1 2008-09-19 Sam Weinig <sam@webkit.org>
3 Reviewed by Darin Adler.
5 Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
6 Speed up JS property enumeration by caching entire PropertyNameArray
8 1.3% speedup on Sunspider, 30% on string-fasta.
11 * VM/JSPropertyNameIterator.cpp:
12 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
13 (JSC::JSPropertyNameIterator::invalidate):
14 * VM/JSPropertyNameIterator.h:
15 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
16 (JSC::JSPropertyNameIterator::create):
18 (JSC::JSObject::getPropertyNames):
19 * kjs/PropertyMap.cpp:
20 (JSC::PropertyMap::getEnumerablePropertyNames):
22 * kjs/PropertyNameArray.cpp:
23 (JSC::PropertyNameArray::add):
24 * kjs/PropertyNameArray.h:
25 (JSC::PropertyNameArrayData::create):
26 (JSC::PropertyNameArrayData::propertyNameVector):
27 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
28 (JSC::PropertyNameArrayData::cachedPrototypeChain):
29 (JSC::PropertyNameArrayData::begin):
30 (JSC::PropertyNameArrayData::end):
31 (JSC::PropertyNameArrayData::PropertyNameArrayData):
32 (JSC::PropertyNameArray::PropertyNameArray):
33 (JSC::PropertyNameArray::addKnownUnique):
34 (JSC::PropertyNameArray::size):
35 (JSC::PropertyNameArray::operator[]):
36 (JSC::PropertyNameArray::begin):
37 (JSC::PropertyNameArray::end):
38 (JSC::PropertyNameArray::setData):
39 (JSC::PropertyNameArray::data):
40 (JSC::PropertyNameArray::releaseData):
42 (JSC::ScopeChainNode::print):
43 * kjs/StructureID.cpp:
44 (JSC::structureIDChainsAreEqual):
45 (JSC::StructureID::getEnumerablePropertyNames):
46 (JSC::StructureID::clearEnumerationCache):
47 (JSC::StructureID::createCachedPrototypeChain):
50 2008-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
52 Reviewed by Maciej Stachowiak.
54 Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
57 (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
59 2008-09-19 Darin Adler <darin@apple.com>
61 Reviewed by Sam Weinig.
63 - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
64 make each distinct C++ class get a distinct JSC::Structure
66 * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
68 * kjs/JSGlobalObject.h: Changed the protected constructor to take a
69 structure instead of a prototype.
71 * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
73 2008-09-19 Julien Chaffraix <jchaffraix@pleyo.com>
75 Reviewed by Alexey Proskuryakov.
77 Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
78 non-template methods' code been copied for each instance of the template.
79 The patch splits RefCounted between a base class that holds non-template methods and attributes
80 and the template RefCounted class that keeps the same functionnality.
82 On my Linux with gcc 4.3 for the Gtk port, this is:
83 - a ~600KB save on libwebkit.so in release.
84 - a ~1.6MB save on libwebkit.so in debug.
86 It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
87 On the whole, it should be a small win as we reduce the compiled code size and the only
88 new function call should be inlined by the compiler.
91 (WTF::RefCountedBase::ref): Copied from RefCounted.
92 (WTF::RefCountedBase::hasOneRef): Ditto.
93 (WTF::RefCountedBase::refCount): Ditto.
94 (WTF::RefCountedBase::RefCountedBase): Ditto.
95 (WTF::RefCountedBase::~RefCountedBase): Ditto.
96 (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
98 (WTF::RefCounted::RefCounted):
99 (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
100 (WTF::RefCounted::~RefCounted): Keep private destructor.
102 2008-09-18 Darin Adler <darin@apple.com>
104 Reviewed by Maciej Stachowiak.
106 - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
107 make each distinct C++ class get a distinct JSC::Structure
109 * kjs/lookup.h: Removed things here that were used only in WebCore:
110 cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
111 and JSC_IMPLEMENT_PROTOTYPE.
113 2008-09-18 Darin Adler <darin@apple.com>
115 Reviewed by Maciej Stachowiak.
117 - https://bugs.webkit.org/show_bug.cgi?id=20927
118 simplify/streamline the code to turn strings into identifiers while parsing
120 * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
124 (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
125 * kjs/lexer.h: Remove makeUString.
127 * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
129 * VM/CodeGenerator.cpp:
130 (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
131 (JSC::prepareJumpTableForStringSwitch): Ditto.
133 (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
134 (JSC::processClauseList): Ditto.
135 * kjs/nodes2string.cpp:
136 (JSC::StringNode::streamTo): Ditto.
138 2008-09-18 Sam Weinig <sam@webkit.org>
143 (JSC::Instruction::Instruction):
145 2008-09-18 Oliver Hunt <oliver@apple.com>
147 Reviewed by Maciej Stachowiak.
149 Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
150 <https://bugs.webkit.org/show_bug.cgi?id=20911>
152 The problem was simply caused by the int constructor for Instruction
153 failing to initialise the full struct in 64bit builds.
156 (JSC::Instruction::Instruction):
158 2008-09-18 Darin Adler <darin@apple.com>
162 * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
164 2008-09-18 Darin Adler <darin@apple.com>
166 Reviewed by Sam Weinig.
168 * kjs/JSGlobalObject.h: Tiny style guideline tweak.
170 2008-09-18 Darin Adler <darin@apple.com>
172 Reviewed by Sam Weinig.
174 - fix https://bugs.webkit.org/show_bug.cgi?id=20925
175 LEAK messages appear every time I quit
177 * JavaScriptCore.exp: Updated, and also added an export
178 needed for future WebCore use of JSC::StructureID.
180 * wtf/RefCountedLeakCounter.cpp:
181 (WTF::RefCountedLeakCounter::suppressMessages): Added.
182 (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
183 (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
184 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
185 log the reason there was no leak checking done.
186 (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
187 (WTF::RefCountedLeakCounter::decrement): Ditto.
189 * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
190 new functions, suppressMessages and cancelMessageSuppression. Also
191 added m_ prefixes to the data member names.
193 2008-09-18 Holger Hans Peter Freyther <zecke@selfish.org>
195 Reviewed by Mark Rowe.
197 https://bugs.webkit.org/show_bug.cgi?id=20437
199 Add a proper #define to define which XML Parser implementation to use. Client
200 code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
201 implementation is going to be used.
205 2008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca>
207 Reviewed by Maciej Stachowiak.
209 Make a Unicode non-breaking space count as a whitespace character in
210 PCRE. This change was already made in WREC, and it fixes one of the
211 Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
212 in a new set of expected test results.
214 * pcre/pcre_internal.h:
216 * tests/mozilla/expected.html:
218 2008-09-18 Stephanie Lewis <slewis@apple.com>
220 Reviewed by Mark Rowe and Maciej Stachowiak.
222 add an option use arch to specify which architecture to run.
224 * tests/mozilla/jsDriver.pl:
226 2008-09-17 Oliver Hunt <oliver@apple.com>
228 Correctly restore argument reference prior to SFX runtime calls.
230 Reviewed by Steve Falkenburg.
233 (JSC::CTI::privateCompileSlowCases):
234 (JSC::CTI::privateCompile):
236 2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
238 Reviewed by Maciej Stachowiak.
240 Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
241 <https://bugs.webkit.org/show_bug.cgi?id=20876>
243 r36417 and r36427 caused an get_by_id opcode to be emitted before the
244 instanceof and construct opcodes, in order to enable inline caching of
245 the prototype property. Unfortunately, this regressed some tests dealing
246 with exceptions thrown by 'instanceof' and the 'new' operator. We fix
247 these problems by detecting whether an "is not an object" exception is
248 thrown before op_instanceof or op_construct, and emit the proper
249 exception in those cases.
251 * VM/CodeGenerator.cpp:
252 (JSC::CodeGenerator::emitConstruct):
253 * VM/CodeGenerator.h:
254 * VM/ExceptionHelpers.cpp:
255 (JSC::createInvalidParamError):
256 (JSC::createNotAConstructorError):
257 (JSC::createNotAnObjectError):
258 * VM/ExceptionHelpers.h:
260 (JSC::Machine::getOpcode):
261 (JSC::Machine::privateExecute):
264 (JSC::NewExprNode::emitCode):
265 (JSC::InstanceOfNode::emitCode):
267 2008-09-17 Gavin Barraclough <barraclough@apple.com>
269 Reviewed by Oliver Hunt.
271 JIT generation cti_op_construct_verify.
273 Quarter to half percent progression on v8-tests.
274 Roughly not change on SunSpider (possible minor progression).
277 (JSC::CTI::privateCompileMainPass):
281 2008-09-15 Steve Falkenburg <sfalken@apple.com>
283 Improve timer accuracy for JavaScript Date object on Windows.
285 Use a combination of ftime and QueryPerformanceCounter.
286 ftime returns the information we want, but doesn't have sufficient resolution.
287 QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
288 To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
289 QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to
290 correct for drift if the low-res and high-res elapsed time between calls differs by more
291 than twice the low-resolution timer resolution.
293 QueryPerformanceCounter may be inaccurate due to a problems with:
294 - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
295 - BIOS bugs (http://support.microsoft.com/kb/895980/)
296 - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
298 Reviewed by Darin Adler.
301 (JSC::highResUpTime):
302 (JSC::lowResUTCTime):
304 (JSC::getCurrentUTCTimeWithMicroseconds):
306 2008-09-17 Gavin Barraclough <barraclough@apple.com>
308 Reviewed by Geoff Garen.
310 Implement JIT generation of CallFrame initialization, for op_call.
312 1% sunspider 2.5% v8-tests.
315 (JSC::CTI::compileOpCall):
317 (JSC::Machine::cti_op_call_JSFunction):
318 (JSC::Machine::cti_op_call_NotJSFunction):
320 2008-09-17 Gavin Barraclough <barraclough@apple.com>
322 Reviewed by Geoff Garen.
324 Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code,
325 move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
326 functions, instead of checking prior to making the call.
328 3% on v8-tests (4% on richards, 6% in delta-blue)
331 (JSC::CTI::compileOpCall):
332 (JSC::CTI::privateCompileSlowCases):
333 (JSC::CTI::privateCompile):
335 (JSC::Machine::execute):
336 (JSC::Machine::cti_op_call_JSFunction):
337 (JSC::Machine::cti_vm_compile):
338 (JSC::Machine::cti_vm_updateScopeChain):
339 (JSC::Machine::cti_op_construct_JSConstruct):
342 2008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com>
344 Fix the QtWebKit/Mac build
346 * wtf/ThreadingQt.cpp:
347 (WTF::initializeThreading): use QCoreApplication to get the main thread
349 2008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
351 Reviewed by Maciej Stachowiak.
353 Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
354 <https://bugs.webkit.org/show_bug.cgi?id=20857>
356 Fix a problem stemming from the slightly unsafe behaviour of the
357 CodeGenerator::finalDestination() method by putting the "func" argument
358 of the emitConstruct() method in a RefPtr in its caller. Also, add an
359 assertion guaranteeing that this is always the case.
361 CodeGenerator::finalDestination() is still incorrect and can cause
362 problems with a different allocator; see bug 20340 for more details.
364 * VM/CodeGenerator.cpp:
365 (JSC::CodeGenerator::emitConstruct):
367 (JSC::NewExprNode::emitCode):
369 2008-09-16 Alice Liu <alice.liu@apple.com>
374 (JSC::CTI::privateCompileMainPass):
376 2008-09-16 Gavin Barraclough <barraclough@apple.com>
378 Reviewed by Geoff Garen.
380 CTI code generation for op_ret. The majority of the work
381 (updating variables on the stack & on exec) can be performed
382 directly in generated code.
384 We still need to check, & to call out to C-code to handle
385 activation records, profiling, and full scope chains.
387 +1.5% Sunspider, +5/6% v8 tests.
390 (JSC::CTI::emitPutCTIParam):
391 (JSC::CTI::compileOpCall):
392 (JSC::CTI::privateCompileMainPass):
395 (JSC::Machine::cti_op_ret_activation):
396 (JSC::Machine::cti_op_ret_profiler):
397 (JSC::Machine::cti_op_ret_scopeChain):
400 2008-09-16 Dimitri Glazkov <dglazkov@chromium.org>
402 Fix the Windows build.
404 Add some extra parentheses to stop MSVC from complaining so much.
407 (JSC::Machine::privateExecute):
408 (JSC::Machine::cti_op_stricteq):
409 (JSC::Machine::cti_op_nstricteq):
410 * kjs/operations.cpp:
413 2008-09-15 Maciej Stachowiak <mjs@apple.com>
415 Reviewed by Cameron Zwarich.
417 - speed up the === and !== operators by choosing the fast cases better
419 No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
422 (JSC::Machine::privateExecute):
423 (JSC::Machine::cti_op_stricteq):
424 (JSC::Machine::cti_op_nstricteq):
426 (JSC::JSImmediate::areBothImmediate):
427 * kjs/operations.cpp:
429 (JSC::strictEqualSlowCase):
432 2008-09-15 Oliver Hunt <oliver@apple.com>
436 Coding style cleanup.
439 (JSC::Machine::privateExecute):
441 2008-09-15 Oliver Hunt <oliver@apple.com>
443 Reviewed by Cameron Zwarich.
445 Bug 20874: op_resolve does not do any form of caching
446 <https://bugs.webkit.org/show_bug.cgi?id=20874>
448 This patch adds an op_resolve_global opcode to handle (and cache)
449 property lookup we can statically determine must occur on the global
452 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
453 10% in math-partial-sums
456 (JSC::CTI::privateCompileMainPass):
459 (JSC::CodeBlock::dump):
460 * VM/CodeGenerator.cpp:
461 (JSC::CodeGenerator::findScopedProperty):
462 (JSC::CodeGenerator::emitResolve):
464 (JSC::resolveGlobal):
465 (JSC::Machine::privateExecute):
466 (JSC::Machine::cti_op_resolve_global):
470 2008-09-15 Sam Weinig <sam@webkit.org>
472 Roll out r36462. It broke document.all.
475 (JSC::CTI::privateCompileMainPass):
476 (JSC::CTI::privateCompileSlowCases):
479 (JSC::Machine::Machine):
480 (JSC::Machine::cti_op_eq_null):
481 (JSC::Machine::cti_op_neq_null):
483 (JSC::Machine::isJSString):
485 * kjs/JSWrapperObject.h:
486 * kjs/StringObject.h:
487 * kjs/StringObjectThatMasqueradesAsUndefined.h:
489 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
491 Reviewed by Maciej Stachowiak.
493 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
494 <https://bugs.webkit.org/show_bug.cgi?id=20863>
496 r36427 changed the number of arguments to op_construct without changing
497 the argument index for the vPC in the call to initializeCallFrame() in
498 the CTI case. This caused a JSC test failure. Correcting the argument
499 index fixes the test failure.
502 (JSC::Machine::cti_op_construct_JSConstruct):
504 2008-09-15 Mark Rowe <mrowe@apple.com>
510 2008-09-15 Geoffrey Garen <ggaren@apple.com>
512 Reviewed by Maciej Stachowiak.
514 Fixed a typo in op_get_by_id_chain that caused it to miss every time
517 Also, a little cleanup.
520 (JSC::Machine::privateExecute): Set up baseObject before entering the
521 loop, so we compare against the right values.
523 2008-09-15 Geoffrey Garen <ggaren@apple.com>
525 Reviewed by Sam Weinig.
527 Removed the CalledAsConstructor flag from the call frame header. Now,
528 we use an explicit opcode at the call site to fix up constructor results.
530 SunSpider says 0.4% faster.
532 cti_op_construct_verify is an out-of-line function call for now, but we
533 can fix that once StructureID holds type information like isObject.
536 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
539 (JSC::CodeBlock::dump):
541 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
542 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
543 (JSC::CodeGenerator::emitConstruct): ... ditto.
545 * VM/Machine.cpp: No more CalledAsConstructor
546 (JSC::Machine::privateExecute): Implementation for the new opcode.
547 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
548 called as a constructor.
549 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
552 * VM/Opcode.h: Declare new opcode.
555 (JSC::RegisterFile::): No more CalledAsConstructor
557 2008-09-15 Gavin Barraclough <barraclough@apple.com>
559 Reviewed by Geoff Garen.
561 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
562 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
563 masquerading may be handled differently (through the StructureIDs - see bug
569 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
570 (JSC::CTI::privateCompileMainPass):
571 (JSC::CTI::privateCompileSlowCases):
574 (JSC::Machine::Machine):
575 (JSC::Machine::cti_op_eq_null):
576 (JSC::Machine::cti_op_neq_null):
578 (JSC::Machine::doesMasqueradesAsUndefined):
579 * kjs/JSWrapperObject.h:
580 (JSC::JSWrapperObject::):
581 (JSC::JSWrapperObject::JSWrapperObject):
582 * kjs/StringObject.h:
583 (JSC::StringObject::StringObject):
584 * kjs/StringObjectThatMasqueradesAsUndefined.h:
585 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
587 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
589 Rubber-stamped by Oliver Hunt.
591 r36427 broke CodeBlock::dump() by changing the number of arguments to
592 op_construct without changing the code that prints it. This patch fixes
593 it by printing the additional argument.
595 * JavaScriptCore.xcodeproj/project.pbxproj:
597 (JSC::CodeBlock::dump):
599 2008-09-15 Adam Roben <aroben@apple.com>
603 * kjs/StructureID.cpp: Removed a stray semicolon.
605 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
607 Reviewed by Maciej Stachowiak.
609 Fix a crash in fast/js/exception-expression-offset.html caused by not
610 updating all mentions of the length of op_construct in r36427.
613 (JSC::Machine::cti_op_construct_NotJSConstruct):
615 2008-09-15 Maciej Stachowiak <mjs@apple.com>
617 Reviewed by Cameron Zwarich.
619 - fix layout test failure introduced by fix for 20849
621 (The failing test was fast/js/delete-then-put.html)
624 (JSC::JSObject::removeDirect): Clear enumeration cache
625 in the dictionary case.
627 (JSC::JSObject::putDirect): Ditto.
629 (JSC::StructureID::clearEnumerationCache): Inline to handle the
632 2008-09-15 Maciej Stachowiak <mjs@apple.com>
634 Reviewed by Cameron Zwarich.
636 - fix JSC test failures introduced by fix for 20849
638 * kjs/PropertyMap.cpp:
639 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
641 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
643 Reviewed by Maciej Stachowiak.
645 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
646 <https://bugs.webkit.org/show_bug.cgi?id=20851>
648 r36410 introduced an optimization for parseInt() that is incorrect when
649 its argument is larger than the range of a 32-bit integer. If the
650 argument is a number that is not an immediate integer, then the correct
651 behaviour is to return the floor of its value, unless it is an infinite
652 value, in which case the correct behaviour is to return 0.
654 * kjs/JSGlobalObjectFunctions.cpp:
655 (JSC::globalFuncParseInt):
657 2008-09-15 Sam Weinig <sam@webkit.org>
659 Reviewed by Maciej Stachowiak.
661 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
662 Cache property names for getEnumerablePropertyNames in the StructureID.
664 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
665 on the v8 test suite.
668 (JSC::JSObject::getPropertyNames):
669 * kjs/PropertyMap.cpp:
670 (JSC::PropertyMap::getEnumerablePropertyNames):
672 * kjs/StructureID.cpp:
673 (JSC::StructureID::StructureID):
674 (JSC::StructureID::getEnumerablePropertyNames):
677 2008-09-14 Maciej Stachowiak <mjs@apple.com>
679 Reviewed by Cameron Zwarich.
681 - speed up JS construction by extracting "prototype" lookup so PIC applies.
683 ~0.5% speedup on SunSpider
684 Speeds up some of the V8 tests as well, most notably earley-boyer.
687 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
688 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
689 * VM/CodeGenerator.cpp:
690 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
692 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
693 (JSC::Machine::cti_op_construct_JSConstruct): ditto
694 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
696 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
698 Reviewed by Eric Seidel.
700 Add a protected destructor for RefCounted.
702 It is wrong to call its destructor directly, because (1) this should be taken care of by
703 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
705 No change in behavior.
707 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
709 2008-09-14 Gavin Barraclough <barraclough@apple.com>
711 Reviewed by Sam Weinig.
713 Accelerated property accesses.
715 Inline more of the array access code into the JIT code for get/put_by_val.
716 Accelerate get/put_by_id by speculatively inlining a disable direct access
717 into the hot path of the code, and repatch this with the correct StructureID
718 and property map offset once these are known. In the case of accesses to the
719 prototype and reading the array-length a trampoline is genertaed, and the
720 branch to the slow-case is relinked to jump to this.
722 By repatching, we mean rewriting the x86 instruction stream. Instructions are
723 only modified in a simple fasion - altering immediate operands, memory access
724 deisplacements, and branch offsets.
726 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
727 instruction's immediate operant is updateded, and a memory access operation's
728 displacement is updated to access the correct field on the object. In the case
729 of more complex accesses (array length and get_by_id_prototype) the offset on
730 the branch to slow-case is updated, to now jump to a trampoline.
732 +2.8% sunspider, +13% v8-tests
735 (JSC::CTI::emitCall):
736 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
738 (JSC::CTI::privateCompileMainPass):
739 (JSC::CTI::privateCompileSlowCases):
740 (JSC::CTI::privateCompile):
741 (JSC::CTI::privateCompileGetByIdSelf):
742 (JSC::CTI::privateCompileGetByIdProto):
743 (JSC::CTI::privateCompileGetByIdChain):
744 (JSC::CTI::privateCompilePutByIdReplace):
745 (JSC::CTI::privateCompilePutByIdTransition):
746 (JSC::CTI::privateCompileArrayLengthTrampoline):
747 (JSC::CTI::privateCompileStringLengthTrampoline):
748 (JSC::CTI::patchGetByIdSelf):
749 (JSC::CTI::patchPutByIdReplace):
750 (JSC::CTI::privateCompilePatchGetArrayLength):
751 (JSC::CTI::privateCompilePatchGetStringLength):
753 (JSC::CTI::compileGetByIdSelf):
754 (JSC::CTI::compileGetByIdProto):
755 (JSC::CTI::compileGetByIdChain):
756 (JSC::CTI::compilePutByIdReplace):
757 (JSC::CTI::compilePutByIdTransition):
758 (JSC::CTI::compileArrayLengthTrampoline):
759 (JSC::CTI::compileStringLengthTrampoline):
760 (JSC::CTI::compilePatchGetArrayLength):
761 (JSC::CTI::compilePatchGetStringLength):
763 (JSC::CodeBlock::dump):
764 (JSC::CodeBlock::~CodeBlock):
766 (JSC::StructureStubInfo::StructureStubInfo):
767 (JSC::CodeBlock::getStubInfo):
769 (JSC::Machine::tryCTICachePutByID):
770 (JSC::Machine::tryCTICacheGetByID):
771 (JSC::Machine::cti_op_put_by_val_array):
773 * masm/X86Assembler.h:
774 (JSC::X86Assembler::):
775 (JSC::X86Assembler::cmpl_i8m):
776 (JSC::X86Assembler::emitUnlinkedJa):
777 (JSC::X86Assembler::getRelocatedAddress):
778 (JSC::X86Assembler::getDifferenceBetweenLabels):
779 (JSC::X86Assembler::emitModRm_opmsib):
781 2008-09-14 Maciej Stachowiak <mjs@apple.com>
783 Reviewed by Cameron Zwarich.
785 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
787 ~5% speedup on v8 earley-boyer test
789 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
790 * API/JSCallbackObjectFunctions.h:
791 (JSC::::hasInstance): Ditto.
792 * API/JSValueRef.cpp:
793 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
794 * JavaScriptCore.exp:
796 (JSC::CTI::privateCompileMainPass): Pass along prototype.
798 (JSC::CodeBlock::dump): Print third arg.
799 * VM/CodeGenerator.cpp:
800 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
802 * VM/CodeGenerator.h:
804 (JSC::Machine::privateExecute): Pass along the prototype.
805 (JSC::Machine::cti_op_instanceof): ditto
807 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
810 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
811 property and pass that register to instanceof.
814 2008-09-14 Gavin Barraclough <barraclough@apple.com>
816 Reviewed by Sam Weinig.
818 Remove unnecessary virtual function call from cti_op_call_JSFunction -
819 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
822 (JSC::Machine::cti_op_call_JSFunction):
824 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
826 Reviewed by Maciej Stachowiak.
828 Bug 20827: the 'typeof' operator is slow
829 <https://bugs.webkit.org/show_bug.cgi?id=20827>
831 Optimize the 'typeof' operator when its result is compared to a constant
834 This is a 5.5% speedup on the V8 Earley-Boyer test.
837 (JSC::CTI::privateCompileMainPass):
839 (JSC::CodeBlock::dump):
840 * VM/CodeGenerator.cpp:
841 (JSC::CodeGenerator::emitEqualityOp):
842 * VM/CodeGenerator.h:
844 (JSC::jsIsObjectType):
845 (JSC::jsIsFunctionType):
846 (JSC::Machine::privateExecute):
847 (JSC::Machine::cti_op_is_undefined):
848 (JSC::Machine::cti_op_is_boolean):
849 (JSC::Machine::cti_op_is_number):
850 (JSC::Machine::cti_op_is_string):
851 (JSC::Machine::cti_op_is_object):
852 (JSC::Machine::cti_op_is_function):
856 (JSC::BinaryOpNode::emitCode):
857 (JSC::EqualNode::emitCode):
858 (JSC::StrictEqualNode::emitCode):
861 2008-09-14 Sam Weinig <sam@webkit.org>
863 Reviewed by Cameron Zwarich.
865 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
866 Speed up parseInt for numbers
868 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
869 No change on the v8 suite.
871 * kjs/JSGlobalObjectFunctions.cpp:
872 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
873 convert them back to numbers.
875 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
877 Reviewed by Oliver Hunt.
879 Bug 20816: op_lesseq should be optimized
880 <https://bugs.webkit.org/show_bug.cgi?id=20816>
882 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
884 This is a 9.4% speedup on the V8 Crypto benchmark.
887 (JSC::CTI::privateCompileMainPass):
888 (JSC::CTI::privateCompileSlowCases):
890 (JSC::CodeBlock::dump):
891 * VM/CodeGenerator.cpp:
892 (JSC::CodeGenerator::emitJumpIfTrue):
894 (JSC::Machine::privateExecute):
895 (JSC::Machine::cti_op_loop_if_lesseq):
899 2008-09-14 Sam Weinig <sam@webkit.org>
901 Reviewed by Cameron Zwarich.
903 Cleanup Sampling code.
906 (JSC::CTI::emitCall):
907 (JSC::CTI::privateCompileMainPass):
910 * VM/SamplingTool.cpp:
912 (JSC::SamplingTool::run):
913 (JSC::SamplingTool::dump):
915 (JSC::SamplingTool::callingHostFunction):
917 2008-09-13 Oliver Hunt <oliver@apple.com>
919 Reviewed by Cameron Zwarich.
921 Bug 20821: Cache property transitions to speed up object initialization
922 https://bugs.webkit.org/show_bug.cgi?id=20821
924 Implement a transition cache to improve the performance of new properties
925 being added to objects. This is extremely beneficial in constructors and
926 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
930 (JSC::CTI::privateCompileMainPass):
932 (JSC::transitionWillNeedStorageRealloc):
933 (JSC::CTI::privateCompilePutByIdTransition):
935 (JSC::CTI::compilePutByIdTransition):
937 (JSC::printPutByIdOp):
938 (JSC::CodeBlock::printStructureIDs):
939 (JSC::CodeBlock::dump):
940 (JSC::CodeBlock::derefStructureIDs):
941 (JSC::CodeBlock::refStructureIDs):
942 * VM/CodeGenerator.cpp:
943 (JSC::CodeGenerator::emitPutById):
945 (JSC::cachePrototypeChain):
946 (JSC::Machine::tryCachePutByID):
947 (JSC::Machine::tryCacheGetByID):
948 (JSC::Machine::privateExecute):
949 (JSC::Machine::tryCTICachePutByID):
950 (JSC::Machine::tryCTICacheGetByID):
954 (JSC::JSObject::putDirect):
955 (JSC::JSObject::transitionTo):
956 * kjs/PutPropertySlot.h:
957 (JSC::PutPropertySlot::PutPropertySlot):
958 (JSC::PutPropertySlot::wasTransition):
959 (JSC::PutPropertySlot::setWasTransition):
960 * kjs/StructureID.cpp:
961 (JSC::StructureID::transitionTo):
962 (JSC::StructureIDChain::StructureIDChain):
964 (JSC::StructureID::previousID):
965 (JSC::StructureID::setCachedPrototypeChain):
966 (JSC::StructureID::cachedPrototypeChain):
967 (JSC::StructureID::propertyMap):
968 * masm/X86Assembler.h:
969 (JSC::X86Assembler::addl_i8m):
970 (JSC::X86Assembler::subl_i8m):
972 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
974 Reviewed by Maciej Stachowiak.
976 Bug 20819: JSValue::isObject() is slow
977 <https://bugs.webkit.org/show_bug.cgi?id=20819>
979 Optimize JSCell::isObject() and JSCell::isString() by making them
980 non-virtual calls that rely on the StructureID type information.
982 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
985 * JavaScriptCore.exp:
988 (JSC::JSCell::isObject):
989 (JSC::JSCell::isString):
994 (JSC::JSString::JSString):
996 (JSC::StructureID::type):
998 2008-09-11 Stephanie Lewis <slewis@apple.com>
1000 Reviewed by Oliver Hunt.
1002 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
1003 crash on CNN and on Dromaeo.
1004 Fix Missing close tag in vcproj.
1006 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1008 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1012 Correct an SVN problem with the last commit and actually add the new
1015 * wrec/CharacterClassConstructor.cpp: Added.
1017 (JSC::getCharacterClassNewline):
1018 (JSC::getCharacterClassDigits):
1019 (JSC::getCharacterClassSpaces):
1020 (JSC::getCharacterClassWordchar):
1021 (JSC::getCharacterClassNondigits):
1022 (JSC::getCharacterClassNonspaces):
1023 (JSC::getCharacterClassNonwordchar):
1024 (JSC::CharacterClassConstructor::addSorted):
1025 (JSC::CharacterClassConstructor::addSortedRange):
1026 (JSC::CharacterClassConstructor::put):
1027 (JSC::CharacterClassConstructor::flush):
1028 (JSC::CharacterClassConstructor::append):
1029 * wrec/CharacterClassConstructor.h: Added.
1030 (JSC::CharacterClassConstructor::CharacterClassConstructor):
1031 (JSC::CharacterClassConstructor::isUpsideDown):
1032 (JSC::CharacterClassConstructor::charClass):
1034 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1036 Reviewed by Maciej Stachowiak.
1038 Bug 20788: Split CharacterClassConstructor into its own file
1039 <https://bugs.webkit.org/show_bug.cgi?id=20788>
1041 Split CharacterClassConstructor into its own file and clean up some
1044 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1045 * JavaScriptCore.xcodeproj/project.pbxproj:
1046 * wrec/CharacterClassConstructor.cpp: Added.
1048 (JSC::getCharacterClassNewline):
1049 (JSC::getCharacterClassDigits):
1050 (JSC::getCharacterClassSpaces):
1051 (JSC::getCharacterClassWordchar):
1052 (JSC::getCharacterClassNondigits):
1053 (JSC::getCharacterClassNonspaces):
1054 (JSC::getCharacterClassNonwordchar):
1055 (JSC::CharacterClassConstructor::addSorted):
1056 (JSC::CharacterClassConstructor::addSortedRange):
1057 (JSC::CharacterClassConstructor::put):
1058 (JSC::CharacterClassConstructor::flush):
1059 (JSC::CharacterClassConstructor::append):
1060 * wrec/CharacterClassConstructor.h: Added.
1061 (JSC::CharacterClassConstructor::CharacterClassConstructor):
1062 (JSC::CharacterClassConstructor::isUpsideDown):
1063 (JSC::CharacterClassConstructor::charClass):
1065 (JSC::WRECParser::parseCharacterClass):
1067 2008-09-10 Simon Hausmann <hausmann@webkit.org>
1069 Not reviewed but trivial one-liner for yet unused macro.
1071 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
1073 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
1077 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1079 Rubber-stamped by Oliver Hunt.
1081 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
1085 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
1086 * masm/X86Assembler.h:
1087 (JSC::X86Assembler::orl_i32r):
1089 (JSC::WRECGenerator::generatePatternCharacter):
1090 (JSC::WRECGenerator::generateCharacterClassInverted):
1092 2008-09-10 Sam Weinig <sam@webkit.org>
1094 Reviewed by Geoff Garen.
1096 Add inline property storage for JSObject.
1098 1.2% progression on Sunspider. .5% progression on the v8 test suite.
1100 * JavaScriptCore.exp:
1102 (JSC::CTI::privateCompileGetByIdProto):
1103 (JSC::CTI::privateCompileGetByIdChain):
1105 (JSC::JSObject::mark): There is no reason to check storageSize now that
1107 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
1109 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
1110 now so there is no reason to .get()
1111 (JSC::JSObject::usingInlineStorage):
1112 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
1114 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
1116 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
1117 we know that we are about to add a property that will overflow the inline
1119 * kjs/PropertyMap.cpp:
1120 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
1121 now handled by JSObject.
1122 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
1123 * kjs/PropertyMap.h:
1124 (JSC::PropertyMap::storageSize): Rename from markingCount.
1125 * kjs/StructureID.cpp:
1126 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
1127 if we are using inline storage.
1128 * kjs/StructureID.h:
1130 2008-09-10 Oliver Hunt <oliver@apple.com>
1132 Reviewed by Geoff Garen.
1134 Inline immediate number version of op_mul.
1136 Renamed mull_rr to imull_rr as that's what it's
1137 actually doing, and added imull_i32r for the constant
1138 case immediate multiply.
1140 1.1% improvement to SunSpider.
1143 (JSC::CTI::privateCompileMainPass):
1144 (JSC::CTI::privateCompileSlowCases):
1145 * masm/X86Assembler.h:
1146 (JSC::X86Assembler::):
1147 (JSC::X86Assembler::imull_rr):
1148 (JSC::X86Assembler::imull_i32r):
1150 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1156 * JavaScriptCore.xcodeproj/project.pbxproj:
1158 2008-09-09 Oliver Hunt <oliver@apple.com>
1160 Reviewed by Maciej Stachowiak.
1162 Add optimised access to known properties on the global object.
1164 Improve cross scope access to the global object by emitting
1165 code to access it directly rather than by walking the scope chain.
1167 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
1170 (JSC::CTI::privateCompileMainPass):
1171 (JSC::CTI::emitGetVariableObjectRegister):
1172 (JSC::CTI::emitPutVariableObjectRegister):
1175 (JSC::CodeBlock::dump):
1176 * VM/CodeGenerator.cpp:
1177 (JSC::CodeGenerator::findScopedProperty):
1178 (JSC::CodeGenerator::emitResolve):
1179 (JSC::CodeGenerator::emitGetScopedVar):
1180 (JSC::CodeGenerator::emitPutScopedVar):
1181 * VM/CodeGenerator.h:
1183 (JSC::Machine::privateExecute):
1186 (JSC::FunctionCallResolveNode::emitCode):
1187 (JSC::PostfixResolveNode::emitCode):
1188 (JSC::PrefixResolveNode::emitCode):
1189 (JSC::ReadModifyResolveNode::emitCode):
1190 (JSC::AssignResolveNode::emitCode):
1192 2008-09-10 Maciej Stachowiak <mjs@apple.com>
1196 - enable polymorphic inline caching of properties of primitives
1198 1.012x speedup on SunSpider.
1200 We create special structure IDs for JSString and
1201 JSNumberCell. Unlike normal structure IDs, these cannot hold the
1202 true prototype. Due to JS autoboxing semantics, the prototype used
1203 when looking up string or number properties depends on the lexical
1204 global object of the call site, not the creation site. Thus we
1205 enable StructureIDs to handle this quirk for primitives.
1207 Everything else should be straightforward.
1210 (JSC::CTI::privateCompileGetByIdProto):
1211 (JSC::CTI::privateCompileGetByIdChain):
1213 (JSC::CTI::compileGetByIdProto):
1214 (JSC::CTI::compileGetByIdChain):
1215 * VM/JSPropertyNameIterator.h:
1216 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1218 (JSC::Machine::Machine):
1219 (JSC::cachePrototypeChain):
1220 (JSC::Machine::tryCachePutByID):
1221 (JSC::Machine::tryCacheGetByID):
1222 (JSC::Machine::privateExecute):
1223 (JSC::Machine::tryCTICachePutByID):
1224 (JSC::Machine::tryCTICacheGetByID):
1225 * kjs/GetterSetter.h:
1226 (JSC::GetterSetter::GetterSetter):
1228 * kjs/JSGlobalData.cpp:
1229 (JSC::JSGlobalData::JSGlobalData):
1230 * kjs/JSGlobalData.h:
1231 * kjs/JSGlobalObject.h:
1232 (JSC::StructureID::prototypeForLookup):
1233 * kjs/JSNumberCell.h:
1234 (JSC::JSNumberCell::JSNumberCell):
1235 (JSC::jsNumberCell):
1237 (JSC::JSObject::prototype):
1241 (JSC::jsOwnedString):
1243 (JSC::JSString::JSString):
1245 (JSC::jsSingleCharacterString):
1246 (JSC::jsSingleCharacterSubstring):
1247 (JSC::jsNontrivialString):
1248 * kjs/SmallStrings.cpp:
1249 (JSC::SmallStrings::createEmptyString):
1250 (JSC::SmallStrings::createSingleCharacterString):
1251 * kjs/StructureID.cpp:
1252 (JSC::StructureID::StructureID):
1253 (JSC::StructureID::addPropertyTransition):
1254 (JSC::StructureID::getterSetterTransition):
1255 (JSC::StructureIDChain::StructureIDChain):
1256 * kjs/StructureID.h:
1257 (JSC::StructureID::create):
1258 (JSC::StructureID::storedPrototype):
1260 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
1262 Reviewed by Sam Weinig.
1264 https://bugs.webkit.org/show_bug.cgi?id=20746
1266 Added WINCE platform macro.
1270 2008-09-09 Sam Weinig <sam@webkit.org>
1272 Reviewed by Mark Rowe.
1274 Remove unnecessary override of getOffset.
1276 Sunspider reports this as a .6% progression.
1278 * JavaScriptCore.exp:
1280 (JSC::JSObject::getDirectLocation):
1281 (JSC::JSObject::getOwnPropertySlotForWrite):
1282 (JSC::JSObject::putDirect):
1283 * kjs/PropertyMap.cpp:
1284 * kjs/PropertyMap.h:
1286 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1288 Reviewed by Maciej Stachowiak.
1290 Bug 20759: Remove MacroAssembler
1291 <https://bugs.webkit.org/show_bug.cgi?id=20759>
1293 Remove MacroAssembler and move its functionality to X86Assembler.
1295 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1296 * JavaScriptCore.xcodeproj/project.pbxproj:
1298 (JSC::CTI::emitGetArg):
1299 (JSC::CTI::emitGetPutArg):
1300 (JSC::CTI::emitPutArg):
1301 (JSC::CTI::emitPutCTIParam):
1302 (JSC::CTI::emitGetCTIParam):
1303 (JSC::CTI::emitPutToCallFrameHeader):
1304 (JSC::CTI::emitGetFromCallFrameHeader):
1305 (JSC::CTI::emitPutResult):
1306 (JSC::CTI::emitDebugExceptionCheck):
1307 (JSC::CTI::emitJumpSlowCaseIfNotImm):
1308 (JSC::CTI::emitJumpSlowCaseIfNotImms):
1309 (JSC::CTI::emitFastArithDeTagImmediate):
1310 (JSC::CTI::emitFastArithReTagImmediate):
1311 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
1312 (JSC::CTI::emitFastArithImmToInt):
1313 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
1314 (JSC::CTI::emitFastArithIntToImmNoCheck):
1315 (JSC::CTI::compileOpCall):
1316 (JSC::CTI::emitSlowScriptCheck):
1317 (JSC::CTI::privateCompileMainPass):
1318 (JSC::CTI::privateCompileSlowCases):
1319 (JSC::CTI::privateCompile):
1320 (JSC::CTI::privateCompileGetByIdSelf):
1321 (JSC::CTI::privateCompileGetByIdProto):
1322 (JSC::CTI::privateCompileGetByIdChain):
1323 (JSC::CTI::privateCompilePutByIdReplace):
1324 (JSC::CTI::privateArrayLengthTrampoline):
1325 (JSC::CTI::privateStringLengthTrampoline):
1326 (JSC::CTI::compileRegExp):
1328 (JSC::CallRecord::CallRecord):
1329 (JSC::JmpTable::JmpTable):
1330 (JSC::SlowCaseEntry::SlowCaseEntry):
1331 (JSC::CTI::JSRInfo::JSRInfo):
1332 * masm/MacroAssembler.h: Removed.
1333 * masm/MacroAssemblerWin.cpp: Removed.
1334 * masm/X86Assembler.h:
1335 (JSC::X86Assembler::emitConvertToFastCall):
1336 (JSC::X86Assembler::emitRestoreArgumentReference):
1338 (JSC::WRECGenerator::WRECGenerator):
1339 (JSC::WRECParser::WRECParser):
1341 2008-09-09 Sam Weinig <sam@webkit.org>
1343 Reviewed by Cameron Zwarich.
1345 Don't waste the first item in the PropertyStorage.
1347 - Fix typo (makingCount -> markingCount)
1348 - Remove undefined method declaration.
1350 No change on Sunspider.
1353 (JSC::JSObject::mark):
1354 * kjs/PropertyMap.cpp:
1355 (JSC::PropertyMap::put):
1356 (JSC::PropertyMap::remove):
1357 (JSC::PropertyMap::getOffset):
1358 (JSC::PropertyMap::insert):
1359 (JSC::PropertyMap::rehash):
1360 (JSC::PropertyMap::resizePropertyStorage):
1361 (JSC::PropertyMap::checkConsistency):
1362 * kjs/PropertyMap.h:
1363 (JSC::PropertyMap::markingCount): Fix typo.
1365 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1369 Speculative Windows build fix.
1371 * masm/MacroAssemblerWin.cpp:
1372 (JSC::MacroAssembler::emitConvertToFastCall):
1373 (JSC::MacroAssembler::emitRestoreArgumentReference):
1375 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1377 Reviewed by Maciej Stachowiak.
1379 Bug 20755: Create an X86 namespace for register names and other things
1380 <https://bugs.webkit.org/show_bug.cgi?id=20755>
1382 Create an X86 namespace to put X86 register names. Perhaps I will move
1383 opcode names here later as well.
1386 (JSC::CTI::emitGetArg):
1387 (JSC::CTI::emitGetPutArg):
1388 (JSC::CTI::emitPutArg):
1389 (JSC::CTI::emitPutArgConstant):
1390 (JSC::CTI::emitPutCTIParam):
1391 (JSC::CTI::emitGetCTIParam):
1392 (JSC::CTI::emitPutToCallFrameHeader):
1393 (JSC::CTI::emitGetFromCallFrameHeader):
1394 (JSC::CTI::emitPutResult):
1395 (JSC::CTI::emitDebugExceptionCheck):
1396 (JSC::CTI::emitJumpSlowCaseIfNotImms):
1397 (JSC::CTI::compileOpCall):
1398 (JSC::CTI::emitSlowScriptCheck):
1399 (JSC::CTI::privateCompileMainPass):
1400 (JSC::CTI::privateCompileSlowCases):
1401 (JSC::CTI::privateCompile):
1402 (JSC::CTI::privateCompileGetByIdSelf):
1403 (JSC::CTI::privateCompileGetByIdProto):
1404 (JSC::CTI::privateCompileGetByIdChain):
1405 (JSC::CTI::privateCompilePutByIdReplace):
1406 (JSC::CTI::privateArrayLengthTrampoline):
1407 (JSC::CTI::privateStringLengthTrampoline):
1408 (JSC::CTI::compileRegExp):
1410 * masm/X86Assembler.h:
1412 (JSC::X86Assembler::emitModRm_rm):
1413 (JSC::X86Assembler::emitModRm_rm_Unchecked):
1414 (JSC::X86Assembler::emitModRm_rmsib):
1416 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1417 (JSC::WRECGenerator::generateGreedyQuantifier):
1418 (JSC::WRECGenerator::generateParentheses):
1419 (JSC::WRECGenerator::generateBackreference):
1420 (JSC::WRECGenerator::gernerateDisjunction):
1423 2008-09-09 Sam Weinig <sam@webkit.org>
1425 Reviewed by Geoffrey Garen.
1427 Remove unnecessary friend declaration.
1429 * kjs/PropertyMap.h:
1431 2008-09-09 Sam Weinig <sam@webkit.org>
1433 Reviewed by Geoffrey Garen.
1435 Replace uses of PropertyMap::get and PropertyMap::getLocation with
1436 PropertyMap::getOffset.
1438 Sunspider reports this as a .6% improvement.
1440 * JavaScriptCore.exp:
1442 (JSC::JSObject::put):
1443 (JSC::JSObject::deleteProperty):
1444 (JSC::JSObject::getPropertyAttributes):
1446 (JSC::JSObject::getDirect):
1447 (JSC::JSObject::getDirectLocation):
1448 (JSC::JSObject::locationForOffset):
1449 * kjs/PropertyMap.cpp:
1450 (JSC::PropertyMap::remove):
1451 (JSC::PropertyMap::getOffset):
1452 * kjs/PropertyMap.h:
1454 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1456 Reviewed by Sam Weinig.
1458 Bug 20754: Remove emit prefix from assembler opcode methods
1459 <https://bugs.webkit.org/show_bug.cgi?id=20754>
1462 (JSC::CTI::emitGetArg):
1463 (JSC::CTI::emitGetPutArg):
1464 (JSC::CTI::emitPutArg):
1465 (JSC::CTI::emitPutArgConstant):
1466 (JSC::CTI::emitPutCTIParam):
1467 (JSC::CTI::emitGetCTIParam):
1468 (JSC::CTI::emitPutToCallFrameHeader):
1469 (JSC::CTI::emitGetFromCallFrameHeader):
1470 (JSC::CTI::emitPutResult):
1471 (JSC::CTI::emitDebugExceptionCheck):
1472 (JSC::CTI::emitCall):
1473 (JSC::CTI::emitJumpSlowCaseIfNotImm):
1474 (JSC::CTI::emitJumpSlowCaseIfNotImms):
1475 (JSC::CTI::emitFastArithDeTagImmediate):
1476 (JSC::CTI::emitFastArithReTagImmediate):
1477 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
1478 (JSC::CTI::emitFastArithImmToInt):
1479 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
1480 (JSC::CTI::emitFastArithIntToImmNoCheck):
1481 (JSC::CTI::compileOpCall):
1482 (JSC::CTI::emitSlowScriptCheck):
1483 (JSC::CTI::privateCompileMainPass):
1484 (JSC::CTI::privateCompileSlowCases):
1485 (JSC::CTI::privateCompile):
1486 (JSC::CTI::privateCompileGetByIdSelf):
1487 (JSC::CTI::privateCompileGetByIdProto):
1488 (JSC::CTI::privateCompileGetByIdChain):
1489 (JSC::CTI::privateCompilePutByIdReplace):
1490 (JSC::CTI::privateArrayLengthTrampoline):
1491 (JSC::CTI::privateStringLengthTrampoline):
1492 (JSC::CTI::compileRegExp):
1493 * masm/MacroAssemblerWin.cpp:
1494 (JSC::MacroAssembler::emitConvertToFastCall):
1495 (JSC::MacroAssembler::emitRestoreArgumentReference):
1496 * masm/X86Assembler.h:
1497 (JSC::X86Assembler::pushl_r):
1498 (JSC::X86Assembler::pushl_m):
1499 (JSC::X86Assembler::popl_r):
1500 (JSC::X86Assembler::popl_m):
1501 (JSC::X86Assembler::movl_rr):
1502 (JSC::X86Assembler::addl_rr):
1503 (JSC::X86Assembler::addl_i8r):
1504 (JSC::X86Assembler::addl_i32r):
1505 (JSC::X86Assembler::addl_mr):
1506 (JSC::X86Assembler::andl_rr):
1507 (JSC::X86Assembler::andl_i32r):
1508 (JSC::X86Assembler::cmpl_i8r):
1509 (JSC::X86Assembler::cmpl_rr):
1510 (JSC::X86Assembler::cmpl_rm):
1511 (JSC::X86Assembler::cmpl_i32r):
1512 (JSC::X86Assembler::cmpl_i32m):
1513 (JSC::X86Assembler::cmpw_rm):
1514 (JSC::X86Assembler::orl_rr):
1515 (JSC::X86Assembler::subl_rr):
1516 (JSC::X86Assembler::subl_i8r):
1517 (JSC::X86Assembler::subl_i32r):
1518 (JSC::X86Assembler::subl_mr):
1519 (JSC::X86Assembler::testl_i32r):
1520 (JSC::X86Assembler::testl_rr):
1521 (JSC::X86Assembler::xorl_i8r):
1522 (JSC::X86Assembler::xorl_rr):
1523 (JSC::X86Assembler::sarl_i8r):
1524 (JSC::X86Assembler::sarl_CLr):
1525 (JSC::X86Assembler::shl_i8r):
1526 (JSC::X86Assembler::shll_CLr):
1527 (JSC::X86Assembler::mull_rr):
1528 (JSC::X86Assembler::idivl_r):
1529 (JSC::X86Assembler::cdq):
1530 (JSC::X86Assembler::movl_mr):
1531 (JSC::X86Assembler::movzwl_mr):
1532 (JSC::X86Assembler::movl_rm):
1533 (JSC::X86Assembler::movl_i32r):
1534 (JSC::X86Assembler::movl_i32m):
1535 (JSC::X86Assembler::leal_mr):
1536 (JSC::X86Assembler::ret):
1537 (JSC::X86Assembler::jmp_r):
1538 (JSC::X86Assembler::jmp_m):
1539 (JSC::X86Assembler::call_r):
1541 (JSC::WRECGenerator::generateBacktrack1):
1542 (JSC::WRECGenerator::generateBacktrackBackreference):
1543 (JSC::WRECGenerator::generateBackreferenceQuantifier):
1544 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1545 (JSC::WRECGenerator::generateGreedyQuantifier):
1546 (JSC::WRECGenerator::generatePatternCharacter):
1547 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
1548 (JSC::WRECGenerator::generateCharacterClassInverted):
1549 (JSC::WRECGenerator::generateCharacterClass):
1550 (JSC::WRECGenerator::generateParentheses):
1551 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
1552 (JSC::WRECGenerator::generateAssertionBOL):
1553 (JSC::WRECGenerator::generateAssertionEOL):
1554 (JSC::WRECGenerator::generateAssertionWordBoundary):
1555 (JSC::WRECGenerator::generateBackreference):
1556 (JSC::WRECGenerator::gernerateDisjunction):
1558 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1560 Reviewed by Maciej Stachowiak.
1562 Clean up the WREC code some more.
1565 (JSC::CTI::compileRegExp):
1567 (JSC::getCharacterClassNewline):
1568 (JSC::getCharacterClassDigits):
1569 (JSC::getCharacterClassSpaces):
1570 (JSC::getCharacterClassWordchar):
1571 (JSC::getCharacterClassNondigits):
1572 (JSC::getCharacterClassNonspaces):
1573 (JSC::getCharacterClassNonwordchar):
1574 (JSC::WRECGenerator::generateBacktrack1):
1575 (JSC::WRECGenerator::generateBacktrackBackreference):
1576 (JSC::WRECGenerator::generateBackreferenceQuantifier):
1577 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1578 (JSC::WRECGenerator::generateGreedyQuantifier):
1579 (JSC::WRECGenerator::generatePatternCharacter):
1580 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
1581 (JSC::WRECGenerator::generateCharacterClassInverted):
1582 (JSC::WRECGenerator::generateCharacterClass):
1583 (JSC::WRECGenerator::generateParentheses):
1584 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
1585 (JSC::WRECGenerator::generateAssertionBOL):
1586 (JSC::WRECGenerator::generateAssertionEOL):
1587 (JSC::WRECGenerator::generateAssertionWordBoundary):
1588 (JSC::WRECGenerator::generateBackreference):
1589 (JSC::WRECGenerator::gernerateDisjunction):
1590 (JSC::WRECParser::parseCharacterClass):
1591 (JSC::WRECParser::parseEscape):
1592 (JSC::WRECParser::parseTerm):
1595 2008-09-09 Mark Rowe <mrowe@apple.com>
1597 Build fix, rubber-stamped by Anders Carlsson.
1599 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
1601 * JavaScriptCore.xcodeproj/project.pbxproj:
1603 2008-09-09 Mark Rowe <mrowe@apple.com>
1605 Rubber-stamped by Oliver Hunt.
1607 Fix builds using the "debug" variant.
1609 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
1610 and Release configurations.
1612 * Configurations/JavaScriptCore.xcconfig:
1613 * DerivedSources.make:
1614 * JavaScriptCore.Debug.exp: Removed.
1615 * JavaScriptCore.base.exp: Removed.
1616 * JavaScriptCore.exp: Added.
1617 * JavaScriptCore.xcodeproj/project.pbxproj:
1618 * kjs/identifier.cpp:
1619 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
1620 there is no overhead in Release builds.
1621 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
1623 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
1624 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
1626 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1628 Reviewed by Maciej Stachowiak.
1630 Clean up WREC a bit to bring it closer to our coding style guidelines.
1634 (JSC::getCharacterClass_newline):
1635 (JSC::getCharacterClass_d):
1636 (JSC::getCharacterClass_s):
1637 (JSC::getCharacterClass_w):
1638 (JSC::getCharacterClass_D):
1639 (JSC::getCharacterClass_S):
1640 (JSC::getCharacterClass_W):
1641 (JSC::CharacterClassConstructor::append):
1642 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1643 (JSC::WRECGenerator::generateGreedyQuantifier):
1644 (JSC::WRECGenerator::generateCharacterClassInverted):
1645 (JSC::WRECParser::parseQuantifier):
1646 (JSC::WRECParser::parsePatternCharacterQualifier):
1647 (JSC::WRECParser::parseCharacterClassQuantifier):
1648 (JSC::WRECParser::parseBackreferenceQuantifier):
1650 (JSC::Quantifier::):
1651 (JSC::Quantifier::Quantifier):
1653 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
1655 Reviewed by Alexey Proskuryakov.
1657 Try MIME charset names before trying IANA names
1658 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
1660 * wtf/StringExtras.h: (strcasecmp): Added.
1662 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1664 Reviewed by Mark Rowe.
1666 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
1667 <https://bugs.webkit.org/show_bug.cgi?id=20719>
1668 <rdar://problem/6205787>
1670 Fix a typo in the case-insensitive matching of character patterns.
1673 (JSC::WRECGenerator::generatePatternCharacter):
1675 2008-09-09 Maciej Stachowiak <mjs@apple.com>
1677 Reviewed by Sam Weinig.
1679 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
1681 1.012x speedup on SunSpider.
1683 * kjs/MathObject.cpp:
1684 (JSC::MathObject::getOwnPropertySlot):
1686 (JSC::setUpStaticFunctionSlot):
1688 (JSC::getStaticPropertySlot):
1690 2008-09-08 Sam Weinig <sam@webkit.org>
1692 Reviewed by Maciej Stachowiak and Oliver Hunt.
1694 Split storage of properties out of the PropertyMap and into the JSObject
1695 to allow sharing PropertyMap on the StructureID. In order to get this
1696 function correctly, the StructureID's transition mappings were changed to
1697 transition based on property name and attribute pairs, instead of just
1700 - Removes the single property optimization now that the PropertyMap is shared.
1701 This will be replaced by in-lining some values on the JSObject.
1703 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
1705 * JavaScriptCore.base.exp:
1707 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
1708 (JSC::CTI::privateCompileGetByIdProto): Ditto.
1709 (JSC::CTI::privateCompileGetByIdChain): Ditto.
1710 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
1712 (JSC::JSObject::mark): Mark the PropertyStorage.
1713 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
1714 (JSC::JSObject::deleteProperty): Ditto.
1715 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
1716 (JSC::JSObject::defineSetter): Ditto.
1717 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
1718 (JSC::JSObject::getPropertyNames): Ditto.
1719 (JSC::JSObject::removeDirect): Ditto.
1720 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
1721 (JSC::JSObject::propertyStorage): return the PropertyStorage.
1722 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
1723 (JSC::JSObject::getDirectLocation): Ditto.
1724 (JSC::JSObject::offsetForLocation): Compute location directly.
1725 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
1726 (JSC::JSObject::hasGetterSetterProperties): Ditto.
1727 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
1728 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
1729 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
1730 (JSC::JSObject::getOwnPropertySlot): Ditto.
1731 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
1732 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
1733 (JSC::PropertyMap::checkConsistency):
1734 (JSC::PropertyMap::operator=):
1735 (JSC::PropertyMap::~PropertyMap):
1736 (JSC::PropertyMap::get):
1737 (JSC::PropertyMap::getLocation):
1738 (JSC::PropertyMap::put):
1739 (JSC::PropertyMap::getOffset):
1740 (JSC::PropertyMap::insert):
1741 (JSC::PropertyMap::expand):
1742 (JSC::PropertyMap::rehash):
1743 (JSC::PropertyMap::createTable):
1744 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
1745 (JSC::PropertyMap::remove):
1746 (JSC::PropertyMap::getEnumerablePropertyNames):
1747 * kjs/PropertyMap.h:
1748 (JSC::PropertyMapEntry::PropertyMapEntry):
1749 (JSC::PropertyMap::isEmpty):
1750 (JSC::PropertyMap::size):
1751 (JSC::PropertyMap::makingCount):
1752 (JSC::PropertyMap::PropertyMap):
1754 * kjs/StructureID.cpp:
1755 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
1757 (JSC::StructureID::toDictionaryTransition): Copy the map.
1758 (JSC::StructureID::changePrototypeTransition): Copy the map.
1759 (JSC::StructureID::getterSetterTransition): Copy the map.
1760 (JSC::StructureID::~StructureID):
1761 * kjs/StructureID.h:
1762 (JSC::TransitionTableHash::hash): Custom hash for transition map.
1763 (JSC::TransitionTableHash::equal): Ditto.
1764 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
1765 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
1766 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
1767 (JSC::StructureID::propertyMap): Added.
1769 2008-09-08 Oliver Hunt <oliver@apple.com>
1771 Reviewed by Mark Rowe.
1773 Bug 20694: Slow Script error pops up when running Dromaeo tests
1775 Correct error in timeout logic where execution tick count would
1776 be reset to incorrect value due to incorrect offset and indirection.
1777 Codegen for the slow script dialog was factored out into a separate
1778 method (emitSlowScriptCheck) rather than having multiple copies of
1779 the same code. Also added calls to generate slow script checks
1780 for loop_if_less and loop_if_true opcodes.
1783 (JSC::CTI::emitSlowScriptCheck):
1784 (JSC::CTI::privateCompileMainPass):
1785 (JSC::CTI::privateCompileSlowCases):
1788 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1790 Reviewed by Maciej Stachowiak.
1792 Remove references to the removed WRECompiler class.
1797 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1799 Rubber-stamped by Mark Rowe.
1801 Fix the build with CTI enabled but WREC disabled.
1806 2008-09-08 Dan Bernstein <mitz@apple.com>
1811 (JSC::StatementNode::):
1814 2008-09-08 Kevin McCullough <kmccullough@apple.com>
1818 <rdar://problem/6134407> Breakpoints in for loops, while loops or
1819 conditions without curly braces don't break. (19306)
1820 -Statement Lists already emit debug hooks but conditionals without
1821 brackets are not lists.
1824 (KJS::IfNode::emitCode):
1825 (KJS::IfElseNode::emitCode):
1826 (KJS::DoWhileNode::emitCode):
1827 (KJS::WhileNode::emitCode):
1828 (KJS::ForNode::emitCode):
1829 (KJS::ForInNode::emitCode):
1831 (KJS::StatementNode::):
1834 2008-09-08 Maciej Stachowiak <mjs@apple.com>
1836 Reviewed by Anders Carlsson.
1838 - Cache the code generated for eval to speed up SunSpider and web sites
1839 https://bugs.webkit.org/show_bug.cgi?id=20718
1842 2.29x on date-format-tofte
1844 Lots of real sites seem to get many hits on this cache as well,
1845 including GMail, Google Spreadsheets, Slate and Digg (the last of
1846 these gets over 100 hits on initial page load).
1849 (JSC::EvalCodeCache::get):
1851 (JSC::Machine::callEval):
1852 (JSC::Machine::privateExecute):
1853 (JSC::Machine::cti_op_call_eval):
1856 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1858 Reviewed by Oliver Hunt.
1860 Bug 20711: Change KJS prefix on preprocessor macros to JSC
1861 <https://bugs.webkit.org/show_bug.cgi?id=20711>
1863 * kjs/CommonIdentifiers.cpp:
1864 (JSC::CommonIdentifiers::CommonIdentifiers):
1865 * kjs/CommonIdentifiers.h:
1866 * kjs/PropertySlot.h:
1867 (JSC::PropertySlot::getValue):
1868 (JSC::PropertySlot::putValue):
1869 (JSC::PropertySlot::setValueSlot):
1870 (JSC::PropertySlot::setValue):
1871 (JSC::PropertySlot::setRegisterSlot):
1876 (JSC::ExpressionNode::):
1877 (JSC::StatementNode::):
1879 (JSC::BooleanNode::):
1880 (JSC::NumberNode::):
1881 (JSC::ImmediateNumberNode::):
1882 (JSC::StringNode::):
1883 (JSC::RegExpNode::):
1885 (JSC::ResolveNode::):
1886 (JSC::ElementNode::):
1888 (JSC::PropertyNode::):
1889 (JSC::PropertyListNode::):
1890 (JSC::ObjectLiteralNode::):
1891 (JSC::BracketAccessorNode::):
1892 (JSC::DotAccessorNode::):
1893 (JSC::ArgumentListNode::):
1894 (JSC::ArgumentsNode::):
1895 (JSC::NewExprNode::):
1896 (JSC::EvalFunctionCallNode::):
1897 (JSC::FunctionCallValueNode::):
1898 (JSC::FunctionCallResolveNode::):
1899 (JSC::FunctionCallBracketNode::):
1900 (JSC::FunctionCallDotNode::):
1901 (JSC::PrePostResolveNode::):
1902 (JSC::PostfixResolveNode::):
1903 (JSC::PostfixBracketNode::):
1904 (JSC::PostfixDotNode::):
1905 (JSC::PostfixErrorNode::):
1906 (JSC::DeleteResolveNode::):
1907 (JSC::DeleteBracketNode::):
1908 (JSC::DeleteDotNode::):
1909 (JSC::DeleteValueNode::):
1911 (JSC::TypeOfResolveNode::):
1912 (JSC::TypeOfValueNode::):
1913 (JSC::PrefixResolveNode::):
1914 (JSC::PrefixBracketNode::):
1915 (JSC::PrefixDotNode::):
1916 (JSC::PrefixErrorNode::):
1917 (JSC::UnaryPlusNode::):
1918 (JSC::NegateNode::):
1919 (JSC::BitwiseNotNode::):
1920 (JSC::LogicalNotNode::):
1926 (JSC::LeftShiftNode::):
1927 (JSC::RightShiftNode::):
1928 (JSC::UnsignedRightShiftNode::):
1930 (JSC::GreaterNode::):
1931 (JSC::LessEqNode::):
1932 (JSC::GreaterEqNode::):
1933 (JSC::ThrowableBinaryOpNode::):
1934 (JSC::InstanceOfNode::):
1937 (JSC::NotEqualNode::):
1938 (JSC::StrictEqualNode::):
1939 (JSC::NotStrictEqualNode::):
1940 (JSC::BitAndNode::):
1942 (JSC::BitXOrNode::):
1943 (JSC::LogicalOpNode::):
1944 (JSC::ConditionalNode::):
1945 (JSC::ReadModifyResolveNode::):
1946 (JSC::AssignResolveNode::):
1947 (JSC::ReadModifyBracketNode::):
1948 (JSC::AssignBracketNode::):
1949 (JSC::AssignDotNode::):
1950 (JSC::ReadModifyDotNode::):
1951 (JSC::AssignErrorNode::):
1953 (JSC::VarDeclCommaNode::):
1954 (JSC::ConstDeclNode::):
1955 (JSC::ConstStatementNode::):
1956 (JSC::EmptyStatementNode::):
1957 (JSC::DebuggerStatementNode::):
1958 (JSC::ExprStatementNode::):
1959 (JSC::VarStatementNode::):
1961 (JSC::IfElseNode::):
1962 (JSC::DoWhileNode::):
1965 (JSC::ContinueNode::):
1967 (JSC::ReturnNode::):
1972 (JSC::ParameterNode::):
1974 (JSC::ProgramNode::):
1976 (JSC::FunctionBodyNode::):
1977 (JSC::FuncExprNode::):
1978 (JSC::FuncDeclNode::):
1979 (JSC::CaseClauseNode::):
1980 (JSC::ClauseListNode::):
1981 (JSC::CaseBlockNode::):
1982 (JSC::SwitchNode::):
1984 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1986 Reviewed by Maciej Stachowiak.
1988 Bug 20704: Replace the KJS namespace
1989 <https://bugs.webkit.org/show_bug.cgi?id=20704>
1991 Rename the KJS namespace to JSC. There are still some uses of KJS in
1992 preprocessor macros and comments, but these will also be changed some
1993 time in the near future.
2000 * API/JSCallbackConstructor.cpp:
2001 * API/JSCallbackConstructor.h:
2002 * API/JSCallbackFunction.cpp:
2003 * API/JSCallbackFunction.h:
2004 * API/JSCallbackObject.cpp:
2005 * API/JSCallbackObject.h:
2006 * API/JSCallbackObjectFunctions.h:
2007 * API/JSClassRef.cpp:
2008 (OpaqueJSClass::staticValues):
2009 (OpaqueJSClass::staticFunctions):
2011 * API/JSContextRef.cpp:
2012 * API/JSObjectRef.cpp:
2013 * API/JSProfilerPrivate.cpp:
2014 * API/JSStringRef.cpp:
2015 * API/JSValueRef.cpp:
2017 * API/OpaqueJSString.cpp:
2018 * API/OpaqueJSString.h:
2019 * JavaScriptCore.Debug.exp:
2020 * JavaScriptCore.base.exp:
2026 * VM/CodeGenerator.cpp:
2027 * VM/CodeGenerator.h:
2028 * VM/ExceptionHelpers.cpp:
2029 * VM/ExceptionHelpers.h:
2031 * VM/JSPropertyNameIterator.cpp:
2032 * VM/JSPropertyNameIterator.h:
2040 * VM/RegisterFile.cpp:
2041 * VM/RegisterFile.h:
2044 * VM/SamplingTool.cpp:
2045 * VM/SamplingTool.h:
2046 * VM/SegmentedVector.h:
2049 * kjs/Arguments.cpp:
2051 * kjs/ArrayConstructor.cpp:
2052 * kjs/ArrayConstructor.h:
2053 * kjs/ArrayPrototype.cpp:
2054 * kjs/ArrayPrototype.h:
2055 * kjs/BatchedTransitionOptimizer.h:
2056 * kjs/BooleanConstructor.cpp:
2057 * kjs/BooleanConstructor.h:
2058 * kjs/BooleanObject.cpp:
2059 * kjs/BooleanObject.h:
2060 * kjs/BooleanPrototype.cpp:
2061 * kjs/BooleanPrototype.h:
2065 * kjs/CommonIdentifiers.cpp:
2066 * kjs/CommonIdentifiers.h:
2067 * kjs/ConstructData.cpp:
2068 * kjs/ConstructData.h:
2069 * kjs/DateConstructor.cpp:
2070 * kjs/DateConstructor.h:
2071 * kjs/DateInstance.cpp:
2072 (JSC::DateInstance::msToGregorianDateTime):
2073 * kjs/DateInstance.h:
2076 * kjs/DatePrototype.cpp:
2077 * kjs/DatePrototype.h:
2078 * kjs/DebuggerCallFrame.cpp:
2079 * kjs/DebuggerCallFrame.h:
2082 * kjs/ErrorConstructor.cpp:
2083 * kjs/ErrorConstructor.h:
2084 * kjs/ErrorInstance.cpp:
2085 * kjs/ErrorInstance.h:
2086 * kjs/ErrorPrototype.cpp:
2087 * kjs/ErrorPrototype.h:
2088 * kjs/ExecState.cpp:
2090 * kjs/FunctionConstructor.cpp:
2091 * kjs/FunctionConstructor.h:
2092 * kjs/FunctionPrototype.cpp:
2093 * kjs/FunctionPrototype.h:
2094 * kjs/GetterSetter.cpp:
2095 * kjs/GetterSetter.h:
2096 * kjs/GlobalEvalFunction.cpp:
2097 * kjs/GlobalEvalFunction.h:
2098 * kjs/IndexToNameMap.cpp:
2099 * kjs/IndexToNameMap.h:
2100 * kjs/InitializeThreading.cpp:
2101 * kjs/InitializeThreading.h:
2102 * kjs/InternalFunction.cpp:
2103 * kjs/InternalFunction.h:
2104 (JSC::InternalFunction::InternalFunction):
2105 * kjs/JSActivation.cpp:
2106 * kjs/JSActivation.h:
2111 * kjs/JSFunction.cpp:
2113 (JSC::JSFunction::JSFunction):
2114 * kjs/JSGlobalData.cpp:
2115 (JSC::JSGlobalData::JSGlobalData):
2116 * kjs/JSGlobalData.h:
2117 * kjs/JSGlobalObject.cpp:
2118 * kjs/JSGlobalObject.h:
2119 * kjs/JSGlobalObjectFunctions.cpp:
2120 * kjs/JSGlobalObjectFunctions.h:
2121 * kjs/JSImmediate.cpp:
2122 * kjs/JSImmediate.h:
2125 * kjs/JSNotAnObject.cpp:
2126 * kjs/JSNotAnObject.h:
2127 * kjs/JSNumberCell.cpp:
2128 * kjs/JSNumberCell.h:
2131 * kjs/JSStaticScopeObject.cpp:
2132 * kjs/JSStaticScopeObject.h:
2138 * kjs/JSVariableObject.cpp:
2139 * kjs/JSVariableObject.h:
2140 * kjs/JSWrapperObject.cpp:
2141 * kjs/JSWrapperObject.h:
2142 * kjs/LabelStack.cpp:
2144 * kjs/MathObject.cpp:
2146 * kjs/NativeErrorConstructor.cpp:
2147 * kjs/NativeErrorConstructor.h:
2148 * kjs/NativeErrorPrototype.cpp:
2149 * kjs/NativeErrorPrototype.h:
2151 * kjs/NumberConstructor.cpp:
2152 * kjs/NumberConstructor.h:
2153 * kjs/NumberObject.cpp:
2154 * kjs/NumberObject.h:
2155 * kjs/NumberPrototype.cpp:
2156 * kjs/NumberPrototype.h:
2157 * kjs/ObjectConstructor.cpp:
2158 * kjs/ObjectConstructor.h:
2159 * kjs/ObjectPrototype.cpp:
2160 * kjs/ObjectPrototype.h:
2163 * kjs/PropertyMap.cpp:
2164 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
2165 * kjs/PropertyMap.h:
2166 * kjs/PropertyNameArray.cpp:
2167 * kjs/PropertyNameArray.h:
2168 * kjs/PropertySlot.cpp:
2169 * kjs/PropertySlot.h:
2170 * kjs/PrototypeFunction.cpp:
2171 * kjs/PrototypeFunction.h:
2172 * kjs/PutPropertySlot.h:
2173 * kjs/RegExpConstructor.cpp:
2174 * kjs/RegExpConstructor.h:
2175 * kjs/RegExpObject.cpp:
2176 * kjs/RegExpObject.h:
2177 * kjs/RegExpPrototype.cpp:
2178 * kjs/RegExpPrototype.h:
2179 * kjs/ScopeChain.cpp:
2181 * kjs/ScopeChainMark.h:
2184 * kjs/SmallStrings.cpp:
2185 * kjs/SmallStrings.h:
2186 * kjs/SourceProvider.h:
2187 * kjs/SourceRange.h:
2188 * kjs/StringConstructor.cpp:
2189 * kjs/StringConstructor.h:
2190 * kjs/StringObject.cpp:
2191 * kjs/StringObject.h:
2192 * kjs/StringObjectThatMasqueradesAsUndefined.h:
2193 * kjs/StringPrototype.cpp:
2194 * kjs/StringPrototype.h:
2195 * kjs/StructureID.cpp:
2196 * kjs/StructureID.h:
2197 * kjs/SymbolTable.h:
2198 * kjs/collector.cpp:
2201 * kjs/create_hash_table:
2207 * kjs/identifier.cpp:
2209 (JSC::Identifier::equal):
2210 * kjs/interpreter.cpp:
2211 * kjs/interpreter.h:
2213 (JSC::Lexer::Lexer):
2214 (JSC::Lexer::clear):
2215 (JSC::Lexer::makeIdentifier):
2221 * kjs/nodes2string.cpp:
2222 * kjs/operations.cpp:
2230 (JSC::IdentifierRepHash::hash):
2232 * masm/MacroAssembler.h:
2233 * masm/MacroAssemblerWin.cpp:
2234 * masm/X86Assembler.h:
2235 * pcre/pcre_exec.cpp:
2236 * profiler/CallIdentifier.h:
2238 * profiler/HeavyProfile.cpp:
2239 * profiler/HeavyProfile.h:
2240 * profiler/Profile.cpp:
2241 * profiler/Profile.h:
2242 * profiler/ProfileGenerator.cpp:
2243 * profiler/ProfileGenerator.h:
2244 * profiler/ProfileNode.cpp:
2245 * profiler/ProfileNode.h:
2246 * profiler/Profiler.cpp:
2247 * profiler/Profiler.h:
2248 * profiler/TreeProfile.cpp:
2249 * profiler/TreeProfile.h:
2254 2008-09-07 Maciej Stachowiak <mjs@apple.com>
2256 Reviewed by Dan Bernstein.
2258 - rename IA32MacroAssembler class to X86Assembler
2260 We otherwise call the platform X86, and also, I don't see any macros.
2262 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2263 * JavaScriptCore.xcodeproj/project.pbxproj:
2264 * masm/IA32MacroAsm.h: Removed.
2265 * masm/MacroAssembler.h:
2266 (KJS::MacroAssembler::MacroAssembler):
2267 * masm/MacroAssemblerWin.cpp:
2268 (KJS::MacroAssembler::emitRestoreArgumentReference):
2269 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
2270 (KJS::X86Assembler::X86Assembler):
2272 (KJS::WRECGenerator::generateNonGreedyQuantifier):
2273 (KJS::WRECGenerator::generateGreedyQuantifier):
2274 (KJS::WRECGenerator::generateParentheses):
2275 (KJS::WRECGenerator::generateBackreference):
2276 (KJS::WRECGenerator::gernerateDisjunction):
2279 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
2283 Visual C++ seems to have some odd casting rules, so just convert the
2284 offending cast back to a C-style cast for now.
2286 * kjs/collector.cpp:
2287 (KJS::otherThreadStackPointer):
2289 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2291 Reviewed by Mark Rowe.
2293 Attempt to fix the Windows build by using a const_cast to cast regs.Esp
2294 to a uintptr_t instead of a reinterpret_cast.
2296 * kjs/collector.cpp:
2297 (KJS::otherThreadStackPointer):
2299 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2301 Reviewed by Sam Weinig.
2303 Remove C-style casts from kjs/collector.cpp.
2305 * kjs/collector.cpp:
2306 (KJS::Heap::heapAllocate):
2307 (KJS::currentThreadStackBase):
2308 (KJS::Heap::markConservatively):
2309 (KJS::otherThreadStackPointer):
2310 (KJS::Heap::markOtherThreadConservatively):
2313 2008-09-07 Mark Rowe <mrowe@apple.com>
2315 Build fix for the debug variant.
2317 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
2319 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2321 Reviewed by Timothy Hatcher.
2323 Remove C-style casts from the CTI code.
2326 (KJS::CTI::emitGetArg):
2327 (KJS::CTI::emitGetPutArg):
2328 (KJS::ctiRepatchCallByReturnAddress):
2329 (KJS::CTI::compileOpCall):
2330 (KJS::CTI::privateCompileMainPass):
2331 (KJS::CTI::privateCompileGetByIdSelf):
2332 (KJS::CTI::privateCompileGetByIdProto):
2333 (KJS::CTI::privateCompileGetByIdChain):
2334 (KJS::CTI::privateCompilePutByIdReplace):
2335 (KJS::CTI::privateArrayLengthTrampoline):
2336 (KJS::CTI::privateStringLengthTrampoline):
2338 === End merge of squirrelfish-extreme ===
2340 2008-09-06 Gavin Barraclough <barraclough@apple.com>
2342 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
2344 - refactor WREC to share more of the JIT infrastructure with CTI
2347 (KJS::CTI::emitGetArg):
2348 (KJS::CTI::emitGetPutArg):
2349 (KJS::CTI::emitPutArg):
2350 (KJS::CTI::emitPutArgConstant):
2351 (KJS::CTI::emitPutCTIParam):
2352 (KJS::CTI::emitGetCTIParam):
2353 (KJS::CTI::emitPutToCallFrameHeader):
2354 (KJS::CTI::emitGetFromCallFrameHeader):
2355 (KJS::CTI::emitPutResult):
2356 (KJS::CTI::emitDebugExceptionCheck):
2357 (KJS::CTI::emitJumpSlowCaseIfNotImm):
2358 (KJS::CTI::emitJumpSlowCaseIfNotImms):
2359 (KJS::CTI::emitFastArithDeTagImmediate):
2360 (KJS::CTI::emitFastArithReTagImmediate):
2361 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
2362 (KJS::CTI::emitFastArithImmToInt):
2363 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
2364 (KJS::CTI::emitFastArithIntToImmNoCheck):
2366 (KJS::CTI::compileOpCall):
2367 (KJS::CTI::privateCompileMainPass):
2368 (KJS::CTI::privateCompileSlowCases):
2369 (KJS::CTI::privateCompile):
2370 (KJS::CTI::privateCompileGetByIdSelf):
2371 (KJS::CTI::privateCompileGetByIdProto):
2372 (KJS::CTI::privateCompileGetByIdChain):
2373 (KJS::CTI::privateCompilePutByIdReplace):
2374 (KJS::CTI::privateArrayLengthTrampoline):
2375 (KJS::CTI::privateStringLengthTrampoline):
2376 (KJS::CTI::compileRegExp):
2378 (KJS::CallRecord::CallRecord):
2379 (KJS::JmpTable::JmpTable):
2380 (KJS::SlowCaseEntry::SlowCaseEntry):
2381 (KJS::CTI::JSRInfo::JSRInfo):
2383 (KJS::RegExp::RegExp):
2385 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
2386 (KJS::GeneratePatternCharacterFunctor::generateAtom):
2387 (KJS::GeneratePatternCharacterFunctor::backtrack):
2388 (KJS::GenerateCharacterClassFunctor::generateAtom):
2389 (KJS::GenerateCharacterClassFunctor::backtrack):
2390 (KJS::GenerateBackreferenceFunctor::generateAtom):
2391 (KJS::GenerateBackreferenceFunctor::backtrack):
2392 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
2393 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
2394 (KJS::WRECGenerate::generateBacktrack1):
2395 (KJS::WRECGenerate::generateBacktrackBackreference):
2396 (KJS::WRECGenerate::generateBackreferenceQuantifier):
2397 (KJS::WRECGenerate::generateNonGreedyQuantifier):
2398 (KJS::WRECGenerate::generateGreedyQuantifier):
2399 (KJS::WRECGenerate::generatePatternCharacter):
2400 (KJS::WRECGenerate::generateCharacterClassInvertedRange):
2401 (KJS::WRECGenerate::generateCharacterClassInverted):
2402 (KJS::WRECGenerate::generateCharacterClass):
2403 (KJS::WRECGenerate::generateParentheses):
2404 (KJS::WRECGenerate::generateParenthesesNonGreedy):
2405 (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
2406 (KJS::WRECGenerate::generateAssertionBOL):
2407 (KJS::WRECGenerate::generateAssertionEOL):
2408 (KJS::WRECGenerate::generateAssertionWordBoundary):
2409 (KJS::WRECGenerate::generateBackreference):
2410 (KJS::WRECGenerate::gernerateDisjunction):
2411 (KJS::WRECGenerate::terminateDisjunction):
2412 (KJS::WRECParser::parseGreedyQuantifier):
2413 (KJS::WRECParser::parseQuantifier):
2414 (KJS::WRECParser::parsePatternCharacterQualifier):
2415 (KJS::WRECParser::parseCharacterClassQuantifier):
2416 (KJS::WRECParser::parseBackreferenceQuantifier):
2417 (KJS::WRECParser::parseParentheses):
2418 (KJS::WRECParser::parseCharacterClass):
2419 (KJS::WRECParser::parseOctalEscape):
2420 (KJS::WRECParser::parseEscape):
2421 (KJS::WRECParser::parseTerm):
2422 (KJS::WRECParser::parseDisjunction):
2424 (KJS::WRECGenerate::WRECGenerate):
2425 (KJS::WRECParser::):
2426 (KJS::WRECParser::WRECParser):
2427 (KJS::WRECParser::parseAlternative):
2428 (KJS::WRECParser::isEndOfPattern):
2430 2008-09-06 Oliver Hunt <oliver@apple.com>
2432 Reviewed by NOBODY (Build fix).
2434 Fix the sampler build.
2436 * VM/SamplingTool.h:
2438 2008-09-06 Oliver Hunt <oliver@apple.com>
2440 Reviewed by Maciej Stachowiak.
2442 Jump through the necessary hoops required to make MSVC cooperate with SFX
2444 We now explicitly declare the calling convention on all cti_op_* cfunctions,
2445 and return int instead of bool where appropriate (despite the cdecl calling
2446 convention seems to state MSVC generates code that returns the result value
2447 through ecx). SFX behaves slightly differently under MSVC, specifically it
2448 stores the base argument address for the cti_op_* functions in the first
2449 argument, and then does the required stack manipulation through that pointer.
2450 This is necessary as MSVC's optimisations assume they have complete control
2451 of the stack, and periodically elide our stack manipulations, or move
2452 values in unexpected ways. MSVC also frequently produces tail calls which may
2453 clobber the first argument, so the MSVC path is slightly less efficient due
2454 to the need to restore it.
2456 * JavaScriptCore.xcodeproj/project.pbxproj:
2459 (KJS::CTI::compileOpCall):
2460 (KJS::CTI::privateCompileMainPass):
2461 (KJS::CTI::privateCompileSlowCases):
2465 * masm/MacroAssembler.h:
2466 (KJS::MacroAssembler::emitConvertToFastCall):
2467 * masm/MacroAssemblerIA32GCC.cpp: Removed.
2468 For performance reasons we need these no-op functions to be inlined.
2470 * masm/MacroAssemblerWin.cpp:
2471 (KJS::MacroAssembler::emitRestoreArgumentReference):
2474 2008-09-05 Geoffrey Garen <ggaren@apple.com>
2476 Reviewed by Maciej Stachowiak, or maybe the other way around.
2478 Added the ability to coalesce JITCode buffer grow operations by first
2479 growing the buffer and then executing unchecked puts to it.
2481 About a 2% speedup on date-format-tofte.
2484 (KJS::CTI::compileOpCall):
2485 * masm/IA32MacroAsm.h:
2486 (KJS::JITCodeBuffer::ensureSpace):
2487 (KJS::JITCodeBuffer::putByteUnchecked):
2488 (KJS::JITCodeBuffer::putByte):
2489 (KJS::JITCodeBuffer::putShortUnchecked):
2490 (KJS::JITCodeBuffer::putShort):
2491 (KJS::JITCodeBuffer::putIntUnchecked):
2492 (KJS::JITCodeBuffer::putInt):
2493 (KJS::IA32MacroAssembler::emitTestl_i32r):
2494 (KJS::IA32MacroAssembler::emitMovl_mr):
2495 (KJS::IA32MacroAssembler::emitMovl_rm):
2496 (KJS::IA32MacroAssembler::emitMovl_i32m):
2497 (KJS::IA32MacroAssembler::emitUnlinkedJe):
2498 (KJS::IA32MacroAssembler::emitModRm_rr):
2499 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
2500 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
2501 (KJS::IA32MacroAssembler::emitModRm_rm):
2502 (KJS::IA32MacroAssembler::emitModRm_opr):
2503 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
2504 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
2506 2008-09-05 Mark Rowe <mrowe@apple.com>
2508 Reviewed by Sam Weinig.
2510 Disable WREC and CTI on platforms that we have not yet had a chance to test with.
2514 2008-09-05 Geoffrey Garen <ggaren@apple.com>
2516 Reviewed by Sam Weinig.
2518 Use jo instead of a mask compare when fetching array.length and
2519 string.length. 4% speedup on array.length / string.length torture
2523 (KJS::CTI::privateArrayLengthTrampoline):
2524 (KJS::CTI::privateStringLengthTrampoline):
2526 2008-09-05 Geoffrey Garen <ggaren@apple.com>
2528 Reviewed by Sam Weinig.
2530 Removed a CTI compilation pass by recording labels during bytecode
2531 generation. This is more to reduce complexity than it is to improve
2534 SunSpider reports no change.
2536 CodeBlock now keeps a "labels" set, which holds the offsets of all the
2537 instructions that can be jumped to.
2539 * VM/CTI.cpp: Nixed a pass.
2541 * VM/CodeBlock.h: Added a "labels" set.
2543 * VM/LabelID.h: No need for a special LableID for holding jump
2544 destinations, since the CodeBlock now knows all jump destinations.
2546 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
2550 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
2552 2008-09-05 Mark Rowe <mrowe@apple.com>
2554 Reviewed by Oliver Hunt and Gavin Barraclough.
2556 Move the JITCodeBuffer onto Machine and remove the static variables.
2558 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
2560 (KJS::Machine::Machine): Allocate a JITCodeBuffer.
2562 * kjs/RegExpConstructor.cpp:
2563 (KJS::constructRegExp): Pass the ExecState through.
2564 * kjs/RegExpPrototype.cpp:
2565 (KJS::regExpProtoFuncCompile): Ditto.
2566 * kjs/StringPrototype.cpp:
2567 (KJS::stringProtoFuncMatch): Ditto.
2568 (KJS::stringProtoFuncSearch): Ditto.
2570 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
2571 so that we have access to an ExecState.
2573 (KJS::RegExpNode::):
2574 * kjs/nodes2string.cpp:
2576 (KJS::RegExp::RegExp): Pass the ExecState through.
2577 (KJS::RegExp::create): Ditto.
2579 * masm/IA32MacroAsm.h:
2580 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
2583 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
2586 2008-09-05 Mark Rowe <mrowe@apple.com>
2588 Reviewed by Oliver Hunt and Gavin Barraclough.
2590 Fix the build when CTI is disabled.
2593 (KJS::CodeBlock::~CodeBlock):
2594 * VM/CodeGenerator.cpp:
2595 (KJS::prepareJumpTableForStringSwitch):
2597 (KJS::Machine::Machine):
2598 (KJS::Machine::~Machine):
2600 2008-09-05 Gavin Barraclough <barraclough@apple.com>
2602 Reviewed by Mark Rowe.
2604 Fix some windows abi issues.
2607 (KJS::CTI::privateCompileMainPass):
2608 (KJS::CTI::privateCompileSlowCases):
2610 (KJS::CallRecord::CallRecord):
2613 (KJS::Machine::cti_op_resolve_func):
2614 (KJS::Machine::cti_op_post_inc):
2615 (KJS::Machine::cti_op_resolve_with_base):
2616 (KJS::Machine::cti_op_post_dec):
2619 2008-09-05 Mark Rowe <mrowe@apple.com>
2621 Reviewed by Sam Weinig.
2623 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
2626 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
2627 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
2629 2008-09-04 Mark Rowe <mrowe@apple.com>
2631 Reviewed by Sam Weinig.
2633 Fix fast/dom/Window/console-functions.html.
2635 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
2636 such as console.log would use the line number of the last JS function on the call stack.
2639 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
2640 and restore it when the function is done.
2641 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
2643 2008-09-05 Oliver Hunt <oliver@apple.com>
2645 Start bringing up SFX on windows.
2647 Reviewed by Mark Rowe and Sam Weinig
2649 Start doing the work to bring up SFX on windows. Initially
2650 just working on WREC, as it does not make any calls so reduces
2651 the amount of code that needs to be corrected.
2653 Start abstracting the CTI JIT codegen engine.
2656 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2657 * JavaScriptCore.xcodeproj/project.pbxproj:
2659 * masm/IA32MacroAsm.h:
2660 * masm/MacroAssembler.h: Added.
2661 (KJS::MacroAssembler::MacroAssembler):
2662 * masm/MacroAssemblerIA32GCC.cpp: Added.
2663 (KJS::MacroAssembler::emitConvertToFastCall):
2664 * masm/MacroAssemblerWin.cpp: Added.
2665 (KJS::MacroAssembler::emitConvertToFastCall):
2667 (KJS::WRECompiler::parseGreedyQuantifier):
2668 (KJS::WRECompiler::parseCharacterClass):
2669 (KJS::WRECompiler::parseEscape):
2670 (KJS::WRECompiler::compilePattern):
2673 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2675 Reviewed by Sam Weinig.
2677 Support for slow scripts (timeout checking).
2680 (KJS::CTI::privateCompileMainPass):
2681 (KJS::CTI::privateCompile):
2683 (KJS::slideRegisterWindowForCall):
2684 (KJS::Machine::cti_timeout_check):
2685 (KJS::Machine::cti_vm_throw):
2687 2008-09-04 Sam Weinig <sam@webkit.org>
2689 Reviewed by Mark Rowe.
2691 Third round of style cleanup.
2700 2008-09-04 Sam Weinig <sam@webkit.org>
2702 Reviewed by Jon Honeycutt.
2704 Second round of style cleanup.
2710 2008-09-04 Sam Weinig <sam@webkit.org>
2712 Reviewed by Mark Rowe.
2714 First round of style cleanup.
2718 * masm/IA32MacroAsm.h:
2722 2008-09-04 Geoffrey Garen <ggaren@apple.com>
2724 Reviewed by Mark Rowe.
2726 Merged http://trac.webkit.org/changeset/36081 to work with CTI.
2729 (KJS::Machine::tryCtiCacheGetByID):
2731 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2733 Reviewed by Sam Weinig.
2735 Enable profiling in CTI.
2739 (KJS::CTI::execute):
2741 (KJS::Machine::cti_op_call_JSFunction):
2742 (KJS::Machine::cti_op_call_NotJSFunction):
2743 (KJS::Machine::cti_op_ret):
2744 (KJS::Machine::cti_op_construct_JSConstruct):
2745 (KJS::Machine::cti_op_construct_NotJSConstruct):
2747 2008-09-04 Victor Hernandez <vhernandez@apple.com>
2749 Reviewed by Geoffrey Garen.
2751 Fixed an #if to support using WREC without CTI.
2754 (KJS::RegExp::match):
2756 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2758 Reviewed by Oliver Hunt.
2760 The array/string length trampolines are owned by the Machine, not the codeblock that compiled them.
2763 (KJS::CTI::privateArrayLengthTrampoline):
2764 (KJS::CTI::privateStringLengthTrampoline):
2766 (KJS::Machine::~Machine):
2769 2008-09-04 Mark Rowe <mrowe@apple.com>
2771 Reviewed by Gavin Barraclough and Sam Weinig.
2773 Fix a crash on launch of jsc when GuardMalloc is enabled.
2776 (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain.
2777 (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref.
2779 2008-09-03 Oliver Hunt <oliver@apple.com>
2781 Reviewed by Gavin Barraclough and Geoff Garen.
2783 Fix inspector and fast array access so that it bounds
2787 (KJS::CTI::privateCompile_pass2_Main):
2788 * masm/IA32MacroAsm.h:
2789 (KJS::IA32MacroAssembler::):
2790 (KJS::IA32MacroAssembler::emitUnlinkedJb):
2791 (KJS::IA32MacroAssembler::emitUnlinkedJbe):
2793 2008-09-03 Mark Rowe <mrowe@apple.com>
2795 Move the assertion after the InitializeAndReturn block, as
2796 that is used even when CTI is enabled.
2799 (KJS::Machine::privateExecute):
2801 2008-09-03 Mark Rowe <mrowe@apple.com>
2803 Reviewed by Sam Weinig.
2805 Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED.
2808 (KJS::CTI::privateCompile_pass1_Scan):
2809 (KJS::CTI::privateCompile_pass2_Main):
2810 (KJS::CTI::privateCompile_pass4_SlowCases):
2812 (KJS::Machine::privateExecute):
2813 (KJS::Machine::cti_vm_throw):
2815 2008-09-03 Mark Rowe <mrowe@apple.com>
2817 Reviewed by Sam Weinig.
2819 Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved
2820 by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86)
2826 (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for
2827 printing a ptrdiff_t.
2831 (KJS::RegExp::RegExp):
2832 (KJS::RegExp::~RegExp):
2833 (KJS::RegExp::match):
2835 * masm/IA32MacroAsm.h:
2838 * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to
2839 track whether any MASM-using features are enabled.
2841 2008-09-03 Gavin Barraclough <barraclough@apple.com>
2843 Reviewed by Oliver Hunt.
2845 Copy Geoff's array/string length optimization for CTI.
2848 (KJS::CTI::privateArrayLengthTrampoline):
2849 (KJS::CTI::privateStringLengthTrampoline):
2851 (KJS::CTI::compileArrayLengthTrampoline):
2852 (KJS::CTI::compileStringLengthTrampoline):
2854 (KJS::Machine::Machine):
2855 (KJS::Machine::getCtiArrayLengthTrampoline):
2856 (KJS::Machine::getCtiStringLengthTrampoline):
2857 (KJS::Machine::tryCtiCacheGetByID):
2858 (KJS::Machine::cti_op_get_by_id_second):
2863 2008-09-03 Gavin Barraclough <barraclough@apple.com>
2865 Reviewed by Oliver Hunt.
2867 Implement fast array accesses in CTI - 2-3% progression on sunspider.
2870 (KJS::CTI::emitFastArithIntToImmNoCheck):
2871 (KJS::CTI::compileOpCall):
2872 (KJS::CTI::privateCompile_pass2_Main):
2873 (KJS::CTI::privateCompile_pass4_SlowCases):
2877 2008-09-02 Gavin Barraclough <barraclough@apple.com>
2879 Reviewed by Oliver Hunt.
2881 Enable fast property access support in CTI.
2884 (KJS::ctiSetReturnAddress):
2885 (KJS::ctiRepatchCallByReturnAddress):
2886 (KJS::CTI::privateCompile_pass2_Main):
2887 (KJS::CTI::privateCompile):
2888 (KJS::CTI::privateCompileGetByIdSelf):
2889 (KJS::CTI::privateCompileGetByIdProto):
2890 (KJS::CTI::privateCompileGetByIdChain):
2891 (KJS::CTI::privateCompilePutByIdReplace):
2893 (KJS::CTI::compileGetByIdSelf):
2894 (KJS::CTI::compileGetByIdProto):
2895 (KJS::CTI::compileGetByIdChain):
2896 (KJS::CTI::compilePutByIdReplace):
2898 (KJS::CodeBlock::~CodeBlock):
2901 (KJS::doSetReturnAddressVmThrowTrampoline):
2902 (KJS::Machine::tryCtiCachePutByID):
2903 (KJS::Machine::tryCtiCacheGetByID):
2904 (KJS::Machine::cti_op_put_by_id):
2905 (KJS::Machine::cti_op_put_by_id_second):
2906 (KJS::Machine::cti_op_put_by_id_generic):
2907 (KJS::Machine::cti_op_put_by_id_fail):
2908 (KJS::Machine::cti_op_get_by_id):
2909 (KJS::Machine::cti_op_get_by_id_second):
2910 (KJS::Machine::cti_op_get_by_id_generic):
2911 (KJS::Machine::cti_op_get_by_id_fail):
2912 (KJS::Machine::cti_op_throw):
2913 (KJS::Machine::cti_vm_throw):
2917 * kjs/PropertyMap.h:
2918 * kjs/StructureID.cpp:
2919 (KJS::StructureIDChain::StructureIDChain):
2920 * masm/IA32MacroAsm.h:
2921 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2922 (KJS::IA32MacroAssembler::emitMovl_mr):
2923 (KJS::IA32MacroAssembler::emitMovl_rm):
2925 2008-09-02 Sam Weinig <sam@webkit.org>
2927 Reviewed by Gavin Barraclough and Mark Rowe.
2929 A backslash (\) at the of a RegEx should produce an error.
2930 Fixes fast/regex/test1.html.
2933 (KJS::WRECompiler::parseEscape):
2935 2008-09-02 Sam Weinig <sam@webkit.org>
2937 Reviewed by Geoff Garen.
2939 Link jumps for the slow case of op_loop_if_less. Fixes acid3.
2942 (KJS::CTI::privateCompile_pass4_SlowCases):
2944 2008-09-01 Sam Weinig <sam@webkit.org>
2946 Rubber-stamped by Maciej Stachowiak.
2948 Switch WREC on by default.
2952 2008-09-01 Sam Weinig <sam@webkit.org>
2954 Reviewed by Mark Rowe.
2956 Fix two failures in fast/regex/test1.html
2957 - \- in a character class should be treated as a literal -
2958 - A missing max quantifier needs to be treated differently than
2959 a null max quantifier.
2962 (KJS::WRECompiler::generateNonGreedyQuantifier):
2963 (KJS::WRECompiler::generateGreedyQuantifier):
2964 (KJS::WRECompiler::parseCharacterClass):
2966 (KJS::Quantifier::Quantifier):
2968 2008-09-01 Sam Weinig <sam@webkit.org>
2970 Reviewed by Mark Rowe.
2972 Fix crash in fast/js/kde/evil-n.html
2974 * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function.
2976 2008-09-01 Sam Weinig <sam@webkit.org>
2978 Reviewed by Gavin Barraclough and Mark Rowe.
2980 Add pattern length limit fixing one test in fast/js.
2983 (KJS::WRECompiler::compile):
2985 (KJS::WRECompiler::):
2987 2008-09-01 Sam Weinig <sam@webkit.org>
2989 Reviewed by Gavin Barraclough and Mark Rowe.
2991 Make octal escape parsing/back-reference parsing more closely match
2992 prior behavior fixing one test in fast/js.
2995 (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped
2996 (KJS::WRECompiler::parseEscape):
2998 (KJS::WRECompiler::peekDigit):
3000 2008-09-01 Sam Weinig <sam@webkit.org>
3002 Reviewed by Gavin Barraclough and Mark Rowe.
3004 Fix one mozilla test.
3007 (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not
3010 2008-09-01 Sam Weinig <sam@webkit.org>
3012 Reviewed by Gavin Barraclough and Mark Rowe.
3014 Parse octal escapes in character classes fixing one mozilla test.
3017 (KJS::WRECompiler::parseCharacterClass):
3018 (KJS::WRECompiler::parseOctalEscape):
3020 (KJS::WRECompiler::consumeOctal):
3022 2008-09-01 Sam Weinig <sam@webkit.org>
3024 Reviewed by Oliver Hunt.
3026 Fixes two mozilla tests with WREC enabled.
3029 (KJS::CharacterClassConstructor::append): Keep the character class sorted
3030 when appending another character class.
3032 2008-09-01 Sam Weinig <sam@webkit.org>
3034 Reviewed by Gavin Barraclough and Mark Rowe.
3036 Fixes two mozilla tests with WREC enabled.
3039 (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position
3040 instead of appending it to the end.
3042 2008-09-01 Gavin Barraclough <barraclough@apple.com>
3044 Reviewed by Oliver Hunt.
3046 Move cross-compilation unit call into NEVER_INLINE function.
3049 (KJS::doSetReturnAddressVmThrowTrampoline):
3051 2008-09-01 Sam Weinig <sam@webkit.org>
3053 Reviewed by Gavin Barraclough and Geoff Garen.
3055 Fix one test in fast/js.
3058 (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError,
3059 instead of a createNotAFunctionError.
3061 2008-08-31 Gavin Barraclough <barraclough@apple.com>
3063 Reviewed by Maciej Stachowiak.
3065 Zero-cost exception handling. This patch takes the exception checking
3066 back of the hot path. When an exception occurs in a Machine::cti*
3067 method, the return address to JIT code is recorded, and is then
3068 overwritten with a pointer to a trampoline routine. When the method
3069 returns the trampoline will cause the cti_vm_throw method to be invoked.
3071 cti_vm_throw uses the return address preserved above, to discover the
3072 vPC of the bytecode that raised the exception (using a map build during
3073 translation). From the VPC of the faulting bytecode the vPC of a catch
3074 routine may be discovered (unwinding the stack where necesary), and then
3075 a bytecode address for the catch routine is looked up. Final cti_vm_throw
3076 overwrites its return address to JIT code again, to trampoline directly
3077 to the catch routine.
3079 cti_op_throw is handled in a similar fashion.
3082 (KJS::CTI::emitPutCTIParam):
3083 (KJS::CTI::emitPutToCallFrameHeader):
3084 (KJS::CTI::emitGetFromCallFrameHeader):
3085 (KJS::ctiSetReturnAddressForArgs):
3086 (KJS::CTI::emitDebugExceptionCheck):
3087 (KJS::CTI::printOpcodeOperandTypes):
3088 (KJS::CTI::emitCall):
3089 (KJS::CTI::compileOpCall):
3090 (KJS::CTI::privateCompile_pass2_Main):
3091 (KJS::CTI::privateCompile):
3093 (KJS::CallRecord::CallRecord):
3095 (KJS::CTI::execute):
3098 (KJS::Machine::privateExecute):
3099 (KJS::Machine::cti_op_instanceof):
3100 (KJS::Machine::cti_op_call_NotJSFunction):
3101 (KJS::Machine::cti_op_resolve):
3102 (KJS::Machine::cti_op_resolve_func):
3103 (KJS::Machine::cti_op_resolve_skip):
3104 (KJS::Machine::cti_op_resolve_with_base):
3105 (KJS::Machine::cti_op_throw):
3106 (KJS::Machine::cti_op_in):
3107 (KJS::Machine::cti_vm_throw):
3108 * VM/RegisterFile.h:
3109 (KJS::RegisterFile::):
3111 (KJS::ExecState::setCtiReturnAddress):
3112 (KJS::ExecState::ctiReturnAddress):
3113 * masm/IA32MacroAsm.h:
3114 (KJS::IA32MacroAssembler::):
3115 (KJS::IA32MacroAssembler::emitPushl_m):
3116 (KJS::IA32MacroAssembler::emitPopl_m):
3117 (KJS::IA32MacroAssembler::getRelocatedAddress):
3119 2008-08-31 Mark Rowe <mrowe@apple.com>
3121 Reviewed by Oliver Hunt.
3123 Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them.
3126 (KJS::WRECompiler::parseParentheses):
3128 (KJS::WRECompiler::):
3130 2008-08-31 Mark Rowe <mrowe@apple.com>
3132 Reviewed by Oliver Hunt.
3134 Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled.
3137 (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum.
3138 (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register.
3139 (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag.
3141 2008-08-30 Mark Rowe <mrowe@apple.com>
3143 Reviewed by Oliver Hunt.
3145 Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance.
3146 This shows up as a 0.6% progression on SunSpider on my machine.
3148 Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out.
3151 (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc.
3152 * kjs/regexp.cpp: Ditto.
3153 * masm/IA32MacroAsm.h:
3154 (KJS::JITCodeBuffer::growBuffer):
3155 (KJS::JITCodeBuffer::JITCodeBuffer):
3156 (KJS::JITCodeBuffer::~JITCodeBuffer):
3157 (KJS::JITCodeBuffer::putByte):
3158 (KJS::JITCodeBuffer::putShort):
3159 (KJS::JITCodeBuffer::putInt):
3160 (KJS::JITCodeBuffer::reset):
3161 (KJS::JITCodeBuffer::copy):
3163 2008-08-29 Oliver Hunt <oliver@apple.com>
3167 Roll out previous patch as it causes a 5% performance regression
3169 * JavaScriptCore.xcodeproj/project.pbxproj:
3172 (KJS::CTI::privateCompile):
3174 (KJS::CodeBlock::~CodeBlock):
3175 * masm/IA32MacroAsm.h:
3176 (KJS::JITCodeBuffer::JITCodeBuffer):
3177 (KJS::JITCodeBuffer::putByte):
3178 (KJS::JITCodeBuffer::putShort):
3179 (KJS::JITCodeBuffer::putInt):
3180 (KJS::JITCodeBuffer::getEIP):
3181 (KJS::JITCodeBuffer::start):
3182 (KJS::JITCodeBuffer::getOffset):
3183 (KJS::JITCodeBuffer::reset):
3184 (KJS::JITCodeBuffer::copy):
3185 (KJS::IA32MacroAssembler::emitModRm_rr):
3186 (KJS::IA32MacroAssembler::emitModRm_rm):
3187 (KJS::IA32MacroAssembler::emitModRm_rmsib):
3188 (KJS::IA32MacroAssembler::IA32MacroAssembler):
3189 (KJS::IA32MacroAssembler::emitInt3):
3190 (KJS::IA32MacroAssembler::emitPushl_r):
3191 (KJS::IA32MacroAssembler::emitPopl_r):
3192 (KJS::IA32MacroAssembler::emitMovl_rr):
3193 (KJS::IA32MacroAssembler::emitAddl_rr):
3194 (KJS::IA32MacroAssembler::emitAddl_i8r):
3195 (KJS::IA32MacroAssembler::emitAddl_i32r):
3196 (KJS::IA32MacroAssembler::emitAddl_mr):
3197 (KJS::IA32MacroAssembler::emitAndl_rr):
3198 (KJS::IA32MacroAssembler::emitAndl_i32r):
3199 (KJS::IA32MacroAssembler::emitCmpl_i8r):
3200 (KJS::IA32MacroAssembler::emitCmpl_rr):
3201 (KJS::IA32MacroAssembler::emitCmpl_rm):
3202 (KJS::IA32MacroAssembler::emitCmpl_i32r):
3203 (KJS::IA32MacroAssembler::emitCmpl_i32m):
3204 (KJS::IA32MacroAssembler::emitCmpw_rm):
3205 (KJS::IA32MacroAssembler::emitOrl_rr):
3206 (KJS::IA32MacroAssembler::emitOrl_i8r):
3207 (KJS::IA32MacroAssembler::emitSubl_rr):
3208 (KJS::IA32MacroAssembler::emitSubl_i8r):
3209 (KJS::IA32MacroAssembler::emitSubl_i32r):
3210 (KJS::IA32MacroAssembler::emitSubl_mr):
3211 (KJS::IA32MacroAssembler::emitTestl_i32r):
3212 (KJS::IA32MacroAssembler::emitTestl_rr):
3213 (KJS::IA32MacroAssembler::emitXorl_i8r):
3214 (KJS::IA32MacroAssembler::emitXorl_rr):
3215 (KJS::IA32MacroAssembler::emitSarl_i8r):
3216 (KJS::IA32MacroAssembler::emitSarl_CLr):
3217 (KJS::IA32MacroAssembler::emitShl_i8r):
3218 (KJS::IA32MacroAssembler::emitShll_CLr):
3219 (KJS::IA32MacroAssembler::emitMull_rr):
3220 (KJS::IA32MacroAssembler::emitIdivl_r):
3221 (KJS::IA32MacroAssembler::emitCdq):
3222 (KJS::IA32MacroAssembler::emitMovl_mr):
3223 (KJS::IA32MacroAssembler::emitMovzwl_mr):
3224 (KJS::IA32MacroAssembler::emitMovl_rm):
3225 (KJS::IA32MacroAssembler::emitMovl_i32r):
3226 (KJS::IA32MacroAssembler::emitMovl_i32m):
3227 (KJS::IA32MacroAssembler::emitLeal_mr):
3228 (KJS::IA32MacroAssembler::emitRet):
3229 (KJS::IA32MacroAssembler::emitJmpN_r):
3230 (KJS::IA32MacroAssembler::emitJmpN_m):
3231 (KJS::IA32MacroAssembler::emitCall):
3232 (KJS::IA32MacroAssembler::label):
3233 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
3234 (KJS::IA32MacroAssembler::emitUnlinkedJne):
3235 (KJS::IA32MacroAssembler::emitUnlinkedJe):
3236 (KJS::IA32MacroAssembler::emitUnlinkedJl):
3237 (KJS::IA32MacroAssembler::emitUnlinkedJle):
3238 (KJS::IA32MacroAssembler::emitUnlinkedJge):
3239 (KJS::IA32MacroAssembler::emitUnlinkedJae):
3240 (KJS::IA32MacroAssembler::emitUnlinkedJo):
3241 (KJS::IA32MacroAssembler::link):
3243 (KJS::WRECompiler::compilePattern):
3244 (KJS::WRECompiler::compile):
3247 2008-08-29 Mark Rowe <mrowe@apple.com>
3249 Reviewed by Oliver Hunt.
3251 Have JITCodeBuffer manage a Vector containing the generated code so that it can grow
3252 as needed when generating code for a large function. This fixes all six remaining failures
3253 in Mozilla tests in both debug and release builds.
3256 (KJS::CTI::privateCompile):
3258 (KJS::CodeBlock::~CodeBlock):
3259 * masm/IA32MacroAsm.h:
3260 (KJS::JITCodeBuffer::putByte):
3261 (KJS::JITCodeBuffer::putShort):
3262 (KJS::JITCodeBuffer::putInt):
3263 (KJS::JITCodeBuffer::getEIP):
3264 (KJS::JITCodeBuffer::start):
3265 (KJS::JITCodeBuffer::getOffset):
3266 (KJS::JITCodeBuffer::getCode):
3267 (KJS::IA32MacroAssembler::emitModRm_rr):
3269 (KJS::WRECompiler::compilePattern):
3272 2008-08-29 Mark Rowe <mrowe@apple.com>
3274 Reviewed by Oliver Hunt.
3276 Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests.
3279 (KJS::WRECompiler::parseOctalEscape):
3280 (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero.
3281 Add a FIXME about treating invalid backreferences as octal escapes in the future.
3283 (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than
3286 (WTF::isASCIIOctalDigit):
3288 2008-08-29 Sam Weinig <sam@webkit.org>
3290 Reviewed by Mark Rowe.
3292 Pass vPC to instanceof method. Fixes 2 mozilla tests in debug.
3295 (KJS::CTI::privateCompile_pass2_Main):
3297 (KJS::Machine::cti_op_instanceof):
3299 2008-08-29 Sam Weinig <sam@webkit.org>
3301 Reviewed by Mark Rowe.
3303 Pass vPCs to resolve methods for correct exception creation. Fixes
3304 17 mozilla tests in debug.
3307 (KJS::CTI::privateCompile_pass2_Main):
3310 (KJS::Machine::cti_op_resolve):
3311 (KJS::Machine::cti_op_resolve_func):
3312 (KJS::Machine::cti_op_resolve_skip):
3313 (KJS::Machine::cti_op_resolve_with_base):
3315 2008-08-29 Gavin Barraclough <barraclough@apple.com>
3317 Reviewed by Oliver Hunt.
3319 Remembering to actually throw the exception passed to op throw helps.
3320 Regressions 19 -> 6.
3323 (KJS::Machine::cti_op_throw):
3324 (KJS::Machine::cti_vm_throw):
3326 2008-08-29 Gavin Barraclough <barraclough@apple.com>
3328 Reviewed by Sam Weinig.
3330 Support for exception unwinding the stack.
3332 Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address
3333 is now preserved on entry to a JIT code function (if we preserve lazily we need
3334 restore the native return address during exception stack unwind). This takes
3335 the number of regressions down from ~150 to 19.
3339 (KJS::CTI::emitExceptionCheck):
3340 (KJS::CTI::compileOpCall):
3341 (KJS::CTI::privateCompile_pass2_Main):
3342 (KJS::CTI::privateCompile):
3346 (KJS::Machine::throwException):
3347 (KJS::Machine::cti_op_call_JSFunction):
3348 (KJS::Machine::cti_op_call_NotJSFunction):
3349 (KJS::Machine::cti_op_construct_JSConstruct):
3350 (KJS::Machine::cti_op_construct_NotJSConstruct):
3351 (KJS::Machine::cti_op_throw):
3352 (KJS::Machine::cti_vm_throw):
3354 2008-08-29 Mark Rowe <mrowe@apple.com>
3356 Reviewed by Oliver Hunt.
3358 Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled.
3361 (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches
3362 succeeded, jump to failure.
3363 (KJS::WRECompiler::compilePattern): Restore and increment the current position stored
3364 on the stack to ensure that it will be reset to the correct position after a failed
3365 match has consumed input.
3367 2008-08-29 Mark Rowe <mrowe@apple.com>
3369 Reviewed by Oliver Hunt.
3371 Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled.
3372 A backreference with a quantifier would get stuck in an infinite
3373 loop if the captured range was empty.
3376 (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range
3377 was empty, do not attempt to match the backreference.
3378 (KJS::WRECompiler::parseBackreferenceQuantifier):
3380 (KJS::Quantifier::):
3382 2008-08-28 Sam Weinig <sam@webkit.org>
3384 Reviewed by Oliver Hunt.
3389 (KJS::CTI::privateCompile_pass1_Scan):
3390 (KJS::CTI::privateCompile_pass2_Main):
3392 (KJS::Machine::debug):
3393 (KJS::Machine::privateExecute):
3394 (KJS::Machine::cti_op_debug):
3397 2008-08-28 Sam Weinig <sam@webkit.org>
3399 Reviewed by Gavin Barraclough and Geoff Garen.
3401 Implement op_switch_string fixing 1 mozilla test and one test in fast/js.
3404 (KJS::CTI::privateCompile_pass1_Scan):
3405 (KJS::CTI::privateCompile_pass2_Main):
3406 (KJS::CTI::privateCompile):
3408 (KJS::SwitchRecord::):
3409 (KJS::SwitchRecord::SwitchRecord):
3411 (KJS::CodeBlock::dump):
3413 (KJS::ExpressionRangeInfo::):
3414 (KJS::StringJumpTable::offsetForValue):
3415 (KJS::StringJumpTable::ctiForValue):
3416 (KJS::SimpleJumpTable::add):
3417 (KJS::SimpleJumpTable::ctiForValue):
3418 * VM/CodeGenerator.cpp:
3419 (KJS::prepareJumpTableForStringSwitch):
3421 (KJS::Machine::privateExecute):
3422 (KJS::Machine::cti_op_switch_string):
3425 2008-08-28 Gavin Barraclough <barraclough@apple.com>
3427 Reviewed by Oliver Hunt.
3429 Do not recurse on the machine stack when executing op_call.
3432 (KJS::CTI::emitGetPutArg):
3433 (KJS::CTI::emitPutArg):
3434 (KJS::CTI::emitPutArgConstant):
3435 (KJS::CTI::compileOpCall):
3436 (KJS::CTI::privateCompile_pass2_Main):
3437 (KJS::CTI::privateCompile):
3440 (KJS::CTI::compile):
3441 (KJS::CTI::execute):
3444 (KJS::Machine::Machine):
3445 (KJS::Machine::execute):
3446 (KJS::Machine::cti_op_call_JSFunction):
3447 (KJS::Machine::cti_op_call_NotJSFunction):
3448 (KJS::Machine::cti_op_ret):
3449 (KJS::Machine::cti_op_construct_JSConstruct):
3450 (KJS::Machine::cti_op_construct_NotJSConstruct):
3451 (KJS::Machine::cti_op_call_eval):
3454 (KJS::Register::Register):
3455 * VM/RegisterFile.h:
3456 (KJS::RegisterFile::):
3457 * kjs/InternalFunction.h:
3458 (KJS::InternalFunction::InternalFunction):
3460 (KJS::JSFunction::JSFunction):
3462 (KJS::ScopeChain::ScopeChain):
3463 * masm/IA32MacroAsm.h:
3464 (KJS::IA32MacroAssembler::):
3465 (KJS::IA32MacroAssembler::emitModRm_opm):
3466 (KJS::IA32MacroAssembler::emitCmpl_i32m):
3467 (KJS::IA32MacroAssembler::emitCallN_r):
3469 2008-08-28 Sam Weinig <sam@webkit.org>
3471 Reviewed by Mark Rowe.
3473 Exit instead of crashing in ctiUnsupported and ctiTimedOut.
3476 (KJS::ctiUnsupported):
3479 2008-08-28 Oliver Hunt <oliver@apple.com>
3481 Reviewed by Maciej Stachowiak.
3483 Implement codegen for op_jsr and op_sret.
3486 (KJS::CTI::privateCompile_pass1_Scan):
3487 (KJS::CTI::privateCompile_pass2_Main):
3488 (KJS::CTI::privateCompile):
3490 (KJS::CTI::JSRInfo::JSRInfo):
3491 * masm/IA32MacroAsm.h:
3492 (KJS::IA32MacroAssembler::emitJmpN_m):
3493 (KJS::IA32MacroAssembler::linkAbsoluteAddress):
3495 2008-08-28 Gavin Barraclough <barraclough@apple.com>
3497 Reviewed by Oliver Hunt.
3499 Initial support for exceptions (throw / catch must occur in same CodeBlock).
3502 (KJS::CTI::emitExceptionCheck):
3503 (KJS::CTI::emitCall):
3504 (KJS::CTI::privateCompile_pass2_Main):
3505 (KJS::CTI::privateCompile_pass4_SlowCases):
3506 (KJS::CTI::privateCompile):
3509 (KJS::CodeBlock::nativeExceptionCodeForHandlerVPC):
3511 * VM/CodeGenerator.cpp:
3512 (KJS::CodeGenerator::emitCatch):
3514 (KJS::Machine::throwException):
3515 (KJS::Machine::privateExecute):
3516 (KJS::ctiUnsupported):
3518 (KJS::Machine::cti_op_add):
3519 (KJS::Machine::cti_op_pre_inc):
3520 (KJS::Machine::cti_timeout_check):
3521 (KJS::Machine::cti_op_loop_if_less):
3522 (KJS::Machine::cti_op_put_by_id):
3523 (KJS::Machine::cti_op_get_by_id):
3524 (KJS::Machine::cti_op_instanceof):
3525 (KJS::Machine::cti_op_del_by_id):
3526 (KJS::Machine::cti_op_mul):
3527 (KJS::Machine::cti_op_call):
3528 (KJS::Machine::cti_op_resolve):
3529 (KJS::Machine::cti_op_construct):
3530 (KJS::Machine::cti_op_get_by_val):
3531 (KJS::Machine::cti_op_resolve_func):
3532 (KJS::Machine::cti_op_sub):
3533 (KJS::Machine::cti_op_put_by_val):
3534 (KJS::Machine::cti_op_lesseq):
3535 (KJS::Machine::cti_op_loop_if_true):
3536 (KJS::Machine::cti_op_negate):
3537 (KJS::Machine::cti_op_resolve_skip):
3538 (KJS::Machine::cti_op_div):
3539 (KJS::Machine::cti_op_pre_dec):
3540 (KJS::Machine::cti_op_jless):
3541 (KJS::Machine::cti_op_not):
3542 (KJS::Machine::cti_op_jtrue):
3543 (KJS::Machine::cti_op_post_inc):
3544 (KJS::Machine::cti_op_eq):
3545 (KJS::Machine::cti_op_lshift):
3546 (KJS::Machine::cti_op_bitand):
3547 (KJS::Machine::cti_op_rshift):
3548 (KJS::Machine::cti_op_bitnot):
3549 (KJS::Machine::cti_op_resolve_with_base):
3550 (KJS::Machine::cti_op_mod):
3551 (KJS::Machine::cti_op_less):
3552 (KJS::Machine::cti_op_neq):
3553 (KJS::Machine::cti_op_post_dec):
3554 (KJS::Machine::cti_op_urshift):
3555 (KJS::Machine::cti_op_bitxor):
3556 (KJS::Machine::cti_op_bitor):
3557 (KJS::Machine::cti_op_call_eval):
3558 (KJS::Machine::cti_op_throw):
3559 (KJS::Machine::cti_op_push_scope):
3560 (KJS::Machine::cti_op_stricteq):
3561 (KJS::Machine::cti_op_nstricteq):
3562 (KJS::Machine::cti_op_to_jsnumber):
3563 (KJS::Machine::cti_op_in):
3564 (KJS::Machine::cti_op_del_by_val):
3565 (KJS::Machine::cti_vm_throw):
3568 * masm/IA32MacroAsm.h:
3569 (KJS::IA32MacroAssembler::emitCmpl_i32m):
3571 2008-08-28 Mark Rowe <mrowe@apple.com>
3573 Rubber-stamped by Oliver Hunt.
3575 Print debugging info to stderr so that run-webkit-tests can capture it.
3576 This makes it easy to check whether test failures are due to unimplemented
3577 op codes, missing support for exceptions, etc.
3580 (KJS::CTI::privateCompile_pass1_Scan):
3581 (KJS::CTI::printOpcodeOperandTypes):
3582 (KJS::CTI::privateCompile_pass2_Main):
3583 (KJS::CTI::privateCompile_pass4_SlowCases):
3584 (KJS::CTI::privateCompile):
3586 (KJS::Machine::privateExecute):
3587 (KJS::ctiException):
3588 (KJS::ctiUnsupported):
3589 (KJS::Machine::cti_op_call):
3590 (KJS::Machine::cti_op_resolve):
3591 (KJS::Machine::cti_op_construct):
3592 (KJS::Machine::cti_op_get_by_val):
3593 (KJS::Machine::cti_op_resolve_func):
3594 (KJS::Machine::cti_op_resolve_skip):
3595 (KJS::Machine::cti_op_resolve_with_base):
3596 (KJS::Machine::cti_op_call_eval):
3598 2008-08-27 Mark Rowe <mrowe@apple.com>
3600 Reviewed by Gavin Barraclough and Maciej Stachowiak.
3602 Fix fast/js/bitwise-and-on-undefined.html.
3604 A temporary value in the slow path of op_bitand was being stored in edx, but was
3605 being clobbered by emitGetPutArg before we used it. To fix this, emitGetPutArg
3606 now takes a third argument that specifies the scratch register to use when loading
3607 from memory. This allows us to avoid clobbering the temporary in op_bitand.
3610 (KJS::CTI::emitGetPutArg):
3611 (KJS::CTI::privateCompile_pass2_Main):
3612 (KJS::CTI::privateCompile_pass4_SlowCases):
3615 2008-08-27 Mark Rowe <mrowe@apple.com>
3617 Rubber-stamped by Oliver Hunt.
3619 Switch CTI on by default.
3623 2008-08-27 Mark Rowe <mrowe@apple.com>
3625 Reviewed by Oliver Hunt.
3627 Fix the build of the full WebKit stack.
3629 * JavaScriptCore.xcodeproj/project.pbxproj: Mark two new headers as private so they can be pulled in from WebCore.
3630 * VM/CTI.h: Fix build issues that show up when compiled with GCC 4.2 as part of WebCore.
3631 * wrec/WREC.h: Ditto.
3633 2008-08-27 Mark Rowe <mrowe@apple.com>
3635 Reviewed by Sam Weinig.
3637 Implement op_new_error. Does not fix any tests as it is always followed by the unimplemented op_throw.
3640 (KJS::CTI::privateCompile_pass1_Scan):
3641 (KJS::CTI::privateCompile_pass2_Main):
3643 (KJS::Machine::cti_op_new_error):
3646 2008-08-27 Sam Weinig <sam@webkit.org>
3648 Reviewed by Gavin Barraclough and Geoff Garen.
3650 Implement op_put_getter and op_put_setter.
3653 (KJS::CTI::privateCompile_pass1_Scan):
3654 (KJS::CTI::privateCompile_pass2_Main):
3656 (KJS::Machine::cti_op_put_getter):
3657 (KJS::Machine::cti_op_put_setter):
3660 2008-08-27 Sam Weinig <sam@webkit.org>
3662 Reviewed by Gavin Barraclough and Geoff Garen.
3664 Implement op_del_by_val fixing 3 mozilla tests.
3667 (KJS::CTI::privateCompile_pass1_Scan):
3668 (KJS::CTI::privateCompile_pass2_Main):
3670 (KJS::Machine::cti_op_del_by_val):
3673 2008-08-27 Gavin Barraclough <barraclough@apple.com>
3675 Reviewed by Oliver Hunt.
3677 Quick & dirty fix to get SamplingTool sampling op_call.
3679 * VM/SamplingTool.h:
3680 (KJS::SamplingTool::callingHostFunction):
3682 2008-08-27 Sam Weinig <sam@webkit.org>
3684 Reviewed by Gavin Barraclough and Geoff Garen.
3686 Fix op_put_by_index.
3689 (KJS::CTI::privateCompile_pass2_Main): Use emitPutArgConstant instead of emitGetPutArg
3690 for the property value.
3692 (KJS::Machine::cti_op_put_by_index): Get the property value from the correct argument.
3694 2008-08-27 Sam Weinig <sam@webkit.org>
3696 Reviewed by Gavin Barraclough and Geoff Garen.
3698 Implement op_switch_imm in the CTI fixing 13 mozilla tests.
3701 (KJS::CTI::privateCompile_pass1_Scan):
3702 (KJS::CTI::privateCompile_pass2_Main):
3704 (KJS::Machine::cti_op_switch_imm):
3707 2008-08-27 Gavin Barraclough <barraclough@apple.com>
3709 Reviewed by Oliver Hunt.
3711 Implement op_switch_char in CTI.
3714 (KJS::CTI::emitCall):
3715 (KJS::CTI::privateCompile_pass1_Scan):
3716 (KJS::CTI::privateCompile_pass2_Main):
3717 (KJS::CTI::privateCompile):
3719 (KJS::CallRecord::CallRecord):
3720 (KJS::SwitchRecord::SwitchRecord):
3722 (KJS::SimpleJumpTable::SimpleJumpTable::ctiForValue):
3724 (KJS::Machine::cti_op_switch_char):
3726 * masm/IA32MacroAsm.h:
3727 (KJS::IA32MacroAssembler::):
3728 (KJS::IA32MacroAssembler::emitJmpN_r):
3729 (KJS::IA32MacroAssembler::getRelocatedAddress):
3732 2008-08-26 Sam Weinig <sam@webkit.org>
3734 Reviewed by Mark Rowe.
3736 Implement op_put_by_index to fix 1 mozilla test.
3739 (KJS::CTI::privateCompile_pass1_Scan):
3740 (KJS::CTI::privateCompile_pass2_Main):
3742 (KJS::Machine::cti_op_put_by_index):
3745 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3747 Reviewed by Geoff Garen.
3749 More fixes from Geoff's review.
3752 (KJS::CTI::emitGetArg):
3753 (KJS::CTI::emitGetPutArg):
3754 (KJS::CTI::emitPutArg):
3755 (KJS::CTI::emitPutArgConstant):
3756 (KJS::CTI::getConstantImmediateNumericArg):
3757 (KJS::CTI::emitGetCTIParam):
3758 (KJS::CTI::emitPutResult):
3759 (KJS::CTI::emitCall):
3760 (KJS::CTI::emitJumpSlowCaseIfNotImm):
3761 (KJS::CTI::emitJumpSlowCaseIfNotImms):
3762 (KJS::CTI::getDeTaggedConstantImmediate):
3763 (KJS::CTI::emitFastArithDeTagImmediate):
3764 (KJS::CTI::emitFastArithReTagImmediate):
3765 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
3766 (KJS::CTI::emitFastArithImmToInt):
3767 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
3768 (KJS::CTI::privateCompile_pass2_Main):
3769 (KJS::CTI::privateCompile_pass4_SlowCases):
3770 (KJS::CTI::privateCompile):
3773 2008-08-26 Mark Rowe <mrowe@apple.com>
3775 Reviewed by Gavin Barraclough and Geoff Garen.
3777 Implement op_jmp_scopes to fix 2 Mozilla tests.
3780 (KJS::CTI::privateCompile_pass1_Scan):
3781 (KJS::CTI::privateCompile_pass2_Main):
3783 (KJS::Machine::cti_op_push_new_scope): Update ExecState::m_scopeChain after calling ARG_setScopeChain.
3784 (KJS::Machine::cti_op_jmp_scopes):
3787 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3789 Reviewed by Oliver Hunt.
3791 WebKit Regular Expression Compiler. (set ENABLE_WREC = 1 in Platform.h).
3793 * JavaScriptCore.xcodeproj/project.pbxproj:
3797 * wrec/WREC.cpp: Added.
3798 * wrec/WREC.h: Added.
3801 2008-08-26 Sam Weinig <sam@webkit.org>
3803 Rubber-stamped by Oliver Hunt.
3805 Remove bogus assertion.
3808 (KJS::Machine::cti_op_del_by_id):
3810 2008-08-26 Mark Rowe <mrowe@apple.com>
3812 Reviewed by Sam Weinig.
3814 Implement op_push_new_scope and stub out op_catch. This fixes 11 Mozilla tests.
3817 (KJS::CTI::privateCompile_pass1_Scan):
3818 (KJS::CTI::privateCompile_pass2_Main):
3820 (KJS::Machine::cti_op_push_new_scope):
3821 (KJS::Machine::cti_op_catch):
3824 2008-08-26 Mark Rowe <mrowe@apple.com>
3826 Reviewed by Sam Weinig.
3828 Clean up op_resolve_base so that it shares its implementation with the bytecode interpreter.
3831 (KJS::inlineResolveBase):
3834 2008-08-26 Oliver Hunt <oliver@apple.com>
3836 Reviewed by Sam Weinig.
3838 Add codegen support for op_instanceof, fixing 15 mozilla tests.
3841 (KJS::CTI::privateCompile_pass1_Scan):
3842 (KJS::CTI::privateCompile_pass2_Main):
3844 (KJS::Machine::cti_op_instanceof):
3845 (KJS::Machine::cti_op_del_by_id):
3849 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3851 Reviewed by Geoff Garen.
3853 Fixes for initial review comments.
3856 (KJS::CTI::ctiCompileGetArg):
3857 (KJS::CTI::ctiCompileGetPutArg):
3858 (KJS::CTI::ctiCompilePutResult):
3859 (KJS::CTI::ctiCompileCall):
3861 (KJS::CTI::privateCompile_pass1_Scan):
3862 (KJS::CTI::printOpcodeOperandTypes):
3863 (KJS::CTI::privateCompile_pass2_Main):
3864 (KJS::CTI::privateCompile_pass4_SlowCases):
3865 (KJS::CTI::privateCompile):
3870 2008-08-26 Sam Weinig <sam@webkit.org>
3872 Reviewed by Gavin Barraclough and Geoff Garen.
3874 Fix up exception checking code.
3877 (KJS::Machine::cti_op_call):
3878 (KJS::Machine::cti_op_resolve):
3879 (KJS::Machine::cti_op_construct):
3880 (KJS::Machine::cti_op_resolve_func):
3881 (KJS::Machine::cti_op_resolve_skip):
3882 (KJS::Machine::cti_op_resolve_with_base):
3883 (KJS::Machine::cti_op_call_eval):
3885 2008-08-26 Sam Weinig <sam@webkit.org>
3887 Reviewed by Oliver Hunt.
3889 Fix slowcase for op_post_inc and op_post_dec fixing 2 mozilla tests.
3892 (KJS::CTI::privateCompile_pass4_SlowCases):
3894 2008-08-26 Mark Rowe <mrowe@apple.com>
3896 Reviewed by Sam Weinig.
3898 Implement op_in, fixing 8 mozilla tests.
3901 (KJS::CTI::privateCompile_pass1_Scan):
3902 (KJS::CTI::privateCompile_pass2_Main):
3904 (KJS::Machine::cti_op_in):
3907 2008-08-26 Mark Rowe <mrowe@apple.com>
3909 Rubber-stamped by Oliver Hunt.
3911 Don't hardcode the size of a Register for op_new_array. Fixes a crash
3912 seen during the Mozilla tests.
3915 (KJS::CTI::privateCompile_pass2_Main):
3917 2008-08-26 Sam Weinig <sam@webkit.org>
3919 Reviewed by Gavin Barraclough and Geoff Garen.
3921 Add support for op_push_scope and op_pop_scope, fixing 20 mozilla tests.
3924 (KJS::CTI::privateCompile_pass1_Scan):
3925 (KJS::CTI::privateCompile_pass2_Main):
3928 (KJS::Machine::cti_op_push_scope):
3929 (KJS::Machine::cti_op_pop_scope):
3932 2008-08-26 Oliver Hunt <oliver@apple.com>
3934 Reviewed by Maciej Stachowiak.
3936 Add codegen support for op_del_by_id, fixing 49 mozilla tests.
3939 (KJS::CTI::privateCompile_pass1_Scan):
3940 (KJS::CTI::privateCompile_pass2_Main):
3942 (KJS::Machine::cti_op_del_by_id):
3945 2008-08-26 Sam Weinig <sam@webkit.org>
3947 Reviewed by Gavin Barraclough and Geoff Garen.
3949 Don't hardcode the size of a Register for op_get_scoped_var and op_put_scoped_var
3950 fixing 513 mozilla tests in debug build.
3953 (KJS::CTI::privateCompile_pass2_Main):
3955 2008-08-26 Oliver Hunt <oliver@apple.com>
3957 Reviewed by Maciej Stachowiak.
3959 Added code generator support for op_loop, fixing around 60 mozilla tests.
3962 (KJS::CTI::privateCompile_pass1_Scan):
3963 (KJS::CTI::privateCompile_pass2_Main):
3965 2008-08-26 Mark Rowe <mrowe@apple.com>
3967 Reviewed by Sam Weinig.
3969 Set -fomit-frame-pointer in the correct location.
3971 * Configurations/JavaScriptCore.xcconfig:
3972 * JavaScriptCore.xcodeproj/project.pbxproj:
3974 2008-08-26 Gavin Barraclough <barraclough@apple.com>
3976 Reviewed by Geoff Garen.
3978 Inital cut of CTI, Geoff's review fixes to follow.
3980 * JavaScriptCore.xcodeproj/project.pbxproj:
3981 * VM/CTI.cpp: Added.
3983 (KJS::CTI::ctiCompileGetArg):
3984 (KJS::CTI::ctiCompileGetPutArg):
3985 (KJS::CTI::ctiCompilePutArg):
3986 (KJS::CTI::ctiCompilePutArgImm):
3987 (KJS::CTI::ctiImmediateNumericArg):
3988 (KJS::CTI::ctiCompileGetCTIParam):
3989 (KJS::CTI::ctiCompilePutResult):
3990 (KJS::CTI::ctiCompileCall):
3991 (KJS::CTI::slowCaseIfNotImm):
3992 (KJS::CTI::slowCaseIfNotImms):
3993 (KJS::CTI::ctiFastArithDeTagConstImmediate):
3994 (KJS::CTI::ctiFastArithDeTagImmediate):
3995 (KJS::CTI::ctiFastArithReTagImmediate):
3996 (KJS::CTI::ctiFastArithPotentiallyReTagImmediate):
3997 (KJS::CTI::ctiFastArithImmToInt):
3998 (KJS::CTI::ctiFastArithIntToImmOrSlowCase):
4000 (KJS::CTI::privateCompile_pass1_Scan):
4001 (KJS::CTI::ctiCompileAdd):
4002 (KJS::CTI::ctiCompileAddImm):
4003 (KJS::CTI::ctiCompileAddImmNotInt):
4004 (KJS::CTI::TEMP_HACK_PRINT_TYPES):
4005 (KJS::CTI::privateCompile_pass2_Main):
4006 (KJS::CTI::privateCompile_pass3_Link):
4007 (KJS::CTI::privateCompile_pass4_SlowCases):
4008 (KJS::CTI::privateCompile):
4010 (KJS::CTI2Result::CTI2Result):
4011 (KJS::CallRecord::CallRecord):
4012 (KJS::JmpTable::JmpTable):
4013 (KJS::SlowCaseEntry::SlowCaseEntry):
4014 (KJS::CTI::compile):
4015 (KJS::CTI::LabelInfo::LabelInfo):
4017 (KJS::CodeBlock::CodeBlock):
4018 (KJS::CodeBlock::~CodeBlock):
4020 (KJS::Machine::execute):
4021 (KJS::Machine::privateExecute):
4022 (KJS::ctiException):
4023 (KJS::ctiUnsupported):
4025 (KJS::Machine::cti_op_end):
4026 (KJS::Machine::cti_op_add):
4027 (KJS::Machine::cti_op_pre_inc):
4028 (KJS::Machine::cti_timeout_check):
4029 (KJS::Machine::cti_op_loop_if_less):
4030 (KJS::Machine::cti_op_new_object):
4031 (KJS::Machine::cti_op_put_by_id):
4032 (KJS::Machine::cti_op_get_by_id):
4033 (KJS::Machine::cti_op_mul):
4034 (KJS::Machine::cti_op_new_func):
4035 (KJS::Machine::cti_op_call):
4036 (KJS::Machine::cti_op_ret):
4037 (KJS::Machine::cti_op_new_array):
4038 (KJS::Machine::cti_op_resolve):
4039 (KJS::Machine::cti_op_construct):
4040 (KJS::Machine::cti_op_get_by_val):
4041 (KJS::Machine::cti_op_resolve_func):
4042 (KJS::Machine::cti_op_sub):
4043 (KJS::Machine::cti_op_put_by_val):
4044 (KJS::Machine::cti_op_lesseq):
4045 (KJS::Machine::cti_op_loop_if_true):
4046 (KJS::Machine::cti_op_negate):
4047 (KJS::Machine::cti_op_resolve_base):
4048 (KJS::Machine::cti_op_resolve_skip):
4049 (KJS::Machine::cti_op_div):
4050 (KJS::Machine::cti_op_pre_dec):
4051 (KJS::Machine::cti_op_jless):
4052 (KJS::Machine::cti_op_not):
4053 (KJS::Machine::cti_op_jtrue):
4054 (KJS::Machine::cti_op_post_inc):
4055 (KJS::Machine::cti_op_eq):
4056 (KJS::Machine::cti_op_lshift):
4057 (KJS::Machine::cti_op_bitand):
4058 (KJS::Machine::cti_op_rshift):
4059 (KJS::Machine::cti_op_bitnot):
4060 (KJS::Machine::cti_op_resolve_with_base):
4061 (KJS::Machine::cti_op_new_func_exp):
4062 (KJS::Machine::cti_op_mod):
4063 (KJS::Machine::cti_op_less):
4064 (KJS::Machine::cti_op_neq):
4065 (KJS::Machine::cti_op_post_dec):
4066 (KJS::Machine::cti_op_urshift):
4067 (KJS::Machine::cti_op_bitxor):
4068 (KJS::Machine::cti_op_new_regexp):
4069 (KJS::Machine::cti_op_bitor):
4070 (KJS::Machine::cti_op_call_eval):
4071 (KJS::Machine::cti_op_throw):
4072 (KJS::Machine::cti_op_get_pnames):
4073 (KJS::Machine::cti_op_next_pname):
4074 (KJS::Machine::cti_op_typeof):
4075 (KJS::Machine::cti_op_stricteq):
4076 (KJS::Machine::cti_op_nstricteq):
4077 (KJS::Machine::cti_op_to_jsnumber):
4080 (KJS::Register::jsValue):
4081 (KJS::Register::getJSValue):
4082 (KJS::Register::codeBlock):
4083 (KJS::Register::scopeChain):
4086 (KJS::Register::vPC):
4087 (KJS::Register::jsPropertyNameIterator):
4088 * VM/SamplingTool.cpp:
4090 (KJS::SamplingTool::run):
4091 (KJS::SamplingTool::dump):
4092 * VM/SamplingTool.h:
4093 * kjs/JSImmediate.h:
4094 (KJS::JSImmediate::zeroImmediate):
4095 (KJS::JSImmediate::oneImmediate):
4097 * kjs/JSVariableObject.h:
4098 (KJS::JSVariableObject::JSVariableObjectData::offsetOf_registers):
4099 (KJS::JSVariableObject::offsetOf_d):
4100 (KJS::JSVariableObject::offsetOf_Data_registers):
4102 * masm/IA32MacroAsm.h: Added.
4103 (KJS::JITCodeBuffer::JITCodeBuffer):
4104 (KJS::JITCodeBuffer::putByte):
4105 (KJS::JITCodeBuffer::putShort):
4106 (KJS::JITCodeBuffer::putInt):
4107 (KJS::JITCodeBuffer::getEIP):
4108 (KJS::JITCodeBuffer::start):
4109 (KJS::JITCodeBuffer::getOffset):
4110 (KJS::JITCodeBuffer::reset):
4111 (KJS::JITCodeBuffer::copy):
4112 (KJS::IA32MacroAssembler::):
4113 (KJS::IA32MacroAssembler::emitModRm_rr):
4114 (KJS::IA32MacroAssembler::emitModRm_rm):
4115 (KJS::IA32MacroAssembler::emitModRm_rmsib):
4116 (KJS::IA32MacroAssembler::emitModRm_opr):
4117 (KJS::IA32MacroAssembler::emitModRm_opm):
4118 (KJS::IA32MacroAssembler::IA32MacroAssembler):
4119 (KJS::IA32MacroAssembler::emitInt3):
4120 (KJS::IA32MacroAssembler::emitPushl_r):
4121 (KJS::IA32MacroAssembler::emitPopl_r):
4122 (KJS::IA32MacroAssembler::emitMovl_rr):
4123 (KJS::IA32MacroAssembler::emitAddl_rr):
4124 (KJS::IA32MacroAssembler::emitAddl_i8r):
4125 (KJS::IA32MacroAssembler::emitAddl_i32r):
4126 (KJS::IA32MacroAssembler::emitAddl_mr):
4127 (KJS::IA32MacroAssembler::emitAndl_rr):
4128 (KJS::IA32MacroAssembler::emitAndl_i32r):
4129 (KJS::IA32MacroAssembler::emitCmpl_i8r):
4130 (KJS::IA32MacroAssembler::emitCmpl_rr):
4131 (KJS::IA32MacroAssembler::emitCmpl_rm):
4132 (KJS::IA32MacroAssembler::emitCmpl_i32r):
4133 (KJS::IA32MacroAssembler::emitCmpw_rm):
4134 (KJS::IA32MacroAssembler::emitOrl_rr):
4135 (KJS::IA32MacroAssembler::emitOrl_i8r):
4136 (KJS::IA32MacroAssembler::emitSubl_rr):
4137 (KJS::IA32MacroAssembler::emitSubl_i8r):
4138 (KJS::IA32MacroAssembler::emitSubl_i32r):
4139 (KJS::IA32MacroAssembler::emitSubl_mr):
4140 (KJS::IA32MacroAssembler::emitTestl_i32r):
4141 (KJS::IA32MacroAssembler::emitTestl_rr):
4142 (KJS::IA32MacroAssembler::emitXorl_i8r):
4143 (KJS::IA32MacroAssembler::emitXorl_rr):
4144 (KJS::IA32MacroAssembler::emitSarl_i8r):
4145 (KJS::IA32MacroAssembler::emitSarl_CLr):
4146 (KJS::IA32MacroAssembler::emitShl_i8r):
4147 (KJS::IA32MacroAssembler::emitShll_CLr):
4148 (KJS::IA32MacroAssembler::emitMull_rr):
4149 (KJS::IA32MacroAssembler::emitIdivl_r):
4150 (KJS::IA32MacroAssembler::emitCdq):
4151 (KJS::IA32MacroAssembler::emitMovl_mr):
4152 (KJS::IA32MacroAssembler::emitMovzwl_mr):
4153 (KJS::IA32MacroAssembler::emitMovl_rm):
4154 (KJS::IA32MacroAssembler::emitMovl_i32r):
4155 (KJS::IA32MacroAssembler::emitMovl_i32m):
4156 (KJS::IA32MacroAssembler::emitLeal_mr):
4157 (KJS::IA32MacroAssembler::emitRet):
4158 (KJS::IA32MacroAssembler::JmpSrc::JmpSrc):
4159 (KJS::IA32MacroAssembler::JmpDst::JmpDst):
4160 (KJS::IA32MacroAssembler::emitCall):
4161 (KJS::IA32MacroAssembler::label):
4162 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
4163 (KJS::IA32MacroAssembler::emitUnlinkedJne):
4164 (KJS::IA32MacroAssembler::emitUnlinkedJe):
4165 (KJS::IA32MacroAssembler::emitUnlinkedJl):
4166 (KJS::IA32MacroAssembler::emitUnlinkedJle):
4167 (KJS::IA32MacroAssembler::emitUnlinkedJge):
4168 (KJS::IA32MacroAssembler::emitUnlinkedJae):
4169 (KJS::IA32MacroAssembler::emitUnlinkedJo):
4170 (KJS::IA32MacroAssembler::emitPredictionNotTaken):
4171 (KJS::IA32MacroAssembler::link):
4172 (KJS::IA32MacroAssembler::copy):
4175 2008-08-26 Oliver Hunt <oliver@apple.com>
4179 Enabled -fomit-frame-pointer on Release and Production builds, add additional Profiling build config for shark, etc.
4181 * JavaScriptCore.xcodeproj/project.pbxproj:
4183 === Start merge of squirrelfish-extreme ===
4185 2008-09-06 Cameron Zwarich <cwzwarich@uwaterloo.ca>
4187 Reviewed by Maciej Stachowiak.
4189 Fix the Mac Debug build by adding symbols that are exported only in a
4190 Debug configuration.
4192 * Configurations/JavaScriptCore.xcconfig:
4193 * DerivedSources.make:
4194 * JavaScriptCore.Debug.exp: Added.
4195 * JavaScriptCore.base.exp: Copied from JavaScriptCore.exp.
4196 * JavaScriptCore.exp: Removed.
4197 * JavaScriptCore.xcodeproj/project.pbxproj:
4199 2008-09-05 Darin Adler <darin@apple.com>
4201 Reviewed by Cameron Zwarich.
4203 - https://bugs.webkit.org/show_bug.cgi?id=20681
4204 JSPropertyNameIterator functions need to be inlined
4206 1.007x as fast on SunSpider overall
4207 1.081x as fast on SunSpider math-cordic
4209 * VM/JSPropertyNameIterator.cpp: Moved functions out of here.
4210 * VM/JSPropertyNameIterator.h:
4211 (KJS::JSPropertyNameIterator::JSPropertyNameIterator): Moved
4212 this into the header and marked it inline.
4213 (KJS::JSPropertyNameIterator::create): Ditto.
4214 (KJS::JSPropertyNameIterator::next): Ditto.
4216 2008-09-05 Darin Adler <darin@apple.com>
4218 Reviewed by Geoffrey Garen.
4220 - fix https://bugs.webkit.org/show_bug.cgi?id=20673
4221 single-character strings are churning in the Identifier table
4223 1.007x as fast on SunSpider overall
4224 1.167x as fast on SunSpider string-fasta
4226 * JavaScriptCore.exp: Updated.
4227 * kjs/SmallStrings.cpp:
4228 (KJS::SmallStrings::singleCharacterStringRep): Added.
4229 * kjs/SmallStrings.h: Added singleCharacterStringRep for clients that
4230 need just a UString, not a JSString.
4231 * kjs/identifier.cpp:
4232 (KJS::Identifier::add): Added special cases for single character strings
4233 so that the UString::Rep that ends up in the identifier table is the one
4234 from the single-character string optimization; otherwise we end up having
4235 to look it up in the identifier table over and over again.
4236 (KJS::Identifier::addSlowCase): Ditto.
4237 (KJS::Identifier::checkSameIdentifierTable): Made this function an empty
4238 inline in release builds so that callers don't have to put #ifndef NDEBUG
4241 (KJS::Identifier::add): Removed #ifndef NDEBUG around the calls to
4242 checkSameIdentifierTable.
4243 (KJS::Identifier::checkSameIdentifierTable): Added. Empt