1 2011-09-26 Geoffrey Garen <ggaren@apple.com>
3 REGRESSION (r95912): Conservative marking doesn't filter out pointers to
5 https://bugs.webkit.org/show_bug.cgi?id=68860
7 Reviewed by Oliver Hunt.
9 Bencher says no performance change, maybe a 7% speedup on kraken-imaging-darkroom.
12 (JSC::MarkedBlock::isAtomAligned): Renamed atomMask to atomAlignment mask
13 because the mask doesn't produce the actual atom number.
15 (JSC::MarkedBlock::isLiveCell): Testing just for alignment isn't good
16 enough; we also need to test that a pointer is beyond the metadata section
17 of a MarkedBlock, to avoid treating random metadata as a JSCell.
19 2011-09-26 Mark Hahnenberg <mhahnenberg@apple.com>
21 Make JSCell::toBoolean non-virtual
22 https://bugs.webkit.org/show_bug.cgi?id=67727
24 Reviewed by Geoffrey Garen.
26 JSCell::toBoolean now manually performs the toBoolean check for objects and strings (where
27 before it was simply virtual and would crash if its implementation was called).
28 Its descendants in JSObject and JSString have also been made non-virtual. JSCell now
29 explicitly covers all cases of toBoolean, so having a virtual implementation of
30 JSCell::toBoolean is no longer necessary. This is part of a larger process of un-virtualizing JSCell.
33 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
36 * runtime/JSNotAnObject.cpp:
37 * runtime/JSNotAnObject.h:
40 (JSC::JSCell::toBoolean):
41 (JSC::JSValue::toBoolean):
43 2011-09-26 Chris Marrin <cmarrin@apple.com>
45 Enable requestAnimationFrame on Windows
46 https://bugs.webkit.org/show_bug.cgi?id=68397
48 Reviewed by Simon Fraser.
50 Enabled REQUEST_ANIMATION_FRAME_TIMER for Windows
54 2011-09-26 Noel Gordon <noel.gordon@gmail.com>
56 [Chromium] Remove DFGAliasTracker.h references from gyp project files
57 https://bugs.webkit.org/show_bug.cgi?id=68787
59 Reviewed by Geoffrey Garen.
61 DFG/DFGAliasTracker.h was removed in r95389. Cleanup (remove) references
62 to that file from the gyp project files.
64 * JavaScriptCore.gypi:
66 2011-09-26 Zoltan Herczeg <zherczeg@webkit.org>
68 [Qt]REGRESSION(r95865): It made 4 tests crash
69 https://bugs.webkit.org/show_bug.cgi?id=68780
71 Reviewed by Oliver Hunt.
73 emitJumpSlowCaseIfNotJSCell(...) cannot be moved
74 away since the next load depends on it.
76 * jit/JITPropertyAccess32_64.cpp:
77 (JSC::JIT::emit_op_put_by_val):
79 2011-09-25 Mark Hahnenberg <mhahnenberg@apple.com>
81 Add custom vtable struct to ClassInfo struct
82 https://bugs.webkit.org/show_bug.cgi?id=68567
84 Reviewed by Oliver Hunt.
86 Declared/defined the MethodTable struct and added it to the ClassInfo struct.
87 Also defined the CREATE_METHOD_TABLE macro to generate these method tables
88 succinctly where they need to be defined.
90 Also added to it the first function to use this macro, visitChildren.
92 This is part of the process of getting rid of all C++ virtual methods in JSCell.
93 Eventually all virtual functions in JSCell that can't easily be converted to
94 non-virtual functions will be put into this custom vtable structure.
95 * runtime/ClassInfo.h:
97 Added the CREATE_METHOD_TABLE macro call as the last argument to each of the
98 ClassInfo structs declared in these classes. This saves us from having to visit
99 each s_info definition in the future when we add more methods to the MethodTable.
100 * API/JSCallbackConstructor.cpp:
101 * API/JSCallbackFunction.cpp:
102 * API/JSCallbackObject.cpp:
103 * JavaScriptCore.exp:
104 * runtime/Arguments.cpp:
105 * runtime/ArrayConstructor.cpp:
106 * runtime/ArrayPrototype.cpp:
107 * runtime/BooleanObject.cpp:
108 * runtime/BooleanPrototype.cpp:
109 * runtime/DateConstructor.cpp:
110 * runtime/DateInstance.cpp:
111 * runtime/DatePrototype.cpp:
112 * runtime/ErrorInstance.cpp:
113 * runtime/ErrorPrototype.cpp:
114 * runtime/ExceptionHelpers.cpp:
115 * runtime/Executable.cpp:
116 * runtime/GetterSetter.cpp:
117 * runtime/InternalFunction.cpp:
118 * runtime/JSAPIValueWrapper.cpp:
119 * runtime/JSActivation.cpp:
120 * runtime/JSArray.cpp:
121 * runtime/JSByteArray.cpp:
122 * runtime/JSFunction.cpp:
123 * runtime/JSGlobalObject.cpp:
124 * runtime/JSONObject.cpp:
125 * runtime/JSObject.cpp:
126 * runtime/JSPropertyNameIterator.cpp:
127 * runtime/JSString.cpp:
128 * runtime/MathObject.cpp:
129 * runtime/NativeErrorConstructor.cpp:
130 * runtime/NumberConstructor.cpp:
131 * runtime/NumberObject.cpp:
132 * runtime/NumberPrototype.cpp:
133 * runtime/ObjectConstructor.cpp:
134 * runtime/ObjectPrototype.cpp:
135 * runtime/RegExp.cpp:
136 * runtime/RegExpConstructor.cpp:
137 * runtime/RegExpObject.cpp:
138 * runtime/RegExpPrototype.cpp:
139 * runtime/ScopeChain.cpp:
140 * runtime/StringConstructor.cpp:
141 * runtime/StringObject.cpp:
142 * runtime/StringPrototype.cpp:
143 * runtime/Structure.cpp:
144 * runtime/StructureChain.cpp:
146 Had to make visitChildren and visitChildrenVirtual protected instead of private
147 because some of the subclasses of JSWrapperObject need access to JSWrapperObject's
148 visitChildren function pointer in their vtable since they don't provide their own
149 implementation. Same for RegExpObject.
150 * runtime/JSWrapperObject.h:
151 * runtime/RegExpObject.h:
153 2011-09-25 Adam Barth <abarth@webkit.org>
155 Finish removing PLATFORM(BREWMP) by removing associated code
156 https://bugs.webkit.org/show_bug.cgi?id=68779
158 Reviewed by Sam Weinig.
160 * JavaScriptCore.gyp/JavaScriptCore.gyp:
161 * JavaScriptCore.gypi:
162 * gyp/JavaScriptCore.gyp:
164 * wtf/FastMalloc.cpp:
165 (WTF::fastMallocSize):
168 * wtf/brew/MainThreadBrew.cpp: Removed.
169 * wtf/brew/OwnPtrBrew.cpp: Removed.
170 * wtf/brew/RefPtrBrew.h: Removed.
171 * wtf/brew/ShellBrew.h: Removed.
172 * wtf/brew/StringBrew.cpp: Removed.
173 * wtf/brew/SystemMallocBrew.h: Removed.
174 * wtf/unicode/brew: Removed.
175 * wtf/unicode/brew/UnicodeBrew.cpp: Removed.
176 * wtf/unicode/brew/UnicodeBrew.h: Removed.
178 2011-09-25 Filip Pizlo <fpizlo@apple.com>
180 DFG JIT does not count speculation successes correctly
181 https://bugs.webkit.org/show_bug.cgi?id=68785
183 Reviewed by Geoffrey Garen.
185 * dfg/DFGJITCompiler.cpp:
186 (JSC::DFG::JITCompiler::compileEntry):
187 (JSC::DFG::JITCompiler::compileBody):
188 * dfg/DFGOperations.cpp:
190 2011-09-25 Filip Pizlo <fpizlo@apple.com>
192 DFG support for op_resolve_global is not enabled
193 https://bugs.webkit.org/show_bug.cgi?id=68786
195 Reviewed by Geoffrey Garen.
197 * dfg/DFGCapabilities.h:
198 (JSC::DFG::canCompileOpcode):
200 2011-09-25 Filip Pizlo <fpizlo@apple.com>
202 DFG static prediction code is no longer needed and should be removed
203 https://bugs.webkit.org/show_bug.cgi?id=68784
205 Reviewed by Oliver Hunt.
207 This gets rid of static prediction code, and ensures that we do not
208 try to compile code where dynamic predictions are not available.
209 This is accomplished by immediately performing an OSR exit wherever
210 a value is retrieved for which no predictions exist.
212 This also adds value profiling for this on functions used for calls.
214 The heuristics for deciding when to optimize code are also tweaked,
215 since it is now profitable to optimize sooner. This may need to be
216 tweaked further, but this patch only makes minimal changes.
218 This results in a 16% speed-up on Kraken/ai-astar, leading to a 3%
219 overall win on Kraken. It's neutral elsewhere.
221 * bytecode/CodeBlock.cpp:
222 (JSC::CodeBlock::shouldOptimizeNow):
223 (JSC::CodeBlock::dumpValueProfiles):
224 * bytecode/CodeBlock.h:
225 * bytecode/PredictedType.cpp:
226 (JSC::predictionToString):
227 * bytecode/PredictedType.h:
228 (JSC::isCellPrediction):
229 (JSC::isObjectPrediction):
230 (JSC::isFinalObjectPrediction):
231 (JSC::isStringPrediction):
232 (JSC::isArrayPrediction):
233 (JSC::isInt32Prediction):
234 (JSC::isDoublePrediction):
235 (JSC::isNumberPrediction):
236 (JSC::isBooleanPrediction):
237 (JSC::mergePredictions):
238 * bytecode/PredictionTracker.h:
239 (JSC::PredictionTracker::predictArgument):
240 (JSC::PredictionTracker::predict):
241 (JSC::PredictionTracker::predictGlobalVar):
242 * bytecode/ValueProfile.cpp:
243 (JSC::ValueProfile::computeUpdatedPrediction):
244 * dfg/DFGByteCodeParser.cpp:
245 (JSC::DFG::ByteCodeParser::set):
246 (JSC::DFG::ByteCodeParser::addCall):
247 (JSC::DFG::ByteCodeParser::getPrediction):
248 (JSC::DFG::ByteCodeParser::parseBlock):
250 (JSC::DFG::Graph::predictArgumentTypes):
252 (JSC::DFG::Graph::predict):
253 (JSC::DFG::Graph::predictGlobalVar):
254 (JSC::DFG::Graph::getMethodCheckPrediction):
255 (JSC::DFG::Graph::getJSConstantPrediction):
256 (JSC::DFG::Graph::getPrediction):
257 * dfg/DFGJITCodeGenerator.cpp:
258 (JSC::DFG::JITCodeGenerator::writeBarrier):
259 (JSC::DFG::JITCodeGenerator::emitBranch):
260 * dfg/DFGJITCompiler.h:
261 (JSC::DFG::JITCompiler::getPrediction):
263 (JSC::DFG::Node::valueOfJSConstantNode):
264 (JSC::DFG::Node::isInt32Constant):
265 (JSC::DFG::Node::isDoubleConstant):
266 (JSC::DFG::Node::isNumberConstant):
267 (JSC::DFG::Node::isBooleanConstant):
268 (JSC::DFG::Node::predict):
269 * dfg/DFGPropagator.cpp:
270 (JSC::DFG::Propagator::Propagator):
271 (JSC::DFG::Propagator::propagateNodePredictions):
272 (JSC::DFG::Propagator::fixupNode):
273 (JSC::DFG::Propagator::isPredictedNumerical):
274 (JSC::DFG::Propagator::logicalNotIsPure):
275 * dfg/DFGSpeculativeJIT.cpp:
276 (JSC::DFG::SpeculativeJIT::compile):
277 * dfg/DFGSpeculativeJIT.h:
278 (JSC::DFG::SpeculativeJIT::shouldSpeculateInteger):
279 (JSC::DFG::SpeculativeJIT::shouldSpeculateDouble):
280 (JSC::DFG::SpeculativeJIT::shouldSpeculateNumber):
281 (JSC::DFG::SpeculativeJIT::shouldNotSpeculateInteger):
282 (JSC::DFG::SpeculativeJIT::shouldSpeculateFinalObject):
283 (JSC::DFG::SpeculativeJIT::shouldSpeculateArray):
284 (JSC::DFG::SpeculativeJIT::shouldSpeculateObject):
285 (JSC::DFG::SpeculativeJIT::shouldSpeculateCell):
287 (JSC::JIT::privateCompile):
289 2011-09-25 Filip Pizlo <fpizlo@apple.com>
291 DFG JIT Construct opcode takes a this argument even though it's
293 https://bugs.webkit.org/show_bug.cgi?id=68782
295 Reviewed by Oliver Hunt.
297 This is performance-neutral, mostly. It's a slight speed-up on
300 * dfg/DFGByteCodeParser.cpp:
301 (JSC::DFG::ByteCodeParser::addCall):
302 * dfg/DFGJITCodeGenerator.cpp:
303 (JSC::DFG::JITCodeGenerator::emitCall):
305 2011-09-25 Filip Pizlo <fpizlo@apple.com>
307 DFG tracking of the value in cachedResultRegister does not handle
309 https://bugs.webkit.org/show_bug.cgi?id=68781
311 Reviewed by Oliver Hunt.
313 This takes the simplest approach: it makes the old JIT dumber rather
314 than making the DFG JIT smarter. This is performance-neutral.
317 (JSC::JIT::canBeOptimized):
318 * jit/JITOpcodes.cpp:
319 (JSC::JIT::emit_op_mov):
321 2011-09-25 Adam Barth <abarth@webkit.org>
323 Remove PLATFORM(HAIKU) and associated code
324 https://bugs.webkit.org/show_bug.cgi?id=68774
326 Reviewed by Sam Weinig.
328 * JavaScriptCore.gyp/JavaScriptCore.gyp:
329 * JavaScriptCore.gypi:
330 * gyp/JavaScriptCore.gyp:
331 * heap/MachineStackMarker.cpp:
332 * wtf/PageAllocation.h:
334 * wtf/StackBounds.cpp:
335 * wtf/haiku: Removed.
336 * wtf/haiku/MainThreadHaiku.cpp: Removed.
337 * wtf/haiku/StringHaiku.cpp: Removed.
338 * wtf/text/WTFString.h:
340 2011-09-24 Adam Barth <abarth@webkit.org>
342 Always enable ENABLE(OFFLINE_WEB_APPLICATIONS)
343 https://bugs.webkit.org/show_bug.cgi?id=68767
345 Reviewed by Eric Seidel.
347 * Configurations/FeatureDefines.xcconfig:
349 2011-09-24 Filip Pizlo <fpizlo@apple.com>
351 JIT implementation of put_by_val increments m_length instead of setting
353 https://bugs.webkit.org/show_bug.cgi?id=68766
355 Reviewed by Geoffrey Garen.
357 * jit/JITPropertyAccess.cpp:
358 (JSC::JIT::emit_op_put_by_val):
360 2011-09-24 Geoffrey Garen <ggaren@apple.com>
364 * heap/ConservativeRoots.cpp: Our system of #includes, it is chaos.
366 2011-09-24 Filip Pizlo <fpizlo@apple.com>
368 The DFG should not attempt to guess types in the absence of value
370 https://bugs.webkit.org/show_bug.cgi?id=68677
372 Reviewed by Oliver Hunt.
374 This adds the ForceOSRExit node, which is ignored by the propagator
375 and virtual register allocator (and hence ensuring that liveness analysis
376 works correctly), but forces terminateSpeculativeExecution() in the
377 back-end. This appears to be a slight speed-up on benchmark averages,
378 with ~5% swings on individual benchmarks, in both directions. But it's
379 never a regression on any average, and appears to be a ~1% progression
380 in the SunSpider average.
382 This also adds a bit better debugging support in the old JIT and in DFG,
383 as this was necessary to debug the much more frequent OSR transitions
384 that occur with this change.
386 * dfg/DFGByteCodeParser.cpp:
387 (JSC::DFG::ByteCodeParser::addCall):
388 (JSC::DFG::ByteCodeParser::getStrongPrediction):
389 (JSC::DFG::ByteCodeParser::parseBlock):
390 * dfg/DFGJITCompiler.cpp:
391 (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
393 * dfg/DFGPropagator.cpp:
394 (JSC::DFG::Propagator::propagateNodePredictions):
395 * dfg/DFGSpeculativeJIT.cpp:
396 (JSC::DFG::SpeculativeJIT::compile):
398 (JSC::JIT::privateCompileMainPass):
399 (JSC::JIT::privateCompileSlowCases):
400 (JSC::JIT::privateCompile):
403 2011-09-24 Geoffrey Garen <ggaren@apple.com>
405 Some Windows build fixage.
407 * heap/MarkedBlock.cpp:
408 (JSC::MarkedBlock::sweep):
409 * heap/MarkedBlock.h:
410 (JSC::MarkedBlock::isLive): Show the compiler that all control paths
411 return a value. There, there, compiler. Everything's going to be OK.
414 (JSC::JSCell::setVPtr): Oops! Unrename this function.
416 2011-09-24 Geoffrey Garen <ggaren@apple.com>
418 Allocate new objects unmarked
419 https://bugs.webkit.org/show_bug.cgi?id=68764
421 Reviewed by Oliver Hunt.
423 This is a pre-requisite to using the mark bit to determine object age.
425 ~2% v8 speedup, mostly due to a 12% v8-splay speedup.
427 * heap/MarkedBlock.h:
428 (JSC::MarkedBlock::isLive):
429 (JSC::MarkedBlock::isLiveCell): These two functions are the reason for
430 this patch. They can now determine object liveness without relying on
431 newly allocated objects having their mark bits set. Each MarkedBlock
432 now has a state variable that tells us how to determine whether its
433 cells are live. (This new state variable supercedes the old one about
434 destructor state. The rest of this patch is just refactoring to support
435 the invariants of this new state variable without introducing a
436 performance regression.)
438 (JSC::MarkedBlock::didConsumeFreeList): New function for updating interal
439 state when a block becomes fully allocated.
441 (JSC::MarkedBlock::clearMarks): Folded a state change to 'Marked' into
442 this function because, logically, clearing all mark bits is the first
443 step in saying "mark bits now exactly reflect object liveness".
445 (JSC::MarkedBlock::markCountIsZero): Renamed from isEmpty() to clarify
446 that this function only tells you about the mark bits, so it's only
447 meaningful if you've put the mark bits into a meaningful state before
450 (JSC::MarkedBlock::forEachCell): Changed to use isLive() helper function
451 instead of testing mark bits, since mark bits are not always the right
452 way to find out if an object is live anymore. (New objects are live, but
455 * heap/MarkedBlock.cpp:
456 (JSC::MarkedBlock::recycle):
457 (JSC::MarkedBlock::MarkedBlock): Folded all initialization -- even
458 initialization when recycling an old block -- into the MarkedBlock
459 constructor, for simplicity.
461 (JSC::MarkedBlock::callDestructor): Inlined for speed. Always check for
462 a zapped cell before running a destructor, and always zap after
463 running a destructor. This does not seem to be expensive, and the
464 alternative just creates a too-confusing matrix of possible cell states
465 ((zombie undestructed cell + zombie destructed cell + zapped destructed
466 cell) * 5! permutations for progressing through block states = "Oh my!").
468 (JSC::MarkedBlock::specializedSweep):
469 (JSC::MarkedBlock::sweep): Maintained and expanded a pre-existing
470 optimization to use template specialization to constant fold lots of
471 branches and elide certain operations entirely during a sweep. Merged
472 four or five functions that were logically about sweeping into this one
473 function pair, so there's only one way to do things now, it's
474 automatically correct, and it's always fast.
476 (JSC::MarkedBlock::zapFreeList): Renamed this function to be more explicit
477 about exactly what it does, and to honor the new block state system.
479 * heap/AllocationSpace.cpp:
480 (JSC::AllocationSpace::allocateBlock): Updated for rename.
482 (JSC::AllocationSpace::freeBlocks): Updated for changed interface.
484 (JSC::TakeIfUnmarked::TakeIfUnmarked):
485 (JSC::TakeIfUnmarked::operator()):
486 (JSC::TakeIfUnmarked::returnValue): Just like isEmpty() above, renamed
487 to clarify that this functor only tests the mark bits, so it's only
488 valid if you've put the mark bits into a meaningful state before
491 (JSC::AllocationSpace::shrink): Updated for rename.
493 * heap/AllocationSpace.h:
494 (JSC::AllocationSpace::canonicalizeCellLivenessData): Renamed to be a
495 little more specific about what we're making canonical.
497 (JSC::AllocationSpace::forEachCell): Updated for rename.
499 (JSC::AllocationSpace::forEachBlock): No need to canonicalize cell
500 liveness data before iterating blocks -- clients that want iterated
501 blocks to have valid cell lieveness data should make this call for
502 themselves. (And not all clients want it.)
504 * heap/ConservativeRoots.cpp:
505 (JSC::ConservativeRoots::genericAddPointer): Updated for rename. Removed
509 (JSC::CountFunctor::ClearMarks::operator()): Removed call to notify...()
510 because clearMarks() now does that implicitly.
512 (JSC::Heap::destroy): Make sure to canonicalize before tear-down, since
513 tear-down tests cell liveness when running destructors.
515 (JSC::Heap::markRoots):
516 (JSC::Heap::collect): Moved weak reference harvesting out of markRoots()
517 and into collect, since it strictly depends on root marking, and does
518 not contribute to root marking.
520 (JSC::Heap::canonicalizeCellLivenessData): Renamed to be a little more
521 specific about what we're making canonical.
524 (JSC::Heap::forEachProtectedCell): No need to canonicalize cell liveness
525 data before iterating protected cells, since we know they're all live,
526 and don't need to test for it.
529 (JSC::::set): Can't make the same ASSERT we used to because we just don't
530 have the mark bits for it anymore. Perhaps we can bring this ASSERT back
531 in a weaker form in the future.
533 * heap/MarkedSpace.cpp:
534 (JSC::MarkedSpace::addBlock):
535 (JSC::MarkedSpace::removeBlock): Updated for interface change.
536 (JSC::MarkedSpace::canonicalizeCellLivenessData): Renamed to be a little more
537 specific about what we're making canonical.
539 * heap/MarkedSpace.h:
540 (JSC::MarkedSpace::allocate):
541 (JSC::MarkedSpace::SizeClass::SizeClass):
542 (JSC::MarkedSpace::SizeClass::resetAllocator):
543 (JSC::MarkedSpace::SizeClass::zapFreeList): Simplified this allocator
544 functionality a bit. We now track only one block -- "currentBlock" --
545 and rely on its internal state to know whether it has more cells to
549 (JSC::Weak::set): Can't make the same ASSERT we used to because we just don't
550 have the mark bits for it anymore. Perhaps we can bring this ASSERT back
551 in a weaker form in the future.
556 (JSC::JSCell::isZapped):
557 (JSC::isZapped): Made zapping a property of JSCell, for a little abstraction.
558 In the future, exactly how a JSCell zaps itself will change, as the
559 internal representation of JSCell changes.
561 2011-09-24 Filip Pizlo <fpizlo@apple.com>
563 DFG JIT should not eagerly initialize integer tags in the register file
564 https://bugs.webkit.org/show_bug.cgi?id=68763
566 Reviewed by Oliver Hunt.
568 * dfg/DFGJITCompiler.cpp:
569 (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
570 * dfg/DFGSpeculativeJIT.cpp:
571 (JSC::DFG::ValueRecovery::dump):
572 (JSC::DFG::OSRExit::OSRExit):
573 (JSC::DFG::SpeculativeJIT::compile):
574 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
575 * dfg/DFGSpeculativeJIT.h:
576 (JSC::DFG::ValueRecovery::alreadyInRegisterFileAsUnboxedInt32):
577 (JSC::DFG::OSRExit::operandForArgument):
578 (JSC::DFG::OSRExit::operandForIndex):
579 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
581 2011-09-23 Yuqiang Xian <yuqiang.xian@intel.com>
583 Add JSVALUE32_64 support to DFG JIT
584 https://bugs.webkit.org/show_bug.cgi?id=67460
586 Reviewed by Gavin Barraclough.
588 This is the initial attempt to add JSVALUE32_64 support to DFG JIT.
589 It's tested on IA32 Linux EFL port currently. It still cannot run
590 all the test cases and benchmarks so should be turned off now.
592 The major work includes:
593 1) dealing with JSVALUE32_64 data format in DFG JIT;
594 2) bindings between 64-bit JS Value and 32-bit registers;
595 3) handling of function calls. Currently for DFG operation function
596 calls we follow the X86 cdecl calling convention on Linux, and the
597 implementation is in a naive way by pushing the arguments into stack
600 The known issues include:
601 1) some code duplicates unnecessarily, especially in Speculative JIT
602 code generation, where most of the operations on SpeculataInteger /
603 SpeculateDouble should be identical to the JSVALUE64 code. Refactoring
604 is needed in the future;
605 2) lack of op_call and op_construct support, comparing to current
607 3) currently integer speculations assume to be StrictInt32;
608 4) lack of JSBoolean speculations;
609 5) boxing and unboxing doubles could be improved;
610 6) DFG X86 register description is different with the baseline JIT,
611 the timeoutCheckRegister is used for general purpose usage;
612 7) calls to runtime functions with primitive double parameters (e.g.
613 fmod) don't work. Support needs to be added to the assembler to
614 implement the mechanism of passing double parameters for X86 cdecl
617 And there should be many other hidden bugs which should be exposed and
618 resolved in later debugging process.
621 * assembler/MacroAssemblerX86.h:
622 (JSC::MacroAssemblerX86::loadDouble):
623 (JSC::MacroAssemblerX86::storeDouble):
624 * assembler/X86Assembler.h:
625 (JSC::X86Assembler::movsd_rm):
626 * bytecode/StructureStubInfo.h:
627 * dfg/DFGByteCodeParser.cpp:
628 (JSC::DFG::ByteCodeParser::parseBlock):
629 * dfg/DFGCapabilities.h:
630 (JSC::DFG::canCompileOpcode):
632 (JSC::DFG::FPRInfo::debugName):
634 (JSC::DFG::GPRInfo::toRegister):
635 (JSC::DFG::GPRInfo::toIndex):
636 (JSC::DFG::GPRInfo::debugName):
637 * dfg/DFGGenerationInfo.h:
638 (JSC::DFG::needDataFormatConversion):
639 (JSC::DFG::GenerationInfo::initJSValue):
640 (JSC::DFG::GenerationInfo::initDouble):
641 (JSC::DFG::GenerationInfo::gpr):
642 (JSC::DFG::GenerationInfo::tagGPR):
643 (JSC::DFG::GenerationInfo::payloadGPR):
644 (JSC::DFG::GenerationInfo::fpr):
645 (JSC::DFG::GenerationInfo::fillJSValue):
646 (JSC::DFG::GenerationInfo::fillCell):
647 (JSC::DFG::GenerationInfo::fillDouble):
648 * dfg/DFGJITCodeGenerator.cpp:
649 * dfg/DFGJITCodeGenerator.h:
650 (JSC::DFG::JITCodeGenerator::allocate):
651 (JSC::DFG::JITCodeGenerator::use):
652 (JSC::DFG::JITCodeGenerator::registersMatched):
653 (JSC::DFG::JITCodeGenerator::silentSpillGPR):
654 (JSC::DFG::JITCodeGenerator::silentFillGPR):
655 (JSC::DFG::JITCodeGenerator::silentFillFPR):
656 (JSC::DFG::JITCodeGenerator::silentSpillAllRegisters):
657 (JSC::DFG::JITCodeGenerator::silentFillAllRegisters):
658 (JSC::DFG::JITCodeGenerator::boxDouble):
659 (JSC::DFG::JITCodeGenerator::unboxDouble):
660 (JSC::DFG::JITCodeGenerator::spill):
661 (JSC::DFG::addressOfDoubleConstant):
662 (JSC::DFG::integerResult):
663 (JSC::DFG::jsValueResult):
664 (JSC::DFG::setupResults):
665 (JSC::DFG::callOperation):
666 (JSC::JSValueOperand::JSValueOperand):
667 (JSC::JSValueOperand::~JSValueOperand):
668 (JSC::JSValueOperand::isDouble):
669 (JSC::JSValueOperand::fill):
670 (JSC::JSValueOperand::tagGPR):
671 (JSC::JSValueOperand::payloadGPR):
672 (JSC::JSValueOperand::fpr):
673 (JSC::GPRTemporary::~GPRTemporary):
674 (JSC::GPRTemporary::gpr):
675 (JSC::GPRResult2::GPRResult2):
676 * dfg/DFGJITCodeGenerator32_64.cpp: Added.
677 (JSC::DFG::JITCodeGenerator::clearGenerationInfo):
678 (JSC::DFG::JITCodeGenerator::fillInteger):
679 (JSC::DFG::JITCodeGenerator::fillDouble):
680 (JSC::DFG::JITCodeGenerator::fillJSValue):
681 (JSC::DFG::JITCodeGenerator::fillStorage):
682 (JSC::DFG::JITCodeGenerator::useChildren):
683 (JSC::DFG::JITCodeGenerator::isStrictInt32):
684 (JSC::DFG::JITCodeGenerator::isKnownInteger):
685 (JSC::DFG::JITCodeGenerator::isKnownNumeric):
686 (JSC::DFG::JITCodeGenerator::isKnownCell):
687 (JSC::DFG::JITCodeGenerator::isKnownNotInteger):
688 (JSC::DFG::JITCodeGenerator::isKnownNotNumber):
689 (JSC::DFG::JITCodeGenerator::isKnownBoolean):
690 (JSC::DFG::JITCodeGenerator::nonSpeculativeValueToNumber):
691 (JSC::DFG::JITCodeGenerator::nonSpeculativeValueToInt32):
692 (JSC::DFG::JITCodeGenerator::nonSpeculativeUInt32ToNumber):
693 (JSC::DFG::JITCodeGenerator::nonSpeculativeKnownConstantArithOp):
694 (JSC::DFG::JITCodeGenerator::nonSpeculativeBasicArithOp):
695 (JSC::DFG::JITCodeGenerator::nonSpeculativeArithMod):
696 (JSC::DFG::JITCodeGenerator::nonSpeculativeCheckHasInstance):
697 (JSC::DFG::JITCodeGenerator::nonSpeculativeInstanceOf):
698 (JSC::DFG::JITCodeGenerator::cachedGetById):
699 (JSC::DFG::JITCodeGenerator::writeBarrier):
700 (JSC::DFG::JITCodeGenerator::cachedPutById):
701 (JSC::DFG::JITCodeGenerator::cachedGetMethod):
702 (JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeCompareNull):
703 (JSC::DFG::JITCodeGenerator::nonSpeculativePeepholeBranchNull):
704 (JSC::DFG::JITCodeGenerator::nonSpeculativeCompareNull):
705 (JSC::DFG::JITCodeGenerator::nonSpeculativePeepholeBranch):
706 (JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeCompare):
707 (JSC::DFG::JITCodeGenerator::nonSpeculativeCompare):
708 (JSC::DFG::JITCodeGenerator::nonSpeculativePeepholeStrictEq):
709 (JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeStrictEq):
710 (JSC::DFG::JITCodeGenerator::nonSpeculativeStrictEq):
711 (JSC::DFG::JITCodeGenerator::emitBranch):
712 (JSC::DFG::JITCodeGenerator::nonSpeculativeLogicalNot):
713 (JSC::DFG::JITCodeGenerator::emitCall):
714 (JSC::DFG::JITCodeGenerator::speculationCheck):
715 (JSC::DFG::dataFormatString):
716 (JSC::DFG::JITCodeGenerator::dump):
717 (JSC::DFG::JITCodeGenerator::checkConsistency):
718 (JSC::DFG::GPRTemporary::GPRTemporary):
719 (JSC::DFG::FPRTemporary::FPRTemporary):
720 * dfg/DFGJITCompiler.cpp:
721 * dfg/DFGJITCompiler.h:
722 (JSC::DFG::JITCompiler::tagForGlobalVar):
723 (JSC::DFG::JITCompiler::payloadForGlobalVar):
724 (JSC::DFG::JITCompiler::appendCallWithExceptionCheck):
725 (JSC::DFG::JITCompiler::addressOfDoubleConstant):
726 (JSC::DFG::JITCompiler::boxDouble):
727 (JSC::DFG::JITCompiler::unboxDouble):
728 (JSC::DFG::JITCompiler::addPropertyAccess):
729 (JSC::DFG::JITCompiler::PropertyAccessRecord::PropertyAccessRecord):
730 * dfg/DFGJITCompiler32_64.cpp: Added.
731 (JSC::DFG::JITCompiler::fillNumericToDouble):
732 (JSC::DFG::JITCompiler::fillInt32ToInteger):
733 (JSC::DFG::JITCompiler::fillToJS):
734 (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
735 (JSC::DFG::JITCompiler::linkOSRExits):
736 (JSC::DFG::JITCompiler::compileEntry):
737 (JSC::DFG::JITCompiler::compileBody):
738 (JSC::DFG::JITCompiler::link):
739 (JSC::DFG::JITCompiler::compile):
740 (JSC::DFG::JITCompiler::compileFunction):
741 (JSC::DFG::JITCompiler::jitAssertIsInt32):
742 (JSC::DFG::JITCompiler::jitAssertIsJSInt32):
743 (JSC::DFG::JITCompiler::jitAssertIsJSNumber):
744 (JSC::DFG::JITCompiler::jitAssertIsJSDouble):
745 (JSC::DFG::JITCompiler::jitAssertIsCell):
746 (JSC::DFG::JITCompiler::emitCount):
747 (JSC::DFG::JITCompiler::setSamplingFlag):
748 (JSC::DFG::JITCompiler::clearSamplingFlag):
749 * dfg/DFGJITCompilerInlineMethods.h: Added.
750 (JSC::DFG::JITCompiler::emitLoadTag):
751 (JSC::DFG::JITCompiler::emitLoadPayload):
752 (JSC::DFG::JITCompiler::emitLoad):
753 (JSC::DFG::JITCompiler::emitLoad2):
754 (JSC::DFG::JITCompiler::emitLoadDouble):
755 (JSC::DFG::JITCompiler::emitLoadInt32ToDouble):
756 (JSC::DFG::JITCompiler::emitStore):
757 (JSC::DFG::JITCompiler::emitStoreInt32):
758 (JSC::DFG::JITCompiler::emitStoreCell):
759 (JSC::DFG::JITCompiler::emitStoreBool):
760 (JSC::DFG::JITCompiler::emitStoreDouble):
762 * dfg/DFGOperations.cpp:
763 * dfg/DFGRepatch.cpp:
764 (JSC::DFG::generateProtoChainAccessStub):
765 (JSC::DFG::tryCacheGetByID):
766 (JSC::DFG::tryBuildGetByIDList):
767 (JSC::DFG::tryCachePutByID):
768 * dfg/DFGSpeculativeJIT.cpp:
769 * dfg/DFGSpeculativeJIT.h:
770 (JSC::DFG::ValueRecovery::inGPR):
771 (JSC::DFG::ValueRecovery::inPair):
772 (JSC::DFG::ValueRecovery::tagGPR):
773 (JSC::DFG::ValueRecovery::payloadGPR):
774 * dfg/DFGSpeculativeJIT32_64.cpp: Added.
775 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
776 (JSC::DFG::ValueSource::dump):
777 (JSC::DFG::ValueRecovery::dump):
778 (JSC::DFG::OSRExit::OSRExit):
779 (JSC::DFG::OSRExit::dump):
780 (JSC::DFG::SpeculativeJIT::fillSpeculateInt):
781 (JSC::DFG::SpeculativeJIT::fillSpeculateIntStrict):
782 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
783 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
784 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
785 (JSC::DFG::SpeculativeJIT::compilePeepHoleIntegerBranch):
786 (JSC::DFG::SpeculativeJIT::convertToDouble):
787 (JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch):
788 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
789 (JSC::DFG::SpeculativeJIT::compileObjectEquality):
790 (JSC::DFG::SpeculativeJIT::compare):
791 (JSC::DFG::SpeculativeJIT::compile):
792 (JSC::DFG::SpeculativeJIT::compileMovHint):
793 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
794 (JSC::DFG::SpeculativeJIT::initializeVariableTypes):
795 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
798 2011-09-23 Filip Pizlo <fpizlo@apple.com>
800 wtf/BitVector.h has a variety of bugs which manifest when the
801 vector grows beyond 63 bits
802 https://bugs.webkit.org/show_bug.cgi?id=68746
804 Reviewed by Oliver Hunt.
806 Out-of-lined slow path code in BitVector so that not every user
807 of CodeBlock ends up having to compile it. Fixed a variety of
808 index computation and size computation bugs.
810 I have not seen these issues manifest themselves, but they are
811 blocking a patch that uses BitVector more aggressively.
813 * GNUmakefile.list.am:
814 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
815 * JavaScriptCore.xcodeproj/project.pbxproj:
816 * wtf/BitVector.cpp: Added.
817 (BitVector::BitVector):
818 (BitVector::operator=):
820 (BitVector::clearAll):
821 (BitVector::OutOfLineBits::create):
822 (BitVector::OutOfLineBits::destroy):
823 (BitVector::resizeOutOfLine):
825 (WTF::BitVector::ensureSize):
826 (WTF::BitVector::get):
827 (WTF::BitVector::set):
828 (WTF::BitVector::clear):
829 (WTF::BitVector::byteCount):
830 (WTF::BitVector::OutOfLineBits::numWords):
831 (WTF::BitVector::OutOfLineBits::bits):
832 (WTF::BitVector::outOfLineBits):
833 * wtf/CMakeLists.txt:
836 2011-09-23 Adam Klein <adamk@chromium.org>
838 Add ENABLE_MUTATION_OBSERVERS feature flag
839 https://bugs.webkit.org/show_bug.cgi?id=68732
841 Reviewed by Ojan Vafai.
843 This flag will guard an implementation of the "Mutation Observers" proposed in
844 http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/1622.html
846 * Configurations/FeatureDefines.xcconfig:
848 2011-09-23 Mark Hahnenberg <mhahnenberg@apple.com>
850 De-virtualize JSCell::getJSNumber
851 https://bugs.webkit.org/show_bug.cgi?id=68651
853 Reviewed by Oliver Hunt.
855 Added a new JSType to check whether or not something is a
856 NumberObject (which includes NumberPrototype) in TypeInfo::isNumberObject because there's not
857 currently a better way to determine whether something is indeed a NumberObject.
858 Also de-virtualized JSCell::getJSNumber, having it check the TypeInfo
859 for whether the object is a NumberObject or not. This patch is part of
860 the larger process of de-virtualizing JSCell.
862 * JavaScriptCore.exp:
863 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
864 * runtime/JSCell.cpp:
865 (JSC::JSCell::getJSNumber):
867 (JSC::JSValue::getJSNumber):
869 * runtime/JSTypeInfo.h:
870 (JSC::TypeInfo::isNumberObject):
872 * runtime/NumberObject.cpp:
873 (JSC::NumberObject::getJSNumber):
874 * runtime/NumberObject.h:
875 (JSC::NumberObject::createStructure):
876 * runtime/NumberPrototype.h:
877 (JSC::NumberPrototype::createStructure):
879 2011-09-23 Filip Pizlo <fpizlo@apple.com>
881 Resolve opcodes should have value profiling.
882 https://bugs.webkit.org/show_bug.cgi?id=68723
884 Reviewed by Oliver Hunt.
886 This adds value profiling to all forms of op_resolve in the
887 old JIT, and patches that information into the DFG along with
888 performing the appropriate type propagation.
890 * dfg/DFGByteCodeParser.cpp:
891 (JSC::DFG::ByteCodeParser::parseBlock):
893 (JSC::DFG::Graph::predict):
895 (JSC::DFG::Node::hasIdentifier):
896 (JSC::DFG::Node::resolveGlobalDataIndex):
897 (JSC::DFG::Node::hasPrediction):
898 * dfg/DFGPropagator.cpp:
899 (JSC::DFG::Propagator::propagateNodePredictions):
900 * dfg/DFGSpeculativeJIT.cpp:
901 (JSC::DFG::SpeculativeJIT::compile):
902 * jit/JITOpcodes.cpp:
903 (JSC::JIT::emit_op_resolve):
904 (JSC::JIT::emit_op_resolve_base):
905 (JSC::JIT::emit_op_resolve_skip):
906 (JSC::JIT::emit_op_resolve_global):
907 (JSC::JIT::emitSlow_op_resolve_global):
908 (JSC::JIT::emit_op_resolve_with_base):
909 (JSC::JIT::emit_op_resolve_with_this):
910 (JSC::JIT::emitSlow_op_resolve_global_dynamic):
912 (JSC::JITStubCall::callWithValueProfiling):
914 2011-09-23 Oliver Hunt <oliver@apple.com>
918 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
920 2011-09-23 Gavin Barraclough <barraclough@apple.com>
922 Strict mode does not work in non-trivial nested functions.
923 https://bugs.webkit.org/show_bug.cgi?id=68740
925 Reviewed by Oliver Hunt.
927 Function-info caching does not preserve all state that it should.
929 * parser/JSParser.cpp:
930 (JSC::JSParser::Scope::saveFunctionInfo):
931 (JSC::JSParser::Scope::restoreFunctionInfo):
932 (JSC::JSParser::parseFunctionInfo):
933 * parser/SourceProviderCacheItem.h:
935 2011-09-23 Filip Pizlo <fpizlo@apple.com>
937 ValueToDouble handling in prediction propagation should be ASSERT_NOT_REACHED
938 https://bugs.webkit.org/show_bug.cgi?id=68724
940 Reviewed by Oliver Hunt.
942 * dfg/DFGPropagator.cpp:
943 (JSC::DFG::Propagator::propagateNodePredictions):
945 2011-09-23 Oliver Hunt <oliver@apple.com>
949 * JavaScriptCore.xcodeproj/project.pbxproj:
951 2011-09-23 Filip Pizlo <fpizlo@apple.com>
953 DFG implementation of PutScopedVar corrupts register allocation
954 https://bugs.webkit.org/show_bug.cgi?id=68735
956 Reviewed by Oliver Hunt.
958 * dfg/DFGSpeculativeJIT.cpp:
959 (JSC::DFG::SpeculativeJIT::compile):
961 2011-09-23 Oliver Hunt <oliver@apple.com>
963 Make write barriers actually do something when enabled
964 https://bugs.webkit.org/show_bug.cgi?id=68717
966 Reviewed by Geoffrey Garen.
968 Add a basic card marking style write barrier to JSC (currently
969 turned off). This requires two scratch registers in the JIT
970 so there was some register re-arranging to satisfy that requirement.
971 Happily this produced a minor perf bump in sunspider (~0.5%).
973 Turning the barriers on causes an overall regression of around 1.5%
975 * JavaScriptCore.exp:
976 * JavaScriptCore.xcodeproj/project.pbxproj:
977 * assembler/MacroAssemblerX86Common.h:
978 (JSC::MacroAssemblerX86Common::store8):
979 * assembler/X86Assembler.h:
980 (JSC::X86Assembler::movb_i8m):
981 * dfg/DFGJITCodeGenerator.cpp:
982 (JSC::DFG::JITCodeGenerator::isKnownNotCell):
983 (JSC::DFG::JITCodeGenerator::writeBarrier):
984 (JSC::DFG::JITCodeGenerator::markCellCard):
985 (JSC::DFG::JITCodeGenerator::cachedPutById):
986 * dfg/DFGJITCodeGenerator.h:
987 * dfg/DFGRepatch.cpp:
988 (JSC::DFG::tryCachePutByID):
989 * dfg/DFGSpeculativeJIT.cpp:
990 (JSC::DFG::SpeculativeJIT::compile):
991 * heap/CardSet.h: Added.
992 (JSC::CardSet::CardSet):
993 (JSC::::cardForAtom):
994 (JSC::::cardMarkedForAtom):
995 (JSC::::markCardForAtom):
998 (JSC::Heap::addressOfCardFor):
999 (JSC::Heap::writeBarrierFastCase):
1000 * heap/MarkedBlock.h:
1001 (JSC::MarkedBlock::setDirtyObject):
1002 (JSC::MarkedBlock::addressOfCardFor):
1003 (JSC::MarkedBlock::offsetOfCards):
1005 * jit/JITPropertyAccess.cpp:
1006 (JSC::JIT::emit_op_put_by_val):
1007 (JSC::JIT::emit_op_put_by_id):
1008 (JSC::JIT::privateCompilePutByIdTransition):
1009 (JSC::JIT::emit_op_put_scoped_var):
1010 (JSC::JIT::emit_op_put_global_var):
1011 (JSC::JIT::emitWriteBarrier):
1012 * jit/JITPropertyAccess32_64.cpp:
1013 (JSC::JIT::emit_op_put_by_val):
1014 (JSC::JIT::emit_op_put_by_id):
1015 (JSC::JIT::emitSlow_op_put_by_id):
1016 (JSC::JIT::privateCompilePutByIdTransition):
1017 (JSC::JIT::emit_op_put_scoped_var):
1018 (JSC::JIT::emit_op_put_global_var):
1020 2011-09-23 Thouraya ANDOLSI <thouraya.andolsi@st.com>
1022 https://bugs.webkit.org/show_bug.cgi?id=68077
1023 SH4 assemblers doesn't refer to executable memory handle.
1025 Reviewed by Gavin Barraclough.
1027 * assembler/MacroAssemblerSH4.h:
1028 (JSC::MacroAssemblerSH4::branch8):
1029 * assembler/SH4Assembler.h:
1030 (JSC::SH4Assembler::executableCopy):
1032 2011-09-23 Oliver Hunt <oliver@apple.com>
1034 PutScopedVar nodes should report that it has a var number
1035 https://bugs.webkit.org/show_bug.cgi?id=68721
1037 Reviewed by Anders Carlsson.
1039 Another assertion fix.
1042 (JSC::DFG::Node::hasVarNumber):
1044 2011-09-23 Oliver Hunt <oliver@apple.com>
1046 Add a bunch of unhandled node types to the propagator
1047 https://bugs.webkit.org/show_bug.cgi?id=68716
1049 Reviewed by Darin Adler.
1051 Remove the ASSERT_NOT_REACHED() default for debug builds in the
1052 prediction propagator, this way unhandled nodes will just cause
1053 compile time failures rather than failing at some point in the
1056 * dfg/DFGPropagator.cpp:
1057 (JSC::DFG::Propagator::propagateNodePredictions):
1059 2011-09-23 Mark Hahnenberg <mhahnenberg@apple.com>
1061 Add static version of JSCell::visitChildren
1062 https://bugs.webkit.org/show_bug.cgi?id=68404
1064 Reviewed by Darin Adler.
1066 In this patch we just extract the bodies of the virtual visitChildren methods
1067 throughout the JSCell inheritance hierarchy out into static methods, which are
1068 now called from the virtual methods. This is an intermediate step in trying to
1069 move the virtual-ness of visitChildren into our own custom vtable stored in
1070 ClassInfo. We need to convert the methods to static methods in order to be
1071 able to more easily store and refer to them in our custom vtable since normal
1072 member methods store some implicit information in their types, making it
1073 impossible to store them generically in ClassInfo.
1075 * API/JSCallbackObject.h:
1076 (JSC::JSCallbackObject::visitChildrenVirtual):
1077 (JSC::JSCallbackObject::visitChildren):
1078 * JavaScriptCore.exp:
1079 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1080 * debugger/DebuggerActivation.cpp:
1081 (JSC::DebuggerActivation::visitChildrenVirtual):
1082 (JSC::DebuggerActivation::visitChildren):
1083 * debugger/DebuggerActivation.h:
1084 * heap/MarkStack.cpp:
1085 (JSC::SlotVisitor::visitChildren):
1086 (JSC::SlotVisitor::drain):
1087 * runtime/Arguments.cpp:
1088 (JSC::Arguments::visitChildrenVirtual):
1089 (JSC::Arguments::visitChildren):
1090 * runtime/Arguments.h:
1091 * runtime/Executable.cpp:
1092 (JSC::EvalExecutable::visitChildrenVirtual):
1093 (JSC::EvalExecutable::visitChildren):
1094 (JSC::ProgramExecutable::visitChildrenVirtual):
1095 (JSC::ProgramExecutable::visitChildren):
1096 (JSC::FunctionExecutable::visitChildrenVirtual):
1097 (JSC::FunctionExecutable::visitChildren):
1098 * runtime/Executable.h:
1099 * runtime/GetterSetter.cpp:
1100 (JSC::GetterSetter::visitChildrenVirtual):
1101 (JSC::GetterSetter::visitChildren):
1102 * runtime/GetterSetter.h:
1103 * runtime/JSActivation.cpp:
1104 (JSC::JSActivation::visitChildrenVirtual):
1105 (JSC::JSActivation::visitChildren):
1106 * runtime/JSActivation.h:
1107 * runtime/JSArray.cpp:
1108 (JSC::JSArray::visitChildrenVirtual):
1109 (JSC::JSArray::visitChildren):
1110 * runtime/JSArray.h:
1111 * runtime/JSBoundFunction.cpp:
1112 (JSC::JSBoundFunction::visitChildrenVirtual):
1113 (JSC::JSBoundFunction::visitChildren):
1114 * runtime/JSBoundFunction.h:
1116 (JSC::JSCell::visitChildrenVirtual):
1117 (JSC::JSCell::visitChildren):
1118 * runtime/JSFunction.cpp:
1119 (JSC::JSFunction::visitChildrenVirtual):
1120 (JSC::JSFunction::visitChildren):
1121 * runtime/JSFunction.h:
1122 * runtime/JSGlobalObject.cpp:
1123 (JSC::JSGlobalObject::visitChildrenVirtual):
1124 (JSC::JSGlobalObject::visitChildren):
1125 * runtime/JSGlobalObject.h:
1126 * runtime/JSObject.cpp:
1127 (JSC::JSObject::visitChildrenVirtual):
1128 (JSC::JSObject::visitChildren):
1129 * runtime/JSObject.h:
1130 (JSC::JSObject::visitChildrenDirect):
1131 * runtime/JSPropertyNameIterator.cpp:
1132 (JSC::JSPropertyNameIterator::visitChildrenVirtual):
1133 (JSC::JSPropertyNameIterator::visitChildren):
1134 * runtime/JSPropertyNameIterator.h:
1135 * runtime/JSStaticScopeObject.cpp:
1136 (JSC::JSStaticScopeObject::visitChildrenVirtual):
1137 (JSC::JSStaticScopeObject::visitChildren):
1138 * runtime/JSStaticScopeObject.h:
1139 * runtime/JSWrapperObject.cpp:
1140 (JSC::JSWrapperObject::visitChildrenVirtual):
1141 (JSC::JSWrapperObject::visitChildren):
1142 * runtime/JSWrapperObject.h:
1143 * runtime/NativeErrorConstructor.cpp:
1144 (JSC::NativeErrorConstructor::visitChildrenVirtual):
1145 (JSC::NativeErrorConstructor::visitChildren):
1146 * runtime/NativeErrorConstructor.h:
1147 * runtime/RegExpObject.cpp:
1148 (JSC::RegExpObject::visitChildrenVirtual):
1149 (JSC::RegExpObject::visitChildren):
1150 * runtime/RegExpObject.h:
1151 * runtime/ScopeChain.cpp:
1152 (JSC::ScopeChainNode::visitChildrenVirtual):
1153 (JSC::ScopeChainNode::visitChildren):
1154 * runtime/ScopeChain.h:
1155 * runtime/Structure.cpp:
1156 (JSC::Structure::visitChildrenVirtual):
1157 (JSC::Structure::visitChildren):
1158 * runtime/Structure.h:
1159 * runtime/StructureChain.cpp:
1160 (JSC::StructureChain::visitChildrenVirtual):
1161 (JSC::StructureChain::visitChildren):
1162 * runtime/StructureChain.h:
1164 2011-09-23 Oliver Hunt <oliver@apple.com>
1166 Node propagation doesn't handle PutScopedVar
1167 https://bugs.webkit.org/show_bug.cgi?id=68713
1169 Reviewed by Sam Weinig.
1171 This was causing assertion failures.
1173 * dfg/DFGPropagator.cpp:
1174 (JSC::DFG::Propagator::propagateNodePredictions):
1176 2011-09-23 Anders Carlsson <andersca@apple.com>
1178 Make sure to define OVERRIDE and FINAL for older builds of clang.
1182 2011-09-23 Gavin Barraclough <barraclough@apple.com>
1184 Implement op_resolve_global in the DFG JIT
1185 https://bugs.webkit.org/show_bug.cgi?id=68704
1187 Reviewed by Oliver Hunt.
1189 This is performance neutral, but increases coverage.
1191 * dfg/DFGByteCodeParser.cpp:
1192 (JSC::DFG::ByteCodeParser::ByteCodeParser):
1193 (JSC::DFG::ByteCodeParser::parseBlock):
1195 (JSC::DFG::Node::hasIdentifier):
1196 (JSC::DFG::Node::resolveInfoIndex):
1197 * dfg/DFGOperations.cpp:
1198 * dfg/DFGOperations.h:
1199 * dfg/DFGSpeculativeJIT.cpp:
1200 (JSC::DFG::SpeculativeJIT::compile):
1202 2011-09-23 Mark Rowe <mrowe@apple.com>
1204 Define BUILDING_ON_LION / TARGETING_LION when appropriate in Platform.h.
1208 2011-09-22 Anders Carlsson <andersca@apple.com>
1210 We should add support for OVERRIDE and FINAL annotations
1211 https://bugs.webkit.org/show_bug.cgi?id=68654
1213 Reviewed by David Hyatt.
1215 Add OVERRIDE and FINAL macros for compilers that support them.
1219 2011-09-22 Filip Pizlo <fpizlo@apple.com>
1221 GetScopedVar should have value profiling
1222 https://bugs.webkit.org/show_bug.cgi?id=68676
1224 Reviewed by Oliver Hunt.
1226 Added GetScopedVar value profiling and predictin propagation.
1227 Added GetScopeChain to CSE.
1229 * dfg/DFGByteCodeParser.cpp:
1230 (JSC::DFG::ByteCodeParser::parseBlock):
1232 (JSC::DFG::Graph::predict):
1234 (JSC::DFG::Node::hasPrediction):
1235 * dfg/DFGPropagator.cpp:
1236 (JSC::DFG::Propagator::propagateNodePredictions):
1237 (JSC::DFG::Propagator::getScopeChainLoadElimination):
1238 (JSC::DFG::Propagator::performNodeCSE):
1239 * jit/JITPropertyAccess.cpp:
1240 (JSC::JIT::emit_op_get_scoped_var):
1242 2011-09-22 Filip Pizlo <fpizlo@apple.com>
1244 PPC build fix, part 3.
1246 * runtime/Executable.cpp:
1247 (JSC::FunctionExecutable::compileForConstructInternal):
1249 2011-09-22 Filip Pizlo <fpizlo@apple.com>
1251 Another PPC build fix.
1253 * runtime/Executable.cpp:
1254 * runtime/Executable.h:
1256 2011-09-22 Dean Jackson <dino@apple.com>
1258 Add ENABLE_CSS_FILTERS
1259 https://bugs.webkit.org/show_bug.cgi?id=68652
1261 Reviewed by Simon Fraser.
1263 * Configurations/FeatureDefines.xcconfig:
1265 2011-09-22 Gavin Barraclough <barraclough@apple.com>
1267 Incorrect this value passed to callbacks.
1268 https://bugs.webkit.org/show_bug.cgi?id=68668
1270 Reviewed by Oliver Hunt.
1272 From Array/String prototype function. Should be undefined, but
1273 global object is passed instead (this is visible for strict callbacks).
1275 * runtime/ArrayPrototype.cpp:
1276 (JSC::arrayProtoFuncSort):
1277 (JSC::arrayProtoFuncFilter):
1278 (JSC::arrayProtoFuncMap):
1279 (JSC::arrayProtoFuncEvery):
1280 (JSC::arrayProtoFuncForEach):
1281 (JSC::arrayProtoFuncSome):
1282 * runtime/JSArray.cpp:
1283 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
1284 (JSC::JSArray::sort):
1285 * runtime/StringPrototype.cpp:
1286 (JSC::stringProtoFuncReplace):
1288 2011-09-22 Gavin Barraclough <barraclough@apple.com>
1290 Function.prototype.bind.length shoudl be 1.
1292 Rubber stamped by Olier Hunt.
1294 * runtime/FunctionPrototype.cpp:
1295 (JSC::FunctionPrototype::addFunctionProperties):
1297 2011-09-22 Filip Pizlo <fpizlo@apple.com>
1301 * bytecode/CodeBlock.h:
1303 2011-09-22 Gavin Barraclough <barraclough@apple.com>
1305 Windows build fix pt. 2
1307 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1309 2011-09-22 Gavin Barraclough <barraclough@apple.com>
1311 Windows build fix pt. 1
1313 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1315 2011-09-21 Filip Pizlo <fpizlo@apple.com>
1317 DFG JIT does not support to_primitive or strcat
1318 https://bugs.webkit.org/show_bug.cgi?id=68582
1320 Reviewed by Darin Adler.
1322 This adds functional support for to_primitive and strcat. It focuses
1323 on minimizing the amount of code emitted on to_primitive (if we know
1324 that it is a primitive or can speculate cheaply, then we omit the
1325 slow path) and on keeping the implementation of strcat simple while
1326 leveraging whatever optimizations we have already. In particular,
1327 unlike the Call and Construct nodes which require extending the size
1328 of the DFG's callee registers, StrCat takes advantage of the fact
1329 that no JS code can run while StrCat is in progress and uses a
1330 scratch buffer, rather than the register file, to store the list of
1331 values to concatenate. This was done mainly to keep the code simple,
1332 but there are probably other benefits to keeping call frame sizes
1333 down. Essentially, this patch ensures that the presence of an
1334 op_strcat does not mess up any other optimizations we might do while
1335 ensuring that if you do execute it, it'll work about as well as you'd
1338 When combined with the previous patch for integer division, this is a
1339 14% speed-up on Kraken. Without it, it would have been a 2% loss.
1341 * assembler/AbstractMacroAssembler.h:
1342 (JSC::AbstractMacroAssembler::TrustedImmPtr::TrustedImmPtr):
1343 * dfg/DFGByteCodeParser.cpp:
1344 (JSC::DFG::ByteCodeParser::parseBlock):
1345 * dfg/DFGCapabilities.h:
1346 (JSC::DFG::canCompileOpcode):
1347 * dfg/DFGJITCodeGenerator.h:
1348 (JSC::DFG::JITCodeGenerator::callOperation):
1349 * dfg/DFGJITCompiler.cpp:
1350 (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
1352 * dfg/DFGOperations.cpp:
1353 * dfg/DFGOperations.h:
1354 * dfg/DFGPropagator.cpp:
1355 (JSC::DFG::Propagator::propagateNodePredictions):
1356 (JSC::DFG::Propagator::performNodeCSE):
1357 * dfg/DFGSpeculativeJIT.cpp:
1358 (JSC::DFG::SpeculativeJIT::compile):
1359 * runtime/JSGlobalData.cpp:
1360 (JSC::JSGlobalData::JSGlobalData):
1361 (JSC::JSGlobalData::~JSGlobalData):
1362 * runtime/JSGlobalData.h:
1363 (JSC::JSGlobalData::scratchBufferForSize):
1365 2011-09-22 Filip Pizlo <fpizlo@apple.com>
1367 DFG JIT should support integer division
1368 https://bugs.webkit.org/show_bug.cgi?id=68597
1370 Reviewed by Darin Adler.
1372 This adds support for ArithDiv speculating integer, and speculating
1373 that the result is integer (i.e. remainder = 0).
1375 This is a 4% win on Kraken and a 1% loss on V8.
1377 * bytecode/CodeBlock.h:
1378 * dfg/DFGByteCodeParser.cpp:
1379 (JSC::DFG::ByteCodeParser::makeDivSafe):
1380 (JSC::DFG::ByteCodeParser::parseBlock):
1382 (JSC::DFG::Node::hasArithNodeFlags):
1383 * dfg/DFGPropagator.cpp:
1384 (JSC::DFG::Propagator::propagateArithNodeFlags):
1385 (JSC::DFG::Propagator::propagateNodePredictions):
1386 (JSC::DFG::Propagator::fixupNode):
1387 * dfg/DFGSpeculativeJIT.cpp:
1388 (JSC::DFG::SpeculativeJIT::compile):
1389 * jit/JITArithmetic.cpp:
1390 (JSC::JIT::emit_op_div):
1392 2011-09-22 Oliver Hunt <oliver@apple.com>
1394 Implement put_scoped_var in the DFG jit
1395 https://bugs.webkit.org/show_bug.cgi?id=68653
1397 Reviewed by Gavin Barraclough.
1399 Naive implementation of put_scoped_var. Same story as the
1400 get_scoped_var implementation, although I've hoisted scope
1401 object acquisition into a separate dfg node. Ideally in the
1402 future we would reuse the resolved scope chain object, but
1405 * dfg/DFGByteCodeParser.cpp:
1406 (JSC::DFG::ByteCodeParser::parseBlock):
1407 * dfg/DFGCapabilities.h:
1408 (JSC::DFG::canCompileOpcode):
1410 (JSC::DFG::Node::hasScopeChainDepth):
1411 (JSC::DFG::Node::scopeChainDepth):
1412 * dfg/DFGPropagator.cpp:
1413 (JSC::DFG::Propagator::propagateNodePredictions):
1414 * dfg/DFGSpeculativeJIT.cpp:
1415 (JSC::DFG::SpeculativeJIT::compile):
1417 2011-09-22 Gavin Barraclough <barraclough@apple.com>
1419 Implement Function.prototype.bind
1420 https://bugs.webkit.org/show_bug.cgi?id=26382
1422 Reviewed by Sam Weinig.
1424 This patch provides a basic functional implementation
1425 for Function.bind. It should (hopefully!) be fully
1426 functionally correct, and the bound functions can be
1427 called to quickly (since they are a subclass of
1428 JSFunction, not InternalFunction), but we'll probably
1429 want to follow up with some optimization work to keep
1430 bound calls in JIT code.
1432 * JavaScriptCore.JSVALUE32_64only.exp:
1433 * JavaScriptCore.JSVALUE64only.exp:
1434 * JavaScriptCore.exp:
1435 * JavaScriptCore.xcodeproj/project.pbxproj:
1437 (JSC::JITThunks::hostFunctionStub):
1440 (GlobalObject::addFunction):
1441 * runtime/CommonIdentifiers.h:
1442 * runtime/ConstructData.h:
1443 * runtime/Executable.h:
1444 (JSC::NativeExecutable::NativeExecutable):
1445 * runtime/FunctionPrototype.cpp:
1446 (JSC::FunctionPrototype::addFunctionProperties):
1447 (JSC::functionProtoFuncBind):
1448 * runtime/FunctionPrototype.h:
1449 * runtime/JSBoundFunction.cpp: Added.
1450 (JSC::boundFunctionCall):
1451 (JSC::boundFunctionConstruct):
1452 (JSC::JSBoundFunction::create):
1453 (JSC::JSBoundFunction::hasInstance):
1454 (JSC::JSBoundFunction::getOwnPropertySlot):
1455 (JSC::JSBoundFunction::getOwnPropertyDescriptor):
1456 (JSC::JSBoundFunction::JSBoundFunction):
1457 (JSC::JSBoundFunction::finishCreation):
1458 * runtime/JSBoundFunction.h: Added.
1459 (JSC::JSBoundFunction::targetFunction):
1460 (JSC::JSBoundFunction::boundThis):
1461 (JSC::JSBoundFunction::boundArgs):
1462 (JSC::JSBoundFunction::createStructure):
1463 * runtime/JSFunction.cpp:
1464 (JSC::JSFunction::create):
1465 (JSC::JSFunction::finishCreation):
1466 (JSC::createDescriptorForThrowingProperty):
1467 (JSC::JSFunction::getOwnPropertySlot):
1468 * runtime/JSFunction.h:
1469 * runtime/JSGlobalData.cpp:
1470 (JSC::JSGlobalData::getHostFunction):
1471 * runtime/JSGlobalData.h:
1472 * runtime/JSGlobalObject.cpp:
1473 (JSC::JSGlobalObject::reset):
1474 (JSC::JSGlobalObject::visitChildren):
1475 * runtime/JSGlobalObject.h:
1476 (JSC::JSGlobalObject::boundFunctionStructure):
1477 * runtime/Lookup.cpp:
1478 (JSC::setUpStaticFunctionSlot):
1480 2011-09-22 Oliver Hunt <oliver@apple.com>
1482 Implement get_scoped_var in the DFG
1483 https://bugs.webkit.org/show_bug.cgi?id=68640
1485 Reviewed by Gavin Barraclough.
1487 Naive implementation of get_scoped_var in the DFG. Essentially this
1488 is the bare minimum required to get correct behaviour, so there's no
1489 load/store coalescing or type profiling involved, even though these
1490 would be wins. No impact on SunSpider or V8.
1492 * dfg/DFGByteCodeParser.cpp:
1493 (JSC::DFG::ByteCodeParser::parseBlock):
1494 * dfg/DFGCapabilities.h:
1495 (JSC::DFG::canCompileOpcode):
1497 (JSC::DFG::Node::hasVarNumber):
1498 (JSC::DFG::Node::hasScopeChainDepth):
1499 (JSC::DFG::Node::scopeChainDepth):
1500 * dfg/DFGPropagator.cpp:
1501 (JSC::DFG::Propagator::propagateNodePredictions):
1502 * dfg/DFGSpeculativeJIT.cpp:
1503 (JSC::DFG::SpeculativeJIT::compile):
1505 2011-09-22 Adam Roben <aroben@apple.com>
1507 Remove FindSafari from all our .sln files
1509 It isn't used anymore, so there's no point in building it.
1511 Part of <http://webkit.org/b/68628> Remove FindSafari
1513 Reviewed by Steve Falkenburg.
1515 * JavaScriptCore.vcproj/JavaScriptCore.sln:
1517 2011-09-22 Filip Pizlo <fpizlo@apple.com>
1519 32-bit call code clobbers the function cell tag
1520 https://bugs.webkit.org/show_bug.cgi?id=68606
1522 Reviewed by Csaba Osztrogonác.
1524 This is a minimalistic fix: it simply emits code to restore the
1525 cell tag on the slow path, if we know that we failed due to
1528 * jit/JITCall32_64.cpp:
1529 (JSC::JIT::compileOpCallVarargsSlowCase):
1530 (JSC::JIT::compileOpCallSlowCase):
1532 2011-09-21 Gavin Barraclough <barraclough@apple.com>
1534 Add missing addPtr->add32 mapping for X86.
1536 Rubber stamped by Sam Weinig.
1538 * assembler/MacroAssembler.h:
1539 (JSC::MacroAssembler::addPtr):
1541 2011-09-21 Gavin Barraclough <barraclough@apple.com>
1543 Add missing addDouble for AbsoluteAddress to X86
1545 Rubber stamped by Geoff Garen.
1547 * assembler/MacroAssemblerX86.h:
1548 (JSC::MacroAssemblerX86::addDouble):
1549 * assembler/X86Assembler.h:
1550 (JSC::X86Assembler::addsd_mr):
1551 (JSC::X86Assembler::cvtsi2sd_rr):
1552 (JSC::X86Assembler::cvtsi2sd_mr):
1554 2011-09-21 Gavin Barraclough <barraclough@apple.com>
1556 Build fix following fix for bug #68586.
1559 * jit/JITInlineMethods.h:
1561 2011-09-21 Filip Pizlo <fpizlo@apple.com>
1563 DFG JIT should be able to compile op_throw
1564 https://bugs.webkit.org/show_bug.cgi?id=68571
1566 Reviewed by Geoffrey Garen.
1568 This compiles op_throw in the simplest way possible: it's an OSR
1569 point back to the old JIT. This is a good step towards increasing
1570 coverage, particularly on Kraken, but it's neutral because the
1571 same functions that do throw also use some other unsupported
1574 * dfg/DFGByteCodeParser.cpp:
1575 (JSC::DFG::ByteCodeParser::parseBlock):
1576 * dfg/DFGCapabilities.h:
1577 (JSC::DFG::canCompileOpcode):
1579 * dfg/DFGPropagator.cpp:
1580 (JSC::DFG::Propagator::propagateNodePredictions):
1581 * dfg/DFGSpeculativeJIT.cpp:
1582 (JSC::DFG::SpeculativeJIT::compile):
1584 2011-09-21 Filip Pizlo <fpizlo@apple.com>
1586 DFG should support continuous optimization
1587 https://bugs.webkit.org/show_bug.cgi?id=68329
1589 Reviewed by Geoffrey Garen.
1591 This adds the ability to reoptimize a code block if speculation
1592 failures happen frequently. 6% speed-up on Kraken, 1% slow-down
1593 on V8, neutral on SunSpider.
1596 * GNUmakefile.list.am:
1597 * JavaScriptCore.pro:
1598 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1599 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1600 * JavaScriptCore.xcodeproj/project.pbxproj:
1601 * bytecode/CodeBlock.cpp:
1602 (JSC::CodeBlock::CodeBlock):
1603 (JSC::ProgramCodeBlock::jettison):
1604 (JSC::EvalCodeBlock::jettison):
1605 (JSC::FunctionCodeBlock::jettison):
1606 (JSC::CodeBlock::shouldOptimizeNow):
1607 (JSC::CodeBlock::dumpValueProfiles):
1608 * bytecode/CodeBlock.h:
1609 * dfg/DFGByteCodeParser.cpp:
1610 (JSC::DFG::ByteCodeParser::getStrongPrediction):
1611 * dfg/DFGJITCompiler.cpp:
1612 (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
1613 (JSC::DFG::JITCompiler::compileEntry):
1614 (JSC::DFG::JITCompiler::compileBody):
1615 * dfg/DFGJITCompiler.h:
1616 (JSC::DFG::JITCompiler::noticeOSREntry):
1617 * dfg/DFGOSREntry.cpp:
1618 (JSC::DFG::prepareOSREntry):
1619 * dfg/DFGOSREntry.h:
1620 (JSC::DFG::getOSREntryDataBytecodeIndex):
1621 * dfg/DFGSpeculativeJIT.cpp:
1622 (JSC::DFG::SpeculativeJIT::compile):
1623 * heap/ConservativeRoots.cpp:
1624 (JSC::ConservativeRoots::ConservativeRoots):
1625 (JSC::ConservativeRoots::~ConservativeRoots):
1626 (JSC::DummyMarkHook::mark):
1627 (JSC::ConservativeRoots::genericAddPointer):
1628 (JSC::ConservativeRoots::genericAddSpan):
1629 (JSC::ConservativeRoots::add):
1630 * heap/ConservativeRoots.h:
1632 (JSC::Heap::addJettisonCodeBlock):
1633 (JSC::Heap::markRoots):
1635 * heap/JettisonedCodeBlocks.cpp: Added.
1636 (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks):
1637 (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks):
1638 (JSC::JettisonedCodeBlocks::addCodeBlock):
1639 (JSC::JettisonedCodeBlocks::clearMarks):
1640 (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks):
1641 (JSC::JettisonedCodeBlocks::traceCodeBlocks):
1642 * heap/JettisonedCodeBlocks.h: Added.
1643 (JSC::JettisonedCodeBlocks::mark):
1644 * interpreter/RegisterFile.cpp:
1645 (JSC::RegisterFile::gatherConservativeRoots):
1646 * interpreter/RegisterFile.h:
1648 (JSC::DEFINE_STUB_FUNCTION):
1649 * runtime/Executable.cpp:
1650 (JSC::jettisonCodeBlock):
1651 (JSC::EvalExecutable::jettisonOptimizedCode):
1652 (JSC::ProgramExecutable::jettisonOptimizedCode):
1653 (JSC::FunctionExecutable::jettisonOptimizedCodeForCall):
1654 (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct):
1655 * runtime/Executable.h:
1656 (JSC::FunctionExecutable::jettisonOptimizedCodeFor):
1657 * wtf/BitVector.h: Added.
1658 (WTF::BitVector::BitVector):
1659 (WTF::BitVector::~BitVector):
1660 (WTF::BitVector::operator=):
1661 (WTF::BitVector::size):
1662 (WTF::BitVector::ensureSize):
1663 (WTF::BitVector::resize):
1664 (WTF::BitVector::clearAll):
1665 (WTF::BitVector::get):
1666 (WTF::BitVector::set):
1667 (WTF::BitVector::clear):
1668 (WTF::BitVector::bitsInPointer):
1669 (WTF::BitVector::maxInlineBits):
1670 (WTF::BitVector::byteCount):
1671 (WTF::BitVector::makeInlineBits):
1672 (WTF::BitVector::OutOfLineBits::numBits):
1673 (WTF::BitVector::OutOfLineBits::numWords):
1674 (WTF::BitVector::OutOfLineBits::bits):
1675 (WTF::BitVector::OutOfLineBits::create):
1676 (WTF::BitVector::OutOfLineBits::destroy):
1677 (WTF::BitVector::OutOfLineBits::OutOfLineBits):
1678 (WTF::BitVector::isInline):
1679 (WTF::BitVector::outOfLineBits):
1680 (WTF::BitVector::resizeOutOfLine):
1681 (WTF::BitVector::bits):
1683 2011-09-21 Gavin Barraclough <barraclough@apple.com>
1685 Add X86 GPRInfo for DFG JIT.
1686 https://bugs.webkit.org/show_bug.cgi?id=68586
1688 Reviewed by Geoff Garen.
1691 (JSC::DFG::GPRInfo::toRegister):
1692 (JSC::DFG::GPRInfo::toIndex):
1693 (JSC::DFG::GPRInfo::debugName):
1695 2011-09-21 Gavin Barraclough <barraclough@apple.com>
1697 Should support value profiling on CPU(X86)
1698 https://bugs.webkit.org/show_bug.cgi?id=68575
1700 Reviewed by Sam Weinig.
1702 Fix verbose profiling in ToT (SlowCaseProfile had been
1703 partially renamed to RareCaseProfile), add in-memory
1704 bucket counter for CPU(X86), move JIT::m_canBeOptimized
1705 out of the DFG_JIT ifdef.
1707 * bytecode/CodeBlock.cpp:
1708 (JSC::CodeBlock::resetRareCaseProfiles):
1709 (JSC::CodeBlock::dumpValueProfiles):
1710 * bytecode/CodeBlock.h:
1711 * dfg/DFGByteCodeParser.cpp:
1712 (JSC::DFG::ByteCodeParser::makeSafe):
1714 (JSC::JIT::privateCompileSlowCases):
1715 (JSC::JIT::privateCompile):
1717 * jit/JITInlineMethods.h:
1718 (JSC::JIT::emitValueProfilingSite):
1720 2011-09-21 Filip Pizlo <fpizlo@apple.com>
1722 DFG does not support compiling functions as constructors
1723 https://bugs.webkit.org/show_bug.cgi?id=68500
1725 Reviewed by Oliver Hunt.
1727 This adds support for compiling constructors to the DFG. It's a
1728 1% speed-up on V8, mostly due to a 6% speed-up on early-boyer.
1729 It's also a 13% win on access-binary-trees, but it's neutral in
1730 the SunSpider and Kraken averages.
1732 * dfg/DFGByteCodeParser.cpp:
1733 (JSC::DFG::ByteCodeParser::parseBlock):
1734 * dfg/DFGCapabilities.h:
1735 (JSC::DFG::mightCompileFunctionForConstruct):
1736 (JSC::DFG::canCompileOpcode):
1738 * dfg/DFGOperations.cpp:
1739 * dfg/DFGOperations.h:
1740 * dfg/DFGPropagator.cpp:
1741 (JSC::DFG::Propagator::propagateNodePredictions):
1742 (JSC::DFG::Propagator::performNodeCSE):
1743 * dfg/DFGSpeculativeJIT.cpp:
1744 (JSC::DFG::SpeculativeJIT::compile):
1745 * runtime/Executable.cpp:
1746 (JSC::FunctionExecutable::compileOptimizedForConstruct):
1747 (JSC::FunctionExecutable::compileForConstructInternal):
1748 * runtime/Executable.h:
1749 (JSC::FunctionExecutable::compileForConstruct):
1750 (JSC::FunctionExecutable::compileFor):
1751 (JSC::FunctionExecutable::compileOptimizedFor):
1753 2011-09-21 Gavin Barraclough <barraclough@apple.com>
1755 Replace jsFunctionVPtr compares with a type check on the Structure.
1756 https://bugs.webkit.org/show_bug.cgi?id=68557
1758 Reviewed by Oliver Hunt.
1760 This will permit calls to still optimize to subclasses of JSFunction
1761 that have the correct type (but a different C++ vptr).
1763 This patch stops passing the globalData into numerous functions.
1765 * dfg/DFGByteCodeParser.cpp:
1766 (JSC::DFG::ByteCodeParser::parseBlock):
1768 (JSC::DFG::Graph::isFunctionConstant):
1769 (JSC::DFG::Graph::valueOfFunctionConstant):
1770 * dfg/DFGJITCompiler.h:
1771 (JSC::DFG::JITCompiler::isFunctionConstant):
1772 (JSC::DFG::JITCompiler::valueOfFunctionConstant):
1773 * dfg/DFGOperations.cpp:
1774 * interpreter/Interpreter.cpp:
1775 (JSC::Interpreter::privateExecute):
1778 (JSC::JIT::compileOpCallVarargs):
1779 (JSC::JIT::compileOpCallSlowCase):
1780 * jit/JITCall32_64.cpp:
1781 (JSC::JIT::compileOpCallVarargs):
1782 (JSC::JIT::compileOpCallSlowCase):
1783 * jit/JITInlineMethods.h:
1784 (JSC::JIT::emitJumpIfNotType):
1786 (JSC::DEFINE_STUB_FUNCTION):
1787 * runtime/Executable.h:
1788 (JSC::isHostFunction):
1789 * runtime/JSFunction.h:
1790 (JSC::JSFunction::createStructure):
1791 * runtime/JSObject.cpp:
1792 (JSC::JSObject::put):
1793 (JSC::JSObject::putWithAttributes):
1794 * runtime/JSObject.h:
1795 (JSC::getJSFunction):
1796 (JSC::JSObject::putDirect):
1797 (JSC::JSObject::putDirectWithoutTransition):
1800 2011-09-21 Geoffrey Garen <ggaren@apple.com>
1802 Removed WTFTHREADDATA_MULTITHREADED, making it always true
1803 https://bugs.webkit.org/show_bug.cgi?id=68549
1805 Reviewed by Darin Adler.
1807 Another part of making threads exist in WebKit.
1809 * wtf/WTFThreadData.cpp:
1810 * wtf/WTFThreadData.h:
1811 (WTF::wtfThreadData):
1813 2011-09-21 Dan Bernstein <mitz@apple.com>
1815 JavaScriptCore Part of: Prevent the WebKit frameworks from defining inappropriately-named Objective-C classes
1816 https://bugs.webkit.org/show_bug.cgi?id=68451
1818 Reviewed by Darin Adler.
1820 * JavaScriptCore.xcodeproj/project.pbxproj: Added a script build phase that invokes
1821 check-for-inappropriate-objc-class-names, allowing only class names prefixed with "JS".
1823 2011-09-20 Gavin Barraclough <barraclough@apple.com>
1825 MacroAssembler fixes.
1826 https://bugs.webkit.org/show_bug.cgi?id=68494
1828 Reviewed by Sam Weinig.
1830 Add X86-64's 3 operand or32 to other MacroAssembler, fix load32's [const] void* mismatch
1832 * assembler/MacroAssembler.h:
1833 (JSC::MacroAssembler::orPtr):
1834 (JSC::MacroAssembler::loadPtr):
1835 * assembler/MacroAssemblerARM.h:
1836 (JSC::MacroAssemblerARM::or32):
1837 * assembler/MacroAssemblerARMv7.h:
1838 (JSC::MacroAssemblerARMv7::or32):
1839 * assembler/MacroAssemblerMIPS.h:
1840 (JSC::MacroAssemblerMIPS::or32):
1841 * assembler/MacroAssemblerSH4.h:
1842 (JSC::MacroAssemblerSH4::or32):
1843 (JSC::MacroAssemblerSH4::load32):
1844 * assembler/MacroAssemblerX86.h:
1845 (JSC::MacroAssemblerX86::load32):
1846 * assembler/MacroAssemblerX86_64.h:
1847 (JSC::MacroAssemblerX86_64::load32):
1849 2011-09-20 Geoffrey Garen <ggaren@apple.com>
1853 Reviewed by Beth Dakin.
1855 * heap/MarkedBlock.cpp:
1856 (JSC::MarkedBlock::blessNewBlock): Removed blessNewBlockForSlowPath()
1857 because it was unused; renamed blessNewBlockForFastPath() to blessNewBlock()
1858 since there is only one now.
1860 * heap/MarkedBlock.h: Removed ownerSet-related stuff since it was unused.
1861 Updated mark bit overhead calculation. Deployed atomsPerBlock in one
1862 place where we were recalculating it.
1864 * heap/MarkedSpace.cpp:
1865 (JSC::MarkedSpace::addBlock): Updated for rename.
1867 2011-09-20 Filip Pizlo <fpizlo@apple.com>
1869 DFG JIT always speculates integer on modulo
1870 https://bugs.webkit.org/show_bug.cgi?id=68485
1872 Reviewed by Oliver Hunt.
1874 Added support for double modulo, which is a call to fmod().
1875 Also added support for recording the old JIT's statistics
1876 on op_mod and propagating them along the graph. Finally,
1877 fixed a goof in the ArithNodeFlags propagation logic that
1878 was made obvious when I started testing ArithMod.
1880 * dfg/DFGByteCodeParser.cpp:
1881 (JSC::DFG::ByteCodeParser::makeSafe):
1882 (JSC::DFG::ByteCodeParser::parseBlock):
1884 (JSC::DFG::Node::hasArithNodeFlags):
1885 * dfg/DFGPropagator.cpp:
1886 (JSC::DFG::Propagator::propagateArithNodeFlags):
1887 (JSC::DFG::Propagator::propagateNodePredictions):
1888 (JSC::DFG::Propagator::fixupNode):
1889 * dfg/DFGSpeculativeJIT.cpp:
1890 (JSC::DFG::SpeculativeJIT::compile):
1892 2011-09-20 ChangSeok Oh <shivamidow@gmail.com>
1894 [GTK] requestAnimationFrame support for gtk port
1895 https://bugs.webkit.org/show_bug.cgi?id=66280
1897 Reviewed by Martin Robinson.
1899 Let GTK port use REQUEST_ANIMATION_FRAME_TIMER.
1903 2011-09-20 Filip Pizlo <fpizlo@apple.com>
1905 DFG JIT performs too many negative zero checks, and too many
1907 https://bugs.webkit.org/show_bug.cgi?id=68430
1909 Reviewed by Oliver Hunt.
1911 This adds comprehensive support for deciding how to perform an
1912 arithmetic operations based on a combination of overflow profiling,
1913 negative zero profiling, value profiling, and a static analysis of
1914 how the results of these operations get used.
1916 This is a 72% speed-up on stanford-crypto-sha256-iterative, and a
1917 2.5% speed-up on the Kraken average, a 1.4% speed-up on the V8
1918 geomean, and neutral on SunSpider. It's also an 8.5% speed-up on
1919 V8-crypto, because apparenty everything we do speeds up crypto.
1921 * dfg/DFGByteCodeParser.cpp:
1922 (JSC::DFG::ByteCodeParser::toInt32):
1923 (JSC::DFG::ByteCodeParser::toNumber):
1924 (JSC::DFG::ByteCodeParser::isSmallInt32Constant):
1925 (JSC::DFG::ByteCodeParser::valueOfInt32Constant):
1926 (JSC::DFG::ByteCodeParser::weaklyPredictInt32):
1927 (JSC::DFG::ByteCodeParser::makeSafe):
1928 (JSC::DFG::ByteCodeParser::handleMinMax):
1929 (JSC::DFG::ByteCodeParser::handleIntrinsic):
1930 (JSC::DFG::ByteCodeParser::parseBlock):
1931 (JSC::DFG::ByteCodeParser::processPhiStack):
1932 (JSC::DFG::ByteCodeParser::parse):
1934 (JSC::DFG::Graph::dump):
1935 * dfg/DFGJITCodeGenerator.cpp:
1936 (JSC::DFG::JITCodeGenerator::nonSpeculativeBasicArithOp):
1938 (JSC::DFG::nodeUsedAsNumber):
1939 (JSC::DFG::nodeCanTruncateInteger):
1940 (JSC::DFG::nodeCanIgnoreNegativeZero):
1941 (JSC::DFG::nodeCanSpeculateInteger):
1942 (JSC::DFG::arithNodeFlagsAsString):
1943 (JSC::DFG::Node::Node):
1944 (JSC::DFG::Node::hasArithNodeFlags):
1945 (JSC::DFG::Node::rawArithNodeFlags):
1946 (JSC::DFG::Node::arithNodeFlags):
1947 (JSC::DFG::Node::arithNodeFlagsForCompare):
1948 (JSC::DFG::Node::setArithNodeFlag):
1949 (JSC::DFG::Node::mergeArithNodeFlags):
1950 * dfg/DFGPropagator.cpp:
1951 (JSC::DFG::Propagator::fixpoint):
1952 (JSC::DFG::Propagator::isNotNegZero):
1953 (JSC::DFG::Propagator::isNotZero):
1954 (JSC::DFG::Propagator::propagateArithNodeFlags):
1955 (JSC::DFG::Propagator::propagateArithNodeFlagsForward):
1956 (JSC::DFG::Propagator::propagateArithNodeFlagsBackward):
1957 (JSC::DFG::Propagator::propagateNodePredictions):
1958 (JSC::DFG::Propagator::propagatePredictionsForward):
1959 (JSC::DFG::Propagator::propagatePredictionsBackward):
1960 (JSC::DFG::Propagator::toDouble):
1961 (JSC::DFG::Propagator::fixupNode):
1962 (JSC::DFG::Propagator::fixup):
1963 (JSC::DFG::Propagator::startIndexForChildren):
1964 (JSC::DFG::Propagator::endIndexForPureCSE):
1965 (JSC::DFG::Propagator::pureCSE):
1966 (JSC::DFG::Propagator::clobbersWorld):
1967 (JSC::DFG::Propagator::setReplacement):
1968 (JSC::DFG::Propagator::performNodeCSE):
1969 (JSC::DFG::Propagator::localCSE):
1970 * dfg/DFGSpeculativeJIT.cpp:
1971 (JSC::DFG::SpeculativeJIT::compile):
1972 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
1974 2011-09-19 Oliver Hunt <oliver@apple.com>
1976 Refactor Heap allocation logic into separate AllocationSpace class
1977 https://bugs.webkit.org/show_bug.cgi?id=68409
1979 Reviewed by Gavin Barraclough.
1981 This patch hoists direct manipulation of the MarkedSpace and related
1982 data out of Heap and into a separate class. This will allow us to
1983 have multiple allocation spaces in future, so easing the way towards
1984 having GC'd backing stores for objects.
1987 * GNUmakefile.list.am:
1988 * JavaScriptCore.exp:
1989 * JavaScriptCore.gypi:
1990 * JavaScriptCore.pro:
1991 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1992 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1993 * JavaScriptCore.xcodeproj/project.pbxproj:
1994 * debugger/Debugger.cpp:
1995 (JSC::Debugger::recompileAllJSFunctions):
1996 * heap/AllocationSpace.cpp: Added.
1997 (JSC::AllocationSpace::tryAllocate):
1998 (JSC::AllocationSpace::allocateSlowCase):
1999 (JSC::AllocationSpace::allocateBlock):
2000 (JSC::AllocationSpace::freeBlocks):
2001 (JSC::TakeIfEmpty::TakeIfEmpty):
2002 (JSC::TakeIfEmpty::operator()):
2003 (JSC::TakeIfEmpty::returnValue):
2004 (JSC::AllocationSpace::shrink):
2005 * heap/AllocationSpace.h: Added.
2006 (JSC::AllocationSpace::AllocationSpace):
2007 (JSC::AllocationSpace::blocks):
2008 (JSC::AllocationSpace::sizeClassFor):
2009 (JSC::AllocationSpace::setHighWaterMark):
2010 (JSC::AllocationSpace::highWaterMark):
2011 (JSC::AllocationSpace::canonicalizeBlocks):
2012 (JSC::AllocationSpace::resetAllocator):
2013 (JSC::AllocationSpace::forEachCell):
2014 (JSC::AllocationSpace::forEachBlock):
2015 (JSC::AllocationSpace::allocate):
2018 (JSC::Heap::reportExtraMemoryCostSlowCase):
2019 (JSC::Heap::getConservativeRegisterRoots):
2020 (JSC::Heap::markRoots):
2021 (JSC::Heap::clearMarks):
2023 (JSC::Heap::objectCount):
2025 (JSC::Heap::capacity):
2026 (JSC::Heap::globalObjectCount):
2027 (JSC::Heap::objectTypeCounts):
2028 (JSC::Heap::collect):
2029 (JSC::Heap::canonicalizeBlocks):
2030 (JSC::Heap::resetAllocator):
2031 (JSC::Heap::freeBlocks):
2032 (JSC::Heap::shrink):
2034 (JSC::Heap::objectSpace):
2035 (JSC::Heap::sizeClassForObject):
2036 (JSC::Heap::allocate):
2037 * jit/JITInlineMethods.h:
2038 (JSC::JIT::emitAllocateBasicJSObject):
2039 * runtime/JSGlobalData.cpp:
2040 (JSC::JSGlobalData::recompileAllJSFunctions):
2041 (JSC::JSGlobalData::releaseExecutableMemory):
2043 2011-09-19 Geoffrey Garen <ggaren@apple.com>
2045 Removed BREWMP* platform #ifdefs
2046 https://bugs.webkit.org/show_bug.cgi?id=68425
2048 BREWMP* has no maintainer, and this is dead code.
2050 Reviewed by Darin Adler.
2053 (JSC::::shrinkAllocation):
2054 * jit/ExecutableAllocator.h:
2055 (JSC::ExecutableAllocator::cacheFlush):
2056 * runtime/TimeoutChecker.cpp:
2058 * wtf/Assertions.cpp:
2060 * wtf/CurrentTime.cpp:
2062 (WTF::calculateUTCOffset):
2063 * wtf/FastMalloc.cpp:
2066 (WTF::fastMallocSize):
2068 * wtf/MainThread.cpp:
2070 * wtf/OwnPtrCommon.h:
2072 * wtf/RandomNumber.cpp:
2073 (WTF::randomNumber):
2074 * wtf/RandomNumberSeed.h:
2075 (WTF::initializeRandomNumberGenerator):
2076 * wtf/text/WTFString.h:
2077 * wtf/unicode/Unicode.h:
2079 2011-09-20 Adam Roben <aroben@apple.com>
2081 Windows build fix after r95523
2083 * wtf/CheckedArithmetic.h: Added stdint.h so we can have int64_t defined.
2085 2011-09-18 Filip Pizlo <fpizlo@apple.com>
2087 DFG JIT does not speculate aggressively enough on GetById
2088 https://bugs.webkit.org/show_bug.cgi?id=68320
2090 Reviewed by Oliver Hunt.
2092 This adds the ability to access properties directly, by offset.
2093 This optimization kicks in when at the time of DFG compilation,
2094 it appears that the given get_by_id is self-cached by the old JIT.
2095 Two new opcodes get introduced: CheckStructure and GetByOffset.
2096 CheckStructure performs a speculation check on the object's
2097 structure, and returns the storage pointer. GetByOffset performs
2098 a direct read of the field from the storage pointer. Both
2099 CheckStructure and GetByOffset can be CSE'd, so that we can
2100 eliminate redundant structure checks, and redundant reads of the
2103 This is a 4% speed-up on V8, a 2% slow-down on Kraken, and
2104 neutral on SunSpider.
2106 * bytecode/PredictedType.cpp:
2107 (JSC::predictionFromClassInfo):
2108 (JSC::predictionFromStructure):
2109 (JSC::predictionFromCell):
2110 * bytecode/PredictedType.h:
2111 * dfg/DFGByteCodeParser.cpp:
2112 (JSC::DFG::ByteCodeParser::parseBlock):
2113 * dfg/DFGGenerationInfo.h:
2114 (JSC::DFG::dataFormatToString):
2115 (JSC::DFG::needDataFormatConversion):
2116 (JSC::DFG::GenerationInfo::initStorage):
2117 (JSC::DFG::GenerationInfo::spill):
2118 (JSC::DFG::GenerationInfo::fillStorage):
2120 (JSC::DFG::Graph::predict):
2121 (JSC::DFG::Graph::getPrediction):
2122 * dfg/DFGJITCodeGenerator.cpp:
2123 (JSC::DFG::JITCodeGenerator::fillInteger):
2124 (JSC::DFG::JITCodeGenerator::fillDouble):
2125 (JSC::DFG::JITCodeGenerator::fillJSValue):
2126 (JSC::DFG::JITCodeGenerator::fillStorage):
2127 (JSC::DFG::GPRTemporary::GPRTemporary):
2128 * dfg/DFGJITCodeGenerator.h:
2129 (JSC::DFG::JITCodeGenerator::silentSpillGPR):
2130 (JSC::DFG::JITCodeGenerator::silentFillGPR):
2131 (JSC::DFG::JITCodeGenerator::spill):
2132 (JSC::DFG::JITCodeGenerator::storageResult):
2133 (JSC::DFG::StorageOperand::StorageOperand):
2134 (JSC::DFG::StorageOperand::~StorageOperand):
2135 (JSC::DFG::StorageOperand::index):
2136 (JSC::DFG::StorageOperand::gpr):
2137 (JSC::DFG::StorageOperand::use):
2139 (JSC::DFG::OpInfo::OpInfo):
2140 (JSC::DFG::Node::Node):
2141 (JSC::DFG::Node::hasPrediction):
2142 (JSC::DFG::Node::hasStructure):
2143 (JSC::DFG::Node::structure):
2144 (JSC::DFG::Node::hasStorageAccessData):
2145 (JSC::DFG::Node::storageAccessDataIndex):
2146 * dfg/DFGPropagator.cpp:
2147 (JSC::DFG::Propagator::propagateNode):
2148 (JSC::DFG::Propagator::globalVarLoadElimination):
2149 (JSC::DFG::Propagator::getMethodLoadElimination):
2150 (JSC::DFG::Propagator::checkStructureLoadElimination):
2151 (JSC::DFG::Propagator::getByOffsetLoadElimination):
2152 (JSC::DFG::Propagator::performNodeCSE):
2153 * dfg/DFGSpeculativeJIT.cpp:
2154 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
2155 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
2156 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
2157 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
2158 (JSC::DFG::SpeculativeJIT::compile):
2159 * wtf/StdLibExtras.h:
2162 2011-09-19 Mark Hahnenberg <mhahnenberg@apple.com>
2164 Remove toPrimitive from JSCell
2165 https://bugs.webkit.org/show_bug.cgi?id=67875
2167 Reviewed by Darin Adler.
2169 Part of the refactoring process to un-virtualize JSCell. We move
2170 all of the implicit functionality provided by the virtual toPrimitive method
2171 in JSCell to be explicit in JSValue::toPrimitive and JSCell:toPrimitive while
2172 also de-virtualizing JSCell::toPrimitive.
2174 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2175 * runtime/JSCell.cpp:
2176 (JSC::JSCell::toPrimitive):
2179 We replace JSNotAnObject::toPrimitive with defaultValue, which it overrides from
2180 JSObject. This pushes the virtual method further down, enabling us to get rid
2181 of the virtual call in JSCell. Eventually we'll probably have to deal with this
2182 again, but we'll cross that bridge when we come to it.
2183 * runtime/JSNotAnObject.cpp:
2184 (JSC::JSNotAnObject::defaultValue):
2185 * runtime/JSNotAnObject.h:
2186 * runtime/JSObject.h:
2187 * runtime/JSString.h:
2189 2011-09-19 Geoffrey Garen <ggaren@apple.com>
2191 Removed ENABLE_LAZY_BLOCK_FREEING and related #ifdefs
2192 https://bugs.webkit.org/show_bug.cgi?id=68424
2194 As discussed on webkit-dev. All ports build with threads enabled in JSC now.
2196 This may break WinCE and other ports that have not built and tested with
2197 this configuration. I've filed bugs for port maintainers. It's time for
2198 WebKit to move forward.
2200 Reviewed by Mark Rowe.
2205 (JSC::Heap::destroy):
2206 (JSC::Heap::blockFreeingThreadMain):
2207 (JSC::Heap::allocateBlock):
2208 (JSC::Heap::freeBlocks):
2209 (JSC::Heap::releaseFreeBlocks):
2213 2011-09-19 Geoffrey Garen <ggaren@apple.com>
2215 Removed ENABLE_WTF_MULTIPLE_THREADS and related #ifdefs
2216 https://bugs.webkit.org/show_bug.cgi?id=68423
2218 As discussed on webkit-dev. All ports build with threads enabled in WTF now.
2220 This may break WinCE and other ports that have not built and tested with
2221 this configuration. I've filed bugs for port maintainers. It's time for
2222 WebKit to move forward.
2224 Reviewed by Mark Rowe.
2226 * wtf/CryptographicallyRandomNumber.cpp:
2227 (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomNumber):
2228 (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomValues):
2229 * wtf/FastMalloc.cpp:
2231 * wtf/RandomNumber.cpp:
2232 (WTF::randomNumber):
2233 * wtf/RefCountedLeakCounter.cpp:
2234 (WTF::RefCountedLeakCounter::increment):
2235 (WTF::RefCountedLeakCounter::decrement):
2236 * wtf/ThreadingPthreads.cpp:
2237 (WTF::initializeThreading):
2238 * wtf/ThreadingWin.cpp:
2239 (WTF::initializeThreading):
2242 * wtf/gtk/ThreadingGtk.cpp:
2243 (WTF::initializeThreading):
2244 * wtf/qt/ThreadingQt.cpp:
2245 (WTF::initializeThreading):
2247 2011-09-19 Geoffrey Garen <ggaren@apple.com>
2249 Removed ENABLE_JSC_MULTIPLE_THREADS and related #ifdefs.
2250 https://bugs.webkit.org/show_bug.cgi?id=68422
2252 As discussed on webkit-dev. All ports build with threads enabled in JSC now.
2254 This may break WinCE and other ports that have not built and tested with
2255 this configuration. I've filed bugs for port maintainers. It's time for
2256 WebKit to move forward.
2258 Reviewed by Sam Weinig.
2261 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
2262 * API/JSContextRef.cpp:
2263 * heap/MachineStackMarker.cpp:
2264 (JSC::MachineThreads::MachineThreads):
2265 (JSC::MachineThreads::~MachineThreads):
2266 (JSC::MachineThreads::gatherConservativeRoots):
2267 * heap/MachineStackMarker.h:
2268 * runtime/InitializeThreading.cpp:
2269 (JSC::initializeThreadingOnce):
2270 (JSC::initializeThreading):
2271 * runtime/JSGlobalData.cpp:
2272 (JSC::JSGlobalData::sharedInstance):
2273 * runtime/JSGlobalData.h:
2274 (JSC::JSGlobalData::makeUsableFromMultipleThreads):
2275 * runtime/JSLock.cpp:
2276 * runtime/Structure.cpp:
2279 2011-09-19 Sheriff Bot <webkit.review.bot@gmail.com>
2281 Unreviewed, rolling out r95493 and r95496.
2282 http://trac.webkit.org/changeset/95493
2283 http://trac.webkit.org/changeset/95496
2284 https://bugs.webkit.org/show_bug.cgi?id=68418
2286 Broke Windows build (Requested by rniwa on #webkit).
2289 * GNUmakefile.list.am:
2290 * JavaScriptCore.exp:
2291 * JavaScriptCore.gypi:
2292 * JavaScriptCore.pro:
2293 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2294 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2295 * JavaScriptCore.xcodeproj/project.pbxproj:
2296 * debugger/Debugger.cpp:
2297 (JSC::Debugger::recompileAllJSFunctions):
2298 * heap/AllocationSpace.cpp: Removed.
2299 * heap/AllocationSpace.h: Removed.
2301 (JSC::CountFunctor::TakeIfEmpty::TakeIfEmpty):
2302 (JSC::CountFunctor::TakeIfEmpty::operator()):
2303 (JSC::CountFunctor::TakeIfEmpty::returnValue):
2305 (JSC::Heap::reportExtraMemoryCostSlowCase):
2306 (JSC::Heap::tryAllocate):
2307 (JSC::Heap::allocateSlowCase):
2308 (JSC::Heap::getConservativeRegisterRoots):
2309 (JSC::Heap::markRoots):
2310 (JSC::Heap::clearMarks):
2312 (JSC::Heap::objectCount):
2314 (JSC::Heap::capacity):
2315 (JSC::Heap::globalObjectCount):
2316 (JSC::Heap::objectTypeCounts):
2317 (JSC::Heap::collect):
2318 (JSC::Heap::canonicalizeBlocks):
2319 (JSC::Heap::resetAllocator):
2320 (JSC::Heap::allocateBlock):
2321 (JSC::Heap::freeBlocks):
2322 (JSC::Heap::shrink):
2324 (JSC::Heap::markedSpace):
2325 (JSC::Heap::forEachCell):
2326 (JSC::Heap::forEachBlock):
2327 (JSC::Heap::sizeClassFor):
2328 (JSC::Heap::allocate):
2329 * jit/JITInlineMethods.h:
2330 (JSC::JIT::emitAllocateBasicJSObject):
2331 * runtime/JSGlobalData.cpp:
2332 (JSC::JSGlobalData::recompileAllJSFunctions):
2333 (JSC::JSGlobalData::releaseExecutableMemory):
2335 2011-09-19 Gavin Barraclough <barraclough@apple.com>
2337 Errrk, missed stylebot comments in last commit.
2339 * runtime/StringPrototype.cpp:
2340 (JSC::stringProtoFuncSplit):
2342 2011-09-19 Gavin Barraclough <barraclough@apple.com>
2344 String#split is buggy
2345 https://bugs.webkit.org/show_bug.cgi?id=68348
2347 Reviewed by Sam Weinig.
2349 * runtime/StringPrototype.cpp:
2350 (JSC::jsStringWithReuse):
2351 - added helper function to reuse original JSString value.
2352 (JSC::stringProtoFuncSplit):
2353 - Rewritten from the spec.
2354 * tests/mozilla/ecma/String/15.5.4.8-2.js:
2356 - This test is not ES5 compliant.
2358 2011-09-19 Geoffrey Garen <ggaren@apple.com>
2360 Removed lots of friend declarations from JSCell, so we can more
2361 effectively make use of private and protected.
2363 Reviewed by Sam Weinig.
2365 * runtime/JSCell.h: Removed MSVCBugWorkaround because it was a lot of
2366 confusion for not much safety.
2367 (JSC::JSCell::operator new): Made this public because it is used by a
2368 few clients, and not really dangerous.
2370 * runtime/JSObject.cpp:
2371 (JSC::JSObject::put):
2372 (JSC::JSObject::deleteProperty):
2373 (JSC::JSObject::defineGetter):
2374 (JSC::JSObject::defineSetter):
2375 (JSC::JSObject::getPropertySpecificValue):
2376 (JSC::JSObject::getOwnPropertyNames):
2377 (JSC::JSObject::seal):
2378 (JSC::JSObject::freeze):
2379 (JSC::JSObject::preventExtensions):
2380 (JSC::JSObject::removeDirect):
2381 (JSC::JSObject::createInheritorID):
2382 (JSC::JSObject::allocatePropertyStorage):
2383 (JSC::JSObject::getOwnPropertyDescriptor):
2384 * runtime/JSObject.h:
2385 (JSC::JSObject::getDirect):
2386 (JSC::JSObject::getDirectLocation):
2387 (JSC::JSObject::hasCustomProperties):
2388 (JSC::JSObject::hasGetterSetterProperties):
2389 (JSC::JSObject::isSealed):
2390 (JSC::JSObject::isFrozen):
2391 (JSC::JSObject::isExtensible):
2392 (JSC::JSObject::flattenDictionaryObject):
2393 (JSC::JSObject::finishCreation):
2394 (JSC::JSObject::prototype):
2395 (JSC::JSObject::setPrototype):
2396 (JSC::JSObject::inlineGetOwnPropertySlot):
2397 (JSC::JSCell::fastGetOwnProperty):
2398 (JSC::JSObject::putDirectInternal):
2399 (JSC::JSObject::putDirectWithoutTransition):
2400 (JSC::JSObject::transitionTo):
2401 (JSC::JSObject::visitChildrenDirect): Changed all use of m_structure to
2402 structure() / setStructure(), so we don't have to be a friend of JSCell.
2404 * runtime/Structure.h:
2405 (JSC::JSCell::setStructure): Added, to avoid direct access by JSObject
2406 to JSCell::m_structure.
2408 2011-09-19 Adam Barth <abarth@webkit.org>
2410 Always enable ENABLE(EVENTSOURCE)
2411 https://bugs.webkit.org/show_bug.cgi?id=68414
2413 Reviewed by Eric Seidel.
2415 * Configurations/FeatureDefines.xcconfig:
2417 2011-09-19 Eli Fidler <efidler@rim.com>
2419 Enable JSC_MULTIPLE_THREADS for OS(QNX).
2420 https://bugs.webkit.org/show_bug.cgi?id=68047
2422 Reviewed by Daniel Bates.
2424 SA_RESTART was required for SIGUSR2-based debugging, but is not
2425 present on QNX. This debugging doesn't seem critical to
2426 JSC_MULTIPLE_THREADS, so allow it to proceed.
2428 * heap/MachineStackMarker.cpp:
2429 (JSC::MachineThreads::Thread::Thread):
2430 (JSC::getPlatformThreadRegisters):
2431 (JSC::otherThreadStackPointer):
2432 (JSC::freePlatformThreadRegisters):
2433 * wtf/Platform.h: enable PTHREADS for OS(QNX)
2435 2011-09-19 Oliver Hunt <oliver@apple.com>
2439 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2441 2011-09-19 Oliver Hunt <oliver@apple.com>
2443 Refactor Heap allocation logic into separate AllocationSpace class
2444 https://bugs.webkit.org/show_bug.cgi?id=68409
2446 Reviewed by Gavin Barraclough.
2448 This patch hoists direct manipulation of the MarkedSpace and related
2449 data out of Heap and into a separate class. This will allow us to
2450 have multiple allocation spaces in future, so easing the way towards
2451 having GC'd backing stores for objects.
2454 * GNUmakefile.list.am:
2455 * JavaScriptCore.exp:
2456 * JavaScriptCore.gypi:
2457 * JavaScriptCore.pro:
2458 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2459 * JavaScriptCore.xcodeproj/project.pbxproj:
2460 * debugger/Debugger.cpp:
2461 (JSC::Debugger::recompileAllJSFunctions):
2462 * heap/AllocationSpace.cpp: Added.
2463 (JSC::AllocationSpace::tryAllocate):
2464 (JSC::AllocationSpace::allocateSlowCase):
2465 (JSC::AllocationSpace::allocateBlock):
2466 (JSC::AllocationSpace::freeBlocks):
2467 (JSC::TakeIfEmpty::TakeIfEmpty):
2468 (JSC::TakeIfEmpty::operator()):
2469 (JSC::TakeIfEmpty::returnValue):
2470 (JSC::AllocationSpace::shrink):
2471 * heap/AllocationSpace.h: Added.
2472 (JSC::AllocationSpace::AllocationSpace):
2473 (JSC::AllocationSpace::blocks):
2474 (JSC::AllocationSpace::sizeClassFor):
2475 (JSC::AllocationSpace::setHighWaterMark):
2476 (JSC::AllocationSpace::highWaterMark):
2477 (JSC::AllocationSpace::canonicalizeBlocks):
2478 (JSC::AllocationSpace::resetAllocator):
2479 (JSC::AllocationSpace::forEachCell):
2480 (JSC::AllocationSpace::forEachBlock):
2481 (JSC::AllocationSpace::allocate):
2484 (JSC::Heap::reportExtraMemoryCostSlowCase):
2485 (JSC::Heap::getConservativeRegisterRoots):
2486 (JSC::Heap::markRoots):
2487 (JSC::Heap::clearMarks):
2489 (JSC::Heap::objectCount):
2491 (JSC::Heap::capacity):
2492 (JSC::Heap::globalObjectCount):
2493 (JSC::Heap::objectTypeCounts):
2494 (JSC::Heap::collect):
2495 (JSC::Heap::canonicalizeBlocks):
2496 (JSC::Heap::resetAllocator):
2497 (JSC::Heap::freeBlocks):
2498 (JSC::Heap::shrink):
2500 (JSC::Heap::objectSpace):
2501 (JSC::Heap::sizeClassForObject):
2502 (JSC::Heap::allocate):
2503 * jit/JITInlineMethods.h:
2504 (JSC::JIT::emitAllocateBasicJSObject):
2505 * runtime/JSGlobalData.cpp:
2506 (JSC::JSGlobalData::recompileAllJSFunctions):
2507 (JSC::JSGlobalData::releaseExecutableMemory):
2509 2011-09-19 Adam Roben <aroben@apple.com>
2511 Windows build fix after r95310
2513 * JavaScriptCore.vcproj/testRegExp/testRegExpCommon.vsprops: Added
2514 include\private\JavaScriptCore to the include path so DFGIntrinsic.h can be found.
2516 2011-09-19 Filip Pizlo <fpizlo@apple.com>
2518 DFG speculation failures should act as additional value profiles
2519 https://bugs.webkit.org/show_bug.cgi?id=68335
2521 Reviewed by Oliver Hunt.
2523 This adds slow-case counters to the old JIT. It also ensures that
2524 negative zero in multiply is handled carefully. The old JIT
2525 previously took slow path if the result of a multiply was zero,
2526 which, without any changes, would cause the DFG to think that
2527 every such multiply produced a double result.
2529 This also fixes a bug in the old JIT's handling of decrements. It
2530 would take the slow path if the result was zero, but not if it
2533 By itself, this would be a 1% slow-down on V8 and Kraken. But then
2534 I wrote optimizations in the DFG that take advantage of this new
2535 information. It's no longer the case that every multiply needs to
2536 do a check for negative zero; it only happens if the negative
2539 This results in a 12% speed-up on v8-crypto, for a 1.4% geomean
2540 speed-up in V8. It's mostly neutral on Kraken. I can see an
2541 0.5% slow-down and it appears to be significant.
2543 * bytecode/CodeBlock.cpp:
2544 (JSC::CodeBlock::resetRareCaseProfiles):
2545 (JSC::CodeBlock::dumpValueProfiles):
2546 * bytecode/CodeBlock.h:
2547 * bytecode/ValueProfile.h:
2548 (JSC::RareCaseProfile::RareCaseProfile):
2549 (JSC::getRareCaseProfileBytecodeOffset):
2550 * dfg/DFGByteCodeParser.cpp:
2551 (JSC::DFG::ByteCodeParser::toInt32):
2552 (JSC::DFG::ByteCodeParser::makeSafe):
2553 (JSC::DFG::ByteCodeParser::parseBlock):
2554 * dfg/DFGJITCodeGenerator.cpp:
2555 (JSC::DFG::GPRTemporary::GPRTemporary):
2556 * dfg/DFGJITCodeGenerator.h:
2558 * dfg/DFGPropagator.cpp:
2559 (JSC::DFG::Propagator::propagateNode):
2560 (JSC::DFG::Propagator::fixupNode):
2561 (JSC::DFG::Propagator::clobbersWorld):
2562 (JSC::DFG::Propagator::performNodeCSE):
2563 * dfg/DFGSpeculativeJIT.cpp:
2564 (JSC::DFG::SpeculativeJIT::compile):
2565 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
2567 (JSC::JIT::privateCompileSlowCases):
2569 (JSC::JIT::linkDummySlowCase):
2570 * jit/JITArithmetic.cpp:
2571 (JSC::JIT::emit_op_post_dec):
2572 (JSC::JIT::emit_op_pre_dec):
2573 (JSC::JIT::compileBinaryArithOp):
2574 (JSC::JIT::emit_op_add):
2575 (JSC::JIT::emitSlow_op_add):
2576 * jit/JITInlineMethods.h:
2577 (JSC::JIT::addSlowCase):
2579 2011-09-19 Adam Roben <aroben@apple.com>
2581 Windows build fix after r94575
2583 * JavaScriptCore.vcproj/JavaScriptCore.sln: Relinearized project dependencies. testRegExp
2584 now builds just before FindSafari.
2586 2011-09-19 Sheriff Bot <webkit.review.bot@gmail.com>
2588 Unreviewed, rolling out r95466.
2589 http://trac.webkit.org/changeset/95466
2590 https://bugs.webkit.org/show_bug.cgi?id=68389
2592 Incorrect version of the patch. (Requested by mhahnenberg on
2595 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2596 * runtime/JSCell.cpp:
2597 (JSC::JSCell::toPrimitive):
2599 (JSC::JSCell::JSValue::toPrimitive):
2600 * runtime/JSNotAnObject.cpp:
2601 (JSC::JSNotAnObject::toPrimitive):
2602 * runtime/JSNotAnObject.h:
2603 * runtime/JSObject.h:
2604 * runtime/JSString.h:
2606 2011-09-19 Mark Hahnenberg <mhahnenberg@apple.com>
2608 Remove toPrimitive from JSCell
2609 https://bugs.webkit.org/show_bug.cgi?id=67875
2611 Reviewed by Geoffrey Garen.
2613 Part of the refactoring process to un-virtualize JSCell. We move
2614 all of the implicit functionality provided by the virtual toPrimitive method
2615 in JSCell to be explicit in JSValue::toPrimitive and JSCell:toPrimitive while
2616 also de-virtualizing JSCell::toPrimitive.
2618 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2619 * runtime/JSCell.cpp:
2620 (JSC::JSCell::toPrimitive):
2623 We replace JSNotAnObject::toPrimitive with defaultValue, which it overrides from
2624 JSObject. This pushes the virtual method further down, enabling us to get rid
2625 of the virtual call in JSCell. Eventually we'll probably have to deal with this
2626 again, but we'll cross that bridge when we come to it.
2627 * runtime/JSNotAnObject.cpp:
2628 (JSC::JSNotAnObject::defaultValue):
2629 * runtime/JSNotAnObject.h:
2630 * runtime/JSObject.h:
2631 * runtime/JSString.h:
2632 (JSC::JSValue::toPrimitive):
2634 2011-09-19 Oliver Hunt <oliver@apple.com>
2638 * jit/JITPropertyAccess32_64.cpp:
2639 (JSC::JIT::compileGetDirectOffset):
2641 2011-09-19 Oliver Hunt <oliver@apple.com>
2643 Rename NewSpace.{h,cpp} to MarkedSpace.{h,cpp}
2644 https://bugs.webkit.org/show_bug.cgi?id=68376
2646 Reviewed by Gavin Barraclough.
2648 Renamed the the MarkedSpace files to match new name, and
2649 updated the relevant references.
2652 * GNUmakefile.list.am:
2653 * JavaScriptCore.gypi:
2654 * JavaScriptCore.pro:
2655 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2656 * JavaScriptCore.xcodeproj/project.pbxproj:
2658 * heap/MarkedSpace.cpp: Renamed from Source/JavaScriptCore/heap/NewSpace.cpp.
2659 (JSC::MarkedSpace::MarkedSpace):
2660 (JSC::MarkedSpace::addBlock):
2661 (JSC::MarkedSpace::removeBlock):
2662 (JSC::MarkedSpace::resetAllocator):
2663 (JSC::MarkedSpace::canonicalizeBlocks):
2664 * heap/MarkedSpace.h: Renamed from Source/JavaScriptCore/heap/NewSpace.h.
2665 (JSC::MarkedSpace::waterMark):
2666 (JSC::MarkedSpace::highWaterMark):
2667 (JSC::MarkedSpace::setHighWaterMark):
2668 (JSC::MarkedSpace::sizeClassFor):
2669 (JSC::MarkedSpace::allocate):
2670 (JSC::MarkedSpace::forEachBlock):
2671 (JSC::MarkedSpace::SizeClass::SizeClass):
2672 (JSC::MarkedSpace::SizeClass::resetAllocator):
2673 (JSC::MarkedSpace::SizeClass::canonicalizeBlock):
2676 2011-09-19 Oliver Hunt <oliver@apple.com>
2678 Rename NewSpace to MarkedSpace
2679 https://bugs.webkit.org/show_bug.cgi?id=68375
2681 Reviewed by Gavin Barraclough.
2683 Rename NewSpace to a more accurate name, and update all uses.
2684 This patch doesn't rename the files themselves as that will
2685 just make the patch appear bigger than it is.
2687 * JavaScriptCore.exp:
2688 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2690 (JSC::CountFunctor::TakeIfEmpty::TakeIfEmpty):
2691 (JSC::CountFunctor::TakeIfEmpty::operator()):
2693 (JSC::Heap::reportExtraMemoryCostSlowCase):
2694 (JSC::Heap::tryAllocate):
2695 (JSC::Heap::allocateSlowCase):
2696 (JSC::Heap::collect):
2697 (JSC::Heap::canonicalizeBlocks):
2698 (JSC::Heap::resetAllocator):
2699 (JSC::Heap::isValidAllocation):
2700 (JSC::Heap::shrink):
2702 (JSC::Heap::markedSpace):
2703 (JSC::Heap::sizeClassFor):
2704 (JSC::Heap::allocate):
2705 * heap/NewSpace.cpp:
2706 (JSC::MarkedSpace::MarkedSpace):
2707 (JSC::MarkedSpace::addBlock):
2708 (JSC::MarkedSpace::removeBlock):
2709 (JSC::MarkedSpace::resetAllocator):
2710 (JSC::MarkedSpace::canonicalizeBlocks):
2712 (JSC::MarkedSpace::waterMark):
2713 (JSC::MarkedSpace::highWaterMark):
2714 (JSC::MarkedSpace::setHighWaterMark):
2715 (JSC::MarkedSpace::sizeClassFor):
2716 (JSC::MarkedSpace::allocate):
2717 (JSC::MarkedSpace::forEachBlock):
2718 (JSC::MarkedSpace::SizeClass::SizeClass):
2719 (JSC::MarkedSpace::SizeClass::resetAllocator):
2720 (JSC::MarkedSpace::SizeClass::canonicalizeBlock):
2721 * jit/JITInlineMethods.h:
2722 (JSC::JIT::emitAllocateBasicJSObject):
2724 2011-09-19 Peter Rybin <peter.rybin@gmail.com>
2726 TextPosition refactoring: Merge ZeroBasedNumber and OneBasedNumber classes
2727 https://bugs.webkit.org/show_bug.cgi?id=63541
2729 Reviewed by Adam Barth.
2731 * parser/SourceProvider.h:
2732 (JSC::SourceProvider::startPosition):
2733 * wtf/text/TextPosition.h:
2734 (WTF::OrdinalNumber::fromZeroBasedInt):
2735 (WTF::OrdinalNumber::fromOneBasedInt):
2736 (WTF::OrdinalNumber::OrdinalNumber):
2737 (WTF::OrdinalNumber::zeroBasedInt):
2738 (WTF::OrdinalNumber::oneBasedInt):
2739 (WTF::OrdinalNumber::operator==):
2740 (WTF::OrdinalNumber::operator!=):
2741 (WTF::OrdinalNumber::first):
2742 (WTF::OrdinalNumber::beforeFirst):
2743 (WTF::TextPosition::TextPosition):
2744 (WTF::TextPosition::minimumPosition):
2745 (WTF::TextPosition::belowRangePosition):
2747 2011-09-19 Dan Bernstein <mitz@apple.com>
2749 JavaScriptCore part of [mac] WebKit contains Objective-C classes that are not prefixed with its standard prefixes
2750 https://bugs.webkit.org/show_bug.cgi?id=68323
2752 Reviewed by Sam Weinig.
2754 Renamed WTFMainThreadCaller to JSWTFMainThreadCaller.
2756 * wtf/mac/MainThreadMac.mm:
2757 (WTF::initializeMainThreadPlatform):
2758 (WTF::initializeMainThreadToProcessMainThreadPlatform):
2760 2011-09-19 Oliver Hunt <oliver@apple.com>
2762 Remove direct property slot pointers from the instruction stream
2763 https://bugs.webkit.org/show_bug.cgi?id=68373
2765 Reviewed by Gavin Barraclough.
2767 Use an indirect load to access prototype properties rather than directly
2768 storing the property address in the instruction stream. This should allow
2769 further optimisations in future, and also provides a 0.5% win to sunspider.
2771 * dfg/DFGRepatch.cpp:
2772 (JSC::DFG::generateProtoChainAccessStub):
2773 * jit/JITPropertyAccess.cpp:
2774 (JSC::JIT::compileGetDirectOffset):
2775 * jit/JITPropertyAccess32_64.cpp:
2776 (JSC::JIT::compileGetDirectOffset):
2777 * runtime/JSObject.h:
2778 (JSC::JSObject::addressOfPropertyStorage):
2780 2011-09-19 Oliver Hunt <oliver@apple.com>
2782 Remove bump allocator
2783 https://bugs.webkit.org/show_bug.cgi?id=68370
2785 Reviewed by Sam Weinig.
2787 Can't do anything with this allocator currently, and it's
2788 increasing the complexity of the GC code. Slight progression
2789 on SunSpider, slight regression (undoing the original progression)
2793 (JSC::Heap::collect):
2795 * heap/NewSpace.cpp:
2796 (JSC::NewSpace::NewSpace):
2798 (JSC::NewSpace::allocate):
2799 * runtime/JSObject.cpp:
2800 (JSC::JSObject::allocatePropertyStorage):
2801 * runtime/JSObject.h:
2802 (JSC::JSObject::~JSObject):
2803 (JSC::JSObject::visitChildrenDirect):
2804 * runtime/StorageBarrier.h:
2805 (JSC::StorageBarrier::set):
2807 2011-09-19 Carlos Garcia Campos <cgarcia@igalia.com>
2809 [GTK] Fix distcheck build
2810 https://bugs.webkit.org/show_bug.cgi?id=68346
2812 Reviewed by Philippe Normand.
2814 * GNUmakefile.list.am:
2816 2011-09-19 Carlos Garcia Campos <cgarcia@igalia.com>
2818 [GTK] Fix distcheck build
2819 https://bugs.webkit.org/show_bug.cgi?id=68241
2821 Reviewed by Martin Robinson.
2823 * GNUmakefile.list.am:
2825 2011-09-18 Dan Bernstein <mitz@apple.com>
2827 Removed ProfilerServer.
2829 Reviewed by Mark Rowe.
2831 * JavaScriptCore.gypi:
2832 * JavaScriptCore.xcodeproj/project.pbxproj:
2833 * profiler/ProfilerServer.h: Removed.
2834 * profiler/ProfilerServer.mm: Removed.
2835 * runtime/JSGlobalData.cpp:
2836 (JSC::JSGlobalData::JSGlobalData):
2839 2011-09-17 Filip Pizlo <fpizlo@apple.com>
2841 DFG JIT should inline Math.min, Math.max, and Math.sqrt
2842 https://bugs.webkit.org/show_bug.cgi?id=68318
2844 Reviewed by Gavin Barraclough.
2846 Adds Math.min, Math.max, and Math.sqrt intrinsics. Adds support for
2847 a function to have an intrinsic but not a thunk generator. This is
2848 a 7% speed-up on access-nbody, and neutral elsewhere, mainly because
2849 we're still not DFG compiling the bulk of the hot code in Kraken audio
2852 * create_hash_table:
2853 * dfg/DFGByteCodeParser.cpp:
2854 (JSC::DFG::ByteCodeParser::handleMinMax):
2855 (JSC::DFG::ByteCodeParser::handleIntrinsic):
2856 * dfg/DFGIntrinsic.h:
2858 * dfg/DFGPropagator.cpp:
2859 (JSC::DFG::Propagator::propagateNode):
2860 (JSC::DFG::Propagator::fixupNode):
2861 * dfg/DFGSpeculativeJIT.cpp:
2862 (JSC::DFG::SpeculativeJIT::compile):
2864 (JSC::JITThunks::hostFunctionStub):
2865 * runtime/Lookup.cpp:
2866 (JSC::setUpStaticFunctionSlot):
2868 2011-09-18 Nico Weber <thakis@chromium.org>
2870 Remove two files from JavaScriptCore.gypi that were removed in r95240
2871 https://bugs.webkit.org/show_bug.cgi?id=68327
2873 Unreviewed, build warning fix.
2875 * JavaScriptCore.gypi:
2877 2011-09-17 Oliver Hunt <oliver@apple.com>
2879 Remove special case handling of inline storage from the JIT
2880 https://bugs.webkit.org/show_bug.cgi?id=68319
2882 Reviewed by Gavin Barraclough.
2884 Simplify logic used for reading and writing to property storage
2885 by removing the special cases for inline storage. This has no
2888 * dfg/DFGRepatch.cpp:
2889 (JSC::DFG::generateProtoChainAccessStub):
2890 (JSC::DFG::tryBuildGetByIDList):
2892 * jit/JITPropertyAccess.cpp:
2893 (JSC::JIT::compilePutDirectOffset):
2894 (JSC::JIT::compileGetDirectOffset):
2895 (JSC::JIT::privateCompilePutByIdTransition):
2896 (JSC::JIT::privateCompileGetByIdSelfList):
2897 * jit/JITPropertyAccess32_64.cpp:
2898 (JSC::JIT::compilePutDirectOffset):
2899 (JSC::JIT::compileGetDirectOffset):
2900 (JSC::JIT::privateCompilePutByIdTransition):
2901 (JSC::JIT::privateCompileGetByIdSelfList):
2903 2011-09-17 Filip Pizlo <fpizlo@apple.com>
2905 DFG JIT does not have full block-local CSE
2906 https://bugs.webkit.org/show_bug.cgi?id=68316
2908 Reviewed by Oliver Hunt.
2910 This adds block-local CSE to the DFG. CSE runs in the propagator just after
2911 type propagation. It is part of the propagator itself because it needs to
2912 use the propagator's internal data structures to determine which operations
2913 may have side effects. Because it changes the live-ranges of nodes, the
2914 virtual register allocator had to be moved into the propagator so that it
2915 runs after CSE. To ensure that the back-end knows to keep the inputs to
2916 any eliminated node alive for OSR, a new node type, Phantom, was introduced.
2917 It is a no-op but prolonges the live-range of its inputs.
2919 This is an 80% speed-up on imaging-gaussian-blur, and a 10% speed-up on
2922 * JavaScriptCore.xcodeproj/project.pbxproj:
2923 * dfg/DFGAliasTracker.h: Removed.
2924 * dfg/DFGByteCodeParser.cpp:
2925 (JSC::DFG::ByteCodeParser::parseBlock):
2926 (JSC::DFG::ByteCodeParser::parse):
2928 (JSC::DFG::Graph::dump):
2930 (JSC::DFG::MethodCheckData::operator==):
2931 (JSC::DFG::MethodCheckData::operator!=):
2933 (JSC::DFG::Node::hasVirtualRegister):
2934 (JSC::DFG::Node::setRefCount):
2935 * dfg/DFGPropagator.cpp:
2936 (JSC::DFG::Propagator::Propagator):
2937 (JSC::DFG::Propagator::fixpoint):
2938 (JSC::DFG::Propagator::propagateNode):
2939 (JSC::DFG::Propagator::canonicalize):
2940 (JSC::DFG::Propagator::computeStartIndex):
2941 (JSC::DFG::Propagator::startIndex):
2942 (JSC::DFG::Propagator::pureCSE):
2943 (JSC::DFG::Propagator::globalVarLoadElimination):
2944 (JSC::DFG::Propagator::getByValLoadElimination):
2945 (JSC::DFG::Propagator::getMethodLoadElimination):
2946 (JSC::DFG::Propagator::performSubstitution):
2947 (JSC::DFG::Propagator::setReplacement):
2948 (JSC::DFG::Propagator::performNodeCSE):
2949 (JSC::DFG::Propagator::performBlockCSE):
2950 (JSC::DFG::Propagator::localCSE):
2951 (JSC::DFG::Propagator::allocateVirtualRegisters):
2952 (JSC::DFG::propagate):
2953 * dfg/DFGSpeculativeJIT.cpp:
2954 (JSC::DFG::SpeculativeJIT::compile):
2956 2011-09-16 Filip Pizlo <fpizlo@apple.com>
2958 method_check should repatch itself if it finds that the new structure(s)
2959 are the result of transitions from the old structure(s)
2960 https://bugs.webkit.org/show_bug.cgi?id=68294
2962 Reviewed by Gavin Barraclough.
2964 Previously a patched method_check would slow-path to get_by_id. Now it
2965 slow-paths to method_check_update, which attempts to correct the
2966 method_check due to structure transitions before bailing to get_by_id.
2968 This is a 1-2% speed-up on some benchmarks and is not a slow-down
2969 anywhere, leading to a 0.6% speed-up on the Kraken geomean.
2971 * jit/JITPropertyAccess.cpp:
2972 (JSC::JIT::patchMethodCallProto):
2974 (JSC::DEFINE_STUB_FUNCTION):
2976 * runtime/Structure.h:
2977 (JSC::Structure::transitivelyTransitionedFrom):
2979 2011-09-16 Ryosuke Niwa <rniwa@webkit.org>
2981 Touch Platform.h in the hope to fix SnowLeopard Intel Release (WebKit2 Tests).
2985 2011-09-16 Sam Weinig <sam@webkit.org>
2987 Rename APIValueWrapper type to APIValueWrapperType for consistency
2988 https://bugs.webkit.org/show_bug.cgi?id=68306
2990 Reviewed by Anders Carlsson.
2992 * runtime/JSAPIValueWrapper.h:
2993 (JSC::JSAPIValueWrapper::createStructure):
2997 Update name and un-indent.
2999 * runtime/Structure.h:
3000 (JSC::JSCell::isAPIValueWrapper):
3003 2011-09-16 Sam Weinig <sam@webkit.org>
3005 Remove unused isStrictModeFunction function
3006 https://bugs.webkit.org/show_bug.cgi?id=68305
3008 Reviewed by Anders Carlsson.
3010 * runtime/JSObject.h:
3011 (JSC::JSObject::isStrictModeFunction):
3013 2011-09-16 Sam Weinig <sam@webkit.org>
3015 Cleanup JSTypeInfo a bit
3016 https://bugs.webkit.org/show_bug.cgi?id=68289
3018 Reviewed by Anders Carlsson.
3020 * dfg/DFGOperations.cpp:
3022 (JSC::DEFINE_STUB_FUNCTION):
3023 Replace direct access to flags() with predicate.
3025 * runtime/JSObject.h:
3026 (JSC::JSFinalObject::createStructure):
3027 Pass FinalObjectType instead of using special IsJSFinalObject.
3029 * runtime/JSTypeInfo.h:
3030 (JSC::TypeInfo::TypeInfo):
3031 Add additional assert that you should no object should OverridesHasInstance but not have ImplementsHasInstance set.
3033 (JSC::TypeInfo::isFinalObject):
3036 (JSC::TypeInfo::masqueradesAsUndefined):
3037 (JSC::TypeInfo::implementsHasInstance):
3038 (JSC::TypeInfo::isEnvironmentRecord):
3039 (JSC::TypeInfo::overridesHasInstance):
3040 (JSC::TypeInfo::implementsDefaultHasInstance):
3041 (JSC::TypeInfo::overridesGetOwnPropertySlot):
3042 (JSC::TypeInfo::overridesVisitChildren):
3043 (JSC::TypeInfo::overridesGetPropertyNames):
3044 (JSC::TypeInfo::prohibitsPropertyCaching):
3045 (JSC::TypeInfo::isSetOnFlags1):
3046 (JSC::TypeInfo::isSetOnFlags2):
3047 Replace direct bit twiddling with helper functions.
3049 * runtime/Structure.cpp:
3050 (JSC::Structure::Structure):
3051 Use new isFinalObject() predicate.
3053 2011-09-16 Gavin Barraclough <barraclough@apple.com>
3055 Unsigned bit shift fails under certain conditions in 32 bit builds
3056 https://bugs.webkit.org/show_bug.cgi?id=68166
3058 Reviewed by Geoff Garen.
3060 The major bug here is that the slow case (which handles shifts of
3061 doubles) doesn't check for negative results from an unsigned shift
3062 (which should be unsigned, and as such can't be represented by a
3063 signed integer immediate). The implementation is also flawed for
3064 shifts by negative shift amounts (treats as shift by zero).
3066 * jit/JITArithmetic32_64.cpp:
3067 (JSC::JIT::emitRightShift):
3068 (JSC::JIT::emitRightShiftSlowCase):
3070 2011-09-16 Geoffrey Garen <ggaren@apple.com>
3072 Removed undetectable style.filter.
3074 Reviewed by Sam Weinig.
3076 This feature was added in http://trac.webkit.org/changeset/15557 to
3077 support housingmaps.com. But housingmaps.com no longer needs this hack,
3078 we don't know of other websites that need it, and we don't know of
3079 any other browsers that have implemented this feature.
3081 * GNUmakefile.list.am:
3082 * JavaScriptCore.gypi:
3083 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3084 * JavaScriptCore.xcodeproj/project.pbxproj:
3085 * runtime/JSTypeInfo.h:
3086 * runtime/StringObjectThatMasqueradesAsUndefined.h: Removed.
3088 2011-09-15 Sam Weinig <sam@webkit.org>
3090 Prepare JSTypes for more Object subtypes
3091 https://bugs.webkit.org/show_bug.cgi?id=68200
3093 Reviewed by Gavin Barraclough.
3095 * dfg/DFGJITCompiler.h:
3096 (JSC::DFG::JITCompiler::branchIfNotObject):
3097 * jit/JITInlineMethods.h:
3098 (JSC::JIT::emitJumpIfNotObject):
3099 * runtime/JSGlobalObject.h:
3100 (JSC::Structure::prototypeForLookup):
3101 * runtime/JSObject.h:
3102 (JSC::JSObject::finishCreation):
3104 * runtime/JSTypeInfo.h:
3105 (JSC::TypeInfo::type):
3106 (JSC::TypeInfo::isObject):
3107 (JSC::TypeInfo::isFinal):
3108 (JSC::TypeInfo::prohibitsPropertyCaching):
3109 * runtime/NativeErrorConstructor.h:
3110 (JSC::NativeErrorConstructor::finishCreation):
3111 * runtime/Operations.cpp:
3112 (JSC::jsIsObjectType):
3113 * runtime/Structure.cpp:
3114 (JSC::Structure::addPropertyTransitionToExistingStructure):
3115 (JSC::Structure::addPropertyTransition):
3116 * runtime/Structure.h:
3117 (JSC::Structure::isObject):
3118 (JSC::JSCell::isObject):
3120 2011-09-16 Geoffrey Garen <ggaren@apple.com>
3122 Rolled back in r95201 with test failure fixed.
3124 I missed two cases of jumpSlowToHot in rshift -- these cases need to be
3125 sure to initialize regT1 to the int tag, since it will otherwise hold
3126 the top 32 bits of a double.
3129 * jit/JITArithmetic32_64.cpp:
3130 (JSC::JIT::emit_op_lshift):
3131 (JSC::JIT::emitRightShift):
3132 (JSC::JIT::emitRightShiftSlowCase):
3133 (JSC::JIT::emit_op_bitand):
3134 (JSC::JIT::emit_op_bitor):
3135 (JSC::JIT::emit_op_bitxor):
3136 (JSC::JIT::emit_op_bitnot):
3137 (JSC::JIT::emit_op_post_inc):
3138 (JSC::JIT::emit_op_post_dec):
3139 (JSC::JIT::emit_op_pre_inc):
3140 (JSC::JIT::emit_op_pre_dec):
3141 * jit/JITInlineMethods.h:
3142 (JSC::JIT::emitStoreAndMapInt32):
3144 2011-09-16 Filip Pizlo <fpizlo@apple.com>
3146 Unreviewed Windows build fix after 95318.
3148 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3150 2011-09-16 Adam Roben <aroben@apple.com>
3152 Windows build fix after r95310
3154 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added include\private\JavaScriptCore to the
3155 include path so DFGIntrinsic.h can be found.
3157 2011-09-16 Gavin Barraclough <barraclough@apple.com>
3159 Rationalize JSObject::putDirect* methods
3160 https://bugs.webkit.org/show_bug.cgi?id=68274
3162 Reviewed by Sam Weinig.
3164 Delete the *Function variants. These are overall inefficient,
3165 in the way they get the name back from the function rather
3166 than just passing it in.
3168 * JavaScriptCore.exp:
3170 (GlobalObject::finishCreation):
3171 (GlobalObject::addFunction):
3172 * runtime/FunctionPrototype.cpp:
3173 (JSC::FunctionPrototype::addFunctionProperties):
3174 * runtime/JSGlobalObject.cpp:
3175 (JSC::JSGlobalObject::reset):
3176 * runtime/JSObject.cpp:
3177 (JSC::JSObject::put):
3178 (JSC::JSObject::putWithAttributes):
3179 (JSC::JSObject::defineGetter):
3180 (JSC::JSObject::defineSetter):
3181 * runtime/JSObject.h:
3182 (JSC::JSObject::putDirect):
3183 (JSC::JSObject::putDirectWithoutTransition):
3184 * runtime/Lookup.cpp:
3185 (JSC::setUpStaticFunctionSlot):
3189 2011-09-16 Filip Pizlo <fpizlo@apple.com>
3191 Unreviewed build fix for Windows.
3193 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3195 2011-09-16 Filip Pizlo <fpizlo@apple.com>
3197 Unreviewed build fix for non-DFG builds.
3199 * runtime/Executable.h:
3200 (JSC::NativeExecutable::finishCreation):
3202 2011-09-16 Filip Pizlo <fpizlo@apple.com>
3204 DFG JIT should inline Math.abs
3205 https://bugs.webkit.org/show_bug.cgi?id=68227
3207 Reviewed by Oliver Hunt.
3209 This adds the ability to track intrinsic functions throughout the
3210 host function infrastructure, so that the DFG can easily query
3211 whether or not a call's target is intrinsic, and if so, which
3214 On top of this, it adds Math.abs intrinsics to DFG. Call(Math.abs)
3215 is transformed into ValueToNumber<-ArithAbs nodes. These nodes
3216 then get optimized using the usual tricks.
3218 Also had to make a completely unrelated change to
3219 DateInstanceCache.h in order to fix a preexisting alphabetical
3220 sorting problem in JSGlobalData.h
3222 This results in a big win in imaging-gaussian-blur: 61% faster
3223 than before. The net win on Kraken is around 13%.
3225 * JavaScriptCore.xcodeproj/project.pbxproj:
3226 * create_hash_table:
3227 * dfg/DFGByteCodeParser.cpp:
3228 (JSC::DFG::ByteCodeParser::parseBlock):
3230 (JSC::DFG::Graph::isFunctionConstant):
3231 (JSC::DFG::Graph::valueOfFunctionConstant):
3232 * dfg/DFGIntrinsic.h: Added.
3233 * dfg/DFGJITCodeGenerator.h:
3234 (JSC::DFG::JITCodeGenerator::isFunctionConstant):
3235 (JSC::DFG::JITCodeGenerator::valueOfFunctionConstant):
3236 * dfg/DFGJITCompiler.h:
3237 (JSC::DFG::JITCompiler::isFunctionConstant):
3238 (JSC::DFG::JITCompiler::valueOfFunctionConstant):
3240 * dfg/DFGPropagator.cpp:
3241 (JSC::DFG::Propagator::propagateNode):
3242 * dfg/DFGSpeculativeJIT.cpp:
3243 (JSC::DFG::SpeculativeJIT::compile):
3245 (JSC::JITThunks::hostFunctionStub):
3247 * runtime/DateInstanceCache.h:
3248 * runtime/Executable.cpp:
3249 (JSC::ExecutableBase::intrinsic):
3250 (JSC::NativeExecutable::intrinsic):
3251 * runtime/Executable.h:
3252 (JSC::NativeExecutable::create):
3253 (JSC::NativeExecutable::finishCreation):
3254 * runtime/JSGlobalData.cpp:
3255 (JSC::JSGlobalData::getHostFunction):
3256 * runtime/JSGlobalData.h:
3257 * runtime/Lookup.cpp:
3258 (JSC::HashTable::createTable):
3259 (JSC::setUpStaticFunctionSlot):
3261 (JSC::HashEntry::initialize):
3262 (JSC::HashEntry::intrinsic):
3264 2011-09-16 Filip Pizlo <fpizlo@apple.com>
3266 REGRESSION: Reproducible crash below SlotVisitor::harvestWeakReferences
3267 using Domino's online ordering
3268 https://bugs.webkit.org/show_bug.cgi?id=68220
3270 Reviewed by Oliver Hunt.
3272 Weak handle processing can result in new objects being marked, which
3273 results in new WeakReferencesHarvesters being added. But weak
3274 reference harvesters are only processed before weak handle processing,
3275 so there's the risk that a weak reference harvester will persist
3276 until the next collection, by which time it may have been deleted.
3279 (JSC::Heap::markRoots):
3281 2011-09-16 Csaba Osztrogonác <ossy@webkit.org>
3283 REGRESSION(r95201): It made two tests fail
3284 https://bugs.webkit.org/show_bug.cgi?id=68230
3286 Unreviewed rolling out r95201.
3289 * jit/JITArithmetic32_64.cpp:
3290 (JSC::JIT::emit_op_lshift):
3291 (JSC::JIT::emitRightShift):
3292 (JSC::JIT::emit_op_bitand):
3293 (JSC::JIT::emit_op_bitor):
3294 (JSC::JIT::emit_op_bitxor):
3295 (JSC::JIT::emit_op_bitnot):
3296 (JSC::JIT::emit_op_post_inc):
3297 (JSC::JIT::emit_op_post_dec):
3298 (JSC::JIT::emit_op_pre_inc):
3299 (JSC::JIT::emit_op_pre_dec):
3300 * jit/JITInlineMethods.h:
3302 2011-09-15 Filip Pizlo <fpizlo@apple.com>
3304 DFG JIT does not optimize method_check
3305 https://bugs.webkit.org/show_bug.cgi?id=68215
3307 Reviewed by Oliver Hunt.
3309 MethodCallLinkInfo and StructureStubInfo are now searchable by
3310 bytecodeIndex, so that DFG::ByteCodeParser can use that information
3311 to determine how to optimize GetMethod.
3313 A new node op has been added to DFG: CheckMethod. This is a variant
3314 of GetMethod that has been optimized for the case that GetMethod
3315 always takes the fast path. CheckMethod results in only a very
3316 small amount of code (two loads and two branches in the worst case,
3317 one load and one branch in the best case). CheckMethod behaves as
3318 if it were a constant.
3320 Introduced the notion that a DFG node that is not JSConstant
3321 behaves as a constant. CheckMethod uses this functionality.
3323 This is a 3% speed-up on Kraken, and a small speed-up on V8.
3324 Appears to be neutral on SunSpider.
3326 * bytecode/CodeBlock.h:
3327 (JSC::getStructureStubInfoBytecodeIndex):
3328 (JSC::getMethodCallLinkInfoBytecodeIndex):
3329 * bytecode/PredictedType.cpp:
3330 (JSC::predictionFromCell):
3331 (JSC::predictionFromValue):
3332 * bytecode/PredictedType.h:
3333 * bytecode/StructureStubInfo.h:
3334 * dfg/DFGAliasTracker.h:
3335 (JSC::DFG::AliasTracker::recordGetMethod):
3336 * dfg/DFGByteCodeParser.cpp:
3337 (JSC::DFG::ByteCodeParser::parseBlock):
3339 (JSC::DFG::Graph::dump):
3341 (JSC::DFG::Graph::getMethodCheckPrediction):
3342 (JSC::DFG::Graph::getPrediction):
3343 (JSC::DFG::Graph::isConstant):
3344 (JSC::DFG::Graph::isJSConstant):
3345 (JSC::DFG::Graph::valueOfJSConstant):
3346 (JSC::DFG::Graph::valueOfInt32Constant):
3347 (JSC::DFG::Graph::valueOfNumberConstant):
3348 (JSC::DFG::Graph::valueOfBooleanConstant):
3349 (JSC::DFG::Graph::valueOfJSConstantNode):
3350 * dfg/DFGJITCodeGenerator.cpp:
3351 (JSC::DFG::JITCodeGenerator::fillInteger):
3352 (JSC::DFG::JITCodeGenerator::fillDouble):
3353 (JSC::DFG::JITCodeGenerator::fillJSValue):
3354 (JSC::DFG::JITCodeGenerator::isKnownNotInteger):
3355 (JSC::DFG::JITCodeGenerator::isKnownNotNumber):
3356 * dfg/DFGJITCodeGenerator.h:
3357 (JSC::DFG::JITCodeGenerator::silentSpillFPR):
3358 (JSC::DFG::JITCodeGenerator::silentFillGPR):
3359 (JSC::DFG::JITCodeGenerator::silentFillFPR):
3360 * dfg/DFGJITCompiler.cpp:
3361 (JSC::DFG::JITCompiler::fillNumericToDouble):
3362 (JSC::DFG::JITCompiler::fillInt32ToInteger):
3363 (JSC::DFG::JITCompiler::fillToJS):
3365 (JSC::DFG::Node::hasConstant):
3366 (JSC::DFG::Node::hasIdentifier):
3367 (JSC::DFG::Node::hasMethodCheckData):
3368 (JSC::DFG::Node::methodCheckDataIndex):
3369 (JSC::DFG::Node::valueOfJSConstant):
3370 * dfg/DFGPropagator.cpp:
3371 (JSC::DFG::Propagator::propagateNode):
3372 * dfg/DFGSpeculativeJIT.cpp:
3373 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
3374 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
3375 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
3376 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
3377 (JSC::DFG::SpeculativeJIT::compile):
3379 (JSC::JIT::privateCompile):
3381 (JSC::PropertyStubCompilationInfo::PropertyStubCompilationInfo):
3382 (JSC::MethodCallCompilationInfo::MethodCallCompilationInfo):
3383 * jit/JITPropertyAccess.cpp:
3384 (JSC::JIT::emit_op_method_check):
3385 (JSC::JIT::compileGetByIdHotPath):
3386 (JSC::JIT::emit_op_put_by_id):
3387 * jit/JITPropertyAccess32_64.cpp:
3388 (JSC::JIT::emit_op_method_check):
3389 (JSC::JIT::compileGetByIdHotPath):
3390 (JSC::JIT::emit_op_put_by_id):
3392 (JSC::JSCell::JSCell::structureAddress):
3394 2011-09-15 Adam Barth <abarth@webkit.org>
3396 Rename ENABLE(DATABASE) to ENABLE(SQL_DATABASE)
3397 https://bugs.webkit.org/show_bug.cgi?id=68205
3399 Reviewed by Eric Seidel.
3401 * Configurations/FeatureDefines.xcconfig:
3404 2011-09-15 Mark Hahnenberg <mhahnenberg@apple.com>
3406 Unzip initialization lists and constructors in JSCell hierarchy (7/7)
3407 https://bugs.webkit.org/show_bug.cgi?id=68122
3409 Reviewed by Geoffrey Garen.
3411 Completed the seventh and final level of the refactoring to add finishCreation()
3412 methods to all classes within the JSCell hierarchy with non-trivial
3415 JSCallbackObject was missed in previous patches due to the fact that
3416 it's non-obvious (at least to my script) that it is in the JSCell hierarchy, so
3417 this is just a bit of retroactive cleanup.
3419 * API/JSCallbackObject.h:
3420 (JSC::JSCallbackObject::create):
3421 * API/JSCallbackObjectFunctions.h:
3422 (JSC::::JSCallbackObject):
3424 2011-09-15 Filip Pizlo <fpizlo@apple.com>
3426 The DFG non-speculative JIT is no longer used and should be removed.
3427 https://bugs.webkit.org/show_bug.cgi?id=68177
3429 Reviewed by Geoffrey Garen.
3431 This removes the non-speculative JIT and everything that relied on it,
3432 including the ability to turn on DFG but not tiered compilation the,
3433 ability to perform speculation failure into non-speculative JIT code,
3434 and the ability to statically terminate speculation.
3436 * GNUmakefile.list.am:
3437 * JavaScriptCore.pro:
3438 * JavaScriptCore.xcodeproj/project.pbxproj:
3439 * bytecode/CodeBlock.h:
3440 * bytecompiler/BytecodeGenerator.cpp:
3441 (JSC::BytecodeGenerator::emitLoopHint):
3442 * dfg/DFGByteCodeParser.cpp:
3443 (JSC::DFG::ByteCodeParser::ByteCodeParser):
3444 (JSC::DFG::ByteCodeParser::getStrongPrediction):
3445 (JSC::DFG::ByteCodeParser::parseBlock):
3446 * dfg/DFGDriver.cpp:
3447 (JSC::DFG::compile):
3448 * dfg/DFGGenerationInfo.h:
3450 (JSC::DFG::Graph::predictArgumentTypes):
3451 * dfg/DFGJITCodeGenerator.cpp:
3452 * dfg/DFGJITCompiler.cpp:
3453 (JSC::DFG::JITCompiler::linkOSRExits):
3454 (JSC::DFG::JITCompiler::compileBody):
3455 * dfg/DFGJITCompiler.h:
3457 * dfg/DFGNonSpeculativeJIT.cpp: Removed.
3458 * dfg/DFGNonSpeculativeJIT.h: Removed.
3459 * dfg/DFGOSREntry.cpp:
3460 (JSC::DFG::prepareOSREntry):
3461 * dfg/DFGPropagator.cpp:
3462 * dfg/DFGPropagator.h:
3463 * dfg/DFGSpeculativeJIT.cpp:
3464 (JSC::DFG::SpeculativeJIT::compile):
3465 * dfg/DFGSpeculativeJIT.h:
3466 (JSC::DFG::SpeculativeJIT::osrExits):
3467 (JSC::DFG::SpeculativeJIT::speculationRecovery):
3468 (JSC::DFG::SpeculativeJIT::speculationCheck):
3469 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
3471 (JSC::JIT::privateCompileMainPass):
3472 (JSC::JIT::privateCompile):
3475 (JSC::JITCode::bottomTierJIT):
3476 * runtime/JSGlobalData.cpp:
3477 (JSC::JSGlobalData::JSGlobalData):
3478 (JSC::JSGlobalData::~JSGlobalData):
3479 * runtime/JSGlobalData.h:
3482 2011-09-15 Eric Seidel <eric@webkit.org>
3484 Remove ENABLE(SVG_AS_IMAGE) since all major ports have it on by default
3485 https://bugs.webkit.org/show_bug.cgi?id=68182
3487 Reviewed by Adam Barth.
3489 * Configurations/FeatureDefines.xcconfig:
3491 2011-09-15 Filip Pizlo <fpizlo@apple.com>
3493 DFG speculative JIT sometimes asserts that a value is not a number
3494 even when it doesn't know anything about the number
3495 https://bugs.webkit.org/show_bug.cgi?id=68189
3497 Reviewed by Oliver Hunt.
3499 * dfg/DFGGenerationInfo.h:
3500 (JSC::DFG::GenerationInfo::isUnknownJS):
3501 * dfg/DFGJITCodeGenerator.cpp:
3502 (JSC::DFG::JITCodeGenerator::isKnownNotNumber):
3504 2011-09-15 Filip Pizlo <fpizlo@apple.com>
3506 All of the functionality in the non-speculative JIT should be
3507 available to the speculative JIT via helper methods
3508 https://bugs.webkit.org/show_bug.cgi?id=68186
3510 Reviewed by Oliver Hunt.
3512 Stole all of the goodness from NonSpeculativeJIT and placed it
3513 in JITCodeGenerator. Left all of the badness (i.e. subtle code
3514 duplication with SpeculativeJIT, etc). This is in preparation
3515 for removing the NonSpeculativeJIT entirely, but having its
3516 goodness available for reuse in the SpeculativeJIT if necessary.
3518 * dfg/DFGJITCodeGenerator.cpp:
3519 (JSC::DFG::JITCodeGenerator::nonSpeculativeValueToNumber):
3520 (JSC::DFG::JITCodeGenerator::nonSpeculativeValueToInt32):
3521 (JSC::DFG::JITCodeGenerator::nonSpeculativeUInt32ToNumber):
3522 (JSC::DFG::JITCodeGenerator::nonSpeculativeKnownConstantArithOp):
3523 (JSC::DFG::JITCodeGenerator::nonSpeculativeBasicArithOp):
3524 (JSC::DFG::JITCodeGenerator::nonSpeculativeArithMod):
3525 (JSC::DFG::JITCodeGenerator::nonSpeculativeCheckHasInstance):
3526 (JSC::DFG::JITCodeGenerator::nonSpeculativeInstanceOf):
3527 * dfg/DFGJITCodeGenerator.h:
3528 (JSC::DFG::JITCodeGenerator::nonSpeculativeAdd):
3529 (JSC::DFG::JITCodeGenerator::nonSpeculativeArithSub):
3530 * dfg/DFGNonSpeculativeJIT.cpp:
3531 (JSC::DFG::NonSpeculativeJIT::compile):
3532 * dfg/DFGNonSpeculativeJIT.h:
3534 2011-09-15 Sheriff Bot <webkit.review.bot@gmail.com>
3536 Unreviewed, rolling out r95167.
3537 http://trac.webkit.org/changeset/95167
3538 https://bugs.webkit.org/show_bug.cgi?id=68191
3540 Patch needs further work. (Requested by mhahnenberg on
3543 * JavaScriptCore.exp:
3544 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3545 * runtime/JSCell.cpp:
3546 (JSC::JSCell::toBoolean):
3548 (JSC::JSCell::JSValue::toBoolean):
3549 * runtime/JSNotAnObject.cpp:
3550 (JSC::JSNotAnObject::toBoolean):
3551 * runtime/JSNotAnObject.h:
3552 * runtime/JSObject.h:
3553 * runtime/JSString.h:
3554 * runtime/StringObjectThatMasqueradesAsUndefined.h:
3555 (JSC::StringObjectThatMasqueradesAsUndefined::toBoolean):
3557 2011-09-15 Filip Pizlo <fpizlo@apple.com>
3559 Unreviewed build fix for platforms that expect a linkable symbol
3560 for primitive static const's.
3562 * bytecode/CodeBlock.h:
3564 (JSC::JIT::emitOptimizationCheck):
3566 2011-09-15 Filip Pizlo <fpizlo@apple.com>
3568 Unreviewed build fix for assertion on existence of alternative
3572 (JSC::DFG::Graph::predictArgumentTypes):
3574 2011-09-14 Filip Pizlo <fpizlo@apple.com>
3576 Value profiles collect no information for global variables
3577 https://bugs.webkit.org/show_bug.cgi?id=68143
3579 Reviewed by Geoffrey Garen.
3581 17% speed-up on string-fasta. Neutral elsewhere.
3583 * dfg/DFGByteCodeParser.cpp:
3584 (JSC::DFG::ByteCodeParser::getStrongPrediction):
3585 (JSC::DFG::ByteCodeParser::stronglyPredict):
3586 (JSC::DFG::ByteCodeParser::parseBlock):
3587 * jit/JITPropertyAccess.cpp:
3588 (JSC::JIT::emit_op_get_global_var):
3590 2011-09-15 Eric Seidel <eric@webkit.org>
3592 Remove ENABLE_SVG_ANIMATION as all major ports have it on by default
3593 https://bugs.webkit.org/show_bug.cgi?id=68022
3595 Reviewed by Ryosuke Niwa.
3597 * Configurations/FeatureDefines.xcconfig:
3599 2011-09-15 Gavin Barraclough <barraclough@apple.com>
3601 Ooops, revert accidentally commited unreviewed changes.
3603 * jit/JITOpcodes32_64.cpp:
3604 (JSC::JIT::emit_op_jfalse):
3605 (JSC::JIT::emit_op_jtrue):
3606 * jit/JSInterfaceJIT.h:
3607 * runtime/JSValue.h:
3609 2011-09-15 Sheriff Bot <webkit.review.bot@gmail.com>
3611 Unreviewed, rolling out r95163.
3612 http://trac.webkit.org/changeset/95163
3613 https://bugs.webkit.org/show_bug.cgi?id=68180
3615 [Qt] The QT_GCC_X variables were removed in Qt5 by accident.
3616 (Requested by darktears on #webkit).
3618 * JavaScriptCore.pro:
3620 2011-09-15 Gavin Barraclough <barraclough@apple.com>
3622 Windows build fix p1.
3624 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3625 * jit/JITOpcodes32_64.cpp:
3626 (JSC::JIT::emit_op_jfalse):
3627 (JSC::JIT::emit_op_jtrue):
3628 * jit/JSInterfaceJIT.h:
3629 * runtime/JSValue.h:
3631 2011-09-14 Filip Pizlo <fpizlo@apple.com>
3633 Tiered compilation should be enabled by default on platforms
3634 that support the DFG JIT
3635 https://bugs.webkit.org/show_bug.cgi?id=68136
3637 Reviewed by Sam Weinig.
3639 Neutral on SunSpider, 4% speed-up on V8, and 19% speed-up on
3640 Kraken. Large progressions on some benchmarks, including
3641 3x on imaging-desaturate.
3645 2011-09-15 Gavin Barraclough <barraclough@apple.com>
3647 devirtualize preventExtensions
3648 https://bugs.webkit.org/show_bug.cgi?id=68176
3650 Reviewed by Oliver Hunt.
3652 This is virtual due to problems in JSFunction putting the prototype
3653 property, but we can fix this problem a different way, just setting
3654 the checkReadOnly flag to false in the put.
3656 * runtime/JSFunction.cpp:
3657 (JSC::JSFunction::getOwnPropertySlot):
3658 * runtime/JSFunction.h:
3659 * runtime/JSObject.h:
3661 2011-09-15 Geoffrey Garen <ggaren@apple.com>
3663 Value chaining for JSValue32_64 bitops.
3665 Reviewed by Sam Weinig.
3667 SunSpider says 2.3% faster, v8 ~1% faster (mostly due to crypto).
3670 * jit/JITInlineMethods.h:
3671 (JSC::JIT::emitStoreAndMapInt32): New int32 helper function for stores
3672 that can chain their results, which is the common case.
3674 * jit/JITArithmetic32_64.cpp:
3675 (JSC::JIT::emit_op_lshift):
3676 (JSC::JIT::emitRightShift):
3677 (JSC::JIT::emit_op_bitand):
3678 (JSC::JIT::emit_op_bitor):
3679 (JSC::JIT::emit_op_bitxor):
3680 (JSC::JIT::emit_op_bitnot):
3681 (JSC::JIT::emit_op_pre_inc):
3682 (JSC::JIT::emit_op_pre_dec): Deployed new function.
3683 (JSC::JIT::emit_op_post_inc):
3684 (JSC::JIT::emit_op_post_dec): Had to reorder these functions so they
3685 computed their result values last, to make them elligible for chaining.
3687 2011-09-15 Adam Roben <aroben@apple.com>
3689 Clang build fix after r95172
3691 * dfg/DFGSpeculativeJIT.h:
3692 (JSC::DFG::SpeculativeJIT::shouldSpeculateFinalObject):
3693 (JSC::DFG::SpeculativeJIT::shouldSpeculateArray):
3694 Added parentheses to make precendence clear.
3696 2011-09-14 Filip Pizlo <fpizlo@apple.com>
3698 DFG does not speculate aggressively enough on comparisons
3699 https://bugs.webkit.org/show_bug.cgi?id=68138
3701 Reviewed by Oliver Hunt.
3703 This is a 75% speed-up on Kraken/ai-astar. It's a 1% win on
3704 V8 and an 8.5% win on Kraken. Neutral on SunSpider.
3706 * dfg/DFGSpeculativeJIT.cpp:
3707 (JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch):
3708 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
3709 (JSC::DFG::SpeculativeJIT::compileObjectEquality):
3710 (JSC::DFG::SpeculativeJIT::compare):
3711 * dfg/DFGSpeculativeJIT.h:
3712 (JSC::DFG::SpeculativeJIT::shouldSpeculateFinalObject):
3713 (JSC::DFG::SpeculativeJIT::shouldSpeculateArray):
3714 (JSC::DFG::SpeculativeJIT::shouldSpeculateObject):
3715 (JSC::DFG::SpeculativeJIT::shouldSpeculateCell):
3717 2011-09-14 Filip Pizlo <fpizlo@apple.com>
3719 DFG JIT does not leverage integer speculations on branches
3720 https://bugs.webkit.org/show_bug.cgi?id=68140
3722 Reviewed by Oliver Hunt.
3724 * dfg/DFGJITCodeGenerator.cpp:
3725 (JSC::DFG::JITCodeGenerator::isStrictInt32):
3726 * dfg/DFGJITCodeGenerator.h:
3727 * dfg/DFGSpeculativeJIT.cpp:
3728 (JSC::DFG::SpeculativeJIT::compile):
3730 2011-09-14 Gavin Barraclough <barraclough@apple.com>
3732 [n]stricteq code is bogus in JSValue32_64 JIT
3733 https://bugs.webkit.org/show_bug.cgi?id=68141
3735 Reviewed by Sam Weinig.
3737 The code tries to check for both ints or cells, but this check also
3738 catches cases where values that are undefined, null, etc (probably
3739 was incorrectly assuming cell was the 2nd highest tag?).
3741 Also, there is no need not to handle int on the fast path.
3742 stricteq is just a case of comparing the payloads, if we:
3743 * handle cases of differing tags on a slow path
3744 * handle doubles a slow path
3745 * handle both-are-string on a slow path
3747 * jit/JITOpcodes32_64.cpp:
3748 (JSC::JIT::compileOpStrictEq):
3749 (JSC::JIT::emitSlow_op_stricteq):
3750 (JSC::JIT::emitSlow_op_nstricteq):
3752 2011-09-14 Mark Hahnenberg <mhahnenberg@apple.com>
3754 Make JSCell::toBoolean non-virtual
3755 https://bugs.webkit.org/show_bug.cgi?id=67727
3757 Reviewed by Sam Weinig.
3759 JSCell::toBoolean now manually performs the toBoolean check for objects and strings (where
3760 before it was simply virtual and would crash if its implementation was called).
3761 Its descendants in JSObject and JSString have also been made non-virtual. JSCell now
3762 explicitly covers all cases of toBoolean, so having a virtual implementation of
3763 JSCell::toBoolean is no longer necessary. This is part of a larger process of un-virtualizing JSCell.
3765 * JavaScriptCore.exp:
3766 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3767 * runtime/JSCell.cpp:
3769 * runtime/JSNotAnObject.cpp:
3770 * runtime/JSNotAnObject.h:
3771 * runtime/JSObject.h:
3772 * runtime/JSString.h:
3773 (JSC::JSCell::toBoolean):
3774 (JSC::JSValue::toBoolean):
3775 * runtime/StringObjectThatMasqueradesAsUndefined.h:
3777 2011-09-14 Alexis Menard <alexis.menard@openbossa.org>
3779 [Qt] Replace QT_GCC_X as they don't exist in Qt5 anymore.
3780 https://bugs.webkit.org/show_bug.cgi?id=68114
3782 Reviewed by Kenneth Rohde Christiansen.
3784 Use the new GCC_X variables defined in WebKit.pri to replace
3785 the usage of QT_GCC_X.
3787 * JavaScriptCore.pro:
3789 2011-09-14 Sheriff Bot <webkit.review.bot@gmail.com>
3791 Unreviewed, rolling out r95145.
3792 http://trac.webkit.org/changeset/95145
3793 https://bugs.webkit.org/show_bug.cgi?id=68139
3795 The GTK+ build is working now, so revert this trial build fix.
3796 (Requested by mrobinson on #webkit).
3798 * GNUmakefile.list.am:
3800 2011-09-14 Patrick Gansterer <paroga@webkit.org>
3802 Port MachineStackMarker to Windows ARM and MIPS
3803 https://bugs.webkit.org/show_bug.cgi?id=68068
3805 Reviewed by Geoffrey Garen.
3807 Use the correct memeber of the CONTEXT struct for the stackpointer for CPU(ARM) and CPU(MIPS).
3808 Only query CONTEXT_INTEGER and CONTEXT_CONTROL, since CONTEXT_SEGMENTS isn't defined for
3809 CPU(ARM) and CPU(MIPS) and the stackpointer is defined in the CONTEXT_CONTROL section for
3810 CPU(ARM), CPU(X86) and CPU(X86_64) and in the CONTEXT_INTEGER section for CPU(MIPS).
3812 * heap/MachineStackMarker.cpp:
3813 (JSC::getPlatformThreadRegisters):
3814 (JSC::otherThreadStackPointer):
3816 2011-09-12 Filip Pizlo <fpizlo@apple.com>
3818 DFG JIT always speculates that ValueAdd is a numeric addition
3819 https://bugs.webkit.org/show_bug.cgi?id=67956
3821 Reviewed by Geoffrey Garen.
3823 * dfg/DFGJITCodeGenerator.cpp:
3824 (JSC::DFG::JITCodeGenerator::isKnownNotNumber):
3825 * dfg/DFGJITCodeGenerator.h:
3826 * dfg/DFGNonSpeculativeJIT.cpp:
3827 (JSC::DFG::NonSpeculativeJIT::knownConstantArithOp):
3828 (JSC::DFG::NonSpeculativeJIT::basicArithOp):
3829 * dfg/DFGOperations.cpp:
3830 * dfg/DFGOperations.h:
3831 * dfg/DFGSpeculativeJIT.cpp:
3832 (JSC::DFG::SpeculativeJIT::compile):
3833 * dfg/DFGSpeculativeJIT.h:
3834 (JSC::DFG::SpeculativeJIT::shouldSpeculateNumber):
3836 2011-09-14 Anders Carlsson <andersca@apple.com>
3838 Stop building BinarySemaphore to see if that's what's breaking the GTK+ build.
3840 * GNUmakefile.list.am:
3842 2011-09-14 Anders Carlsson <andersca@apple.com>
3844 This is getting old. Yet another build fix attempt.
3846 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
3848 2011-09-14 Anders Carlsson <andersca@apple.com>
3850 Yet another build fix attempt.
3852 * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
3854 2011-09-14 Anders Carlsson <andersca@apple.com>
3856 How I "love" Visual Studio...
3858 Try to fix build again.
3860 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
3862 2011-09-14 Anders Carlsson <andersca@apple.com>
3864 Try to fix Windows build.
3866 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
3868 2011-09-14 Anders Carlsson <andersca@apple.com>
3870 Add BinarySemaphore class from WebKit2 to WTF
3871 https://bugs.webkit.org/show_bug.cgi?id=68132
3873 Reviewed by Sam Weinig.
3875 * GNUmakefile.list.am:
3876 * JavaScriptCore.gypi:
3877 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3878 * JavaScriptCore.xcodeproj/project.pbxproj:
3879 * wtf/CMakeLists.txt:
3880 Update build systems.
3882 * wtf/threads: Added.
3883 * wtf/threads/BinarySemaphore.cpp: Copied from Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp.
3884 * wtf/threads/BinarySemaphore.h: Copied from Source/WebKit2/Platform/CoreIPC/BinarySemaphore.h.
3885 * wtf/threads/win: Added.
3886 * wtf/threads/win/BinarySemaphoreWin.cpp: Copied from Source/WebKit2/Platform/CoreIPC/win/BinarySemaphoreWin.cpp.
3888 2011-09-14 Filip Pizlo <fpizlo@apple.com>
3890 Unreviewed build fix for Interpreter.
3892 * interpreter/Interpreter.cpp:
3893 (JSC::Interpreter::privateExecute):
3895 2011-09-14 Anders Carlsson <andersca@apple.com>
3897 Add wtf/threads and wtf/threads/win, so we can be sure that the EWS
3898 bots can correctly build the patch in https://bugs.webkit.org/show_bug.cgi?id=68132
3900 Rubber-stamped by Sam Weinig.
3902 * wtf/threads: Added.
3903 * wtf/threads/win: Added.
3905 2011-09-14 Filip Pizlo <fpizlo@apple.com>
3907 DFG JIT should not speculate integer if the value is always going to be
3908 used as a double anyway
3909 https://bugs.webkit.org/show_bug.cgi?id=68127
3911 Reviewed by Oliver Hunt.
3913 Added a ValueToDouble node, which is a variant of ValueToNumber that
3914 hints that it will only be used as a double and never as an integer.
3915 Thus, it turns off integer speculation even if the value profiler
3916 told us that the value source is an int. The logic for converting a
3917 ValueToNumber into a ValueToDouble is found in Propagator.
3919 This appears to be a 22% speed-up in imaging-darkroom.
3922 * dfg/DFGNonSpeculativeJIT.cpp:
3923 (JSC::DFG::NonSpeculativeJIT::compile):
3924 * dfg/DFGPropagator.cpp:
3925 (JSC::DFG::Propagator::fixpoint):
3926 (JSC::DFG::Propagator::toDouble):
3927 (JSC::DFG::Propagator::fixupNode):
3928 (JSC::DFG::Propagator::fixup):
3929 * dfg/DFGSpeculativeJIT.cpp:
3930 (JSC::DFG::SpeculativeJIT::compile):
3931 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
3933 2011-09-14 Filip Pizlo <fpizlo@apple.com>
3935 Tiered compilation heuristics do not account for value profile fullness
3936 https://bugs.webkit.org/show_bug.cgi?id=68116
3938 Reviewed by Oliver Hunt.
3940 Tiered compilation avoids invoking the DFG JIT if it finds that value
3941 profiles contain insufficient information. Instead, it produces a
3942 prediction from the current value profile, and then clears the value
3943 profile. This allows the value profile to heat up from scratch for
3944 some number of additional executions. The new profiles will then be
3945 merged with the previous prediction. Once the amount of information
3946 in predictions is enough according to heuristics in CodeBlock.cpp,
3947 DFG optimization is allowed to proceed.
3950 * GNUmakefile.list.am:
3951 * JavaScriptCore.pro:
3952 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3953 * JavaScriptCore.xcodeproj/project.pbxproj:
3954 * bytecode/CodeBlock.cpp:
3955 (JSC::CodeBlock::CodeBlock):
3956 (JSC::CodeBlock::~CodeBlock):
3957 (JSC::CodeBlock::visitAggregate):
3958 (JSC::CodeBlock::visitWeakReferences):
3959 (JSC::CodeBlock::shouldOptimizeNow):
3960 (JSC::CodeBlock::dumpValueProfiles):
3961 * bytecode/CodeBlock.h:
3962 * bytecode/PredictedType.cpp:
3963 (JSC::predictionToString):
3964 * bytecode/PredictedType.h:
3965 * bytecode/ValueProfile.cpp: Added.
3966 (JSC::ValueProfile::computeStatistics):
3967 (JSC::ValueProfile::computeUpdatedPrediction):
3968 * bytecode/ValueProfile.h:
3969 (JSC::ValueProfile::ValueProfile):
3970 (JSC::ValueProfile::classInfo):
3971 (JSC::ValueProfile::numberOfSamples):
3972 (JSC::ValueProfile::totalNumberOfSamples):
3973 (JSC::ValueProfile::isLive):
3974 (JSC::ValueProfile::numberOfInt32s):
3975 (JSC::ValueProfile::numberOfDoubles):
3976 (JSC::ValueProfile::numberOfBooleans):
3977 (JSC::ValueProfile::dump):
3978 (JSC::getValueProfileBytecodeOffset):
3979 * dfg/DFGByteCodeParser.cpp:
3980 (JSC::DFG::ByteCodeParser::stronglyPredict):
3982 (JSC::DFG::Graph::predictArgumentTypes):
3983 * dfg/DFGJITCompiler.cpp:
3984 (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
3985 (JSC::DFG::JITCompiler::jumpFromSpeculativeToNonSpeculative):
3987 (JSC::JIT::emitOptimizationCheck):
3988 * jit/JITInlineMethods.h:
3989 (JSC::JIT::emitValueProfilingSite):
3991 (JSC::DEFINE_STUB_FUNCTION):
3993 2011-09-14 Filip Pizlo <fpizlo@apple.com>
3995 DFG should not speculate that the child of LogicalNot is a boolean if
3996 predictions tell us otherwise
3997 https://bugs.webkit.org/show_bug.cgi?id=68118
3999 Reviewed by Geoffrey Garen.
4001 * dfg/DFGJITCodeGenerator.cpp:
4002 (JSC::DFG::JITCodeGenerator::nonSpeculativeLogicalNot):
4003 * dfg/DFGJITCodeGenerator.h:
4004 * dfg/DFGNonSpeculativeJIT.cpp:
4005 (JSC::DFG::NonSpeculativeJIT::compile):
4006 * dfg/DFGSpeculativeJIT.cpp:
4007 (JSC::DFG::SpeculativeJIT::compile):
4009 2011-09-14 Filip Pizlo <fpizlo@apple.com>
4011 Unreviewed build fix. Turn off tiered compilation.
4015 2011-09-13 Filip Pizlo <fpizlo@apple.com>
4017 Prediction tracking is not precise enough
4018 https://bugs.webkit.org/show_bug.cgi?id=67993
4020 Reviewed by Oliver Hunt.
4022 Added a richer set of type predictions, including JSFinalObject, JSString,
4023 object that is not a JSFinalObject or JSArray (ObjectOther), some object
4024 but we don't or care know what kind (SomeObject), definitely an object,
4025 cell that is not an object or JSString, an value that is none of the above
4026 (so either Undefined or Null). Made the propagator and value profiler work
4029 Performance is neutral, because the DFG JIT does not take advantage of this
4032 In the process of writing predictionToString() (which is now considerably
4033 more complex) I decided to finally add a BoundsCheckedPointer, which
4034 should come in handy in other places, like at least the OSR scratch buffer
4035 and the CompactJITCodeMap. It's great for cases where you want to
4036 do pointer arithmetic, you want to have assertions about the
4037 pointer not going out of bounds, but you don't want to write those
4038 assertions yourself.
4040 This also required refactoring inherits(), since the ValueProfiler may
4041 want to do the equivalent of inherits() but given two ClassInfo's.
4043 * GNUmakefile.list.am:
4044 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
4045 * JavaScriptCore.xcodeproj/project.pbxproj:
4046 * bytecode/PredictedType.cpp: Added.
4047 (JSC::predictionToString):
4048 (JSC::makePrediction):