908508b238afa13c8cb48a3d82b23210d96337f4
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2012-02-29  Kevin Ollivier  <kevino@theolliviers.com>
2
3         Add JSCore symbol exports needed by wx port
4         https://bugs.webkit.org/show_bug.cgi?id=77280
5
6         Reviewed by Hajime Morita.
7
8         * wtf/ArrayBufferView.h:
9         * wtf/ExportMacros.h:
10
11 2012-02-28  Raphael Kubo da Costa  <kubo@profusion.mobi>
12
13         [CMake] Always build wtf as a static library.
14         https://bugs.webkit.org/show_bug.cgi?id=79857
15
16         Reviewed by Eric Seidel.
17
18         To help the efforts in bug 75673 to move WTF out of
19         JavaScriptCore, act more like the other ports and remove the
20         possibility of building WTF as a shared library.
21
22         It does not make much sense to, for example, ship WTF as a
23         separate .so with webkit-efl packages, and it should be small
24         enough not to cause problems during linking.
25
26         * wtf/CMakeLists.txt:
27
28 2012-02-28  Dmitry Lomov  <dslomov@google.com>
29
30         [JSC] Implement ArrayBuffer transfer
31         https://bugs.webkit.org/show_bug.cgi?id=73493.
32         Implement ArrayBuffer transfer, per Khronos spec:  http://www.khronos.org/registry/typedarray/specs/latest/#9.
33         This brings parity with V8 implementation of transferable typed arrays.
34
35         Reviewed by Oliver Hunt.
36
37         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Extra export.
38         * wtf/ArrayBuffer.h:
39         (ArrayBuffer): Added extra export.
40
41 2012-02-28  Kevin Ollivier  <kevino@theolliviers.com>
42
43         [wx] Unreviewed. Build fix after recent LLInt additions.
44         
45         * wscript:
46
47 2012-02-28  Mark Hahnenberg  <mhahnenberg@apple.com>
48
49         Refactor SpeculativeJIT::emitAllocateJSFinalObject
50         https://bugs.webkit.org/show_bug.cgi?id=79801
51
52         Reviewed by Filip Pizlo.
53
54         * dfg/DFGSpeculativeJIT.h:
55         (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): Split emitAllocateJSFinalObject out to form this
56         function, which is more generic in that it can allocate a variety of classes.
57         (SpeculativeJIT):
58         (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject): Changed to use the new helper function.
59
60 2012-02-28  Gavin Barraclough  <barraclough@apple.com>
61
62         [[Get]]/[[Put]] for primitives should not wrap on strict accessor call
63         https://bugs.webkit.org/show_bug.cgi?id=79588
64
65         Reviewed by Oliver Hunt.
66
67         In the case of [[Get]], this is a pretty trivial bug - just don't wrap
68         primitives at the point you call a getter.
69
70         For setters, this is a little more involved, since we have already wrapped
71         the value up in a synthesized object. Stop doing so. There is also a further
72         subtely, that in strict mode all attempts to create a new data property on
73         the object should throw.
74
75         * runtime/JSCell.cpp:
76         (JSC::JSCell::put):
77             - [[Put]] to a string primitive should use JSValue::putToPrimitive.
78         * runtime/JSObject.cpp:
79         (JSC::JSObject::put):
80             - Remove static function called in one place.
81         * runtime/JSObject.h:
82         (JSC::JSValue::put):
83             - [[Put]] to a non-cell JSValue should use JSValue::putToPrimitive.
84         * runtime/JSValue.cpp:
85         (JSC::JSValue::synthesizePrototype):
86             - Add support for synthesizing the prototype of strings.
87         (JSC::JSValue::putToPrimitive):
88             - Added, implements [[Put]] for primitive bases, per 8.7.2.
89         * runtime/JSValue.h:
90         (JSValue):
91             - Add declaration for JSValue::putToPrimitive.
92         * runtime/PropertySlot.cpp:
93         (JSC::PropertySlot::functionGetter):
94             - Don't call ToObject on primitive this values.
95
96 2012-02-28  Mark Hahnenberg  <mhahnenberg@apple.com>
97
98         Re-enable parallel GC on Mac
99         https://bugs.webkit.org/show_bug.cgi?id=79837
100
101         Rubber stamped by Filip Pizlo.
102
103         * runtime/Options.cpp:
104         (JSC::Options::initializeOptions): We accidentally disabled parallel GC with this line,
105         so we removed it and things should go back to normal.
106
107 2012-02-28  Filip Pizlo  <fpizlo@apple.com>
108
109         Some run-javascriptcore-tests broken for 32-bit debug
110         https://bugs.webkit.org/show_bug.cgi?id=79844
111
112         Rubber stamped by Oliver Hunt.
113         
114         These assertions are just plain wrong for 32-bit. We could either have a massive
115         assertion that depends on value representation, that has to be changed every
116         time we change the JITs, resulting in a bug tail of debug-mode crashes, or we
117         could get rid of the assertions. I pick the latter.
118
119         * dfg/DFGOperations.cpp:
120         * jit/JITStubs.cpp:
121         (JSC::DEFINE_STUB_FUNCTION):
122
123 2012-02-28  Mark Hahnenberg  <mhahnenberg@apple.com>
124
125         Get rid of padding cruft in CopiedBlock
126         https://bugs.webkit.org/show_bug.cgi?id=79686
127
128         Reviewed by Filip Pizlo.
129
130         * heap/CopiedBlock.h:
131         (CopiedBlock): Removed the extra padding that was used for alignment purposes until 
132         the calculation of the payload offset into CopiedBlocks was redone recently.
133
134 2012-02-28  Anders Carlsson  <andersca@apple.com>
135
136         Fix build with newer versions of clang.
137
138         Clang now warns since we're not passing a CFString literal to CFStringCreateWithFormatAndArguments,
139         but it's OK to ignore this warning since clang is also checking that the caller (vprintf_stderr_common)
140         takes a string literal.
141
142         * wtf/Assertions.cpp:
143
144 2012-02-28  Mario Sanchez Prada  <msanchez@igalia.com>
145
146         [GTK] Add GMainLoop and GMainContext to be handled by GRefPtr
147         https://bugs.webkit.org/show_bug.cgi?id=79496
148
149         Reviewed by Martin Robinson.
150
151         Handle GMainLoop and GMainContext in GRefPtr, by calling
152         g_main_loop_(un)ref and g_main_context_(un)ref in the
153         implementation of the refGPtr and derefGPtr template functions.
154
155         * wtf/gobject/GRefPtr.cpp:
156         (WTF::refGPtr):
157         (WTF):
158         (WTF::derefGPtr):
159         * wtf/gobject/GRefPtr.h:
160         (WTF):
161         * wtf/gobject/GTypedefs.h:
162
163 2012-02-28  Yong Li  <yoli@rim.com>
164
165         JSString::resolveRope() should report extra memory cost to the heap.
166         https://bugs.webkit.org/show_bug.cgi?id=79555
167
168         Reviewed by Michael Saboff.
169
170         At the time a JSString is constructed with fibers, it doesn't report
171         extra memory cost, which is reasonable because it hasn't allocate
172         new memory. However when the rope is resolved, it should report meory
173         cost for the new buffer.
174
175         * runtime/JSString.cpp:
176         (JSC::JSString::resolveRope):
177
178 2012-02-27  Oliver Hunt  <oliver@apple.com>
179
180         sputnik/Unicode/Unicode_500/S7.2_A1.6_T1.html crashes in the interpreter
181         https://bugs.webkit.org/show_bug.cgi?id=79728
182
183         Reviewed by Gavin Barraclough.
184
185         When initialising a chained get instruction we may end up in a state where
186         the instruction stream says we have a scopechain, but it has not yet been set
187         (eg. if allocating the StructureChain itself is what leads to the GC).  We could
188         re-order the allocation, but it occurs in a couple of places, so it seems less
189         fragile simply to null check the scopechain slot before we actually visit the slot.
190
191         * bytecode/CodeBlock.cpp:
192         (JSC::CodeBlock::visitStructures):
193
194 2012-02-27  Filip Pizlo  <fpizlo@apple.com>
195
196         Old JIT's style of JSVALUE64 strict equality is subtly wrong
197         https://bugs.webkit.org/show_bug.cgi?id=79700
198
199         Reviewed by Oliver Hunt.
200
201         * assembler/MacroAssemblerX86_64.h:
202         (JSC::MacroAssemblerX86_64::comparePtr):
203         (MacroAssemblerX86_64):
204         * dfg/DFGOperations.cpp:
205         * dfg/DFGSpeculativeJIT.cpp:
206         (JSC::DFG::SpeculativeJIT::nonSpeculativeStrictEq):
207         * dfg/DFGSpeculativeJIT64.cpp:
208         (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
209         (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq):
210         * jit/JITOpcodes.cpp:
211         (JSC::JIT::compileOpStrictEq):
212         (JSC::JIT::emitSlow_op_stricteq):
213         (JSC::JIT::emitSlow_op_nstricteq):
214         * jit/JITStubs.cpp:
215         (JSC::DEFINE_STUB_FUNCTION):
216
217 2012-02-27  Gavin Barraclough  <barraclough@apple.com>
218
219         Implement support for op_negate and op_bitnot in the DFG JIT
220         https://bugs.webkit.org/show_bug.cgi?id=79617
221
222         Reviewed by Filip Pizlo.
223
224         Add an ArithNegate op to the DFG JIT, to implement op_negate.
225
226         This patch also adds support for op_negate to the JSVALUE64 baseline JIT
227         (JSVALUE32_64 already had this), so that we can profile the slowpath usage.
228
229         This is a 2.5%-3% Sunspider progression and a 1% win on Kraken.
230
231         * assembler/ARMv7Assembler.h:
232         (JSC::ARMv7Assembler::sub_S):
233             - Added sub_S from immediate.
234         (ARMv7Assembler):
235         (JSC::ARMv7Assembler::vneg):
236             - Added double negate.
237         * assembler/MacroAssemblerARMv7.h:
238         (JSC::MacroAssemblerARMv7::negateDouble):
239             - Added double negate.
240         (MacroAssemblerARMv7):
241         (JSC::MacroAssemblerARMv7::branchNeg32):
242             - Added.
243         * assembler/MacroAssemblerX86.h:
244         (MacroAssemblerX86):
245             - moved loadDouble, absDouble to common.
246         * assembler/MacroAssemblerX86Common.h:
247         (MacroAssemblerX86Common):
248         (JSC::MacroAssemblerX86Common::absDouble):
249             - implementation can be shared.
250         (JSC::MacroAssemblerX86Common::negateDouble):
251             - Added.
252         (JSC::MacroAssemblerX86Common::loadDouble):
253             - allow absDouble to have a common implementation.
254         * assembler/MacroAssemblerX86_64.h:
255         (MacroAssemblerX86_64):
256             - moved loadDouble, absDouble to common.
257         * dfg/DFGAbstractState.cpp:
258         (JSC::DFG::AbstractState::execute):
259             - support ArithNegate.
260         * dfg/DFGArithNodeFlagsInferencePhase.cpp:
261         (JSC::DFG::ArithNodeFlagsInferencePhase::propagate):
262             - support ArithNegate.
263         * dfg/DFGByteCodeParser.cpp:
264         (JSC::DFG::ByteCodeParser::makeSafe):
265             - support ArithNegate.
266         (JSC::DFG::ByteCodeParser::parseBlock):
267             - support op_negate.
268         * dfg/DFGCSEPhase.cpp:
269         (JSC::DFG::CSEPhase::performNodeCSE):
270             - support ArithNegate.
271         * dfg/DFGCapabilities.h:
272         (JSC::DFG::canCompileOpcode):
273             - support op_negate.
274         * dfg/DFGGraph.h:
275         (JSC::DFG::Graph::negateShouldSpeculateInteger):
276             - support ArithNegate.
277         * dfg/DFGNode.h:
278         (JSC::DFG::Node::hasArithNodeFlags):
279             - support ArithNegate.
280         * dfg/DFGPredictionPropagationPhase.cpp:
281         (JSC::DFG::PredictionPropagationPhase::propagate):
282             - support ArithNegate.
283         * dfg/DFGSpeculativeJIT.cpp:
284         (JSC::DFG::SpeculativeJIT::compileArithNegate):
285             - support ArithNegate.
286         * dfg/DFGSpeculativeJIT.h:
287         (SpeculativeJIT):
288             - support ArithNegate.
289         * dfg/DFGSpeculativeJIT32_64.cpp:
290         (JSC::DFG::SpeculativeJIT::compile):
291             - support ArithNegate.
292         * dfg/DFGSpeculativeJIT64.cpp:
293         (JSC::DFG::SpeculativeJIT::compile):
294             - support ArithNegate.
295         * jit/JIT.cpp:
296         (JSC::JIT::privateCompileMainPass):
297         (JSC::JIT::privateCompileSlowCases):
298             - Add support for op_negate in JSVALUE64.
299         * jit/JITArithmetic.cpp:
300         (JSC::JIT::emit_op_negate):
301         (JSC::JIT::emitSlow_op_negate):
302             - Add support for op_negate in JSVALUE64.
303
304 2012-02-27  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
305
306         Unreviewed. Build fix for linux-bot (qt) after r109021.
307
308         * runtime/Error.cpp:
309
310 2012-02-27  Oliver Hunt  <oliver@apple.com>
311
312         REGRESSION (r108112): AWS Management Console at amazon.com fails to initialize
313         https://bugs.webkit.org/show_bug.cgi?id=79693
314
315         Reviewed by Filip Pizlo.
316
317         Alas we can't provide the stack trace as an array, as despite everyone wanting
318         an array, everyone arbitrarily creates the array by calling split on the stack
319         trace.  To create the array we would have provided them in the first place.
320
321         This changes the exception's stack property to a \n separated string.  To get the
322         old array just do <exception>.stack.split("\n").
323
324         * runtime/Error.cpp:
325         (JSC::addErrorInfo):
326
327 2012-02-27  Gavin Barraclough  <barraclough@apple.com>
328
329         RegExp lastIndex should behave as a regular property
330         https://bugs.webkit.org/show_bug.cgi?id=79446
331
332         Reviewed by Sam Weinig.
333
334         lastIndex should be a regular data descriptor, with the attributes configurable:false,
335         enumerable:false, writable:true. As such, it should be possible to reconfigure writable
336         as false. If the lastIndex property is reconfigured to be read-only, we should respect
337         this correctly.
338
339         * runtime/CommonIdentifiers.h:
340             - Removed some unused identifiers, added lastIndex.
341         * runtime/RegExpObject.cpp:
342         (JSC::RegExpObject::getOwnPropertySlot):
343             - lastIndex is no longer a static value, provided specific handling.
344         (JSC::RegExpObject::getOwnPropertyDescriptor):
345             - lastIndex is no longer a static value, provided specific handling.
346         (JSC::RegExpObject::deleteProperty):
347             - lastIndex is no longer a static value, provided specific handling.
348         (JSC::RegExpObject::getOwnPropertyNames):
349             - lastIndex is no longer a static value, provided specific handling.
350         (JSC::RegExpObject::getPropertyNames):
351             - lastIndex is no longer a static value, provided specific handling.
352         (JSC::reject):
353             - helper function for defineOwnProperty.
354         (JSC::RegExpObject::defineOwnProperty):
355             - lastIndex is no longer a static value, provided specific handling.
356         (JSC::RegExpObject::put):
357             - lastIndex is no longer a static value, provided specific handling.
358         (JSC::RegExpObject::match):
359             - Pass setLastIndex an ExecState, so it can throw if read-only.
360         * runtime/RegExpObject.h:
361         (JSC::RegExpObject::setLastIndex):
362             - Pass setLastIndex an ExecState, so it can throw if read-only.
363         (RegExpObjectData):
364             - Added lastIndexIsWritable.
365         * runtime/RegExpPrototype.cpp:
366         (JSC::regExpProtoFuncCompile):
367             - Pass setLastIndex an ExecState, so it can throw if read-only.
368
369 2012-02-27  Gavin Barraclough  <barraclough@apple.com>
370
371         Implement support for op_negate and op_bitnot in the DFG JIT
372         https://bugs.webkit.org/show_bug.cgi?id=79617
373
374         Reviewed by Sam Weinig.
375
376         Remove op_bitnop - this is redundant, ~x === x^-1.
377         This is a fractional (<1%) progression.
378
379         Remove not32(X) from the MacroAssemblers - make this an optimization to add32(-1, X).
380         Remove CanReuse from the result type - this was unused.
381         Remove op_bitnot.
382
383         * assembler/MacroAssemblerARM.h:
384         (MacroAssemblerARM):
385         (JSC::MacroAssemblerARM::xor32):
386         * assembler/MacroAssemblerARMv7.h:
387         (MacroAssemblerARMv7):
388         (JSC::MacroAssemblerARMv7::xor32):
389         * assembler/MacroAssemblerMIPS.h:
390         (MacroAssemblerMIPS):
391         (JSC::MacroAssemblerMIPS::xor32):
392         * assembler/MacroAssemblerSH4.h:
393         (MacroAssemblerSH4):
394         (JSC::MacroAssemblerSH4::xor32):
395         * assembler/MacroAssemblerX86Common.h:
396         (MacroAssemblerX86Common):
397         (JSC::MacroAssemblerX86Common::xor32):
398         * bytecode/CodeBlock.cpp:
399         (JSC::CodeBlock::dump):
400         * bytecode/Opcode.h:
401         (JSC):
402         (JSC::padOpcodeName):
403         * bytecompiler/NodesCodegen.cpp:
404         (JSC):
405         (JSC::BitwiseNotNode::emitBytecode):
406         * interpreter/Interpreter.cpp:
407         (JSC::Interpreter::privateExecute):
408         * jit/JIT.cpp:
409         (JSC::JIT::privateCompileMainPass):
410         (JSC::JIT::privateCompileSlowCases):
411         * jit/JIT.h:
412         (JIT):
413         * jit/JITArithmetic32_64.cpp:
414         (JSC):
415         * jit/JITOpcodes.cpp:
416         (JSC):
417         * jit/JITStubs.cpp:
418         (JSC):
419         * jit/JITStubs.h:
420         * llint/LLIntSlowPaths.cpp:
421         (LLInt):
422         * llint/LLIntSlowPaths.h:
423         (LLInt):
424         * llint/LowLevelInterpreter32_64.asm:
425         * parser/NodeConstructors.h:
426         (JSC::NegateNode::NegateNode):
427         (JSC::BitwiseNotNode::BitwiseNotNode):
428         (JSC::MultNode::MultNode):
429         (JSC::DivNode::DivNode):
430         (JSC::ModNode::ModNode):
431         (JSC::SubNode::SubNode):
432         (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
433         * parser/Nodes.h:
434         (BitwiseNotNode):
435         (JSC::BitwiseNotNode::expr):
436         (JSC):
437         * parser/ResultType.h:
438         (ResultType):
439         (JSC::ResultType::numberTypeIsInt32):
440         (JSC::ResultType::stringOrNumberType):
441         (JSC::ResultType::forAdd):
442         (JSC::ResultType::forBitOp):
443
444 2012-02-27  Michael Saboff  <msaboff@apple.com>
445
446         Error check regexp min quantifier
447         https://bugs.webkit.org/show_bug.cgi?id=70648
448
449         Reviewed by Gavin Barraclough.
450
451         Added checking for min or only quantifier being UINT_MAX.
452         When encountered this becomes a SyntaxError during parsing.
453
454         * yarr/YarrParser.h:
455         (JSC::Yarr::Parser::parseQuantifier):
456         (JSC::Yarr::Parser::parse):
457         (Parser):
458
459 2012-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
460
461         Unreviewed. Fix make distcheck.
462
463         * GNUmakefile.list.am: Add missing files.
464
465 2012-02-26  Hajime Morrita  <morrita@chromium.org>
466
467         Move ChromeClient::showContextMenu() to ContextMenuClient
468         https://bugs.webkit.org/show_bug.cgi?id=79427
469
470         Reviewed by Adam Barth.
471
472         Added ACCESSIBILITY_CONTEXT_MENUS.
473
474         * wtf/Platform.h:
475
476 2012-02-26  Filip Pizlo  <fpizlo@apple.com>
477
478         LayoutTests/fast/xpath/xpath-functional-test.html is crashing in the DFG
479         https://bugs.webkit.org/show_bug.cgi?id=79616
480
481         Reviewed by Oliver Hunt.
482         
483         Guard against the fact that in JSVALUE64, JSValue().isCell() == true.
484
485         * dfg/DFGAbstractValue.h:
486         (JSC::DFG::AbstractValue::validate):
487
488 2012-02-26  Filip Pizlo  <fpizlo@apple.com>
489
490         DFG should support activations and nested functions
491         https://bugs.webkit.org/show_bug.cgi?id=79554
492
493         Reviewed by Sam Weinig.
494         
495         Fix 32-bit. The 32-bit function+activation code had some really weird
496         register reuse bugs.
497
498         * dfg/DFGSpeculativeJIT32_64.cpp:
499         (JSC::DFG::SpeculativeJIT::compile):
500
501 2012-02-26  Filip Pizlo  <fpizlo@apple.com>
502
503         Getting the instruction stream for a code block should not require two loads
504         https://bugs.webkit.org/show_bug.cgi?id=79608
505
506         Reviewed by Sam Weinig.
507         
508         Introduced the RefCountedArray class, which contains a single inline pointer
509         to a ref-counted non-resizeable vector backing store. This satisfies the
510         requirements of CodeBlock, which desires the ability to share instruction
511         streams with other CodeBlocks. It also reduces the number of loads required
512         for getting the instruction stream by one.
513         
514         This patch also gets rid of the bytecode discarding logic, since we don't
515         use it anymore and it's unlikely to ever work right with DFG or LLInt. And
516         I didn't feel like porting dead code to use RefCountedArray.
517
518         * GNUmakefile.list.am:
519         * JavaScriptCore.xcodeproj/project.pbxproj:
520         * bytecode/CodeBlock.cpp:
521         (JSC::instructionOffsetForNth):
522         (JSC::CodeBlock::dump):
523         (JSC::CodeBlock::CodeBlock):
524         (JSC::CodeBlock::finalizeUnconditionally):
525         (JSC::CodeBlock::handlerForBytecodeOffset):
526         (JSC::CodeBlock::lineNumberForBytecodeOffset):
527         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
528         (JSC::CodeBlock::shrinkToFit):
529         * bytecode/CodeBlock.h:
530         (CodeBlock):
531         (JSC::CodeBlock::numberOfInstructions):
532         (JSC::CodeBlock::instructions):
533         (JSC::CodeBlock::instructionCount):
534         (JSC::CodeBlock::valueProfileForBytecodeOffset):
535         (JSC):
536         * bytecompiler/BytecodeGenerator.cpp:
537         (JSC::Label::setLocation):
538         (JSC):
539         (JSC::BytecodeGenerator::generate):
540         (JSC::BytecodeGenerator::newLabel):
541         * bytecompiler/BytecodeGenerator.h:
542         (JSC):
543         (BytecodeGenerator):
544         (JSC::BytecodeGenerator::instructions):
545         * bytecompiler/Label.h:
546         (JSC::Label::Label):
547         (Label):
548         * dfg/DFGByteCodeCache.h:
549         (JSC::DFG::ByteCodeCache::~ByteCodeCache):
550         (JSC::DFG::ByteCodeCache::get):
551         * jit/JITExceptions.cpp:
552         (JSC::genericThrow):
553         * llint/LowLevelInterpreter32_64.asm:
554         * runtime/Executable.cpp:
555         (JSC::EvalExecutable::compileInternal):
556         (JSC::ProgramExecutable::compileInternal):
557         (JSC::FunctionExecutable::codeBlockWithBytecodeFor):
558         (JSC::FunctionExecutable::produceCodeBlockFor):
559         * wtf/RefCountedArray.h: Added.
560         (WTF):
561         (RefCountedArray):
562         (WTF::RefCountedArray::RefCountedArray):
563         (WTF::RefCountedArray::operator=):
564         (WTF::RefCountedArray::~RefCountedArray):
565         (WTF::RefCountedArray::size):
566         (WTF::RefCountedArray::data):
567         (WTF::RefCountedArray::begin):
568         (WTF::RefCountedArray::end):
569         (WTF::RefCountedArray::at):
570         (WTF::RefCountedArray::operator[]):
571         (Header):
572         (WTF::RefCountedArray::Header::size):
573         (WTF::RefCountedArray::Header::payload):
574         (WTF::RefCountedArray::Header::fromPayload):
575         * wtf/Platform.h:
576
577 2012-02-26  Yusuke Suzuki  <utatane.tea@gmail.com>
578
579         StringLiteral and NumericLiteral are allowed as ObjectLiteral getter / setter name
580         https://bugs.webkit.org/show_bug.cgi?id=79571
581
582         Reviewed by Gavin Barraclough.
583
584         * parser/ASTBuilder.h:
585         (JSC::ASTBuilder::createGetterOrSetterProperty):
586         * parser/Parser.cpp:
587         (JSC::::parseProperty):
588         * parser/SyntaxChecker.h:
589         (JSC::SyntaxChecker::createGetterOrSetterProperty):
590
591 2012-02-26  Mark Hahnenberg  <mhahnenberg@apple.com>
592
593         Implement fast path for op_new_array in the baseline JIT
594         https://bugs.webkit.org/show_bug.cgi?id=78612
595
596         Reviewed by Filip Pizlo.
597
598         heap/CopiedAllocator.h:
599         (CopiedAllocator): Friended the JIT to allow access to m_currentOffset.
600         * heap/CopiedSpace.h:
601         (CopiedSpace): Friended the JIT to allow access to isOversize.
602         (JSC::CopiedSpace::allocator):
603         * heap/Heap.h:
604         (JSC::Heap::storageAllocator): Added a getter for the CopiedAllocator class so the JIT
605         can use it for simple allocation i.e. when we can just bump the offset without having to 
606         do anything else.
607         * jit/JIT.cpp:
608         (JSC::JIT::privateCompileSlowCases): Added new slow case for op_new_array for when
609         we have to bail out because the fast allocation path fails for whatever reason.
610         * jit/JIT.h:
611         (JIT):
612         * jit/JITInlineMethods.h:
613         (JSC::JIT::emitAllocateBasicStorage): Added utility function that allows objects to 
614         allocate generic backing stores. This function is used by emitAllocateJSArray.
615         (JSC):
616         (JSC::JIT::emitAllocateJSArray): Added utility function that allows the client to 
617         more easily allocate JSArrays. This function is used by emit_op_new_array and I expect 
618         it will also be used for emit_op_new_array_buffer.
619         * jit/JITOpcodes.cpp:
620         (JSC::JIT::emit_op_new_array): Changed to do inline allocation of JSArrays. Still does 
621         a stub call for oversize arrays.
622         (JSC):
623         (JSC::JIT::emitSlow_op_new_array): New slow path that just bails out to a stub call if we 
624         fail in any way on the fast path.
625         * runtime/JSArray.cpp:
626         (JSC):
627         * runtime/JSArray.h: Added lots of offset functions for all the fields that we need to 
628         initialize in the JIT.
629         (ArrayStorage):
630         (JSC::ArrayStorage::lengthOffset):
631         (JSC::ArrayStorage::numValuesInVectorOffset):
632         (JSC::ArrayStorage::allocBaseOffset):
633         (JSC::ArrayStorage::vectorOffset):
634         (JSArray):
635         (JSC::JSArray::sparseValueMapOffset):
636         (JSC::JSArray::subclassDataOffset):
637         (JSC::JSArray::indexBiasOffset):
638         (JSC):
639         (JSC::JSArray::storageSize): Moved this function from being a static function in the cpp file
640         to being a static function in the JSArray class. This move allows the JIT to call it to 
641         see what size it should allocate.
642
643 2012-02-26  Patrick Gansterer  <paroga@webkit.org>
644
645         Unreviewed. Build fix for ENABLE(CLASSIC_INTERPRETER) after r108681.
646
647         * interpreter/Interpreter.cpp:
648         (JSC::getLineNumberForCallFrame):
649         (JSC::Interpreter::getStackTrace):
650
651 2012-02-26  Patrick Gansterer  <paroga@webkit.org>
652
653         Unreviewed. Build fix for !ENABLE(JIT) after r108681.
654
655         * interpreter/Interpreter.cpp:
656         (JSC::getLineNumberForCallFrame):
657
658 2012-02-25  Filip Pizlo  <fpizlo@apple.com>
659
660         LLInt assembly file should be split into 32-bit and 64-bit parts
661         https://bugs.webkit.org/show_bug.cgi?id=79584
662
663         Reviewed by Sam Weinig.
664         
665         Moved LowLevelInterpreter.asm to LowLevelInterpreter32_64.asm. Gave offlineasm
666         the ability to include files, and correctly track dependencies: it restricts
667         the include mechanism to using the same directory as the source file, and uses
668         the SHA1 hash of all .asm files in that directory as an input hash.
669
670         * llint/LLIntOfflineAsmConfig.h:
671         * llint/LowLevelInterpreter.asm:
672         * llint/LowLevelInterpreter32_64.asm: Added.
673             - This is just the entire contents of what was previously LowLevelInterpreter.asm
674         * llint/LowLevelInterpreter64.asm: Added.
675         * offlineasm/asm.rb:
676         * offlineasm/ast.rb:
677         * offlineasm/generate_offset_extractor.rb:
678         * offlineasm/parser.rb:
679         * offlineasm/self_hash.rb:
680
681 2012-02-25  Filip Pizlo  <fpizlo@apple.com>
682
683         Offlineasm should support X86_64
684         https://bugs.webkit.org/show_bug.cgi?id=79581
685
686         Reviewed by Oliver Hunt.
687
688         * llint/LLIntOfflineAsmConfig.h:
689         * offlineasm/backends.rb:
690         * offlineasm/instructions.rb:
691         * offlineasm/settings.rb:
692         * offlineasm/x86.rb:
693
694 2012-02-25  Filip Pizlo  <fpizlo@apple.com>
695
696         DFG should support activations and nested functions
697         https://bugs.webkit.org/show_bug.cgi?id=79554
698
699         Reviewed by Oliver Hunt.
700         
701         Wrote the simplest possible implementation of activations. Big speed-up on
702         code that uses activations, no speed-up on major benchmarks (SunSpider, V8,
703         Kraken) because they do not appear to have sufficient coverage over code
704         that uses activations.
705
706         * bytecode/PredictedType.cpp:
707         (JSC::predictionToString):
708         (JSC::predictionFromValue):
709         * bytecode/PredictedType.h:
710         (JSC):
711         (JSC::isEmptyPrediction):
712         * dfg/DFGAbstractState.cpp:
713         (JSC::DFG::AbstractState::execute):
714         * dfg/DFGByteCodeParser.cpp:
715         (JSC::DFG::ByteCodeParser::ByteCodeParser):
716         (ByteCodeParser):
717         (JSC::DFG::ByteCodeParser::parseBlock):
718         (JSC::DFG::ByteCodeParser::buildOperandMapsIfNecessary):
719         (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
720         (JSC::DFG::ByteCodeParser::parse):
721         * dfg/DFGCapabilities.h:
722         (JSC::DFG::canCompileOpcode):
723         (JSC::DFG::canInlineOpcode):
724         * dfg/DFGGraph.h:
725         (JSC::DFG::Graph::needsActivation):
726         * dfg/DFGNode.h:
727         (DFG):
728         (JSC::DFG::Node::storageAccessDataIndex):
729         (Node):
730         (JSC::DFG::Node::hasFunctionDeclIndex):
731         (JSC::DFG::Node::functionDeclIndex):
732         (JSC::DFG::Node::hasFunctionExprIndex):
733         (JSC::DFG::Node::functionExprIndex):
734         * dfg/DFGOperations.cpp:
735         * dfg/DFGOperations.h:
736         * dfg/DFGPredictionPropagationPhase.cpp:
737         (JSC::DFG::PredictionPropagationPhase::propagate):
738         * dfg/DFGSpeculativeJIT.cpp:
739         (JSC::DFG::SpeculativeJIT::compileNewFunctionNoCheck):
740         (DFG):
741         (JSC::DFG::SpeculativeJIT::compileNewFunctionExpression):
742         * dfg/DFGSpeculativeJIT.h:
743         (JSC::DFG::SpeculativeJIT::callOperation):
744         * dfg/DFGSpeculativeJIT32_64.cpp:
745         (JSC::DFG::SpeculativeJIT::compile):
746         * dfg/DFGSpeculativeJIT64.cpp:
747         (JSC::DFG::SpeculativeJIT::compile):
748
749 2012-02-25  Benjamin Poulain  <benjamin@webkit.org>
750
751         Add an empty skeleton of KURL for WTFURL
752         https://bugs.webkit.org/show_bug.cgi?id=78990
753
754         Reviewed by Adam Barth.
755
756         * JavaScriptCore.xcodeproj/project.pbxproj: Export the relevant classes from WTFURL
757         so that can use them in WebCore.
758
759 2012-02-25  Filip Pizlo  <fpizlo@apple.com>
760
761         Unreviewed, fix build for DFG disabled and LLInt enabled.
762
763         * jit/JIT.cpp:
764         (JSC::JIT::privateCompile):
765         * llint/LLIntSlowPaths.cpp:
766         (LLInt):
767         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
768
769 2012-02-25  Mark Hahnenberg  <mhahnenberg@apple.com>
770
771         Fix the CopiedBlock offset alignment in a cross platform fashion
772         https://bugs.webkit.org/show_bug.cgi?id=79556
773
774         Reviewed by Filip Pizlo.
775
776         Replaced m_payload with a payload() method that calculates the offset
777         of the payload with the proper alignment. This change allows us to 
778         avoid alignment-related issues in a cross-platform manner.
779
780         * heap/CopiedAllocator.h:
781         (JSC::CopiedAllocator::currentUtilization):
782         * heap/CopiedBlock.h:
783         (JSC::CopiedBlock::CopiedBlock):
784         (JSC::CopiedBlock::payload):
785         (CopiedBlock):
786         * heap/CopiedSpace.cpp:
787         (JSC::CopiedSpace::doneFillingBlock):
788         * heap/CopiedSpaceInlineMethods.h:
789         (JSC::CopiedSpace::borrowBlock):
790         (JSC::CopiedSpace::allocateFromBlock):
791
792 2012-02-24  Michael Saboff  <msaboff@apple.com>
793
794         Unreviewed, Windows build fix.  Changed signature in export to match
795         change made in r108858.
796
797         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
798
799 2012-02-24  Filip Pizlo  <fpizlo@apple.com>
800
801         DFG support for op_new_regexp should be enabled
802         https://bugs.webkit.org/show_bug.cgi?id=79538
803
804         Reviewed by Oliver Hunt.
805         
806         No performance change.
807
808         * dfg/DFGCapabilities.h:
809         (JSC::DFG::canCompileOpcode):
810         * dfg/DFGCommon.h:
811
812 2012-02-24  Michael Saboff  <msaboff@apple.com>
813
814         ASSERT(position < 0) in JSC::Yarr::Interpreter::InputStream::readChecked
815         https://bugs.webkit.org/show_bug.cgi?id=73728
816
817         Reviewed by Gavin Barraclough.
818
819         Fixed the mixing of signed and unsigned character indeces in YARR
820         interpreter.
821
822         * runtime/RegExp.cpp:
823         (JSC::RegExp::match): Added code to check for match longer than 2^31 and
824         return no match after resetting the offsets.
825         * yarr/YarrInterpreter.cpp: Changed to use unsigned for all character index
826         handling except when matching back references.
827         (JSC::Yarr::Interpreter::InputStream::readChecked):
828         (JSC::Yarr::Interpreter::InputStream::checkInput):
829         (JSC::Yarr::Interpreter::InputStream::uncheckInput):
830         (JSC::Yarr::Interpreter::InputStream::atStart):
831         (JSC::Yarr::Interpreter::InputStream::atEnd):
832         (JSC::Yarr::Interpreter::InputStream::isAvailableInput):
833         (JSC::Yarr::Interpreter::checkCharacter):
834         (JSC::Yarr::Interpreter::checkCasedCharacter):
835         (JSC::Yarr::Interpreter::checkCharacterClass):
836         (JSC::Yarr::Interpreter::tryConsumeBackReference):
837         (JSC::Yarr::Interpreter::matchAssertionBOL):
838         (JSC::Yarr::Interpreter::matchAssertionWordBoundary):
839         (JSC::Yarr::Interpreter::backtrackPatternCharacter):
840         (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
841         (JSC::Yarr::Interpreter::matchCharacterClass):
842         (JSC::Yarr::Interpreter::backtrackCharacterClass):
843         (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
844         (JSC::Yarr::Interpreter::matchDisjunction):
845         (JSC::Yarr::Interpreter::interpret):
846         (JSC::Yarr::ByteCompiler::assertionBOL):
847         (JSC::Yarr::ByteCompiler::assertionEOL):
848         (JSC::Yarr::ByteCompiler::assertionWordBoundary):
849         (JSC::Yarr::ByteCompiler::atomPatternCharacter):
850         (JSC::Yarr::ByteCompiler::atomCharacterClass):
851         (JSC::Yarr::ByteCompiler::atomBackReference):
852         (JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
853         (JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
854         (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
855         (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd):
856         (JSC::Yarr::ByteCompiler::emitDisjunction):
857         * yarr/YarrInterpreter.h:
858
859 2012-02-24  Filip Pizlo  <fpizlo@apple.com>
860
861         Unreviewed, build fix for builds where the DFG is disabled but the LLInt is
862         enabled.
863
864         * llint/LLIntOfflineAsmConfig.h:
865         * llint/LowLevelInterpreter.asm:
866
867 2012-02-24  Filip Pizlo  <fpizlo@apple.com>
868
869         DFG should be able to handle variables getting captured
870         https://bugs.webkit.org/show_bug.cgi?id=79469
871
872         Reviewed by Oliver Hunt.
873         
874         Made captured variables work by placing a Flush on the SetLocal and
875         forcing the emission of the GetLocal even if copy propagation tells us
876         who has the value.
877         
878         Changed the CFA and various prediction codes to understand that we can't
879         really prove anything about captured variables. Well, we could in the
880         future by just looking at what side effects are happening, but in this
881         first cut we just assume that we can't reason about captured variables.
882         
883         Also added a mode where the DFG pretends that all variables and arguments
884         got captured. Used this mode to harden the code.
885         
886         This is performance neutral. Capturing all variables is a slow down, but
887         not too big of one. This seems to predict that when we add activation
888         support, the amount of speed benefit we'll get from increased coverage
889         will far outweigh the pessimism that we'll have to endure for captured
890         variables.
891
892         * bytecode/CodeType.h:
893         (JSC::codeTypeToString):
894         * dfg/DFGAbstractState.cpp:
895         (JSC::DFG::AbstractState::initialize):
896         (JSC::DFG::AbstractState::endBasicBlock):
897         (JSC::DFG::AbstractState::execute):
898         (JSC::DFG::AbstractState::merge):
899         * dfg/DFGAbstractState.h:
900         (AbstractState):
901         * dfg/DFGByteCodeParser.cpp:
902         (JSC::DFG::ByteCodeParser::getLocal):
903         (JSC::DFG::ByteCodeParser::setLocal):
904         (JSC::DFG::ByteCodeParser::getArgument):
905         (JSC::DFG::ByteCodeParser::setArgument):
906         (JSC::DFG::ByteCodeParser::flushArgument):
907         (JSC::DFG::ByteCodeParser::handleInlining):
908         (JSC::DFG::ByteCodeParser::processPhiStack):
909         (JSC::DFG::ByteCodeParser::parseCodeBlock):
910         (JSC::DFG::ByteCodeParser::parse):
911         * dfg/DFGCapabilities.h:
912         (JSC::DFG::mightInlineFunctionForCall):
913         (JSC::DFG::mightInlineFunctionForConstruct):
914         * dfg/DFGCommon.h:
915         * dfg/DFGGraph.h:
916         (JSC::DFG::Graph::needsActivation):
917         (Graph):
918         (JSC::DFG::Graph::argumentIsCaptured):
919         (JSC::DFG::Graph::localIsCaptured):
920         (JSC::DFG::Graph::isCaptured):
921         * dfg/DFGNode.h:
922         (JSC::DFG::Node::shouldGenerate):
923         * dfg/DFGPredictionPropagationPhase.cpp:
924         (JSC::DFG::PredictionPropagationPhase::propagate):
925         (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
926         * dfg/DFGSpeculativeJIT.cpp:
927         (DFG):
928         (JSC::DFG::ValueSource::dump):
929         (JSC::DFG::SpeculativeJIT::compile):
930         * dfg/DFGSpeculativeJIT.h:
931         (ValueSource):
932         * dfg/DFGSpeculativeJIT32_64.cpp:
933         (JSC::DFG::SpeculativeJIT::compile):
934         * dfg/DFGSpeculativeJIT64.cpp:
935         (JSC::DFG::SpeculativeJIT::compile):
936         * dfg/DFGVirtualRegisterAllocationPhase.cpp:
937         (JSC::DFG::VirtualRegisterAllocationPhase::run):
938
939 2012-02-24  Gavin Barraclough  <barraclough@apple.com>
940
941         Should not allow malformed \x escapes
942         https://bugs.webkit.org/show_bug.cgi?id=79462
943
944         Reviewed by Oliver Hunt.
945
946         * parser/Lexer.cpp:
947         (JSC::::parseString):
948         (JSC::::parseStringSlowCase):
949             - Prohibit malformed '\x' escapes
950         * tests/mozilla/ecma/Array/15.4.5.1-1.js:
951         * tests/mozilla/ecma/LexicalConventions/7.7.4.js:
952         * tests/mozilla/ecma_2/RegExp/hex-001.js:
953         * tests/mozilla/js1_2/regexp/hexadecimal.js:
954             - Remove erroneous test cases (correct behaviour is tested by LayoutTests/sputnik).
955
956 2012-02-24  Daniel Bates  <dbates@webkit.org>
957
958         Fix change log entry for changeset r108819; add bug URL
959         https://bugs.webkit.org/show_bug.cgi?id=79504
960
961         Changeset r108819 is associated with bug #79504.
962
963         * ChangeLog
964
965 2012-02-24  Daniel Bates  <dbates@webkit.org>
966
967         Substitute ENABLE(CLASSIC_INTERPRETER) for ENABLE(INTERPRETER) in Interpreter.cpp
968         https://bugs.webkit.org/show_bug.cgi?id=79504
969
970         Reviewed by Oliver Hunt.
971
972         There are a few places in Interpreter.cpp that need to be updated to use
973         ENABLE(CLASSIC_INTERPRETER) following the renaming of ENABLE_INTERPRETER to
974         ENABLE_CLASSIC_INTERPRETER in changeset <http://trac.webkit.org/changeset/108020>
975         (https://bugs.webkit.org/show_bug.cgi?id=78791).
976
977         * interpreter/Interpreter.cpp:
978         (JSC::getLineNumberForCallFrame):
979         (JSC::getCallerInfo):
980         (JSC::getSourceURLFromCallFrame):
981
982 2012-02-24  Adam Roben  <aroben@apple.com>
983
984         Undo the BUILDING_WTF part of r108808
985
986         This broke the build, which is obviously worse than the linker warning it was trying to
987         solve.
988
989         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
990
991 2012-02-24  Adam Roben  <aroben@apple.com>
992
993         Fix linker warnings on Windows
994
995         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Removed symbols that are already
996         exported via JS_EXPORTDATA.
997
998         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Define BUILDING_WTF. We
999         aren't actually building WTF, but we are statically linking it, so we need to define this
1000         symbol so that we export WTF's exports.
1001
1002 2012-02-24  Philippe Normand  <pnormand@igalia.com>
1003
1004         Fix GTK WebAudio build for WebKitGTK 1.7.90.
1005
1006         Patch by Priit Laes <plaes@plaes.org> on 2012-02-24
1007         Rubber-stamped by Philippe Normand.
1008
1009         * GNUmakefile.list.am: Add Complex.h to the list of files so it
1010         gets disted in the tarballs.
1011
1012 2012-02-24  Zoltan Herczeg  <zherczeg@webkit.org>
1013
1014         [Qt] Buildfix for "Zero out CopiedBlocks on initialization".
1015         https://bugs.webkit.org/show_bug.cgi?id=79199
1016
1017         Ruber stamped by Csaba Osztrogonác.
1018
1019         Temporary fix since the new member wastes a little space on
1020         64 bit systems. Although it is harmless, it is only needed
1021         for 32 bit systems.
1022
1023         * heap/CopiedBlock.h:
1024         (CopiedBlock):
1025
1026 2012-02-24  Han Hojong  <hojong.han@samsung.com>
1027
1028         Remove useless jump instructions for short circuit
1029         https://bugs.webkit.org/show_bug.cgi?id=75602
1030
1031         Reviewed by Michael Saboff.
1032
1033         Jump instruction is inserted to make short circuit, 
1034         however it does nothing but moving to the next instruction.
1035         Therefore useless jump instructions are removed, 
1036         and jump list is moved into the case not for a short circuit,
1037         so that only necessary instructions are added to JIT code
1038         unless it has a 16 bit pattern character and an 8 bit string.
1039
1040         * yarr/YarrJIT.cpp:
1041         (JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
1042         (JSC::Yarr::YarrGenerator::backtrackPatternCharacterNonGreedy):
1043
1044 2012-02-24  Sheriff Bot  <webkit.review.bot@gmail.com>
1045
1046         Unreviewed, rolling out r108731.
1047         http://trac.webkit.org/changeset/108731
1048         https://bugs.webkit.org/show_bug.cgi?id=79464
1049
1050         Broke Chromium Win tests (Requested by bashi on #webkit).
1051
1052         * wtf/Platform.h:
1053
1054 2012-02-24  Andrew Lo  <anlo@rim.com>
1055
1056         [BlackBerry] Enable requestAnimationFrame
1057         https://bugs.webkit.org/show_bug.cgi?id=79408
1058
1059         Use timer implementation of requestAnimationFrame on BlackBerry.
1060
1061         Reviewed by Rob Buis.
1062
1063         * wtf/Platform.h:
1064
1065 2012-02-24  Mathias Bynens  <mathias@qiwi.be>
1066
1067         `\u200c` and `\u200d` should be allowed in IdentifierPart, as per ES5
1068         https://bugs.webkit.org/show_bug.cgi?id=78908
1069
1070         Add additional checks for zero-width non-joiner (0x200C) and
1071         zero-width joiner (0x200D) characters.
1072
1073         Reviewed by Michael Saboff.
1074
1075         * parser/Lexer.cpp:
1076         (JSC::isNonASCIIIdentPart)
1077         * runtime/LiteralParser.cpp:
1078         (JSC::::Lexer::lexIdentifier)
1079
1080 2012-02-23  Kenichi Ishibashi  <bashi@chromium.org>
1081
1082         Adding WebSocket per-frame DEFLATE extension
1083         https://bugs.webkit.org/show_bug.cgi?id=77522
1084
1085         Added USE(ZLIB) flag.
1086
1087         Reviewed by Kent Tamura.
1088
1089         * wtf/Platform.h:
1090
1091 2012-02-23  Mark Hahnenberg  <mhahnenberg@apple.com>
1092
1093         Zero out CopiedBlocks on initialization
1094         https://bugs.webkit.org/show_bug.cgi?id=79199
1095
1096         Reviewed by Filip Pizlo.
1097
1098         Made CopyBlocks zero their payloads during construction. This allows 
1099         JSArray to avoid having to manually clear its backing store upon allocation
1100         and also alleviates any future pain with regard to the garbage collector trying 
1101         to mark what it thinks are values in what is actually uninitialized memory.
1102
1103         * heap/CopiedBlock.h:
1104         (JSC::CopiedBlock::CopiedBlock):
1105         * runtime/JSArray.cpp:
1106         (JSC::JSArray::finishCreation):
1107         (JSC::JSArray::tryFinishCreationUninitialized):
1108         (JSC::JSArray::increaseVectorLength):
1109         (JSC::JSArray::unshiftCountSlowCase):
1110
1111 2012-02-23  Oliver Hunt  <oliver@apple.com>
1112
1113         Make Interpreter::getStackTrace be able to generate the line number for the top callframe if none is provided
1114         https://bugs.webkit.org/show_bug.cgi?id=79407
1115
1116         Reviewed by Gavin Barraclough.
1117
1118         Outside of exception handling, we don't know what our source line number is.  This
1119         change allows us to pass -1 is as the initial line number, and get the correct line
1120         number in the resultant stack trace.  We can't completely elide the initial line
1121         number (yet) due to some idiosyncrasies of the exception handling machinery.
1122
1123         * interpreter/Interpreter.cpp:
1124         (JSC::getLineNumberForCallFrame):
1125         (JSC):
1126         (JSC::Interpreter::getStackTrace):
1127
1128 2012-02-22  Filip Pizlo  <fpizlo@apple.com>
1129
1130         DFG OSR exit value profiling should have graceful handling of local variables and arguments
1131         https://bugs.webkit.org/show_bug.cgi?id=79310
1132
1133         Reviewed by Gavin Barraclough.
1134         
1135         Previously, if we OSR exited because a prediction in a local was wrong, we'd
1136         only realize what the true type of the local was if the regular value profiling
1137         kicked in and told us. Unless the local was block-locally copy propagated, in
1138         which case we'd know from an OSR exit profile.
1139         
1140         This patch adds OSR exit profiling to all locals and arguments. Now, if we OSR
1141         exit because of a mispredicted local or argument type, we'll know what the type of
1142         the local or argument should be immediately upon exiting.
1143         
1144         The way that local variable OSR exit profiling works is that we now have a lazily
1145         added set of OSR-exit-only value profiles for exit sites that are BadType and that
1146         cited a GetLocal as their value source. The value profiles are only added if the
1147         OSR exit is taken, and are keyed by CodeBlock, bytecode index of the GetLocal, and
1148         operand. The look-up is performed by querying the
1149         CompressedLazyOperandValueProfileHolder in the CodeBlock, using a key that contains
1150         the bytecode index and the operand. Because the value profiles are added at random
1151         times, they are not sorted; instead they are just stored in an arbitrarily-ordered
1152         SegmentedVector. Look-ups are made fast by "decompressing": the DFG::ByteCodeParser
1153         creates a LazyOperandValueProfileParser, which turns the
1154         CompressedLazyOperandValueProfileHolder's contents into a HashMap for the duration
1155         of DFG parsing.
1156         
1157         Previously, OSR exits had a pointer to the ValueProfile that had the specFailBucket
1158         into which values observed during OSR exit would be placed. Now it uses a lazy
1159         thunk for a ValueProfile. I call this the MethodOfGettingAValueProfile. It may
1160         either contain a ValueProfile inside it (which works for previous uses of OSR exit
1161         profiling) or it may just have knowledge of how to go about creating the
1162         LazyOperandValueProfile in the case that the OSR exit is actually taken. This
1163         ensures that we never have to create NumOperands*NumBytecodeIndices*NumCodeBlocks
1164         value profiling buckets unless we actually did OSR exit on every single operand,
1165         in every single instruction, in each code block (that's probably unlikely).
1166         
1167         This appears to be neutral on the major benchmarks, but is a double-digit speed-up
1168         on code deliberately written to have data flow that spans basic blocks and where
1169         the code exhibits post-optimization polymorphism in a local variable.
1170
1171         * CMakeLists.txt:
1172         * GNUmakefile.list.am:
1173         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1174         * JavaScriptCore.xcodeproj/project.pbxproj:
1175         * Target.pri:
1176         * bytecode/CodeBlock.cpp:
1177         (JSC::CodeBlock::stronglyVisitStrongReferences):
1178         * bytecode/CodeBlock.h:
1179         (CodeBlock):
1180         (JSC::CodeBlock::lazyOperandValueProfiles):
1181         * bytecode/LazyOperandValueProfile.cpp: Added.
1182         (JSC):
1183         (JSC::CompressedLazyOperandValueProfileHolder::CompressedLazyOperandValueProfileHolder):
1184         (JSC::CompressedLazyOperandValueProfileHolder::~CompressedLazyOperandValueProfileHolder):
1185         (JSC::CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions):
1186         (JSC::CompressedLazyOperandValueProfileHolder::add):
1187         (JSC::LazyOperandValueProfileParser::LazyOperandValueProfileParser):
1188         (JSC::LazyOperandValueProfileParser::~LazyOperandValueProfileParser):
1189         (JSC::LazyOperandValueProfileParser::getIfPresent):
1190         (JSC::LazyOperandValueProfileParser::prediction):
1191         * bytecode/LazyOperandValueProfile.h: Added.
1192         (JSC):
1193         (LazyOperandValueProfileKey):
1194         (JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey):
1195         (JSC::LazyOperandValueProfileKey::operator!):
1196         (JSC::LazyOperandValueProfileKey::operator==):
1197         (JSC::LazyOperandValueProfileKey::hash):
1198         (JSC::LazyOperandValueProfileKey::bytecodeOffset):
1199         (JSC::LazyOperandValueProfileKey::operand):
1200         (JSC::LazyOperandValueProfileKey::isHashTableDeletedValue):
1201         (JSC::LazyOperandValueProfileKeyHash::hash):
1202         (JSC::LazyOperandValueProfileKeyHash::equal):
1203         (LazyOperandValueProfileKeyHash):
1204         (WTF):
1205         (JSC::LazyOperandValueProfile::LazyOperandValueProfile):
1206         (LazyOperandValueProfile):
1207         (JSC::LazyOperandValueProfile::key):
1208         (CompressedLazyOperandValueProfileHolder):
1209         (LazyOperandValueProfileParser):
1210         * bytecode/MethodOfGettingAValueProfile.cpp: Added.
1211         (JSC):
1212         (JSC::MethodOfGettingAValueProfile::fromLazyOperand):
1213         (JSC::MethodOfGettingAValueProfile::getSpecFailBucket):
1214         * bytecode/MethodOfGettingAValueProfile.h: Added.
1215         (JSC):
1216         (MethodOfGettingAValueProfile):
1217         (JSC::MethodOfGettingAValueProfile::MethodOfGettingAValueProfile):
1218         (JSC::MethodOfGettingAValueProfile::operator!):
1219         * bytecode/ValueProfile.cpp: Removed.
1220         * bytecode/ValueProfile.h:
1221         (JSC):
1222         (ValueProfileBase):
1223         (JSC::ValueProfileBase::ValueProfileBase):
1224         (JSC::ValueProfileBase::dump):
1225         (JSC::ValueProfileBase::computeUpdatedPrediction):
1226         (JSC::MinimalValueProfile::MinimalValueProfile):
1227         (ValueProfileWithLogNumberOfBuckets):
1228         (JSC::ValueProfileWithLogNumberOfBuckets::ValueProfileWithLogNumberOfBuckets):
1229         (JSC::ValueProfile::ValueProfile):
1230         (JSC::getValueProfileBytecodeOffset):
1231         (JSC::getRareCaseProfileBytecodeOffset):
1232         * dfg/DFGByteCodeParser.cpp:
1233         (ByteCodeParser):
1234         (JSC::DFG::ByteCodeParser::injectLazyOperandPrediction):
1235         (JSC::DFG::ByteCodeParser::getLocal):
1236         (JSC::DFG::ByteCodeParser::getArgument):
1237         (InlineStackEntry):
1238         (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
1239         (DFG):
1240         (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
1241         (JSC::DFG::ByteCodeParser::parse):
1242         * dfg/DFGDriver.cpp:
1243         (JSC::DFG::compile):
1244         * dfg/DFGGraph.h:
1245         (JSC::DFG::Graph::valueProfileFor):
1246         (JSC::DFG::Graph::methodOfGettingAValueProfileFor):
1247         (Graph):
1248         * dfg/DFGNode.h:
1249         (Node):
1250         * dfg/DFGOSRExit.cpp:
1251         (JSC::DFG::OSRExit::OSRExit):
1252         * dfg/DFGOSRExit.h:
1253         (OSRExit):
1254         * dfg/DFGOSRExitCompiler32_64.cpp:
1255         (JSC::DFG::OSRExitCompiler::compileExit):
1256         * dfg/DFGOSRExitCompiler64.cpp:
1257         (JSC::DFG::OSRExitCompiler::compileExit):
1258         * dfg/DFGPhase.cpp:
1259         (JSC::DFG::Phase::beginPhase):
1260         (JSC::DFG::Phase::endPhase):
1261         * dfg/DFGSpeculativeJIT.cpp:
1262         (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
1263         * dfg/DFGSpeculativeJIT.h:
1264         (JSC::DFG::SpeculativeJIT::speculationCheck):
1265         * dfg/DFGVariableAccessData.h:
1266         (JSC::DFG::VariableAccessData::nonUnifiedPrediction):
1267         (VariableAccessData):
1268
1269 2012-02-23  Filip Pizlo  <fpizlo@apple.com>
1270
1271         Build fix.
1272
1273         * llint/LLIntOffsetsExtractor.cpp:
1274
1275 2012-02-23  Kevin Ollivier  <kevino@theolliviers.com>
1276
1277         [wx] Build fix, disable LLINT for now and fix ENABLE defines for it.
1278
1279         * llint/LLIntOffsetsExtractor.cpp:
1280         * wtf/Platform.h:
1281
1282 2012-02-23  Kevin Ollivier  <kevino@theolliviers.com>
1283
1284         [wx] Build fix for non-Mac wx builds.
1285
1286         * runtime/DatePrototype.cpp:
1287
1288 2012-02-22  Filip Pizlo  <fpizlo@apple.com>
1289
1290         DFG's logic for emitting a Flush is too convoluted and contains an inaccurate comment
1291         https://bugs.webkit.org/show_bug.cgi?id=79334
1292
1293         Reviewed by Oliver Hunt.
1294
1295         * dfg/DFGByteCodeParser.cpp:
1296         (JSC::DFG::ByteCodeParser::getLocal):
1297         (JSC::DFG::ByteCodeParser::getArgument):
1298         (JSC::DFG::ByteCodeParser::flush):
1299
1300 2012-02-23  Gavin Barraclough  <barraclough@apple.com>
1301
1302         Object.isSealed / Object.isFrozen don't work for native objects
1303         https://bugs.webkit.org/show_bug.cgi?id=79331
1304
1305         Reviewed by Sam Weinig.
1306
1307         Need to inspect all properties, including static ones.
1308         This exposes a couple of bugs in Array & Arguments:
1309             - getOwnPropertyDescriptor doesn't correctly report the writable attribute of array length.
1310             - Arguments object's defineOwnProperty does not handle callee/caller/length correctly.
1311
1312         * runtime/Arguments.cpp:
1313         (JSC::Arguments::defineOwnProperty):
1314             - Add handling for callee/caller/length.
1315         * runtime/JSArray.cpp:
1316         (JSC::JSArray::getOwnPropertyDescriptor):
1317             - report length's writability correctly.
1318         * runtime/ObjectConstructor.cpp:
1319         (JSC::objectConstructorSeal):
1320         (JSC::objectConstructorFreeze):
1321         (JSC::objectConstructorIsSealed):
1322         (JSC::objectConstructorIsFrozen):
1323             - Add spec-based implementation for non-final objects.
1324
1325 2012-02-23  Gavin Barraclough  <barraclough@apple.com>
1326
1327         pop of array hole should get from the prototype chain
1328         https://bugs.webkit.org/show_bug.cgi?id=79338
1329
1330         Reviewed by Sam Weinig.
1331
1332         * runtime/JSArray.cpp:
1333         (JSC::JSArray::pop):
1334             - If the fast fast vector case fails, more closely follow the spec.
1335
1336 2012-02-23  Yong Li  <yoli@rim.com>
1337
1338         JSString::outOfMemory() should ASSERT(isRope()) rather than !isRope()
1339         https://bugs.webkit.org/show_bug.cgi?id=79268
1340
1341         Reviewed by Michael Saboff.
1342
1343         resolveRope() is the only caller of outOfMemory(), and it calls outOfMemory()
1344         after it fails to allocate a buffer for m_value. So outOfMemory() should assert
1345         isRope() rather than !isRope().
1346
1347         * runtime/JSString.cpp:
1348         (JSC::JSString::outOfMemory):
1349
1350 2012-02-23  Patrick Gansterer  <paroga@webkit.org>
1351
1352         [CMake] Add WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS macro
1353         https://bugs.webkit.org/show_bug.cgi?id=79371
1354
1355         Reviewed by Daniel Bates.
1356
1357         * CMakeLists.txt:
1358         * shell/CMakeLists.txt:
1359         * wtf/CMakeLists.txt:
1360
1361 2012-02-23  Aron Rosenberg  <arosenberg@logitech.com>
1362
1363         Fix the PRI macros used in WTF::String formatters to be compatible with Qt and Visual Studio 2005 and newer.
1364         https://bugs.webkit.org/show_bug.cgi?id=76210
1365
1366         Add compile time check for Visual Studio 2005 or newer.
1367
1368         Reviewed by Simon Hausmann.
1369
1370         * os-win32/inttypes.h:
1371
1372 2012-02-22  Gavin Barraclough  <barraclough@apple.com>
1373
1374         Implement [[DefineOwnProperty]] for the arguments object
1375         https://bugs.webkit.org/show_bug.cgi?id=79309
1376
1377         Reviewed by Sam Weinig.
1378
1379         * runtime/Arguments.cpp:
1380         (JSC::Arguments::deletePropertyByIndex):
1381         (JSC::Arguments::deleteProperty):
1382             - Deleting an argument should also delete the copy on the object, if any.
1383         (JSC::Arguments::defineOwnProperty):
1384             - Defining a property may override the live mapping.
1385         * runtime/Arguments.h:
1386         (Arguments):
1387
1388 2012-02-22  Gavin Barraclough  <barraclough@apple.com>
1389
1390         Fix Object.freeze for non-final objects.
1391         https://bugs.webkit.org/show_bug.cgi?id=79286
1392
1393         Reviewed by Oliver Hunt.
1394
1395         For vanilla objects we implement this with a single transition, for objects
1396         with special properties we should just follow the spec defined algorithm.
1397
1398         * runtime/JSArray.cpp:
1399         (JSC::SparseArrayValueMap::put):
1400             - this does need to handle inextensible objects.
1401         * runtime/ObjectConstructor.cpp:
1402         (JSC::objectConstructorSeal):
1403         (JSC::objectConstructorFreeze):
1404             - Implement spec defined algorithm for non-final objects.
1405         * runtime/Structure.cpp:
1406         (JSC::Structure::Structure):
1407         (JSC::Structure::freezeTransition):
1408             - freeze should set m_hasReadOnlyOrGetterSetterPropertiesExcludingProto.
1409         * runtime/Structure.h:
1410         (JSC::Structure::hasReadOnlyOrGetterSetterPropertiesExcludingProto):
1411         (JSC::Structure::setHasGetterSetterProperties):
1412         (JSC::Structure::setContainsReadOnlyProperties):
1413         (Structure):
1414             - renamed m_hasReadOnlyOrGetterSetterPropertiesExcludingProto.
1415
1416 2012-02-22  Mark Hahnenberg  <mhahnenberg@apple.com>
1417
1418         Allocations from CopiedBlocks should always be 8-byte aligned
1419         https://bugs.webkit.org/show_bug.cgi?id=79271
1420
1421         Reviewed by Geoffrey Garen.
1422
1423         * heap/CopiedAllocator.h:
1424         (JSC::CopiedAllocator::allocate):
1425         * heap/CopiedBlock.h: Changed to add padding so that the start of the payload is always 
1426         guaranteed to be 8 byte aligned on both 64- and 32-bit platforms.
1427         (CopiedBlock):
1428         * heap/CopiedSpace.cpp: Changed all assertions of isPointerAligned to is8ByteAligned.
1429         (JSC::CopiedSpace::tryAllocateOversize):
1430         (JSC::CopiedSpace::getFreshBlock):
1431         * heap/CopiedSpaceInlineMethods.h:
1432         (JSC::CopiedSpace::allocateFromBlock):
1433         * runtime/JSArray.h:
1434         (ArrayStorage): Added padding for ArrayStorage to make sure that it is always 8 byte 
1435         aligned on both 64- and 32-bit platforms.
1436         * wtf/StdLibExtras.h:
1437         (WTF::is8ByteAligned): Added new utility function that functions similarly to the 
1438         way isPointerAligned does, but it just always checks for 8 byte alignment.
1439         (WTF):
1440
1441 2012-02-22  Sheriff Bot  <webkit.review.bot@gmail.com>
1442
1443         Unreviewed, rolling out r108456.
1444         http://trac.webkit.org/changeset/108456
1445         https://bugs.webkit.org/show_bug.cgi?id=79223
1446
1447         Broke fast/regex/pcre-test-4.html and cannot find anyone on
1448         IRC (Requested by zherczeg on #webkit).
1449
1450         * yarr/YarrJIT.cpp:
1451         (JSC::Yarr::YarrGenerator::backtrackPatternCharacterGreedy):
1452
1453 2012-02-22  Sheriff Bot  <webkit.review.bot@gmail.com>
1454
1455         Unreviewed, rolling out r108468.
1456         http://trac.webkit.org/changeset/108468
1457         https://bugs.webkit.org/show_bug.cgi?id=79219
1458
1459         Broke Chromium Win release build (Requested by bashi on
1460         #webkit).
1461
1462         * wtf/Platform.h:
1463
1464 2012-02-22  Kenichi Ishibashi  <bashi@chromium.org>
1465
1466         Adding WebSocket per-frame DEFLATE extension
1467         https://bugs.webkit.org/show_bug.cgi?id=77522
1468
1469         Added USE(ZLIB) flag.
1470
1471         Reviewed by Kent Tamura.
1472
1473         * wtf/Platform.h:
1474
1475 2012-02-22  Hojong Han  <hojong.han@samsung.com>
1476
1477         Short circuit fixed for a 16 bt pattern character and an 8 bit string.
1478         https://bugs.webkit.org/show_bug.cgi?id=75602
1479
1480         Reviewed by Gavin Barraclough.
1481
1482         * yarr/YarrJIT.cpp:
1483         (JSC::Yarr::YarrGenerator::backtrackPatternCharacterGreedy):
1484
1485 2012-02-21  Filip Pizlo  <fpizlo@apple.com>
1486
1487         Build fix for systems with case sensitive disks.
1488
1489         * llint/LLIntOfflineAsmConfig.h:
1490
1491 2012-02-21  Filip Pizlo  <fpizlo@apple.com>
1492
1493         JSC should be a triple-tier VM
1494         https://bugs.webkit.org/show_bug.cgi?id=75812
1495         <rdar://problem/10079694>
1496
1497         Reviewed by Gavin Barraclough.
1498         
1499         Implemented an interpreter that uses the JIT's calling convention. This
1500         interpreter is called LLInt, or the Low Level Interpreter. JSC will now
1501         will start by executing code in LLInt and will only tier up to the old
1502         JIT after the code is proven hot.
1503         
1504         LLInt is written in a modified form of our macro assembly. This new macro
1505         assembly is compiled by an offline assembler (see offlineasm), which
1506         implements many modern conveniences such as a Turing-complete CPS-based
1507         macro language and direct access to relevant C++ type information
1508         (basically offsets of fields and sizes of structs/classes).
1509         
1510         Code executing in LLInt appears to the rest of the JSC world "as if" it
1511         were executing in the old JIT. Hence, things like exception handling and
1512         cross-execution-engine calls just work and require pretty much no
1513         additional overhead.
1514         
1515         This interpreter is 2-2.5x faster than our old interpreter on SunSpider,
1516         V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider,
1517         V8, and Kraken, but appear to get a double-digit improvement on real-world
1518         websites due to a huge reduction in the amount of JIT'ing.
1519         
1520         * CMakeLists.txt:
1521         * GNUmakefile.am:
1522         * GNUmakefile.list.am:
1523         * JavaScriptCore.pri:
1524         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1525         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
1526         * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
1527         * JavaScriptCore.xcodeproj/project.pbxproj:
1528         * Target.pri:
1529         * assembler/LinkBuffer.h:
1530         * assembler/MacroAssemblerCodeRef.h:
1531         (MacroAssemblerCodePtr):
1532         (JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
1533         * bytecode/BytecodeConventions.h: Added.
1534         * bytecode/CallLinkStatus.cpp:
1535         (JSC::CallLinkStatus::computeFromLLInt):
1536         (JSC):
1537         (JSC::CallLinkStatus::computeFor):
1538         * bytecode/CallLinkStatus.h:
1539         (JSC::CallLinkStatus::isSet):
1540         (JSC::CallLinkStatus::operator!):
1541         (CallLinkStatus):
1542         * bytecode/CodeBlock.cpp:
1543         (JSC::CodeBlock::dump):
1544         (JSC::CodeBlock::CodeBlock):
1545         (JSC::CodeBlock::~CodeBlock):
1546         (JSC::CodeBlock::finalizeUnconditionally):
1547         (JSC::CodeBlock::stronglyVisitStrongReferences):
1548         (JSC):
1549         (JSC::CodeBlock::unlinkCalls):
1550         (JSC::CodeBlock::unlinkIncomingCalls):
1551         (JSC::CodeBlock::bytecodeOffset):
1552         (JSC::ProgramCodeBlock::jettison):
1553         (JSC::EvalCodeBlock::jettison):
1554         (JSC::FunctionCodeBlock::jettison):
1555         (JSC::ProgramCodeBlock::jitCompileImpl):
1556         (JSC::EvalCodeBlock::jitCompileImpl):
1557         (JSC::FunctionCodeBlock::jitCompileImpl):
1558         * bytecode/CodeBlock.h:
1559         (JSC):
1560         (CodeBlock):
1561         (JSC::CodeBlock::baselineVersion):
1562         (JSC::CodeBlock::linkIncomingCall):
1563         (JSC::CodeBlock::bytecodeOffset):
1564         (JSC::CodeBlock::jitCompile):
1565         (JSC::CodeBlock::hasOptimizedReplacement):
1566         (JSC::CodeBlock::addPropertyAccessInstruction):
1567         (JSC::CodeBlock::addGlobalResolveInstruction):
1568         (JSC::CodeBlock::addLLIntCallLinkInfo):
1569         (JSC::CodeBlock::addGlobalResolveInfo):
1570         (JSC::CodeBlock::numberOfMethodCallLinkInfos):
1571         (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset):
1572         (JSC::CodeBlock::likelyToTakeSlowCase):
1573         (JSC::CodeBlock::couldTakeSlowCase):
1574         (JSC::CodeBlock::likelyToTakeSpecialFastCase):
1575         (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
1576         (JSC::CodeBlock::likelyToTakeAnySlowCase):
1577         (JSC::CodeBlock::addFrequentExitSite):
1578         (JSC::CodeBlock::dontJITAnytimeSoon):
1579         (JSC::CodeBlock::jitAfterWarmUp):
1580         (JSC::CodeBlock::jitSoon):
1581         (JSC::CodeBlock::llintExecuteCounter):
1582         (ProgramCodeBlock):
1583         (EvalCodeBlock):
1584         (FunctionCodeBlock):
1585         * bytecode/GetByIdStatus.cpp:
1586         (JSC::GetByIdStatus::computeFromLLInt):
1587         (JSC):
1588         (JSC::GetByIdStatus::computeFor):
1589         * bytecode/GetByIdStatus.h:
1590         (JSC::GetByIdStatus::GetByIdStatus):
1591         (JSC::GetByIdStatus::wasSeenInJIT):
1592         (GetByIdStatus):
1593         * bytecode/Instruction.h:
1594         (JSC):
1595         (JSC::Instruction::Instruction):
1596         (Instruction):
1597         * bytecode/LLIntCallLinkInfo.h: Added.
1598         (JSC):
1599         (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo):
1600         (LLIntCallLinkInfo):
1601         (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo):
1602         (JSC::LLIntCallLinkInfo::isLinked):
1603         (JSC::LLIntCallLinkInfo::unlink):
1604         * bytecode/MethodCallLinkStatus.cpp:
1605         (JSC::MethodCallLinkStatus::computeFor):
1606         * bytecode/Opcode.cpp:
1607         (JSC):
1608         * bytecode/Opcode.h:
1609         (JSC):
1610         (JSC::padOpcodeName):
1611         * bytecode/PutByIdStatus.cpp:
1612         (JSC::PutByIdStatus::computeFromLLInt):
1613         (JSC):
1614         (JSC::PutByIdStatus::computeFor):
1615         * bytecode/PutByIdStatus.h:
1616         (PutByIdStatus):
1617         * bytecompiler/BytecodeGenerator.cpp:
1618         (JSC::BytecodeGenerator::emitResolve):
1619         (JSC::BytecodeGenerator::emitResolveWithBase):
1620         (JSC::BytecodeGenerator::emitGetById):
1621         (JSC::BytecodeGenerator::emitPutById):
1622         (JSC::BytecodeGenerator::emitDirectPutById):
1623         (JSC::BytecodeGenerator::emitCall):
1624         (JSC::BytecodeGenerator::emitConstruct):
1625         (JSC::BytecodeGenerator::emitCatch):
1626         * dfg/DFGByteCodeParser.cpp:
1627         (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
1628         (JSC::DFG::ByteCodeParser::handleInlining):
1629         (JSC::DFG::ByteCodeParser::parseBlock):
1630         * dfg/DFGCapabilities.h:
1631         (JSC::DFG::canCompileOpcode):
1632         * dfg/DFGOSRExitCompiler.cpp:
1633         * dfg/DFGOperations.cpp:
1634         * heap/Heap.h:
1635         (JSC):
1636         (JSC::Heap::firstAllocatorWithoutDestructors):
1637         (Heap):
1638         * heap/MarkStack.cpp:
1639         (JSC::visitChildren):
1640         * heap/MarkedAllocator.h:
1641         (JSC):
1642         (MarkedAllocator):
1643         * heap/MarkedSpace.h:
1644         (JSC):
1645         (MarkedSpace):
1646         (JSC::MarkedSpace::firstAllocator):
1647         * interpreter/CallFrame.cpp:
1648         (JSC):
1649         (JSC::CallFrame::bytecodeOffsetForNonDFGCode):
1650         (JSC::CallFrame::setBytecodeOffsetForNonDFGCode):
1651         (JSC::CallFrame::currentVPC):
1652         (JSC::CallFrame::setCurrentVPC):
1653         (JSC::CallFrame::trueCallerFrame):
1654         * interpreter/CallFrame.h:
1655         (JSC::ExecState::hasReturnPC):
1656         (JSC::ExecState::clearReturnPC):
1657         (ExecState):
1658         (JSC::ExecState::bytecodeOffsetForNonDFGCode):
1659         (JSC::ExecState::currentVPC):
1660         (JSC::ExecState::setCurrentVPC):
1661         * interpreter/Interpreter.cpp:
1662         (JSC::Interpreter::Interpreter):
1663         (JSC::Interpreter::~Interpreter):
1664         (JSC):
1665         (JSC::Interpreter::initialize):
1666         (JSC::Interpreter::isOpcode):
1667         (JSC::Interpreter::unwindCallFrame):
1668         (JSC::getCallerInfo):
1669         (JSC::Interpreter::privateExecute):
1670         (JSC::Interpreter::retrieveLastCaller):
1671         * interpreter/Interpreter.h:
1672         (JSC):
1673         (Interpreter):
1674         (JSC::Interpreter::getOpcode):
1675         (JSC::Interpreter::getOpcodeID):
1676         (JSC::Interpreter::classicEnabled):
1677         * interpreter/RegisterFile.h:
1678         (JSC):
1679         (RegisterFile):
1680         * jit/ExecutableAllocator.h:
1681         (JSC):
1682         * jit/HostCallReturnValue.cpp: Added.
1683         (JSC):
1684         (JSC::getHostCallReturnValueWithExecState):
1685         * jit/HostCallReturnValue.h: Added.
1686         (JSC):
1687         (JSC::initializeHostCallReturnValue):
1688         * jit/JIT.cpp:
1689         (JSC::JIT::privateCompileMainPass):
1690         (JSC::JIT::privateCompileSlowCases):
1691         (JSC::JIT::privateCompile):
1692         * jit/JITCode.h:
1693         (JSC::JITCode::isOptimizingJIT):
1694         (JITCode):
1695         (JSC::JITCode::isBaselineCode):
1696         (JSC::JITCode::JITCode):
1697         * jit/JITDriver.h:
1698         (JSC::jitCompileIfAppropriate):
1699         (JSC::jitCompileFunctionIfAppropriate):
1700         * jit/JITExceptions.cpp:
1701         (JSC::jitThrow):
1702         * jit/JITInlineMethods.h:
1703         (JSC::JIT::updateTopCallFrame):
1704         * jit/JITStubs.cpp:
1705         (JSC::DEFINE_STUB_FUNCTION):
1706         (JSC):
1707         * jit/JITStubs.h:
1708         (JSC):
1709         * jit/JSInterfaceJIT.h:
1710         * llint: Added.
1711         * llint/LLIntCommon.h: Added.
1712         * llint/LLIntData.cpp: Added.
1713         (LLInt):
1714         (JSC::LLInt::Data::Data):
1715         (JSC::LLInt::Data::performAssertions):
1716         (JSC::LLInt::Data::~Data):
1717         * llint/LLIntData.h: Added.
1718         (JSC):
1719         (LLInt):
1720         (Data):
1721         (JSC::LLInt::Data::exceptionInstructions):
1722         (JSC::LLInt::Data::opcodeMap):
1723         (JSC::LLInt::Data::performAssertions):
1724         * llint/LLIntEntrypoints.cpp: Added.
1725         (LLInt):
1726         (JSC::LLInt::getFunctionEntrypoint):
1727         (JSC::LLInt::getEvalEntrypoint):
1728         (JSC::LLInt::getProgramEntrypoint):
1729         * llint/LLIntEntrypoints.h: Added.
1730         (JSC):
1731         (LLInt):
1732         (JSC::LLInt::getEntrypoint):
1733         * llint/LLIntExceptions.cpp: Added.
1734         (LLInt):
1735         (JSC::LLInt::interpreterThrowInCaller):
1736         (JSC::LLInt::returnToThrowForThrownException):
1737         (JSC::LLInt::returnToThrow):
1738         (JSC::LLInt::callToThrow):
1739         * llint/LLIntExceptions.h: Added.
1740         (JSC):
1741         (LLInt):
1742         * llint/LLIntOfflineAsmConfig.h: Added.
1743         * llint/LLIntOffsetsExtractor.cpp: Added.
1744         (JSC):
1745         (LLIntOffsetsExtractor):
1746         (JSC::LLIntOffsetsExtractor::dummy):
1747         (main):
1748         * llint/LLIntSlowPaths.cpp: Added.
1749         (LLInt):
1750         (JSC::LLInt::llint_trace_operand):
1751         (JSC::LLInt::llint_trace_value):
1752         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
1753         (JSC::LLInt::traceFunctionPrologue):
1754         (JSC::LLInt::shouldJIT):
1755         (JSC::LLInt::entryOSR):
1756         (JSC::LLInt::resolveGlobal):
1757         (JSC::LLInt::getByVal):
1758         (JSC::LLInt::handleHostCall):
1759         (JSC::LLInt::setUpCall):
1760         (JSC::LLInt::genericCall):
1761         * llint/LLIntSlowPaths.h: Added.
1762         (JSC):
1763         (LLInt):
1764         * llint/LLIntThunks.cpp: Added.
1765         (LLInt):
1766         (JSC::LLInt::generateThunkWithJumpTo):
1767         (JSC::LLInt::functionForCallEntryThunkGenerator):
1768         (JSC::LLInt::functionForConstructEntryThunkGenerator):
1769         (JSC::LLInt::functionForCallArityCheckThunkGenerator):
1770         (JSC::LLInt::functionForConstructArityCheckThunkGenerator):
1771         (JSC::LLInt::evalEntryThunkGenerator):
1772         (JSC::LLInt::programEntryThunkGenerator):
1773         * llint/LLIntThunks.h: Added.
1774         (JSC):
1775         (LLInt):
1776         * llint/LowLevelInterpreter.asm: Added.
1777         * llint/LowLevelInterpreter.cpp: Added.
1778         * llint/LowLevelInterpreter.h: Added.
1779         * offlineasm: Added.
1780         * offlineasm/armv7.rb: Added.
1781         * offlineasm/asm.rb: Added.
1782         * offlineasm/ast.rb: Added.
1783         * offlineasm/backends.rb: Added.
1784         * offlineasm/generate_offset_extractor.rb: Added.
1785         * offlineasm/instructions.rb: Added.
1786         * offlineasm/offset_extractor_constants.rb: Added.
1787         * offlineasm/offsets.rb: Added.
1788         * offlineasm/opt.rb: Added.
1789         * offlineasm/parser.rb: Added.
1790         * offlineasm/registers.rb: Added.
1791         * offlineasm/self_hash.rb: Added.
1792         * offlineasm/settings.rb: Added.
1793         * offlineasm/transform.rb: Added.
1794         * offlineasm/x86.rb: Added.
1795         * runtime/CodeSpecializationKind.h: Added.
1796         (JSC):
1797         * runtime/CommonSlowPaths.h:
1798         (JSC::CommonSlowPaths::arityCheckFor):
1799         (CommonSlowPaths):
1800         * runtime/Executable.cpp:
1801         (JSC::jettisonCodeBlock):
1802         (JSC):
1803         (JSC::EvalExecutable::jitCompile):
1804         (JSC::samplingDescription):
1805         (JSC::EvalExecutable::compileInternal):
1806         (JSC::ProgramExecutable::jitCompile):
1807         (JSC::ProgramExecutable::compileInternal):
1808         (JSC::FunctionExecutable::baselineCodeBlockFor):
1809         (JSC::FunctionExecutable::jitCompileForCall):
1810         (JSC::FunctionExecutable::jitCompileForConstruct):
1811         (JSC::FunctionExecutable::compileForCallInternal):
1812         (JSC::FunctionExecutable::compileForConstructInternal):
1813         * runtime/Executable.h:
1814         (JSC):
1815         (EvalExecutable):
1816         (ProgramExecutable):
1817         (FunctionExecutable):
1818         (JSC::FunctionExecutable::jitCompileFor):
1819         * runtime/ExecutionHarness.h: Added.
1820         (JSC):
1821         (JSC::prepareForExecution):
1822         (JSC::prepareFunctionForExecution):
1823         * runtime/JSArray.h:
1824         (JSC):
1825         (JSArray):
1826         * runtime/JSCell.h:
1827         (JSC):
1828         (JSCell):
1829         * runtime/JSFunction.h:
1830         (JSC):
1831         (JSFunction):
1832         * runtime/JSGlobalData.cpp:
1833         (JSC::JSGlobalData::JSGlobalData):
1834         * runtime/JSGlobalData.h:
1835         (JSC):
1836         (JSGlobalData):
1837         * runtime/JSGlobalObject.h:
1838         (JSC):
1839         (JSGlobalObject):
1840         * runtime/JSObject.h:
1841         (JSC):
1842         (JSObject):
1843         (JSFinalObject):
1844         * runtime/JSPropertyNameIterator.h:
1845         (JSC):
1846         (JSPropertyNameIterator):
1847         * runtime/JSString.h:
1848         (JSC):
1849         (JSString):
1850         * runtime/JSTypeInfo.h:
1851         (JSC):
1852         (TypeInfo):
1853         * runtime/JSValue.cpp:
1854         (JSC::JSValue::description):
1855         * runtime/JSValue.h:
1856         (LLInt):
1857         (JSValue):
1858         * runtime/JSVariableObject.h:
1859         (JSC):
1860         (JSVariableObject):
1861         * runtime/Options.cpp:
1862         (Options):
1863         (JSC::Options::initializeOptions):
1864         * runtime/Options.h:
1865         (Options):
1866         * runtime/ScopeChain.h:
1867         (JSC):
1868         (ScopeChainNode):
1869         * runtime/Structure.cpp:
1870         (JSC::Structure::addPropertyTransition):
1871         * runtime/Structure.h:
1872         (JSC):
1873         (Structure):
1874         * runtime/StructureChain.h:
1875         (JSC):
1876         (StructureChain):
1877         * wtf/InlineASM.h:
1878         * wtf/Platform.h:
1879         * wtf/SentinelLinkedList.h:
1880         (SentinelLinkedList):
1881         (WTF::SentinelLinkedList::isEmpty):
1882         * wtf/text/StringImpl.h:
1883         (JSC):
1884         (StringImpl):
1885
1886 2012-02-21  Oliver Hunt  <oliver@apple.com>
1887
1888         Unbreak double-typed arrays on ARMv7
1889         https://bugs.webkit.org/show_bug.cgi?id=79177
1890
1891         Reviewed by Gavin Barraclough.
1892
1893         The existing code had completely broken address arithmetic.
1894
1895         * JSCTypedArrayStubs.h:
1896         (JSC):
1897         * assembler/MacroAssemblerARMv7.h:
1898         (JSC::MacroAssemblerARMv7::storeDouble):
1899         (JSC::MacroAssemblerARMv7::storeFloat):
1900
1901 2012-02-21  Gavin Barraclough  <barraclough@apple.com>
1902
1903         Should be able to reconfigure a non-configurable property as read-only
1904         https://bugs.webkit.org/show_bug.cgi?id=79170
1905
1906         Reviewed by Sam Weinig.
1907
1908         See ES5.1 8.12.9 10.a.i - the spec prohibits making a read-only property writable,
1909         but does not inhibit making a writable property read-only.
1910
1911         * runtime/JSGlobalData.cpp:
1912         (JSC::JSGlobalData::JSGlobalData):
1913         * runtime/JSGlobalData.h:
1914         (JSC::JSGlobalData::setInDefineOwnProperty):
1915         (JSGlobalData):
1916         (JSC::JSGlobalData::isInDefineOwnProperty):
1917             - Added flag, tracking whether we are in JSObject::defineOwnProperty.
1918         * runtime/JSObject.cpp:
1919         (JSC::JSObject::deleteProperty):
1920         (DefineOwnPropertyScope):
1921             - Always allow properties to be deleted by DefineOwnProperty - assume it knows what it is doing!
1922         (JSC::DefineOwnPropertyScope::DefineOwnPropertyScope):
1923         (JSC::DefineOwnPropertyScope::~DefineOwnPropertyScope):
1924             - Added RAII helper.
1925         (JSC::JSObject::defineOwnProperty):
1926             - Track on the globalData when we are in this method.
1927
1928 2012-02-21  Oliver Hunt  <oliver@apple.com>
1929
1930         Make TypedArrays be available in commandline jsc
1931         https://bugs.webkit.org/show_bug.cgi?id=79163
1932
1933         Reviewed by Gavin Barraclough.
1934
1935         Adds a compile time option to have jsc support a basic implementation
1936         of the TypedArrays available in WebCore.  This lets us test the typed
1937         array logic in the JIT witout having to build webcore.
1938
1939         * JSCTypedArrayStubs.h: Added.
1940         (JSC):
1941         * JavaScriptCore.xcodeproj/project.pbxproj:
1942         * jsc.cpp:
1943         (GlobalObject::finishCreation):
1944         (GlobalObject):
1945         (GlobalObject::addConstructableFunction):
1946         * runtime/JSGlobalData.h:
1947         (JSGlobalData):
1948
1949 2012-02-21  Tom Sepez  <tsepez@chromium.org>
1950
1951         equalIgnoringNullity() only comparing half the bytes for equality
1952         https://bugs.webkit.org/show_bug.cgi?id=79135
1953
1954         Reviewed by Adam Barth.
1955
1956         * wtf/text/StringImpl.h:
1957         (WTF::equalIgnoringNullity):
1958
1959 2012-02-21  Roland Takacs  <takacs.roland@stud.u-szeged.hu>
1960
1961         Unnecessary preprocessor macros in MainThread.h/cpp
1962         https://bugs.webkit.org/show_bug.cgi?id=79083
1963
1964         Removed invalid/wrong PLATFORM(WINDOWS) preprocessor macro.
1965
1966         * wtf/MainThread.cpp:
1967         (WTF):
1968         * wtf/MainThread.h:
1969         (WTF):
1970
1971 2012-02-21  Sam Weinig  <sam@webkit.org>
1972
1973         Attempt to fix the Snow Leopard build.
1974
1975         * Configurations/Base.xcconfig:
1976
1977 2012-02-21  Sam Weinig  <sam@webkit.org>
1978
1979         Use libc++ when building with Clang on Mac
1980         https://bugs.webkit.org/show_bug.cgi?id=78981
1981
1982         Reviewed by Dan Bernstein.
1983
1984         * Configurations/Base.xcconfig:
1985
1986 2012-02-21  Adam Roben  <aroben@apple.com>
1987
1988         Roll out r108309, r108323, and r108326
1989
1990         They broke the 32-bit Lion build.
1991
1992         Original bugs is <http://webkit.org/b/75812> <rdar://problem/10079694>.
1993
1994         * CMakeLists.txt:
1995         * GNUmakefile.am:
1996         * GNUmakefile.list.am:
1997         * JavaScriptCore.pri:
1998         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1999         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2000         * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
2001         * JavaScriptCore.xcodeproj/project.pbxproj:
2002         * Target.pri:
2003         * assembler/LinkBuffer.h:
2004         * assembler/MacroAssemblerCodeRef.h:
2005         * bytecode/BytecodeConventions.h: Removed.
2006         * bytecode/CallLinkStatus.cpp:
2007         * bytecode/CallLinkStatus.h:
2008         * bytecode/CodeBlock.cpp:
2009         * bytecode/CodeBlock.h:
2010         * bytecode/GetByIdStatus.cpp:
2011         * bytecode/GetByIdStatus.h:
2012         * bytecode/Instruction.h:
2013         * bytecode/LLIntCallLinkInfo.h: Removed.
2014         * bytecode/MethodCallLinkStatus.cpp:
2015         * bytecode/Opcode.cpp:
2016         * bytecode/Opcode.h:
2017         * bytecode/PutByIdStatus.cpp:
2018         * bytecode/PutByIdStatus.h:
2019         * bytecompiler/BytecodeGenerator.cpp:
2020         * dfg/DFGByteCodeParser.cpp:
2021         * dfg/DFGCapabilities.h:
2022         * dfg/DFGOSRExitCompiler.cpp:
2023         * dfg/DFGOperations.cpp:
2024         * heap/Heap.h:
2025         * heap/MarkStack.cpp:
2026         * heap/MarkedAllocator.h:
2027         * heap/MarkedSpace.h:
2028         * interpreter/CallFrame.cpp:
2029         * interpreter/CallFrame.h:
2030         * interpreter/Interpreter.cpp:
2031         * interpreter/Interpreter.h:
2032         * interpreter/RegisterFile.h:
2033         * jit/ExecutableAllocator.h:
2034         * jit/HostCallReturnValue.cpp: Removed.
2035         * jit/HostCallReturnValue.h: Removed.
2036         * jit/JIT.cpp:
2037         * jit/JITCode.h:
2038         * jit/JITDriver.h:
2039         * jit/JITExceptions.cpp:
2040         * jit/JITInlineMethods.h:
2041         * jit/JITStubs.cpp:
2042         * jit/JITStubs.h:
2043         * jit/JSInterfaceJIT.h:
2044         * llint/LLIntCommon.h: Removed.
2045         * llint/LLIntData.cpp: Removed.
2046         * llint/LLIntData.h: Removed.
2047         * llint/LLIntEntrypoints.cpp: Removed.
2048         * llint/LLIntEntrypoints.h: Removed.
2049         * llint/LLIntExceptions.cpp: Removed.
2050         * llint/LLIntExceptions.h: Removed.
2051         * llint/LLIntOfflineAsmConfig.h: Removed.
2052         * llint/LLIntOffsetsExtractor.cpp: Removed.
2053         * llint/LLIntSlowPaths.cpp: Removed.
2054         * llint/LLIntSlowPaths.h: Removed.
2055         * llint/LLIntThunks.cpp: Removed.
2056         * llint/LLIntThunks.h: Removed.
2057         * llint/LowLevelInterpreter.asm: Removed.
2058         * llint/LowLevelInterpreter.cpp: Removed.
2059         * llint/LowLevelInterpreter.h: Removed.
2060         * offlineasm/armv7.rb: Removed.
2061         * offlineasm/asm.rb: Removed.
2062         * offlineasm/ast.rb: Removed.
2063         * offlineasm/backends.rb: Removed.
2064         * offlineasm/generate_offset_extractor.rb: Removed.
2065         * offlineasm/instructions.rb: Removed.
2066         * offlineasm/offset_extractor_constants.rb: Removed.
2067         * offlineasm/offsets.rb: Removed.
2068         * offlineasm/opt.rb: Removed.
2069         * offlineasm/parser.rb: Removed.
2070         * offlineasm/registers.rb: Removed.
2071         * offlineasm/self_hash.rb: Removed.
2072         * offlineasm/settings.rb: Removed.
2073         * offlineasm/transform.rb: Removed.
2074         * offlineasm/x86.rb: Removed.
2075         * runtime/CodeSpecializationKind.h: Removed.
2076         * runtime/CommonSlowPaths.h:
2077         * runtime/Executable.cpp:
2078         * runtime/Executable.h:
2079         * runtime/ExecutionHarness.h: Removed.
2080         * runtime/JSArray.h:
2081         * runtime/JSCell.h:
2082         * runtime/JSFunction.h:
2083         * runtime/JSGlobalData.cpp:
2084         * runtime/JSGlobalData.h:
2085         * runtime/JSGlobalObject.h:
2086         * runtime/JSObject.h:
2087         * runtime/JSPropertyNameIterator.h:
2088         * runtime/JSString.h:
2089         * runtime/JSTypeInfo.h:
2090         * runtime/JSValue.cpp:
2091         * runtime/JSValue.h:
2092         * runtime/JSVariableObject.h:
2093         * runtime/Options.cpp:
2094         * runtime/Options.h:
2095         * runtime/ScopeChain.h:
2096         * runtime/Structure.cpp:
2097         * runtime/Structure.h:
2098         * runtime/StructureChain.h:
2099         * wtf/InlineASM.h:
2100         * wtf/Platform.h:
2101         * wtf/SentinelLinkedList.h:
2102         * wtf/text/StringImpl.h:
2103
2104 2012-02-21  Gustavo Noronha Silva  <kov@debian.org> and Bob Tracy  <rct@frus.com>
2105
2106         Does not build on IA64, SPARC and Alpha
2107         https://bugs.webkit.org/show_bug.cgi?id=79047
2108
2109         Rubber-stamped by Kent Tamura.
2110
2111         * wtf/dtoa/utils.h: these architectures also have correct double
2112         operations, so add them to the appropriate side of the check.
2113
2114 2012-02-21  Filip Pizlo  <fpizlo@apple.com>
2115
2116         Fix massive crashes in all tests introduced by previous build fix, and fix non-DFG build.
2117         https://bugs.webkit.org/show_bug.cgi?id=75812
2118
2119         Reviewed by Csaba Osztrogonác.
2120
2121         * dfg/DFGOperations.cpp:
2122         (JSC):
2123         * jit/HostCallReturnValue.h:
2124         (JSC::initializeHostCallReturnValue):
2125
2126 2012-02-21  Filip Pizlo  <fpizlo@apple.com>
2127
2128         Attempted build fix for ELF platforms.
2129
2130         * dfg/DFGOperations.cpp:
2131         (JSC):
2132         (JSC::getHostCallReturnValueWithExecState):
2133         * jit/HostCallReturnValue.cpp:
2134         (JSC):
2135         * jit/HostCallReturnValue.h:
2136         (JSC::initializeHostCallReturnValue):
2137
2138 2012-02-20  Filip Pizlo  <fpizlo@apple.com>
2139
2140         JSC should be a triple-tier VM
2141         https://bugs.webkit.org/show_bug.cgi?id=75812
2142         <rdar://problem/10079694>
2143
2144         Reviewed by Gavin Barraclough.
2145         
2146         Implemented an interpreter that uses the JIT's calling convention. This
2147         interpreter is called LLInt, or the Low Level Interpreter. JSC will now
2148         will start by executing code in LLInt and will only tier up to the old
2149         JIT after the code is proven hot.
2150         
2151         LLInt is written in a modified form of our macro assembly. This new macro
2152         assembly is compiled by an offline assembler (see offlineasm), which
2153         implements many modern conveniences such as a Turing-complete CPS-based
2154         macro language and direct access to relevant C++ type information
2155         (basically offsets of fields and sizes of structs/classes).
2156         
2157         Code executing in LLInt appears to the rest of the JSC world "as if" it
2158         were executing in the old JIT. Hence, things like exception handling and
2159         cross-execution-engine calls just work and require pretty much no
2160         additional overhead.
2161         
2162         This interpreter is 2-2.5x faster than our old interpreter on SunSpider,
2163         V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider,
2164         V8, and Kraken, but appear to get a double-digit improvement on real-world
2165         websites due to a huge reduction in the amount of JIT'ing.
2166         
2167         * CMakeLists.txt:
2168         * GNUmakefile.am:
2169         * GNUmakefile.list.am:
2170         * JavaScriptCore.pri:
2171         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2172         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2173         * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
2174         * JavaScriptCore.xcodeproj/project.pbxproj:
2175         * Target.pri:
2176         * assembler/LinkBuffer.h:
2177         * assembler/MacroAssemblerCodeRef.h:
2178         (MacroAssemblerCodePtr):
2179         (JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
2180         * bytecode/BytecodeConventions.h: Added.
2181         * bytecode/CallLinkStatus.cpp:
2182         (JSC::CallLinkStatus::computeFromLLInt):
2183         (JSC):
2184         (JSC::CallLinkStatus::computeFor):
2185         * bytecode/CallLinkStatus.h:
2186         (JSC::CallLinkStatus::isSet):
2187         (JSC::CallLinkStatus::operator!):
2188         (CallLinkStatus):
2189         * bytecode/CodeBlock.cpp:
2190         (JSC::CodeBlock::dump):
2191         (JSC::CodeBlock::CodeBlock):
2192         (JSC::CodeBlock::~CodeBlock):
2193         (JSC::CodeBlock::finalizeUnconditionally):
2194         (JSC::CodeBlock::stronglyVisitStrongReferences):
2195         (JSC):
2196         (JSC::CodeBlock::unlinkCalls):
2197         (JSC::CodeBlock::unlinkIncomingCalls):
2198         (JSC::CodeBlock::bytecodeOffset):
2199         (JSC::ProgramCodeBlock::jettison):
2200         (JSC::EvalCodeBlock::jettison):
2201         (JSC::FunctionCodeBlock::jettison):
2202         (JSC::ProgramCodeBlock::jitCompileImpl):
2203         (JSC::EvalCodeBlock::jitCompileImpl):
2204         (JSC::FunctionCodeBlock::jitCompileImpl):
2205         * bytecode/CodeBlock.h:
2206         (JSC):
2207         (CodeBlock):
2208         (JSC::CodeBlock::baselineVersion):
2209         (JSC::CodeBlock::linkIncomingCall):
2210         (JSC::CodeBlock::bytecodeOffset):
2211         (JSC::CodeBlock::jitCompile):
2212         (JSC::CodeBlock::hasOptimizedReplacement):
2213         (JSC::CodeBlock::addPropertyAccessInstruction):
2214         (JSC::CodeBlock::addGlobalResolveInstruction):
2215         (JSC::CodeBlock::addLLIntCallLinkInfo):
2216         (JSC::CodeBlock::addGlobalResolveInfo):
2217         (JSC::CodeBlock::numberOfMethodCallLinkInfos):
2218         (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset):
2219         (JSC::CodeBlock::likelyToTakeSlowCase):
2220         (JSC::CodeBlock::couldTakeSlowCase):
2221         (JSC::CodeBlock::likelyToTakeSpecialFastCase):
2222         (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
2223         (JSC::CodeBlock::likelyToTakeAnySlowCase):
2224         (JSC::CodeBlock::addFrequentExitSite):
2225         (JSC::CodeBlock::dontJITAnytimeSoon):
2226         (JSC::CodeBlock::jitAfterWarmUp):
2227         (JSC::CodeBlock::jitSoon):
2228         (JSC::CodeBlock::llintExecuteCounter):
2229         (ProgramCodeBlock):
2230         (EvalCodeBlock):
2231         (FunctionCodeBlock):
2232         * bytecode/GetByIdStatus.cpp:
2233         (JSC::GetByIdStatus::computeFromLLInt):
2234         (JSC):
2235         (JSC::GetByIdStatus::computeFor):
2236         * bytecode/GetByIdStatus.h:
2237         (JSC::GetByIdStatus::GetByIdStatus):
2238         (JSC::GetByIdStatus::wasSeenInJIT):
2239         (GetByIdStatus):
2240         * bytecode/Instruction.h:
2241         (JSC):
2242         (JSC::Instruction::Instruction):
2243         (Instruction):
2244         * bytecode/LLIntCallLinkInfo.h: Added.
2245         (JSC):
2246         (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo):
2247         (LLIntCallLinkInfo):
2248         (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo):
2249         (JSC::LLIntCallLinkInfo::isLinked):
2250         (JSC::LLIntCallLinkInfo::unlink):
2251         * bytecode/MethodCallLinkStatus.cpp:
2252         (JSC::MethodCallLinkStatus::computeFor):
2253         * bytecode/Opcode.cpp:
2254         (JSC):
2255         * bytecode/Opcode.h:
2256         (JSC):
2257         (JSC::padOpcodeName):
2258         * bytecode/PutByIdStatus.cpp:
2259         (JSC::PutByIdStatus::computeFromLLInt):
2260         (JSC):
2261         (JSC::PutByIdStatus::computeFor):
2262         * bytecode/PutByIdStatus.h:
2263         (PutByIdStatus):
2264         * bytecompiler/BytecodeGenerator.cpp:
2265         (JSC::BytecodeGenerator::emitResolve):
2266         (JSC::BytecodeGenerator::emitResolveWithBase):
2267         (JSC::BytecodeGenerator::emitGetById):
2268         (JSC::BytecodeGenerator::emitPutById):
2269         (JSC::BytecodeGenerator::emitDirectPutById):
2270         (JSC::BytecodeGenerator::emitCall):
2271         (JSC::BytecodeGenerator::emitConstruct):
2272         (JSC::BytecodeGenerator::emitCatch):
2273         * dfg/DFGByteCodeParser.cpp:
2274         (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
2275         (JSC::DFG::ByteCodeParser::handleInlining):
2276         (JSC::DFG::ByteCodeParser::parseBlock):
2277         * dfg/DFGCapabilities.h:
2278         (JSC::DFG::canCompileOpcode):
2279         * dfg/DFGOSRExitCompiler.cpp:
2280         * dfg/DFGOperations.cpp:
2281         * heap/Heap.h:
2282         (JSC):
2283         (JSC::Heap::firstAllocatorWithoutDestructors):
2284         (Heap):
2285         * heap/MarkStack.cpp:
2286         (JSC::visitChildren):
2287         * heap/MarkedAllocator.h:
2288         (JSC):
2289         (MarkedAllocator):
2290         * heap/MarkedSpace.h:
2291         (JSC):
2292         (MarkedSpace):
2293         (JSC::MarkedSpace::firstAllocator):
2294         * interpreter/CallFrame.cpp:
2295         (JSC):
2296         (JSC::CallFrame::bytecodeOffsetForNonDFGCode):
2297         (JSC::CallFrame::setBytecodeOffsetForNonDFGCode):
2298         (JSC::CallFrame::currentVPC):
2299         (JSC::CallFrame::setCurrentVPC):
2300         (JSC::CallFrame::trueCallerFrame):
2301         * interpreter/CallFrame.h:
2302         (JSC::ExecState::hasReturnPC):
2303         (JSC::ExecState::clearReturnPC):
2304         (ExecState):
2305         (JSC::ExecState::bytecodeOffsetForNonDFGCode):
2306         (JSC::ExecState::currentVPC):
2307         (JSC::ExecState::setCurrentVPC):
2308         * interpreter/Interpreter.cpp:
2309         (JSC::Interpreter::Interpreter):
2310         (JSC::Interpreter::~Interpreter):
2311         (JSC):
2312         (JSC::Interpreter::initialize):
2313         (JSC::Interpreter::isOpcode):
2314         (JSC::Interpreter::unwindCallFrame):
2315         (JSC::getCallerInfo):
2316         (JSC::Interpreter::privateExecute):
2317         (JSC::Interpreter::retrieveLastCaller):
2318         * interpreter/Interpreter.h:
2319         (JSC):
2320         (Interpreter):
2321         (JSC::Interpreter::getOpcode):
2322         (JSC::Interpreter::getOpcodeID):
2323         (JSC::Interpreter::classicEnabled):
2324         * interpreter/RegisterFile.h:
2325         (JSC):
2326         (RegisterFile):
2327         * jit/ExecutableAllocator.h:
2328         (JSC):
2329         * jit/HostCallReturnValue.cpp: Added.
2330         (JSC):
2331         (JSC::getHostCallReturnValueWithExecState):
2332         * jit/HostCallReturnValue.h: Added.
2333         (JSC):
2334         (JSC::initializeHostCallReturnValue):
2335         * jit/JIT.cpp:
2336         (JSC::JIT::privateCompileMainPass):
2337         (JSC::JIT::privateCompileSlowCases):
2338         (JSC::JIT::privateCompile):
2339         * jit/JITCode.h:
2340         (JSC::JITCode::isOptimizingJIT):
2341         (JITCode):
2342         (JSC::JITCode::isBaselineCode):
2343         (JSC::JITCode::JITCode):
2344         * jit/JITDriver.h:
2345         (JSC::jitCompileIfAppropriate):
2346         (JSC::jitCompileFunctionIfAppropriate):
2347         * jit/JITExceptions.cpp:
2348         (JSC::jitThrow):
2349         * jit/JITInlineMethods.h:
2350         (JSC::JIT::updateTopCallFrame):
2351         * jit/JITStubs.cpp:
2352         (JSC::DEFINE_STUB_FUNCTION):
2353         (JSC):
2354         * jit/JITStubs.h:
2355         (JSC):
2356         * jit/JSInterfaceJIT.h:
2357         * llint: Added.
2358         * llint/LLIntCommon.h: Added.
2359         * llint/LLIntData.cpp: Added.
2360         (LLInt):
2361         (JSC::LLInt::Data::Data):
2362         (JSC::LLInt::Data::performAssertions):
2363         (JSC::LLInt::Data::~Data):
2364         * llint/LLIntData.h: Added.
2365         (JSC):
2366         (LLInt):
2367         (Data):
2368         (JSC::LLInt::Data::exceptionInstructions):
2369         (JSC::LLInt::Data::opcodeMap):
2370         (JSC::LLInt::Data::performAssertions):
2371         * llint/LLIntEntrypoints.cpp: Added.
2372         (LLInt):
2373         (JSC::LLInt::getFunctionEntrypoint):
2374         (JSC::LLInt::getEvalEntrypoint):
2375         (JSC::LLInt::getProgramEntrypoint):
2376         * llint/LLIntEntrypoints.h: Added.
2377         (JSC):
2378         (LLInt):
2379         (JSC::LLInt::getEntrypoint):
2380         * llint/LLIntExceptions.cpp: Added.
2381         (LLInt):
2382         (JSC::LLInt::interpreterThrowInCaller):
2383         (JSC::LLInt::returnToThrowForThrownException):
2384         (JSC::LLInt::returnToThrow):
2385         (JSC::LLInt::callToThrow):
2386         * llint/LLIntExceptions.h: Added.
2387         (JSC):
2388         (LLInt):
2389         * llint/LLIntOfflineAsmConfig.h: Added.
2390         * llint/LLIntOffsetsExtractor.cpp: Added.
2391         (JSC):
2392         (LLIntOffsetsExtractor):
2393         (JSC::LLIntOffsetsExtractor::dummy):
2394         (main):
2395         * llint/LLIntSlowPaths.cpp: Added.
2396         (LLInt):
2397         (JSC::LLInt::llint_trace_operand):
2398         (JSC::LLInt::llint_trace_value):
2399         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2400         (JSC::LLInt::traceFunctionPrologue):
2401         (JSC::LLInt::shouldJIT):
2402         (JSC::LLInt::entryOSR):
2403         (JSC::LLInt::resolveGlobal):
2404         (JSC::LLInt::getByVal):
2405         (JSC::LLInt::handleHostCall):
2406         (JSC::LLInt::setUpCall):
2407         (JSC::LLInt::genericCall):
2408         * llint/LLIntSlowPaths.h: Added.
2409         (JSC):
2410         (LLInt):
2411         * llint/LLIntThunks.cpp: Added.
2412         (LLInt):
2413         (JSC::LLInt::generateThunkWithJumpTo):
2414         (JSC::LLInt::functionForCallEntryThunkGenerator):
2415         (JSC::LLInt::functionForConstructEntryThunkGenerator):
2416         (JSC::LLInt::functionForCallArityCheckThunkGenerator):
2417         (JSC::LLInt::functionForConstructArityCheckThunkGenerator):
2418         (JSC::LLInt::evalEntryThunkGenerator):
2419         (JSC::LLInt::programEntryThunkGenerator):
2420         * llint/LLIntThunks.h: Added.
2421         (JSC):
2422         (LLInt):
2423         * llint/LowLevelInterpreter.asm: Added.
2424         * llint/LowLevelInterpreter.cpp: Added.
2425         * llint/LowLevelInterpreter.h: Added.
2426         * offlineasm: Added.
2427         * offlineasm/armv7.rb: Added.
2428         * offlineasm/asm.rb: Added.
2429         * offlineasm/ast.rb: Added.
2430         * offlineasm/backends.rb: Added.
2431         * offlineasm/generate_offset_extractor.rb: Added.
2432         * offlineasm/instructions.rb: Added.
2433         * offlineasm/offset_extractor_constants.rb: Added.
2434         * offlineasm/offsets.rb: Added.
2435         * offlineasm/opt.rb: Added.
2436         * offlineasm/parser.rb: Added.
2437         * offlineasm/registers.rb: Added.
2438         * offlineasm/self_hash.rb: Added.
2439         * offlineasm/settings.rb: Added.
2440         * offlineasm/transform.rb: Added.
2441         * offlineasm/x86.rb: Added.
2442         * runtime/CodeSpecializationKind.h: Added.
2443         (JSC):
2444         * runtime/CommonSlowPaths.h:
2445         (JSC::CommonSlowPaths::arityCheckFor):
2446         (CommonSlowPaths):
2447         * runtime/Executable.cpp:
2448         (JSC::jettisonCodeBlock):
2449         (JSC):
2450         (JSC::EvalExecutable::jitCompile):
2451         (JSC::samplingDescription):
2452         (JSC::EvalExecutable::compileInternal):
2453         (JSC::ProgramExecutable::jitCompile):
2454         (JSC::ProgramExecutable::compileInternal):
2455         (JSC::FunctionExecutable::baselineCodeBlockFor):
2456         (JSC::FunctionExecutable::jitCompileForCall):
2457         (JSC::FunctionExecutable::jitCompileForConstruct):
2458         (JSC::FunctionExecutable::compileForCallInternal):
2459         (JSC::FunctionExecutable::compileForConstructInternal):
2460         * runtime/Executable.h:
2461         (JSC):
2462         (EvalExecutable):
2463         (ProgramExecutable):
2464         (FunctionExecutable):
2465         (JSC::FunctionExecutable::jitCompileFor):
2466         * runtime/ExecutionHarness.h: Added.
2467         (JSC):
2468         (JSC::prepareForExecution):
2469         (JSC::prepareFunctionForExecution):
2470         * runtime/JSArray.h:
2471         (JSC):
2472         (JSArray):
2473         * runtime/JSCell.h:
2474         (JSC):
2475         (JSCell):
2476         * runtime/JSFunction.h:
2477         (JSC):
2478         (JSFunction):
2479         * runtime/JSGlobalData.cpp:
2480         (JSC::JSGlobalData::JSGlobalData):
2481         * runtime/JSGlobalData.h:
2482         (JSC):
2483         (JSGlobalData):
2484         * runtime/JSGlobalObject.h:
2485         (JSC):
2486         (JSGlobalObject):
2487         * runtime/JSObject.h:
2488         (JSC):
2489         (JSObject):
2490         (JSFinalObject):
2491         * runtime/JSPropertyNameIterator.h:
2492         (JSC):
2493         (JSPropertyNameIterator):
2494         * runtime/JSString.h:
2495         (JSC):
2496         (JSString):
2497         * runtime/JSTypeInfo.h:
2498         (JSC):
2499         (TypeInfo):
2500         * runtime/JSValue.cpp:
2501         (JSC::JSValue::description):
2502         * runtime/JSValue.h:
2503         (LLInt):
2504         (JSValue):
2505         * runtime/JSVariableObject.h:
2506         (JSC):
2507         (JSVariableObject):
2508         * runtime/Options.cpp:
2509         (Options):
2510         (JSC::Options::initializeOptions):
2511         * runtime/Options.h:
2512         (Options):
2513         * runtime/ScopeChain.h:
2514         (JSC):
2515         (ScopeChainNode):
2516         * runtime/Structure.cpp:
2517         (JSC::Structure::addPropertyTransition):
2518         * runtime/Structure.h:
2519         (JSC):
2520         (Structure):
2521         * runtime/StructureChain.h:
2522         (JSC):
2523         (StructureChain):
2524         * wtf/InlineASM.h:
2525         * wtf/Platform.h:
2526         * wtf/SentinelLinkedList.h:
2527         (SentinelLinkedList):
2528         (WTF::SentinelLinkedList::isEmpty):
2529         * wtf/text/StringImpl.h:
2530         (JSC):
2531         (StringImpl):
2532
2533 2012-02-20  Filip Pizlo  <fpizlo@apple.com>
2534
2535         Unreviewed, rolling out http://trac.webkit.org/changeset/108291
2536         It completely broke the 32-bit JIT.
2537
2538         * heap/CopiedAllocator.h:
2539         * heap/CopiedSpace.h:
2540         (CopiedSpace):
2541         * heap/Heap.h:
2542         (JSC::Heap::allocatorForObjectWithDestructor):
2543         * jit/JIT.cpp:
2544         (JSC::JIT::privateCompileSlowCases):
2545         * jit/JIT.h:
2546         (JIT):
2547         * jit/JITInlineMethods.h:
2548         (JSC):
2549         * jit/JITOpcodes.cpp:
2550         (JSC::JIT::emit_op_new_array):
2551         * runtime/JSArray.cpp:
2552         (JSC::storageSize):
2553         (JSC):
2554         * runtime/JSArray.h:
2555         (ArrayStorage):
2556         (JSArray):
2557
2558 2012-02-20  Gavin Barraclough  <barraclough@apple.com>
2559
2560         [[Put]] should throw if prototype chain contains a readonly property.
2561         https://bugs.webkit.org/show_bug.cgi?id=79069
2562
2563         Reviewed by Oliver Hunt.
2564
2565         Currently we only check the base of the put, not the prototype chain.
2566         Fold this check in with the test for accessors.
2567
2568         * runtime/JSObject.cpp:
2569         (JSC::JSObject::put):
2570             - Updated to test all objects in the propotype chain for readonly properties.
2571         (JSC::JSObject::putDirectAccessor):
2572         (JSC::putDescriptor):
2573             - Record the presence of readonly properties on the structure.
2574         * runtime/Structure.cpp:
2575         (JSC::Structure::Structure):
2576             - hasGetterSetterPropertiesExcludingProto expanded to hasReadOnlyOrGetterSetterPropertiesExcludingProto.
2577         * runtime/Structure.h:
2578         (JSC::Structure::hasReadOnlyOrGetterSetterPropertiesExcludingProto):
2579         (JSC::Structure::setHasGetterSetterProperties):
2580             - hasGetterSetterPropertiesExcludingProto expanded to hasReadOnlyOrGetterSetterPropertiesExcludingProto.
2581         (JSC::Structure::setContainsReadOnlyProperties):
2582             - Added.
2583
2584 2012-02-20  Mark Hahnenberg  <mhahnenberg@apple.com>
2585
2586         Implement fast path for op_new_array in the baseline JIT
2587         https://bugs.webkit.org/show_bug.cgi?id=78612
2588
2589         Reviewed by Filip Pizlo.
2590
2591         * heap/CopiedAllocator.h:
2592         (CopiedAllocator): Friended the JIT to allow access to m_currentOffset.
2593         * heap/CopiedSpace.h:
2594         (CopiedSpace): Friended the JIT to allow access to 
2595         (JSC::CopiedSpace::allocator):
2596         * heap/Heap.h:
2597         (JSC::Heap::storageAllocator): Added a getter for the CopiedAllocator class so the JIT
2598         can use it for simple allocation i.e. when we can just bump the offset without having to 
2599         do anything else.
2600         * jit/JIT.cpp:
2601         (JSC::JIT::privateCompileSlowCases): Added new slow case for op_new_array for when
2602         we have to bail out because the fast allocation path fails for whatever reason.
2603         * jit/JIT.h:
2604         (JIT):
2605         * jit/JITInlineMethods.h:
2606         (JSC::JIT::emitAllocateBasicStorage): Added utility function that allows objects to 
2607         allocate generic backing stores. This function is used by emitAllocateJSArray.
2608         (JSC):
2609         (JSC::JIT::emitAllocateJSArray): Added utility function that allows the client to 
2610         more easily allocate JSArrays. This function is used by emit_op_new_array and I expect 
2611         it will also be used for emit_op_new_array_buffer.
2612         * jit/JITOpcodes.cpp:
2613         (JSC::JIT::emit_op_new_array): Changed to do inline allocation of JSArrays. Still does 
2614         a stub call for oversize arrays.
2615         (JSC):
2616         (JSC::JIT::emitSlow_op_new_array): Just bails out to a stub call if we fail in any way on 
2617         the fast path.
2618         * runtime/JSArray.cpp:
2619         (JSC):
2620         * runtime/JSArray.h: Added lots of offset functions for all the fields that we need to 
2621         initialize in the JIT.
2622         (ArrayStorage):
2623         (JSC::ArrayStorage::lengthOffset):
2624         (JSC::ArrayStorage::numValuesInVectorOffset):
2625         (JSC::ArrayStorage::allocBaseOffset):
2626         (JSC::ArrayStorage::vectorOffset):
2627         (JSArray):
2628         (JSC::JSArray::sparseValueMapOffset):
2629         (JSC::JSArray::subclassDataOffset):
2630         (JSC::JSArray::indexBiasOffset):
2631         (JSC):
2632         (JSC::JSArray::storageSize): Moved this function from being a static function in the cpp file
2633         to being a static function in the JSArray class. This move allows the JIT to call it to 
2634         see what size it should allocate.
2635
2636 2012-02-20  Gavin Barraclough  <barraclough@apple.com>
2637
2638         DefineOwnProperty fails with numeric properties & Object.prototype
2639         https://bugs.webkit.org/show_bug.cgi?id=79059
2640
2641         Reviewed by Oliver Hunt.
2642
2643         ObjectPrototype caches whether it contains any numeric properties (m_hasNoPropertiesWithUInt32Names),
2644         calls to defineOwnProperty need to update this cache.
2645
2646         * runtime/ObjectPrototype.cpp:
2647         (JSC::ObjectPrototype::put):
2648         (JSC::ObjectPrototype::defineOwnProperty):
2649         (JSC):
2650         (JSC::ObjectPrototype::getOwnPropertySlotByIndex):
2651         * runtime/ObjectPrototype.h:
2652         (ObjectPrototype):
2653
2654 2012-02-20  Pino Toscano  <pino@debian.org>
2655
2656         Does not build on GNU Hurd
2657         https://bugs.webkit.org/show_bug.cgi?id=79045
2658
2659         Reviewed by Gustavo Noronha Silva.
2660
2661         * wtf/Platform.h: define WTF_OS_HURD.
2662         * wtf/ThreadIdentifierDataPthreads.cpp: adds a band-aid fix
2663         for the lack of PTHREAD_KEYS_MAX definition, with a value which
2664         should not cause issues.
2665
2666 2012-02-20  Gavin Barraclough  <barraclough@apple.com>
2667
2668         Unreviewed windows build fix.
2669
2670         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2671
2672 2012-02-20  Mark Hahnenberg  <mhahnenberg@apple.com>
2673
2674         Undoing accidental changes
2675
2676         * heap/Heap.cpp:
2677         (JSC::Heap::collectAllGarbage):
2678
2679 2012-02-20  Mark Hahnenberg  <mhahnenberg@apple.com>
2680
2681         Factor out allocation in CopySpace into a separate CopyAllocator
2682         https://bugs.webkit.org/show_bug.cgi?id=78610
2683
2684         Reviewed by Oliver Hunt.
2685
2686         Added a new CopyAllocator class, which allows us to do allocations without 
2687         having to load the current offset and store the current offset in the current 
2688         block. This change will allow us to easily do inline assembly in the JIT for 
2689         array allocations.
2690
2691         * GNUmakefile.list.am:
2692         * JavaScriptCore.gypi:
2693         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2694         * JavaScriptCore.xcodeproj/project.pbxproj:
2695         * heap/CopiedAllocator.h: Added.
2696         (JSC):
2697         (CopiedAllocator):
2698         (JSC::CopiedAllocator::currentBlock):
2699         (JSC::CopiedAllocator::CopiedAllocator):
2700         (JSC::CopiedAllocator::allocate):
2701         (JSC::CopiedAllocator::fitsInCurrentBlock):
2702         (JSC::CopiedAllocator::wasLastAllocation):
2703         (JSC::CopiedAllocator::startedCopying):
2704         (JSC::CopiedAllocator::resetCurrentBlock):
2705         (JSC::CopiedAllocator::currentUtilization):
2706         (JSC::CopiedAllocator::resetLastAllocation):
2707         * heap/CopiedBlock.h:
2708         (CopiedBlock):
2709         * heap/CopiedSpace.cpp: Moved some stuff from CopiedSpaceInlineMethods to here because we 
2710         weren't really getting any benefits from having such big functions in a header file.
2711         (JSC::CopiedSpace::CopiedSpace):
2712         (JSC):
2713         (JSC::CopiedSpace::init):
2714         (JSC::CopiedSpace::tryAllocateSlowCase):
2715         (JSC::CopiedSpace::tryAllocateOversize):
2716         (JSC::CopiedSpace::tryReallocate):
2717         (JSC::CopiedSpace::tryReallocateOversize):
2718         (JSC::CopiedSpace::doneFillingBlock):
2719         (JSC::CopiedSpace::doneCopying):
2720         (JSC::CopiedSpace::getFreshBlock):
2721         * heap/CopiedSpace.h:
2722         (CopiedSpace):
2723         * heap/CopiedSpaceInlineMethods.h:
2724         (JSC):
2725         (JSC::CopiedSpace::startedCopying):
2726         (JSC::CopiedSpace::addNewBlock):
2727         (JSC::CopiedSpace::allocateNewBlock):
2728         (JSC::CopiedSpace::fitsInBlock):
2729         (JSC::CopiedSpace::tryAllocate):
2730         (JSC::CopiedSpace::allocateFromBlock):
2731         * heap/Heap.cpp:
2732         (JSC::Heap::collectAllGarbage):
2733         * heap/HeapBlock.h:
2734         (HeapBlock):
2735
2736 2012-02-20  Patrick Gansterer  <paroga@webkit.org>
2737
2738         Fix Visual Studio 2010 build.
2739
2740         * bytecompiler/NodesCodegen.cpp:
2741         (JSC::PropertyListNode::emitBytecode):
2742
2743 2012-02-16  Gavin Barraclough  <barraclough@apple.com>
2744
2745         Move special __proto__ property to Object.prototype
2746         https://bugs.webkit.org/show_bug.cgi?id=78409
2747
2748         Reviewed by Oliver Hunt.
2749
2750         Re-implement this as a regular accessor property.  This has three key benefits:
2751         1) It makes it possible for objects to be given properties named __proto__.
2752         2) Object.prototype.__proto__ can be deleted, preventing object prototypes from being changed.
2753         3) This largely removes the magic used the implement __proto__, it can just be made a regular accessor property.
2754
2755         * parser/Parser.cpp:
2756         (JSC::::parseFunctionInfo):
2757             - No need to prohibit functions named __proto__.
2758         * runtime/JSGlobalObject.cpp:
2759         (JSC::JSGlobalObject::reset):
2760             - Add __proto__ accessor to Object.prototype.
2761         * runtime/JSGlobalObjectFunctions.cpp:
2762         (JSC::globalFuncProtoGetter):
2763         (JSC::globalFuncProtoSetter):
2764             - Definition of the __proto__ accessor functions.
2765         * runtime/JSGlobalObjectFunctions.h:
2766             - Declaration of the __proto__ accessor functions.
2767         * runtime/JSObject.cpp:
2768         (JSC::JSObject::put):
2769             - Remove the special handling for __proto__, there is still a check to allow for a fast guard for accessors excluding __proto__.
2770         (JSC::JSObject::putDirectAccessor):
2771             - Track on the structure whether an object contains accessors other than one for __proto__.
2772         (JSC::JSObject::defineOwnProperty):
2773             - No need to prohibit definition of own properties named __proto__.
2774         * runtime/JSObject.h:
2775         (JSC::JSObject::inlineGetOwnPropertySlot):
2776             - Remove the special handling for __proto__.
2777         (JSC::JSValue::get):
2778             - Remove the special handling for __proto__.
2779         * runtime/JSString.cpp:
2780         (JSC::JSString::getOwnPropertySlot):
2781             - Remove the special handling for __proto__.
2782         * runtime/JSValue.h:
2783         (JSValue):
2784             - Made synthesizePrototype public (this may be needed by the __proto__ getter).
2785         * runtime/ObjectConstructor.cpp:
2786         (JSC::objectConstructorGetPrototypeOf):
2787             - Perform the security check & call prototype() directly.
2788         * runtime/Structure.cpp:
2789         (JSC::Structure::Structure):
2790             - Added 'ExcludingProto' variant of the 'hasGetterSetterProperties' state.
2791         * runtime/Structure.h:
2792         (JSC::Structure::hasGetterSetterPropertiesExcludingProto):
2793         (JSC::Structure::setHasGetterSetterProperties):
2794         (Structure):
2795             - Added 'ExcludingProto' variant of the 'hasGetterSetterProperties' state.
2796
2797 2012-02-20  Michael Saboff  <msaboff@apple.com>
2798
2799         Update toLower and toUpper tests for Unicode 6.1 changes
2800         https://bugs.webkit.org/show_bug.cgi?id=78923
2801
2802         Reviewed by Oliver Hunt.
2803
2804         * tests/mozilla/ecma/String/15.5.4.11-2.js: Updated the test
2805         to handle a third set of results for updated Unicode 6.1
2806         changes.
2807         (getTestCases):
2808         (TestCaseMultiExpected):
2809         (writeTestCaseResultMultiExpected):
2810         (getTestCaseResultMultiExpected):
2811         (test):
2812         (GetUnicodeValues):
2813         (DecimalToHexString):
2814
2815 2012-02-20  Andy Wingo  <wingo@igalia.com>
2816
2817         Remove unused features from CodeFeatures
2818         https://bugs.webkit.org/show_bug.cgi?id=78804
2819
2820         Reviewed by Gavin Barraclough.
2821
2822         * parser/Nodes.h:
2823         * parser/ASTBuilder.h:
2824         (JSC::ClosureFeature):
2825         (JSC::ASTBuilder::createFunctionBody):
2826         (JSC::ASTBuilder::usesClosures):
2827         Remove "ClosureFeature".  Since we track captured variables more
2828         precisely, this bit doesn't do us any good.
2829
2830         (JSC::AssignFeature):
2831         (JSC::ASTBuilder::makeAssignNode):
2832         (JSC::ASTBuilder::makePrefixNode):
2833         (JSC::ASTBuilder::makePostfixNode):
2834         (JSC::ASTBuilder::usesAssignment):
2835         Similarly, remove AssignFeature.  It is unused.
2836
2837 2012-02-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2838
2839         Unreviewed. Fix make distcheck issues.
2840
2841         * GNUmakefile.list.am: Add missing files.
2842
2843 2012-02-18  Sam Weinig  <sam@webkit.org>
2844
2845         Fix style issues in DFG Phase classes
2846         https://bugs.webkit.org/show_bug.cgi?id=78983
2847
2848         Reviewed by Ryosuke Niwa.
2849
2850         * dfg/DFGArithNodeFlagsInferencePhase.cpp:
2851         * dfg/DFGCFAPhase.cpp:
2852         * dfg/DFGCSEPhase.cpp:
2853         * dfg/DFGPredictionPropagationPhase.cpp:
2854         * dfg/DFGVirtualRegisterAllocationPhase.cpp:
2855         Add a space before the colon in class declarations.
2856
2857 2012-02-18  Filip Pizlo  <fpizlo@apple.com>
2858
2859         Attempt to fix Windows build.
2860
2861         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2862
2863 2012-02-18  Sam Weinig  <sam@webkit.org>
2864
2865         Fix the libc++ build.
2866
2867         Reviewed by Anders Carlsson.
2868
2869         * heap/Weak.h:
2870         Libc++'s nullptr emulation does not allow default construction
2871         of the nullptr_t type. Work around this with the arguably clearer
2872         just returning nullptr.
2873
2874 2012-02-18  Filip Pizlo  <fpizlo@apple.com>
2875
2876         DFGPropagator.cpp has too many things
2877         https://bugs.webkit.org/show_bug.cgi?id=78956
2878
2879         Reviewed by Oliver Hunt.
2880         
2881         Added the notion of a DFG::Phase. Removed DFG::Propagator, and took its
2882         various things and put them into separate files. These new phases follow
2883         the naming convention "DFG<name>Phase" where <name> is a noun. They are
2884         called via functions of the form "perform<name>".
2885
2886         * CMakeLists.txt:
2887         * GNUmakefile.list.am:
2888         * JavaScriptCore.xcodeproj/project.pbxproj:
2889         * Target.pri:
2890         * dfg/DFGArithNodeFlagsInferencePhase.cpp: Added.
2891         (DFG):
2892         (JSC::DFG::performArithNodeFlagsInference):
2893         * dfg/DFGArithNodeFlagsInferencePhase.h: Added.
2894         (DFG):
2895         * dfg/DFGCFAPhase.cpp: Added.
2896         (DFG):
2897         (JSC::DFG::performCFA):
2898         * dfg/DFGCFAPhase.h: Added.
2899         (DFG):
2900         * dfg/DFGCSEPhase.cpp: Added.
2901         (DFG):
2902         (JSC::DFG::performCSE):
2903         * dfg/DFGCSEPhase.h: Added.
2904         (DFG):
2905         * dfg/DFGDriver.cpp:
2906         (JSC::DFG::compile):
2907         * dfg/DFGPhase.cpp: Added.
2908         (DFG):
2909         (JSC::DFG::Phase::beginPhase):
2910         (JSC::DFG::Phase::endPhase):
2911         * dfg/DFGPhase.h: Added.
2912         (DFG):
2913         (Phase):
2914         (JSC::DFG::Phase::Phase):
2915         (JSC::DFG::Phase::~Phase):
2916         (JSC::DFG::Phase::globalData):
2917         (JSC::DFG::Phase::codeBlock):
2918         (JSC::DFG::Phase::profiledBlock):
2919         (JSC::DFG::Phase::beginPhase):
2920         (JSC::DFG::Phase::endPhase):
2921         (JSC::DFG::runPhase):
2922         * dfg/DFGPredictionPropagationPhase.cpp: Added.
2923         (DFG):
2924         (JSC::DFG::performPredictionPropagation):
2925         * dfg/DFGPredictionPropagationPhase.h: Added.
2926         (DFG):
2927         * dfg/DFGPropagator.cpp: Removed.
2928         * dfg/DFGPropagator.h: Removed.
2929         * dfg/DFGVirtualRegisterAllocationPhase.cpp: Added.
2930         (DFG):
2931         (JSC::DFG::performVirtualRegisterAllocation):
2932         * dfg/DFGVirtualRegisterAllocationPhase.h: Added.
2933         (DFG):
2934
2935 2012-02-17  Filip Pizlo  <fpizlo@apple.com>
2936
2937         DFG::Graph should have references to JSGlobalData, the CodeBlock being compiled, and
2938         the CodeBlock that was used for profiling
2939         https://bugs.webkit.org/show_bug.cgi?id=78954
2940
2941         Reviewed by Gavin Barraclough.
2942
2943         * bytecode/CodeBlock.h:
2944         (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
2945         (JSC):
2946         * dfg/DFGAbstractState.cpp:
2947         (JSC::DFG::AbstractState::AbstractState):
2948         (JSC::DFG::AbstractState::execute):
2949         * dfg/DFGAbstractState.h:
2950         * dfg/DFGAssemblyHelpers.h:
2951         (AssemblyHelpers):
2952         * dfg/DFGByteCodeParser.cpp:
2953         (JSC::DFG::ByteCodeParser::ByteCodeParser):
2954         (JSC::DFG::ByteCodeParser::handleCall):
2955         (JSC::DFG::parse):
2956         * dfg/DFGByteCodeParser.h:
2957         (DFG):
2958         * dfg/DFGDriver.cpp:
2959         (JSC::DFG::compile):
2960         * dfg/DFGGraph.cpp:
2961         (JSC::DFG::Graph::dump):
2962         (JSC::DFG::Graph::predictArgumentTypes):
2963         * dfg/DFGGraph.h:
2964         (JSC::DFG::Graph::Graph):
2965         (Graph):
2966         (JSC::DFG::Graph::getJSConstantPrediction):
2967         (JSC::DFG::Graph::addShouldSpeculateInteger):
2968         (JSC::DFG::Graph::isInt32Constant):
2969         (JSC::DFG::Graph::isDoubleConstant):
2970         (JSC::DFG::Graph::isNumberConstant):
2971         (JSC::DFG::Graph::isBooleanConstant):
2972         (JSC::DFG::Graph::isFunctionConstant):
2973         (JSC::DFG::Graph::valueOfJSConstant):
2974         (JSC::DFG::Graph::valueOfInt32Constant):
2975         (JSC::DFG::Graph::valueOfNumberConstant):
2976         (JSC::DFG::Graph::valueOfBooleanConstant):
2977         (JSC::DFG::Graph::valueOfFunctionConstant):
2978         (JSC::DFG::Graph::baselineCodeBlockFor):
2979         (JSC::DFG::Graph::valueProfileFor):
2980         (JSC::DFG::Graph::addImmediateShouldSpeculateInteger):
2981         * dfg/DFGJITCompiler.h:
2982         (JSC::DFG::JITCompiler::JITCompiler):
2983         (JITCompiler):
2984         * dfg/DFGOSRExit.cpp:
2985         (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
2986         * dfg/DFGPropagator.cpp:
2987         (JSC::DFG::Propagator::Propagator):
2988         (JSC::DFG::Propagator::isNotNegZero):
2989         (JSC::DFG::Propagator::isNotZero):
2990         (JSC::DFG::Propagator::propagateNodePredictions):
2991         (JSC::DFG::Propagator::doRoundOfDoubleVoting):
2992         (JSC::DFG::Propagator::globalCFA):
2993         (JSC::DFG::propagate):
2994         * dfg/DFGPropagator.h:
2995         (DFG):
2996         * dfg/DFGSpeculativeJIT.cpp:
2997         (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
2998         (JSC::DFG::SpeculativeJIT::compileAdd):
2999         (JSC::DFG::SpeculativeJIT::compileArithSub):
3000         * dfg/DFGSpeculativeJIT.h:
3001         (JSC::DFG::SpeculativeJIT::isConstant):
3002         (JSC::DFG::SpeculativeJIT::isJSConstant):
3003         (JSC::DFG::SpeculativeJIT::isInt32Constant):
3004         (JSC::DFG::SpeculativeJIT::isDoubleConstant):
3005         (JSC::DFG::SpeculativeJIT::isNumberConstant):
3006         (JSC::DFG::SpeculativeJIT::isBooleanConstant):
3007         (JSC::DFG::SpeculativeJIT::isFunctionConstant):
3008         (JSC::DFG::SpeculativeJIT::valueOfInt32Constant):
3009         (JSC::DFG::SpeculativeJIT::valueOfNumberConstant):
3010         (JSC::DFG::SpeculativeJIT::valueOfJSConstant):
3011         (JSC::DFG::SpeculativeJIT::valueOfBooleanConstant):
3012         (JSC::DFG::SpeculativeJIT::valueOfFunctionConstant):
3013         (JSC::DFG::SpeculativeJIT::speculationCheck):
3014         (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
3015
3016 2012-02-17  Ahmad Sharif  <asharif.tools@gmail.com>
3017
3018         There is a warning in memset in glibc that gets triggered through a
3019         warndecl when the fill-value of memset is a non-zero constant and the
3020         size is zero. This warning is enabled when building with
3021         -D_FORTIFY_SOURCE=2. This patch fixes the warning.
3022
3023         https://bugs.webkit.org/show_bug.cgi?id=78513
3024
3025         Reviewed by Alexey Proskuryakov
3026
3027         * wtf/Vector.h:
3028
3029 2012-02-17  Kalev Lember  <kalevlember@gmail.com>
3030
3031         Remove unused parameters from WTF threading API
3032         https://bugs.webkit.org/show_bug.cgi?id=78389
3033
3034         Reviewed by Adam Roben.
3035
3036         waitForThreadCompletion() had an out param 'void **result' to get the
3037         'void *' returned by ThreadFunction. However, the implementation in
3038         ThreadingWin.cpp ignored the out param, not filling it in. This had
3039         led to a situation where none of the client code made use of the param
3040         and just ignored it.
3041
3042         To clean this up, the patch changes the signature of ThreadFunction to
3043         return void instead of void* and drops the the unused 'void **result'
3044         parameter from waitForThreadCompletion. Also, all client code is
3045         updated for the API change.
3046
3047         As mentioned in https://bugs.webkit.org/show_bug.cgi?id=78389 , even
3048         though the change only affects internal API, Safari is using it
3049         directly and we'll need to keep the old versions around for ABI
3050         compatibility. For this, the patch adds compatibility wrappers with
3051         the old ABI.
3052
3053         * JavaScriptCore.order:
3054         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3055         * bytecode/SamplingTool.cpp:
3056         (JSC::SamplingThread::threadStartFunc):
3057         (JSC::SamplingThread::stop):
3058         * bytecode/SamplingTool.h:
3059         (SamplingThread):
3060         * heap/Heap.cpp:
3061         (JSC::Heap::~Heap):
3062         (JSC::Heap::blockFreeingThreadStartFunc):
3063         * heap/Heap.h:
3064         * heap/MarkStack.cpp:
3065         (JSC::MarkStackThreadSharedData::markingThreadStartFunc):
3066         (JSC::MarkStackThreadSharedData::~MarkStackThreadSharedData):
3067         * heap/MarkStack.h:
3068         (MarkStackThreadSharedData):
3069         * wtf/ParallelJobsGeneric.cpp:
3070         (WTF::ParallelEnvironment::ThreadPrivate::workerThread):
3071         * wtf/ParallelJobsGeneric.h:
3072         (ThreadPrivate):
3073         * wtf/ThreadFunctionInvocation.h: Update the signature of
3074         ThreadFunction.
3075         (WTF):
3076         * wtf/Threading.cpp:
3077         (WTF::threadEntryPoint): Update for ThreadFunction signature change.
3078         (WTF):
3079         (WTF::ThreadFunctionWithReturnValueInvocation::ThreadFunctionWithReturnValueInvocation):
3080         ABI compatibility function for Safari.
3081         (ThreadFunctionWithReturnValueInvocation): Ditto.
3082         (WTF::compatEntryPoint): Ditto.
3083         (WTF::createThread): Ditto.
3084         (WTF::waitForThreadCompletion): Ditto.
3085         * wtf/Threading.h: Update the signature of ThreadFunction and
3086         waitForThreadCompletion.
3087         (WTF):
3088         * wtf/ThreadingPthreads.cpp: Implement the new API.
3089         (WTF::wtfThreadEntryPoint):
3090         (WTF):
3091         (WTF::createThreadInternal):
3092         (WTF::waitForThreadCompletion):
3093         * wtf/ThreadingWin.cpp: Implement the new API.
3094         (WTF::wtfThreadEntryPoint):
3095         (WTF::waitForThreadCompletion):
3096
3097 2012-02-16  Oliver Hunt  <oliver@apple.com>
3098
3099         Implement Error.stack
3100         https://bugs.webkit.org/show_bug.cgi?id=66994
3101
3102         Reviewed by Gavin Barraclough.
3103
3104         Implement support for stack traces on exception objects.  This is a rewrite
3105         of the core portion of the last stack walking logic, but the mechanical work
3106         of adding the information to an exception comes from the original work by
3107         Juan Carlos Montemayor Elosua.
3108
3109         * interpreter/Interpreter.cpp:
3110         (JSC::getCallerInfo):
3111         (JSC):
3112         (JSC::getSourceURLFromCallFrame):
3113         (JSC::getStackFrameCodeType):
3114         (JSC::Interpreter::getStackTrace):
3115         (JSC::Interpreter::throwException):
3116         (JSC::Interpreter::privateExecute):
3117         * interpreter/Interpreter.h:
3118         (JSC):
3119         (StackFrame):
3120         (JSC::StackFrame::toString):
3121         (Interpreter):
3122         * jsc.cpp:
3123         (GlobalObject::finishCreation):
3124         (functionJSCStack):
3125         * parser/Nodes.h:
3126         (JSC::FunctionBodyNode::setInferredName):
3127         * parser/Parser.h:
3128         (JSC::::parse):
3129         * runtime/CommonIdentifiers.h:
3130         * runtime/Error.cpp:
3131         (JSC::addErrorInfo):
3132         * runtime/Error.h:
3133         (JSC):
3134
3135 2012-02-17  Mark Hahnenberg  <mhahnenberg@apple.com>
3136
3137         Rename Bump* to Copy*
3138         https://bugs.webkit.org/show_bug.cgi?id=78573
3139
3140         Reviewed by Geoffrey Garen.
3141
3142         Renamed anything with "Bump" in the name to have "Copied" instead.
3143
3144         * CMakeLists.txt:
3145         * GNUmakefile.list.am:
3146         * JavaScriptCore.gypi:
3147         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3148         * JavaScriptCore.xcodeproj/project.pbxproj:
3149         * Target.pri:
3150         * heap/BumpBlock.h: Removed.
3151         * heap/BumpSpace.cpp: Removed.
3152         * heap/BumpSpace.h: Removed.
3153         * heap/BumpSpaceInlineMethods.h: Removed.
3154         * heap/ConservativeRoots.cpp:
3155         (JSC::ConservativeRoots::ConservativeRoots):
3156         (JSC::ConservativeRoots::genericAddPointer):
3157         * heap/ConservativeRoots.h:
3158         (ConservativeRoots):
3159         * heap/CopiedBlock.h: Added.
3160         (JSC):
3161         (CopiedBlock):
3162         (JSC::CopiedBlock::CopiedBlock):
3163         * heap/CopiedSpace.cpp: Added.
3164         (JSC):
3165         (JSC::CopiedSpace::tryAllocateSlowCase):
3166         * heap/CopiedSpace.h: Added.
3167         (JSC):
3168         (CopiedSpace):
3169         (JSC::CopiedSpace::isInCopyPhase):
3170         (JSC::CopiedSpace::totalMemoryAllocated):
3171         (JSC::CopiedSpace::totalMemoryUtilized):
3172         * heap/CopiedSpaceInlineMethods.h: Added.
3173         (JSC):
3174         (JSC::CopiedSpace::CopiedSpace):
3175         (JSC::CopiedSpace::init):
3176         (JSC::CopiedSpace::contains):
3177         (JSC::CopiedSpace::pin):
3178         (JSC::CopiedSpace::startedCopying):
3179         (JSC::CopiedSpace::doneCopying):
3180         (JSC::CopiedSpace::doneFillingBlock):
3181         (JSC::CopiedSpace::recycleBlock):
3182         (JSC::CopiedSpace::getFreshBlock):
3183         (JSC::CopiedSpace::borrowBlock):
3184         (JSC::CopiedSpace::addNewBlock):
3185         (JSC::CopiedSpace::allocateNewBlock):
3186         (JSC::CopiedSpace::fitsInBlock):
3187         (JSC::CopiedSpace::fitsInCurrentBlock):
3188         (JSC::CopiedSpace::tryAllocate):
3189         (JSC::CopiedSpace::tryAllocateOversize):
3190         (JSC::CopiedSpace::allocateFromBlock):
3191         (JSC::CopiedSpace::tryReallocate):
3192         (JSC::CopiedSpace::tryReallocateOversize):
3193         (JSC::CopiedSpace::isOversize):
3194         (JSC::CopiedSpace::isPinned):
3195         (JSC::CopiedSpace::oversizeBlockFor):
3196         (JSC::CopiedSpace::blockFor):
3197         * heap/Heap.cpp:
3198         * heap/Heap.h:
3199         (JSC):
3200         (Heap):
3201         * heap/MarkStack.cpp:
3202         (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
3203         (JSC::SlotVisitor::drainFromShared):
3204         (JSC::SlotVisitor::startCopying):
3205         (JSC::SlotVisitor::allocateNewSpace):
3206         (JSC::SlotVisitor::doneCopying):
3207         * heap/MarkStack.h:
3208         (MarkStackThreadSharedData):
3209         * heap/SlotVisitor.h:
3210         (SlotVisitor):
3211         * runtime/JSArray.cpp:
3212         * runtime/JSObject.cpp:
3213
3214 2012-02-16  Yuqiang Xian  <yuqiang.xian@intel.com>
3215
3216         Add JSC code profiling support on Linux x86
3217         https://bugs.webkit.org/show_bug.cgi?id=78871
3218
3219         Reviewed by Gavin Barraclough.
3220
3221         We don't unwind the stack for now as we cannot guarantee all the
3222         libraries are compiled without -fomit-frame-pointer.
3223
3224         * tools/CodeProfile.cpp:
3225         (JSC::CodeProfile::sample):
3226         * tools/CodeProfiling.cpp:
3227         (JSC):
3228         (JSC::profilingTimer):
3229         (JSC::CodeProfiling::begin):
3230         (JSC::CodeProfiling::end):
3231
3232 2012-02-16  Csaba Osztrogonác  <ossy@webkit.org>
3233
3234         Unreviewed. Rolling out r107980, because it broke 32 bit platforms.
3235
3236         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3237         * interpreter/Interpreter.cpp:
3238         (JSC::Interpreter::throwException):
3239         (JSC::Interpreter::privateExecute):
3240         * interpreter/Interpreter.h:
3241         (JSC):
3242         (Interpreter):
3243         * jsc.cpp:
3244         (GlobalObject::finishCreation):
3245         * parser/Nodes.h:
3246         (JSC::FunctionBodyNode::setInferredName):
3247         * parser/Parser.h:
3248         (JSC::::parse):
3249         * runtime/CommonIdentifiers.h:
3250         * runtime/Error.cpp:
3251         (JSC::addErrorInfo):
3252         * runtime/Error.h:
3253         (JSC):
3254
3255 2012-02-16  Filip Pizlo  <fpizlo@apple.com>
3256
3257         ENABLE_INTERPRETER should be ENABLE_CLASSIC_INTERPRETER
3258         https://bugs.webkit.org/show_bug.cgi?id=78791
3259
3260         Rubber stamped by Oliver Hunt.
3261         
3262         Just a renaming, nothing more. Also renamed COMPUTED_GOTO_INTERPRETER to
3263         COMPUTED_GOTO_CLASSIC_INTERPRETER.
3264
3265         * bytecode/CodeBlock.cpp:
3266         (JSC::CodeBlock::dump):
3267         (JSC::CodeBlock::stronglyVisitStrongReferences):
3268         (JSC):
3269         (JSC::CodeBlock::shrinkToFit):
3270         * bytecode/CodeBlock.h:
3271         (CodeBlock):
3272         * bytecode/Instruction.h:
3273         (JSC::Instruction::Instruction):
3274         * bytecode/Opcode.h:
3275         (JSC::padOpcodeName):
3276         * bytecompiler/BytecodeGenerator.cpp:
3277         (JSC::BytecodeGenerator::emitResolve):
3278         (JSC::BytecodeGenerator::emitResolveWithBase):
3279         (JSC::BytecodeGenerator::emitGetById):
3280         (JSC::BytecodeGenerator::emitPutById):
3281         (JSC::BytecodeGenerator::emitDirectPutById):
3282         * interpreter/AbstractPC.cpp:
3283         (JSC::AbstractPC::AbstractPC):
3284         * interpreter/AbstractPC.h:
3285         (AbstractPC):
3286         * interpreter/CallFrame.h:
3287         (ExecState):
3288         * interpreter/Interpreter.cpp:
3289         (JSC):
3290         (JSC::Interpreter::initialize):
3291         (JSC::Interpreter::isOpcode):
3292         (JSC::Interpreter::unwindCallFrame):
3293         (JSC::Interpreter::execute):
3294         (JSC::Interpreter::privateExecute):
3295         (JSC::Interpreter::retrieveLastCaller):
3296         * interpreter/Interpreter.h:
3297         (JSC::Interpreter::getOpcode):
3298         (JSC::Interpreter::getOpcodeID):
3299         (Interpreter):
3300         * jit/ExecutableAllocatorFixedVMPool.cpp:
3301         (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
3302         * runtime/Executable.cpp:
3303         (JSC::EvalExecutable::compileInternal):
3304         (JSC::ProgramExecutable::compileInternal):
3305         (JSC::FunctionExecutable::compileForCallInternal):
3306         (JSC::FunctionExecutable::compileForConstructInternal):
3307         * runtime/Executable.h:
3308         (NativeExecutable):
3309         * runtime/JSGlobalData.cpp:
3310         (JSC::JSGlobalData::JSGlobalData):
3311         (JSC::JSGlobalData::getHostFunction):
3312         * runtime/JSGlobalData.h:
3313         (JSGlobalData):
3314         * wtf/OSAllocatorPosix.cpp:
3315         (WTF::OSAllocator::reserveAndCommit):
3316         * wtf/Platform.h:
3317
3318 2012-02-15  Geoffrey Garen  <ggaren@apple.com>
3319
3320         Made Weak<T> single-owner, adding PassWeak<T>
3321         https://bugs.webkit.org/show_bug.cgi?id=78740
3322
3323         Reviewed by Sam Weinig.
3324
3325         This works basically the same way as OwnPtr<T> and PassOwnPtr<T>.
3326
3327         This clarifies the semantics of finalizers: It's ambiguous and probably
3328         a bug to copy a finalizer (i.e., it's a bug to run a C++ destructor
3329         twice), so I've made Weak<T> non-copyable. Anywhere we used to copy a 
3330         Weak<T>, we now use PassWeak<T>.
3331
3332         This also makes Weak<T> HashMaps more efficient.
3333
3334         * API/JSClassRef.cpp:
3335         (OpaqueJSClass::prototype): Use PassWeak<T> instead of set(), since 
3336         set() is gone now.
3337
3338         * JavaScriptCore.xcodeproj/project.pbxproj: Export!
3339
3340         * heap/PassWeak.h: Added.
3341         (JSC):
3342         (PassWeak):
3343         (JSC::PassWeak::PassWeak):
3344         (JSC::PassWeak::~PassWeak):
3345         (JSC::PassWeak::get):
3346         (JSC::::leakHandle):
3347         (JSC::adoptWeak):
3348         (JSC::operator==):
3349         (JSC::operator!=): This is the Weak<T> version of PassOwnPtr<T>.
3350
3351         * heap/Weak.h:
3352         (Weak):
3353         (JSC::Weak::Weak):
3354         (JSC::Weak::release):
3355         (JSC::Weak::hashTableDeletedValue):
3356         (JSC::=):
3357         (JSC): Changed to be non-copyable, removing a lot of copying-related
3358         APIs. Added hash traits so hash maps still work.
3359
3360         * jit/JITStubs.cpp:
3361         (JSC::JITThunks::hostFunctionStub):
3362         * runtime/RegExpCache.cpp:
3363         (JSC::RegExpCache::lookupOrCreate): Use PassWeak<T>, as required by
3364         our new hash map API.
3365
3366 2012-02-16  Mark Hahnenberg  <mhahnenberg@apple.com>
3367
3368         Fix the broken viewport tests
3369         https://bugs.webkit.org/show_bug.cgi?id=78774
3370
3371         Reviewed by Kenneth Rohde Christiansen.
3372
3373         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3374         * wtf/text/WTFString.cpp:
3375         (WTF):
3376         (WTF::toDoubleType): Template-ized to allow other functions to specify whether they
3377         want to allow trailing junk or not when calling strtod.
3378         (WTF::charactersToDouble):
3379         (WTF::charactersToFloat):
3380         (WTF::charactersToFloatIgnoringJunk): Created new version of charactersToFloat that allows 
3381         trailing junk.
3382         * wtf/text/WTFString.h:
3383         (WTF):
3384
3385 2012-02-16  Oliver Hunt  <oliver@apple.com>
3386
3387         Implement Error.stack
3388         https://bugs.webkit.org/show_bug.cgi?id=66994
3389
3390         Reviewed by Gavin Barraclough.
3391
3392         Implement support for stack traces on exception objects.  This is a rewrite
3393         of the core portion of the last stack walking logic, but the mechanical work
3394         of adding the information to an exception comes from the original work by
3395         Juan Carlos Montemayor Elosua.
3396
3397         * interpreter/Interpreter.cpp:
3398         (JSC::getCallerInfo):
3399         (JSC):
3400         (JSC::getSourceURLFromCallFrame):
3401         (JSC::getStackFrameCodeType):
3402         (JSC::Interpreter::getStackTrace):
3403         (JSC::Interpreter::throwException):
3404         (JSC::Interpreter::privateExecute):
3405         * interpreter/Interpreter.h:
3406         (JSC):
3407         (StackFrame):
3408         (JSC::StackFrame::toString):
3409         (Interpreter):
3410         * jsc.cpp:
3411         (GlobalObject::finishCreation):
3412         (functionJSCStack):
3413         * parser/Nodes.h:
3414         (JSC::FunctionBodyNode::setInferredName):
3415         * parser/Parser.h:
3416         (JSC::::parse):
3417         * runtime/CommonIdentifiers.h:
3418         * runtime/Error.cpp:
3419         (JSC::addErrorInfo):
3420         * runtime/Error.h:
3421         (JSC):
3422
3423 2012-02-15  Gavin Barraclough  <barraclough@apple.com>
3424
3425         Numerous trivial bugs in Object.defineProperty
3426         https://bugs.webkit.org/show_bug.cgi?id=78777
3427
3428         Reviewed by Sam Weinig.
3429
3430         There are a handful of really trivial bugs, related to Object.defineProperty:
3431             * Redefining an accessor with different attributes changes the attributes, but not the get/set functions!
3432             * Calling an undefined setter should only throw in strict mode.
3433             * When redefining an accessor to a data decriptor, if writable is not specified we should default to false.
3434             * Any attempt to redefine a non-configurable property of an array as configurable should be rejected.
3435             * Object.defineProperties should call toObject on 'Properties' argument, rather than throwing if it is not an object.
3436             * If preventExtensions has been called on an array, subsequent assignment beyond array bounds should fail.
3437             * 'isFrozen' shouldn't be checking the ReadOnly bit for accessor descriptors (we presently always keep this bit as 'false').
3438             * Should be able to redefine an non-writable, non-configurable property, with the same value and attributes.
3439             * Should be able to define an non-configurable accessor.
3440         These are mostly all one-line changes, e.g. inverted boolean checks, masking against wrong attribute.
3441
3442         * runtime/JSArray.cpp:
3443         (JSC::SparseArrayValueMap::put):
3444             - Added ASSERT.
3445             - Calling an undefined setter should only throw in strict mode.
3446         (JSC::JSArray::putDescriptor):
3447             - Should be able to define an non-configurable accessor.
3448         (JSC::JSArray::defineOwnNumericProperty):
3449             - Any attempt to redefine a non-configurable property of an array as configurable should be rejected.
3450         (JSC::JSArray::putByIndexBeyondVectorLength):
3451             - If preventExtensions has been called on an array, subsequent assignment beyond array bounds should fail.
3452         * runtime/JSArray.h:
3453         (JSArray):
3454             - made enterDictionaryMode public, called from JSObject.
3455         * runtime/JSObject.cpp:
3456         (JSC::JSObject::put):
3457             - Calling an undefined setter should only throw in strict mode.
3458         (JSC::JSObject::preventExtensions):
3459             - Put array objects into dictionary mode to handle this!
3460         (JSC::JSObject::defineOwnProperty):
3461             - Should be able to redefine an non-writable, non-configurable property, with the same value and attributes.
3462             - Redefining an accessor with different attributes changes the attributes, but not the get/set functions!
3463         * runtime/ObjectConstructor.cpp:
3464         (JSC::objectConstructorDefineProperties):
3465             - Object.defineProperties should call toObject on 'Properties' argument, rather than throwing if it is not an object.
3466         * runtime/PropertyDescriptor.cpp:
3467         (JSC::PropertyDescriptor::attributesWithOverride):
3468             - When redefining an accessor to a data decriptor, if writable is not specified we should default to false.
3469         (JSC::PropertyDescriptor::attributesOverridingCurrent):
3470             - When redefining an accessor to a data decriptor, if writable is not specified we should default to false.
3471         * runtime/Structure.cpp:
3472         (JSC::Structure::freezeTransition):
3473             - 'freezeTransition' shouldn't be setting the ReadOnly bit for accessor descriptors (we presently always keep this bit as 'false').
3474         (JSC::Structure::isFrozen):
3475             - 'isFrozen' shouldn't be checking the ReadOnly bit for accessor descriptors (we presently always keep this bit as 'false').
3476
3477 2012-02-13  Filip Pizlo  <fpizlo@apple.com>
3478
3479         DFG should not check the types of arguments that are dead
3480         https://bugs.webkit.org/show_bug.cgi?id=78518
3481
3482         Reviewed by Geoff Garen.
3483         
3484         The argument checks are now elided if the corresponding SetArgument is dead,
3485         and the abstract value of the argument is set to bottom (None, []). This is
3486         performance neutral on the benchmarks we currently track.
3487
3488         * dfg/DFGAbstractState.cpp:
3489         (JSC::DFG::AbstractState::initialize):
3490         * dfg/DFGSpeculativeJIT.cpp:
3491         (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
3492
3493 2012-02-15  Oliver Hunt  <oliver@apple.com>
3494
3495         Ensure that the DFG JIT always plants a CodeOrigin when making calls
3496         https://bugs.webkit.org/show_bug.cgi?id=78763
3497
3498         Reviewed by Gavin Barraclough.
3499
3500         Make all calls plant a CodeOrigin prior to the actual
3501         call.  Also clobbers the Interpreter with logic to ensure
3502         that the interpreter always plants a bytecode offset.
3503
3504         * dfg/DFGJITCompiler.cpp:
3505         (JSC::DFG::JITCompiler::link):
3506         (JSC::DFG::JITCompiler::compileFunction):
3507         * dfg/DFGJITCompiler.h:
3508         (CallBeginToken):
3509         (JSC::DFG::JITCompiler::beginJSCall):
3510         (JSC::DFG::JITCompiler::beginCall):
3511         * dfg/DFGRepatch.cpp:
3512         (JSC::DFG::tryBuildGetByIDList):
3513         * dfg/DFGSpeculativeJIT.h:
3514         (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck):
3515         * dfg/DFGSpeculativeJIT32_64.cpp:
3516         (JSC::DFG::SpeculativeJIT::emitCall):
3517         * dfg/DFGSpeculativeJIT64.cpp:
3518         (JSC::DFG::SpeculativeJIT::emitCall):
3519         * interpreter/AbstractPC.cpp:
3520         (JSC::AbstractPC::AbstractPC):
3521         * interpreter/CallFrame.cpp:
3522         (JSC::CallFrame::trueCallFrame):
3523         * interpreter/CallFrame.h:
3524         (JSC::ExecState::bytecodeOffsetForNonDFGCode):
3525         (ExecState):
3526         (JSC::ExecState::setBytecodeOffsetForNonDFGCode):
3527         (JSC::ExecState::codeOriginIndexForDFG):
3528
3529 2012-02-14  Oliver Hunt  <oliver@apple.com>
3530
3531         Fix Interpreter.
3532
3533         * runtime/Executable.cpp:
3534         (JSC):
3535         * runtime/Executable.h:
3536         (ExecutableBase):
3537
3538 2012-02-14  Matt Lilek  <mrl@apple.com>
3539
3540         Don't ENABLE_DASHBOARD_SUPPORT unconditionally on all Mac platforms
3541         https://bugs.webkit.org/show_bug.cgi?id=78629
3542
3543         Reviewed by David Kilzer.
3544
3545         * Configurations/FeatureDefines.xcconfig:
3546
3547 2012-02-14  Filip Pizlo  <fpizlo@apple.com>
3548
3549         Unreviewed, build fix for non-DFG platforms.
3550
3551         * assembler/MacroAssembler.h:
3552         (MacroAssembler):
3553
3554 2012-02-14  Filip Pizlo  <fpizlo@apple.com>
3555
3556         Unreviewed, fix build and configuration goof.
3557
3558         * assembler/MacroAssembler.h:
3559         (JSC::MacroAssembler::invert):
3560         * dfg/DFGCommon.h:
3561
3562 2012-02-13  Filip Pizlo  <fpizlo@apple.com>
3563
3564         DFG should be able to emit code on control flow edges
3565         https://bugs.webkit.org/show_bug.cgi?id=78515
3566
3567         Reviewed by Gavin Barraclough.
3568         
3569         This gets us a few steps closer to being able to perform global register allocation,
3570         by allowing us to have landing pads on control flow edges. This will let us reshuffle
3571         registers if it happens to be necessary due to different reg alloc decisions in
3572         differen blocks.
3573         
3574         This also introduces the notion of a landing pad for OSR entry, which will allow us
3575         to emit code that places data into registers when we're entering into the DFG from
3576         the old JIT.
3577         
3578         Finally, this patch introduces a verification mode that checks that the landing pads
3579         are actually emitted and do actually work as advertised. When verification is disabled,
3580         this has no effect on behavior.
3581
3582         * assembler/MacroAssembler.h:
3583         (MacroAssembler):
3584         (JSC::MacroAssembler::invert):
3585         (JSC::MacroAssembler::isInvertible):
3586         * dfg/DFGCommon.h:
3587         * dfg/DFGJITCompiler.cpp:
3588         (JSC::DFG::JITCompiler::compile):
3589         (JSC::DFG::JITCompiler::compileFunction):
3590         * dfg/DFGSpeculativeJIT.cpp:
3591         (JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch):
3592         (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
3593         (JSC::DFG::SpeculativeJIT::compilePeepHoleIntegerBranch):
3594         (JSC::DFG::SpeculativeJIT::compile):
3595         (JSC::DFG::SpeculativeJIT::createOSREntries):
3596         (DFG):
3597         (JSC::DFG::SpeculativeJIT::linkOSREntries):
3598         (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant):
3599         * dfg/DFGSpeculativeJIT.h:
3600         (SpeculativeJIT):
3601         (JSC::DFG::SpeculativeJIT::branchDouble):
3602         (JSC::DFG::SpeculativeJIT::branchDoubleNonZero):
3603         (JSC::DFG::SpeculativeJIT::branch32):
3604         (JSC::DFG::SpeculativeJIT::branchTest32):
3605         (JSC::DFG::SpeculativeJIT::branchPtr):
3606         (JSC::DFG::SpeculativeJIT::branchTestPtr):
3607         (JSC::DFG::SpeculativeJIT::branchTest8):
3608         (JSC::DFG::SpeculativeJIT::jump):
3609         (JSC::DFG::SpeculativeJIT::haveEdgeCodeToEmit):
3610         (JSC::DFG::SpeculativeJIT::emitEdgeCode):
3611         * dfg/DFGSpeculativeJIT32_64.cpp:
3612         (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
3613         (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
3614         (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
3615         (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
3616         (JSC::DFG::SpeculativeJIT::emitBranch):
3617         (JSC::DFG::SpeculativeJIT::compile):
3618         * dfg/DFGSpeculativeJIT64.cpp:
3619         (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
3620         (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
3621         (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
3622         (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
3623         (JSC::DFG::SpeculativeJIT::emitBranch):
3624         (JSC::DFG::SpeculativeJIT::compile):
3625
3626 2012-02-14  Filip Pizlo  <fpizlo@apple.com>
3627
3628         Assertion failure under JSC::DFG::AbstractState::execute loading economist.com
3629         https://bugs.webkit.org/show_bug.cgi?id=78153
3630         <rdar://problem/10861712> <rdar://problem/10861947>
3631
3632         Reviewed by Oliver Hunt.
3633
3634         * dfg/DFGAbstractState.cpp:
3635         (JSC::DFG::AbstractState::execute):
3636         * dfg/DFGSpeculativeJIT.cpp:
3637         (JSC::DFG::SpeculativeJIT::compileAdd):
3638
3639 2012-02-14  Eric Seidel  <eric@webkit.org>
3640
3641         Upstream Android's additions to Platform.h
3642         https://bugs.webkit.org/show_bug.cgi?id=78536
3643
3644         Reviewed by Adam Barth.
3645
3646         * wtf/Platform.h:
3647
3648 2012-02-12  Mark Hahnenberg  <mhahnenberg@apple.com>
3649
3650         Replace old strtod with new strtod
3651         https://bugs.webkit.org/show_bug.cgi?id=68044
3652
3653         Reviewed by Geoffrey Garen.
3654
3655         * parser/Lexer.cpp: Added template argument. This version allows junk after numbers.
3656         (JSC::::lex):
3657         * runtime/JSGlobalObjectFunctions.cpp: Ditto.
3658         (JSC::parseInt):
3659         (JSC::jsStrDecimalLiteral):
3660         * runtime/LiteralParser.cpp: Ditto.
3661         (JSC::::Lexer::lexNumber):
3662         * wtf/dtoa.cpp: Replaced old strtod with a new version that uses the new StringToDoubleConverter.
3663         It takes a template argument to allow clients to determine statically whether it should allow 
3664         junk after the numbers or not.
3665         (WTF):
3666         (WTF::strtod):
3667         * wtf/dtoa.h:
3668         (WTF):
3669         * wtf/text/WTFString.cpp: Added template argument. This version does not allow junk after numbers.
3670         (WTF::toDoubleType):
3671
3672 2012-02-13  Mark Hahnenberg  <mhahnenberg@apple.com>
3673
3674         More windows build fixing
3675
3676         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3677
3678 2012-02-13  Oliver Hunt  <oliver@apple.com>
3679
3680         Executing out of bounds in JSC::Yarr::YarrCodeBlock::execute / JSC::RegExp::match
3681         https://bugs.webkit.org/show_bug.cgi?id=76315
3682
3683         Reviewed by Gavin Barraclough.
3684
3685         Perform a 3 byte compare using two comparisons, rather than trying to perform the
3686         operation with a four byte load.
3687
3688         * yarr/YarrJIT.cpp:
3689         (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):
3690
3691 2012-02-13  Mark Hahnenberg  <mhahnenberg@apple.com>
3692
3693         Windows build fix
3694
3695         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3696
3697 2012-02-12  Mark Hahnenberg  <mhahnenberg@apple.com>
3698
3699         Replace old strtod with new strtod
3700         https://bugs.webkit.org/show_bug.cgi?id=68044
3701
3702         Reviewed by Geoffrey Garen.
3703
3704         * parser/Lexer.cpp: Added template argument. This version allows junk after numbers.
3705         (JSC::::lex):
3706         * runtime/JSGlobalObjectFunctions.cpp: Ditto.
3707         (JSC::parseInt):
3708         (JSC::jsStrDecimalLiteral):
3709         * runtime/LiteralParser.cpp: Ditto.
3710         (JSC::::Lexer::lexNumber):
3711         * wtf/dtoa.cpp: Replaced old strtod with a new version that uses the new StringToDoubleConverter.
3712         It takes a template argument to allow clients to determine statically whether it should allow 
3713         junk after the numbers or not.
3714         (WTF):
3715         (WTF::strtod):
3716         * wtf/dtoa.h:
3717         (WTF):
3718         * wtf/text/WTFString.cpp: Added template argument. This version does not allow junk after numbers.
3719         (WTF::toDoubleType):
3720
3721 2012-02-13  Sam Weinig  <sam@webkit.org>
3722
3723         Move JSC related assertions out of Assertions.h and into their own header
3724         https://bugs.webkit.org/show_bug.cgi?id=78508
3725
3726         Reviewed by Gavin Barraclough.
3727
3728         * GNUmakefile.list.am:
3729         * JavaScriptCore.gypi:
3730         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3731         * JavaScriptCore.xcodeproj/project.pbxproj:
3732         Add GCAssertions.h
3733
3734         * heap/GCAssertions.h: Added.
3735         Move assertions here.
3736
3737         * runtime/WriteBarrier.h:
3738         Add #include of GCAssertions.h
3739
3740         * wtf/Assertions.h:
3741         Remove JSC related assertions.
3742
3743         * wtf/Compiler.h:
3744         Add compiler check for __has_trivial_destructor.
3745
3746 2012-02-13  Chao-ying Fu  <fu@mips.com>
3747
3748         Update MIPS patchOffsetGetByIdSlowCaseCall
3749         https://bugs.webkit.org/show_bug.cgi?id=78392
3750
3751         Reviewed by Gavin Barraclough.
3752
3753         * jit/JIT.h:
3754         (JIT):
3755
3756 2012-02-13  Patrick Gansterer  <paroga@webkit.org>
3757
3758         Remove obsolete #if from ThreadSpecific.h
3759         https://bugs.webkit.org/show_bug.cgi?id=78485
3760
3761         Reviewed by Adam Roben.
3762
3763         Since alle platform use either pthread or Win32 for threading,
3764         we can remove all PLATFORM() preprocessor statements.
3765
3766         * wtf/ThreadSpecific.h:
3767         (ThreadSpecific):
3768
3769 2012-02-13  Jessie Berlin  <jberlin@apple.com>
3770
3771         Fix the Windows build.
3772
3773         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3774
3775 2012-02-13  Sam Weinig  <sam@webkit.org>
3776
3777         Use C11's _Static_assert for COMPILE_ASSERT if it is available
3778         https://bugs.webkit.org/show_bug.cgi?id=78506
3779
3780         Rubber-stamped by Antti Koivisto.
3781
3782         Use C11's _Static_assert for COMPILE_ASSERT if it is available to give slightly
3783         better error messages.
3784
3785         * wtf/Assertions.h:
3786         Use _Static_assert if it is available.
3787
3788         * wtf/Compiler.h:
3789         Add COMPILER_SUPPORTS support for _Static_assert when using the LLVM Compiler.
3790
3791 2012-02-13  Mario Sanchez Prada  <msanchez@igalia.com>
3792
3793         [GTK] Add GSList to the list of GObject types in GOwnPtr
3794         https://bugs.webkit.org/show_bug.cgi?id=78487
3795
3796         Reviewed by Philippe Normand.
3797
3798         Handle the GSList type in GOwnPtr, by calling g_slist_free in the
3799         implementation of the freeOwnedGPtr template function.
3800
3801         * wtf/gobject/GOwnPtr.cpp:
3802         (WTF::GSList):
3803         (WTF):
3804         * wtf/gobject/GOwnPtr.h:
3805         (WTF):
3806         * wtf/gobject/GTypedefs.h:
3807
3808 2012-02-06  Raphael Kubo da Costa  <kubo@profusion.mobi>
3809
3810         [EFL] Drop support for the Curl network backend.
3811         https://bugs.webkit.org/show_bug.cgi?id=77874
3812
3813         Reviewed by Eric Seidel.
3814
3815         Nobody seems to be maintaining the Curl backend in WebCore, the
3816         EFL port developers all seem to be using the Soup backend and the
3817         port itself has many features which are only implemented for the
3818         latter.
3819
3820         * wtf/PlatformEfl.cmake: Always build the gobject-dependent source
3821         files.
3822
3823 2012-02-13  Patrick Gansterer  <paroga@webkit.org>
3824
3825         Unreviewed. Build fix for !ENABLE(JIT) after r107485.
3826
3827         * bytecode/PolymorphicPutByIdList.cpp:
3828
3829 2012-02-13  Gavin Barraclough  <barraclough@apple.com>
3830
3831         https://bugs.webkit.org/show_bug.cgi?id=78434
3832         Unreviewed - temporarily reverting r107498 will I fix a couple of testcases.
3833
3834         * parser/Parser.cpp:
3835         (JSC::::parseFunctionInfo):
3836         * runtime/ClassInfo.h:
3837         (MethodTable):
3838         (JSC):
3839         * runtime/JSCell.cpp:
3840         (JSC):
3841         * runtime/JSCell.h:
3842         (JSCell):
3843         * runtime/JSGlobalObject.cpp:
3844         (JSC::JSGlobalObject::reset):
3845         * runtime/JSGlobalObjectFunctions.cpp:
3846         (JSC):
3847         * runtime/JSGlobalObjectFunctions.h:
3848         (JSC):
3849         * runtime/JSObject.cpp:
3850         (JSC::JSObject::put):
3851         (JSC):
3852         (JSC::JSObject::putDirectAccessor):
3853         (JSC::JSObject::defineOwnProperty):
3854         * runtime/JSObject.h:
3855         (JSC::JSObject::inlineGetOwnPropertySlot):
3856         (JSC::JSValue::get):
3857         * runtime/JSString.cpp:
3858         (JSC::JSString::getOwnPropertySlot):
3859         * runtime/JSValue.h:
3860         (JSValue):
3861         * runtime/ObjectConstructor.cpp:
3862         (JSC::objectConstructorGetPrototypeOf):
3863         * runtime/Structure.cpp:
3864         (JSC::Structure::Structure):
3865         * runtime/Structure.h:
3866         (JSC::Structure::setHasGetterSetterProperties):
3867         (Structure):
3868
3869 2012-02-12  Ashod Nakashian  <ashodnakashian@yahoo.com>
3870
3871         KeywordLookupGenerator.py script fails in some cases
3872         https://bugs.webkit.org/show_bug.cgi?id=77886
3873
3874         Reviewed by Benjamin Poulain.
3875
3876         * parser/Keywords.table: Converted to LF-only.
3877
3878 2012-02-12  Shinya Kawanaka  <shinyak@google.com>
3879
3880         Introduce ShadowRootList.
3881         https://bugs.webkit.org/show_bug.cgi?id=78069
3882
3883         Reviewed by Hajime Morita.
3884
3885         DoublyLinkedList should have tail() method to take the last element.
3886
3887         * wtf/DoublyLinkedList.h:
3888         (DoublyLinkedList):
3889         (WTF::::tail):
3890         (WTF):
3891
3892 2012-02-12  Raphael Kubo da Costa  <kubo@profusion.mobi>
3893
3894         [CMake] Move source files in WTF_HEADERS to WTF_SOURCES.
3895         https://bugs.webkit.org/show_bug.cgi?id=78436
3896
3897         Reviewed by Daniel Bates.
3898
3899         * wtf/CMakeLists.txt: Move .cpp files from WTF_HEADERS to WTF_SOURCES,
3900         and correctly sort the files which start with 'M'.
3901
3902 2012-02-12  Sam Weinig  <sam@webkit.org>
3903
3904         Move the NumberOfCores.h/cpp files into the WTF group of JavaScriptCore.xcodeproj.
3905
3906         Rubber-stamped by Anders Carlsson.
3907
3908         * JavaScriptCore.xcodeproj/project.pbxproj:
3909
3910 2012-02-12  Raphael Kubo da Costa  <kubo@profusion.mobi>
3911
3912         [CMake] Remove unused or empty variable definitions.
3913         https://bugs.webkit.org/show_bug.cgi?id=78437
3914
3915         Reviewed by Daniel Bates.
3916
3917         * CMakeLists.txt: Remove unused JavaScriptCore_HEADERS definition.
3918         * shell/CMakeLists.txt: Remove unused JSC_HEADERS definition.
3919         * wtf/CMakeLists.txt: Remove empty WTF_LIBRARIES definition, it will
3920         be defined later by Platform*.cmake via LIST(APPEND WTF_LIBRARIES).
3921
3922 2012-02-12  Filip Pizlo  <fpizlo@apple.com>
3923
3924         DFG::SpeculativeJIT calls fprintf() instead of dataLog in terminateSpeculativeExecution()
3925         https://bugs.webkit.org/show_bug.cgi?id=78431
3926
3927         Reviewed by Gavin Barraclough.
3928
3929         * dfg/DFGSpeculativeJIT.h:
3930         (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
3931
3932 2012-02-11  Benjamin Poulain  <benjamin@webkit.org>
3933
3934         Add back WTFURL to WebKit
3935         https://bugs.webkit.org/show_bug.cgi?id=77291
3936
3937         Reviewed by Adam Barth.
3938
3939         WTFURL was removed from WebKit in r86787.
3940
3941         This patch adds the code back to WTF with the following changes:
3942         -Guard the feature with USE(WTFURL).
3943         -Change the typename CHAR to CharacterType to follow recent WebKit conventions.
3944         -Fix some coding style to make check-webkit-style happy.
3945
3946         * JavaScriptCore.xcodeproj/project.pbxproj:
3947         * wtf/Platform.h:
3948         * wtf/url/api/ParsedURL.cpp: Added.
3949         (WTF):
3950         (WTF::ParsedURL::ParsedURL):
3951         (WTF::ParsedURL::scheme):
3952         (WTF::ParsedURL::username):
3953         (WTF::ParsedURL::password):
3954         (WTF::ParsedURL::host):
3955         (WTF::ParsedURL::port):
3956         (WTF::ParsedURL::path):
3957         (WTF::ParsedURL::query):
3958         (WTF::ParsedURL::fragment):
3959         (WTF::ParsedURL::segment):
3960         * wtf/url/api/ParsedURL.h: Added.
3961         (WTF):
3962         (ParsedURL):
3963         (WTF::ParsedURL::spec):
3964         * wtf/url/api/URLString.h: Added.
3965         (WTF):
3966         (URLString):
3967         (WTF::URLString::URLString):
3968         (WTF::URLString::string):
3969         * wtf/url/src/RawURLBuffer.h: Added.
3970         (WTF):
3971         (RawURLBuffer):
3972         (WTF::RawURLBuffer::RawURLBuffer):
3973         (WTF::RawURLBuffer::~RawURLBuffer):
3974         (WTF::RawURLBuffer::resize):
3975         * wtf/url/src/URLBuffer.h: Added.
3976         (WTF):
3977         (URLBuffer):
3978         (WTF::URLBuffer::URLBuffer):
3979         (WTF::URLBuffer::~URLBuffer):
3980         (WTF::URLBuffer::at):
3981         (WTF::URLBuffer::set):
3982         (WTF::URLBuffer::capacity):
3983         (WTF::URLBuffer::length):
3984         (WTF::URLBuffer::data):
3985         (WTF::URLBuffer::setLength):
3986         (WTF::URLBuffer::append):
3987         (WTF::URLBuffer::grow):
3988         * wtf/url/src/URLCharacterTypes.cpp: Added.
3989         (WTF):
3990         ():
3991         * wtf/url/src/URLCharacterTypes.h: Added.
3992         (WTF):
3993         (URLCharacterTypes):
3994         (WTF::URLCharacterTypes::isQueryChar):
3995         (WTF::URLCharacterTypes::isIPv4Char):
3996         (WTF::URLCharacterTypes::isHexChar):
3997         ():
3998         (WTF::URLCharacterTypes::isCharOfType):
3999         * wtf/url/src/URLComponent.h: Added.
4000         (WTF):
4001         (URLComponent):
4002         (WTF::URLComponent::URLComponent):
4003         (WTF::URLComponent::fromRange):
4004         (WTF::URLComponent::isValid):
4005         (WTF::URLComponent::isNonEmpty):
4006         (WTF::URLComponent::isEmptyOrInvalid):
4007         (WTF::URLComponent::reset):
4008         (WTF::URLComponent::operator==):
4009         (WTF::URLComponent::begin):
4010         (WTF::URLComponent::setBegin):
4011         (WTF::URLComponent::length):
4012         (WTF::URLComponent::setLength):
4013         (WTF::URLComponent::end):
4014         * wtf/url/src/URLEscape.cpp: Added.
4015         (WTF):
4016         ():
4017         * wtf/url/src/URLEscape.h: Added.
4018         (WTF):
4019         (WTF::appendURLEscapedCharacter):
4020         * wtf/url/src/URLParser.h: Added.
4021         (WTF):
4022         (URLParser):
4023         ():
4024         (WTF::URLParser::isPossibleAuthorityTerminator):
4025         (WTF::URLParser::parseAuthority):
4026         (WTF::URLParser::extractScheme):
4027         (WTF::URLParser::parseAfterScheme):
4028         (WTF::URLParser::parseStandardURL):
4029         (WTF::URLParser::parsePath):
4030         (WTF::URLParser::parsePathURL):
4031         (WTF::URLParser::parseMailtoURL):
4032         (WTF::URLParser::parsePort):
4033         (WTF::URLParser::extractFileName):
4034         (WTF::URLPars