1 2008-09-15 Oliver Hunt <oliver@apple.com>
8 (JSC::Machine::privateExecute):
10 2008-09-15 Oliver Hunt <oliver@apple.com>
12 Reviewed by Cameron Zwarich.
14 Bug 20874: op_resolve does not do any form of caching
15 <https://bugs.webkit.org/show_bug.cgi?id=20874>
17 This patch adds an op_resolve_global opcode to handle (and cache)
18 property lookup we can statically determine must occur on the global
21 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
22 10% in math-partial-sums
25 (JSC::CTI::privateCompileMainPass):
28 (JSC::CodeBlock::dump):
29 * VM/CodeGenerator.cpp:
30 (JSC::CodeGenerator::findScopedProperty):
31 (JSC::CodeGenerator::emitResolve):
34 (JSC::Machine::privateExecute):
35 (JSC::Machine::cti_op_resolve_global):
39 2008-09-15 Sam Weinig <sam@webkit.org>
42 Roll out r36462. It broke document.all.
45 (JSC::CTI::privateCompileMainPass):
46 (JSC::CTI::privateCompileSlowCases):
49 (JSC::Machine::Machine):
50 (JSC::Machine::cti_op_eq_null):
51 (JSC::Machine::cti_op_neq_null):
53 (JSC::Machine::isJSString):
55 * kjs/JSWrapperObject.h:
57 * kjs/StringObjectThatMasqueradesAsUndefined.h:
59 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
61 Reviewed by Maciej Stachowiak.
63 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
64 <https://bugs.webkit.org/show_bug.cgi?id=20863>
66 r36427 changed the number of arguments to op_construct without changing
67 the argument index for the vPC in the call to initializeCallFrame() in
68 the CTI case. This caused a JSC test failure. Correcting the argument
69 index fixes the test failure.
72 (JSC::Machine::cti_op_construct_JSConstruct):
74 2008-09-15 Mark Rowe <mrowe@apple.com>
80 2008-09-15 Geoffrey Garen <ggaren@apple.com>
82 Reviewed by Maciej Stachowiak.
84 Fixed a typo in op_get_by_id_chain that caused it to miss every time
87 Also, a little cleanup.
90 (JSC::Machine::privateExecute): Set up baseObject before entering the
91 loop, so we compare against the right values.
93 2008-09-15 Geoffrey Garen <ggaren@apple.com>
95 Reviewed by Sam Weinig.
97 Removed the CalledAsConstructor flag from the call frame header. Now,
98 we use an explicit opcode at the call site to fix up constructor results.
100 SunSpider says 0.4% faster.
102 cti_op_construct_verify is an out-of-line function call for now, but we
103 can fix that once StructureID holds type information like isObject.
106 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
109 (JSC::CodeBlock::dump):
111 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
112 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
113 (JSC::CodeGenerator::emitConstruct): ... ditto.
115 * VM/Machine.cpp: No more CalledAsConstructor
116 (JSC::Machine::privateExecute): Implementation for the new opcode.
117 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
118 called as a constructor.
119 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
122 * VM/Opcode.h: Declare new opcode.
125 (JSC::RegisterFile::): No more CalledAsConstructor
127 2008-09-15 Gavin Barraclough <barraclough@apple.com>
129 Reviewed by Geoff Garen.
131 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
132 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
133 masquerading may be handled differently (through the StructureIDs - see bug
139 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
140 (JSC::CTI::privateCompileMainPass):
141 (JSC::CTI::privateCompileSlowCases):
144 (JSC::Machine::Machine):
145 (JSC::Machine::cti_op_eq_null):
146 (JSC::Machine::cti_op_neq_null):
148 (JSC::Machine::doesMasqueradesAsUndefined):
149 * kjs/JSWrapperObject.h:
150 (JSC::JSWrapperObject::):
151 (JSC::JSWrapperObject::JSWrapperObject):
152 * kjs/StringObject.h:
153 (JSC::StringObject::StringObject):
154 * kjs/StringObjectThatMasqueradesAsUndefined.h:
155 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
157 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
159 Rubber-stamped by Oliver Hunt.
161 r36427 broke CodeBlock::dump() by changing the number of arguments to
162 op_construct without changing the code that prints it. This patch fixes
163 it by printing the additional argument.
165 * JavaScriptCore.xcodeproj/project.pbxproj:
167 (JSC::CodeBlock::dump):
169 2008-09-15 Adam Roben <aroben@apple.com>
173 * kjs/StructureID.cpp: Removed a stray semicolon.
175 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
177 Reviewed by Maciej Stachowiak.
179 Fix a crash in fast/js/exception-expression-offset.html caused by not
180 updating all mentions of the length of op_construct in r36427.
183 (JSC::Machine::cti_op_construct_NotJSConstruct):
185 2008-09-15 Maciej Stachowiak <mjs@apple.com>
187 Reviewed by Cameron Zwarich.
189 - fix layout test failure introduced by fix for 20849
191 (The failing test was fast/js/delete-then-put.html)
194 (JSC::JSObject::removeDirect): Clear enumeration cache
195 in the dictionary case.
197 (JSC::JSObject::putDirect): Ditto.
199 (JSC::StructureID::clearEnumerationCache): Inline to handle the
202 2008-09-15 Maciej Stachowiak <mjs@apple.com>
204 Reviewed by Cameron Zwarich.
206 - fix JSC test failures introduced by fix for 20849
208 * kjs/PropertyMap.cpp:
209 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
211 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
213 Reviewed by Maciej Stachowiak.
215 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
216 <https://bugs.webkit.org/show_bug.cgi?id=20851>
218 r36410 introduced an optimization for parseInt() that is incorrect when
219 its argument is larger than the range of a 32-bit integer. If the
220 argument is a number that is not an immediate integer, then the correct
221 behaviour is to return the floor of its value, unless it is an infinite
222 value, in which case the correct behaviour is to return 0.
224 * kjs/JSGlobalObjectFunctions.cpp:
225 (JSC::globalFuncParseInt):
227 2008-09-15 Sam Weinig <sam@webkit.org>
229 Reviewed by Maciej Stachowiak.
231 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
232 Cache property names for getEnumerablePropertyNames in the StructureID.
234 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
235 on the v8 test suite.
238 (JSC::JSObject::getPropertyNames):
239 * kjs/PropertyMap.cpp:
240 (JSC::PropertyMap::getEnumerablePropertyNames):
242 * kjs/StructureID.cpp:
243 (JSC::StructureID::StructureID):
244 (JSC::StructureID::getEnumerablePropertyNames):
247 2008-09-14 Maciej Stachowiak <mjs@apple.com>
249 Reviewed by Cameron Zwarich.
251 - speed up JS construction by extracting "prototype" lookup so PIC applies.
253 ~0.5% speedup on SunSpider
254 Speeds up some of the V8 tests as well, most notably earley-boyer.
257 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
258 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
259 * VM/CodeGenerator.cpp:
260 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
262 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
263 (JSC::Machine::cti_op_construct_JSConstruct): ditto
264 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
266 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
268 Reviewed by Eric Seidel.
270 Add a protected destructor for RefCounted.
272 It is wrong to call its destructor directly, because (1) this should be taken care of by
273 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
275 No change in behavior.
277 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
279 2008-09-14 Gavin Barraclough <barraclough@apple.com>
281 Reviewed by Sam Weinig.
283 Accelerated property accesses.
285 Inline more of the array access code into the JIT code for get/put_by_val.
286 Accelerate get/put_by_id by speculatively inlining a disable direct access
287 into the hot path of the code, and repatch this with the correct StructureID
288 and property map offset once these are known. In the case of accesses to the
289 prototype and reading the array-length a trampoline is genertaed, and the
290 branch to the slow-case is relinked to jump to this.
292 By repatching, we mean rewriting the x86 instruction stream. Instructions are
293 only modified in a simple fasion - altering immediate operands, memory access
294 deisplacements, and branch offsets.
296 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
297 instruction's immediate operant is updateded, and a memory access operation's
298 displacement is updated to access the correct field on the object. In the case
299 of more complex accesses (array length and get_by_id_prototype) the offset on
300 the branch to slow-case is updated, to now jump to a trampoline.
302 +2.8% sunspider, +13% v8-tests
305 (JSC::CTI::emitCall):
306 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
308 (JSC::CTI::privateCompileMainPass):
309 (JSC::CTI::privateCompileSlowCases):
310 (JSC::CTI::privateCompile):
311 (JSC::CTI::privateCompileGetByIdSelf):
312 (JSC::CTI::privateCompileGetByIdProto):
313 (JSC::CTI::privateCompileGetByIdChain):
314 (JSC::CTI::privateCompilePutByIdReplace):
315 (JSC::CTI::privateCompilePutByIdTransition):
316 (JSC::CTI::privateCompileArrayLengthTrampoline):
317 (JSC::CTI::privateCompileStringLengthTrampoline):
318 (JSC::CTI::patchGetByIdSelf):
319 (JSC::CTI::patchPutByIdReplace):
320 (JSC::CTI::privateCompilePatchGetArrayLength):
321 (JSC::CTI::privateCompilePatchGetStringLength):
323 (JSC::CTI::compileGetByIdSelf):
324 (JSC::CTI::compileGetByIdProto):
325 (JSC::CTI::compileGetByIdChain):
326 (JSC::CTI::compilePutByIdReplace):
327 (JSC::CTI::compilePutByIdTransition):
328 (JSC::CTI::compileArrayLengthTrampoline):
329 (JSC::CTI::compileStringLengthTrampoline):
330 (JSC::CTI::compilePatchGetArrayLength):
331 (JSC::CTI::compilePatchGetStringLength):
333 (JSC::CodeBlock::dump):
334 (JSC::CodeBlock::~CodeBlock):
336 (JSC::StructureStubInfo::StructureStubInfo):
337 (JSC::CodeBlock::getStubInfo):
339 (JSC::Machine::tryCTICachePutByID):
340 (JSC::Machine::tryCTICacheGetByID):
341 (JSC::Machine::cti_op_put_by_val_array):
343 * masm/X86Assembler.h:
344 (JSC::X86Assembler::):
345 (JSC::X86Assembler::cmpl_i8m):
346 (JSC::X86Assembler::emitUnlinkedJa):
347 (JSC::X86Assembler::getRelocatedAddress):
348 (JSC::X86Assembler::getDifferenceBetweenLabels):
349 (JSC::X86Assembler::emitModRm_opmsib):
351 2008-09-14 Maciej Stachowiak <mjs@apple.com>
353 Reviewed by Cameron Zwarich.
355 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
357 ~5% speedup on v8 earley-boyer test
359 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
360 * API/JSCallbackObjectFunctions.h:
361 (JSC::::hasInstance): Ditto.
362 * API/JSValueRef.cpp:
363 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
364 * JavaScriptCore.exp:
366 (JSC::CTI::privateCompileMainPass): Pass along prototype.
368 (JSC::CodeBlock::dump): Print third arg.
369 * VM/CodeGenerator.cpp:
370 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
372 * VM/CodeGenerator.h:
374 (JSC::Machine::privateExecute): Pass along the prototype.
375 (JSC::Machine::cti_op_instanceof): ditto
377 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
380 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
381 property and pass that register to instanceof.
384 2008-09-14 Gavin Barraclough <barraclough@apple.com>
386 Reviewed by Sam Weinig.
388 Remove unnecessary virtual function call from cti_op_call_JSFunction -
389 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
392 (JSC::Machine::cti_op_call_JSFunction):
394 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
396 Reviewed by Maciej Stachowiak.
398 Bug 20827: the 'typeof' operator is slow
399 <https://bugs.webkit.org/show_bug.cgi?id=20827>
401 Optimize the 'typeof' operator when its result is compared to a constant
404 This is a 5.5% speedup on the V8 Earley-Boyer test.
407 (JSC::CTI::privateCompileMainPass):
409 (JSC::CodeBlock::dump):
410 * VM/CodeGenerator.cpp:
411 (JSC::CodeGenerator::emitEqualityOp):
412 * VM/CodeGenerator.h:
414 (JSC::jsIsObjectType):
415 (JSC::jsIsFunctionType):
416 (JSC::Machine::privateExecute):
417 (JSC::Machine::cti_op_is_undefined):
418 (JSC::Machine::cti_op_is_boolean):
419 (JSC::Machine::cti_op_is_number):
420 (JSC::Machine::cti_op_is_string):
421 (JSC::Machine::cti_op_is_object):
422 (JSC::Machine::cti_op_is_function):
426 (JSC::BinaryOpNode::emitCode):
427 (JSC::EqualNode::emitCode):
428 (JSC::StrictEqualNode::emitCode):
431 2008-09-14 Sam Weinig <sam@webkit.org>
433 Reviewed by Cameron Zwarich.
435 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
436 Speed up parseInt for numbers
438 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
439 No change on the v8 suite.
441 * kjs/JSGlobalObjectFunctions.cpp:
442 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
443 convert them back to numbers.
445 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
447 Reviewed by Oliver Hunt.
449 Bug 20816: op_lesseq should be optimized
450 <https://bugs.webkit.org/show_bug.cgi?id=20816>
452 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
454 This is a 9.4% speedup on the V8 Crypto benchmark.
457 (JSC::CTI::privateCompileMainPass):
458 (JSC::CTI::privateCompileSlowCases):
460 (JSC::CodeBlock::dump):
461 * VM/CodeGenerator.cpp:
462 (JSC::CodeGenerator::emitJumpIfTrue):
464 (JSC::Machine::privateExecute):
465 (JSC::Machine::cti_op_loop_if_lesseq):
469 2008-09-14 Sam Weinig <sam@webkit.org>
471 Reviewed by Cameron Zwarich.
473 Cleanup Sampling code.
476 (JSC::CTI::emitCall):
477 (JSC::CTI::privateCompileMainPass):
480 * VM/SamplingTool.cpp:
482 (JSC::SamplingTool::run):
483 (JSC::SamplingTool::dump):
485 (JSC::SamplingTool::callingHostFunction):
487 2008-09-13 Oliver Hunt <oliver@apple.com>
489 Reviewed by Cameron Zwarich.
491 Bug 20821: Cache property transitions to speed up object initialization
492 https://bugs.webkit.org/show_bug.cgi?id=20821
494 Implement a transition cache to improve the performance of new properties
495 being added to objects. This is extremely beneficial in constructors and
496 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
500 (JSC::CTI::privateCompileMainPass):
502 (JSC::transitionWillNeedStorageRealloc):
503 (JSC::CTI::privateCompilePutByIdTransition):
505 (JSC::CTI::compilePutByIdTransition):
507 (JSC::printPutByIdOp):
508 (JSC::CodeBlock::printStructureIDs):
509 (JSC::CodeBlock::dump):
510 (JSC::CodeBlock::derefStructureIDs):
511 (JSC::CodeBlock::refStructureIDs):
512 * VM/CodeGenerator.cpp:
513 (JSC::CodeGenerator::emitPutById):
515 (JSC::cachePrototypeChain):
516 (JSC::Machine::tryCachePutByID):
517 (JSC::Machine::tryCacheGetByID):
518 (JSC::Machine::privateExecute):
519 (JSC::Machine::tryCTICachePutByID):
520 (JSC::Machine::tryCTICacheGetByID):
524 (JSC::JSObject::putDirect):
525 (JSC::JSObject::transitionTo):
526 * kjs/PutPropertySlot.h:
527 (JSC::PutPropertySlot::PutPropertySlot):
528 (JSC::PutPropertySlot::wasTransition):
529 (JSC::PutPropertySlot::setWasTransition):
530 * kjs/StructureID.cpp:
531 (JSC::StructureID::transitionTo):
532 (JSC::StructureIDChain::StructureIDChain):
534 (JSC::StructureID::previousID):
535 (JSC::StructureID::setCachedPrototypeChain):
536 (JSC::StructureID::cachedPrototypeChain):
537 (JSC::StructureID::propertyMap):
538 * masm/X86Assembler.h:
539 (JSC::X86Assembler::addl_i8m):
540 (JSC::X86Assembler::subl_i8m):
542 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
544 Reviewed by Maciej Stachowiak.
546 Bug 20819: JSValue::isObject() is slow
547 <https://bugs.webkit.org/show_bug.cgi?id=20819>
549 Optimize JSCell::isObject() and JSCell::isString() by making them
550 non-virtual calls that rely on the StructureID type information.
552 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
555 * JavaScriptCore.exp:
558 (JSC::JSCell::isObject):
559 (JSC::JSCell::isString):
564 (JSC::JSString::JSString):
566 (JSC::StructureID::type):
568 2008-09-11 Stephanie Lewis <slewis@apple.com>
570 Reviewed by Oliver Hunt.
572 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
573 crash on CNN and on Dromaeo.
574 Fix Missing close tag in vcproj.
576 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
578 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
582 Correct an SVN problem with the last commit and actually add the new
585 * wrec/CharacterClassConstructor.cpp: Added.
587 (JSC::getCharacterClassNewline):
588 (JSC::getCharacterClassDigits):
589 (JSC::getCharacterClassSpaces):
590 (JSC::getCharacterClassWordchar):
591 (JSC::getCharacterClassNondigits):
592 (JSC::getCharacterClassNonspaces):
593 (JSC::getCharacterClassNonwordchar):
594 (JSC::CharacterClassConstructor::addSorted):
595 (JSC::CharacterClassConstructor::addSortedRange):
596 (JSC::CharacterClassConstructor::put):
597 (JSC::CharacterClassConstructor::flush):
598 (JSC::CharacterClassConstructor::append):
599 * wrec/CharacterClassConstructor.h: Added.
600 (JSC::CharacterClassConstructor::CharacterClassConstructor):
601 (JSC::CharacterClassConstructor::isUpsideDown):
602 (JSC::CharacterClassConstructor::charClass):
604 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
606 Reviewed by Maciej Stachowiak.
608 Bug 20788: Split CharacterClassConstructor into its own file
609 <https://bugs.webkit.org/show_bug.cgi?id=20788>
611 Split CharacterClassConstructor into its own file and clean up some
614 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
615 * JavaScriptCore.xcodeproj/project.pbxproj:
616 * wrec/CharacterClassConstructor.cpp: Added.
618 (JSC::getCharacterClassNewline):
619 (JSC::getCharacterClassDigits):
620 (JSC::getCharacterClassSpaces):
621 (JSC::getCharacterClassWordchar):
622 (JSC::getCharacterClassNondigits):
623 (JSC::getCharacterClassNonspaces):
624 (JSC::getCharacterClassNonwordchar):
625 (JSC::CharacterClassConstructor::addSorted):
626 (JSC::CharacterClassConstructor::addSortedRange):
627 (JSC::CharacterClassConstructor::put):
628 (JSC::CharacterClassConstructor::flush):
629 (JSC::CharacterClassConstructor::append):
630 * wrec/CharacterClassConstructor.h: Added.
631 (JSC::CharacterClassConstructor::CharacterClassConstructor):
632 (JSC::CharacterClassConstructor::isUpsideDown):
633 (JSC::CharacterClassConstructor::charClass):
635 (JSC::WRECParser::parseCharacterClass):
637 2008-09-10 Simon Hausmann <hausmann@webkit.org>
639 Not reviewed but trivial one-liner for yet unused macro.
641 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
643 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
647 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
649 Rubber-stamped by Oliver Hunt.
651 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
655 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
656 * masm/X86Assembler.h:
657 (JSC::X86Assembler::orl_i32r):
659 (JSC::WRECGenerator::generatePatternCharacter):
660 (JSC::WRECGenerator::generateCharacterClassInverted):
662 2008-09-10 Sam Weinig <sam@webkit.org>
664 Reviewed by Geoff Garen.
666 Add inline property storage for JSObject.
668 1.2% progression on Sunspider. .5% progression on the v8 test suite.
670 * JavaScriptCore.exp:
672 (JSC::CTI::privateCompileGetByIdProto):
673 (JSC::CTI::privateCompileGetByIdChain):
675 (JSC::JSObject::mark): There is no reason to check storageSize now that
677 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
679 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
680 now so there is no reason to .get()
681 (JSC::JSObject::usingInlineStorage):
682 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
684 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
686 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
687 we know that we are about to add a property that will overflow the inline
689 * kjs/PropertyMap.cpp:
690 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
691 now handled by JSObject.
692 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
694 (JSC::PropertyMap::storageSize): Rename from markingCount.
695 * kjs/StructureID.cpp:
696 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
697 if we are using inline storage.
700 2008-09-10 Oliver Hunt <oliver@apple.com>
702 Reviewed by Geoff Garen.
704 Inline immediate number version of op_mul.
706 Renamed mull_rr to imull_rr as that's what it's
707 actually doing, and added imull_i32r for the constant
708 case immediate multiply.
710 1.1% improvement to SunSpider.
713 (JSC::CTI::privateCompileMainPass):
714 (JSC::CTI::privateCompileSlowCases):
715 * masm/X86Assembler.h:
716 (JSC::X86Assembler::):
717 (JSC::X86Assembler::imull_rr):
718 (JSC::X86Assembler::imull_i32r):
720 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
726 * JavaScriptCore.xcodeproj/project.pbxproj:
728 2008-09-09 Oliver Hunt <oliver@apple.com>
730 Reviewed by Maciej Stachowiak.
732 Add optimised access to known properties on the global object.
734 Improve cross scope access to the global object by emitting
735 code to access it directly rather than by walking the scope chain.
737 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
740 (JSC::CTI::privateCompileMainPass):
741 (JSC::CTI::emitGetVariableObjectRegister):
742 (JSC::CTI::emitPutVariableObjectRegister):
745 (JSC::CodeBlock::dump):
746 * VM/CodeGenerator.cpp:
747 (JSC::CodeGenerator::findScopedProperty):
748 (JSC::CodeGenerator::emitResolve):
749 (JSC::CodeGenerator::emitGetScopedVar):
750 (JSC::CodeGenerator::emitPutScopedVar):
751 * VM/CodeGenerator.h:
753 (JSC::Machine::privateExecute):
756 (JSC::FunctionCallResolveNode::emitCode):
757 (JSC::PostfixResolveNode::emitCode):
758 (JSC::PrefixResolveNode::emitCode):
759 (JSC::ReadModifyResolveNode::emitCode):
760 (JSC::AssignResolveNode::emitCode):
762 2008-09-10 Maciej Stachowiak <mjs@apple.com>
766 - enable polymorphic inline caching of properties of primitives
768 1.012x speedup on SunSpider.
770 We create special structure IDs for JSString and
771 JSNumberCell. Unlike normal structure IDs, these cannot hold the
772 true prototype. Due to JS autoboxing semantics, the prototype used
773 when looking up string or number properties depends on the lexical
774 global object of the call site, not the creation site. Thus we
775 enable StructureIDs to handle this quirk for primitives.
777 Everything else should be straightforward.
780 (JSC::CTI::privateCompileGetByIdProto):
781 (JSC::CTI::privateCompileGetByIdChain):
783 (JSC::CTI::compileGetByIdProto):
784 (JSC::CTI::compileGetByIdChain):
785 * VM/JSPropertyNameIterator.h:
786 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
788 (JSC::Machine::Machine):
789 (JSC::cachePrototypeChain):
790 (JSC::Machine::tryCachePutByID):
791 (JSC::Machine::tryCacheGetByID):
792 (JSC::Machine::privateExecute):
793 (JSC::Machine::tryCTICachePutByID):
794 (JSC::Machine::tryCTICacheGetByID):
795 * kjs/GetterSetter.h:
796 (JSC::GetterSetter::GetterSetter):
798 * kjs/JSGlobalData.cpp:
799 (JSC::JSGlobalData::JSGlobalData):
800 * kjs/JSGlobalData.h:
801 * kjs/JSGlobalObject.h:
802 (JSC::StructureID::prototypeForLookup):
803 * kjs/JSNumberCell.h:
804 (JSC::JSNumberCell::JSNumberCell):
807 (JSC::JSObject::prototype):
811 (JSC::jsOwnedString):
813 (JSC::JSString::JSString):
815 (JSC::jsSingleCharacterString):
816 (JSC::jsSingleCharacterSubstring):
817 (JSC::jsNontrivialString):
818 * kjs/SmallStrings.cpp:
819 (JSC::SmallStrings::createEmptyString):
820 (JSC::SmallStrings::createSingleCharacterString):
821 * kjs/StructureID.cpp:
822 (JSC::StructureID::StructureID):
823 (JSC::StructureID::addPropertyTransition):
824 (JSC::StructureID::getterSetterTransition):
825 (JSC::StructureIDChain::StructureIDChain):
827 (JSC::StructureID::create):
828 (JSC::StructureID::storedPrototype):
830 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
832 Reviewed by Sam Weinig.
834 https://bugs.webkit.org/show_bug.cgi?id=20746
836 Added WINCE platform macro.
840 2008-09-09 Sam Weinig <sam@webkit.org>
842 Reviewed by Mark Rowe.
844 Remove unnecessary override of getOffset.
846 Sunspider reports this as a .6% progression.
848 * JavaScriptCore.exp:
850 (JSC::JSObject::getDirectLocation):
851 (JSC::JSObject::getOwnPropertySlotForWrite):
852 (JSC::JSObject::putDirect):
853 * kjs/PropertyMap.cpp:
856 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
858 Reviewed by Maciej Stachowiak.
860 Bug 20759: Remove MacroAssembler
861 <https://bugs.webkit.org/show_bug.cgi?id=20759>
863 Remove MacroAssembler and move its functionality to X86Assembler.
865 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
866 * JavaScriptCore.xcodeproj/project.pbxproj:
868 (JSC::CTI::emitGetArg):
869 (JSC::CTI::emitGetPutArg):
870 (JSC::CTI::emitPutArg):
871 (JSC::CTI::emitPutCTIParam):
872 (JSC::CTI::emitGetCTIParam):
873 (JSC::CTI::emitPutToCallFrameHeader):
874 (JSC::CTI::emitGetFromCallFrameHeader):
875 (JSC::CTI::emitPutResult):
876 (JSC::CTI::emitDebugExceptionCheck):
877 (JSC::CTI::emitJumpSlowCaseIfNotImm):
878 (JSC::CTI::emitJumpSlowCaseIfNotImms):
879 (JSC::CTI::emitFastArithDeTagImmediate):
880 (JSC::CTI::emitFastArithReTagImmediate):
881 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
882 (JSC::CTI::emitFastArithImmToInt):
883 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
884 (JSC::CTI::emitFastArithIntToImmNoCheck):
885 (JSC::CTI::compileOpCall):
886 (JSC::CTI::emitSlowScriptCheck):
887 (JSC::CTI::privateCompileMainPass):
888 (JSC::CTI::privateCompileSlowCases):
889 (JSC::CTI::privateCompile):
890 (JSC::CTI::privateCompileGetByIdSelf):
891 (JSC::CTI::privateCompileGetByIdProto):
892 (JSC::CTI::privateCompileGetByIdChain):
893 (JSC::CTI::privateCompilePutByIdReplace):
894 (JSC::CTI::privateArrayLengthTrampoline):
895 (JSC::CTI::privateStringLengthTrampoline):
896 (JSC::CTI::compileRegExp):
898 (JSC::CallRecord::CallRecord):
899 (JSC::JmpTable::JmpTable):
900 (JSC::SlowCaseEntry::SlowCaseEntry):
901 (JSC::CTI::JSRInfo::JSRInfo):
902 * masm/MacroAssembler.h: Removed.
903 * masm/MacroAssemblerWin.cpp: Removed.
904 * masm/X86Assembler.h:
905 (JSC::X86Assembler::emitConvertToFastCall):
906 (JSC::X86Assembler::emitRestoreArgumentReference):
908 (JSC::WRECGenerator::WRECGenerator):
909 (JSC::WRECParser::WRECParser):
911 2008-09-09 Sam Weinig <sam@webkit.org>
913 Reviewed by Cameron Zwarich.
915 Don't waste the first item in the PropertyStorage.
917 - Fix typo (makingCount -> markingCount)
918 - Remove undefined method declaration.
920 No change on Sunspider.
923 (JSC::JSObject::mark):
924 * kjs/PropertyMap.cpp:
925 (JSC::PropertyMap::put):
926 (JSC::PropertyMap::remove):
927 (JSC::PropertyMap::getOffset):
928 (JSC::PropertyMap::insert):
929 (JSC::PropertyMap::rehash):
930 (JSC::PropertyMap::resizePropertyStorage):
931 (JSC::PropertyMap::checkConsistency):
933 (JSC::PropertyMap::markingCount): Fix typo.
935 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
939 Speculative Windows build fix.
941 * masm/MacroAssemblerWin.cpp:
942 (JSC::MacroAssembler::emitConvertToFastCall):
943 (JSC::MacroAssembler::emitRestoreArgumentReference):
945 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
947 Reviewed by Maciej Stachowiak.
949 Bug 20755: Create an X86 namespace for register names and other things
950 <https://bugs.webkit.org/show_bug.cgi?id=20755>
952 Create an X86 namespace to put X86 register names. Perhaps I will move
953 opcode names here later as well.
956 (JSC::CTI::emitGetArg):
957 (JSC::CTI::emitGetPutArg):
958 (JSC::CTI::emitPutArg):
959 (JSC::CTI::emitPutArgConstant):
960 (JSC::CTI::emitPutCTIParam):
961 (JSC::CTI::emitGetCTIParam):
962 (JSC::CTI::emitPutToCallFrameHeader):
963 (JSC::CTI::emitGetFromCallFrameHeader):
964 (JSC::CTI::emitPutResult):
965 (JSC::CTI::emitDebugExceptionCheck):
966 (JSC::CTI::emitJumpSlowCaseIfNotImms):
967 (JSC::CTI::compileOpCall):
968 (JSC::CTI::emitSlowScriptCheck):
969 (JSC::CTI::privateCompileMainPass):
970 (JSC::CTI::privateCompileSlowCases):
971 (JSC::CTI::privateCompile):
972 (JSC::CTI::privateCompileGetByIdSelf):
973 (JSC::CTI::privateCompileGetByIdProto):
974 (JSC::CTI::privateCompileGetByIdChain):
975 (JSC::CTI::privateCompilePutByIdReplace):
976 (JSC::CTI::privateArrayLengthTrampoline):
977 (JSC::CTI::privateStringLengthTrampoline):
978 (JSC::CTI::compileRegExp):
980 * masm/X86Assembler.h:
982 (JSC::X86Assembler::emitModRm_rm):
983 (JSC::X86Assembler::emitModRm_rm_Unchecked):
984 (JSC::X86Assembler::emitModRm_rmsib):
986 (JSC::WRECGenerator::generateNonGreedyQuantifier):
987 (JSC::WRECGenerator::generateGreedyQuantifier):
988 (JSC::WRECGenerator::generateParentheses):
989 (JSC::WRECGenerator::generateBackreference):
990 (JSC::WRECGenerator::gernerateDisjunction):
993 2008-09-09 Sam Weinig <sam@webkit.org>
995 Reviewed by Geoffrey Garen.
997 Remove unnecessary friend declaration.
1001 2008-09-09 Sam Weinig <sam@webkit.org>
1003 Reviewed by Geoffrey Garen.
1005 Replace uses of PropertyMap::get and PropertyMap::getLocation with
1006 PropertyMap::getOffset.
1008 Sunspider reports this as a .6% improvement.
1010 * JavaScriptCore.exp:
1012 (JSC::JSObject::put):
1013 (JSC::JSObject::deleteProperty):
1014 (JSC::JSObject::getPropertyAttributes):
1016 (JSC::JSObject::getDirect):
1017 (JSC::JSObject::getDirectLocation):
1018 (JSC::JSObject::locationForOffset):
1019 * kjs/PropertyMap.cpp:
1020 (JSC::PropertyMap::remove):
1021 (JSC::PropertyMap::getOffset):
1022 * kjs/PropertyMap.h:
1024 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1026 Reviewed by Sam Weinig.
1028 Bug 20754: Remove emit prefix from assembler opcode methods
1029 <https://bugs.webkit.org/show_bug.cgi?id=20754>
1032 (JSC::CTI::emitGetArg):
1033 (JSC::CTI::emitGetPutArg):
1034 (JSC::CTI::emitPutArg):
1035 (JSC::CTI::emitPutArgConstant):
1036 (JSC::CTI::emitPutCTIParam):
1037 (JSC::CTI::emitGetCTIParam):
1038 (JSC::CTI::emitPutToCallFrameHeader):
1039 (JSC::CTI::emitGetFromCallFrameHeader):
1040 (JSC::CTI::emitPutResult):
1041 (JSC::CTI::emitDebugExceptionCheck):
1042 (JSC::CTI::emitCall):
1043 (JSC::CTI::emitJumpSlowCaseIfNotImm):
1044 (JSC::CTI::emitJumpSlowCaseIfNotImms):
1045 (JSC::CTI::emitFastArithDeTagImmediate):
1046 (JSC::CTI::emitFastArithReTagImmediate):
1047 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
1048 (JSC::CTI::emitFastArithImmToInt):
1049 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
1050 (JSC::CTI::emitFastArithIntToImmNoCheck):
1051 (JSC::CTI::compileOpCall):
1052 (JSC::CTI::emitSlowScriptCheck):
1053 (JSC::CTI::privateCompileMainPass):
1054 (JSC::CTI::privateCompileSlowCases):
1055 (JSC::CTI::privateCompile):
1056 (JSC::CTI::privateCompileGetByIdSelf):
1057 (JSC::CTI::privateCompileGetByIdProto):
1058 (JSC::CTI::privateCompileGetByIdChain):
1059 (JSC::CTI::privateCompilePutByIdReplace):
1060 (JSC::CTI::privateArrayLengthTrampoline):
1061 (JSC::CTI::privateStringLengthTrampoline):
1062 (JSC::CTI::compileRegExp):
1063 * masm/MacroAssemblerWin.cpp:
1064 (JSC::MacroAssembler::emitConvertToFastCall):
1065 (JSC::MacroAssembler::emitRestoreArgumentReference):
1066 * masm/X86Assembler.h:
1067 (JSC::X86Assembler::pushl_r):
1068 (JSC::X86Assembler::pushl_m):
1069 (JSC::X86Assembler::popl_r):
1070 (JSC::X86Assembler::popl_m):
1071 (JSC::X86Assembler::movl_rr):
1072 (JSC::X86Assembler::addl_rr):
1073 (JSC::X86Assembler::addl_i8r):
1074 (JSC::X86Assembler::addl_i32r):
1075 (JSC::X86Assembler::addl_mr):
1076 (JSC::X86Assembler::andl_rr):
1077 (JSC::X86Assembler::andl_i32r):
1078 (JSC::X86Assembler::cmpl_i8r):
1079 (JSC::X86Assembler::cmpl_rr):
1080 (JSC::X86Assembler::cmpl_rm):
1081 (JSC::X86Assembler::cmpl_i32r):
1082 (JSC::X86Assembler::cmpl_i32m):
1083 (JSC::X86Assembler::cmpw_rm):
1084 (JSC::X86Assembler::orl_rr):
1085 (JSC::X86Assembler::subl_rr):
1086 (JSC::X86Assembler::subl_i8r):
1087 (JSC::X86Assembler::subl_i32r):
1088 (JSC::X86Assembler::subl_mr):
1089 (JSC::X86Assembler::testl_i32r):
1090 (JSC::X86Assembler::testl_rr):
1091 (JSC::X86Assembler::xorl_i8r):
1092 (JSC::X86Assembler::xorl_rr):
1093 (JSC::X86Assembler::sarl_i8r):
1094 (JSC::X86Assembler::sarl_CLr):
1095 (JSC::X86Assembler::shl_i8r):
1096 (JSC::X86Assembler::shll_CLr):
1097 (JSC::X86Assembler::mull_rr):
1098 (JSC::X86Assembler::idivl_r):
1099 (JSC::X86Assembler::cdq):
1100 (JSC::X86Assembler::movl_mr):
1101 (JSC::X86Assembler::movzwl_mr):
1102 (JSC::X86Assembler::movl_rm):
1103 (JSC::X86Assembler::movl_i32r):
1104 (JSC::X86Assembler::movl_i32m):
1105 (JSC::X86Assembler::leal_mr):
1106 (JSC::X86Assembler::ret):
1107 (JSC::X86Assembler::jmp_r):
1108 (JSC::X86Assembler::jmp_m):
1109 (JSC::X86Assembler::call_r):
1111 (JSC::WRECGenerator::generateBacktrack1):
1112 (JSC::WRECGenerator::generateBacktrackBackreference):
1113 (JSC::WRECGenerator::generateBackreferenceQuantifier):
1114 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1115 (JSC::WRECGenerator::generateGreedyQuantifier):
1116 (JSC::WRECGenerator::generatePatternCharacter):
1117 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
1118 (JSC::WRECGenerator::generateCharacterClassInverted):
1119 (JSC::WRECGenerator::generateCharacterClass):
1120 (JSC::WRECGenerator::generateParentheses):
1121 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
1122 (JSC::WRECGenerator::generateAssertionBOL):
1123 (JSC::WRECGenerator::generateAssertionEOL):
1124 (JSC::WRECGenerator::generateAssertionWordBoundary):
1125 (JSC::WRECGenerator::generateBackreference):
1126 (JSC::WRECGenerator::gernerateDisjunction):
1128 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1130 Reviewed by Maciej Stachowiak.
1132 Clean up the WREC code some more.
1135 (JSC::CTI::compileRegExp):
1137 (JSC::getCharacterClassNewline):
1138 (JSC::getCharacterClassDigits):
1139 (JSC::getCharacterClassSpaces):
1140 (JSC::getCharacterClassWordchar):
1141 (JSC::getCharacterClassNondigits):
1142 (JSC::getCharacterClassNonspaces):
1143 (JSC::getCharacterClassNonwordchar):
1144 (JSC::WRECGenerator::generateBacktrack1):
1145 (JSC::WRECGenerator::generateBacktrackBackreference):
1146 (JSC::WRECGenerator::generateBackreferenceQuantifier):
1147 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1148 (JSC::WRECGenerator::generateGreedyQuantifier):
1149 (JSC::WRECGenerator::generatePatternCharacter):
1150 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
1151 (JSC::WRECGenerator::generateCharacterClassInverted):
1152 (JSC::WRECGenerator::generateCharacterClass):
1153 (JSC::WRECGenerator::generateParentheses):
1154 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
1155 (JSC::WRECGenerator::generateAssertionBOL):
1156 (JSC::WRECGenerator::generateAssertionEOL):
1157 (JSC::WRECGenerator::generateAssertionWordBoundary):
1158 (JSC::WRECGenerator::generateBackreference):
1159 (JSC::WRECGenerator::gernerateDisjunction):
1160 (JSC::WRECParser::parseCharacterClass):
1161 (JSC::WRECParser::parseEscape):
1162 (JSC::WRECParser::parseTerm):
1165 2008-09-09 Mark Rowe <mrowe@apple.com>
1167 Build fix, rubber-stamped by Anders Carlsson.
1169 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
1171 * JavaScriptCore.xcodeproj/project.pbxproj:
1173 2008-09-09 Mark Rowe <mrowe@apple.com>
1175 Rubber-stamped by Oliver Hunt.
1177 Fix builds using the "debug" variant.
1179 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
1180 and Release configurations.
1182 * Configurations/JavaScriptCore.xcconfig:
1183 * DerivedSources.make:
1184 * JavaScriptCore.Debug.exp: Removed.
1185 * JavaScriptCore.base.exp: Removed.
1186 * JavaScriptCore.exp: Added.
1187 * JavaScriptCore.xcodeproj/project.pbxproj:
1188 * kjs/identifier.cpp:
1189 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
1190 there is no overhead in Release builds.
1191 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
1193 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
1194 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
1196 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1198 Reviewed by Maciej Stachowiak.
1200 Clean up WREC a bit to bring it closer to our coding style guidelines.
1204 (JSC::getCharacterClass_newline):
1205 (JSC::getCharacterClass_d):
1206 (JSC::getCharacterClass_s):
1207 (JSC::getCharacterClass_w):
1208 (JSC::getCharacterClass_D):
1209 (JSC::getCharacterClass_S):
1210 (JSC::getCharacterClass_W):
1211 (JSC::CharacterClassConstructor::append):
1212 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1213 (JSC::WRECGenerator::generateGreedyQuantifier):
1214 (JSC::WRECGenerator::generateCharacterClassInverted):
1215 (JSC::WRECParser::parseQuantifier):
1216 (JSC::WRECParser::parsePatternCharacterQualifier):
1217 (JSC::WRECParser::parseCharacterClassQuantifier):
1218 (JSC::WRECParser::parseBackreferenceQuantifier):
1220 (JSC::Quantifier::):
1221 (JSC::Quantifier::Quantifier):
1223 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
1225 Reviewed by Alexey Proskuryakov.
1227 Try MIME charset names before trying IANA names
1228 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
1230 * wtf/StringExtras.h: (strcasecmp): Added.
1232 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1234 Reviewed by Mark Rowe.
1236 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
1237 <https://bugs.webkit.org/show_bug.cgi?id=20719>
1238 <rdar://problem/6205787>
1240 Fix a typo in the case-insensitive matching of character patterns.
1243 (JSC::WRECGenerator::generatePatternCharacter):
1245 2008-09-09 Maciej Stachowiak <mjs@apple.com>
1247 Reviewed by Sam Weinig.
1249 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
1251 1.012x speedup on SunSpider.
1253 * kjs/MathObject.cpp:
1254 (JSC::MathObject::getOwnPropertySlot):
1256 (JSC::setUpStaticFunctionSlot):
1258 (JSC::getStaticPropertySlot):
1260 2008-09-08 Sam Weinig <sam@webkit.org>
1262 Reviewed by Maciej Stachowiak and Oliver Hunt.
1264 Split storage of properties out of the PropertyMap and into the JSObject
1265 to allow sharing PropertyMap on the StructureID. In order to get this
1266 function correctly, the StructureID's transition mappings were changed to
1267 transition based on property name and attribute pairs, instead of just
1270 - Removes the single property optimization now that the PropertyMap is shared.
1271 This will be replaced by in-lining some values on the JSObject.
1273 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
1275 * JavaScriptCore.base.exp:
1277 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
1278 (JSC::CTI::privateCompileGetByIdProto): Ditto.
1279 (JSC::CTI::privateCompileGetByIdChain): Ditto.
1280 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
1282 (JSC::JSObject::mark): Mark the PropertyStorage.
1283 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
1284 (JSC::JSObject::deleteProperty): Ditto.
1285 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
1286 (JSC::JSObject::defineSetter): Ditto.
1287 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
1288 (JSC::JSObject::getPropertyNames): Ditto.
1289 (JSC::JSObject::removeDirect): Ditto.
1290 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
1291 (JSC::JSObject::propertyStorage): return the PropertyStorage.
1292 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
1293 (JSC::JSObject::getDirectLocation): Ditto.
1294 (JSC::JSObject::offsetForLocation): Compute location directly.
1295 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
1296 (JSC::JSObject::hasGetterSetterProperties): Ditto.
1297 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
1298 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
1299 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
1300 (JSC::JSObject::getOwnPropertySlot): Ditto.
1301 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
1302 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
1303 (JSC::PropertyMap::checkConsistency):
1304 (JSC::PropertyMap::operator=):
1305 (JSC::PropertyMap::~PropertyMap):
1306 (JSC::PropertyMap::get):
1307 (JSC::PropertyMap::getLocation):
1308 (JSC::PropertyMap::put):
1309 (JSC::PropertyMap::getOffset):
1310 (JSC::PropertyMap::insert):
1311 (JSC::PropertyMap::expand):
1312 (JSC::PropertyMap::rehash):
1313 (JSC::PropertyMap::createTable):
1314 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
1315 (JSC::PropertyMap::remove):
1316 (JSC::PropertyMap::getEnumerablePropertyNames):
1317 * kjs/PropertyMap.h:
1318 (JSC::PropertyMapEntry::PropertyMapEntry):
1319 (JSC::PropertyMap::isEmpty):
1320 (JSC::PropertyMap::size):
1321 (JSC::PropertyMap::makingCount):
1322 (JSC::PropertyMap::PropertyMap):
1324 * kjs/StructureID.cpp:
1325 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
1327 (JSC::StructureID::toDictionaryTransition): Copy the map.
1328 (JSC::StructureID::changePrototypeTransition): Copy the map.
1329 (JSC::StructureID::getterSetterTransition): Copy the map.
1330 (JSC::StructureID::~StructureID):
1331 * kjs/StructureID.h:
1332 (JSC::TransitionTableHash::hash): Custom hash for transition map.
1333 (JSC::TransitionTableHash::equal): Ditto.
1334 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
1335 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
1336 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
1337 (JSC::StructureID::propertyMap): Added.
1339 2008-09-08 Oliver Hunt <oliver@apple.com>
1341 Reviewed by Mark Rowe.
1343 Bug 20694: Slow Script error pops up when running Dromaeo tests
1345 Correct error in timeout logic where execution tick count would
1346 be reset to incorrect value due to incorrect offset and indirection.
1347 Codegen for the slow script dialog was factored out into a separate
1348 method (emitSlowScriptCheck) rather than having multiple copies of
1349 the same code. Also added calls to generate slow script checks
1350 for loop_if_less and loop_if_true opcodes.
1353 (JSC::CTI::emitSlowScriptCheck):
1354 (JSC::CTI::privateCompileMainPass):
1355 (JSC::CTI::privateCompileSlowCases):
1358 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1360 Reviewed by Maciej Stachowiak.
1362 Remove references to the removed WRECompiler class.
1367 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1369 Rubber-stamped by Mark Rowe.
1371 Fix the build with CTI enabled but WREC disabled.
1376 2008-09-08 Dan Bernstein <mitz@apple.com>
1381 (JSC::StatementNode::):
1384 2008-09-08 Kevin McCullough <kmccullough@apple.com>
1388 <rdar://problem/6134407> Breakpoints in for loops, while loops or
1389 conditions without curly braces don't break. (19306)
1390 -Statement Lists already emit debug hooks but conditionals without
1391 brackets are not lists.
1394 (KJS::IfNode::emitCode):
1395 (KJS::IfElseNode::emitCode):
1396 (KJS::DoWhileNode::emitCode):
1397 (KJS::WhileNode::emitCode):
1398 (KJS::ForNode::emitCode):
1399 (KJS::ForInNode::emitCode):
1401 (KJS::StatementNode::):
1404 2008-09-08 Maciej Stachowiak <mjs@apple.com>
1406 Reviewed by Anders Carlsson.
1408 - Cache the code generated for eval to speed up SunSpider and web sites
1409 https://bugs.webkit.org/show_bug.cgi?id=20718
1412 2.29x on date-format-tofte
1414 Lots of real sites seem to get many hits on this cache as well,
1415 including GMail, Google Spreadsheets, Slate and Digg (the last of
1416 these gets over 100 hits on initial page load).
1419 (JSC::EvalCodeCache::get):
1421 (JSC::Machine::callEval):
1422 (JSC::Machine::privateExecute):
1423 (JSC::Machine::cti_op_call_eval):
1426 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1428 Reviewed by Oliver Hunt.
1430 Bug 20711: Change KJS prefix on preprocessor macros to JSC
1431 <https://bugs.webkit.org/show_bug.cgi?id=20711>
1433 * kjs/CommonIdentifiers.cpp:
1434 (JSC::CommonIdentifiers::CommonIdentifiers):
1435 * kjs/CommonIdentifiers.h:
1436 * kjs/PropertySlot.h:
1437 (JSC::PropertySlot::getValue):
1438 (JSC::PropertySlot::putValue):
1439 (JSC::PropertySlot::setValueSlot):
1440 (JSC::PropertySlot::setValue):
1441 (JSC::PropertySlot::setRegisterSlot):
1446 (JSC::ExpressionNode::):
1447 (JSC::StatementNode::):
1449 (JSC::BooleanNode::):
1450 (JSC::NumberNode::):
1451 (JSC::ImmediateNumberNode::):
1452 (JSC::StringNode::):
1453 (JSC::RegExpNode::):
1455 (JSC::ResolveNode::):
1456 (JSC::ElementNode::):
1458 (JSC::PropertyNode::):
1459 (JSC::PropertyListNode::):
1460 (JSC::ObjectLiteralNode::):
1461 (JSC::BracketAccessorNode::):
1462 (JSC::DotAccessorNode::):
1463 (JSC::ArgumentListNode::):
1464 (JSC::ArgumentsNode::):
1465 (JSC::NewExprNode::):
1466 (JSC::EvalFunctionCallNode::):
1467 (JSC::FunctionCallValueNode::):
1468 (JSC::FunctionCallResolveNode::):
1469 (JSC::FunctionCallBracketNode::):
1470 (JSC::FunctionCallDotNode::):
1471 (JSC::PrePostResolveNode::):
1472 (JSC::PostfixResolveNode::):
1473 (JSC::PostfixBracketNode::):
1474 (JSC::PostfixDotNode::):
1475 (JSC::PostfixErrorNode::):
1476 (JSC::DeleteResolveNode::):
1477 (JSC::DeleteBracketNode::):
1478 (JSC::DeleteDotNode::):
1479 (JSC::DeleteValueNode::):
1481 (JSC::TypeOfResolveNode::):
1482 (JSC::TypeOfValueNode::):
1483 (JSC::PrefixResolveNode::):
1484 (JSC::PrefixBracketNode::):
1485 (JSC::PrefixDotNode::):
1486 (JSC::PrefixErrorNode::):
1487 (JSC::UnaryPlusNode::):
1488 (JSC::NegateNode::):
1489 (JSC::BitwiseNotNode::):
1490 (JSC::LogicalNotNode::):
1496 (JSC::LeftShiftNode::):
1497 (JSC::RightShiftNode::):
1498 (JSC::UnsignedRightShiftNode::):
1500 (JSC::GreaterNode::):
1501 (JSC::LessEqNode::):
1502 (JSC::GreaterEqNode::):
1503 (JSC::ThrowableBinaryOpNode::):
1504 (JSC::InstanceOfNode::):
1507 (JSC::NotEqualNode::):
1508 (JSC::StrictEqualNode::):
1509 (JSC::NotStrictEqualNode::):
1510 (JSC::BitAndNode::):
1512 (JSC::BitXOrNode::):
1513 (JSC::LogicalOpNode::):
1514 (JSC::ConditionalNode::):
1515 (JSC::ReadModifyResolveNode::):
1516 (JSC::AssignResolveNode::):
1517 (JSC::ReadModifyBracketNode::):
1518 (JSC::AssignBracketNode::):
1519 (JSC::AssignDotNode::):
1520 (JSC::ReadModifyDotNode::):
1521 (JSC::AssignErrorNode::):
1523 (JSC::VarDeclCommaNode::):
1524 (JSC::ConstDeclNode::):
1525 (JSC::ConstStatementNode::):
1526 (JSC::EmptyStatementNode::):
1527 (JSC::DebuggerStatementNode::):
1528 (JSC::ExprStatementNode::):
1529 (JSC::VarStatementNode::):
1531 (JSC::IfElseNode::):
1532 (JSC::DoWhileNode::):
1535 (JSC::ContinueNode::):
1537 (JSC::ReturnNode::):
1542 (JSC::ParameterNode::):
1544 (JSC::ProgramNode::):
1546 (JSC::FunctionBodyNode::):
1547 (JSC::FuncExprNode::):
1548 (JSC::FuncDeclNode::):
1549 (JSC::CaseClauseNode::):
1550 (JSC::ClauseListNode::):
1551 (JSC::CaseBlockNode::):
1552 (JSC::SwitchNode::):
1554 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1556 Reviewed by Maciej Stachowiak.
1558 Bug 20704: Replace the KJS namespace
1559 <https://bugs.webkit.org/show_bug.cgi?id=20704>
1561 Rename the KJS namespace to JSC. There are still some uses of KJS in
1562 preprocessor macros and comments, but these will also be changed some
1563 time in the near future.
1570 * API/JSCallbackConstructor.cpp:
1571 * API/JSCallbackConstructor.h:
1572 * API/JSCallbackFunction.cpp:
1573 * API/JSCallbackFunction.h:
1574 * API/JSCallbackObject.cpp:
1575 * API/JSCallbackObject.h:
1576 * API/JSCallbackObjectFunctions.h:
1577 * API/JSClassRef.cpp:
1578 (OpaqueJSClass::staticValues):
1579 (OpaqueJSClass::staticFunctions):
1581 * API/JSContextRef.cpp:
1582 * API/JSObjectRef.cpp:
1583 * API/JSProfilerPrivate.cpp:
1584 * API/JSStringRef.cpp:
1585 * API/JSValueRef.cpp:
1587 * API/OpaqueJSString.cpp:
1588 * API/OpaqueJSString.h:
1589 * JavaScriptCore.Debug.exp:
1590 * JavaScriptCore.base.exp:
1596 * VM/CodeGenerator.cpp:
1597 * VM/CodeGenerator.h:
1598 * VM/ExceptionHelpers.cpp:
1599 * VM/ExceptionHelpers.h:
1601 * VM/JSPropertyNameIterator.cpp:
1602 * VM/JSPropertyNameIterator.h:
1610 * VM/RegisterFile.cpp:
1611 * VM/RegisterFile.h:
1614 * VM/SamplingTool.cpp:
1615 * VM/SamplingTool.h:
1616 * VM/SegmentedVector.h:
1619 * kjs/Arguments.cpp:
1621 * kjs/ArrayConstructor.cpp:
1622 * kjs/ArrayConstructor.h:
1623 * kjs/ArrayPrototype.cpp:
1624 * kjs/ArrayPrototype.h:
1625 * kjs/BatchedTransitionOptimizer.h:
1626 * kjs/BooleanConstructor.cpp:
1627 * kjs/BooleanConstructor.h:
1628 * kjs/BooleanObject.cpp:
1629 * kjs/BooleanObject.h:
1630 * kjs/BooleanPrototype.cpp:
1631 * kjs/BooleanPrototype.h:
1635 * kjs/CommonIdentifiers.cpp:
1636 * kjs/CommonIdentifiers.h:
1637 * kjs/ConstructData.cpp:
1638 * kjs/ConstructData.h:
1639 * kjs/DateConstructor.cpp:
1640 * kjs/DateConstructor.h:
1641 * kjs/DateInstance.cpp:
1642 (JSC::DateInstance::msToGregorianDateTime):
1643 * kjs/DateInstance.h:
1646 * kjs/DatePrototype.cpp:
1647 * kjs/DatePrototype.h:
1648 * kjs/DebuggerCallFrame.cpp:
1649 * kjs/DebuggerCallFrame.h:
1652 * kjs/ErrorConstructor.cpp:
1653 * kjs/ErrorConstructor.h:
1654 * kjs/ErrorInstance.cpp:
1655 * kjs/ErrorInstance.h:
1656 * kjs/ErrorPrototype.cpp:
1657 * kjs/ErrorPrototype.h:
1658 * kjs/ExecState.cpp:
1660 * kjs/FunctionConstructor.cpp:
1661 * kjs/FunctionConstructor.h:
1662 * kjs/FunctionPrototype.cpp:
1663 * kjs/FunctionPrototype.h:
1664 * kjs/GetterSetter.cpp:
1665 * kjs/GetterSetter.h:
1666 * kjs/GlobalEvalFunction.cpp:
1667 * kjs/GlobalEvalFunction.h:
1668 * kjs/IndexToNameMap.cpp:
1669 * kjs/IndexToNameMap.h:
1670 * kjs/InitializeThreading.cpp:
1671 * kjs/InitializeThreading.h:
1672 * kjs/InternalFunction.cpp:
1673 * kjs/InternalFunction.h:
1674 (JSC::InternalFunction::InternalFunction):
1675 * kjs/JSActivation.cpp:
1676 * kjs/JSActivation.h:
1681 * kjs/JSFunction.cpp:
1683 (JSC::JSFunction::JSFunction):
1684 * kjs/JSGlobalData.cpp:
1685 (JSC::JSGlobalData::JSGlobalData):
1686 * kjs/JSGlobalData.h:
1687 * kjs/JSGlobalObject.cpp:
1688 * kjs/JSGlobalObject.h:
1689 * kjs/JSGlobalObjectFunctions.cpp:
1690 * kjs/JSGlobalObjectFunctions.h:
1691 * kjs/JSImmediate.cpp:
1692 * kjs/JSImmediate.h:
1695 * kjs/JSNotAnObject.cpp:
1696 * kjs/JSNotAnObject.h:
1697 * kjs/JSNumberCell.cpp:
1698 * kjs/JSNumberCell.h:
1701 * kjs/JSStaticScopeObject.cpp:
1702 * kjs/JSStaticScopeObject.h:
1708 * kjs/JSVariableObject.cpp:
1709 * kjs/JSVariableObject.h:
1710 * kjs/JSWrapperObject.cpp:
1711 * kjs/JSWrapperObject.h:
1712 * kjs/LabelStack.cpp:
1714 * kjs/MathObject.cpp:
1716 * kjs/NativeErrorConstructor.cpp:
1717 * kjs/NativeErrorConstructor.h:
1718 * kjs/NativeErrorPrototype.cpp:
1719 * kjs/NativeErrorPrototype.h:
1721 * kjs/NumberConstructor.cpp:
1722 * kjs/NumberConstructor.h:
1723 * kjs/NumberObject.cpp:
1724 * kjs/NumberObject.h:
1725 * kjs/NumberPrototype.cpp:
1726 * kjs/NumberPrototype.h:
1727 * kjs/ObjectConstructor.cpp:
1728 * kjs/ObjectConstructor.h:
1729 * kjs/ObjectPrototype.cpp:
1730 * kjs/ObjectPrototype.h:
1733 * kjs/PropertyMap.cpp:
1734 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
1735 * kjs/PropertyMap.h:
1736 * kjs/PropertyNameArray.cpp:
1737 * kjs/PropertyNameArray.h:
1738 * kjs/PropertySlot.cpp:
1739 * kjs/PropertySlot.h:
1740 * kjs/PrototypeFunction.cpp:
1741 * kjs/PrototypeFunction.h:
1742 * kjs/PutPropertySlot.h:
1743 * kjs/RegExpConstructor.cpp:
1744 * kjs/RegExpConstructor.h:
1745 * kjs/RegExpObject.cpp:
1746 * kjs/RegExpObject.h:
1747 * kjs/RegExpPrototype.cpp:
1748 * kjs/RegExpPrototype.h:
1749 * kjs/ScopeChain.cpp:
1751 * kjs/ScopeChainMark.h:
1754 * kjs/SmallStrings.cpp:
1755 * kjs/SmallStrings.h:
1756 * kjs/SourceProvider.h:
1757 * kjs/SourceRange.h:
1758 * kjs/StringConstructor.cpp:
1759 * kjs/StringConstructor.h:
1760 * kjs/StringObject.cpp:
1761 * kjs/StringObject.h:
1762 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1763 * kjs/StringPrototype.cpp:
1764 * kjs/StringPrototype.h:
1765 * kjs/StructureID.cpp:
1766 * kjs/StructureID.h:
1767 * kjs/SymbolTable.h:
1768 * kjs/collector.cpp:
1771 * kjs/create_hash_table:
1777 * kjs/identifier.cpp:
1779 (JSC::Identifier::equal):
1780 * kjs/interpreter.cpp:
1781 * kjs/interpreter.h:
1783 (JSC::Lexer::Lexer):
1784 (JSC::Lexer::clear):
1785 (JSC::Lexer::makeIdentifier):
1791 * kjs/nodes2string.cpp:
1792 * kjs/operations.cpp:
1800 (JSC::IdentifierRepHash::hash):
1802 * masm/MacroAssembler.h:
1803 * masm/MacroAssemblerWin.cpp:
1804 * masm/X86Assembler.h:
1805 * pcre/pcre_exec.cpp:
1806 * profiler/CallIdentifier.h:
1808 * profiler/HeavyProfile.cpp:
1809 * profiler/HeavyProfile.h:
1810 * profiler/Profile.cpp:
1811 * profiler/Profile.h:
1812 * profiler/ProfileGenerator.cpp:
1813 * profiler/ProfileGenerator.h:
1814 * profiler/ProfileNode.cpp:
1815 * profiler/ProfileNode.h:
1816 * profiler/Profiler.cpp:
1817 * profiler/Profiler.h:
1818 * profiler/TreeProfile.cpp:
1819 * profiler/TreeProfile.h:
1824 2008-09-07 Maciej Stachowiak <mjs@apple.com>
1826 Reviewed by Dan Bernstein.
1828 - rename IA32MacroAssembler class to X86Assembler
1830 We otherwise call the platform X86, and also, I don't see any macros.
1832 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1833 * JavaScriptCore.xcodeproj/project.pbxproj:
1834 * masm/IA32MacroAsm.h: Removed.
1835 * masm/MacroAssembler.h:
1836 (KJS::MacroAssembler::MacroAssembler):
1837 * masm/MacroAssemblerWin.cpp:
1838 (KJS::MacroAssembler::emitRestoreArgumentReference):
1839 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
1840 (KJS::X86Assembler::X86Assembler):
1842 (KJS::WRECGenerator::generateNonGreedyQuantifier):
1843 (KJS::WRECGenerator::generateGreedyQuantifier):
1844 (KJS::WRECGenerator::generateParentheses):
1845 (KJS::WRECGenerator::generateBackreference):
1846 (KJS::WRECGenerator::gernerateDisjunction):
1849 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
1853 Visual C++ seems to have some odd casting rules, so just convert the
1854 offending cast back to a C-style cast for now.
1856 * kjs/collector.cpp:
1857 (KJS::otherThreadStackPointer):
1859 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1861 Reviewed by Mark Rowe.
1863 Attempt to fix the Windows build by using a const_cast to cast regs.Esp
1864 to a uintptr_t instead of a reinterpret_cast.
1866 * kjs/collector.cpp:
1867 (KJS::otherThreadStackPointer):
1869 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1871 Reviewed by Sam Weinig.
1873 Remove C-style casts from kjs/collector.cpp.
1875 * kjs/collector.cpp:
1876 (KJS::Heap::heapAllocate):
1877 (KJS::currentThreadStackBase):
1878 (KJS::Heap::markConservatively):
1879 (KJS::otherThreadStackPointer):
1880 (KJS::Heap::markOtherThreadConservatively):
1883 2008-09-07 Mark Rowe <mrowe@apple.com>
1885 Build fix for the debug variant.
1887 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
1889 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1891 Reviewed by Timothy Hatcher.
1893 Remove C-style casts from the CTI code.
1896 (KJS::CTI::emitGetArg):
1897 (KJS::CTI::emitGetPutArg):
1898 (KJS::ctiRepatchCallByReturnAddress):
1899 (KJS::CTI::compileOpCall):
1900 (KJS::CTI::privateCompileMainPass):
1901 (KJS::CTI::privateCompileGetByIdSelf):
1902 (KJS::CTI::privateCompileGetByIdProto):
1903 (KJS::CTI::privateCompileGetByIdChain):
1904 (KJS::CTI::privateCompilePutByIdReplace):
1905 (KJS::CTI::privateArrayLengthTrampoline):
1906 (KJS::CTI::privateStringLengthTrampoline):
1908 === End merge of squirrelfish-extreme ===
1910 2008-09-06 Gavin Barraclough <barraclough@apple.com>
1912 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
1914 - refactor WREC to share more of the JIT infrastructure with CTI
1917 (KJS::CTI::emitGetArg):
1918 (KJS::CTI::emitGetPutArg):
1919 (KJS::CTI::emitPutArg):
1920 (KJS::CTI::emitPutArgConstant):
1921 (KJS::CTI::emitPutCTIParam):
1922 (KJS::CTI::emitGetCTIParam):
1923 (KJS::CTI::emitPutToCallFrameHeader):
1924 (KJS::CTI::emitGetFromCallFrameHeader):
1925 (KJS::CTI::emitPutResult):
1926 (KJS::CTI::emitDebugExceptionCheck):
1927 (KJS::CTI::emitJumpSlowCaseIfNotImm):
1928 (KJS::CTI::emitJumpSlowCaseIfNotImms):
1929 (KJS::CTI::emitFastArithDeTagImmediate):
1930 (KJS::CTI::emitFastArithReTagImmediate):
1931 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
1932 (KJS::CTI::emitFastArithImmToInt):
1933 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
1934 (KJS::CTI::emitFastArithIntToImmNoCheck):
1936 (KJS::CTI::compileOpCall):
1937 (KJS::CTI::privateCompileMainPass):
1938 (KJS::CTI::privateCompileSlowCases):
1939 (KJS::CTI::privateCompile):
1940 (KJS::CTI::privateCompileGetByIdSelf):
1941 (KJS::CTI::privateCompileGetByIdProto):
1942 (KJS::CTI::privateCompileGetByIdChain):
1943 (KJS::CTI::privateCompilePutByIdReplace):
1944 (KJS::CTI::privateArrayLengthTrampoline):
1945 (KJS::CTI::privateStringLengthTrampoline):
1946 (KJS::CTI::compileRegExp):
1948 (KJS::CallRecord::CallRecord):
1949 (KJS::JmpTable::JmpTable):
1950 (KJS::SlowCaseEntry::SlowCaseEntry):
1951 (KJS::CTI::JSRInfo::JSRInfo):
1953 (KJS::RegExp::RegExp):
1955 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
1956 (KJS::GeneratePatternCharacterFunctor::generateAtom):
1957 (KJS::GeneratePatternCharacterFunctor::backtrack):
1958 (KJS::GenerateCharacterClassFunctor::generateAtom):
1959 (KJS::GenerateCharacterClassFunctor::backtrack):
1960 (KJS::GenerateBackreferenceFunctor::generateAtom):
1961 (KJS::GenerateBackreferenceFunctor::backtrack):
1962 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
1963 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
1964 (KJS::WRECGenerate::generateBacktrack1):
1965 (KJS::WRECGenerate::generateBacktrackBackreference):
1966 (KJS::WRECGenerate::generateBackreferenceQuantifier):
1967 (KJS::WRECGenerate::generateNonGreedyQuantifier):
1968 (KJS::WRECGenerate::generateGreedyQuantifier):
1969 (KJS::WRECGenerate::generatePatternCharacter):
1970 (KJS::WRECGenerate::generateCharacterClassInvertedRange):
1971 (KJS::WRECGenerate::generateCharacterClassInverted):
1972 (KJS::WRECGenerate::generateCharacterClass):
1973 (KJS::WRECGenerate::generateParentheses):
1974 (KJS::WRECGenerate::generateParenthesesNonGreedy):
1975 (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
1976 (KJS::WRECGenerate::generateAssertionBOL):
1977 (KJS::WRECGenerate::generateAssertionEOL):
1978 (KJS::WRECGenerate::generateAssertionWordBoundary):
1979 (KJS::WRECGenerate::generateBackreference):
1980 (KJS::WRECGenerate::gernerateDisjunction):
1981 (KJS::WRECGenerate::terminateDisjunction):
1982 (KJS::WRECParser::parseGreedyQuantifier):
1983 (KJS::WRECParser::parseQuantifier):
1984 (KJS::WRECParser::parsePatternCharacterQualifier):
1985 (KJS::WRECParser::parseCharacterClassQuantifier):
1986 (KJS::WRECParser::parseBackreferenceQuantifier):
1987 (KJS::WRECParser::parseParentheses):
1988 (KJS::WRECParser::parseCharacterClass):
1989 (KJS::WRECParser::parseOctalEscape):
1990 (KJS::WRECParser::parseEscape):
1991 (KJS::WRECParser::parseTerm):
1992 (KJS::WRECParser::parseDisjunction):
1994 (KJS::WRECGenerate::WRECGenerate):
1995 (KJS::WRECParser::):
1996 (KJS::WRECParser::WRECParser):
1997 (KJS::WRECParser::parseAlternative):
1998 (KJS::WRECParser::isEndOfPattern):
2000 2008-09-06 Oliver Hunt <oliver@apple.com>
2002 Reviewed by NOBODY (Build fix).
2004 Fix the sampler build.
2006 * VM/SamplingTool.h:
2008 2008-09-06 Oliver Hunt <oliver@apple.com>
2010 Reviewed by Maciej Stachowiak.
2012 Jump through the necessary hoops required to make MSVC cooperate with SFX
2014 We now explicitly declare the calling convention on all cti_op_* cfunctions,
2015 and return int instead of bool where appropriate (despite the cdecl calling
2016 convention seems to state MSVC generates code that returns the result value
2017 through ecx). SFX behaves slightly differently under MSVC, specifically it
2018 stores the base argument address for the cti_op_* functions in the first
2019 argument, and then does the required stack manipulation through that pointer.
2020 This is necessary as MSVC's optimisations assume they have complete control
2021 of the stack, and periodically elide our stack manipulations, or move
2022 values in unexpected ways. MSVC also frequently produces tail calls which may
2023 clobber the first argument, so the MSVC path is slightly less efficient due
2024 to the need to restore it.
2026 * JavaScriptCore.xcodeproj/project.pbxproj:
2029 (KJS::CTI::compileOpCall):
2030 (KJS::CTI::privateCompileMainPass):
2031 (KJS::CTI::privateCompileSlowCases):
2035 * masm/MacroAssembler.h:
2036 (KJS::MacroAssembler::emitConvertToFastCall):
2037 * masm/MacroAssemblerIA32GCC.cpp: Removed.
2038 For performance reasons we need these no-op functions to be inlined.
2040 * masm/MacroAssemblerWin.cpp:
2041 (KJS::MacroAssembler::emitRestoreArgumentReference):
2044 2008-09-05 Geoffrey Garen <ggaren@apple.com>
2046 Reviewed by Maciej Stachowiak, or maybe the other way around.
2048 Added the ability to coalesce JITCode buffer grow operations by first
2049 growing the buffer and then executing unchecked puts to it.
2051 About a 2% speedup on date-format-tofte.
2054 (KJS::CTI::compileOpCall):
2055 * masm/IA32MacroAsm.h:
2056 (KJS::JITCodeBuffer::ensureSpace):
2057 (KJS::JITCodeBuffer::putByteUnchecked):
2058 (KJS::JITCodeBuffer::putByte):
2059 (KJS::JITCodeBuffer::putShortUnchecked):
2060 (KJS::JITCodeBuffer::putShort):
2061 (KJS::JITCodeBuffer::putIntUnchecked):
2062 (KJS::JITCodeBuffer::putInt):
2063 (KJS::IA32MacroAssembler::emitTestl_i32r):
2064 (KJS::IA32MacroAssembler::emitMovl_mr):
2065 (KJS::IA32MacroAssembler::emitMovl_rm):
2066 (KJS::IA32MacroAssembler::emitMovl_i32m):
2067 (KJS::IA32MacroAssembler::emitUnlinkedJe):
2068 (KJS::IA32MacroAssembler::emitModRm_rr):
2069 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
2070 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
2071 (KJS::IA32MacroAssembler::emitModRm_rm):
2072 (KJS::IA32MacroAssembler::emitModRm_opr):
2073 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
2074 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
2076 2008-09-05 Mark Rowe <mrowe@apple.com>
2078 Reviewed by Sam Weinig.
2080 Disable WREC and CTI on platforms that we have not yet had a chance to test with.
2084 2008-09-05 Geoffrey Garen <ggaren@apple.com>
2086 Reviewed by Sam Weinig.
2088 Use jo instead of a mask compare when fetching array.length and
2089 string.length. 4% speedup on array.length / string.length torture
2093 (KJS::CTI::privateArrayLengthTrampoline):
2094 (KJS::CTI::privateStringLengthTrampoline):
2096 2008-09-05 Geoffrey Garen <ggaren@apple.com>
2098 Reviewed by Sam Weinig.
2100 Removed a CTI compilation pass by recording labels during bytecode
2101 generation. This is more to reduce complexity than it is to improve
2104 SunSpider reports no change.
2106 CodeBlock now keeps a "labels" set, which holds the offsets of all the
2107 instructions that can be jumped to.
2109 * VM/CTI.cpp: Nixed a pass.
2111 * VM/CodeBlock.h: Added a "labels" set.
2113 * VM/LabelID.h: No need for a special LableID for holding jump
2114 destinations, since the CodeBlock now knows all jump destinations.
2116 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
2120 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
2122 2008-09-05 Mark Rowe <mrowe@apple.com>
2124 Reviewed by Oliver Hunt and Gavin Barraclough.
2126 Move the JITCodeBuffer onto Machine and remove the static variables.
2128 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
2130 (KJS::Machine::Machine): Allocate a JITCodeBuffer.
2132 * kjs/RegExpConstructor.cpp:
2133 (KJS::constructRegExp): Pass the ExecState through.
2134 * kjs/RegExpPrototype.cpp:
2135 (KJS::regExpProtoFuncCompile): Ditto.
2136 * kjs/StringPrototype.cpp:
2137 (KJS::stringProtoFuncMatch): Ditto.
2138 (KJS::stringProtoFuncSearch): Ditto.
2140 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
2141 so that we have access to an ExecState.
2143 (KJS::RegExpNode::):
2144 * kjs/nodes2string.cpp:
2146 (KJS::RegExp::RegExp): Pass the ExecState through.
2147 (KJS::RegExp::create): Ditto.
2149 * masm/IA32MacroAsm.h:
2150 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
2153 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
2156 2008-09-05 Mark Rowe <mrowe@apple.com>
2158 Reviewed by Oliver Hunt and Gavin Barraclough.
2160 Fix the build when CTI is disabled.
2163 (KJS::CodeBlock::~CodeBlock):
2164 * VM/CodeGenerator.cpp:
2165 (KJS::prepareJumpTableForStringSwitch):
2167 (KJS::Machine::Machine):
2168 (KJS::Machine::~Machine):
2170 2008-09-05 Gavin Barraclough <barraclough@apple.com>
2172 Reviewed by Mark Rowe.
2174 Fix some windows abi issues.
2177 (KJS::CTI::privateCompileMainPass):
2178 (KJS::CTI::privateCompileSlowCases):
2180 (KJS::CallRecord::CallRecord):
2183 (KJS::Machine::cti_op_resolve_func):
2184 (KJS::Machine::cti_op_post_inc):
2185 (KJS::Machine::cti_op_resolve_with_base):
2186 (KJS::Machine::cti_op_post_dec):
2189 2008-09-05 Mark Rowe <mrowe@apple.com>
2191 Reviewed by Sam Weinig.
2193 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
2196 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
2197 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
2199 2008-09-04 Mark Rowe <mrowe@apple.com>
2201 Reviewed by Sam Weinig.
2203 Fix fast/dom/Window/console-functions.html.
2205 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
2206 such as console.log would use the line number of the last JS function on the call stack.
2209 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
2210 and restore it when the function is done.
2211 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
2213 2008-09-05 Oliver Hunt <oliver@apple.com>
2215 Start bringing up SFX on windows.
2217 Reviewed by Mark Rowe and Sam Weinig
2219 Start doing the work to bring up SFX on windows. Initially
2220 just working on WREC, as it does not make any calls so reduces
2221 the amount of code that needs to be corrected.
2223 Start abstracting the CTI JIT codegen engine.
2226 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2227 * JavaScriptCore.xcodeproj/project.pbxproj:
2229 * masm/IA32MacroAsm.h:
2230 * masm/MacroAssembler.h: Added.
2231 (KJS::MacroAssembler::MacroAssembler):
2232 * masm/MacroAssemblerIA32GCC.cpp: Added.
2233 (KJS::MacroAssembler::emitConvertToFastCall):
2234 * masm/MacroAssemblerWin.cpp: Added.
2235 (KJS::MacroAssembler::emitConvertToFastCall):
2237 (KJS::WRECompiler::parseGreedyQuantifier):
2238 (KJS::WRECompiler::parseCharacterClass):
2239 (KJS::WRECompiler::parseEscape):
2240 (KJS::WRECompiler::compilePattern):
2243 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2245 Reviewed by Sam Weinig.
2247 Support for slow scripts (timeout checking).
2250 (KJS::CTI::privateCompileMainPass):
2251 (KJS::CTI::privateCompile):
2253 (KJS::slideRegisterWindowForCall):
2254 (KJS::Machine::cti_timeout_check):
2255 (KJS::Machine::cti_vm_throw):
2257 2008-09-04 Sam Weinig <sam@webkit.org>
2259 Reviewed by Mark Rowe.
2261 Third round of style cleanup.
2270 2008-09-04 Sam Weinig <sam@webkit.org>
2272 Reviewed by Jon Honeycutt.
2274 Second round of style cleanup.
2280 2008-09-04 Sam Weinig <sam@webkit.org>
2282 Reviewed by Mark Rowe.
2284 First round of style cleanup.
2288 * masm/IA32MacroAsm.h:
2292 2008-09-04 Geoffrey Garen <ggaren@apple.com>
2294 Reviewed by Mark Rowe.
2296 Merged http://trac.webkit.org/changeset/36081 to work with CTI.
2299 (KJS::Machine::tryCtiCacheGetByID):
2301 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2303 Reviewed by Sam Weinig.
2305 Enable profiling in CTI.
2309 (KJS::CTI::execute):
2311 (KJS::Machine::cti_op_call_JSFunction):
2312 (KJS::Machine::cti_op_call_NotJSFunction):
2313 (KJS::Machine::cti_op_ret):
2314 (KJS::Machine::cti_op_construct_JSConstruct):
2315 (KJS::Machine::cti_op_construct_NotJSConstruct):
2317 2008-09-04 Victor Hernandez <vhernandez@apple.com>
2319 Reviewed by Geoffrey Garen.
2321 Fixed an #if to support using WREC without CTI.
2324 (KJS::RegExp::match):
2326 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2328 Reviewed by Oliver Hunt.
2330 The array/string length trampolines are owned by the Machine, not the codeblock that compiled them.
2333 (KJS::CTI::privateArrayLengthTrampoline):
2334 (KJS::CTI::privateStringLengthTrampoline):
2336 (KJS::Machine::~Machine):
2339 2008-09-04 Mark Rowe <mrowe@apple.com>
2341 Reviewed by Gavin Barraclough and Sam Weinig.
2343 Fix a crash on launch of jsc when GuardMalloc is enabled.
2346 (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain.
2347 (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref.
2349 2008-09-03 Oliver Hunt <oliver@apple.com>
2351 Reviewed by Gavin Barraclough and Geoff Garen.
2353 Fix inspector and fast array access so that it bounds
2357 (KJS::CTI::privateCompile_pass2_Main):
2358 * masm/IA32MacroAsm.h:
2359 (KJS::IA32MacroAssembler::):
2360 (KJS::IA32MacroAssembler::emitUnlinkedJb):
2361 (KJS::IA32MacroAssembler::emitUnlinkedJbe):
2363 2008-09-03 Mark Rowe <mrowe@apple.com>
2365 Move the assertion after the InitializeAndReturn block, as
2366 that is used even when CTI is enabled.
2369 (KJS::Machine::privateExecute):
2371 2008-09-03 Mark Rowe <mrowe@apple.com>
2373 Reviewed by Sam Weinig.
2375 Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED.
2378 (KJS::CTI::privateCompile_pass1_Scan):
2379 (KJS::CTI::privateCompile_pass2_Main):
2380 (KJS::CTI::privateCompile_pass4_SlowCases):
2382 (KJS::Machine::privateExecute):
2383 (KJS::Machine::cti_vm_throw):
2385 2008-09-03 Mark Rowe <mrowe@apple.com>
2387 Reviewed by Sam Weinig.
2389 Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved
2390 by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86)
2396 (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for
2397 printing a ptrdiff_t.
2401 (KJS::RegExp::RegExp):
2402 (KJS::RegExp::~RegExp):
2403 (KJS::RegExp::match):
2405 * masm/IA32MacroAsm.h:
2408 * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to
2409 track whether any MASM-using features are enabled.
2411 2008-09-03 Gavin Barraclough <barraclough@apple.com>
2413 Reviewed by Oliver Hunt.
2415 Copy Geoff's array/string length optimization for CTI.
2418 (KJS::CTI::privateArrayLengthTrampoline):
2419 (KJS::CTI::privateStringLengthTrampoline):
2421 (KJS::CTI::compileArrayLengthTrampoline):
2422 (KJS::CTI::compileStringLengthTrampoline):
2424 (KJS::Machine::Machine):
2425 (KJS::Machine::getCtiArrayLengthTrampoline):
2426 (KJS::Machine::getCtiStringLengthTrampoline):
2427 (KJS::Machine::tryCtiCacheGetByID):
2428 (KJS::Machine::cti_op_get_by_id_second):
2433 2008-09-03 Gavin Barraclough <barraclough@apple.com>
2435 Reviewed by Oliver Hunt.
2437 Implement fast array accesses in CTI - 2-3% progression on sunspider.
2440 (KJS::CTI::emitFastArithIntToImmNoCheck):
2441 (KJS::CTI::compileOpCall):
2442 (KJS::CTI::privateCompile_pass2_Main):
2443 (KJS::CTI::privateCompile_pass4_SlowCases):
2447 2008-09-02 Gavin Barraclough <barraclough@apple.com>
2449 Reviewed by Oliver Hunt.
2451 Enable fast property access support in CTI.
2454 (KJS::ctiSetReturnAddress):
2455 (KJS::ctiRepatchCallByReturnAddress):
2456 (KJS::CTI::privateCompile_pass2_Main):
2457 (KJS::CTI::privateCompile):
2458 (KJS::CTI::privateCompileGetByIdSelf):
2459 (KJS::CTI::privateCompileGetByIdProto):
2460 (KJS::CTI::privateCompileGetByIdChain):
2461 (KJS::CTI::privateCompilePutByIdReplace):
2463 (KJS::CTI::compileGetByIdSelf):
2464 (KJS::CTI::compileGetByIdProto):
2465 (KJS::CTI::compileGetByIdChain):
2466 (KJS::CTI::compilePutByIdReplace):
2468 (KJS::CodeBlock::~CodeBlock):
2471 (KJS::doSetReturnAddressVmThrowTrampoline):
2472 (KJS::Machine::tryCtiCachePutByID):
2473 (KJS::Machine::tryCtiCacheGetByID):
2474 (KJS::Machine::cti_op_put_by_id):
2475 (KJS::Machine::cti_op_put_by_id_second):
2476 (KJS::Machine::cti_op_put_by_id_generic):
2477 (KJS::Machine::cti_op_put_by_id_fail):
2478 (KJS::Machine::cti_op_get_by_id):
2479 (KJS::Machine::cti_op_get_by_id_second):
2480 (KJS::Machine::cti_op_get_by_id_generic):
2481 (KJS::Machine::cti_op_get_by_id_fail):
2482 (KJS::Machine::cti_op_throw):
2483 (KJS::Machine::cti_vm_throw):
2487 * kjs/PropertyMap.h:
2488 * kjs/StructureID.cpp:
2489 (KJS::StructureIDChain::StructureIDChain):
2490 * masm/IA32MacroAsm.h:
2491 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2492 (KJS::IA32MacroAssembler::emitMovl_mr):
2493 (KJS::IA32MacroAssembler::emitMovl_rm):
2495 2008-09-02 Sam Weinig <sam@webkit.org>
2497 Reviewed by Gavin Barraclough and Mark Rowe.
2499 A backslash (\) at the of a RegEx should produce an error.
2500 Fixes fast/regex/test1.html.
2503 (KJS::WRECompiler::parseEscape):
2505 2008-09-02 Sam Weinig <sam@webkit.org>
2507 Reviewed by Geoff Garen.
2509 Link jumps for the slow case of op_loop_if_less. Fixes acid3.
2512 (KJS::CTI::privateCompile_pass4_SlowCases):
2514 2008-09-01 Sam Weinig <sam@webkit.org>
2516 Rubber-stamped by Maciej Stachowiak.
2518 Switch WREC on by default.
2522 2008-09-01 Sam Weinig <sam@webkit.org>
2524 Reviewed by Mark Rowe.
2526 Fix two failures in fast/regex/test1.html
2527 - \- in a character class should be treated as a literal -
2528 - A missing max quantifier needs to be treated differently than
2529 a null max quantifier.
2532 (KJS::WRECompiler::generateNonGreedyQuantifier):
2533 (KJS::WRECompiler::generateGreedyQuantifier):
2534 (KJS::WRECompiler::parseCharacterClass):
2536 (KJS::Quantifier::Quantifier):
2538 2008-09-01 Sam Weinig <sam@webkit.org>
2540 Reviewed by Mark Rowe.
2542 Fix crash in fast/js/kde/evil-n.html
2544 * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function.
2546 2008-09-01 Sam Weinig <sam@webkit.org>
2548 Reviewed by Gavin Barraclough and Mark Rowe.
2550 Add pattern length limit fixing one test in fast/js.
2553 (KJS::WRECompiler::compile):
2555 (KJS::WRECompiler::):
2557 2008-09-01 Sam Weinig <sam@webkit.org>
2559 Reviewed by Gavin Barraclough and Mark Rowe.
2561 Make octal escape parsing/back-reference parsing more closely match
2562 prior behavior fixing one test in fast/js.
2565 (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped
2566 (KJS::WRECompiler::parseEscape):
2568 (KJS::WRECompiler::peekDigit):
2570 2008-09-01 Sam Weinig <sam@webkit.org>
2572 Reviewed by Gavin Barraclough and Mark Rowe.
2574 Fix one mozilla test.
2577 (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not
2580 2008-09-01 Sam Weinig <sam@webkit.org>
2582 Reviewed by Gavin Barraclough and Mark Rowe.
2584 Parse octal escapes in character classes fixing one mozilla test.
2587 (KJS::WRECompiler::parseCharacterClass):
2588 (KJS::WRECompiler::parseOctalEscape):
2590 (KJS::WRECompiler::consumeOctal):
2592 2008-09-01 Sam Weinig <sam@webkit.org>
2594 Reviewed by Oliver Hunt.
2596 Fixes two mozilla tests with WREC enabled.
2599 (KJS::CharacterClassConstructor::append): Keep the character class sorted
2600 when appending another character class.
2602 2008-09-01 Sam Weinig <sam@webkit.org>
2604 Reviewed by Gavin Barraclough and Mark Rowe.
2606 Fixes two mozilla tests with WREC enabled.
2609 (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position
2610 instead of appending it to the end.
2612 2008-09-01 Gavin Barraclough <barraclough@apple.com>
2614 Reviewed by Oliver Hunt.
2616 Move cross-compilation unit call into NEVER_INLINE function.
2619 (KJS::doSetReturnAddressVmThrowTrampoline):
2621 2008-09-01 Sam Weinig <sam@webkit.org>
2623 Reviewed by Gavin Barraclough and Geoff Garen.
2625 Fix one test in fast/js.
2628 (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError,
2629 instead of a createNotAFunctionError.
2631 2008-08-31 Gavin Barraclough <barraclough@apple.com>
2633 Reviewed by Maciej Stachowiak.
2635 Zero-cost exception handling. This patch takes the exception checking
2636 back of the hot path. When an exception occurs in a Machine::cti*
2637 method, the return address to JIT code is recorded, and is then
2638 overwritten with a pointer to a trampoline routine. When the method
2639 returns the trampoline will cause the cti_vm_throw method to be invoked.
2641 cti_vm_throw uses the return address preserved above, to discover the
2642 vPC of the bytecode that raised the exception (using a map build during
2643 translation). From the VPC of the faulting bytecode the vPC of a catch
2644 routine may be discovered (unwinding the stack where necesary), and then
2645 a bytecode address for the catch routine is looked up. Final cti_vm_throw
2646 overwrites its return address to JIT code again, to trampoline directly
2647 to the catch routine.
2649 cti_op_throw is handled in a similar fashion.
2652 (KJS::CTI::emitPutCTIParam):
2653 (KJS::CTI::emitPutToCallFrameHeader):
2654 (KJS::CTI::emitGetFromCallFrameHeader):
2655 (KJS::ctiSetReturnAddressForArgs):
2656 (KJS::CTI::emitDebugExceptionCheck):
2657 (KJS::CTI::printOpcodeOperandTypes):
2658 (KJS::CTI::emitCall):
2659 (KJS::CTI::compileOpCall):
2660 (KJS::CTI::privateCompile_pass2_Main):
2661 (KJS::CTI::privateCompile):
2663 (KJS::CallRecord::CallRecord):
2665 (KJS::CTI::execute):
2668 (KJS::Machine::privateExecute):
2669 (KJS::Machine::cti_op_instanceof):
2670 (KJS::Machine::cti_op_call_NotJSFunction):
2671 (KJS::Machine::cti_op_resolve):
2672 (KJS::Machine::cti_op_resolve_func):
2673 (KJS::Machine::cti_op_resolve_skip):
2674 (KJS::Machine::cti_op_resolve_with_base):
2675 (KJS::Machine::cti_op_throw):
2676 (KJS::Machine::cti_op_in):
2677 (KJS::Machine::cti_vm_throw):
2678 * VM/RegisterFile.h:
2679 (KJS::RegisterFile::):
2681 (KJS::ExecState::setCtiReturnAddress):
2682 (KJS::ExecState::ctiReturnAddress):
2683 * masm/IA32MacroAsm.h:
2684 (KJS::IA32MacroAssembler::):
2685 (KJS::IA32MacroAssembler::emitPushl_m):
2686 (KJS::IA32MacroAssembler::emitPopl_m):
2687 (KJS::IA32MacroAssembler::getRelocatedAddress):
2689 2008-08-31 Mark Rowe <mrowe@apple.com>
2691 Reviewed by Oliver Hunt.
2693 Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them.
2696 (KJS::WRECompiler::parseParentheses):
2698 (KJS::WRECompiler::):
2700 2008-08-31 Mark Rowe <mrowe@apple.com>
2702 Reviewed by Oliver Hunt.
2704 Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled.
2707 (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum.
2708 (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register.
2709 (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag.
2711 2008-08-30 Mark Rowe <mrowe@apple.com>
2713 Reviewed by Oliver Hunt.
2715 Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance.
2716 This shows up as a 0.6% progression on SunSpider on my machine.
2718 Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out.
2721 (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc.
2722 * kjs/regexp.cpp: Ditto.
2723 * masm/IA32MacroAsm.h:
2724 (KJS::JITCodeBuffer::growBuffer):
2725 (KJS::JITCodeBuffer::JITCodeBuffer):
2726 (KJS::JITCodeBuffer::~JITCodeBuffer):
2727 (KJS::JITCodeBuffer::putByte):
2728 (KJS::JITCodeBuffer::putShort):
2729 (KJS::JITCodeBuffer::putInt):
2730 (KJS::JITCodeBuffer::reset):
2731 (KJS::JITCodeBuffer::copy):
2733 2008-08-29 Oliver Hunt <oliver@apple.com>
2737 Roll out previous patch as it causes a 5% performance regression
2739 * JavaScriptCore.xcodeproj/project.pbxproj:
2742 (KJS::CTI::privateCompile):
2744 (KJS::CodeBlock::~CodeBlock):
2745 * masm/IA32MacroAsm.h:
2746 (KJS::JITCodeBuffer::JITCodeBuffer):
2747 (KJS::JITCodeBuffer::putByte):
2748 (KJS::JITCodeBuffer::putShort):
2749 (KJS::JITCodeBuffer::putInt):
2750 (KJS::JITCodeBuffer::getEIP):
2751 (KJS::JITCodeBuffer::start):
2752 (KJS::JITCodeBuffer::getOffset):
2753 (KJS::JITCodeBuffer::reset):
2754 (KJS::JITCodeBuffer::copy):
2755 (KJS::IA32MacroAssembler::emitModRm_rr):
2756 (KJS::IA32MacroAssembler::emitModRm_rm):
2757 (KJS::IA32MacroAssembler::emitModRm_rmsib):
2758 (KJS::IA32MacroAssembler::IA32MacroAssembler):
2759 (KJS::IA32MacroAssembler::emitInt3):
2760 (KJS::IA32MacroAssembler::emitPushl_r):
2761 (KJS::IA32MacroAssembler::emitPopl_r):
2762 (KJS::IA32MacroAssembler::emitMovl_rr):
2763 (KJS::IA32MacroAssembler::emitAddl_rr):
2764 (KJS::IA32MacroAssembler::emitAddl_i8r):
2765 (KJS::IA32MacroAssembler::emitAddl_i32r):
2766 (KJS::IA32MacroAssembler::emitAddl_mr):
2767 (KJS::IA32MacroAssembler::emitAndl_rr):
2768 (KJS::IA32MacroAssembler::emitAndl_i32r):
2769 (KJS::IA32MacroAssembler::emitCmpl_i8r):
2770 (KJS::IA32MacroAssembler::emitCmpl_rr):
2771 (KJS::IA32MacroAssembler::emitCmpl_rm):
2772 (KJS::IA32MacroAssembler::emitCmpl_i32r):
2773 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2774 (KJS::IA32MacroAssembler::emitCmpw_rm):
2775 (KJS::IA32MacroAssembler::emitOrl_rr):
2776 (KJS::IA32MacroAssembler::emitOrl_i8r):
2777 (KJS::IA32MacroAssembler::emitSubl_rr):
2778 (KJS::IA32MacroAssembler::emitSubl_i8r):
2779 (KJS::IA32MacroAssembler::emitSubl_i32r):
2780 (KJS::IA32MacroAssembler::emitSubl_mr):
2781 (KJS::IA32MacroAssembler::emitTestl_i32r):
2782 (KJS::IA32MacroAssembler::emitTestl_rr):
2783 (KJS::IA32MacroAssembler::emitXorl_i8r):
2784 (KJS::IA32MacroAssembler::emitXorl_rr):
2785 (KJS::IA32MacroAssembler::emitSarl_i8r):
2786 (KJS::IA32MacroAssembler::emitSarl_CLr):
2787 (KJS::IA32MacroAssembler::emitShl_i8r):
2788 (KJS::IA32MacroAssembler::emitShll_CLr):
2789 (KJS::IA32MacroAssembler::emitMull_rr):
2790 (KJS::IA32MacroAssembler::emitIdivl_r):
2791 (KJS::IA32MacroAssembler::emitCdq):
2792 (KJS::IA32MacroAssembler::emitMovl_mr):
2793 (KJS::IA32MacroAssembler::emitMovzwl_mr):
2794 (KJS::IA32MacroAssembler::emitMovl_rm):
2795 (KJS::IA32MacroAssembler::emitMovl_i32r):
2796 (KJS::IA32MacroAssembler::emitMovl_i32m):
2797 (KJS::IA32MacroAssembler::emitLeal_mr):
2798 (KJS::IA32MacroAssembler::emitRet):
2799 (KJS::IA32MacroAssembler::emitJmpN_r):
2800 (KJS::IA32MacroAssembler::emitJmpN_m):
2801 (KJS::IA32MacroAssembler::emitCall):
2802 (KJS::IA32MacroAssembler::label):
2803 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
2804 (KJS::IA32MacroAssembler::emitUnlinkedJne):
2805 (KJS::IA32MacroAssembler::emitUnlinkedJe):
2806 (KJS::IA32MacroAssembler::emitUnlinkedJl):
2807 (KJS::IA32MacroAssembler::emitUnlinkedJle):
2808 (KJS::IA32MacroAssembler::emitUnlinkedJge):
2809 (KJS::IA32MacroAssembler::emitUnlinkedJae):
2810 (KJS::IA32MacroAssembler::emitUnlinkedJo):
2811 (KJS::IA32MacroAssembler::link):
2813 (KJS::WRECompiler::compilePattern):
2814 (KJS::WRECompiler::compile):
2817 2008-08-29 Mark Rowe <mrowe@apple.com>
2819 Reviewed by Oliver Hunt.
2821 Have JITCodeBuffer manage a Vector containing the generated code so that it can grow
2822 as needed when generating code for a large function. This fixes all six remaining failures
2823 in Mozilla tests in both debug and release builds.
2826 (KJS::CTI::privateCompile):
2828 (KJS::CodeBlock::~CodeBlock):
2829 * masm/IA32MacroAsm.h:
2830 (KJS::JITCodeBuffer::putByte):
2831 (KJS::JITCodeBuffer::putShort):
2832 (KJS::JITCodeBuffer::putInt):
2833 (KJS::JITCodeBuffer::getEIP):
2834 (KJS::JITCodeBuffer::start):
2835 (KJS::JITCodeBuffer::getOffset):
2836 (KJS::JITCodeBuffer::getCode):
2837 (KJS::IA32MacroAssembler::emitModRm_rr):
2839 (KJS::WRECompiler::compilePattern):
2842 2008-08-29 Mark Rowe <mrowe@apple.com>
2844 Reviewed by Oliver Hunt.
2846 Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests.
2849 (KJS::WRECompiler::parseOctalEscape):
2850 (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero.
2851 Add a FIXME about treating invalid backreferences as octal escapes in the future.
2853 (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than
2856 (WTF::isASCIIOctalDigit):
2858 2008-08-29 Sam Weinig <sam@webkit.org>
2860 Reviewed by Mark Rowe.
2862 Pass vPC to instanceof method. Fixes 2 mozilla tests in debug.
2865 (KJS::CTI::privateCompile_pass2_Main):
2867 (KJS::Machine::cti_op_instanceof):
2869 2008-08-29 Sam Weinig <sam@webkit.org>
2871 Reviewed by Mark Rowe.
2873 Pass vPCs to resolve methods for correct exception creation. Fixes
2874 17 mozilla tests in debug.
2877 (KJS::CTI::privateCompile_pass2_Main):
2880 (KJS::Machine::cti_op_resolve):
2881 (KJS::Machine::cti_op_resolve_func):
2882 (KJS::Machine::cti_op_resolve_skip):
2883 (KJS::Machine::cti_op_resolve_with_base):
2885 2008-08-29 Gavin Barraclough <barraclough@apple.com>
2887 Reviewed by Oliver Hunt.
2889 Remembering to actually throw the exception passed to op throw helps.
2890 Regressions 19 -> 6.
2893 (KJS::Machine::cti_op_throw):
2894 (KJS::Machine::cti_vm_throw):
2896 2008-08-29 Gavin Barraclough <barraclough@apple.com>
2898 Reviewed by Sam Weinig.
2900 Support for exception unwinding the stack.
2902 Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address
2903 is now preserved on entry to a JIT code function (if we preserve lazily we need
2904 restore the native return address during exception stack unwind). This takes
2905 the number of regressions down from ~150 to 19.
2909 (KJS::CTI::emitExceptionCheck):
2910 (KJS::CTI::compileOpCall):
2911 (KJS::CTI::privateCompile_pass2_Main):
2912 (KJS::CTI::privateCompile):
2916 (KJS::Machine::throwException):
2917 (KJS::Machine::cti_op_call_JSFunction):
2918 (KJS::Machine::cti_op_call_NotJSFunction):
2919 (KJS::Machine::cti_op_construct_JSConstruct):
2920 (KJS::Machine::cti_op_construct_NotJSConstruct):
2921 (KJS::Machine::cti_op_throw):
2922 (KJS::Machine::cti_vm_throw):
2924 2008-08-29 Mark Rowe <mrowe@apple.com>
2926 Reviewed by Oliver Hunt.
2928 Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled.
2931 (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches
2932 succeeded, jump to failure.
2933 (KJS::WRECompiler::compilePattern): Restore and increment the current position stored
2934 on the stack to ensure that it will be reset to the correct position after a failed
2935 match has consumed input.
2937 2008-08-29 Mark Rowe <mrowe@apple.com>
2939 Reviewed by Oliver Hunt.
2941 Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled.
2942 A backreference with a quantifier would get stuck in an infinite
2943 loop if the captured range was empty.
2946 (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range
2947 was empty, do not attempt to match the backreference.
2948 (KJS::WRECompiler::parseBackreferenceQuantifier):
2950 (KJS::Quantifier::):
2952 2008-08-28 Sam Weinig <sam@webkit.org>
2954 Reviewed by Oliver Hunt.
2959 (KJS::CTI::privateCompile_pass1_Scan):
2960 (KJS::CTI::privateCompile_pass2_Main):
2962 (KJS::Machine::debug):
2963 (KJS::Machine::privateExecute):
2964 (KJS::Machine::cti_op_debug):
2967 2008-08-28 Sam Weinig <sam@webkit.org>
2969 Reviewed by Gavin Barraclough and Geoff Garen.
2971 Implement op_switch_string fixing 1 mozilla test and one test in fast/js.
2974 (KJS::CTI::privateCompile_pass1_Scan):
2975 (KJS::CTI::privateCompile_pass2_Main):
2976 (KJS::CTI::privateCompile):
2978 (KJS::SwitchRecord::):
2979 (KJS::SwitchRecord::SwitchRecord):
2981 (KJS::CodeBlock::dump):
2983 (KJS::ExpressionRangeInfo::):
2984 (KJS::StringJumpTable::offsetForValue):
2985 (KJS::StringJumpTable::ctiForValue):
2986 (KJS::SimpleJumpTable::add):
2987 (KJS::SimpleJumpTable::ctiForValue):
2988 * VM/CodeGenerator.cpp:
2989 (KJS::prepareJumpTableForStringSwitch):
2991 (KJS::Machine::privateExecute):
2992 (KJS::Machine::cti_op_switch_string):
2995 2008-08-28 Gavin Barraclough <barraclough@apple.com>
2997 Reviewed by Oliver Hunt.
2999 Do not recurse on the machine stack when executing op_call.
3002 (KJS::CTI::emitGetPutArg):
3003 (KJS::CTI::emitPutArg):
3004 (KJS::CTI::emitPutArgConstant):
3005 (KJS::CTI::compileOpCall):
3006 (KJS::CTI::privateCompile_pass2_Main):
3007 (KJS::CTI::privateCompile):
3010 (KJS::CTI::compile):
3011 (KJS::CTI::execute):
3014 (KJS::Machine::Machine):
3015 (KJS::Machine::execute):
3016 (KJS::Machine::cti_op_call_JSFunction):
3017 (KJS::Machine::cti_op_call_NotJSFunction):
3018 (KJS::Machine::cti_op_ret):
3019 (KJS::Machine::cti_op_construct_JSConstruct):
3020 (KJS::Machine::cti_op_construct_NotJSConstruct):
3021 (KJS::Machine::cti_op_call_eval):
3024 (KJS::Register::Register):
3025 * VM/RegisterFile.h:
3026 (KJS::RegisterFile::):
3027 * kjs/InternalFunction.h:
3028 (KJS::InternalFunction::InternalFunction):
3030 (KJS::JSFunction::JSFunction):
3032 (KJS::ScopeChain::ScopeChain):
3033 * masm/IA32MacroAsm.h:
3034 (KJS::IA32MacroAssembler::):
3035 (KJS::IA32MacroAssembler::emitModRm_opm):
3036 (KJS::IA32MacroAssembler::emitCmpl_i32m):
3037 (KJS::IA32MacroAssembler::emitCallN_r):
3039 2008-08-28 Sam Weinig <sam@webkit.org>
3041 Reviewed by Mark Rowe.
3043 Exit instead of crashing in ctiUnsupported and ctiTimedOut.
3046 (KJS::ctiUnsupported):
3049 2008-08-28 Oliver Hunt <oliver@apple.com>
3051 Reviewed by Maciej Stachowiak.
3053 Implement codegen for op_jsr and op_sret.
3056 (KJS::CTI::privateCompile_pass1_Scan):
3057 (KJS::CTI::privateCompile_pass2_Main):
3058 (KJS::CTI::privateCompile):
3060 (KJS::CTI::JSRInfo::JSRInfo):
3061 * masm/IA32MacroAsm.h:
3062 (KJS::IA32MacroAssembler::emitJmpN_m):
3063 (KJS::IA32MacroAssembler::linkAbsoluteAddress):
3065 2008-08-28 Gavin Barraclough <barraclough@apple.com>
3067 Reviewed by Oliver Hunt.
3069 Initial support for exceptions (throw / catch must occur in same CodeBlock).
3072 (KJS::CTI::emitExceptionCheck):
3073 (KJS::CTI::emitCall):
3074 (KJS::CTI::privateCompile_pass2_Main):
3075 (KJS::CTI::privateCompile_pass4_SlowCases):
3076 (KJS::CTI::privateCompile):
3079 (KJS::CodeBlock::nativeExceptionCodeForHandlerVPC):
3081 * VM/CodeGenerator.cpp:
3082 (KJS::CodeGenerator::emitCatch):
3084 (KJS::Machine::throwException):
3085 (KJS::Machine::privateExecute):
3086 (KJS::ctiUnsupported):
3088 (KJS::Machine::cti_op_add):
3089 (KJS::Machine::cti_op_pre_inc):
3090 (KJS::Machine::cti_timeout_check):
3091 (KJS::Machine::cti_op_loop_if_less):
3092 (KJS::Machine::cti_op_put_by_id):
3093 (KJS::Machine::cti_op_get_by_id):
3094 (KJS::Machine::cti_op_instanceof):
3095 (KJS::Machine::cti_op_del_by_id):
3096 (KJS::Machine::cti_op_mul):
3097 (KJS::Machine::cti_op_call):
3098 (KJS::Machine::cti_op_resolve):
3099 (KJS::Machine::cti_op_construct):
3100 (KJS::Machine::cti_op_get_by_val):
3101 (KJS::Machine::cti_op_resolve_func):
3102 (KJS::Machine::cti_op_sub):
3103 (KJS::Machine::cti_op_put_by_val):
3104 (KJS::Machine::cti_op_lesseq):
3105 (KJS::Machine::cti_op_loop_if_true):
3106 (KJS::Machine::cti_op_negate):
3107 (KJS::Machine::cti_op_resolve_skip):
3108 (KJS::Machine::cti_op_div):
3109 (KJS::Machine::cti_op_pre_dec):
3110 (KJS::Machine::cti_op_jless):
3111 (KJS::Machine::cti_op_not):
3112 (KJS::Machine::cti_op_jtrue):
3113 (KJS::Machine::cti_op_post_inc):
3114 (KJS::Machine::cti_op_eq):
3115 (KJS::Machine::cti_op_lshift):
3116 (KJS::Machine::cti_op_bitand):
3117 (KJS::Machine::cti_op_rshift):
3118 (KJS::Machine::cti_op_bitnot):
3119 (KJS::Machine::cti_op_resolve_with_base):
3120 (KJS::Machine::cti_op_mod):
3121 (KJS::Machine::cti_op_less):
3122 (KJS::Machine::cti_op_neq):
3123 (KJS::Machine::cti_op_post_dec):
3124 (KJS::Machine::cti_op_urshift):
3125 (KJS::Machine::cti_op_bitxor):
3126 (KJS::Machine::cti_op_bitor):
3127 (KJS::Machine::cti_op_call_eval):
3128 (KJS::Machine::cti_op_throw):
3129 (KJS::Machine::cti_op_push_scope):
3130 (KJS::Machine::cti_op_stricteq):
3131 (KJS::Machine::cti_op_nstricteq):
3132 (KJS::Machine::cti_op_to_jsnumber):
3133 (KJS::Machine::cti_op_in):
3134 (KJS::Machine::cti_op_del_by_val):
3135 (KJS::Machine::cti_vm_throw):
3138 * masm/IA32MacroAsm.h:
3139 (KJS::IA32MacroAssembler::emitCmpl_i32m):
3141 2008-08-28 Mark Rowe <mrowe@apple.com>
3143 Rubber-stamped by Oliver Hunt.
3145 Print debugging info to stderr so that run-webkit-tests can capture it.
3146 This makes it easy to check whether test failures are due to unimplemented
3147 op codes, missing support for exceptions, etc.
3150 (KJS::CTI::privateCompile_pass1_Scan):
3151 (KJS::CTI::printOpcodeOperandTypes):
3152 (KJS::CTI::privateCompile_pass2_Main):
3153 (KJS::CTI::privateCompile_pass4_SlowCases):
3154 (KJS::CTI::privateCompile):
3156 (KJS::Machine::privateExecute):
3157 (KJS::ctiException):
3158 (KJS::ctiUnsupported):
3159 (KJS::Machine::cti_op_call):
3160 (KJS::Machine::cti_op_resolve):
3161 (KJS::Machine::cti_op_construct):
3162 (KJS::Machine::cti_op_get_by_val):
3163 (KJS::Machine::cti_op_resolve_func):
3164 (KJS::Machine::cti_op_resolve_skip):
3165 (KJS::Machine::cti_op_resolve_with_base):
3166 (KJS::Machine::cti_op_call_eval):
3168 2008-08-27 Mark Rowe <mrowe@apple.com>
3170 Reviewed by Gavin Barraclough and Maciej Stachowiak.
3172 Fix fast/js/bitwise-and-on-undefined.html.
3174 A temporary value in the slow path of op_bitand was being stored in edx, but was
3175 being clobbered by emitGetPutArg before we used it. To fix this, emitGetPutArg
3176 now takes a third argument that specifies the scratch register to use when loading
3177 from memory. This allows us to avoid clobbering the temporary in op_bitand.
3180 (KJS::CTI::emitGetPutArg):
3181 (KJS::CTI::privateCompile_pass2_Main):
3182 (KJS::CTI::privateCompile_pass4_SlowCases):
3185 2008-08-27 Mark Rowe <mrowe@apple.com>
3187 Rubber-stamped by Oliver Hunt.
3189 Switch CTI on by default.
3193 2008-08-27 Mark Rowe <mrowe@apple.com>
3195 Reviewed by Oliver Hunt.
3197 Fix the build of the full WebKit stack.
3199 * JavaScriptCore.xcodeproj/project.pbxproj: Mark two new headers as private so they can be pulled in from WebCore.
3200 * VM/CTI.h: Fix build issues that show up when compiled with GCC 4.2 as part of WebCore.
3201 * wrec/WREC.h: Ditto.
3203 2008-08-27 Mark Rowe <mrowe@apple.com>
3205 Reviewed by Sam Weinig.
3207 Implement op_new_error. Does not fix any tests as it is always followed by the unimplemented op_throw.
3210 (KJS::CTI::privateCompile_pass1_Scan):
3211 (KJS::CTI::privateCompile_pass2_Main):
3213 (KJS::Machine::cti_op_new_error):
3216 2008-08-27 Sam Weinig <sam@webkit.org>
3218 Reviewed by Gavin Barraclough and Geoff Garen.
3220 Implement op_put_getter and op_put_setter.
3223 (KJS::CTI::privateCompile_pass1_Scan):
3224 (KJS::CTI::privateCompile_pass2_Main):
3226 (KJS::Machine::cti_op_put_getter):
3227 (KJS::Machine::cti_op_put_setter):
3230 2008-08-27 Sam Weinig <sam@webkit.org>
3232 Reviewed by Gavin Barraclough and Geoff Garen.
3234 Implement op_del_by_val fixing 3 mozilla tests.
3237 (KJS::CTI::privateCompile_pass1_Scan):
3238 (KJS::CTI::privateCompile_pass2_Main):
3240 (KJS::Machine::cti_op_del_by_val):
3243 2008-08-27 Gavin Barraclough <barraclough@apple.com>
3245 Reviewed by Oliver Hunt.
3247 Quick & dirty fix to get SamplingTool sampling op_call.
3249 * VM/SamplingTool.h:
3250 (KJS::SamplingTool::callingHostFunction):
3252 2008-08-27 Sam Weinig <sam@webkit.org>
3254 Reviewed by Gavin Barraclough and Geoff Garen.
3256 Fix op_put_by_index.
3259 (KJS::CTI::privateCompile_pass2_Main): Use emitPutArgConstant instead of emitGetPutArg
3260 for the property value.
3262 (KJS::Machine::cti_op_put_by_index): Get the property value from the correct argument.
3264 2008-08-27 Sam Weinig <sam@webkit.org>
3266 Reviewed by Gavin Barraclough and Geoff Garen.
3268 Implement op_switch_imm in the CTI fixing 13 mozilla tests.
3271 (KJS::CTI::privateCompile_pass1_Scan):
3272 (KJS::CTI::privateCompile_pass2_Main):
3274 (KJS::Machine::cti_op_switch_imm):
3277 2008-08-27 Gavin Barraclough <barraclough@apple.com>
3279 Reviewed by Oliver Hunt.
3281 Implement op_switch_char in CTI.
3284 (KJS::CTI::emitCall):
3285 (KJS::CTI::privateCompile_pass1_Scan):
3286 (KJS::CTI::privateCompile_pass2_Main):
3287 (KJS::CTI::privateCompile):
3289 (KJS::CallRecord::CallRecord):
3290 (KJS::SwitchRecord::SwitchRecord):
3292 (KJS::SimpleJumpTable::SimpleJumpTable::ctiForValue):
3294 (KJS::Machine::cti_op_switch_char):
3296 * masm/IA32MacroAsm.h:
3297 (KJS::IA32MacroAssembler::):
3298 (KJS::IA32MacroAssembler::emitJmpN_r):
3299 (KJS::IA32MacroAssembler::getRelocatedAddress):
3302 2008-08-26 Sam Weinig <sam@webkit.org>
3304 Reviewed by Mark Rowe.
3306 Implement op_put_by_index to fix 1 mozilla test.
3309 (KJS::CTI::privateCompile_pass1_Scan):
3310 (KJS::CTI::privateCompile_pass2_Main):
3312 (KJS::Machine::cti_op_put_by_index):
3315 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3317 Reviewed by Geoff Garen.
3319 More fixes from Geoff's review.
3322 (KJS::CTI::emitGetArg):
3323 (KJS::CTI::emitGetPutArg):
3324 (KJS::CTI::emitPutArg):
3325 (KJS::CTI::emitPutArgConstant):
3326 (KJS::CTI::getConstantImmediateNumericArg):
3327 (KJS::CTI::emitGetCTIParam):
3328 (KJS::CTI::emitPutResult):
3329 (KJS::CTI::emitCall):
3330 (KJS::CTI::emitJumpSlowCaseIfNotImm):
3331 (KJS::CTI::emitJumpSlowCaseIfNotImms):
3332 (KJS::CTI::getDeTaggedConstantImmediate):
3333 (KJS::CTI::emitFastArithDeTagImmediate):
3334 (KJS::CTI::emitFastArithReTagImmediate):
3335 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
3336 (KJS::CTI::emitFastArithImmToInt):
3337 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
3338 (KJS::CTI::privateCompile_pass2_Main):
3339 (KJS::CTI::privateCompile_pass4_SlowCases):
3340 (KJS::CTI::privateCompile):
3343 2008-08-26 Mark Rowe <mrowe@apple.com>
3345 Reviewed by Gavin Barraclough and Geoff Garen.
3347 Implement op_jmp_scopes to fix 2 Mozilla tests.
3350 (KJS::CTI::privateCompile_pass1_Scan):
3351 (KJS::CTI::privateCompile_pass2_Main):
3353 (KJS::Machine::cti_op_push_new_scope): Update ExecState::m_scopeChain after calling ARG_setScopeChain.
3354 (KJS::Machine::cti_op_jmp_scopes):
3357 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3359 Reviewed by Oliver Hunt.
3361 WebKit Regular Expression Compiler. (set ENABLE_WREC = 1 in Platform.h).
3363 * JavaScriptCore.xcodeproj/project.pbxproj:
3367 * wrec/WREC.cpp: Added.
3368 * wrec/WREC.h: Added.
3371 2008-08-26 Sam Weinig <sam@webkit.org>
3373 Rubber-stamped by Oliver Hunt.
3375 Remove bogus assertion.
3378 (KJS::Machine::cti_op_del_by_id):
3380 2008-08-26 Mark Rowe <mrowe@apple.com>
3382 Reviewed by Sam Weinig.
3384 Implement op_push_new_scope and stub out op_catch. This fixes 11 Mozilla tests.
3387 (KJS::CTI::privateCompile_pass1_Scan):
3388 (KJS::CTI::privateCompile_pass2_Main):
3390 (KJS::Machine::cti_op_push_new_scope):
3391 (KJS::Machine::cti_op_catch):
3394 2008-08-26 Mark Rowe <mrowe@apple.com>
3396 Reviewed by Sam Weinig.
3398 Clean up op_resolve_base so that it shares its implementation with the bytecode interpreter.
3401 (KJS::inlineResolveBase):
3404 2008-08-26 Oliver Hunt <oliver@apple.com>
3406 Reviewed by Sam Weinig.
3408 Add codegen support for op_instanceof, fixing 15 mozilla tests.
3411 (KJS::CTI::privateCompile_pass1_Scan):
3412 (KJS::CTI::privateCompile_pass2_Main):
3414 (KJS::Machine::cti_op_instanceof):
3415 (KJS::Machine::cti_op_del_by_id):
3419 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3421 Reviewed by Geoff Garen.
3423 Fixes for initial review comments.
3426 (KJS::CTI::ctiCompileGetArg):
3427 (KJS::CTI::ctiCompileGetPutArg):
3428 (KJS::CTI::ctiCompilePutResult):
3429 (KJS::CTI::ctiCompileCall):
3431 (KJS::CTI::privateCompile_pass1_Scan):
3432 (KJS::CTI::printOpcodeOperandTypes):
3433 (KJS::CTI::privateCompile_pass2_Main):
3434 (KJS::CTI::privateCompile_pass4_SlowCases):
3435 (KJS::CTI::privateCompile):
3440 2008-08-26 Sam Weinig <sam@webkit.org>
3442 Reviewed by Gavin Barraclough and Geoff Garen.
3444 Fix up exception checking code.
3447 (KJS::Machine::cti_op_call):
3448 (KJS::Machine::cti_op_resolve):
3449 (KJS::Machine::cti_op_construct):
3450 (KJS::Machine::cti_op_resolve_func):
3451 (KJS::Machine::cti_op_resolve_skip):
3452 (KJS::Machine::cti_op_resolve_with_base):
3453 (KJS::Machine::cti_op_call_eval):
3455 2008-08-26 Sam Weinig <sam@webkit.org>
3457 Reviewed by Oliver Hunt.
3459 Fix slowcase for op_post_inc and op_post_dec fixing 2 mozilla tests.
3462 (KJS::CTI::privateCompile_pass4_SlowCases):
3464 2008-08-26 Mark Rowe <mrowe@apple.com>
3466 Reviewed by Sam Weinig.
3468 Implement op_in, fixing 8 mozilla tests.
3471 (KJS::CTI::privateCompile_pass1_Scan):
3472 (KJS::CTI::privateCompile_pass2_Main):
3474 (KJS::Machine::cti_op_in):
3477 2008-08-26 Mark Rowe <mrowe@apple.com>
3479 Rubber-stamped by Oliver Hunt.
3481 Don't hardcode the size of a Register for op_new_array. Fixes a crash
3482 seen during the Mozilla tests.
3485 (KJS::CTI::privateCompile_pass2_Main):
3487 2008-08-26 Sam Weinig <sam@webkit.org>
3489 Reviewed by Gavin Barraclough and Geoff Garen.
3491 Add support for op_push_scope and op_pop_scope, fixing 20 mozilla tests.
3494 (KJS::CTI::privateCompile_pass1_Scan):
3495 (KJS::CTI::privateCompile_pass2_Main):
3498 (KJS::Machine::cti_op_push_scope):
3499 (KJS::Machine::cti_op_pop_scope):
3502 2008-08-26 Oliver Hunt <oliver@apple.com>
3504 Reviewed by Maciej Stachowiak.
3506 Add codegen support for op_del_by_id, fixing 49 mozilla tests.
3509 (KJS::CTI::privateCompile_pass1_Scan):
3510 (KJS::CTI::privateCompile_pass2_Main):
3512 (KJS::Machine::cti_op_del_by_id):
3515 2008-08-26 Sam Weinig <sam@webkit.org>
3517 Reviewed by Gavin Barraclough and Geoff Garen.
3519 Don't hardcode the size of a Register for op_get_scoped_var and op_put_scoped_var
3520 fixing 513 mozilla tests in debug build.
3523 (KJS::CTI::privateCompile_pass2_Main):
3525 2008-08-26 Oliver Hunt <oliver@apple.com>
3527 Reviewed by Maciej Stachowiak.
3529 Added code generator support for op_loop, fixing around 60 mozilla tests.
3532 (KJS::CTI::privateCompile_pass1_Scan):
3533 (KJS::CTI::privateCompile_pass2_Main):
3535 2008-08-26 Mark Rowe <mrowe@apple.com>
3537 Reviewed by Sam Weinig.
3539 Set -fomit-frame-pointer in the correct location.
3541 * Configurations/JavaScriptCore.xcconfig:
3542 * JavaScriptCore.xcodeproj/project.pbxproj:
3544 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3546 Reviewed by Geoff Garen.
3548 Inital cut of CTI, Geoff's review fixes to follow.
3550 * JavaScriptCore.xcodeproj/project.pbxproj:
3551 * VM/CTI.cpp: Added.
3553 (KJS::CTI::ctiCompileGetArg):
3554 (KJS::CTI::ctiCompileGetPutArg):
3555 (KJS::CTI::ctiCompilePutArg):
3556 (KJS::CTI::ctiCompilePutArgImm):
3557 (KJS::CTI::ctiImmediateNumericArg):
3558 (KJS::CTI::ctiCompileGetCTIParam):
3559 (KJS::CTI::ctiCompilePutResult):
3560 (KJS::CTI::ctiCompileCall):
3561 (KJS::CTI::slowCaseIfNotImm):
3562 (KJS::CTI::slowCaseIfNotImms):
3563 (KJS::CTI::ctiFastArithDeTagConstImmediate):
3564 (KJS::CTI::ctiFastArithDeTagImmediate):
3565 (KJS::CTI::ctiFastArithReTagImmediate):
3566 (KJS::CTI::ctiFastArithPotentiallyReTagImmediate):
3567 (KJS::CTI::ctiFastArithImmToInt):
3568 (KJS::CTI::ctiFastArithIntToImmOrSlowCase):
3570 (KJS::CTI::privateCompile_pass1_Scan):
3571 (KJS::CTI::ctiCompileAdd):
3572 (KJS::CTI::ctiCompileAddImm):
3573 (KJS::CTI::ctiCompileAddImmNotInt):
3574 (KJS::CTI::TEMP_HACK_PRINT_TYPES):
3575 (KJS::CTI::privateCompile_pass2_Main):
3576 (KJS::CTI::privateCompile_pass3_Link):
3577 (KJS::CTI::privateCompile_pass4_SlowCases):
3578 (KJS::CTI::privateCompile):
3580 (KJS::CTI2Result::CTI2Result):
3581 (KJS::CallRecord::CallRecord):
3582 (KJS::JmpTable::JmpTable):
3583 (KJS::SlowCaseEntry::SlowCaseEntry):
3584 (KJS::CTI::compile):
3585 (KJS::CTI::LabelInfo::LabelInfo):
3587 (KJS::CodeBlock::CodeBlock):
3588 (KJS::CodeBlock::~CodeBlock):
3590 (KJS::Machine::execute):
3591 (KJS::Machine::privateExecute):
3592 (KJS::ctiException):
3593 (KJS::ctiUnsupported):
3595 (KJS::Machine::cti_op_end):
3596 (KJS::Machine::cti_op_add):
3597 (KJS::Machine::cti_op_pre_inc):
3598 (KJS::Machine::cti_timeout_check):
3599 (KJS::Machine::cti_op_loop_if_less):
3600 (KJS::Machine::cti_op_new_object):
3601 (KJS::Machine::cti_op_put_by_id):
3602 (KJS::Machine::cti_op_get_by_id):
3603 (KJS::Machine::cti_op_mul):
3604 (KJS::Machine::cti_op_new_func):
3605 (KJS::Machine::cti_op_call):
3606 (KJS::Machine::cti_op_ret):
3607 (KJS::Machine::cti_op_new_array):