1 2014-03-28 Michael Saboff <msaboff@apple.com>
3 Unreviewed, rolling r166248 back in.
5 Turns out r166070 didn't cause a 2% performance loss in page load times
9 Unreviewed, rolling out r166126.
10 Rollout r166126 in prepartion to roll out prerequisite r166070
12 2014-03-27 Commit Queue <commit-queue@webkit.org>
14 Unreviewed, rolling out r166376.
15 https://bugs.webkit.org/show_bug.cgi?id=130887
17 This was a misguided optimization. (Requested by kling on
22 "Avoid fetching JSObject::structure() repeatedly in
24 https://bugs.webkit.org/show_bug.cgi?id=130857
25 http://trac.webkit.org/changeset/166376
27 2014-03-27 Oliver Hunt <oliver@apple.com>
29 Support spread operand in |new| expressions
30 https://bugs.webkit.org/show_bug.cgi?id=130877
32 Reviewed by Michael Saboff.
34 Add support for the spread operator being applied in
35 |new| expressions. This required adding support for
36 a new opcode, op_construct_varargs. This is a relatively
37 simple refactoring of the call_varargs implementation.
39 * bytecode/BytecodeList.json:
40 * bytecode/BytecodeUseDef.h:
41 (JSC::computeUsesForBytecodeOffset):
42 (JSC::computeDefsForBytecodeOffset):
43 * bytecode/CallLinkInfo.cpp:
44 (JSC::CallLinkInfo::unlink):
45 * bytecode/CallLinkInfo.h:
46 (JSC::CallLinkInfo::callTypeFor):
47 (JSC::CallLinkInfo::specializationKind):
48 * bytecode/CodeBlock.cpp:
49 (JSC::CodeBlock::dumpBytecode):
50 (JSC::CodeBlock::CodeBlock):
51 * bytecompiler/BytecodeGenerator.cpp:
52 (JSC::BytecodeGenerator::emitCallVarargs):
53 (JSC::BytecodeGenerator::emitConstructVarargs):
54 (JSC::BytecodeGenerator::emitConstruct):
55 * bytecompiler/BytecodeGenerator.h:
57 (JSC::JIT::privateCompileMainPass):
58 (JSC::JIT::privateCompileSlowCases):
61 (JSC::JIT::compileOpCall):
62 (JSC::JIT::compileOpCallSlowCase):
63 (JSC::JIT::emit_op_construct_varargs):
64 (JSC::JIT::emitSlow_op_construct_varargs):
65 * jit/JITCall32_64.cpp:
66 (JSC::JIT::emitSlow_op_construct_varargs):
67 (JSC::JIT::emit_op_construct_varargs):
68 (JSC::JIT::compileOpCall):
69 (JSC::JIT::compileOpCallSlowCase):
70 * jit/JITOperations.cpp:
71 * llint/LLIntSlowPaths.cpp:
72 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
73 * llint/LLIntSlowPaths.h:
74 * llint/LowLevelInterpreter.asm:
76 (JSC::Parser<LexerType>::parseMemberExpression):
78 2014-03-27 Filip Pizlo <fpizlo@apple.com>
80 Revert http://trac.webkit.org/changeset/166386 because it broke builds.
82 * Configurations/Base.xcconfig:
83 * Configurations/LLVMForJSC.xcconfig:
85 2014-03-27 Filip Pizlo <fpizlo@apple.com>
87 Unreviewed, skip this test for now.
89 * tests/stress/recurse-infinitely-on-getter.js:
91 2014-03-27 Filip Pizlo <fpizlo@apple.com>
93 Switch the LLVMForJSC target to using the LLVM in /usr/local rather than /usr/local/LLVMForJavaScriptCore on iOS
94 https://bugs.webkit.org/show_bug.cgi?id=130867
95 <rdar://problem/16432456>
97 Reviewed by Mark Hahnenberg.
99 * Configurations/Base.xcconfig:
100 * Configurations/LLVMForJSC.xcconfig:
102 2014-03-27 Andreas Kling <akling@apple.com>
104 Avoid fetching JSObject::structure() repeatedly in putDirectInternal.
105 <https://webkit.org/b/130857>
107 Use the cached Structure* instead of re-fetching it over and over since
108 that's a non-trivial operation these days.
110 Reviewed by Mark Hahnenberg.
112 * runtime/JSObject.h:
113 (JSC::JSObject::putDirectInternal):
115 2014-03-27 Mark Hahnenberg <mhahnenberg@apple.com>
117 Check the remembered set bit faster
118 https://bugs.webkit.org/show_bug.cgi?id=130860
120 Reviewed by Oliver Hunt.
122 Currently we look up the remembered set bit in the MarkedBlock in C++ code, but
123 that bit is also stored in the object. We should look it up there whenever possible.
125 * heap/CopiedBlockInlines.h:
126 (JSC::CopiedBlock::shouldReportLiveBytes):
128 (JSC::Heap::addToRememberedSet):
130 * heap/HeapInlines.h: Removed.
131 * heap/SlotVisitorInlines.h:
132 (JSC::SlotVisitor::reportExtraMemoryUsage):
134 2014-03-27 Joseph Pecoraro <pecoraro@apple.com>
136 Web Inspector: Provide SPI to disallow remote inspection of a JSContext
137 https://bugs.webkit.org/show_bug.cgi?id=130853
139 Reviewed by Timothy Hatcher.
141 * API/JSContextPrivate.h: Added.
143 (-[JSContext _remoteInspectionEnabled]):
144 (-[JSContext _setRemoteInspectionEnabled:]):
145 ObjC SPI to enable/disable remote inspection.
147 * API/JSContextRefPrivate.h:
148 * API/JSContextRef.cpp:
149 (JSGlobalContextGetRemoteInspectionEnabled):
150 (JSGlobalContextSetRemoteInspectionEnabled):
151 C SPI to enable/disable remote inspection.
153 * JavaScriptCore.xcodeproj/project.pbxproj:
154 Add new private header, and export as a private header.
156 2014-03-27 Mark Hahnenberg <mhahnenberg@apple.com>
158 Clean up questionable style in ScriptExecutable::prepareForExecutionImpl
159 https://bugs.webkit.org/show_bug.cgi?id=130845
161 Reviewed by Filip Pizlo.
163 There was a hack added to make sure C Loop LLInt worked which included overriding the
164 global Options::useLLInt setting, which makes no sense to do here. We should put the
165 update of the global setting in Options::recomputeDependentOptions along with the other
166 execution engine flags.
168 * runtime/Executable.cpp:
169 (JSC::ScriptExecutable::prepareForExecutionImpl):
170 * runtime/Options.cpp:
171 (JSC::recomputeDependentOptions):
173 2014-03-26 Filip Pizlo <fpizlo@apple.com>
175 Enable LLVM stackmap liveOuts computation
176 https://bugs.webkit.org/show_bug.cgi?id=130821
178 Reviewed by Andy Estes and Sam Weinig.
180 * ftl/FTLStackMaps.cpp:
181 (JSC::FTL::StackMaps::Record::dump):
182 * llvm/library/LLVMExports.cpp:
183 (initializeAndGetJSCLLVMAPI):
185 2014-03-26 Filip Pizlo <fpizlo@apple.com>
187 Parse stackmaps liveOuts
188 https://bugs.webkit.org/show_bug.cgi?id=130801
190 Reviewed by Geoffrey Garen.
192 This just adds the code to parse them but doesn't do anything with them, yet.
194 * ftl/FTLLocation.cpp:
195 (JSC::FTL::Location::forStackmaps):
197 (JSC::FTL::Location::forRegister):
198 (JSC::FTL::Location::forIndirect):
199 * ftl/FTLStackMaps.cpp:
200 (JSC::FTL::StackMaps::Location::parse):
201 (JSC::FTL::StackMaps::Location::dump):
202 (JSC::FTL::StackMaps::LiveOut::parse):
203 (JSC::FTL::StackMaps::LiveOut::dump):
204 (JSC::FTL::StackMaps::Record::parse):
205 (JSC::FTL::StackMaps::Record::dump):
206 * ftl/FTLStackMaps.h:
208 2014-03-26 Mark Lam <mark.lam@apple.com>
210 Build fix after r166307.
215 - The inline function isAPIValueWrapper() should not be exported. This
216 was causing a linkage error when building for 32-bit x86 on Mac.
218 2014-03-26 Filip Pizlo <fpizlo@apple.com>
220 Reasoning about DWARF register numbers should be moved out of FTL::Location
221 https://bugs.webkit.org/show_bug.cgi?id=130792
223 Reviewed by Oliver Hunt.
225 Moving this code makes it possible for things other than FTL::Location to reason about
226 DWARF register encoding. This refactoring also appears to reduce some code duplication
227 and makes FTLLocation.cpp cleaner.
229 * JavaScriptCore.xcodeproj/project.pbxproj:
230 * ftl/FTLCompile.cpp:
231 (JSC::FTL::fixFunctionBasedOnStackMaps):
232 * ftl/FTLDWARFRegister.cpp: Added.
233 (JSC::FTL::DWARFRegister::reg):
234 (JSC::FTL::DWARFRegister::dump):
235 * ftl/FTLDWARFRegister.h: Added.
236 (JSC::FTL::DWARFRegister::DWARFRegister):
237 (JSC::FTL::DWARFRegister::dwarfRegNum):
238 * ftl/FTLLocation.cpp:
239 (JSC::FTL::Location::dump):
240 (JSC::FTL::Location::isGPR):
241 (JSC::FTL::Location::gpr):
242 (JSC::FTL::Location::isFPR):
243 (JSC::FTL::Location::fpr):
245 (JSC::FTL::Location::hasDwarfReg):
246 (JSC::FTL::Location::dwarfReg):
248 2014-03-26 Brent Fulgham <bfulgham@apple.com>
250 Unreviewed build fix.
252 * runtime/JSCell.h: VS2013 confused about argument type.
254 2014-03-26 Zoltan Horvath <zoltan@webkit.org>
256 [CSS Shapes] Remove shape-inside support
257 https://bugs.webkit.org/show_bug.cgi?id=130698
259 Reviewed by David Hyatt.
261 * Configurations/FeatureDefines.xcconfig:
263 2014-03-26 Dániel Bátyai <dbatyai.u-szeged@partner.samsung.com>
265 Rename hasFastArrayStorage to be more appropriate
266 https://bugs.webkit.org/show_bug.cgi?id=130773
268 Reviewed by Filip Pizlo.
270 * dfg/DFGArrayMode.cpp:
271 (JSC::DFG::ArrayMode::alreadyChecked):
272 * dfg/DFGSpeculativeJIT32_64.cpp:
273 (JSC::DFG::SpeculativeJIT::compile):
274 * dfg/DFGSpeculativeJIT64.cpp:
275 (JSC::DFG::SpeculativeJIT::compile):
276 * dfg/DFGWatchpointCollectionPhase.cpp:
277 (JSC::DFG::WatchpointCollectionPhase::handle):
278 * ftl/FTLLowerDFGToLLVM.cpp:
279 (JSC::FTL::LowerDFGToLLVM::compileNewArray):
280 (JSC::FTL::LowerDFGToLLVM::compileNewArrayBuffer):
281 (JSC::FTL::LowerDFGToLLVM::compileNewArrayWithSize):
282 * runtime/ButterflyInlines.h:
283 (JSC::Butterfly::unshift):
284 (JSC::Butterfly::shift):
285 * runtime/IndexingHeaderInlines.h:
286 (JSC::IndexingHeader::preCapacity):
287 * runtime/IndexingType.h:
288 (JSC::hasArrayStorage):
289 (JSC::hasAnyArrayStorage):
290 (JSC::hasFastArrayStorage): Deleted.
291 * runtime/JSArray.cpp:
292 (JSC::JSArray::sortVector):
293 (JSC::JSArray::compactForSorting):
295 (JSC::JSArray::create):
296 (JSC::JSArray::tryCreateUninitialized):
297 * runtime/JSGlobalObject.cpp:
298 * runtime/JSObject.cpp:
299 (JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage):
300 * runtime/JSObject.h:
301 (JSC::JSObject::ensureArrayStorage):
302 (JSC::JSObject::arrayStorage):
303 * runtime/StructureTransitionTable.h:
304 (JSC::newIndexingType):
306 2014-03-26 Zan Dobersek <zdobersek@igalia.com>
308 Unreviewed. Removing the remaining Automake cruft.
310 * GNUmakefile.list.am: Removed.
312 2014-03-25 Filip Pizlo <fpizlo@apple.com>
314 Arguments simplification phase should be fine with marking the arguments local itself as an arguments alias
315 https://bugs.webkit.org/show_bug.cgi?id=130764
316 <rdar://problem/16304788>
318 Reviewed by Sam Weinig.
320 Being an arguments alias just means that your OSR exit recovery should attempt arguments
321 creation. This is true of arguments locals. We had special cases that tried to make it not
322 true of arguments locals. The only consequence of those special cases was to cause crashes
323 in case of arguments that are also captured variables (i.e. we have SlowArguments). This
324 change just removes those special cases.
326 This change means that the FTL will now see SetLocals with a FlushedArguments format.
327 Previously you wouldn't see them because previously only non-captured variable would be
328 arguments aliases, and non-captured variables get completely SSAified - i.e. no SetLocals
329 left. Adding handling for FlushedArguments is a benign and simple change since its
330 behavior is identical to FlushedJSValue for that code's purposes.
332 * dfg/DFGArgumentsSimplificationPhase.cpp:
333 (JSC::DFG::ArgumentsSimplificationPhase::run):
334 * ftl/FTLLowerDFGToLLVM.cpp:
335 (JSC::FTL::LowerDFGToLLVM::compileSetLocal):
336 * tests/stress/captured-arguments-variable.js: Added.
340 2014-03-25 Mark Hahnenberg <mhahnenberg@apple.com>
343 https://bugs.webkit.org/show_bug.cgi?id=130759
345 Reviewed by Filip Pizlo.
347 * GNUmakefile.list.am:
348 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
349 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
350 * JavaScriptCore.xcodeproj/project.pbxproj:
352 (JSC::MarkedBlockSnapshotFunctor::MarkedBlockSnapshotFunctor):
353 (JSC::MarkedBlockSnapshotFunctor::operator()):
354 * heap/Heap.h: Also reindented while we're here.
355 (JSC::Heap::writeBarrierBuffer):
357 (JSC::Heap::objectSpace):
358 (JSC::Heap::machineThreads):
359 (JSC::Heap::operationInProgress):
360 (JSC::Heap::allocatorForObjectWithoutDestructor):
361 (JSC::Heap::allocatorForObjectWithNormalDestructor):
362 (JSC::Heap::allocatorForObjectWithImmortalStructureDestructor):
363 (JSC::Heap::storageAllocator):
364 (JSC::Heap::notifyIsSafeToCollect):
365 (JSC::Heap::isSafeToCollect):
366 (JSC::Heap::handleSet):
367 (JSC::Heap::handleStack):
368 (JSC::Heap::lastFullGCLength):
369 (JSC::Heap::lastEdenGCLength):
370 (JSC::Heap::increaseLastFullGCLength):
371 (JSC::Heap::sizeBeforeLastEdenCollection):
372 (JSC::Heap::sizeAfterLastEdenCollection):
373 (JSC::Heap::sizeBeforeLastFullCollection):
374 (JSC::Heap::sizeAfterLastFullCollection):
375 (JSC::Heap::jitStubRoutines):
376 (JSC::Heap::isDeferred):
377 (JSC::Heap::structureIDTable):
378 (JSC::Heap::removeCodeBlock):
379 * heap/HeapInlines.h: Added.
380 (JSC::Heap::shouldCollect):
382 (JSC::Heap::isCollecting):
385 (JSC::Heap::isInRememberedSet):
386 (JSC::Heap::isMarked):
387 (JSC::Heap::testAndSetMarked):
388 (JSC::Heap::setMarked):
389 (JSC::Heap::isWriteBarrierEnabled):
390 (JSC::Heap::writeBarrier):
391 (JSC::Heap::reportExtraMemoryCost):
392 (JSC::Heap::forEachProtectedCell):
393 (JSC::Heap::forEachCodeBlock):
394 (JSC::Heap::allocateWithNormalDestructor):
395 (JSC::Heap::allocateWithImmortalStructureDestructor):
396 (JSC::Heap::allocateWithoutDestructor):
397 (JSC::Heap::tryAllocateStorage):
398 (JSC::Heap::tryReallocateStorage):
399 (JSC::Heap::ascribeOwner):
400 (JSC::Heap::blockAllocator):
401 (JSC::Heap::releaseSoon):
402 (JSC::Heap::incrementDeferralDepth):
403 (JSC::Heap::decrementDeferralDepth):
404 (JSC::Heap::collectIfNecessaryOrDefer):
405 (JSC::Heap::decrementDeferralDepthAndGCIfNeeded):
406 (JSC::Heap::markListSet):
407 * runtime/JSCInlines.h:
409 2014-03-25 Filip Pizlo <fpizlo@apple.com>
411 DFG::ByteCodeParser::SetMode should distinguish between setting immediately without a flush and setting immediately with a flush
412 https://bugs.webkit.org/show_bug.cgi?id=130760
414 Reviewed by Mark Hahnenberg.
416 * dfg/DFGByteCodeParser.cpp:
417 (JSC::DFG::ByteCodeParser::setLocal):
418 (JSC::DFG::ByteCodeParser::setArgument):
419 (JSC::DFG::ByteCodeParser::handleInlining):
420 (JSC::DFG::ByteCodeParser::parseBlock):
421 * tests/stress/assign-argument-in-inlined-call.js: Added.
426 * tests/stress/assign-captured-argument-in-inlined-call.js: Added.
431 2014-03-25 Filip Pizlo <fpizlo@apple.com>
433 Fix 32-bit getter call alignment.
435 Reviewed by Mark Hahnenberg.
438 (JSC::generateGetByIdStub):
440 2014-03-25 Filip Pizlo <fpizlo@apple.com>
442 Repatch should plant calls to getters directly rather than through a C helper
443 https://bugs.webkit.org/show_bug.cgi?id=129589
445 Reviewed by Mark Hahnenberg.
447 As the title says. All of the superstructure for this was already in place, so now it
448 was just a matter of actually emitting the call.
450 8x speed-up for getter microbenchmarks.
453 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
454 * JavaScriptCore.xcodeproj/project.pbxproj:
455 * bytecode/PolymorphicGetByIdList.h:
456 (JSC::GetByIdAccess::doesCalls):
457 * jit/AccessorCallJITStubRoutine.cpp: Added.
458 (JSC::AccessorCallJITStubRoutine::AccessorCallJITStubRoutine):
459 (JSC::AccessorCallJITStubRoutine::~AccessorCallJITStubRoutine):
460 (JSC::AccessorCallJITStubRoutine::visitWeak):
461 * jit/AccessorCallJITStubRoutine.h: Added.
462 * jit/AssemblyHelpers.h:
463 (JSC::AssemblyHelpers::storeCell):
464 * jit/GCAwareJITStubRoutine.h:
466 (JSC::generateGetByIdStub):
467 * runtime/GetterSetter.h:
468 (JSC::GetterSetter::offsetOfGetter):
469 (JSC::GetterSetter::offsetOfSetter):
471 2014-03-25 Michael Saboff <msaboff@apple.com>
473 Unreviewed, rolling out r166126.
475 Rollout r166126 in prepartion to roll out prerequisite r166070
479 "toThis() on a JSWorkerGlobalScope should return a JSProxy and
481 https://bugs.webkit.org/show_bug.cgi?id=130554
482 http://trac.webkit.org/changeset/166126
484 2014-03-25 Oliver Hunt <oliver@apple.com>
486 AST incorrectly conflates readable and writable locations
487 https://bugs.webkit.org/show_bug.cgi?id=130734
489 Reviewed by Filip Pizlo.
491 We need to distinguish between "locations" that are valid for reading
492 and writing, vs those that may only be written.
494 * bytecompiler/NodesCodegen.cpp:
495 (JSC::ForInNode::emitBytecode):
496 (JSC::ForOfNode::emitBytecode):
498 (JSC::ExpressionNode::isAssignmentLocation):
500 2014-03-24 Oliver Hunt <oliver@apple.com>
502 ASSERTION FAILED in Parser: dst != localReg
503 https://bugs.webkit.org/show_bug.cgi?id=130710
505 Reviewed by Filip Pizlo.
507 Just make sure we don't try to write to a captured constant,
508 following the change to track captured variables separately.
510 * bytecompiler/NodesCodegen.cpp:
511 (JSC::PostfixNode::emitResolve):
512 (JSC::PrefixNode::emitResolve):
514 2014-03-25 Martin Robinson <mrobinson@igalia.com>
516 [GTK] Remove the autotools build
517 https://bugs.webkit.org/show_bug.cgi?id=130717
519 Reviewed by Anders Carlsson.
521 * GNUmakefile.am: Removed.
522 * config.h: Remove references to the autotools configure file.
524 2014-03-24 Filip Pizlo <fpizlo@apple.com>
526 More scaffolding for a stub routine to have a stub recursively embedded inside it
527 https://bugs.webkit.org/show_bug.cgi?id=130770
529 Reviewed by Oliver Hunt.
531 * bytecode/CallLinkInfo.cpp:
532 (JSC::CallLinkInfo::unlink): VM& argument is superfluous.
533 (JSC::CallLinkInfo::visitWeak): Factor this out, it used to be in CodeBlock::finalizeUnconditionally().
534 * bytecode/CallLinkInfo.h:
535 * bytecode/CodeBlock.cpp:
536 (JSC::CodeBlock::finalizeUnconditionally): Factor out some functionality into CallLinkInfo::visitWeak(), and make sure we pass RepatchBuffer& in more places.
537 (JSC::CodeBlock::unlinkCalls):
538 (JSC::CodeBlock::unlinkIncomingCalls):
539 * bytecode/PolymorphicGetByIdList.cpp: Pass RepatchBuffer& through and call JITStubRoutine::visitWeak().
540 (JSC::GetByIdAccess::visitWeak):
541 (JSC::PolymorphicGetByIdList::visitWeak):
542 * bytecode/PolymorphicGetByIdList.h:
543 * bytecode/PolymorphicPutByIdList.cpp: Pass RepatchBuffer& through and call JITStubRoutine::visitWeak().
544 (JSC::PutByIdAccess::visitWeak):
545 (JSC::PolymorphicPutByIdList::visitWeak):
546 * bytecode/PolymorphicPutByIdList.h:
547 * bytecode/StructureStubInfo.cpp: Pass RepatchBuffer& through.
548 (JSC::StructureStubInfo::visitWeakReferences):
549 * bytecode/StructureStubInfo.h:
550 * jit/ClosureCallStubRoutine.cpp: isClosureCall is unused.
551 (JSC::ClosureCallStubRoutine::ClosureCallStubRoutine):
552 * jit/GCAwareJITStubRoutine.cpp:
553 (JSC::GCAwareJITStubRoutine::GCAwareJITStubRoutine):
554 (JSC::createJITStubRoutine):
555 * jit/GCAwareJITStubRoutine.h: Make it easier to construct one of these.
556 (JSC::GCAwareJITStubRoutine::isClosureCall): Deleted.
557 * jit/JITStubRoutine.cpp:
558 (JSC::JITStubRoutine::visitWeak): This will allow future JITStubRoutine subclasses to have stubs recursively embedded inside them.
559 * jit/JITStubRoutine.h:
561 (JSC::generateGetByIdStub): Fix a possible GC bug where we weren't making the stub routine GC aware.
562 (JSC::emitCustomSetterStub): Clean up some code.
564 2014-03-24 Geoffrey Garen <ggaren@apple.com>
566 Safari crashes in JavaScriptCore: JSC::JSObject::growOutOfLineStorage
567 when WebKit is compiled with fcatch-undefined-behavior
568 https://bugs.webkit.org/show_bug.cgi?id=130652
570 Reviewed by Mark Hahnenberg.
572 Use a static member function because the butterfly we pass in might be
573 NULL, and passing NULL to a member function is undefined behavior.
575 Stylistically, I think this new way reads a little more clearly, since it
576 matches createOrGrowArrayRight, and it helps to convey that m_butterfly
579 * runtime/Butterfly.h:
580 * runtime/ButterflyInlines.h:
581 (JSC::Butterfly::createOrGrowPropertyStorage): Renamed from growPropertyStorage
582 because we might create. Split out the create path to avoid using NULL
583 in a member function expression.
585 Removed some unused versions of this function.
587 * runtime/JSObject.cpp:
588 (JSC::JSObject::growOutOfLineStorage): Updated for interface change.
590 2014-03-24 Oliver Hunt <oliver@apple.com>
592 Strict mode destructuring assignment crashes the parser.
593 https://bugs.webkit.org/show_bug.cgi?id=130538
595 Reviewed by Michael Saboff.
597 The SyntaxChecker mode always return 1 for success, except
598 for a small subset of functions where we needed exact information.
599 This ends up just being a poor design decision as it means
600 the parser can get confused between a function return 1, and
601 the Resolve constant which was also 1. So we now use a unique
602 type for every creation method.
604 * parser/SyntaxChecker.h:
605 (JSC::SyntaxChecker::createSourceElements):
606 (JSC::SyntaxChecker::createFunctionBody):
607 (JSC::SyntaxChecker::createArguments):
608 (JSC::SyntaxChecker::createSpreadExpression):
609 (JSC::SyntaxChecker::createArgumentsList):
610 (JSC::SyntaxChecker::createPropertyList):
611 (JSC::SyntaxChecker::createElementList):
612 (JSC::SyntaxChecker::createFormalParameterList):
613 (JSC::SyntaxChecker::createClause):
614 (JSC::SyntaxChecker::createClauseList):
615 (JSC::SyntaxChecker::createFuncDeclStatement):
616 (JSC::SyntaxChecker::createBlockStatement):
617 (JSC::SyntaxChecker::createExprStatement):
618 (JSC::SyntaxChecker::createIfStatement):
619 (JSC::SyntaxChecker::createForLoop):
620 (JSC::SyntaxChecker::createForInLoop):
621 (JSC::SyntaxChecker::createForOfLoop):
622 (JSC::SyntaxChecker::createEmptyStatement):
623 (JSC::SyntaxChecker::createVarStatement):
624 (JSC::SyntaxChecker::createReturnStatement):
625 (JSC::SyntaxChecker::createBreakStatement):
626 (JSC::SyntaxChecker::createContinueStatement):
627 (JSC::SyntaxChecker::createTryStatement):
628 (JSC::SyntaxChecker::createSwitchStatement):
629 (JSC::SyntaxChecker::createWhileStatement):
630 (JSC::SyntaxChecker::createWithStatement):
631 (JSC::SyntaxChecker::createDoWhileStatement):
632 (JSC::SyntaxChecker::createLabelStatement):
633 (JSC::SyntaxChecker::createThrowStatement):
634 (JSC::SyntaxChecker::createDebugger):
635 (JSC::SyntaxChecker::createConstStatement):
636 (JSC::SyntaxChecker::appendConstDecl):
637 (JSC::SyntaxChecker::combineCommaNodes):
638 (JSC::SyntaxChecker::operatorStackPop):
640 2014-03-24 Brent Fulgham <bfulgham@apple.com>
642 Activate WebVTT Tests Once Merging is Complete
643 https://bugs.webkit.org/show_bug.cgi?id=130420
645 Reviewed by Eric Carlson.
647 * Configurations/FeatureDefines.xcconfig: Turn on ENABLE(WEBVTT_REGIONS)
649 2014-03-24 Andreas Kling <akling@apple.com>
651 Stop pulling in all the macro assemblers from VM.h
652 <https://webkit.org/b/130691>
654 Remove #include of "GPRInfo.h". This breaks WebCore's dependency
655 on macro assemblers headers and removes 8 includes from every
656 .cpp file in the JS bindings.
658 Reviewed by Geoff Garen.
662 2014-03-24 Gavin Barraclough <barraclough@apple.com>
664 Add support for thread QoS
665 https://bugs.webkit.org/show_bug.cgi?id=130688
667 Reviewed by Andreas Kling.
669 * heap/BlockAllocator.cpp:
670 (JSC::BlockAllocator::blockFreeingThreadStartFunc):
671 - block freeing is a utility activity.
673 2014-03-24 Filip Pizlo <fpizlo@apple.com>
675 Unreviewed, fix CLOOP build.
677 * bytecode/CallLinkStatus.cpp:
678 (JSC::CallLinkStatus::computeFor):
679 * bytecode/CodeBlock.cpp:
680 (JSC::CodeBlock::printCallOp):
681 (JSC::CodeBlock::getCallLinkInfoForBytecodeIndex):
682 (JSC::CodeBlock::resetStubDuringGCInternal): Deleted.
683 * bytecode/CodeBlock.h:
684 (JSC::CodeBlock::callLinkInfosEnd): Deleted.
686 2014-03-24 Gabor Rapcsanyi <rgabor@webkit.org>
688 [ARM64] GNU assembler doesn't work with LLInt arm64 backend.
689 https://bugs.webkit.org/show_bug.cgi?id=130453
691 Reviewed by Filip Pizlo.
693 Change fp and lr to x29 and x30. Add both operand kinds to emitARM64()
694 at sxtw and uxtw instructions.
696 * offlineasm/arm64.rb:
698 2014-03-23 Hyowon Kim <hw1008.kim@samsung.com>
700 Move all EFL typedefs into EflTypedefs.h.
701 https://bugs.webkit.org/show_bug.cgi?id=130511
703 Reviewed by Gyuyoung Kim
705 * heap/HeapTimer.h: Remove EFL typedefs.
707 2014-03-23 Filip Pizlo <fpizlo@apple.com>
709 Gotta grow the locals vectors if we are about to do SetLocals beyond the bytecode's numCalleeRegisters
710 https://bugs.webkit.org/show_bug.cgi?id=130650
711 <rdar://problem/16122966>
713 Reviewed by Michael Saboff.
715 Previously, it was only in the case of inlining that we would do SetLocal's beyond the
716 previously established numLocals limit. But then we added generalized op_call_varargs
717 handling, which results in us emitting SetLocals that didn't previously exist in the
720 This factors out the inliner's ensureLocals loop and calls it from op_call_varargs.
722 * dfg/DFGByteCodeParser.cpp:
723 (JSC::DFG::ByteCodeParser::ensureLocals):
724 (JSC::DFG::ByteCodeParser::handleInlining):
725 (JSC::DFG::ByteCodeParser::parseBlock):
726 (JSC::DFG::ByteCodeParser::parse):
727 * ftl/FTLOSRExitCompiler.cpp:
728 (JSC::FTL::compileStub): Make this do alignment correctly.
730 * tests/stress/call-varargs-from-inlined-code.js: Added.
731 * tests/stress/call-varargs-from-inlined-code-with-odd-number-of-arguments.js: Added.
733 2014-03-22 Filip Pizlo <fpizlo@apple.com>
735 Unreviewed, adjust sizes for ARM64.
737 * ftl/FTLInlineCacheSize.cpp:
738 (JSC::FTL::sizeOfCall):
740 2014-03-22 Filip Pizlo <fpizlo@apple.com>
742 Protect the silent spiller/filler's desire to fill Int32Constants by making sure that we don't mark something as having a Int32 register format if it's a non-Int32 constant
743 https://bugs.webkit.org/show_bug.cgi?id=130649
744 <rdar://problem/16399949>
746 Reviewed by Andreas Kling.
748 * dfg/DFGSpeculativeJIT32_64.cpp:
749 (JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
750 * dfg/DFGSpeculativeJIT64.cpp:
751 (JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
752 * tests/stress/fuzz-bug-16399949.js: Added.
756 2014-03-22 Filip Pizlo <fpizlo@apple.com>
758 Call linking slow paths should be passed a CallLinkInfo* directly so that you can create a call IC without adding it to any CodeBlocks
759 https://bugs.webkit.org/show_bug.cgi?id=130644
761 Reviewed by Andreas Kling.
763 This is conceptually a really simple change but it involves the following:
765 - The inline part of the call IC stuffs a pointer to the CallLinkInfo into regT2.
767 - CodeBlock uses a Bag of CallLinkInfos instead of a Vector.
769 - Remove the significance of a CallLinkInfo's index. This means that DFG::JITCode no
770 longer has a vector of slow path counts that shadows the CallLinkInfo vector.
772 - Make CallLinkInfo have its own slowPathCount, which counts actual slow path executions
773 and not all relinking.
775 This makes planting JS->JS calls inside other inline caches or stubs a lot easier, since
776 the CallLinkInfo and the call IC slow paths no longer rely on the call being associated
777 with a op_call/op_construct instruction and a machine code return PC within such an
780 * bytecode/CallLinkInfo.h:
781 (JSC::getCallLinkInfoCodeOrigin):
782 * bytecode/CallLinkStatus.cpp:
783 (JSC::CallLinkStatus::computeFor):
784 (JSC::CallLinkStatus::computeDFGStatuses):
785 * bytecode/CallLinkStatus.h:
786 * bytecode/CodeBlock.cpp:
787 (JSC::CodeBlock::printCallOp):
788 (JSC::CodeBlock::dumpBytecode):
789 (JSC::CodeBlock::finalizeUnconditionally):
790 (JSC::CodeBlock::getCallLinkInfoMap):
791 (JSC::CodeBlock::getCallLinkInfoForBytecodeIndex):
792 (JSC::CodeBlock::addCallLinkInfo):
793 (JSC::CodeBlock::unlinkCalls):
794 * bytecode/CodeBlock.h:
795 (JSC::CodeBlock::stubInfoBegin):
796 (JSC::CodeBlock::stubInfoEnd):
797 (JSC::CodeBlock::callLinkInfosBegin):
798 (JSC::CodeBlock::callLinkInfosEnd):
799 (JSC::CodeBlock::byValInfo):
800 * dfg/DFGByteCodeParser.cpp:
801 (JSC::DFG::ByteCodeParser::handleCall):
802 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
804 * dfg/DFGJITCompiler.cpp:
805 (JSC::DFG::JITCompiler::link):
806 * dfg/DFGJITCompiler.h:
807 (JSC::DFG::JITCompiler::addJSCall):
808 (JSC::DFG::JITCompiler::JSCallRecord::JSCallRecord):
809 * dfg/DFGOSRExitCompilerCommon.cpp:
810 (JSC::DFG::reifyInlinedCallFrames):
811 * dfg/DFGSpeculativeJIT.cpp:
812 (JSC::DFG::SpeculativeJIT::compile):
813 * dfg/DFGSpeculativeJIT.h:
814 * dfg/DFGSpeculativeJIT32_64.cpp:
815 (JSC::DFG::SpeculativeJIT::emitCall):
816 * dfg/DFGSpeculativeJIT64.cpp:
817 (JSC::DFG::SpeculativeJIT::emitCall):
818 * ftl/FTLCompile.cpp:
819 (JSC::FTL::fixFunctionBasedOnStackMaps):
820 * ftl/FTLInlineCacheSize.cpp:
821 (JSC::FTL::sizeOfCall):
823 (JSC::FTL::JSCall::JSCall):
824 (JSC::FTL::JSCall::emit):
825 (JSC::FTL::JSCall::link):
828 (JSC::JIT::privateCompileMainPass):
829 (JSC::JIT::privateCompileSlowCases):
830 (JSC::JIT::privateCompile):
833 (JSC::JIT::compileOpCall):
834 (JSC::JIT::compileOpCallSlowCase):
835 * jit/JITCall32_64.cpp:
836 (JSC::JIT::compileOpCall):
837 (JSC::JIT::compileOpCallSlowCase):
838 * jit/JITOperations.cpp:
839 * jit/JITOperations.h:
840 (JSC::operationLinkFor):
841 (JSC::operationVirtualFor):
842 (JSC::operationLinkClosureCallFor):
844 (JSC::linkClosureCall):
845 * jit/ThunkGenerators.cpp:
847 (JSC::virtualForThunkGenerator):
848 * tests/stress/eval-that-is-not-eval.js: Added.
850 2014-03-22 Filip Pizlo <fpizlo@apple.com>
852 Unreviewed, fix mispelled test name.
854 * tests/stress/constand-folding-osr-exit.js: Removed.
855 * tests/stress/constant-folding-osr-exit.js: Copied from Source/JavaScriptCore/tests/stress/constand-folding-osr-exit.js.
857 2014-03-22 Andreas Kling <akling@apple.com>
859 CREATE_DOM_WRAPPER doesn't need the ExecState.
860 <https://webkit.org/b/130648>
862 Add a fast path from JSGlobalObject to the VM so we don't have
863 to dance via the Heap.
865 Reviewed by Darin Adler.
867 * runtime/JSGlobalObject.cpp:
868 (JSC::JSGlobalObject::JSGlobalObject):
869 * runtime/JSGlobalObject.h:
870 (JSC::JSGlobalObject::vm):
872 2014-03-22 Filip Pizlo <fpizlo@apple.com>
874 Unreviewed, fix FTL build.
876 * ftl/FTLJITFinalizer.cpp:
878 2014-03-22 Michael Saboff <msaboff@apple.com>
880 toThis() on a JSWorkerGlobalScope should return a JSProxy and not undefined
881 https://bugs.webkit.org/show_bug.cgi?id=130554
883 Reviewed by Geoffrey Garen.
885 Fixed toThis() on WorkerGlobalScope to return a JSProxy instead of the JSGlobalObject.
886 Did some cleanup as well. Moved the setting of the thisObject in a JSGlobalObject to
887 happen in finishCreation() so that it will also happen for other derived classes including
888 JSWorkerGlobalScopeBase.
890 * API/JSContextRef.cpp:
891 (JSGlobalContextCreateInGroup):
893 (GlobalObject::create):
894 * API/tests/testapi.c:
895 (globalObject_initialize): Eliminated ASSERT that the global object we are creating matches
896 the result from JSContextGetGlobalObject() as that will return the proxy.
897 * runtime/JSGlobalObject.cpp:
898 (JSC::JSGlobalObject::init): Removed thisValue parameter and the call to setGlobalThis() since
899 we now call setGlobalThis in finishCreation().
900 * runtime/JSGlobalObject.h:
901 (JSC::JSGlobalObject::finishCreation):
902 (JSC::JSGlobalObject::setGlobalThis): Made this a private method.
904 2014-03-22 Andreas Kling <akling@apple.com>
908 * bytecode/CodeBlock.cpp:
909 * runtime/Executable.cpp:
911 2014-03-22 Andreas Kling <akling@apple.com>
913 Cut down on JSC profiler includes in WebCore & co.
914 <https://webkit.org/b/130637>
916 Most of WebKit was pulling in JSC's profiler headers via VM.h.
918 Reviewed by Darin Adler.
920 * dfg/DFGDisassembler.cpp:
921 * dfg/DFGDisassembler.h:
922 * dfg/DFGJITFinalizer.cpp:
927 2014-03-22 Landry Breuil <landry@openbsd.org>
929 Use pthread_stackseg_np() to find the stack bounds on OpenBSD.
930 https://bugs.webkit.org/show_bug.cgi?id=129965
932 Reviewed By Anders Carlsson.
934 2014-03-21 Mark Lam <mark.lam@apple.com>
936 Crash when BytecodeGenerator::emitJump calls Label::bind on null pointer.
937 <https://webkit.org/b/124508>
939 Reviewed by Oliver Hunt.
941 The issue is that BreakNode::emitBytecode() is holding onto a LabelScope
942 pointer from the BytecodeGenerator's m_localScopes vector, and then it
943 calls emitPopScopes(). emitPopScopes() may do finally clause handling
944 which will require the m_localScopes to be cloned so that it can change
945 the local scopes for the finally block, and then restore it after
946 handling the finally clause. These modifications of the m_localScopes
947 vector will result in the LabelScope pointer in BreakNode::emitBytecode()
948 becoming stale, thereby causing the crash.
950 The same issue applies to the ContinueNode as well.
952 The fix is to use the existing LabelScopePtr abstraction instead of raw
953 LabelScope pointers. The LabelScopePtr is resilient to the underlying
954 vector re-allocating its backing store.
956 I also changed the LabelScopePtr constructor that takes a LabelScopeStore
957 to expect a reference to the owner store instead of a pointer because the
958 owner store should never be a null pointer.
960 * bytecompiler/BytecodeGenerator.cpp:
961 (JSC::BytecodeGenerator::newLabelScope):
962 (JSC::BytecodeGenerator::breakTarget):
963 (JSC::BytecodeGenerator::continueTarget):
964 * bytecompiler/BytecodeGenerator.h:
965 * bytecompiler/LabelScope.h:
966 (JSC::LabelScopePtr::LabelScopePtr):
967 (JSC::LabelScopePtr::operator bool):
968 (JSC::LabelScopePtr::null):
969 * bytecompiler/NodesCodegen.cpp:
970 (JSC::ContinueNode::trivialTarget):
971 (JSC::ContinueNode::emitBytecode):
972 (JSC::BreakNode::trivialTarget):
973 (JSC::BreakNode::emitBytecode):
975 2014-03-21 Mark Hahnenberg <mhahnenberg@apple.com>
977 6% SunSpider commandline regression due to r165940
978 https://bugs.webkit.org/show_bug.cgi?id=130617
980 Reviewed by Michael Saboff.
982 In GCActivityCallback::didAllocate, lastGCLength() returns 0 if we've never collected
983 before. Some of the benchmarks are never running a single EdenCollection, which causes
984 them to repeatedly call scheduleTimer with a newDelay of 0. This defeats our timer
985 slop heuristic, causing us to invoke CFRunLoopTimerSetNextFireDate a couple orders of
986 magnitude more than we normally would.
988 The fix is to seed the last GC lengths in Heap with a non-zero length so that our heuristic works.
993 2014-03-21 Filip Pizlo <fpizlo@apple.com>
995 Constants folded by DFG::ByteCodeParser should not be dead.
996 https://bugs.webkit.org/show_bug.cgi?id=130576
998 Reviewed by Mark Hahnenberg.
1000 This fixes bugs in the ByteCodeParser's constant folder by removing that constant folder. This
1001 reduces the number of folders in JSC from fourish to just threeish (parser, DFG AI, and one
1002 or more folders in LLVM). Doing so has no performance impact since the other constant folders
1003 already subsume this one.
1005 Also added a test case for the specific bug that instigated this.
1007 * dfg/DFGByteCodeParser.cpp:
1008 (JSC::DFG::ByteCodeParser::getJSConstantForValue):
1009 (JSC::DFG::ByteCodeParser::getJSConstant):
1010 (JSC::DFG::ByteCodeParser::inferredConstant):
1011 (JSC::DFG::ByteCodeParser::handleIntrinsic):
1012 (JSC::DFG::ByteCodeParser::parseBlock):
1014 * dfg/DFGNodeFlags.h:
1015 * tests/stress/constand-folding-osr-exit.js: Added.
1020 2014-03-21 Mark Lam <mark.lam@apple.com>
1022 StackLayoutPhase should find the union'ed calleeVariable before accessing its machineLocal.
1023 <https://webkit.org/b/130566>
1025 Reviewed by Filip Pizlo.
1027 * dfg/DFGStackLayoutPhase.cpp:
1028 (JSC::DFG::StackLayoutPhase::run):
1030 2014-03-20 Filip Pizlo <fpizlo@apple.com>
1032 FTL should correctly compile GetByVal on Uint32Array that claims to return non-int32 values
1033 https://bugs.webkit.org/show_bug.cgi?id=130562
1034 <rdar://problem/16382842>
1036 Reviewed by Geoffrey Garen.
1038 * ftl/FTLLowerDFGToLLVM.cpp:
1039 (JSC::FTL::LowerDFGToLLVM::compileGetByVal):
1040 * tests/stress/uint32array-unsigned-load.js: Added.
1043 2014-03-20 Brian Burg <bburg@apple.com>
1045 Web Inspector: add frontend controller and models for replay sessions
1046 https://bugs.webkit.org/show_bug.cgi?id=130145
1048 Reviewed by Joseph Pecoraro.
1050 * inspector/scripts/CodeGeneratorInspector.py: Add the conditional Replay domain.
1052 2014-03-20 Filip Pizlo <fpizlo@apple.com>
1054 FTL ValueToInt32 mishandles the constant case, and by the way, there is a constant case that the FTL sees
1055 https://bugs.webkit.org/show_bug.cgi?id=130546
1056 <rdar://problem/16383308>
1058 Reviewed by Mark Hahnenberg.
1060 Make AI do a better job of folding this.
1062 Also made the FTL backend be more tolerant of data representations. In this case it
1063 didn't know that "constant" was a valid representation. There is a finite set of
1064 possible representations, but broadly, we don't write code that presumes anything
1065 about the representation of an input; that's what methods like lowJSValue() are for.
1066 ValueToInt32 was previously not relying on those methods at all because it had some
1067 hacks. Now, those hacks are just a fast-path optimization but ultimately we fall down
1070 * dfg/DFGAbstractInterpreterInlines.h:
1071 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
1072 * ftl/FTLLowerDFGToLLVM.cpp:
1073 (JSC::FTL::LowerDFGToLLVM::compileValueToInt32):
1074 (JSC::FTL::LowerDFGToLLVM::numberOrNotCellToInt32):
1075 * tests/stress/value-to-int32-undefined-constant.js: Added.
1077 * tests/stress/value-to-int32-undefined.js: Added.
1080 2014-03-20 Mark Hahnenberg <mhahnenberg@apple.com>
1082 Add some assertions back
1083 https://bugs.webkit.org/show_bug.cgi?id=130531
1085 Reviewed by Geoffrey Garen.
1087 We removed a useful set of assertions for verifying that MarkedBlocks were
1088 in the state that we expected them to be in after clearing marks in the Heap.
1089 We should add these back to catch bugs earlier.
1091 * heap/MarkedBlock.h:
1092 * heap/MarkedSpace.cpp:
1093 (JSC::VerifyMarkedOrRetired::operator()):
1094 (JSC::MarkedSpace::clearMarks):
1096 2014-03-20 Filip Pizlo <fpizlo@apple.com>
1098 Implement stackmap header version check and support new stackmap formats
1099 https://bugs.webkit.org/show_bug.cgi?id=130535
1100 <rdar://problem/16164284>
1102 Reviewed by Geoffrey Garen.
1104 Add the notion of versioning so that LLVMers can happily implement new stackmap formats
1105 without worrying about WebKit getting version-locked to LLVM. In the future, we will have
1106 to implement parsing for a new LLVM stackmap format before it lands in LLVM, or we'll have
1107 to have a "max usable LLVM revision" limit. But, thanks to versioning, we'll always be
1108 happy to move backward in time to older versions of LLVM.
1110 * ftl/FTLStackMaps.cpp:
1111 (JSC::FTL::readObject):
1112 (JSC::FTL::StackMaps::Constant::parse):
1113 (JSC::FTL::StackMaps::StackSize::parse):
1114 (JSC::FTL::StackMaps::Location::parse):
1115 (JSC::FTL::StackMaps::Record::parse):
1116 (JSC::FTL::StackMaps::parse):
1117 (JSC::FTL::StackMaps::dump):
1118 (JSC::FTL::StackMaps::dumpMultiline):
1119 * ftl/FTLStackMaps.h:
1121 2014-03-20 Filip Pizlo <fpizlo@apple.com>
1123 Crash beneath operationTearOffActivation running this JS compression demo
1124 https://bugs.webkit.org/show_bug.cgi?id=130295
1125 <rdar://problem/16332337>
1127 Reviewed by Oliver Hunt.
1129 Make sure that we flush things as if we were at a terminal, if we are at a block with
1130 no forward edges. This fixes infinitely loopy code with captured variables.
1132 Make sure that the CFG simplifier adds explicit flushes whenever it jettisons a block.
1134 Make it so that NodeIsFlushed is a thing. Previously only SSA used it and it computed
1135 it by itself. Now it's an artifact of CPS rethreading.
1137 Add a bunch of tests. All of them previously either crashed or returned bad output due
1138 to memory corruption.
1140 * bytecode/CodeBlock.cpp:
1141 (JSC::CodeBlock::isCaptured):
1142 * dfg/DFGByteCodeParser.cpp:
1143 (JSC::DFG::ByteCodeParser::flushForTerminal):
1144 (JSC::DFG::ByteCodeParser::flushForReturn):
1145 (JSC::DFG::ByteCodeParser::flushIfTerminal):
1146 (JSC::DFG::ByteCodeParser::branchData):
1147 (JSC::DFG::ByteCodeParser::parseBlock):
1148 * dfg/DFGCFGSimplificationPhase.cpp:
1149 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
1150 * dfg/DFGCPSRethreadingPhase.cpp:
1151 (JSC::DFG::CPSRethreadingPhase::run):
1152 (JSC::DFG::CPSRethreadingPhase::computeIsFlushed):
1153 (JSC::DFG::CPSRethreadingPhase::addFlushedLocalOp):
1154 (JSC::DFG::CPSRethreadingPhase::addFlushedLocalEdge):
1155 * dfg/DFGCSEPhase.cpp:
1156 (JSC::DFG::CSEPhase::performNodeCSE):
1158 (JSC::DFG::Graph::clearFlagsOnAllNodes):
1161 * dfg/DFGNodeFlags.cpp:
1162 (JSC::DFG::dumpNodeFlags):
1163 * dfg/DFGNodeFlags.h:
1164 * dfg/DFGSSAConversionPhase.cpp:
1165 (JSC::DFG::SSAConversionPhase::run):
1166 * tests/stress/activation-test-loop.js: Added.
1167 (Inner.this.doStuff):
1171 * tests/stress/inferred-infinite-loop-that-uses-captured-variables.js: Added.
1175 * tests/stress/infinite-loop-that-uses-captured-variables-before-throwing.js: Added.
1179 * tests/stress/infinite-loop-that-uses-captured-variables-but-they-do-not-escape.js: Added.
1183 * tests/stress/infinite-loop-that-uses-captured-variables-with-osr-entry.js: Added.
1187 * tests/stress/infinite-loop-that-uses-captured-variables.js: Added.
1191 * tests/stress/tricky-indirectly-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js: Added.
1196 * tests/stress/tricky-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js: Added.
1200 * tests/stress/tricky-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js: Added.
1204 * tests/stress/tricky-infinite-loop-that-uses-captured-variables.js: Added.
1209 2014-03-20 Oliver Hunt <oliver@apple.com>
1211 Incorrect behavior when mutating a typed array during set.
1212 https://bugs.webkit.org/show_bug.cgi?id=130428
1214 Reviewed by Geoffrey Garen.
1216 This fixes a null derefence that occurs if a typed array
1217 is mutated during the set() operation. The patch gets rid
1218 of the "Quickly" version of setIndex that is assigning
1219 JSValues of unknown type, as the numeric conversion can trigger
1220 side effects that lead to neutering, and so we deref null.
1222 * runtime/JSGenericTypedArrayView.h:
1223 (JSC::JSGenericTypedArrayView::setIndex):
1224 * runtime/JSGenericTypedArrayViewInlines.h:
1225 (JSC::JSGenericTypedArrayView<Adaptor>::set):
1226 (JSC::JSGenericTypedArrayView<Adaptor>::putByIndex):
1228 2014-03-20 Gavin Barraclough <barraclough@apple.com>
1230 Remove IdentifierTable typedef, isIdentifier()
1231 https://bugs.webkit.org/show_bug.cgi?id=130533
1233 Rubber stamped by Geoff Garen.
1235 Code should use AtomicStringTable, isAtomic() directly.
1237 * API/JSClassRef.cpp:
1238 (OpaqueJSClass::~OpaqueJSClass):
1239 (OpaqueJSClassContextData::OpaqueJSClassContextData):
1240 (OpaqueJSClass::className):
1242 * bytecode/SpeculatedType.cpp:
1243 (JSC::speculationFromCell):
1244 * bytecompiler/BytecodeGenerator.cpp:
1245 (JSC::BytecodeGenerator::BytecodeGenerator):
1246 * dfg/DFGSpeculativeJIT.cpp:
1247 (JSC::DFG::SpeculativeJIT::compileIn):
1248 (JSC::DFG::SpeculativeJIT::speculateStringIdentAndLoadStorage):
1249 * ftl/FTLLowerDFGToLLVM.cpp:
1250 (JSC::FTL::LowerDFGToLLVM::speculateStringIdent):
1252 (JSC::Heap::collect):
1253 * interpreter/CallFrame.h:
1254 (JSC::ExecState::atomicStringTable):
1255 * parser/ASTBuilder.h:
1256 (JSC::ASTBuilder::addVar):
1257 * parser/Parser.cpp:
1258 (JSC::Parser<LexerType>::createBindingPattern):
1259 * runtime/Completion.cpp:
1262 * runtime/Identifier.cpp:
1263 (JSC::Identifier::checkCurrentAtomicStringTable):
1264 * runtime/Identifier.h:
1265 (JSC::Identifier::Identifier):
1266 * runtime/IdentifierInlines.h:
1267 (JSC::Identifier::add):
1268 * runtime/JSCJSValue.cpp:
1269 (JSC::JSValue::dumpInContext):
1270 * runtime/JSLock.cpp:
1271 (JSC::JSLock::didAcquireLock):
1272 (JSC::JSLock::willReleaseLock):
1273 (JSC::JSLock::DropAllLocks::DropAllLocks):
1274 (JSC::JSLock::DropAllLocks::~DropAllLocks):
1276 * runtime/PropertyMapHashTable.h:
1277 (JSC::PropertyTable::find):
1278 (JSC::PropertyTable::get):
1279 (JSC::PropertyTable::findWithString):
1280 * runtime/PropertyName.h:
1281 (JSC::PropertyName::PropertyName):
1282 * runtime/PropertyNameArray.cpp:
1283 (JSC::PropertyNameArray::add):
1288 (JSC::VM::atomicStringTable):
1290 2014-03-20 Gavin Barraclough <barraclough@apple.com>
1292 Merge AtomicString, Identifier
1293 https://bugs.webkit.org/show_bug.cgi?id=128624
1295 Reviewed by Geoff Garen.
1297 WTF::StringImpl currently supports two uniquing mechanism - AtomicString and
1298 Identifer - that is one too many.
1300 Remove Identifier in favour of AtomicString. Identifier had two interesting
1301 mechanisms that we preserve.
1303 (1) JSC API VMs each get their own string table, switch the string table on
1305 (2) JSC caches a pointer to the string table on the VM to avoid a thread
1306 specific access. Adds a new AtomicString::add method to support this.
1308 * API/JSAPIWrapperObject.mm:
1310 * JavaScriptCore.xcodeproj/project.pbxproj:
1311 - added IdentifierInlines.h.
1312 * inspector/JSInjectedScriptHostPrototype.cpp:
1313 * inspector/JSJavaScriptCallFramePrototype.cpp:
1315 * interpreter/CallFrame.h:
1316 (JSC::ExecState::atomicStringTable):
1317 - added, used via AtomicString::add to avoid thread-specific access.
1318 * runtime/ConsolePrototype.cpp:
1320 * runtime/Identifier.cpp:
1321 (JSC::Identifier::add):
1322 (JSC::Identifier::add8):
1323 - vm->smallStrings.singleCharacterStringRep now returns Atomic strings, use AtomicString::add.
1324 * runtime/Identifier.h:
1325 (JSC::Identifier::Identifier):
1327 (JSC::Identifier::add):
1328 - vm->smallStrings.singleCharacterStringRep now returns Atomic strings, use AtomicString::add.
1329 * runtime/IdentifierInlines.h: Added.
1330 (JSC::Identifier::add):
1331 - moved from Identifier.h, use AtomicString::add.
1332 * runtime/JSCInlines.h:
1333 - added IdentifierInlines.h.
1335 - removed IdentifierTable.
1336 * runtime/PropertyNameArray.cpp:
1338 * runtime/SmallStrings.cpp:
1339 (JSC::SmallStringsStorage::SmallStringsStorage):
1340 - ensure all single character strings are Atomic.
1343 - instantiate CommonIdentifiers with the correct AtomicStringTable set on thread data.
1345 (JSC::VM::atomicStringTable):
1346 - added, used via AtomicString::add to avoid thread-specific access.
1348 2014-03-20 Gabor Rapcsanyi <rgabor@webkit.org>
1350 [ARM64] Fix assembler build issues and add cacheFlush support for Linux
1351 https://bugs.webkit.org/show_bug.cgi?id=130502
1353 Reviewed by Michael Saboff.
1355 Add limits.h for INT_MIN in ARM64Assembler(). Delete shouldBlindForSpecificArch(uintptr_t)
1356 because on ARM64 uint64_t and uintptr_t is the same with GCC and Clang as well.
1357 Add cacheFlush support for Linux.
1359 * assembler/ARM64Assembler.h:
1360 (JSC::ARM64Assembler::linuxPageFlush):
1361 (JSC::ARM64Assembler::cacheFlush):
1362 * assembler/MacroAssemblerARM64.h:
1363 (JSC::MacroAssemblerARM64::shouldBlindForSpecificArch):
1365 2014-03-19 Gavin Barraclough <barraclough@apple.com>
1367 https://bugs.webkit.org/show_bug.cgi?id=130494
1368 EmptyUnique strings are Identifiers/Atomic
1370 Reviewed by Geoff Garen.
1372 EmptyUnique strings should set the Identifier/Atomic flag.
1374 This fixes an unreproducible bug we believe exists in Identifier handling.
1375 Expected behaviour is that while Identifiers may reference EmptyUniques
1376 (StringImpls allocated as UIDs for PrivateNames), these are not created
1377 through the main Identifier constructor, the Identifier flag is not set
1378 on PrivateNames, and we should never lookup EmptyUnique strings in the
1381 Unfortunately that was happening. Some tables used to implement property
1382 access in the JIT hold StringImpl*s, and turn these back into Identifiers
1383 using the identfiier constructor. Since the code generator will now plant
1384 by-id (cachable) accesses to PrivateNames we can end up passing an
1385 EmptyUnique to Identifier::add, potentially leading to PrivateNames being
1386 uniqued together (though hard to prove, since the hash codes are random).
1388 * runtime/PropertyName.h:
1389 (JSC::PropertyName::PropertyName):
1390 (JSC::PropertyName::uid):
1391 (JSC::PropertyName::publicName):
1392 (JSC::PropertyName::asIndex):
1393 - PropertyName assumed that PrivateNames are not Identifiers - instead check isEmptyUnique().
1394 * runtime/Structure.cpp:
1395 (JSC::Structure::getPropertyNamesFromStructure):
1396 - Structure assumed that PrivateNames are not Identifiers - instead check isEmptyUnique().
1398 2014-03-19 Filip Pizlo <fpizlo@apple.com>
1400 Unreviewed, revert the DFGCommon.h change in r165938. It was not intentional.
1404 2014-03-19 Mark Hahnenberg <mhahnenberg@apple.com>
1406 GC timer should intelligently choose between EdenCollections and FullCollections
1407 https://bugs.webkit.org/show_bug.cgi?id=128261
1409 Reviewed by Geoffrey Garen.
1411 Most of the GCs while browsing the web are due to the GC timer. Currently the GC timer
1412 always does FullCollections. To reduce the impact of the GC timer on the system this patch
1413 changes Heap so that it has two timers, one for each type of collection. The FullCollection
1414 timer is notified at the end of EdenCollections how much the Heap has grown since the last
1415 FullCollection and when somebody notifies the Heap of abandoned memory (which usually wouldn't
1416 be detected by an EdenCollection).
1419 * GNUmakefile.list.am:
1420 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
1421 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
1422 * JavaScriptCore.xcodeproj/project.pbxproj:
1423 * heap/EdenGCActivityCallback.cpp: Added.
1424 (JSC::EdenGCActivityCallback::EdenGCActivityCallback):
1425 (JSC::EdenGCActivityCallback::doCollection):
1426 (JSC::EdenGCActivityCallback::lastGCLength):
1427 (JSC::EdenGCActivityCallback::deathRate):
1428 (JSC::EdenGCActivityCallback::gcTimeSlice):
1429 * heap/EdenGCActivityCallback.h: Added.
1430 (JSC::GCActivityCallback::createEdenTimer):
1431 * heap/FullGCActivityCallback.cpp: Added.
1432 (JSC::FullGCActivityCallback::FullGCActivityCallback):
1433 (JSC::FullGCActivityCallback::doCollection):
1434 (JSC::FullGCActivityCallback::lastGCLength):
1435 (JSC::FullGCActivityCallback::deathRate):
1436 (JSC::FullGCActivityCallback::gcTimeSlice):
1437 * heap/FullGCActivityCallback.h: Added.
1438 (JSC::GCActivityCallback::createFullTimer):
1439 * heap/GCActivityCallback.cpp:
1440 (JSC::GCActivityCallback::GCActivityCallback):
1441 (JSC::GCActivityCallback::doWork):
1442 (JSC::GCActivityCallback::scheduleTimer):
1443 (JSC::GCActivityCallback::cancelTimer):
1444 (JSC::GCActivityCallback::didAllocate):
1445 (JSC::GCActivityCallback::willCollect):
1446 (JSC::GCActivityCallback::cancel):
1447 * heap/GCActivityCallback.h:
1450 (JSC::Heap::reportAbandonedObjectGraph):
1451 (JSC::Heap::didAbandon):
1452 (JSC::Heap::collectAllGarbage):
1453 (JSC::Heap::collect):
1454 (JSC::Heap::willStartCollection):
1455 (JSC::Heap::updateAllocationLimits):
1456 (JSC::Heap::didFinishCollection):
1457 (JSC::Heap::setFullActivityCallback):
1458 (JSC::Heap::setEdenActivityCallback):
1459 (JSC::Heap::fullActivityCallback):
1460 (JSC::Heap::edenActivityCallback):
1461 (JSC::Heap::setGarbageCollectionTimerEnabled):
1462 (JSC::Heap::didAllocate):
1463 (JSC::Heap::shouldDoFullCollection):
1465 (JSC::Heap::lastFullGCLength):
1466 (JSC::Heap::lastEdenGCLength):
1467 (JSC::Heap::increaseLastFullGCLength):
1468 (JSC::Heap::sizeBeforeLastEdenCollection):
1469 (JSC::Heap::sizeAfterLastEdenCollection):
1470 (JSC::Heap::sizeBeforeLastFullCollection):
1471 (JSC::Heap::sizeAfterLastFullCollection):
1472 * heap/HeapOperation.h:
1473 * heap/HeapStatistics.cpp:
1474 (JSC::HeapStatistics::showObjectStatistics):
1475 * heap/HeapTimer.cpp:
1476 (JSC::HeapTimer::timerDidFire):
1480 * runtime/Options.h:
1482 2014-03-19 Commit Queue <commit-queue@webkit.org>
1484 Unreviewed, rolling out r165926.
1485 https://bugs.webkit.org/show_bug.cgi?id=130488
1487 broke the iOS build (Requested by estes on #webkit).
1491 "GC timer should intelligently choose between EdenCollections
1492 and FullCollections"
1493 https://bugs.webkit.org/show_bug.cgi?id=128261
1494 http://trac.webkit.org/changeset/165926
1496 2014-03-13 Mark Hahnenberg <mhahnenberg@apple.com>
1498 GC timer should intelligently choose between EdenCollections and FullCollections
1499 https://bugs.webkit.org/show_bug.cgi?id=128261
1501 Reviewed by Geoffrey Garen.
1503 Most of the GCs while browsing the web are due to the GC timer. Currently the GC timer
1504 always does FullCollections. To reduce the impact of the GC timer on the system this patch
1505 changes Heap so that it has two timers, one for each type of collection. The FullCollection
1506 timer is notified at the end of EdenCollections how much the Heap has grown since the last
1507 FullCollection and when somebody notifies the Heap of abandoned memory (which wouldn't be
1508 detected by an EdenCollection).
1510 * heap/GCActivityCallback.cpp:
1511 (JSC::GCActivityCallback::GCActivityCallback):
1512 (JSC::GCActivityCallback::doWork):
1513 (JSC::FullGCActivityCallback::FullGCActivityCallback):
1514 (JSC::FullGCActivityCallback::doCollection):
1515 (JSC::EdenGCActivityCallback::EdenGCActivityCallback):
1516 (JSC::EdenGCActivityCallback::doCollection):
1517 (JSC::GCActivityCallback::scheduleTimer):
1518 (JSC::GCActivityCallback::cancelTimer):
1519 (JSC::GCActivityCallback::didAllocate):
1520 (JSC::GCActivityCallback::willCollect):
1521 (JSC::GCActivityCallback::cancel):
1522 * heap/GCActivityCallback.h:
1523 (JSC::GCActivityCallback::GCActivityCallback):
1524 (JSC::GCActivityCallback::createFullTimer):
1525 (JSC::GCActivityCallback::createEdenTimer):
1528 (JSC::Heap::didAbandon):
1529 (JSC::Heap::willStartCollection):
1530 (JSC::Heap::updateAllocationLimits):
1531 (JSC::Heap::setFullActivityCallback):
1532 (JSC::Heap::setEdenActivityCallback):
1533 (JSC::Heap::fullActivityCallback):
1534 (JSC::Heap::edenActivityCallback):
1535 (JSC::Heap::setGarbageCollectionTimerEnabled):
1536 (JSC::Heap::didAllocate):
1538 * heap/HeapTimer.cpp:
1539 (JSC::HeapTimer::timerDidFire):
1541 2014-03-19 Filip Pizlo <fpizlo@apple.com>
1543 REGRESSION(r165459): It broke 109 jsc stress test on ARM Thumb2 and Mac 32 bit
1544 https://bugs.webkit.org/show_bug.cgi?id=130134
1546 Reviewed by Mark Hahnenberg.
1548 * dfg/DFGFixupPhase.cpp:
1549 (JSC::DFG::FixupPhase::fixupNode): Can't do some optimizations if you don't have a lot of registers.
1550 * dfg/DFGSpeculativeJIT32_64.cpp:
1551 (JSC::DFG::SpeculativeJIT::cachedGetById): Move stuff around before going into the IC code to ensure that we give the IC code the invariants it needs. This only happens in case of GetByIdFlush, where we are forced into using weird combinations of registers because the results have to be in t0/t1.
1552 (JSC::DFG::SpeculativeJIT::compile): For a normal GetById, the register allocator should just do the right thing so nobody has to move anything around.
1553 * jit/JITInlineCacheGenerator.cpp:
1554 (JSC::JITGetByIdGenerator::JITGetByIdGenerator): Assert the things we want.
1555 * jit/JITInlineCacheGenerator.h:
1557 (JSC::generateGetByIdStub): Remove a previous incomplete hack to try to work around the DFG's problem.
1559 2014-03-19 Mark Hahnenberg <mhahnenberg@apple.com>
1561 Normalize some of the older JSC options
1562 https://bugs.webkit.org/show_bug.cgi?id=128753
1564 Reviewed by Michael Saboff.
1566 * runtime/Options.cpp:
1567 (JSC::Options::initialize):
1569 2014-03-12 Mark Lam <mark.lam@apple.com>
1571 Update type of local vars to match the type of String length.
1572 <https://webkit.org/b/130077>
1574 Reviewed by Geoffrey Garen.
1576 * runtime/JSStringJoiner.cpp:
1577 (JSC::JSStringJoiner::join):
1579 2014-03-18 Filip Pizlo <fpizlo@apple.com>
1581 Get rid of Flush in SSA
1582 https://bugs.webkit.org/show_bug.cgi?id=130440
1584 Reviewed by Sam Weinig.
1586 This is basically a red patch. We used to use backwards flow for determining what was
1587 flushed, until it became clear that this doesn't make sense. Now the Flush nodes don't
1588 accomplish anything. Keeping them around in SSA can only make things hard.
1591 * GNUmakefile.list.am:
1592 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
1593 * JavaScriptCore.xcodeproj/project.pbxproj:
1594 * dfg/DFGBasicBlock.cpp:
1595 (JSC::DFG::BasicBlock::SSAData::SSAData):
1596 * dfg/DFGBasicBlock.h:
1597 * dfg/DFGFlushLivenessAnalysisPhase.cpp: Removed.
1598 * dfg/DFGFlushLivenessAnalysisPhase.h: Removed.
1600 (JSC::DFG::Graph::dump):
1602 (JSC::DFG::Plan::compileInThreadImpl):
1603 * dfg/DFGSSAConversionPhase.cpp:
1604 (JSC::DFG::SSAConversionPhase::run):
1605 * ftl/FTLLowerDFGToLLVM.cpp:
1606 (JSC::FTL::LowerDFGToLLVM::compileNode):
1608 2014-03-18 Filip Pizlo <fpizlo@apple.com>
1610 Unreviewed, fix iOS production build.
1612 * JavaScriptCore.xcodeproj/project.pbxproj:
1614 2014-03-18 Michael Saboff <msaboff@apple.com>
1616 Update RegExp Tracing code
1617 https://bugs.webkit.org/show_bug.cgi?id=130381
1619 Reviewed by Andreas Kling.
1621 Updated the regular expression tracing code for 8/16 bit JIT as
1622 well as match only entry points. Also added average string length
1625 * runtime/RegExp.cpp:
1626 (JSC::RegExp::RegExp):
1627 (JSC::RegExp::match):
1628 (JSC::RegExp::printTraceData):
1631 (JSC::VM::addRegExpToTrace):
1632 (JSC::VM::dumpRegExpTrace):
1635 (JSC::Yarr::YarrCodeBlock::get8BitMatchOnlyAddr):
1636 (JSC::Yarr::YarrCodeBlock::get16BitMatchOnlyAddr):
1637 (JSC::Yarr::YarrCodeBlock::get8BitMatchAddr):
1638 (JSC::Yarr::YarrCodeBlock::get16BitMatchAddr):
1640 2014-03-17 Filip Pizlo <fpizlo@apple.com>
1642 Add CompareStrictEq(StringIdent:, NotStringVar:) and CompareStrictEq(String:, Untyped:)
1643 https://bugs.webkit.org/show_bug.cgi?id=130300
1645 Reviewed by Mark Hahnenberg.
1647 We can quickly strictly compare StringIdent's to NotStringVar's and String's to Untyped's.
1648 This makes the DFG aware of this.
1650 Also adds StringIdent-to-StringIdent and StringIdent-to-NotStringVar strict comparisons to
1651 the FTL. Also adds StringIdent-to-StringIdent non-strict comparisons to the FTL.
1653 This also gives the DFG some abstractions for checking something is a cell or is other.
1654 This made this patch easier to write and also simplified a bunch of other stuff.
1656 1% speed-up on Octane.
1658 * assembler/AbstractMacroAssembler.h:
1659 (JSC::AbstractMacroAssembler::JumpList::JumpList):
1660 * bytecode/SpeculatedType.h:
1661 (JSC::isNotStringVarSpeculation):
1662 * dfg/DFGFixupPhase.cpp:
1663 (JSC::DFG::FixupPhase::fixupNode):
1665 (JSC::DFG::Node::childFor):
1666 (JSC::DFG::Node::shouldSpeculateNotStringVar):
1667 * dfg/DFGSafeToExecute.h:
1668 (JSC::DFG::SafeToExecuteEdge::operator()):
1669 * dfg/DFGSpeculativeJIT.cpp:
1670 (JSC::DFG::SpeculativeJIT::compileIn):
1671 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
1672 (JSC::DFG::SpeculativeJIT::compileInstanceOfForObject):
1673 (JSC::DFG::SpeculativeJIT::compileInstanceOf):
1674 (JSC::DFG::SpeculativeJIT::compileStrictEq):
1675 (JSC::DFG::SpeculativeJIT::compileBooleanCompare):
1676 (JSC::DFG::SpeculativeJIT::compileStringEquality):
1677 (JSC::DFG::SpeculativeJIT::compileStringToUntypedEquality):
1678 (JSC::DFG::SpeculativeJIT::compileStringIdentEquality):
1679 (JSC::DFG::SpeculativeJIT::compileStringIdentToNotStringVarEquality):
1680 (JSC::DFG::SpeculativeJIT::compileStringZeroLength):
1681 (JSC::DFG::SpeculativeJIT::speculateObjectOrOther):
1682 (JSC::DFG::SpeculativeJIT::speculateString):
1683 (JSC::DFG::SpeculativeJIT::speculateStringIdentAndLoadStorage):
1684 (JSC::DFG::SpeculativeJIT::speculateNotStringVar):
1685 (JSC::DFG::SpeculativeJIT::speculateNotCell):
1686 (JSC::DFG::SpeculativeJIT::speculateOther):
1687 (JSC::DFG::SpeculativeJIT::speculate):
1688 (JSC::DFG::SpeculativeJIT::emitSwitchChar):
1689 (JSC::DFG::SpeculativeJIT::emitSwitchString):
1690 * dfg/DFGSpeculativeJIT.h:
1691 (JSC::DFG::SpeculativeJIT::blessedBooleanResult):
1692 (JSC::DFG::SpeculativeJIT::unblessedBooleanResult):
1693 (JSC::DFG::SpeculativeJIT::booleanResult):
1694 * dfg/DFGSpeculativeJIT32_64.cpp:
1695 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
1696 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
1697 (JSC::DFG::SpeculativeJIT::emitCall):
1698 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
1699 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
1700 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
1701 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
1702 (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
1703 (JSC::DFG::SpeculativeJIT::compile):
1704 (JSC::DFG::branchIsCell):
1705 (JSC::DFG::branchNotCell):
1706 (JSC::DFG::SpeculativeJIT::branchIsOther):
1707 (JSC::DFG::SpeculativeJIT::branchNotOther):
1708 (JSC::DFG::SpeculativeJIT::moveTrueTo):
1709 (JSC::DFG::SpeculativeJIT::moveFalseTo):
1710 (JSC::DFG::SpeculativeJIT::blessBoolean):
1711 * dfg/DFGSpeculativeJIT64.cpp:
1712 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
1713 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
1714 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
1715 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
1716 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
1717 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
1718 (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
1719 (JSC::DFG::SpeculativeJIT::compile):
1720 (JSC::DFG::SpeculativeJIT::writeBarrier):
1721 (JSC::DFG::SpeculativeJIT::branchIsCell):
1722 (JSC::DFG::SpeculativeJIT::branchNotCell):
1723 (JSC::DFG::SpeculativeJIT::branchIsOther):
1724 (JSC::DFG::SpeculativeJIT::branchNotOther):
1725 (JSC::DFG::SpeculativeJIT::moveTrueTo):
1726 (JSC::DFG::SpeculativeJIT::moveFalseTo):
1727 (JSC::DFG::SpeculativeJIT::blessBoolean):
1728 * dfg/DFGUseKind.cpp:
1729 (WTF::printInternal):
1731 (JSC::DFG::typeFilterFor):
1732 * ftl/FTLCapabilities.cpp:
1733 (JSC::FTL::canCompile):
1734 * ftl/FTLLowerDFGToLLVM.cpp:
1735 (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq):
1736 (JSC::FTL::LowerDFGToLLVM::lowString):
1737 (JSC::FTL::LowerDFGToLLVM::lowStringIdent):
1738 (JSC::FTL::LowerDFGToLLVM::speculate):
1739 (JSC::FTL::LowerDFGToLLVM::speculateString):
1740 (JSC::FTL::LowerDFGToLLVM::speculateStringIdent):
1741 (JSC::FTL::LowerDFGToLLVM::speculateNotStringVar):
1742 * runtime/JSCJSValue.h:
1743 * tests/stress/string-ident-to-not-string-var-equality.js: Added.
1748 2014-03-18 Joseph Pecoraro <pecoraro@apple.com>
1750 Add Copyright to framework.sb
1751 https://bugs.webkit.org/show_bug.cgi?id=130413
1753 Reviewed by Timothy Hatcher.
1755 Other sb files got the copyright. Follow suit.
1759 2014-03-18 Matthew Mirman <mmirman@apple.com>
1761 Removed extra parens from if statement in a preprocessor define.
1762 https://bugs.webkit.org/show_bug.cgi?id=130408
1764 Reviewed by Filip Pizlo.
1766 * parser/Parser.cpp:
1768 2014-03-18 Filip Pizlo <fpizlo@apple.com>
1772 Rubber stamped by Dan Bernstein and Mark Hahnenberg.
1774 * Configurations/FeatureDefines.xcconfig:
1775 * ftl/FTLCompile.cpp:
1776 (JSC::FTL::compile):
1778 2014-03-17 Michael Saboff <msaboff@apple.com>
1780 V8 regexp spends most of its time in operationGetById
1781 https://bugs.webkit.org/show_bug.cgi?id=130380
1783 Reviewed by Filip Pizlo.
1785 Added String.length case to tryCacheGetByID that will only help the BaseLine JIT.
1786 When V8 regexp is run from the command line, this nets a 2% performance improvement.
1787 When the test is run for a longer amount of time, there is much less benefit as the
1788 DFG will emit the appropriate code for String.length. This does remove
1789 operationGetById as the hottest function whne run from the command line.
1792 (JSC::tryCacheGetByID):
1794 2014-03-17 Andreas Kling <akling@apple.com>
1796 Add one-deep cache to opaque roots hashset.
1797 <https://webkit.org/b/130357>
1799 The vast majority of WebCore JS wrappers will have their Document*
1800 as the root(). This change adds a simple optimization where we cache
1801 the last lookup and avoid going to the hashset for repeated queries.
1803 Looks like 0.4% progression on DYEB on my MBP.
1805 Reviewed by Mark Hahnenberg.
1807 * JavaScriptCore.xcodeproj/project.pbxproj:
1808 * heap/OpaqueRootSet.h: Added.
1809 (JSC::OpaqueRootSet::OpaqueRootSet):
1810 (JSC::OpaqueRootSet::contains):
1811 (JSC::OpaqueRootSet::isEmpty):
1812 (JSC::OpaqueRootSet::clear):
1813 (JSC::OpaqueRootSet::add):
1814 (JSC::OpaqueRootSet::size):
1815 (JSC::OpaqueRootSet::begin):
1816 (JSC::OpaqueRootSet::end):
1817 * heap/SlotVisitor.h:
1819 2014-03-17 Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com>
1821 Implement Math.hypot
1822 https://bugs.webkit.org/show_bug.cgi?id=129486
1824 Reviewed by Darin Adler.
1826 * runtime/MathObject.cpp:
1827 (JSC::MathObject::finishCreation):
1828 (JSC::mathProtoFuncHypot):
1830 2014-03-17 Zsolt Borbely <borbezs@inf.u-szeged.hu>
1832 Fix the !ENABLE(PROMISES) build
1833 https://bugs.webkit.org/show_bug.cgi?id=130328
1835 Reviewed by Darin Adler.
1837 Add missing ENABLE(PROMISES) guards.
1839 * runtime/JSGlobalObject.cpp:
1840 (JSC::JSGlobalObject::reset):
1841 (JSC::JSGlobalObject::visitChildren):
1842 * runtime/JSGlobalObject.h:
1843 * runtime/JSPromiseDeferred.cpp:
1844 * runtime/JSPromiseDeferred.h:
1845 * runtime/JSPromiseReaction.cpp:
1846 * runtime/JSPromiseReaction.h:
1851 2014-03-16 Andreas Kling <akling@apple.com>
1853 REGRESSION(r165703): JSC tests crashing in StringImpl::destroy().
1854 <https://webkit.org/b/130304>
1856 Reviewed by Anders Carlsson.
1858 Unreviewed, restoring the old behavior of OpaqueJSString::identifier()
1859 that doesn't put a potentially unwanted string into the Identifier table.
1861 * API/OpaqueJSString.cpp:
1862 (OpaqueJSString::identifier):
1864 2014-03-16 Brian Burg <bburg@apple.com>
1866 Web Inspector: generated backend commands should reflect build system ENABLE settings
1867 https://bugs.webkit.org/show_bug.cgi?id=130111
1869 Reviewed by Timothy Hatcher.
1873 Combine only the Inspector domains listed in INSPECTOR_DOMAINS,
1874 instead of globbing any .json file.
1876 * DerivedSources.make:
1878 Force the combined inspector protocol file to be regenerated if
1879 the content or list of domains itself changes.
1881 2014-03-16 Brian Burg <bburg@apple.com>
1883 Web Inspector: vended backend commands file should be generated as part of the build
1884 https://bugs.webkit.org/show_bug.cgi?id=130110
1886 Reviewed by Timothy Hatcher.
1888 * JavaScriptCore.xcodeproj/project.pbxproj: Copy InspectorJSBackendCommands.js to the
1889 private headers directory.
1891 2014-03-16 Darin Adler <darin@apple.com>
1893 Remove all uses of deprecatedCharacters from JavaScriptCore
1894 https://bugs.webkit.org/show_bug.cgi?id=130304
1896 Reviewed by Anders Carlsson.
1898 * API/JSValueRef.cpp:
1899 (JSValueMakeFromJSONString): Use characters16 in the 16-bit code path.
1900 * API/OpaqueJSString.cpp:
1901 (OpaqueJSString::~OpaqueJSString): Use characters 16 in the 16-bit code path.
1902 (OpaqueJSString::identifier): Get rid of custom Identifier constructor, and
1903 juse use the standard one that takes a String.
1904 (OpaqueJSString::characters): Use getCharactersWithUpconvert instead of a
1905 hand-written alternative.
1907 * bindings/ScriptValue.cpp:
1908 (Deprecated::jsToInspectorValue): Create InspectorString from String directly
1909 instead of involving a character pointer. Use the String from Identifier
1910 directly instead of making a new String.
1912 * inspector/ContentSearchUtilities.cpp:
1913 (Inspector::ContentSearchUtilities::createSearchRegexSource): Use StringBuilder
1914 instead of building a String a character at a time. This is still a very slow
1915 way to do this. Also use strchr to search for a character instead of building
1916 a String every time just to use find on it.
1918 * inspector/InspectorValues.cpp:
1919 (Inspector::doubleQuoteString): Remove unnecessary trip through a
1920 character pointer. This is still a really slow way to do this.
1921 (Inspector::InspectorValue::parseJSON): Use StringView::upconvertedCharacters
1922 instead of String::deprecatedCharacters. Still slow to always upconvert.
1924 * runtime/DateConstructor.cpp: Removed unneeded include.
1925 * runtime/DatePrototype.cpp: Ditto.
1927 * runtime/Identifier.h: Removed deprecatedCharacters function.
1929 * runtime/JSGlobalObjectFunctions.cpp:
1930 (JSC::encode): Added a type cast to avoid ambiguity with the two character-
1931 appending functions from JSStringBuilder. Removed unneeded code duplicating
1932 what JSStringBuilder already does in its character append function.
1933 (JSC::decode): Deleted code that creates a JSStringBuilder that is never used.
1934 (JSC::parseIntOverflow): Changed lengths to unsigned. Made only the overload that
1935 is used outside this file have external linkage. Added a new overload that takes
1937 (JSC::parseInt): Use StringView::substring to call parseIntOverflow.
1938 (JSC::globalFuncEscape): Use JSBuilder::append in a more efficient way for a
1941 * runtime/JSGlobalObjectFunctions.h: Removed unused overloads of parseIntOverflow.
1943 * runtime/JSStringBuilder.h: Marked this "lightly deprecated".
1944 (JSC::JSStringBuilder::append): Overloaded for better speed with 8-bit characters.
1945 Made one overload private. Fixed a performance bug where we would reserve capacity
1946 in the 8-bit buffer but then append to the 16-bit buffer.
1948 * runtime/ObjectPrototype.cpp: Removed unneeded include.
1950 * runtime/StringPrototype.cpp:
1951 (JSC::stringProtoFuncFontsize): Use StringView::getCharactersWithUpconvert.
1952 (JSC::stringProtoFuncLink): Ditto.
1954 2014-03-15 Filip Pizlo <fpizlo@apple.com>
1956 FTL ArrayifyToStructure shouldn't fail every time that it actually arrayifies
1957 https://bugs.webkit.org/show_bug.cgi?id=130296
1959 Reviewed by Andreas Kling.
1961 During the 32-bit structure ID work, the second load of the structure was removed.
1962 That's wrong. The whole point of loading the structure ID again is that the structure
1963 ID would have been changed by the arrayification call, and we're verifying that the
1964 arrayification succeeded in changing the structure. If we check the old structure - as
1965 the code was doing after the 32-bit structure ID work - then this check is guaranteed
1966 to fail, causing a significant performance regression.
1968 It's actually amazing that the regression wasn't bigger. The reason is that if FTL
1969 code pathologically exits but the equivalent DFG code doesn't, then the exponential
1970 backoff almost perfectly guarantees that we just end up in the DFG. For this code, at
1971 the time at least, the DFG wasn't much slower so this didn't cause too much pain.
1973 * ftl/FTLLowerDFGToLLVM.cpp:
1974 (JSC::FTL::LowerDFGToLLVM::compileArrayifyToStructure):
1976 2014-03-15 Filip Pizlo <fpizlo@apple.com>
1978 FTL should support CheckHasInstance/InstanceOf
1979 https://bugs.webkit.org/show_bug.cgi?id=130285
1981 Reviewed by Sam Weinig.
1983 Fairly straightforward; I also discovered an inaccurate FIXME in the process.
1985 * dfg/DFGFixupPhase.cpp:
1986 (JSC::DFG::FixupPhase::fixupNode):
1987 * ftl/FTLAbstractHeapRepository.h:
1988 * ftl/FTLCapabilities.cpp:
1989 (JSC::FTL::canCompile):
1990 * ftl/FTLLowerDFGToLLVM.cpp:
1991 (JSC::FTL::LowerDFGToLLVM::compileNode):
1992 (JSC::FTL::LowerDFGToLLVM::compileCheckHasInstance):
1993 (JSC::FTL::LowerDFGToLLVM::compileInstanceOf):
1995 (JSC::FTL::Output::phi):
1996 * tests/stress/instanceof.js: Added.
1997 * tests/stress/instanceof-not-cell.js: Added.
1999 2014-03-15 Michael Saboff <msaboff@apple.com>
2001 It should be possible to adjust DFG and FTL compiler thread priorities
2002 https://bugs.webkit.org/show_bug.cgi?id=130288
2004 Reviewed by Filip Pizlo.
2006 Added ability to change thread priorities relative to its current priority.
2007 Created options to adjust the priority of the DFG and FTL compilation work thread
2008 pools. For two core systems, there might be three runnable threads, the main thread,
2009 the DFG compilation thread and the FTL compilation thread. With the same priority,
2010 the scheduler is free to schedule whatever thread it wants. By lowering the
2011 compilation threads, the main thread can run. Further tests may suggest better values
2012 for the new options, priorityDeltaOfDFGCompilerThreads and priorityDeltaOfFTLCompilerThreads.
2014 For a two-core device, this change has a net positive improvement of 1-3% across
2015 SunSpider, Octane, Kraken and AsmBench.
2017 * dfg/DFGWorklist.cpp:
2018 (JSC::DFG::Worklist::finishCreation):
2019 (JSC::DFG::Worklist::create):
2020 (JSC::DFG::ensureGlobalDFGWorklist):
2021 (JSC::DFG::ensureGlobalFTLWorklist):
2022 * dfg/DFGWorklist.h:
2023 * runtime/Options.cpp:
2024 (JSC::computePriorityDeltaOfWorkerThreads):
2025 * runtime/Options.h:
2027 2014-03-15 David Kilzer <ddkilzer@apple.com>
2029 [iOS] Define SYSTEM_VERSION_PREFIX consistently
2030 <http://webkit.org/b/130293>
2031 <rdar://problem/15926359>
2033 Reviewed by Dan Bernstein.
2035 * Configurations/Version.xcconfig:
2036 (SYSTEM_VERSION_PREFIX_iphoneos): Sync with
2037 Source/WebKit/mac/Version.xcconfig.
2039 2014-03-15 David Kilzer <ddkilzer@apple.com>
2041 Fix build: using integer absolute value function 'abs' when argument is of floating point type
2042 <http://webkit.org/b/130286>
2044 Reviewed by Filip Pizlo.
2046 Fixes the following build failure using trunk clang:
2048 JavaScriptCore/assembler/MacroAssembler.h:992:17: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
2051 JavaScriptCore/assembler/MacroAssembler.h:992:17: note: use function 'fabs' instead
2056 * assembler/MacroAssembler.h:
2057 (JSC::MacroAssembler::shouldBlindDouble): Switch from abs() to
2060 2014-03-14 Oliver Hunt <oliver@apple.com>
2062 Reinstate intialiser syntax in for-in loops
2063 https://bugs.webkit.org/show_bug.cgi?id=130269
2065 Reviewed by Michael Saboff.
2067 Disallowing the initialiser broke some sites so this patch re-allows
2068 the syntax. We still disallow the syntax in 'of' and pattern based
2071 * parser/ASTBuilder.h:
2072 (JSC::ASTBuilder::isBindingNode):
2073 * parser/Parser.cpp:
2074 (JSC::Parser<LexerType>::parseVarDeclarationList):
2075 (JSC::Parser<LexerType>::parseForStatement):
2076 * parser/SyntaxChecker.h:
2077 (JSC::SyntaxChecker::operatorStackPop):
2079 2014-03-14 Mark Lam <mark.lam@apple.com>
2081 Accessing __lookupGetter__ and __lookupSetter__ should not crash the VM when undefined.
2082 <https://webkit.org/b/130279>
2084 Reviewed by Filip Pizlo.
2086 If neither the getter nor setter are defined, accessing __lookupGetter__
2087 and __lookupSetter__ will return undefined as expected. However, if the
2088 getter is defined but the setter is not, accessing __lookupSetter__ will
2089 crash the VM. Similarly, accessing __lookupGetter__ when only the setter
2090 is defined will crash the VM.
2092 The reason is because objectProtoFuncLookupGetter() and
2093 objectProtoFuncLookupSetter() did not check if the getter and setter
2094 value is non-null before returning it as an EncodedJSValue. The fix is
2095 to add the appropriate null checks.
2097 * runtime/ObjectPrototype.cpp:
2098 (JSC::objectProtoFuncLookupGetter):
2099 (JSC::objectProtoFuncLookupSetter):
2101 2014-03-14 Mark Rowe <mrowe@apple.com>
2103 Fix the production build.
2105 Don't rely on USE_INTERNAL_SDK being set for the Production configuration since UseInternalSDK.xcconfig won't
2106 be at the expected relative path when working from installed source.
2108 * Configurations/Base.xcconfig:
2110 2014-03-14 Maciej Stachowiak <mjs@apple.com>
2112 Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers
2113 https://bugs.webkit.org/show_bug.cgi?id=130276
2114 <rdar://problem/16266927>
2116 Reviewed by Simon Fraser.
2121 * API/JSBasePrivate.h:
2122 * API/JSCallbackConstructor.cpp:
2123 * API/JSCallbackConstructor.h:
2124 * API/JSCallbackFunction.cpp:
2125 * API/JSCallbackFunction.h:
2126 * API/JSCallbackObject.cpp:
2127 * API/JSCallbackObject.h:
2128 * API/JSCallbackObjectFunctions.h:
2129 * API/JSClassRef.cpp:
2131 * API/JSContextRef.cpp:
2132 * API/JSContextRef.h:
2133 * API/JSContextRefPrivate.h:
2134 * API/JSObjectRef.cpp:
2135 * API/JSObjectRef.h:
2136 * API/JSProfilerPrivate.cpp:
2137 * API/JSProfilerPrivate.h:
2138 * API/JSRetainPtr.h:
2139 * API/JSStringRef.cpp:
2140 * API/JSStringRef.h:
2141 * API/JSStringRefBSTR.cpp:
2142 * API/JSStringRefBSTR.h:
2143 * API/JSStringRefCF.cpp:
2144 * API/JSStringRefCF.h:
2145 * API/JSValueRef.cpp:
2148 * API/JavaScriptCore.h:
2149 * API/OpaqueJSString.cpp:
2150 * API/OpaqueJSString.h:
2151 * API/tests/JSNode.c:
2152 * API/tests/JSNode.h:
2153 * API/tests/JSNodeList.c:
2154 * API/tests/JSNodeList.h:
2157 * API/tests/NodeList.c:
2158 * API/tests/NodeList.h:
2159 * API/tests/minidom.c:
2160 * API/tests/minidom.js:
2161 * API/tests/testapi.c:
2162 * API/tests/testapi.js:
2163 * DerivedSources.make:
2164 * bindings/ScriptValue.cpp:
2165 * bytecode/CodeBlock.cpp:
2166 * bytecode/CodeBlock.h:
2167 * bytecode/EvalCodeCache.h:
2168 * bytecode/Instruction.h:
2169 * bytecode/JumpTable.cpp:
2170 * bytecode/JumpTable.h:
2171 * bytecode/Opcode.cpp:
2172 * bytecode/Opcode.h:
2173 * bytecode/SamplingTool.cpp:
2174 * bytecode/SamplingTool.h:
2175 * bytecode/SpeculatedType.cpp:
2176 * bytecode/SpeculatedType.h:
2177 * bytecode/ValueProfile.h:
2178 * bytecompiler/BytecodeGenerator.cpp:
2179 * bytecompiler/BytecodeGenerator.h:
2180 * bytecompiler/Label.h:
2181 * bytecompiler/LabelScope.h:
2182 * bytecompiler/RegisterID.h:
2183 * debugger/DebuggerCallFrame.cpp:
2184 * debugger/DebuggerCallFrame.h:
2185 * dfg/DFGDesiredStructureChains.cpp:
2186 * dfg/DFGDesiredStructureChains.h:
2187 * heap/GCActivityCallback.cpp:
2188 * heap/GCActivityCallback.h:
2189 * inspector/ConsoleMessage.cpp:
2190 * inspector/ConsoleMessage.h:
2191 * inspector/IdentifiersFactory.cpp:
2192 * inspector/IdentifiersFactory.h:
2193 * inspector/InjectedScriptManager.cpp:
2194 * inspector/InjectedScriptManager.h:
2195 * inspector/InjectedScriptSource.js:
2196 * inspector/ScriptBreakpoint.h:
2197 * inspector/ScriptDebugListener.h:
2198 * inspector/ScriptDebugServer.cpp:
2199 * inspector/ScriptDebugServer.h:
2200 * inspector/agents/InspectorAgent.cpp:
2201 * inspector/agents/InspectorAgent.h:
2202 * inspector/agents/InspectorDebuggerAgent.cpp:
2203 * inspector/agents/InspectorDebuggerAgent.h:
2204 * interpreter/Interpreter.cpp:
2205 * interpreter/Interpreter.h:
2206 * interpreter/JSStack.cpp:
2207 * interpreter/JSStack.h:
2208 * interpreter/Register.h:
2209 * jit/CompactJITCodeMap.h:
2212 * jit/JITStubsARM.h:
2213 * jit/JITStubsARMv7.h:
2214 * jit/JITStubsX86.h:
2215 * jit/JITStubsX86_64.h:
2216 * os-win32/stdbool.h:
2217 * parser/SourceCode.h:
2218 * parser/SourceProvider.h:
2219 * profiler/LegacyProfiler.cpp:
2220 * profiler/LegacyProfiler.h:
2221 * profiler/ProfileNode.cpp:
2222 * profiler/ProfileNode.h:
2223 * runtime/ArrayBufferView.cpp:
2224 * runtime/ArrayBufferView.h:
2225 * runtime/BatchedTransitionOptimizer.h:
2226 * runtime/CallData.h:
2227 * runtime/ConstructData.h:
2228 * runtime/DumpContext.cpp:
2229 * runtime/DumpContext.h:
2230 * runtime/ExceptionHelpers.cpp:
2231 * runtime/ExceptionHelpers.h:
2232 * runtime/InitializeThreading.cpp:
2233 * runtime/InitializeThreading.h:
2234 * runtime/IntegralTypedArrayBase.h:
2235 * runtime/IntendedStructureChain.cpp:
2236 * runtime/IntendedStructureChain.h:
2237 * runtime/JSActivation.cpp:
2238 * runtime/JSActivation.h:
2239 * runtime/JSExportMacros.h:
2240 * runtime/JSGlobalObject.cpp:
2241 * runtime/JSNotAnObject.cpp:
2242 * runtime/JSNotAnObject.h:
2243 * runtime/JSPropertyNameIterator.cpp:
2244 * runtime/JSPropertyNameIterator.h:
2245 * runtime/JSSegmentedVariableObject.cpp:
2246 * runtime/JSSegmentedVariableObject.h:
2247 * runtime/JSSymbolTableObject.cpp:
2248 * runtime/JSSymbolTableObject.h:
2249 * runtime/JSTypeInfo.h:
2250 * runtime/JSVariableObject.cpp:
2251 * runtime/JSVariableObject.h:
2252 * runtime/PropertyTable.cpp:
2253 * runtime/PutPropertySlot.h:
2254 * runtime/SamplingCounter.cpp:
2255 * runtime/SamplingCounter.h:
2256 * runtime/Structure.cpp:
2257 * runtime/Structure.h:
2258 * runtime/StructureChain.cpp:
2259 * runtime/StructureChain.h:
2260 * runtime/StructureInlines.h:
2261 * runtime/StructureTransitionTable.h:
2262 * runtime/SymbolTable.cpp:
2263 * runtime/SymbolTable.h:
2264 * runtime/TypedArrayBase.h:
2265 * runtime/TypedArrayType.cpp:
2266 * runtime/TypedArrayType.h:
2269 * yarr/RegularExpression.cpp:
2270 * yarr/RegularExpression.h:
2272 2014-03-14 Filip Pizlo <fpizlo@apple.com>
2274 Final FTL iOS build magic
2275 https://bugs.webkit.org/show_bug.cgi?id=130281
2277 Reviewed by Michael Saboff.
2279 * Configurations/Base.xcconfig: For now our LLVM headers are in /usr/local/LLVMForJavaScriptCore/include, which is the same as OS X.
2280 * Configurations/LLVMForJSC.xcconfig: We need to be more careful about how we specify library paths if we want to get the prioritzation right. Also we need protobuf because things. :-/
2282 2014-03-14 Joseph Pecoraro <pecoraro@apple.com>
2284 Web Inspector: Gracefully handle nil name -[JSContext setName:]
2285 https://bugs.webkit.org/show_bug.cgi?id=130262
2287 Reviewed by Mark Hahnenberg.
2290 (-[JSContext setName:]):
2291 Gracefully handle nil input.
2293 * API/tests/testapi.c:
2294 (globalContextNameTest):
2295 * API/tests/testapi.mm:
2296 Test for nil / NULL names in the ObjC and C APIs.
2298 2014-03-11 Oliver Hunt <oliver@apple.com>
2300 Improve dom error messages
2301 https://bugs.webkit.org/show_bug.cgi?id=130103
2303 Reviewed by Andreas Kling.
2305 Add new helper function.
2308 (JSC::throwVMTypeError):
2310 2014-03-14 László Langó <llango.u-szeged@partner.samsung.com>
2312 Remove unused method declaration.
2313 https://bugs.webkit.org/show_bug.cgi?id=130238
2315 Reviewed by Filip Pizlo.
2317 The implementation of CallFrame::dumpCaller was removed in
2318 http://trac.webkit.org/changeset/153183, but the declaration of it was not.
2320 * interpreter/CallFrame.h:
2321 Remove CallFrame::dumpCaller() method declaration.
2323 2014-03-12 Sergio Villar Senin <svillar@igalia.com>
2325 Rename DEFINE_STATIC_LOCAL to DEPRECATED_DEFINE_STATIC_LOCAL
2326 https://bugs.webkit.org/show_bug.cgi?id=129612
2328 Reviewed by Darin Adler.
2330 For new code use static NeverDestroyed<T> instead.
2332 * API/JSAPIWrapperObject.mm:
2333 (jsAPIWrapperObjectHandleOwner):
2334 * API/JSManagedValue.mm:
2335 (managedValueHandleOwner):
2336 * inspector/agents/InspectorDebuggerAgent.cpp:
2337 (Inspector::objectGroupForBreakpointAction):
2338 * inspector/scripts/CodeGeneratorInspectorStrings.py:
2339 * interpreter/JSStack.cpp:
2340 (JSC::stackStatisticsMutex):
2341 * jit/ExecutableAllocator.cpp:
2342 (JSC::DemandExecutableAllocator::allocators):
2344 2014-03-12 Gavin Barraclough <barraclough@apple.com>
2346 Reduce memory use for static property maps
2347 https://bugs.webkit.org/show_bug.cgi?id=129986
2349 Reviewed by Andreas Kling.
2351 Static property tables are currently duplicated on first use from read-only memory into dirty memory
2352 in every process, and since the entries are large (48 bytes) and the tables can be unusually sparse
2353 (we use a custom hash table without a rehash) a lot of memory may be wasted.
2355 First, reduce the size of the hashtable. Instead of storing values in the table the hashtable maps
2356 from string hashes to indicies into a densely packed array of values. Compute the index table at
2357 compile time as a part of the derived sources step, such that this may be read-only data.
2359 Second, don't copy all data from the HashTableValue array into a HashEntry objects. Instead refer
2360 directly to the HashTableValue entries. The only data that needs to be allocated at runtime are the
2361 keys, which are Identifiers.
2363 * create_hash_table:
2364 - emit the hash table index into the derived source (we were calculating this already to ensure chaining does not get too deep).
2366 (JSC::Lexer<LChar>::parseIdentifier):
2367 (JSC::Lexer<UChar>::parseIdentifier):
2368 (JSC::Lexer<T>::parseIdentifierSlowCase):
2369 - HashEntry -> HashTableValue.
2371 (JSC::Keywords::getKeyword):
2372 - HashEntry -> HashTableValue.
2373 * runtime/ClassInfo.h:
2374 - removed HashEntry.
2375 * runtime/JSObject.cpp:
2376 (JSC::getClassPropertyNames):
2377 - use HashTable::ConstIterator.
2378 (JSC::JSObject::put):
2379 (JSC::JSObject::deleteProperty):
2380 (JSC::JSObject::findPropertyHashEntry):
2381 - HashEntry -> HashTableValue.
2382 (JSC::JSObject::reifyStaticFunctionsForDelete):
2383 - changed HashTable::ConstIterator interface.
2384 * runtime/JSObject.h:
2385 - HashEntry -> HashTableValue.
2386 * runtime/Lookup.cpp:
2387 (JSC::HashTable::createTable):
2388 - table -> keys, keys array is now densely packed.
2389 (JSC::HashTable::deleteTable):
2391 (JSC::setUpStaticFunctionSlot):
2392 - HashEntry -> HashTableValue.
2394 (JSC::HashTableValue::builtinGenerator):
2395 (JSC::HashTableValue::function):
2396 (JSC::HashTableValue::functionLength):
2397 (JSC::HashTableValue::propertyGetter):
2398 (JSC::HashTableValue::propertyPutter):
2399 (JSC::HashTableValue::lexerValue):
2400 - added accessor methods from HashEntry.
2401 (JSC::HashTable::copy):
2403 (JSC::HashTable::initializeIfNeeded):
2405 (JSC::HashTable::entry):
2406 - HashEntry -> HashTableValue.
2407 (JSC::HashTable::ConstIterator::ConstIterator):
2408 - iterate packed value array, so no need to skipInvalidKeys().
2409 (JSC::HashTable::ConstIterator::value):
2410 (JSC::HashTable::ConstIterator::key):
2411 (JSC::HashTable::ConstIterator::operator->):
2412 - accessors now get HashTableValue/StringImpl* separately.
2413 (JSC::HashTable::ConstIterator::operator++):
2414 - iterate packed value array, so no need to skipInvalidKeys().
2415 (JSC::HashTable::end):
2416 - end is now size of dense not sparse array.
2417 (JSC::getStaticPropertySlot):
2418 (JSC::getStaticFunctionSlot):
2419 (JSC::getStaticValueSlot):
2422 - HashEntry -> HashTableValue.
2424 2014-03-13 Filip Pizlo <fpizlo@apple.com>
2426 Unreviewed, fix Mac no-FTL build.
2428 * llvm/library/LLVMExports.cpp:
2429 (initializeAndGetJSCLLVMAPI):
2431 2014-03-13 Juergen Ributzka <juergen@apple.com>
2433 Only export initializeAndGetJSCLLVMAPI from libllvmForJSC.dylib
2434 https://bugs.webkit.org/show_bug.cgi?id=130224
2436 Reviewed by Filip Pizlo.
2438 This limits the exported symbols to only initializeAndGetJSCLLVMAPI from
2439 the LLVM dylib. This allows the dylib to be safely used with other LLVM
2440 dylibs on the same system. It also reduces the dynamic linking overhead
2441 and also reduces the size by 6MB, because the linker can now dead strip
2442 many unused functions.
2444 * Configurations/LLVMForJSC.xcconfig:
2446 2014-03-13 Andreas Kling <akling@apple.com>
2448 VM::discardAllCode() should clear the RegExp cache.
2449 <https://webkit.org/b/130144>
2451 Reviewed by Michael Saboff.
2454 (JSC::VM::discardAllCode):
2456 2014-03-13 Andreas Kling <akling@apple.com>
2458 Revert "Short-circuit JSGlobalObjectInspectorController when not inspecting."
2459 <https://webkit.org/b/129995>
2461 This code path is not taken anymore on DYEB, and I can't explain why
2462 it was showing up in my profiles. Backing it out per JoePeck's suggestion.
2464 * inspector/JSGlobalObjectInspectorController.cpp:
2465 (Inspector::JSGlobalObjectInspectorController::reportAPIException):
2467 2014-03-13 Filip Pizlo <fpizlo@apple.com>
2469 FTL should support IsBlah
2470 https://bugs.webkit.org/show_bug.cgi?id=130202
2472 Reviewed by Geoffrey Garen.
2474 * ftl/FTLCapabilities.cpp:
2475 (JSC::FTL::canCompile):
2476 * ftl/FTLIntrinsicRepository.h:
2477 * ftl/FTLLowerDFGToLLVM.cpp:
2478 (JSC::FTL::LowerDFGToLLVM::compileNode):
2479 (JSC::FTL::LowerDFGToLLVM::compileIsUndefined):
2480 (JSC::FTL::LowerDFGToLLVM::compileIsBoolean):
2481 (JSC::FTL::LowerDFGToLLVM::compileIsNumber):
2482 (JSC::FTL::LowerDFGToLLVM::compileIsString):
2483 (JSC::FTL::LowerDFGToLLVM::compileIsObject):
2484 (JSC::FTL::LowerDFGToLLVM::compileIsFunction):
2485 (JSC::FTL::LowerDFGToLLVM::compileStoreBarrier):
2486 (JSC::FTL::LowerDFGToLLVM::compileStoreBarrierWithNullCheck):
2487 (JSC::FTL::LowerDFGToLLVM::isNotCellOrMisc):
2488 (JSC::FTL::LowerDFGToLLVM::isNumber):
2489 (JSC::FTL::LowerDFGToLLVM::isNotNumber):
2490 (JSC::FTL::LowerDFGToLLVM::isBoolean):
2491 * ftl/FTLOSRExitCompiler.cpp:
2492 * tests/stress/is-undefined-exit-on-masquerader.js: Added.
2496 * tests/stress/is-undefined-jettison-on-masquerader.js: Added.
2499 * tests/stress/is-undefined-masquerader.js: Added.
2503 2014-03-13 Mark Lam <mark.lam@apple.com>
2505 JS benchmarks crash with a bus error on 32-bit x86.
2506 <https://webkit.org/b/130203>
2508 Reviewed by Geoffrey Garen.
2510 The issue is that generateGetByIdStub() can potentially use the same register
2511 for the JSValue base register and the target tag register. After loading the
2512 tag value into the target tag register, the JSValue base address is lost.
2513 The code then proceeds to load the payload value using the base register, and
2514 this results in a crash.
2516 The fix is to check if the base register is the same as the target tag register.
2517 If so, we should make a copy the base register first before loading the tag
2518 value, and use the copy to load the payload value instead.
2521 (JSC::generateGetByIdStub):
2523 2014-03-12 Filip Pizlo <fpizlo@apple.com>
2525 WebKit shouldn't crash on uniprocessor machines
2526 https://bugs.webkit.org/show_bug.cgi?id=130176
2528 Reviewed by Michael Saboff.
2530 Previously the math for computing the number of JIT compiler threads would come up with
2531 zero threads on uniprocessor machines, and then the Worklist code would assert.
2533 * runtime/Options.cpp:
2534 (JSC::computeNumberOfWorkerThreads):
2535 * runtime/Options.h:
2537 2014-03-13 Radu Stavila <stavila@adobe.com>
2539 Webkit not building on XCode 5.1 due to garbage collection no longer being supported
2540 https://bugs.webkit.org/show_bug.cgi?id=130087
2542 Reviewed by Mark Rowe.
2544 Disable garbage collection on macosx when not using internal SDK.
2546 * Configurations/Base.xcconfig:
2548 2014-03-10 Darin Adler <darin@apple.com>
2550 Avoid copy-prone idiom "for (auto item : collection)"
2551 https://bugs.webkit.org/show_bug.cgi?id=129990
2553 Reviewed by Geoffrey Garen.
2555 * heap/CodeBlockSet.h:
2556 (JSC::CodeBlockSet::iterate): Use auto& to be sure we don't copy by accident.
2557 * inspector/ScriptDebugServer.cpp:
2558 (Inspector::ScriptDebugServer::dispatchBreakpointActionLog): Use auto* to
2559 make explicit that we are iterating through pointers.
2560 (Inspector::ScriptDebugServer::dispatchBreakpointActionSound): Ditto.
2561 (Inspector::ScriptDebugServer::dispatchBreakpointActionProbe): Ditto.
2562 * inspector/agents/InspectorDebuggerAgent.cpp:
2563 (Inspector::InspectorDebuggerAgent::removeBreakpoint): Use auto&, and also
2564 get rid of an unneeded local variable.
2566 2014-03-13 Brian Burg <bburg@apple.com>
2568 Web Inspector: Remove unused callId parameter from evaluateInWebInspector
2569 https://bugs.webkit.org/show_bug.cgi?id=129744
2571 Reviewed by Timothy Hatcher.
2573 * inspector/agents/InspectorAgent.cpp:
2574 (Inspector::InspectorAgent::enable):
2575 (Inspector::InspectorAgent::evaluateForTestInFrontend):
2576 * inspector/agents/InspectorAgent.h:
2577 * inspector/protocol/InspectorDomain.json:
2579 2014-03-11 Filip Pizlo <fpizlo@apple.com>
2581 ASSERTION FAILED: node->op() == Phi || node->op() == SetArgument
2582 https://bugs.webkit.org/show_bug.cgi?id=130069
2584 Reviewed by Geoffrey Garen.
2586 This was a great assertion, and it represents our strictest interpretation of the rules of
2587 our intermediate representation. However, fixing DCE to actually preserve the relevant
2588 property would be hard, and it wouldn't have an observable effect right now because nobody
2589 actually uses the propery of CPS that this assertion is checking for.
2591 In particular, we do always require, and rely on, the fact that non-captured variables
2592 have variablesAtTail refer to the last interesting use of the variable: a SetLocal if the
2593 block assigns to the variable, a GetLocal if it only reads from it, and a Flush,
2594 PhantomLocal, or Phi otherwise. We do preserve this property successfully and DCE was not
2595 broken in this regard. But, in the strictest sense, CPS also means that for captured
2596 variables, variablesAtTail also continues to point to the last relevant use of the
2597 variable. In particular, if there are multiple GetLocals, then it should point to the last
2598 one. This is hard for DCE to preserve. Also, nobody relies on variablesAtTail for captured
2599 variables, except to check the VariableAccessData; but in that case, we don't really need
2600 the *last* relevant use of the variable - any node that mentions the same variable will do
2603 So, this change loosens the assertion and adds a detailed FIXME describing what we would
2604 have to do if we wanted to preserve the more strict property.
2606 This also makes changes to various debug printing paths so that validation doesn't crash
2607 during graph dump. This also adds tests for the interesting cases of DCE failing to
2608 preserve CPS in the strictest sense. This also attempts to win the record for longest test
2611 * bytecode/CodeBlock.cpp:
2612 (JSC::CodeBlock::hashAsStringIfPossible):
2613 (JSC::CodeBlock::dumpAssumingJITType):
2614 * bytecode/CodeBlock.h:
2615 * bytecode/CodeOrigin.cpp:
2616 (JSC::InlineCallFrame::hashAsStringIfPossible):
2617 (JSC::InlineCallFrame::dumpBriefFunctionInformation):
2618 * bytecode/CodeOrigin.h:
2619 * dfg/DFGCPSRethreadingPhase.cpp:
2620 (JSC::DFG::CPSRethreadingPhase::run):
2621 * dfg/DFGDCEPhase.cpp:
2622 (JSC::DFG::DCEPhase::cleanVariables):
2623 * dfg/DFGInPlaceAbstractState.cpp:
2624 (JSC::DFG::InPlaceAbstractState::mergeStateAtTail):
2625 * runtime/FunctionExecutableDump.cpp:
2626 (JSC::FunctionExecutableDump::dump):
2627 * tests/stress/dead-access-to-captured-variable-preceded-by-a-live-store-in-function-with-multiple-basic-blocks.js: Added.
2629 * tests/stress/dead-access-to-captured-variable-preceded-by-a-live-store.js: Added.
2632 2014-03-12 Brian Burg <bburg@apple.com>
2634 Web Replay: add infrastructure for memoizing nondeterministic DOM APIs
2635 https://bugs.webkit.org/show_bug.cgi?id=129445
2637 Reviewed by Timothy Hatcher.
2639 There was a bug in the replay inputs code generator that would include
2640 headers for definitions of enum classes, even though they can be safely
2643 * replay/scripts/CodeGeneratorReplayInputs.py:
2644 (Generator.generate_includes): Only include for copy constructor if the
2645 type is a heavy scalar (i.e., String, URL), not a normal scalar
2646 (i.e., int, double, enum classes).
2648 (Generator.generate_type_forward_declarations): Forward-declare scalars
2649 that are enums or enum classes.
2651 2014-03-12 Joseph Pecoraro <pecoraro@apple.com>
2653 Web Inspector: Disable REMOTE_INSPECTOR in earlier OS X releases
2654 https://bugs.webkit.org/show_bug.cgi?id=130118
2656 Reviewed by Timothy Hatcher.
2658 * Configurations/FeatureDefines.xcconfig:
2660 2014-03-12 Joseph Pecoraro <pecoraro@apple.com>
2662 Web Inspector: Hang in Remote Inspection triggering breakpoint from console
2663 https://bugs.webkit.org/show_bug.cgi?id=130032
2665 Reviewed by Timothy Hatcher.
2667 * inspector/EventLoop.h:
2668 * inspector/EventLoop.cpp:
2669 (Inspector::EventLoop::remoteInspectorRunLoopMode):
2670 (Inspector::EventLoop::cycle):
2671 Expose the run loop mode name so it can be used if needed by others.
2673 * inspector/remote/RemoteInspectorDebuggableConnection.h:
2674 * inspector/remote/RemoteInspectorDebuggableConnection.mm:
2675 (Inspector::RemoteInspectorBlock::RemoteInspectorBlock):
2676 (Inspector::RemoteInspectorBlock::~RemoteInspectorBlock):
2677 (Inspector::RemoteInspectorBlock::operator=):
2678 (Inspector::RemoteInspectorBlock::operator()):
2679 (Inspector::RemoteInspectorQueueTask):
2680 Instead of a dispatch_queue, have our own static Vector of debugger tasks.
2682 (Inspector::RemoteInspectorHandleRunSource):
2683 (Inspector::RemoteInspectorInitializeQueue):
2684 Initialize the static queue and run loop source. When the run loop source
2685 fires, it will exhaust the queue of debugger messages.
2687 (Inspector::RemoteInspectorDebuggableConnection::RemoteInspectorDebuggableConnection):
2688 (Inspector::RemoteInspectorDebuggableConnection::~RemoteInspectorDebuggableConnection):
2689 When we get a debuggable connection add a run loop source for inspector commands.
2691 (Inspector::RemoteInspectorDebuggableConnection::dispatchAsyncOnDebuggable):
2692 (Inspector::RemoteInspectorDebuggableConnection::sendMessageToBackend):
2693 Enqueue blocks on our Vector instead of our dispatch_queue.
2695 2014-03-12 Commit Queue <commit-queue@webkit.org>
2697 Unreviewed, rolling out r165482.
2698 https://bugs.webkit.org/show_bug.cgi?id=130157
2700 Broke the windows build; "error C2466: cannot allocate an
2701 array of constant size 0" (Requested by jernoble on #webkit).
2705 "Reduce memory use for static property maps"
2706 https://bugs.webkit.org/show_bug.cgi?id=129986
2707 http://trac.webkit.org/changeset/165482
2709 2014-03-12 Mark Hahnenberg <mhahnenberg@apple.com>
2711 Remove HandleSet::m_nextToFinalize
2712 https://bugs.webkit.org/show_bug.cgi?id=130109
2714 Reviewed by Mark Lam.
2716 This is a remnant of when HandleSet contained things that needed to be finalized.
2718 * heap/HandleSet.cpp:
2719 (JSC::HandleSet::HandleSet):
2720 (JSC::HandleSet::writeBarrier):
2722 (JSC::HandleSet::allocate):
2723 (JSC::HandleSet::deallocate):
2725 2014-03-12 Mark Hahnenberg <mhahnenberg@apple.com>
2727 Layout Test fast/workers/worker-gc.html is failing
2728 https://bugs.webkit.org/show_bug.cgi?id=130135
2730 Reviewed by Geoffrey Garen.
2732 When removing MarkedBlocks, we always expect them to be in the MarkedAllocator's
2733 main list of blocks, i.e. not in the retired list. When shutting down the VM this
2734 wasn't always the case which was causing ASSERTs to fire. We should rearrange things
2735 so that allocators are notified with lastChanceToFinalize. This will give them
2736 the chance to move their retired blocks back into the main list before removing them all.
2738 * heap/MarkedAllocator.cpp:
2739 (JSC::LastChanceToFinalize::operator()):
2740 (JSC::MarkedAllocator::lastChanceToFinalize):
2741 * heap/MarkedAllocator.h:
2742 * heap/MarkedSpace.cpp:
2743 (JSC::LastChanceToFinalize::operator()):
2744 (JSC::MarkedSpace::lastChanceToFinalize):
2746 2014-03-12 Gavin Barraclough <barraclough@apple.com>
2748 Reduce memory use for static property maps
2749 https://bugs.webkit.org/show_bug.cgi?id=129986
2751 Reviewed by Andreas Kling.
2753 Static property tables are currently duplicated on first use from read-only memory into dirty memory
2754 in every process, and since the entries are large (48 bytes) and the tables can be unusually sparse
2755 (we use a custom hash table without a rehash) a lot of memory may be wasted.
2757 First, reduce the size of the hashtable. Instead of storing values in the table the hashtable maps
2758 from string hashes to indicies into a densely packed array of values. Compute the index table at
2759 compile time as a part of the derived sources step, such that this may be read-only data.
2761 Second, don't copy all data from the HashTableValue array into a HashEntry objects. Instead refer
2762 directly to the HashTableValue entries. The only data that needs to be allocated at runtime are the
2763 keys, which are Identifiers.
2765 * create_hash_table:
2766 - emit the hash table index into the derived source (we were calculating this already to ensure chaining does not get too deep).
2768 (JSC::Lexer<LChar>::parseIdentifier):
2769 (JSC::Lexer<UChar>::parseIdentifier):
2770 (JSC::Lexer<T>::parseIdentifierSlowCase):
2771 - HashEntry -> HashTableValue.
2773 (JSC::Keywords::getKeyword):
2774 - HashEntry -> HashTableValue.
2775 * runtime/ClassInfo.h:
2776 - removed HashEntry.
2777 * runtime/JSObject.cpp:
2778 (JSC::getClassPropertyNames):
2779 - use HashTable::ConstIterator.
2780 (JSC::JSObject::put):
2781 (JSC::JSObject::deleteProperty):
2782 (JSC::JSObject::findPropertyHashEntry):
2783 - HashEntry -> HashTableValue.
2784 (JSC::JSObject::reifyStaticFunctionsForDelete):
2785 - changed HashTable::ConstIterator interface.
2786 * runtime/JSObject.h:
2787 - HashEntry -> HashTableValue.
2788 * runtime/Lookup.cpp:
2789 (JSC::HashTable::createTable):
2790 - table -> keys, keys array is now densely packed.
2791 (JSC::HashTable::deleteTable):
2793 (JSC::setUpStaticFunctionSlot):
2794 - HashEntry -> HashTableValue.
2796 (JSC::HashTableValue::builtinGenerator):
2797 (JSC::HashTableValue::function):
2798 (JSC::HashTableValue::functionLength):
2799 (JSC::HashTableValue::propertyGetter):
2800 (JSC::HashTableValue::propertyPutter):
2801 (JSC::HashTableValue::lexerValue):
2802 - added accessor methods from HashEntry.
2803 (JSC::HashTable::copy):
2805 (JSC::HashTable::initializeIfNeeded):
2807 (JSC::HashTable::entry):
2808 - HashEntry -> HashTableValue.
2809 (JSC::HashTable::ConstIterator::ConstIterator):
2810 - iterate packed value array, so no need to skipInvalidKeys().
2811 (JSC::HashTable::ConstIterator::value):
2812 (JSC::HashTable::ConstIterator::key):
2813 (JSC::HashTable::ConstIterator::operator->):
2814 - accessors now get HashTableValue/StringImpl* separately.
2815 (JSC::HashTable::ConstIterator::operator++):
2816 - iterate packed value array, so no need to skipInvalidKeys().
2817 (JSC::HashTable::end):
2818 - end is now size of dense not sparse array.
2819 (JSC::getStaticPropertySlot):
2820 (JSC::getStaticFunctionSlot):
2821 (JSC::getStaticValueSlot):
2824 - HashEntry -> HashTableValue.
2826 2014-03-11 Filip Pizlo <fpizlo@apple.com>
2828 It should be possible to build WebKit with FTL on iOS
2829 https://bugs.webkit.org/show_bug.cgi?id=130116
2831 Reviewed by Dan Bernstein.
2833 * Configurations/Base.xcconfig:
2835 2014-03-10 Filip Pizlo <fpizlo@apple.com>
2837 GetById list caching should use something object-oriented rather than PolymorphicAccessStructureList
2838 https://bugs.webkit.org/show_bug.cgi?id=129778
2840 Reviewed by Geoffrey Garen.
2842 Also deduplicate the GetById getter call caching. Also add some small tests for
2845 This change reduces the amount of code involved in GetById access caching and it
2846 creates data structures that can serve as an elegant scaffold for introducing other
2847 kinds of caches or improving current caching styles. It will definitely make getter
2848 performance improvements easier to implement.
2851 * GNUmakefile.list.am:
2852 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2853 * JavaScriptCore.xcodeproj/project.pbxproj:
2854 * bytecode/CodeBlock.cpp:
2855 (JSC::CodeBlock::printGetByIdCacheStatus):
2856 * bytecode/GetByIdStatus.cpp:
2857 (JSC::GetByIdStatus::computeForStubInfo):
2858 * bytecode/PolymorphicGetByIdList.cpp: Added.
2859 (JSC::GetByIdAccess::GetByIdAccess):
2860 (JSC::GetByIdAccess::~GetByIdAccess):
2861 (JSC::GetByIdAccess::fromStructureStubInfo):
2862 (JSC::GetByIdAccess::visitWeak):
2863 (JSC::PolymorphicGetByIdList::PolymorphicGetByIdList):
2864 (JSC::PolymorphicGetByIdList::from):
2865 (JSC::PolymorphicGetByIdList::~PolymorphicGetByIdList):
2866 (JSC::PolymorphicGetByIdList::currentSlowPathTarget):
2867 (JSC::PolymorphicGetByIdList::addAccess):
2868 (JSC::PolymorphicGetByIdList::isFull):
2869 (JSC::PolymorphicGetByIdList::isAlmostFull):
2870 (JSC::PolymorphicGetByIdList::didSelfPatching):
2871 (JSC::PolymorphicGetByIdList::visitWeak):
2872 * bytecode/PolymorphicGetByIdList.h: Added.
2873 (JSC::GetByIdAccess::GetByIdAccess):
2874 (JSC::GetByIdAccess::isSet):
2875 (JSC::GetByIdAccess::operator!):
2876 (JSC::GetByIdAccess::type):
2877 (JSC::GetByIdAccess::structure):
2878 (JSC::GetByIdAccess::chain):
2879 (JSC::GetByIdAccess::chainCount):
2880 (JSC::GetByIdAccess::stubRoutine):
2881 (JSC::GetByIdAccess::doesCalls):
2882 (JSC::PolymorphicGetByIdList::isEmpty):
2883 (JSC::PolymorphicGetByIdList::size):
2884 (JSC::PolymorphicGetByIdList::at):
2885 (JSC::PolymorphicGetByIdList::operator[]):
2886 * bytecode/StructureStubInfo.cpp:
2887 (JSC::StructureStubInfo::deref):
2888 (JSC::StructureStubInfo::visitWeakReferences):
2889 * bytecode/StructureStubInfo.h:
2890 (JSC::isGetByIdAccess):
2891 (JSC::StructureStubInfo::initGetByIdList):
2893 (JSC::generateGetByIdStub):
2894 (JSC::tryCacheGetByID):
2895 (JSC::patchJumpToGetByIdStub):
2896 (JSC::tryBuildGetByIDList):
2897 (JSC::tryBuildPutByIdList):
2898 * tests/stress/getter.js: Added.
2901 * tests/stress/polymorphic-prototype-accesses.js: Added.
2905 * tests/stress/prototype-getter.js: Added.
2908 * tests/stress/simple-prototype-accesses.js: Added.
2912 2014-03-11 Mark Hahnenberg <mhahnenberg@apple.com>
2914 MarkedBlocks that are "full enough" shouldn't be swept after EdenCollections
2915 https://bugs.webkit.org/show_bug.cgi?id=129920
2917 Reviewed by Geoffrey Garen.
2919 This patch introduces the notion of "retiring" MarkedBlocks. We retire a MarkedBlock
2920 when the amount of free space in a MarkedBlock drops below a certain threshold.
2921 Retired blocks are not considered for sweeping.
2923 This is profitable because it reduces churn during sweeping. To build a free list,
2924 we have to scan through each cell in a block. After a collection, all objects that
2925 are live in the block will remain live until the next FullCollection, at which time
2926 we un-retire all previously retired blocks. Thus, a small number of objects in a block
2927 that die during each EdenCollection could cause us to do a disproportiante amount of
2928 sweeping for how much free memory we get back.
2930 This patch looks like a consistent ~2% progression on boyer and is neutral everywhere else.
2933 (JSC::Heap::didRetireBlockWithFreeListSize):
2934 * heap/MarkedAllocator.cpp:
2935 (JSC::MarkedAllocator::tryAllocateHelper):
2936 (JSC::MarkedAllocator::removeBlock):
2937 (JSC::MarkedAllocator::reset):
2938 * heap/MarkedAllocator.h:
2939 (JSC::MarkedAllocator::MarkedAllocator):
2940 (JSC::MarkedAllocator::forEachBlock):
2941 * heap/MarkedBlock.cpp:
2942 (JSC::MarkedBlock::sweepHelper):
2943 (JSC::MarkedBlock::clearMarksWithCollectionType):
2944 (JSC::MarkedBlock::didRetireBlock):
2945 * heap/MarkedBlock.h:
2946 (JSC::MarkedBlock::willRemoveBlock):
2947 (JSC::MarkedBlock::isLive):
2948 * heap/MarkedSpace.cpp:
2949 (JSC::MarkedSpace::clearNewlyAllocated):
2950 (JSC::MarkedSpace::clearMarks):
2951 * runtime/Options.h:
2953 2014-03-11 Andreas Kling <akling@apple.com>
2955 Streamline PropertyTable for lookup-only access.
2956 <https://webkit.org/b/130060>
2958 The PropertyTable lookup algorithm was written to support both read
2959 and write access. This wasn't actually needed in most places.
2961 This change adds a PropertyTable::get() that just returns the value
2962 type (instead of an insertion iterator.) It also adds an early return
2965 Finally, up the minimum table capacity from 8 to 16. It was lowered
2966 to 8 in order to save memory, but that was before PropertyTables were
2967 GC allocated. Nowadays we don't have nearly as many tables, since all
2968 the unpinned transitions die off.
2970 Reviewed by Darin Adler.
2972 * runtime/PropertyMapHashTable.h:
2973 (JSC::PropertyTable::get):
2974 * runtime/Structure.cpp:
2975 (JSC::Structure::despecifyDictionaryFunction):
2976 (JSC::Structure::attributeChangeTransition):
2977 (JSC::Structure::get):
2978 (JSC::Structure::despecifyFunction):
2979 * runtime/StructureInlines.h:
2980 (JSC::Structure::get):
2982 2014-03-10 Mark Hahnenberg <mhahnenberg@apple.com>
2984 REGRESSION(r165407): DoYouEvenBench crashes in DRT
2985 https://bugs.webkit.org/show_bug.cgi?id=130066
2987 Reviewed by Geoffrey Garen.
2989 The baseline JIT does a conditional store barrier for the put_by_id, but we need
2990 an unconditional store barrier so that we cover the butterfly case as well in emitPutTransitionStub.
2993 * jit/JITPropertyAccess.cpp:
2994 (JSC::JIT::emit_op_put_by_id):
2995 (JSC::JIT::emitWriteBarrier):
2997 2014-03-10 Mark Lam <mark.lam@apple.com>
2999 Resurrect bit-rotted JIT::probe() mechanism.
3000 <https://webkit.org/b/130067>
3002 Reviewed by Geoffrey Garen.
3005 - Added the needed #include <wtf/InlineASM.h>.
3007 2014-03-10 Joseph Pecoraro <pecoraro@apple.com>
3009 Fix typo in EXCLUDED_SOURCE_FILE_NAMES_iphoneos.
3011 Rubber-stamped by Dan Bernstein.
3013 * Configurations/JavaScriptCore.xcconfig:
3015 2014-03-10 Mark Lam <mark.lam@apple.com>
3017 r165414 broke the 32-bit x86 tests: ASSERTION FAILED: result != InvalidIndex @ GPRInfo.h:330.
3018 <https://webkit.org/b/130065>
3020 Reviewed by Michael Saboff.
3022 There is code in ScratchRegisterAllocator.cpp that is relying on GPRInfo::toIndex()
3023 being able to return InvalidIndex. Hence, the assertion is invalid. Ditto for
3026 The fix is to remove the "result != InvalidIndex" assertions.
3029 (JSC::FPRInfo::toIndex):
3031 (JSC::GPRInfo::toIndex):
3033 2014-03-10 Mark Lam <mark.lam@apple.com>
3035 Crash on a stack overflow on 32-bit x86 in http/tests/websocket/tests/hybi/workers/no-onmessage-in-sync-op.html.
3036 <https://webkit.org/b/129955>
3038 Reviewed by Geoffrey Garen.
3040 The 32-bit x86 version of getHostCallReturnValue() was leaking 16 bytes
3041 stack memory every time it was called. This is now fixed.
3043 * jit/JITOperations.cpp:
3045 2014-03-10 Joseph Pecoraro <pecoraro@apple.com>
3047 Better JSContext API for named evaluations (other than //# sourceURL)
3048 https://bugs.webkit.org/show_bug.cgi?id=129911
3050 Reviewed by Geoffrey Garen.
3055 (-[JSContext evaluateScript:]):
3056 (-[JSContext evaluateScript:withSourceURL:]):
3057 Add new evaluateScript:withSourceURL:.
3059 * API/tests/testapi.c:
3061 * API/tests/testapi.mm:
3062 (testObjectiveCAPI):
3063 Add tests for sourceURL in evaluate APIs. It should
3064 affect the exception objects.
3066 2014-03-10 Filip Pizlo <fpizlo@apple.com>
3068 Repatch should save and restore all used registers - not just temp ones - when making a call
3069 https://bugs.webkit.org/show_bug.cgi?id=130041
3071 Reviewed by Geoffrey Garen and Mark Hahnenberg.
3073 The save/restore code was written back when the only client was the DFG, which only uses a
3074 subset of hardware registers: the "temp" registers in our lingo. But the FTL may use many
3075 other registers, especially on ARM64. The fact that Repatch doesn't know to save those can
3076 lead to data corruption on ARM64.
3078 * jit/RegisterSet.cpp:
3079 (JSC::RegisterSet::calleeSaveRegisters):
3080 (JSC::RegisterSet::numberOfSetGPRs):
3081 (JSC::RegisterSet::numberOfSetFPRs):
3082 * jit/RegisterSet.h:
3084 (JSC::storeToWriteBarrierBuffer):
3085 (JSC::emitPutTransitionStub):
3086 * jit/ScratchRegisterAllocator.cpp:
3087 (JSC::ScratchRegisterAllocator::ScratchRegisterAllocator):
3088 (JSC::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
3089 (JSC::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
3090 (JSC::ScratchRegisterAllocator::usedRegistersForCall):
3091 (JSC::ScratchRegisterAllocator::desiredScratchBufferSizeForCall):
3092 (JSC::ScratchRegisterAllocator::preserveUsedRegistersToScratchBufferForCall):
3093 (JSC::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBufferForCall):
3094 * jit/ScratchRegisterAllocator.h:
3096 2014-03-10 Mark Hahnenberg <mhahnenberg@apple.com>
3098 Remove ConditionalStore barrier
3099 https://bugs.webkit.org/show_bug.cgi?id=130040
3101 Reviewed by Geoffrey Garen.
3103 ConditionalStoreBarrier was created when barriers were much more expensive. Now that
3104 they're cheap(er), we can get rid of them. This also allows us to get rid of the write
3105 barrier logic in emitPutTransitionStub because we always will have executed a write barrier
3106 on the base object in the case where we are allocating and storing a new Butterfly into it.
3107 Previously, a ConditionalStoreBarrier might or might not have barrier-ed the base object,
3108 so we'd have to emit a write barrier in the transition case.
3110 This is performance neutral on the benchmarks we track.
3112 * dfg/DFGAbstractInterpreterInlines.h:
3113 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
3114 * dfg/DFGClobberize.h:
3115 (JSC::DFG::clobberize):
3116 * dfg/DFGConstantFoldingPhase.cpp:
3117 (JSC::DFG::ConstantFoldingPhase::foldConstants):
3118 (JSC::DFG::ConstantFoldingPhase::emitPutByOffset):
3119 * dfg/DFGFixupPhase.cpp:
3120 (JSC::DFG::FixupPhase::fixupNode):
3121 (JSC::DFG::FixupPhase::insertStoreBarrier):
3123 (JSC::DFG::Node::isStoreBarrier):
3124 * dfg/DFGNodeType.h:
3125 * dfg/DFGPredictionPropagationPhase.cpp:
3126 (JSC::DFG::PredictionPropagationPhase::propagate):
3127 * dfg/DFGSafeToExecute.h:
3128 (JSC::DFG::safeToExecute):
3129 * dfg/DFGSpeculativeJIT.cpp:
3130 (JSC::DFG::SpeculativeJIT::compileStoreBarrier):
3131 * dfg/DFGSpeculativeJIT32_64.cpp:
3132 (JSC::DFG::SpeculativeJIT::compile):
3133 * dfg/DFGSpeculativeJIT64.cpp:
3134 (JSC::DFG::SpeculativeJIT::compile):
3135 * ftl/FTLCapabilities.cpp:
3136 (JSC::FTL::canCompile):
3137 * ftl/FTLLowerDFGToLLVM.cpp:
3138 (JSC::FTL::LowerDFGToLLVM::compileNode):
3140 (JSC::emitPutTransitionStub):
3142 2014-03-10 Filip Pizlo <fpizlo@apple.com>
3144 DFG and FTL should know that comparing anything to Misc is cheap and easy
3145 https://bugs.webkit.org/show_bug.cgi?id=130001
3147 Reviewed by Geoffrey Garen.
3149 - Expand CompareStrictEq(Misc:, Misc:) to work for cases where either side of the
3150 comparison is just Untyped:.
3152 - This obviates the need for CompareStrictEqConstant, so remove it.
3154 - FTL had a thing called "Nully" which is really "Other". Rename it and add
3157 9% speed-up on box2d.
3159 * dfg/DFGAbstractInterpreterInlines.h:
3160 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
3161 * dfg/DFGByteCodeParser.cpp:
3162 (JSC::DFG::ByteCodeParser::parseBlock):
3163 * dfg/DFGClobberize.h:
3164 (JSC::DFG::clobberize):
3165 * dfg/DFGFixupPhase.cpp:
3166 (JSC::DFG::FixupPhase::fixupNode):
3168 (JSC::DFG::Node::isBinaryUseKind):
3169 (JSC::DFG::Node::shouldSpeculateOther):
3170 * dfg/DFGNodeType.h:
3171 * dfg/DFGPredictionPropagationPhase.cpp:
3172 (JSC::DFG::PredictionPropagationPhase::propagate):
3173 * dfg/DFGSafeToExecute.h:
3174 (JSC::DFG::safeToExecute):
3175 * dfg/DFGSpeculativeJIT.cpp:
3176 (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
3177 (JSC::DFG::SpeculativeJIT::compare):
3178 (JSC::DFG::SpeculativeJIT::compileStrictEq):
3179 * dfg/DFGSpeculativeJIT.h:
3180 * dfg/DFGSpeculativeJIT32_64.cpp:
3181 (JSC::DFG::SpeculativeJIT::compileMiscStrictEq):
3182 (JSC::DFG::SpeculativeJIT::compile):
3183 * dfg/DFGSpeculativeJIT64.cpp:
3184 (JSC::DFG::SpeculativeJIT::compileMiscStrictEq):
3185 (JSC::DFG::SpeculativeJIT::compile):
3186 * ftl/FTLCapabilities.cpp:
3187 (JSC::FTL::canCompile):
3188 * ftl/FTLLowerDFGToLLVM.cpp:
3189 (JSC::FTL::LowerDFGToLLVM::compileNode):
3190 (JSC::FTL::LowerDFGToLLVM::compileCompareEq):
3191 (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq):
3192 (JSC::FTL::LowerDFGToLLVM::compareEqObjectOrOtherToObject):
3193 (JSC::FTL::LowerDFGToLLVM::equalNullOrUndefined):
3194 (JSC::FTL::LowerDFGToLLVM::isNotOther):
3195 (JSC::FTL::LowerDFGToLLVM::isOther):
3196 (JSC::FTL::LowerDFGToLLVM::speculate):
3197 (JSC::FTL::LowerDFGToLLVM::speculateObjectOrOther):
3198 (JSC::FTL::LowerDFGToLLVM::speculateNotCell):
3199 (JSC::FTL::LowerDFGToLLVM::speculateOther):
3200 (JSC::FTL::LowerDFGToLLVM::speculateMisc):
3201 * tests/stress/compare-strict-eq-integer-to-misc.js: Added.
3203 2014-03-10 Filip Pizlo <fpizlo@apple.com>
3205 Unreviewed, remove unintended change.
3207 * dfg/DFGDriver.cpp:
3208 (JSC::DFG::compileImpl):
3210 2014-03-10 Filip Pizlo <fpizlo@apple.com>
3212 jsc commandline shouldn't have a "console" because that confuses some tests into thinking
3213 that they're running in the browser.
3215 Rubber stamped by Mark Hahnenberg.
3218 (GlobalObject::finishCreation):
3220 2014-03-10 Filip Pizlo <fpizlo@apple.com>
3222 Out-line ScratchRegisterAllocator
3224 Rubber stamped by Mark Hahnenberg.
3227 * GNUmakefile.list.am:
3228 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
3229 * JavaScriptCore.xcodeproj/project.pbxproj:
3230 * dfg/DFGDriver.cpp:
3231 (JSC::DFG::compileImpl):
3232 * jit/ScratchRegisterAllocator.cpp: Added.
3233 (JSC::ScratchRegisterAllocator::ScratchRegisterAllocator):
3234 (JSC::ScratchRegisterAllocator::~ScratchRegisterAllocator):
3235 (JSC::ScratchRegisterAllocator::lock):
3236 (JSC::ScratchRegisterAllocator::allocateScratch):
3237 (JSC::ScratchRegisterAllocator::allocateScratchGPR):
3238 (JSC::ScratchRegisterAllocator::allocateScratchFPR):
3239 (JSC::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
3240 (JSC::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
3241 (JSC::ScratchRegisterAllocator::desiredScratchBufferSize):
3242 (JSC::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
3243 (JSC::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
3244 * jit/ScratchRegisterAllocator.h:
3246 2014-03-10 Brent Fulgham <bfulgham@apple.com>
3248 [Win] Pass environment to Pre-Build, Pre-link, and Post-Build Stages.
3249 https://bugs.webkit.org/show_bug.cgi?id=130023
3251 Reviewed by Dean Jackson.
3253 * JavaScriptCore.vcxproj/JavaScriptCore.proj: Avoid trailing backslashes in
3254 path names to avoid accidental escaping of later string substitutions.
3256 2014-03-10 Andreas Kling <akling@apple.com>
3258 [X86_64] Smaller code for testb_i8r when register is accumulator.
3259 <https://webkit.org/b/130026>
3261 Generate the shorthand version of "test al, imm" when possible.
3263 Reviewed by Michael Saboff.
3265 * assembler/X86Assembler.h:
3266 (JSC::X86Assembler::testb_i8r):
3268 2014-03-10 Andreas Kling <akling@apple.com>
3270 [X86_64] Smaller code for sub_ir when register is accumulator.
3271 <https://webkit.org/b/130025>
3273 Generate the shorthand version of "sub eax, imm" when possible.
3275 Reviewed by Michael Saboff.
3277 * assembler/X86Assembler.h:
3278 (JSC::X86Assembler::subl_ir):
3279 (JSC::X86Assembler::subq_ir):
3281 2014-03-10 Andreas Kling <akling@apple.com>
3283 [X86_64] Smaller code for add_ir when register is accumulator.
3284 <https://webkit.org/b/130024>
3286 Generate the shorthand version of "add eax, imm" when possible.
3288 Reviewed by Michael Saboff.
3290 * assembler/X86Assembler.h:
3291 (JSC::X86Assembler::addl_ir):
3292 (JSC::X86Assembler::addq_ir):
3294 2014-03-10 Mark Hahnenberg <mhahnenberg@apple.com>
3296 writeBarrier in emitPutReplaceStub is unnecessary
3297 https://bugs.webkit.org/show_bug.cgi?id=130030
3299 Reviewed by Filip Pizlo.
3301 We already emit write barriers for each put-by-id when they're first compiled, so it's
3302 redundant to emit a write barrier as part of the repatched code.
3305 (JSC::emitPutReplaceStub):
3307 2014-03-10 Andreas Kling <akling@apple.com>
3309 [X86_64] Smaller code for xor_ir when register is accumulator.
3310 <https://webkit.org/b/130008>
3312 Generate the shorthand version of "xor eax, imm" when possible.
3314 Reviewed by Benjamin Poulain.
3316 * assembler/X86Assembler.h:
3317 (JSC::X86Assembler::xorl_ir):
3318 (JSC::X86Assembler::xorq_ir):
3320 2014-03-10 Andreas Kling <akling@apple.com>
3322 [X86_64] Smaller code for or_ir when register is accumulator.
3323 <https://webkit.org/b/130007>
3325 Generate the shorthand version of "or eax, imm" when possible.
3327 Reviewed by Benjamin Poulain.
3329 * assembler/X86Assembler.h:
3330 (JSC::X86Assembler::orl_ir):
3331 (JSC::X86Assembler::orq_ir):
3333 2014-03-10 Andreas Kling <akling@apple.com>
3335 [X86_64] Smaller code for test_ir when register is accumulator.
3336 <https://webkit.org/b/130006>
3338 Generate the shorthand version of "test eax, imm" when possible.
3340 Reviewed by Benjamin Poulain.
3342 * assembler/X86Assembler.h:
3343 (JSC::X86Assembler::testl_i32r):
3344 (JSC::X86Assembler::testq_i32r):
3346 2014-03-10 Andreas Kling <akling@apple.com>
3348 [X86_64] Smaller code for cmp_ir when register is accumulator.
3349 <https://webkit.org/b/130005>
3351 Generate the shorthand version of "cmp eax, imm" when possible.
3353 Reviewed by Benjamin Poulain.
3355 * assembler/X86Assembler.h:
3356 (JSC::X86Assembler::cmpl_ir):
3357 (JSC::X86Assembler::cmpq_ir):
3359 2014-03-10 Andreas Kling <akling@apple.com>
3361 [X86_64] Smaller code for store64(imm, address) when imm fits in 32 bits.
3362 <https://webkit.org/b/130002>
3366 mov [address], imm32
3370 mov scratchRegister, imm32
3371 mov [address], scratchRegister
3373 For store64(imm, address) where the 64-bit immediate can be passed as
3374 a sign-extended 32-bit value.
3376 Reviewed by Benjamin Poulain.
3378 * assembler/MacroAssemblerX86_64.h:
3379 (CAN_SIGN_EXTEND_32_64):
3380 (JSC::MacroAssemblerX86_64::store64):
3382 2014-03-10 Andreas Kling <akling@apple.com>
3384 [X86_64] Smaller code for xchg_rr when one register is accumulator.
3385 <https://webkit.org/b/130004>
3387 Generate the 1-byte version of "xchg eax, reg" when possible.
3389 Reviewed by Benjamin Poulain.
3391 * assembler/X86Assembler.h:
3392 (JSC::X86Assembler::xchgl_rr):
3393 (JSC::X86Assembler::xchgq_rr):
3395 2014-03-09 Filip Pizlo <fpizlo@apple.com>
3397 GPRInfo::toIndex should return InvalidIndex for non-temp registers on ARM64
3398 https://bugs.webkit.org/show_bug.cgi?id=129998
3400 Reviewed by Geoffrey Garen.
3402 Not only is that the established contract, but this is used to signal to
3403 ScratchRegisterAllocator that the register doesn't need locking since it isn't a register
3404 that this allocator would use. In the FTL, we may have an inline cache where LLVM had used
3405 some non-temp register (i.e. a register that JSC itself wouldn't have used). This is totally
3406 fine but previously it would have led to either an assertion failure, or data corruption, in
3407 the ScratchRegisterAllocator.
3410 (JSC::GPRInfo::toIndex):
3412 2014-03-09 Filip Pizlo <fpizlo@apple.com>
3414 FTL fails the new equals-masquerader strictEqualConstant test
3415 https://bugs.webkit.org/show_bug.cgi?id=129996
3417 Reviewed by Mark Lam.
3419 It turns out that the FTL was trying to do the masquerading stuff for ===null. But
3420 that's wrong since none of the other engines do it. The DFG even had an ancient
3421 FIXME about doing it - but that doesn't make sense since the LLInt and baseline JIT
3422 don't do it and JSValue::strictEqual() doesn't do it.
3424 Remove the FIXME and remove the extra checks in the FTL.
3426 This is a glorious patch: nothing but red and it fixes a test failure.
3428 * dfg/DFGSpeculativeJIT.cpp:
3429 (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant):
3430 * ftl/FTLLowerDFGToLLVM.cpp:
3431 (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEqConstant):
3433 2014-03-09 Andreas Kling <akling@apple.com>
3435 Short-circuit JSGlobalObjectInspectorController when not inspecting.
3436 <https://webkit.org/b/129995>
3438 Add an early return in reportAPIException() when the console agent
3439 is disabled. This avoids expensive symbolication during exceptions
3440 if there's nobody expecting the fancy backtrace anyway.
3442 ~2% progression on DYEB on my MBP.
3444 Reviewed by Geoff Garen.
3446 * inspector/JSGlobalObjectInspectorController.cpp:
3447 (Inspector::JSGlobalObjectInspectorController::reportAPIException):
3449 2014-03-09 Andreas Kling <akling@apple.com>
3451 Inline the trivial parts of GC deferral.
3452 <https://webkit.org/b/129984>
3454 Made most of the functions called by the DeferGC RAII object inline
3455 to avoid function call overhead.
3457 Looks like ~1% progression on DYEB.
3459 Reviewed by Geoffrey Garen.
3463 (JSC::Heap::incrementDeferralDepth):
3464 (JSC::Heap::decrementDeferralDepth):
3465 (JSC::Heap::collectIfNecessaryOrDefer):
3466 (JSC::Heap::decrementDeferralDepthAndGCIfNeeded):
3468 2014-03-08 Mark Lam <mark.lam@apple.com>
3470 32-bit x86 handleUncaughtException returns to wrong location after a stack overflow.
3471 <https://webkit.org/b/129969>
3473 Reviewed by Geoffrey Garen.
3475 The 32-bit version of handleUncaughtException was missing the handling of an
3476 edge case for stack overflows where the current frame may already be the
3477 sentinel frame. This edge case was handled in the 64-bit version. The fix
3478 is to bring the 32-bit version up to parity.
3481 (JSC::JIT::privateCompile):
3482 * llint/LowLevelInterpreter32_64.asm:
3484 2014-03-07 Mark Lam <mark.lam@apple.com>
3486 Fix bugs in 32-bit Structure implementation.
3487 <https://webkit.org/b/129947>
3489 Reviewed by Mark Hahnenberg.
3491 Added the loading of the Structure (from the JSCell) before use that was
3492 missing in a few places. Also added more test cases to equals-masquerader.js.
3494 * dfg/DFGSpeculativeJIT32_64.cpp:
3495 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
3496 (JSC::DFG::SpeculativeJIT::compile):
3497 * dfg/DFGSpeculativeJIT64.cpp:
3498 (JSC::DFG::SpeculativeJIT::compile):
3499 * llint/LowLevelInterpreter32_64.asm:
3500 * tests/stress/equals-masquerader.js:
3504 (strictNotEqualsNull):
3506 (notEqualsUndefined):
3507 (strictEqualsUndefined):
3508 (strictNotEqualsUndefined):
3512 2014-03-07 Andrew Trick <atrick@apple.com>
3514 Temporarily disable repeat-out-of-bounds stress tests pending fix for 129953.
3515 https://bugs.webkit.org/show_bug.cgi?id=129954
3517 Reviewed by Filip Pizlo.
3519 * tests/stress/float32-repeat-out-of-bounds.js:
3520 * tests/stress/int8-repeat-out-of-bounds.js:
3522 2014-03-07 Michael Saboff <msaboff@apple.com>
3524 .cfi directives in LowLevelInterpreter.cpp are providing no benefit
3525 https://bugs.webkit.org/show_bug.cgi?id=129945
3527 Reviewed by Mark Lam.
3529 Removed .cfi directive. Verified that stack traces didn't regress in crash reporter
3532 * llint/LowLevelInterpreter.cpp:
3534 2014-03-07 Oliver Hunt <oliver@apple.com>
3536 Continue hangs when performing for-of over arguments
3537 https://bugs.webkit.org/show_bug.cgi?id=129915
3539 Reviewed by Geoffrey Garen.
3541 Put the continue label in the right place
3543 * bytecompiler/BytecodeGenerator.cpp:
3544 (JSC::BytecodeGenerator::emitEnumeration):
3546 2014-03-07 peavo@outlook.com <peavo@outlook.com>
3548 [Win64] Compile error after r165128.
3549 https://bugs.webkit.org/show_bug.cgi?id=129807
3551 Reviewed by Mark Lam.
3553 * JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.sh:
3554 Check platform environment variable to determine if an assembler file should be generated.
3556 2014-03-07 Michael Saboff <msaboff@apple.com>
3558 Clarify how we deal with "special" registers
3559 https://bugs.webkit.org/show_bug.cgi?id=129806
3561 Already reviewed change being relanded.
3563 Relanding change set r165196 as it wasn't responsible for the breakage reported in
3564 https://bugs.webkit.org/show_bug.cgi?id=129822. That appears to be a build or
3566 Reviewed by Michael Saboff.
3567 configuration issue.
3569 * assembler/ARM64Assembler.h:
3570 (JSC::ARM64Assembler::lastRegister):
3571 * assembler/MacroAssembler.h:
3572 (JSC::MacroAssembler::nextRegister):
3573 * ftl/FTLLocation.cpp:
3574 (JSC::FTL::Location::restoreInto):
3575 * ftl/FTLSaveRestore.cpp:
3576 (JSC::FTL::saveAllRegisters):
3577 (JSC::FTL::restoreAllRegisters):
3578 * ftl/FTLSlowPathCall.cpp:
3579 * jit/RegisterSet.cpp:
3580 (JSC::RegisterSet::reservedHardwareRegisters):
3581 (JSC::RegisterSet::runtimeRegisters):
3582 (JSC::RegisterSet::specialRegisters):
3583 (JSC::RegisterSet::calleeSaveRegisters):
3584 * jit/RegisterSet.h:
3586 2014-03-07 Mark Hahnenberg <mhahnenberg@apple.com>
3588 Move GCActivityCallback to heap
3589 https://bugs.webkit.org/show_bug.cgi?id=129457
3591 Reviewed by Geoffrey Garen.
3593 All the other GC timer related stuff is there already.
3596 * GNUmakefile.list.am:
3597 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
3598 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
3599 * JavaScriptCore.xcodeproj/project.pbxproj:
3600 * heap/GCActivityCallback.cpp: Copied from Source/JavaScriptCore/runtime/GCActivityCallback.cpp.
3601 * heap/GCActivityCallback.h: Copied from Source/JavaScriptCore/runtime/GCActivityCallback.h.
3602 * runtime/GCActivityCallback.cpp: Removed.
3603 * runtime/GCActivityCallback.h: Removed.
3605 2014-03-07 Andrew Trick <atrick@apple.com>
3607 Correct a comment typo from:
3608 FLT should call fmod directly on platforms where LLVM cannot relocate the libcall
3609 https://bugs.webkit.org/show_bug.cgi?id=129865
3611 Reviewed by Mark Lam.
3614 (JSC::FTL::Output::doubleRem):
3616 2014-03-07 Mark Hahnenberg <mhahnenberg@apple.com>
3618 Use OwnPtr in StructureIDTable
3619 https://bugs.webkit.org/show_bug.cgi?id=129828
3621 Reviewed by Geoffrey Garen.
3623 This reduces the amount of boilerplate and fixes a memory leak.
3625 * runtime/StructureIDTable.cpp:
3626 (JSC::StructureIDTable::StructureIDTable):
3627 (JSC::StructureIDTable::resize):
3628 (JSC::StructureIDTable::flushOldTables):
3629 (JSC::StructureIDTable::allocateID):
3630 (JSC::StructureIDTable::deallocateID):
3631 * runtime/StructureIDTable.h:
3632 (JSC::StructureIDTable::table):
3633 (JSC::StructureIDTable::get):
3635 2014-03-07 Andrew Trick <atrick@apple.com>
3637 FLT should call fmod directly on platforms where LLVM cannot relocate the libcall
3638 https://bugs.webkit.org/show_bug.cgi?id=129865
3640 Reviewed by Filip Pizlo.
3642 * ftl/FTLIntrinsicRepository.h:
3644 (JSC::FTL::Output::doubleRem):
3646 2014-03-06 Filip Pizlo <fpizlo@apple.com>
3648 If the FTL is build-time enabled then it should be run-time enabled.
3650 Rubber stamped by Geoffrey Garen.
3652 * runtime/Options.cpp:
3653 (JSC::recomputeDependentOptions):
3654 * runtime/Options.h:
3656 2014-03-06 Joseph Pecoraro <pecoraro@apple.com>
3658 [OS X] Web Inspector: Allow Apps using JavaScriptCore to access "com.apple.webinspector" mach port
3659 https://bugs.webkit.org/show_bug.cgi?id=129852
3661 Reviewed by Geoffrey Garen.
3663 * framework.sb: Added.
3664 Sandbox extension to allow access to "com.apple.webinspector".
3666 * JavaScriptCore.xcodeproj/project.pbxproj:
3667 Add a Copy Resources build phase and include framework.sb.
3669 * Configurations/JavaScriptCore.xcconfig:
3670 Do not copy framework.sb on iOS.
3672 2014-03-06 Mark Hahnenberg <mhahnenberg@apple.com>
3674 JSGlobalContextRelease incorrectly handles saving/restoring IdentifierTable
3675 https://bugs.webkit.org/show_bug.cgi?id=129858
3677 Reviewed by Mark Lam.
3679 It was correct (but really ugly) prior to the combining of APIEntryShim and JSLock,
3680 but now it ends up overwriting the IdentifierTable that JSLock just restored.
3682 * API/JSContextRef.cpp:
3683 (JSGlobalContextRelease):
3685 2014-03-06 Oliver Hunt <oliver@apple.com>
3689 * dfg/DFGConstantFoldingPhase.cpp:
3690 (JSC::DFG::ConstantFoldingPhase::foldConstants):
3692 2014-03-06 Brent Fulgham <bfulgham@apple.com>
3694 Unreviewed build fix after r165128.
3696 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: The SEH flag was not getting set when
3697 performing 'Production' and 'DebugSuffix' type builds.
3699 2014-03-06 Julien Brianceau <jbriance@cisco.com>
3701 Unreviewed, fix style in my previous commit.
3702 https://bugs.webkit.org/show_bug.cgi?id=129833
3704 * runtime/JSConsole.cpp:
3706 2014-03-06 Julien Brianceau <jbriance@cisco.com>
3708 Build fix: add missing include in JSConole.cpp.
3709 https://bugs.webkit.org/show_bug.cgi?id=129833
3711 Reviewed by Oliver Hunt.
3713 * runtime/JSConsole.cpp:
3715 2014-03-06 Oliver Hunt <oliver@apple.com>
3719 * jit/CCallHelpers.h:
3720 (JSC::CCallHelpers::setupArgumentsWithExecState):
3722 2014-03-06 Commit Queue <commit-queue@webkit.org>
3724 Unreviewed, rolling out r165196.
3725 http://trac.webkit.org/changeset/165196
3726 https://bugs.webkit.org/show_bug.cgi?id=129822
3728 broke arm64 on hardware (Requested by bfulgham on #webkit).
3730 * assembler/ARM64Assembler.h:
3731 (JSC::ARM64Assembler::lastRegister):
3732 * assembler/MacroAssembler.h:
3733 (JSC::MacroAssembler::isStackRelated):
3734 (JSC::MacroAssembler::firstRealRegister):
3735 (JSC::MacroAssembler::nextRegister):
3736 (JSC::MacroAssembler::secondRealRegister):
3737 * ftl/FTLLocation.cpp:
3738 (JSC::FTL::Location::restoreInto):
3739 * ftl/FTLSaveRestore.cpp:
3740 (JSC::FTL::saveAllRegisters):
3741 (JSC::FTL::restoreAllRegisters):
3742 * ftl/FTLSlowPathCall.cpp:
3743 * jit/RegisterSet.cpp:
3744 (JSC::RegisterSet::specialRegisters):
3745 (JSC::RegisterSet::calleeSaveRegisters):
3746 * jit/RegisterSet.h:
3748 2014-03-06 Mark Lam <mark.lam@apple.com>
3750 REGRESSION(r165205): broke the CLOOP build (Requested by smfr on #webkit).
3751 <https://webkit.org/b/129813>
3753 Reviewed by Michael Saboff.
3755 Fixed broken C loop LLINT build.
3757 * llint/LowLevelInterpreter.cpp:
3758 (JSC::CLoop::execute):
3759 * offlineasm/cloop.rb:
3761 2014-03-03 Oliver Hunt <oliver@apple.com>
3763 Support caching of custom setters
3764 https://bugs.webkit.org/show_bug.cgi?id=129519
3766 Reviewed by Filip Pizlo.
3768 This patch adds caching of assignment to properties that
3769 are backed by C functions. This provides most of the leg
3770 work required to start supporting setters, and resolves
3771 the remaining regressions from moving DOM properties up
3772 the prototype chain.
3774 * JavaScriptCore.xcodeproj/project.pbxproj:
3775 * bytecode/PolymorphicPutByIdList.cpp:
3776 (JSC::PutByIdAccess::visitWeak):
3777 (JSC::PolymorphicPutByIdList::PolymorphicPutByIdList):
3778 (JSC::PolymorphicPutByIdList::from):
3779 * bytecode/PolymorphicPutByIdList.h:
3780 (JSC::PutByIdAccess::transition):
3781 (JSC::PutByIdAccess::replace):
3782 (JSC::PutByIdAccess::customSetter):
3783 (JSC::PutByIdAccess::isCustom):
3784 (JSC::PutByIdAccess::oldStructure):
3785 (JSC::PutByIdAccess::chain):
3786 (JSC::PutByIdAccess::stubRoutine):
3787 * bytecode/PutByIdStatus.cpp:
3788 (JSC::PutByIdStatus::computeForStubInfo):
3789 (JSC::PutByIdStatus::computeFor):
3790 (JSC::PutByIdStatus::dump):
3791 * bytecode/PutByIdStatus.h:
3792 (JSC::PutByIdStatus::PutByIdStatus):
3793 (JSC::PutByIdStatus::takesSlowPath):
3794 (JSC::PutByIdStatus::makesCalls):
3795 * bytecode/StructureStubInfo.h:
3796 * dfg/DFGAbstractInterpreterInlines.h:
3797 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
3798 * dfg/DFGByteCodeParser.cpp:
3799 (JSC::DFG::ByteCodeParser::emitPutById):
3800 (JSC::DFG::ByteCodeParser::handlePutById):
3801 * dfg/DFGClobberize.h:
3802 (JSC::DFG::clobberize):
3804 * dfg/DFGConstantFoldingPhase.cpp:
3805 (JSC::DFG::ConstantFoldingPhase::foldConstants):
3806 * dfg/DFGFixupPhase.cpp:
3807 (JSC::DFG::FixupPhase::fixupNode):
3809 (JSC::DFG::Node::hasIdentifier):
3810 * dfg/DFGNodeType.h:
3811 * dfg/DFGPredictionPropagationPhase.cpp:
3812 (JSC::DFG::PredictionPropagationPhase::propagate):
3813 * dfg/DFGSafeToExecute.h:
3814 (JSC::DFG::safeToExecute):
3815 * dfg/DFGSpeculativeJIT.cpp:
3816 (JSC::DFG::SpeculativeJIT::compileIn):
3817 * dfg/DFGSpeculativeJIT.h:
3818 * dfg/DFGSpeculativeJIT32_64.cpp:
3819 (JSC::DFG::SpeculativeJIT::cachedGetById):
3820 (JSC::DFG::SpeculativeJIT::cachedPutById):
3821 (JSC::DFG::SpeculativeJIT::compile):
3822 * dfg/DFGSpeculativeJIT64.cpp:
3823 (JSC::DFG::SpeculativeJIT::cachedGetById):
3824 (JSC::DFG::SpeculativeJIT::cachedPutById):
3825 (JSC::DFG::SpeculativeJIT::compile):
3826 * jit/CCallHelpers.h:
3827 (JSC::CCallHelpers::setupArgumentsWithExecState):
3828 * jit/JITInlineCacheGenerator.cpp:
3829 (JSC::JITByIdGenerator::JITByIdGenerator):
3830 (JSC::JITPutByIdGenerator::JITPutByIdGenerator):
3831 * jit/JITInlineCacheGenerator.h:
3832 (JSC::JITGetByIdGenerator::JITGetByIdGenerator):
3833 * jit/JITOperations.cpp:
3834 * jit/JITOperations.h:
3835 * jit/JITPropertyAccess.cpp:
3836 (JSC::JIT::emit_op_get_by_id):
3837 (JSC::JIT::emit_op_put_by_id):
3838 * jit/JITPropertyAccess32_64.cpp:
3839 (JSC::JIT::emit_op_get_by_id):
3840 (JSC::JIT::emit_op_put_by_id):
3842 (JSC::tryCacheGetByID):
3843 (JSC::tryBuildGetByIDList):
3844 (JSC::emitCustomSetterStub):
3845 (JSC::tryCachePutByID):
3846 (JSC::tryBuildPutByIdList):
3847 * jit/SpillRegistersMode.h: Added.
3848 * llint/LLIntSlowPaths.cpp:
3849 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
3852 * runtime/PutPropertySlot.h:
3853 (JSC::PutPropertySlot::setCacheableCustomProperty):
3854 (JSC::PutPropertySlot::customSetter):
3855 (JSC::PutPropertySlot::isCacheablePut):
3856 (JSC::PutPropertySlot::isCacheableCustomProperty):
3857 (JSC::PutPropertySlot::cachedOffset):
3859 2014-03-06 Filip Pizlo <fpizlo@apple.com>
3861 FTL arity fixup should work on ARM64
3862 https://bugs.webkit.org/show_bug.cgi?id=129810
3864 Reviewed by Michael Saboff.
3866 - Using regT5 to pass the thunk return address to arityFixup is shady since that's a
3869 - The FTL path was assuming X86 conventions for where SP points at the top of the prologue.
3871 This makes some more tests pass.
3873 * dfg/DFGJITCompiler.cpp:
3874 (JSC::DFG::JITCompiler::compileFunction):
3877 * jit/AssemblyHelpers.h:
3878 (JSC::AssemblyHelpers::prologueStackPointerDelta):
3880 (JSC::JIT::privateCompile):
3881 * jit/ThunkGenerators.cpp:
3883 * llint/LowLevelInterpreter64.asm:
3884 * offlineasm/arm64.rb:
3885 * offlineasm/x86.rb: In addition to the t7 change, make t6 agree with GPRInfo.h.
3887 2014-03-06 Mark Hahnenberg <mhahnenberg@apple.com>
3889 Fix write barriers in Repatch.cpp for !ENABLE(DFG_JIT) platforms after r165128
3890 https://bugs.webkit.org/show_bug.cgi?id=129760
3892 Reviewed by Geoffrey Garen.
3894 r165128 disabled the write barrier fast path for inline caches on !ENABLE(DFG_JIT) platforms.
3895 The fix is to refactor the write barrier code into AssemblyHelpers and use that everywhere.
3897 * dfg/DFGSpeculativeJIT.cpp:
3898 (JSC::DFG::SpeculativeJIT::writeBarrier):
3899 * dfg/DFGSpeculativeJIT.h:
3900 * dfg/DFGSpeculativeJIT32_64.cpp:
3901 (JSC::DFG::SpeculativeJIT::writeBarrier):
3902 * dfg/DFGSpeculativeJIT64.cpp:
3903 (JSC::DFG::SpeculativeJIT::writeBarrier):
3904 * jit/AssemblyHelpers.h:
3905 (JSC::AssemblyHelpers::checkMarkByte):
3907 * jit/JITPropertyAccess.cpp:
3909 (JSC::writeBarrier):
3911 2014-03-06 Joseph Pecoraro <pecoraro@apple.com>
3913 Web Inspector: Expose the console object in JSContexts to interact with Web Inspector
3914 https://bugs.webkit.org/show_bug.cgi?id=127944
3916 Reviewed by Geoffrey Garen.
3918 Always expose the Console object in JSContexts, just like we
3919 do for web pages. The default behavior will route to an
3920 attached JSContext inspector. This can be overriden by
3921 setting the ConsoleClient on the JSGlobalObject, which WebCore
3922 does to get slightly different behavior.
3925 * GNUmakefile.list.am:
3926 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
3927 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
3928 * JavaScriptCore.xcodeproj/project.pbxproj:
3929 Update build systems.
3931 * API/tests/testapi.js:
3932 * API/tests/testapi.mm:
3933 Test that "console" exists in C and ObjC contexts.
3935 * runtime/ConsoleClient.cpp: Added.
3936 (JSC::ConsoleClient::printURLAndPosition):
3937 (JSC::ConsoleClient::printMessagePrefix):
3938 (JSC::ConsoleClient::printConsoleMessage):
3939 (JSC::ConsoleClient::printConsoleMessageWithArguments):
3940 (JSC::ConsoleClient::internalMessageWithTypeAndLevel):
3941 (JSC::ConsoleClient::logWithLevel):
3942 (JSC::ConsoleClient::clear):
3943 (JSC::ConsoleClient::dir):
3944 (JSC::ConsoleClient::dirXML):
3945 (JSC::ConsoleClient::table):
3946 (JSC::ConsoleClient::trace):
3947 (JSC::ConsoleClient::assertCondition):
3948 (JSC::ConsoleClient::group):
3949 (JSC::ConsoleClient::groupCollapsed):
3950 (JSC::ConsoleClient::groupEnd):
3951 * runtime/ConsoleClient.h: Added.
3952 (JSC::ConsoleClient::~ConsoleClient):
3953 New private interface for handling the console object's methods.
3954 A lot of the methods funnel through messageWithTypeAndLevel.
3956 * runtime/ConsoleTypes.h: Renamed from Source/JavaScriptCore/inspector/ConsoleTypes.h.
3957 Moved to JSC namespace.
3959 * runtime/JSGlobalObject.cpp:
3960 (JSC::JSGlobalObject::JSGlobalObject):
3961 (JSC::JSGlobalObject::init):
3962 (JSC::JSGlobalObject::reset):
3963 (JSC::JSGlobalObject::visitChildren):
3964 Create the "console" object when initializing the environment.
3965 Also set the default console client to be the JS context inspector.
3967 * runtime/JSGlobalObject.h:
3968 (JSC::JSGlobalObject::setConsoleClient):
3969 (JSC::JSGlobalObject::consoleClient):
3970 Ability to change the console client, so WebCore can set a custom client.
3972 * runtime/ConsolePrototype.cpp: Added.
3973 (JSC::ConsolePrototype::finishCreation):
3974 (JSC::valueToStringWithUndefinedOrNullCheck):
3975 (JSC::consoleLogWithLevel):
3976 (JSC::consoleProtoFuncDebug):
3977 (JSC::consoleProtoFuncError):
3978 (JSC::consoleProtoFuncLog):
3979 (JSC::consoleProtoFuncWarn):
3980 (JSC::consoleProtoFuncClear):
3981 (JSC::consoleProtoFuncDir):
3982 (JSC::consoleProtoFuncDirXML):
3983 (JSC::consoleProtoFuncTable):
3984 (JSC::consoleProtoFuncTrace):
3985 (JSC::consoleProtoFuncAssert):
3986 (JSC::consoleProtoFuncCount):
3987 (JSC::consoleProtoFuncProfile):
3988 (JSC::consoleProtoFuncProfileEnd):
3989 (JSC::consoleProtoFuncTime):
3990 (JSC::consoleProtoFuncTimeEnd):
3991 (JSC::consoleProtoFuncTimeStamp):
3992 (JSC::consoleProtoFuncGroup):
3993 (JSC::consoleProtoFuncGroupCollapsed):
3994 (JSC::consoleProtoFuncGroupEnd):
3995 * runtime/ConsolePrototype.h: Added.
3996 (JSC::ConsolePrototype::create):
3997 (JSC::ConsolePrototype::createStructure):
3998 (JSC::ConsolePrototype::ConsolePrototype):
3999 Define the console object interface. Parse out required / expected
4000 arguments and throw expcetions when methods are misused.
4002 * runtime/JSConsole.cpp: Added.
4003 * runtime/JSConsole.h: Added.
4004 (JSC::JSConsole::createStructure):
4005 (JSC::JSConsole::create):
4006 (JSC::JSConsole::JSConsole):
4007 Empty "console" object. Everything is in the prototype.
4009 * inspector/JSConsoleClient.cpp: Added.
4010 (Inspector::JSConsoleClient::JSGlobalObjectConsole):
4011 (Inspector::JSConsoleClient::count):
4012 (Inspector::JSConsoleClient::profile):
4013 (Inspector::JSConsoleClient::profileEnd):
4014 (Inspector::JSConsoleClient::time):
4015 (Inspector::JSConsoleClient::timeEnd):
4016 (Inspector::JSConsoleClient::timeStamp):