1 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
7 * JavaScriptCore.xcodeproj/project.pbxproj:
9 2008-09-09 Oliver Hunt <oliver@apple.com>
11 Reviewed by Maciej Stachowiak.
13 Add optimised access to known properties on the global object.
15 Improve cross scope access to the global object by emitting
16 code to access it directly rather than by walking the scope chain.
18 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
21 (JSC::CTI::privateCompileMainPass):
22 (JSC::CTI::emitGetVariableObjectRegister):
23 (JSC::CTI::emitPutVariableObjectRegister):
26 (JSC::CodeBlock::dump):
27 * VM/CodeGenerator.cpp:
28 (JSC::CodeGenerator::findScopedProperty):
29 (JSC::CodeGenerator::emitResolve):
30 (JSC::CodeGenerator::emitGetScopedVar):
31 (JSC::CodeGenerator::emitPutScopedVar):
34 (JSC::Machine::privateExecute):
37 (JSC::FunctionCallResolveNode::emitCode):
38 (JSC::PostfixResolveNode::emitCode):
39 (JSC::PrefixResolveNode::emitCode):
40 (JSC::ReadModifyResolveNode::emitCode):
41 (JSC::AssignResolveNode::emitCode):
43 2008-09-10 Maciej Stachowiak <mjs@apple.com>
47 - enable polymorphic inline caching of properties of primitives
49 1.012x speedup on SunSpider.
51 We create special structure IDs for JSString and
52 JSNumberCell. Unlike normal structure IDs, these cannot hold the
53 true prototype. Due to JS autoboxing semantics, the prototype used
54 when looking up string or number properties depends on the lexical
55 global object of the call site, not the creation site. Thus we
56 enable StructureIDs to handle this quirk for primitives.
58 Everything else should be straightforward.
61 (JSC::CTI::privateCompileGetByIdProto):
62 (JSC::CTI::privateCompileGetByIdChain):
64 (JSC::CTI::compileGetByIdProto):
65 (JSC::CTI::compileGetByIdChain):
66 * VM/JSPropertyNameIterator.h:
67 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
69 (JSC::Machine::Machine):
70 (JSC::cachePrototypeChain):
71 (JSC::Machine::tryCachePutByID):
72 (JSC::Machine::tryCacheGetByID):
73 (JSC::Machine::privateExecute):
74 (JSC::Machine::tryCTICachePutByID):
75 (JSC::Machine::tryCTICacheGetByID):
77 (JSC::GetterSetter::GetterSetter):
79 * kjs/JSGlobalData.cpp:
80 (JSC::JSGlobalData::JSGlobalData):
82 * kjs/JSGlobalObject.h:
83 (JSC::StructureID::prototypeForLookup):
85 (JSC::JSNumberCell::JSNumberCell):
88 (JSC::JSObject::prototype):
94 (JSC::JSString::JSString):
96 (JSC::jsSingleCharacterString):
97 (JSC::jsSingleCharacterSubstring):
98 (JSC::jsNontrivialString):
99 * kjs/SmallStrings.cpp:
100 (JSC::SmallStrings::createEmptyString):
101 (JSC::SmallStrings::createSingleCharacterString):
102 * kjs/StructureID.cpp:
103 (JSC::StructureID::StructureID):
104 (JSC::StructureID::addPropertyTransition):
105 (JSC::StructureID::getterSetterTransition):
106 (JSC::StructureIDChain::StructureIDChain):
108 (JSC::StructureID::create):
109 (JSC::StructureID::storedPrototype):
111 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
113 Reviewed by Sam Weinig.
115 https://bugs.webkit.org/show_bug.cgi?id=20746
117 Added WINCE platform macro.
121 2008-09-09 Sam Weinig <sam@webkit.org>
123 Reviewed by Mark Rowe.
125 Remove unnecessary override of getOffset.
127 Sunspider reports this as a .6% progression.
129 * JavaScriptCore.exp:
131 (JSC::JSObject::getDirectLocation):
132 (JSC::JSObject::getOwnPropertySlotForWrite):
133 (JSC::JSObject::putDirect):
134 * kjs/PropertyMap.cpp:
137 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
139 Reviewed by Maciej Stachowiak.
141 Bug 20759: Remove MacroAssembler
142 <https://bugs.webkit.org/show_bug.cgi?id=20759>
144 Remove MacroAssembler and move its functionality to X86Assembler.
146 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
147 * JavaScriptCore.xcodeproj/project.pbxproj:
149 (JSC::CTI::emitGetArg):
150 (JSC::CTI::emitGetPutArg):
151 (JSC::CTI::emitPutArg):
152 (JSC::CTI::emitPutCTIParam):
153 (JSC::CTI::emitGetCTIParam):
154 (JSC::CTI::emitPutToCallFrameHeader):
155 (JSC::CTI::emitGetFromCallFrameHeader):
156 (JSC::CTI::emitPutResult):
157 (JSC::CTI::emitDebugExceptionCheck):
158 (JSC::CTI::emitJumpSlowCaseIfNotImm):
159 (JSC::CTI::emitJumpSlowCaseIfNotImms):
160 (JSC::CTI::emitFastArithDeTagImmediate):
161 (JSC::CTI::emitFastArithReTagImmediate):
162 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
163 (JSC::CTI::emitFastArithImmToInt):
164 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
165 (JSC::CTI::emitFastArithIntToImmNoCheck):
166 (JSC::CTI::compileOpCall):
167 (JSC::CTI::emitSlowScriptCheck):
168 (JSC::CTI::privateCompileMainPass):
169 (JSC::CTI::privateCompileSlowCases):
170 (JSC::CTI::privateCompile):
171 (JSC::CTI::privateCompileGetByIdSelf):
172 (JSC::CTI::privateCompileGetByIdProto):
173 (JSC::CTI::privateCompileGetByIdChain):
174 (JSC::CTI::privateCompilePutByIdReplace):
175 (JSC::CTI::privateArrayLengthTrampoline):
176 (JSC::CTI::privateStringLengthTrampoline):
177 (JSC::CTI::compileRegExp):
179 (JSC::CallRecord::CallRecord):
180 (JSC::JmpTable::JmpTable):
181 (JSC::SlowCaseEntry::SlowCaseEntry):
182 (JSC::CTI::JSRInfo::JSRInfo):
183 * masm/MacroAssembler.h: Removed.
184 * masm/MacroAssemblerWin.cpp: Removed.
185 * masm/X86Assembler.h:
186 (JSC::X86Assembler::emitConvertToFastCall):
187 (JSC::X86Assembler::emitRestoreArgumentReference):
189 (JSC::WRECGenerator::WRECGenerator):
190 (JSC::WRECParser::WRECParser):
192 2008-09-09 Sam Weinig <sam@webkit.org>
194 Reviewed by Cameron Zwarich.
196 Don't waste the first item in the PropertyStorage.
198 - Fix typo (makingCount -> markingCount)
199 - Remove undefined method declaration.
201 No change on Sunspider.
204 (JSC::JSObject::mark):
205 * kjs/PropertyMap.cpp:
206 (JSC::PropertyMap::put):
207 (JSC::PropertyMap::remove):
208 (JSC::PropertyMap::getOffset):
209 (JSC::PropertyMap::insert):
210 (JSC::PropertyMap::rehash):
211 (JSC::PropertyMap::resizePropertyStorage):
212 (JSC::PropertyMap::checkConsistency):
214 (JSC::PropertyMap::markingCount): Fix typo.
216 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
220 Speculative Windows build fix.
222 * masm/MacroAssemblerWin.cpp:
223 (JSC::MacroAssembler::emitConvertToFastCall):
224 (JSC::MacroAssembler::emitRestoreArgumentReference):
226 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
228 Reviewed by Maciej Stachowiak.
230 Bug 20755: Create an X86 namespace for register names and other things
231 <https://bugs.webkit.org/show_bug.cgi?id=20755>
233 Create an X86 namespace to put X86 register names. Perhaps I will move
234 opcode names here later as well.
237 (JSC::CTI::emitGetArg):
238 (JSC::CTI::emitGetPutArg):
239 (JSC::CTI::emitPutArg):
240 (JSC::CTI::emitPutArgConstant):
241 (JSC::CTI::emitPutCTIParam):
242 (JSC::CTI::emitGetCTIParam):
243 (JSC::CTI::emitPutToCallFrameHeader):
244 (JSC::CTI::emitGetFromCallFrameHeader):
245 (JSC::CTI::emitPutResult):
246 (JSC::CTI::emitDebugExceptionCheck):
247 (JSC::CTI::emitJumpSlowCaseIfNotImms):
248 (JSC::CTI::compileOpCall):
249 (JSC::CTI::emitSlowScriptCheck):
250 (JSC::CTI::privateCompileMainPass):
251 (JSC::CTI::privateCompileSlowCases):
252 (JSC::CTI::privateCompile):
253 (JSC::CTI::privateCompileGetByIdSelf):
254 (JSC::CTI::privateCompileGetByIdProto):
255 (JSC::CTI::privateCompileGetByIdChain):
256 (JSC::CTI::privateCompilePutByIdReplace):
257 (JSC::CTI::privateArrayLengthTrampoline):
258 (JSC::CTI::privateStringLengthTrampoline):
259 (JSC::CTI::compileRegExp):
261 * masm/X86Assembler.h:
263 (JSC::X86Assembler::emitModRm_rm):
264 (JSC::X86Assembler::emitModRm_rm_Unchecked):
265 (JSC::X86Assembler::emitModRm_rmsib):
267 (JSC::WRECGenerator::generateNonGreedyQuantifier):
268 (JSC::WRECGenerator::generateGreedyQuantifier):
269 (JSC::WRECGenerator::generateParentheses):
270 (JSC::WRECGenerator::generateBackreference):
271 (JSC::WRECGenerator::gernerateDisjunction):
274 2008-09-09 Sam Weinig <sam@webkit.org>
276 Reviewed by Geoffrey Garen.
278 Remove unnecessary friend declaration.
282 2008-09-09 Sam Weinig <sam@webkit.org>
284 Reviewed by Geoffrey Garen.
286 Replace uses of PropertyMap::get and PropertyMap::getLocation with
287 PropertyMap::getOffset.
289 Sunspider reports this as a .6% improvement.
291 * JavaScriptCore.exp:
293 (JSC::JSObject::put):
294 (JSC::JSObject::deleteProperty):
295 (JSC::JSObject::getPropertyAttributes):
297 (JSC::JSObject::getDirect):
298 (JSC::JSObject::getDirectLocation):
299 (JSC::JSObject::locationForOffset):
300 * kjs/PropertyMap.cpp:
301 (JSC::PropertyMap::remove):
302 (JSC::PropertyMap::getOffset):
305 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
307 Reviewed by Sam Weinig.
309 Bug 20754: Remove emit prefix from assembler opcode methods
310 <https://bugs.webkit.org/show_bug.cgi?id=20754>
313 (JSC::CTI::emitGetArg):
314 (JSC::CTI::emitGetPutArg):
315 (JSC::CTI::emitPutArg):
316 (JSC::CTI::emitPutArgConstant):
317 (JSC::CTI::emitPutCTIParam):
318 (JSC::CTI::emitGetCTIParam):
319 (JSC::CTI::emitPutToCallFrameHeader):
320 (JSC::CTI::emitGetFromCallFrameHeader):
321 (JSC::CTI::emitPutResult):
322 (JSC::CTI::emitDebugExceptionCheck):
323 (JSC::CTI::emitCall):
324 (JSC::CTI::emitJumpSlowCaseIfNotImm):
325 (JSC::CTI::emitJumpSlowCaseIfNotImms):
326 (JSC::CTI::emitFastArithDeTagImmediate):
327 (JSC::CTI::emitFastArithReTagImmediate):
328 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
329 (JSC::CTI::emitFastArithImmToInt):
330 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
331 (JSC::CTI::emitFastArithIntToImmNoCheck):
332 (JSC::CTI::compileOpCall):
333 (JSC::CTI::emitSlowScriptCheck):
334 (JSC::CTI::privateCompileMainPass):
335 (JSC::CTI::privateCompileSlowCases):
336 (JSC::CTI::privateCompile):
337 (JSC::CTI::privateCompileGetByIdSelf):
338 (JSC::CTI::privateCompileGetByIdProto):
339 (JSC::CTI::privateCompileGetByIdChain):
340 (JSC::CTI::privateCompilePutByIdReplace):
341 (JSC::CTI::privateArrayLengthTrampoline):
342 (JSC::CTI::privateStringLengthTrampoline):
343 (JSC::CTI::compileRegExp):
344 * masm/MacroAssemblerWin.cpp:
345 (JSC::MacroAssembler::emitConvertToFastCall):
346 (JSC::MacroAssembler::emitRestoreArgumentReference):
347 * masm/X86Assembler.h:
348 (JSC::X86Assembler::pushl_r):
349 (JSC::X86Assembler::pushl_m):
350 (JSC::X86Assembler::popl_r):
351 (JSC::X86Assembler::popl_m):
352 (JSC::X86Assembler::movl_rr):
353 (JSC::X86Assembler::addl_rr):
354 (JSC::X86Assembler::addl_i8r):
355 (JSC::X86Assembler::addl_i32r):
356 (JSC::X86Assembler::addl_mr):
357 (JSC::X86Assembler::andl_rr):
358 (JSC::X86Assembler::andl_i32r):
359 (JSC::X86Assembler::cmpl_i8r):
360 (JSC::X86Assembler::cmpl_rr):
361 (JSC::X86Assembler::cmpl_rm):
362 (JSC::X86Assembler::cmpl_i32r):
363 (JSC::X86Assembler::cmpl_i32m):
364 (JSC::X86Assembler::cmpw_rm):
365 (JSC::X86Assembler::orl_rr):
366 (JSC::X86Assembler::subl_rr):
367 (JSC::X86Assembler::subl_i8r):
368 (JSC::X86Assembler::subl_i32r):
369 (JSC::X86Assembler::subl_mr):
370 (JSC::X86Assembler::testl_i32r):
371 (JSC::X86Assembler::testl_rr):
372 (JSC::X86Assembler::xorl_i8r):
373 (JSC::X86Assembler::xorl_rr):
374 (JSC::X86Assembler::sarl_i8r):
375 (JSC::X86Assembler::sarl_CLr):
376 (JSC::X86Assembler::shl_i8r):
377 (JSC::X86Assembler::shll_CLr):
378 (JSC::X86Assembler::mull_rr):
379 (JSC::X86Assembler::idivl_r):
380 (JSC::X86Assembler::cdq):
381 (JSC::X86Assembler::movl_mr):
382 (JSC::X86Assembler::movzwl_mr):
383 (JSC::X86Assembler::movl_rm):
384 (JSC::X86Assembler::movl_i32r):
385 (JSC::X86Assembler::movl_i32m):
386 (JSC::X86Assembler::leal_mr):
387 (JSC::X86Assembler::ret):
388 (JSC::X86Assembler::jmp_r):
389 (JSC::X86Assembler::jmp_m):
390 (JSC::X86Assembler::call_r):
392 (JSC::WRECGenerator::generateBacktrack1):
393 (JSC::WRECGenerator::generateBacktrackBackreference):
394 (JSC::WRECGenerator::generateBackreferenceQuantifier):
395 (JSC::WRECGenerator::generateNonGreedyQuantifier):
396 (JSC::WRECGenerator::generateGreedyQuantifier):
397 (JSC::WRECGenerator::generatePatternCharacter):
398 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
399 (JSC::WRECGenerator::generateCharacterClassInverted):
400 (JSC::WRECGenerator::generateCharacterClass):
401 (JSC::WRECGenerator::generateParentheses):
402 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
403 (JSC::WRECGenerator::generateAssertionBOL):
404 (JSC::WRECGenerator::generateAssertionEOL):
405 (JSC::WRECGenerator::generateAssertionWordBoundary):
406 (JSC::WRECGenerator::generateBackreference):
407 (JSC::WRECGenerator::gernerateDisjunction):
409 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
411 Reviewed by Maciej Stachowiak.
413 Clean up the WREC code some more.
416 (JSC::CTI::compileRegExp):
418 (JSC::getCharacterClassNewline):
419 (JSC::getCharacterClassDigits):
420 (JSC::getCharacterClassSpaces):
421 (JSC::getCharacterClassWordchar):
422 (JSC::getCharacterClassNondigits):
423 (JSC::getCharacterClassNonspaces):
424 (JSC::getCharacterClassNonwordchar):
425 (JSC::WRECGenerator::generateBacktrack1):
426 (JSC::WRECGenerator::generateBacktrackBackreference):
427 (JSC::WRECGenerator::generateBackreferenceQuantifier):
428 (JSC::WRECGenerator::generateNonGreedyQuantifier):
429 (JSC::WRECGenerator::generateGreedyQuantifier):
430 (JSC::WRECGenerator::generatePatternCharacter):
431 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
432 (JSC::WRECGenerator::generateCharacterClassInverted):
433 (JSC::WRECGenerator::generateCharacterClass):
434 (JSC::WRECGenerator::generateParentheses):
435 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
436 (JSC::WRECGenerator::generateAssertionBOL):
437 (JSC::WRECGenerator::generateAssertionEOL):
438 (JSC::WRECGenerator::generateAssertionWordBoundary):
439 (JSC::WRECGenerator::generateBackreference):
440 (JSC::WRECGenerator::gernerateDisjunction):
441 (JSC::WRECParser::parseCharacterClass):
442 (JSC::WRECParser::parseEscape):
443 (JSC::WRECParser::parseTerm):
446 2008-09-09 Mark Rowe <mrowe@apple.com>
448 Build fix, rubber-stamped by Anders Carlsson.
450 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
452 * JavaScriptCore.xcodeproj/project.pbxproj:
454 2008-09-09 Mark Rowe <mrowe@apple.com>
456 Rubber-stamped by Oliver Hunt.
458 Fix builds using the "debug" variant.
460 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
461 and Release configurations.
463 * Configurations/JavaScriptCore.xcconfig:
464 * DerivedSources.make:
465 * JavaScriptCore.Debug.exp: Removed.
466 * JavaScriptCore.base.exp: Removed.
467 * JavaScriptCore.exp: Added.
468 * JavaScriptCore.xcodeproj/project.pbxproj:
469 * kjs/identifier.cpp:
470 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
471 there is no overhead in Release builds.
472 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
474 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
475 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
477 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
479 Reviewed by Maciej Stachowiak.
481 Clean up WREC a bit to bring it closer to our coding style guidelines.
485 (JSC::getCharacterClass_newline):
486 (JSC::getCharacterClass_d):
487 (JSC::getCharacterClass_s):
488 (JSC::getCharacterClass_w):
489 (JSC::getCharacterClass_D):
490 (JSC::getCharacterClass_S):
491 (JSC::getCharacterClass_W):
492 (JSC::CharacterClassConstructor::append):
493 (JSC::WRECGenerator::generateNonGreedyQuantifier):
494 (JSC::WRECGenerator::generateGreedyQuantifier):
495 (JSC::WRECGenerator::generateCharacterClassInverted):
496 (JSC::WRECParser::parseQuantifier):
497 (JSC::WRECParser::parsePatternCharacterQualifier):
498 (JSC::WRECParser::parseCharacterClassQuantifier):
499 (JSC::WRECParser::parseBackreferenceQuantifier):
502 (JSC::Quantifier::Quantifier):
504 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
506 Reviewed by Alexey Proskuryakov.
508 Try MIME charset names before trying IANA names
509 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
511 * wtf/StringExtras.h: (strcasecmp): Added.
513 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
515 Reviewed by Mark Rowe.
517 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
518 <https://bugs.webkit.org/show_bug.cgi?id=20719>
519 <rdar://problem/6205787>
521 Fix a typo in the case-insensitive matching of character patterns.
524 (JSC::WRECGenerator::generatePatternCharacter):
526 2008-09-09 Maciej Stachowiak <mjs@apple.com>
528 Reviewed by Sam Weinig.
530 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
532 1.012x speedup on SunSpider.
534 * kjs/MathObject.cpp:
535 (JSC::MathObject::getOwnPropertySlot):
537 (JSC::setUpStaticFunctionSlot):
539 (JSC::getStaticPropertySlot):
541 2008-09-08 Sam Weinig <sam@webkit.org>
543 Reviewed by Maciej Stachowiak and Oliver Hunt.
545 Split storage of properties out of the PropertyMap and into the JSObject
546 to allow sharing PropertyMap on the StructureID. In order to get this
547 function correctly, the StructureID's transition mappings were changed to
548 transition based on property name and attribute pairs, instead of just
551 - Removes the single property optimization now that the PropertyMap is shared.
552 This will be replaced by in-lining some values on the JSObject.
554 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
556 * JavaScriptCore.base.exp:
558 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
559 (JSC::CTI::privateCompileGetByIdProto): Ditto.
560 (JSC::CTI::privateCompileGetByIdChain): Ditto.
561 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
563 (JSC::JSObject::mark): Mark the PropertyStorage.
564 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
565 (JSC::JSObject::deleteProperty): Ditto.
566 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
567 (JSC::JSObject::defineSetter): Ditto.
568 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
569 (JSC::JSObject::getPropertyNames): Ditto.
570 (JSC::JSObject::removeDirect): Ditto.
571 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
572 (JSC::JSObject::propertyStorage): return the PropertyStorage.
573 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
574 (JSC::JSObject::getDirectLocation): Ditto.
575 (JSC::JSObject::offsetForLocation): Compute location directly.
576 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
577 (JSC::JSObject::hasGetterSetterProperties): Ditto.
578 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
579 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
580 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
581 (JSC::JSObject::getOwnPropertySlot): Ditto.
582 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
583 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
584 (JSC::PropertyMap::checkConsistency):
585 (JSC::PropertyMap::operator=):
586 (JSC::PropertyMap::~PropertyMap):
587 (JSC::PropertyMap::get):
588 (JSC::PropertyMap::getLocation):
589 (JSC::PropertyMap::put):
590 (JSC::PropertyMap::getOffset):
591 (JSC::PropertyMap::insert):
592 (JSC::PropertyMap::expand):
593 (JSC::PropertyMap::rehash):
594 (JSC::PropertyMap::createTable):
595 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
596 (JSC::PropertyMap::remove):
597 (JSC::PropertyMap::getEnumerablePropertyNames):
599 (JSC::PropertyMapEntry::PropertyMapEntry):
600 (JSC::PropertyMap::isEmpty):
601 (JSC::PropertyMap::size):
602 (JSC::PropertyMap::makingCount):
603 (JSC::PropertyMap::PropertyMap):
605 * kjs/StructureID.cpp:
606 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
608 (JSC::StructureID::toDictionaryTransition): Copy the map.
609 (JSC::StructureID::changePrototypeTransition): Copy the map.
610 (JSC::StructureID::getterSetterTransition): Copy the map.
611 (JSC::StructureID::~StructureID):
613 (JSC::TransitionTableHash::hash): Custom hash for transition map.
614 (JSC::TransitionTableHash::equal): Ditto.
615 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
616 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
617 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
618 (JSC::StructureID::propertyMap): Added.
620 2008-09-08 Oliver Hunt <oliver@apple.com>
622 Reviewed by Mark Rowe.
624 Bug 20694: Slow Script error pops up when running Dromaeo tests
626 Correct error in timeout logic where execution tick count would
627 be reset to incorrect value due to incorrect offset and indirection.
628 Codegen for the slow script dialog was factored out into a separate
629 method (emitSlowScriptCheck) rather than having multiple copies of
630 the same code. Also added calls to generate slow script checks
631 for loop_if_less and loop_if_true opcodes.
634 (JSC::CTI::emitSlowScriptCheck):
635 (JSC::CTI::privateCompileMainPass):
636 (JSC::CTI::privateCompileSlowCases):
639 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
641 Reviewed by Maciej Stachowiak.
643 Remove references to the removed WRECompiler class.
648 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
650 Rubber-stamped by Mark Rowe.
652 Fix the build with CTI enabled but WREC disabled.
657 2008-09-08 Dan Bernstein <mitz@apple.com>
662 (JSC::StatementNode::):
665 2008-09-08 Kevin McCullough <kmccullough@apple.com>
669 <rdar://problem/6134407> Breakpoints in for loops, while loops or
670 conditions without curly braces don't break. (19306)
671 -Statement Lists already emit debug hooks but conditionals without
672 brackets are not lists.
675 (KJS::IfNode::emitCode):
676 (KJS::IfElseNode::emitCode):
677 (KJS::DoWhileNode::emitCode):
678 (KJS::WhileNode::emitCode):
679 (KJS::ForNode::emitCode):
680 (KJS::ForInNode::emitCode):
682 (KJS::StatementNode::):
685 2008-09-08 Maciej Stachowiak <mjs@apple.com>
687 Reviewed by Anders Carlsson.
689 - Cache the code generated for eval to speed up SunSpider and web sites
690 https://bugs.webkit.org/show_bug.cgi?id=20718
693 2.29x on date-format-tofte
695 Lots of real sites seem to get many hits on this cache as well,
696 including GMail, Google Spreadsheets, Slate and Digg (the last of
697 these gets over 100 hits on initial page load).
700 (JSC::EvalCodeCache::get):
702 (JSC::Machine::callEval):
703 (JSC::Machine::privateExecute):
704 (JSC::Machine::cti_op_call_eval):
707 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
709 Reviewed by Oliver Hunt.
711 Bug 20711: Change KJS prefix on preprocessor macros to JSC
712 <https://bugs.webkit.org/show_bug.cgi?id=20711>
714 * kjs/CommonIdentifiers.cpp:
715 (JSC::CommonIdentifiers::CommonIdentifiers):
716 * kjs/CommonIdentifiers.h:
717 * kjs/PropertySlot.h:
718 (JSC::PropertySlot::getValue):
719 (JSC::PropertySlot::putValue):
720 (JSC::PropertySlot::setValueSlot):
721 (JSC::PropertySlot::setValue):
722 (JSC::PropertySlot::setRegisterSlot):
727 (JSC::ExpressionNode::):
728 (JSC::StatementNode::):
730 (JSC::BooleanNode::):
732 (JSC::ImmediateNumberNode::):
736 (JSC::ResolveNode::):
737 (JSC::ElementNode::):
739 (JSC::PropertyNode::):
740 (JSC::PropertyListNode::):
741 (JSC::ObjectLiteralNode::):
742 (JSC::BracketAccessorNode::):
743 (JSC::DotAccessorNode::):
744 (JSC::ArgumentListNode::):
745 (JSC::ArgumentsNode::):
746 (JSC::NewExprNode::):
747 (JSC::EvalFunctionCallNode::):
748 (JSC::FunctionCallValueNode::):
749 (JSC::FunctionCallResolveNode::):
750 (JSC::FunctionCallBracketNode::):
751 (JSC::FunctionCallDotNode::):
752 (JSC::PrePostResolveNode::):
753 (JSC::PostfixResolveNode::):
754 (JSC::PostfixBracketNode::):
755 (JSC::PostfixDotNode::):
756 (JSC::PostfixErrorNode::):
757 (JSC::DeleteResolveNode::):
758 (JSC::DeleteBracketNode::):
759 (JSC::DeleteDotNode::):
760 (JSC::DeleteValueNode::):
762 (JSC::TypeOfResolveNode::):
763 (JSC::TypeOfValueNode::):
764 (JSC::PrefixResolveNode::):
765 (JSC::PrefixBracketNode::):
766 (JSC::PrefixDotNode::):
767 (JSC::PrefixErrorNode::):
768 (JSC::UnaryPlusNode::):
770 (JSC::BitwiseNotNode::):
771 (JSC::LogicalNotNode::):
777 (JSC::LeftShiftNode::):
778 (JSC::RightShiftNode::):
779 (JSC::UnsignedRightShiftNode::):
781 (JSC::GreaterNode::):
783 (JSC::GreaterEqNode::):
784 (JSC::ThrowableBinaryOpNode::):
785 (JSC::InstanceOfNode::):
788 (JSC::NotEqualNode::):
789 (JSC::StrictEqualNode::):
790 (JSC::NotStrictEqualNode::):
794 (JSC::LogicalOpNode::):
795 (JSC::ConditionalNode::):
796 (JSC::ReadModifyResolveNode::):
797 (JSC::AssignResolveNode::):
798 (JSC::ReadModifyBracketNode::):
799 (JSC::AssignBracketNode::):
800 (JSC::AssignDotNode::):
801 (JSC::ReadModifyDotNode::):
802 (JSC::AssignErrorNode::):
804 (JSC::VarDeclCommaNode::):
805 (JSC::ConstDeclNode::):
806 (JSC::ConstStatementNode::):
807 (JSC::EmptyStatementNode::):
808 (JSC::DebuggerStatementNode::):
809 (JSC::ExprStatementNode::):
810 (JSC::VarStatementNode::):
813 (JSC::DoWhileNode::):
816 (JSC::ContinueNode::):
823 (JSC::ParameterNode::):
825 (JSC::ProgramNode::):
827 (JSC::FunctionBodyNode::):
828 (JSC::FuncExprNode::):
829 (JSC::FuncDeclNode::):
830 (JSC::CaseClauseNode::):
831 (JSC::ClauseListNode::):
832 (JSC::CaseBlockNode::):
835 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
837 Reviewed by Maciej Stachowiak.
839 Bug 20704: Replace the KJS namespace
840 <https://bugs.webkit.org/show_bug.cgi?id=20704>
842 Rename the KJS namespace to JSC. There are still some uses of KJS in
843 preprocessor macros and comments, but these will also be changed some
844 time in the near future.
851 * API/JSCallbackConstructor.cpp:
852 * API/JSCallbackConstructor.h:
853 * API/JSCallbackFunction.cpp:
854 * API/JSCallbackFunction.h:
855 * API/JSCallbackObject.cpp:
856 * API/JSCallbackObject.h:
857 * API/JSCallbackObjectFunctions.h:
858 * API/JSClassRef.cpp:
859 (OpaqueJSClass::staticValues):
860 (OpaqueJSClass::staticFunctions):
862 * API/JSContextRef.cpp:
863 * API/JSObjectRef.cpp:
864 * API/JSProfilerPrivate.cpp:
865 * API/JSStringRef.cpp:
866 * API/JSValueRef.cpp:
868 * API/OpaqueJSString.cpp:
869 * API/OpaqueJSString.h:
870 * JavaScriptCore.Debug.exp:
871 * JavaScriptCore.base.exp:
877 * VM/CodeGenerator.cpp:
878 * VM/CodeGenerator.h:
879 * VM/ExceptionHelpers.cpp:
880 * VM/ExceptionHelpers.h:
882 * VM/JSPropertyNameIterator.cpp:
883 * VM/JSPropertyNameIterator.h:
891 * VM/RegisterFile.cpp:
895 * VM/SamplingTool.cpp:
897 * VM/SegmentedVector.h:
902 * kjs/ArrayConstructor.cpp:
903 * kjs/ArrayConstructor.h:
904 * kjs/ArrayPrototype.cpp:
905 * kjs/ArrayPrototype.h:
906 * kjs/BatchedTransitionOptimizer.h:
907 * kjs/BooleanConstructor.cpp:
908 * kjs/BooleanConstructor.h:
909 * kjs/BooleanObject.cpp:
910 * kjs/BooleanObject.h:
911 * kjs/BooleanPrototype.cpp:
912 * kjs/BooleanPrototype.h:
916 * kjs/CommonIdentifiers.cpp:
917 * kjs/CommonIdentifiers.h:
918 * kjs/ConstructData.cpp:
919 * kjs/ConstructData.h:
920 * kjs/DateConstructor.cpp:
921 * kjs/DateConstructor.h:
922 * kjs/DateInstance.cpp:
923 (JSC::DateInstance::msToGregorianDateTime):
924 * kjs/DateInstance.h:
927 * kjs/DatePrototype.cpp:
928 * kjs/DatePrototype.h:
929 * kjs/DebuggerCallFrame.cpp:
930 * kjs/DebuggerCallFrame.h:
933 * kjs/ErrorConstructor.cpp:
934 * kjs/ErrorConstructor.h:
935 * kjs/ErrorInstance.cpp:
936 * kjs/ErrorInstance.h:
937 * kjs/ErrorPrototype.cpp:
938 * kjs/ErrorPrototype.h:
941 * kjs/FunctionConstructor.cpp:
942 * kjs/FunctionConstructor.h:
943 * kjs/FunctionPrototype.cpp:
944 * kjs/FunctionPrototype.h:
945 * kjs/GetterSetter.cpp:
946 * kjs/GetterSetter.h:
947 * kjs/GlobalEvalFunction.cpp:
948 * kjs/GlobalEvalFunction.h:
949 * kjs/IndexToNameMap.cpp:
950 * kjs/IndexToNameMap.h:
951 * kjs/InitializeThreading.cpp:
952 * kjs/InitializeThreading.h:
953 * kjs/InternalFunction.cpp:
954 * kjs/InternalFunction.h:
955 (JSC::InternalFunction::InternalFunction):
956 * kjs/JSActivation.cpp:
957 * kjs/JSActivation.h:
962 * kjs/JSFunction.cpp:
964 (JSC::JSFunction::JSFunction):
965 * kjs/JSGlobalData.cpp:
966 (JSC::JSGlobalData::JSGlobalData):
967 * kjs/JSGlobalData.h:
968 * kjs/JSGlobalObject.cpp:
969 * kjs/JSGlobalObject.h:
970 * kjs/JSGlobalObjectFunctions.cpp:
971 * kjs/JSGlobalObjectFunctions.h:
972 * kjs/JSImmediate.cpp:
976 * kjs/JSNotAnObject.cpp:
977 * kjs/JSNotAnObject.h:
978 * kjs/JSNumberCell.cpp:
979 * kjs/JSNumberCell.h:
982 * kjs/JSStaticScopeObject.cpp:
983 * kjs/JSStaticScopeObject.h:
989 * kjs/JSVariableObject.cpp:
990 * kjs/JSVariableObject.h:
991 * kjs/JSWrapperObject.cpp:
992 * kjs/JSWrapperObject.h:
993 * kjs/LabelStack.cpp:
995 * kjs/MathObject.cpp:
997 * kjs/NativeErrorConstructor.cpp:
998 * kjs/NativeErrorConstructor.h:
999 * kjs/NativeErrorPrototype.cpp:
1000 * kjs/NativeErrorPrototype.h:
1002 * kjs/NumberConstructor.cpp:
1003 * kjs/NumberConstructor.h:
1004 * kjs/NumberObject.cpp:
1005 * kjs/NumberObject.h:
1006 * kjs/NumberPrototype.cpp:
1007 * kjs/NumberPrototype.h:
1008 * kjs/ObjectConstructor.cpp:
1009 * kjs/ObjectConstructor.h:
1010 * kjs/ObjectPrototype.cpp:
1011 * kjs/ObjectPrototype.h:
1014 * kjs/PropertyMap.cpp:
1015 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
1016 * kjs/PropertyMap.h:
1017 * kjs/PropertyNameArray.cpp:
1018 * kjs/PropertyNameArray.h:
1019 * kjs/PropertySlot.cpp:
1020 * kjs/PropertySlot.h:
1021 * kjs/PrototypeFunction.cpp:
1022 * kjs/PrototypeFunction.h:
1023 * kjs/PutPropertySlot.h:
1024 * kjs/RegExpConstructor.cpp:
1025 * kjs/RegExpConstructor.h:
1026 * kjs/RegExpObject.cpp:
1027 * kjs/RegExpObject.h:
1028 * kjs/RegExpPrototype.cpp:
1029 * kjs/RegExpPrototype.h:
1030 * kjs/ScopeChain.cpp:
1032 * kjs/ScopeChainMark.h:
1035 * kjs/SmallStrings.cpp:
1036 * kjs/SmallStrings.h:
1037 * kjs/SourceProvider.h:
1038 * kjs/SourceRange.h:
1039 * kjs/StringConstructor.cpp:
1040 * kjs/StringConstructor.h:
1041 * kjs/StringObject.cpp:
1042 * kjs/StringObject.h:
1043 * kjs/StringObjectThatMasqueradesAsUndefined.h:
1044 * kjs/StringPrototype.cpp:
1045 * kjs/StringPrototype.h:
1046 * kjs/StructureID.cpp:
1047 * kjs/StructureID.h:
1048 * kjs/SymbolTable.h:
1049 * kjs/collector.cpp:
1052 * kjs/create_hash_table:
1058 * kjs/identifier.cpp:
1060 (JSC::Identifier::equal):
1061 * kjs/interpreter.cpp:
1062 * kjs/interpreter.h:
1064 (JSC::Lexer::Lexer):
1065 (JSC::Lexer::clear):
1066 (JSC::Lexer::makeIdentifier):
1072 * kjs/nodes2string.cpp:
1073 * kjs/operations.cpp:
1081 (JSC::IdentifierRepHash::hash):
1083 * masm/MacroAssembler.h:
1084 * masm/MacroAssemblerWin.cpp:
1085 * masm/X86Assembler.h:
1086 * pcre/pcre_exec.cpp:
1087 * profiler/CallIdentifier.h:
1089 * profiler/HeavyProfile.cpp:
1090 * profiler/HeavyProfile.h:
1091 * profiler/Profile.cpp:
1092 * profiler/Profile.h:
1093 * profiler/ProfileGenerator.cpp:
1094 * profiler/ProfileGenerator.h:
1095 * profiler/ProfileNode.cpp:
1096 * profiler/ProfileNode.h:
1097 * profiler/Profiler.cpp:
1098 * profiler/Profiler.h:
1099 * profiler/TreeProfile.cpp:
1100 * profiler/TreeProfile.h:
1105 2008-09-07 Maciej Stachowiak <mjs@apple.com>
1107 Reviewed by Dan Bernstein.
1109 - rename IA32MacroAssembler class to X86Assembler
1111 We otherwise call the platform X86, and also, I don't see any macros.
1113 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1114 * JavaScriptCore.xcodeproj/project.pbxproj:
1115 * masm/IA32MacroAsm.h: Removed.
1116 * masm/MacroAssembler.h:
1117 (KJS::MacroAssembler::MacroAssembler):
1118 * masm/MacroAssemblerWin.cpp:
1119 (KJS::MacroAssembler::emitRestoreArgumentReference):
1120 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
1121 (KJS::X86Assembler::X86Assembler):
1123 (KJS::WRECGenerator::generateNonGreedyQuantifier):
1124 (KJS::WRECGenerator::generateGreedyQuantifier):
1125 (KJS::WRECGenerator::generateParentheses):
1126 (KJS::WRECGenerator::generateBackreference):
1127 (KJS::WRECGenerator::gernerateDisjunction):
1130 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
1134 Visual C++ seems to have some odd casting rules, so just convert the
1135 offending cast back to a C-style cast for now.
1137 * kjs/collector.cpp:
1138 (KJS::otherThreadStackPointer):
1140 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1142 Reviewed by Mark Rowe.
1144 Attempt to fix the Windows build by using a const_cast to cast regs.Esp
1145 to a uintptr_t instead of a reinterpret_cast.
1147 * kjs/collector.cpp:
1148 (KJS::otherThreadStackPointer):
1150 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1152 Reviewed by Sam Weinig.
1154 Remove C-style casts from kjs/collector.cpp.
1156 * kjs/collector.cpp:
1157 (KJS::Heap::heapAllocate):
1158 (KJS::currentThreadStackBase):
1159 (KJS::Heap::markConservatively):
1160 (KJS::otherThreadStackPointer):
1161 (KJS::Heap::markOtherThreadConservatively):
1164 2008-09-07 Mark Rowe <mrowe@apple.com>
1166 Build fix for the debug variant.
1168 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
1170 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1172 Reviewed by Timothy Hatcher.
1174 Remove C-style casts from the CTI code.
1177 (KJS::CTI::emitGetArg):
1178 (KJS::CTI::emitGetPutArg):
1179 (KJS::ctiRepatchCallByReturnAddress):
1180 (KJS::CTI::compileOpCall):
1181 (KJS::CTI::privateCompileMainPass):
1182 (KJS::CTI::privateCompileGetByIdSelf):
1183 (KJS::CTI::privateCompileGetByIdProto):
1184 (KJS::CTI::privateCompileGetByIdChain):
1185 (KJS::CTI::privateCompilePutByIdReplace):
1186 (KJS::CTI::privateArrayLengthTrampoline):
1187 (KJS::CTI::privateStringLengthTrampoline):
1189 === End merge of squirrelfish-extreme ===
1191 2008-09-06 Gavin Barraclough <barraclough@apple.com>
1193 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
1195 - refactor WREC to share more of the JIT infrastructure with CTI
1198 (KJS::CTI::emitGetArg):
1199 (KJS::CTI::emitGetPutArg):
1200 (KJS::CTI::emitPutArg):
1201 (KJS::CTI::emitPutArgConstant):
1202 (KJS::CTI::emitPutCTIParam):
1203 (KJS::CTI::emitGetCTIParam):
1204 (KJS::CTI::emitPutToCallFrameHeader):
1205 (KJS::CTI::emitGetFromCallFrameHeader):
1206 (KJS::CTI::emitPutResult):
1207 (KJS::CTI::emitDebugExceptionCheck):
1208 (KJS::CTI::emitJumpSlowCaseIfNotImm):
1209 (KJS::CTI::emitJumpSlowCaseIfNotImms):
1210 (KJS::CTI::emitFastArithDeTagImmediate):
1211 (KJS::CTI::emitFastArithReTagImmediate):
1212 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
1213 (KJS::CTI::emitFastArithImmToInt):
1214 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
1215 (KJS::CTI::emitFastArithIntToImmNoCheck):
1217 (KJS::CTI::compileOpCall):
1218 (KJS::CTI::privateCompileMainPass):
1219 (KJS::CTI::privateCompileSlowCases):
1220 (KJS::CTI::privateCompile):
1221 (KJS::CTI::privateCompileGetByIdSelf):
1222 (KJS::CTI::privateCompileGetByIdProto):
1223 (KJS::CTI::privateCompileGetByIdChain):
1224 (KJS::CTI::privateCompilePutByIdReplace):
1225 (KJS::CTI::privateArrayLengthTrampoline):
1226 (KJS::CTI::privateStringLengthTrampoline):
1227 (KJS::CTI::compileRegExp):
1229 (KJS::CallRecord::CallRecord):
1230 (KJS::JmpTable::JmpTable):
1231 (KJS::SlowCaseEntry::SlowCaseEntry):
1232 (KJS::CTI::JSRInfo::JSRInfo):
1234 (KJS::RegExp::RegExp):
1236 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
1237 (KJS::GeneratePatternCharacterFunctor::generateAtom):
1238 (KJS::GeneratePatternCharacterFunctor::backtrack):
1239 (KJS::GenerateCharacterClassFunctor::generateAtom):
1240 (KJS::GenerateCharacterClassFunctor::backtrack):
1241 (KJS::GenerateBackreferenceFunctor::generateAtom):
1242 (KJS::GenerateBackreferenceFunctor::backtrack):
1243 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
1244 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
1245 (KJS::WRECGenerate::generateBacktrack1):
1246 (KJS::WRECGenerate::generateBacktrackBackreference):
1247 (KJS::WRECGenerate::generateBackreferenceQuantifier):
1248 (KJS::WRECGenerate::generateNonGreedyQuantifier):
1249 (KJS::WRECGenerate::generateGreedyQuantifier):
1250 (KJS::WRECGenerate::generatePatternCharacter):
1251 (KJS::WRECGenerate::generateCharacterClassInvertedRange):
1252 (KJS::WRECGenerate::generateCharacterClassInverted):
1253 (KJS::WRECGenerate::generateCharacterClass):
1254 (KJS::WRECGenerate::generateParentheses):
1255 (KJS::WRECGenerate::generateParenthesesNonGreedy):
1256 (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
1257 (KJS::WRECGenerate::generateAssertionBOL):
1258 (KJS::WRECGenerate::generateAssertionEOL):
1259 (KJS::WRECGenerate::generateAssertionWordBoundary):
1260 (KJS::WRECGenerate::generateBackreference):
1261 (KJS::WRECGenerate::gernerateDisjunction):
1262 (KJS::WRECGenerate::terminateDisjunction):
1263 (KJS::WRECParser::parseGreedyQuantifier):
1264 (KJS::WRECParser::parseQuantifier):
1265 (KJS::WRECParser::parsePatternCharacterQualifier):
1266 (KJS::WRECParser::parseCharacterClassQuantifier):
1267 (KJS::WRECParser::parseBackreferenceQuantifier):
1268 (KJS::WRECParser::parseParentheses):
1269 (KJS::WRECParser::parseCharacterClass):
1270 (KJS::WRECParser::parseOctalEscape):
1271 (KJS::WRECParser::parseEscape):
1272 (KJS::WRECParser::parseTerm):
1273 (KJS::WRECParser::parseDisjunction):
1275 (KJS::WRECGenerate::WRECGenerate):
1276 (KJS::WRECParser::):
1277 (KJS::WRECParser::WRECParser):
1278 (KJS::WRECParser::parseAlternative):
1279 (KJS::WRECParser::isEndOfPattern):
1281 2008-09-06 Oliver Hunt <oliver@apple.com>
1283 Reviewed by NOBODY (Build fix).
1285 Fix the sampler build.
1287 * VM/SamplingTool.h:
1289 2008-09-06 Oliver Hunt <oliver@apple.com>
1291 Reviewed by Maciej Stachowiak.
1293 Jump through the necessary hoops required to make MSVC cooperate with SFX
1295 We now explicitly declare the calling convention on all cti_op_* cfunctions,
1296 and return int instead of bool where appropriate (despite the cdecl calling
1297 convention seems to state MSVC generates code that returns the result value
1298 through ecx). SFX behaves slightly differently under MSVC, specifically it
1299 stores the base argument address for the cti_op_* functions in the first
1300 argument, and then does the required stack manipulation through that pointer.
1301 This is necessary as MSVC's optimisations assume they have complete control
1302 of the stack, and periodically elide our stack manipulations, or move
1303 values in unexpected ways. MSVC also frequently produces tail calls which may
1304 clobber the first argument, so the MSVC path is slightly less efficient due
1305 to the need to restore it.
1307 * JavaScriptCore.xcodeproj/project.pbxproj:
1310 (KJS::CTI::compileOpCall):
1311 (KJS::CTI::privateCompileMainPass):
1312 (KJS::CTI::privateCompileSlowCases):
1316 * masm/MacroAssembler.h:
1317 (KJS::MacroAssembler::emitConvertToFastCall):
1318 * masm/MacroAssemblerIA32GCC.cpp: Removed.
1319 For performance reasons we need these no-op functions to be inlined.
1321 * masm/MacroAssemblerWin.cpp:
1322 (KJS::MacroAssembler::emitRestoreArgumentReference):
1325 2008-09-05 Geoffrey Garen <ggaren@apple.com>
1327 Reviewed by Maciej Stachowiak, or maybe the other way around.
1329 Added the ability to coalesce JITCode buffer grow operations by first
1330 growing the buffer and then executing unchecked puts to it.
1332 About a 2% speedup on date-format-tofte.
1335 (KJS::CTI::compileOpCall):
1336 * masm/IA32MacroAsm.h:
1337 (KJS::JITCodeBuffer::ensureSpace):
1338 (KJS::JITCodeBuffer::putByteUnchecked):
1339 (KJS::JITCodeBuffer::putByte):
1340 (KJS::JITCodeBuffer::putShortUnchecked):
1341 (KJS::JITCodeBuffer::putShort):
1342 (KJS::JITCodeBuffer::putIntUnchecked):
1343 (KJS::JITCodeBuffer::putInt):
1344 (KJS::IA32MacroAssembler::emitTestl_i32r):
1345 (KJS::IA32MacroAssembler::emitMovl_mr):
1346 (KJS::IA32MacroAssembler::emitMovl_rm):
1347 (KJS::IA32MacroAssembler::emitMovl_i32m):
1348 (KJS::IA32MacroAssembler::emitUnlinkedJe):
1349 (KJS::IA32MacroAssembler::emitModRm_rr):
1350 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
1351 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
1352 (KJS::IA32MacroAssembler::emitModRm_rm):
1353 (KJS::IA32MacroAssembler::emitModRm_opr):
1354 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
1355 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
1357 2008-09-05 Mark Rowe <mrowe@apple.com>
1359 Reviewed by Sam Weinig.
1361 Disable WREC and CTI on platforms that we have not yet had a chance to test with.
1365 2008-09-05 Geoffrey Garen <ggaren@apple.com>
1367 Reviewed by Sam Weinig.
1369 Use jo instead of a mask compare when fetching array.length and
1370 string.length. 4% speedup on array.length / string.length torture
1374 (KJS::CTI::privateArrayLengthTrampoline):
1375 (KJS::CTI::privateStringLengthTrampoline):
1377 2008-09-05 Geoffrey Garen <ggaren@apple.com>
1379 Reviewed by Sam Weinig.
1381 Removed a CTI compilation pass by recording labels during bytecode
1382 generation. This is more to reduce complexity than it is to improve
1385 SunSpider reports no change.
1387 CodeBlock now keeps a "labels" set, which holds the offsets of all the
1388 instructions that can be jumped to.
1390 * VM/CTI.cpp: Nixed a pass.
1392 * VM/CodeBlock.h: Added a "labels" set.
1394 * VM/LabelID.h: No need for a special LableID for holding jump
1395 destinations, since the CodeBlock now knows all jump destinations.
1397 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
1401 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
1403 2008-09-05 Mark Rowe <mrowe@apple.com>
1405 Reviewed by Oliver Hunt and Gavin Barraclough.
1407 Move the JITCodeBuffer onto Machine and remove the static variables.
1409 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
1411 (KJS::Machine::Machine): Allocate a JITCodeBuffer.
1413 * kjs/RegExpConstructor.cpp:
1414 (KJS::constructRegExp): Pass the ExecState through.
1415 * kjs/RegExpPrototype.cpp:
1416 (KJS::regExpProtoFuncCompile): Ditto.
1417 * kjs/StringPrototype.cpp:
1418 (KJS::stringProtoFuncMatch): Ditto.
1419 (KJS::stringProtoFuncSearch): Ditto.
1421 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
1422 so that we have access to an ExecState.
1424 (KJS::RegExpNode::):
1425 * kjs/nodes2string.cpp:
1427 (KJS::RegExp::RegExp): Pass the ExecState through.
1428 (KJS::RegExp::create): Ditto.
1430 * masm/IA32MacroAsm.h:
1431 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
1434 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
1437 2008-09-05 Mark Rowe <mrowe@apple.com>
1439 Reviewed by Oliver Hunt and Gavin Barraclough.
1441 Fix the build when CTI is disabled.
1444 (KJS::CodeBlock::~CodeBlock):
1445 * VM/CodeGenerator.cpp:
1446 (KJS::prepareJumpTableForStringSwitch):
1448 (KJS::Machine::Machine):
1449 (KJS::Machine::~Machine):
1451 2008-09-05 Gavin Barraclough <barraclough@apple.com>
1453 Reviewed by Mark Rowe.
1455 Fix some windows abi issues.
1458 (KJS::CTI::privateCompileMainPass):
1459 (KJS::CTI::privateCompileSlowCases):
1461 (KJS::CallRecord::CallRecord):
1464 (KJS::Machine::cti_op_resolve_func):
1465 (KJS::Machine::cti_op_post_inc):
1466 (KJS::Machine::cti_op_resolve_with_base):
1467 (KJS::Machine::cti_op_post_dec):
1470 2008-09-05 Mark Rowe <mrowe@apple.com>
1472 Reviewed by Sam Weinig.
1474 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
1477 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
1478 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
1480 2008-09-04 Mark Rowe <mrowe@apple.com>
1482 Reviewed by Sam Weinig.
1484 Fix fast/dom/Window/console-functions.html.
1486 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
1487 such as console.log would use the line number of the last JS function on the call stack.
1490 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
1491 and restore it when the function is done.
1492 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
1494 2008-09-05 Oliver Hunt <oliver@apple.com>
1496 Start bringing up SFX on windows.
1498 Reviewed by Mark Rowe and Sam Weinig
1500 Start doing the work to bring up SFX on windows. Initially
1501 just working on WREC, as it does not make any calls so reduces
1502 the amount of code that needs to be corrected.
1504 Start abstracting the CTI JIT codegen engine.
1507 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1508 * JavaScriptCore.xcodeproj/project.pbxproj:
1510 * masm/IA32MacroAsm.h:
1511 * masm/MacroAssembler.h: Added.
1512 (KJS::MacroAssembler::MacroAssembler):
1513 * masm/MacroAssemblerIA32GCC.cpp: Added.
1514 (KJS::MacroAssembler::emitConvertToFastCall):
1515 * masm/MacroAssemblerWin.cpp: Added.
1516 (KJS::MacroAssembler::emitConvertToFastCall):
1518 (KJS::WRECompiler::parseGreedyQuantifier):
1519 (KJS::WRECompiler::parseCharacterClass):
1520 (KJS::WRECompiler::parseEscape):
1521 (KJS::WRECompiler::compilePattern):
1524 2008-09-04 Gavin Barraclough <barraclough@apple.com>
1526 Reviewed by Sam Weinig.
1528 Support for slow scripts (timeout checking).
1531 (KJS::CTI::privateCompileMainPass):
1532 (KJS::CTI::privateCompile):
1534 (KJS::slideRegisterWindowForCall):
1535 (KJS::Machine::cti_timeout_check):
1536 (KJS::Machine::cti_vm_throw):
1538 2008-09-04 Sam Weinig <sam@webkit.org>
1540 Reviewed by Mark Rowe.
1542 Third round of style cleanup.
1551 2008-09-04 Sam Weinig <sam@webkit.org>
1553 Reviewed by Jon Honeycutt.
1555 Second round of style cleanup.
1561 2008-09-04 Sam Weinig <sam@webkit.org>
1563 Reviewed by Mark Rowe.
1565 First round of style cleanup.
1569 * masm/IA32MacroAsm.h:
1573 2008-09-04 Geoffrey Garen <ggaren@apple.com>
1575 Reviewed by Mark Rowe.
1577 Merged http://trac.webkit.org/changeset/36081 to work with CTI.
1580 (KJS::Machine::tryCtiCacheGetByID):
1582 2008-09-04 Gavin Barraclough <barraclough@apple.com>
1584 Reviewed by Sam Weinig.
1586 Enable profiling in CTI.
1590 (KJS::CTI::execute):
1592 (KJS::Machine::cti_op_call_JSFunction):
1593 (KJS::Machine::cti_op_call_NotJSFunction):
1594 (KJS::Machine::cti_op_ret):
1595 (KJS::Machine::cti_op_construct_JSConstruct):
1596 (KJS::Machine::cti_op_construct_NotJSConstruct):
1598 2008-09-04 Victor Hernandez <vhernandez@apple.com>
1600 Reviewed by Geoffrey Garen.
1602 Fixed an #if to support using WREC without CTI.
1605 (KJS::RegExp::match):
1607 2008-09-04 Gavin Barraclough <barraclough@apple.com>
1609 Reviewed by Oliver Hunt.
1611 The array/string length trampolines are owned by the Machine, not the codeblock that compiled them.
1614 (KJS::CTI::privateArrayLengthTrampoline):
1615 (KJS::CTI::privateStringLengthTrampoline):
1617 (KJS::Machine::~Machine):
1620 2008-09-04 Mark Rowe <mrowe@apple.com>
1622 Reviewed by Gavin Barraclough and Sam Weinig.
1624 Fix a crash on launch of jsc when GuardMalloc is enabled.
1627 (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain.
1628 (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref.
1630 2008-09-03 Oliver Hunt <oliver@apple.com>
1632 Reviewed by Gavin Barraclough and Geoff Garen.
1634 Fix inspector and fast array access so that it bounds
1638 (KJS::CTI::privateCompile_pass2_Main):
1639 * masm/IA32MacroAsm.h:
1640 (KJS::IA32MacroAssembler::):
1641 (KJS::IA32MacroAssembler::emitUnlinkedJb):
1642 (KJS::IA32MacroAssembler::emitUnlinkedJbe):
1644 2008-09-03 Mark Rowe <mrowe@apple.com>
1646 Move the assertion after the InitializeAndReturn block, as
1647 that is used even when CTI is enabled.
1650 (KJS::Machine::privateExecute):
1652 2008-09-03 Mark Rowe <mrowe@apple.com>
1654 Reviewed by Sam Weinig.
1656 Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED.
1659 (KJS::CTI::privateCompile_pass1_Scan):
1660 (KJS::CTI::privateCompile_pass2_Main):
1661 (KJS::CTI::privateCompile_pass4_SlowCases):
1663 (KJS::Machine::privateExecute):
1664 (KJS::Machine::cti_vm_throw):
1666 2008-09-03 Mark Rowe <mrowe@apple.com>
1668 Reviewed by Sam Weinig.
1670 Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved
1671 by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86)
1677 (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for
1678 printing a ptrdiff_t.
1682 (KJS::RegExp::RegExp):
1683 (KJS::RegExp::~RegExp):
1684 (KJS::RegExp::match):
1686 * masm/IA32MacroAsm.h:
1689 * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to
1690 track whether any MASM-using features are enabled.
1692 2008-09-03 Gavin Barraclough <barraclough@apple.com>
1694 Reviewed by Oliver Hunt.
1696 Copy Geoff's array/string length optimization for CTI.
1699 (KJS::CTI::privateArrayLengthTrampoline):
1700 (KJS::CTI::privateStringLengthTrampoline):
1702 (KJS::CTI::compileArrayLengthTrampoline):
1703 (KJS::CTI::compileStringLengthTrampoline):
1705 (KJS::Machine::Machine):
1706 (KJS::Machine::getCtiArrayLengthTrampoline):
1707 (KJS::Machine::getCtiStringLengthTrampoline):
1708 (KJS::Machine::tryCtiCacheGetByID):
1709 (KJS::Machine::cti_op_get_by_id_second):
1714 2008-09-03 Gavin Barraclough <barraclough@apple.com>
1716 Reviewed by Oliver Hunt.
1718 Implement fast array accesses in CTI - 2-3% progression on sunspider.
1721 (KJS::CTI::emitFastArithIntToImmNoCheck):
1722 (KJS::CTI::compileOpCall):
1723 (KJS::CTI::privateCompile_pass2_Main):
1724 (KJS::CTI::privateCompile_pass4_SlowCases):
1728 2008-09-02 Gavin Barraclough <barraclough@apple.com>
1730 Reviewed by Oliver Hunt.
1732 Enable fast property access support in CTI.
1735 (KJS::ctiSetReturnAddress):
1736 (KJS::ctiRepatchCallByReturnAddress):
1737 (KJS::CTI::privateCompile_pass2_Main):
1738 (KJS::CTI::privateCompile):
1739 (KJS::CTI::privateCompileGetByIdSelf):
1740 (KJS::CTI::privateCompileGetByIdProto):
1741 (KJS::CTI::privateCompileGetByIdChain):
1742 (KJS::CTI::privateCompilePutByIdReplace):
1744 (KJS::CTI::compileGetByIdSelf):
1745 (KJS::CTI::compileGetByIdProto):
1746 (KJS::CTI::compileGetByIdChain):
1747 (KJS::CTI::compilePutByIdReplace):
1749 (KJS::CodeBlock::~CodeBlock):
1752 (KJS::doSetReturnAddressVmThrowTrampoline):
1753 (KJS::Machine::tryCtiCachePutByID):
1754 (KJS::Machine::tryCtiCacheGetByID):
1755 (KJS::Machine::cti_op_put_by_id):
1756 (KJS::Machine::cti_op_put_by_id_second):
1757 (KJS::Machine::cti_op_put_by_id_generic):
1758 (KJS::Machine::cti_op_put_by_id_fail):
1759 (KJS::Machine::cti_op_get_by_id):
1760 (KJS::Machine::cti_op_get_by_id_second):
1761 (KJS::Machine::cti_op_get_by_id_generic):
1762 (KJS::Machine::cti_op_get_by_id_fail):
1763 (KJS::Machine::cti_op_throw):
1764 (KJS::Machine::cti_vm_throw):
1768 * kjs/PropertyMap.h:
1769 * kjs/StructureID.cpp:
1770 (KJS::StructureIDChain::StructureIDChain):
1771 * masm/IA32MacroAsm.h:
1772 (KJS::IA32MacroAssembler::emitCmpl_i32m):
1773 (KJS::IA32MacroAssembler::emitMovl_mr):
1774 (KJS::IA32MacroAssembler::emitMovl_rm):
1776 2008-09-02 Sam Weinig <sam@webkit.org>
1778 Reviewed by Gavin Barraclough and Mark Rowe.
1780 A backslash (\) at the of a RegEx should produce an error.
1781 Fixes fast/regex/test1.html.
1784 (KJS::WRECompiler::parseEscape):
1786 2008-09-02 Sam Weinig <sam@webkit.org>
1788 Reviewed by Geoff Garen.
1790 Link jumps for the slow case of op_loop_if_less. Fixes acid3.
1793 (KJS::CTI::privateCompile_pass4_SlowCases):
1795 2008-09-01 Sam Weinig <sam@webkit.org>
1797 Rubber-stamped by Maciej Stachowiak.
1799 Switch WREC on by default.
1803 2008-09-01 Sam Weinig <sam@webkit.org>
1805 Reviewed by Mark Rowe.
1807 Fix two failures in fast/regex/test1.html
1808 - \- in a character class should be treated as a literal -
1809 - A missing max quantifier needs to be treated differently than
1810 a null max quantifier.
1813 (KJS::WRECompiler::generateNonGreedyQuantifier):
1814 (KJS::WRECompiler::generateGreedyQuantifier):
1815 (KJS::WRECompiler::parseCharacterClass):
1817 (KJS::Quantifier::Quantifier):
1819 2008-09-01 Sam Weinig <sam@webkit.org>
1821 Reviewed by Mark Rowe.
1823 Fix crash in fast/js/kde/evil-n.html
1825 * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function.
1827 2008-09-01 Sam Weinig <sam@webkit.org>
1829 Reviewed by Gavin Barraclough and Mark Rowe.
1831 Add pattern length limit fixing one test in fast/js.
1834 (KJS::WRECompiler::compile):
1836 (KJS::WRECompiler::):
1838 2008-09-01 Sam Weinig <sam@webkit.org>
1840 Reviewed by Gavin Barraclough and Mark Rowe.
1842 Make octal escape parsing/back-reference parsing more closely match
1843 prior behavior fixing one test in fast/js.
1846 (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped
1847 (KJS::WRECompiler::parseEscape):
1849 (KJS::WRECompiler::peekDigit):
1851 2008-09-01 Sam Weinig <sam@webkit.org>
1853 Reviewed by Gavin Barraclough and Mark Rowe.
1855 Fix one mozilla test.
1858 (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not
1861 2008-09-01 Sam Weinig <sam@webkit.org>
1863 Reviewed by Gavin Barraclough and Mark Rowe.
1865 Parse octal escapes in character classes fixing one mozilla test.
1868 (KJS::WRECompiler::parseCharacterClass):
1869 (KJS::WRECompiler::parseOctalEscape):
1871 (KJS::WRECompiler::consumeOctal):
1873 2008-09-01 Sam Weinig <sam@webkit.org>
1875 Reviewed by Oliver Hunt.
1877 Fixes two mozilla tests with WREC enabled.
1880 (KJS::CharacterClassConstructor::append): Keep the character class sorted
1881 when appending another character class.
1883 2008-09-01 Sam Weinig <sam@webkit.org>
1885 Reviewed by Gavin Barraclough and Mark Rowe.
1887 Fixes two mozilla tests with WREC enabled.
1890 (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position
1891 instead of appending it to the end.
1893 2008-09-01 Gavin Barraclough <barraclough@apple.com>
1895 Reviewed by Oliver Hunt.
1897 Move cross-compilation unit call into NEVER_INLINE function.
1900 (KJS::doSetReturnAddressVmThrowTrampoline):
1902 2008-09-01 Sam Weinig <sam@webkit.org>
1904 Reviewed by Gavin Barraclough and Geoff Garen.
1906 Fix one test in fast/js.
1909 (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError,
1910 instead of a createNotAFunctionError.
1912 2008-08-31 Gavin Barraclough <barraclough@apple.com>
1914 Reviewed by Maciej Stachowiak.
1916 Zero-cost exception handling. This patch takes the exception checking
1917 back of the hot path. When an exception occurs in a Machine::cti*
1918 method, the return address to JIT code is recorded, and is then
1919 overwritten with a pointer to a trampoline routine. When the method
1920 returns the trampoline will cause the cti_vm_throw method to be invoked.
1922 cti_vm_throw uses the return address preserved above, to discover the
1923 vPC of the bytecode that raised the exception (using a map build during
1924 translation). From the VPC of the faulting bytecode the vPC of a catch
1925 routine may be discovered (unwinding the stack where necesary), and then
1926 a bytecode address for the catch routine is looked up. Final cti_vm_throw
1927 overwrites its return address to JIT code again, to trampoline directly
1928 to the catch routine.
1930 cti_op_throw is handled in a similar fashion.
1933 (KJS::CTI::emitPutCTIParam):
1934 (KJS::CTI::emitPutToCallFrameHeader):
1935 (KJS::CTI::emitGetFromCallFrameHeader):
1936 (KJS::ctiSetReturnAddressForArgs):
1937 (KJS::CTI::emitDebugExceptionCheck):
1938 (KJS::CTI::printOpcodeOperandTypes):
1939 (KJS::CTI::emitCall):
1940 (KJS::CTI::compileOpCall):
1941 (KJS::CTI::privateCompile_pass2_Main):
1942 (KJS::CTI::privateCompile):
1944 (KJS::CallRecord::CallRecord):
1946 (KJS::CTI::execute):
1949 (KJS::Machine::privateExecute):
1950 (KJS::Machine::cti_op_instanceof):
1951 (KJS::Machine::cti_op_call_NotJSFunction):
1952 (KJS::Machine::cti_op_resolve):
1953 (KJS::Machine::cti_op_resolve_func):
1954 (KJS::Machine::cti_op_resolve_skip):
1955 (KJS::Machine::cti_op_resolve_with_base):
1956 (KJS::Machine::cti_op_throw):
1957 (KJS::Machine::cti_op_in):
1958 (KJS::Machine::cti_vm_throw):
1959 * VM/RegisterFile.h:
1960 (KJS::RegisterFile::):
1962 (KJS::ExecState::setCtiReturnAddress):
1963 (KJS::ExecState::ctiReturnAddress):
1964 * masm/IA32MacroAsm.h:
1965 (KJS::IA32MacroAssembler::):
1966 (KJS::IA32MacroAssembler::emitPushl_m):
1967 (KJS::IA32MacroAssembler::emitPopl_m):
1968 (KJS::IA32MacroAssembler::getRelocatedAddress):
1970 2008-08-31 Mark Rowe <mrowe@apple.com>
1972 Reviewed by Oliver Hunt.
1974 Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them.
1977 (KJS::WRECompiler::parseParentheses):
1979 (KJS::WRECompiler::):
1981 2008-08-31 Mark Rowe <mrowe@apple.com>
1983 Reviewed by Oliver Hunt.
1985 Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled.
1988 (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum.
1989 (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register.
1990 (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag.
1992 2008-08-30 Mark Rowe <mrowe@apple.com>
1994 Reviewed by Oliver Hunt.
1996 Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance.
1997 This shows up as a 0.6% progression on SunSpider on my machine.
1999 Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out.
2002 (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc.
2003 * kjs/regexp.cpp: Ditto.
2004 * masm/IA32MacroAsm.h:
2005 (KJS::JITCodeBuffer::growBuffer):
2006 (KJS::JITCodeBuffer::JITCodeBuffer):
2007 (KJS::JITCodeBuffer::~JITCodeBuffer):
2008 (KJS::JITCodeBuffer::putByte):
2009 (KJS::JITCodeBuffer::putShort):
2010 (KJS::JITCodeBuffer::putInt):
2011 (KJS::JITCodeBuffer::reset):
2012 (KJS::JITCodeBuffer::copy):
2014 2008-08-29 Oliver Hunt <oliver@apple.com>
2018 Roll out previous patch as it causes a 5% performance regression
2020 * JavaScriptCore.xcodeproj/project.pbxproj:
2023 (KJS::CTI::privateCompile):
2025 (KJS::CodeBlock::~CodeBlock):
2026 * masm/IA32MacroAsm.h:
2027 (KJS::JITCodeBuffer::JITCodeBuffer):
2028 (KJS::JITCodeBuffer::putByte):
2029 (KJS::JITCodeBuffer::putShort):
2030 (KJS::JITCodeBuffer::putInt):
2031 (KJS::JITCodeBuffer::getEIP):
2032 (KJS::JITCodeBuffer::start):
2033 (KJS::JITCodeBuffer::getOffset):
2034 (KJS::JITCodeBuffer::reset):
2035 (KJS::JITCodeBuffer::copy):
2036 (KJS::IA32MacroAssembler::emitModRm_rr):
2037 (KJS::IA32MacroAssembler::emitModRm_rm):
2038 (KJS::IA32MacroAssembler::emitModRm_rmsib):
2039 (KJS::IA32MacroAssembler::IA32MacroAssembler):
2040 (KJS::IA32MacroAssembler::emitInt3):
2041 (KJS::IA32MacroAssembler::emitPushl_r):
2042 (KJS::IA32MacroAssembler::emitPopl_r):
2043 (KJS::IA32MacroAssembler::emitMovl_rr):
2044 (KJS::IA32MacroAssembler::emitAddl_rr):
2045 (KJS::IA32MacroAssembler::emitAddl_i8r):
2046 (KJS::IA32MacroAssembler::emitAddl_i32r):
2047 (KJS::IA32MacroAssembler::emitAddl_mr):
2048 (KJS::IA32MacroAssembler::emitAndl_rr):
2049 (KJS::IA32MacroAssembler::emitAndl_i32r):
2050 (KJS::IA32MacroAssembler::emitCmpl_i8r):
2051 (KJS::IA32MacroAssembler::emitCmpl_rr):
2052 (KJS::IA32MacroAssembler::emitCmpl_rm):
2053 (KJS::IA32MacroAssembler::emitCmpl_i32r):
2054 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2055 (KJS::IA32MacroAssembler::emitCmpw_rm):
2056 (KJS::IA32MacroAssembler::emitOrl_rr):
2057 (KJS::IA32MacroAssembler::emitOrl_i8r):
2058 (KJS::IA32MacroAssembler::emitSubl_rr):
2059 (KJS::IA32MacroAssembler::emitSubl_i8r):
2060 (KJS::IA32MacroAssembler::emitSubl_i32r):
2061 (KJS::IA32MacroAssembler::emitSubl_mr):
2062 (KJS::IA32MacroAssembler::emitTestl_i32r):
2063 (KJS::IA32MacroAssembler::emitTestl_rr):
2064 (KJS::IA32MacroAssembler::emitXorl_i8r):
2065 (KJS::IA32MacroAssembler::emitXorl_rr):
2066 (KJS::IA32MacroAssembler::emitSarl_i8r):
2067 (KJS::IA32MacroAssembler::emitSarl_CLr):
2068 (KJS::IA32MacroAssembler::emitShl_i8r):
2069 (KJS::IA32MacroAssembler::emitShll_CLr):
2070 (KJS::IA32MacroAssembler::emitMull_rr):
2071 (KJS::IA32MacroAssembler::emitIdivl_r):
2072 (KJS::IA32MacroAssembler::emitCdq):
2073 (KJS::IA32MacroAssembler::emitMovl_mr):
2074 (KJS::IA32MacroAssembler::emitMovzwl_mr):
2075 (KJS::IA32MacroAssembler::emitMovl_rm):
2076 (KJS::IA32MacroAssembler::emitMovl_i32r):
2077 (KJS::IA32MacroAssembler::emitMovl_i32m):
2078 (KJS::IA32MacroAssembler::emitLeal_mr):
2079 (KJS::IA32MacroAssembler::emitRet):
2080 (KJS::IA32MacroAssembler::emitJmpN_r):
2081 (KJS::IA32MacroAssembler::emitJmpN_m):
2082 (KJS::IA32MacroAssembler::emitCall):
2083 (KJS::IA32MacroAssembler::label):
2084 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
2085 (KJS::IA32MacroAssembler::emitUnlinkedJne):
2086 (KJS::IA32MacroAssembler::emitUnlinkedJe):
2087 (KJS::IA32MacroAssembler::emitUnlinkedJl):
2088 (KJS::IA32MacroAssembler::emitUnlinkedJle):
2089 (KJS::IA32MacroAssembler::emitUnlinkedJge):
2090 (KJS::IA32MacroAssembler::emitUnlinkedJae):
2091 (KJS::IA32MacroAssembler::emitUnlinkedJo):
2092 (KJS::IA32MacroAssembler::link):
2094 (KJS::WRECompiler::compilePattern):
2095 (KJS::WRECompiler::compile):
2098 2008-08-29 Mark Rowe <mrowe@apple.com>
2100 Reviewed by Oliver Hunt.
2102 Have JITCodeBuffer manage a Vector containing the generated code so that it can grow
2103 as needed when generating code for a large function. This fixes all six remaining failures
2104 in Mozilla tests in both debug and release builds.
2107 (KJS::CTI::privateCompile):
2109 (KJS::CodeBlock::~CodeBlock):
2110 * masm/IA32MacroAsm.h:
2111 (KJS::JITCodeBuffer::putByte):
2112 (KJS::JITCodeBuffer::putShort):
2113 (KJS::JITCodeBuffer::putInt):
2114 (KJS::JITCodeBuffer::getEIP):
2115 (KJS::JITCodeBuffer::start):
2116 (KJS::JITCodeBuffer::getOffset):
2117 (KJS::JITCodeBuffer::getCode):
2118 (KJS::IA32MacroAssembler::emitModRm_rr):
2120 (KJS::WRECompiler::compilePattern):
2123 2008-08-29 Mark Rowe <mrowe@apple.com>
2125 Reviewed by Oliver Hunt.
2127 Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests.
2130 (KJS::WRECompiler::parseOctalEscape):
2131 (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero.
2132 Add a FIXME about treating invalid backreferences as octal escapes in the future.
2134 (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than
2137 (WTF::isASCIIOctalDigit):
2139 2008-08-29 Sam Weinig <sam@webkit.org>
2141 Reviewed by Mark Rowe.
2143 Pass vPC to instanceof method. Fixes 2 mozilla tests in debug.
2146 (KJS::CTI::privateCompile_pass2_Main):
2148 (KJS::Machine::cti_op_instanceof):
2150 2008-08-29 Sam Weinig <sam@webkit.org>
2152 Reviewed by Mark Rowe.
2154 Pass vPCs to resolve methods for correct exception creation. Fixes
2155 17 mozilla tests in debug.
2158 (KJS::CTI::privateCompile_pass2_Main):
2161 (KJS::Machine::cti_op_resolve):
2162 (KJS::Machine::cti_op_resolve_func):
2163 (KJS::Machine::cti_op_resolve_skip):
2164 (KJS::Machine::cti_op_resolve_with_base):
2166 2008-08-29 Gavin Barraclough <barraclough@apple.com>
2168 Reviewed by Oliver Hunt.
2170 Remembering to actually throw the exception passed to op throw helps.
2171 Regressions 19 -> 6.
2174 (KJS::Machine::cti_op_throw):
2175 (KJS::Machine::cti_vm_throw):
2177 2008-08-29 Gavin Barraclough <barraclough@apple.com>
2179 Reviewed by Sam Weinig.
2181 Support for exception unwinding the stack.
2183 Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address
2184 is now preserved on entry to a JIT code function (if we preserve lazily we need
2185 restore the native return address during exception stack unwind). This takes
2186 the number of regressions down from ~150 to 19.
2190 (KJS::CTI::emitExceptionCheck):
2191 (KJS::CTI::compileOpCall):
2192 (KJS::CTI::privateCompile_pass2_Main):
2193 (KJS::CTI::privateCompile):
2197 (KJS::Machine::throwException):
2198 (KJS::Machine::cti_op_call_JSFunction):
2199 (KJS::Machine::cti_op_call_NotJSFunction):
2200 (KJS::Machine::cti_op_construct_JSConstruct):
2201 (KJS::Machine::cti_op_construct_NotJSConstruct):
2202 (KJS::Machine::cti_op_throw):
2203 (KJS::Machine::cti_vm_throw):
2205 2008-08-29 Mark Rowe <mrowe@apple.com>
2207 Reviewed by Oliver Hunt.
2209 Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled.
2212 (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches
2213 succeeded, jump to failure.
2214 (KJS::WRECompiler::compilePattern): Restore and increment the current position stored
2215 on the stack to ensure that it will be reset to the correct position after a failed
2216 match has consumed input.
2218 2008-08-29 Mark Rowe <mrowe@apple.com>
2220 Reviewed by Oliver Hunt.
2222 Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled.
2223 A backreference with a quantifier would get stuck in an infinite
2224 loop if the captured range was empty.
2227 (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range
2228 was empty, do not attempt to match the backreference.
2229 (KJS::WRECompiler::parseBackreferenceQuantifier):
2231 (KJS::Quantifier::):
2233 2008-08-28 Sam Weinig <sam@webkit.org>
2235 Reviewed by Oliver Hunt.
2240 (KJS::CTI::privateCompile_pass1_Scan):
2241 (KJS::CTI::privateCompile_pass2_Main):
2243 (KJS::Machine::debug):
2244 (KJS::Machine::privateExecute):
2245 (KJS::Machine::cti_op_debug):
2248 2008-08-28 Sam Weinig <sam@webkit.org>
2250 Reviewed by Gavin Barraclough and Geoff Garen.
2252 Implement op_switch_string fixing 1 mozilla test and one test in fast/js.
2255 (KJS::CTI::privateCompile_pass1_Scan):
2256 (KJS::CTI::privateCompile_pass2_Main):
2257 (KJS::CTI::privateCompile):
2259 (KJS::SwitchRecord::):
2260 (KJS::SwitchRecord::SwitchRecord):
2262 (KJS::CodeBlock::dump):
2264 (KJS::ExpressionRangeInfo::):
2265 (KJS::StringJumpTable::offsetForValue):
2266 (KJS::StringJumpTable::ctiForValue):
2267 (KJS::SimpleJumpTable::add):
2268 (KJS::SimpleJumpTable::ctiForValue):
2269 * VM/CodeGenerator.cpp:
2270 (KJS::prepareJumpTableForStringSwitch):
2272 (KJS::Machine::privateExecute):
2273 (KJS::Machine::cti_op_switch_string):
2276 2008-08-28 Gavin Barraclough <barraclough@apple.com>
2278 Reviewed by Oliver Hunt.
2280 Do not recurse on the machine stack when executing op_call.
2283 (KJS::CTI::emitGetPutArg):
2284 (KJS::CTI::emitPutArg):
2285 (KJS::CTI::emitPutArgConstant):
2286 (KJS::CTI::compileOpCall):
2287 (KJS::CTI::privateCompile_pass2_Main):
2288 (KJS::CTI::privateCompile):
2291 (KJS::CTI::compile):
2292 (KJS::CTI::execute):
2295 (KJS::Machine::Machine):
2296 (KJS::Machine::execute):
2297 (KJS::Machine::cti_op_call_JSFunction):
2298 (KJS::Machine::cti_op_call_NotJSFunction):
2299 (KJS::Machine::cti_op_ret):
2300 (KJS::Machine::cti_op_construct_JSConstruct):
2301 (KJS::Machine::cti_op_construct_NotJSConstruct):
2302 (KJS::Machine::cti_op_call_eval):
2305 (KJS::Register::Register):
2306 * VM/RegisterFile.h:
2307 (KJS::RegisterFile::):
2308 * kjs/InternalFunction.h:
2309 (KJS::InternalFunction::InternalFunction):
2311 (KJS::JSFunction::JSFunction):
2313 (KJS::ScopeChain::ScopeChain):
2314 * masm/IA32MacroAsm.h:
2315 (KJS::IA32MacroAssembler::):
2316 (KJS::IA32MacroAssembler::emitModRm_opm):
2317 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2318 (KJS::IA32MacroAssembler::emitCallN_r):
2320 2008-08-28 Sam Weinig <sam@webkit.org>
2322 Reviewed by Mark Rowe.
2324 Exit instead of crashing in ctiUnsupported and ctiTimedOut.
2327 (KJS::ctiUnsupported):
2330 2008-08-28 Oliver Hunt <oliver@apple.com>
2332 Reviewed by Maciej Stachowiak.
2334 Implement codegen for op_jsr and op_sret.
2337 (KJS::CTI::privateCompile_pass1_Scan):
2338 (KJS::CTI::privateCompile_pass2_Main):
2339 (KJS::CTI::privateCompile):
2341 (KJS::CTI::JSRInfo::JSRInfo):
2342 * masm/IA32MacroAsm.h:
2343 (KJS::IA32MacroAssembler::emitJmpN_m):
2344 (KJS::IA32MacroAssembler::linkAbsoluteAddress):
2346 2008-08-28 Gavin Barraclough <barraclough@apple.com>
2348 Reviewed by Oliver Hunt.
2350 Initial support for exceptions (throw / catch must occur in same CodeBlock).
2353 (KJS::CTI::emitExceptionCheck):
2354 (KJS::CTI::emitCall):
2355 (KJS::CTI::privateCompile_pass2_Main):
2356 (KJS::CTI::privateCompile_pass4_SlowCases):
2357 (KJS::CTI::privateCompile):
2360 (KJS::CodeBlock::nativeExceptionCodeForHandlerVPC):
2362 * VM/CodeGenerator.cpp:
2363 (KJS::CodeGenerator::emitCatch):
2365 (KJS::Machine::throwException):
2366 (KJS::Machine::privateExecute):
2367 (KJS::ctiUnsupported):
2369 (KJS::Machine::cti_op_add):
2370 (KJS::Machine::cti_op_pre_inc):
2371 (KJS::Machine::cti_timeout_check):
2372 (KJS::Machine::cti_op_loop_if_less):
2373 (KJS::Machine::cti_op_put_by_id):
2374 (KJS::Machine::cti_op_get_by_id):
2375 (KJS::Machine::cti_op_instanceof):
2376 (KJS::Machine::cti_op_del_by_id):
2377 (KJS::Machine::cti_op_mul):
2378 (KJS::Machine::cti_op_call):
2379 (KJS::Machine::cti_op_resolve):
2380 (KJS::Machine::cti_op_construct):
2381 (KJS::Machine::cti_op_get_by_val):
2382 (KJS::Machine::cti_op_resolve_func):
2383 (KJS::Machine::cti_op_sub):
2384 (KJS::Machine::cti_op_put_by_val):
2385 (KJS::Machine::cti_op_lesseq):
2386 (KJS::Machine::cti_op_loop_if_true):
2387 (KJS::Machine::cti_op_negate):
2388 (KJS::Machine::cti_op_resolve_skip):
2389 (KJS::Machine::cti_op_div):
2390 (KJS::Machine::cti_op_pre_dec):
2391 (KJS::Machine::cti_op_jless):
2392 (KJS::Machine::cti_op_not):
2393 (KJS::Machine::cti_op_jtrue):
2394 (KJS::Machine::cti_op_post_inc):
2395 (KJS::Machine::cti_op_eq):
2396 (KJS::Machine::cti_op_lshift):
2397 (KJS::Machine::cti_op_bitand):
2398 (KJS::Machine::cti_op_rshift):
2399 (KJS::Machine::cti_op_bitnot):
2400 (KJS::Machine::cti_op_resolve_with_base):
2401 (KJS::Machine::cti_op_mod):
2402 (KJS::Machine::cti_op_less):
2403 (KJS::Machine::cti_op_neq):
2404 (KJS::Machine::cti_op_post_dec):
2405 (KJS::Machine::cti_op_urshift):
2406 (KJS::Machine::cti_op_bitxor):
2407 (KJS::Machine::cti_op_bitor):
2408 (KJS::Machine::cti_op_call_eval):
2409 (KJS::Machine::cti_op_throw):
2410 (KJS::Machine::cti_op_push_scope):
2411 (KJS::Machine::cti_op_stricteq):
2412 (KJS::Machine::cti_op_nstricteq):
2413 (KJS::Machine::cti_op_to_jsnumber):
2414 (KJS::Machine::cti_op_in):
2415 (KJS::Machine::cti_op_del_by_val):
2416 (KJS::Machine::cti_vm_throw):
2419 * masm/IA32MacroAsm.h:
2420 (KJS::IA32MacroAssembler::emitCmpl_i32m):
2422 2008-08-28 Mark Rowe <mrowe@apple.com>
2424 Rubber-stamped by Oliver Hunt.
2426 Print debugging info to stderr so that run-webkit-tests can capture it.
2427 This makes it easy to check whether test failures are due to unimplemented
2428 op codes, missing support for exceptions, etc.
2431 (KJS::CTI::privateCompile_pass1_Scan):
2432 (KJS::CTI::printOpcodeOperandTypes):
2433 (KJS::CTI::privateCompile_pass2_Main):
2434 (KJS::CTI::privateCompile_pass4_SlowCases):
2435 (KJS::CTI::privateCompile):
2437 (KJS::Machine::privateExecute):
2438 (KJS::ctiException):
2439 (KJS::ctiUnsupported):
2440 (KJS::Machine::cti_op_call):
2441 (KJS::Machine::cti_op_resolve):
2442 (KJS::Machine::cti_op_construct):
2443 (KJS::Machine::cti_op_get_by_val):
2444 (KJS::Machine::cti_op_resolve_func):
2445 (KJS::Machine::cti_op_resolve_skip):
2446 (KJS::Machine::cti_op_resolve_with_base):
2447 (KJS::Machine::cti_op_call_eval):
2449 2008-08-27 Mark Rowe <mrowe@apple.com>
2451 Reviewed by Gavin Barraclough and Maciej Stachowiak.
2453 Fix fast/js/bitwise-and-on-undefined.html.
2455 A temporary value in the slow path of op_bitand was being stored in edx, but was
2456 being clobbered by emitGetPutArg before we used it. To fix this, emitGetPutArg
2457 now takes a third argument that specifies the scratch register to use when loading
2458 from memory. This allows us to avoid clobbering the temporary in op_bitand.
2461 (KJS::CTI::emitGetPutArg):
2462 (KJS::CTI::privateCompile_pass2_Main):
2463 (KJS::CTI::privateCompile_pass4_SlowCases):
2466 2008-08-27 Mark Rowe <mrowe@apple.com>
2468 Rubber-stamped by Oliver Hunt.
2470 Switch CTI on by default.
2474 2008-08-27 Mark Rowe <mrowe@apple.com>
2476 Reviewed by Oliver Hunt.
2478 Fix the build of the full WebKit stack.
2480 * JavaScriptCore.xcodeproj/project.pbxproj: Mark two new headers as private so they can be pulled in from WebCore.
2481 * VM/CTI.h: Fix build issues that show up when compiled with GCC 4.2 as part of WebCore.
2482 * wrec/WREC.h: Ditto.
2484 2008-08-27 Mark Rowe <mrowe@apple.com>
2486 Reviewed by Sam Weinig.
2488 Implement op_new_error. Does not fix any tests as it is always followed by the unimplemented op_throw.
2491 (KJS::CTI::privateCompile_pass1_Scan):
2492 (KJS::CTI::privateCompile_pass2_Main):
2494 (KJS::Machine::cti_op_new_error):
2497 2008-08-27 Sam Weinig <sam@webkit.org>
2499 Reviewed by Gavin Barraclough and Geoff Garen.
2501 Implement op_put_getter and op_put_setter.
2504 (KJS::CTI::privateCompile_pass1_Scan):
2505 (KJS::CTI::privateCompile_pass2_Main):
2507 (KJS::Machine::cti_op_put_getter):
2508 (KJS::Machine::cti_op_put_setter):
2511 2008-08-27 Sam Weinig <sam@webkit.org>
2513 Reviewed by Gavin Barraclough and Geoff Garen.
2515 Implement op_del_by_val fixing 3 mozilla tests.
2518 (KJS::CTI::privateCompile_pass1_Scan):
2519 (KJS::CTI::privateCompile_pass2_Main):
2521 (KJS::Machine::cti_op_del_by_val):
2524 2008-08-27 Gavin Barraclough <barraclough@apple.com>
2526 Reviewed by Oliver Hunt.
2528 Quick & dirty fix to get SamplingTool sampling op_call.
2530 * VM/SamplingTool.h:
2531 (KJS::SamplingTool::callingHostFunction):
2533 2008-08-27 Sam Weinig <sam@webkit.org>
2535 Reviewed by Gavin Barraclough and Geoff Garen.
2537 Fix op_put_by_index.
2540 (KJS::CTI::privateCompile_pass2_Main): Use emitPutArgConstant instead of emitGetPutArg
2541 for the property value.
2543 (KJS::Machine::cti_op_put_by_index): Get the property value from the correct argument.
2545 2008-08-27 Sam Weinig <sam@webkit.org>
2547 Reviewed by Gavin Barraclough and Geoff Garen.
2549 Implement op_switch_imm in the CTI fixing 13 mozilla tests.
2552 (KJS::CTI::privateCompile_pass1_Scan):
2553 (KJS::CTI::privateCompile_pass2_Main):
2555 (KJS::Machine::cti_op_switch_imm):
2558 2008-08-27 Gavin Barraclough <barraclough@apple.com>
2560 Reviewed by Oliver Hunt.
2562 Implement op_switch_char in CTI.
2565 (KJS::CTI::emitCall):
2566 (KJS::CTI::privateCompile_pass1_Scan):
2567 (KJS::CTI::privateCompile_pass2_Main):
2568 (KJS::CTI::privateCompile):
2570 (KJS::CallRecord::CallRecord):
2571 (KJS::SwitchRecord::SwitchRecord):
2573 (KJS::SimpleJumpTable::SimpleJumpTable::ctiForValue):
2575 (KJS::Machine::cti_op_switch_char):
2577 * masm/IA32MacroAsm.h:
2578 (KJS::IA32MacroAssembler::):
2579 (KJS::IA32MacroAssembler::emitJmpN_r):
2580 (KJS::IA32MacroAssembler::getRelocatedAddress):
2583 2008-08-26 Sam Weinig <sam@webkit.org>
2585 Reviewed by Mark Rowe.
2587 Implement op_put_by_index to fix 1 mozilla test.
2590 (KJS::CTI::privateCompile_pass1_Scan):
2591 (KJS::CTI::privateCompile_pass2_Main):
2593 (KJS::Machine::cti_op_put_by_index):
2596 2008-08-26 Gavin Barraclough <barraclough@apple.com>
2598 Reviewed by Geoff Garen.
2600 More fixes from Geoff's review.
2603 (KJS::CTI::emitGetArg):
2604 (KJS::CTI::emitGetPutArg):
2605 (KJS::CTI::emitPutArg):
2606 (KJS::CTI::emitPutArgConstant):
2607 (KJS::CTI::getConstantImmediateNumericArg):
2608 (KJS::CTI::emitGetCTIParam):
2609 (KJS::CTI::emitPutResult):
2610 (KJS::CTI::emitCall):
2611 (KJS::CTI::emitJumpSlowCaseIfNotImm):
2612 (KJS::CTI::emitJumpSlowCaseIfNotImms):
2613 (KJS::CTI::getDeTaggedConstantImmediate):
2614 (KJS::CTI::emitFastArithDeTagImmediate):
2615 (KJS::CTI::emitFastArithReTagImmediate):
2616 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
2617 (KJS::CTI::emitFastArithImmToInt):
2618 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
2619 (KJS::CTI::privateCompile_pass2_Main):
2620 (KJS::CTI::privateCompile_pass4_SlowCases):
2621 (KJS::CTI::privateCompile):
2624 2008-08-26 Mark Rowe <mrowe@apple.com>
2626 Reviewed by Gavin Barraclough and Geoff Garen.
2628 Implement op_jmp_scopes to fix 2 Mozilla tests.
2631 (KJS::CTI::privateCompile_pass1_Scan):
2632 (KJS::CTI::privateCompile_pass2_Main):
2634 (KJS::Machine::cti_op_push_new_scope): Update ExecState::m_scopeChain after calling ARG_setScopeChain.
2635 (KJS::Machine::cti_op_jmp_scopes):
2638 2008-08-26 Gavin Barraclough <barraclough@apple.com>
2640 Reviewed by Oliver Hunt.
2642 WebKit Regular Expression Compiler. (set ENABLE_WREC = 1 in Platform.h).
2644 * JavaScriptCore.xcodeproj/project.pbxproj:
2648 * wrec/WREC.cpp: Added.
2649 * wrec/WREC.h: Added.
2652 2008-08-26 Sam Weinig <sam@webkit.org>
2654 Rubber-stamped by Oliver Hunt.
2656 Remove bogus assertion.
2659 (KJS::Machine::cti_op_del_by_id):
2661 2008-08-26 Mark Rowe <mrowe@apple.com>
2663 Reviewed by Sam Weinig.
2665 Implement op_push_new_scope and stub out op_catch. This fixes 11 Mozilla tests.
2668 (KJS::CTI::privateCompile_pass1_Scan):
2669 (KJS::CTI::privateCompile_pass2_Main):
2671 (KJS::Machine::cti_op_push_new_scope):
2672 (KJS::Machine::cti_op_catch):
2675 2008-08-26 Mark Rowe <mrowe@apple.com>
2677 Reviewed by Sam Weinig.
2679 Clean up op_resolve_base so that it shares its implementation with the bytecode interpreter.
2682 (KJS::inlineResolveBase):
2685 2008-08-26 Oliver Hunt <oliver@apple.com>
2687 Reviewed by Sam Weinig.
2689 Add codegen support for op_instanceof, fixing 15 mozilla tests.
2692 (KJS::CTI::privateCompile_pass1_Scan):
2693 (KJS::CTI::privateCompile_pass2_Main):
2695 (KJS::Machine::cti_op_instanceof):
2696 (KJS::Machine::cti_op_del_by_id):
2700 2008-08-26 Gavin Barraclough <barraclough@apple.com>
2702 Reviewed by Geoff Garen.
2704 Fixes for initial review comments.
2707 (KJS::CTI::ctiCompileGetArg):
2708 (KJS::CTI::ctiCompileGetPutArg):
2709 (KJS::CTI::ctiCompilePutResult):
2710 (KJS::CTI::ctiCompileCall):
2712 (KJS::CTI::privateCompile_pass1_Scan):
2713 (KJS::CTI::printOpcodeOperandTypes):
2714 (KJS::CTI::privateCompile_pass2_Main):
2715 (KJS::CTI::privateCompile_pass4_SlowCases):
2716 (KJS::CTI::privateCompile):
2721 2008-08-26 Sam Weinig <sam@webkit.org>
2723 Reviewed by Gavin Barraclough and Geoff Garen.
2725 Fix up exception checking code.
2728 (KJS::Machine::cti_op_call):
2729 (KJS::Machine::cti_op_resolve):
2730 (KJS::Machine::cti_op_construct):
2731 (KJS::Machine::cti_op_resolve_func):
2732 (KJS::Machine::cti_op_resolve_skip):
2733 (KJS::Machine::cti_op_resolve_with_base):
2734 (KJS::Machine::cti_op_call_eval):
2736 2008-08-26 Sam Weinig <sam@webkit.org>
2738 Reviewed by Oliver Hunt.
2740 Fix slowcase for op_post_inc and op_post_dec fixing 2 mozilla tests.
2743 (KJS::CTI::privateCompile_pass4_SlowCases):
2745 2008-08-26 Mark Rowe <mrowe@apple.com>
2747 Reviewed by Sam Weinig.
2749 Implement op_in, fixing 8 mozilla tests.
2752 (KJS::CTI::privateCompile_pass1_Scan):
2753 (KJS::CTI::privateCompile_pass2_Main):
2755 (KJS::Machine::cti_op_in):
2758 2008-08-26 Mark Rowe <mrowe@apple.com>
2760 Rubber-stamped by Oliver Hunt.
2762 Don't hardcode the size of a Register for op_new_array. Fixes a crash
2763 seen during the Mozilla tests.
2766 (KJS::CTI::privateCompile_pass2_Main):
2768 2008-08-26 Sam Weinig <sam@webkit.org>
2770 Reviewed by Gavin Barraclough and Geoff Garen.
2772 Add support for op_push_scope and op_pop_scope, fixing 20 mozilla tests.
2775 (KJS::CTI::privateCompile_pass1_Scan):
2776 (KJS::CTI::privateCompile_pass2_Main):
2779 (KJS::Machine::cti_op_push_scope):
2780 (KJS::Machine::cti_op_pop_scope):
2783 2008-08-26 Oliver Hunt <oliver@apple.com>
2785 Reviewed by Maciej Stachowiak.
2787 Add codegen support for op_del_by_id, fixing 49 mozilla tests.
2790 (KJS::CTI::privateCompile_pass1_Scan):
2791 (KJS::CTI::privateCompile_pass2_Main):
2793 (KJS::Machine::cti_op_del_by_id):
2796 2008-08-26 Sam Weinig <sam@webkit.org>
2798 Reviewed by Gavin Barraclough and Geoff Garen.
2800 Don't hardcode the size of a Register for op_get_scoped_var and op_put_scoped_var
2801 fixing 513 mozilla tests in debug build.
2804 (KJS::CTI::privateCompile_pass2_Main):
2806 2008-08-26 Oliver Hunt <oliver@apple.com>
2808 Reviewed by Maciej Stachowiak.
2810 Added code generator support for op_loop, fixing around 60 mozilla tests.
2813 (KJS::CTI::privateCompile_pass1_Scan):
2814 (KJS::CTI::privateCompile_pass2_Main):
2816 2008-08-26 Mark Rowe <mrowe@apple.com>
2818 Reviewed by Sam Weinig.
2820 Set -fomit-frame-pointer in the correct location.
2822 * Configurations/JavaScriptCore.xcconfig:
2823 * JavaScriptCore.xcodeproj/project.pbxproj:
2825 2008-08-26 Gavin Barraclough <barraclough@apple.com>
2827 Reviewed by Geoff Garen.
2829 Inital cut of CTI, Geoff's review fixes to follow.
2831 * JavaScriptCore.xcodeproj/project.pbxproj:
2832 * VM/CTI.cpp: Added.
2834 (KJS::CTI::ctiCompileGetArg):
2835 (KJS::CTI::ctiCompileGetPutArg):
2836 (KJS::CTI::ctiCompilePutArg):
2837 (KJS::CTI::ctiCompilePutArgImm):
2838 (KJS::CTI::ctiImmediateNumericArg):
2839 (KJS::CTI::ctiCompileGetCTIParam):
2840 (KJS::CTI::ctiCompilePutResult):
2841 (KJS::CTI::ctiCompileCall):
2842 (KJS::CTI::slowCaseIfNotImm):
2843 (KJS::CTI::slowCaseIfNotImms):
2844 (KJS::CTI::ctiFastArithDeTagConstImmediate):
2845 (KJS::CTI::ctiFastArithDeTagImmediate):
2846 (KJS::CTI::ctiFastArithReTagImmediate):
2847 (KJS::CTI::ctiFastArithPotentiallyReTagImmediate):
2848 (KJS::CTI::ctiFastArithImmToInt):
2849 (KJS::CTI::ctiFastArithIntToImmOrSlowCase):
2851 (KJS::CTI::privateCompile_pass1_Scan):
2852 (KJS::CTI::ctiCompileAdd):
2853 (KJS::CTI::ctiCompileAddImm):
2854 (KJS::CTI::ctiCompileAddImmNotInt):
2855 (KJS::CTI::TEMP_HACK_PRINT_TYPES):
2856 (KJS::CTI::privateCompile_pass2_Main):
2857 (KJS::CTI::privateCompile_pass3_Link):
2858 (KJS::CTI::privateCompile_pass4_SlowCases):
2859 (KJS::CTI::privateCompile):
2861 (KJS::CTI2Result::CTI2Result):
2862 (KJS::CallRecord::CallRecord):
2863 (KJS::JmpTable::JmpTable):
2864 (KJS::SlowCaseEntry::SlowCaseEntry):
2865 (KJS::CTI::compile):
2866 (KJS::CTI::LabelInfo::LabelInfo):
2868 (KJS::CodeBlock::CodeBlock):
2869 (KJS::CodeBlock::~CodeBlock):
2871 (KJS::Machine::execute):
2872 (KJS::Machine::privateExecute):
2873 (KJS::ctiException):
2874 (KJS::ctiUnsupported):
2876 (KJS::Machine::cti_op_end):
2877 (KJS::Machine::cti_op_add):
2878 (KJS::Machine::cti_op_pre_inc):
2879 (KJS::Machine::cti_timeout_check):
2880 (KJS::Machine::cti_op_loop_if_less):
2881 (KJS::Machine::cti_op_new_object):
2882 (KJS::Machine::cti_op_put_by_id):
2883 (KJS::Machine::cti_op_get_by_id):
2884 (KJS::Machine::cti_op_mul):
2885 (KJS::Machine::cti_op_new_func):
2886 (KJS::Machine::cti_op_call):
2887 (KJS::Machine::cti_op_ret):
2888 (KJS::Machine::cti_op_new_array):
2889 (KJS::Machine::cti_op_resolve):
2890 (KJS::Machine::cti_op_construct):
2891 (KJS::Machine::cti_op_get_by_val):
2892 (KJS::Machine::cti_op_resolve_func):
2893 (KJS::Machine::cti_op_sub):
2894 (KJS::Machine::cti_op_put_by_val):
2895 (KJS::Machine::cti_op_lesseq):
2896 (KJS::Machine::cti_op_loop_if_true):
2897 (KJS::Machine::cti_op_negate):
2898 (KJS::Machine::cti_op_resolve_base):
2899 (KJS::Machine::cti_op_resolve_skip):
2900 (KJS::Machine::cti_op_div):
2901 (KJS::Machine::cti_op_pre_dec):
2902 (KJS::Machine::cti_op_jless):
2903 (KJS::Machine::cti_op_not):
2904 (KJS::Machine::cti_op_jtrue):
2905 (KJS::Machine::cti_op_post_inc):
2906 (KJS::Machine::cti_op_eq):
2907 (KJS::Machine::cti_op_lshift):
2908 (KJS::Machine::cti_op_bitand):
2909 (KJS::Machine::cti_op_rshift):
2910 (KJS::Machine::cti_op_bitnot):
2911 (KJS::Machine::cti_op_resolve_with_base):
2912 (KJS::Machine::cti_op_new_func_exp):
2913 (KJS::Machine::cti_op_mod):
2914 (KJS::Machine::cti_op_less):
2915 (KJS::Machine::cti_op_neq):
2916 (KJS::Machine::cti_op_post_dec):
2917 (KJS::Machine::cti_op_urshift):
2918 (KJS::Machine::cti_op_bitxor):
2919 (KJS::Machine::cti_op_new_regexp):
2920 (KJS::Machine::cti_op_bitor):
2921 (KJS::Machine::cti_op_call_eval):
2922 (KJS::Machine::cti_op_throw):
2923 (KJS::Machine::cti_op_get_pnames):
2924 (KJS::Machine::cti_op_next_pname):
2925 (KJS::Machine::cti_op_typeof):
2926 (KJS::Machine::cti_op_stricteq):
2927 (KJS::Machine::cti_op_nstricteq):
2928 (KJS::Machine::cti_op_to_jsnumber):
2931 (KJS::Register::jsValue):
2932 (KJS::Register::getJSValue):
2933 (KJS::Register::codeBlock):
2934 (KJS::Register::scopeChain):
2937 (KJS::Register::vPC):
2938 (KJS::Register::jsPropertyNameIterator):
2939 * VM/SamplingTool.cpp:
2941 (KJS::SamplingTool::run):
2942 (KJS::SamplingTool::dump):
2943 * VM/SamplingTool.h:
2944 * kjs/JSImmediate.h:
2945 (KJS::JSImmediate::zeroImmediate):
2946 (KJS::JSImmediate::oneImmediate):
2948 * kjs/JSVariableObject.h:
2949 (KJS::JSVariableObject::JSVariableObjectData::offsetOf_registers):
2950 (KJS::JSVariableObject::offsetOf_d):
2951 (KJS::JSVariableObject::offsetOf_Data_registers):
2953 * masm/IA32MacroAsm.h: Added.
2954 (KJS::JITCodeBuffer::JITCodeBuffer):
2955 (KJS::JITCodeBuffer::putByte):
2956 (KJS::JITCodeBuffer::putShort):
2957 (KJS::JITCodeBuffer::putInt):
2958 (KJS::JITCodeBuffer::getEIP):
2959 (KJS::JITCodeBuffer::start):
2960 (KJS::JITCodeBuffer::getOffset):
2961 (KJS::JITCodeBuffer::reset):
2962 (KJS::JITCodeBuffer::copy):
2963 (KJS::IA32MacroAssembler::):
2964 (KJS::IA32MacroAssembler::emitModRm_rr):
2965 (KJS::IA32MacroAssembler::emitModRm_rm):
2966 (KJS::IA32MacroAssembler::emitModRm_rmsib):
2967 (KJS::IA32MacroAssembler::emitModRm_opr):
2968 (KJS::IA32MacroAssembler::emitModRm_opm):
2969 (KJS::IA32MacroAssembler::IA32MacroAssembler):
2970 (KJS::IA32MacroAssembler::emitInt3):
2971 (KJS::IA32MacroAssembler::emitPushl_r):
2972 (KJS::IA32MacroAssembler::emitPopl_r):
2973 (KJS::IA32MacroAssembler::emitMovl_rr):
2974 (KJS::IA32MacroAssembler::emitAddl_rr):
2975 (KJS::IA32MacroAssembler::emitAddl_i8r):
2976 (KJS::IA32MacroAssembler::emitAddl_i32r):
2977 (KJS::IA32MacroAssembler::emitAddl_mr):
2978 (KJS::IA32MacroAssembler::emitAndl_rr):
2979 (KJS::IA32MacroAssembler::emitAndl_i32r):
2980 (KJS::IA32MacroAssembler::emitCmpl_i8r):
2981 (KJS::IA32MacroAssembler::emitCmpl_rr):
2982 (KJS::IA32MacroAssembler::emitCmpl_rm):
2983 (KJS::IA32MacroAssembler::emitCmpl_i32r):
2984 (KJS::IA32MacroAssembler::emitCmpw_rm):
2985 (KJS::IA32MacroAssembler::emitOrl_rr):
2986 (KJS::IA32MacroAssembler::emitOrl_i8r):
2987 (KJS::IA32MacroAssembler::emitSubl_rr):
2988 (KJS::IA32MacroAssembler::emitSubl_i8r):
2989 (KJS::IA32MacroAssembler::emitSubl_i32r):
2990 (KJS::IA32MacroAssembler::emitSubl_mr):
2991 (KJS::IA32MacroAssembler::emitTestl_i32r):
2992 (KJS::IA32MacroAssembler::emitTestl_rr):
2993 (KJS::IA32MacroAssembler::emitXorl_i8r):
2994 (KJS::IA32MacroAssembler::emitXorl_rr):
2995 (KJS::IA32MacroAssembler::emitSarl_i8r):
2996 (KJS::IA32MacroAssembler::emitSarl_CLr):
2997 (KJS::IA32MacroAssembler::emitShl_i8r):
2998 (KJS::IA32MacroAssembler::emitShll_CLr):
2999 (KJS::IA32MacroAssembler::emitMull_rr):
3000 (KJS::IA32MacroAssembler::emitIdivl_r):
3001 (KJS::IA32MacroAssembler::emitCdq):
3002 (KJS::IA32MacroAssembler::emitMovl_mr):
3003 (KJS::IA32MacroAssembler::emitMovzwl_mr):
3004 (KJS::IA32MacroAssembler::emitMovl_rm):
3005 (KJS::IA32MacroAssembler::emitMovl_i32r):
3006 (KJS::IA32MacroAssembler::emitMovl_i32m):
3007 (KJS::IA32MacroAssembler::emitLeal_mr):
3008 (KJS::IA32MacroAssembler::emitRet):
3009 (KJS::IA32MacroAssembler::JmpSrc::JmpSrc):
3010 (KJS::IA32MacroAssembler::JmpDst::JmpDst):
3011 (KJS::IA32MacroAssembler::emitCall):
3012 (KJS::IA32MacroAssembler::label):
3013 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
3014 (KJS::IA32MacroAssembler::emitUnlinkedJne):
3015 (KJS::IA32MacroAssembler::emitUnlinkedJe):
3016 (KJS::IA32MacroAssembler::emitUnlinkedJl):
3017 (KJS::IA32MacroAssembler::emitUnlinkedJle):
3018 (KJS::IA32MacroAssembler::emitUnlinkedJge):
3019 (KJS::IA32MacroAssembler::emitUnlinkedJae):
3020 (KJS::IA32MacroAssembler::emitUnlinkedJo):
3021 (KJS::IA32MacroAssembler::emitPredictionNotTaken):
3022 (KJS::IA32MacroAssembler::link):
3023 (KJS::IA32MacroAssembler::copy):
3026 2008-08-26 Oliver Hunt <oliver@apple.com>
3030 Enabled -fomit-frame-pointer on Release and Production builds, add additional Profiling build config for shark, etc.
3032 * JavaScriptCore.xcodeproj/project.pbxproj:
3034 === Start merge of squirrelfish-extreme ===
3036 2008-09-06 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3038 Reviewed by Maciej Stachowiak.
3040 Fix the Mac Debug build by adding symbols that are exported only in a
3041 Debug configuration.
3043 * Configurations/JavaScriptCore.xcconfig:
3044 * DerivedSources.make:
3045 * JavaScriptCore.Debug.exp: Added.
3046 * JavaScriptCore.base.exp: Copied from JavaScriptCore.exp.
3047 * JavaScriptCore.exp: Removed.
3048 * JavaScriptCore.xcodeproj/project.pbxproj:
3050 2008-09-05 Darin Adler <darin@apple.com>
3052 Reviewed by Cameron Zwarich.
3054 - https://bugs.webkit.org/show_bug.cgi?id=20681
3055 JSPropertyNameIterator functions need to be inlined
3057 1.007x as fast on SunSpider overall
3058 1.081x as fast on SunSpider math-cordic
3060 * VM/JSPropertyNameIterator.cpp: Moved functions out of here.
3061 * VM/JSPropertyNameIterator.h:
3062 (KJS::JSPropertyNameIterator::JSPropertyNameIterator): Moved
3063 this into the header and marked it inline.
3064 (KJS::JSPropertyNameIterator::create): Ditto.
3065 (KJS::JSPropertyNameIterator::next): Ditto.
3067 2008-09-05 Darin Adler <darin@apple.com>
3069 Reviewed by Geoffrey Garen.
3071 - fix https://bugs.webkit.org/show_bug.cgi?id=20673
3072 single-character strings are churning in the Identifier table
3074 1.007x as fast on SunSpider overall
3075 1.167x as fast on SunSpider string-fasta
3077 * JavaScriptCore.exp: Updated.
3078 * kjs/SmallStrings.cpp:
3079 (KJS::SmallStrings::singleCharacterStringRep): Added.
3080 * kjs/SmallStrings.h: Added singleCharacterStringRep for clients that
3081 need just a UString, not a JSString.
3082 * kjs/identifier.cpp:
3083 (KJS::Identifier::add): Added special cases for single character strings
3084 so that the UString::Rep that ends up in the identifier table is the one
3085 from the single-character string optimization; otherwise we end up having
3086 to look it up in the identifier table over and over again.
3087 (KJS::Identifier::addSlowCase): Ditto.
3088 (KJS::Identifier::checkSameIdentifierTable): Made this function an empty
3089 inline in release builds so that callers don't have to put #ifndef NDEBUG
3092 (KJS::Identifier::add): Removed #ifndef NDEBUG around the calls to
3093 checkSameIdentifierTable.
3094 (KJS::Identifier::checkSameIdentifierTable): Added. Empty inline version
3097 2008-09-05 Mark Rowe <mrowe@apple.com>
3101 * kjs/JSObject.h: Move the inline virtual destructor after a non-inline
3102 virtual function so that the symbol for the vtable is not marked as a
3103 weakly exported symbol.
3105 2008-09-05 Darin Adler <darin@apple.com>
3107 Reviewed by Sam Weinig.
3109 - fix https://bugs.webkit.org/show_bug.cgi?id=20671
3110 JavaScriptCore string manipulation spends too much time in memcpy
3112 1.011x as fast on SunSpider overall
3113 1.028x as fast on SunSpider string tests
3115 For small strings, use a loop rather than calling memcpy. The loop can
3116 be faster because there's no function call overhead, and because it can
3117 assume the pointers are aligned instead of checking that. Currently the
3118 threshold is set at 20 characters, based on some testing on one particular
3119 computer. Later we can tune this for various platforms by setting
3120 USTRING_COPY_CHARS_INLINE_CUTOFF appropriately, but it does no great harm
3121 if not perfectly tuned.
3124 (KJS::overflowIndicator): Removed bogus const.
3125 (KJS::maxUChars): Ditto.
3126 (KJS::copyChars): Added.
3127 (KJS::UString::Rep::createCopying): Call copyChars instead of memcpy.
3128 Also eliminated need for const_cast.
3129 (KJS::UString::expandPreCapacity): Ditto.
3130 (KJS::concatenate): Ditto.
3131 (KJS::UString::spliceSubstringsWithSeparators): Ditto.
3132 (KJS::UString::append): Ditto.
3134 2008-09-05 Kevin McCullough <kmccullough@apple.com>
3136 Reviewed by Sam and Alexey.
3138 Make the profiler work with a null exec state. This will allow other
3139 applications start the profiler to get DTrace probes going without
3143 * profiler/ProfileGenerator.cpp:
3144 (KJS::ProfileGenerator::ProfileGenerator):
3145 (KJS::ProfileGenerator::willExecute):
3146 (KJS::ProfileGenerator::didExecute):
3147 * profiler/Profiler.cpp:
3148 (KJS::Profiler::startProfiling):
3149 (KJS::Profiler::stopProfiling):
3150 (KJS::dispatchFunctionToProfiles):
3152 2008-09-04 Gavin Barraclough <barraclough@apple.com>
3154 Reviewed by Geoffrey Garen.
3156 Fixed an off-by-one error that would cause the StructureIDChain to
3157 be one object too short.
3159 Can't construct a test case because other factors make this not crash
3162 * kjs/StructureID.cpp:
3163 (KJS::StructureIDChain::StructureIDChain):
3165 2008-09-04 Kevin Ollivier <kevino@theolliviers.com>
3169 * JavaScriptCoreSources.bkl:
3171 2008-09-04 Mark Rowe <mrowe@apple.com>
3173 Reviewed by Eric Seidel.
3175 Fix https://bugs.webkit.org/show_bug.cgi?id=20639.
3176 Bug 20639: ENABLE_DASHBOARD_SUPPORT does not need to be a FEATURE_DEFINE
3178 * Configurations/JavaScriptCore.xcconfig: Remove ENABLE_DASHBOARD_SUPPORT from FEATURE_DEFINES.
3179 * wtf/Platform.h: Set ENABLE_DASHBOARD_SUPPORT for PLATFORM(MAC).
3181 2008-09-04 Adele Peterson <adele@apple.com>
3185 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3186 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3187 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
3189 2008-09-04 Mark Rowe <mrowe@apple.com>
3193 * kjs/config.h: Only check the value of HAVE_CONFIG_H if it is defined.
3195 2008-09-04 Marco Barisione <marco.barisione@collabora.co.uk>
3197 Reviewed by Eric Seidel.
3199 http://bugs.webkit.org/show_bug.cgi?id=20380
3200 [GTK][AUTOTOOLS] Include autotoolsconfig.h from config.h
3202 * kjs/config.h: Include the configuration header generated by
3203 autotools if available.
3205 2008-09-04 Tor Arne Vestbø <tavestbo@trolltech.com>
3209 Fix the QtWebKit build to match changes in r36016
3211 * JavaScriptCore.pri:
3213 2008-09-04 Mark Rowe <mrowe@apple.com>
3215 Fix the 64-bit build.
3218 (KJS::CodeBlock::printStructureID): Store the instruction offset into an unsigned local
3219 to avoid a warning related to format specifiers.
3220 (KJS::CodeBlock::printStructureIDs): Ditto.
3222 2008-09-04 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3224 Rubber-stamped by Oliver Hunt.
3226 Correct the spelling of 'entryIndices'.
3228 * kjs/PropertyMap.cpp:
3229 (KJS::PropertyMap::get):
3230 (KJS::PropertyMap::getLocation):
3231 (KJS::PropertyMap::put):
3232 (KJS::PropertyMap::insert):
3233 (KJS::PropertyMap::remove):
3234 (KJS::PropertyMap::checkConsistency):
3235 * kjs/PropertyMap.h:
3236 (KJS::PropertyMapHashTable::entries):
3237 (KJS::PropertyMap::getOffset):
3238 (KJS::PropertyMap::putOffset):
3239 (KJS::PropertyMap::offsetForTableLocation):
3241 2008-09-03 Geoffrey Garen <ggaren@apple.com>
3243 Reviewed by Cameron Zwarich.
3245 Fixed <rdar://problem/6193925> REGRESSION: Crash occurs at
3246 KJS::Machine::privateExecute() when attempting to load my Mobile Gallery
3247 (http://www.me.com/gallery/#home)
3251 https://bugs.webkit.org/show_bug.cgi?id=20633 Crash in privateExecute
3254 The underlying problem was that we would cache prototype properties
3255 even if the prototype was a dictionary.
3257 The fix is to transition a prototype back from dictionary to normal
3258 status when an opcode caches access to it. (This is better than just
3259 refusing to cache, since a heavily accessed prototype is almost
3260 certainly not a true dictionary.)
3263 (KJS::Machine::tryCacheGetByID):
3266 2008-09-03 Eric Seidel <eric@webkit.org>
3270 Clean up Platform.h and add PLATFORM(CHROMIUM), PLATFORM(SKIA) and USE(V8_BINDINGS)
3272 * Configurations/JavaScriptCore.xcconfig: add missing ENABLE_*
3273 * wtf/ASCIICType.h: include <wtf/Assertions.h> since it depends on it.
3276 2008-09-03 Kevin McCullough <kmccullough@apple.com>
3280 Remove the rest of the "zombie" code from the profiler.
3281 - There is no longer a need for the ProfilerClient callback mechanism.
3283 * API/JSProfilerPrivate.cpp:
3285 * JavaScriptCore.exp:
3286 * profiler/HeavyProfile.h:
3287 * profiler/ProfileGenerator.cpp:
3288 (KJS::ProfileGenerator::create):
3289 (KJS::ProfileGenerator::ProfileGenerator):
3290 * profiler/ProfileGenerator.h:
3291 (KJS::ProfileGenerator::profileGroup):
3292 * profiler/Profiler.cpp:
3293 (KJS::Profiler::startProfiling):
3294 (KJS::Profiler::stopProfiling): Immediately return the profile when
3295 stopped instead of using a callback.
3296 * profiler/Profiler.h:
3297 * profiler/TreeProfile.h:
3299 2008-09-03 Adele Peterson <adele@apple.com>
3303 * wtf/win/MainThreadWin.cpp:
3305 2008-09-02 Kevin McCullough <kmccullough@apple.com>
3307 Reviewed by Darin and Tim.
3309 Remove most of the "zombie" mode from the profiler. Next we will need
3310 to remove the client callback mechanism in profiles.
3312 - This simplifies the code, leverages the recent changes I've made in
3313 getting line numbers from SquirrelFish, and is a slight speed
3314 improvement on SunSpider.
3315 - Also the "zombie" mode was a constant source of odd edge cases and
3316 obscure bugs so it's good to remove since all of its issues may not have
3319 * API/JSProfilerPrivate.cpp: No need to call didFinishAllExecution() any
3322 * JavaScriptCore.exp: Export the new signature of retrieveLastCaller()
3324 (KJS::Machine::execute): No need to call didFinishAllExecution() any
3326 (KJS::Machine::retrieveCaller): Now operates on InternalFunctions now
3327 since the RegisterFile is no longer guaranteeded to store only
3329 (KJS::Machine::retrieveLastCaller): Now also retrieve the function's
3331 (KJS::Machine::callFrame): A result of changing retrieveCaller()
3334 * kjs/JSGlobalObject.cpp:
3335 (KJS::JSGlobalObject::~JSGlobalObject):
3337 * profiler/ProfileGenerator.cpp:
3338 (KJS::ProfileGenerator::create): Now pass the original exec and get the
3339 global exec and client when necessary. We need the original exec so we
3340 can have the stack frame where profiling started.
3341 (KJS::ProfileGenerator::ProfileGenerator): ditto.
3342 (KJS::ProfileGenerator::addParentForConsoleStart): This is where the
3343 parent to star of the profile is added, if there is one.
3344 (KJS::ProfileGenerator::willExecute): Remove uglyness!
3345 (KJS::ProfileGenerator::didExecute): Ditto!
3346 (KJS::ProfileGenerator::stopProfiling):
3347 (KJS::ProfileGenerator::removeProfileStart): Use a better way to find
3348 and remove the function we are looking for.
3349 (KJS::ProfileGenerator::removeProfileEnd): Ditto.
3350 * profiler/ProfileGenerator.h:
3351 (KJS::ProfileGenerator::client):
3352 * profiler/ProfileNode.cpp:
3353 (KJS::ProfileNode::removeChild): Add a better way to remove a child from
3355 (KJS::ProfileNode::stopProfiling):
3356 (KJS::ProfileNode::debugPrintData): Modified a debug-only diagnostic
3357 function to be sane.
3358 * profiler/ProfileNode.h:
3359 * profiler/Profiler.cpp: Change to pass the original exec state.
3360 (KJS::Profiler::startProfiling):
3361 (KJS::Profiler::stopProfiling):
3362 (KJS::Profiler::willExecute):
3363 (KJS::Profiler::didExecute):
3364 (KJS::Profiler::createCallIdentifier):
3365 * profiler/Profiler.h:
3367 2008-09-01 Alexey Proskuryakov <ap@webkit.org>
3369 Reviewed by Darin Adler.
3371 Implement callOnMainThreadAndWait().
3373 This will be useful when a background thread needs to perform UI calls synchronously
3374 (e.g. an openDatabase() call cannot return until the user answers to a confirmation dialog).
3376 * wtf/MainThread.cpp:
3377 (WTF::FunctionWithContext::FunctionWithContext): Added a ThreadCondition member. When
3378 non-zero, the condition is signalled after the function is called.
3379 (WTF::mainThreadFunctionQueueMutex): Renamed from functionQueueMutex, sinc this is no longer
3380 static. Changed to be initialized from initializeThreading() to avoid lock contention.
3381 (WTF::initializeMainThread): On non-Windows platforms, just call mainThreadFunctionQueueMutex.
3382 (WTF::dispatchFunctionsFromMainThread): Signal synchronous calls when done.
3383 (WTF::callOnMainThread): Updated for functionQueueMutex rename.
3384 (WTF::callOnMainThreadAndWait): Added.
3386 * wtf/MainThread.h: Added callOnMainThreadAndWait(); initializeMainThread() now exists on
3389 * wtf/win/MainThreadWin.cpp: (WTF::initializeMainThread): Added a callOnMainThreadAndWait()
3390 call to initialize function queue mutex.
3392 * wtf/ThreadingGtk.cpp: (WTF::initializeThreading):
3393 * wtf/ThreadingPthreads.cpp: (WTF::initializeThreading):
3394 * wtf/ThreadingQt.cpp: (WTF::initializeThreading):
3395 Only initialize mainThreadIdentifier on non-Darwin platforms. It was not guaranteed to be
3398 2008-09-03 Geoffrey Garen <ggaren@apple.com>
3400 Reviewed by Darin Adler.
3402 Use isUndefinedOrNull() instead of separate checks for each in op_eq_null
3406 (KJS::Machine::privateExecute):
3408 2008-09-02 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
3410 Reviewed by Darin Adler.
3412 Bug 20296: OpcodeStats doesn't build on platforms which don't have mergesort().
3413 <https://bugs.webkit.org/show_bug.cgi?id=20296>
3416 (KJS::OpcodeStats::~OpcodeStats): mergesort() replaced with qsort()
3418 2008-09-02 Geoffrey Garen <ggaren@apple.com>
3420 Reviewed by Oliver Hunt.
3422 Fast path for array.length and string.length.
3424 SunSpider says 0.5% faster.
3426 2008-09-02 Geoffrey Garen <ggaren@apple.com>
3428 Reviewed by Anders Carlsson.
3430 Added optimized paths for comparing to null.
3432 SunSpider says 0.5% faster.
3434 2008-09-02 Geoffrey Garen <ggaren@apple.com>
3436 Reviewed by Sam Weinig.
3438 Changed jsDriver.pl to dump the exact text you would need in order to
3439 reproduce a test result. This enables a fast workflow where you copy
3440 and paste a test failure in the terminal.
3442 * tests/mozilla/jsDriver.pl:
3444 2008-09-02 Geoffrey Garen <ggaren@apple.com>
3446 Reviewed by Sam Weinig.
3448 Implemented the rest of Darin's review comments for the 09-01 inline
3451 SunSpider says 0.5% faster, but that seems like noise.
3453 * JavaScriptCore.xcodeproj/project.pbxproj: Put PutPropertySlot into
3454 its own file, and added BatchedTransitionOptimizer.
3457 (KJS::CodeBlock::~CodeBlock): Use array indexing instead of a pointer
3460 * VM/CodeGenerator.cpp:
3461 (KJS::CodeGenerator::CodeGenerator): Used BatchedTransitionOptimizer to
3462 make batched put and remove for declared variables fast, without forever
3463 pessimizing the global object. Removed the old getDirect/removeDirect hack
3464 that tried to do the same in a more limited way.
3466 * VM/CodeGenerator.h: Moved IdentifierRepHash to the KJS namespace since
3467 it doesn't specialize anything in WTF.
3470 (KJS::Machine::Machine): Nixed the DummyConstruct tag because it was
3473 (KJS::Machine::execute): Used BatchedTransitionOptimizer, as above. Fixed
3476 (KJS::cachePrototypeChain): Cast to JSObject*, since it's more specific.
3478 (KJS::Machine::tryCachePutByID): Use isNull() instead of comparing to
3479 jsNull(), since isNull() leaves more options open for the future.
3480 (KJS::Machine::tryCacheGetByID): ditto
3481 (KJS::Machine::privateExecute): ditto
3483 * VM/SamplingTool.cpp:
3484 (KJS::SamplingTool::dump): Use C++-style cast, to match our style
3487 * kjs/BatchedTransitionOptimizer.h: Added. New class that allows host
3488 code to add a batch of properties to an object in an efficient way.
3490 * kjs/JSActivation.cpp: Use isNull(), as above.
3492 * kjs/JSArray.cpp: Get rid of DummyConstruct tag, as above.
3495 * kjs/JSGlobalData.cpp: Nixed two unused StructureIDs.
3496 * kjs/JSGlobalData.h:
3498 * kjs/JSImmediate.cpp: Use isNull(), as above.
3501 (KJS::JSObject::mark): Moved mark tracing code elsewhere, to make this
3502 function more readable.
3504 (KJS::JSObject::put): Use isNull(), as above.
3506 (KJS::JSObject::createInheritorID): Return a raw pointer, since the
3507 object is owned by a data member, not necessarily the caller.
3510 * kjs/JSString.cpp: Use isNull(), as above.
3512 * kjs/PropertyMap.h: Updated to use PropertySlot::invalidOffset.
3514 * kjs/PropertySlot.h: Changed KJS_INVALID_OFFSET to WTF::notFound
3515 because C macros are so 80's.
3517 * kjs/PutPropertySlot.h: Added. Split out of PropertySlot.h. Also renamed
3518 PutPropertySlot::SlotType to PutPropertySlot::Type, and slotBase to base,
3519 since "slot" was redundant.
3521 * kjs/StructureID.cpp: Added a new transition *away* from dictionary
3522 status, to support BatchedTransitionOptimizer.
3524 (KJS::StructureIDChain::StructureIDChain): No need to store m_size as
3525 a data member, so keep it in a local, which might be faster.
3526 * kjs/StructureID.h:
3528 * kjs/SymbolTable.h: Moved IdentifierRepHash to KJS namespace, as above.
3531 2008-09-02 Adam Roben <aroben@apple.com>
3535 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
3536 StructureID.{cpp,h} to the project. Also let VS reorder this file.
3537 * VM/CodeBlock.cpp: Include StringExtras so that snprintf will be
3540 2008-09-01 Sam Weinig <sam@webkit.org>
3544 * JavaScriptCore.exp:
3546 2008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
3548 Reviewed by Oliver Hunt.
3553 * kjs/PropertyMap.cpp: rename Identifier.h to identifier.h
3554 * kjs/StructureID.cpp: include JSObject.h
3556 2008-09-01 Geoffrey Garen <ggaren@apple.com>
3558 Reviewed by Darin Adler.
3560 First cut at inline caching for access to vanilla JavaScript properties.
3562 SunSpider says 4% faster. Tests heavy on dictionary-like access have
3563 regressed a bit -- we have a lot of room to improve in this area,
3564 but this patch is over-ripe as-is.
3566 JSCells now have a StructureID that uniquely identifies their layout,
3567 and holds their prototype.
3569 JSValue::put takes a PropertySlot& argument, so it can fill in details
3570 about where it put a value, for the sake of caching.
3572 * VM/CodeGenerator.cpp:
3573 (KJS::CodeGenerator::CodeGenerator): Avoid calling removeDirect if we
3574 can, since it disables inline caching in the global object. This can
3575 probably improve in the future.
3577 * kjs/JSGlobalObject.cpp: Nixed reset(), since it complicates caching, and
3578 wasn't really necessary.
3580 * kjs/JSObject.cpp: Tweaked getter / setter behavior not to rely on the
3581 IsGetterSetter flag, since the flag was buggy. This is necessary in order
3582 to avoid accidentally accessing a getter / setter as a normal property.
3584 Also changed getter / setter creation to honor ReadOnly, matching Mozilla.
3586 * kjs/PropertyMap.cpp: Nixed clear(), since it complicates caching and
3589 * kjs/Shell.cpp: Moved SamplingTool dumping outside the loop. This allows
3590 you to aggregate sampling of multiple files (or the same file repeatedly),
3591 which helped me track down regressions.
3593 * kjs/ustring.h: Moved IdentifierRepHash here to share it.
3595 2008-09-01 Geoffrey Garen <ggaren@apple.com>
3597 Reviewed by Sam Weinig.
3599 Eagerly allocate the Math object's numeric constants. This avoids
3600 constantly reallocating them in loops, and also ensures that the Math
3601 object will not use the single property optimization, which makes
3602 properties ineligible for caching.
3604 SunSpider reports a small speedup, in combination with inline caching.
3606 * kjs/MathObject.cpp:
3607 (KJS::MathObject::MathObject):
3608 (KJS::MathObject::getOwnPropertySlot):
3611 2008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
3613 Gtk build fix, not reviewed.
3615 * GNUmakefile.am: Add SmallStrings.cpp in both release and debug builds
3617 2008-08-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3619 Reviewed by Maciej Stachowiak.
3621 Bug 20577: REGRESSION (r36006): Gmail is broken
3622 <https://bugs.webkit.org/show_bug.cgi?id=20577>
3624 r36006 changed stringProtoFuncSubstr() so that it is uses the more
3625 efficient jsSubstring(), rather than using UString::substr() and then
3626 calling jsString(). However, the change did not account for the case
3627 where the start and the length of the substring extend beyond the length
3628 of the original string. This patch corrects that.
3630 * kjs/StringPrototype.cpp:
3631 (KJS::stringProtoFuncSubstr):
3633 2008-08-31 Simon Hausmann <hausmann@wekit.org>
3635 Unreviewed build fix (with gcc 4.3)
3637 * kjs/ustring.h: Properly forward declare operator== for UString and
3638 the the concatenate functions inside the KJS namespace.
3640 2008-08-30 Darin Adler <darin@apple.com>
3644 - https://bugs.webkit.org/show_bug.cgi?id=20333
3645 improve JavaScript speed when handling single-character strings
3647 1.035x as fast on SunSpider overall.
3648 1.127x as fast on SunSpider string tests.
3649 1.910x as fast on SunSpider string-base64 test.
3651 * API/JSObjectRef.cpp:
3652 (JSObjectMakeFunction): Removed unneeded explicit construction of UString.
3654 * GNUmakefile.am: Added SmallStrings.h and SmallStrings.cpp.
3655 * JavaScriptCore.pri: Ditto.
3656 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3658 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
3659 * JavaScriptCoreSources.bkl: Ditto.
3661 * JavaScriptCore.exp: Updated.
3664 (KJS::jsAddSlowCase): Changed to use a code path that doesn't involve
3665 a UString constructor. This avoids an extra jump caused by the "in charge"
3666 vs. "not in charge" constructors.
3667 (KJS::jsAdd): Ditto.
3668 (KJS::jsTypeStringForValue): Adopted jsNontrivialString.
3670 * kjs/ArrayPrototype.cpp:
3671 (KJS::arrayProtoFuncToString): Adopted jsEmptyString.
3672 (KJS::arrayProtoFuncToLocaleString): Ditto.
3673 (KJS::arrayProtoFuncJoin): Ditto.
3674 * kjs/BooleanPrototype.cpp:
3675 (KJS::booleanProtoFuncToString): Adopted jsNontrivialString.
3676 * kjs/DateConstructor.cpp:
3677 (KJS::callDate): Ditto.
3678 * kjs/DatePrototype.cpp:
3679 (KJS::formatLocaleDate): Adopted jsEmptyString and jsNontrivialString.
3680 (KJS::dateProtoFuncToString): Ditto.
3681 (KJS::dateProtoFuncToUTCString): Ditto.
3682 (KJS::dateProtoFuncToDateString): Ditto.
3683 (KJS::dateProtoFuncToTimeString): Ditto.
3684 (KJS::dateProtoFuncToLocaleString): Ditto.
3685 (KJS::dateProtoFuncToLocaleDateString): Ditto.
3686 (KJS::dateProtoFuncToLocaleTimeString): Ditto.
3687 (KJS::dateProtoFuncToGMTString): Ditto.
3689 * kjs/ErrorPrototype.cpp:
3690 (KJS::ErrorPrototype::ErrorPrototype): Ditto.
3691 (KJS::errorProtoFuncToString): Ditto.
3693 * kjs/JSGlobalData.h: Added SmallStrings.
3696 (KJS::jsString): Eliminated the overload that takes a const char*.
3697 Added code to use SmallStrings to get strings of small sizes rather
3698 than creating a new JSString every time.
3699 (KJS::jsSubstring): Added. Used when creating a string from a substring
3700 to avoid creating a JSString in cases where the substring will end up
3701 empty or as one character.
3702 (KJS::jsOwnedString): Added the same code as in jsString.
3704 * kjs/JSString.h: Added new functions jsEmptyString, jsSingleCharacterString,
3705 jsSingleCharacterSubstring, jsSubstring, and jsNontrivialString for various
3706 cases where we want to create JSString, and want special handling for small
3708 (KJS::JSString::JSString): Added an overload that takes a PassRefPtr of
3709 a UString::Rep so you don't have to construct a UString; PassRefPtr can be
3711 (KJS::jsEmptyString): Added.
3712 (KJS::jsSingleCharacterString): Added.
3713 (KJS::jsSingleCharacterSubstring): Added.
3714 (KJS::jsNontrivialString): Added.
3715 (KJS::JSString::getIndex): Adopted jsSingleCharacterSubstring.
3716 (KJS::JSString::getStringPropertySlot): Ditto.
3718 * kjs/NumberPrototype.cpp:
3719 (KJS::numberProtoFuncToFixed): Adopted jsNontrivialString.
3720 (KJS::numberProtoFuncToExponential): Ditto.
3721 (KJS::numberProtoFuncToPrecision): Ditto.
3723 * kjs/ObjectPrototype.cpp:
3724 (KJS::objectProtoFuncToLocaleString): Adopted toThisJSString.
3725 (KJS::objectProtoFuncToString): Adopted jsNontrivialString.
3727 * kjs/RegExpConstructor.cpp: Separated the lastInput value that's used
3728 with the lastOvector to return matches from the input value that can be
3729 changed via JavaScript. They will be equal in many cases, but not all.
3730 (KJS::RegExpConstructor::performMatch): Set input.
3731 (KJS::RegExpMatchesArray::RegExpMatchesArray): Ditto.
3732 (KJS::RegExpMatchesArray::fillArrayInstance): Adopted jsSubstring. Also,
3733 use input rather than lastInput in the appropriate place.
3734 (KJS::RegExpConstructor::getBackref): Adopted jsSubstring and jsEmptyString.
3735 Added code to handle the case where there is no backref -- before this
3736 depended on range checking in UString::substr which is not present in
3738 (KJS::RegExpConstructor::getLastParen): Ditto.
3739 (KJS::RegExpConstructor::getLeftContext): Ditto.
3740 (KJS::RegExpConstructor::getRightContext): Ditto.
3741 (KJS::RegExpConstructor::getValueProperty): Use input rather than lastInput.
3742 Also adopt jsEmptyString.
3743 (KJS::RegExpConstructor::putValueProperty): Ditto.
3744 (KJS::RegExpConstructor::input): Ditto.
3746 * kjs/RegExpPrototype.cpp:
3747 (KJS::regExpProtoFuncToString): Adopt jsNonTrivialString. Also changed to
3748 use UString::append to append single characters rather than using += and
3751 * kjs/SmallStrings.cpp: Added.
3752 (KJS::SmallStringsStorage::SmallStringsStorage): Construct the
3753 buffer and UString::Rep for all 256 single-character strings for
3754 the U+0000 through U+00FF. This covers all the values used in
3755 the base64 test as well as most values seen elsewhere on the web
3756 as well. It's possible that later we might fix this to only work
3757 for U+0000 through U+007F but the others are used quite a bit in
3758 the current version of the base64 test.
3759 (KJS::SmallStringsStorage::~SmallStringsStorage): Free memory.
3760 (KJS::SmallStrings::SmallStrings): Create a set of small strings,
3761 initially not created; created later when they are used.
3762 (KJS::SmallStrings::~SmallStrings): Deallocate. Not left compiler
3763 generated because the SmallStringsStorage class's destructor needs
3765 (KJS::SmallStrings::mark): Mark all the strings.
3766 (KJS::SmallStrings::createEmptyString): Create a cell for the
3767 empty string. Called only the first time.
3768 (KJS::SmallStrings::createSingleCharacterString): Create a cell
3769 for one of the single-character strings. Called only the first time.
3770 * kjs/SmallStrings.h: Added.
3772 * kjs/StringConstructor.cpp:
3773 (KJS::stringFromCharCodeSlowCase): Factored out of strinFromCharCode.
3774 Only used for cases where the caller does not pass exactly one argument.
3775 (KJS::stringFromCharCode): Adopted jsSingleCharacterString.
3776 (KJS::callStringConstructor): Adopted jsEmptyString.
3778 * kjs/StringObject.cpp:
3779 (KJS::StringObject::StringObject): Adopted jsEmptyString.
3781 * kjs/StringPrototype.cpp:
3782 (KJS::stringProtoFuncReplace): Adopted jsSubstring.
3783 (KJS::stringProtoFuncCharAt): Adopted jsEmptyString and
3784 jsSingleCharacterSubstring and also added a special case when the
3785 index is an immediate number to avoid conversion to and from floating
3786 point, since that's the common case.
3787 (KJS::stringProtoFuncCharCodeAt): Ditto.
3788 (KJS::stringProtoFuncMatch): Adopted jsSubstring and jsEmptyString.
3789 (KJS::stringProtoFuncSlice): Adopted jsSubstring and
3790 jsSingleCharacterSubstring. Also got rid of some unneeded locals and
3791 removed unneeded code to set the length property of the array, since it
3792 is automatically updated as values are added to the array.
3793 (KJS::stringProtoFuncSplit): Adopted jsEmptyString.
3794 (KJS::stringProtoFuncSubstr): Adopted jsSubstring.
3795 (KJS::stringProtoFuncSubstring): Ditto.
3797 * kjs/collector.cpp:
3798 (KJS::Heap::collect): Added a call to mark SmallStrings.
3801 (KJS::UString::expandedSize): Made this a static member function since
3802 it doesn't need to look at any data members.
3803 (KJS::UString::expandCapacity): Use a non-inline function, makeNull, to
3804 set the rep to null in failure cases. This avoids adding a PIC branch for
3805 the normal case when there is no failure.
3806 (KJS::UString::expandPreCapacity): Ditto.
3807 (KJS::UString::UString): Ditto.
3808 (KJS::concatenate): Refactored the concatenation constructor into this
3809 separate function. Calling the concatenation constructor was leading to
3810 an extra branch because of the in-charge vs. not-in-charge versions not
3811 both being inlined, and this was showing up as nearly 1% on Shark. Also
3812 added a special case for when the second string is a single character,
3813 since it's a common idiom to build up a string that way and we can do
3814 things much more quickly, without involving memcpy for example. Also
3815 adopted the non-inline function, nullRep, for the same reason given for
3817 (KJS::UString::append): Adopted makeNull for failure cases.
3818 (KJS::UString::operator=): Ditto.
3819 (KJS::UString::toDouble): Added a special case for converting single
3820 character strings to numbers. We're doing this a ton of times while
3821 running the base64 test.
3822 (KJS::operator==): Added special cases so we can compare single-character
3823 strings without calling memcmp. Later we might want to special case other
3824 short lengths similarly.
3825 (KJS::UString::makeNull): Added.
3826 (KJS::UString::nullRep): Added.
3827 * kjs/ustring.h: Added declarations for the nullRep and makeNull. Changed
3828 expandedSize to be a static member function. Added a declaration of the
3829 concatenate function. Removed the concatenation constructor. Rewrote
3830 operator+ to use the concatenate function.
3832 2008-08-29 Anders Carlsson <andersca@apple.com>
3839 2008-08-29 Anders Carlsson <andersca@apple.com>
3841 Reviewed by Darin Adler.
3843 <rdar://problem/6174667>
3844 When a machine is under heavy load, the Slow Script dialog often comes up many times and just gets in the way
3846 Instead of using clock time, use the CPU time spent executing the current thread when
3847 determining if the script has been running for too long.
3851 (KJS::Machine::checkTimeout):
3853 2008-08-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3855 Rubber-stamped by Sam Weinig.
3857 Change 'term' to 'expr' in variable names to standardize terminology.
3860 (KJS::BinaryOpNode::emitCode):
3861 (KJS::ReverseBinaryOpNode::emitCode):
3862 (KJS::ThrowableBinaryOpNode::emitCode):
3864 (KJS::BinaryOpNode::BinaryOpNode):
3865 (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
3871 (KJS::LeftShiftNode::):
3872 (KJS::RightShiftNode::):
3873 (KJS::UnsignedRightShiftNode::):
3875 (KJS::GreaterNode::):
3876 (KJS::LessEqNode::):
3877 (KJS::GreaterEqNode::):
3878 (KJS::ThrowableBinaryOpNode::):
3879 (KJS::InstanceOfNode::):
3882 (KJS::NotEqualNode::):
3883 (KJS::StrictEqualNode::):
3884 (KJS::NotStrictEqualNode::):
3885 (KJS::BitAndNode::):
3887 (KJS::BitXOrNode::):
3888 * kjs/nodes2string.cpp:
3889 (KJS::MultNode::streamTo):
3890 (KJS::DivNode::streamTo):
3891 (KJS::ModNode::streamTo):
3892 (KJS::AddNode::streamTo):
3893 (KJS::SubNode::streamTo):
3894 (KJS::LeftShiftNode::streamTo):
3895 (KJS::RightShiftNode::streamTo):
3896 (KJS::UnsignedRightShiftNode::streamTo):
3897 (KJS::LessNode::streamTo):
3898 (KJS::GreaterNode::streamTo):
3899 (KJS::LessEqNode::streamTo):
3900 (KJS::GreaterEqNode::streamTo):
3901 (KJS::InstanceOfNode::streamTo):
3902 (KJS::InNode::streamTo):
3903 (KJS::EqualNode::streamTo):
3904 (KJS::NotEqualNode::streamTo):
3905 (KJS::StrictEqualNode::streamTo):
3906 (KJS::NotStrictEqualNode::streamTo):
3907 (KJS::BitAndNode::streamTo):
3908 (KJS::BitXOrNode::streamTo):
3909 (KJS::BitOrNode::streamTo):
3911 2008-08-28 Alp Toker <alp@nuanti.com>
3913 GTK+ dist/build fix. List newly added header files.
3917 2008-08-28 Sam Weinig <sam@webkit.org>
3919 Reviewed by Oliver Hunt.
3921 Change to throw a ReferenceError at runtime instead of a ParseError
3922 at parse time, when the left hand side expression of a for-in statement
3927 (KJS::ForInNode::emitCode):
3929 2008-08-28 Alexey Proskuryakov <ap@webkit.org>
3931 Not reviewed, build fix (at least for OpenBSD, posssibly more).
3933 https://bugs.webkit.org/show_bug.cgi?id=20545
3934 missing #include <unistd.h> in JavaScriptCore/VM/SamplingTool.cpp
3936 * VM/SamplingTool.cpp: add the missing include.
3938 2008-08-26 Kevin McCullough <kmccullough@apple.com>
3940 Reviewed by Geoff and Cameron.
3942 <rdar://problem/6174603> Hitting assertion in Register::codeBlock when
3943 loading facebook (20516).
3945 - This was a result of my line numbers change. After a host function is
3946 called the stack does not get reset correctly.
3947 - Oddly this also appears to be a slight speedup on SunSpider.
3950 (KJS::Machine::privateExecute):
3952 2008-08-26 Alexey Proskuryakov <ap@webkit.org>
3954 Reviewed by Geoff and Tim.
3956 Export new API methods.
3958 * JavaScriptCore.exp:
3960 2008-08-25 Kevin McCullough <kmccullough@apple.com>
3962 Reviewed by Geoff, Tim and Mark.
3964 <rdar://problem/6150623> JSProfiler: It would be nice if the profiles
3965 in the console said what file and line number they came from
3966 - Lay the foundation for getting line numbers and other data from the
3967 JavaScript engine. With the cleanup in kjs/ExecState this is actually
3968 a slight performance improvement.
3970 * JavaScriptCore.exp: Export retrieveLastCaller() for WebCore.
3971 * JavaScriptCore.xcodeproj/project.pbxproj:
3972 * VM/Machine.cpp: Now Host and JS functions set a call frame on the
3973 exec state, so this and the profiler code were pulled out of the
3975 (KJS::Machine::privateExecute):
3976 (KJS::Machine::retrieveLastCaller): This get's the lineNumber, sourceID
3977 and sourceURL for the previously called function.
3979 * kjs/ExecState.cpp: Remove references to JSFunction since it's not used
3983 2008-08-25 Alexey Proskuryakov <ap@webkit.org>
3985 Reviewed by Darin Adler.
3987 Ensure that JSGlobalContextRelease() performs garbage collection, even if there are other
3988 contexts in the current context's group.
3990 This is only really necessary when the last reference is released, but there is no way to
3991 determine that, and no harm in collecting slightly more often.
3993 * API/JSContextRef.cpp: (JSGlobalContextRelease): Explicitly collect the heap if it is not
3996 2008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3998 Reviewed by Oliver Hunt.
4000 Bug 20093: JSC shell does not clear exceptions after it executes toString on an expression
4001 <https://bugs.webkit.org/show_bug.cgi?id=20093>
4003 Clear exceptions after evaluating any code in the JSC shell. We do not
4004 report exceptions that are caused by calling toString on the final
4005 valued, but at least we avoid incorrect behaviour.
4007 Also, print any exceptions that occurred while evaluating code at the
4008 interactive prompt, not just while evaluating code from a file.
4014 2008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
4018 Remove an unnecessary RefPtr to a RegisterID.
4021 (KJS::DeleteBracketNode::emitCode):
4023 2008-08-24 Mark Rowe <mrowe@apple.com>
4025 Reviewed by Oliver Hunt.
4027 Use the correct version number for when JSGlobalContextCreate was introduced.
4029 * API/JSContextRef.h:
4031 2008-08-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
4033 Rubber-stamped by Mark Rowe.
4039 * API/JSCallbackConstructor.cpp:
4040 * API/JSCallbackConstructor.h:
4041 * API/JSCallbackFunction.cpp:
4042 * API/JSCallbackFunction.h:
4043 * API/JSCallbackObject.cpp:
4044 * API/JSCallbackObject.h:
4045 * API/JSCallbackObjectFunctions.h:
4046 * API/JSClassRef.cpp:
4047 * API/JSContextRef.cpp:
4048 * API/JSObjectRef.cpp:
4049 * API/JSProfilerPrivate.cpp:
4050 * API/JSStringRef.cpp:
4051 * API/JSStringRefBSTR.cpp:
4052 * API/JSStringRefCF.cpp:
4053 * API/JSValueRef.cpp:
4054 * API/tests/JSNode.c:
4055 * API/tests/JSNode.h:
4056 * API/tests/JSNodeList.c:
4057 * API/tests/JSNodeList.h:
4060 * API/tests/NodeList.c:
4061 * API/tests/NodeList.h:
4062 * API/tests/minidom.c:
4063 * API/tests/minidom.js:
4064 * API/tests/testapi.c:
4065 * API/tests/testapi.js:
4066 * JavaScriptCore.pro:
4067 * kjs/FunctionConstructor.h:
4068 * kjs/FunctionPrototype.h:
4071 * kjs/JSWrapperObject.cpp:
4072 * kjs/NumberConstructor.h:
4073 * kjs/NumberObject.h:
4074 * kjs/NumberPrototype.h:
4077 * wtf/Assertions.cpp:
4079 * wtf/HashCountedSet.h:
4080 * wtf/HashFunctions.h:
4081 * wtf/HashIterators.h:
4086 * wtf/ListHashSet.h:
4088 * wtf/Noncopyable.h:
4089 * wtf/OwnArrayPtr.h:
4094 * wtf/RefPtrHashMap.h:
4096 * wtf/UnusedParam.h:
4098 * wtf/VectorTraits.h:
4099 * wtf/unicode/Unicode.h:
4100 * wtf/unicode/icu/UnicodeIcu.h:
4102 2008-08-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>
4106 Some cleanup to match our coding style.
4108 * VM/CodeGenerator.h:
4110 (KJS::Machine::privateExecute):
4111 * kjs/ExecState.cpp:
4114 * kjs/identifier.cpp:
4115 (KJS::Identifier::equal):
4116 (KJS::CStringTranslator::hash):
4117 (KJS::CStringTranslator::equal):
4118 (KJS::CStringTranslator::translate):
4119 (KJS::UCharBufferTranslator::equal):
4120 (KJS::UCharBufferTranslator::translate):
4121 (KJS::Identifier::remove):
4124 2008-08-20 Alexey Proskuryakov <ap@webkit.org>
4128 * API/WebKitAvailability.h: Define DEPRECATED_ATTRIBUTE.
4130 2008-08-19 Alexey Proskuryakov <ap@webkit.org>
4132 Reviewed by Geoff Garen.
4134 Bring back shared JSGlobalData and implicit locking, because too many clients rely on it.
4136 * kjs/JSGlobalData.cpp:
4137 (KJS::JSGlobalData::~JSGlobalData):
4138 (KJS::JSGlobalData::JSGlobalData): Re-add shared instance.
4139 (KJS::JSGlobalData::sharedInstanceExists): Ditto.
4140 (KJS::JSGlobalData::sharedInstance): Ditto.
4141 (KJS::JSGlobalData::sharedInstanceInternal): Ditto.
4143 * API/JSContextRef.h: Deprecated JSGlobalContextCreate(). Added a very conservative
4144 description of its threading model (nothing is allowed).
4146 * API/JSContextRef.cpp:
4147 (JSGlobalContextCreate): Use shared JSGlobalData.
4148 (JSGlobalContextCreateInGroup): Support passing NULL group to request a unique one.
4149 (JSGlobalContextRetain): Added back locking.
4150 (JSGlobalContextRelease): Ditto.
4151 (JSContextGetGlobalObject): Ditto.
4153 * API/tests/minidom.c: (main):
4154 * API/tests/testapi.c: (main):
4155 Switched to JSGlobalContextCreateInGroup() to avoid deprecation warnings.
4157 * JavaScriptCore.exp: Re-added JSLock methods. Added JSGlobalContextCreateInGroup (d'oh!).
4161 (JSCheckScriptSyntax):
4163 * API/JSCallbackConstructor.cpp:
4164 (KJS::constructJSCallback):
4165 * API/JSCallbackFunction.cpp:
4166 (KJS::JSCallbackFunction::call):
4167 * API/JSCallbackObjectFunctions.h:
4169 (KJS::::getOwnPropertySlot):
4171 (KJS::::deleteProperty):
4173 (KJS::::hasInstance):
4175 (KJS::::getPropertyNames):
4178 (KJS::::staticValueGetter):
4179 (KJS::::callbackGetter):
4180 * API/JSObjectRef.cpp:
4182 (JSObjectMakeFunctionWithCallback):
4183 (JSObjectMakeConstructor):
4184 (JSObjectMakeFunction):
4185 (JSObjectHasProperty):
4186 (JSObjectGetProperty):
4187 (JSObjectSetProperty):
4188 (JSObjectGetPropertyAtIndex):
4189 (JSObjectSetPropertyAtIndex):
4190 (JSObjectDeleteProperty):
4191 (JSObjectCallAsFunction):
4192 (JSObjectCallAsConstructor):
4193 (JSObjectCopyPropertyNames):
4194 (JSPropertyNameArrayRelease):
4195 (JSPropertyNameAccumulatorAddName):
4196 * API/JSValueRef.cpp:
4198 (JSValueIsInstanceOfConstructor):
4199 (JSValueMakeNumber):
4200 (JSValueMakeString):
4202 (JSValueToStringCopy):
4206 * ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
4208 * JavaScriptCore.pri:
4209 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4210 * JavaScriptCore.xcodeproj/project.pbxproj:
4211 * JavaScriptCoreSources.bkl:
4212 * kjs/AllInOneFile.cpp:
4213 * kjs/JSGlobalData.h:
4214 * kjs/JSGlobalObject.cpp:
4215 (KJS::JSGlobalObject::~JSGlobalObject):
4216 (KJS::JSGlobalObject::init):
4217 * kjs/JSLock.cpp: Added.
4218 (KJS::createJSLockCount):