1 2008-09-22 Darin Adler <darin@apple.com>
3 Reviewed by Sam Weinig.
5 - https://bugs.webkit.org/show_bug.cgi?id=21019
6 make FunctionBodyNode::ref/deref fast
8 Speeds up v8-raytrace by 7.2%.
11 (JSC::FunctionBodyNode::FunctionBodyNode): Initialize m_refCount to 0.
13 (JSC::FunctionBodyNode::ref): Call base class ref once, and thereafter use
15 (JSC::FunctionBodyNode::deref): Ditto, but the deref side.
17 2008-09-22 Darin Adler <darin@apple.com>
19 Pointed out by Sam Weinig.
22 (JSC::Arguments::fillArgList): Fix bad copy and paste. Oops!
24 2008-09-22 Darin Adler <darin@apple.com>
26 Reviewed by Cameron Zwarich.
28 - https://bugs.webkit.org/show_bug.cgi?id=20983
29 ArgumentsData should have some room to allocate some extra arguments inline
31 Speeds up v8-raytrace by 5%.
34 (JSC::ArgumentsData::ArgumentsData): Use a fixed buffer if there are 4 or fewer
36 (JSC::Arguments::Arguments): Use a fixed buffer if there are 4 or fewer
38 (JSC::Arguments::~Arguments): Delete the buffer if necessary.
39 (JSC::Arguments::mark): Update since extraArguments are now Register.
40 (JSC::Arguments::fillArgList): Added special case for the only case that's
41 actually used in the practice, when there are no parameters. There are some
42 other special cases in there too, but that's the only one that matters.
43 (JSC::Arguments::getOwnPropertySlot): Updated to use setValueSlot since there's
44 no operation to get you at the JSValue* inside a Register as a "slot".
46 2008-09-22 Sam Weinig <sam@webkit.org>
48 Reviewed by Maciej Stachowiak.
50 Patch for https://bugs.webkit.org/show_bug.cgi?id=21014
51 Speed up for..in by using StructureID to avoid calls to hasProperty
53 Speeds up fasta by 8%.
55 * VM/JSPropertyNameIterator.cpp:
56 (JSC::JSPropertyNameIterator::invalidate):
57 * VM/JSPropertyNameIterator.h:
58 (JSC::JSPropertyNameIterator::next):
59 * kjs/PropertyNameArray.h:
60 (JSC::PropertyNameArrayData::begin):
61 (JSC::PropertyNameArrayData::end):
62 (JSC::PropertyNameArrayData::setCachedStructureID):
63 (JSC::PropertyNameArrayData::cachedStructureID):
64 * kjs/StructureID.cpp:
65 (JSC::StructureID::getEnumerablePropertyNames):
66 (JSC::structureIDChainsAreEqual):
69 2008-09-22 Kelvin Sherlock <ksherlock@gmail.com>
71 Updated and tweaked by Sam Weinig.
73 Reviewed by Geoffrey Garen.
75 Bug 20020: Proposed enhancement to JavaScriptCore API
76 <https://bugs.webkit.org/show_bug.cgi?id=20020>
78 Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp
79 functions to create JavaScript Array, Date, Error, and RegExp objects, respectively.
81 * API/JSObjectRef.cpp: The functions
82 * API/JSObjectRef.h: Function prototype and documentation
83 * JavaScriptCore.exp: Added functions to exported function list
84 * API/tests/testapi.c: Added basic functionality tests.
86 * kjs/DateConstructor.cpp:
87 Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
88 with JSObject* constructDate(ExecState* exec, const ArgList& args).
89 Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function
91 * kjs/DateConstructor.h:
92 added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args)
94 * kjs/ErrorConstructor.cpp:
95 removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args)
97 * kjs/ErrorConstructor.h:
98 added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args)
100 * kjs/RegExpConstructor.cpp:
101 removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args)
103 * kjs/RegExpConstructor.h:
104 added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args)
106 2008-09-22 Matt Lilek <webkit@mattlilek.com>
108 Not reviewed, Windows build fix.
111 * kjs/FunctionPrototype.cpp:
113 2008-09-22 Sam Weinig <sam@webkit.org>
115 Reviewed by Darin Adler.
117 Patch for https://bugs.webkit.org/show_bug.cgi?id=20982
118 Speed up the apply method of functions by special-casing array and 'arguments' objects
120 1% speedup on v8-raytrace.
122 Test: fast/js/function-apply.html
125 (JSC::Arguments::fillArgList):
127 * kjs/FunctionPrototype.cpp:
128 (JSC::functionProtoFuncApply):
130 (JSC::JSArray::fillArgList):
133 2008-09-22 Darin Adler <darin@apple.com>
135 Reviewed by Sam Weinig.
137 - https://bugs.webkit.org/show_bug.cgi?id=20993
138 Array.push/pop need optimized cases for JSArray
140 3% or so speedup on DeltaBlue benchmark.
142 * kjs/ArrayPrototype.cpp:
143 (JSC::arrayProtoFuncPop): Call JSArray::pop when appropriate.
144 (JSC::arrayProtoFuncPush): Call JSArray::push when appropriate.
147 (JSC::JSArray::putSlowCase): Set m_fastAccessCutoff when appropriate, getting
148 us into the fast code path.
149 (JSC::JSArray::pop): Added.
150 (JSC::JSArray::push): Added.
151 * kjs/JSArray.h: Added push and pop.
153 * kjs/operations.cpp:
154 (JSC::throwOutOfMemoryError): Don't inline this. Helps us avoid PIC branches.
156 2008-09-22 Maciej Stachowiak <mjs@apple.com>
158 Reviewed by Cameron Zwarich.
160 - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
162 Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
164 2.2% speedup on EarleyBoyer benchmark.
166 * API/JSCallbackConstructor.cpp:
167 * API/JSCallbackConstructor.h:
168 (JSC::JSCallbackConstructor::createStructureID):
169 * API/JSCallbackFunction.cpp:
170 * API/JSCallbackFunction.h:
171 (JSC::JSCallbackFunction::createStructureID):
172 * API/JSCallbackObject.h:
173 (JSC::JSCallbackObject::createStructureID):
174 * API/JSCallbackObjectFunctions.h:
175 (JSC::::hasInstance):
176 * API/JSValueRef.cpp:
177 (JSValueIsInstanceOfConstructor):
178 * JavaScriptCore.exp:
180 (JSC::Machine::privateExecute):
181 (JSC::Machine::cti_op_instanceof):
182 * kjs/InternalFunction.cpp:
183 * kjs/InternalFunction.h:
184 (JSC::InternalFunction::createStructureID):
188 (JSC::TypeInfo::implementsHasInstance):
190 2008-09-22 Maciej Stachowiak <mjs@apple.com>
192 Reviewed by Dave Hyatt.
194 Based on initial work by Darin Adler.
196 - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
197 - use this to JIT inline code for eq_null and neq_null
198 https://bugs.webkit.org/show_bug.cgi?id=20823
200 0.5% speedup on SunSpider
201 ~4% speedup on Richards benchmark
204 (JSC::CTI::privateCompileMainPass):
206 (JSC::jsTypeStringForValue):
207 (JSC::jsIsObjectType):
208 (JSC::Machine::privateExecute):
209 (JSC::Machine::cti_op_is_undefined):
213 * kjs/StringObjectThatMasqueradesAsUndefined.h:
214 (JSC::StringObjectThatMasqueradesAsUndefined::create):
215 (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
217 (JSC::StructureID::mutableTypeInfo):
219 (JSC::TypeInfo::TypeInfo):
220 (JSC::TypeInfo::masqueradesAsUndefined):
221 * kjs/operations.cpp:
223 * masm/X86Assembler.h:
224 (JSC::X86Assembler::):
225 (JSC::X86Assembler::setne_r):
226 (JSC::X86Assembler::setnz_r):
227 (JSC::X86Assembler::testl_i32m):
229 2008-09-22 Tor Arne Vestbø <tavestbo@trolltech.com>
233 Initialize QCoreApplication in kjs binary/Shell.cpp
235 This allows us to use QCoreApplication::instance() to
236 get the main thread in ThreadingQt.cpp
240 * wtf/ThreadingQt.cpp:
241 (WTF::initializeThreading):
243 2008-09-21 Darin Adler <darin@apple.com>
245 - blind attempt to fix non-all-in-one builds
247 * kjs/JSGlobalObject.cpp: Added includes of Arguments.h and RegExpObject.h.
249 2008-09-21 Darin Adler <darin@apple.com>
253 * kjs/StructureID.cpp:
254 (JSC::StructureID::addPropertyTransition): Use typeInfo().type() instead of m_type.
255 (JSC::StructureID::createCachedPrototypeChain): Ditto.
257 2008-09-21 Maciej Stachowiak <mjs@apple.com>
259 Reviewed by Darin Adler.
261 - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
262 https://bugs.webkit.org/show_bug.cgi?id=20981
264 * JavaScriptCore.exp:
265 * JavaScriptCore.xcodeproj/project.pbxproj:
267 (JSC::CTI::privateCompileMainPass):
268 (JSC::CTI::privateCompilePutByIdTransition):
270 (JSC::jsIsObjectType):
271 (JSC::Machine::Machine):
272 * kjs/AllInOneFile.cpp:
274 (JSC::JSCell::isObject):
275 (JSC::JSCell::isString):
276 * kjs/JSGlobalData.cpp:
277 (JSC::JSGlobalData::JSGlobalData):
278 * kjs/JSGlobalObject.cpp:
279 (JSC::JSGlobalObject::reset):
280 * kjs/JSGlobalObject.h:
281 (JSC::StructureID::prototypeForLookup):
282 * kjs/JSNumberCell.h:
283 (JSC::JSNumberCell::createStructureID):
285 (JSC::JSObject::createInheritorID):
287 (JSC::JSObject::createStructureID):
289 (JSC::JSString::createStructureID):
290 * kjs/NativeErrorConstructor.cpp:
291 (JSC::NativeErrorConstructor::NativeErrorConstructor):
292 * kjs/RegExpConstructor.cpp:
293 * kjs/RegExpMatchesArray.h: Added.
294 (JSC::RegExpMatchesArray::getOwnPropertySlot):
295 (JSC::RegExpMatchesArray::put):
296 (JSC::RegExpMatchesArray::deleteProperty):
297 (JSC::RegExpMatchesArray::getPropertyNames):
298 * kjs/StructureID.cpp:
299 (JSC::StructureID::StructureID):
300 (JSC::StructureID::addPropertyTransition):
301 (JSC::StructureID::toDictionaryTransition):
302 (JSC::StructureID::changePrototypeTransition):
303 (JSC::StructureID::getterSetterTransition):
305 (JSC::StructureID::create):
306 (JSC::StructureID::typeInfo):
307 * kjs/TypeInfo.h: Added.
308 (JSC::TypeInfo::TypeInfo):
309 (JSC::TypeInfo::type):
311 2008-09-21 Darin Adler <darin@apple.com>
313 Reviewed by Cameron Zwarich.
315 - fix crash logging into Gmail due to recent Arguments change
318 (JSC::Arguments::Arguments): Fix window where mark() function could
319 see d->extraArguments with uninitialized contents.
320 (JSC::Arguments::mark): Check d->extraArguments for 0 to handle two
321 cases: 1) Inside the constructor before it's initialized.
322 2) numArguments <= numParameters.
324 2008-09-21 Darin Adler <darin@apple.com>
326 - fix loose end from the "duplicate constant values" patch
328 * VM/CodeGenerator.cpp:
329 (JSC::CodeGenerator::emitLoad): Add a special case for values the
330 hash table can't handle.
332 2008-09-21 Mark Rowe <mrowe@apple.com>
334 Fix the non-AllInOneFile build.
336 * kjs/Arguments.cpp: Add missing #include.
338 2008-09-21 Darin Adler <darin@apple.com>
340 Reviewed by Cameron Zwarich and Mark Rowe.
342 - fix test failure caused by my recent IndexToNameMap patch
345 (JSC::Arguments::deleteProperty): Added the accidentally-omitted
346 check of the boolean result from toArrayIndex.
348 2008-09-21 Darin Adler <darin@apple.com>
350 Reviewed by Maciej Stachowiak.
352 - https://bugs.webkit.org/show_bug.cgi?id=20975
353 inline immediate-number case of ==
355 * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to
356 emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.
358 * VM/CTI.cpp: Updated for new name.
359 (JSC::CTI::privateCompileMainPass): Added op_eq.
360 (JSC::CTI::privateCompileSlowCases): Added op_eq.
363 (JSC::Machine::cti_op_eq): Removed fast case, since it's now
366 2008-09-21 Peter Gal <galpter@inf.u-szeged.hu>
368 Reviewed by Tim Hatcher and Eric Seidel.
370 Fix the QT/Linux JavaScriptCore segmentation fault.
371 https://bugs.webkit.org/show_bug.cgi?id=20914
373 * wtf/ThreadingQt.cpp:
374 (WTF::initializeThreading): Use currentThread() if
375 platform is not a MAC (like in pre 36541 revisions)
377 2008-09-21 Darin Adler <darin@apple.com>
379 Reviewed by Sam Weinig.
381 * kjs/debugger.h: Removed some unneeded includes and declarations.
383 2008-09-21 Darin Adler <darin@apple.com>
385 Reviewed by Sam Weinig.
387 - https://bugs.webkit.org/show_bug.cgi?id=20972
388 speed up Arguments further by eliminating the IndexToNameMap
390 No change on SunSpider. 1.29x as fast on V8 Raytrace.
392 * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the
393 indexToNameMap and hadDeletes data members. Changed extraArguments into
394 an OwnArrayPtr and added deletedArguments, another OwnArrayPtr.
395 Replaced numExtraArguments with numParameters, since that's what's
396 used more directly in hot code paths.
397 (JSC::Arguments::Arguments): Pass in argument count instead of ArgList.
398 Initialize ArgumentsData the new way.
399 (JSC::Arguments::mark): Updated.
400 (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so
401 we don't have to convert integers to identifiers just to get an argument.
402 Integrated the deleted case with the fast case.
403 (JSC::Arguments::put): Ditto.
404 (JSC::Arguments::deleteProperty): Ditto.
406 * kjs/Arguments.h: Minimized includes. Made everything private. Added
407 overloads for the integral property name case. Eliminated mappedIndexSetter.
408 Moved ArgumentsData into the .cpp file.
410 * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
411 * kjs/IndexToNameMap.h: Ditto.
413 * kjs/JSActivation.cpp:
414 (JSC::JSActivation::createArgumentsObject): Elminated ArgList.
417 * JavaScriptCore.pri:
418 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
419 * JavaScriptCore.xcodeproj/project.pbxproj:
420 * JavaScriptCoreSources.bkl:
421 * kjs/AllInOneFile.cpp:
422 Removed IndexToNameMap.
424 2008-09-21 Darin Adler <darin@apple.com>
426 * VM/CodeGenerator.cpp:
427 (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly
430 2008-09-21 Judit Jasz <jasy@inf.u-szeged.hu>
432 Reviewed and tweaked by Darin Adler.
434 - https://bugs.webkit.org/show_bug.cgi?id=20645
435 Elminate duplicate constant values in CodeBlocks.
437 Seems to be a wash on SunSpider.
439 * VM/CodeGenerator.cpp:
440 (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee
441 we emit the same JSValue* for identical numbers and strings.
442 * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&.
443 Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap.
445 (JSC::StringNode::emitCode): Call the new emitLoad and let it do the
448 2008-09-21 Paul Pedriana <webkit@pedriana.com>
450 Reviewed and tweaked by Darin Adler.
452 - https://bugs.webkit.org/show_bug.cgi?id=16925
453 Fixed lack of Vector buffer alignment for both GCC and MSVC.
454 Since there's no portable way to do this, for now we don't support
457 * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer.
458 Use AlignedBuffer insteadof an array of char in VectorBuffer.
460 2008-09-21 Gabor Loki <loki@inf.u-szeged.hu>
462 Reviewed by Darin Adler.
464 - https://bugs.webkit.org/show_bug.cgi?id=19408
465 Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators.
467 1.008x as fast on SunSpider.
470 (makeNegateNode): Fold if expression is a number > 0.
471 (makeBitwiseNotNode): Fold if expression is a number.
472 (makeMultNode): Fold if expressions are both numbers.
473 (makeDivNode): Fold if expressions are both numbers.
474 (makeAddNode): Fold if expressions are both numbers.
475 (makeLeftShiftNode): Fold if expressions are both numbers.
476 (makeRightShiftNode): Fold if expressions are both numbers.
478 2008-09-21 Maciej Stachowiak <mjs@apple.com>
482 - speed up === operator by generating inline machine code for the fast paths
483 https://bugs.webkit.org/show_bug.cgi?id=20820
486 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber):
487 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers):
488 (JSC::CTI::emitJumpSlowCaseIfNotImmediates):
489 (JSC::CTI::emitTagAsBoolImmediate):
490 (JSC::CTI::privateCompileMainPass):
491 (JSC::CTI::privateCompileSlowCases):
494 (JSC::Machine::cti_op_stricteq):
495 * masm/X86Assembler.h:
496 (JSC::X86Assembler::):
497 (JSC::X86Assembler::sete_r):
498 (JSC::X86Assembler::setz_r):
499 (JSC::X86Assembler::movzbl_rr):
500 (JSC::X86Assembler::emitUnlinkedJnz):
502 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
504 Reviewed by Maciej Stachowiak.
506 Free memory allocated for extra arguments in the destructor of the
510 (JSC::Arguments::~Arguments):
513 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
515 Reviewed by Maciej Stachowiak.
517 Bug 20815: 'arguments' object creation is non-optimal
518 <https://bugs.webkit.org/show_bug.cgi?id=20815>
520 Fix our inefficient way of creating the arguments object by only
521 creating named properties for each of the arguments after a use of the
522 'delete' statement. This patch also speeds up access to the 'arguments'
523 object slightly, but it still does not use the array fast path for
524 indexed access that exists for many opcodes.
526 This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5%
527 improvement on the Earley-Boyer benchmark, which gives a 4% improvement
531 (JSC::Arguments::Arguments):
532 (JSC::Arguments::mark):
533 (JSC::Arguments::getOwnPropertySlot):
534 (JSC::Arguments::put):
535 (JSC::Arguments::deleteProperty):
537 (JSC::Arguments::ArgumentsData::ArgumentsData):
538 * kjs/IndexToNameMap.h:
539 (JSC::IndexToNameMap::size):
540 * kjs/JSActivation.cpp:
541 (JSC::JSActivation::createArgumentsObject):
542 * kjs/JSActivation.h:
543 (JSC::JSActivation::uncheckedSymbolTableGet):
544 (JSC::JSActivation::uncheckedSymbolTableGetValue):
545 (JSC::JSActivation::uncheckedSymbolTablePut):
547 (JSC::JSFunction::numParameters):
549 2008-09-20 Darin Adler <darin@apple.com>
551 Reviewed by Mark Rowe.
553 - fix crash seen on buildbot
555 * kjs/JSGlobalObject.cpp:
556 (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype,
557 deleted by accident in my recent check-in.
559 2008-09-20 Maciej Stachowiak <mjs@apple.com>
561 Not reviewed, build fix.
563 - speculative fix for non-AllInOne builds
567 2008-09-20 Maciej Stachowiak <mjs@apple.com>
569 Reviewed by Darin Adler.
571 - assorted optimizations to === and !== operators
572 (work towards <https://bugs.webkit.org/show_bug.cgi?id=20820>)
574 2.5% speedup on earley-boyer test
577 (JSC::Machine::cti_op_stricteq): Use inline version of
578 strictEqualSlowCase; remove unneeded exception check.
579 (JSC::Machine::cti_op_nstricteq): ditto
580 * kjs/operations.cpp:
581 (JSC::strictEqual): Use strictEqualSlowCaseInline
582 (JSC::strictEqualSlowCase): ditto
584 (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined,
585 since the extra function call indirection is a lose for CTI.
587 2008-09-20 Darin Adler <darin@apple.com>
589 Reviewed by Maciej Stachowiak.
591 - finish https://bugs.webkit.org/show_bug.cgi?id=20858
592 make each distinct C++ class get a distinct JSC::Structure
594 This also includes some optimizations that make the change an overall
595 small speedup. Without those it was a bit of a slowdown.
597 * API/JSCallbackConstructor.cpp:
598 (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
599 * API/JSCallbackConstructor.h: Ditto.
600 * API/JSCallbackFunction.cpp:
601 (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
602 * API/JSCallbackObject.h: Take a structure.
603 * API/JSCallbackObjectFunctions.h:
604 (JSC::JSCallbackObject::JSCallbackObject): Ditto.
606 * API/JSClassRef.cpp:
607 (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype
608 if there's a custom prototype involved.
609 * API/JSObjectRef.cpp:
610 (JSObjectMake): Ditto.
611 (JSObjectMakeConstructor): Pass in a structure.
613 * JavaScriptCore.exp: Updated.
616 (JSC::jsLess): Added a special case for when both arguments are strings.
617 This avoids converting both strings to with UString::toDouble.
618 (JSC::jsLessEq): Ditto.
619 (JSC::Machine::privateExecute): Pass in a structure.
620 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
621 (JSC::Machine::cti_op_new_regexp): Ditto.
622 (JSC::Machine::cti_op_is_string): Ditto.
623 * VM/Machine.h: Made isJSString public so it can be used in the CTI.
626 (JSC::Arguments::Arguments): Pass in a structure.
628 * kjs/JSCell.h: Mark constructor explicit.
630 * kjs/JSGlobalObject.cpp:
631 (JSC::markIfNeeded): Added an overload for marking structures.
632 (JSC::JSGlobalObject::reset): Eliminate code to set data members to
633 zero. We now do that in the constructor, and we no longer use this
634 anywhere except in the constructor. Added code to create structures.
635 Pass structures rather than prototypes when creating objects.
636 (JSC::JSGlobalObject::mark): Mark the structures.
638 * kjs/JSGlobalObject.h: Removed unneeded class declarations.
639 Added initializers for raw pointers in JSGlobalObjectData so
640 everything starts with a 0. Added structure data and accessor
643 * kjs/JSImmediate.cpp:
644 (JSC::JSImmediate::nonInlineNaN): Added.
646 (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
648 * kjs/JSNumberCell.cpp:
649 (JSC::jsNumberCell): Made non-inline to avoid PIC branches
650 in functions that call this one.
652 * kjs/JSNumberCell.h: Ditto.
654 * kjs/JSObject.h: Removed constructor that takes a prototype.
655 All callers now pass structures.
657 * kjs/ArrayConstructor.cpp:
658 (JSC::ArrayConstructor::ArrayConstructor):
659 (JSC::constructArrayWithSizeQuirk):
660 * kjs/ArrayConstructor.h:
661 * kjs/ArrayPrototype.cpp:
662 (JSC::ArrayPrototype::ArrayPrototype):
663 * kjs/ArrayPrototype.h:
664 * kjs/BooleanConstructor.cpp:
665 (JSC::BooleanConstructor::BooleanConstructor):
666 (JSC::constructBoolean):
667 (JSC::constructBooleanFromImmediateBoolean):
668 * kjs/BooleanConstructor.h:
669 * kjs/BooleanObject.cpp:
670 (JSC::BooleanObject::BooleanObject):
671 * kjs/BooleanObject.h:
672 * kjs/BooleanPrototype.cpp:
673 (JSC::BooleanPrototype::BooleanPrototype):
674 * kjs/BooleanPrototype.h:
675 * kjs/DateConstructor.cpp:
676 (JSC::DateConstructor::DateConstructor):
677 (JSC::constructDate):
678 * kjs/DateConstructor.h:
679 * kjs/DateInstance.cpp:
680 (JSC::DateInstance::DateInstance):
681 * kjs/DateInstance.h:
682 * kjs/DatePrototype.cpp:
683 (JSC::DatePrototype::DatePrototype):
684 * kjs/DatePrototype.h:
685 * kjs/ErrorConstructor.cpp:
686 (JSC::ErrorConstructor::ErrorConstructor):
687 (JSC::constructError):
688 * kjs/ErrorConstructor.h:
689 * kjs/ErrorInstance.cpp:
690 (JSC::ErrorInstance::ErrorInstance):
691 * kjs/ErrorInstance.h:
692 * kjs/ErrorPrototype.cpp:
693 (JSC::ErrorPrototype::ErrorPrototype):
694 * kjs/ErrorPrototype.h:
695 * kjs/FunctionConstructor.cpp:
696 (JSC::FunctionConstructor::FunctionConstructor):
697 * kjs/FunctionConstructor.h:
698 * kjs/FunctionPrototype.cpp:
699 (JSC::FunctionPrototype::FunctionPrototype):
700 (JSC::FunctionPrototype::addFunctionProperties):
701 * kjs/FunctionPrototype.h:
702 * kjs/GlobalEvalFunction.cpp:
703 (JSC::GlobalEvalFunction::GlobalEvalFunction):
704 * kjs/GlobalEvalFunction.h:
705 * kjs/InternalFunction.cpp:
706 (JSC::InternalFunction::InternalFunction):
707 * kjs/InternalFunction.h:
708 (JSC::InternalFunction::InternalFunction):
710 (JSC::JSArray::JSArray):
711 (JSC::constructEmptyArray):
712 (JSC::constructArray):
714 * kjs/JSFunction.cpp:
715 (JSC::JSFunction::JSFunction):
716 (JSC::JSFunction::construct):
718 (JSC::constructEmptyObject):
720 (JSC::StringObject::create):
721 * kjs/JSWrapperObject.h:
722 * kjs/MathObject.cpp:
723 (JSC::MathObject::MathObject):
725 * kjs/NativeErrorConstructor.cpp:
726 (JSC::NativeErrorConstructor::NativeErrorConstructor):
727 (JSC::NativeErrorConstructor::construct):
728 * kjs/NativeErrorConstructor.h:
729 * kjs/NativeErrorPrototype.cpp:
730 (JSC::NativeErrorPrototype::NativeErrorPrototype):
731 * kjs/NativeErrorPrototype.h:
732 * kjs/NumberConstructor.cpp:
733 (JSC::NumberConstructor::NumberConstructor):
734 (JSC::constructWithNumberConstructor):
735 * kjs/NumberConstructor.h:
736 * kjs/NumberObject.cpp:
737 (JSC::NumberObject::NumberObject):
738 (JSC::constructNumber):
739 (JSC::constructNumberFromImmediateNumber):
740 * kjs/NumberObject.h:
741 * kjs/NumberPrototype.cpp:
742 (JSC::NumberPrototype::NumberPrototype):
743 * kjs/NumberPrototype.h:
744 * kjs/ObjectConstructor.cpp:
745 (JSC::ObjectConstructor::ObjectConstructor):
746 (JSC::constructObject):
747 * kjs/ObjectConstructor.h:
748 * kjs/ObjectPrototype.cpp:
749 (JSC::ObjectPrototype::ObjectPrototype):
750 * kjs/ObjectPrototype.h:
751 * kjs/PrototypeFunction.cpp:
752 (JSC::PrototypeFunction::PrototypeFunction):
753 * kjs/PrototypeFunction.h:
754 * kjs/RegExpConstructor.cpp:
755 (JSC::RegExpConstructor::RegExpConstructor):
756 (JSC::RegExpMatchesArray::RegExpMatchesArray):
757 (JSC::constructRegExp):
758 * kjs/RegExpConstructor.h:
759 * kjs/RegExpObject.cpp:
760 (JSC::RegExpObject::RegExpObject):
761 * kjs/RegExpObject.h:
762 * kjs/RegExpPrototype.cpp:
763 (JSC::RegExpPrototype::RegExpPrototype):
764 * kjs/RegExpPrototype.h:
766 (GlobalObject::GlobalObject):
767 * kjs/StringConstructor.cpp:
768 (JSC::StringConstructor::StringConstructor):
769 (JSC::constructWithStringConstructor):
770 * kjs/StringConstructor.h:
771 * kjs/StringObject.cpp:
772 (JSC::StringObject::StringObject):
773 * kjs/StringObject.h:
774 * kjs/StringObjectThatMasqueradesAsUndefined.h:
775 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
776 * kjs/StringPrototype.cpp:
777 (JSC::StringPrototype::StringPrototype):
778 * kjs/StringPrototype.h:
779 Take and pass structures.
781 2008-09-19 Alp Toker <alp@nuanti.com>
783 Build fix for the 'gold' linker and recent binutils. New behaviour
784 requires that we link to used libraries explicitly.
788 2008-09-19 Sam Weinig <sam@webkit.org>
790 Roll r36694 back in. It did not cause the crash.
792 * JavaScriptCore.exp:
793 * VM/JSPropertyNameIterator.cpp:
794 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
795 (JSC::JSPropertyNameIterator::invalidate):
796 * VM/JSPropertyNameIterator.h:
797 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
798 (JSC::JSPropertyNameIterator::create):
800 (JSC::JSObject::getPropertyNames):
801 * kjs/PropertyMap.cpp:
802 (JSC::PropertyMap::getEnumerablePropertyNames):
804 * kjs/PropertyNameArray.cpp:
805 (JSC::PropertyNameArray::add):
806 * kjs/PropertyNameArray.h:
807 (JSC::PropertyNameArrayData::create):
808 (JSC::PropertyNameArrayData::propertyNameVector):
809 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
810 (JSC::PropertyNameArrayData::cachedPrototypeChain):
811 (JSC::PropertyNameArrayData::begin):
812 (JSC::PropertyNameArrayData::end):
813 (JSC::PropertyNameArrayData::PropertyNameArrayData):
814 (JSC::PropertyNameArray::PropertyNameArray):
815 (JSC::PropertyNameArray::addKnownUnique):
816 (JSC::PropertyNameArray::size):
817 (JSC::PropertyNameArray::operator[]):
818 (JSC::PropertyNameArray::begin):
819 (JSC::PropertyNameArray::end):
820 (JSC::PropertyNameArray::setData):
821 (JSC::PropertyNameArray::data):
822 (JSC::PropertyNameArray::releaseData):
823 * kjs/StructureID.cpp:
824 (JSC::structureIDChainsAreEqual):
825 (JSC::StructureID::getEnumerablePropertyNames):
826 (JSC::StructureID::clearEnumerationCache):
827 (JSC::StructureID::createCachedPrototypeChain):
830 2008-09-19 Sam Weinig <sam@webkit.org>
834 * JavaScriptCore.exp:
835 * VM/JSPropertyNameIterator.cpp:
836 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
837 (JSC::JSPropertyNameIterator::invalidate):
838 * VM/JSPropertyNameIterator.h:
839 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
840 (JSC::JSPropertyNameIterator::create):
842 (JSC::JSObject::getPropertyNames):
843 * kjs/PropertyMap.cpp:
844 (JSC::PropertyMap::getEnumerablePropertyNames):
846 * kjs/PropertyNameArray.cpp:
847 (JSC::PropertyNameArray::add):
848 * kjs/PropertyNameArray.h:
849 (JSC::PropertyNameArray::PropertyNameArray):
850 (JSC::PropertyNameArray::addKnownUnique):
851 (JSC::PropertyNameArray::begin):
852 (JSC::PropertyNameArray::end):
853 (JSC::PropertyNameArray::size):
854 (JSC::PropertyNameArray::operator[]):
855 (JSC::PropertyNameArray::releaseIdentifiers):
856 * kjs/StructureID.cpp:
857 (JSC::StructureID::getEnumerablePropertyNames):
859 (JSC::StructureID::clearEnumerationCache):
861 2008-09-19 Oliver Hunt <oliver@apple.com>
863 Reviewed by Maciej Stachowiak.
865 Improve peformance of local variable initialisation.
867 Pull local and constant initialisation out of slideRegisterWindowForCall
868 and into its own opcode. This allows the JIT to generate the initialisation
869 code for a function directly into the instruction stream and so avoids a few
870 branches on function entry.
872 Results a 1% progression in SunSpider, particularly in a number of the bitop
873 tests where the called functions are very fast.
876 (JSC::CTI::emitInitialiseRegister):
877 (JSC::CTI::privateCompileMainPass):
880 (JSC::CodeBlock::dump):
881 * VM/CodeGenerator.cpp:
882 (JSC::CodeGenerator::CodeGenerator):
884 (JSC::slideRegisterWindowForCall):
885 (JSC::Machine::privateExecute):
888 2008-09-19 Sam Weinig <sam@webkit.org>
890 Reviewed by Darin Adler.
892 Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
893 Speed up JS property enumeration by caching entire PropertyNameArray
895 1.3% speedup on Sunspider, 30% on string-fasta.
897 * JavaScriptCore.exp:
898 * VM/JSPropertyNameIterator.cpp:
899 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
900 (JSC::JSPropertyNameIterator::invalidate):
901 * VM/JSPropertyNameIterator.h:
902 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
903 (JSC::JSPropertyNameIterator::create):
905 (JSC::JSObject::getPropertyNames):
906 * kjs/PropertyMap.cpp:
907 (JSC::PropertyMap::getEnumerablePropertyNames):
909 * kjs/PropertyNameArray.cpp:
910 (JSC::PropertyNameArray::add):
911 * kjs/PropertyNameArray.h:
912 (JSC::PropertyNameArrayData::create):
913 (JSC::PropertyNameArrayData::propertyNameVector):
914 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
915 (JSC::PropertyNameArrayData::cachedPrototypeChain):
916 (JSC::PropertyNameArrayData::begin):
917 (JSC::PropertyNameArrayData::end):
918 (JSC::PropertyNameArrayData::PropertyNameArrayData):
919 (JSC::PropertyNameArray::PropertyNameArray):
920 (JSC::PropertyNameArray::addKnownUnique):
921 (JSC::PropertyNameArray::size):
922 (JSC::PropertyNameArray::operator[]):
923 (JSC::PropertyNameArray::begin):
924 (JSC::PropertyNameArray::end):
925 (JSC::PropertyNameArray::setData):
926 (JSC::PropertyNameArray::data):
927 (JSC::PropertyNameArray::releaseData):
928 * kjs/ScopeChain.cpp:
929 (JSC::ScopeChainNode::print):
930 * kjs/StructureID.cpp:
931 (JSC::structureIDChainsAreEqual):
932 (JSC::StructureID::getEnumerablePropertyNames):
933 (JSC::StructureID::clearEnumerationCache):
934 (JSC::StructureID::createCachedPrototypeChain):
937 2008-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
939 Reviewed by Maciej Stachowiak.
941 Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
944 (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
946 2008-09-19 Darin Adler <darin@apple.com>
948 Reviewed by Sam Weinig.
950 - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
951 make each distinct C++ class get a distinct JSC::Structure
953 * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
955 * kjs/JSGlobalObject.h: Changed the protected constructor to take a
956 structure instead of a prototype.
958 * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
960 2008-09-19 Julien Chaffraix <jchaffraix@pleyo.com>
962 Reviewed by Alexey Proskuryakov.
964 Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
965 non-template methods' code been copied for each instance of the template.
966 The patch splits RefCounted between a base class that holds non-template methods and attributes
967 and the template RefCounted class that keeps the same functionnality.
969 On my Linux with gcc 4.3 for the Gtk port, this is:
970 - a ~600KB save on libwebkit.so in release.
971 - a ~1.6MB save on libwebkit.so in debug.
973 It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
974 On the whole, it should be a small win as we reduce the compiled code size and the only
975 new function call should be inlined by the compiler.
978 (WTF::RefCountedBase::ref): Copied from RefCounted.
979 (WTF::RefCountedBase::hasOneRef): Ditto.
980 (WTF::RefCountedBase::refCount): Ditto.
981 (WTF::RefCountedBase::RefCountedBase): Ditto.
982 (WTF::RefCountedBase::~RefCountedBase): Ditto.
983 (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
985 (WTF::RefCounted::RefCounted):
986 (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
987 (WTF::RefCounted::~RefCounted): Keep private destructor.
989 2008-09-18 Darin Adler <darin@apple.com>
991 Reviewed by Maciej Stachowiak.
993 - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
994 make each distinct C++ class get a distinct JSC::Structure
996 * kjs/lookup.h: Removed things here that were used only in WebCore:
997 cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
998 and JSC_IMPLEMENT_PROTOTYPE.
1000 2008-09-18 Darin Adler <darin@apple.com>
1002 Reviewed by Maciej Stachowiak.
1004 - https://bugs.webkit.org/show_bug.cgi?id=20927
1005 simplify/streamline the code to turn strings into identifiers while parsing
1007 * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
1011 (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
1012 * kjs/lexer.h: Remove makeUString.
1014 * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
1016 * VM/CodeGenerator.cpp:
1017 (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
1018 (JSC::prepareJumpTableForStringSwitch): Ditto.
1020 (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
1021 (JSC::processClauseList): Ditto.
1022 * kjs/nodes2string.cpp:
1023 (JSC::StringNode::streamTo): Ditto.
1025 2008-09-18 Sam Weinig <sam@webkit.org>
1030 (JSC::Instruction::Instruction):
1032 2008-09-18 Oliver Hunt <oliver@apple.com>
1034 Reviewed by Maciej Stachowiak.
1036 Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
1037 <https://bugs.webkit.org/show_bug.cgi?id=20911>
1039 The problem was simply caused by the int constructor for Instruction
1040 failing to initialise the full struct in 64bit builds.
1043 (JSC::Instruction::Instruction):
1045 2008-09-18 Darin Adler <darin@apple.com>
1049 * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
1051 2008-09-18 Darin Adler <darin@apple.com>
1053 Reviewed by Sam Weinig.
1055 * kjs/JSGlobalObject.h: Tiny style guideline tweak.
1057 2008-09-18 Darin Adler <darin@apple.com>
1059 Reviewed by Sam Weinig.
1061 - fix https://bugs.webkit.org/show_bug.cgi?id=20925
1062 LEAK messages appear every time I quit
1064 * JavaScriptCore.exp: Updated, and also added an export
1065 needed for future WebCore use of JSC::StructureID.
1067 * wtf/RefCountedLeakCounter.cpp:
1068 (WTF::RefCountedLeakCounter::suppressMessages): Added.
1069 (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
1070 (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
1071 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
1072 log the reason there was no leak checking done.
1073 (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
1074 (WTF::RefCountedLeakCounter::decrement): Ditto.
1076 * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
1077 new functions, suppressMessages and cancelMessageSuppression. Also
1078 added m_ prefixes to the data member names.
1080 2008-09-18 Holger Hans Peter Freyther <zecke@selfish.org>
1082 Reviewed by Mark Rowe.
1084 https://bugs.webkit.org/show_bug.cgi?id=20437
1086 Add a proper #define to define which XML Parser implementation to use. Client
1087 code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
1088 implementation is going to be used.
1092 2008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1094 Reviewed by Maciej Stachowiak.
1096 Make a Unicode non-breaking space count as a whitespace character in
1097 PCRE. This change was already made in WREC, and it fixes one of the
1098 Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
1099 in a new set of expected test results.
1101 * pcre/pcre_internal.h:
1103 * tests/mozilla/expected.html:
1105 2008-09-18 Stephanie Lewis <slewis@apple.com>
1107 Reviewed by Mark Rowe and Maciej Stachowiak.
1109 add an option use arch to specify which architecture to run.
1111 * tests/mozilla/jsDriver.pl:
1113 2008-09-17 Oliver Hunt <oliver@apple.com>
1115 Correctly restore argument reference prior to SFX runtime calls.
1117 Reviewed by Steve Falkenburg.
1120 (JSC::CTI::privateCompileSlowCases):
1121 (JSC::CTI::privateCompile):
1123 2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1125 Reviewed by Maciej Stachowiak.
1127 Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
1128 <https://bugs.webkit.org/show_bug.cgi?id=20876>
1130 r36417 and r36427 caused an get_by_id opcode to be emitted before the
1131 instanceof and construct opcodes, in order to enable inline caching of
1132 the prototype property. Unfortunately, this regressed some tests dealing
1133 with exceptions thrown by 'instanceof' and the 'new' operator. We fix
1134 these problems by detecting whether an "is not an object" exception is
1135 thrown before op_instanceof or op_construct, and emit the proper
1136 exception in those cases.
1138 * VM/CodeGenerator.cpp:
1139 (JSC::CodeGenerator::emitConstruct):
1140 * VM/CodeGenerator.h:
1141 * VM/ExceptionHelpers.cpp:
1142 (JSC::createInvalidParamError):
1143 (JSC::createNotAConstructorError):
1144 (JSC::createNotAnObjectError):
1145 * VM/ExceptionHelpers.h:
1147 (JSC::Machine::getOpcode):
1148 (JSC::Machine::privateExecute):
1151 (JSC::NewExprNode::emitCode):
1152 (JSC::InstanceOfNode::emitCode):
1154 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1156 Reviewed by Oliver Hunt.
1158 JIT generation cti_op_construct_verify.
1160 Quarter to half percent progression on v8-tests.
1161 Roughly not change on SunSpider (possible minor progression).
1164 (JSC::CTI::privateCompileMainPass):
1168 2008-09-15 Steve Falkenburg <sfalken@apple.com>
1170 Improve timer accuracy for JavaScript Date object on Windows.
1172 Use a combination of ftime and QueryPerformanceCounter.
1173 ftime returns the information we want, but doesn't have sufficient resolution.
1174 QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
1175 To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
1176 QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to
1177 correct for drift if the low-res and high-res elapsed time between calls differs by more
1178 than twice the low-resolution timer resolution.
1180 QueryPerformanceCounter may be inaccurate due to a problems with:
1181 - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
1182 - BIOS bugs (http://support.microsoft.com/kb/895980/)
1183 - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
1185 Reviewed by Darin Adler.
1188 (JSC::highResUpTime):
1189 (JSC::lowResUTCTime):
1190 (JSC::qpcAvailable):
1191 (JSC::getCurrentUTCTimeWithMicroseconds):
1193 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1195 Reviewed by Geoff Garen.
1197 Implement JIT generation of CallFrame initialization, for op_call.
1199 1% sunspider 2.5% v8-tests.
1202 (JSC::CTI::compileOpCall):
1204 (JSC::Machine::cti_op_call_JSFunction):
1205 (JSC::Machine::cti_op_call_NotJSFunction):
1207 2008-09-17 Gavin Barraclough <barraclough@apple.com>
1209 Reviewed by Geoff Garen.
1211 Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code,
1212 move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
1213 functions, instead of checking prior to making the call.
1215 3% on v8-tests (4% on richards, 6% in delta-blue)
1218 (JSC::CTI::compileOpCall):
1219 (JSC::CTI::privateCompileSlowCases):
1220 (JSC::CTI::privateCompile):
1222 (JSC::Machine::execute):
1223 (JSC::Machine::cti_op_call_JSFunction):
1224 (JSC::Machine::cti_vm_compile):
1225 (JSC::Machine::cti_vm_updateScopeChain):
1226 (JSC::Machine::cti_op_construct_JSConstruct):
1229 2008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com>
1231 Fix the QtWebKit/Mac build
1233 * wtf/ThreadingQt.cpp:
1234 (WTF::initializeThreading): use QCoreApplication to get the main thread
1236 2008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1238 Reviewed by Maciej Stachowiak.
1240 Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
1241 <https://bugs.webkit.org/show_bug.cgi?id=20857>
1243 Fix a problem stemming from the slightly unsafe behaviour of the
1244 CodeGenerator::finalDestination() method by putting the "func" argument
1245 of the emitConstruct() method in a RefPtr in its caller. Also, add an
1246 assertion guaranteeing that this is always the case.
1248 CodeGenerator::finalDestination() is still incorrect and can cause
1249 problems with a different allocator; see bug 20340 for more details.
1251 * VM/CodeGenerator.cpp:
1252 (JSC::CodeGenerator::emitConstruct):
1254 (JSC::NewExprNode::emitCode):
1256 2008-09-16 Alice Liu <alice.liu@apple.com>
1261 (JSC::CTI::privateCompileMainPass):
1263 2008-09-16 Gavin Barraclough <barraclough@apple.com>
1265 Reviewed by Geoff Garen.
1267 CTI code generation for op_ret. The majority of the work
1268 (updating variables on the stack & on exec) can be performed
1269 directly in generated code.
1271 We still need to check, & to call out to C-code to handle
1272 activation records, profiling, and full scope chains.
1274 +1.5% Sunspider, +5/6% v8 tests.
1277 (JSC::CTI::emitPutCTIParam):
1278 (JSC::CTI::compileOpCall):
1279 (JSC::CTI::privateCompileMainPass):
1282 (JSC::Machine::cti_op_ret_activation):
1283 (JSC::Machine::cti_op_ret_profiler):
1284 (JSC::Machine::cti_op_ret_scopeChain):
1287 2008-09-16 Dimitri Glazkov <dglazkov@chromium.org>
1289 Fix the Windows build.
1291 Add some extra parentheses to stop MSVC from complaining so much.
1294 (JSC::Machine::privateExecute):
1295 (JSC::Machine::cti_op_stricteq):
1296 (JSC::Machine::cti_op_nstricteq):
1297 * kjs/operations.cpp:
1300 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1302 Reviewed by Cameron Zwarich.
1304 - speed up the === and !== operators by choosing the fast cases better
1306 No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
1309 (JSC::Machine::privateExecute):
1310 (JSC::Machine::cti_op_stricteq):
1311 (JSC::Machine::cti_op_nstricteq):
1312 * kjs/JSImmediate.h:
1313 (JSC::JSImmediate::areBothImmediate):
1314 * kjs/operations.cpp:
1316 (JSC::strictEqualSlowCase):
1319 2008-09-15 Oliver Hunt <oliver@apple.com>
1323 Coding style cleanup.
1326 (JSC::Machine::privateExecute):
1328 2008-09-15 Oliver Hunt <oliver@apple.com>
1330 Reviewed by Cameron Zwarich.
1332 Bug 20874: op_resolve does not do any form of caching
1333 <https://bugs.webkit.org/show_bug.cgi?id=20874>
1335 This patch adds an op_resolve_global opcode to handle (and cache)
1336 property lookup we can statically determine must occur on the global
1339 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
1340 10% in math-partial-sums
1343 (JSC::CTI::privateCompileMainPass):
1346 (JSC::CodeBlock::dump):
1347 * VM/CodeGenerator.cpp:
1348 (JSC::CodeGenerator::findScopedProperty):
1349 (JSC::CodeGenerator::emitResolve):
1351 (JSC::resolveGlobal):
1352 (JSC::Machine::privateExecute):
1353 (JSC::Machine::cti_op_resolve_global):
1357 2008-09-15 Sam Weinig <sam@webkit.org>
1359 Roll out r36462. It broke document.all.
1362 (JSC::CTI::privateCompileMainPass):
1363 (JSC::CTI::privateCompileSlowCases):
1366 (JSC::Machine::Machine):
1367 (JSC::Machine::cti_op_eq_null):
1368 (JSC::Machine::cti_op_neq_null):
1370 (JSC::Machine::isJSString):
1372 * kjs/JSWrapperObject.h:
1373 * kjs/StringObject.h:
1374 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1376 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1378 Reviewed by Maciej Stachowiak.
1380 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
1381 <https://bugs.webkit.org/show_bug.cgi?id=20863>
1383 r36427 changed the number of arguments to op_construct without changing
1384 the argument index for the vPC in the call to initializeCallFrame() in
1385 the CTI case. This caused a JSC test failure. Correcting the argument
1386 index fixes the test failure.
1389 (JSC::Machine::cti_op_construct_JSConstruct):
1391 2008-09-15 Mark Rowe <mrowe@apple.com>
1397 2008-09-15 Geoffrey Garen <ggaren@apple.com>
1399 Reviewed by Maciej Stachowiak.
1401 Fixed a typo in op_get_by_id_chain that caused it to miss every time
1404 Also, a little cleanup.
1407 (JSC::Machine::privateExecute): Set up baseObject before entering the
1408 loop, so we compare against the right values.
1410 2008-09-15 Geoffrey Garen <ggaren@apple.com>
1412 Reviewed by Sam Weinig.
1414 Removed the CalledAsConstructor flag from the call frame header. Now,
1415 we use an explicit opcode at the call site to fix up constructor results.
1417 SunSpider says 0.4% faster.
1419 cti_op_construct_verify is an out-of-line function call for now, but we
1420 can fix that once StructureID holds type information like isObject.
1423 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
1426 (JSC::CodeBlock::dump):
1428 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
1429 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
1430 (JSC::CodeGenerator::emitConstruct): ... ditto.
1432 * VM/Machine.cpp: No more CalledAsConstructor
1433 (JSC::Machine::privateExecute): Implementation for the new opcode.
1434 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
1435 called as a constructor.
1436 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
1439 * VM/Opcode.h: Declare new opcode.
1441 * VM/RegisterFile.h:
1442 (JSC::RegisterFile::): No more CalledAsConstructor
1444 2008-09-15 Gavin Barraclough <barraclough@apple.com>
1446 Reviewed by Geoff Garen.
1448 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
1449 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
1450 masquerading may be handled differently (through the StructureIDs - see bug
1456 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
1457 (JSC::CTI::privateCompileMainPass):
1458 (JSC::CTI::privateCompileSlowCases):
1461 (JSC::Machine::Machine):
1462 (JSC::Machine::cti_op_eq_null):
1463 (JSC::Machine::cti_op_neq_null):
1465 (JSC::Machine::doesMasqueradesAsUndefined):
1466 * kjs/JSWrapperObject.h:
1467 (JSC::JSWrapperObject::):
1468 (JSC::JSWrapperObject::JSWrapperObject):
1469 * kjs/StringObject.h:
1470 (JSC::StringObject::StringObject):
1471 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1472 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1474 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1476 Rubber-stamped by Oliver Hunt.
1478 r36427 broke CodeBlock::dump() by changing the number of arguments to
1479 op_construct without changing the code that prints it. This patch fixes
1480 it by printing the additional argument.
1482 * JavaScriptCore.xcodeproj/project.pbxproj:
1484 (JSC::CodeBlock::dump):
1486 2008-09-15 Adam Roben <aroben@apple.com>
1490 * kjs/StructureID.cpp: Removed a stray semicolon.
1492 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1494 Reviewed by Maciej Stachowiak.
1496 Fix a crash in fast/js/exception-expression-offset.html caused by not
1497 updating all mentions of the length of op_construct in r36427.
1500 (JSC::Machine::cti_op_construct_NotJSConstruct):
1502 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1504 Reviewed by Cameron Zwarich.
1506 - fix layout test failure introduced by fix for 20849
1508 (The failing test was fast/js/delete-then-put.html)
1511 (JSC::JSObject::removeDirect): Clear enumeration cache
1512 in the dictionary case.
1514 (JSC::JSObject::putDirect): Ditto.
1515 * kjs/StructureID.h:
1516 (JSC::StructureID::clearEnumerationCache): Inline to handle the
1519 2008-09-15 Maciej Stachowiak <mjs@apple.com>
1521 Reviewed by Cameron Zwarich.
1523 - fix JSC test failures introduced by fix for 20849
1525 * kjs/PropertyMap.cpp:
1526 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
1528 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1530 Reviewed by Maciej Stachowiak.
1532 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
1533 <https://bugs.webkit.org/show_bug.cgi?id=20851>
1535 r36410 introduced an optimization for parseInt() that is incorrect when
1536 its argument is larger than the range of a 32-bit integer. If the
1537 argument is a number that is not an immediate integer, then the correct
1538 behaviour is to return the floor of its value, unless it is an infinite
1539 value, in which case the correct behaviour is to return 0.
1541 * kjs/JSGlobalObjectFunctions.cpp:
1542 (JSC::globalFuncParseInt):
1544 2008-09-15 Sam Weinig <sam@webkit.org>
1546 Reviewed by Maciej Stachowiak.
1548 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
1549 Cache property names for getEnumerablePropertyNames in the StructureID.
1551 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
1552 on the v8 test suite.
1555 (JSC::JSObject::getPropertyNames):
1556 * kjs/PropertyMap.cpp:
1557 (JSC::PropertyMap::getEnumerablePropertyNames):
1558 * kjs/PropertyMap.h:
1559 * kjs/StructureID.cpp:
1560 (JSC::StructureID::StructureID):
1561 (JSC::StructureID::getEnumerablePropertyNames):
1562 * kjs/StructureID.h:
1564 2008-09-14 Maciej Stachowiak <mjs@apple.com>
1566 Reviewed by Cameron Zwarich.
1568 - speed up JS construction by extracting "prototype" lookup so PIC applies.
1570 ~0.5% speedup on SunSpider
1571 Speeds up some of the V8 tests as well, most notably earley-boyer.
1574 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
1575 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
1576 * VM/CodeGenerator.cpp:
1577 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
1579 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
1580 (JSC::Machine::cti_op_construct_JSConstruct): ditto
1581 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
1583 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
1585 Reviewed by Eric Seidel.
1587 Add a protected destructor for RefCounted.
1589 It is wrong to call its destructor directly, because (1) this should be taken care of by
1590 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
1592 No change in behavior.
1594 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
1596 2008-09-14 Gavin Barraclough <barraclough@apple.com>
1598 Reviewed by Sam Weinig.
1600 Accelerated property accesses.
1602 Inline more of the array access code into the JIT code for get/put_by_val.
1603 Accelerate get/put_by_id by speculatively inlining a disable direct access
1604 into the hot path of the code, and repatch this with the correct StructureID
1605 and property map offset once these are known. In the case of accesses to the
1606 prototype and reading the array-length a trampoline is genertaed, and the
1607 branch to the slow-case is relinked to jump to this.
1609 By repatching, we mean rewriting the x86 instruction stream. Instructions are
1610 only modified in a simple fasion - altering immediate operands, memory access
1611 deisplacements, and branch offsets.
1613 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
1614 instruction's immediate operant is updateded, and a memory access operation's
1615 displacement is updated to access the correct field on the object. In the case
1616 of more complex accesses (array length and get_by_id_prototype) the offset on
1617 the branch to slow-case is updated, to now jump to a trampoline.
1619 +2.8% sunspider, +13% v8-tests
1622 (JSC::CTI::emitCall):
1623 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
1625 (JSC::CTI::privateCompileMainPass):
1626 (JSC::CTI::privateCompileSlowCases):
1627 (JSC::CTI::privateCompile):
1628 (JSC::CTI::privateCompileGetByIdSelf):
1629 (JSC::CTI::privateCompileGetByIdProto):
1630 (JSC::CTI::privateCompileGetByIdChain):
1631 (JSC::CTI::privateCompilePutByIdReplace):
1632 (JSC::CTI::privateCompilePutByIdTransition):
1633 (JSC::CTI::privateCompileArrayLengthTrampoline):
1634 (JSC::CTI::privateCompileStringLengthTrampoline):
1635 (JSC::CTI::patchGetByIdSelf):
1636 (JSC::CTI::patchPutByIdReplace):
1637 (JSC::CTI::privateCompilePatchGetArrayLength):
1638 (JSC::CTI::privateCompilePatchGetStringLength):
1640 (JSC::CTI::compileGetByIdSelf):
1641 (JSC::CTI::compileGetByIdProto):
1642 (JSC::CTI::compileGetByIdChain):
1643 (JSC::CTI::compilePutByIdReplace):
1644 (JSC::CTI::compilePutByIdTransition):
1645 (JSC::CTI::compileArrayLengthTrampoline):
1646 (JSC::CTI::compileStringLengthTrampoline):
1647 (JSC::CTI::compilePatchGetArrayLength):
1648 (JSC::CTI::compilePatchGetStringLength):
1650 (JSC::CodeBlock::dump):
1651 (JSC::CodeBlock::~CodeBlock):
1653 (JSC::StructureStubInfo::StructureStubInfo):
1654 (JSC::CodeBlock::getStubInfo):
1656 (JSC::Machine::tryCTICachePutByID):
1657 (JSC::Machine::tryCTICacheGetByID):
1658 (JSC::Machine::cti_op_put_by_val_array):
1660 * masm/X86Assembler.h:
1661 (JSC::X86Assembler::):
1662 (JSC::X86Assembler::cmpl_i8m):
1663 (JSC::X86Assembler::emitUnlinkedJa):
1664 (JSC::X86Assembler::getRelocatedAddress):
1665 (JSC::X86Assembler::getDifferenceBetweenLabels):
1666 (JSC::X86Assembler::emitModRm_opmsib):
1668 2008-09-14 Maciej Stachowiak <mjs@apple.com>
1670 Reviewed by Cameron Zwarich.
1672 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
1674 ~5% speedup on v8 earley-boyer test
1676 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
1677 * API/JSCallbackObjectFunctions.h:
1678 (JSC::::hasInstance): Ditto.
1679 * API/JSValueRef.cpp:
1680 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
1681 * JavaScriptCore.exp:
1683 (JSC::CTI::privateCompileMainPass): Pass along prototype.
1685 (JSC::CodeBlock::dump): Print third arg.
1686 * VM/CodeGenerator.cpp:
1687 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
1688 is a third argument.
1689 * VM/CodeGenerator.h:
1691 (JSC::Machine::privateExecute): Pass along the prototype.
1692 (JSC::Machine::cti_op_instanceof): ditto
1694 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
1697 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
1698 property and pass that register to instanceof.
1701 2008-09-14 Gavin Barraclough <barraclough@apple.com>
1703 Reviewed by Sam Weinig.
1705 Remove unnecessary virtual function call from cti_op_call_JSFunction -
1706 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
1709 (JSC::Machine::cti_op_call_JSFunction):
1711 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1713 Reviewed by Maciej Stachowiak.
1715 Bug 20827: the 'typeof' operator is slow
1716 <https://bugs.webkit.org/show_bug.cgi?id=20827>
1718 Optimize the 'typeof' operator when its result is compared to a constant
1721 This is a 5.5% speedup on the V8 Earley-Boyer test.
1724 (JSC::CTI::privateCompileMainPass):
1726 (JSC::CodeBlock::dump):
1727 * VM/CodeGenerator.cpp:
1728 (JSC::CodeGenerator::emitEqualityOp):
1729 * VM/CodeGenerator.h:
1731 (JSC::jsIsObjectType):
1732 (JSC::jsIsFunctionType):
1733 (JSC::Machine::privateExecute):
1734 (JSC::Machine::cti_op_is_undefined):
1735 (JSC::Machine::cti_op_is_boolean):
1736 (JSC::Machine::cti_op_is_number):
1737 (JSC::Machine::cti_op_is_string):
1738 (JSC::Machine::cti_op_is_object):
1739 (JSC::Machine::cti_op_is_function):
1743 (JSC::BinaryOpNode::emitCode):
1744 (JSC::EqualNode::emitCode):
1745 (JSC::StrictEqualNode::emitCode):
1748 2008-09-14 Sam Weinig <sam@webkit.org>
1750 Reviewed by Cameron Zwarich.
1752 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
1753 Speed up parseInt for numbers
1755 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
1756 No change on the v8 suite.
1758 * kjs/JSGlobalObjectFunctions.cpp:
1759 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
1760 convert them back to numbers.
1762 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1764 Reviewed by Oliver Hunt.
1766 Bug 20816: op_lesseq should be optimized
1767 <https://bugs.webkit.org/show_bug.cgi?id=20816>
1769 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
1771 This is a 9.4% speedup on the V8 Crypto benchmark.
1774 (JSC::CTI::privateCompileMainPass):
1775 (JSC::CTI::privateCompileSlowCases):
1777 (JSC::CodeBlock::dump):
1778 * VM/CodeGenerator.cpp:
1779 (JSC::CodeGenerator::emitJumpIfTrue):
1781 (JSC::Machine::privateExecute):
1782 (JSC::Machine::cti_op_loop_if_lesseq):
1786 2008-09-14 Sam Weinig <sam@webkit.org>
1788 Reviewed by Cameron Zwarich.
1790 Cleanup Sampling code.
1793 (JSC::CTI::emitCall):
1794 (JSC::CTI::privateCompileMainPass):
1796 (JSC::CTI::execute):
1797 * VM/SamplingTool.cpp:
1799 (JSC::SamplingTool::run):
1800 (JSC::SamplingTool::dump):
1801 * VM/SamplingTool.h:
1802 (JSC::SamplingTool::callingHostFunction):
1804 2008-09-13 Oliver Hunt <oliver@apple.com>
1806 Reviewed by Cameron Zwarich.
1808 Bug 20821: Cache property transitions to speed up object initialization
1809 https://bugs.webkit.org/show_bug.cgi?id=20821
1811 Implement a transition cache to improve the performance of new properties
1812 being added to objects. This is extremely beneficial in constructors and
1813 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
1817 (JSC::CTI::privateCompileMainPass):
1819 (JSC::transitionWillNeedStorageRealloc):
1820 (JSC::CTI::privateCompilePutByIdTransition):
1822 (JSC::CTI::compilePutByIdTransition):
1824 (JSC::printPutByIdOp):
1825 (JSC::CodeBlock::printStructureIDs):
1826 (JSC::CodeBlock::dump):
1827 (JSC::CodeBlock::derefStructureIDs):
1828 (JSC::CodeBlock::refStructureIDs):
1829 * VM/CodeGenerator.cpp:
1830 (JSC::CodeGenerator::emitPutById):
1832 (JSC::cachePrototypeChain):
1833 (JSC::Machine::tryCachePutByID):
1834 (JSC::Machine::tryCacheGetByID):
1835 (JSC::Machine::privateExecute):
1836 (JSC::Machine::tryCTICachePutByID):
1837 (JSC::Machine::tryCTICacheGetByID):
1841 (JSC::JSObject::putDirect):
1842 (JSC::JSObject::transitionTo):
1843 * kjs/PutPropertySlot.h:
1844 (JSC::PutPropertySlot::PutPropertySlot):
1845 (JSC::PutPropertySlot::wasTransition):
1846 (JSC::PutPropertySlot::setWasTransition):
1847 * kjs/StructureID.cpp:
1848 (JSC::StructureID::transitionTo):
1849 (JSC::StructureIDChain::StructureIDChain):
1850 * kjs/StructureID.h:
1851 (JSC::StructureID::previousID):
1852 (JSC::StructureID::setCachedPrototypeChain):
1853 (JSC::StructureID::cachedPrototypeChain):
1854 (JSC::StructureID::propertyMap):
1855 * masm/X86Assembler.h:
1856 (JSC::X86Assembler::addl_i8m):
1857 (JSC::X86Assembler::subl_i8m):
1859 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1861 Reviewed by Maciej Stachowiak.
1863 Bug 20819: JSValue::isObject() is slow
1864 <https://bugs.webkit.org/show_bug.cgi?id=20819>
1866 Optimize JSCell::isObject() and JSCell::isString() by making them
1867 non-virtual calls that rely on the StructureID type information.
1869 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
1872 * JavaScriptCore.exp:
1875 (JSC::JSCell::isObject):
1876 (JSC::JSCell::isString):
1881 (JSC::JSString::JSString):
1882 * kjs/StructureID.h:
1883 (JSC::StructureID::type):
1885 2008-09-11 Stephanie Lewis <slewis@apple.com>
1887 Reviewed by Oliver Hunt.
1889 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
1890 crash on CNN and on Dromaeo.
1891 Fix Missing close tag in vcproj.
1893 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1895 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1899 Correct an SVN problem with the last commit and actually add the new
1902 * wrec/CharacterClassConstructor.cpp: Added.
1904 (JSC::getCharacterClassNewline):
1905 (JSC::getCharacterClassDigits):
1906 (JSC::getCharacterClassSpaces):
1907 (JSC::getCharacterClassWordchar):
1908 (JSC::getCharacterClassNondigits):
1909 (JSC::getCharacterClassNonspaces):
1910 (JSC::getCharacterClassNonwordchar):
1911 (JSC::CharacterClassConstructor::addSorted):
1912 (JSC::CharacterClassConstructor::addSortedRange):
1913 (JSC::CharacterClassConstructor::put):
1914 (JSC::CharacterClassConstructor::flush):
1915 (JSC::CharacterClassConstructor::append):
1916 * wrec/CharacterClassConstructor.h: Added.
1917 (JSC::CharacterClassConstructor::CharacterClassConstructor):
1918 (JSC::CharacterClassConstructor::isUpsideDown):
1919 (JSC::CharacterClassConstructor::charClass):
1921 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1923 Reviewed by Maciej Stachowiak.
1925 Bug 20788: Split CharacterClassConstructor into its own file
1926 <https://bugs.webkit.org/show_bug.cgi?id=20788>
1928 Split CharacterClassConstructor into its own file and clean up some
1931 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1932 * JavaScriptCore.xcodeproj/project.pbxproj:
1933 * wrec/CharacterClassConstructor.cpp: Added.
1935 (JSC::getCharacterClassNewline):
1936 (JSC::getCharacterClassDigits):
1937 (JSC::getCharacterClassSpaces):
1938 (JSC::getCharacterClassWordchar):
1939 (JSC::getCharacterClassNondigits):
1940 (JSC::getCharacterClassNonspaces):
1941 (JSC::getCharacterClassNonwordchar):
1942 (JSC::CharacterClassConstructor::addSorted):
1943 (JSC::CharacterClassConstructor::addSortedRange):
1944 (JSC::CharacterClassConstructor::put):
1945 (JSC::CharacterClassConstructor::flush):
1946 (JSC::CharacterClassConstructor::append):
1947 * wrec/CharacterClassConstructor.h: Added.
1948 (JSC::CharacterClassConstructor::CharacterClassConstructor):
1949 (JSC::CharacterClassConstructor::isUpsideDown):
1950 (JSC::CharacterClassConstructor::charClass):
1952 (JSC::WRECParser::parseCharacterClass):
1954 2008-09-10 Simon Hausmann <hausmann@webkit.org>
1956 Not reviewed but trivial one-liner for yet unused macro.
1958 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
1960 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
1964 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1966 Rubber-stamped by Oliver Hunt.
1968 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
1972 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
1973 * masm/X86Assembler.h:
1974 (JSC::X86Assembler::orl_i32r):
1976 (JSC::WRECGenerator::generatePatternCharacter):
1977 (JSC::WRECGenerator::generateCharacterClassInverted):
1979 2008-09-10 Sam Weinig <sam@webkit.org>
1981 Reviewed by Geoff Garen.
1983 Add inline property storage for JSObject.
1985 1.2% progression on Sunspider. .5% progression on the v8 test suite.
1987 * JavaScriptCore.exp:
1989 (JSC::CTI::privateCompileGetByIdProto):
1990 (JSC::CTI::privateCompileGetByIdChain):
1992 (JSC::JSObject::mark): There is no reason to check storageSize now that
1994 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
1996 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
1997 now so there is no reason to .get()
1998 (JSC::JSObject::usingInlineStorage):
1999 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
2001 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
2003 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
2004 we know that we are about to add a property that will overflow the inline
2006 * kjs/PropertyMap.cpp:
2007 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
2008 now handled by JSObject.
2009 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
2010 * kjs/PropertyMap.h:
2011 (JSC::PropertyMap::storageSize): Rename from markingCount.
2012 * kjs/StructureID.cpp:
2013 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
2014 if we are using inline storage.
2015 * kjs/StructureID.h:
2017 2008-09-10 Oliver Hunt <oliver@apple.com>
2019 Reviewed by Geoff Garen.
2021 Inline immediate number version of op_mul.
2023 Renamed mull_rr to imull_rr as that's what it's
2024 actually doing, and added imull_i32r for the constant
2025 case immediate multiply.
2027 1.1% improvement to SunSpider.
2030 (JSC::CTI::privateCompileMainPass):
2031 (JSC::CTI::privateCompileSlowCases):
2032 * masm/X86Assembler.h:
2033 (JSC::X86Assembler::):
2034 (JSC::X86Assembler::imull_rr):
2035 (JSC::X86Assembler::imull_i32r):
2037 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2043 * JavaScriptCore.xcodeproj/project.pbxproj:
2045 2008-09-09 Oliver Hunt <oliver@apple.com>
2047 Reviewed by Maciej Stachowiak.
2049 Add optimised access to known properties on the global object.
2051 Improve cross scope access to the global object by emitting
2052 code to access it directly rather than by walking the scope chain.
2054 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
2057 (JSC::CTI::privateCompileMainPass):
2058 (JSC::CTI::emitGetVariableObjectRegister):
2059 (JSC::CTI::emitPutVariableObjectRegister):
2062 (JSC::CodeBlock::dump):
2063 * VM/CodeGenerator.cpp:
2064 (JSC::CodeGenerator::findScopedProperty):
2065 (JSC::CodeGenerator::emitResolve):
2066 (JSC::CodeGenerator::emitGetScopedVar):
2067 (JSC::CodeGenerator::emitPutScopedVar):
2068 * VM/CodeGenerator.h:
2070 (JSC::Machine::privateExecute):
2073 (JSC::FunctionCallResolveNode::emitCode):
2074 (JSC::PostfixResolveNode::emitCode):
2075 (JSC::PrefixResolveNode::emitCode):
2076 (JSC::ReadModifyResolveNode::emitCode):
2077 (JSC::AssignResolveNode::emitCode):
2079 2008-09-10 Maciej Stachowiak <mjs@apple.com>
2083 - enable polymorphic inline caching of properties of primitives
2085 1.012x speedup on SunSpider.
2087 We create special structure IDs for JSString and
2088 JSNumberCell. Unlike normal structure IDs, these cannot hold the
2089 true prototype. Due to JS autoboxing semantics, the prototype used
2090 when looking up string or number properties depends on the lexical
2091 global object of the call site, not the creation site. Thus we
2092 enable StructureIDs to handle this quirk for primitives.
2094 Everything else should be straightforward.
2097 (JSC::CTI::privateCompileGetByIdProto):
2098 (JSC::CTI::privateCompileGetByIdChain):
2100 (JSC::CTI::compileGetByIdProto):
2101 (JSC::CTI::compileGetByIdChain):
2102 * VM/JSPropertyNameIterator.h:
2103 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
2105 (JSC::Machine::Machine):
2106 (JSC::cachePrototypeChain):
2107 (JSC::Machine::tryCachePutByID):
2108 (JSC::Machine::tryCacheGetByID):
2109 (JSC::Machine::privateExecute):
2110 (JSC::Machine::tryCTICachePutByID):
2111 (JSC::Machine::tryCTICacheGetByID):
2112 * kjs/GetterSetter.h:
2113 (JSC::GetterSetter::GetterSetter):
2115 * kjs/JSGlobalData.cpp:
2116 (JSC::JSGlobalData::JSGlobalData):
2117 * kjs/JSGlobalData.h:
2118 * kjs/JSGlobalObject.h:
2119 (JSC::StructureID::prototypeForLookup):
2120 * kjs/JSNumberCell.h:
2121 (JSC::JSNumberCell::JSNumberCell):
2122 (JSC::jsNumberCell):
2124 (JSC::JSObject::prototype):
2128 (JSC::jsOwnedString):
2130 (JSC::JSString::JSString):
2132 (JSC::jsSingleCharacterString):
2133 (JSC::jsSingleCharacterSubstring):
2134 (JSC::jsNontrivialString):
2135 * kjs/SmallStrings.cpp:
2136 (JSC::SmallStrings::createEmptyString):
2137 (JSC::SmallStrings::createSingleCharacterString):
2138 * kjs/StructureID.cpp:
2139 (JSC::StructureID::StructureID):
2140 (JSC::StructureID::addPropertyTransition):
2141 (JSC::StructureID::getterSetterTransition):
2142 (JSC::StructureIDChain::StructureIDChain):
2143 * kjs/StructureID.h:
2144 (JSC::StructureID::create):
2145 (JSC::StructureID::storedPrototype):
2147 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
2149 Reviewed by Sam Weinig.
2151 https://bugs.webkit.org/show_bug.cgi?id=20746
2153 Added WINCE platform macro.
2157 2008-09-09 Sam Weinig <sam@webkit.org>
2159 Reviewed by Mark Rowe.
2161 Remove unnecessary override of getOffset.
2163 Sunspider reports this as a .6% progression.
2165 * JavaScriptCore.exp:
2167 (JSC::JSObject::getDirectLocation):
2168 (JSC::JSObject::getOwnPropertySlotForWrite):
2169 (JSC::JSObject::putDirect):
2170 * kjs/PropertyMap.cpp:
2171 * kjs/PropertyMap.h:
2173 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2175 Reviewed by Maciej Stachowiak.
2177 Bug 20759: Remove MacroAssembler
2178 <https://bugs.webkit.org/show_bug.cgi?id=20759>
2180 Remove MacroAssembler and move its functionality to X86Assembler.
2182 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2183 * JavaScriptCore.xcodeproj/project.pbxproj:
2185 (JSC::CTI::emitGetArg):
2186 (JSC::CTI::emitGetPutArg):
2187 (JSC::CTI::emitPutArg):
2188 (JSC::CTI::emitPutCTIParam):
2189 (JSC::CTI::emitGetCTIParam):
2190 (JSC::CTI::emitPutToCallFrameHeader):
2191 (JSC::CTI::emitGetFromCallFrameHeader):
2192 (JSC::CTI::emitPutResult):
2193 (JSC::CTI::emitDebugExceptionCheck):
2194 (JSC::CTI::emitJumpSlowCaseIfNotImm):
2195 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2196 (JSC::CTI::emitFastArithDeTagImmediate):
2197 (JSC::CTI::emitFastArithReTagImmediate):
2198 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2199 (JSC::CTI::emitFastArithImmToInt):
2200 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2201 (JSC::CTI::emitFastArithIntToImmNoCheck):
2202 (JSC::CTI::compileOpCall):
2203 (JSC::CTI::emitSlowScriptCheck):
2204 (JSC::CTI::privateCompileMainPass):
2205 (JSC::CTI::privateCompileSlowCases):
2206 (JSC::CTI::privateCompile):
2207 (JSC::CTI::privateCompileGetByIdSelf):
2208 (JSC::CTI::privateCompileGetByIdProto):
2209 (JSC::CTI::privateCompileGetByIdChain):
2210 (JSC::CTI::privateCompilePutByIdReplace):
2211 (JSC::CTI::privateArrayLengthTrampoline):
2212 (JSC::CTI::privateStringLengthTrampoline):
2213 (JSC::CTI::compileRegExp):
2215 (JSC::CallRecord::CallRecord):
2216 (JSC::JmpTable::JmpTable):
2217 (JSC::SlowCaseEntry::SlowCaseEntry):
2218 (JSC::CTI::JSRInfo::JSRInfo):
2219 * masm/MacroAssembler.h: Removed.
2220 * masm/MacroAssemblerWin.cpp: Removed.
2221 * masm/X86Assembler.h:
2222 (JSC::X86Assembler::emitConvertToFastCall):
2223 (JSC::X86Assembler::emitRestoreArgumentReference):
2225 (JSC::WRECGenerator::WRECGenerator):
2226 (JSC::WRECParser::WRECParser):
2228 2008-09-09 Sam Weinig <sam@webkit.org>
2230 Reviewed by Cameron Zwarich.
2232 Don't waste the first item in the PropertyStorage.
2234 - Fix typo (makingCount -> markingCount)
2235 - Remove undefined method declaration.
2237 No change on Sunspider.
2240 (JSC::JSObject::mark):
2241 * kjs/PropertyMap.cpp:
2242 (JSC::PropertyMap::put):
2243 (JSC::PropertyMap::remove):
2244 (JSC::PropertyMap::getOffset):
2245 (JSC::PropertyMap::insert):
2246 (JSC::PropertyMap::rehash):
2247 (JSC::PropertyMap::resizePropertyStorage):
2248 (JSC::PropertyMap::checkConsistency):
2249 * kjs/PropertyMap.h:
2250 (JSC::PropertyMap::markingCount): Fix typo.
2252 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2256 Speculative Windows build fix.
2258 * masm/MacroAssemblerWin.cpp:
2259 (JSC::MacroAssembler::emitConvertToFastCall):
2260 (JSC::MacroAssembler::emitRestoreArgumentReference):
2262 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2264 Reviewed by Maciej Stachowiak.
2266 Bug 20755: Create an X86 namespace for register names and other things
2267 <https://bugs.webkit.org/show_bug.cgi?id=20755>
2269 Create an X86 namespace to put X86 register names. Perhaps I will move
2270 opcode names here later as well.
2273 (JSC::CTI::emitGetArg):
2274 (JSC::CTI::emitGetPutArg):
2275 (JSC::CTI::emitPutArg):
2276 (JSC::CTI::emitPutArgConstant):
2277 (JSC::CTI::emitPutCTIParam):
2278 (JSC::CTI::emitGetCTIParam):
2279 (JSC::CTI::emitPutToCallFrameHeader):
2280 (JSC::CTI::emitGetFromCallFrameHeader):
2281 (JSC::CTI::emitPutResult):
2282 (JSC::CTI::emitDebugExceptionCheck):
2283 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2284 (JSC::CTI::compileOpCall):
2285 (JSC::CTI::emitSlowScriptCheck):
2286 (JSC::CTI::privateCompileMainPass):
2287 (JSC::CTI::privateCompileSlowCases):
2288 (JSC::CTI::privateCompile):
2289 (JSC::CTI::privateCompileGetByIdSelf):
2290 (JSC::CTI::privateCompileGetByIdProto):
2291 (JSC::CTI::privateCompileGetByIdChain):
2292 (JSC::CTI::privateCompilePutByIdReplace):
2293 (JSC::CTI::privateArrayLengthTrampoline):
2294 (JSC::CTI::privateStringLengthTrampoline):
2295 (JSC::CTI::compileRegExp):
2297 * masm/X86Assembler.h:
2299 (JSC::X86Assembler::emitModRm_rm):
2300 (JSC::X86Assembler::emitModRm_rm_Unchecked):
2301 (JSC::X86Assembler::emitModRm_rmsib):
2303 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2304 (JSC::WRECGenerator::generateGreedyQuantifier):
2305 (JSC::WRECGenerator::generateParentheses):
2306 (JSC::WRECGenerator::generateBackreference):
2307 (JSC::WRECGenerator::gernerateDisjunction):
2310 2008-09-09 Sam Weinig <sam@webkit.org>
2312 Reviewed by Geoffrey Garen.
2314 Remove unnecessary friend declaration.
2316 * kjs/PropertyMap.h:
2318 2008-09-09 Sam Weinig <sam@webkit.org>
2320 Reviewed by Geoffrey Garen.
2322 Replace uses of PropertyMap::get and PropertyMap::getLocation with
2323 PropertyMap::getOffset.
2325 Sunspider reports this as a .6% improvement.
2327 * JavaScriptCore.exp:
2329 (JSC::JSObject::put):
2330 (JSC::JSObject::deleteProperty):
2331 (JSC::JSObject::getPropertyAttributes):
2333 (JSC::JSObject::getDirect):
2334 (JSC::JSObject::getDirectLocation):
2335 (JSC::JSObject::locationForOffset):
2336 * kjs/PropertyMap.cpp:
2337 (JSC::PropertyMap::remove):
2338 (JSC::PropertyMap::getOffset):
2339 * kjs/PropertyMap.h:
2341 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2343 Reviewed by Sam Weinig.
2345 Bug 20754: Remove emit prefix from assembler opcode methods
2346 <https://bugs.webkit.org/show_bug.cgi?id=20754>
2349 (JSC::CTI::emitGetArg):
2350 (JSC::CTI::emitGetPutArg):
2351 (JSC::CTI::emitPutArg):
2352 (JSC::CTI::emitPutArgConstant):
2353 (JSC::CTI::emitPutCTIParam):
2354 (JSC::CTI::emitGetCTIParam):
2355 (JSC::CTI::emitPutToCallFrameHeader):
2356 (JSC::CTI::emitGetFromCallFrameHeader):
2357 (JSC::CTI::emitPutResult):
2358 (JSC::CTI::emitDebugExceptionCheck):
2359 (JSC::CTI::emitCall):
2360 (JSC::CTI::emitJumpSlowCaseIfNotImm):
2361 (JSC::CTI::emitJumpSlowCaseIfNotImms):
2362 (JSC::CTI::emitFastArithDeTagImmediate):
2363 (JSC::CTI::emitFastArithReTagImmediate):
2364 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
2365 (JSC::CTI::emitFastArithImmToInt):
2366 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
2367 (JSC::CTI::emitFastArithIntToImmNoCheck):
2368 (JSC::CTI::compileOpCall):
2369 (JSC::CTI::emitSlowScriptCheck):
2370 (JSC::CTI::privateCompileMainPass):
2371 (JSC::CTI::privateCompileSlowCases):
2372 (JSC::CTI::privateCompile):
2373 (JSC::CTI::privateCompileGetByIdSelf):
2374 (JSC::CTI::privateCompileGetByIdProto):
2375 (JSC::CTI::privateCompileGetByIdChain):
2376 (JSC::CTI::privateCompilePutByIdReplace):
2377 (JSC::CTI::privateArrayLengthTrampoline):
2378 (JSC::CTI::privateStringLengthTrampoline):
2379 (JSC::CTI::compileRegExp):
2380 * masm/MacroAssemblerWin.cpp:
2381 (JSC::MacroAssembler::emitConvertToFastCall):
2382 (JSC::MacroAssembler::emitRestoreArgumentReference):
2383 * masm/X86Assembler.h:
2384 (JSC::X86Assembler::pushl_r):
2385 (JSC::X86Assembler::pushl_m):
2386 (JSC::X86Assembler::popl_r):
2387 (JSC::X86Assembler::popl_m):
2388 (JSC::X86Assembler::movl_rr):
2389 (JSC::X86Assembler::addl_rr):
2390 (JSC::X86Assembler::addl_i8r):
2391 (JSC::X86Assembler::addl_i32r):
2392 (JSC::X86Assembler::addl_mr):
2393 (JSC::X86Assembler::andl_rr):
2394 (JSC::X86Assembler::andl_i32r):
2395 (JSC::X86Assembler::cmpl_i8r):
2396 (JSC::X86Assembler::cmpl_rr):
2397 (JSC::X86Assembler::cmpl_rm):
2398 (JSC::X86Assembler::cmpl_i32r):
2399 (JSC::X86Assembler::cmpl_i32m):
2400 (JSC::X86Assembler::cmpw_rm):
2401 (JSC::X86Assembler::orl_rr):
2402 (JSC::X86Assembler::subl_rr):
2403 (JSC::X86Assembler::subl_i8r):
2404 (JSC::X86Assembler::subl_i32r):
2405 (JSC::X86Assembler::subl_mr):
2406 (JSC::X86Assembler::testl_i32r):
2407 (JSC::X86Assembler::testl_rr):
2408 (JSC::X86Assembler::xorl_i8r):
2409 (JSC::X86Assembler::xorl_rr):
2410 (JSC::X86Assembler::sarl_i8r):
2411 (JSC::X86Assembler::sarl_CLr):
2412 (JSC::X86Assembler::shl_i8r):
2413 (JSC::X86Assembler::shll_CLr):
2414 (JSC::X86Assembler::mull_rr):
2415 (JSC::X86Assembler::idivl_r):
2416 (JSC::X86Assembler::cdq):
2417 (JSC::X86Assembler::movl_mr):
2418 (JSC::X86Assembler::movzwl_mr):
2419 (JSC::X86Assembler::movl_rm):
2420 (JSC::X86Assembler::movl_i32r):
2421 (JSC::X86Assembler::movl_i32m):
2422 (JSC::X86Assembler::leal_mr):
2423 (JSC::X86Assembler::ret):
2424 (JSC::X86Assembler::jmp_r):
2425 (JSC::X86Assembler::jmp_m):
2426 (JSC::X86Assembler::call_r):
2428 (JSC::WRECGenerator::generateBacktrack1):
2429 (JSC::WRECGenerator::generateBacktrackBackreference):
2430 (JSC::WRECGenerator::generateBackreferenceQuantifier):
2431 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2432 (JSC::WRECGenerator::generateGreedyQuantifier):
2433 (JSC::WRECGenerator::generatePatternCharacter):
2434 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
2435 (JSC::WRECGenerator::generateCharacterClassInverted):
2436 (JSC::WRECGenerator::generateCharacterClass):
2437 (JSC::WRECGenerator::generateParentheses):
2438 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
2439 (JSC::WRECGenerator::generateAssertionBOL):
2440 (JSC::WRECGenerator::generateAssertionEOL):
2441 (JSC::WRECGenerator::generateAssertionWordBoundary):
2442 (JSC::WRECGenerator::generateBackreference):
2443 (JSC::WRECGenerator::gernerateDisjunction):
2445 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2447 Reviewed by Maciej Stachowiak.
2449 Clean up the WREC code some more.
2452 (JSC::CTI::compileRegExp):
2454 (JSC::getCharacterClassNewline):
2455 (JSC::getCharacterClassDigits):
2456 (JSC::getCharacterClassSpaces):
2457 (JSC::getCharacterClassWordchar):
2458 (JSC::getCharacterClassNondigits):
2459 (JSC::getCharacterClassNonspaces):
2460 (JSC::getCharacterClassNonwordchar):
2461 (JSC::WRECGenerator::generateBacktrack1):
2462 (JSC::WRECGenerator::generateBacktrackBackreference):
2463 (JSC::WRECGenerator::generateBackreferenceQuantifier):
2464 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2465 (JSC::WRECGenerator::generateGreedyQuantifier):
2466 (JSC::WRECGenerator::generatePatternCharacter):
2467 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
2468 (JSC::WRECGenerator::generateCharacterClassInverted):
2469 (JSC::WRECGenerator::generateCharacterClass):
2470 (JSC::WRECGenerator::generateParentheses):
2471 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
2472 (JSC::WRECGenerator::generateAssertionBOL):
2473 (JSC::WRECGenerator::generateAssertionEOL):
2474 (JSC::WRECGenerator::generateAssertionWordBoundary):
2475 (JSC::WRECGenerator::generateBackreference):
2476 (JSC::WRECGenerator::gernerateDisjunction):
2477 (JSC::WRECParser::parseCharacterClass):
2478 (JSC::WRECParser::parseEscape):
2479 (JSC::WRECParser::parseTerm):
2482 2008-09-09 Mark Rowe <mrowe@apple.com>
2484 Build fix, rubber-stamped by Anders Carlsson.
2486 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
2488 * JavaScriptCore.xcodeproj/project.pbxproj:
2490 2008-09-09 Mark Rowe <mrowe@apple.com>
2492 Rubber-stamped by Oliver Hunt.
2494 Fix builds using the "debug" variant.
2496 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
2497 and Release configurations.
2499 * Configurations/JavaScriptCore.xcconfig:
2500 * DerivedSources.make:
2501 * JavaScriptCore.Debug.exp: Removed.
2502 * JavaScriptCore.base.exp: Removed.
2503 * JavaScriptCore.exp: Added.
2504 * JavaScriptCore.xcodeproj/project.pbxproj:
2505 * kjs/identifier.cpp:
2506 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
2507 there is no overhead in Release builds.
2508 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
2510 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
2511 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
2513 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2515 Reviewed by Maciej Stachowiak.
2517 Clean up WREC a bit to bring it closer to our coding style guidelines.
2521 (JSC::getCharacterClass_newline):
2522 (JSC::getCharacterClass_d):
2523 (JSC::getCharacterClass_s):
2524 (JSC::getCharacterClass_w):
2525 (JSC::getCharacterClass_D):
2526 (JSC::getCharacterClass_S):
2527 (JSC::getCharacterClass_W):
2528 (JSC::CharacterClassConstructor::append):
2529 (JSC::WRECGenerator::generateNonGreedyQuantifier):
2530 (JSC::WRECGenerator::generateGreedyQuantifier):
2531 (JSC::WRECGenerator::generateCharacterClassInverted):
2532 (JSC::WRECParser::parseQuantifier):
2533 (JSC::WRECParser::parsePatternCharacterQualifier):
2534 (JSC::WRECParser::parseCharacterClassQuantifier):
2535 (JSC::WRECParser::parseBackreferenceQuantifier):
2537 (JSC::Quantifier::):
2538 (JSC::Quantifier::Quantifier):
2540 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
2542 Reviewed by Alexey Proskuryakov.
2544 Try MIME charset names before trying IANA names
2545 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
2547 * wtf/StringExtras.h: (strcasecmp): Added.
2549 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2551 Reviewed by Mark Rowe.
2553 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
2554 <https://bugs.webkit.org/show_bug.cgi?id=20719>
2555 <rdar://problem/6205787>
2557 Fix a typo in the case-insensitive matching of character patterns.
2560 (JSC::WRECGenerator::generatePatternCharacter):
2562 2008-09-09 Maciej Stachowiak <mjs@apple.com>
2564 Reviewed by Sam Weinig.
2566 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
2568 1.012x speedup on SunSpider.
2570 * kjs/MathObject.cpp:
2571 (JSC::MathObject::getOwnPropertySlot):
2573 (JSC::setUpStaticFunctionSlot):
2575 (JSC::getStaticPropertySlot):
2577 2008-09-08 Sam Weinig <sam@webkit.org>
2579 Reviewed by Maciej Stachowiak and Oliver Hunt.
2581 Split storage of properties out of the PropertyMap and into the JSObject
2582 to allow sharing PropertyMap on the StructureID. In order to get this
2583 function correctly, the StructureID's transition mappings were changed to
2584 transition based on property name and attribute pairs, instead of just
2587 - Removes the single property optimization now that the PropertyMap is shared.
2588 This will be replaced by in-lining some values on the JSObject.
2590 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
2592 * JavaScriptCore.base.exp:
2594 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
2595 (JSC::CTI::privateCompileGetByIdProto): Ditto.
2596 (JSC::CTI::privateCompileGetByIdChain): Ditto.
2597 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
2599 (JSC::JSObject::mark): Mark the PropertyStorage.
2600 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
2601 (JSC::JSObject::deleteProperty): Ditto.
2602 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
2603 (JSC::JSObject::defineSetter): Ditto.
2604 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
2605 (JSC::JSObject::getPropertyNames): Ditto.
2606 (JSC::JSObject::removeDirect): Ditto.
2607 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
2608 (JSC::JSObject::propertyStorage): return the PropertyStorage.
2609 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
2610 (JSC::JSObject::getDirectLocation): Ditto.
2611 (JSC::JSObject::offsetForLocation): Compute location directly.
2612 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
2613 (JSC::JSObject::hasGetterSetterProperties): Ditto.
2614 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
2615 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
2616 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
2617 (JSC::JSObject::getOwnPropertySlot): Ditto.
2618 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
2619 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
2620 (JSC::PropertyMap::checkConsistency):
2621 (JSC::PropertyMap::operator=):
2622 (JSC::PropertyMap::~PropertyMap):
2623 (JSC::PropertyMap::get):
2624 (JSC::PropertyMap::getLocation):
2625 (JSC::PropertyMap::put):
2626 (JSC::PropertyMap::getOffset):
2627 (JSC::PropertyMap::insert):
2628 (JSC::PropertyMap::expand):
2629 (JSC::PropertyMap::rehash):
2630 (JSC::PropertyMap::createTable):
2631 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
2632 (JSC::PropertyMap::remove):
2633 (JSC::PropertyMap::getEnumerablePropertyNames):
2634 * kjs/PropertyMap.h:
2635 (JSC::PropertyMapEntry::PropertyMapEntry):
2636 (JSC::PropertyMap::isEmpty):
2637 (JSC::PropertyMap::size):
2638 (JSC::PropertyMap::makingCount):
2639 (JSC::PropertyMap::PropertyMap):
2641 * kjs/StructureID.cpp:
2642 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
2644 (JSC::StructureID::toDictionaryTransition): Copy the map.
2645 (JSC::StructureID::changePrototypeTransition): Copy the map.
2646 (JSC::StructureID::getterSetterTransition): Copy the map.
2647 (JSC::StructureID::~StructureID):
2648 * kjs/StructureID.h:
2649 (JSC::TransitionTableHash::hash): Custom hash for transition map.
2650 (JSC::TransitionTableHash::equal): Ditto.
2651 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
2652 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
2653 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
2654 (JSC::StructureID::propertyMap): Added.
2656 2008-09-08 Oliver Hunt <oliver@apple.com>
2658 Reviewed by Mark Rowe.
2660 Bug 20694: Slow Script error pops up when running Dromaeo tests
2662 Correct error in timeout logic where execution tick count would
2663 be reset to incorrect value due to incorrect offset and indirection.
2664 Codegen for the slow script dialog was factored out into a separate
2665 method (emitSlowScriptCheck) rather than having multiple copies of
2666 the same code. Also added calls to generate slow script checks
2667 for loop_if_less and loop_if_true opcodes.
2670 (JSC::CTI::emitSlowScriptCheck):
2671 (JSC::CTI::privateCompileMainPass):
2672 (JSC::CTI::privateCompileSlowCases):
2675 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2677 Reviewed by Maciej Stachowiak.
2679 Remove references to the removed WRECompiler class.
2684 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2686 Rubber-stamped by Mark Rowe.
2688 Fix the build with CTI enabled but WREC disabled.
2693 2008-09-08 Dan Bernstein <mitz@apple.com>
2698 (JSC::StatementNode::):
2701 2008-09-08 Kevin McCullough <kmccullough@apple.com>
2705 <rdar://problem/6134407> Breakpoints in for loops, while loops or
2706 conditions without curly braces don't break. (19306)
2707 -Statement Lists already emit debug hooks but conditionals without
2708 brackets are not lists.
2711 (KJS::IfNode::emitCode):
2712 (KJS::IfElseNode::emitCode):
2713 (KJS::DoWhileNode::emitCode):
2714 (KJS::WhileNode::emitCode):
2715 (KJS::ForNode::emitCode):
2716 (KJS::ForInNode::emitCode):
2718 (KJS::StatementNode::):
2721 2008-09-08 Maciej Stachowiak <mjs@apple.com>
2723 Reviewed by Anders Carlsson.
2725 - Cache the code generated for eval to speed up SunSpider and web sites
2726 https://bugs.webkit.org/show_bug.cgi?id=20718
2729 2.29x on date-format-tofte
2731 Lots of real sites seem to get many hits on this cache as well,
2732 including GMail, Google Spreadsheets, Slate and Digg (the last of
2733 these gets over 100 hits on initial page load).
2736 (JSC::EvalCodeCache::get):
2738 (JSC::Machine::callEval):
2739 (JSC::Machine::privateExecute):
2740 (JSC::Machine::cti_op_call_eval):
2743 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2745 Reviewed by Oliver Hunt.
2747 Bug 20711: Change KJS prefix on preprocessor macros to JSC
2748 <https://bugs.webkit.org/show_bug.cgi?id=20711>
2750 * kjs/CommonIdentifiers.cpp:
2751 (JSC::CommonIdentifiers::CommonIdentifiers):
2752 * kjs/CommonIdentifiers.h:
2753 * kjs/PropertySlot.h:
2754 (JSC::PropertySlot::getValue):
2755 (JSC::PropertySlot::putValue):
2756 (JSC::PropertySlot::setValueSlot):
2757 (JSC::PropertySlot::setValue):
2758 (JSC::PropertySlot::setRegisterSlot):
2763 (JSC::ExpressionNode::):
2764 (JSC::StatementNode::):
2766 (JSC::BooleanNode::):
2767 (JSC::NumberNode::):
2768 (JSC::ImmediateNumberNode::):
2769 (JSC::StringNode::):
2770 (JSC::RegExpNode::):
2772 (JSC::ResolveNode::):
2773 (JSC::ElementNode::):
2775 (JSC::PropertyNode::):
2776 (JSC::PropertyListNode::):
2777 (JSC::ObjectLiteralNode::):
2778 (JSC::BracketAccessorNode::):
2779 (JSC::DotAccessorNode::):
2780 (JSC::ArgumentListNode::):
2781 (JSC::ArgumentsNode::):
2782 (JSC::NewExprNode::):
2783 (JSC::EvalFunctionCallNode::):
2784 (JSC::FunctionCallValueNode::):
2785 (JSC::FunctionCallResolveNode::):
2786 (JSC::FunctionCallBracketNode::):
2787 (JSC::FunctionCallDotNode::):
2788 (JSC::PrePostResolveNode::):
2789 (JSC::PostfixResolveNode::):
2790 (JSC::PostfixBracketNode::):
2791 (JSC::PostfixDotNode::):
2792 (JSC::PostfixErrorNode::):
2793 (JSC::DeleteResolveNode::):
2794 (JSC::DeleteBracketNode::):
2795 (JSC::DeleteDotNode::):
2796 (JSC::DeleteValueNode::):
2798 (JSC::TypeOfResolveNode::):
2799 (JSC::TypeOfValueNode::):
2800 (JSC::PrefixResolveNode::):
2801 (JSC::PrefixBracketNode::):
2802 (JSC::PrefixDotNode::):
2803 (JSC::PrefixErrorNode::):
2804 (JSC::UnaryPlusNode::):
2805 (JSC::NegateNode::):
2806 (JSC::BitwiseNotNode::):
2807 (JSC::LogicalNotNode::):
2813 (JSC::LeftShiftNode::):
2814 (JSC::RightShiftNode::):
2815 (JSC::UnsignedRightShiftNode::):
2817 (JSC::GreaterNode::):
2818 (JSC::LessEqNode::):
2819 (JSC::GreaterEqNode::):
2820 (JSC::ThrowableBinaryOpNode::):
2821 (JSC::InstanceOfNode::):
2824 (JSC::NotEqualNode::):
2825 (JSC::StrictEqualNode::):
2826 (JSC::NotStrictEqualNode::):
2827 (JSC::BitAndNode::):
2829 (JSC::BitXOrNode::):
2830 (JSC::LogicalOpNode::):
2831 (JSC::ConditionalNode::):
2832 (JSC::ReadModifyResolveNode::):
2833 (JSC::AssignResolveNode::):
2834 (JSC::ReadModifyBracketNode::):
2835 (JSC::AssignBracketNode::):
2836 (JSC::AssignDotNode::):
2837 (JSC::ReadModifyDotNode::):
2838 (JSC::AssignErrorNode::):
2840 (JSC::VarDeclCommaNode::):
2841 (JSC::ConstDeclNode::):
2842 (JSC::ConstStatementNode::):
2843 (JSC::EmptyStatementNode::):
2844 (JSC::DebuggerStatementNode::):
2845 (JSC::ExprStatementNode::):
2846 (JSC::VarStatementNode::):
2848 (JSC::IfElseNode::):
2849 (JSC::DoWhileNode::):
2852 (JSC::ContinueNode::):
2854 (JSC::ReturnNode::):
2859 (JSC::ParameterNode::):
2861 (JSC::ProgramNode::):
2863 (JSC::FunctionBodyNode::):
2864 (JSC::FuncExprNode::):
2865 (JSC::FuncDeclNode::):
2866 (JSC::CaseClauseNode::):
2867 (JSC::ClauseListNode::):
2868 (JSC::CaseBlockNode::):
2869 (JSC::SwitchNode::):
2871 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2873 Reviewed by Maciej Stachowiak.
2875 Bug 20704: Replace the KJS namespace
2876 <https://bugs.webkit.org/show_bug.cgi?id=20704>
2878 Rename the KJS namespace to JSC. There are still some uses of KJS in
2879 preprocessor macros and comments, but these will also be changed some
2880 time in the near future.
2887 * API/JSCallbackConstructor.cpp:
2888 * API/JSCallbackConstructor.h:
2889 * API/JSCallbackFunction.cpp:
2890 * API/JSCallbackFunction.h:
2891 * API/JSCallbackObject.cpp:
2892 * API/JSCallbackObject.h:
2893 * API/JSCallbackObjectFunctions.h:
2894 * API/JSClassRef.cpp:
2895 (OpaqueJSClass::staticValues):
2896 (OpaqueJSClass::staticFunctions):
2898 * API/JSContextRef.cpp:
2899 * API/JSObjectRef.cpp:
2900 * API/JSProfilerPrivate.cpp:
2901 * API/JSStringRef.cpp:
2902 * API/JSValueRef.cpp:
2904 * API/OpaqueJSString.cpp:
2905 * API/OpaqueJSString.h:
2906 * JavaScriptCore.Debug.exp:
2907 * JavaScriptCore.base.exp:
2913 * VM/CodeGenerator.cpp:
2914 * VM/CodeGenerator.h:
2915 * VM/ExceptionHelpers.cpp:
2916 * VM/ExceptionHelpers.h:
2918 * VM/JSPropertyNameIterator.cpp:
2919 * VM/JSPropertyNameIterator.h:
2927 * VM/RegisterFile.cpp:
2928 * VM/RegisterFile.h:
2931 * VM/SamplingTool.cpp:
2932 * VM/SamplingTool.h:
2933 * VM/SegmentedVector.h:
2936 * kjs/Arguments.cpp:
2938 * kjs/ArrayConstructor.cpp:
2939 * kjs/ArrayConstructor.h:
2940 * kjs/ArrayPrototype.cpp:
2941 * kjs/ArrayPrototype.h:
2942 * kjs/BatchedTransitionOptimizer.h:
2943 * kjs/BooleanConstructor.cpp:
2944 * kjs/BooleanConstructor.h:
2945 * kjs/BooleanObject.cpp:
2946 * kjs/BooleanObject.h:
2947 * kjs/BooleanPrototype.cpp:
2948 * kjs/BooleanPrototype.h:
2952 * kjs/CommonIdentifiers.cpp:
2953 * kjs/CommonIdentifiers.h:
2954 * kjs/ConstructData.cpp:
2955 * kjs/ConstructData.h:
2956 * kjs/DateConstructor.cpp:
2957 * kjs/DateConstructor.h:
2958 * kjs/DateInstance.cpp:
2959 (JSC::DateInstance::msToGregorianDateTime):
2960 * kjs/DateInstance.h:
2963 * kjs/DatePrototype.cpp:
2964 * kjs/DatePrototype.h:
2965 * kjs/DebuggerCallFrame.cpp:
2966 * kjs/DebuggerCallFrame.h:
2969 * kjs/ErrorConstructor.cpp:
2970 * kjs/ErrorConstructor.h:
2971 * kjs/ErrorInstance.cpp:
2972 * kjs/ErrorInstance.h:
2973 * kjs/ErrorPrototype.cpp:
2974 * kjs/ErrorPrototype.h:
2975 * kjs/ExecState.cpp:
2977 * kjs/FunctionConstructor.cpp:
2978 * kjs/FunctionConstructor.h:
2979 * kjs/FunctionPrototype.cpp:
2980 * kjs/FunctionPrototype.h:
2981 * kjs/GetterSetter.cpp:
2982 * kjs/GetterSetter.h:
2983 * kjs/GlobalEvalFunction.cpp:
2984 * kjs/GlobalEvalFunction.h:
2985 * kjs/IndexToNameMap.cpp:
2986 * kjs/IndexToNameMap.h:
2987 * kjs/InitializeThreading.cpp:
2988 * kjs/InitializeThreading.h:
2989 * kjs/InternalFunction.cpp:
2990 * kjs/InternalFunction.h:
2991 (JSC::InternalFunction::InternalFunction):
2992 * kjs/JSActivation.cpp:
2993 * kjs/JSActivation.h:
2998 * kjs/JSFunction.cpp:
3000 (JSC::JSFunction::JSFunction):
3001 * kjs/JSGlobalData.cpp:
3002 (JSC::JSGlobalData::JSGlobalData):
3003 * kjs/JSGlobalData.h:
3004 * kjs/JSGlobalObject.cpp:
3005 * kjs/JSGlobalObject.h:
3006 * kjs/JSGlobalObjectFunctions.cpp:
3007 * kjs/JSGlobalObjectFunctions.h:
3008 * kjs/JSImmediate.cpp:
3009 * kjs/JSImmediate.h:
3012 * kjs/JSNotAnObject.cpp:
3013 * kjs/JSNotAnObject.h:
3014 * kjs/JSNumberCell.cpp:
3015 * kjs/JSNumberCell.h:
3018 * kjs/JSStaticScopeObject.cpp:
3019 * kjs/JSStaticScopeObject.h:
3025 * kjs/JSVariableObject.cpp:
3026 * kjs/JSVariableObject.h:
3027 * kjs/JSWrapperObject.cpp:
3028 * kjs/JSWrapperObject.h:
3029 * kjs/LabelStack.cpp:
3031 * kjs/MathObject.cpp:
3033 * kjs/NativeErrorConstructor.cpp:
3034 * kjs/NativeErrorConstructor.h:
3035 * kjs/NativeErrorPrototype.cpp:
3036 * kjs/NativeErrorPrototype.h:
3038 * kjs/NumberConstructor.cpp:
3039 * kjs/NumberConstructor.h:
3040 * kjs/NumberObject.cpp:
3041 * kjs/NumberObject.h:
3042 * kjs/NumberPrototype.cpp:
3043 * kjs/NumberPrototype.h:
3044 * kjs/ObjectConstructor.cpp:
3045 * kjs/ObjectConstructor.h:
3046 * kjs/ObjectPrototype.cpp:
3047 * kjs/ObjectPrototype.h:
3050 * kjs/PropertyMap.cpp:
3051 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
3052 * kjs/PropertyMap.h:
3053 * kjs/PropertyNameArray.cpp:
3054 * kjs/PropertyNameArray.h:
3055 * kjs/PropertySlot.cpp:
3056 * kjs/PropertySlot.h:
3057 * kjs/PrototypeFunction.cpp:
3058 * kjs/PrototypeFunction.h:
3059 * kjs/PutPropertySlot.h:
3060 * kjs/RegExpConstructor.cpp:
3061 * kjs/RegExpConstructor.h:
3062 * kjs/RegExpObject.cpp:
3063 * kjs/RegExpObject.h:
3064 * kjs/RegExpPrototype.cpp:
3065 * kjs/RegExpPrototype.h:
3066 * kjs/ScopeChain.cpp:
3068 * kjs/ScopeChainMark.h:
3071 * kjs/SmallStrings.cpp:
3072 * kjs/SmallStrings.h:
3073 * kjs/SourceProvider.h:
3074 * kjs/SourceRange.h:
3075 * kjs/StringConstructor.cpp:
3076 * kjs/StringConstructor.h:
3077 * kjs/StringObject.cpp:
3078 * kjs/StringObject.h:
3079 * kjs/StringObjectThatMasqueradesAsUndefined.h:
3080 * kjs/StringPrototype.cpp:
3081 * kjs/StringPrototype.h:
3082 * kjs/StructureID.cpp:
3083 * kjs/StructureID.h:
3084 * kjs/SymbolTable.h:
3085 * kjs/collector.cpp:
3088 * kjs/create_hash_table:
3094 * kjs/identifier.cpp:
3096 (JSC::Identifier::equal):
3097 * kjs/interpreter.cpp:
3098 * kjs/interpreter.h:
3100 (JSC::Lexer::Lexer):
3101 (JSC::Lexer::clear):
3102 (JSC::Lexer::makeIdentifier):
3108 * kjs/nodes2string.cpp:
3109 * kjs/operations.cpp:
3117 (JSC::IdentifierRepHash::hash):
3119 * masm/MacroAssembler.h:
3120 * masm/MacroAssemblerWin.cpp:
3121 * masm/X86Assembler.h:
3122 * pcre/pcre_exec.cpp:
3123 * profiler/CallIdentifier.h:
3125 * profiler/HeavyProfile.cpp:
3126 * profiler/HeavyProfile.h:
3127 * profiler/Profile.cpp:
3128 * profiler/Profile.h:
3129 * profiler/ProfileGenerator.cpp:
3130 * profiler/ProfileGenerator.h:
3131 * profiler/ProfileNode.cpp:
3132 * profiler/ProfileNode.h:
3133 * profiler/Profiler.cpp:
3134 * profiler/Profiler.h:
3135 * profiler/TreeProfile.cpp:
3136 * profiler/TreeProfile.h:
3141 2008-09-07 Maciej Stachowiak <mjs@apple.com>
3143 Reviewed by Dan Bernstein.
3145 - rename IA32MacroAssembler class to X86Assembler
3147 We otherwise call the platform X86, and also, I don't see any macros.
3149 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3150 * JavaScriptCore.xcodeproj/project.pbxproj:
3151 * masm/IA32MacroAsm.h: Removed.
3152 * masm/MacroAssembler.h:
3153 (KJS::MacroAssembler::MacroAssembler):
3154 * masm/MacroAssemblerWin.cpp:
3155 (KJS::MacroAssembler::emitRestoreArgumentReference):
3156 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
3157 (KJS::X86Assembler::X86Assembler):
3159 (KJS::WRECGenerator::generateNonGreedyQuantifier):
3160 (KJS::WRECGenerator::generateGreedyQuantifier):
3161 (KJS::WRECGenerator::generateParentheses):
3162 (KJS::WRECGenerator::generateBackreference):
3163 (KJS::WRECGenerator::gernerateDisjunction):
3166 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
3170 Visual C++ seems to have some odd casting rules, so just convert the
3171 offending cast back to a C-style cast for now.
3173 * kjs/collector.cpp:
3174 (KJS::otherThreadStackPointer):
3176 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3178 Reviewed by Mark Rowe.
3180 Attempt to fix the Windows build by using a const_cast to cast regs.Esp
3181 to a uintptr_t instead of a reinterpret_cast.
3183 * kjs/collector.cpp:
3184 (KJS::otherThreadStackPointer):
3186 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3188 Reviewed by Sam Weinig.
3190 Remove C-style casts from kjs/collector.cpp.
3192 * kjs/collector.cpp:
3193 (KJS::Heap::heapAllocate):
3194 (KJS::currentThreadStackBase):
3195 (KJS::Heap::markConservatively):
3196 (KJS::otherThreadStackPointer):
3197 (KJS::Heap::markOtherThreadConservatively):
3200 2008-09-07 Mark Rowe <mrowe@apple.com>
3202 Build fix for the debug variant.
3204 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
3206 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3208 Reviewed by Timothy Hatcher.
3210 Remove C-style casts from the CTI code.
3213 (KJS::CTI::emitGetArg):
3214 (KJS::CTI::emitGetPutArg):
3215 (KJS::ctiRepatchCallByReturnAddress):
3216 (KJS::CTI::compileOpCall):
3217 (KJS::CTI::privateCompileMainPass):
3218 (KJS::CTI::privateCompileGetByIdSelf):
3219 (KJS::CTI::privateCompileGetByIdProto):
3220 (KJS::CTI::privateCompileGetByIdChain):
3221 (KJS::CTI::privateCompilePutByIdReplace):
3222 (KJS::CTI::privateArrayLengthTrampoline):
3223 (KJS::CTI::privateStringLengthTrampoline):
3225 === End merge of squirrelfish-extreme ===
3227 2008-09-06 Gavin Barraclough <barraclough@apple.com>
3229 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
3231 - refactor WREC to share more of the JIT infrastructure with CTI
3234 (KJS::CTI::emitGetArg):
3235 (KJS::CTI::emitGetPutArg):
3236 (KJS::CTI::emitPutArg):
3237 (KJS::CTI::emitPutArgConstant):
3238 (KJS::CTI::emitPutCTIParam):
3239 (KJS::CTI::emitGetCTIParam):
3240 (KJS::CTI::emitPutToCallFrameHeader):
3241 (KJS::CTI::emitGetFromCallFrameHeader):
3242 (KJS::CTI::emitPutResult):
3243 (KJS::CTI::emitDebugExceptionCheck):
3244 (KJS::CTI::emitJumpSlowCaseIfNotImm):
3245 (KJS::CTI::emitJumpSlowCaseIfNotImms):
3246 (KJS::CTI::emitFastArithDeTagImmediate):
3247 (KJS::CTI::emitFastArithReTagImmediate):
3248 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
3249 (KJS::CTI::emitFastArithImmToInt):
3250 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
3251 (KJS::CTI::emitFastArithIntToImmNoCheck):
3253 (KJS::CTI::compileOpCall):
3254 (KJS::CTI::privateCompileMainPass):
3255 (KJS::CTI::privateCompileSlowCases):
3256 (KJS::CTI::privateCompile):
3257 (KJS::CTI::privateCompileGetByIdSelf):
3258 (KJS::CTI::privateCompileGetByIdProto):
3259 (KJS::CTI::privateCompileGetByIdChain):
3260 (KJS::CTI::privateCompilePutByIdReplace):
3261 (KJS::CTI::privateArrayLengthTrampoline):
3262 (KJS::CTI::privateStringLengthTrampoline):
3263 (KJS::CTI::compileRegExp):
3265 (KJS::CallRecord::CallRecord):
3266 (KJS::JmpTable::JmpTable):
3267 (KJS::SlowCaseEntry::SlowCaseEntry):
3268 (KJS::CTI::JSRInfo::JSRInfo):
3270 (KJS::RegExp::RegExp):
3272 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
3273 (KJS::GeneratePatternCharacterFunctor::generateAtom):
3274 (KJS::GeneratePatternCharacterFunctor::backtrack):
3275 (KJS::GenerateCharacterClassFunctor::generateAtom):
3276 (KJS::GenerateCharacterClassFunctor::backtrack):
3277 (KJS::GenerateBackreferenceFunctor::generateAtom):
3278 (KJS::GenerateBackreferenceFunctor::backtrack):
3279 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
3280 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
3281 (KJS::WRECGenerate::generateBacktrack1):
3282 (KJS::WRECGenerate::generateBacktrackBackreference):
3283 (KJS::WRECGenerate::generateBackreferenceQuantifier):
3284 (KJS::WRECGenerate::generateNonGreedyQuantifier):
3285 (KJS::WRECGenerate::generateGreedyQuantifier):
3286 (KJS::WRECGenerate::generatePatternCharacter):
3287 (KJS::WRECGenerate::generateCharacterClassInvertedRange):
3288 (KJS::WRECGenerate::generateCharacterClassInverted):
3289 (KJS::WRECGenerate::generateCharacterClass):
3290 (KJS::WRECGenerate::generateParentheses):
3291 (KJS::WRECGenerate::generateParenthesesNonGreedy):
3292 (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
3293 (KJS::WRECGenerate::generateAssertionBOL):
3294 (KJS::WRECGenerate::generateAssertionEOL):
3295 (KJS::WRECGenerate::generateAssertionWordBoundary):
3296 (KJS::WRECGenerate::generateBackreference):
3297 (KJS::WRECGenerate::gernerateDisjunction):
3298 (KJS::WRECGenerate::terminateDisjunction):
3299 (KJS::WRECParser::parseGreedyQuantifier):
3300 (KJS::WRECParser::parseQuantifier):
3301 (KJS::WRECParser::parsePatternCharacterQualifier):
3302 (KJS::WRECParser::parseCharacterClassQuantifier):
3303 (KJS::WRECParser::parseBackreferenceQuantifier):
3304 (KJS::WRECParser::parseParentheses):
3305 (KJS::WRECParser::parseCharacterClass):
3306 (KJS::WRECParser::parseOctalEscape):
3307 (KJS::WRECParser::parseEscape):
3308 (KJS::WRECParser::parseTerm):
3309 (KJS::WRECParser::parseDisjunction):
3311 (KJS::WRECGenerate::WRECGenerate):
3312 (KJS::WRECParser::):
3313 (KJS::WRECParser::WRECParser):
3314 (KJS::WRECParser::parseAlternative):
3315 (KJS::WRECParser::isEndOfPattern):
3317 2008-09-06 Oliver Hunt <oliver@apple.com>
3319 Reviewed by NOBODY (Build fix).
3321 Fix the sampler build.
3323 * VM/SamplingTool.h:
3325 2008-09-06 Oliver Hunt <oliver@apple.com>
3327 Reviewed by Maciej Stachowiak.
3329 Jump through the necessary hoops required to make MSVC cooperate with SFX
3331 We now explicitly declare the calling convention on all cti_op_* cfunctions,
3332 and return int instead of bool where appropriate (despite the cdecl calling
3333 convention seems to state MSVC generates code that returns the result value
3334 through ecx). SFX behaves slightly differently under MSVC, specifically it
3335 stores the base argument address for the cti_op_* functions in the first
3336 argument, and then does the required stack manipulation through that pointer.
3337 This is necessary as MSVC's optimisations assume they have complete control
3338 of the stack, and periodically elide our stack manipulations, or move
3339 values in unexpected ways. MSVC also frequently produces tail calls which may
3340 clobber the first argument, so the MSVC path is slightly less efficient due
3341 to the need to restore it.
3343 * JavaScriptCore.xcodeproj/project.pbxproj:
3346 (KJS::CTI::compileOpCall):
3347 (KJS::CTI::privateCompileMainPass):
3348 (KJS::CTI::privateCompileSlowCases):
3352 * masm/MacroAssembler.h:
3353 (KJS::MacroAssembler::emitConvertToFastCall):
3354 * masm/MacroAssemblerIA32GCC.cpp: Removed.
3355 For performance reasons we need these no-op functions to be inlined.
3357 * masm/MacroAssemblerWin.cpp:
3358 (KJS::MacroAssembler::emitRestoreArgumentReference):
3361 2008-09-05 Geoffrey Garen <ggaren@apple.com>
3363 Reviewed by Maciej Stachowiak, or maybe the other way around.
3365 Added the ability to coalesce JITCode buffer grow operations by first
3366 growing the buffer and then executing unchecked puts to it.
3368 About a 2% speedup on date-format-tofte.
3371 (KJS::CTI::compileOpCall):
3372 * masm/IA32MacroAsm.h:
3373 (KJS::JITCodeBuffer::ensureSpace):
3374 (KJS::JITCodeBuffer::putByteUnchecked):
3375 (KJS::JITCodeBuffer::putByte):
3376 (KJS::JITCodeBuffer::putShortUnchecked):
3377 (KJS::JITCodeBuffer::putShort):
3378 (KJS::JITCodeBuffer::putIntUnchecked):
3379 (KJS::JITCodeBuffer::putInt):
3380 (KJS::IA32MacroAssembler::emitTestl_i32r):
3381 (KJS::IA32MacroAssembler::emitMovl_mr):
3382 (KJS::IA32MacroAssembler::emitMovl_rm):
3383 (KJS::IA32MacroAssembler::emitMovl_i32m):
3384 (KJS::IA32MacroAssembler::emitUnlinkedJe):
3385 (KJS::IA32MacroAssembler::emitModRm_rr):
3386 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
3387 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
3388 (KJS::IA32MacroAssembler::emitModRm_rm):
3389 (KJS::IA32MacroAssembler::emitModRm_opr):
3390 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
3391 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
3393 2008-09-05 Mark Rowe <mrowe@apple.com>
3395 Reviewed by Sam Weinig.
3397 Disable WREC and CTI on platforms that we have not yet had a chance to test with.
3401 2008-09-05 Geoffrey Garen <ggaren@apple.com>
3403 Reviewed by Sam Weinig.
3405 Use jo instead of a mask compare when fetching array.length and
3406 string.length. 4% speedup on array.length / string.length torture
3410 (KJS::CTI::privateArrayLengthTrampoline):
3411 (KJS::CTI::privateStringLengthTrampoline):
3413 2008-09-05 Geoffrey Garen <ggaren@apple.com>
3415 Reviewed by Sam Weinig.
3417 Removed a CTI compilation pass by recording labels during bytecode
3418 generation. This is more to reduce complexity than it is to improve
3421 SunSpider reports no change.
3423 CodeBlock now keeps a "labels" set, which holds the offsets of all the
3424 instructions that can be jumped to.
3426 * VM/CTI.cpp: Nixed a pass.
3428 * VM/CodeBlock.h: Added a "labels" set.
3430 * VM/LabelID.h: No need for a special LableID for holding jump
3431 destinations, since the CodeBlock now knows all jump destinations.
3433 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
3437 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
3439 2008-09-05 Mark Rowe <mrowe@apple.com>
3441 Reviewed by Oliver Hunt and Gavin Barraclough.
3443 Move the JITCodeBuffer onto Machine and remove the static variables.
3445 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
3447 (KJS::Machine::Machine): Allocate a JITCodeBuffer.
3449 * kjs/RegExpConstructor.cpp:
3450 (KJS::constructRegExp): Pass the ExecState through.
3451 * kjs/RegExpPrototype.cpp:
3452 (KJS::regExpProtoFuncCompile): Ditto.
3453 * kjs/StringPrototype.cpp:
3454 (KJS::stringProtoFuncMatch): Ditto.
3455 (KJS::stringProtoFuncSearch): Ditto.
3457 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
3458 so that we have access to an ExecState.
3460 (KJS::RegExpNode::):
3461 * kjs/nodes2string.cpp:
3463 (KJS::RegExp::RegExp): Pass the ExecState through.
3464 (KJS::RegExp::create): Ditto.
3466 * masm/IA32MacroAsm.h:
3467 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
3470 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
3473 2008-09-05 Mark Rowe <mrowe@apple.com>
3475 Reviewed by Oliver Hunt and Gavin Barraclough.
3477 Fix the build when CTI is disabled.
3480 (KJS::CodeBlock::~CodeBlock):
3481 * VM/CodeGenerator.cpp:
3482 (KJS::prepareJumpTableForStringSwitch):
3484 (KJS::Machine::Machine):
3485 (KJS::Machine::~Machine):
3487 2008-09-05 Gavin Barraclough <barraclough@apple.com>
3489 Reviewed by Mark Rowe.
3491 Fix some windows abi issues.
3494 (KJS::CTI::privateCompileMainPass):
3495 (KJS::CTI::privateCompileSlowCases):
3497 (KJS::CallRecord::CallRecord):
3500 (KJS::Machine::cti_op_resolve_func):
3501 (KJS::Machine::cti_op_post_inc):
3502 (KJS::Machine::cti_op_resolve_with_base):
3503 (KJS::Machine::cti_op_post_dec):
3506 2008-09-05 Mark Rowe <mrowe@apple.com>
3508 Reviewed by Sam Weinig.
3510 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
3513 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
3514 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
3516 2008-09-04 Mark Rowe <mrowe@apple.com>
3518 Reviewed by Sam Weinig.
3520 Fix fast/dom/Window/console-functions.html.
3522 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
3523 such as console.log would use the line number of the last JS function on the call stack.
3526 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
3527 and restore it when the function is done.
3528 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
3530 2008-09-05 Oliver Hunt <oliver@apple.com>
3532 Start bringing up SFX on windows.
3534 Reviewed by Mark Rowe and Sam Weinig
3536 Start doing the work to bring up SFX on windows. Initially
3537 just working on WREC, as it does not make any calls so reduces
3538 the amount of code that needs to be corrected.
3540 Start abstracting the CTI JIT codegen engine.
3543 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3544 * JavaScriptCore.xcodeproj/project.pbxproj:
3546 * masm/IA32MacroAsm.h:
3547 * masm/MacroAssembler.h: Added.
3548 (KJS::MacroAssembler::MacroAssembler):
3549 * masm/MacroAssemblerIA32GCC.cpp: Added.
3550 (KJS::MacroAssembler::emitConvertToFastCall):
3551 * masm/MacroAssemblerWin.cpp: Added.
3552 (KJS::MacroAssembler::emitConvertToFastCall):
3554 (KJS::WRECompiler::parseGreedyQuantifier):
3555 (KJS::WRECompiler::parseCharacterClass):
3556 (KJS::WRECompiler::parseEscape):
3557 (KJS::WRECompiler::compilePattern):
3560 2008-09-04 Gavin Barraclough <barraclough@apple.com>
3562 Reviewed by Sam Weinig.
3564 Support for slow scripts (timeout checking).
3567 (KJS::CTI::privateCompileMainPass):
3568 (KJS::CTI::privateCompile):
3570 (KJS::slideRegisterWindowForCall):
3571 (KJS::Machine::cti_timeout_check):
3572 (KJS::Machine::cti_vm_throw):
3574 2008-09-04 Sam Weinig <sam@webkit.org>
3576 Reviewed by Mark Rowe.
3578 Third round of style cleanup.
3587 2008-09-04 Sam Weinig <sam@webkit.org>
3589 Reviewed by Jon Honeycutt.
3591 Second round of style cleanup.
3597 2008-09-04 Sam Weinig <sam@webkit.org>
3599 Reviewed by Mark Rowe.
3601 First round of style cleanup.
3605 * masm/IA32MacroAsm.h:
3609 2008-09-04 Geoffrey Garen <ggaren@apple.com>
3611 Reviewed by Mark Rowe.
3613 Merged http://trac.webkit.org/changeset/36081 to work with CTI.
3616 (KJS::Machine::tryCtiCacheGetByID):
3618 2008-09-04 Gavin Barraclough <barraclough@apple.com>
3620 Reviewed by Sam Weinig.
3622 Enable profiling in CTI.
3626 (KJS::CTI::execute):
3628 (KJS::Machine::cti_op_call_JSFunction):
3629 (KJS::Machine::cti_op_call_NotJSFunction):
3630 (KJS::Machine::cti_op_ret):
3631 (KJS::Machine::cti_op_construct_JSConstruct):
3632 (KJS::Machine::cti_op_construct_NotJSConstruct):
3634 2008-09-04 Victor Hernandez <vhernandez@apple.com>
3636 Reviewed by Geoffrey Garen.
3638 Fixed an #if to support using WREC without CTI.
3641 (KJS::RegExp::match):
3643 2008-09-04 Gavin Barraclough <barraclough@apple.com>
3645 Reviewed by Oliver Hunt.
3647 The array/string length trampolines are owned by the Machine, not the codeblock that compiled them.
3650 (KJS::CTI::privateArrayLengthTrampoline):
3651 (KJS::CTI::privateStringLengthTrampoline):
3653 (KJS::Machine::~Machine):
3656 2008-09-04 Mark Rowe <mrowe@apple.com>
3658 Reviewed by Gavin Barraclough and Sam Weinig.
3660 Fix a crash on launch of jsc when GuardMalloc is enabled.
3663 (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain.
3664 (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref.
3666 2008-09-03 Oliver Hunt <oliver@apple.com>
3668 Reviewed by Gavin Barraclough and Geoff Garen.
3670 Fix inspector and fast array access so that it bounds
3674 (KJS::CTI::privateCompile_pass2_Main):
3675 * masm/IA32MacroAsm.h:
3676 (KJS::IA32MacroAssembler::):
3677 (KJS::IA32MacroAssembler::emitUnlinkedJb):
3678 (KJS::IA32MacroAssembler::emitUnlinkedJbe):
3680 2008-09-03 Mark Rowe <mrowe@apple.com>
3682 Move the assertion after the InitializeAndReturn block, as
3683 that is used even when CTI is enabled.
3686 (KJS::Machine::privateExecute):
3688 2008-09-03 Mark Rowe <mrowe@apple.com>
3690 Reviewed by Sam Weinig.
3692 Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED.
3695 (KJS::CTI::privateCompile_pass1_Scan):
3696 (KJS::CTI::privateCompile_pass2_Main):
3697 (KJS::CTI::privateCompile_pass4_SlowCases):
3699 (KJS::Machine::privateExecute):
3700 (KJS::Machine::cti_vm_throw):
3702 2008-09-03 Mark Rowe <mrowe@apple.com>
3704 Reviewed by Sam Weinig.
3706 Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved
3707 by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86)
3713 (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for
3714 printing a ptrdiff_t.
3718 (KJS::RegExp::RegExp):
3719 (KJS::RegExp::~RegExp):
3720 (KJS::RegExp::match):
3722 * masm/IA32MacroAsm.h:
3725 * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to
3726 track whether any MASM-using features are enabled.
3728 2008-09-03 Gavin Barraclough <barraclough@apple.com>
3730 Reviewed by Oliver Hunt.
3732 Copy Geoff's array/string length optimization for CTI.
3735 (KJS::CTI::privateArrayLengthTrampoline):
3736 (KJS::CTI::privateStringLengthTrampoline):
3738 (KJS::CTI::compileArrayLengthTrampoline):
3739 (KJS::CTI::compileStringLengthTrampoline):
3741 (KJS::Machine::Machine):
3742 (KJS::Machine::getCtiArrayLengthTrampoline):
3743 (KJS::Machine::getCtiStringLengthTrampoline):
3744 (KJS::Machine::tryCtiCacheGetByID):
3745 (KJS::Machine::cti_op_get_by_id_second):
3750 2008-09-03 Gavin Barraclough <barraclough@apple.com>
3752 Reviewed by Oliver Hunt.
3754 Implement fast array accesses in CTI - 2-3% progression on sunspider.
3757 (KJS::CTI::emitFastArithIntToImmNoCheck):
3758 (KJS::CTI::compileOpCall):
3759 (KJS::CTI::privateCompile_pass2_Main):
3760 (KJS::CTI::privateCompile_pass4_SlowCases):
3764 2008-09-02 Gavin Barraclough <barraclough@apple.com>
3766 Reviewed by Oliver Hunt.
3768 Enable fast property access support in CTI.
3771 (KJS::ctiSetReturnAddress):
3772 (KJS::ctiRepatchCallByReturnAddress):
3773 (KJS::CTI::privateCompile_pass2_Main):
3774 (KJS::CTI::privateCompile):
3775 (KJS::CTI::privateCompileGetByIdSelf):
3776 (KJS::CTI::privateCompileGetByIdProto):
3777 (KJS::CTI::privateCompileGetByIdChain):
3778 (KJS::CTI::privateCompilePutByIdReplace):
3780 (KJS::CTI::compileGetByIdSelf):
3781 (KJS::CTI::compileGetByIdProto):
3782 (KJS::CTI::compileGetByIdChain):
3783 (KJS::CTI::compilePutByIdReplace):
3785 (KJS::CodeBlock::~CodeBlock):
3788 (KJS::doSetReturnAddressVmThrowTrampoline):
3789 (KJS::Machine::tryCtiCachePutByID):
3790 (KJS::Machine::tryCtiCacheGetByID):
3791 (KJS::Machine::cti_op_put_by_id):
3792 (KJS::Machine::cti_op_put_by_id_second):
3793 (KJS::Machine::cti_op_put_by_id_generic):
3794 (KJS::Machine::cti_op_put_by_id_fail):
3795 (KJS::Machine::cti_op_get_by_id):
3796 (KJS::Machine::cti_op_get_by_id_second):
3797 (KJS::Machine::cti_op_get_by_id_generic):
3798 (KJS::Machine::cti_op_get_by_id_fail):
3799 (KJS::Machine::cti_op_throw):
3800 (KJS::Machine::cti_vm_throw):
3804 * kjs/PropertyMap.h:
3805 * kjs/StructureID.cpp:
3806 (KJS::StructureIDChain::StructureIDChain):
3807 * masm/IA32MacroAsm.h:
3808 (KJS::IA32MacroAssembler::emitCmpl_i32m):
3809 (KJS::IA32MacroAssembler::emitMovl_mr):
3810 (KJS::IA32MacroAssembler::emitMovl_rm):
3812 2008-09-02 Sam Weinig <sam@webkit.org>
3814 Reviewed by Gavin Barraclough and Mark Rowe.
3816 A backslash (\) at the of a RegEx should produce an error.
3817 Fixes fast/regex/test1.html.
3820 (KJS::WRECompiler::parseEscape):
3822 2008-09-02 Sam Weinig <sam@webkit.org>
3824 Reviewed by Geoff Garen.
3826 Link jumps for the slow case of op_loop_if_less. Fixes acid3.
3829 (KJS::CTI::privateCompile_pass4_SlowCases):
3831 2008-09-01 Sam Weinig <sam@webkit.org>
3833 Rubber-stamped by Maciej Stachowiak.
3835 Switch WREC on by default.
3839 2008-09-01 Sam Weinig <sam@webkit.org>
3841 Reviewed by Mark Rowe.
3843 Fix two failures in fast/regex/test1.html
3844 - \- in a character class should be treated as a literal -
3845 - A missing max quantifier needs to be treated differently than
3846 a null max quantifier.
3849 (KJS::WRECompiler::generateNonGreedyQuantifier):
3850 (KJS::WRECompiler::generateGreedyQuantifier):
3851 (KJS::WRECompiler::parseCharacterClass):
3853 (KJS::Quantifier::Quantifier):
3855 2008-09-01 Sam Weinig <sam@webkit.org>
3857 Reviewed by Mark Rowe.
3859 Fix crash in fast/js/kde/evil-n.html
3861 * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function.
3863 2008-09-01 Sam Weinig <sam@webkit.org>
3865 Reviewed by Gavin Barraclough and Mark Rowe.
3867 Add pattern length limit fixing one test in fast/js.
3870 (KJS::WRECompiler::compile):
3872 (KJS::WRECompiler::):
3874 2008-09-01 Sam Weinig <sam@webkit.org>
3876 Reviewed by Gavin Barraclough and Mark Rowe.
3878 Make octal escape parsing/back-reference parsing more closely match
3879 prior behavior fixing one test in fast/js.
3882 (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped
3883 (KJS::WRECompiler::parseEscape):
3885 (KJS::WRECompiler::peekDigit):
3887 2008-09-01 Sam Weinig <sam@webkit.org>
3889 Reviewed by Gavin Barraclough and Mark Rowe.
3891 Fix one mozilla test.
3894 (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not
3897 2008-09-01 Sam Weinig <sam@webkit.org>
3899 Reviewed by Gavin Barraclough and Mark Rowe.
3901 Parse octal escapes in character classes fixing one mozilla test.
3904 (KJS::WRECompiler::parseCharacterClass):
3905 (KJS::WRECompiler::parseOctalEscape):
3907 (KJS::WRECompiler::consumeOctal):
3909 2008-09-01 Sam Weinig <sam@webkit.org>
3911 Reviewed by Oliver Hunt.
3913 Fixes two mozilla tests with WREC enabled.
3916 (KJS::CharacterClassConstructor::append): Keep the character class sorted
3917 when appending another character class.
3919 2008-09-01 Sam Weinig <sam@webkit.org>
3921 Reviewed by Gavin Barraclough and Mark Rowe.
3923 Fixes two mozilla tests with WREC enabled.
3926 (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position
3927 instead of appending it to the end.
3929 2008-09-01 Gavin Barraclough <barraclough@apple.com>
3931 Reviewed by Oliver Hunt.
3933 Move cross-compilation unit call into NEVER_INLINE function.
3936 (KJS::doSetReturnAddressVmThrowTrampoline):
3938 2008-09-01 Sam Weinig <sam@webkit.org>
3940 Reviewed by Gavin Barraclough and Geoff Garen.
3942 Fix one test in fast/js.
3945 (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError,
3946 instead of a createNotAFunctionError.
3948 2008-08-31 Gavin Barraclough <barraclough@apple.com>
3950 Reviewed by Maciej Stachowiak.
3952 Zero-cost exception handling. This patch takes the exception checking
3953 back of the hot path. When an exception occurs in a Machine::cti*
3954 method, the return address to JIT code is recorded, and is then
3955 overwritten with a pointer to a trampoline routine. When the method
3956 returns the trampoline will cause the cti_vm_throw method to be invoked.
3958 cti_vm_throw uses the return address preserved above, to discover the
3959 vPC of the bytecode that raised the exception (using a map build during
3960 translation). From the VPC of the faulting bytecode the vPC of a catch
3961 routine may be discovered (unwinding the stack where necesary), and then
3962 a bytecode address for the catch routine is looked up. Final cti_vm_throw
3963 overwrites its return address to JIT code again, to trampoline directly
3964 to the catch routine.
3966 cti_op_throw is handled in a similar fashion.
3969 (KJS::CTI::emitPutCTIParam):
3970 (KJS::CTI::emitPutToCallFrameHeader):
3971 (KJS::CTI::emitGetFromCallFrameHeader):
3972 (KJS::ctiSetReturnAddressForArgs):
3973 (KJS::CTI::emitDebugExceptionCheck):
3974 (KJS::CTI::printOpcodeOperandTypes):
3975 (KJS::CTI::emitCall):
3976 (KJS::CTI::compileOpCall):
3977 (KJS::CTI::privateCompile_pass2_Main):
3978 (KJS::CTI::privateCompile):
3980 (KJS::CallRecord::CallRecord):
3982 (KJS::CTI::execute):
3985 (KJS::Machine::privateExecute):
3986 (KJS::Machine::cti_op_instanceof):
3987 (KJS::Machine::cti_op_call_NotJSFunction):
3988 (KJS::Machine::cti_op_resolve):
3989 (KJS::Machine::cti_op_resolve_func):
3990 (KJS::Machine::cti_op_resolve_skip):
3991 (KJS::Machine::cti_op_resolve_with_base):
3992 (KJS::Machine::cti_op_throw):
3993 (KJS::Machine::cti_op_in):
3994 (KJS::Machine::cti_vm_throw):
3995 * VM/RegisterFile.h:
3996 (KJS::RegisterFile::):
3998 (KJS::ExecState::setCtiReturnAddress):
3999 (KJS::ExecState::ctiReturnAddress):
4000 * masm/IA32MacroAsm.h:
4001 (KJS::IA32MacroAssembler::):
4002 (KJS::IA32MacroAssembler::emitPushl_m):
4003 (KJS::IA32MacroAssembler::emitPopl_m):
4004 (KJS::IA32MacroAssembler::getRelocatedAddress):
4006 2008-08-31 Mark Rowe <mrowe@apple.com>
4008 Reviewed by Oliver Hunt.
4010 Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them.
4013 (KJS::WRECompiler::parseParentheses):
4015 (KJS::WRECompiler::):
4017 2008-08-31 Mark Rowe <mrowe@apple.com>
4019 Reviewed by Oliver Hunt.
4021 Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled.
4024 (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum.
4025 (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register.
4026 (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag.
4028 2008-08-30 Mark Rowe <mrowe@apple.com>
4030 Reviewed by Oliver Hunt.
4032 Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance.
4033 This shows up as a 0.6% progression on SunSpider on my machine.
4035 Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out.
4038 (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc.
4039 * kjs/regexp.cpp: Ditto.
4040 * masm/IA32MacroAsm.h:
4041 (KJS::JITCodeBuffer::growBuffer):
4042 (KJS::JITCodeBuffer::JITCodeBuffer):
4043 (KJS::JITCodeBuffer::~JITCodeBuffer):
4044 (KJS::JITCodeBuffer::putByte):
4045 (KJS::JITCodeBuffer::putShort):
4046 (KJS::JITCodeBuffer::putInt):
4047 (KJS::JITCodeBuffer::reset):
4048 (KJS::JITCodeBuffer::copy):
4050 2008-08-29 Oliver Hunt <oliver@apple.com>
4054 Roll out previous patch as it causes a 5% performance regression
4056 * JavaScriptCore.xcodeproj/project.pbxproj:
4059 (KJS::CTI::privateCompile):
4061 (KJS::CodeBlock::~CodeBlock):
4062 * masm/IA32MacroAsm.h:
4063 (KJS::JITCodeBuffer::JITCodeBuffer):
4064 (KJS::JITCodeBuffer::putByte):
4065 (KJS::JITCodeBuffer::putShort):
4066 (KJS::JITCodeBuffer::putInt):
4067 (KJS::JITCodeBuffer::getEIP):
4068 (KJS::JITCodeBuffer::start):
4069 (KJS::JITCodeBuffer::getOffset):
4070 (KJS::JITCodeBuffer::reset):
4071 (KJS::JITCodeBuffer::copy):
4072 (KJS::IA32MacroAssembler::emitModRm_rr):
4073 (KJS::IA32MacroAssembler::emitModRm_rm):
4074 (KJS::IA32MacroAssembler::emitModRm_rmsib):
4075 (KJS::IA32MacroAssembler::IA32MacroAssembler):
4076 (KJS::IA32MacroAssembler::emitInt3):
4077 (KJS::IA32MacroAssembler::emitPushl_r):
4078 (KJS::IA32MacroAssembler::emitPopl_r):
4079 (KJS::IA32MacroAssembler::emitMovl_rr):
4080 (KJS::IA32MacroAssembler::emitAddl_rr):
4081 (KJS::IA32MacroAssembler::emitAddl_i8r):
4082 (KJS::IA32MacroAssembler::emitAddl_i32r):
4083 (KJS::IA32MacroAssembler::emitAddl_mr):
4084 (KJS::IA32MacroAssembler::emitAndl_rr):
4085 (KJS::IA32MacroAssembler::emitAndl_i32r):
4086 (KJS::IA32MacroAssembler::emitCmpl_i8r):
4087 (KJS::IA32MacroAssembler::emitCmpl_rr):
4088 (KJS::IA32MacroAssembler::emitCmpl_rm):
4089 (KJS::IA32MacroAssembler::emitCmpl_i32r):
4090 (KJS::IA32MacroAssembler::emitCmpl_i32m):
4091 (KJS::IA32MacroAssembler::emitCmpw_rm):
4092 (KJS::IA32MacroAssembler::emitOrl_rr):
4093 (KJS::IA32MacroAssembler::emitOrl_i8r):
4094 (KJS::IA32MacroAssembler::emitSubl_rr):
4095 (KJS::IA32MacroAssembler::emitSubl_i8r):
4096 (KJS::IA32MacroAssembler::emitSubl_i32r):
4097 (KJS::IA32MacroAssembler::emitSubl_mr):
4098 (KJS::IA32MacroAssembler::emitTestl_i32r):
4099 (KJS::IA32MacroAssembler::emitTestl_rr):
4100 (KJS::IA32MacroAssembler::emitXorl_i8r):
4101 (KJS::IA32MacroAssembler::emitXorl_rr):
4102 (KJS::IA32MacroAssembler::emitSarl_i8r):
4103 (KJS::IA32MacroAssembler::emitSarl_CLr):
4104 (KJS::IA32MacroAssembler::emitShl_i8r):
4105 (KJS::IA32MacroAssembler::emitShll_CLr):
4106 (KJS::IA32MacroAssembler::emitMull_rr):
4107 (KJS::IA32MacroAssembler::emitIdivl_r):
4108 (KJS::IA32MacroAssembler::emitCdq):
4109 (KJS::IA32MacroAssembler::emitMovl_mr):
4110 (KJS::IA32MacroAssembler::emitMovzwl_mr):
4111 (KJS::IA32MacroAssembler::emitMovl_rm):
4112 (KJS::IA32MacroAssembler::emitMovl_i32r):
4113 (KJS::IA32MacroAssembler::emitMovl_i32m):
4114 (KJS::IA32MacroAssembler::emitLeal_mr):
4115 (KJS::IA32MacroAssembler::emitRet):
4116 (KJS::IA32MacroAssembler::emitJmpN_r):
4117 (KJS::IA32MacroAssembler::emitJmpN_m):
4118 (KJS::IA32MacroAssembler::emitCall):
4119 (KJS::IA32MacroAssembler::label):
4120 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
4121 (KJS::IA32MacroAssembler::emitUnlinkedJne):
4122 (KJS::IA32MacroAssembler::emitUnlinkedJe):
4123 (KJS::IA32MacroAssembler::emitUnlinkedJl):
4124 (KJS::IA32MacroAssembler::emitUnlinkedJle):
4125 (KJS::IA32MacroAssembler::emitUnlinkedJge):
4126 (KJS::IA32MacroAssembler::emitUnlinkedJae):
4127 (KJS::IA32MacroAssembler::emitUnlinkedJo):
4128 (KJS::IA32MacroAssembler::link):
4130 (KJS::WRECompiler::compilePattern):
4131 (KJS::WRECompiler::compile):
4134 2008-08-29 Mark Rowe <mrowe@apple.com>
4136 Reviewed by Oliver Hunt.
4138 Have JITCodeBuffer manage a Vector containing the generated code so that it can grow
4139 as needed when generating code for a large function. This fixes all six remaining failures
4140 in Mozilla tests in both debug and release builds.
4143 (KJS::CTI::privateCompile):
4145 (KJS::CodeBlock::~CodeBlock):
4146 * masm/IA32MacroAsm.h:
4147 (KJS::JITCodeBuffer::putByte):
4148 (KJS::JITCodeBuffer::putShort):
4149 (KJS::JITCodeBuffer::putInt):
4150 (KJS::JITCodeBuffer::getEIP):
4151 (KJS::JITCodeBuffer::start):
4152 (KJS::JITCodeBuffer::getOffset):
4153 (KJS::JITCodeBuffer::getCode):
4154 (KJS::IA32MacroAssembler::emitModRm_rr):
4156 (KJS::WRECompiler::compilePattern):
4159 2008-08-29 Mark Rowe <mrowe@apple.com>
4161 Reviewed by Oliver Hunt.
4163 Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests.
4166 (KJS::WRECompiler::parseOctalEscape):
4167 (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero.
4168 Add a FIXME about treating invalid backreferences as octal escapes in the future.
4170 (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than
4173 (WTF::isASCIIOctalDigit):
4175 2008-08-29 Sam Weinig <sam@webkit.org>
4177 Reviewed by Mark Rowe.
4179 Pass vPC to instanceof method. Fixes 2 mozilla tests in debug.
4182 (KJS::CTI::privateCompile_pass2_Main):
4184 (KJS::Machine::cti_op_instanceof):
4186 2008-08-29 Sam Weinig <sam@webkit.org>
4188 Reviewed by Mark Rowe.
4190 Pass vPCs to resolve methods for correct exception creation. Fixes
4191 17 mozilla tests in debug.
4194 (KJS::CTI::privateCompile_pass2_Main):
4197 (KJS::Machine::cti_op_resolve):
4198 (KJS::Machine::cti_op_resolve_func):
4199 (KJS::Machine::cti_op_resolve_skip):
4200 (KJS::Machine::cti_op_resolve_with_base):
4202 2008-08-29 Gavin Barraclough <barraclough@apple.com>
4204 Reviewed by Oliver Hunt.
4206 Remembering to actually throw the exception passed to op throw helps.
4207 Regressions 19 -> 6.
4210 (KJS::Machine::cti_op_throw):
4211 (KJS::Machine::cti_vm_throw):
4213 2008-08-29 Gavin Barraclough <barraclough@apple.com>
4215 Reviewed by Sam Weinig.
4217 Support for exception unwinding the stack.
4219 Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address
4220 is now preserved on entry to a JIT code function (if we preserve lazily we need
4221 restore the native return address during exception stack unwind). This takes
4222 the number of regressions down from ~150 to 19.
4226 (KJS::CTI::emitExceptionCheck):
4227 (KJS::CTI::compileOpCall):
4228 (KJS::CTI::privateCompile_pass2_Main):
4229 (KJS::CTI::privateCompile):
4233 (KJS::Machine::throwException):
4234 (KJS::Machine::cti_op_call_JSFunction):
4235 (KJS::Machine::cti_op_call_NotJSFunction):
4236 (KJS::Machine::cti_op_construct_JSConstruct):
4237 (KJS::Machine::cti_op_construct_NotJSConstruct):
4238 (KJS::Machine::cti_op_throw):
4239 (KJS::Machine::cti_vm_throw):
4241 2008-08-29 Mark Rowe <mrowe@apple.com>
4243 Reviewed by Oliver Hunt.
4245 Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled.
4248 (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches
4249 succeeded, jump to failure.
4250 (KJS::WRECompiler::compilePattern): Restore and increment the current position stored
4251 on the stack to ensure that it will be reset to the correct position after a failed
4252 match has consumed input.
4254 2008-08-29 Mark Rowe <mrowe@apple.com>
4256 Reviewed by Oliver Hunt.
4258 Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled.
4259 A backreference with a quantifier would get stuck in an infinite
4260 loop if the captured range was empty.
4263 (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range
4264 was empty, do not attempt to match the backreference.
4265 (KJS::WRECompiler::parseBackreferenceQuantifier):
4267 (KJS::Quantifier::):
4269 2008-08-28 Sam Weinig <sam@webkit.org>
4271 Reviewed by Oliver Hunt.
4276 (KJS::CTI::privateCompile_pass1_Scan):
4277 (KJS::CTI::privateCompile_pass2_Main):
4279 (KJS::Machine::debug):
4280 (KJS::Machine::privateExecute):
4281 (KJS::Machine::cti_op_debug):
4284 2008-08-28 Sam Weinig <sam@webkit.org>
4286 Reviewed by Gavin Barraclough and Geoff Garen.
4288 Implement op_switch_string fixing 1 mozilla test and one test in fast/js.
4291 (KJS::CTI::privateCompile_pass1_Scan):
4292 (KJS::CTI::privateCompile_pass2_Main):
4293 (KJS::CTI::privateCompile):
4295 (KJS::SwitchRecord::):
4296 (KJS::SwitchRecord::SwitchRecord):
4298 (KJS::CodeBlock::dump):
4300 (KJS::ExpressionRangeInfo::):
4301 (KJS::StringJumpTable::offsetForValue):
4302 (KJS::StringJumpTable::ctiForValue):
4303 (KJS::SimpleJumpTable::add):
4304 (KJS::SimpleJumpTable::ctiForValue):
4305 * VM/CodeGenerator.cpp:
4306 (KJS::prepareJumpTableForStringSwitch):
4308 (KJS::Machine::privateExecute):
4309 (KJS::Machine::cti_op_switch_string):
4312 2008-08-28 Gavin Barraclough <barraclough@apple.com>
4314 Reviewed by Oliver Hunt.
4316 Do not recurse on the machine stack when executing op_call.
4319 (KJS::CTI::emitGetPutArg):
4320 (KJS::CTI::emitPutArg):
4321 (KJS::CTI::emitPutArgConstant):
4322 (KJS::CTI::compileOpCall):
4323 (KJS::CTI::privateCompile_pass2_Main):
4324 (KJS::CTI::privateCompile):