f51aa98b527481420fb92c0bf850d5027b382213
[WebKit.git] / JavaScriptCore / ChangeLog
1 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
2
3         Reviewed by Alexey Proskuryakov.
4
5         Removed JSObject::call, since it just called JSObject::callAsFunction.
6
7         SunSpider reports no change.
8
9 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
10
11         Reviewed by Darin Adler.
12         
13         A little cleanup in the CodeGenerator.
14
15         * VM/CodeGenerator.cpp: A few changes here.
16
17         (1) Removed remaining cases of the old hack of putting "this" into the
18         symbol table; replaced with explicit tracking of m_thisRegister.
19
20         (2) Made m_thisRegister behave the same for function, eval, and program
21         code, removing the static programCodeThis() function.
22
23         (3) Added a feature to nix a ScopeNode's declaration stacks when done
24         compiling, to save memory.
25
26         (4) Removed code that copied eval declarations into special vectors: we
27         just use the originals in the ScopeNode now.
28         
29         * VM/CodeGenerator.h: Removed unneded parameters from the CodeGenerator
30         constructor: we just use get that data from the ScopeNode now.
31
32         * VM/Machine.cpp:
33         (KJS::Machine::execute): When executing an eval node, don't iterate a
34         special copy of its declarations; iterate the originals, instead.
35
36         * kjs/nodes.cpp: Moved responsibility for knowing what AST data to throw
37         away into the CodeGenerator. Nodes no longer call shrinkCapacity on
38         their data directly.
39         
40         * kjs/nodes.h: Changed FunctionStack to ref its contents, so declaration
41         data stays around even after we've thrown away the AST, unless we explicitly
42         throw away the declaration data, too. This is useful for eval code, which
43         needs to reference its declaration data at execution time. (Soon, it will
44         be useful for program code, too, since program code should do the same.)
45
46 2008-06-02  Adam Roben  <aroben@apple.com>
47
48         Build fix for non-AllInOne builds
49
50         * kjs/array_object.cpp: Added a missing #include.
51
52 2008-06-02  Kevin McCullough  <kmccullough@apple.com>
53
54         Took out accidental confilct lines I checked in.
55
56         * ChangeLog:
57
58 2008-06-02  Kevin McCullough  <kmccullough@apple.com>
59
60         Reviewed by Darin.
61
62         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
63         profiler
64         Implement Next Sibling pointers as groundwork for removing the recursion
65         limit in the profiler.
66
67         * profiler/ProfileNode.cpp: Also I renamed parentNode and headNode since
68         'node' is redundant.
69         (KJS::ProfileNode::ProfileNode): Initialize the nextSibling.
70         (KJS::ProfileNode::willExecute): If there are already children then the
71         new child needs to be the nextSibling of the last child.
72         (KJS::ProfileNode::didExecute):
73         (KJS::ProfileNode::addChild): Ditto.
74         (KJS::ProfileNode::stopProfiling):
75         (KJS::ProfileNode::sortTotalTimeDescending): For all of the sorting
76         algorithms once the children are sorted their nextSibling pointers need
77         to be reset to reflect the new order.
78         (KJS::ProfileNode::sortTotalTimeAscending):
79         (KJS::ProfileNode::sortSelfTimeDescending):
80         (KJS::ProfileNode::sortSelfTimeAscending):
81         (KJS::ProfileNode::sortCallsDescending):
82         (KJS::ProfileNode::sortCallsAscending):
83         (KJS::ProfileNode::sortFunctionNameDescending):
84         (KJS::ProfileNode::sortFunctionNameAscending):
85         (KJS::ProfileNode::resetChildrensSiblings): This new function simply
86         loops over all of the children and sets their nextSibling pointers to
87         the next child in the Vector
88         (KJS::ProfileNode::debugPrintData):
89         * profiler/ProfileNode.h:
90         (KJS::ProfileNode::parent):
91         (KJS::ProfileNode::setParent):
92         (KJS::ProfileNode::nextSibling):
93         (KJS::ProfileNode::setNextSibling):
94         (KJS::ProfileNode::totalPercent):
95         (KJS::ProfileNode::selfPercent):
96
97 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
98
99         Reviewed by Maciej Stachowiak.
100
101         Removed the recursion limit from JSObject::call, since the VM does
102         recursion checking now.
103
104         This should allow us to remove JSObject::call entirely, netting a small
105         speedup.
106
107         * kjs/object.cpp:
108         (KJS::JSObject::call):
109
110 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
111
112         Reviewed by Adele Peterson.
113
114         Added a specific affordance for avoiding stack overflow when converting
115         recursive arrays to string, in preparation for removing generic stack
116         overflow checking from JSObject::call.
117         
118         Tested by fast/js/toString-stack-overflow.html.
119
120 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
121
122         Reviewed by Alice Liu.
123         
124         Refactored some hand-rolled code to call ScopeChain::globalObject instead.
125
126 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
127
128         Reviewed by Darin Adler.
129         
130         Fixed ASSERT due to execution continuing after an exception is thrown
131         during array sort.
132
133         * kjs/array_instance.cpp:
134         (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key): Don't call the
135         custom comparator function if an exception has been thrown. Just return
136         1 for everything, so the sort completes quickly. (The result will be
137         thrown away.)
138
139 2008-05-30  Timothy Hatcher  <timothy@apple.com>
140
141         Made the starting line number of scripts be 1-based throughout the engine.
142         This cleans up script line numbers so they are all consistent now and fixes
143         some cases where script execution was shown as off by one line in the debugger.
144
145         No change in SunSpider.
146
147         Reviewed by Oliver Hunt.
148
149         * API/minidom.c:
150         (main): Pass a line number of 1 instead of 0 to parser().parse().
151         * API/testapi.c:
152         (main): Ditto. And removes a FIXME and changed an assertEqualsAsNumber
153         to use 1 instead of 2 for the line number.
154         * VM/Machine.cpp:
155         (KJS::callEval): Pass a line number of 1 instead of 0.
156         (KJS::Machine::debug): Use firstLine for WillExecuteProgram instead of
157         lastLine. Use lastLine for DidExecuteProgram instead of firstLine.
158         * kjs/DebuggerCallFrame.cpp:
159         (KJS::DebuggerCallFrame::evaluate): Pass a line number of 1 instead of
160         0 to parser().parse().
161         * kjs/Parser.cpp:
162         (KJS::Parser::parse): ASSERT startingLineNumber is greatter than 0. Change
163         the startingLineNumber to be 1 if it was less than or equal to 0. This is needed
164         for release builds to maintain compatibility with the JavaScriptCore API.
165         * kjs/function.cpp:
166         (KJS::globalFuncEval): Pass a line number of 1 instead of 0 to parser().parse().
167         * kjs/function_object.cpp:
168         (FunctionObjectImp::construct): Pass a line number of 1 instead of 0 to construct().
169         * kjs/lexer.cpp:
170         (Lexer::setCode): Made yylineno = startingLineNumber instead of adding 1.
171         * kjs/testkjs.cpp:
172         (functionRun): Pass a line number of 1 instead of 0 to Interpreter::evaluate().
173         (functionLoad): Ditto.
174         (prettyPrintScript): Ditto.
175         (runWithScripts): Ditto.
176         * profiler/Profiler.cpp:
177         (WebCore::createCallIdentifier): Removed a plus 1 of startingLineNumber.
178
179 2008-05-30  Alexey Proskuryakov  <ap@webkit.org>
180
181         Reviewed by Darin.
182
183         https://bugs.webkit.org/show_bug.cgi?id=19180
184         speed up SunSpider by optimizing immediate number cases
185
186         Also fixed a JavaScriptCore regression seen on PowerPC - we didn't clip left shift
187         parameter to 0...31.
188
189         0.5% improvement on SunSpider overall, although a 8.5 regression on bitops-3bit-bits-in-byte.
190
191         * VM/Machine.cpp:
192         (KJS::Machine::privateExecute):
193
194         * kjs/JSImmediate.h:
195         (KJS::JSImmediate::toTruncatedUInt32): Added. Same as getTruncatedInt32, but casts the result
196         to unsigned.
197
198 2008-05-30  Alexey Proskuryakov  <ap@webkit.org>
199
200         Reviewed by Oliver Hunt.
201
202         https://bugs.webkit.org/show_bug.cgi?id=19180
203         speed up SunSpider by optimizing immediate number cases
204
205         Also fixed two JavaScriptCore regressions seen on PowerPC - we didn't clip right shift
206         parameter to 0...31.
207
208         1.6% improvement on SunSpider, without significant regressions on any tests.
209
210         * VM/Machine.cpp:
211         (KJS::Machine::privateExecute):
212         Added fast paths for >>, ==, ===, !=, !==. Changed order of memory accesses in many
213         cases, making them less dependent on gcc's ability to properly assign registers. With this,
214         I could move exception checks back into slow code paths, and saw less randomness in general.
215
216         * kjs/JSImmediate.h:
217         (KJS::JSImmediate::rightShiftImmediateNumbers):
218         Added.
219
220 2008-05-29  Maciej Stachowiak  <mjs@apple.com>
221
222         Reviewed by Oliver.
223
224         - fixed <rdar://problem/5972943> REGRESSION(r33979): Flash clips do not play on cnn.com
225         
226         Finally blocks could clobber registers that had to remain live
227         until they returned. This patch takes a conservative approach and
228         makes sure that finally blocks do not reuse any registers that
229         were previously allocated for the function. In the future this
230         could probably be tightened up to be less profligate with the
231         register allocation.
232         
233         * VM/CodeGenerator.cpp:
234         (KJS::CodeGenerator::highestUsedRegister):
235         * VM/CodeGenerator.h:
236         * kjs/nodes.cpp:
237         (KJS::TryNode::emitCode):
238
239 2008-05-29  Steve Falkenburg  <sfalken@apple.com>
240
241         Build fix.
242
243         * kjs/array_instance.cpp:
244
245 2008-05-29  Alexey Proskuryakov  <ap@webkit.org>
246
247         Reviewed by Darin.
248
249         https://bugs.webkit.org/show_bug.cgi?id=19294
250         <rdar://problem/5969062> A crash when iterating over a sparse array backwards.
251
252         * kjs/array_instance.cpp: Turned sparseArrayCutoff into a macro, so that using max() on it
253         doesn't cause a PIC branch.
254         (KJS::ArrayInstance::increaseVectorLength): Added a comment about this function not
255         preserving class invariants.
256         (KJS::ArrayInstance::put): Update m_storage after reallocation. Move values that fit to
257         the vector from the map in all code paths.
258
259 2008-05-29  Thiago Macieira  <tjmaciei@trolltech.com>
260
261         Reviewed by Simon.
262
263         Fix compilation in Solaris with Sun CC
264
265         Lots of WebKit code uses C99 functions that, strict as it
266         is, the Solaris system doesn't provide in C++. So we must define them
267         for both GCC and the Sun CC.
268
269         * wtf/MathExtras.h:
270
271 2008-05-28  Oliver Hunt  <oliver@apple.com>
272
273         Reviewed by Anders.
274
275         Fix codegen for assignment being used as a function.
276
277         FunctionCallValueNode::emitCode failed to account for the
278         potential of the function expression to allocate arbitrary
279         registers.
280
281         * kjs/nodes.cpp:
282         (KJS::FunctionCallValueNode::emitCode):
283
284 2008-05-27  Geoffrey Garen  <ggaren@apple.com>
285
286         Reviewed by Tim Hatcher.
287
288         Fixed https://bugs.webkit.org/show_bug.cgi?id=19183
289         REGRESSION (r33979): Crash in DebuggerCallFrame::functionName when
290         clicking button in returnEvent-crash.html
291
292         Added two new debugger hooks, willExecuteProgram and didExecuteProgram,
293         along with code to generate them, code to invoke them when unwinding
294         due to an exception, and code to dump them.
295         
296         SunSpider reports no change.
297
298         * VM/CodeBlock.cpp:
299         (KJS::debugHookName): I had to mark this function NEVER_INLINE to avoid
300         a .4% performance regression. The mind boggles.
301
302 2008-05-28  Adam Roben  <aroben@apple.com>
303
304         Fix JavaScriptCore tests on OS X
305
306         We were quoting the path to testkjs too late, after it had already
307         been combined with spaces and other options.
308
309         * tests/mozilla/jsDriver.pl:
310         (top level): Move path quoting from here...
311         (sub get_kjs_engine_command): ...to here.
312
313 2008-05-28  Anders Carlsson  <andersca@apple.com>
314
315         Reviewed by Oliver.
316
317         <rdar://problem/5968071> "const f" crashes in JavaScriptCore
318         
319         Make sure to null check the initializer.
320         
321         * kjs/nodes.cpp:
322         (KJS::ConstDeclNode::emitCodeSingle):
323
324 2008-05-28  Adam Roben  <aroben@apple.com>
325
326         Make run-javascriptcore-tests work with a space in the path to testkjs
327
328         Reviewed by Alexey Proskuryakov.
329
330         * tests/mozilla/jsDriver.pl: Quote the path to the engine so that
331         spaces will be interpreted correctly.
332
333 2008-05-28  Alexey Proskuryakov  <ap@webkit.org>
334
335         Fixed a misguiding comment - my measurement for negative numbers only included cases
336         where both operands were negative, which is not very interesting.
337
338         * VM/Machine.cpp:
339
340 2008-05-28  Alexey Proskuryakov  <ap@webkit.org>
341
342         Reviewed by Maciej.
343
344         Based on a patch by Oliver Hunt.
345
346         https://bugs.webkit.org/show_bug.cgi?id=19180
347         speed up SunSpider by optimizing immediate number cases
348
349         1.4% speedup on SunSpider.
350
351         * VM/Machine.cpp:
352         (KJS::Machine::privateExecute):
353         * kjs/JSImmediate.h:
354         (KJS::JSImmediate::incImmediateNumber):
355         (KJS::JSImmediate::decImmediateNumber):
356         Added fast paths for ++ and --.
357
358         (KJS::JSImmediate::canDoFastAdditiveOperations): Corrected a comment.
359
360 2008-05-28  Alexey Proskuryakov  <ap@webkit.org>
361
362         Reviewed by Darin.
363
364         https://bugs.webkit.org/show_bug.cgi?id=19180
365         speed up SunSpider by optimizing immediate number cases
366
367         2% speedup overall, maximum 10% on controlflow-recursive and bitops-3bit-bits-in-byte,
368         but a 4% regression on bitops-bits-in-byte and bitops-bitwise-and.
369
370         * kjs/JSImmediate.h:
371         (KJS::JSImmediate::canDoFastAdditiveOperations):
372         (KJS::JSImmediate::addImmediateNumbers):
373         (KJS::JSImmediate::subImmediateNumbers):
374         Added fast cases that work with positive values less than 2^30.
375
376         * VM/Machine.cpp:
377         (KJS::Machine::privateExecute): Use the above operations. Also updated SunSpider frequencies
378         with my results (looks like tag values have changed, not sure what caused the minor variation
379         in actual frequencies).
380
381 2008-05-27  Adam Roben  <aroben@apple.com>
382
383         Windows build fix
384
385         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
386         Remove code that appended Cygwin's /bin directory to PATH.
387         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
388         Prepend Cygwin's /bin directory to PATH. We prepend instead of append
389         so that Cygwin's utilities will win out over Win32 versions of the
390         same utilities (particularly perl). We do the prepend here instead of
391         in the Makefile because nmake doesn't seem to like prepending to PATH
392         inside the Makefile. This also matches the way WebCoreGenerated works.
393
394 2008-05-27  Adam Roben  <aroben@apple.com>
395
396         Roll out r34163
397
398         A better fix is on the way.
399
400         * DerivedSources.make:
401         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
402
403 2008-05-27  Adam Roben  <aroben@apple.com>
404
405         Windows build fix
406
407         * DerivedSources.make: Don't generate the bytecode docs if
408         OMIT_BYTECODE_DOCS is set to 1.
409         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Set
410         OMIT_BYTECODE_DOCS for production builds.
411
412 2008-05-27  Anders Carlsson  <andersca@apple.com>
413
414         Reviewed by Geoff and Maciej.
415
416         <rdar://problem/5806428> 
417         https://bugs.webkit.org/show_bug.cgi?id=17925
418         Crash in KJS::JSObject::put after setting this.__proto__
419
420         Set slotIsWriteable to false for __proto__, we want setting __proto__ to go through JSObject::put instead.
421         
422         * kjs/object.h:
423         (KJS::JSObject::getOwnPropertySlotForWrite):
424
425 2008-05-27  Kevin Ollivier  <kevino@theolliviers.com>
426
427         wx build fixes to catch up with SquirrelFish, etc.
428
429         * JavaScriptCoreSources.bkl:
430         * jscore.bkl:
431         * wtf/Platform.h:
432
433 2008-05-27  Darin Adler  <darin@apple.com>
434
435         Reviewed by Tim Hatcher.
436
437         - https://bugs.webkit.org/show_bug.cgi?id=19180
438           speed up SunSpider by optimizing immediate number cases
439
440         Add immediate number cases for the &, |, and ^ operators.
441         Makes standalone SunSpider 1.010x faster.
442
443         * VM/Machine.cpp:
444         (KJS::Machine::privateExecute): Add areBothImmediateNumbers special cases
445         for the &, |, and ^ operators.
446
447         * kjs/JSImmediate.h:
448         (KJS::JSImmediate::xorImmediateNumbers): Added.
449         (KJS::JSImmediate::orImmediateNumbers): Added.
450
451 2008-05-26  Stephanie Lewis  <slewis@apple.com>
452
453         Windows build fix. 
454
455         * kjs/testkjs.cpp:
456
457 2008-05-26  Maciej Stachowiak  <mjs@apple.com>
458
459         Reviewed by Anders.
460         
461         - make addStaticGlobals protected instead of private so subclasses can use it
462
463         * JavaScriptCore.exp:
464         * kjs/JSGlobalObject.h:
465
466 2008-05-26  Geoffrey Garen  <ggaren@apple.com>
467
468         Reviewed by Darin Adler.
469         
470         Fixed <rdar://problem/5960859> After an eval of a non-string or a syntax
471         error, all profile stack frames are incorrect
472         
473         SunSpider reports a .3% speedup, possibly because eval of a string is a
474         little more efficient now.
475
476         * VM/Machine.cpp:
477         (KJS::callEval): Make sure to call didExecute when returning early. I
478         simplified this function to remove one early return, making the job
479         of adding special code to early returns easier.
480
481         (KJS::Machine::execute): Use the new function ExecState when notifying
482         the profiler. (This doesn't change behavior now, but it might prevent
483         subtle errors in the future.)
484
485 2008-05-23  Tor Arne Vestbø  <tavestbo@trolltech.com>
486
487         Reviewed by Simon.
488
489         Fixed toLower and toUpper implementations to allow being called
490         with a null result pointer and resultLength, to determine the
491         number of characters needed for the case conversion.
492
493         * wtf/unicode/qt4/UnicodeQt4.h:
494         (WTF::Unicode::toLower):
495         (WTF::Unicode::toUpper):
496
497 2008-05-25  Alexey Proskuryakov  <ap@webkit.org>
498
499         Fixing a typo in the previous commit made as a last minute change.
500
501         * kjs/regexp_object.cpp:
502
503 2008-05-24  Alexey Proskuryakov  <ap@webkit.org>
504
505         Reviewed by Darin.
506
507         Changed regular expression matching result array to be lazily filled, because many callers
508         only care about it being non-null.
509
510         2% improvement on Acid3 test 26.
511
512         * kjs/array_instance.cpp: Added a void* member to ArrayStorage for ArrayInstance subclasses
513         to use.
514         * kjs/array_instance.h:
515         (KJS::ArrayInstance::lazyCreationData):
516         (KJS::ArrayInstance::setLazyCreationData):
517         Added methods to access it from subclasses.
518
519         * kjs/regexp_object.cpp:
520         (KJS::RegExpMatchesArray::RegExpMatchesArray):
521         (KJS::RegExpMatchesArray::getOwnPropertySlot):
522         (KJS::RegExpMatchesArray::put):
523         (KJS::RegExpMatchesArray::deleteProperty):
524         (KJS::RegExpMatchesArray::getPropertyNames):
525         (KJS::RegExpMatchesArray::fillArrayInstanceIfNeeded):
526         (KJS::RegExpMatchesArray::~RegExpMatchesArray):
527         (KJS::RegExpObjectImp::arrayOfMatches):
528         RegExpMatchesArray is a subclass of ArrayInstance that isn't filled until
529         accessed for the first time.
530
531 2008-05-24  Alp Toker  <alp@nuanti.com>
532
533         Win32/gcc build fix. Remove MSVC assumption.
534
535         * wtf/TCSpinLock.h:
536         (TCMalloc_SlowLock):
537
538 2008-05-24  Oleg Finkelshteyn <olegfink@gmail.com>
539
540         Rubber-stamped, tweaked and landed by Alexey.
541
542         Build fix for gcc 4.3.
543
544         * JavaScriptCore/kjs/testkjs.cpp:
545         * JavaScriptCore/VM/CodeBlock.cpp:
546         Add missing standard includes.
547
548 2008-05-23  Anders Carlsson  <andersca@apple.com>
549
550         Reviewed by Geoff.
551
552         <rdar://problem/5959886> REGRESSION: Assertion failure in JSImmediate::toString when loading GMail (19217)
553         
554         Change List to store a JSValue*** pointer + an offset instead of a JSValue** pointer to protect against the case where 
555         a register file changes while a list object points to its buffer.
556         
557         * VM/Machine.cpp:
558         (KJS::Machine::privateExecute):
559         * kjs/JSActivation.cpp:
560         (KJS::JSActivation::createArgumentsObject):
561         * kjs/list.cpp:
562         (KJS::List::getSlice):
563         * kjs/list.h:
564         (KJS::List::List):
565         (KJS::List::at):
566         (KJS::List::append):
567         (KJS::List::begin):
568         (KJS::List::end):
569         (KJS::List::buffer):
570
571 2008-05-23  Kevin McCullough  <kmccullough@apple.com>
572
573         Reviewed by Sam.
574
575         <rdar://problem/5960012> JSProfiler: Stack overflow if recursion is
576         too deep.
577         -Use a simple depth limit to restrict too deep of recursion.
578
579         * profiler/Profile.cpp:
580         (KJS::Profile::willExecute):
581         (KJS::Profile::didExecute):
582         * profiler/Profile.h:
583
584 2008-05-23  Geoffrey Garen  <ggaren@apple.com>
585
586         Rolling back in r34085, with performance resolved.
587         
588         Apparently, passing the eval function to callEval gave GCC a hernia.
589
590         Reviewed by Darin Adler, Kevin McCullough, and Oliver Hunt.
591         
592         Fixed <rdar://problem/5959447> Crashes and incorrect reporting in the
593         JavaScript profiler
594
595         * VM/Machine.cpp:
596         (KJS::Machine::unwindCallFrame): Fixed incorrect reporting / a crash
597         when unwinding from inside eval and/or program code: detect the
598         difference, and do the right thing. Also, be sure to notify the profiler
599         *before* deref'ing the scope chain, since the profiler uses the scope chain.
600
601         (KJS::Machine::execute): Fixed incorrect reporting / crash when calling
602         a JS function re-entrently: Machine::execute(FunctionBodyNode*...)
603         should not invoke the didExecute hook, because op_ret already does that.
604         Also, use the new function's ExecState when calling out to the profiler.
605         (Not important now, but could have become a subtle bug later.)
606
607         (KJS::Machine::privateExecute): Fixed a hard to reproduce crash when
608         profiling JS functions: notify the profiler *before* deref'ing the scope
609         chain, since the profiler uses the scope chain.
610
611         * kjs/object.cpp:
612         (KJS::JSObject::call): Removed these hooks, because they are now unnecessary.
613
614         * profiler/Profile.cpp: Added a comment to explain a subtlety that only
615         Kevin and I understood previously. (Now, the whole world can understand!)
616
617         * profiler/Profiler.cpp:
618         (KJS::shouldExcludeFunction): Don't exclude .call and .apply. That was
619         a hack to fix bugs that no longer exist.
620
621         Finally, sped things up a little bit by changing the "Is the profiler
622         running?" check into an ASSERT, since we only call into the profiler
623         when it's running:
624
625         (KJS::Profiler::willExecute):
626         (KJS::Profiler::didExecute):
627
628 2008-05-23  Geoffrey Garen  <ggaren@apple.com>
629
630         Reviewed by Oliver Hunt.
631
632         - fixed <rdar://problem/5957662> REGRESSION(r33943-r33980): Can't send email , attach file or save as draft from hotmail.com
633         
634         SunSpider reports no change.
635         
636         This is a reworking of r34073, which I rolled out because it caused
637         lots of crashes.
638
639         * VM/CodeGenerator.cpp:
640         (KJS::CodeGenerator::CodeGenerator): Use removeDirect to nix old
641         properties whose names collide with new functions. (Don't use putWithAttributes
642         because that tries to write to the register file, which hasn't grown to
643         fit this program yet.)
644
645 2008-05-23  Darin Adler  <darin@apple.com>
646
647         Reviewed by Mark Rowe.
648
649         As allocateNumber is used via jsNumberCell outside of JavaScriptCore,
650         we need to provide a non-inlined version of it to avoid creating a
651         weak external symbol.
652
653         * JavaScriptCore.exp:
654         * kjs/AllInOneFile.cpp:
655         * kjs/collector.cpp:
656         (KJS::Collector::allocate):
657         (KJS::Collector::allocateNumber):
658         * kjs/collector.h:
659         (KJS::Collector::allocate):
660         (KJS::Collector::inlineAllocateNumber):
661         * kjs/value.h:
662         (KJS::NumberImp::operator new):
663
664 2008-05-23  Geoffrey Garen  <ggaren@apple.com>
665
666         Rolled out r34073 because it caused lots of layout test crashes.
667
668 2008-05-23  Geoffrey Garen  <ggaren@apple.com>
669
670         Rolled out r34085 because it measured as a 7.6% performance regression.
671
672 2008-05-23  Adam Roben  <aroben@apple.com>
673
674         Windows build fix
675
676         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add the
677         profiler directory to the include path.
678
679 2008-05-23  Oliver Hunt  <oliver@apple.com>
680
681         Reviewed by Anders.
682
683         SQUIRRELFISH: JavaScript error messages are missing informative text
684
685         Partial fix.
686         Tidy up error messages, makes a couple of them provide slightly more info.
687         Inexplicably leads to a 1% SunSpider Progression.
688
689         * VM/ExceptionHelpers.cpp:
690         (KJS::createError):
691         (KJS::createInvalidParamError):
692         (KJS::createNotAConstructorError):
693         (KJS::createNotAFunctionError):
694         * VM/ExceptionHelpers.h:
695         * VM/Machine.cpp:
696         (KJS::isNotObject):
697
698 2008-05-23  Oliver Hunt  <oliver@apple.com>
699
700         Reviewed by Tim H.
701
702         Fix call stack reported by profiler when entering event handlers.
703
704         JSObject::call was arbitrarily notifying the profiler when it was
705         called, even if it was JS code, which notifies the profile on entry
706         in any case.
707
708         * kjs/object.cpp:
709         (KJS::JSObject::call):
710
711 2008-05-16  Alp Toker  <alp@nuanti.com>
712
713         Build fix for gcc 3. Default constructor required in ExecState,
714         used by OldInterpreterExecState.
715
716         * kjs/ExecState.h:
717         (KJS::ExecState::ExecState):
718
719 2008-05-23  Mark Rowe  <mrowe@apple.com>
720
721         Reviewed by Oliver Hunt.
722
723         Fix <rdar://problem/5954997> global-recursion-on-full-stack.html crashes under guardmalloc.
724
725         Growing the register file with uncheckedGrow from within Machine::execute is not safe as the
726         register file may be too close to its maximum size to grow successfully.  By using grow,
727         checking the result and throwing a stack overflow error we can avoid crashing.
728
729         * VM/Machine.cpp:
730         (KJS::Machine::execute):
731         * VM/RegisterFile.h: Remove the now-unused uncheckedGrow.
732
733 2008-05-23  Oliver Hunt  <oliver@apple.com>
734
735         RS=Kevin McCullough
736
737         Remove JAVASCRIPT_PROFILER define
738
739         * VM/Machine.cpp:
740         (KJS::callEval):
741         (KJS::Machine::unwindCallFrame):
742         (KJS::Machine::execute):
743         (KJS::Machine::privateExecute):
744         * kjs/config.h:
745         * kjs/object.cpp:
746         (KJS::JSObject::call):
747
748 2008-05-23  Oliver Hunt  <oliver@apple.com>
749
750        <rdar://problem/5951561> Turn on JavaScript Profiler
751
752         Reviewed by Kevin McCullough.
753
754         Flipped the switch on the profiler, rearranged how we
755         signal the the profiler is active so that calls aren't
756         needed in the general case.
757         
758         Also fixed the entry point for Machine::execute(FunctionBodyNode..)
759         to correctly indicate function exit.
760
761         Results in a 0.7-1.0% regression in SunSpider :-(
762
763         * VM/Machine.cpp:
764         (KJS::callEval):
765         (KJS::Machine::unwindCallFrame):
766         (KJS::Machine::execute):
767         (KJS::Machine::privateExecute):
768         * kjs/config.h:
769         * profiler/Profiler.cpp:
770         (KJS::Profiler::profiler):
771         (KJS::Profiler::startProfiling):
772         (KJS::Profiler::stopProfiling):
773         * profiler/Profiler.h:
774         (KJS::Profiler::enabledProfilerReference):
775
776 2008-05-23  Simon Hausmann  <hausmann@webkit.org>
777
778         Fix the Qt build by adding profiler/ to the include search path.
779
780         * JavaScriptCore.pri:
781
782 2008-05-22  Kevin McCullough  <kmccullough@apple.com>
783
784         Reviewed by Adam.
785
786         Fix a bug in the profiler where time in the current function is given to
787         (idle).
788
789         * profiler/Profile.cpp:
790         (KJS::Profile::didExecute): Set the start time and then call didExecute
791         to calculate the time spent in this function.
792         * profiler/ProfileNode.cpp: Remove confusing calculations that are no
793         longer necessary.
794         (KJS::ProfileNode::insertNode):
795         * profiler/ProfileNode.h: Expose access to the start time to allow the
796         simpler time calculations above.
797         (KJS::ProfileNode::startTime):
798         (KJS::ProfileNode::setStartTime):
799
800 2008-05-22  Adam Roben  <aroben@apple.com>
801
802         Show "(Function object)" instead of "(JSInpectorCallbackWrapper
803         object)" in profiles
804
805         Reviewed by Kevin McCullough.
806
807         * profiler/Profiler.cpp:
808         (KJS::createCallIdentifier): Use JSObject::className instead of
809         getting the class name from the ClassInfo directly. JSObject
810         subclasses can override className to provide a custom class name, and
811         it seems like we should honor that.
812
813 2008-05-22  Timothy Hatcher  <timothy@apple.com>
814
815         Added Profile::restoreAll and added ProfileNode::restoreAll
816         to the export file.
817
818         Reviewed by Adam Roben.
819
820         * JavaScriptCore.exp:
821         * profiler/Profile.h:
822
823 2008-05-22  Alp Toker  <alp@nuanti.com>
824
825         GTK+ build fix. Add JavaScriptCore/profiler to include path.
826
827         * GNUmakefile.am:
828
829 2008-05-22  Adam Roben  <aroben@apple.com>
830
831         Implement sub-millisecond profiling on Windows
832
833         Reviewed by Kevin McCullough.
834
835         * profiler/ProfileNode.cpp:
836         (KJS::getCount): Added. On Windows, we use QueryPerformanceCounter. On
837         other platforms, we use getCurrentUTCTimeWithMicroseconds.
838         (KJS::ProfileNode::endAndRecordCall): Use getCount instead of
839         getCurrentUTCTimeWithMicroseconds.
840         (KJS::ProfileNode::startTimer): Ditto.
841
842 2008-05-22  Adam Roben  <aroben@apple.com>
843
844         Fix a profiler assertion when calling a NodeList as a function
845
846         Reviewed by Kevin McCullough.
847
848         * profiler/Profiler.cpp:
849         (KJS::createCallIdentifier): Don't assert when a non-function object
850         is called as a function. Instead, build up a CallIdentifier using the
851         object's class name.
852
853 2008-05-22  Kevin McCullough  <kmccullough@apple.com>
854
855         Reviewed by Darin.
856
857         <rdar://problem/5951529> JSProfiler: Allow the profiler to "Exclude" a
858         profile node.
859         -Implement 'exclude'; where the excluded node attributes its time to its
860         parent's self time.
861
862         * JavaScriptCore.exp: Export the exclude function.
863         * profiler/Profile.h: 
864         (KJS::Profile::exclude):
865         * profiler/ProfileNode.cpp: 
866         (KJS::ProfileNode::setTreeVisible): New function that allows a change in
867         visiblitiy to be propogated to all the children of a node.
868         (KJS::ProfileNode::exclude): If the node matches the callIdentifier then
869         set the visiblity of this node and all of its children to false and
870         attribute it's total time to it's caller's self time.
871         * profiler/ProfileNode.h:
872
873 2008-05-22  Mark Rowe  <mrowe@apple.com>
874
875         Reviewed by Oliver Hunt.
876
877         Fix access to static global variables in Windows release builds.
878
879         * kjs/JSGlobalObject.h: Don't store a reference to an Identifier
880         in GlobalPropertyInfo as the Identifier is likely to be a temporary
881         and therefore may be destroyed before the GlobalPropertyInfo.
882
883 2008-05-22  Kevin McCullough  <kmccullough@apple.com>
884
885         Build fix.
886
887         * VM/Machine.cpp:
888         (KJS::callEval):
889
890 2008-05-22  Kevin McCullough  <kmccullough@apple.com>
891
892         Reviewed by Sam.
893
894         <rdar://problem/5951561> Turn on JavaScript Profiler
895         Get basic JS profiling working.
896         Even with this patch the profiler will not be compiled in because we do
897         not know the extend, if any, of the performance regression it would cause
898         when it is not in use. However with these changes, if the profiler were
899         on, it would not crash and show good profiling data.
900
901         * VM/Machine.cpp: Instrument the calls sites that are needed for profiling.
902         (KJS::callEval):
903         (KJS::Machine::unwindCallFrame):
904         (KJS::Machine::execute):
905         (KJS::Machine::privateExecute):
906         * kjs/function.cpp: Ditto.
907         (KJS::globalFuncEval):
908         * kjs/interpreter.cpp: Ditto.
909         (KJS::Interpreter::evaluate):
910         * profiler/Profile.cpp: 
911         (KJS::Profile::willExecute):
912         (KJS::Profile::didExecute): Because we do not get a good context when
913         startProfiling is called it is possible that m_currentNode will be at the
914         top of the known stack when a didExecute() is called.  What we then do is
915         create a new node that represents the function being exited and insert
916         it between the head and the currently known children, since they should
917         be children of this new node.
918         * profiler/ProfileNode.cpp:
919         (KJS::ProfileNode::ProfileNode):
920         (KJS::ProfileNode::willExecute): Rename the add function for consistency.
921         (KJS::ProfileNode::addChild): Appends the child to this node but also
922         sets the parent pointer of the children to this node.
923         (KJS::ProfileNode::insertNode): Insert a node between this node and its
924         children.  Also set the time for the new node since it is now exiting
925         and we don't really know when it started.
926         (KJS::ProfileNode::stopProfiling):
927         (KJS::ProfileNode::startTimer):
928         * profiler/ProfileNode.h:
929         (KJS::CallIdentifier::toString): Added for debugging.
930         (KJS::ProfileNode::setParent):
931         (KJS::ProfileNode::setSelfTime): Fixed an old bug where we set the
932         visibleTotalTime not the visibleSelfTime.
933         (KJS::ProfileNode::children):
934         (KJS::ProfileNode::toString): Added for debugging.
935         * profiler/Profiler.cpp: remove unecessary calls.
936         (KJS::Profiler::startProfiling):
937
938 2008-05-22  Sam Weinig  <sam@webkit.org>
939
940         Reviewed by Oliver Hunt.
941
942         Rename register arguments for op_call, op_call_eval, op_end, and op_construct 
943         to document what they are for.
944
945         * VM/CodeGenerator.cpp:
946         (KJS::CodeGenerator::emitCall):
947         (KJS::CodeGenerator::emitCallEval):
948         (KJS::CodeGenerator::emitEnd):
949         (KJS::CodeGenerator::emitConstruct):
950         * VM/CodeGenerator.h:
951         * VM/Machine.cpp:
952         (KJS::Machine::privateExecute):
953
954 2008-05-22  Oliver Hunt  <oliver@apple.com>
955
956         Reviewed by Darin.
957
958         Bug 19116: SquirrelFish shouldn't regress on variable lookups
959         <https://bugs.webkit.org/show_bug.cgi?id=19116>
960
961         Last of the multiscope look up optimisations.  This is a wash overall on SunSpider
962         but is a factor of 5-10 improvement in multiscope read/write/modify (eg. ++, --, +=,
963         ... applied to any non-local var).
964
965         * kjs/nodes.cpp:
966         (KJS::PostIncResolveNode::emitCode):
967         (KJS::PostDecResolveNode::emitCode):
968         (KJS::PreIncResolveNode::emitCode):
969         (KJS::PreDecResolveNode::emitCode):
970         (KJS::ReadModifyResolveNode::emitCode):
971
972 2008-05-22  David Kilzer  <ddkilzer@apple.com>
973
974         <rdar://problem/5954233> Add method to release free memory from FastMalloc
975
976         Patch suggested by Mark Rowe.  Rubber-stamped by Maciej.
977
978         * JavaScriptCore.exp: Export _releaseFastMallocFreeMemory.
979         * wtf/FastMalloc.cpp:
980         (WTF::TCMallocStats::): Added releaseFastMallocFreeMemory() for both
981         system malloc and FastMalloc code paths.
982         * wtf/FastMalloc.h: Define releaseFastMallocFreeMemory().
983
984 2008-05-22  Oliver Hunt  <oliver@apple.com>
985
986         RS=Maciej.
987
988         Roll out r34020 as it causes recursion tests to fail.
989
990         * kjs/object.cpp:
991         (KJS::JSObject::call):
992
993 2008-05-22  Oliver Hunt  <oliver@apple.com>
994
995         Reviewed by Mark.
996
997         Don't leak the SymbolTable when compiling eval code.
998
999         * kjs/nodes.cpp:
1000         (KJS::EvalNode::generateCode):
1001
1002 2008-05-22  Simon Hausmann  <hausmann@webkit.org>
1003
1004         Reviewed by Oliver.
1005
1006         Qt build fix.
1007
1008         * JavaScriptCore.pri: Added DebuggerCallFrame to the build.
1009         * VM/LabelID.h: Include limits.h for UINT_MAX.
1010         * wtf/VectorTraits.h: Include memory for std::auto_ptr.
1011
1012 2008-05-22  Geoffrey Garen  <ggaren@apple.com>
1013
1014         Reviewed by Adam Roben.
1015         
1016         Removed the old recursion guard mechanism, since squirrelfish has its
1017         own mechanism. Also removed some old JS call tracing code, since we
1018         have other ways to do that, too.
1019         
1020         SunSpider reports no change.
1021
1022         * kjs/object.cpp:
1023         (KJS::JSObject::call):
1024
1025 2008-05-22  Maciej Stachowiak  <mjs@apple.com>
1026
1027         Reviewed by Oliver.
1028         
1029         - fixed <rdar://problem/5954979> crash on celtic kane JS benchmark
1030
1031         * kjs/nodes.cpp:
1032         (KJS::WithNode::emitCode):
1033         (KJS::TryNode::emitCode):
1034
1035 2008-05-21  Kevin McCullough  <kmccullough@apple.com>
1036
1037         Reviewed by Maciej and Geoff.
1038
1039         <rdar://problem/5951561> Turn on JavaScript Profiler
1040         -As part of the effort to turn on the profiler it would be helpful if it
1041         did not need ExecStates to represent the stack location of the currently
1042         executing statement.
1043         -We now create each node as necessary with a reference to the current
1044         node and each node knows its parent so that the tree can be made without
1045         the entire stack.
1046
1047         * profiler/Profile.cpp:
1048         (KJS::Profile::Profile): The current node starts at the head.
1049         (KJS::Profile::stopProfiling): The current node is cleared when profiling
1050         stops.
1051         (KJS::Profile::willExecute): The current node either adds a new child or
1052         starts and returns a reference to an already existing child if the call
1053         ID that is requested already exists.
1054         (KJS::Profile::didExecute): The current node finishes and returns its
1055         parent.
1056         * profiler/Profile.h: Use a single callIdentifier instead of a vector
1057         since we no longer use the whole stack.
1058         * profiler/ProfileNode.cpp: Now profile nodes keep a reference to their
1059         parent.
1060         (KJS::ProfileNode::ProfileNode): Initialize the parent.
1061         (KJS::ProfileNode::didExecute): Record the time and return the parent.
1062         (KJS::ProfileNode::addOrStartChild): If the given callIdentifier is
1063         already a child, start it and return it, otherwise create a new one and
1064         return that.
1065         (KJS::ProfileNode::stopProfiling): Same logic, just use the new function.
1066         * profiler/ProfileNode.h: Utilize the parent.
1067         (KJS::ProfileNode::create):
1068         (KJS::ProfileNode::parent):
1069         * profiler/Profiler.cpp: 
1070         (KJS::Profiler::startProfiling): Here is the only place where the
1071         ExecState is used to figure out where in the stack the profiler is
1072         currently profiling.
1073         (KJS::dispatchFunctionToProfiles): Only send one CallIdentifier instead
1074         of a vector of them.
1075         (KJS::Profiler::willExecute): Ditto.
1076         (KJS::Profiler::didExecute): Ditto.
1077         (KJS::createCallIdentifier): Create only one CallIdentifier.
1078         (KJS::createCallIdentifierFromFunctionImp): Ditto.
1079         * profiler/Profiler.h:
1080
1081 2008-05-21  Darin Adler  <darin@apple.com>
1082
1083         Reviewed by Maciej.
1084
1085         - https://bugs.webkit.org/show_bug.cgi?id=19180
1086           speed up the < operator for the case when both values are integers
1087
1088         Makes standalone SunSpider 1.022x faster.
1089
1090         * VM/Machine.cpp:
1091         (KJS::jsLess): Add a special case for when both are numbers that fit in a JSImmediate.
1092
1093 2008-05-21  Maciej Stachowiak  <mjs@apple.com>
1094
1095         Reviewed by Oliver and Sam.
1096         
1097         - fixed <rdar://problem/5815631> REGRESSION (r31239): Multiscope optimisation of function calls results in incorrect this value (breaks tvtv.de)
1098         
1099         Track global this value in the scope chain so we can retrieve it
1100         efficiently but it follows lexical scope properly.
1101
1102         * kjs/ExecState.h:
1103         (KJS::ExecState::globalThisValue):
1104         * kjs/JSGlobalObject.h:
1105         (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
1106         * kjs/function_object.cpp:
1107         (KJS::FunctionObjectImp::construct):
1108         * kjs/scope_chain.h:
1109         (KJS::ScopeChainNode::ScopeChainNode):
1110         (KJS::ScopeChainNode::globalThisObject):
1111         (KJS::ScopeChainNode::push):
1112         (KJS::ScopeChain::ScopeChain):
1113
1114 2008-05-21  Kevin McCullough  <kmccullough@apple.com>
1115
1116         Sadness :(
1117
1118         * kjs/config.h:
1119
1120 2008-05-21  Kevin McCullough  <kmccullough@apple.com>
1121
1122         Reviewed by Maciej.
1123
1124         <rdar://problem/5950867> JSProfiler: Allow the profiler to "Focus" a
1125         profile node.
1126         - This patch updatest the times of the visible nodes correctly, but to do
1127         so, some of the design of the ProfileNode changed.
1128
1129         * JavaScriptCore.exp: export focus' symbol.
1130         * profiler/Profile.cpp: ProfileNodes now take a reference to the head of
1131         the profile tree to get up-to-date accurate total profile time.
1132         (KJS::Profile::Profile): Pass 0 for the head node.
1133         (KJS::Profile::stopProfiling): stopProfiling no longer needs the time
1134         passed into it, since it can get it from the head and it does not need to
1135         be told it is the head because it can figure it out on it's own.
1136         (KJS::Profile::willExecute): Set the head node for each created node.
1137         * profiler/Profile.h:
1138         (KJS::Profile::focus): Instead of taking a CallIdentifier that the caller
1139         would have to create, now focus() takes a ProfileNode that they should
1140         already have a reference to and focus() can extract the CallIdentifier
1141         from it.
1142         * profiler/ProfileNode.cpp: Create actual and visible versions fo the
1143         total and self times for focus and exclude.  Also add a head node
1144         reference so that nodes can get information from their head.
1145         (KJS::ProfileNode::ProfileNode):
1146         (KJS::ProfileNode::stopProfiling): Rename the total and self time
1147         variables and set the visual ones to the actual ones, so that without any
1148         changes to the visual versions of these variables, their times will match
1149         the actual times.
1150         (KJS::ProfileNode::focus): Now focus() has a bool to force it's children
1151         to be visible if this node is visible.  If this node does not match the
1152         CallIdentifier being focused then the visibleTotalTime is only updated if
1153         one or more of it's children is the CallIdentifier being focused. 
1154         (KJS::ProfileNode::restoreAll): Restores all variables with respect to
1155         the visible data in the ProfileNode.
1156         (KJS::ProfileNode::endAndRecordCall): Name change.
1157         (KJS::ProfileNode::debugPrintData): Dump the new variables.
1158         (KJS::ProfileNode::debugPrintDataSampleStyle): Name change.
1159         * profiler/ProfileNode.h: Use the new variables and reference to the head
1160         node.
1161         (KJS::ProfileNode::create):
1162         (KJS::ProfileNode::totalTime):
1163         (KJS::ProfileNode::setTotalTime):
1164         (KJS::ProfileNode::selfTime):
1165         (KJS::ProfileNode::setSelfTime):
1166         (KJS::ProfileNode::totalPercent):
1167         (KJS::ProfileNode::selfPercent):
1168         (KJS::ProfileNode::setVisible):
1169
1170 2008-05-21  Alp Toker  <alp@nuanti.com>
1171
1172         GTK+/UNIX testkjs build fix. Include signal.h.
1173
1174         * kjs/testkjs.cpp:
1175
1176 2008-05-21  Oliver Hunt  <oliver@apple.com>
1177
1178         Reviewed by NOBODY (Build fix).
1179
1180         Yet more windows build fixes
1181
1182         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1183
1184 2008-05-21  Oliver Hunt  <oliver@apple.com>
1185
1186         Reviewed by NOBODY (Build fix).
1187
1188         Yet more windows build fixes
1189
1190         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1191
1192 2008-05-21  Alp Toker  <alp@nuanti.com>
1193
1194         GTK+ build fix. Add DebuggerCallFrame.cpp and take AllInOneFile.cpp
1195         changes into account.
1196
1197         * GNUmakefile.am:
1198
1199 2008-05-21  Oliver Hunt  <oliver@apple.com>
1200
1201         Reviewed by NOBODY (Build fix).
1202
1203         Add DebuggerCallFrame.{h,cpp} to the project file
1204
1205         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1206
1207 2008-05-21  Alp Toker  <alp@nuanti.com>
1208
1209         GTK+ port build fixes following squirrelfish merge r33979.
1210
1211         * GNUmakefile.am:
1212
1213 2008-05-21  Maciej Stachowiak  <mjs@apple.com>
1214
1215         Reviewed by Darin.
1216         
1217         - save a hash lookup wne writing to global properties
1218         0.3% speedup on SunSpider, 7% on bitops-bitwise-and
1219
1220         * VM/Machine.cpp:
1221         (KJS::resolveBase): Check for being a the end of the scope chain
1222         before hash lookup.
1223
1224 2008-05-21  Alp Toker  <alp@nuanti.com>
1225
1226         Rubber-stamped by Maciej.
1227
1228         Replace non-standard #pragma marks with comments to avoid compiler
1229         warnings.
1230
1231         * profiler/ProfileNode.cpp:
1232
1233 2008-05-21  Geoffrey Garen  <ggaren@apple.com>
1234
1235         Reviewed by Mark Rowe.
1236
1237         Fix layout test failure in fast/dom/getter-on-window-object2 introduced in r33961.
1238
1239         * JavaScriptCore.exp:
1240         * kjs/JSGlobalObject.cpp:
1241         (KJS::JSGlobalObject::defineGetter):
1242         (KJS::JSGlobalObject::defineSetter):
1243         * kjs/JSGlobalObject.h:
1244
1245 === End merge of squirrelfish ===
1246
1247 2008-05-21  Geoffrey Garen  <ggaren@apple.com>
1248
1249         Reviewed by Tim Hatcher.
1250         
1251         Merged with trunk WebCore's new debugger.
1252
1253         * kjs/DebuggerCallFrame.cpp:
1254         (KJS::DebuggerCallFrame::evaluate): Changed this function to separate
1255         the exception value from the return value. The WebKit debugger treats
1256         them as one, but the WebCore debugger doesn't.
1257
1258         * kjs/DebuggerCallFrame.h:
1259         (KJS::DebuggerCallFrame::dynamicGlobalObject): Added a new accessor for
1260         the dynamic global object, since the debugger doesn't want the lexical
1261         global object.
1262
1263 2008-05-21  Oliver Hunt  <oliver@apple.com>
1264
1265         Reviewed by Maciej.
1266
1267         Bug 19116: SquirrelFish shouldn't regress on variable lookups
1268         <https://bugs.webkit.org/show_bug.cgi?id=19116>
1269
1270         Optimise cross scope assignment, 0.4% progression in sunspider.
1271
1272         * VM/CodeBlock.cpp:
1273         (KJS::CodeBlock::dump):
1274         * VM/CodeGenerator.cpp:
1275         (KJS::CodeGenerator::emitPutScopedVar):
1276         * VM/CodeGenerator.h:
1277         * VM/Machine.cpp:
1278         (KJS::Machine::privateExecute):
1279         * VM/Opcode.h:
1280         * kjs/nodes.cpp:
1281         (KJS::AssignResolveNode::emitCode):
1282
1283 2008-05-21  Maciej Stachowiak  <mjs@apple.com>
1284
1285         Reviewed by Oliver.
1286         
1287         - check property map before symbol table in JSGlobalObject::getOwnPropertySlot
1288         0.5% speedup on SunSpider
1289
1290         * kjs/JSGlobalObject.h:
1291         (KJS::JSGlobalObject::getOwnPropertySlot): Check property map before symbol table
1292         because symbol table access is likely to have been optimized.
1293
1294 2008-05-21  Oliver Hunt  <oliver@apple.com>
1295
1296         Reviewed by Maciej.
1297
1298         Bug 19116: SquirrelFish shouldn't regress on variable lookups
1299         <https://bugs.webkit.org/show_bug.cgi?id=19116>
1300
1301         Optimise multiscope lookup of statically resolvable function calls.
1302         SunSpider reports a 1.5% improvement, including 37% on 
1303         controlflow-recursive for some reason :D
1304
1305         * VM/CodeBlock.cpp:
1306         (KJS::CodeBlock::dump):
1307         * VM/CodeGenerator.cpp:
1308         (KJS::CodeGenerator::emitResolve):
1309         * VM/CodeGenerator.h:
1310         * kjs/nodes.cpp:
1311         (KJS::FunctionCallResolveNode::emitCode):
1312
1313 2008-05-21  Maciej Stachowiak  <mjs@apple.com>
1314
1315         Reviewed by Oliver.
1316         
1317         - give JSGlobalObject a special version of getOwnPropertySlot that tells you if the slot is directly writable
1318         (WebCore change using this is a 2.6% speedup on in-browser SunSpider).
1319
1320         * JavaScriptCore.exp:
1321         * kjs/JSGlobalObject.h:
1322         (KJS::JSGlobalObject::getOwnPropertySlot):
1323         * kjs/JSVariableObject.h:
1324         (KJS::JSVariableObject::symbolTableGet):
1325         * kjs/object.h:
1326         (KJS::JSObject::getDirectLocation):
1327         (KJS::JSObject::getOwnPropertySlotForWrite):
1328         * kjs/property_map.cpp:
1329         (KJS::PropertyMap::getLocation):
1330         * kjs/property_map.h:
1331         * kjs/property_slot.h:
1332         (KJS::PropertySlot::putValue):
1333
1334 2008-05-20  Oliver Hunt  <oliver@apple.com>
1335
1336         Reviewed by Maciej.
1337
1338         Bug 19116: SquirrelFish shouldn't regress on variable lookups
1339         <https://bugs.webkit.org/show_bug.cgi?id=19116>
1340
1341         This restores multiscope optimisation to simple resolve, producing
1342         a 2.6% progression in SunSpider.  Have verified that none of the
1343         sites broken by the multiscope optimisation in trunk were effected
1344         by this change.
1345
1346         * VM/CodeBlock.cpp:
1347         (KJS::CodeBlock::dump):
1348         * VM/CodeBlock.h:
1349         (KJS::CodeBlock::CodeBlock):
1350         * VM/CodeGenerator.cpp:
1351         (KJS::CodeGenerator::findScopedProperty):
1352         (KJS::CodeGenerator::emitResolve):
1353         * VM/CodeGenerator.h:
1354         * VM/Machine.cpp:
1355         (KJS::resolve_n):
1356         (KJS::Machine::privateExecute):
1357         * VM/Opcode.h:
1358         * kjs/JSVariableObject.h:
1359
1360 2008-05-20  Oliver Hunt  <oliver@apple.com>
1361
1362         Reviewed by NOBODY (Build fix).
1363
1364         Fixerate the windows build.
1365
1366         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1367         * VM/CodeGenerator.cpp:
1368         * VM/RegisterFile.h:
1369         * kjs/JSGlobalObject.h:
1370         * kjs/Parser.cpp:
1371         * kjs/interpreter.h:
1372
1373 2008-05-20  Oliver Hunt  <oliver@apple.com>
1374
1375         Reviewed by Geoff.
1376
1377         Bug 19110: SquirrelFish: Google Maps - no maps
1378         <https://bugs.webkit.org/show_bug.cgi?id=19110>
1379
1380         Correct a comedy of errors present in my original patch to "fix"
1381         exceptions occurring midway through pre and post increment. This
1382         solution is cleaner than the original, doesn't need the additional
1383         opcodes, and as an added benefit does not break Google Maps.
1384
1385         Sunspider reports a 0.4% progression.
1386
1387         * VM/CodeBlock.cpp:
1388         (KJS::CodeBlock::dump):
1389         * VM/CodeGenerator.cpp:
1390         * VM/CodeGenerator.h:
1391         * VM/Machine.cpp:
1392         (KJS::Machine::privateExecute):
1393         * VM/Opcode.h:
1394         * kjs/nodes.cpp:
1395         (KJS::PreIncResolveNode::emitCode):
1396         (KJS::PreDecResolveNode::emitCode):
1397         (KJS::PreIncBracketNode::emitCode):
1398         (KJS::PreDecBracketNode::emitCode):
1399         (KJS::PreIncDotNode::emitCode):
1400         (KJS::PreDecDotNode::emitCode):
1401
1402 2008-05-20  Maciej Stachowiak  <mjs@apple.com>
1403
1404         Reviewed by Oliver.
1405         
1406         - inline JSGlobalObject::getOwnPropertySlot
1407         1% improvement on in-browser SunSpider (a wash command-line)
1408
1409         * kjs/JSGlobalObject.cpp:
1410         * kjs/JSGlobalObject.h:
1411         (KJS::JSGlobalObject::getOwnPropertySlot):
1412
1413 2008-05-18  Oliver Hunt  <oliver@apple.com>
1414
1415         Reviewed by Maciej.
1416
1417         Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
1418         <https://bugs.webkit.org/show_bug.cgi?id=18752>
1419
1420         Handle exceptions thrown by toString conversion in subscript operators,
1421         this should basically complete exception handling in SquirrelFish.
1422
1423         Sunspider reports no regression.
1424
1425         * VM/Machine.cpp:
1426         (KJS::Machine::privateExecute):
1427
1428 2008-05-17  Geoffrey Garen  <ggaren@apple.com>
1429
1430         Reviewed by Oliver Hunt.
1431
1432         [Reapplying patch with previously missing files from r33553 -- Oliver]
1433
1434         Behold: debugging.
1435         
1436         SunSpider reports no change.
1437
1438         * JavaScriptCore.xcodeproj/project.pbxproj: Added DebuggerCallFrame.h/.cpp,
1439         and created a debugger folder.
1440
1441         * VM/CodeGenerator.cpp:
1442         (KJS::CodeGenerator::generate): If the debugger is attached, always
1443         generate full scope chains for its sake.
1444
1445         * VM/Machine.cpp:
1446         (KJS::Machine::unwindCallFrame): Notify the debugger when unwinding
1447         due to an exception, so it doesn't keep stale call frames around.
1448
1449         (KJS::Machine::execute): Set Callee to 0 in eval frames, so the
1450         debugger can distinguish them from function call frames.
1451
1452         (KJS::Machine::debug): Simplified this function, since the debugger
1453         doesn't actually need all the information we used to provide.
1454
1455         (KJS::Machine::privateExecute): Treat debugging hooks like other function
1456         calls, so the code we hook into (the debugger UI) can be optimized.
1457
1458         * kjs/debugger.cpp: Nixed these default callback implementations and
1459         made the callbacks pure virtual instead, so the compiler could tell me
1460         if I made a mistake in one of the subclasses.
1461
1462         * kjs/debugger.h: Removed a bunch of irrelevent data from the debugger
1463         callbacks. Changed from passing an ExecState* to passing a
1464         DebuggerCallFrame*, since an ExecState* doesn't contain sufficient
1465         information anymore.
1466
1467         * kjs/function.cpp:
1468         (KJS::globalFuncEval): Easiest bug fix evar!
1469
1470         [Previously missing files from r33553]
1471         * kjs/DebuggerCallFrame.cpp: Copied from JavaScriptCore/profiler/FunctionCallProfile.h.
1472         (KJS::DebuggerCallFrame::functionName):
1473         (KJS::DebuggerCallFrame::thisObject):
1474         (KJS::DebuggerCallFrame::evaluateScript):
1475         * kjs/DebuggerCallFrame.h: Copied from JavaScriptCore/VM/Register.h.
1476         (KJS::DebuggerCallFrame::DebuggerCallFrame):
1477         (KJS::DebuggerCallFrame::scopeChain):
1478         (KJS::DebuggerCallFrame::exception):
1479
1480 2008-05-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1481
1482         Reviewed by Oliver.
1483
1484         Bug 18991: SquirrelFish: Major codegen issue in a.b=expr, a[b]=expr
1485         <https://bugs.webkit.org/show_bug.cgi?id=18991>
1486
1487         Fix the last remaining blocking cases of this bug.
1488
1489         * kjs/grammar.y:
1490         * kjs/nodes.cpp:
1491         (KJS::ReadModifyResolveNode::emitCode):
1492
1493 2008-05-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1494
1495         Reviewed by Oliver.
1496
1497         Partial fix for:
1498
1499         Bug 18991: SquirrelFish: Major codegen issue in a.b=expr, a[b]=expr
1500         <https://bugs.webkit.org/show_bug.cgi?id=18991>
1501
1502         Ensure that the code generated for assignments uses temporaries whenever
1503         necessary. This patch covers the vast majority of situations, but there
1504         are still a few left.
1505
1506         This patch also adds some missing cases to CodeBlock::dump().
1507
1508         * VM/CodeBlock.cpp:
1509         (KJS::CodeBlock::dump):
1510         * VM/CodeGenerator.h:
1511         (KJS::CodeGenerator::destinationForAssignResult):
1512         (KJS::CodeGenerator::leftHandSideNeedsCopy):
1513         (KJS::CodeGenerator::emitNodeForLeftHandSide):
1514         * kjs/NodeInfo.h:
1515         * kjs/grammar.y:
1516         * kjs/nodes.cpp:
1517         (KJS::AssignDotNode::emitCode):
1518         (KJS::ReadModifyDotNode::emitCode):
1519         (KJS::AssignBracketNode::emitCode):
1520         (KJS::ReadModifyBracketNode::emitCode):
1521         (KJS::ForInNode::ForInNode):
1522         * kjs/nodes.h:
1523         (KJS::ReadModifyResolveNode::):
1524         (KJS::AssignResolveNode::):
1525         (KJS::ReadModifyBracketNode::):
1526         (KJS::AssignBracketNode::):
1527         (KJS::AssignDotNode::):
1528         (KJS::ReadModifyDotNode::):
1529
1530 2008-05-17  Oliver Hunt  <oliver@apple.com>
1531
1532         Reviewed by Maciej.
1533
1534         Bug 19106: SquirrelFish: Activation is not marked correctly
1535         <https://bugs.webkit.org/show_bug.cgi?id=19106>
1536
1537         We can't rely on the symbol table for a count of the number of globals
1538         we need to mark as that misses duplicate parameters and 'this'.  Now we
1539         use the actual local register count from the codeBlock.
1540
1541         * kjs/JSActivation.cpp:
1542         (KJS::JSActivation::mark):
1543
1544 2008-05-16  Oliver Hunt  <oliver@apple.com>
1545
1546         Reviewed by Geoff.
1547
1548         Bug 19076: SquirrelFish: RegisterFile can be corrupted if implictly reenter global scope with no declared vars
1549         <https://bugs.webkit.org/show_bug.cgi?id=19076>
1550
1551         Don't delay allocation of initial global RegisterFile, as we can't guarantee we will be able
1552         to allocate the global 'this' register safely at any point after initialisation of the Global
1553         Object.
1554
1555         Unfortunately this initial allocation caused a regression of 0.2-0.3%, however this patch adds
1556         support for the static slot optimisation for the global Math object which brings it to a 0.3%
1557         progression.
1558
1559         * VM/CodeGenerator.cpp:
1560         (KJS::CodeGenerator::programCodeThis):
1561         (KJS::CodeGenerator::CodeGenerator):
1562         (KJS::CodeGenerator::addParameter):
1563         * VM/CodeGenerator.h:
1564         * VM/Machine.cpp:
1565         (KJS::Machine::execute):
1566         * kjs/ExecState.h:
1567         * kjs/JSGlobalObject.cpp:
1568         (KJS::JSGlobalObject::reset):
1569         * kjs/JSGlobalObject.h:
1570         (KJS::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo):
1571         (KJS::JSGlobalObject::addStaticGlobals):
1572         * kjs/nodes.cpp:
1573
1574 2008-05-16  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1575
1576         Reviewed by Oliver Hunt.
1577
1578         Bug 19098: SquirrelFish: Ref'd temporaries can be clobbered
1579         <https://bugs.webkit.org/show_bug.cgi?id=19098>
1580
1581         When doing code generation for a statement list, increase the reference
1582         count on a register that might eventually be returned, so that it doesn't
1583         get clobbered by a request for a new temporary.
1584
1585         * kjs/nodes.cpp:
1586         (KJS::statementListEmitCode):
1587
1588 2008-05-16  Maciej Stachowiak  <mjs@apple.com>
1589
1590         Reviewed by Oliver.
1591         
1592         - fixed Bug 19044: SquirrelFish: Bogus values enter evaluation when closing over scope with parameter and var with same name
1593         https://bugs.webkit.org/show_bug.cgi?id=19044
1594
1595         * kjs/JSActivation.cpp:
1596         (KJS::JSActivation::copyRegisters): Use numLocals from the code
1597         block rather than the size of the symbol table for the number of
1598         registers to copy, to account for duplicate parameters and vars
1599         with the same name as parameters (we still have potentially
1600         suboptimal codegen in that we allocate a local register for the
1601         var in the latter case but it is never used).
1602         
1603 2008-05-15  Geoffrey Garen  <ggaren@apple.com>
1604
1605         Not reviewed.
1606         
1607         We regret to inform you that your program is crashing because you were
1608         stupid.
1609
1610         * VM/Machine.cpp:
1611         (KJS::Machine::privateExecute): Math is hard.
1612
1613 2008-05-14  Geoffrey Garen  <ggaren@apple.com>
1614
1615         Reviewed by Oliver Hunt.
1616
1617         A little more debugger action: filled in op_debug. All debugger control
1618         flow works now, but variable inspection and backtraces still don't.
1619         
1620         SunSpider reports no change.
1621
1622         * VM/CodeGenerator.cpp: Changed op_debug to accept line number parameters.
1623
1624         * VM/Machine.cpp:
1625         (KJS::Machine::getFunctionAndArguments): Moved op_debug into a
1626         NEVER_INLINE function to avoid a stunning 10% performance regression.
1627         Also factored out a common function for retrieving the function and 
1628         arguments from a  call frame. 
1629
1630         * kjs/JSActivation.cpp:
1631         (KJS::JSActivation::createArgumentsObject): Use the new factored out
1632         function mentioned above.
1633
1634         * kjs/Parser.cpp:
1635         (KJS::Parser::parse): Increment m_sourceId before assigning it, so the
1636         sourceId we send to the debugger matches the sourceId recorded in the
1637         node.
1638
1639         * kjs/nodes.cpp: Emit debugging hooks.
1640
1641 2008-05-14  Oliver Hunt  <oliver@apple.com>
1642
1643         Reviewed by Maciej.
1644
1645         Bug 19024: SQUIRRELFISH: ASSERTION FAILED: activation->isActivationObject() in Machine::unwindCallFrame
1646         <https://bugs.webkit.org/show_bug.cgi?id=19024>
1647
1648         This fixes a number of issues.  The most important is that we now check every register
1649         file for tainting rather than just looking for function register files as that was
1650         insufficient. Additionally guarded against implicit re-entry into Eval code.
1651
1652         Also added a few additional assertions to reduce the amout of time between something
1653         going wrong and us seeing the error.
1654
1655         * VM/Machine.cpp:
1656         (KJS::Machine::execute):
1657         (KJS::Machine::privateExecute):
1658         * VM/RegisterFile.cpp:
1659         (KJS::RegisterFile::growBuffer):
1660         (KJS::RegisterFile::addGlobalSlots):
1661         * VM/RegisterFileStack.cpp:
1662         (KJS::RegisterFileStack::pushGlobalRegisterFile):
1663         (KJS::RegisterFileStack::pushFunctionRegisterFile):
1664         * VM/RegisterFileStack.h:
1665         (KJS::RegisterFileStack::inImplicitCall):
1666
1667 2008-05-14  Geoffrey Garen  <ggaren@apple.com>
1668
1669         Reviewed by Oliver Hunt.
1670         
1671         A little more debugger action: emit opcodes for debugger hooks. Right
1672         now, the opcode implementation is just a stub.
1673         
1674         SunSpider reports no change.
1675         
1676         Some example codegen for "function f() { 1; }":
1677
1678             [   0] dbg         DidEnterCallFrame
1679             [   2] dbg         WillExecuteStatement
1680             [   4] load        tr0, 1(@k0)
1681             [   7] load        tr0, undefined(@k1)
1682             [  10] dbg         WillLeaveCallFrame
1683             [  12] ret         tr0
1684
1685 2008-05-14  Oliver Hunt  <oliver@apple.com>
1686
1687         Reviewed by Geoff.
1688
1689         Bug 19025: SQUIRRELFISH: malformed syntax in onload handler causes crash
1690         <https://bugs.webkit.org/show_bug.cgi?id=19025>
1691
1692         Simple fix -- move the use of functionBodyNode to after the null check.
1693
1694         * kjs/function_object.cpp:
1695         (KJS::FunctionObjectImp::construct):
1696
1697 2008-05-13  Geoffrey Garen  <ggaren@apple.com>
1698
1699         Reviewed by Oliver Hunt.
1700         
1701         Fixed a codegen crash with run-time parse errors.
1702         
1703         SunSpider reports no change.
1704         
1705         emitThrowError needs to return the temporary holding the error, not dst,
1706         since dst may be NULL. In fact, emitThrowError shouldn't take a dst
1707         parameter at all, since exceptions should not modify the destination
1708         register.
1709
1710 2008-05-13  Oliver Hunt  <oliver@apple.com>
1711
1712         Reviewed by Geoff.
1713
1714         Bug 19027: SquirrelFish: Incorrect codegen for pre-increment
1715         <https://bugs.webkit.org/show_bug.cgi?id=19027>
1716
1717         This fixes the codegen issues for the pre-inc/decrement operators
1718         to prevent incorrectly clobbering the destination in the event of
1719         an exception.
1720
1721         * VM/CodeBlock.cpp:
1722         (KJS::CodeBlock::dump):
1723         * VM/CodeGenerator.cpp:
1724         (KJS::CodeGenerator::emitPreInc):
1725         (KJS::CodeGenerator::emitPreDec):
1726         * VM/CodeGenerator.h:
1727         * VM/Machine.cpp:
1728         (KJS::Machine::privateExecute):
1729         * VM/Opcode.h:
1730         * kjs/nodes.cpp:
1731         (KJS::PreIncResolveNode::emitCode):
1732         (KJS::PreDecResolveNode::emitCode):
1733         (KJS::PreIncBracketNode::emitCode):
1734         (KJS::PreDecBracketNode::emitCode):
1735         (KJS::PreIncDotNode::emitCode):
1736         (KJS::PreDecDotNode::emitCode):
1737
1738 2008-05-13  Geoffrey Garen  <ggaren@apple.com>
1739
1740         Reviewed by Oliver Hunt.
1741         
1742         A little more debugger action: supply a real line number, sourceId,
1743         and sourceURL in op_new_error.
1744         
1745         SunSpider reports a .2% speedup. Not sure what that's about.
1746
1747         * VM/Machine.cpp:
1748         (KJS::Machine::privateExecute): Use the new good stuff in op_new_error.
1749
1750         * kjs/nodes.cpp:
1751         (KJS::RegExpNode::emitCode): Use the shared emitThrowError instead of
1752         rolling our own.
1753
1754 2008-05-13  Geoffrey Garen  <ggaren@apple.com>
1755
1756         Reviewed by Oliver Hunt.
1757         
1758         A little more debugger action: implemented the exception callback.
1759         
1760         SunSpider reports a .2% speedup. Not sure what that's about.
1761
1762         * VM/CodeBlock.h: A little refactoring here. Store a pointer to our
1763         owner ScopeNode so we can retrieve data from it. This allows us to
1764         stop storing copies of the data ourselves. Also, store a "this" register
1765         instead of a code type, since we were only using the code type to
1766         calculate the "this" register.
1767
1768         * VM/CodeGenerator.cpp:
1769         (KJS::CodeGenerator::generate): Calculate the "this" register mentioned
1770         above. Also, take care of removing "this" from the symbol table after
1771         codegen is done, since relying on the timing of a destructor for correct
1772         behavior is not so good.
1773
1774         * VM/Machine.cpp:
1775         (KJS::Machine::throwException): Invoke the debugger's exception callback.
1776         (KJS::Machine::privateExecute): Use the "this" register mentioned above.
1777
1778 2008-05-13  Geoffrey Garen  <ggaren@apple.com>
1779
1780         Reviewed by Oliver Hunt.
1781         
1782         Removed some unused exception machinery.
1783         
1784         SunSpider reports a .3% speedup.
1785
1786         * API/JSCallbackObject.h:
1787         * API/JSCallbackObjectFunctions.h:
1788         * JavaScriptCore.exp:
1789         * VM/Machine.cpp:
1790         (KJS::Machine::privateExecute):
1791         * kjs/internal.cpp:
1792         * kjs/object.cpp:
1793         * kjs/object.h:
1794         * kjs/value.h:
1795
1796 2008-05-13  Geoffrey Garen  <ggaren@apple.com>
1797
1798         Reviewed by Oliver Hunt.
1799         
1800         A little more debugger action.
1801
1802         * kjs/debugger.cpp:
1803         * kjs/debugger.h: Removed debuggersPresent because it was unused.
1804         Replaced AttachedGlobalObject linked list with a HashSet because HashSet
1805         is faster and simpler. Changed all functions to return void instead of
1806         bool, because no clients ever return false, and we don't want to support
1807         it.
1808
1809         * kjs/nodes.cpp: Did some up-keep to avoid build bustage.
1810         (KJS::Node::handleException):
1811         (KJS::BreakpointCheckStatement::execute):
1812         (KJS::FunctionBodyNodeWithDebuggerHooks::execute):
1813
1814 2008-05-13  Oliver Hunt  <oliver@apple.com>
1815
1816         Reviewed by Darin.
1817
1818         Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
1819         <https://bugs.webkit.org/show_bug.cgi?id=18752>
1820
1821         Replace old attempt at "branchless" exceptions as the extra information
1822         being passed made gcc an unhappy compiler, replacing these custom toNumber
1823         calls with ordinary toNumber logic (by relying on toNumber now preventing
1824         side effects after an exception has been thrown) provided sufficient leeway
1825         to add the additional checks for the remaining unchecked cases.
1826
1827         This leaves only toString conversions in certain contexts as possibly
1828         misbehaving.
1829
1830         * VM/Machine.cpp:
1831         (KJS::jsAdd):
1832         (KJS::resolve):
1833         (KJS::resolveBaseAndProperty):
1834         (KJS::resolveBaseAndFunc):
1835         (KJS::Machine::privateExecute):
1836         * VM/Opcode.h:
1837         * kjs/value.h:
1838         (KJS::JSValue::safeGetNumber):
1839
1840 2008-05-13  Geoffrey Garen  <ggaren@apple.com>
1841
1842         Reviewed by Oliver Hunt.
1843         
1844         First steps toward supporting the debugger API: support the sourceParsed
1845         callback; plus some minor fixups.
1846
1847         SunSpider reports no regression.
1848
1849         * VM/CodeGenerator.h: Removed a misleading comment.
1850
1851         * kjs/Parser.h: Changed the parser to take an ExecState*, so it can
1852         implement the sourceParsed callback -- that way, we only have to
1853         implement the callback in one place.
1854
1855         * kjs/debugger.cpp: Nixed DebuggerImp, because its sole purpose in life
1856         was to demonstrate the misapplication of design patterns.
1857
1858         * kjs/debugger.h: Changed sourceParsed to take a SourceProvider, to
1859         reduce copying, and not to return a value, because pausing execution
1860         after parsing is complicated, and no clients needed that ability, anyway.
1861
1862         * kjs/grammar.y: Make sure never to pass a NULL SourceElements* to
1863         didFinishParsing -- that simplifies some code down the road.
1864         
1865         * kjs/nodes.cpp: Don't generate special AST nodes just because the
1866         debugger is attached -- that's a relic of the old AST execution model,
1867         and those nodes haven't been maintained.
1868
1869 2008-05-13  Oliver Hunt  <oliver@apple.com>
1870
1871         Reviewed by Geoff.
1872
1873         Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
1874         <https://bugs.webkit.org/show_bug.cgi?id=18752>
1875
1876         First step: prevent incorrect evaluation of valueOf/toString conversion
1877         in right hand side of expression after earlier conversion throws.
1878
1879         * API/JSCallbackObjectFunctions.h:
1880         (KJS::::toNumber):
1881         * kjs/object.cpp:
1882         (KJS::JSObject::defaultValue):
1883
1884 2008-05-12  Oliver Hunt  <oliver@apple.com>
1885
1886         Reviewed by Geoff.
1887
1888         Bug 18934: SQUIRRELFISH: ASSERT @ nytimes.com due to RegisterFile being clobbered
1889         <https://bugs.webkit.org/show_bug.cgi?id=18934>
1890
1891         Unfortunately we cannot create new statically optimised globals if there are any
1892         tainted RegisterFiles on the RegisterFileStack.  To handle this we re-introduce
1893         (in a slightly cleaner form) the inImplicitCall concept to the RegisterFileStack.
1894
1895         * VM/Machine.cpp:
1896         (KJS::Machine::execute):
1897         * VM/RegisterFileStack.cpp:
1898         (KJS::RegisterFileStack::pushFunctionRegisterFile):
1899         * VM/RegisterFileStack.h:
1900
1901 2008-05-12  Geoffrey Garen  <ggaren@apple.com>
1902
1903         Reviewed by Maciej Stachowiak.
1904         
1905         Introduced support for function.caller.
1906         
1907         Improved support for walking interesting scopes for function introspection.
1908         
1909         This fixes all remaining layout tests not blocked by rebasing to trunk.
1910         
1911         SunSpider reports no change.
1912
1913         * VM/Machine.cpp:
1914         (KJS::Machine::dumpRegisters): Fixed a spacing issue.
1915
1916 2008-05-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1917
1918         Reviewed by Oliver.
1919
1920         Bug 18961: SQUIRRELFISH: Gmail doesn't load
1921         <https://bugs.webkit.org/show_bug.cgi?id=18961>
1922
1923         Fix codegen for logical nodes so that they don't use their destination
1924         as a temporary.
1925
1926         * kjs/nodes.cpp:
1927         (KJS::LogicalAndNode::emitCode):
1928         (KJS::LogicalOrNode::emitCode):
1929
1930 2008-05-10  Maciej Stachowiak  <mjs@apple.com>
1931
1932         Reviewed by Oliver.
1933
1934         - JavaScriptCore part of fix for: "SQUIRRELFISH: function toString broken after calling"
1935         https://bugs.webkit.org/show_bug.cgi?id=18869
1936        
1937         Three layout tests are fixed:
1938           fast/js/toString-elision-trailing-comma.html
1939           fast/js/toString-prefix-postfix-preserve-parens.html
1940           fast/js/kde/lval-exceptions.html
1941         
1942         Functions now save a shared subrange of the original source used
1943         to make them (so in the common case this adds no storage above the
1944         memory cache).
1945         
1946         * kjs/SourceProvider.h: Added.
1947         (KJS::SourceProvider): New abstract base class for classes that provide on-demand access
1948         to the source for a JavaScript program. This allows function objects to have access to their
1949         original source without copying.
1950         (KJS::UStringSourceProvider): SourceProvider subclass backed by a KJS::UString.
1951         (KJS::UStringSourceProvider::create):
1952         (KJS::UStringSourceProvider::getRange):
1953         (KJS::UStringSourceProvider::data):
1954         (KJS::UStringSourceProvider::length):
1955         (KJS::UStringSourceProvider::UStringSourceProvider):
1956         * kjs/SourceRange.h: Added.
1957         (KJS::SourceRange::SourceRange): Class that holds a SourceProvider and a character range into
1958         the source, to encapsulate on-demand access to the source of a function.
1959         (KJS::SourceRange::toString):
1960         * VM/Machine.cpp:
1961         (KJS::eval): Pass a UStringSourceProvider to the parser.
1962         * kjs/Parser.cpp:
1963         (KJS::Parser::parse): Take a SourceProvider and pass it on to the lexer.
1964         * kjs/Parser.h:
1965         (KJS::Parser::parse): Take a SourceProvider.
1966         * kjs/lexer.cpp:
1967         (KJS::Lexer::setCode): Take a SourceProvider; keep it around, and
1968         use it to get the raw buffer and length.
1969         * kjs/lexer.h:
1970         (KJS::Lexer::sourceRange): Convenience function to get a source
1971         range based on the lexer's source provieder, and char offsets
1972         right before and after the desired range.
1973         * kjs/function.cpp:
1974         (KJS::globalFuncEval): Pass a UStringSourceProvider to the parser.
1975         * kjs/function_object.cpp:
1976         (KJS::functionProtoFuncToString): Use toSourceString to get the source.
1977         (KJS::FunctionObjectImp::construct): Give the parser a UStringSourceProvider.
1978         * kjs/grammar.y: When parsing a function declaration, function
1979         expression, or getter or setter, tell the function body about its
1980         SourceRange.
1981         * kjs/interpreter.cpp:
1982         (KJS::Interpreter::checkSyntax): Pass a SourceProvider to the parser.
1983         (KJS::Interpreter::evaluate): Pass a SourceProvider to the parser.
1984         * kjs/interpreter.h:
1985         * kjs/nodes.h:
1986         (KJS::FunctionBodyNode::setSource): Establish a SourceRange for this function.
1987         (KJS::FunctionBodyNode::toSourceString): Get the source string out
1988         of the SourceRange.
1989         (KJS::FuncExprNode::): Take a SourceRange and set it on the body.
1990         (KJS::FuncDeclNode::): ditto
1991         * kjs/testkjs.cpp:
1992         (prettyPrintScript): Use a SourceProvider appropriately.
1993         * JavaScriptCore.exp: Export new symbols.
1994         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add new files.
1995         * JavaScriptCore.xcodeproj/project.pbxproj: Add new files.
1996
1997 2008-05-09  Oliver Hunt  <oliver@apple.com>
1998
1999         Reviewed by Maciej.
2000
2001         Bring back RegisterFile tainting in order to correctly handle
2002         natively implemented getters and setters that re-enter JavaScript
2003
2004         * VM/Machine.cpp:
2005         (KJS::Machine::privateExecute):
2006         * VM/RegisterFile.h:
2007         * kjs/function.cpp:
2008         (KJS::FunctionImp::callAsFunction):
2009         * kjs/object.cpp:
2010         (KJS::JSObject::put):
2011         (KJS::tryGetAndCallProperty):
2012         * kjs/property_slot.cpp:
2013         (KJS::PropertySlot::functionGetter):
2014
2015 2008-05-09  Maciej Stachowiak  <mjs@apple.com>
2016
2017         Reviewed by Oliver.
2018         
2019         - track character offsets of open and close braces, in preparation for saving function source
2020         
2021         I verified that there is no performance regression from this change.
2022
2023         * kjs/grammar.y:
2024         * kjs/lexer.cpp:
2025         (KJS::Lexer::lex):
2026         (KJS::Lexer::matchPunctuator):
2027         * kjs/lexer.h:
2028
2029 2008-05-09  Oliver Hunt  <oliver@apple.com>
2030
2031         Reviewed by Nobody (build fix).
2032
2033         Debug build fix
2034
2035         * kjs/JSGlobalObject.cpp:
2036         (KJS::JSGlobalObject::restoreLocalStorage):
2037
2038 2008-05-09  Oliver Hunt  <oliver@apple.com>
2039
2040         Reviewed by Geoff.
2041
2042         Build fixes for SquirrelFish on windows.
2043
2044         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2045         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2046         * VM/Register.h:
2047         * kjs/JSGlobalObject.cpp:
2048         (KJS::JSGlobalObject::restoreLocalStorage):
2049         * kjs/collector.cpp:
2050         (KJS::Collector::allocate):
2051         (KJS::Collector::allocateNumber):
2052         * kjs/collector.h:
2053         (KJS::Collector::allocate):
2054         (KJS::Collector::allocateNumber):
2055         * kjs/property_slot.cpp:
2056
2057 2008-05-08  Maciej Stachowiak  <mjs@apple.com>
2058
2059         Reviewed by Geoff.
2060         
2061         - fix activation tearoff in the case where functions are called with too many arguments
2062         
2063         Fixes:
2064         fast/canvas/patternfill-repeat.html
2065         fast/dom/SelectorAPI/bug-17313.html
2066
2067         * VM/Machine.cpp:
2068         (KJS::slideRegisterWindowForCall):
2069         (KJS::scopeChainForCall):
2070         (KJS::Machine::execute):
2071         (KJS::Machine::privateExecute):
2072
2073 2008-05-08  Geoffrey Garen  <ggaren@apple.com>
2074
2075         Reviewed by Oliver Hunt.
2076         
2077         Fixed failure in fast/canvas/canvas-pattern-behaviour.html.
2078         
2079         SunSpider reports a small speedup. Not sure what that's about.
2080
2081         * VM/CodeBlock.cpp:
2082         (KJS::CodeBlock::dump): Fixed op_call_eval to dump as "op_call_eval".
2083         This helped me while debugging.
2084
2085         * VM/Machine.cpp:
2086         (KJS::Machine::unwindCallFrame): When looking for an activation to tear
2087         off, don't use the scope chain. Inside eval, the scope chain doesn't
2088         belong to us; it belongs to our calling function.
2089         
2090         Also, don't use the needsFullScopeChain flag to decide whether to tear
2091         off the activation. "function.arguments" can create an activation
2092         for a function whose needsFullScopeChain flag is set to false.
2093
2094 2008-05-08  Maciej Stachowiak  <mjs@apple.com>
2095
2096         Reviewed by Oliver.
2097         
2098         - fix function.call for calls of more than 8 arguments
2099         
2100         Fixes svg/carto.net/button.svg
2101
2102         * kjs/list.cpp:
2103         (KJS::List::getSlice): properly set up the m_buffer of the target list.
2104
2105 2008-05-08  Maciej Stachowiak  <mjs@apple.com>
2106
2107         Reviewed by Oliver.
2108         
2109         - don't return a null RegisterID from RegExpNode in the exception case, since the caller may need a real register
2110
2111         Fixes:
2112         - fast/regex/early-acid3-86.html
2113         - http/tests/misc/acid3.html
2114         
2115         * kjs/nodes.cpp:
2116         (KJS::RegExpNode::emitCode):
2117
2118 2008-05-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2119
2120         Reviewed by Oliver.
2121
2122         Fix a performance regression caused by the introduction of property
2123         attributes to SymbolTable in r32859 by encoding the attributes and the
2124         register index into a single field of SymbolTableEntry.
2125
2126         This leaves Node::optimizeVariableAccess() definitely broken, although
2127         it was probably not entirely correct in SquirrelFish before this change.
2128
2129         * VM/CodeBlock.h:
2130         (KJS::missingThisObjectMarker):
2131         * VM/CodeGenerator.cpp:
2132         (KJS::CodeGenerator::addVar):
2133         (KJS::CodeGenerator::CodeGenerator):
2134         (KJS::CodeGenerator::registerForLocal):
2135         (KJS::CodeGenerator::registerForLocalConstInit):
2136         (KJS::CodeGenerator::isLocalConstant):
2137         (KJS::CodeGenerator::addConstant):
2138         (KJS::CodeGenerator::emitCall):
2139         * VM/CodeGenerator.h:
2140         (KJS::CodeGenerator::IdentifierMapIndexHashTraits::emptyValue):
2141         * VM/Machine.cpp:
2142         (KJS::Machine::privateExecute):
2143         * kjs/JSGlobalObject.cpp:
2144         (KJS::JSGlobalObject::saveLocalStorage):
2145         * kjs/JSVariableObject.cpp:
2146         (KJS::JSVariableObject::getPropertyNames):
2147         (KJS::JSVariableObject::getPropertyAttributes):
2148         * kjs/JSVariableObject.h:
2149         (KJS::JSVariableObject::symbolTableGet):
2150         (KJS::JSVariableObject::symbolTablePut):
2151         (KJS::JSVariableObject::symbolTablePutWithAttributes):
2152         * kjs/SymbolTable.h:
2153         (KJS::SymbolTableEntry::SymbolTableEntry):
2154         (KJS::SymbolTableEntry::isEmpty):
2155         (KJS::SymbolTableEntry::getIndex):
2156         (KJS::SymbolTableEntry::getAttributes):
2157         (KJS::SymbolTableEntry::setAttributes):
2158         (KJS::SymbolTableEntry::isReadOnly):
2159         * kjs/nodes.cpp:
2160         (KJS::getSymbolTableEntry):
2161         (KJS::PostIncResolveNode::optimizeVariableAccess):
2162         (KJS::PostDecResolveNode::optimizeVariableAccess):
2163         (KJS::DeleteResolveNode::optimizeVariableAccess):
2164         (KJS::TypeOfResolveNode::optimizeVariableAccess):
2165         (KJS::PreIncResolveNode::optimizeVariableAccess):
2166         (KJS::PreDecResolveNode::optimizeVariableAccess):
2167         (KJS::ReadModifyResolveNode::optimizeVariableAccess):
2168         (KJS::AssignResolveNode::optimizeVariableAccess):
2169         (KJS::ProgramNode::initializeSymbolTable):
2170
2171 2008-05-06  Maciej Stachowiak  <mjs@apple.com>
2172
2173         Rubber stamped by Oliver.
2174         
2175         - add missing ! in an assert that I failed to reverse
2176
2177         * VM/CodeGenerator.cpp:
2178         (KJS::CodeGenerator::CodeGenerator):
2179
2180 2008-05-06  Maciej Stachowiak  <mjs@apple.com>
2181
2182         Reviewed by Oliver.
2183         
2184         - fixed "SQUIRRELFISH: window.this shows up as a property, but it shouldn't"
2185         https://bugs.webkit.org/show_bug.cgi?id=18868
2186         
2187         The basic approach is to have "this" only be present in the symbol
2188         table at compile time, not runtime.
2189
2190         * VM/CodeGenerator.cpp:
2191         (KJS::CodeGenerator::~CodeGenerator): Remove "this" from symbol table.
2192         (KJS::CodeGenerator::CodeGenerator): Add "this" back when re-using
2193         a symbol table.
2194         * VM/CodeGenerator.h:
2195         * VM/Machine.cpp:
2196         (KJS::Machine::execute): Don't assert that "this" is in the symbol table.
2197
2198 2008-05-06  Geoffrey Garen  <ggaren@apple.com>
2199
2200         Reviewed by Oliver Hunt.
2201         
2202         Trivial support for function.arguments: Currently, we only support
2203         function.arguments from within the scope of function.
2204         
2205         This fixes the remaining Mozilla JS test failures.
2206         
2207         SunSpider reports no change.
2208
2209         * JavaScriptCore.exp:
2210
2211         * VM/Machine.cpp:
2212         (KJS::Machine::privateExecute): Separated scope chain deref from
2213         activation register copying: since it is now possible for client code
2214         to create an activation on behalf of a function that otherwise wouldn't
2215         need one, having an activation no longer necessarily means that you need
2216         to deref the scope chain.
2217         
2218         (KJS::Machine::getCallFrame): For now, this function only examines the
2219         current scope. Walking parent scopes requires some refactoring in the
2220         way we track execution stacks.
2221
2222         * kjs/ExecState.cpp:
2223         (KJS::ExecState::ExecState): We use a negative call frame offset to
2224         indicate that a given scope is not a function call scope.
2225         
2226 2008-05-05  Oliver Hunt  <oliver@apple.com>
2227
2228         Reviewed by Geoff.
2229
2230         Fix call frame set up for native -> JS function calls.
2231
2232         * VM/Machine.cpp:
2233         (KJS::Machine::execute):
2234
2235 2008-05-05  Geoffrey Garen  <ggaren@apple.com>
2236
2237         Reviewed by Maciej Stachowiak.
2238         
2239         Fixed ecma_3/Object/8.6.2.6-001.js, and similar bugs.
2240         
2241         SunSpider reports a .4% speedup. Not sure what that's about.
2242
2243         * VM/Machine.cpp:
2244         (KJS::Machine::privateExecute): Check for exception return from equal,
2245         since toPrimitive can throw.
2246
2247         * kjs/operations.cpp:
2248         (KJS::strictEqual): In response to an error I made in an earlier version
2249         of this patch, I changed strictEqual to make clear the fact that it
2250         performs no conversions and can't throw, making it slightly more efficient
2251         in the process.
2252
2253 2008-05-05  Maciej Stachowiak  <mjs@apple.com>
2254
2255         Reviewed by Oliver.
2256         
2257         - fix some dumb mistakes in my last patch
2258
2259         * VM/CodeGenerator.cpp:
2260         (KJS::CodeGenerator::emitPushScope):
2261         (KJS::CodeGenerator::emitGetPropertyNames):
2262         * VM/Machine.cpp:
2263         (KJS::Machine::privateExecute):
2264
2265 2008-05-05  Maciej Stachowiak  <mjs@apple.com>
2266
2267         Reviewed by Oliver.
2268         
2269         - document opcodes relating to jumps, scopes, and property name iteration
2270         
2271         Documented jmp, jtrue, false, push_scope, pop_scope, get_pnames,
2272         next_pname and jmp_scopes.
2273
2274         * VM/CodeGenerator.cpp:
2275         (KJS::CodeGenerator::emitJump):
2276         (KJS::CodeGenerator::emitJumpIfTrue):
2277         (KJS::CodeGenerator::emitJumpIfFalse):
2278         (KJS::CodeGenerator::emitPushScope):
2279         (KJS::CodeGenerator::emitNextPropertyName):
2280         (KJS::CodeGenerator::emitGetPropertyNames):
2281         * VM/CodeGenerator.h:
2282         * VM/Machine.cpp:
2283         (KJS::Machine::privateExecute):
2284         * kjs/nodes.cpp:
2285         (KJS::LogicalAndNode::emitCode):
2286         (KJS::LogicalOrNode::emitCode):
2287         (KJS::ConditionalNode::emitCode):
2288         (KJS::IfNode::emitCode):
2289         (KJS::IfElseNode::emitCode):
2290         (KJS::DoWhileNode::emitCode):
2291         (KJS::WhileNode::emitCode):
2292         (KJS::ForNode::emitCode):
2293         (KJS::ForInNode::emitCode):
2294         (KJS::WithNode::emitCode):
2295
2296 2008-05-05  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2297
2298         Reviewed by Oliver.
2299
2300         Bug 18749: SQUIRRELFISH: const support is broken
2301         <https://bugs.webkit.org/show_bug.cgi?id=18749>
2302
2303         Adds support for const during code generation.
2304
2305         Fixes 2 layout tests.
2306
2307         * ChangeLog:
2308         * VM/CodeGenerator.cpp:
2309         (KJS::CodeGenerator::addVar):
2310         (KJS::CodeGenerator::CodeGenerator):
2311         (KJS::CodeGenerator::isLocalConstant):
2312         * VM/CodeGenerator.h:
2313         (KJS::CodeGenerator::addVar):
2314         * kjs/nodes.cpp:
2315         (KJS::PostIncResolveNode::emitCode):
2316         (KJS::PostDecResolveNode::emitCode):
2317         (KJS::PreIncResolveNode::emitCode):
2318         (KJS::PreDecResolveNode::emitCode):
2319         (KJS::ReadModifyResolveNode::emitCode):
2320         (KJS::AssignResolveNode::emitCode):
2321
2322 2008-05-04  Maciej Stachowiak  <mjs@apple.com>
2323
2324         Reviewed by Geoff.
2325         
2326         - document some more opcodes (and fix argument names)
2327         
2328         Added docs for eq, neq, stricteq, nstriceq, less and lesseq.
2329
2330         * VM/CodeGenerator.cpp:
2331         (KJS::CodeGenerator::emitEqual):
2332         (KJS::CodeGenerator::emitNotEqual):
2333         (KJS::CodeGenerator::emitStrictEqual):
2334         (KJS::CodeGenerator::emitNotStrictEqual):
2335         (KJS::CodeGenerator::emitLess):
2336         (KJS::CodeGenerator::emitLessEq):
2337         * VM/CodeGenerator.h:
2338         * VM/Machine.cpp:
2339         (KJS::Machine::privateExecute):
2340         * kjs/nodes.cpp:
2341         (KJS::LessNode::emitCode):
2342         (KJS::GreaterNode::emitCode):
2343         (KJS::LessEqNode::emitCode):
2344         (KJS::GreaterEqNode::emitCode):
2345         (KJS::EqualNode::emitCode):
2346         (KJS::NotEqualNode::emitCode):
2347         (KJS::StrictEqualNode::emitCode):
2348         (KJS::NotStrictEqualNode::emitCode):
2349         (KJS::CaseBlockNode::emitCodeForBlock):
2350
2351 2008-05-04  Geoffrey Garen  <ggaren@apple.com>
2352
2353         Reviewed by Maciej Stachowiak.
2354
2355         More scaffolding for f.arguments.
2356         
2357         Track the offset of the last call frame in the ExecState, so we can
2358         produce a backtrace at any time.
2359         
2360         Also, record numLocals, the sum of numVars + numParameters, in each code
2361         block, to make updates to the ExecState a little cheaper than they
2362         would be otherwise.
2363         
2364         We now use numLocals in a bunch of places where we used to calculate
2365         numVars + numParameters or -numVars - numParameters.
2366         
2367         Reports are mixed, but all in all, this seems to be a wash on SunSpider.
2368
2369 2008-05-04  Oliver Hunt  <oliver@apple.com>
2370
2371         Reviewed by Geoff.
2372
2373         Whoops, correctly handle properties that don't exist in the 
2374         symbol table.
2375
2376         * kjs/JSVariableObject.h:
2377         (KJS::JSVariableObject::symbolTablePutWithAttributes):
2378
2379 2008-05-04  Oliver Hunt  <oliver@apple.com>
2380
2381         Reviewed by Geoff.
2382
2383         Add attribute information to SymbolTable as ground work for
2384         various DontEnum and ReadOnly issues.
2385
2386         * VM/CodeGenerator.cpp:
2387         (KJS::CodeGenerator::addVar):
2388         (KJS::CodeGenerator::CodeGenerator):
2389         (KJS::CodeGenerator::registerForLocal):
2390         (KJS::CodeGenerator::registerForLocalConstInit):
2391         (KJS::CodeGenerator::addConstant):
2392         * VM/Machine.cpp:
2393         (KJS::Machine::execute):
2394         * kjs/JSGlobalObject.cpp:
2395         (KJS::JSGlobalObject::saveLocalStorage):
2396         * kjs/JSVariableObject.cpp:
2397         (KJS::JSVariableObject::getPropertyNames):
2398         (KJS::JSVariableObject::getPropertyAttributes):
2399         * kjs/JSVariableObject.h:
2400         (KJS::JSVariableObject::symbolTablePut):
2401         (KJS::JSVariableObject::symbolTablePutWithAttributes):
2402         * kjs/SymbolTable.h:
2403         (KJS::SymbolTableEntry::SymbolTableEntry):
2404         (KJS::SymbolTableIndexHashTraits::emptyValue):
2405         * kjs/nodes.cpp:
2406         (KJS::getSymbolTableEntry):
2407         (KJS::ReadModifyResolveNode::optimizeVariableAccess):
2408         (KJS::AssignResolveNode::optimizeVariableAccess):
2409         (KJS::ProgramNode::initializeSymbolTable):
2410
2411 2008-05-04  Geoffrey Garen  <ggaren@apple.com>
2412
2413         Reviewed by Oliver Hunt.
2414         
2415         More scaffolding for f.arguments.
2416         
2417         Store the register file associated with an ExecState in the ExecState.
2418         
2419         SunSpider reports no change.
2420
2421         * kjs/JSGlobalObject.h:
2422         (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Moved
2423         registerFileStack above globalExec, so it gets initialized first.
2424         Removed remnants of old activation scheme.
2425
2426 2008-05-04  Maciej Stachowiak  <mjs@apple.com>
2427
2428         Rubber stamped by Oliver.
2429         
2430         - renamed a few opcodes and fixed assembly formatting to accomodate the longest opcode
2431         
2432         equal --> eq
2433         nequal --> neq
2434         resolve_base_and_property --> resolve_with_base
2435         resolve_base_and_func --> resolve_func
2436         get_prop_id --> get_by_id
2437         put_prop_id --> put_by_id
2438         delete_prop_id --> del_by_id
2439         get_prop_val --> get_by_val
2440         put_prop_val --> put_by_val
2441         delete_prop_val --> del_by_val
2442         put_prop_index --> put_by_index
2443         
2444         * VM/CodeBlock.cpp:
2445         (KJS::printUnaryOp):
2446         (KJS::printBinaryOp):
2447         (KJS::printConditionalJump):
2448         (KJS::CodeBlock::dump):
2449         * VM/CodeGenerator.cpp:
2450         (KJS::CodeGenerator::emitEqual):
2451         (KJS::CodeGenerator::emitNotEqual):
2452         (KJS::CodeGenerator::emitResolveWithBase):
2453         (KJS::CodeGenerator::emitResolveFunction):
2454         (KJS::CodeGenerator::emitGetById):
2455         (KJS::CodeGenerator::emitPutById):
2456         (KJS::CodeGenerator::emitDeleteById):
2457         (KJS::CodeGenerator::emitGetByVal):
2458         (KJS::CodeGenerator::emitPutByVal):
2459         (KJS::CodeGenerator::emitDeleteByVal):
2460         (KJS::CodeGenerator::emitPutByIndex):
2461         * VM/CodeGenerator.h:
2462         * VM/Machine.cpp:
2463         (KJS::Machine::privateExecute):
2464         * VM/Opcode.h:
2465         * kjs/nodes.cpp:
2466         (KJS::ArrayNode::emitCode):
2467         (KJS::PropertyListNode::emitCode):
2468         (KJS::BracketAccessorNode::emitCode):
2469         (KJS::DotAccessorNode::emitCode):
2470         (KJS::EvalFunctionCallNode::emitCode):
2471         (KJS::FunctionCallResolveNode::emitCode):
2472         (KJS::FunctionCallBracketNode::emitCode):
2473         (KJS::FunctionCallDotNode::emitCode):
2474         (KJS::PostIncResolveNode::emitCode):
2475         (KJS::PostDecResolveNode::emitCode):
2476         (KJS::PostIncBracketNode::emitCode):
2477         (KJS::PostDecBracketNode::emitCode):
2478         (KJS::PostIncDotNode::emitCode):
2479         (KJS::PostDecDotNode::emitCode):
2480         (KJS::DeleteResolveNode::emitCode):
2481         (KJS::DeleteBracketNode::emitCode):
2482         (KJS::DeleteDotNode::emitCode):
2483         (KJS::TypeOfResolveNode::emitCode):
2484         (KJS::PreIncResolveNode::emitCode):
2485         (KJS::PreDecResolveNode::emitCode):
2486         (KJS::PreIncBracketNode::emitCode):
2487         (KJS::PreDecBracketNode::emitCode):
2488         (KJS::PreIncDotNode::emitCode):
2489         (KJS::PreDecDotNode::emitCode):
2490         (KJS::ReadModifyResolveNode::emitCode):
2491         (KJS::AssignResolveNode::emitCode):
2492         (KJS::AssignDotNode::emitCode):
2493         (KJS::ReadModifyDotNode::emitCode):
2494         (KJS::AssignBracketNode::emitCode):
2495         (KJS::ReadModifyBracketNode::emitCode):
2496         (KJS::ConstDeclNode::emitCodeSingle):
2497         (KJS::ForInNode::emitCode):
2498         (KJS::TryNode::emitCode):
2499
2500 2008-05-04  Oliver Hunt  <oliver@apple.com>
2501
2502         Reviewed by Maciej.
2503
2504         Fix assertion when accessing arguments object with too many arguments provided
2505
2506         The arguments constructor was assuming that the register offset given for argv
2507         was an absolute offset into the registerfile, rather than the offset from the
2508         frame.  This patches corrects that issue.
2509
2510         * kjs/JSActivation.cpp:
2511         (KJS::JSActivation::createArgumentsObject):
2512
2513 2008-05-04  Geoffrey Garen  <ggaren@apple.com>
2514
2515         Rubber stamped by Sam Weinig.
2516         
2517         Cleaned up Machine.cpp according to our style guidelines: moved static
2518         data to the top of the file; moved stand-alone functions below that;
2519         moved the Machine constructor above other Machine member functions.
2520
2521 2008-05-03  Maciej Stachowiak  <mjs@apple.com>
2522
2523         Reviewed by Sam.
2524         
2525         - fix accidental breakage from last patch
2526
2527         * VM/Machine.cpp:
2528         (KJS::Machine::privateExecute):
2529
2530 2008-05-03  Maciej Stachowiak  <mjs@apple.com>
2531
2532         Reviewed by Geoff.
2533         
2534         - a bunch more opcode documentation and corresponding parameter name fixes
2535
2536         I renamed a few opcodes:
2537         
2538         type_of --> typeof (that's what the JS operator is named)
2539         instance_of --> instanceof (ditto)
2540         create_error --> new_error (for consistency with other new_* opcodes)
2541         
2542         I documented the following opcodes:
2543         
2544         - load
2545         - new_object
2546         - new_array
2547         - new_regexp
2548         - mov
2549         - pre_inc
2550         - pre_dec
2551         - post_inc
2552         - post_dec
2553         - to_jsnumber
2554         - negate
2555         - bitnot
2556         - not
2557         - instanceof
2558         - typeof
2559         - in
2560         - new_func
2561         - new_funcexp
2562         - new_error
2563
2564         I also fixed formatting on some existing opcode docs.
2565         
2566         * VM/CodeBlock.cpp:
2567         (KJS::CodeBlock::dump):
2568         * VM/CodeGenerator.cpp:
2569         (KJS::CodeGenerator::emitMove):
2570         (KJS::CodeGenerator::emitNot):
2571         (KJS::CodeGenerator::emitPreInc):
2572         (KJS::CodeGenerator::emitPreDec):
2573         (KJS::CodeGenerator::emitPostInc):
2574         (KJS::CodeGenerator::emitPostDec):
2575         (KJS::CodeGenerator::emitToJSNumber):
2576         (KJS::CodeGenerator::emitNegate):
2577         (KJS::CodeGenerator::emitBitNot):
2578         (KJS::CodeGenerator::emitInstanceOf):
2579         (KJS::CodeGenerator::emitTypeOf):
2580         (KJS::CodeGenerator::emitIn):
2581         (KJS::CodeGenerator::emitLoad):
2582         (KJS::CodeGenerator::emitNewObject):
2583         (KJS::CodeGenerator::emitNewArray):
2584         (KJS::CodeGenerator::emitNewRegExp):
2585         (KJS::CodeGenerator::emitNewError):
2586         * VM/CodeGenerator.h:
2587         (KJS::CodeGenerator::scopeDepth):
2588         (KJS::CodeGenerator::addVar):
2589         * VM/Machine.cpp:
2590         (KJS::Machine::privateExecute):
2591         * VM/Opcode.h:
2592         * kjs/nodes.cpp:
2593         (KJS::Node::emitThrowError):
2594         (KJS::RegExpNode::emitCode):
2595         (KJS::TypeOfValueNode::emitCode):
2596         (KJS::UnaryPlusNode::emitCode):
2597         (KJS::NegateNode::emitCode):
2598         (KJS::BitwiseNotNode::emitCode):
2599         (KJS::LogicalNotNode::emitCode):
2600         (KJS::InstanceOfNode::emitCode):
2601         (KJS::InNode::emitCode):
2602
2603 2008-05-03  Maciej Stachowiak  <mjs@apple.com>
2604
2605         Reviewed by Geoff and Sam.
2606         
2607         - generate HTML bytecode docs at build time
2608
2609         * DerivedSources.make:
2610         * docs: Added.
2611         * docs/make-bytecode-docs.pl: Added.
2612
2613 2008-05-03  Geoffrey Garen  <ggaren@apple.com>
2614
2615         Reviewed by Sam Weinig.
2616         
2617         Update ExecState::m_scopeChain when switching scope chains inside the
2618         machine.
2619         
2620         This fixes uses of lexicalGlobalObject, such as, in a subframe
2621
2622             alert(top.makeArray() instanceof Array ? "FAIL" : "PASS");
2623         
2624         and a bunch of the security failures listed in
2625         https://bugs.webkit.org/show_bug.cgi?id=18870. (Those tests still fail,
2626         seemingly because of regressions in exception messages).
2627         
2628         SunSpider reports no change.
2629
2630         * VM/Machine.cpp: Factored out scope chain updating into a common
2631         function that takes care to update ExecState::m_scopeChain, too.
2632
2633         * kjs/ExecState.h: I made Machine a friend of ExecState so that Machine
2634         could update ExecState::m_scopeChain, even though that value is
2635         read-only for everyone else.
2636
2637         * kjs/JSGlobalObject.h:
2638         (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Changed
2639         this client to be a little friendlier to ExecState's internal
2640         storage type for scope chain data.
2641
2642 2008-05-03  Geoffrey Garen  <ggaren@apple.com>
2643
2644         Reviewed by Sam Weinig.
2645         
2646         Fixed https://bugs.webkit.org/show_bug.cgi?id=18876
2647         Squirrelfish: ScopeChainNode leak in op_jmp_scopes.
2648         
2649         SunSpider reports no change.
2650
2651         * VM/Machine.cpp:
2652         (KJS::Machine::privateExecute): Don't construct a ScopeChain object,
2653         since the direct threaded interpreter will goto across its destructor.
2654
2655 2008-05-03  Geoffrey Garen  <ggaren@apple.com>
2656
2657         Reviewed by Oliver Hunt.
2658         
2659         A bit more efficient fix than r32832: Don't copy globals into function
2660         register files; instead, have the RegisterFileStack track only the base
2661         of the last *global* register file, so the global object's register
2662         references stay good.
2663         
2664         SunSpider reports a .3% speedup. Not sure what that's about.
2665
2666 2008-05-03  Oliver Hunt  <oliver@apple.com>
2667
2668         Reviewed by Maciej.
2669
2670         Bug 18864: SquirrelFish: Support getter and setter definition in object literals
2671         <https://bugs.webkit.org/show_bug.cgi?id=18864>
2672
2673         Add new opcodes to allow us to add getters and setters to an object.  These are
2674         only used by the codegen for object literals.
2675
2676         * VM/CodeGenerator.cpp:
2677         (KJS::CodeGenerator::emitPutGetter):
2678         (KJS::CodeGenerator::emitPutSetter):
2679         * VM/CodeGenerator.h:
2680         * VM/Machine.cpp:
2681         (KJS::Machine::privateExecute):
2682         * VM/Opcode.h:
2683         * kjs/nodes.cpp:
2684         (KJS::PropertyListNode::emitCode):
2685
2686 2008-05-02  Maciej Stachowiak  <mjs@apple.com>
2687
2688         Reviewed by Oliver.
2689         
2690         - properly copy globals into and out of implicit call register
2691         files, otherwise they will fail at global lookup
2692
2693         Fixes fast/js/array-tostring-and-join.html layout test.
2694         
2695         * VM/RegisterFileStack.cpp:
2696         (KJS::RegisterFileStack::pushGlobalRegisterFile):
2697         (KJS::RegisterFileStack::popGlobalRegisterFile):
2698         (KJS::RegisterFileStack::pushFunctionRegisterFile):
2699         (KJS::RegisterFileStack::popFunctionRegisterFile):
2700
2701 2008-05-02  Geoffrey Garen  <ggaren@apple.com>
2702
2703         Reviewed by Oliver Hunt.
2704         
2705         Fixed https://bugs.webkit.org/show_bug.cgi?id=18822
2706         SQUIRRELFISH: incorrect eval used in some cases
2707         
2708         Changed all code inside the machine to fetch the lexical global object
2709         directly from the scope chain, instead of from the ExecState.
2710         
2711         Clients who fetch the lexical global object through the ExecState
2712         still don't work.
2713         
2714         SunSpider reports no change.
2715
2716         * VM/Machine.cpp:
2717         (KJS::Machine::privateExecute): Fetch the lexical global object from
2718         the scope chain.
2719         
2720         * kjs/ExecState.h:
2721         (KJS::ExecState::ExecState::lexicalGlobalObject): Moved the logic for
2722         this function into ScopeChainNode, but kept this function around to
2723         support existing clients.
2724
2725 2008-05-02  Geoffrey Garen  <ggaren@apple.com>
2726
2727         Rubber stamped by Oliver Hunt.
2728         
2729         Removed ExecState.cpp from AllInOneFile.cpp, for a .2% speedup.
2730
2731         * JavaScriptCore.xcodeproj/project.pbxproj:
2732         * kjs/AllInOneFile.cpp:
2733
2734 2008-05-01  Oliver Hunt  <oliver@apple.com>
2735
2736         Reviewed by Geoff and Maciej.
2737
2738         Bug 18827: SquirrelFish: Prevent getters and setters from destroying the current RegisterFile
2739         <https://bugs.webkit.org/show_bug.cgi?id=18827>
2740
2741         Remove safe/unsafe RegisterFile concept, and instead just add additional
2742         logic to ensure we always push/pop RegisterFiles when executing getters
2743         and setters, similar to the logic for valueOf and toString.
2744
2745         * VM/Machine.cpp:
2746         (KJS::Machine::privateExecute):
2747         * VM/RegisterFile.h:
2748         * kjs/function.cpp:
2749         (KJS::FunctionImp::callAsFunction):
2750         * kjs/object.cpp:
2751         (KJS::JSObject::put):
2752         * kjs/property_slot.cpp:
2753         (KJS::PropertySlot::functionGetter):
2754
2755 2008-05-01  Oliver Hunt  <oliver@apple.com>
2756
2757         RS=Geoff
2758
2759         Rename unsafeForReentry to safeForReentry to avoid double negatives.
2760
2761         * VM/Machine.cpp:
2762         (KJS::Machine::privateExecute):
2763         * VM/RegisterFile.h:
2764         * kjs/function.cpp:
2765         (KJS::FunctionImp::callAsFunction):
2766
2767 2008-05-01  Oliver Hunt  <oliver@apple.com>
2768
2769         Reviewed by Maciej.
2770
2771         Bug 18827: SquirrelFish: Prevent getters and setters from destroying the current RegisterFile
2772         <https://bugs.webkit.org/show_bug.cgi?id=18827>
2773         
2774         This patch makes getters and setters work.  It does this by
2775         tracking whether the RegisterFile is "safe", that is whether
2776         the interpreter is in a state that in which it can handle
2777         the RegisterFile being reallocated.
2778
2779         * VM/Machine.cpp:
2780         (KJS::resolve):
2781         (KJS::Machine::privateExecute):
2782         * VM/RegisterFile.h:
2783         * kjs/function.cpp:
2784         (KJS::FunctionImp::callAsFunction):
2785
2786 2008-04-30  Geoffrey Garen  <ggaren@apple.com>
2787
2788         Release build fix: Always compile in "isGlobalObject", since it's
2789         listed in our .exp file.
2790
2791         * kjs/ExecState.cpp:
2792         (KJS::ExecState::isGlobalObject):
2793         * kjs/ExecState.h:
2794
2795 2008-04-30  Oliver Hunt  <oliver@apple.com>
2796
2797         Reviewed by Maciej.
2798
2799         Minor code restructuring to prepare for getters and setters, 
2800         also helps exception semantics a bit.
2801
2802         * VM/Machine.cpp:
2803         (KJS::Machine::privateExecute):
2804
2805 2008-04-30  Geoffrey Garen  <ggaren@apple.com>
2806
2807         Fixed tyop.
2808
2809         * kjs/ExecState.h:
2810
2811 2008-04-30  Geoffrey Garen  <ggaren@apple.com>
2812
2813         Debug build fix: export a missing symbol.
2814
2815         * JavaScriptCore.exp:
2816
2817 2008-04-30  Geoffrey Garen  <ggaren@apple.com>
2818
2819         Reviewed by Oliver Hunt.
2820         
2821         A little more ExecState refactoring: Now, only the global object creates
2822         an ExecState.
2823         
2824         Also inlined ExecState::lexicalGlobalObject().
2825         
2826         SunSpider reports no change.
2827
2828 2008-04-30  Geoffrey Garen  <ggaren@apple.com>
2829
2830         WebCore build fix: forward-declare ScopeChain.
2831
2832         * kjs/interpreter.h:
2833
2834 2008-04-30  Geoffrey Garen  <ggaren@apple.com>
2835
2836         Build fix for JavaScriptGlue: export a missing symbol.
2837
2838         * JavaScriptCore.exp:
2839
2840 2008-04-30  Geoffrey Garen  <ggaren@apple.com>
2841
2842         Reviewed by Oliver Hunt.
2843         
2844         Removed a lot of unused bits from ExecState, moving them into
2845         OldInterpreterExecState, the fake scaffolding class.
2846         
2847         The clutter was making it hard to see the forest from the trees.
2848         
2849         .4% SunSpider speedup, probably because ExecState::lexicalGlobalObject()
2850         is faster now.
2851
2852 2008-04-29  Oliver Hunt  <oliver@apple.com>
2853
2854         Reviewed by Maciej.
2855
2856         Bug 18643: SQUIRRELFISH: need to support implicit function calls (valueOf, toString, getters/setters)
2857         <https://bugs.webkit.org/show_bug.cgi?id=18643>
2858
2859         Prevent static slot optimisation for new variables and functions in
2860         globally re-entrant code called from an an implicit function call.
2861
2862         This is necessary to prevent us from needing to resize the global
2863         slot portion of the root RegisterFile during an implicit (and hence
2864         unguarded) function call.
2865
2866         * VM/CodeGenerator.cpp:
2867         (KJS::CodeGenerator::CodeGenerator):
2868         * VM/CodeGenerator.h:
2869         * VM/Machine.cpp:
2870         (KJS::Machine::execute):
2871         * VM/RegisterFile.h:
2872         * VM/RegisterFileStack.cpp:
2873         (KJS::RegisterFileStack::pushGlobalRegisterFile):
2874         (KJS::RegisterFileStack::popGlobalRegisterFile):
2875         (KJS::RegisterFileStack::pushFunctionRegisterFile):
2876         (KJS::RegisterFileStack::popFunctionRegisterFile):
2877         * VM/RegisterFileStack.h:
2878         (KJS::RegisterFileStack::inImplicitFunctionCall):
2879         (KJS::RegisterFileStack::lastGlobal):
2880         * kjs/nodes.cpp:
2881         (KJS::ProgramNode::generateCode):
2882         * kjs/nodes.h:
2883         (KJS::ProgramNode::):
2884
2885 2008-04-29  Geoffrey Garen  <ggaren@apple.com>
2886
2887         Reviewed by Oliver Hunt.
2888         
2889         In nested program code, don't propogate "this" back to the parent
2890         register file. ("this" should remain constant in the parent register
2891         file, regardless of the scripts it invokes.)
2892
2893         * VM/RegisterFile.cpp:
2894         (KJS::RegisterFile::copyGlobals):
2895
2896 2008-04-28  Oliver Hunt  <oliver@apple.com>
2897
2898         Reviewed by Geoff.
2899
2900         Restore base pointer when popping a global RegisterFile
2901
2902         * VM/RegisterFileStack.cpp:
2903         (KJS::RegisterFileStack::popGlobalRegisterFile):
2904
2905 2008-04-28  Oliver Hunt  <oliver@apple.com>
2906
2907         Reviewed by Geoff.
2908
2909         Bug 18643: SQUIRRELFISH: need to support implicit function calls (valueOf, toString, getters/setters)
2910         <https://bugs.webkit.org/show_bug.cgi?id=18643>
2911
2912         Partial fix.  This results in all implicit calls to toString or valueOf
2913         executing in a separate RegisterFile, so ensuring that the the pointers
2914         in the triggering interpreter don't get trashed.  This still leaves the
2915         task of preventing new global re-entry from toString and valueOf from
2916         clobbering the RegisterFile.
2917
2918         * VM/Machine.cpp:
2919         (KJS::Machine::execute):
2920         * VM/RegisterFileStack.cpp:
2921         (KJS::RegisterFileStack::pushFunctionRegisterFile):
2922         (KJS::RegisterFileStack::popFunctionRegisterFile):
2923         * VM/RegisterFileStack.h:
2924         * kjs/object.cpp:
2925         (KJS::tryGetAndCallProperty):
2926
2927 2008-04-28  Geoffrey Garen  <ggaren@apple.com>
2928
2929         Reviewed by Maciej Stachowiak.
2930         
2931         Simplified activation object a bit: No need to store the callee
2932         in the activation object -- we can pull it out of the call frame
2933         when needed, instead.
2934         
2935         SunSpider reports no change.
2936
2937 2008-04-28  Geoffrey Garen  <ggaren@apple.com>
2938
2939         Reviewed by Maciej Stachowiak.
2940         
2941         RS by Oliver Hunt on moving JSArguments.cpp out of AllInOneFile.cpp.
2942
2943         Substantially more handling of "arguments": "arguments" works fully
2944         now, but "f.arguments" still doesn't work.
2945
2946         Fixes 10 regression tests.
2947         
2948         SunSpider reports no regression.
2949
2950         * kjs/JSActivation.cpp:
2951         (KJS::JSActivation::createArgumentsObject): Reconstruct an arguments
2952         List to pass to the arguments object constructor.
2953
2954         * JavaScriptCore.xcodeproj/project.pbxproj:
2955         * kjs/AllInOneFile.cpp: Removed JSActivation.cpp from AllInOneFile.cpp
2956         because that seems to make GCC happy. (Previously, I had added
2957         JSActivation.cpp to AllInOneFile.cpp because *that* seemed to make GCC
2958         happy. So it goes.)
2959
2960 2008-04-28  Geoffrey Garen  <ggaren@apple.com>
2961
2962         Reviewed by Maciej Stachowiak.
2963         
2964         Groundwork for more handling of "arguments". I'm not checking in the
2965         actual handling of "arguments" yet, because it still needs a little
2966         fiddling to avoid a performance regression.
2967         
2968         SunSpider reports no change.
2969
2970         * VM/Machine.cpp:
2971         (KJS::initializeCallFrame): Put argc in the register file, so the
2972         arguments object can find it later, to determine arguments.length.
2973
2974         * kjs/nodes.h:
2975         (KJS::FunctionBodyNode::): Added a special code accessor for when you
2976         know the code has already been generated, and you don't have a scopeChain
2977         to supply for potential code generation. (This is the case when the
2978         activation object creates the arguments object.)
2979
2980 2008-04-28  Oliver Hunt  <oliver@apple.com>
2981
2982         Reviewed by Geoff.
2983
2984         Replace unsafe use of auto_ptr in Vector with manual memory
2985         management.
2986
2987         * VM/RegisterFileStack.cpp:
2988         (KJS::RegisterFileStack::~RegisterFileStack):
2989         (KJS::RegisterFileStack::popRegisterFile):
2990         * VM/RegisterFileStack.h:
2991
2992 2008-04-27  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2993
2994         Reviewed by Maciej.
2995
2996         Bug 18746: SQUIRRELFISH: indirect eval used when direct eval should be used
2997         <https://bugs.webkit.org/show_bug.cgi?id=18746>
2998
2999         Change the base to the correct value of the 'this' object after the direct
3000         eval test instead of before.
3001
3002         Fixes 5 layout tests.
3003
3004         * VM/Machine.cpp:
3005         (KJS::Machine::privateExecute):
3006         * kjs/nodes.cpp:
3007         (KJS::EvalFunctionCallNode::emitCode):
3008
3009 2008-04-26  Maciej Stachowiak  <mjs@apple.com>
3010
3011         Reviewed by Oliver.
3012         
3013         - document all property getting, setting and deleting opcodes
3014         
3015         (And fix function parameter names to match corresponding opcode parameter names.)
3016
3017         * VM/CodeGenerator.cpp:
3018         (KJS::CodeGenerator::emitResolve):
3019         (KJS::CodeGenerator::emitResolveBase):
3020         (KJS::CodeGenerator::emitResolveBaseAndProperty):
3021         (KJS::CodeGenerator::emitResolveBaseAndFunc):
3022         (KJS::CodeGenerator::emitGetPropId):
3023         (KJS::CodeGenerator::emitPutPropId):
3024         (KJS::CodeGenerator::emitDeletePropId):
3025         (KJS::CodeGenerator::emitPutPropVal):
3026         * VM/CodeGenerator.h:
3027         * VM/Machine.cpp:
3028         (KJS::resolve):
3029         (KJS::resolveBase):
3030         (KJS::resolveBaseAndProperty):
3031         (KJS::resolveBaseAndFunc):
3032         (KJS::Machine::privateExecute):
3033         * kjs/nodes.cpp:
3034         (KJS::ResolveNode::emitCode):
3035         (KJS::ArrayNode::emitCode):
3036         (KJS::PropertyListNode::emitCode):
3037         (KJS::BracketAccessorNode::emitCode):
3038         (KJS::EvalFunctionCallNode::emitCode):
3039         (KJS::FunctionCallResolveNode::emitCode):
3040         (KJS::FunctionCallBracketNode::emitCode):
3041         (KJS::PostIncResolveNode::emitCode):
3042         (KJS::PostDecResolveNode::emitCode):
3043         (KJS::PostIncBracketNode::emitCode):
3044         (KJS::PostDecBracketNode::emitCode):
3045         (KJS::PostIncDotNode::emitCode):
3046         (KJS::PostDecDotNode::emitCode):
3047         (KJS::DeleteResolveNode::emitCode):
3048         (KJS::TypeOfResolveNode::emitCode):
3049         (KJS::PreIncResolveNode::emitCode):
3050         (KJS::PreDecResolveNode::emitCode):
3051         (KJS::PreIncBracketNode::emitCode):
3052         (KJS::PreDecBracketNode::emitCode):
3053         (KJS::AssignResolveNode::emitCode):
3054         (KJS::AssignDotNode::emitCode):
3055         (KJS::ReadModifyDotNode::emitCode):
3056         (KJS::AssignBracketNode::emitCode):
3057         (KJS::ReadModifyBracketNode::emitCode):
3058         (KJS::ConstDeclNode::emitCodeSingle):
3059
3060 2008-04-26  Oliver Hunt  <oliver@apple.com>
3061
3062         Reviewed by Maciej.
3063
3064         Bug 18628: SQUIRRELFISH: need to support recursion limit
3065         <https://bugs.webkit.org/show_bug.cgi?id=18628>
3066
3067         Basically completes recursion limiting.  There is still some
3068         tuning we may want to do to make things better in the face of
3069         very bad code, but certainly nothing worse than anything already
3070         possible in trunk.
3071
3072         Also fixes a WebKit test by fixing the exception text :D
3073
3074         * JavaScriptCore.exp:
3075         * VM/ExceptionHelpers.cpp:
3076         * VM/Machine.cpp:
3077         (KJS::Machine::execute):
3078         * VM/RegisterFile.cpp:
3079         (KJS::RegisterFile::growBuffer):
3080         (KJS::RegisterFile::addGlobalSlots):
3081         * VM/RegisterFile.h:
3082         (KJS::RegisterFile::grow):
3083         (KJS::RegisterFile::uncheckedGrow):
3084         * VM/RegisterFileStack.cpp:
3085         (KJS::RegisterFileStack::pushRegisterFile):
3086         * VM/RegisterFileStack.h:
3087
3088 2008-04-25  Oliver Hunt  <oliver@apple.com>
3089
3090         Reviewed by Geoff.
3091
3092         Bug 18628: SQUIRRELFISH: need to support recursion limit
3093         <https://bugs.webkit.org/show_bug.cgi?id=18628>
3094
3095         Put a limit on the level of reentry recursion.  128 levels of re-entrant recursion
3096         seems reasonable as it is greater than the old eval limit, and a long way short of
3097         the reentry depth needed to overflow the stack.
3098
3099         * VM/Machine.cpp:
3100         (KJS::Machine::execute):
3101         * VM/Machine.h:
3102
3103 2008-04-25  Geoffrey Garen  <ggaren@apple.com>
3104
3105         Reviewed by Sam Weinig.
3106         
3107         A tiny bit of cleanup to the regexp code.
3108         
3109         Removed some static_cast.
3110         
3111         Removed createRegExpImp because it's no longer used.
3112
3113 2008-04-25  Oliver Hunt  <oliver@apple.com>
3114
3115         Reviewed by Maciej.
3116
3117         Bug 18736: SQUIRRELFISH: switch statements with no default have incorrect codegen
3118         <https://bugs.webkit.org/show_bug.cgi?id=18736>
3119
3120         Ensure the "default" target is correct in the absence of an explicit default handler.
3121
3122         * kjs/nodes.cpp:
3123         (KJS::CaseBlockNode::emitCodeForBlock):
3124
3125 2008-04-25  Oliver Hunt  <oliver@apple.com>
3126
3127         Reviewed by Maciej.
3128
3129         Bug 18628: SQUIRRELFISH: need to support recursion limit
3130         <https://bugs.webkit.org/show_bug.cgi?id=18628>
3131
3132         More bounds checking.
3133
3134         * VM/Machine.cpp:
3135         (KJS::Machine::execute):
3136         * VM/RegisterFile.cpp:
3137         (KJS::RegisterFile::growBuffer):
3138         * VM/RegisterFile.h:
3139
3140 2008-04-25  Maciej Stachowiak  <mjs@apple.com>
3141
3142         Reviewed by Oliver.
3143         
3144         - fix signal catching magic
3145         
3146         The signal handlers are restored to _exit but are only set when
3147         running under run-javascriptcore-tests. fprintf from a signal
3148         handler is not safe.
3149
3150         * kjs/testkjs.cpp:
3151         (main):
3152         (parseArguments):
3153         * tests/mozilla/jsDriver.pl:
3154
3155 2008-04-25  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3156
3157         Reviewed by Maciej.
3158
3159         Bug 18732: SQUIRRELFISH: exceptions thrown by native constructors are ignored
3160         <https://bugs.webkit.org/show_bug.cgi?id=18732>
3161
3162         Fixes another regression test.
3163
3164         * VM/Machine.cpp:
3165         (KJS::Machine::privateExecute):
3166
3167 2008-04-25  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3168
3169         Reviewed by Maciej.
3170
3171         Bug 18728: SQUIRRELFISH: invalid regular expression constants should throw exceptions
3172         <https://bugs.webkit.org/show_bug.cgi?id=18728>
3173
3174         Fixes another regression test.
3175
3176         * kjs/nodes.cpp:
3177         (KJS::RegExpNode::emitCode):
3178
3179 2008-04-24  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3180
3181         Reviewed by Geoffrey Garen.
3182
3183         Bug 18735: SQUIRRELFISH: closures are sometimes given an incorrect 'this' value when called
3184         <https://bugs.webkit.org/show_bug.cgi?id=18735>
3185
3186         The overloaded toThisObject method was not copied over to JSActivation.
3187
3188         Fixes two regression tests.
3189
3190         * kjs/JSActivation.cpp:
3191         (KJS::JSActivation::toThisObject):
3192         * kjs/JSActivation.h:
3193
3194 2008-04-24  Geoffrey Garen  <ggaren@apple.com>
3195
3196         Reviewed by Oliver Hunt.
3197         
3198         Added support for arguments.callee.
3199
3200 2008-04-24  Oliver Hunt  <oliver@apple.com>
3201
3202         Reviewed by Maciej.
3203
3204         Bug 18628: SQUIRRELFISH: need to support recursion limit
3205         <https://bugs.webkit.org/show_bug.cgi?id=18628>
3206
3207         Partial fix -- this gets us some of the required bounds checking, but not
3208         complete coverage.  But it does manage to do them without regressing :D
3209
3210         * VM/ExceptionHelpers.cpp:
3211         (KJS::createError):
3212         (KJS::createStackOverflowError):
3213         * VM/ExceptionHelpers.h:
3214         * VM/Machine.cpp:
3215         (KJS::slideRegisterWindowForCall):
3216         (KJS::Machine::execute):
3217         (KJS::Machine::privateExecute):
3218         * VM/RegisterFile.cpp:
3219         * VM/RegisterFile.h:
3220         (KJS::RegisterFile::):
3221         (KJS::RegisterFile::RegisterFile):
3222         (KJS::RegisterFile::grow):
3223
3224 2008-04-24  Geoffrey Garen  <ggaren@apple.com>
3225
3226         Reviewed by Oliver Hunt.
3227         
3228         A tiny bit more handling of "arguments": create a real, but mostly
3229         hollow, arguments object.
3230         
3231         Fixes 2 regression tests.
3232
3233 2008-04-24  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3234
3235         Reviewed by Oliver.
3236
3237         Bug 18717: SQUIRRELFISH: eval returns the wrong value for a variable declaration statement
3238         <https://bugs.webkit.org/show_bug.cgi?id=18717>
3239
3240         Fixes a regression test, but exposes the failure of another due to the
3241         lack of getters and setters.
3242
3243         * kjs/nodes.cpp:
3244         (KJS::ConstDeclNode::emitCodeSingle):
3245         (KJS::ConstDeclNode::emitCode):
3246         (KJS::ConstStatementNode::emitCode):
3247         (KJS::VarStatementNode::emitCode):
3248         * kjs/nodes.h:
3249
3250 2008-04-24  Geoffrey Garen  <ggaren@apple.com>
3251
3252         Reviewed by Sam Weinig.
3253         
3254         Print a CRASH statement when crashing, so test failures are not a
3255         mystery.
3256
3257         * kjs/testkjs.cpp:
3258         (handleCrash):
3259         (main):
3260
3261 2008-04-24  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3262
3263         Reviewed by Geoffrey Garen.
3264
3265         Bug 18716: SQUIRRELFISH: typeof should return undefined for an undefined variable reference
3266         <https://bugs.webkit.org/show_bug.cgi?id=18716>
3267
3268         This fixes 2 more regression tests.
3269
3270         * kjs/nodes.cpp:
3271         (KJS::TypeOfResolveNode::emitCode):
3272
3273 2008-04-24  Geoffrey Garen  <ggaren@apple.com>
3274
3275         Reviewed by Sam Weinig.
3276         
3277         Put the callee in the call frame.
3278         
3279         Necessary in order to support "arguments" and "arguments.callee".
3280
3281         Also fixes a latent GC bug, where an executing function could be
3282         subject to GC if the register holding it were overwritten. Here's
3283         an example that would have caused problems:
3284         
3285         function f()
3286         {
3287             // Flood the machine stack to eliminate any old pointers to f.
3288             g.call({});
3289             
3290             // Overwrite f in the register file.
3291             f = 1;
3292
3293             // Force a GC.
3294             for (var i = 0; i < 5000; ++i) {
3295                 ({});
3296             }
3297             
3298             // Welcome to crash-ville.
3299         }
3300
3301         function g()
3302         {
3303         }
3304
3305         f();
3306
3307         * VM/Machine.h: Changed the order of arguments to
3308         execute(FunctionBodyNode*...) to match the other execute functions.
3309         * kjs/function.cpp: Updated to match new argument requirements from
3310         execute(FunctionBodyNode*...). Renamed newObj to thisObj to match the
3311         rest of JavaScriptCore.
3312
3313         SunSpider reports no change.
3314
3315 2008-04-23  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3316
3317         Reviewed by Maciej.
3318
3319         Bug 18707: SQUIRRELFISH: eval always performs toString() on its argument
3320         <https://bugs.webkit.org/show_bug.cgi?id=18707>
3321
3322         This fixes 4 more regression tests.
3323
3324         * VM/Machine.cpp:
3325         (KJS::eval):
3326
3327 2008-04-23  Maciej Stachowiak  <mjs@apple.com>
3328
3329         Reviewed by Oliver.
3330         
3331         - fix logic bug in SegmentedVector::grow which would sometimes fail to resize a segment when needed
3332         
3333         Fixes 3 JSC tests.
3334
3335         * VM/SegmentedVector.h:
3336         (KJS::SegmentedVector::grow):
3337
3338 2008-04-23  Geoffrey Garen  <ggaren@apple.com>
3339
3340         Reviewed by Maciej Stachowiak.
3341         
3342         Degenerate handling of "arguments" as a property of the activation
3343         object. Currently, we just return a vanilla object.
3344         
3345         SunSpider reports no change.
3346
3347         Fixes:
3348
3349         ecma_3/Function/regress-94506.js.
3350         
3351         Reveals to have been secretly broken:
3352
3353         ecma_3/Function/15.3.4.3-1.js
3354         ecma_3/Function/15.3.4.4-1.js
3355         
3356         These tests were passing incorrectly. testkjs creates a global array
3357         named "arguments" to hold command-line arguments. That array was
3358         tricking these tests into thinking that an arguments object with length
3359         0 had been created. Since our new vanilla object shadows the global
3360         property named arguments, that object no longer fools these tests into
3361         passing.
3362         
3363         Net change: +1 failing test.
3364
3365         * kjs/AllInOneFile.cpp: Had to put JSActivation.cpp into AllInOneFile.cpp
3366         to solve a surprising 8.6% regression in bitops-3bit-bits-in-byte.
3367
3368 2008-04-23  Maciej Stachowiak  <mjs@apple.com>
3369
3370         Reviewed by Oliver.
3371         
3372         - save and restore callFrame
3373
3374         * VM/Machine.cpp:
3375         (KJS::slideRegisterWindowForCall):
3376         (KJS::Machine::execute):
3377         (KJS::Machine::privateExecute):
3378         * kjs/testkjs.cpp:
3379         (main):
3380
3381 2008-04-23  Geoffrey Garen  <ggaren@apple.com>
3382
3383         Reviewed by Maciej Stachowiak.
3384         
3385         Fixed scopes for named function expressions.
3386         
3387         Fixes one regression test.
3388         
3389         Two changes here:
3390         
3391         (1) The function's name is supposed to have attributes DontDelete,
3392         ReadOnly, regardless of the type of code executing.
3393         
3394         (2) Push the name object on the function's scope chain, rather than
3395         the ExecState's scope chain because, well, that's where it belongs.
3396
3397 2008-04-23  Geoffrey Garen  <ggaren@apple.com>
3398
3399         Reviewed by Oliver Hunt.
3400         
3401         Inlined JSObject::putDirect, for a .4% SunSpider speedup.
3402         
3403         I did this as a first step toward removing nodes.cpp from
3404         AllInOneFile.cpp, but I'm putting that larger project aside for now.
3405
3406 2008-04-23  Maciej Stachowiak  <mjs@apple.com>
3407
3408         Rubber stamped by Geoff.
3409         
3410         - add OldInterpreterExecState class and use it in dead code
3411         
3412         This will allow removing things from the real ExecState class
3413         without having to figure out how to remove all this code without
3414         getting a perf regression.
3415
3416         * kjs/nodes.cpp:
3417         (KJS::ExpressionNode::evaluateToNumber):
3418         (KJS::ExpressionNode::evaluateToBoolean):
3419         (KJS::ExpressionNode::evaluateToInt32):
3420         (KJS::ExpressionNode::evaluateToUInt32):
3421         (KJS::Node::setErrorCompletion):
3422         (KJS::Node::throwError):
3423         (KJS::Node::throwUndefinedVariableError):
3424         (KJS::Node::handleException):
3425         (KJS::Node::rethrowException):
3426         (KJS::BreakpointCheckStatement::execute):
3427         (KJS::BreakpointCheckStatement::optimizeVariableAccess):
3428         (KJS::NullNode::evaluate):
3429         (KJS::FalseNode::evaluate):
3430         (KJS::TrueNode::evaluate):
3431         (KJS::NumberNode::evaluate):
3432         (KJS::NumberNode::evaluateToNumber):
3433         (KJS::NumberNode::evaluateToBoolean):
3434         (KJS::NumberNode::evaluateToInt32):
3435         (KJS::NumberNode::evaluateToUInt32):
3436         (KJS::ImmediateNumberNode::evaluate):
3437         (KJS::ImmediateNumberNode::evaluateToInt32):
3438         (KJS::ImmediateNumberNode::evaluateToUInt32):
3439         (KJS::StringNode::evaluate):
3440         (KJS::StringNode::evaluateToNumber):
3441         (KJS::StringNode::evaluateToBoolean):
3442         (KJS::RegExpNode::evaluate):
3443         (KJS::ThisNode::evaluate):
3444         (KJS::ResolveNode::inlineEvaluate):
3445         (KJS::ResolveNode::evaluate):
3446         (KJS::ResolveNode::evaluateToNumber):
3447         (KJS::ResolveNode::evaluateToBoolean):
3448         (KJS::ResolveNode::evaluateToInt32):
3449         (KJS::ResolveNode::evaluateToUInt32):
3450         (KJS::getSymbolTableEntry):
3451         (KJS::ResolveNode::optimizeVariableAccess):
3452         (KJS::LocalVarAccessNode::inlineEvaluate):
3453         (KJS::LocalVarAccessNode::evaluate):
3454         (KJS::LocalVarAccessNode::evaluateToNumber):
3455         (KJS::LocalVarAccessNode::evaluateToBoolean):
3456         (KJS::LocalVarAccessNode::evaluateToInt32):
3457         (KJS::LocalVarAccessNode::evaluateToUInt32):
3458         (KJS::getNonLocalSymbol):
3459         (KJS::ScopedVarAccessNode::inlineEvaluate):
3460         (KJS::ScopedVarAccessNode::evaluate):
3461         (KJS::ScopedVarAccessNode::evaluateToNumber):
3462         (KJS::ScopedVarAccessNode::evaluateToBoolean):
3463         (KJS::ScopedVarAccessNode::evaluateToInt32):
3464         (KJS::ScopedVarAccessNode::evaluateToUInt32):
3465         (KJS::NonLocalVarAccessNode::inlineEvaluate):
3466         (KJS::NonLocalVarAccessNode::evaluate):
3467         (KJS::NonLocalVarAccessNode::evaluateToNumber):
3468         (KJS::NonLocalVarAccessNode::evaluateToBoolean):
3469         (KJS::NonLocalVarAccessNode::evaluateToInt32):
3470         (KJS::NonLocalVarAccessNode::evaluateToUInt32):
3471         (KJS::ElementNode::optimizeVariableAccess):
3472         (KJS::ElementNode::evaluate):
3473         (KJS::ArrayNode::optimizeVariableAccess):
3474         (KJS::ArrayNode::evaluate):
3475         (KJS::ObjectLiteralNode::optimizeVariableAccess):
3476         (KJS::ObjectLiteralNode::evaluate):
3477         (KJS::PropertyListNode::optimizeVariableAccess):
3478         (KJS::PropertyListNode::evaluate):
3479         (KJS::PropertyNode::optimizeVariableAccess):
3480         (KJS::PropertyNode::evaluate):
3481         (KJS::BracketAccessorNode::optimizeVariableAccess):
3482         (KJS::BracketAccessorNode::inlineEvaluate):
3483         (KJS::BracketAccessorNode::evaluate):
3484         (KJS::BracketAccessorNode::evaluateToNumber):
3485         (KJS::BracketAccessorNode::evaluateToBoolean):
3486         (KJS::BracketAccessorNode::evaluateToInt32):
3487         (KJS::BracketAccessorNode::evaluateToUInt32):
3488         (KJS::DotAccessorNode::optimizeVariableAccess):
3489         (KJS::DotAccessorNode::inlineEvaluate):
3490         (KJS::DotAccessorNode::evaluate):
3491         (KJS::DotAccessorNode::evaluateToNumber):
3492         (KJS::DotAccessorNode::evaluateToBoolean):
3493         (KJS::DotAccessorNode::evaluateToInt32):
3494         (KJS::DotAccessorNode::evaluateToUInt32):
3495         (KJS::ArgumentListNode::optimizeVariableAccess):
3496         (KJS::ArgumentListNode::evaluateList):
3497         (KJS::ArgumentsNode::optimizeVariableAccess):
3498         (KJS::NewExprNode::optimizeVariableAccess):
3499         (KJS::NewExprNode::inlineEvaluate):
3500         (KJS::NewExprNode::evaluate):
3501         (KJS::NewExprNode::evaluateToNumber):
3502         (KJS::NewExprNode::evaluateToBoolean):
3503         (KJS::NewExprNode::evaluateToInt32):
3504         (KJS::NewExprNode::evaluateToUInt32):
3505         (KJS::ExpressionNode::resolveAndCall):
3506         (KJS::EvalFunctionCallNode::optimizeVariableAccess):
3507         (KJS::EvalFunctionCallNode::evaluate):
3508         (KJS::FunctionCallValueNode::optimizeVariableAccess):
3509         (KJS::FunctionCallValueNode::evaluate):
3510         (KJS::FunctionCallResolveNode::optimizeVariableAccess):
3511         (KJS::FunctionCallResolveNode::inlineEvaluate):
3512         (KJS::FunctionCallResolveNode::evaluate):
3513         (KJS::FunctionCallResolveNode::evaluateToNumber):
3514         (KJS::FunctionCallResolveNode::evaluateToBoolean):
3515         (KJS::FunctionCallResolveNode::evaluateToInt32):
3516         (KJS::FunctionCallResolveNode::evaluateToUInt32):
3517         (KJS::LocalVarFunctionCallNode::inlineEvaluate):
3518         (KJS::LocalVarFunctionCallNode::evaluate):
3519         (KJS::LocalVarFunctionCallNode::evaluateToNumber):
3520         (KJS::LocalVarFunctionCallNode::evaluateToBoolean):
3521         (KJS::LocalVarFunctionCallNode::evaluateToInt32):
3522         (KJS::LocalVarFunctionCallNode::evaluateToUInt32):
3523         (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
3524         (KJS::ScopedVarFunctionCallNode::evaluate):
3525         (KJS::ScopedVarFunctionCallNode::evaluateToNumber):
3526         (KJS::ScopedVarFunctionCallNode::evaluateToBoolean):
3527         (KJS::ScopedVarFunctionCallNode::evaluateToInt32):
3528         (KJS::ScopedVarFunctionCallNode::evaluateToUInt32):
3529         (KJS::NonLocalVarFunctionCallNode::inlineEvaluate):
3530         (KJS::NonLocalVarFunctionCallNode::evaluate):
3531         (KJS::NonLocalVarFunctionCallNode::evaluateToNumber):
3532         (KJS::NonLocalVarFunctionCallNode::evaluateToBoolean):
3533         (KJS::NonLocalVarFunctionCallNode::evaluateToInt32):
3534         (KJS::NonLocalVarFunctionCallNode::evaluateToUInt32):
3535         (KJS::FunctionCallBracketNode::optimizeVariableAccess):
3536         (KJS::FunctionCallBracketNode::evaluate):
3537         (KJS::FunctionCallDotNode::optimizeVariableAccess):
3538         (KJS::FunctionCallDotNode::inlineEvaluate):
3539         (KJS::FunctionCallDotNode::evaluate):
3540         (KJS::FunctionCallDotNode::evaluateToNumber):
3541         (KJS::FunctionCallDotNode::evaluateToBoolean):
3542         (KJS::FunctionCallDotNode::evaluateToInt32):
3543         (KJS::FunctionCallDotNode::evaluateToUInt32):
3544         (KJS::PostIncResolveNode::optimizeVariableAccess):
3545         (KJS::PostIncResolveNode::evaluate):
3546         (KJS::PostIncLocalVarNode::evaluate):
3547         (KJS::PostDecResolveNode::optimizeVariableAccess):
3548         (KJS::PostDecResolveNode::evaluate):
3549         (KJS::PostDecLocalVarNode::evaluate):
3550         (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
3551         (KJS::PostDecLocalVarNode::evaluateToNumber):
3552         (KJS::PostDecLocalVarNode::evaluateToBoolean):
3553         (KJS::PostDecLocalVarNode::evaluateToInt32):
3554         (KJS::PostDecLocalVarNode::evaluateToUInt32):
3555         (KJS::PostfixBracketNode::optimizeVariableAccess):
3556         (KJS::PostIncBracketNode::evaluate):
3557         (KJS::PostDecBracketNode::evaluate):
3558         (KJS::PostfixDotNode::optimizeVariableAccess):
3559         (KJS::PostIncDotNode::evaluate):
3560         (KJS::PostDecDotNode::evaluate):
3561         (KJS::PostfixErrorNode::evaluate):
3562         (KJS::DeleteResolveNode::optimizeVariableAccess):
3563         (KJS::DeleteResolveNode::evaluate):
3564         (KJS::LocalVarDeleteNode::evaluate):
3565         (KJS::DeleteBracketNode::optimizeVariableAccess):
3566         (KJS::DeleteBracketNode::evaluate):
3567         (KJS::DeleteDotNode::optimizeVariableAccess):
3568         (KJS::DeleteDotNode::evaluate):
3569         (KJS::DeleteValueNode::optimizeVariableAccess):
3570         (KJS::DeleteValueNode::evaluate):
3571         (KJS::VoidNode::optimizeVariableAccess):
3572         (KJS::VoidNode::evaluate):
3573         (KJS::TypeOfValueNode::optimizeVariableAccess):
3574         (KJS::TypeOfResolveNode::optimizeVariableAccess):
3575         (KJS::LocalVarTypeOfNode::evaluate):
3576         (KJS::TypeOfResolveNode::evaluate):
3577         (KJS::TypeOfValueNode::evaluate):
3578         (KJS::PreIncResolveNode::optimizeVariableAccess):
3579         (KJS::PreIncLocalVarNode::evaluate):
3580         (KJS::PreIncResolveNode::evaluate):
3581         (KJS::PreDecResolveNode::optimizeVariableAccess):
3582         (KJS::PreDecLocalVarNode::evaluate):
3583         (KJS::PreDecResolveNode::evaluate):
3584         (KJS::PreIncConstNode::evaluate):
3585         (KJS::PreDecConstNode::evaluate):
3586         (KJS::PostIncConstNode::evaluate):
3587         (KJS::PostDecConstNode::evaluate):
3588         (KJS::PrefixBracketNode::optimizeVariableAccess):
3589         (KJS::PreIncBracketNode::evaluate):
3590         (KJS::PreDecBracketNode::evaluate):
3591         (KJS::PrefixDotNode::optimizeVariableAccess):
3592         (KJS::PreIncDotNode::evaluate):
3593         (KJS::PreDecDotNode::evaluate):
3594         (KJS::PrefixErrorNode::evaluate):
3595         (KJS::UnaryPlusNode::optimizeVariableAccess):
3596         (KJS::UnaryPlusNode::evaluate):
3597         (KJS::UnaryPlusNode::evaluateToBoolean):
3598         (KJS::UnaryPlusNode::evaluateToNumber):
3599         (KJS::UnaryPlusNode::evaluateToInt32):
3600         (KJS::UnaryPlusNode::evaluateToUInt32):
3601         (KJS::NegateNode::optimizeVariableAccess):
3602         (KJS::NegateNode::evaluate):
3603         (KJS::NegateNode::evaluateToNumber):
3604         (KJS::BitwiseNotNode::optimizeVariableAccess):
3605         (KJS::BitwiseNotNode::inlineEvaluateToInt32):
3606         (KJS::BitwiseNotNode::evaluate):
3607         (KJS::BitwiseNotNode::evaluateToNumber):
3608         (KJS::BitwiseNotNode::evaluateToBoolean):
3609         (KJS::BitwiseNotNode::evaluateToInt32):
3610         (KJS::BitwiseNotNode::evaluateToUInt32):
3611         (KJS::LogicalNotNode::optimizeVariableAccess):
3612         (KJS::LogicalNotNode::evaluate):
3613         (KJS::LogicalNotNode::evaluateToBoolean):
3614         (KJS::MultNode::optimizeVariableAccess):
3615         (KJS::MultNode::inlineEvaluateToNumber):
3616         (KJS::MultNode::evaluate):
3617         (KJS::MultNode::evaluateToNumber):
3618         (KJS::MultNode::evaluateToBoolean):
3619         (KJS::MultNode::evaluateToInt32):
3620         (KJS::MultNode::evaluateToUInt32):
3621         (KJS::DivNode::optimizeVariableAccess):
3622         (KJS::DivNode::inlineEvaluateToNumber):
3623         (KJS::DivNode::evaluate):
3624         (KJS::DivNode::evaluateToNumber):
3625         (KJS::DivNode::evaluateToInt32):
3626         (KJS::DivNode::evaluateToUInt32):
3627         (KJS::ModNode::optimizeVariableAccess):
3628         (KJS::ModNode::inlineEvaluateToNumber):
3629         (KJS::ModNode::evaluate):
3630         (KJS::ModNode::evaluateToNumber):
3631