1 2008-09-19 Oliver Hunt <oliver@apple.com>
3 Reviewed by Maciej Stachowiak.
5 Improve peformance of local variable initialisation.
7 Pull local and constant initialisation out of slideRegisterWindowForCall
8 and into its own opcode. This allows the JIT to generate the initialisation
9 code for a function directly into the instruction stream and so avoids a few
10 branches on function entry.
12 Results a 1% progression in SunSpider, particularly in a number of the bitop
13 tests where the called functions are very fast.
16 (JSC::CTI::emitInitialiseRegister):
17 (JSC::CTI::privateCompileMainPass):
20 (JSC::CodeBlock::dump):
21 * VM/CodeGenerator.cpp:
22 (JSC::CodeGenerator::CodeGenerator):
24 (JSC::slideRegisterWindowForCall):
25 (JSC::Machine::privateExecute):
28 2008-09-19 Sam Weinig <sam@webkit.org>
30 Reviewed by Darin Adler.
32 Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
33 Speed up JS property enumeration by caching entire PropertyNameArray
35 1.3% speedup on Sunspider, 30% on string-fasta.
38 * VM/JSPropertyNameIterator.cpp:
39 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
40 (JSC::JSPropertyNameIterator::invalidate):
41 * VM/JSPropertyNameIterator.h:
42 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
43 (JSC::JSPropertyNameIterator::create):
45 (JSC::JSObject::getPropertyNames):
46 * kjs/PropertyMap.cpp:
47 (JSC::PropertyMap::getEnumerablePropertyNames):
49 * kjs/PropertyNameArray.cpp:
50 (JSC::PropertyNameArray::add):
51 * kjs/PropertyNameArray.h:
52 (JSC::PropertyNameArrayData::create):
53 (JSC::PropertyNameArrayData::propertyNameVector):
54 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
55 (JSC::PropertyNameArrayData::cachedPrototypeChain):
56 (JSC::PropertyNameArrayData::begin):
57 (JSC::PropertyNameArrayData::end):
58 (JSC::PropertyNameArrayData::PropertyNameArrayData):
59 (JSC::PropertyNameArray::PropertyNameArray):
60 (JSC::PropertyNameArray::addKnownUnique):
61 (JSC::PropertyNameArray::size):
62 (JSC::PropertyNameArray::operator[]):
63 (JSC::PropertyNameArray::begin):
64 (JSC::PropertyNameArray::end):
65 (JSC::PropertyNameArray::setData):
66 (JSC::PropertyNameArray::data):
67 (JSC::PropertyNameArray::releaseData):
69 (JSC::ScopeChainNode::print):
70 * kjs/StructureID.cpp:
71 (JSC::structureIDChainsAreEqual):
72 (JSC::StructureID::getEnumerablePropertyNames):
73 (JSC::StructureID::clearEnumerationCache):
74 (JSC::StructureID::createCachedPrototypeChain):
77 2008-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
79 Reviewed by Maciej Stachowiak.
81 Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
84 (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
86 2008-09-19 Darin Adler <darin@apple.com>
88 Reviewed by Sam Weinig.
90 - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
91 make each distinct C++ class get a distinct JSC::Structure
93 * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
95 * kjs/JSGlobalObject.h: Changed the protected constructor to take a
96 structure instead of a prototype.
98 * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
100 2008-09-19 Julien Chaffraix <jchaffraix@pleyo.com>
102 Reviewed by Alexey Proskuryakov.
104 Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
105 non-template methods' code been copied for each instance of the template.
106 The patch splits RefCounted between a base class that holds non-template methods and attributes
107 and the template RefCounted class that keeps the same functionnality.
109 On my Linux with gcc 4.3 for the Gtk port, this is:
110 - a ~600KB save on libwebkit.so in release.
111 - a ~1.6MB save on libwebkit.so in debug.
113 It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
114 On the whole, it should be a small win as we reduce the compiled code size and the only
115 new function call should be inlined by the compiler.
118 (WTF::RefCountedBase::ref): Copied from RefCounted.
119 (WTF::RefCountedBase::hasOneRef): Ditto.
120 (WTF::RefCountedBase::refCount): Ditto.
121 (WTF::RefCountedBase::RefCountedBase): Ditto.
122 (WTF::RefCountedBase::~RefCountedBase): Ditto.
123 (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
125 (WTF::RefCounted::RefCounted):
126 (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
127 (WTF::RefCounted::~RefCounted): Keep private destructor.
129 2008-09-18 Darin Adler <darin@apple.com>
131 Reviewed by Maciej Stachowiak.
133 - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
134 make each distinct C++ class get a distinct JSC::Structure
136 * kjs/lookup.h: Removed things here that were used only in WebCore:
137 cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
138 and JSC_IMPLEMENT_PROTOTYPE.
140 2008-09-18 Darin Adler <darin@apple.com>
142 Reviewed by Maciej Stachowiak.
144 - https://bugs.webkit.org/show_bug.cgi?id=20927
145 simplify/streamline the code to turn strings into identifiers while parsing
147 * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
151 (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
152 * kjs/lexer.h: Remove makeUString.
154 * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
156 * VM/CodeGenerator.cpp:
157 (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
158 (JSC::prepareJumpTableForStringSwitch): Ditto.
160 (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
161 (JSC::processClauseList): Ditto.
162 * kjs/nodes2string.cpp:
163 (JSC::StringNode::streamTo): Ditto.
165 2008-09-18 Sam Weinig <sam@webkit.org>
170 (JSC::Instruction::Instruction):
172 2008-09-18 Oliver Hunt <oliver@apple.com>
174 Reviewed by Maciej Stachowiak.
176 Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
177 <https://bugs.webkit.org/show_bug.cgi?id=20911>
179 The problem was simply caused by the int constructor for Instruction
180 failing to initialise the full struct in 64bit builds.
183 (JSC::Instruction::Instruction):
185 2008-09-18 Darin Adler <darin@apple.com>
189 * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
191 2008-09-18 Darin Adler <darin@apple.com>
193 Reviewed by Sam Weinig.
195 * kjs/JSGlobalObject.h: Tiny style guideline tweak.
197 2008-09-18 Darin Adler <darin@apple.com>
199 Reviewed by Sam Weinig.
201 - fix https://bugs.webkit.org/show_bug.cgi?id=20925
202 LEAK messages appear every time I quit
204 * JavaScriptCore.exp: Updated, and also added an export
205 needed for future WebCore use of JSC::StructureID.
207 * wtf/RefCountedLeakCounter.cpp:
208 (WTF::RefCountedLeakCounter::suppressMessages): Added.
209 (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
210 (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
211 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
212 log the reason there was no leak checking done.
213 (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
214 (WTF::RefCountedLeakCounter::decrement): Ditto.
216 * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
217 new functions, suppressMessages and cancelMessageSuppression. Also
218 added m_ prefixes to the data member names.
220 2008-09-18 Holger Hans Peter Freyther <zecke@selfish.org>
222 Reviewed by Mark Rowe.
224 https://bugs.webkit.org/show_bug.cgi?id=20437
226 Add a proper #define to define which XML Parser implementation to use. Client
227 code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
228 implementation is going to be used.
232 2008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca>
234 Reviewed by Maciej Stachowiak.
236 Make a Unicode non-breaking space count as a whitespace character in
237 PCRE. This change was already made in WREC, and it fixes one of the
238 Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
239 in a new set of expected test results.
241 * pcre/pcre_internal.h:
243 * tests/mozilla/expected.html:
245 2008-09-18 Stephanie Lewis <slewis@apple.com>
247 Reviewed by Mark Rowe and Maciej Stachowiak.
249 add an option use arch to specify which architecture to run.
251 * tests/mozilla/jsDriver.pl:
253 2008-09-17 Oliver Hunt <oliver@apple.com>
255 Correctly restore argument reference prior to SFX runtime calls.
257 Reviewed by Steve Falkenburg.
260 (JSC::CTI::privateCompileSlowCases):
261 (JSC::CTI::privateCompile):
263 2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
265 Reviewed by Maciej Stachowiak.
267 Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
268 <https://bugs.webkit.org/show_bug.cgi?id=20876>
270 r36417 and r36427 caused an get_by_id opcode to be emitted before the
271 instanceof and construct opcodes, in order to enable inline caching of
272 the prototype property. Unfortunately, this regressed some tests dealing
273 with exceptions thrown by 'instanceof' and the 'new' operator. We fix
274 these problems by detecting whether an "is not an object" exception is
275 thrown before op_instanceof or op_construct, and emit the proper
276 exception in those cases.
278 * VM/CodeGenerator.cpp:
279 (JSC::CodeGenerator::emitConstruct):
280 * VM/CodeGenerator.h:
281 * VM/ExceptionHelpers.cpp:
282 (JSC::createInvalidParamError):
283 (JSC::createNotAConstructorError):
284 (JSC::createNotAnObjectError):
285 * VM/ExceptionHelpers.h:
287 (JSC::Machine::getOpcode):
288 (JSC::Machine::privateExecute):
291 (JSC::NewExprNode::emitCode):
292 (JSC::InstanceOfNode::emitCode):
294 2008-09-17 Gavin Barraclough <barraclough@apple.com>
296 Reviewed by Oliver Hunt.
298 JIT generation cti_op_construct_verify.
300 Quarter to half percent progression on v8-tests.
301 Roughly not change on SunSpider (possible minor progression).
304 (JSC::CTI::privateCompileMainPass):
308 2008-09-15 Steve Falkenburg <sfalken@apple.com>
310 Improve timer accuracy for JavaScript Date object on Windows.
312 Use a combination of ftime and QueryPerformanceCounter.
313 ftime returns the information we want, but doesn't have sufficient resolution.
314 QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
315 To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
316 QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to
317 correct for drift if the low-res and high-res elapsed time between calls differs by more
318 than twice the low-resolution timer resolution.
320 QueryPerformanceCounter may be inaccurate due to a problems with:
321 - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
322 - BIOS bugs (http://support.microsoft.com/kb/895980/)
323 - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
325 Reviewed by Darin Adler.
328 (JSC::highResUpTime):
329 (JSC::lowResUTCTime):
331 (JSC::getCurrentUTCTimeWithMicroseconds):
333 2008-09-17 Gavin Barraclough <barraclough@apple.com>
335 Reviewed by Geoff Garen.
337 Implement JIT generation of CallFrame initialization, for op_call.
339 1% sunspider 2.5% v8-tests.
342 (JSC::CTI::compileOpCall):
344 (JSC::Machine::cti_op_call_JSFunction):
345 (JSC::Machine::cti_op_call_NotJSFunction):
347 2008-09-17 Gavin Barraclough <barraclough@apple.com>
349 Reviewed by Geoff Garen.
351 Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code,
352 move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
353 functions, instead of checking prior to making the call.
355 3% on v8-tests (4% on richards, 6% in delta-blue)
358 (JSC::CTI::compileOpCall):
359 (JSC::CTI::privateCompileSlowCases):
360 (JSC::CTI::privateCompile):
362 (JSC::Machine::execute):
363 (JSC::Machine::cti_op_call_JSFunction):
364 (JSC::Machine::cti_vm_compile):
365 (JSC::Machine::cti_vm_updateScopeChain):
366 (JSC::Machine::cti_op_construct_JSConstruct):
369 2008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com>
371 Fix the QtWebKit/Mac build
373 * wtf/ThreadingQt.cpp:
374 (WTF::initializeThreading): use QCoreApplication to get the main thread
376 2008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
378 Reviewed by Maciej Stachowiak.
380 Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
381 <https://bugs.webkit.org/show_bug.cgi?id=20857>
383 Fix a problem stemming from the slightly unsafe behaviour of the
384 CodeGenerator::finalDestination() method by putting the "func" argument
385 of the emitConstruct() method in a RefPtr in its caller. Also, add an
386 assertion guaranteeing that this is always the case.
388 CodeGenerator::finalDestination() is still incorrect and can cause
389 problems with a different allocator; see bug 20340 for more details.
391 * VM/CodeGenerator.cpp:
392 (JSC::CodeGenerator::emitConstruct):
394 (JSC::NewExprNode::emitCode):
396 2008-09-16 Alice Liu <alice.liu@apple.com>
401 (JSC::CTI::privateCompileMainPass):
403 2008-09-16 Gavin Barraclough <barraclough@apple.com>
405 Reviewed by Geoff Garen.
407 CTI code generation for op_ret. The majority of the work
408 (updating variables on the stack & on exec) can be performed
409 directly in generated code.
411 We still need to check, & to call out to C-code to handle
412 activation records, profiling, and full scope chains.
414 +1.5% Sunspider, +5/6% v8 tests.
417 (JSC::CTI::emitPutCTIParam):
418 (JSC::CTI::compileOpCall):
419 (JSC::CTI::privateCompileMainPass):
422 (JSC::Machine::cti_op_ret_activation):
423 (JSC::Machine::cti_op_ret_profiler):
424 (JSC::Machine::cti_op_ret_scopeChain):
427 2008-09-16 Dimitri Glazkov <dglazkov@chromium.org>
429 Fix the Windows build.
431 Add some extra parentheses to stop MSVC from complaining so much.
434 (JSC::Machine::privateExecute):
435 (JSC::Machine::cti_op_stricteq):
436 (JSC::Machine::cti_op_nstricteq):
437 * kjs/operations.cpp:
440 2008-09-15 Maciej Stachowiak <mjs@apple.com>
442 Reviewed by Cameron Zwarich.
444 - speed up the === and !== operators by choosing the fast cases better
446 No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
449 (JSC::Machine::privateExecute):
450 (JSC::Machine::cti_op_stricteq):
451 (JSC::Machine::cti_op_nstricteq):
453 (JSC::JSImmediate::areBothImmediate):
454 * kjs/operations.cpp:
456 (JSC::strictEqualSlowCase):
459 2008-09-15 Oliver Hunt <oliver@apple.com>
463 Coding style cleanup.
466 (JSC::Machine::privateExecute):
468 2008-09-15 Oliver Hunt <oliver@apple.com>
470 Reviewed by Cameron Zwarich.
472 Bug 20874: op_resolve does not do any form of caching
473 <https://bugs.webkit.org/show_bug.cgi?id=20874>
475 This patch adds an op_resolve_global opcode to handle (and cache)
476 property lookup we can statically determine must occur on the global
479 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
480 10% in math-partial-sums
483 (JSC::CTI::privateCompileMainPass):
486 (JSC::CodeBlock::dump):
487 * VM/CodeGenerator.cpp:
488 (JSC::CodeGenerator::findScopedProperty):
489 (JSC::CodeGenerator::emitResolve):
491 (JSC::resolveGlobal):
492 (JSC::Machine::privateExecute):
493 (JSC::Machine::cti_op_resolve_global):
497 2008-09-15 Sam Weinig <sam@webkit.org>
499 Roll out r36462. It broke document.all.
502 (JSC::CTI::privateCompileMainPass):
503 (JSC::CTI::privateCompileSlowCases):
506 (JSC::Machine::Machine):
507 (JSC::Machine::cti_op_eq_null):
508 (JSC::Machine::cti_op_neq_null):
510 (JSC::Machine::isJSString):
512 * kjs/JSWrapperObject.h:
513 * kjs/StringObject.h:
514 * kjs/StringObjectThatMasqueradesAsUndefined.h:
516 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
518 Reviewed by Maciej Stachowiak.
520 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
521 <https://bugs.webkit.org/show_bug.cgi?id=20863>
523 r36427 changed the number of arguments to op_construct without changing
524 the argument index for the vPC in the call to initializeCallFrame() in
525 the CTI case. This caused a JSC test failure. Correcting the argument
526 index fixes the test failure.
529 (JSC::Machine::cti_op_construct_JSConstruct):
531 2008-09-15 Mark Rowe <mrowe@apple.com>
537 2008-09-15 Geoffrey Garen <ggaren@apple.com>
539 Reviewed by Maciej Stachowiak.
541 Fixed a typo in op_get_by_id_chain that caused it to miss every time
544 Also, a little cleanup.
547 (JSC::Machine::privateExecute): Set up baseObject before entering the
548 loop, so we compare against the right values.
550 2008-09-15 Geoffrey Garen <ggaren@apple.com>
552 Reviewed by Sam Weinig.
554 Removed the CalledAsConstructor flag from the call frame header. Now,
555 we use an explicit opcode at the call site to fix up constructor results.
557 SunSpider says 0.4% faster.
559 cti_op_construct_verify is an out-of-line function call for now, but we
560 can fix that once StructureID holds type information like isObject.
563 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
566 (JSC::CodeBlock::dump):
568 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
569 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
570 (JSC::CodeGenerator::emitConstruct): ... ditto.
572 * VM/Machine.cpp: No more CalledAsConstructor
573 (JSC::Machine::privateExecute): Implementation for the new opcode.
574 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
575 called as a constructor.
576 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
579 * VM/Opcode.h: Declare new opcode.
582 (JSC::RegisterFile::): No more CalledAsConstructor
584 2008-09-15 Gavin Barraclough <barraclough@apple.com>
586 Reviewed by Geoff Garen.
588 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
589 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
590 masquerading may be handled differently (through the StructureIDs - see bug
596 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
597 (JSC::CTI::privateCompileMainPass):
598 (JSC::CTI::privateCompileSlowCases):
601 (JSC::Machine::Machine):
602 (JSC::Machine::cti_op_eq_null):
603 (JSC::Machine::cti_op_neq_null):
605 (JSC::Machine::doesMasqueradesAsUndefined):
606 * kjs/JSWrapperObject.h:
607 (JSC::JSWrapperObject::):
608 (JSC::JSWrapperObject::JSWrapperObject):
609 * kjs/StringObject.h:
610 (JSC::StringObject::StringObject):
611 * kjs/StringObjectThatMasqueradesAsUndefined.h:
612 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
614 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
616 Rubber-stamped by Oliver Hunt.
618 r36427 broke CodeBlock::dump() by changing the number of arguments to
619 op_construct without changing the code that prints it. This patch fixes
620 it by printing the additional argument.
622 * JavaScriptCore.xcodeproj/project.pbxproj:
624 (JSC::CodeBlock::dump):
626 2008-09-15 Adam Roben <aroben@apple.com>
630 * kjs/StructureID.cpp: Removed a stray semicolon.
632 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
634 Reviewed by Maciej Stachowiak.
636 Fix a crash in fast/js/exception-expression-offset.html caused by not
637 updating all mentions of the length of op_construct in r36427.
640 (JSC::Machine::cti_op_construct_NotJSConstruct):
642 2008-09-15 Maciej Stachowiak <mjs@apple.com>
644 Reviewed by Cameron Zwarich.
646 - fix layout test failure introduced by fix for 20849
648 (The failing test was fast/js/delete-then-put.html)
651 (JSC::JSObject::removeDirect): Clear enumeration cache
652 in the dictionary case.
654 (JSC::JSObject::putDirect): Ditto.
656 (JSC::StructureID::clearEnumerationCache): Inline to handle the
659 2008-09-15 Maciej Stachowiak <mjs@apple.com>
661 Reviewed by Cameron Zwarich.
663 - fix JSC test failures introduced by fix for 20849
665 * kjs/PropertyMap.cpp:
666 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
668 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
670 Reviewed by Maciej Stachowiak.
672 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
673 <https://bugs.webkit.org/show_bug.cgi?id=20851>
675 r36410 introduced an optimization for parseInt() that is incorrect when
676 its argument is larger than the range of a 32-bit integer. If the
677 argument is a number that is not an immediate integer, then the correct
678 behaviour is to return the floor of its value, unless it is an infinite
679 value, in which case the correct behaviour is to return 0.
681 * kjs/JSGlobalObjectFunctions.cpp:
682 (JSC::globalFuncParseInt):
684 2008-09-15 Sam Weinig <sam@webkit.org>
686 Reviewed by Maciej Stachowiak.
688 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
689 Cache property names for getEnumerablePropertyNames in the StructureID.
691 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
692 on the v8 test suite.
695 (JSC::JSObject::getPropertyNames):
696 * kjs/PropertyMap.cpp:
697 (JSC::PropertyMap::getEnumerablePropertyNames):
699 * kjs/StructureID.cpp:
700 (JSC::StructureID::StructureID):
701 (JSC::StructureID::getEnumerablePropertyNames):
704 2008-09-14 Maciej Stachowiak <mjs@apple.com>
706 Reviewed by Cameron Zwarich.
708 - speed up JS construction by extracting "prototype" lookup so PIC applies.
710 ~0.5% speedup on SunSpider
711 Speeds up some of the V8 tests as well, most notably earley-boyer.
714 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
715 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
716 * VM/CodeGenerator.cpp:
717 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
719 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
720 (JSC::Machine::cti_op_construct_JSConstruct): ditto
721 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
723 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
725 Reviewed by Eric Seidel.
727 Add a protected destructor for RefCounted.
729 It is wrong to call its destructor directly, because (1) this should be taken care of by
730 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
732 No change in behavior.
734 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
736 2008-09-14 Gavin Barraclough <barraclough@apple.com>
738 Reviewed by Sam Weinig.
740 Accelerated property accesses.
742 Inline more of the array access code into the JIT code for get/put_by_val.
743 Accelerate get/put_by_id by speculatively inlining a disable direct access
744 into the hot path of the code, and repatch this with the correct StructureID
745 and property map offset once these are known. In the case of accesses to the
746 prototype and reading the array-length a trampoline is genertaed, and the
747 branch to the slow-case is relinked to jump to this.
749 By repatching, we mean rewriting the x86 instruction stream. Instructions are
750 only modified in a simple fasion - altering immediate operands, memory access
751 deisplacements, and branch offsets.
753 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
754 instruction's immediate operant is updateded, and a memory access operation's
755 displacement is updated to access the correct field on the object. In the case
756 of more complex accesses (array length and get_by_id_prototype) the offset on
757 the branch to slow-case is updated, to now jump to a trampoline.
759 +2.8% sunspider, +13% v8-tests
762 (JSC::CTI::emitCall):
763 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
765 (JSC::CTI::privateCompileMainPass):
766 (JSC::CTI::privateCompileSlowCases):
767 (JSC::CTI::privateCompile):
768 (JSC::CTI::privateCompileGetByIdSelf):
769 (JSC::CTI::privateCompileGetByIdProto):
770 (JSC::CTI::privateCompileGetByIdChain):
771 (JSC::CTI::privateCompilePutByIdReplace):
772 (JSC::CTI::privateCompilePutByIdTransition):
773 (JSC::CTI::privateCompileArrayLengthTrampoline):
774 (JSC::CTI::privateCompileStringLengthTrampoline):
775 (JSC::CTI::patchGetByIdSelf):
776 (JSC::CTI::patchPutByIdReplace):
777 (JSC::CTI::privateCompilePatchGetArrayLength):
778 (JSC::CTI::privateCompilePatchGetStringLength):
780 (JSC::CTI::compileGetByIdSelf):
781 (JSC::CTI::compileGetByIdProto):
782 (JSC::CTI::compileGetByIdChain):
783 (JSC::CTI::compilePutByIdReplace):
784 (JSC::CTI::compilePutByIdTransition):
785 (JSC::CTI::compileArrayLengthTrampoline):
786 (JSC::CTI::compileStringLengthTrampoline):
787 (JSC::CTI::compilePatchGetArrayLength):
788 (JSC::CTI::compilePatchGetStringLength):
790 (JSC::CodeBlock::dump):
791 (JSC::CodeBlock::~CodeBlock):
793 (JSC::StructureStubInfo::StructureStubInfo):
794 (JSC::CodeBlock::getStubInfo):
796 (JSC::Machine::tryCTICachePutByID):
797 (JSC::Machine::tryCTICacheGetByID):
798 (JSC::Machine::cti_op_put_by_val_array):
800 * masm/X86Assembler.h:
801 (JSC::X86Assembler::):
802 (JSC::X86Assembler::cmpl_i8m):
803 (JSC::X86Assembler::emitUnlinkedJa):
804 (JSC::X86Assembler::getRelocatedAddress):
805 (JSC::X86Assembler::getDifferenceBetweenLabels):
806 (JSC::X86Assembler::emitModRm_opmsib):
808 2008-09-14 Maciej Stachowiak <mjs@apple.com>
810 Reviewed by Cameron Zwarich.
812 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
814 ~5% speedup on v8 earley-boyer test
816 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
817 * API/JSCallbackObjectFunctions.h:
818 (JSC::::hasInstance): Ditto.
819 * API/JSValueRef.cpp:
820 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
821 * JavaScriptCore.exp:
823 (JSC::CTI::privateCompileMainPass): Pass along prototype.
825 (JSC::CodeBlock::dump): Print third arg.
826 * VM/CodeGenerator.cpp:
827 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
829 * VM/CodeGenerator.h:
831 (JSC::Machine::privateExecute): Pass along the prototype.
832 (JSC::Machine::cti_op_instanceof): ditto
834 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
837 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
838 property and pass that register to instanceof.
841 2008-09-14 Gavin Barraclough <barraclough@apple.com>
843 Reviewed by Sam Weinig.
845 Remove unnecessary virtual function call from cti_op_call_JSFunction -
846 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
849 (JSC::Machine::cti_op_call_JSFunction):
851 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
853 Reviewed by Maciej Stachowiak.
855 Bug 20827: the 'typeof' operator is slow
856 <https://bugs.webkit.org/show_bug.cgi?id=20827>
858 Optimize the 'typeof' operator when its result is compared to a constant
861 This is a 5.5% speedup on the V8 Earley-Boyer test.
864 (JSC::CTI::privateCompileMainPass):
866 (JSC::CodeBlock::dump):
867 * VM/CodeGenerator.cpp:
868 (JSC::CodeGenerator::emitEqualityOp):
869 * VM/CodeGenerator.h:
871 (JSC::jsIsObjectType):
872 (JSC::jsIsFunctionType):
873 (JSC::Machine::privateExecute):
874 (JSC::Machine::cti_op_is_undefined):
875 (JSC::Machine::cti_op_is_boolean):
876 (JSC::Machine::cti_op_is_number):
877 (JSC::Machine::cti_op_is_string):
878 (JSC::Machine::cti_op_is_object):
879 (JSC::Machine::cti_op_is_function):
883 (JSC::BinaryOpNode::emitCode):
884 (JSC::EqualNode::emitCode):
885 (JSC::StrictEqualNode::emitCode):
888 2008-09-14 Sam Weinig <sam@webkit.org>
890 Reviewed by Cameron Zwarich.
892 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
893 Speed up parseInt for numbers
895 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
896 No change on the v8 suite.
898 * kjs/JSGlobalObjectFunctions.cpp:
899 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
900 convert them back to numbers.
902 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
904 Reviewed by Oliver Hunt.
906 Bug 20816: op_lesseq should be optimized
907 <https://bugs.webkit.org/show_bug.cgi?id=20816>
909 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
911 This is a 9.4% speedup on the V8 Crypto benchmark.
914 (JSC::CTI::privateCompileMainPass):
915 (JSC::CTI::privateCompileSlowCases):
917 (JSC::CodeBlock::dump):
918 * VM/CodeGenerator.cpp:
919 (JSC::CodeGenerator::emitJumpIfTrue):
921 (JSC::Machine::privateExecute):
922 (JSC::Machine::cti_op_loop_if_lesseq):
926 2008-09-14 Sam Weinig <sam@webkit.org>
928 Reviewed by Cameron Zwarich.
930 Cleanup Sampling code.
933 (JSC::CTI::emitCall):
934 (JSC::CTI::privateCompileMainPass):
937 * VM/SamplingTool.cpp:
939 (JSC::SamplingTool::run):
940 (JSC::SamplingTool::dump):
942 (JSC::SamplingTool::callingHostFunction):
944 2008-09-13 Oliver Hunt <oliver@apple.com>
946 Reviewed by Cameron Zwarich.
948 Bug 20821: Cache property transitions to speed up object initialization
949 https://bugs.webkit.org/show_bug.cgi?id=20821
951 Implement a transition cache to improve the performance of new properties
952 being added to objects. This is extremely beneficial in constructors and
953 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
957 (JSC::CTI::privateCompileMainPass):
959 (JSC::transitionWillNeedStorageRealloc):
960 (JSC::CTI::privateCompilePutByIdTransition):
962 (JSC::CTI::compilePutByIdTransition):
964 (JSC::printPutByIdOp):
965 (JSC::CodeBlock::printStructureIDs):
966 (JSC::CodeBlock::dump):
967 (JSC::CodeBlock::derefStructureIDs):
968 (JSC::CodeBlock::refStructureIDs):
969 * VM/CodeGenerator.cpp:
970 (JSC::CodeGenerator::emitPutById):
972 (JSC::cachePrototypeChain):
973 (JSC::Machine::tryCachePutByID):
974 (JSC::Machine::tryCacheGetByID):
975 (JSC::Machine::privateExecute):
976 (JSC::Machine::tryCTICachePutByID):
977 (JSC::Machine::tryCTICacheGetByID):
981 (JSC::JSObject::putDirect):
982 (JSC::JSObject::transitionTo):
983 * kjs/PutPropertySlot.h:
984 (JSC::PutPropertySlot::PutPropertySlot):
985 (JSC::PutPropertySlot::wasTransition):
986 (JSC::PutPropertySlot::setWasTransition):
987 * kjs/StructureID.cpp:
988 (JSC::StructureID::transitionTo):
989 (JSC::StructureIDChain::StructureIDChain):
991 (JSC::StructureID::previousID):
992 (JSC::StructureID::setCachedPrototypeChain):
993 (JSC::StructureID::cachedPrototypeChain):
994 (JSC::StructureID::propertyMap):
995 * masm/X86Assembler.h:
996 (JSC::X86Assembler::addl_i8m):
997 (JSC::X86Assembler::subl_i8m):
999 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1001 Reviewed by Maciej Stachowiak.
1003 Bug 20819: JSValue::isObject() is slow
1004 <https://bugs.webkit.org/show_bug.cgi?id=20819>
1006 Optimize JSCell::isObject() and JSCell::isString() by making them
1007 non-virtual calls that rely on the StructureID type information.
1009 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
1012 * JavaScriptCore.exp:
1015 (JSC::JSCell::isObject):
1016 (JSC::JSCell::isString):
1021 (JSC::JSString::JSString):
1022 * kjs/StructureID.h:
1023 (JSC::StructureID::type):
1025 2008-09-11 Stephanie Lewis <slewis@apple.com>
1027 Reviewed by Oliver Hunt.
1029 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
1030 crash on CNN and on Dromaeo.
1031 Fix Missing close tag in vcproj.
1033 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1035 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1039 Correct an SVN problem with the last commit and actually add the new
1042 * wrec/CharacterClassConstructor.cpp: Added.
1044 (JSC::getCharacterClassNewline):
1045 (JSC::getCharacterClassDigits):
1046 (JSC::getCharacterClassSpaces):
1047 (JSC::getCharacterClassWordchar):
1048 (JSC::getCharacterClassNondigits):
1049 (JSC::getCharacterClassNonspaces):
1050 (JSC::getCharacterClassNonwordchar):
1051 (JSC::CharacterClassConstructor::addSorted):
1052 (JSC::CharacterClassConstructor::addSortedRange):
1053 (JSC::CharacterClassConstructor::put):
1054 (JSC::CharacterClassConstructor::flush):
1055 (JSC::CharacterClassConstructor::append):
1056 * wrec/CharacterClassConstructor.h: Added.
1057 (JSC::CharacterClassConstructor::CharacterClassConstructor):
1058 (JSC::CharacterClassConstructor::isUpsideDown):
1059 (JSC::CharacterClassConstructor::charClass):
1061 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1063 Reviewed by Maciej Stachowiak.
1065 Bug 20788: Split CharacterClassConstructor into its own file
1066 <https://bugs.webkit.org/show_bug.cgi?id=20788>
1068 Split CharacterClassConstructor into its own file and clean up some
1071 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1072 * JavaScriptCore.xcodeproj/project.pbxproj:
1073 * wrec/CharacterClassConstructor.cpp: Added.
1075 (JSC::getCharacterClassNewline):
1076 (JSC::getCharacterClassDigits):
1077 (JSC::getCharacterClassSpaces):
1078 (JSC::getCharacterClassWordchar):
1079 (JSC::getCharacterClassNondigits):
1080 (JSC::getCharacterClassNonspaces):
1081 (JSC::getCharacterClassNonwordchar):
1082 (JSC::CharacterClassConstructor::addSorted):
1083 (JSC::CharacterClassConstructor::addSortedRange):
1084 (JSC::CharacterClassConstructor::put):
1085 (JSC::CharacterClassConstructor::flush):
1086 (JSC::CharacterClassConstructor::append):
1087 * wrec/CharacterClassConstructor.h: Added.
1088 (JSC::CharacterClassConstructor::CharacterClassConstructor):
1089 (JSC::CharacterClassConstructor::isUpsideDown):
1090 (JSC::CharacterClassConstructor::charClass):
1092 (JSC::WRECParser::parseCharacterClass):
1094 2008-09-10 Simon Hausmann <hausmann@webkit.org>
1096 Not reviewed but trivial one-liner for yet unused macro.
1098 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
1100 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
1104 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1106 Rubber-stamped by Oliver Hunt.
1108 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
1112 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
1113 * masm/X86Assembler.h:
1114 (JSC::X86Assembler::orl_i32r):
1116 (JSC::WRECGenerator::generatePatternCharacter):
1117 (JSC::WRECGenerator::generateCharacterClassInverted):
1119 2008-09-10 Sam Weinig <sam@webkit.org>
1121 Reviewed by Geoff Garen.
1123 Add inline property storage for JSObject.
1125 1.2% progression on Sunspider. .5% progression on the v8 test suite.
1127 * JavaScriptCore.exp:
1129 (JSC::CTI::privateCompileGetByIdProto):
1130 (JSC::CTI::privateCompileGetByIdChain):
1132 (JSC::JSObject::mark): There is no reason to check storageSize now that
1134 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
1136 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
1137 now so there is no reason to .get()
1138 (JSC::JSObject::usingInlineStorage):
1139 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
1141 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
1143 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
1144 we know that we are about to add a property that will overflow the inline
1146 * kjs/PropertyMap.cpp:
1147 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
1148 now handled by JSObject.
1149 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
1150 * kjs/PropertyMap.h:
1151 (JSC::PropertyMap::storageSize): Rename from markingCount.
1152 * kjs/StructureID.cpp:
1153 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
1154 if we are using inline storage.
1155 * kjs/StructureID.h:
1157 2008-09-10 Oliver Hunt <oliver@apple.com>
1159 Reviewed by Geoff Garen.
1161 Inline immediate number version of op_mul.
1163 Renamed mull_rr to imull_rr as that's what it's
1164 actually doing, and added imull_i32r for the constant
1165 case immediate multiply.
1167 1.1% improvement to SunSpider.
1170 (JSC::CTI::privateCompileMainPass):
1171 (JSC::CTI::privateCompileSlowCases):
1172 * masm/X86Assembler.h:
1173 (JSC::X86Assembler::):
1174 (JSC::X86Assembler::imull_rr):
1175 (JSC::X86Assembler::imull_i32r):
1177 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1183 * JavaScriptCore.xcodeproj/project.pbxproj:
1185 2008-09-09 Oliver Hunt <oliver@apple.com>
1187 Reviewed by Maciej Stachowiak.
1189 Add optimised access to known properties on the global object.
1191 Improve cross scope access to the global object by emitting
1192 code to access it directly rather than by walking the scope chain.
1194 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
1197 (JSC::CTI::privateCompileMainPass):
1198 (JSC::CTI::emitGetVariableObjectRegister):
1199 (JSC::CTI::emitPutVariableObjectRegister):
1202 (JSC::CodeBlock::dump):
1203 * VM/CodeGenerator.cpp:
1204 (JSC::CodeGenerator::findScopedProperty):
1205 (JSC::CodeGenerator::emitResolve):
1206 (JSC::CodeGenerator::emitGetScopedVar):
1207 (JSC::CodeGenerator::emitPutScopedVar):
1208 * VM/CodeGenerator.h:
1210 (JSC::Machine::privateExecute):
1213 (JSC::FunctionCallResolveNode::emitCode):
1214 (JSC::PostfixResolveNode::emitCode):
1215 (JSC::PrefixResolveNode::emitCode):
1216 (JSC::ReadModifyResolveNode::emitCode):
1217 (JSC::AssignResolveNode::emitCode):
1219 2008-09-10 Maciej Stachowiak <mjs@apple.com>
1223 - enable polymorphic inline caching of properties of primitives
1225 1.012x speedup on SunSpider.
1227 We create special structure IDs for JSString and
1228 JSNumberCell. Unlike normal structure IDs, these cannot hold the
1229 true prototype. Due to JS autoboxing semantics, the prototype used
1230 when looking up string or number properties depends on the lexical
1231 global object of the call site, not the creation site. Thus we
1232 enable StructureIDs to handle this quirk for primitives.
1234 Everything else should be straightforward.
1237 (JSC::CTI::privateCompileGetByIdProto):
1238 (JSC::CTI::privateCompileGetByIdChain):
1240 (JSC::CTI::compileGetByIdProto):
1241 (JSC::CTI::compileGetByIdChain):
1242 * VM/JSPropertyNameIterator.h:
1243 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
1245 (JSC::Machine::Machine):
1246 (JSC::cachePrototypeChain):
1247 (JSC::Machine::tryCachePutByID):
1248 (JSC::Machine::tryCacheGetByID):
1249 (JSC::Machine::privateExecute):
1250 (JSC::Machine::tryCTICachePutByID):
1251 (JSC::Machine::tryCTICacheGetByID):
1252 * kjs/GetterSetter.h:
1253 (JSC::GetterSetter::GetterSetter):
1255 * kjs/JSGlobalData.cpp:
1256 (JSC::JSGlobalData::JSGlobalData):
1257 * kjs/JSGlobalData.h:
1258 * kjs/JSGlobalObject.h:
1259 (JSC::StructureID::prototypeForLookup):
1260 * kjs/JSNumberCell.h:
1261 (JSC::JSNumberCell::JSNumberCell):
1262 (JSC::jsNumberCell):
1264 (JSC::JSObject::prototype):
1268 (JSC::jsOwnedString):
1270 (JSC::JSString::JSString):
1272 (JSC::jsSingleCharacterString):
1273 (JSC::jsSingleCharacterSubstring):
1274 (JSC::jsNontrivialString):
1275 * kjs/SmallStrings.cpp:
1276 (JSC::SmallStrings::createEmptyString):
1277 (JSC::SmallStrings::createSingleCharacterString):
1278 * kjs/StructureID.cpp:
1279 (JSC::StructureID::StructureID):
1280 (JSC::StructureID::addPropertyTransition):
1281 (JSC::StructureID::getterSetterTransition):
1282 (JSC::StructureIDChain::StructureIDChain):
1283 * kjs/StructureID.h:
1284 (JSC::StructureID::create):
1285 (JSC::StructureID::storedPrototype):
1287 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
1289 Reviewed by Sam Weinig.
1291 https://bugs.webkit.org/show_bug.cgi?id=20746
1293 Added WINCE platform macro.
1297 2008-09-09 Sam Weinig <sam@webkit.org>
1299 Reviewed by Mark Rowe.
1301 Remove unnecessary override of getOffset.
1303 Sunspider reports this as a .6% progression.
1305 * JavaScriptCore.exp:
1307 (JSC::JSObject::getDirectLocation):
1308 (JSC::JSObject::getOwnPropertySlotForWrite):
1309 (JSC::JSObject::putDirect):
1310 * kjs/PropertyMap.cpp:
1311 * kjs/PropertyMap.h:
1313 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1315 Reviewed by Maciej Stachowiak.
1317 Bug 20759: Remove MacroAssembler
1318 <https://bugs.webkit.org/show_bug.cgi?id=20759>
1320 Remove MacroAssembler and move its functionality to X86Assembler.
1322 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1323 * JavaScriptCore.xcodeproj/project.pbxproj:
1325 (JSC::CTI::emitGetArg):
1326 (JSC::CTI::emitGetPutArg):
1327 (JSC::CTI::emitPutArg):
1328 (JSC::CTI::emitPutCTIParam):
1329 (JSC::CTI::emitGetCTIParam):
1330 (JSC::CTI::emitPutToCallFrameHeader):
1331 (JSC::CTI::emitGetFromCallFrameHeader):
1332 (JSC::CTI::emitPutResult):
1333 (JSC::CTI::emitDebugExceptionCheck):
1334 (JSC::CTI::emitJumpSlowCaseIfNotImm):
1335 (JSC::CTI::emitJumpSlowCaseIfNotImms):
1336 (JSC::CTI::emitFastArithDeTagImmediate):
1337 (JSC::CTI::emitFastArithReTagImmediate):
1338 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
1339 (JSC::CTI::emitFastArithImmToInt):
1340 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
1341 (JSC::CTI::emitFastArithIntToImmNoCheck):
1342 (JSC::CTI::compileOpCall):
1343 (JSC::CTI::emitSlowScriptCheck):
1344 (JSC::CTI::privateCompileMainPass):
1345 (JSC::CTI::privateCompileSlowCases):
1346 (JSC::CTI::privateCompile):
1347 (JSC::CTI::privateCompileGetByIdSelf):
1348 (JSC::CTI::privateCompileGetByIdProto):
1349 (JSC::CTI::privateCompileGetByIdChain):
1350 (JSC::CTI::privateCompilePutByIdReplace):
1351 (JSC::CTI::privateArrayLengthTrampoline):
1352 (JSC::CTI::privateStringLengthTrampoline):
1353 (JSC::CTI::compileRegExp):
1355 (JSC::CallRecord::CallRecord):
1356 (JSC::JmpTable::JmpTable):
1357 (JSC::SlowCaseEntry::SlowCaseEntry):
1358 (JSC::CTI::JSRInfo::JSRInfo):
1359 * masm/MacroAssembler.h: Removed.
1360 * masm/MacroAssemblerWin.cpp: Removed.
1361 * masm/X86Assembler.h:
1362 (JSC::X86Assembler::emitConvertToFastCall):
1363 (JSC::X86Assembler::emitRestoreArgumentReference):
1365 (JSC::WRECGenerator::WRECGenerator):
1366 (JSC::WRECParser::WRECParser):
1368 2008-09-09 Sam Weinig <sam@webkit.org>
1370 Reviewed by Cameron Zwarich.
1372 Don't waste the first item in the PropertyStorage.
1374 - Fix typo (makingCount -> markingCount)
1375 - Remove undefined method declaration.
1377 No change on Sunspider.
1380 (JSC::JSObject::mark):
1381 * kjs/PropertyMap.cpp:
1382 (JSC::PropertyMap::put):
1383 (JSC::PropertyMap::remove):
1384 (JSC::PropertyMap::getOffset):
1385 (JSC::PropertyMap::insert):
1386 (JSC::PropertyMap::rehash):
1387 (JSC::PropertyMap::resizePropertyStorage):
1388 (JSC::PropertyMap::checkConsistency):
1389 * kjs/PropertyMap.h:
1390 (JSC::PropertyMap::markingCount): Fix typo.
1392 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1396 Speculative Windows build fix.
1398 * masm/MacroAssemblerWin.cpp:
1399 (JSC::MacroAssembler::emitConvertToFastCall):
1400 (JSC::MacroAssembler::emitRestoreArgumentReference):
1402 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1404 Reviewed by Maciej Stachowiak.
1406 Bug 20755: Create an X86 namespace for register names and other things
1407 <https://bugs.webkit.org/show_bug.cgi?id=20755>
1409 Create an X86 namespace to put X86 register names. Perhaps I will move
1410 opcode names here later as well.
1413 (JSC::CTI::emitGetArg):
1414 (JSC::CTI::emitGetPutArg):
1415 (JSC::CTI::emitPutArg):
1416 (JSC::CTI::emitPutArgConstant):
1417 (JSC::CTI::emitPutCTIParam):
1418 (JSC::CTI::emitGetCTIParam):
1419 (JSC::CTI::emitPutToCallFrameHeader):
1420 (JSC::CTI::emitGetFromCallFrameHeader):
1421 (JSC::CTI::emitPutResult):
1422 (JSC::CTI::emitDebugExceptionCheck):
1423 (JSC::CTI::emitJumpSlowCaseIfNotImms):
1424 (JSC::CTI::compileOpCall):
1425 (JSC::CTI::emitSlowScriptCheck):
1426 (JSC::CTI::privateCompileMainPass):
1427 (JSC::CTI::privateCompileSlowCases):
1428 (JSC::CTI::privateCompile):
1429 (JSC::CTI::privateCompileGetByIdSelf):
1430 (JSC::CTI::privateCompileGetByIdProto):
1431 (JSC::CTI::privateCompileGetByIdChain):
1432 (JSC::CTI::privateCompilePutByIdReplace):
1433 (JSC::CTI::privateArrayLengthTrampoline):
1434 (JSC::CTI::privateStringLengthTrampoline):
1435 (JSC::CTI::compileRegExp):
1437 * masm/X86Assembler.h:
1439 (JSC::X86Assembler::emitModRm_rm):
1440 (JSC::X86Assembler::emitModRm_rm_Unchecked):
1441 (JSC::X86Assembler::emitModRm_rmsib):
1443 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1444 (JSC::WRECGenerator::generateGreedyQuantifier):
1445 (JSC::WRECGenerator::generateParentheses):
1446 (JSC::WRECGenerator::generateBackreference):
1447 (JSC::WRECGenerator::gernerateDisjunction):
1450 2008-09-09 Sam Weinig <sam@webkit.org>
1452 Reviewed by Geoffrey Garen.
1454 Remove unnecessary friend declaration.
1456 * kjs/PropertyMap.h:
1458 2008-09-09 Sam Weinig <sam@webkit.org>
1460 Reviewed by Geoffrey Garen.
1462 Replace uses of PropertyMap::get and PropertyMap::getLocation with
1463 PropertyMap::getOffset.
1465 Sunspider reports this as a .6% improvement.
1467 * JavaScriptCore.exp:
1469 (JSC::JSObject::put):
1470 (JSC::JSObject::deleteProperty):
1471 (JSC::JSObject::getPropertyAttributes):
1473 (JSC::JSObject::getDirect):
1474 (JSC::JSObject::getDirectLocation):
1475 (JSC::JSObject::locationForOffset):
1476 * kjs/PropertyMap.cpp:
1477 (JSC::PropertyMap::remove):
1478 (JSC::PropertyMap::getOffset):
1479 * kjs/PropertyMap.h:
1481 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1483 Reviewed by Sam Weinig.
1485 Bug 20754: Remove emit prefix from assembler opcode methods
1486 <https://bugs.webkit.org/show_bug.cgi?id=20754>
1489 (JSC::CTI::emitGetArg):
1490 (JSC::CTI::emitGetPutArg):
1491 (JSC::CTI::emitPutArg):
1492 (JSC::CTI::emitPutArgConstant):
1493 (JSC::CTI::emitPutCTIParam):
1494 (JSC::CTI::emitGetCTIParam):
1495 (JSC::CTI::emitPutToCallFrameHeader):
1496 (JSC::CTI::emitGetFromCallFrameHeader):
1497 (JSC::CTI::emitPutResult):
1498 (JSC::CTI::emitDebugExceptionCheck):
1499 (JSC::CTI::emitCall):
1500 (JSC::CTI::emitJumpSlowCaseIfNotImm):
1501 (JSC::CTI::emitJumpSlowCaseIfNotImms):
1502 (JSC::CTI::emitFastArithDeTagImmediate):
1503 (JSC::CTI::emitFastArithReTagImmediate):
1504 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
1505 (JSC::CTI::emitFastArithImmToInt):
1506 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
1507 (JSC::CTI::emitFastArithIntToImmNoCheck):
1508 (JSC::CTI::compileOpCall):
1509 (JSC::CTI::emitSlowScriptCheck):
1510 (JSC::CTI::privateCompileMainPass):
1511 (JSC::CTI::privateCompileSlowCases):
1512 (JSC::CTI::privateCompile):
1513 (JSC::CTI::privateCompileGetByIdSelf):
1514 (JSC::CTI::privateCompileGetByIdProto):
1515 (JSC::CTI::privateCompileGetByIdChain):
1516 (JSC::CTI::privateCompilePutByIdReplace):
1517 (JSC::CTI::privateArrayLengthTrampoline):
1518 (JSC::CTI::privateStringLengthTrampoline):
1519 (JSC::CTI::compileRegExp):
1520 * masm/MacroAssemblerWin.cpp:
1521 (JSC::MacroAssembler::emitConvertToFastCall):
1522 (JSC::MacroAssembler::emitRestoreArgumentReference):
1523 * masm/X86Assembler.h:
1524 (JSC::X86Assembler::pushl_r):
1525 (JSC::X86Assembler::pushl_m):
1526 (JSC::X86Assembler::popl_r):
1527 (JSC::X86Assembler::popl_m):
1528 (JSC::X86Assembler::movl_rr):
1529 (JSC::X86Assembler::addl_rr):
1530 (JSC::X86Assembler::addl_i8r):
1531 (JSC::X86Assembler::addl_i32r):
1532 (JSC::X86Assembler::addl_mr):
1533 (JSC::X86Assembler::andl_rr):
1534 (JSC::X86Assembler::andl_i32r):
1535 (JSC::X86Assembler::cmpl_i8r):
1536 (JSC::X86Assembler::cmpl_rr):
1537 (JSC::X86Assembler::cmpl_rm):
1538 (JSC::X86Assembler::cmpl_i32r):
1539 (JSC::X86Assembler::cmpl_i32m):
1540 (JSC::X86Assembler::cmpw_rm):
1541 (JSC::X86Assembler::orl_rr):
1542 (JSC::X86Assembler::subl_rr):
1543 (JSC::X86Assembler::subl_i8r):
1544 (JSC::X86Assembler::subl_i32r):
1545 (JSC::X86Assembler::subl_mr):
1546 (JSC::X86Assembler::testl_i32r):
1547 (JSC::X86Assembler::testl_rr):
1548 (JSC::X86Assembler::xorl_i8r):
1549 (JSC::X86Assembler::xorl_rr):
1550 (JSC::X86Assembler::sarl_i8r):
1551 (JSC::X86Assembler::sarl_CLr):
1552 (JSC::X86Assembler::shl_i8r):
1553 (JSC::X86Assembler::shll_CLr):
1554 (JSC::X86Assembler::mull_rr):
1555 (JSC::X86Assembler::idivl_r):
1556 (JSC::X86Assembler::cdq):
1557 (JSC::X86Assembler::movl_mr):
1558 (JSC::X86Assembler::movzwl_mr):
1559 (JSC::X86Assembler::movl_rm):
1560 (JSC::X86Assembler::movl_i32r):
1561 (JSC::X86Assembler::movl_i32m):
1562 (JSC::X86Assembler::leal_mr):
1563 (JSC::X86Assembler::ret):
1564 (JSC::X86Assembler::jmp_r):
1565 (JSC::X86Assembler::jmp_m):
1566 (JSC::X86Assembler::call_r):
1568 (JSC::WRECGenerator::generateBacktrack1):
1569 (JSC::WRECGenerator::generateBacktrackBackreference):
1570 (JSC::WRECGenerator::generateBackreferenceQuantifier):
1571 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1572 (JSC::WRECGenerator::generateGreedyQuantifier):
1573 (JSC::WRECGenerator::generatePatternCharacter):
1574 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
1575 (JSC::WRECGenerator::generateCharacterClassInverted):
1576 (JSC::WRECGenerator::generateCharacterClass):
1577 (JSC::WRECGenerator::generateParentheses):
1578 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
1579 (JSC::WRECGenerator::generateAssertionBOL):
1580 (JSC::WRECGenerator::generateAssertionEOL):
1581 (JSC::WRECGenerator::generateAssertionWordBoundary):
1582 (JSC::WRECGenerator::generateBackreference):
1583 (JSC::WRECGenerator::gernerateDisjunction):
1585 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1587 Reviewed by Maciej Stachowiak.
1589 Clean up the WREC code some more.
1592 (JSC::CTI::compileRegExp):
1594 (JSC::getCharacterClassNewline):
1595 (JSC::getCharacterClassDigits):
1596 (JSC::getCharacterClassSpaces):
1597 (JSC::getCharacterClassWordchar):
1598 (JSC::getCharacterClassNondigits):
1599 (JSC::getCharacterClassNonspaces):
1600 (JSC::getCharacterClassNonwordchar):
1601 (JSC::WRECGenerator::generateBacktrack1):
1602 (JSC::WRECGenerator::generateBacktrackBackreference):
1603 (JSC::WRECGenerator::generateBackreferenceQuantifier):
1604 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1605 (JSC::WRECGenerator::generateGreedyQuantifier):
1606 (JSC::WRECGenerator::generatePatternCharacter):
1607 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
1608 (JSC::WRECGenerator::generateCharacterClassInverted):
1609 (JSC::WRECGenerator::generateCharacterClass):
1610 (JSC::WRECGenerator::generateParentheses):
1611 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
1612 (JSC::WRECGenerator::generateAssertionBOL):
1613 (JSC::WRECGenerator::generateAssertionEOL):
1614 (JSC::WRECGenerator::generateAssertionWordBoundary):
1615 (JSC::WRECGenerator::generateBackreference):
1616 (JSC::WRECGenerator::gernerateDisjunction):
1617 (JSC::WRECParser::parseCharacterClass):
1618 (JSC::WRECParser::parseEscape):
1619 (JSC::WRECParser::parseTerm):
1622 2008-09-09 Mark Rowe <mrowe@apple.com>
1624 Build fix, rubber-stamped by Anders Carlsson.
1626 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
1628 * JavaScriptCore.xcodeproj/project.pbxproj:
1630 2008-09-09 Mark Rowe <mrowe@apple.com>
1632 Rubber-stamped by Oliver Hunt.
1634 Fix builds using the "debug" variant.
1636 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
1637 and Release configurations.
1639 * Configurations/JavaScriptCore.xcconfig:
1640 * DerivedSources.make:
1641 * JavaScriptCore.Debug.exp: Removed.
1642 * JavaScriptCore.base.exp: Removed.
1643 * JavaScriptCore.exp: Added.
1644 * JavaScriptCore.xcodeproj/project.pbxproj:
1645 * kjs/identifier.cpp:
1646 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
1647 there is no overhead in Release builds.
1648 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
1650 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
1651 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
1653 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1655 Reviewed by Maciej Stachowiak.
1657 Clean up WREC a bit to bring it closer to our coding style guidelines.
1661 (JSC::getCharacterClass_newline):
1662 (JSC::getCharacterClass_d):
1663 (JSC::getCharacterClass_s):
1664 (JSC::getCharacterClass_w):
1665 (JSC::getCharacterClass_D):
1666 (JSC::getCharacterClass_S):
1667 (JSC::getCharacterClass_W):
1668 (JSC::CharacterClassConstructor::append):
1669 (JSC::WRECGenerator::generateNonGreedyQuantifier):
1670 (JSC::WRECGenerator::generateGreedyQuantifier):
1671 (JSC::WRECGenerator::generateCharacterClassInverted):
1672 (JSC::WRECParser::parseQuantifier):
1673 (JSC::WRECParser::parsePatternCharacterQualifier):
1674 (JSC::WRECParser::parseCharacterClassQuantifier):
1675 (JSC::WRECParser::parseBackreferenceQuantifier):
1677 (JSC::Quantifier::):
1678 (JSC::Quantifier::Quantifier):
1680 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
1682 Reviewed by Alexey Proskuryakov.
1684 Try MIME charset names before trying IANA names
1685 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
1687 * wtf/StringExtras.h: (strcasecmp): Added.
1689 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1691 Reviewed by Mark Rowe.
1693 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
1694 <https://bugs.webkit.org/show_bug.cgi?id=20719>
1695 <rdar://problem/6205787>
1697 Fix a typo in the case-insensitive matching of character patterns.
1700 (JSC::WRECGenerator::generatePatternCharacter):
1702 2008-09-09 Maciej Stachowiak <mjs@apple.com>
1704 Reviewed by Sam Weinig.
1706 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
1708 1.012x speedup on SunSpider.
1710 * kjs/MathObject.cpp:
1711 (JSC::MathObject::getOwnPropertySlot):
1713 (JSC::setUpStaticFunctionSlot):
1715 (JSC::getStaticPropertySlot):
1717 2008-09-08 Sam Weinig <sam@webkit.org>
1719 Reviewed by Maciej Stachowiak and Oliver Hunt.
1721 Split storage of properties out of the PropertyMap and into the JSObject
1722 to allow sharing PropertyMap on the StructureID. In order to get this
1723 function correctly, the StructureID's transition mappings were changed to
1724 transition based on property name and attribute pairs, instead of just
1727 - Removes the single property optimization now that the PropertyMap is shared.
1728 This will be replaced by in-lining some values on the JSObject.
1730 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
1732 * JavaScriptCore.base.exp:
1734 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
1735 (JSC::CTI::privateCompileGetByIdProto): Ditto.
1736 (JSC::CTI::privateCompileGetByIdChain): Ditto.
1737 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
1739 (JSC::JSObject::mark): Mark the PropertyStorage.
1740 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
1741 (JSC::JSObject::deleteProperty): Ditto.
1742 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
1743 (JSC::JSObject::defineSetter): Ditto.
1744 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
1745 (JSC::JSObject::getPropertyNames): Ditto.
1746 (JSC::JSObject::removeDirect): Ditto.
1747 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
1748 (JSC::JSObject::propertyStorage): return the PropertyStorage.
1749 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
1750 (JSC::JSObject::getDirectLocation): Ditto.
1751 (JSC::JSObject::offsetForLocation): Compute location directly.
1752 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
1753 (JSC::JSObject::hasGetterSetterProperties): Ditto.
1754 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
1755 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
1756 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
1757 (JSC::JSObject::getOwnPropertySlot): Ditto.
1758 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
1759 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
1760 (JSC::PropertyMap::checkConsistency):
1761 (JSC::PropertyMap::operator=):
1762 (JSC::PropertyMap::~PropertyMap):
1763 (JSC::PropertyMap::get):
1764 (JSC::PropertyMap::getLocation):
1765 (JSC::PropertyMap::put):
1766 (JSC::PropertyMap::getOffset):
1767 (JSC::PropertyMap::insert):
1768 (JSC::PropertyMap::expand):
1769 (JSC::PropertyMap::rehash):
1770 (JSC::PropertyMap::createTable):
1771 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
1772 (JSC::PropertyMap::remove):
1773 (JSC::PropertyMap::getEnumerablePropertyNames):
1774 * kjs/PropertyMap.h:
1775 (JSC::PropertyMapEntry::PropertyMapEntry):
1776 (JSC::PropertyMap::isEmpty):
1777 (JSC::PropertyMap::size):
1778 (JSC::PropertyMap::makingCount):
1779 (JSC::PropertyMap::PropertyMap):
1781 * kjs/StructureID.cpp:
1782 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
1784 (JSC::StructureID::toDictionaryTransition): Copy the map.
1785 (JSC::StructureID::changePrototypeTransition): Copy the map.
1786 (JSC::StructureID::getterSetterTransition): Copy the map.
1787 (JSC::StructureID::~StructureID):
1788 * kjs/StructureID.h:
1789 (JSC::TransitionTableHash::hash): Custom hash for transition map.
1790 (JSC::TransitionTableHash::equal): Ditto.
1791 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
1792 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
1793 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
1794 (JSC::StructureID::propertyMap): Added.
1796 2008-09-08 Oliver Hunt <oliver@apple.com>
1798 Reviewed by Mark Rowe.
1800 Bug 20694: Slow Script error pops up when running Dromaeo tests
1802 Correct error in timeout logic where execution tick count would
1803 be reset to incorrect value due to incorrect offset and indirection.
1804 Codegen for the slow script dialog was factored out into a separate
1805 method (emitSlowScriptCheck) rather than having multiple copies of
1806 the same code. Also added calls to generate slow script checks
1807 for loop_if_less and loop_if_true opcodes.
1810 (JSC::CTI::emitSlowScriptCheck):
1811 (JSC::CTI::privateCompileMainPass):
1812 (JSC::CTI::privateCompileSlowCases):
1815 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1817 Reviewed by Maciej Stachowiak.
1819 Remove references to the removed WRECompiler class.
1824 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1826 Rubber-stamped by Mark Rowe.
1828 Fix the build with CTI enabled but WREC disabled.
1833 2008-09-08 Dan Bernstein <mitz@apple.com>
1838 (JSC::StatementNode::):
1841 2008-09-08 Kevin McCullough <kmccullough@apple.com>
1845 <rdar://problem/6134407> Breakpoints in for loops, while loops or
1846 conditions without curly braces don't break. (19306)
1847 -Statement Lists already emit debug hooks but conditionals without
1848 brackets are not lists.
1851 (KJS::IfNode::emitCode):
1852 (KJS::IfElseNode::emitCode):
1853 (KJS::DoWhileNode::emitCode):
1854 (KJS::WhileNode::emitCode):
1855 (KJS::ForNode::emitCode):
1856 (KJS::ForInNode::emitCode):
1858 (KJS::StatementNode::):
1861 2008-09-08 Maciej Stachowiak <mjs@apple.com>
1863 Reviewed by Anders Carlsson.
1865 - Cache the code generated for eval to speed up SunSpider and web sites
1866 https://bugs.webkit.org/show_bug.cgi?id=20718
1869 2.29x on date-format-tofte
1871 Lots of real sites seem to get many hits on this cache as well,
1872 including GMail, Google Spreadsheets, Slate and Digg (the last of
1873 these gets over 100 hits on initial page load).
1876 (JSC::EvalCodeCache::get):
1878 (JSC::Machine::callEval):
1879 (JSC::Machine::privateExecute):
1880 (JSC::Machine::cti_op_call_eval):
1883 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1885 Reviewed by Oliver Hunt.
1887 Bug 20711: Change KJS prefix on preprocessor macros to JSC
1888 <https://bugs.webkit.org/show_bug.cgi?id=20711>
1890 * kjs/CommonIdentifiers.cpp:
1891 (JSC::CommonIdentifiers::CommonIdentifiers):
1892 * kjs/CommonIdentifiers.h:
1893 * kjs/PropertySlot.h:
1894 (JSC::PropertySlot::getValue):
1895 (JSC::PropertySlot::putValue):
1896 (JSC::PropertySlot::setValueSlot):
1897 (JSC::PropertySlot::setValue):
1898 (JSC::PropertySlot::setRegisterSlot):
1903 (JSC::ExpressionNode::):
1904 (JSC::StatementNode::):
1906 (JSC::BooleanNode::):
1907 (JSC::NumberNode::):
1908 (JSC::ImmediateNumberNode::):
1909 (JSC::StringNode::):
1910 (JSC::RegExpNode::):
1912 (JSC::ResolveNode::):
1913 (JSC::ElementNode::):
1915 (JSC::PropertyNode::):
1916 (JSC::PropertyListNode::):
1917 (JSC::ObjectLiteralNode::):
1918 (JSC::BracketAccessorNode::):
1919 (JSC::DotAccessorNode::):
1920 (JSC::ArgumentListNode::):
1921 (JSC::ArgumentsNode::):
1922 (JSC::NewExprNode::):
1923 (JSC::EvalFunctionCallNode::):
1924 (JSC::FunctionCallValueNode::):
1925 (JSC::FunctionCallResolveNode::):
1926 (JSC::FunctionCallBracketNode::):
1927 (JSC::FunctionCallDotNode::):
1928 (JSC::PrePostResolveNode::):
1929 (JSC::PostfixResolveNode::):
1930 (JSC::PostfixBracketNode::):
1931 (JSC::PostfixDotNode::):
1932 (JSC::PostfixErrorNode::):
1933 (JSC::DeleteResolveNode::):
1934 (JSC::DeleteBracketNode::):
1935 (JSC::DeleteDotNode::):
1936 (JSC::DeleteValueNode::):
1938 (JSC::TypeOfResolveNode::):
1939 (JSC::TypeOfValueNode::):
1940 (JSC::PrefixResolveNode::):
1941 (JSC::PrefixBracketNode::):
1942 (JSC::PrefixDotNode::):
1943 (JSC::PrefixErrorNode::):
1944 (JSC::UnaryPlusNode::):
1945 (JSC::NegateNode::):
1946 (JSC::BitwiseNotNode::):
1947 (JSC::LogicalNotNode::):
1953 (JSC::LeftShiftNode::):
1954 (JSC::RightShiftNode::):
1955 (JSC::UnsignedRightShiftNode::):
1957 (JSC::GreaterNode::):
1958 (JSC::LessEqNode::):
1959 (JSC::GreaterEqNode::):
1960 (JSC::ThrowableBinaryOpNode::):
1961 (JSC::InstanceOfNode::):
1964 (JSC::NotEqualNode::):
1965 (JSC::StrictEqualNode::):
1966 (JSC::NotStrictEqualNode::):
1967 (JSC::BitAndNode::):
1969 (JSC::BitXOrNode::):
1970 (JSC::LogicalOpNode::):
1971 (JSC::ConditionalNode::):
1972 (JSC::ReadModifyResolveNode::):
1973 (JSC::AssignResolveNode::):
1974 (JSC::ReadModifyBracketNode::):
1975 (JSC::AssignBracketNode::):
1976 (JSC::AssignDotNode::):
1977 (JSC::ReadModifyDotNode::):
1978 (JSC::AssignErrorNode::):
1980 (JSC::VarDeclCommaNode::):
1981 (JSC::ConstDeclNode::):
1982 (JSC::ConstStatementNode::):
1983 (JSC::EmptyStatementNode::):
1984 (JSC::DebuggerStatementNode::):
1985 (JSC::ExprStatementNode::):
1986 (JSC::VarStatementNode::):
1988 (JSC::IfElseNode::):
1989 (JSC::DoWhileNode::):
1992 (JSC::ContinueNode::):
1994 (JSC::ReturnNode::):
1999 (JSC::ParameterNode::):
2001 (JSC::ProgramNode::):
2003 (JSC::FunctionBodyNode::):
2004 (JSC::FuncExprNode::):
2005 (JSC::FuncDeclNode::):
2006 (JSC::CaseClauseNode::):
2007 (JSC::ClauseListNode::):
2008 (JSC::CaseBlockNode::):
2009 (JSC::SwitchNode::):
2011 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2013 Reviewed by Maciej Stachowiak.
2015 Bug 20704: Replace the KJS namespace
2016 <https://bugs.webkit.org/show_bug.cgi?id=20704>
2018 Rename the KJS namespace to JSC. There are still some uses of KJS in
2019 preprocessor macros and comments, but these will also be changed some
2020 time in the near future.
2027 * API/JSCallbackConstructor.cpp:
2028 * API/JSCallbackConstructor.h:
2029 * API/JSCallbackFunction.cpp:
2030 * API/JSCallbackFunction.h:
2031 * API/JSCallbackObject.cpp:
2032 * API/JSCallbackObject.h:
2033 * API/JSCallbackObjectFunctions.h:
2034 * API/JSClassRef.cpp:
2035 (OpaqueJSClass::staticValues):
2036 (OpaqueJSClass::staticFunctions):
2038 * API/JSContextRef.cpp:
2039 * API/JSObjectRef.cpp:
2040 * API/JSProfilerPrivate.cpp:
2041 * API/JSStringRef.cpp:
2042 * API/JSValueRef.cpp:
2044 * API/OpaqueJSString.cpp:
2045 * API/OpaqueJSString.h:
2046 * JavaScriptCore.Debug.exp:
2047 * JavaScriptCore.base.exp:
2053 * VM/CodeGenerator.cpp:
2054 * VM/CodeGenerator.h:
2055 * VM/ExceptionHelpers.cpp:
2056 * VM/ExceptionHelpers.h:
2058 * VM/JSPropertyNameIterator.cpp:
2059 * VM/JSPropertyNameIterator.h:
2067 * VM/RegisterFile.cpp:
2068 * VM/RegisterFile.h:
2071 * VM/SamplingTool.cpp:
2072 * VM/SamplingTool.h:
2073 * VM/SegmentedVector.h:
2076 * kjs/Arguments.cpp:
2078 * kjs/ArrayConstructor.cpp:
2079 * kjs/ArrayConstructor.h:
2080 * kjs/ArrayPrototype.cpp:
2081 * kjs/ArrayPrototype.h:
2082 * kjs/BatchedTransitionOptimizer.h:
2083 * kjs/BooleanConstructor.cpp:
2084 * kjs/BooleanConstructor.h:
2085 * kjs/BooleanObject.cpp:
2086 * kjs/BooleanObject.h:
2087 * kjs/BooleanPrototype.cpp:
2088 * kjs/BooleanPrototype.h:
2092 * kjs/CommonIdentifiers.cpp:
2093 * kjs/CommonIdentifiers.h:
2094 * kjs/ConstructData.cpp:
2095 * kjs/ConstructData.h:
2096 * kjs/DateConstructor.cpp:
2097 * kjs/DateConstructor.h:
2098 * kjs/DateInstance.cpp:
2099 (JSC::DateInstance::msToGregorianDateTime):
2100 * kjs/DateInstance.h:
2103 * kjs/DatePrototype.cpp:
2104 * kjs/DatePrototype.h:
2105 * kjs/DebuggerCallFrame.cpp:
2106 * kjs/DebuggerCallFrame.h:
2109 * kjs/ErrorConstructor.cpp:
2110 * kjs/ErrorConstructor.h:
2111 * kjs/ErrorInstance.cpp:
2112 * kjs/ErrorInstance.h:
2113 * kjs/ErrorPrototype.cpp:
2114 * kjs/ErrorPrototype.h:
2115 * kjs/ExecState.cpp:
2117 * kjs/FunctionConstructor.cpp:
2118 * kjs/FunctionConstructor.h:
2119 * kjs/FunctionPrototype.cpp:
2120 * kjs/FunctionPrototype.h:
2121 * kjs/GetterSetter.cpp:
2122 * kjs/GetterSetter.h:
2123 * kjs/GlobalEvalFunction.cpp:
2124 * kjs/GlobalEvalFunction.h:
2125 * kjs/IndexToNameMap.cpp:
2126 * kjs/IndexToNameMap.h:
2127 * kjs/InitializeThreading.cpp:
2128 * kjs/InitializeThreading.h:
2129 * kjs/InternalFunction.cpp:
2130 * kjs/InternalFunction.h:
2131 (JSC::InternalFunction::InternalFunction):
2132 * kjs/JSActivation.cpp:
2133 * kjs/JSActivation.h:
2138 * kjs/JSFunction.cpp:
2140 (JSC::JSFunction::JSFunction):
2141 * kjs/JSGlobalData.cpp:
2142 (JSC::JSGlobalData::JSGlobalData):
2143 * kjs/JSGlobalData.h:
2144 * kjs/JSGlobalObject.cpp:
2145 * kjs/JSGlobalObject.h:
2146 * kjs/JSGlobalObjectFunctions.cpp:
2147 * kjs/JSGlobalObjectFunctions.h:
2148 * kjs/JSImmediate.cpp:
2149 * kjs/JSImmediate.h:
2152 * kjs/JSNotAnObject.cpp:
2153 * kjs/JSNotAnObject.h:
2154 * kjs/JSNumberCell.cpp:
2155 * kjs/JSNumberCell.h:
2158 * kjs/JSStaticScopeObject.cpp:
2159 * kjs/JSStaticScopeObject.h:
2165 * kjs/JSVariableObject.cpp:
2166 * kjs/JSVariableObject.h:
2167 * kjs/JSWrapperObject.cpp:
2168 * kjs/JSWrapperObject.h:
2169 * kjs/LabelStack.cpp:
2171 * kjs/MathObject.cpp:
2173 * kjs/NativeErrorConstructor.cpp:
2174 * kjs/NativeErrorConstructor.h:
2175 * kjs/NativeErrorPrototype.cpp:
2176 * kjs/NativeErrorPrototype.h:
2178 * kjs/NumberConstructor.cpp:
2179 * kjs/NumberConstructor.h:
2180 * kjs/NumberObject.cpp:
2181 * kjs/NumberObject.h:
2182 * kjs/NumberPrototype.cpp:
2183 * kjs/NumberPrototype.h:
2184 * kjs/ObjectConstructor.cpp:
2185 * kjs/ObjectConstructor.h:
2186 * kjs/ObjectPrototype.cpp:
2187 * kjs/ObjectPrototype.h:
2190 * kjs/PropertyMap.cpp:
2191 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
2192 * kjs/PropertyMap.h:
2193 * kjs/PropertyNameArray.cpp:
2194 * kjs/PropertyNameArray.h:
2195 * kjs/PropertySlot.cpp:
2196 * kjs/PropertySlot.h:
2197 * kjs/PrototypeFunction.cpp:
2198 * kjs/PrototypeFunction.h:
2199 * kjs/PutPropertySlot.h:
2200 * kjs/RegExpConstructor.cpp:
2201 * kjs/RegExpConstructor.h:
2202 * kjs/RegExpObject.cpp:
2203 * kjs/RegExpObject.h:
2204 * kjs/RegExpPrototype.cpp:
2205 * kjs/RegExpPrototype.h:
2206 * kjs/ScopeChain.cpp:
2208 * kjs/ScopeChainMark.h:
2211 * kjs/SmallStrings.cpp:
2212 * kjs/SmallStrings.h:
2213 * kjs/SourceProvider.h:
2214 * kjs/SourceRange.h:
2215 * kjs/StringConstructor.cpp:
2216 * kjs/StringConstructor.h:
2217 * kjs/StringObject.cpp:
2218 * kjs/StringObject.h:
2219 * kjs/StringObjectThatMasqueradesAsUndefined.h:
2220 * kjs/StringPrototype.cpp:
2221 * kjs/StringPrototype.h:
2222 * kjs/StructureID.cpp:
2223 * kjs/StructureID.h:
2224 * kjs/SymbolTable.h:
2225 * kjs/collector.cpp:
2228 * kjs/create_hash_table:
2234 * kjs/identifier.cpp:
2236 (JSC::Identifier::equal):
2237 * kjs/interpreter.cpp:
2238 * kjs/interpreter.h:
2240 (JSC::Lexer::Lexer):
2241 (JSC::Lexer::clear):
2242 (JSC::Lexer::makeIdentifier):
2248 * kjs/nodes2string.cpp:
2249 * kjs/operations.cpp:
2257 (JSC::IdentifierRepHash::hash):
2259 * masm/MacroAssembler.h:
2260 * masm/MacroAssemblerWin.cpp:
2261 * masm/X86Assembler.h:
2262 * pcre/pcre_exec.cpp:
2263 * profiler/CallIdentifier.h:
2265 * profiler/HeavyProfile.cpp:
2266 * profiler/HeavyProfile.h:
2267 * profiler/Profile.cpp:
2268 * profiler/Profile.h:
2269 * profiler/ProfileGenerator.cpp:
2270 * profiler/ProfileGenerator.h:
2271 * profiler/ProfileNode.cpp:
2272 * profiler/ProfileNode.h:
2273 * profiler/Profiler.cpp:
2274 * profiler/Profiler.h:
2275 * profiler/TreeProfile.cpp:
2276 * profiler/TreeProfile.h:
2281 2008-09-07 Maciej Stachowiak <mjs@apple.com>
2283 Reviewed by Dan Bernstein.
2285 - rename IA32MacroAssembler class to X86Assembler
2287 We otherwise call the platform X86, and also, I don't see any macros.
2289 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2290 * JavaScriptCore.xcodeproj/project.pbxproj:
2291 * masm/IA32MacroAsm.h: Removed.
2292 * masm/MacroAssembler.h:
2293 (KJS::MacroAssembler::MacroAssembler):
2294 * masm/MacroAssemblerWin.cpp:
2295 (KJS::MacroAssembler::emitRestoreArgumentReference):
2296 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
2297 (KJS::X86Assembler::X86Assembler):
2299 (KJS::WRECGenerator::generateNonGreedyQuantifier):
2300 (KJS::WRECGenerator::generateGreedyQuantifier):
2301 (KJS::WRECGenerator::generateParentheses):
2302 (KJS::WRECGenerator::generateBackreference):
2303 (KJS::WRECGenerator::gernerateDisjunction):
2306 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
2310 Visual C++ seems to have some odd casting rules, so just convert the
2311 offending cast back to a C-style cast for now.
2313 * kjs/collector.cpp:
2314 (KJS::otherThreadStackPointer):
2316 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2318 Reviewed by Mark Rowe.
2320 Attempt to fix the Windows build by using a const_cast to cast regs.Esp
2321 to a uintptr_t instead of a reinterpret_cast.
2323 * kjs/collector.cpp:
2324 (KJS::otherThreadStackPointer):
2326 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2328 Reviewed by Sam Weinig.
2330 Remove C-style casts from kjs/collector.cpp.
2332 * kjs/collector.cpp:
2333 (KJS::Heap::heapAllocate):
2334 (KJS::currentThreadStackBase):
2335 (KJS::Heap::markConservatively):
2336 (KJS::otherThreadStackPointer):
2337 (KJS::Heap::markOtherThreadConservatively):
2340 2008-09-07 Mark Rowe <mrowe@apple.com>
2342 Build fix for the debug variant.
2344 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
2346 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
2348 Reviewed by Timothy Hatcher.
2350 Remove C-style casts from the CTI code.
2353 (KJS::CTI::emitGetArg):
2354 (KJS::CTI::emitGetPutArg):
2355 (KJS::ctiRepatchCallByReturnAddress):
2356 (KJS::CTI::compileOpCall):
2357 (KJS::CTI::privateCompileMainPass):
2358 (KJS::CTI::privateCompileGetByIdSelf):
2359 (KJS::CTI::privateCompileGetByIdProto):
2360 (KJS::CTI::privateCompileGetByIdChain):
2361 (KJS::CTI::privateCompilePutByIdReplace):
2362 (KJS::CTI::privateArrayLengthTrampoline):
2363 (KJS::CTI::privateStringLengthTrampoline):
2365 === End merge of squirrelfish-extreme ===
2367 2008-09-06 Gavin Barraclough <barraclough@apple.com>
2369 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
2371 - refactor WREC to share more of the JIT infrastructure with CTI
2374 (KJS::CTI::emitGetArg):
2375 (KJS::CTI::emitGetPutArg):
2376 (KJS::CTI::emitPutArg):
2377 (KJS::CTI::emitPutArgConstant):
2378 (KJS::CTI::emitPutCTIParam):
2379 (KJS::CTI::emitGetCTIParam):
2380 (KJS::CTI::emitPutToCallFrameHeader):
2381 (KJS::CTI::emitGetFromCallFrameHeader):
2382 (KJS::CTI::emitPutResult):
2383 (KJS::CTI::emitDebugExceptionCheck):
2384 (KJS::CTI::emitJumpSlowCaseIfNotImm):
2385 (KJS::CTI::emitJumpSlowCaseIfNotImms):
2386 (KJS::CTI::emitFastArithDeTagImmediate):
2387 (KJS::CTI::emitFastArithReTagImmediate):
2388 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
2389 (KJS::CTI::emitFastArithImmToInt):
2390 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
2391 (KJS::CTI::emitFastArithIntToImmNoCheck):
2393 (KJS::CTI::compileOpCall):
2394 (KJS::CTI::privateCompileMainPass):
2395 (KJS::CTI::privateCompileSlowCases):
2396 (KJS::CTI::privateCompile):
2397 (KJS::CTI::privateCompileGetByIdSelf):
2398 (KJS::CTI::privateCompileGetByIdProto):
2399 (KJS::CTI::privateCompileGetByIdChain):
2400 (KJS::CTI::privateCompilePutByIdReplace):
2401 (KJS::CTI::privateArrayLengthTrampoline):
2402 (KJS::CTI::privateStringLengthTrampoline):
2403 (KJS::CTI::compileRegExp):
2405 (KJS::CallRecord::CallRecord):
2406 (KJS::JmpTable::JmpTable):
2407 (KJS::SlowCaseEntry::SlowCaseEntry):
2408 (KJS::CTI::JSRInfo::JSRInfo):
2410 (KJS::RegExp::RegExp):
2412 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
2413 (KJS::GeneratePatternCharacterFunctor::generateAtom):
2414 (KJS::GeneratePatternCharacterFunctor::backtrack):
2415 (KJS::GenerateCharacterClassFunctor::generateAtom):
2416 (KJS::GenerateCharacterClassFunctor::backtrack):
2417 (KJS::GenerateBackreferenceFunctor::generateAtom):
2418 (KJS::GenerateBackreferenceFunctor::backtrack):
2419 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
2420 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
2421 (KJS::WRECGenerate::generateBacktrack1):
2422 (KJS::WRECGenerate::generateBacktrackBackreference):
2423 (KJS::WRECGenerate::generateBackreferenceQuantifier):
2424 (KJS::WRECGenerate::generateNonGreedyQuantifier):
2425 (KJS::WRECGenerate::generateGreedyQuantifier):
2426 (KJS::WRECGenerate::generatePatternCharacter):
2427 (KJS::WRECGenerate::generateCharacterClassInvertedRange):
2428 (KJS::WRECGenerate::generateCharacterClassInverted):
2429 (KJS::WRECGenerate::generateCharacterClass):
2430 (KJS::WRECGenerate::generateParentheses):
2431 (KJS::WRECGenerate::generateParenthesesNonGreedy):
2432 (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
2433 (KJS::WRECGenerate::generateAssertionBOL):
2434 (KJS::WRECGenerate::generateAssertionEOL):
2435 (KJS::WRECGenerate::generateAssertionWordBoundary):
2436 (KJS::WRECGenerate::generateBackreference):
2437 (KJS::WRECGenerate::gernerateDisjunction):
2438 (KJS::WRECGenerate::terminateDisjunction):
2439 (KJS::WRECParser::parseGreedyQuantifier):
2440 (KJS::WRECParser::parseQuantifier):
2441 (KJS::WRECParser::parsePatternCharacterQualifier):
2442 (KJS::WRECParser::parseCharacterClassQuantifier):
2443 (KJS::WRECParser::parseBackreferenceQuantifier):
2444 (KJS::WRECParser::parseParentheses):
2445 (KJS::WRECParser::parseCharacterClass):
2446 (KJS::WRECParser::parseOctalEscape):
2447 (KJS::WRECParser::parseEscape):
2448 (KJS::WRECParser::parseTerm):
2449 (KJS::WRECParser::parseDisjunction):
2451 (KJS::WRECGenerate::WRECGenerate):
2452 (KJS::WRECParser::):
2453 (KJS::WRECParser::WRECParser):
2454 (KJS::WRECParser::parseAlternative):
2455 (KJS::WRECParser::isEndOfPattern):
2457 2008-09-06 Oliver Hunt <oliver@apple.com>
2459 Reviewed by NOBODY (Build fix).
2461 Fix the sampler build.
2463 * VM/SamplingTool.h:
2465 2008-09-06 Oliver Hunt <oliver@apple.com>
2467 Reviewed by Maciej Stachowiak.
2469 Jump through the necessary hoops required to make MSVC cooperate with SFX
2471 We now explicitly declare the calling convention on all cti_op_* cfunctions,
2472 and return int instead of bool where appropriate (despite the cdecl calling
2473 convention seems to state MSVC generates code that returns the result value
2474 through ecx). SFX behaves slightly differently under MSVC, specifically it
2475 stores the base argument address for the cti_op_* functions in the first
2476 argument, and then does the required stack manipulation through that pointer.
2477 This is necessary as MSVC's optimisations assume they have complete control
2478 of the stack, and periodically elide our stack manipulations, or move
2479 values in unexpected ways. MSVC also frequently produces tail calls which may
2480 clobber the first argument, so the MSVC path is slightly less efficient due
2481 to the need to restore it.
2483 * JavaScriptCore.xcodeproj/project.pbxproj:
2486 (KJS::CTI::compileOpCall):
2487 (KJS::CTI::privateCompileMainPass):
2488 (KJS::CTI::privateCompileSlowCases):
2492 * masm/MacroAssembler.h:
2493 (KJS::MacroAssembler::emitConvertToFastCall):
2494 * masm/MacroAssemblerIA32GCC.cpp: Removed.
2495 For performance reasons we need these no-op functions to be inlined.
2497 * masm/MacroAssemblerWin.cpp:
2498 (KJS::MacroAssembler::emitRestoreArgumentReference):
2501 2008-09-05 Geoffrey Garen <ggaren@apple.com>
2503 Reviewed by Maciej Stachowiak, or maybe the other way around.
2505 Added the ability to coalesce JITCode buffer grow operations by first
2506 growing the buffer and then executing unchecked puts to it.
2508 About a 2% speedup on date-format-tofte.
2511 (KJS::CTI::compileOpCall):
2512 * masm/IA32MacroAsm.h:
2513 (KJS::JITCodeBuffer::ensureSpace):
2514 (KJS::JITCodeBuffer::putByteUnchecked):
2515 (KJS::JITCodeBuffer::putByte):
2516 (KJS::JITCodeBuffer::putShortUnchecked):
2517 (KJS::JITCodeBuffer::putShort):
2518 (KJS::JITCodeBuffer::putIntUnchecked):
2519 (KJS::JITCodeBuffer::putInt):
2520 (KJS::IA32MacroAssembler::emitTestl_i32r):
2521 (KJS::IA32MacroAssembler::emitMovl_mr):
2522 (KJS::IA32MacroAssembler::emitMovl_rm):
2523 (KJS::IA32MacroAssembler::emitMovl_i32m):
2524 (KJS::IA32MacroAssembler::emitUnlinkedJe):
2525 (KJS::IA32MacroAssembler::emitModRm_rr):
2526 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
2527 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
2528 (KJS::IA32MacroAssembler::emitModRm_rm):
2529 (KJS::IA32MacroAssembler::emitModRm_opr):
2530 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
2531 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
2533 2008-09-05 Mark Rowe <mrowe@apple.com>
2535 Reviewed by Sam Weinig.
2537 Disable WREC and CTI on platforms that we have not yet had a chance to test with.
2541 2008-09-05 Geoffrey Garen <ggaren@apple.com>
2543 Reviewed by Sam Weinig.
2545 Use jo instead of a mask compare when fetching array.length and
2546 string.length. 4% speedup on array.length / string.length torture
2550 (KJS::CTI::privateArrayLengthTrampoline):
2551 (KJS::CTI::privateStringLengthTrampoline):
2553 2008-09-05 Geoffrey Garen <ggaren@apple.com>
2555 Reviewed by Sam Weinig.
2557 Removed a CTI compilation pass by recording labels during bytecode
2558 generation. This is more to reduce complexity than it is to improve
2561 SunSpider reports no change.
2563 CodeBlock now keeps a "labels" set, which holds the offsets of all the
2564 instructions that can be jumped to.
2566 * VM/CTI.cpp: Nixed a pass.
2568 * VM/CodeBlock.h: Added a "labels" set.
2570 * VM/LabelID.h: No need for a special LableID for holding jump
2571 destinations, since the CodeBlock now knows all jump destinations.
2573 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
2577 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
2579 2008-09-05 Mark Rowe <mrowe@apple.com>
2581 Reviewed by Oliver Hunt and Gavin Barraclough.
2583 Move the JITCodeBuffer onto Machine and remove the static variables.
2585 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
2587 (KJS::Machine::Machine): Allocate a JITCodeBuffer.
2589 * kjs/RegExpConstructor.cpp:
2590 (KJS::constructRegExp): Pass the ExecState through.
2591 * kjs/RegExpPrototype.cpp:
2592 (KJS::regExpProtoFuncCompile): Ditto.
2593 * kjs/StringPrototype.cpp:
2594 (KJS::stringProtoFuncMatch): Ditto.
2595 (KJS::stringProtoFuncSearch): Ditto.
2597 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
2598 so that we have access to an ExecState.
2600 (KJS::RegExpNode::):
2601 * kjs/nodes2string.cpp:
2603 (KJS::RegExp::RegExp): Pass the ExecState through.
2604 (KJS::RegExp::create): Ditto.
2606 * masm/IA32MacroAsm.h:
2607 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
2610 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
2613 2008-09-05 Mark Rowe <mrowe@apple.com>
2615 Reviewed by Oliver Hunt and Gavin Barraclough.
2617 Fix the build when CTI is disabled.
2620 (KJS::CodeBlock::~CodeBlock):
2621 * VM/CodeGenerator.cpp:
2622 (KJS::prepareJumpTableForStringSwitch):
2624 (KJS::Machine::Machine):
2625 (KJS::Machine::~Machine):
2627 2008-09-05 Gavin Barraclough <barraclough@apple.com>
2629 Reviewed by Mark Rowe.
2631 Fix some windows abi issues.
2634 (KJS::CTI::privateCompileMainPass):
2635 (KJS::CTI::privateCompileSlowCases):
2637 (KJS::CallRecord::CallRecord):
2640 (KJS::Machine::cti_op_resolve_func):
2641 (KJS::Machine::cti_op_post_inc):
2642 (KJS::Machine::cti_op_resolve_with_base):
2643 (KJS::Machine::cti_op_post_dec):
2646 2008-09-05 Mark Rowe <mrowe@apple.com>
2648 Reviewed by Sam Weinig.
2650 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
2653 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
2654 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
2656 2008-09-04 Mark Rowe <mrowe@apple.com>
2658 Reviewed by Sam Weinig.
2660 Fix fast/dom/Window/console-functions.html.
2662 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
2663 such as console.log would use the line number of the last JS function on the call stack.
2666 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
2667 and restore it when the function is done.
2668 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
2670 2008-09-05 Oliver Hunt <oliver@apple.com>
2672 Start bringing up SFX on windows.
2674 Reviewed by Mark Rowe and Sam Weinig
2676 Start doing the work to bring up SFX on windows. Initially
2677 just working on WREC, as it does not make any calls so reduces
2678 the amount of code that needs to be corrected.
2680 Start abstracting the CTI JIT codegen engine.
2683 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2684 * JavaScriptCore.xcodeproj/project.pbxproj:
2686 * masm/IA32MacroAsm.h:
2687 * masm/MacroAssembler.h: Added.
2688 (KJS::MacroAssembler::MacroAssembler):
2689 * masm/MacroAssemblerIA32GCC.cpp: Added.
2690 (KJS::MacroAssembler::emitConvertToFastCall):
2691 * masm/MacroAssemblerWin.cpp: Added.
2692 (KJS::MacroAssembler::emitConvertToFastCall):
2694 (KJS::WRECompiler::parseGreedyQuantifier):
2695 (KJS::WRECompiler::parseCharacterClass):
2696 (KJS::WRECompiler::parseEscape):
2697 (KJS::WRECompiler::compilePattern):
2700 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2702 Reviewed by Sam Weinig.
2704 Support for slow scripts (timeout checking).
2707 (KJS::CTI::privateCompileMainPass):
2708 (KJS::CTI::privateCompile):
2710 (KJS::slideRegisterWindowForCall):
2711 (KJS::Machine::cti_timeout_check):
2712 (KJS::Machine::cti_vm_throw):
2714 2008-09-04 Sam Weinig <sam@webkit.org>
2716 Reviewed by Mark Rowe.
2718 Third round of style cleanup.
2727 2008-09-04 Sam Weinig <sam@webkit.org>
2729 Reviewed by Jon Honeycutt.
2731 Second round of style cleanup.
2737 2008-09-04 Sam Weinig <sam@webkit.org>
2739 Reviewed by Mark Rowe.
2741 First round of style cleanup.
2745 * masm/IA32MacroAsm.h:
2749 2008-09-04 Geoffrey Garen <ggaren@apple.com>
2751 Reviewed by Mark Rowe.
2753 Merged http://trac.webkit.org/changeset/36081 to work with CTI.
2756 (KJS::Machine::tryCtiCacheGetByID):
2758 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2760 Reviewed by Sam Weinig.
2762 Enable profiling in CTI.
2766 (KJS::CTI::execute):
2768 (KJS::Machine::cti_op_call_JSFunction):
2769 (KJS::Machine::cti_op_call_NotJSFunction):
2770 (KJS::Machine::cti_op_ret):
2771 (KJS::Machine::cti_op_construct_JSConstruct):
2772 (KJS::Machine::cti_op_construct_NotJSConstruct):
2774 2008-09-04 Victor Hernandez <vhernandez@apple.com>
2776 Reviewed by Geoffrey Garen.
2778 Fixed an #if to support using WREC without CTI.
2781 (KJS::RegExp::match):
2783 2008-09-04 Gavin Barraclough <barraclough@apple.com>
2785 Reviewed by Oliver Hunt.
2787 The array/string length trampolines are owned by the Machine, not the codeblock that compiled them.
2790 (KJS::CTI::privateArrayLengthTrampoline):
2791 (KJS::CTI::privateStringLengthTrampoline):
2793 (KJS::Machine::~Machine):
2796 2008-09-04 Mark Rowe <mrowe@apple.com>
2798 Reviewed by Gavin Barraclough and Sam Weinig.
2800 Fix a crash on launch of jsc when GuardMalloc is enabled.
2803 (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain.
2804 (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref.
2806 2008-09-03 Oliver Hunt <oliver@apple.com>
2808 Reviewed by Gavin Barraclough and Geoff Garen.
2810 Fix inspector and fast array access so that it bounds
2814 (KJS::CTI::privateCompile_pass2_Main):
2815 * masm/IA32MacroAsm.h:
2816 (KJS::IA32MacroAssembler::):
2817 (KJS::IA32MacroAssembler::emitUnlinkedJb):
2818 (KJS::IA32MacroAssembler::emitUnlinkedJbe):
2820 2008-09-03 Mark Rowe <mrowe@apple.com>
2822 Move the assertion after the InitializeAndReturn block, as
2823 that is used even when CTI is enabled.
2826 (KJS::Machine::privateExecute):
2828 2008-09-03 Mark Rowe <mrowe@apple.com>
2830 Reviewed by Sam Weinig.
2832 Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED.
2835 (KJS::CTI::privateCompile_pass1_Scan):
2836 (KJS::CTI::privateCompile_pass2_Main):
2837 (KJS::CTI::privateCompile_pass4_SlowCases):
2839 (KJS::Machine::privateExecute):
2840 (KJS::Machine::cti_vm_throw):
2842 2008-09-03 Mark Rowe <mrowe@apple.com>
2844 Reviewed by Sam Weinig.
2846 Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved
2847 by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86)
2853 (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for
2854 printing a ptrdiff_t.
2858 (KJS::RegExp::RegExp):
2859 (KJS::RegExp::~RegExp):
2860 (KJS::RegExp::match):
2862 * masm/IA32MacroAsm.h:
2865 * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to
2866 track whether any MASM-using features are enabled.
2868 2008-09-03 Gavin Barraclough <barraclough@apple.com>
2870 Reviewed by Oliver Hunt.
2872 Copy Geoff's array/string length optimization for CTI.
2875 (KJS::CTI::privateArrayLengthTrampoline):
2876 (KJS::CTI::privateStringLengthTrampoline):
2878 (KJS::CTI::compileArrayLengthTrampoline):
2879 (KJS::CTI::compileStringLengthTrampoline):
2881 (KJS::Machine::Machine):
2882 (KJS::Machine::getCtiArrayLengthTrampoline):
2883 (KJS::Machine::getCtiStringLengthTrampoline):
2884 (KJS::Machine::tryCtiCacheGetByID):
2885 (KJS::Machine::cti_op_get_by_id_second):
2890 2008-09-03 Gavin Barraclough <barraclough@apple.com>
2892 Reviewed by Oliver Hunt.
2894 Implement fast array accesses in CTI - 2-3% progression on sunspider.
2897 (KJS::CTI::emitFastArithIntToImmNoCheck):
2898 (KJS::CTI::compileOpCall):
2899 (KJS::CTI::privateCompile_pass2_Main):
2900 (KJS::CTI::privateCompile_pass4_SlowCases):
2904 2008-09-02 Gavin Barraclough <barraclough@apple.com>
2906 Reviewed by Oliver Hunt.
2908 Enable fast property access support in CTI.
2911 (KJS::ctiSetReturnAddress):
2912 (KJS::ctiRepatchCallByReturnAddress):
2913 (KJS::CTI::privateCompile_pass2_Main):
2914 (KJS::CTI::privateCompile):
2915 (KJS::CTI::privateCompileGetByIdSelf):
2916 (KJS::CTI::privateCompileGetByIdProto):
2917 (KJS::CTI::privateCompileGetByIdChain):
2918 (KJS::CTI::privateCompilePutByIdReplace):
2920 (KJS::CTI::compileGetByIdSelf):
2921 (KJS::CTI::compileGetByIdProto):
2922 (KJS::CTI::compileGetByIdChain):
2923 (KJS::CTI::compilePutByIdReplace):
2925 (KJS::CodeBlock::~CodeBlock):
2928 (KJS::doSetReturnAddressVmThrowTrampoline):
2929 (KJS::Machine::tryCtiCachePutByID):
2930 (KJS::Machine::tryCtiCacheGetByID):
2931 (KJS::Machine::cti_op_put_by_id):
2932 (KJS::Machine::cti_op_put_by_id_second):
2933 (KJS::Machine::cti_op_put_by_id_generic):
2934 (KJS::Machine::cti_op_put_by_id_fail):
2935 (KJS::Machine::cti_op_get_by_id):
2936 (KJS::Machine::cti_op_get_by_id_second):
2937 (KJS::Machine::cti_op_get_by_id_generic):
2938 (KJS::Machine::cti_op_get_by_id_fail):
2939 (KJS::Machine::cti_op_throw):
2940 (KJS::Machine::cti_vm_throw):
2944 * kjs/PropertyMap.h:
2945 * kjs/StructureID.cpp:
2946 (KJS::StructureIDChain::StructureIDChain):
2947 * masm/IA32MacroAsm.h:
2948 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2949 (KJS::IA32MacroAssembler::emitMovl_mr):
2950 (KJS::IA32MacroAssembler::emitMovl_rm):
2952 2008-09-02 Sam Weinig <sam@webkit.org>
2954 Reviewed by Gavin Barraclough and Mark Rowe.
2956 A backslash (\) at the of a RegEx should produce an error.
2957 Fixes fast/regex/test1.html.
2960 (KJS::WRECompiler::parseEscape):
2962 2008-09-02 Sam Weinig <sam@webkit.org>
2964 Reviewed by Geoff Garen.
2966 Link jumps for the slow case of op_loop_if_less. Fixes acid3.
2969 (KJS::CTI::privateCompile_pass4_SlowCases):
2971 2008-09-01 Sam Weinig <sam@webkit.org>
2973 Rubber-stamped by Maciej Stachowiak.
2975 Switch WREC on by default.
2979 2008-09-01 Sam Weinig <sam@webkit.org>
2981 Reviewed by Mark Rowe.
2983 Fix two failures in fast/regex/test1.html
2984 - \- in a character class should be treated as a literal -
2985 - A missing max quantifier needs to be treated differently than
2986 a null max quantifier.
2989 (KJS::WRECompiler::generateNonGreedyQuantifier):
2990 (KJS::WRECompiler::generateGreedyQuantifier):
2991 (KJS::WRECompiler::parseCharacterClass):
2993 (KJS::Quantifier::Quantifier):
2995 2008-09-01 Sam Weinig <sam@webkit.org>
2997 Reviewed by Mark Rowe.
2999 Fix crash in fast/js/kde/evil-n.html
3001 * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function.
3003 2008-09-01 Sam Weinig <sam@webkit.org>
3005 Reviewed by Gavin Barraclough and Mark Rowe.
3007 Add pattern length limit fixing one test in fast/js.
3010 (KJS::WRECompiler::compile):
3012 (KJS::WRECompiler::):
3014 2008-09-01 Sam Weinig <sam@webkit.org>
3016 Reviewed by Gavin Barraclough and Mark Rowe.
3018 Make octal escape parsing/back-reference parsing more closely match
3019 prior behavior fixing one test in fast/js.
3022 (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped
3023 (KJS::WRECompiler::parseEscape):
3025 (KJS::WRECompiler::peekDigit):
3027 2008-09-01 Sam Weinig <sam@webkit.org>
3029 Reviewed by Gavin Barraclough and Mark Rowe.
3031 Fix one mozilla test.
3034 (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not
3037 2008-09-01 Sam Weinig <sam@webkit.org>
3039 Reviewed by Gavin Barraclough and Mark Rowe.
3041 Parse octal escapes in character classes fixing one mozilla test.
3044 (KJS::WRECompiler::parseCharacterClass):
3045 (KJS::WRECompiler::parseOctalEscape):
3047 (KJS::WRECompiler::consumeOctal):
3049 2008-09-01 Sam Weinig <sam@webkit.org>
3051 Reviewed by Oliver Hunt.
3053 Fixes two mozilla tests with WREC enabled.
3056 (KJS::CharacterClassConstructor::append): Keep the character class sorted
3057 when appending another character class.
3059 2008-09-01 Sam Weinig <sam@webkit.org>
3061 Reviewed by Gavin Barraclough and Mark Rowe.
3063 Fixes two mozilla tests with WREC enabled.
3066 (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position
3067 instead of appending it to the end.
3069 2008-09-01 Gavin Barraclough <barraclough@apple.com>
3071 Reviewed by Oliver Hunt.
3073 Move cross-compilation unit call into NEVER_INLINE function.
3076 (KJS::doSetReturnAddressVmThrowTrampoline):
3078 2008-09-01 Sam Weinig <sam@webkit.org>
3080 Reviewed by Gavin Barraclough and Geoff Garen.
3082 Fix one test in fast/js.
3085 (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError,
3086 instead of a createNotAFunctionError.
3088 2008-08-31 Gavin Barraclough <barraclough@apple.com>
3090 Reviewed by Maciej Stachowiak.
3092 Zero-cost exception handling. This patch takes the exception checking
3093 back of the hot path. When an exception occurs in a Machine::cti*
3094 method, the return address to JIT code is recorded, and is then
3095 overwritten with a pointer to a trampoline routine. When the method
3096 returns the trampoline will cause the cti_vm_throw method to be invoked.
3098 cti_vm_throw uses the return address preserved above, to discover the
3099 vPC of the bytecode that raised the exception (using a map build during
3100 translation). From the VPC of the faulting bytecode the vPC of a catch
3101 routine may be discovered (unwinding the stack where necesary), and then
3102 a bytecode address for the catch routine is looked up. Final cti_vm_throw
3103 overwrites its return address to JIT code again, to trampoline directly
3104 to the catch routine.
3106 cti_op_throw is handled in a similar fashion.
3109 (KJS::CTI::emitPutCTIParam):
3110 (KJS::CTI::emitPutToCallFrameHeader):
3111 (KJS::CTI::emitGetFromCallFrameHeader):
3112 (KJS::ctiSetReturnAddressForArgs):
3113 (KJS::CTI::emitDebugExceptionCheck):
3114 (KJS::CTI::printOpcodeOperandTypes):
3115 (KJS::CTI::emitCall):
3116 (KJS::CTI::compileOpCall):
3117 (KJS::CTI::privateCompile_pass2_Main):
3118 (KJS::CTI::privateCompile):
3120 (KJS::CallRecord::CallRecord):
3122 (KJS::CTI::execute):
3125 (KJS::Machine::privateExecute):
3126 (KJS::Machine::cti_op_instanceof):
3127 (KJS::Machine::cti_op_call_NotJSFunction):
3128 (KJS::Machine::cti_op_resolve):
3129 (KJS::Machine::cti_op_resolve_func):
3130 (KJS::Machine::cti_op_resolve_skip):
3131 (KJS::Machine::cti_op_resolve_with_base):
3132 (KJS::Machine::cti_op_throw):
3133 (KJS::Machine::cti_op_in):
3134 (KJS::Machine::cti_vm_throw):
3135 * VM/RegisterFile.h:
3136 (KJS::RegisterFile::):
3138 (KJS::ExecState::setCtiReturnAddress):
3139 (KJS::ExecState::ctiReturnAddress):
3140 * masm/IA32MacroAsm.h:
3141 (KJS::IA32MacroAssembler::):
3142 (KJS::IA32MacroAssembler::emitPushl_m):
3143 (KJS::IA32MacroAssembler::emitPopl_m):
3144 (KJS::IA32MacroAssembler::getRelocatedAddress):
3146 2008-08-31 Mark Rowe <mrowe@apple.com>
3148 Reviewed by Oliver Hunt.
3150 Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them.
3153 (KJS::WRECompiler::parseParentheses):
3155 (KJS::WRECompiler::):
3157 2008-08-31 Mark Rowe <mrowe@apple.com>
3159 Reviewed by Oliver Hunt.
3161 Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled.
3164 (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum.
3165 (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register.
3166 (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag.
3168 2008-08-30 Mark Rowe <mrowe@apple.com>
3170 Reviewed by Oliver Hunt.
3172 Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance.
3173 This shows up as a 0.6% progression on SunSpider on my machine.
3175 Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out.
3178 (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc.
3179 * kjs/regexp.cpp: Ditto.
3180 * masm/IA32MacroAsm.h:
3181 (KJS::JITCodeBuffer::growBuffer):
3182 (KJS::JITCodeBuffer::JITCodeBuffer):
3183 (KJS::JITCodeBuffer::~JITCodeBuffer):
3184 (KJS::JITCodeBuffer::putByte):
3185 (KJS::JITCodeBuffer::putShort):
3186 (KJS::JITCodeBuffer::putInt):
3187 (KJS::JITCodeBuffer::reset):
3188 (KJS::JITCodeBuffer::copy):
3190 2008-08-29 Oliver Hunt <oliver@apple.com>
3194 Roll out previous patch as it causes a 5% performance regression
3196 * JavaScriptCore.xcodeproj/project.pbxproj:
3199 (KJS::CTI::privateCompile):
3201 (KJS::CodeBlock::~CodeBlock):
3202 * masm/IA32MacroAsm.h:
3203 (KJS::JITCodeBuffer::JITCodeBuffer):
3204 (KJS::JITCodeBuffer::putByte):
3205 (KJS::JITCodeBuffer::putShort):
3206 (KJS::JITCodeBuffer::putInt):
3207 (KJS::JITCodeBuffer::getEIP):
3208 (KJS::JITCodeBuffer::start):
3209 (KJS::JITCodeBuffer::getOffset):
3210 (KJS::JITCodeBuffer::reset):
3211 (KJS::JITCodeBuffer::copy):
3212 (KJS::IA32MacroAssembler::emitModRm_rr):
3213 (KJS::IA32MacroAssembler::emitModRm_rm):
3214 (KJS::IA32MacroAssembler::emitModRm_rmsib):
3215 (KJS::IA32MacroAssembler::IA32MacroAssembler):
3216 (KJS::IA32MacroAssembler::emitInt3):
3217 (KJS::IA32MacroAssembler::emitPushl_r):
3218 (KJS::IA32MacroAssembler::emitPopl_r):
3219 (KJS::IA32MacroAssembler::emitMovl_rr):
3220 (KJS::IA32MacroAssembler::emitAddl_rr):
3221 (KJS::IA32MacroAssembler::emitAddl_i8r):
3222 (KJS::IA32MacroAssembler::emitAddl_i32r):
3223 (KJS::IA32MacroAssembler::emitAddl_mr):
3224 (KJS::IA32MacroAssembler::emitAndl_rr):
3225 (KJS::IA32MacroAssembler::emitAndl_i32r):
3226 (KJS::IA32MacroAssembler::emitCmpl_i8r):
3227 (KJS::IA32MacroAssembler::emitCmpl_rr):
3228 (KJS::IA32MacroAssembler::emitCmpl_rm):
3229 (KJS::IA32MacroAssembler::emitCmpl_i32r):
3230 (KJS::IA32MacroAssembler::emitCmpl_i32m):
3231 (KJS::IA32MacroAssembler::emitCmpw_rm):
3232 (KJS::IA32MacroAssembler::emitOrl_rr):
3233 (KJS::IA32MacroAssembler::emitOrl_i8r):
3234 (KJS::IA32MacroAssembler::emitSubl_rr):
3235 (KJS::IA32MacroAssembler::emitSubl_i8r):
3236 (KJS::IA32MacroAssembler::emitSubl_i32r):
3237 (KJS::IA32MacroAssembler::emitSubl_mr):
3238 (KJS::IA32MacroAssembler::emitTestl_i32r):
3239 (KJS::IA32MacroAssembler::emitTestl_rr):
3240 (KJS::IA32MacroAssembler::emitXorl_i8r):
3241 (KJS::IA32MacroAssembler::emitXorl_rr):
3242 (KJS::IA32MacroAssembler::emitSarl_i8r):
3243 (KJS::IA32MacroAssembler::emitSarl_CLr):
3244 (KJS::IA32MacroAssembler::emitShl_i8r):
3245 (KJS::IA32MacroAssembler::emitShll_CLr):
3246 (KJS::IA32MacroAssembler::emitMull_rr):
3247 (KJS::IA32MacroAssembler::emitIdivl_r):
3248 (KJS::IA32MacroAssembler::emitCdq):
3249 (KJS::IA32MacroAssembler::emitMovl_mr):
3250 (KJS::IA32MacroAssembler::emitMovzwl_mr):
3251 (KJS::IA32MacroAssembler::emitMovl_rm):
3252 (KJS::IA32MacroAssembler::emitMovl_i32r):
3253 (KJS::IA32MacroAssembler::emitMovl_i32m):
3254 (KJS::IA32MacroAssembler::emitLeal_mr):
3255 (KJS::IA32MacroAssembler::emitRet):
3256 (KJS::IA32MacroAssembler::emitJmpN_r):
3257 (KJS::IA32MacroAssembler::emitJmpN_m):
3258 (KJS::IA32MacroAssembler::emitCall):
3259 (KJS::IA32MacroAssembler::label):
3260 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
3261 (KJS::IA32MacroAssembler::emitUnlinkedJne):
3262 (KJS::IA32MacroAssembler::emitUnlinkedJe):
3263 (KJS::IA32MacroAssembler::emitUnlinkedJl):
3264 (KJS::IA32MacroAssembler::emitUnlinkedJle):
3265 (KJS::IA32MacroAssembler::emitUnlinkedJge):
3266 (KJS::IA32MacroAssembler::emitUnlinkedJae):
3267 (KJS::IA32MacroAssembler::emitUnlinkedJo):
3268 (KJS::IA32MacroAssembler::link):
3270 (KJS::WRECompiler::compilePattern):
3271 (KJS::WRECompiler::compile):
3274 2008-08-29 Mark Rowe <mrowe@apple.com>
3276 Reviewed by Oliver Hunt.
3278 Have JITCodeBuffer manage a Vector containing the generated code so that it can grow
3279 as needed when generating code for a large function. This fixes all six remaining failures
3280 in Mozilla tests in both debug and release builds.
3283 (KJS::CTI::privateCompile):
3285 (KJS::CodeBlock::~CodeBlock):
3286 * masm/IA32MacroAsm.h:
3287 (KJS::JITCodeBuffer::putByte):
3288 (KJS::JITCodeBuffer::putShort):
3289 (KJS::JITCodeBuffer::putInt):
3290 (KJS::JITCodeBuffer::getEIP):
3291 (KJS::JITCodeBuffer::start):
3292 (KJS::JITCodeBuffer::getOffset):
3293 (KJS::JITCodeBuffer::getCode):
3294 (KJS::IA32MacroAssembler::emitModRm_rr):
3296 (KJS::WRECompiler::compilePattern):
3299 2008-08-29 Mark Rowe <mrowe@apple.com>
3301 Reviewed by Oliver Hunt.
3303 Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests.
3306 (KJS::WRECompiler::parseOctalEscape):
3307 (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero.
3308 Add a FIXME about treating invalid backreferences as octal escapes in the future.
3310 (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than
3313 (WTF::isASCIIOctalDigit):
3315 2008-08-29 Sam Weinig <sam@webkit.org>
3317 Reviewed by Mark Rowe.
3319 Pass vPC to instanceof method. Fixes 2 mozilla tests in debug.
3322 (KJS::CTI::privateCompile_pass2_Main):
3324 (KJS::Machine::cti_op_instanceof):
3326 2008-08-29 Sam Weinig <sam@webkit.org>
3328 Reviewed by Mark Rowe.
3330 Pass vPCs to resolve methods for correct exception creation. Fixes
3331 17 mozilla tests in debug.
3334 (KJS::CTI::privateCompile_pass2_Main):
3337 (KJS::Machine::cti_op_resolve):
3338 (KJS::Machine::cti_op_resolve_func):
3339 (KJS::Machine::cti_op_resolve_skip):
3340 (KJS::Machine::cti_op_resolve_with_base):
3342 2008-08-29 Gavin Barraclough <barraclough@apple.com>
3344 Reviewed by Oliver Hunt.
3346 Remembering to actually throw the exception passed to op throw helps.
3347 Regressions 19 -> 6.
3350 (KJS::Machine::cti_op_throw):
3351 (KJS::Machine::cti_vm_throw):
3353 2008-08-29 Gavin Barraclough <barraclough@apple.com>
3355 Reviewed by Sam Weinig.
3357 Support for exception unwinding the stack.
3359 Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address
3360 is now preserved on entry to a JIT code function (if we preserve lazily we need
3361 restore the native return address during exception stack unwind). This takes
3362 the number of regressions down from ~150 to 19.
3366 (KJS::CTI::emitExceptionCheck):
3367 (KJS::CTI::compileOpCall):
3368 (KJS::CTI::privateCompile_pass2_Main):
3369 (KJS::CTI::privateCompile):
3373 (KJS::Machine::throwException):
3374 (KJS::Machine::cti_op_call_JSFunction):
3375 (KJS::Machine::cti_op_call_NotJSFunction):
3376 (KJS::Machine::cti_op_construct_JSConstruct):
3377 (KJS::Machine::cti_op_construct_NotJSConstruct):
3378 (KJS::Machine::cti_op_throw):
3379 (KJS::Machine::cti_vm_throw):
3381 2008-08-29 Mark Rowe <mrowe@apple.com>
3383 Reviewed by Oliver Hunt.
3385 Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled.
3388 (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches
3389 succeeded, jump to failure.
3390 (KJS::WRECompiler::compilePattern): Restore and increment the current position stored
3391 on the stack to ensure that it will be reset to the correct position after a failed
3392 match has consumed input.
3394 2008-08-29 Mark Rowe <mrowe@apple.com>
3396 Reviewed by Oliver Hunt.
3398 Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled.
3399 A backreference with a quantifier would get stuck in an infinite
3400 loop if the captured range was empty.
3403 (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range
3404 was empty, do not attempt to match the backreference.
3405 (KJS::WRECompiler::parseBackreferenceQuantifier):
3407 (KJS::Quantifier::):
3409 2008-08-28 Sam Weinig <sam@webkit.org>
3411 Reviewed by Oliver Hunt.
3416 (KJS::CTI::privateCompile_pass1_Scan):
3417 (KJS::CTI::privateCompile_pass2_Main):
3419 (KJS::Machine::debug):
3420 (KJS::Machine::privateExecute):
3421 (KJS::Machine::cti_op_debug):
3424 2008-08-28 Sam Weinig <sam@webkit.org>
3426 Reviewed by Gavin Barraclough and Geoff Garen.
3428 Implement op_switch_string fixing 1 mozilla test and one test in fast/js.
3431 (KJS::CTI::privateCompile_pass1_Scan):
3432 (KJS::CTI::privateCompile_pass2_Main):
3433 (KJS::CTI::privateCompile):
3435 (KJS::SwitchRecord::):
3436 (KJS::SwitchRecord::SwitchRecord):
3438 (KJS::CodeBlock::dump):
3440 (KJS::ExpressionRangeInfo::):
3441 (KJS::StringJumpTable::offsetForValue):
3442 (KJS::StringJumpTable::ctiForValue):
3443 (KJS::SimpleJumpTable::add):
3444 (KJS::SimpleJumpTable::ctiForValue):
3445 * VM/CodeGenerator.cpp:
3446 (KJS::prepareJumpTableForStringSwitch):
3448 (KJS::Machine::privateExecute):
3449 (KJS::Machine::cti_op_switch_string):
3452 2008-08-28 Gavin Barraclough <barraclough@apple.com>
3454 Reviewed by Oliver Hunt.
3456 Do not recurse on the machine stack when executing op_call.
3459 (KJS::CTI::emitGetPutArg):
3460 (KJS::CTI::emitPutArg):
3461 (KJS::CTI::emitPutArgConstant):
3462 (KJS::CTI::compileOpCall):
3463 (KJS::CTI::privateCompile_pass2_Main):
3464 (KJS::CTI::privateCompile):
3467 (KJS::CTI::compile):
3468 (KJS::CTI::execute):
3471 (KJS::Machine::Machine):
3472 (KJS::Machine::execute):
3473 (KJS::Machine::cti_op_call_JSFunction):
3474 (KJS::Machine::cti_op_call_NotJSFunction):
3475 (KJS::Machine::cti_op_ret):
3476 (KJS::Machine::cti_op_construct_JSConstruct):
3477 (KJS::Machine::cti_op_construct_NotJSConstruct):
3478 (KJS::Machine::cti_op_call_eval):
3481 (KJS::Register::Register):
3482 * VM/RegisterFile.h:
3483 (KJS::RegisterFile::):
3484 * kjs/InternalFunction.h:
3485 (KJS::InternalFunction::InternalFunction):
3487 (KJS::JSFunction::JSFunction):
3489 (KJS::ScopeChain::ScopeChain):
3490 * masm/IA32MacroAsm.h:
3491 (KJS::IA32MacroAssembler::):
3492 (KJS::IA32MacroAssembler::emitModRm_opm):
3493 (KJS::IA32MacroAssembler::emitCmpl_i32m):
3494 (KJS::IA32MacroAssembler::emitCallN_r):
3496 2008-08-28 Sam Weinig <sam@webkit.org>
3498 Reviewed by Mark Rowe.
3500 Exit instead of crashing in ctiUnsupported and ctiTimedOut.
3503 (KJS::ctiUnsupported):
3506 2008-08-28 Oliver Hunt <oliver@apple.com>
3508 Reviewed by Maciej Stachowiak.
3510 Implement codegen for op_jsr and op_sret.
3513 (KJS::CTI::privateCompile_pass1_Scan):
3514 (KJS::CTI::privateCompile_pass2_Main):
3515 (KJS::CTI::privateCompile):
3517 (KJS::CTI::JSRInfo::JSRInfo):
3518 * masm/IA32MacroAsm.h:
3519 (KJS::IA32MacroAssembler::emitJmpN_m):
3520 (KJS::IA32MacroAssembler::linkAbsoluteAddress):
3522 2008-08-28 Gavin Barraclough <barraclough@apple.com>
3524 Reviewed by Oliver Hunt.
3526 Initial support for exceptions (throw / catch must occur in same CodeBlock).
3529 (KJS::CTI::emitExceptionCheck):
3530 (KJS::CTI::emitCall):
3531 (KJS::CTI::privateCompile_pass2_Main):
3532 (KJS::CTI::privateCompile_pass4_SlowCases):
3533 (KJS::CTI::privateCompile):
3536 (KJS::CodeBlock::nativeExceptionCodeForHandlerVPC):
3538 * VM/CodeGenerator.cpp:
3539 (KJS::CodeGenerator::emitCatch):
3541 (KJS::Machine::throwException):
3542 (KJS::Machine::privateExecute):
3543 (KJS::ctiUnsupported):
3545 (KJS::Machine::cti_op_add):
3546 (KJS::Machine::cti_op_pre_inc):
3547 (KJS::Machine::cti_timeout_check):
3548 (KJS::Machine::cti_op_loop_if_less):
3549 (KJS::Machine::cti_op_put_by_id):
3550 (KJS::Machine::cti_op_get_by_id):
3551 (KJS::Machine::cti_op_instanceof):
3552 (KJS::Machine::cti_op_del_by_id):
3553 (KJS::Machine::cti_op_mul):
3554 (KJS::Machine::cti_op_call):
3555 (KJS::Machine::cti_op_resolve):
3556 (KJS::Machine::cti_op_construct):
3557 (KJS::Machine::cti_op_get_by_val):
3558 (KJS::Machine::cti_op_resolve_func):
3559 (KJS::Machine::cti_op_sub):
3560 (KJS::Machine::cti_op_put_by_val):
3561 (KJS::Machine::cti_op_lesseq):
3562 (KJS::Machine::cti_op_loop_if_true):
3563 (KJS::Machine::cti_op_negate):
3564 (KJS::Machine::cti_op_resolve_skip):
3565 (KJS::Machine::cti_op_div):
3566 (KJS::Machine::cti_op_pre_dec):
3567 (KJS::Machine::cti_op_jless):
3568 (KJS::Machine::cti_op_not):
3569 (KJS::Machine::cti_op_jtrue):
3570 (KJS::Machine::cti_op_post_inc):
3571 (KJS::Machine::cti_op_eq):
3572 (KJS::Machine::cti_op_lshift):
3573 (KJS::Machine::cti_op_bitand):
3574 (KJS::Machine::cti_op_rshift):
3575 (KJS::Machine::cti_op_bitnot):
3576 (KJS::Machine::cti_op_resolve_with_base):
3577 (KJS::Machine::cti_op_mod):
3578 (KJS::Machine::cti_op_less):
3579 (KJS::Machine::cti_op_neq):
3580 (KJS::Machine::cti_op_post_dec):
3581 (KJS::Machine::cti_op_urshift):
3582 (KJS::Machine::cti_op_bitxor):
3583 (KJS::Machine::cti_op_bitor):
3584 (KJS::Machine::cti_op_call_eval):
3585 (KJS::Machine::cti_op_throw):
3586 (KJS::Machine::cti_op_push_scope):
3587 (KJS::Machine::cti_op_stricteq):
3588 (KJS::Machine::cti_op_nstricteq):