Remove AllInOneFile.cpp
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2013-10-21  Nadav Rotem  <nrotem@apple.com>
2
3         Remove AllInOneFile.cpp
4         https://bugs.webkit.org/show_bug.cgi?id=123055
5
6         Reviewed by Csaba Osztrogon√°c.
7
8         * AllInOneFile.cpp: Removed.
9
10 2013-10-20  Filip Pizlo  <fpizlo@apple.com>
11
12         Unreviewed, cleanup a FIXME comment.
13
14         * jit/Repatch.cpp:
15
16 2013-10-20  Filip Pizlo  <fpizlo@apple.com>
17
18         StructureStubInfo's usedRegisters set should be able to track all registers, not just the ones that our JIT's view as temporaries
19         https://bugs.webkit.org/show_bug.cgi?id=123076
20
21         Reviewed by Sam Weinig.
22         
23         Start preparing for a world in which we are patching code generated by LLVM, which may have
24         very different register usage conventions than our JITs. This requires us being more explicit
25         about the registers we are using. For example, the repatching code shouldn't take for granted
26         that tagMaskRegister holds the TagMask or that the register is even in use.
27
28         * CMakeLists.txt:
29         * GNUmakefile.list.am:
30         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
31         * JavaScriptCore.xcodeproj/project.pbxproj:
32         * assembler/MacroAssembler.h:
33         (JSC::MacroAssembler::numberOfRegisters):
34         (JSC::MacroAssembler::registerIndex):
35         (JSC::MacroAssembler::numberOfFPRegisters):
36         (JSC::MacroAssembler::fpRegisterIndex):
37         (JSC::MacroAssembler::totalNumberOfRegisters):
38         * bytecode/StructureStubInfo.h:
39         * dfg/DFGSpeculativeJIT.cpp:
40         (JSC::DFG::SpeculativeJIT::usedRegisters):
41         * dfg/DFGSpeculativeJIT.h:
42         * ftl/FTLSaveRestore.cpp:
43         (JSC::FTL::bytesForGPRs):
44         (JSC::FTL::bytesForFPRs):
45         (JSC::FTL::offsetOfGPR):
46         (JSC::FTL::offsetOfFPR):
47         * jit/JITInlineCacheGenerator.cpp:
48         (JSC::JITByIdGenerator::JITByIdGenerator):
49         (JSC::JITPutByIdGenerator::JITPutByIdGenerator):
50         * jit/JITInlineCacheGenerator.h:
51         (JSC::JITGetByIdGenerator::JITGetByIdGenerator):
52         * jit/JITPropertyAccess.cpp:
53         (JSC::JIT::emit_op_get_by_id):
54         (JSC::JIT::emit_op_put_by_id):
55         * jit/JITPropertyAccess32_64.cpp:
56         (JSC::JIT::emit_op_get_by_id):
57         (JSC::JIT::emit_op_put_by_id):
58         * jit/RegisterSet.cpp: Added.
59         (JSC::RegisterSet::specialRegisters):
60         * jit/RegisterSet.h: Added.
61         (JSC::RegisterSet::RegisterSet):
62         (JSC::RegisterSet::set):
63         (JSC::RegisterSet::clear):
64         (JSC::RegisterSet::get):
65         (JSC::RegisterSet::merge):
66         * jit/Repatch.cpp:
67         (JSC::generateProtoChainAccessStub):
68         (JSC::tryCacheGetByID):
69         (JSC::tryBuildGetByIDList):
70         (JSC::emitPutReplaceStub):
71         (JSC::tryRepatchIn):
72         (JSC::linkClosureCall):
73         * jit/TempRegisterSet.cpp: Added.
74         (JSC::TempRegisterSet::TempRegisterSet):
75         * jit/TempRegisterSet.h:
76
77 2013-10-20  Julien Brianceau  <jbriance@cisco.com>
78
79         [sh4] Fix build (broken since r157690).
80         https://bugs.webkit.org/show_bug.cgi?id=123081
81
82         Reviewed by Andreas Kling.
83
84         * assembler/AssemblerBufferWithConstantPool.h:
85         * assembler/SH4Assembler.h:
86         (JSC::SH4Assembler::buffer):
87         (JSC::SH4Assembler::readCallTarget):
88
89 2013-10-19  Filip Pizlo  <fpizlo@apple.com>
90
91         Simplify TempRegisterSet - it no longer needs to be convertible to a POD since it's no longer going to be a member of a union
92         https://bugs.webkit.org/show_bug.cgi?id=123079
93
94         Reviewed by Geoffrey Garen.
95
96         * jit/TempRegisterSet.h:
97
98 2013-10-19  Filip Pizlo  <fpizlo@apple.com>
99
100         Rename RegisterSet to TempRegisterSet
101         https://bugs.webkit.org/show_bug.cgi?id=123077
102
103         Reviewed by Dan Bernstein.
104
105         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
106         * JavaScriptCore.xcodeproj/project.pbxproj:
107         * bytecode/StructureStubInfo.h:
108         * dfg/DFGJITCompiler.h:
109         * dfg/DFGSpeculativeJIT.h:
110         (JSC::DFG::SpeculativeJIT::usedRegisters):
111         * jit/JITInlineCacheGenerator.cpp:
112         (JSC::JITByIdGenerator::JITByIdGenerator):
113         (JSC::JITPutByIdGenerator::JITPutByIdGenerator):
114         * jit/JITInlineCacheGenerator.h:
115         (JSC::JITGetByIdGenerator::JITGetByIdGenerator):
116         * jit/JITPropertyAccess.cpp:
117         (JSC::JIT::emit_op_get_by_id):
118         (JSC::JIT::emit_op_put_by_id):
119         * jit/JITPropertyAccess32_64.cpp:
120         (JSC::JIT::emit_op_get_by_id):
121         (JSC::JIT::emit_op_put_by_id):
122         * jit/RegisterSet.h: Removed.
123         * jit/ScratchRegisterAllocator.h:
124         (JSC::ScratchRegisterAllocator::ScratchRegisterAllocator):
125         * jit/TempRegisterSet.h: Copied from Source/JavaScriptCore/jit/RegisterSet.h.
126         (JSC::TempRegisterSet::TempRegisterSet):
127         (JSC::TempRegisterSet::asPOD):
128         (JSC::TempRegisterSet::copyInfo):
129
130 2013-10-19  Filip Pizlo  <fpizlo@apple.com>
131
132         Restructure LinkBuffer to allow for alternate allocation strategies
133         https://bugs.webkit.org/show_bug.cgi?id=123071
134
135         Reviewed by Oliver Hunt.
136         
137         The idea is to eventually allow a LinkBuffer to place the code into an already
138         allocated region of memory.  That region of memory could be the nop-slide left behind
139         by a llvm.webkit.patchpoint.
140
141         * assembler/ARM64Assembler.h:
142         (JSC::ARM64Assembler::buffer):
143         * assembler/AssemblerBuffer.h:
144         * assembler/LinkBuffer.cpp:
145         (JSC::LinkBuffer::copyCompactAndLinkCode):
146         (JSC::LinkBuffer::linkCode):
147         (JSC::LinkBuffer::allocate):
148         (JSC::LinkBuffer::shrink):
149         * assembler/LinkBuffer.h:
150         (JSC::LinkBuffer::LinkBuffer):
151         (JSC::LinkBuffer::didFailToAllocate):
152         * assembler/X86Assembler.h:
153         (JSC::X86Assembler::buffer):
154         (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
155
156 2013-10-19  Alexey Proskuryakov  <ap@apple.com>
157
158         Some includes in JSC seem to use an incorrect style
159         https://bugs.webkit.org/show_bug.cgi?id=123057
160
161         Reviewed by Geoffrey Garen.
162
163         Changed pseudo-system includes to user ones.
164
165         * API/JSContextRef.cpp:
166         * API/JSStringRefCF.cpp:
167         * API/JSValueRef.cpp:
168         * API/OpaqueJSString.cpp:
169         * jit/JIT.h:
170         * parser/SyntaxChecker.h:
171         * runtime/WeakGCMap.h:
172
173 2013-10-19  Filip Pizlo  <fpizlo@apple.com>
174
175         Baseline JIT and DFG IC code generation should be unified and rationalized
176         https://bugs.webkit.org/show_bug.cgi?id=122939
177
178         Reviewed by Geoffrey Garen.
179         
180         Introduce the JITInlineCacheGenerator, which takes a CodeBlock and a CodeOrigin plus
181         some register info and creates JIT inline caches for you. Used this to even furhter
182         unify the baseline and DFG ICs. In the future we can use this for FTL ICs. And my hope
183         is that we'll be able to use it for cascading ICs: an IC for some instruction may realize
184         that it needs to do the equivalent of get_by_id, so with this generator it will be able
185         to create an IC even though it wasn't associated with a get_by_id bytecode instruction.
186
187         * CMakeLists.txt:
188         * GNUmakefile.list.am:
189         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
190         * JavaScriptCore.xcodeproj/project.pbxproj:
191         * assembler/AbstractMacroAssembler.h:
192         (JSC::AbstractMacroAssembler::DataLabelCompact::label):
193         * bytecode/CodeBlock.h:
194         (JSC::CodeBlock::ecmaMode):
195         * dfg/DFGInlineCacheWrapper.h: Added.
196         (JSC::DFG::InlineCacheWrapper::InlineCacheWrapper):
197         * dfg/DFGInlineCacheWrapperInlines.h: Added.
198         (JSC::DFG::::finalize):
199         * dfg/DFGJITCompiler.cpp:
200         (JSC::DFG::JITCompiler::link):
201         * dfg/DFGJITCompiler.h:
202         (JSC::DFG::JITCompiler::addGetById):
203         (JSC::DFG::JITCompiler::addPutById):
204         * dfg/DFGSpeculativeJIT32_64.cpp:
205         (JSC::DFG::SpeculativeJIT::cachedGetById):
206         (JSC::DFG::SpeculativeJIT::cachedPutById):
207         * dfg/DFGSpeculativeJIT64.cpp:
208         (JSC::DFG::SpeculativeJIT::cachedGetById):
209         (JSC::DFG::SpeculativeJIT::cachedPutById):
210         (JSC::DFG::SpeculativeJIT::compile):
211         * jit/AssemblyHelpers.h:
212         (JSC::AssemblyHelpers::isStrictModeFor):
213         (JSC::AssemblyHelpers::strictModeFor):
214         * jit/GPRInfo.h:
215         (JSC::JSValueRegs::tagGPR):
216         * jit/JIT.cpp:
217         (JSC::JIT::JIT):
218         (JSC::JIT::privateCompileSlowCases):
219         (JSC::JIT::privateCompile):
220         * jit/JIT.h:
221         * jit/JITInlineCacheGenerator.cpp: Added.
222         (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator):
223         (JSC::JITByIdGenerator::JITByIdGenerator):
224         (JSC::JITByIdGenerator::finalize):
225         (JSC::JITByIdGenerator::generateFastPathChecks):
226         (JSC::JITGetByIdGenerator::generateFastPath):
227         (JSC::JITPutByIdGenerator::JITPutByIdGenerator):
228         (JSC::JITPutByIdGenerator::generateFastPath):
229         (JSC::JITPutByIdGenerator::slowPathFunction):
230         * jit/JITInlineCacheGenerator.h: Added.
231         (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator):
232         (JSC::JITInlineCacheGenerator::stubInfo):
233         (JSC::JITByIdGenerator::JITByIdGenerator):
234         (JSC::JITByIdGenerator::reportSlowPathCall):
235         (JSC::JITByIdGenerator::slowPathJump):
236         (JSC::JITGetByIdGenerator::JITGetByIdGenerator):
237         (JSC::JITPutByIdGenerator::JITPutByIdGenerator):
238         * jit/JITPropertyAccess.cpp:
239         (JSC::JIT::emit_op_get_by_id):
240         (JSC::JIT::emitSlow_op_get_by_id):
241         (JSC::JIT::emit_op_put_by_id):
242         (JSC::JIT::emitSlow_op_put_by_id):
243         * jit/JITPropertyAccess32_64.cpp:
244         (JSC::JIT::emit_op_get_by_id):
245         (JSC::JIT::emitSlow_op_get_by_id):
246         (JSC::JIT::emit_op_put_by_id):
247         (JSC::JIT::emitSlow_op_put_by_id):
248         * jit/RegisterSet.h:
249         (JSC::RegisterSet::set):
250
251 2013-10-19  Alexey Proskuryakov  <ap@apple.com>
252
253         APICast.h uses functions from JSCJSValueInlines.h, but doesn't include it
254         https://bugs.webkit.org/show_bug.cgi?id=123067
255
256         Reviewed by Geoffrey Garen.
257
258         * API/APICast.h: Include it.
259
260 2013-10-19  Filip Pizlo  <fpizlo@apple.com>
261
262         FTL::Location should treat the offset as an addend in the case of a Register location
263         https://bugs.webkit.org/show_bug.cgi?id=123062
264
265         Reviewed by Sam Weinig.
266
267         * ftl/FTLLocation.cpp:
268         (JSC::FTL::Location::forStackmaps):
269         (JSC::FTL::Location::dump):
270         (JSC::FTL::Location::restoreInto):
271         * ftl/FTLLocation.h:
272         (JSC::FTL::Location::forRegister):
273         (JSC::FTL::Location::hasAddend):
274         (JSC::FTL::Location::addend):
275
276 2013-10-19  Nadav Rotem  <nrotem@apple.com>
277
278         DFG dominators: document and rename stuff.
279         https://bugs.webkit.org/show_bug.cgi?id=123056
280
281         Reviewed by Filip Pizlo.
282
283         Documented the code and renamed some variables.
284
285         * dfg/DFGDominators.cpp:
286         (JSC::DFG::Dominators::compute):
287         (JSC::DFG::Dominators::pruneDominators):
288         * dfg/DFGDominators.h:
289
290 2013-10-19  Julien Brianceau  <jbriance@cisco.com>
291
292         Fix build failure for architectures with 4 argument registers.
293         https://bugs.webkit.org/show_bug.cgi?id=123060
294
295         Reviewed by Michael Saboff.
296
297         Add missing setupArgumentsWithExecState() prototypes for architecture with 4 argument registers.
298         Remove SH4 specific code no longer needed since callOperation prototype change in r157660.
299
300         * dfg/DFGSpeculativeJIT.h:
301         (JSC::DFG::SpeculativeJIT::callOperation):
302         * jit/CCallHelpers.h:
303         (JSC::CCallHelpers::setupArgumentsWithExecState):
304         * jit/JITInlines.h:
305         (JSC::JIT::callOperation):
306
307 2013-10-18  Filip Pizlo  <fpizlo@apple.com>
308
309         Unreviewed, fix FTL build.
310
311         * ftl/FTLIntrinsicRepository.h:
312         * ftl/FTLLowerDFGToLLVM.cpp:
313         (JSC::FTL::LowerDFGToLLVM::compileGetById):
314
315 2013-10-18  Filip Pizlo  <fpizlo@apple.com>
316
317         A CodeBlock's StructureStubInfos shouldn't be in a Vector that we search using code origins and machine code PCs
318         https://bugs.webkit.org/show_bug.cgi?id=122940
319
320         Reviewed by Oliver Hunt.
321         
322         This accomplishes a number of simplifications. StructureStubInfo is now non-moving,
323         whereas previously it was in a Vector, so it moved. This allows you to use pointers to
324         StructureStubInfo. This also eliminates the use of return PC as a way of finding the
325         StructureStubInfo's. It removes some of the need for the compile-time property access
326         records; for example the DFG no longer has to save information about registers in a
327         property access record only to later save it to the stub info.
328         
329         The main thing is accomplishes is that it makes it easier to add StructureStubInfo's
330         at any stage of compilation.
331
332         * bytecode/CodeBlock.cpp:
333         (JSC::CodeBlock::printGetByIdCacheStatus):
334         (JSC::CodeBlock::dumpBytecode):
335         (JSC::CodeBlock::~CodeBlock):
336         (JSC::CodeBlock::propagateTransitions):
337         (JSC::CodeBlock::finalizeUnconditionally):
338         (JSC::CodeBlock::addStubInfo):
339         (JSC::CodeBlock::getStubInfoMap):
340         (JSC::CodeBlock::shrinkToFit):
341         * bytecode/CodeBlock.h:
342         (JSC::CodeBlock::begin):
343         (JSC::CodeBlock::end):
344         (JSC::CodeBlock::rareCaseProfileForBytecodeOffset):
345         * bytecode/CodeOrigin.h:
346         (JSC::CodeOrigin::CodeOrigin):
347         (JSC::CodeOrigin::isHashTableDeletedValue):
348         (JSC::CodeOrigin::hash):
349         (JSC::CodeOriginHash::hash):
350         (JSC::CodeOriginHash::equal):
351         * bytecode/GetByIdStatus.cpp:
352         (JSC::GetByIdStatus::computeFor):
353         * bytecode/GetByIdStatus.h:
354         * bytecode/PutByIdStatus.cpp:
355         (JSC::PutByIdStatus::computeFor):
356         * bytecode/PutByIdStatus.h:
357         * bytecode/StructureStubInfo.h:
358         (JSC::getStructureStubInfoCodeOrigin):
359         * dfg/DFGByteCodeParser.cpp:
360         (JSC::DFG::ByteCodeParser::parseBlock):
361         (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
362         * dfg/DFGJITCompiler.cpp:
363         (JSC::DFG::JITCompiler::link):
364         * dfg/DFGJITCompiler.h:
365         (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord):
366         (JSC::DFG::InRecord::InRecord):
367         * dfg/DFGSpeculativeJIT.cpp:
368         (JSC::DFG::SpeculativeJIT::compileIn):
369         * dfg/DFGSpeculativeJIT.h:
370         (JSC::DFG::SpeculativeJIT::callOperation):
371         * dfg/DFGSpeculativeJIT32_64.cpp:
372         (JSC::DFG::SpeculativeJIT::cachedGetById):
373         (JSC::DFG::SpeculativeJIT::cachedPutById):
374         * dfg/DFGSpeculativeJIT64.cpp:
375         (JSC::DFG::SpeculativeJIT::cachedGetById):
376         (JSC::DFG::SpeculativeJIT::cachedPutById):
377         * jit/CCallHelpers.h:
378         (JSC::CCallHelpers::setupArgumentsWithExecState):
379         * jit/JIT.cpp:
380         (JSC::PropertyStubCompilationInfo::copyToStubInfo):
381         (JSC::JIT::privateCompile):
382         * jit/JIT.h:
383         (JSC::PropertyStubCompilationInfo::slowCaseInfo):
384         * jit/JITInlines.h:
385         (JSC::JIT::callOperation):
386         * jit/JITOperations.cpp:
387         * jit/JITOperations.h:
388         * jit/JITPropertyAccess.cpp:
389         (JSC::JIT::emitSlow_op_get_by_id):
390         (JSC::JIT::emitSlow_op_put_by_id):
391         * jit/JITPropertyAccess32_64.cpp:
392         (JSC::JIT::emitSlow_op_get_by_id):
393         (JSC::JIT::emitSlow_op_put_by_id):
394         * jit/Repatch.cpp:
395         (JSC::appropriateGenericPutByIdFunction):
396         (JSC::appropriateListBuildingPutByIdFunction):
397         (JSC::resetPutByID):
398
399 2013-10-18  Oliver Hunt  <oliver@apple.com>
400
401         Spread operator should be performing direct "puts" and not triggering setters
402         https://bugs.webkit.org/show_bug.cgi?id=123047
403
404         Reviewed by Geoffrey Garen.
405
406         Add a new opcode -- op_put_by_val_directue -- and make use of it in the spread
407         to array construct.  This required a new PutByValDirect node to be introduced to
408         the DFG.  The current implementation simply changes the slow path function that
409         is called, but in future this could be made faster as it does not need to check
410         the prototype chain.
411
412         * bytecode/CodeBlock.cpp:
413         (JSC::CodeBlock::dumpBytecode):
414         (JSC::CodeBlock::CodeBlock):
415         * bytecode/Opcode.h:
416         (JSC::padOpcodeName):
417         * bytecompiler/BytecodeGenerator.cpp:
418         (JSC::BytecodeGenerator::emitDirectPutByVal):
419         * bytecompiler/BytecodeGenerator.h:
420         * bytecompiler/NodesCodegen.cpp:
421         (JSC::ArrayNode::emitBytecode):
422         * dfg/DFGAbstractInterpreterInlines.h:
423         (JSC::DFG::::executeEffects):
424         * dfg/DFGBackwardsPropagationPhase.cpp:
425         (JSC::DFG::BackwardsPropagationPhase::propagate):
426         * dfg/DFGByteCodeParser.cpp:
427         (JSC::DFG::ByteCodeParser::parseBlock):
428         * dfg/DFGCSEPhase.cpp:
429         (JSC::DFG::CSEPhase::getArrayLengthElimination):
430         (JSC::DFG::CSEPhase::getByValLoadElimination):
431         (JSC::DFG::CSEPhase::checkStructureElimination):
432         (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
433         (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
434         (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
435         (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
436         (JSC::DFG::CSEPhase::performNodeCSE):
437         * dfg/DFGCapabilities.cpp:
438         (JSC::DFG::capabilityLevel):
439         * dfg/DFGClobberize.h:
440         (JSC::DFG::clobberize):
441         * dfg/DFGFixupPhase.cpp:
442         (JSC::DFG::FixupPhase::fixupNode):
443         * dfg/DFGGraph.h:
444         (JSC::DFG::Graph::clobbersWorld):
445         * dfg/DFGNode.h:
446         (JSC::DFG::Node::hasArrayMode):
447         * dfg/DFGNodeType.h:
448         * dfg/DFGOperations.cpp:
449         (JSC::DFG::putByVal):
450         (JSC::DFG::operationPutByValInternal):
451         * dfg/DFGOperations.h:
452         * dfg/DFGPredictionPropagationPhase.cpp:
453         (JSC::DFG::PredictionPropagationPhase::propagate):
454         (JSC::DFG::PredictionPropagationPhase::doDoubleVoting):
455         * dfg/DFGSafeToExecute.h:
456         (JSC::DFG::safeToExecute):
457         * dfg/DFGSpeculativeJIT32_64.cpp:
458         (JSC::DFG::SpeculativeJIT::compileContiguousPutByVal):
459         (JSC::DFG::SpeculativeJIT::compile):
460         * dfg/DFGSpeculativeJIT64.cpp:
461         (JSC::DFG::SpeculativeJIT::compile):
462         * dfg/DFGTypeCheckHoistingPhase.cpp:
463         (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks):
464         (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks):
465         * jit/JIT.cpp:
466         (JSC::JIT::privateCompileMainPass):
467         (JSC::JIT::privateCompileSlowCases):
468         * jit/JIT.h:
469         (JSC::JIT::compileDirectPutByVal):
470         * jit/JITOperations.cpp:
471         * jit/JITOperations.h:
472         * jit/JITPropertyAccess.cpp:
473         (JSC::JIT::emitSlow_op_put_by_val):
474         (JSC::JIT::privateCompilePutByVal):
475         * jit/JITPropertyAccess32_64.cpp:
476         (JSC::JIT::emitSlow_op_put_by_val):
477         * llint/LLIntSlowPaths.cpp:
478         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
479         * llint/LLIntSlowPaths.h:
480         * llint/LowLevelInterpreter32_64.asm:
481         * llint/LowLevelInterpreter64.asm:
482
483 2013-10-18  Daniel Bates  <dabates@apple.com>
484
485         [iOS] Export symbol for VM::sharedInstanceExists()
486         https://bugs.webkit.org/show_bug.cgi?id=123046
487
488         Reviewed by Mark Hahnenberg.
489
490         * runtime/VM.h:
491
492 2013-10-18  Daniel Bates  <dabates@apple.com>
493
494         [iOS] Upstream WebSafe{GCActivityCallback, IncrementalSweeper}IOS
495         https://bugs.webkit.org/show_bug.cgi?id=123049
496
497         Reviewed by Mark Hahnenberg.
498
499         * heap/Heap.cpp:
500         (JSC::Heap::setIncrementalSweeper):
501         * heap/Heap.h:
502         * heap/HeapTimer.h:
503         * heap/IncrementalSweeper.h: Make protected and export CF-variant of constructor.
504         Removed unused include of header RetainPtr.h. Also forward declare class MarkedBlock
505         (we include its header in the .cpp file) and remove include for header wtf/HashSet.h
506         (duplicates the include in the .cpp).
507         * heap/MachineStackMarker.h: Export function makeUsableFromMultipleThreads(). We aren't
508         making use of this now, but we'll make use of it in a subsequent patch.
509
510 2013-10-18  Anders Carlsson  <andersca@apple.com>
511
512         Remove spaces between template angle brackets
513         https://bugs.webkit.org/show_bug.cgi?id=123040
514
515         Reviewed by Andreas Kling.
516
517         * API/JSCallbackObject.cpp:
518         (JSC::::create):
519         * API/JSObjectRef.cpp:
520         * bytecode/CodeBlock.h:
521         (JSC::CodeBlock::constants):
522         (JSC::CodeBlock::setConstantRegisters):
523         * bytecode/DFGExitProfile.h:
524         * bytecode/EvalCodeCache.h:
525         * bytecode/Operands.h:
526         * bytecode/UnlinkedCodeBlock.h:
527         (JSC::UnlinkedCodeBlock::constantRegisters):
528         * bytecode/Watchpoint.h:
529         * bytecompiler/BytecodeGenerator.h:
530         * bytecompiler/StaticPropertyAnalysis.h:
531         * bytecompiler/StaticPropertyAnalyzer.h:
532         * dfg/DFGArgumentsSimplificationPhase.cpp:
533         * dfg/DFGBlockInsertionSet.h:
534         * dfg/DFGCSEPhase.cpp:
535         (JSC::DFG::performCSE):
536         (JSC::DFG::performStoreElimination):
537         * dfg/DFGCommonData.h:
538         * dfg/DFGDesiredStructureChains.h:
539         * dfg/DFGDesiredWatchpoints.h:
540         * dfg/DFGJITCompiler.h:
541         * dfg/DFGOSRExitCompiler32_64.cpp:
542         (JSC::DFG::OSRExitCompiler::compileExit):
543         * dfg/DFGOSRExitCompiler64.cpp:
544         (JSC::DFG::OSRExitCompiler::compileExit):
545         * dfg/DFGWorklist.h:
546         * heap/BlockAllocator.h:
547         (JSC::CopiedBlock):
548         (JSC::MarkedBlock):
549         (JSC::WeakBlock):
550         (JSC::MarkStackSegment):
551         (JSC::CopyWorkListSegment):
552         (JSC::HandleBlock):
553         * heap/Heap.h:
554         * heap/Local.h:
555         * heap/MarkedBlock.h:
556         * heap/Strong.h:
557         * jit/AssemblyHelpers.cpp:
558         (JSC::AssemblyHelpers::decodedCodeMapFor):
559         * jit/AssemblyHelpers.h:
560         * jit/SpecializedThunkJIT.h:
561         * parser/Nodes.h:
562         * parser/Parser.cpp:
563         (JSC::::parseIfStatement):
564         * parser/Parser.h:
565         (JSC::Scope::copyCapturedVariablesToVector):
566         (JSC::parse):
567         * parser/ParserArena.h:
568         * parser/SourceProviderCacheItem.h:
569         * profiler/LegacyProfiler.cpp:
570         (JSC::dispatchFunctionToProfiles):
571         * profiler/LegacyProfiler.h:
572         (JSC::LegacyProfiler::currentProfiles):
573         * profiler/ProfileNode.h:
574         (JSC::ProfileNode::children):
575         * profiler/ProfilerDatabase.h:
576         * runtime/Butterfly.h:
577         (JSC::Butterfly::contiguousInt32):
578         (JSC::Butterfly::contiguous):
579         * runtime/GenericTypedArrayViewInlines.h:
580         (JSC::::create):
581         * runtime/Identifier.h:
582         (JSC::Identifier::add):
583         * runtime/JSPromise.h:
584         * runtime/PropertyMapHashTable.h:
585         * runtime/PropertyNameArray.h:
586         * runtime/RegExpCache.h:
587         * runtime/SparseArrayValueMap.h:
588         * runtime/SymbolTable.h:
589         * runtime/VM.h:
590         * tools/CodeProfile.cpp:
591         (JSC::truncateTrace):
592         * tools/CodeProfile.h:
593         * yarr/YarrInterpreter.cpp:
594         * yarr/YarrInterpreter.h:
595         (JSC::Yarr::BytecodePattern::BytecodePattern):
596         * yarr/YarrJIT.cpp:
597         (JSC::Yarr::YarrGenerator::opCompileParenthesesSubpattern):
598         (JSC::Yarr::YarrGenerator::opCompileParentheticalAssertion):
599         (JSC::Yarr::YarrGenerator::opCompileBody):
600         * yarr/YarrPattern.cpp:
601         (JSC::Yarr::YarrPatternConstructor::checkForTerminalParentheses):
602         (JSC::Yarr::YarrPatternConstructor::optimizeDotStarWrappedExpressions):
603         * yarr/YarrPattern.h:
604
605 2013-10-18  Mark Lam  <mark.lam@apple.com>
606
607         Remove excess reserved space in ctiTrampoline frames for X86 and X86_64.
608         https://bugs.webkit.org/show_bug.cgi?id=123037.
609
610         Reviewed by Geoffrey Garen.
611
612         * jit/JITStubsMSVC64.asm:
613         * jit/JITStubsX86.h:
614         * jit/JITStubsX86_64.h:
615
616 2013-10-18  Filip Pizlo  <fpizlo@apple.com>
617
618         Frequent RELEASE_ASSERT crashes in Structure::checkOffsetConsistency on WebGL swizzler tests
619         https://bugs.webkit.org/show_bug.cgi?id=121661
620
621         Reviewed by Mark Hahnenberg.
622         
623         This method shouldn't have been called from the concurrent JIT thread. That's hard to prevent
624         so I added a return-early check using isCompilationThread().
625         
626         Here's why this makes sense. Structure has two ways to tell you about the layout of the objects
627         it is describing: m_offset and the property table. Most structures only have m_offset and report
628         null for the property table. If the property table is there, it will tell you additional
629         information and that information subsumes m_offset - but the m_offset is still there. So, when
630         we have a property table, we have to keep it in sync with the m_offset. There is a bunch of
631         machinery to do this.
632         
633         Changing the property table only happens on the main thread.
634         
635         Because the machinery to change the property table is so complex, especially with respect to
636         keeping it in sync with m_offset, we have the checkOffsetConsistency method. It's meant to be
637         called at key points before and after changes to the property table or the offset.
638
639         Most clients of Structure who care about object layout, including the concurrent thread, will
640         want to know m_offset and not the property table. If they want the property table, they will
641         already be super careful. The concurrent thread has special methods for this, like
642         Structure::getConcurrently(), which uses fine-grained locking to ensure that it sees a coherent
643         view of the property table.
644         
645         Adding locking to checkOffsetConsistency() is probably a bad idea since that method may be
646         called when the relevant lock is already held. So, we'd have awkward recursive locking issues.
647         
648         But right now, the concurrent JIT thread may call a method, like Structure::outOfLineCapacity(),
649         which has a call to checkOffsetConsistency(). The call to checkOffsetConsistency() is there
650         because we have found that it helps quickly identify situations where the property table and
651         m_offset get out of sync - mainly because code that changes either of those things will usually
652         also want to know the outOfLineCapacity(). But Structure::outOfLineCapacity() doesn't *actually*
653         need the property table; it uses the m_offset. The concurrent JIT is correct to call
654         outOfLineCapacity(), and is right to do so without holding any locks (since in all cases where
655         it calls outOfLineCapacity() it has already proven that m_offset is immutable). But because
656         outOfLineCapacity() calls checkOffsetConsistency(), and checkOffsetConsistency() doesn't grab
657         locks, and that same structure is having its property table modified by the main thread, we end
658         up with these spurious assertion failures. FWIW, the structure isn't *actually* having *its*
659         property table modified - instead what happens is that some downstream structure steals the
660         property table and then starts adding things to it. The concurrent thread loads the property
661         table before it's stolen, and hence the badness.
662         
663         I suspect there are other code paths that lead to the concurrent JIT calling some Structure
664         method that it is fine and safe to call, but then that method calls checkOffsetConsistency(),
665         and then you have a possible crash.
666         
667         The most sensible solution to this appears to be to make sure that checkOffsetConsistency() is
668         aware of its uselessness to the concurrent JIT thread. This change makes it return early if
669         it's in the concurrent JIT.
670         
671         * runtime/StructureInlines.h:
672         (JSC::Structure::checkOffsetConsistency):
673
674 2013-10-18  Daniel Bates  <dabates@apple.com>
675
676         Add SPI to disable the garbage collector timer
677         https://bugs.webkit.org/show_bug.cgi?id=122921
678
679         Add null check to Heap::setGarbageCollectionTimerEnabled() that I inadvertently
680         omitted.
681
682         * heap/Heap.cpp:
683         (JSC::Heap::setGarbageCollectionTimerEnabled):
684
685 2013-10-18  Julien Brianceau  <jbriance@cisco.com>
686
687         Group 64-bit specific and 32-bit specific callOperation implementations.
688         https://bugs.webkit.org/show_bug.cgi?id=123024
689
690         Reviewed by Michael Saboff.
691
692         This is not a big deal, but could be less confusing when reading the code.
693
694         * jit/JITInlines.h:
695         (JSC::JIT::callOperation):
696         (JSC::JIT::callOperationWithCallFrameRollbackOnException):
697         (JSC::JIT::callOperationNoExceptionCheck):
698
699 2013-10-18  Nadav Rotem  <nrotem@apple.com>
700
701         Fix a FlushLiveness problem.
702         https://bugs.webkit.org/show_bug.cgi?id=122984
703
704         Reviewed by Filip Pizlo.
705
706         * dfg/DFGFlushLivenessAnalysisPhase.cpp:
707         (JSC::DFG::FlushLivenessAnalysisPhase::process):
708
709 2013-10-18  Michael Saboff  <msaboff@apple.com>
710
711         Change native function call stubs to use JIT operations instead of ctiVMHandleException
712         https://bugs.webkit.org/show_bug.cgi?id=122982
713
714         Reviewed by Geoffrey Garen.
715
716         Change ctiVMHandleException to operationVMHandleException.  Change all exception operations to
717         return the catch callFrame and entryPC via vm.callFrameForThrow and vm.targetMachinePCForThrow.
718         This removed calling convention headaches, fixing https://bugs.webkit.org/show_bug.cgi?id=122980
719         in the process.
720
721         * dfg/DFGJITCompiler.cpp:
722         (JSC::DFG::JITCompiler::compileExceptionHandlers):
723         * jit/CCallHelpers.h:
724         (JSC::CCallHelpers::jumpToExceptionHandler):
725         * jit/JIT.cpp:
726         (JSC::JIT::privateCompileExceptionHandlers):
727         * jit/JIT.h:
728         * jit/JITExceptions.cpp:
729         (JSC::genericUnwind):
730         * jit/JITExceptions.h:
731         * jit/JITInlines.h:
732         (JSC::JIT::callOperationNoExceptionCheck):
733         * jit/JITOpcodes.cpp:
734         (JSC::JIT::emit_op_throw):
735         * jit/JITOpcodes32_64.cpp:
736         (JSC::JIT::privateCompileCTINativeCall):
737         (JSC::JIT::emit_op_throw):
738         * jit/JITOperations.cpp:
739         * jit/JITOperations.h:
740         * jit/JITStubs.cpp:
741         * jit/JITStubs.h:
742         * jit/JITStubsARM.h:
743         * jit/JITStubsARM64.h:
744         * jit/JITStubsARMv7.h:
745         * jit/JITStubsMIPS.h:
746         * jit/JITStubsMSVC64.asm:
747         * jit/JITStubsSH4.h:
748         * jit/JITStubsX86.h:
749         * jit/JITStubsX86_64.h:
750         * jit/Repatch.cpp:
751         (JSC::tryBuildGetByIDList):
752         * jit/SlowPathCall.h:
753         (JSC::JITSlowPathCall::call):
754         * jit/ThunkGenerators.cpp:
755         (JSC::throwExceptionFromCallSlowPathGenerator):
756         (JSC::nativeForGenerator):
757         * runtime/VM.h:
758         (JSC::VM::callFrameForThrowOffset):
759         (JSC::VM::targetMachinePCForThrowOffset):
760
761 2013-10-18  Julien Brianceau  <jbriance@cisco.com>
762
763         Fix J_JITOperation_EAapJ call for MIPS and ARM EABI.
764         https://bugs.webkit.org/show_bug.cgi?id=123023
765
766         Reviewed by Michael Saboff.
767
768         * jit/JITInlines.h:
769         (JSC::JIT::callOperation): EncodedJSValue parameter do not need alignment
770         using EABI_32BIT_DUMMY_ARG here.
771
772 2013-10-17  Filip Pizlo  <fpizlo@apple.com>
773
774         Unreviewed, another ARM64 build fix.
775         
776         Get rid of andPtr(TrustedImmPtr, blah), since it would take Effort to get it to work
777         on ARM64 and none of its uses are legit - they should all be using
778         andPtr(TrustedImm32, blah) anyway.
779
780         * assembler/MacroAssembler.h:
781         * assembler/MacroAssemblerARM64.h:
782         * dfg/DFGJITCompiler.cpp:
783         (JSC::DFG::JITCompiler::compileExceptionHandlers):
784         * jit/JIT.cpp:
785         (JSC::JIT::privateCompileExceptionHandlers):
786
787 2013-10-17  Filip Pizlo  <fpizlo@apple.com>
788
789         Unreviewed, speculative ARM64 build fix.
790         
791         move(ImmPtr, blah) is only available in MacroAssembler since that's where blinding is
792         implemented. So, you have to use TrustedImmPtr in the superclasses.
793
794         * assembler/MacroAssemblerARM64.h:
795         (JSC::MacroAssemblerARM64::store8):
796         (JSC::MacroAssemblerARM64::branchTest8):
797
798 2013-10-17  Filip Pizlo  <fpizlo@apple.com>
799
800         Unreviewed, speculative ARM build fix.
801         https://bugs.webkit.org/show_bug.cgi?id=122890
802         <rdar://problem/15258624>
803
804         * assembler/ARM64Assembler.h:
805         (JSC::ARM64Assembler::firstRegister):
806         (JSC::ARM64Assembler::lastRegister):
807         (JSC::ARM64Assembler::firstFPRegister):
808         (JSC::ARM64Assembler::lastFPRegister):
809         * assembler/MacroAssemblerARM64.h:
810         * assembler/MacroAssemblerARMv7.h:
811
812 2013-10-17  Andreas Kling  <akling@apple.com>
813
814         Pass VM instead of JSGlobalObject to JSONObject constructor.
815         <https://webkit.org/b/122999>
816
817         JSONObject was only use the JSGlobalObject to grab at the VM.
818         Dodge a few loads by passing the VM directly instead.
819
820         Reviewed by Geoffrey Garen.
821
822         * runtime/JSONObject.cpp:
823         (JSC::JSONObject::JSONObject):
824         (JSC::JSONObject::finishCreation):
825         * runtime/JSONObject.h:
826         (JSC::JSONObject::create):
827
828 2013-10-17  Geoffrey Garen  <ggaren@apple.com>
829
830         Removed the JITStackFrame struct
831         https://bugs.webkit.org/show_bug.cgi?id=123001
832
833         Reviewed by Anders Carlsson.
834
835         * jit/JITStubs.h: JITStackFrame and JITStubArg are unused now, since all
836         our helper functions obey the C function call ABI.
837
838 2013-10-17  Geoffrey Garen  <ggaren@apple.com>
839
840         Removed an unused #define
841         https://bugs.webkit.org/show_bug.cgi?id=123000
842
843         Reviewed by Anders Carlsson.
844
845         * jit/JITStubs.h: Removed the concept of JITSTACKFRAME_ARGS_INDEX,
846         since it is unused now. This is a step toward using the C stack.
847
848 2013-10-17  Geoffrey Garen  <ggaren@apple.com>
849
850         Eliminate uses of JITSTACKFRAME_ARGS_INDEX as scratch area for thunks
851         https://bugs.webkit.org/show_bug.cgi?id=122973
852
853         Reviewed by Michael Saboff.
854
855         * jit/ThunkGenerators.cpp:
856         (JSC::throwExceptionFromCallSlowPathGenerator): This was all dead code,
857         so I removed it.
858
859         The code acted as if it needed to pass an argument to
860         lookupExceptionHandler, and as if it passed that argument to itself
861         through JITStackFrame. However, lookupExceptionHandler does not take
862         an argument (other than the default ExecState argument), and the code
863         did not initialize the thing that it thought it passed to itself!
864
865 2013-10-17  Alex Christensen  <achristensen@webkit.org>
866
867         Run JavaScriptCore tests again on Windows.
868         https://bugs.webkit.org/show_bug.cgi?id=122787
869
870         Reviewed by Tim Horton.
871
872         * JavaScriptCore.vcxproj/JavaScriptCore.sln: Added.
873         * jit/JITStubsMSVC64.asm: Removed reference to cti_vm_throw unused since r157581.
874
875 2013-10-17  Geoffrey Garen  <ggaren@apple.com>
876
877         Removed restoreArgumentReference (another use of JITStackFrame)
878         https://bugs.webkit.org/show_bug.cgi?id=122997
879
880         Reviewed by Oliver Hunt.
881
882         * jit/JSInterfaceJIT.h: Removed an unused function. This is a step
883         toward using the C stack.
884
885 2013-10-17  Oliver Hunt  <oliver@apple.com>
886
887         Remove JITStubCall.h
888         https://bugs.webkit.org/show_bug.cgi?id=122991
889
890         Reviewed by Geoff Garen.
891
892         Happily this is no longer used
893
894         * GNUmakefile.list.am:
895         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
896         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
897         * JavaScriptCore.xcodeproj/project.pbxproj:
898         * jit/JIT.cpp:
899         * jit/JITArithmetic.cpp:
900         * jit/JITArithmetic32_64.cpp:
901         * jit/JITCall.cpp:
902         * jit/JITCall32_64.cpp:
903         * jit/JITOpcodes.cpp:
904         * jit/JITOpcodes32_64.cpp:
905         * jit/JITPropertyAccess.cpp:
906         * jit/JITPropertyAccess32_64.cpp:
907         * jit/JITStubCall.h: Removed.
908
909 2013-10-17  Geoffrey Garen  <ggaren@apple.com>
910
911         Removed a use of JITSTACKFRAME_ARGS_INDEX
912         https://bugs.webkit.org/show_bug.cgi?id=122989
913
914         Reviewed by Oliver Hunt.
915
916         * jit/JITStubCall.h: Removed an unused function. This is one step closer
917         to using the C stack.
918
919 2013-10-17  Geoffrey Garen  <ggaren@apple.com>
920
921         Change emit_op_catch to use another method to materialize VM
922         https://bugs.webkit.org/show_bug.cgi?id=122977
923
924         Reviewed by Oliver Hunt.
925
926         * jit/JITOpcodes.cpp:
927         (JSC::JIT::emit_op_catch):
928         * jit/JITOpcodes32_64.cpp:
929         (JSC::JIT::emit_op_catch): Use a constant. It removes our dependency
930         on JITStackFrame. It is also faster and simpler.
931
932 2013-10-17  Geoffrey Garen  <ggaren@apple.com>
933
934         Eliminate emitGetJITStubArg() - dead code
935         https://bugs.webkit.org/show_bug.cgi?id=122975
936
937         Reviewed by Anders Carlsson.
938
939         * jit/JIT.h:
940         * jit/JITInlines.h: Removed unused, deprecated function.
941
942 2013-10-17  Mark Lam  <mark.lam@apple.com>
943
944         Eliminate all ASSERT references to OBJECT_OFFSETOF(struct JITStackFrame,...) in JITStubsXXX.h.
945         https://bugs.webkit.org/show_bug.cgi?id=122979.
946
947         Reviewed by Michael Saboff.
948
949         * jit/JITStubs.cpp:
950         * jit/JITStubs.h:
951         * jit/JITStubsARM.h:
952         * jit/JITStubsARM64.h:
953         * jit/JITStubsARMv7.h:
954         * jit/JITStubsMIPS.h:
955         * jit/JITStubsSH4.h:
956         * jit/JITStubsX86.h:
957         * jit/JITStubsX86_64.h:
958         * runtime/VM.cpp:
959         (JSC::VM::VM):
960
961 2013-10-17  Michael Saboff  <msaboff@apple.com>
962
963         Remove saving callFrameRegister to JITStackFrame in JITCompiler::compileFunction()
964         https://bugs.webkit.org/show_bug.cgi?id=122974
965
966         Reviewed by Geoffrey Garen.
967
968         Eliminated unneeded storing to JITStackFrame.
969
970         * dfg/DFGJITCompiler.cpp:
971         (JSC::DFG::JITCompiler::compileFunction):
972
973 2013-10-17  Michael Saboff  <msaboff@apple.com>
974
975         Transition cti_op_throw and cti_vm_throw to a JIT operation
976         https://bugs.webkit.org/show_bug.cgi?id=122931
977
978         Reviewed by Filip Pizlo.
979
980         Moved cti_op_throw to operationThrow.  Made the caller responsible for jumping to the
981         catch handler.  Eliminated cti_op_throw_static_error, cti_vm_throw, ctiVMThrowTrampoline()
982         and their callers as it is now dead code.  There is some work needed on the Microsoft X86
983         callOperation to handle the need to provide space for structure return value.
984
985         * jit/JIT.h:
986         * jit/JITInlines.h:
987         (JSC::JIT::callOperation):
988         * jit/JITOpcodes.cpp:
989         (JSC::JIT::emit_op_throw):
990         * jit/JITOpcodes32_64.cpp:
991         (JSC::JIT::emit_op_throw):
992         (JSC::JIT::emit_op_catch):
993         * jit/JITOperations.cpp:
994         * jit/JITOperations.h:
995         * jit/JITStubs.cpp:
996         * jit/JITStubs.h:
997         * jit/JITStubsARM.h:
998         * jit/JITStubsARM64.h:
999         * jit/JITStubsARMv7.h:
1000         * jit/JITStubsMIPS.h:
1001         * jit/JITStubsMSVC64.asm:
1002         * jit/JITStubsSH4.h:
1003         * jit/JITStubsX86.h:
1004         * jit/JITStubsX86_64.h:
1005         * jit/JSInterfaceJIT.h:
1006
1007 2013-10-17  Mark Lam  <mark.lam@apple.com>
1008
1009         Remove JITStackFrame references in the C Loop LLINT.
1010         https://bugs.webkit.org/show_bug.cgi?id=122950.
1011
1012         Reviewed by Michael Saboff.
1013
1014         * jit/JITStubs.h:
1015         * llint/LowLevelInterpreter.cpp:
1016         (JSC::CLoop::execute):
1017         * offlineasm/cloop.rb:
1018
1019 2013-10-17  Mark Lam  <mark.lam@apple.com>
1020
1021         Remove JITStackFrame references in JIT probes.
1022         https://bugs.webkit.org/show_bug.cgi?id=122947.
1023
1024         Reviewed by Michael Saboff.
1025
1026         * assembler/MacroAssemblerARM.cpp:
1027         (JSC::MacroAssemblerARM::ProbeContext::dump):
1028         * assembler/MacroAssemblerARM.h:
1029         * assembler/MacroAssemblerARMv7.cpp:
1030         (JSC::MacroAssemblerARMv7::ProbeContext::dump):
1031         * assembler/MacroAssemblerARMv7.h:
1032         * assembler/MacroAssemblerX86Common.cpp:
1033         (JSC::MacroAssemblerX86Common::ProbeContext::dump):
1034         * assembler/MacroAssemblerX86Common.h:
1035         * jit/JITStubsARM.h:
1036         * jit/JITStubsARMv7.h:
1037         * jit/JITStubsX86.h:
1038         * jit/JITStubsX86Common.h:
1039         * jit/JITStubsX86_64.h:
1040
1041 2013-10-17  Julien Brianceau  <jbriance@cisco.com>
1042
1043         Fix build when NUMBER_OF_ARGUMENT_REGISTERS == 4.
1044         https://bugs.webkit.org/show_bug.cgi?id=122949
1045
1046         Reviewed by Andreas Kling.
1047
1048         * jit/CCallHelpers.h:
1049         (JSC::CCallHelpers::setupArgumentsWithExecState):
1050
1051 2013-10-16  Mark Lam  <mark.lam@apple.com>
1052
1053         Transition remaining op_get* JITStubs to JIT operations.
1054         https://bugs.webkit.org/show_bug.cgi?id=122925.
1055
1056         Reviewed by Geoffrey Garen.
1057
1058         Transitioning:
1059             cti_op_get_by_id_generic
1060             cti_op_get_by_val
1061             cti_op_get_by_val_generic
1062             cti_op_get_by_val_string
1063
1064         * dfg/DFGOperations.cpp:
1065         * dfg/DFGOperations.h:
1066         * jit/JIT.h:
1067         * jit/JITInlines.h:
1068         (JSC::JIT::callOperation):
1069         * jit/JITOpcodes.cpp:
1070         (JSC::JIT::emitSlow_op_get_arguments_length):
1071         (JSC::JIT::emitSlow_op_get_argument_by_val):
1072         * jit/JITOpcodes32_64.cpp:
1073         (JSC::JIT::emitSlow_op_get_arguments_length):
1074         (JSC::JIT::emitSlow_op_get_argument_by_val):
1075         * jit/JITOperations.cpp:
1076         * jit/JITOperations.h:
1077         * jit/JITPropertyAccess.cpp:
1078         (JSC::JIT::emitSlow_op_get_by_val):
1079         (JSC::JIT::emitSlow_op_get_by_pname):
1080         (JSC::JIT::privateCompileGetByVal):
1081         * jit/JITPropertyAccess32_64.cpp:
1082         (JSC::JIT::emitSlow_op_get_by_val):
1083         (JSC::JIT::emitSlow_op_get_by_pname):
1084         * jit/JITStubs.cpp:
1085         * jit/JITStubs.h:
1086         * runtime/Executable.cpp:
1087         (JSC::setupLLInt): Added some UNUSED_PARAMs to fix the no LLINT build.
1088         * runtime/Options.cpp:
1089         (JSC::Options::initialize):
1090
1091 2013-10-16  Filip Pizlo  <fpizlo@apple.com>
1092
1093         Introduce WTF::Bag and start using it for InlineCallFrameSet
1094         https://bugs.webkit.org/show_bug.cgi?id=122941
1095
1096         Reviewed by Geoffrey Garen.
1097         
1098         Use Bag for InlineCallFrameSet. If this works out then I'll make other
1099         SegmentedVectors into Bags as well.
1100
1101         * bytecode/InlineCallFrameSet.cpp:
1102         (JSC::InlineCallFrameSet::add):
1103         * bytecode/InlineCallFrameSet.h:
1104         (JSC::InlineCallFrameSet::begin):
1105         (JSC::InlineCallFrameSet::end):
1106         * dfg/DFGArgumentsSimplificationPhase.cpp:
1107         (JSC::DFG::ArgumentsSimplificationPhase::run):
1108         * dfg/DFGJITCompiler.cpp:
1109         (JSC::DFG::JITCompiler::link):
1110         * dfg/DFGStackLayoutPhase.cpp:
1111         (JSC::DFG::StackLayoutPhase::run):
1112         * dfg/DFGVirtualRegisterAllocationPhase.cpp:
1113         (JSC::DFG::VirtualRegisterAllocationPhase::run):
1114
1115 2013-10-16  Filip Pizlo  <fpizlo@apple.com>
1116
1117         libllvmForJSC shouldn't call exit(1) on report_fatal_error()
1118         https://bugs.webkit.org/show_bug.cgi?id=122905
1119         <rdar://problem/15237856>
1120
1121         Reviewed by Michael Saboff.
1122         
1123         Expose the new LLVMInstallFatalErrorHandler() API through the soft linking magic and
1124         then always call it to install something that calls CRASH().
1125
1126         * llvm/InitializeLLVM.cpp:
1127         (JSC::llvmCrash):
1128         (JSC::initializeLLVMOnce):
1129         (JSC::initializeLLVM):
1130         * llvm/LLVMAPIFunctions.h:
1131
1132 2013-10-16  Filip Pizlo  <fpizlo@apple.com>
1133
1134         Prototype chain repatching in the polymorphic case fails to check if the receiver is a dictionary
1135         https://bugs.webkit.org/show_bug.cgi?id=122938
1136
1137         Reviewed by Sam Weinig.
1138         
1139         This fixes jsc-layout-tests.yaml/js/script-tests/dictionary-prototype-caching.js.layout-no-llint.
1140
1141         * jit/Repatch.cpp:
1142         (JSC::tryBuildGetByIDList):
1143
1144 2013-10-16  Filip Pizlo  <fpizlo@apple.com>
1145
1146         JIT::appendCall() needs to killLastResultRegister() or equivalent since there's some really bad code that expects it
1147         https://bugs.webkit.org/show_bug.cgi?id=122937
1148
1149         Reviewed by Geoffrey Garen.
1150         
1151         JITStubCall used to do it.
1152         
1153         This makes mozilla-tests.yaml/ecma/Statements/12.10-1.js.mozilla-baseline pass.
1154
1155         * jit/JIT.h:
1156         (JSC::JIT::appendCall):
1157
1158 2013-10-16  Michael Saboff  <msaboff@apple.com>
1159
1160         transition void cti_op_put_by_val* stubs to JIT operations
1161         https://bugs.webkit.org/show_bug.cgi?id=122903
1162
1163         Reviewed by Geoffrey Garen.
1164
1165         Transitioned cti_op_put_by_val and cti_op_put_by_val_generic to operationPutByVal and
1166         operationPutByValGeneric.
1167
1168         * jit/CCallHelpers.h:
1169         (JSC::CCallHelpers::setupArgumentsWithExecState):
1170         * jit/JIT.h:
1171         * jit/JITInlines.h:
1172         (JSC::JIT::callOperation):
1173         * jit/JITOperations.cpp:
1174         * jit/JITOperations.h:
1175         * jit/JITPropertyAccess.cpp:
1176         (JSC::JIT::emitSlow_op_put_by_val):
1177         (JSC::JIT::privateCompilePutByVal):
1178         * jit/JITPropertyAccess32_64.cpp:
1179         (JSC::JIT::emitSlow_op_put_by_val):
1180         * jit/JITStubs.cpp:
1181         * jit/JITStubs.h:
1182         * jit/JSInterfaceJIT.h:
1183
1184 2013-10-16  Oliver Hunt  <oliver@apple.com>
1185
1186         Implement ES6 spread operator
1187         https://bugs.webkit.org/show_bug.cgi?id=122911
1188
1189         Reviewed by Michael Saboff.
1190
1191         Implement the ES6 spread operator
1192
1193         This has a little bit of refactoring to move the enumeration logic out ForOfNode
1194         and into BytecodeGenerator, and then adds the logic to make it nicely callback
1195         driven.
1196
1197         The rest of the logic is just the addition of the SpreadExpressionNode, the parsing,
1198         and actually handling the spread.
1199
1200         * bytecompiler/BytecodeGenerator.cpp:
1201         (JSC::BytecodeGenerator::emitNewArray):
1202         (JSC::BytecodeGenerator::emitCall):
1203         (JSC::BytecodeGenerator::emitEnumeration):
1204         * bytecompiler/BytecodeGenerator.h:
1205         * bytecompiler/NodesCodegen.cpp:
1206         (JSC::ArrayNode::emitBytecode):
1207         (JSC::ForOfNode::emitBytecode):
1208         (JSC::SpreadExpressionNode::emitBytecode):
1209         * parser/ASTBuilder.h:
1210         (JSC::ASTBuilder::createSpreadExpression):
1211         * parser/Lexer.cpp:
1212         (JSC::::lex):
1213         * parser/NodeConstructors.h:
1214         (JSC::SpreadExpressionNode::SpreadExpressionNode):
1215         * parser/Nodes.h:
1216         (JSC::ExpressionNode::isSpreadExpression):
1217         (JSC::SpreadExpressionNode::expression):
1218         * parser/Parser.cpp:
1219         (JSC::::parseArrayLiteral):
1220         (JSC::::parseArguments):
1221         (JSC::::parseMemberExpression):
1222         * parser/Parser.h:
1223         (JSC::Parser::getTokenName):
1224         (JSC::Parser::updateErrorMessageSpecialCase):
1225         * parser/ParserTokens.h:
1226         * parser/SyntaxChecker.h:
1227         (JSC::SyntaxChecker::createSpreadExpression):
1228
1229 2013-10-16  Filip Pizlo  <fpizlo@apple.com>
1230
1231         Add a useLLInt option to jsc
1232         https://bugs.webkit.org/show_bug.cgi?id=122930
1233
1234         Reviewed by Geoffrey Garen.
1235
1236         * runtime/Executable.cpp:
1237         (JSC::setupLLInt):
1238         (JSC::setupJIT):
1239         (JSC::ScriptExecutable::prepareForExecutionImpl):
1240         * runtime/Options.h:
1241
1242 2013-10-16  Mark Hahnenberg  <mhahnenberg@apple.com>
1243
1244         Build fix.
1245
1246         Forgot to svn add DeferGC.cpp
1247
1248         * heap/DeferGC.cpp: Added.
1249
1250 2013-10-16  Filip Pizlo  <fpizlo@apple.com>
1251
1252         r157411 fails run-javascriptcore-tests when run with Baseline JIT
1253         https://bugs.webkit.org/show_bug.cgi?id=122902
1254
1255         Reviewed by Mark Hahnenberg.
1256         
1257         It turns out that this was a long-standing bug in the DFG PutById repatching logic. It's
1258         not legal to patch if the typeInfo tells you that you can't patch. The old JIT's patching
1259         logic did this right, and the DFG's GetById patching logic did it right; but DFG PutById
1260         didn't. Turns out that there's even a helpful method,
1261         Structure::propertyAccessesAreCacheable(), that will even do all of the checks for you!
1262
1263         * jit/Repatch.cpp:
1264         (JSC::tryCachePutByID):
1265
1266 2013-10-16  Mark Hahnenberg  <mhahnenberg@apple.com>
1267
1268         llint_slow_path_put_by_id can deadlock on a ConcurrentJITLock
1269         https://bugs.webkit.org/show_bug.cgi?id=122667
1270
1271         Reviewed by Geoffrey Garen.
1272
1273         The issue this patch is attempting to fix is that there are places in our codebase
1274         where we acquire the ConcurrentJITLock for a particular CodeBlock, then we do some
1275         operations that can initiate a garbage collection. Garbage collection then calls 
1276         some methods of CodeBlock that also take the ConcurrentJITLock (because they don't
1277         always necessarily run during garbage collection). This causes a deadlock.
1278  
1279         To fix this issue, this patch adds a new RAII-style object (DisallowGC) that stores 
1280         into a thread-local field that indicates that it is unsafe to perform any operation 
1281         that could trigger garbage collection on the current thread. In debug builds, 
1282         ConcurrentJITLocker contains one of these DisallowGC objects so that we can eagerly 
1283         detect deadlocks.
1284  
1285         This patch also adds a new type of ConcurrentJITLocker, GCSafeConcurrentJITLocker,
1286         which uses the DeferGC mechanism to prevent collections from occurring while the 
1287         lock is held.
1288
1289         * CMakeLists.txt:
1290         * GNUmakefile.list.am:
1291         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
1292         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
1293         * JavaScriptCore.xcodeproj/project.pbxproj:
1294         * heap/DeferGC.h:
1295         (JSC::DisallowGC::DisallowGC):
1296         (JSC::DisallowGC::~DisallowGC):
1297         (JSC::DisallowGC::isGCDisallowedOnCurrentThread):
1298         (JSC::DisallowGC::initialize):
1299         * jit/Repatch.cpp:
1300         (JSC::repatchPutByID):
1301         (JSC::buildPutByIdList):
1302         * llint/LLIntSlowPaths.cpp:
1303         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
1304         * runtime/ConcurrentJITLock.h:
1305         (JSC::ConcurrentJITLockerBase::ConcurrentJITLockerBase):
1306         (JSC::ConcurrentJITLockerBase::~ConcurrentJITLockerBase):
1307         (JSC::ConcurrentJITLockerBase::unlockEarly):
1308         (JSC::GCSafeConcurrentJITLocker::GCSafeConcurrentJITLocker):
1309         (JSC::GCSafeConcurrentJITLocker::~GCSafeConcurrentJITLocker):
1310         (JSC::GCSafeConcurrentJITLocker::NoDefer::NoDefer):
1311         (JSC::ConcurrentJITLocker::ConcurrentJITLocker):
1312         * runtime/InitializeThreading.cpp:
1313         (JSC::initializeThreadingOnce):
1314         * runtime/JSCellInlines.h:
1315         (JSC::allocateCell):
1316         * runtime/JSSymbolTableObject.h:
1317         (JSC::symbolTablePut):
1318         * runtime/Structure.cpp: materializePropertyMapIfNecessary* now has a problem in that it
1319         can start a garbage collection when the GCSafeConcurrentJITLocker goes out of scope, but 
1320         before the caller has a chance to use the newly created PropertyTable. The garbage collection
1321         clears the PropertyTable, and then the caller uses it assuming it's valid. To avoid this,
1322         we must DeferGC until the caller is done getting the newly materialized PropertyTable from 
1323         the Structure.
1324         (JSC::Structure::materializePropertyMap):
1325         (JSC::Structure::despecifyDictionaryFunction):
1326         (JSC::Structure::changePrototypeTransition):
1327         (JSC::Structure::despecifyFunctionTransition):
1328         (JSC::Structure::attributeChangeTransition):
1329         (JSC::Structure::toDictionaryTransition):
1330         (JSC::Structure::preventExtensionsTransition):
1331         (JSC::Structure::takePropertyTableOrCloneIfPinned):
1332         (JSC::Structure::isSealed):
1333         (JSC::Structure::isFrozen):
1334         (JSC::Structure::addPropertyWithoutTransition):
1335         (JSC::Structure::removePropertyWithoutTransition):
1336         (JSC::Structure::get):
1337         (JSC::Structure::despecifyFunction):
1338         (JSC::Structure::despecifyAllFunctions):
1339         (JSC::Structure::putSpecificValue):
1340         (JSC::Structure::createPropertyMap):
1341         (JSC::Structure::getPropertyNamesFromStructure):
1342         * runtime/Structure.h:
1343         (JSC::Structure::materializePropertyMapIfNecessary):
1344         (JSC::Structure::materializePropertyMapIfNecessaryForPinning):
1345         * runtime/StructureInlines.h:
1346         (JSC::Structure::get):
1347         * runtime/SymbolTable.h:
1348         (JSC::SymbolTable::find):
1349         (JSC::SymbolTable::end):
1350
1351 2013-10-16  Daniel Bates  <dabates@apple.com>
1352
1353         Add SPI to disable the garbage collector timer
1354         https://bugs.webkit.org/show_bug.cgi?id=122921
1355
1356         Reviewed by Geoffrey Garen.
1357
1358         Based on a patch by Mark Hahnenberg.
1359
1360         * API/JSBase.cpp:
1361         (JSDisableGCTimer): Added; SPI function.
1362         * API/JSBasePrivate.h:
1363         * heap/BlockAllocator.cpp:
1364         (JSC::createBlockFreeingThread): Added.
1365         (JSC::BlockAllocator::BlockAllocator): Modified to use JSC::createBlockFreeingThread()
1366         to conditionally create the "block freeing" thread depending on the value of
1367         GCActivityCallback::s_shouldCreateGCTimer.
1368         (JSC::BlockAllocator::~BlockAllocator):
1369         * heap/BlockAllocator.h:
1370         (JSC::BlockAllocator::deallocate):
1371         * heap/Heap.cpp:
1372         (JSC::Heap::didAbandon):
1373         (JSC::Heap::collect):
1374         (JSC::Heap::didAllocate):
1375         * heap/HeapTimer.cpp:
1376         (JSC::HeapTimer::timerDidFire):
1377         * runtime/GCActivityCallback.cpp:
1378         * runtime/GCActivityCallback.h:
1379         (JSC::DefaultGCActivityCallback::create): Only instantiate a DefaultGCActivityCallback object
1380         when GCActivityCallback::s_shouldCreateGCTimer is true so as to prevent allocating a HeapTimer
1381         object (since DefaultGCActivityCallback ultimately extends HeapTimer).
1382
1383 2013-10-16  Commit Queue  <commit-queue@webkit.org>
1384
1385         Unreviewed, rolling out r157529.
1386         http://trac.webkit.org/changeset/157529
1387         https://bugs.webkit.org/show_bug.cgi?id=122919
1388
1389         Caused score test failures and some build failures. (Requested
1390         by rfong on #webkit).
1391
1392         * bytecompiler/BytecodeGenerator.cpp:
1393         (JSC::BytecodeGenerator::emitNewArray):
1394         (JSC::BytecodeGenerator::emitCall):
1395         (JSC::BytecodeGenerator::emitReadOnlyExceptionIfNeeded):
1396         * bytecompiler/BytecodeGenerator.h:
1397         * bytecompiler/NodesCodegen.cpp:
1398         (JSC::ArrayNode::emitBytecode):
1399         (JSC::CallArguments::CallArguments):
1400         (JSC::ForOfNode::emitBytecode):
1401         (JSC::BindingNode::collectBoundIdentifiers):
1402         * parser/ASTBuilder.h:
1403         * parser/Lexer.cpp:
1404         (JSC::::lex):
1405         * parser/NodeConstructors.h:
1406         (JSC::DotAccessorNode::DotAccessorNode):
1407         * parser/Nodes.h:
1408         * parser/Parser.cpp:
1409         (JSC::::parseArrayLiteral):
1410         (JSC::::parseArguments):
1411         (JSC::::parseMemberExpression):
1412         * parser/Parser.h:
1413         (JSC::Parser::getTokenName):
1414         (JSC::Parser::updateErrorMessageSpecialCase):
1415         * parser/ParserTokens.h:
1416         * parser/SyntaxChecker.h:
1417
1418 2013-10-16  Julien Brianceau  <jbriance@cisco.com>
1419
1420         Remove useless architecture specific implementation in DFG.
1421         https://bugs.webkit.org/show_bug.cgi?id=122917.
1422
1423         Reviewed by Michael Saboff.
1424
1425         With CPU(ARM) && CPU(ARM_HARDFP) architecture, the fallback implementation is fine
1426         as FPRInfo::argumentFPR0 == FPRInfo::returnValueFPR in this case.
1427
1428         * dfg/DFGSpeculativeJIT.h:
1429
1430 2013-10-16  Julien Brianceau  <jbriance@cisco.com>
1431
1432         Remove unused JIT::restoreArgumentReferenceForTrampoline function.
1433         https://bugs.webkit.org/show_bug.cgi?id=122916.
1434
1435         Reviewed by Michael Saboff.
1436
1437         This architecture specific function is not used anymore, so get rid of it.
1438
1439         * jit/JIT.h:
1440         * jit/JITInlines.h:
1441
1442 2013-10-16  Oliver Hunt  <oliver@apple.com>
1443
1444         Implement ES6 spread operator
1445         https://bugs.webkit.org/show_bug.cgi?id=122911
1446
1447         Reviewed by Michael Saboff.
1448
1449         Implement the ES6 spread operator
1450
1451         This has a little bit of refactoring to move the enumeration logic out ForOfNode
1452         and into BytecodeGenerator, and then adds the logic to make it nicely callback
1453         driven.
1454
1455         The rest of the logic is just the addition of the SpreadExpressionNode, the parsing,
1456         and actually handling the spread.
1457
1458         * bytecompiler/BytecodeGenerator.cpp:
1459         (JSC::BytecodeGenerator::emitNewArray):
1460         (JSC::BytecodeGenerator::emitCall):
1461         (JSC::BytecodeGenerator::emitEnumeration):
1462         * bytecompiler/BytecodeGenerator.h:
1463         * bytecompiler/NodesCodegen.cpp:
1464         (JSC::ArrayNode::emitBytecode):
1465         (JSC::ForOfNode::emitBytecode):
1466         (JSC::SpreadExpressionNode::emitBytecode):
1467         * parser/ASTBuilder.h:
1468         (JSC::ASTBuilder::createSpreadExpression):
1469         * parser/Lexer.cpp:
1470         (JSC::::lex):
1471         * parser/NodeConstructors.h:
1472         (JSC::SpreadExpressionNode::SpreadExpressionNode):
1473         * parser/Nodes.h:
1474         (JSC::ExpressionNode::isSpreadExpression):
1475         (JSC::SpreadExpressionNode::expression):
1476         * parser/Parser.cpp:
1477         (JSC::::parseArrayLiteral):
1478         (JSC::::parseArguments):
1479         (JSC::::parseMemberExpression):
1480         * parser/Parser.h:
1481         (JSC::Parser::getTokenName):
1482         (JSC::Parser::updateErrorMessageSpecialCase):
1483         * parser/ParserTokens.h:
1484         * parser/SyntaxChecker.h:
1485         (JSC::SyntaxChecker::createSpreadExpression):
1486
1487 2013-10-16  Mark Lam  <mark.lam@apple.com>
1488
1489         Transition void cti_op_tear_off* methods to JIT operations for 32 bit.
1490         https://bugs.webkit.org/show_bug.cgi?id=122899.
1491
1492         Reviewed by Michael Saboff.
1493
1494         * jit/JITOpcodes32_64.cpp:
1495         (JSC::JIT::emit_op_tear_off_activation):
1496         (JSC::JIT::emit_op_tear_off_arguments):
1497         * jit/JITStubs.cpp:
1498         * jit/JITStubs.h:
1499
1500 2013-10-16  Julien Brianceau  <jbriance@cisco.com>
1501
1502         Remove more of the UNINTERRUPTED_SEQUENCE thing
1503         https://bugs.webkit.org/show_bug.cgi?id=122885
1504
1505         Reviewed by Andreas Kling.
1506
1507         It was not completely removed by r157481, leading to build failure for sh4 architecture.
1508
1509         * jit/JIT.h:
1510         * jit/JITInlines.h:
1511
1512 2013-10-15  Filip Pizlo  <fpizlo@apple.com>
1513
1514         Get rid of the StructureStubInfo::patch union
1515         https://bugs.webkit.org/show_bug.cgi?id=122877
1516
1517         Reviewed by Sam Weinig.
1518         
1519         Just simplifying code by getting rid of data structures that ain't used no more.
1520         
1521         Note that I replace the patch union with a patch struct. This means we say things like
1522         stubInfo.patch.valueGPR instead of stubInfo.valueGPR. I think that this extra
1523         encapsulation makes the code more readable: the patch struct contains just those things
1524         that you need to know to perform patching.
1525
1526         * bytecode/StructureStubInfo.h:
1527         * dfg/DFGJITCompiler.cpp:
1528         (JSC::DFG::JITCompiler::link):
1529         * jit/JIT.cpp:
1530         (JSC::PropertyStubCompilationInfo::copyToStubInfo):
1531         * jit/Repatch.cpp:
1532         (JSC::repatchByIdSelfAccess):
1533         (JSC::replaceWithJump):
1534         (JSC::linkRestoreScratch):
1535         (JSC::generateProtoChainAccessStub):
1536         (JSC::tryCacheGetByID):
1537         (JSC::getPolymorphicStructureList):
1538         (JSC::patchJumpToGetByIdStub):
1539         (JSC::tryBuildGetByIDList):
1540         (JSC::emitPutReplaceStub):
1541         (JSC::emitPutTransitionStub):
1542         (JSC::tryCachePutByID):
1543         (JSC::tryBuildPutByIdList):
1544         (JSC::tryRepatchIn):
1545         (JSC::resetGetByID):
1546         (JSC::resetPutByID):
1547         (JSC::resetIn):
1548
1549 2013-10-15  Nadav Rotem  <nrotem@apple.com>
1550
1551         FTL: add support for Int52ToValue and fix putByVal of int52s.
1552         https://bugs.webkit.org/show_bug.cgi?id=122873
1553
1554         Reviewed by Filip Pizlo.
1555
1556         * ftl/FTLCapabilities.cpp:
1557         (JSC::FTL::canCompile):
1558         * ftl/FTLLowerDFGToLLVM.cpp:
1559         (JSC::FTL::LowerDFGToLLVM::compileNode):
1560         (JSC::FTL::LowerDFGToLLVM::compileInt52ToValue):
1561         (JSC::FTL::LowerDFGToLLVM::compilePutByVal):
1562
1563 2013-10-15  Filip Pizlo  <fpizlo@apple.com>
1564
1565         Get rid of the UNINTERRUPTED_SEQUENCE thing
1566         https://bugs.webkit.org/show_bug.cgi?id=122876
1567
1568         Reviewed by Mark Hahnenberg.
1569         
1570         It doesn't make sense anymore. We now use the DFG's IC logic, which never needed that.
1571         
1572         Moreover, we should resist the temptation to bring anything like this back. We don't
1573         want to have inline caches that only work if the assembler lays out code in a specific
1574         predetermined way.
1575
1576         * jit/JIT.h:
1577         * jit/JITCall.cpp:
1578         (JSC::JIT::compileOpCall):
1579         * jit/JITCall32_64.cpp:
1580         (JSC::JIT::compileOpCall):
1581
1582 2013-10-15  Filip Pizlo  <fpizlo@apple.com>
1583
1584         Baseline JIT should use the DFG GetById IC
1585         https://bugs.webkit.org/show_bug.cgi?id=122861
1586
1587         Reviewed by Oliver Hunt.
1588         
1589         This mostly just kills a ton of code.
1590         
1591         Note that this doesn't yet do all of the simplifications that can be done, but it does
1592         kill dead code. I'll have another change to simplify StructureStubInfo's unions and such.
1593
1594         * bytecode/CodeBlock.cpp:
1595         (JSC::CodeBlock::resetStubInternal):
1596         * jit/JIT.cpp:
1597         (JSC::PropertyStubCompilationInfo::copyToStubInfo):
1598         * jit/JIT.h:
1599         (JSC::PropertyStubCompilationInfo::PropertyStubCompilationInfo):
1600         * jit/JITInlines.h:
1601         (JSC::JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile):
1602         (JSC::JIT::callOperation):
1603         * jit/JITPropertyAccess.cpp:
1604         (JSC::JIT::compileGetByIdHotPath):
1605         (JSC::JIT::emitSlow_op_get_by_id):
1606         (JSC::JIT::emitSlow_op_get_from_scope):
1607         * jit/JITPropertyAccess32_64.cpp:
1608         (JSC::JIT::compileGetByIdHotPath):
1609         (JSC::JIT::emitSlow_op_get_by_id):
1610         (JSC::JIT::emitSlow_op_get_from_scope):
1611         * jit/JITStubs.cpp:
1612         * jit/JITStubs.h:
1613         * jit/Repatch.cpp:
1614         (JSC::repatchGetByID):
1615         (JSC::buildGetByIDList):
1616         * jit/ThunkGenerators.cpp:
1617         * jit/ThunkGenerators.h:
1618
1619 2013-10-15  Dean Jackson  <dino@apple.com>
1620
1621         Add ENABLE_WEB_ANIMATIONS flag
1622         https://bugs.webkit.org/show_bug.cgi?id=122871
1623
1624         Reviewed by Tim Horton.
1625
1626         Eventually might be http://dev.w3.org/fxtf/web-animations/
1627         but this is just engine-internal work at the moment.
1628
1629         * Configurations/FeatureDefines.xcconfig:
1630
1631 2013-10-15  Julien Brianceau  <jbriance@cisco.com>
1632
1633         [sh4] Some calls don't match sh4 ABI.
1634         https://bugs.webkit.org/show_bug.cgi?id=122863
1635
1636         Reviewed by Michael Saboff.
1637
1638         * dfg/DFGSpeculativeJIT.h:
1639         (JSC::DFG::SpeculativeJIT::callOperation):
1640         * jit/CCallHelpers.h:
1641         (JSC::CCallHelpers::setupArgumentsWithExecState):
1642         * jit/JITInlines.h:
1643         (JSC::JIT::callOperation):
1644
1645 2013-10-15  Daniel Bates  <dabates@apple.com>
1646
1647         [iOS] Upstream JavaScriptCore support for ARM64
1648         https://bugs.webkit.org/show_bug.cgi?id=122762
1649
1650         Reviewed by Oliver Hunt and Filip Pizlo.
1651
1652         * Configurations/Base.xcconfig:
1653         * Configurations/DebugRelease.xcconfig:
1654         * Configurations/JavaScriptCore.xcconfig:
1655         * Configurations/ToolExecutable.xcconfig:
1656         * JavaScriptCore.xcodeproj/project.pbxproj:
1657         * assembler/ARM64Assembler.h: Added.
1658         * assembler/AbstractMacroAssembler.h:
1659         (JSC::isARM64):
1660         (JSC::AbstractMacroAssembler::Label::Label):
1661         (JSC::AbstractMacroAssembler::Jump::Jump):
1662         (JSC::AbstractMacroAssembler::Jump::link):
1663         (JSC::AbstractMacroAssembler::Jump::linkTo):
1664         (JSC::AbstractMacroAssembler::CachedTempRegister::CachedTempRegister):
1665         (JSC::AbstractMacroAssembler::CachedTempRegister::registerIDInvalidate):
1666         (JSC::AbstractMacroAssembler::CachedTempRegister::registerIDNoInvalidate):
1667         (JSC::AbstractMacroAssembler::CachedTempRegister::value):
1668         (JSC::AbstractMacroAssembler::CachedTempRegister::setValue):
1669         (JSC::AbstractMacroAssembler::CachedTempRegister::invalidate):
1670         (JSC::AbstractMacroAssembler::invalidateAllTempRegisters):
1671         (JSC::AbstractMacroAssembler::isTempRegisterValid):
1672         (JSC::AbstractMacroAssembler::clearTempRegisterValid):
1673         (JSC::AbstractMacroAssembler::setTempRegisterValid):
1674         * assembler/LinkBuffer.cpp:
1675         (JSC::LinkBuffer::copyCompactAndLinkCode):
1676         (JSC::LinkBuffer::linkCode):
1677         * assembler/LinkBuffer.h:
1678         * assembler/MacroAssembler.h:
1679         (JSC::MacroAssembler::isPtrAlignedAddressOffset):
1680         (JSC::MacroAssembler::pushToSave):
1681         (JSC::MacroAssembler::popToRestore):
1682         (JSC::MacroAssembler::patchableBranchTest32):
1683         * assembler/MacroAssemblerARM64.h: Added.
1684         * assembler/MacroAssemblerARMv7.h:
1685         * dfg/DFGFixupPhase.cpp:
1686         (JSC::DFG::FixupPhase::fixupNode):
1687         * dfg/DFGOSRExitCompiler32_64.cpp:
1688         (JSC::DFG::OSRExitCompiler::compileExit):
1689         * dfg/DFGOSRExitCompiler64.cpp:
1690         (JSC::DFG::OSRExitCompiler::compileExit):
1691         * dfg/DFGSpeculativeJIT.cpp:
1692         (JSC::DFG::SpeculativeJIT::compileArithDiv):
1693         (JSC::DFG::SpeculativeJIT::compileArithMod):
1694         * disassembler/ARM64/A64DOpcode.cpp: Added.
1695         * disassembler/ARM64/A64DOpcode.h: Added.
1696         * disassembler/ARM64Disassembler.cpp: Added.
1697         * heap/MachineStackMarker.cpp:
1698         (JSC::getPlatformThreadRegisters):
1699         (JSC::otherThreadStackPointer):
1700         * heap/Region.h:
1701         * jit/AssemblyHelpers.h:
1702         (JSC::AssemblyHelpers::debugCall):
1703         * jit/CCallHelpers.h:
1704         * jit/ExecutableAllocator.h:
1705         * jit/FPRInfo.h:
1706         (JSC::FPRInfo::toRegister):
1707         (JSC::FPRInfo::toIndex):
1708         (JSC::FPRInfo::debugName):
1709         * jit/GPRInfo.h:
1710         (JSC::GPRInfo::toRegister):
1711         (JSC::GPRInfo::toIndex):
1712         (JSC::GPRInfo::debugName):
1713         * jit/JITInlines.h:
1714         (JSC::JIT::restoreArgumentReferenceForTrampoline):
1715         * jit/JITOperationWrappers.h:
1716         * jit/JITOperations.cpp:
1717         * jit/JITStubs.cpp:
1718         (JSC::performPlatformSpecificJITAssertions):
1719         (JSC::tryCachePutByID):
1720         * jit/JITStubs.h:
1721         (JSC::JITStackFrame::returnAddressSlot):
1722         * jit/JITStubsARM64.h: Added.
1723         * jit/JSInterfaceJIT.h:
1724         * jit/Repatch.cpp:
1725         (JSC::emitRestoreScratch):
1726         (JSC::generateProtoChainAccessStub):
1727         (JSC::tryCacheGetByID):
1728         (JSC::emitPutReplaceStub):
1729         (JSC::tryCachePutByID):
1730         (JSC::tryRepatchIn):
1731         * jit/ScratchRegisterAllocator.h:
1732         (JSC::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
1733         (JSC::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
1734         * jit/ThunkGenerators.cpp:
1735         (JSC::nativeForGenerator):
1736         (JSC::floorThunkGenerator):
1737         (JSC::ceilThunkGenerator):
1738         * jsc.cpp:
1739         (main):
1740         * llint/LLIntOfflineAsmConfig.h:
1741         * llint/LLIntSlowPaths.cpp:
1742         (JSC::LLInt::handleHostCall):
1743         * llint/LowLevelInterpreter.asm:
1744         * llint/LowLevelInterpreter64.asm:
1745         * offlineasm/arm.rb:
1746         * offlineasm/arm64.rb: Added.
1747         * offlineasm/backends.rb:
1748         * offlineasm/instructions.rb:
1749         * offlineasm/risc.rb:
1750         * offlineasm/transform.rb:
1751         * yarr/YarrJIT.cpp:
1752         (JSC::Yarr::YarrGenerator::alignCallFrameSizeInBytes):
1753         (JSC::Yarr::YarrGenerator::initCallFrame):
1754         (JSC::Yarr::YarrGenerator::removeCallFrame):
1755         (JSC::Yarr::YarrGenerator::generateEnter):
1756         * yarr/YarrJIT.h:
1757
1758 2013-10-15  Mark Lam  <mark.lam@apple.com>
1759
1760         Fix 3 operand sub operation in C loop LLINT.
1761         https://bugs.webkit.org/show_bug.cgi?id=122866.
1762
1763         Reviewed by Geoffrey Garen.
1764
1765         * offlineasm/cloop.rb:
1766
1767 2013-10-15  Mark Hahnenberg  <mhahnenberg@apple.com>
1768
1769         ObjCCallbackFunctionImpl shouldn't store a JSContext
1770         https://bugs.webkit.org/show_bug.cgi?id=122531
1771
1772         Reviewed by Geoffrey Garen.
1773
1774         The m_context field in ObjCCallbackFunctionImpl is vestigial and is only incidentally correct 
1775         in the common case. It's also no longer necessary in that we can look up the current JSContext 
1776         by looking using the globalObject of the callee when the function callback is invoked.
1777  
1778         Also added a new test that would cause us to crash previously. The test required making 
1779         JSContextGetGlobalContext public API so that clients can obtain a JSContext from the JSContextRef
1780         in C API callbacks.
1781
1782         * API/JSContextRef.h:
1783         * API/JSContextRefPrivate.h:
1784         * API/ObjCCallbackFunction.mm:
1785         (JSC::ObjCCallbackFunctionImpl::ObjCCallbackFunctionImpl):
1786         (JSC::objCCallbackFunctionCallAsFunction):
1787         (objCCallbackFunctionForInvocation):
1788         * API/WebKitAvailability.h:
1789         * API/tests/CurrentThisInsideBlockGetterTest.h: Added.
1790         * API/tests/CurrentThisInsideBlockGetterTest.mm: Added.
1791         (CallAsConstructor):
1792         (ConstructorFinalize):
1793         (ConstructorClass):
1794         (+[JSValue valueWithConstructorDescriptor:inContext:]):
1795         (-[JSContext valueWithConstructorDescriptor:]):
1796         (currentThisInsideBlockGetterTest):
1797         * API/tests/testapi.mm:
1798         * JavaScriptCore.xcodeproj/project.pbxproj:
1799         * debugger/Debugger.cpp: Had to add some fully qualified names to avoid conflicts with Mac OS X headers.
1800
1801 2013-10-15  Julien Brianceau  <jbriance@cisco.com>
1802
1803         Fix build after r157457 for architecture with 4 argument registers.
1804         https://bugs.webkit.org/show_bug.cgi?id=122860
1805
1806         Reviewed by Michael Saboff.
1807
1808         * jit/CCallHelpers.h:
1809         (JSC::CCallHelpers::setupStubArguments134):
1810
1811 2013-10-14  Michael Saboff  <msaboff@apple.com>
1812
1813         transition void cti_op_* methods to JIT operations.
1814         https://bugs.webkit.org/show_bug.cgi?id=122617
1815
1816         Reviewed by Geoffrey Garen.
1817
1818         Converted the follow stubs to JIT operations:
1819             cti_handle_watchdog_timer
1820             cti_op_debug
1821             cti_op_pop_scope
1822             cti_op_profile_did_call
1823             cti_op_profile_will_call
1824             cti_op_put_by_index
1825             cti_op_put_getter_setter
1826             cti_op_tear_off_activation
1827             cti_op_tear_off_arguments
1828             cti_op_throw_static_error
1829             cti_optimize
1830
1831         * dfg/DFGOperations.cpp:
1832         * dfg/DFGOperations.h:
1833         * jit/CCallHelpers.h:
1834         (JSC::CCallHelpers::setupArgumentsWithExecState):
1835         (JSC::CCallHelpers::setupThreeStubArgsGPR):
1836         (JSC::CCallHelpers::setupStubArguments):
1837         (JSC::CCallHelpers::setupStubArguments134):
1838         * jit/JIT.cpp:
1839         (JSC::JIT::emitEnterOptimizationCheck):
1840         * jit/JIT.h:
1841         * jit/JITInlines.h:
1842         (JSC::JIT::callOperation):
1843         * jit/JITOpcodes.cpp:
1844         (JSC::JIT::emit_op_tear_off_activation):
1845         (JSC::JIT::emit_op_tear_off_arguments):
1846         (JSC::JIT::emit_op_push_with_scope):
1847         (JSC::JIT::emit_op_pop_scope):
1848         (JSC::JIT::emit_op_push_name_scope):
1849         (JSC::JIT::emit_op_throw_static_error):
1850         (JSC::JIT::emit_op_debug):
1851         (JSC::JIT::emit_op_profile_will_call):
1852         (JSC::JIT::emit_op_profile_did_call):
1853         (JSC::JIT::emitSlow_op_loop_hint):
1854         * jit/JITOpcodes32_64.cpp:
1855         (JSC::JIT::emit_op_push_with_scope):
1856         (JSC::JIT::emit_op_pop_scope):
1857         (JSC::JIT::emit_op_push_name_scope):
1858         (JSC::JIT::emit_op_throw_static_error):
1859         (JSC::JIT::emit_op_debug):
1860         (JSC::JIT::emit_op_profile_will_call):
1861         (JSC::JIT::emit_op_profile_did_call):
1862         * jit/JITOperations.cpp:
1863         * jit/JITOperations.h:
1864         * jit/JITPropertyAccess.cpp:
1865         (JSC::JIT::emit_op_put_by_index):
1866         (JSC::JIT::emit_op_put_getter_setter):
1867         * jit/JITPropertyAccess32_64.cpp:
1868         (JSC::JIT::emit_op_put_by_index):
1869         (JSC::JIT::emit_op_put_getter_setter):
1870         * jit/JITStubs.cpp:
1871         * jit/JITStubs.h:
1872
1873 2013-10-15  Julien Brianceau  <jbriance@cisco.com>
1874
1875         [sh4] Introduce const pools in LLINT.
1876         https://bugs.webkit.org/show_bug.cgi?id=122746
1877
1878         Reviewed by Michael Saboff.
1879
1880         In current implementation of LLINT for sh4, immediate values outside range -128..127 are
1881         loaded this way:
1882
1883             mov.l .label, rx
1884             bra out
1885             nop
1886             .balign 4
1887             .label: .long immvalue
1888             out:
1889
1890         This change introduces const pools for sh4 implementation to avoid lots of useless branches
1891         and reduce code size. It also removes lines of dirty code, like jmpf and callf.
1892
1893         * offlineasm/instructions.rb: Remove jmpf and callf sh4 specific instructions.
1894         * offlineasm/sh4.rb:
1895
1896 2013-10-15  Mark Lam  <mark.lam@apple.com>
1897
1898         Fix broken C Loop LLINT build.
1899         https://bugs.webkit.org/show_bug.cgi?id=122839.
1900
1901         Reviewed by Michael Saboff.
1902
1903         * dfg/DFGFlushedAt.cpp:
1904         * jit/JITOperations.h:
1905
1906 2013-10-14  Mark Lam  <mark.lam@apple.com>
1907
1908         Transition *switch* and *scope* JITStubs to JIT operations.
1909         https://bugs.webkit.org/show_bug.cgi?id=122757.
1910
1911         Reviewed by Geoffrey Garen.
1912
1913         Transitioning:
1914             cti_op_switch_char
1915             cti_op_switch_imm
1916             cti_op_switch_string
1917             cti_op_resolve_scope
1918             cti_op_get_from_scope
1919             cti_op_put_to_scope
1920
1921         * jit/JIT.h:
1922         * jit/JITInlines.h:
1923         (JSC::JIT::callOperation):
1924         * jit/JITOpcodes.cpp:
1925         (JSC::JIT::emit_op_switch_imm):
1926         (JSC::JIT::emit_op_switch_char):
1927         (JSC::JIT::emit_op_switch_string):
1928         * jit/JITOpcodes32_64.cpp:
1929         (JSC::JIT::emit_op_switch_imm):
1930         (JSC::JIT::emit_op_switch_char):
1931         (JSC::JIT::emit_op_switch_string):
1932         * jit/JITOperations.cpp:
1933         * jit/JITOperations.h:
1934         * jit/JITPropertyAccess.cpp:
1935         (JSC::JIT::emitSlow_op_resolve_scope):
1936         (JSC::JIT::emitSlow_op_get_from_scope):
1937         (JSC::JIT::emitSlow_op_put_to_scope):
1938         * jit/JITPropertyAccess32_64.cpp:
1939         (JSC::JIT::emitSlow_op_resolve_scope):
1940         (JSC::JIT::emitSlow_op_get_from_scope):
1941         (JSC::JIT::emitSlow_op_put_to_scope):
1942         * jit/JITStubs.cpp:
1943         * jit/JITStubs.h:
1944
1945 2013-10-14  Filip Pizlo  <fpizlo@apple.com>
1946
1947         DFG PutById IC should use the ConcurrentJITLocker since it's now dealing with IC's that get read by the compiler thread
1948         https://bugs.webkit.org/show_bug.cgi?id=122786
1949
1950         Reviewed by Mark Hahnenberg.
1951
1952         * bytecode/CodeBlock.cpp:
1953         (JSC::CodeBlock::resetStub): Resetting a stub should acquire the lock since this is observable from the thread; but we should only acquire the lock if we're resetting outside of GC.
1954         * jit/Repatch.cpp:
1955         (JSC::repatchPutByID): Doing the PutById patching should hold the lock.
1956         (JSC::buildPutByIdList): Ditto.
1957
1958 2013-10-14  Nadav Rotem  <nrotem@apple.com>
1959
1960         Add FTL support for LogicalNot(string)
1961         https://bugs.webkit.org/show_bug.cgi?id=122765
1962
1963         Reviewed by Filip Pizlo.
1964
1965         This patch is tested by:
1966         regress/script-tests/emscripten-cube2hash.js.ftl-eager
1967
1968         * ftl/FTLCapabilities.cpp:
1969         (JSC::FTL::canCompile):
1970         * ftl/FTLLowerDFGToLLVM.cpp:
1971         (JSC::FTL::LowerDFGToLLVM::compileLogicalNot):
1972
1973 2013-10-14  Julien Brianceau  <jbriance@cisco.com>
1974
1975         [sh4] Fixes after r157404 and r157411.
1976         https://bugs.webkit.org/show_bug.cgi?id=122782
1977
1978         Reviewed by Michael Saboff.
1979
1980         * dfg/DFGSpeculativeJIT.h:
1981         (JSC::DFG::SpeculativeJIT::callOperation): Add missing SH4_32BIT_DUMMY_ARG.
1982         * jit/CCallHelpers.h:
1983         (JSC::CCallHelpers::setupArgumentsWithExecState):
1984         * jit/JITInlines.h:
1985         (JSC::JIT::callOperation): Add missing SH4_32BIT_DUMMY_ARG.
1986         * jit/JITPropertyAccess32_64.cpp:
1987         (JSC::JIT::emit_op_put_by_id): Remove unwanted BEGIN_UNINTERRUPTED_SEQUENCE.
1988
1989 2013-10-14  Commit Queue  <commit-queue@webkit.org>
1990
1991         Unreviewed, rolling out r157413.
1992         http://trac.webkit.org/changeset/157413
1993         https://bugs.webkit.org/show_bug.cgi?id=122779
1994
1995         Appears to have caused frequent crashes (Requested by ap on
1996         #webkit).
1997
1998         * CMakeLists.txt:
1999         * GNUmakefile.list.am:
2000         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2001         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
2002         * JavaScriptCore.xcodeproj/project.pbxproj:
2003         * heap/DeferGC.cpp: Removed.
2004         * heap/DeferGC.h:
2005         * jit/JITStubs.cpp:
2006         (JSC::tryCacheGetByID):
2007         (JSC::DEFINE_STUB_FUNCTION):
2008         * llint/LLIntSlowPaths.cpp:
2009         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2010         * runtime/ConcurrentJITLock.h:
2011         * runtime/InitializeThreading.cpp:
2012         (JSC::initializeThreadingOnce):
2013         * runtime/JSCellInlines.h:
2014         (JSC::allocateCell):
2015         * runtime/Structure.cpp:
2016         (JSC::Structure::materializePropertyMap):
2017         (JSC::Structure::putSpecificValue):
2018         (JSC::Structure::createPropertyMap):
2019         * runtime/Structure.h:
2020
2021 2013-10-14  Mark Hahnenberg  <mhahnenberg@apple.com>
2022
2023         COLLECT_ON_EVERY_ALLOCATION causes assertion failures
2024         https://bugs.webkit.org/show_bug.cgi?id=122652
2025
2026         Reviewed by Filip Pizlo.
2027
2028         COLLECT_ON_EVERY_ALLOCATION wasn't accounting for the new GC deferral mechanism,
2029         so we would end up ASSERTing during garbage collection.
2030
2031         * heap/MarkedAllocator.cpp:
2032         (JSC::MarkedAllocator::allocateSlowCase):
2033
2034 2013-10-11  Oliver Hunt  <oliver@apple.com>
2035
2036         Separate out array iteration intrinsics
2037         https://bugs.webkit.org/show_bug.cgi?id=122656
2038
2039         Reviewed by Michael Saboff.
2040
2041         Separate out the intrinsics for key and values iteration
2042         of arrays.
2043
2044         This requires moving moving array iteration into the iterator
2045         instance, rather than the prototype, but this is essentially
2046         unobservable so we'll live with it for now.
2047
2048         * jit/ThunkGenerators.cpp:
2049         (JSC::arrayIteratorNextThunkGenerator):
2050         (JSC::arrayIteratorNextKeyThunkGenerator):
2051         (JSC::arrayIteratorNextValueThunkGenerator):
2052         * jit/ThunkGenerators.h:
2053         * runtime/ArrayIteratorPrototype.cpp:
2054         (JSC::ArrayIteratorPrototype::finishCreation):
2055         * runtime/Intrinsic.h:
2056         * runtime/JSArrayIterator.cpp:
2057         (JSC::JSArrayIterator::finishCreation):
2058         (JSC::createIteratorResult):
2059         (JSC::arrayIteratorNext):
2060         (JSC::arrayIteratorNextKey):
2061         (JSC::arrayIteratorNextValue):
2062         (JSC::arrayIteratorNextGeneric):
2063         * runtime/VM.cpp:
2064         (JSC::thunkGeneratorForIntrinsic):
2065
2066 2013-10-11  Mark Hahnenberg  <mhahnenberg@apple.com>
2067
2068         llint_slow_path_put_by_id can deadlock on a ConcurrentJITLock
2069         https://bugs.webkit.org/show_bug.cgi?id=122667
2070
2071         Reviewed by Filip Pizlo.
2072
2073         The issue this patch is attempting to fix is that there are places in our codebase
2074         where we acquire the ConcurrentJITLock for a particular CodeBlock, then we do some
2075         operations that can initiate a garbage collection. Garbage collection then calls 
2076         some methods of CodeBlock that also take the ConcurrentJITLock (because they don't
2077         always necessarily run during garbage collection). This causes a deadlock.
2078
2079         To fix this issue, this patch adds a new RAII-style object (DisallowGC) that stores 
2080         into a thread-local field that indicates that it is unsafe to perform any operation 
2081         that could trigger garbage collection on the current thread. In debug builds, 
2082         ConcurrentJITLocker contains one of these DisallowGC objects so that we can eagerly 
2083         detect deadlocks.
2084
2085         This patch also adds a new type of ConcurrentJITLocker, GCSafeConcurrentJITLocker,
2086         which uses the DeferGC mechanism to prevent collections from occurring while the 
2087         lock is held.
2088
2089         * CMakeLists.txt:
2090         * GNUmakefile.list.am:
2091         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2092         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
2093         * JavaScriptCore.xcodeproj/project.pbxproj:
2094         * heap/DeferGC.cpp: Added.
2095         * heap/DeferGC.h:
2096         (JSC::DisallowGC::DisallowGC):
2097         (JSC::DisallowGC::~DisallowGC):
2098         (JSC::DisallowGC::isGCDisallowedOnCurrentThread):
2099         (JSC::DisallowGC::initialize):
2100         * jit/JITStubs.cpp:
2101         (JSC::tryCachePutByID):
2102         (JSC::tryCacheGetByID):
2103         (JSC::DEFINE_STUB_FUNCTION):
2104         * llint/LLIntSlowPaths.cpp:
2105         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2106         * runtime/ConcurrentJITLock.h:
2107         (JSC::ConcurrentJITLockerBase::ConcurrentJITLockerBase):
2108         (JSC::ConcurrentJITLockerBase::~ConcurrentJITLockerBase):
2109         (JSC::ConcurrentJITLockerBase::unlockEarly):
2110         (JSC::GCSafeConcurrentJITLocker::GCSafeConcurrentJITLocker):
2111         (JSC::ConcurrentJITLocker::ConcurrentJITLocker):
2112         * runtime/InitializeThreading.cpp:
2113         (JSC::initializeThreadingOnce):
2114         * runtime/JSCellInlines.h:
2115         (JSC::allocateCell):
2116         * runtime/Structure.cpp:
2117         (JSC::Structure::materializePropertyMap):
2118         (JSC::Structure::putSpecificValue):
2119         (JSC::Structure::createPropertyMap):
2120         * runtime/Structure.h:
2121
2122 2013-10-14  Filip Pizlo  <fpizlo@apple.com>
2123
2124         Baseline JIT should use the DFG's PutById IC
2125         https://bugs.webkit.org/show_bug.cgi?id=122704
2126
2127         Reviewed by Mark Hahnenberg.
2128         
2129         Mostly no big deal, just removing the old Baseline JIT's put_by_id IC support and forcing
2130         that JIT to use the DFG's (i.e. JITOperations) PutById IC.
2131         
2132         The only complicated part was that the PutById operations assumed that we first did a
2133         cell speculation, which the baseline JIT obviously won't do. So I changed all of those
2134         slow paths to deal with EncodedJSValue's.
2135
2136         * bytecode/CodeBlock.cpp:
2137         (JSC::CodeBlock::resetStubInternal):
2138         * bytecode/PutByIdStatus.cpp:
2139         (JSC::PutByIdStatus::computeFor):
2140         * dfg/DFGSpeculativeJIT.h:
2141         (JSC::DFG::SpeculativeJIT::callOperation):
2142         * dfg/DFGSpeculativeJIT32_64.cpp:
2143         (JSC::DFG::SpeculativeJIT::cachedPutById):
2144         * dfg/DFGSpeculativeJIT64.cpp:
2145         (JSC::DFG::SpeculativeJIT::cachedPutById):
2146         * jit/CCallHelpers.h:
2147         (JSC::CCallHelpers::setupArgumentsWithExecState):
2148         * jit/JIT.cpp:
2149         (JSC::PropertyStubCompilationInfo::copyToStubInfo):
2150         * jit/JIT.h:
2151         (JSC::PropertyStubCompilationInfo::PropertyStubCompilationInfo):
2152         (JSC::PropertyStubCompilationInfo::slowCaseInfo):
2153         * jit/JITInlines.h:
2154         (JSC::JIT::callOperation):
2155         * jit/JITOperationWrappers.h:
2156         * jit/JITOperations.cpp:
2157         * jit/JITOperations.h:
2158         * jit/JITPropertyAccess.cpp:
2159         (JSC::JIT::compileGetByIdHotPath):
2160         (JSC::JIT::compileGetByIdSlowCase):
2161         (JSC::JIT::emit_op_put_by_id):
2162         (JSC::JIT::emitSlow_op_put_by_id):
2163         * jit/JITPropertyAccess32_64.cpp:
2164         (JSC::JIT::compileGetByIdSlowCase):
2165         (JSC::JIT::emit_op_put_by_id):
2166         (JSC::JIT::emitSlow_op_put_by_id):
2167         * jit/JITStubs.cpp:
2168         * jit/JITStubs.h:
2169         * jit/Repatch.cpp:
2170         (JSC::appropriateGenericPutByIdFunction):
2171         (JSC::appropriateListBuildingPutByIdFunction):
2172         (JSC::resetPutByID):
2173
2174 2013-10-13  Filip Pizlo  <fpizlo@apple.com>
2175
2176         FTL should have an inefficient but correct implementation of GetById
2177         https://bugs.webkit.org/show_bug.cgi?id=122740
2178
2179         Reviewed by Mark Hahnenberg.
2180         
2181         It took some effort to realize that the node->prediction() check in the DFG backends
2182         are completely unnecessary since the ByteCodeParser will always insert a ForceOSRExit
2183         if !prediction.
2184         
2185         But other than that this was an easy patch.
2186
2187         * dfg/DFGByteCodeParser.cpp:
2188         (JSC::DFG::ByteCodeParser::handleGetById):
2189         * dfg/DFGSpeculativeJIT32_64.cpp:
2190         (JSC::DFG::SpeculativeJIT::compile):
2191         * dfg/DFGSpeculativeJIT64.cpp:
2192         (JSC::DFG::SpeculativeJIT::compile):
2193         * ftl/FTLCapabilities.cpp:
2194         (JSC::FTL::canCompile):
2195         * ftl/FTLIntrinsicRepository.h:
2196         * ftl/FTLLowerDFGToLLVM.cpp:
2197         (JSC::FTL::LowerDFGToLLVM::compileNode):
2198         (JSC::FTL::LowerDFGToLLVM::compileGetById):
2199
2200 2013-10-13  Mark Lam  <mark.lam@apple.com>
2201
2202         Transition misc cti_op_* JITStubs to JIT operations.
2203         https://bugs.webkit.org/show_bug.cgi?id=122645.
2204
2205         Reviewed by Michael Saboff.
2206
2207         Stubs converted:
2208             cti_op_check_has_instance
2209             cti_op_create_arguments
2210             cti_op_del_by_id
2211             cti_op_instanceof
2212             cti_to_object
2213             cti_op_push_activation
2214             cti_op_get_pnames
2215             cti_op_load_varargs
2216
2217         * dfg/DFGOperations.cpp:
2218         * dfg/DFGOperations.h:
2219         * jit/CCallHelpers.h:
2220         (JSC::CCallHelpers::setupArgumentsWithExecState):
2221         * jit/JIT.h:
2222         (JSC::JIT::emitStoreCell):
2223         * jit/JITCall.cpp:
2224         (JSC::JIT::compileLoadVarargs):
2225         * jit/JITCall32_64.cpp:
2226         (JSC::JIT::compileLoadVarargs):
2227         * jit/JITInlines.h:
2228         (JSC::JIT::callOperation):
2229         * jit/JITOpcodes.cpp:
2230         (JSC::JIT::emit_op_get_pnames):
2231         (JSC::JIT::emit_op_create_activation):
2232         (JSC::JIT::emit_op_create_arguments):
2233         (JSC::JIT::emitSlow_op_check_has_instance):
2234         (JSC::JIT::emitSlow_op_instanceof):
2235         (JSC::JIT::emitSlow_op_get_argument_by_val):
2236         * jit/JITOpcodes32_64.cpp:
2237         (JSC::JIT::emitSlow_op_check_has_instance):
2238         (JSC::JIT::emitSlow_op_instanceof):
2239         (JSC::JIT::emit_op_get_pnames):
2240         (JSC::JIT::emit_op_create_activation):
2241         (JSC::JIT::emit_op_create_arguments):
2242         (JSC::JIT::emitSlow_op_get_argument_by_val):
2243         * jit/JITOperations.cpp:
2244         * jit/JITOperations.h:
2245         * jit/JITPropertyAccess.cpp:
2246         (JSC::JIT::emit_op_del_by_id):
2247         * jit/JITPropertyAccess32_64.cpp:
2248         (JSC::JIT::emit_op_del_by_id):
2249         * jit/JITStubs.cpp:
2250         * jit/JITStubs.h:
2251
2252 2013-10-13  Filip Pizlo  <fpizlo@apple.com>
2253
2254         FTL OSR exit should perform zero extension on values smaller than 64-bit
2255         https://bugs.webkit.org/show_bug.cgi?id=122688
2256
2257         Reviewed by Gavin Barraclough.
2258         
2259         In the DFG we usually make the simplistic assumption that a 32-bit value in a 64-bit
2260         register will have zeros on the high bits.  In the few cases where the high bits are
2261         non-zero, the DFG sort of tells us this explicitly.
2262
2263         But when working with llvm.webkit.stackmap, it doesn't work that way.  Consider we might
2264         emit LLVM IR like:
2265
2266             %2 = trunc i64 %1 to i32
2267             stuff %2
2268             call @llvm.webkit.stackmap(...., %2)
2269
2270         LLVM may never actually emit a truncation instruction of any kind.  And that's great - in
2271         many cases it won't be needed, like if 'stuff %2' is a 32-bit op that ignores the high
2272         bits anyway.  Hence LLVM may tell us that %2 is in the register that still had the value
2273         from before truncation, and that register may have garbage in the high bits.
2274
2275         This means that on our end, if we want a 32-bit value and we want that value to be
2276         zero-extended, we should zero-extend it ourselves.  This is pretty easy and should be
2277         cheap, so we should just do it and not make it a requirement that LLVM does it on its
2278         end.
2279         
2280         This makes all tests pass with JSC_ftlOSRExitUsesStackmap=true.
2281
2282         * ftl/FTLOSRExitCompiler.cpp:
2283         (JSC::FTL::compileStubWithOSRExitStackmap):
2284         * ftl/FTLValueFormat.cpp:
2285         (JSC::FTL::reboxAccordingToFormat):
2286
2287 == Rolled over to ChangeLog-2013-10-13 ==