1 2008-09-24 Sam Weinig <sam@webkit.org>
3 Reviewed by Darin Adler.
5 Fix for https://bugs.webkit.org/show_bug.cgi?id=21080
6 <rdar://problem/6243534>
7 Crash below Function.apply when using a runtime array as the argument list
9 Test: plugins/bindings-array-apply-crash.html
11 * kjs/FunctionPrototype.cpp:
12 (JSC::functionProtoFuncApply): Revert to the slow case if the object inherits from
13 JSArray (via ClassInfo) but is not a JSArray.
15 2008-09-24 Kevin McCullough <kmccullough@apple.com>
20 (JSC::statementListEmitCode):
22 2008-09-24 Kevin McCullough <kmccullough@apple.com>
26 Bug 21031: Breakpoints in the condition of loops only breaks the first
28 - Now when setting breakpoints in the condition of a loop (for, while,
29 for in, and do while) will successfully break each time throught the
31 - For 'for' loops we need a little more complicated behavior that cannot
32 be accomplished without some more significant changes:
33 https://bugs.webkit.org/show_bug.cgi?id=21073
36 (JSC::statementListEmitCode): We don't want to blindly emit a debug hook
37 at the first line of loops, instead let the loop emit the debug hooks.
38 (JSC::DoWhileNode::emitCode):
39 (JSC::WhileNode::emitCode):
40 (JSC::ForNode::emitCode):
41 (JSC::ForInNode::emitCode):
43 (JSC::StatementNode::):
48 2008-09-24 Geoffrey Garen <ggaren@apple.com>
50 Reviewed by Darin Adler.
52 Fixed <rdar://problem/5605532> Need a SPI for telling JS the size of
53 the objects it retains
55 * API/tests/testapi.c: Test the new SPI a little.
57 * API/JSSPI.cpp: Add the new SPI.
58 * API/JSSPI.h: Add the new SPI.
59 * JavaScriptCore.exp: Add the new SPI.
60 * JavaScriptCore.xcodeproj/project.pbxproj: Add the new SPI.
62 2008-09-24 Geoffrey Garen <ggaren@apple.com>
64 Reviewed by Darin Adler.
66 * API/JSBase.h: Filled in some missing function names.
68 2008-09-24 Geoffrey Garen <ggaren@apple.com>
70 Reviewed by Cameron Zwarich.
72 Fixed https://bugs.webkit.org/show_bug.cgi?id=21057
73 Crash in RegisterID::deref() running fast/canvas/canvas-putImageData.html
75 * VM/CodeGenerator.h: Changed declaration order to ensure the
76 m_lastConstant, which is a RefPtr that points into m_calleeRegisters,
77 has its destructor called before the destructor for m_calleeRegisters.
79 2008-09-24 Darin Adler <darin@apple.com>
81 Reviewed by Sam Weinig.
83 - https://bugs.webkit.org/show_bug.cgi?id=21047
84 speed up ret_activation with inlining
86 About 1% on v8-raytrace.
88 * JavaScriptCore.exp: Removed JSVariableObject::setRegisters.
90 * kjs/JSActivation.cpp: Moved copyRegisters to the header to make it inline.
92 (JSC::JSActivation::copyRegisters): Moved here. Also removed the registerArraySize
93 argument to setRegisters, since the object doesn't need to store the number of
96 * kjs/JSGlobalObject.cpp:
97 (JSC::JSGlobalObject::reset): Removed unnecessary clearing left over from when we
98 used this on objects that weren't brand new. These days, this function is really
99 just part of the constructor.
101 * kjs/JSGlobalObject.h: Added registerArraySize to JSGlobalObjectData, since
102 JSVariableObjectData no longer needs it. Added a setRegisters override here
103 that handles storing the size.
105 * kjs/JSStaticScopeObject.h: Removed code to set registerArraySize, since it
108 * kjs/JSVariableObject.cpp: Moved copyRegisterArray and setRegisters to the
109 header to make them inline.
110 * kjs/JSVariableObject.h: Removed registerArraySize from JSVariableObjectData,
111 since it was only used for the global object.
112 (JSC::JSVariableObject::copyRegisterArray): Moved here ot make it inline.
113 (JSC::JSVariableObject::setRegisters): Moved here to make it inline. Also
114 removed the code to set registerArraySize and changed an if statement into
115 an assert to save an unnnecessary branch.
117 2008-09-24 Maciej Stachowiak <mjs@apple.com>
119 Reviewed by Oliver Hunt.
121 - inline PropertyMap::getOffset to speed up polymorphic lookups
123 ~1.5% speedup on v8 benchmark
124 no effect on SunSpider
126 * JavaScriptCore.exp:
127 * kjs/PropertyMap.cpp:
129 (JSC::PropertyMap::getOffset):
131 2008-09-24 Jan Michael Alonzo <jmalonzo@webkit.org>
133 Reviewed by Alp Toker.
135 https://bugs.webkit.org/show_bug.cgi?id=20992
136 Build fails on GTK+ Mac OS
138 * wtf/ThreadingGtk.cpp: Remove platform ifdef as suggested by
140 (WTF::initializeThreading):
142 2008-09-23 Oliver Hunt <oliver@apple.com>
144 Reviewed by Maciej Stachowiak.
146 Bug 19968: Slow Script at www.huffingtonpost.com
147 <https://bugs.webkit.org/show_bug.cgi?id=19968>
149 Finally found the cause of this accursed issue. It is triggered
150 by synchronous creation of a new global object from JS. The new
151 global object resets the timer state in this execution group's
152 Machine, taking timerCheckCount to 0. Then when JS returns the
153 timerCheckCount is decremented making it non-zero. The next time
154 we execute JS we will start the timeout counter, however the non-zero
155 timeoutCheckCount means we don't reset the timer information. This
156 means that the timeout check is now checking the cumulative time
157 since the creation of the global object rather than the time since
158 JS was last entered. At this point the slow script dialog is guaranteed
159 to eventually be displayed incorrectly unless a page is loaded
160 asynchronously (which will reset everything into a sane state).
162 The fix for this is rather trivial -- the JSGlobalObject constructor
163 should not be resetting the machine timer state.
166 (JSC::Machine::Machine):
167 Now that we can't rely on the GlobalObject initialising the timeout
168 state, we do it in the Machine constructor.
171 (JSC::Machine::stopTimeoutCheck):
172 Add assertions to guard against this happening.
174 * kjs/JSGlobalObject.cpp:
175 (JSC::JSGlobalObject::init):
176 Don't reset the timeout state.
178 2008-09-23 Geoffrey Garen <ggaren@apple.com>
180 Reviewed by Oliver Hunt.
182 Fixed https://bugs.webkit.org/show_bug.cgi?id=21038 | <rdar://problem/6240812>
183 Uncaught exceptions in regex replace callbacks crash webkit
185 This was a combination of two problems:
187 (1) the replace function would continue execution after an exception
190 (2) In some cases, the Machine would return 0 in the case of an exception,
191 despite the fact that a few clients dereference the Machine's return
192 value without first checking for an exception.
195 (JSC::Machine::execute):
197 ^ Return jsNull() instead of 0 in the case of an exception, since some
198 clients depend on using our return value.
200 ^ ASSERT that execution does not continue after an exception has been
201 thrown, to help catch problems like this in the future.
203 * kjs/StringPrototype.cpp:
204 (JSC::stringProtoFuncReplace):
206 ^ Stop execution if an exception has been thrown.
208 2008-09-23 Geoffrey Garen <ggaren@apple.com>
210 Try to fix the windows build.
213 (JSC::CTI::compileOpCall):
214 (JSC::CTI::privateCompileMainPass):
216 2008-09-23 Alp Toker <alp@nuanti.com>
222 2008-09-23 Geoffrey Garen <ggaren@apple.com>
224 Reviewed by Darin Adler.
226 * wtf/Platform.h: Removed duplicate #if.
228 2008-09-23 Geoffrey Garen <ggaren@apple.com>
230 Reviewed by Darin Adler.
232 Changed the layout of the call frame from
234 { header, parameters, locals | constants, temporaries }
238 { parameters, header | locals, constants, temporaries }
240 This simplifies function entry+exit, and enables a number of future
243 13.5% speedup on empty call benchmark for bytecode; 23.6% speedup on
244 empty call benchmark for CTI.
246 SunSpider says no change. SunSpider --v8 says 1% faster.
250 Added a bit of abstraction for calculating whether a register is a
251 constant, since this patch changes that calculation:
252 (JSC::CTI::isConstant):
253 (JSC::CTI::getConstant):
254 (JSC::CTI::emitGetArg):
255 (JSC::CTI::emitGetPutArg):
256 (JSC::CTI::getConstantImmediateNumericArg):
258 Updated for changes to callframe header location:
259 (JSC::CTI::emitPutToCallFrameHeader):
260 (JSC::CTI::emitGetFromCallFrameHeader):
261 (JSC::CTI::printOpcodeOperandTypes):
263 Renamed to spite Oliver:
264 (JSC::CTI::emitInitRegister):
266 Added an abstraction for emitting a call through a register, so that
267 calls through registers generate exception info, too:
268 (JSC::CTI::emitCall):
270 Updated to match the new callframe header layout, and to support calls
271 through registers, which have no destination address:
272 (JSC::CTI::compileOpCall):
273 (JSC::CTI::privateCompileMainPass):
274 (JSC::CTI::privateCompileSlowCases):
275 (JSC::CTI::privateCompile):
280 (JSC::CallRecord::CallRecord):
284 Updated for new register layout:
286 (JSC::CodeBlock::dump):
290 Updated CodeBlock to track slightly different information about the
291 register frame, and tweaked the style of an ASSERT_NOT_REACHED.
292 (JSC::CodeBlock::CodeBlock):
293 (JSC::CodeBlock::getStubInfo):
295 * VM/CodeGenerator.cpp:
297 Added some abstraction around constant register allocation, since this
298 patch changes it, changed codegen to account for the new callframe
299 layout, and added abstraction around register fetching code
300 that used to assume that all local registers lived at negative indices,
301 since vars now live at positive indices:
302 (JSC::CodeGenerator::generate):
303 (JSC::CodeGenerator::addVar):
304 (JSC::CodeGenerator::addGlobalVar):
305 (JSC::CodeGenerator::allocateConstants):
306 (JSC::CodeGenerator::CodeGenerator):
307 (JSC::CodeGenerator::addParameter):
308 (JSC::CodeGenerator::registerFor):
309 (JSC::CodeGenerator::constRegisterFor):
310 (JSC::CodeGenerator::newRegister):
311 (JSC::CodeGenerator::newTemporary):
312 (JSC::CodeGenerator::highestUsedRegister):
313 (JSC::CodeGenerator::addConstant):
315 ASSERT that our caller referenced the registers it passed to us.
316 Otherwise, we might overwrite them with parameters:
317 (JSC::CodeGenerator::emitCall):
318 (JSC::CodeGenerator::emitConstruct):
320 * VM/CodeGenerator.h:
322 Added some abstraction for getting a RegisterID for a given index,
323 since the rules are a little weird:
324 (JSC::CodeGenerator::registerFor):
328 Utility function to transform a machine return PC to a virtual machine
329 return VPC, for the sake of stack unwinding, since both PCs are stored
330 in the same location now:
333 Tweaked to account for new call frame:
334 (JSC::Machine::initializeCallFrame):
336 Tweaked to account for registerOffset supplied by caller:
337 (JSC::slideRegisterWindowForCall):
339 Tweaked to account for new register layout:
340 (JSC::scopeChainForCall):
341 (JSC::Machine::callEval):
342 (JSC::Machine::dumpRegisters):
343 (JSC::Machine::unwindCallFrame):
344 (JSC::Machine::execute):
346 Changed op_call and op_construct to implement the new calling convention:
347 (JSC::Machine::privateExecute):
349 Tweaked to account for the new register layout:
350 (JSC::Machine::retrieveArguments):
351 (JSC::Machine::retrieveCaller):
352 (JSC::Machine::retrieveLastCaller):
353 (JSC::Machine::callFrame):
354 (JSC::Machine::getArgumentsData):
356 Changed CTI call helpers to implement the new calling convention:
357 (JSC::Machine::cti_op_call_JSFunction):
358 (JSC::Machine::cti_op_call_NotJSFunction):
359 (JSC::Machine::cti_op_ret_activation):
360 (JSC::Machine::cti_op_ret_profiler):
361 (JSC::Machine::cti_op_construct_JSConstruct):
362 (JSC::Machine::cti_op_construct_NotJSConstruct):
363 (JSC::Machine::cti_op_call_eval):
369 Renamed op_initialise_locals to op_init, because this opcode
370 doesn't initialize all locals, and it doesn't initialize only locals.
371 Also, to spite Oliver.
375 New call frame enumeration values:
376 (JSC::RegisterFile::):
378 Simplified the calculation of whether a RegisterID is a temporary,
379 since we can no longer assume that all positive non-constant registers
382 (JSC::RegisterID::RegisterID):
383 (JSC::RegisterID::setTemporary):
384 (JSC::RegisterID::isTemporary):
386 Renamed firstArgumentIndex to firstParameterIndex because the assumption
387 that this variable pertained to the actual arguments supplied by the
388 caller caused me to write some buggy code:
390 (JSC::ArgumentsData::ArgumentsData):
391 (JSC::Arguments::Arguments):
392 (JSC::Arguments::fillArgList):
393 (JSC::Arguments::getOwnPropertySlot):
394 (JSC::Arguments::put):
396 Updated for new call frame layout:
397 * kjs/DebuggerCallFrame.cpp:
398 (JSC::DebuggerCallFrame::functionName):
399 (JSC::DebuggerCallFrame::type):
400 * kjs/DebuggerCallFrame.h:
402 Changed the activation object to account for the fact that a call frame
403 header now sits between parameters and local variables. This change
404 requires all variable objects to do their own marking, since they
405 now use their register storage differently:
406 * kjs/JSActivation.cpp:
407 (JSC::JSActivation::mark):
408 (JSC::JSActivation::copyRegisters):
409 (JSC::JSActivation::createArgumentsObject):
410 * kjs/JSActivation.h:
412 Updated global object to use the new interfaces required by the change
413 to JSActivation above:
414 * kjs/JSGlobalObject.cpp:
415 (JSC::JSGlobalObject::reset):
416 (JSC::JSGlobalObject::mark):
417 (JSC::JSGlobalObject::copyGlobalsFrom):
418 (JSC::JSGlobalObject::copyGlobalsTo):
419 * kjs/JSGlobalObject.h:
420 (JSC::JSGlobalObject::addStaticGlobals):
422 Updated static scope object to use the new interfaces required by the
423 change to JSActivation above:
424 * kjs/JSStaticScopeObject.cpp:
425 (JSC::JSStaticScopeObject::mark):
426 (JSC::JSStaticScopeObject::~JSStaticScopeObject):
427 * kjs/JSStaticScopeObject.h:
428 (JSC::JSStaticScopeObject::JSStaticScopeObject):
429 (JSC::JSStaticScopeObject::d):
431 Updated variable object to use the new interfaces required by the
432 change to JSActivation above:
433 * kjs/JSVariableObject.cpp:
434 (JSC::JSVariableObject::copyRegisterArray):
435 (JSC::JSVariableObject::setRegisters):
436 * kjs/JSVariableObject.h:
438 Changed the bit twiddling in symbol table not to assume that all indices
439 are negative, since they can be positive now:
441 (JSC::SymbolTableEntry::SymbolTableEntry):
442 (JSC::SymbolTableEntry::isNull):
443 (JSC::SymbolTableEntry::getIndex):
444 (JSC::SymbolTableEntry::getAttributes):
445 (JSC::SymbolTableEntry::setAttributes):
446 (JSC::SymbolTableEntry::isReadOnly):
447 (JSC::SymbolTableEntry::pack):
448 (JSC::SymbolTableEntry::isValidIndex):
450 Changed call and construct nodes to ref their functions and/or bases,
451 so that emitCall/emitConstruct doesn't overwrite them with parameters.
452 Also, updated for rename to registerFor:
454 (JSC::ResolveNode::emitCode):
455 (JSC::NewExprNode::emitCode):
456 (JSC::EvalFunctionCallNode::emitCode):
457 (JSC::FunctionCallValueNode::emitCode):
458 (JSC::FunctionCallResolveNode::emitCode):
459 (JSC::FunctionCallBracketNode::emitCode):
460 (JSC::FunctionCallDotNode::emitCode):
461 (JSC::PostfixResolveNode::emitCode):
462 (JSC::DeleteResolveNode::emitCode):
463 (JSC::TypeOfResolveNode::emitCode):
464 (JSC::PrefixResolveNode::emitCode):
465 (JSC::ReadModifyResolveNode::emitCode):
466 (JSC::AssignResolveNode::emitCode):
467 (JSC::ConstDeclNode::emitCodeSingle):
468 (JSC::ForInNode::emitCode):
470 Added abstraction for getting exception info out of a call through a
472 * masm/X86Assembler.h:
473 (JSC::X86Assembler::emitCall):
475 Removed duplicate #if:
478 2008-09-23 Kevin McCullough <kmccullough@apple.com>
482 Bug 21030: The JS debugger breaks on the do of a do-while not the while
483 (where the conditional statement is)
484 https://bugs.webkit.org/show_bug.cgi?id=21030
485 Now the statementListEmitCode detects if a do-while node is being
486 emited and emits the debug hook on the last line instead of the first.
488 This change had no effect on sunspider.
491 (JSC::statementListEmitCode):
493 (JSC::StatementNode::isDoWhile):
494 (JSC::DoWhileNode::isDoWhile):
496 2008-09-23 Maciej Stachowiak <mjs@apple.com>
498 Reviewed by Camron Zwarich.
500 - inline the fast case of instanceof
501 https://bugs.webkit.org/show_bug.cgi?id=20818
503 ~2% speedup on EarleyBoyer test.
506 (JSC::CTI::privateCompileMainPass):
507 (JSC::CTI::privateCompileSlowCases):
509 (JSC::Machine::cti_op_instanceof):
511 2008-09-23 Maciej Stachowiak <mjs@apple.com>
513 Reviewed by Cameron Zwarich.
515 - add forgotten slow case logic for !==
518 (JSC::CTI::privateCompileSlowCases):
520 2008-09-23 Maciej Stachowiak <mjs@apple.com>
522 Reviewed by Cameron Zwarich.
524 - inline the fast cases of !==, same as for ===
526 2.9% speedup on EarleyBoyer benchmark
529 (JSC::CTI::compileOpStrictEq): Factored stricteq codegen into this function,
530 and parameterized so it can do the reverse version as well.
531 (JSC::CTI::privateCompileMainPass): Use the above for stricteq and nstricteq.
533 (JSC::CTI::): Declare above stuff.
535 (JSC::Machine::cti_op_nstricteq): Removed fast cases, now handled inline.
537 2008-09-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
539 Reviewed by Oliver Hunt.
541 Bug 20989: Aguments constructor should put 'callee' and 'length' properties in a more efficient way
542 <https://bugs.webkit.org/show_bug.cgi?id=20989>
544 Make special cases for the 'callee' and 'length' properties in the
547 This is somewhere between a 7.8% speedup and a 10% speedup on the V8
548 Raytrace benchmark, depending on whether it is run alone or with the
552 (JSC::ArgumentsData::ArgumentsData):
553 (JSC::Arguments::Arguments):
554 (JSC::Arguments::mark):
555 (JSC::Arguments::getOwnPropertySlot):
556 (JSC::Arguments::put):
557 (JSC::Arguments::deleteProperty):
559 2008-09-23 Maciej Stachowiak <mjs@apple.com>
563 - speed up instanceof some more
564 https://bugs.webkit.org/show_bug.cgi?id=20818
566 ~2% speedup on EarleyBoyer
568 The idea here is to record in the StructureID whether the class
569 needs a special hasInstance or if it can use the normal logic from
572 Based on this I inlined the real work directly into
573 cti_op_instanceof and put the fastest checks up front and the
574 error handling at the end (so it should be fairly straightforward
575 to split off the beginning to be inlined if desired).
577 I only did this for CTI, not the bytecode interpreter.
579 * API/JSCallbackObject.h:
580 (JSC::JSCallbackObject::createStructureID):
583 (JSC::Machine::cti_op_instanceof):
585 (JSC::JSImmediate::isAnyImmediate):
587 (JSC::TypeInfo::overridesHasInstance):
588 (JSC::TypeInfo::flags):
590 2008-09-22 Darin Adler <darin@apple.com>
592 Reviewed by Sam Weinig.
594 - https://bugs.webkit.org/show_bug.cgi?id=21019
595 make FunctionBodyNode::ref/deref fast
597 Speeds up v8-raytrace by 7.2%.
600 (JSC::FunctionBodyNode::FunctionBodyNode): Initialize m_refCount to 0.
602 (JSC::FunctionBodyNode::ref): Call base class ref once, and thereafter use
604 (JSC::FunctionBodyNode::deref): Ditto, but the deref side.
606 2008-09-22 Darin Adler <darin@apple.com>
608 Pointed out by Sam Weinig.
611 (JSC::Arguments::fillArgList): Fix bad copy and paste. Oops!
613 2008-09-22 Darin Adler <darin@apple.com>
615 Reviewed by Cameron Zwarich.
617 - https://bugs.webkit.org/show_bug.cgi?id=20983
618 ArgumentsData should have some room to allocate some extra arguments inline
620 Speeds up v8-raytrace by 5%.
623 (JSC::ArgumentsData::ArgumentsData): Use a fixed buffer if there are 4 or fewer
625 (JSC::Arguments::Arguments): Use a fixed buffer if there are 4 or fewer
627 (JSC::Arguments::~Arguments): Delete the buffer if necessary.
628 (JSC::Arguments::mark): Update since extraArguments are now Register.
629 (JSC::Arguments::fillArgList): Added special case for the only case that's
630 actually used in the practice, when there are no parameters. There are some
631 other special cases in there too, but that's the only one that matters.
632 (JSC::Arguments::getOwnPropertySlot): Updated to use setValueSlot since there's
633 no operation to get you at the JSValue* inside a Register as a "slot".
635 2008-09-22 Sam Weinig <sam@webkit.org>
637 Reviewed by Maciej Stachowiak.
639 Patch for https://bugs.webkit.org/show_bug.cgi?id=21014
640 Speed up for..in by using StructureID to avoid calls to hasProperty
642 Speeds up fasta by 8%.
644 * VM/JSPropertyNameIterator.cpp:
645 (JSC::JSPropertyNameIterator::invalidate):
646 * VM/JSPropertyNameIterator.h:
647 (JSC::JSPropertyNameIterator::next):
648 * kjs/PropertyNameArray.h:
649 (JSC::PropertyNameArrayData::begin):
650 (JSC::PropertyNameArrayData::end):
651 (JSC::PropertyNameArrayData::setCachedStructureID):
652 (JSC::PropertyNameArrayData::cachedStructureID):
653 * kjs/StructureID.cpp:
654 (JSC::StructureID::getEnumerablePropertyNames):
655 (JSC::structureIDChainsAreEqual):
658 2008-09-22 Kelvin Sherlock <ksherlock@gmail.com>
660 Updated and tweaked by Sam Weinig.
662 Reviewed by Geoffrey Garen.
664 Bug 20020: Proposed enhancement to JavaScriptCore API
665 <https://bugs.webkit.org/show_bug.cgi?id=20020>
667 Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp
668 functions to create JavaScript Array, Date, Error, and RegExp objects, respectively.
670 * API/JSObjectRef.cpp: The functions
671 * API/JSObjectRef.h: Function prototype and documentation
672 * JavaScriptCore.exp: Added functions to exported function list
673 * API/tests/testapi.c: Added basic functionality tests.
675 * kjs/DateConstructor.cpp:
676 Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
677 with JSObject* constructDate(ExecState* exec, const ArgList& args).
678 Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function
680 * kjs/DateConstructor.h:
681 added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args)
683 * kjs/ErrorConstructor.cpp:
684 removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args)
686 * kjs/ErrorConstructor.h:
687 added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args)
689 * kjs/RegExpConstructor.cpp:
690 removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args)
692 * kjs/RegExpConstructor.h:
693 added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args)
695 2008-09-22 Matt Lilek <webkit@mattlilek.com>
697 Not reviewed, Windows build fix.
700 * kjs/FunctionPrototype.cpp:
702 2008-09-22 Sam Weinig <sam@webkit.org>
704 Reviewed by Darin Adler.
706 Patch for https://bugs.webkit.org/show_bug.cgi?id=20982
707 Speed up the apply method of functions by special-casing array and 'arguments' objects
709 1% speedup on v8-raytrace.
711 Test: fast/js/function-apply.html
714 (JSC::Arguments::fillArgList):
716 * kjs/FunctionPrototype.cpp:
717 (JSC::functionProtoFuncApply):
719 (JSC::JSArray::fillArgList):
722 2008-09-22 Darin Adler <darin@apple.com>
724 Reviewed by Sam Weinig.
726 - https://bugs.webkit.org/show_bug.cgi?id=20993
727 Array.push/pop need optimized cases for JSArray
729 3% or so speedup on DeltaBlue benchmark.
731 * kjs/ArrayPrototype.cpp:
732 (JSC::arrayProtoFuncPop): Call JSArray::pop when appropriate.
733 (JSC::arrayProtoFuncPush): Call JSArray::push when appropriate.
736 (JSC::JSArray::putSlowCase): Set m_fastAccessCutoff when appropriate, getting
737 us into the fast code path.
738 (JSC::JSArray::pop): Added.
739 (JSC::JSArray::push): Added.
740 * kjs/JSArray.h: Added push and pop.
742 * kjs/operations.cpp:
743 (JSC::throwOutOfMemoryError): Don't inline this. Helps us avoid PIC branches.
745 2008-09-22 Maciej Stachowiak <mjs@apple.com>
747 Reviewed by Cameron Zwarich.
749 - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
751 Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
753 2.2% speedup on EarleyBoyer benchmark.
755 * API/JSCallbackConstructor.cpp:
756 * API/JSCallbackConstructor.h:
757 (JSC::JSCallbackConstructor::createStructureID):
758 * API/JSCallbackFunction.cpp:
759 * API/JSCallbackFunction.h:
760 (JSC::JSCallbackFunction::createStructureID):
761 * API/JSCallbackObject.h:
762 (JSC::JSCallbackObject::createStructureID):
763 * API/JSCallbackObjectFunctions.h:
764 (JSC::::hasInstance):
765 * API/JSValueRef.cpp:
766 (JSValueIsInstanceOfConstructor):
767 * JavaScriptCore.exp:
769 (JSC::Machine::privateExecute):
770 (JSC::Machine::cti_op_instanceof):
771 * kjs/InternalFunction.cpp:
772 * kjs/InternalFunction.h:
773 (JSC::InternalFunction::createStructureID):
777 (JSC::TypeInfo::implementsHasInstance):
779 2008-09-22 Maciej Stachowiak <mjs@apple.com>
781 Reviewed by Dave Hyatt.
783 Based on initial work by Darin Adler.
785 - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
786 - use this to JIT inline code for eq_null and neq_null
787 https://bugs.webkit.org/show_bug.cgi?id=20823
789 0.5% speedup on SunSpider
790 ~4% speedup on Richards benchmark
793 (JSC::CTI::privateCompileMainPass):
795 (JSC::jsTypeStringForValue):
796 (JSC::jsIsObjectType):
797 (JSC::Machine::privateExecute):
798 (JSC::Machine::cti_op_is_undefined):
802 * kjs/StringObjectThatMasqueradesAsUndefined.h:
803 (JSC::StringObjectThatMasqueradesAsUndefined::create):
804 (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
806 (JSC::StructureID::mutableTypeInfo):
808 (JSC::TypeInfo::TypeInfo):
809 (JSC::TypeInfo::masqueradesAsUndefined):
810 * kjs/operations.cpp:
812 * masm/X86Assembler.h:
813 (JSC::X86Assembler::):
814 (JSC::X86Assembler::setne_r):
815 (JSC::X86Assembler::setnz_r):
816 (JSC::X86Assembler::testl_i32m):
818 2008-09-22 Tor Arne Vestbø <tavestbo@trolltech.com>
822 Initialize QCoreApplication in kjs binary/Shell.cpp
824 This allows us to use QCoreApplication::instance() to
825 get the main thread in ThreadingQt.cpp
829 * wtf/ThreadingQt.cpp:
830 (WTF::initializeThreading):
832 2008-09-21 Darin Adler <darin@apple.com>
834 - blind attempt to fix non-all-in-one builds
836 * kjs/JSGlobalObject.cpp: Added includes of Arguments.h and RegExpObject.h.
838 2008-09-21 Darin Adler <darin@apple.com>
842 * kjs/StructureID.cpp:
843 (JSC::StructureID::addPropertyTransition): Use typeInfo().type() instead of m_type.
844 (JSC::StructureID::createCachedPrototypeChain): Ditto.
846 2008-09-21 Maciej Stachowiak <mjs@apple.com>
848 Reviewed by Darin Adler.
850 - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
851 https://bugs.webkit.org/show_bug.cgi?id=20981
853 * JavaScriptCore.exp:
854 * JavaScriptCore.xcodeproj/project.pbxproj:
856 (JSC::CTI::privateCompileMainPass):
857 (JSC::CTI::privateCompilePutByIdTransition):
859 (JSC::jsIsObjectType):
860 (JSC::Machine::Machine):
861 * kjs/AllInOneFile.cpp:
863 (JSC::JSCell::isObject):
864 (JSC::JSCell::isString):
865 * kjs/JSGlobalData.cpp:
866 (JSC::JSGlobalData::JSGlobalData):
867 * kjs/JSGlobalObject.cpp:
868 (JSC::JSGlobalObject::reset):
869 * kjs/JSGlobalObject.h:
870 (JSC::StructureID::prototypeForLookup):
871 * kjs/JSNumberCell.h:
872 (JSC::JSNumberCell::createStructureID):
874 (JSC::JSObject::createInheritorID):
876 (JSC::JSObject::createStructureID):
878 (JSC::JSString::createStructureID):
879 * kjs/NativeErrorConstructor.cpp:
880 (JSC::NativeErrorConstructor::NativeErrorConstructor):
881 * kjs/RegExpConstructor.cpp:
882 * kjs/RegExpMatchesArray.h: Added.
883 (JSC::RegExpMatchesArray::getOwnPropertySlot):
884 (JSC::RegExpMatchesArray::put):
885 (JSC::RegExpMatchesArray::deleteProperty):
886 (JSC::RegExpMatchesArray::getPropertyNames):
887 * kjs/StructureID.cpp:
888 (JSC::StructureID::StructureID):
889 (JSC::StructureID::addPropertyTransition):
890 (JSC::StructureID::toDictionaryTransition):
891 (JSC::StructureID::changePrototypeTransition):
892 (JSC::StructureID::getterSetterTransition):
894 (JSC::StructureID::create):
895 (JSC::StructureID::typeInfo):
896 * kjs/TypeInfo.h: Added.
897 (JSC::TypeInfo::TypeInfo):
898 (JSC::TypeInfo::type):
900 2008-09-21 Darin Adler <darin@apple.com>
902 Reviewed by Cameron Zwarich.
904 - fix crash logging into Gmail due to recent Arguments change
907 (JSC::Arguments::Arguments): Fix window where mark() function could
908 see d->extraArguments with uninitialized contents.
909 (JSC::Arguments::mark): Check d->extraArguments for 0 to handle two
910 cases: 1) Inside the constructor before it's initialized.
911 2) numArguments <= numParameters.
913 2008-09-21 Darin Adler <darin@apple.com>
915 - fix loose end from the "duplicate constant values" patch
917 * VM/CodeGenerator.cpp:
918 (JSC::CodeGenerator::emitLoad): Add a special case for values the
919 hash table can't handle.
921 2008-09-21 Mark Rowe <mrowe@apple.com>
923 Fix the non-AllInOneFile build.
925 * kjs/Arguments.cpp: Add missing #include.
927 2008-09-21 Darin Adler <darin@apple.com>
929 Reviewed by Cameron Zwarich and Mark Rowe.
931 - fix test failure caused by my recent IndexToNameMap patch
934 (JSC::Arguments::deleteProperty): Added the accidentally-omitted
935 check of the boolean result from toArrayIndex.
937 2008-09-21 Darin Adler <darin@apple.com>
939 Reviewed by Maciej Stachowiak.
941 - https://bugs.webkit.org/show_bug.cgi?id=20975
942 inline immediate-number case of ==
944 * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to
945 emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.
947 * VM/CTI.cpp: Updated for new name.
948 (JSC::CTI::privateCompileMainPass): Added op_eq.
949 (JSC::CTI::privateCompileSlowCases): Added op_eq.
952 (JSC::Machine::cti_op_eq): Removed fast case, since it's now
955 2008-09-21 Peter Gal <galpter@inf.u-szeged.hu>
957 Reviewed by Tim Hatcher and Eric Seidel.
959 Fix the QT/Linux JavaScriptCore segmentation fault.
960 https://bugs.webkit.org/show_bug.cgi?id=20914
962 * wtf/ThreadingQt.cpp:
963 (WTF::initializeThreading): Use currentThread() if
964 platform is not a MAC (like in pre 36541 revisions)
966 2008-09-21 Darin Adler <darin@apple.com>
968 Reviewed by Sam Weinig.
970 * kjs/debugger.h: Removed some unneeded includes and declarations.
972 2008-09-21 Darin Adler <darin@apple.com>
974 Reviewed by Sam Weinig.
976 - https://bugs.webkit.org/show_bug.cgi?id=20972
977 speed up Arguments further by eliminating the IndexToNameMap
979 No change on SunSpider. 1.29x as fast on V8 Raytrace.
981 * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the
982 indexToNameMap and hadDeletes data members. Changed extraArguments into
983 an OwnArrayPtr and added deletedArguments, another OwnArrayPtr.
984 Replaced numExtraArguments with numParameters, since that's what's
985 used more directly in hot code paths.
986 (JSC::Arguments::Arguments): Pass in argument count instead of ArgList.
987 Initialize ArgumentsData the new way.
988 (JSC::Arguments::mark): Updated.
989 (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so
990 we don't have to convert integers to identifiers just to get an argument.
991 Integrated the deleted case with the fast case.
992 (JSC::Arguments::put): Ditto.
993 (JSC::Arguments::deleteProperty): Ditto.
995 * kjs/Arguments.h: Minimized includes. Made everything private. Added
996 overloads for the integral property name case. Eliminated mappedIndexSetter.
997 Moved ArgumentsData into the .cpp file.
999 * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
1000 * kjs/IndexToNameMap.h: Ditto.
1002 * kjs/JSActivation.cpp:
1003 (JSC::JSActivation::createArgumentsObject): Elminated ArgList.
1006 * JavaScriptCore.pri:
1007 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1008 * JavaScriptCore.xcodeproj/project.pbxproj:
1009 * JavaScriptCoreSources.bkl:
1010 * kjs/AllInOneFile.cpp:
1011 Removed IndexToNameMap.
1013 2008-09-21 Darin Adler <darin@apple.com>
1015 * VM/CodeGenerator.cpp:
1016 (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly
1019 2008-09-21 Judit Jasz <jasy@inf.u-szeged.hu>
1021 Reviewed and tweaked by Darin Adler.
1023 - https://bugs.webkit.org/show_bug.cgi?id=20645
1024 Elminate duplicate constant values in CodeBlocks.
1026 Seems to be a wash on SunSpider.
1028 * VM/CodeGenerator.cpp:
1029 (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee
1030 we emit the same JSValue* for identical numbers and strings.
1031 * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&.
1032 Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap.
1034 (JSC::StringNode::emitCode): Call the new emitLoad and let it do the
1037 2008-09-21 Paul Pedriana <webkit@pedriana.com>
1039 Reviewed and tweaked by Darin Adler.
1041 - https://bugs.webkit.org/show_bug.cgi?id=16925
1042 Fixed lack of Vector buffer alignment for both GCC and MSVC.
1043 Since there's no portable way to do this, for now we don't support
1046 * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer.
1047 Use AlignedBuffer insteadof an array of char in VectorBuffer.
1049 2008-09-21 Gabor Loki <loki@inf.u-szeged.hu>
1051 Reviewed by Darin Adler.
1053 - https://bugs.webkit.org/show_bug.cgi?id=19408
1054 Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators.
1056 1.008x as fast on SunSpider.
1059 (makeNegateNode): Fold if expression is a number > 0.
1060 (makeBitwiseNotNode): Fold if expression is a number.
1061 (makeMultNode): Fold if expressions are both numbers.
1062 (makeDivNode): Fold if expressions are both numbers.
1063 (makeAddNode): Fold if expressions are both numbers.
1064 (makeLeftShiftNode): Fold if expressions are both numbers.
1065 (makeRightShiftNode): Fold if expressions are both numbers.
1067 2008-09-21 Maciej Stachowiak <mjs@apple.com>
1071 - speed up === operator by generating inline machine code for the fast paths
1072 https://bugs.webkit.org/show_bug.cgi?id=20820
1075 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber):
1076 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers):
1077 (JSC::CTI::emitJumpSlowCaseIfNotImmediates):
1078 (JSC::CTI::emitTagAsBoolImmediate):
1079 (JSC::CTI::privateCompileMainPass):
1080 (JSC::CTI::privateCompileSlowCases):
1083 (JSC::Machine::cti_op_stricteq):
1084 * masm/X86Assembler.h:
1085 (JSC::X86Assembler::):
1086 (JSC::X86Assembler::sete_r):
1087 (JSC::X86Assembler::setz_r):
1088 (JSC::X86Assembler::movzbl_rr):
1089 (JSC::X86Assembler::emitUnlinkedJnz):
1091 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1093 Reviewed by Maciej Stachowiak.
1095 Free memory allocated for extra arguments in the destructor of the
1098 * kjs/Arguments.cpp:
1099 (JSC::Arguments::~Arguments):
1102 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1104 Reviewed by Maciej Stachowiak.
1106 Bug 20815: 'arguments' object creation is non-optimal
1107 <https://bugs.webkit.org/show_bug.cgi?id=20815>
1109 Fix our inefficient way of creating the arguments object by only
1110 creating named properties for each of the arguments after a use of the
1111 'delete' statement. This patch also speeds up access to the 'arguments'
1112 object slightly, but it still does not use the array fast path for
1113 indexed access that exists for many opcodes.
1115 This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5%
1116 improvement on the Earley-Boyer benchmark, which gives a 4% improvement
1119 * kjs/Arguments.cpp:
1120 (JSC::Arguments::Arguments):
1121 (JSC::Arguments::mark):
1122 (JSC::Arguments::getOwnPropertySlot):
1123 (JSC::Arguments::put):
1124 (JSC::Arguments::deleteProperty):
1126 (JSC::Arguments::ArgumentsData::ArgumentsData):
1127 * kjs/IndexToNameMap.h:
1128 (JSC::IndexToNameMap::size):
1129 * kjs/JSActivation.cpp:
1130 (JSC::JSActivation::createArgumentsObject):
1131 * kjs/JSActivation.h:
1132 (JSC::JSActivation::uncheckedSymbolTableGet):
1133 (JSC::JSActivation::uncheckedSymbolTableGetValue):
1134 (JSC::JSActivation::uncheckedSymbolTablePut):
1136 (JSC::JSFunction::numParameters):
1138 2008-09-20 Darin Adler <darin@apple.com>
1140 Reviewed by Mark Rowe.
1142 - fix crash seen on buildbot
1144 * kjs/JSGlobalObject.cpp:
1145 (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype,
1146 deleted by accident in my recent check-in.
1148 2008-09-20 Maciej Stachowiak <mjs@apple.com>
1150 Not reviewed, build fix.
1152 - speculative fix for non-AllInOne builds
1156 2008-09-20 Maciej Stachowiak <mjs@apple.com>
1158 Reviewed by Darin Adler.
1160 - assorted optimizations to === and !== operators
1161 (work towards <https://bugs.webkit.org/show_bug.cgi?id=20820>)
1163 2.5% speedup on earley-boyer test
1166 (JSC::Machine::cti_op_stricteq): Use inline version of
1167 strictEqualSlowCase; remove unneeded exception check.
1168 (JSC::Machine::cti_op_nstricteq): ditto
1169 * kjs/operations.cpp:
1170 (JSC::strictEqual): Use strictEqualSlowCaseInline
1171 (JSC::strictEqualSlowCase): ditto
1173 (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined,
1174 since the extra function call indirection is a lose for CTI.
1176 2008-09-20 Darin Adler <darin@apple.com>
1178 Reviewed by Maciej Stachowiak.
1180 - finish https://bugs.webkit.org/show_bug.cgi?id=20858
1181 make each distinct C++ class get a distinct JSC::Structure
1183 This also includes some optimizations that make the change an overall
1184 small speedup. Without those it was a bit of a slowdown.
1186 * API/JSCallbackConstructor.cpp:
1187 (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
1188 * API/JSCallbackConstructor.h: Ditto.
1189 * API/JSCallbackFunction.cpp:
1190 (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
1191 * API/JSCallbackObject.h: Take a structure.
1192 * API/JSCallbackObjectFunctions.h:
1193 (JSC::JSCallbackObject::JSCallbackObject): Ditto.
1195 * API/JSClassRef.cpp:
1196 (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype
1197 if there's a custom prototype involved.
1198 * API/JSObjectRef.cpp:
1199 (JSObjectMake): Ditto.
1200 (JSObjectMakeConstructor): Pass in a structure.
1202 * JavaScriptCore.exp: Updated.
1205 (JSC::jsLess): Added a special case for when both arguments are strings.
1206 This avoids converting both strings to with UString::toDouble.
1207 (JSC::jsLessEq): Ditto.
1208 (JSC::Machine::privateExecute): Pass in a structure.
1209 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
1210 (JSC::Machine::cti_op_new_regexp): Ditto.
1211 (JSC::Machine::cti_op_is_string): Ditto.
1212 * VM/Machine.h: Made isJSString public so it can be used in the CTI.
1214 * kjs/Arguments.cpp:
1215 (JSC::Arguments::Arguments): Pass in a structure.
1217 * kjs/JSCell.h: Mark constructor explicit.
1219 * kjs/JSGlobalObject.cpp:
1220 (JSC::markIfNeeded): Added an overload for marking structures.
1221 (JSC::JSGlobalObject::reset): Eliminate code to set data members to
1222 zero. We now do that in the constructor, and we no longer use this
1223 anywhere except in the constructor. Added code to create structures.
1224 Pass structures rather than prototypes when creating objects.
1225 (JSC::JSGlobalObject::mark): Mark the structures.
1227 * kjs/JSGlobalObject.h: Removed unneeded class declarations.
1228 Added initializers for raw pointers in JSGlobalObjectData so
1229 everything starts with a 0. Added structure data and accessor
1232 * kjs/JSImmediate.cpp:
1233 (JSC::JSImmediate::nonInlineNaN): Added.
1234 * kjs/JSImmediate.h:
1235 (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
1237 * kjs/JSNumberCell.cpp:
1238 (JSC::jsNumberCell): Made non-inline to avoid PIC branches
1239 in functions that call this one.
1240 (JSC::jsNaN): Ditto.
1241 * kjs/JSNumberCell.h: Ditto.
1243 * kjs/JSObject.h: Removed constructor that takes a prototype.
1244 All callers now pass structures.
1246 * kjs/ArrayConstructor.cpp:
1247 (JSC::ArrayConstructor::ArrayConstructor):
1248 (JSC::constructArrayWithSizeQuirk):
1249 * kjs/ArrayConstructor.h:
1250 * kjs/ArrayPrototype.cpp:
1251 (JSC::ArrayPrototype::ArrayPrototype):
1252 * kjs/ArrayPrototype.h:
1253 * kjs/BooleanConstructor.cpp:
1254 (JSC::BooleanConstructor::BooleanConstructor):
1255 (JSC::constructBoolean):
1256 (JSC::constructBooleanFromImmediateBoolean):
1257 * kjs/BooleanConstructor.h:
1258 * kjs/BooleanObject.cpp:
1259 (JSC::BooleanObject::BooleanObject):
1260 * kjs/BooleanObject.h:
1261 * kjs/BooleanPrototype.cpp:
1262 (JSC::BooleanPrototype::BooleanPrototype):
1263 * kjs/BooleanPrototype.h:
1264 * kjs/DateConstructor.cpp:
1265 (JSC::DateConstructor::DateConstructor):
1266 (JSC::constructDate):
1267 * kjs/DateConstructor.h:
1268 * kjs/DateInstance.cpp:
1269 (JSC::DateInstance::DateInstance):
1270 * kjs/DateInstance.h:
1271 * kjs/DatePrototype.cpp:
1272 (JSC::DatePrototype::DatePrototype):
1273 * kjs/DatePrototype.h:
1274 * kjs/ErrorConstructor.cpp:
1275 (JSC::ErrorConstructor::ErrorConstructor):
1276 (JSC::constructError):
1277 * kjs/ErrorConstructor.h:
1278 * kjs/ErrorInstance.cpp:
1279 (JSC::ErrorInstance::ErrorInstance):
1280 * kjs/ErrorInstance.h:
1281 * kjs/ErrorPrototype.cpp:
1282 (JSC::ErrorPrototype::ErrorPrototype):
1283 * kjs/ErrorPrototype.h:
1284 * kjs/FunctionConstructor.cpp:
1285 (JSC::FunctionConstructor::FunctionConstructor):
1286 * kjs/FunctionConstructor.h:
1287 * kjs/FunctionPrototype.cpp:
1288 (JSC::FunctionPrototype::FunctionPrototype):
1289 (JSC::FunctionPrototype::addFunctionProperties):
1290 * kjs/FunctionPrototype.h:
1291 * kjs/GlobalEvalFunction.cpp:
1292 (JSC::GlobalEvalFunction::GlobalEvalFunction):
1293 * kjs/GlobalEvalFunction.h:
1294 * kjs/InternalFunction.cpp:
1295 (JSC::InternalFunction::InternalFunction):
1296 * kjs/InternalFunction.h:
1297 (JSC::InternalFunction::InternalFunction):
1299 (JSC::JSArray::JSArray):
1300 (JSC::constructEmptyArray):
1301 (JSC::constructArray):
1303 * kjs/JSFunction.cpp:
1304 (JSC::JSFunction::JSFunction):
1305 (JSC::JSFunction::construct):
1307 (JSC::constructEmptyObject):
1309 (JSC::StringObject::create):
1310 * kjs/JSWrapperObject.h:
1311 * kjs/MathObject.cpp:
1312 (JSC::MathObject::MathObject):
1314 * kjs/NativeErrorConstructor.cpp:
1315 (JSC::NativeErrorConstructor::NativeErrorConstructor):
1316 (JSC::NativeErrorConstructor::construct):
1317 * kjs/NativeErrorConstructor.h:
1318 * kjs/NativeErrorPrototype.cpp:
1319 (JSC::NativeErrorPrototype::NativeErrorPrototype):
1320 * kjs/NativeErrorPrototype.h:
1321 * kjs/NumberConstructor.cpp:
1322 (JSC::NumberConstructor::NumberConstructor):
1323 (JSC::constructWithNumberConstructor):
1324 * kjs/NumberConstructor.h:
1325 * kjs/NumberObject.cpp:
1326 (JSC::NumberObject::NumberObject):
1327 (JSC::constructNumber):
1328 (JSC::constructNumberFromImmediateNumber):
1329 * kjs/NumberObject.h:
1330 * kjs/NumberPrototype.cpp:
1331 (JSC::NumberPrototype::NumberPrototype):
1332 * kjs/NumberPrototype.h:
1333 * kjs/ObjectConstructor.cpp:
1334 (JSC::ObjectConstructor::ObjectConstructor):
1335 (JSC::constructObject):
1336 * kjs/ObjectConstructor.h:
1337 * kjs/ObjectPrototype.cpp:
1338 (JSC::ObjectPrototype::ObjectPrototype):
1339 * kjs/ObjectPrototype.h:
1340 * kjs/PrototypeFunction.cpp:
1341 (JSC::PrototypeFunction::PrototypeFunction):
1342 * kjs/PrototypeFunction.h:
1343 * kjs/RegExpConstructor.cpp:
1344 (JSC::RegExpConstructor::RegExpConstructor):
1345 (JSC::RegExpMatchesArray::RegExpMatchesArray):
1346 (JSC::constructRegExp):
1347 * kjs/RegExpConstructor.h:
1348 * kjs/RegExpObject.cpp:
1349 (JSC::RegExpObject::RegExpObject):
1350 * kjs/RegExpObject.h:
1351 * kjs/RegExpPrototype.cpp:
1352 (JSC::RegExpPrototype::RegExpPrototype):
1353 * kjs/RegExpPrototype.h:
1355 (GlobalObject::GlobalObject):
1356 * kjs/StringConstructor.cpp:
1357 (JSC::StringConstructor::StringConstructor):
1358 (JSC::constructWithStringConstructor):
1359 * kjs/StringConstructor.h:
1360 * kjs/StringObject.cpp:
1361 (JSC::StringObject::StringObject):
1362 * kjs/StringObject.h:
1363 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1364 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1365 * kjs/StringPrototype.cpp:
1366 (JSC::StringPrototype::StringPrototype):
1367 * kjs/StringPrototype.h:
1368 Take and pass structures.
1370 2008-09-19 Alp Toker <alp@nuanti.com>
1372 Build fix for the 'gold' linker and recent binutils. New behaviour
1373 requires that we link to used libraries explicitly.
1377 2008-09-19 Sam Weinig <sam@webkit.org>
1379 Roll r36694 back in. It did not cause the crash.
1381 * JavaScriptCore.exp:
1382 * VM/JSPropertyNameIterator.cpp:
1383 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
1384 (JSC::JSPropertyNameIterator::invalidate):
1385 * VM/JSPropertyNameIterator.h:
1386 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1387 (JSC::JSPropertyNameIterator::create):
1389 (JSC::JSObject::getPropertyNames):
1390 * kjs/PropertyMap.cpp:
1391 (JSC::PropertyMap::getEnumerablePropertyNames):
1392 * kjs/PropertyMap.h:
1393 * kjs/PropertyNameArray.cpp:
1394 (JSC::PropertyNameArray::add):
1395 * kjs/PropertyNameArray.h:
1396 (JSC::PropertyNameArrayData::create):
1397 (JSC::PropertyNameArrayData::propertyNameVector):
1398 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
1399 (JSC::PropertyNameArrayData::cachedPrototypeChain):
1400 (JSC::PropertyNameArrayData::begin):
1401 (JSC::PropertyNameArrayData::end):
1402 (JSC::PropertyNameArrayData::PropertyNameArrayData):
1403 (JSC::PropertyNameArray::PropertyNameArray):
1404 (JSC::PropertyNameArray::addKnownUnique):
1405 (JSC::PropertyNameArray::size):
1406 (JSC::PropertyNameArray::operator[]):
1407 (JSC::PropertyNameArray::begin):
1408 (JSC::PropertyNameArray::end):
1409 (JSC::PropertyNameArray::setData):
1410 (JSC::PropertyNameArray::data):
1411 (JSC::PropertyNameArray::releaseData):
1412 * kjs/StructureID.cpp:
1413 (JSC::structureIDChainsAreEqual):
1414 (JSC::StructureID::getEnumerablePropertyNames):
1415 (JSC::StructureID::clearEnumerationCache):
1416 (JSC::StructureID::createCachedPrototypeChain):
1417 * kjs/StructureID.h:
1419 2008-09-19 Sam Weinig <sam@webkit.org>
1423 * JavaScriptCore.exp:
1424 * VM/JSPropertyNameIterator.cpp:
1425 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
1426 (JSC::JSPropertyNameIterator::invalidate):
1427 * VM/JSPropertyNameIterator.h:
1428 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1429 (JSC::JSPropertyNameIterator::create):
1431 (JSC::JSObject::getPropertyNames):
1432 * kjs/PropertyMap.cpp:
1433 (JSC::PropertyMap::getEnumerablePropertyNames):
1434 * kjs/PropertyMap.h:
1435 * kjs/PropertyNameArray.cpp:
1436 (JSC::PropertyNameArray::add):
1437 * kjs/PropertyNameArray.h:
1438 (JSC::PropertyNameArray::PropertyNameArray):
1439 (JSC::PropertyNameArray::addKnownUnique):
1440 (JSC::PropertyNameArray::begin):
1441 (JSC::PropertyNameArray::end):
1442 (JSC::PropertyNameArray::size):
1443 (JSC::PropertyNameArray::operator[]):
1444 (JSC::PropertyNameArray::releaseIdentifiers):
1445 * kjs/StructureID.cpp:
1446 (JSC::StructureID::getEnumerablePropertyNames):
1447 * kjs/StructureID.h:
1448 (JSC::StructureID::clearEnumerationCache):
1450 2008-09-19 Oliver Hunt <oliver@apple.com>
1452 Reviewed by Maciej Stachowiak.
1454 Improve peformance of local variable initialisation.
1456 Pull local and constant initialisation out of slideRegisterWindowForCall
1457 and into its own opcode. This allows the JIT to generate the initialisation
1458 code for a function directly into the instruction stream and so avoids a few
1459 branches on function entry.
1461 Results a 1% progression in SunSpider, particularly in a number of the bitop
1462 tests where the called functions are very fast.
1465 (JSC::CTI::emitInitialiseRegister):
1466 (JSC::CTI::privateCompileMainPass):
1469 (JSC::CodeBlock::dump):
1470 * VM/CodeGenerator.cpp:
1471 (JSC::CodeGenerator::CodeGenerator):
1473 (JSC::slideRegisterWindowForCall):
1474 (JSC::Machine::privateExecute):
1477 2008-09-19 Sam Weinig <sam@webkit.org>
1479 Reviewed by Darin Adler.
1481 Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
1482 Speed up JS property enumeration by caching entire PropertyNameArray
1484 1.3% speedup on Sunspider, 30% on string-fasta.
1486 * JavaScriptCore.exp:
1487 * VM/JSPropertyNameIterator.cpp:
1488 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
1489 (JSC::JSPropertyNameIterator::invalidate):
1490 * VM/JSPropertyNameIterator.h:
1491 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1492 (JSC::JSPropertyNameIterator::create):
1494 (JSC::JSObject::getPropertyNames):
1495 * kjs/PropertyMap.cpp:
1496 (JSC::PropertyMap::getEnumerablePropertyNames):
1497 * kjs/PropertyMap.h:
1498 * kjs/PropertyNameArray.cpp:
1499 (JSC::PropertyNameArray::add):
1500 * kjs/PropertyNameArray.h:
1501 (JSC::PropertyNameArrayData::create):
1502 (JSC::PropertyNameArrayData::propertyNameVector):
1503 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
1504 (JSC::PropertyNameArrayData::cachedPrototypeChain):
1505 (JSC::PropertyNameArrayData::begin):
1506 (JSC::PropertyNameArrayData::end):
1507 (JSC::PropertyNameArrayData::PropertyNameArrayData):
1508 (JSC::PropertyNameArray::PropertyNameArray):
1509 (JSC::PropertyNameArray::addKnownUnique):
1510 (JSC::PropertyNameArray::size):
1511 (JSC::PropertyNameArray::operator[]):
1512 (JSC::PropertyNameArray::begin):
1513 (JSC::PropertyNameArray::end):
1514 (JSC::PropertyNameArray::setData):
1515 (JSC::PropertyNameArray::data):
1516 (JSC::PropertyNameArray::releaseData):
1517 * kjs/ScopeChain.cpp:
1518 (JSC::ScopeChainNode::print):
1519 * kjs/StructureID.cpp:
1520 (JSC::structureIDChainsAreEqual):
1521 (JSC::StructureID::getEnumerablePropertyNames):
1522 (JSC::StructureID::clearEnumerationCache):
1523 (JSC::StructureID::createCachedPrototypeChain):
1524 * kjs/StructureID.h:
1526 2008-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
1528 Reviewed by Maciej Stachowiak.
1530 Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
1533 (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
1535 2008-09-19 Darin Adler <darin@apple.com>
1537 Reviewed by Sam Weinig.
1539 - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
1540 make each distinct C++ class get a distinct JSC::Structure
1542 * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
1544 * kjs/JSGlobalObject.h: Changed the protected constructor to take a
1545 structure instead of a prototype.
1547 * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
1549 2008-09-19 Julien Chaffraix <jchaffraix@pleyo.com>
1551 Reviewed by Alexey Proskuryakov.
1553 Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
1554 non-template methods' code been copied for each instance of the template.
1555 The patch splits RefCounted between a base class that holds non-template methods and attributes
1556 and the template RefCounted class that keeps the same functionnality.
1558 On my Linux with gcc 4.3 for the Gtk port, this is:
1559 - a ~600KB save on libwebkit.so in release.
1560 - a ~1.6MB save on libwebkit.so in debug.
1562 It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
1563 On the whole, it should be a small win as we reduce the compiled code size and the only
1564 new function call should be inlined by the compiler.
1567 (WTF::RefCountedBase::ref): Copied from RefCounted.
1568 (WTF::RefCountedBase::hasOneRef): Ditto.
1569 (WTF::RefCountedBase::refCount): Ditto.
1570 (WTF::RefCountedBase::RefCountedBase): Ditto.
1571 (WTF::RefCountedBase::~RefCountedBase): Ditto.
1572 (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
1574 (WTF::RefCounted::RefCounted):
1575 (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
1576 (WTF::RefCounted::~RefCounted): Keep private destructor.
1578 2008-09-18 Darin Adler <darin@apple.com>
1580 Reviewed by Maciej Stachowiak.
1582 - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
1583 make each distinct C++ class get a distinct JSC::Structure
1585 * kjs/lookup.h: Removed things here that were used only in WebCore:
1586 cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
1587 and JSC_IMPLEMENT_PROTOTYPE.
1589 2008-09-18 Darin Adler <darin@apple.com>
1591 Reviewed by Maciej Stachowiak.
1593 - https://bugs.webkit.org/show_bug.cgi?id=20927
1594 simplify/streamline the code to turn strings into identifiers while parsing
1596 * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
1600 (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
1601 * kjs/lexer.h: Remove makeUString.
1603 * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
1605 * VM/CodeGenerator.cpp:
1606 (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
1607 (JSC::prepareJumpTableForStringSwitch): Ditto.
1609 (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
1610 (JSC::processClauseList): Ditto.
1611 * kjs/nodes2string.cpp:
1612 (JSC::StringNode::streamTo): Ditto.
1614 2008-09-18 Sam Weinig <sam@webkit.org>
1619 (JSC::Instruction::Instruction):
1621 2008-09-18 Oliver Hunt <oliver@apple.com>
1623 Reviewed by Maciej Stachowiak.
1625 Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
1626 <https://bugs.webkit.org/show_bug.cgi?id=20911>
1628 The problem was simply caused by the int constructor for Instruction
1629 failing to initialise the full struct in 64bit builds.
1632 (JSC::Instruction::Instruction):
1634 2008-09-18 Darin Adler <darin@apple.com>
1638 * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
1640 2008-09-18 Darin Adler <darin@apple.com>
1642 Reviewed by Sam Weinig.
1644 * kjs/JSGlobalObject.h: Tiny style guideline tweak.
1646 2008-09-18 Darin Adler <darin@apple.com>
1648 Reviewed by Sam Weinig.
1650 - fix https://bugs.webkit.org/show_bug.cgi?id=20925
1651 LEAK messages appear every time I quit
1653 * JavaScriptCore.exp: Updated, and also added an export
1654 needed for future WebCore use of JSC::StructureID.
1656 * wtf/RefCountedLeakCounter.cpp:
1657 (WTF::RefCountedLeakCounter::suppressMessages): Added.
1658 (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
1659 (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
1660 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
1661 log the reason there was no leak checking done.
1662 (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
1663 (WTF::RefCountedLeakCounter::decrement): Ditto.
1665 * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
1666 new functions, suppressMessages and cancelMessageSuppression. Also
1667 added m_ prefixes to the data member names.
1669 2008-09-18 Holger Hans Peter Freyther <zecke@selfish.org>
1671 Reviewed by Mark Rowe.
1673 https://bugs.webkit.org/show_bug.cgi?id=20437
1675 Add a proper #define to define which XML Parser implementation to use. Client
1676 code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
1677 implementation is going to be used.
1681 2008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1683 Reviewed by Maciej Stachowiak.
1685 Make a Unicode non-breaking space count as a whitespace character in
1686 PCRE. This change was already made in WREC, and it fixes one of the
1687 Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
1688 in a new set of expected test results.
1690 * pcre/pcre_internal.h:
1692 * tests/mozilla/expected.html:
1694 2008-09-18 Stephanie Lewis <slewis@apple.com>
1696 Reviewed by Mark Rowe and Maciej Stachowiak.
1698 add an option use arch to specify which architecture to run.
1700 * tests/mozilla/jsDriver.pl:
1702 2008-09-17 Oliver Hunt <oliver@apple.com>
1704 Correctly restore argument reference prior to SFX runtime calls.
1706 Reviewed by Steve Falkenburg.
1709 (JSC::CTI::privateCompileSlowCases):
1710 (JSC::CTI::privateCompile):
1712 2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1714 Reviewed by Maciej Stachowiak.
1716 Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
1717 <https://bugs.webkit.org/show_bug.cgi?id=20876>
1719 r36417 and r36427 caused an get_by_id opcode to be emitted before the
1720 instanceof and construct opcodes, in order to enable inline caching of
1721 the prototype property. Unfortunately, this regressed some tests dealing
1722 with exceptions thrown by 'instanceof' and the 'new' operator. We fix
1723 these problems by detecting whether an "is not an object" exception is
1724 thrown before op_instanceof or op_construct, and emit the proper
1725 exception in those cases.
1727 * VM/CodeGenerator.cpp:
1728 (JSC::CodeGenerator::emitConstruct):
1729 * VM/CodeGenerator.h:
1730 * VM/ExceptionHelpers.cpp:
1731 (JSC::createInvalidParamError):
1732 (JSC::createNotAConstructorError):
1733 (JSC::createNotAnObjectError):
1734 * VM/ExceptionHelpers.h:
1736 (JSC::Machine::getOpcode):
1737 (JSC::Machine::privateExecute):
1740 (JSC::NewExprNode::emitCode):
1741 (JSC::InstanceOfNode::emitCode):
1743 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1745 Reviewed by Oliver Hunt.
1747 JIT generation cti_op_construct_verify.
1749 Quarter to half percent progression on v8-tests.
1750 Roughly not change on SunSpider (possible minor progression).
1753 (JSC::CTI::privateCompileMainPass):
1757 2008-09-15 Steve Falkenburg <sfalken@apple.com>
1759 Improve timer accuracy for JavaScript Date object on Windows.
1761 Use a combination of ftime and QueryPerformanceCounter.
1762 ftime returns the information we want, but doesn't have sufficient resolution.
1763 QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
1764 To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
1765 QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to
1766 correct for drift if the low-res and high-res elapsed time between calls differs by more
1767 than twice the low-resolution timer resolution.
1769 QueryPerformanceCounter may be inaccurate due to a problems with:
1770 - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
1771 - BIOS bugs (http://support.microsoft.com/kb/895980/)
1772 - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
1774 Reviewed by Darin Adler.
1777 (JSC::highResUpTime):
1778 (JSC::lowResUTCTime):
1779 (JSC::qpcAvailable):
1780 (JSC::getCurrentUTCTimeWithMicroseconds):
1782 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1784 Reviewed by Geoff Garen.
1786 Implement JIT generation of CallFrame initialization, for op_call.
1788 1% sunspider 2.5% v8-tests.
1791 (JSC::CTI::compileOpCall):
1793 (JSC::Machine::cti_op_call_JSFunction):
1794 (JSC::Machine::cti_op_call_NotJSFunction):
1796 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1798 Reviewed by Geoff Garen.
1800 Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code,
1801 move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
1802 functions, instead of checking prior to making the call.
1804 3% on v8-tests (4% on richards, 6% in delta-blue)
1807 (JSC::CTI::compileOpCall):
1808 (JSC::CTI::privateCompileSlowCases):
1809 (JSC::CTI::privateCompile):
1811 (JSC::Machine::execute):
1812 (JSC::Machine::cti_op_call_JSFunction):
1813 (JSC::Machine::cti_vm_compile):
1814 (JSC::Machine::cti_vm_updateScopeChain):
1815 (JSC::Machine::cti_op_construct_JSConstruct):
1818 2008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com>
1820 Fix the QtWebKit/Mac build
1822 * wtf/ThreadingQt.cpp:
1823 (WTF::initializeThreading): use QCoreApplication to get the main thread
1825 2008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1827 Reviewed by Maciej Stachowiak.
1829 Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
1830 <https://bugs.webkit.org/show_bug.cgi?id=20857>
1832 Fix a problem stemming from the slightly unsafe behaviour of the
1833 CodeGenerator::finalDestination() method by putting the "func" argument
1834 of the emitConstruct() method in a RefPtr in its caller. Also, add an
1835 assertion guaranteeing that this is always the case.
1837 CodeGenerator::finalDestination() is still incorrect and can cause
1838 problems with a different allocator; see bug 20340 for more details.
1840 * VM/CodeGenerator.cpp:
1841 (JSC::CodeGenerator::emitConstruct):
1843 (JSC::NewExprNode::emitCode):
1845 2008-09-16 Alice Liu <alice.liu@apple.com>
1850 (JSC::CTI::privateCompileMainPass):
1852 2008-09-16 Gavin Barraclough <barraclough@apple.com>
1854 Reviewed by Geoff Garen.
1856 CTI code generation for op_ret. The majority of the work
1857 (updating variables on the stack & on exec) can be performed
1858 directly in generated code.
1860 We still need to check, & to call out to C-code to handle
1861 activation records, profiling, and full scope chains.
1863 +1.5% Sunspider, +5/6% v8 tests.
1866 (JSC::CTI::emitPutCTIParam):
1867 (JSC::CTI::compileOpCall):
1868 (JSC::CTI::privateCompileMainPass):
1871 (JSC::Machine::cti_op_ret_activation):
1872 (JSC::Machine::cti_op_ret_profiler):
1873 (JSC::Machine::cti_op_ret_scopeChain):
1876 2008-09-16 Dimitri Glazkov <dglazkov@chromium.org>
1878 Fix the Windows build.
1880 Add some extra parentheses to stop MSVC from complaining so much.
1883 (JSC::Machine::privateExecute):
1884 (JSC::Machine::cti_op_stricteq):
1885 (JSC::Machine::cti_op_nstricteq):
1886 * kjs/operations.cpp:
1889 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1891 Reviewed by Cameron Zwarich.
1893 - speed up the === and !== operators by choosing the fast cases better
1895 No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
1898 (JSC::Machine::privateExecute):
1899 (JSC::Machine::cti_op_stricteq):
1900 (JSC::Machine::cti_op_nstricteq):
1901 * kjs/JSImmediate.h:
1902 (JSC::JSImmediate::areBothImmediate):
1903 * kjs/operations.cpp:
1905 (JSC::strictEqualSlowCase):
1908 2008-09-15 Oliver Hunt <oliver@apple.com>
1912 Coding style cleanup.
1915 (JSC::Machine::privateExecute):
1917 2008-09-15 Oliver Hunt <oliver@apple.com>
1919 Reviewed by Cameron Zwarich.
1921 Bug 20874: op_resolve does not do any form of caching
1922 <https://bugs.webkit.org/show_bug.cgi?id=20874>
1924 This patch adds an op_resolve_global opcode to handle (and cache)
1925 property lookup we can statically determine must occur on the global
1928 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
1929 10% in math-partial-sums
1932 (JSC::CTI::privateCompileMainPass):
1935 (JSC::CodeBlock::dump):
1936 * VM/CodeGenerator.cpp:
1937 (JSC::CodeGenerator::findScopedProperty):
1938 (JSC::CodeGenerator::emitResolve):
1940 (JSC::resolveGlobal):
1941 (JSC::Machine::privateExecute):
1942 (JSC::Machine::cti_op_resolve_global):
1946 2008-09-15 Sam Weinig <sam@webkit.org>
1948 Roll out r36462. It broke document.all.
1951 (JSC::CTI::privateCompileMainPass):
1952 (JSC::CTI::privateCompileSlowCases):
1955 (JSC::Machine::Machine):
1956 (JSC::Machine::cti_op_eq_null):
1957 (JSC::Machine::cti_op_neq_null):
1959 (JSC::Machine::isJSString):
1961 * kjs/JSWrapperObject.h:
1962 * kjs/StringObject.h:
1963 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1965 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1967 Reviewed by Maciej Stachowiak.
1969 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
1970 <https://bugs.webkit.org/show_bug.cgi?id=20863>
1972 r36427 changed the number of arguments to op_construct without changing
1973 the argument index for the vPC in the call to initializeCallFrame() in
1974 the CTI case. This caused a JSC test failure. Correcting the argument
1975 index fixes the test failure.
1978 (JSC::Machine::cti_op_construct_JSConstruct):
1980 2008-09-15 Mark Rowe <mrowe@apple.com>
1986 2008-09-15 Geoffrey Garen <ggaren@apple.com>
1988 Reviewed by Maciej Stachowiak.
1990 Fixed a typo in op_get_by_id_chain that caused it to miss every time
1993 Also, a little cleanup.
1996 (JSC::Machine::privateExecute): Set up baseObject before entering the
1997 loop, so we compare against the right values.
1999 2008-09-15 Geoffrey Garen <ggaren@apple.com>
2001 Reviewed by Sam Weinig.
2003 Removed the CalledAsConstructor flag from the call frame header. Now,
2004 we use an explicit opcode at the call site to fix up constructor results.
2006 SunSpider says 0.4% faster.
2008 cti_op_construct_verify is an out-of-line function call for now, but we
2009 can fix that once StructureID holds type information like isObject.
2012 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
2015 (JSC::CodeBlock::dump):
2017 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
2018 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
2019 (JSC::CodeGenerator::emitConstruct): ... ditto.
2021 * VM/Machine.cpp: No more CalledAsConstructor
2022 (JSC::Machine::privateExecute): Implementation for the new opcode.
2023 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
2024 called as a constructor.
2025 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
2028 * VM/Opcode.h: Declare new opcode.
2030 * VM/RegisterFile.h:
2031 (JSC::RegisterFile::): No more CalledAsConstructor
2033 2008-09-15 Gavin Barraclough <barraclough@apple.com>
2035 Reviewed by Geoff Garen.
2037 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
2038 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
2039 masquerading may be handled differently (through the StructureIDs - see bug
2045 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
2046 (JSC::CTI::privateCompileMainPass):
2047 (JSC::CTI::privateCompileSlowCases):
2050 (JSC::Machine::Machine):
2051 (JSC::Machine::cti_op_eq_null):
2052 (JSC::Machine::cti_op_neq_null):
2054 (JSC::Machine::doesMasqueradesAsUndefined):
2055 * kjs/JSWrapperObject.h:
2056 (JSC::JSWrapperObject::):
2057 (JSC::JSWrapperObject::JSWrapperObject):
2058 * kjs/StringObject.h:
2059 (JSC::StringObject::StringObject):
2060 * kjs/StringObjectThatMasqueradesAsUndefined.h:
2061 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
2063 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2065 Rubber-stamped by Oliver Hunt.
2067 r36427 broke CodeBlock::dump() by changing the number of arguments to
2068 op_construct without changing the code that prints it. This patch fixes
2069 it by printing the additional argument.
2071 * JavaScriptCore.xcodeproj/project.pbxproj:
2073 (JSC::CodeBlock::dump):
2075 2008-09-15 Adam Roben <aroben@apple.com>
2079 * kjs/StructureID.cpp: Removed a stray semicolon.
2081 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2083 Reviewed by Maciej Stachowiak.
2085 Fix a crash in fast/js/exception-expression-offset.html caused by not
2086 updating all mentions of the length of op_construct in r36427.
2089 (JSC::Machine::cti_op_construct_NotJSConstruct):
2091 2008-09-15 Maciej Stachowiak <mjs@apple.com>
2093 Reviewed by Cameron Zwarich.
2095 - fix layout test failure introduced by fix for 20849
2097 (The failing test was fast/js/delete-then-put.html)
2100 (JSC::JSObject::removeDirect): Clear enumeration cache
2101 in the dictionary case.
2103 (JSC::JSObject::putDirect): Ditto.
2104 * kjs/StructureID.h:
2105 (JSC::StructureID::clearEnumerationCache): Inline to handle the
2108 2008-09-15 Maciej Stachowiak <mjs@apple.com>
2110 Reviewed by Cameron Zwarich.
2112 - fix JSC test failures introduced by fix for 20849
2114 * kjs/PropertyMap.cpp:
2115 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
2117 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2119 Reviewed by Maciej Stachowiak.
2121 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
2122 <https://bugs.webkit.org/show_bug.cgi?id=20851>
2124 r36410 introduced an optimization for parseInt() that is incorrect when
2125 its argument is larger than the range of a 32-bit integer. If the
2126 argument is a number that is not an immediate integer, then the correct
2127 behaviour is to return the floor of its value, unless it is an infinite
2128 value, in which case the correct behaviour is to return 0.
2130 * kjs/JSGlobalObjectFunctions.cpp:
2131 (JSC::globalFuncParseInt):
2133 2008-09-15 Sam Weinig <sam@webkit.org>
2135 Reviewed by Maciej Stachowiak.
2137 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
2138 Cache property names for getEnumerablePropertyNames in the StructureID.
2140 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
2141 on the v8 test suite.
2144 (JSC::JSObject::getPropertyNames):
2145 * kjs/PropertyMap.cpp:
2146 (JSC::PropertyMap::getEnumerablePropertyNames):
2147 * kjs/PropertyMap.h:
2148 * kjs/StructureID.cpp:
2149 (JSC::StructureID::StructureID):
2150 (JSC::StructureID::getEnumerablePropertyNames):
2151 * kjs/StructureID.h:
2153 2008-09-14 Maciej Stachowiak <mjs@apple.com>
2155 Reviewed by Cameron Zwarich.
2157 - speed up JS construction by extracting "prototype" lookup so PIC applies.
2159 ~0.5% speedup on SunSpider
2160 Speeds up some of the V8 tests as well, most notably earley-boyer.
2163 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
2164 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
2165 * VM/CodeGenerator.cpp:
2166 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
2168 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
2169 (JSC::Machine::cti_op_construct_JSConstruct): ditto
2170 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
2172 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
2174 Reviewed by Eric Seidel.
2176 Add a protected destructor for RefCounted.
2178 It is wrong to call its destructor directly, because (1) this should be taken care of by
2179 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
2181 No change in behavior.
2183 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
2185 2008-09-14 Gavin Barraclough <barraclough@apple.com>
2187 Reviewed by Sam Weinig.
2189 Accelerated property accesses.
2191 Inline more of the array access code into the JIT code for get/put_by_val.
2192 Accelerate get/put_by_id by speculatively inlining a disable direct access
2193 into the hot path of the code, and repatch this with the correct StructureID
2194 and property map offset once these are known. In the case of accesses to the
2195 prototype and reading the array-length a trampoline is genertaed, and the
2196 branch to the slow-case is relinked to jump to this.
2198 By repatching, we mean rewriting the x86 instruction stream. Instructions are
2199 only modified in a simple fasion - altering immediate operands, memory access
2200 deisplacements, and branch offsets.
2202 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
2203 instruction's immediate operant is updateded, and a memory access operation's
2204 displacement is updated to access the correct field on the object. In the case
2205 of more complex accesses (array length and get_by_id_prototype) the offset on
2206 the branch to slow-case is updated, to now jump to a trampoline.
2208 +2.8% sunspider, +13% v8-tests
2211 (JSC::CTI::emitCall):
2212 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
2214 (JSC::CTI::privateCompileMainPass):
2215 (JSC::CTI::privateCompileSlowCases):
2216 (JSC::CTI::privateCompile):
2217 (JSC::CTI::privateCompileGetByIdSelf):
2218 (JSC::CTI::privateCompileGetByIdProto):
2219 (JSC::CTI::privateCompileGetByIdChain):
2220 (JSC::CTI::privateCompilePutByIdReplace):
2221 (JSC::CTI::privateCompilePutByIdTransition):
2222 (JSC::CTI::privateCompileArrayLengthTrampoline):
2223 (JSC::CTI::privateCompileStringLengthTrampoline):
2224 (JSC::CTI::patchGetByIdSelf):
2225 (JSC::CTI::patchPutByIdReplace):
2226 (JSC::CTI::privateCompilePatchGetArrayLength):
2227 (JSC::CTI::privateCompilePatchGetStringLength):
2229 (JSC::CTI::compileGetByIdSelf):
2230 (JSC::CTI::compileGetByIdProto):
2231 (JSC::CTI::compileGetByIdChain):
2232 (JSC::CTI::compilePutByIdReplace):
2233 (JSC::CTI::compilePutByIdTransition):
2234 (JSC::CTI::compileArrayLengthTrampoline):
2235 (JSC::CTI::compileStringLengthTrampoline):
2236 (JSC::CTI::compilePatchGetArrayLength):
2237 (JSC::CTI::compilePatchGetStringLength):
2239 (JSC::CodeBlock::dump):
2240 (JSC::CodeBlock::~CodeBlock):
2242 (JSC::StructureStubInfo::StructureStubInfo):
2243 (JSC::CodeBlock::getStubInfo):
2245 (JSC::Machine::tryCTICachePutByID):
2246 (JSC::Machine::tryCTICacheGetByID):
2247 (JSC::Machine::cti_op_put_by_val_array):
2249 * masm/X86Assembler.h:
2250 (JSC::X86Assembler::):
2251 (JSC::X86Assembler::cmpl_i8m):
2252 (JSC::X86Assembler::emitUnlinkedJa):
2253 (JSC::X86Assembler::getRelocatedAddress):
2254 (JSC::X86Assembler::getDifferenceBetweenLabels):
2255 (JSC::X86Assembler::emitModRm_opmsib):
2257 2008-09-14 Maciej Stachowiak <mjs@apple.com>
2259 Reviewed by Cameron Zwarich.
2261 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
2263 ~5% speedup on v8 earley-boyer test
2265 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
2266 * API/JSCallbackObjectFunctions.h:
2267 (JSC::::hasInstance): Ditto.
2268 * API/JSValueRef.cpp:
2269 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
2270 * JavaScriptCore.exp:
2272 (JSC::CTI::privateCompileMainPass): Pass along prototype.
2274 (JSC::CodeBlock::dump): Print third arg.
2275 * VM/CodeGenerator.cpp:
2276 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
2277 is a third argument.
2278 * VM/CodeGenerator.h:
2280 (JSC::Machine::privateExecute): Pass along the prototype.
2281 (JSC::Machine::cti_op_instanceof): ditto
2283 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
2286 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
2287 property and pass that register to instanceof.
2290 2008-09-14 Gavin Barraclough <barraclough@apple.com>
2292 Reviewed by Sam Weinig.
2294 Remove unnecessary virtual function call from cti_op_call_JSFunction -
2295 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
2298 (JSC::Machine::cti_op_call_JSFunction):
2300 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2302 Reviewed by Maciej Stachowiak.
2304 Bug 20827: the 'typeof' operator is slow
2305 <https://bugs.webkit.org/show_bug.cgi?id=20827>
2307 Optimize the 'typeof' operator when its result is compared to a constant
2310 This is a 5.5% speedup on the V8 Earley-Boyer test.
2313 (JSC::CTI::privateCompileMainPass):
2315 (JSC::CodeBlock::dump):
2316 * VM/CodeGenerator.cpp:
2317 (JSC::CodeGenerator::emitEqualityOp):
2318 * VM/CodeGenerator.h:
2320 (JSC::jsIsObjectType):
2321 (JSC::jsIsFunctionType):
2322 (JSC::Machine::privateExecute):
2323 (JSC::Machine::cti_op_is_undefined):
2324 (JSC::Machine::cti_op_is_boolean):
2325 (JSC::Machine::cti_op_is_number):
2326 (JSC::Machine::cti_op_is_string):
2327 (JSC::Machine::cti_op_is_object):
2328 (JSC::Machine::cti_op_is_function):
2332 (JSC::BinaryOpNode::emitCode):
2333 (JSC::EqualNode::emitCode):
2334 (JSC::StrictEqualNode::emitCode):
2337 2008-09-14 Sam Weinig <sam@webkit.org>
2339 Reviewed by Cameron Zwarich.
2341 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
2342 Speed up parseInt for numbers
2344 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
2345 No change on the v8 suite.
2347 * kjs/JSGlobalObjectFunctions.cpp:
2348 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
2349 convert them back to numbers.
2351 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2353 Reviewed by Oliver Hunt.
2355 Bug 20816: op_lesseq should be optimized
2356 <https://bugs.webkit.org/show_bug.cgi?id=20816>
2358 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
2360 This is a 9.4% speedup on the V8 Crypto benchmark.
2363 (JSC::CTI::privateCompileMainPass):
2364 (JSC::CTI::privateCompileSlowCases):
2366 (JSC::CodeBlock::dump):
2367 * VM/CodeGenerator.cpp:
2368 (JSC::CodeGenerator::emitJumpIfTrue):
2370 (JSC::Machine::privateExecute):
2371 (JSC::Machine::cti_op_loop_if_lesseq):
2375 2008-09-14 Sam Weinig <sam@webkit.org>
2377 Reviewed by Cameron Zwarich.
2379 Cleanup Sampling code.
2382 (JSC::CTI::emitCall):
2383 (JSC::CTI::privateCompileMainPass):
2385 (JSC::CTI::execute):
2386 * VM/SamplingTool.cpp:
2388 (JSC::SamplingTool::run):
2389 (JSC::SamplingTool::dump):
2390 * VM/SamplingTool.h:
2391 (JSC::SamplingTool::callingHostFunction):
2393 2008-09-13 Oliver Hunt <oliver@apple.com>
2395 Reviewed by Cameron Zwarich.
2397 Bug 20821: Cache property transitions to speed up object initialization
2398 https://bugs.webkit.org/show_bug.cgi?id=20821
2400 Implement a transition cache to improve the performance of new properties
2401 being added to objects. This is extremely beneficial in constructors and
2402 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
2406 (JSC::CTI::privateCompileMainPass):
2408 (JSC::transitionWillNeedStorageRealloc):
2409 (JSC::CTI::privateCompilePutByIdTransition):
2411 (JSC::CTI::compilePutByIdTransition):
2413 (JSC::printPutByIdOp):
2414 (JSC::CodeBlock::printStructureIDs):
2415 (JSC::CodeBlock::dump):
2416 (JSC::CodeBlock::derefStructureIDs):
2417 (JSC::CodeBlock::refStructureIDs):
2418 * VM/CodeGenerator.cpp:
2419 (JSC::CodeGenerator::emitPutById):
2421 (JSC::cachePrototypeChain):
2422 (JSC::Machine::tryCachePutByID):
2423 (JSC::Machine::tryCacheGetByID):
2424 (JSC::Machine::privateExecute):
2425 (JSC::Machine::tryCTICachePutByID):
2426 (JSC::Machine::tryCTICacheGetByID):
2430 (JSC::JSObject::putDirect):
2431 (JSC::JSObject::transitionTo):
2432 * kjs/PutPropertySlot.h:
2433 (JSC::PutPropertySlot::PutPropertySlot):
2434 (JSC::PutPropertySlot::wasTransition):
2435 (JSC::PutPropertySlot::setWasTransition):
2436 * kjs/StructureID.cpp:
2437 (JSC::StructureID::transitionTo):
2438 (JSC::StructureIDChain::StructureIDChain):
2439 * kjs/StructureID.h:
2440 (JSC::StructureID::previousID):
2441 (JSC::StructureID::setCachedPrototypeChain):
2442 (JSC::StructureID::cachedPrototypeChain):
2443 (JSC::StructureID::propertyMap):
2444 * masm/X86Assembler.h:
2445 (JSC::X86Assembler::addl_i8m):
2446 (JSC::X86Assembler::subl_i8m):
2448 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2450 Reviewed by Maciej Stachowiak.
2452 Bug 20819: JSValue::isObject() is slow
2453 <https://bugs.webkit.org/show_bug.cgi?id=20819>
2455 Optimize JSCell::isObject() and JSCell::isString() by making them
2456 non-virtual calls that rely on the StructureID type information.
2458 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
2461 * JavaScriptCore.exp:
2464 (JSC::JSCell::isObject):
2465 (JSC::JSCell::isString):
2470 (JSC::JSString::JSString):
2471 * kjs/StructureID.h:
2472 (JSC::StructureID::type):
2474 2008-09-11 Stephanie Lewis <slewis@apple.com>
2476 Reviewed by Oliver Hunt.
2478 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
2479 crash on CNN and on Dromaeo.
2480 Fix Missing close tag in vcproj.
2482 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2484 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2488 Correct an SVN problem with the last commit and actually add the new
2491 * wrec/CharacterClassConstructor.cpp: Added.
2493 (JSC::getCharacterClassNewline):
2494 (JSC::getCharacterClassDigits):
2495 (JSC::getCharacterClassSpaces):
2496 (JSC::getCharacterClassWordchar):
2497 (JSC::getCharacterClassNondigits):
2498 (JSC::getCharacterClassNonspaces):
2499 (JSC::getCharacterClassNonwordchar):
2500 (JSC::CharacterClassConstructor::addSorted):
2501 (JSC::CharacterClassConstructor::addSortedRange):
2502 (JSC::CharacterClassConstructor::put):
2503 (JSC::CharacterClassConstructor::flush):
2504 (JSC::CharacterClassConstructor::append):
2505 * wrec/CharacterClassConstructor.h: Added.
2506 (JSC::CharacterClassConstructor::CharacterClassConstructor):
2507 (JSC::CharacterClassConstructor::isUpsideDown):
2508 (JSC::CharacterClassConstructor::charClass):
2510 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2512 Reviewed by Maciej Stachowiak.
2514 Bug 20788: Split CharacterClassConstructor into its own file
2515 <https://bugs.webkit.org/show_bug.cgi?id=20788>
2517 Split CharacterClassConstructor into its own file and clean up some
2520 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2521 * JavaScriptCore.xcodeproj/project.pbxproj:
2522 * wrec/CharacterClassConstructor.cpp: Added.
2524 (JSC::getCharacterClassNewline):
2525 (JSC::getCharacterClassDigits):
2526 (JSC::getCharacterClassSpaces):
2527 (JSC::getCharacterClassWordchar):
2528 (JSC::getCharacterClassNondigits):
2529 (JSC::getCharacterClassNonspaces):
2530 (JSC::getCharacterClassNonwordchar):
2531 (JSC::CharacterClassConstructor::addSorted):
2532 (JSC::CharacterClassConstructor::addSortedRange):
2533 (JSC::CharacterClassConstructor::put):
2534 (JSC::CharacterClassConstructor::flush):
2535 (JSC::CharacterClassConstructor::append):
2536 * wrec/CharacterClassConstructor.h: Added.
2537 (JSC::CharacterClassConstructor::CharacterClassConstructor):
2538 (JSC::CharacterClassConstructor::isUpsideDown):
2539 (JSC::CharacterClassConstructor::charClass):
2541 (JSC::WRECParser::parseCharacterClass):
2543 2008-09-10 Simon Hausmann <hausmann@webkit.org>
2545 Not reviewed but trivial one-liner for yet unused macro.
2547 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
2549 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
2553 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2555 Rubber-stamped by Oliver Hunt.
2557 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
2561 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2562 * masm/X86Assembler.h:
2563 (JSC::X86Assembler::orl_i32r):
2565 (JSC::WRECGenerator::generatePatternCharacter):
2566 (JSC::WRECGenerator::generateCharacterClassInverted):
2568 2008-09-10 Sam Weinig <sam@webkit.org>
2570 Reviewed by Geoff Garen.
2572 Add inline property storage for JSObject.
2574 1.2% progression on Sunspider. .5% progression on the v8 test suite.
2576 * JavaScriptCore.exp:
2578 (JSC::CTI::privateCompileGetByIdProto):
2579 (JSC::CTI::privateCompileGetByIdChain):
2581 (JSC::JSObject::mark): There is no reason to check storageSize now that
2583 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
2585 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
2586 now so there is no reason to .get()
2587 (JSC::JSObject::usingInlineStorage):
2588 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
2590 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
2592 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
2593 we know that we are about to add a property that will overflow the inline
2595 * kjs/PropertyMap.cpp:
2596 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
2597 now handled by JSObject.
2598 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
2599 * kjs/PropertyMap.h:
2600 (JSC::PropertyMap::storageSize): Rename from markingCount.
2601 * kjs/StructureID.cpp:
2602 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
2603 if we are using inline storage.
2604 * kjs/StructureID.h:
2606 2008-09-10 Oliver Hunt <oliver@apple.com>
2608 Reviewed by Geoff Garen.
2610 Inline immediate number version of op_mul.
2612 Renamed mull_rr to imull_rr as that's what it's
2613 actually doing, and added imull_i32r for the constant
2614 case immediate multiply.
2616 1.1% improvement to SunSpider.
2619 (JSC::CTI::privateCompileMainPass):
2620 (JSC::CTI::privateCompileSlowCases):
2621 * masm/X86Assembler.h:
2622 (JSC::X86Assembler::):
2623 (JSC::X86Assembler::imull_rr):
2624 (JSC::X86Assembler::imull_i32r):
2626 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2632 * JavaScriptCore.xcodeproj/project.pbxproj:
2634 2008-09-09 Oliver Hunt <oliver@apple.com>
2636 Reviewed by Maciej Stachowiak.
2638 Add optimised access to known properties on the global object.
2640 Improve cross scope access to the global object by emitting
2641 code to access it directly rather than by walking the scope chain.
2643 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
2646 (JSC::CTI::privateCompileMainPass):
2647 (JSC::CTI::emitGetVariableObjectRegister):
2648 (JSC::CTI::emitPutVariableObjectRegister):
2651 (JSC::CodeBlock::dump):
2652 * VM/CodeGenerator.cpp:
2653 (JSC::CodeGenerator::findScopedProperty):
2654 (JSC::CodeGenerator::emitResolve):
2655 (JSC::CodeGenerator::emitGetScopedVar):
2656 (JSC::CodeGenerator::emitPutScopedVar):
2657 * VM/CodeGenerator.h:
2659 (JSC::Machine::privateExecute):
2662 (JSC::FunctionCallResolveNode::emitCode):
2663 (JSC::PostfixResolveNode::emitCode):
2664 (JSC::PrefixResolveNode::emitCode):
2665 (JSC::ReadModifyResolveNode::emitCode):
2666 (JSC::AssignResolveNode::emitCode):
2668 2008-09-10 Maciej Stachowiak <mjs@apple.com>
2672 - enable polymorphic inline caching of properties of primitives
2674 1.012x speedup on SunSpider.
2676 We create special structure IDs for JSString and
2677 JSNumberCell. Unlike normal structure IDs, these cannot hold the
2678 true prototype. Due to JS autoboxing semantics, the prototype used
2679 when looking up string or number properties depends on the lexical
2680 global object of the call site, not the creation site. Thus we
2681 enable StructureIDs to handle this quirk for primitives.
2683 Everything else should be straightforward.
2686 (JSC::CTI::privateCompileGetByIdProto):
2687 (JSC::CTI::privateCompileGetByIdChain):
2689 (JSC::CTI::compileGetByIdProto):
2690 (JSC::CTI::compileGetByIdChain):
2691 * VM/JSPropertyNameIterator.h:
2692 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
2694 (JSC::Machine::Machine):
2695 (JSC::cachePrototypeChain):
2696 (JSC::Machine::tryCachePutByID):
2697 (JSC::Machine::tryCacheGetByID):
2698 (JSC::Machine::privateExecute):
2699 (JSC::Machine::tryCTICachePutByID):
2700 (JSC::Machine::tryCTICacheGetByID):
2701 * kjs/GetterSetter.h:
2702 (JSC::GetterSetter::GetterSetter):
2704 * kjs/JSGlobalData.cpp:
2705 (JSC::JSGlobalData::JSGlobalData):
2706 * kjs/JSGlobalData.h:
2707 * kjs/JSGlobalObject.h:
2708 (JSC::StructureID::prototypeForLookup):
2709 * kjs/JSNumberCell.h:
2710 (JSC::JSNumberCell::JSNumberCell):
2711 (JSC::jsNumberCell):
2713 (JSC::JSObject::prototype):
2717 (JSC::jsOwnedString):
2719 (JSC::JSString::JSString):
2721 (JSC::jsSingleCharacterString):
2722 (JSC::jsSingleCharacterSubstring):
2723 (JSC::jsNontrivialString):
2724 * kjs/SmallStrings.cpp:
2725 (JSC::SmallStrings::createEmptyString):
2726 (JSC::SmallStrings::createSingleCharacterString):
2727 * kjs/StructureID.cpp:
2728 (JSC::StructureID::StructureID):
2729 (JSC::StructureID::addPropertyTransition):
2730 (JSC::StructureID::getterSetterTransition):
2731 (JSC::StructureIDChain::StructureIDChain):
2732 * kjs/StructureID.h:
2733 (JSC::StructureID::create):
2734 (JSC::StructureID::storedPrototype):
2736 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
2738 Reviewed by Sam Weinig.
2740 https://bugs.webkit.org/show_bug.cgi?id=20746
2742 Added WINCE platform macro.
2746 2008-09-09 Sam Weinig <sam@webkit.org>
2748 Reviewed by Mark Rowe.
2750 Remove unnecessary override of getOffset.
2752 Sunspider reports this as a .6% progression.
2754 * JavaScriptCore.exp:
2756 (JSC::JSObject::getDirectLocation):
2757 (JSC::JSObject::getOwnPropertySlotForWrite):
2758 (JSC::JSObject::putDirect):
2759 * kjs/PropertyMap.cpp:
2760 * kjs/PropertyMap.h:
2762 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2764 Reviewed by Maciej Stachowiak.
2766 Bug 20759: Remove MacroAssembler
2767 <https://bugs.webkit.org/show_bug.cgi?id=20759>
2769 Remove MacroAssembler and move its functionality to X86Assembler.
2771 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2772 * JavaScriptCore.xcodeproj/project.pbxproj:
2774 (JSC::CTI::emitGetArg):
2775 (JSC::CTI::emitGetPutArg):
2776 (JSC::CTI::emitPutArg):
2777 (JSC::CTI::emitPutCTIParam):
2778 (JSC::CTI::emitGetCTIParam):
2779 (JSC::CTI::emitPutToCallFrameHeader):
2780 (JSC::CTI::emitGetFromCallFrameHeader):
2781 (JSC::CTI::emitPutResult):
2782 (JSC::CTI::emitDebugExceptionCheck):
2783 (JSC::CTI::emitJumpSlowCaseIfNotImm):
2784 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2785 (JSC::CTI::emitFastArithDeTagImmediate):
2786 (JSC::CTI::emitFastArithReTagImmediate):
2787 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2788 (JSC::CTI::emitFastArithImmToInt):
2789 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2790 (JSC::CTI::emitFastArithIntToImmNoCheck):
2791 (JSC::CTI::compileOpCall):
2792 (JSC::CTI::emitSlowScriptCheck):
2793 (JSC::CTI::privateCompileMainPass):
2794 (JSC::CTI::privateCompileSlowCases):
2795 (JSC::CTI::privateCompile):
2796 (JSC::CTI::privateCompileGetByIdSelf):
2797 (JSC::CTI::privateCompileGetByIdProto):
2798 (JSC::CTI::privateCompileGetByIdChain):
2799 (JSC::CTI::privateCompilePutByIdReplace):
2800 (JSC::CTI::privateArrayLengthTrampoline):
2801 (JSC::CTI::privateStringLengthTrampoline):
2802 (JSC::CTI::compileRegExp):
2804 (JSC::CallRecord::CallRecord):
2805 (JSC::JmpTable::JmpTable):
2806 (JSC::SlowCaseEntry::SlowCaseEntry):
2807 (JSC::CTI::JSRInfo::JSRInfo):
2808 * masm/MacroAssembler.h: Removed.
2809 * masm/MacroAssemblerWin.cpp: Removed.
2810 * masm/X86Assembler.h:
2811 (JSC::X86Assembler::emitConvertToFastCall):
2812 (JSC::X86Assembler::emitRestoreArgumentReference):
2814 (JSC::WRECGenerator::WRECGenerator):
2815 (JSC::WRECParser::WRECParser):
2817 2008-09-09 Sam Weinig <sam@webkit.org>
2819 Reviewed by Cameron Zwarich.
2821 Don't waste the first item in the PropertyStorage.
2823 - Fix typo (makingCount -> markingCount)
2824 - Remove undefined method declaration.
2826 No change on Sunspider.
2829 (JSC::JSObject::mark):
2830 * kjs/PropertyMap.cpp:
2831 (JSC::PropertyMap::put):
2832 (JSC::PropertyMap::remove):
2833 (JSC::PropertyMap::getOffset):
2834 (JSC::PropertyMap::insert):
2835 (JSC::PropertyMap::rehash):
2836 (JSC::PropertyMap::resizePropertyStorage):
2837 (JSC::PropertyMap::checkConsistency):
2838 * kjs/PropertyMap.h:
2839 (JSC::PropertyMap::markingCount): Fix typo.
2841 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2845 Speculative Windows build fix.
2847 * masm/MacroAssemblerWin.cpp:
2848 (JSC::MacroAssembler::emitConvertToFastCall):
2849 (JSC::MacroAssembler::emitRestoreArgumentReference):
2851 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2853 Reviewed by Maciej Stachowiak.
2855 Bug 20755: Create an X86 namespace for register names and other things
2856 <https://bugs.webkit.org/show_bug.cgi?id=20755>
2858 Create an X86 namespace to put X86 register names. Perhaps I will move
2859 opcode names here later as well.
2862 (JSC::CTI::emitGetArg):
2863 (JSC::CTI::emitGetPutArg):
2864 (JSC::CTI::emitPutArg):
2865 (JSC::CTI::emitPutArgConstant):
2866 (JSC::CTI::emitPutCTIParam):
2867 (JSC::CTI::emitGetCTIParam):
2868 (JSC::CTI::emitPutToCallFrameHeader):
2869 (JSC::CTI::emitGetFromCallFrameHeader):
2870 (JSC::CTI::emitPutResult):
2871 (JSC::CTI::emitDebugExceptionCheck):
2872 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2873 (JSC::CTI::compileOpCall):
2874 (JSC::CTI::emitSlowScriptCheck):
2875 (JSC::CTI::privateCompileMainPass):
2876 (JSC::CTI::privateCompileSlowCases):
2877 (JSC::CTI::privateCompile):
2878 (JSC::CTI::privateCompileGetByIdSelf):
2879 (JSC::CTI::privateCompileGetByIdProto):
2880 (JSC::CTI::privateCompileGetByIdChain):
2881 (JSC::CTI::privateCompilePutByIdReplace):
2882 (JSC::CTI::privateArrayLengthTrampoline):
2883 (JSC::CTI::privateStringLengthTrampoline):
2884 (JSC::CTI::compileRegExp):
2886 * masm/X86Assembler.h:
2888 (JSC::X86Assembler::emitModRm_rm):
2889 (JSC::X86Assembler::emitModRm_rm_Unchecked):
2890 (JSC::X86Assembler::emitModRm_rmsib):
2892 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2893 (JSC::WRECGenerator::generateGreedyQuantifier):
2894 (JSC::WRECGenerator::generateParentheses):
2895 (JSC::WRECGenerator::generateBackreference):
2896 (JSC::WRECGenerator::gernerateDisjunction):
2899 2008-09-09 Sam Weinig <sam@webkit.org>
2901 Reviewed by Geoffrey Garen.
2903 Remove unnecessary friend declaration.
2905 * kjs/PropertyMap.h:
2907 2008-09-09 Sam Weinig <sam@webkit.org>
2909 Reviewed by Geoffrey Garen.
2911 Replace uses of PropertyMap::get and PropertyMap::getLocation with
2912 PropertyMap::getOffset.
2914 Sunspider reports this as a .6% improvement.
2916 * JavaScriptCore.exp:
2918 (JSC::JSObject::put):
2919 (JSC::JSObject::deleteProperty):
2920 (JSC::JSObject::getPropertyAttributes):
2922 (JSC::JSObject::getDirect):
2923 (JSC::JSObject::getDirectLocation):
2924 (JSC::JSObject::locationForOffset):
2925 * kjs/PropertyMap.cpp:
2926 (JSC::PropertyMap::remove):
2927 (JSC::PropertyMap::getOffset):
2928 * kjs/PropertyMap.h:
2930 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2932 Reviewed by Sam Weinig.
2934 Bug 20754: Remove emit prefix from assembler opcode methods
2935 <https://bugs.webkit.org/show_bug.cgi?id=20754>
2938 (JSC::CTI::emitGetArg):
2939 (JSC::CTI::emitGetPutArg):
2940 (JSC::CTI::emitPutArg):
2941 (JSC::CTI::emitPutArgConstant):
2942 (JSC::CTI::emitPutCTIParam):
2943 (JSC::CTI::emitGetCTIParam):
2944 (JSC::CTI::emitPutToCallFrameHeader):
2945 (JSC::CTI::emitGetFromCallFrameHeader):
2946 (JSC::CTI::emitPutResult):
2947 (JSC::CTI::emitDebugExceptionCheck):
2948 (JSC::CTI::emitCall):
2949 (JSC::CTI::emitJumpSlowCaseIfNotImm):
2950 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2951 (JSC::CTI::emitFastArithDeTagImmediate):
2952 (JSC::CTI::emitFastArithReTagImmediate):
2953 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2954 (JSC::CTI::emitFastArithImmToInt):
2955 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2956 (JSC::CTI::emitFastArithIntToImmNoCheck):
2957 (JSC::CTI::compileOpCall):
2958 (JSC::CTI::emitSlowScriptCheck):
2959 (JSC::CTI::privateCompileMainPass):
2960 (JSC::CTI::privateCompileSlowCases):
2961 (JSC::CTI::privateCompile):
2962 (JSC::CTI::privateCompileGetByIdSelf):
2963 (JSC::CTI::privateCompileGetByIdProto):
2964 (JSC::CTI::privateCompileGetByIdChain):
2965 (JSC::CTI::privateCompilePutByIdReplace):
2966 (JSC::CTI::privateArrayLengthTrampoline):
2967 (JSC::CTI::privateStringLengthTrampoline):
2968 (JSC::CTI::compileRegExp):
2969 * masm/MacroAssemblerWin.cpp:
2970 (JSC::MacroAssembler::emitConvertToFastCall):
2971 (JSC::MacroAssembler::emitRestoreArgumentReference):
2972 * masm/X86Assembler.h:
2973 (JSC::X86Assembler::pushl_r):
2974 (JSC::X86Assembler::pushl_m):
2975 (JSC::X86Assembler::popl_r):
2976 (JSC::X86Assembler::popl_m):
2977 (JSC::X86Assembler::movl_rr):
2978 (JSC::X86Assembler::addl_rr):
2979 (JSC::X86Assembler::addl_i8r):
2980 (JSC::X86Assembler::addl_i32r):
2981 (JSC::X86Assembler::addl_mr):
2982 (JSC::X86Assembler::andl_rr):
2983 (JSC::X86Assembler::andl_i32r):
2984 (JSC::X86Assembler::cmpl_i8r):
2985 (JSC::X86Assembler::cmpl_rr):
2986 (JSC::X86Assembler::cmpl_rm):
2987 (JSC::X86Assembler::cmpl_i32r):
2988 (JSC::X86Assembler::cmpl_i32m):
2989 (JSC::X86Assembler::cmpw_rm):
2990 (JSC::X86Assembler::orl_rr):
2991 (JSC::X86Assembler::subl_rr):
2992 (JSC::X86Assembler::subl_i8r):
2993 (JSC::X86Assembler::subl_i32r):
2994 (JSC::X86Assembler::subl_mr):
2995 (JSC::X86Assembler::testl_i32r):
2996 (JSC::X86Assembler::testl_rr):
2997 (JSC::X86Assembler::xorl_i8r):
2998 (JSC::X86Assembler::xorl_rr):
2999 (JSC::X86Assembler::sarl_i8r):
3000 (JSC::X86Assembler::sarl_CLr):
3001 (JSC::X86Assembler::shl_i8r):
3002 (JSC::X86Assembler::shll_CLr):
3003 (JSC::X86Assembler::mull_rr):
3004 (JSC::X86Assembler::idivl_r):
3005 (JSC::X86Assembler::cdq):
3006 (JSC::X86Assembler::movl_mr):
3007 (JSC::X86Assembler::movzwl_mr):
3008 (JSC::X86Assembler::movl_rm):
3009 (JSC::X86Assembler::movl_i32r):
3010 (JSC::X86Assembler::movl_i32m):
3011 (JSC::X86Assembler::leal_mr):
3012 (JSC::X86Assembler::ret):
3013 (JSC::X86Assembler::jmp_r):
3014 (JSC::X86Assembler::jmp_m):
3015 (JSC::X86Assembler::call_r):
3017 (JSC::WRECGenerator::generateBacktrack1):
3018 (JSC::WRECGenerator::generateBacktrackBackreference):
3019 (JSC::WRECGenerator::generateBackreferenceQuantifier):
3020 (JSC::WRECGenerator::generateNonGreedyQuantifier):
3021 (JSC::WRECGenerator::generateGreedyQuantifier):
3022 (JSC::WRECGenerator::generatePatternCharacter):
3023 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
3024 (JSC::WRECGenerator::generateCharacterClassInverted):
3025 (JSC::WRECGenerator::generateCharacterClass):
3026 (JSC::WRECGenerator::generateParentheses):
3027 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
3028 (JSC::WRECGenerator::generateAssertionBOL):
3029 (JSC::WRECGenerator::generateAssertionEOL):
3030 (JSC::WRECGenerator::generateAssertionWordBoundary):
3031 (JSC::WRECGenerator::generateBackreference):
3032 (JSC::WRECGenerator::gernerateDisjunction):
3034 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3036 Reviewed by Maciej Stachowiak.
3038 Clean up the WREC code some more.
3041 (JSC::CTI::compileRegExp):
3043 (JSC::getCharacterClassNewline):
3044 (JSC::getCharacterClassDigits):
3045 (JSC::getCharacterClassSpaces):
3046 (JSC::getCharacterClassWordchar):
3047 (JSC::getCharacterClassNondigits):
3048 (JSC::getCharacterClassNonspaces):
3049 (JSC::getCharacterClassNonwordchar):
3050 (JSC::WRECGenerator::generateBacktrack1):
3051 (JSC::WRECGenerator::generateBacktrackBackreference):
3052 (JSC::WRECGenerator::generateBackreferenceQuantifier):
3053 (JSC::WRECGenerator::generateNonGreedyQuantifier):
3054 (JSC::WRECGenerator::generateGreedyQuantifier):
3055 (JSC::WRECGenerator::generatePatternCharacter):
3056 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
3057 (JSC::WRECGenerator::generateCharacterClassInverted):
3058 (JSC::WRECGenerator::generateCharacterClass):
3059 (JSC::WRECGenerator::generateParentheses):
3060 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
3061 (JSC::WRECGenerator::generateAssertionBOL):
3062 (JSC::WRECGenerator::generateAssertionEOL):
3063 (JSC::WRECGenerator::generateAssertionWordBoundary):
3064 (JSC::WRECGenerator::generateBackreference):
3065 (JSC::WRECGenerator::gernerateDisjunction):
3066 (JSC::WRECParser::parseCharacterClass):
3067 (JSC::WRECParser::parseEscape):
3068 (JSC::WRECParser::parseTerm):
3071 2008-09-09 Mark Rowe <mrowe@apple.com>
3073 Build fix, rubber-stamped by Anders Carlsson.
3075 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
3077 * JavaScriptCore.xcodeproj/project.pbxproj:
3079 2008-09-09 Mark Rowe <mrowe@apple.com>
3081 Rubber-stamped by Oliver Hunt.
3083 Fix builds using the "debug" variant.
3085 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
3086 and Release configurations.
3088 * Configurations/JavaScriptCore.xcconfig:
3089 * DerivedSources.make:
3090 * JavaScriptCore.Debug.exp: Removed.
3091 * JavaScriptCore.base.exp: Removed.
3092 * JavaScriptCore.exp: Added.
3093 * JavaScriptCore.xcodeproj/project.pbxproj:
3094 * kjs/identifier.cpp:
3095 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
3096 there is no overhead in Release builds.
3097 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
3099 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
3100 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
3102 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3104 Reviewed by Maciej Stachowiak.
3106 Clean up WREC a bit to bring it closer to our coding style guidelines.
3110 (JSC::getCharacterClass_newline):
3111 (JSC::getCharacterClass_d):
3112 (JSC::getCharacterClass_s):
3113 (JSC::getCharacterClass_w):
3114 (JSC::getCharacterClass_D):
3115 (JSC::getCharacterClass_S):
3116 (JSC::getCharacterClass_W):
3117 (JSC::CharacterClassConstructor::append):
3118 (JSC::WRECGenerator::generateNonGreedyQuantifier):
3119 (JSC::WRECGenerator::generateGreedyQuantifier):
3120 (JSC::WRECGenerator::generateCharacterClassInverted):
3121 (JSC::WRECParser::parseQuantifier):
3122 (JSC::WRECParser::parsePatternCharacterQualifier):
3123 (JSC::WRECParser::parseCharacterClassQuantifier):
3124 (JSC::WRECParser::parseBackreferenceQuantifier):
3126 (JSC::Quantifier::):
3127 (JSC::Quantifier::Quantifier):
3129 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
3131 Reviewed by Alexey Proskuryakov.
3133 Try MIME charset names before trying IANA names
3134 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
3136 * wtf/StringExtras.h: (strcasecmp): Added.
3138 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3140 Reviewed by Mark Rowe.
3142 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
3143 <https://bugs.webkit.org/show_bug.cgi?id=20719>
3144 <rdar://problem/6205787>
3146 Fix a typo in the case-insensitive matching of character patterns.
3149 (JSC::WRECGenerator::generatePatternCharacter):
3151 2008-09-09 Maciej Stachowiak <mjs@apple.com>
3153 Reviewed by Sam Weinig.
3155 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
3157 1.012x speedup on SunSpider.
3159 * kjs/MathObject.cpp:
3160 (JSC::MathObject::getOwnPropertySlot):
3162 (JSC::setUpStaticFunctionSlot):
3164 (JSC::getStaticPropertySlot):
3166 2008-09-08 Sam Weinig <sam@webkit.org>
3168 Reviewed by Maciej Stachowiak and Oliver Hunt.
3170 Split storage of properties out of the PropertyMap and into the JSObject
3171 to allow sharing PropertyMap on the StructureID. In order to get this
3172 function correctly, the StructureID's transition mappings were changed to
3173 transition based on property name and attribute pairs, instead of just
3176 - Removes the single property optimization now that the PropertyMap is shared.
3177 This will be replaced by in-lining some values on the JSObject.
3179 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
3181 * JavaScriptCore.base.exp:
3183 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
3184 (JSC::CTI::privateCompileGetByIdProto): Ditto.
3185 (JSC::CTI::privateCompileGetByIdChain): Ditto.
3186 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
3188 (JSC::JSObject::mark): Mark the PropertyStorage.
3189 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
3190 (JSC::JSObject::deleteProperty): Ditto.
3191 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
3192 (JSC::JSObject::defineSetter): Ditto.
3193 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
3194 (JSC::JSObject::getPropertyNames): Ditto.
3195 (JSC::JSObject::removeDirect): Ditto.
3196 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
3197 (JSC::JSObject::propertyStorage): return the PropertyStorage.
3198 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
3199 (JSC::JSObject::getDirectLocation): Ditto.
3200 (JSC::JSObject::offsetForLocation): Compute location directly.
3201 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
3202 (JSC::JSObject::hasGetterSetterProperties): Ditto.
3203 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
3204 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
3205 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
3206 (JSC::JSObject::getOwnPropertySlot): Ditto.
3207 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
3208 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
3209 (JSC::PropertyMap::checkConsistency):
3210 (JSC::PropertyMap::operator=):
3211 (JSC::PropertyMap::~PropertyMap):
3212 (JSC::PropertyMap::get):
3213 (JSC::PropertyMap::getLocation):
3214 (JSC::PropertyMap::put):
3215 (JSC::PropertyMap::getOffset):
3216 (JSC::PropertyMap::insert):
3217 (JSC::PropertyMap::expand):
3218 (JSC::PropertyMap::rehash):
3219 (JSC::PropertyMap::createTable):
3220 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
3221 (JSC::PropertyMap::remove):
3222 (JSC::PropertyMap::getEnumerablePropertyNames):
3223 * kjs/PropertyMap.h:
3224 (JSC::PropertyMapEntry::PropertyMapEntry):
3225 (JSC::PropertyMap::isEmpty):
3226 (JSC::PropertyMap::size):
3227 (JSC::PropertyMap::makingCount):
3228 (JSC::PropertyMap::PropertyMap):
3230 * kjs/StructureID.cpp:
3231 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
3233 (JSC::StructureID::toDictionaryTransition): Copy the map.
3234 (JSC::StructureID::changePrototypeTransition): Copy the map.
3235 (JSC::StructureID::getterSetterTransition): Copy the map.
3236 (JSC::StructureID::~StructureID):
3237 * kjs/StructureID.h:
3238 (JSC::TransitionTableHash::hash): Custom hash for transition map.
3239 (JSC::TransitionTableHash::equal): Ditto.
3240 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
3241 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
3242 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
3243 (JSC::StructureID::propertyMap): Added.
3245 2008-09-08 Oliver Hunt <oliver@apple.com>
3247 Reviewed by Mark Rowe.
3249 Bug 20694: Slow Script error pops up when running Dromaeo tests
3251 Correct error in timeout logic where execution tick count would
3252 be reset to incorrect value due to incorrect offset and indirection.
3253 Codegen for the slow script dialog was factored out into a separate
3254 method (emitSlowScriptCheck) rather than having multiple copies of
3255 the same code. Also added calls to generate slow script checks
3256 for loop_if_less and loop_if_true opcodes.
3259 (JSC::CTI::emitSlowScriptCheck):
3260 (JSC::CTI::privateCompileMainPass):
3261 (JSC::CTI::privateCompileSlowCases):
3264 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3266 Reviewed by Maciej Stachowiak.
3268 Remove references to the removed WRECompiler class.
3273 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3275 Rubber-stamped by Mark Rowe.
3277 Fix the build with CTI enabled but WREC disabled.
3282 2008-09-08 Dan Bernstein <mitz@apple.com>
3287 (JSC::StatementNode::):
3290 2008-09-08 Kevin McCullough <kmccullough@apple.com>
3294 <rdar://problem/6134407> Breakpoints in for loops, while loops or
3295 conditions without curly braces don't break. (19306)
3296 -Statement Lists already emit debug hooks but conditionals without
3297 brackets are not lists.
3300 (KJS::IfNode::emitCode):
3301 (KJS::IfElseNode::emitCode):
3302 (KJS::DoWhileNode::emitCode):
3303 (KJS::WhileNode::emitCode):
3304 (KJS::ForNode::emitCode):
3305 (KJS::ForInNode::emitCode):
3307 (KJS::StatementNode::):
3310 2008-09-08 Maciej Stachowiak <mjs@apple.com>
3312 Reviewed by Anders Carlsson.
3314 - Cache the code generated for eval to speed up SunSpider and web sites
3315 https://bugs.webkit.org/show_bug.cgi?id=20718
3318 2.29x on date-format-tofte
3320 Lots of real sites seem to get many hits on this cache as well,
3321 including GMail, Google Spreadsheets, Slate and Digg (the last of
3322 these gets over 100 hits on initial page load).
3325 (JSC::EvalCodeCache::get):
3327 (JSC::Machine::callEval):
3328 (JSC::Machine::privateExecute):
3329 (JSC::Machine::cti_op_call_eval):
3332 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3334 Reviewed by Oliver Hunt.
3336 Bug 20711: Change KJS prefix on preprocessor macros to JSC
3337 <https://bugs.webkit.org/show_bug.cgi?id=20711>
3339 * kjs/CommonIdentifiers.cpp:
3340 (JSC::CommonIdentifiers::CommonIdentifiers):
3341 * kjs/CommonIdentifiers.h:
3342 * kjs/PropertySlot.h:
3343 (JSC::PropertySlot::getValue):
3344 (JSC::PropertySlot::putValue):
3345 (JSC::PropertySlot::setValueSlot):
3346 (JSC::PropertySlot::setValue):
3347 (JSC::PropertySlot::setRegisterSlot):
3352 (JSC::ExpressionNode::):
3353 (JSC::StatementNode::):
3355 (JSC::BooleanNode::):
3356 (JSC::NumberNode::):
3357 (JSC::ImmediateNumberNode::):
3358 (JSC::StringNode::):
3359 (JSC::RegExpNode::):
3361 (JSC::ResolveNode::):
3362 (JSC::ElementNode::):
3364 (JSC::PropertyNode::):
3365 (JSC::PropertyListNode::):
3366 (JSC::ObjectLiteralNode::):
3367 (JSC::BracketAccessorNode::):
3368 (JSC::DotAccessorNode::):
3369 (JSC::ArgumentListNode::):
3370 (JSC::ArgumentsNode::):
3371 (JSC::NewExprNode::):
3372 (JSC::EvalFunctionCallNode::):
3373 (JSC::FunctionCallValueNode::):
3374 (JSC::FunctionCallResolveNode::):
3375 (JSC::FunctionCallBracketNode::):
3376 (JSC::FunctionCallDotNode::):
3377 (JSC::PrePostResolveNode::):
3378 (JSC::PostfixResolveNode::):
3379 (JSC::PostfixBracketNode::):
3380 (JSC::PostfixDotNode::):
3381 (JSC::PostfixErrorNode::):
3382 (JSC::DeleteResolveNode::):
3383 (JSC::DeleteBracketNode::):
3384 (JSC::DeleteDotNode::):
3385 (JSC::DeleteValueNode::):
3387 (JSC::TypeOfResolveNode::):
3388 (JSC::TypeOfValueNode::):
3389 (JSC::PrefixResolveNode::):
3390 (JSC::PrefixBracketNode::):
3391 (JSC::PrefixDotNode::):
3392 (JSC::PrefixErrorNode::):
3393 (JSC::UnaryPlusNode::):
3394 (JSC::NegateNode::):
3395 (JSC::BitwiseNotNode::):
3396 (JSC::LogicalNotNode::):
3402 (JSC::LeftShiftNode::):
3403 (JSC::RightShiftNode::):
3404 (JSC::UnsignedRightShiftNode::):
3406 (JSC::GreaterNode::):
3407 (JSC::LessEqNode::):
3408 (JSC::GreaterEqNode::):
3409 (JSC::ThrowableBinaryOpNode::):
3410 (JSC::InstanceOfNode::):
3413 (JSC::NotEqualNode::):
3414 (JSC::StrictEqualNode::):
3415 (JSC::NotStrictEqualNode::):
3416 (JSC::BitAndNode::):
3418 (JSC::BitXOrNode::):
3419 (JSC::LogicalOpNode::):
3420 (JSC::ConditionalNode::):
3421 (JSC::ReadModifyResolveNode::):
3422 (JSC::AssignResolveNode::):
3423 (JSC::ReadModifyBracketNode::):
3424 (JSC::AssignBracketNode::):
3425 (JSC::AssignDotNode::):
3426 (JSC::ReadModifyDotNode::):
3427 (JSC::AssignErrorNode::):
3429 (JSC::VarDeclCommaNode::):
3430 (JSC::ConstDeclNode::):
3431 (JSC::ConstStatementNode::):
3432 (JSC::EmptyStatementNode::):
3433 (JSC::DebuggerStatementNode::):
3434 (JSC::ExprStatementNode::):
3435 (JSC::VarStatementNode::):
3437 (JSC::IfElseNode::):
3438 (JSC::DoWhileNode::):
3441 (JSC::ContinueNode::):
3443 (JSC::ReturnNode::):
3448 (JSC::ParameterNode::):
3450 (JSC::ProgramNode::):
3452 (JSC::FunctionBodyNode::):
3453 (JSC::FuncExprNode::):
3454 (JSC::FuncDeclNode::):
3455 (JSC::CaseClauseNode::):
3456 (JSC::ClauseListNode::):
3457 (JSC::CaseBlockNode::):
3458 (JSC::SwitchNode::):
3460 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3462 Reviewed by Maciej Stachowiak.
3464 Bug 20704: Replace the KJS namespace
3465 <https://bugs.webkit.org/show_bug.cgi?id=20704>
3467 Rename the KJS namespace to JSC. There are still some uses of KJS in
3468 preprocessor macros and comments, but these will also be changed some
3469 time in the near future.
3476 * API/JSCallbackConstructor.cpp:
3477 * API/JSCallbackConstructor.h:
3478 * API/JSCallbackFunction.cpp:
3479 * API/JSCallbackFunction.h:
3480 * API/JSCallbackObject.cpp:
3481 * API/JSCallbackObject.h:
3482 * API/JSCallbackObjectFunctions.h:
3483 * API/JSClassRef.cpp:
3484 (OpaqueJSClass::staticValues):
3485 (OpaqueJSClass::staticFunctions):
3487 * API/JSContextRef.cpp:
3488 * API/JSObjectRef.cpp:
3489 * API/JSProfilerPrivate.cpp:
3490 * API/JSStringRef.cpp:
3491 * API/JSValueRef.cpp:
3493 * API/OpaqueJSString.cpp:
3494 * API/OpaqueJSString.h:
3495 * JavaScriptCore.Debug.exp:
3496 * JavaScriptCore.base.exp:
3502 * VM/CodeGenerator.cpp:
3503 * VM/CodeGenerator.h:
3504 * VM/ExceptionHelpers.cpp:
3505 * VM/ExceptionHelpers.h:
3507 * VM/JSPropertyNameIterator.cpp:
3508 * VM/JSPropertyNameIterator.h:
3516 * VM/RegisterFile.cpp:
3517 * VM/RegisterFile.h:
3520 * VM/SamplingTool.cpp:
3521 * VM/SamplingTool.h:
3522 * VM/SegmentedVector.h:
3525 * kjs/Arguments.cpp:
3527 * kjs/ArrayConstructor.cpp:
3528 * kjs/ArrayConstructor.h:
3529 * kjs/ArrayPrototype.cpp:
3530 * kjs/ArrayPrototype.h:
3531 * kjs/BatchedTransitionOptimizer.h:
3532 * kjs/BooleanConstructor.cpp:
3533 * kjs/BooleanConstructor.h:
3534 * kjs/BooleanObject.cpp:
3535 * kjs/BooleanObject.h:
3536 * kjs/BooleanPrototype.cpp:
3537 * kjs/BooleanPrototype.h:
3541 * kjs/CommonIdentifiers.cpp:
3542 * kjs/CommonIdentifiers.h:
3543 * kjs/ConstructData.cpp:
3544 * kjs/ConstructData.h:
3545 * kjs/DateConstructor.cpp:
3546 * kjs/DateConstructor.h:
3547 * kjs/DateInstance.cpp:
3548 (JSC::DateInstance::msToGregorianDateTime):
3549 * kjs/DateInstance.h:
3552 * kjs/DatePrototype.cpp:
3553 * kjs/DatePrototype.h:
3554 * kjs/DebuggerCallFrame.cpp:
3555 * kjs/DebuggerCallFrame.h:
3558 * kjs/ErrorConstructor.cpp:
3559 * kjs/ErrorConstructor.h:
3560 * kjs/ErrorInstance.cpp:
3561 * kjs/ErrorInstance.h:
3562 * kjs/ErrorPrototype.cpp:
3563 * kjs/ErrorPrototype.h:
3564 * kjs/ExecState.cpp:
3566 * kjs/FunctionConstructor.cpp:
3567 * kjs/FunctionConstructor.h:
3568 * kjs/FunctionPrototype.cpp:
3569 * kjs/FunctionPrototype.h:
3570 * kjs/GetterSetter.cpp:
3571 * kjs/GetterSetter.h:
3572 * kjs/GlobalEvalFunction.cpp:
3573 * kjs/GlobalEvalFunction.h:
3574 * kjs/IndexToNameMap.cpp:
3575 * kjs/IndexToNameMap.h:
3576 * kjs/InitializeThreading.cpp:
3577 * kjs/InitializeThreading.h:
3578 * kjs/InternalFunction.cpp:
3579 * kjs/InternalFunction.h:
3580 (JSC::InternalFunction::InternalFunction):
3581 * kjs/JSActivation.cpp:
3582 * kjs/JSActivation.h:
3587 * kjs/JSFunction.cpp:
3589 (JSC::JSFunction::JSFunction):
3590 * kjs/JSGlobalData.cpp:
3591 (JSC::JSGlobalData::JSGlobalData):
3592 * kjs/JSGlobalData.h:
3593 * kjs/JSGlobalObject.cpp:
3594 * kjs/JSGlobalObject.h:
3595 * kjs/JSGlobalObjectFunctions.cpp:
3596 * kjs/JSGlobalObjectFunctions.h:
3597 * kjs/JSImmediate.cpp:
3598 * kjs/JSImmediate.h:
3601 * kjs/JSNotAnObject.cpp:
3602 * kjs/JSNotAnObject.h:
3603 * kjs/JSNumberCell.cpp:
3604 * kjs/JSNumberCell.h:
3607 * kjs/JSStaticScopeObject.cpp:
3608 * kjs/JSStaticScopeObject.h:
3614 * kjs/JSVariableObject.cpp:
3615 * kjs/JSVariableObject.h:
3616 * kjs/JSWrapperObject.cpp:
3617 * kjs/JSWrapperObject.h:
3618 * kjs/LabelStack.cpp:
3620 * kjs/MathObject.cpp:
3622 * kjs/NativeErrorConstructor.cpp:
3623 * kjs/NativeErrorConstructor.h:
3624 * kjs/NativeErrorPrototype.cpp:
3625 * kjs/NativeErrorPrototype.h:
3627 * kjs/NumberConstructor.cpp:
3628 * kjs/NumberConstructor.h:
3629 * kjs/NumberObject.cpp:
3630 * kjs/NumberObject.h:
3631 * kjs/NumberPrototype.cpp:
3632 * kjs/NumberPrototype.h:
3633 * kjs/ObjectConstructor.cpp:
3634 * kjs/ObjectConstructor.h:
3635 * kjs/ObjectPrototype.cpp:
3636 * kjs/ObjectPrototype.h: