1 2008-05-23 Oliver Hunt <oliver@apple.com>
5 SQUIRRELFISH: JavaScript error messages are missing informative text
8 Tidy up error messages, makes a couple of them provide slightly more info.
9 Inexplicably leads to a 1% SunSpider Progression.
11 * VM/ExceptionHelpers.cpp:
13 (KJS::createInvalidParamError):
14 (KJS::createNotAConstructorError):
15 (KJS::createNotAFunctionError):
16 * VM/ExceptionHelpers.h:
20 2008-05-23 Oliver Hunt <oliver@apple.com>
24 Fix call stack reported by profiler when entering event handlers.
26 JSObject::call was arbitrarily notifying the profiler when it was
27 called, even if it was JS code, which notifies the profile on entry
31 (KJS::JSObject::call):
33 2008-05-23 Maciej Stachowiak <mjs@apple.com>
37 - fixed <rdar://problem/5957662> REGRESSION(r33943-r33980): Can't send email , attach file or save as draft from hotmail.com
39 * VM/CodeGenerator.cpp:
40 (KJS::CodeGenerator::CodeGenerator): Delete any existing
41 properties before creating the function (this should really be
42 done at execution time not codegen time).
44 2008-05-16 Alp Toker <alp@nuanti.com>
46 Build fix for gcc 3. Default constructor required in ExecState,
47 used by OldInterpreterExecState.
50 (KJS::ExecState::ExecState):
52 2008-05-23 Mark Rowe <mrowe@apple.com>
54 Reviewed by Oliver Hunt.
56 Fix <rdar://problem/5954997> global-recursion-on-full-stack.html crashes under guardmalloc.
58 Growing the register file with uncheckedGrow from within Machine::execute is not safe as the
59 register file may be too close to its maximum size to grow successfully. By using grow,
60 checking the result and throwing a stack overflow error we can avoid crashing.
63 (KJS::Machine::execute):
64 * VM/RegisterFile.h: Remove the now-unused uncheckedGrow.
66 2008-05-23 Oliver Hunt <oliver@apple.com>
70 Remove JAVASCRIPT_PROFILER define
74 (KJS::Machine::unwindCallFrame):
75 (KJS::Machine::execute):
76 (KJS::Machine::privateExecute):
79 (KJS::JSObject::call):
81 2008-05-23 Oliver Hunt <oliver@apple.com>
83 <rdar://problem/5951561> Turn on JavaScript Profiler
85 Reviewed by Kevin McCullough.
87 Flipped the switch on the profiler, rearranged how we
88 signal the the profiler is active so that calls aren't
89 needed in the general case.
91 Also fixed the entry point for Machine::execute(FunctionBodyNode..)
92 to correctly indicate function exit.
94 Results in a 0.7-1.0% regression in SunSpider :-(
98 (KJS::Machine::unwindCallFrame):
99 (KJS::Machine::execute):
100 (KJS::Machine::privateExecute):
102 * profiler/Profiler.cpp:
103 (KJS::Profiler::profiler):
104 (KJS::Profiler::startProfiling):
105 (KJS::Profiler::stopProfiling):
106 * profiler/Profiler.h:
107 (KJS::Profiler::enabledProfilerReference):
109 2008-05-23 Simon Hausmann <hausmann@webkit.org>
111 Fix the Qt build by adding profiler/ to the include search path.
113 * JavaScriptCore.pri:
115 2008-05-22 Kevin McCullough <kmccullough@apple.com>
119 Fix a bug in the profiler where time in the current function is given to
122 * profiler/Profile.cpp:
123 (KJS::Profile::didExecute): Set the start time and then call didExecute
124 to calculate the time spent in this function.
125 * profiler/ProfileNode.cpp: Remove confusing calculations that are no
127 (KJS::ProfileNode::insertNode):
128 * profiler/ProfileNode.h: Expose access to the start time to allow the
129 simpler time calculations above.
130 (KJS::ProfileNode::startTime):
131 (KJS::ProfileNode::setStartTime):
133 2008-05-22 Adam Roben <aroben@apple.com>
135 Show "(Function object)" instead of "(JSInpectorCallbackWrapper
138 Reviewed by Kevin McCullough.
140 * profiler/Profiler.cpp:
141 (KJS::createCallIdentifier): Use JSObject::className instead of
142 getting the class name from the ClassInfo directly. JSObject
143 subclasses can override className to provide a custom class name, and
144 it seems like we should honor that.
146 2008-05-22 Timothy Hatcher <timothy@apple.com>
148 Added Profile::restoreAll and added ProfileNode::restoreAll
151 Reviewed by Adam Roben.
153 * JavaScriptCore.exp:
154 * profiler/Profile.h:
156 2008-05-22 Alp Toker <alp@nuanti.com>
158 GTK+ build fix. Add JavaScriptCore/profiler to include path.
162 2008-05-22 Adam Roben <aroben@apple.com>
164 Implement sub-millisecond profiling on Windows
166 Reviewed by Kevin McCullough.
168 * profiler/ProfileNode.cpp:
169 (KJS::getCount): Added. On Windows, we use QueryPerformanceCounter. On
170 other platforms, we use getCurrentUTCTimeWithMicroseconds.
171 (KJS::ProfileNode::endAndRecordCall): Use getCount instead of
172 getCurrentUTCTimeWithMicroseconds.
173 (KJS::ProfileNode::startTimer): Ditto.
175 2008-05-22 Adam Roben <aroben@apple.com>
177 Fix a profiler assertion when calling a NodeList as a function
179 Reviewed by Kevin McCullough.
181 * profiler/Profiler.cpp:
182 (KJS::createCallIdentifier): Don't assert when a non-function object
183 is called as a function. Instead, build up a CallIdentifier using the
186 2008-05-22 Kevin McCullough <kmccullough@apple.com>
190 <rdar://problem/5951529> JSProfiler: Allow the profiler to "Exclude" a
192 -Implement 'exclude'; where the excluded node attributes its time to its
195 * JavaScriptCore.exp: Export the exclude function.
196 * profiler/Profile.h:
197 (KJS::Profile::exclude):
198 * profiler/ProfileNode.cpp:
199 (KJS::ProfileNode::setTreeVisible): New function that allows a change in
200 visiblitiy to be propogated to all the children of a node.
201 (KJS::ProfileNode::exclude): If the node matches the callIdentifier then
202 set the visiblity of this node and all of its children to false and
203 attribute it's total time to it's caller's self time.
204 * profiler/ProfileNode.h:
206 2008-05-22 Mark Rowe <mrowe@apple.com>
208 Reviewed by Oliver Hunt.
210 Fix access to static global variables in Windows release builds.
212 * kjs/JSGlobalObject.h: Don't store a reference to an Identifier
213 in GlobalPropertyInfo as the Identifier is likely to be a temporary
214 and therefore may be destroyed before the GlobalPropertyInfo.
216 2008-05-22 Kevin McCullough <kmccullough@apple.com>
223 2008-05-22 Kevin McCullough <kmccullough@apple.com>
227 <rdar://problem/5951561> Turn on JavaScript Profiler
228 Get basic JS profiling working.
229 Even with this patch the profiler will not be compiled in because we do
230 not know the extend, if any, of the performance regression it would cause
231 when it is not in use. However with these changes, if the profiler were
232 on, it would not crash and show good profiling data.
234 * VM/Machine.cpp: Instrument the calls sites that are needed for profiling.
236 (KJS::Machine::unwindCallFrame):
237 (KJS::Machine::execute):
238 (KJS::Machine::privateExecute):
239 * kjs/function.cpp: Ditto.
240 (KJS::globalFuncEval):
241 * kjs/interpreter.cpp: Ditto.
242 (KJS::Interpreter::evaluate):
243 * profiler/Profile.cpp:
244 (KJS::Profile::willExecute):
245 (KJS::Profile::didExecute): Because we do not get a good context when
246 startProfiling is called it is possible that m_currentNode will be at the
247 top of the known stack when a didExecute() is called. What we then do is
248 create a new node that represents the function being exited and insert
249 it between the head and the currently known children, since they should
250 be children of this new node.
251 * profiler/ProfileNode.cpp:
252 (KJS::ProfileNode::ProfileNode):
253 (KJS::ProfileNode::willExecute): Rename the add function for consistency.
254 (KJS::ProfileNode::addChild): Appends the child to this node but also
255 sets the parent pointer of the children to this node.
256 (KJS::ProfileNode::insertNode): Insert a node between this node and its
257 children. Also set the time for the new node since it is now exiting
258 and we don't really know when it started.
259 (KJS::ProfileNode::stopProfiling):
260 (KJS::ProfileNode::startTimer):
261 * profiler/ProfileNode.h:
262 (KJS::CallIdentifier::toString): Added for debugging.
263 (KJS::ProfileNode::setParent):
264 (KJS::ProfileNode::setSelfTime): Fixed an old bug where we set the
265 visibleTotalTime not the visibleSelfTime.
266 (KJS::ProfileNode::children):
267 (KJS::ProfileNode::toString): Added for debugging.
268 * profiler/Profiler.cpp: remove unecessary calls.
269 (KJS::Profiler::startProfiling):
271 2008-05-22 Sam Weinig <sam@webkit.org>
273 Reviewed by Oliver Hunt.
275 Rename register arguments for op_call, op_call_eval, op_end, and op_construct
276 to document what they are for.
278 * VM/CodeGenerator.cpp:
279 (KJS::CodeGenerator::emitCall):
280 (KJS::CodeGenerator::emitCallEval):
281 (KJS::CodeGenerator::emitEnd):
282 (KJS::CodeGenerator::emitConstruct):
283 * VM/CodeGenerator.h:
285 (KJS::Machine::privateExecute):
287 2008-05-22 Oliver Hunt <oliver@apple.com>
291 Bug 19116: SquirrelFish shouldn't regress on variable lookups
292 <https://bugs.webkit.org/show_bug.cgi?id=19116>
294 Last of the multiscope look up optimisations. This is a wash overall on SunSpider
295 but is a factor of 5-10 improvement in multiscope read/write/modify (eg. ++, --, +=,
296 ... applied to any non-local var).
299 (KJS::PostIncResolveNode::emitCode):
300 (KJS::PostDecResolveNode::emitCode):
301 (KJS::PreIncResolveNode::emitCode):
302 (KJS::PreDecResolveNode::emitCode):
303 (KJS::ReadModifyResolveNode::emitCode):
305 2008-05-22 David Kilzer <ddkilzer@apple.com>
307 <rdar://problem/5954233> Add method to release free memory from FastMalloc
309 Patch suggested by Mark Rowe. Rubber-stamped by Maciej.
311 * JavaScriptCore.exp: Export _releaseFastMallocFreeMemory.
312 * wtf/FastMalloc.cpp:
313 (WTF::TCMallocStats::): Added releaseFastMallocFreeMemory() for both
314 system malloc and FastMalloc code paths.
315 * wtf/FastMalloc.h: Define releaseFastMallocFreeMemory().
317 2008-05-22 Oliver Hunt <oliver@apple.com>
321 Roll out r34020 as it causes recursion tests to fail.
324 (KJS::JSObject::call):
326 2008-05-22 Oliver Hunt <oliver@apple.com>
330 Don't leak the SymbolTable when compiling eval code.
333 (KJS::EvalNode::generateCode):
335 2008-05-22 Simon Hausmann <hausmann@webkit.org>
341 * JavaScriptCore.pri: Added DebuggerCallFrame to the build.
342 * VM/LabelID.h: Include limits.h for UINT_MAX.
343 * wtf/VectorTraits.h: Include memory for std::auto_ptr.
345 2008-05-22 Geoffrey Garen <ggaren@apple.com>
347 Reviewed by Adam Roben.
349 Removed the old recursion guard mechanism, since squirrelfish has its
350 own mechanism. Also removed some old JS call tracing code, since we
351 have other ways to do that, too.
353 SunSpider reports no change.
356 (KJS::JSObject::call):
358 2008-05-22 Maciej Stachowiak <mjs@apple.com>
362 - fixed <rdar://problem/5954979> crash on celtic kane JS benchmark
365 (KJS::WithNode::emitCode):
366 (KJS::TryNode::emitCode):
368 2008-05-21 Kevin McCullough <kmccullough@apple.com>
370 Reviewed by Maciej and Geoff.
372 <rdar://problem/5951561> Turn on JavaScript Profiler
373 -As part of the effort to turn on the profiler it would be helpful if it
374 did not need ExecStates to represent the stack location of the currently
376 -We now create each node as necessary with a reference to the current
377 node and each node knows its parent so that the tree can be made without
380 * profiler/Profile.cpp:
381 (KJS::Profile::Profile): The current node starts at the head.
382 (KJS::Profile::stopProfiling): The current node is cleared when profiling
384 (KJS::Profile::willExecute): The current node either adds a new child or
385 starts and returns a reference to an already existing child if the call
386 ID that is requested already exists.
387 (KJS::Profile::didExecute): The current node finishes and returns its
389 * profiler/Profile.h: Use a single callIdentifier instead of a vector
390 since we no longer use the whole stack.
391 * profiler/ProfileNode.cpp: Now profile nodes keep a reference to their
393 (KJS::ProfileNode::ProfileNode): Initialize the parent.
394 (KJS::ProfileNode::didExecute): Record the time and return the parent.
395 (KJS::ProfileNode::addOrStartChild): If the given callIdentifier is
396 already a child, start it and return it, otherwise create a new one and
398 (KJS::ProfileNode::stopProfiling): Same logic, just use the new function.
399 * profiler/ProfileNode.h: Utilize the parent.
400 (KJS::ProfileNode::create):
401 (KJS::ProfileNode::parent):
402 * profiler/Profiler.cpp:
403 (KJS::Profiler::startProfiling): Here is the only place where the
404 ExecState is used to figure out where in the stack the profiler is
406 (KJS::dispatchFunctionToProfiles): Only send one CallIdentifier instead
408 (KJS::Profiler::willExecute): Ditto.
409 (KJS::Profiler::didExecute): Ditto.
410 (KJS::createCallIdentifier): Create only one CallIdentifier.
411 (KJS::createCallIdentifierFromFunctionImp): Ditto.
412 * profiler/Profiler.h:
414 2008-05-21 Darin Adler <darin@apple.com>
418 - https://bugs.webkit.org/show_bug.cgi?id=19180
419 speed up the < operator for the case when both values are integers
421 Makes standalone SunSpider 1.022x faster.
424 (KJS::jsLess): Add a special case for when both are numbers that fit in a JSImmediate.
426 2008-05-21 Maciej Stachowiak <mjs@apple.com>
428 Reviewed by Oliver and Sam.
430 - fixed <rdar://problem/5815631> REGRESSION (r31239): Multiscope optimisation of function calls results in incorrect this value (breaks tvtv.de)
432 Track global this value in the scope chain so we can retrieve it
433 efficiently but it follows lexical scope properly.
436 (KJS::ExecState::globalThisValue):
437 * kjs/JSGlobalObject.h:
438 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
439 * kjs/function_object.cpp:
440 (KJS::FunctionObjectImp::construct):
442 (KJS::ScopeChainNode::ScopeChainNode):
443 (KJS::ScopeChainNode::globalThisObject):
444 (KJS::ScopeChainNode::push):
445 (KJS::ScopeChain::ScopeChain):
447 2008-05-21 Kevin McCullough <kmccullough@apple.com>
453 2008-05-21 Kevin McCullough <kmccullough@apple.com>
457 <rdar://problem/5950867> JSProfiler: Allow the profiler to "Focus" a
459 - This patch updatest the times of the visible nodes correctly, but to do
460 so, some of the design of the ProfileNode changed.
462 * JavaScriptCore.exp: export focus' symbol.
463 * profiler/Profile.cpp: ProfileNodes now take a reference to the head of
464 the profile tree to get up-to-date accurate total profile time.
465 (KJS::Profile::Profile): Pass 0 for the head node.
466 (KJS::Profile::stopProfiling): stopProfiling no longer needs the time
467 passed into it, since it can get it from the head and it does not need to
468 be told it is the head because it can figure it out on it's own.
469 (KJS::Profile::willExecute): Set the head node for each created node.
470 * profiler/Profile.h:
471 (KJS::Profile::focus): Instead of taking a CallIdentifier that the caller
472 would have to create, now focus() takes a ProfileNode that they should
473 already have a reference to and focus() can extract the CallIdentifier
475 * profiler/ProfileNode.cpp: Create actual and visible versions fo the
476 total and self times for focus and exclude. Also add a head node
477 reference so that nodes can get information from their head.
478 (KJS::ProfileNode::ProfileNode):
479 (KJS::ProfileNode::stopProfiling): Rename the total and self time
480 variables and set the visual ones to the actual ones, so that without any
481 changes to the visual versions of these variables, their times will match
483 (KJS::ProfileNode::focus): Now focus() has a bool to force it's children
484 to be visible if this node is visible. If this node does not match the
485 CallIdentifier being focused then the visibleTotalTime is only updated if
486 one or more of it's children is the CallIdentifier being focused.
487 (KJS::ProfileNode::restoreAll): Restores all variables with respect to
488 the visible data in the ProfileNode.
489 (KJS::ProfileNode::endAndRecordCall): Name change.
490 (KJS::ProfileNode::debugPrintData): Dump the new variables.
491 (KJS::ProfileNode::debugPrintDataSampleStyle): Name change.
492 * profiler/ProfileNode.h: Use the new variables and reference to the head
494 (KJS::ProfileNode::create):
495 (KJS::ProfileNode::totalTime):
496 (KJS::ProfileNode::setTotalTime):
497 (KJS::ProfileNode::selfTime):
498 (KJS::ProfileNode::setSelfTime):
499 (KJS::ProfileNode::totalPercent):
500 (KJS::ProfileNode::selfPercent):
501 (KJS::ProfileNode::setVisible):
503 2008-05-21 Alp Toker <alp@nuanti.com>
505 GTK+/UNIX testkjs build fix. Include signal.h.
509 2008-05-21 Oliver Hunt <oliver@apple.com>
511 Reviewed by NOBODY (Build fix).
513 Yet more windows build fixes
515 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
517 2008-05-21 Oliver Hunt <oliver@apple.com>
519 Reviewed by NOBODY (Build fix).
521 Yet more windows build fixes
523 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
525 2008-05-21 Alp Toker <alp@nuanti.com>
527 GTK+ build fix. Add DebuggerCallFrame.cpp and take AllInOneFile.cpp
528 changes into account.
532 2008-05-21 Oliver Hunt <oliver@apple.com>
534 Reviewed by NOBODY (Build fix).
536 Add DebuggerCallFrame.{h,cpp} to the project file
538 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
540 2008-05-21 Alp Toker <alp@nuanti.com>
542 GTK+ port build fixes following squirrelfish merge r33979.
546 2008-05-21 Maciej Stachowiak <mjs@apple.com>
550 - save a hash lookup wne writing to global properties
551 0.3% speedup on SunSpider, 7% on bitops-bitwise-and
554 (KJS::resolveBase): Check for being a the end of the scope chain
557 2008-05-21 Alp Toker <alp@nuanti.com>
559 Rubber-stamped by Maciej.
561 Replace non-standard #pragma marks with comments to avoid compiler
564 * profiler/ProfileNode.cpp:
566 2008-05-21 Geoffrey Garen <ggaren@apple.com>
568 Reviewed by Mark Rowe.
570 Fix layout test failure in fast/dom/getter-on-window-object2 introduced in r33961.
572 * JavaScriptCore.exp:
573 * kjs/JSGlobalObject.cpp:
574 (KJS::JSGlobalObject::defineGetter):
575 (KJS::JSGlobalObject::defineSetter):
576 * kjs/JSGlobalObject.h:
578 === End merge of squirrelfish ===
580 2008-05-21 Geoffrey Garen <ggaren@apple.com>
582 Reviewed by Tim Hatcher.
584 Merged with trunk WebCore's new debugger.
586 * kjs/DebuggerCallFrame.cpp:
587 (KJS::DebuggerCallFrame::evaluate): Changed this function to separate
588 the exception value from the return value. The WebKit debugger treats
589 them as one, but the WebCore debugger doesn't.
591 * kjs/DebuggerCallFrame.h:
592 (KJS::DebuggerCallFrame::dynamicGlobalObject): Added a new accessor for
593 the dynamic global object, since the debugger doesn't want the lexical
596 2008-05-21 Oliver Hunt <oliver@apple.com>
600 Bug 19116: SquirrelFish shouldn't regress on variable lookups
601 <https://bugs.webkit.org/show_bug.cgi?id=19116>
603 Optimise cross scope assignment, 0.4% progression in sunspider.
606 (KJS::CodeBlock::dump):
607 * VM/CodeGenerator.cpp:
608 (KJS::CodeGenerator::emitPutScopedVar):
609 * VM/CodeGenerator.h:
611 (KJS::Machine::privateExecute):
614 (KJS::AssignResolveNode::emitCode):
616 2008-05-21 Maciej Stachowiak <mjs@apple.com>
620 - check property map before symbol table in JSGlobalObject::getOwnPropertySlot
621 0.5% speedup on SunSpider
623 * kjs/JSGlobalObject.h:
624 (KJS::JSGlobalObject::getOwnPropertySlot): Check property map before symbol table
625 because symbol table access is likely to have been optimized.
627 2008-05-21 Oliver Hunt <oliver@apple.com>
631 Bug 19116: SquirrelFish shouldn't regress on variable lookups
632 <https://bugs.webkit.org/show_bug.cgi?id=19116>
634 Optimise multiscope lookup of statically resolvable function calls.
635 SunSpider reports a 1.5% improvement, including 37% on
636 controlflow-recursive for some reason :D
639 (KJS::CodeBlock::dump):
640 * VM/CodeGenerator.cpp:
641 (KJS::CodeGenerator::emitResolve):
642 * VM/CodeGenerator.h:
644 (KJS::FunctionCallResolveNode::emitCode):
646 2008-05-21 Maciej Stachowiak <mjs@apple.com>
650 - give JSGlobalObject a special version of getOwnPropertySlot that tells you if the slot is directly writable
651 (WebCore change using this is a 2.6% speedup on in-browser SunSpider).
653 * JavaScriptCore.exp:
654 * kjs/JSGlobalObject.h:
655 (KJS::JSGlobalObject::getOwnPropertySlot):
656 * kjs/JSVariableObject.h:
657 (KJS::JSVariableObject::symbolTableGet):
659 (KJS::JSObject::getDirectLocation):
660 (KJS::JSObject::getOwnPropertySlotForWrite):
661 * kjs/property_map.cpp:
662 (KJS::PropertyMap::getLocation):
663 * kjs/property_map.h:
664 * kjs/property_slot.h:
665 (KJS::PropertySlot::putValue):
667 2008-05-20 Oliver Hunt <oliver@apple.com>
671 Bug 19116: SquirrelFish shouldn't regress on variable lookups
672 <https://bugs.webkit.org/show_bug.cgi?id=19116>
674 This restores multiscope optimisation to simple resolve, producing
675 a 2.6% progression in SunSpider. Have verified that none of the
676 sites broken by the multiscope optimisation in trunk were effected
680 (KJS::CodeBlock::dump):
682 (KJS::CodeBlock::CodeBlock):
683 * VM/CodeGenerator.cpp:
684 (KJS::CodeGenerator::findScopedProperty):
685 (KJS::CodeGenerator::emitResolve):
686 * VM/CodeGenerator.h:
689 (KJS::Machine::privateExecute):
691 * kjs/JSVariableObject.h:
693 2008-05-20 Oliver Hunt <oliver@apple.com>
695 Reviewed by NOBODY (Build fix).
697 Fixerate the windows build.
699 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
700 * VM/CodeGenerator.cpp:
702 * kjs/JSGlobalObject.h:
706 2008-05-20 Oliver Hunt <oliver@apple.com>
710 Bug 19110: SquirrelFish: Google Maps - no maps
711 <https://bugs.webkit.org/show_bug.cgi?id=19110>
713 Correct a comedy of errors present in my original patch to "fix"
714 exceptions occurring midway through pre and post increment. This
715 solution is cleaner than the original, doesn't need the additional
716 opcodes, and as an added benefit does not break Google Maps.
718 Sunspider reports a 0.4% progression.
721 (KJS::CodeBlock::dump):
722 * VM/CodeGenerator.cpp:
723 * VM/CodeGenerator.h:
725 (KJS::Machine::privateExecute):
728 (KJS::PreIncResolveNode::emitCode):
729 (KJS::PreDecResolveNode::emitCode):
730 (KJS::PreIncBracketNode::emitCode):
731 (KJS::PreDecBracketNode::emitCode):
732 (KJS::PreIncDotNode::emitCode):
733 (KJS::PreDecDotNode::emitCode):
735 2008-05-20 Maciej Stachowiak <mjs@apple.com>
739 - inline JSGlobalObject::getOwnPropertySlot
740 1% improvement on in-browser SunSpider (a wash command-line)
742 * kjs/JSGlobalObject.cpp:
743 * kjs/JSGlobalObject.h:
744 (KJS::JSGlobalObject::getOwnPropertySlot):
746 2008-05-18 Oliver Hunt <oliver@apple.com>
750 Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
751 <https://bugs.webkit.org/show_bug.cgi?id=18752>
753 Handle exceptions thrown by toString conversion in subscript operators,
754 this should basically complete exception handling in SquirrelFish.
756 Sunspider reports no regression.
759 (KJS::Machine::privateExecute):
761 2008-05-17 Geoffrey Garen <ggaren@apple.com>
763 Reviewed by Oliver Hunt.
765 [Reapplying patch with previously missing files from r33553 -- Oliver]
769 SunSpider reports no change.
771 * JavaScriptCore.xcodeproj/project.pbxproj: Added DebuggerCallFrame.h/.cpp,
772 and created a debugger folder.
774 * VM/CodeGenerator.cpp:
775 (KJS::CodeGenerator::generate): If the debugger is attached, always
776 generate full scope chains for its sake.
779 (KJS::Machine::unwindCallFrame): Notify the debugger when unwinding
780 due to an exception, so it doesn't keep stale call frames around.
782 (KJS::Machine::execute): Set Callee to 0 in eval frames, so the
783 debugger can distinguish them from function call frames.
785 (KJS::Machine::debug): Simplified this function, since the debugger
786 doesn't actually need all the information we used to provide.
788 (KJS::Machine::privateExecute): Treat debugging hooks like other function
789 calls, so the code we hook into (the debugger UI) can be optimized.
791 * kjs/debugger.cpp: Nixed these default callback implementations and
792 made the callbacks pure virtual instead, so the compiler could tell me
793 if I made a mistake in one of the subclasses.
795 * kjs/debugger.h: Removed a bunch of irrelevent data from the debugger
796 callbacks. Changed from passing an ExecState* to passing a
797 DebuggerCallFrame*, since an ExecState* doesn't contain sufficient
801 (KJS::globalFuncEval): Easiest bug fix evar!
803 [Previously missing files from r33553]
804 * kjs/DebuggerCallFrame.cpp: Copied from JavaScriptCore/profiler/FunctionCallProfile.h.
805 (KJS::DebuggerCallFrame::functionName):
806 (KJS::DebuggerCallFrame::thisObject):
807 (KJS::DebuggerCallFrame::evaluateScript):
808 * kjs/DebuggerCallFrame.h: Copied from JavaScriptCore/VM/Register.h.
809 (KJS::DebuggerCallFrame::DebuggerCallFrame):
810 (KJS::DebuggerCallFrame::scopeChain):
811 (KJS::DebuggerCallFrame::exception):
813 2008-05-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
817 Bug 18991: SquirrelFish: Major codegen issue in a.b=expr, a[b]=expr
818 <https://bugs.webkit.org/show_bug.cgi?id=18991>
820 Fix the last remaining blocking cases of this bug.
824 (KJS::ReadModifyResolveNode::emitCode):
826 2008-05-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
832 Bug 18991: SquirrelFish: Major codegen issue in a.b=expr, a[b]=expr
833 <https://bugs.webkit.org/show_bug.cgi?id=18991>
835 Ensure that the code generated for assignments uses temporaries whenever
836 necessary. This patch covers the vast majority of situations, but there
837 are still a few left.
839 This patch also adds some missing cases to CodeBlock::dump().
842 (KJS::CodeBlock::dump):
843 * VM/CodeGenerator.h:
844 (KJS::CodeGenerator::destinationForAssignResult):
845 (KJS::CodeGenerator::leftHandSideNeedsCopy):
846 (KJS::CodeGenerator::emitNodeForLeftHandSide):
850 (KJS::AssignDotNode::emitCode):
851 (KJS::ReadModifyDotNode::emitCode):
852 (KJS::AssignBracketNode::emitCode):
853 (KJS::ReadModifyBracketNode::emitCode):
854 (KJS::ForInNode::ForInNode):
856 (KJS::ReadModifyResolveNode::):
857 (KJS::AssignResolveNode::):
858 (KJS::ReadModifyBracketNode::):
859 (KJS::AssignBracketNode::):
860 (KJS::AssignDotNode::):
861 (KJS::ReadModifyDotNode::):
863 2008-05-17 Oliver Hunt <oliver@apple.com>
867 Bug 19106: SquirrelFish: Activation is not marked correctly
868 <https://bugs.webkit.org/show_bug.cgi?id=19106>
870 We can't rely on the symbol table for a count of the number of globals
871 we need to mark as that misses duplicate parameters and 'this'. Now we
872 use the actual local register count from the codeBlock.
874 * kjs/JSActivation.cpp:
875 (KJS::JSActivation::mark):
877 2008-05-16 Oliver Hunt <oliver@apple.com>
881 Bug 19076: SquirrelFish: RegisterFile can be corrupted if implictly reenter global scope with no declared vars
882 <https://bugs.webkit.org/show_bug.cgi?id=19076>
884 Don't delay allocation of initial global RegisterFile, as we can't guarantee we will be able
885 to allocate the global 'this' register safely at any point after initialisation of the Global
888 Unfortunately this initial allocation caused a regression of 0.2-0.3%, however this patch adds
889 support for the static slot optimisation for the global Math object which brings it to a 0.3%
892 * VM/CodeGenerator.cpp:
893 (KJS::CodeGenerator::programCodeThis):
894 (KJS::CodeGenerator::CodeGenerator):
895 (KJS::CodeGenerator::addParameter):
896 * VM/CodeGenerator.h:
898 (KJS::Machine::execute):
900 * kjs/JSGlobalObject.cpp:
901 (KJS::JSGlobalObject::reset):
902 * kjs/JSGlobalObject.h:
903 (KJS::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo):
904 (KJS::JSGlobalObject::addStaticGlobals):
907 2008-05-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
909 Reviewed by Oliver Hunt.
911 Bug 19098: SquirrelFish: Ref'd temporaries can be clobbered
912 <https://bugs.webkit.org/show_bug.cgi?id=19098>
914 When doing code generation for a statement list, increase the reference
915 count on a register that might eventually be returned, so that it doesn't
916 get clobbered by a request for a new temporary.
919 (KJS::statementListEmitCode):
921 2008-05-16 Maciej Stachowiak <mjs@apple.com>
925 - fixed Bug 19044: SquirrelFish: Bogus values enter evaluation when closing over scope with parameter and var with same name
926 https://bugs.webkit.org/show_bug.cgi?id=19044
928 * kjs/JSActivation.cpp:
929 (KJS::JSActivation::copyRegisters): Use numLocals from the code
930 block rather than the size of the symbol table for the number of
931 registers to copy, to account for duplicate parameters and vars
932 with the same name as parameters (we still have potentially
933 suboptimal codegen in that we allocate a local register for the
934 var in the latter case but it is never used).
936 2008-05-15 Geoffrey Garen <ggaren@apple.com>
940 We regret to inform you that your program is crashing because you were
944 (KJS::Machine::privateExecute): Math is hard.
946 2008-05-14 Geoffrey Garen <ggaren@apple.com>
948 Reviewed by Oliver Hunt.
950 A little more debugger action: filled in op_debug. All debugger control
951 flow works now, but variable inspection and backtraces still don't.
953 SunSpider reports no change.
955 * VM/CodeGenerator.cpp: Changed op_debug to accept line number parameters.
958 (KJS::Machine::getFunctionAndArguments): Moved op_debug into a
959 NEVER_INLINE function to avoid a stunning 10% performance regression.
960 Also factored out a common function for retrieving the function and
961 arguments from a call frame.
963 * kjs/JSActivation.cpp:
964 (KJS::JSActivation::createArgumentsObject): Use the new factored out
965 function mentioned above.
968 (KJS::Parser::parse): Increment m_sourceId before assigning it, so the
969 sourceId we send to the debugger matches the sourceId recorded in the
972 * kjs/nodes.cpp: Emit debugging hooks.
974 2008-05-14 Oliver Hunt <oliver@apple.com>
978 Bug 19024: SQUIRRELFISH: ASSERTION FAILED: activation->isActivationObject() in Machine::unwindCallFrame
979 <https://bugs.webkit.org/show_bug.cgi?id=19024>
981 This fixes a number of issues. The most important is that we now check every register
982 file for tainting rather than just looking for function register files as that was
983 insufficient. Additionally guarded against implicit re-entry into Eval code.
985 Also added a few additional assertions to reduce the amout of time between something
986 going wrong and us seeing the error.
989 (KJS::Machine::execute):
990 (KJS::Machine::privateExecute):
991 * VM/RegisterFile.cpp:
992 (KJS::RegisterFile::growBuffer):
993 (KJS::RegisterFile::addGlobalSlots):
994 * VM/RegisterFileStack.cpp:
995 (KJS::RegisterFileStack::pushGlobalRegisterFile):
996 (KJS::RegisterFileStack::pushFunctionRegisterFile):
997 * VM/RegisterFileStack.h:
998 (KJS::RegisterFileStack::inImplicitCall):
1000 2008-05-14 Geoffrey Garen <ggaren@apple.com>
1002 Reviewed by Oliver Hunt.
1004 A little more debugger action: emit opcodes for debugger hooks. Right
1005 now, the opcode implementation is just a stub.
1007 SunSpider reports no change.
1009 Some example codegen for "function f() { 1; }":
1011 [ 0] dbg DidEnterCallFrame
1012 [ 2] dbg WillExecuteStatement
1013 [ 4] load tr0, 1(@k0)
1014 [ 7] load tr0, undefined(@k1)
1015 [ 10] dbg WillLeaveCallFrame
1018 2008-05-14 Oliver Hunt <oliver@apple.com>
1022 Bug 19025: SQUIRRELFISH: malformed syntax in onload handler causes crash
1023 <https://bugs.webkit.org/show_bug.cgi?id=19025>
1025 Simple fix -- move the use of functionBodyNode to after the null check.
1027 * kjs/function_object.cpp:
1028 (KJS::FunctionObjectImp::construct):
1030 2008-05-13 Geoffrey Garen <ggaren@apple.com>
1032 Reviewed by Oliver Hunt.
1034 Fixed a codegen crash with run-time parse errors.
1036 SunSpider reports no change.
1038 emitThrowError needs to return the temporary holding the error, not dst,
1039 since dst may be NULL. In fact, emitThrowError shouldn't take a dst
1040 parameter at all, since exceptions should not modify the destination
1043 2008-05-13 Oliver Hunt <oliver@apple.com>
1047 Bug 19027: SquirrelFish: Incorrect codegen for pre-increment
1048 <https://bugs.webkit.org/show_bug.cgi?id=19027>
1050 This fixes the codegen issues for the pre-inc/decrement operators
1051 to prevent incorrectly clobbering the destination in the event of
1055 (KJS::CodeBlock::dump):
1056 * VM/CodeGenerator.cpp:
1057 (KJS::CodeGenerator::emitPreInc):
1058 (KJS::CodeGenerator::emitPreDec):
1059 * VM/CodeGenerator.h:
1061 (KJS::Machine::privateExecute):
1064 (KJS::PreIncResolveNode::emitCode):
1065 (KJS::PreDecResolveNode::emitCode):
1066 (KJS::PreIncBracketNode::emitCode):
1067 (KJS::PreDecBracketNode::emitCode):
1068 (KJS::PreIncDotNode::emitCode):
1069 (KJS::PreDecDotNode::emitCode):
1071 2008-05-13 Geoffrey Garen <ggaren@apple.com>
1073 Reviewed by Oliver Hunt.
1075 A little more debugger action: supply a real line number, sourceId,
1076 and sourceURL in op_new_error.
1078 SunSpider reports a .2% speedup. Not sure what that's about.
1081 (KJS::Machine::privateExecute): Use the new good stuff in op_new_error.
1084 (KJS::RegExpNode::emitCode): Use the shared emitThrowError instead of
1087 2008-05-13 Geoffrey Garen <ggaren@apple.com>
1089 Reviewed by Oliver Hunt.
1091 A little more debugger action: implemented the exception callback.
1093 SunSpider reports a .2% speedup. Not sure what that's about.
1095 * VM/CodeBlock.h: A little refactoring here. Store a pointer to our
1096 owner ScopeNode so we can retrieve data from it. This allows us to
1097 stop storing copies of the data ourselves. Also, store a "this" register
1098 instead of a code type, since we were only using the code type to
1099 calculate the "this" register.
1101 * VM/CodeGenerator.cpp:
1102 (KJS::CodeGenerator::generate): Calculate the "this" register mentioned
1103 above. Also, take care of removing "this" from the symbol table after
1104 codegen is done, since relying on the timing of a destructor for correct
1105 behavior is not so good.
1108 (KJS::Machine::throwException): Invoke the debugger's exception callback.
1109 (KJS::Machine::privateExecute): Use the "this" register mentioned above.
1111 2008-05-13 Geoffrey Garen <ggaren@apple.com>
1113 Reviewed by Oliver Hunt.
1115 Removed some unused exception machinery.
1117 SunSpider reports a .3% speedup.
1119 * API/JSCallbackObject.h:
1120 * API/JSCallbackObjectFunctions.h:
1121 * JavaScriptCore.exp:
1123 (KJS::Machine::privateExecute):
1129 2008-05-13 Geoffrey Garen <ggaren@apple.com>
1131 Reviewed by Oliver Hunt.
1133 A little more debugger action.
1136 * kjs/debugger.h: Removed debuggersPresent because it was unused.
1137 Replaced AttachedGlobalObject linked list with a HashSet because HashSet
1138 is faster and simpler. Changed all functions to return void instead of
1139 bool, because no clients ever return false, and we don't want to support
1142 * kjs/nodes.cpp: Did some up-keep to avoid build bustage.
1143 (KJS::Node::handleException):
1144 (KJS::BreakpointCheckStatement::execute):
1145 (KJS::FunctionBodyNodeWithDebuggerHooks::execute):
1147 2008-05-13 Oliver Hunt <oliver@apple.com>
1151 Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
1152 <https://bugs.webkit.org/show_bug.cgi?id=18752>
1154 Replace old attempt at "branchless" exceptions as the extra information
1155 being passed made gcc an unhappy compiler, replacing these custom toNumber
1156 calls with ordinary toNumber logic (by relying on toNumber now preventing
1157 side effects after an exception has been thrown) provided sufficient leeway
1158 to add the additional checks for the remaining unchecked cases.
1160 This leaves only toString conversions in certain contexts as possibly
1166 (KJS::resolveBaseAndProperty):
1167 (KJS::resolveBaseAndFunc):
1168 (KJS::Machine::privateExecute):
1171 (KJS::JSValue::safeGetNumber):
1173 2008-05-13 Geoffrey Garen <ggaren@apple.com>
1175 Reviewed by Oliver Hunt.
1177 First steps toward supporting the debugger API: support the sourceParsed
1178 callback; plus some minor fixups.
1180 SunSpider reports no regression.
1182 * VM/CodeGenerator.h: Removed a misleading comment.
1184 * kjs/Parser.h: Changed the parser to take an ExecState*, so it can
1185 implement the sourceParsed callback -- that way, we only have to
1186 implement the callback in one place.
1188 * kjs/debugger.cpp: Nixed DebuggerImp, because its sole purpose in life
1189 was to demonstrate the misapplication of design patterns.
1191 * kjs/debugger.h: Changed sourceParsed to take a SourceProvider, to
1192 reduce copying, and not to return a value, because pausing execution
1193 after parsing is complicated, and no clients needed that ability, anyway.
1195 * kjs/grammar.y: Make sure never to pass a NULL SourceElements* to
1196 didFinishParsing -- that simplifies some code down the road.
1198 * kjs/nodes.cpp: Don't generate special AST nodes just because the
1199 debugger is attached -- that's a relic of the old AST execution model,
1200 and those nodes haven't been maintained.
1202 2008-05-13 Oliver Hunt <oliver@apple.com>
1206 Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
1207 <https://bugs.webkit.org/show_bug.cgi?id=18752>
1209 First step: prevent incorrect evaluation of valueOf/toString conversion
1210 in right hand side of expression after earlier conversion throws.
1212 * API/JSCallbackObjectFunctions.h:
1215 (KJS::JSObject::defaultValue):
1217 2008-05-12 Oliver Hunt <oliver@apple.com>
1221 Bug 18934: SQUIRRELFISH: ASSERT @ nytimes.com due to RegisterFile being clobbered
1222 <https://bugs.webkit.org/show_bug.cgi?id=18934>
1224 Unfortunately we cannot create new statically optimised globals if there are any
1225 tainted RegisterFiles on the RegisterFileStack. To handle this we re-introduce
1226 (in a slightly cleaner form) the inImplicitCall concept to the RegisterFileStack.
1229 (KJS::Machine::execute):
1230 * VM/RegisterFileStack.cpp:
1231 (KJS::RegisterFileStack::pushFunctionRegisterFile):
1232 * VM/RegisterFileStack.h:
1234 2008-05-12 Geoffrey Garen <ggaren@apple.com>
1236 Reviewed by Maciej Stachowiak.
1238 Introduced support for function.caller.
1240 Improved support for walking interesting scopes for function introspection.
1242 This fixes all remaining layout tests not blocked by rebasing to trunk.
1244 SunSpider reports no change.
1247 (KJS::Machine::dumpRegisters): Fixed a spacing issue.
1249 2008-05-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1253 Bug 18961: SQUIRRELFISH: Gmail doesn't load
1254 <https://bugs.webkit.org/show_bug.cgi?id=18961>
1256 Fix codegen for logical nodes so that they don't use their destination
1260 (KJS::LogicalAndNode::emitCode):
1261 (KJS::LogicalOrNode::emitCode):
1263 2008-05-10 Maciej Stachowiak <mjs@apple.com>
1267 - JavaScriptCore part of fix for: "SQUIRRELFISH: function toString broken after calling"
1268 https://bugs.webkit.org/show_bug.cgi?id=18869
1270 Three layout tests are fixed:
1271 fast/js/toString-elision-trailing-comma.html
1272 fast/js/toString-prefix-postfix-preserve-parens.html
1273 fast/js/kde/lval-exceptions.html
1275 Functions now save a shared subrange of the original source used
1276 to make them (so in the common case this adds no storage above the
1279 * kjs/SourceProvider.h: Added.
1280 (KJS::SourceProvider): New abstract base class for classes that provide on-demand access
1281 to the source for a JavaScript program. This allows function objects to have access to their
1282 original source without copying.
1283 (KJS::UStringSourceProvider): SourceProvider subclass backed by a KJS::UString.
1284 (KJS::UStringSourceProvider::create):
1285 (KJS::UStringSourceProvider::getRange):
1286 (KJS::UStringSourceProvider::data):
1287 (KJS::UStringSourceProvider::length):
1288 (KJS::UStringSourceProvider::UStringSourceProvider):
1289 * kjs/SourceRange.h: Added.
1290 (KJS::SourceRange::SourceRange): Class that holds a SourceProvider and a character range into
1291 the source, to encapsulate on-demand access to the source of a function.
1292 (KJS::SourceRange::toString):
1294 (KJS::eval): Pass a UStringSourceProvider to the parser.
1296 (KJS::Parser::parse): Take a SourceProvider and pass it on to the lexer.
1298 (KJS::Parser::parse): Take a SourceProvider.
1300 (KJS::Lexer::setCode): Take a SourceProvider; keep it around, and
1301 use it to get the raw buffer and length.
1303 (KJS::Lexer::sourceRange): Convenience function to get a source
1304 range based on the lexer's source provieder, and char offsets
1305 right before and after the desired range.
1307 (KJS::globalFuncEval): Pass a UStringSourceProvider to the parser.
1308 * kjs/function_object.cpp:
1309 (KJS::functionProtoFuncToString): Use toSourceString to get the source.
1310 (KJS::FunctionObjectImp::construct): Give the parser a UStringSourceProvider.
1311 * kjs/grammar.y: When parsing a function declaration, function
1312 expression, or getter or setter, tell the function body about its
1314 * kjs/interpreter.cpp:
1315 (KJS::Interpreter::checkSyntax): Pass a SourceProvider to the parser.
1316 (KJS::Interpreter::evaluate): Pass a SourceProvider to the parser.
1317 * kjs/interpreter.h:
1319 (KJS::FunctionBodyNode::setSource): Establish a SourceRange for this function.
1320 (KJS::FunctionBodyNode::toSourceString): Get the source string out
1322 (KJS::FuncExprNode::): Take a SourceRange and set it on the body.
1323 (KJS::FuncDeclNode::): ditto
1325 (prettyPrintScript): Use a SourceProvider appropriately.
1326 * JavaScriptCore.exp: Export new symbols.
1327 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add new files.
1328 * JavaScriptCore.xcodeproj/project.pbxproj: Add new files.
1330 2008-05-09 Oliver Hunt <oliver@apple.com>
1334 Bring back RegisterFile tainting in order to correctly handle
1335 natively implemented getters and setters that re-enter JavaScript
1338 (KJS::Machine::privateExecute):
1339 * VM/RegisterFile.h:
1341 (KJS::FunctionImp::callAsFunction):
1343 (KJS::JSObject::put):
1344 (KJS::tryGetAndCallProperty):
1345 * kjs/property_slot.cpp:
1346 (KJS::PropertySlot::functionGetter):
1348 2008-05-09 Maciej Stachowiak <mjs@apple.com>
1352 - track character offsets of open and close braces, in preparation for saving function source
1354 I verified that there is no performance regression from this change.
1359 (KJS::Lexer::matchPunctuator):
1362 2008-05-09 Oliver Hunt <oliver@apple.com>
1364 Reviewed by Nobody (build fix).
1368 * kjs/JSGlobalObject.cpp:
1369 (KJS::JSGlobalObject::restoreLocalStorage):
1371 2008-05-09 Oliver Hunt <oliver@apple.com>
1375 Build fixes for SquirrelFish on windows.
1377 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1378 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1380 * kjs/JSGlobalObject.cpp:
1381 (KJS::JSGlobalObject::restoreLocalStorage):
1382 * kjs/collector.cpp:
1383 (KJS::Collector::allocate):
1384 (KJS::Collector::allocateNumber):
1386 (KJS::Collector::allocate):
1387 (KJS::Collector::allocateNumber):
1388 * kjs/property_slot.cpp:
1390 2008-05-08 Maciej Stachowiak <mjs@apple.com>
1394 - fix activation tearoff in the case where functions are called with too many arguments
1397 fast/canvas/patternfill-repeat.html
1398 fast/dom/SelectorAPI/bug-17313.html
1401 (KJS::slideRegisterWindowForCall):
1402 (KJS::scopeChainForCall):
1403 (KJS::Machine::execute):
1404 (KJS::Machine::privateExecute):
1406 2008-05-08 Geoffrey Garen <ggaren@apple.com>
1408 Reviewed by Oliver Hunt.
1410 Fixed failure in fast/canvas/canvas-pattern-behaviour.html.
1412 SunSpider reports a small speedup. Not sure what that's about.
1415 (KJS::CodeBlock::dump): Fixed op_call_eval to dump as "op_call_eval".
1416 This helped me while debugging.
1419 (KJS::Machine::unwindCallFrame): When looking for an activation to tear
1420 off, don't use the scope chain. Inside eval, the scope chain doesn't
1421 belong to us; it belongs to our calling function.
1423 Also, don't use the needsFullScopeChain flag to decide whether to tear
1424 off the activation. "function.arguments" can create an activation
1425 for a function whose needsFullScopeChain flag is set to false.
1427 2008-05-08 Maciej Stachowiak <mjs@apple.com>
1431 - fix function.call for calls of more than 8 arguments
1433 Fixes svg/carto.net/button.svg
1436 (KJS::List::getSlice): properly set up the m_buffer of the target list.
1438 2008-05-08 Maciej Stachowiak <mjs@apple.com>
1442 - don't return a null RegisterID from RegExpNode in the exception case, since the caller may need a real register
1445 - fast/regex/early-acid3-86.html
1446 - http/tests/misc/acid3.html
1449 (KJS::RegExpNode::emitCode):
1451 2008-05-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1455 Fix a performance regression caused by the introduction of property
1456 attributes to SymbolTable in r32859 by encoding the attributes and the
1457 register index into a single field of SymbolTableEntry.
1459 This leaves Node::optimizeVariableAccess() definitely broken, although
1460 it was probably not entirely correct in SquirrelFish before this change.
1463 (KJS::missingThisObjectMarker):
1464 * VM/CodeGenerator.cpp:
1465 (KJS::CodeGenerator::addVar):
1466 (KJS::CodeGenerator::CodeGenerator):
1467 (KJS::CodeGenerator::registerForLocal):
1468 (KJS::CodeGenerator::registerForLocalConstInit):
1469 (KJS::CodeGenerator::isLocalConstant):
1470 (KJS::CodeGenerator::addConstant):
1471 (KJS::CodeGenerator::emitCall):
1472 * VM/CodeGenerator.h:
1473 (KJS::CodeGenerator::IdentifierMapIndexHashTraits::emptyValue):
1475 (KJS::Machine::privateExecute):
1476 * kjs/JSGlobalObject.cpp:
1477 (KJS::JSGlobalObject::saveLocalStorage):
1478 * kjs/JSVariableObject.cpp:
1479 (KJS::JSVariableObject::getPropertyNames):
1480 (KJS::JSVariableObject::getPropertyAttributes):
1481 * kjs/JSVariableObject.h:
1482 (KJS::JSVariableObject::symbolTableGet):
1483 (KJS::JSVariableObject::symbolTablePut):
1484 (KJS::JSVariableObject::symbolTablePutWithAttributes):
1485 * kjs/SymbolTable.h:
1486 (KJS::SymbolTableEntry::SymbolTableEntry):
1487 (KJS::SymbolTableEntry::isEmpty):
1488 (KJS::SymbolTableEntry::getIndex):
1489 (KJS::SymbolTableEntry::getAttributes):
1490 (KJS::SymbolTableEntry::setAttributes):
1491 (KJS::SymbolTableEntry::isReadOnly):
1493 (KJS::getSymbolTableEntry):
1494 (KJS::PostIncResolveNode::optimizeVariableAccess):
1495 (KJS::PostDecResolveNode::optimizeVariableAccess):
1496 (KJS::DeleteResolveNode::optimizeVariableAccess):
1497 (KJS::TypeOfResolveNode::optimizeVariableAccess):
1498 (KJS::PreIncResolveNode::optimizeVariableAccess):
1499 (KJS::PreDecResolveNode::optimizeVariableAccess):
1500 (KJS::ReadModifyResolveNode::optimizeVariableAccess):
1501 (KJS::AssignResolveNode::optimizeVariableAccess):
1502 (KJS::ProgramNode::initializeSymbolTable):
1504 2008-05-06 Maciej Stachowiak <mjs@apple.com>
1506 Rubber stamped by Oliver.
1508 - add missing ! in an assert that I failed to reverse
1510 * VM/CodeGenerator.cpp:
1511 (KJS::CodeGenerator::CodeGenerator):
1513 2008-05-06 Maciej Stachowiak <mjs@apple.com>
1517 - fixed "SQUIRRELFISH: window.this shows up as a property, but it shouldn't"
1518 https://bugs.webkit.org/show_bug.cgi?id=18868
1520 The basic approach is to have "this" only be present in the symbol
1521 table at compile time, not runtime.
1523 * VM/CodeGenerator.cpp:
1524 (KJS::CodeGenerator::~CodeGenerator): Remove "this" from symbol table.
1525 (KJS::CodeGenerator::CodeGenerator): Add "this" back when re-using
1527 * VM/CodeGenerator.h:
1529 (KJS::Machine::execute): Don't assert that "this" is in the symbol table.
1531 2008-05-06 Geoffrey Garen <ggaren@apple.com>
1533 Reviewed by Oliver Hunt.
1535 Trivial support for function.arguments: Currently, we only support
1536 function.arguments from within the scope of function.
1538 This fixes the remaining Mozilla JS test failures.
1540 SunSpider reports no change.
1542 * JavaScriptCore.exp:
1545 (KJS::Machine::privateExecute): Separated scope chain deref from
1546 activation register copying: since it is now possible for client code
1547 to create an activation on behalf of a function that otherwise wouldn't
1548 need one, having an activation no longer necessarily means that you need
1549 to deref the scope chain.
1551 (KJS::Machine::getCallFrame): For now, this function only examines the
1552 current scope. Walking parent scopes requires some refactoring in the
1553 way we track execution stacks.
1555 * kjs/ExecState.cpp:
1556 (KJS::ExecState::ExecState): We use a negative call frame offset to
1557 indicate that a given scope is not a function call scope.
1559 2008-05-05 Oliver Hunt <oliver@apple.com>
1563 Fix call frame set up for native -> JS function calls.
1566 (KJS::Machine::execute):
1568 2008-05-05 Geoffrey Garen <ggaren@apple.com>
1570 Reviewed by Maciej Stachowiak.
1572 Fixed ecma_3/Object/8.6.2.6-001.js, and similar bugs.
1574 SunSpider reports a .4% speedup. Not sure what that's about.
1577 (KJS::Machine::privateExecute): Check for exception return from equal,
1578 since toPrimitive can throw.
1580 * kjs/operations.cpp:
1581 (KJS::strictEqual): In response to an error I made in an earlier version
1582 of this patch, I changed strictEqual to make clear the fact that it
1583 performs no conversions and can't throw, making it slightly more efficient
1586 2008-05-05 Maciej Stachowiak <mjs@apple.com>
1590 - fix some dumb mistakes in my last patch
1592 * VM/CodeGenerator.cpp:
1593 (KJS::CodeGenerator::emitPushScope):
1594 (KJS::CodeGenerator::emitGetPropertyNames):
1596 (KJS::Machine::privateExecute):
1598 2008-05-05 Maciej Stachowiak <mjs@apple.com>
1602 - document opcodes relating to jumps, scopes, and property name iteration
1604 Documented jmp, jtrue, false, push_scope, pop_scope, get_pnames,
1605 next_pname and jmp_scopes.
1607 * VM/CodeGenerator.cpp:
1608 (KJS::CodeGenerator::emitJump):
1609 (KJS::CodeGenerator::emitJumpIfTrue):
1610 (KJS::CodeGenerator::emitJumpIfFalse):
1611 (KJS::CodeGenerator::emitPushScope):
1612 (KJS::CodeGenerator::emitNextPropertyName):
1613 (KJS::CodeGenerator::emitGetPropertyNames):
1614 * VM/CodeGenerator.h:
1616 (KJS::Machine::privateExecute):
1618 (KJS::LogicalAndNode::emitCode):
1619 (KJS::LogicalOrNode::emitCode):
1620 (KJS::ConditionalNode::emitCode):
1621 (KJS::IfNode::emitCode):
1622 (KJS::IfElseNode::emitCode):
1623 (KJS::DoWhileNode::emitCode):
1624 (KJS::WhileNode::emitCode):
1625 (KJS::ForNode::emitCode):
1626 (KJS::ForInNode::emitCode):
1627 (KJS::WithNode::emitCode):
1629 2008-05-05 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1633 Bug 18749: SQUIRRELFISH: const support is broken
1634 <https://bugs.webkit.org/show_bug.cgi?id=18749>
1636 Adds support for const during code generation.
1638 Fixes 2 layout tests.
1641 * VM/CodeGenerator.cpp:
1642 (KJS::CodeGenerator::addVar):
1643 (KJS::CodeGenerator::CodeGenerator):
1644 (KJS::CodeGenerator::isLocalConstant):
1645 * VM/CodeGenerator.h:
1646 (KJS::CodeGenerator::addVar):
1648 (KJS::PostIncResolveNode::emitCode):
1649 (KJS::PostDecResolveNode::emitCode):
1650 (KJS::PreIncResolveNode::emitCode):
1651 (KJS::PreDecResolveNode::emitCode):
1652 (KJS::ReadModifyResolveNode::emitCode):
1653 (KJS::AssignResolveNode::emitCode):
1655 2008-05-04 Maciej Stachowiak <mjs@apple.com>
1659 - document some more opcodes (and fix argument names)
1661 Added docs for eq, neq, stricteq, nstriceq, less and lesseq.
1663 * VM/CodeGenerator.cpp:
1664 (KJS::CodeGenerator::emitEqual):
1665 (KJS::CodeGenerator::emitNotEqual):
1666 (KJS::CodeGenerator::emitStrictEqual):
1667 (KJS::CodeGenerator::emitNotStrictEqual):
1668 (KJS::CodeGenerator::emitLess):
1669 (KJS::CodeGenerator::emitLessEq):
1670 * VM/CodeGenerator.h:
1672 (KJS::Machine::privateExecute):
1674 (KJS::LessNode::emitCode):
1675 (KJS::GreaterNode::emitCode):
1676 (KJS::LessEqNode::emitCode):
1677 (KJS::GreaterEqNode::emitCode):
1678 (KJS::EqualNode::emitCode):
1679 (KJS::NotEqualNode::emitCode):
1680 (KJS::StrictEqualNode::emitCode):
1681 (KJS::NotStrictEqualNode::emitCode):
1682 (KJS::CaseBlockNode::emitCodeForBlock):
1684 2008-05-04 Geoffrey Garen <ggaren@apple.com>
1686 Reviewed by Maciej Stachowiak.
1688 More scaffolding for f.arguments.
1690 Track the offset of the last call frame in the ExecState, so we can
1691 produce a backtrace at any time.
1693 Also, record numLocals, the sum of numVars + numParameters, in each code
1694 block, to make updates to the ExecState a little cheaper than they
1697 We now use numLocals in a bunch of places where we used to calculate
1698 numVars + numParameters or -numVars - numParameters.
1700 Reports are mixed, but all in all, this seems to be a wash on SunSpider.
1702 2008-05-04 Oliver Hunt <oliver@apple.com>
1706 Whoops, correctly handle properties that don't exist in the
1709 * kjs/JSVariableObject.h:
1710 (KJS::JSVariableObject::symbolTablePutWithAttributes):
1712 2008-05-04 Oliver Hunt <oliver@apple.com>
1716 Add attribute information to SymbolTable as ground work for
1717 various DontEnum and ReadOnly issues.
1719 * VM/CodeGenerator.cpp:
1720 (KJS::CodeGenerator::addVar):
1721 (KJS::CodeGenerator::CodeGenerator):
1722 (KJS::CodeGenerator::registerForLocal):
1723 (KJS::CodeGenerator::registerForLocalConstInit):
1724 (KJS::CodeGenerator::addConstant):
1726 (KJS::Machine::execute):
1727 * kjs/JSGlobalObject.cpp:
1728 (KJS::JSGlobalObject::saveLocalStorage):
1729 * kjs/JSVariableObject.cpp:
1730 (KJS::JSVariableObject::getPropertyNames):
1731 (KJS::JSVariableObject::getPropertyAttributes):
1732 * kjs/JSVariableObject.h:
1733 (KJS::JSVariableObject::symbolTablePut):
1734 (KJS::JSVariableObject::symbolTablePutWithAttributes):
1735 * kjs/SymbolTable.h:
1736 (KJS::SymbolTableEntry::SymbolTableEntry):
1737 (KJS::SymbolTableIndexHashTraits::emptyValue):
1739 (KJS::getSymbolTableEntry):
1740 (KJS::ReadModifyResolveNode::optimizeVariableAccess):
1741 (KJS::AssignResolveNode::optimizeVariableAccess):
1742 (KJS::ProgramNode::initializeSymbolTable):
1744 2008-05-04 Geoffrey Garen <ggaren@apple.com>
1746 Reviewed by Oliver Hunt.
1748 More scaffolding for f.arguments.
1750 Store the register file associated with an ExecState in the ExecState.
1752 SunSpider reports no change.
1754 * kjs/JSGlobalObject.h:
1755 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Moved
1756 registerFileStack above globalExec, so it gets initialized first.
1757 Removed remnants of old activation scheme.
1759 2008-05-04 Maciej Stachowiak <mjs@apple.com>
1761 Rubber stamped by Oliver.
1763 - renamed a few opcodes and fixed assembly formatting to accomodate the longest opcode
1767 resolve_base_and_property --> resolve_with_base
1768 resolve_base_and_func --> resolve_func
1769 get_prop_id --> get_by_id
1770 put_prop_id --> put_by_id
1771 delete_prop_id --> del_by_id
1772 get_prop_val --> get_by_val
1773 put_prop_val --> put_by_val
1774 delete_prop_val --> del_by_val
1775 put_prop_index --> put_by_index
1778 (KJS::printUnaryOp):
1779 (KJS::printBinaryOp):
1780 (KJS::printConditionalJump):
1781 (KJS::CodeBlock::dump):
1782 * VM/CodeGenerator.cpp:
1783 (KJS::CodeGenerator::emitEqual):
1784 (KJS::CodeGenerator::emitNotEqual):
1785 (KJS::CodeGenerator::emitResolveWithBase):
1786 (KJS::CodeGenerator::emitResolveFunction):
1787 (KJS::CodeGenerator::emitGetById):
1788 (KJS::CodeGenerator::emitPutById):
1789 (KJS::CodeGenerator::emitDeleteById):
1790 (KJS::CodeGenerator::emitGetByVal):
1791 (KJS::CodeGenerator::emitPutByVal):
1792 (KJS::CodeGenerator::emitDeleteByVal):
1793 (KJS::CodeGenerator::emitPutByIndex):
1794 * VM/CodeGenerator.h:
1796 (KJS::Machine::privateExecute):
1799 (KJS::ArrayNode::emitCode):
1800 (KJS::PropertyListNode::emitCode):
1801 (KJS::BracketAccessorNode::emitCode):
1802 (KJS::DotAccessorNode::emitCode):
1803 (KJS::EvalFunctionCallNode::emitCode):
1804 (KJS::FunctionCallResolveNode::emitCode):
1805 (KJS::FunctionCallBracketNode::emitCode):
1806 (KJS::FunctionCallDotNode::emitCode):
1807 (KJS::PostIncResolveNode::emitCode):
1808 (KJS::PostDecResolveNode::emitCode):
1809 (KJS::PostIncBracketNode::emitCode):
1810 (KJS::PostDecBracketNode::emitCode):
1811 (KJS::PostIncDotNode::emitCode):
1812 (KJS::PostDecDotNode::emitCode):
1813 (KJS::DeleteResolveNode::emitCode):
1814 (KJS::DeleteBracketNode::emitCode):
1815 (KJS::DeleteDotNode::emitCode):
1816 (KJS::TypeOfResolveNode::emitCode):
1817 (KJS::PreIncResolveNode::emitCode):
1818 (KJS::PreDecResolveNode::emitCode):
1819 (KJS::PreIncBracketNode::emitCode):
1820 (KJS::PreDecBracketNode::emitCode):
1821 (KJS::PreIncDotNode::emitCode):
1822 (KJS::PreDecDotNode::emitCode):
1823 (KJS::ReadModifyResolveNode::emitCode):
1824 (KJS::AssignResolveNode::emitCode):
1825 (KJS::AssignDotNode::emitCode):
1826 (KJS::ReadModifyDotNode::emitCode):
1827 (KJS::AssignBracketNode::emitCode):
1828 (KJS::ReadModifyBracketNode::emitCode):
1829 (KJS::ConstDeclNode::emitCodeSingle):
1830 (KJS::ForInNode::emitCode):
1831 (KJS::TryNode::emitCode):
1833 2008-05-04 Oliver Hunt <oliver@apple.com>
1837 Fix assertion when accessing arguments object with too many arguments provided
1839 The arguments constructor was assuming that the register offset given for argv
1840 was an absolute offset into the registerfile, rather than the offset from the
1841 frame. This patches corrects that issue.
1843 * kjs/JSActivation.cpp:
1844 (KJS::JSActivation::createArgumentsObject):
1846 2008-05-04 Geoffrey Garen <ggaren@apple.com>
1848 Rubber stamped by Sam Weinig.
1850 Cleaned up Machine.cpp according to our style guidelines: moved static
1851 data to the top of the file; moved stand-alone functions below that;
1852 moved the Machine constructor above other Machine member functions.
1854 2008-05-03 Maciej Stachowiak <mjs@apple.com>
1858 - fix accidental breakage from last patch
1861 (KJS::Machine::privateExecute):
1863 2008-05-03 Maciej Stachowiak <mjs@apple.com>
1867 - a bunch more opcode documentation and corresponding parameter name fixes
1869 I renamed a few opcodes:
1871 type_of --> typeof (that's what the JS operator is named)
1872 instance_of --> instanceof (ditto)
1873 create_error --> new_error (for consistency with other new_* opcodes)
1875 I documented the following opcodes:
1897 I also fixed formatting on some existing opcode docs.
1900 (KJS::CodeBlock::dump):
1901 * VM/CodeGenerator.cpp:
1902 (KJS::CodeGenerator::emitMove):
1903 (KJS::CodeGenerator::emitNot):
1904 (KJS::CodeGenerator::emitPreInc):
1905 (KJS::CodeGenerator::emitPreDec):
1906 (KJS::CodeGenerator::emitPostInc):
1907 (KJS::CodeGenerator::emitPostDec):
1908 (KJS::CodeGenerator::emitToJSNumber):
1909 (KJS::CodeGenerator::emitNegate):
1910 (KJS::CodeGenerator::emitBitNot):
1911 (KJS::CodeGenerator::emitInstanceOf):
1912 (KJS::CodeGenerator::emitTypeOf):
1913 (KJS::CodeGenerator::emitIn):
1914 (KJS::CodeGenerator::emitLoad):
1915 (KJS::CodeGenerator::emitNewObject):
1916 (KJS::CodeGenerator::emitNewArray):
1917 (KJS::CodeGenerator::emitNewRegExp):
1918 (KJS::CodeGenerator::emitNewError):
1919 * VM/CodeGenerator.h:
1920 (KJS::CodeGenerator::scopeDepth):
1921 (KJS::CodeGenerator::addVar):
1923 (KJS::Machine::privateExecute):
1926 (KJS::Node::emitThrowError):
1927 (KJS::RegExpNode::emitCode):
1928 (KJS::TypeOfValueNode::emitCode):
1929 (KJS::UnaryPlusNode::emitCode):
1930 (KJS::NegateNode::emitCode):
1931 (KJS::BitwiseNotNode::emitCode):
1932 (KJS::LogicalNotNode::emitCode):
1933 (KJS::InstanceOfNode::emitCode):
1934 (KJS::InNode::emitCode):
1936 2008-05-03 Maciej Stachowiak <mjs@apple.com>
1938 Reviewed by Geoff and Sam.
1940 - generate HTML bytecode docs at build time
1942 * DerivedSources.make:
1944 * docs/make-bytecode-docs.pl: Added.
1946 2008-05-03 Geoffrey Garen <ggaren@apple.com>
1948 Reviewed by Sam Weinig.
1950 Update ExecState::m_scopeChain when switching scope chains inside the
1953 This fixes uses of lexicalGlobalObject, such as, in a subframe
1955 alert(top.makeArray() instanceof Array ? "FAIL" : "PASS");
1957 and a bunch of the security failures listed in
1958 https://bugs.webkit.org/show_bug.cgi?id=18870. (Those tests still fail,
1959 seemingly because of regressions in exception messages).
1961 SunSpider reports no change.
1963 * VM/Machine.cpp: Factored out scope chain updating into a common
1964 function that takes care to update ExecState::m_scopeChain, too.
1966 * kjs/ExecState.h: I made Machine a friend of ExecState so that Machine
1967 could update ExecState::m_scopeChain, even though that value is
1968 read-only for everyone else.
1970 * kjs/JSGlobalObject.h:
1971 (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Changed
1972 this client to be a little friendlier to ExecState's internal
1973 storage type for scope chain data.
1975 2008-05-03 Geoffrey Garen <ggaren@apple.com>
1977 Reviewed by Sam Weinig.
1979 Fixed https://bugs.webkit.org/show_bug.cgi?id=18876
1980 Squirrelfish: ScopeChainNode leak in op_jmp_scopes.
1982 SunSpider reports no change.
1985 (KJS::Machine::privateExecute): Don't construct a ScopeChain object,
1986 since the direct threaded interpreter will goto across its destructor.
1988 2008-05-03 Geoffrey Garen <ggaren@apple.com>
1990 Reviewed by Oliver Hunt.
1992 A bit more efficient fix than r32832: Don't copy globals into function
1993 register files; instead, have the RegisterFileStack track only the base
1994 of the last *global* register file, so the global object's register
1995 references stay good.
1997 SunSpider reports a .3% speedup. Not sure what that's about.
1999 2008-05-03 Oliver Hunt <oliver@apple.com>
2003 Bug 18864: SquirrelFish: Support getter and setter definition in object literals
2004 <https://bugs.webkit.org/show_bug.cgi?id=18864>
2006 Add new opcodes to allow us to add getters and setters to an object. These are
2007 only used by the codegen for object literals.
2009 * VM/CodeGenerator.cpp:
2010 (KJS::CodeGenerator::emitPutGetter):
2011 (KJS::CodeGenerator::emitPutSetter):
2012 * VM/CodeGenerator.h:
2014 (KJS::Machine::privateExecute):
2017 (KJS::PropertyListNode::emitCode):
2019 2008-05-02 Maciej Stachowiak <mjs@apple.com>
2023 - properly copy globals into and out of implicit call register
2024 files, otherwise they will fail at global lookup
2026 Fixes fast/js/array-tostring-and-join.html layout test.
2028 * VM/RegisterFileStack.cpp:
2029 (KJS::RegisterFileStack::pushGlobalRegisterFile):
2030 (KJS::RegisterFileStack::popGlobalRegisterFile):
2031 (KJS::RegisterFileStack::pushFunctionRegisterFile):
2032 (KJS::RegisterFileStack::popFunctionRegisterFile):
2034 2008-05-02 Geoffrey Garen <ggaren@apple.com>
2036 Reviewed by Oliver Hunt.
2038 Fixed https://bugs.webkit.org/show_bug.cgi?id=18822
2039 SQUIRRELFISH: incorrect eval used in some cases
2041 Changed all code inside the machine to fetch the lexical global object
2042 directly from the scope chain, instead of from the ExecState.
2044 Clients who fetch the lexical global object through the ExecState
2047 SunSpider reports no change.
2050 (KJS::Machine::privateExecute): Fetch the lexical global object from
2054 (KJS::ExecState::ExecState::lexicalGlobalObject): Moved the logic for
2055 this function into ScopeChainNode, but kept this function around to
2056 support existing clients.
2058 2008-05-02 Geoffrey Garen <ggaren@apple.com>
2060 Rubber stamped by Oliver Hunt.
2062 Removed ExecState.cpp from AllInOneFile.cpp, for a .2% speedup.
2064 * JavaScriptCore.xcodeproj/project.pbxproj:
2065 * kjs/AllInOneFile.cpp:
2067 2008-05-01 Oliver Hunt <oliver@apple.com>
2069 Reviewed by Geoff and Maciej.
2071 Bug 18827: SquirrelFish: Prevent getters and setters from destroying the current RegisterFile
2072 <https://bugs.webkit.org/show_bug.cgi?id=18827>
2074 Remove safe/unsafe RegisterFile concept, and instead just add additional
2075 logic to ensure we always push/pop RegisterFiles when executing getters
2076 and setters, similar to the logic for valueOf and toString.
2079 (KJS::Machine::privateExecute):
2080 * VM/RegisterFile.h:
2082 (KJS::FunctionImp::callAsFunction):
2084 (KJS::JSObject::put):
2085 * kjs/property_slot.cpp:
2086 (KJS::PropertySlot::functionGetter):
2088 2008-05-01 Oliver Hunt <oliver@apple.com>
2092 Rename unsafeForReentry to safeForReentry to avoid double negatives.
2095 (KJS::Machine::privateExecute):
2096 * VM/RegisterFile.h:
2098 (KJS::FunctionImp::callAsFunction):
2100 2008-05-01 Oliver Hunt <oliver@apple.com>
2104 Bug 18827: SquirrelFish: Prevent getters and setters from destroying the current RegisterFile
2105 <https://bugs.webkit.org/show_bug.cgi?id=18827>
2107 This patch makes getters and setters work. It does this by
2108 tracking whether the RegisterFile is "safe", that is whether
2109 the interpreter is in a state that in which it can handle
2110 the RegisterFile being reallocated.
2114 (KJS::Machine::privateExecute):
2115 * VM/RegisterFile.h:
2117 (KJS::FunctionImp::callAsFunction):
2119 2008-04-30 Geoffrey Garen <ggaren@apple.com>
2121 Release build fix: Always compile in "isGlobalObject", since it's
2122 listed in our .exp file.
2124 * kjs/ExecState.cpp:
2125 (KJS::ExecState::isGlobalObject):
2128 2008-04-30 Oliver Hunt <oliver@apple.com>
2132 Minor code restructuring to prepare for getters and setters,
2133 also helps exception semantics a bit.
2136 (KJS::Machine::privateExecute):
2138 2008-04-30 Geoffrey Garen <ggaren@apple.com>
2144 2008-04-30 Geoffrey Garen <ggaren@apple.com>
2146 Debug build fix: export a missing symbol.
2148 * JavaScriptCore.exp:
2150 2008-04-30 Geoffrey Garen <ggaren@apple.com>
2152 Reviewed by Oliver Hunt.
2154 A little more ExecState refactoring: Now, only the global object creates
2157 Also inlined ExecState::lexicalGlobalObject().
2159 SunSpider reports no change.
2161 2008-04-30 Geoffrey Garen <ggaren@apple.com>
2163 WebCore build fix: forward-declare ScopeChain.
2165 * kjs/interpreter.h:
2167 2008-04-30 Geoffrey Garen <ggaren@apple.com>
2169 Build fix for JavaScriptGlue: export a missing symbol.
2171 * JavaScriptCore.exp:
2173 2008-04-30 Geoffrey Garen <ggaren@apple.com>
2175 Reviewed by Oliver Hunt.
2177 Removed a lot of unused bits from ExecState, moving them into
2178 OldInterpreterExecState, the fake scaffolding class.
2180 The clutter was making it hard to see the forest from the trees.
2182 .4% SunSpider speedup, probably because ExecState::lexicalGlobalObject()
2185 2008-04-29 Oliver Hunt <oliver@apple.com>
2189 Bug 18643: SQUIRRELFISH: need to support implicit function calls (valueOf, toString, getters/setters)
2190 <https://bugs.webkit.org/show_bug.cgi?id=18643>
2192 Prevent static slot optimisation for new variables and functions in
2193 globally re-entrant code called from an an implicit function call.
2195 This is necessary to prevent us from needing to resize the global
2196 slot portion of the root RegisterFile during an implicit (and hence
2197 unguarded) function call.
2199 * VM/CodeGenerator.cpp:
2200 (KJS::CodeGenerator::CodeGenerator):
2201 * VM/CodeGenerator.h:
2203 (KJS::Machine::execute):
2204 * VM/RegisterFile.h:
2205 * VM/RegisterFileStack.cpp:
2206 (KJS::RegisterFileStack::pushGlobalRegisterFile):
2207 (KJS::RegisterFileStack::popGlobalRegisterFile):
2208 (KJS::RegisterFileStack::pushFunctionRegisterFile):
2209 (KJS::RegisterFileStack::popFunctionRegisterFile):
2210 * VM/RegisterFileStack.h:
2211 (KJS::RegisterFileStack::inImplicitFunctionCall):
2212 (KJS::RegisterFileStack::lastGlobal):
2214 (KJS::ProgramNode::generateCode):
2216 (KJS::ProgramNode::):
2218 2008-04-29 Geoffrey Garen <ggaren@apple.com>
2220 Reviewed by Oliver Hunt.
2222 In nested program code, don't propogate "this" back to the parent
2223 register file. ("this" should remain constant in the parent register
2224 file, regardless of the scripts it invokes.)
2226 * VM/RegisterFile.cpp:
2227 (KJS::RegisterFile::copyGlobals):
2229 2008-04-28 Oliver Hunt <oliver@apple.com>
2233 Restore base pointer when popping a global RegisterFile
2235 * VM/RegisterFileStack.cpp:
2236 (KJS::RegisterFileStack::popGlobalRegisterFile):
2238 2008-04-28 Oliver Hunt <oliver@apple.com>
2242 Bug 18643: SQUIRRELFISH: need to support implicit function calls (valueOf, toString, getters/setters)
2243 <https://bugs.webkit.org/show_bug.cgi?id=18643>
2245 Partial fix. This results in all implicit calls to toString or valueOf
2246 executing in a separate RegisterFile, so ensuring that the the pointers
2247 in the triggering interpreter don't get trashed. This still leaves the
2248 task of preventing new global re-entry from toString and valueOf from
2249 clobbering the RegisterFile.
2252 (KJS::Machine::execute):
2253 * VM/RegisterFileStack.cpp:
2254 (KJS::RegisterFileStack::pushFunctionRegisterFile):
2255 (KJS::RegisterFileStack::popFunctionRegisterFile):
2256 * VM/RegisterFileStack.h:
2258 (KJS::tryGetAndCallProperty):
2260 2008-04-28 Geoffrey Garen <ggaren@apple.com>
2262 Reviewed by Maciej Stachowiak.
2264 Simplified activation object a bit: No need to store the callee
2265 in the activation object -- we can pull it out of the call frame
2266 when needed, instead.
2268 SunSpider reports no change.
2270 2008-04-28 Geoffrey Garen <ggaren@apple.com>
2272 Reviewed by Maciej Stachowiak.
2274 RS by Oliver Hunt on moving JSArguments.cpp out of AllInOneFile.cpp.
2276 Substantially more handling of "arguments": "arguments" works fully
2277 now, but "f.arguments" still doesn't work.
2279 Fixes 10 regression tests.
2281 SunSpider reports no regression.
2283 * kjs/JSActivation.cpp:
2284 (KJS::JSActivation::createArgumentsObject): Reconstruct an arguments
2285 List to pass to the arguments object constructor.
2287 * JavaScriptCore.xcodeproj/project.pbxproj:
2288 * kjs/AllInOneFile.cpp: Removed JSActivation.cpp from AllInOneFile.cpp
2289 because that seems to make GCC happy. (Previously, I had added
2290 JSActivation.cpp to AllInOneFile.cpp because *that* seemed to make GCC
2293 2008-04-28 Geoffrey Garen <ggaren@apple.com>
2295 Reviewed by Maciej Stachowiak.
2297 Groundwork for more handling of "arguments". I'm not checking in the
2298 actual handling of "arguments" yet, because it still needs a little
2299 fiddling to avoid a performance regression.
2301 SunSpider reports no change.
2304 (KJS::initializeCallFrame): Put argc in the register file, so the
2305 arguments object can find it later, to determine arguments.length.
2308 (KJS::FunctionBodyNode::): Added a special code accessor for when you
2309 know the code has already been generated, and you don't have a scopeChain
2310 to supply for potential code generation. (This is the case when the
2311 activation object creates the arguments object.)
2313 2008-04-28 Oliver Hunt <oliver@apple.com>
2317 Replace unsafe use of auto_ptr in Vector with manual memory
2320 * VM/RegisterFileStack.cpp:
2321 (KJS::RegisterFileStack::~RegisterFileStack):
2322 (KJS::RegisterFileStack::popRegisterFile):
2323 * VM/RegisterFileStack.h:
2325 2008-04-27 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2329 Bug 18746: SQUIRRELFISH: indirect eval used when direct eval should be used
2330 <https://bugs.webkit.org/show_bug.cgi?id=18746>
2332 Change the base to the correct value of the 'this' object after the direct
2333 eval test instead of before.
2335 Fixes 5 layout tests.
2338 (KJS::Machine::privateExecute):
2340 (KJS::EvalFunctionCallNode::emitCode):
2342 2008-04-26 Maciej Stachowiak <mjs@apple.com>
2346 - document all property getting, setting and deleting opcodes
2348 (And fix function parameter names to match corresponding opcode parameter names.)
2350 * VM/CodeGenerator.cpp:
2351 (KJS::CodeGenerator::emitResolve):
2352 (KJS::CodeGenerator::emitResolveBase):
2353 (KJS::CodeGenerator::emitResolveBaseAndProperty):
2354 (KJS::CodeGenerator::emitResolveBaseAndFunc):
2355 (KJS::CodeGenerator::emitGetPropId):
2356 (KJS::CodeGenerator::emitPutPropId):
2357 (KJS::CodeGenerator::emitDeletePropId):
2358 (KJS::CodeGenerator::emitPutPropVal):
2359 * VM/CodeGenerator.h:
2363 (KJS::resolveBaseAndProperty):
2364 (KJS::resolveBaseAndFunc):
2365 (KJS::Machine::privateExecute):
2367 (KJS::ResolveNode::emitCode):
2368 (KJS::ArrayNode::emitCode):
2369 (KJS::PropertyListNode::emitCode):
2370 (KJS::BracketAccessorNode::emitCode):
2371 (KJS::EvalFunctionCallNode::emitCode):
2372 (KJS::FunctionCallResolveNode::emitCode):
2373 (KJS::FunctionCallBracketNode::emitCode):
2374 (KJS::PostIncResolveNode::emitCode):
2375 (KJS::PostDecResolveNode::emitCode):
2376 (KJS::PostIncBracketNode::emitCode):
2377 (KJS::PostDecBracketNode::emitCode):
2378 (KJS::PostIncDotNode::emitCode):
2379 (KJS::PostDecDotNode::emitCode):
2380 (KJS::DeleteResolveNode::emitCode):
2381 (KJS::TypeOfResolveNode::emitCode):
2382 (KJS::PreIncResolveNode::emitCode):
2383 (KJS::PreDecResolveNode::emitCode):
2384 (KJS::PreIncBracketNode::emitCode):
2385 (KJS::PreDecBracketNode::emitCode):
2386 (KJS::AssignResolveNode::emitCode):
2387 (KJS::AssignDotNode::emitCode):
2388 (KJS::ReadModifyDotNode::emitCode):
2389 (KJS::AssignBracketNode::emitCode):
2390 (KJS::ReadModifyBracketNode::emitCode):
2391 (KJS::ConstDeclNode::emitCodeSingle):
2393 2008-04-26 Oliver Hunt <oliver@apple.com>
2397 Bug 18628: SQUIRRELFISH: need to support recursion limit
2398 <https://bugs.webkit.org/show_bug.cgi?id=18628>
2400 Basically completes recursion limiting. There is still some
2401 tuning we may want to do to make things better in the face of
2402 very bad code, but certainly nothing worse than anything already
2405 Also fixes a WebKit test by fixing the exception text :D
2407 * JavaScriptCore.exp:
2408 * VM/ExceptionHelpers.cpp:
2410 (KJS::Machine::execute):
2411 * VM/RegisterFile.cpp:
2412 (KJS::RegisterFile::growBuffer):
2413 (KJS::RegisterFile::addGlobalSlots):
2414 * VM/RegisterFile.h:
2415 (KJS::RegisterFile::grow):
2416 (KJS::RegisterFile::uncheckedGrow):
2417 * VM/RegisterFileStack.cpp:
2418 (KJS::RegisterFileStack::pushRegisterFile):
2419 * VM/RegisterFileStack.h:
2421 2008-04-25 Oliver Hunt <oliver@apple.com>
2425 Bug 18628: SQUIRRELFISH: need to support recursion limit
2426 <https://bugs.webkit.org/show_bug.cgi?id=18628>
2428 Put a limit on the level of reentry recursion. 128 levels of re-entrant recursion
2429 seems reasonable as it is greater than the old eval limit, and a long way short of
2430 the reentry depth needed to overflow the stack.
2433 (KJS::Machine::execute):
2436 2008-04-25 Geoffrey Garen <ggaren@apple.com>
2438 Reviewed by Sam Weinig.
2440 A tiny bit of cleanup to the regexp code.
2442 Removed some static_cast.
2444 Removed createRegExpImp because it's no longer used.
2446 2008-04-25 Oliver Hunt <oliver@apple.com>
2450 Bug 18736: SQUIRRELFISH: switch statements with no default have incorrect codegen
2451 <https://bugs.webkit.org/show_bug.cgi?id=18736>
2453 Ensure the "default" target is correct in the absence of an explicit default handler.
2456 (KJS::CaseBlockNode::emitCodeForBlock):
2458 2008-04-25 Oliver Hunt <oliver@apple.com>
2462 Bug 18628: SQUIRRELFISH: need to support recursion limit
2463 <https://bugs.webkit.org/show_bug.cgi?id=18628>
2465 More bounds checking.
2468 (KJS::Machine::execute):
2469 * VM/RegisterFile.cpp:
2470 (KJS::RegisterFile::growBuffer):
2471 * VM/RegisterFile.h:
2473 2008-04-25 Maciej Stachowiak <mjs@apple.com>
2477 - fix signal catching magic
2479 The signal handlers are restored to _exit but are only set when
2480 running under run-javascriptcore-tests. fprintf from a signal
2481 handler is not safe.
2486 * tests/mozilla/jsDriver.pl:
2488 2008-04-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2492 Bug 18732: SQUIRRELFISH: exceptions thrown by native constructors are ignored
2493 <https://bugs.webkit.org/show_bug.cgi?id=18732>
2495 Fixes another regression test.
2498 (KJS::Machine::privateExecute):
2500 2008-04-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2504 Bug 18728: SQUIRRELFISH: invalid regular expression constants should throw exceptions
2505 <https://bugs.webkit.org/show_bug.cgi?id=18728>
2507 Fixes another regression test.
2510 (KJS::RegExpNode::emitCode):
2512 2008-04-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2514 Reviewed by Geoffrey Garen.
2516 Bug 18735: SQUIRRELFISH: closures are sometimes given an incorrect 'this' value when called
2517 <https://bugs.webkit.org/show_bug.cgi?id=18735>
2519 The overloaded toThisObject method was not copied over to JSActivation.
2521 Fixes two regression tests.
2523 * kjs/JSActivation.cpp:
2524 (KJS::JSActivation::toThisObject):
2525 * kjs/JSActivation.h:
2527 2008-04-24 Geoffrey Garen <ggaren@apple.com>
2529 Reviewed by Oliver Hunt.
2531 Added support for arguments.callee.
2533 2008-04-24 Oliver Hunt <oliver@apple.com>
2537 Bug 18628: SQUIRRELFISH: need to support recursion limit
2538 <https://bugs.webkit.org/show_bug.cgi?id=18628>
2540 Partial fix -- this gets us some of the required bounds checking, but not
2541 complete coverage. But it does manage to do them without regressing :D
2543 * VM/ExceptionHelpers.cpp:
2545 (KJS::createStackOverflowError):
2546 * VM/ExceptionHelpers.h:
2548 (KJS::slideRegisterWindowForCall):
2549 (KJS::Machine::execute):
2550 (KJS::Machine::privateExecute):
2551 * VM/RegisterFile.cpp:
2552 * VM/RegisterFile.h:
2553 (KJS::RegisterFile::):
2554 (KJS::RegisterFile::RegisterFile):
2555 (KJS::RegisterFile::grow):
2557 2008-04-24 Geoffrey Garen <ggaren@apple.com>
2559 Reviewed by Oliver Hunt.
2561 A tiny bit more handling of "arguments": create a real, but mostly
2562 hollow, arguments object.
2564 Fixes 2 regression tests.
2566 2008-04-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2570 Bug 18717: SQUIRRELFISH: eval returns the wrong value for a variable declaration statement
2571 <https://bugs.webkit.org/show_bug.cgi?id=18717>
2573 Fixes a regression test, but exposes the failure of another due to the
2574 lack of getters and setters.
2577 (KJS::ConstDeclNode::emitCodeSingle):
2578 (KJS::ConstDeclNode::emitCode):
2579 (KJS::ConstStatementNode::emitCode):
2580 (KJS::VarStatementNode::emitCode):
2583 2008-04-24 Geoffrey Garen <ggaren@apple.com>
2585 Reviewed by Sam Weinig.
2587 Print a CRASH statement when crashing, so test failures are not a
2594 2008-04-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2596 Reviewed by Geoffrey Garen.
2598 Bug 18716: SQUIRRELFISH: typeof should return undefined for an undefined variable reference
2599 <https://bugs.webkit.org/show_bug.cgi?id=18716>
2601 This fixes 2 more regression tests.
2604 (KJS::TypeOfResolveNode::emitCode):
2606 2008-04-24 Geoffrey Garen <ggaren@apple.com>
2608 Reviewed by Sam Weinig.
2610 Put the callee in the call frame.
2612 Necessary in order to support "arguments" and "arguments.callee".
2614 Also fixes a latent GC bug, where an executing function could be
2615 subject to GC if the register holding it were overwritten. Here's
2616 an example that would have caused problems:
2620 // Flood the machine stack to eliminate any old pointers to f.
2623 // Overwrite f in the register file.
2627 for (var i = 0; i < 5000; ++i) {
2631 // Welcome to crash-ville.
2640 * VM/Machine.h: Changed the order of arguments to
2641 execute(FunctionBodyNode*...) to match the other execute functions.
2642 * kjs/function.cpp: Updated to match new argument requirements from
2643 execute(FunctionBodyNode*...). Renamed newObj to thisObj to match the
2644 rest of JavaScriptCore.
2646 SunSpider reports no change.
2648 2008-04-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2652 Bug 18707: SQUIRRELFISH: eval always performs toString() on its argument
2653 <https://bugs.webkit.org/show_bug.cgi?id=18707>
2655 This fixes 4 more regression tests.
2660 2008-04-23 Maciej Stachowiak <mjs@apple.com>
2664 - fix logic bug in SegmentedVector::grow which would sometimes fail to resize a segment when needed
2668 * VM/SegmentedVector.h:
2669 (KJS::SegmentedVector::grow):
2671 2008-04-23 Geoffrey Garen <ggaren@apple.com>
2673 Reviewed by Maciej Stachowiak.
2675 Degenerate handling of "arguments" as a property of the activation
2676 object. Currently, we just return a vanilla object.
2678 SunSpider reports no change.
2682 ecma_3/Function/regress-94506.js.
2684 Reveals to have been secretly broken:
2686 ecma_3/Function/15.3.4.3-1.js
2687 ecma_3/Function/15.3.4.4-1.js
2689 These tests were passing incorrectly. testkjs creates a global array
2690 named "arguments" to hold command-line arguments. That array was
2691 tricking these tests into thinking that an arguments object with length
2692 0 had been created. Since our new vanilla object shadows the global
2693 property named arguments, that object no longer fools these tests into
2696 Net change: +1 failing test.
2698 * kjs/AllInOneFile.cpp: Had to put JSActivation.cpp into AllInOneFile.cpp
2699 to solve a surprising 8.6% regression in bitops-3bit-bits-in-byte.
2701 2008-04-23 Maciej Stachowiak <mjs@apple.com>
2705 - save and restore callFrame
2708 (KJS::slideRegisterWindowForCall):
2709 (KJS::Machine::execute):
2710 (KJS::Machine::privateExecute):
2714 2008-04-23 Geoffrey Garen <ggaren@apple.com>
2716 Reviewed by Maciej Stachowiak.
2718 Fixed scopes for named function expressions.
2720 Fixes one regression test.
2724 (1) The function's name is supposed to have attributes DontDelete,
2725 ReadOnly, regardless of the type of code executing.
2727 (2) Push the name object on the function's scope chain, rather than
2728 the ExecState's scope chain because, well, that's where it belongs.
2730 2008-04-23 Geoffrey Garen <ggaren@apple.com>
2732 Reviewed by Oliver Hunt.
2734 Inlined JSObject::putDirect, for a .4% SunSpider speedup.
2736 I did this as a first step toward removing nodes.cpp from
2737 AllInOneFile.cpp, but I'm putting that larger project aside for now.
2739 2008-04-23 Maciej Stachowiak <mjs@apple.com>
2741 Rubber stamped by Geoff.
2743 - add OldInterpreterExecState class and use it in dead code
2745 This will allow removing things from the real ExecState class
2746 without having to figure out how to remove all this code without
2747 getting a perf regression.
2750 (KJS::ExpressionNode::evaluateToNumber):
2751 (KJS::ExpressionNode::evaluateToBoolean):
2752 (KJS::ExpressionNode::evaluateToInt32):
2753 (KJS::ExpressionNode::evaluateToUInt32):
2754 (KJS::Node::setErrorCompletion):
2755 (KJS::Node::throwError):
2756 (KJS::Node::throwUndefinedVariableError):
2757 (KJS::Node::handleException):
2758 (KJS::Node::rethrowException):
2759 (KJS::BreakpointCheckStatement::execute):
2760 (KJS::BreakpointCheckStatement::optimizeVariableAccess):
2761 (KJS::NullNode::evaluate):
2762 (KJS::FalseNode::evaluate):
2763 (KJS::TrueNode::evaluate):
2764 (KJS::NumberNode::evaluate):
2765 (KJS::NumberNode::evaluateToNumber):
2766 (KJS::NumberNode::evaluateToBoolean):
2767 (KJS::NumberNode::evaluateToInt32):
2768 (KJS::NumberNode::evaluateToUInt32):
2769 (KJS::ImmediateNumberNode::evaluate):
2770 (KJS::ImmediateNumberNode::evaluateToInt32):
2771 (KJS::ImmediateNumberNode::evaluateToUInt32):
2772 (KJS::StringNode::evaluate):
2773 (KJS::StringNode::evaluateToNumber):
2774 (KJS::StringNode::evaluateToBoolean):
2775 (KJS::RegExpNode::evaluate):
2776 (KJS::ThisNode::evaluate):
2777 (KJS::ResolveNode::inlineEvaluate):
2778 (KJS::ResolveNode::evaluate):
2779 (KJS::ResolveNode::evaluateToNumber):
2780 (KJS::ResolveNode::evaluateToBoolean):
2781 (KJS::ResolveNode::evaluateToInt32):
2782 (KJS::ResolveNode::evaluateToUInt32):
2783 (KJS::getSymbolTableEntry):
2784 (KJS::ResolveNode::optimizeVariableAccess):
2785 (KJS::LocalVarAccessNode::inlineEvaluate):
2786 (KJS::LocalVarAccessNode::evaluate):
2787 (KJS::LocalVarAccessNode::evaluateToNumber):
2788 (KJS::LocalVarAccessNode::evaluateToBoolean):
2789 (KJS::LocalVarAccessNode::evaluateToInt32):
2790 (KJS::LocalVarAccessNode::evaluateToUInt32):
2791 (KJS::getNonLocalSymbol):
2792 (KJS::ScopedVarAccessNode::inlineEvaluate):
2793 (KJS::ScopedVarAccessNode::evaluate):
2794 (KJS::ScopedVarAccessNode::evaluateToNumber):
2795 (KJS::ScopedVarAccessNode::evaluateToBoolean):
2796 (KJS::ScopedVarAccessNode::evaluateToInt32):
2797 (KJS::ScopedVarAccessNode::evaluateToUInt32):
2798 (KJS::NonLocalVarAccessNode::inlineEvaluate):
2799 (KJS::NonLocalVarAccessNode::evaluate):
2800 (KJS::NonLocalVarAccessNode::evaluateToNumber):
2801 (KJS::NonLocalVarAccessNode::evaluateToBoolean):
2802 (KJS::NonLocalVarAccessNode::evaluateToInt32):
2803 (KJS::NonLocalVarAccessNode::evaluateToUInt32):
2804 (KJS::ElementNode::optimizeVariableAccess):
2805 (KJS::ElementNode::evaluate):
2806 (KJS::ArrayNode::optimizeVariableAccess):
2807 (KJS::ArrayNode::evaluate):
2808 (KJS::ObjectLiteralNode::optimizeVariableAccess):
2809 (KJS::ObjectLiteralNode::evaluate):
2810 (KJS::PropertyListNode::optimizeVariableAccess):
2811 (KJS::PropertyListNode::evaluate):
2812 (KJS::PropertyNode::optimizeVariableAccess):
2813 (KJS::PropertyNode::evaluate):
2814 (KJS::BracketAccessorNode::optimizeVariableAccess):
2815 (KJS::BracketAccessorNode::inlineEvaluate):
2816 (KJS::BracketAccessorNode::evaluate):
2817 (KJS::BracketAccessorNode::evaluateToNumber):
2818 (KJS::BracketAccessorNode::evaluateToBoolean):
2819 (KJS::BracketAccessorNode::evaluateToInt32):
2820 (KJS::BracketAccessorNode::evaluateToUInt32):
2821 (KJS::DotAccessorNode::optimizeVariableAccess):
2822 (KJS::DotAccessorNode::inlineEvaluate):
2823 (KJS::DotAccessorNode::evaluate):
2824 (KJS::DotAccessorNode::evaluateToNumber):
2825 (KJS::DotAccessorNode::evaluateToBoolean):
2826 (KJS::DotAccessorNode::evaluateToInt32):
2827 (KJS::DotAccessorNode::evaluateToUInt32):
2828 (KJS::ArgumentListNode::optimizeVariableAccess):
2829 (KJS::ArgumentListNode::evaluateList):
2830 (KJS::ArgumentsNode::optimizeVariableAccess):
2831 (KJS::NewExprNode::optimizeVariableAccess):
2832 (KJS::NewExprNode::inlineEvaluate):
2833 (KJS::NewExprNode::evaluate):
2834 (KJS::NewExprNode::evaluateToNumber):
2835 (KJS::NewExprNode::evaluateToBoolean):
2836 (KJS::NewExprNode::evaluateToInt32):
2837 (KJS::NewExprNode::evaluateToUInt32):
2838 (KJS::ExpressionNode::resolveAndCall):
2839 (KJS::EvalFunctionCallNode::optimizeVariableAccess):
2840 (KJS::EvalFunctionCallNode::evaluate):
2841 (KJS::FunctionCallValueNode::optimizeVariableAccess):
2842 (KJS::FunctionCallValueNode::evaluate):
2843 (KJS::FunctionCallResolveNode::optimizeVariableAccess):
2844 (KJS::FunctionCallResolveNode::inlineEvaluate):
2845 (KJS::FunctionCallResolveNode::evaluate):
2846 (KJS::FunctionCallResolveNode::evaluateToNumber):
2847 (KJS::FunctionCallResolveNode::evaluateToBoolean):
2848 (KJS::FunctionCallResolveNode::evaluateToInt32):
2849 (KJS::FunctionCallResolveNode::evaluateToUInt32):
2850 (KJS::LocalVarFunctionCallNode::inlineEvaluate):
2851 (KJS::LocalVarFunctionCallNode::evaluate):
2852 (KJS::LocalVarFunctionCallNode::evaluateToNumber):
2853 (KJS::LocalVarFunctionCallNode::evaluateToBoolean):
2854 (KJS::LocalVarFunctionCallNode::evaluateToInt32):
2855 (KJS::LocalVarFunctionCallNode::evaluateToUInt32):
2856 (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
2857 (KJS::ScopedVarFunctionCallNode::evaluate):
2858 (KJS::ScopedVarFunctionCallNode::evaluateToNumber):
2859 (KJS::ScopedVarFunctionCallNode::evaluateToBoolean):
2860 (KJS::ScopedVarFunctionCallNode::evaluateToInt32):
2861 (KJS::ScopedVarFunctionCallNode::evaluateToUInt32):
2862 (KJS::NonLocalVarFunctionCallNode::inlineEvaluate):
2863 (KJS::NonLocalVarFunctionCallNode::evaluate):
2864 (KJS::NonLocalVarFunctionCallNode::evaluateToNumber):
2865 (KJS::NonLocalVarFunctionCallNode::evaluateToBoolean):
2866 (KJS::NonLocalVarFunctionCallNode::evaluateToInt32):
2867 (KJS::NonLocalVarFunctionCallNode::evaluateToUInt32):
2868 (KJS::FunctionCallBracketNode::optimizeVariableAccess):
2869 (KJS::FunctionCallBracketNode::evaluate):
2870 (KJS::FunctionCallDotNode::optimizeVariableAccess):
2871 (KJS::FunctionCallDotNode::inlineEvaluate):
2872 (KJS::FunctionCallDotNode::evaluate):
2873 (KJS::FunctionCallDotNode::evaluateToNumber):
2874 (KJS::FunctionCallDotNode::evaluateToBoolean):
2875 (KJS::FunctionCallDotNode::evaluateToInt32):
2876 (KJS::FunctionCallDotNode::evaluateToUInt32):
2877 (KJS::PostIncResolveNode::optimizeVariableAccess):
2878 (KJS::PostIncResolveNode::evaluate):
2879 (KJS::PostIncLocalVarNode::evaluate):
2880 (KJS::PostDecResolveNode::optimizeVariableAccess):
2881 (KJS::PostDecResolveNode::evaluate):
2882 (KJS::PostDecLocalVarNode::evaluate):
2883 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
2884 (KJS::PostDecLocalVarNode::evaluateToNumber):
2885 (KJS::PostDecLocalVarNode::evaluateToBoolean):
2886 (KJS::PostDecLocalVarNode::evaluateToInt32):
2887 (KJS::PostDecLocalVarNode::evaluateToUInt32):
2888 (KJS::PostfixBracketNode::optimizeVariableAccess):
2889 (KJS::PostIncBracketNode::evaluate):
2890 (KJS::PostDecBracketNode::evaluate):
2891 (KJS::PostfixDotNode::optimizeVariableAccess):
2892 (KJS::PostIncDotNode::evaluate):
2893 (KJS::PostDecDotNode::evaluate):
2894 (KJS::PostfixErrorNode::evaluate):
2895 (KJS::DeleteResolveNode::optimizeVariableAccess):
2896 (KJS::DeleteResolveNode::evaluate):
2897 (KJS::LocalVarDeleteNode::evaluate):
2898 (KJS::DeleteBracketNode::optimizeVariableAccess):
2899 (KJS::DeleteBracketNode::evaluate):
2900 (KJS::DeleteDotNode::optimizeVariableAccess):
2901 (KJS::DeleteDotNode::evaluate):
2902 (KJS::DeleteValueNode::optimizeVariableAccess):
2903 (KJS::DeleteValueNode::evaluate):
2904 (KJS::VoidNode::optimizeVariableAccess):
2905 (KJS::VoidNode::evaluate):
2906 (KJS::TypeOfValueNode::optimizeVariableAccess):
2907 (KJS::TypeOfResolveNode::optimizeVariableAccess):
2908 (KJS::LocalVarTypeOfNode::evaluate):
2909 (KJS::TypeOfResolveNode::evaluate):
2910 (KJS::TypeOfValueNode::evaluate):
2911 (KJS::PreIncResolveNode::optimizeVariableAccess):
2912 (KJS::PreIncLocalVarNode::evaluate):
2913 (KJS::PreIncResolveNode::evaluate):
2914 (KJS::PreDecResolveNode::optimizeVariableAccess):
2915 (KJS::PreDecLocalVarNode::evaluate):
2916 (KJS::PreDecResolveNode::evaluate):
2917 (KJS::PreIncConstNode::evaluate):
2918 (KJS::PreDecConstNode::evaluate):
2919 (KJS::PostIncConstNode::evaluate):
2920 (KJS::PostDecConstNode::evaluate):
2921 (KJS::PrefixBracketNode::optimizeVariableAccess):
2922 (KJS::PreIncBracketNode::evaluate):
2923 (KJS::PreDecBracketNode::evaluate):
2924 (KJS::PrefixDotNode::optimizeVariableAccess):
2925 (KJS::PreIncDotNode::evaluate):
2926 (KJS::PreDecDotNode::evaluate):
2927 (KJS::PrefixErrorNode::evaluate):
2928 (KJS::UnaryPlusNode::optimizeVariableAccess):
2929 (KJS::UnaryPlusNode::evaluate):
2930 (KJS::UnaryPlusNode::evaluateToBoolean):
2931 (KJS::UnaryPlusNode::evaluateToNumber):
2932 (KJS::UnaryPlusNode::evaluateToInt32):
2933 (KJS::UnaryPlusNode::evaluateToUInt32):
2934 (KJS::NegateNode::optimizeVariableAccess):
2935 (KJS::NegateNode::evaluate):
2936 (KJS::NegateNode::evaluateToNumber):
2937 (KJS::BitwiseNotNode::optimizeVariableAccess):
2938 (KJS::BitwiseNotNode::inlineEvaluateToInt32):
2939 (KJS::BitwiseNotNode::evaluate):
2940 (KJS::BitwiseNotNode::evaluateToNumber):
2941 (KJS::BitwiseNotNode::evaluateToBoolean):
2942 (KJS::BitwiseNotNode::evaluateToInt32):
2943 (KJS::BitwiseNotNode::evaluateToUInt32):
2944 (KJS::LogicalNotNode::optimizeVariableAccess):
2945 (KJS::LogicalNotNode::evaluate):
2946 (KJS::LogicalNotNode::evaluateToBoolean):
2947 (KJS::MultNode::optimizeVariableAccess):
2948 (KJS::MultNode::inlineEvaluateToNumber):
2949 (KJS::MultNode::evaluate):
2950 (KJS::MultNode::evaluateToNumber):
2951 (KJS::MultNode::evaluateToBoolean):
2952 (KJS::MultNode::evaluateToInt32):
2953 (KJS::MultNode::evaluateToUInt32):
2954 (KJS::DivNode::optimizeVariableAccess):
2955 (KJS::DivNode::inlineEvaluateToNumber):
2956 (KJS::DivNode::evaluate):
2957 (KJS::DivNode::evaluateToNumber):
2958 (KJS::DivNode::evaluateToInt32):
2959 (KJS::DivNode::evaluateToUInt32):
2960 (KJS::ModNode::optimizeVariableAccess):
2961 (KJS::ModNode::inlineEvaluateToNumber):
2962 (KJS::ModNode::evaluate):
2963 (KJS::ModNode::evaluateToNumber):
2964 (KJS::ModNode::evaluateToBoolean):
2965 (KJS::ModNode::evaluateToInt32):
2966 (KJS::ModNode::evaluateToUInt32):
2967 (KJS::throwOutOfMemoryErrorToNumber):
2969 (KJS::addSlowCaseToNumber):
2972 (KJS::AddNode::optimizeVariableAccess):
2973 (KJS::AddNode::evaluate):
2974 (KJS::AddNode::inlineEvaluateToNumber):
2975 (KJS::AddNode::evaluateToNumber):
2976 (KJS::AddNode::evaluateToInt32):
2977 (KJS::AddNode::evaluateToUInt32):
2978 (KJS::AddNumbersNode::inlineEvaluateToNumber):
2979 (KJS::AddNumbersNode::evaluate):
2980 (KJS::AddNumbersNode::evaluateToNumber):
2981 (KJS::AddNumbersNode::evaluateToInt32):
2982 (KJS::AddNumbersNode::evaluateToUInt32):
2983 (KJS::AddStringsNode::evaluate):
2984 (KJS::AddStringLeftNode::evaluate):
2985 (KJS::AddStringRightNode::evaluate):
2986 (KJS::SubNode::optimizeVariableAccess):
2987 (KJS::SubNode::inlineEvaluateToNumber):
2988 (KJS::SubNode::evaluate):
2989 (KJS::SubNode::evaluateToNumber):
2990 (KJS::SubNode::evaluateToInt32):
2991 (KJS::SubNode::evaluateToUInt32):
2992 (KJS::LeftShiftNode::optimizeVariableAccess):
2993 (KJS::LeftShiftNode::inlineEvaluateToInt32):
2994 (KJS::LeftShiftNode::evaluate):
2995 (KJS::LeftShiftNode::evaluateToNumber):
2996 (KJS::LeftShiftNode::evaluateToInt32):
2997 (KJS::LeftShiftNode::evaluateToUInt32):
2998 (KJS::RightShiftNode::optimizeVariableAccess):
2999 (KJS::RightShiftNode::inlineEvaluateToInt32):
3000 (KJS::RightShiftNode::evaluate):
3001 (KJS::RightShiftNode::evaluateToNumber):
3002 (KJS::RightShiftNode::evaluateToInt32):
3003 (KJS::RightShiftNode::evaluateToUInt32):
3004 (KJS::UnsignedRightShiftNode::optimizeVariableAccess):
3005 (KJS::UnsignedRightShiftNode::inlineEvaluateToUInt32):
3006 (KJS::UnsignedRightShiftNode::evaluate):
3007 (KJS::UnsignedRightShiftNode::evaluateToNumber):
3008 (KJS::UnsignedRightShiftNode::evaluateToInt32):
3009 (KJS::UnsignedRightShiftNode::evaluateToUInt32):
3012 (KJS::LessNode::optimizeVariableAccess):
3013 (KJS::LessNode::inlineEvaluateToBoolean):
3014 (KJS::LessNode::evaluate):
3015 (KJS::LessNode::evaluateToBoolean):
3016 (KJS::LessNumbersNode::inlineEvaluateToBoolean):
3017 (KJS::LessNumbersNode::evaluate):
3018 (KJS::LessNumbersNode::evaluateToBoolean):
3019 (KJS::LessStringsNode::inlineEvaluateToBoolean):
3020 (KJS::LessStringsNode::evaluate):
3021 (KJS::LessStringsNode::evaluateToBoolean):
3022 (KJS::GreaterNode::optimizeVariableAccess):
3023 (KJS::GreaterNode::inlineEvaluateToBoolean):
3024 (KJS::GreaterNode::evaluate):
3025 (KJS::GreaterNode::evaluateToBoolean):
3026 (KJS::LessEqNode::optimizeVariableAccess):
3027 (KJS::LessEqNode::inlineEvaluateToBoolean):
3028 (KJS::LessEqNode::evaluate):
3029 (KJS::LessEqNode::evaluateToBoolean):
3030 (KJS::GreaterEqNode::optimizeVariableAccess):
3031 (KJS::GreaterEqNode::inlineEvaluateToBoolean):
3032 (KJS::GreaterEqNode::evaluate):
3033 (KJS::GreaterEqNode::evaluateToBoolean):
3034 (KJS::InstanceOfNode::optimizeVariableAccess):
3035 (KJS::InstanceOfNode::evaluate):
3036 (KJS::InstanceOfNode::evaluateToBoolean):
3037 (KJS::InNode::optimizeVariableAccess):
3038 (KJS::InNode::evaluate):
3039 (KJS::InNode::evaluateToBoolean):
3040 (KJS::EqualNode::optimizeVariableAccess):
3041 (KJS::EqualNode::inlineEvaluateToBoolean):
3042 (KJS::EqualNode::evaluate):
3043 (KJS::EqualNode::evaluateToBoolean):
3044 (KJS::NotEqualNode::optimizeVariableAccess):
3045 (KJS::NotEqualNode::inlineEvaluateToBoolean):
3046 (KJS::NotEqualNode::evaluate):
3047 (KJS::NotEqualNode::evaluateToBoolean):
3048 (KJS::StrictEqualNode::optimizeVariableAccess):
3049 (KJS::StrictEqualNode::inlineEvaluateToBoolean):
3050 (KJS::StrictEqualNode::evaluate):
3051 (KJS::StrictEqualNode::evaluateToBoolean):
3052 (KJS::NotStrictEqualNode::optimizeVariableAccess):
3053 (KJS::NotStrictEqualNode::inlineEvaluateToBoolean):
3054 (KJS::NotStrictEqualNode::evaluate):
3055 (KJS::NotStrictEqualNode::evaluateToBoolean):
3056 (KJS::BitAndNode::optimizeVariableAccess):
3057 (KJS::BitAndNode::evaluate):
3058 (KJS::BitAndNode::inlineEvaluateToInt32):
3059 (KJS::BitAndNode::evaluateToNumber):
3060 (KJS::BitAndNode::evaluateToBoolean):
3061 (KJS::BitAndNode::evaluateToInt32):
3062 (KJS::BitAndNode::evaluateToUInt32):
3063 (KJS::BitXOrNode::optimizeVariableAccess):
3064 (KJS::BitXOrNode::inlineEvaluateToInt32):
3065 (KJS::BitXOrNode::evaluate):
3066 (KJS::BitXOrNode::evaluateToNumber):
3067 (KJS::BitXOrNode::evaluateToBoolean):
3068 (KJS::BitXOrNode::evaluateToInt32):
3069 (KJS::BitXOrNode::evaluateToUInt32):
3070 (KJS::BitOrNode::optimizeVariableAccess):
3071 (KJS::BitOrNode::inlineEvaluateToInt32):
3072 (KJS::BitOrNode::evaluate):
3073 (KJS::BitOrNode::evaluateToNumber):
3074 (KJS::BitOrNode::evaluateToBoolean):
3075 (KJS::BitOrNode::evaluateToInt32):
3076 (KJS::BitOrNode::evaluateToUInt32):
3077 (KJS::LogicalAndNode::optimizeVariableAccess):
3078 (KJS::LogicalAndNode::evaluate):
3079 (KJS::LogicalAndNode::evaluateToBoolean):
3080 (KJS::LogicalOrNode::optimizeVariableAccess):
3081 (KJS::LogicalOrNode::evaluate):
3082 (KJS::LogicalOrNode::evaluateToBoolean):
3083 (KJS::ConditionalNode::optimizeVariableAccess):
3084 (KJS::ConditionalNode::evaluate):
3085 (KJS::ConditionalNode::evaluateToBoolean):
3086 (KJS::ConditionalNode::evaluateToNumber):
3087 (KJS::ConditionalNode::evaluateToInt32):
3088 (KJS::ConditionalNode::evaluateToUInt32):
3089 (KJS::valueForReadModifyAssignment):
3090 (KJS::ReadModifyResolveNode::optimizeVariableAccess):
3091 (KJS::AssignResolveNode::optimizeVariableAccess):
3092 (KJS::ReadModifyLocalVarNode::evaluate):
3093 (KJS::AssignLocalVarNode::evaluate):
3094 (KJS::ReadModifyConstNode::evaluate):
3095 (KJS::AssignConstNode::evaluate):
3096 (KJS::ReadModifyResolveNode::evaluate):
3097 (KJS::AssignResolveNode::evaluate):
3098 (KJS::AssignDotNode::optimizeVariableAccess):
3099 (KJS::AssignDotNode::evaluate):
3100 (KJS::ReadModifyDotNode::optimizeVariableAccess):
3101 (KJS::ReadModifyDotNode::evaluate):
3102 (KJS::AssignErrorNode::evaluate):
3103 (KJS::AssignBracketNode::optimizeVariableAccess):
3104 (KJS::AssignBracketNode::evaluate):
3105 (KJS::ReadModifyBracketNode::optimizeVariableAccess):
3106 (KJS::ReadModifyBracketNode::evaluate):
3107 (KJS::CommaNode::optimizeVariableAccess):
3108 (KJS::CommaNode::evaluate):
3109 (KJS::ConstDeclNode::optimizeVariableAccess):
3110 (KJS::ConstDeclNode::handleSlowCase):
3111 (KJS::ConstDeclNode::evaluateSingle):
3112 (KJS::ConstDeclNode::evaluate):
3113 (KJS::ConstStatementNode::optimizeVariableAccess):
3114 (KJS::ConstStatementNode::execute):
3115 (KJS::statementListExecute):
3116 (KJS::BlockNode::optimizeVariableAccess):
3117 (KJS::BlockNode::execute):
3118 (KJS::EmptyStatementNode::execute):
3119 (KJS::ExprStatementNode::optimizeVariableAccess):
3120 (KJS::ExprStatementNode::execute):
3121 (KJS::VarStatementNode::optimizeVariableAccess):
3122 (KJS::VarStatementNode::execute):
3123 (KJS::IfNode::optimizeVariableAccess):
3124 (KJS::IfNode::execute):
3125 (KJS::IfElseNode::optimizeVariableAccess):
3126 (KJS::IfElseNode::execute):
3127 (KJS::DoWhileNode::optimizeVariableAccess):
3128 (KJS::DoWhileNode::execute):
3129 (KJS::WhileNode::optimizeVariableAccess):
3130 (KJS::WhileNode::execute):
3131 (KJS::ForNode::optimizeVariableAccess):
3132 (KJS::ForNode::execute):
3133 (KJS::ForInNode::optimizeVariableAccess):
3134 (KJS::ForInNode::execute):
3135 (KJS::ContinueNode::execute):
3136 (KJS::BreakNode::execute):
3137 (KJS::ReturnNode::optimizeVariableAccess):
3138 (KJS::ReturnNode::execute):
3139 (KJS::WithNode::optimizeVariableAccess):
3140 (KJS::WithNode::execute):
3141 (KJS::CaseClauseNode::optimizeVariableAccess):
3142 (KJS::CaseClauseNode::evaluate):
3143 (KJS::CaseClauseNode::executeStatements):
3144 (KJS::ClauseListNode::optimizeVariableAccess):
3145 (KJS::CaseBlockNode::optimizeVariableAccess):
3146 (KJS::CaseBlockNode::executeBlock):
3147 (KJS::SwitchNode::optimizeVariableAccess):
3148 (KJS::SwitchNode::execute):
3149 (KJS::LabelNode::optimizeVariableAccess):
3150 (KJS::LabelNode::execute):
3151 (KJS::ThrowNode::optimizeVariableAccess):
3152 (KJS::ThrowNode::execute):
3153 (KJS::TryNode::optimizeVariableAccess):
3154 (KJS::TryNode::execute):
3155 (KJS::ProgramNode::initializeSymbolTable):
3156 (KJS::ScopeNode::optimizeVariableAccess):
3157 (KJS::ProgramNode::processDeclarations):
3158 (KJS::EvalNode::processDeclarations):
3159 (KJS::ProgramNode::execute):
3160 (KJS::EvalNode::execute):
3161 (KJS::FunctionBodyNodeWithDebuggerHooks::execute):
3162 (KJS::FuncDeclNode::execute):
3163 (KJS::FuncExprNode::evaluate):
3168 (KJS::ArgumentsNode::):
3170 2008-04-23 Oliver Hunt <oliver@apple.com>
3174 Bug 18672: SQUIRRELFISH: codegen fails with a large number of temporaries
3175 <https://bugs.webkit.org/show_bug.cgi?id=18672>
3177 Add a SegmentedVector type, which provides a Vector<T> which maintains
3178 existing memory locations during resize. This allows dynamically sizing
3179 local, temporary and label "vectors" in CodeGenerator.
3181 * JavaScriptCore.xcodeproj/project.pbxproj:
3182 * VM/CodeGenerator.cpp:
3183 (KJS::CodeGenerator::addVar):
3184 (KJS::CodeGenerator::CodeGenerator):
3185 (KJS::CodeGenerator::newTemporary):
3186 (KJS::CodeGenerator::newLabel):
3187 * VM/CodeGenerator.h:
3188 * VM/SegmentedVector.h: Added.
3189 (KJS::SegmentedVector::SegmentedVector):
3190 (KJS::SegmentedVector::~SegmentedVector):
3191 (KJS::SegmentedVector::last):
3192 (KJS::SegmentedVector::append):
3193 (KJS::SegmentedVector::removeLast):
3194 (KJS::SegmentedVector::size):
3195 (KJS::SegmentedVector::operator[]):
3196 (KJS::SegmentedVector::resize):
3197 (KJS::SegmentedVector::shrink):
3198 (KJS::SegmentedVector::grow):
3200 2008-04-23 Geoffrey Garen <ggaren@apple.com>
3202 Reviewed by Maciej Stachowiak.
3204 A little refactoring in preparation for supporting 'arguments'.
3206 Fixes 2 regression tests.
3208 SunSpider reports no change.
3210 We now check the activation register, instead of the codeBlock, to
3211 determine whether we need to tear off the activation. This is to support
3212 "f.arguments", which will create an activation/arguments pair for f,
3213 even though the needsFullScopeChain flag is false for f's codeBlock.
3215 The test fixes resulted from calling initializeCallFrame for re-entrant
3216 function code, instead of initializing (not enough) parts of the call
3219 2008-04-22 Maciej Stachowiak <mjs@apple.com>
3223 - propagate the "this" value properly to local eval
3225 (fixes a measly one regression test)
3228 (KJS::CodeBlock::CodeBlock):
3229 (KJS::ProgramCodeBlock::ProgramCodeBlock):
3230 (KJS::EvalCodeBlock::EvalCodeBlock):
3232 (KJS::Machine::privateExecute):
3234 2008-04-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3238 Add support for function declarations in eval code.
3240 (this fixes 12 more regression tests)
3243 * VM/CodeGenerator.cpp:
3244 (KJS::CodeGenerator::CodeGenerator):
3245 * VM/CodeGenerator.h:
3247 (KJS::Machine::execute):
3249 (KJS::EvalNode::generateCode):
3251 2008-04-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3255 Implement LabelNode.
3257 * VM/CodeGenerator.cpp:
3258 (KJS::CodeGenerator::pushJumpContext):
3259 (KJS::CodeGenerator::jumpContextForContinue):
3260 (KJS::CodeGenerator::jumpContextForBreak):
3261 * VM/CodeGenerator.h:
3263 (KJS::DoWhileNode::emitCode):
3264 (KJS::WhileNode::emitCode):
3265 (KJS::ForNode::emitCode):
3266 (KJS::ForInNode::emitCode):
3267 (KJS::ContinueNode::emitCode):
3268 (KJS::BreakNode::emitCode):
3269 (KJS::SwitchNode::emitCode):
3270 (KJS::LabelNode::emitCode):
3272 2008-04-22 Geoffrey Garen <ggaren@apple.com>
3274 Reviewed by Oliver Hunt.
3276 Fixed crash when unwinding from exceptions inside eval.
3279 (KJS::Machine::unwindCallFrame): Don't assume that the top of the
3280 current call frame's scope chain is an activation: it can be the global
3283 2008-04-22 Maciej Stachowiak <mjs@apple.com>
3288 (main): Convert signals to exit codes, so that crashing tests are
3289 detected as regression test failures.
3291 2008-04-22 Geoffrey Garen <ggaren@apple.com>
3293 Reviewed by Oliver Hunt and Maciej Stachowiak.
3295 Renamed "needsActivation" to "needsFullScopeChain" because lying will
3296 make hair grow on the backs of your hands.
3298 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3300 Reviewed by Maciej Stachowiak.
3302 Fixed ScopeChainNode lifetime problems:
3304 (1) In "with" and "catch" scopes, we would construct a ScopeChain
3305 object and then jump across its destructor, leaking the ScopeChainNode
3308 (2) In global and eval scopes, we would fail to initially ref
3309 "scopeChain", causing us to overrelease it later. Now that we ref
3310 "scopeChain" properly, we also need to deref it when the script
3313 SunSpider reports a .2% regression, but an earlier round of ScopeChain
3314 refactoring was a .4% speedup, so there.
3316 2008-04-22 Maciej Stachowiak <mjs@apple.com>
3320 - use global object instead of null for "this" on unqualified calls
3322 This fixes 10 more JSC test regressions.
3325 (KJS::Machine::privateExecute):
3327 2008-04-22 Maciej Stachowiak <mjs@apple.com>
3331 - throw proper exceptions for objects that don't implement call or construct
3333 This fixes 21 more JSC test regressions. It is also seemingly an
3336 * VM/ExceptionHelpers.cpp:
3337 (KJS::createNotAnObjectError):
3338 (KJS::createNotAConstructorError):
3339 (KJS::createNotAFunctionError):
3340 * VM/ExceptionHelpers.h:
3342 (KJS::Machine::privateExecute):
3344 2008-04-21 Oliver Hunt <oliver@apple.com>
3348 Implement emitCode for ConstDeclNode.
3350 This fixes the crash (assertion) in js1_5/Scope/scope-001.js
3352 * VM/CodeGenerator.cpp:
3353 (KJS::CodeGenerator::registerForLocalConstInit):
3354 * VM/CodeGenerator.h:
3356 (KJS::AssignResolveNode::emitCode):
3357 (KJS::ConstDeclNode::emitCodeSingle):
3358 (KJS::ConstDeclNode::emitCode):
3359 (KJS::ConstStatementNode::emitCode):
3362 2008-04-21 Maciej Stachowiak <mjs@apple.com>
3366 - add some support for the split window object
3368 This fixes many layout tests.
3371 (KJS::resolveBaseAndFunc): Use toThisObject() to ensure we get the
3372 wrapper global, if one exists, as the "this" object.
3374 (KJS::globalFuncEval): Use toGlobalObject() to handle the wrapper
3377 2008-04-21 Maciej Stachowiak <mjs@apple.com>
3381 - restore ScopeChain::operator= to avoid crash on many layout tests
3383 Otherwise, FunctionImp::setScope would cause a reference
3384 underflow. I implemented using the copy construct and swap idiom.
3386 * kjs/scope_chain.h:
3387 (KJS::ScopeChain::swap):
3388 (KJS::ScopeChain::operator=):
3390 2008-04-21 Oliver Hunt <oliver@apple.com>
3394 Bug 18649: SQUIRRELFISH: correctly handle exceptions in eval code
3395 <https://bugs.webkit.org/show_bug.cgi?id=18649>
3397 Allocate a callframe for eval() and initialise with a null codeBlock to
3398 indicate native code. This prevents the unwinder from clobbering the
3402 (KJS::Machine::execute):
3404 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3406 Reviewed by Sam Weinig.
3408 Removed ScopeChain::push(ScopeChain&) because it was unused. Moved
3409 ScopeChain::print to ScopeChainNode.
3411 ScopeChain is now nothing more than a resource-handling wrapper around
3414 2008-04-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3418 Bug 18671: SquirrelFish: continue inside switch fails
3419 <https://bugs.webkit.org/show_bug.cgi?id=18671>
3421 * VM/CodeGenerator.cpp:
3422 (KJS::CodeGenerator::jumpContextForLabel):
3423 * VM/CodeGenerator.h:
3425 (KJS::ContinueNode::emitCode):
3427 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3429 Reviewed by Sam Weinig.
3431 Moved push(JSObject*) and pop() from ScopeChain to ScopeChainNode,
3432 rearranging scope_chain.h a bit.
3434 SunSpider reports no change.
3436 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3438 Reviewed by Sam Weinig.
3440 Moved bottom() from ScopeChain to ScopeChainNode, simplifying it based
3441 on the knowledge that the ScopeChain is never empty.
3443 SunSpider reports no change.
3445 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3447 Reviewed by Oliver Hunt.
3449 Moved begin() and end() from ScopeChain to ScopeChainNode.
3451 Also marked a few methods "const".
3453 SunSpider reports no change.
3455 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3457 Reviewed by Maciej Stachowiak.
3459 Turned ScopeChain::depth into a stand-alone function, and simplified it
3462 I also moved ScopeChain::depth to Machine.cpp because it doesn't report
3463 the true depth of the ScopeChain -- just the Machine's perspective of
3464 its depth within a given call frame.
3466 SunSpider reports no change.
3468 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3470 Reviewed by Maciej Stachowiak.
3472 Removed indirection in ScopeChain::ref / ScopeChain::deref.
3474 SunSpider reports no change.
3476 * kjs/scope_chain.h:
3477 (KJS::ScopeChain::ScopeChain):
3478 (KJS::ScopeChain::~ScopeChain):
3479 (KJS::ScopeChain::clear):
3481 2008-04-21 Oliver Hunt <oliver@apple.com>
3483 Reviewed by NOBODY(Build fix)
3488 (KJS::ConstDeclNode::evaluateSingle):
3490 2008-04-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3494 Bug 18664: SQUIRRELFISH: correctly throw a SyntaxError when parsing of eval code fails
3495 <https://bugs.webkit.org/show_bug.cgi?id=18664>
3497 Correctly throw a SyntaxError when parsing of eval code fails.
3502 2008-04-21 Oliver Hunt <oliver@apple.com>
3506 Partial fix for Bug 18649: SQUIRRELFISH: correctly handle exceptions in eval code
3508 Make sure we correct the register state before jumping to vm_throw.
3511 (KJS::Machine::privateExecute):
3513 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3515 Reviewed by Maciej Stachowiak.
3517 Simplified ScopeChain ref/deref.
3519 SunSpider reports a .4% speedup.
3521 * kjs/scope_chain.h:
3522 (KJS::ScopeChainNode::ref): Removed this function because it was nonsense.
3523 ScopeChainNodes are initialized with a refCount of 1, so the loop was
3524 guaranteed to iterate exactly once.
3526 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3528 Reviewed by Maciej Stachowiak.
3530 Removed support for empty ScopeChains.
3532 SunSpider reports no change.
3534 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3536 Reviewed by Maciej Stachowiak.
3538 Removed some completely unused ScopeChain member functions.
3540 SunSpider reports no change.
3542 2008-04-21 Geoffrey Garen <ggaren@apple.com>
3544 Reviewed by Maciej Stachowiak.
3546 Avoid creating unnecessary ScopeChain objects, to reduce refcount churn.
3548 SunSpider reports no change.
3550 2008-04-21 Maciej Stachowiak <mjs@apple.com>
3552 Rubber stamped by Alexey.
3559 2008-04-21 Maciej Stachowiak <mjs@apple.com>