1 2012-03-02 Filip Pizlo <fpizlo@apple.com>
3 When getting the line number of a call into a call frame with no code block, it's
4 incorrect to rely on the returnPC
5 https://bugs.webkit.org/show_bug.cgi?id=80195
7 Reviewed by Oliver Hunt.
9 * interpreter/Interpreter.cpp:
12 (JSC::JIT::compileLoadVarargs):
14 2012-03-02 Han Hojong <hojong.han@samsung.com>
16 Expected results updated for checking type conversion
17 https://bugs.webkit.org/show_bug.cgi?id=80138
19 Reviewed by Gavin Barraclough.
21 * tests/mozilla/ecma/TypeConversion/9.3.1-3.js:
23 2012-03-02 Kenichi Ishibashi <bashi@chromium.org>
25 Adding WebSocket per-frame DEFLATE extension
26 https://bugs.webkit.org/show_bug.cgi?id=77522
30 Reviewed by Kent Tamura.
34 2012-03-02 Filip Pizlo <fpizlo@apple.com>
36 Unreviewed build fix for platforms that have DFG_JIT disabled but PARALLEL_GC enabled.
38 * bytecode/CodeBlock.cpp:
39 (JSC::CodeBlock::visitAggregate):
41 2012-03-01 Filip Pizlo <fpizlo@apple.com>
43 DFGCodeBlocks should not trace CodeBlocks that are also going to be traced by
44 virtue of being in the transitive closure
45 https://bugs.webkit.org/show_bug.cgi?id=80098
47 Reviewed by Anders Carlsson.
49 If DFGCodeBlocks traces a CodeBlock that might also be traced via its owner Executable,
50 then you might have the visitAggregate() method called concurrently by multiple threads.
51 This is benign on 64-bit -- visitAggregate() and everything it calls turns out to be
52 racy and slightly imprecise but not unsound. But on 32-bit, visitAggregate() may crash
53 due to word tearing in ValueProfile bucket updates inside of computeUpdatedPrediction().
55 It would seem that the fix is just to have DFGCodeBlocks not trace CodeBlocks that are
56 not jettisoned. But CodeBlocks may be jettisoned later during the GC, so it must trace
57 any CodeBlock that it knows to be live by virtue of it being reachable from the stack.
58 Hence the real fix is to make sure that concurrent calls into CodeBlock::visitAggregate()
59 don't lead to two threads racing over each other as they clobber state. This patch
60 achieves this with a simple CAS loop: whichever thread wins the CAS race (which is
61 trivially linearizable) will get to trace the CodeBlock; all other threads give up and
64 Unfortunately there will be no new tests. It's possible to reproduce this maybe 1/10
65 times by running V8-v6's raytrace repeatedly, using the V8 harness hacked to rerun it
66 even when it's gotten sufficient counts. But that takes a while - sometimes up to a
67 minute to get a crash. I have no other reliable repro case.
69 * bytecode/CodeBlock.cpp:
70 (JSC::CodeBlock::visitAggregate):
71 * bytecode/CodeBlock.h:
73 * heap/DFGCodeBlocks.cpp:
74 (JSC::DFGCodeBlocks::clearMarks):
76 2012-03-01 Filip Pizlo <fpizlo@apple.com>
78 The JIT should not crash the entire process just because there is not enough executable
79 memory, if the LLInt is enabled
80 https://bugs.webkit.org/show_bug.cgi?id=79962
82 Reviewed by Csaba Osztrogonác.
86 * assembler/AssemblerBufferWithConstantPool.h:
87 (JSC::AssemblerBufferWithConstantPool::executableCopy):
89 2012-03-01 Ryosuke Niwa <rniwa@webkit.org>
91 Revert my change. Broke builds.
92 Source/JavaScriptCore/wtf/Atomics.h:188: error: redefinition of 'bool WTF::weakCompareAndSwap(volatile uintptr_t*, uintptr_t, uintptr_t)'
93 Source/JavaScriptCore/wtf/Atomics.h:122: error: 'bool WTF::weakCompareAndSwap(volatile unsigned int*, unsigned int, unsigned i
97 (WTF::weakCompareAndSwap):
99 2012-03-01 Ryosuke Niwa <rniwa@webkit.org>
103 Rubber-stamped by Filip Pizlo.
107 (WTF::weakCompareAndSwap):
109 2012-03-01 Gavin Barraclough <barraclough@apple.com>
111 ES5.1-15.3.5.4. prohibits Function.caller from [[Get]]ting a strict caller
112 https://bugs.webkit.org/show_bug.cgi?id=80011
114 Reviewed by Oliver Hunt.
116 Also, fix getting the caller from within a bound function, for within a getter,
117 or setter (make our implementation match other browsers).
119 * interpreter/Interpreter.cpp:
120 (JSC::getCallerInfo):
121 - Allow this to get the caller of host functions.
122 (JSC::Interpreter::retrieveCallerFromVMCode):
123 - This should use getCallerInfo, and should skip over function bindings.
124 * runtime/JSFunction.cpp:
125 (JSC::JSFunction::callerGetter):
126 - This should never return a strict-mode function.
128 2012-03-01 Yuqiang Xian <yuqiang.xian@intel.com>
130 DFG local CSE for a node can be terminated earlier
131 https://bugs.webkit.org/show_bug.cgi?id=80014
133 Reviewed by Filip Pizlo.
135 When one of the node's childredn is met in the process of back traversing
136 the nodes, we don't need to traverse the remaining nodes.
137 This is performance neutral on SunSpider, V8 and Kraken.
139 * dfg/DFGCSEPhase.cpp:
140 (JSC::DFG::CSEPhase::pureCSE):
141 (JSC::DFG::CSEPhase::impureCSE):
142 (JSC::DFG::CSEPhase::getByValLoadElimination):
143 (JSC::DFG::CSEPhase::checkFunctionElimination):
144 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
145 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
146 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
147 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
149 2012-02-29 Yuqiang Xian <yuqiang.xian@intel.com>
151 DFG BasicBlocks should not require that their nodes have continuous indices in the graph
152 https://bugs.webkit.org/show_bug.cgi?id=79899
154 Reviewed by Filip Pizlo.
156 This will make it more convenient to insert nodes into the DFG.
157 With this capability we now place the Phi nodes in the corresponding
159 Local CSE is modified to not to rely on the assumption of continuous
160 node indices in a block.
161 This is performance neutral on SunSpider, V8 and Kraken.
163 * dfg/DFGAbstractState.cpp:
164 (JSC::DFG::AbstractState::AbstractState):
165 (JSC::DFG::AbstractState::beginBasicBlock):
166 (JSC::DFG::AbstractState::execute):
167 (JSC::DFG::AbstractState::clobberStructures):
168 (JSC::DFG::AbstractState::mergeToSuccessors):
169 (JSC::DFG::AbstractState::dump):
170 * dfg/DFGAbstractState.h:
171 (JSC::DFG::AbstractState::forNode):
173 * dfg/DFGArithNodeFlagsInferencePhase.cpp:
174 (ArithNodeFlagsInferencePhase):
175 * dfg/DFGBasicBlock.h:
176 (JSC::DFG::BasicBlock::BasicBlock):
178 * dfg/DFGByteCodeParser.cpp:
179 (JSC::DFG::ByteCodeParser::addToGraph):
181 (JSC::DFG::ByteCodeParser::insertPhiNode):
182 (JSC::DFG::ByteCodeParser::handleInlining):
183 (JSC::DFG::ByteCodeParser::parseBlock):
184 (JSC::DFG::ByteCodeParser::processPhiStack):
185 (JSC::DFG::ByteCodeParser::linkBlock):
186 (JSC::DFG::ByteCodeParser::determineReachability):
187 (JSC::DFG::ByteCodeParser::parseCodeBlock):
188 * dfg/DFGCFAPhase.cpp:
189 (JSC::DFG::CFAPhase::performBlockCFA):
191 * dfg/DFGCSEPhase.cpp:
192 (JSC::DFG::CSEPhase::CSEPhase):
193 (JSC::DFG::CSEPhase::endIndexForPureCSE):
194 (JSC::DFG::CSEPhase::pureCSE):
195 (JSC::DFG::CSEPhase::impureCSE):
196 (JSC::DFG::CSEPhase::globalVarLoadElimination):
197 (JSC::DFG::CSEPhase::getByValLoadElimination):
198 (JSC::DFG::CSEPhase::checkFunctionElimination):
199 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
200 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
201 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
202 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
203 (JSC::DFG::CSEPhase::getScopeChainLoadElimination):
204 (JSC::DFG::CSEPhase::performNodeCSE):
205 (JSC::DFG::CSEPhase::performBlockCSE):
208 (JSC::DFG::Graph::dump):
210 (JSC::DFG::Phase::beginPhase):
211 * dfg/DFGSpeculativeJIT.cpp:
212 (JSC::DFG::SpeculativeJIT::nonSpeculativeCompare):
213 (JSC::DFG::SpeculativeJIT::nonSpeculativeStrictEq):
214 (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
215 (JSC::DFG::SpeculativeJIT::compile):
216 (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant):
217 (JSC::DFG::SpeculativeJIT::compileStrictEq):
218 * dfg/DFGSpeculativeJIT.h:
220 (JSC::DFG::SpeculativeJIT::detectPeepHoleBranch):
221 (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
222 * dfg/DFGSpeculativeJIT32_64.cpp:
223 (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull):
224 * dfg/DFGSpeculativeJIT64.cpp:
225 (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull):
226 * dfg/DFGVirtualRegisterAllocationPhase.cpp:
227 (JSC::DFG::VirtualRegisterAllocationPhase::run):
229 2012-02-29 Filip Pizlo <fpizlo@apple.com>
231 The JIT should not crash the entire process just because there is not
232 enough executable memory, if the LLInt is enabled
233 https://bugs.webkit.org/show_bug.cgi?id=79962
234 <rdar://problem/10922215>
236 Unreviewed, adding forgotten file.
238 * jit/JITCompilationEffort.h: Added.
241 2012-02-29 Filip Pizlo <fpizlo@apple.com>
243 The JIT should not crash the entire process just because there is not
244 enough executable memory, if the LLInt is enabled
245 https://bugs.webkit.org/show_bug.cgi?id=79962
246 <rdar://problem/10922215>
248 Reviewed by Gavin Barraclough.
250 Added the notion of JITCompilationEffort. If we're JIT'ing as a result of
251 a tier-up, then we set it to JITCompilationCanFail. Otherwise it's
252 JITCompilationMustSucceed. This preserves the old behavior of LLInt is
253 disabled or if we're compiling something that can't be interpreted (like
256 * JavaScriptCore.xcodeproj/project.pbxproj:
257 * assembler/ARMAssembler.cpp:
258 (JSC::ARMAssembler::executableCopy):
259 * assembler/ARMAssembler.h:
261 * assembler/AssemblerBuffer.h:
262 (JSC::AssemblerBuffer::executableCopy):
263 * assembler/LinkBuffer.h:
264 (JSC::LinkBuffer::LinkBuffer):
265 (JSC::LinkBuffer::~LinkBuffer):
267 (JSC::LinkBuffer::didFailToAllocate):
268 (JSC::LinkBuffer::isValid):
269 (JSC::LinkBuffer::linkCode):
270 (JSC::LinkBuffer::performFinalization):
271 * assembler/MIPSAssembler.h:
272 (JSC::MIPSAssembler::executableCopy):
273 * assembler/SH4Assembler.h:
274 (JSC::SH4Assembler::executableCopy):
275 * assembler/X86Assembler.h:
276 (JSC::X86Assembler::executableCopy):
277 (JSC::X86Assembler::X86InstructionFormatter::executableCopy):
278 * bytecode/CodeBlock.cpp:
279 (JSC::ProgramCodeBlock::jitCompileImpl):
280 (JSC::EvalCodeBlock::jitCompileImpl):
281 (JSC::FunctionCodeBlock::jitCompileImpl):
282 * bytecode/CodeBlock.h:
283 (JSC::CodeBlock::jitCompile):
290 * dfg/DFGJITCompiler.cpp:
291 (JSC::DFG::JITCompiler::compile):
292 (JSC::DFG::JITCompiler::compileFunction):
293 * dfg/DFGJITCompiler.h:
295 * jit/ExecutableAllocator.cpp:
296 (JSC::DemandExecutableAllocator::allocateNewSpace):
297 (JSC::ExecutableAllocator::allocate):
298 * jit/ExecutableAllocator.h:
299 (ExecutableAllocator):
300 * jit/ExecutableAllocatorFixedVMPool.cpp:
301 (JSC::ExecutableAllocator::allocate):
303 (JSC::JIT::privateCompile):
307 * jit/JITCompilationEffort.h: Added.
310 (JSC::jitCompileIfAppropriate):
311 (JSC::jitCompileFunctionIfAppropriate):
312 * llint/LLIntSlowPaths.cpp:
314 (JSC::LLInt::jitCompileAndSetHeuristics):
315 (JSC::LLInt::entryOSR):
316 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
317 * runtime/Executable.cpp:
318 (JSC::EvalExecutable::jitCompile):
319 (JSC::ProgramExecutable::jitCompile):
320 (JSC::FunctionExecutable::jitCompileForCall):
321 (JSC::FunctionExecutable::jitCompileForConstruct):
322 * runtime/Executable.h:
325 (FunctionExecutable):
326 (JSC::FunctionExecutable::jitCompileFor):
327 * runtime/ExecutionHarness.h:
328 (JSC::prepareForExecution):
329 (JSC::prepareFunctionForExecution):
331 2012-02-29 No'am Rosenthal <noam.rosenthal@nokia.com>
333 [Qt][WK2] Get rid of the #ifdef mess in LayerTreeHost[Proxy]
334 https://bugs.webkit.org/show_bug.cgi?id=79501
336 Enable WTF_USE_UI_SIDE_COMPOSITING for Qt.
338 Reviewed by Kenneth Rohde Christiansen.
342 2012-02-29 Gavin Barraclough <barraclough@apple.com>
344 Rubber stamped by Oliver Hunt.
346 * tests/mozilla/ecma_2/RegExp/constructor-001.js:
347 * tests/mozilla/ecma_2/RegExp/function-001.js:
348 * tests/mozilla/ecma_2/RegExp/properties-001.js:
349 - Check in new test cases results.
351 2012-02-29 Mark Rowe <mrowe@apple.com>
353 Stop installing JSCLLIntOffsetsExtractor.
355 Replace the separate TestRegExp and TestAPI xcconfig files with a single ToolExecutable xcconfig file
356 that derives the product name from the target name. We can then use that xcconfig file for JSCLLIntOffsetsExtractor.
357 This has the results of setting SKIP_INSTALL = YES for JSCLLIntOffsetsExtractor.
359 While I was doing this fiddling I noticed that the JSCLLIntOffsetsExtractor target had a custom value
360 for USER_HEADER_SEARCH_PATHS to allow it to find LLIntDesiredOffsets.h. A better way of doing that is
361 to add LLIntDesiredOffsets.h to the Xcode project so that it'll be included in the header map. That
362 allows us to remove the override of USER_HEADER_SEARCH_PATHS entirely. So I did that too!
364 Reviewed by Filip Pizlo.
366 * Configurations/TestRegExp.xcconfig: Removed.
367 * Configurations/ToolExecutable.xcconfig: Renamed from Source/JavaScriptCore/Configurations/TestAPI.xcconfig.
368 * JavaScriptCore.xcodeproj/project.pbxproj:
370 2012-02-28 Filip Pizlo <fpizlo@apple.com>
372 RefCounted::deprecatedTurnOffVerifier() should not be deprecated
373 https://bugs.webkit.org/show_bug.cgi?id=79864
375 Reviewed by Oliver Hunt.
377 Removed the word "deprecated" from the name of this method, since this method
378 should not be deprecated. It works just fine as it is, and there is simply no
379 alternative to calling this method for many interesting JSC classes.
381 * parser/SourceProvider.h:
382 (JSC::SourceProvider::SourceProvider):
383 * runtime/SymbolTable.h:
384 (JSC::SharedSymbolTable::SharedSymbolTable):
385 * wtf/MetaAllocator.cpp:
386 (WTF::MetaAllocatorHandle::MetaAllocatorHandle):
387 (WTF::MetaAllocator::allocate):
390 (WTF::RefCountedBase::turnOffVerifier):
392 2012-02-29 Gavin Barraclough <barraclough@apple.com>
394 'source' property of RegExp instance cannot be ""
395 https://bugs.webkit.org/show_bug.cgi?id=79938
397 Reviewed by Oliver Hunt.
399 15.10.6.4 specifies that RegExp.prototype.toString must return '/' + source + '/',
400 and also states that the result must be a valid RegularExpressionLiteral. '//' is
401 not a valid RegularExpressionLiteral (since it is a single line comment), and hence
402 source cannot ever validly be "". If the source is empty, return a different Pattern
403 that would match the same thing.
405 * runtime/RegExpObject.cpp:
406 (JSC::regExpObjectSource):
407 - Do not return "" if the source is empty, this would lead to invalid behaviour in toString.
408 * runtime/RegExpPrototype.cpp:
409 (JSC::regExpProtoFuncToString):
410 - No need to special case the empty string - this should be being done by 'source'.
412 2012-02-29 Gavin Barraclough <barraclough@apple.com>
414 Writable attribute not set correctly when redefining an accessor to a data descriptor
415 https://bugs.webkit.org/show_bug.cgi?id=79931
417 Reviewed by Oliver Hunt.
419 * runtime/JSObject.cpp:
420 (JSC::JSObject::defineOwnProperty):
421 - use attributesOverridingCurrent instead of attributesWithOverride.
422 * runtime/PropertyDescriptor.cpp:
423 * runtime/PropertyDescriptor.h:
424 - remove attributesWithOverride - attributesOverridingCurrent does the same thing.
426 2012-02-29 Kevin Ollivier <kevino@theolliviers.com>
428 Add JSCore symbol exports needed by wx port
429 https://bugs.webkit.org/show_bug.cgi?id=77280
431 Reviewed by Hajime Morita.
433 * wtf/ArrayBufferView.h:
434 * wtf/ExportMacros.h:
436 2012-02-28 Raphael Kubo da Costa <kubo@profusion.mobi>
438 [CMake] Always build wtf as a static library.
439 https://bugs.webkit.org/show_bug.cgi?id=79857
441 Reviewed by Eric Seidel.
443 To help the efforts in bug 75673 to move WTF out of
444 JavaScriptCore, act more like the other ports and remove the
445 possibility of building WTF as a shared library.
447 It does not make much sense to, for example, ship WTF as a
448 separate .so with webkit-efl packages, and it should be small
449 enough not to cause problems during linking.
451 * wtf/CMakeLists.txt:
453 2012-02-28 Dmitry Lomov <dslomov@google.com>
455 [JSC] Implement ArrayBuffer transfer
456 https://bugs.webkit.org/show_bug.cgi?id=73493.
457 Implement ArrayBuffer transfer, per Khronos spec: http://www.khronos.org/registry/typedarray/specs/latest/#9.
458 This brings parity with V8 implementation of transferable typed arrays.
460 Reviewed by Oliver Hunt.
462 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Extra export.
464 (ArrayBuffer): Added extra export.
466 2012-02-28 Kevin Ollivier <kevino@theolliviers.com>
468 [wx] Unreviewed. Build fix after recent LLInt additions.
472 2012-02-28 Mark Hahnenberg <mhahnenberg@apple.com>
474 Refactor SpeculativeJIT::emitAllocateJSFinalObject
475 https://bugs.webkit.org/show_bug.cgi?id=79801
477 Reviewed by Filip Pizlo.
479 * dfg/DFGSpeculativeJIT.h:
480 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): Split emitAllocateJSFinalObject out to form this
481 function, which is more generic in that it can allocate a variety of classes.
483 (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject): Changed to use the new helper function.
485 2012-02-28 Gavin Barraclough <barraclough@apple.com>
487 [[Get]]/[[Put]] for primitives should not wrap on strict accessor call
488 https://bugs.webkit.org/show_bug.cgi?id=79588
490 Reviewed by Oliver Hunt.
492 In the case of [[Get]], this is a pretty trivial bug - just don't wrap
493 primitives at the point you call a getter.
495 For setters, this is a little more involved, since we have already wrapped
496 the value up in a synthesized object. Stop doing so. There is also a further
497 subtely, that in strict mode all attempts to create a new data property on
498 the object should throw.
500 * runtime/JSCell.cpp:
502 - [[Put]] to a string primitive should use JSValue::putToPrimitive.
503 * runtime/JSObject.cpp:
504 (JSC::JSObject::put):
505 - Remove static function called in one place.
506 * runtime/JSObject.h:
508 - [[Put]] to a non-cell JSValue should use JSValue::putToPrimitive.
509 * runtime/JSValue.cpp:
510 (JSC::JSValue::synthesizePrototype):
511 - Add support for synthesizing the prototype of strings.
512 (JSC::JSValue::putToPrimitive):
513 - Added, implements [[Put]] for primitive bases, per 8.7.2.
516 - Add declaration for JSValue::putToPrimitive.
517 * runtime/PropertySlot.cpp:
518 (JSC::PropertySlot::functionGetter):
519 - Don't call ToObject on primitive this values.
521 2012-02-28 Mark Hahnenberg <mhahnenberg@apple.com>
523 Re-enable parallel GC on Mac
524 https://bugs.webkit.org/show_bug.cgi?id=79837
526 Rubber stamped by Filip Pizlo.
528 * runtime/Options.cpp:
529 (JSC::Options::initializeOptions): We accidentally disabled parallel GC with this line,
530 so we removed it and things should go back to normal.
532 2012-02-28 Filip Pizlo <fpizlo@apple.com>
534 Some run-javascriptcore-tests broken for 32-bit debug
535 https://bugs.webkit.org/show_bug.cgi?id=79844
537 Rubber stamped by Oliver Hunt.
539 These assertions are just plain wrong for 32-bit. We could either have a massive
540 assertion that depends on value representation, that has to be changed every
541 time we change the JITs, resulting in a bug tail of debug-mode crashes, or we
542 could get rid of the assertions. I pick the latter.
544 * dfg/DFGOperations.cpp:
546 (JSC::DEFINE_STUB_FUNCTION):
548 2012-02-28 Mark Hahnenberg <mhahnenberg@apple.com>
550 Get rid of padding cruft in CopiedBlock
551 https://bugs.webkit.org/show_bug.cgi?id=79686
553 Reviewed by Filip Pizlo.
555 * heap/CopiedBlock.h:
556 (CopiedBlock): Removed the extra padding that was used for alignment purposes until
557 the calculation of the payload offset into CopiedBlocks was redone recently.
559 2012-02-28 Anders Carlsson <andersca@apple.com>
561 Fix build with newer versions of clang.
563 Clang now warns since we're not passing a CFString literal to CFStringCreateWithFormatAndArguments,
564 but it's OK to ignore this warning since clang is also checking that the caller (vprintf_stderr_common)
565 takes a string literal.
567 * wtf/Assertions.cpp:
569 2012-02-28 Mario Sanchez Prada <msanchez@igalia.com>
571 [GTK] Add GMainLoop and GMainContext to be handled by GRefPtr
572 https://bugs.webkit.org/show_bug.cgi?id=79496
574 Reviewed by Martin Robinson.
576 Handle GMainLoop and GMainContext in GRefPtr, by calling
577 g_main_loop_(un)ref and g_main_context_(un)ref in the
578 implementation of the refGPtr and derefGPtr template functions.
580 * wtf/gobject/GRefPtr.cpp:
584 * wtf/gobject/GRefPtr.h:
586 * wtf/gobject/GTypedefs.h:
588 2012-02-28 Yong Li <yoli@rim.com>
590 JSString::resolveRope() should report extra memory cost to the heap.
591 https://bugs.webkit.org/show_bug.cgi?id=79555
593 Reviewed by Michael Saboff.
595 At the time a JSString is constructed with fibers, it doesn't report
596 extra memory cost, which is reasonable because it hasn't allocate
597 new memory. However when the rope is resolved, it should report meory
598 cost for the new buffer.
600 * runtime/JSString.cpp:
601 (JSC::JSString::resolveRope):
603 2012-02-27 Oliver Hunt <oliver@apple.com>
605 sputnik/Unicode/Unicode_500/S7.2_A1.6_T1.html crashes in the interpreter
606 https://bugs.webkit.org/show_bug.cgi?id=79728
608 Reviewed by Gavin Barraclough.
610 When initialising a chained get instruction we may end up in a state where
611 the instruction stream says we have a scopechain, but it has not yet been set
612 (eg. if allocating the StructureChain itself is what leads to the GC). We could
613 re-order the allocation, but it occurs in a couple of places, so it seems less
614 fragile simply to null check the scopechain slot before we actually visit the slot.
616 * bytecode/CodeBlock.cpp:
617 (JSC::CodeBlock::visitStructures):
619 2012-02-27 Filip Pizlo <fpizlo@apple.com>
621 Old JIT's style of JSVALUE64 strict equality is subtly wrong
622 https://bugs.webkit.org/show_bug.cgi?id=79700
624 Reviewed by Oliver Hunt.
626 * assembler/MacroAssemblerX86_64.h:
627 (JSC::MacroAssemblerX86_64::comparePtr):
628 (MacroAssemblerX86_64):
629 * dfg/DFGOperations.cpp:
630 * dfg/DFGSpeculativeJIT.cpp:
631 (JSC::DFG::SpeculativeJIT::nonSpeculativeStrictEq):
632 * dfg/DFGSpeculativeJIT64.cpp:
633 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
634 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq):
635 * jit/JITOpcodes.cpp:
636 (JSC::JIT::compileOpStrictEq):
637 (JSC::JIT::emitSlow_op_stricteq):
638 (JSC::JIT::emitSlow_op_nstricteq):
640 (JSC::DEFINE_STUB_FUNCTION):
642 2012-02-27 Gavin Barraclough <barraclough@apple.com>
644 Implement support for op_negate and op_bitnot in the DFG JIT
645 https://bugs.webkit.org/show_bug.cgi?id=79617
647 Reviewed by Filip Pizlo.
649 Add an ArithNegate op to the DFG JIT, to implement op_negate.
651 This patch also adds support for op_negate to the JSVALUE64 baseline JIT
652 (JSVALUE32_64 already had this), so that we can profile the slowpath usage.
654 This is a 2.5%-3% Sunspider progression and a 1% win on Kraken.
656 * assembler/ARMv7Assembler.h:
657 (JSC::ARMv7Assembler::sub_S):
658 - Added sub_S from immediate.
660 (JSC::ARMv7Assembler::vneg):
661 - Added double negate.
662 * assembler/MacroAssemblerARMv7.h:
663 (JSC::MacroAssemblerARMv7::negateDouble):
664 - Added double negate.
665 (MacroAssemblerARMv7):
666 (JSC::MacroAssemblerARMv7::branchNeg32):
668 * assembler/MacroAssemblerX86.h:
670 - moved loadDouble, absDouble to common.
671 * assembler/MacroAssemblerX86Common.h:
672 (MacroAssemblerX86Common):
673 (JSC::MacroAssemblerX86Common::absDouble):
674 - implementation can be shared.
675 (JSC::MacroAssemblerX86Common::negateDouble):
677 (JSC::MacroAssemblerX86Common::loadDouble):
678 - allow absDouble to have a common implementation.
679 * assembler/MacroAssemblerX86_64.h:
680 (MacroAssemblerX86_64):
681 - moved loadDouble, absDouble to common.
682 * dfg/DFGAbstractState.cpp:
683 (JSC::DFG::AbstractState::execute):
684 - support ArithNegate.
685 * dfg/DFGArithNodeFlagsInferencePhase.cpp:
686 (JSC::DFG::ArithNodeFlagsInferencePhase::propagate):
687 - support ArithNegate.
688 * dfg/DFGByteCodeParser.cpp:
689 (JSC::DFG::ByteCodeParser::makeSafe):
690 - support ArithNegate.
691 (JSC::DFG::ByteCodeParser::parseBlock):
693 * dfg/DFGCSEPhase.cpp:
694 (JSC::DFG::CSEPhase::performNodeCSE):
695 - support ArithNegate.
696 * dfg/DFGCapabilities.h:
697 (JSC::DFG::canCompileOpcode):
700 (JSC::DFG::Graph::negateShouldSpeculateInteger):
701 - support ArithNegate.
703 (JSC::DFG::Node::hasArithNodeFlags):
704 - support ArithNegate.
705 * dfg/DFGPredictionPropagationPhase.cpp:
706 (JSC::DFG::PredictionPropagationPhase::propagate):
707 - support ArithNegate.
708 * dfg/DFGSpeculativeJIT.cpp:
709 (JSC::DFG::SpeculativeJIT::compileArithNegate):
710 - support ArithNegate.
711 * dfg/DFGSpeculativeJIT.h:
713 - support ArithNegate.
714 * dfg/DFGSpeculativeJIT32_64.cpp:
715 (JSC::DFG::SpeculativeJIT::compile):
716 - support ArithNegate.
717 * dfg/DFGSpeculativeJIT64.cpp:
718 (JSC::DFG::SpeculativeJIT::compile):
719 - support ArithNegate.
721 (JSC::JIT::privateCompileMainPass):
722 (JSC::JIT::privateCompileSlowCases):
723 - Add support for op_negate in JSVALUE64.
724 * jit/JITArithmetic.cpp:
725 (JSC::JIT::emit_op_negate):
726 (JSC::JIT::emitSlow_op_negate):
727 - Add support for op_negate in JSVALUE64.
729 2012-02-27 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
731 Unreviewed. Build fix for linux-bot (qt) after r109021.
735 2012-02-27 Oliver Hunt <oliver@apple.com>
737 REGRESSION (r108112): AWS Management Console at amazon.com fails to initialize
738 https://bugs.webkit.org/show_bug.cgi?id=79693
740 Reviewed by Filip Pizlo.
742 Alas we can't provide the stack trace as an array, as despite everyone wanting
743 an array, everyone arbitrarily creates the array by calling split on the stack
744 trace. To create the array we would have provided them in the first place.
746 This changes the exception's stack property to a \n separated string. To get the
747 old array just do <exception>.stack.split("\n").
752 2012-02-27 Gavin Barraclough <barraclough@apple.com>
754 RegExp lastIndex should behave as a regular property
755 https://bugs.webkit.org/show_bug.cgi?id=79446
757 Reviewed by Sam Weinig.
759 lastIndex should be a regular data descriptor, with the attributes configurable:false,
760 enumerable:false, writable:true. As such, it should be possible to reconfigure writable
761 as false. If the lastIndex property is reconfigured to be read-only, we should respect
764 * runtime/CommonIdentifiers.h:
765 - Removed some unused identifiers, added lastIndex.
766 * runtime/RegExpObject.cpp:
767 (JSC::RegExpObject::getOwnPropertySlot):
768 - lastIndex is no longer a static value, provided specific handling.
769 (JSC::RegExpObject::getOwnPropertyDescriptor):
770 - lastIndex is no longer a static value, provided specific handling.
771 (JSC::RegExpObject::deleteProperty):
772 - lastIndex is no longer a static value, provided specific handling.
773 (JSC::RegExpObject::getOwnPropertyNames):
774 - lastIndex is no longer a static value, provided specific handling.
775 (JSC::RegExpObject::getPropertyNames):
776 - lastIndex is no longer a static value, provided specific handling.
778 - helper function for defineOwnProperty.
779 (JSC::RegExpObject::defineOwnProperty):
780 - lastIndex is no longer a static value, provided specific handling.
781 (JSC::RegExpObject::put):
782 - lastIndex is no longer a static value, provided specific handling.
783 (JSC::RegExpObject::match):
784 - Pass setLastIndex an ExecState, so it can throw if read-only.
785 * runtime/RegExpObject.h:
786 (JSC::RegExpObject::setLastIndex):
787 - Pass setLastIndex an ExecState, so it can throw if read-only.
789 - Added lastIndexIsWritable.
790 * runtime/RegExpPrototype.cpp:
791 (JSC::regExpProtoFuncCompile):
792 - Pass setLastIndex an ExecState, so it can throw if read-only.
794 2012-02-27 Gavin Barraclough <barraclough@apple.com>
796 Implement support for op_negate and op_bitnot in the DFG JIT
797 https://bugs.webkit.org/show_bug.cgi?id=79617
799 Reviewed by Sam Weinig.
801 Remove op_bitnop - this is redundant, ~x === x^-1.
802 This is a fractional (<1%) progression.
804 Remove not32(X) from the MacroAssemblers - make this an optimization to add32(-1, X).
805 Remove CanReuse from the result type - this was unused.
808 * assembler/MacroAssemblerARM.h:
810 (JSC::MacroAssemblerARM::xor32):
811 * assembler/MacroAssemblerARMv7.h:
812 (MacroAssemblerARMv7):
813 (JSC::MacroAssemblerARMv7::xor32):
814 * assembler/MacroAssemblerMIPS.h:
815 (MacroAssemblerMIPS):
816 (JSC::MacroAssemblerMIPS::xor32):
817 * assembler/MacroAssemblerSH4.h:
819 (JSC::MacroAssemblerSH4::xor32):
820 * assembler/MacroAssemblerX86Common.h:
821 (MacroAssemblerX86Common):
822 (JSC::MacroAssemblerX86Common::xor32):
823 * bytecode/CodeBlock.cpp:
824 (JSC::CodeBlock::dump):
827 (JSC::padOpcodeName):
828 * bytecompiler/NodesCodegen.cpp:
830 (JSC::BitwiseNotNode::emitBytecode):
831 * interpreter/Interpreter.cpp:
832 (JSC::Interpreter::privateExecute):
834 (JSC::JIT::privateCompileMainPass):
835 (JSC::JIT::privateCompileSlowCases):
838 * jit/JITArithmetic32_64.cpp:
840 * jit/JITOpcodes.cpp:
845 * llint/LLIntSlowPaths.cpp:
847 * llint/LLIntSlowPaths.h:
849 * llint/LowLevelInterpreter32_64.asm:
850 * parser/NodeConstructors.h:
851 (JSC::NegateNode::NegateNode):
852 (JSC::BitwiseNotNode::BitwiseNotNode):
853 (JSC::MultNode::MultNode):
854 (JSC::DivNode::DivNode):
855 (JSC::ModNode::ModNode):
856 (JSC::SubNode::SubNode):
857 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
860 (JSC::BitwiseNotNode::expr):
862 * parser/ResultType.h:
864 (JSC::ResultType::numberTypeIsInt32):
865 (JSC::ResultType::stringOrNumberType):
866 (JSC::ResultType::forAdd):
867 (JSC::ResultType::forBitOp):
869 2012-02-27 Michael Saboff <msaboff@apple.com>
871 Error check regexp min quantifier
872 https://bugs.webkit.org/show_bug.cgi?id=70648
874 Reviewed by Gavin Barraclough.
876 Added checking for min or only quantifier being UINT_MAX.
877 When encountered this becomes a SyntaxError during parsing.
880 (JSC::Yarr::Parser::parseQuantifier):
881 (JSC::Yarr::Parser::parse):
884 2012-02-27 Carlos Garcia Campos <cgarcia@igalia.com>
886 Unreviewed. Fix make distcheck.
888 * GNUmakefile.list.am: Add missing files.
890 2012-02-26 Hajime Morrita <morrita@chromium.org>
892 Move ChromeClient::showContextMenu() to ContextMenuClient
893 https://bugs.webkit.org/show_bug.cgi?id=79427
895 Reviewed by Adam Barth.
897 Added ACCESSIBILITY_CONTEXT_MENUS.
901 2012-02-26 Filip Pizlo <fpizlo@apple.com>
903 LayoutTests/fast/xpath/xpath-functional-test.html is crashing in the DFG
904 https://bugs.webkit.org/show_bug.cgi?id=79616
906 Reviewed by Oliver Hunt.
908 Guard against the fact that in JSVALUE64, JSValue().isCell() == true.
910 * dfg/DFGAbstractValue.h:
911 (JSC::DFG::AbstractValue::validate):
913 2012-02-26 Filip Pizlo <fpizlo@apple.com>
915 DFG should support activations and nested functions
916 https://bugs.webkit.org/show_bug.cgi?id=79554
918 Reviewed by Sam Weinig.
920 Fix 32-bit. The 32-bit function+activation code had some really weird
923 * dfg/DFGSpeculativeJIT32_64.cpp:
924 (JSC::DFG::SpeculativeJIT::compile):
926 2012-02-26 Filip Pizlo <fpizlo@apple.com>
928 Getting the instruction stream for a code block should not require two loads
929 https://bugs.webkit.org/show_bug.cgi?id=79608
931 Reviewed by Sam Weinig.
933 Introduced the RefCountedArray class, which contains a single inline pointer
934 to a ref-counted non-resizeable vector backing store. This satisfies the
935 requirements of CodeBlock, which desires the ability to share instruction
936 streams with other CodeBlocks. It also reduces the number of loads required
937 for getting the instruction stream by one.
939 This patch also gets rid of the bytecode discarding logic, since we don't
940 use it anymore and it's unlikely to ever work right with DFG or LLInt. And
941 I didn't feel like porting dead code to use RefCountedArray.
943 * GNUmakefile.list.am:
944 * JavaScriptCore.xcodeproj/project.pbxproj:
945 * bytecode/CodeBlock.cpp:
946 (JSC::instructionOffsetForNth):
947 (JSC::CodeBlock::dump):
948 (JSC::CodeBlock::CodeBlock):
949 (JSC::CodeBlock::finalizeUnconditionally):
950 (JSC::CodeBlock::handlerForBytecodeOffset):
951 (JSC::CodeBlock::lineNumberForBytecodeOffset):
952 (JSC::CodeBlock::expressionRangeForBytecodeOffset):
953 (JSC::CodeBlock::shrinkToFit):
954 * bytecode/CodeBlock.h:
956 (JSC::CodeBlock::numberOfInstructions):
957 (JSC::CodeBlock::instructions):
958 (JSC::CodeBlock::instructionCount):
959 (JSC::CodeBlock::valueProfileForBytecodeOffset):
961 * bytecompiler/BytecodeGenerator.cpp:
962 (JSC::Label::setLocation):
964 (JSC::BytecodeGenerator::generate):
965 (JSC::BytecodeGenerator::newLabel):
966 * bytecompiler/BytecodeGenerator.h:
969 (JSC::BytecodeGenerator::instructions):
970 * bytecompiler/Label.h:
973 * dfg/DFGByteCodeCache.h:
974 (JSC::DFG::ByteCodeCache::~ByteCodeCache):
975 (JSC::DFG::ByteCodeCache::get):
976 * jit/JITExceptions.cpp:
978 * llint/LowLevelInterpreter32_64.asm:
979 * runtime/Executable.cpp:
980 (JSC::EvalExecutable::compileInternal):
981 (JSC::ProgramExecutable::compileInternal):
982 (JSC::FunctionExecutable::codeBlockWithBytecodeFor):
983 (JSC::FunctionExecutable::produceCodeBlockFor):
984 * wtf/RefCountedArray.h: Added.
987 (WTF::RefCountedArray::RefCountedArray):
988 (WTF::RefCountedArray::operator=):
989 (WTF::RefCountedArray::~RefCountedArray):
990 (WTF::RefCountedArray::size):
991 (WTF::RefCountedArray::data):
992 (WTF::RefCountedArray::begin):
993 (WTF::RefCountedArray::end):
994 (WTF::RefCountedArray::at):
995 (WTF::RefCountedArray::operator[]):
997 (WTF::RefCountedArray::Header::size):
998 (WTF::RefCountedArray::Header::payload):
999 (WTF::RefCountedArray::Header::fromPayload):
1002 2012-02-26 Yusuke Suzuki <utatane.tea@gmail.com>
1004 StringLiteral and NumericLiteral are allowed as ObjectLiteral getter / setter name
1005 https://bugs.webkit.org/show_bug.cgi?id=79571
1007 Reviewed by Gavin Barraclough.
1009 * parser/ASTBuilder.h:
1010 (JSC::ASTBuilder::createGetterOrSetterProperty):
1011 * parser/Parser.cpp:
1012 (JSC::::parseProperty):
1013 * parser/SyntaxChecker.h:
1014 (JSC::SyntaxChecker::createGetterOrSetterProperty):
1016 2012-02-26 Mark Hahnenberg <mhahnenberg@apple.com>
1018 Implement fast path for op_new_array in the baseline JIT
1019 https://bugs.webkit.org/show_bug.cgi?id=78612
1021 Reviewed by Filip Pizlo.
1023 heap/CopiedAllocator.h:
1024 (CopiedAllocator): Friended the JIT to allow access to m_currentOffset.
1025 * heap/CopiedSpace.h:
1026 (CopiedSpace): Friended the JIT to allow access to isOversize.
1027 (JSC::CopiedSpace::allocator):
1029 (JSC::Heap::storageAllocator): Added a getter for the CopiedAllocator class so the JIT
1030 can use it for simple allocation i.e. when we can just bump the offset without having to
1033 (JSC::JIT::privateCompileSlowCases): Added new slow case for op_new_array for when
1034 we have to bail out because the fast allocation path fails for whatever reason.
1037 * jit/JITInlineMethods.h:
1038 (JSC::JIT::emitAllocateBasicStorage): Added utility function that allows objects to
1039 allocate generic backing stores. This function is used by emitAllocateJSArray.
1041 (JSC::JIT::emitAllocateJSArray): Added utility function that allows the client to
1042 more easily allocate JSArrays. This function is used by emit_op_new_array and I expect
1043 it will also be used for emit_op_new_array_buffer.
1044 * jit/JITOpcodes.cpp:
1045 (JSC::JIT::emit_op_new_array): Changed to do inline allocation of JSArrays. Still does
1046 a stub call for oversize arrays.
1048 (JSC::JIT::emitSlow_op_new_array): New slow path that just bails out to a stub call if we
1049 fail in any way on the fast path.
1050 * runtime/JSArray.cpp:
1052 * runtime/JSArray.h: Added lots of offset functions for all the fields that we need to
1053 initialize in the JIT.
1055 (JSC::ArrayStorage::lengthOffset):
1056 (JSC::ArrayStorage::numValuesInVectorOffset):
1057 (JSC::ArrayStorage::allocBaseOffset):
1058 (JSC::ArrayStorage::vectorOffset):
1060 (JSC::JSArray::sparseValueMapOffset):
1061 (JSC::JSArray::subclassDataOffset):
1062 (JSC::JSArray::indexBiasOffset):
1064 (JSC::JSArray::storageSize): Moved this function from being a static function in the cpp file
1065 to being a static function in the JSArray class. This move allows the JIT to call it to
1066 see what size it should allocate.
1068 2012-02-26 Patrick Gansterer <paroga@webkit.org>
1070 Unreviewed. Build fix for ENABLE(CLASSIC_INTERPRETER) after r108681.
1072 * interpreter/Interpreter.cpp:
1073 (JSC::getLineNumberForCallFrame):
1074 (JSC::Interpreter::getStackTrace):
1076 2012-02-26 Patrick Gansterer <paroga@webkit.org>
1078 Unreviewed. Build fix for !ENABLE(JIT) after r108681.
1080 * interpreter/Interpreter.cpp:
1081 (JSC::getLineNumberForCallFrame):
1083 2012-02-25 Filip Pizlo <fpizlo@apple.com>
1085 LLInt assembly file should be split into 32-bit and 64-bit parts
1086 https://bugs.webkit.org/show_bug.cgi?id=79584
1088 Reviewed by Sam Weinig.
1090 Moved LowLevelInterpreter.asm to LowLevelInterpreter32_64.asm. Gave offlineasm
1091 the ability to include files, and correctly track dependencies: it restricts
1092 the include mechanism to using the same directory as the source file, and uses
1093 the SHA1 hash of all .asm files in that directory as an input hash.
1095 * llint/LLIntOfflineAsmConfig.h:
1096 * llint/LowLevelInterpreter.asm:
1097 * llint/LowLevelInterpreter32_64.asm: Added.
1098 - This is just the entire contents of what was previously LowLevelInterpreter.asm
1099 * llint/LowLevelInterpreter64.asm: Added.
1100 * offlineasm/asm.rb:
1101 * offlineasm/ast.rb:
1102 * offlineasm/generate_offset_extractor.rb:
1103 * offlineasm/parser.rb:
1104 * offlineasm/self_hash.rb:
1106 2012-02-25 Filip Pizlo <fpizlo@apple.com>
1108 Offlineasm should support X86_64
1109 https://bugs.webkit.org/show_bug.cgi?id=79581
1111 Reviewed by Oliver Hunt.
1113 * llint/LLIntOfflineAsmConfig.h:
1114 * offlineasm/backends.rb:
1115 * offlineasm/instructions.rb:
1116 * offlineasm/settings.rb:
1117 * offlineasm/x86.rb:
1119 2012-02-25 Filip Pizlo <fpizlo@apple.com>
1121 DFG should support activations and nested functions
1122 https://bugs.webkit.org/show_bug.cgi?id=79554
1124 Reviewed by Oliver Hunt.
1126 Wrote the simplest possible implementation of activations. Big speed-up on
1127 code that uses activations, no speed-up on major benchmarks (SunSpider, V8,
1128 Kraken) because they do not appear to have sufficient coverage over code
1129 that uses activations.
1131 * bytecode/PredictedType.cpp:
1132 (JSC::predictionToString):
1133 (JSC::predictionFromValue):
1134 * bytecode/PredictedType.h:
1136 (JSC::isEmptyPrediction):
1137 * dfg/DFGAbstractState.cpp:
1138 (JSC::DFG::AbstractState::execute):
1139 * dfg/DFGByteCodeParser.cpp:
1140 (JSC::DFG::ByteCodeParser::ByteCodeParser):
1142 (JSC::DFG::ByteCodeParser::parseBlock):
1143 (JSC::DFG::ByteCodeParser::buildOperandMapsIfNecessary):
1144 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
1145 (JSC::DFG::ByteCodeParser::parse):
1146 * dfg/DFGCapabilities.h:
1147 (JSC::DFG::canCompileOpcode):
1148 (JSC::DFG::canInlineOpcode):
1150 (JSC::DFG::Graph::needsActivation):
1153 (JSC::DFG::Node::storageAccessDataIndex):
1155 (JSC::DFG::Node::hasFunctionDeclIndex):
1156 (JSC::DFG::Node::functionDeclIndex):
1157 (JSC::DFG::Node::hasFunctionExprIndex):
1158 (JSC::DFG::Node::functionExprIndex):
1159 * dfg/DFGOperations.cpp:
1160 * dfg/DFGOperations.h:
1161 * dfg/DFGPredictionPropagationPhase.cpp:
1162 (JSC::DFG::PredictionPropagationPhase::propagate):
1163 * dfg/DFGSpeculativeJIT.cpp:
1164 (JSC::DFG::SpeculativeJIT::compileNewFunctionNoCheck):
1166 (JSC::DFG::SpeculativeJIT::compileNewFunctionExpression):
1167 * dfg/DFGSpeculativeJIT.h:
1168 (JSC::DFG::SpeculativeJIT::callOperation):
1169 * dfg/DFGSpeculativeJIT32_64.cpp:
1170 (JSC::DFG::SpeculativeJIT::compile):
1171 * dfg/DFGSpeculativeJIT64.cpp:
1172 (JSC::DFG::SpeculativeJIT::compile):
1174 2012-02-25 Benjamin Poulain <benjamin@webkit.org>
1176 Add an empty skeleton of KURL for WTFURL
1177 https://bugs.webkit.org/show_bug.cgi?id=78990
1179 Reviewed by Adam Barth.
1181 * JavaScriptCore.xcodeproj/project.pbxproj: Export the relevant classes from WTFURL
1182 so that can use them in WebCore.
1184 2012-02-25 Filip Pizlo <fpizlo@apple.com>
1186 Unreviewed, fix build for DFG disabled and LLInt enabled.
1189 (JSC::JIT::privateCompile):
1190 * llint/LLIntSlowPaths.cpp:
1192 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
1194 2012-02-25 Mark Hahnenberg <mhahnenberg@apple.com>
1196 Fix the CopiedBlock offset alignment in a cross platform fashion
1197 https://bugs.webkit.org/show_bug.cgi?id=79556
1199 Reviewed by Filip Pizlo.
1201 Replaced m_payload with a payload() method that calculates the offset
1202 of the payload with the proper alignment. This change allows us to
1203 avoid alignment-related issues in a cross-platform manner.
1205 * heap/CopiedAllocator.h:
1206 (JSC::CopiedAllocator::currentUtilization):
1207 * heap/CopiedBlock.h:
1208 (JSC::CopiedBlock::CopiedBlock):
1209 (JSC::CopiedBlock::payload):
1211 * heap/CopiedSpace.cpp:
1212 (JSC::CopiedSpace::doneFillingBlock):
1213 * heap/CopiedSpaceInlineMethods.h:
1214 (JSC::CopiedSpace::borrowBlock):
1215 (JSC::CopiedSpace::allocateFromBlock):
1217 2012-02-24 Michael Saboff <msaboff@apple.com>
1219 Unreviewed, Windows build fix. Changed signature in export to match
1220 change made in r108858.
1222 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1224 2012-02-24 Filip Pizlo <fpizlo@apple.com>
1226 DFG support for op_new_regexp should be enabled
1227 https://bugs.webkit.org/show_bug.cgi?id=79538
1229 Reviewed by Oliver Hunt.
1231 No performance change.
1233 * dfg/DFGCapabilities.h:
1234 (JSC::DFG::canCompileOpcode):
1237 2012-02-24 Michael Saboff <msaboff@apple.com>
1239 ASSERT(position < 0) in JSC::Yarr::Interpreter::InputStream::readChecked
1240 https://bugs.webkit.org/show_bug.cgi?id=73728
1242 Reviewed by Gavin Barraclough.
1244 Fixed the mixing of signed and unsigned character indeces in YARR
1247 * runtime/RegExp.cpp:
1248 (JSC::RegExp::match): Added code to check for match longer than 2^31 and
1249 return no match after resetting the offsets.
1250 * yarr/YarrInterpreter.cpp: Changed to use unsigned for all character index
1251 handling except when matching back references.
1252 (JSC::Yarr::Interpreter::InputStream::readChecked):
1253 (JSC::Yarr::Interpreter::InputStream::checkInput):
1254 (JSC::Yarr::Interpreter::InputStream::uncheckInput):
1255 (JSC::Yarr::Interpreter::InputStream::atStart):
1256 (JSC::Yarr::Interpreter::InputStream::atEnd):
1257 (JSC::Yarr::Interpreter::InputStream::isAvailableInput):
1258 (JSC::Yarr::Interpreter::checkCharacter):
1259 (JSC::Yarr::Interpreter::checkCasedCharacter):
1260 (JSC::Yarr::Interpreter::checkCharacterClass):
1261 (JSC::Yarr::Interpreter::tryConsumeBackReference):
1262 (JSC::Yarr::Interpreter::matchAssertionBOL):
1263 (JSC::Yarr::Interpreter::matchAssertionWordBoundary):
1264 (JSC::Yarr::Interpreter::backtrackPatternCharacter):
1265 (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
1266 (JSC::Yarr::Interpreter::matchCharacterClass):
1267 (JSC::Yarr::Interpreter::backtrackCharacterClass):
1268 (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
1269 (JSC::Yarr::Interpreter::matchDisjunction):
1270 (JSC::Yarr::Interpreter::interpret):
1271 (JSC::Yarr::ByteCompiler::assertionBOL):
1272 (JSC::Yarr::ByteCompiler::assertionEOL):
1273 (JSC::Yarr::ByteCompiler::assertionWordBoundary):
1274 (JSC::Yarr::ByteCompiler::atomPatternCharacter):
1275 (JSC::Yarr::ByteCompiler::atomCharacterClass):
1276 (JSC::Yarr::ByteCompiler::atomBackReference):
1277 (JSC::Yarr::ByteCompiler::atomParenthesesOnceBegin):
1278 (JSC::Yarr::ByteCompiler::atomParenthesesTerminalBegin):
1279 (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
1280 (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd):
1281 (JSC::Yarr::ByteCompiler::emitDisjunction):
1282 * yarr/YarrInterpreter.h:
1284 2012-02-24 Filip Pizlo <fpizlo@apple.com>
1286 Unreviewed, build fix for builds where the DFG is disabled but the LLInt is
1289 * llint/LLIntOfflineAsmConfig.h:
1290 * llint/LowLevelInterpreter.asm:
1292 2012-02-24 Filip Pizlo <fpizlo@apple.com>
1294 DFG should be able to handle variables getting captured
1295 https://bugs.webkit.org/show_bug.cgi?id=79469
1297 Reviewed by Oliver Hunt.
1299 Made captured variables work by placing a Flush on the SetLocal and
1300 forcing the emission of the GetLocal even if copy propagation tells us
1303 Changed the CFA and various prediction codes to understand that we can't
1304 really prove anything about captured variables. Well, we could in the
1305 future by just looking at what side effects are happening, but in this
1306 first cut we just assume that we can't reason about captured variables.
1308 Also added a mode where the DFG pretends that all variables and arguments
1309 got captured. Used this mode to harden the code.
1311 This is performance neutral. Capturing all variables is a slow down, but
1312 not too big of one. This seems to predict that when we add activation
1313 support, the amount of speed benefit we'll get from increased coverage
1314 will far outweigh the pessimism that we'll have to endure for captured
1317 * bytecode/CodeType.h:
1318 (JSC::codeTypeToString):
1319 * dfg/DFGAbstractState.cpp:
1320 (JSC::DFG::AbstractState::initialize):
1321 (JSC::DFG::AbstractState::endBasicBlock):
1322 (JSC::DFG::AbstractState::execute):
1323 (JSC::DFG::AbstractState::merge):
1324 * dfg/DFGAbstractState.h:
1326 * dfg/DFGByteCodeParser.cpp:
1327 (JSC::DFG::ByteCodeParser::getLocal):
1328 (JSC::DFG::ByteCodeParser::setLocal):
1329 (JSC::DFG::ByteCodeParser::getArgument):
1330 (JSC::DFG::ByteCodeParser::setArgument):
1331 (JSC::DFG::ByteCodeParser::flushArgument):
1332 (JSC::DFG::ByteCodeParser::handleInlining):
1333 (JSC::DFG::ByteCodeParser::processPhiStack):
1334 (JSC::DFG::ByteCodeParser::parseCodeBlock):
1335 (JSC::DFG::ByteCodeParser::parse):
1336 * dfg/DFGCapabilities.h:
1337 (JSC::DFG::mightInlineFunctionForCall):
1338 (JSC::DFG::mightInlineFunctionForConstruct):
1341 (JSC::DFG::Graph::needsActivation):
1343 (JSC::DFG::Graph::argumentIsCaptured):
1344 (JSC::DFG::Graph::localIsCaptured):
1345 (JSC::DFG::Graph::isCaptured):
1347 (JSC::DFG::Node::shouldGenerate):
1348 * dfg/DFGPredictionPropagationPhase.cpp:
1349 (JSC::DFG::PredictionPropagationPhase::propagate):
1350 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
1351 * dfg/DFGSpeculativeJIT.cpp:
1353 (JSC::DFG::ValueSource::dump):
1354 (JSC::DFG::SpeculativeJIT::compile):
1355 * dfg/DFGSpeculativeJIT.h:
1357 * dfg/DFGSpeculativeJIT32_64.cpp:
1358 (JSC::DFG::SpeculativeJIT::compile):
1359 * dfg/DFGSpeculativeJIT64.cpp:
1360 (JSC::DFG::SpeculativeJIT::compile):
1361 * dfg/DFGVirtualRegisterAllocationPhase.cpp:
1362 (JSC::DFG::VirtualRegisterAllocationPhase::run):
1364 2012-02-24 Gavin Barraclough <barraclough@apple.com>
1366 Should not allow malformed \x escapes
1367 https://bugs.webkit.org/show_bug.cgi?id=79462
1369 Reviewed by Oliver Hunt.
1372 (JSC::::parseString):
1373 (JSC::::parseStringSlowCase):
1374 - Prohibit malformed '\x' escapes
1375 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
1376 * tests/mozilla/ecma/LexicalConventions/7.7.4.js:
1377 * tests/mozilla/ecma_2/RegExp/hex-001.js:
1378 * tests/mozilla/js1_2/regexp/hexadecimal.js:
1379 - Remove erroneous test cases (correct behaviour is tested by LayoutTests/sputnik).
1381 2012-02-24 Daniel Bates <dbates@webkit.org>
1383 Fix change log entry for changeset r108819; add bug URL
1384 https://bugs.webkit.org/show_bug.cgi?id=79504
1386 Changeset r108819 is associated with bug #79504.
1390 2012-02-24 Daniel Bates <dbates@webkit.org>
1392 Substitute ENABLE(CLASSIC_INTERPRETER) for ENABLE(INTERPRETER) in Interpreter.cpp
1393 https://bugs.webkit.org/show_bug.cgi?id=79504
1395 Reviewed by Oliver Hunt.
1397 There are a few places in Interpreter.cpp that need to be updated to use
1398 ENABLE(CLASSIC_INTERPRETER) following the renaming of ENABLE_INTERPRETER to
1399 ENABLE_CLASSIC_INTERPRETER in changeset <http://trac.webkit.org/changeset/108020>
1400 (https://bugs.webkit.org/show_bug.cgi?id=78791).
1402 * interpreter/Interpreter.cpp:
1403 (JSC::getLineNumberForCallFrame):
1404 (JSC::getCallerInfo):
1405 (JSC::getSourceURLFromCallFrame):
1407 2012-02-24 Adam Roben <aroben@apple.com>
1409 Undo the BUILDING_WTF part of r108808
1411 This broke the build, which is obviously worse than the linker warning it was trying to
1414 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
1416 2012-02-24 Adam Roben <aroben@apple.com>
1418 Fix linker warnings on Windows
1420 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Removed symbols that are already
1421 exported via JS_EXPORTDATA.
1423 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Define BUILDING_WTF. We
1424 aren't actually building WTF, but we are statically linking it, so we need to define this
1425 symbol so that we export WTF's exports.
1427 2012-02-24 Philippe Normand <pnormand@igalia.com>
1429 Fix GTK WebAudio build for WebKitGTK 1.7.90.
1431 Patch by Priit Laes <plaes@plaes.org> on 2012-02-24
1432 Rubber-stamped by Philippe Normand.
1434 * GNUmakefile.list.am: Add Complex.h to the list of files so it
1435 gets disted in the tarballs.
1437 2012-02-24 Zoltan Herczeg <zherczeg@webkit.org>
1439 [Qt] Buildfix for "Zero out CopiedBlocks on initialization".
1440 https://bugs.webkit.org/show_bug.cgi?id=79199
1442 Ruber stamped by Csaba Osztrogonác.
1444 Temporary fix since the new member wastes a little space on
1445 64 bit systems. Although it is harmless, it is only needed
1448 * heap/CopiedBlock.h:
1451 2012-02-24 Han Hojong <hojong.han@samsung.com>
1453 Remove useless jump instructions for short circuit
1454 https://bugs.webkit.org/show_bug.cgi?id=75602
1456 Reviewed by Michael Saboff.
1458 Jump instruction is inserted to make short circuit,
1459 however it does nothing but moving to the next instruction.
1460 Therefore useless jump instructions are removed,
1461 and jump list is moved into the case not for a short circuit,
1462 so that only necessary instructions are added to JIT code
1463 unless it has a 16 bit pattern character and an 8 bit string.
1466 (JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
1467 (JSC::Yarr::YarrGenerator::backtrackPatternCharacterNonGreedy):
1469 2012-02-24 Sheriff Bot <webkit.review.bot@gmail.com>
1471 Unreviewed, rolling out r108731.
1472 http://trac.webkit.org/changeset/108731
1473 https://bugs.webkit.org/show_bug.cgi?id=79464
1475 Broke Chromium Win tests (Requested by bashi on #webkit).
1479 2012-02-24 Andrew Lo <anlo@rim.com>
1481 [BlackBerry] Enable requestAnimationFrame
1482 https://bugs.webkit.org/show_bug.cgi?id=79408
1484 Use timer implementation of requestAnimationFrame on BlackBerry.
1486 Reviewed by Rob Buis.
1490 2012-02-24 Mathias Bynens <mathias@qiwi.be>
1492 `\u200c` and `\u200d` should be allowed in IdentifierPart, as per ES5
1493 https://bugs.webkit.org/show_bug.cgi?id=78908
1495 Add additional checks for zero-width non-joiner (0x200C) and
1496 zero-width joiner (0x200D) characters.
1498 Reviewed by Michael Saboff.
1501 (JSC::isNonASCIIIdentPart)
1502 * runtime/LiteralParser.cpp:
1503 (JSC::::Lexer::lexIdentifier)
1505 2012-02-23 Kenichi Ishibashi <bashi@chromium.org>
1507 Adding WebSocket per-frame DEFLATE extension
1508 https://bugs.webkit.org/show_bug.cgi?id=77522
1510 Added USE(ZLIB) flag.
1512 Reviewed by Kent Tamura.
1516 2012-02-23 Mark Hahnenberg <mhahnenberg@apple.com>
1518 Zero out CopiedBlocks on initialization
1519 https://bugs.webkit.org/show_bug.cgi?id=79199
1521 Reviewed by Filip Pizlo.
1523 Made CopyBlocks zero their payloads during construction. This allows
1524 JSArray to avoid having to manually clear its backing store upon allocation
1525 and also alleviates any future pain with regard to the garbage collector trying
1526 to mark what it thinks are values in what is actually uninitialized memory.
1528 * heap/CopiedBlock.h:
1529 (JSC::CopiedBlock::CopiedBlock):
1530 * runtime/JSArray.cpp:
1531 (JSC::JSArray::finishCreation):
1532 (JSC::JSArray::tryFinishCreationUninitialized):
1533 (JSC::JSArray::increaseVectorLength):
1534 (JSC::JSArray::unshiftCountSlowCase):
1536 2012-02-23 Oliver Hunt <oliver@apple.com>
1538 Make Interpreter::getStackTrace be able to generate the line number for the top callframe if none is provided
1539 https://bugs.webkit.org/show_bug.cgi?id=79407
1541 Reviewed by Gavin Barraclough.
1543 Outside of exception handling, we don't know what our source line number is. This
1544 change allows us to pass -1 is as the initial line number, and get the correct line
1545 number in the resultant stack trace. We can't completely elide the initial line
1546 number (yet) due to some idiosyncrasies of the exception handling machinery.
1548 * interpreter/Interpreter.cpp:
1549 (JSC::getLineNumberForCallFrame):
1551 (JSC::Interpreter::getStackTrace):
1553 2012-02-22 Filip Pizlo <fpizlo@apple.com>
1555 DFG OSR exit value profiling should have graceful handling of local variables and arguments
1556 https://bugs.webkit.org/show_bug.cgi?id=79310
1558 Reviewed by Gavin Barraclough.
1560 Previously, if we OSR exited because a prediction in a local was wrong, we'd
1561 only realize what the true type of the local was if the regular value profiling
1562 kicked in and told us. Unless the local was block-locally copy propagated, in
1563 which case we'd know from an OSR exit profile.
1565 This patch adds OSR exit profiling to all locals and arguments. Now, if we OSR
1566 exit because of a mispredicted local or argument type, we'll know what the type of
1567 the local or argument should be immediately upon exiting.
1569 The way that local variable OSR exit profiling works is that we now have a lazily
1570 added set of OSR-exit-only value profiles for exit sites that are BadType and that
1571 cited a GetLocal as their value source. The value profiles are only added if the
1572 OSR exit is taken, and are keyed by CodeBlock, bytecode index of the GetLocal, and
1573 operand. The look-up is performed by querying the
1574 CompressedLazyOperandValueProfileHolder in the CodeBlock, using a key that contains
1575 the bytecode index and the operand. Because the value profiles are added at random
1576 times, they are not sorted; instead they are just stored in an arbitrarily-ordered
1577 SegmentedVector. Look-ups are made fast by "decompressing": the DFG::ByteCodeParser
1578 creates a LazyOperandValueProfileParser, which turns the
1579 CompressedLazyOperandValueProfileHolder's contents into a HashMap for the duration
1582 Previously, OSR exits had a pointer to the ValueProfile that had the specFailBucket
1583 into which values observed during OSR exit would be placed. Now it uses a lazy
1584 thunk for a ValueProfile. I call this the MethodOfGettingAValueProfile. It may
1585 either contain a ValueProfile inside it (which works for previous uses of OSR exit
1586 profiling) or it may just have knowledge of how to go about creating the
1587 LazyOperandValueProfile in the case that the OSR exit is actually taken. This
1588 ensures that we never have to create NumOperands*NumBytecodeIndices*NumCodeBlocks
1589 value profiling buckets unless we actually did OSR exit on every single operand,
1590 in every single instruction, in each code block (that's probably unlikely).
1592 This appears to be neutral on the major benchmarks, but is a double-digit speed-up
1593 on code deliberately written to have data flow that spans basic blocks and where
1594 the code exhibits post-optimization polymorphism in a local variable.
1597 * GNUmakefile.list.am:
1598 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1599 * JavaScriptCore.xcodeproj/project.pbxproj:
1601 * bytecode/CodeBlock.cpp:
1602 (JSC::CodeBlock::stronglyVisitStrongReferences):
1603 * bytecode/CodeBlock.h:
1605 (JSC::CodeBlock::lazyOperandValueProfiles):
1606 * bytecode/LazyOperandValueProfile.cpp: Added.
1608 (JSC::CompressedLazyOperandValueProfileHolder::CompressedLazyOperandValueProfileHolder):
1609 (JSC::CompressedLazyOperandValueProfileHolder::~CompressedLazyOperandValueProfileHolder):
1610 (JSC::CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions):
1611 (JSC::CompressedLazyOperandValueProfileHolder::add):
1612 (JSC::LazyOperandValueProfileParser::LazyOperandValueProfileParser):
1613 (JSC::LazyOperandValueProfileParser::~LazyOperandValueProfileParser):
1614 (JSC::LazyOperandValueProfileParser::getIfPresent):
1615 (JSC::LazyOperandValueProfileParser::prediction):
1616 * bytecode/LazyOperandValueProfile.h: Added.
1618 (LazyOperandValueProfileKey):
1619 (JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey):
1620 (JSC::LazyOperandValueProfileKey::operator!):
1621 (JSC::LazyOperandValueProfileKey::operator==):
1622 (JSC::LazyOperandValueProfileKey::hash):
1623 (JSC::LazyOperandValueProfileKey::bytecodeOffset):
1624 (JSC::LazyOperandValueProfileKey::operand):
1625 (JSC::LazyOperandValueProfileKey::isHashTableDeletedValue):
1626 (JSC::LazyOperandValueProfileKeyHash::hash):
1627 (JSC::LazyOperandValueProfileKeyHash::equal):
1628 (LazyOperandValueProfileKeyHash):
1630 (JSC::LazyOperandValueProfile::LazyOperandValueProfile):
1631 (LazyOperandValueProfile):
1632 (JSC::LazyOperandValueProfile::key):
1633 (CompressedLazyOperandValueProfileHolder):
1634 (LazyOperandValueProfileParser):
1635 * bytecode/MethodOfGettingAValueProfile.cpp: Added.
1637 (JSC::MethodOfGettingAValueProfile::fromLazyOperand):
1638 (JSC::MethodOfGettingAValueProfile::getSpecFailBucket):
1639 * bytecode/MethodOfGettingAValueProfile.h: Added.
1641 (MethodOfGettingAValueProfile):
1642 (JSC::MethodOfGettingAValueProfile::MethodOfGettingAValueProfile):
1643 (JSC::MethodOfGettingAValueProfile::operator!):
1644 * bytecode/ValueProfile.cpp: Removed.
1645 * bytecode/ValueProfile.h:
1648 (JSC::ValueProfileBase::ValueProfileBase):
1649 (JSC::ValueProfileBase::dump):
1650 (JSC::ValueProfileBase::computeUpdatedPrediction):
1651 (JSC::MinimalValueProfile::MinimalValueProfile):
1652 (ValueProfileWithLogNumberOfBuckets):
1653 (JSC::ValueProfileWithLogNumberOfBuckets::ValueProfileWithLogNumberOfBuckets):
1654 (JSC::ValueProfile::ValueProfile):
1655 (JSC::getValueProfileBytecodeOffset):
1656 (JSC::getRareCaseProfileBytecodeOffset):
1657 * dfg/DFGByteCodeParser.cpp:
1659 (JSC::DFG::ByteCodeParser::injectLazyOperandPrediction):
1660 (JSC::DFG::ByteCodeParser::getLocal):
1661 (JSC::DFG::ByteCodeParser::getArgument):
1663 (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
1665 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
1666 (JSC::DFG::ByteCodeParser::parse):
1667 * dfg/DFGDriver.cpp:
1668 (JSC::DFG::compile):
1670 (JSC::DFG::Graph::valueProfileFor):
1671 (JSC::DFG::Graph::methodOfGettingAValueProfileFor):
1675 * dfg/DFGOSRExit.cpp:
1676 (JSC::DFG::OSRExit::OSRExit):
1679 * dfg/DFGOSRExitCompiler32_64.cpp:
1680 (JSC::DFG::OSRExitCompiler::compileExit):
1681 * dfg/DFGOSRExitCompiler64.cpp:
1682 (JSC::DFG::OSRExitCompiler::compileExit):
1684 (JSC::DFG::Phase::beginPhase):
1685 (JSC::DFG::Phase::endPhase):
1686 * dfg/DFGSpeculativeJIT.cpp:
1687 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
1688 * dfg/DFGSpeculativeJIT.h:
1689 (JSC::DFG::SpeculativeJIT::speculationCheck):
1690 * dfg/DFGVariableAccessData.h:
1691 (JSC::DFG::VariableAccessData::nonUnifiedPrediction):
1692 (VariableAccessData):
1694 2012-02-23 Filip Pizlo <fpizlo@apple.com>
1698 * llint/LLIntOffsetsExtractor.cpp:
1700 2012-02-23 Kevin Ollivier <kevino@theolliviers.com>
1702 [wx] Build fix, disable LLINT for now and fix ENABLE defines for it.
1704 * llint/LLIntOffsetsExtractor.cpp:
1707 2012-02-23 Kevin Ollivier <kevino@theolliviers.com>
1709 [wx] Build fix for non-Mac wx builds.
1711 * runtime/DatePrototype.cpp:
1713 2012-02-22 Filip Pizlo <fpizlo@apple.com>
1715 DFG's logic for emitting a Flush is too convoluted and contains an inaccurate comment
1716 https://bugs.webkit.org/show_bug.cgi?id=79334
1718 Reviewed by Oliver Hunt.
1720 * dfg/DFGByteCodeParser.cpp:
1721 (JSC::DFG::ByteCodeParser::getLocal):
1722 (JSC::DFG::ByteCodeParser::getArgument):
1723 (JSC::DFG::ByteCodeParser::flush):
1725 2012-02-23 Gavin Barraclough <barraclough@apple.com>
1727 Object.isSealed / Object.isFrozen don't work for native objects
1728 https://bugs.webkit.org/show_bug.cgi?id=79331
1730 Reviewed by Sam Weinig.
1732 Need to inspect all properties, including static ones.
1733 This exposes a couple of bugs in Array & Arguments:
1734 - getOwnPropertyDescriptor doesn't correctly report the writable attribute of array length.
1735 - Arguments object's defineOwnProperty does not handle callee/caller/length correctly.
1737 * runtime/Arguments.cpp:
1738 (JSC::Arguments::defineOwnProperty):
1739 - Add handling for callee/caller/length.
1740 * runtime/JSArray.cpp:
1741 (JSC::JSArray::getOwnPropertyDescriptor):
1742 - report length's writability correctly.
1743 * runtime/ObjectConstructor.cpp:
1744 (JSC::objectConstructorSeal):
1745 (JSC::objectConstructorFreeze):
1746 (JSC::objectConstructorIsSealed):
1747 (JSC::objectConstructorIsFrozen):
1748 - Add spec-based implementation for non-final objects.
1750 2012-02-23 Gavin Barraclough <barraclough@apple.com>
1752 pop of array hole should get from the prototype chain
1753 https://bugs.webkit.org/show_bug.cgi?id=79338
1755 Reviewed by Sam Weinig.
1757 * runtime/JSArray.cpp:
1758 (JSC::JSArray::pop):
1759 - If the fast fast vector case fails, more closely follow the spec.
1761 2012-02-23 Yong Li <yoli@rim.com>
1763 JSString::outOfMemory() should ASSERT(isRope()) rather than !isRope()
1764 https://bugs.webkit.org/show_bug.cgi?id=79268
1766 Reviewed by Michael Saboff.
1768 resolveRope() is the only caller of outOfMemory(), and it calls outOfMemory()
1769 after it fails to allocate a buffer for m_value. So outOfMemory() should assert
1770 isRope() rather than !isRope().
1772 * runtime/JSString.cpp:
1773 (JSC::JSString::outOfMemory):
1775 2012-02-23 Patrick Gansterer <paroga@webkit.org>
1777 [CMake] Add WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS macro
1778 https://bugs.webkit.org/show_bug.cgi?id=79371
1780 Reviewed by Daniel Bates.
1783 * shell/CMakeLists.txt:
1784 * wtf/CMakeLists.txt:
1786 2012-02-23 Aron Rosenberg <arosenberg@logitech.com>
1788 Fix the PRI macros used in WTF::String formatters to be compatible with Qt and Visual Studio 2005 and newer.
1789 https://bugs.webkit.org/show_bug.cgi?id=76210
1791 Add compile time check for Visual Studio 2005 or newer.
1793 Reviewed by Simon Hausmann.
1795 * os-win32/inttypes.h:
1797 2012-02-22 Gavin Barraclough <barraclough@apple.com>
1799 Implement [[DefineOwnProperty]] for the arguments object
1800 https://bugs.webkit.org/show_bug.cgi?id=79309
1802 Reviewed by Sam Weinig.
1804 * runtime/Arguments.cpp:
1805 (JSC::Arguments::deletePropertyByIndex):
1806 (JSC::Arguments::deleteProperty):
1807 - Deleting an argument should also delete the copy on the object, if any.
1808 (JSC::Arguments::defineOwnProperty):
1809 - Defining a property may override the live mapping.
1810 * runtime/Arguments.h:
1813 2012-02-22 Gavin Barraclough <barraclough@apple.com>
1815 Fix Object.freeze for non-final objects.
1816 https://bugs.webkit.org/show_bug.cgi?id=79286
1818 Reviewed by Oliver Hunt.
1820 For vanilla objects we implement this with a single transition, for objects
1821 with special properties we should just follow the spec defined algorithm.
1823 * runtime/JSArray.cpp:
1824 (JSC::SparseArrayValueMap::put):
1825 - this does need to handle inextensible objects.
1826 * runtime/ObjectConstructor.cpp:
1827 (JSC::objectConstructorSeal):
1828 (JSC::objectConstructorFreeze):
1829 - Implement spec defined algorithm for non-final objects.
1830 * runtime/Structure.cpp:
1831 (JSC::Structure::Structure):
1832 (JSC::Structure::freezeTransition):
1833 - freeze should set m_hasReadOnlyOrGetterSetterPropertiesExcludingProto.
1834 * runtime/Structure.h:
1835 (JSC::Structure::hasReadOnlyOrGetterSetterPropertiesExcludingProto):
1836 (JSC::Structure::setHasGetterSetterProperties):
1837 (JSC::Structure::setContainsReadOnlyProperties):
1839 - renamed m_hasReadOnlyOrGetterSetterPropertiesExcludingProto.
1841 2012-02-22 Mark Hahnenberg <mhahnenberg@apple.com>
1843 Allocations from CopiedBlocks should always be 8-byte aligned
1844 https://bugs.webkit.org/show_bug.cgi?id=79271
1846 Reviewed by Geoffrey Garen.
1848 * heap/CopiedAllocator.h:
1849 (JSC::CopiedAllocator::allocate):
1850 * heap/CopiedBlock.h: Changed to add padding so that the start of the payload is always
1851 guaranteed to be 8 byte aligned on both 64- and 32-bit platforms.
1853 * heap/CopiedSpace.cpp: Changed all assertions of isPointerAligned to is8ByteAligned.
1854 (JSC::CopiedSpace::tryAllocateOversize):
1855 (JSC::CopiedSpace::getFreshBlock):
1856 * heap/CopiedSpaceInlineMethods.h:
1857 (JSC::CopiedSpace::allocateFromBlock):
1858 * runtime/JSArray.h:
1859 (ArrayStorage): Added padding for ArrayStorage to make sure that it is always 8 byte
1860 aligned on both 64- and 32-bit platforms.
1861 * wtf/StdLibExtras.h:
1862 (WTF::is8ByteAligned): Added new utility function that functions similarly to the
1863 way isPointerAligned does, but it just always checks for 8 byte alignment.
1866 2012-02-22 Sheriff Bot <webkit.review.bot@gmail.com>
1868 Unreviewed, rolling out r108456.
1869 http://trac.webkit.org/changeset/108456
1870 https://bugs.webkit.org/show_bug.cgi?id=79223
1872 Broke fast/regex/pcre-test-4.html and cannot find anyone on
1873 IRC (Requested by zherczeg on #webkit).
1876 (JSC::Yarr::YarrGenerator::backtrackPatternCharacterGreedy):
1878 2012-02-22 Sheriff Bot <webkit.review.bot@gmail.com>
1880 Unreviewed, rolling out r108468.
1881 http://trac.webkit.org/changeset/108468
1882 https://bugs.webkit.org/show_bug.cgi?id=79219
1884 Broke Chromium Win release build (Requested by bashi on
1889 2012-02-22 Kenichi Ishibashi <bashi@chromium.org>
1891 Adding WebSocket per-frame DEFLATE extension
1892 https://bugs.webkit.org/show_bug.cgi?id=77522
1894 Added USE(ZLIB) flag.
1896 Reviewed by Kent Tamura.
1900 2012-02-22 Hojong Han <hojong.han@samsung.com>
1902 Short circuit fixed for a 16 bt pattern character and an 8 bit string.
1903 https://bugs.webkit.org/show_bug.cgi?id=75602
1905 Reviewed by Gavin Barraclough.
1908 (JSC::Yarr::YarrGenerator::backtrackPatternCharacterGreedy):
1910 2012-02-21 Filip Pizlo <fpizlo@apple.com>
1912 Build fix for systems with case sensitive disks.
1914 * llint/LLIntOfflineAsmConfig.h:
1916 2012-02-21 Filip Pizlo <fpizlo@apple.com>
1918 JSC should be a triple-tier VM
1919 https://bugs.webkit.org/show_bug.cgi?id=75812
1920 <rdar://problem/10079694>
1922 Reviewed by Gavin Barraclough.
1924 Implemented an interpreter that uses the JIT's calling convention. This
1925 interpreter is called LLInt, or the Low Level Interpreter. JSC will now
1926 will start by executing code in LLInt and will only tier up to the old
1927 JIT after the code is proven hot.
1929 LLInt is written in a modified form of our macro assembly. This new macro
1930 assembly is compiled by an offline assembler (see offlineasm), which
1931 implements many modern conveniences such as a Turing-complete CPS-based
1932 macro language and direct access to relevant C++ type information
1933 (basically offsets of fields and sizes of structs/classes).
1935 Code executing in LLInt appears to the rest of the JSC world "as if" it
1936 were executing in the old JIT. Hence, things like exception handling and
1937 cross-execution-engine calls just work and require pretty much no
1938 additional overhead.
1940 This interpreter is 2-2.5x faster than our old interpreter on SunSpider,
1941 V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider,
1942 V8, and Kraken, but appear to get a double-digit improvement on real-world
1943 websites due to a huge reduction in the amount of JIT'ing.
1947 * GNUmakefile.list.am:
1948 * JavaScriptCore.pri:
1949 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1950 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
1951 * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
1952 * JavaScriptCore.xcodeproj/project.pbxproj:
1954 * assembler/LinkBuffer.h:
1955 * assembler/MacroAssemblerCodeRef.h:
1956 (MacroAssemblerCodePtr):
1957 (JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
1958 * bytecode/BytecodeConventions.h: Added.
1959 * bytecode/CallLinkStatus.cpp:
1960 (JSC::CallLinkStatus::computeFromLLInt):
1962 (JSC::CallLinkStatus::computeFor):
1963 * bytecode/CallLinkStatus.h:
1964 (JSC::CallLinkStatus::isSet):
1965 (JSC::CallLinkStatus::operator!):
1967 * bytecode/CodeBlock.cpp:
1968 (JSC::CodeBlock::dump):
1969 (JSC::CodeBlock::CodeBlock):
1970 (JSC::CodeBlock::~CodeBlock):
1971 (JSC::CodeBlock::finalizeUnconditionally):
1972 (JSC::CodeBlock::stronglyVisitStrongReferences):
1974 (JSC::CodeBlock::unlinkCalls):
1975 (JSC::CodeBlock::unlinkIncomingCalls):
1976 (JSC::CodeBlock::bytecodeOffset):
1977 (JSC::ProgramCodeBlock::jettison):
1978 (JSC::EvalCodeBlock::jettison):
1979 (JSC::FunctionCodeBlock::jettison):
1980 (JSC::ProgramCodeBlock::jitCompileImpl):
1981 (JSC::EvalCodeBlock::jitCompileImpl):
1982 (JSC::FunctionCodeBlock::jitCompileImpl):
1983 * bytecode/CodeBlock.h:
1986 (JSC::CodeBlock::baselineVersion):
1987 (JSC::CodeBlock::linkIncomingCall):
1988 (JSC::CodeBlock::bytecodeOffset):
1989 (JSC::CodeBlock::jitCompile):
1990 (JSC::CodeBlock::hasOptimizedReplacement):
1991 (JSC::CodeBlock::addPropertyAccessInstruction):
1992 (JSC::CodeBlock::addGlobalResolveInstruction):
1993 (JSC::CodeBlock::addLLIntCallLinkInfo):
1994 (JSC::CodeBlock::addGlobalResolveInfo):
1995 (JSC::CodeBlock::numberOfMethodCallLinkInfos):
1996 (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset):
1997 (JSC::CodeBlock::likelyToTakeSlowCase):
1998 (JSC::CodeBlock::couldTakeSlowCase):
1999 (JSC::CodeBlock::likelyToTakeSpecialFastCase):
2000 (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
2001 (JSC::CodeBlock::likelyToTakeAnySlowCase):
2002 (JSC::CodeBlock::addFrequentExitSite):
2003 (JSC::CodeBlock::dontJITAnytimeSoon):
2004 (JSC::CodeBlock::jitAfterWarmUp):
2005 (JSC::CodeBlock::jitSoon):
2006 (JSC::CodeBlock::llintExecuteCounter):
2009 (FunctionCodeBlock):
2010 * bytecode/GetByIdStatus.cpp:
2011 (JSC::GetByIdStatus::computeFromLLInt):
2013 (JSC::GetByIdStatus::computeFor):
2014 * bytecode/GetByIdStatus.h:
2015 (JSC::GetByIdStatus::GetByIdStatus):
2016 (JSC::GetByIdStatus::wasSeenInJIT):
2018 * bytecode/Instruction.h:
2020 (JSC::Instruction::Instruction):
2022 * bytecode/LLIntCallLinkInfo.h: Added.
2024 (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo):
2025 (LLIntCallLinkInfo):
2026 (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo):
2027 (JSC::LLIntCallLinkInfo::isLinked):
2028 (JSC::LLIntCallLinkInfo::unlink):
2029 * bytecode/MethodCallLinkStatus.cpp:
2030 (JSC::MethodCallLinkStatus::computeFor):
2031 * bytecode/Opcode.cpp:
2033 * bytecode/Opcode.h:
2035 (JSC::padOpcodeName):
2036 * bytecode/PutByIdStatus.cpp:
2037 (JSC::PutByIdStatus::computeFromLLInt):
2039 (JSC::PutByIdStatus::computeFor):
2040 * bytecode/PutByIdStatus.h:
2042 * bytecompiler/BytecodeGenerator.cpp:
2043 (JSC::BytecodeGenerator::emitResolve):
2044 (JSC::BytecodeGenerator::emitResolveWithBase):
2045 (JSC::BytecodeGenerator::emitGetById):
2046 (JSC::BytecodeGenerator::emitPutById):
2047 (JSC::BytecodeGenerator::emitDirectPutById):
2048 (JSC::BytecodeGenerator::emitCall):
2049 (JSC::BytecodeGenerator::emitConstruct):
2050 (JSC::BytecodeGenerator::emitCatch):
2051 * dfg/DFGByteCodeParser.cpp:
2052 (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
2053 (JSC::DFG::ByteCodeParser::handleInlining):
2054 (JSC::DFG::ByteCodeParser::parseBlock):
2055 * dfg/DFGCapabilities.h:
2056 (JSC::DFG::canCompileOpcode):
2057 * dfg/DFGOSRExitCompiler.cpp:
2058 * dfg/DFGOperations.cpp:
2061 (JSC::Heap::firstAllocatorWithoutDestructors):
2063 * heap/MarkStack.cpp:
2064 (JSC::visitChildren):
2065 * heap/MarkedAllocator.h:
2068 * heap/MarkedSpace.h:
2071 (JSC::MarkedSpace::firstAllocator):
2072 * interpreter/CallFrame.cpp:
2074 (JSC::CallFrame::bytecodeOffsetForNonDFGCode):
2075 (JSC::CallFrame::setBytecodeOffsetForNonDFGCode):
2076 (JSC::CallFrame::currentVPC):
2077 (JSC::CallFrame::setCurrentVPC):
2078 (JSC::CallFrame::trueCallerFrame):
2079 * interpreter/CallFrame.h:
2080 (JSC::ExecState::hasReturnPC):
2081 (JSC::ExecState::clearReturnPC):
2083 (JSC::ExecState::bytecodeOffsetForNonDFGCode):
2084 (JSC::ExecState::currentVPC):
2085 (JSC::ExecState::setCurrentVPC):
2086 * interpreter/Interpreter.cpp:
2087 (JSC::Interpreter::Interpreter):
2088 (JSC::Interpreter::~Interpreter):
2090 (JSC::Interpreter::initialize):
2091 (JSC::Interpreter::isOpcode):
2092 (JSC::Interpreter::unwindCallFrame):
2093 (JSC::getCallerInfo):
2094 (JSC::Interpreter::privateExecute):
2095 (JSC::Interpreter::retrieveLastCaller):
2096 * interpreter/Interpreter.h:
2099 (JSC::Interpreter::getOpcode):
2100 (JSC::Interpreter::getOpcodeID):
2101 (JSC::Interpreter::classicEnabled):
2102 * interpreter/RegisterFile.h:
2105 * jit/ExecutableAllocator.h:
2107 * jit/HostCallReturnValue.cpp: Added.
2109 (JSC::getHostCallReturnValueWithExecState):
2110 * jit/HostCallReturnValue.h: Added.
2112 (JSC::initializeHostCallReturnValue):
2114 (JSC::JIT::privateCompileMainPass):
2115 (JSC::JIT::privateCompileSlowCases):
2116 (JSC::JIT::privateCompile):
2118 (JSC::JITCode::isOptimizingJIT):
2120 (JSC::JITCode::isBaselineCode):
2121 (JSC::JITCode::JITCode):
2123 (JSC::jitCompileIfAppropriate):
2124 (JSC::jitCompileFunctionIfAppropriate):
2125 * jit/JITExceptions.cpp:
2127 * jit/JITInlineMethods.h:
2128 (JSC::JIT::updateTopCallFrame):
2130 (JSC::DEFINE_STUB_FUNCTION):
2134 * jit/JSInterfaceJIT.h:
2136 * llint/LLIntCommon.h: Added.
2137 * llint/LLIntData.cpp: Added.
2139 (JSC::LLInt::Data::Data):
2140 (JSC::LLInt::Data::performAssertions):
2141 (JSC::LLInt::Data::~Data):
2142 * llint/LLIntData.h: Added.
2146 (JSC::LLInt::Data::exceptionInstructions):
2147 (JSC::LLInt::Data::opcodeMap):
2148 (JSC::LLInt::Data::performAssertions):
2149 * llint/LLIntEntrypoints.cpp: Added.
2151 (JSC::LLInt::getFunctionEntrypoint):
2152 (JSC::LLInt::getEvalEntrypoint):
2153 (JSC::LLInt::getProgramEntrypoint):
2154 * llint/LLIntEntrypoints.h: Added.
2157 (JSC::LLInt::getEntrypoint):
2158 * llint/LLIntExceptions.cpp: Added.
2160 (JSC::LLInt::interpreterThrowInCaller):
2161 (JSC::LLInt::returnToThrowForThrownException):
2162 (JSC::LLInt::returnToThrow):
2163 (JSC::LLInt::callToThrow):
2164 * llint/LLIntExceptions.h: Added.
2167 * llint/LLIntOfflineAsmConfig.h: Added.
2168 * llint/LLIntOffsetsExtractor.cpp: Added.
2170 (LLIntOffsetsExtractor):
2171 (JSC::LLIntOffsetsExtractor::dummy):
2173 * llint/LLIntSlowPaths.cpp: Added.
2175 (JSC::LLInt::llint_trace_operand):
2176 (JSC::LLInt::llint_trace_value):
2177 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2178 (JSC::LLInt::traceFunctionPrologue):
2179 (JSC::LLInt::shouldJIT):
2180 (JSC::LLInt::entryOSR):
2181 (JSC::LLInt::resolveGlobal):
2182 (JSC::LLInt::getByVal):
2183 (JSC::LLInt::handleHostCall):
2184 (JSC::LLInt::setUpCall):
2185 (JSC::LLInt::genericCall):
2186 * llint/LLIntSlowPaths.h: Added.
2189 * llint/LLIntThunks.cpp: Added.
2191 (JSC::LLInt::generateThunkWithJumpTo):
2192 (JSC::LLInt::functionForCallEntryThunkGenerator):
2193 (JSC::LLInt::functionForConstructEntryThunkGenerator):
2194 (JSC::LLInt::functionForCallArityCheckThunkGenerator):
2195 (JSC::LLInt::functionForConstructArityCheckThunkGenerator):
2196 (JSC::LLInt::evalEntryThunkGenerator):
2197 (JSC::LLInt::programEntryThunkGenerator):
2198 * llint/LLIntThunks.h: Added.
2201 * llint/LowLevelInterpreter.asm: Added.
2202 * llint/LowLevelInterpreter.cpp: Added.
2203 * llint/LowLevelInterpreter.h: Added.
2204 * offlineasm: Added.
2205 * offlineasm/armv7.rb: Added.
2206 * offlineasm/asm.rb: Added.
2207 * offlineasm/ast.rb: Added.
2208 * offlineasm/backends.rb: Added.
2209 * offlineasm/generate_offset_extractor.rb: Added.
2210 * offlineasm/instructions.rb: Added.
2211 * offlineasm/offset_extractor_constants.rb: Added.
2212 * offlineasm/offsets.rb: Added.
2213 * offlineasm/opt.rb: Added.
2214 * offlineasm/parser.rb: Added.
2215 * offlineasm/registers.rb: Added.
2216 * offlineasm/self_hash.rb: Added.
2217 * offlineasm/settings.rb: Added.
2218 * offlineasm/transform.rb: Added.
2219 * offlineasm/x86.rb: Added.
2220 * runtime/CodeSpecializationKind.h: Added.
2222 * runtime/CommonSlowPaths.h:
2223 (JSC::CommonSlowPaths::arityCheckFor):
2225 * runtime/Executable.cpp:
2226 (JSC::jettisonCodeBlock):
2228 (JSC::EvalExecutable::jitCompile):
2229 (JSC::samplingDescription):
2230 (JSC::EvalExecutable::compileInternal):
2231 (JSC::ProgramExecutable::jitCompile):
2232 (JSC::ProgramExecutable::compileInternal):
2233 (JSC::FunctionExecutable::baselineCodeBlockFor):
2234 (JSC::FunctionExecutable::jitCompileForCall):
2235 (JSC::FunctionExecutable::jitCompileForConstruct):
2236 (JSC::FunctionExecutable::compileForCallInternal):
2237 (JSC::FunctionExecutable::compileForConstructInternal):
2238 * runtime/Executable.h:
2241 (ProgramExecutable):
2242 (FunctionExecutable):
2243 (JSC::FunctionExecutable::jitCompileFor):
2244 * runtime/ExecutionHarness.h: Added.
2246 (JSC::prepareForExecution):
2247 (JSC::prepareFunctionForExecution):
2248 * runtime/JSArray.h:
2254 * runtime/JSFunction.h:
2257 * runtime/JSGlobalData.cpp:
2258 (JSC::JSGlobalData::JSGlobalData):
2259 * runtime/JSGlobalData.h:
2262 * runtime/JSGlobalObject.h:
2265 * runtime/JSObject.h:
2269 * runtime/JSPropertyNameIterator.h:
2271 (JSPropertyNameIterator):
2272 * runtime/JSString.h:
2275 * runtime/JSTypeInfo.h:
2278 * runtime/JSValue.cpp:
2279 (JSC::JSValue::description):
2280 * runtime/JSValue.h:
2283 * runtime/JSVariableObject.h:
2286 * runtime/Options.cpp:
2288 (JSC::Options::initializeOptions):
2289 * runtime/Options.h:
2291 * runtime/ScopeChain.h:
2294 * runtime/Structure.cpp:
2295 (JSC::Structure::addPropertyTransition):
2296 * runtime/Structure.h:
2299 * runtime/StructureChain.h:
2304 * wtf/SentinelLinkedList.h:
2305 (SentinelLinkedList):
2306 (WTF::SentinelLinkedList::isEmpty):
2307 * wtf/text/StringImpl.h:
2311 2012-02-21 Oliver Hunt <oliver@apple.com>
2313 Unbreak double-typed arrays on ARMv7
2314 https://bugs.webkit.org/show_bug.cgi?id=79177
2316 Reviewed by Gavin Barraclough.
2318 The existing code had completely broken address arithmetic.
2320 * JSCTypedArrayStubs.h:
2322 * assembler/MacroAssemblerARMv7.h:
2323 (JSC::MacroAssemblerARMv7::storeDouble):
2324 (JSC::MacroAssemblerARMv7::storeFloat):
2326 2012-02-21 Gavin Barraclough <barraclough@apple.com>
2328 Should be able to reconfigure a non-configurable property as read-only
2329 https://bugs.webkit.org/show_bug.cgi?id=79170
2331 Reviewed by Sam Weinig.
2333 See ES5.1 8.12.9 10.a.i - the spec prohibits making a read-only property writable,
2334 but does not inhibit making a writable property read-only.
2336 * runtime/JSGlobalData.cpp:
2337 (JSC::JSGlobalData::JSGlobalData):
2338 * runtime/JSGlobalData.h:
2339 (JSC::JSGlobalData::setInDefineOwnProperty):
2341 (JSC::JSGlobalData::isInDefineOwnProperty):
2342 - Added flag, tracking whether we are in JSObject::defineOwnProperty.
2343 * runtime/JSObject.cpp:
2344 (JSC::JSObject::deleteProperty):
2345 (DefineOwnPropertyScope):
2346 - Always allow properties to be deleted by DefineOwnProperty - assume it knows what it is doing!
2347 (JSC::DefineOwnPropertyScope::DefineOwnPropertyScope):
2348 (JSC::DefineOwnPropertyScope::~DefineOwnPropertyScope):
2349 - Added RAII helper.
2350 (JSC::JSObject::defineOwnProperty):
2351 - Track on the globalData when we are in this method.
2353 2012-02-21 Oliver Hunt <oliver@apple.com>
2355 Make TypedArrays be available in commandline jsc
2356 https://bugs.webkit.org/show_bug.cgi?id=79163
2358 Reviewed by Gavin Barraclough.
2360 Adds a compile time option to have jsc support a basic implementation
2361 of the TypedArrays available in WebCore. This lets us test the typed
2362 array logic in the JIT witout having to build webcore.
2364 * JSCTypedArrayStubs.h: Added.
2366 * JavaScriptCore.xcodeproj/project.pbxproj:
2368 (GlobalObject::finishCreation):
2370 (GlobalObject::addConstructableFunction):
2371 * runtime/JSGlobalData.h:
2374 2012-02-21 Tom Sepez <tsepez@chromium.org>
2376 equalIgnoringNullity() only comparing half the bytes for equality
2377 https://bugs.webkit.org/show_bug.cgi?id=79135
2379 Reviewed by Adam Barth.
2381 * wtf/text/StringImpl.h:
2382 (WTF::equalIgnoringNullity):
2384 2012-02-21 Roland Takacs <takacs.roland@stud.u-szeged.hu>
2386 Unnecessary preprocessor macros in MainThread.h/cpp
2387 https://bugs.webkit.org/show_bug.cgi?id=79083
2389 Removed invalid/wrong PLATFORM(WINDOWS) preprocessor macro.
2391 * wtf/MainThread.cpp:
2396 2012-02-21 Sam Weinig <sam@webkit.org>
2398 Attempt to fix the Snow Leopard build.
2400 * Configurations/Base.xcconfig:
2402 2012-02-21 Sam Weinig <sam@webkit.org>
2404 Use libc++ when building with Clang on Mac
2405 https://bugs.webkit.org/show_bug.cgi?id=78981
2407 Reviewed by Dan Bernstein.
2409 * Configurations/Base.xcconfig:
2411 2012-02-21 Adam Roben <aroben@apple.com>
2413 Roll out r108309, r108323, and r108326
2415 They broke the 32-bit Lion build.
2417 Original bugs is <http://webkit.org/b/75812> <rdar://problem/10079694>.
2421 * GNUmakefile.list.am:
2422 * JavaScriptCore.pri:
2423 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2424 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2425 * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
2426 * JavaScriptCore.xcodeproj/project.pbxproj:
2428 * assembler/LinkBuffer.h:
2429 * assembler/MacroAssemblerCodeRef.h:
2430 * bytecode/BytecodeConventions.h: Removed.
2431 * bytecode/CallLinkStatus.cpp:
2432 * bytecode/CallLinkStatus.h:
2433 * bytecode/CodeBlock.cpp:
2434 * bytecode/CodeBlock.h:
2435 * bytecode/GetByIdStatus.cpp:
2436 * bytecode/GetByIdStatus.h:
2437 * bytecode/Instruction.h:
2438 * bytecode/LLIntCallLinkInfo.h: Removed.
2439 * bytecode/MethodCallLinkStatus.cpp:
2440 * bytecode/Opcode.cpp:
2441 * bytecode/Opcode.h:
2442 * bytecode/PutByIdStatus.cpp:
2443 * bytecode/PutByIdStatus.h:
2444 * bytecompiler/BytecodeGenerator.cpp:
2445 * dfg/DFGByteCodeParser.cpp:
2446 * dfg/DFGCapabilities.h:
2447 * dfg/DFGOSRExitCompiler.cpp:
2448 * dfg/DFGOperations.cpp:
2450 * heap/MarkStack.cpp:
2451 * heap/MarkedAllocator.h:
2452 * heap/MarkedSpace.h:
2453 * interpreter/CallFrame.cpp:
2454 * interpreter/CallFrame.h:
2455 * interpreter/Interpreter.cpp:
2456 * interpreter/Interpreter.h:
2457 * interpreter/RegisterFile.h:
2458 * jit/ExecutableAllocator.h:
2459 * jit/HostCallReturnValue.cpp: Removed.
2460 * jit/HostCallReturnValue.h: Removed.
2464 * jit/JITExceptions.cpp:
2465 * jit/JITInlineMethods.h:
2468 * jit/JSInterfaceJIT.h:
2469 * llint/LLIntCommon.h: Removed.
2470 * llint/LLIntData.cpp: Removed.
2471 * llint/LLIntData.h: Removed.
2472 * llint/LLIntEntrypoints.cpp: Removed.
2473 * llint/LLIntEntrypoints.h: Removed.
2474 * llint/LLIntExceptions.cpp: Removed.
2475 * llint/LLIntExceptions.h: Removed.
2476 * llint/LLIntOfflineAsmConfig.h: Removed.
2477 * llint/LLIntOffsetsExtractor.cpp: Removed.
2478 * llint/LLIntSlowPaths.cpp: Removed.
2479 * llint/LLIntSlowPaths.h: Removed.
2480 * llint/LLIntThunks.cpp: Removed.
2481 * llint/LLIntThunks.h: Removed.
2482 * llint/LowLevelInterpreter.asm: Removed.
2483 * llint/LowLevelInterpreter.cpp: Removed.
2484 * llint/LowLevelInterpreter.h: Removed.
2485 * offlineasm/armv7.rb: Removed.
2486 * offlineasm/asm.rb: Removed.
2487 * offlineasm/ast.rb: Removed.
2488 * offlineasm/backends.rb: Removed.
2489 * offlineasm/generate_offset_extractor.rb: Removed.
2490 * offlineasm/instructions.rb: Removed.
2491 * offlineasm/offset_extractor_constants.rb: Removed.
2492 * offlineasm/offsets.rb: Removed.
2493 * offlineasm/opt.rb: Removed.
2494 * offlineasm/parser.rb: Removed.
2495 * offlineasm/registers.rb: Removed.
2496 * offlineasm/self_hash.rb: Removed.
2497 * offlineasm/settings.rb: Removed.
2498 * offlineasm/transform.rb: Removed.
2499 * offlineasm/x86.rb: Removed.
2500 * runtime/CodeSpecializationKind.h: Removed.
2501 * runtime/CommonSlowPaths.h:
2502 * runtime/Executable.cpp:
2503 * runtime/Executable.h:
2504 * runtime/ExecutionHarness.h: Removed.
2505 * runtime/JSArray.h:
2507 * runtime/JSFunction.h:
2508 * runtime/JSGlobalData.cpp:
2509 * runtime/JSGlobalData.h:
2510 * runtime/JSGlobalObject.h:
2511 * runtime/JSObject.h:
2512 * runtime/JSPropertyNameIterator.h:
2513 * runtime/JSString.h:
2514 * runtime/JSTypeInfo.h:
2515 * runtime/JSValue.cpp:
2516 * runtime/JSValue.h:
2517 * runtime/JSVariableObject.h:
2518 * runtime/Options.cpp:
2519 * runtime/Options.h:
2520 * runtime/ScopeChain.h:
2521 * runtime/Structure.cpp:
2522 * runtime/Structure.h:
2523 * runtime/StructureChain.h:
2526 * wtf/SentinelLinkedList.h:
2527 * wtf/text/StringImpl.h:
2529 2012-02-21 Gustavo Noronha Silva <kov@debian.org> and Bob Tracy <rct@frus.com>
2531 Does not build on IA64, SPARC and Alpha
2532 https://bugs.webkit.org/show_bug.cgi?id=79047
2534 Rubber-stamped by Kent Tamura.
2536 * wtf/dtoa/utils.h: these architectures also have correct double
2537 operations, so add them to the appropriate side of the check.
2539 2012-02-21 Filip Pizlo <fpizlo@apple.com>
2541 Fix massive crashes in all tests introduced by previous build fix, and fix non-DFG build.
2542 https://bugs.webkit.org/show_bug.cgi?id=75812
2544 Reviewed by Csaba Osztrogonác.
2546 * dfg/DFGOperations.cpp:
2548 * jit/HostCallReturnValue.h:
2549 (JSC::initializeHostCallReturnValue):
2551 2012-02-21 Filip Pizlo <fpizlo@apple.com>
2553 Attempted build fix for ELF platforms.
2555 * dfg/DFGOperations.cpp:
2557 (JSC::getHostCallReturnValueWithExecState):
2558 * jit/HostCallReturnValue.cpp:
2560 * jit/HostCallReturnValue.h:
2561 (JSC::initializeHostCallReturnValue):
2563 2012-02-20 Filip Pizlo <fpizlo@apple.com>
2565 JSC should be a triple-tier VM
2566 https://bugs.webkit.org/show_bug.cgi?id=75812
2567 <rdar://problem/10079694>
2569 Reviewed by Gavin Barraclough.
2571 Implemented an interpreter that uses the JIT's calling convention. This
2572 interpreter is called LLInt, or the Low Level Interpreter. JSC will now
2573 will start by executing code in LLInt and will only tier up to the old
2574 JIT after the code is proven hot.
2576 LLInt is written in a modified form of our macro assembly. This new macro
2577 assembly is compiled by an offline assembler (see offlineasm), which
2578 implements many modern conveniences such as a Turing-complete CPS-based
2579 macro language and direct access to relevant C++ type information
2580 (basically offsets of fields and sizes of structs/classes).
2582 Code executing in LLInt appears to the rest of the JSC world "as if" it
2583 were executing in the old JIT. Hence, things like exception handling and
2584 cross-execution-engine calls just work and require pretty much no
2585 additional overhead.
2587 This interpreter is 2-2.5x faster than our old interpreter on SunSpider,
2588 V8, and Kraken. With triple-tiering turned on, we're neutral on SunSpider,
2589 V8, and Kraken, but appear to get a double-digit improvement on real-world
2590 websites due to a huge reduction in the amount of JIT'ing.
2594 * GNUmakefile.list.am:
2595 * JavaScriptCore.pri:
2596 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2597 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2598 * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
2599 * JavaScriptCore.xcodeproj/project.pbxproj:
2601 * assembler/LinkBuffer.h:
2602 * assembler/MacroAssemblerCodeRef.h:
2603 (MacroAssemblerCodePtr):
2604 (JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
2605 * bytecode/BytecodeConventions.h: Added.
2606 * bytecode/CallLinkStatus.cpp:
2607 (JSC::CallLinkStatus::computeFromLLInt):
2609 (JSC::CallLinkStatus::computeFor):
2610 * bytecode/CallLinkStatus.h:
2611 (JSC::CallLinkStatus::isSet):
2612 (JSC::CallLinkStatus::operator!):
2614 * bytecode/CodeBlock.cpp:
2615 (JSC::CodeBlock::dump):
2616 (JSC::CodeBlock::CodeBlock):
2617 (JSC::CodeBlock::~CodeBlock):
2618 (JSC::CodeBlock::finalizeUnconditionally):
2619 (JSC::CodeBlock::stronglyVisitStrongReferences):
2621 (JSC::CodeBlock::unlinkCalls):
2622 (JSC::CodeBlock::unlinkIncomingCalls):
2623 (JSC::CodeBlock::bytecodeOffset):
2624 (JSC::ProgramCodeBlock::jettison):
2625 (JSC::EvalCodeBlock::jettison):
2626 (JSC::FunctionCodeBlock::jettison):
2627 (JSC::ProgramCodeBlock::jitCompileImpl):
2628 (JSC::EvalCodeBlock::jitCompileImpl):
2629 (JSC::FunctionCodeBlock::jitCompileImpl):
2630 * bytecode/CodeBlock.h:
2633 (JSC::CodeBlock::baselineVersion):
2634 (JSC::CodeBlock::linkIncomingCall):
2635 (JSC::CodeBlock::bytecodeOffset):
2636 (JSC::CodeBlock::jitCompile):
2637 (JSC::CodeBlock::hasOptimizedReplacement):
2638 (JSC::CodeBlock::addPropertyAccessInstruction):
2639 (JSC::CodeBlock::addGlobalResolveInstruction):
2640 (JSC::CodeBlock::addLLIntCallLinkInfo):
2641 (JSC::CodeBlock::addGlobalResolveInfo):
2642 (JSC::CodeBlock::numberOfMethodCallLinkInfos):
2643 (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset):
2644 (JSC::CodeBlock::likelyToTakeSlowCase):
2645 (JSC::CodeBlock::couldTakeSlowCase):
2646 (JSC::CodeBlock::likelyToTakeSpecialFastCase):
2647 (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
2648 (JSC::CodeBlock::likelyToTakeAnySlowCase):
2649 (JSC::CodeBlock::addFrequentExitSite):
2650 (JSC::CodeBlock::dontJITAnytimeSoon):
2651 (JSC::CodeBlock::jitAfterWarmUp):
2652 (JSC::CodeBlock::jitSoon):
2653 (JSC::CodeBlock::llintExecuteCounter):
2656 (FunctionCodeBlock):
2657 * bytecode/GetByIdStatus.cpp:
2658 (JSC::GetByIdStatus::computeFromLLInt):
2660 (JSC::GetByIdStatus::computeFor):
2661 * bytecode/GetByIdStatus.h:
2662 (JSC::GetByIdStatus::GetByIdStatus):
2663 (JSC::GetByIdStatus::wasSeenInJIT):
2665 * bytecode/Instruction.h:
2667 (JSC::Instruction::Instruction):
2669 * bytecode/LLIntCallLinkInfo.h: Added.
2671 (JSC::LLIntCallLinkInfo::LLIntCallLinkInfo):
2672 (LLIntCallLinkInfo):
2673 (JSC::LLIntCallLinkInfo::~LLIntCallLinkInfo):
2674 (JSC::LLIntCallLinkInfo::isLinked):
2675 (JSC::LLIntCallLinkInfo::unlink):
2676 * bytecode/MethodCallLinkStatus.cpp:
2677 (JSC::MethodCallLinkStatus::computeFor):
2678 * bytecode/Opcode.cpp:
2680 * bytecode/Opcode.h:
2682 (JSC::padOpcodeName):
2683 * bytecode/PutByIdStatus.cpp:
2684 (JSC::PutByIdStatus::computeFromLLInt):
2686 (JSC::PutByIdStatus::computeFor):
2687 * bytecode/PutByIdStatus.h:
2689 * bytecompiler/BytecodeGenerator.cpp:
2690 (JSC::BytecodeGenerator::emitResolve):
2691 (JSC::BytecodeGenerator::emitResolveWithBase):
2692 (JSC::BytecodeGenerator::emitGetById):
2693 (JSC::BytecodeGenerator::emitPutById):
2694 (JSC::BytecodeGenerator::emitDirectPutById):
2695 (JSC::BytecodeGenerator::emitCall):
2696 (JSC::BytecodeGenerator::emitConstruct):
2697 (JSC::BytecodeGenerator::emitCatch):
2698 * dfg/DFGByteCodeParser.cpp:
2699 (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
2700 (JSC::DFG::ByteCodeParser::handleInlining):
2701 (JSC::DFG::ByteCodeParser::parseBlock):
2702 * dfg/DFGCapabilities.h:
2703 (JSC::DFG::canCompileOpcode):
2704 * dfg/DFGOSRExitCompiler.cpp:
2705 * dfg/DFGOperations.cpp:
2708 (JSC::Heap::firstAllocatorWithoutDestructors):
2710 * heap/MarkStack.cpp:
2711 (JSC::visitChildren):
2712 * heap/MarkedAllocator.h:
2715 * heap/MarkedSpace.h:
2718 (JSC::MarkedSpace::firstAllocator):
2719 * interpreter/CallFrame.cpp:
2721 (JSC::CallFrame::bytecodeOffsetForNonDFGCode):
2722 (JSC::CallFrame::setBytecodeOffsetForNonDFGCode):
2723 (JSC::CallFrame::currentVPC):
2724 (JSC::CallFrame::setCurrentVPC):
2725 (JSC::CallFrame::trueCallerFrame):
2726 * interpreter/CallFrame.h:
2727 (JSC::ExecState::hasReturnPC):
2728 (JSC::ExecState::clearReturnPC):
2730 (JSC::ExecState::bytecodeOffsetForNonDFGCode):
2731 (JSC::ExecState::currentVPC):
2732 (JSC::ExecState::setCurrentVPC):
2733 * interpreter/Interpreter.cpp:
2734 (JSC::Interpreter::Interpreter):
2735 (JSC::Interpreter::~Interpreter):
2737 (JSC::Interpreter::initialize):
2738 (JSC::Interpreter::isOpcode):
2739 (JSC::Interpreter::unwindCallFrame):
2740 (JSC::getCallerInfo):
2741 (JSC::Interpreter::privateExecute):
2742 (JSC::Interpreter::retrieveLastCaller):
2743 * interpreter/Interpreter.h:
2746 (JSC::Interpreter::getOpcode):
2747 (JSC::Interpreter::getOpcodeID):
2748 (JSC::Interpreter::classicEnabled):
2749 * interpreter/RegisterFile.h:
2752 * jit/ExecutableAllocator.h:
2754 * jit/HostCallReturnValue.cpp: Added.
2756 (JSC::getHostCallReturnValueWithExecState):
2757 * jit/HostCallReturnValue.h: Added.
2759 (JSC::initializeHostCallReturnValue):
2761 (JSC::JIT::privateCompileMainPass):
2762 (JSC::JIT::privateCompileSlowCases):
2763 (JSC::JIT::privateCompile):
2765 (JSC::JITCode::isOptimizingJIT):
2767 (JSC::JITCode::isBaselineCode):
2768 (JSC::JITCode::JITCode):
2770 (JSC::jitCompileIfAppropriate):
2771 (JSC::jitCompileFunctionIfAppropriate):
2772 * jit/JITExceptions.cpp:
2774 * jit/JITInlineMethods.h:
2775 (JSC::JIT::updateTopCallFrame):
2777 (JSC::DEFINE_STUB_FUNCTION):
2781 * jit/JSInterfaceJIT.h:
2783 * llint/LLIntCommon.h: Added.
2784 * llint/LLIntData.cpp: Added.
2786 (JSC::LLInt::Data::Data):
2787 (JSC::LLInt::Data::performAssertions):
2788 (JSC::LLInt::Data::~Data):
2789 * llint/LLIntData.h: Added.
2793 (JSC::LLInt::Data::exceptionInstructions):
2794 (JSC::LLInt::Data::opcodeMap):
2795 (JSC::LLInt::Data::performAssertions):
2796 * llint/LLIntEntrypoints.cpp: Added.
2798 (JSC::LLInt::getFunctionEntrypoint):
2799 (JSC::LLInt::getEvalEntrypoint):
2800 (JSC::LLInt::getProgramEntrypoint):
2801 * llint/LLIntEntrypoints.h: Added.
2804 (JSC::LLInt::getEntrypoint):
2805 * llint/LLIntExceptions.cpp: Added.
2807 (JSC::LLInt::interpreterThrowInCaller):
2808 (JSC::LLInt::returnToThrowForThrownException):
2809 (JSC::LLInt::returnToThrow):
2810 (JSC::LLInt::callToThrow):
2811 * llint/LLIntExceptions.h: Added.
2814 * llint/LLIntOfflineAsmConfig.h: Added.
2815 * llint/LLIntOffsetsExtractor.cpp: Added.
2817 (LLIntOffsetsExtractor):
2818 (JSC::LLIntOffsetsExtractor::dummy):
2820 * llint/LLIntSlowPaths.cpp: Added.
2822 (JSC::LLInt::llint_trace_operand):
2823 (JSC::LLInt::llint_trace_value):
2824 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2825 (JSC::LLInt::traceFunctionPrologue):
2826 (JSC::LLInt::shouldJIT):
2827 (JSC::LLInt::entryOSR):
2828 (JSC::LLInt::resolveGlobal):
2829 (JSC::LLInt::getByVal):
2830 (JSC::LLInt::handleHostCall):
2831 (JSC::LLInt::setUpCall):
2832 (JSC::LLInt::genericCall):
2833 * llint/LLIntSlowPaths.h: Added.
2836 * llint/LLIntThunks.cpp: Added.
2838 (JSC::LLInt::generateThunkWithJumpTo):
2839 (JSC::LLInt::functionForCallEntryThunkGenerator):
2840 (JSC::LLInt::functionForConstructEntryThunkGenerator):
2841 (JSC::LLInt::functionForCallArityCheckThunkGenerator):
2842 (JSC::LLInt::functionForConstructArityCheckThunkGenerator):
2843 (JSC::LLInt::evalEntryThunkGenerator):
2844 (JSC::LLInt::programEntryThunkGenerator):
2845 * llint/LLIntThunks.h: Added.
2848 * llint/LowLevelInterpreter.asm: Added.
2849 * llint/LowLevelInterpreter.cpp: Added.
2850 * llint/LowLevelInterpreter.h: Added.
2851 * offlineasm: Added.
2852 * offlineasm/armv7.rb: Added.
2853 * offlineasm/asm.rb: Added.
2854 * offlineasm/ast.rb: Added.
2855 * offlineasm/backends.rb: Added.
2856 * offlineasm/generate_offset_extractor.rb: Added.
2857 * offlineasm/instructions.rb: Added.
2858 * offlineasm/offset_extractor_constants.rb: Added.
2859 * offlineasm/offsets.rb: Added.
2860 * offlineasm/opt.rb: Added.
2861 * offlineasm/parser.rb: Added.
2862 * offlineasm/registers.rb: Added.
2863 * offlineasm/self_hash.rb: Added.
2864 * offlineasm/settings.rb: Added.
2865 * offlineasm/transform.rb: Added.
2866 * offlineasm/x86.rb: Added.
2867 * runtime/CodeSpecializationKind.h: Added.
2869 * runtime/CommonSlowPaths.h:
2870 (JSC::CommonSlowPaths::arityCheckFor):
2872 * runtime/Executable.cpp:
2873 (JSC::jettisonCodeBlock):
2875 (JSC::EvalExecutable::jitCompile):
2876 (JSC::samplingDescription):
2877 (JSC::EvalExecutable::compileInternal):
2878 (JSC::ProgramExecutable::jitCompile):
2879 (JSC::ProgramExecutable::compileInternal):
2880 (JSC::FunctionExecutable::baselineCodeBlockFor):
2881 (JSC::FunctionExecutable::jitCompileForCall):
2882 (JSC::FunctionExecutable::jitCompileForConstruct):
2883 (JSC::FunctionExecutable::compileForCallInternal):
2884 (JSC::FunctionExecutable::compileForConstructInternal):
2885 * runtime/Executable.h:
2888 (ProgramExecutable):
2889 (FunctionExecutable):
2890 (JSC::FunctionExecutable::jitCompileFor):
2891 * runtime/ExecutionHarness.h: Added.
2893 (JSC::prepareForExecution):
2894 (JSC::prepareFunctionForExecution):
2895 * runtime/JSArray.h:
2901 * runtime/JSFunction.h:
2904 * runtime/JSGlobalData.cpp:
2905 (JSC::JSGlobalData::JSGlobalData):
2906 * runtime/JSGlobalData.h:
2909 * runtime/JSGlobalObject.h:
2912 * runtime/JSObject.h:
2916 * runtime/JSPropertyNameIterator.h:
2918 (JSPropertyNameIterator):
2919 * runtime/JSString.h:
2922 * runtime/JSTypeInfo.h:
2925 * runtime/JSValue.cpp:
2926 (JSC::JSValue::description):
2927 * runtime/JSValue.h:
2930 * runtime/JSVariableObject.h:
2933 * runtime/Options.cpp:
2935 (JSC::Options::initializeOptions):
2936 * runtime/Options.h:
2938 * runtime/ScopeChain.h:
2941 * runtime/Structure.cpp:
2942 (JSC::Structure::addPropertyTransition):
2943 * runtime/Structure.h:
2946 * runtime/StructureChain.h:
2951 * wtf/SentinelLinkedList.h:
2952 (SentinelLinkedList):
2953 (WTF::SentinelLinkedList::isEmpty):
2954 * wtf/text/StringImpl.h:
2958 2012-02-20 Filip Pizlo <fpizlo@apple.com>
2960 Unreviewed, rolling out http://trac.webkit.org/changeset/108291
2961 It completely broke the 32-bit JIT.
2963 * heap/CopiedAllocator.h:
2964 * heap/CopiedSpace.h:
2967 (JSC::Heap::allocatorForObjectWithDestructor):
2969 (JSC::JIT::privateCompileSlowCases):
2972 * jit/JITInlineMethods.h:
2974 * jit/JITOpcodes.cpp:
2975 (JSC::JIT::emit_op_new_array):
2976 * runtime/JSArray.cpp:
2979 * runtime/JSArray.h:
2983 2012-02-20 Gavin Barraclough <barraclough@apple.com>
2985 [[Put]] should throw if prototype chain contains a readonly property.
2986 https://bugs.webkit.org/show_bug.cgi?id=79069
2988 Reviewed by Oliver Hunt.
2990 Currently we only check the base of the put, not the prototype chain.
2991 Fold this check in with the test for accessors.
2993 * runtime/JSObject.cpp:
2994 (JSC::JSObject::put):
2995 - Updated to test all objects in the propotype chain for readonly properties.
2996 (JSC::JSObject::putDirectAccessor):
2997 (JSC::putDescriptor):
2998 - Record the presence of readonly properties on the structure.
2999 * runtime/Structure.cpp:
3000 (JSC::Structure::Structure):
3001 - hasGetterSetterPropertiesExcludingProto expanded to hasReadOnlyOrGetterSetterPropertiesExcludingProto.
3002 * runtime/Structure.h:
3003 (JSC::Structure::hasReadOnlyOrGetterSetterPropertiesExcludingProto):
3004 (JSC::Structure::setHasGetterSetterProperties):
3005 - hasGetterSetterPropertiesExcludingProto expanded to hasReadOnlyOrGetterSetterPropertiesExcludingProto.
3006 (JSC::Structure::setContainsReadOnlyProperties):
3009 2012-02-20 Mark Hahnenberg <mhahnenberg@apple.com>
3011 Implement fast path for op_new_array in the baseline JIT
3012 https://bugs.webkit.org/show_bug.cgi?id=78612
3014 Reviewed by Filip Pizlo.
3016 * heap/CopiedAllocator.h:
3017 (CopiedAllocator): Friended the JIT to allow access to m_currentOffset.
3018 * heap/CopiedSpace.h:
3019 (CopiedSpace): Friended the JIT to allow access to
3020 (JSC::CopiedSpace::allocator):
3022 (JSC::Heap::storageAllocator): Added a getter for the CopiedAllocator class so the JIT
3023 can use it for simple allocation i.e. when we can just bump the offset without having to
3026 (JSC::JIT::privateCompileSlowCases): Added new slow case for op_new_array for when
3027 we have to bail out because the fast allocation path fails for whatever reason.
3030 * jit/JITInlineMethods.h:
3031 (JSC::JIT::emitAllocateBasicStorage): Added utility function that allows objects to
3032 allocate generic backing stores. This function is used by emitAllocateJSArray.
3034 (JSC::JIT::emitAllocateJSArray): Added utility function that allows the client to
3035 more easily allocate JSArrays. This function is used by emit_op_new_array and I expect
3036 it will also be used for emit_op_new_array_buffer.
3037 * jit/JITOpcodes.cpp:
3038 (JSC::JIT::emit_op_new_array): Changed to do inline allocation of JSArrays. Still does
3039 a stub call for oversize arrays.
3041 (JSC::JIT::emitSlow_op_new_array): Just bails out to a stub call if we fail in any way on
3043 * runtime/JSArray.cpp:
3045 * runtime/JSArray.h: Added lots of offset functions for all the fields that we need to
3046 initialize in the JIT.
3048 (JSC::ArrayStorage::lengthOffset):
3049 (JSC::ArrayStorage::numValuesInVectorOffset):
3050 (JSC::ArrayStorage::allocBaseOffset):
3051 (JSC::ArrayStorage::vectorOffset):
3053 (JSC::JSArray::sparseValueMapOffset):
3054 (JSC::JSArray::subclassDataOffset):
3055 (JSC::JSArray::indexBiasOffset):
3057 (JSC::JSArray::storageSize): Moved this function from being a static function in the cpp file
3058 to being a static function in the JSArray class. This move allows the JIT to call it to
3059 see what size it should allocate.
3061 2012-02-20 Gavin Barraclough <barraclough@apple.com>
3063 DefineOwnProperty fails with numeric properties & Object.prototype
3064 https://bugs.webkit.org/show_bug.cgi?id=79059
3066 Reviewed by Oliver Hunt.
3068 ObjectPrototype caches whether it contains any numeric properties (m_hasNoPropertiesWithUInt32Names),
3069 calls to defineOwnProperty need to update this cache.
3071 * runtime/ObjectPrototype.cpp:
3072 (JSC::ObjectPrototype::put):
3073 (JSC::ObjectPrototype::defineOwnProperty):
3075 (JSC::ObjectPrototype::getOwnPropertySlotByIndex):
3076 * runtime/ObjectPrototype.h:
3079 2012-02-20 Pino Toscano <pino@debian.org>
3081 Does not build on GNU Hurd
3082 https://bugs.webkit.org/show_bug.cgi?id=79045
3084 Reviewed by Gustavo Noronha Silva.
3086 * wtf/Platform.h: define WTF_OS_HURD.
3087 * wtf/ThreadIdentifierDataPthreads.cpp: adds a band-aid fix
3088 for the lack of PTHREAD_KEYS_MAX definition, with a value which
3089 should not cause issues.
3091 2012-02-20 Gavin Barraclough <barraclough@apple.com>
3093 Unreviewed windows build fix.
3095 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3097 2012-02-20 Mark Hahnenberg <mhahnenberg@apple.com>
3099 Undoing accidental changes
3102 (JSC::Heap::collectAllGarbage):
3104 2012-02-20 Mark Hahnenberg <mhahnenberg@apple.com>
3106 Factor out allocation in CopySpace into a separate CopyAllocator
3107 https://bugs.webkit.org/show_bug.cgi?id=78610
3109 Reviewed by Oliver Hunt.
3111 Added a new CopyAllocator class, which allows us to do allocations without
3112 having to load the current offset and store the current offset in the current
3113 block. This change will allow us to easily do inline assembly in the JIT for
3116 * GNUmakefile.list.am:
3117 * JavaScriptCore.gypi:
3118 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3119 * JavaScriptCore.xcodeproj/project.pbxproj:
3120 * heap/CopiedAllocator.h: Added.
3123 (JSC::CopiedAllocator::currentBlock):
3124 (JSC::CopiedAllocator::CopiedAllocator):
3125 (JSC::CopiedAllocator::allocate):
3126 (JSC::CopiedAllocator::fitsInCurrentBlock):
3127 (JSC::CopiedAllocator::wasLastAllocation):
3128 (JSC::CopiedAllocator::startedCopying):
3129 (JSC::CopiedAllocator::resetCurrentBlock):
3130 (JSC::CopiedAllocator::currentUtilization):
3131 (JSC::CopiedAllocator::resetLastAllocation):
3132 * heap/CopiedBlock.h:
3134 * heap/CopiedSpace.cpp: Moved some stuff from CopiedSpaceInlineMethods to here because we
3135 weren't really getting any benefits from having such big functions in a header file.
3136 (JSC::CopiedSpace::CopiedSpace):
3138 (JSC::CopiedSpace::init):
3139 (JSC::CopiedSpace::tryAllocateSlowCase):
3140 (JSC::CopiedSpace::tryAllocateOversize):
3141 (JSC::CopiedSpace::tryReallocate):
3142 (JSC::CopiedSpace::tryReallocateOversize):
3143 (JSC::CopiedSpace::doneFillingBlock):
3144 (JSC::CopiedSpace::doneCopying):
3145 (JSC::CopiedSpace::getFreshBlock):
3146 * heap/CopiedSpace.h:
3148 * heap/CopiedSpaceInlineMethods.h:
3150 (JSC::CopiedSpace::startedCopying):
3151 (JSC::CopiedSpace::addNewBlock):
3152 (JSC::CopiedSpace::allocateNewBlock):
3153 (JSC::CopiedSpace::fitsInBlock):
3154 (JSC::CopiedSpace::tryAllocate):
3155 (JSC::CopiedSpace::allocateFromBlock):
3157 (JSC::Heap::collectAllGarbage):
3161 2012-02-20 Patrick Gansterer <paroga@webkit.org>
3163 Fix Visual Studio 2010 build.
3165 * bytecompiler/NodesCodegen.cpp:
3166 (JSC::PropertyListNode::emitBytecode):
3168 2012-02-16 Gavin Barraclough <barraclough@apple.com>
3170 Move special __proto__ property to Object.prototype
3171 https://bugs.webkit.org/show_bug.cgi?id=78409
3173 Reviewed by Oliver Hunt.
3175 Re-implement this as a regular accessor property. This has three key benefits:
3176 1) It makes it possible for objects to be given properties named __proto__.
3177 2) Object.prototype.__proto__ can be deleted, preventing object prototypes from being changed.
3178 3) This largely removes the magic used the implement __proto__, it can just be made a regular accessor property.
3180 * parser/Parser.cpp:
3181 (JSC::::parseFunctionInfo):
3182 - No need to prohibit functions named __proto__.
3183 * runtime/JSGlobalObject.cpp:
3184 (JSC::JSGlobalObject::reset):
3185 - Add __proto__ accessor to Object.prototype.
3186 * runtime/JSGlobalObjectFunctions.cpp:
3187 (JSC::globalFuncProtoGetter):
3188 (JSC::globalFuncProtoSetter):
3189 - Definition of the __proto__ accessor functions.
3190 * runtime/JSGlobalObjectFunctions.h:
3191 - Declaration of the __proto__ accessor functions.
3192 * runtime/JSObject.cpp:
3193 (JSC::JSObject::put):
3194 - Remove the special handling for __proto__, there is still a check to allow for a fast guard for accessors excluding __proto__.
3195 (JSC::JSObject::putDirectAccessor):
3196 - Track on the structure whether an object contains accessors other than one for __proto__.
3197 (JSC::JSObject::defineOwnProperty):
3198 - No need to prohibit definition of own properties named __proto__.
3199 * runtime/JSObject.h:
3200 (JSC::JSObject::inlineGetOwnPropertySlot):
3201 - Remove the special handling for __proto__.
3202 (JSC::JSValue::get):
3203 - Remove the special handling for __proto__.
3204 * runtime/JSString.cpp:
3205 (JSC::JSString::getOwnPropertySlot):
3206 - Remove the special handling for __proto__.
3207 * runtime/JSValue.h:
3209 - Made synthesizePrototype public (this may be needed by the __proto__ getter).
3210 * runtime/ObjectConstructor.cpp:
3211 (JSC::objectConstructorGetPrototypeOf):
3212 - Perform the security check & call prototype() directly.
3213 * runtime/Structure.cpp:
3214 (JSC::Structure::Structure):
3215 - Added 'ExcludingProto' variant of the 'hasGetterSetterProperties' state.
3216 * runtime/Structure.h:
3217 (JSC::Structure::hasGetterSetterPropertiesExcludingProto):
3218 (JSC::Structure::setHasGetterSetterProperties):
3220 - Added 'ExcludingProto' variant of the 'hasGetterSetterProperties' state.
3222 2012-02-20 Michael Saboff <msaboff@apple.com>
3224 Update toLower and toUpper tests for Unicode 6.1 changes
3225 https://bugs.webkit.org/show_bug.cgi?id=78923
3227 Reviewed by Oliver Hunt.
3229 * tests/mozilla/ecma/String/15.5.4.11-2.js: Updated the test
3230 to handle a third set of results for updated Unicode 6.1
3233 (TestCaseMultiExpected):
3234 (writeTestCaseResultMultiExpected):
3235 (getTestCaseResultMultiExpected):
3238 (DecimalToHexString):
3240 2012-02-20 Andy Wingo <wingo@igalia.com>
3242 Remove unused features from CodeFeatures
3243 https://bugs.webkit.org/show_bug.cgi?id=78804
3245 Reviewed by Gavin Barraclough.
3248 * parser/ASTBuilder.h:
3249 (JSC::ClosureFeature):
3250 (JSC::ASTBuilder::createFunctionBody):
3251 (JSC::ASTBuilder::usesClosures):
3252 Remove "ClosureFeature". Since we track captured variables more
3253 precisely, this bit doesn't do us any good.
3255 (JSC::AssignFeature):
3256 (JSC::ASTBuilder::makeAssignNode):
3257 (JSC::ASTBuilder::makePrefixNode):
3258 (JSC::ASTBuilder::makePostfixNode):
3259 (JSC::ASTBuilder::usesAssignment):
3260 Similarly, remove AssignFeature. It is unused.
3262 2012-02-19 Carlos Garcia Campos <cgarcia@igalia.com>
3264 Unreviewed. Fix make distcheck issues.
3266 * GNUmakefile.list.am: Add missing files.
3268 2012-02-18 Sam Weinig <sam@webkit.org>
3270 Fix style issues in DFG Phase classes
3271 https://bugs.webkit.org/show_bug.cgi?id=78983
3273 Reviewed by Ryosuke Niwa.
3275 * dfg/DFGArithNodeFlagsInferencePhase.cpp:
3276 * dfg/DFGCFAPhase.cpp:
3277 * dfg/DFGCSEPhase.cpp:
3278 * dfg/DFGPredictionPropagationPhase.cpp:
3279 * dfg/DFGVirtualRegisterAllocationPhase.cpp:
3280 Add a space before the colon in class declarations.
3282 2012-02-18 Filip Pizlo <fpizlo@apple.com>
3284 Attempt to fix Windows build.
3286 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3288 2012-02-18 Sam Weinig <sam@webkit.org>
3290 Fix the libc++ build.
3292 Reviewed by Anders Carlsson.
3295 Libc++'s nullptr emulation does not allow default construction
3296 of the nullptr_t type. Work around this with the arguably clearer
3297 just returning nullptr.
3299 2012-02-18 Filip Pizlo <fpizlo@apple.com>
3301 DFGPropagator.cpp has too many things
3302 https://bugs.webkit.org/show_bug.cgi?id=78956
3304 Reviewed by Oliver Hunt.
3306 Added the notion of a DFG::Phase. Removed DFG::Propagator, and took its
3307 various things and put them into separate files. These new phases follow
3308 the naming convention "DFG<name>Phase" where <name> is a noun. They are
3309 called via functions of the form "perform<name>".
3312 * GNUmakefile.list.am:
3313 * JavaScriptCore.xcodeproj/project.pbxproj:
3315 * dfg/DFGArithNodeFlagsInferencePhase.cpp: Added.
3317 (JSC::DFG::performArithNodeFlagsInference):
3318 * dfg/DFGArithNodeFlagsInferencePhase.h: Added.
3320 * dfg/DFGCFAPhase.cpp: Added.
3322 (JSC::DFG::performCFA):
3323 * dfg/DFGCFAPhase.h: Added.
3325 * dfg/DFGCSEPhase.cpp: Added.
3327 (JSC::DFG::performCSE):
3328 * dfg/DFGCSEPhase.h: Added.
3330 * dfg/DFGDriver.cpp:
3331 (JSC::DFG::compile):
3332 * dfg/DFGPhase.cpp: Added.
3334 (JSC::DFG::Phase::beginPhase):
3335 (JSC::DFG::Phase::endPhase):
3336 * dfg/DFGPhase.h: Added.
3339 (JSC::DFG::Phase::Phase):
3340 (JSC::DFG::Phase::~Phase):
3341 (JSC::DFG::Phase::globalData):
3342 (JSC::DFG::Phase::codeBlock):
3343 (JSC::DFG::Phase::profiledBlock):
3344 (JSC::DFG::Phase::beginPhase):
3345 (JSC::DFG::Phase::endPhase):
3346 (JSC::DFG::runPhase):
3347 * dfg/DFGPredictionPropagationPhase.cpp: Added.
3349 (JSC::DFG::performPredictionPropagation):
3350 * dfg/DFGPredictionPropagationPhase.h: Added.
3352 * dfg/DFGPropagator.cpp: Removed.
3353 * dfg/DFGPropagator.h: Removed.
3354 * dfg/DFGVirtualRegisterAllocationPhase.cpp: Added.
3356 (JSC::DFG::performVirtualRegisterAllocation):
3357 * dfg/DFGVirtualRegisterAllocationPhase.h: Added.
3360 2012-02-17 Filip Pizlo <fpizlo@apple.com>
3362 DFG::Graph should have references to JSGlobalData, the CodeBlock being compiled, and
3363 the CodeBlock that was used for profiling
3364 https://bugs.webkit.org/show_bug.cgi?id=78954
3366 Reviewed by Gavin Barraclough.
3368 * bytecode/CodeBlock.h:
3369 (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
3371 * dfg/DFGAbstractState.cpp:
3372 (JSC::DFG::AbstractState::AbstractState):
3373 (JSC::DFG::AbstractState::execute):
3374 * dfg/DFGAbstractState.h:
3375 * dfg/DFGAssemblyHelpers.h:
3377 * dfg/DFGByteCodeParser.cpp:
3378 (JSC::DFG::ByteCodeParser::ByteCodeParser):
3379 (JSC::DFG::ByteCodeParser::handleCall):
3381 * dfg/DFGByteCodeParser.h:
3383 * dfg/DFGDriver.cpp:
3384 (JSC::DFG::compile):
3386 (JSC::DFG::Graph::dump):
3387 (JSC::DFG::Graph::predictArgumentTypes):
3389 (JSC::DFG::Graph::Graph):
3391 (JSC::DFG::Graph::getJSConstantPrediction):
3392 (JSC::DFG::Graph::addShouldSpeculateInteger):
3393 (JSC::DFG::Graph::isInt32Constant):
3394 (JSC::DFG::Graph::isDoubleConstant):
3395 (JSC::DFG::Graph::isNumberConstant):
3396 (JSC::DFG::Graph::isBooleanConstant):
3397 (JSC::DFG::Graph::isFunctionConstant):
3398 (JSC::DFG::Graph::valueOfJSConstant):
3399 (JSC::DFG::Graph::valueOfInt32Constant):
3400 (JSC::DFG::Graph::valueOfNumberConstant):
3401 (JSC::DFG::Graph::valueOfBooleanConstant):
3402 (JSC::DFG::Graph::valueOfFunctionConstant):
3403 (JSC::DFG::Graph::baselineCodeBlockFor):
3404 (JSC::DFG::Graph::valueProfileFor):
3405 (JSC::DFG::Graph::addImmediateShouldSpeculateInteger):
3406 * dfg/DFGJITCompiler.h:
3407 (JSC::DFG::JITCompiler::JITCompiler):
3409 * dfg/DFGOSRExit.cpp:
3410 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
3411 * dfg/DFGPropagator.cpp:
3412 (JSC::DFG::Propagator::Propagator):
3413 (JSC::DFG::Propagator::isNotNegZero):
3414 (JSC::DFG::Propagator::isNotZero):
3415 (JSC::DFG::Propagator::propagateNodePredictions):
3416 (JSC::DFG::Propagator::doRoundOfDoubleVoting):
3417 (JSC::DFG::Propagator::globalCFA):
3418 (JSC::DFG::propagate):
3419 * dfg/DFGPropagator.h:
3421 * dfg/DFGSpeculativeJIT.cpp:
3422 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
3423 (JSC::DFG::SpeculativeJIT::compileAdd):
3424 (JSC::DFG::SpeculativeJIT::compileArithSub):
3425 * dfg/DFGSpeculativeJIT.h:
3426 (JSC::DFG::SpeculativeJIT::isConstant):
3427 (JSC::DFG::SpeculativeJIT::isJSConstant):
3428 (JSC::DFG::SpeculativeJIT::isInt32Constant):
3429 (JSC::DFG::SpeculativeJIT::isDoubleConstant):
3430 (JSC::DFG::SpeculativeJIT::isNumberConstant):
3431 (JSC::DFG::SpeculativeJIT::isBooleanConstant):
3432 (JSC::DFG::SpeculativeJIT::isFunctionConstant):
3433 (JSC::DFG::SpeculativeJIT::valueOfInt32Constant):