1 2008-09-23 Oliver Hunt <oliver@apple.com>
3 Reviewed by Maciej Stachowiak.
5 Bug 19968: Slow Script at www.huffingtonpost.com
6 <https://bugs.webkit.org/show_bug.cgi?id=19968>
8 Finally found the cause of this accursed issue. It is triggered
9 by synchronous creation of a new global object from JS. The new
10 global object resets the timer state in this execution group's
11 Machine, taking timerCheckCount to 0. Then when JS returns the
12 timerCheckCount is decremented making it non-zero. The next time
13 we execute JS we will start the timeout counter, however the non-zero
14 timeoutCheckCount means we don't reset the timer information. This
15 means that the timeout check is now checking the cumulative time
16 since the creation of the global object rather than the time since
17 JS was last entered. At this point the slow script dialog is guaranteed
18 to eventually be displayed incorrectly unless a page is loaded
19 asynchronously (which will reset everything into a sane state).
21 The fix for this is rather trivial -- the JSGlobalObject constructor
22 should not be resetting the machine timer state.
25 (JSC::Machine::Machine):
26 Now that we can't rely on the GlobalObject initialising the timeout
27 state, we do it in the Machine constructor.
30 (JSC::Machine::stopTimeoutCheck):
31 Add assertions to guard against this happening.
33 * kjs/JSGlobalObject.cpp:
34 (JSC::JSGlobalObject::init):
35 Don't reset the timeout state.
37 2008-09-23 Geoffrey Garen <ggaren@apple.com>
39 Reviewed by Oliver Hunt.
41 Fixed https://bugs.webkit.org/show_bug.cgi?id=21038 | <rdar://problem/6240812>
42 Uncaught exceptions in regex replace callbacks crash webkit
44 This was a combination of two problems:
46 (1) the replace function would continue execution after an exception
49 (2) In some cases, the Machine would return 0 in the case of an exception,
50 despite the fact that a few clients dereference the Machine's return
51 value without first checking for an exception.
54 (JSC::Machine::execute):
56 ^ Return jsNull() instead of 0 in the case of an exception, since some
57 clients depend on using our return value.
59 ^ ASSERT that execution does not continue after an exception has been
60 thrown, to help catch problems like this in the future.
62 * kjs/StringPrototype.cpp:
63 (JSC::stringProtoFuncReplace):
65 ^ Stop execution if an exception has been thrown.
67 2008-09-23 Geoffrey Garen <ggaren@apple.com>
69 Try to fix the windows build.
72 (JSC::CTI::compileOpCall):
73 (JSC::CTI::privateCompileMainPass):
75 2008-09-23 Alp Toker <alp@nuanti.com>
81 2008-09-23 Geoffrey Garen <ggaren@apple.com>
83 Reviewed by Darin Adler.
85 * wtf/Platform.h: Removed duplicate #if.
87 2008-09-23 Geoffrey Garen <ggaren@apple.com>
89 Reviewed by Darin Adler.
91 Changed the layout of the call frame from
93 { header, parameters, locals | constants, temporaries }
97 { parameters, header | locals, constants, temporaries }
99 This simplifies function entry+exit, and enables a number of future
102 13.5% speedup on empty call benchmark for bytecode; 23.6% speedup on
103 empty call benchmark for CTI.
105 SunSpider says no change. SunSpider --v8 says 1% faster.
109 Added a bit of abstraction for calculating whether a register is a
110 constant, since this patch changes that calculation:
111 (JSC::CTI::isConstant):
112 (JSC::CTI::getConstant):
113 (JSC::CTI::emitGetArg):
114 (JSC::CTI::emitGetPutArg):
115 (JSC::CTI::getConstantImmediateNumericArg):
117 Updated for changes to callframe header location:
118 (JSC::CTI::emitPutToCallFrameHeader):
119 (JSC::CTI::emitGetFromCallFrameHeader):
120 (JSC::CTI::printOpcodeOperandTypes):
122 Renamed to spite Oliver:
123 (JSC::CTI::emitInitRegister):
125 Added an abstraction for emitting a call through a register, so that
126 calls through registers generate exception info, too:
127 (JSC::CTI::emitCall):
129 Updated to match the new callframe header layout, and to support calls
130 through registers, which have no destination address:
131 (JSC::CTI::compileOpCall):
132 (JSC::CTI::privateCompileMainPass):
133 (JSC::CTI::privateCompileSlowCases):
134 (JSC::CTI::privateCompile):
139 (JSC::CallRecord::CallRecord):
143 Updated for new register layout:
145 (JSC::CodeBlock::dump):
149 Updated CodeBlock to track slightly different information about the
150 register frame, and tweaked the style of an ASSERT_NOT_REACHED.
151 (JSC::CodeBlock::CodeBlock):
152 (JSC::CodeBlock::getStubInfo):
154 * VM/CodeGenerator.cpp:
156 Added some abstraction around constant register allocation, since this
157 patch changes it, changed codegen to account for the new callframe
158 layout, and added abstraction around register fetching code
159 that used to assume that all local registers lived at negative indices,
160 since vars now live at positive indices:
161 (JSC::CodeGenerator::generate):
162 (JSC::CodeGenerator::addVar):
163 (JSC::CodeGenerator::addGlobalVar):
164 (JSC::CodeGenerator::allocateConstants):
165 (JSC::CodeGenerator::CodeGenerator):
166 (JSC::CodeGenerator::addParameter):
167 (JSC::CodeGenerator::registerFor):
168 (JSC::CodeGenerator::constRegisterFor):
169 (JSC::CodeGenerator::newRegister):
170 (JSC::CodeGenerator::newTemporary):
171 (JSC::CodeGenerator::highestUsedRegister):
172 (JSC::CodeGenerator::addConstant):
174 ASSERT that our caller referenced the registers it passed to us.
175 Otherwise, we might overwrite them with parameters:
176 (JSC::CodeGenerator::emitCall):
177 (JSC::CodeGenerator::emitConstruct):
179 * VM/CodeGenerator.h:
181 Added some abstraction for getting a RegisterID for a given index,
182 since the rules are a little weird:
183 (JSC::CodeGenerator::registerFor):
187 Utility function to transform a machine return PC to a virtual machine
188 return VPC, for the sake of stack unwinding, since both PCs are stored
189 in the same location now:
192 Tweaked to account for new call frame:
193 (JSC::Machine::initializeCallFrame):
195 Tweaked to account for registerOffset supplied by caller:
196 (JSC::slideRegisterWindowForCall):
198 Tweaked to account for new register layout:
199 (JSC::scopeChainForCall):
200 (JSC::Machine::callEval):
201 (JSC::Machine::dumpRegisters):
202 (JSC::Machine::unwindCallFrame):
203 (JSC::Machine::execute):
205 Changed op_call and op_construct to implement the new calling convention:
206 (JSC::Machine::privateExecute):
208 Tweaked to account for the new register layout:
209 (JSC::Machine::retrieveArguments):
210 (JSC::Machine::retrieveCaller):
211 (JSC::Machine::retrieveLastCaller):
212 (JSC::Machine::callFrame):
213 (JSC::Machine::getArgumentsData):
215 Changed CTI call helpers to implement the new calling convention:
216 (JSC::Machine::cti_op_call_JSFunction):
217 (JSC::Machine::cti_op_call_NotJSFunction):
218 (JSC::Machine::cti_op_ret_activation):
219 (JSC::Machine::cti_op_ret_profiler):
220 (JSC::Machine::cti_op_construct_JSConstruct):
221 (JSC::Machine::cti_op_construct_NotJSConstruct):
222 (JSC::Machine::cti_op_call_eval):
228 Renamed op_initialise_locals to op_init, because this opcode
229 doesn't initialize all locals, and it doesn't initialize only locals.
230 Also, to spite Oliver.
234 New call frame enumeration values:
235 (JSC::RegisterFile::):
237 Simplified the calculation of whether a RegisterID is a temporary,
238 since we can no longer assume that all positive non-constant registers
241 (JSC::RegisterID::RegisterID):
242 (JSC::RegisterID::setTemporary):
243 (JSC::RegisterID::isTemporary):
245 Renamed firstArgumentIndex to firstParameterIndex because the assumption
246 that this variable pertained to the actual arguments supplied by the
247 caller caused me to write some buggy code:
249 (JSC::ArgumentsData::ArgumentsData):
250 (JSC::Arguments::Arguments):
251 (JSC::Arguments::fillArgList):
252 (JSC::Arguments::getOwnPropertySlot):
253 (JSC::Arguments::put):
255 Updated for new call frame layout:
256 * kjs/DebuggerCallFrame.cpp:
257 (JSC::DebuggerCallFrame::functionName):
258 (JSC::DebuggerCallFrame::type):
259 * kjs/DebuggerCallFrame.h:
261 Changed the activation object to account for the fact that a call frame
262 header now sits between parameters and local variables. This change
263 requires all variable objects to do their own marking, since they
264 now use their register storage differently:
265 * kjs/JSActivation.cpp:
266 (JSC::JSActivation::mark):
267 (JSC::JSActivation::copyRegisters):
268 (JSC::JSActivation::createArgumentsObject):
269 * kjs/JSActivation.h:
271 Updated global object to use the new interfaces required by the change
272 to JSActivation above:
273 * kjs/JSGlobalObject.cpp:
274 (JSC::JSGlobalObject::reset):
275 (JSC::JSGlobalObject::mark):
276 (JSC::JSGlobalObject::copyGlobalsFrom):
277 (JSC::JSGlobalObject::copyGlobalsTo):
278 * kjs/JSGlobalObject.h:
279 (JSC::JSGlobalObject::addStaticGlobals):
281 Updated static scope object to use the new interfaces required by the
282 change to JSActivation above:
283 * kjs/JSStaticScopeObject.cpp:
284 (JSC::JSStaticScopeObject::mark):
285 (JSC::JSStaticScopeObject::~JSStaticScopeObject):
286 * kjs/JSStaticScopeObject.h:
287 (JSC::JSStaticScopeObject::JSStaticScopeObject):
288 (JSC::JSStaticScopeObject::d):
290 Updated variable object to use the new interfaces required by the
291 change to JSActivation above:
292 * kjs/JSVariableObject.cpp:
293 (JSC::JSVariableObject::copyRegisterArray):
294 (JSC::JSVariableObject::setRegisters):
295 * kjs/JSVariableObject.h:
297 Changed the bit twiddling in symbol table not to assume that all indices
298 are negative, since they can be positive now:
300 (JSC::SymbolTableEntry::SymbolTableEntry):
301 (JSC::SymbolTableEntry::isNull):
302 (JSC::SymbolTableEntry::getIndex):
303 (JSC::SymbolTableEntry::getAttributes):
304 (JSC::SymbolTableEntry::setAttributes):
305 (JSC::SymbolTableEntry::isReadOnly):
306 (JSC::SymbolTableEntry::pack):
307 (JSC::SymbolTableEntry::isValidIndex):
309 Changed call and construct nodes to ref their functions and/or bases,
310 so that emitCall/emitConstruct doesn't overwrite them with parameters.
311 Also, updated for rename to registerFor:
313 (JSC::ResolveNode::emitCode):
314 (JSC::NewExprNode::emitCode):
315 (JSC::EvalFunctionCallNode::emitCode):
316 (JSC::FunctionCallValueNode::emitCode):
317 (JSC::FunctionCallResolveNode::emitCode):
318 (JSC::FunctionCallBracketNode::emitCode):
319 (JSC::FunctionCallDotNode::emitCode):
320 (JSC::PostfixResolveNode::emitCode):
321 (JSC::DeleteResolveNode::emitCode):
322 (JSC::TypeOfResolveNode::emitCode):
323 (JSC::PrefixResolveNode::emitCode):
324 (JSC::ReadModifyResolveNode::emitCode):
325 (JSC::AssignResolveNode::emitCode):
326 (JSC::ConstDeclNode::emitCodeSingle):
327 (JSC::ForInNode::emitCode):
329 Added abstraction for getting exception info out of a call through a
331 * masm/X86Assembler.h:
332 (JSC::X86Assembler::emitCall):
334 Removed duplicate #if:
337 2008-09-23 Kevin McCullough <kmccullough@apple.com>
341 Bug 21030: The JS debugger breaks on the do of a do-while not the while
342 (where the conditional statement is)
343 https://bugs.webkit.org/show_bug.cgi?id=21030
344 Now the statementListEmitCode detects if a do-while node is being
345 emited and emits the debug hook on the last line instead of the first.
347 This change had no effect on sunspider.
350 (JSC::statementListEmitCode):
352 (JSC::StatementNode::isDoWhile):
353 (JSC::DoWhileNode::isDoWhile):
355 2008-09-23 Maciej Stachowiak <mjs@apple.com>
357 Reviewed by Camron Zwarich.
359 - inline the fast case of instanceof
360 https://bugs.webkit.org/show_bug.cgi?id=20818
362 ~2% speedup on EarleyBoyer test.
365 (JSC::CTI::privateCompileMainPass):
366 (JSC::CTI::privateCompileSlowCases):
368 (JSC::Machine::cti_op_instanceof):
370 2008-09-23 Maciej Stachowiak <mjs@apple.com>
372 Reviewed by Cameron Zwarich.
374 - add forgotten slow case logic for !==
377 (JSC::CTI::privateCompileSlowCases):
379 2008-09-23 Maciej Stachowiak <mjs@apple.com>
381 Reviewed by Cameron Zwarich.
383 - inline the fast cases of !==, same as for ===
385 2.9% speedup on EarleyBoyer benchmark
388 (JSC::CTI::compileOpStrictEq): Factored stricteq codegen into this function,
389 and parameterized so it can do the reverse version as well.
390 (JSC::CTI::privateCompileMainPass): Use the above for stricteq and nstricteq.
392 (JSC::CTI::): Declare above stuff.
394 (JSC::Machine::cti_op_nstricteq): Removed fast cases, now handled inline.
396 2008-09-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
398 Reviewed by Oliver Hunt.
400 Bug 20989: Aguments constructor should put 'callee' and 'length' properties in a more efficient way
401 <https://bugs.webkit.org/show_bug.cgi?id=20989>
403 Make special cases for the 'callee' and 'length' properties in the
406 This is somewhere between a 7.8% speedup and a 10% speedup on the V8
407 Raytrace benchmark, depending on whether it is run alone or with the
411 (JSC::ArgumentsData::ArgumentsData):
412 (JSC::Arguments::Arguments):
413 (JSC::Arguments::mark):
414 (JSC::Arguments::getOwnPropertySlot):
415 (JSC::Arguments::put):
416 (JSC::Arguments::deleteProperty):
418 2008-09-23 Maciej Stachowiak <mjs@apple.com>
422 - speed up instanceof some more
423 https://bugs.webkit.org/show_bug.cgi?id=20818
425 ~2% speedup on EarleyBoyer
427 The idea here is to record in the StructureID whether the class
428 needs a special hasInstance or if it can use the normal logic from
431 Based on this I inlined the real work directly into
432 cti_op_instanceof and put the fastest checks up front and the
433 error handling at the end (so it should be fairly straightforward
434 to split off the beginning to be inlined if desired).
436 I only did this for CTI, not the bytecode interpreter.
438 * API/JSCallbackObject.h:
439 (JSC::JSCallbackObject::createStructureID):
442 (JSC::Machine::cti_op_instanceof):
444 (JSC::JSImmediate::isAnyImmediate):
446 (JSC::TypeInfo::overridesHasInstance):
447 (JSC::TypeInfo::flags):
449 2008-09-22 Darin Adler <darin@apple.com>
451 Reviewed by Sam Weinig.
453 - https://bugs.webkit.org/show_bug.cgi?id=21019
454 make FunctionBodyNode::ref/deref fast
456 Speeds up v8-raytrace by 7.2%.
459 (JSC::FunctionBodyNode::FunctionBodyNode): Initialize m_refCount to 0.
461 (JSC::FunctionBodyNode::ref): Call base class ref once, and thereafter use
463 (JSC::FunctionBodyNode::deref): Ditto, but the deref side.
465 2008-09-22 Darin Adler <darin@apple.com>
467 Pointed out by Sam Weinig.
470 (JSC::Arguments::fillArgList): Fix bad copy and paste. Oops!
472 2008-09-22 Darin Adler <darin@apple.com>
474 Reviewed by Cameron Zwarich.
476 - https://bugs.webkit.org/show_bug.cgi?id=20983
477 ArgumentsData should have some room to allocate some extra arguments inline
479 Speeds up v8-raytrace by 5%.
482 (JSC::ArgumentsData::ArgumentsData): Use a fixed buffer if there are 4 or fewer
484 (JSC::Arguments::Arguments): Use a fixed buffer if there are 4 or fewer
486 (JSC::Arguments::~Arguments): Delete the buffer if necessary.
487 (JSC::Arguments::mark): Update since extraArguments are now Register.
488 (JSC::Arguments::fillArgList): Added special case for the only case that's
489 actually used in the practice, when there are no parameters. There are some
490 other special cases in there too, but that's the only one that matters.
491 (JSC::Arguments::getOwnPropertySlot): Updated to use setValueSlot since there's
492 no operation to get you at the JSValue* inside a Register as a "slot".
494 2008-09-22 Sam Weinig <sam@webkit.org>
496 Reviewed by Maciej Stachowiak.
498 Patch for https://bugs.webkit.org/show_bug.cgi?id=21014
499 Speed up for..in by using StructureID to avoid calls to hasProperty
501 Speeds up fasta by 8%.
503 * VM/JSPropertyNameIterator.cpp:
504 (JSC::JSPropertyNameIterator::invalidate):
505 * VM/JSPropertyNameIterator.h:
506 (JSC::JSPropertyNameIterator::next):
507 * kjs/PropertyNameArray.h:
508 (JSC::PropertyNameArrayData::begin):
509 (JSC::PropertyNameArrayData::end):
510 (JSC::PropertyNameArrayData::setCachedStructureID):
511 (JSC::PropertyNameArrayData::cachedStructureID):
512 * kjs/StructureID.cpp:
513 (JSC::StructureID::getEnumerablePropertyNames):
514 (JSC::structureIDChainsAreEqual):
517 2008-09-22 Kelvin Sherlock <ksherlock@gmail.com>
519 Updated and tweaked by Sam Weinig.
521 Reviewed by Geoffrey Garen.
523 Bug 20020: Proposed enhancement to JavaScriptCore API
524 <https://bugs.webkit.org/show_bug.cgi?id=20020>
526 Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp
527 functions to create JavaScript Array, Date, Error, and RegExp objects, respectively.
529 * API/JSObjectRef.cpp: The functions
530 * API/JSObjectRef.h: Function prototype and documentation
531 * JavaScriptCore.exp: Added functions to exported function list
532 * API/tests/testapi.c: Added basic functionality tests.
534 * kjs/DateConstructor.cpp:
535 Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
536 with JSObject* constructDate(ExecState* exec, const ArgList& args).
537 Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function
539 * kjs/DateConstructor.h:
540 added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args)
542 * kjs/ErrorConstructor.cpp:
543 removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args)
545 * kjs/ErrorConstructor.h:
546 added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args)
548 * kjs/RegExpConstructor.cpp:
549 removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args)
551 * kjs/RegExpConstructor.h:
552 added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args)
554 2008-09-22 Matt Lilek <webkit@mattlilek.com>
556 Not reviewed, Windows build fix.
559 * kjs/FunctionPrototype.cpp:
561 2008-09-22 Sam Weinig <sam@webkit.org>
563 Reviewed by Darin Adler.
565 Patch for https://bugs.webkit.org/show_bug.cgi?id=20982
566 Speed up the apply method of functions by special-casing array and 'arguments' objects
568 1% speedup on v8-raytrace.
570 Test: fast/js/function-apply.html
573 (JSC::Arguments::fillArgList):
575 * kjs/FunctionPrototype.cpp:
576 (JSC::functionProtoFuncApply):
578 (JSC::JSArray::fillArgList):
581 2008-09-22 Darin Adler <darin@apple.com>
583 Reviewed by Sam Weinig.
585 - https://bugs.webkit.org/show_bug.cgi?id=20993
586 Array.push/pop need optimized cases for JSArray
588 3% or so speedup on DeltaBlue benchmark.
590 * kjs/ArrayPrototype.cpp:
591 (JSC::arrayProtoFuncPop): Call JSArray::pop when appropriate.
592 (JSC::arrayProtoFuncPush): Call JSArray::push when appropriate.
595 (JSC::JSArray::putSlowCase): Set m_fastAccessCutoff when appropriate, getting
596 us into the fast code path.
597 (JSC::JSArray::pop): Added.
598 (JSC::JSArray::push): Added.
599 * kjs/JSArray.h: Added push and pop.
601 * kjs/operations.cpp:
602 (JSC::throwOutOfMemoryError): Don't inline this. Helps us avoid PIC branches.
604 2008-09-22 Maciej Stachowiak <mjs@apple.com>
606 Reviewed by Cameron Zwarich.
608 - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
610 Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
612 2.2% speedup on EarleyBoyer benchmark.
614 * API/JSCallbackConstructor.cpp:
615 * API/JSCallbackConstructor.h:
616 (JSC::JSCallbackConstructor::createStructureID):
617 * API/JSCallbackFunction.cpp:
618 * API/JSCallbackFunction.h:
619 (JSC::JSCallbackFunction::createStructureID):
620 * API/JSCallbackObject.h:
621 (JSC::JSCallbackObject::createStructureID):
622 * API/JSCallbackObjectFunctions.h:
623 (JSC::::hasInstance):
624 * API/JSValueRef.cpp:
625 (JSValueIsInstanceOfConstructor):
626 * JavaScriptCore.exp:
628 (JSC::Machine::privateExecute):
629 (JSC::Machine::cti_op_instanceof):
630 * kjs/InternalFunction.cpp:
631 * kjs/InternalFunction.h:
632 (JSC::InternalFunction::createStructureID):
636 (JSC::TypeInfo::implementsHasInstance):
638 2008-09-22 Maciej Stachowiak <mjs@apple.com>
640 Reviewed by Dave Hyatt.
642 Based on initial work by Darin Adler.
644 - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
645 - use this to JIT inline code for eq_null and neq_null
646 https://bugs.webkit.org/show_bug.cgi?id=20823
648 0.5% speedup on SunSpider
649 ~4% speedup on Richards benchmark
652 (JSC::CTI::privateCompileMainPass):
654 (JSC::jsTypeStringForValue):
655 (JSC::jsIsObjectType):
656 (JSC::Machine::privateExecute):
657 (JSC::Machine::cti_op_is_undefined):
661 * kjs/StringObjectThatMasqueradesAsUndefined.h:
662 (JSC::StringObjectThatMasqueradesAsUndefined::create):
663 (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
665 (JSC::StructureID::mutableTypeInfo):
667 (JSC::TypeInfo::TypeInfo):
668 (JSC::TypeInfo::masqueradesAsUndefined):
669 * kjs/operations.cpp:
671 * masm/X86Assembler.h:
672 (JSC::X86Assembler::):
673 (JSC::X86Assembler::setne_r):
674 (JSC::X86Assembler::setnz_r):
675 (JSC::X86Assembler::testl_i32m):
677 2008-09-22 Tor Arne Vestbø <tavestbo@trolltech.com>
681 Initialize QCoreApplication in kjs binary/Shell.cpp
683 This allows us to use QCoreApplication::instance() to
684 get the main thread in ThreadingQt.cpp
688 * wtf/ThreadingQt.cpp:
689 (WTF::initializeThreading):
691 2008-09-21 Darin Adler <darin@apple.com>
693 - blind attempt to fix non-all-in-one builds
695 * kjs/JSGlobalObject.cpp: Added includes of Arguments.h and RegExpObject.h.
697 2008-09-21 Darin Adler <darin@apple.com>
701 * kjs/StructureID.cpp:
702 (JSC::StructureID::addPropertyTransition): Use typeInfo().type() instead of m_type.
703 (JSC::StructureID::createCachedPrototypeChain): Ditto.
705 2008-09-21 Maciej Stachowiak <mjs@apple.com>
707 Reviewed by Darin Adler.
709 - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
710 https://bugs.webkit.org/show_bug.cgi?id=20981
712 * JavaScriptCore.exp:
713 * JavaScriptCore.xcodeproj/project.pbxproj:
715 (JSC::CTI::privateCompileMainPass):
716 (JSC::CTI::privateCompilePutByIdTransition):
718 (JSC::jsIsObjectType):
719 (JSC::Machine::Machine):
720 * kjs/AllInOneFile.cpp:
722 (JSC::JSCell::isObject):
723 (JSC::JSCell::isString):
724 * kjs/JSGlobalData.cpp:
725 (JSC::JSGlobalData::JSGlobalData):
726 * kjs/JSGlobalObject.cpp:
727 (JSC::JSGlobalObject::reset):
728 * kjs/JSGlobalObject.h:
729 (JSC::StructureID::prototypeForLookup):
730 * kjs/JSNumberCell.h:
731 (JSC::JSNumberCell::createStructureID):
733 (JSC::JSObject::createInheritorID):
735 (JSC::JSObject::createStructureID):
737 (JSC::JSString::createStructureID):
738 * kjs/NativeErrorConstructor.cpp:
739 (JSC::NativeErrorConstructor::NativeErrorConstructor):
740 * kjs/RegExpConstructor.cpp:
741 * kjs/RegExpMatchesArray.h: Added.
742 (JSC::RegExpMatchesArray::getOwnPropertySlot):
743 (JSC::RegExpMatchesArray::put):
744 (JSC::RegExpMatchesArray::deleteProperty):
745 (JSC::RegExpMatchesArray::getPropertyNames):
746 * kjs/StructureID.cpp:
747 (JSC::StructureID::StructureID):
748 (JSC::StructureID::addPropertyTransition):
749 (JSC::StructureID::toDictionaryTransition):
750 (JSC::StructureID::changePrototypeTransition):
751 (JSC::StructureID::getterSetterTransition):
753 (JSC::StructureID::create):
754 (JSC::StructureID::typeInfo):
755 * kjs/TypeInfo.h: Added.
756 (JSC::TypeInfo::TypeInfo):
757 (JSC::TypeInfo::type):
759 2008-09-21 Darin Adler <darin@apple.com>
761 Reviewed by Cameron Zwarich.
763 - fix crash logging into Gmail due to recent Arguments change
766 (JSC::Arguments::Arguments): Fix window where mark() function could
767 see d->extraArguments with uninitialized contents.
768 (JSC::Arguments::mark): Check d->extraArguments for 0 to handle two
769 cases: 1) Inside the constructor before it's initialized.
770 2) numArguments <= numParameters.
772 2008-09-21 Darin Adler <darin@apple.com>
774 - fix loose end from the "duplicate constant values" patch
776 * VM/CodeGenerator.cpp:
777 (JSC::CodeGenerator::emitLoad): Add a special case for values the
778 hash table can't handle.
780 2008-09-21 Mark Rowe <mrowe@apple.com>
782 Fix the non-AllInOneFile build.
784 * kjs/Arguments.cpp: Add missing #include.
786 2008-09-21 Darin Adler <darin@apple.com>
788 Reviewed by Cameron Zwarich and Mark Rowe.
790 - fix test failure caused by my recent IndexToNameMap patch
793 (JSC::Arguments::deleteProperty): Added the accidentally-omitted
794 check of the boolean result from toArrayIndex.
796 2008-09-21 Darin Adler <darin@apple.com>
798 Reviewed by Maciej Stachowiak.
800 - https://bugs.webkit.org/show_bug.cgi?id=20975
801 inline immediate-number case of ==
803 * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to
804 emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.
806 * VM/CTI.cpp: Updated for new name.
807 (JSC::CTI::privateCompileMainPass): Added op_eq.
808 (JSC::CTI::privateCompileSlowCases): Added op_eq.
811 (JSC::Machine::cti_op_eq): Removed fast case, since it's now
814 2008-09-21 Peter Gal <galpter@inf.u-szeged.hu>
816 Reviewed by Tim Hatcher and Eric Seidel.
818 Fix the QT/Linux JavaScriptCore segmentation fault.
819 https://bugs.webkit.org/show_bug.cgi?id=20914
821 * wtf/ThreadingQt.cpp:
822 (WTF::initializeThreading): Use currentThread() if
823 platform is not a MAC (like in pre 36541 revisions)
825 2008-09-21 Darin Adler <darin@apple.com>
827 Reviewed by Sam Weinig.
829 * kjs/debugger.h: Removed some unneeded includes and declarations.
831 2008-09-21 Darin Adler <darin@apple.com>
833 Reviewed by Sam Weinig.
835 - https://bugs.webkit.org/show_bug.cgi?id=20972
836 speed up Arguments further by eliminating the IndexToNameMap
838 No change on SunSpider. 1.29x as fast on V8 Raytrace.
840 * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the
841 indexToNameMap and hadDeletes data members. Changed extraArguments into
842 an OwnArrayPtr and added deletedArguments, another OwnArrayPtr.
843 Replaced numExtraArguments with numParameters, since that's what's
844 used more directly in hot code paths.
845 (JSC::Arguments::Arguments): Pass in argument count instead of ArgList.
846 Initialize ArgumentsData the new way.
847 (JSC::Arguments::mark): Updated.
848 (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so
849 we don't have to convert integers to identifiers just to get an argument.
850 Integrated the deleted case with the fast case.
851 (JSC::Arguments::put): Ditto.
852 (JSC::Arguments::deleteProperty): Ditto.
854 * kjs/Arguments.h: Minimized includes. Made everything private. Added
855 overloads for the integral property name case. Eliminated mappedIndexSetter.
856 Moved ArgumentsData into the .cpp file.
858 * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
859 * kjs/IndexToNameMap.h: Ditto.
861 * kjs/JSActivation.cpp:
862 (JSC::JSActivation::createArgumentsObject): Elminated ArgList.
865 * JavaScriptCore.pri:
866 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
867 * JavaScriptCore.xcodeproj/project.pbxproj:
868 * JavaScriptCoreSources.bkl:
869 * kjs/AllInOneFile.cpp:
870 Removed IndexToNameMap.
872 2008-09-21 Darin Adler <darin@apple.com>
874 * VM/CodeGenerator.cpp:
875 (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly
878 2008-09-21 Judit Jasz <jasy@inf.u-szeged.hu>
880 Reviewed and tweaked by Darin Adler.
882 - https://bugs.webkit.org/show_bug.cgi?id=20645
883 Elminate duplicate constant values in CodeBlocks.
885 Seems to be a wash on SunSpider.
887 * VM/CodeGenerator.cpp:
888 (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee
889 we emit the same JSValue* for identical numbers and strings.
890 * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&.
891 Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap.
893 (JSC::StringNode::emitCode): Call the new emitLoad and let it do the
896 2008-09-21 Paul Pedriana <webkit@pedriana.com>
898 Reviewed and tweaked by Darin Adler.
900 - https://bugs.webkit.org/show_bug.cgi?id=16925
901 Fixed lack of Vector buffer alignment for both GCC and MSVC.
902 Since there's no portable way to do this, for now we don't support
905 * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer.
906 Use AlignedBuffer insteadof an array of char in VectorBuffer.
908 2008-09-21 Gabor Loki <loki@inf.u-szeged.hu>
910 Reviewed by Darin Adler.
912 - https://bugs.webkit.org/show_bug.cgi?id=19408
913 Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators.
915 1.008x as fast on SunSpider.
918 (makeNegateNode): Fold if expression is a number > 0.
919 (makeBitwiseNotNode): Fold if expression is a number.
920 (makeMultNode): Fold if expressions are both numbers.
921 (makeDivNode): Fold if expressions are both numbers.
922 (makeAddNode): Fold if expressions are both numbers.
923 (makeLeftShiftNode): Fold if expressions are both numbers.
924 (makeRightShiftNode): Fold if expressions are both numbers.
926 2008-09-21 Maciej Stachowiak <mjs@apple.com>
930 - speed up === operator by generating inline machine code for the fast paths
931 https://bugs.webkit.org/show_bug.cgi?id=20820
934 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber):
935 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers):
936 (JSC::CTI::emitJumpSlowCaseIfNotImmediates):
937 (JSC::CTI::emitTagAsBoolImmediate):
938 (JSC::CTI::privateCompileMainPass):
939 (JSC::CTI::privateCompileSlowCases):
942 (JSC::Machine::cti_op_stricteq):
943 * masm/X86Assembler.h:
944 (JSC::X86Assembler::):
945 (JSC::X86Assembler::sete_r):
946 (JSC::X86Assembler::setz_r):
947 (JSC::X86Assembler::movzbl_rr):
948 (JSC::X86Assembler::emitUnlinkedJnz):
950 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
952 Reviewed by Maciej Stachowiak.
954 Free memory allocated for extra arguments in the destructor of the
958 (JSC::Arguments::~Arguments):
961 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
963 Reviewed by Maciej Stachowiak.
965 Bug 20815: 'arguments' object creation is non-optimal
966 <https://bugs.webkit.org/show_bug.cgi?id=20815>
968 Fix our inefficient way of creating the arguments object by only
969 creating named properties for each of the arguments after a use of the
970 'delete' statement. This patch also speeds up access to the 'arguments'
971 object slightly, but it still does not use the array fast path for
972 indexed access that exists for many opcodes.
974 This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5%
975 improvement on the Earley-Boyer benchmark, which gives a 4% improvement
979 (JSC::Arguments::Arguments):
980 (JSC::Arguments::mark):
981 (JSC::Arguments::getOwnPropertySlot):
982 (JSC::Arguments::put):
983 (JSC::Arguments::deleteProperty):
985 (JSC::Arguments::ArgumentsData::ArgumentsData):
986 * kjs/IndexToNameMap.h:
987 (JSC::IndexToNameMap::size):
988 * kjs/JSActivation.cpp:
989 (JSC::JSActivation::createArgumentsObject):
990 * kjs/JSActivation.h:
991 (JSC::JSActivation::uncheckedSymbolTableGet):
992 (JSC::JSActivation::uncheckedSymbolTableGetValue):
993 (JSC::JSActivation::uncheckedSymbolTablePut):
995 (JSC::JSFunction::numParameters):
997 2008-09-20 Darin Adler <darin@apple.com>
999 Reviewed by Mark Rowe.
1001 - fix crash seen on buildbot
1003 * kjs/JSGlobalObject.cpp:
1004 (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype,
1005 deleted by accident in my recent check-in.
1007 2008-09-20 Maciej Stachowiak <mjs@apple.com>
1009 Not reviewed, build fix.
1011 - speculative fix for non-AllInOne builds
1015 2008-09-20 Maciej Stachowiak <mjs@apple.com>
1017 Reviewed by Darin Adler.
1019 - assorted optimizations to === and !== operators
1020 (work towards <https://bugs.webkit.org/show_bug.cgi?id=20820>)
1022 2.5% speedup on earley-boyer test
1025 (JSC::Machine::cti_op_stricteq): Use inline version of
1026 strictEqualSlowCase; remove unneeded exception check.
1027 (JSC::Machine::cti_op_nstricteq): ditto
1028 * kjs/operations.cpp:
1029 (JSC::strictEqual): Use strictEqualSlowCaseInline
1030 (JSC::strictEqualSlowCase): ditto
1032 (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined,
1033 since the extra function call indirection is a lose for CTI.
1035 2008-09-20 Darin Adler <darin@apple.com>
1037 Reviewed by Maciej Stachowiak.
1039 - finish https://bugs.webkit.org/show_bug.cgi?id=20858
1040 make each distinct C++ class get a distinct JSC::Structure
1042 This also includes some optimizations that make the change an overall
1043 small speedup. Without those it was a bit of a slowdown.
1045 * API/JSCallbackConstructor.cpp:
1046 (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
1047 * API/JSCallbackConstructor.h: Ditto.
1048 * API/JSCallbackFunction.cpp:
1049 (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
1050 * API/JSCallbackObject.h: Take a structure.
1051 * API/JSCallbackObjectFunctions.h:
1052 (JSC::JSCallbackObject::JSCallbackObject): Ditto.
1054 * API/JSClassRef.cpp:
1055 (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype
1056 if there's a custom prototype involved.
1057 * API/JSObjectRef.cpp:
1058 (JSObjectMake): Ditto.
1059 (JSObjectMakeConstructor): Pass in a structure.
1061 * JavaScriptCore.exp: Updated.
1064 (JSC::jsLess): Added a special case for when both arguments are strings.
1065 This avoids converting both strings to with UString::toDouble.
1066 (JSC::jsLessEq): Ditto.
1067 (JSC::Machine::privateExecute): Pass in a structure.
1068 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
1069 (JSC::Machine::cti_op_new_regexp): Ditto.
1070 (JSC::Machine::cti_op_is_string): Ditto.
1071 * VM/Machine.h: Made isJSString public so it can be used in the CTI.
1073 * kjs/Arguments.cpp:
1074 (JSC::Arguments::Arguments): Pass in a structure.
1076 * kjs/JSCell.h: Mark constructor explicit.
1078 * kjs/JSGlobalObject.cpp:
1079 (JSC::markIfNeeded): Added an overload for marking structures.
1080 (JSC::JSGlobalObject::reset): Eliminate code to set data members to
1081 zero. We now do that in the constructor, and we no longer use this
1082 anywhere except in the constructor. Added code to create structures.
1083 Pass structures rather than prototypes when creating objects.
1084 (JSC::JSGlobalObject::mark): Mark the structures.
1086 * kjs/JSGlobalObject.h: Removed unneeded class declarations.
1087 Added initializers for raw pointers in JSGlobalObjectData so
1088 everything starts with a 0. Added structure data and accessor
1091 * kjs/JSImmediate.cpp:
1092 (JSC::JSImmediate::nonInlineNaN): Added.
1093 * kjs/JSImmediate.h:
1094 (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
1096 * kjs/JSNumberCell.cpp:
1097 (JSC::jsNumberCell): Made non-inline to avoid PIC branches
1098 in functions that call this one.
1099 (JSC::jsNaN): Ditto.
1100 * kjs/JSNumberCell.h: Ditto.
1102 * kjs/JSObject.h: Removed constructor that takes a prototype.
1103 All callers now pass structures.
1105 * kjs/ArrayConstructor.cpp:
1106 (JSC::ArrayConstructor::ArrayConstructor):
1107 (JSC::constructArrayWithSizeQuirk):
1108 * kjs/ArrayConstructor.h:
1109 * kjs/ArrayPrototype.cpp:
1110 (JSC::ArrayPrototype::ArrayPrototype):
1111 * kjs/ArrayPrototype.h:
1112 * kjs/BooleanConstructor.cpp:
1113 (JSC::BooleanConstructor::BooleanConstructor):
1114 (JSC::constructBoolean):
1115 (JSC::constructBooleanFromImmediateBoolean):
1116 * kjs/BooleanConstructor.h:
1117 * kjs/BooleanObject.cpp:
1118 (JSC::BooleanObject::BooleanObject):
1119 * kjs/BooleanObject.h:
1120 * kjs/BooleanPrototype.cpp:
1121 (JSC::BooleanPrototype::BooleanPrototype):
1122 * kjs/BooleanPrototype.h:
1123 * kjs/DateConstructor.cpp:
1124 (JSC::DateConstructor::DateConstructor):
1125 (JSC::constructDate):
1126 * kjs/DateConstructor.h:
1127 * kjs/DateInstance.cpp:
1128 (JSC::DateInstance::DateInstance):
1129 * kjs/DateInstance.h:
1130 * kjs/DatePrototype.cpp:
1131 (JSC::DatePrototype::DatePrototype):
1132 * kjs/DatePrototype.h:
1133 * kjs/ErrorConstructor.cpp:
1134 (JSC::ErrorConstructor::ErrorConstructor):
1135 (JSC::constructError):
1136 * kjs/ErrorConstructor.h:
1137 * kjs/ErrorInstance.cpp:
1138 (JSC::ErrorInstance::ErrorInstance):
1139 * kjs/ErrorInstance.h:
1140 * kjs/ErrorPrototype.cpp:
1141 (JSC::ErrorPrototype::ErrorPrototype):
1142 * kjs/ErrorPrototype.h:
1143 * kjs/FunctionConstructor.cpp:
1144 (JSC::FunctionConstructor::FunctionConstructor):
1145 * kjs/FunctionConstructor.h:
1146 * kjs/FunctionPrototype.cpp:
1147 (JSC::FunctionPrototype::FunctionPrototype):
1148 (JSC::FunctionPrototype::addFunctionProperties):
1149 * kjs/FunctionPrototype.h:
1150 * kjs/GlobalEvalFunction.cpp:
1151 (JSC::GlobalEvalFunction::GlobalEvalFunction):
1152 * kjs/GlobalEvalFunction.h:
1153 * kjs/InternalFunction.cpp:
1154 (JSC::InternalFunction::InternalFunction):
1155 * kjs/InternalFunction.h:
1156 (JSC::InternalFunction::InternalFunction):
1158 (JSC::JSArray::JSArray):
1159 (JSC::constructEmptyArray):
1160 (JSC::constructArray):
1162 * kjs/JSFunction.cpp:
1163 (JSC::JSFunction::JSFunction):
1164 (JSC::JSFunction::construct):
1166 (JSC::constructEmptyObject):
1168 (JSC::StringObject::create):
1169 * kjs/JSWrapperObject.h:
1170 * kjs/MathObject.cpp:
1171 (JSC::MathObject::MathObject):
1173 * kjs/NativeErrorConstructor.cpp:
1174 (JSC::NativeErrorConstructor::NativeErrorConstructor):
1175 (JSC::NativeErrorConstructor::construct):
1176 * kjs/NativeErrorConstructor.h:
1177 * kjs/NativeErrorPrototype.cpp:
1178 (JSC::NativeErrorPrototype::NativeErrorPrototype):
1179 * kjs/NativeErrorPrototype.h:
1180 * kjs/NumberConstructor.cpp:
1181 (JSC::NumberConstructor::NumberConstructor):
1182 (JSC::constructWithNumberConstructor):
1183 * kjs/NumberConstructor.h:
1184 * kjs/NumberObject.cpp:
1185 (JSC::NumberObject::NumberObject):
1186 (JSC::constructNumber):
1187 (JSC::constructNumberFromImmediateNumber):
1188 * kjs/NumberObject.h:
1189 * kjs/NumberPrototype.cpp:
1190 (JSC::NumberPrototype::NumberPrototype):
1191 * kjs/NumberPrototype.h:
1192 * kjs/ObjectConstructor.cpp:
1193 (JSC::ObjectConstructor::ObjectConstructor):
1194 (JSC::constructObject):
1195 * kjs/ObjectConstructor.h:
1196 * kjs/ObjectPrototype.cpp:
1197 (JSC::ObjectPrototype::ObjectPrototype):
1198 * kjs/ObjectPrototype.h:
1199 * kjs/PrototypeFunction.cpp:
1200 (JSC::PrototypeFunction::PrototypeFunction):
1201 * kjs/PrototypeFunction.h:
1202 * kjs/RegExpConstructor.cpp:
1203 (JSC::RegExpConstructor::RegExpConstructor):
1204 (JSC::RegExpMatchesArray::RegExpMatchesArray):
1205 (JSC::constructRegExp):
1206 * kjs/RegExpConstructor.h:
1207 * kjs/RegExpObject.cpp:
1208 (JSC::RegExpObject::RegExpObject):
1209 * kjs/RegExpObject.h:
1210 * kjs/RegExpPrototype.cpp:
1211 (JSC::RegExpPrototype::RegExpPrototype):
1212 * kjs/RegExpPrototype.h:
1214 (GlobalObject::GlobalObject):
1215 * kjs/StringConstructor.cpp:
1216 (JSC::StringConstructor::StringConstructor):
1217 (JSC::constructWithStringConstructor):
1218 * kjs/StringConstructor.h:
1219 * kjs/StringObject.cpp:
1220 (JSC::StringObject::StringObject):
1221 * kjs/StringObject.h:
1222 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1223 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1224 * kjs/StringPrototype.cpp:
1225 (JSC::StringPrototype::StringPrototype):
1226 * kjs/StringPrototype.h:
1227 Take and pass structures.
1229 2008-09-19 Alp Toker <alp@nuanti.com>
1231 Build fix for the 'gold' linker and recent binutils. New behaviour
1232 requires that we link to used libraries explicitly.
1236 2008-09-19 Sam Weinig <sam@webkit.org>
1238 Roll r36694 back in. It did not cause the crash.
1240 * JavaScriptCore.exp:
1241 * VM/JSPropertyNameIterator.cpp:
1242 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
1243 (JSC::JSPropertyNameIterator::invalidate):
1244 * VM/JSPropertyNameIterator.h:
1245 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1246 (JSC::JSPropertyNameIterator::create):
1248 (JSC::JSObject::getPropertyNames):
1249 * kjs/PropertyMap.cpp:
1250 (JSC::PropertyMap::getEnumerablePropertyNames):
1251 * kjs/PropertyMap.h:
1252 * kjs/PropertyNameArray.cpp:
1253 (JSC::PropertyNameArray::add):
1254 * kjs/PropertyNameArray.h:
1255 (JSC::PropertyNameArrayData::create):
1256 (JSC::PropertyNameArrayData::propertyNameVector):
1257 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
1258 (JSC::PropertyNameArrayData::cachedPrototypeChain):
1259 (JSC::PropertyNameArrayData::begin):
1260 (JSC::PropertyNameArrayData::end):
1261 (JSC::PropertyNameArrayData::PropertyNameArrayData):
1262 (JSC::PropertyNameArray::PropertyNameArray):
1263 (JSC::PropertyNameArray::addKnownUnique):
1264 (JSC::PropertyNameArray::size):
1265 (JSC::PropertyNameArray::operator[]):
1266 (JSC::PropertyNameArray::begin):
1267 (JSC::PropertyNameArray::end):
1268 (JSC::PropertyNameArray::setData):
1269 (JSC::PropertyNameArray::data):
1270 (JSC::PropertyNameArray::releaseData):
1271 * kjs/StructureID.cpp:
1272 (JSC::structureIDChainsAreEqual):
1273 (JSC::StructureID::getEnumerablePropertyNames):
1274 (JSC::StructureID::clearEnumerationCache):
1275 (JSC::StructureID::createCachedPrototypeChain):
1276 * kjs/StructureID.h:
1278 2008-09-19 Sam Weinig <sam@webkit.org>
1282 * JavaScriptCore.exp:
1283 * VM/JSPropertyNameIterator.cpp:
1284 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
1285 (JSC::JSPropertyNameIterator::invalidate):
1286 * VM/JSPropertyNameIterator.h:
1287 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1288 (JSC::JSPropertyNameIterator::create):
1290 (JSC::JSObject::getPropertyNames):
1291 * kjs/PropertyMap.cpp:
1292 (JSC::PropertyMap::getEnumerablePropertyNames):
1293 * kjs/PropertyMap.h:
1294 * kjs/PropertyNameArray.cpp:
1295 (JSC::PropertyNameArray::add):
1296 * kjs/PropertyNameArray.h:
1297 (JSC::PropertyNameArray::PropertyNameArray):
1298 (JSC::PropertyNameArray::addKnownUnique):
1299 (JSC::PropertyNameArray::begin):
1300 (JSC::PropertyNameArray::end):
1301 (JSC::PropertyNameArray::size):
1302 (JSC::PropertyNameArray::operator[]):
1303 (JSC::PropertyNameArray::releaseIdentifiers):
1304 * kjs/StructureID.cpp:
1305 (JSC::StructureID::getEnumerablePropertyNames):
1306 * kjs/StructureID.h:
1307 (JSC::StructureID::clearEnumerationCache):
1309 2008-09-19 Oliver Hunt <oliver@apple.com>
1311 Reviewed by Maciej Stachowiak.
1313 Improve peformance of local variable initialisation.
1315 Pull local and constant initialisation out of slideRegisterWindowForCall
1316 and into its own opcode. This allows the JIT to generate the initialisation
1317 code for a function directly into the instruction stream and so avoids a few
1318 branches on function entry.
1320 Results a 1% progression in SunSpider, particularly in a number of the bitop
1321 tests where the called functions are very fast.
1324 (JSC::CTI::emitInitialiseRegister):
1325 (JSC::CTI::privateCompileMainPass):
1328 (JSC::CodeBlock::dump):
1329 * VM/CodeGenerator.cpp:
1330 (JSC::CodeGenerator::CodeGenerator):
1332 (JSC::slideRegisterWindowForCall):
1333 (JSC::Machine::privateExecute):
1336 2008-09-19 Sam Weinig <sam@webkit.org>
1338 Reviewed by Darin Adler.
1340 Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
1341 Speed up JS property enumeration by caching entire PropertyNameArray
1343 1.3% speedup on Sunspider, 30% on string-fasta.
1345 * JavaScriptCore.exp:
1346 * VM/JSPropertyNameIterator.cpp:
1347 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
1348 (JSC::JSPropertyNameIterator::invalidate):
1349 * VM/JSPropertyNameIterator.h:
1350 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1351 (JSC::JSPropertyNameIterator::create):
1353 (JSC::JSObject::getPropertyNames):
1354 * kjs/PropertyMap.cpp:
1355 (JSC::PropertyMap::getEnumerablePropertyNames):
1356 * kjs/PropertyMap.h:
1357 * kjs/PropertyNameArray.cpp:
1358 (JSC::PropertyNameArray::add):
1359 * kjs/PropertyNameArray.h:
1360 (JSC::PropertyNameArrayData::create):
1361 (JSC::PropertyNameArrayData::propertyNameVector):
1362 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
1363 (JSC::PropertyNameArrayData::cachedPrototypeChain):
1364 (JSC::PropertyNameArrayData::begin):
1365 (JSC::PropertyNameArrayData::end):
1366 (JSC::PropertyNameArrayData::PropertyNameArrayData):
1367 (JSC::PropertyNameArray::PropertyNameArray):
1368 (JSC::PropertyNameArray::addKnownUnique):
1369 (JSC::PropertyNameArray::size):
1370 (JSC::PropertyNameArray::operator[]):
1371 (JSC::PropertyNameArray::begin):
1372 (JSC::PropertyNameArray::end):
1373 (JSC::PropertyNameArray::setData):
1374 (JSC::PropertyNameArray::data):
1375 (JSC::PropertyNameArray::releaseData):
1376 * kjs/ScopeChain.cpp:
1377 (JSC::ScopeChainNode::print):
1378 * kjs/StructureID.cpp:
1379 (JSC::structureIDChainsAreEqual):
1380 (JSC::StructureID::getEnumerablePropertyNames):
1381 (JSC::StructureID::clearEnumerationCache):
1382 (JSC::StructureID::createCachedPrototypeChain):
1383 * kjs/StructureID.h:
1385 2008-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
1387 Reviewed by Maciej Stachowiak.
1389 Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
1392 (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
1394 2008-09-19 Darin Adler <darin@apple.com>
1396 Reviewed by Sam Weinig.
1398 - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
1399 make each distinct C++ class get a distinct JSC::Structure
1401 * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
1403 * kjs/JSGlobalObject.h: Changed the protected constructor to take a
1404 structure instead of a prototype.
1406 * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
1408 2008-09-19 Julien Chaffraix <jchaffraix@pleyo.com>
1410 Reviewed by Alexey Proskuryakov.
1412 Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
1413 non-template methods' code been copied for each instance of the template.
1414 The patch splits RefCounted between a base class that holds non-template methods and attributes
1415 and the template RefCounted class that keeps the same functionnality.
1417 On my Linux with gcc 4.3 for the Gtk port, this is:
1418 - a ~600KB save on libwebkit.so in release.
1419 - a ~1.6MB save on libwebkit.so in debug.
1421 It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
1422 On the whole, it should be a small win as we reduce the compiled code size and the only
1423 new function call should be inlined by the compiler.
1426 (WTF::RefCountedBase::ref): Copied from RefCounted.
1427 (WTF::RefCountedBase::hasOneRef): Ditto.
1428 (WTF::RefCountedBase::refCount): Ditto.
1429 (WTF::RefCountedBase::RefCountedBase): Ditto.
1430 (WTF::RefCountedBase::~RefCountedBase): Ditto.
1431 (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
1433 (WTF::RefCounted::RefCounted):
1434 (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
1435 (WTF::RefCounted::~RefCounted): Keep private destructor.
1437 2008-09-18 Darin Adler <darin@apple.com>
1439 Reviewed by Maciej Stachowiak.
1441 - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
1442 make each distinct C++ class get a distinct JSC::Structure
1444 * kjs/lookup.h: Removed things here that were used only in WebCore:
1445 cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
1446 and JSC_IMPLEMENT_PROTOTYPE.
1448 2008-09-18 Darin Adler <darin@apple.com>
1450 Reviewed by Maciej Stachowiak.
1452 - https://bugs.webkit.org/show_bug.cgi?id=20927
1453 simplify/streamline the code to turn strings into identifiers while parsing
1455 * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
1459 (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
1460 * kjs/lexer.h: Remove makeUString.
1462 * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
1464 * VM/CodeGenerator.cpp:
1465 (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
1466 (JSC::prepareJumpTableForStringSwitch): Ditto.
1468 (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
1469 (JSC::processClauseList): Ditto.
1470 * kjs/nodes2string.cpp:
1471 (JSC::StringNode::streamTo): Ditto.
1473 2008-09-18 Sam Weinig <sam@webkit.org>
1478 (JSC::Instruction::Instruction):
1480 2008-09-18 Oliver Hunt <oliver@apple.com>
1482 Reviewed by Maciej Stachowiak.
1484 Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
1485 <https://bugs.webkit.org/show_bug.cgi?id=20911>
1487 The problem was simply caused by the int constructor for Instruction
1488 failing to initialise the full struct in 64bit builds.
1491 (JSC::Instruction::Instruction):
1493 2008-09-18 Darin Adler <darin@apple.com>
1497 * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
1499 2008-09-18 Darin Adler <darin@apple.com>
1501 Reviewed by Sam Weinig.
1503 * kjs/JSGlobalObject.h: Tiny style guideline tweak.
1505 2008-09-18 Darin Adler <darin@apple.com>
1507 Reviewed by Sam Weinig.
1509 - fix https://bugs.webkit.org/show_bug.cgi?id=20925
1510 LEAK messages appear every time I quit
1512 * JavaScriptCore.exp: Updated, and also added an export
1513 needed for future WebCore use of JSC::StructureID.
1515 * wtf/RefCountedLeakCounter.cpp:
1516 (WTF::RefCountedLeakCounter::suppressMessages): Added.
1517 (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
1518 (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
1519 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
1520 log the reason there was no leak checking done.
1521 (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
1522 (WTF::RefCountedLeakCounter::decrement): Ditto.
1524 * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
1525 new functions, suppressMessages and cancelMessageSuppression. Also
1526 added m_ prefixes to the data member names.
1528 2008-09-18 Holger Hans Peter Freyther <zecke@selfish.org>
1530 Reviewed by Mark Rowe.
1532 https://bugs.webkit.org/show_bug.cgi?id=20437
1534 Add a proper #define to define which XML Parser implementation to use. Client
1535 code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
1536 implementation is going to be used.
1540 2008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1542 Reviewed by Maciej Stachowiak.
1544 Make a Unicode non-breaking space count as a whitespace character in
1545 PCRE. This change was already made in WREC, and it fixes one of the
1546 Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
1547 in a new set of expected test results.
1549 * pcre/pcre_internal.h:
1551 * tests/mozilla/expected.html:
1553 2008-09-18 Stephanie Lewis <slewis@apple.com>
1555 Reviewed by Mark Rowe and Maciej Stachowiak.
1557 add an option use arch to specify which architecture to run.
1559 * tests/mozilla/jsDriver.pl:
1561 2008-09-17 Oliver Hunt <oliver@apple.com>
1563 Correctly restore argument reference prior to SFX runtime calls.
1565 Reviewed by Steve Falkenburg.
1568 (JSC::CTI::privateCompileSlowCases):
1569 (JSC::CTI::privateCompile):
1571 2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1573 Reviewed by Maciej Stachowiak.
1575 Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
1576 <https://bugs.webkit.org/show_bug.cgi?id=20876>
1578 r36417 and r36427 caused an get_by_id opcode to be emitted before the
1579 instanceof and construct opcodes, in order to enable inline caching of
1580 the prototype property. Unfortunately, this regressed some tests dealing
1581 with exceptions thrown by 'instanceof' and the 'new' operator. We fix
1582 these problems by detecting whether an "is not an object" exception is
1583 thrown before op_instanceof or op_construct, and emit the proper
1584 exception in those cases.
1586 * VM/CodeGenerator.cpp:
1587 (JSC::CodeGenerator::emitConstruct):
1588 * VM/CodeGenerator.h:
1589 * VM/ExceptionHelpers.cpp:
1590 (JSC::createInvalidParamError):
1591 (JSC::createNotAConstructorError):
1592 (JSC::createNotAnObjectError):
1593 * VM/ExceptionHelpers.h:
1595 (JSC::Machine::getOpcode):
1596 (JSC::Machine::privateExecute):
1599 (JSC::NewExprNode::emitCode):
1600 (JSC::InstanceOfNode::emitCode):
1602 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1604 Reviewed by Oliver Hunt.
1606 JIT generation cti_op_construct_verify.
1608 Quarter to half percent progression on v8-tests.
1609 Roughly not change on SunSpider (possible minor progression).
1612 (JSC::CTI::privateCompileMainPass):
1616 2008-09-15 Steve Falkenburg <sfalken@apple.com>
1618 Improve timer accuracy for JavaScript Date object on Windows.
1620 Use a combination of ftime and QueryPerformanceCounter.
1621 ftime returns the information we want, but doesn't have sufficient resolution.
1622 QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
1623 To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
1624 QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to
1625 correct for drift if the low-res and high-res elapsed time between calls differs by more
1626 than twice the low-resolution timer resolution.
1628 QueryPerformanceCounter may be inaccurate due to a problems with:
1629 - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
1630 - BIOS bugs (http://support.microsoft.com/kb/895980/)
1631 - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
1633 Reviewed by Darin Adler.
1636 (JSC::highResUpTime):
1637 (JSC::lowResUTCTime):
1638 (JSC::qpcAvailable):
1639 (JSC::getCurrentUTCTimeWithMicroseconds):
1641 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1643 Reviewed by Geoff Garen.
1645 Implement JIT generation of CallFrame initialization, for op_call.
1647 1% sunspider 2.5% v8-tests.
1650 (JSC::CTI::compileOpCall):
1652 (JSC::Machine::cti_op_call_JSFunction):
1653 (JSC::Machine::cti_op_call_NotJSFunction):
1655 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1657 Reviewed by Geoff Garen.
1659 Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code,
1660 move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
1661 functions, instead of checking prior to making the call.
1663 3% on v8-tests (4% on richards, 6% in delta-blue)
1666 (JSC::CTI::compileOpCall):
1667 (JSC::CTI::privateCompileSlowCases):
1668 (JSC::CTI::privateCompile):
1670 (JSC::Machine::execute):
1671 (JSC::Machine::cti_op_call_JSFunction):
1672 (JSC::Machine::cti_vm_compile):
1673 (JSC::Machine::cti_vm_updateScopeChain):
1674 (JSC::Machine::cti_op_construct_JSConstruct):
1677 2008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com>
1679 Fix the QtWebKit/Mac build
1681 * wtf/ThreadingQt.cpp:
1682 (WTF::initializeThreading): use QCoreApplication to get the main thread
1684 2008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1686 Reviewed by Maciej Stachowiak.
1688 Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
1689 <https://bugs.webkit.org/show_bug.cgi?id=20857>
1691 Fix a problem stemming from the slightly unsafe behaviour of the
1692 CodeGenerator::finalDestination() method by putting the "func" argument
1693 of the emitConstruct() method in a RefPtr in its caller. Also, add an
1694 assertion guaranteeing that this is always the case.
1696 CodeGenerator::finalDestination() is still incorrect and can cause
1697 problems with a different allocator; see bug 20340 for more details.
1699 * VM/CodeGenerator.cpp:
1700 (JSC::CodeGenerator::emitConstruct):
1702 (JSC::NewExprNode::emitCode):
1704 2008-09-16 Alice Liu <alice.liu@apple.com>
1709 (JSC::CTI::privateCompileMainPass):
1711 2008-09-16 Gavin Barraclough <barraclough@apple.com>
1713 Reviewed by Geoff Garen.
1715 CTI code generation for op_ret. The majority of the work
1716 (updating variables on the stack & on exec) can be performed
1717 directly in generated code.
1719 We still need to check, & to call out to C-code to handle
1720 activation records, profiling, and full scope chains.
1722 +1.5% Sunspider, +5/6% v8 tests.
1725 (JSC::CTI::emitPutCTIParam):
1726 (JSC::CTI::compileOpCall):
1727 (JSC::CTI::privateCompileMainPass):
1730 (JSC::Machine::cti_op_ret_activation):
1731 (JSC::Machine::cti_op_ret_profiler):
1732 (JSC::Machine::cti_op_ret_scopeChain):
1735 2008-09-16 Dimitri Glazkov <dglazkov@chromium.org>
1737 Fix the Windows build.
1739 Add some extra parentheses to stop MSVC from complaining so much.
1742 (JSC::Machine::privateExecute):
1743 (JSC::Machine::cti_op_stricteq):
1744 (JSC::Machine::cti_op_nstricteq):
1745 * kjs/operations.cpp:
1748 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1750 Reviewed by Cameron Zwarich.
1752 - speed up the === and !== operators by choosing the fast cases better
1754 No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
1757 (JSC::Machine::privateExecute):
1758 (JSC::Machine::cti_op_stricteq):
1759 (JSC::Machine::cti_op_nstricteq):
1760 * kjs/JSImmediate.h:
1761 (JSC::JSImmediate::areBothImmediate):
1762 * kjs/operations.cpp:
1764 (JSC::strictEqualSlowCase):
1767 2008-09-15 Oliver Hunt <oliver@apple.com>
1771 Coding style cleanup.
1774 (JSC::Machine::privateExecute):
1776 2008-09-15 Oliver Hunt <oliver@apple.com>
1778 Reviewed by Cameron Zwarich.
1780 Bug 20874: op_resolve does not do any form of caching
1781 <https://bugs.webkit.org/show_bug.cgi?id=20874>
1783 This patch adds an op_resolve_global opcode to handle (and cache)
1784 property lookup we can statically determine must occur on the global
1787 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
1788 10% in math-partial-sums
1791 (JSC::CTI::privateCompileMainPass):
1794 (JSC::CodeBlock::dump):
1795 * VM/CodeGenerator.cpp:
1796 (JSC::CodeGenerator::findScopedProperty):
1797 (JSC::CodeGenerator::emitResolve):
1799 (JSC::resolveGlobal):
1800 (JSC::Machine::privateExecute):
1801 (JSC::Machine::cti_op_resolve_global):
1805 2008-09-15 Sam Weinig <sam@webkit.org>
1807 Roll out r36462. It broke document.all.
1810 (JSC::CTI::privateCompileMainPass):
1811 (JSC::CTI::privateCompileSlowCases):
1814 (JSC::Machine::Machine):
1815 (JSC::Machine::cti_op_eq_null):
1816 (JSC::Machine::cti_op_neq_null):
1818 (JSC::Machine::isJSString):
1820 * kjs/JSWrapperObject.h:
1821 * kjs/StringObject.h:
1822 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1824 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1826 Reviewed by Maciej Stachowiak.
1828 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
1829 <https://bugs.webkit.org/show_bug.cgi?id=20863>
1831 r36427 changed the number of arguments to op_construct without changing
1832 the argument index for the vPC in the call to initializeCallFrame() in
1833 the CTI case. This caused a JSC test failure. Correcting the argument
1834 index fixes the test failure.
1837 (JSC::Machine::cti_op_construct_JSConstruct):
1839 2008-09-15 Mark Rowe <mrowe@apple.com>
1845 2008-09-15 Geoffrey Garen <ggaren@apple.com>
1847 Reviewed by Maciej Stachowiak.
1849 Fixed a typo in op_get_by_id_chain that caused it to miss every time
1852 Also, a little cleanup.
1855 (JSC::Machine::privateExecute): Set up baseObject before entering the
1856 loop, so we compare against the right values.
1858 2008-09-15 Geoffrey Garen <ggaren@apple.com>
1860 Reviewed by Sam Weinig.
1862 Removed the CalledAsConstructor flag from the call frame header. Now,
1863 we use an explicit opcode at the call site to fix up constructor results.
1865 SunSpider says 0.4% faster.
1867 cti_op_construct_verify is an out-of-line function call for now, but we
1868 can fix that once StructureID holds type information like isObject.
1871 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
1874 (JSC::CodeBlock::dump):
1876 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
1877 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
1878 (JSC::CodeGenerator::emitConstruct): ... ditto.
1880 * VM/Machine.cpp: No more CalledAsConstructor
1881 (JSC::Machine::privateExecute): Implementation for the new opcode.
1882 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
1883 called as a constructor.
1884 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
1887 * VM/Opcode.h: Declare new opcode.
1889 * VM/RegisterFile.h:
1890 (JSC::RegisterFile::): No more CalledAsConstructor
1892 2008-09-15 Gavin Barraclough <barraclough@apple.com>
1894 Reviewed by Geoff Garen.
1896 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
1897 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
1898 masquerading may be handled differently (through the StructureIDs - see bug
1904 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
1905 (JSC::CTI::privateCompileMainPass):
1906 (JSC::CTI::privateCompileSlowCases):
1909 (JSC::Machine::Machine):
1910 (JSC::Machine::cti_op_eq_null):
1911 (JSC::Machine::cti_op_neq_null):
1913 (JSC::Machine::doesMasqueradesAsUndefined):
1914 * kjs/JSWrapperObject.h:
1915 (JSC::JSWrapperObject::):
1916 (JSC::JSWrapperObject::JSWrapperObject):
1917 * kjs/StringObject.h:
1918 (JSC::StringObject::StringObject):
1919 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1920 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1922 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1924 Rubber-stamped by Oliver Hunt.
1926 r36427 broke CodeBlock::dump() by changing the number of arguments to
1927 op_construct without changing the code that prints it. This patch fixes
1928 it by printing the additional argument.
1930 * JavaScriptCore.xcodeproj/project.pbxproj:
1932 (JSC::CodeBlock::dump):
1934 2008-09-15 Adam Roben <aroben@apple.com>
1938 * kjs/StructureID.cpp: Removed a stray semicolon.
1940 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1942 Reviewed by Maciej Stachowiak.
1944 Fix a crash in fast/js/exception-expression-offset.html caused by not
1945 updating all mentions of the length of op_construct in r36427.
1948 (JSC::Machine::cti_op_construct_NotJSConstruct):
1950 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1952 Reviewed by Cameron Zwarich.
1954 - fix layout test failure introduced by fix for 20849
1956 (The failing test was fast/js/delete-then-put.html)
1959 (JSC::JSObject::removeDirect): Clear enumeration cache
1960 in the dictionary case.
1962 (JSC::JSObject::putDirect): Ditto.
1963 * kjs/StructureID.h:
1964 (JSC::StructureID::clearEnumerationCache): Inline to handle the
1967 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1969 Reviewed by Cameron Zwarich.
1971 - fix JSC test failures introduced by fix for 20849
1973 * kjs/PropertyMap.cpp:
1974 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
1976 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1978 Reviewed by Maciej Stachowiak.
1980 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
1981 <https://bugs.webkit.org/show_bug.cgi?id=20851>
1983 r36410 introduced an optimization for parseInt() that is incorrect when
1984 its argument is larger than the range of a 32-bit integer. If the
1985 argument is a number that is not an immediate integer, then the correct
1986 behaviour is to return the floor of its value, unless it is an infinite
1987 value, in which case the correct behaviour is to return 0.
1989 * kjs/JSGlobalObjectFunctions.cpp:
1990 (JSC::globalFuncParseInt):
1992 2008-09-15 Sam Weinig <sam@webkit.org>
1994 Reviewed by Maciej Stachowiak.
1996 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
1997 Cache property names for getEnumerablePropertyNames in the StructureID.
1999 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
2000 on the v8 test suite.
2003 (JSC::JSObject::getPropertyNames):
2004 * kjs/PropertyMap.cpp:
2005 (JSC::PropertyMap::getEnumerablePropertyNames):
2006 * kjs/PropertyMap.h:
2007 * kjs/StructureID.cpp:
2008 (JSC::StructureID::StructureID):
2009 (JSC::StructureID::getEnumerablePropertyNames):
2010 * kjs/StructureID.h:
2012 2008-09-14 Maciej Stachowiak <mjs@apple.com>
2014 Reviewed by Cameron Zwarich.
2016 - speed up JS construction by extracting "prototype" lookup so PIC applies.
2018 ~0.5% speedup on SunSpider
2019 Speeds up some of the V8 tests as well, most notably earley-boyer.
2022 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
2023 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
2024 * VM/CodeGenerator.cpp:
2025 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
2027 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
2028 (JSC::Machine::cti_op_construct_JSConstruct): ditto
2029 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
2031 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
2033 Reviewed by Eric Seidel.
2035 Add a protected destructor for RefCounted.
2037 It is wrong to call its destructor directly, because (1) this should be taken care of by
2038 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
2040 No change in behavior.
2042 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
2044 2008-09-14 Gavin Barraclough <barraclough@apple.com>
2046 Reviewed by Sam Weinig.
2048 Accelerated property accesses.
2050 Inline more of the array access code into the JIT code for get/put_by_val.
2051 Accelerate get/put_by_id by speculatively inlining a disable direct access
2052 into the hot path of the code, and repatch this with the correct StructureID
2053 and property map offset once these are known. In the case of accesses to the
2054 prototype and reading the array-length a trampoline is genertaed, and the
2055 branch to the slow-case is relinked to jump to this.
2057 By repatching, we mean rewriting the x86 instruction stream. Instructions are
2058 only modified in a simple fasion - altering immediate operands, memory access
2059 deisplacements, and branch offsets.
2061 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
2062 instruction's immediate operant is updateded, and a memory access operation's
2063 displacement is updated to access the correct field on the object. In the case
2064 of more complex accesses (array length and get_by_id_prototype) the offset on
2065 the branch to slow-case is updated, to now jump to a trampoline.
2067 +2.8% sunspider, +13% v8-tests
2070 (JSC::CTI::emitCall):
2071 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
2073 (JSC::CTI::privateCompileMainPass):
2074 (JSC::CTI::privateCompileSlowCases):
2075 (JSC::CTI::privateCompile):
2076 (JSC::CTI::privateCompileGetByIdSelf):
2077 (JSC::CTI::privateCompileGetByIdProto):
2078 (JSC::CTI::privateCompileGetByIdChain):
2079 (JSC::CTI::privateCompilePutByIdReplace):
2080 (JSC::CTI::privateCompilePutByIdTransition):
2081 (JSC::CTI::privateCompileArrayLengthTrampoline):
2082 (JSC::CTI::privateCompileStringLengthTrampoline):
2083 (JSC::CTI::patchGetByIdSelf):
2084 (JSC::CTI::patchPutByIdReplace):
2085 (JSC::CTI::privateCompilePatchGetArrayLength):
2086 (JSC::CTI::privateCompilePatchGetStringLength):
2088 (JSC::CTI::compileGetByIdSelf):
2089 (JSC::CTI::compileGetByIdProto):
2090 (JSC::CTI::compileGetByIdChain):
2091 (JSC::CTI::compilePutByIdReplace):
2092 (JSC::CTI::compilePutByIdTransition):
2093 (JSC::CTI::compileArrayLengthTrampoline):
2094 (JSC::CTI::compileStringLengthTrampoline):
2095 (JSC::CTI::compilePatchGetArrayLength):
2096 (JSC::CTI::compilePatchGetStringLength):
2098 (JSC::CodeBlock::dump):
2099 (JSC::CodeBlock::~CodeBlock):
2101 (JSC::StructureStubInfo::StructureStubInfo):
2102 (JSC::CodeBlock::getStubInfo):
2104 (JSC::Machine::tryCTICachePutByID):
2105 (JSC::Machine::tryCTICacheGetByID):
2106 (JSC::Machine::cti_op_put_by_val_array):
2108 * masm/X86Assembler.h:
2109 (JSC::X86Assembler::):
2110 (JSC::X86Assembler::cmpl_i8m):
2111 (JSC::X86Assembler::emitUnlinkedJa):
2112 (JSC::X86Assembler::getRelocatedAddress):
2113 (JSC::X86Assembler::getDifferenceBetweenLabels):
2114 (JSC::X86Assembler::emitModRm_opmsib):
2116 2008-09-14 Maciej Stachowiak <mjs@apple.com>
2118 Reviewed by Cameron Zwarich.
2120 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
2122 ~5% speedup on v8 earley-boyer test
2124 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
2125 * API/JSCallbackObjectFunctions.h:
2126 (JSC::::hasInstance): Ditto.
2127 * API/JSValueRef.cpp:
2128 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
2129 * JavaScriptCore.exp:
2131 (JSC::CTI::privateCompileMainPass): Pass along prototype.
2133 (JSC::CodeBlock::dump): Print third arg.
2134 * VM/CodeGenerator.cpp:
2135 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
2136 is a third argument.
2137 * VM/CodeGenerator.h:
2139 (JSC::Machine::privateExecute): Pass along the prototype.
2140 (JSC::Machine::cti_op_instanceof): ditto
2142 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
2145 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
2146 property and pass that register to instanceof.
2149 2008-09-14 Gavin Barraclough <barraclough@apple.com>
2151 Reviewed by Sam Weinig.
2153 Remove unnecessary virtual function call from cti_op_call_JSFunction -
2154 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
2157 (JSC::Machine::cti_op_call_JSFunction):
2159 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2161 Reviewed by Maciej Stachowiak.
2163 Bug 20827: the 'typeof' operator is slow
2164 <https://bugs.webkit.org/show_bug.cgi?id=20827>
2166 Optimize the 'typeof' operator when its result is compared to a constant
2169 This is a 5.5% speedup on the V8 Earley-Boyer test.
2172 (JSC::CTI::privateCompileMainPass):
2174 (JSC::CodeBlock::dump):
2175 * VM/CodeGenerator.cpp:
2176 (JSC::CodeGenerator::emitEqualityOp):
2177 * VM/CodeGenerator.h:
2179 (JSC::jsIsObjectType):
2180 (JSC::jsIsFunctionType):
2181 (JSC::Machine::privateExecute):
2182 (JSC::Machine::cti_op_is_undefined):
2183 (JSC::Machine::cti_op_is_boolean):
2184 (JSC::Machine::cti_op_is_number):
2185 (JSC::Machine::cti_op_is_string):
2186 (JSC::Machine::cti_op_is_object):
2187 (JSC::Machine::cti_op_is_function):
2191 (JSC::BinaryOpNode::emitCode):
2192 (JSC::EqualNode::emitCode):
2193 (JSC::StrictEqualNode::emitCode):
2196 2008-09-14 Sam Weinig <sam@webkit.org>
2198 Reviewed by Cameron Zwarich.
2200 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
2201 Speed up parseInt for numbers
2203 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
2204 No change on the v8 suite.
2206 * kjs/JSGlobalObjectFunctions.cpp:
2207 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
2208 convert them back to numbers.
2210 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2212 Reviewed by Oliver Hunt.
2214 Bug 20816: op_lesseq should be optimized
2215 <https://bugs.webkit.org/show_bug.cgi?id=20816>
2217 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
2219 This is a 9.4% speedup on the V8 Crypto benchmark.
2222 (JSC::CTI::privateCompileMainPass):
2223 (JSC::CTI::privateCompileSlowCases):
2225 (JSC::CodeBlock::dump):
2226 * VM/CodeGenerator.cpp:
2227 (JSC::CodeGenerator::emitJumpIfTrue):
2229 (JSC::Machine::privateExecute):
2230 (JSC::Machine::cti_op_loop_if_lesseq):
2234 2008-09-14 Sam Weinig <sam@webkit.org>
2236 Reviewed by Cameron Zwarich.
2238 Cleanup Sampling code.
2241 (JSC::CTI::emitCall):
2242 (JSC::CTI::privateCompileMainPass):
2244 (JSC::CTI::execute):
2245 * VM/SamplingTool.cpp:
2247 (JSC::SamplingTool::run):
2248 (JSC::SamplingTool::dump):
2249 * VM/SamplingTool.h:
2250 (JSC::SamplingTool::callingHostFunction):
2252 2008-09-13 Oliver Hunt <oliver@apple.com>
2254 Reviewed by Cameron Zwarich.
2256 Bug 20821: Cache property transitions to speed up object initialization
2257 https://bugs.webkit.org/show_bug.cgi?id=20821
2259 Implement a transition cache to improve the performance of new properties
2260 being added to objects. This is extremely beneficial in constructors and
2261 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
2265 (JSC::CTI::privateCompileMainPass):
2267 (JSC::transitionWillNeedStorageRealloc):
2268 (JSC::CTI::privateCompilePutByIdTransition):
2270 (JSC::CTI::compilePutByIdTransition):
2272 (JSC::printPutByIdOp):
2273 (JSC::CodeBlock::printStructureIDs):
2274 (JSC::CodeBlock::dump):
2275 (JSC::CodeBlock::derefStructureIDs):
2276 (JSC::CodeBlock::refStructureIDs):
2277 * VM/CodeGenerator.cpp:
2278 (JSC::CodeGenerator::emitPutById):
2280 (JSC::cachePrototypeChain):
2281 (JSC::Machine::tryCachePutByID):
2282 (JSC::Machine::tryCacheGetByID):
2283 (JSC::Machine::privateExecute):
2284 (JSC::Machine::tryCTICachePutByID):
2285 (JSC::Machine::tryCTICacheGetByID):
2289 (JSC::JSObject::putDirect):
2290 (JSC::JSObject::transitionTo):
2291 * kjs/PutPropertySlot.h:
2292 (JSC::PutPropertySlot::PutPropertySlot):
2293 (JSC::PutPropertySlot::wasTransition):
2294 (JSC::PutPropertySlot::setWasTransition):
2295 * kjs/StructureID.cpp:
2296 (JSC::StructureID::transitionTo):
2297 (JSC::StructureIDChain::StructureIDChain):
2298 * kjs/StructureID.h:
2299 (JSC::StructureID::previousID):
2300 (JSC::StructureID::setCachedPrototypeChain):
2301 (JSC::StructureID::cachedPrototypeChain):
2302 (JSC::StructureID::propertyMap):
2303 * masm/X86Assembler.h:
2304 (JSC::X86Assembler::addl_i8m):
2305 (JSC::X86Assembler::subl_i8m):
2307 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2309 Reviewed by Maciej Stachowiak.
2311 Bug 20819: JSValue::isObject() is slow
2312 <https://bugs.webkit.org/show_bug.cgi?id=20819>
2314 Optimize JSCell::isObject() and JSCell::isString() by making them
2315 non-virtual calls that rely on the StructureID type information.
2317 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
2320 * JavaScriptCore.exp:
2323 (JSC::JSCell::isObject):
2324 (JSC::JSCell::isString):
2329 (JSC::JSString::JSString):
2330 * kjs/StructureID.h:
2331 (JSC::StructureID::type):
2333 2008-09-11 Stephanie Lewis <slewis@apple.com>
2335 Reviewed by Oliver Hunt.
2337 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
2338 crash on CNN and on Dromaeo.
2339 Fix Missing close tag in vcproj.
2341 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2343 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2347 Correct an SVN problem with the last commit and actually add the new
2350 * wrec/CharacterClassConstructor.cpp: Added.
2352 (JSC::getCharacterClassNewline):
2353 (JSC::getCharacterClassDigits):
2354 (JSC::getCharacterClassSpaces):
2355 (JSC::getCharacterClassWordchar):
2356 (JSC::getCharacterClassNondigits):
2357 (JSC::getCharacterClassNonspaces):
2358 (JSC::getCharacterClassNonwordchar):
2359 (JSC::CharacterClassConstructor::addSorted):
2360 (JSC::CharacterClassConstructor::addSortedRange):
2361 (JSC::CharacterClassConstructor::put):
2362 (JSC::CharacterClassConstructor::flush):
2363 (JSC::CharacterClassConstructor::append):
2364 * wrec/CharacterClassConstructor.h: Added.
2365 (JSC::CharacterClassConstructor::CharacterClassConstructor):
2366 (JSC::CharacterClassConstructor::isUpsideDown):
2367 (JSC::CharacterClassConstructor::charClass):
2369 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2371 Reviewed by Maciej Stachowiak.
2373 Bug 20788: Split CharacterClassConstructor into its own file
2374 <https://bugs.webkit.org/show_bug.cgi?id=20788>
2376 Split CharacterClassConstructor into its own file and clean up some
2379 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2380 * JavaScriptCore.xcodeproj/project.pbxproj:
2381 * wrec/CharacterClassConstructor.cpp: Added.
2383 (JSC::getCharacterClassNewline):
2384 (JSC::getCharacterClassDigits):
2385 (JSC::getCharacterClassSpaces):
2386 (JSC::getCharacterClassWordchar):
2387 (JSC::getCharacterClassNondigits):
2388 (JSC::getCharacterClassNonspaces):
2389 (JSC::getCharacterClassNonwordchar):
2390 (JSC::CharacterClassConstructor::addSorted):
2391 (JSC::CharacterClassConstructor::addSortedRange):
2392 (JSC::CharacterClassConstructor::put):
2393 (JSC::CharacterClassConstructor::flush):
2394 (JSC::CharacterClassConstructor::append):
2395 * wrec/CharacterClassConstructor.h: Added.
2396 (JSC::CharacterClassConstructor::CharacterClassConstructor):
2397 (JSC::CharacterClassConstructor::isUpsideDown):
2398 (JSC::CharacterClassConstructor::charClass):
2400 (JSC::WRECParser::parseCharacterClass):
2402 2008-09-10 Simon Hausmann <hausmann@webkit.org>
2404 Not reviewed but trivial one-liner for yet unused macro.
2406 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
2408 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
2412 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2414 Rubber-stamped by Oliver Hunt.
2416 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
2420 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2421 * masm/X86Assembler.h:
2422 (JSC::X86Assembler::orl_i32r):
2424 (JSC::WRECGenerator::generatePatternCharacter):
2425 (JSC::WRECGenerator::generateCharacterClassInverted):
2427 2008-09-10 Sam Weinig <sam@webkit.org>
2429 Reviewed by Geoff Garen.
2431 Add inline property storage for JSObject.
2433 1.2% progression on Sunspider. .5% progression on the v8 test suite.
2435 * JavaScriptCore.exp:
2437 (JSC::CTI::privateCompileGetByIdProto):
2438 (JSC::CTI::privateCompileGetByIdChain):
2440 (JSC::JSObject::mark): There is no reason to check storageSize now that
2442 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
2444 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
2445 now so there is no reason to .get()
2446 (JSC::JSObject::usingInlineStorage):
2447 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
2449 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
2451 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
2452 we know that we are about to add a property that will overflow the inline
2454 * kjs/PropertyMap.cpp:
2455 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
2456 now handled by JSObject.
2457 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
2458 * kjs/PropertyMap.h:
2459 (JSC::PropertyMap::storageSize): Rename from markingCount.
2460 * kjs/StructureID.cpp:
2461 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
2462 if we are using inline storage.
2463 * kjs/StructureID.h:
2465 2008-09-10 Oliver Hunt <oliver@apple.com>
2467 Reviewed by Geoff Garen.
2469 Inline immediate number version of op_mul.
2471 Renamed mull_rr to imull_rr as that's what it's
2472 actually doing, and added imull_i32r for the constant
2473 case immediate multiply.
2475 1.1% improvement to SunSpider.
2478 (JSC::CTI::privateCompileMainPass):
2479 (JSC::CTI::privateCompileSlowCases):
2480 * masm/X86Assembler.h:
2481 (JSC::X86Assembler::):
2482 (JSC::X86Assembler::imull_rr):
2483 (JSC::X86Assembler::imull_i32r):
2485 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2491 * JavaScriptCore.xcodeproj/project.pbxproj:
2493 2008-09-09 Oliver Hunt <oliver@apple.com>
2495 Reviewed by Maciej Stachowiak.
2497 Add optimised access to known properties on the global object.
2499 Improve cross scope access to the global object by emitting
2500 code to access it directly rather than by walking the scope chain.
2502 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
2505 (JSC::CTI::privateCompileMainPass):
2506 (JSC::CTI::emitGetVariableObjectRegister):
2507 (JSC::CTI::emitPutVariableObjectRegister):
2510 (JSC::CodeBlock::dump):
2511 * VM/CodeGenerator.cpp:
2512 (JSC::CodeGenerator::findScopedProperty):
2513 (JSC::CodeGenerator::emitResolve):
2514 (JSC::CodeGenerator::emitGetScopedVar):
2515 (JSC::CodeGenerator::emitPutScopedVar):
2516 * VM/CodeGenerator.h:
2518 (JSC::Machine::privateExecute):
2521 (JSC::FunctionCallResolveNode::emitCode):
2522 (JSC::PostfixResolveNode::emitCode):
2523 (JSC::PrefixResolveNode::emitCode):
2524 (JSC::ReadModifyResolveNode::emitCode):
2525 (JSC::AssignResolveNode::emitCode):
2527 2008-09-10 Maciej Stachowiak <mjs@apple.com>
2531 - enable polymorphic inline caching of properties of primitives
2533 1.012x speedup on SunSpider.
2535 We create special structure IDs for JSString and
2536 JSNumberCell. Unlike normal structure IDs, these cannot hold the
2537 true prototype. Due to JS autoboxing semantics, the prototype used
2538 when looking up string or number properties depends on the lexical
2539 global object of the call site, not the creation site. Thus we
2540 enable StructureIDs to handle this quirk for primitives.
2542 Everything else should be straightforward.
2545 (JSC::CTI::privateCompileGetByIdProto):
2546 (JSC::CTI::privateCompileGetByIdChain):
2548 (JSC::CTI::compileGetByIdProto):
2549 (JSC::CTI::compileGetByIdChain):
2550 * VM/JSPropertyNameIterator.h:
2551 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
2553 (JSC::Machine::Machine):
2554 (JSC::cachePrototypeChain):
2555 (JSC::Machine::tryCachePutByID):
2556 (JSC::Machine::tryCacheGetByID):
2557 (JSC::Machine::privateExecute):
2558 (JSC::Machine::tryCTICachePutByID):
2559 (JSC::Machine::tryCTICacheGetByID):
2560 * kjs/GetterSetter.h:
2561 (JSC::GetterSetter::GetterSetter):
2563 * kjs/JSGlobalData.cpp:
2564 (JSC::JSGlobalData::JSGlobalData):
2565 * kjs/JSGlobalData.h:
2566 * kjs/JSGlobalObject.h:
2567 (JSC::StructureID::prototypeForLookup):
2568 * kjs/JSNumberCell.h:
2569 (JSC::JSNumberCell::JSNumberCell):
2570 (JSC::jsNumberCell):
2572 (JSC::JSObject::prototype):
2576 (JSC::jsOwnedString):
2578 (JSC::JSString::JSString):
2580 (JSC::jsSingleCharacterString):
2581 (JSC::jsSingleCharacterSubstring):
2582 (JSC::jsNontrivialString):
2583 * kjs/SmallStrings.cpp:
2584 (JSC::SmallStrings::createEmptyString):
2585 (JSC::SmallStrings::createSingleCharacterString):
2586 * kjs/StructureID.cpp:
2587 (JSC::StructureID::StructureID):
2588 (JSC::StructureID::addPropertyTransition):
2589 (JSC::StructureID::getterSetterTransition):
2590 (JSC::StructureIDChain::StructureIDChain):
2591 * kjs/StructureID.h:
2592 (JSC::StructureID::create):
2593 (JSC::StructureID::storedPrototype):
2595 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
2597 Reviewed by Sam Weinig.
2599 https://bugs.webkit.org/show_bug.cgi?id=20746
2601 Added WINCE platform macro.
2605 2008-09-09 Sam Weinig <sam@webkit.org>
2607 Reviewed by Mark Rowe.
2609 Remove unnecessary override of getOffset.
2611 Sunspider reports this as a .6% progression.
2613 * JavaScriptCore.exp:
2615 (JSC::JSObject::getDirectLocation):
2616 (JSC::JSObject::getOwnPropertySlotForWrite):
2617 (JSC::JSObject::putDirect):
2618 * kjs/PropertyMap.cpp:
2619 * kjs/PropertyMap.h:
2621 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2623 Reviewed by Maciej Stachowiak.
2625 Bug 20759: Remove MacroAssembler
2626 <https://bugs.webkit.org/show_bug.cgi?id=20759>
2628 Remove MacroAssembler and move its functionality to X86Assembler.
2630 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2631 * JavaScriptCore.xcodeproj/project.pbxproj:
2633 (JSC::CTI::emitGetArg):
2634 (JSC::CTI::emitGetPutArg):
2635 (JSC::CTI::emitPutArg):
2636 (JSC::CTI::emitPutCTIParam):
2637 (JSC::CTI::emitGetCTIParam):
2638 (JSC::CTI::emitPutToCallFrameHeader):
2639 (JSC::CTI::emitGetFromCallFrameHeader):
2640 (JSC::CTI::emitPutResult):
2641 (JSC::CTI::emitDebugExceptionCheck):
2642 (JSC::CTI::emitJumpSlowCaseIfNotImm):
2643 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2644 (JSC::CTI::emitFastArithDeTagImmediate):
2645 (JSC::CTI::emitFastArithReTagImmediate):
2646 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2647 (JSC::CTI::emitFastArithImmToInt):
2648 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2649 (JSC::CTI::emitFastArithIntToImmNoCheck):
2650 (JSC::CTI::compileOpCall):
2651 (JSC::CTI::emitSlowScriptCheck):
2652 (JSC::CTI::privateCompileMainPass):
2653 (JSC::CTI::privateCompileSlowCases):
2654 (JSC::CTI::privateCompile):
2655 (JSC::CTI::privateCompileGetByIdSelf):
2656 (JSC::CTI::privateCompileGetByIdProto):
2657 (JSC::CTI::privateCompileGetByIdChain):
2658 (JSC::CTI::privateCompilePutByIdReplace):
2659 (JSC::CTI::privateArrayLengthTrampoline):
2660 (JSC::CTI::privateStringLengthTrampoline):
2661 (JSC::CTI::compileRegExp):
2663 (JSC::CallRecord::CallRecord):
2664 (JSC::JmpTable::JmpTable):
2665 (JSC::SlowCaseEntry::SlowCaseEntry):
2666 (JSC::CTI::JSRInfo::JSRInfo):
2667 * masm/MacroAssembler.h: Removed.
2668 * masm/MacroAssemblerWin.cpp: Removed.
2669 * masm/X86Assembler.h:
2670 (JSC::X86Assembler::emitConvertToFastCall):
2671 (JSC::X86Assembler::emitRestoreArgumentReference):
2673 (JSC::WRECGenerator::WRECGenerator):
2674 (JSC::WRECParser::WRECParser):
2676 2008-09-09 Sam Weinig <sam@webkit.org>
2678 Reviewed by Cameron Zwarich.
2680 Don't waste the first item in the PropertyStorage.
2682 - Fix typo (makingCount -> markingCount)
2683 - Remove undefined method declaration.
2685 No change on Sunspider.
2688 (JSC::JSObject::mark):
2689 * kjs/PropertyMap.cpp:
2690 (JSC::PropertyMap::put):
2691 (JSC::PropertyMap::remove):
2692 (JSC::PropertyMap::getOffset):
2693 (JSC::PropertyMap::insert):
2694 (JSC::PropertyMap::rehash):
2695 (JSC::PropertyMap::resizePropertyStorage):
2696 (JSC::PropertyMap::checkConsistency):
2697 * kjs/PropertyMap.h:
2698 (JSC::PropertyMap::markingCount): Fix typo.
2700 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2704 Speculative Windows build fix.
2706 * masm/MacroAssemblerWin.cpp:
2707 (JSC::MacroAssembler::emitConvertToFastCall):
2708 (JSC::MacroAssembler::emitRestoreArgumentReference):
2710 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2712 Reviewed by Maciej Stachowiak.
2714 Bug 20755: Create an X86 namespace for register names and other things
2715 <https://bugs.webkit.org/show_bug.cgi?id=20755>
2717 Create an X86 namespace to put X86 register names. Perhaps I will move
2718 opcode names here later as well.
2721 (JSC::CTI::emitGetArg):
2722 (JSC::CTI::emitGetPutArg):
2723 (JSC::CTI::emitPutArg):
2724 (JSC::CTI::emitPutArgConstant):
2725 (JSC::CTI::emitPutCTIParam):
2726 (JSC::CTI::emitGetCTIParam):
2727 (JSC::CTI::emitPutToCallFrameHeader):
2728 (JSC::CTI::emitGetFromCallFrameHeader):
2729 (JSC::CTI::emitPutResult):
2730 (JSC::CTI::emitDebugExceptionCheck):
2731 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2732 (JSC::CTI::compileOpCall):
2733 (JSC::CTI::emitSlowScriptCheck):
2734 (JSC::CTI::privateCompileMainPass):
2735 (JSC::CTI::privateCompileSlowCases):
2736 (JSC::CTI::privateCompile):
2737 (JSC::CTI::privateCompileGetByIdSelf):
2738 (JSC::CTI::privateCompileGetByIdProto):
2739 (JSC::CTI::privateCompileGetByIdChain):
2740 (JSC::CTI::privateCompilePutByIdReplace):
2741 (JSC::CTI::privateArrayLengthTrampoline):
2742 (JSC::CTI::privateStringLengthTrampoline):
2743 (JSC::CTI::compileRegExp):
2745 * masm/X86Assembler.h:
2747 (JSC::X86Assembler::emitModRm_rm):
2748 (JSC::X86Assembler::emitModRm_rm_Unchecked):
2749 (JSC::X86Assembler::emitModRm_rmsib):
2751 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2752 (JSC::WRECGenerator::generateGreedyQuantifier):
2753 (JSC::WRECGenerator::generateParentheses):
2754 (JSC::WRECGenerator::generateBackreference):
2755 (JSC::WRECGenerator::gernerateDisjunction):
2758 2008-09-09 Sam Weinig <sam@webkit.org>
2760 Reviewed by Geoffrey Garen.
2762 Remove unnecessary friend declaration.
2764 * kjs/PropertyMap.h:
2766 2008-09-09 Sam Weinig <sam@webkit.org>
2768 Reviewed by Geoffrey Garen.
2770 Replace uses of PropertyMap::get and PropertyMap::getLocation with
2771 PropertyMap::getOffset.
2773 Sunspider reports this as a .6% improvement.
2775 * JavaScriptCore.exp:
2777 (JSC::JSObject::put):
2778 (JSC::JSObject::deleteProperty):
2779 (JSC::JSObject::getPropertyAttributes):
2781 (JSC::JSObject::getDirect):
2782 (JSC::JSObject::getDirectLocation):
2783 (JSC::JSObject::locationForOffset):
2784 * kjs/PropertyMap.cpp:
2785 (JSC::PropertyMap::remove):
2786 (JSC::PropertyMap::getOffset):
2787 * kjs/PropertyMap.h:
2789 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2791 Reviewed by Sam Weinig.
2793 Bug 20754: Remove emit prefix from assembler opcode methods
2794 <https://bugs.webkit.org/show_bug.cgi?id=20754>
2797 (JSC::CTI::emitGetArg):
2798 (JSC::CTI::emitGetPutArg):
2799 (JSC::CTI::emitPutArg):
2800 (JSC::CTI::emitPutArgConstant):
2801 (JSC::CTI::emitPutCTIParam):
2802 (JSC::CTI::emitGetCTIParam):
2803 (JSC::CTI::emitPutToCallFrameHeader):
2804 (JSC::CTI::emitGetFromCallFrameHeader):
2805 (JSC::CTI::emitPutResult):
2806 (JSC::CTI::emitDebugExceptionCheck):
2807 (JSC::CTI::emitCall):
2808 (JSC::CTI::emitJumpSlowCaseIfNotImm):
2809 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2810 (JSC::CTI::emitFastArithDeTagImmediate):
2811 (JSC::CTI::emitFastArithReTagImmediate):
2812 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2813 (JSC::CTI::emitFastArithImmToInt):
2814 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2815 (JSC::CTI::emitFastArithIntToImmNoCheck):
2816 (JSC::CTI::compileOpCall):
2817 (JSC::CTI::emitSlowScriptCheck):
2818 (JSC::CTI::privateCompileMainPass):
2819 (JSC::CTI::privateCompileSlowCases):
2820 (JSC::CTI::privateCompile):
2821 (JSC::CTI::privateCompileGetByIdSelf):
2822 (JSC::CTI::privateCompileGetByIdProto):
2823 (JSC::CTI::privateCompileGetByIdChain):
2824 (JSC::CTI::privateCompilePutByIdReplace):
2825 (JSC::CTI::privateArrayLengthTrampoline):
2826 (JSC::CTI::privateStringLengthTrampoline):
2827 (JSC::CTI::compileRegExp):
2828 * masm/MacroAssemblerWin.cpp:
2829 (JSC::MacroAssembler::emitConvertToFastCall):
2830 (JSC::MacroAssembler::emitRestoreArgumentReference):
2831 * masm/X86Assembler.h:
2832 (JSC::X86Assembler::pushl_r):
2833 (JSC::X86Assembler::pushl_m):
2834 (JSC::X86Assembler::popl_r):
2835 (JSC::X86Assembler::popl_m):
2836 (JSC::X86Assembler::movl_rr):
2837 (JSC::X86Assembler::addl_rr):
2838 (JSC::X86Assembler::addl_i8r):
2839 (JSC::X86Assembler::addl_i32r):
2840 (JSC::X86Assembler::addl_mr):
2841 (JSC::X86Assembler::andl_rr):
2842 (JSC::X86Assembler::andl_i32r):
2843 (JSC::X86Assembler::cmpl_i8r):
2844 (JSC::X86Assembler::cmpl_rr):
2845 (JSC::X86Assembler::cmpl_rm):
2846 (JSC::X86Assembler::cmpl_i32r):
2847 (JSC::X86Assembler::cmpl_i32m):
2848 (JSC::X86Assembler::cmpw_rm):
2849 (JSC::X86Assembler::orl_rr):
2850 (JSC::X86Assembler::subl_rr):
2851 (JSC::X86Assembler::subl_i8r):
2852 (JSC::X86Assembler::subl_i32r):
2853 (JSC::X86Assembler::subl_mr):
2854 (JSC::X86Assembler::testl_i32r):
2855 (JSC::X86Assembler::testl_rr):
2856 (JSC::X86Assembler::xorl_i8r):
2857 (JSC::X86Assembler::xorl_rr):
2858 (JSC::X86Assembler::sarl_i8r):
2859 (JSC::X86Assembler::sarl_CLr):
2860 (JSC::X86Assembler::shl_i8r):
2861 (JSC::X86Assembler::shll_CLr):
2862 (JSC::X86Assembler::mull_rr):
2863 (JSC::X86Assembler::idivl_r):
2864 (JSC::X86Assembler::cdq):
2865 (JSC::X86Assembler::movl_mr):
2866 (JSC::X86Assembler::movzwl_mr):
2867 (JSC::X86Assembler::movl_rm):
2868 (JSC::X86Assembler::movl_i32r):
2869 (JSC::X86Assembler::movl_i32m):
2870 (JSC::X86Assembler::leal_mr):
2871 (JSC::X86Assembler::ret):
2872 (JSC::X86Assembler::jmp_r):
2873 (JSC::X86Assembler::jmp_m):
2874 (JSC::X86Assembler::call_r):
2876 (JSC::WRECGenerator::generateBacktrack1):
2877 (JSC::WRECGenerator::generateBacktrackBackreference):
2878 (JSC::WRECGenerator::generateBackreferenceQuantifier):
2879 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2880 (JSC::WRECGenerator::generateGreedyQuantifier):
2881 (JSC::WRECGenerator::generatePatternCharacter):
2882 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
2883 (JSC::WRECGenerator::generateCharacterClassInverted):
2884 (JSC::WRECGenerator::generateCharacterClass):
2885 (JSC::WRECGenerator::generateParentheses):
2886 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
2887 (JSC::WRECGenerator::generateAssertionBOL):
2888 (JSC::WRECGenerator::generateAssertionEOL):
2889 (JSC::WRECGenerator::generateAssertionWordBoundary):
2890 (JSC::WRECGenerator::generateBackreference):
2891 (JSC::WRECGenerator::gernerateDisjunction):
2893 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2895 Reviewed by Maciej Stachowiak.
2897 Clean up the WREC code some more.
2900 (JSC::CTI::compileRegExp):
2902 (JSC::getCharacterClassNewline):
2903 (JSC::getCharacterClassDigits):
2904 (JSC::getCharacterClassSpaces):
2905 (JSC::getCharacterClassWordchar):
2906 (JSC::getCharacterClassNondigits):
2907 (JSC::getCharacterClassNonspaces):
2908 (JSC::getCharacterClassNonwordchar):
2909 (JSC::WRECGenerator::generateBacktrack1):
2910 (JSC::WRECGenerator::generateBacktrackBackreference):
2911 (JSC::WRECGenerator::generateBackreferenceQuantifier):
2912 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2913 (JSC::WRECGenerator::generateGreedyQuantifier):
2914 (JSC::WRECGenerator::generatePatternCharacter):
2915 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
2916 (JSC::WRECGenerator::generateCharacterClassInverted):
2917 (JSC::WRECGenerator::generateCharacterClass):
2918 (JSC::WRECGenerator::generateParentheses):
2919 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
2920 (JSC::WRECGenerator::generateAssertionBOL):
2921 (JSC::WRECGenerator::generateAssertionEOL):
2922 (JSC::WRECGenerator::generateAssertionWordBoundary):
2923 (JSC::WRECGenerator::generateBackreference):
2924 (JSC::WRECGenerator::gernerateDisjunction):
2925 (JSC::WRECParser::parseCharacterClass):
2926 (JSC::WRECParser::parseEscape):
2927 (JSC::WRECParser::parseTerm):
2930 2008-09-09 Mark Rowe <mrowe@apple.com>
2932 Build fix, rubber-stamped by Anders Carlsson.
2934 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
2936 * JavaScriptCore.xcodeproj/project.pbxproj:
2938 2008-09-09 Mark Rowe <mrowe@apple.com>
2940 Rubber-stamped by Oliver Hunt.
2942 Fix builds using the "debug" variant.
2944 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
2945 and Release configurations.
2947 * Configurations/JavaScriptCore.xcconfig:
2948 * DerivedSources.make:
2949 * JavaScriptCore.Debug.exp: Removed.
2950 * JavaScriptCore.base.exp: Removed.
2951 * JavaScriptCore.exp: Added.
2952 * JavaScriptCore.xcodeproj/project.pbxproj:
2953 * kjs/identifier.cpp:
2954 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
2955 there is no overhead in Release builds.
2956 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
2958 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
2959 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
2961 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2963 Reviewed by Maciej Stachowiak.
2965 Clean up WREC a bit to bring it closer to our coding style guidelines.
2969 (JSC::getCharacterClass_newline):
2970 (JSC::getCharacterClass_d):
2971 (JSC::getCharacterClass_s):
2972 (JSC::getCharacterClass_w):
2973 (JSC::getCharacterClass_D):
2974 (JSC::getCharacterClass_S):
2975 (JSC::getCharacterClass_W):
2976 (JSC::CharacterClassConstructor::append):
2977 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2978 (JSC::WRECGenerator::generateGreedyQuantifier):
2979 (JSC::WRECGenerator::generateCharacterClassInverted):
2980 (JSC::WRECParser::parseQuantifier):
2981 (JSC::WRECParser::parsePatternCharacterQualifier):
2982 (JSC::WRECParser::parseCharacterClassQuantifier):
2983 (JSC::WRECParser::parseBackreferenceQuantifier):
2985 (JSC::Quantifier::):
2986 (JSC::Quantifier::Quantifier):
2988 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
2990 Reviewed by Alexey Proskuryakov.
2992 Try MIME charset names before trying IANA names
2993 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
2995 * wtf/StringExtras.h: (strcasecmp): Added.
2997 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2999 Reviewed by Mark Rowe.
3001 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
3002 <https://bugs.webkit.org/show_bug.cgi?id=20719>
3003 <rdar://problem/6205787>
3005 Fix a typo in the case-insensitive matching of character patterns.
3008 (JSC::WRECGenerator::generatePatternCharacter):
3010 2008-09-09 Maciej Stachowiak <mjs@apple.com>
3012 Reviewed by Sam Weinig.
3014 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
3016 1.012x speedup on SunSpider.
3018 * kjs/MathObject.cpp:
3019 (JSC::MathObject::getOwnPropertySlot):
3021 (JSC::setUpStaticFunctionSlot):
3023 (JSC::getStaticPropertySlot):
3025 2008-09-08 Sam Weinig <sam@webkit.org>
3027 Reviewed by Maciej Stachowiak and Oliver Hunt.
3029 Split storage of properties out of the PropertyMap and into the JSObject
3030 to allow sharing PropertyMap on the StructureID. In order to get this
3031 function correctly, the StructureID's transition mappings were changed to
3032 transition based on property name and attribute pairs, instead of just
3035 - Removes the single property optimization now that the PropertyMap is shared.
3036 This will be replaced by in-lining some values on the JSObject.
3038 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
3040 * JavaScriptCore.base.exp:
3042 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
3043 (JSC::CTI::privateCompileGetByIdProto): Ditto.
3044 (JSC::CTI::privateCompileGetByIdChain): Ditto.
3045 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
3047 (JSC::JSObject::mark): Mark the PropertyStorage.
3048 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
3049 (JSC::JSObject::deleteProperty): Ditto.
3050 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
3051 (JSC::JSObject::defineSetter): Ditto.
3052 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
3053 (JSC::JSObject::getPropertyNames): Ditto.
3054 (JSC::JSObject::removeDirect): Ditto.
3055 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
3056 (JSC::JSObject::propertyStorage): return the PropertyStorage.
3057 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
3058 (JSC::JSObject::getDirectLocation): Ditto.
3059 (JSC::JSObject::offsetForLocation): Compute location directly.
3060 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
3061 (JSC::JSObject::hasGetterSetterProperties): Ditto.
3062 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
3063 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
3064 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
3065 (JSC::JSObject::getOwnPropertySlot): Ditto.
3066 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
3067 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
3068 (JSC::PropertyMap::checkConsistency):
3069 (JSC::PropertyMap::operator=):
3070 (JSC::PropertyMap::~PropertyMap):
3071 (JSC::PropertyMap::get):
3072 (JSC::PropertyMap::getLocation):
3073 (JSC::PropertyMap::put):
3074 (JSC::PropertyMap::getOffset):
3075 (JSC::PropertyMap::insert):
3076 (JSC::PropertyMap::expand):
3077 (JSC::PropertyMap::rehash):
3078 (JSC::PropertyMap::createTable):
3079 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
3080 (JSC::PropertyMap::remove):
3081 (JSC::PropertyMap::getEnumerablePropertyNames):
3082 * kjs/PropertyMap.h:
3083 (JSC::PropertyMapEntry::PropertyMapEntry):
3084 (JSC::PropertyMap::isEmpty):
3085 (JSC::PropertyMap::size):
3086 (JSC::PropertyMap::makingCount):
3087 (JSC::PropertyMap::PropertyMap):
3089 * kjs/StructureID.cpp:
3090 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
3092 (JSC::StructureID::toDictionaryTransition): Copy the map.
3093 (JSC::StructureID::changePrototypeTransition): Copy the map.
3094 (JSC::StructureID::getterSetterTransition): Copy the map.
3095 (JSC::StructureID::~StructureID):
3096 * kjs/StructureID.h:
3097 (JSC::TransitionTableHash::hash): Custom hash for transition map.
3098 (JSC::TransitionTableHash::equal): Ditto.
3099 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
3100 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
3101 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
3102 (JSC::StructureID::propertyMap): Added.
3104 2008-09-08 Oliver Hunt <oliver@apple.com>
3106 Reviewed by Mark Rowe.
3108 Bug 20694: Slow Script error pops up when running Dromaeo tests
3110 Correct error in timeout logic where execution tick count would
3111 be reset to incorrect value due to incorrect offset and indirection.
3112 Codegen for the slow script dialog was factored out into a separate
3113 method (emitSlowScriptCheck) rather than having multiple copies of
3114 the same code. Also added calls to generate slow script checks
3115 for loop_if_less and loop_if_true opcodes.
3118 (JSC::CTI::emitSlowScriptCheck):
3119 (JSC::CTI::privateCompileMainPass):
3120 (JSC::CTI::privateCompileSlowCases):
3123 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3125 Reviewed by Maciej Stachowiak.
3127 Remove references to the removed WRECompiler class.
3132 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3134 Rubber-stamped by Mark Rowe.
3136 Fix the build with CTI enabled but WREC disabled.
3141 2008-09-08 Dan Bernstein <mitz@apple.com>
3146 (JSC::StatementNode::):
3149 2008-09-08 Kevin McCullough <kmccullough@apple.com>
3153 <rdar://problem/6134407> Breakpoints in for loops, while loops or
3154 conditions without curly braces don't break. (19306)
3155 -Statement Lists already emit debug hooks but conditionals without
3156 brackets are not lists.
3159 (KJS::IfNode::emitCode):
3160 (KJS::IfElseNode::emitCode):
3161 (KJS::DoWhileNode::emitCode):
3162 (KJS::WhileNode::emitCode):
3163 (KJS::ForNode::emitCode):
3164 (KJS::ForInNode::emitCode):
3166 (KJS::StatementNode::):
3169 2008-09-08 Maciej Stachowiak <mjs@apple.com>
3171 Reviewed by Anders Carlsson.
3173 - Cache the code generated for eval to speed up SunSpider and web sites
3174 https://bugs.webkit.org/show_bug.cgi?id=20718
3177 2.29x on date-format-tofte
3179 Lots of real sites seem to get many hits on this cache as well,
3180 including GMail, Google Spreadsheets, Slate and Digg (the last of
3181 these gets over 100 hits on initial page load).
3184 (JSC::EvalCodeCache::get):
3186 (JSC::Machine::callEval):
3187 (JSC::Machine::privateExecute):
3188 (JSC::Machine::cti_op_call_eval):
3191 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3193 Reviewed by Oliver Hunt.
3195 Bug 20711: Change KJS prefix on preprocessor macros to JSC
3196 <https://bugs.webkit.org/show_bug.cgi?id=20711>
3198 * kjs/CommonIdentifiers.cpp:
3199 (JSC::CommonIdentifiers::CommonIdentifiers):
3200 * kjs/CommonIdentifiers.h:
3201 * kjs/PropertySlot.h:
3202 (JSC::PropertySlot::getValue):
3203 (JSC::PropertySlot::putValue):
3204 (JSC::PropertySlot::setValueSlot):
3205 (JSC::PropertySlot::setValue):
3206 (JSC::PropertySlot::setRegisterSlot):
3211 (JSC::ExpressionNode::):
3212 (JSC::StatementNode::):
3214 (JSC::BooleanNode::):
3215 (JSC::NumberNode::):
3216 (JSC::ImmediateNumberNode::):
3217 (JSC::StringNode::):
3218 (JSC::RegExpNode::):
3220 (JSC::ResolveNode::):
3221 (JSC::ElementNode::):
3223 (JSC::PropertyNode::):
3224 (JSC::PropertyListNode::):
3225 (JSC::ObjectLiteralNode::):
3226 (JSC::BracketAccessorNode::):
3227 (JSC::DotAccessorNode::):
3228 (JSC::ArgumentListNode::):
3229 (JSC::ArgumentsNode::):
3230 (JSC::NewExprNode::):
3231 (JSC::EvalFunctionCallNode::):
3232 (JSC::FunctionCallValueNode::):
3233 (JSC::FunctionCallResolveNode::):
3234 (JSC::FunctionCallBracketNode::):
3235 (JSC::FunctionCallDotNode::):
3236 (JSC::PrePostResolveNode::):
3237 (JSC::PostfixResolveNode::):
3238 (JSC::PostfixBracketNode::):
3239 (JSC::PostfixDotNode::):
3240 (JSC::PostfixErrorNode::):
3241 (JSC::DeleteResolveNode::):
3242 (JSC::DeleteBracketNode::):
3243 (JSC::DeleteDotNode::):
3244 (JSC::DeleteValueNode::):
3246 (JSC::TypeOfResolveNode::):
3247 (JSC::TypeOfValueNode::):
3248 (JSC::PrefixResolveNode::):
3249 (JSC::PrefixBracketNode::):
3250 (JSC::PrefixDotNode::):
3251 (JSC::PrefixErrorNode::):
3252 (JSC::UnaryPlusNode::):
3253 (JSC::NegateNode::):
3254 (JSC::BitwiseNotNode::):
3255 (JSC::LogicalNotNode::):
3261 (JSC::LeftShiftNode::):
3262 (JSC::RightShiftNode::):
3263 (JSC::UnsignedRightShiftNode::):
3265 (JSC::GreaterNode::):
3266 (JSC::LessEqNode::):
3267 (JSC::GreaterEqNode::):
3268 (JSC::ThrowableBinaryOpNode::):
3269 (JSC::InstanceOfNode::):
3272 (JSC::NotEqualNode::):
3273 (JSC::StrictEqualNode::):
3274 (JSC::NotStrictEqualNode::):
3275 (JSC::BitAndNode::):
3277 (JSC::BitXOrNode::):
3278 (JSC::LogicalOpNode::):
3279 (JSC::ConditionalNode::):
3280 (JSC::ReadModifyResolveNode::):
3281 (JSC::AssignResolveNode::):
3282 (JSC::ReadModifyBracketNode::):
3283 (JSC::AssignBracketNode::):
3284 (JSC::AssignDotNode::):
3285 (JSC::ReadModifyDotNode::):
3286 (JSC::AssignErrorNode::):
3288 (JSC::VarDeclCommaNode::):
3289 (JSC::ConstDeclNode::):
3290 (JSC::ConstStatementNode::):
3291 (JSC::EmptyStatementNode::):
3292 (JSC::DebuggerStatementNode::):
3293 (JSC::ExprStatementNode::):
3294 (JSC::VarStatementNode::):
3296 (JSC::IfElseNode::):
3297 (JSC::DoWhileNode::):
3300 (JSC::ContinueNode::):
3302 (JSC::ReturnNode::):
3307 (JSC::ParameterNode::):
3309 (JSC::ProgramNode::):
3311 (JSC::FunctionBodyNode::):
3312 (JSC::FuncExprNode::):
3313 (JSC::FuncDeclNode::):
3314 (JSC::CaseClauseNode::):
3315 (JSC::ClauseListNode::):
3316 (JSC::CaseBlockNode::):
3317 (JSC::SwitchNode::):
3319 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3321 Reviewed by Maciej Stachowiak.
3323 Bug 20704: Replace the KJS namespace
3324 <https://bugs.webkit.org/show_bug.cgi?id=20704>
3326 Rename the KJS namespace to JSC. There are still some uses of KJS in
3327 preprocessor macros and comments, but these will also be changed some
3328 time in the near future.
3335 * API/JSCallbackConstructor.cpp:
3336 * API/JSCallbackConstructor.h:
3337 * API/JSCallbackFunction.cpp:
3338 * API/JSCallbackFunction.h:
3339 * API/JSCallbackObject.cpp:
3340 * API/JSCallbackObject.h:
3341 * API/JSCallbackObjectFunctions.h:
3342 * API/JSClassRef.cpp:
3343 (OpaqueJSClass::staticValues):
3344 (OpaqueJSClass::staticFunctions):
3346 * API/JSContextRef.cpp:
3347 * API/JSObjectRef.cpp:
3348 * API/JSProfilerPrivate.cpp:
3349 * API/JSStringRef.cpp:
3350 * API/JSValueRef.cpp:
3352 * API/OpaqueJSString.cpp:
3353 * API/OpaqueJSString.h:
3354 * JavaScriptCore.Debug.exp:
3355 * JavaScriptCore.base.exp:
3361 * VM/CodeGenerator.cpp:
3362 * VM/CodeGenerator.h:
3363 * VM/ExceptionHelpers.cpp:
3364 * VM/ExceptionHelpers.h:
3366 * VM/JSPropertyNameIterator.cpp:
3367 * VM/JSPropertyNameIterator.h:
3375 * VM/RegisterFile.cpp:
3376 * VM/RegisterFile.h:
3379 * VM/SamplingTool.cpp:
3380 * VM/SamplingTool.h:
3381 * VM/SegmentedVector.h:
3384 * kjs/Arguments.cpp:
3386 * kjs/ArrayConstructor.cpp:
3387 * kjs/ArrayConstructor.h:
3388 * kjs/ArrayPrototype.cpp:
3389 * kjs/ArrayPrototype.h:
3390 * kjs/BatchedTransitionOptimizer.h:
3391 * kjs/BooleanConstructor.cpp:
3392 * kjs/BooleanConstructor.h:
3393 * kjs/BooleanObject.cpp:
3394 * kjs/BooleanObject.h:
3395 * kjs/BooleanPrototype.cpp:
3396 * kjs/BooleanPrototype.h:
3400 * kjs/CommonIdentifiers.cpp:
3401 * kjs/CommonIdentifiers.h:
3402 * kjs/ConstructData.cpp:
3403 * kjs/ConstructData.h:
3404 * kjs/DateConstructor.cpp:
3405 * kjs/DateConstructor.h:
3406 * kjs/DateInstance.cpp:
3407 (JSC::DateInstance::msToGregorianDateTime):
3408 * kjs/DateInstance.h:
3411 * kjs/DatePrototype.cpp:
3412 * kjs/DatePrototype.h:
3413 * kjs/DebuggerCallFrame.cpp:
3414 * kjs/DebuggerCallFrame.h:
3417 * kjs/ErrorConstructor.cpp:
3418 * kjs/ErrorConstructor.h:
3419 * kjs/ErrorInstance.cpp:
3420 * kjs/ErrorInstance.h:
3421 * kjs/ErrorPrototype.cpp:
3422 * kjs/ErrorPrototype.h:
3423 * kjs/ExecState.cpp:
3425 * kjs/FunctionConstructor.cpp:
3426 * kjs/FunctionConstructor.h:
3427 * kjs/FunctionPrototype.cpp:
3428 * kjs/FunctionPrototype.h:
3429 * kjs/GetterSetter.cpp:
3430 * kjs/GetterSetter.h:
3431 * kjs/GlobalEvalFunction.cpp:
3432 * kjs/GlobalEvalFunction.h:
3433 * kjs/IndexToNameMap.cpp:
3434 * kjs/IndexToNameMap.h:
3435 * kjs/InitializeThreading.cpp:
3436 * kjs/InitializeThreading.h:
3437 * kjs/InternalFunction.cpp:
3438 * kjs/InternalFunction.h:
3439 (JSC::InternalFunction::InternalFunction):
3440 * kjs/JSActivation.cpp:
3441 * kjs/JSActivation.h:
3446 * kjs/JSFunction.cpp:
3448 (JSC::JSFunction::JSFunction):
3449 * kjs/JSGlobalData.cpp:
3450 (JSC::JSGlobalData::JSGlobalData):
3451 * kjs/JSGlobalData.h:
3452 * kjs/JSGlobalObject.cpp:
3453 * kjs/JSGlobalObject.h:
3454 * kjs/JSGlobalObjectFunctions.cpp:
3455 * kjs/JSGlobalObjectFunctions.h:
3456 * kjs/JSImmediate.cpp:
3457 * kjs/JSImmediate.h:
3460 * kjs/JSNotAnObject.cpp:
3461 * kjs/JSNotAnObject.h:
3462 * kjs/JSNumberCell.cpp:
3463 * kjs/JSNumberCell.h:
3466 * kjs/JSStaticScopeObject.cpp:
3467 * kjs/JSStaticScopeObject.h:
3473 * kjs/JSVariableObject.cpp:
3474 * kjs/JSVariableObject.h:
3475 * kjs/JSWrapperObject.cpp:
3476 * kjs/JSWrapperObject.h:
3477 * kjs/LabelStack.cpp:
3479 * kjs/MathObject.cpp:
3481 * kjs/NativeErrorConstructor.cpp:
3482 * kjs/NativeErrorConstructor.h:
3483 * kjs/NativeErrorPrototype.cpp:
3484 * kjs/NativeErrorPrototype.h:
3486 * kjs/NumberConstructor.cpp:
3487 * kjs/NumberConstructor.h:
3488 * kjs/NumberObject.cpp:
3489 * kjs/NumberObject.h:
3490 * kjs/NumberPrototype.cpp:
3491 * kjs/NumberPrototype.h:
3492 * kjs/ObjectConstructor.cpp:
3493 * kjs/ObjectConstructor.h:
3494 * kjs/ObjectPrototype.cpp:
3495 * kjs/ObjectPrototype.h:
3498 * kjs/PropertyMap.cpp:
3499 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
3500 * kjs/PropertyMap.h:
3501 * kjs/PropertyNameArray.cpp:
3502 * kjs/PropertyNameArray.h:
3503 * kjs/PropertySlot.cpp:
3504 * kjs/PropertySlot.h:
3505 * kjs/PrototypeFunction.cpp:
3506 * kjs/PrototypeFunction.h:
3507 * kjs/PutPropertySlot.h:
3508 * kjs/RegExpConstructor.cpp:
3509 * kjs/RegExpConstructor.h:
3510 * kjs/RegExpObject.cpp:
3511 * kjs/RegExpObject.h:
3512 * kjs/RegExpPrototype.cpp:
3513 * kjs/RegExpPrototype.h:
3514 * kjs/ScopeChain.cpp:
3516 * kjs/ScopeChainMark.h:
3519 * kjs/SmallStrings.cpp:
3520 * kjs/SmallStrings.h:
3521 * kjs/SourceProvider.h:
3522 * kjs/SourceRange.h:
3523 * kjs/StringConstructor.cpp:
3524 * kjs/StringConstructor.h:
3525 * kjs/StringObject.cpp:
3526 * kjs/StringObject.h:
3527 * kjs/StringObjectThatMasqueradesAsUndefined.h:
3528 * kjs/StringPrototype.cpp:
3529 * kjs/StringPrototype.h:
3530 * kjs/StructureID.cpp:
3531 * kjs/StructureID.h:
3532 * kjs/SymbolTable.h:
3533 * kjs/collector.cpp:
3536 * kjs/create_hash_table:
3542 * kjs/identifier.cpp:
3544 (JSC::Identifier::equal):
3545 * kjs/interpreter.cpp:
3546 * kjs/interpreter.h:
3548 (JSC::Lexer::Lexer):
3549 (JSC::Lexer::clear):
3550 (JSC::Lexer::makeIdentifier):
3556 * kjs/nodes2string.cpp:
3557 * kjs/operations.cpp: