1 2008-09-23 Maciej Stachowiak <mjs@apple.com>
3 Reviewed by Cameron Zwarich.
5 - inline the fast cases of !==, same as for ===
7 2.9% speedup on EarleyBoyer benchmark
10 (JSC::CTI::compileOpStrictEq): Factored stricteq codegen into this function,
11 and parameterized so it can do the reverse version as well.
12 (JSC::CTI::privateCompileMainPass): Use the above for stricteq and nstricteq.
14 (JSC::CTI::): Declare above stuff.
16 (JSC::Machine::cti_op_nstricteq): Removed fast cases, now handled inline.
18 2008-09-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
20 Reviewed by Oliver Hunt.
22 Bug 20989: Aguments constructor should put 'callee' and 'length' properties in a more efficient way
23 <https://bugs.webkit.org/show_bug.cgi?id=20989>
25 Make special cases for the 'callee' and 'length' properties in the
28 This is somewhere between a 7.8% speedup and a 10% speedup on the V8
29 Raytrace benchmark, depending on whether it is run alone or with the
33 (JSC::ArgumentsData::ArgumentsData):
34 (JSC::Arguments::Arguments):
35 (JSC::Arguments::mark):
36 (JSC::Arguments::getOwnPropertySlot):
37 (JSC::Arguments::put):
38 (JSC::Arguments::deleteProperty):
40 2008-09-23 Maciej Stachowiak <mjs@apple.com>
44 - speed up instanceof some more
45 https://bugs.webkit.org/show_bug.cgi?id=20818
47 ~2% speedup on EarleyBoyer
49 The idea here is to record in the StructureID whether the class
50 needs a special hasInstance or if it can use the normal logic from
53 Based on this I inlined the real work directly into
54 cti_op_instanceof and put the fastest checks up front and the
55 error handling at the end (so it should be fairly straightforward
56 to split off the beginning to be inlined if desired).
58 I only did this for CTI, not the bytecode interpreter.
60 * API/JSCallbackObject.h:
61 (JSC::JSCallbackObject::createStructureID):
64 (JSC::Machine::cti_op_instanceof):
66 (JSC::JSImmediate::isAnyImmediate):
68 (JSC::TypeInfo::overridesHasInstance):
69 (JSC::TypeInfo::flags):
71 2008-09-22 Darin Adler <darin@apple.com>
73 Reviewed by Sam Weinig.
75 - https://bugs.webkit.org/show_bug.cgi?id=21019
76 make FunctionBodyNode::ref/deref fast
78 Speeds up v8-raytrace by 7.2%.
81 (JSC::FunctionBodyNode::FunctionBodyNode): Initialize m_refCount to 0.
83 (JSC::FunctionBodyNode::ref): Call base class ref once, and thereafter use
85 (JSC::FunctionBodyNode::deref): Ditto, but the deref side.
87 2008-09-22 Darin Adler <darin@apple.com>
89 Pointed out by Sam Weinig.
92 (JSC::Arguments::fillArgList): Fix bad copy and paste. Oops!
94 2008-09-22 Darin Adler <darin@apple.com>
96 Reviewed by Cameron Zwarich.
98 - https://bugs.webkit.org/show_bug.cgi?id=20983
99 ArgumentsData should have some room to allocate some extra arguments inline
101 Speeds up v8-raytrace by 5%.
104 (JSC::ArgumentsData::ArgumentsData): Use a fixed buffer if there are 4 or fewer
106 (JSC::Arguments::Arguments): Use a fixed buffer if there are 4 or fewer
108 (JSC::Arguments::~Arguments): Delete the buffer if necessary.
109 (JSC::Arguments::mark): Update since extraArguments are now Register.
110 (JSC::Arguments::fillArgList): Added special case for the only case that's
111 actually used in the practice, when there are no parameters. There are some
112 other special cases in there too, but that's the only one that matters.
113 (JSC::Arguments::getOwnPropertySlot): Updated to use setValueSlot since there's
114 no operation to get you at the JSValue* inside a Register as a "slot".
116 2008-09-22 Sam Weinig <sam@webkit.org>
118 Reviewed by Maciej Stachowiak.
120 Patch for https://bugs.webkit.org/show_bug.cgi?id=21014
121 Speed up for..in by using StructureID to avoid calls to hasProperty
123 Speeds up fasta by 8%.
125 * VM/JSPropertyNameIterator.cpp:
126 (JSC::JSPropertyNameIterator::invalidate):
127 * VM/JSPropertyNameIterator.h:
128 (JSC::JSPropertyNameIterator::next):
129 * kjs/PropertyNameArray.h:
130 (JSC::PropertyNameArrayData::begin):
131 (JSC::PropertyNameArrayData::end):
132 (JSC::PropertyNameArrayData::setCachedStructureID):
133 (JSC::PropertyNameArrayData::cachedStructureID):
134 * kjs/StructureID.cpp:
135 (JSC::StructureID::getEnumerablePropertyNames):
136 (JSC::structureIDChainsAreEqual):
139 2008-09-22 Kelvin Sherlock <ksherlock@gmail.com>
141 Updated and tweaked by Sam Weinig.
143 Reviewed by Geoffrey Garen.
145 Bug 20020: Proposed enhancement to JavaScriptCore API
146 <https://bugs.webkit.org/show_bug.cgi?id=20020>
148 Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp
149 functions to create JavaScript Array, Date, Error, and RegExp objects, respectively.
151 * API/JSObjectRef.cpp: The functions
152 * API/JSObjectRef.h: Function prototype and documentation
153 * JavaScriptCore.exp: Added functions to exported function list
154 * API/tests/testapi.c: Added basic functionality tests.
156 * kjs/DateConstructor.cpp:
157 Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
158 with JSObject* constructDate(ExecState* exec, const ArgList& args).
159 Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function
161 * kjs/DateConstructor.h:
162 added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args)
164 * kjs/ErrorConstructor.cpp:
165 removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args)
167 * kjs/ErrorConstructor.h:
168 added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args)
170 * kjs/RegExpConstructor.cpp:
171 removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args)
173 * kjs/RegExpConstructor.h:
174 added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args)
176 2008-09-22 Matt Lilek <webkit@mattlilek.com>
178 Not reviewed, Windows build fix.
181 * kjs/FunctionPrototype.cpp:
183 2008-09-22 Sam Weinig <sam@webkit.org>
185 Reviewed by Darin Adler.
187 Patch for https://bugs.webkit.org/show_bug.cgi?id=20982
188 Speed up the apply method of functions by special-casing array and 'arguments' objects
190 1% speedup on v8-raytrace.
192 Test: fast/js/function-apply.html
195 (JSC::Arguments::fillArgList):
197 * kjs/FunctionPrototype.cpp:
198 (JSC::functionProtoFuncApply):
200 (JSC::JSArray::fillArgList):
203 2008-09-22 Darin Adler <darin@apple.com>
205 Reviewed by Sam Weinig.
207 - https://bugs.webkit.org/show_bug.cgi?id=20993
208 Array.push/pop need optimized cases for JSArray
210 3% or so speedup on DeltaBlue benchmark.
212 * kjs/ArrayPrototype.cpp:
213 (JSC::arrayProtoFuncPop): Call JSArray::pop when appropriate.
214 (JSC::arrayProtoFuncPush): Call JSArray::push when appropriate.
217 (JSC::JSArray::putSlowCase): Set m_fastAccessCutoff when appropriate, getting
218 us into the fast code path.
219 (JSC::JSArray::pop): Added.
220 (JSC::JSArray::push): Added.
221 * kjs/JSArray.h: Added push and pop.
223 * kjs/operations.cpp:
224 (JSC::throwOutOfMemoryError): Don't inline this. Helps us avoid PIC branches.
226 2008-09-22 Maciej Stachowiak <mjs@apple.com>
228 Reviewed by Cameron Zwarich.
230 - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
232 Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
234 2.2% speedup on EarleyBoyer benchmark.
236 * API/JSCallbackConstructor.cpp:
237 * API/JSCallbackConstructor.h:
238 (JSC::JSCallbackConstructor::createStructureID):
239 * API/JSCallbackFunction.cpp:
240 * API/JSCallbackFunction.h:
241 (JSC::JSCallbackFunction::createStructureID):
242 * API/JSCallbackObject.h:
243 (JSC::JSCallbackObject::createStructureID):
244 * API/JSCallbackObjectFunctions.h:
245 (JSC::::hasInstance):
246 * API/JSValueRef.cpp:
247 (JSValueIsInstanceOfConstructor):
248 * JavaScriptCore.exp:
250 (JSC::Machine::privateExecute):
251 (JSC::Machine::cti_op_instanceof):
252 * kjs/InternalFunction.cpp:
253 * kjs/InternalFunction.h:
254 (JSC::InternalFunction::createStructureID):
258 (JSC::TypeInfo::implementsHasInstance):
260 2008-09-22 Maciej Stachowiak <mjs@apple.com>
262 Reviewed by Dave Hyatt.
264 Based on initial work by Darin Adler.
266 - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
267 - use this to JIT inline code for eq_null and neq_null
268 https://bugs.webkit.org/show_bug.cgi?id=20823
270 0.5% speedup on SunSpider
271 ~4% speedup on Richards benchmark
274 (JSC::CTI::privateCompileMainPass):
276 (JSC::jsTypeStringForValue):
277 (JSC::jsIsObjectType):
278 (JSC::Machine::privateExecute):
279 (JSC::Machine::cti_op_is_undefined):
283 * kjs/StringObjectThatMasqueradesAsUndefined.h:
284 (JSC::StringObjectThatMasqueradesAsUndefined::create):
285 (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
287 (JSC::StructureID::mutableTypeInfo):
289 (JSC::TypeInfo::TypeInfo):
290 (JSC::TypeInfo::masqueradesAsUndefined):
291 * kjs/operations.cpp:
293 * masm/X86Assembler.h:
294 (JSC::X86Assembler::):
295 (JSC::X86Assembler::setne_r):
296 (JSC::X86Assembler::setnz_r):
297 (JSC::X86Assembler::testl_i32m):
299 2008-09-22 Tor Arne Vestbø <tavestbo@trolltech.com>
303 Initialize QCoreApplication in kjs binary/Shell.cpp
305 This allows us to use QCoreApplication::instance() to
306 get the main thread in ThreadingQt.cpp
310 * wtf/ThreadingQt.cpp:
311 (WTF::initializeThreading):
313 2008-09-21 Darin Adler <darin@apple.com>
315 - blind attempt to fix non-all-in-one builds
317 * kjs/JSGlobalObject.cpp: Added includes of Arguments.h and RegExpObject.h.
319 2008-09-21 Darin Adler <darin@apple.com>
323 * kjs/StructureID.cpp:
324 (JSC::StructureID::addPropertyTransition): Use typeInfo().type() instead of m_type.
325 (JSC::StructureID::createCachedPrototypeChain): Ditto.
327 2008-09-21 Maciej Stachowiak <mjs@apple.com>
329 Reviewed by Darin Adler.
331 - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
332 https://bugs.webkit.org/show_bug.cgi?id=20981
334 * JavaScriptCore.exp:
335 * JavaScriptCore.xcodeproj/project.pbxproj:
337 (JSC::CTI::privateCompileMainPass):
338 (JSC::CTI::privateCompilePutByIdTransition):
340 (JSC::jsIsObjectType):
341 (JSC::Machine::Machine):
342 * kjs/AllInOneFile.cpp:
344 (JSC::JSCell::isObject):
345 (JSC::JSCell::isString):
346 * kjs/JSGlobalData.cpp:
347 (JSC::JSGlobalData::JSGlobalData):
348 * kjs/JSGlobalObject.cpp:
349 (JSC::JSGlobalObject::reset):
350 * kjs/JSGlobalObject.h:
351 (JSC::StructureID::prototypeForLookup):
352 * kjs/JSNumberCell.h:
353 (JSC::JSNumberCell::createStructureID):
355 (JSC::JSObject::createInheritorID):
357 (JSC::JSObject::createStructureID):
359 (JSC::JSString::createStructureID):
360 * kjs/NativeErrorConstructor.cpp:
361 (JSC::NativeErrorConstructor::NativeErrorConstructor):
362 * kjs/RegExpConstructor.cpp:
363 * kjs/RegExpMatchesArray.h: Added.
364 (JSC::RegExpMatchesArray::getOwnPropertySlot):
365 (JSC::RegExpMatchesArray::put):
366 (JSC::RegExpMatchesArray::deleteProperty):
367 (JSC::RegExpMatchesArray::getPropertyNames):
368 * kjs/StructureID.cpp:
369 (JSC::StructureID::StructureID):
370 (JSC::StructureID::addPropertyTransition):
371 (JSC::StructureID::toDictionaryTransition):
372 (JSC::StructureID::changePrototypeTransition):
373 (JSC::StructureID::getterSetterTransition):
375 (JSC::StructureID::create):
376 (JSC::StructureID::typeInfo):
377 * kjs/TypeInfo.h: Added.
378 (JSC::TypeInfo::TypeInfo):
379 (JSC::TypeInfo::type):
381 2008-09-21 Darin Adler <darin@apple.com>
383 Reviewed by Cameron Zwarich.
385 - fix crash logging into Gmail due to recent Arguments change
388 (JSC::Arguments::Arguments): Fix window where mark() function could
389 see d->extraArguments with uninitialized contents.
390 (JSC::Arguments::mark): Check d->extraArguments for 0 to handle two
391 cases: 1) Inside the constructor before it's initialized.
392 2) numArguments <= numParameters.
394 2008-09-21 Darin Adler <darin@apple.com>
396 - fix loose end from the "duplicate constant values" patch
398 * VM/CodeGenerator.cpp:
399 (JSC::CodeGenerator::emitLoad): Add a special case for values the
400 hash table can't handle.
402 2008-09-21 Mark Rowe <mrowe@apple.com>
404 Fix the non-AllInOneFile build.
406 * kjs/Arguments.cpp: Add missing #include.
408 2008-09-21 Darin Adler <darin@apple.com>
410 Reviewed by Cameron Zwarich and Mark Rowe.
412 - fix test failure caused by my recent IndexToNameMap patch
415 (JSC::Arguments::deleteProperty): Added the accidentally-omitted
416 check of the boolean result from toArrayIndex.
418 2008-09-21 Darin Adler <darin@apple.com>
420 Reviewed by Maciej Stachowiak.
422 - https://bugs.webkit.org/show_bug.cgi?id=20975
423 inline immediate-number case of ==
425 * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to
426 emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.
428 * VM/CTI.cpp: Updated for new name.
429 (JSC::CTI::privateCompileMainPass): Added op_eq.
430 (JSC::CTI::privateCompileSlowCases): Added op_eq.
433 (JSC::Machine::cti_op_eq): Removed fast case, since it's now
436 2008-09-21 Peter Gal <galpter@inf.u-szeged.hu>
438 Reviewed by Tim Hatcher and Eric Seidel.
440 Fix the QT/Linux JavaScriptCore segmentation fault.
441 https://bugs.webkit.org/show_bug.cgi?id=20914
443 * wtf/ThreadingQt.cpp:
444 (WTF::initializeThreading): Use currentThread() if
445 platform is not a MAC (like in pre 36541 revisions)
447 2008-09-21 Darin Adler <darin@apple.com>
449 Reviewed by Sam Weinig.
451 * kjs/debugger.h: Removed some unneeded includes and declarations.
453 2008-09-21 Darin Adler <darin@apple.com>
455 Reviewed by Sam Weinig.
457 - https://bugs.webkit.org/show_bug.cgi?id=20972
458 speed up Arguments further by eliminating the IndexToNameMap
460 No change on SunSpider. 1.29x as fast on V8 Raytrace.
462 * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the
463 indexToNameMap and hadDeletes data members. Changed extraArguments into
464 an OwnArrayPtr and added deletedArguments, another OwnArrayPtr.
465 Replaced numExtraArguments with numParameters, since that's what's
466 used more directly in hot code paths.
467 (JSC::Arguments::Arguments): Pass in argument count instead of ArgList.
468 Initialize ArgumentsData the new way.
469 (JSC::Arguments::mark): Updated.
470 (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so
471 we don't have to convert integers to identifiers just to get an argument.
472 Integrated the deleted case with the fast case.
473 (JSC::Arguments::put): Ditto.
474 (JSC::Arguments::deleteProperty): Ditto.
476 * kjs/Arguments.h: Minimized includes. Made everything private. Added
477 overloads for the integral property name case. Eliminated mappedIndexSetter.
478 Moved ArgumentsData into the .cpp file.
480 * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
481 * kjs/IndexToNameMap.h: Ditto.
483 * kjs/JSActivation.cpp:
484 (JSC::JSActivation::createArgumentsObject): Elminated ArgList.
487 * JavaScriptCore.pri:
488 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
489 * JavaScriptCore.xcodeproj/project.pbxproj:
490 * JavaScriptCoreSources.bkl:
491 * kjs/AllInOneFile.cpp:
492 Removed IndexToNameMap.
494 2008-09-21 Darin Adler <darin@apple.com>
496 * VM/CodeGenerator.cpp:
497 (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly
500 2008-09-21 Judit Jasz <jasy@inf.u-szeged.hu>
502 Reviewed and tweaked by Darin Adler.
504 - https://bugs.webkit.org/show_bug.cgi?id=20645
505 Elminate duplicate constant values in CodeBlocks.
507 Seems to be a wash on SunSpider.
509 * VM/CodeGenerator.cpp:
510 (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee
511 we emit the same JSValue* for identical numbers and strings.
512 * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&.
513 Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap.
515 (JSC::StringNode::emitCode): Call the new emitLoad and let it do the
518 2008-09-21 Paul Pedriana <webkit@pedriana.com>
520 Reviewed and tweaked by Darin Adler.
522 - https://bugs.webkit.org/show_bug.cgi?id=16925
523 Fixed lack of Vector buffer alignment for both GCC and MSVC.
524 Since there's no portable way to do this, for now we don't support
527 * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer.
528 Use AlignedBuffer insteadof an array of char in VectorBuffer.
530 2008-09-21 Gabor Loki <loki@inf.u-szeged.hu>
532 Reviewed by Darin Adler.
534 - https://bugs.webkit.org/show_bug.cgi?id=19408
535 Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators.
537 1.008x as fast on SunSpider.
540 (makeNegateNode): Fold if expression is a number > 0.
541 (makeBitwiseNotNode): Fold if expression is a number.
542 (makeMultNode): Fold if expressions are both numbers.
543 (makeDivNode): Fold if expressions are both numbers.
544 (makeAddNode): Fold if expressions are both numbers.
545 (makeLeftShiftNode): Fold if expressions are both numbers.
546 (makeRightShiftNode): Fold if expressions are both numbers.
548 2008-09-21 Maciej Stachowiak <mjs@apple.com>
552 - speed up === operator by generating inline machine code for the fast paths
553 https://bugs.webkit.org/show_bug.cgi?id=20820
556 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber):
557 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers):
558 (JSC::CTI::emitJumpSlowCaseIfNotImmediates):
559 (JSC::CTI::emitTagAsBoolImmediate):
560 (JSC::CTI::privateCompileMainPass):
561 (JSC::CTI::privateCompileSlowCases):
564 (JSC::Machine::cti_op_stricteq):
565 * masm/X86Assembler.h:
566 (JSC::X86Assembler::):
567 (JSC::X86Assembler::sete_r):
568 (JSC::X86Assembler::setz_r):
569 (JSC::X86Assembler::movzbl_rr):
570 (JSC::X86Assembler::emitUnlinkedJnz):
572 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
574 Reviewed by Maciej Stachowiak.
576 Free memory allocated for extra arguments in the destructor of the
580 (JSC::Arguments::~Arguments):
583 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
585 Reviewed by Maciej Stachowiak.
587 Bug 20815: 'arguments' object creation is non-optimal
588 <https://bugs.webkit.org/show_bug.cgi?id=20815>
590 Fix our inefficient way of creating the arguments object by only
591 creating named properties for each of the arguments after a use of the
592 'delete' statement. This patch also speeds up access to the 'arguments'
593 object slightly, but it still does not use the array fast path for
594 indexed access that exists for many opcodes.
596 This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5%
597 improvement on the Earley-Boyer benchmark, which gives a 4% improvement
601 (JSC::Arguments::Arguments):
602 (JSC::Arguments::mark):
603 (JSC::Arguments::getOwnPropertySlot):
604 (JSC::Arguments::put):
605 (JSC::Arguments::deleteProperty):
607 (JSC::Arguments::ArgumentsData::ArgumentsData):
608 * kjs/IndexToNameMap.h:
609 (JSC::IndexToNameMap::size):
610 * kjs/JSActivation.cpp:
611 (JSC::JSActivation::createArgumentsObject):
612 * kjs/JSActivation.h:
613 (JSC::JSActivation::uncheckedSymbolTableGet):
614 (JSC::JSActivation::uncheckedSymbolTableGetValue):
615 (JSC::JSActivation::uncheckedSymbolTablePut):
617 (JSC::JSFunction::numParameters):
619 2008-09-20 Darin Adler <darin@apple.com>
621 Reviewed by Mark Rowe.
623 - fix crash seen on buildbot
625 * kjs/JSGlobalObject.cpp:
626 (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype,
627 deleted by accident in my recent check-in.
629 2008-09-20 Maciej Stachowiak <mjs@apple.com>
631 Not reviewed, build fix.
633 - speculative fix for non-AllInOne builds
637 2008-09-20 Maciej Stachowiak <mjs@apple.com>
639 Reviewed by Darin Adler.
641 - assorted optimizations to === and !== operators
642 (work towards <https://bugs.webkit.org/show_bug.cgi?id=20820>)
644 2.5% speedup on earley-boyer test
647 (JSC::Machine::cti_op_stricteq): Use inline version of
648 strictEqualSlowCase; remove unneeded exception check.
649 (JSC::Machine::cti_op_nstricteq): ditto
650 * kjs/operations.cpp:
651 (JSC::strictEqual): Use strictEqualSlowCaseInline
652 (JSC::strictEqualSlowCase): ditto
654 (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined,
655 since the extra function call indirection is a lose for CTI.
657 2008-09-20 Darin Adler <darin@apple.com>
659 Reviewed by Maciej Stachowiak.
661 - finish https://bugs.webkit.org/show_bug.cgi?id=20858
662 make each distinct C++ class get a distinct JSC::Structure
664 This also includes some optimizations that make the change an overall
665 small speedup. Without those it was a bit of a slowdown.
667 * API/JSCallbackConstructor.cpp:
668 (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
669 * API/JSCallbackConstructor.h: Ditto.
670 * API/JSCallbackFunction.cpp:
671 (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
672 * API/JSCallbackObject.h: Take a structure.
673 * API/JSCallbackObjectFunctions.h:
674 (JSC::JSCallbackObject::JSCallbackObject): Ditto.
676 * API/JSClassRef.cpp:
677 (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype
678 if there's a custom prototype involved.
679 * API/JSObjectRef.cpp:
680 (JSObjectMake): Ditto.
681 (JSObjectMakeConstructor): Pass in a structure.
683 * JavaScriptCore.exp: Updated.
686 (JSC::jsLess): Added a special case for when both arguments are strings.
687 This avoids converting both strings to with UString::toDouble.
688 (JSC::jsLessEq): Ditto.
689 (JSC::Machine::privateExecute): Pass in a structure.
690 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
691 (JSC::Machine::cti_op_new_regexp): Ditto.
692 (JSC::Machine::cti_op_is_string): Ditto.
693 * VM/Machine.h: Made isJSString public so it can be used in the CTI.
696 (JSC::Arguments::Arguments): Pass in a structure.
698 * kjs/JSCell.h: Mark constructor explicit.
700 * kjs/JSGlobalObject.cpp:
701 (JSC::markIfNeeded): Added an overload for marking structures.
702 (JSC::JSGlobalObject::reset): Eliminate code to set data members to
703 zero. We now do that in the constructor, and we no longer use this
704 anywhere except in the constructor. Added code to create structures.
705 Pass structures rather than prototypes when creating objects.
706 (JSC::JSGlobalObject::mark): Mark the structures.
708 * kjs/JSGlobalObject.h: Removed unneeded class declarations.
709 Added initializers for raw pointers in JSGlobalObjectData so
710 everything starts with a 0. Added structure data and accessor
713 * kjs/JSImmediate.cpp:
714 (JSC::JSImmediate::nonInlineNaN): Added.
716 (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
718 * kjs/JSNumberCell.cpp:
719 (JSC::jsNumberCell): Made non-inline to avoid PIC branches
720 in functions that call this one.
722 * kjs/JSNumberCell.h: Ditto.
724 * kjs/JSObject.h: Removed constructor that takes a prototype.
725 All callers now pass structures.
727 * kjs/ArrayConstructor.cpp:
728 (JSC::ArrayConstructor::ArrayConstructor):
729 (JSC::constructArrayWithSizeQuirk):
730 * kjs/ArrayConstructor.h:
731 * kjs/ArrayPrototype.cpp:
732 (JSC::ArrayPrototype::ArrayPrototype):
733 * kjs/ArrayPrototype.h:
734 * kjs/BooleanConstructor.cpp:
735 (JSC::BooleanConstructor::BooleanConstructor):
736 (JSC::constructBoolean):
737 (JSC::constructBooleanFromImmediateBoolean):
738 * kjs/BooleanConstructor.h:
739 * kjs/BooleanObject.cpp:
740 (JSC::BooleanObject::BooleanObject):
741 * kjs/BooleanObject.h:
742 * kjs/BooleanPrototype.cpp:
743 (JSC::BooleanPrototype::BooleanPrototype):
744 * kjs/BooleanPrototype.h:
745 * kjs/DateConstructor.cpp:
746 (JSC::DateConstructor::DateConstructor):
747 (JSC::constructDate):
748 * kjs/DateConstructor.h:
749 * kjs/DateInstance.cpp:
750 (JSC::DateInstance::DateInstance):
751 * kjs/DateInstance.h:
752 * kjs/DatePrototype.cpp:
753 (JSC::DatePrototype::DatePrototype):
754 * kjs/DatePrototype.h:
755 * kjs/ErrorConstructor.cpp:
756 (JSC::ErrorConstructor::ErrorConstructor):
757 (JSC::constructError):
758 * kjs/ErrorConstructor.h:
759 * kjs/ErrorInstance.cpp:
760 (JSC::ErrorInstance::ErrorInstance):
761 * kjs/ErrorInstance.h:
762 * kjs/ErrorPrototype.cpp:
763 (JSC::ErrorPrototype::ErrorPrototype):
764 * kjs/ErrorPrototype.h:
765 * kjs/FunctionConstructor.cpp:
766 (JSC::FunctionConstructor::FunctionConstructor):
767 * kjs/FunctionConstructor.h:
768 * kjs/FunctionPrototype.cpp:
769 (JSC::FunctionPrototype::FunctionPrototype):
770 (JSC::FunctionPrototype::addFunctionProperties):
771 * kjs/FunctionPrototype.h:
772 * kjs/GlobalEvalFunction.cpp:
773 (JSC::GlobalEvalFunction::GlobalEvalFunction):
774 * kjs/GlobalEvalFunction.h:
775 * kjs/InternalFunction.cpp:
776 (JSC::InternalFunction::InternalFunction):
777 * kjs/InternalFunction.h:
778 (JSC::InternalFunction::InternalFunction):
780 (JSC::JSArray::JSArray):
781 (JSC::constructEmptyArray):
782 (JSC::constructArray):
784 * kjs/JSFunction.cpp:
785 (JSC::JSFunction::JSFunction):
786 (JSC::JSFunction::construct):
788 (JSC::constructEmptyObject):
790 (JSC::StringObject::create):
791 * kjs/JSWrapperObject.h:
792 * kjs/MathObject.cpp:
793 (JSC::MathObject::MathObject):
795 * kjs/NativeErrorConstructor.cpp:
796 (JSC::NativeErrorConstructor::NativeErrorConstructor):
797 (JSC::NativeErrorConstructor::construct):
798 * kjs/NativeErrorConstructor.h:
799 * kjs/NativeErrorPrototype.cpp:
800 (JSC::NativeErrorPrototype::NativeErrorPrototype):
801 * kjs/NativeErrorPrototype.h:
802 * kjs/NumberConstructor.cpp:
803 (JSC::NumberConstructor::NumberConstructor):
804 (JSC::constructWithNumberConstructor):
805 * kjs/NumberConstructor.h:
806 * kjs/NumberObject.cpp:
807 (JSC::NumberObject::NumberObject):
808 (JSC::constructNumber):
809 (JSC::constructNumberFromImmediateNumber):
810 * kjs/NumberObject.h:
811 * kjs/NumberPrototype.cpp:
812 (JSC::NumberPrototype::NumberPrototype):
813 * kjs/NumberPrototype.h:
814 * kjs/ObjectConstructor.cpp:
815 (JSC::ObjectConstructor::ObjectConstructor):
816 (JSC::constructObject):
817 * kjs/ObjectConstructor.h:
818 * kjs/ObjectPrototype.cpp:
819 (JSC::ObjectPrototype::ObjectPrototype):
820 * kjs/ObjectPrototype.h:
821 * kjs/PrototypeFunction.cpp:
822 (JSC::PrototypeFunction::PrototypeFunction):
823 * kjs/PrototypeFunction.h:
824 * kjs/RegExpConstructor.cpp:
825 (JSC::RegExpConstructor::RegExpConstructor):
826 (JSC::RegExpMatchesArray::RegExpMatchesArray):
827 (JSC::constructRegExp):
828 * kjs/RegExpConstructor.h:
829 * kjs/RegExpObject.cpp:
830 (JSC::RegExpObject::RegExpObject):
831 * kjs/RegExpObject.h:
832 * kjs/RegExpPrototype.cpp:
833 (JSC::RegExpPrototype::RegExpPrototype):
834 * kjs/RegExpPrototype.h:
836 (GlobalObject::GlobalObject):
837 * kjs/StringConstructor.cpp:
838 (JSC::StringConstructor::StringConstructor):
839 (JSC::constructWithStringConstructor):
840 * kjs/StringConstructor.h:
841 * kjs/StringObject.cpp:
842 (JSC::StringObject::StringObject):
843 * kjs/StringObject.h:
844 * kjs/StringObjectThatMasqueradesAsUndefined.h:
845 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
846 * kjs/StringPrototype.cpp:
847 (JSC::StringPrototype::StringPrototype):
848 * kjs/StringPrototype.h:
849 Take and pass structures.
851 2008-09-19 Alp Toker <alp@nuanti.com>
853 Build fix for the 'gold' linker and recent binutils. New behaviour
854 requires that we link to used libraries explicitly.
858 2008-09-19 Sam Weinig <sam@webkit.org>
860 Roll r36694 back in. It did not cause the crash.
862 * JavaScriptCore.exp:
863 * VM/JSPropertyNameIterator.cpp:
864 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
865 (JSC::JSPropertyNameIterator::invalidate):
866 * VM/JSPropertyNameIterator.h:
867 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
868 (JSC::JSPropertyNameIterator::create):
870 (JSC::JSObject::getPropertyNames):
871 * kjs/PropertyMap.cpp:
872 (JSC::PropertyMap::getEnumerablePropertyNames):
874 * kjs/PropertyNameArray.cpp:
875 (JSC::PropertyNameArray::add):
876 * kjs/PropertyNameArray.h:
877 (JSC::PropertyNameArrayData::create):
878 (JSC::PropertyNameArrayData::propertyNameVector):
879 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
880 (JSC::PropertyNameArrayData::cachedPrototypeChain):
881 (JSC::PropertyNameArrayData::begin):
882 (JSC::PropertyNameArrayData::end):
883 (JSC::PropertyNameArrayData::PropertyNameArrayData):
884 (JSC::PropertyNameArray::PropertyNameArray):
885 (JSC::PropertyNameArray::addKnownUnique):
886 (JSC::PropertyNameArray::size):
887 (JSC::PropertyNameArray::operator[]):
888 (JSC::PropertyNameArray::begin):
889 (JSC::PropertyNameArray::end):
890 (JSC::PropertyNameArray::setData):
891 (JSC::PropertyNameArray::data):
892 (JSC::PropertyNameArray::releaseData):
893 * kjs/StructureID.cpp:
894 (JSC::structureIDChainsAreEqual):
895 (JSC::StructureID::getEnumerablePropertyNames):
896 (JSC::StructureID::clearEnumerationCache):
897 (JSC::StructureID::createCachedPrototypeChain):
900 2008-09-19 Sam Weinig <sam@webkit.org>
904 * JavaScriptCore.exp:
905 * VM/JSPropertyNameIterator.cpp:
906 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
907 (JSC::JSPropertyNameIterator::invalidate):
908 * VM/JSPropertyNameIterator.h:
909 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
910 (JSC::JSPropertyNameIterator::create):
912 (JSC::JSObject::getPropertyNames):
913 * kjs/PropertyMap.cpp:
914 (JSC::PropertyMap::getEnumerablePropertyNames):
916 * kjs/PropertyNameArray.cpp:
917 (JSC::PropertyNameArray::add):
918 * kjs/PropertyNameArray.h:
919 (JSC::PropertyNameArray::PropertyNameArray):
920 (JSC::PropertyNameArray::addKnownUnique):
921 (JSC::PropertyNameArray::begin):
922 (JSC::PropertyNameArray::end):
923 (JSC::PropertyNameArray::size):
924 (JSC::PropertyNameArray::operator[]):
925 (JSC::PropertyNameArray::releaseIdentifiers):
926 * kjs/StructureID.cpp:
927 (JSC::StructureID::getEnumerablePropertyNames):
929 (JSC::StructureID::clearEnumerationCache):
931 2008-09-19 Oliver Hunt <oliver@apple.com>
933 Reviewed by Maciej Stachowiak.
935 Improve peformance of local variable initialisation.
937 Pull local and constant initialisation out of slideRegisterWindowForCall
938 and into its own opcode. This allows the JIT to generate the initialisation
939 code for a function directly into the instruction stream and so avoids a few
940 branches on function entry.
942 Results a 1% progression in SunSpider, particularly in a number of the bitop
943 tests where the called functions are very fast.
946 (JSC::CTI::emitInitialiseRegister):
947 (JSC::CTI::privateCompileMainPass):
950 (JSC::CodeBlock::dump):
951 * VM/CodeGenerator.cpp:
952 (JSC::CodeGenerator::CodeGenerator):
954 (JSC::slideRegisterWindowForCall):
955 (JSC::Machine::privateExecute):
958 2008-09-19 Sam Weinig <sam@webkit.org>
960 Reviewed by Darin Adler.
962 Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
963 Speed up JS property enumeration by caching entire PropertyNameArray
965 1.3% speedup on Sunspider, 30% on string-fasta.
967 * JavaScriptCore.exp:
968 * VM/JSPropertyNameIterator.cpp:
969 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
970 (JSC::JSPropertyNameIterator::invalidate):
971 * VM/JSPropertyNameIterator.h:
972 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
973 (JSC::JSPropertyNameIterator::create):
975 (JSC::JSObject::getPropertyNames):
976 * kjs/PropertyMap.cpp:
977 (JSC::PropertyMap::getEnumerablePropertyNames):
979 * kjs/PropertyNameArray.cpp:
980 (JSC::PropertyNameArray::add):
981 * kjs/PropertyNameArray.h:
982 (JSC::PropertyNameArrayData::create):
983 (JSC::PropertyNameArrayData::propertyNameVector):
984 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
985 (JSC::PropertyNameArrayData::cachedPrototypeChain):
986 (JSC::PropertyNameArrayData::begin):
987 (JSC::PropertyNameArrayData::end):
988 (JSC::PropertyNameArrayData::PropertyNameArrayData):
989 (JSC::PropertyNameArray::PropertyNameArray):
990 (JSC::PropertyNameArray::addKnownUnique):
991 (JSC::PropertyNameArray::size):
992 (JSC::PropertyNameArray::operator[]):
993 (JSC::PropertyNameArray::begin):
994 (JSC::PropertyNameArray::end):
995 (JSC::PropertyNameArray::setData):
996 (JSC::PropertyNameArray::data):
997 (JSC::PropertyNameArray::releaseData):
998 * kjs/ScopeChain.cpp:
999 (JSC::ScopeChainNode::print):
1000 * kjs/StructureID.cpp:
1001 (JSC::structureIDChainsAreEqual):
1002 (JSC::StructureID::getEnumerablePropertyNames):
1003 (JSC::StructureID::clearEnumerationCache):
1004 (JSC::StructureID::createCachedPrototypeChain):
1005 * kjs/StructureID.h:
1007 2008-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
1009 Reviewed by Maciej Stachowiak.
1011 Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
1014 (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
1016 2008-09-19 Darin Adler <darin@apple.com>
1018 Reviewed by Sam Weinig.
1020 - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
1021 make each distinct C++ class get a distinct JSC::Structure
1023 * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
1025 * kjs/JSGlobalObject.h: Changed the protected constructor to take a
1026 structure instead of a prototype.
1028 * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
1030 2008-09-19 Julien Chaffraix <jchaffraix@pleyo.com>
1032 Reviewed by Alexey Proskuryakov.
1034 Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
1035 non-template methods' code been copied for each instance of the template.
1036 The patch splits RefCounted between a base class that holds non-template methods and attributes
1037 and the template RefCounted class that keeps the same functionnality.
1039 On my Linux with gcc 4.3 for the Gtk port, this is:
1040 - a ~600KB save on libwebkit.so in release.
1041 - a ~1.6MB save on libwebkit.so in debug.
1043 It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
1044 On the whole, it should be a small win as we reduce the compiled code size and the only
1045 new function call should be inlined by the compiler.
1048 (WTF::RefCountedBase::ref): Copied from RefCounted.
1049 (WTF::RefCountedBase::hasOneRef): Ditto.
1050 (WTF::RefCountedBase::refCount): Ditto.
1051 (WTF::RefCountedBase::RefCountedBase): Ditto.
1052 (WTF::RefCountedBase::~RefCountedBase): Ditto.
1053 (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
1055 (WTF::RefCounted::RefCounted):
1056 (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
1057 (WTF::RefCounted::~RefCounted): Keep private destructor.
1059 2008-09-18 Darin Adler <darin@apple.com>
1061 Reviewed by Maciej Stachowiak.
1063 - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
1064 make each distinct C++ class get a distinct JSC::Structure
1066 * kjs/lookup.h: Removed things here that were used only in WebCore:
1067 cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
1068 and JSC_IMPLEMENT_PROTOTYPE.
1070 2008-09-18 Darin Adler <darin@apple.com>
1072 Reviewed by Maciej Stachowiak.
1074 - https://bugs.webkit.org/show_bug.cgi?id=20927
1075 simplify/streamline the code to turn strings into identifiers while parsing
1077 * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
1081 (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
1082 * kjs/lexer.h: Remove makeUString.
1084 * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
1086 * VM/CodeGenerator.cpp:
1087 (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
1088 (JSC::prepareJumpTableForStringSwitch): Ditto.
1090 (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
1091 (JSC::processClauseList): Ditto.
1092 * kjs/nodes2string.cpp:
1093 (JSC::StringNode::streamTo): Ditto.
1095 2008-09-18 Sam Weinig <sam@webkit.org>
1100 (JSC::Instruction::Instruction):
1102 2008-09-18 Oliver Hunt <oliver@apple.com>
1104 Reviewed by Maciej Stachowiak.
1106 Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
1107 <https://bugs.webkit.org/show_bug.cgi?id=20911>
1109 The problem was simply caused by the int constructor for Instruction
1110 failing to initialise the full struct in 64bit builds.
1113 (JSC::Instruction::Instruction):
1115 2008-09-18 Darin Adler <darin@apple.com>
1119 * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
1121 2008-09-18 Darin Adler <darin@apple.com>
1123 Reviewed by Sam Weinig.
1125 * kjs/JSGlobalObject.h: Tiny style guideline tweak.
1127 2008-09-18 Darin Adler <darin@apple.com>
1129 Reviewed by Sam Weinig.
1131 - fix https://bugs.webkit.org/show_bug.cgi?id=20925
1132 LEAK messages appear every time I quit
1134 * JavaScriptCore.exp: Updated, and also added an export
1135 needed for future WebCore use of JSC::StructureID.
1137 * wtf/RefCountedLeakCounter.cpp:
1138 (WTF::RefCountedLeakCounter::suppressMessages): Added.
1139 (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
1140 (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
1141 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
1142 log the reason there was no leak checking done.
1143 (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
1144 (WTF::RefCountedLeakCounter::decrement): Ditto.
1146 * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
1147 new functions, suppressMessages and cancelMessageSuppression. Also
1148 added m_ prefixes to the data member names.
1150 2008-09-18 Holger Hans Peter Freyther <zecke@selfish.org>
1152 Reviewed by Mark Rowe.
1154 https://bugs.webkit.org/show_bug.cgi?id=20437
1156 Add a proper #define to define which XML Parser implementation to use. Client
1157 code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
1158 implementation is going to be used.
1162 2008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1164 Reviewed by Maciej Stachowiak.
1166 Make a Unicode non-breaking space count as a whitespace character in
1167 PCRE. This change was already made in WREC, and it fixes one of the
1168 Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
1169 in a new set of expected test results.
1171 * pcre/pcre_internal.h:
1173 * tests/mozilla/expected.html:
1175 2008-09-18 Stephanie Lewis <slewis@apple.com>
1177 Reviewed by Mark Rowe and Maciej Stachowiak.
1179 add an option use arch to specify which architecture to run.
1181 * tests/mozilla/jsDriver.pl:
1183 2008-09-17 Oliver Hunt <oliver@apple.com>
1185 Correctly restore argument reference prior to SFX runtime calls.
1187 Reviewed by Steve Falkenburg.
1190 (JSC::CTI::privateCompileSlowCases):
1191 (JSC::CTI::privateCompile):
1193 2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1195 Reviewed by Maciej Stachowiak.
1197 Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
1198 <https://bugs.webkit.org/show_bug.cgi?id=20876>
1200 r36417 and r36427 caused an get_by_id opcode to be emitted before the
1201 instanceof and construct opcodes, in order to enable inline caching of
1202 the prototype property. Unfortunately, this regressed some tests dealing
1203 with exceptions thrown by 'instanceof' and the 'new' operator. We fix
1204 these problems by detecting whether an "is not an object" exception is
1205 thrown before op_instanceof or op_construct, and emit the proper
1206 exception in those cases.
1208 * VM/CodeGenerator.cpp:
1209 (JSC::CodeGenerator::emitConstruct):
1210 * VM/CodeGenerator.h:
1211 * VM/ExceptionHelpers.cpp:
1212 (JSC::createInvalidParamError):
1213 (JSC::createNotAConstructorError):
1214 (JSC::createNotAnObjectError):
1215 * VM/ExceptionHelpers.h:
1217 (JSC::Machine::getOpcode):
1218 (JSC::Machine::privateExecute):
1221 (JSC::NewExprNode::emitCode):
1222 (JSC::InstanceOfNode::emitCode):
1224 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1226 Reviewed by Oliver Hunt.
1228 JIT generation cti_op_construct_verify.
1230 Quarter to half percent progression on v8-tests.
1231 Roughly not change on SunSpider (possible minor progression).
1234 (JSC::CTI::privateCompileMainPass):
1238 2008-09-15 Steve Falkenburg <sfalken@apple.com>
1240 Improve timer accuracy for JavaScript Date object on Windows.
1242 Use a combination of ftime and QueryPerformanceCounter.
1243 ftime returns the information we want, but doesn't have sufficient resolution.
1244 QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
1245 To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
1246 QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to
1247 correct for drift if the low-res and high-res elapsed time between calls differs by more
1248 than twice the low-resolution timer resolution.
1250 QueryPerformanceCounter may be inaccurate due to a problems with:
1251 - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
1252 - BIOS bugs (http://support.microsoft.com/kb/895980/)
1253 - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
1255 Reviewed by Darin Adler.
1258 (JSC::highResUpTime):
1259 (JSC::lowResUTCTime):
1260 (JSC::qpcAvailable):
1261 (JSC::getCurrentUTCTimeWithMicroseconds):
1263 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1265 Reviewed by Geoff Garen.
1267 Implement JIT generation of CallFrame initialization, for op_call.
1269 1% sunspider 2.5% v8-tests.
1272 (JSC::CTI::compileOpCall):
1274 (JSC::Machine::cti_op_call_JSFunction):
1275 (JSC::Machine::cti_op_call_NotJSFunction):
1277 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1279 Reviewed by Geoff Garen.
1281 Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code,
1282 move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
1283 functions, instead of checking prior to making the call.
1285 3% on v8-tests (4% on richards, 6% in delta-blue)
1288 (JSC::CTI::compileOpCall):
1289 (JSC::CTI::privateCompileSlowCases):
1290 (JSC::CTI::privateCompile):
1292 (JSC::Machine::execute):
1293 (JSC::Machine::cti_op_call_JSFunction):
1294 (JSC::Machine::cti_vm_compile):
1295 (JSC::Machine::cti_vm_updateScopeChain):
1296 (JSC::Machine::cti_op_construct_JSConstruct):
1299 2008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com>
1301 Fix the QtWebKit/Mac build
1303 * wtf/ThreadingQt.cpp:
1304 (WTF::initializeThreading): use QCoreApplication to get the main thread
1306 2008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1308 Reviewed by Maciej Stachowiak.
1310 Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
1311 <https://bugs.webkit.org/show_bug.cgi?id=20857>
1313 Fix a problem stemming from the slightly unsafe behaviour of the
1314 CodeGenerator::finalDestination() method by putting the "func" argument
1315 of the emitConstruct() method in a RefPtr in its caller. Also, add an
1316 assertion guaranteeing that this is always the case.
1318 CodeGenerator::finalDestination() is still incorrect and can cause
1319 problems with a different allocator; see bug 20340 for more details.
1321 * VM/CodeGenerator.cpp:
1322 (JSC::CodeGenerator::emitConstruct):
1324 (JSC::NewExprNode::emitCode):
1326 2008-09-16 Alice Liu <alice.liu@apple.com>
1331 (JSC::CTI::privateCompileMainPass):
1333 2008-09-16 Gavin Barraclough <barraclough@apple.com>
1335 Reviewed by Geoff Garen.
1337 CTI code generation for op_ret. The majority of the work
1338 (updating variables on the stack & on exec) can be performed
1339 directly in generated code.
1341 We still need to check, & to call out to C-code to handle
1342 activation records, profiling, and full scope chains.
1344 +1.5% Sunspider, +5/6% v8 tests.
1347 (JSC::CTI::emitPutCTIParam):
1348 (JSC::CTI::compileOpCall):
1349 (JSC::CTI::privateCompileMainPass):
1352 (JSC::Machine::cti_op_ret_activation):
1353 (JSC::Machine::cti_op_ret_profiler):
1354 (JSC::Machine::cti_op_ret_scopeChain):
1357 2008-09-16 Dimitri Glazkov <dglazkov@chromium.org>
1359 Fix the Windows build.
1361 Add some extra parentheses to stop MSVC from complaining so much.
1364 (JSC::Machine::privateExecute):
1365 (JSC::Machine::cti_op_stricteq):
1366 (JSC::Machine::cti_op_nstricteq):
1367 * kjs/operations.cpp:
1370 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1372 Reviewed by Cameron Zwarich.
1374 - speed up the === and !== operators by choosing the fast cases better
1376 No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
1379 (JSC::Machine::privateExecute):
1380 (JSC::Machine::cti_op_stricteq):
1381 (JSC::Machine::cti_op_nstricteq):
1382 * kjs/JSImmediate.h:
1383 (JSC::JSImmediate::areBothImmediate):
1384 * kjs/operations.cpp:
1386 (JSC::strictEqualSlowCase):
1389 2008-09-15 Oliver Hunt <oliver@apple.com>
1393 Coding style cleanup.
1396 (JSC::Machine::privateExecute):
1398 2008-09-15 Oliver Hunt <oliver@apple.com>
1400 Reviewed by Cameron Zwarich.
1402 Bug 20874: op_resolve does not do any form of caching
1403 <https://bugs.webkit.org/show_bug.cgi?id=20874>
1405 This patch adds an op_resolve_global opcode to handle (and cache)
1406 property lookup we can statically determine must occur on the global
1409 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
1410 10% in math-partial-sums
1413 (JSC::CTI::privateCompileMainPass):
1416 (JSC::CodeBlock::dump):
1417 * VM/CodeGenerator.cpp:
1418 (JSC::CodeGenerator::findScopedProperty):
1419 (JSC::CodeGenerator::emitResolve):
1421 (JSC::resolveGlobal):
1422 (JSC::Machine::privateExecute):
1423 (JSC::Machine::cti_op_resolve_global):
1427 2008-09-15 Sam Weinig <sam@webkit.org>
1429 Roll out r36462. It broke document.all.
1432 (JSC::CTI::privateCompileMainPass):
1433 (JSC::CTI::privateCompileSlowCases):
1436 (JSC::Machine::Machine):
1437 (JSC::Machine::cti_op_eq_null):
1438 (JSC::Machine::cti_op_neq_null):
1440 (JSC::Machine::isJSString):
1442 * kjs/JSWrapperObject.h:
1443 * kjs/StringObject.h:
1444 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1446 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1448 Reviewed by Maciej Stachowiak.
1450 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
1451 <https://bugs.webkit.org/show_bug.cgi?id=20863>
1453 r36427 changed the number of arguments to op_construct without changing
1454 the argument index for the vPC in the call to initializeCallFrame() in
1455 the CTI case. This caused a JSC test failure. Correcting the argument
1456 index fixes the test failure.
1459 (JSC::Machine::cti_op_construct_JSConstruct):
1461 2008-09-15 Mark Rowe <mrowe@apple.com>
1467 2008-09-15 Geoffrey Garen <ggaren@apple.com>
1469 Reviewed by Maciej Stachowiak.
1471 Fixed a typo in op_get_by_id_chain that caused it to miss every time
1474 Also, a little cleanup.
1477 (JSC::Machine::privateExecute): Set up baseObject before entering the
1478 loop, so we compare against the right values.
1480 2008-09-15 Geoffrey Garen <ggaren@apple.com>
1482 Reviewed by Sam Weinig.
1484 Removed the CalledAsConstructor flag from the call frame header. Now,
1485 we use an explicit opcode at the call site to fix up constructor results.
1487 SunSpider says 0.4% faster.
1489 cti_op_construct_verify is an out-of-line function call for now, but we
1490 can fix that once StructureID holds type information like isObject.
1493 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
1496 (JSC::CodeBlock::dump):
1498 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
1499 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
1500 (JSC::CodeGenerator::emitConstruct): ... ditto.
1502 * VM/Machine.cpp: No more CalledAsConstructor
1503 (JSC::Machine::privateExecute): Implementation for the new opcode.
1504 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
1505 called as a constructor.
1506 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
1509 * VM/Opcode.h: Declare new opcode.
1511 * VM/RegisterFile.h:
1512 (JSC::RegisterFile::): No more CalledAsConstructor
1514 2008-09-15 Gavin Barraclough <barraclough@apple.com>
1516 Reviewed by Geoff Garen.
1518 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
1519 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
1520 masquerading may be handled differently (through the StructureIDs - see bug
1526 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
1527 (JSC::CTI::privateCompileMainPass):
1528 (JSC::CTI::privateCompileSlowCases):
1531 (JSC::Machine::Machine):
1532 (JSC::Machine::cti_op_eq_null):
1533 (JSC::Machine::cti_op_neq_null):
1535 (JSC::Machine::doesMasqueradesAsUndefined):
1536 * kjs/JSWrapperObject.h:
1537 (JSC::JSWrapperObject::):
1538 (JSC::JSWrapperObject::JSWrapperObject):
1539 * kjs/StringObject.h:
1540 (JSC::StringObject::StringObject):
1541 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1542 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1544 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1546 Rubber-stamped by Oliver Hunt.
1548 r36427 broke CodeBlock::dump() by changing the number of arguments to
1549 op_construct without changing the code that prints it. This patch fixes
1550 it by printing the additional argument.
1552 * JavaScriptCore.xcodeproj/project.pbxproj:
1554 (JSC::CodeBlock::dump):
1556 2008-09-15 Adam Roben <aroben@apple.com>
1560 * kjs/StructureID.cpp: Removed a stray semicolon.
1562 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1564 Reviewed by Maciej Stachowiak.
1566 Fix a crash in fast/js/exception-expression-offset.html caused by not
1567 updating all mentions of the length of op_construct in r36427.
1570 (JSC::Machine::cti_op_construct_NotJSConstruct):
1572 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1574 Reviewed by Cameron Zwarich.
1576 - fix layout test failure introduced by fix for 20849
1578 (The failing test was fast/js/delete-then-put.html)
1581 (JSC::JSObject::removeDirect): Clear enumeration cache
1582 in the dictionary case.
1584 (JSC::JSObject::putDirect): Ditto.
1585 * kjs/StructureID.h:
1586 (JSC::StructureID::clearEnumerationCache): Inline to handle the
1589 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1591 Reviewed by Cameron Zwarich.
1593 - fix JSC test failures introduced by fix for 20849
1595 * kjs/PropertyMap.cpp:
1596 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
1598 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1600 Reviewed by Maciej Stachowiak.
1602 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
1603 <https://bugs.webkit.org/show_bug.cgi?id=20851>
1605 r36410 introduced an optimization for parseInt() that is incorrect when
1606 its argument is larger than the range of a 32-bit integer. If the
1607 argument is a number that is not an immediate integer, then the correct
1608 behaviour is to return the floor of its value, unless it is an infinite
1609 value, in which case the correct behaviour is to return 0.
1611 * kjs/JSGlobalObjectFunctions.cpp:
1612 (JSC::globalFuncParseInt):
1614 2008-09-15 Sam Weinig <sam@webkit.org>
1616 Reviewed by Maciej Stachowiak.
1618 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
1619 Cache property names for getEnumerablePropertyNames in the StructureID.
1621 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
1622 on the v8 test suite.
1625 (JSC::JSObject::getPropertyNames):
1626 * kjs/PropertyMap.cpp:
1627 (JSC::PropertyMap::getEnumerablePropertyNames):
1628 * kjs/PropertyMap.h:
1629 * kjs/StructureID.cpp:
1630 (JSC::StructureID::StructureID):
1631 (JSC::StructureID::getEnumerablePropertyNames):
1632 * kjs/StructureID.h:
1634 2008-09-14 Maciej Stachowiak <mjs@apple.com>
1636 Reviewed by Cameron Zwarich.
1638 - speed up JS construction by extracting "prototype" lookup so PIC applies.
1640 ~0.5% speedup on SunSpider
1641 Speeds up some of the V8 tests as well, most notably earley-boyer.
1644 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
1645 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
1646 * VM/CodeGenerator.cpp:
1647 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
1649 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
1650 (JSC::Machine::cti_op_construct_JSConstruct): ditto
1651 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
1653 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
1655 Reviewed by Eric Seidel.
1657 Add a protected destructor for RefCounted.
1659 It is wrong to call its destructor directly, because (1) this should be taken care of by
1660 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
1662 No change in behavior.
1664 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
1666 2008-09-14 Gavin Barraclough <barraclough@apple.com>
1668 Reviewed by Sam Weinig.
1670 Accelerated property accesses.
1672 Inline more of the array access code into the JIT code for get/put_by_val.
1673 Accelerate get/put_by_id by speculatively inlining a disable direct access
1674 into the hot path of the code, and repatch this with the correct StructureID
1675 and property map offset once these are known. In the case of accesses to the
1676 prototype and reading the array-length a trampoline is genertaed, and the
1677 branch to the slow-case is relinked to jump to this.
1679 By repatching, we mean rewriting the x86 instruction stream. Instructions are
1680 only modified in a simple fasion - altering immediate operands, memory access
1681 deisplacements, and branch offsets.
1683 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
1684 instruction's immediate operant is updateded, and a memory access operation's
1685 displacement is updated to access the correct field on the object. In the case
1686 of more complex accesses (array length and get_by_id_prototype) the offset on
1687 the branch to slow-case is updated, to now jump to a trampoline.
1689 +2.8% sunspider, +13% v8-tests
1692 (JSC::CTI::emitCall):
1693 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
1695 (JSC::CTI::privateCompileMainPass):
1696 (JSC::CTI::privateCompileSlowCases):
1697 (JSC::CTI::privateCompile):
1698 (JSC::CTI::privateCompileGetByIdSelf):
1699 (JSC::CTI::privateCompileGetByIdProto):
1700 (JSC::CTI::privateCompileGetByIdChain):
1701 (JSC::CTI::privateCompilePutByIdReplace):
1702 (JSC::CTI::privateCompilePutByIdTransition):
1703 (JSC::CTI::privateCompileArrayLengthTrampoline):
1704 (JSC::CTI::privateCompileStringLengthTrampoline):
1705 (JSC::CTI::patchGetByIdSelf):
1706 (JSC::CTI::patchPutByIdReplace):
1707 (JSC::CTI::privateCompilePatchGetArrayLength):
1708 (JSC::CTI::privateCompilePatchGetStringLength):
1710 (JSC::CTI::compileGetByIdSelf):
1711 (JSC::CTI::compileGetByIdProto):
1712 (JSC::CTI::compileGetByIdChain):
1713 (JSC::CTI::compilePutByIdReplace):
1714 (JSC::CTI::compilePutByIdTransition):
1715 (JSC::CTI::compileArrayLengthTrampoline):
1716 (JSC::CTI::compileStringLengthTrampoline):
1717 (JSC::CTI::compilePatchGetArrayLength):
1718 (JSC::CTI::compilePatchGetStringLength):
1720 (JSC::CodeBlock::dump):
1721 (JSC::CodeBlock::~CodeBlock):
1723 (JSC::StructureStubInfo::StructureStubInfo):
1724 (JSC::CodeBlock::getStubInfo):
1726 (JSC::Machine::tryCTICachePutByID):
1727 (JSC::Machine::tryCTICacheGetByID):
1728 (JSC::Machine::cti_op_put_by_val_array):
1730 * masm/X86Assembler.h:
1731 (JSC::X86Assembler::):
1732 (JSC::X86Assembler::cmpl_i8m):
1733 (JSC::X86Assembler::emitUnlinkedJa):
1734 (JSC::X86Assembler::getRelocatedAddress):
1735 (JSC::X86Assembler::getDifferenceBetweenLabels):
1736 (JSC::X86Assembler::emitModRm_opmsib):
1738 2008-09-14 Maciej Stachowiak <mjs@apple.com>
1740 Reviewed by Cameron Zwarich.
1742 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
1744 ~5% speedup on v8 earley-boyer test
1746 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
1747 * API/JSCallbackObjectFunctions.h:
1748 (JSC::::hasInstance): Ditto.
1749 * API/JSValueRef.cpp:
1750 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
1751 * JavaScriptCore.exp:
1753 (JSC::CTI::privateCompileMainPass): Pass along prototype.
1755 (JSC::CodeBlock::dump): Print third arg.
1756 * VM/CodeGenerator.cpp:
1757 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
1758 is a third argument.
1759 * VM/CodeGenerator.h:
1761 (JSC::Machine::privateExecute): Pass along the prototype.
1762 (JSC::Machine::cti_op_instanceof): ditto
1764 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
1767 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
1768 property and pass that register to instanceof.
1771 2008-09-14 Gavin Barraclough <barraclough@apple.com>
1773 Reviewed by Sam Weinig.
1775 Remove unnecessary virtual function call from cti_op_call_JSFunction -
1776 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
1779 (JSC::Machine::cti_op_call_JSFunction):
1781 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1783 Reviewed by Maciej Stachowiak.
1785 Bug 20827: the 'typeof' operator is slow
1786 <https://bugs.webkit.org/show_bug.cgi?id=20827>
1788 Optimize the 'typeof' operator when its result is compared to a constant
1791 This is a 5.5% speedup on the V8 Earley-Boyer test.
1794 (JSC::CTI::privateCompileMainPass):
1796 (JSC::CodeBlock::dump):
1797 * VM/CodeGenerator.cpp:
1798 (JSC::CodeGenerator::emitEqualityOp):
1799 * VM/CodeGenerator.h:
1801 (JSC::jsIsObjectType):
1802 (JSC::jsIsFunctionType):
1803 (JSC::Machine::privateExecute):
1804 (JSC::Machine::cti_op_is_undefined):
1805 (JSC::Machine::cti_op_is_boolean):
1806 (JSC::Machine::cti_op_is_number):
1807 (JSC::Machine::cti_op_is_string):
1808 (JSC::Machine::cti_op_is_object):
1809 (JSC::Machine::cti_op_is_function):
1813 (JSC::BinaryOpNode::emitCode):
1814 (JSC::EqualNode::emitCode):
1815 (JSC::StrictEqualNode::emitCode):
1818 2008-09-14 Sam Weinig <sam@webkit.org>
1820 Reviewed by Cameron Zwarich.
1822 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
1823 Speed up parseInt for numbers
1825 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
1826 No change on the v8 suite.
1828 * kjs/JSGlobalObjectFunctions.cpp:
1829 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
1830 convert them back to numbers.
1832 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1834 Reviewed by Oliver Hunt.
1836 Bug 20816: op_lesseq should be optimized
1837 <https://bugs.webkit.org/show_bug.cgi?id=20816>
1839 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
1841 This is a 9.4% speedup on the V8 Crypto benchmark.
1844 (JSC::CTI::privateCompileMainPass):
1845 (JSC::CTI::privateCompileSlowCases):
1847 (JSC::CodeBlock::dump):
1848 * VM/CodeGenerator.cpp:
1849 (JSC::CodeGenerator::emitJumpIfTrue):
1851 (JSC::Machine::privateExecute):
1852 (JSC::Machine::cti_op_loop_if_lesseq):
1856 2008-09-14 Sam Weinig <sam@webkit.org>
1858 Reviewed by Cameron Zwarich.
1860 Cleanup Sampling code.
1863 (JSC::CTI::emitCall):
1864 (JSC::CTI::privateCompileMainPass):
1866 (JSC::CTI::execute):
1867 * VM/SamplingTool.cpp:
1869 (JSC::SamplingTool::run):
1870 (JSC::SamplingTool::dump):
1871 * VM/SamplingTool.h:
1872 (JSC::SamplingTool::callingHostFunction):
1874 2008-09-13 Oliver Hunt <oliver@apple.com>
1876 Reviewed by Cameron Zwarich.
1878 Bug 20821: Cache property transitions to speed up object initialization
1879 https://bugs.webkit.org/show_bug.cgi?id=20821
1881 Implement a transition cache to improve the performance of new properties
1882 being added to objects. This is extremely beneficial in constructors and
1883 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
1887 (JSC::CTI::privateCompileMainPass):
1889 (JSC::transitionWillNeedStorageRealloc):
1890 (JSC::CTI::privateCompilePutByIdTransition):
1892 (JSC::CTI::compilePutByIdTransition):
1894 (JSC::printPutByIdOp):
1895 (JSC::CodeBlock::printStructureIDs):
1896 (JSC::CodeBlock::dump):
1897 (JSC::CodeBlock::derefStructureIDs):
1898 (JSC::CodeBlock::refStructureIDs):
1899 * VM/CodeGenerator.cpp:
1900 (JSC::CodeGenerator::emitPutById):
1902 (JSC::cachePrototypeChain):
1903 (JSC::Machine::tryCachePutByID):
1904 (JSC::Machine::tryCacheGetByID):
1905 (JSC::Machine::privateExecute):
1906 (JSC::Machine::tryCTICachePutByID):
1907 (JSC::Machine::tryCTICacheGetByID):
1911 (JSC::JSObject::putDirect):
1912 (JSC::JSObject::transitionTo):
1913 * kjs/PutPropertySlot.h:
1914 (JSC::PutPropertySlot::PutPropertySlot):
1915 (JSC::PutPropertySlot::wasTransition):
1916 (JSC::PutPropertySlot::setWasTransition):
1917 * kjs/StructureID.cpp:
1918 (JSC::StructureID::transitionTo):
1919 (JSC::StructureIDChain::StructureIDChain):
1920 * kjs/StructureID.h:
1921 (JSC::StructureID::previousID):
1922 (JSC::StructureID::setCachedPrototypeChain):
1923 (JSC::StructureID::cachedPrototypeChain):
1924 (JSC::StructureID::propertyMap):
1925 * masm/X86Assembler.h:
1926 (JSC::X86Assembler::addl_i8m):
1927 (JSC::X86Assembler::subl_i8m):
1929 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1931 Reviewed by Maciej Stachowiak.
1933 Bug 20819: JSValue::isObject() is slow
1934 <https://bugs.webkit.org/show_bug.cgi?id=20819>
1936 Optimize JSCell::isObject() and JSCell::isString() by making them
1937 non-virtual calls that rely on the StructureID type information.
1939 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
1942 * JavaScriptCore.exp:
1945 (JSC::JSCell::isObject):
1946 (JSC::JSCell::isString):
1951 (JSC::JSString::JSString):
1952 * kjs/StructureID.h:
1953 (JSC::StructureID::type):
1955 2008-09-11 Stephanie Lewis <slewis@apple.com>
1957 Reviewed by Oliver Hunt.
1959 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
1960 crash on CNN and on Dromaeo.
1961 Fix Missing close tag in vcproj.
1963 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1965 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1969 Correct an SVN problem with the last commit and actually add the new
1972 * wrec/CharacterClassConstructor.cpp: Added.
1974 (JSC::getCharacterClassNewline):
1975 (JSC::getCharacterClassDigits):
1976 (JSC::getCharacterClassSpaces):
1977 (JSC::getCharacterClassWordchar):
1978 (JSC::getCharacterClassNondigits):
1979 (JSC::getCharacterClassNonspaces):
1980 (JSC::getCharacterClassNonwordchar):
1981 (JSC::CharacterClassConstructor::addSorted):
1982 (JSC::CharacterClassConstructor::addSortedRange):
1983 (JSC::CharacterClassConstructor::put):
1984 (JSC::CharacterClassConstructor::flush):
1985 (JSC::CharacterClassConstructor::append):
1986 * wrec/CharacterClassConstructor.h: Added.
1987 (JSC::CharacterClassConstructor::CharacterClassConstructor):
1988 (JSC::CharacterClassConstructor::isUpsideDown):
1989 (JSC::CharacterClassConstructor::charClass):
1991 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1993 Reviewed by Maciej Stachowiak.
1995 Bug 20788: Split CharacterClassConstructor into its own file
1996 <https://bugs.webkit.org/show_bug.cgi?id=20788>
1998 Split CharacterClassConstructor into its own file and clean up some
2001 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2002 * JavaScriptCore.xcodeproj/project.pbxproj:
2003 * wrec/CharacterClassConstructor.cpp: Added.
2005 (JSC::getCharacterClassNewline):
2006 (JSC::getCharacterClassDigits):
2007 (JSC::getCharacterClassSpaces):
2008 (JSC::getCharacterClassWordchar):
2009 (JSC::getCharacterClassNondigits):
2010 (JSC::getCharacterClassNonspaces):
2011 (JSC::getCharacterClassNonwordchar):
2012 (JSC::CharacterClassConstructor::addSorted):
2013 (JSC::CharacterClassConstructor::addSortedRange):
2014 (JSC::CharacterClassConstructor::put):
2015 (JSC::CharacterClassConstructor::flush):
2016 (JSC::CharacterClassConstructor::append):
2017 * wrec/CharacterClassConstructor.h: Added.
2018 (JSC::CharacterClassConstructor::CharacterClassConstructor):
2019 (JSC::CharacterClassConstructor::isUpsideDown):
2020 (JSC::CharacterClassConstructor::charClass):
2022 (JSC::WRECParser::parseCharacterClass):
2024 2008-09-10 Simon Hausmann <hausmann@webkit.org>
2026 Not reviewed but trivial one-liner for yet unused macro.
2028 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
2030 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
2034 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2036 Rubber-stamped by Oliver Hunt.
2038 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
2042 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2043 * masm/X86Assembler.h:
2044 (JSC::X86Assembler::orl_i32r):
2046 (JSC::WRECGenerator::generatePatternCharacter):
2047 (JSC::WRECGenerator::generateCharacterClassInverted):
2049 2008-09-10 Sam Weinig <sam@webkit.org>
2051 Reviewed by Geoff Garen.
2053 Add inline property storage for JSObject.
2055 1.2% progression on Sunspider. .5% progression on the v8 test suite.
2057 * JavaScriptCore.exp:
2059 (JSC::CTI::privateCompileGetByIdProto):
2060 (JSC::CTI::privateCompileGetByIdChain):
2062 (JSC::JSObject::mark): There is no reason to check storageSize now that
2064 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
2066 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
2067 now so there is no reason to .get()
2068 (JSC::JSObject::usingInlineStorage):
2069 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
2071 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
2073 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
2074 we know that we are about to add a property that will overflow the inline
2076 * kjs/PropertyMap.cpp:
2077 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
2078 now handled by JSObject.
2079 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
2080 * kjs/PropertyMap.h:
2081 (JSC::PropertyMap::storageSize): Rename from markingCount.
2082 * kjs/StructureID.cpp:
2083 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
2084 if we are using inline storage.
2085 * kjs/StructureID.h:
2087 2008-09-10 Oliver Hunt <oliver@apple.com>
2089 Reviewed by Geoff Garen.
2091 Inline immediate number version of op_mul.
2093 Renamed mull_rr to imull_rr as that's what it's
2094 actually doing, and added imull_i32r for the constant
2095 case immediate multiply.
2097 1.1% improvement to SunSpider.
2100 (JSC::CTI::privateCompileMainPass):
2101 (JSC::CTI::privateCompileSlowCases):
2102 * masm/X86Assembler.h:
2103 (JSC::X86Assembler::):
2104 (JSC::X86Assembler::imull_rr):
2105 (JSC::X86Assembler::imull_i32r):
2107 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2113 * JavaScriptCore.xcodeproj/project.pbxproj:
2115 2008-09-09 Oliver Hunt <oliver@apple.com>
2117 Reviewed by Maciej Stachowiak.
2119 Add optimised access to known properties on the global object.
2121 Improve cross scope access to the global object by emitting
2122 code to access it directly rather than by walking the scope chain.
2124 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
2127 (JSC::CTI::privateCompileMainPass):
2128 (JSC::CTI::emitGetVariableObjectRegister):
2129 (JSC::CTI::emitPutVariableObjectRegister):
2132 (JSC::CodeBlock::dump):
2133 * VM/CodeGenerator.cpp:
2134 (JSC::CodeGenerator::findScopedProperty):
2135 (JSC::CodeGenerator::emitResolve):
2136 (JSC::CodeGenerator::emitGetScopedVar):
2137 (JSC::CodeGenerator::emitPutScopedVar):
2138 * VM/CodeGenerator.h:
2140 (JSC::Machine::privateExecute):
2143 (JSC::FunctionCallResolveNode::emitCode):
2144 (JSC::PostfixResolveNode::emitCode):
2145 (JSC::PrefixResolveNode::emitCode):
2146 (JSC::ReadModifyResolveNode::emitCode):
2147 (JSC::AssignResolveNode::emitCode):
2149 2008-09-10 Maciej Stachowiak <mjs@apple.com>
2153 - enable polymorphic inline caching of properties of primitives
2155 1.012x speedup on SunSpider.
2157 We create special structure IDs for JSString and
2158 JSNumberCell. Unlike normal structure IDs, these cannot hold the
2159 true prototype. Due to JS autoboxing semantics, the prototype used
2160 when looking up string or number properties depends on the lexical
2161 global object of the call site, not the creation site. Thus we
2162 enable StructureIDs to handle this quirk for primitives.
2164 Everything else should be straightforward.
2167 (JSC::CTI::privateCompileGetByIdProto):
2168 (JSC::CTI::privateCompileGetByIdChain):
2170 (JSC::CTI::compileGetByIdProto):
2171 (JSC::CTI::compileGetByIdChain):
2172 * VM/JSPropertyNameIterator.h:
2173 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
2175 (JSC::Machine::Machine):
2176 (JSC::cachePrototypeChain):
2177 (JSC::Machine::tryCachePutByID):
2178 (JSC::Machine::tryCacheGetByID):
2179 (JSC::Machine::privateExecute):
2180 (JSC::Machine::tryCTICachePutByID):
2181 (JSC::Machine::tryCTICacheGetByID):
2182 * kjs/GetterSetter.h:
2183 (JSC::GetterSetter::GetterSetter):
2185 * kjs/JSGlobalData.cpp:
2186 (JSC::JSGlobalData::JSGlobalData):
2187 * kjs/JSGlobalData.h:
2188 * kjs/JSGlobalObject.h:
2189 (JSC::StructureID::prototypeForLookup):
2190 * kjs/JSNumberCell.h:
2191 (JSC::JSNumberCell::JSNumberCell):
2192 (JSC::jsNumberCell):
2194 (JSC::JSObject::prototype):
2198 (JSC::jsOwnedString):
2200 (JSC::JSString::JSString):
2202 (JSC::jsSingleCharacterString):
2203 (JSC::jsSingleCharacterSubstring):
2204 (JSC::jsNontrivialString):
2205 * kjs/SmallStrings.cpp:
2206 (JSC::SmallStrings::createEmptyString):
2207 (JSC::SmallStrings::createSingleCharacterString):
2208 * kjs/StructureID.cpp:
2209 (JSC::StructureID::StructureID):
2210 (JSC::StructureID::addPropertyTransition):
2211 (JSC::StructureID::getterSetterTransition):
2212 (JSC::StructureIDChain::StructureIDChain):
2213 * kjs/StructureID.h:
2214 (JSC::StructureID::create):
2215 (JSC::StructureID::storedPrototype):
2217 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
2219 Reviewed by Sam Weinig.
2221 https://bugs.webkit.org/show_bug.cgi?id=20746
2223 Added WINCE platform macro.
2227 2008-09-09 Sam Weinig <sam@webkit.org>
2229 Reviewed by Mark Rowe.
2231 Remove unnecessary override of getOffset.
2233 Sunspider reports this as a .6% progression.
2235 * JavaScriptCore.exp:
2237 (JSC::JSObject::getDirectLocation):
2238 (JSC::JSObject::getOwnPropertySlotForWrite):
2239 (JSC::JSObject::putDirect):
2240 * kjs/PropertyMap.cpp:
2241 * kjs/PropertyMap.h:
2243 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2245 Reviewed by Maciej Stachowiak.
2247 Bug 20759: Remove MacroAssembler
2248 <https://bugs.webkit.org/show_bug.cgi?id=20759>
2250 Remove MacroAssembler and move its functionality to X86Assembler.
2252 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2253 * JavaScriptCore.xcodeproj/project.pbxproj:
2255 (JSC::CTI::emitGetArg):
2256 (JSC::CTI::emitGetPutArg):
2257 (JSC::CTI::emitPutArg):
2258 (JSC::CTI::emitPutCTIParam):
2259 (JSC::CTI::emitGetCTIParam):
2260 (JSC::CTI::emitPutToCallFrameHeader):
2261 (JSC::CTI::emitGetFromCallFrameHeader):
2262 (JSC::CTI::emitPutResult):
2263 (JSC::CTI::emitDebugExceptionCheck):
2264 (JSC::CTI::emitJumpSlowCaseIfNotImm):
2265 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2266 (JSC::CTI::emitFastArithDeTagImmediate):
2267 (JSC::CTI::emitFastArithReTagImmediate):
2268 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2269 (JSC::CTI::emitFastArithImmToInt):
2270 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2271 (JSC::CTI::emitFastArithIntToImmNoCheck):
2272 (JSC::CTI::compileOpCall):
2273 (JSC::CTI::emitSlowScriptCheck):
2274 (JSC::CTI::privateCompileMainPass):
2275 (JSC::CTI::privateCompileSlowCases):
2276 (JSC::CTI::privateCompile):
2277 (JSC::CTI::privateCompileGetByIdSelf):
2278 (JSC::CTI::privateCompileGetByIdProto):
2279 (JSC::CTI::privateCompileGetByIdChain):
2280 (JSC::CTI::privateCompilePutByIdReplace):
2281 (JSC::CTI::privateArrayLengthTrampoline):
2282 (JSC::CTI::privateStringLengthTrampoline):
2283 (JSC::CTI::compileRegExp):
2285 (JSC::CallRecord::CallRecord):
2286 (JSC::JmpTable::JmpTable):
2287 (JSC::SlowCaseEntry::SlowCaseEntry):
2288 (JSC::CTI::JSRInfo::JSRInfo):
2289 * masm/MacroAssembler.h: Removed.
2290 * masm/MacroAssemblerWin.cpp: Removed.
2291 * masm/X86Assembler.h:
2292 (JSC::X86Assembler::emitConvertToFastCall):
2293 (JSC::X86Assembler::emitRestoreArgumentReference):
2295 (JSC::WRECGenerator::WRECGenerator):
2296 (JSC::WRECParser::WRECParser):
2298 2008-09-09 Sam Weinig <sam@webkit.org>
2300 Reviewed by Cameron Zwarich.
2302 Don't waste the first item in the PropertyStorage.
2304 - Fix typo (makingCount -> markingCount)
2305 - Remove undefined method declaration.
2307 No change on Sunspider.
2310 (JSC::JSObject::mark):
2311 * kjs/PropertyMap.cpp:
2312 (JSC::PropertyMap::put):
2313 (JSC::PropertyMap::remove):
2314 (JSC::PropertyMap::getOffset):
2315 (JSC::PropertyMap::insert):
2316 (JSC::PropertyMap::rehash):
2317 (JSC::PropertyMap::resizePropertyStorage):
2318 (JSC::PropertyMap::checkConsistency):
2319 * kjs/PropertyMap.h:
2320 (JSC::PropertyMap::markingCount): Fix typo.
2322 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2326 Speculative Windows build fix.
2328 * masm/MacroAssemblerWin.cpp:
2329 (JSC::MacroAssembler::emitConvertToFastCall):
2330 (JSC::MacroAssembler::emitRestoreArgumentReference):
2332 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2334 Reviewed by Maciej Stachowiak.
2336 Bug 20755: Create an X86 namespace for register names and other things
2337 <https://bugs.webkit.org/show_bug.cgi?id=20755>
2339 Create an X86 namespace to put X86 register names. Perhaps I will move
2340 opcode names here later as well.
2343 (JSC::CTI::emitGetArg):
2344 (JSC::CTI::emitGetPutArg):
2345 (JSC::CTI::emitPutArg):
2346 (JSC::CTI::emitPutArgConstant):
2347 (JSC::CTI::emitPutCTIParam):
2348 (JSC::CTI::emitGetCTIParam):
2349 (JSC::CTI::emitPutToCallFrameHeader):
2350 (JSC::CTI::emitGetFromCallFrameHeader):
2351 (JSC::CTI::emitPutResult):
2352 (JSC::CTI::emitDebugExceptionCheck):
2353 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2354 (JSC::CTI::compileOpCall):
2355 (JSC::CTI::emitSlowScriptCheck):
2356 (JSC::CTI::privateCompileMainPass):
2357 (JSC::CTI::privateCompileSlowCases):
2358 (JSC::CTI::privateCompile):
2359 (JSC::CTI::privateCompileGetByIdSelf):
2360 (JSC::CTI::privateCompileGetByIdProto):
2361 (JSC::CTI::privateCompileGetByIdChain):
2362 (JSC::CTI::privateCompilePutByIdReplace):
2363 (JSC::CTI::privateArrayLengthTrampoline):
2364 (JSC::CTI::privateStringLengthTrampoline):
2365 (JSC::CTI::compileRegExp):
2367 * masm/X86Assembler.h:
2369 (JSC::X86Assembler::emitModRm_rm):
2370 (JSC::X86Assembler::emitModRm_rm_Unchecked):
2371 (JSC::X86Assembler::emitModRm_rmsib):
2373 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2374 (JSC::WRECGenerator::generateGreedyQuantifier):
2375 (JSC::WRECGenerator::generateParentheses):
2376 (JSC::WRECGenerator::generateBackreference):
2377 (JSC::WRECGenerator::gernerateDisjunction):
2380 2008-09-09 Sam Weinig <sam@webkit.org>
2382 Reviewed by Geoffrey Garen.
2384 Remove unnecessary friend declaration.
2386 * kjs/PropertyMap.h:
2388 2008-09-09 Sam Weinig <sam@webkit.org>
2390 Reviewed by Geoffrey Garen.
2392 Replace uses of PropertyMap::get and PropertyMap::getLocation with
2393 PropertyMap::getOffset.
2395 Sunspider reports this as a .6% improvement.
2397 * JavaScriptCore.exp:
2399 (JSC::JSObject::put):
2400 (JSC::JSObject::deleteProperty):
2401 (JSC::JSObject::getPropertyAttributes):
2403 (JSC::JSObject::getDirect):
2404 (JSC::JSObject::getDirectLocation):
2405 (JSC::JSObject::locationForOffset):
2406 * kjs/PropertyMap.cpp:
2407 (JSC::PropertyMap::remove):
2408 (JSC::PropertyMap::getOffset):
2409 * kjs/PropertyMap.h:
2411 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2413 Reviewed by Sam Weinig.
2415 Bug 20754: Remove emit prefix from assembler opcode methods
2416 <https://bugs.webkit.org/show_bug.cgi?id=20754>
2419 (JSC::CTI::emitGetArg):
2420 (JSC::CTI::emitGetPutArg):
2421 (JSC::CTI::emitPutArg):
2422 (JSC::CTI::emitPutArgConstant):
2423 (JSC::CTI::emitPutCTIParam):
2424 (JSC::CTI::emitGetCTIParam):
2425 (JSC::CTI::emitPutToCallFrameHeader):
2426 (JSC::CTI::emitGetFromCallFrameHeader):
2427 (JSC::CTI::emitPutResult):
2428 (JSC::CTI::emitDebugExceptionCheck):
2429 (JSC::CTI::emitCall):
2430 (JSC::CTI::emitJumpSlowCaseIfNotImm):
2431 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2432 (JSC::CTI::emitFastArithDeTagImmediate):
2433 (JSC::CTI::emitFastArithReTagImmediate):
2434 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2435 (JSC::CTI::emitFastArithImmToInt):
2436 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2437 (JSC::CTI::emitFastArithIntToImmNoCheck):
2438 (JSC::CTI::compileOpCall):
2439 (JSC::CTI::emitSlowScriptCheck):
2440 (JSC::CTI::privateCompileMainPass):
2441 (JSC::CTI::privateCompileSlowCases):
2442 (JSC::CTI::privateCompile):
2443 (JSC::CTI::privateCompileGetByIdSelf):
2444 (JSC::CTI::privateCompileGetByIdProto):
2445 (JSC::CTI::privateCompileGetByIdChain):
2446 (JSC::CTI::privateCompilePutByIdReplace):
2447 (JSC::CTI::privateArrayLengthTrampoline):
2448 (JSC::CTI::privateStringLengthTrampoline):
2449 (JSC::CTI::compileRegExp):
2450 * masm/MacroAssemblerWin.cpp:
2451 (JSC::MacroAssembler::emitConvertToFastCall):
2452 (JSC::MacroAssembler::emitRestoreArgumentReference):
2453 * masm/X86Assembler.h:
2454 (JSC::X86Assembler::pushl_r):
2455 (JSC::X86Assembler::pushl_m):
2456 (JSC::X86Assembler::popl_r):
2457 (JSC::X86Assembler::popl_m):
2458 (JSC::X86Assembler::movl_rr):
2459 (JSC::X86Assembler::addl_rr):
2460 (JSC::X86Assembler::addl_i8r):
2461 (JSC::X86Assembler::addl_i32r):
2462 (JSC::X86Assembler::addl_mr):
2463 (JSC::X86Assembler::andl_rr):
2464 (JSC::X86Assembler::andl_i32r):
2465 (JSC::X86Assembler::cmpl_i8r):
2466 (JSC::X86Assembler::cmpl_rr):
2467 (JSC::X86Assembler::cmpl_rm):
2468 (JSC::X86Assembler::cmpl_i32r):
2469 (JSC::X86Assembler::cmpl_i32m):
2470 (JSC::X86Assembler::cmpw_rm):
2471 (JSC::X86Assembler::orl_rr):
2472 (JSC::X86Assembler::subl_rr):
2473 (JSC::X86Assembler::subl_i8r):
2474 (JSC::X86Assembler::subl_i32r):
2475 (JSC::X86Assembler::subl_mr):
2476 (JSC::X86Assembler::testl_i32r):
2477 (JSC::X86Assembler::testl_rr):
2478 (JSC::X86Assembler::xorl_i8r):
2479 (JSC::X86Assembler::xorl_rr):
2480 (JSC::X86Assembler::sarl_i8r):
2481 (JSC::X86Assembler::sarl_CLr):
2482 (JSC::X86Assembler::shl_i8r):
2483 (JSC::X86Assembler::shll_CLr):
2484 (JSC::X86Assembler::mull_rr):
2485 (JSC::X86Assembler::idivl_r):
2486 (JSC::X86Assembler::cdq):
2487 (JSC::X86Assembler::movl_mr):
2488 (JSC::X86Assembler::movzwl_mr):
2489 (JSC::X86Assembler::movl_rm):
2490 (JSC::X86Assembler::movl_i32r):
2491 (JSC::X86Assembler::movl_i32m):
2492 (JSC::X86Assembler::leal_mr):
2493 (JSC::X86Assembler::ret):
2494 (JSC::X86Assembler::jmp_r):
2495 (JSC::X86Assembler::jmp_m):
2496 (JSC::X86Assembler::call_r):
2498 (JSC::WRECGenerator::generateBacktrack1):
2499 (JSC::WRECGenerator::generateBacktrackBackreference):
2500 (JSC::WRECGenerator::generateBackreferenceQuantifier):
2501 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2502 (JSC::WRECGenerator::generateGreedyQuantifier):
2503 (JSC::WRECGenerator::generatePatternCharacter):
2504 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
2505 (JSC::WRECGenerator::generateCharacterClassInverted):
2506 (JSC::WRECGenerator::generateCharacterClass):
2507 (JSC::WRECGenerator::generateParentheses):
2508 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
2509 (JSC::WRECGenerator::generateAssertionBOL):
2510 (JSC::WRECGenerator::generateAssertionEOL):
2511 (JSC::WRECGenerator::generateAssertionWordBoundary):
2512 (JSC::WRECGenerator::generateBackreference):
2513 (JSC::WRECGenerator::gernerateDisjunction):
2515 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2517 Reviewed by Maciej Stachowiak.
2519 Clean up the WREC code some more.
2522 (JSC::CTI::compileRegExp):
2524 (JSC::getCharacterClassNewline):
2525 (JSC::getCharacterClassDigits):
2526 (JSC::getCharacterClassSpaces):
2527 (JSC::getCharacterClassWordchar):
2528 (JSC::getCharacterClassNondigits):
2529 (JSC::getCharacterClassNonspaces):
2530 (JSC::getCharacterClassNonwordchar):
2531 (JSC::WRECGenerator::generateBacktrack1):
2532 (JSC::WRECGenerator::generateBacktrackBackreference):
2533 (JSC::WRECGenerator::generateBackreferenceQuantifier):
2534 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2535 (JSC::WRECGenerator::generateGreedyQuantifier):
2536 (JSC::WRECGenerator::generatePatternCharacter):
2537 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
2538 (JSC::WRECGenerator::generateCharacterClassInverted):
2539 (JSC::WRECGenerator::generateCharacterClass):
2540 (JSC::WRECGenerator::generateParentheses):
2541 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
2542 (JSC::WRECGenerator::generateAssertionBOL):
2543 (JSC::WRECGenerator::generateAssertionEOL):
2544 (JSC::WRECGenerator::generateAssertionWordBoundary):
2545 (JSC::WRECGenerator::generateBackreference):
2546 (JSC::WRECGenerator::gernerateDisjunction):
2547 (JSC::WRECParser::parseCharacterClass):
2548 (JSC::WRECParser::parseEscape):
2549 (JSC::WRECParser::parseTerm):
2552 2008-09-09 Mark Rowe <mrowe@apple.com>
2554 Build fix, rubber-stamped by Anders Carlsson.
2556 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
2558 * JavaScriptCore.xcodeproj/project.pbxproj:
2560 2008-09-09 Mark Rowe <mrowe@apple.com>
2562 Rubber-stamped by Oliver Hunt.
2564 Fix builds using the "debug" variant.
2566 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
2567 and Release configurations.
2569 * Configurations/JavaScriptCore.xcconfig:
2570 * DerivedSources.make:
2571 * JavaScriptCore.Debug.exp: Removed.
2572 * JavaScriptCore.base.exp: Removed.
2573 * JavaScriptCore.exp: Added.
2574 * JavaScriptCore.xcodeproj/project.pbxproj:
2575 * kjs/identifier.cpp:
2576 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
2577 there is no overhead in Release builds.
2578 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
2580 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
2581 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
2583 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2585 Reviewed by Maciej Stachowiak.
2587 Clean up WREC a bit to bring it closer to our coding style guidelines.
2591 (JSC::getCharacterClass_newline):
2592 (JSC::getCharacterClass_d):
2593 (JSC::getCharacterClass_s):
2594 (JSC::getCharacterClass_w):
2595 (JSC::getCharacterClass_D):
2596 (JSC::getCharacterClass_S):
2597 (JSC::getCharacterClass_W):
2598 (JSC::CharacterClassConstructor::append):
2599 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2600 (JSC::WRECGenerator::generateGreedyQuantifier):
2601 (JSC::WRECGenerator::generateCharacterClassInverted):
2602 (JSC::WRECParser::parseQuantifier):
2603 (JSC::WRECParser::parsePatternCharacterQualifier):
2604 (JSC::WRECParser::parseCharacterClassQuantifier):
2605 (JSC::WRECParser::parseBackreferenceQuantifier):
2607 (JSC::Quantifier::):
2608 (JSC::Quantifier::Quantifier):
2610 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
2612 Reviewed by Alexey Proskuryakov.
2614 Try MIME charset names before trying IANA names
2615 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
2617 * wtf/StringExtras.h: (strcasecmp): Added.
2619 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2621 Reviewed by Mark Rowe.
2623 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
2624 <https://bugs.webkit.org/show_bug.cgi?id=20719>
2625 <rdar://problem/6205787>
2627 Fix a typo in the case-insensitive matching of character patterns.
2630 (JSC::WRECGenerator::generatePatternCharacter):
2632 2008-09-09 Maciej Stachowiak <mjs@apple.com>
2634 Reviewed by Sam Weinig.
2636 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
2638 1.012x speedup on SunSpider.
2640 * kjs/MathObject.cpp:
2641 (JSC::MathObject::getOwnPropertySlot):
2643 (JSC::setUpStaticFunctionSlot):
2645 (JSC::getStaticPropertySlot):
2647 2008-09-08 Sam Weinig <sam@webkit.org>
2649 Reviewed by Maciej Stachowiak and Oliver Hunt.
2651 Split storage of properties out of the PropertyMap and into the JSObject
2652 to allow sharing PropertyMap on the StructureID. In order to get this
2653 function correctly, the StructureID's transition mappings were changed to
2654 transition based on property name and attribute pairs, instead of just
2657 - Removes the single property optimization now that the PropertyMap is shared.
2658 This will be replaced by in-lining some values on the JSObject.
2660 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
2662 * JavaScriptCore.base.exp:
2664 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
2665 (JSC::CTI::privateCompileGetByIdProto): Ditto.
2666 (JSC::CTI::privateCompileGetByIdChain): Ditto.
2667 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
2669 (JSC::JSObject::mark): Mark the PropertyStorage.
2670 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
2671 (JSC::JSObject::deleteProperty): Ditto.
2672 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
2673 (JSC::JSObject::defineSetter): Ditto.
2674 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
2675 (JSC::JSObject::getPropertyNames): Ditto.
2676 (JSC::JSObject::removeDirect): Ditto.
2677 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
2678 (JSC::JSObject::propertyStorage): return the PropertyStorage.
2679 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
2680 (JSC::JSObject::getDirectLocation): Ditto.
2681 (JSC::JSObject::offsetForLocation): Compute location directly.
2682 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
2683 (JSC::JSObject::hasGetterSetterProperties): Ditto.
2684 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
2685 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
2686 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
2687 (JSC::JSObject::getOwnPropertySlot): Ditto.
2688 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
2689 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
2690 (JSC::PropertyMap::checkConsistency):
2691 (JSC::PropertyMap::operator=):
2692 (JSC::PropertyMap::~PropertyMap):
2693 (JSC::PropertyMap::get):
2694 (JSC::PropertyMap::getLocation):
2695 (JSC::PropertyMap::put):
2696 (JSC::PropertyMap::getOffset):
2697 (JSC::PropertyMap::insert):
2698 (JSC::PropertyMap::expand):
2699 (JSC::PropertyMap::rehash):
2700 (JSC::PropertyMap::createTable):
2701 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
2702 (JSC::PropertyMap::remove):
2703 (JSC::PropertyMap::getEnumerablePropertyNames):
2704 * kjs/PropertyMap.h:
2705 (JSC::PropertyMapEntry::PropertyMapEntry):
2706 (JSC::PropertyMap::isEmpty):
2707 (JSC::PropertyMap::size):
2708 (JSC::PropertyMap::makingCount):
2709 (JSC::PropertyMap::PropertyMap):
2711 * kjs/StructureID.cpp:
2712 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
2714 (JSC::StructureID::toDictionaryTransition): Copy the map.
2715 (JSC::StructureID::changePrototypeTransition): Copy the map.
2716 (JSC::StructureID::getterSetterTransition): Copy the map.
2717 (JSC::StructureID::~StructureID):
2718 * kjs/StructureID.h:
2719 (JSC::TransitionTableHash::hash): Custom hash for transition map.
2720 (JSC::TransitionTableHash::equal): Ditto.
2721 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
2722 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
2723 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
2724 (JSC::StructureID::propertyMap): Added.
2726 2008-09-08 Oliver Hunt <oliver@apple.com>
2728 Reviewed by Mark Rowe.
2730 Bug 20694: Slow Script error pops up when running Dromaeo tests
2732 Correct error in timeout logic where execution tick count would
2733 be reset to incorrect value due to incorrect offset and indirection.
2734 Codegen for the slow script dialog was factored out into a separate
2735 method (emitSlowScriptCheck) rather than having multiple copies of
2736 the same code. Also added calls to generate slow script checks
2737 for loop_if_less and loop_if_true opcodes.
2740 (JSC::CTI::emitSlowScriptCheck):
2741 (JSC::CTI::privateCompileMainPass):
2742 (JSC::CTI::privateCompileSlowCases):
2745 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2747 Reviewed by Maciej Stachowiak.
2749 Remove references to the removed WRECompiler class.
2754 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2756 Rubber-stamped by Mark Rowe.
2758 Fix the build with CTI enabled but WREC disabled.
2763 2008-09-08 Dan Bernstein <mitz@apple.com>
2768 (JSC::StatementNode::):
2771 2008-09-08 Kevin McCullough <kmccullough@apple.com>
2775 <rdar://problem/6134407> Breakpoints in for loops, while loops or
2776 conditions without curly braces don't break. (19306)
2777 -Statement Lists already emit debug hooks but conditionals without
2778 brackets are not lists.
2781 (KJS::IfNode::emitCode):
2782 (KJS::IfElseNode::emitCode):
2783 (KJS::DoWhileNode::emitCode):
2784 (KJS::WhileNode::emitCode):
2785 (KJS::ForNode::emitCode):
2786 (KJS::ForInNode::emitCode):
2788 (KJS::StatementNode::):
2791 2008-09-08 Maciej Stachowiak <mjs@apple.com>
2793 Reviewed by Anders Carlsson.
2795 - Cache the code generated for eval to speed up SunSpider and web sites
2796 https://bugs.webkit.org/show_bug.cgi?id=20718
2799 2.29x on date-format-tofte
2801 Lots of real sites seem to get many hits on this cache as well,
2802 including GMail, Google Spreadsheets, Slate and Digg (the last of
2803 these gets over 100 hits on initial page load).
2806 (JSC::EvalCodeCache::get):
2808 (JSC::Machine::callEval):
2809 (JSC::Machine::privateExecute):
2810 (JSC::Machine::cti_op_call_eval):
2813 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2815 Reviewed by Oliver Hunt.
2817 Bug 20711: Change KJS prefix on preprocessor macros to JSC
2818 <https://bugs.webkit.org/show_bug.cgi?id=20711>
2820 * kjs/CommonIdentifiers.cpp:
2821 (JSC::CommonIdentifiers::CommonIdentifiers):
2822 * kjs/CommonIdentifiers.h:
2823 * kjs/PropertySlot.h:
2824 (JSC::PropertySlot::getValue):
2825 (JSC::PropertySlot::putValue):
2826 (JSC::PropertySlot::setValueSlot):
2827 (JSC::PropertySlot::setValue):
2828 (JSC::PropertySlot::setRegisterSlot):
2833 (JSC::ExpressionNode::):
2834 (JSC::StatementNode::):
2836 (JSC::BooleanNode::):
2837 (JSC::NumberNode::):
2838 (JSC::ImmediateNumberNode::):
2839 (JSC::StringNode::):
2840 (JSC::RegExpNode::):
2842 (JSC::ResolveNode::):
2843 (JSC::ElementNode::):
2845 (JSC::PropertyNode::):
2846 (JSC::PropertyListNode::):
2847 (JSC::ObjectLiteralNode::):
2848 (JSC::BracketAccessorNode::):
2849 (JSC::DotAccessorNode::):
2850 (JSC::ArgumentListNode::):
2851 (JSC::ArgumentsNode::):
2852 (JSC::NewExprNode::):
2853 (JSC::EvalFunctionCallNode::):
2854 (JSC::FunctionCallValueNode::):
2855 (JSC::FunctionCallResolveNode::):
2856 (JSC::FunctionCallBracketNode::):
2857 (JSC::FunctionCallDotNode::):
2858 (JSC::PrePostResolveNode::):
2859 (JSC::PostfixResolveNode::):
2860 (JSC::PostfixBracketNode::):
2861 (JSC::PostfixDotNode::):
2862 (JSC::PostfixErrorNode::):
2863 (JSC::DeleteResolveNode::):
2864 (JSC::DeleteBracketNode::):
2865 (JSC::DeleteDotNode::):
2866 (JSC::DeleteValueNode::):
2868 (JSC::TypeOfResolveNode::):
2869 (JSC::TypeOfValueNode::):
2870 (JSC::PrefixResolveNode::):
2871 (JSC::PrefixBracketNode::):
2872 (JSC::PrefixDotNode::):
2873 (JSC::PrefixErrorNode::):
2874 (JSC::UnaryPlusNode::):
2875 (JSC::NegateNode::):
2876 (JSC::BitwiseNotNode::):
2877 (JSC::LogicalNotNode::):
2883 (JSC::LeftShiftNode::):
2884 (JSC::RightShiftNode::):
2885 (JSC::UnsignedRightShiftNode::):
2887 (JSC::GreaterNode::):
2888 (JSC::LessEqNode::):
2889 (JSC::GreaterEqNode::):
2890 (JSC::ThrowableBinaryOpNode::):
2891 (JSC::InstanceOfNode::):
2894 (JSC::NotEqualNode::):
2895 (JSC::StrictEqualNode::):
2896 (JSC::NotStrictEqualNode::):
2897 (JSC::BitAndNode::):
2899 (JSC::BitXOrNode::):
2900 (JSC::LogicalOpNode::):
2901 (JSC::ConditionalNode::):
2902 (JSC::ReadModifyResolveNode::):
2903 (JSC::AssignResolveNode::):
2904 (JSC::ReadModifyBracketNode::):
2905 (JSC::AssignBracketNode::):
2906 (JSC::AssignDotNode::):
2907 (JSC::ReadModifyDotNode::):
2908 (JSC::AssignErrorNode::):
2910 (JSC::VarDeclCommaNode::):
2911 (JSC::ConstDeclNode::):
2912 (JSC::ConstStatementNode::):
2913 (JSC::EmptyStatementNode::):
2914 (JSC::DebuggerStatementNode::):
2915 (JSC::ExprStatementNode::):
2916 (JSC::VarStatementNode::):
2918 (JSC::IfElseNode::):
2919 (JSC::DoWhileNode::):
2922 (JSC::ContinueNode::):
2924 (JSC::ReturnNode::):
2929 (JSC::ParameterNode::):
2931 (JSC::ProgramNode::):
2933 (JSC::FunctionBodyNode::):
2934 (JSC::FuncExprNode::):
2935 (JSC::FuncDeclNode::):
2936 (JSC::CaseClauseNode::):
2937 (JSC::ClauseListNode::):
2938 (JSC::CaseBlockNode::):
2939 (JSC::SwitchNode::):
2941 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2943 Reviewed by Maciej Stachowiak.
2945 Bug 20704: Replace the KJS namespace
2946 <https://bugs.webkit.org/show_bug.cgi?id=20704>
2948 Rename the KJS namespace to JSC. There are still some uses of KJS in
2949 preprocessor macros and comments, but these will also be changed some
2950 time in the near future.
2957 * API/JSCallbackConstructor.cpp:
2958 * API/JSCallbackConstructor.h:
2959 * API/JSCallbackFunction.cpp:
2960 * API/JSCallbackFunction.h:
2961 * API/JSCallbackObject.cpp:
2962 * API/JSCallbackObject.h:
2963 * API/JSCallbackObjectFunctions.h:
2964 * API/JSClassRef.cpp:
2965 (OpaqueJSClass::staticValues):
2966 (OpaqueJSClass::staticFunctions):
2968 * API/JSContextRef.cpp:
2969 * API/JSObjectRef.cpp:
2970 * API/JSProfilerPrivate.cpp:
2971 * API/JSStringRef.cpp:
2972 * API/JSValueRef.cpp:
2974 * API/OpaqueJSString.cpp:
2975 * API/OpaqueJSString.h:
2976 * JavaScriptCore.Debug.exp:
2977 * JavaScriptCore.base.exp:
2983 * VM/CodeGenerator.cpp:
2984 * VM/CodeGenerator.h:
2985 * VM/ExceptionHelpers.cpp:
2986 * VM/ExceptionHelpers.h:
2988 * VM/JSPropertyNameIterator.cpp:
2989 * VM/JSPropertyNameIterator.h:
2997 * VM/RegisterFile.cpp:
2998 * VM/RegisterFile.h:
3001 * VM/SamplingTool.cpp:
3002 * VM/SamplingTool.h:
3003 * VM/SegmentedVector.h:
3006 * kjs/Arguments.cpp:
3008 * kjs/ArrayConstructor.cpp:
3009 * kjs/ArrayConstructor.h:
3010 * kjs/ArrayPrototype.cpp:
3011 * kjs/ArrayPrototype.h:
3012 * kjs/BatchedTransitionOptimizer.h:
3013 * kjs/BooleanConstructor.cpp:
3014 * kjs/BooleanConstructor.h:
3015 * kjs/BooleanObject.cpp:
3016 * kjs/BooleanObject.h:
3017 * kjs/BooleanPrototype.cpp:
3018 * kjs/BooleanPrototype.h:
3022 * kjs/CommonIdentifiers.cpp:
3023 * kjs/CommonIdentifiers.h:
3024 * kjs/ConstructData.cpp:
3025 * kjs/ConstructData.h:
3026 * kjs/DateConstructor.cpp:
3027 * kjs/DateConstructor.h:
3028 * kjs/DateInstance.cpp:
3029 (JSC::DateInstance::msToGregorianDateTime):
3030 * kjs/DateInstance.h:
3033 * kjs/DatePrototype.cpp:
3034 * kjs/DatePrototype.h:
3035 * kjs/DebuggerCallFrame.cpp:
3036 * kjs/DebuggerCallFrame.h:
3039 * kjs/ErrorConstructor.cpp:
3040 * kjs/ErrorConstructor.h:
3041 * kjs/ErrorInstance.cpp:
3042 * kjs/ErrorInstance.h:
3043 * kjs/ErrorPrototype.cpp:
3044 * kjs/ErrorPrototype.h:
3045 * kjs/ExecState.cpp:
3047 * kjs/FunctionConstructor.cpp:
3048 * kjs/FunctionConstructor.h:
3049 * kjs/FunctionPrototype.cpp:
3050 * kjs/FunctionPrototype.h:
3051 * kjs/GetterSetter.cpp:
3052 * kjs/GetterSetter.h:
3053 * kjs/GlobalEvalFunction.cpp:
3054 * kjs/GlobalEvalFunction.h:
3055 * kjs/IndexToNameMap.cpp:
3056 * kjs/IndexToNameMap.h:
3057 * kjs/InitializeThreading.cpp:
3058 * kjs/InitializeThreading.h:
3059 * kjs/InternalFunction.cpp:
3060 * kjs/InternalFunction.h:
3061 (JSC::InternalFunction::InternalFunction):
3062 * kjs/JSActivation.cpp:
3063 * kjs/JSActivation.h:
3068 * kjs/JSFunction.cpp:
3070 (JSC::JSFunction::JSFunction):
3071 * kjs/JSGlobalData.cpp:
3072 (JSC::JSGlobalData::JSGlobalData):
3073 * kjs/JSGlobalData.h:
3074 * kjs/JSGlobalObject.cpp:
3075 * kjs/JSGlobalObject.h:
3076 * kjs/JSGlobalObjectFunctions.cpp:
3077 * kjs/JSGlobalObjectFunctions.h:
3078 * kjs/JSImmediate.cpp:
3079 * kjs/JSImmediate.h:
3082 * kjs/JSNotAnObject.cpp:
3083 * kjs/JSNotAnObject.h:
3084 * kjs/JSNumberCell.cpp:
3085 * kjs/JSNumberCell.h:
3088 * kjs/JSStaticScopeObject.cpp:
3089 * kjs/JSStaticScopeObject.h:
3095 * kjs/JSVariableObject.cpp:
3096 * kjs/JSVariableObject.h:
3097 * kjs/JSWrapperObject.cpp:
3098 * kjs/JSWrapperObject.h:
3099 * kjs/LabelStack.cpp:
3101 * kjs/MathObject.cpp:
3103 * kjs/NativeErrorConstructor.cpp:
3104 * kjs/NativeErrorConstructor.h:
3105 * kjs/NativeErrorPrototype.cpp:
3106 * kjs/NativeErrorPrototype.h:
3108 * kjs/NumberConstructor.cpp:
3109 * kjs/NumberConstructor.h:
3110 * kjs/NumberObject.cpp:
3111 * kjs/NumberObject.h:
3112 * kjs/NumberPrototype.cpp:
3113 * kjs/NumberPrototype.h:
3114 * kjs/ObjectConstructor.cpp:
3115 * kjs/ObjectConstructor.h:
3116 * kjs/ObjectPrototype.cpp:
3117 * kjs/ObjectPrototype.h:
3120 * kjs/PropertyMap.cpp:
3121 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
3122 * kjs/PropertyMap.h:
3123 * kjs/PropertyNameArray.cpp:
3124 * kjs/PropertyNameArray.h:
3125 * kjs/PropertySlot.cpp:
3126 * kjs/PropertySlot.h:
3127 * kjs/PrototypeFunction.cpp:
3128 * kjs/PrototypeFunction.h:
3129 * kjs/PutPropertySlot.h:
3130 * kjs/RegExpConstructor.cpp:
3131 * kjs/RegExpConstructor.h:
3132 * kjs/RegExpObject.cpp:
3133 * kjs/RegExpObject.h:
3134 * kjs/RegExpPrototype.cpp:
3135 * kjs/RegExpPrototype.h:
3136 * kjs/ScopeChain.cpp:
3138 * kjs/ScopeChainMark.h:
3141 * kjs/SmallStrings.cpp:
3142 * kjs/SmallStrings.h:
3143 * kjs/SourceProvider.h:
3144 * kjs/SourceRange.h:
3145 * kjs/StringConstructor.cpp:
3146 * kjs/StringConstructor.h:
3147 * kjs/StringObject.cpp:
3148 * kjs/StringObject.h:
3149 * kjs/StringObjectThatMasqueradesAsUndefined.h:
3150 * kjs/StringPrototype.cpp:
3151 * kjs/StringPrototype.h:
3152 * kjs/StructureID.cpp:
3153 * kjs/StructureID.h:
3154 * kjs/SymbolTable.h:
3155 * kjs/collector.cpp:
3158 * kjs/create_hash_table:
3164 * kjs/identifier.cpp:
3166 (JSC::Identifier::equal):
3167 * kjs/interpreter.cpp:
3168 * kjs/interpreter.h:
3170 (JSC::Lexer::Lexer):
3171 (JSC::Lexer::clear):
3172 (JSC::Lexer::makeIdentifier):
3178 * kjs/nodes2string.cpp:
3179 * kjs/operations.cpp:
3187 (JSC::IdentifierRepHash::hash):
3189 * masm/MacroAssembler.h:
3190 * masm/MacroAssemblerWin.cpp:
3191 * masm/X86Assembler.h:
3192 * pcre/pcre_exec.cpp:
3193 * profiler/CallIdentifier.h:
3195 * profiler/HeavyProfile.cpp:
3196 * profiler/HeavyProfile.h:
3197 * profiler/Profile.cpp:
3198 * profiler/Profile.h:
3199 * profiler/ProfileGenerator.cpp:
3200 * profiler/ProfileGenerator.h:
3201 * profiler/ProfileNode.cpp:
3202 * profiler/ProfileNode.h:
3203 * profiler/Profiler.cpp:
3204 * profiler/Profiler.h:
3205 * profiler/TreeProfile.cpp:
3206 * profiler/TreeProfile.h:
3211 2008-09-07 Maciej Stachowiak <mjs@apple.com>
3213 Reviewed by Dan Bernstein.
3215 - rename IA32MacroAssembler class to X86Assembler
3217 We otherwise call the platform X86, and also, I don't see any macros.
3219 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3220 * JavaScriptCore.xcodeproj/project.pbxproj:
3221 * masm/IA32MacroAsm.h: Removed.
3222 * masm/MacroAssembler.h:
3223 (KJS::MacroAssembler::MacroAssembler):
3224 * masm/MacroAssemblerWin.cpp:
3225 (KJS::MacroAssembler::emitRestoreArgumentReference):
3226 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
3227 (KJS::X86Assembler::X86Assembler):
3229 (KJS::WRECGenerator::generateNonGreedyQuantifier):
3230 (KJS::WRECGenerator::generateGreedyQuantifier):
3231 (KJS::WRECGenerator::generateParentheses):
3232 (KJS::WRECGenerator::generateBackreference):
3233 (KJS::WRECGenerator::gernerateDisjunction):
3236 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
3240 Visual C++ seems to have some odd casting rules, so just convert the
3241 offending cast back to a C-style cast for now.
3243 * kjs/collector.cpp:
3244 (KJS::otherThreadStackPointer):
3246 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3248 Reviewed by Mark Rowe.
3250 Attempt to fix the Windows build by using a const_cast to cast regs.Esp
3251 to a uintptr_t instead of a reinterpret_cast.
3253 * kjs/collector.cpp:
3254 (KJS::otherThreadStackPointer):
3256 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3258 Reviewed by Sam Weinig.
3260 Remove C-style casts from kjs/collector.cpp.
3262 * kjs/collector.cpp:
3263 (KJS::Heap::heapAllocate):
3264 (KJS::currentThreadStackBase):
3265 (KJS::Heap::markConservatively):
3266 (KJS::otherThreadStackPointer):
3267 (KJS::Heap::markOtherThreadConservatively):
3270 2008-09-07 Mark Rowe <mrowe@apple.com>
3272 Build fix for the debug variant.
3274 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
3276 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3278 Reviewed by Timothy Hatcher.
3280 Remove C-style casts from the CTI code.
3283 (KJS::CTI::emitGetArg):
3284 (KJS::CTI::emitGetPutArg):
3285 (KJS::ctiRepatchCallByReturnAddress):
3286 (KJS::CTI::compileOpCall):
3287 (KJS::CTI::privateCompileMainPass):
3288 (KJS::CTI::privateCompileGetByIdSelf):
3289 (KJS::CTI::privateCompileGetByIdProto):
3290 (KJS::CTI::privateCompileGetByIdChain):
3291 (KJS::CTI::privateCompilePutByIdReplace):
3292 (KJS::CTI::privateArrayLengthTrampoline):
3293 (KJS::CTI::privateStringLengthTrampoline):
3295 === End merge of squirrelfish-extreme ===
3297 2008-09-06 Gavin Barraclough <barraclough@apple.com>
3299 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
3301 - refactor WREC to share more of the JIT infrastructure with CTI
3304 (KJS::CTI::emitGetArg):
3305 (KJS::CTI::emitGetPutArg):
3306 (KJS::CTI::emitPutArg):
3307 (KJS::CTI::emitPutArgConstant):
3308 (KJS::CTI::emitPutCTIParam):
3309 (KJS::CTI::emitGetCTIParam):
3310 (KJS::CTI::emitPutToCallFrameHeader):
3311 (KJS::CTI::emitGetFromCallFrameHeader):
3312 (KJS::CTI::emitPutResult):
3313 (KJS::CTI::emitDebugExceptionCheck):
3314 (KJS::CTI::emitJumpSlowCaseIfNotImm):
3315 (KJS::CTI::emitJumpSlowCaseIfNotImms):
3316 (KJS::CTI::emitFastArithDeTagImmediate):
3317 (KJS::CTI::emitFastArithReTagImmediate):
3318 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
3319 (KJS::CTI::emitFastArithImmToInt):
3320 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
3321 (KJS::CTI::emitFastArithIntToImmNoCheck):
3323 (KJS::CTI::compileOpCall):
3324 (KJS::CTI::privateCompileMainPass):
3325 (KJS::CTI::privateCompileSlowCases):
3326 (KJS::CTI::privateCompile):
3327 (KJS::CTI::privateCompileGetByIdSelf):
3328 (KJS::CTI::privateCompileGetByIdProto):
3329 (KJS::CTI::privateCompileGetByIdChain):
3330 (KJS::CTI::privateCompilePutByIdReplace):
3331 (KJS::CTI::privateArrayLengthTrampoline):
3332 (KJS::CTI::privateStringLengthTrampoline):
3333 (KJS::CTI::compileRegExp):
3335 (KJS::CallRecord::CallRecord):
3336 (KJS::JmpTable::JmpTable):
3337 (KJS::SlowCaseEntry::SlowCaseEntry):
3338 (KJS::CTI::JSRInfo::JSRInfo):
3340 (KJS::RegExp::RegExp):
3342 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
3343 (KJS::GeneratePatternCharacterFunctor::generateAtom):
3344 (KJS::GeneratePatternCharacterFunctor::backtrack):
3345 (KJS::GenerateCharacterClassFunctor::generateAtom):
3346 (KJS::GenerateCharacterClassFunctor::backtrack):
3347 (KJS::GenerateBackreferenceFunctor::generateAtom):
3348 (KJS::GenerateBackreferenceFunctor::backtrack):
3349 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
3350 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
3351 (KJS::WRECGenerate::generateBacktrack1):
3352 (KJS::WRECGenerate::generateBacktrackBackreference):
3353 (KJS::WRECGenerate::generateBackreferenceQuantifier):
3354 (KJS::WRECGenerate::generateNonGreedyQuantifier):
3355 (KJS::WRECGenerate::generateGreedyQuantifier):
3356 (KJS::WRECGenerate::generatePatternCharacter):
3357 (KJS::WRECGenerate::generateCharacterClassInvertedRange):
3358 (KJS::WRECGenerate::generateCharacterClassInverted):
3359 (KJS::WRECGenerate::generateCharacterClass):
3360 (KJS::WRECGenerate::generateParentheses):
3361 (KJS::WRECGenerate::generateParenthesesNonGreedy):
3362 (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
3363 (KJS::WRECGenerate::generateAssertionBOL):
3364 (KJS::WRECGenerate::generateAssertionEOL):
3365 (KJS::WRECGenerate::generateAssertionWordBoundary):
3366 (KJS::WRECGenerate::generateBackreference):
3367 (KJS::WRECGenerate::gernerateDisjunction):
3368 (KJS::WRECGenerate::terminateDisjunction):
3369 (KJS::WRECParser::parseGreedyQuantifier):
3370 (KJS::WRECParser::parseQuantifier):
3371 (KJS::WRECParser::parsePatternCharacterQualifier):
3372 (KJS::WRECParser::parseCharacterClassQuantifier):
3373 (KJS::WRECParser::parseBackreferenceQuantifier):
3374 (KJS::WRECParser::parseParentheses):
3375 (KJS::WRECParser::parseCharacterClass):
3376 (KJS::WRECParser::parseOctalEscape):
3377 (KJS::WRECParser::parseEscape):
3378 (KJS::WRECParser::parseTerm):
3379 (KJS::WRECParser::parseDisjunction):
3381 (KJS::WRECGenerate::WRECGenerate):
3382 (KJS::WRECParser::):
3383 (KJS::WRECParser::WRECParser):
3384 (KJS::WRECParser::parseAlternative):
3385 (KJS::WRECParser::isEndOfPattern):
3387 2008-09-06 Oliver Hunt <oliver@apple.com>
3389 Reviewed by NOBODY (Build fix).
3391 Fix the sampler build.
3393 * VM/SamplingTool.h:
3395 2008-09-06 Oliver Hunt <oliver@apple.com>
3397 Reviewed by Maciej Stachowiak.
3399 Jump through the necessary hoops required to make MSVC cooperate with SFX
3401 We now explicitly declare the calling convention on all cti_op_* cfunctions,
3402 and return int instead of bool where appropriate (despite the cdecl calling
3403 convention seems to state MSVC generates code that returns the result value
3404 through ecx). SFX behaves slightly differently under MSVC, specifically it
3405 stores the base argument address for the cti_op_* functions in the first
3406 argument, and then does the required stack manipulation through that pointer.
3407 This is necessary as MSVC's optimisations assume they have complete control
3408 of the stack, and periodically elide our stack manipulations, or move
3409 values in unexpected ways. MSVC also frequently produces tail calls which may
3410 clobber the first argument, so the MSVC path is slightly less efficient due
3411 to the need to restore it.
3413 * JavaScriptCore.xcodeproj/project.pbxproj:
3416 (KJS::CTI::compileOpCall):
3417 (KJS::CTI::privateCompileMainPass):
3418 (KJS::CTI::privateCompileSlowCases):
3422 * masm/MacroAssembler.h:
3423 (KJS::MacroAssembler::emitConvertToFastCall):
3424 * masm/MacroAssemblerIA32GCC.cpp: Removed.
3425 For performance reasons we need these no-op functions to be inlined.
3427 * masm/MacroAssemblerWin.cpp:
3428 (KJS::MacroAssembler::emitRestoreArgumentReference):
3431 2008-09-05 Geoffrey Garen <ggaren@apple.com>
3433 Reviewed by Maciej Stachowiak, or maybe the other way around.
3435 Added the ability to coalesce JITCode buffer grow operations by first
3436 growing the buffer and then executing unchecked puts to it.
3438 About a 2% speedup on date-format-tofte.
3441 (KJS::CTI::compileOpCall):
3442 * masm/IA32MacroAsm.h:
3443 (KJS::JITCodeBuffer::ensureSpace):
3444 (KJS::JITCodeBuffer::putByteUnchecked):
3445 (KJS::JITCodeBuffer::putByte):
3446 (KJS::JITCodeBuffer::putShortUnchecked):
3447 (KJS::JITCodeBuffer::putShort):
3448 (KJS::JITCodeBuffer::putIntUnchecked):
3449 (KJS::JITCodeBuffer::putInt):
3450 (KJS::IA32MacroAssembler::emitTestl_i32r):
3451 (KJS::IA32MacroAssembler::emitMovl_mr):
3452 (KJS::IA32MacroAssembler::emitMovl_rm):
3453 (KJS::IA32MacroAssembler::emitMovl_i32m):
3454 (KJS::IA32MacroAssembler::emitUnlinkedJe):
3455 (KJS::IA32MacroAssembler::emitModRm_rr):
3456 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
3457 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
3458 (KJS::IA32MacroAssembler::emitModRm_rm):
3459 (KJS::IA32MacroAssembler::emitModRm_opr):
3460 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
3461 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
3463 2008-09-05 Mark Rowe <mrowe@apple.com>
3465 Reviewed by Sam Weinig.
3467 Disable WREC and CTI on platforms that we have not yet had a chance to test with.
3471 2008-09-05 Geoffrey Garen <ggaren@apple.com>
3473 Reviewed by Sam Weinig.
3475 Use jo instead of a mask compare when fetching array.length and
3476 string.length. 4% speedup on array.length / string.length torture
3480 (KJS::CTI::privateArrayLengthTrampoline):
3481 (KJS::CTI::privateStringLengthTrampoline):
3483 2008-09-05 Geoffrey Garen <ggaren@apple.com>
3485 Reviewed by Sam Weinig.
3487 Removed a CTI compilation pass by recording labels during bytecode
3488 generation. This is more to reduce complexity than it is to improve
3491 SunSpider reports no change.
3493 CodeBlock now keeps a "labels" set, which holds the offsets of all the
3494 instructions that can be jumped to.
3496 * VM/CTI.cpp: Nixed a pass.
3498 * VM/CodeBlock.h: Added a "labels" set.
3500 * VM/LabelID.h: No need for a special LableID for holding jump
3501 destinations, since the CodeBlock now knows all jump destinations.
3503 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
3507 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
3509 2008-09-05 Mark Rowe <mrowe@apple.com>
3511 Reviewed by Oliver Hunt and Gavin Barraclough.
3513 Move the JITCodeBuffer onto Machine and remove the static variables.
3515 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
3517 (KJS::Machine::Machine): Allocate a JITCodeBuffer.
3519 * kjs/RegExpConstructor.cpp:
3520 (KJS::constructRegExp): Pass the ExecState through.
3521 * kjs/RegExpPrototype.cpp:
3522 (KJS::regExpProtoFuncCompile): Ditto.
3523 * kjs/StringPrototype.cpp:
3524 (KJS::stringProtoFuncMatch): Ditto.
3525 (KJS::stringProtoFuncSearch): Ditto.
3527 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
3528 so that we have access to an ExecState.
3530 (KJS::RegExpNode::):
3531 * kjs/nodes2string.cpp:
3533 (KJS::RegExp::RegExp): Pass the ExecState through.
3534 (KJS::RegExp::create): Ditto.
3536 * masm/IA32MacroAsm.h:
3537 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
3540 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
3543 2008-09-05 Mark Rowe <mrowe@apple.com>
3545 Reviewed by Oliver Hunt and Gavin Barraclough.
3547 Fix the build when CTI is disabled.
3550 (KJS::CodeBlock::~CodeBlock):
3551 * VM/CodeGenerator.cpp:
3552 (KJS::prepareJumpTableForStringSwitch):
3554 (KJS::Machine::Machine):
3555 (KJS::Machine::~Machine):
3557 2008-09-05 Gavin Barraclough <barraclough@apple.com>
3559 Reviewed by Mark Rowe.
3561 Fix some windows abi issues.
3564 (KJS::CTI::privateCompileMainPass):
3565 (KJS::CTI::privateCompileSlowCases):
3567 (KJS::CallRecord::CallRecord):
3570 (KJS::Machine::cti_op_resolve_func):
3571 (KJS::Machine::cti_op_post_inc):
3572 (KJS::Machine::cti_op_resolve_with_base):
3573 (KJS::Machine::cti_op_post_dec):
3576 2008-09-05 Mark Rowe <mrowe@apple.com>
3578 Reviewed by Sam Weinig.
3580 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
3583 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
3584 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
3586 2008-09-04 Mark Rowe <mrowe@apple.com>
3588 Reviewed by Sam Weinig.
3590 Fix fast/dom/Window/console-functions.html.
3592 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
3593 such as console.log would use the line number of the last JS function on the call stack.
3596 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
3597 and restore it when the function is done.
3598 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
3600 2008-09-05 Oliver Hunt <oliver@apple.com>
3602 Start bringing up SFX on windows.
3604 Reviewed by Mark Rowe and Sam Weinig
3606 Start doing the work to bring up SFX on windows. Initially
3607 just working on WREC, as it does not make any calls so reduces
3608 the amount of code that needs to be corrected.
3610 Start abstracting the CTI JIT codegen engine.
3613 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3614 * JavaScriptCore.xcodeproj/project.pbxproj:
3616 * masm/IA32MacroAsm.h:
3617 * masm/MacroAssembler.h: Added.
3618 (KJS::MacroAssembler::MacroAssembler):
3619 * masm/MacroAssemblerIA32GCC.cpp: Added.
3620 (KJS::MacroAssembler::emitConvertToFastCall):
3621 * masm/MacroAssemblerWin.cpp: Added.
3622 (KJS::MacroAssembler::emitConvertToFastCall):
3624 (KJS::WRECompiler::parseGreedyQuantifier):
3625 (KJS::WRECompiler::parseCharacterClass):
3626 (KJS::WRECompiler::parseEscape):
3627 (KJS::WRECompiler::compilePattern):
3630 2008-09-04 Gavin Barraclough <barraclough@apple.com>
3632 Reviewed by Sam Weinig.
3634 Support for slow scripts (timeout checking).
3637 (KJS::CTI::privateCompileMainPass):
3638 (KJS::CTI::privateCompile):
3640 (KJS::slideRegisterWindowForCall):
3641 (KJS::Machine::cti_timeout_check):
3642 (KJS::Machine::cti_vm_throw):