ChangeLog 332 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
2013-12-02  László Langó  <lango@inf.u-szeged.hu>

        Unused include files when building without JIT.
        https://bugs.webkit.org/show_bug.cgi?id=125062

        Reviewed by Michael Saboff.

        We should organize the includes, and guard JIT methods
        in ValueRecovery.

        * bytecode/ValueRecovery.cpp: Guard include files.
        * bytecode/ValueRecovery.h: Guard JIT methods.

14
15
16
17
18
19
20
21
22
23
24
2013-12-02  Balazs Kilvady  <kilvadyb@homejinni.com>

        [MIPS] Small stack frame causes regressions.
        https://bugs.webkit.org/show_bug.cgi?id=124945

        Reviewed by Michael Saboff.

        Fix stack space for LLInt on MIPS.

        * llint/LowLevelInterpreter32_64.asm:

25
26
27
28
29
30
31
32
33
34
35
36
37
38
2013-12-02  Brian J. Burg  <burg@cs.washington.edu>

        jsc: implement a native readFile function
        https://bugs.webkit.org/show_bug.cgi?id=125059

        Reviewed by Filip Pizlo.

        This adds a native readFile() function to jsc, used to slurp
        an entire file into a JavaScript string.

        * jsc.cpp:
        (GlobalObject::finishCreation): Add readFile() to globals.
        (functionReadFile): Added.

39
40
41
42
43
44
45
46
47
2013-12-02  László Langó  <lango@inf.u-szeged.hu>

        JSC does not build if OPCODE_STATS is enabled.
        https://bugs.webkit.org/show_bug.cgi?id=125011

        Reviewed by Filip Pizlo.

        * bytecode/Opcode.cpp:

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
2013-11-29  Filip Pizlo  <fpizlo@apple.com>

        Finally remove those DFG_ENABLE things
        https://bugs.webkit.org/show_bug.cgi?id=125025

        Rubber stamped by Sam Weinig.
        
        This removes a bunch of unused and untested insanity.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::tallyFrequentExitSites):
        * dfg/DFGArgumentsSimplificationPhase.cpp:
        (JSC::DFG::ArgumentsSimplificationPhase::run):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation):
        (JSC::DFG::ByteCodeParser::getArrayModeConsideringSlowPath):
        (JSC::DFG::ByteCodeParser::makeSafe):
        (JSC::DFG::ByteCodeParser::makeDivSafe):
        (JSC::DFG::ByteCodeParser::handleCall):
        (JSC::DFG::ByteCodeParser::handleInlining):
        (JSC::DFG::ByteCodeParser::parseBlock):
        (JSC::DFG::ByteCodeParser::linkBlock):
        (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
        (JSC::DFG::ByteCodeParser::parseCodeBlock):
        (JSC::DFG::ByteCodeParser::parse):
        (JSC::DFG::parse):
        * dfg/DFGCFGSimplificationPhase.cpp:
        (JSC::DFG::CFGSimplificationPhase::run):
        (JSC::DFG::CFGSimplificationPhase::convertToJump):
        (JSC::DFG::CFGSimplificationPhase::fixJettisonedPredecessors):
        * dfg/DFGCSEPhase.cpp:
        (JSC::DFG::CSEPhase::endIndexForPureCSE):
        (JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren):
        (JSC::DFG::CSEPhase::setReplacement):
        (JSC::DFG::CSEPhase::eliminate):
        (JSC::DFG::CSEPhase::performNodeCSE):
        * dfg/DFGCommon.h:
        (JSC::DFG::verboseCompilationEnabled):
        (JSC::DFG::logCompilationChanges):
        (JSC::DFG::shouldDumpGraphAtEachPhase):
        * dfg/DFGConstantFoldingPhase.cpp:
        (JSC::DFG::ConstantFoldingPhase::foldConstants):
        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        (JSC::DFG::FixupPhase::injectInt32ToDoubleNode):
        * dfg/DFGInPlaceAbstractState.cpp:
        (JSC::DFG::InPlaceAbstractState::initialize):
        (JSC::DFG::InPlaceAbstractState::endBasicBlock):
        (JSC::DFG::InPlaceAbstractState::mergeStateAtTail):
        (JSC::DFG::InPlaceAbstractState::mergeToSuccessors):
        * dfg/DFGJITCompiler.cpp:
        (JSC::DFG::JITCompiler::compileBody):
        (JSC::DFG::JITCompiler::link):
        * dfg/DFGOSRExitCompiler.cpp:
        * dfg/DFGOSRExitCompiler32_64.cpp:
        (JSC::DFG::OSRExitCompiler::compileExit):
        * dfg/DFGOSRExitCompiler64.cpp:
        (JSC::DFG::OSRExitCompiler::compileExit):
        * dfg/DFGOSRExitCompilerCommon.cpp:
        (JSC::DFG::adjustAndJumpToTarget):
        * dfg/DFGPredictionInjectionPhase.cpp:
        (JSC::DFG::PredictionInjectionPhase::run):
        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::PredictionPropagationPhase::run):
        (JSC::DFG::PredictionPropagationPhase::propagate):
        (JSC::DFG::PredictionPropagationPhase::propagateForward):
        (JSC::DFG::PredictionPropagationPhase::propagateBackward):
        (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
        * dfg/DFGScoreBoard.h:
        (JSC::DFG::ScoreBoard::use):
        * dfg/DFGSlowPathGenerator.h:
        (JSC::DFG::SlowPathGenerator::generate):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
        (JSC::DFG::SpeculativeJIT::runSlowPathGenerators):
        (JSC::DFG::SpeculativeJIT::dump):
        (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
        (JSC::DFG::SpeculativeJIT::checkGeneratedTypeForToInt32):
        * dfg/DFGSpeculativeJIT.h:
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
        (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
        (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
        (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
        (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
        (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
        (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGVariableEventStream.cpp:
        (JSC::DFG::VariableEventStream::reconstruct):
        * dfg/DFGVariableEventStream.h:
        (JSC::DFG::VariableEventStream::appendAndLog):
        * dfg/DFGVirtualRegisterAllocationPhase.cpp:
        (JSC::DFG::VirtualRegisterAllocationPhase::run):
        * jit/JIT.cpp:
        (JSC::JIT::privateCompile):

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
2013-11-29  Filip Pizlo  <fpizlo@apple.com>

        FTL IC should nop-fill to make up the difference between the actual IC size and the requested patchpoint size
        https://bugs.webkit.org/show_bug.cgi?id=124960

        Reviewed by Sam Weinig.

        * assembler/LinkBuffer.h:
        (JSC::LinkBuffer::size):
        * assembler/X86Assembler.h:
        (JSC::X86Assembler::fillNops):
        * dfg/DFGDisassembler.cpp:
        (JSC::DFG::Disassembler::dumpHeader):
        * ftl/FTLCompile.cpp:
        (JSC::FTL::generateICFastPath):
        * jit/JITDisassembler.cpp:
        (JSC::JITDisassembler::dumpHeader):

166
167
168
169
170
171
172
173
174
175
176
177
178
179
2013-11-29  Julien Brianceau  <jbriance@cisco.com>

        Use moveDoubleToInts in SpecializedThunkJIT::returnDouble for non-X86 JSVALUE32_64 ports.
        https://bugs.webkit.org/show_bug.cgi?id=124936

        Reviewed by Zoltan Herczeg.

        The moveDoubleToInts implementations in ARM, MIPS and SH4 macro assemblers do not clobber
        src FPRegister and are likely to be more efficient than the current generic implementation
        using the stack.

        * jit/SpecializedThunkJIT.h:
        (JSC::SpecializedThunkJIT::returnDouble):

180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
2013-11-29  Julien Brianceau  <jbriance@cisco.com>

        Merge arm and sh4 paths in nativeForGenerator and privateCompileCTINativeCall functions.
        https://bugs.webkit.org/show_bug.cgi?id=124892

        Reviewed by Zoltan Herczeg.

        * assembler/MacroAssemblerSH4.h:
        (JSC::MacroAssemblerSH4::call): Pick a scratch register instead of getting it as a
        parameter. The sh4 port was the only one to have this call(Address, RegisterID) prototype.
        * jit/JITOpcodes32_64.cpp:
        (JSC::JIT::privateCompileCTINativeCall): Use argumentGPRx and merge arm and sh4 paths.
        * jit/ThunkGenerators.cpp:
        (JSC::nativeForGenerator): Use argumentGPRx and merge arm and sh4 paths.

195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
2013-11-28  Nadav Rotem  <nrotem@apple.com>

        Revert the X86 assembler peephole changes
        https://bugs.webkit.org/show_bug.cgi?id=124988

        Reviewed by Csaba Osztrogonác.

        * assembler/MacroAssemblerX86.h:
        (JSC::MacroAssemblerX86::add32):
        (JSC::MacroAssemblerX86::add64):
        (JSC::MacroAssemblerX86::or32):
        * assembler/MacroAssemblerX86Common.h:
        (JSC::MacroAssemblerX86Common::add32):
        (JSC::MacroAssemblerX86Common::or32):
        (JSC::MacroAssemblerX86Common::branchAdd32):
        * assembler/MacroAssemblerX86_64.h:
        (JSC::MacroAssemblerX86_64::add32):
        (JSC::MacroAssemblerX86_64::or32):
        (JSC::MacroAssemblerX86_64::add64):
        (JSC::MacroAssemblerX86_64::or64):
        (JSC::MacroAssemblerX86_64::xor64):

217
218
219
220
221
222
223
224
225
2013-11-28  Antti Koivisto  <antti@apple.com>

        Remove feature: CSS variables
        https://bugs.webkit.org/show_bug.cgi?id=114119

        Reviewed by Andreas Kling.

        * Configurations/FeatureDefines.xcconfig:

226
227
228
229
230
231
232
233
234
2013-11-28  Peter Gal  <galpeter@inf.u-szeged.hu>

        Typo fix after r159834 to fix 32 bit builds.

        Reviewed by Csaba Osztrogonác.

        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
2013-11-27  Nadav Rotem  <nrotem@apple.com>

        Add a bunch of early exits and local optimizations to the x86 assembler.
        https://bugs.webkit.org/show_bug.cgi?id=124904

        Reviewed by Filip Pizlo.

        * assembler/MacroAssemblerX86.h:
        (JSC::MacroAssemblerX86::add32):
        (JSC::MacroAssemblerX86::add64):
        (JSC::MacroAssemblerX86::or32):
        * assembler/MacroAssemblerX86Common.h:
        (JSC::MacroAssemblerX86Common::add32):
        (JSC::MacroAssemblerX86Common::or32):
        * assembler/MacroAssemblerX86_64.h:
        (JSC::MacroAssemblerX86_64::add32):
        (JSC::MacroAssemblerX86_64::or32):
        (JSC::MacroAssemblerX86_64::add64):
        (JSC::MacroAssemblerX86_64::or64):
        (JSC::MacroAssemblerX86_64::xor64):

fpizlo@apple.com's avatar
fpizlo@apple.com committed
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
2013-11-27  Filip Pizlo  <fpizlo@apple.com>

        Infer one-time scopes
        https://bugs.webkit.org/show_bug.cgi?id=124812

        Reviewed by Oliver Hunt.
        
        This detects JSActivations that are created only once. The JSActivation pointer is then
        baked into the machine code.
        
        This takes advantage of the one-time scope inference to reduce the number of
        indirections needed to get to a closure variable in case where the scope is only
        allocated once. This isn't really a speed-up since in the common case the total number
        of instruction bytes needed to load the scope from the stack is about equal to the
        number of instruction bytes needed to materialize the absolute address of a scoped
        variable. But, this is a necessary prerequisite to
        https://bugs.webkit.org/show_bug.cgi?id=124630, so it's probably a good idea anyway.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::dumpBytecode):
        (JSC::CodeBlock::CodeBlock):
        (JSC::CodeBlock::finalizeUnconditionally):
        * bytecode/Instruction.h:
        * bytecode/Opcode.h:
        (JSC::padOpcodeName):
        * bytecode/Watchpoint.h:
        (JSC::WatchpointSet::notifyWrite):
        (JSC::InlineWatchpointSet::notifyWrite):
        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::BytecodeGenerator::emitResolveScope):
        * dfg/DFGAbstractInterpreterInlines.h:
        (JSC::DFG::::executeEffects):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGCSEPhase.cpp:
        (JSC::DFG::CSEPhase::scopedVarLoadElimination):
        (JSC::DFG::CSEPhase::scopedVarStoreElimination):
        (JSC::DFG::CSEPhase::getLocalLoadElimination):
        (JSC::DFG::CSEPhase::setLocalStoreElimination):
        * dfg/DFGClobberize.h:
        (JSC::DFG::clobberize):
        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        * dfg/DFGGraph.cpp:
        (JSC::DFG::Graph::tryGetRegisters):
        * dfg/DFGGraph.h:
        * dfg/DFGNode.h:
        (JSC::DFG::Node::varNumber):
        (JSC::DFG::Node::hasSymbolTable):
        (JSC::DFG::Node::symbolTable):
        * dfg/DFGNodeType.h:
        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::PredictionPropagationPhase::propagate):
        * dfg/DFGSafeToExecute.h:
        (JSC::DFG::safeToExecute):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGWatchpointCollectionPhase.cpp:
        (JSC::DFG::WatchpointCollectionPhase::handle):
        * ftl/FTLCapabilities.cpp:
        (JSC::FTL::canCompile):
        * ftl/FTLLowerDFGToLLVM.cpp:
        (JSC::FTL::LowerDFGToLLVM::compileNode):
        (JSC::FTL::LowerDFGToLLVM::compileGetClosureRegisters):
        * llint/LowLevelInterpreter32_64.asm:
        * llint/LowLevelInterpreter64.asm:
        * runtime/JSActivation.h:
        (JSC::JSActivation::create):
        * runtime/JSScope.cpp:
        (JSC::abstractAccess):
        (JSC::JSScope::abstractResolve):
        * runtime/JSScope.h:
        (JSC::ResolveOp::ResolveOp):
        * runtime/JSVariableObject.h:
        (JSC::JSVariableObject::registers):
        * runtime/SymbolTable.cpp:
        (JSC::SymbolTable::SymbolTable):
        * runtime/SymbolTable.h:

337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
2013-11-27  Filip Pizlo  <fpizlo@apple.com>

        Finally fix some obvious Bartlett bugs
        https://bugs.webkit.org/show_bug.cgi?id=124951

        Reviewed by Mark Hahnenberg.
        
        Sanitize the stack (i.e. zero parts of it known to be dead) at three key points:
        
        - GC.
        
        - At beginning of OSR entry.
        
        - Just as we finish preparing OSR entry. This clears those slots on the stack that
          could have been live in baseline but that are known to be dead in DFG.
        
        This is as much as a 2x speed-up on splay if you run it in certain modes, and run it
        for a long enough interval. It appears to fix all instances of the dreaded exponential
        heap growth that splay gets into when some stale pointer stays around.
        
        This doesn't have much of an effect on real-world programs. This bug has only ever
        manifested in splay and for that reason we thus far opted against fixing it. But splay
        is, for what it's worth, the premiere GC stress test in JavaScript - so making sure we
        can run it without pathologies - even when you tweak its configuration - is probably
        fairly important.

        * dfg/DFGJITCompiler.h:
        (JSC::DFG::JITCompiler::noticeOSREntry):
        * dfg/DFGOSREntry.cpp:
        (JSC::DFG::prepareOSREntry):
        * dfg/DFGOSREntry.h:
        * heap/Heap.cpp:
        (JSC::Heap::markRoots):
        * interpreter/JSStack.cpp:
        (JSC::JSStack::JSStack):
        (JSC::JSStack::sanitizeStack):
        * interpreter/JSStack.h:

375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
2013-11-26  Filip Pizlo  <fpizlo@apple.com>

        Do bytecode validation as part of testing
        https://bugs.webkit.org/show_bug.cgi?id=124913

        Reviewed by Oliver Hunt.
        
        Also fix some small bugs in the bytecode liveness analysis that I found by doing
        this validation thingy.

        * bytecode/BytecodeLivenessAnalysis.cpp:
        (JSC::isValidRegisterForLiveness):
        (JSC::BytecodeLivenessAnalysis::runLivenessFixpoint):
        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::validate):
        (JSC::CodeBlock::beginValidationDidFail):
        (JSC::CodeBlock::endValidationDidFail):
        * bytecode/CodeBlock.h:
        * runtime/Executable.cpp:
        (JSC::ScriptExecutable::prepareForExecutionImpl):
        * runtime/Options.h:

397
398
399
400
401
402
403
404
405
406
2013-11-27  Andreas Kling  <akling@apple.com>

        Structure::m_staticFunctionReified should be a single bit.
        <https://webkit.org/b/124912>

        Shave 8 bytes off of JSC::Structure by jamming m_staticFunctionReified
        into the bitfield just above.

        Reviewed by Antti Koivisto.

407
408
409
410
411
412
413
414
415
2013-11-27  Andreas Kling  <akling@apple.com>

        JSActivation constructor should use NotNull placement new.
        <https://webkit.org/b/124909>

        Knock a null check outta the storage initialization loop.

        Reviewed by Antti Koivisto.

416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
2013-11-26  Filip Pizlo  <fpizlo@apple.com>

        Restructure global variable constant inference so that it could work for any kind of symbol table variable
        https://bugs.webkit.org/show_bug.cgi?id=124760

        Reviewed by Oliver Hunt.
        
        This changes the way global variable constant inference works so that it can be reused
        for closure variable constant inference. Some of the premises that originally motivated
        this patch are somewhat wrong, but it led to some simplifications anyway and I suspect
        that we'll be able to fix those premises in the future. The main point of this patch is
        to make it easy to reuse global variable constant inference for closure variable
        constant inference, and this will be possible provided we can also either (a) infer
        one-shot closures (easy) or (b) infer closure variables that are always assigned prior
        to first use.
        
        One of the things that this patch is meant to enable is constant inference for closure
        variables that may be part of a multi-shot closure. Closure variables may be
        instantiated multiple times, like:
        
            function foo() {
                var WIDTH = 45;
                function bar() {
                    ... use WIDTH ...
                }
                ...
            }
        
        Even if foo() is called many times and WIDTH is assigned to multiple times, that
        doesn't change the fact that it's a constant. The goal of closure variable constant
        inference is to catch any case where a closure variable has been assigned at least once
        and its value has never changed. This patch doesn't implement that, but it does change
        global variable constant inference to have most of the powers needed to do that. Note
        that most likely we will use this functionality only to implement constant inference
        for one-shot closures, but the resulting machinery is still simpler than what we had
        before.
        
        This involves three changes:
        
            - The watchpoint object now contains the inferred value. This involves creating a
              new kind of watchpoint set, the VariableWatchpointSet. We will reuse this object
              for closure variables.
        
            - Writing to a variable that is watchpointed still involves these three states that
              we proceed through monotonically (Uninitialized->Initialized->Invalidated) but
              now, the Initialized->Invalidated state transition only happens if we change the
              variable's value, rather than store to the variable. Repeatedly storing the same
              value won't change the variable's state.
        
            - On 64-bit systems (the only systems on which we do concurrent JIT), you no longer
              need fancy fencing to get a consistent view of the watchpoint in the JIT. The
              state of the VariableWatchpointSet for the purposes of constant folding is
              entirely encapsulated in the VariableWatchpointSet::m_inferredValue. If that is
              JSValue() then you cannot fold (either because the set is uninitialized or
              because it's invalidated - doesn't matter which); on the other hand if the value
              is anything other than JSValue() then you can fold, and that's the value you fold
              to. Simple!
        
        This also changes the way that DFG IR deals with variable watchpoints. It's now
        oblivious to global variables. You install a watchpoint using VariableWatchpoint and
        you notify write using NotifyWrite. Easy!
        
        Note that this will requires some more tweaks because of the fact that op_enter will
        store Undefined into every captured variable. Hence it won't even work for one-shot
        closures. One-shot closures are easily fixed by introducing another state (so we'll
        have Uninitialized->Undefined->Initialized->Invalidated). Multi-shot closures will
        require static analysis. One-shot closures are clearly a higher priority.

        * GNUmakefile.list.am:
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bytecode/Instruction.h:
        * bytecode/VariableWatchpointSet.h: Added.
        (JSC::VariableWatchpointSet::VariableWatchpointSet):
        (JSC::VariableWatchpointSet::~VariableWatchpointSet):
        (JSC::VariableWatchpointSet::inferredValue):
        (JSC::VariableWatchpointSet::notifyWrite):
        (JSC::VariableWatchpointSet::invalidate):
        (JSC::VariableWatchpointSet::finalizeUnconditionally):
        (JSC::VariableWatchpointSet::addressOfInferredValue):
        * bytecode/Watchpoint.h:
        * dfg/DFGAbstractInterpreterInlines.h:
        (JSC::DFG::::executeEffects):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGCSEPhase.cpp:
        (JSC::DFG::CSEPhase::performNodeCSE):
        * dfg/DFGClobberize.h:
        (JSC::DFG::clobberize):
        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        * dfg/DFGNode.h:
        (JSC::DFG::Node::hasRegisterPointer):
        (JSC::DFG::Node::hasVariableWatchpointSet):
        (JSC::DFG::Node::variableWatchpointSet):
        * dfg/DFGNodeType.h:
        * dfg/DFGOperations.cpp:
        * dfg/DFGOperations.h:
        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::PredictionPropagationPhase::propagate):
        * dfg/DFGSafeToExecute.h:
        (JSC::DFG::safeToExecute):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileArithMod):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::callOperation):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGWatchpointCollectionPhase.cpp:
        (JSC::DFG::WatchpointCollectionPhase::handle):
        * ftl/FTLCapabilities.cpp:
        (JSC::FTL::canCompile):
        * ftl/FTLLowerDFGToLLVM.cpp:
        (JSC::FTL::LowerDFGToLLVM::compileNode):
        (JSC::FTL::LowerDFGToLLVM::compileNotifyWrite):
        * jit/JIT.h:
        * jit/JITOperations.h:
        * jit/JITPropertyAccess.cpp:
        (JSC::JIT::emitNotifyWrite):
        (JSC::JIT::emitPutGlobalVar):
        * jit/JITPropertyAccess32_64.cpp:
        (JSC::JIT::emitNotifyWrite):
        (JSC::JIT::emitPutGlobalVar):
        * llint/LowLevelInterpreter32_64.asm:
        * llint/LowLevelInterpreter64.asm:
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::addGlobalVar):
        (JSC::JSGlobalObject::addFunction):
        * runtime/JSGlobalObject.h:
        * runtime/JSScope.h:
        (JSC::ResolveOp::ResolveOp):
        * runtime/JSSymbolTableObject.h:
        (JSC::symbolTablePut):
        (JSC::symbolTablePutWithAttributes):
        * runtime/SymbolTable.cpp:
        (JSC::SymbolTableEntry::inferredValue):
        (JSC::SymbolTableEntry::prepareToWatch):
        (JSC::SymbolTableEntry::addWatchpoint):
        (JSC::SymbolTableEntry::notifyWriteSlow):
        (JSC::SymbolTable::visitChildren):
        (JSC::SymbolTable::WatchpointCleanup::WatchpointCleanup):
        (JSC::SymbolTable::WatchpointCleanup::~WatchpointCleanup):
        (JSC::SymbolTable::WatchpointCleanup::finalizeUnconditionally):
        * runtime/SymbolTable.h:
        (JSC::SymbolTableEntry::watchpointSet):
        (JSC::SymbolTableEntry::notifyWrite):

565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
2013-11-24  Filip Pizlo  <fpizlo@apple.com>

        Create a new SymbolTable every time code is loaded so that the watchpoints don't get reused
        https://bugs.webkit.org/show_bug.cgi?id=124824

        Reviewed by Oliver Hunt.
        
        This helps with one shot closure inference as well as closure variable constant
        inference, since without this, if code was reloaded from the cache then we would
        think that the first run was actually an Nth run. This would cause us to think that
        the watchpoint(s) should all be invalidated.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::CodeBlock):
        (JSC::CodeBlock::stronglyVisitStrongReferences):
        * bytecode/CodeBlock.h:
        (JSC::CodeBlock::symbolTable):
        * runtime/Executable.cpp:
        (JSC::FunctionExecutable::symbolTable):
        * runtime/Executable.h:
        * runtime/SymbolTable.cpp:
        (JSC::SymbolTable::clone):
        * runtime/SymbolTable.h:

589
590
591
592
593
594
595
596
597
598
599
600
601
602
2013-11-26  Oliver Hunt  <oliver@apple.com>

        Crash in JSC::ASTBuilder::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseUnaryExpression<JSC::ASTBuilder>(JSC::ASTBuilder&)
        https://bugs.webkit.org/show_bug.cgi?id=124886

        Reviewed by Sam Weinig.

        Make sure the error macros propagate an existing error before
        trying to create a new error message.  We need to do this as
        the parser state may not be safe for any specific error message
        if we are already unwinding due to an error.

        * parser/Parser.cpp:

603
604
605
606
607
608
609
610
611
612
2013-11-26  Nadav Rotem  <nrotem@apple.com>

        Optimize away OR with zero - a common ASM.js pattern.
        https://bugs.webkit.org/show_bug.cgi?id=124869

        Reviewed by Filip Pizlo.

        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):

613
614
615
616
617
618
619
620
621
622
623
624
625
626
2013-11-25  Julien Brianceau  <jbriance@cisco.com>

        [arm][mips] Fix crash in dfg-arrayify-elimination layout jsc test.
        https://bugs.webkit.org/show_bug.cgi?id=124839

        Reviewed by Michael Saboff.

        In ARM EABI and MIPS, 64-bit values have to be aligned on stack too.

        * jit/CCallHelpers.h:
        (JSC::CCallHelpers::setupArgumentsWithExecState):
        * jit/JITInlines.h:
        (JSC::JIT::callOperation): Add missing EABI_32BIT_DUMMY_ARG.

627
628
629
630
631
632
633
634
635
636
2013-11-23  Filip Pizlo  <fpizlo@apple.com>

        Fix more fallout from failed attempts at div/mod DFG strength reductions
        https://bugs.webkit.org/show_bug.cgi?id=124813

        Reviewed by Geoffrey Garen.

        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileArithMod):

637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
2013-11-22  Mark Hahnenberg  <mhahnenberg@apple.com>

        JSC Obj-C API should have real documentation
        https://bugs.webkit.org/show_bug.cgi?id=124805

        Reviewed by Geoffrey Garen.

        Massaging the header comments into proper headerdocs.

        * API/JSContext.h:
        * API/JSExport.h:
        * API/JSManagedValue.h:
        * API/JSValue.h:
        * API/JSVirtualMachine.h:

652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
2013-11-22  Filip Pizlo  <fpizlo@apple.com>

        CodeBlock::m_numCalleeRegisters shouldn't also mean frame size, frame size needed for exit, or any other unrelated things
        https://bugs.webkit.org/show_bug.cgi?id=124793

        Reviewed by Mark Hahnenberg.
        
        Now m_numCalleeRegisters always refers to the number of locals that the attached
        bytecode uses. It never means anything else.
        
        For frame size, we now have it lazily computed from m_numCalleeRegisters for the
        baseline engines and we have it stored in DFG::CommonData for the optimizing JITs.
        
        For frame-size-needed-at-exit, we store that in DFG::CommonData, too.
        
        The code no longer implies that there is any arithmetic relationship between
        m_numCalleeRegisters and frameSize. Previously it implied that the latter is greater
        than the former.
        
        The code no longer implies that there is any arithmetic relationship between the
        frame Size and the frame-size-needed-at-exit. Previously it implied that the latter
        is greater that the former.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::frameRegisterCount):
        * bytecode/CodeBlock.h:
        * dfg/DFGCommonData.h:
        (JSC::DFG::CommonData::CommonData):
        (JSC::DFG::CommonData::requiredRegisterCountForExecutionAndExit):
        * dfg/DFGGraph.cpp:
        (JSC::DFG::Graph::frameRegisterCount):
        (JSC::DFG::Graph::requiredRegisterCountForExit):
        (JSC::DFG::Graph::requiredRegisterCountForExecutionAndExit):
        * dfg/DFGGraph.h:
        * dfg/DFGJITCompiler.cpp:
        (JSC::DFG::JITCompiler::link):
        (JSC::DFG::JITCompiler::compileFunction):
        * dfg/DFGOSREntry.cpp:
        (JSC::DFG::prepareOSREntry):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
        * dfg/DFGVirtualRegisterAllocationPhase.cpp:
        (JSC::DFG::VirtualRegisterAllocationPhase::run):
        * ftl/FTLLink.cpp:
        (JSC::FTL::link):
        * ftl/FTLLowerDFGToLLVM.cpp:
        (JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
        * ftl/FTLOSREntry.cpp:
        (JSC::FTL::prepareOSREntry):
        * interpreter/CallFrame.cpp:
        (JSC::CallFrame::frameExtentInternal):
        * interpreter/JSStackInlines.h:
        (JSC::JSStack::pushFrame):
        * jit/JIT.h:
        (JSC::JIT::frameRegisterCountFor):
        * jit/JITOperations.cpp:
        * llint/LLIntEntrypoint.cpp:
        (JSC::LLInt::frameRegisterCountFor):
        * llint/LLIntEntrypoint.h:

712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
2013-11-21  Filip Pizlo  <fpizlo@apple.com>

        Combine SymbolTable and SharedSymbolTable
        https://bugs.webkit.org/show_bug.cgi?id=124761

        Reviewed by Geoffrey Garen.
        
        SymbolTable was never used directly; we now always used SharedSymbolTable. So, this
        gets rid of SymbolTable and renames SharedSymbolTable to SymbolTable.

        * bytecode/CodeBlock.h:
        (JSC::CodeBlock::symbolTable):
        * bytecode/UnlinkedCodeBlock.h:
        (JSC::UnlinkedFunctionExecutable::symbolTable):
        (JSC::UnlinkedCodeBlock::symbolTable):
        (JSC::UnlinkedCodeBlock::finishCreation):
        * bytecompiler/BytecodeGenerator.h:
        (JSC::BytecodeGenerator::symbolTable):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGStackLayoutPhase.cpp:
        (JSC::DFG::StackLayoutPhase::run):
        * jit/AssemblyHelpers.h:
        (JSC::AssemblyHelpers::symbolTableFor):
        * runtime/Arguments.h:
        (JSC::Arguments::finishCreation):
        * runtime/Executable.h:
        (JSC::FunctionExecutable::symbolTable):
        * runtime/JSActivation.h:
        (JSC::JSActivation::create):
        (JSC::JSActivation::JSActivation):
        (JSC::JSActivation::registersOffset):
        (JSC::JSActivation::allocationSize):
        * runtime/JSSymbolTableObject.h:
        (JSC::JSSymbolTableObject::symbolTable):
        (JSC::JSSymbolTableObject::JSSymbolTableObject):
        (JSC::JSSymbolTableObject::finishCreation):
        * runtime/JSVariableObject.h:
        (JSC::JSVariableObject::JSVariableObject):
        * runtime/SymbolTable.cpp:
        (JSC::SymbolTable::destroy):
        (JSC::SymbolTable::SymbolTable):
        * runtime/SymbolTable.h:
        (JSC::SymbolTable::create):
        (JSC::SymbolTable::createStructure):
        * runtime/VM.cpp:
        (JSC::VM::VM):
        * runtime/VM.h:

763
764
765
766
767
768
769
770
771
772
2013-11-22  Mark Lam  <mark.lam@apple.com>

        Remove residual references to "dynamicGlobalObject".
        https://bugs.webkit.org/show_bug.cgi?id=124787.

        Reviewed by Filip Pizlo.

        * JavaScriptCore.order:
        * interpreter/CallFrame.h:

773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
2013-11-22  Mark Lam  <mark.lam@apple.com>

        Ensure that arity fixups honor stack alignment requirements.
        https://bugs.webkit.org/show_bug.cgi?id=124756.

        Reviewed by Geoffrey Garen.

        The LLINT and all the JITs rely on CommonSlowPaths::arityCheckFor() to
        compute the arg count adjustment for the arity fixup. We take advantage
        of this choke point and introduce the stack alignment padding there in
        the guise of additional args.

        The only cost of this approach is that the padding will also be
        initialized to undefined values as if they were args. Since arity fixups
        are considered a slow path that is rarely taken, this cost is not a
        concern.

        * runtime/CommonSlowPaths.h:
        (JSC::CommonSlowPaths::arityCheckFor):
        * runtime/VM.h:
        (JSC::VM::isSafeToRecurse):

795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
2013-11-21  Filip Pizlo  <fpizlo@apple.com>

        BytecodeGenerator should align the stack according to native conventions
        https://bugs.webkit.org/show_bug.cgi?id=124735

        Reviewed by Mark Lam.
        
        Rolling this back in because it actually fixed fast/dom/gc-attribute-node.html, but
        our infrastructure misleads peole into thinking that fixing a test constitutes
        breaking it.

        * bytecompiler/BytecodeGenerator.h:
        (JSC::CallArguments::registerOffset):
        (JSC::CallArguments::argumentCountIncludingThis):
        * bytecompiler/NodesCodegen.cpp:
        (JSC::CallArguments::CallArguments):

812
813
814
815
816
817
818
819
820
821
822
823
2013-11-21  Filip Pizlo  <fpizlo@apple.com>

        Get rid of CodeBlock::dumpStatistics()
        https://bugs.webkit.org/show_bug.cgi?id=124762

        Reviewed by Mark Hahnenberg.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::CodeBlock):
        (JSC::CodeBlock::~CodeBlock):
        * bytecode/CodeBlock.h:

824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
2013-11-22  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r159652.
        http://trac.webkit.org/changeset/159652
        https://bugs.webkit.org/show_bug.cgi?id=124778

        broke fast/dom/gc-attribute-node.html (Requested by ap on
        #webkit).

        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::BytecodeGenerator::emitCall):
        (JSC::BytecodeGenerator::emitConstruct):
        * bytecompiler/BytecodeGenerator.h:
        (JSC::CallArguments::registerOffset):
        (JSC::CallArguments::argumentCountIncludingThis):
        * bytecompiler/NodesCodegen.cpp:
        (JSC::CallArguments::CallArguments):
        (JSC::CallArguments::newArgument):

843
844
845
846
847
848
2013-11-21  Filip Pizlo  <fpizlo@apple.com>

        Fix a typo (requriements->requirements).

        * runtime/StackAlignment.h:

849
850
851
852
853
854
855
856
857
858
859
860
2013-11-21  Mark Lam  <mark.lam@apple.com>

        CodeBlock::m_numCalleeRegisters need to honor native stack alignment.
        https://bugs.webkit.org/show_bug.cgi?id=124754.

        Reviewed by Filip Pizlo.

        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::BytecodeGenerator::newRegister):
        * dfg/DFGVirtualRegisterAllocationPhase.cpp:
        (JSC::DFG::VirtualRegisterAllocationPhase::run):

861
862
863
864
865
866
867
868
869
870
2013-11-21  Mark Rowe  <mrowe@apple.com>

        <https://webkit.org/b/124702> Stop overriding VALID_ARCHS.

        All modern versions of Xcode set it appropriately for our needs.

        Reviewed by Alexey Proskuryakov.

        * Configurations/Base.xcconfig:

871
872
873
874
875
876
877
878
2013-11-21  Mark Rowe  <mrowe@apple.com>

        <https://webkit.org/b/124701> Fix an error in a few Xcode configuration setting files.

        Reviewed by Alexey Proskuryakov.

        * Configurations/Base.xcconfig:

879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
2013-11-21  Michael Saboff  <msaboff@apple.com>

        ARM64: Implement push/pop equivalents in LLInt
        https://bugs.webkit.org/show_bug.cgi?id=124721

        Reviewed by Filip Pizlo.

        Added pushLRAndFP and popLRAndFP that push and pop the link register and frame pointer register.
        These ops emit code just like what the compiler emits in the prologue and epilogue.  Also changed
        pushCalleeSaves and popCalleeSaves to use the same store pair and load pair instructions to do
        the actually pushing and popping.  Finally changed the implementation of push and pop to raise
        an exception since we don't have (or need) a single register push or pop.

        * llint/LowLevelInterpreter64.asm:
        * offlineasm/arm64.rb:
        * offlineasm/instructions.rb:

896
897
898
899
900
901
902
903
904
905
906
907
2013-11-21  Michael Saboff  <msaboff@apple.com>

        JSC: Removed unused opcodes from offline assembler
        https://bugs.webkit.org/show_bug.cgi?id=124749

        Reviewed by Mark Hahnenberg.

        Removed the unused, X86 only peekq and pokeq.

        * offlineasm/instructions.rb:
        * offlineasm/x86.rb:

908
909
910
911
912
913
914
915
916
917
918
919
920
2013-11-21  Michael Saboff  <msaboff@apple.com>

        REGRESSION(159395) Fix branch8(…, AbsoluteAddress, …) in ARM64 MacroAssembler
        https://bugs.webkit.org/show_bug.cgi?id=124688

        Reviewed by Geoffrey Garen.

        Changed handling of the address for the load8() in the branch8(AbsoluteAddress) to be like
        the rest of the branchXX(AbsoluteAddress) fucntions.

        * assembler/MacroAssemblerARM64.h:
        (JSC::MacroAssemblerARM64::branch8):

921
922
923
924
925
926
927
928
929
930
931
932
933
2013-11-21  Filip Pizlo  <fpizlo@apple.com>

        BytecodeGenerator should align the stack according to native conventions
        https://bugs.webkit.org/show_bug.cgi?id=124735

        Reviewed by Mark Lam.

        * bytecompiler/BytecodeGenerator.h:
        (JSC::CallArguments::registerOffset):
        (JSC::CallArguments::argumentCountIncludingThis):
        * bytecompiler/NodesCodegen.cpp:
        (JSC::CallArguments::CallArguments):

934
935
936
937
938
939
940
941
2013-11-21  Filip Pizlo  <fpizlo@apple.com>

        Unreviewed, preemptive build fix.

        * runtime/StackAlignment.h:
        (JSC::stackAlignmentBytes):
        (JSC::stackAlignmentRegisters):

942
943
944
945
946
947
948
949
950
951
952
953
954
955
2013-11-21  Filip Pizlo  <fpizlo@apple.com>

        JSC should know what the stack alignment conventions are
        https://bugs.webkit.org/show_bug.cgi?id=124736

        Reviewed by Mark Lam.

        * GNUmakefile.list.am:
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * runtime/StackAlignment.h: Added.
        (JSC::stackAlignmentBytes):
        (JSC::stackAlignmentRegisters):

956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
2013-11-21  Balazs Kilvady  <kilvadyb@homejinni.com>

        [MIPS] Build fails since r159545.
        https://bugs.webkit.org/show_bug.cgi?id=124716

        Reviewed by Michael Saboff.

        Add missing implementations in MacroAssembler and LLInt for MIPS.

        * assembler/MIPSAssembler.h:
        (JSC::MIPSAssembler::sync):
        * assembler/MacroAssemblerMIPS.h:
        (JSC::MacroAssemblerMIPS::store8):
        (JSC::MacroAssemblerMIPS::memoryFence):
        * offlineasm/mips.rb:

972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
2013-11-21  Julien Brianceau  <jbriance@cisco.com>

        Fix sh4 build after r159545.
        https://bugs.webkit.org/show_bug.cgi?id=124713

        Reviewed by Michael Saboff.

        Add missing implementations in macro assembler and LLINT for sh4.

        * assembler/MacroAssemblerSH4.h:
        (JSC::MacroAssemblerSH4::load8):
        (JSC::MacroAssemblerSH4::store8):
        (JSC::MacroAssemblerSH4::memoryFence):
        * assembler/SH4Assembler.h:
        (JSC::SH4Assembler::synco):
        * offlineasm/sh4.rb: Handle "memfence" opcode.

989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
2013-11-20  Mark Lam  <mark.lam@apple.com>

        Introducing VMEntryScope to update the VM stack limit.
        https://bugs.webkit.org/show_bug.cgi?id=124634.

        Reviewed by Geoffrey Garen.

        1. Introduced USE(SEPARATE_C_AND_JS_STACK) (defined in Platform.h).
           Currently, it is hardcoded to use separate C and JS stacks. Once we
           switch to using the C stack for JS frames, we'll need to fix this to
           only be enabled when ENABLE(LLINT_C_LOOP).

        2. Stack limits are now tracked in the VM.

           Logically, there are 2 stack limits:
           a. m_stackLimit for the native C stack, and
           b. m_jsStackLimit for the JS stack.

           If USE(SEPARATE_C_AND_JS_STACK), then the 2 limits are the same
           value, and are implemented as 2 fields in a union.

        3. The VM native stackLimit is set as follows:
           a. Initially, the VM sets it to the limit of the stack of the thread that
              instantiated the VM. This allows the parser and bytecode generator to
              run before we enter the VM to execute JS code.

           b. Upon entry into the VM to execute JS code (via one of the
              Interpreter::execute...() functions), we instantiate a VMEntryScope
              that sets the VM's stackLimit to the limit of the current thread's
              stack. The VMEntryScope will automatically restore the previous
              entryScope and stack limit upon destruction.

           If USE(SEPARATE_C_AND_JS_STACK), the JSStack's methods will set the VM's
           jsStackLimit whenever it grows or shrinks.

        4. The VM now provides a isSafeToRecurse() function that compares the
           current stack pointer against its native stackLimit. This subsumes and
           obsoletes the VMStackBounds class.

        5. The VMEntryScope class also subsumes DynamicGlobalObjectScope for
           tracking the JSGlobalObject that we last entered the VM with.

        6. Renamed dynamicGlobalObject() to vmEntryGlobalObject() since that is
           the value that the function retrieves.

        7. Changed JIT and LLINT code to do stack checks against the jsStackLimit
           in the VM class instead of the JSStack.

        * API/JSBase.cpp:
        (JSEvaluateScript):
        (JSCheckScriptSyntax):
        * API/JSContextRef.cpp:
        (JSGlobalContextRetain):
        (JSGlobalContextRelease):
        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::BytecodeGenerator::BytecodeGenerator):
        * bytecompiler/BytecodeGenerator.h:
        (JSC::BytecodeGenerator::emitNode):
        (JSC::BytecodeGenerator::emitNodeInConditionContext):
        * debugger/Debugger.cpp:
        (JSC::Debugger::detach):
        (JSC::Debugger::recompileAllJSFunctions):
        (JSC::Debugger::pauseIfNeeded):
        * debugger/DebuggerCallFrame.cpp:
        (JSC::DebuggerCallFrame::vmEntryGlobalObject):
        * debugger/DebuggerCallFrame.h:
        * dfg/DFGJITCompiler.cpp:
        (JSC::DFG::JITCompiler::compileFunction):
        * dfg/DFGOSREntry.cpp:
        * ftl/FTLLink.cpp:
        (JSC::FTL::link):
        * ftl/FTLOSREntry.cpp:
        * heap/Heap.cpp:
        (JSC::Heap::lastChanceToFinalize):
        (JSC::Heap::deleteAllCompiledCode):
        * interpreter/CachedCall.h:
        (JSC::CachedCall::CachedCall):
        * interpreter/CallFrame.cpp:
        (JSC::CallFrame::vmEntryGlobalObject):
        * interpreter/CallFrame.h:
        * interpreter/Interpreter.cpp:
        (JSC::unwindCallFrame):
        (JSC::Interpreter::unwind):
        (JSC::Interpreter::execute):
        (JSC::Interpreter::executeCall):
        (JSC::Interpreter::executeConstruct):
        (JSC::Interpreter::prepareForRepeatCall):
        (JSC::Interpreter::debug):
        * interpreter/JSStack.cpp:
        (JSC::JSStack::JSStack):
        (JSC::JSStack::growSlowCase):
        * interpreter/JSStack.h:
        * interpreter/JSStackInlines.h:
        (JSC::JSStack::shrink):
        (JSC::JSStack::grow):
        - Moved these inlined functions here from JSStack.h. It reduces some
          #include dependencies of JSSTack.h which had previously resulted
          in some EWS bots' unhappiness with this patch.
        (JSC::JSStack::updateStackLimit):
        * jit/JIT.cpp:
        (JSC::JIT::privateCompile):
        * jit/JITCall.cpp:
        (JSC::JIT::compileLoadVarargs):
        * jit/JITCall32_64.cpp:
        (JSC::JIT::compileLoadVarargs):
        * jit/JITOperations.cpp:
        * llint/LLIntSlowPaths.cpp:
        * llint/LowLevelInterpreter.asm:
        * parser/Parser.cpp:
        (JSC::::Parser):
        * parser/Parser.h:
        (JSC::Parser::canRecurse):
        * runtime/CommonSlowPaths.h:
        * runtime/Completion.cpp:
        (JSC::evaluate):
        * runtime/FunctionConstructor.cpp:
        (JSC::constructFunctionSkippingEvalEnabledCheck):
        * runtime/JSGlobalObject.cpp:
        * runtime/JSGlobalObject.h:
        * runtime/StringRecursionChecker.h:
        (JSC::StringRecursionChecker::performCheck):
        * runtime/VM.cpp:
        (JSC::VM::VM):
        (JSC::VM::releaseExecutableMemory):
        (JSC::VM::throwException):
        * runtime/VM.h:
        (JSC::VM::addressOfJSStackLimit):
        (JSC::VM::jsStackLimit):
        (JSC::VM::setJSStackLimit):
        (JSC::VM::stackLimit):
        (JSC::VM::setStackLimit):
        (JSC::VM::isSafeToRecurse):
        * runtime/VMEntryScope.cpp: Added.
        (JSC::VMEntryScope::VMEntryScope):
        (JSC::VMEntryScope::~VMEntryScope):
        (JSC::VMEntryScope::requiredCapacity):
        * runtime/VMEntryScope.h: Added.
        (JSC::VMEntryScope::globalObject):
        * runtime/VMStackBounds.h: Removed.

1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
2013-11-20  Michael Saboff  <msaboff@apple.com>

        [Win] JavaScript JIT crash (with DFG enabled).
        https://bugs.webkit.org/show_bug.cgi?id=124675

        Reviewed by Geoffrey Garen.

        Similar to the change in r159427, changed linkClosureCall to use regT0/regT1 (payload/tag) for the callee.
        linkForThunkGenerator already expected the callee in regT0/regT1, but changed the comment to reflect that.

        * jit/Repatch.cpp:
        (JSC::linkClosureCall):
        * jit/ThunkGenerators.cpp:
        (JSC::linkForThunkGenerator):

1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
2013-11-20  Michael Saboff  <msaboff@apple.com>

        ARMv7: Crash due to use after free of AssemblerBuffer
        https://bugs.webkit.org/show_bug.cgi?id=124611

        Reviewed by Geoffrey Garen.

        Changed JITFinalizer constructor to take a MacroAssemblerCodePtr instead of a Label.
        In finalizeFunction(), we use that value instead of calculating it from the label.

        * assembler/MacroAssembler.cpp:
        * dfg/DFGJITFinalizer.cpp:
        (JSC::DFG::JITFinalizer::JITFinalizer):
        (JSC::DFG::JITFinalizer::finalizeFunction):
        * dfg/DFGJITFinalizer.h:

1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
2013-11-20  Julien Brianceau  <jbriance@cisco.com>

        Fix CPU(ARM_TRADITIONAL) build after r159545.
        https://bugs.webkit.org/show_bug.cgi?id=124649

        Reviewed by Michael Saboff.

        Add missing memoryFence, load8 and store8 implementations in macro assembler.

        * assembler/ARMAssembler.h:
        (JSC::ARMAssembler::dmbSY):
        * assembler/MacroAssemblerARM.h:
        (JSC::MacroAssemblerARM::load8):
        (JSC::MacroAssemblerARM::store8):
        (JSC::MacroAssemblerARM::memoryFence):

1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
2013-11-20  Julien Brianceau  <jbriance@cisco.com>

        [armv7][arm64] Speculative build fix after r159545.
        https://bugs.webkit.org/show_bug.cgi?id=124646

        Reviewed by Filip Pizlo.

        * assembler/ARMv7Assembler.h:
        * assembler/MacroAssemblerARM64.h:
        (JSC::MacroAssemblerARM64::memoryFence):
        * assembler/MacroAssemblerARMv7.h:
        (JSC::MacroAssemblerARMv7::memoryFence):

1194
1195
1196
1197
1198
1199
1200
1201
1202
2013-11-19  Ryosuke Niwa  <rniwa@webkit.org>

        Enable HTMLTemplateElement on Mac port
        https://bugs.webkit.org/show_bug.cgi?id=124637

        Reviewed by Tim Horton.

        * Configurations/FeatureDefines.xcconfig:

1203
1204
1205
1206
1207
1208
1209
2013-11-19  Filip Pizlo  <fpizlo@apple.com>

        Unreviewed, remove completely bogus assertion.

        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::addFunction):

1210
1211
1212
1213
1214
1215
1216
2013-11-19  Filip Pizlo  <fpizlo@apple.com>

        Unreviewed, debug build fix.

        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::addFunction):

1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
2013-11-19  Filip Pizlo  <fpizlo@apple.com>

        Infer constant global variables
        https://bugs.webkit.org/show_bug.cgi?id=124464

        Reviewed by Sam Weinig.
        
        All global variables that are candidates for watchpoint-based constant inference (i.e.
        not 'const' variables) will now have WatchpointSet's associated with them and those
        are used to drive the inference by tracking three states of each variable:
        
        Uninitialized: the variable's value is Undefined and the WatchpointSet state is
            ClearWatchpoint.
        
        Initialized: the variable's value was set to something (could even be explicitly set
            to Undefined) and the WatchpointSet state is IsWatching.
        
        Invalidated: the variable's value was set to something else (could even be the same
            thing as before but the point is that a put operation did execute again) and the
            WatchpointSet is IsInvalidated.
        
        If the compiler tries to compile a GetGlobalVar and the WatchpointSet state is
        IsWatching, then the current value of the variable can be folded in place of the get,
        and a watchpoint on the variable can be registered.
        
        We handle race conditions between the mutator and compiler by mandating that:
        
        - The mutator changes the WatchpointSet state after executing the put.
        
        - There is no opportunity to install code or call functions between when the mutator
          executes a put and changes the WatchpointSet state.
        
        - The compiler checks the WatchpointSet state prior to reading the value.
        
        The concrete algorithm used by the mutator is:
        
            1. Store the new value into the variable.
            --- Execute a store-store fence.
            2. Bump the state (ClearWatchpoing becomes IsWatching, IsWatching becomes
               IsInvalidated); the IsWatching->IsInvalidated transition may end up firing
               watchpoints.
        
        The concrete algorithm that the compiler uses is:
        
            1. Load the state. If it's *not* IsWatching, then give up on constant inference.
            --- Execute a load-load fence.
            2. Load the value of the variable and use that for folding, while also registering
               a DesiredWatchpoint. The various parts of this step can be done in any order.
        
        The desired watchpoint registration will fail if the watchpoint set is already
        invalidated. Now consider the following interesting interleavings:
        
        Uninitialized->M1->M2->C1->C2: Compiler sees IsWatching because of the mutator's store
            operation, and the variable is folded. The fencing ensures that C2 sees the value
            stored in M1 - i.e. we fold on the value that will actually be watchpointed. If
            before the compilation is installed the mutator executes another store then we
            will be sure that it will be a complete sequence of M1+M2 since compilations get
            installed at safepoints and never "in the middle" of a put_to_scope. Hence that
            compilation installation will be invalidated. If the M1+M2 sequence happens after
            the code is installed, then the code will be invalidated by triggering a jettison.
        
        Uninitialized->M1->C1->C2->M2: Compiler sees Uninitialized and will not fold. This is
            a sensible outcome since if the compiler read the variable's value, it would have
            seen Undefined.
        
        Uninitialized->C1->C2->M1->M2: Compiler sees Uninitialized and will not fold.
        Uninitialized->C1->M1->C2->M2: Compiler sees Uninitialized and will not fold.
        Uninitialized->C1->M1->M2->C2: Compiler sees Uninitialized and will not fold.
        Uninitialized->M1->C1->M2->C2: Compiler sees Uninitialized and will not fold.
        
        IsWatched->M1->M2->C1->C2: Compiler sees IsInvalidated and will not fold.
        
        IsWatched->M1->C1->C2->M2: Compiler will fold, but will also register a desired
            watchpoint, and that watchpoint will get invalidated before the code is installed.
        
        IsWatched->M1->C1->M2->C2: As above, will fold but the code will get invalidated.
        IsWatched->C1->C2->M1->M2: As above, will fold but the code will get invalidated.
        IsWatched->C1->M1->C2->M2: As above, will fold but the code will get invalidated.
        IsWatched->C1->M1->M2->C2: As above, will fold but the code will get invalidated.
        
        Note that this kind of reasoning shows why having the mutator first bump the state and
        then store the new value would be wrong. If we had done that (M1 = bump state, M2 =
        execute put) then we could have the following deadly interleavings:
        
        Uninitialized->M1->C1->C2->M2:
        Uninitialized->M1->C1->M2->C2: Mutator bumps the state to IsWatched and then the
            compiler folds Undefined, since M2 hasn't executed yet. Although C2 will set the
            watchpoint, M1 didn't notify it - it mearly initiated watching. M2 then stores a
            value other than Undefined, and you're toast.
        
        You could fix this sort of thing by making the Desired Watchpoints machinery more
        sophisticated, for example having it track the value that was folded; if the global
        variable's value was later found to be different then we could invalidate the
        compilation. You could also fix it by having the compiler also check that the value of
        the variable is not Undefined before folding. While those all sound great, I decided
        to instead just use the right interleaving since that results in less code and feels
        more intuitive.
        
        This is a 0.5% speed-up on SunSpider, mostly due to a 20% speed-up on math-cordic.
        It's a 0.6% slow-down on LongSpider, mostly due to a 25% slow-down on 3d-cube. This is
        because 3d-cube takes global variable assignment slow paths very often. Note that this
        3d-cube slow-down doesn't manifest as much in SunSpider (only 6% there). This patch is
        also a 1.5% speed-up on V8v7 and a 2.8% speed-up on Octane v1, mostly due to deltablue
        (3.7%), richards (4%), and mandreel (26%). This is a 2% speed-up on Kraken, mostly due
        to a 17.5% speed-up on imaging-gaussian-blur. Something that really illustrates the
        slam-dunk-itude of this patch is the wide range of speed-ups on JSRegress. Casual JS
        programming often leads to global-var-based idioms and those variables tend to be
        assigned once, leading to excellent constant folding opportunities in an optimizing
        JIT. This is very evident in the speed-ups on JSRegress.

        * assembler/ARM64Assembler.h:
        (JSC::ARM64Assembler::dmbSY):
        * assembler/ARMv7Assembler.h:
        (JSC::ARMv7Assembler::dmbSY):
        * assembler/MacroAssemblerARM64.h:
        (JSC::MacroAssemblerARM64::memfence):
        * assembler/MacroAssemblerARMv7.h:
        (JSC::MacroAssemblerARMv7::load8):
        (JSC::MacroAssemblerARMv7::memfence):
        * assembler/MacroAssemblerX86.h:
        (JSC::MacroAssemblerX86::load8):
        (JSC::MacroAssemblerX86::store8):
        * assembler/MacroAssemblerX86Common.h:
        (JSC::MacroAssemblerX86Common::getUnusedRegister):
        (JSC::MacroAssemblerX86Common::store8):
        (JSC::MacroAssemblerX86Common::memoryFence):
        * assembler/MacroAssemblerX86_64.h:
        (JSC::MacroAssemblerX86_64::load8):
        (JSC::MacroAssemblerX86_64::store8):
        * assembler/X86Assembler.h:
        (JSC::X86Assembler::movb_rm):
        (JSC::X86Assembler::movzbl_mr):
        (JSC::X86Assembler::mfence):
        (JSC::X86Assembler::X86InstructionFormatter::threeByteOp):
        (JSC::X86Assembler::X86InstructionFormatter::oneByteOp8):
        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::CodeBlock):
        * bytecode/Watchpoint.cpp:
        (JSC::WatchpointSet::WatchpointSet):
        (JSC::WatchpointSet::add):
        (JSC::WatchpointSet::notifyWriteSlow):
        * bytecode/Watchpoint.h:
        (JSC::WatchpointSet::state):
        (JSC::WatchpointSet::isStillValid):
        (JSC::WatchpointSet::addressOfSetIsNotEmpty):
        * dfg/DFGAbstractInterpreterInlines.h:
        (JSC::DFG::::executeEffects):
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::getJSConstantForValue):
        (JSC::DFG::ByteCodeParser::getJSConstant):
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGClobberize.h:
        (JSC::DFG::clobberize):
        * dfg/DFGFixupPhase.cpp:
        (JSC::DFG::FixupPhase::fixupNode):
        * dfg/DFGNode.h:
        (JSC::DFG::Node::isStronglyProvedConstantIn):
        (JSC::DFG::Node::hasIdentifierNumberForCheck):
        (JSC::DFG::Node::hasRegisterPointer):
        * dfg/DFGNodeFlags.h:
        * dfg/DFGNodeType.h:
        * dfg/DFGOperations.cpp:
        * dfg/DFGOperations.h:
        * dfg/DFGPredictionPropagationPhase.cpp:
        (JSC::DFG::PredictionPropagationPhase::propagate):
        * dfg/DFGSafeToExecute.h:
        (JSC::DFG::safeToExecute):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileNotifyPutGlobalVar):
        * dfg/DFGSpeculativeJIT.h:
        (JSC::DFG::SpeculativeJIT::callOperation):
        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::compile):
        * ftl/FTLAbbreviatedTypes.h:
        * ftl/FTLAbbreviations.h:
        (JSC::FTL::buildFence):
        * ftl/FTLCapabilities.cpp:
        (JSC::FTL::canCompile):
        * ftl/FTLIntrinsicRepository.h:
        * ftl/FTLLowerDFGToLLVM.cpp:
        (JSC::FTL::LowerDFGToLLVM::compileNode):
        (JSC::FTL::LowerDFGToLLVM::compileNotifyPutGlobalVar):
        * ftl/FTLOutput.h:
        (JSC::FTL::Output::fence):
        * jit/JIT.h:
        * jit/JITOperations.h:
        * jit/JITPropertyAccess.cpp:
        (JSC::JIT::emitPutGlobalVar):
        (JSC::JIT::emit_op_put_to_scope):
        (JSC::JIT::emitSlow_op_put_to_scope):
        * jit/JITPropertyAccess32_64.cpp:
        (JSC::JIT::emitPutGlobalVar):
        (JSC::JIT::emit_op_put_to_scope):
        (JSC::JIT::emitSlow_op_put_to_scope):
        * llint/LowLevelInterpreter32_64.asm:
        * llint/LowLevelInterpreter64.asm:
        * llvm/LLVMAPIFunctions.h:
        * offlineasm/arm.rb:
        * offlineasm/arm64.rb:
        * offlineasm/cloop.rb:
        * offlineasm/instructions.rb:
        * offlineasm/x86.rb:
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::addGlobalVar):
        (JSC::JSGlobalObject::addFunction):
        * runtime/JSGlobalObject.h:
        (JSC::JSGlobalObject::addVar):
        (JSC::JSGlobalObject::addConst):
        * runtime/JSScope.cpp:
        (JSC::abstractAccess):
        * runtime/JSSymbolTableObject.h:
        (JSC::symbolTablePut):
        (JSC::symbolTablePutWithAttributes):
        * runtime/SymbolTable.cpp:
        (JSC::SymbolTableEntry::couldBeWatched):
        (JSC::SymbolTableEntry::prepareToWatch):
        (JSC::SymbolTableEntry::notifyWriteSlow):
        * runtime/SymbolTable.h:

1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
2013-11-19  Michael Saboff  <msaboff@apple.com>

        REGRESSION(158384) ARMv7 point checks too restrictive for native calls to traditional ARM code
        https://bugs.webkit.org/show_bug.cgi?id=124612

        Reviewed by Geoffrey Garen.

        Removed ASSERT checks (i.e. lower bit set) for ARM Thumb2 destination addresses related to
        calls since we are calling native ARM traditional functions like sin() and cos().

        * assembler/ARMv7Assembler.h:
        (JSC::ARMv7Assembler::linkCall):
        (JSC::ARMv7Assembler::relinkCall):
        * assembler/MacroAssemblerCodeRef.h:

1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
2013-11-19  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r159459.
        http://trac.webkit.org/changeset/159459
        https://bugs.webkit.org/show_bug.cgi?id=124616

        tons of assertions on launch (Requested by thorton on
        #webkit).

        * API/JSContext.mm:
        (-[JSContext setException:]):
        (-[JSContext wrapperForObjCObject:]):
        (-[JSContext wrapperForJSObject:]):
        * API/JSContextRef.cpp:
        (JSContextGroupRelease):
        (JSGlobalContextRelease):
        * API/JSManagedValue.mm:
        (-[JSManagedValue initWithValue:]):
        (-[JSManagedValue value]):
        * API/JSObjectRef.cpp:
        (JSObjectIsFunction):
        (JSObjectCopyPropertyNames):
        * API/JSValue.mm:
        (containerValueToObject):
        * API/JSWrapperMap.mm:
        (tryUnwrapObjcObject):

1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
2013-11-19  Filip Pizlo  <fpizlo@apple.com>

        Rename WatchpointSet::notifyWrite() should be renamed to WatchpointSet::fireAll()
        https://bugs.webkit.org/show_bug.cgi?id=124609

        Rubber stamped by Mark Lam.
        
        notifyWrite() is a thing that SymbolTable does. WatchpointSet uses that terminology
        because it was original designed to match exactly SymbolTable's semantics. But now
        it's a confusing term.

        * bytecode/Watchpoint.cpp:
        (JSC::WatchpointSet::fireAllSlow):
        * bytecode/Watchpoint.h:
        (JSC::WatchpointSet::fireAll):
        (JSC::InlineWatchpointSet::fireAll):
        * interpreter/Interpreter.cpp:
        (JSC::Interpreter::execute):
        * runtime/JSFunction.cpp:
        (JSC::JSFunction::put):
        (JSC::JSFunction::defineOwnProperty):
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::haveABadTime):
        * runtime/Structure.h:
        (JSC::Structure::notifyTransitionFromThisStructure):
        * runtime/SymbolTable.cpp:
        (JSC::SymbolTableEntry::notifyWriteSlow):

1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
2013-11-18  Michael Saboff  <msaboff@apple.com>

        REGRESSION (r159395): Error compiling for ARMv7
        https://bugs.webkit.org/show_bug.cgi?id=124552

        Reviewed by Geoffrey Garen.

        Fixed the implementation of branch8(RelationalCondition cond, AbsoluteAddress address, TrustedImm32 right)
        to materialize and use address similar to other ARMv7 branchXX() functions.

        * assembler/MacroAssemblerARMv7.h:
        (JSC::MacroAssemblerARMv7::branch8):

1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
2013-11-19  Mark Lam  <mark.lam@apple.com>

        Add tracking of endColumn for Executables.
        https://bugs.webkit.org/show_bug.cgi?id=124245.

        Reviewed by Geoffrey Garen.

        1. Fixed computation of columns to take into account the startColumn from
           <script> tags. Previously, we were only computing the column relative
           to the char after the <script> tag. Now, the column number that JSC
           computes is always the column number you'll see when viewing the source
           in a text editor (assuming the first column position is 1, not 0).

        2. Previously, unlinkedExecutables kept the a base-1 startColumn for
           ProgramExecutables and EvalExecutables, but uses base-0 columns for
           FunctionExecutables. This has been fixed so that they all use base-0
           columns. When the executable gets linked, the column is adjusted into
           a base-1 value.

        3. In the UnlinkedFunctionExecutable, renamed m_functionStartOffset to
           m_unlinkedFunctionNameStart because it actually points to the start
           column in the name part of the function declaration.

           Similarly, renamed m_functionStartColumn to m_unlinkedBodyStartColumn
           because it points to the first character in the function body. This is
           usually '{' except for functions created from "global code" which
           excludes its braces. See FunctionExecutable::fromGlobalCode().

               The exclusion of braces for the global code case is needed so that
           computed start and end columns will more readily map to what a JS
           developer would expect them to be. Otherwise, the first column of the
           function source will not be 1 (includes prepended characters added in
           constructFunctionSkippingEvalEnabledCheck()).

           Also, similarly, a m_unlinkedBodyEndColumn has been added to track the
           end column of the UnlinkedFunctionExecutable.

        4. For unlinked executables, end column values are either:
           a. Relative to the start of the last line if (last line != first line).
           b. Relative to the start column position if (last line == first line).

           The second case is needed so that we can add an appropriate adjustment
           to the end column value (just like we do for the start column) when we
           link the executable.

        5. This is not new to this patch, but it worth noting that the lineCount
           values used through this patch has the following meaning:
           - a lineCount of 0 means the source for this code block is on 1 line.
           - a lineCount of N means there are N + l lines of source.

           This interpretation is janky, but was present before this patch. We can
           clean that up later in another patch.


        * JavaScriptCore.xcodeproj/project.pbxproj:
        - In order to implement WebCore::Internals::parserMetaData(), we need to
          move some seemingly unrelated header files from the Project section to
          the Private section so that they can be #include'd by the forwarding
          CodeBlock.h from WebCore.
        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::sourceCodeForTools):
        (JSC::CodeBlock::CodeBlock):
        * bytecode/UnlinkedCodeBlock.cpp:
        (JSC::generateFunctionCodeBlock):
        (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
        - m_isFromGlobalCode is needed to support the exclusion of the open brace /
          prepended code for functions created from "global code".
        (JSC::UnlinkedFunctionExecutable::link):
        (JSC::UnlinkedFunctionExecutable::fromGlobalCode):
        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
        * bytecode/UnlinkedCodeBlock.h:
        (JSC::UnlinkedFunctionExecutable::create):
        (JSC::UnlinkedFunctionExecutable::unlinkedFunctionNameStart):
        (JSC::UnlinkedFunctionExecutable::unlinkedBodyStartColumn):
        (JSC::UnlinkedFunctionExecutable::unlinkedBodyEndColumn):
        (JSC::UnlinkedFunctionExecutable::recordParse):
        (JSC::UnlinkedCodeBlock::recordParse):
        (JSC::UnlinkedCodeBlock::endColumn):
        * bytecompiler/NodesCodegen.cpp:
        (JSC::FunctionBodyNode::emitBytecode):
        * parser/ASTBuilder.h:
        (JSC::ASTBuilder::createFunctionBody):
        (JSC::ASTBuilder::setFunctionNameStart):
        * parser/Lexer.cpp:
        (JSC::::shiftLineTerminator):
        - Removed an unused SourceCode Lexer<T>::sourceCode() function.
        * parser/Lexer.h:
        (JSC::Lexer::positionBeforeLastNewline):
        (JSC::Lexer::prevTerminator):
        - Added tracking of m_positionBeforeLastNewline in the Lexer to enable us
          to exclude the close brace / appended code for functions created from "global
          code".
        * parser/Nodes.cpp:
        (JSC::ProgramNode::ProgramNode):
        (JSC::ProgramNode::create):
        (JSC::EvalNode::EvalNode):
        (JSC::EvalNode::create):
        (JSC::FunctionBodyNode::FunctionBodyNode):
        (JSC::FunctionBodyNode::create):
        (JSC::FunctionBodyNode::setEndPosition):
        - setEndPosition() is needed to fixed up the end position so that we can
          exclude the close brace / appended code for functions created from "global
          code".
        * parser/Nodes.h:
        (JSC::ProgramNode::startColumn):
        (JSC::ProgramNode::endColumn):
        (JSC::EvalNode::startColumn):
        (JSC::EvalNode::endColumn):
        (JSC::FunctionBodyNode::setFunctionNameStart):
        (JSC::FunctionBodyNode::functionNameStart):
        (JSC::FunctionBodyNode::endColumn):
        * parser/Parser.cpp:
        (JSC::::parseFunctionBody):
        (JSC::::parseFunctionInfo):
        * parser/Parser.h:
        (JSC::Parser::positionBeforeLastNewline):
        (JSC::::parse):
        - Subtracted 1 from startColumn here to keep the node column values consistently
          base-0. See note 2 above.
        (JSC::parse):
        * parser/SourceProviderCacheItem.h:
        (JSC::SourceProviderCacheItem::SourceProviderCacheItem):
        * parser/SyntaxChecker.h:
        (JSC::SyntaxChecker::createFunctionBody):
        (JSC::SyntaxChecker::setFunctionNameStart):
        * runtime/CodeCache.cpp:
        (JSC::CodeCache::getGlobalCodeBlock):
        (JSC::CodeCache::getProgramCodeBlock):
        (JSC::CodeCache::getEvalCodeBlock):
        (JSC::CodeCache::getFunctionExecutableFromGlobalCode):
        * runtime/CodeCache.h:
        * runtime/Executable.cpp:
        (JSC::ScriptExecutable::newCodeBlockFor):
        (JSC::FunctionExecutable::FunctionExecutable):
        (JSC::ProgramExecutable::initializeGlobalProperties):
        (JSC::FunctionExecutable::fromGlobalCode):
        * runtime/Executable.h:
        (JSC::ExecutableBase::isEvalExecutable):
        (JSC::ExecutableBase::isProgramExecutable):
        (JSC::ScriptExecutable::ScriptExecutable):
        (JSC::ScriptExecutable::endColumn):
        (JSC::ScriptExecutable::recordParse):
        (JSC::FunctionExecutable::create):
        (JSC::FunctionExecutable::bodyIncludesBraces):
        * runtime/FunctionConstructor.cpp:
        (JSC::constructFunctionSkippingEvalEnabledCheck):
        * runtime/FunctionPrototype.cpp:
        (JSC::insertSemicolonIfNeeded):
        (JSC::functionProtoFuncToString):
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::createProgramCodeBlock):
        (JSC::JSGlobalObject::createEvalCodeBlock):

1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
2013-11-19  Dean Jackson  <dino@apple.com>

        MarkedSpace::resumeAllocating needs to delay release
        https://bugs.webkit.org/show_bug.cgi?id=124596

        Reviewed by Geoffrey Garen.

        * heap/MarkedSpace.cpp:
        (JSC::MarkedSpace::resumeAllocating): Add DelayedReleaseScope protection.

1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
2013-11-19  Mark Hahnenberg  <mhahnenberg@apple.com>

        IncrementalSweeper needs to use DelayedReleaseScope too
        https://bugs.webkit.org/show_bug.cgi?id=124558

        Reviewed by Filip Pizlo.

        It does sweeping too, so it needs to use it. Also refactored an
        ASSERT that should have caught this sooner.

        * heap/DelayedReleaseScope.h:
        (JSC::DelayedReleaseScope::isInEffectFor):
        * heap/IncrementalSweeper.cpp:
        (JSC::IncrementalSweeper::doSweep):
        * heap/MarkedBlock.cpp:
        (JSC::MarkedBlock::sweep):
        * heap/MarkedSpace.cpp:
        (JSC::MarkedSpace::sweep):

1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
2013-11-18  Michael Saboff  <msaboff@apple.com>

        ARM64 CRASH: Debug builds crash in emitPointerValidation()
        https://bugs.webkit.org/show_bug.cgi?id=124545

        Reviewed by Filip Pizlo.

        Changed emitPointerValidation() to use pushToSave() and popToRestore() as
        all macro assemblers have an implementation of these functions.

        * jit/ThunkGenerators.cpp:
        (JSC::emitPointerValidation):

1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
2013-11-18  Michael Saboff  <msaboff@apple.com>

        ARM64: Update getHostCallReturnValue() to use architected frame pointer register
        https://bugs.webkit.org/show_bug.cgi?id=124520

        Reviewed by Filip Pizlo.

        Changed from using the prior JSC specific x25 callframe register to the ARM64
        architected x29 (fp) register.  This change should have been done as part of
        https://bugs.webkit.org/show_bug.cgi?id=123956.

        * jit/JITOperations.cpp:

1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
2013-11-18  Filip Pizlo  <fpizlo@apple.com>

        put_to_scope[5] should not point to the structure if it's a variable access, but it should point to the WatchpointSet
        https://bugs.webkit.org/show_bug.cgi?id=124539

        Reviewed by Mark Hahnenberg.
        
        This is in preparation for getting put_to_scope to directly invalidate the watchpoint set
        on stores, which will allow us to run constant inference on all globals.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::CodeBlock):
        (JSC::CodeBlock::finalizeUnconditionally):
        * bytecode/Instruction.h:
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parseBlock):
        * runtime/JSScope.cpp:
        (JSC::abstractAccess):
        (JSC::JSScope::abstractResolve):
        * runtime/JSScope.h:
        (JSC::ResolveOp::ResolveOp):
        * runtime/SymbolTable.h:
        (JSC::SymbolTableEntry::watchpointSet):

1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
2013-11-18  Mark Hahnenberg  <mhahnenberg@apple.com>

        APIEntryShims need some love
        https://bugs.webkit.org/show_bug.cgi?id=124540

        Reviewed by Filip Pizlo.

        We were missing them in key places which some other hacking revealed. These could have manifested as
        race conditions for VMs being used in multithreaded environments.

        * API/JSContext.mm:
        (-[JSContext setException:]):
        (-[JSContext wrapperForObjCObject:]):
        (-[JSContext wrapperForJSObject:]):
        * API/JSContextRef.cpp:
        (JSContextGroupRelease):
        (JSGlobalContextRelease):
        * API/JSManagedValue.mm:
        (-[JSManagedValue initWithValue:]):
        (-[JSManagedValue value]):
        * API/JSObjectRef.cpp:
        (JSObjectIsFunction):
        (JSObjectCopyPropertyNames):
        * API/JSValue.mm:
        (containerValueToObject):
        * API/JSWrapperMap.mm:
        (tryUnwrapObjcObject):

1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
2013-11-18  Filip Pizlo  <fpizlo@apple.com>

        Allow the FTL debug dumps to include the new size field
        https://bugs.webkit.org/show_bug.cgi?id=124479

        Reviewed by Mark Hahnenberg.

        * ftl/FTLStackMaps.cpp:
        (JSC::FTL::StackMaps::Location::parse):
        (JSC::FTL::StackMaps::Location::dump):
        * ftl/FTLStackMaps.h:

1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
2013-11-18  peavo@outlook.com  <peavo@outlook.com>

        [Win] Link fails when DFG JIT is enabled.
        https://bugs.webkit.org/show_bug.cgi?id=123614

        Reviewed by Brent Fulgham.

        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Added new files.
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.

1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
2013-11-18  Julien Brianceau  <jbriance@cisco.com>

        [sh4] Add missing implementation in MacroAssembler to fix build (broken since r159395).
        https://bugs.webkit.org/show_bug.cgi?id=124484

        Reviewed by Michael Saboff.

        * assembler/MacroAssemblerSH4.h:
        (JSC::MacroAssemblerSH4::load8):
        (JSC::MacroAssemblerSH4::branch8):

1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
2013-11-18  Michael Saboff  <msaboff@apple.com>

        ARM64 CRASH: Improper offset in getHostCallReturnValue() to access callerFrame in CallFrame
        https://bugs.webkit.org/show_bug.cgi?id=124481

        Reviewed by Mark Lam.

        Fixed the offset to access CallerFrame in the ARM64 version of getHostCallReturnValue() to be 0
        to correspond with the change in CallFrame layout done in r158315.

        * jit/JITOperations.cpp:

1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
2013-11-18  Michael Saboff  <msaboff@apple.com>

        Crash in virtualForThunkGenerator generated code on ARM64
        https://bugs.webkit.org/show_bug.cgi?id=124447

        Reviewed by Geoffrey Garen.

        The baseline JIT generates slow path call code with the caller in regT0.  The DFG
        generates call code with the caller in nonArgGPR0.  The virtualForThunkGenerator
        generates code with the caller in nonArgGPR0.  For X86 and X86_64, regT0 and nonArgGPR0
        are the same CPU register, eax.  For other platforms this isn't the case.  The same
        issue exists for JSVALUE32_64 ports as well, where there also is an issue with the callee
        tag registers being regT1 and nonArgGPR1 in the various locations.

        Changed nonArgGPR0, nonArgGPR1 and nonArgGPR2 for X86 and X86_64 to not match up with
        regT0-2.  Changing these registers will cause a crash on all ports should we have a
        similar problem in the future.  Changed the DFG call generating code to use regT0 and
        regT1.  Now all slow path call code is generated using regT0 and for JSVALUE32_64 regT1.
        Added r12 to X86_64 as a new temp register (regT9) and moved r13 down to regT10.
        The new temp register decreases the likelihood of inadvertant register overlap.

        * dfg/DFGSpeculativeJIT32_64.cpp:
        (JSC::DFG::SpeculativeJIT::emitCall):
        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::emitCall):
        * jit/GPRInfo.h:
        (JSC::GPRInfo::toRegister):
        (JSC::GPRInfo::toIndex):
        * jit/ThunkGenerators.cpp:
        (JSC::virtualForThunkGenerator):

1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
2013-11-18  Balazs Kilvady  <kilvadyb@homejinni.com>

        Add missing load8/branch8 with AbsoluteAddress parameter to MIPS port.

        [MIPS] Build fails since r159395.
        https://bugs.webkit.org/show_bug.cgi?id=124491

        Reviewed by Michael Saboff.

        * assembler/MacroAssemblerMIPS.h:
        (JSC::MacroAssemblerMIPS::load8):
        (JSC::MacroAssemblerMIPS::branch8):

1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
2013-11-18  Csaba Osztrogonác  <ossy@webkit.org>

        REGRESSION(r159351): It made zillion tests assert on !CF platforms
        https://bugs.webkit.org/show_bug.cgi?id=124490

        Reviewed by Mark Hahnenberg.

        * heap/MarkedSpace.cpp:
        (JSC::MarkedSpace::sweep):

1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
2013-11-18  Julien Brianceau  <jbriance@cisco.com>

        Remove architecture specific code in LowLevelInterpreter.
        https://bugs.webkit.org/show_bug.cgi?id=124501

        Reviewed by Michael Saboff.

        * llint/LowLevelInterpreter.asm: Use generic path instead of sh4 specific code.
        * llint/LowLevelInterpreter32_64.asm: Merge sh4/mips path with arm path. The
        "move t0, a0" is not needed for arm because t0 == a0 with this architecture.
        * offlineasm/sh4.rb: Handle move opcode with pr register.

1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
2013-11-18  Julien Brianceau  <jbriance@cisco.com>

        [arm] Add missing implementation in MacroAssembler to fix build (broken since r159395).
        https://bugs.webkit.org/show_bug.cgi?id=124488

        Reviewed by Zoltan Herczeg.

        * assembler/MacroAssemblerARM.h:
        (JSC::MacroAssemblerARM::branch8):

1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
2013-11-17  Julien Brianceau  <jbriance@cisco.com>

        [sh4] Fix revertJumpReplacementToBranchPtrWithPatch in MacroAssembler.
        https://bugs.webkit.org/show_bug.cgi?id=124468

        Reviewed by Michael Saboff.

        Current implementation of revertJumpReplacementToBranchPtrWithPatch is wrong in
        the sh4 MacroAssembler part, leading to random instabilities. This patch fixes it
        and also renames the bad-named revertJumpToMove to revertJumpReplacementToBranchPtrWithPatch
        in the SH4Assembler.

        * assembler/MacroAssemblerSH4.h:
        (JSC::MacroAssemblerSH4::revertJumpReplacementToBranchPtrWithPatch):
        * assembler/SH4Assembler.h:
        (JSC::SH4Assembler::replaceWithJump):
        (JSC::SH4Assembler::revertJumpReplacementToBranchPtrWithPatch):

1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
2013-11-16  Filip Pizlo  <fpizlo@apple.com>

        Simplify WatchpointSet state tracking
        https://bugs.webkit.org/show_bug.cgi?id=124465

        Reviewed by Sam Weinig.
        
        We previously represented the state of watchpoint sets using two booleans. But that
        makes it awkward to case over the state.
        
        We also previously supported a watchpoint set being both watched and invalidated. We
        never used that capability, and its presence was just purely confusing.
        
        This turns the whole thing into an enum.

        * assembler/MacroAssemblerARM64.h:
        (JSC::MacroAssemblerARM64::branch8):
        * assembler/MacroAssemblerARMv7.h:
        (JSC::MacroAssemblerARMv7::branch8):
        * assembler/MacroAssemblerX86.h:
        (JSC::MacroAssemblerX86::branch8):
        * assembler/MacroAssemblerX86_64.h:
        (JSC::MacroAssemblerX86_64::branch8):
        * bytecode/Watchpoint.cpp:
        (JSC::WatchpointSet::WatchpointSet):
        (JSC::WatchpointSet::add):
        (JSC::WatchpointSet::notifyWriteSlow):
        (JSC::InlineWatchpointSet::inflateSlow):
        * bytecode/Watchpoint.h:
        (JSC::WatchpointSet::state):
        (JSC::WatchpointSet::isStillValid):
        (JSC::WatchpointSet::startWatching):
        (JSC::WatchpointSet::notifyWrite):
        (JSC::WatchpointSet::addressOfState):
        (JSC::InlineWatchpointSet::InlineWatchpointSet):
        (JSC::InlineWatchpointSet::hasBeenInvalidated):
        (JSC::InlineWatchpointSet::startWatching):
        (JSC::InlineWatchpointSet::notifyWrite):
        (JSC::InlineWatchpointSet::decodeState):
        (JSC::InlineWatchpointSet::encodeState):
        * jit/JITPropertyAccess.cpp:
        (JSC::JIT::emitVarInjectionCheck):
        * jit/JITPropertyAccess32_64.cpp:
        (JSC::JIT::emitVarInjectionCheck):
        * llint/LowLevelInterpreter.asm:
        * llint/LowLevelInterpreter32_64.asm:
        * llint/LowLevelInterpreter64.asm:
        * runtime/JSFunction.cpp:
        (JSC::JSFunction::JSFunction):
        * runtime/JSFunctionInlines.h:
        (JSC::JSFunction::JSFunction):
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::JSGlobalObject):
        * runtime/Structure.cpp:
        (JSC::Structure::Structure):
        * runtime/SymbolTable.cpp:
        (JSC::SymbolTableEntry::attemptToWatch):
        * runtime/SymbolTable.h:

1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2013-11-16  Filip Pizlo  <fpizlo@apple.com>

        FTL should have an explicit notion of bytecode liveness
        https://bugs.webkit.org/show_bug.cgi?id=124181

        Reviewed by Sam Weinig.
        
        This makes FTL OSR exit use bytecode liveness analysis to determine which variables
        to include values for. The decision of how to get the values of variables is based on
        forward propagation of MovHints and SetLocals.
        
        This fixes a bunch of bugs (like https://bugs.webkit.org/show_bug.cgi?id=124138 but
        also others that I noticed when I started writing more targetted tests) and allows us
        to remove some sketchy code.

        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bytecode/BytecodeBasicBlock.h:
        * bytecode/BytecodeLivenessAnalysis.cpp:
        (JSC::isValidRegisterForLiveness):
        (JSC::setForOperand):
        (JSC::computeUsesForBytecodeOffset):
        (JSC::computeDefsForBytecodeOffset):
        (JSC::stepOverInstruction):
        (JSC::computeLocalLivenessForBytecodeOffset):
        (JSC::BytecodeLivenessAnalysis::runLivenessFixpoint):
        (JSC::BytecodeLivenessAnalysis::operandIsLiveAtBytecodeOffset):
        (JSC::getLivenessInfo):
        (JSC::BytecodeLivenessAnalysis::getLivenessInfoAtBytecodeOffset):
        (JSC::BytecodeLivenessAnalysis::computeFullLiveness):
        * bytecode/BytecodeLivenessAnalysis.h:
        * bytecode/BytecodeLivenessAnalysisInlines.h: Added.
        (JSC::operandIsAlwaysLive):
        (JSC::operandThatIsNotAlwaysLiveIsLive):
        (JSC::operandIsLive):
        * bytecode/CodeBlock.h:
        (JSC::CodeBlock::captureCount):
        (JSC::CodeBlock::captureStart):
        (JSC::CodeBlock::captureEnd):
        * bytecode/CodeOrigin.cpp:
        (JSC::InlineCallFrame::dumpInContext):
        * bytecode/FullBytecodeLiveness.h: Added.
        (JSC::FullBytecodeLiveness::FullBytecodeLiveness):
        (JSC::FullBytecodeLiveness::getOut):
        (JSC::FullBytecodeLiveness::operandIsLive):
        (JSC::FullBytecodeLiveness::getLiveness):
        * dfg/DFGAvailability.cpp: Added.
        (JSC::DFG::Availability::dump):
        (JSC::DFG::Availability::dumpInContext):
        * dfg/DFGAvailability.h: Added.
        (JSC::DFG::Availability::Availability):
        (JSC::DFG::Availability::unavailable):
        (JSC::DFG::Availability::withFlush):
        (JSC::DFG::Availability::withNode):
        (JSC::DFG::Availability::withUnavailableNode):
        (JSC::DFG::Availability::nodeIsUndecided):
        (JSC::DFG::Availability::nodeIsUnavailable):
        (JSC::DFG::Availability::hasNode):
        (JSC::DFG::Availability::node):
        (JSC::DFG::Availability::flushedAt):
        (JSC::DFG::Availability::operator!):
        (JSC::DFG::Availability::operator==):
        (JSC::DFG::Availability::merge):
        (JSC::DFG::Availability::mergeNodes):
        (JSC::DFG::Availability::unavailableMarker):
        * dfg/DFGBasicBlock.h:
        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parseBlock):
        * dfg/DFGDisassembler.cpp:
        (JSC::DFG::Disassembler::Disassembler):
        * dfg/DFGFlushFormat.cpp:
        (WTF::printInternal):
        * dfg/DFGFlushFormat.h:
        (JSC::DFG::resultFor):
        (JSC::DFG::useKindFor):
        (JSC::DFG::dataFormatFor):
        * dfg/DFGFlushedAt.cpp:
        (JSC::DFG::FlushedAt::dump):
        * dfg/DFGFlushedAt.h:
        (JSC::DFG::FlushedAt::FlushedAt):
        (JSC::DFG::FlushedAt::merge):
        * dfg/DFGGraph.cpp:
        (JSC::DFG::Graph::dump):
        (JSC::DFG::Graph::livenessFor):
        (JSC::DFG::Graph::isLiveInBytecode):
        * dfg/DFGGraph.h:
        (JSC::DFG::Graph::baselineCodeBlockFor):
        * dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
        (JSC::DFG::OSRAvailabilityAnalysisPhase::run):
        * dfg/DFGOSRAvailabilityAnalysisPhase.h:
        * dfg/DFGPlan.cpp:
        (JSC::DFG::Plan::compileInThreadImpl):
        * dfg/DFGResurrectionForValidationPhase.cpp: Added.
        (JSC::DFG::ResurrectionForValidationPhase::ResurrectionForValidationPhase):
        (JSC::DFG::ResurrectionForValidationPhase::run):
        (JSC::DFG::performResurrectionForValidation):
        * dfg/DFGResurrectionForValidationPhase.h: Added.
        * dfg/DFGSSAConversionPhase.cpp:
        (JSC::DFG::SSAConversionPhase::run):
        * dfg/DFGValueSource.h:
        (JSC::DFG::ValueSource::forFlushFormat):
        * dfg/DFGVariableAccessData.h:
        * ftl/FTLExitValue.cpp:
        (JSC::FTL::ExitValue::dumpInContext):
        * ftl/FTLInlineCacheSize.cpp:
        (JSC::FTL::sizeOfGetById):
        * ftl/FTLLocation.cpp:
        (JSC::FTL::Location::gpr):
        (JSC::FTL::Location::fpr):
        (JSC::FTL::Location::directGPR):
        * ftl/FTLLowerDFGToLLVM.cpp:
        (JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM):
        (JSC::FTL::LowerDFGToLLVM::compileBlock):
        (JSC::FTL::LowerDFGToLLVM::compileNode):
        (JSC::FTL::LowerDFGToLLVM::compileSetLocal):
        (JSC::FTL::LowerDFGToLLVM::compileZombieHint):
        (JSC::FTL::LowerDFGToLLVM::compilePutById):
        (JSC::FTL::LowerDFGToLLVM::compileInvalidationPoint):
        (JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock):
        (JSC::FTL::LowerDFGToLLVM::appendOSRExit):
        (JSC::FTL::LowerDFGToLLVM::emitOSRExitCall):
        (JSC::FTL::LowerDFGToLLVM::buildExitArguments):
        (JSC::FTL::LowerDFGToLLVM::addExitArgumentForNode):
        (JSC::FTL::LowerDFGToLLVM::observeMovHint):
        * ftl/FTLOutput.h:
        (JSC::FTL::Output::alloca):
        * ftl/FTLValueSource.cpp: Removed.
        * ftl/FTLValueSource.h: Removed.
        * llvm/LLVMAPIFunctions.h:
        * runtime/DumpContext.cpp:
        (JSC::DumpContext::DumpContext):
        * runtime/DumpContext.h:
        * runtime/Options.h:
        * runtime/SymbolTable.h:
        (JSC::SharedSymbolTable::captureStart):
        (JSC::SharedSymbolTable::captureEnd):
        (JSC::SharedSymbolTable::captureCount):

2119
2120
2121
2122
2123
2124
2125
2126
2013-11-16  Filip Pizlo  <fpizlo@apple.com>

        Fix indentation of JSActivation.h.

        Rubber stamped by Mark Hahnenberg.

        * runtime/JSActivation.h:

2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2013-11-16  Filip Pizlo  <fpizlo@apple.com>

        Fix indentation of JSVariableObject.h.

        Rubber stamped by Mark Hahnenberg.
        
        I'm about to do some damage to this file. I wanted to give it some sanity first.

        * runtime/JSVariableObject.h:

2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2013-11-16  Julien Brianceau  <jbriance@cisco.com>

        [sh4] Fix build (broken since r159346).
        https://bugs.webkit.org/show_bug.cgi?id=124455

        Reviewed by Oliver Hunt.

        Fix LLINT implementation for sh4 architecture to handle properly load and store operations with pr register.

        * offlineasm/sh4.rb:

2148
2149
2150
2151
2152
2153
2154
2155
2156
2013-11-15  Alexey Proskuryakov  <ap@apple.com>

        Support exporting symmetric keys as JWK
        https://bugs.webkit.org/show_bug.cgi?id=124442

        Reviewed by Sam Weinig.

        * runtime/JSONObject.h: Export JSONStringify.

2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2013-11-15  peavo@outlook.com  <peavo@outlook.com>

        [Win] JavaScript crashes on 64-bit with JIT enabled.
        https://bugs.webkit.org/show_bug.cgi?id=124409

        Reviewed by Michael Saboff.

        These are issues found with JIT on 64-bit:
        - The registers rsi and rdi in callToJavaScript needs to be saved and restored. This is required by the Windows 64-bit ABI.
        - The getHostCallReturnValue function needs to be updated according to it's GCC counterpart.
        - The poke argument offset needs to be 20h, because Windows 64-bit ABI requires stack space allocated for the 4 argument registers.

        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Re-added JITStubsMSVC64.asm to project.
        * jit/CCallHelpers.h: Set poke argument offset.
        (JSC::CCallHelpers::setupArguments): Compile fix, added needed method.
        * jit/JITStubsMSVC64.asm: Save and restore registers rsi and rdi.
                                  Update getHostCallReturnValue according to the GCC version.

2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2013-11-14  David Farler  <dfarler@apple.com>

        Copy ASAN flag settings to WebCore and JavaScriptCore intermediate build tools
        https://bugs.webkit.org/show_bug.cgi?id=124362

        Reviewed by David Kilzer.

        * Configurations/ToolExecutable.xcconfig:
        Use ASAN_C*FLAGS.

mhahnenberg@apple.com's avatar
mhahnenberg@apple.com committed
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2013-11-15  Mark Hahnenberg  <mhahnenberg@apple.com>

        Remove JSChunk
        https://bugs.webkit.org/show_bug.cgi?id=124435

        Reviewed by Geoffrey Garen.

        It's empty and has been since it was added 3 years ago.

        * CMakeLists.txt:
        * runtime/JSChunk.cpp: Removed.
        * runtime/JSChunk.h: Removed.

mhahnenberg@apple.com's avatar
mhahnenberg@apple.com committed
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2013-11-15  Mark Hahnenberg  <mhahnenberg@apple.com>

        Remove VTableSpectrum
        https://bugs.webkit.org/show_bug.cgi?id=124427

        Reviewed by Filip Pizlo.

        * CMakeLists.txt:
        * GNUmakefile.list.am:
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * heap/Heap.cpp:
        (JSC::Heap::lastChanceToFinalize):
        * heap/Heap.h:
        * heap/MarkedBlock.cpp:
        (JSC::MarkedBlock::callDestructor):
        * heap/SlotVisitor.cpp:
        (JSC::visitChildren):
        * heap/SlotVisitor.h:
        * heap/VTableSpectrum.cpp: Removed.
        * heap/VTableSpectrum.h: Removed.

2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2013-11-14  Mark Hahnenberg  <mhahnenberg@apple.com>

        -dealloc callbacks from wrapped Objective-C objects can happen at bad times
        https://bugs.webkit.org/show_bug.cgi?id=123821

        Reviewed by Darin Adler.

        Currently with the JSC Obj-C API, JS wrappers for client Obj-C objects retain their associated Obj-C 
        object. When they are swept, they release their Obj-C objects which can trigger a call to that 
        object's -dealloc method. These -dealloc methods can then call back into the same VM, which is not 
        allowed during sweeping or VM shutdown.

        We can handle this case by creating our own pool of Obj-C objects to be released when it is safe to do so.
        This is accomplished by using DelayedReleaseScope, an RAII-style object that will retain all objects
        that are unsafe to release until the end of the DelayedReleaseScope.

        * API/APIShims.h:
        (JSC::APICallbackShim::APICallbackShim):
        (JSC::APICallbackShim::vmForDropAllLocks):
        (JSC::APICallbackShim::execForDropAllLocks):
        * API/JSAPIWrapperObject.mm:
        (JSAPIWrapperObjectHandleOwner::finalize):
        * API/ObjCCallbackFunction.mm:
        (JSC::ObjCCallbackFunctionImpl::destroy):
        (JSC::ObjCCallbackFunction::destroy):
        * API/tests/testapi.mm:
        (-[TinyDOMNode initWithVirtualMachine:]):
        (-[TinyDOMNode dealloc]):
        (-[TinyDOMNode appendChild:]):
        (-[TinyDOMNode removeChildAtIndex:]):
        (-[EvilAllocationObject initWithContext:]):
        (-[EvilAllocationObject dealloc]):
        (-[EvilAllocationObject doEvilThingsWithContext:]):
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * heap/DelayedReleaseScope.h: Added.
        (JSC::DelayedReleaseScope::DelayedReleaseScope):
        (JSC::DelayedReleaseScope::~DelayedReleaseScope):
        (JSC::DelayedReleaseScope::releaseSoon):
        (JSC::MarkedSpace::releaseSoon):
        * heap/Heap.cpp:
        (JSC::Heap::collectAllGarbage):
        * heap/Heap.h:
        (JSC::Heap::releaseSoon):
        * heap/MarkedAllocator.cpp:
        (JSC::MarkedAllocator::allocateSlowCase):
        * heap/MarkedSpace.cpp:
        (JSC::MarkedSpace::MarkedSpace):
        (JSC::MarkedSpace::lastChanceToFinalize):
        (JSC::MarkedSpace::sweep):
        * heap/MarkedSpace.h:

2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2013-11-15  Michael Saboff  <msaboff@apple.com>

        REGRESSION (r158586): callToJavaScript needs to save return PC to Sentinel frame
        https://bugs.webkit.org/show_bug.cgi?id=124420

        Reviewed by Filip Pizlo.

        Save the return PC into the sentinel frame.

        * jit/JITStubsMSVC64.asm:
        * jit/JITStubsX86.h:
        * llint/LowLevelInterpreter32_64.asm:
        * llint/LowLevelInterpreter64.asm:

2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2013-11-14  Oliver Hunt  <oliver@apple.com>

        Make CLoop easier to build, and make it work
        https://bugs.webkit.org/show_bug.cgi?id=124359

        Reviewed by Geoffrey Garen.

        Add --cloop to build-jsc, build-webkit and friends.

        Also make CLoop build and work again - This meant adding a
        couple of missing ENABLE(DFG_JIT) blocks, and fixing a few 
        other references.

        * Configurations/FeatureDefines.xcconfig:
        * bytecode/BytecodeLivenessAnalysis.cpp:
        (JSC::computeUsesForBytecodeOffset):
        (JSC::computeDefsForBytecodeOffset):
        * bytecode/DFGExitProfile.cpp:
        * dfg/DFGCapabilities.cpp:
        * dfg/DFGCompilationKey.cpp:
        * dfg/DFGCompilationMode.cpp:
        * jit/JITExceptions.cpp:
        (JSC::genericUnwind):

2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2013-11-14  Michael Saboff  <msaboff@apple.com>

        REGRESSION (r159276): Fix lots of crashes for arm_traditional architecture.
        https://bugs.webkit.org/show_bug.cgi?id=124365

        Reviewed by Oliver Hunt.

        Crashes were caused by a mixup between regular registers and temporary registers in ARM_EXTRA_GPRS.

        * llint/LowLevelInterpreter32_64.asm: Warning, t3 != a3. It's safer to use an implementation using aX
        registers like the MIPS one for cCallX macros.
        * offlineasm/arm.rb: Rearrange ARM_EXTRA_GPRS according to the new register distribution in LLINT.

2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2013-11-14  Michael Saboff  <msaboff@apple.com>

        REGRESSION (r159276): rbp register overwritten in Win 64 version of callToJavascript stub
        https://bugs.webkit.org/show_bug.cgi?id=124361

        Reviewed by Oliver Hunt.

        Swapped operand ordering to: mov rax, rbp

        * jit/JITStubsMSVC64.asm:

2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2013-11-14  Julien Brianceau  <jbriance@cisco.com>

        REGRESSION (r159276): Fix lots of crashes for sh4 architecture.
        https://bugs.webkit.org/show_bug.cgi?id=124347

        Reviewed by Michael Saboff.

        Since r159276, we have (t4 == a0 == r4) and (t5 == a1 == r5) in LLINT for sh4.
        This leads to argument register trampling in cCallX macros, especially with cCall2
        macro when arg1 == t4.

        * llint/LowLevelInterpreter32_64.asm: Use a new "setargs" pseudo-op to setup arguments for sh4.
        * offlineasm/instructions.rb:
        * offlineasm/sh4.rb: Lower "setargs" pseudo-op to setup argument registers and prevent register trampling issues.

2349
2350
2351
2352
2353
2354
2355
2356
2357
2013-11-14  Julien Brianceau  <jbriance@cisco.com>

        Fix build for sh4 architectures (broken since r159276).
        https://bugs.webkit.org/show_bug.cgi?id=124344

        Reviewed by Csaba Osztrogonác.

        * offlineasm/sh4.rb: There is no fp alias for r14 register for sh4.

2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2013-11-13  Michael Saboff  <msaboff@apple.com>

        Change callToJavaScript thunk into an offline assembled stub
        https://bugs.webkit.org/show_bug.cgi?id=124251

        Reviewed by Geoffrey Garen.

        Changed callToJavaScript and throwNotCaught into stubs generated by the offline assembler.
        Added popCalleeSaves and pushCalleeSaves pseudo ops to the offline assembler to handle
        the saving and restoring of callee save registers.  Fixed callFrameRegister differences
        between arm traditional (r11) and arm Thumb2 (r7) in GPRInfo.h.  Also fixed implementation
        of pop & push in arm.rb.

        Since the offline assembler and therefore the LLInt don't work on Windows, the Windows stubs
        are handled as inline assembly in JITStubsX86.h and JITStubsMSVC64.asm.

        * dfg/DFGDriver.cpp:
        (JSC::DFG::compileImpl):
        * jit/GPRInfo.h:
        (JSC::GPRInfo::toIndex):
        (JSC::GPRInfo::debugName):
        * jit/JITCode.cpp:
        (JSC::JITCode::execute):
        * jit/JITExceptions.cpp:
        (JSC::genericUnwind):
        * jit/JITStubs.h:
        * jit/JITStubsMSVC64.asm:
        * jit/JITStubsX86.h:
        * jit/ThunkGenerators.cpp:
        * jit/ThunkGenerators.h:
        * llint/LLIntThunks.h:
        * llint/LowLevelInterpreter.asm:
        * llint/LowLevelInterpreter32_64.asm:
        * llint/LowLevelInterpreter64.asm:
        * offlineasm/arm.rb:
        * offlineasm/arm64.rb:
        * offlineasm/instructions.rb:
        * offlineasm/mips.rb:
        * offlineasm/registers.rb:
        * offlineasm/sh4.rb:
        * offlineasm/x86.rb:
        * runtime/VM.cpp:
        (JSC::VM::VM):
        * runtime/VM.h:

2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2013-11-13  Andy Estes  <aestes@apple.com>

        Fix the ARM64 build after recent JavaScriptCore changes
        https://bugs.webkit.org/show_bug.cgi?id=124315

        Reviewed by Michael Saboff.

        Based on patches by myself, Filip Pizlo, Benjamin Poulain, and Michael Saboff.

        * Configurations/JavaScriptCore.xcconfig: Hid the symbol for
        std::bad_function_call.
        * JavaScriptCore.xcodeproj/project.pbxproj: Marked
        MacroAssemblerARM64.h and ARM64Assembler.h as Private headers.
        * assembler/ARM64Assembler.h:
        (JSC::ARM64Assembler::executableOffsetFor):
        * assembler/MacroAssemblerARM64.h: Removed ARM64's executableCopy(),
        which was removed from other assembler backends in r157690.
        (JSC::MacroAssemblerARM64::shouldBlindForSpecificArch): Added.
        (JSC::MacroAssemblerARM64::lshift64): Added.
        (JSC::MacroAssemblerARM64::mul64): Added.
        (JSC::MacroAssemblerARM64::rshift64): Added.
        (JSC::MacroAssemblerARM64::convertInt64ToDouble): Added.
        (JSC::MacroAssemblerARM64::branchMul64): Added.
        (JSC::MacroAssemblerARM64::branchNeg64): Added.
        (JSC::MacroAssemblerARM64::scratchRegisterForBlinding): Added.
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::compileArithDiv): Changed
        SpeculateIntegerOperand to SpeculateInt32Operand,
        nodeCanIgnoreNegativeZero() to bytecodeCanIgnoreNegativeZero(), and
        nodeUsedAsNumber() to bytecodeUsesAsNumber().
        (JSC::DFG::SpeculativeJIT::compileArithMod): Changed
        nodeCanIgnoreNegativeZero() to bytecodeCanIgnoreNegativeZero().

oliver@apple.com's avatar
oliver@apple.com committed
2436
2437
2438
2439
2440
2441
2013-11-13  Oliver Hunt  <oliver@apple.com>

        Fix debug build.

        * parser/Parser.cpp:

2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2013-11-13  Tim Horton  <timothy_horton@apple.com>

        r159210 added a period where there previously wasn't one, breaking >100 tests

        Rubber-stamped by Oliver Hunt.

        * parser/Parser.cpp:
        (JSC::::logError):
        Remove the extra period.

2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2013-11-13  Oliver Hunt  <oliver@apple.com>

        REGRESSION (r158014): Many webpages throw stack overflow exceptions on iOS (because Parser::parseMemberExpression uses ~130K more stack)
        https://bugs.webkit.org/show_bug.cgi?id=124177

        Reviewed by Michael Saboff.

        This patch pushes error handling into NEVER_INLINE functions to perform
        the actual error message construction.  This dramatically reduces the
        stack usage of the Parser.  For the large functions (such as parseMemberExpression)
        the improvement is on the order of 2.5x reduction in stack usage.  For
        smaller functions the reduction is in the order of 5-6x.

        * parser/Parser.cpp:
        (JSC::::logError):
        * parser/Parser.h:

2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2013-11-13  Julien Brianceau  <jbriance@cisco.com>

        [sh4] Protect repatchCompact from flushConstantPool.
        https://bugs.webkit.org/show_bug.cgi?id=124278

        Reviewed by Michael Saboff.

        Random crashes may occur with sh4 architecture, when a flushConstantPool occurs in
        movlMemRegCompact. As in this case a branch opcode and the constant pool are put
        before the movlMemRegCompact, the branch itself is patched when calling repatchCompact
        instead of the mov instruction, which is really bad.

        * assembler/SH4Assembler.h:
        (JSC::SH4Assembler::repatchCompact): Handle this specific case and add an ASSERT.

2484
2485
2486
2487
2488
2489
2490
2491
2492
2013-11-12  Alexey Proskuryakov  <ap@apple.com>

        Disable WebCrypto on Mountain Lion
        https://bugs.webkit.org/show_bug.cgi?id=124261

        Rubber-stamped by Sam Weinig.

        * Configurations/FeatureDefines.xcconfig:

2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2013-11-12  Julien Brianceau  <jbriance@cisco.com>

        [sh4] Fix load32WithUnalignedHalfWords function in baseline JIT.
        https://bugs.webkit.org/show_bug.cgi?id=124233

        Reviewed by Michael Saboff.

        * assembler/MacroAssemblerSH4.h:
        (JSC::MacroAssemblerSH4::load32WithUnalignedHalfWords): Do not claim scratch register too early.
        Test already covered by fast/regex/pcre-test-1.

2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2013-11-12  Filip Pizlo  <fpizlo@apple.com>

        Liveness analysis should take less memory in CodeBlock when it is unused
        https://bugs.webkit.org/show_bug.cgi?id=124225

        Reviewed by Mark Hahnenberg.
        
        Basically, I turned CodeBlock::m_livenessAnalysis into a pointer that is null by
        default.

        * bytecode/BytecodeLivenessAnalysis.cpp:
        (JSC::BytecodeLivenessAnalysis::BytecodeLivenessAnalysis):
        (JSC::BytecodeLivenessAnalysis::runLivenessFixpoint):
        (JSC::BytecodeLivenessAnalysis::operandIsLiveAtBytecodeOffset):
        (JSC::BytecodeLivenessAnalysis::dumpResults):
        (JSC::BytecodeLivenessAnalysis::compute):
        * bytecode/BytecodeLivenessAnalysis.h:
        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::CodeBlock):
        * bytecode/CodeBlock.h:
        (JSC::CodeBlock::livenessAnalysis):

2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2013-11-11  Oliver Hunt  <oliver@apple.com>

        Support unprefixed deconstructing assignment
        https://bugs.webkit.org/show_bug.cgi?id=124172

        Reviewed by Mark Lam.

        Add support for unprefixed descontructive assignment.

        Happily non-reference types on the left hand side of an assignment
        are a runtime error, so we're able to defer validation of the binding
        pattern to codegen time when we're already doing a lot more work.

        We're also able to predicate our attempt to parse on the existence of
        '[' or '{' as they are not as common as other constructs. 

        * bytecompiler/NodesCodegen.cpp:
        (JSC::ArrayPatternNode::emitDirectBinding):
        * parser/ASTBuilder.h:
        * parser/Parser.cpp:
        (JSC::::createBindingPattern):
        (JSC::::tryParseDeconstructionPatternExpression):
        (JSC::::parseDeconstructionPattern):
        (JSC::::parseForStatement):
        (JSC::::parseAssignmentExpression):
        * parser/Parser.h:
        (JSC::Parser::createSavePoint):
        (JSC::Parser::restoreSavePoint):
        * parser/SyntaxChecker.h:

2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2013-11-12  Andy Estes  <aestes@apple.com>

        Run JavaScriptCore Objective-C API tests on all supported platforms
        https://bugs.webkit.org/show_bug.cgi?id=124214

        Reviewed by Mark Hahnenberg.

        Now that we support the API on iOS and on OS X 10.8, there's no reason
        to limit the tests to OS X 10.9 (or greater).

        * API/tests/CurrentThisInsideBlockGetterTest.h:
        * API/tests/CurrentThisInsideBlockGetterTest.mm:
        * API/tests/testapi.mm:

2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2013-08-02  Mark Hahnenberg  <mhahnenberg@apple.com>

        CodeBlocks should be able to determine bytecode liveness
        https://bugs.webkit.org/show_bug.cgi?id=118546

        Reviewed by Filip Pizlo.

        This will simplify some things in the DFG related to OSR exits and determining 
        which bytecode variables are live at which points during execution. It will
        also be useful for making our conservative GC scan more precise. Currently it 
        doesn't properly account for liveness while the DFG is running, so it will be 
        off by default behing a runtime Options flag.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bytecode/BytecodeBasicBlock.cpp: Added.
        (JSC::isBranch): Used to determine the end of basic blocks.
        (JSC::isUnconditionalBranch): Used to determine when a branch at the end of a 
        basic block can't possibly fall through to the next basic block in program order.
        (JSC::isTerminal): Also used to detect the end of a block.
        (JSC::isThrow):
        (JSC::isJumpTarget): Used to correctly separate basic blocks. Any jump destination 
        must be the head of its own basic block.
        (JSC::linkBlocks): Links two blocks together in a bi-direcitonal fashion.
        (JSC::computeBytecodeBasicBlocks): Creates a set of basic blocks given a particular 
        CodeBlock and links them together.
        * bytecode/BytecodeBasicBlock.h: Added.
        (JSC::BytecodeBasicBlock::isEntryBlock): Entry blocks are a special basic blocks 
        that indicate the beginning of the function.
        (JSC::BytecodeBasicBlock::isExitBlock): Exit blocks are a special basic block that 
        all blocks that exit the function have as a successor. Entry and exit blocks allows 
        the various code paths to be more regular.
        (JSC::BytecodeBasicBlock::leaderBytecodeOffset): The leader bytecode offset is the 
        bytecode offset of the first instruction in the block.
        (JSC::BytecodeBasicBlock::totalBytecodeLength): The total length of all the bytecodes 
        in this block.
        (JSC::BytecodeBasicBlock::bytecodeOffsets): The bytecode offsets in this particular 
        basic block. This Vector allows us to iterate over the bytecodes in reverse order 
        which wouldn't be possible normally since they are of variable size.
        (JSC::BytecodeBasicBlock::addPredecessor): Links a block to a specified predecessor. 
        Only creates one direction of the link.
        (JSC::BytecodeBasicBlock::addSuccessor): Same as addPredecessor, but for successors.
        (JSC::BytecodeBasicBlock::predecessors): Getter for predecessors.
        (JSC::BytecodeBasicBlock::successors): Getter for successors.
        (JSC::BytecodeBasicBlock::in): Getter for the liveness info at the head of the block.
        (JSC::BytecodeBasicBlock::out): Getter for the liveness info at  the tail of the block.
        (JSC::BytecodeBasicBlock::BytecodeBasicBlock):
        (JSC::BytecodeBasicBlock::addBytecodeLength): When creating basic blocks we call 
        this function when we want to add the next bytecode in program order to this block.
        * bytecode/BytecodeLivenessAnalysis.cpp: Added.
        (JSC::BytecodeLivenessAnalysis::BytecodeLivenessAnalysis):
        (JSC::numberOfCapturedVariables): Convenience wrapper. Returns the
        number of captured variables for a particular CodeBlock, or 0 if 
        the CodeBlock has no SymbolTable.
        (JSC::captureStart): Ditto, but for captureStart().
        (JSC::captureEnd): Ditto, but for captureEnd().
        (JSC::isValidRegisterForLiveness): Returns true if the liveness analysis should 
        track the liveness of a particular operand. We ignore constants, arguments, and 
        captured variables. We ignore arguments because they're live for the duration of 
        a function call. We ignore captured variables because we also treat them as live 
        for the duration of the function. This could probably be improved to be more precise, 
        but it didn't seem worth it for now.
        (JSC::setForOperand): Convenience wrapper that sets the bit in the provided bit 
        vector for the provided operand. It handles skipping over captured variables.
        (JSC::computeUsesForBytecodeOffset): Computes which operands are used by a particular bytecode.
        (JSC::computeDefsForBytecodeOffset): Computes which operands are defined by a particular 
        bytecode. Typically this is just the left-most operand.
        (JSC::findBasicBlockWithLeaderOffset): 
        (JSC::findBasicBlockForBytecodeOffset): Scans over basic blocks to find the block 
        which contains a particular bytecode offset.
        (JSC::computeLocalLivenessForBytecodeOffset): Computes block-local liveness from the 
        bottom of the block until a specified bytecode offset is reached. 
        (JSC::computeLocalLivenessForBlock): Computes liveness for the entire block and 
        stores the resulting liveness at the head.
        (JSC::BytecodeLivenessAnalysis::runLivenessFixpoint): Runs backward flow liveness 
        analysis to fixpoint.
        (JSC::BytecodeLivenessAnalysis::getLivenessInfoForNonCapturedVarsAtBytecodeOffset): 
        Slow path to get liveness info for non-captured, non-argument variable.
        (JSC::BytecodeLivenessAnalysis::operandIsLiveAtBytecodeOffset): 
        (JSC::BytecodeLivenessAnalysis::getLivenessInfoAtBytecodeOffset): Returns the liveness 
        info for both captured and non-captured vars at a particular bytecode offset.
        (JSC::BytecodeLivenessAnalysis::dumpResults): Dumps the output of the liveness analysis. 
        Controlled by new flag in Options.h/.cpp.
        (JSC::BytecodeLivenessAnalysis::compute): Creates bytecode basic blocks and runs 
        full liveness analysis.
        * bytecode/BytecodeLivenessAnalysis.h: Added.
        (JSC::BytecodeLivenessAnalysis::hasBeenComputed):
        (JSC::BytecodeLivenessAnalysis::computeIfNecessary):
        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::CodeBlock):
        * bytecode/CodeBlock.h:
        (JSC::CodeBlock::livenessAnalysis):
        * bytecode/PreciseJumpTargets.cpp: Refactored to be able to get the jump targets for 
        a particular bytecode offset for use during bytecode basic block construction.
        (JSC::getJumpTargetsForBytecodeOffset):
        (JSC::computePreciseJumpTargets):
        (JSC::findJumpTargetsForBytecodeOffset):
        * bytecode/PreciseJumpTargets.h:
        * runtime/Options.cpp:
        (JSC::Options::initialize):
        * runtime/Options.h:

2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2013-11-11  Andy Estes  <aestes@apple.com>

        [iOS] Define JSC_OBJC_API_ENABLED
        https://bugs.webkit.org/show_bug.cgi?id=124192

        Reviewed by Geoffrey Garen.

        * API/JSBase.h: JSC_OBJC_API_ENABLED should evaluate to true if
        TARGET_OS_IPHONE is true.
        * API/JSValue.h: Ensure CG types referenced later in the file are defined.

2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2013-11-12  Balazs Kilvady  <kilvadyb@homejinni.com>

        Fix undefined reference issues in JavaScriptCore build.
        https://bugs.webkit.org/show_bug.cgi?id=124152

        Reviewed by Michael Saboff.

        Missing includes added.

        * runtime/SymbolTable.cpp:

2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2013-11-12  Alexandru Chiculita  <achicu@adobe.com>

        Web Inspector: Crash when closing the Inspector while debugging an exception inside a breakpoint condition.
        https://bugs.webkit.org/show_bug.cgi?id=124078

        Reviewed by Joseph Pecoraro.

        The crash would happen because the Debugger is not designed to support nested
        breaks. For example, when the debugger handles a breakpoint and the Inspector
        executes a console command that would hit the breakpoint again, the Debugger
        will just ignore the breakpoint.

        There were no checks for conditions and actions. Because of that conditions and actions
        could trigger exceptions and breakpoints. This patch disables that functionality as it
        cannot be supported without a bigger rewrite of the code.

        * debugger/Debugger.cpp:
        (JSC::TemporaryPausedState::TemporaryPausedState):
        (JSC::TemporaryPausedState::~TemporaryPausedState):
        (JSC::Debugger::hasBreakpoint):
        (JSC::Debugger::pauseIfNeeded):
        * debugger/Debugger.h:

2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2013-11-12  Julien Brianceau  <jbriance@cisco.com>

        InvalidIndex shouldn't be private in GPRInfo and FPRInfo for sh4, mips and arm64 architectures.
        https://bugs.webkit.org/show_bug.cgi?id=124156

        Reviewed by Michael Saboff.

        * jit/FPRInfo.h:
        (JSC::FPRInfo::debugName):
        * jit/GPRInfo.h:
        (JSC::GPRInfo::debugName):

2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2013-11-11  Andreas Kling  <akling@apple.com>

        CodeBlock: Un-segment some Vectors.
        <https://webkit.org/b/124188>

        Turn some SegmentedVectors into Vectors where the final item count
        is known at CodeBlock construction time. This removes unnecessary
        allocation and indirection.

        I've got ~4.5 MB below SegmentedVector<ValueProfile>::ensureSegment
        on Membuster3 (peak, before pressure signal) so this should help
        take a bit of the edge off there.

        Reviewed by Geoffrey Garen.

2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2013-11-11  Filip Pizlo  <fpizlo@apple.com>

        Get rid of the lastResultRegister optimization in the baseline JIT
        https://bugs.webkit.org/show_bug.cgi?id=124171

        Rubber stamped by Mark Hahnenberg.
        
        The baseline JIT no longer needs amazing throughput. And this optimization has caused
        way too many OSR exit bugs. And it constrains how much we can do in the DFG/FTL. So,
        I'm getting rid of it.

        * dfg/DFGOSRExit.cpp:
        (JSC::DFG::OSRExit::OSRExit):
        (JSC::DFG::OSRExit::convertToForward):
        * dfg/DFGOSRExit.h:
        * dfg/DFGOSRExitCompiler32_64.cpp:
        (JSC::DFG::OSRExitCompiler::compileExit):
        * dfg/DFGOSRExitCompiler64.cpp:
        (JSC::DFG::OSRExitCompiler::compileExit):
        * dfg/DFGSpeculativeJIT.cpp:
        (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
        (JSC::DFG::SpeculativeJIT::compileMovHint):
        (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
        * dfg/DFGSpeculativeJIT.h:
        * ftl/FTLLowerDFGToLLVM.cpp:
        (JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM):
        (JSC::FTL::LowerDFGToLLVM::compileZombieHint):
        (JSC::FTL::LowerDFGToLLVM::compileInvalidationPoint):
        (JSC::FTL::LowerDFGToLLVM::appendOSRExit):
        (JSC::FTL::LowerDFGToLLVM::observeMovHint):
        * ftl/FTLOSRExit.cpp:
        (JSC::FTL::OSRExit::OSRExit):
        (JSC::FTL::OSRExit::convertToForward):
        * ftl/FTLOSRExit.h:
        * ftl/FTLOSRExitCompiler.cpp:
        (JSC::FTL::compileStub):
        * jit/JIT.cpp:
        (JSC::JIT::JIT):
        (JSC::JIT::privateCompileMainPass):
        (JSC::JIT::privateCompileSlowCases):
        * jit/JIT.h:
        (JSC::JIT::appendCall):
        * jit/JITArithmetic32_64.cpp:
        (JSC::JIT::emit_op_lshift):
        (JSC::JIT::emitRightShift):
        (JSC::JIT::emit_op_bitand):
        (JSC::JIT::emit_op_bitor):
        (JSC::JIT::emit_op_bitxor):
        (JSC::JIT::emit_op_inc):
        (JSC::JIT::emit_op_dec):
        * jit/JITCall.cpp:
        (JSC::JIT::emitPutCallResult):
        (JSC::JIT::compileLoadVarargs):
        * jit/JITInlines.h:
        (JSC::JIT::emitGetFromCallFrameHeaderPtr):
        (JSC::JIT::emitGetFromCallFrameHeader32):
        (JSC::JIT::emitGetFromCallFrameHeader64):
        (JSC::JIT::emitLoadTag):
        (JSC::JIT::emitLoadPayload):
        (JSC::JIT::emitLoad2):
        (JSC::JIT::emitGetVirtualRegister):
        (JSC::JIT::emitGetVirtualRegisters):
        (JSC::JIT::emitPutVirtualRegister):
        * jit/JITOpcodes.cpp:
        (JSC::JIT::emit_op_mov):
        (JSC::JIT::emit_op_catch):
        (JSC::JIT::emit_op_new_func):
        * jit/JITOpcodes32_64.cpp:
        (JSC::JIT::emit_op_mov):
        (JSC::JIT::emit_op_to_primitive):
        (JSC::JIT::emit_op_to_number):
        (JSC::JIT::emit_op_catch):
        * jit/JITPropertyAccess.cpp:
        (JSC::JIT::emit_op_resolve_scope):
        (JSC::JIT::emit_op_get_from_scope):
        (JSC::JIT::emit_op_put_to_scope):
        * jit/JITPropertyAccess32_64.cpp:
        (JSC::JIT::emit_op_get_by_val):
        (JSC::JIT::emit_op_get_by_id):
        (JSC::JIT::emit_op_get_by_pname):
        (JSC::JIT::emitResolveClosure):
        (JSC::JIT::emit_op_resolve_scope):
        (JSC::JIT::emit_op_get_from_scope):
        (JSC::JIT::emit_op_init_global_const):
        * jit/SlowPathCall.h:
        (JSC::JITSlowPathCall::call):

2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2013-11-11  Filip Pizlo  <fpizlo@apple.com>

        Remove ConstantFoldingPhase's weirdo compile-time optimization
        https://bugs.webkit.org/show_bug.cgi?id=124169

        Reviewed by Mark Hahnenberg.
        
        It turns out that this compile-time optimization doesn't optimize compile times
        anymore. Kill it with fire.

        * dfg/DFGConstantFoldingPhase.cpp:
        (JSC::DFG::ConstantFoldingPhase::foldConstants):

2843
2844
2845
2846
2847
2848
2849
2850
2851
2013-11-11  Filip Pizlo  <fpizlo@apple.com>

        Make bytecode dumping use the right opcode names for inc/dec.

        Rubber stamped by Mark Hahnenberg.

        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::dumpBytecode):

2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2013-11-10  Filip Pizlo  <fpizlo@apple.com>

        DFG Int52 boxing code may clobber the source without telling anyone
        https://bugs.webkit.org/show_bug.cgi?id=124137

        Reviewed by Mark Hahnenberg.

        * dfg/DFGSpeculativeJIT64.cpp:
        (JSC::DFG::SpeculativeJIT::boxInt52): This is called in places where source is expected to be unchanged. We never call this expecting super-amazing codegen. So, preserve the source's value the dumb way (by recovering it mathematically).
        * jit/AssemblyHelpers.h: Document the invariant for boxInt52.
        * jsc.cpp:
        (GlobalObject::finishCreation): It's been super annoying that sometimes we say noInline() and sometimes we say neverInlineFunction(). The LayoutTests harnesses ensure that we have something called noInline(), but it's great to also ensure that the shell has it.

2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2013-11-11  Oliver Hunt  <oliver@apple.com>

        ExtJS breaks with modern Array.prototype.values API due to use of with()
        https://bugs.webkit.org/show_bug.cgi?id=123440

        Reviewed by Beth Dakin.

        As with our attempt to make Arguments use the Array prototype, ExtJS has
        a weird dependency on not adding new APIs to core types.  In this case
        Array.prototype.values.  The fix is to remove it, and push for ES6 to drop
        the API.

        * runtime/ArrayPrototype.cpp:

2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2013-11-11  Gabor Rapcsanyi  <rgabor@webkit.org>

        Fix CPU(ARM_TRADITIONAL) build after r159039.
        https://bugs.webkit.org/show_bug.cgi?id=124149

        Reviewed by Geoffrey Garen.

        * assembler/ARMAssembler.h:
        (JSC::ARMAssembler::firstRegister):
        (JSC::ARMAssembler::lastRegister):
        (JSC::ARMAssembler::firstFPRegister):
        (JSC::ARMAssembler::lastFPRegister):
        * assembler/MacroAssemblerARM.h:
        * jit/FPRInfo.h:

2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
2013-11-09  Filip Pizlo  <fpizlo@apple.com>

        Switch FTL GetById/PutById IC's over to using AnyRegCC
        https://bugs.webkit.org/show_bug.cgi?id=124094

        Reviewed by Sam Weinig.
        
        This closes the loop on inline caches (IC's) in the FTL. The goal is to have IC's
        in LLVM-generated code that are just as efficient (if not more so) than what a
        custom JIT could do. As in zero sources of overhead. Not a single extra instruction
        or even register allocation pathology. We accomplish this by having two thingies in
        LLVM. First is the llvm.experimental.patchpoint intrinsic, which is sort of an
        inline machine code snippet that we can fill in with whatever we want and then
        modify subsequently. But you have only two choices of how to pass values to a
        patchpoint: (1) via the calling convention or (2) via the stackmap. Neither are good
        for operands to an IC (like the base pointer for a GetById, for example). (1) is bad
        because it results in things being pinned to certain registers a priori; a custom
        JIT (like the DFG) will not pin IC operands to any registers a priori but will allow
        the register allocator to do whatever it wants. (2) is bad because the operands may
        be spilled or may be represented in other crazy ways. You generally want an IC to
        have its operands in registers. Also, patchpoints only return values using the
        calling convention, which is unfortunate since it pins the return value to a
        register a priori. This is where the second thingy comes in: the AnyRegCC. This is
        a special calling convention only for use with patchpoints. It means that arguments
        passed "by CC" in the patchpoint can be placed in any register, and the register
        that gets used is reported as part of the stackmap. It also means that the return
        value (if there is one) can be placed in any register, and the stackmap will tell
        you which one it was. Thus, patchpoints combined with AnyRegCC mean that you not
        only get the kind of self-modifying code that you want for IC's, but you also get
        all of the register allocation goodness that a custom JIT would have given you.
        Except that you're getting it from LLVM and not a custom JIT. Awesome.
        
        Even though all of the fun stuff is on the LLVM side, this patch was harder than
        you'd expect.
        
        First the obvious bits:
        
        - IC patchpoints now use AnyRegCC instead of the C CC. (CC = calling convention.)
        
        - FTL::fixFunctionBasedOnStackMaps() now correctly figures out which registers the
          IC is supposed to use instead of assuming C CC argument registers.
        
        And then all of the stuff that broke and that this patch fixes:
        
        - IC sizing based on generating a dummy IC (what FTLInlineCacheSize did) is totally
          bad on x86-64, where various register permutations lead to bizarre header bytes
          and eclectic SIB encodings. I changed that to have magic constants, for now.
        
        - Slow path calls didn't preserve the CC return register.
        
        - Repatch's scratch register allocation would get totally confused if the operand
          registers weren't one of the DFG-style "temp" registers. And by "totally confused"
          I mean that it would crash.
        
        - We assumed that r10 is callee-saved. It's not. That one dude's PPT about x86-64
          cdecl that I found on the intertubes was not a trustworthy source of information,
          apparently.
        
        - Call repatching didn't know that the FTL does its IC slow calls via specially
          generated thunks. This was particularly fun to fix: basically, now when we relink
          an IC call in the FTL, we use the old call target to find the SlowPathCallKey,
          which tells us everything we need to know to generate (or look up) a new thunk for
          the new function we want to call.
        
        * assembler/MacroAssemblerCodeRef.h:
        (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
        (JSC::MacroAssemblerCodePtr::isEmptyValue):
        (JSC::MacroAssemblerCodePtr::isDeletedValue):
        (JSC::MacroAssemblerCodePtr::hash):
        (JSC::MacroAssemblerCodePtr::emptyValue):
        (JSC::MacroAssemblerCodePtr::deletedValue):
        (JSC::MacroAssemblerCodePtrHash::hash):
        (JSC::MacroAssemblerCodePtrHash::equal):
        * assembler/MacroAssemblerX86Common.h:
        * assembler/RepatchBuffer.h:
        (JSC::RepatchBuffer::RepatchBuffer):
        (JSC::RepatchBuffer::codeBlock):
        * ftl/FTLAbbreviations.h:
        (JSC::FTL::setInstructionCallingConvention):
        * ftl/FTLCompile.cpp:
        (JSC::FTL::fixFunctionBasedOnStackMaps):
        * ftl/FTLInlineCacheSize.cpp:
        (JSC::FTL::sizeOfGetById):
        (JSC::FTL::sizeOfPutById):
        * ftl/FTLJITFinalizer.cpp:
        (JSC::FTL::JITFinalizer::finalizeFunction):
        * ftl/FTLLocation.cpp:
        (JSC::FTL::Location::forStackmaps):
        * ftl/FTLLocation.h:
        * ftl/FTLLowerDFGToLLVM.cpp:
        (JSC::FTL::LowerDFGToLLVM::compileGetById):
        (JSC::FTL::LowerDFGToLLVM::compilePutById):
        * ftl/FTLOSRExitCompiler.cpp:
        (JSC::FTL::compileStub):
        * ftl/FTLSlowPathCall.cpp:
        * ftl/FTLSlowPathCallKey.h:
        (JSC::FTL::SlowPathCallKey::withCallTarget):
        * ftl/FTLStackMaps.cpp:
        (JSC::FTL::StackMaps::Location::directGPR):
        (JSC::FTL::StackMaps::Location::restoreInto):
        * ftl/FTLStackMaps.h:
        * ftl/FTLThunks.h:
        (JSC::FTL::generateIfNecessary):
        (JSC::FTL::keyForThunk):
        (JSC::FTL::Thunks::keyForSlowPathCallThunk):
        * jit/FPRInfo.h:
        (JSC::FPRInfo::toIndex):
        * jit/GPRInfo.h:
        (JSC::GPRInfo::toIndex):
        (JSC::GPRInfo::debugName):
        * jit/RegisterSet.cpp:
        (JSC::RegisterSet::calleeSaveRegisters):
        * jit/RegisterSet.h:
        (JSC::RegisterSet::filter):
        * jit/Repatch.cpp:
        (JSC::readCallTarget):
        (JSC::repatchCall):
        (JSC::repatchByIdSelfAccess):
        (JSC::tryCacheGetByID):
        (JSC::tryCachePutByID):
        (JSC::tryBuildPutByIdList):
        (JSC::resetGetByID):
        (JSC::resetPutByID):
        * jit/ScratchRegisterAllocator.h:
        (JSC::ScratchRegisterAllocator::lock):

oliver@apple.com's avatar
oliver@apple.com committed
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
2013-11-10  Oliver Hunt  <oliver@apple.com>

        Implement Set iterators
        https://bugs.webkit.org/show_bug.cgi?id=124129

        Reviewed by Antti Koivisto.

        Add Set iterator classes and implementations

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * runtime/CommonIdentifiers.h:
        * runtime/JSGlobalObject.cpp:
        * runtime/JSGlobalObject.h:
        * runtime/JSSetIterator.cpp: Added.
        (JSC::JSSetIterator::finishCreation):
        (JSC::JSSetIterator::visitChildren):
        (JSC::JSSetIterator::createPair):
        * runtime/JSSetIterator.h: Added.
        (JSC::JSSetIterator::createStructure):
        (JSC::JSSetIterator::create):
        (JSC::JSSetIterator::next):
        (JSC::JSSetIterator::JSSetIterator):
        * runtime/SetIteratorConstructor.cpp: Added.
        (JSC::SetIteratorConstructor::finishCreation):
        * runtime/SetIteratorConstructor.h: Added.
        (JSC::SetIteratorConstructor::create):
        (JSC::SetIteratorConstructor::createStructure):
        (JSC::SetIteratorConstructor::SetIteratorConstructor):
        * runtime/SetIteratorPrototype.cpp: Added.
        (JSC::SetIteratorPrototype::finishCreation):
        (JSC::SetIteratorPrototypeFuncIterator):
        (JSC::SetIteratorPrototypeFuncNext):
        * runtime/SetIteratorPrototype.h: Added.
        (JSC::SetIteratorPrototype::create):
        (JSC::SetIteratorPrototype::createStructure):
        (JSC::SetIteratorPrototype::SetIteratorPrototype):
        * runtime/SetPrototype.cpp:
        (JSC::SetPrototype::finishCreation):
        (JSC::setProtoFuncValues):
        (JSC::setProtoFuncEntries):
        (JSC::setProtoFuncKeys):

oliver@apple.com's avatar
oliver@apple.com committed
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083