1 2008-09-15 Gavin Barraclough <barraclough@apple.com>
3 Reviewed by Geoff Garen.
5 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
6 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
7 masquerading may be handled differently (through the StructureIDs - see bug
13 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
14 (JSC::CTI::privateCompileMainPass):
15 (JSC::CTI::privateCompileSlowCases):
18 (JSC::Machine::Machine):
19 (JSC::Machine::cti_op_eq_null):
20 (JSC::Machine::cti_op_neq_null):
22 (JSC::Machine::doesMasqueradesAsUndefined):
23 * kjs/JSWrapperObject.h:
24 (JSC::JSWrapperObject::):
25 (JSC::JSWrapperObject::JSWrapperObject):
27 (JSC::StringObject::StringObject):
28 * kjs/StringObjectThatMasqueradesAsUndefined.h:
29 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
31 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
33 Rubber-stamped by Oliver Hunt.
35 r36427 broke CodeBlock::dump() by changing the number of arguments to
36 op_construct without changing the code that prints it. This patch fixes
37 it by printing the additional argument.
39 * JavaScriptCore.xcodeproj/project.pbxproj:
41 (JSC::CodeBlock::dump):
43 2008-09-15 Adam Roben <aroben@apple.com>
47 * kjs/StructureID.cpp: Removed a stray semicolon.
49 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
51 Reviewed by Maciej Stachowiak.
53 Fix a crash in fast/js/exception-expression-offset.html caused by not
54 updating all mentions of the length of op_construct in r36427.
57 (JSC::Machine::cti_op_construct_NotJSConstruct):
59 2008-09-15 Maciej Stachowiak <mjs@apple.com>
61 Reviewed by Cameron Zwarich.
63 - fix layout test failure introduced by fix for 20849
65 (The failing test was fast/js/delete-then-put.html)
68 (JSC::JSObject::removeDirect): Clear enumeration cache
69 in the dictionary case.
71 (JSC::JSObject::putDirect): Ditto.
73 (JSC::StructureID::clearEnumerationCache): Inline to handle the
76 2008-09-15 Maciej Stachowiak <mjs@apple.com>
78 Reviewed by Cameron Zwarich.
80 - fix JSC test failures introduced by fix for 20849
82 * kjs/PropertyMap.cpp:
83 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
85 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
87 Reviewed by Maciej Stachowiak.
89 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
90 <https://bugs.webkit.org/show_bug.cgi?id=20851>
92 r36410 introduced an optimization for parseInt() that is incorrect when
93 its argument is larger than the range of a 32-bit integer. If the
94 argument is a number that is not an immediate integer, then the correct
95 behaviour is to return the floor of its value, unless it is an infinite
96 value, in which case the correct behaviour is to return 0.
98 * kjs/JSGlobalObjectFunctions.cpp:
99 (JSC::globalFuncParseInt):
101 2008-09-15 Sam Weinig <sam@webkit.org>
103 Reviewed by Maciej Stachowiak.
105 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
106 Cache property names for getEnumerablePropertyNames in the StructureID.
108 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
109 on the v8 test suite.
112 (JSC::JSObject::getPropertyNames):
113 * kjs/PropertyMap.cpp:
114 (JSC::PropertyMap::getEnumerablePropertyNames):
116 * kjs/StructureID.cpp:
117 (JSC::StructureID::StructureID):
118 (JSC::StructureID::getEnumerablePropertyNames):
121 2008-09-14 Maciej Stachowiak <mjs@apple.com>
123 Reviewed by Cameron Zwarich.
125 - speed up JS construction by extracting "prototype" lookup so PIC applies.
127 ~0.5% speedup on SunSpider
128 Speeds up some of the V8 tests as well, most notably earley-boyer.
131 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
132 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
133 * VM/CodeGenerator.cpp:
134 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
136 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
137 (JSC::Machine::cti_op_construct_JSConstruct): ditto
138 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
140 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
142 Reviewed by Eric Seidel.
144 Add a protected destructor for RefCounted.
146 It is wrong to call its destructor directly, because (1) this should be taken care of by
147 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
149 No change in behavior.
151 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
153 2008-09-14 Gavin Barraclough <barraclough@apple.com>
155 Reviewed by Sam Weinig.
157 Accelerated property accesses.
159 Inline more of the array access code into the JIT code for get/put_by_val.
160 Accelerate get/put_by_id by speculatively inlining a disable direct access
161 into the hot path of the code, and repatch this with the correct StructureID
162 and property map offset once these are known. In the case of accesses to the
163 prototype and reading the array-length a trampoline is genertaed, and the
164 branch to the slow-case is relinked to jump to this.
166 By repatching, we mean rewriting the x86 instruction stream. Instructions are
167 only modified in a simple fasion - altering immediate operands, memory access
168 deisplacements, and branch offsets.
170 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
171 instruction's immediate operant is updateded, and a memory access operation's
172 displacement is updated to access the correct field on the object. In the case
173 of more complex accesses (array length and get_by_id_prototype) the offset on
174 the branch to slow-case is updated, to now jump to a trampoline.
176 +2.8% sunspider, +13% v8-tests
179 (JSC::CTI::emitCall):
180 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
182 (JSC::CTI::privateCompileMainPass):
183 (JSC::CTI::privateCompileSlowCases):
184 (JSC::CTI::privateCompile):
185 (JSC::CTI::privateCompileGetByIdSelf):
186 (JSC::CTI::privateCompileGetByIdProto):
187 (JSC::CTI::privateCompileGetByIdChain):
188 (JSC::CTI::privateCompilePutByIdReplace):
189 (JSC::CTI::privateCompilePutByIdTransition):
190 (JSC::CTI::privateCompileArrayLengthTrampoline):
191 (JSC::CTI::privateCompileStringLengthTrampoline):
192 (JSC::CTI::patchGetByIdSelf):
193 (JSC::CTI::patchPutByIdReplace):
194 (JSC::CTI::privateCompilePatchGetArrayLength):
195 (JSC::CTI::privateCompilePatchGetStringLength):
197 (JSC::CTI::compileGetByIdSelf):
198 (JSC::CTI::compileGetByIdProto):
199 (JSC::CTI::compileGetByIdChain):
200 (JSC::CTI::compilePutByIdReplace):
201 (JSC::CTI::compilePutByIdTransition):
202 (JSC::CTI::compileArrayLengthTrampoline):
203 (JSC::CTI::compileStringLengthTrampoline):
204 (JSC::CTI::compilePatchGetArrayLength):
205 (JSC::CTI::compilePatchGetStringLength):
207 (JSC::CodeBlock::dump):
208 (JSC::CodeBlock::~CodeBlock):
210 (JSC::StructureStubInfo::StructureStubInfo):
211 (JSC::CodeBlock::getStubInfo):
213 (JSC::Machine::tryCTICachePutByID):
214 (JSC::Machine::tryCTICacheGetByID):
215 (JSC::Machine::cti_op_put_by_val_array):
217 * masm/X86Assembler.h:
218 (JSC::X86Assembler::):
219 (JSC::X86Assembler::cmpl_i8m):
220 (JSC::X86Assembler::emitUnlinkedJa):
221 (JSC::X86Assembler::getRelocatedAddress):
222 (JSC::X86Assembler::getDifferenceBetweenLabels):
223 (JSC::X86Assembler::emitModRm_opmsib):
225 2008-09-14 Maciej Stachowiak <mjs@apple.com>
227 Reviewed by Cameron Zwarich.
229 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
231 ~5% speedup on v8 earley-boyer test
233 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
234 * API/JSCallbackObjectFunctions.h:
235 (JSC::::hasInstance): Ditto.
236 * API/JSValueRef.cpp:
237 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
238 * JavaScriptCore.exp:
240 (JSC::CTI::privateCompileMainPass): Pass along prototype.
242 (JSC::CodeBlock::dump): Print third arg.
243 * VM/CodeGenerator.cpp:
244 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
246 * VM/CodeGenerator.h:
248 (JSC::Machine::privateExecute): Pass along the prototype.
249 (JSC::Machine::cti_op_instanceof): ditto
251 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
254 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
255 property and pass that register to instanceof.
258 2008-09-14 Gavin Barraclough <barraclough@apple.com>
260 Reviewed by Sam Weinig.
262 Remove unnecessary virtual function call from cti_op_call_JSFunction -
263 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
266 (JSC::Machine::cti_op_call_JSFunction):
268 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
270 Reviewed by Maciej Stachowiak.
272 Bug 20827: the 'typeof' operator is slow
273 <https://bugs.webkit.org/show_bug.cgi?id=20827>
275 Optimize the 'typeof' operator when its result is compared to a constant
278 This is a 5.5% speedup on the V8 Earley-Boyer test.
281 (JSC::CTI::privateCompileMainPass):
283 (JSC::CodeBlock::dump):
284 * VM/CodeGenerator.cpp:
285 (JSC::CodeGenerator::emitEqualityOp):
286 * VM/CodeGenerator.h:
288 (JSC::jsIsObjectType):
289 (JSC::jsIsFunctionType):
290 (JSC::Machine::privateExecute):
291 (JSC::Machine::cti_op_is_undefined):
292 (JSC::Machine::cti_op_is_boolean):
293 (JSC::Machine::cti_op_is_number):
294 (JSC::Machine::cti_op_is_string):
295 (JSC::Machine::cti_op_is_object):
296 (JSC::Machine::cti_op_is_function):
300 (JSC::BinaryOpNode::emitCode):
301 (JSC::EqualNode::emitCode):
302 (JSC::StrictEqualNode::emitCode):
305 2008-09-14 Sam Weinig <sam@webkit.org>
307 Reviewed by Cameron Zwarich.
309 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
310 Speed up parseInt for numbers
312 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
313 No change on the v8 suite.
315 * kjs/JSGlobalObjectFunctions.cpp:
316 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
317 convert them back to numbers.
319 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
321 Reviewed by Oliver Hunt.
323 Bug 20816: op_lesseq should be optimized
324 <https://bugs.webkit.org/show_bug.cgi?id=20816>
326 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
328 This is a 9.4% speedup on the V8 Crypto benchmark.
331 (JSC::CTI::privateCompileMainPass):
332 (JSC::CTI::privateCompileSlowCases):
334 (JSC::CodeBlock::dump):
335 * VM/CodeGenerator.cpp:
336 (JSC::CodeGenerator::emitJumpIfTrue):
338 (JSC::Machine::privateExecute):
339 (JSC::Machine::cti_op_loop_if_lesseq):
343 2008-09-14 Sam Weinig <sam@webkit.org>
345 Reviewed by Cameron Zwarich.
347 Cleanup Sampling code.
350 (JSC::CTI::emitCall):
351 (JSC::CTI::privateCompileMainPass):
354 * VM/SamplingTool.cpp:
356 (JSC::SamplingTool::run):
357 (JSC::SamplingTool::dump):
359 (JSC::SamplingTool::callingHostFunction):
361 2008-09-13 Oliver Hunt <oliver@apple.com>
363 Reviewed by Cameron Zwarich.
365 Bug 20821: Cache property transitions to speed up object initialization
366 https://bugs.webkit.org/show_bug.cgi?id=20821
368 Implement a transition cache to improve the performance of new properties
369 being added to objects. This is extremely beneficial in constructors and
370 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
374 (JSC::CTI::privateCompileMainPass):
376 (JSC::transitionWillNeedStorageRealloc):
377 (JSC::CTI::privateCompilePutByIdTransition):
379 (JSC::CTI::compilePutByIdTransition):
381 (JSC::printPutByIdOp):
382 (JSC::CodeBlock::printStructureIDs):
383 (JSC::CodeBlock::dump):
384 (JSC::CodeBlock::derefStructureIDs):
385 (JSC::CodeBlock::refStructureIDs):
386 * VM/CodeGenerator.cpp:
387 (JSC::CodeGenerator::emitPutById):
389 (JSC::cachePrototypeChain):
390 (JSC::Machine::tryCachePutByID):
391 (JSC::Machine::tryCacheGetByID):
392 (JSC::Machine::privateExecute):
393 (JSC::Machine::tryCTICachePutByID):
394 (JSC::Machine::tryCTICacheGetByID):
398 (JSC::JSObject::putDirect):
399 (JSC::JSObject::transitionTo):
400 * kjs/PutPropertySlot.h:
401 (JSC::PutPropertySlot::PutPropertySlot):
402 (JSC::PutPropertySlot::wasTransition):
403 (JSC::PutPropertySlot::setWasTransition):
404 * kjs/StructureID.cpp:
405 (JSC::StructureID::transitionTo):
406 (JSC::StructureIDChain::StructureIDChain):
408 (JSC::StructureID::previousID):
409 (JSC::StructureID::setCachedPrototypeChain):
410 (JSC::StructureID::cachedPrototypeChain):
411 (JSC::StructureID::propertyMap):
412 * masm/X86Assembler.h:
413 (JSC::X86Assembler::addl_i8m):
414 (JSC::X86Assembler::subl_i8m):
416 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
418 Reviewed by Maciej Stachowiak.
420 Bug 20819: JSValue::isObject() is slow
421 <https://bugs.webkit.org/show_bug.cgi?id=20819>
423 Optimize JSCell::isObject() and JSCell::isString() by making them
424 non-virtual calls that rely on the StructureID type information.
426 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
429 * JavaScriptCore.exp:
432 (JSC::JSCell::isObject):
433 (JSC::JSCell::isString):
438 (JSC::JSString::JSString):
440 (JSC::StructureID::type):
442 2008-09-11 Stephanie Lewis <slewis@apple.com>
444 Reviewed by Oliver Hunt.
446 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
447 crash on CNN and on Dromaeo.
448 Fix Missing close tag in vcproj.
450 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
452 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
456 Correct an SVN problem with the last commit and actually add the new
459 * wrec/CharacterClassConstructor.cpp: Added.
461 (JSC::getCharacterClassNewline):
462 (JSC::getCharacterClassDigits):
463 (JSC::getCharacterClassSpaces):
464 (JSC::getCharacterClassWordchar):
465 (JSC::getCharacterClassNondigits):
466 (JSC::getCharacterClassNonspaces):
467 (JSC::getCharacterClassNonwordchar):
468 (JSC::CharacterClassConstructor::addSorted):
469 (JSC::CharacterClassConstructor::addSortedRange):
470 (JSC::CharacterClassConstructor::put):
471 (JSC::CharacterClassConstructor::flush):
472 (JSC::CharacterClassConstructor::append):
473 * wrec/CharacterClassConstructor.h: Added.
474 (JSC::CharacterClassConstructor::CharacterClassConstructor):
475 (JSC::CharacterClassConstructor::isUpsideDown):
476 (JSC::CharacterClassConstructor::charClass):
478 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
480 Reviewed by Maciej Stachowiak.
482 Bug 20788: Split CharacterClassConstructor into its own file
483 <https://bugs.webkit.org/show_bug.cgi?id=20788>
485 Split CharacterClassConstructor into its own file and clean up some
488 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
489 * JavaScriptCore.xcodeproj/project.pbxproj:
490 * wrec/CharacterClassConstructor.cpp: Added.
492 (JSC::getCharacterClassNewline):
493 (JSC::getCharacterClassDigits):
494 (JSC::getCharacterClassSpaces):
495 (JSC::getCharacterClassWordchar):
496 (JSC::getCharacterClassNondigits):
497 (JSC::getCharacterClassNonspaces):
498 (JSC::getCharacterClassNonwordchar):
499 (JSC::CharacterClassConstructor::addSorted):
500 (JSC::CharacterClassConstructor::addSortedRange):
501 (JSC::CharacterClassConstructor::put):
502 (JSC::CharacterClassConstructor::flush):
503 (JSC::CharacterClassConstructor::append):
504 * wrec/CharacterClassConstructor.h: Added.
505 (JSC::CharacterClassConstructor::CharacterClassConstructor):
506 (JSC::CharacterClassConstructor::isUpsideDown):
507 (JSC::CharacterClassConstructor::charClass):
509 (JSC::WRECParser::parseCharacterClass):
511 2008-09-10 Simon Hausmann <hausmann@webkit.org>
513 Not reviewed but trivial one-liner for yet unused macro.
515 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
517 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
521 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
523 Rubber-stamped by Oliver Hunt.
525 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
529 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
530 * masm/X86Assembler.h:
531 (JSC::X86Assembler::orl_i32r):
533 (JSC::WRECGenerator::generatePatternCharacter):
534 (JSC::WRECGenerator::generateCharacterClassInverted):
536 2008-09-10 Sam Weinig <sam@webkit.org>
538 Reviewed by Geoff Garen.
540 Add inline property storage for JSObject.
542 1.2% progression on Sunspider. .5% progression on the v8 test suite.
544 * JavaScriptCore.exp:
546 (JSC::CTI::privateCompileGetByIdProto):
547 (JSC::CTI::privateCompileGetByIdChain):
549 (JSC::JSObject::mark): There is no reason to check storageSize now that
551 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
553 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
554 now so there is no reason to .get()
555 (JSC::JSObject::usingInlineStorage):
556 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
558 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
560 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
561 we know that we are about to add a property that will overflow the inline
563 * kjs/PropertyMap.cpp:
564 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
565 now handled by JSObject.
566 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
568 (JSC::PropertyMap::storageSize): Rename from markingCount.
569 * kjs/StructureID.cpp:
570 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
571 if we are using inline storage.
574 2008-09-10 Oliver Hunt <oliver@apple.com>
576 Reviewed by Geoff Garen.
578 Inline immediate number version of op_mul.
580 Renamed mull_rr to imull_rr as that's what it's
581 actually doing, and added imull_i32r for the constant
582 case immediate multiply.
584 1.1% improvement to SunSpider.
587 (JSC::CTI::privateCompileMainPass):
588 (JSC::CTI::privateCompileSlowCases):
589 * masm/X86Assembler.h:
590 (JSC::X86Assembler::):
591 (JSC::X86Assembler::imull_rr):
592 (JSC::X86Assembler::imull_i32r):
594 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
600 * JavaScriptCore.xcodeproj/project.pbxproj:
602 2008-09-09 Oliver Hunt <oliver@apple.com>
604 Reviewed by Maciej Stachowiak.
606 Add optimised access to known properties on the global object.
608 Improve cross scope access to the global object by emitting
609 code to access it directly rather than by walking the scope chain.
611 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
614 (JSC::CTI::privateCompileMainPass):
615 (JSC::CTI::emitGetVariableObjectRegister):
616 (JSC::CTI::emitPutVariableObjectRegister):
619 (JSC::CodeBlock::dump):
620 * VM/CodeGenerator.cpp:
621 (JSC::CodeGenerator::findScopedProperty):
622 (JSC::CodeGenerator::emitResolve):
623 (JSC::CodeGenerator::emitGetScopedVar):
624 (JSC::CodeGenerator::emitPutScopedVar):
625 * VM/CodeGenerator.h:
627 (JSC::Machine::privateExecute):
630 (JSC::FunctionCallResolveNode::emitCode):
631 (JSC::PostfixResolveNode::emitCode):
632 (JSC::PrefixResolveNode::emitCode):
633 (JSC::ReadModifyResolveNode::emitCode):
634 (JSC::AssignResolveNode::emitCode):
636 2008-09-10 Maciej Stachowiak <mjs@apple.com>
640 - enable polymorphic inline caching of properties of primitives
642 1.012x speedup on SunSpider.
644 We create special structure IDs for JSString and
645 JSNumberCell. Unlike normal structure IDs, these cannot hold the
646 true prototype. Due to JS autoboxing semantics, the prototype used
647 when looking up string or number properties depends on the lexical
648 global object of the call site, not the creation site. Thus we
649 enable StructureIDs to handle this quirk for primitives.
651 Everything else should be straightforward.
654 (JSC::CTI::privateCompileGetByIdProto):
655 (JSC::CTI::privateCompileGetByIdChain):
657 (JSC::CTI::compileGetByIdProto):
658 (JSC::CTI::compileGetByIdChain):
659 * VM/JSPropertyNameIterator.h:
660 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
662 (JSC::Machine::Machine):
663 (JSC::cachePrototypeChain):
664 (JSC::Machine::tryCachePutByID):
665 (JSC::Machine::tryCacheGetByID):
666 (JSC::Machine::privateExecute):
667 (JSC::Machine::tryCTICachePutByID):
668 (JSC::Machine::tryCTICacheGetByID):
669 * kjs/GetterSetter.h:
670 (JSC::GetterSetter::GetterSetter):
672 * kjs/JSGlobalData.cpp:
673 (JSC::JSGlobalData::JSGlobalData):
674 * kjs/JSGlobalData.h:
675 * kjs/JSGlobalObject.h:
676 (JSC::StructureID::prototypeForLookup):
677 * kjs/JSNumberCell.h:
678 (JSC::JSNumberCell::JSNumberCell):
681 (JSC::JSObject::prototype):
685 (JSC::jsOwnedString):
687 (JSC::JSString::JSString):
689 (JSC::jsSingleCharacterString):
690 (JSC::jsSingleCharacterSubstring):
691 (JSC::jsNontrivialString):
692 * kjs/SmallStrings.cpp:
693 (JSC::SmallStrings::createEmptyString):
694 (JSC::SmallStrings::createSingleCharacterString):
695 * kjs/StructureID.cpp:
696 (JSC::StructureID::StructureID):
697 (JSC::StructureID::addPropertyTransition):
698 (JSC::StructureID::getterSetterTransition):
699 (JSC::StructureIDChain::StructureIDChain):
701 (JSC::StructureID::create):
702 (JSC::StructureID::storedPrototype):
704 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
706 Reviewed by Sam Weinig.
708 https://bugs.webkit.org/show_bug.cgi?id=20746
710 Added WINCE platform macro.
714 2008-09-09 Sam Weinig <sam@webkit.org>
716 Reviewed by Mark Rowe.
718 Remove unnecessary override of getOffset.
720 Sunspider reports this as a .6% progression.
722 * JavaScriptCore.exp:
724 (JSC::JSObject::getDirectLocation):
725 (JSC::JSObject::getOwnPropertySlotForWrite):
726 (JSC::JSObject::putDirect):
727 * kjs/PropertyMap.cpp:
730 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
732 Reviewed by Maciej Stachowiak.
734 Bug 20759: Remove MacroAssembler
735 <https://bugs.webkit.org/show_bug.cgi?id=20759>
737 Remove MacroAssembler and move its functionality to X86Assembler.
739 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
740 * JavaScriptCore.xcodeproj/project.pbxproj:
742 (JSC::CTI::emitGetArg):
743 (JSC::CTI::emitGetPutArg):
744 (JSC::CTI::emitPutArg):
745 (JSC::CTI::emitPutCTIParam):
746 (JSC::CTI::emitGetCTIParam):
747 (JSC::CTI::emitPutToCallFrameHeader):
748 (JSC::CTI::emitGetFromCallFrameHeader):
749 (JSC::CTI::emitPutResult):
750 (JSC::CTI::emitDebugExceptionCheck):
751 (JSC::CTI::emitJumpSlowCaseIfNotImm):
752 (JSC::CTI::emitJumpSlowCaseIfNotImms):
753 (JSC::CTI::emitFastArithDeTagImmediate):
754 (JSC::CTI::emitFastArithReTagImmediate):
755 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
756 (JSC::CTI::emitFastArithImmToInt):
757 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
758 (JSC::CTI::emitFastArithIntToImmNoCheck):
759 (JSC::CTI::compileOpCall):
760 (JSC::CTI::emitSlowScriptCheck):
761 (JSC::CTI::privateCompileMainPass):
762 (JSC::CTI::privateCompileSlowCases):
763 (JSC::CTI::privateCompile):
764 (JSC::CTI::privateCompileGetByIdSelf):
765 (JSC::CTI::privateCompileGetByIdProto):
766 (JSC::CTI::privateCompileGetByIdChain):
767 (JSC::CTI::privateCompilePutByIdReplace):
768 (JSC::CTI::privateArrayLengthTrampoline):
769 (JSC::CTI::privateStringLengthTrampoline):
770 (JSC::CTI::compileRegExp):
772 (JSC::CallRecord::CallRecord):
773 (JSC::JmpTable::JmpTable):
774 (JSC::SlowCaseEntry::SlowCaseEntry):
775 (JSC::CTI::JSRInfo::JSRInfo):
776 * masm/MacroAssembler.h: Removed.
777 * masm/MacroAssemblerWin.cpp: Removed.
778 * masm/X86Assembler.h:
779 (JSC::X86Assembler::emitConvertToFastCall):
780 (JSC::X86Assembler::emitRestoreArgumentReference):
782 (JSC::WRECGenerator::WRECGenerator):
783 (JSC::WRECParser::WRECParser):
785 2008-09-09 Sam Weinig <sam@webkit.org>
787 Reviewed by Cameron Zwarich.
789 Don't waste the first item in the PropertyStorage.
791 - Fix typo (makingCount -> markingCount)
792 - Remove undefined method declaration.
794 No change on Sunspider.
797 (JSC::JSObject::mark):
798 * kjs/PropertyMap.cpp:
799 (JSC::PropertyMap::put):
800 (JSC::PropertyMap::remove):
801 (JSC::PropertyMap::getOffset):
802 (JSC::PropertyMap::insert):
803 (JSC::PropertyMap::rehash):
804 (JSC::PropertyMap::resizePropertyStorage):
805 (JSC::PropertyMap::checkConsistency):
807 (JSC::PropertyMap::markingCount): Fix typo.
809 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
813 Speculative Windows build fix.
815 * masm/MacroAssemblerWin.cpp:
816 (JSC::MacroAssembler::emitConvertToFastCall):
817 (JSC::MacroAssembler::emitRestoreArgumentReference):
819 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
821 Reviewed by Maciej Stachowiak.
823 Bug 20755: Create an X86 namespace for register names and other things
824 <https://bugs.webkit.org/show_bug.cgi?id=20755>
826 Create an X86 namespace to put X86 register names. Perhaps I will move
827 opcode names here later as well.
830 (JSC::CTI::emitGetArg):
831 (JSC::CTI::emitGetPutArg):
832 (JSC::CTI::emitPutArg):
833 (JSC::CTI::emitPutArgConstant):
834 (JSC::CTI::emitPutCTIParam):
835 (JSC::CTI::emitGetCTIParam):
836 (JSC::CTI::emitPutToCallFrameHeader):
837 (JSC::CTI::emitGetFromCallFrameHeader):
838 (JSC::CTI::emitPutResult):
839 (JSC::CTI::emitDebugExceptionCheck):
840 (JSC::CTI::emitJumpSlowCaseIfNotImms):
841 (JSC::CTI::compileOpCall):
842 (JSC::CTI::emitSlowScriptCheck):
843 (JSC::CTI::privateCompileMainPass):
844 (JSC::CTI::privateCompileSlowCases):
845 (JSC::CTI::privateCompile):
846 (JSC::CTI::privateCompileGetByIdSelf):
847 (JSC::CTI::privateCompileGetByIdProto):
848 (JSC::CTI::privateCompileGetByIdChain):
849 (JSC::CTI::privateCompilePutByIdReplace):
850 (JSC::CTI::privateArrayLengthTrampoline):
851 (JSC::CTI::privateStringLengthTrampoline):
852 (JSC::CTI::compileRegExp):
854 * masm/X86Assembler.h:
856 (JSC::X86Assembler::emitModRm_rm):
857 (JSC::X86Assembler::emitModRm_rm_Unchecked):
858 (JSC::X86Assembler::emitModRm_rmsib):
860 (JSC::WRECGenerator::generateNonGreedyQuantifier):
861 (JSC::WRECGenerator::generateGreedyQuantifier):
862 (JSC::WRECGenerator::generateParentheses):
863 (JSC::WRECGenerator::generateBackreference):
864 (JSC::WRECGenerator::gernerateDisjunction):
867 2008-09-09 Sam Weinig <sam@webkit.org>
869 Reviewed by Geoffrey Garen.
871 Remove unnecessary friend declaration.
875 2008-09-09 Sam Weinig <sam@webkit.org>
877 Reviewed by Geoffrey Garen.
879 Replace uses of PropertyMap::get and PropertyMap::getLocation with
880 PropertyMap::getOffset.
882 Sunspider reports this as a .6% improvement.
884 * JavaScriptCore.exp:
886 (JSC::JSObject::put):
887 (JSC::JSObject::deleteProperty):
888 (JSC::JSObject::getPropertyAttributes):
890 (JSC::JSObject::getDirect):
891 (JSC::JSObject::getDirectLocation):
892 (JSC::JSObject::locationForOffset):
893 * kjs/PropertyMap.cpp:
894 (JSC::PropertyMap::remove):
895 (JSC::PropertyMap::getOffset):
898 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
900 Reviewed by Sam Weinig.
902 Bug 20754: Remove emit prefix from assembler opcode methods
903 <https://bugs.webkit.org/show_bug.cgi?id=20754>
906 (JSC::CTI::emitGetArg):
907 (JSC::CTI::emitGetPutArg):
908 (JSC::CTI::emitPutArg):
909 (JSC::CTI::emitPutArgConstant):
910 (JSC::CTI::emitPutCTIParam):
911 (JSC::CTI::emitGetCTIParam):
912 (JSC::CTI::emitPutToCallFrameHeader):
913 (JSC::CTI::emitGetFromCallFrameHeader):
914 (JSC::CTI::emitPutResult):
915 (JSC::CTI::emitDebugExceptionCheck):
916 (JSC::CTI::emitCall):
917 (JSC::CTI::emitJumpSlowCaseIfNotImm):
918 (JSC::CTI::emitJumpSlowCaseIfNotImms):
919 (JSC::CTI::emitFastArithDeTagImmediate):
920 (JSC::CTI::emitFastArithReTagImmediate):
921 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
922 (JSC::CTI::emitFastArithImmToInt):
923 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
924 (JSC::CTI::emitFastArithIntToImmNoCheck):
925 (JSC::CTI::compileOpCall):
926 (JSC::CTI::emitSlowScriptCheck):
927 (JSC::CTI::privateCompileMainPass):
928 (JSC::CTI::privateCompileSlowCases):
929 (JSC::CTI::privateCompile):
930 (JSC::CTI::privateCompileGetByIdSelf):
931 (JSC::CTI::privateCompileGetByIdProto):
932 (JSC::CTI::privateCompileGetByIdChain):
933 (JSC::CTI::privateCompilePutByIdReplace):
934 (JSC::CTI::privateArrayLengthTrampoline):
935 (JSC::CTI::privateStringLengthTrampoline):
936 (JSC::CTI::compileRegExp):
937 * masm/MacroAssemblerWin.cpp:
938 (JSC::MacroAssembler::emitConvertToFastCall):
939 (JSC::MacroAssembler::emitRestoreArgumentReference):
940 * masm/X86Assembler.h:
941 (JSC::X86Assembler::pushl_r):
942 (JSC::X86Assembler::pushl_m):
943 (JSC::X86Assembler::popl_r):
944 (JSC::X86Assembler::popl_m):
945 (JSC::X86Assembler::movl_rr):
946 (JSC::X86Assembler::addl_rr):
947 (JSC::X86Assembler::addl_i8r):
948 (JSC::X86Assembler::addl_i32r):
949 (JSC::X86Assembler::addl_mr):
950 (JSC::X86Assembler::andl_rr):
951 (JSC::X86Assembler::andl_i32r):
952 (JSC::X86Assembler::cmpl_i8r):
953 (JSC::X86Assembler::cmpl_rr):
954 (JSC::X86Assembler::cmpl_rm):
955 (JSC::X86Assembler::cmpl_i32r):
956 (JSC::X86Assembler::cmpl_i32m):
957 (JSC::X86Assembler::cmpw_rm):
958 (JSC::X86Assembler::orl_rr):
959 (JSC::X86Assembler::subl_rr):
960 (JSC::X86Assembler::subl_i8r):
961 (JSC::X86Assembler::subl_i32r):
962 (JSC::X86Assembler::subl_mr):
963 (JSC::X86Assembler::testl_i32r):
964 (JSC::X86Assembler::testl_rr):
965 (JSC::X86Assembler::xorl_i8r):
966 (JSC::X86Assembler::xorl_rr):
967 (JSC::X86Assembler::sarl_i8r):
968 (JSC::X86Assembler::sarl_CLr):
969 (JSC::X86Assembler::shl_i8r):
970 (JSC::X86Assembler::shll_CLr):
971 (JSC::X86Assembler::mull_rr):
972 (JSC::X86Assembler::idivl_r):
973 (JSC::X86Assembler::cdq):
974 (JSC::X86Assembler::movl_mr):
975 (JSC::X86Assembler::movzwl_mr):
976 (JSC::X86Assembler::movl_rm):
977 (JSC::X86Assembler::movl_i32r):
978 (JSC::X86Assembler::movl_i32m):
979 (JSC::X86Assembler::leal_mr):
980 (JSC::X86Assembler::ret):
981 (JSC::X86Assembler::jmp_r):
982 (JSC::X86Assembler::jmp_m):
983 (JSC::X86Assembler::call_r):
985 (JSC::WRECGenerator::generateBacktrack1):
986 (JSC::WRECGenerator::generateBacktrackBackreference):
987 (JSC::WRECGenerator::generateBackreferenceQuantifier):
988 (JSC::WRECGenerator::generateNonGreedyQuantifier):
989 (JSC::WRECGenerator::generateGreedyQuantifier):
990 (JSC::WRECGenerator::generatePatternCharacter):
991 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
992 (JSC::WRECGenerator::generateCharacterClassInverted):
993 (JSC::WRECGenerator::generateCharacterClass):
994 (JSC::WRECGenerator::generateParentheses):
995 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
996 (JSC::WRECGenerator::generateAssertionBOL):
997 (JSC::WRECGenerator::generateAssertionEOL):
998 (JSC::WRECGenerator::generateAssertionWordBoundary):
999 (JSC::WRECGenerator::generateBackreference):
1000 (JSC::WRECGenerator::gernerateDisjunction):
1002 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1004 Reviewed by Maciej Stachowiak.
1006 Clean up the WREC code some more.
1009 (JSC::CTI::compileRegExp):
1011 (JSC::getCharacterClassNewline):
1012 (JSC::getCharacterClassDigits):
1013 (JSC::getCharacterClassSpaces):
1014 (JSC::getCharacterClassWordchar):
1015 (JSC::getCharacterClassNondigits):
1016 (JSC::getCharacterClassNonspaces):
1017 (JSC::getCharacterClassNonwordchar):
1018 (JSC::WRECGenerator::generateBacktrack1):
1019 (JSC::WRECGenerator::generateBacktrackBackreference):
1020 (JSC::WRECGenerator::generateBackreferenceQuantifier):
1021 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1022 (JSC::WRECGenerator::generateGreedyQuantifier):
1023 (JSC::WRECGenerator::generatePatternCharacter):
1024 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
1025 (JSC::WRECGenerator::generateCharacterClassInverted):
1026 (JSC::WRECGenerator::generateCharacterClass):
1027 (JSC::WRECGenerator::generateParentheses):
1028 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
1029 (JSC::WRECGenerator::generateAssertionBOL):
1030 (JSC::WRECGenerator::generateAssertionEOL):
1031 (JSC::WRECGenerator::generateAssertionWordBoundary):
1032 (JSC::WRECGenerator::generateBackreference):
1033 (JSC::WRECGenerator::gernerateDisjunction):
1034 (JSC::WRECParser::parseCharacterClass):
1035 (JSC::WRECParser::parseEscape):
1036 (JSC::WRECParser::parseTerm):
1039 2008-09-09 Mark Rowe <mrowe@apple.com>
1041 Build fix, rubber-stamped by Anders Carlsson.
1043 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
1045 * JavaScriptCore.xcodeproj/project.pbxproj:
1047 2008-09-09 Mark Rowe <mrowe@apple.com>
1049 Rubber-stamped by Oliver Hunt.
1051 Fix builds using the "debug" variant.
1053 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
1054 and Release configurations.
1056 * Configurations/JavaScriptCore.xcconfig:
1057 * DerivedSources.make:
1058 * JavaScriptCore.Debug.exp: Removed.
1059 * JavaScriptCore.base.exp: Removed.
1060 * JavaScriptCore.exp: Added.
1061 * JavaScriptCore.xcodeproj/project.pbxproj:
1062 * kjs/identifier.cpp:
1063 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
1064 there is no overhead in Release builds.
1065 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
1067 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
1068 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
1070 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1072 Reviewed by Maciej Stachowiak.
1074 Clean up WREC a bit to bring it closer to our coding style guidelines.
1078 (JSC::getCharacterClass_newline):
1079 (JSC::getCharacterClass_d):
1080 (JSC::getCharacterClass_s):
1081 (JSC::getCharacterClass_w):
1082 (JSC::getCharacterClass_D):
1083 (JSC::getCharacterClass_S):
1084 (JSC::getCharacterClass_W):
1085 (JSC::CharacterClassConstructor::append):
1086 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1087 (JSC::WRECGenerator::generateGreedyQuantifier):
1088 (JSC::WRECGenerator::generateCharacterClassInverted):
1089 (JSC::WRECParser::parseQuantifier):
1090 (JSC::WRECParser::parsePatternCharacterQualifier):
1091 (JSC::WRECParser::parseCharacterClassQuantifier):
1092 (JSC::WRECParser::parseBackreferenceQuantifier):
1094 (JSC::Quantifier::):
1095 (JSC::Quantifier::Quantifier):
1097 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
1099 Reviewed by Alexey Proskuryakov.
1101 Try MIME charset names before trying IANA names
1102 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
1104 * wtf/StringExtras.h: (strcasecmp): Added.
1106 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1108 Reviewed by Mark Rowe.
1110 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
1111 <https://bugs.webkit.org/show_bug.cgi?id=20719>
1112 <rdar://problem/6205787>
1114 Fix a typo in the case-insensitive matching of character patterns.
1117 (JSC::WRECGenerator::generatePatternCharacter):
1119 2008-09-09 Maciej Stachowiak <mjs@apple.com>
1121 Reviewed by Sam Weinig.
1123 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
1125 1.012x speedup on SunSpider.
1127 * kjs/MathObject.cpp:
1128 (JSC::MathObject::getOwnPropertySlot):
1130 (JSC::setUpStaticFunctionSlot):
1132 (JSC::getStaticPropertySlot):
1134 2008-09-08 Sam Weinig <sam@webkit.org>
1136 Reviewed by Maciej Stachowiak and Oliver Hunt.
1138 Split storage of properties out of the PropertyMap and into the JSObject
1139 to allow sharing PropertyMap on the StructureID. In order to get this
1140 function correctly, the StructureID's transition mappings were changed to
1141 transition based on property name and attribute pairs, instead of just
1144 - Removes the single property optimization now that the PropertyMap is shared.
1145 This will be replaced by in-lining some values on the JSObject.
1147 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
1149 * JavaScriptCore.base.exp:
1151 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
1152 (JSC::CTI::privateCompileGetByIdProto): Ditto.
1153 (JSC::CTI::privateCompileGetByIdChain): Ditto.
1154 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
1156 (JSC::JSObject::mark): Mark the PropertyStorage.
1157 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
1158 (JSC::JSObject::deleteProperty): Ditto.
1159 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
1160 (JSC::JSObject::defineSetter): Ditto.
1161 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
1162 (JSC::JSObject::getPropertyNames): Ditto.
1163 (JSC::JSObject::removeDirect): Ditto.
1164 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
1165 (JSC::JSObject::propertyStorage): return the PropertyStorage.
1166 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
1167 (JSC::JSObject::getDirectLocation): Ditto.
1168 (JSC::JSObject::offsetForLocation): Compute location directly.
1169 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
1170 (JSC::JSObject::hasGetterSetterProperties): Ditto.
1171 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
1172 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
1173 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
1174 (JSC::JSObject::getOwnPropertySlot): Ditto.
1175 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
1176 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
1177 (JSC::PropertyMap::checkConsistency):
1178 (JSC::PropertyMap::operator=):
1179 (JSC::PropertyMap::~PropertyMap):
1180 (JSC::PropertyMap::get):
1181 (JSC::PropertyMap::getLocation):
1182 (JSC::PropertyMap::put):
1183 (JSC::PropertyMap::getOffset):
1184 (JSC::PropertyMap::insert):
1185 (JSC::PropertyMap::expand):
1186 (JSC::PropertyMap::rehash):
1187 (JSC::PropertyMap::createTable):
1188 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
1189 (JSC::PropertyMap::remove):
1190 (JSC::PropertyMap::getEnumerablePropertyNames):
1191 * kjs/PropertyMap.h:
1192 (JSC::PropertyMapEntry::PropertyMapEntry):
1193 (JSC::PropertyMap::isEmpty):
1194 (JSC::PropertyMap::size):
1195 (JSC::PropertyMap::makingCount):
1196 (JSC::PropertyMap::PropertyMap):
1198 * kjs/StructureID.cpp:
1199 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
1201 (JSC::StructureID::toDictionaryTransition): Copy the map.
1202 (JSC::StructureID::changePrototypeTransition): Copy the map.
1203 (JSC::StructureID::getterSetterTransition): Copy the map.
1204 (JSC::StructureID::~StructureID):
1205 * kjs/StructureID.h:
1206 (JSC::TransitionTableHash::hash): Custom hash for transition map.
1207 (JSC::TransitionTableHash::equal): Ditto.
1208 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
1209 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
1210 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
1211 (JSC::StructureID::propertyMap): Added.
1213 2008-09-08 Oliver Hunt <oliver@apple.com>
1215 Reviewed by Mark Rowe.
1217 Bug 20694: Slow Script error pops up when running Dromaeo tests
1219 Correct error in timeout logic where execution tick count would
1220 be reset to incorrect value due to incorrect offset and indirection.
1221 Codegen for the slow script dialog was factored out into a separate
1222 method (emitSlowScriptCheck) rather than having multiple copies of
1223 the same code. Also added calls to generate slow script checks
1224 for loop_if_less and loop_if_true opcodes.
1227 (JSC::CTI::emitSlowScriptCheck):
1228 (JSC::CTI::privateCompileMainPass):
1229 (JSC::CTI::privateCompileSlowCases):
1232 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1234 Reviewed by Maciej Stachowiak.
1236 Remove references to the removed WRECompiler class.
1241 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1243 Rubber-stamped by Mark Rowe.
1245 Fix the build with CTI enabled but WREC disabled.
1250 2008-09-08 Dan Bernstein <mitz@apple.com>
1255 (JSC::StatementNode::):
1258 2008-09-08 Kevin McCullough <kmccullough@apple.com>
1262 <rdar://problem/6134407> Breakpoints in for loops, while loops or
1263 conditions without curly braces don't break. (19306)
1264 -Statement Lists already emit debug hooks but conditionals without
1265 brackets are not lists.
1268 (KJS::IfNode::emitCode):
1269 (KJS::IfElseNode::emitCode):
1270 (KJS::DoWhileNode::emitCode):
1271 (KJS::WhileNode::emitCode):
1272 (KJS::ForNode::emitCode):
1273 (KJS::ForInNode::emitCode):
1275 (KJS::StatementNode::):
1278 2008-09-08 Maciej Stachowiak <mjs@apple.com>
1280 Reviewed by Anders Carlsson.
1282 - Cache the code generated for eval to speed up SunSpider and web sites
1283 https://bugs.webkit.org/show_bug.cgi?id=20718
1286 2.29x on date-format-tofte
1288 Lots of real sites seem to get many hits on this cache as well,
1289 including GMail, Google Spreadsheets, Slate and Digg (the last of
1290 these gets over 100 hits on initial page load).
1293 (JSC::EvalCodeCache::get):
1295 (JSC::Machine::callEval):
1296 (JSC::Machine::privateExecute):
1297 (JSC::Machine::cti_op_call_eval):
1300 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1302 Reviewed by Oliver Hunt.
1304 Bug 20711: Change KJS prefix on preprocessor macros to JSC
1305 <https://bugs.webkit.org/show_bug.cgi?id=20711>
1307 * kjs/CommonIdentifiers.cpp:
1308 (JSC::CommonIdentifiers::CommonIdentifiers):
1309 * kjs/CommonIdentifiers.h:
1310 * kjs/PropertySlot.h:
1311 (JSC::PropertySlot::getValue):
1312 (JSC::PropertySlot::putValue):
1313 (JSC::PropertySlot::setValueSlot):
1314 (JSC::PropertySlot::setValue):
1315 (JSC::PropertySlot::setRegisterSlot):
1320 (JSC::ExpressionNode::):
1321 (JSC::StatementNode::):
1323 (JSC::BooleanNode::):
1324 (JSC::NumberNode::):
1325 (JSC::ImmediateNumberNode::):
1326 (JSC::StringNode::):
1327 (JSC::RegExpNode::):
1329 (JSC::ResolveNode::):
1330 (JSC::ElementNode::):
1332 (JSC::PropertyNode::):
1333 (JSC::PropertyListNode::):
1334 (JSC::ObjectLiteralNode::):
1335 (JSC::BracketAccessorNode::):
1336 (JSC::DotAccessorNode::):
1337 (JSC::ArgumentListNode::):
1338 (JSC::ArgumentsNode::):
1339 (JSC::NewExprNode::):
1340 (JSC::EvalFunctionCallNode::):
1341 (JSC::FunctionCallValueNode::):
1342 (JSC::FunctionCallResolveNode::):
1343 (JSC::FunctionCallBracketNode::):
1344 (JSC::FunctionCallDotNode::):
1345 (JSC::PrePostResolveNode::):
1346 (JSC::PostfixResolveNode::):
1347 (JSC::PostfixBracketNode::):
1348 (JSC::PostfixDotNode::):
1349 (JSC::PostfixErrorNode::):
1350 (JSC::DeleteResolveNode::):
1351 (JSC::DeleteBracketNode::):
1352 (JSC::DeleteDotNode::):
1353 (JSC::DeleteValueNode::):
1355 (JSC::TypeOfResolveNode::):
1356 (JSC::TypeOfValueNode::):
1357 (JSC::PrefixResolveNode::):
1358 (JSC::PrefixBracketNode::):
1359 (JSC::PrefixDotNode::):
1360 (JSC::PrefixErrorNode::):
1361 (JSC::UnaryPlusNode::):
1362 (JSC::NegateNode::):
1363 (JSC::BitwiseNotNode::):
1364 (JSC::LogicalNotNode::):
1370 (JSC::LeftShiftNode::):
1371 (JSC::RightShiftNode::):
1372 (JSC::UnsignedRightShiftNode::):
1374 (JSC::GreaterNode::):
1375 (JSC::LessEqNode::):
1376 (JSC::GreaterEqNode::):
1377 (JSC::ThrowableBinaryOpNode::):
1378 (JSC::InstanceOfNode::):
1381 (JSC::NotEqualNode::):
1382 (JSC::StrictEqualNode::):
1383 (JSC::NotStrictEqualNode::):
1384 (JSC::BitAndNode::):
1386 (JSC::BitXOrNode::):
1387 (JSC::LogicalOpNode::):
1388 (JSC::ConditionalNode::):
1389 (JSC::ReadModifyResolveNode::):
1390 (JSC::AssignResolveNode::):
1391 (JSC::ReadModifyBracketNode::):
1392 (JSC::AssignBracketNode::):
1393 (JSC::AssignDotNode::):
1394 (JSC::ReadModifyDotNode::):
1395 (JSC::AssignErrorNode::):
1397 (JSC::VarDeclCommaNode::):
1398 (JSC::ConstDeclNode::):
1399 (JSC::ConstStatementNode::):
1400 (JSC::EmptyStatementNode::):
1401 (JSC::DebuggerStatementNode::):
1402 (JSC::ExprStatementNode::):
1403 (JSC::VarStatementNode::):
1405 (JSC::IfElseNode::):
1406 (JSC::DoWhileNode::):
1409 (JSC::ContinueNode::):
1411 (JSC::ReturnNode::):
1416 (JSC::ParameterNode::):
1418 (JSC::ProgramNode::):
1420 (JSC::FunctionBodyNode::):
1421 (JSC::FuncExprNode::):
1422 (JSC::FuncDeclNode::):
1423 (JSC::CaseClauseNode::):
1424 (JSC::ClauseListNode::):
1425 (JSC::CaseBlockNode::):
1426 (JSC::SwitchNode::):
1428 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1430 Reviewed by Maciej Stachowiak.
1432 Bug 20704: Replace the KJS namespace
1433 <https://bugs.webkit.org/show_bug.cgi?id=20704>
1435 Rename the KJS namespace to JSC. There are still some uses of KJS in
1436 preprocessor macros and comments, but these will also be changed some
1437 time in the near future.
1444 * API/JSCallbackConstructor.cpp:
1445 * API/JSCallbackConstructor.h:
1446 * API/JSCallbackFunction.cpp:
1447 * API/JSCallbackFunction.h:
1448 * API/JSCallbackObject.cpp:
1449 * API/JSCallbackObject.h:
1450 * API/JSCallbackObjectFunctions.h:
1451 * API/JSClassRef.cpp:
1452 (OpaqueJSClass::staticValues):
1453 (OpaqueJSClass::staticFunctions):
1455 * API/JSContextRef.cpp:
1456 * API/JSObjectRef.cpp:
1457 * API/JSProfilerPrivate.cpp:
1458 * API/JSStringRef.cpp:
1459 * API/JSValueRef.cpp:
1461 * API/OpaqueJSString.cpp:
1462 * API/OpaqueJSString.h:
1463 * JavaScriptCore.Debug.exp:
1464 * JavaScriptCore.base.exp:
1470 * VM/CodeGenerator.cpp:
1471 * VM/CodeGenerator.h:
1472 * VM/ExceptionHelpers.cpp:
1473 * VM/ExceptionHelpers.h:
1475 * VM/JSPropertyNameIterator.cpp:
1476 * VM/JSPropertyNameIterator.h:
1484 * VM/RegisterFile.cpp:
1485 * VM/RegisterFile.h:
1488 * VM/SamplingTool.cpp:
1489 * VM/SamplingTool.h:
1490 * VM/SegmentedVector.h:
1493 * kjs/Arguments.cpp:
1495 * kjs/ArrayConstructor.cpp:
1496 * kjs/ArrayConstructor.h:
1497 * kjs/ArrayPrototype.cpp:
1498 * kjs/ArrayPrototype.h:
1499 * kjs/BatchedTransitionOptimizer.h:
1500 * kjs/BooleanConstructor.cpp:
1501 * kjs/BooleanConstructor.h:
1502 * kjs/BooleanObject.cpp:
1503 * kjs/BooleanObject.h:
1504 * kjs/BooleanPrototype.cpp:
1505 * kjs/BooleanPrototype.h:
1509 * kjs/CommonIdentifiers.cpp:
1510 * kjs/CommonIdentifiers.h:
1511 * kjs/ConstructData.cpp:
1512 * kjs/ConstructData.h:
1513 * kjs/DateConstructor.cpp:
1514 * kjs/DateConstructor.h:
1515 * kjs/DateInstance.cpp:
1516 (JSC::DateInstance::msToGregorianDateTime):
1517 * kjs/DateInstance.h:
1520 * kjs/DatePrototype.cpp:
1521 * kjs/DatePrototype.h:
1522 * kjs/DebuggerCallFrame.cpp:
1523 * kjs/DebuggerCallFrame.h:
1526 * kjs/ErrorConstructor.cpp:
1527 * kjs/ErrorConstructor.h:
1528 * kjs/ErrorInstance.cpp:
1529 * kjs/ErrorInstance.h:
1530 * kjs/ErrorPrototype.cpp:
1531 * kjs/ErrorPrototype.h:
1532 * kjs/ExecState.cpp:
1534 * kjs/FunctionConstructor.cpp:
1535 * kjs/FunctionConstructor.h:
1536 * kjs/FunctionPrototype.cpp:
1537 * kjs/FunctionPrototype.h:
1538 * kjs/GetterSetter.cpp:
1539 * kjs/GetterSetter.h:
1540 * kjs/GlobalEvalFunction.cpp:
1541 * kjs/GlobalEvalFunction.h:
1542 * kjs/IndexToNameMap.cpp:
1543 * kjs/IndexToNameMap.h:
1544 * kjs/InitializeThreading.cpp:
1545 * kjs/InitializeThreading.h:
1546 * kjs/InternalFunction.cpp:
1547 * kjs/InternalFunction.h:
1548 (JSC::InternalFunction::InternalFunction):
1549 * kjs/JSActivation.cpp:
1550 * kjs/JSActivation.h:
1555 * kjs/JSFunction.cpp:
1557 (JSC::JSFunction::JSFunction):
1558 * kjs/JSGlobalData.cpp:
1559 (JSC::JSGlobalData::JSGlobalData):
1560 * kjs/JSGlobalData.h:
1561 * kjs/JSGlobalObject.cpp:
1562 * kjs/JSGlobalObject.h:
1563 * kjs/JSGlobalObjectFunctions.cpp:
1564 * kjs/JSGlobalObjectFunctions.h:
1565 * kjs/JSImmediate.cpp:
1566 * kjs/JSImmediate.h:
1569 * kjs/JSNotAnObject.cpp:
1570 * kjs/JSNotAnObject.h:
1571 * kjs/JSNumberCell.cpp:
1572 * kjs/JSNumberCell.h:
1575 * kjs/JSStaticScopeObject.cpp:
1576 * kjs/JSStaticScopeObject.h:
1582 * kjs/JSVariableObject.cpp:
1583 * kjs/JSVariableObject.h:
1584 * kjs/JSWrapperObject.cpp:
1585 * kjs/JSWrapperObject.h:
1586 * kjs/LabelStack.cpp:
1588 * kjs/MathObject.cpp:
1590 * kjs/NativeErrorConstructor.cpp:
1591 * kjs/NativeErrorConstructor.h:
1592 * kjs/NativeErrorPrototype.cpp:
1593 * kjs/NativeErrorPrototype.h:
1595 * kjs/NumberConstructor.cpp:
1596 * kjs/NumberConstructor.h:
1597 * kjs/NumberObject.cpp:
1598 * kjs/NumberObject.h:
1599 * kjs/NumberPrototype.cpp:
1600 * kjs/NumberPrototype.h:
1601 * kjs/ObjectConstructor.cpp:
1602 * kjs/ObjectConstructor.h:
1603 * kjs/ObjectPrototype.cpp:
1604 * kjs/ObjectPrototype.h:
1607 * kjs/PropertyMap.cpp:
1608 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
1609 * kjs/PropertyMap.h:
1610 * kjs/PropertyNameArray.cpp:
1611 * kjs/PropertyNameArray.h:
1612 * kjs/PropertySlot.cpp:
1613 * kjs/PropertySlot.h:
1614 * kjs/PrototypeFunction.cpp:
1615 * kjs/PrototypeFunction.h:
1616 * kjs/PutPropertySlot.h:
1617 * kjs/RegExpConstructor.cpp:
1618 * kjs/RegExpConstructor.h:
1619 * kjs/RegExpObject.cpp:
1620 * kjs/RegExpObject.h:
1621 * kjs/RegExpPrototype.cpp:
1622 * kjs/RegExpPrototype.h:
1623 * kjs/ScopeChain.cpp:
1625 * kjs/ScopeChainMark.h:
1628 * kjs/SmallStrings.cpp:
1629 * kjs/SmallStrings.h:
1630 * kjs/SourceProvider.h:
1631 * kjs/SourceRange.h:
1632 * kjs/StringConstructor.cpp:
1633 * kjs/StringConstructor.h:
1634 * kjs/StringObject.cpp:
1635 * kjs/StringObject.h:
1636 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1637 * kjs/StringPrototype.cpp:
1638 * kjs/StringPrototype.h:
1639 * kjs/StructureID.cpp:
1640 * kjs/StructureID.h:
1641 * kjs/SymbolTable.h:
1642 * kjs/collector.cpp:
1645 * kjs/create_hash_table:
1651 * kjs/identifier.cpp:
1653 (JSC::Identifier::equal):
1654 * kjs/interpreter.cpp:
1655 * kjs/interpreter.h:
1657 (JSC::Lexer::Lexer):
1658 (JSC::Lexer::clear):
1659 (JSC::Lexer::makeIdentifier):
1665 * kjs/nodes2string.cpp:
1666 * kjs/operations.cpp:
1674 (JSC::IdentifierRepHash::hash):
1676 * masm/MacroAssembler.h:
1677 * masm/MacroAssemblerWin.cpp:
1678 * masm/X86Assembler.h:
1679 * pcre/pcre_exec.cpp:
1680 * profiler/CallIdentifier.h:
1682 * profiler/HeavyProfile.cpp:
1683 * profiler/HeavyProfile.h:
1684 * profiler/Profile.cpp:
1685 * profiler/Profile.h:
1686 * profiler/ProfileGenerator.cpp:
1687 * profiler/ProfileGenerator.h:
1688 * profiler/ProfileNode.cpp:
1689 * profiler/ProfileNode.h:
1690 * profiler/Profiler.cpp:
1691 * profiler/Profiler.h:
1692 * profiler/TreeProfile.cpp:
1693 * profiler/TreeProfile.h:
1698 2008-09-07 Maciej Stachowiak <mjs@apple.com>
1700 Reviewed by Dan Bernstein.
1702 - rename IA32MacroAssembler class to X86Assembler
1704 We otherwise call the platform X86, and also, I don't see any macros.
1706 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1707 * JavaScriptCore.xcodeproj/project.pbxproj:
1708 * masm/IA32MacroAsm.h: Removed.
1709 * masm/MacroAssembler.h:
1710 (KJS::MacroAssembler::MacroAssembler):
1711 * masm/MacroAssemblerWin.cpp:
1712 (KJS::MacroAssembler::emitRestoreArgumentReference):
1713 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
1714 (KJS::X86Assembler::X86Assembler):
1716 (KJS::WRECGenerator::generateNonGreedyQuantifier):
1717 (KJS::WRECGenerator::generateGreedyQuantifier):
1718 (KJS::WRECGenerator::generateParentheses):
1719 (KJS::WRECGenerator::generateBackreference):
1720 (KJS::WRECGenerator::gernerateDisjunction):
1723 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
1727 Visual C++ seems to have some odd casting rules, so just convert the
1728 offending cast back to a C-style cast for now.
1730 * kjs/collector.cpp:
1731 (KJS::otherThreadStackPointer):
1733 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1735 Reviewed by Mark Rowe.
1737 Attempt to fix the Windows build by using a const_cast to cast regs.Esp
1738 to a uintptr_t instead of a reinterpret_cast.
1740 * kjs/collector.cpp:
1741 (KJS::otherThreadStackPointer):
1743 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1745 Reviewed by Sam Weinig.
1747 Remove C-style casts from kjs/collector.cpp.
1749 * kjs/collector.cpp:
1750 (KJS::Heap::heapAllocate):
1751 (KJS::currentThreadStackBase):
1752 (KJS::Heap::markConservatively):
1753 (KJS::otherThreadStackPointer):
1754 (KJS::Heap::markOtherThreadConservatively):
1757 2008-09-07 Mark Rowe <mrowe@apple.com>
1759 Build fix for the debug variant.
1761 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
1763 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1765 Reviewed by Timothy Hatcher.
1767 Remove C-style casts from the CTI code.
1770 (KJS::CTI::emitGetArg):
1771 (KJS::CTI::emitGetPutArg):
1772 (KJS::ctiRepatchCallByReturnAddress):
1773 (KJS::CTI::compileOpCall):
1774 (KJS::CTI::privateCompileMainPass):
1775 (KJS::CTI::privateCompileGetByIdSelf):
1776 (KJS::CTI::privateCompileGetByIdProto):
1777 (KJS::CTI::privateCompileGetByIdChain):
1778 (KJS::CTI::privateCompilePutByIdReplace):
1779 (KJS::CTI::privateArrayLengthTrampoline):
1780 (KJS::CTI::privateStringLengthTrampoline):
1782 === End merge of squirrelfish-extreme ===
1784 2008-09-06 Gavin Barraclough <barraclough@apple.com>
1786 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
1788 - refactor WREC to share more of the JIT infrastructure with CTI
1791 (KJS::CTI::emitGetArg):
1792 (KJS::CTI::emitGetPutArg):
1793 (KJS::CTI::emitPutArg):
1794 (KJS::CTI::emitPutArgConstant):
1795 (KJS::CTI::emitPutCTIParam):
1796 (KJS::CTI::emitGetCTIParam):
1797 (KJS::CTI::emitPutToCallFrameHeader):
1798 (KJS::CTI::emitGetFromCallFrameHeader):
1799 (KJS::CTI::emitPutResult):
1800 (KJS::CTI::emitDebugExceptionCheck):
1801 (KJS::CTI::emitJumpSlowCaseIfNotImm):
1802 (KJS::CTI::emitJumpSlowCaseIfNotImms):
1803 (KJS::CTI::emitFastArithDeTagImmediate):
1804 (KJS::CTI::emitFastArithReTagImmediate):
1805 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
1806 (KJS::CTI::emitFastArithImmToInt):
1807 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
1808 (KJS::CTI::emitFastArithIntToImmNoCheck):
1810 (KJS::CTI::compileOpCall):
1811 (KJS::CTI::privateCompileMainPass):
1812 (KJS::CTI::privateCompileSlowCases):
1813 (KJS::CTI::privateCompile):
1814 (KJS::CTI::privateCompileGetByIdSelf):
1815 (KJS::CTI::privateCompileGetByIdProto):
1816 (KJS::CTI::privateCompileGetByIdChain):
1817 (KJS::CTI::privateCompilePutByIdReplace):
1818 (KJS::CTI::privateArrayLengthTrampoline):
1819 (KJS::CTI::privateStringLengthTrampoline):
1820 (KJS::CTI::compileRegExp):
1822 (KJS::CallRecord::CallRecord):
1823 (KJS::JmpTable::JmpTable):
1824 (KJS::SlowCaseEntry::SlowCaseEntry):
1825 (KJS::CTI::JSRInfo::JSRInfo):
1827 (KJS::RegExp::RegExp):
1829 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
1830 (KJS::GeneratePatternCharacterFunctor::generateAtom):
1831 (KJS::GeneratePatternCharacterFunctor::backtrack):
1832 (KJS::GenerateCharacterClassFunctor::generateAtom):
1833 (KJS::GenerateCharacterClassFunctor::backtrack):
1834 (KJS::GenerateBackreferenceFunctor::generateAtom):
1835 (KJS::GenerateBackreferenceFunctor::backtrack):
1836 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
1837 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
1838 (KJS::WRECGenerate::generateBacktrack1):
1839 (KJS::WRECGenerate::generateBacktrackBackreference):
1840 (KJS::WRECGenerate::generateBackreferenceQuantifier):
1841 (KJS::WRECGenerate::generateNonGreedyQuantifier):
1842 (KJS::WRECGenerate::generateGreedyQuantifier):
1843 (KJS::WRECGenerate::generatePatternCharacter):
1844 (KJS::WRECGenerate::generateCharacterClassInvertedRange):
1845 (KJS::WRECGenerate::generateCharacterClassInverted):
1846 (KJS::WRECGenerate::generateCharacterClass):
1847 (KJS::WRECGenerate::generateParentheses):
1848 (KJS::WRECGenerate::generateParenthesesNonGreedy):
1849 (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
1850 (KJS::WRECGenerate::generateAssertionBOL):
1851 (KJS::WRECGenerate::generateAssertionEOL):
1852 (KJS::WRECGenerate::generateAssertionWordBoundary):
1853 (KJS::WRECGenerate::generateBackreference):
1854 (KJS::WRECGenerate::gernerateDisjunction):
1855 (KJS::WRECGenerate::terminateDisjunction):
1856 (KJS::WRECParser::parseGreedyQuantifier):
1857 (KJS::WRECParser::parseQuantifier):
1858 (KJS::WRECParser::parsePatternCharacterQualifier):
1859 (KJS::WRECParser::parseCharacterClassQuantifier):
1860 (KJS::WRECParser::parseBackreferenceQuantifier):
1861 (KJS::WRECParser::parseParentheses):
1862 (KJS::WRECParser::parseCharacterClass):
1863 (KJS::WRECParser::parseOctalEscape):
1864 (KJS::WRECParser::parseEscape):
1865 (KJS::WRECParser::parseTerm):
1866 (KJS::WRECParser::parseDisjunction):
1868 (KJS::WRECGenerate::WRECGenerate):
1869 (KJS::WRECParser::):
1870 (KJS::WRECParser::WRECParser):
1871 (KJS::WRECParser::parseAlternative):
1872 (KJS::WRECParser::isEndOfPattern):
1874 2008-09-06 Oliver Hunt <oliver@apple.com>
1876 Reviewed by NOBODY (Build fix).
1878 Fix the sampler build.
1880 * VM/SamplingTool.h:
1882 2008-09-06 Oliver Hunt <oliver@apple.com>
1884 Reviewed by Maciej Stachowiak.
1886 Jump through the necessary hoops required to make MSVC cooperate with SFX
1888 We now explicitly declare the calling convention on all cti_op_* cfunctions,
1889 and return int instead of bool where appropriate (despite the cdecl calling
1890 convention seems to state MSVC generates code that returns the result value
1891 through ecx). SFX behaves slightly differently under MSVC, specifically it
1892 stores the base argument address for the cti_op_* functions in the first
1893 argument, and then does the required stack manipulation through that pointer.
1894 This is necessary as MSVC's optimisations assume they have complete control
1895 of the stack, and periodically elide our stack manipulations, or move
1896 values in unexpected ways. MSVC also frequently produces tail calls which may
1897 clobber the first argument, so the MSVC path is slightly less efficient due
1898 to the need to restore it.
1900 * JavaScriptCore.xcodeproj/project.pbxproj:
1903 (KJS::CTI::compileOpCall):
1904 (KJS::CTI::privateCompileMainPass):
1905 (KJS::CTI::privateCompileSlowCases):
1909 * masm/MacroAssembler.h:
1910 (KJS::MacroAssembler::emitConvertToFastCall):
1911 * masm/MacroAssemblerIA32GCC.cpp: Removed.
1912 For performance reasons we need these no-op functions to be inlined.
1914 * masm/MacroAssemblerWin.cpp:
1915 (KJS::MacroAssembler::emitRestoreArgumentReference):
1918 2008-09-05 Geoffrey Garen <ggaren@apple.com>
1920 Reviewed by Maciej Stachowiak, or maybe the other way around.
1922 Added the ability to coalesce JITCode buffer grow operations by first
1923 growing the buffer and then executing unchecked puts to it.
1925 About a 2% speedup on date-format-tofte.
1928 (KJS::CTI::compileOpCall):
1929 * masm/IA32MacroAsm.h:
1930 (KJS::JITCodeBuffer::ensureSpace):
1931 (KJS::JITCodeBuffer::putByteUnchecked):
1932 (KJS::JITCodeBuffer::putByte):
1933 (KJS::JITCodeBuffer::putShortUnchecked):
1934 (KJS::JITCodeBuffer::putShort):
1935 (KJS::JITCodeBuffer::putIntUnchecked):
1936 (KJS::JITCodeBuffer::putInt):
1937 (KJS::IA32MacroAssembler::emitTestl_i32r):
1938 (KJS::IA32MacroAssembler::emitMovl_mr):
1939 (KJS::IA32MacroAssembler::emitMovl_rm):
1940 (KJS::IA32MacroAssembler::emitMovl_i32m):
1941 (KJS::IA32MacroAssembler::emitUnlinkedJe):
1942 (KJS::IA32MacroAssembler::emitModRm_rr):
1943 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
1944 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
1945 (KJS::IA32MacroAssembler::emitModRm_rm):
1946 (KJS::IA32MacroAssembler::emitModRm_opr):
1947 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
1948 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
1950 2008-09-05 Mark Rowe <mrowe@apple.com>
1952 Reviewed by Sam Weinig.
1954 Disable WREC and CTI on platforms that we have not yet had a chance to test with.
1958 2008-09-05 Geoffrey Garen <ggaren@apple.com>
1960 Reviewed by Sam Weinig.
1962 Use jo instead of a mask compare when fetching array.length and
1963 string.length. 4% speedup on array.length / string.length torture
1967 (KJS::CTI::privateArrayLengthTrampoline):
1968 (KJS::CTI::privateStringLengthTrampoline):
1970 2008-09-05 Geoffrey Garen <ggaren@apple.com>
1972 Reviewed by Sam Weinig.
1974 Removed a CTI compilation pass by recording labels during bytecode
1975 generation. This is more to reduce complexity than it is to improve
1978 SunSpider reports no change.
1980 CodeBlock now keeps a "labels" set, which holds the offsets of all the
1981 instructions that can be jumped to.
1983 * VM/CTI.cpp: Nixed a pass.
1985 * VM/CodeBlock.h: Added a "labels" set.
1987 * VM/LabelID.h: No need for a special LableID for holding jump
1988 destinations, since the CodeBlock now knows all jump destinations.
1990 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
1994 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
1996 2008-09-05 Mark Rowe <mrowe@apple.com>
1998 Reviewed by Oliver Hunt and Gavin Barraclough.
2000 Move the JITCodeBuffer onto Machine and remove the static variables.
2002 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
2004 (KJS::Machine::Machine): Allocate a JITCodeBuffer.
2006 * kjs/RegExpConstructor.cpp:
2007 (KJS::constructRegExp): Pass the ExecState through.
2008 * kjs/RegExpPrototype.cpp:
2009 (KJS::regExpProtoFuncCompile): Ditto.
2010 * kjs/StringPrototype.cpp:
2011 (KJS::stringProtoFuncMatch): Ditto.
2012 (KJS::stringProtoFuncSearch): Ditto.
2014 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
2015 so that we have access to an ExecState.
2017 (KJS::RegExpNode::):
2018 * kjs/nodes2string.cpp:
2020 (KJS::RegExp::RegExp): Pass the ExecState through.
2021 (KJS::RegExp::create): Ditto.
2023 * masm/IA32MacroAsm.h:
2024 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
2027 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
2030 2008-09-05 Mark Rowe <mrowe@apple.com>
2032 Reviewed by Oliver Hunt and Gavin Barraclough.
2034 Fix the build when CTI is disabled.
2037 (KJS::CodeBlock::~CodeBlock):
2038 * VM/CodeGenerator.cpp:
2039 (KJS::prepareJumpTableForStringSwitch):
2041 (KJS::Machine::Machine):
2042 (KJS::Machine::~Machine):
2044 2008-09-05 Gavin Barraclough <barraclough@apple.com>
2046 Reviewed by Mark Rowe.
2048 Fix some windows abi issues.
2051 (KJS::CTI::privateCompileMainPass):
2052 (KJS::CTI::privateCompileSlowCases):
2054 (KJS::CallRecord::CallRecord):
2057 (KJS::Machine::cti_op_resolve_func):
2058 (KJS::Machine::cti_op_post_inc):
2059 (KJS::Machine::cti_op_resolve_with_base):
2060 (KJS::Machine::cti_op_post_dec):
2063 2008-09-05 Mark Rowe <mrowe@apple.com>
2065 Reviewed by Sam Weinig.
2067 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
2070 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
2071 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
2073 2008-09-04 Mark Rowe <mrowe@apple.com>
2075 Reviewed by Sam Weinig.
2077 Fix fast/dom/Window/console-functions.html.
2079 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
2080 such as console.log would use the line number of the last JS function on the call stack.
2083 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
2084 and restore it when the function is done.
2085 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
2087 2008-09-05 Oliver Hunt <oliver@apple.com>
2089 Start bringing up SFX on windows.
2091 Reviewed by Mark Rowe and Sam Weinig
2093 Start doing the work to bring up SFX on windows. Initially
2094 just working on WREC, as it does not make any calls so reduces
2095 the amount of code that needs to be corrected.
2097 Start abstracting the CTI JIT codegen engine.
2100 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2101 * JavaScriptCore.xcodeproj/project.pbxproj:
2103 * masm/IA32MacroAsm.h:
2104 * masm/MacroAssembler.h: Added.
2105 (KJS::MacroAssembler::MacroAssembler):
2106 * masm/MacroAssemblerIA32GCC.cpp: Added.
2107 (KJS::MacroAssembler::emitConvertToFastCall):
2108 * masm/MacroAssemblerWin.cpp: Added.
2109 (KJS::MacroAssembler::emitConvertToFastCall):
2111 (KJS::WRECompiler::parseGreedyQuantifier):
2112 (KJS::WRECompiler::parseCharacterClass):
2113 (KJS::WRECompiler::parseEscape):
2114 (KJS::WRECompiler::compilePattern):
2117 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2119 Reviewed by Sam Weinig.
2121 Support for slow scripts (timeout checking).
2124 (KJS::CTI::privateCompileMainPass):
2125 (KJS::CTI::privateCompile):
2127 (KJS::slideRegisterWindowForCall):
2128 (KJS::Machine::cti_timeout_check):
2129 (KJS::Machine::cti_vm_throw):
2131 2008-09-04 Sam Weinig <sam@webkit.org>
2133 Reviewed by Mark Rowe.
2135 Third round of style cleanup.
2144 2008-09-04 Sam Weinig <sam@webkit.org>
2146 Reviewed by Jon Honeycutt.
2148 Second round of style cleanup.
2154 2008-09-04 Sam Weinig <sam@webkit.org>
2156 Reviewed by Mark Rowe.
2158 First round of style cleanup.
2162 * masm/IA32MacroAsm.h:
2166 2008-09-04 Geoffrey Garen <ggaren@apple.com>
2168 Reviewed by Mark Rowe.
2170 Merged http://trac.webkit.org/changeset/36081 to work with CTI.
2173 (KJS::Machine::tryCtiCacheGetByID):
2175 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2177 Reviewed by Sam Weinig.
2179 Enable profiling in CTI.
2183 (KJS::CTI::execute):
2185 (KJS::Machine::cti_op_call_JSFunction):
2186 (KJS::Machine::cti_op_call_NotJSFunction):
2187 (KJS::Machine::cti_op_ret):
2188 (KJS::Machine::cti_op_construct_JSConstruct):
2189 (KJS::Machine::cti_op_construct_NotJSConstruct):
2191 2008-09-04 Victor Hernandez <vhernandez@apple.com>
2193 Reviewed by Geoffrey Garen.
2195 Fixed an #if to support using WREC without CTI.
2198 (KJS::RegExp::match):
2200 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2202 Reviewed by Oliver Hunt.
2204 The array/string length trampolines are owned by the Machine, not the codeblock that compiled them.
2207 (KJS::CTI::privateArrayLengthTrampoline):
2208 (KJS::CTI::privateStringLengthTrampoline):
2210 (KJS::Machine::~Machine):
2213 2008-09-04 Mark Rowe <mrowe@apple.com>
2215 Reviewed by Gavin Barraclough and Sam Weinig.
2217 Fix a crash on launch of jsc when GuardMalloc is enabled.
2220 (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain.
2221 (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref.
2223 2008-09-03 Oliver Hunt <oliver@apple.com>
2225 Reviewed by Gavin Barraclough and Geoff Garen.
2227 Fix inspector and fast array access so that it bounds
2231 (KJS::CTI::privateCompile_pass2_Main):
2232 * masm/IA32MacroAsm.h:
2233 (KJS::IA32MacroAssembler::):
2234 (KJS::IA32MacroAssembler::emitUnlinkedJb):
2235 (KJS::IA32MacroAssembler::emitUnlinkedJbe):
2237 2008-09-03 Mark Rowe <mrowe@apple.com>
2239 Move the assertion after the InitializeAndReturn block, as
2240 that is used even when CTI is enabled.
2243 (KJS::Machine::privateExecute):
2245 2008-09-03 Mark Rowe <mrowe@apple.com>
2247 Reviewed by Sam Weinig.
2249 Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED.
2252 (KJS::CTI::privateCompile_pass1_Scan):
2253 (KJS::CTI::privateCompile_pass2_Main):
2254 (KJS::CTI::privateCompile_pass4_SlowCases):
2256 (KJS::Machine::privateExecute):
2257 (KJS::Machine::cti_vm_throw):
2259 2008-09-03 Mark Rowe <mrowe@apple.com>
2261 Reviewed by Sam Weinig.
2263 Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved
2264 by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86)
2270 (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for
2271 printing a ptrdiff_t.
2275 (KJS::RegExp::RegExp):
2276 (KJS::RegExp::~RegExp):
2277 (KJS::RegExp::match):
2279 * masm/IA32MacroAsm.h:
2282 * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to
2283 track whether any MASM-using features are enabled.
2285 2008-09-03 Gavin Barraclough <barraclough@apple.com>
2287 Reviewed by Oliver Hunt.
2289 Copy Geoff's array/string length optimization for CTI.
2292 (KJS::CTI::privateArrayLengthTrampoline):
2293 (KJS::CTI::privateStringLengthTrampoline):
2295 (KJS::CTI::compileArrayLengthTrampoline):
2296 (KJS::CTI::compileStringLengthTrampoline):
2298 (KJS::Machine::Machine):
2299 (KJS::Machine::getCtiArrayLengthTrampoline):
2300 (KJS::Machine::getCtiStringLengthTrampoline):
2301 (KJS::Machine::tryCtiCacheGetByID):
2302 (KJS::Machine::cti_op_get_by_id_second):
2307 2008-09-03 Gavin Barraclough <barraclough@apple.com>
2309 Reviewed by Oliver Hunt.
2311 Implement fast array accesses in CTI - 2-3% progression on sunspider.
2314 (KJS::CTI::emitFastArithIntToImmNoCheck):
2315 (KJS::CTI::compileOpCall):
2316 (KJS::CTI::privateCompile_pass2_Main):
2317 (KJS::CTI::privateCompile_pass4_SlowCases):
2321 2008-09-02 Gavin Barraclough <barraclough@apple.com>
2323 Reviewed by Oliver Hunt.
2325 Enable fast property access support in CTI.
2328 (KJS::ctiSetReturnAddress):
2329 (KJS::ctiRepatchCallByReturnAddress):
2330 (KJS::CTI::privateCompile_pass2_Main):
2331 (KJS::CTI::privateCompile):
2332 (KJS::CTI::privateCompileGetByIdSelf):
2333 (KJS::CTI::privateCompileGetByIdProto):
2334 (KJS::CTI::privateCompileGetByIdChain):
2335 (KJS::CTI::privateCompilePutByIdReplace):
2337 (KJS::CTI::compileGetByIdSelf):
2338 (KJS::CTI::compileGetByIdProto):
2339 (KJS::CTI::compileGetByIdChain):
2340 (KJS::CTI::compilePutByIdReplace):
2342 (KJS::CodeBlock::~CodeBlock):
2345 (KJS::doSetReturnAddressVmThrowTrampoline):
2346 (KJS::Machine::tryCtiCachePutByID):
2347 (KJS::Machine::tryCtiCacheGetByID):
2348 (KJS::Machine::cti_op_put_by_id):
2349 (KJS::Machine::cti_op_put_by_id_second):
2350 (KJS::Machine::cti_op_put_by_id_generic):
2351 (KJS::Machine::cti_op_put_by_id_fail):
2352 (KJS::Machine::cti_op_get_by_id):
2353 (KJS::Machine::cti_op_get_by_id_second):
2354 (KJS::Machine::cti_op_get_by_id_generic):
2355 (KJS::Machine::cti_op_get_by_id_fail):
2356 (KJS::Machine::cti_op_throw):
2357 (KJS::Machine::cti_vm_throw):
2361 * kjs/PropertyMap.h:
2362 * kjs/StructureID.cpp:
2363 (KJS::StructureIDChain::StructureIDChain):
2364 * masm/IA32MacroAsm.h:
2365 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2366 (KJS::IA32MacroAssembler::emitMovl_mr):
2367 (KJS::IA32MacroAssembler::emitMovl_rm):
2369 2008-09-02 Sam Weinig <sam@webkit.org>
2371 Reviewed by Gavin Barraclough and Mark Rowe.
2373 A backslash (\) at the of a RegEx should produce an error.
2374 Fixes fast/regex/test1.html.
2377 (KJS::WRECompiler::parseEscape):
2379 2008-09-02 Sam Weinig <sam@webkit.org>
2381 Reviewed by Geoff Garen.
2383 Link jumps for the slow case of op_loop_if_less. Fixes acid3.
2386 (KJS::CTI::privateCompile_pass4_SlowCases):
2388 2008-09-01 Sam Weinig <sam@webkit.org>
2390 Rubber-stamped by Maciej Stachowiak.
2392 Switch WREC on by default.
2396 2008-09-01 Sam Weinig <sam@webkit.org>
2398 Reviewed by Mark Rowe.
2400 Fix two failures in fast/regex/test1.html
2401 - \- in a character class should be treated as a literal -
2402 - A missing max quantifier needs to be treated differently than
2403 a null max quantifier.
2406 (KJS::WRECompiler::generateNonGreedyQuantifier):
2407 (KJS::WRECompiler::generateGreedyQuantifier):
2408 (KJS::WRECompiler::parseCharacterClass):
2410 (KJS::Quantifier::Quantifier):
2412 2008-09-01 Sam Weinig <sam@webkit.org>
2414 Reviewed by Mark Rowe.
2416 Fix crash in fast/js/kde/evil-n.html
2418 * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function.
2420 2008-09-01 Sam Weinig <sam@webkit.org>
2422 Reviewed by Gavin Barraclough and Mark Rowe.
2424 Add pattern length limit fixing one test in fast/js.
2427 (KJS::WRECompiler::compile):
2429 (KJS::WRECompiler::):
2431 2008-09-01 Sam Weinig <sam@webkit.org>
2433 Reviewed by Gavin Barraclough and Mark Rowe.
2435 Make octal escape parsing/back-reference parsing more closely match
2436 prior behavior fixing one test in fast/js.
2439 (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped
2440 (KJS::WRECompiler::parseEscape):
2442 (KJS::WRECompiler::peekDigit):
2444 2008-09-01 Sam Weinig <sam@webkit.org>
2446 Reviewed by Gavin Barraclough and Mark Rowe.
2448 Fix one mozilla test.
2451 (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not
2454 2008-09-01 Sam Weinig <sam@webkit.org>
2456 Reviewed by Gavin Barraclough and Mark Rowe.
2458 Parse octal escapes in character classes fixing one mozilla test.
2461 (KJS::WRECompiler::parseCharacterClass):
2462 (KJS::WRECompiler::parseOctalEscape):
2464 (KJS::WRECompiler::consumeOctal):
2466 2008-09-01 Sam Weinig <sam@webkit.org>
2468 Reviewed by Oliver Hunt.
2470 Fixes two mozilla tests with WREC enabled.
2473 (KJS::CharacterClassConstructor::append): Keep the character class sorted
2474 when appending another character class.
2476 2008-09-01 Sam Weinig <sam@webkit.org>
2478 Reviewed by Gavin Barraclough and Mark Rowe.
2480 Fixes two mozilla tests with WREC enabled.
2483 (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position
2484 instead of appending it to the end.
2486 2008-09-01 Gavin Barraclough <barraclough@apple.com>
2488 Reviewed by Oliver Hunt.
2490 Move cross-compilation unit call into NEVER_INLINE function.
2493 (KJS::doSetReturnAddressVmThrowTrampoline):
2495 2008-09-01 Sam Weinig <sam@webkit.org>
2497 Reviewed by Gavin Barraclough and Geoff Garen.
2499 Fix one test in fast/js.
2502 (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError,
2503 instead of a createNotAFunctionError.
2505 2008-08-31 Gavin Barraclough <barraclough@apple.com>
2507 Reviewed by Maciej Stachowiak.
2509 Zero-cost exception handling. This patch takes the exception checking
2510 back of the hot path. When an exception occurs in a Machine::cti*
2511 method, the return address to JIT code is recorded, and is then
2512 overwritten with a pointer to a trampoline routine. When the method
2513 returns the trampoline will cause the cti_vm_throw method to be invoked.
2515 cti_vm_throw uses the return address preserved above, to discover the
2516 vPC of the bytecode that raised the exception (using a map build during
2517 translation). From the VPC of the faulting bytecode the vPC of a catch
2518 routine may be discovered (unwinding the stack where necesary), and then
2519 a bytecode address for the catch routine is looked up. Final cti_vm_throw
2520 overwrites its return address to JIT code again, to trampoline directly
2521 to the catch routine.
2523 cti_op_throw is handled in a similar fashion.
2526 (KJS::CTI::emitPutCTIParam):
2527 (KJS::CTI::emitPutToCallFrameHeader):
2528 (KJS::CTI::emitGetFromCallFrameHeader):
2529 (KJS::ctiSetReturnAddressForArgs):
2530 (KJS::CTI::emitDebugExceptionCheck):
2531 (KJS::CTI::printOpcodeOperandTypes):
2532 (KJS::CTI::emitCall):
2533 (KJS::CTI::compileOpCall):
2534 (KJS::CTI::privateCompile_pass2_Main):
2535 (KJS::CTI::privateCompile):
2537 (KJS::CallRecord::CallRecord):
2539 (KJS::CTI::execute):
2542 (KJS::Machine::privateExecute):
2543 (KJS::Machine::cti_op_instanceof):
2544 (KJS::Machine::cti_op_call_NotJSFunction):
2545 (KJS::Machine::cti_op_resolve):
2546 (KJS::Machine::cti_op_resolve_func):
2547 (KJS::Machine::cti_op_resolve_skip):
2548 (KJS::Machine::cti_op_resolve_with_base):
2549 (KJS::Machine::cti_op_throw):
2550 (KJS::Machine::cti_op_in):
2551 (KJS::Machine::cti_vm_throw):
2552 * VM/RegisterFile.h:
2553 (KJS::RegisterFile::):
2555 (KJS::ExecState::setCtiReturnAddress):
2556 (KJS::ExecState::ctiReturnAddress):
2557 * masm/IA32MacroAsm.h:
2558 (KJS::IA32MacroAssembler::):
2559 (KJS::IA32MacroAssembler::emitPushl_m):
2560 (KJS::IA32MacroAssembler::emitPopl_m):
2561 (KJS::IA32MacroAssembler::getRelocatedAddress):
2563 2008-08-31 Mark Rowe <mrowe@apple.com>
2565 Reviewed by Oliver Hunt.
2567 Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them.
2570 (KJS::WRECompiler::parseParentheses):
2572 (KJS::WRECompiler::):
2574 2008-08-31 Mark Rowe <mrowe@apple.com>
2576 Reviewed by Oliver Hunt.
2578 Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled.
2581 (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum.
2582 (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register.
2583 (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag.
2585 2008-08-30 Mark Rowe <mrowe@apple.com>
2587 Reviewed by Oliver Hunt.
2589 Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance.
2590 This shows up as a 0.6% progression on SunSpider on my machine.
2592 Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out.
2595 (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc.
2596 * kjs/regexp.cpp: Ditto.
2597 * masm/IA32MacroAsm.h:
2598 (KJS::JITCodeBuffer::growBuffer):
2599 (KJS::JITCodeBuffer::JITCodeBuffer):
2600 (KJS::JITCodeBuffer::~JITCodeBuffer):
2601 (KJS::JITCodeBuffer::putByte):
2602 (KJS::JITCodeBuffer::putShort):
2603 (KJS::JITCodeBuffer::putInt):
2604 (KJS::JITCodeBuffer::reset):
2605 (KJS::JITCodeBuffer::copy):
2607 2008-08-29 Oliver Hunt <oliver@apple.com>
2611 Roll out previous patch as it causes a 5% performance regression
2613 * JavaScriptCore.xcodeproj/project.pbxproj:
2616 (KJS::CTI::privateCompile):
2618 (KJS::CodeBlock::~CodeBlock):
2619 * masm/IA32MacroAsm.h:
2620 (KJS::JITCodeBuffer::JITCodeBuffer):
2621 (KJS::JITCodeBuffer::putByte):
2622 (KJS::JITCodeBuffer::putShort):
2623 (KJS::JITCodeBuffer::putInt):
2624 (KJS::JITCodeBuffer::getEIP):
2625 (KJS::JITCodeBuffer::start):
2626 (KJS::JITCodeBuffer::getOffset):
2627 (KJS::JITCodeBuffer::reset):
2628 (KJS::JITCodeBuffer::copy):
2629 (KJS::IA32MacroAssembler::emitModRm_rr):
2630 (KJS::IA32MacroAssembler::emitModRm_rm):
2631 (KJS::IA32MacroAssembler::emitModRm_rmsib):
2632 (KJS::IA32MacroAssembler::IA32MacroAssembler):
2633 (KJS::IA32MacroAssembler::emitInt3):
2634 (KJS::IA32MacroAssembler::emitPushl_r):
2635 (KJS::IA32MacroAssembler::emitPopl_r):
2636 (KJS::IA32MacroAssembler::emitMovl_rr):
2637 (KJS::IA32MacroAssembler::emitAddl_rr):
2638 (KJS::IA32MacroAssembler::emitAddl_i8r):
2639 (KJS::IA32MacroAssembler::emitAddl_i32r):
2640 (KJS::IA32MacroAssembler::emitAddl_mr):
2641 (KJS::IA32MacroAssembler::emitAndl_rr):
2642 (KJS::IA32MacroAssembler::emitAndl_i32r):
2643 (KJS::IA32MacroAssembler::emitCmpl_i8r):
2644 (KJS::IA32MacroAssembler::emitCmpl_rr):
2645 (KJS::IA32MacroAssembler::emitCmpl_rm):
2646 (KJS::IA32MacroAssembler::emitCmpl_i32r):
2647 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2648 (KJS::IA32MacroAssembler::emitCmpw_rm):
2649 (KJS::IA32MacroAssembler::emitOrl_rr):
2650 (KJS::IA32MacroAssembler::emitOrl_i8r):
2651 (KJS::IA32MacroAssembler::emitSubl_rr):
2652 (KJS::IA32MacroAssembler::emitSubl_i8r):
2653 (KJS::IA32MacroAssembler::emitSubl_i32r):
2654 (KJS::IA32MacroAssembler::emitSubl_mr):
2655 (KJS::IA32MacroAssembler::emitTestl_i32r):
2656 (KJS::IA32MacroAssembler::emitTestl_rr):
2657 (KJS::IA32MacroAssembler::emitXorl_i8r):
2658 (KJS::IA32MacroAssembler::emitXorl_rr):
2659 (KJS::IA32MacroAssembler::emitSarl_i8r):
2660 (KJS::IA32MacroAssembler::emitSarl_CLr):
2661 (KJS::IA32MacroAssembler::emitShl_i8r):
2662 (KJS::IA32MacroAssembler::emitShll_CLr):
2663 (KJS::IA32MacroAssembler::emitMull_rr):
2664 (KJS::IA32MacroAssembler::emitIdivl_r):
2665 (KJS::IA32MacroAssembler::emitCdq):
2666 (KJS::IA32MacroAssembler::emitMovl_mr):
2667 (KJS::IA32MacroAssembler::emitMovzwl_mr):
2668 (KJS::IA32MacroAssembler::emitMovl_rm):
2669 (KJS::IA32MacroAssembler::emitMovl_i32r):
2670 (KJS::IA32MacroAssembler::emitMovl_i32m):
2671 (KJS::IA32MacroAssembler::emitLeal_mr):
2672 (KJS::IA32MacroAssembler::emitRet):
2673 (KJS::IA32MacroAssembler::emitJmpN_r):
2674 (KJS::IA32MacroAssembler::emitJmpN_m):
2675 (KJS::IA32MacroAssembler::emitCall):
2676 (KJS::IA32MacroAssembler::label):
2677 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
2678 (KJS::IA32MacroAssembler::emitUnlinkedJne):
2679 (KJS::IA32MacroAssembler::emitUnlinkedJe):
2680 (KJS::IA32MacroAssembler::emitUnlinkedJl):
2681 (KJS::IA32MacroAssembler::emitUnlinkedJle):
2682 (KJS::IA32MacroAssembler::emitUnlinkedJge):
2683 (KJS::IA32MacroAssembler::emitUnlinkedJae):
2684 (KJS::IA32MacroAssembler::emitUnlinkedJo):
2685 (KJS::IA32MacroAssembler::link):
2687 (KJS::WRECompiler::compilePattern):
2688 (KJS::WRECompiler::compile):
2691 2008-08-29 Mark Rowe <mrowe@apple.com>
2693 Reviewed by Oliver Hunt.
2695 Have JITCodeBuffer manage a Vector containing the generated code so that it can grow
2696 as needed when generating code for a large function. This fixes all six remaining failures
2697 in Mozilla tests in both debug and release builds.
2700 (KJS::CTI::privateCompile):
2702 (KJS::CodeBlock::~CodeBlock):
2703 * masm/IA32MacroAsm.h:
2704 (KJS::JITCodeBuffer::putByte):
2705 (KJS::JITCodeBuffer::putShort):
2706 (KJS::JITCodeBuffer::putInt):
2707 (KJS::JITCodeBuffer::getEIP):
2708 (KJS::JITCodeBuffer::start):
2709 (KJS::JITCodeBuffer::getOffset):
2710 (KJS::JITCodeBuffer::getCode):
2711 (KJS::IA32MacroAssembler::emitModRm_rr):
2713 (KJS::WRECompiler::compilePattern):
2716 2008-08-29 Mark Rowe <mrowe@apple.com>
2718 Reviewed by Oliver Hunt.
2720 Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests.
2723 (KJS::WRECompiler::parseOctalEscape):
2724 (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero.
2725 Add a FIXME about treating invalid backreferences as octal escapes in the future.
2727 (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than
2730 (WTF::isASCIIOctalDigit):
2732 2008-08-29 Sam Weinig <sam@webkit.org>
2734 Reviewed by Mark Rowe.
2736 Pass vPC to instanceof method. Fixes 2 mozilla tests in debug.
2739 (KJS::CTI::privateCompile_pass2_Main):
2741 (KJS::Machine::cti_op_instanceof):
2743 2008-08-29 Sam Weinig <sam@webkit.org>
2745 Reviewed by Mark Rowe.
2747 Pass vPCs to resolve methods for correct exception creation. Fixes
2748 17 mozilla tests in debug.
2751 (KJS::CTI::privateCompile_pass2_Main):
2754 (KJS::Machine::cti_op_resolve):
2755 (KJS::Machine::cti_op_resolve_func):
2756 (KJS::Machine::cti_op_resolve_skip):
2757 (KJS::Machine::cti_op_resolve_with_base):
2759 2008-08-29 Gavin Barraclough <barraclough@apple.com>
2761 Reviewed by Oliver Hunt.
2763 Remembering to actually throw the exception passed to op throw helps.
2764 Regressions 19 -> 6.
2767 (KJS::Machine::cti_op_throw):
2768 (KJS::Machine::cti_vm_throw):
2770 2008-08-29 Gavin Barraclough <barraclough@apple.com>
2772 Reviewed by Sam Weinig.
2774 Support for exception unwinding the stack.
2776 Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address
2777 is now preserved on entry to a JIT code function (if we preserve lazily we need
2778 restore the native return address during exception stack unwind). This takes
2779 the number of regressions down from ~150 to 19.
2783 (KJS::CTI::emitExceptionCheck):
2784 (KJS::CTI::compileOpCall):
2785 (KJS::CTI::privateCompile_pass2_Main):
2786 (KJS::CTI::privateCompile):
2790 (KJS::Machine::throwException):
2791 (KJS::Machine::cti_op_call_JSFunction):
2792 (KJS::Machine::cti_op_call_NotJSFunction):
2793 (KJS::Machine::cti_op_construct_JSConstruct):
2794 (KJS::Machine::cti_op_construct_NotJSConstruct):
2795 (KJS::Machine::cti_op_throw):
2796 (KJS::Machine::cti_vm_throw):
2798 2008-08-29 Mark Rowe <mrowe@apple.com>
2800 Reviewed by Oliver Hunt.
2802 Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled.
2805 (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches
2806 succeeded, jump to failure.
2807 (KJS::WRECompiler::compilePattern): Restore and increment the current position stored
2808 on the stack to ensure that it will be reset to the correct position after a failed
2809 match has consumed input.
2811 2008-08-29 Mark Rowe <mrowe@apple.com>
2813 Reviewed by Oliver Hunt.
2815 Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled.
2816 A backreference with a quantifier would get stuck in an infinite
2817 loop if the captured range was empty.
2820 (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range
2821 was empty, do not attempt to match the backreference.
2822 (KJS::WRECompiler::parseBackreferenceQuantifier):
2824 (KJS::Quantifier::):
2826 2008-08-28 Sam Weinig <sam@webkit.org>
2828 Reviewed by Oliver Hunt.
2833 (KJS::CTI::privateCompile_pass1_Scan):
2834 (KJS::CTI::privateCompile_pass2_Main):
2836 (KJS::Machine::debug):
2837 (KJS::Machine::privateExecute):
2838 (KJS::Machine::cti_op_debug):
2841 2008-08-28 Sam Weinig <sam@webkit.org>
2843 Reviewed by Gavin Barraclough and Geoff Garen.
2845 Implement op_switch_string fixing 1 mozilla test and one test in fast/js.
2848 (KJS::CTI::privateCompile_pass1_Scan):
2849 (KJS::CTI::privateCompile_pass2_Main):
2850 (KJS::CTI::privateCompile):
2852 (KJS::SwitchRecord::):
2853 (KJS::SwitchRecord::SwitchRecord):
2855 (KJS::CodeBlock::dump):
2857 (KJS::ExpressionRangeInfo::):
2858 (KJS::StringJumpTable::offsetForValue):
2859 (KJS::StringJumpTable::ctiForValue):
2860 (KJS::SimpleJumpTable::add):
2861 (KJS::SimpleJumpTable::ctiForValue):
2862 * VM/CodeGenerator.cpp:
2863 (KJS::prepareJumpTableForStringSwitch):
2865 (KJS::Machine::privateExecute):
2866 (KJS::Machine::cti_op_switch_string):
2869 2008-08-28 Gavin Barraclough <barraclough@apple.com>
2871 Reviewed by Oliver Hunt.
2873 Do not recurse on the machine stack when executing op_call.
2876 (KJS::CTI::emitGetPutArg):
2877 (KJS::CTI::emitPutArg):
2878 (KJS::CTI::emitPutArgConstant):
2879 (KJS::CTI::compileOpCall):
2880 (KJS::CTI::privateCompile_pass2_Main):
2881 (KJS::CTI::privateCompile):
2884 (KJS::CTI::compile):
2885 (KJS::CTI::execute):
2888 (KJS::Machine::Machine):
2889 (KJS::Machine::execute):
2890 (KJS::Machine::cti_op_call_JSFunction):
2891 (KJS::Machine::cti_op_call_NotJSFunction):
2892 (KJS::Machine::cti_op_ret):
2893 (KJS::Machine::cti_op_construct_JSConstruct):
2894 (KJS::Machine::cti_op_construct_NotJSConstruct):
2895 (KJS::Machine::cti_op_call_eval):
2898 (KJS::Register::Register):
2899 * VM/RegisterFile.h:
2900 (KJS::RegisterFile::):
2901 * kjs/InternalFunction.h:
2902 (KJS::InternalFunction::InternalFunction):
2904 (KJS::JSFunction::JSFunction):
2906 (KJS::ScopeChain::ScopeChain):
2907 * masm/IA32MacroAsm.h:
2908 (KJS::IA32MacroAssembler::):
2909 (KJS::IA32MacroAssembler::emitModRm_opm):
2910 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2911 (KJS::IA32MacroAssembler::emitCallN_r):
2913 2008-08-28 Sam Weinig <sam@webkit.org>
2915 Reviewed by Mark Rowe.
2917 Exit instead of crashing in ctiUnsupported and ctiTimedOut.
2920 (KJS::ctiUnsupported):
2923 2008-08-28 Oliver Hunt <oliver@apple.com>
2925 Reviewed by Maciej Stachowiak.
2927 Implement codegen for op_jsr and op_sret.
2930 (KJS::CTI::privateCompile_pass1_Scan):
2931 (KJS::CTI::privateCompile_pass2_Main):
2932 (KJS::CTI::privateCompile):
2934 (KJS::CTI::JSRInfo::JSRInfo):
2935 * masm/IA32MacroAsm.h:
2936 (KJS::IA32MacroAssembler::emitJmpN_m):
2937 (KJS::IA32MacroAssembler::linkAbsoluteAddress):
2939 2008-08-28 Gavin Barraclough <barraclough@apple.com>
2941 Reviewed by Oliver Hunt.
2943 Initial support for exceptions (throw / catch must occur in same CodeBlock).
2946 (KJS::CTI::emitExceptionCheck):
2947 (KJS::CTI::emitCall):
2948 (KJS::CTI::privateCompile_pass2_Main):
2949 (KJS::CTI::privateCompile_pass4_SlowCases):
2950 (KJS::CTI::privateCompile):
2953 (KJS::CodeBlock::nativeExceptionCodeForHandlerVPC):
2955 * VM/CodeGenerator.cpp:
2956 (KJS::CodeGenerator::emitCatch):
2958 (KJS::Machine::throwException):
2959 (KJS::Machine::privateExecute):
2960 (KJS::ctiUnsupported):
2962 (KJS::Machine::cti_op_add):
2963 (KJS::Machine::cti_op_pre_inc):
2964 (KJS::Machine::cti_timeout_check):
2965 (KJS::Machine::cti_op_loop_if_less):
2966 (KJS::Machine::cti_op_put_by_id):
2967 (KJS::Machine::cti_op_get_by_id):
2968 (KJS::Machine::cti_op_instanceof):
2969 (KJS::Machine::cti_op_del_by_id):
2970 (KJS::Machine::cti_op_mul):
2971 (KJS::Machine::cti_op_call):
2972 (KJS::Machine::cti_op_resolve):
2973 (KJS::Machine::cti_op_construct):
2974 (KJS::Machine::cti_op_get_by_val):
2975 (KJS::Machine::cti_op_resolve_func):
2976 (KJS::Machine::cti_op_sub):
2977 (KJS::Machine::cti_op_put_by_val):
2978 (KJS::Machine::cti_op_lesseq):
2979 (KJS::Machine::cti_op_loop_if_true):
2980 (KJS::Machine::cti_op_negate):
2981 (KJS::Machine::cti_op_resolve_skip):
2982 (KJS::Machine::cti_op_div):
2983 (KJS::Machine::cti_op_pre_dec):
2984 (KJS::Machine::cti_op_jless):
2985 (KJS::Machine::cti_op_not):
2986 (KJS::Machine::cti_op_jtrue):
2987 (KJS::Machine::cti_op_post_inc):
2988 (KJS::Machine::cti_op_eq):
2989 (KJS::Machine::cti_op_lshift):
2990 (KJS::Machine::cti_op_bitand):
2991 (KJS::Machine::cti_op_rshift):
2992 (KJS::Machine::cti_op_bitnot):
2993 (KJS::Machine::cti_op_resolve_with_base):
2994 (KJS::Machine::cti_op_mod):
2995 (KJS::Machine::cti_op_less):
2996 (KJS::Machine::cti_op_neq):
2997 (KJS::Machine::cti_op_post_dec):
2998 (KJS::Machine::cti_op_urshift):
2999 (KJS::Machine::cti_op_bitxor):
3000 (KJS::Machine::cti_op_bitor):
3001 (KJS::Machine::cti_op_call_eval):
3002 (KJS::Machine::cti_op_throw):
3003 (KJS::Machine::cti_op_push_scope):
3004 (KJS::Machine::cti_op_stricteq):
3005 (KJS::Machine::cti_op_nstricteq):
3006 (KJS::Machine::cti_op_to_jsnumber):
3007 (KJS::Machine::cti_op_in):
3008 (KJS::Machine::cti_op_del_by_val):
3009 (KJS::Machine::cti_vm_throw):
3012 * masm/IA32MacroAsm.h:
3013 (KJS::IA32MacroAssembler::emitCmpl_i32m):
3015 2008-08-28 Mark Rowe <mrowe@apple.com>
3017 Rubber-stamped by Oliver Hunt.
3019 Print debugging info to stderr so that run-webkit-tests can capture it.
3020 This makes it easy to check whether test failures are due to unimplemented
3021 op codes, missing support for exceptions, etc.
3024 (KJS::CTI::privateCompile_pass1_Scan):
3025 (KJS::CTI::printOpcodeOperandTypes):
3026 (KJS::CTI::privateCompile_pass2_Main):
3027 (KJS::CTI::privateCompile_pass4_SlowCases):
3028 (KJS::CTI::privateCompile):
3030 (KJS::Machine::privateExecute):
3031 (KJS::ctiException):
3032 (KJS::ctiUnsupported):
3033 (KJS::Machine::cti_op_call):
3034 (KJS::Machine::cti_op_resolve):
3035 (KJS::Machine::cti_op_construct):
3036 (KJS::Machine::cti_op_get_by_val):
3037 (KJS::Machine::cti_op_resolve_func):
3038 (KJS::Machine::cti_op_resolve_skip):
3039 (KJS::Machine::cti_op_resolve_with_base):
3040 (KJS::Machine::cti_op_call_eval):
3042 2008-08-27 Mark Rowe <mrowe@apple.com>
3044 Reviewed by Gavin Barraclough and Maciej Stachowiak.
3046 Fix fast/js/bitwise-and-on-undefined.html.
3048 A temporary value in the slow path of op_bitand was being stored in edx, but was
3049 being clobbered by emitGetPutArg before we used it. To fix this, emitGetPutArg
3050 now takes a third argument that specifies the scratch register to use when loading
3051 from memory. This allows us to avoid clobbering the temporary in op_bitand.
3054 (KJS::CTI::emitGetPutArg):
3055 (KJS::CTI::privateCompile_pass2_Main):
3056 (KJS::CTI::privateCompile_pass4_SlowCases):
3059 2008-08-27 Mark Rowe <mrowe@apple.com>
3061 Rubber-stamped by Oliver Hunt.
3063 Switch CTI on by default.
3067 2008-08-27 Mark Rowe <mrowe@apple.com>
3069 Reviewed by Oliver Hunt.
3071 Fix the build of the full WebKit stack.
3073 * JavaScriptCore.xcodeproj/project.pbxproj: Mark two new headers as private so they can be pulled in from WebCore.
3074 * VM/CTI.h: Fix build issues that show up when compiled with GCC 4.2 as part of WebCore.
3075 * wrec/WREC.h: Ditto.
3077 2008-08-27 Mark Rowe <mrowe@apple.com>
3079 Reviewed by Sam Weinig.
3081 Implement op_new_error. Does not fix any tests as it is always followed by the unimplemented op_throw.
3084 (KJS::CTI::privateCompile_pass1_Scan):
3085 (KJS::CTI::privateCompile_pass2_Main):
3087 (KJS::Machine::cti_op_new_error):
3090 2008-08-27 Sam Weinig <sam@webkit.org>
3092 Reviewed by Gavin Barraclough and Geoff Garen.
3094 Implement op_put_getter and op_put_setter.
3097 (KJS::CTI::privateCompile_pass1_Scan):
3098 (KJS::CTI::privateCompile_pass2_Main):
3100 (KJS::Machine::cti_op_put_getter):
3101 (KJS::Machine::cti_op_put_setter):
3104 2008-08-27 Sam Weinig <sam@webkit.org>
3106 Reviewed by Gavin Barraclough and Geoff Garen.
3108 Implement op_del_by_val fixing 3 mozilla tests.
3111 (KJS::CTI::privateCompile_pass1_Scan):
3112 (KJS::CTI::privateCompile_pass2_Main):
3114 (KJS::Machine::cti_op_del_by_val):
3117 2008-08-27 Gavin Barraclough <barraclough@apple.com>
3119 Reviewed by Oliver Hunt.
3121 Quick & dirty fix to get SamplingTool sampling op_call.
3123 * VM/SamplingTool.h:
3124 (KJS::SamplingTool::callingHostFunction):
3126 2008-08-27 Sam Weinig <sam@webkit.org>
3128 Reviewed by Gavin Barraclough and Geoff Garen.
3130 Fix op_put_by_index.
3133 (KJS::CTI::privateCompile_pass2_Main): Use emitPutArgConstant instead of emitGetPutArg
3134 for the property value.
3136 (KJS::Machine::cti_op_put_by_index): Get the property value from the correct argument.
3138 2008-08-27 Sam Weinig <sam@webkit.org>
3140 Reviewed by Gavin Barraclough and Geoff Garen.
3142 Implement op_switch_imm in the CTI fixing 13 mozilla tests.
3145 (KJS::CTI::privateCompile_pass1_Scan):
3146 (KJS::CTI::privateCompile_pass2_Main):
3148 (KJS::Machine::cti_op_switch_imm):
3151 2008-08-27 Gavin Barraclough <barraclough@apple.com>
3153 Reviewed by Oliver Hunt.
3155 Implement op_switch_char in CTI.
3158 (KJS::CTI::emitCall):
3159 (KJS::CTI::privateCompile_pass1_Scan):
3160 (KJS::CTI::privateCompile_pass2_Main):
3161 (KJS::CTI::privateCompile):
3163 (KJS::CallRecord::CallRecord):
3164 (KJS::SwitchRecord::SwitchRecord):
3166 (KJS::SimpleJumpTable::SimpleJumpTable::ctiForValue):
3168 (KJS::Machine::cti_op_switch_char):
3170 * masm/IA32MacroAsm.h:
3171 (KJS::IA32MacroAssembler::):
3172 (KJS::IA32MacroAssembler::emitJmpN_r):
3173 (KJS::IA32MacroAssembler::getRelocatedAddress):
3176 2008-08-26 Sam Weinig <sam@webkit.org>
3178 Reviewed by Mark Rowe.
3180 Implement op_put_by_index to fix 1 mozilla test.
3183 (KJS::CTI::privateCompile_pass1_Scan):
3184 (KJS::CTI::privateCompile_pass2_Main):
3186 (KJS::Machine::cti_op_put_by_index):
3189 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3191 Reviewed by Geoff Garen.
3193 More fixes from Geoff's review.
3196 (KJS::CTI::emitGetArg):
3197 (KJS::CTI::emitGetPutArg):
3198 (KJS::CTI::emitPutArg):
3199 (KJS::CTI::emitPutArgConstant):
3200 (KJS::CTI::getConstantImmediateNumericArg):
3201 (KJS::CTI::emitGetCTIParam):
3202 (KJS::CTI::emitPutResult):
3203 (KJS::CTI::emitCall):
3204 (KJS::CTI::emitJumpSlowCaseIfNotImm):
3205 (KJS::CTI::emitJumpSlowCaseIfNotImms):
3206 (KJS::CTI::getDeTaggedConstantImmediate):
3207 (KJS::CTI::emitFastArithDeTagImmediate):
3208 (KJS::CTI::emitFastArithReTagImmediate):
3209 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
3210 (KJS::CTI::emitFastArithImmToInt):
3211 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
3212 (KJS::CTI::privateCompile_pass2_Main):
3213 (KJS::CTI::privateCompile_pass4_SlowCases):
3214 (KJS::CTI::privateCompile):
3217 2008-08-26 Mark Rowe <mrowe@apple.com>
3219 Reviewed by Gavin Barraclough and Geoff Garen.
3221 Implement op_jmp_scopes to fix 2 Mozilla tests.
3224 (KJS::CTI::privateCompile_pass1_Scan):
3225 (KJS::CTI::privateCompile_pass2_Main):
3227 (KJS::Machine::cti_op_push_new_scope): Update ExecState::m_scopeChain after calling ARG_setScopeChain.
3228 (KJS::Machine::cti_op_jmp_scopes):
3231 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3233 Reviewed by Oliver Hunt.
3235 WebKit Regular Expression Compiler. (set ENABLE_WREC = 1 in Platform.h).
3237 * JavaScriptCore.xcodeproj/project.pbxproj:
3241 * wrec/WREC.cpp: Added.
3242 * wrec/WREC.h: Added.
3245 2008-08-26 Sam Weinig <sam@webkit.org>
3247 Rubber-stamped by Oliver Hunt.
3249 Remove bogus assertion.
3252 (KJS::Machine::cti_op_del_by_id):
3254 2008-08-26 Mark Rowe <mrowe@apple.com>
3256 Reviewed by Sam Weinig.
3258 Implement op_push_new_scope and stub out op_catch. This fixes 11 Mozilla tests.
3261 (KJS::CTI::privateCompile_pass1_Scan):
3262 (KJS::CTI::privateCompile_pass2_Main):
3264 (KJS::Machine::cti_op_push_new_scope):
3265 (KJS::Machine::cti_op_catch):
3268 2008-08-26 Mark Rowe <mrowe@apple.com>
3270 Reviewed by Sam Weinig.
3272 Clean up op_resolve_base so that it shares its implementation with the bytecode interpreter.
3275 (KJS::inlineResolveBase):
3278 2008-08-26 Oliver Hunt <oliver@apple.com>
3280 Reviewed by Sam Weinig.
3282 Add codegen support for op_instanceof, fixing 15 mozilla tests.
3285 (KJS::CTI::privateCompile_pass1_Scan):
3286 (KJS::CTI::privateCompile_pass2_Main):
3288 (KJS::Machine::cti_op_instanceof):
3289 (KJS::Machine::cti_op_del_by_id):
3293 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3295 Reviewed by Geoff Garen.
3297 Fixes for initial review comments.
3300 (KJS::CTI::ctiCompileGetArg):
3301 (KJS::CTI::ctiCompileGetPutArg):
3302 (KJS::CTI::ctiCompilePutResult):
3303 (KJS::CTI::ctiCompileCall):
3305 (KJS::CTI::privateCompile_pass1_Scan):
3306 (KJS::CTI::printOpcodeOperandTypes):
3307 (KJS::CTI::privateCompile_pass2_Main):
3308 (KJS::CTI::privateCompile_pass4_SlowCases):
3309 (KJS::CTI::privateCompile):
3314 2008-08-26 Sam Weinig <sam@webkit.org>
3316 Reviewed by Gavin Barraclough and Geoff Garen.
3318 Fix up exception checking code.
3321 (KJS::Machine::cti_op_call):
3322 (KJS::Machine::cti_op_resolve):
3323 (KJS::Machine::cti_op_construct):
3324 (KJS::Machine::cti_op_resolve_func):
3325 (KJS::Machine::cti_op_resolve_skip):
3326 (KJS::Machine::cti_op_resolve_with_base):
3327 (KJS::Machine::cti_op_call_eval):
3329 2008-08-26 Sam Weinig <sam@webkit.org>
3331 Reviewed by Oliver Hunt.
3333 Fix slowcase for op_post_inc and op_post_dec fixing 2 mozilla tests.
3336 (KJS::CTI::privateCompile_pass4_SlowCases):
3338 2008-08-26 Mark Rowe <mrowe@apple.com>
3340 Reviewed by Sam Weinig.
3342 Implement op_in, fixing 8 mozilla tests.
3345 (KJS::CTI::privateCompile_pass1_Scan):
3346 (KJS::CTI::privateCompile_pass2_Main):
3348 (KJS::Machine::cti_op_in):
3351 2008-08-26 Mark Rowe <mrowe@apple.com>
3353 Rubber-stamped by Oliver Hunt.
3355 Don't hardcode the size of a Register for op_new_array. Fixes a crash
3356 seen during the Mozilla tests.
3359 (KJS::CTI::privateCompile_pass2_Main):
3361 2008-08-26 Sam Weinig <sam@webkit.org>
3363 Reviewed by Gavin Barraclough and Geoff Garen.
3365 Add support for op_push_scope and op_pop_scope, fixing 20 mozilla tests.
3368 (KJS::CTI::privateCompile_pass1_Scan):
3369 (KJS::CTI::privateCompile_pass2_Main):
3372 (KJS::Machine::cti_op_push_scope):
3373 (KJS::Machine::cti_op_pop_scope):
3376 2008-08-26 Oliver Hunt <oliver@apple.com>
3378 Reviewed by Maciej Stachowiak.
3380 Add codegen support for op_del_by_id, fixing 49 mozilla tests.
3383 (KJS::CTI::privateCompile_pass1_Scan):
3384 (KJS::CTI::privateCompile_pass2_Main):
3386 (KJS::Machine::cti_op_del_by_id):
3389 2008-08-26 Sam Weinig <sam@webkit.org>
3391 Reviewed by Gavin Barraclough and Geoff Garen.
3393 Don't hardcode the size of a Register for op_get_scoped_var and op_put_scoped_var
3394 fixing 513 mozilla tests in debug build.
3397 (KJS::CTI::privateCompile_pass2_Main):
3399 2008-08-26 Oliver Hunt <oliver@apple.com>
3401 Reviewed by Maciej Stachowiak.
3403 Added code generator support for op_loop, fixing around 60 mozilla tests.
3406 (KJS::CTI::privateCompile_pass1_Scan):
3407 (KJS::CTI::privateCompile_pass2_Main):
3409 2008-08-26 Mark Rowe <mrowe@apple.com>
3411 Reviewed by Sam Weinig.
3413 Set -fomit-frame-pointer in the correct location.
3415 * Configurations/JavaScriptCore.xcconfig:
3416 * JavaScriptCore.xcodeproj/project.pbxproj:
3418 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3420 Reviewed by Geoff Garen.
3422 Inital cut of CTI, Geoff's review fixes to follow.
3424 * JavaScriptCore.xcodeproj/project.pbxproj:
3425 * VM/CTI.cpp: Added.
3427 (KJS::CTI::ctiCompileGetArg):
3428 (KJS::CTI::ctiCompileGetPutArg):
3429 (KJS::CTI::ctiCompilePutArg):
3430 (KJS::CTI::ctiCompilePutArgImm):
3431 (KJS::CTI::ctiImmediateNumericArg):
3432 (KJS::CTI::ctiCompileGetCTIParam):
3433 (KJS::CTI::ctiCompilePutResult):
3434 (KJS::CTI::ctiCompileCall):
3435 (KJS::CTI::slowCaseIfNotImm):
3436 (KJS::CTI::slowCaseIfNotImms):
3437 (KJS::CTI::ctiFastArithDeTagConstImmediate):
3438 (KJS::CTI::ctiFastArithDeTagImmediate):
3439 (KJS::CTI::ctiFastArithReTagImmediate):
3440 (KJS::CTI::ctiFastArithPotentiallyReTagImmediate):
3441 (KJS::CTI::ctiFastArithImmToInt):
3442 (KJS::CTI::ctiFastArithIntToImmOrSlowCase):
3444 (KJS::CTI::privateCompile_pass1_Scan):
3445 (KJS::CTI::ctiCompileAdd):
3446 (KJS::CTI::ctiCompileAddImm):
3447 (KJS::CTI::ctiCompileAddImmNotInt):
3448 (KJS::CTI::TEMP_HACK_PRINT_TYPES):
3449 (KJS::CTI::privateCompile_pass2_Main):
3450 (KJS::CTI::privateCompile_pass3_Link):
3451 (KJS::CTI::privateCompile_pass4_SlowCases):
3452 (KJS::CTI::privateCompile):
3454 (KJS::CTI2Result::CTI2Result):
3455 (KJS::CallRecord::CallRecord):
3456 (KJS::JmpTable::JmpTable):
3457 (KJS::SlowCaseEntry::SlowCaseEntry):
3458 (KJS::CTI::compile):
3459 (KJS::CTI::LabelInfo::LabelInfo):
3461 (KJS::CodeBlock::CodeBlock):
3462 (KJS::CodeBlock::~CodeBlock):
3464 (KJS::Machine::execute):
3465 (KJS::Machine::privateExecute):
3466 (KJS::ctiException):
3467 (KJS::ctiUnsupported):
3469 (KJS::Machine::cti_op_end):
3470 (KJS::Machine::cti_op_add):
3471 (KJS::Machine::cti_op_pre_inc):
3472 (KJS::Machine::cti_timeout_check):
3473 (KJS::Machine::cti_op_loop_if_less):
3474 (KJS::Machine::cti_op_new_object):
3475 (KJS::Machine::cti_op_put_by_id):
3476 (KJS::Machine::cti_op_get_by_id):
3477 (KJS::Machine::cti_op_mul):
3478 (KJS::Machine::cti_op_new_func):
3479 (KJS::Machine::cti_op_call):
3480 (KJS::Machine::cti_op_ret):
3481 (KJS::Machine::cti_op_new_array):
3482 (KJS::Machine::cti_op_resolve):
3483 (KJS::Machine::cti_op_construct):
3484 (KJS::Machine::cti_op_get_by_val):
3485 (KJS::Machine::cti_op_resolve_func):
3486 (KJS::Machine::cti_op_sub):
3487 (KJS::Machine::cti_op_put_by_val):
3488 (KJS::Machine::cti_op_lesseq):
3489 (KJS::Machine::cti_op_loop_if_true):
3490 (KJS::Machine::cti_op_negate):
3491 (KJS::Machine::cti_op_resolve_base):
3492 (KJS::Machine::cti_op_resolve_skip):
3493 (KJS::Machine::cti_op_div):
3494 (KJS::Machine::cti_op_pre_dec):
3495 (KJS::Machine::cti_op_jless):
3496 (KJS::Machine::cti_op_not):
3497 (KJS::Machine::cti_op_jtrue):
3498 (KJS::Machine::cti_op_post_inc):
3499 (KJS::Machine::cti_op_eq):
3500 (KJS::Machine::cti_op_lshift):
3501 (KJS::Machine::cti_op_bitand):
3502 (KJS::Machine::cti_op_rshift):
3503 (KJS::Machine::cti_op_bitnot):
3504 (KJS::Machine::cti_op_resolve_with_base):
3505 (KJS::Machine::cti_op_new_func_exp):
3506 (KJS::Machine::cti_op_mod):
3507 (KJS::Machine::cti_op_less):
3508 (KJS::Machine::cti_op_neq):
3509 (KJS::Machine::cti_op_post_dec):
3510 (KJS::Machine::cti_op_urshift):
3511 (KJS::Machine::cti_op_bitxor):
3512 (KJS::Machine::cti_op_new_regexp):
3513 (KJS::Machine::cti_op_bitor):
3514 (KJS::Machine::cti_op_call_eval):
3515 (KJS::Machine::cti_op_throw):
3516 (KJS::Machine::cti_op_get_pnames):
3517 (KJS::Machine::cti_op_next_pname):
3518 (KJS::Machine::cti_op_typeof):
3519 (KJS::Machine::cti_op_stricteq):
3520 (KJS::Machine::cti_op_nstricteq):
3521 (KJS::Machine::cti_op_to_jsnumber):
3524 (KJS::Register::jsValue):
3525 (KJS::Register::getJSValue):
3526 (KJS::Register::codeBlock):
3527 (KJS::Register::scopeChain):
3530 (KJS::Register::vPC):
3531 (KJS::Register::jsPropertyNameIterator):
3532 * VM/SamplingTool.cpp:
3534 (KJS::SamplingTool::run):
3535 (KJS::SamplingTool::dump):
3536 * VM/SamplingTool.h:
3537 * kjs/JSImmediate.h:
3538 (KJS::JSImmediate::zeroImmediate):
3539 (KJS::JSImmediate::oneImmediate):
3541 * kjs/JSVariableObject.h:
3542 (KJS::JSVariableObject::JSVariableObjectData::offsetOf_registers):
3543 (KJS::JSVariableObject::offsetOf_d):
3544 (KJS::JSVariableObject::offsetOf_Data_registers):
3546 * masm/IA32MacroAsm.h: Added.
3547 (KJS::JITCodeBuffer::JITCodeBuffer):
3548 (KJS::JITCodeBuffer::putByte):
3549 (KJS::JITCodeBuffer::putShort):
3550 (KJS::JITCodeBuffer::putInt):
3551 (KJS::JITCodeBuffer::getEIP):
3552 (KJS::JITCodeBuffer::start):
3553 (KJS::JITCodeBuffer::getOffset):
3554 (KJS::JITCodeBuffer::reset):
3555 (KJS::JITCodeBuffer::copy):
3556 (KJS::IA32MacroAssembler::):
3557 (KJS::IA32MacroAssembler::emitModRm_rr):
3558 (KJS::IA32MacroAssembler::emitModRm_rm):
3559 (KJS::IA32MacroAssembler::emitModRm_rmsib):
3560 (KJS::IA32MacroAssembler::emitModRm_opr):
3561 (KJS::IA32MacroAssembler::emitModRm_opm):
3562 (KJS::IA32MacroAssembler::IA32MacroAssembler):
3563 (KJS::IA32MacroAssembler::emitInt3):
3564 (KJS::IA32MacroAssembler::emitPushl_r):
3565 (KJS::IA32MacroAssembler::emitPopl_r):
3566 (KJS::IA32MacroAssembler::emitMovl_rr):
3567 (KJS::IA32MacroAssembler::emitAddl_rr):
3568 (KJS::IA32MacroAssembler::emitAddl_i8r):
3569 (KJS::IA32MacroAssembler::emitAddl_i32r):
3570 (KJS::IA32MacroAssembler::emitAddl_mr):
3571 (KJS::IA32MacroAssembler::emitAndl_rr):
3572 (KJS::IA32MacroAssembler::emitAndl_i32r):
3573 (KJS::IA32MacroAssembler::emitCmpl_i8r):
3574 (KJS::IA32MacroAssembler::emitCmpl_rr):
3575 (KJS::IA32MacroAssembler::emitCmpl_rm):
3576 (KJS::IA32MacroAssembler::emitCmpl_i32r):
3577 (KJS::IA32MacroAssembler::emitCmpw_rm):
3578 (KJS::IA32MacroAssembler::emitOrl_rr):
3579 (KJS::IA32MacroAssembler::emitOrl_i8r):
3580 (KJS::IA32MacroAssembler::emitSubl_rr):
3581 (KJS::IA32MacroAssembler::emitSubl_i8r):
3582 (KJS::IA32MacroAssembler::emitSubl_i32r):
3583 (KJS::IA32MacroAssembler::emitSubl_mr):
3584 (KJS::IA32MacroAssembler::emitTestl_i32r):
3585 (KJS::IA32MacroAssembler::emitTestl_rr):
3586 (KJS::IA32MacroAssembler::emitXorl_i8r):
3587 (KJS::IA32MacroAssembler::emitXorl_rr):
3588 (KJS::IA32MacroAssembler::emitSarl_i8r):
3589 (KJS::IA32MacroAssembler::emitSarl_CLr):
3590 (KJS::IA32MacroAssembler::emitShl_i8r):
3591 (KJS::IA32MacroAssembler::emitShll_CLr):
3592 (KJS::IA32MacroAssembler::emitMull_rr):
3593 (KJS::IA32MacroAssembler::emitIdivl_r):
3594 (KJS::IA32MacroAssembler::emitCdq):
3595 (KJS::IA32MacroAssembler::emitMovl_mr):
3596 (KJS::IA32MacroAssembler::emitMovzwl_mr):
3597 (KJS::IA32MacroAssembler::emitMovl_rm):
3598 (KJS::IA32MacroAssembler::emitMovl_i32r):
3599 (KJS::IA32MacroAssembler::emitMovl_i32m):
3600 (KJS::IA32MacroAssembler::emitLeal_mr):
3601 (KJS::IA32MacroAssembler::emitRet):
3602 (KJS::IA32MacroAssembler::JmpSrc::JmpSrc):