1 2009-06-15 Gavin Barraclough <barraclough@apple.com>
3 Rubber Stamped by Sam Weinig.
5 Rename PatchBuffer to LinkBuffer. Previously our terminology has been a little
6 mixed up, but we have decided to fix on refering to the process that takes place
7 at the end of code generation as 'linking', and on any modifications that take
8 place later (and once the code has potentially already been executed) as 'patching'.
10 However, the term 'PatchBuffer' is already in use, and needs to be repurposed.
12 To try to minimize confusion, we're going to switch the terminology over in stages,
13 so for now we'll refer to later modifications as 'repatching'. This means that the
14 new 'PatchBuffer' has been introduced with the name 'RepatchBuffer' instead.
16 This patch renames the old 'PatchBuffer' to 'LinkBuffer'. We'll leave ToT in this
17 state for a week or so to try to avoid to much overlap of the meaning of the term
18 'PatchBuffer', then will come back and rename 'RepatchBuffer'.
20 * assembler/ARMv7Assembler.h:
21 * assembler/AbstractMacroAssembler.h:
22 (JSC::AbstractMacroAssembler::LinkBuffer::LinkBuffer):
23 (JSC::AbstractMacroAssembler::LinkBuffer::~LinkBuffer):
25 (JSC::JIT::privateCompile):
26 * jit/JITPropertyAccess.cpp:
27 (JSC::JIT::privateCompilePutByIdTransition):
28 (JSC::JIT::privateCompilePatchGetArrayLength):
29 (JSC::JIT::privateCompileGetByIdProto):
30 (JSC::JIT::privateCompileGetByIdSelfList):
31 (JSC::JIT::privateCompileGetByIdProtoList):
32 (JSC::JIT::privateCompileGetByIdChainList):
33 (JSC::JIT::privateCompileGetByIdChain):
35 (JSC::Yarr::RegexGenerator::compile):
37 2009-06-15 Gavin Barraclough <barraclough@apple.com>
39 Reviewed by Sam Weinig.
41 Having moved most of their functionality into the RepatchBuffer class,
42 we can simplify the CodeLocation* classes.
44 The CodeLocation* classes are currently a tangle of templatey and friendly
45 badness, burried in the middle of AbstractMacroAssembler. Having moved
46 the ability to repatch out into RepatchBufer they are now do-nothing wrappers
47 on CodePtr (MacroAssemblerCodePtr), that only exist to provide type-safety.
49 Simplify the code, and move them off into their own header.
51 * JavaScriptCore.xcodeproj/project.pbxproj:
52 * assembler/AbstractMacroAssembler.h:
53 (JSC::AbstractMacroAssembler::PatchBuffer::patch):
54 * assembler/CodeLocation.h: Copied from assembler/AbstractMacroAssembler.h.
55 (JSC::CodeLocationCommon::CodeLocationCommon):
56 (JSC::CodeLocationInstruction::CodeLocationInstruction):
57 (JSC::CodeLocationLabel::CodeLocationLabel):
58 (JSC::CodeLocationJump::CodeLocationJump):
59 (JSC::CodeLocationCall::CodeLocationCall):
60 (JSC::CodeLocationNearCall::CodeLocationNearCall):
61 (JSC::CodeLocationDataLabel32::CodeLocationDataLabel32):
62 (JSC::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
63 (JSC::CodeLocationCommon::instructionAtOffset):
64 (JSC::CodeLocationCommon::labelAtOffset):
65 (JSC::CodeLocationCommon::jumpAtOffset):
66 (JSC::CodeLocationCommon::callAtOffset):
67 (JSC::CodeLocationCommon::nearCallAtOffset):
68 (JSC::CodeLocationCommon::dataLabelPtrAtOffset):
69 (JSC::CodeLocationCommon::dataLabel32AtOffset):
70 * assembler/MacroAssemblerCodeRef.h:
71 (JSC::MacroAssemblerCodePtr::operator!):
72 * bytecode/CodeBlock.h:
73 (JSC::getStructureStubInfoReturnLocation):
74 (JSC::getCallLinkInfoReturnLocation):
75 (JSC::getMethodCallLinkInfoReturnLocation):
76 * bytecode/Instruction.h:
77 * bytecode/JumpTable.h:
78 (JSC::StringJumpTable::ctiForValue):
79 (JSC::SimpleJumpTable::ctiForValue):
80 * bytecode/StructureStubInfo.h:
81 * bytecompiler/BytecodeGenerator.cpp:
82 (JSC::BytecodeGenerator::emitCatch):
84 (JSC::JIT::privateCompile):
86 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
87 (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
89 2009-06-15 Gavin Barraclough <barraclough@apple.com>
91 Reviewed by Sam Weinig.
93 Having introduced the RepatchBuffer, ProcessorReturnAddress is now a do-nothing
94 wrapper around ReturnAddressPtr. Remove it. In tugging on this piece of string
95 it made sense to roll out the use of ReturnAddressPtr a little further into
96 JITStubs (which had always been the intention).
98 No performance impact.
100 * assembler/AbstractMacroAssembler.h:
101 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToTrampoline):
102 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToFunction):
103 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkNearCallerToTrampoline):
104 * assembler/MacroAssemblerCodeRef.h:
105 (JSC::ReturnAddressPtr::ReturnAddressPtr):
106 * bytecode/CodeBlock.h:
107 (JSC::CodeBlock::getStubInfo):
108 (JSC::CodeBlock::getCallLinkInfo):
109 (JSC::CodeBlock::getMethodCallLinkInfo):
110 (JSC::CodeBlock::getBytecodeIndex):
111 * interpreter/Interpreter.cpp:
112 (JSC::bytecodeOffsetForPC):
114 (JSC::ctiPatchNearCallByReturnAddress):
115 (JSC::ctiPatchCallByReturnAddress):
117 (JSC::JIT::compileGetByIdProto):
118 (JSC::JIT::compileGetByIdChain):
119 (JSC::JIT::compilePutByIdTransition):
120 (JSC::JIT::compilePatchGetArrayLength):
121 * jit/JITPropertyAccess.cpp:
122 (JSC::JIT::privateCompilePutByIdTransition):
123 (JSC::JIT::patchGetByIdSelf):
124 (JSC::JIT::patchPutByIdReplace):
125 (JSC::JIT::privateCompilePatchGetArrayLength):
126 (JSC::JIT::privateCompileGetByIdProto):
127 (JSC::JIT::privateCompileGetByIdChain):
129 (JSC::JITThunks::tryCachePutByID):
130 (JSC::JITThunks::tryCacheGetByID):
131 (JSC::StackHack::StackHack):
132 (JSC::returnToThrowTrampoline):
133 (JSC::throwStackOverflowError):
134 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
137 (JSC::JITStackFrame::returnAddressSlot):
138 * runtime/JSGlobalData.h:
140 2009-06-15 Simon Fraser <simon.fraser@apple.com>
142 Reviewed by Mark Rowe.
144 <rdar://problem/6974857>
146 Define ENABLE_3D_RENDERING when building on 10.6, and move ENABLE_3D_RENDERING
147 switch from config.h to wtf/Platform.h.
149 * Configurations/FeatureDefines.xcconfig:
152 2009-06-15 Gavin Barraclough <barraclough@apple.com>
154 Reviewed by Oliver Hunt.
156 Move repatching methods into a set of methods on a class. This will allow us to
157 coallesce memory reprotection calls. Really, we want this class to be called
158 PatchBuffer, we want the class PatchBuffer to be called LinkBuffer, we want both
159 to be memblers of MacroAssembler rather then AbstractMacroAssembler, we don't
160 want the CodeLocationFoo types anymore (they are now only really there to provide
161 type safety, and that is completely undermined by the way we use offsets). Then
162 the link & patch buffers should delegate the actual patching calls to the
163 architecture-specific layer of the MacroAssembler. Landing all these changes as a
166 No performance impact.
168 * assembler/AbstractMacroAssembler.h:
169 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
170 (JSC::AbstractMacroAssembler::CodeLocationNearCall::CodeLocationNearCall):
171 (JSC::AbstractMacroAssembler::CodeLocationNearCall::calleeReturnAddressValue):
172 (JSC::AbstractMacroAssembler::RepatchBuffer::RepatchBuffer):
173 (JSC::AbstractMacroAssembler::RepatchBuffer::relink):
174 (JSC::AbstractMacroAssembler::RepatchBuffer::repatch):
175 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToTrampoline):
176 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToFunction):
177 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkNearCallerToTrampoline):
178 (JSC::AbstractMacroAssembler::RepatchBuffer::repatchLoadPtrToLEA):
180 (JSC::ctiPatchNearCallByReturnAddress):
181 (JSC::ctiPatchCallByReturnAddress):
182 (JSC::JIT::unlinkCall):
183 (JSC::JIT::linkCall):
184 * jit/JITPropertyAccess.cpp:
185 (JSC::JIT::privateCompilePutByIdTransition):
186 (JSC::JIT::patchGetByIdSelf):
187 (JSC::JIT::patchMethodCallProto):
188 (JSC::JIT::patchPutByIdReplace):
189 (JSC::JIT::privateCompilePatchGetArrayLength):
190 (JSC::JIT::privateCompileGetByIdProto):
191 (JSC::JIT::privateCompileGetByIdSelfList):
192 (JSC::JIT::privateCompileGetByIdProtoList):
193 (JSC::JIT::privateCompileGetByIdChainList):
194 (JSC::JIT::privateCompileGetByIdChain):
196 2009-06-15 Gavin Barraclough <barraclough@apple.com>
198 Reviewed by Geoff Hunt & Oliver Garen.
200 We are currently generating two copies of the slow path for op_call for no reason. Stop that.
202 Originally op_call used two slow paths since the first set up the pointer to the CallLinkInfo
203 for use when linking. However this is now looked up using the return address (as we do for
204 property accesses) so the two paths are now identical.
206 No performance impact, reduces memory footprint.
208 * bytecode/CodeBlock.h:
210 (JSC::JIT::privateCompile):
211 (JSC::JIT::linkCall):
214 (JSC::JIT::compileOpCallSlowCase):
216 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
218 2009-06-12 Dave Hyatt <hyatt@apple.com>
220 Reviewed by Anders Carlsson.
222 https://bugs.webkit.org/show_bug.cgi?id=26373
224 Add a new class to Threading in wtf called ReadWriteLock that handles single writer/multiple reader locking.
225 Provide a pthreads-only implementation of the lock for now, as this class is only going to be used
226 on Snow Leopard at first.
229 (WTF::ReadWriteLock::impl):
230 * wtf/ThreadingPthreads.cpp:
231 (WTF::ReadWriteLock::ReadWriteLock):
232 (WTF::ReadWriteLock::~ReadWriteLock):
233 (WTF::ReadWriteLock::readLock):
234 (WTF::ReadWriteLock::tryReadLock):
235 (WTF::ReadWriteLock::writeLock):
236 (WTF::ReadWriteLock::tryWriteLock):
237 (WTF::ReadWriteLock::unlock):
239 2009-06-12 Oliver Hunt <oliver@apple.com>
241 Reviewed by Geoff Garen.
243 Make LiteralParser non-recursive
245 Convert LiteralParser from using a simple recursive descent parser
246 to a hand rolled PDA. Relatively simple conversion, but required
247 modifications to MarkedArgumentBuffer to make it more suitable as
248 a generic marked vector. I'll refactor and rename MarkedArgumentBuffer
249 in future as there are many other cases where it will be useful to
253 (JSC::MarkedArgumentBuffer::MarkedArgumentBuffer):
254 (JSC::MarkedArgumentBuffer::append):
255 (JSC::MarkedArgumentBuffer::removeLast):
256 (JSC::MarkedArgumentBuffer::last):
257 * runtime/LiteralParser.cpp:
258 (JSC::LiteralParser::parse):
259 * runtime/LiteralParser.h:
260 (JSC::LiteralParser::LiteralParser):
261 (JSC::LiteralParser::tryLiteralParse):
262 (JSC::LiteralParser::):
264 2009-06-12 David Levin <levin@chromium.org>
266 Reviewed by NOBODY (build fix for windows).
268 Adjust the exports for JSC on Windows like what was done for OSX in
271 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
272 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
274 2009-06-12 David Levin <levin@chromium.org>
276 Reviewed by Darin Adler.
278 UString shouldn't create sharedBuffer for SmallStrings.
279 https://bugs.webkit.org/show_bug.cgi?id=26360
281 The methods changed are not used by JSC, so there is no JS perf impact. However,
282 there is a potential DOM perf impact, so I re-ran several of the tests that
283 I ran previously and ensured that the perf stay the same which caused me to
284 adjust the minLengthToShare.
286 * JavaScriptCore.exp:
287 * runtime/UString.cpp:
288 (JSC::UString::Rep::sharedBuffer):
289 Determines if the buffer being shared is big enough before doing so.
290 Previously, BaseString::sharedBuffer was called but it would only know
291 the length of the base string (BaseString::len) which may not be the same
292 as the string being shared (Rep::len).
293 (JSC::UString::BaseString::sharedBuffer):
294 This is now only be used by Rep::sharedBuffer. which does the length check.
297 2009-06-12 Dimitri Glazkov <dglazkov@chromium.org>
299 Reviewed by Eric Seidel.
301 https://bugs.webkit.org/show_bug.cgi?id=26191
302 Remove xmath include in MathExtras.h, because it is not needed and also
303 breaks VS2008 builds with TR1 turned on.
305 * wtf/MathExtras.h: Removed xmath include.
307 2009-06-12 Peter Kasting <pkasting@google.com>
309 Reviewed by Eric Seidel.
311 * ChangeLog-2007-10-14: Change pseudonym "Don Gibson" to me (was used while Google Chrome was not public); update my email address.
313 2009-06-12 Kevin Ollivier <kevino@theolliviers.com>
315 wx build fix. Adding JSONObject.cpp to the build.
317 * JavaScriptCoreSources.bkl:
319 2009-06-12 Laszlo Gombos <laszlo.1.gombos@nokia.com>
321 Reviewed by Jan Michael Alonzo.
324 https://bugs.webkit.org/show_bug.cgi?id=26340
326 * JavaScriptCore.pri: Add JSONObject.cpp to LUT files.
328 2009-06-11 Oliver Hunt <oliver@apple.com>
330 Reviewed by NOBODY (build fix).
332 Lower stringify recursion limit to deal with small windows stack.
334 * JavaScriptCore.xcodeproj/project.pbxproj:
335 * runtime/JSONObject.cpp:
336 (JSC::Stringifier::):
338 2009-06-11 Laszlo Gombos <laszlo.1.gombos@nokia.com>
340 Reviewed by Holger Freyther.
342 Fix compilation warnings
343 <https://bugs.webkit.org/show_bug.cgi?id=26015>
345 * wtf/ThreadingNone.cpp:
346 (WTF::ThreadCondition::wait): Fix compilation warning.
347 (WTF::ThreadCondition::timedWait): Ditto.
349 2009-06-10 Brent Fulgham <bfulgham@webkit.org>
351 Build fix for Windows target.
353 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
354 Correct missing </File> tag after @r44550 that prevents the
355 project from being loaded in the Visual Studio IDE.
357 2009-06-09 Gavin Barraclough <barraclough@apple.com>
359 Rubber Stamped by Mark Rowe.
361 Tidy up a couple of comments.
363 * assembler/ARMv7Assembler.h:
364 Fix date in copyright, neaten up a couple of comments.
365 * assembler/MacroAssemblerARMv7.h:
366 Fix date in copyright.
368 2009-06-07 Oliver Hunt <oliver@apple.com>
370 Reviewed by Sam Weinig.
372 Bug 26249: Support JSON.stringify
373 <https://bugs.webkit.org/show_bug.cgi?id=26249>
375 Implement JSON.stringify. This patch handles all the semantics of the ES5
376 JSON.stringify function, including replacer functions and arrays and both
377 string and numeric gap arguments.
379 Currently uses a clamped recursive algorithm basically identical to the spec
380 description but with a few minor tweaks for performance and corrected semantics
381 discussed in the es-discuss mailing list.
383 * DerivedSources.make:
385 * JavaScriptCore.pri:
386 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
387 * JavaScriptCore.xcodeproj/project.pbxproj:
388 * interpreter/CallFrame.h:
389 (JSC::ExecState::jsonTable):
390 * runtime/CommonIdentifiers.h:
391 add toJSON to the list of common identifiers
393 * runtime/JSGlobalData.cpp:
394 (JSC::JSGlobalData::JSGlobalData):
395 (JSC::JSGlobalData::~JSGlobalData):
396 * runtime/JSGlobalData.h:
397 * runtime/JSGlobalObject.cpp:
398 (JSC::JSGlobalObject::reset):
399 Add support for the JSON object lookup table
401 * runtime/JSONObject.cpp: Added.
403 (JSC::JSONObject::getOwnPropertySlot):
404 (JSC::Stringifier::):
405 (JSC::Stringifier::Stringifier):
406 (JSC::Stringifier::stringify):
407 (JSC::Stringifier::appendString):
409 (JSC::Stringifier::StringKeyGenerator::StringKeyGenerator):
410 (JSC::Stringifier::StringKeyGenerator::getKey):
411 (JSC::Stringifier::IntKeyGenerator::IntKeyGenerator):
412 (JSC::Stringifier::IntKeyGenerator::getKey):
413 These KeyGenerator classes are used to abstract away the lazy evaluation of keys for
414 toJSON and replacer functions.
416 (JSC::Stringifier::toJSONValue):
417 (JSC::Stringifier::stringifyArray):
418 (JSC::Stringifier::stringifyObject):
419 (JSC::JSONProtoFuncStringify):
420 * runtime/JSONObject.h: Added.
421 (JSC::JSONObject:::JSObject):
422 (JSC::JSONObject::classInfo):
423 (JSC::JSONObject::createStructure):
425 2009-06-09 Gavin Barraclough <barraclough@apple.com>
427 Reviewed by Geoff Garen.
429 Enable JIT_OPTIMIZE_CALL & JIT_OPTIMIZE_METHOD_CALLS on ARMv7 platforms.
431 These optimizations function correctly with no further changes.
434 Change to enable JIT_OPTIMIZE_CALL & JIT_OPTIMIZE_METHOD_CALLS.
436 2009-06-09 Gavin Barraclough <barraclough@apple.com>
438 Not Reviewed, build fix.
440 * assembler/MacroAssemblerARMv7.h:
442 2009-06-09 Gavin Barraclough <barraclough@apple.com>
444 Reviewed by Geoff Garen.
446 Enable JIT_OPTIMIZE_ARITHMETIC on ARMv7 platforms.
448 Temporarily split support for 'branchTruncateDoubleToInt32' onto its own switch
449 ('supportsFloatingPointTruncate'). See comment in MacroAssemblerARMv7, we need
450 to work out wherther we are going to be able to support the current interface on
451 all platforms, or whether this should be refactored.
453 * assembler/MacroAssemblerARMv7.h:
454 (JSC::MacroAssemblerARMv7::supportsFloatingPoint):
455 Add implementation of supportsFloatingPointTruncate (returns true).
456 (JSC::MacroAssemblerARMv7::supportsFloatingPointTruncate):
457 Add implementation of supportsFloatingPointTruncate (returns false).
458 (JSC::MacroAssemblerARMv7::loadDouble):
459 (JSC::MacroAssemblerARMv7::storeDouble):
460 (JSC::MacroAssemblerARMv7::addDouble):
461 (JSC::MacroAssemblerARMv7::subDouble):
462 (JSC::MacroAssemblerARMv7::mulDouble):
463 (JSC::MacroAssemblerARMv7::convertInt32ToDouble):
464 (JSC::MacroAssemblerARMv7::branchDouble):
465 Implement FP code genertion operations.
466 * assembler/MacroAssemblerX86.h:
467 (JSC::MacroAssemblerX86::supportsFloatingPointTruncate):
468 Add implementation of supportsFloatingPointTruncate (returns true).
469 * assembler/MacroAssemblerX86_64.h:
470 (JSC::MacroAssemblerX86_64::supportsFloatingPointTruncate):
471 Add implementation of supportsFloatingPointTruncate (returns true).
472 * jit/JITArithmetic.cpp:
473 (JSC::JIT::emit_op_rshift):
474 Changed to call supportsFloatingPointTruncate().
475 (JSC::JIT::emitSlow_op_rshift):
476 Changed to call supportsFloatingPointTruncate().
478 Change to enable JIT_OPTIMIZE_ARITHMETIC.
480 2009-06-09 Gavin Barraclough <barraclough@apple.com>
482 Reviewed by Mark Rowe & Geoff Garen.
484 Enable JIT_OPTIMIZE_PROPERTY_ACCESS on ARMv7 platforms.
486 Firm up interface for planting load intructions that will be repatched by
487 repatchLoadPtrToLEA(). This method should now no longer be applied to just
488 any loadPtr instruction.
490 * assembler/MacroAssemblerARMv7.h:
491 (JSC::MacroAssemblerARMv7::loadPtrWithPatchToLEA):
492 Implement loadPtrWithPatchToLEA interface (plants a load with a fixed width address).
493 (JSC::MacroAssemblerARMv7::move):
494 (JSC::MacroAssemblerARMv7::nearCall):
495 (JSC::MacroAssemblerARMv7::call):
496 (JSC::MacroAssemblerARMv7::moveWithPatch):
497 (JSC::MacroAssemblerARMv7::tailRecursiveCall):
498 Switch to use common method 'moveFixedWidthEncoding()' to perform fixed width (often patchable) loads.
499 (JSC::MacroAssemblerARMv7::moveFixedWidthEncoding):
500 Move an immediate to a register, always plants movT3/movt instruction pair.
501 * assembler/MacroAssemblerX86.h:
502 (JSC::MacroAssemblerX86::loadPtrWithPatchToLEA):
503 Implement loadPtrWithPatchToLEA interface (just a regular 32-bit load on x86).
504 * assembler/MacroAssemblerX86_64.h:
505 (JSC::MacroAssemblerX86_64::loadPtrWithPatchToLEA):
506 Implement loadPtrWithPatchToLEA interface (just a regular 64-bit load on x86_64).
507 * jit/JITPropertyAccess.cpp:
508 (JSC::JIT::compileGetByIdHotPath):
509 (JSC::JIT::emit_op_put_by_id):
511 Change to enable JIT_OPTIMIZE_PROPERTY_ACCESS.
513 2009-06-08 Gavin Barraclough <barraclough@apple.com>
515 Reviewed by Geoff Garen.
517 Enable JS language JIT for ARM thumb2 platforms. Add ARMv7 specific
518 asm & constants, add appropriate configuration switches to Platform.h.
520 Landing this disabled until jump linking is completed (see YARR jit patch).
522 * assembler/MacroAssemblerARMv7.h:
523 (JSC::MacroAssemblerARMv7::load32):
524 Fix: should load pointer with ImmPtr not Imm32.
525 (JSC::MacroAssemblerARMv7::store32):
526 Fix: should load pointer with ImmPtr not Imm32.
527 (JSC::MacroAssemblerARMv7::move):
528 Fix: When moving an Imm32 that is actually a pointer, should call movT3()
529 not mov(), to ensure code generation is repeatable (for exception handling).
531 (JSC::JIT::privateCompileCTIMachineTrampolines):
532 Disable JIT_OPTIMIZE_NATIVE_CALL specific code generation if the optimization is not enabled.
534 Add ARMv7 specific values of constants & register names.
535 * jit/JITInlineMethods.h:
536 (JSC::JIT::preverveReturnAddressAfterCall):
537 (JSC::JIT::restoreReturnAddressBeforeReturn):
538 (JSC::JIT::restoreArgumentReferenceForTrampoline):
539 Implement for ARMv7 (move value to/from lr).
541 Add JIT entry/thow trampolines, add macro to add thunk wrapper around stub routines.
543 (JSC::JITStackFrame::returnAddressSlot):
544 Add ARMv7 stack frame object.
546 Add changes necessary to allow JIT to build on this platform, disabled.
548 2009-06-08 Mark Rowe <mrowe@apple.com>
550 Speculative GTK build fix.
554 2009-06-08 Gavin Barraclough <barraclough@apple.com>
556 Reviewed by Mark Rowe.
558 Previous patch caused a regression.
560 Restructure so no new (empty, inline) function calls are added on x86.
562 * jit/ExecutableAllocator.h:
563 (JSC::ExecutableAllocator::makeWritable):
564 (JSC::ExecutableAllocator::makeExecutable):
565 (JSC::ExecutableAllocator::reprotectRegion):
566 (JSC::ExecutableAllocator::cacheFlush):
568 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
570 Unreviewed, GTK build fix (thanks, bdash).
572 * GNUmakefile.am: Moved DateMath with all other wtf kin.
574 2009-06-08 Gavin Barraclough <barraclough@apple.com>
576 Reviewed by Geoff Garen.
578 Add (incomplete) support to YARR for running with the jit enabled
579 on Arm thumb2 platforms. Adds new Assembler/MacroAssembler classes,
580 along with cache flushing support, tweaks to MacroAssemblerCodePtr
581 to support decorated thumb code pointers, and new enter/exit code
582 to YARR jit for the platform.
584 Support for this platform is still under development - the assembler
585 currrently only supports planting and linking jumps with a 16Mb range.
586 As such, initially commiting in a disabled state.
588 * JavaScriptCore.xcodeproj/project.pbxproj:
589 Add new assembler files.
590 * assembler/ARMv7Assembler.h: Added.
592 * assembler/AbstractMacroAssembler.h:
593 Tweaks to ensure sizes of pointer values planted in JIT code do not change.
594 * assembler/MacroAssembler.h:
595 On ARMv7 platforms use MacroAssemblerARMv7.
596 * assembler/MacroAssemblerARMv7.h: Added.
597 Add new MacroAssembler.
598 * assembler/MacroAssemblerCodeRef.h:
599 (JSC::FunctionPtr::FunctionPtr):
601 (JSC::ReturnAddressPtr::ReturnAddressPtr):
603 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
604 On ARMv7, MacroAssemblerCodePtr's mush be 'decorated' with a low bit set,
605 to indicate to the processor that the code is thumb code, not traditional
607 (JSC::MacroAssemblerCodePtr::dataLocation):
608 On ARMv7, decoration must be removed.
609 * jit/ExecutableAllocator.h:
610 (JSC::ExecutableAllocator::makeWritable):
611 Reformatted, no change.
612 (JSC::ExecutableAllocator::makeExecutable):
613 When marking code executable also cache flush it, where necessary.
614 (JSC::ExecutableAllocator::MakeWritable::MakeWritable):
615 Only use the null implementation of this class if both !ASSEMBLER_WX_EXCLUSIVE
616 and running on x86(_64) - on other platforms we may also need ensure that
617 makeExecutable is called at the end to flush caches.
618 (JSC::ExecutableAllocator::reprotectRegion):
619 Reformatted, no change.
620 (JSC::ExecutableAllocator::cacheFlush):
621 Cache flush a region of memory, or platforms where this is necessary.
623 Add changes necessary to allow YARR jit to build on this platform, disabled.
625 (JSC::Yarr::RegexGenerator::generateEnter):
626 (JSC::Yarr::RegexGenerator::generateReturn):
627 Add support to these methods for ARMv7.
629 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
631 Unreviewed, fix my previous fix.
633 * runtime/DateInstance.cpp:
634 (JSC::DateInstance::msToGregorianDateTime): Use WTF namespace qualifier to
635 disambiguate func signatures.
637 2009-06-08 Mark Rowe <mrowe@apple.com>
639 Attempt to fix the Tiger build.
641 * wtf/Platform.h: Only test the value of the macro once we know it is defined.
643 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
645 Unreviewed, another Windows build fix.
647 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
648 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
650 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
652 Unreviewed, projectile-fixing Windows build.
654 * runtime/DateConversion.cpp: Added StringExtras include.
655 * wtf/DateMath.cpp: Replaced math with algorithm include (looking for std::min def for Windows).
657 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
659 Unreviewed, Windows build fix.
661 * runtime/DateConstructor.cpp: Changed to use WTF namespace.
662 * runtime/DateConversion.cpp: Added UString include.
663 * runtime/DateInstance.cpp: Changed to use WTF namespace.
664 * wtf/DateMath.cpp: Added math include.
666 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
668 Reviewed by Eric Seidel.
670 https://bugs.webkit.org/show_bug.cgi?id=26238
671 Move most of runtime/DateMath functions to wtf/DateMath, and split off conversion-related
672 helpers to DateConversion.
674 * AllInOneFile.cpp: Changed DateMath->DateConversion.
675 * GNUmakefile.am: Ditto and added DateMath.
676 * JavaScriptCore.exp: Ditto.
677 * JavaScriptCore.pri: Ditto.
678 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
679 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added DateMath.
680 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
681 * JavaScriptCoreSources.bkl: Ditto.
682 * pcre/pcre_exec.cpp: Changed to use DateMath.
683 * profiler/ProfileNode.cpp:
684 (JSC::getCount): Changed to use DateConversion.
685 * runtime/DateConstructor.cpp: Ditto.
686 * runtime/DateConversion.cpp: Copied from JavaScriptCore/runtime/DateMath.cpp.
687 (JSC::parseDate): Refactored to use null-terminated characters as input.
688 * runtime/DateConversion.h: Copied from JavaScriptCore/runtime/DateMath.h.
689 * runtime/DateInstance.cpp: Changed to use wtf/DateMath.
690 * runtime/DateInstance.h: Ditto.
691 * runtime/DateMath.cpp: Removed.
692 * runtime/DateMath.h: Removed.
693 * runtime/DatePrototype.cpp: Ditto.
694 * runtime/InitializeThreading.cpp: Ditto.
695 * wtf/DateMath.cpp: Copied from JavaScriptCore/runtime/DateMath.cpp.
696 * wtf/DateMath.h: Copied from JavaScriptCore/runtime/DateMath.h.
698 2009-06-08 Steve Falkenburg <sfalken@apple.com>
702 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
704 2009-06-07 David Kilzer <ddkilzer@apple.com>
706 Make JavaScriptCore compile for iPhone and iPhone Simulator
708 Reviewed by Gavin Barraclough.
710 * Configurations/Base.xcconfig: Split GCC_ENABLE_OBJC_GC on
711 $(REAL_PLATFORM_NAME). Added $(ARCHS_UNIVERSAL_IPHONE_OS) to
712 VALID_ARCHS. Added REAL_PLATFORM_NAME_iphoneos,
713 REAL_PLATFORM_NAME_iphonesimulator, HAVE_DTRACE_iphoneos and
714 HAVE_DTRACE_iphonesimulator variables.
715 * Configurations/DebugRelase.xcconfig: Split ARCHS definition on
716 $(REAL_PLATFORM_NAME).
717 * Configurations/JavaScriptCore.xcconfig: Added
718 EXPORTED_SYMBOLS_FILE_armv6 and EXPORTED_SYMBOLS_FILE_armv7
719 variables. Split OTHER_LDFLAGS into OTHER_LDFLAGS_BASE and
720 OTHER_LDFLAGS_$(REAL_PLATFORM_NAME) since CoreServices.framework
721 is only linked to on Mac OS X.
722 * JavaScriptCore.xcodeproj/project.pbxproj: Removed references
723 to CoreServices.framework since it's linked using OTHER_LDFLAGS
724 in JavaScriptCore.xcconfig.
725 * profiler/ProfilerServer.mm: Added #import for iPhone
727 (-[ProfilerServer init]): Conditionalize use of
728 NSDistributedNotificationCenter to non-iPhone or iPhone
730 * wtf/FastMalloc.cpp:
731 (WTF::TCMallocStats::): Build fix for iPhone and iPhone
733 * wtf/Platform.h: Defined PLATFORM(IPHONE) and
734 PLATFORM(IPHONE_SIMULATOR).
735 * wtf/ThreadingPthreads.cpp:
736 (WTF::setThreadNameInternal): Build fix for iPhone and iPhone
739 2009-06-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
741 Reviewed by Simon Hausmann.
743 [Qt] Use $QMAKE_PATH_SEP instead of hardcoded / to fix Windows build
745 * JavaScriptCore.pri:
746 * JavaScriptCore.pro:
749 2009-06-07 Gavin Barraclough <barraclough@apple.com>
753 Remove bonus bogus \n from last commit.
758 2009-06-07 Gavin Barraclough <barraclough@apple.com>
760 Reviewed by Sam Weinig.
762 Change the implementation of op_throw so the stub function always modifies its
763 return address - if it doesn't find a 'catch' it will switch to a trampoline
764 to force a return from JIT execution. This saves memory, by avoiding the need
765 for a unique return for every op_throw.
767 * jit/JITOpcodes.cpp:
768 (JSC::JIT::emit_op_throw):
769 JITStubs::cti_op_throw now always changes its return address,
770 remove return code generated after the stub call (this is now
771 handled by ctiOpThrowNotCaught).
774 Add ctiOpThrowNotCaught definitions.
775 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
776 Change cti_op_throw to always change its return address.
778 Add ctiOpThrowNotCaught declaration.
780 2009-06-05 Gavin Barraclough <barraclough@apple.com>
782 Rudder stamped by Sam Weinig.
786 * assembler/X86Assembler.h:
787 (JSC::X86Assembler::getRelocatedAddress):
789 2009-06-05 Gavin Barraclough <barraclough@apple.com>
791 Reviewed by Sam Weinig.
793 Switch storePtrWithPatch to take the initial immediate value as an argument.
795 * assembler/MacroAssemblerX86.h:
796 (JSC::MacroAssemblerX86::storePtrWithPatch):
797 * assembler/MacroAssemblerX86_64.h:
798 (JSC::MacroAssemblerX86_64::storePtrWithPatch):
799 * jit/JITOpcodes.cpp:
800 (JSC::JIT::emit_op_jsr):
802 2009-06-05 Gavin Barraclough <barraclough@apple.com>
804 Reviewed by Sam Weinig.
806 Remove patchLength..tByIdExternalLoadPrefix magic numbers from JIT.h.
808 These aren't really suitable values to be tracking within common code
809 of the JIT, since they are not (and realistically cannot) be checked
810 by ASSERTs, as the other repatch offsets are. Move this functionality
811 (skipping the REX prefix when patching load instructions to LEAs on
812 x86-64) into the X86Assembler.
814 * assembler/AbstractMacroAssembler.h:
815 (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadPtrToLEA):
816 * assembler/X86Assembler.h:
817 (JSC::X86Assembler::repatchLoadPtrToLEA):
819 * jit/JITPropertyAccess.cpp:
820 (JSC::JIT::patchGetByIdSelf):
821 (JSC::JIT::patchPutByIdReplace):
823 2009-06-05 Shinichiro Hamaji <hamaji@chromium.org>
825 Bug 26160: Compile fails in MacOSX when GNU fileutils are installed
827 <https://bugs.webkit.org/show_bug.cgi?id=26160>
829 Reviewed by Alexey Proskuryakov.
831 Use /bin/ln instead of ln for cases where this command is used with -h option.
832 As this option is not supported by GNU fileutils, this change helps users
833 who have GNU fileutils in their PATH.
835 * JavaScriptCore.xcodeproj/project.pbxproj:
837 2009-06-05 Gavin Barraclough <barraclough@apple.com>
839 Reviewed by Oliver Hunt.
841 Remove DoubleNotEqual floating point comparison condition for now -
842 it is not used, and it is unclear the semantics are correct (I think
843 this comparison would actually give you not-equal-or-unordered, which
844 might be what is wanted... we can revisit this interface & get it
845 right when required).
847 Also, fix asserts in branchArith32 ops. All adds & subs can check
848 for Signed, multiply only sets OF so can only check for overflow.
850 * assembler/MacroAssemblerX86Common.h:
851 (JSC::MacroAssemblerX86Common::):
852 (JSC::MacroAssemblerX86Common::branchAdd32):
853 (JSC::MacroAssemblerX86Common::branchMul32):
854 (JSC::MacroAssemblerX86Common::branchSub32):
856 2009-06-05 Gavin Barraclough <barraclough@apple.com>
858 Reviewed by Oliver Hunt.
860 Minor tidy up in JITStubs.
863 (JSC::StackHack::StackHack):
866 2009-06-05 Koen Kooi <koen@dominion.thruhere.net>
868 Reviewed by Xan Lopez.
870 Build fix for glib unicode backend.
872 * wtf/unicode/glib/UnicodeMacrosFromICU.h:
874 2009-06-05 Gavin Barraclough <barraclough@apple.com>
876 Reviewed by Oliver Hunt.
880 * assembler/MacroAssemblerX86.h:
881 * assembler/MacroAssemblerX86_64.h:
882 (JSC::MacroAssemblerX86_64::storePtrWithPatch):
883 store*() methods should take an ImplicitAddress, rather than an Address.
884 * assembler/X86Assembler.h:
885 Make patchPointer private.
886 * jit/JITOpcodes.cpp:
887 (JSC::JIT::emit_op_ret):
888 Remove empty line at end of function.
890 2009-06-05 Gavin Barraclough <barraclough@apple.com>
892 Reviewed by Oliver Hunt.
894 Encapsulate many uses of void* in the assembler & jit with types that provide
895 more semantic information. The new types are:
897 * MacroAssemblerCodePtr - this wraps a pointer into JIT generated code.
898 * FunctionPtr - this wraps a pointer to a C/C++ function in JSC.
899 * ReturnAddressPtr - this wraps a return address resulting from a 'call' instruction.
901 Wrapping these types allows for stronger type-checking than is possible with everything
902 represented a void*. For example, it is now enforced by the type system that near
903 calls can only be linked to JIT code and not to C functions in JSC (this was previously
904 required, but could not be enforced on the interface).
906 * assembler/AbstractMacroAssembler.h:
907 (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
908 (JSC::AbstractMacroAssembler::CodeLocationCommon::dataLocation):
909 (JSC::AbstractMacroAssembler::CodeLocationCommon::executableAddress):
910 (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
911 (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadToLEA):
912 (JSC::AbstractMacroAssembler::CodeLocationInstruction::CodeLocationInstruction):
913 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
914 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
915 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
916 (JSC::AbstractMacroAssembler::CodeLocationLabel::operator!):
917 (JSC::AbstractMacroAssembler::CodeLocationLabel::reset):
918 (JSC::AbstractMacroAssembler::CodeLocationLabel::CodeLocationLabel):
919 (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
920 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
921 (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
922 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
923 (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
924 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
925 (JSC::AbstractMacroAssembler::CodeLocationNearCall::relink):
926 (JSC::AbstractMacroAssembler::CodeLocationNearCall::calleeReturnAddressValue):
927 (JSC::AbstractMacroAssembler::CodeLocationNearCall::CodeLocationNearCall):
928 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
929 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
930 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
931 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
932 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToTrampoline):
933 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
934 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkNearCallerToTrampoline):
935 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::addressForLookup):
936 (JSC::AbstractMacroAssembler::trampolineAt):
937 (JSC::AbstractMacroAssembler::PatchBuffer::link):
938 (JSC::AbstractMacroAssembler::PatchBuffer::performFinalization):
939 (JSC::::CodeLocationCommon::instructionAtOffset):
940 (JSC::::CodeLocationCommon::labelAtOffset):
941 (JSC::::CodeLocationCommon::jumpAtOffset):
942 (JSC::::CodeLocationCommon::callAtOffset):
943 (JSC::::CodeLocationCommon::nearCallAtOffset):
944 (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
945 (JSC::::CodeLocationCommon::dataLabel32AtOffset):
946 * assembler/MacroAssemblerCodeRef.h:
947 (JSC::FunctionPtr::FunctionPtr):
948 (JSC::FunctionPtr::value):
949 (JSC::FunctionPtr::executableAddress):
950 (JSC::ReturnAddressPtr::ReturnAddressPtr):
951 (JSC::ReturnAddressPtr::value):
952 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
953 (JSC::MacroAssemblerCodePtr::executableAddress):
954 (JSC::MacroAssemblerCodePtr::dataLocation):
955 (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
956 * assembler/X86Assembler.h:
957 (JSC::X86Assembler::patchPointerForCall):
959 (JSC::ctiPatchNearCallByReturnAddress):
960 (JSC::ctiPatchCallByReturnAddress):
961 (JSC::JIT::privateCompile):
962 (JSC::JIT::privateCompileCTIMachineTrampolines):
964 (JSC::JIT::compileCTIMachineTrampolines):
966 (JSC::JIT::compileOpCall):
968 (JSC::JITCode::operator !):
969 (JSC::JITCode::addressForCall):
970 (JSC::JITCode::offsetOf):
971 (JSC::JITCode::execute):
972 (JSC::JITCode::size):
973 (JSC::JITCode::HostFunction):
974 * jit/JITInlineMethods.h:
975 (JSC::JIT::emitNakedCall):
976 * jit/JITPropertyAccess.cpp:
977 (JSC::JIT::privateCompilePutByIdTransition):
978 (JSC::JIT::patchGetByIdSelf):
979 (JSC::JIT::patchPutByIdReplace):
980 (JSC::JIT::privateCompilePatchGetArrayLength):
981 (JSC::JIT::privateCompileGetByIdProto):
982 (JSC::JIT::privateCompileGetByIdChain):
984 (JSC::JITThunks::JITThunks):
985 (JSC::JITThunks::tryCachePutByID):
986 (JSC::JITThunks::tryCacheGetByID):
987 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
989 (JSC::JITThunks::ctiArrayLengthTrampoline):
990 (JSC::JITThunks::ctiStringLengthTrampoline):
991 (JSC::JITThunks::ctiVirtualCallPreLink):
992 (JSC::JITThunks::ctiVirtualCallLink):
993 (JSC::JITThunks::ctiVirtualCall):
994 (JSC::JITThunks::ctiNativeCallThunk):
996 (JSC::Yarr::RegexCodeBlock::operator!):
997 (JSC::Yarr::RegexCodeBlock::execute):
999 2009-06-05 Antti Koivisto <antti@apple.com>
1001 Try to unbreak Windows build.
1003 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1004 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1006 2009-06-03 Antti Koivisto <antti@apple.com>
1008 Reviewed by Dave Kilzer.
1010 https://bugs.webkit.org/show_bug.cgi?id=13128
1011 Safari not obeying cache header
1013 Export JSC::parseDate()
1015 * JavaScriptCore.exp:
1016 * JavaScriptCore.xcodeproj/project.pbxproj:
1018 2009-06-04 Oliver Hunt <oliver@apple.com>
1020 Reviewed by Gavin Barraclough.
1022 Bug in property caching of getters and setters.
1024 Make sure that the transition logic accounts for getters and setters.
1025 If we don't we end up screwing up the transition tables so that some
1026 transitions will start incorrectly believing that they need to check
1027 for getters and setters.
1029 * runtime/JSObject.cpp:
1030 (JSC::JSObject::defineGetter):
1031 (JSC::JSObject::defineSetter):
1032 * runtime/JSObject.h:
1034 * runtime/Structure.h:
1036 2009-06-04 Gavin Barraclough <barraclough@apple.com>
1038 Reviewed by Sam Weinig.
1040 Minor tweak to PatchBuffer, change it so it no longer holds a CodeRef, and instead
1041 holds a separate code pointer and executable pool. Since it now always holds its
1042 own copy of the code size, and to simplify the construction sequence, it's neater
1045 * assembler/AbstractMacroAssembler.h:
1046 (JSC::AbstractMacroAssembler::PatchBuffer::PatchBuffer):
1047 (JSC::AbstractMacroAssembler::PatchBuffer::finalizeCode):
1048 (JSC::AbstractMacroAssembler::PatchBuffer::code):
1049 (JSC::AbstractMacroAssembler::PatchBuffer::performFinalization):
1051 2009-06-04 Gavin Barraclough <barraclough@apple.com>
1053 Reviewed by Oliver Hunt.
1055 Remove 'JIT_STUB_ARGUMENT_STACK' this is unused and untested.
1057 This just leaves JIT_STUB_ARGUMENT_REGISTER and JIT_STUB_ARGUMENT_VA_LIST.
1058 Since JIT_STUB_ARGUMENT_REGISTER is the sensible configuration on most platforms,
1059 remove this define and make this the default behaviour.
1060 Platforms must now define JIT_STUB_ARGUMENT_VA_LIST to get crazy va_list voodoo,
1063 (Refactoring of #ifdefs only, no functional change, no performance impact.)
1066 * jit/JITInlineMethods.h:
1067 (JSC::JIT::restoreArgumentReference):
1068 (JSC::JIT::restoreArgumentReferenceForTrampoline):
1074 2009-06-04 Gavin Barraclough <barraclough@apple.com>
1076 Rubber stamped by Sam Weinig.
1078 * jit/JITArithmetic.cpp:
1079 Remove some redundant typedefs, unused since arithmetic was added to the MacroAssembler interface.
1081 2009-06-04 Brent Fulgham <bfulgham@webkit.org>
1083 Build fix due to header include problem.
1085 * interpreter/Interpreter.h: Remove wtf from includes so that
1086 compile can find the headers in expected places.
1088 2009-06-04 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
1090 Reviewed by Darin Adler.
1092 HashTable class (JavaScriptCore/wtf/HashTable.h) doesn't instantiated by 'new', so
1093 inheritance was removed. HashTable struct has been instantiated by operator new in
1094 JSGlobalData.cpp:106.
1095 HashTable couldn't inherited from FastAllocBase since struct with inheritance is
1096 no longer POD, so HashTable struct has been instantiated by fastNew, destroyed by
1099 * interpreter/Interpreter.h:
1100 * runtime/JSGlobalData.cpp:
1101 (JSC::JSGlobalData::JSGlobalData):
1102 (JSC::JSGlobalData::~JSGlobalData):
1105 2009-06-04 Gavin Barraclough <barraclough@apple.com>
1107 Reviewed by Oliver Hunt.
1109 Wrap the code that plants pushes/pops planted by JIT in explanatorily named
1110 methods; move property storage reallocation into a standard stub function.
1112 ~No performance impact (possible <1% progression on x86-64, likely just noise).
1115 (JSC::JIT::privateCompile):
1116 (JSC::JIT::privateCompileCTIMachineTrampolines):
1117 Wrap calls to push/pop.
1119 Declare the new wrapper methods.
1120 * jit/JITInlineMethods.h:
1121 (JSC::JIT::preverveReturnAddressAfterCall):
1122 (JSC::JIT::restoreReturnAddressBeforeReturn):
1123 Define the new wrapper methods.
1124 * jit/JITOpcodes.cpp:
1125 (JSC::JIT::emit_op_end):
1126 (JSC::JIT::emit_op_ret):
1127 Wrap calls to push/pop.
1128 * jit/JITPropertyAccess.cpp:
1129 (JSC::JIT::privateCompilePutByIdTransition):
1130 Move property storage reallocation into a standard stub function.
1132 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1136 2009-06-04 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1138 Reviewed by Ariya Hidayat.
1140 [Qt] Single-threaded QtWebKit configuration
1141 <https://bugs.webkit.org/show_bug.cgi?id=26015>
1143 * JavaScriptCore.pri: Use ThreadingNone.cpp instead of
1144 ThreadingQt.cpp and make sure ENABLE_JSC_MULTIPLE_THREADS is turned off
1145 when ENABLE_SINGLE_THREADED is tuned on
1146 * wtf/ThreadingNone.cpp:
1147 (WTF::ThreadCondition::wait): Fix compilation warning.
1148 (WTF::ThreadCondition::timedWait): Ditto.
1150 2009-06-02 Mark Rowe <mrowe@apple.com>
1152 Reviewed by Anders Carlsson.
1154 Remove workaround that was added to address <rdar://problem/5488678> as it no longer affects our Tiger builds.
1156 * Configurations/Base.xcconfig:
1158 2009-06-02 Xan Lopez <xlopez@igalia.com>
1160 Reviewed by Sam Weinig.
1162 Use C-style comments in Platform.h so it can be included from C
1167 2009-06-02 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
1169 Rubber-stamped by Simon Hausmann.
1171 Use File::Spec->tmpdir instead of hardcoded paths for tempfile() dir
1173 This fixes the Windows-build if the user does not have a /tmp directory.
1177 2009-06-02 Gavin Barraclough <barraclough@apple.com>
1179 Reviewed by Oliver ">>" Hunt.
1181 emitSlow_op_rshift is linking the wrong number of slow cases, if !supportsFloatingPoint().
1182 Fixerate, and refactor/comment the code a little to make it clearer what is going on.
1184 * jit/JITArithmetic.cpp:
1185 (JSC::JIT::emit_op_rshift):
1186 (JSC::JIT::emitSlow_op_rshift):
1188 2009-06-01 Gavin Barraclough <barraclough@apple.com>
1190 Reviewed by NOBODY - speculative windows build fix (errm, for the other patch!).
1195 2009-06-01 Gavin Barraclough <barraclough@apple.com>
1197 Reviewed by NOBODY - speculative windows build fix.
1199 * assembler/AbstractMacroAssembler.h:
1200 (JSC::::CodeLocationCall::CodeLocationCall):
1201 (JSC::::CodeLocationNearCall::CodeLocationNearCall):
1203 2009-06-01 Gavin Barraclough <barraclough@apple.com>
1205 Reviewed by Olliej Hunt.
1207 Change JITStub functions from being static members on the JITStub class to be
1208 global extern "C" functions, and switch their the function signature declaration
1209 in the definition of the functions to be C-macro generated. This makes it easier
1210 to work with the stub functions from assembler code (since the names no longer
1211 require mangling), and by delaring the functions with a macro we can look at
1212 also auto-generating asm thunks to wrap the JITStub functions to perform the
1213 work currently in 'restoreArgumentReference' (as a memory saving).
1215 Making this change also forces us to be a bit more realistic about what is private
1216 on the Register and CallFrame objects. Presently most everything on these classes
1217 is private, and the classes have plenty of friends. We could befriend all the
1218 global functions to perpetuate the delusion of encapsulation, but using friends is
1219 a bit of a sledgehammer solution here - since friends can poke around with all of
1220 the class's privates, and since all the major classes taht operate on Regsiters are
1221 currently friends, right there is currently in practice very little protection at
1222 all. Better to start removing friend delclarations, and exposing just the parts
1223 that need to be exposed.
1225 * interpreter/CallFrame.h:
1226 (JSC::ExecState::returnPC):
1227 (JSC::ExecState::setCallerFrame):
1228 (JSC::ExecState::returnValueRegister):
1229 (JSC::ExecState::setArgumentCount):
1230 (JSC::ExecState::setCallee):
1231 (JSC::ExecState::setCodeBlock):
1232 * interpreter/Interpreter.h:
1233 * interpreter/Register.h:
1234 (JSC::Register::Register):
1238 (JSC::JITThunks::JITThunks):
1239 (JSC::JITThunks::tryCachePutByID):
1240 (JSC::JITThunks::tryCacheGetByID):
1241 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1244 * runtime/JSFunction.h:
1245 (JSC::JSFunction::nativeFunction):
1246 (JSC::JSFunction::classInfo):
1247 * runtime/JSGlobalData.h:
1249 2009-06-01 Oliver Hunt <oliver@apple.com>
1251 Reviewed by Gavin Barraclough.
1253 Tidy up the literal parser.
1255 Make the number lexing in the LiteralParser exactly match the JSON spec, which
1256 makes us cover more cases, but also more strict. Also made string lexing only
1257 allow double-quoted strings.
1259 * runtime/LiteralParser.cpp:
1260 (JSC::LiteralParser::Lexer::lex):
1261 (JSC::LiteralParser::Lexer::lexString):
1262 (JSC::LiteralParser::Lexer::lexNumber):
1264 2009-06-01 Gavin Barraclough <barraclough@apple.com>
1266 Reviewed by Sam "WX" Weinig.
1268 Allow the JIT to operate without relying on use of RWX memory, on platforms where this is supported.
1270 This patch adds a switch to Platform.h (ENABLE_ASSEMBLER_WX_EXCLUSIVE) which enables this mode of operation.
1271 When this flag is set, all executable memory will be allocated RX, and switched to RW only whilst being
1272 modified. Upon completion of code generation the protection is switched back to RX to allow execution.
1274 Further optimization will be required before it is desirable to enable this mode of operation by default;
1275 enabling this presently incurs a 5%-10% regression.
1277 (Submitting disabled - no performance impact).
1279 * assembler/AbstractMacroAssembler.h:
1280 (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadToLEA):
1281 (JSC::AbstractMacroAssembler::CodeLocationLabel::fromFunctionPointer):
1282 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
1283 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
1284 (JSC::AbstractMacroAssembler::CodeLocationNearCall::relink):
1285 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
1286 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
1287 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToTrampoline):
1288 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
1289 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkNearCallerToTrampoline):
1290 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkNearCallerToFunction):
1291 (JSC::AbstractMacroAssembler::PatchBuffer::PatchBuffer):
1292 (JSC::AbstractMacroAssembler::PatchBuffer::~PatchBuffer):
1293 (JSC::AbstractMacroAssembler::PatchBuffer::link):
1294 (JSC::AbstractMacroAssembler::PatchBuffer::patch):
1295 (JSC::AbstractMacroAssembler::PatchBuffer::performFinalization):
1296 (JSC::::CodeLocationCommon::nearCallAtOffset):
1297 (JSC::::CodeLocationCall::CodeLocationCall):
1298 (JSC::::CodeLocationNearCall::CodeLocationNearCall):
1299 * assembler/AssemblerBuffer.h:
1300 (JSC::AssemblerBuffer::executableCopy):
1301 * assembler/X86Assembler.h:
1302 (JSC::CAN_SIGN_EXTEND_U32_64):
1303 (JSC::X86Assembler::linkJump):
1304 (JSC::X86Assembler::linkCall):
1305 (JSC::X86Assembler::patchPointer):
1306 (JSC::X86Assembler::relinkJump):
1307 (JSC::X86Assembler::relinkCall):
1308 (JSC::X86Assembler::repatchInt32):
1309 (JSC::X86Assembler::repatchPointer):
1310 (JSC::X86Assembler::repatchLoadToLEA):
1311 (JSC::X86Assembler::patchInt32):
1312 (JSC::X86Assembler::patchRel32):
1313 * jit/ExecutableAllocator.h:
1314 (JSC::ExecutableAllocator::):
1315 (JSC::ExecutableAllocator::makeWritable):
1316 (JSC::ExecutableAllocator::makeExecutable):
1317 * jit/ExecutableAllocatorFixedVMPool.cpp:
1318 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
1319 * jit/ExecutableAllocatorPosix.cpp:
1320 (JSC::ExecutablePool::systemAlloc):
1321 (JSC::ExecutablePool::systemRelease):
1322 (JSC::ExecutableAllocator::reprotectRegion):
1323 * jit/ExecutableAllocatorWin.cpp:
1324 * jit/JITPropertyAccess.cpp:
1325 (JSC::JIT::patchGetByIdSelf):
1326 (JSC::JIT::patchPutByIdReplace):
1329 2009-05-29 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
1331 Reviewed by Darin Adler.
1333 Inherits Interpreter class from FastAllocBase because it has been
1334 instantiated by 'new' in JavaScriptCore/runtime/JSGlobalData.cpp.
1336 * interpreter/Interpreter.h:
1338 2009-06-01 David Levin <levin@chromium.org>
1340 Reviewed by NOBODY (windows build fix).
1342 Add exports for windows (corresponding to the JavaScriptCore.exp modification
1343 in the previous change).
1345 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1346 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1348 2009-06-01 David Levin <levin@chromium.org>
1350 Reviewed by Darin Alder and Maciej Stachowiak.
1352 Bug 26057: StringImpl should share buffers with UString.
1353 https://bugs.webkit.org/show_bug.cgi?id=26057
1355 * JavaScriptCore.exp:
1356 * runtime/UString.cpp:
1357 (JSC::UString::Rep::create):
1358 (JSC::UString::BaseString::sharedBuffer): Only do the sharing when
1359 the buffer exceeds a certain size. The size was tuned by running
1360 various dom benchmarks with numbers ranging from 20 to 800 and finding
1361 a place that seemed to do the best overall.
1362 * runtime/UString.h:
1364 2009-05-31 Gavin Barraclough <barraclough@apple.com>
1366 Reviewed by Olliej "you just need to change NativeFunctionWrapper.h" Hunt.
1368 Add ENABLE_JIT_OPTIMIZE_NATIVE_CALL switch to allow JIT to operate without native call optimizations.
1370 * runtime/NativeFunctionWrapper.h:
1373 2009-05-30 Darin Adler <darin@apple.com>
1375 Reviewed by Sam Weinig.
1377 <rdar://problem/6935193> REGRESSION (r42734): Celtic Kane JavaScript benchmark does not run:
1378 "Maximum call stack size exceeded"
1380 * runtime/ArrayPrototype.cpp:
1381 (JSC::arrayProtoFuncToString): Use the same recursion limit as the other recursion checks.
1382 We need a limit of at least 100 to run the benchmark above.
1383 (JSC::arrayProtoFuncToLocaleString): Ditto.
1384 (JSC::arrayProtoFuncJoin): Ditto.
1386 2009-05-28 Dirk Schulze <krit@webkit.org>
1388 Reviewed by Nikolas Zimmermann.
1390 Added new build flag --filters for Mac. More details in WebCore/ChangeLog.
1392 * Configurations/FeatureDefines.xcconfig:
1394 2009-05-27 Oliver Hunt <oliver@apple.com>
1396 Reviewed by Mark Rowe.
1398 <rdar://problem/6928025> Stack overflow in JSC::stringProtoFuncReplace() running jsFunFuzz
1400 We should always check for exceptions after creating a CachedCall, this wasn't being done in
1401 the string replace logic.
1403 * runtime/StringPrototype.cpp:
1404 (JSC::stringProtoFuncReplace):
1406 2009-05-27 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
1408 Unreviewed (make distcheck) build fix; adding missing headers.
1412 2009-05-27 Jessie Berlin <jberlin@apple.com>
1414 Reviewed by Adam Roben
1416 Fix the Windows build.
1418 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1419 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1421 2009-05-27 Fridrich Strba <fridrich.strba@bluewin.ch>
1423 Reviewed by Gustavo Noronha.
1425 When building on Windows, consider Windows specific files.
1429 2009-05-27 Fridrich Strba <fridrich.strba@bluewin.ch>
1431 Reviewed by Maciej Stachowiak.
1433 When building with MinGW, don't use the __declspec(dl{import,export})
1434 decorations and rely on the linker to use its nifty auto-import feature.
1435 It is extremely hard to get the decorations right with MinGW in general
1436 and impossible in WebKit, where the resulting shared library is linking
1437 together some static libraries.
1441 2009-05-26 Holger Hans Peter Freyther <zecke@selfish.org>
1443 Reviewed by Xan Lopez.
1445 https://bugs.webkit.org/show_bug.cgi?id=25613
1447 Be able to use GOwnPtr for GHashTable as well. The assumption
1448 is that the hash table has been created with g_hash_table_new_full
1449 and has proper destruction functions.
1455 2009-05-26 Oliver Hunt <oliver@apple.com>
1457 Reviewed by Gavin Barraclough.
1459 <rdar://problem/6924033> REGRESSION: Assertion failure due to forward references
1461 Add a pattern type for forward references to ensure that we don't confuse the
1462 quantifier alternatives assertion.
1464 * yarr/RegexCompiler.cpp:
1465 (JSC::Yarr::RegexPatternConstructor::atomBackReference):
1466 (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
1467 * yarr/RegexInterpreter.cpp:
1468 (JSC::Yarr::ByteCompiler::emitDisjunction):
1469 * yarr/RegexJIT.cpp:
1470 (JSC::Yarr::RegexGenerator::generateTerm):
1471 * yarr/RegexPattern.h:
1472 (JSC::Yarr::PatternTerm::):
1473 (JSC::Yarr::PatternTerm::PatternTerm):
1474 (JSC::Yarr::PatternTerm::ForwardReference):
1476 2009-05-26 Gavin Barraclough <barraclough@apple.com>
1478 Reviewed by Oliver Hunt.
1480 Fix for: <rdar://problem/6918095> REGRESSION: jQuery load() issue (25981),
1481 and also an ASSERT failure on http://ihasahotdog.com/.
1483 When overwriting a property on a dictionary with a cached specific value,
1484 clear the cache if new value being written is different.
1486 * JavaScriptCore.exp:
1487 Export the new symbols.
1489 (JSC::JITStubs::cti_op_get_by_id_method_check_second):
1490 Close dictionary prototypes upon caching a method access, as would happen when caching
1491 a regular get_by_id.
1492 * runtime/JSObject.h:
1493 (JSC::JSObject::propertyStorage):
1494 (JSC::JSObject::locationForOffset):
1495 Make these methods private.
1496 (JSC::JSObject::putDirectInternal):
1497 When overwriting a property on a dictionary with a cached specific value,
1498 clear the cache if new value being written is different.
1499 * runtime/Structure.cpp:
1500 (JSC::Structure::despecifyDictionaryFunction):
1501 Reset the specific value field for a given property in a dictionary.
1502 (JSC::Structure::despecifyFunctionTransition):
1503 Rename of 'changeFunctionTransition' (this was already internally refered to as a despecification).
1504 * runtime/Structure.h:
1507 2009-05-26 Gavin Barraclough <barraclough@apple.com>
1509 Reviewed by Oliver "pieces of eight" Hunt.
1511 When reseting RegexPattern class, should fully reset the class, not just bits of it.
1512 In particular, we delete the cached character classes (for wordchars, etc), but do
1513 not reset the set of pointers to the cached classes. In the case of a repeated parse
1514 due to an illegal back-reference we will continue to use the deleted character class.
1516 * yarr/RegexPattern.h:
1517 (JSC::Yarr::RegexPattern::reset):
1519 2009-05-26 Brent Fulgham <bfulgham@webkit.org>
1521 Build fix to correct r44161.
1523 * wtf/FastAllocBase.h:
1525 2009-05-26 Zoltan Horvath <horvath.zoltan.6@stud.u-szeged.hu>
1527 Reviewed by Maciej Stachowiak.
1529 Inherite HashTable from FastAllocBase, because it has been instantiated by
1530 'new' in JavaScriptCore/runtime/JSGlobalData.cpp.
1533 * wtf/FastAllocBase.h: Remove 'wtf' path from TypeTraits.h to allow use outside of wtf.
1535 2009-05-25 David Levin <levin@chromium.org>
1537 Reviewed by Maciej Stachowiak and Oliver Hunt.
1539 https://bugs.webkit.org/show_bug.cgi?id=25126
1540 Allow the buffer underlying UString to be shared.
1542 In order to not grow the underlying size of any structure,
1543 there is a union in the Rep string which holds
1544 + m_sharedBuffer -- a pointer to the shared ref counted buffer
1545 if the class is BaseString and the buffer is being shared OR
1546 + m_baseString -- the BaseString if the class is only UString::Rep
1547 but not a UString::BaseString
1549 Ideally, m_sharedBuffer would be a RefPtr, but it cannot be because
1552 No change in sunspider perf.
1554 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1555 * JavaScriptCore.xcodeproj/project.pbxproj:
1556 * runtime/UString.cpp:
1557 (JSC::UString::Rep::share):
1558 (JSC::UString::Rep::destroy):
1559 (JSC::UString::BaseString::sharedBuffer):
1560 (JSC::UString::BaseString::setSharedBuffer):
1561 (JSC::UString::BaseString::slowIsBufferReadOnly):
1562 (JSC::expandCapacity):
1563 (JSC::UString::Rep::reserveCapacity):
1564 (JSC::UString::expandPreCapacity):
1566 (JSC::UString::append):
1567 * runtime/UString.h:
1568 (JSC::UString::Rep::Rep):
1569 (JSC::UString::Rep::):
1570 (JSC::UString::BaseString::isShared):
1571 (JSC::UString::BaseString::isBufferReadOnly):
1572 (JSC::UString::Rep::baseString):
1573 * wtf/CrossThreadRefCounted.h:
1574 (WTF::CrossThreadRefCounted::isShared):
1575 * wtf/OwnFastMallocPtr.h: Added.
1576 (WTF::OwnFastMallocPtr::OwnFastMallocPtr):
1577 (WTF::OwnFastMallocPtr::~OwnFastMallocPtr):
1578 (WTF::OwnFastMallocPtr::get):
1579 (WTF::OwnFastMallocPtr::release):
1581 2009-05-25 Oliver Hunt <oliver@apple.com>
1583 Reviewed by Maciej Stachowiak.
1585 Re-add interpreter logic to jit-enabled builds as GCC mysteriously regresses without it
1589 2009-05-25 Fridrich Strba <fridrich.strba@bluewin.ch>
1591 Reviewed by Maciej Stachowiak.
1593 The functions written in assembly need to have a leading
1594 underscore on Windows too.
1598 2009-05-24 Steve Falkenburg <sfalken@apple.com>
1600 Build fix for experimental PGO Windows target.
1602 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1604 2009-05-23 David Kilzer <ddkilzer@apple.com>
1606 Part 1 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr
1608 <https://bugs.webkit.org/show_bug.cgi?id=25495>
1610 Reviewed by Oliver Hunt.
1612 * GNUmakefile.am: Added OwnPtrCommon.h and PassOwnPtr.h.
1613 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
1614 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
1617 (WTF::OwnPtr::OwnPtr): Added constructors that take a
1618 PassOwnPtr. Also added a copy constructor declaration that's
1619 required when assigning a PassOwnPtr to a stack-based OwnPtr.
1620 (WTF::operator=): Added assignment operator methods that take a
1622 (WTF::swap): Reformatted.
1623 (WTF::operator==): Whitespace changes.
1624 (WTF::operator!=): Ditto.
1626 * wtf/OwnPtrCommon.h: Added.
1627 (WTF::deleteOwnedPtr):
1629 * wtf/PassOwnPtr.h: Added.
1630 (WTF::PassOwnPtr::PassOwnPtr):
1631 (WTF::PassOwnPtr::~PassOwnPtr):
1632 (WTF::PassOwnPtr::get):
1633 (WTF::PassOwnPtr::clear):
1634 (WTF::PassOwnPtr::release):
1635 (WTF::PassOwnPtr::operator*):
1636 (WTF::PassOwnPtr::operator->):
1637 (WTF::PassOwnPtr::operator!):
1638 (WTF::PassOwnPtr::operator UnspecifiedBoolType):
1642 (WTF::static_pointer_cast):
1643 (WTF::const_pointer_cast):
1646 2009-05-23 Oliver Hunt <oliver@apple.com>
1648 Reviewed by Maciej Stachowiak.
1650 Remove interpreter specific logic from the JIT builds.
1652 This saves ~100k in JSC release builds.
1654 * interpreter/Interpreter.cpp:
1655 (JSC::Interpreter::privateExecute):
1656 * interpreter/Interpreter.h:
1659 2009-05-22 Mark Rowe <mrowe@apple.com>
1661 Part two of an attempted Windows build fix.
1663 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1664 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1666 2009-05-22 Mark Rowe <mrowe@apple.com>
1668 Part one of an attempted Windows build fix.
1670 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1671 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1673 2009-05-21 Gavin Barraclough <barraclough@apple.com>
1675 Reviewed by Geoff Garen.
1679 Optimize method calls, by caching specific function values within the Structure.
1680 The new opcode is used almost like an x86 opcode prefix byte to optimize op_get_by_id,
1681 where the property access is being used to read a function to be passed to op-call (i.e.
1682 'foo.bar();'). This patch modifies the Structure class such that when a property is
1683 put to an object for the first time we will check if the value is a function. If it is,
1684 we will cache the function value on the Structure. A Structure in such a state guarantees
1685 that not only does a property with the given identifier exist on the object, but also that
1686 its value is unchanged. Upon any further attempt to put a property with the same identifier
1687 (but a different value) to the object, it will transition back to a normal Structure (where
1688 it will guarantee the presence but not the value of the property).
1690 op_method_check makes use of the new information made available by the Structure, by
1691 augmenting the functionality of op_get_by_id. Upon generating a FunctionCallDotNode a
1692 check will be emitted prior to the property access reading the function value, and the JIT
1693 will generate an extra (initially unlinked but patchable) set of checks prior to the regular
1694 JIT code for get_by_id. The new code will do inline structure and prototype structure check
1695 (unlike a regular get_by_id, which can only handle 'self' accesses inline), and then performs
1696 an immediate load of the function value, rather than using memory accesses to load the value
1697 from the obejct's property storage array. If the method check fails it will revert, or if
1698 the access is polymorphic, the op_get_by_id will continue to operate - and optimize itself -
1699 just as any other regular op_get_by_id would.
1701 ~2.5% on v8-tests, due to a ~9% progression on richards.
1703 * API/JSCallbackObjectFunctions.h:
1705 (JSC::::staticFunctionGetter):
1706 * API/JSObjectRef.cpp:
1707 (JSObjectMakeConstructor):
1708 * JavaScriptCore.exp:
1709 * assembler/AbstractMacroAssembler.h:
1710 (JSC::AbstractMacroAssembler::differenceBetween):
1711 * assembler/MacroAssemblerX86.h:
1712 (JSC::MacroAssemblerX86::moveWithPatch):
1713 * bytecode/CodeBlock.cpp:
1714 (JSC::CodeBlock::dump):
1715 * bytecode/CodeBlock.h:
1716 (JSC::getMethodCallLinkInfoReturnLocation):
1717 (JSC::CodeBlock::getMethodCallLinkInfo):
1718 (JSC::CodeBlock::addMethodCallLinkInfos):
1719 (JSC::CodeBlock::methodCallLinkInfo):
1720 * bytecode/Opcode.h:
1721 * bytecompiler/BytecodeGenerator.cpp:
1722 (JSC::BytecodeGenerator::emitMethodCheck):
1723 * bytecompiler/BytecodeGenerator.h:
1724 * interpreter/Interpreter.cpp:
1725 (JSC::Interpreter::privateExecute):
1727 (JSC::JIT::privateCompileMainPass):
1728 (JSC::JIT::privateCompileSlowCases):
1729 (JSC::JIT::privateCompile):
1731 (JSC::MethodCallCompilationInfo::MethodCallCompilationInfo):
1732 * jit/JITOpcodes.cpp:
1733 * jit/JITPropertyAccess.cpp:
1734 (JSC::JIT::emit_op_method_check):
1735 (JSC::JIT::emitSlow_op_method_check):
1736 (JSC::JIT::emit_op_get_by_id):
1737 (JSC::JIT::emitSlow_op_get_by_id):
1738 (JSC::JIT::emit_op_put_by_id):
1739 (JSC::JIT::emitSlow_op_put_by_id):
1740 (JSC::JIT::compileGetByIdHotPath):
1741 (JSC::JIT::compileGetByIdSlowCase):
1742 (JSC::JIT::patchMethodCallProto):
1744 (JSC::JITStubs::cti_op_get_by_id_method_check):
1745 (JSC::JITStubs::cti_op_get_by_id_method_check_second):
1748 (GlobalObject::GlobalObject):
1750 (JSC::FunctionCallDotNode::emitBytecode):
1751 * runtime/Arguments.cpp:
1752 (JSC::Arguments::put):
1753 * runtime/ArrayConstructor.cpp:
1754 (JSC::ArrayConstructor::ArrayConstructor):
1755 * runtime/BooleanConstructor.cpp:
1756 (JSC::BooleanConstructor::BooleanConstructor):
1757 * runtime/DateConstructor.cpp:
1758 (JSC::DateConstructor::DateConstructor):
1759 * runtime/ErrorConstructor.cpp:
1760 (JSC::ErrorConstructor::ErrorConstructor):
1761 (JSC::constructError):
1762 * runtime/ErrorPrototype.cpp:
1763 (JSC::ErrorPrototype::ErrorPrototype):
1764 * runtime/FunctionConstructor.cpp:
1765 (JSC::FunctionConstructor::FunctionConstructor):
1766 * runtime/FunctionPrototype.cpp:
1767 (JSC::FunctionPrototype::FunctionPrototype):
1768 * runtime/InternalFunction.cpp:
1769 (JSC::InternalFunction::InternalFunction):
1770 * runtime/JSActivation.cpp:
1771 (JSC::JSActivation::put):
1772 (JSC::JSActivation::putWithAttributes):
1773 * runtime/JSByteArray.cpp:
1774 (JSC::JSByteArray::JSByteArray):
1775 * runtime/JSFunction.cpp:
1776 (JSC::JSFunction::JSFunction):
1777 (JSC::JSFunction::getOwnPropertySlot):
1778 * runtime/JSGlobalObject.cpp:
1779 (JSC::JSGlobalObject::putWithAttributes):
1780 (JSC::JSGlobalObject::reset):
1781 (JSC::JSGlobalObject::mark):
1782 * runtime/JSGlobalObject.h:
1783 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
1784 (JSC::JSGlobalObject::methodCallDummy):
1785 * runtime/JSObject.cpp:
1786 (JSC::JSObject::put):
1787 (JSC::JSObject::putWithAttributes):
1788 (JSC::JSObject::deleteProperty):
1789 (JSC::JSObject::defineGetter):
1790 (JSC::JSObject::defineSetter):
1791 (JSC::JSObject::getPropertyAttributes):
1792 (JSC::JSObject::getPropertySpecificFunction):
1793 (JSC::JSObject::putDirectFunction):
1794 (JSC::JSObject::putDirectFunctionWithoutTransition):
1795 * runtime/JSObject.h:
1796 (JSC::getJSFunction):
1797 (JSC::JSObject::getDirectLocation):
1798 (JSC::JSObject::putDirect):
1799 (JSC::JSObject::putDirectWithoutTransition):
1800 * runtime/LiteralParser.cpp:
1801 (JSC::LiteralParser::parseObject):
1802 * runtime/Lookup.cpp:
1803 (JSC::setUpStaticFunctionSlot):
1806 * runtime/MathObject.cpp:
1807 (JSC::MathObject::MathObject):
1808 * runtime/NativeErrorConstructor.cpp:
1809 (JSC::NativeErrorConstructor::NativeErrorConstructor):
1810 (JSC::NativeErrorConstructor::construct):
1811 * runtime/NativeErrorPrototype.cpp:
1812 (JSC::NativeErrorPrototype::NativeErrorPrototype):
1813 * runtime/NumberConstructor.cpp:
1814 (JSC::NumberConstructor::NumberConstructor):
1815 * runtime/ObjectConstructor.cpp:
1816 (JSC::ObjectConstructor::ObjectConstructor):
1817 * runtime/PropertyMapHashTable.h:
1818 (JSC::PropertyMapEntry::PropertyMapEntry):
1819 * runtime/PrototypeFunction.cpp:
1820 (JSC::PrototypeFunction::PrototypeFunction):
1821 * runtime/PutPropertySlot.h:
1822 (JSC::PutPropertySlot::):
1823 (JSC::PutPropertySlot::PutPropertySlot):
1824 (JSC::PutPropertySlot::setNewProperty):
1825 (JSC::PutPropertySlot::setDespecifyFunctionProperty):
1826 (JSC::PutPropertySlot::isCacheable):
1827 (JSC::PutPropertySlot::cachedOffset):
1828 * runtime/RegExpConstructor.cpp:
1829 (JSC::RegExpConstructor::RegExpConstructor):
1830 * runtime/StringConstructor.cpp:
1831 (JSC::StringConstructor::StringConstructor):
1832 * runtime/StringPrototype.cpp:
1833 (JSC::StringPrototype::StringPrototype):
1834 * runtime/Structure.cpp:
1835 (JSC::Structure::Structure):
1836 (JSC::Structure::~Structure):
1837 (JSC::Structure::materializePropertyMap):
1838 (JSC::Structure::addPropertyTransitionToExistingStructure):
1839 (JSC::Structure::addPropertyTransition):
1840 (JSC::Structure::changeFunctionTransition):
1841 (JSC::Structure::addPropertyWithoutTransition):
1842 (JSC::Structure::get):
1843 (JSC::Structure::despecifyFunction):
1844 (JSC::Structure::put):
1845 (JSC::Structure::remove):
1846 * runtime/Structure.h:
1847 (JSC::Structure::get):
1848 (JSC::Structure::specificFunction):
1849 * runtime/StructureTransitionTable.h:
1850 (JSC::StructureTransitionTableHashTraits::emptyValue):
1853 2009-05-22 Brent Fulgham <bfulgham@webkit.org>
1855 Reviewed by Steve Falkenburg.
1857 https://bugs.webkit.org/show_bug.cgi?id=25950
1858 JavaScriptCore Fails to build on Windows (Cairo) due to CoreFoundation
1861 Modify project to add new Debug_CFLite and Release_CFLite targets. These
1862 use the new JavaScriptCoreCFLite.vsprops to link against CFLite.dll.
1863 Existing projects are changed to use the new JavaScriptCoreCF.vsprops
1864 to link against CoreFoundation.dll.
1866 The JavaScriptCoreCommon.vsprops is modified to remove the link
1867 against CoreFoundation.dll.
1869 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1870 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCF.vsprops: Added.
1871 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops: Added.
1872 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
1874 2009-05-22 Dominik Röttsches <dominik.roettsches@access-company.com>
1876 Reviewed by Gustavo Noronha.
1878 https://bugs.webkit.org/show_bug.cgi?id=15914
1879 [GTK] Implement Unicode functionality using GLib
1881 Original patch by Jürg Billeter and Naiem Shaik.
1882 Implementing WTF Unicode functionality based on GLib.
1885 * wtf/unicode/Unicode.h:
1886 * wtf/unicode/glib: Added.
1887 * wtf/unicode/glib/UnicodeGLib.cpp: Added.
1888 (WTF::Unicode::foldCase):
1889 (WTF::Unicode::toLower):
1890 (WTF::Unicode::toUpper):
1891 (WTF::Unicode::direction):
1892 (WTF::Unicode::umemcasecmp):
1893 * wtf/unicode/glib/UnicodeGLib.h: Added.
1895 (WTF::Unicode::toLower):
1896 (WTF::Unicode::toUpper):
1897 (WTF::Unicode::toTitleCase):
1898 (WTF::Unicode::isArabicChar):
1899 (WTF::Unicode::isFormatChar):
1900 (WTF::Unicode::isSeparatorSpace):
1901 (WTF::Unicode::isPrintableChar):
1902 (WTF::Unicode::isDigit):
1903 (WTF::Unicode::isPunct):
1904 (WTF::Unicode::mirroredChar):
1905 (WTF::Unicode::category):
1906 (WTF::Unicode::isLower):
1907 (WTF::Unicode::digitValue):
1908 (WTF::Unicode::combiningClass):
1909 (WTF::Unicode::decompositionType):
1910 * wtf/unicode/glib/UnicodeMacrosFromICU.h: Added.
1912 2009-05-21 Xan Lopez <xlopez@igalia.com>
1914 Unreviewed build fix.
1916 Add MacroAssemblerCodeRef.h to file list.
1920 2009-05-21 Gavin Barraclough <barraclough@apple.com>
1922 Reviewed by Darin Adler.
1923 Addition of MacroAssemblerCodeRef.h rubber stamped by Geoff Garen.
1925 Refactor JIT code-handle objects. The representation of generated code is currently
1926 a bit of a mess. We have a class JITCode which wraps the pointer to a block of
1927 generated code, but this object does not reference the executable pool meaning that
1928 external events (the pool being derefed) could make the pointer become invalid.
1929 To overcome this both the JIT and Yarr implement further (and similar) objects to
1930 wrap the code pointer with a RefPtr to the pool. To add to the mire, as well as the
1931 CodeBlock containing a handle onto the code the FunctionBodyNode also contains a
1932 copy of the code pointer which is used almost (but not entirely) uniquely to access
1933 the JIT code for a function.
1935 Rationalization of all this:
1937 * Add a new type 'MacroAssembler::CodeRef' as a handle for a block of JIT generated code.
1938 * Change the JIT & Yarr to internally handle code using CodeRefs.
1939 * Move the CodeRef (formerly anow defunct JITCodeRef) from CodeBlock to its owner node.
1940 * Remove the (now) redundant code pointer from FunctionBodyNode.
1942 While tidying this up I've made the PatchBuffer return code in new allocations using a CodeRef,
1943 and have enforced an interface that the PatchBuffer will always be used, and 'finalizeCode()' or
1944 'finalizeCodeAddendum()' will always be called exactly once on the PatchBuffer to complete code generation.
1946 This gives us a potentially useful hook ('PatchBuffer::performFinalization()') at the end of generation,
1947 which may have a number of uses. It may be helpful should we wish to switch our generation
1948 model to allow RW/RX exclusive memory, and it may be useful on non-cache-coherent platforms to
1949 give us an oportunity to cache flush as necessary.
1951 No performance impact.
1953 * assembler/AbstractMacroAssembler.h:
1954 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToTrampoline):
1955 (JSC::AbstractMacroAssembler::CodeRef::CodeRef):
1956 (JSC::AbstractMacroAssembler::CodeRef::trampolineAt):
1957 (JSC::AbstractMacroAssembler::PatchBuffer::PatchBuffer):
1958 (JSC::AbstractMacroAssembler::PatchBuffer::~PatchBuffer):
1959 (JSC::AbstractMacroAssembler::PatchBuffer::link):
1960 (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
1961 (JSC::AbstractMacroAssembler::PatchBuffer::patch):
1962 (JSC::AbstractMacroAssembler::PatchBuffer::complete):
1963 (JSC::AbstractMacroAssembler::PatchBuffer::finalize):
1964 (JSC::AbstractMacroAssembler::PatchBuffer::entry):
1965 * bytecode/CodeBlock.cpp:
1966 (JSC::CodeBlock::CodeBlock):
1967 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
1968 (JSC::CodeBlock::setJITCode):
1969 * bytecode/CodeBlock.h:
1970 (JSC::CodeBlock::getBytecodeIndex):
1971 (JSC::CodeBlock::executablePool):
1972 * interpreter/CallFrameClosure.h:
1973 * interpreter/Interpreter.cpp:
1974 (JSC::Interpreter::execute):
1975 (JSC::Interpreter::prepareForRepeatCall):
1977 (JSC::JIT::privateCompile):
1978 (JSC::JIT::privateCompileCTIMachineTrampolines):
1979 (JSC::JIT::linkCall):
1982 (JSC::JITCode::JITCode):
1983 (JSC::JITCode::operator bool):
1984 (JSC::JITCode::addressForCall):
1985 (JSC::JITCode::offsetOf):
1986 (JSC::JITCode::execute):
1987 (JSC::JITCode::size):
1988 (JSC::JITCode::executablePool):
1989 (JSC::JITCode::HostFunction):
1990 * jit/JITPropertyAccess.cpp:
1991 (JSC::JIT::privateCompilePutByIdTransition):
1992 (JSC::JIT::privateCompilePatchGetArrayLength):
1993 (JSC::JIT::privateCompileGetByIdProto):
1994 (JSC::JIT::privateCompileGetByIdSelfList):
1995 (JSC::JIT::privateCompileGetByIdProtoList):
1996 (JSC::JIT::privateCompileGetByIdChainList):
1997 (JSC::JIT::privateCompileGetByIdChain):
1999 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2000 (JSC::JITStubs::cti_vm_lazyLinkCall):
2002 (JSC::ProgramNode::generateJITCode):
2003 (JSC::EvalNode::generateJITCode):
2004 (JSC::FunctionBodyNode::FunctionBodyNode):
2005 (JSC::FunctionBodyNode::createNativeThunk):
2006 (JSC::FunctionBodyNode::generateJITCode):
2008 (JSC::ScopeNode::generatedJITCode):
2009 (JSC::ScopeNode::getExecutablePool):
2010 (JSC::ScopeNode::setJITCode):
2011 (JSC::ProgramNode::jitCode):
2012 (JSC::EvalNode::jitCode):
2013 (JSC::FunctionBodyNode::jitCode):
2014 * runtime/RegExp.cpp:
2015 (JSC::RegExp::match):
2016 * yarr/RegexJIT.cpp:
2017 (JSC::Yarr::RegexGenerator::compile):
2018 (JSC::Yarr::jitCompileRegex):
2019 (JSC::Yarr::executeRegex):
2021 (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
2022 (JSC::Yarr::RegexCodeBlock::pcreFallback):
2023 (JSC::Yarr::RegexCodeBlock::setFallback):
2024 (JSC::Yarr::RegexCodeBlock::operator bool):
2025 (JSC::Yarr::RegexCodeBlock::set):
2026 (JSC::Yarr::RegexCodeBlock::execute):
2028 2009-05-21 Oliver Hunt <oliver@apple.com>
2030 Reviewed by Maciej Stachowiak.
2032 <rdar://problem/6910264> REGRESSION: Cached DOM global object property access fails in browser (25921)
2033 <https://bugs.webkit.org/show_bug.cgi?id=25921>
2035 When caching properties on the global object we need to ensure that we're
2036 not attempting to cache through a shell object.
2038 * interpreter/Interpreter.cpp:
2039 (JSC::Interpreter::resolveGlobal):
2041 (JSC::JITStubs::cti_op_resolve_global):
2043 2009-05-21 Steve Falkenburg <sfalken@apple.com>
2047 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
2049 2009-05-21 Cameron Zwarich <zwarich@apple.com>
2051 Reviewed by Mark Rowe.
2053 Bug 25945: Add support for MADV_FREE to TCMalloc
2054 <https://bugs.webkit.org/show_bug.cgi?id=25945>
2055 <rdar://problem/6910754>
2057 Add support for MADV_FREE to TCMalloc_SystemRelease for platforms that
2058 don't also support MADV_FREE_REUSE. The code is identical to the MADV_DONTNEED
2059 case except for the advice passed to madvise(), so combining the two cases
2060 makes the most sense.
2062 * wtf/Platform.h: Only define HAVE_MADV_FREE when not building on Tiger or
2063 Leopard, because while it is defined on these platforms it actually does
2065 * wtf/TCSystemAlloc.cpp:
2066 (TCMalloc_SystemRelease): use MADV_FREE if it is available; otherwise use
2069 2009-05-21 Mark Rowe <mrowe@apple.com>
2071 Reviewed by Oliver Hunt.
2073 Fix <https://bugs.webkit.org/show_bug.cgi?id=25917> / <rdar://problem/6910066>.
2074 Bug 25917: REGRESSION (r43559?): Javascript debugger crashes when pausing page
2076 The debugger currently retrieves the arguments object from an activation rather than pulling
2077 it from a call frame. This is unreliable to due to the recent optimization to lazily create
2078 the arguments object. In the long-term it should stop doing that (<rdar://problem/6911886>),
2079 but for now we force eager creation of the arguments object when debugging.
2081 * bytecompiler/BytecodeGenerator.cpp:
2082 (JSC::BytecodeGenerator::BytecodeGenerator):
2084 2009-05-21 Cameron Zwarich <zwarich@apple.com>
2086 Reviewed by Maciej Stachowiak.
2088 Bug 25912: Harden NumberPrototype.cpp by removing use of strcpy()
2089 <https://bugs.webkit.org/show_bug.cgi?id=25912>
2091 This causes no change on SunSpider.
2093 * runtime/NumberPrototype.cpp:
2094 (JSC::integerPartNoExp): replace strcpy() with memcpy(), ASSERT that the
2095 temporary buffer has sufficient space to store the result, and move the
2096 explicit null-termination closer to the memcpy() for easier visual inspection
2098 (JSC::fractionalPartToString): replace strcpy() with memcpy(), and ASSERT
2099 that the temporary buffer has sufficient space to store the result. There
2100 is no explicit null-termination because this is done by the caller. The
2101 same is already true for exponentialPartToString().
2102 (JSC::numberProtoFuncToExponential): replace strcpy() with memcpy(), explicitly
2103 null-terminate the result, and ASSERT that the temporary buffer has sufficient
2104 space to store the result.
2106 2009-05-20 Sam Weinig <sam@webkit.org>
2108 Reviewed by Cameron Zwarich.
2110 Cleanup the JSGlobalData when exiting early with the usage statement in jsc.
2113 (printUsageStatement):
2117 2009-05-20 Stephanie Lewis <slewis@apple.com>
2119 Update the order files. <rdar://problem/6881750> Generate new order files.
2121 * JavaScriptCore.order:
2123 2009-05-19 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
2125 Reviewed by Simon Hausmann.
2127 Replace WREC with YARR + YARR_JIT for the Qt port. This is only
2128 used when compiled with JIT support for now, so it is a drop-in
2129 replacement for the WREC usage. Still including the wrec headers
2130 as they are being referred from RegExp.h, though the contents of
2131 that header it protected by "#if ENABLE(WREC)".
2133 * JavaScriptCore.pri:
2135 2009-05-20 Xan Lopez <xlopez@igalia.com>
2137 Reviewed by Eric Seidel.
2139 Fix GTK debug build.
2141 The function dumpDisjunction, compiled with debug enabled, uses
2142 printf, which needs stdio.h to be included.
2144 * yarr/RegexInterpreter.cpp:
2146 2009-05-20 Laszlo Gombos <laszlo.1.gombos@nokia.com>
2148 Reviewed by George Staikos.
2150 BUG 25843: [Qt] Remove qt-port build flag
2151 <https://bugs.webkit.org/show_bug.cgi?id=25843>
2153 * JavaScriptCore.pro:
2156 2009-05-19 Geoffrey Garen <ggaren@apple.com>
2160 * interpreter/RegisterFile.cpp:
2161 (JSC::RegisterFile::releaseExcessCapacity): Copy-paste typo.
2163 2009-05-19 Geoffrey Garen <ggaren@apple.com>
2165 Reviewed by Sam Weinig.
2167 Fixed <rdar://problem/6885680> CrashTracer: [USER] 1 crash in Install
2168 Mac OS X at <unknown binary> • 0x9274241c
2170 (Original patch by Joe Sokol and Ronnie Misra.)
2172 SunSpider says 1.004x faster.
2174 * interpreter/RegisterFile.cpp:
2175 (JSC::RegisterFile::releaseExcessCapacity): Instead of doing complicated
2176 math that sometimes used to overflow, just release the full range of the
2179 * interpreter/RegisterFile.h:
2180 (JSC::isPageAligned):
2181 (JSC::RegisterFile::RegisterFile): Added ASSERTs to verify that it's
2182 safe to release the full range of the register file.
2184 (JSC::RegisterFile::shrink): No need to releaseExcessCapacity() if the
2185 new end is not smaller than the old end. (Also, doing so used to cause
2186 numeric overflow, unmapping basically the whole process from memory.)
2188 2009-05-19 Oliver Hunt <oliver@apple.com>
2192 <rdar://problem/6888393> REGRESSION: Start Debugging JavaScript crashes browser (nightly builds only?)
2193 <https://bugs.webkit.org/show_bug.cgi?id=25717>
2195 Remove JSC_FAST_CALL as it wasn't gaining us anything, and was
2196 resulting in weird bugs in the nightly builds.
2200 (JSC::ExpressionNode::isNumber):
2201 (JSC::ExpressionNode::isString):
2202 (JSC::ExpressionNode::isNull):
2203 (JSC::ExpressionNode::isPure):
2204 (JSC::ExpressionNode::isLocation):
2205 (JSC::ExpressionNode::isResolveNode):
2206 (JSC::ExpressionNode::isBracketAccessorNode):
2207 (JSC::ExpressionNode::isDotAccessorNode):
2208 (JSC::ExpressionNode::isFuncExprNode):
2209 (JSC::ExpressionNode::isSimpleArray):
2210 (JSC::ExpressionNode::isAdd):
2211 (JSC::ExpressionNode::resultDescriptor):
2212 (JSC::StatementNode::firstLine):
2213 (JSC::StatementNode::lastLine):
2214 (JSC::StatementNode::isEmptyStatement):
2215 (JSC::StatementNode::isReturnNode):
2216 (JSC::StatementNode::isExprStatement):
2217 (JSC::StatementNode::isBlock):
2218 (JSC::NullNode::isNull):
2219 (JSC::BooleanNode::isPure):
2220 (JSC::NumberNode::value):
2221 (JSC::NumberNode::setValue):
2222 (JSC::NumberNode::isNumber):
2223 (JSC::NumberNode::isPure):
2224 (JSC::StringNode::isPure):
2225 (JSC::StringNode::isString):
2226 (JSC::ResolveNode::identifier):
2227 (JSC::ResolveNode::isLocation):
2228 (JSC::ResolveNode::isResolveNode):
2229 (JSC::BracketAccessorNode::isLocation):
2230 (JSC::BracketAccessorNode::isBracketAccessorNode):
2231 (JSC::DotAccessorNode::base):
2232 (JSC::DotAccessorNode::identifier):
2233 (JSC::DotAccessorNode::isLocation):
2234 (JSC::DotAccessorNode::isDotAccessorNode):
2235 (JSC::TypeOfResolveNode::identifier):
2236 (JSC::AddNode::isAdd):
2237 (JSC::BlockNode::isBlock):
2238 (JSC::EmptyStatementNode::isEmptyStatement):
2239 (JSC::ExprStatementNode::isExprStatement):
2240 (JSC::ReturnNode::isReturnNode):
2241 (JSC::ScopeNode::sourceURL):
2242 (JSC::ProgramNode::bytecode):
2243 (JSC::EvalNode::bytecode):
2244 (JSC::FunctionBodyNode::parameters):
2245 (JSC::FunctionBodyNode::toSourceString):
2246 (JSC::FunctionBodyNode::bytecode):
2247 (JSC::FuncExprNode::isFuncExprNode):
2249 2009-05-19 Maciej Stachowiak <mjs@apple.com>
2251 Reviewed by Gavin Barraclough.
2253 - speed up string comparison, especially for short strings
2257 * JavaScriptCore.exp:
2258 * runtime/UString.cpp:
2259 * runtime/UString.h:
2260 (JSC::operator==): Inline UString's operator==, since it is called from
2261 hot places in the runtime. Also, specialize 2-char strings in a similar way to
2262 1-char, since we're taking the hit of a switch anyway.
2264 2009-05-18 Maciej Stachowiak <mjs@apple.com>
2266 Reviewed by Gavin Barraclough.
2268 - for polymorphic prototype lookups, increase the number of slots from 4 to 8
2270 ~4% faster on v8 raytrace benchmark
2272 * bytecode/Instruction.h:
2274 2009-05-18 Maciej Stachowiak <mjs@apple.com>
2276 Reviewed by Oliver Hunt.
2278 - tighten up the code for the load_varargs stub
2280 ~1-2% on v8-raytrace
2283 (JSC::JITStubs::cti_op_load_varargs): Hoist some loop invariants that
2284 the compiler didn't feel like hoisting for us. Remove unneeded exception check.
2286 2009-05-18 Maciej Stachowiak <mjs@apple.com>
2288 Reviewed by Geoff Garen.
2290 - Improve code generation for access to prototype properties
2292 ~0.4% speedup on SunSpider.
2294 Based on a suggestion from Geoff Garen.
2297 * jit/JITPropertyAccess.cpp:
2298 (JSC::JIT::compileGetDirectOffset):
2299 (JSC::JIT::privateCompileGetByIdProto):
2300 (JSC::JIT::privateCompileGetByIdProtoList):
2301 (JSC::JIT::privateCompileGetByIdChainList):
2302 (JSC::JIT::privateCompileGetByIdChain):
2304 2009-05-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
2306 Reviewed by Gavin Barraclough.
2308 Enable YARR, and disable WREC for GTK+.
2311 * yarr/RegexParser.h:
2313 2009-05-18 Jan Michael Alonzo <jmalonzo@webkit.org>
2315 Reviewed by Xan Lopez.
2317 [Gtk] Various autotools build refactoring and fixes
2318 https://bugs.webkit.org/show_bug.cgi?id=25286
2320 Add -no-install and -no-fast-install to programs and tests that we
2321 don't install. Also remove -O2 since this is already handled at
2326 2009-05-17 Jan Michael Alonzo <jmalonzo@webkit.org>
2328 Reviewed by Xan Lopez.
2330 [Gtk] Various autotools build refactoring and fixes
2331 https://bugs.webkit.org/show_bug.cgi?id=25286
2333 Add JavaScriptCore/ to JSC include path only since it's not
2334 required when building WebCore.
2338 2009-05-17 Steve Falkenburg <sfalken@apple.com>
2342 * JavaScriptCore.vcproj/JavaScriptCore.make:
2343 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2345 2009-05-15 Gavin Barraclough <barraclough@apple.com>
2347 Reviewed by Oliver Hunt.
2349 Looking like MSVC doesn't like static variables in inline methods?
2350 Make the state of the SSE2 check a static variable on the class
2351 MacroAssemblerX86Common as a speculative build fix for Windows.
2353 * assembler/MacroAssemblerX86Common.h:
2354 (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
2355 (JSC::MacroAssemblerX86Common::branchDouble):
2356 (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
2357 (JSC::MacroAssemblerX86Common::isSSE2Present):
2358 (JSC::MacroAssemblerX86Common::):
2361 2009-05-15 Adam Roben <aroben@apple.com>
2363 Add some assembler headers to JavaScriptCore.vcproj
2365 This is just a convenience for Windows developers.
2367 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2369 2009-05-15 Gavin Barraclough <barraclough@apple.com>
2371 Reviewed by Oliver Hunt.
2373 Add FP support to the MacroAssembler, port JITArithmetic over to make use of this. Also add
2374 API to determine whether FP support is available 'MacroAssembler::supportsFloatingPoint()',
2375 FP is presently only supported on SSE2 platforms, not x87. On platforms where a suitable
2376 hardware FPU is not available 'supportsFloatingPoint()' may simply return false, and all
2377 other methods ASSERT_NOT_REACHED().
2379 * assembler/AbstractMacroAssembler.h:
2380 * assembler/MacroAssemblerX86.h:
2381 (JSC::MacroAssemblerX86::MacroAssemblerX86):
2382 (JSC::MacroAssemblerX86::branch32):
2383 (JSC::MacroAssemblerX86::branchPtrWithPatch):
2384 (JSC::MacroAssemblerX86::supportsFloatingPoint):
2385 * assembler/MacroAssemblerX86Common.h:
2386 (JSC::MacroAssemblerX86Common::):
2387 (JSC::MacroAssemblerX86Common::loadDouble):
2388 (JSC::MacroAssemblerX86Common::storeDouble):
2389 (JSC::MacroAssemblerX86Common::addDouble):
2390 (JSC::MacroAssemblerX86Common::subDouble):
2391 (JSC::MacroAssemblerX86Common::mulDouble):
2392 (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
2393 (JSC::MacroAssemblerX86Common::branchDouble):
2394 (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
2395 (JSC::MacroAssemblerX86Common::branch32):
2396 (JSC::MacroAssemblerX86Common::branch16):
2397 (JSC::MacroAssemblerX86Common::branchTest32):
2398 (JSC::MacroAssemblerX86Common::branchAdd32):
2399 (JSC::MacroAssemblerX86Common::branchMul32):
2400 (JSC::MacroAssemblerX86Common::branchSub32):
2401 (JSC::MacroAssemblerX86Common::set32):
2402 (JSC::MacroAssemblerX86Common::setTest32):
2403 (JSC::MacroAssemblerX86Common::x86Condition):
2404 (JSC::MacroAssemblerX86Common::isSSE2Present):
2405 * assembler/MacroAssemblerX86_64.h:
2406 (JSC::MacroAssemblerX86_64::movePtrToDouble):
2407 (JSC::MacroAssemblerX86_64::moveDoubleToPtr):
2408 (JSC::MacroAssemblerX86_64::setPtr):
2409 (JSC::MacroAssemblerX86_64::branchPtr):
2410 (JSC::MacroAssemblerX86_64::branchTestPtr):
2411 (JSC::MacroAssemblerX86_64::branchAddPtr):
2412 (JSC::MacroAssemblerX86_64::branchSubPtr):
2413 (JSC::MacroAssemblerX86_64::supportsFloatingPoint):
2414 * assembler/X86Assembler.h:
2418 * jit/JITArithmetic.cpp:
2419 (JSC::JIT::emit_op_rshift):
2420 (JSC::JIT::emitSlow_op_rshift):
2421 (JSC::JIT::emitSlow_op_jnless):
2422 (JSC::JIT::emitSlow_op_jnlesseq):
2423 (JSC::JIT::compileBinaryArithOp):
2424 (JSC::JIT::compileBinaryArithOpSlowCase):
2425 (JSC::JIT::emit_op_add):
2426 (JSC::JIT::emitSlow_op_add):
2427 (JSC::JIT::emit_op_mul):
2428 (JSC::JIT::emitSlow_op_mul):
2429 * jit/JITPropertyAccess.cpp:
2430 (JSC::JIT::privateCompilePutByIdTransition):
2432 2009-05-15 Francisco Tolmasky <francisco@280north.com>
2434 BUG 25467: JavaScript debugger should use function.displayName as the function's name in the call stack
2435 <https://bugs.webkit.org/show_bug.cgi?id=25467>
2437 Reviewed by Adam Roben.
2439 * JavaScriptCore.exp: Added calculatedFunctionName
2440 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Added calculatedFunctionName
2441 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added calculatedFunctionName
2442 * debugger/DebuggerCallFrame.cpp: Added calculatedFunctionName to match existing one in ProfileNode.
2443 (JSC::DebuggerCallFrame::calculatedFunctionName):
2444 * debugger/DebuggerCallFrame.h: Added calculatedFunctionName to match existing one in ProfileNode.
2446 2009-05-14 Gavin Barraclough <barraclough@apple.com>
2448 Build fix, not reviewed.
2450 Quick fixes for JIT builds with OPTIMIZE flags disabled.
2453 (JSC::JIT::compileOpCall):
2454 (JSC::JIT::compileOpCallSlowCase):
2455 * jit/JITPropertyAccess.cpp:
2456 (JSC::JIT::compilePutByIdHotPath):
2458 2009-05-14 Steve Falkenburg <sfalken@apple.com>
2460 Back out incorrect Windows build fix
2462 * JavaScriptCore.vcproj/JavaScriptCore.make:
2463 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2465 2009-05-14 Steve Falkenburg <sfalken@apple.com>
2469 * JavaScriptCore.vcproj/JavaScriptCore.make:
2470 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2472 2009-05-14 Adam Roben <aroben@apple.com>
2474 Windows jsc build fix
2476 r43648 modified jsc.vcproj's post-build event not to try to copy files
2477 that aren't present. Then r43661 mistakenly un-did that modification.
2478 This patch restores the modification from r43648, but puts the code in
2479 jscCommon.vsprops (where it should have been added in r43648).
2481 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Restored empty
2482 VCPostBuildEventTool tags.
2483 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Modified the post-build
2484 event command line to match the one in jsc.vcproj from r43648.
2486 2009-05-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
2488 Reviewed by Darin Adler.
2490 https://bugs.webkit.org/show_bug.cgi?id=25325
2492 Make sure pthread_self() is declared before it gets called in Collector.cpp
2494 * runtime/Collector.cpp: Include pthread.h in most Unix-like platforms
2495 (not just for OPENBSD)
2497 2009-05-14 Mark Rowe <mrowe@apple.com>
2499 Reviewed by Oliver Hunt.
2501 Fix <https://bugs.webkit.org/show_bug.cgi?id=25785>.
2502 Bug 25785: Segfault in mark when using JSObjectMakeConstructor
2504 * API/JSObjectRef.cpp:
2505 (JSObjectMakeConstructor): OpaqueJSClass::prototype can return 0. We need to use the default object prototype when it does.
2506 * API/tests/testapi.c:
2507 (main): Add a test case.
2508 * runtime/JSObject.h:
2509 (JSC::JSObject::putDirect): Add a clearer assertion for a null value. The assertion on the next line does catch this,
2510 but the cause of the failure is not clear from the assertion itself.
2512 2009-05-14 Mark Rowe <mrowe@apple.com>
2514 Rubber-stamped by Darin Adler.
2516 <rdar://problem/6681868> When building with Xcode 3.1.3 should be using gcc 4.2
2518 The meaning of XCODE_VERSION_ACTUAL is more sensible in newer versions of Xcode.
2519 Update our logic to select the compiler version to use the more appropriate XCODE_VERSION_MINOR
2520 if the version of Xcode supports it, and fall back to XCODE_VERSION_ACTUAL if not.
2522 * Configurations/Base.xcconfig:
2524 2009-05-14 Gavin Barraclough <barraclough@apple.com>
2526 Reviewed by Geoff Garen.
2528 Checking register file bounds should be a ptr comparison (m_end is a Register*).
2529 Also, the compare should be unsigned, pointers don'ts go negative.
2532 (JSC::JIT::privateCompile):
2534 2009-05-13 Gavin Barraclough <barraclough@apple.com>
2536 Reviewed by Oliver Hunt.
2538 Fix <rdar://problem/6882919> REGRESSION: page at Metroauto site crashes in cti_op_loop_if_less (25730)
2540 op_loop_if_less (imm < op) was loading op into regT1, but in the slow path spills regT0.
2541 This leads to bad happen.
2543 * jit/JITOpcodes.cpp:
2544 (JSC::JIT::emit_op_loop_if_less):
2545 (JSC::JIT::emitSlow_op_loop_if_less):
2547 2009-05-13 Dmitry Titov <dimich@chromium.org>
2549 Rubber-stamped by Mark Rowe.
2551 https://bugs.webkit.org/show_bug.cgi?id=25746
2552 Revert http://trac.webkit.org/changeset/43507 which caused crash in PPC nightlies with Safari 4.
2554 * JavaScriptCore.exp:
2555 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2556 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2557 * bytecode/SamplingTool.cpp:
2558 (JSC::SamplingThread::start):
2559 (JSC::SamplingThread::stop):
2560 * bytecode/SamplingTool.h:
2561 * wtf/CrossThreadRefCounted.h:
2562 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
2566 * wtf/ThreadingNone.cpp:
2567 * wtf/ThreadingPthreads.cpp:
2568 (WTF::threadMapMutex):
2569 (WTF::initializeThreading):
2571 (WTF::identifierByPthreadHandle):
2572 (WTF::establishIdentifierForPthreadHandle):
2573 (WTF::pthreadHandleForIdentifier):
2574 (WTF::clearPthreadHandleForIdentifier):
2575 (WTF::createThreadInternal):
2576 (WTF::waitForThreadCompletion):
2577 (WTF::detachThread):
2578 (WTF::currentThread):
2579 * wtf/ThreadingWin.cpp:
2580 (WTF::threadMapMutex):
2581 (WTF::initializeThreading):
2583 (WTF::storeThreadHandleByIdentifier):
2584 (WTF::threadHandleForIdentifier):
2585 (WTF::clearThreadHandleForIdentifier):
2586 (WTF::createThreadInternal):
2587 (WTF::waitForThreadCompletion):
2588 (WTF::detachThread):
2589 (WTF::currentThread):
2590 * wtf/gtk/ThreadingGtk.cpp:
2591 (WTF::threadMapMutex):
2592 (WTF::initializeThreading):
2594 (WTF::identifierByGthreadHandle):
2595 (WTF::establishIdentifierForThread):
2596 (WTF::threadForIdentifier):
2597 (WTF::clearThreadForIdentifier):
2598 (WTF::createThreadInternal):
2599 (WTF::waitForThreadCompletion):
2600 (WTF::currentThread):
2601 * wtf/qt/ThreadingQt.cpp:
2602 (WTF::threadMapMutex):
2604 (WTF::identifierByQthreadHandle):
2605 (WTF::establishIdentifierForThread):
2606 (WTF::clearThreadForIdentifier):
2607 (WTF::threadForIdentifier):
2608 (WTF::initializeThreading):
2609 (WTF::createThreadInternal):
2610 (WTF::waitForThreadCompletion):
2611 (WTF::currentThread):
2613 2009-05-13 Darin Adler <darin@apple.com>
2615 Revert the parser arena change. It was a slowdown, not a speedup.
2616 Better luck next time (I'll break it up into pieces).
2618 2009-05-13 Darin Adler <darin@apple.com>
2622 * parser/Grammar.y: Add back empty code blocks, needed by older
2623 versions of bison on certain rules.
2625 2009-05-13 Steve Falkenburg <sfalken@apple.com>
2629 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2631 2009-05-13 Adam Roben <aroben@apple.com>
2633 Windows build fixes after r43642
2635 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2636 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2639 * debugger/Debugger.cpp:
2640 * runtime/ArrayConstructor.cpp:
2641 * runtime/JSArray.cpp:
2642 * runtime/RegExp.cpp:
2643 * runtime/RegExpConstructor.cpp:
2644 * runtime/RegExpPrototype.cpp:
2645 * runtime/StringPrototype.cpp:
2646 Added missing #includes.
2648 2009-05-13 Darin Adler <darin@apple.com>
2650 Reviewed by Cameron Zwarich.
2652 Bug 25674: syntax tree nodes should use arena allocation
2653 https://bugs.webkit.org/show_bug.cgi?id=25674
2655 Step 3: Add some actual arena allocation. About 1% SunSpider speedup.
2657 * JavaScriptCore.exp: Updated.
2659 * bytecompiler/BytecodeGenerator.cpp:
2660 (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
2661 contains const Identifier* now.
2662 (JSC::BytecodeGenerator::emitPushNewScope): Updated to take a const
2664 * bytecompiler/BytecodeGenerator.h: Ditto
2666 * bytecompiler/SegmentedVector.h: Added isEmpty.
2668 * debugger/Debugger.cpp:
2669 (JSC::Debugger::recompileAllJSFunctions): Moved this function here from
2670 WebCore so WebCore doesn't need the details of FunctionBodyNode.
2671 * debugger/Debugger.h: Ditto.
2673 * interpreter/Interpreter.cpp:
2674 (JSC::Interpreter::execute): Updated since VarStack contains const
2678 (JSC::JITStubs::cti_vm_lazyLinkCall): Call isHostFunction on the body
2679 rather than on the function object, since we can't easily have inlined
2680 access to the FunctionBodyNode in JSFunction.h since WebCore needs
2681 access to that header.
2682 (JSC::JITStubs::cti_op_construct_JSConstruct): Ditto.
2683 * profiler/Profiler.cpp:
2684 (JSC::Profiler::createCallIdentifier): Ditto.
2686 * parser/Grammar.y: Use JSGlobalData* to pass the global data pointer
2687 around whenever possible instead of using void*. Changed
2688 SET_EXCEPTION_LOCATION from a macro to an inline function. Marked
2689 the structure-creating functions inline. Changed the VarStack to use
2690 identifier pointers instead of actual identifiers. This takes
2691 advantage of the fact that all identifier pointers come from the
2692 arena and avoids reference count churn. Changed Identifier* to
2693 const Identifier* to make sure we don't modify any by accident.
2694 Used identifiers for regular expression strings too, using the new
2695 scanRegExp that has out parameters instead of the old one that relied
2696 on side effects in the Lexer. Move the creation of numeric identifiers
2697 out of this file and into the PropertyNode constructor.
2700 (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
2701 (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
2702 and changed to call ParserArena.
2703 (JSC::Lexer::scanRegExp): Added out arguments that are const Identifier*
2704 as well as a prefix character argument so we can handle the /= case
2705 without a string append.
2706 (JSC::Lexer::skipRegExp): Added. Skips a regular expression without
2707 allocating Identifier objects.
2708 (JSC::Lexer::clear): Removed the code to manage m_identifiers, m_pattern,
2709 and m_flags, and added code to set m_arena to 0.
2710 * parser/Lexer.h: Updated for changes above.
2712 * parser/NodeConstructors.h:
2713 (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
2715 (JSC::ParserArenaDeletable::operator new): Changed to call the
2716 allocateDeletable function on the arena instead of deleteWithArena.
2717 (JSC::RegExpNode::RegExpNode): Changed arguments to Identifier instead
2718 of UString since these come from the parser which makes identifiers.
2719 (JSC::PropertyNode::PropertyNode): Added new constructor that makes
2720 numeric identifiers. Some day we might want to optimize this for
2721 integers so it doesn't create a string for each one.
2722 (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
2723 since it's now a const Identifier& so it can't be left uninitialized.
2724 (JSC::BreakNode::BreakNode): Ditto.
2725 (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
2726 to keep track of the statements rather than a separate statement vector.
2727 (JSC::BlockNode::BlockNode): Ditto.
2728 (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
2730 * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
2731 It seemed strangely out of place in the header.
2732 (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
2733 UString as well as Identifier.
2734 (JSC::SourceElements::singleStatement): Added.
2735 (JSC::SourceElements::lastStatement): Added.
2736 (JSC::RegExpNode::emitBytecode): Updated since the pattern and flags
2737 are now Identifier instead of UString. Also changed the throwError code
2738 to use the substitution mechanism instead of doing a string append.
2739 (JSC::SourceElements::emitBytecode): Added. Replaces the old
2740 statementListEmitCode function, since we now keep the SourceElements
2742 (JSC::BlockNode::lastStatement): Added.
2743 (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
2744 statementListEmitCode.
2745 (JSC::CaseClauseNode::emitBytecode): Added.
2746 (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
2747 instead of statementListEmitCode.
2748 (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
2749 SourceElements* instead of using releaseContentsIntoVector.
2750 (JSC::ScopeNode::emitStatementsBytecode): Added.
2751 (JSC::ScopeNode::singleStatement): Added.
2752 (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
2753 of statementListEmitCode.
2754 (JSC::EvalNode::emitBytecode): Ditto.
2755 (JSC::EvalNode::generateBytecode): Removed code to clear the children
2756 vector. This optimization is no longer possible since everything is in
2758 (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
2759 insetad of statementListEmitCode and check for the return node using
2762 * parser/Nodes.h: Changed VarStack to store const Identifier* instead
2763 of Identifier and rely on the arena to control lifetime. Added a new
2764 ParserArenaFreeable class. Made ParserArenaDeletable inherit from
2765 FastAllocBase instead of having its own operator new. Base the Node
2766 class on ParserArenaFreeable. Changed the various Node classes
2767 to use const Identifier& instead of Identifier to avoid the need to
2768 call their destructors and allow them to function as "freeable" in the
2769 arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
2770 Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
2771 CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
2772 as a base class since they do not descend from Node. Eliminated the
2773 StatementVector type and instead have various classes use SourceElements*
2774 instead of StatementVector. This prevents those classes from having th
2775 use ParserArenaDeletable to make sure the vector destructor is called.
2777 * parser/Parser.cpp:
2778 (JSC::Parser::parse): Pass the arena to the lexer.
2780 * parser/Parser.h: Added an include of ParserArena.h, which is no longer
2781 included by Nodes.h.
2783 * parser/ParserArena.cpp:
2784 (JSC::ParserArena::ParserArena): Added. Initializes the new members,
2785 m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
2786 (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
2787 since we store only the current pointer and the end of pool pointer.
2788 (JSC::ParserArena::deallocateObjects): Added. Contains the common
2789 memory-deallocation logic used by both the destructor and the
2791 (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
2792 (JSC::ParserArena::reset): Ditto. Also added code to zero out the
2793 new structures, and switched to use clear() instead of shrink(0) since
2794 we don't really reuse arenas.
2795 (JSC::ParserArena::makeNumericIdentifier): Added.
2796 (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
2798 (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
2799 since this is used only for assertions at the moment.
2801 * parser/ParserArena.h: Added an actual arena of "freeable" objects,
2802 ones that don't need destructors to be called. Also added the segmented
2803 vector of identifiers that used to be in the Lexer.
2805 * runtime/FunctionConstructor.cpp:
2806 (JSC::extractFunctionBody): Use singleStatement function rather than
2807 getting at a StatementVector.
2809 * runtime/FunctionPrototype.cpp:
2810 (JSC::functionProtoFuncToString): Call isHostFunction on the body
2811 rather than the function object.
2813 * runtime/JSFunction.cpp:
2814 (JSC::JSFunction::JSFunction): Moved the structure version of this in
2815 here from the header. It's not hot enough that it needs to be inlined.
2816 (JSC::JSFunction::isHostFunction): Moved this in here from the header.
2817 It's now a helper to be used only within the class.
2818 (JSC::JSFunction::setBody): Moved this in here. It's not hot enough that
2819 it needs to be inlined, and we want to be able to compile the header
2820 without the definition of FunctionBodyNode.
2822 * runtime/JSFunction.h: Eliminated the include of "Nodes.h". This was
2823 exposing too much JavaScriptCore dependency to WebCore. Because of this
2824 change and some changes made to WebCore, we could now export a lot fewer
2825 headers from JavaScriptCore, but I have not done that yet in this check-in.
2826 Made a couple functions non-inline. Removes some isHostFunction() assertions.
2828 * wtf/FastAllocBase.h: Added the conventional using statements we use in
2829 WTF so we can use identifiers from the WTF namespace without explicit
2830 namespace qualification or namespace directive. This is the usual WTF style,
2831 although it's unconventional in the C++ world. We use the namespace primarily
2832 for link-time disambiguation, not compile-time.
2834 * wtf/FastMalloc.cpp: Fixed an incorrect comment.
2836 2009-05-13 Xan Lopez <xlopez@igalia.com>
2838 Unreviewed build fix: add JITStubCall.h to files list.
2842 2009-05-13 Ariya Hidayat <ariya.hidayat@nokia.com>
2844 Unreviewed build fix, as suggested by Yael Aharon <yael.aharon@nokia.com>.
2846 * wtf/qt/ThreadingQt.cpp:
2847 (WTF::waitForThreadCompletion): renamed IsValid to isValid.
2849 2009-05-13 Jan Michael Alonzo <jmalonzo@webkit.org>
2851 Revert r43562 - [Gtk] WTF_USE_JSC is already defined in
2856 2009-05-12 Gavin Barraclough <barraclough@apple.com>
2858 Reviewed by Oliver Hunt.
2860 Add SamplingCounter tool to provide a simple mechanism for counting events in JSC
2861 (enabled using ENABLE(SAMPLING_COUNTERS)). To count events within a single function
2862 use the class 'SamplingCounter', where the counter may be incremented from multiple
2863 functions 'GlobalSamplingCounter' may be convenient; all other counters (stack or
2864 heap allocated, rather than statically declared) should use the DeletableSamplingCounter.
2865 Further description of these classes is provided alongside their definition in
2868 Counters may be incremented from c++ by calling the 'count()' method on the counter,
2869 or may be incremented by JIT code by using the 'emitCount()' method within the JIT.
2871 This patch also fixes CODEBLOCK_SAMPLING, which was missing a null pointer check.
2873 * JavaScriptCore.exp:
2874 * assembler/MacroAssemblerX86.h:
2875 (JSC::MacroAssemblerX86::addWithCarry32):
2876 (JSC::MacroAssemblerX86::and32):
2877 (JSC::MacroAssemblerX86::or32):
2878 * assembler/MacroAssemblerX86Common.h:
2879 (JSC::MacroAssemblerX86Common::and32):
2880 (JSC::MacroAssemblerX86Common::or32):
2881 * assembler/MacroAssemblerX86_64.h:
2882 (JSC::MacroAssemblerX86_64::and32):
2883 (JSC::MacroAssemblerX86_64::or32):
2884 (JSC::MacroAssemblerX86_64::addPtr):
2885 * assembler/X86Assembler.h:
2886 (JSC::X86Assembler::):
2887 (JSC::X86Assembler::adcl_im):
2888 (JSC::X86Assembler::addq_im):
2889 (JSC::X86Assembler::andl_im):
2890 (JSC::X86Assembler::orl_im):
2891 * bytecode/SamplingTool.cpp:
2892 (JSC::AbstractSamplingCounter::dump):
2893 * bytecode/SamplingTool.h:
2894 (JSC::AbstractSamplingCounter::count):
2895 (JSC::GlobalSamplingCounter::name):
2896 (JSC::SamplingCounter::SamplingCounter):
2900 * jit/JITInlineMethods.h:
2901 (JSC::JIT::setSamplingFlag):
2902 (JSC::JIT::clearSamplingFlag):
2903 (JSC::JIT::emitCount):
2907 (JSC::ScopeNode::ScopeNode):
2910 2009-05-13 Steve Falkenburg <sfalken@apple.com>
2914 * JavaScriptCore.vcproj/JavaScriptCore.make:
2916 2009-05-12 Steve Falkenburg <sfalken@apple.com>
2920 * JavaScriptCore.vcproj/JavaScriptCore.make:
2922 2009-05-12 Oliver Hunt <oliver@apple.com>
2924 Reviewed by Gavin Barraclough.
2926 <rdar://problem/6881457> Crash occurs at JSC::Interpreter::execute() when loading http://www.sears.com
2928 We created the arguments objects before an op_push_scope but not
2929 before op_push_new_scope, this meant a null arguments object could
2930 be resolved inside catch blocks.
2932 * bytecompiler/BytecodeGenerator.cpp:
2933 (JSC::BytecodeGenerator::emitPushNewScope):
2935 2009-05-12 Oliver Hunt <oliver@apple.com>
2937 Reviewed by Gavin Barraclough.
2939 <rdar://problem/6879881> Crash occurs at JSC::JSActivation::mark() when loading http://www.monster.com; http://www.cnet.com
2940 <https://bugs.webkit.org/show_bug.cgi?id=25736> Crash loading www.google.dk/ig (and other igoogle's as well)
2942 Following on from the lazy arguments creation patch, it's now
2943 possible for an activation to to have a null register in the callframe
2944 so we can't just blindly mark the local registers in an activation,
2945 and must null check first instead.
2947 * API/tests/testapi.c:
2949 * API/tests/testapi.js:
2950 (bludgeonArguments.return.g):
2951 (bludgeonArguments):
2952 * runtime/JSActivation.cpp:
2953 (JSC::JSActivation::mark):
2955 2009-05-12 Gavin Barraclough <barraclough@apple.com>
2957 Rubber stamped by Geoff Garen.
2959 WTF_USE_CTI_REPATCH_PIC is no longer used, remove.
2962 * jit/JITStubCall.h:
2964 2009-05-12 Gavin Barraclough <barraclough@apple.com>
2966 Reviewed by Maciej Stachowiak.
2968 We've run into some problems where changing the size of the class JIT leads to
2969 performance fluctuations. Try forcing alignment in an attempt to stabalize this.
2973 2009-05-12 Kevin Ollivier <kevino@theolliviers.com>
2975 wx build fix. Add ParserArena.cpp to the build.
2977 * JavaScriptCoreSources.bkl:
2979 2009-05-12 Oliver Hunt <oliver@apple.com>
2981 Reviewed by Geoff Garen.
2983 Unsigned underflow on 64bit cannot be treated as a negative number
2985 This code included some placeswhere we deliberately create negative offsets
2986 from unsigned values, on 32bit this is "safe", but in 64bit builds much
2987 badness occurs. Solution is to use signed types as nature intended.
2990 (JSC::JITStubs::cti_op_load_varargs):
2992 2009-05-12 Jan Michael Alonzo <jmalonzo@webkit.org>
2994 Reviewed by Holger Freyther.
2996 [Gtk] Various autotools build refactoring and fixes
2997 https://bugs.webkit.org/show_bug.cgi?id=25286
2999 Define WTF_USE_JSC for the Gtk port.
3003 2009-05-12 Maciej Stachowiak <mjs@apple.com>
3005 Reviewed by Oliver Hunt.
3007 - allow all of strictEqual to be inlined into cti_op_stricteq once again
3009 We had this optimization once but accidentally lost it at some point.
3011 * runtime/Operations.h:
3012 (JSC::JSValue::strictEqualSlowCaseInline):
3013 (JSC::JSValue::strictEqual):
3015 2009-05-12 Gavin Barraclough <barraclough@apple.com>
3017 Reviewed by Oliver Hunt.
3019 instanceof should throw if the constructor being tested does not implement
3020 'HasInstance" (i.e. is a function). Instead we were returning false.
3022 * interpreter/Interpreter.cpp:
3023 (JSC::isInvalidParamForIn):
3024 (JSC::isInvalidParamForInstanceOf):
3025 (JSC::Interpreter::privateExecute):
3027 (JSC::JITStubs::cti_op_instanceof):
3028 * tests/mozilla/ecma_2/instanceof/instanceof-003.js:
3029 Fix broken test case.
3030 * tests/mozilla/ecma_2/instanceof/regress-7635.js:
3031 Remove broken test case (was an exact duplicate of a test in instanceof-003.js).
3033 2009-05-12 Oliver Hunt <oliver@apple.com>
3035 Reviewed by Gavin Barraclough.
3037 Improve function call forwarding performance
3039 Make creation of the Arguments object occur lazily, so it
3040 is not necessarily created for every function that references
3041 it. Then add logic to Function.apply to allow it to avoid
3042 allocating the Arguments object at all. Helps a lot with
3043 the function forwarding/binding logic in jQuery, Prototype,
3044 and numerous other JS libraries.
3046 * bytecode/CodeBlock.cpp:
3047 (JSC::CodeBlock::dump):
3048 * bytecode/Opcode.h:
3049 * bytecompiler/BytecodeGenerator.cpp:
3050 (JSC::BytecodeGenerator::BytecodeGenerator):
3051 (JSC::BytecodeGenerator::registerFor):
3052 (JSC::BytecodeGenerator::willResolveToArguments):
3053 (JSC::BytecodeGenerator::uncheckedRegisterForArguments):
3054 (JSC::BytecodeGenerator::createArgumentsIfNecessary):
3055 (JSC::BytecodeGenerator::emitCallEval):
3056 (JSC::BytecodeGenerator::emitPushScope):
3057 * bytecompiler/BytecodeGenerator.h:
3058 * interpreter/Interpreter.cpp:
3059 (JSC::Interpreter::privateExecute):
3060 (JSC::Interpreter::retrieveArguments):
3062 (JSC::JIT::privateCompileMainPass):
3064 * jit/JITOpcodes.cpp:
3065 (JSC::JIT::emit_op_create_arguments):
3066 (JSC::JIT::emit_op_init_arguments):
3068 (JSC::JITStubs::cti_op_tear_off_arguments):
3069 (JSC::JITStubs::cti_op_load_varargs):
3071 (JSC::ApplyFunctionCallDotNode::emitBytecode):
3073 2009-05-11 Gavin Barraclough <barraclough@apple.com>
3075 Reviewed by Oliver Hunt.
3077 Enable use of SamplingFlags directly from JIT code.
3079 * bytecode/SamplingTool.h:
3081 (JSC::JIT::sampleCodeBlock):
3082 (JSC::JIT::sampleInstruction):
3083 * jit/JITInlineMethods.h:
3084 (JSC::JIT::setSamplingFlag):
3085 (JSC::JIT::clearSamplingFlag):
3087 2009-05-11 Gavin Barraclough <barraclough@apple.com>
3089 Reviewed by Cameron Zwarich.
3091 Implement JIT generation for instanceof for non-objects (always returns false).
3092 Also fixes the sequencing of the prototype and value isObject checks, to no match the spec.
3094 0.5% progression on v8 tests overall, due to 3.5% on early-boyer.
3097 (JSC::JIT::privateCompileMainPass):
3098 (JSC::JIT::privateCompileSlowCases):
3099 * runtime/JSObject.cpp:
3100 (JSC::JSObject::hasInstance):
3101 * runtime/TypeInfo.h:
3102 (JSC::TypeInfo::TypeInfo):
3104 2009-05-11 Geoffrey Garen <ggaren@apple.com>
3106 Reviewed by Sam Weinig.
3108 A little more JIT refactoring.
3110 Rearranged code to more clearly indicate what's conditionally compiled
3111 and why. Now, all shared code is at the top of our JIT files, and all
3112 #if'd code is at the bottom. #if'd code is delineated by large comments.
3114 Moved functions that relate to the JIT but don't explicitly do codegen
3115 into JIT.cpp. Refactored SSE2 check to store its result as a data member
3119 (JSC::isSSE2Present):
3121 (JSC::JIT::unlinkCall):
3122 (JSC::JIT::linkCall):
3124 (JSC::JIT::isSSE2Present):
3125 * jit/JITArithmetic.cpp:
3126 (JSC::JIT::emit_op_mod):
3127 (JSC::JIT::emitSlow_op_mod):
3129 (JSC::JIT::compileOpCallVarargs):
3130 (JSC::JIT::compileOpCallVarargsSlowCase):
3132 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
3136 * JavaScriptCore.pri: Build the new JITOpcodes.cpp
3138 2009-05-11 Sam Weinig <sam@webkit.org>
3140 Reviewed by Geoffrey Garen.
3142 More re-factoring of JIT code generation. Use a macro to
3143 forward the main switch-statement cases to the helper functions.
3146 (JSC::JIT::privateCompileMainPass):
3147 (JSC::JIT::privateCompileSlowCases):
3149 2009-05-11 Sam Weinig <sam@webkit.org>
3151 Reviewed by Geoffrey Garen.
3153 More re-factoring of JIT code generation to move opcode generation
3154 to helper functions outside the main switch-statement and gave those
3155 helper functions standardized names. This patch covers the remaining
3160 * jit/JITOpcodes.cpp:
3162 2009-05-11 Geoffrey Garen <ggaren@apple.com>
3166 * GNUmakefile.am: Added JITOpcodes.cpp and JITStubCall.h to the project.
3168 2009-05-11 Geoffrey Garen <ggaren@apple.com>
3172 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
3173 JITOpcodes.cpp and JITStubCall.h to the project.
3175 2009-05-11 Geoffrey Garen <ggaren@apple.com>
3177 Reviewed by Sam Weinig.
3179 Some JIT refactoring.
3181 Moved JITStubCall* into its own header.
3183 Modified JITStubCall to ASSERT that its return value is handled correctly.
3184 Also, replaced function template with explicit instantiations to resolve
3187 Replaced all uses of emit{Get,Put}CTIArgument with explicit peeks, pokes,
3188 and calls to killLastResultRegister().
3190 * JavaScriptCore.xcodeproj/project.pbxproj:
3192 (JSC::JIT::privateCompileMainPass):
3193 (JSC::JIT::privateCompile):
3195 * jit/JITArithmetic.cpp:
3197 * jit/JITInlineMethods.h:
3198 (JSC::JIT::restoreArgumentReference):
3199 * jit/JITPropertyAccess.cpp:
3200 * jit/JITStubCall.h: Copied from jit/JIT.h.
3201 (JSC::JITStubCall::JITStubCall):
3202 (JSC::JITStubCall::addArgument):
3203 (JSC::JITStubCall::call):
3204 (JSC::JITStubCall::):
3206 2009-05-11 Sam Weinig <sam@webkit.org>
3208 Reviewed by Geoffrey Garen.
3210 Start re-factoring JIT code generation to move opcode generation
3211 to helper functions outside the main switch-statement and gave those
3212 helper functions standardized names. This patch only covers the main
3213 pass and all the arithmetic opcodes in the slow path.
3215 * JavaScriptCore.xcodeproj/project.pbxproj:
3217 (JSC::JIT::privateCompileMainPass):
3218 (JSC::JIT::privateCompileSlowCases):
3220 * jit/JITArithmetic.cpp:
3221 * jit/JITOpcodes.cpp: Copied from jit/JIT.cpp.
3222 * jit/JITPropertyAccess.cpp:
3224 2009-05-11 Steve Falkenburg <sfalken@apple.com>
3226 Re-add experimental PGO configs.
3228 Reviewed by Adam Roben.
3230 * JavaScriptCore.vcproj/JavaScriptCore.make:
3231 * JavaScriptCore.vcproj/JavaScriptCore.sln:
3232 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3233 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
3234 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
3236 2009-05-11 Sam Weinig <sam@webkit.org>
3238 Reviewed by Geoffrey "1" Garen.
3240 Rip out the !USE(CTI_REPATCH_PIC) code. It was untested and unused.
3243 (JSC::JIT::compileGetByIdChainList):
3244 (JSC::JIT::compileGetByIdChain):
3245 (JSC::JIT::compileCTIMachineTrampolines):
3246 * jit/JITPropertyAccess.cpp:
3247 (JSC::JIT::privateCompileGetByIdProto):
3248 (JSC::JIT::privateCompileGetByIdChainList):
3249 (JSC::JIT::privateCompileGetByIdChain):
3251 (JSC::JITStubs::tryCachePutByID):
3252 (JSC::JITStubs::tryCacheGetByID):
3254 2009-05-11 Dmitry Titov <dimich@chromium.org>
3256 GTK build fix - the deprecated waitForThreadCompletion is not needed on GTK.
3258 * wtf/ThreadingPthreads.cpp: used #ifdef PLATFORM(DARWIN) around waitForThreadCompletion().
3260 2009-05-11 Adam Roben <aroben@apple.com>
3262 Build fix for newer versions of GCC
3264 * wtf/ThreadingPthreads.cpp: Added a declaration of
3265 waitForThreadCompletion before its definition to silence a warning.
3267 2009-05-11 Dmitry Titov <dimich@chromium.org>
3269 Reviewed by Alexey Proskuryakov and Adam Roben.
3271 https://bugs.webkit.org/show_bug.cgi?id=25348
3272 Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
3275 (WTF::ThreadIdentifier::ThreadIdentifier):
3276 (WTF::ThreadIdentifier::isValid):
3277 (WTF::ThreadIdentifier::invalidate):
3278 (WTF::ThreadIdentifier::platformId):
3279 ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
3280 methods that are used across the code on thread ids: construction, comparisons,
3281 check for 'valid' state etc. '0' is used as invalid id, which happens to just work
3282 with all platform-specific thread id implementations.
3284 All the following files repeatedly reflect the new ThreadIdentifier for each platform.
3285 We remove ThreadMap and threadMapMutex from all of them, remove the functions that
3286 populated/searched/cleared the map and add platform-specific comparison operators
3287 for ThreadIdentifier.
3289 There are specific temporary workarounds for Safari 4 beta on OSX and Win32 since the
3290 public build uses WTF threading functions with old type of ThreadingIdentifier.
3291 The next time Safari 4 is rebuilt, it will 'automatically' pick up the new type and new
3292 functions so the deprecated ones can be removed.
3294 * wtf/gtk/ThreadingGtk.cpp:
3295 (WTF::ThreadIdentifier::operator==):
3296 (WTF::ThreadIdentifier::operator!=):
3297 (WTF::initializeThreading):
3298 (WTF::createThreadInternal):
3299 (WTF::waitForThreadCompletion):
3300 (WTF::currentThread):
3302 * wtf/ThreadingNone.cpp:
3303 (WTF::ThreadIdentifier::operator==):
3304 (WTF::ThreadIdentifier::operator!=):
3306 * wtf/ThreadingPthreads.cpp:
3307 (WTF::ThreadIdentifier::operator==):
3308 (WTF::ThreadIdentifier::operator!=):
3309 (WTF::initializeThreading):
3310 (WTF::createThreadInternal):
3311 (WTF::waitForThreadCompletion):
3312 (WTF::detachThread):
3313 (WTF::currentThread):
3314 (WTF::waitForThreadCompletion): This is a workaround for Safari 4 beta on Mac.
3315 Safari 4 is linked against old definition of ThreadIdentifier so it treats it as uint32_t.
3316 This 'old' variant of waitForThreadCompletion takes uint32_t and has the old decorated name, so Safari can
3317 load it from JavaScriptCore library. The other functions (CurrentThread() etc) happen to match their previous
3318 decorated names and, while they return pthread_t now, it is a pointer which round-trips through a uint32_t.
3319 This function will be removed as soon as Safari 4 will release next public build.
3321 * wtf/qt/ThreadingQt.cpp:
3322 (WTF::ThreadIdentifier::operator==):
3323 (WTF::ThreadIdentifier::operator!=):
3324 (WTF::initializeThreading):
3325 (WTF::createThreadInternal):
3326 (WTF::waitForThreadCompletion):
3327 (WTF::currentThread):
3329 * wtf/ThreadingWin.cpp:
3330 (WTF::ThreadIdentifier::operator==):
3331 (WTF::ThreadIdentifier::operator!=):
3332 (WTF::initializeThreading):
3333 (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
3334 counter as a thread ID and mapped it into platform ID. Windows was using native thread
3335 id and mapped it into thread handle. Since we can always obtain a thread handle
3336 by thread id, createThread now closes the handle.
3337 (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
3338 it means the thread already exited.
3339 (WTF::detachThread):
3340 (WTF::currentThread):
3341 (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
3342 (WTF::waitForThreadCompletionDeprecated): same.
3343 (WTF::currentThreadDeprecated): same.
3344 (WTF::createThreadDeprecated): same.
3346 * bytecode/SamplingTool.h:
3347 * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
3349 * JavaScriptCore.exp: export lists - updated decorated names of the WTF threading functions
3350 since they now take a different type as a parameter.
3351 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
3352 that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
3353 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
3355 2009-05-11 Darin Adler <darin@apple.com>
3357 Reviewed by Oliver Hunt.
3359 Bug 25560: REGRESSION (r34821): "string value".__proto__ gets the wrong object.
3360 https://bugs.webkit.org/show_bug.cgi?id=25560
3361 rdar://problem/6861069
3363 I missed this case back a year ago when I sped up handling
3364 of JavaScript wrappers. Easy to fix.
3366 * runtime/JSObject.h:
3367 (JSC::JSValue::get): Return the prototype itself if the property name
3369 * runtime/JSString.cpp:
3370 (JSC::JSString::getOwnPropertySlot): Ditto.
3372 2009-05-09 Oliver Hunt <oliver@apple.com>
3374 Reviewed by Maciej Stachowiak.
3376 Rename emitGetFromCallFrameHeader to emitGetFromCallFrameHeaderPtr
3379 (JSC::JIT::privateCompileMainPass):
3380 (JSC::JIT::privateCompileCTIMachineTrampolines):
3382 * jit/JITInlineMethods.h:
3383 (JSC::JIT::emitGetFromCallFrameHeaderPtr):
3384 (JSC::JIT::emitGetFromCallFrameHeader32):
3386 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
3388 Unreviewed build fix. Build ParserAreana.cpp for Qt
3390 * JavaScriptCore.pri:
3392 2009-05-11 Norbert Leser <norbert.leser@nokia.com>
3394 Reviewed by Darin Adler.
3396 https://bugs.webkit.org/show_bug.cgi?id=24536
3398 Symbian compilers cannot resolve WTF::PassRefPtr<JSC::Profile>
3399 unless Profile.h is included.
3401 * profiler/ProfileGenerator.h:
3403 2009-05-11 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
3405 Reviewed by Holger Freyther.
3407 https://bugs.webkit.org/show_bug.cgi?id=24284
3409 * JavaScriptCore.pri: coding style modified
3410 * jsc.pro: duplicated values removed from INCLUDEPATH, DEFINES
3412 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
3414 Reviewed by NOBODY (build fix).
3416 Also add ParserArena, in addition to AllInOne, for release builds,
3417 since adding it to AllInOne breaks Mac.
3421 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
3423 Unreviewed build fix. Adding ParserArena to the autotools build.
3427 2009-05-11 Adam Roben <aroben@apple.com>
3429 More Windows build fixes after r43479
3431 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3432 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3433 Export ParserArena::reset.
3435 2009-05-11 Adam Roben <aroben@apple.com>
3437 Windows build fixes after r43479
3439 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
3440 ParserArena to the project.
3442 * parser/NodeConstructors.h: Added a missing include.
3443 (JSC::ParserArenaDeletable::operator new): Marked these as inline.
3445 2009-05-10 Maciej Stachowiak <mjs@apple.com>
3447 Reviewed by Geoff Garen.
3449 - fixed REGRESSION(r43432): Many JavaScriptCore tests crash in 64-bit
3450 https://bugs.webkit.org/show_bug.cgi?id=25680
3452 Accound for the 64-bit instruction prefix when rewriting mov to lea on 64-bit.
3455 * jit/JITPropertyAccess.cpp:
3456 (JSC::JIT::patchGetByIdSelf):
3457 (JSC::JIT::patchPutByIdReplace):
3459 2009-05-10 Darin Adler <darin@apple.com>
3461 Reviewed by Cameron Zwarich.
3463 Bug 25674: syntax tree nodes should use arena allocation
3464 https://bugs.webkit.org/show_bug.cgi?id=25674
3466 Part two: Remove reference counting from most nodes.
3468 * JavaScriptCore.exp: Updated.
3470 * JavaScriptCore.xcodeproj/project.pbxproj: Added ParserArena.h and .cpp.
3472 * parser/Grammar.y: Replaced uses of ParserRefCountedData with uses of
3473 ParserArenaData. Took out now-nonfunctional code that tries to manually
3474 release declaration list. Changed the new calls that create FuncDeclNode
3475 and FuncExprNode so that they use the proper version of operator new for
3476 the reference-counted idiom, not the deletion idiom.
3478 * parser/NodeConstructors.h:
3479 (JSC::ParserArenaDeletable::operator new): Added.
3480 (JSC::ParserArenaRefCounted::ParserArenaRefCounted): Added.
3481 (JSC::Node::Node): Removed ParserRefCounted initializer.
3482 (JSC::ElementNode::ElementNode): Ditto.
3483 (JSC::PropertyNode::PropertyNode): Ditto.
3484 (JSC::ArgumentsNode::ArgumentsNode): Ditto.
3485 (JSC::SourceElements::SourceElements): Ditto.
3486 (JSC::ParameterNode::ParameterNode): Ditto.
3487 (JSC::FuncExprNode::FuncExprNode): Added ParserArenaRefCounted initializer.
3488 (JSC::FuncDeclNode::FuncDeclNode): Ditto.
3489 (JSC::CaseClauseNode::CaseClauseNode): Removed ParserRefCounted initializer.
3490 (JSC::ClauseListNode::ClauseListNode): Ditto.
3491 (JSC::CaseBlockNode::CaseBlockNode): Ditto.
3493 * parser/NodeInfo.h: Replaced uses of ParserRefCountedData with uses of
3497 (JSC::ScopeNode::ScopeNode): Added ParserArenaRefCounted initializer.
3498 (JSC::ProgramNode::create): Use the proper version of operator new for
3499 the reference-counted idiom, not the deletion idiom. Use the arena
3500 contains function instead of the vecctor find function.
3501 (JSC::EvalNode::create): Use the proper version of operator new for
3502 the reference-counted idiom, not the deletion idiom. Use the arena
3503 reset function instead of the vector shrink function.
3504 (JSC::FunctionBodyNode::createNativeThunk): Use the proper version
3505 of operator new for the reference-counted idiom, not the deletion idiom.
3506 (JSC::FunctionBodyNode::create): More of the same.
3508 * parser/Nodes.h: Added ParserArenaDeletable and ParserArenaRefCounted
3509 to replace ParserRefCounted. Fixed inheritance so only the classes that
3510 need reference counting inherit from ParserArenaRefCounted.
3512 * parser/Parser.cpp:
3513 (JSC::Parser::parse): Set m_sourceElements to 0 since it now starts
3514 uninitialized. Just set it to 0 again in the failure case, since it's
3515 now just a raw pointer, not an owning one.
3516 (JSC::Parser::reparseInPlace): Removed now-unneeded get() function.
3517 (JSC::Parser::didFinishParsing): Replaced uses of ParserRefCountedData
3518 with uses of ParserArenaData.
3520 * parser/Parser.h: Less RefPtr, more arena.
3522 * parser/ParserArena.cpp: Added.
3523 * parser/ParserArena.h: Added.
3525 * runtime/JSGlobalData.cpp:
3526 (JSC::JSGlobalData::~JSGlobalData): Removed arena-related code, since it's
3528 (JSC::JSGlobalData::createLeaked): Removed unneeded #ifndef.
3529 (JSC::JSGlobalData::createNativeThunk): Tweaked #if a bit.
3531 * runtime/JSGlobalData.h: Removed parserArena, which is now in Parser.
3533 * wtf/RefCounted.h: Added deletionHasBegun function, for use in
3534 assertions to catch deletion not done by the deref function.
3536 2009-05-10 David Kilzer <ddkilzer@apple.com>
3538 Part 2: Try to fix the Windows build by adding a symbol which is really just a re-mangling of a changed method signature
3540 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3541 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3543 2009-05-10 David Kilzer <ddkilzer@apple.com>
3545 Try to fix the Windows build by removing an unknown symbol
3547 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3548 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3550 2009-05-10 David Kilzer <ddkilzer@apple.com>
3552 Touch Nodes.cpp to try to fix Windows build
3554 * parser/Nodes.cpp: Removed whitespace.
3556 2009-05-10 Darin Adler <darin@apple.com>
3558 Reviewed by Maciej Stachowiak.
3560 Quick fix for failures seen on buildbot. Maciej plans a better fix later.
3562 * wtf/dtoa.cpp: Change the hardcoded number of 32-bit words in a BigInt
3563 from 32 to 64. Parsing "1e500", for example, requires more than 32 words.
3565 2009-05-10 Darin Adler <darin@apple.com>
3567 Reviewed by Sam Weinig.
3569 Bug 25674: syntax tree nodes should use arena allocation
3570 Part one: Change lifetimes so we won't have to use reference
3571 counting so much, but don't eliminate the reference counts
3574 * JavaScriptCore.exp: Updated.
3576 * bytecompiler/BytecodeGenerator.cpp:
3577 (JSC::BytecodeGenerator::BytecodeGenerator): Update for use of raw pointers
3579 (JSC::BytecodeGenerator::emitCall): Ditto.
3580 (JSC::BytecodeGenerator::emitConstruct): Ditto.
3582 * parser/Grammar.y: Update node creating code to use new (JSGlobalData*)
3583 instead of the plain new. At the moment this is just a hook for future
3584 arena allocation; it's inline and JSGlobalData* is not used.
3586 * parser/NodeConstructors.h: Updated for name change of parserObjects to
3587 parserArena. Also added explicit initialization for raw pointers that used
3588 to be RefPtr. Also removed some uses of get() that aren't needed now that
3589 the pointers are raw pointers. Also eliminated m_parameter from FuncExprNode
3590 and FuncDeclNode. Also changed node-creating code to use new (JSGlobalData*)
3593 * parser/Nodes.cpp: Eliminated NodeReleaser and all use of it.
3594 (JSC::ParserRefCounted::ParserRefCounted): Updated for name change of
3595 parserObjects to parserArena.
3596 (JSC::SourceElements::append): Use raw pointers.
3597 (JSC::ArrayNode::emitBytecode): Ditto.
3598 (JSC::ArrayNode::isSimpleArray): Ditto.
3599 (JSC::ArrayNode::toArgumentList): Ditto.
3600 (JSC::ObjectLiteralNode::emitBytecode): Ditto.
3601 (JSC::PropertyListNode::emitBytecode): Ditto.
3602 (JSC::BracketAccessorNode::emitBytecode): Ditto.
3603 (JSC::DotAccessorNode::emitBytecode): Ditto.
3604 (JSC::ArgumentListNode::emitBytecode): Ditto.
3605 (JSC::NewExprNode::emitBytecode): Ditto.
3606 (JSC::EvalFunctionCallNode::emitBytecode): Ditto.
3607 (JSC::FunctionCallValueNode::emitBytecode): Ditto.
3608 (JSC::FunctionCallResolveNode::emitBytecode): Ditto.
3609 (JSC::FunctionCallBracketNode::emitBytecode): Ditto.
3610 (JSC::FunctionCallDotNode::emitBytecode): Ditto.
3611 (JSC::CallFunctionCallDotNode::emitBytecode): Ditto.
3612 (JSC::ApplyFunctionCallDotNode::emitBytecode): Ditto.
3613 (JSC::PostfixBracketNode::emitBytecode): Ditto.
3614 (JSC::PostfixDotNode::emitBytecode): Ditto.
3615 (JSC::DeleteBracketNode::emitBytecode): Ditto.
3616 (JSC::DeleteDotNode::emitBytecode): Ditto.
3617 (JSC::DeleteValueNode::emitBytecode): Ditto.
3618 (JSC::VoidNode::emitBytecode): Ditto.
3619 (JSC::TypeOfValueNode::emitBytecode): Ditto.
3620 (JSC::PrefixBracketNode::emitBytecode): Ditto.
3621 (JSC::PrefixDotNode::emitBytecode): Ditto.
3622 (JSC::UnaryOpNode::emitBytecode): Ditto.
3623 (JSC::BinaryOpNode::emitStrcat): Ditto.
3624 (JSC::BinaryOpNode::emitBytecode): Ditto.
3625 (JSC::EqualNode::emitBytecode): Ditto.
3626 (JSC::StrictEqualNode::emitBytecode): Ditto.
3627 (JSC::ReverseBinaryOpNode::emitBytecode): Ditto.
3628 (JSC::ThrowableBinaryOpNode::emitBytecode): Ditto.
3629 (JSC::InstanceOfNode::emitBytecode): Ditto.
3630 (JSC::LogicalOpNode::emitBytecode): Ditto.
3631 (JSC::ConditionalNode::emitBytecode): Ditto.
3632 (JSC::ReadModifyResolveNode::emitBytecode): Ditto.
3633 (JSC::AssignResolveNode::emitBytecode): Ditto.
3634 (JSC::AssignDotNode::emitBytecode): Ditto.
3635 (JSC::ReadModifyDotNode::emitBytecode): Ditto.
3636 (JSC::AssignBracketNode::emitBytecode): Ditto.
3637 (JSC::ReadModifyBracketNode::emitBytecode): Ditto.
3638 (JSC::CommaNode::emitBytecode): Ditto.
3639 (JSC::ConstDeclNode::emitCodeSingle): Ditto.
3640 (JSC::ConstDeclNode::emitBytecode): Ditto.
3641 (JSC::ConstStatementNode::emitBytecode): Ditto.
3642 (JSC::statementListEmitCode): Ditto.
3643 (JSC::BlockNode::emitBytecode): Ditto.
3644 (JSC::ExprStatementNode::emitBytecode): Ditto.
3645 (JSC::VarStatementNode::emitBytecode): Ditto.
3646 (JSC::IfNode::emitBytecode): Ditto.
3647 (JSC::IfElseNode::emitBytecode): Ditto.
3648 (JSC::DoWhileNode::emitBytecode): Ditto.
3649 (JSC::WhileNode::emitBytecode): Ditto.
3650 (JSC::ForNode::emitBytecode): Ditto.
3651 (JSC::ForInNode::emitBytecode): Ditto.
3652 (JSC::ReturnNode::emitBytecode): Ditto.
3653 (JSC::WithNode::emitBytecode): Ditto.
3654 (JSC::CaseBlockNode::tryOptimizedSwitch): Ditto.
3655 (JSC::CaseBlockNode::emitBytecodeForBlock): Ditto.
3656 (JSC::SwitchNode::emitBytecode): Ditto.
3657 (JSC::LabelNode::emitBytecode): Ditto.
3658 (JSC::ThrowNode::emitBytecode): Ditto.
3659 (JSC::TryNode::emitBytecode): Ditto.
3660 (JSC::ScopeNodeData::ScopeNodeData): Use swap to transfer ownership
3661 of the arena, varStack and functionStack.
3662 (JSC::ScopeNode::ScopeNode): Pass in the arena when creating the
3664 (JSC::ProgramNode::ProgramNode): Made this inline since it's used
3666 (JSC::ProgramNode::create): Changed this to return a PassRefPtr since
3667 we plan to have the scope nodes be outside the arena, so they will need
3668 some kind of ownership transfer (maybe auto_ptr instead of PassRefPtr
3669 in the future, though). Remove the node from the newly-created arena to
3670 avoid a circular reference. Later we'll keep the node out of the arena
3671 by using a different operator new, but for now it's the ParserRefCounted
3672 constructor that puts the node into the arena, and there's no way to
3674 (JSC::EvalNode::EvalNode): Ditto.
3675 (JSC::EvalNode::create): Ditto.
3676 (JSC::FunctionBodyNode::FunctionBodyNode): Ditto.
3677 (JSC::FunctionBodyNode::createNativeThunk): Moved the code that
3678 reseets the arena here instead of the caller.
3679 (JSC::FunctionBodyNode::create): Same change as the other create
3681 (JSC::FunctionBodyNode::emitBytecode): Use raw pointers.
3683 * parser/Nodes.h: Removed NodeReleaser. Changed FunctionStack to
3684 use raw pointers. Removed the releaseNodes function. Added an override
3685 of operator new that takes a JSGlobalData* to prepare for future arena use.
3686 Use raw pointers instead of RefPtr everywhere possible.
3688 * parser/Parser.cpp:
3689 (JSC::Parser::reparseInPlace): Pass the arena in.
3692 (JSC::Parser::parse): Updated for name change of parserObjects to parserArena.
3693 (JSC::Parser::reparse): Ditto.
3694 * runtime/FunctionConstructor.cpp:
3695 (JSC::extractFunctionBody): Ditto.
3696 * runtime/JSGlobalData.cpp:
3697 (JSC::JSGlobalData::~JSGlobalData): Ditto.
3698 (JSC::JSGlobalData::createNativeThunk): Moved arena manipulation into the
3699 FunctionBodyNode::createNativeThunk function.
3701 * runtime/JSGlobalData.h: Tweaked formatting and renamed parserObjects to
3704 * wtf/NotFound.h: Added the usual "using WTF" to this header to match the
3707 2009-05-10 Dimitri Glazkov <dglazkov@chromium.org>
3709 Reviewed by Geoffrey Garen.
3711 https://bugs.webkit.org/show_bug.cgi?id=25670
3712 Remove no longer valid chunk of code from dtoa.
3715 (WTF::dtoa): Removed invalid code.
3717 2009-05-10 Alexey Proskuryakov <ap@webkit.org>
3719 Reviewed by Geoff Garen.
3721 "Class const *" is the same as "const Class*", use the latter syntax consistently.
3723 See <http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.9>.
3725 * pcre/pcre_compile.cpp:
3726 (calculateCompiledPatternLength):
3727 * runtime/JSObject.h:
3728 (JSC::JSObject::offsetForLocation):
3729 (JSC::JSObject::locationForOffset):
3731 2009-05-10 Maciej Stachowiak <mjs@apple.com>
3733 Reviewed by Alexey Proskuryakov.
3735 - speedup dtoa/strtod
3737 Added a bunch of inlining, and replaced malloc with stack allocation.
3739 0.5% SunSpider speedup (7% on string-tagcloud).
3741 * runtime/NumberPrototype.cpp:
3742 (JSC::integerPartNoExp):
3743 (JSC::numberProtoFuncToExponential):
3744 * runtime/UString.cpp:
3746 (JSC::UString::from):
3748 (WTF::BigInt::BigInt):
3749 (WTF::BigInt::operator=):
3769 2009-05-09 Mike Hommey <glandium@debian.org>
3771 Reviewed by Geoffrey Garen. Landed by Jan Alonzo.
3773 Enable JIT on x86-64 gtk+
3774 https://bugs.webkit.org/show_bug.cgi?id=24724
3778 2009-05-09 Geoffrey Garen <ggaren@apple.com>
3780 Reviewed by Cameron Zwarich.
3782 Removed the last non-call-related manually managed JIT stub call.
3784 * jit/JITArithmetic.cpp:
3785 (JSC::JIT::compileFastArithSlow_op_rshift): Fully use the JITStubCall
3786 abstraction, instead of emitPutJITStubArg.
3788 2009-05-09 Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
3790 Reviewed by Gustavo Noronha.
3792 https://bugs.webkit.org/show_bug.cgi?id=25653
3793 PLATFORM(X86_64) inherits ia64
3795 __ia64__ is defined by gcc in an IA64 arch and has completely
3796 nothing in common with X86-64 exept both are from Intel and have
3797 an 64bit address space. That's it. Since code seems to expect x86
3798 here, ia64 has to go.
3802 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
3804 Suggested by Geoffrey Garen.
3806 Assume SSE2 is present on X86-64 and on MAC X86-32. This fixes a
3807 build breakage on non-Mac X86-64 when JIT is enabled.
3809 * jit/JITArithmetic.cpp:
3811 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
3813 Build fix, adding missing files to make dist.
3817 2009-05-09 Geoffrey Garen <ggaren@apple.com>
3821 * assembler/X86Assembler.h:
3822 (JSC::X86Assembler::patchLoadToLEA):
3824 2009-05-09 Geoffrey Garen <ggaren@apple.com>
3828 * assembler/X86Assembler.h:
3829 (JSC::X86Assembler::patchLoadToLEA):
3831 2009-05-09 Maciej Stachowiak <mjs@apple.com>
3833 Reviewed by Gavin Barraclough.
3835 Original patch by John McCall. Updated by Cameron Zwarich. Further refined by me.
3837 - Assorted speedups to property access
3839 ~.3%-1% speedup on SunSpider
3841 1) When we know from the structure ID that an object is using inline storage, plant direct
3842 loads and stores against it; no need to indirect through storage pointer.
3844 2) Also because of the above, union the property storage pointer with the first inline property
3845 slot and add an extra inline property slot.
3847 * assembler/AbstractMacroAssembler.h:
3848 (JSC::AbstractMacroAssembler::CodeLocationInstruction::CodeLocationInstruction):
3849 (JSC::AbstractMacroAssembler::CodeLocationInstruction::patchLoadToLEA):
3850 (JSC::::CodeLocationCommon::instructionAtOffset):
3851 * assembler/MacroAssembler.h:
3852 (JSC::MacroAssembler::storePtr):
3853 * assembler/MacroAssemblerX86.h:
3854 (JSC::MacroAssemblerX86::store32):
3855 * assembler/MacroAssemblerX86_64.h:
3856 (JSC::MacroAssemblerX86_64::storePtr):
3857 * assembler/X86Assembler.h:
3858 (JSC::X86Assembler::movq_EAXm):
3859 (JSC::X86Assembler::movl_rm):
3860 (JSC::X86Assembler::patchLoadToLEA):
3862 (JSC::JIT::privateCompileMainPass):
3864 * jit/JITPropertyAccess.cpp:
3865 (JSC::JIT::compileGetByIdHotPath):
3866 (JSC::JIT::compilePutByIdHotPath):
3867 (JSC::JIT::compilePutDirectOffset):
3868 (JSC::JIT::compileGetDirectOffset):
3869 (JSC::JIT::privateCompilePutByIdTransition):
3870 (JSC::JIT::patchGetByIdSelf):
3871 (JSC::JIT::patchPutByIdReplace):
3872 (JSC::JIT::privateCompileGetByIdSelf):
3873 (JSC::JIT::privateCompileGetByIdProto):
3874 (JSC::JIT::privateCompileGetByIdSelfList):
3875 (JSC::JIT::privateCompileGetByIdProtoList):
3876 (JSC::JIT::privateCompileGetByIdChainList):
3877 (JSC::JIT::privateCompileGetByIdChain):
3878 (JSC::JIT::privateCompilePutByIdReplace):
3879 * runtime/JSObject.cpp:
3880 (JSC::JSObject::mark):
3881 (JSC::JSObject::removeDirect):
3882 * runtime/JSObject.h:
3883 (JSC::JSObject::propertyStorage):
3884 (JSC::JSObject::getDirect):
3885 (JSC::JSObject::getOffset):
3886 (JSC::JSObject::offsetForLocation):
3887 (JSC::JSObject::locationForOffset):
3888 (JSC::JSObject::getDirectOffset):
3889 (JSC::JSObject::putDirectOffset):
3890 (JSC::JSObject::isUsingInlineStorage):
3892 (JSC::JSObject::JSObject):
3893 (JSC::JSObject::~JSObject):
3894 (JSC::Structure::isUsingInlineStorage):
3895 (JSC::JSObject::putDirect):
3896 (JSC::JSObject::putDirectWithoutTransition):
3897 (JSC::JSObject::allocatePropertyStorageInline):
3898 * runtime/Structure.h:
3900 2009-05-09 Geoffrey Garen <ggaren@apple.com>
3902 Reviewed by Gavin Barraclough.
3904 Changed all our JIT stubs so that they return a maximum of 1 JS value or
3905 two non-JS pointers, and do all other value returning through out
3906 parameters, in preparation for 64bit JS values on a 32bit system.
3908 Stubs that used to return two JSValues now return one JSValue and take
3909 and out parameter specifying where in the register array the second
3912 SunSpider reports no change.
3915 (JSC::JIT::privateCompileMainPass):
3916 * jit/JITArithmetic.cpp:
3917 (JSC::JIT::compileFastArithSlow_op_post_inc):
3918 (JSC::JIT::compileFastArithSlow_op_post_dec):
3920 (JSC::JITStubs::cti_op_call_arityCheck):
3921 (JSC::JITStubs::cti_op_resolve_func):
3922 (JSC::JITStubs::cti_op_post_inc):
3923 (JSC::JITStubs::cti_op_resolve_with_base):
3924 (JSC::JITStubs::cti_op_post_dec):
3928 2009-05-08 Geoffrey Garen <ggaren@apple.com>
3930 Reviewed by Cameron Zwarich.
3932 Fixed <rdar://problem/6634956> CrashTracer: [REGRESSION] >400 crashes
3933 in Safari at com.apple.JavaScriptCore • JSC::BytecodeGenerator::emitComplexJumpScopes + 468
3934 https://bugs.webkit.org/show_bug.cgi?id=25658
3936 * bytecompiler/BytecodeGenerator.cpp:
3937 (JSC::BytecodeGenerator::emitComplexJumpScopes): Guard the whole loop
3938 with a bounds check. The old loop logic would decrement and read topScope
3939 without a bounds check, which could cause crashes on page boundaries.
3941 2009-05-08 Jan Michael Alonzo <jmalonzo@webkit.org>
3943 Reviewed by NOBODY (BuildFix).
3945 Gtk fix: add LiteralParser to the build script per r43424.
3947 Add LiteralParser to the Qt and Wx build scripts too.
3950 * JavaScriptCore.pri:
3951 * JavaScriptCoreSources.bkl:
3953 2009-05-08 Oliver Hunt <oliver@apple.com>
3955 Reviewed by Gavin Barraclough and Darin Adler.
3957 Add a limited literal parser for eval to handle object and array literals fired at eval
3959 This is a simplified parser and lexer that we can throw at strings passed to eval
3960 in case a site is using eval to parse JSON (eg. json2.js). The lexer is intentionally
3961 limited (in effect it's whitelisting a limited "common" subset of the JSON grammar)
3962 as this decreases the likelihood of us wating time attempting to parse any significant
3963 amount of non-JSON content.
3965 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3966 * JavaScriptCore.xcodeproj/project.pbxproj:
3967 * interpreter/Interpreter.cpp:
3968 (JSC::Interpreter::callEval):
3969 * runtime/JSGlobalObjectFunctions.cpp:
3970 (JSC::globalFuncEval):
3971 * runtime/LiteralParser.cpp: Added.
3972 (JSC::isStringCharacter):
3973 (JSC::LiteralParser::Lexer::lex):
3974 (JSC::LiteralParser::Lexer::lexString):
3975 (JSC::LiteralParser::Lexer::lexNumber):
3976 (JSC::LiteralParser::parseStatement):
3977 (JSC::LiteralParser::parseExpression):
3978 (JSC::LiteralParser::parseArray):
3979 (JSC::LiteralParser::parseObject):
3980 (JSC::LiteralParser::StackGuard::StackGuard):
3981 (JSC::LiteralParser::StackGuard::~StackGuard):
3982 (JSC::LiteralParser::StackGuard::isSafe):
3983 * runtime/LiteralParser.h: Added.
3984 (JSC::LiteralParser::LiteralParser):
3985 (JSC::LiteralParser::attemptJSONParse):
3986 (JSC::LiteralParser::):
3987 (JSC::LiteralParser::Lexer::Lexer):
3988 (JSC::LiteralParser::Lexer::next):
3989 (JSC::LiteralParser::Lexer::currentToken):
3990 (JSC::LiteralParser::abortParse):
3992 2009-05-08 Geoffrey Garen <ggaren@apple.com>
3996 Restored a Mozilla JS test I accidentally gutted.
3998 * tests/mozilla/ecma/Array/15.4.4.2.js:
4002 2009-05-08 Geoffrey Garen <ggaren@apple.com>
4004 Reviewed by Gavin Barraclough.
4006 More abstraction for JITStub calls from JITed code.
4008 Added a JITStubCall class that automatically handles things like assigning
4009 arguments to different stack slots and storing return values. Deployed
4010 the class in about a billion places. A bunch more places remain to be
4011 fixed up, but this is a good stopping point for now.
4014 (JSC::JIT::emitTimeoutCheck):
4015 (JSC::JIT::privateCompileMainPass):
4016 (JSC::JIT::privateCompileSlowCases):
4017 (JSC::JIT::privateCompile):
4019 (JSC::JIT::JSRInfo::JSRInfo):
4020 (JSC::JITStubCall::JITStubCall):
4021 (JSC::JITStubCall::addArgument):
4022 (JSC::JITStubCall::call):
4023 (JSC::JITStubCall::):
4024 (JSC::CallEvalJITStub::CallEvalJITStub):
4025 * jit/JITArithmetic.cpp:
4026 (JSC::JIT::compileFastArithSlow_op_lshift):
4027 (JSC::JIT::compileFastArithSlow_op_rshift):
4028 (JSC::JIT::compileFastArithSlow_op_jnless):
4029 (JSC::JIT::compileFastArithSlow_op_bitand):
4030 (JSC::JIT::compileFastArithSlow_op_mod):
4031 (JSC::JIT::compileFastArith_op_mod):
4032 (JSC::JIT::compileFastArithSlow_op_post_inc):
4033 (JSC::JIT::compileFastArithSlow_op_post_dec):
4034 (JSC::JIT::compileFastArithSlow_op_pre_inc):
4035 (JSC::JIT::compileFastArithSlow_op_pre_dec):
4036 (JSC::JIT::compileFastArith_op_add):
4037 (JSC::JIT::compileFastArith_op_mul):
4038 (JSC::JIT::compileFastArith_op_sub):
4039 (JSC::JIT::compileBinaryArithOpSlowCase):
4040 (JSC::JIT::compileFastArithSlow_op_add):
4041 (JSC::JIT::compileFastArithSlow_op_mul):
4043 (JSC::JIT::compileOpCall):
4045 * jit/JITPropertyAccess.cpp:
4046 (JSC::JIT::compileGetByIdHotPath):
4047 (JSC::JIT::compilePutByIdHotPath):
4048 (JSC::JIT::compileGetByIdSlowCase):
4049 (JSC::JIT::compilePutByIdSlowCase):
4051 (JSC::JITStubs::cti_op_resolve_func):
4052 (JSC::JITStubs::cti_op_resolve_with_base):
4054 2009-05-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
4056 Reviewed by Maciej Stachowiak.
4058 Add a new opcode jnlesseq, and optimize its compilation in the JIT using
4059 techniques similar to what were used to optimize jnless in r43363.
4061 This gives a 0.7% speedup on SunSpider, particularly on the tests 3d-cube,
4062 control-flow-recursive, date-format-xparb, and string-base64.
4064 * bytecode/CodeBlock.cpp:
4065 (JSC::CodeBlock::dump): Add support for dumping op_jnlesseq.
4066 * bytecode/Opcode.h: Add op_jnlesseq to the list of opcodes.
4067 * bytecompiler/BytecodeGenerator.cpp:
4068 (JSC::BytecodeGenerator::emitJumpIfFalse): Add a peephole optimization
4069 for op_jnlesseq when emitting lesseq followed by a jump.
4070 * interpreter/Interpreter.cpp:
4071 (JSC::Interpreter::privateExecute): Add case for op_jnlesseq.
4073 (JSC::JIT::privateCompileMainPass): Add case for op_jnlesseq.
4074 (JSC::JIT::privateCompileSlowCases): Add case for op_jnlesseq.
4076 * jit/JITArithmetic.cpp:
4077 (JSC::JIT::compileFastArith_op_jnlesseq): Added.
4078 (JSC::JIT::compileFastArithSlow_op_jnlesseq): Added.
4080 (JSC::JITStubs::cti_op_jlesseq): Added.
4083 2009-05-08 Maciej Stachowiak <mjs@apple.com>
4085 Reviewed by Cameron Zwarich.
4087 - fix test failures on 64-bit
4089 * jit/JITArithmetic.cpp:
4090 (JSC::JIT::compileFastArithSlow_op_jnless): Avoid accidentaly treating an
4091 immediate int as an immediate float in the 64-bit value representation.
4093 2009-05-08 Gavin Barraclough <barraclough@apple.com>
4095 Rubber stamped by Oliver Hunt.
4097 Removing an empty constructor and an uncalled, empty function seems to be a
4098 pretty solid 1% regeression on my machine, so I'm going to put them back.
4099 Um. Yeah, this this pretty pointles and makes no sense at all. I officially
4100 lose the will to live in 3... 2...
4102 * bytecode/SamplingTool.cpp:
4103 (JSC::SamplingTool::notifyOfScope):
4104 * bytecode/SamplingTool.h:
4105 (JSC::SamplingTool::~SamplingTool):
4107 2009-05-08 Gavin Barraclough <barraclough@apple.com>
4109 Reviewed by Oliver "I see lots of ifdefs" Hunt.
4111 Fix (kinda) for sampling tool breakage. The codeblock sampling tool has become
4112 b0rked due to recent changes in native function calling. The initialization of
4113 a ScopeNode appears to now occur before the sampling tool (or possibly the
4114 interpreter has been brought into existence, wihich leads to crashyness).
4116 This patch doesn't fix the problem. The crash occurs when tracking a Scope, but
4117 we shouldn't need to track scopes when we're just sampling opcodes, not
4118 codeblocks. Not retaining Scopes when just opcode sampling will reduce sampling
4119 overhead reducing any instrumentation skew, which is a good thing. As a side
4120 benefit this patch also gets the opcode sampling going again, albeit in a bit of
4121 a lame way. Will come back later with a proper fix from codeblock sampling.
4123 * JavaScriptCore.exp:
4124 * bytecode/SamplingTool.cpp:
4125 (JSC::compareLineCountInfoSampling):
4126 (JSC::SamplingTool::dump):
4127 * bytecode/SamplingTool.h:
4128 (JSC::SamplingTool::SamplingTool):
4130 (JSC::ScopeNode::ScopeNode):
4132 2009-05-07 Mark Rowe <mrowe@apple.com>
4134 Rubber-stamped by Oliver Hunt.
4136 Fix <https://bugs.webkit.org/show_bug.cgi?id=25640>.
4137 Bug 25640: Crash on quit in r43384 nightly build on Leopard w/ Safari 4 beta installed
4139 Roll out r43366 as it removed symbols that Safari 4 Beta uses.
4141 * JavaScriptCore.exp:
4142 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4143 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4144 * bytecode/SamplingTool.cpp:
4145 (JSC::SamplingThread::start):
4146 (JSC::SamplingThread::stop):
4147 * bytecode/SamplingTool.h:
4148 * wtf/CrossThreadRefCounted.h:
4149 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
4153 * wtf/ThreadingNone.cpp:
4154 * wtf/ThreadingPthreads.cpp:
4155 (WTF::threadMapMutex):
4156 (WTF::initializeThreading):
4158 (WTF::identifierByPthreadHandle):
4159 (WTF::establishIdentifierForPthreadHandle):
4160 (WTF::pthreadHandleForIdentifier):
4161 (WTF::clearPthreadHandleForIdentifier):
4162 (WTF::createThreadInternal):
4163 (WTF::waitForThreadCompletion):
4164 (WTF::detachThread):
4165 (WTF::currentThread):
4166 * wtf/ThreadingWin.cpp:
4167 (WTF::threadMapMutex):
4168 (WTF::initializeThreading):
4170 (WTF::storeThreadHandleByIdentifier):
4171 (WTF::threadHandleForIdentifier):
4172 (WTF::clearThreadHandleForIdentifier):
4173 (WTF::createThreadInternal):
4174 (WTF::waitForThreadCompletion):
4175 (WTF::detachThread):
4176 (WTF::currentThread):
4177 * wtf/gtk/ThreadingGtk.cpp:
4178 (WTF::threadMapMutex):
4179 (WTF::initializeThreading):
4181 (WTF::identifierByGthreadHandle):
4182 (WTF::establishIdentifierForThread):
4183 (WTF::threadForIdentifier):
4184 (WTF::clearThreadForIdentifier):
4185 (WTF::createThreadInternal):
4186 (WTF::waitForThreadCompletion):
4187 (WTF::currentThread):
4188 * wtf/qt/ThreadingQt.cpp:
4189 (WTF::threadMapMutex):
4191 (WTF::identifierByQthreadHandle):
4192 (WTF::establishIdentifierForThread):
4193 (WTF::clearThreadForIdentifier):
4194 (WTF::threadForIdentifier):
4195 (WTF::initializeThreading):
4196 (WTF::createThreadInternal):
4197 (WTF::waitForThreadCompletion):
4198 (WTF::currentThread):
4200 2009-05-07 Gustavo Noronha Silva <gns@gnome.org>
4202 Suggested by Oliver Hunt.
4204 Also check for Linux for the special-cased calling convention.
4207 (JSC::JIT::privateCompileCTIMachineTrampolines):
4210 2009-05-07 Gavin Barraclough <barraclough@apple.com>
4212 Reviewed by Maciej Stachowiak.
4214 Previously, when appending to an existing string and growing the underlying buffer,
4215 we would actually allocate 110% of the required size in order to give us some space
4216 to expand into. Now we treat strings differently based on their size:
4218 Small Strings (up to 4 pages):
4219 Expand the allocation size to 112.5% of the amount requested. This is largely sicking
4220 to our previous policy, however 112.5% is cheaper to calculate.
4222 Medium Strings (up to 128 pages):
4223 For pages covering multiple pages over-allocation is less of a concern - any unused
4224 space will not be paged in if it is not used, so this is purely a VM overhead. For
4225 these strings allocate 2x the requested size.
4227 Large Strings (to infinity and beyond!):
4228 Revert to our 112.5% policy - probably best to limit the amount of unused VM we allow
4229 any individual string be responsible for.
4231 Additionally, round small allocations up to a multiple of 16 bytes, and medium and
4232 large allocations up to a multiple of page size.
4234 ~1.5% progression on Sunspider, due to 5% improvement on tagcloud & 15% on validate.
4236 * runtime/UString.cpp:
4237 (JSC::expandedSize):
4239 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4241 Reviewed by Cameron Zwarich.
4243 Fixed a minor sequencing error introduced by recent Parser speedups.
4245 * runtime/JSGlobalData.cpp:
4246 (JSC::JSGlobalData::createNativeThunk): Missed a spot in my last patch.
4248 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4252 * wtf/Platform.h: Reverted an accidental (and performance-catastrophic)
4255 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4257 Reviewed by Cameron Zwarich.
4259 Fixed a minor sequencing error introduced by recent Parser speedups.
4261 * parser/Parser.cpp:
4262 (JSC::Parser::reparseInPlace): Missed a spot in my last patch.
4264 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4266 Reviewed by Cameron Zwarich.
4268 Fixed a minor sequencing error introduced by recent Parser speedups.
4270 * parser/Parser.cpp:
4271 (JSC::Parser::parse):
4273 (JSC::Parser::parse):
4274 (JSC::Parser::reparse): Shrink the parsedObjects vector after allocating
4275 the root node, to avoid leaving a stray node in the vector, since that's
4276 a slight memory leak, and it causes problems during JSGlobalData teardown.
4278 * runtime/JSGlobalData.cpp:
4279 (JSC::JSGlobalData::~JSGlobalData): ASSERT that we're not being torn
4280 down while we think we're still parsing, since that would cause lots of
4281 bad memory references during our destruction.
4283 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4285 Reviewed by Cameron Zwarich.
4287 Replaced two more macros with references to the JITStackFrame structure.
4290 (JSC::JIT::privateCompileMainPass):
4291 * jit/JITInlineMethods.h:
4292 (JSC::JIT::restoreArgumentReference):
4297 2009-05-07 Oliver Hunt <oliver@apple.com>
4299 Reviewed by Gavin Barraclough.
4301 Improve native call performance
4303 Fix the windows build by adding calling convention declarations everywhere,
4304 chose fastcall as that seemed most sensible given we were having to declare
4305 the convention explicitly. In addition switched to fastcall on mac in the
4306 deluded belief that documented fastcall behavior on windows would match
4307 actual its actual behavior.
4309 * API/JSCallbackFunction.h:
4310 * API/JSCallbackObject.h:
4311 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4312 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4313 * interpreter/CallFrame.h:
4314 (JSC::ExecState::argumentCount):
4316 (JSC::JIT::privateCompileCTIMachineTrampolines):
4324 (functionSetSamplingFlags):
4325 (functionClearSamplingFlags):
4328 * runtime/ArrayConstructor.cpp:
4329 (JSC::callArrayConstructor):
4330 * runtime/ArrayPrototype.cpp:
4331 (JSC::arrayProtoFuncToString):
4332 (JSC::arrayProtoFuncToLocaleString):
4333 (JSC::arrayProtoFuncJoin):
4334 (JSC::arrayProtoFuncConcat):
4335 (JSC::arrayProtoFuncPop):
4336 (JSC::arrayProtoFuncPush):
4337 (JSC::arrayProtoFuncReverse):
4338 (JSC::arrayProtoFuncShift):
4339 (JSC::arrayProtoFuncSlice):
4340 (JSC::arrayProtoFuncSort):
4341 (JSC::arrayProtoFuncSplice):
4342 (JSC::arrayProtoFuncUnShift):
4343 (JSC::arrayProtoFuncFilter):
4344 (JSC::arrayProtoFuncMap):
4345 (JSC::arrayProtoFuncEvery):
4346 (JSC::arrayProtoFuncForEach):
4347 (JSC::arrayProtoFuncSome):
4348 (JSC::arrayProtoFuncReduce):
4349 (JSC::arrayProtoFuncReduceRight):
4350 (JSC::arrayProtoFuncIndexOf):
4351 (JSC::arrayProtoFuncLastIndexOf):
4352 * runtime/BooleanConstructor.cpp:
4353 (JSC::callBooleanConstructor):
4354 * runtime/BooleanPrototype.cpp:
4355 (JSC::booleanProtoFuncToString):
4356 (JSC::booleanProtoFuncValueOf):
4357 * runtime/CallData.h:
4358 * runtime/DateConstructor.cpp:
4363 * runtime/DatePrototype.cpp:
4364 (JSC::dateProtoFuncToString):
4365 (JSC::dateProtoFuncToUTCString):
4366 (JSC::dateProtoFuncToDateString):
4367 (JSC::dateProtoFuncToTimeString):
4368 (JSC::dateProtoFuncToLocaleString):
4369 (JSC::dateProtoFuncToLocaleDateString):
4370 (JSC::dateProtoFuncToLocaleTimeString):
4371 (JSC::dateProtoFuncGetTime):
4372 (JSC::dateProtoFuncGetFullYear):
4373 (JSC::dateProtoFuncGetUTCFullYear):
4374 (JSC::dateProtoFuncToGMTString):
4375 (JSC::dateProtoFuncGetMonth):
4376 (JSC::dateProtoFuncGetUTCMonth):
4377 (JSC::dateProtoFuncGetDate):
4378 (JSC::dateProtoFuncGetUTCDate):
4379 (JSC::dateProtoFuncGetDay):
4380 (JSC::dateProtoFuncGetUTCDay):
4381 (JSC::dateProtoFuncGetHours):
4382 (JSC::dateProtoFuncGetUTCHours):
4383 (JSC::dateProtoFuncGetMinutes):
4384 (JSC::dateProtoFuncGetUTCMinutes):
4385 (JSC::dateProtoFuncGetSeconds):
4386 (JSC::dateProtoFuncGetUTCSeconds):
4387 (JSC::dateProtoFuncGetMilliSeconds):
4388 (JSC::dateProtoFuncGetUTCMilliseconds):
4389 (JSC::dateProtoFuncGetTimezoneOffset):
4390 (JSC::dateProtoFuncSetTime):
4391 (JSC::dateProtoFuncSetMilliSeconds):
4392 (JSC::dateProtoFuncSetUTCMilliseconds):
4393 (JSC::dateProtoFuncSetSeconds):
4394 (JSC::dateProtoFuncSetUTCSeconds):
4395 (JSC::dateProtoFuncSetMinutes):
4396 (JSC::dateProtoFuncSetUTCMinutes):
4397 (JSC::dateProtoFuncSetHours):
4398 (JSC::dateProtoFuncSetUTCHours):
4399 (JSC::dateProtoFuncSetDate):
4400 (JSC::dateProtoFuncSetUTCDate):
4401 (JSC::dateProtoFuncSetMonth):
4402 (JSC::dateProtoFuncSetUTCMonth):
4403 (JSC::dateProtoFuncSetFullYear):
4404 (JSC::dateProtoFuncSetUTCFullYear):
4405 (JSC::dateProtoFuncSetYear):
4406 (JSC::dateProtoFuncGetYear):
4407 * runtime/ErrorConstructor.cpp:
4408 (JSC::callErrorConstructor):
4409 * runtime/ErrorPrototype.cpp:
4410 (JSC::errorProtoFuncToString):
4411 * runtime/FunctionConstructor.cpp:
4412 (JSC::callFunctionConstructor):
4413 * runtime/FunctionPrototype.cpp:
4414 (JSC::callFunctionPrototype):
4415 (JSC::functionProtoFuncToString):
4416 (JSC::functionProtoFuncApply):
4417 (JSC::functionProtoFuncCall):
4418 * runtime/JSFunction.h:
4419 (JSC::JSFunction::nativeFunction):
4420 (JSC::JSFunction::setScopeChain):
4421 * runtime/JSGlobalObjectFunctions.cpp:
4422 (JSC::globalFuncEval):
4423 (JSC::globalFuncParseInt):
4424 (JSC::globalFuncParseFloat):
4425 (JSC::globalFuncIsNaN):
4426 (JSC::globalFuncIsFinite):
4427 (JSC::globalFuncDecodeURI):
4428 (JSC::globalFuncDecodeURIComponent):
4429 (JSC::globalFuncEncodeURI):
4430 (JSC::globalFuncEncodeURIComponent):
4431 (JSC::globalFuncEscape):
4432 (JSC::globalFuncUnescape):
4433 (JSC::globalFuncJSCPrint):
4434 * runtime/JSGlobalObjectFunctions.h:
4435 * runtime/MathObject.cpp:
4436 (JSC::mathProtoFuncAbs):
4437 (JSC::mathProtoFuncACos):
4438 (JSC::mathProtoFuncASin):
4439 (JSC::mathProtoFuncATan):
4440 (JSC::mathProtoFuncATan2):
4441 (JSC::mathProtoFuncCeil):
4442 (JSC::mathProtoFuncCos):
4443 (JSC::mathProtoFuncExp):
4444 (JSC::mathProtoFuncFloor):
4445 (JSC::mathProtoFuncLog):
4446 (JSC::mathProtoFuncMax):
4447 (JSC::mathProtoFuncMin):
4448 (JSC::mathProtoFuncPow):
4449 (JSC::mathProtoFuncRandom):
4450 (JSC::mathProtoFuncRound):
4451 (JSC::mathProtoFuncSin):
4452 (JSC::mathProtoFuncSqrt):
4453 (JSC::mathProtoFuncTan):
4454 * runtime/NativeErrorConstructor.cpp:
4455 (JSC::callNativeErrorConstructor):
4456 * runtime/NativeFunctionWrapper.h:
4457 * runtime/NumberConstructor.cpp:
4458 (JSC::callNumberConstructor):
4459 * runtime/NumberPrototype.cpp:
4460 (JSC::numberProtoFuncToString):
4461 (JSC::numberProtoFuncToLocaleString):
4462 (JSC::numberProtoFuncValueOf):
4463 (JSC::numberProtoFuncToFixed):
4464 (JSC::numberProtoFuncToExponential):
4465 (JSC::numberProtoFuncToPrecision):
4466 * runtime/ObjectConstructor.cpp:
4467 (JSC::callObjectConstructor):
4468 * runtime/ObjectPrototype.cpp:
4469 (JSC::objectProtoFuncValueOf):
4470 (JSC::objectProtoFuncHasOwnProperty):
4471 (JSC::objectProtoFuncIsPrototypeOf):
4472 (JSC::objectProtoFuncDefineGetter):
4473 (JSC::objectProtoFuncDefineSetter):
4474 (JSC::objectProtoFuncLookupGetter):
4475 (JSC::objectProtoFuncLookupSetter):
4476 (JSC::objectProtoFuncPropertyIsEnumerable):
4477 (JSC::objectProtoFuncToLocaleString):
4478 (JSC::objectProtoFuncToString):
4479 * runtime/ObjectPrototype.h:
4480 * runtime/RegExpConstructor.cpp:
4481 (JSC::callRegExpConstructor):
4482 * runtime/RegExpObject.cpp:
4483 (JSC::callRegExpObject):
4484 * runtime/RegExpPrototype.cpp:
4485 (JSC::regExpProtoFuncTest):
4486 (JSC::regExpProtoFuncExec):
4487 (JSC::regExpProtoFuncCompile):
4488 (JSC::regExpProtoFuncToString):
4489 * runtime/StringConstructor.cpp:
4490 (JSC::stringFromCharCode):
4491 (JSC::callStringConstructor):
4492 * runtime/StringPrototype.cpp:
4493 (JSC::stringProtoFuncReplace):
4494 (JSC::stringProtoFuncToString):
4495 (JSC::stringProtoFuncCharAt):
4496 (JSC::stringProtoFuncCharCodeAt):
4497 (JSC::stringProtoFuncConcat):
4498 (JSC::stringProtoFuncIndexOf):
4499 (JSC::stringProtoFuncLastIndexOf):
4500 (JSC::stringProtoFuncMatch):
4501 (JSC::stringProtoFuncSearch):
4502 (JSC::stringProtoFuncSlice):
4503 (JSC::stringProtoFuncSplit):
4504 (JSC::stringProtoFuncSubstr):
4505 (JSC::stringProtoFuncSubstring):
4506 (JSC::stringProtoFuncToLowerCase):
4507 (JSC::stringProtoFuncToUpperCase):
4508 (JSC::stringProtoFuncLocaleCompare):
4509 (JSC::stringProtoFuncBig):
4510 (JSC::stringProtoFuncSmall):
4511 (JSC::stringProtoFuncBlink):
4512 (JSC::stringProtoFuncBold):
4513 (JSC::stringProtoFuncFixed):
4514 (JSC::stringProtoFuncItalics):
4515 (JSC::stringProtoFuncStrike):
4516 (JSC::stringProtoFuncSub):
4517 (JSC::stringProtoFuncSup):
4518 (JSC::stringProtoFuncFontcolor):
4519 (JSC::stringProtoFuncFontsize):
4520 (JSC::stringProtoFuncAnchor):
4521 (JSC::stringProtoFuncLink):
4524 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4528 Rolled out a portion of r43352 because it broke 64bit.
4532 2009-05-07 Kevin Ollivier <kevino@theolliviers.com>
4534 Build fix for functions reaturning ThreadIdentifier.
4536 * wtf/ThreadingNone.cpp:
4537 (WTF::createThreadInternal):
4538 (WTF::currentThread):
4540 2009-05-07 Maciej Stachowiak <mjs@apple.com>
4542 Reviewed by John Honeycutt.
4544 - enable optimization case im the last patch that I accidentally had disabled.
4546 * jit/JITArithmetic.cpp:
4547 (JSC::JIT::compileFastArithSlow_op_jnless):
4549 2009-05-07 Dmitry Titov <dimich@chromium.org>
4551 Attempt to fix Win build.
4553 * jit/JITArithmetic.cpp:
4554 (JSC::JIT::compileFastArithSlow_op_jnless):
4556 2009-05-07 Dmitry Titov <dimich@chromium.org>
4558 Reviewed by Alexey Proskuryakov and Adam Roben.
4560 https://bugs.webkit.org/show_bug.cgi?id=25348
4561 Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
4564 (WTF::ThreadIdentifier::ThreadIdentifier):
4565 (WTF::ThreadIdentifier::isValid):
4566 (WTF::ThreadIdentifier::invalidate):
4567 (WTF::ThreadIdentifier::platformId):
4568 ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
4569 methods that are used across the code on thread ids: construction, comparisons,
4570 check for 'valid' state etc. '0' is used as invalid id, which happens to just work
4571 with all platform-specific thread id implementations.
4573 All the following files repeatedly reflect the new ThreadIdentifier for each platform.
4574 We remove ThreadMap and threadMapMutex from all of them, remove the functions that
4575 populated/searched/cleared the map and add platform-specific comparison operators
4576 for ThreadIdentifier.
4578 * wtf/gtk/ThreadingGtk.cpp:
4579 (WTF::ThreadIdentifier::operator==):
4580 (WTF::ThreadIdentifier::operator!=):
4581 (WTF::initializeThreading):
4582 (WTF::createThreadInternal):
4583 (WTF::waitForThreadCompletion):
4584 (WTF::currentThread):
4586 * wtf/ThreadingNone.cpp:
4587 (WTF::ThreadIdentifier::operator==):
4588 (WTF::ThreadIdentifier::operator!=):
4590 * wtf/ThreadingPthreads.cpp:
4591 (WTF::ThreadIdentifier::operator==):
4592 (WTF::ThreadIdentifier::operator!=):
4593 (WTF::initializeThreading):
4594 (WTF::createThreadInternal):
4595 (WTF::waitForThreadCompletion):
4596 (WTF::detachThread):
4597 (WTF::currentThread):
4599 * wtf/qt/ThreadingQt.cpp:
4600 (WTF::ThreadIdentifier::operator==):
4601 (WTF::ThreadIdentifier::operator!=):
4602 (WTF::initializeThreading):
4603 (WTF::createThreadInternal):
4604 (WTF::waitForThreadCompletion):
4605 (WTF::currentThread):
4607 * wtf/ThreadingWin.cpp:
4608 (WTF::ThreadIdentifier::operator==):
4609 (WTF::ThreadIdentifier::operator!=):
4610 (WTF::initializeThreading):
4611 (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
4612 counter as a thread ID and mapped it into platform ID. Windows was using native thread
4613 id and mapped it into thread handle. Since we can always obtain a thread handle
4614 by thread id, createThread now closes the handle.
4615 (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
4616 it means the thread already exited.
4617 (WTF::detachThread):
4618 (WTF::currentThread):
4619 (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
4620 (WTF::waitForThreadCompletionDeprecated): same.
4621 (WTF::currentThreadDeprecated): same.
4622 (WTF::createThreadDeprecated): same.
4624 * bytecode/SamplingTool.h:
4625 * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
4627 * JavaScriptCore.exp: export lists - updated the WTF threading functions decorated names
4628 since they now take a different type as a parameter.
4629 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
4630 that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
4631 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
4633 2009-05-07 Maciej Stachowiak <mjs@apple.com>
4635 Reviewed by Sam Weinig.
4637 - optimize various cases of branch-fused less
4639 1% speedup on SunSpider overall
4640 13% speedup on math-cordic
4643 (JSC::JIT::privateCompileMainPass):
4644 op_loop_if_less: Optimize case of constant as first operand, just as case of constant as
4646 op_jnless: Factored out into compileFastArith_op_jnless.
4647 (JSC::JIT::privateCompileSlowCases):
4648 op_jnless: Factored out into compileFastArithSlow_op_jnless.
4650 * jit/JITArithmetic.cpp:
4651 (JSC::JIT::compileFastArith_op_jnless): Factored out from main compile loop.
4652 - Generate inline code for comparison of constant immediate int as first operand to another
4653 immediate int, as for loop_if_less
4655 (JSC::JIT::compileFastArithSlow_op_jnless):
4656 - Generate inline code for comparing two floating point numbers.
4657 - Generate code for both cases of comparing a floating point number to a constant immediate
4659 * bytecode/CodeBlock.cpp:
4660 (JSC::CodeBlock::dump): Fix dumping of op_jnless (tangentially related bugfix).
4662 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4664 Reviewed by Sam Weinig.
4666 Added the return address of a stub function to the JITStackFrame abstraction.
4672 (JSC::StackHack::StackHack):
4673 (JSC::StackHack::~StackHack):
4674 (JSC::returnToThrowTrampoline):
4675 (JSC::JITStubs::cti_op_convert_this):
4676 (JSC::JITStubs::cti_op_end):
4677 (JSC::JITStubs::cti_op_add):
4678 (JSC::JITStubs::cti_op_pre_inc):
4679 (JSC::JITStubs::cti_timeout_check):
4680 (JSC::JITStubs::cti_register_file_check):
4681 (JSC::JITStubs::cti_op_loop_if_less):
4682 (JSC::JITStubs::cti_op_loop_if_lesseq):
4683 (JSC::JITStubs::cti_op_new_object):
4684 (JSC::JITStubs::cti_op_put_by_id_generic):
4685 (JSC::JITStubs::cti_op_get_by_id_generic):
4686 (JSC::JITStubs::cti_op_put_by_id):
4687 (JSC::JITStubs::cti_op_put_by_id_second):
4688 (JSC::JITStubs::cti_op_put_by_id_fail):
4689 (JSC::JITStubs::cti_op_get_by_id):
4690 (JSC::JITStubs::cti_op_get_by_id_second):
4691 (JSC::JITStubs::cti_op_get_by_id_self_fail):
4692 (JSC::JITStubs::cti_op_get_by_id_proto_list):
4693 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
4694 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
4695 (JSC::JITStubs::cti_op_get_by_id_array_fail):
4696 (JSC::JITStubs::cti_op_get_by_id_string_fail):
4697 (JSC::JITStubs::cti_op_instanceof):
4698 (JSC::JITStubs::cti_op_del_by_id):
4699 (JSC::JITStubs::cti_op_mul):
4700 (JSC::JITStubs::cti_op_new_func):
4701 (JSC::JITStubs::cti_op_call_JSFunction):
4702 (JSC::JITStubs::cti_op_call_arityCheck):
4703 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
4704 (JSC::JITStubs::cti_vm_lazyLinkCall):
4705 (JSC::JITStubs::cti_op_push_activation):
4706 (JSC::JITStubs::cti_op_call_NotJSFunction):
4707 (JSC::JITStubs::cti_op_create_arguments):
4708 (JSC::JITStubs::cti_op_create_arguments_no_params):
4709 (JSC::JITStubs::cti_op_tear_off_activation):
4710 (JSC::JITStubs::cti_op_tear_off_arguments):
4711 (JSC::JITStubs::cti_op_profile_will_call):
4712 (JSC::JITStubs::cti_op_profile_did_call):
4713 (JSC::JITStubs::cti_op_ret_scopeChain):
4714 (JSC::JITStubs::cti_op_new_array):
4715 (JSC::JITStubs::cti_op_resolve):
4716 (JSC::JITStubs::cti_op_construct_JSConstruct):
4717 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
4718 (JSC::JITStubs::cti_op_get_by_val):
4719 (JSC::JITStubs::cti_op_get_by_val_string):
4720 (JSC::JITStubs::cti_op_get_by_val_byte_array):
4721 (JSC::JITStubs::cti_op_resolve_func):
4722 (JSC::JITStubs::cti_op_sub):
4723 (JSC::JITStubs::cti_op_put_by_val):
4724 (JSC::JITStubs::cti_op_put_by_val_array):
4725 (JSC::JITStubs::cti_op_put_by_val_byte_array):
4726 (JSC::JITStubs::cti_op_lesseq):
4727 (JSC::JITStubs::cti_op_loop_if_true):
4728 (JSC::JITStubs::cti_op_load_varargs):
4729 (JSC::JITStubs::cti_op_negate):
4730 (JSC::JITStubs::cti_op_resolve_base):
4731 (JSC::JITStubs::cti_op_resolve_skip):
4732 (JSC::JITStubs::cti_op_resolve_global):
4733 (JSC::JITStubs::cti_op_div):
4734 (JSC::JITStubs::cti_op_pre_dec):
4735 (JSC::JITStubs::cti_op_jless):
4736 (JSC::JITStubs::cti_op_not):
4737 (JSC::JITStubs::cti_op_jtrue):
4738 (JSC::JITStubs::cti_op_post_inc):
4739 (JSC::JITStubs::cti_op_eq):
4740 (JSC::JITStubs::cti_op_lshift):
4741 (JSC::JITStubs::cti_op_bitand):
4742 (JSC::JITStubs::cti_op_rshift):
4743 (JSC::JITStubs::cti_op_bitnot):
4744 (JSC::JITStubs::cti_op_resolve_with_base):
4745 (JSC::JITStubs::cti_op_new_func_exp):
4746 (JSC::JITStubs::cti_op_mod):
4747 (JSC::JITStubs::cti_op_less):
4748 (JSC::JITStubs::cti_op_neq):
4749 (JSC::JITStubs::cti_op_post_dec):
4750 (JSC::JITStubs::cti_op_urshift):
4751 (JSC::JITStubs::cti_op_bitxor):
4752 (JSC::JITStubs::cti_op_new_regexp):
4753 (JSC::JITStubs::cti_op_bitor):
4754 (JSC::JITStubs::cti_op_call_eval):
4755 (JSC::JITStubs::cti_op_throw):
4756 (JSC::JITStubs::cti_op_get_pnames):
4757 (JSC::JITStubs::cti_op_next_pname):
4758 (JSC::JITStubs::cti_op_push_scope):
4759 (JSC::JITStubs::cti_op_pop_scope):
4760 (JSC::JITStubs::cti_op_typeof):
4761 (JSC::JITStubs::cti_op_is_undefined):
4762 (JSC::JITStubs::cti_op_is_boolean):
4763 (JSC::JITStubs::cti_op_is_number):
4764 (JSC::JITStubs::cti_op_is_string):
4765 (JSC::JITStubs::cti_op_is_object):
4766 (JSC::JITStubs::cti_op_is_function):
4767 (JSC::JITStubs::cti_op_stricteq):
4768 (JSC::JITStubs::cti_op_to_primitive):
4769 (JSC::JITStubs::cti_op_strcat):
4770 (JSC::JITStubs::cti_op_nstricteq):
4771 (JSC::JITStubs::cti_op_to_jsnumber):
4772 (JSC::JITStubs::cti_op_in):
4773 (JSC::JITStubs::cti_op_push_new_scope):
4774 (JSC::JITStubs::cti_op_jmp_scopes):
4775 (JSC::JITStubs::cti_op_put_by_index):
4776 (JSC::JITStubs::cti_op_switch_imm):
4777 (JSC::JITStubs::cti_op_switch_char):
4778 (JSC::JITStubs::cti_op_switch_string):
4779 (JSC::JITStubs::cti_op_del_by_val):
4780 (JSC::JITStubs::cti_op_put_getter):
4781 (JSC::JITStubs::cti_op_put_setter):
4782 (JSC::JITStubs::cti_op_new_error):
4783 (JSC::JITStubs::cti_op_debug):
4784 (JSC::JITStubs::cti_vm_throw):
4786 (JSC::JITStackFrame::returnAddressSlot):
4788 2009-05-07 Darin Adler <darin@apple.com>
4790 Reviewed by Geoff Garen.
4793 (JSC::Lexer::lex): Fix missing braces. This would make us always
4794 take the slower case for string parsing and Visual Studio correctly
4795 noticed unreachable code.
4797 2009-05-07 Darin Adler <darin@apple.com>
4799 Reviewed by Sam Weinig.
4801 Bug 25589: goto instead of state machine in lexer
4802 https://bugs.webkit.org/show_bug.cgi?id=25589
4804 SunSpider is 0.8% faster.
4807 (JSC::Lexer::currentCharacter): Added.
4808 (JSC::Lexer::currentOffset): Changed to call currentCharacter for clarity.
4809 (JSC::Lexer::setCode): Removed code to set now-obsolete m_skipLineEnd.
4810 (JSC::Lexer::shiftLineTerminator): Added. Handles line numbers and the
4811 two-character line terminators.
4812 (JSC::Lexer::makeIdentifier): Changed to take characters and length rather
4813 than a vector, since we now make these directly out of the source buffer
4815 (JSC::Lexer::lastTokenWasRestrKeyword): Added.
4816 (JSC::isNonASCIIIdentStart): Broke out the non-inline part.
4817 (JSC::isIdentStart): Moved here.
4818 (JSC::isNonASCIIIdentPart): Broke out the non-inline part.
4819 (JSC::isIdentPart): Moved here.
4820 (JSC::singleEscape): Moved here, and removed some unneeded cases.
4821 (JSC::Lexer::record8): Moved here.
4822 (JSC::Lexer::record16): Moved here.
4823 (JSC::Lexer::lex): Rewrote this whole function to use goto and not use
4824 a state machine. Got rid of most of the local variables. Also rolled the
4825 matchPunctuator function in here.
4826 (JSC::Lexer::scanRegExp): Changed to use the new version of isLineTerminator.
4827 Clear m_buffer16 after using it instead of before.
4829 * parser/Lexer.h: Removed State enum, setDone function, nextLine function,
4830 lookupKeywordFunction, one of the isLineTerminator functions, m_done data member,
4831 m_skipLineEnd data member, and m_state data member. Added shiftLineTerminator
4832 function, currentCharacter function, and changed the arguments to the makeIdentifier
4833 function. Removed one branch from the isLineTerminator function.
4835 * runtime/StringPrototype.cpp:
4836 (JSC::stringProtoFuncReplace): Streamlined the case where we don't replace anything.
4838 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4840 Reviewed by Gavin Barraclough.
4842 Removed a few more special constants, and replaced them with uses of
4843 the JITStackFrame struct.
4845 Removed one of the two possible definitions of VoidPtrPair. The Mac
4846 definition was more elegant, but SunSpider doesn't think it's any
4847 faster, and it's net less elegant to have two ways of doing things.
4850 (JSC::JIT::privateCompileMainPass):
4851 (JSC::JIT::privateCompile):
4855 2009-05-07 Darin Adler <darin@apple.com>
4857 * runtime/ScopeChain.h:
4858 (JSC::ScopeChainNode::~ScopeChainNode): Tweak formatting.
4860 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
4862 Reviewed by Tor Arne Vestbø.
4864 Fix the build thread stack base determination build on Symbian,
4865 by moving the code block before PLATFORM(UNIX), which is also
4866 enabled on Symbian builds.
4868 * runtime/Collector.cpp:
4869 (JSC::currentThreadStackBase):
4871 2009-05-07 Oliver Hunt <oliver@apple.com>
4873 Reviewed by Gavin Barraclough.
4875 Fix crash due to incorrectly using an invalid scopechain
4877 stringProtoFuncReplace was checking for an exception on a CachedCall
4878 by asking for the cached callframes exception. Unfortunately this
4879 could crash in certain circumstances as CachedCall does not guarantee
4880 a valid callframe following a call. Even more unfortunately the check
4881 was entirely unnecessary as there is only a single exception slot per
4882 global data, so it was already checked via the initial exec->hadException()
4885 To make bugs like this more obvious, i've added a debug only destructor
4886 to ScopeChainNode that 0's all of its fields. This exposed a crash in
4887 the standard javascriptcore tests.
4889 * runtime/ScopeChain.h:
4890 (JSC::ScopeChainNode::~ScopeChainNode):
4891 (JSC::ScopeChain::~ScopeChain):
4892 * runtime/StringPrototype.cpp:
4893 (JSC::stringProtoFuncReplace):
4895 2009-05-07 Gavin Barraclough <barraclough@apple.com>
4897 Reviewed by Geoff Garen.
4899 Enable op_strcat across += assignments. This patch allows the lhs of a read/modify node
4900 to be included within the concatenation operation, and also modifies the implementation
4901 of the concatenation to attempt to reuse and cat onto the leftmost string, rather than
4902 always allocating a new empty output string to copy into (as was previously the behaviour).
4904 ~0.5% progression, due to a 3%-3.5% progression on the string tests (particularly validate).
4907 (JSC::BinaryOpNode::emitStrcat):
4908 (JSC::emitReadModifyAssignment):
4909 (JSC::ReadModifyResolveNode::emitBytecode):
4910 (JSC::ReadModifyDotNode::emitBytecode):
4911 (JSC::ReadModifyBracketNode::emitBytecode):
4913 * runtime/Operations.h:
4914 (JSC::concatenateStrings):
4915 * runtime/UString.cpp:
4916 (JSC::UString::reserveCapacity):
4917 * runtime/UString.h:
4919 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
4921 Reviewed by Oliver Hunt.
4923 Fix the build on Windows without JIT: interpreter/RegisterFile.h needs
4924 roundUpAllocationSize, which is protected by #if ENABLED(ASSEMBLER).
4925 Moved the #ifdef down and always offer the function.
4927 * jit/ExecutableAllocator.h:
4929 2009-05-06 Geoffrey Garen <ggaren@apple.com>
4931 Reviewed by Gavin "++" Barraclough.
4933 Added some abstraction around the JIT stub calling convention by creating
4934 a struct to represent the persistent stack frame JIT code shares with
4937 SunSpider reports no change.
4941 (JSC::JITStubs::cti_op_convert_this):
4942 (JSC::JITStubs::cti_op_end):
4943 (JSC::JITStubs::cti_op_add):
4944 (JSC::JITStubs::cti_op_pre_inc):
4945 (JSC::JITStubs::cti_timeout_check):
4946 (JSC::JITStubs::cti_register_file_check):
4947 (JSC::JITStubs::cti_op_loop_if_less):
4948 (JSC::JITStubs::cti_op_loop_if_lesseq):
4949 (JSC::JITStubs::cti_op_new_object):
4950 (JSC::JITStubs::cti_op_put_by_id_generic):
4951 (JSC::JITStubs::cti_op_get_by_id_generic):
4952 (JSC::JITStubs::cti_op_put_by_id):
4953 (JSC::JITStubs::cti_op_put_by_id_second):
4954 (JSC::JITStubs::cti_op_put_by_id_fail):
4955 (JSC::JITStubs::cti_op_get_by_id):
4956 (JSC::JITStubs::cti_op_get_by_id_second):
4957 (JSC::JITStubs::cti_op_get_by_id_self_fail):
4958 (JSC::JITStubs::cti_op_get_by_id_proto_list):
4959 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
4960 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
4961 (JSC::JITStubs::cti_op_get_by_id_array_fail):
4962 (JSC::JITStubs::cti_op_get_by_id_string_fail):
4963 (JSC::JITStubs::cti_op_instanceof):
4964 (JSC::JITStubs::cti_op_del_by_id):
4965 (JSC::JITStubs::cti_op_mul):
4966 (JSC::JITStubs::cti_op_new_func):
4967 (JSC::JITStubs::cti_op_call_JSFunction):
4968 (JSC::JITStubs::cti_op_call_arityCheck):
4969 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
4970 (JSC::JITStubs::cti_vm_lazyLinkCall):
4971 (JSC::JITStubs::cti_op_push_activation):
4972 (JSC::JITStubs::cti_op_call_NotJSFunction):
4973 (JSC::JITStubs::cti_op_create_arguments):
4974 (JSC::JITStubs::cti_op_create_arguments_no_params):
4975 (JSC::JITStubs::cti_op_tear_off_activation):
4976 (JSC::JITStubs::cti_op_tear_off_arguments):
4977 (JSC::JITStubs::cti_op_profile_will_call):
4978 (JSC::JITStubs::cti_op_profile_did_call):
4979 (JSC::JITStubs::cti_op_ret_scopeChain):
4980 (JSC::JITStubs::cti_op_new_array):
4981 (JSC::JITStubs::cti_op_resolve):
4982 (JSC::JITStubs::cti_op_construct_JSConstruct):
4983 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
4984 (JSC::JITStubs::cti_op_get_by_val):
4985 (JSC::JITStubs::cti_op_get_by_val_string):
4986 (JSC::JITStubs::cti_op_get_by_val_byte_array):
4987 (JSC::JITStubs::cti_op_resolve_func):
4988 (JSC::JITStubs::cti_op_sub):
4989 (JSC::JITStubs::cti_op_put_by_val):
4990 (JSC::JITStubs::cti_op_put_by_val_array):
4991 (JSC::JITStubs::cti_op_put_by_val_byte_array):
4992 (JSC::JITStubs::cti_op_lesseq):
4993 (JSC::JITStubs::cti_op_loop_if_true):
4994 (JSC::JITStubs::cti_op_load_varargs):
4995 (JSC::JITStubs::cti_op_negate):
4996 (JSC::JITStubs::cti_op_resolve_base):
4997 (JSC::JITStubs::cti_op_resolve_skip):
4998 (JSC::JITStubs::cti_op_resolve_global):
4999 (JSC::JITStubs::cti_op_div):
5000 (JSC::JITStubs::cti_op_pre_dec):
5001 (JSC::JITStubs::cti_op_jless):
5002 (JSC::JITStubs::cti_op_not):
5003 (JSC::JITStubs::cti_op_jtrue):
5004 (JSC::JITStubs::cti_op_post_inc):
5005 (JSC::JITStubs::cti_op_eq):
5006 (JSC::JITStubs::cti_op_lshift):
5007 (JSC::JITStubs::cti_op_bitand):
5008 (JSC::JITStubs::cti_op_rshift):
5009 (JSC::JITStubs::cti_op_bitnot):
5010 (JSC::JITStubs::cti_op_resolve_with_base):
5011 (JSC::JITStubs::cti_op_new_func_exp):
5012 (JSC::JITStubs::cti_op_mod):
5013 (JSC::JITStubs::cti_op_less):
5014 (JSC::JITStubs::cti_op_neq):
5015 (JSC::JITStubs::cti_op_post_dec):
5016 (JSC::JITStubs::cti_op_urshift):
5017 (JSC::JITStubs::cti_op_bitxor):
5018 (JSC::JITStubs::cti_op_new_regexp):
5019 (JSC::JITStubs::cti_op_bitor):
5020 (JSC::JITStubs::cti_op_call_eval):
5021 (JSC::JITStubs::cti_op_throw):
5022 (JSC::JITStubs::cti_op_get_pnames):
5023 (JSC::JITStubs::cti_op_next_pname):
5024 (JSC::JITStubs::cti_op_push_scope):
5025 (JSC::JITStubs::cti_op_pop_scope):
5026 (JSC::JITStubs::cti_op_typeof):
5027 (JSC::JITStubs::cti_op_is_undefined):
5028 (JSC::JITStubs::cti_op_is_boolean):
5029 (JSC::JITStubs::cti_op_is_number):
5030 (JSC::JITStubs::cti_op_is_string):
5031 (JSC::JITStubs::cti_op_is_object):
5032 (JSC::JITStubs::cti_op_is_function):
5033 (JSC::JITStubs::cti_op_stricteq):
5034 (JSC::JITStubs::cti_op_to_primitive):
5035 (JSC::JITStubs::cti_op_strcat):
5036 (JSC::JITStubs::cti_op_nstricteq):
5037 (JSC::JITStubs::cti_op_to_jsnumber):
5038 (JSC::JITStubs::cti_op_in):
5039 (JSC::JITStubs::cti_op_push_new_scope):
5040 (JSC::JITStubs::cti_op_jmp_scopes):
5041 (JSC::JITStubs::cti_op_put_by_index):
5042 (JSC::JITStubs::cti_op_switch_imm):
5043 (JSC::JITStubs::cti_op_switch_char):
5044 (JSC::JITStubs::cti_op_switch_string):
5045 (JSC::JITStubs::cti_op_del_by_val):
5046 (JSC::JITStubs::cti_op_put_getter):
5047 (JSC::JITStubs::cti_op_put_setter):
5048 (JSC::JITStubs::cti_op_new_error):
5049 (JSC::JITStubs::cti_op_debug):
5050 (JSC::JITStubs::cti_vm_throw):
5054 2009-05-06 Gavin Barraclough <barraclough@apple.com>
5056 Reviewed by Maciej Stachowiak & Darin Adler.
5058 Improve string concatenation (as coded in JS as a sequence of adds).
5060 Detect patterns corresponding to string concatenation, and change the bytecode
5061 generation to emit a new op_strcat instruction. By handling the full set of
5062 additions within a single function we do not need allocate JSString wrappers
5063 for intermediate results, and we can calculate the size of the output string
5064 prior to allocating storage, in order to prevent reallocation of the buffer.
5066 1.5%-2% progression on Sunspider, largely due to a 30% progression on date-format-xparb.
5068 * bytecode/CodeBlock.cpp:
5069 (JSC::CodeBlock::dump):
5071 * bytecode/Opcode.h:
5073 * bytecompiler/BytecodeGenerator.cpp:
5074 (JSC::BytecodeGenerator::emitStrcat):
5075 (JSC::BytecodeGenerator::emitToPrimitive):
5076 Add generation of new opcodes.
5077 * bytecompiler/BytecodeGenerator.h:
5078 Add generation of new opcodes.
5079 * interpreter/Interpreter.cpp:
5080 (JSC::Interpreter::privateExecute):
5081 Add implmentation of new opcodes.
5083 (JSC::JIT::privateCompileMainPass):
5084 (JSC::JIT::privateCompileSlowCases):
5085 Add implmentation of new opcodes.
5087 (JSC::JITStubs::cti_op_to_primitive):
5088 (JSC::JITStubs::cti_op_strcat):
5089 Add implmentation of new opcodes.
5091 Add implmentation of new opcodes.
5093 (JSC::BinaryOpNode::emitStrcat):
5094 (JSC::BinaryOpNode::emitBytecode):
5095 (JSC::ReadModifyResolveNode::emitBytecode):
5096 Add generation of new opcodes.
5098 (JSC::ExpressionNode::):
5100 Add methods to allow identification of add nodes.
5101 * parser/ResultType.h:
5102 (JSC::ResultType::definitelyIsString):
5103 (JSC::ResultType::forAdd):
5104 Fix error in detection of adds that will produce string results.
5105 * runtime/Operations.h:
5106 (JSC::concatenateStrings):
5107 Add implmentation of new opcodes.
5108 * runtime/UString.cpp:
5109 (JSC::UString::appendNumeric):
5110 Add methods to append numbers to an existing string.
5111 * runtime/UString.h:
5112 (JSC::UString::Rep::createEmptyBuffer):
5113 (JSC::UString::BaseString::BaseString):
5114 Add support for creating an empty string with a non-zero capacity available in the BaseString.
5116 2009-05-06 Darin Adler <darin@apple.com>
5118 Reviewed by Sam Weinig.
5120 Made RefCounted::m_refCount private.
5122 * runtime/Structure.h: Removed addressOfCount.
5123 * wtf/RefCounted.h: Made m_refCount private.
5124 Added addressOfCount.
5126 2009-05-06 Darin Adler <darin@apple.com>
5128 Fixed assertion seen a lot!
5131 (JSC::FunctionBodyNode::~FunctionBodyNode): Removed now-bogus assertion.
5133 2009-05-06 Darin Adler <darin@apple.com>
5135 Working with Sam Weinig.
5137 Redo parse tree constructor optimization without breaking the Windows
5138 build the way I did yesterday. The previous try broke the build by adding
5139 an include of Lexer.h and all its dependencies that had to work outside
5140 the JavaScriptCore project.
5142 * GNUmakefile.am: Added NodeConstructors.h.
5143 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
5145 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
5146 Removed byteocde directory -- we no longer are trying to include Lexer.h
5147 outside JavaScriptCore.
5149 * JavaScriptCore.xcodeproj/project.pbxproj: Change SegmentedVector.h
5150 and Lexer.h back to internal files. Added NodeConstructors.h.
5152 * parser/Grammar.y: Added include of NodeConstructors.h.
5153 Changed use of ConstDeclNode to use public functions.
5155 * parser/NodeConstructors.h: Copied from parser/Nodes.h.
5156 Just contains the inlined constructors now.
5158 * parser/Nodes.cpp: Added include of NodeConstructors.h.
5159 Moved node constructors into the header.
5160 (JSC::FunctionBodyNode::FunctionBodyNode): Removed m_refCount
5163 * parser/Nodes.h: Removed all the constructor definitions, and also
5164 removed the JSC_FAST_CALL from them since these are all inlined, so the
5165 calling convention is irrelevant. Made more things private. Used a data
5166 member for operator opcodes instead of a virtual function. Removed the
5167 special FunctionBodyNode::ref/deref functions since the default functions
5168 are now just as fast.
5170 * runtime/FunctionConstructor.cpp:
5171 (JSC::extractFunctionBody): Fixed types here so we don't typecast until
5172 after we do type checking.
5174 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
5176 Reviewed by Ariya Hidayat.
5178 Fix the Qt build on Windows.
5180 * JavaScriptCore.pri: Define BUILDING_JavaScriptCore/WTF to get the meaning
5181 of the JS_EXPORTDATA macros correct
5183 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
5185 Reviewed by Ariya Hidayat.
5187 Enable the JIT for the Qt build on Windows.
5189 * JavaScriptCore.pri:
5191 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
5193 Reviewed by Tor Arne Vestbø.
5195 Tweak JavaScriptCore.pri for being able to override the generated sources dir for the
5196 generated_files target.
5198 * JavaScriptCore.pri:
5200 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
5202 Reviewed by Simon Hausmann.
5204 Build QtWebKit as a framework on Mac
5206 This implies both debug and release build by default, unless
5207 one of the --debug or --release config options are passed to
5208 the build-webkit script.
5210 Frameworks can be disabled by passing CONFIG+=webkit_no_framework
5211 to the build-webkit script.
5213 To be able to build both debug and release targets in parallel
5214 we have to use separate output directories for the generated
5215 sources, which is not optimal, but required to avoid race conditions.
5217 An optimization would be to only require this spit-up on Mac.
5219 * JavaScriptCore.pri:
5220 * JavaScriptCore.pro:
5223 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
5225 Reviewed by Simon Hausmann.
5227 [Qt] Use $$GENERATED_SOURCES_DIR as output when running bison
5229 A couple of the generators left the bison output file in the source
5230 tree, and then moved it into $$GENERATED_SOURCES_DIR, which did not
5231 work well when building release and debug configurations in parallel.
5233 * JavaScriptCore.pri:
5235 2009-05-05 Geoffrey Garen <ggaren@apple.com>
5237 Reviewed by Maciej Stachowiak.
5239 Simplified a bit of codegen.
5242 (JSC::JIT::privateCompileMainPass):
5244 2009-05-05 Geoffrey Garen <ggaren@apple.com>
5246 Reviewed by Cameron Zwarich.
5248 Moved all the JIT stub related code into one place.
5257 2009-05-05 Sam Weinig <sam@webkit.org>
5259 Try to fix Windows build.
5261 Move Node constructor to the .cpp file.
5266 2009-05-05 Darin Adler <darin@apple.com>
5268 Try to fix Windows build.
5270 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5271 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5273 Try to fix Mac build.
5275 * JavaScriptCore.xcodeproj/project.pbxproj: Made SegmentedVector.h private.
5277 2009-05-05 Darin Adler <darin@apple.com>
5279 Try to fix Mac build.
5281 * JavaScriptCore.xcodeproj/project.pbxproj: Made Lexer.h private.
5283 2009-05-05 Darin Adler <darin@apple.com>
5285 Reviewed by Sam Weinig.
5287 Bug 25569: make ParserRefCounted use conventional reference counting
5288 https://bugs.webkit.org/show_bug.cgi?id=25569
5290 SunSpider speedup of about 1.6%.
5292 * JavaScriptCore.exp: Updated.
5295 (JSC::NodeReleaser::releaseAllNodes): ALWAYS_INLINE.
5296 (JSC::NodeReleaser::adopt): Ditto.
5297 (JSC::ParserRefCounted::ParserRefCounted): Removed most of the code.
5298 Add the object to a Vector<RefPtr> that gets cleared after parsing.
5299 (JSC::ParserRefCounted::~ParserRefCounted): Removed most of the code.
5301 * parser/Nodes.h: Made ParserRefCounted inherit from RefCounted and
5302 made inline versions of the constructor and destructor. Made the
5303 Node constructor inline.
5305 * parser/Parser.cpp:
5306 (JSC::Parser::parse): Call globalData->parserObjects.shrink(0) after
5307 parsing, where it used to call ParserRefCounted::deleteNewObjects.
5309 * runtime/JSGlobalData.cpp:
5310 (JSC::JSGlobalData::JSGlobalData): Eliminated code to manage the
5311 newParserObjects and parserObjectExtraRefCounts.
5312 (JSC::JSGlobalData::~JSGlobalData): Ditto.
5314 * runtime/JSGlobalData.h: Replaced the HashSet and HashCountedSet
5318 (WTF::PassRefPtr::~PassRefPtr): The most common thing to do with a
5319 PassRefPtr in hot code is to pass it and then destroy it once it's
5320 set to zero. Help the optimizer by telling it that's true.
5322 2009-05-05 Xan Lopez <xlopez@igalia.com> and Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
5324 Reviewed by Oliver Hunt.
5326 Disable the NativeFunctionWrapper for all non-Mac ports for now,
5327 as it is also crashing on Linux/x86.
5329 * runtime/NativeFunctionWrapper.h:
5331 2009-05-05 Steve Falkenburg <sfalken@apple.com>
5335 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5336 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5338 2009-05-05 Oliver Hunt <oliver@apple.com>
5340 Reviewed by Maciej Stachowiak.
5342 Expose toThisObject for the DOM Window
5344 * JavaScriptCore.exp:
5346 2009-05-05 Oliver Hunt <oliver@apple.com>
5348 Reviewed by NOBODY (Make windows go again until i work out the
5349 accursed calling convention).
5351 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5353 * runtime/NativeFunctionWrapper.h:
5355 2009-05-05 Oliver Hunt <oliver@apple.com>
5357 Reviewed by NOBODY (Fix windows debug builds).
5359 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5361 2009-05-05 Oliver Hunt <oliver@apple.com>
5363 Reviewed by NOBODY (Hopefully the last fix).
5365 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5367 2009-05-05 Oliver Hunt <oliver@apple.com>
5369 Reviewed by NOBODY (Fix the build fix caused by a different build fix).
5374 2009-05-05 Oliver Hunt <oliver@apple.com>
5376 Reviewed by NOBODY (No idea how my changes could have broken these).
5378 * runtime/DatePrototype.cpp:
5379 * runtime/RegExpObject.cpp:
5381 2009-05-05 Oliver Hunt <oliver@apple.com>
5383 Reviewed by NOBODY (Why should i expect msvc to list all the errors in a file?).
5387 2009-05-05 Oliver Hunt <oliver@apple.com>
5389 Reviewed by NOBODY (Fix warning, and another missing include).
5394 2009-05-05 Oliver Hunt <oliver@apple.com>
5396 Reviewed by NOBODY (More build fixes).
5398 * runtime/ErrorPrototype.cpp:
5399 * runtime/JSGlobalObject.cpp:
5400 * runtime/NumberPrototype.cpp:
5401 * runtime/ObjectPrototype.cpp:
5402 * runtime/StringConstructor.cpp:
5404 2009-05-05 Oliver Hunt <oliver@apple.com>
5406 Reviewed by NOBODY (Will the fixes never end?).
5408 * runtime/FunctionPrototype.h:
5409 * runtime/Lookup.cpp:
5411 2009-05-05 Oliver Hunt <oliver@apple.com>
5413 Reviewed by NOBODY (More build fixes).
5417 2009-05-05 Oliver Hunt <oliver@apple.com>
5419 Reviewed by NOBODY (More build fixing).
5421 * runtime/CallData.h:
5423 2009-05-05 Oliver Hunt <oliver@apple.com>
5425 Reviewed by NOBODY (Build fix).
5427 * runtime/ArrayConstructor.cpp:
5428 * runtime/BooleanPrototype.cpp:
5429 * runtime/DateConstructor.cpp:
5430 * runtime/Error.cpp:
5431 * runtime/ObjectConstructor.cpp:
5432 * runtime/RegExpPrototype.cpp:
5434 2009-05-05 Oliver Hunt <oliver@apple.com>
5436 Reviewed by NOBODY (Buildfix).
5440 * runtime/NativeFunctionWrapper.h: Copied from JavaScriptCore/jit/ExecutableAllocator.cpp.
5442 2009-05-05 Oliver Hunt <oliver@apple.com>
5444 Reviewed by Gavin Barraclough.
5446 Bug 25559: Improve native function call performance
5447 <https://bugs.webkit.org/show_bug.cgi?id=25559>
5449 In order to cache calls to native functions we now make the standard
5450 prototype functions use a small assembly thunk that converts the JS
5451 calling convention into the native calling convention. As this is
5452 only beneficial in the JIT we use the NativeFunctionWrapper typedef
5453 to alternate between PrototypeFunction and JSFunction to keep the
5454 code sane. This change from PrototypeFunction to NativeFunctionWrapper
5455 is the bulk of this patch.
5457 * JavaScriptCore.exp:
5458 * JavaScriptCore.xcodeproj/project.pbxproj:
5459 * assembler/MacroAssemblerX86Common.h:
5460 (JSC::MacroAssemblerX86Common::call):
5461 * assembler/MacroAssemblerX86_64.h:
5462 (JSC::MacroAssemblerX86_64::addPtr):
5463 * assembler/X86Assembler.h:
5464 (JSC::X86Assembler::leaq_mr):
5465 (JSC::X86Assembler::call_m):
5466 * interpreter/Interpreter.cpp:
5467 (JSC::Interpreter::execute):
5468 (JSC::Interpreter::prepareForRepeatCall):
5470 (JSC::JIT::privateCompileCTIMachineTrampolines):
5472 (JSC::JIT::compileCTIMachineTrampolines):
5474 (JSC::JIT::linkCall):
5475 (JSC::JIT::compileOpCallInitializeCallFrame):
5476 (JSC::JIT::compileOpCall):
5478 (JSC::JITCode::operator bool):
5479 * jit/JITInlineMethods.h:
5480 (JSC::JIT::emitGetFromCallFrameHeader):
5481 (JSC::JIT::emitGetFromCallFrameHeader32):
5483 (JSC::JITStubs::JITStubs):
5484 (JSC::JITStubs::cti_op_call_JSFunction):
5485 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
5486 (JSC::JITStubs::cti_vm_lazyLinkCall):
5487 (JSC::JITStubs::cti_op_construct_JSConstruct):
5489 (JSC::JITStubs::ctiNativeCallThunk):
5491 (GlobalObject::GlobalObject):
5493 (JSC::FunctionBodyNode::FunctionBodyNode):
5494 (JSC::FunctionBodyNode::createNativeThunk):
5495 (JSC::FunctionBodyNode::generateJITCode):
5497 (JSC::FunctionBodyNode::):
5498 (JSC::FunctionBodyNode::generatedJITCode):
5499 (JSC::FunctionBodyNode::jitCode):
5500 * profiler/Profiler.cpp:
5501 (JSC::Profiler::createCallIdentifier):
5502 * runtime/ArgList.h:
5503 * runtime/ArrayPrototype.cpp:
5504 (JSC::isNumericCompareFunction):
5505 * runtime/BooleanPrototype.cpp:
5506 (JSC::BooleanPrototype::BooleanPrototype):
5507 * runtime/DateConstructor.cpp:
5508 (JSC::DateConstructor::DateConstructor):
5509 * runtime/ErrorPrototype.cpp:
5510 (JSC::ErrorPrototype::ErrorPrototype):
5511 * runtime/FunctionPrototype.cpp:
5512 (JSC::FunctionPrototype::addFunctionProperties):
5513 (JSC::functionProtoFuncToString):
5514 * runtime/FunctionPrototype.h:
5515 * runtime/JSFunction.cpp:
5516 (JSC::JSFunction::JSFunction):
5517 (JSC::JSFunction::~JSFunction):
5518 (JSC::JSFunction::mark):
5519 (JSC::JSFunction::getCallData):
5520 (JSC::JSFunction::call):
5521 (JSC::JSFunction::argumentsGetter):
5522 (JSC::JSFunction::callerGetter):
5523 (JSC::JSFunction::lengthGetter):
5524 (JSC::JSFunction::getOwnPropertySlot):
5525 (JSC::JSFunction::put):
5526 (JSC::JSFunction::deleteProperty):
5527 (JSC::JSFunction::getConstructData):
5528 (JSC::JSFunction::construct):
5529 * runtime/JSFunction.h:
5530 (JSC::JSFunction::JSFunction):
5531 (JSC::JSFunction::setScope):
5532 (JSC::JSFunction::scope):
5533 (JSC::JSFunction::isHostFunction):
5534 (JSC::JSFunction::scopeChain):
5535 (JSC::JSFunction::clearScopeChain):
5536 (JSC::JSFunction::setScopeChain):
5537 (JSC::JSFunction::nativeFunction):
5538 (JSC::JSFunction::setNativeFunction):
5539 * runtime/JSGlobalData.cpp:
5540 (JSC::JSGlobalData::~JSGlobalData):
5541 (JSC::JSGlobalData::createNativeThunk):
5542 * runtime/JSGlobalData.h:
5543 (JSC::JSGlobalData::nativeFunctionThunk):
5544 * runtime/JSGlobalObject.cpp:
5545 (JSC::JSGlobalObject::reset):
5546 * runtime/JSGlobalObject.h:
5547 * runtime/Lookup.cpp:
5548 (JSC::setUpStaticFunctionSlot):
5550 * runtime/NumberPrototype.cpp:
5551 (JSC::NumberPrototype::NumberPrototype):
5552 * runtime/ObjectPrototype.cpp:
5553 (JSC::ObjectPrototype::ObjectPrototype):
5554 * runtime/RegExpPrototype.cpp:
5555 (JSC::RegExpPrototype::RegExpPrototype):
5556 * runtime/StringConstructor.cpp:
5557 (JSC::StringConstructor::StringConstructor):
5559 2009-05-05 Gavin Barraclough <barraclough@apple.com>
5561 Reviewed by Oliver Hunt.
5563 For convenience, let the sampling flags tool clear multiple flags at once.
5566 (GlobalObject::GlobalObject):
5567 (functionSetSamplingFlags):
5568 (functionClearSamplingFlags):
5570 2009-05-04 Maciej Stachowiak <mjs@apple.com>
5572 Rubber stamped by Gavin.
5574 - inline Vector::resize for a ~1.5% speedup on string-tagcloud
5577 (WTF::Vector::resize): Inline
5579 2009-05-03 Steve Falkenburg <sfalken@apple.com>
5583 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
5585 2009-05-03 Mark Rowe <mrowe@apple.com>
5587 Fix the 64-bit build.
5592 * runtime/JSNumberCell.cpp:
5593 (JSC::jsAPIMangledNumber):
5594 * runtime/JSNumberCell.h:
5596 2009-05-02 Sam Weinig <sam@webkit.org>
5598 Roll JSC API number marshaling back in one last time (I hope).
5600 2009-05-03 Sam Weinig <sam@webkit.org>
5602 Roll JSC API number marshaling back out. It still breaks windows.
5604 2009-05-03 Sam Weinig <sam@webkit.org>
5606 Roll JSC API number marshaling back in.
5608 2009-05-02 Darin Adler <darin@apple.com>
5610 Reviewed by Maciej Stachowiak.
5612 Bug 25519: streamline lexer by handling BOMs differently
5613 https://bugs.webkit.org/show_bug.cgi?id=25519
5615 Roughly 1% faster SunSpider.
5617 * parser/Grammar.y: Tweak formatting a bit.
5620 (JSC::Lexer::Lexer): Remove unnnecessary initialization of data members
5621 that are set up by setCode.
5622 (JSC::Lexer::currentOffset): Added. Used where the old code would look at
5624 (JSC::Lexer::shift1): Replaces the old shift function. No longer does anything
5625 to handle BOM characters.
5626 (JSC::Lexer::shift2): Ditto.
5627 (JSC::Lexer::shift3): Ditto.
5628 (JSC::Lexer::shift4): Ditto.
5629 (JSC::Lexer::setCode): Updated for name change from yylineno to m_line.
5630 Removed now-unused m_eatNextIdentifier, m_stackToken, and m_restrKeyword.
5631 Replaced m_skipLF and m_skipCR with m_skipLineEnd. Replaced the old
5632 m_length with m_codeEnd and m_currentOffset with m_codeStart. Added code
5633 to scan for a BOM character and call copyCodeWithoutBOMs() if we find any.
5634 (JSC::Lexer::copyCodeWithoutBOMs): Added.
5635 (JSC::Lexer::nextLine): Updated for name change from yylineno to m_line.
5636 (JSC::Lexer::makeIdentifier): Moved up higher in the file.
5637 (JSC::Lexer::matchPunctuator): Moved up higher in the file and changed to
5638 use a switch statement instead of just if statements.
5639 (JSC::Lexer::isLineTerminator): Moved up higher in the file and changed to
5640 have fewer branches.
5641 (JSC::Lexer::lastTokenWasRestrKeyword): Added. This replaces the old
5642 m_restrKeyword boolean.
5643 (JSC::Lexer::isIdentStart): Moved up higher in the file. Changed to use
5644 fewer branches in the ASCII but not identifier case.
5645 (JSC::Lexer::isIdentPart): Ditto.
5646 (JSC::Lexer::singleEscape): Moved up higher in the file.
5647 (JSC::Lexer::convertOctal): Moved up higher in the file.
5648 (JSC::Lexer::convertHex): Moved up higher in the file. Changed to use
5649 toASCIIHexValue instead of rolling our own here.
5650 (JSC::Lexer::convertUnicode): Ditto.
5651 (JSC::Lexer::record8): Moved up higher in the file.
5652 (JSC::Lexer::record16): Moved up higher in the file.
5653 (JSC::Lexer::lex): Changed type of stringType to int. Replaced m_skipLF
5654 and m_skipCR with m_skipLineEnd, which requires fewer branches in the
5655 main lexer loop. Use currentOffset instead of m_currentOffset. Removed
5656 unneeded m_stackToken. Use isASCIIDigit instead of isDecimalDigit.
5657 Split out the two cases for InIdentifierOrKeyword and InIdentifier.
5658 Added special case tight loops for identifiers and other simple states.
5659 Removed a branch from the code that sets m_atLineStart to false using goto.
5660 Streamlined the number-handling code so we don't check for the same types
5661 twice for non-numeric cases and don't add a null to m_buffer8 when it's
5662 not being used. Removed m_eatNextIdentifier, which wasn't working anyway,
5663 and m_restrKeyword, which is redundant with m_lastToken. Set the
5664 m_delimited flag without using a branch.
5665 (JSC::Lexer::scanRegExp): Tweaked style a bit.
5666 (JSC::Lexer::clear): Clear m_codeWithoutBOMs so we don't use memory after
5667 parsing. Clear out UString objects in the more conventional way.
5668 (JSC::Lexer::sourceCode): Made this no-longer inline since it has more
5669 work to do in the case where we stripped BOMs.
5671 * parser/Lexer.h: Renamed yylineno to m_lineNumber. Removed convertHex
5672 function, which is the same as toASCIIHexValue. Removed isHexDigit
5673 function, which is the same as isASCIIHedDigit. Replaced shift with four
5674 separate shift functions. Removed isWhiteSpace function that passes
5675 m_current, instead just passing m_current explicitly. Removed isOctalDigit,
5676 which is the same as isASCIIOctalDigit. Eliminated unused arguments from
5677 matchPunctuator. Added copyCoodeWithoutBOMs and currentOffset. Moved the
5678 makeIdentifier function out of the header. Added lastTokenWasRestrKeyword
5679 function. Added new constants for m_skipLineEnd. Removed unused yycolumn,
5680 m_restrKeyword, m_skipLF, m_skipCR, m_eatNextIdentifier, m_stackToken,
5681 m_position, m_length, m_currentOffset, m_nextOffset1, m_nextOffset2,
5682 m_nextOffset3. Added m_skipLineEnd, m_codeStart, m_codeEnd, and
5685 * parser/SourceProvider.h: Added hasBOMs function. In the future this can
5686 be used to tell the lexer about strings known not to have BOMs.
5688 * runtime/JSGlobalObjectFunctions.cpp:
5689 (JSC::globalFuncUnescape): Changed to use isASCIIHexDigit.
5691 * wtf/ASCIICType.h: Added using statements to match the design of the
5694 2009-05-02 Ada Chan <adachan@apple.com>
5696 Fix windows build (when doing a clean build)
5698 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5700 2009-05-02 Geoffrey Garen <ggaren@apple.com>
5702 Reviewed by Sam Weinig.
5704 Simplified null-ish JSValues.
5706 Replaced calls to noValue() with calls to JSValue() (which is what
5707 noValue() returned). Removed noValue().
5709 Replaced almost all uses of jsImpossibleValue() with uses of JSValue().
5710 Its one remaining use is for construction of hash table deleted values.
5711 For that specific task, I made a new, private constructor with a special
5712 tag. Removed jsImpossibleValue().
5714 Removed "JSValue()" initialiazers, since default construction happens...
5717 * API/JSCallbackObjectFunctions.h:
5719 * bytecompiler/BytecodeGenerator.cpp:
5720 (JSC::BytecodeGenerator::emitLoad):
5721 * bytecompiler/BytecodeGenerator.h:
5722 * debugger/DebuggerCallFrame.cpp:
5723 (JSC::DebuggerCallFrame::evaluate):
5724 * debugger/DebuggerCallFrame.h:
5725 (JSC::DebuggerCallFrame::DebuggerCallFrame):
5726 * interpreter/CallFrame.h:
5727 (JSC::ExecState::clearException):
5728 * interpreter/Interpreter.cpp:
5729 (JSC::Interpreter::privateExecute):
5730 (JSC::Interpreter::retrieveLastCaller):
5731 * interpreter/Register.h:
5732 (JSC::Register::Register):
5734 (JSC::JIT::unlinkCall):
5735 (JSC::JIT::compileOpCallInitializeCallFrame):
5736 (JSC::JIT::compileOpCall):
5738 (JSC::JITStubs::cti_op_call_eval):
5739 (JSC::JITStubs::cti_vm_throw):
5740 * profiler/Profiler.cpp:
5741 (JSC::Profiler::willExecute):
5742 (JSC::Profiler::didExecute):
5743 * runtime/ArrayPrototype.cpp:
5745 * runtime/Completion.cpp:
5747 * runtime/Completion.h:
5748 (JSC::Completion::Completion):
5749 * runtime/GetterSetter.cpp:
5750 (JSC::GetterSetter::getPrimitiveNumber):
5751 * runtime/JSArray.cpp:
5752 (JSC::JSArray::putSlowCase):
5753 (JSC::JSArray::deleteProperty):
5754 (JSC::JSArray::increaseVectorLength):
5755 (JSC::JSArray::setLength):
5756 (JSC::JSArray::pop):
5757 (JSC::JSArray::sort):
5758 (JSC::JSArray::compactForSorting):
5759 * runtime/JSCell.cpp:
5760 (JSC::JSCell::getJSNumber):
5762 (JSC::JSValue::getJSNumber):
5763 * runtime/JSGlobalData.cpp:
5764 (JSC::JSGlobalData::JSGlobalData):
5765 * runtime/JSImmediate.h:
5766 (JSC::JSImmediate::fromNumberOutsideIntegerRange):
5767 (JSC::JSImmediate::from):
5768 * runtime/JSNumberCell.cpp:
5769 (JSC::jsNumberCell):
5770 * runtime/JSObject.cpp:
5771 (JSC::callDefaultValueFunction):
5772 * runtime/JSObject.h:
5773 (JSC::JSObject::getDirect):
5774 * runtime/JSPropertyNameIterator.cpp:
5775 (JSC::JSPropertyNameIterator::toPrimitive):
5776 * runtime/JSPropertyNameIterator.h:
5777 (JSC::JSPropertyNameIterator::next):
5778 * runtime/JSValue.h:
5780 (JSC::JSValueHashTraits::constructDeletedValue):
5781 (JSC::JSValueHashTraits::isDeletedValue):
5782 (JSC::JSValue::JSValue):
5783 * runtime/JSWrapperObject.h:
5784 (JSC::JSWrapperObject::JSWrapperObject):
5785 * runtime/Operations.h:
5787 * runtime/PropertySlot.h:
5788 (JSC::PropertySlot::clearBase):
5789 (JSC::PropertySlot::clearValue):
5791 2009-05-02 Maciej Stachowiak <mjs@apple.com>
5793 Reviewed by Cameron Zwarich.
5795 - speed up the lexer in various ways
5797 ~2% command-line SunSpider speedup
5800 (JSC::Lexer::setCode): Moved below shift() so it can inline.
5801 (JSC::Lexer::scanRegExp): Use resize(0) instead of clear() on Vectors, since the intent
5802 here is not to free the underlying buffer.
5803 (JSC::Lexer::lex): ditto; also, change the loop logic a bit for the main lexing loop
5804 to avoid branching on !m_done twice per iteration. Now we only check it once.
5805 (JSC::Lexer::shift): Make this ALWAYS_INLINE and tag an unusual branch as UNLIKELY
5807 (JSC::Lexer::makeIdentifier): force to be ALWAYS_INLINE
5809 (WTF::::append): force to be ALWAYS_INLINE (may have helped in ways other than parsing but it wasn't
5810 getting inlined in a hot code path in the lexer)
5812 2009-05-01 Steve Falkenburg <sfalken@apple.com>
5816 * JavaScriptCore.vcproj/JavaScriptCore.make:
5818 2009-05-01 Sam Weinig <sam@webkit.org>
5822 * runtime/JSNumberCell.h:
5823 (JSC::JSValue::JSValue):
5824 * runtime/JSValue.h:
5827 2009-05-01 Sam Weinig <sam@webkit.org>
5829 Roll out JavaScriptCore API number marshaling.
5836 (JSCheckScriptSyntax):
5837 * API/JSCallbackConstructor.cpp:
5838 (JSC::constructJSCallback):
5839 * API/JSCallbackFunction.cpp:
5840 (JSC::JSCallbackFunction::call):
5841 * API/JSCallbackObjectFunctions.h:
5842 (JSC::::getOwnPropertySlot):
5844 (JSC::::deleteProperty):
5846 (JSC::::hasInstance):
5850 (JSC::::staticValueGetter):
5851 (JSC::::callbackGetter):
5852 * API/JSObjectRef.cpp:
5853 (JSObjectMakeFunction):
5854 (JSObjectMakeArray):
5856 (JSObjectMakeError):
5857 (JSObjectMakeRegExp):
5858 (JSObjectGetPrototype):
5859 (JSObjectSetPrototype):
5860 (JSObjectGetProperty):
5861 (JSObjectSetProperty):
5862 (JSObjectGetPropertyAtIndex):
5863 (JSObjectSetPropertyAtIndex):
5864 (JSObjectDeleteProperty):
5865 (JSObjectCallAsFunction):
5866 (JSObjectCallAsConstructor):
5867 * API/JSValueRef.cpp:
5869 (JSValueIsUndefined):
5875 (JSValueIsObjectOfClass):
5877 (JSValueIsStrictEqual):
5878 (JSValueIsInstanceOfConstructor):
5879 (JSValueMakeUndefined):
5881 (JSValueMakeBoolean):
5882 (JSValueMakeNumber):
5883 (JSValueMakeString):
5886 (JSValueToStringCopy):
5890 * JavaScriptCore.exp:
5891 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5892 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5893 * runtime/JSNumberCell.cpp:
5894 * runtime/JSNumberCell.h:
5895 * runtime/JSValue.h:
5897 2009-05-01 Sam Weinig <sam@webkit.org>
5901 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5902 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5904 2009-05-01 Sam Weinig <sam@webkit.org>
5908 * JavaScriptCore.exp:
5910 2009-05-01 Sam Weinig <sam@webkit.org>
5912 Reviewed by Geoffrey "Too Far!" Garen.
5914 Move JS number construction into JSValue.
5916 * runtime/JSImmediate.h:
5917 * runtime/JSNumberCell.h:
5918 (JSC::JSValue::JSValue):
5919 * runtime/JSValue.h:
5922 2009-05-01 Sam Weinig <sam@webkit.org>
5924 Reviewed by Geoff "The Minneapolis" Garen.
5926 Add mechanism to vend heap allocated JS numbers to JavaScriptCore API clients with a
5927 representation that is independent of the number representation in the VM.
5928 - Numbers leaving the interpreter are converted to a tagged JSNumberCell.
5929 - The numbers coming into the interpreter (asserted to be the tagged JSNumberCell) are
5930 converted back to the VM's internal number representation.
5937 (JSCheckScriptSyntax):
5938 * API/JSCallbackConstructor.cpp:
5939 (JSC::constructJSCallback):
5940 * API/JSCallbackFunction.cpp:
5941 (JSC::JSCallbackFunction::call):
5942 * API/JSCallbackObjectFunctions.h:
5943 (JSC::::getOwnPropertySlot):
5945 (JSC::::deleteProperty):
5947 (JSC::::hasInstance):
5951 (JSC::::staticValueGetter):
5952 (JSC::::callbackGetter):
5953 * API/JSObjectRef.cpp:
5954 (JSObjectMakeFunction):
5955 (JSObjectMakeArray):
5957 (JSObjectMakeError):
5958 (JSObjectMakeRegExp):
5959 (JSObjectGetPrototype):
5960 (JSObjectSetPrototype):
5961 (JSObjectGetProperty):
5962 (JSObjectSetProperty):
5963 (JSObjectGetPropertyAtIndex):
5964 (JSObjectSetPropertyAtIndex):
5965 (JSObjectDeleteProperty):
5966 (JSObjectCallAsFunction):
5967 (JSObjectCallAsConstructor):
5968 * API/JSValueRef.cpp:
5970 (JSValueIsUndefined):
5976 (JSValueIsObjectOfClass):
5978 (JSValueIsStrictEqual):
5979 (JSValueIsInstanceOfConstructor):
5980 (JSValueMakeUndefined):
5982 (JSValueMakeBoolean):
5983 (JSValueMakeNumber):
5984 (JSValueMakeString):
5987 (JSValueToStringCopy):
5991 * runtime/JSNumberCell.cpp:
5992 (JSC::jsAPIMangledNumber):
5993 * runtime/JSNumberCell.h:
5994 (JSC::JSNumberCell::isAPIMangledNumber):
5995 (JSC::JSNumberCell::):
5996 (JSC::JSNumberCell::JSNumberCell):
5997 (JSC::JSValue::isAPIMangledNumber):
5998 * runtime/JSValue.h:
6000 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6002 Windows build fix take 6.
6004 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6006 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6008 Windows build fix take 5.
6010 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6012 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6014 Windows build fix take 4.
6016 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6018 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6020 Windows build fix take 3.
6022 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6024 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6026 Windows build fix take 2.
6028 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6030 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6032 Windows build fix take 1.
6034 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6035 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6037 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6039 Rubber Stamped by Sam Weinig.
6041 Renamed JSValuePtr => JSValue.
6046 * API/JSCallbackConstructor.h:
6047 (JSC::JSCallbackConstructor::createStructure):
6048 * API/JSCallbackFunction.cpp:
6049 (JSC::JSCallbackFunction::call):
6050 * API/JSCallbackFunction.h:
6051 (JSC::JSCallbackFunction::createStructure):
6052 * API/JSCallbackObject.h:
6053 (JSC::JSCallbackObject::createStructure):
6054 * API/JSCallbackObjectFunctions.h:
6055 (JSC::::asCallbackObject):
6057 (JSC::::hasInstance):
6059 (JSC::::staticValueGetter):
6060 (JSC::::staticFunctionGetter):
6061 (JSC::::callbackGetter):
6062 * API/JSContextRef.cpp:
6063 * API/JSObjectRef.cpp:
6064 (JSObjectMakeConstructor):
6065 (JSObjectSetPrototype):
6066 (JSObjectGetProperty):
6067 (JSObjectSetProperty):
6068 (JSObjectGetPropertyAtIndex):
6069 (JSObjectSetPropertyAtIndex):
6070 * API/JSValueRef.cpp:
6072 (JSValueIsUndefined):
6078 (JSValueIsObjectOfClass):
6080 (JSValueIsStrictEqual):
6081 (JSValueIsInstanceOfConstructor):
6084 (JSValueToStringCopy):
6088 * JavaScriptCore.exp:
6089 * bytecode/CodeBlock.cpp:
6090 (JSC::valueToSourceString):
6091 (JSC::constantName):
6092 (JSC::CodeBlock::dump):
6093 * bytecode/CodeBlock.h:
6094 (JSC::CodeBlock::getConstant):
6095 (JSC::CodeBlock::addUnexpectedConstant):
6096 (JSC::CodeBlock::unexpectedConstant):
6097 * bytecode/EvalCodeCache.h:
6098 (JSC::EvalCodeCache::get):
6099 * bytecompiler/BytecodeGenerator.cpp:
6100 (JSC::BytecodeGenerator::addConstant):
6101 (JSC::BytecodeGenerator::addUnexpectedConstant):
6102 (JSC::BytecodeGenerator::emitLoad):
6103 (JSC::BytecodeGenerator::emitGetScopedVar):
6104 (JSC::BytecodeGenerator::emitPutScopedVar):
6105 (JSC::BytecodeGenerator::emitNewError):
6106 (JSC::keyForImmediateSwitch):
6107 * bytecompiler/BytecodeGenerator.h:
6108 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
6109 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
6110 * debugger/Debugger.cpp:
6111 (JSC::evaluateInGlobalCallFrame):
6112 * debugger/Debugger.h:
6113 * debugger/DebuggerActivation.cpp:
6114 (JSC::DebuggerActivation::put):
6115 (JSC::DebuggerActivation::putWithAttributes):
6116 (JSC::DebuggerActivation::lookupGetter):
6117 (JSC::DebuggerActivation::lookupSetter):
6118 * debugger/DebuggerActivation.h:
6119 (JSC::DebuggerActivation::createStructure):
6120 * debugger/DebuggerCallFrame.cpp:
6121 (JSC::DebuggerCallFrame::evaluate):
6122 * debugger/DebuggerCallFrame.h:
6123 (JSC::DebuggerCallFrame::DebuggerCallFrame):
6124 (JSC::DebuggerCallFrame::exception):
6125 * interpreter/CachedCall.h:
6126 (JSC::CachedCall::CachedCall):
6127 (JSC::CachedCall::call):
6128 (JSC::CachedCall::setThis):
6129 (JSC::CachedCall::setArgument):
6130 * interpreter/CallFrame.cpp:
6131 (JSC::CallFrame::thisValue):
6132 (JSC::CallFrame::dumpCaller):
6133 * interpreter/CallFrame.h:
6134 (JSC::ExecState::setException):
6135 (JSC::ExecState::exception):
6136 (JSC::ExecState::exceptionSlot):
6137 * interpreter/CallFrameClosure.h:
6138 (JSC::CallFrameClosure::setArgument):
6139 * interpreter/Interpreter.cpp:
6140 (JSC::Interpreter::resolve):
6141 (JSC::Interpreter::resolveSkip):
6142 (JSC::Interpreter::resolveGlobal):
6143 (JSC::Interpreter::resolveBase):
6144 (JSC::Interpreter::resolveBaseAndProperty):
6145 (JSC::Interpreter::resolveBaseAndFunc):
6147 (JSC::Interpreter::callEval):
6148 (JSC::Interpreter::unwindCallFrame):
6149 (JSC::Interpreter::throwException):
6150 (JSC::Interpreter::execute):
6151 (JSC::Interpreter::prepareForRepeatCall):
6152 (JSC::Interpreter::createExceptionScope):
6153 (JSC::Interpreter::tryCachePutByID):
6154 (JSC::Interpreter::tryCacheGetByID):
6155 (JSC::Interpreter::privateExecute):
6156 (JSC::Interpreter::retrieveArguments):
6157 (JSC::Interpreter::retrieveCaller):
6158 (JSC::Interpreter::retrieveLastCaller):
6159 * interpreter/Interpreter.h:
6160 * interpreter/Register.h:
6162 (JSC::Register::Register):
6163 (JSC::Register::jsValue):
6166 (JSC::JIT::privateCompileMainPass):
6168 * jit/JITArithmetic.cpp:
6169 (JSC::JIT::compileFastArith_op_mod):
6171 (JSC::JIT::unlinkCall):
6172 (JSC::JIT::compileOpCallInitializeCallFrame):
6173 (JSC::JIT::compileOpCall):
6176 (JSC::JITCode::execute):
6177 * jit/JITInlineMethods.h:
6178 (JSC::JIT::emitGetVirtualRegister):
6179 (JSC::JIT::getConstantOperand):
6180 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
6181 (JSC::JIT::emitInitRegister):
6182 * jit/JITPropertyAccess.cpp:
6183 (JSC::JIT::privateCompilePutByIdTransition):
6184 (JSC::JIT::patchGetByIdSelf):
6185 (JSC::JIT::patchPutByIdReplace):
6186 (JSC::JIT::privateCompileGetByIdSelf):
6187 (JSC::JIT::privateCompileGetByIdProto):
6188 (JSC::JIT::privateCompileGetByIdSelfList):
6189 (JSC::JIT::privateCompileGetByIdProtoList):
6190 (JSC::JIT::privateCompileGetByIdChainList):
6191 (JSC::JIT::privateCompileGetByIdChain):
6192 (JSC::JIT::privateCompilePutByIdReplace):
6194 (JSC::JITStubs::tryCachePutByID):
6195 (JSC::JITStubs::tryCacheGetByID):
6196 (JSC::JITStubs::cti_op_convert_this):
6197 (JSC::JITStubs::cti_op_add):
6198 (JSC::JITStubs::cti_op_pre_inc):
6199 (JSC::JITStubs::cti_op_loop_if_less):
6200 (JSC::JITStubs::cti_op_loop_if_lesseq):
6201 (JSC::JITStubs::cti_op_get_by_id_generic):
6202 (JSC::JITStubs::cti_op_get_by_id):
6203 (JSC::JITStubs::cti_op_get_by_id_second):
6204 (JSC::JITStubs::cti_op_get_by_id_self_fail):
6205 (JSC::JITStubs::cti_op_get_by_id_proto_list):
6206 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
6207 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
6208 (JSC::JITStubs::cti_op_get_by_id_array_fail):
6209 (JSC::JITStubs::cti_op_get_by_id_string_fail):
6210 (JSC::JITStubs::cti_op_instanceof):
6211 (JSC::JITStubs::cti_op_del_by_id):
6212 (JSC::JITStubs::cti_op_mul):
6213 (JSC::JITStubs::cti_op_call_NotJSFunction):
6214 (JSC::JITStubs::cti_op_resolve):
6215 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
6216 (JSC::JITStubs::cti_op_get_by_val):
6217 (JSC::JITStubs::cti_op_get_by_val_string):
6218 (JSC::JITStubs::cti_op_get_by_val_byte_array):
6219 (JSC::JITStubs::cti_op_resolve_func):
6220 (JSC::JITStubs::cti_op_sub):
6221 (JSC::JITStubs::cti_op_put_by_val):
6222 (JSC::JITStubs::cti_op_put_by_val_array):
6223 (JSC::JITStubs::cti_op_put_by_val_byte_array):
6224 (JSC::JITStubs::cti_op_lesseq):
6225 (JSC::JITStubs::cti_op_loop_if_true):
6226 (JSC::JITStubs::cti_op_load_varargs):
6227 (JSC::JITStubs::cti_op_negate):
6228 (JSC::JITStubs::cti_op_resolve_base):
6229 (JSC::JITStubs::cti_op_resolve_skip):
6230 (JSC::JITStubs::cti_op_resolve_global):
6231 (JSC::JITStubs::cti_op_div):
6232 (JSC::JITStubs::cti_op_pre_dec):
6233 (JSC::JITStubs::cti_op_jless):
6234 (JSC::JITStubs::cti_op_not):
6235 (JSC::JITStubs::cti_op_jtrue):
6236 (JSC::JITStubs::cti_op_post_inc):
6237 (JSC::JITStubs::cti_op_eq):
6238 (JSC::JITStubs::cti_op_lshift):
6239 (JSC::JITStubs::cti_op_bitand):
6240 (JSC::JITStubs::cti_op_rshift):
6241 (JSC::JITStubs::cti_op_bitnot):
6242 (JSC::JITStubs::cti_op_resolve_with_base):
6243 (JSC::JITStubs::cti_op_mod):
6244 (JSC::JITStubs::cti_op_less):
6245 (JSC::JITStubs::cti_op_neq):
6246 (JSC::JITStubs::cti_op_post_dec):
6247 (JSC::JITStubs::cti_op_urshift):
6248 (JSC::JITStubs::cti_op_bitxor):
6249 (JSC::JITStubs::cti_op_bitor):
6250 (JSC::JITStubs::cti_op_call_eval):
6251 (JSC::JITStubs::cti_op_throw):
6252 (JSC::JITStubs::cti_op_next_pname):
6253 (JSC::JITStubs::cti_op_typeof):
6254 (JSC::JITStubs::cti_op_is_undefined):
6255 (JSC::JITStubs::cti_op_is_boolean):
6256 (JSC::JITStubs::cti_op_is_number):
6257 (JSC::JITStubs::cti_op_is_string):
6258 (JSC::JITStubs::cti_op_is_object):
6259 (JSC::JITStubs::cti_op_is_function):
6260 (JSC::JITStubs::cti_op_stricteq):
6261 (JSC::JITStubs::cti_op_nstricteq):
6262 (JSC::JITStubs::cti_op_to_jsnumber):
6263 (JSC::JITStubs::cti_op_in):
6264 (JSC::JITStubs::cti_op_switch_imm):
6265 (JSC::JITStubs::cti_op_switch_char):
6266 (JSC::JITStubs::cti_op_switch_string):
6267 (JSC::JITStubs::cti_op_del_by_val):
6268 (JSC::JITStubs::cti_op_new_error):
6269 (JSC::JITStubs::cti_vm_throw):
6278 (functionSetSamplingFlag):
6279 (functionClearSamplingFlag):
6283 (JSC::processClauseList):
6284 * profiler/ProfileGenerator.cpp:
6285 (JSC::ProfileGenerator::addParentForConsoleStart):
6286 * profiler/Profiler.cpp:
6287 (JSC::Profiler::willExecute):
6288 (JSC::Profiler::didExecute):
6289 (JSC::Profiler::createCallIdentifier):
6290 * profiler/Profiler.h:
6291 * runtime/ArgList.cpp:
6292 (JSC::MarkedArgumentBuffer::slowAppend):
6293 * runtime/ArgList.h:
6294 (JSC::MarkedArgumentBuffer::at):
6295 (JSC::MarkedArgumentBuffer::append):
6296 (JSC::ArgList::ArgList):
6298 * runtime/Arguments.cpp:
6299 (JSC::Arguments::put):
6300 * runtime/Arguments.h:
6301 (JSC::Arguments::createStructure):
6303 * runtime/ArrayConstructor.cpp:
6304 (JSC::callArrayConstructor):
6305 * runtime/ArrayPrototype.cpp:
6308 (JSC::arrayProtoFuncToString):
6309 (JSC::arrayProtoFuncToLocaleString):
6310 (JSC::arrayProtoFuncJoin):
6311 (JSC::arrayProtoFuncConcat):
6312 (JSC::arrayProtoFuncPop):
6313 (JSC::arrayProtoFuncPush):
6314 (JSC::arrayProtoFuncReverse):
6315 (JSC::arrayProtoFuncShift):
6316 (JSC::arrayProtoFuncSlice):
6317 (JSC::arrayProtoFuncSort):
6318 (JSC::arrayProtoFuncSplice):
6319 (JSC::arrayProtoFuncUnShift):
6320 (JSC::arrayProtoFuncFilter):
6321 (JSC::arrayProtoFuncMap):
6322 (JSC::arrayProtoFuncEvery):
6323 (JSC::arrayProtoFuncForEach):
6324 (JSC::arrayProtoFuncSome):
6325 (JSC::arrayProtoFuncReduce):
6326 (JSC::arrayProtoFuncReduceRight):
6327 (JSC::arrayProtoFuncIndexOf):
6328 (JSC::arrayProtoFuncLastIndexOf):
6329 * runtime/BooleanConstructor.cpp:
6330 (JSC::callBooleanConstructor):
6331 (JSC::constructBooleanFromImmediateBoolean):
6332 * runtime/BooleanConstructor.h:
6333 * runtime/BooleanObject.h:
6334 (JSC::asBooleanObject):
6335 * runtime/BooleanPrototype.cpp:
6336 (JSC::booleanProtoFuncToString):
6337 (JSC::booleanProtoFuncValueOf):
6338 * runtime/CallData.cpp:
6340 * runtime/CallData.h:
6341 * runtime/Collector.cpp:
6342 (JSC::Heap::protect):
6343 (JSC::Heap::unprotect):
6345 * runtime/Collector.h:
6346 * runtime/Completion.cpp:
6348 * runtime/Completion.h:
6349 (JSC::Completion::Completion):
6350 (JSC::Completion::value):
6351 (JSC::Completion::setValue):
6352 * runtime/ConstructData.cpp:
6354 * runtime/ConstructData.h:
6355 * runtime/DateConstructor.cpp:
6356 (JSC::constructDate):
6361 * runtime/DateInstance.h:
6362 (JSC::asDateInstance):
6363 * runtime/DatePrototype.cpp:
6364 (JSC::dateProtoFuncToString):
6365 (JSC::dateProtoFuncToUTCString):
6366 (JSC::dateProtoFuncToDateString):
6367 (JSC::dateProtoFuncToTimeString):
6368 (JSC::dateProtoFuncToLocaleString):
6369 (JSC::dateProtoFuncToLocaleDateString):
6370 (JSC::dateProtoFuncToLocaleTimeString):
6371 (JSC::dateProtoFuncGetTime):
6372 (JSC::dateProtoFuncGetFullYear):
6373 (JSC::dateProtoFuncGetUTCFullYear):
6374 (JSC::dateProtoFuncToGMTString):
6375 (JSC::dateProtoFuncGetMonth):
6376 (JSC::dateProtoFuncGetUTCMonth):
6377 (JSC::dateProtoFuncGetDate):
6378 (JSC::dateProtoFuncGetUTCDate):
6379 (JSC::dateProtoFuncGetDay):
6380 (JSC::dateProtoFuncGetUTCDay):
6381 (JSC::dateProtoFuncGetHours):
6382 (JSC::dateProtoFuncGetUTCHours):
6383 (JSC::dateProtoFuncGetMinutes):
6384 (JSC::dateProtoFuncGetUTCMinutes):
6385 (JSC::dateProtoFuncGetSeconds):
6386 (JSC::dateProtoFuncGetUTCSeconds):
6387 (JSC::dateProtoFuncGetMilliSeconds):
6388 (JSC::dateProtoFuncGetUTCMilliseconds):
6389 (JSC::dateProtoFuncGetTimezoneOffset):
6390 (JSC::dateProtoFuncSetTime):
6391 (JSC::setNewValueFromTimeArgs):
6392 (JSC::setNewValueFromDateArgs):
6393 (JSC::dateProtoFuncSetMilliSeconds):
6394 (JSC::dateProtoFuncSetUTCMilliseconds):
6395 (JSC::dateProtoFuncSetSeconds):
6396 (JSC::dateProtoFuncSetUTCSeconds):
6397 (JSC::dateProtoFuncSetMinutes):
6398 (JSC::dateProtoFuncSetUTCMinutes):
6399 (JSC::dateProtoFuncSetHours):
6400 (JSC::dateProtoFuncSetUTCHours):
6401 (JSC::dateProtoFuncSetDate):
6402 (JSC::dateProtoFuncSetUTCDate):
6403 (JSC::dateProtoFuncSetMonth):
6404 (JSC::dateProtoFuncSetUTCMonth):
6405 (JSC::dateProtoFuncSetFullYear):
6406 (JSC::dateProtoFuncSetUTCFullYear):
6407 (JSC::dateProtoFuncSetYear):
6408 (JSC::dateProtoFuncGetYear):
6409 * runtime/DatePrototype.h:
6410 (JSC::DatePrototype::createStructure):
6411 * runtime/ErrorConstructor.cpp:
6412 (JSC::callErrorConstructor):
6413 * runtime/ErrorPrototype.cpp:
6414 (JSC::errorProtoFuncToString):
6415 * runtime/ExceptionHelpers.cpp:
6416 (JSC::createInterruptedExecutionException):
6418 (JSC::createStackOverflowError):
6419 (JSC::createUndefinedVariableError):
6420 (JSC::createErrorMessage):
6421 (JSC::createInvalidParamError):
6422 (JSC::createNotAConstructorError):
6423 (JSC::createNotAFunctionError):
6424 * runtime/ExceptionHelpers.h:
6425 * runtime/FunctionConstructor.cpp:
6426 (JSC::callFunctionConstructor):
6427 * runtime/FunctionPrototype.cpp:
6428 (JSC::callFunctionPrototype):
6429 (JSC::functionProtoFuncToString):
6430 (JSC::functionProtoFuncApply):
6431 (JSC::functionProtoFuncCall):
6432 * runtime/FunctionPrototype.h:
6433 (JSC::FunctionPrototype::createStructure):
6434 * runtime/GetterSetter.cpp:
6435 (JSC::GetterSetter::toPrimitive):
6436 (JSC::GetterSetter::getPrimitiveNumber):
6437 * runtime/GetterSetter.h:
6438 (JSC::asGetterSetter):
6439 * runtime/InternalFunction.cpp:
6440 (JSC::InternalFunction::displayName):
6441 * runtime/InternalFunction.h:
6442 (JSC::InternalFunction::createStructure):
6443 (JSC::asInternalFunction):
6444 * runtime/JSActivation.cpp:
6445 (JSC::JSActivation::getOwnPropertySlot):
6446 (JSC::JSActivation::put):
6447 (JSC::JSActivation::putWithAttributes):
6448 (JSC::JSActivation::argumentsGetter):
6449 * runtime/JSActivation.h:
6450 (JSC::JSActivation::createStructure):
6451 (JSC::asActivation):
6452 * runtime/JSArray.cpp:
6454 (JSC::JSArray::JSArray):
6455 (JSC::JSArray::getOwnPropertySlot):
6456 (JSC::JSArray::put):
6457 (JSC::JSArray::putSlowCase):
6458 (JSC::JSArray::deleteProperty):
6459 (JSC::JSArray::setLength):
6460 (JSC::JSArray::pop):
6461 (JSC::JSArray::push):
6462 (JSC::JSArray::mark):
6463 (JSC::compareNumbersForQSort):
6464 (JSC::JSArray::sortNumeric):
6465 (JSC::JSArray::sort):
6466 (JSC::JSArray::compactForSorting):
6467 (JSC::JSArray::checkConsistency):
6468 (JSC::constructArray):
6469 * runtime/JSArray.h:
6470 (JSC::JSArray::getIndex):
6471 (JSC::JSArray::setIndex):
6472 (JSC::JSArray::createStructure):
6475 * runtime/JSByteArray.cpp:
6476 (JSC::JSByteArray::createStructure):
6477 (JSC::JSByteArray::put):
6478 * runtime/JSByteArray.h:
6479 (JSC::JSByteArray::getIndex):
6480 (JSC::JSByteArray::setIndex):
6482 (JSC::isJSByteArray):
6483 * runtime/JSCell.cpp:
6485 (JSC::JSCell::getJSNumber):
6488 (JSC::JSValue::asCell):
6489 (JSC::JSValue::isString):
6490 (JSC::JSValue::isGetterSetter):
6491 (JSC::JSValue::isObject):
6492 (JSC::JSValue::getString):
6493 (JSC::JSValue::getObject):
6494 (JSC::JSValue::getCallData):
6495 (JSC::JSValue::getConstructData):
6496 (JSC::JSValue::getUInt32):
6497 (JSC::JSValue::getTruncatedInt32):
6498 (JSC::JSValue::getTruncatedUInt32):
6499 (JSC::JSValue::mark):
6500 (JSC::JSValue::marked):
6501 (JSC::JSValue::toPrimitive):
6502 (JSC::JSValue::getPrimitiveNumber):
6503 (JSC::JSValue::toBoolean):
6504 (JSC::JSValue::toNumber):
6505 (JSC::JSValue::toString):
6506 (JSC::JSValue::toObject):
6507 (JSC::JSValue::toThisObject):
6508 (JSC::JSValue::needsThisConversion):
6509 (JSC::JSValue::toThisString):
6510 (JSC::JSValue::getJSNumber):
6511 * runtime/JSFunction.cpp:
6512 (JSC::JSFunction::call):
6513 (JSC::JSFunction::argumentsGetter):
6514 (JSC::JSFunction::callerGetter):
6515 (JSC::JSFunction::lengthGetter):
6516 (JSC::JSFunction::getOwnPropertySlot):
6517 (JSC::JSFunction::put):
6518 (JSC::JSFunction::construct):
6519 * runtime/JSFunction.h:
6520 (JSC::JSFunction::createStructure):
6522 * runtime/JSGlobalData.h:
6523 * runtime/JSGlobalObject.cpp:
6524 (JSC::markIfNeeded):
6525 (JSC::JSGlobalObject::put):
6526 (JSC::JSGlobalObject::putWithAttributes):
6527 (JSC::JSGlobalObject::reset):
6528 (JSC::JSGlobalObject::resetPrototype):
6529 * runtime/JSGlobalObject.h:
6530 (JSC::JSGlobalObject::createStructure):
6531 (JSC::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo):
6532 (JSC::asGlobalObject):
6533 (JSC::Structure::prototypeForLookup):
6534 (JSC::Structure::prototypeChain):
6535 (JSC::Structure::isValid):
6536 * runtime/JSGlobalObjectFunctions.cpp:
6539 (JSC::globalFuncEval):
6540 (JSC::globalFuncParseInt):
6541 (JSC::globalFuncParseFloat):
6542 (JSC::globalFuncIsNaN):
6543 (JSC::globalFuncIsFinite):
6544 (JSC::globalFuncDecodeURI):
6545 (JSC::globalFuncDecodeURIComponent):
6546 (JSC::globalFuncEncodeURI):
6547 (JSC::globalFuncEncodeURIComponent):
6548 (JSC::globalFuncEscape):
6549 (JSC::globalFuncUnescape):
6550 (JSC::globalFuncJSCPrint):
6551 * runtime/JSGlobalObjectFunctions.h:
6552 * runtime/JSImmediate.cpp:
6553 (JSC::JSImmediate::toThisObject):
6554 (JSC::JSImmediate::toObject):
6555 (JSC::JSImmediate::prototype):
6556 (JSC::JSImmediate::toString):
6557 * runtime/JSImmediate.h:
6558 (JSC::JSImmediate::isImmediate):
6559 (JSC::JSImmediate::isNumber):
6560 (JSC::JSImmediate::isIntegerNumber):
6561 (JSC::JSImmediate::isDoubleNumber):
6562 (JSC::JSImmediate::isPositiveIntegerNumber):
6563 (JSC::JSImmediate::isBoolean):
6564 (JSC::JSImmediate::isUndefinedOrNull):
6565 (JSC::JSImmediate::isEitherImmediate):
6566 (JSC::JSImmediate::areBothImmediate):
6567 (JSC::JSImmediate::areBothImmediateIntegerNumbers):
6568 (JSC::JSImmediate::makeValue):
6569 (JSC::JSImmediate::makeInt):
6570 (JSC::JSImmediate::makeDouble):
6571 (JSC::JSImmediate::makeBool):
6572 (JSC::JSImmediate::makeUndefined):
6573 (JSC::JSImmediate::makeNull):
6574 (JSC::JSImmediate::doubleValue):
6575 (JSC::JSImmediate::intValue):
6576 (JSC::JSImmediate::uintValue):
6577 (JSC::JSImmediate::boolValue):
6578 (JSC::JSImmediate::rawValue):
6579 (JSC::JSImmediate::trueImmediate):
6580 (JSC::JSImmediate::falseImmediate):
6581 (JSC::JSImmediate::undefinedImmediate):
6582 (JSC::JSImmediate::nullImmediate):
6583 (JSC::JSImmediate::zeroImmediate):
6584 (JSC::JSImmediate::oneImmediate):
6585 (JSC::JSImmediate::impossibleValue):
6586 (JSC::JSImmediate::toBoolean):
6587 (JSC::JSImmediate::getTruncatedUInt32):
6588 (JSC::JSImmediate::fromNumberOutsideIntegerRange):
6589 (JSC::JSImmediate::from):
6590 (JSC::JSImmediate::getTruncatedInt32):
6591 (JSC::JSImmediate::toDouble):
6592 (JSC::JSImmediate::getUInt32):
6593 (JSC::JSValue::JSValue):
6594 (JSC::JSValue::isUndefinedOrNull):
6595 (JSC::JSValue::isBoolean):
6596 (JSC::JSValue::getBoolean):
6597 (JSC::JSValue::toInt32):
6598 (JSC::JSValue::toUInt32):
6599 (JSC::JSValue::isCell):
6600 (JSC::JSValue::isInt32Fast):
6601 (JSC::JSValue::getInt32Fast):
6602 (JSC::JSValue::isUInt32Fast):
6603 (JSC::JSValue::getUInt32Fast):
6604 (JSC::JSValue::makeInt32Fast):
6605 (JSC::JSValue::areBothInt32Fast):
6606 (JSC::JSFastMath::canDoFastBitwiseOperations):
6607 (JSC::JSFastMath::equal):
6608 (JSC::JSFastMath::notEqual):
6609 (JSC::JSFastMath::andImmediateNumbers):
6610 (JSC::JSFastMath::xorImmediateNumbers):
6611 (JSC::JSFastMath::orImmediateNumbers):
6612 (JSC::JSFastMath::canDoFastRshift):
6613 (JSC::JSFastMath::canDoFastUrshift):
6614 (JSC::JSFastMath::rightShiftImmediateNumbers):
6615 (JSC::JSFastMath::canDoFastAdditiveOperations):
6616 (JSC::JSFastMath::addImmediateNumbers):
6617 (JSC::JSFastMath::subImmediateNumbers):
6618 (JSC::JSFastMath::incImmediateNumber):
6619 (JSC::JSFastMath::decImmediateNumber):
6620 * runtime/JSNotAnObject.cpp:
6621 (JSC::JSNotAnObject::toPrimitive):
6622 (JSC::JSNotAnObject::getPrimitiveNumber):
6623 (JSC::JSNotAnObject::put):
6624 * runtime/JSNotAnObject.h:
6625 (JSC::JSNotAnObject::createStructure):
6626 * runtime/JSNumberCell.cpp:
6627 (JSC::JSNumberCell::toPrimitive):
6628 (JSC::JSNumberCell::getPrimitiveNumber):
6629 (JSC::JSNumberCell::getJSNumber):
6630 (JSC::jsNumberCell):
6631 * runtime/JSNumberCell.h:
6632 (JSC::JSNumberCell::createStructure):
6633 (JSC::isNumberCell):
6634 (JSC::asNumberCell):
6636 (JSC::JSValue::isDoubleNumber):
6637 (JSC::JSValue::getDoubleNumber):
6638 (JSC::JSValue::isNumber):
6639 (JSC::JSValue::uncheckedGetNumber):
6641 (JSC::JSValue::toJSNumber):
6642 (JSC::JSValue::getNumber):
6643 (JSC::JSValue::numberToInt32):
6644 (JSC::JSValue::numberToUInt32):
6645 * runtime/JSObject.cpp:
6646 (JSC::JSObject::mark):
6647 (JSC::JSObject::put):
6648 (JSC::JSObject::putWithAttributes):
6649 (JSC::callDefaultValueFunction):
6650 (JSC::JSObject::getPrimitiveNumber):
6651 (JSC::JSObject::defaultValue):
6652 (JSC::JSObject::defineGetter):
6653 (JSC::JSObject::defineSetter):
6654 (JSC::JSObject::lookupGetter):
6655 (JSC::JSObject::lookupSetter):
6656 (JSC::JSObject::hasInstance):
6657 (JSC::JSObject::toNumber):
6658 (JSC::JSObject::toString):
6659 (JSC::JSObject::fillGetterPropertySlot):
6660 * runtime/JSObject.h:
6661 (JSC::JSObject::getDirect):
6662 (JSC::JSObject::getDirectLocation):
6663 (JSC::JSObject::offsetForLocation):
6664 (JSC::JSObject::locationForOffset):
6665 (JSC::JSObject::getDirectOffset):
6666 (JSC::JSObject::putDirectOffset):
6667 (JSC::JSObject::createStructure):
6669 (JSC::JSObject::prototype):
6670 (JSC::JSObject::setPrototype):
6671 (JSC::JSValue::isObject):
6672 (JSC::JSObject::inlineGetOwnPropertySlot):
6673 (JSC::JSObject::getOwnPropertySlotForWrite):
6674 (JSC::JSObject::getPropertySlot):
6675 (JSC::JSObject::get):
6676 (JSC::JSObject::putDirect):
6677 (JSC::JSObject::putDirectWithoutTransition):
6678 (JSC::JSObject::toPrimitive):
6679 (JSC::JSValue::get):
6680 (JSC::JSValue::put):
6681 (JSC::JSObject::allocatePropertyStorageInline):
6682 * runtime/JSPropertyNameIterator.cpp:
6683 (JSC::JSPropertyNameIterator::toPrimitive):
6684 (JSC::JSPropertyNameIterator::getPrimitiveNumber):
6685 * runtime/JSPropertyNameIterator.h:
6686 (JSC::JSPropertyNameIterator::create):
6687 (JSC::JSPropertyNameIterator::next):
6688 * runtime/JSStaticScopeObject.cpp:
6689 (JSC::JSStaticScopeObject::put):
6690 (JSC::JSStaticScopeObject::putWithAttributes):
6691 * runtime/JSStaticScopeObject.h:
6692 (JSC::JSStaticScopeObject::JSStaticScopeObject):
6693 (JSC::JSStaticScopeObject::createStructure):
6694 * runtime/JSString.cpp:
6695 (JSC::JSString::toPrimitive):
6696 (JSC::JSString::getPrimitiveNumber):
6697 (JSC::JSString::getOwnPropertySlot):
6698 * runtime/JSString.h:
6699 (JSC::JSString::createStructure):
6702 (JSC::JSValue::toThisJSString):
6703 * runtime/JSValue.cpp:
6704 (JSC::JSValue::toInteger):
6705 (JSC::JSValue::toIntegerPreserveNaN):
6706 * runtime/JSValue.h:
6707 (JSC::JSValue::makeImmediate):
6708 (JSC::JSValue::asValue):
6710 (JSC::jsImpossibleValue):
6716 (JSC::JSValue::encode):
6717 (JSC::JSValue::decode):
6718 (JSC::JSValue::JSValue):
6719 (JSC::JSValue::operator bool):
6720 (JSC::JSValue::operator==):
6721 (JSC::JSValue::operator!=):
6722 (JSC::JSValue::isUndefined):
6723 (JSC::JSValue::isNull):
6724 * runtime/JSVariableObject.h:
6725 (JSC::JSVariableObject::symbolTablePut):
6726 (JSC::JSVariableObject::symbolTablePutWithAttributes):
6727 * runtime/JSWrapperObject.h:
6728 (JSC::JSWrapperObject::internalValue):
6729 (JSC::JSWrapperObject::setInternalValue):
6730 * runtime/Lookup.cpp:
6731 (JSC::setUpStaticFunctionSlot):
6734 * runtime/MathObject.cpp:
6735 (JSC::mathProtoFuncAbs):
6736 (JSC::mathProtoFuncACos):
6737 (JSC::mathProtoFuncASin):
6738 (JSC::mathProtoFuncATan):
6739 (JSC::mathProtoFuncATan2):
6740 (JSC::mathProtoFuncCeil):
6741 (JSC::mathProtoFuncCos):
6742 (JSC::mathProtoFuncExp):
6743 (JSC::mathProtoFuncFloor):
6744 (JSC::mathProtoFuncLog):
6745 (JSC::mathProtoFuncMax):
6746 (JSC::mathProtoFuncMin):
6747 (JSC::mathProtoFuncPow):
6748 (JSC::mathProtoFuncRandom):
6749 (JSC::mathProtoFuncRound):
6750 (JSC::mathProtoFuncSin):
6751 (JSC::mathProtoFuncSqrt):
6752 (JSC::mathProtoFuncTan):
6753 * runtime/MathObject.h:
6754 (JSC::MathObject::createStructure):
6755 * runtime/NativeErrorConstructor.cpp:
6756 (JSC::callNativeErrorConstructor):
6757 * runtime/NumberConstructor.cpp:
6758 (JSC::numberConstructorNaNValue):
6759 (JSC::numberConstructorNegInfinity):
6760 (JSC::numberConstructorPosInfinity):
6761 (JSC::numberConstructorMaxValue):
6762 (JSC::numberConstructorMinValue):
6763 (JSC::callNumberConstructor):
6764 * runtime/NumberConstructor.h:
6765 (JSC::NumberConstructor::createStructure):
6766 * runtime/NumberObject.cpp:
6767 (JSC::NumberObject::getJSNumber):
6768 (JSC::constructNumber):
6769 * runtime/NumberObject.h:
6770 * runtime/NumberPrototype.cpp:
6771 (JSC::numberProtoFuncToString):
6772 (JSC::numberProtoFuncToLocaleString):
6773 (JSC::numberProtoFuncValueOf):
6774 (JSC::numberProtoFuncToFixed):
6775 (JSC::numberProtoFuncToExponential):
6776 (JSC::numberProtoFuncToPrecision):
6777 * runtime/ObjectConstructor.cpp:
6778 (JSC::constructObject):
6779 (JSC::callObjectConstructor):
6780 * runtime/ObjectPrototype.cpp:
6781 (JSC::objectProtoFuncValueOf):
6782 (JSC::objectProtoFuncHasOwnProperty):
6783 (JSC::objectProtoFuncIsPrototypeOf):
6784 (JSC::objectProtoFuncDefineGetter):
6785 (JSC::objectProtoFuncDefineSetter):
6786 (JSC::objectProtoFuncLookupGetter):
6787 (JSC::objectProtoFuncLookupSetter):
6788 (JSC::objectProtoFuncPropertyIsEnumerable):
6789 (JSC::objectProtoFuncToLocaleString):
6790 (JSC::objectProtoFuncToString):
6791 * runtime/ObjectPrototype.h:
6792 * runtime/Operations.cpp:
6793 (JSC::JSValue::equalSlowCase):
6794 (JSC::JSValue::strictEqualSlowCase):
6795 (JSC::throwOutOfMemoryError):
6796 (JSC::jsAddSlowCase):
6797 (JSC::jsTypeStringForValue):
6798 (JSC::jsIsObjectType):
6799 (JSC::jsIsFunctionType):
6800 * runtime/Operations.h:
6801 (JSC::JSValue::equal):
6802 (JSC::JSValue::equalSlowCaseInline):
6803 (JSC::JSValue::strictEqual):
6804 (JSC::JSValue::strictEqualSlowCaseInline):
6808 (JSC::countPrototypeChainEntriesAndCheckForProxies):
6810 * runtime/PropertySlot.cpp:
6811 (JSC::PropertySlot::functionGetter):
6812 * runtime/PropertySlot.h:
6813 (JSC::PropertySlot::PropertySlot):
6814 (JSC::PropertySlot::getValue):
6815 (JSC::PropertySlot::putValue):
6816 (JSC::PropertySlot::setValueSlot):
6817 (JSC::PropertySlot::setValue):
6818 (JSC::PropertySlot::setCustom):
6819 (JSC::PropertySlot::setCustomIndex):
6820 (JSC::PropertySlot::slotBase):
6821 (JSC::PropertySlot::setBase):
6822 (JSC::PropertySlot::):
6823 * runtime/Protect.h:
6826 (JSC::ProtectedPtr::operator JSValue):
6827 (JSC::ProtectedJSValue::ProtectedJSValue):
6828 (JSC::ProtectedJSValue::get):
6829 (JSC::ProtectedJSValue::operator JSValue):
6830 (JSC::ProtectedJSValue::operator->):
6831 (JSC::ProtectedJSValue::~ProtectedJSValue):
6832 (JSC::ProtectedJSValue::operator=):
6835 * runtime/RegExpConstructor.cpp:
6836 (JSC::RegExpConstructor::getBackref):
6837 (JSC::RegExpConstructor::getLastParen):
6838 (JSC::RegExpConstructor::getLeftContext):
6839 (JSC::RegExpConstructor::getRightContext):
6840 (JSC::regExpConstructorDollar1):
6841 (JSC::regExpConstructorDollar2):
6842 (JSC::regExpConstructorDollar3):
6843 (JSC::regExpConstructorDollar4):
6844 (JSC::regExpConstructorDollar5):
6845 (JSC::regExpConstructorDollar6):
6846 (JSC::regExpConstructorDollar7):
6847 (JSC::regExpConstructorDollar8):
6848 (JSC::regExpConstructorDollar9):
6849 (JSC::regExpConstructorInput):
6850 (JSC::regExpConstructorMultiline):
6851 (JSC::regExpConstructorLastMatch):
6852 (JSC::regExpConstructorLastParen):
6853 (JSC::regExpConstructorLeftContext):
6854 (JSC::regExpConstructorRightContext):
6855 (JSC::RegExpConstructor::put):
6856 (JSC::setRegExpConstructorInput):
6857 (JSC::setRegExpConstructorMultiline):
6858 (JSC::constructRegExp):
6859 (JSC::callRegExpConstructor):
6860 * runtime/RegExpConstructor.h:
6861 (JSC::RegExpConstructor::createStructure):
6862 (JSC::asRegExpConstructor):
6863 * runtime/RegExpMatchesArray.h:
6864 (JSC::RegExpMatchesArray::put):
6865 * runtime/RegExpObject.cpp:
6866 (JSC::regExpObjectGlobal):
6867 (JSC::regExpObjectIgnoreCase):
6868 (JSC::regExpObjectMultiline):
6869 (JSC::regExpObjectSource):
6870 (JSC::regExpObjectLastIndex):
6871 (JSC::RegExpObject::put):
6872 (JSC::setRegExpObjectLastIndex):
6873 (JSC::RegExpObject::test):
6874 (JSC::RegExpObject::exec):
6875 (JSC::callRegExpObject):
6876 * runtime/RegExpObject.h:
6877 (JSC::RegExpObject::createStructure):
6878 (JSC::asRegExpObject):
6879 * runtime/RegExpPrototype.cpp:
6880 (JSC::regExpProtoFuncTest):
6881 (JSC::regExpProtoFuncExec):
6882 (JSC::regExpProtoFuncCompile):
6883 (JSC::regExpProtoFuncToString):
6884 * runtime/StringConstructor.cpp:
6885 (JSC::stringFromCharCodeSlowCase):
6886 (JSC::stringFromCharCode):
6887 (JSC::callStringConstructor):
6888 * runtime/StringObject.cpp:
6889 (JSC::StringObject::put):
6890 * runtime/StringObject.h:
6891 (JSC::StringObject::createStructure):
6892 (JSC::asStringObject):
6893 * runtime/StringObjectThatMasqueradesAsUndefined.h:
6894 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
6895 * runtime/StringPrototype.cpp:
6896 (JSC::stringProtoFuncReplace):
6897 (JSC::stringProtoFuncToString):
6898 (JSC::stringProtoFuncCharAt):
6899 (JSC::stringProtoFuncCharCodeAt):
6900 (JSC::stringProtoFuncConcat):
6901 (JSC::stringProtoFuncIndexOf):
6902 (JSC::stringProtoFuncLastIndexOf):
6903 (JSC::stringProtoFuncMatch):
6904 (JSC::stringProtoFuncSearch):
6905 (JSC::stringProtoFuncSlice):
6906 (JSC::stringProtoFuncSplit):
6907 (JSC::stringProtoFuncSubstr):
6908 (JSC::stringProtoFuncSubstring):
6909 (JSC::stringProtoFuncToLowerCase):
6910 (JSC::stringProtoFuncToUpperCase):
6911 (JSC::stringProtoFuncLocaleCompare):
6912 (JSC::stringProtoFuncBig):
6913 (JSC::stringProtoFuncSmall):
6914 (JSC::stringProtoFuncBlink):
6915 (JSC::stringProtoFuncBold):
6916 (JSC::stringProtoFuncFixed):
6917 (JSC::stringProtoFuncItalics):
6918 (JSC::stringProtoFuncStrike):
6919 (JSC::stringProtoFuncSub):
6920 (JSC::stringProtoFuncSup):
6921 (JSC::stringProtoFuncFontcolor):
6922 (JSC::stringProtoFuncFontsize):
6923 (JSC::stringProtoFuncAnchor):
6924 (JSC::stringProtoFuncLink):
6925 * runtime/Structure.cpp:
6926 (JSC::Structure::Structure):
6927 (JSC::Structure::changePrototypeTransition):
6928 * runtime/Structure.h:
6929 (JSC::Structure::create):
6930 (JSC::Structure::setPrototypeWithoutTransition):
6931 (JSC::Structure::storedPrototype):
6933 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6935 Reviewed by Sam "That doesn't look like what I thought it looks like" Weinig.
6937 Beefed up the JSValuePtr class and removed some non-JSValuePtr dependencies
6938 on JSImmediate, in prepapration for making JSImmediate an implementation
6939 detail of JSValuePtr.
6941 SunSpider reports no change.
6943 * interpreter/Interpreter.cpp:
6944 (JSC::Interpreter::privateExecute):
6946 (JSC::JIT::privateCompileMainPass):
6947 * jit/JITArithmetic.cpp:
6948 (JSC::JIT::compileFastArith_op_mod):
6949 * runtime/JSGlobalObjectFunctions.cpp:
6950 (JSC::globalFuncParseInt): Updated for interface changes.
6952 * runtime/JSImmediate.h:
6953 (JSC::JSValuePtr::JSValuePtr):
6954 * runtime/JSValue.h:
6955 (JSC::JSValuePtr::):
6956 (JSC::jsImpossibleValue):
6960 (JSC::JSValuePtr::encode):
6961 (JSC::JSValuePtr::decode):
6962 (JSC::JSValuePtr::JSValuePtr):
6963 (JSC::JSValuePtr::operator bool):
6964 (JSC::JSValuePtr::operator==):
6965 (JSC::JSValuePtr::operator!=):
6966 (JSC::JSValuePtr::isUndefined):
6967 (JSC::JSValuePtr::isNull): Changed jsImpossibleValue(), jsNull(),
6968 jsUndefined(), and jsBoolean() to operate in terms of JSValuePtr instead
6971 * wtf/StdLibExtras.h:
6972 (WTF::bitwise_cast): Fixed up for clarity.
6974 2009-04-30 Gavin Barraclough <barraclough@apple.com>
6976 Reviewed by Geoff Garen.
6978 Bug fix for rdar:/6845379. If a case-insensitive regex contains
6979 a character class containing a range with an upper bound of \uFFFF
6980 the parser will infinite-loop whist adding other-case characters
6981 for characters in the range that do have another case.
6983 * yarr/RegexCompiler.cpp:
6984 (JSC::Yarr::CharacterClassConstructor::putRange):
6986 2009-04-30 Gavin Barraclough <barraclough@apple.com>
6988 Reviewed by Oliver Hunt.
6990 OPCODE_SAMPLING without CODEBLOCK_SAMPLING is currently broken,
6991 since SamplingTool::Sample::isNull() checks the m_codeBlock
6992 member (which is always null without CODEBLOCK_SAMPLING).
6994 Restructure the checks so make this work again.
6996 * bytecode/SamplingTool.cpp:
6997 (JSC::SamplingTool::doRun):
6998 * bytecode/SamplingTool.h:
6999 (JSC::SamplingTool::Sample::isNull):
7001 2009-04-30 Maciej Stachowiak <mjs@apple.com>
7003 Reviewed by Gavin Barraclough.
7005 - Concatenate final three strings in simple replace case at one go
7007 ~0.2% SunSpider speedup
7009 * runtime/StringPrototype.cpp:
7010 (JSC::stringProtoFuncReplace): Use new replaceRange helper instead of
7011 taking substrings and concatenating three strings.
7012 * runtime/UString.cpp:
7013 (JSC::UString::replaceRange): New helper function.
7014 * runtime/UString.h:
7016 2009-04-30 Geoffrey Garen <ggaren@apple.com>
7018 Rubber Stamped by Gavin Barraclough.
7020 Changed JSValueEncodedAsPtr* => EncodedJSValuePtr to support a non-pointer
7021 encoding for JSValuePtrs.
7025 * bytecompiler/BytecodeGenerator.h:
7026 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
7027 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
7028 * interpreter/Register.h:
7036 (JSC::JITStubs::cti_op_add):
7037 (JSC::JITStubs::cti_op_pre_inc):
7038 (JSC::JITStubs::cti_op_get_by_id_generic):
7039 (JSC::JITStubs::cti_op_get_by_id):
7040 (JSC::JITStubs::cti_op_get_by_id_second):
7041 (JSC::JITStubs::cti_op_get_by_id_self_fail):
7042 (JSC::JITStubs::cti_op_get_by_id_proto_list):
7043 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
7044 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
7045 (JSC::JITStubs::cti_op_get_by_id_array_fail):
7046 (JSC::JITStubs::cti_op_get_by_id_string_fail):
7047 (JSC::JITStubs::cti_op_instanceof):
7048 (JSC::JITStubs::cti_op_del_by_id):
7049 (JSC::JITStubs::cti_op_mul):
7050 (JSC::JITStubs::cti_op_call_NotJSFunction):
7051 (JSC::JITStubs::cti_op_resolve):
7052 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
7053 (JSC::JITStubs::cti_op_get_by_val):
7054 (JSC::JITStubs::cti_op_get_by_val_string):
7055 (JSC::JITStubs::cti_op_get_by_val_byte_array):
7056 (JSC::JITStubs::cti_op_sub):
7057 (JSC::JITStubs::cti_op_lesseq):
7058 (JSC::JITStubs::cti_op_negate):
7059 (JSC::JITStubs::cti_op_resolve_base):
7060 (JSC::JITStubs::cti_op_resolve_skip):
7061 (JSC::JITStubs::cti_op_resolve_global):
7062 (JSC::JITStubs::cti_op_div):
7063 (JSC::JITStubs::cti_op_pre_dec):
7064 (JSC::JITStubs::cti_op_not):
7065 (JSC::JITStubs::cti_op_eq):
7066 (JSC::JITStubs::cti_op_lshift):
7067 (JSC::JITStubs::cti_op_bitand):
7068 (JSC::JITStubs::cti_op_rshift):
7069 (JSC::JITStubs::cti_op_bitnot):
7070 (JSC::JITStubs::cti_op_mod):
7071 (JSC::JITStubs::cti_op_less):
7072 (JSC::JITStubs::cti_op_neq):
7073 (JSC::JITStubs::cti_op_urshift):
7074 (JSC::JITStubs::cti_op_bitxor):
7075 (JSC::JITStubs::cti_op_bitor):
7076 (JSC::JITStubs::cti_op_call_eval):
7077 (JSC::JITStubs::cti_op_throw):
7078 (JSC::JITStubs::cti_op_next_pname):
7079 (JSC::JITStubs::cti_op_typeof):
7080 (JSC::JITStubs::cti_op_is_undefined):
7081 (JSC::JITStubs::cti_op_is_boolean):
7082 (JSC::JITStubs::cti_op_is_number):
7083 (JSC::JITStubs::cti_op_is_string):
7084 (JSC::JITStubs::cti_op_is_object):
7085 (JSC::JITStubs::cti_op_is_function):
7086 (JSC::JITStubs::cti_op_stricteq):
7087 (JSC::JITStubs::cti_op_nstricteq):
7088 (JSC::JITStubs::cti_op_to_jsnumber):
7089 (JSC::JITStubs::cti_op_in):
7090 (JSC::JITStubs::cti_op_del_by_val):
7091 (JSC::JITStubs::cti_vm_throw):
7093 * runtime/JSValue.h:
7094 (JSC::JSValuePtr::encode):
7095 (JSC::JSValuePtr::decode):
7097 2009-04-30 Gavin Barraclough <barraclough@apple.com>
7099 Reviewed by Oliver "Abandon Ship!" Hunt.
7103 All Disjunctions should be recorded in RegexPattern::m_disjunctions,
7104 so that they can be freed at the end of compilation - copyDisjunction
7105 is failing to do so.
7107 * yarr/RegexCompiler.cpp:
7108 (JSC::Yarr::RegexPatternConstructor::copyDisjunction):
7110 2009-04-30 Oliver Hunt <oliver@apple.com>
7112 Reviewed by Gavin Barraclough.
7114 Add function to CallFrame for dumping the current JS caller
7116 Added debug only method CallFrame::dumpCaller() that provide the call location
7117 of the deepest currently executing JS function.
7119 * interpreter/CallFrame.cpp:
7120 (JSC::CallFrame::dumpCaller):
7121 * interpreter/CallFrame.h:
7123 2009-04-30 Maciej Stachowiak <mjs@apple.com>
7125 Reviewed by Geoff Garen.
7127 - make BaseStrings have themselves as a base, instead of nothing, to remove common branches
7129 ~0.7% SunSpider speedup
7131 * runtime/UString.h:
7132 (JSC::UString::Rep::Rep): For the constructor without a base, set self as base instead of null.
7133 (JSC::UString::Rep::baseString): Just read m_baseString - no more branching.
7135 2009-04-30 Gavin Barraclough <barraclough@apple.com>
7137 Reviewed by Oliver Hunt.
7139 Two quick improvements to SamplingFlags mechanism.
7141 SamplingFlags::ScopedFlag class to provide support for automagically
7142 clearing a flag as it goes out of scope, and add a little more detail
7143 to the output generated by the tool.
7145 * bytecode/SamplingTool.cpp:
7146 (JSC::SamplingFlags::stop):
7147 * bytecode/SamplingTool.h:
7148 (JSC::SamplingFlags::ScopedFlag::ScopedFlag):
7149 (JSC::SamplingFlags::ScopedFlag::~ScopedFlag):
7151 2009-04-30 Adam Roben <aroben@apple.com>
7153 Restore build event steps that were truncated in r43082
7155 Rubber-stamped by Steve Falkenburg.
7157 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
7158 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
7159 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
7160 Re-copied the command lines for the build events from the pre-r43082
7163 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Removed an unnecessary
7166 2009-04-30 Adam Roben <aroben@apple.com>
7168 Move settings from .vcproj files to .vsprops files within the
7169 JavaScriptCore directory
7171 Moving the settings to a .vsprops file means that we will only have to
7172 change a single setting to affect all configurations, instead of one
7173 setting per configuration.
7175 Reviewed by Steve Falkenburg.
7177 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7178 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
7179 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
7180 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
7181 Moved settings from these files to the new .vsprops files. Note that
7182 testapi.vcproj had a lot of overrides of default settings that were
7183 the same as the defaults, which I've removed.
7185 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Added.
7186 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: Added.
7187 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added.
7188 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Added.
7190 2009-04-30 Dimitri Glazkov <dglazkov@chromium.org>
7192 Reviewed by Timothy Hatcher.
7194 https://bugs.webkit.org/show_bug.cgi?id=25470
7195 Extend the cover of ENABLE_JAVASCRIPT_DEBUGGER to profiler.
7197 * Configurations/FeatureDefines.xcconfig: Added ENABLE_JAVASCRIPT_DEBUGGER define.
7199 2009-04-30 Maciej Stachowiak <mjs@apple.com>
7201 Reviewed by Alexey Proskuryakov.
7203 - speed up string concatenation by reorganizing some simple cases
7205 0.7% SunSpider speedup
7207 * runtime/UString.cpp:
7208 (JSC::concatenate): Put fast case for appending a single character
7209 before the empty string special cases; streamline code a bit to
7210 delay computing values that are not needed in the fast path.
7212 2009-04-30 Gavin Barraclough <barraclough@apple.com>
7214 Reviewed by Maciej Stachowiak.
7216 Add SamplingFlags mechanism.
7218 This mechanism allows fine-grained JSC and JavaScript program aware
7219 performance measurement. The mechanism provides a set of 32 flags,
7220 numbered #1..#32. Flag #16 is initially set, and all other flags
7221 are cleared. Flags may be set and cleared from within
7223 Enable by setting ENABLE_SAMPLING_FLAGS to 1 in wtf/Platform.h.
7224 Disabled by default, no performance impact. Flags may be modified
7225 by calling SamplingFlags::setFlag() and SamplingFlags::clearFlag()
7226 from within JSC implementation, or by calling setSamplingFlag() and
7227 clearSamplingFlag() from JavaScript.
7229 The flags are sampled with a frequency of 10000Hz, and the highest
7230 set flag in recorded, allowing multiple events to be measured (with
7231 the highest flag number representing the highest priority).
7233 Disabled by default; no performance impact.
7235 * JavaScriptCore.exp:
7236 * bytecode/SamplingTool.cpp:
7237 (JSC::SamplingFlags::sample):
7238 (JSC::SamplingFlags::start):
7239 (JSC::SamplingFlags::stop):
7240 (JSC::SamplingThread::threadStartFunc):
7241 (JSC::SamplingThread::start):
7242 (JSC::SamplingThread::stop):
7243 (JSC::ScopeSampleRecord::sample):
7244 (JSC::SamplingTool::doRun):
7245 (JSC::SamplingTool::sample):
7246 (JSC::SamplingTool::start):
7247 (JSC::SamplingTool::stop):
7248 * bytecode/SamplingTool.h:
7249 (JSC::SamplingFlags::setFlag):
7250 (JSC::SamplingFlags::clearFlag):
7251 (JSC::SamplingTool::SamplingTool):
7253 (GlobalObject::GlobalObject):
7254 (functionSetSamplingFlag):
7255 (functionClearSamplingFlag):
7259 2009-04-29 Sam Weinig <sam@webkit.org>
7261 Another attempt to fix the windows build.
7263 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7264 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
7266 2009-04-29 Sam Weinig <sam@webkit.org>
7268 Try and fix the windows build.
7270 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7271 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
7273 2009-04-29 Gavin Barraclough <barraclough@apple.com>
7275 Reviewed by Oliver "Peg-Leg" Hunt.
7277 Coallesce input checking and reduce futzing with the index position
7278 between alternatives and iterations of the main loop of a regex,
7281 Consider the following regex: /foo|bar/
7283 Prior to this patch, this will be implemented something like this pseudo-code description:
7286 check_for_available_input(3) // this increments the index by 3, for the first alterantive.
7287 if (available) { test "foo" }
7289 check_for_available_input(3) // this increments the index by 3, for the second alterantive.
7290 if (available) { test "bar" }
7292 check_for_available_input(1) // can we loop again?
7293 if (available) { goto loop }
7295 With these changes it will look more like this:
7297 check_for_available_input(3) // this increments the index by 3, for the first alterantive.
7298 if (!available) { goto fail }
7302 check_for_available_input(1) // can we loop again?
7303 if (available) { goto loop }
7307 This gives about a 5% gain on v8-regex, no change on Sunspider.
7309 * yarr/RegexJIT.cpp:
7310 (JSC::Yarr::RegexGenerator::TermGenerationState::linkAlternativeBacktracksTo):
7311 (JSC::Yarr::RegexGenerator::generateDisjunction):
7313 2009-04-29 Oliver Hunt <oliver@apple.com>
7315 Reviewed by Gavin Barraclough.
7317 Clean up ArgList to be a trivial type
7319 Separate out old ArgList logic to handle buffering and marking arguments
7320 into a distinct MarkedArgumentBuffer type. ArgList becomes a trivial
7321 struct of a pointer and length.
7323 * API/JSObjectRef.cpp:
7324 (JSObjectMakeFunction):
7325 (JSObjectMakeArray):
7327 (JSObjectMakeError):
7328 (JSObjectMakeRegExp):
7329 (JSObjectCallAsFunction):
7330 (JSObjectCallAsConstructor):
7331 * JavaScriptCore.exp:
7332 * interpreter/CallFrame.h:
7333 (JSC::ExecState::emptyList):
7334 * runtime/ArgList.cpp:
7335 (JSC::ArgList::getSlice):
7336 (JSC::MarkedArgumentBuffer::markLists):
7337 (JSC::MarkedArgumentBuffer::slowAppend):
7338 * runtime/ArgList.h:
7339 (JSC::MarkedArgumentBuffer::MarkedArgumentBuffer):
7340 (JSC::MarkedArgumentBuffer::~MarkedArgumentBuffer):
7341 (JSC::ArgList::ArgList):
7343 (JSC::ArgList::isEmpty):
7344 (JSC::ArgList::size):
7345 (JSC::ArgList::begin):
7346 (JSC::ArgList::end):
7347 * runtime/Arguments.cpp:
7348 (JSC::Arguments::fillArgList):
7349 * runtime/Arguments.h:
7350 * runtime/ArrayPrototype.cpp:
7351 (JSC::arrayProtoFuncConcat):
7352 (JSC::arrayProtoFuncPush):
7353 (JSC::arrayProtoFuncSort):
7354 (JSC::arrayProtoFuncFilter):
7355 (JSC::arrayProtoFuncMap):
7356 (JSC::arrayProtoFuncEvery):
7357 (JSC::arrayProtoFuncForEach):
7358 (JSC::arrayProtoFuncSome):
7359 (JSC::arrayProtoFuncReduce):
7360 (JSC::arrayProtoFuncReduceRight):
7361 * runtime/Collector.cpp:
7362 (JSC::Heap::collect):
7363 * runtime/Collector.h:
7364 (JSC::Heap::markListSet):
7365 * runtime/CommonIdentifiers.h:
7366 * runtime/Error.cpp:
7367 (JSC::Error::create):
7368 * runtime/FunctionPrototype.cpp:
7369 (JSC::functionProtoFuncApply):
7370 * runtime/JSArray.cpp:
7371 (JSC::JSArray::JSArray):
7372 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
7373 (JSC::JSArray::fillArgList):
7374 (JSC::constructArray):
7375 * runtime/JSArray.h:
7376 * runtime/JSGlobalData.cpp:
7377 (JSC::JSGlobalData::JSGlobalData):
7378 * runtime/JSGlobalData.h:
7379 * runtime/JSObject.cpp:
7380 (JSC::JSObject::put):
7381 * runtime/StringConstructor.cpp:
7382 (JSC::stringFromCharCodeSlowCase):
7383 * runtime/StringPrototype.cpp:
7384 (JSC::stringProtoFuncReplace):
7385 (JSC::stringProtoFuncConcat):
7386 (JSC::stringProtoFuncMatch):
7388 2009-04-29 Laszlo Gombos <laszlo.1.gombos@nokia.com>
7390 Reviewed by Sam Weinig.
7392 https://bugs.webkit.org/show_bug.cgi?id=25334
7394 Fix Qt build when ENABLE_JIT is explicitly set to 1
7395 to overrule defaults.
7397 * JavaScriptCore.pri:
7399 2009-04-29 Oliver Hunt <oliver@apple.com>
7401 Reviewed by Steve Falkenburg.
7403 Crash in profiler due to incorrect assuming displayName would be a string.
7405 Fixed by adding a type guard.
7407 * runtime/InternalFunction.cpp:
7408 (JSC::InternalFunction::displayName):
7410 2009-04-28 Geoffrey Garen <ggaren@apple.com>
7412 Rubber stamped by Beth Dakin.
7414 Removed scaffolding supporting dynamically converting between 32bit and
7415 64bit value representations.
7417 * API/JSCallbackConstructor.cpp:
7418 (JSC::constructJSCallback):
7419 * API/JSCallbackFunction.cpp:
7420 (JSC::JSCallbackFunction::call):
7421 * API/JSCallbackObjectFunctions.h:
7424 * bytecode/CodeBlock.cpp:
7425 (JSC::CodeBlock::dump):
7426 * bytecode/CodeBlock.h:
7427 (JSC::CodeBlock::getConstant):
7428 * bytecompiler/BytecodeGenerator.cpp:
7429 (JSC::BytecodeGenerator::emitEqualityOp):
7430 * interpreter/CallFrame.cpp:
7431 (JSC::CallFrame::thisValue):
7432 * interpreter/Interpreter.cpp:
7433 (JSC::Interpreter::callEval):
7434 (JSC::Interpreter::throwException):
7435 (JSC::Interpreter::createExceptionScope):
7436 (JSC::Interpreter::privateExecute):
7437 (JSC::Interpreter::retrieveArguments):
7438 * interpreter/Register.h:
7440 (JSC::Register::Register):
7441 (JSC::Register::jsValue):
7442 (JSC::Register::marked):
7443 (JSC::Register::mark):
7445 (JSC::Register::activation):
7446 (JSC::Register::arguments):
7447 (JSC::Register::callFrame):
7448 (JSC::Register::codeBlock):
7449 (JSC::Register::function):
7450 (JSC::Register::propertyNameIterator):
7451 (JSC::Register::scopeChain):
7452 (JSC::Register::vPC):
7454 (JSC::JITStubs::cti_op_call_NotJSFunction):
7455 (JSC::JITStubs::cti_op_load_varargs):
7456 (JSC::JITStubs::cti_op_call_eval):
7462 * runtime/ArgList.h:
7464 * runtime/Arguments.cpp:
7465 (JSC::Arguments::copyToRegisters):
7466 (JSC::Arguments::fillArgList):
7467 (JSC::Arguments::getOwnPropertySlot):
7468 * runtime/ArrayConstructor.cpp:
7469 (JSC::constructArrayWithSizeQuirk):
7470 * runtime/ArrayPrototype.cpp:
7471 (JSC::arrayProtoFuncJoin):
7472 (JSC::arrayProtoFuncConcat):
7473 (JSC::arrayProtoFuncPush):
7474 (JSC::arrayProtoFuncSlice):
7475 (JSC::arrayProtoFuncSort):
7476 (JSC::arrayProtoFuncSplice):
7477 (JSC::arrayProtoFuncUnShift):
7478 (JSC::arrayProtoFuncFilter):
7479 (JSC::arrayProtoFuncMap):
7480 (JSC::arrayProtoFuncEvery):
7481 (JSC::arrayProtoFuncForEach):
7482 (JSC::arrayProtoFuncSome):
7483 (JSC::arrayProtoFuncReduce):
7484 (JSC::arrayProtoFuncReduceRight):
7485 (JSC::arrayProtoFuncIndexOf):
7486 (JSC::arrayProtoFuncLastIndexOf):
7487 * runtime/BooleanConstructor.cpp:
7488 (JSC::constructBoolean):
7489 (JSC::callBooleanConstructor):
7490 * runtime/DateConstructor.cpp:
7491 (JSC::constructDate):
7494 * runtime/DatePrototype.cpp:
7495 (JSC::formatLocaleDate):
7496 (JSC::fillStructuresUsingTimeArgs):
7497 (JSC::fillStructuresUsingDateArgs):
7498 (JSC::dateProtoFuncSetTime):
7499 (JSC::dateProtoFuncSetYear):
7500 * runtime/ErrorConstructor.cpp:
7501 (JSC::constructError):
7502 * runtime/FunctionConstructor.cpp:
7503 (JSC::constructFunction):
7504 * runtime/FunctionPrototype.cpp:
7505 (JSC::functionProtoFuncApply):
7506 (JSC::functionProtoFuncCall):
7507 * runtime/JSArray.cpp:
7508 (JSC::JSArray::JSArray):
7509 (JSC::constructArray):
7510 * runtime/JSArray.h:
7511 * runtime/JSGlobalObjectFunctions.cpp:
7514 (JSC::globalFuncEval):
7515 (JSC::globalFuncParseInt):
7516 (JSC::globalFuncParseFloat):
7517 (JSC::globalFuncIsNaN):
7518 (JSC::globalFuncIsFinite):
7519 (JSC::globalFuncEscape):
7520 (JSC::globalFuncUnescape):
7521 (JSC::globalFuncJSCPrint):
7522 * runtime/MathObject.cpp:
7523 (JSC::mathProtoFuncAbs):
7524 (JSC::mathProtoFuncACos):
7525 (JSC::mathProtoFuncASin):
7526 (JSC::mathProtoFuncATan):
7527 (JSC::mathProtoFuncATan2):
7528 (JSC::mathProtoFuncCeil):
7529 (JSC::mathProtoFuncCos):
7530 (JSC::mathProtoFuncExp):
7531 (JSC::mathProtoFuncFloor):
7532 (JSC::mathProtoFuncLog):
7533 (JSC::mathProtoFuncMax):
7534 (JSC::mathProtoFuncMin):
7535 (JSC::mathProtoFuncPow):
7536 (JSC::mathProtoFuncRound):
7537 (JSC::mathProtoFuncSin):
7538 (JSC::mathProtoFuncSqrt):
7539 (JSC::mathProtoFuncTan):
7540 * runtime/NativeErrorConstructor.cpp:
7541 (JSC::NativeErrorConstructor::construct):
7542 * runtime/NumberConstructor.cpp:
7543 (JSC::constructWithNumberConstructor):
7544 (JSC::callNumberConstructor):
7545 * runtime/NumberPrototype.cpp:
7546 (JSC::numberProtoFuncToString):
7547 (JSC::numberProtoFuncToFixed):
7548 (JSC::numberProtoFuncToExponential):
7549 (JSC::numberProtoFuncToPrecision):
7550 * runtime/ObjectConstructor.cpp:
7551 (JSC::constructObject):
7552 * runtime/ObjectPrototype.cpp:
7553 (JSC::objectProtoFuncHasOwnProperty):
7554 (JSC::objectProtoFuncIsPrototypeOf):
7555 (JSC::objectProtoFuncDefineGetter):
7556 (JSC::objectProtoFuncDefineSetter):
7557 (JSC::objectProtoFuncLookupGetter):
7558 (JSC::objectProtoFuncLookupSetter):
7559 (JSC::objectProtoFuncPropertyIsEnumerable):
7560 * runtime/PropertySlot.h:
7561 (JSC::PropertySlot::getValue):
7562 * runtime/RegExpConstructor.cpp:
7563 (JSC::constructRegExp):
7564 * runtime/RegExpObject.cpp:
7565 (JSC::RegExpObject::match):
7566 * runtime/RegExpPrototype.cpp:
7567 (JSC::regExpProtoFuncCompile):
7568 * runtime/StringConstructor.cpp:
7569 (JSC::stringFromCharCodeSlowCase):
7570 (JSC::stringFromCharCode):
7571 (JSC::constructWithStringConstructor):
7572 (JSC::callStringConstructor):
7573 * runtime/StringPrototype.cpp:
7574 (JSC::stringProtoFuncReplace):
7575 (JSC::stringProtoFuncCharAt):
7576 (JSC::stringProtoFuncCharCodeAt):
7577 (JSC::stringProtoFuncConcat):
7578 (JSC::stringProtoFuncIndexOf):
7579 (JSC::stringProtoFuncLastIndexOf):
7580 (JSC::stringProtoFuncMatch):
7581 (JSC::stringProtoFuncSearch):
7582 (JSC::stringProtoFuncSlice):
7583 (JSC::stringProtoFuncSplit):
7584 (JSC::stringProtoFuncSubstr):
7585 (JSC::stringProtoFuncSubstring):
7586 (JSC::stringProtoFuncLocaleCompare):
7587 (JSC::stringProtoFuncFontcolor):
7588 (JSC::stringProtoFuncFontsize):
7589 (JSC::stringProtoFuncAnchor):
7590 (JSC::stringProtoFuncLink):
7592 2009-04-28 David Kilzer <ddkilzer@apple.com>
7594 A little more hardening for UString
7596 Reviewed by Maciej Stachowiak.
7598 Revised fix for <rdar://problem/5861045> in r42644.
7600 * runtime/UString.cpp:
7601 (JSC::newCapacityWithOverflowCheck): Added.
7602 (JSC::concatenate): Used newCapacityWithOverflowCheck().
7603 (JSC::UString::append): Ditto.
7605 2009-04-28 Oliver Hunt <oliver@apple.com>
7607 Reviewed by Gavin Barraclough.
7609 Bring back r42969, this time with correct codegen
7611 Add logic to the codegen for right shift to avoid jumping to a helper function
7612 when shifting a small floating point value.
7614 * jit/JITArithmetic.cpp:
7616 (JSC::JIT::compileFastArith_op_rshift):
7617 (JSC::JIT::compileFastArithSlow_op_rshift):
7619 2009-04-28 Kevin Ollivier <kevino@theolliviers.com>
7621 wxMSW build fix. Switch JSCore build back to static.
7627 2009-04-28 Oliver Hunt <oliver@apple.com>
7629 Reviewed by NOBODY (Build fix).
7631 Roll out r42969, due to hangs in build bot.
7633 * jit/JITArithmetic.cpp:
7634 (JSC::JIT::compileFastArith_op_rshift):
7635 (JSC::JIT::compileFastArithSlow_op_rshift):
7636 (JSC::isSSE2Present):
7638 2009-04-28 Xan Lopez <xlopez@igalia.com>
7640 Unreviewed: fix distcheck build, add (even more) missing files to list.
7644 2009-04-28 Oliver Hunt <oliver@apple.com>
7646 Reviewed by Geoff Garen.
7648 Improve performance of string indexing
7650 Add a cti_get_by_val_string function to specialise indexing into a string object.
7651 This gives us a slight performance win on a number of string tests.
7654 (JSC::JITStubs::cti_op_get_by_val):
7655 (JSC::JITStubs::cti_op_get_by_val_string):
7658 2009-04-28 Oliver Hunt <oliver@apple.com>
7660 Reviewed by Geoff Garen.
7662 Improve performance of right shifts of large or otherwise floating point values.
7664 Add logic to the codegen for right shift to avoid jumping to a helper function
7665 when shifting a small floating point value.
7667 * jit/JITArithmetic.cpp:
7668 (isSSE2Present): Moved to the head of file.
7669 (JSC::JIT::compileFastArith_op_rshift):
7670 (JSC::JIT::compileFastArithSlow_op_rshift):
7672 2009-04-28 Xan Lopez <xlopez@igalia.com>
7674 Unreviewed: fix distcheck build, add (more) missing files to list.
7678 2009-04-28 Xan Lopez <xlopez@igalia.com>
7680 Unreviewed: fix distcheck build, add missing header to file list.
7684 2009-04-28 Gavin Barraclough <barraclough@apple.com>
7686 Rubber stamped by Maciej "Henry Morgan" Stachowiak.
7693 2009-04-27 Gavin Barraclough <barraclough@apple.com>
7695 Reviewed by Maciej Stachowiak.
7697 Tweak a loop condition to keep GCC happy,
7698 some GCCs seem to be having issues with this. :-/
7700 * bytecompiler/BytecodeGenerator.cpp:
7701 (JSC::BytecodeGenerator::breakTarget):
7704 2009-04-27 Adam Roben <aroben@apple.com>
7706 Windows Debug build fix
7708 Not sure why the buildbots weren't affected by this problem.
7710 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Let VS
7711 re-order the file list, and added JavaScriptCore[_debug].def to the
7712 project. This was not necessary for the fix, but made making the fix
7715 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
7716 Removed a function that no longer exists.
7718 2009-04-26 Gavin Barraclough <barraclough@apple.com>
7720 Reviewed by Weinig Sam.
7722 Fix for https://bugs.webkit.org/show_bug.cgi?id=25416
7723 "Cached prototype accesses unsafely hoist property storage load above structure checks."
7725 Do not hoist the load of the pointer to the property storage array.
7727 No performance impact.
7729 * jit/JITPropertyAccess.cpp:
7730 (JSC::JIT::privateCompileGetByIdProto):
7731 (JSC::JIT::privateCompileGetByIdProtoList):
7733 2009-04-26 Gavin Barraclough <barraclough@apple.com>
7735 Reviewed by Geoffrey "Gaffe or energy?" Garen.
7737 Randomize address requested by ExecutableAllocatorFixedVMPool.
7739 * jit/ExecutableAllocatorFixedVMPool.cpp:
7740 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
7742 2009-04-26 Sam Weinig <sam@webkit.org>
7744 Reviewed by Eric Seidel.
7746 Remove scons-based build system.
7748 * JavaScriptCore.scons: Removed.
7750 2009-04-25 Oliver Hunt <oliver@apple.com>
7752 Reviewed by NOBODY (Buildfix).
7754 Make HAVE_MADV_FREE darwin only for now
7758 2009-04-25 Jan Michael Alonzo <jmalonzo@webkit.org>
7760 Reviewed by Oliver Hunt.
7762 Gtk build fix - check if we have MADV_FREE before using it.
7764 * interpreter/RegisterFile.cpp:
7765 (JSC::RegisterFile::releaseExcessCapacity):
7768 2009-04-24 Kevin Ollivier <kevino@theolliviers.com>
7770 wx build fix. Switching JSCore from a static lib to a dynamic lib
7771 to match the Apple build and fix symbol exports.
7775 2009-04-24 Laszlo Gombos <laszlo.1.gombos@nokia.com>
7777 Rubber-stamped by Mark Rowe.
7779 https://bugs.webkit.org/show_bug.cgi?id=25337
7780 Move ThreadingQt.cpp under the qt directory.
7782 * JavaScriptCore.pri:
7783 * wtf/ThreadingQt.cpp: Removed.
7784 * wtf/qt/ThreadingQt.cpp: Copied from JavaScriptCore/wtf/ThreadingQt.cpp.
7786 2009-04-24 Laszlo Gombos <laszlo.1.gombos@nokia.com>
7788 Rubber-stamped by Mark Rowe.
7790 https://bugs.webkit.org/show_bug.cgi?id=25338
7791 Move ThreadingGtk.cpp under the gtk directory.
7794 * wtf/ThreadingGtk.cpp: Removed.
7795 * wtf/gtk/ThreadingGtk.cpp: Copied from JavaScriptCore/wtf/ThreadingGtk.cpp.
7797 2009-04-24 Gavin Barraclough <barraclough@apple.com>
7799 Reviewed by Sam "Wesley" Weinig.
7801 Improve performance to YARR interpreter.
7802 (From about 3x slower than PCRE on regex-dna to about 30% slower).
7804 * yarr/RegexCompiler.cpp:
7805 (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
7806 * yarr/RegexInterpreter.cpp:
7807 (JSC::Yarr::Interpreter::checkCharacter):
7808 (JSC::Yarr::Interpreter::checkCasedCharacter):
7809 (JSC::Yarr::Interpreter::backtrackPatternCharacter):
7810 (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
7811 (JSC::Yarr::Interpreter::matchParentheticalAssertionBegin):
7812 (JSC::Yarr::Interpreter::matchParentheticalAssertionEnd):
7813 (JSC::Yarr::Interpreter::backtrackParentheticalAssertionBegin):
7814 (JSC::Yarr::Interpreter::backtrackParentheticalAssertionEnd):
7815 (JSC::Yarr::Interpreter::matchDisjunction):
7816 (JSC::Yarr::Interpreter::interpret):
7817 (JSC::Yarr::ByteCompiler::atomPatternCharacter):
7818 (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
7819 (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
7820 (JSC::Yarr::ByteCompiler::closeAlternative):
7821 (JSC::Yarr::ByteCompiler::closeBodyAlternative):
7822 (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
7823 (JSC::Yarr::ByteCompiler::regexBegin):
7824 (JSC::Yarr::ByteCompiler::regexEnd):
7825 (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction):
7826 (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
7827 (JSC::Yarr::ByteCompiler::emitDisjunction):
7828 * yarr/RegexInterpreter.h:
7829 (JSC::Yarr::ByteTerm::):
7830 (JSC::Yarr::ByteTerm::ByteTerm):
7831 (JSC::Yarr::ByteTerm::BodyAlternativeBegin):
7832 (JSC::Yarr::ByteTerm::BodyAlternativeDisjunction):
7833 (JSC::Yarr::ByteTerm::BodyAlternativeEnd):
7834 (JSC::Yarr::ByteTerm::AlternativeBegin):
7835 (JSC::Yarr::ByteTerm::AlternativeDisjunction):
7836 (JSC::Yarr::ByteTerm::AlternativeEnd):
7837 (JSC::Yarr::ByteTerm::SubpatternBegin):
7838 (JSC::Yarr::ByteTerm::SubpatternEnd):
7839 * yarr/RegexJIT.cpp:
7840 (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
7841 * yarr/RegexPattern.h:
7843 2009-04-24 Rob Raguet-Schofield <ragfield@gmail.com>
7845 Rubber-stamped by Mark Rowe.
7847 * wtf/CurrentTime.h: Fix a typo in a comment.
7849 2009-04-24 Oliver Hunt <oliver@apple.com>
7851 Reviewed by NOBODY (Build fix).
7853 Add reinterpret_cast
7855 * interpreter/RegisterFile.cpp:
7856 (JSC::RegisterFile::releaseExcessCapacity):
7858 2009-04-23 Oliver Hunt <oliver@apple.com>
7860 Reviewed by Geoff Garen.
7862 <rdar://problem/6050421> JavaScript register file should remap to release physical pages accumulated during deep recursion
7864 We now track the maximum extent of the RegisterFile, and when we reach the final
7865 return from JS (so the stack portion of the registerfile becomes empty) we see
7866 if that extent is greater than maxExcessCapacity. If it is we use madvise or
7867 VirtualFree to release the physical pages that were backing the excess.
7869 * interpreter/RegisterFile.cpp:
7870 (JSC::RegisterFile::releaseExcessCapacity):
7871 * interpreter/RegisterFile.h:
7872 (JSC::RegisterFile::RegisterFile):
7873 (JSC::RegisterFile::shrink):
7874 (JSC::RegisterFile::grow):
7876 2009-04-23 Mark Rowe <mrowe@apple.com>
7878 With great sadness and a heavy heart I switch us back from YARR to WREC in
7879 order to restore greenness to the world once more.
7883 2009-04-23 Mark Rowe <mrowe@apple.com>
7885 More Windows build fixage.
7887 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7888 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
7890 2009-04-23 Mark Rowe <mrowe@apple.com>
7892 Attempt to fix the Windows build.
7894 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove a symbol that no longer exists.
7896 2009-04-23 Francisco Tolmasky <francisco@280north.com>
7898 BUG 24604: WebKit profiler reports incorrect total times
7899 <https://bugs.webkit.org/show_bug.cgi?id=24604>
7901 Reviewed by Timothy Hatcher and Kevin McCullough.
7903 * JavaScriptCore.exp:
7904 * JavaScriptCore.xcodeproj/project.pbxproj:
7905 * profiler/CallIdentifier.h:
7906 (JSC::CallIdentifier::Hash::hash):
7907 (JSC::CallIdentifier::Hash::equal):
7908 (JSC::CallIdentifier::hash):
7910 * profiler/HeavyProfile.cpp: Removed.
7911 * profiler/HeavyProfile.h: Removed.
7912 * profiler/Profile.cpp: No more need for TreeProfile/HeavyProfile
7913 (JSC::Profile::create):
7914 * profiler/Profile.h:
7915 * profiler/ProfileNode.cpp:
7916 * profiler/ProfileNode.h:
7917 * profiler/TreeProfile.cpp: Removed.
7918 * profiler/TreeProfile.h: Removed.
7920 2009-04-23 Gavin Barraclough <barraclough@apple.com>
7924 Speculative Windows build fix II.
7926 * yarr/RegexInterpreter.cpp:
7928 2009-04-23 Gavin Barraclough <barraclough@apple.com>
7932 Speculative Windows build fix.
7934 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7935 * runtime/RegExp.cpp:
7937 2009-04-23 Gavin Barraclough <barraclough@apple.com>
7939 Rubber stamped by salty sea dogs Sam & Geoff.
7941 Enable YARR_JIT by default (where supported), replacing WREC.
7945 2009-04-23 Gavin Barraclough <barraclough@apple.com>
7947 Reviewed by Geoff "Dread Pirate Roberts" Garen.
7949 Various small fixes to YARR JIT, in preparation for enabling it by default.
7951 * Correctly index into the callframe when storing restart addresses for
7952 nested alternatives.
7953 * Allow backtracking back into matched alternatives of parentheses.
7954 * Fix callframe offset calculation for parenthetical assertions.
7955 * When a set of parenthese are quantified with a fixed and variable portion,
7956 and the variable portion is quantified once, this should not reset the
7957 pattern match on failure to match (the last match from the firxed portion
7958 should be preserved).
7959 * Up the pattern size limit to match PCRE's new limit.
7960 * Unlclosed parentheses should be reported with the message "missing )".
7963 * yarr/RegexCompiler.cpp:
7964 (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
7965 (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
7966 * yarr/RegexInterpreter.cpp:
7967 (JSC::Yarr::Interpreter::matchParentheses):
7968 (JSC::Yarr::Interpreter::backtrackParentheses):
7969 (JSC::Yarr::ByteCompiler::emitDisjunction):
7970 * yarr/RegexJIT.cpp:
7971 (JSC::Yarr::RegexGenerator::loadFromFrameAndJump):
7972 (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction):
7973 (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
7974 (JSC::Yarr::RegexGenerator::generateTerm):
7975 (JSC::Yarr::executeRegex):
7976 * yarr/RegexParser.h:
7977 (JSC::Yarr::Parser::):
7978 (JSC::Yarr::Parser::parseTokens):
7979 (JSC::Yarr::Parser::parse):
7980 * yarr/RegexPattern.h:
7981 (JSC::Yarr::PatternTerm::):
7982 (JSC::Yarr::PatternTerm::PatternTerm):
7984 2009-04-22 Mark Rowe <mrowe@apple.com>
7986 Rubber-stamped by Gavin Barraclough.
7988 Add the m_ prefix on FixedVMPoolAllocator's member variables, and fix typos in a few comments.
7990 * jit/ExecutableAllocatorFixedVMPool.cpp:
7991 (JSC::FixedVMPoolAllocator::addToFreeList):
7992 (JSC::FixedVMPoolAllocator::coalesceFreeSpace):
7993 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
7994 (JSC::FixedVMPoolAllocator::alloc):
7995 (JSC::FixedVMPoolAllocator::free):
7996 (JSC::FixedVMPoolAllocator::isWithinVMPool):
7998 2009-04-22 Mark Rowe <mrowe@apple.com>
8000 Rubber-stamped by Gavin Barraclough.
8002 Add some assertions to FixedVMPoolAllocator to guard against cases where we
8003 attempt to free memory that didn't originate from the pool, or we attempt to
8004 hand out a bogus address from alloc.
8006 * jit/ExecutableAllocatorFixedVMPool.cpp:
8007 (JSC::FixedVMPoolAllocator::release):
8008 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8009 (JSC::FixedVMPoolAllocator::alloc):
8010 (JSC::FixedVMPoolAllocator::free):
8011 (JSC::FixedVMPoolAllocator::isWithinVMPool):
8013 2009-04-22 Gavin Barraclough <barraclough@apple.com>
8015 Rubber stamped by Sam "Blackbeard" Weinig.
8017 Although pirates do spell the word 'generate' as 'genertate',
8018 webkit developers do not. Fixertate.
8020 * yarr/RegexJIT.cpp:
8021 (JSC::Yarr::RegexGenerator::generateAssertionBOL):
8022 (JSC::Yarr::RegexGenerator::generateAssertionEOL):
8023 (JSC::Yarr::RegexGenerator::generateAssertionWordBoundary):
8024 (JSC::Yarr::RegexGenerator::generatePatternCharacterSingle):
8025 (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
8026 (JSC::Yarr::RegexGenerator::generatePatternCharacterFixed):
8027 (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
8028 (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
8029 (JSC::Yarr::RegexGenerator::generateCharacterClassSingle):
8030 (JSC::Yarr::RegexGenerator::generateCharacterClassFixed):
8031 (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
8032 (JSC::Yarr::RegexGenerator::generateCharacterClassNonGreedy):
8033 (JSC::Yarr::RegexGenerator::generateTerm):
8035 2009-04-22 Gavin Barraclough <barraclough@apple.com>
8037 Reviewed by Sam "Blackbeard" Weinig.
8039 Improvements to YARR JIT. This patch expands support in three key areas:
8040 * Add (temporary) support for falling back to PCRE for expressions not supported.
8041 * Add support for x86_64 and Windows.
8042 * Add support for singly quantified parentheses (? and ??), alternatives within
8043 parentheses, and parenthetical assertions.
8045 * runtime/RegExp.cpp:
8046 (JSC::RegExp::match):
8047 * yarr/RegexJIT.cpp:
8048 (JSC::Yarr::RegexGenerator::storeToFrame):
8049 (JSC::Yarr::RegexGenerator::storeToFrameWithPatch):
8050 (JSC::Yarr::RegexGenerator::loadFromFrameAndJump):
8051 (JSC::Yarr::RegexGenerator::AlternativeBacktrackRecord::AlternativeBacktrackRecord):
8052 (JSC::Yarr::RegexGenerator::TermGenerationState::resetAlternative):
8053 (JSC::Yarr::RegexGenerator::TermGenerationState::resetTerm):
8054 (JSC::Yarr::RegexGenerator::TermGenerationState::jumpToBacktrack):
8055 (JSC::Yarr::RegexGenerator::TermGenerationState::plantJumpToBacktrackIfExists):
8056 (JSC::Yarr::RegexGenerator::TermGenerationState::addBacktrackJump):
8057 (JSC::Yarr::RegexGenerator::TermGenerationState::linkAlternativeBacktracks):
8058 (JSC::Yarr::RegexGenerator::TermGenerationState::propagateBacktrackingFrom):
8059 (JSC::Yarr::RegexGenerator::genertateAssertionBOL):
8060 (JSC::Yarr::RegexGenerator::genertateAssertionEOL):
8061 (JSC::Yarr::RegexGenerator::matchAssertionWordchar):
8062 (JSC::Yarr::RegexGenerator::genertateAssertionWordBoundary):
8063 (JSC::Yarr::RegexGenerator::genertatePatternCharacterSingle):
8064 (JSC::Yarr::RegexGenerator::genertatePatternCharacterPair):
8065 (JSC::Yarr::RegexGenerator::genertatePatternCharacterFixed):
8066 (JSC::Yarr::RegexGenerator::genertatePatternCharacterGreedy):
8067 (JSC::Yarr::RegexGenerator::genertatePatternCharacterNonGreedy):
8068 (JSC::Yarr::RegexGenerator::genertateCharacterClassSingle):
8069 (JSC::Yarr::RegexGenerator::genertateCharacterClassFixed):
8070 (JSC::Yarr::RegexGenerator::genertateCharacterClassGreedy):
8071 (JSC::Yarr::RegexGenerator::genertateCharacterClassNonGreedy):
8072 (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction):
8073 (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
8074 (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
8075 (JSC::Yarr::RegexGenerator::generateTerm):
8076 (JSC::Yarr::RegexGenerator::generateDisjunction):
8077 (JSC::Yarr::RegexGenerator::generateEnter):
8078 (JSC::Yarr::RegexGenerator::generateReturn):
8079 (JSC::Yarr::RegexGenerator::RegexGenerator):
8080 (JSC::Yarr::RegexGenerator::generate):
8081 (JSC::Yarr::RegexGenerator::compile):
8082 (JSC::Yarr::RegexGenerator::generationFailed):
8083 (JSC::Yarr::jitCompileRegex):
8084 (JSC::Yarr::executeRegex):
8086 (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
8087 (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
8089 2009-04-22 Sam Weinig <sam@webkit.org>
8091 Rubber-stamped by Darin Adler.
8093 Fix for <rdar://problem/6816957>
8094 Turn off Geolocation by default
8096 * Configurations/FeatureDefines.xcconfig:
8098 2009-04-22 Oliver Hunt <oliver@apple.com>
8100 Reviewed by NOBODY (Buildfix).
8102 * interpreter/CachedCall.h:
8104 2009-04-21 Oliver Hunt <oliver@apple.com>
8106 Reviewed by NOBODY (Build fix).
8108 * runtime/StringPrototype.cpp:
8110 2009-04-21 Oliver Hunt <oliver@apple.com>
8112 Reviewed by Maciej Stachowiak.
8114 Improve String.replace performance slightly
8116 Apply our vm reentry caching logic to String.replace with global
8119 * runtime/StringPrototype.cpp:
8120 (JSC::stringProtoFuncReplace):
8122 2009-04-21 Geoffrey Garen <ggaren@apple.com>
8124 Reviewed by Cameron Zwarich and Oliver Hunt.
8126 Re-Fixed <rdar://problem/6406045> REGRESSION: Stack overflow on PowerPC on
8127 fast/workers/use-machine-stack.html (22531)
8129 SunSpider reports no change.
8131 Use a larger recursion limit on the main thread (because we can, and
8132 there's some evidence that it may improve compatibility), and a smaller
8133 recursion limit on secondary threads (because they tend to have smaller
8136 * interpreter/Interpreter.cpp:
8137 (JSC::Interpreter::execute):
8138 (JSC::Interpreter::prepareForRepeatCall):
8139 * interpreter/Interpreter.h:
8140 (JSC::): Ditto. I wrote the recursion test slightly funny, so that the
8141 common case remains a simple compare to constant.
8143 * runtime/ArrayPrototype.cpp:
8144 (JSC::arrayProtoFuncToString):
8145 (JSC::arrayProtoFuncToLocaleString):
8146 (JSC::arrayProtoFuncJoin): Conservatively, set the array recursion limits
8147 to the lower, secondary thread limit. We can do something fancier if
8148 compatibility moves us, but this seems sufficient for now.
8150 2009-04-21 Geoffrey Garen <ggaren@apple.com>
8152 Rubber-stamped by Adam Roben.
8154 Disabled one more Mozilla JS test because it fails intermittently on Windows.
8155 (See https://bugs.webkit.org/show_bug.cgi?id=25160.)
8157 * tests/mozilla/expected.html:
8159 2009-04-21 Adam Roben <aroben@apple.com>
8161 Rename JavaScriptCore_debug.dll to JavaScriptCore.dll in the Debug
8164 This matches the naming scheme for WebKit.dll, and will be necessary
8165 once Safari links against JavaScriptCore.dll. This change also causes
8166 run-safari not to fail (because the launcher printed by FindSafari was
8167 always looking for JavaScriptCore.dll, never
8168 JavaScriptCore_debug.dll).
8170 Part of Bug 25305: can't run safari or drt on windows
8171 <https://bugs.webkit.org/show_bug.cgi?id=25305>
8173 Reviewed by Steve Falkenburg and Sam Weinig.
8175 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8176 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
8177 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
8178 Use $(WebKitDLLConfigSuffix) for naming JavaScriptCore.{dll,lib}.
8180 2009-04-21 Adam Roben <aroben@apple.com>
8182 Fix JavaScriptCore build on VC++ Express
8184 Reviewed by Steve Falkenburg and Sam Weinig.
8186 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Link
8187 explicitly against gdi32.lib and oleaut32.lib.
8189 2009-04-21 Geoffrey Garen <ggaren@apple.com>
8191 Reviewed by Mark Rowe.
8193 Tiger crash fix: Put VM tags in their own header file, and fixed up the
8194 #ifdefs so they're not used on Tiger.
8196 * JavaScriptCore.xcodeproj/project.pbxproj:
8197 * interpreter/RegisterFile.h:
8198 (JSC::RegisterFile::RegisterFile):
8199 * jit/ExecutableAllocatorFixedVMPool.cpp:
8200 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8201 * jit/ExecutableAllocatorPosix.cpp:
8202 (JSC::ExecutablePool::systemAlloc):
8203 * runtime/Collector.cpp:
8204 (JSC::allocateBlock):
8205 * wtf/VMTags.h: Added.
8207 2009-04-20 Steve Falkenburg <sfalken@apple.com>
8209 More Windows build fixes.
8211 * JavaScriptCore.vcproj/JavaScriptCore.make: Copy DLLs, PDBs.
8212 * JavaScriptCore.vcproj/JavaScriptCore.resources: Added.
8213 * JavaScriptCore.vcproj/JavaScriptCore.resources/Info.plist: Added.
8214 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Added.
8215 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add version stamping, resource copying.
8217 2009-04-20 Steve Falkenburg <sfalken@apple.com>
8219 Separate JavaScriptCore.dll from WebKit.dll.
8220 Slight performance improvement or no change on benchmarks.
8222 Allows us to break a circular dependency between CFNetwork and WebKit on Windows,
8223 and simplifies standalone JavaScriptCore builds.
8225 Reviewed by Oliver Hunt.
8227 * API/JSBase.h: Export symbols with JS_EXPORT when using MSVC.
8228 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8229 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Build JavaScriptCore as a DLL instead of a static library.
8230 * config.h: Specify __declspec(dllexport/dllimport) appropriately when exporting data.
8231 * runtime/InternalFunction.h: Specify JS_EXPORTDATA on exported data.
8232 * runtime/JSArray.h: Specify JS_EXPORTDATA on exported data.
8233 * runtime/JSFunction.h: Specify JS_EXPORTDATA on exported data.
8234 * runtime/StringObject.h: Specify JS_EXPORTDATA on exported data.
8235 * runtime/UString.h: Specify JS_EXPORTDATA on exported data.
8237 2009-04-20 Sam Weinig <sam@webkit.org>
8239 Reviewed by Kevin McCullough.
8241 Always tag mmaped memory on darwin and clean up #defines
8242 now that they are a little bigger.
8244 * interpreter/RegisterFile.h:
8245 (JSC::RegisterFile::RegisterFile):
8246 * jit/ExecutableAllocatorFixedVMPool.cpp:
8247 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8248 * jit/ExecutableAllocatorPosix.cpp:
8249 (JSC::ExecutablePool::systemAlloc):
8250 * runtime/Collector.cpp:
8251 (JSC::allocateBlock):
8253 2009-04-20 Sam Weinig <sam@webkit.org>
8255 Rubber-stamped by Tim Hatcher.
8257 Add licenses for xcconfig files.
8259 * Configurations/Base.xcconfig:
8260 * Configurations/DebugRelease.xcconfig:
8261 * Configurations/FeatureDefines.xcconfig:
8262 * Configurations/JavaScriptCore.xcconfig:
8263 * Configurations/Version.xcconfig:
8265 2009-04-20 Ariya Hidayat <ariya.hidayat@nokia.com>
8267 Build fix for Qt port (after r42646). Not reviewed.
8269 * wtf/unicode/qt4/UnicodeQt4.h: Added U16_PREV.
8271 2009-04-19 Sam Weinig <sam@webkit.org>
8273 Reviewed by Darin Adler.
8275 Better fix for JSStringCreateWithCFString hardening.
8277 * API/JSStringRefCF.cpp:
8278 (JSStringCreateWithCFString):
8280 2009-04-19 Sam Weinig <sam@webkit.org>
8282 Reviewed by Dan Bernstein.
8284 Fix for <rdar://problem/5860954>
8285 Harden JSStringCreateWithCFString against malformed CFStringRefs.
8287 * API/JSStringRefCF.cpp:
8288 (JSStringCreateWithCFString):
8290 2009-04-19 David Kilzer <ddkilzer@apple.com>
8292 Make FEATURE_DEFINES completely dynamic
8294 Reviewed by Darin Adler.
8296 Make FEATURE_DEFINES depend on individual ENABLE_FEATURE_NAME
8297 variables for each feature, making it possible to remove all
8298 knowledge of FEATURE_DEFINES from build-webkit.
8300 * Configurations/FeatureDefines.xcconfig: Extract a variable
8301 from FEATURE_DEFINES for each feature setting.
8303 2009-04-18 Sam Weinig <sam@webkit.org>
8305 Reviewed by Dan Bernstein.
8307 Fix typo. s/VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE/VM_MEMORY_JAVASCRIPT_CORE/
8309 * runtime/Collector.cpp:
8310 (JSC::allocateBlock): Fix bozo typo.
8312 2009-04-18 Sam Weinig <sam@webkit.org>
8314 Reviewed by Anders Carlsson.
8316 Fix for <rdar://problem/6801555> Tag JavaScript memory on SnowLeopard
8318 * interpreter/RegisterFile.h:
8319 (JSC::RegisterFile::RegisterFile):
8320 * jit/ExecutableAllocatorFixedVMPool.cpp:
8321 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8322 * jit/ExecutableAllocatorPosix.cpp:
8323 (JSC::ExecutablePool::systemAlloc):
8324 * runtime/Collector.cpp:
8325 (JSC::allocateBlock):
8327 2009-04-18 Drew Wilson <amw@apple.com>
8329 <rdar://problem/6781407> VisiblePosition.characterAfter should return UChar32
8331 Reviewed by Dan Bernstein.
8333 * wtf/unicode/icu/UnicodeIcu.h:
8334 (WTF::Unicode::hasLineBreakingPropertyComplexContextOrIdeographic): Added.
8336 2009-04-18 Sam Weinig <sam@webkit.org>
8338 Reviewed by Mark Rowe.
8340 Fix for <rdar://problem/5861045>
8341 A little bit of hardening for UString.
8343 * runtime/UString.cpp:
8345 (JSC::UString::append):
8347 2009-04-18 Sam Weinig <sam@webkit.org>
8349 Reviewed by Mark Rowe and Dan Bernstein.
8351 Fix for <rdar://problem/5861188>
8352 A little bit of hardening for Vector.
8355 (WTF::Vector<T, inlineCapacity>::append):
8356 (WTF::Vector<T, inlineCapacity>::insert):
8358 2009-04-17 Gavin Barraclough <barraclough@apple.com>
8360 Reviewed by Geoff Garen.
8362 On x86_64, make all JIT-code allocations from a new heap, managed
8363 by FixedVMPoolAllocator. This class allocates a single large (2Gb)
8364 pool of virtual memory from which all further allocations take place.
8365 Since all JIT code is allocated from this pool, we can continue to
8366 safely assume (as is already asserted) that it will always be possible
8367 to link any JIT-code to JIT-code jumps and calls.
8369 * JavaScriptCore.xcodeproj/project.pbxproj:
8371 * jit/ExecutableAllocatorFixedVMPool.cpp: Added.
8372 (JSC::FreeListEntry::FreeListEntry):
8373 (JSC::AVLTreeAbstractorForFreeList::get_less):
8374 (JSC::AVLTreeAbstractorForFreeList::set_less):
8375 (JSC::AVLTreeAbstractorForFreeList::get_greater):
8376 (JSC::AVLTreeAbstractorForFreeList::set_greater):
8377 (JSC::AVLTreeAbstractorForFreeList::get_balance_factor):
8378 (JSC::AVLTreeAbstractorForFreeList::set_balance_factor):
8379 (JSC::AVLTreeAbstractorForFreeList::null):
8380 (JSC::AVLTreeAbstractorForFreeList::compare_key_key):
8381 (JSC::AVLTreeAbstractorForFreeList::compare_key_node):
8382 (JSC::AVLTreeAbstractorForFreeList::compare_node_node):
8383 (JSC::sortFreeListEntriesByPointer):
8384 (JSC::sortCommonSizedAllocations):
8385 (JSC::FixedVMPoolAllocator::release):
8386 (JSC::FixedVMPoolAllocator::reuse):
8387 (JSC::FixedVMPoolAllocator::addToFreeList):
8388 (JSC::FixedVMPoolAllocator::coalesceFreeSpace):
8389 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8390 (JSC::FixedVMPoolAllocator::alloc):
8391 (JSC::FixedVMPoolAllocator::free):
8392 (JSC::ExecutableAllocator::intializePageSize):
8393 (JSC::ExecutablePool::systemAlloc):
8394 (JSC::ExecutablePool::systemRelease):
8395 The new 2Gb heap class!
8396 * jit/ExecutableAllocatorPosix.cpp:
8397 Disable use of this implementation on x86_64.
8399 Add missing variable initialization.
8402 2009-04-17 Oliver Hunt <oliver@apple.com>
8404 Reviewed by Darin Adler.
8406 Fix bug where the VM reentry cache would not correctly unroll the cached callframe
8408 Fix a check that was intended to mark a cached call as invalid when the callframe could
8409 not be constructed. Instead it was just checking that there was a place to put the
8410 exception. This eventually results in a non-recoverable RegisterFile starvation.
8412 * interpreter/CachedCall.h:
8413 (JSC::CachedCall::CachedCall):
8414 (JSC::CachedCall::call): add assertion to ensure we don't use a bad callframe
8416 2009-04-17 David Kilzer <ddkilzer@apple.com>
8418 Simplify FEATURE_DEFINES definition
8420 Reviewed by Darin Adler.
8422 This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
8423 variables to their own FeatureDefines.xcconfig file. It also
8424 extracts a new ENABLE_GEOLOCATION variable so that
8425 FEATURE_DEFINES only needs to be defined once.
8427 * Configurations/FeatureDefines.xcconfig: Added.
8428 * Configurations/JavaScriptCore.xcconfig: Removed definition of
8429 ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES. Added include
8430 of FeatureDefines.xcconfig.
8431 * JavaScriptCore.xcodeproj/project.pbxproj: Added
8432 FeatureDefines.xcconfig file.
8434 2009-04-08 Mihnea Ovidenie <mihnea@adobe.com>
8436 Reviewed by Oliver Hunt.
8438 Bug 25027: JavaScript parseInt wrong on negative numbers
8439 <https://bugs.webkit.org/show_bug.cgi?id=25027>
8441 When dealing with negative numbers, parseInt should use ceil instead of floor.
8443 * runtime/JSGlobalObjectFunctions.cpp:
8444 (JSC::globalFuncParseInt):
8446 2009-04-16 Stephanie Lewis <slewis@apple.com>
8448 Reviewed by Oliver Hunt.
8450 <rdar://problem/6744652> 32-bit to 64-bit: Javascript hash tables double in size
8452 Remove perfect hash optimization which removes 1 MB of overhead on 32-bit and almost 2 MB on 64-bit. Removing the optimization was not a regression on SunSpider and the acid 3 test still passes.
8454 * create_hash_table:
8455 * runtime/Lookup.cpp:
8456 (JSC::HashTable::createTable):
8457 (JSC::HashTable::deleteTable):
8459 (JSC::HashEntry::initialize):
8460 (JSC::HashEntry::next):
8461 (JSC::HashTable::entry):
8462 * runtime/Structure.cpp:
8463 (JSC::Structure::getEnumerableNamesFromClassInfoTable):
8465 2009-04-16 Oliver Hunt <oliver@apple.com>
8467 Reviewed by Gavin Barraclough.
8469 Fix subtle error in optimised VM reentry in Array.sort
8471 Basically to ensure we don't accidentally invalidate the cached callframe
8472 we should be using the cached callframe rather than our own exec state.
8473 While the old behaviour was wrong i have been unable to actually create a
8474 test case where anything actually ends up going wrong.
8476 * interpreter/CachedCall.h:
8477 (JSC::CachedCall::newCallFrame):
8478 * runtime/JSArray.cpp:
8479 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
8481 2009-04-16 Oliver Hunt <oliver@apple.com>
8483 Reviewed by Gavin Barraclough.
8485 Optimise op_resolve_base
8487 If we can statically find a property we are trying to resolve
8488 the base of, the base is guaranteed to be the global object.
8490 * bytecompiler/BytecodeGenerator.cpp:
8491 (JSC::BytecodeGenerator::emitResolveBase):
8493 2009-04-16 Oliver Hunt <oliver@apple.com>
8495 Reviewed by Gavin Barraclough.
8497 Improve performance of read-write-modify operators
8499 Implement cross scope optimisation for read-write-modify
8500 operators, to avoid unnecessary calls to property resolve
8503 * bytecompiler/BytecodeGenerator.cpp:
8504 (JSC::BytecodeGenerator::BytecodeGenerator):
8505 (JSC::BytecodeGenerator::emitLoadGlobalObject):
8506 (JSC::BytecodeGenerator::emitResolveWithBase):
8507 * bytecompiler/BytecodeGenerator.h:
8509 2009-04-16 Oliver Hunt <oliver@apple.com>
8511 Reviewed by Gavin Barraclough.
8513 Improve performance of remaining array enumeration functions
8515 Make use of function entry cache for remaining Array enumeration functions.
8517 * runtime/ArrayPrototype.cpp:
8518 (JSC::arrayProtoFuncMap):
8519 (JSC::arrayProtoFuncEvery):
8520 (JSC::arrayProtoFuncForEach):
8521 (JSC::arrayProtoFuncSome):
8523 2009-04-15 Oliver Hunt <oliver@apple.com>
8525 Reviewed by Gavin Barraclough.
8527 Improve performance of Array.sort
8529 Cache the VM entry for Array.sort when using a JS comparison function.
8531 * runtime/JSArray.cpp:
8532 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
8533 (JSC::JSArray::sort):
8535 2009-04-15 Oliver Hunt <oliver@apple.com>
8537 Reviewed by Gavin Barraclough.
8539 Bug 25229: Need support for Array.prototype.reduceRight
8540 <https://bugs.webkit.org/show_bug.cgi?id=25229>
8542 Implement Array.reduceRight
8544 * runtime/ArrayPrototype.cpp:
8545 (JSC::arrayProtoFuncReduceRight):
8547 2009-04-15 Oliver Hunt <oliver@apple.com>
8549 Reviewed by Gavin Barraclough.
8551 Bug 25227: Array.filter triggers an assertion when the target array shrinks while being filtered
8552 <https://bugs.webkit.org/show_bug.cgi?id=25227>
8554 We correct this simply by making the fast array path fall back on the slow path if
8555 we ever discover the fast access is unsafe.
8557 * runtime/ArrayPrototype.cpp:
8558 (JSC::arrayProtoFuncFilter):
8560 2009-04-13 Oliver Hunt <oliver@apple.com>
8562 Reviewed by Gavin Barraclough.
8564 Bug 25159: Support Array.prototype.reduce
8565 <https://bugs.webkit.org/show_bug.cgi?id=25159>
8567 Implement Array.prototype.reduce
8569 * runtime/ArrayPrototype.cpp:
8570 (JSC::arrayProtoFuncReduce):
8572 2009-04-15 Oliver Hunt <oliver@apple.com>
8574 Reviewed by NOBODY (Build fix).
8576 Move CallFrameClosure from inside the Interpreter class to its own file.
8578 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8579 * JavaScriptCore.xcodeproj/project.pbxproj:
8580 * interpreter/CachedCall.h:
8581 * interpreter/CallFrameClosure.h: Copied from JavaScriptCore/yarr/RegexJIT.h.
8582 (JSC::CallFrameClosure::setArgument):
8583 (JSC::CallFrameClosure::resetCallFrame):
8584 * interpreter/Interpreter.cpp:
8585 (JSC::Interpreter::prepareForRepeatCall):
8586 * interpreter/Interpreter.h:
8588 2009-04-14 Oliver Hunt <oliver@apple.com>
8590 Reviewed by Cameron Zwarich.
8592 Bug 25202: Improve performance of repeated callbacks into the VM
8594 Add the concept of a CachedCall to native code for use in Array
8595 prototype and similar functions where a single callback function
8596 is called repeatedly with the same number of arguments.
8598 Used Array.prototype.filter as the test function and got a 50% win
8599 over a naive non-caching specialised version. This makes the native
8600 implementation of Array.prototype.filter faster than the JS one once
8603 * JavaScriptCore.vcproj/JavaScriptCore.sln:
8604 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8605 * JavaScriptCore.xcodeproj/project.pbxproj:
8606 * interpreter/CachedCall.h: Added.
8607 (JSC::CachedCall::CachedCall):
8608 (JSC::CachedCall::call):
8609 (JSC::CachedCall::setThis):
8610 (JSC::CachedCall::setArgument):
8611 (JSC::CachedCall::~CachedCall):
8612 CachedCall is a wrapper that automates the calling and teardown
8613 for a CallFrameClosure
8614 * interpreter/CallFrame.h:
8615 * interpreter/Interpreter.cpp:
8616 (JSC::Interpreter::prepareForRepeatCall):
8617 Create the basic entry closure for a function
8618 (JSC::Interpreter::execute):
8619 A new ::execute method to enter the interpreter from a closure
8620 (JSC::Interpreter::endRepeatCall):
8621 Clear the entry closure
8622 * interpreter/Interpreter.h:
8623 (JSC::Interpreter::CallFrameClosure::setArgument):
8624 (JSC::Interpreter::CallFrameClosure::resetCallFrame):
8625 Helper functions to simplify setting up the closure's callframe
8626 * runtime/ArrayPrototype.cpp:
8627 (JSC::arrayProtoFuncFilter):
8629 2009-04-14 Xan Lopez <xlopez@igalia.com>
8633 Add the yarr headers (and only the headers) to the build, so that
8634 RegExp.cpp can compile. The headers are ifdefed out with yarr
8635 disabled, so we don't need anything else for now.
8639 2009-04-14 Adam Roben <aroben@apple.com>
8641 Remove support for profile-guided optimization on Windows
8643 Rubber-stamped by Steve Falkenburg.
8645 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed
8646 the Release_PGO configuration. Also let VS re-order the source files
8649 2009-04-14 Xan Lopez <xlopez@igalia.com>
8651 Unreviewed build fix.
8655 2009-04-14 Jan Michael Alonzo <jmalonzo@webkit.org>
8657 Gtk build fix when building minidom. Not reviewed.
8659 Use C-style comment instead of C++ style since autotools builds
8660 minidom using gcc and not g++.
8664 2009-04-14 Gavin Barraclough <barraclough@apple.com>
8666 Reviewed by NOBODY - speculative build fix.
8670 2009-04-13 Gavin Barraclough <barraclough@apple.com>
8672 Reviewed by Cap'n Geoff Garen.
8675 (Yet another regex runtime).
8677 Currently disabled by default since the interpreter, whilst awesomely
8678 functional, has not been optimized and is likely slower than PCRE, and
8679 the JIT, whilst faster than WREC, is presently incomplete and does not
8680 fallback to using an interpreter for the cases it cannot handle.
8682 * JavaScriptCore.xcodeproj/project.pbxproj:
8683 * assembler/MacroAssemblerX86Common.h:
8684 (JSC::MacroAssemblerX86Common::move):
8685 (JSC::MacroAssemblerX86Common::swap):
8686 (JSC::MacroAssemblerX86Common::signExtend32ToPtr):
8687 (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr):
8688 (JSC::MacroAssemblerX86Common::branch32):
8689 (JSC::MacroAssemblerX86Common::branch16):
8690 * assembler/X86Assembler.h:
8691 (JSC::X86Assembler::cmpw_im):
8692 (JSC::X86Assembler::testw_rr):
8693 (JSC::X86Assembler::X86InstructionFormatter::immediate16):
8694 * runtime/RegExp.cpp:
8695 (JSC::RegExp::RegExp):
8696 (JSC::RegExp::~RegExp):
8697 (JSC::RegExp::create):
8698 (JSC::RegExp::compile):
8699 (JSC::RegExp::match):
8703 * yarr/RegexCompiler.cpp: Added.
8704 (JSC::Yarr::CharacterClassConstructor::CharacterClassConstructor):
8705 (JSC::Yarr::CharacterClassConstructor::reset):
8706 (JSC::Yarr::CharacterClassConstructor::append):
8707 (JSC::Yarr::CharacterClassConstructor::putChar):
8708 (JSC::Yarr::CharacterClassConstructor::isUnicodeUpper):
8709 (JSC::Yarr::CharacterClassConstructor::isUnicodeLower):
8710 (JSC::Yarr::CharacterClassConstructor::putRange):
8711 (JSC::Yarr::CharacterClassConstructor::charClass):
8712 (JSC::Yarr::CharacterClassConstructor::addSorted):
8713 (JSC::Yarr::CharacterClassConstructor::addSortedRange):
8714 (JSC::Yarr::newlineCreate):
8715 (JSC::Yarr::digitsCreate):
8716 (JSC::Yarr::spacesCreate):
8717 (JSC::Yarr::wordcharCreate):
8718 (JSC::Yarr::nondigitsCreate):
8719 (JSC::Yarr::nonspacesCreate):
8720 (JSC::Yarr::nonwordcharCreate):
8721 (JSC::Yarr::RegexPatternConstructor::RegexPatternConstructor):
8722 (JSC::Yarr::RegexPatternConstructor::~RegexPatternConstructor):
8723 (JSC::Yarr::RegexPatternConstructor::reset):
8724 (JSC::Yarr::RegexPatternConstructor::assertionBOL):
8725 (JSC::Yarr::RegexPatternConstructor::assertionEOL):
8726 (JSC::Yarr::RegexPatternConstructor::assertionWordBoundary):
8727 (JSC::Yarr::RegexPatternConstructor::atomPatternCharacter):
8728 (JSC::Yarr::RegexPatternConstructor::atomBuiltInCharacterClass):
8729 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassBegin):
8730 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassAtom):
8731 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassRange):
8732 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassBuiltIn):
8733 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassEnd):
8734 (JSC::Yarr::RegexPatternConstructor::atomParenthesesSubpatternBegin):
8735 (JSC::Yarr::RegexPatternConstructor::atomParentheticalAssertionBegin):
8736 (JSC::Yarr::RegexPatternConstructor::atomParenthesesEnd):
8737 (JSC::Yarr::RegexPatternConstructor::atomBackReference):
8738 (JSC::Yarr::RegexPatternConstructor::copyDisjunction):
8739 (JSC::Yarr::RegexPatternConstructor::copyTerm):
8740 (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
8741 (JSC::Yarr::RegexPatternConstructor::disjunction):
8742 (JSC::Yarr::RegexPatternConstructor::regexBegin):
8743 (JSC::Yarr::RegexPatternConstructor::regexEnd):
8744 (JSC::Yarr::RegexPatternConstructor::regexError):
8745 (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
8746 (JSC::Yarr::RegexPatternConstructor::setupDisjunctionOffsets):
8747 (JSC::Yarr::RegexPatternConstructor::setupOffsets):
8748 (JSC::Yarr::compileRegex):
8749 * yarr/RegexCompiler.h: Added.
8750 * yarr/RegexInterpreter.cpp: Added.
8751 (JSC::Yarr::Interpreter::appendParenthesesDisjunctionContext):
8752 (JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):
8753 (JSC::Yarr::Interpreter::DisjunctionContext::DisjunctionContext):
8754 (JSC::Yarr::Interpreter::DisjunctionContext::operator new):
8755 (JSC::Yarr::Interpreter::allocDisjunctionContext):
8756 (JSC::Yarr::Interpreter::freeDisjunctionContext):
8757 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
8758 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::operator new):
8759 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::restoreOutput):
8760 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::getDisjunctionContext):
8761 (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
8762 (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
8763 (JSC::Yarr::Interpreter::InputStream::InputStream):
8764 (JSC::Yarr::Interpreter::InputStream::next):
8765 (JSC::Yarr::Interpreter::InputStream::rewind):
8766 (JSC::Yarr::Interpreter::InputStream::read):
8767 (JSC::Yarr::Interpreter::InputStream::readChecked):
8768 (JSC::Yarr::Interpreter::InputStream::reread):
8769 (JSC::Yarr::Interpreter::InputStream::prev):
8770 (JSC::Yarr::Interpreter::InputStream::getPos):
8771 (JSC::Yarr::Interpreter::InputStream::setPos):
8772 (JSC::Yarr::Interpreter::InputStream::atStart):
8773 (JSC::Yarr::Interpreter::InputStream::atEnd):
8774 (JSC::Yarr::Interpreter::InputStream::checkInput):
8775 (JSC::Yarr::Interpreter::InputStream::uncheckInput):
8776 (JSC::Yarr::Interpreter::testCharacterClass):
8777 (JSC::Yarr::Interpreter::tryConsumeCharacter):
8778 (JSC::Yarr::Interpreter::checkCharacter):
8779 (JSC::Yarr::Interpreter::tryConsumeCharacterClass):
8780 (JSC::Yarr::Interpreter::checkCharacterClass):
8781 (JSC::Yarr::Interpreter::tryConsumeBackReference):
8782 (JSC::Yarr::Interpreter::matchAssertionBOL):
8783 (JSC::Yarr::Interpreter::matchAssertionEOL):
8784 (JSC::Yarr::Interpreter::matchAssertionWordBoundary):
8785 (JSC::Yarr::Interpreter::matchPatternCharacter):
8786 (JSC::Yarr::Interpreter::backtrackPatternCharacter):
8787 (JSC::Yarr::Interpreter::matchCharacterClass):
8788 (JSC::Yarr::Interpreter::backtrackCharacterClass):
8789 (JSC::Yarr::Interpreter::matchBackReference):
8790 (JSC::Yarr::Interpreter::backtrackBackReference):
8791 (JSC::Yarr::Interpreter::recordParenthesesMatch):
8792 (JSC::Yarr::Interpreter::resetMatches):
8793 (JSC::Yarr::Interpreter::resetAssertionMatches):
8794 (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
8795 (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
8796 (JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
8797 (JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
8798 (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
8799 (JSC::Yarr::Interpreter::matchParentheticalAssertionOnceBegin):
8800 (JSC::Yarr::Interpreter::matchParentheticalAssertionOnceEnd):
8801 (JSC::Yarr::Interpreter::backtrackParentheticalAssertionOnceBegin):
8802 (JSC::Yarr::Interpreter::backtrackParentheticalAssertionOnceEnd):
8803 (JSC::Yarr::Interpreter::matchParentheses):
8804 (JSC::Yarr::Interpreter::backtrackParentheses):
8805 (JSC::Yarr::Interpreter::matchTerm):
8806 (JSC::Yarr::Interpreter::backtrackTerm):
8807 (JSC::Yarr::Interpreter::matchAlternative):
8808 (JSC::Yarr::Interpreter::matchDisjunction):
8809 (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
8810 (JSC::Yarr::Interpreter::interpret):
8811 (JSC::Yarr::Interpreter::Interpreter):
8812 (JSC::Yarr::ByteCompiler::ParenthesesStackEntry::ParenthesesStackEntry):
8813 (JSC::Yarr::ByteCompiler::ByteCompiler):
8814 (JSC::Yarr::ByteCompiler::compile):
8815 (JSC::Yarr::ByteCompiler::checkInput):
8816 (JSC::Yarr::ByteCompiler::assertionBOL):
8817 (JSC::Yarr::ByteCompiler::assertionEOL):
8818 (JSC::Yarr::ByteCompiler::assertionWordBoundary):
8819 (JSC::Yarr::ByteCompiler::atomPatternCharacter):
8820 (JSC::Yarr::ByteCompiler::atomCharacterClass):
8821 (JSC::Yarr::ByteCompiler::atomBackReference):
8822 (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
8823 (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
8824 (JSC::Yarr::ByteCompiler::popParenthesesStack):
8825 (JSC::Yarr::ByteCompiler::dumpDisjunction):
8826 (JSC::Yarr::ByteCompiler::closeAlternative):
8827 (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
8828 (JSC::Yarr::ByteCompiler::regexBegin):
8829 (JSC::Yarr::ByteCompiler::regexEnd):
8830 (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
8831 (JSC::Yarr::ByteCompiler::emitDisjunction):
8832 (JSC::Yarr::byteCompileRegex):
8833 (JSC::Yarr::interpretRegex):
8834 * yarr/RegexInterpreter.h: Added.
8835 (JSC::Yarr::ByteTerm::):
8836 (JSC::Yarr::ByteTerm::ByteTerm):
8837 (JSC::Yarr::ByteTerm::BOL):
8838 (JSC::Yarr::ByteTerm::CheckInput):
8839 (JSC::Yarr::ByteTerm::EOL):
8840 (JSC::Yarr::ByteTerm::WordBoundary):
8841 (JSC::Yarr::ByteTerm::BackReference):
8842 (JSC::Yarr::ByteTerm::AlternativeBegin):
8843 (JSC::Yarr::ByteTerm::AlternativeDisjunction):
8844 (JSC::Yarr::ByteTerm::AlternativeEnd):
8845 (JSC::Yarr::ByteTerm::PatternEnd):
8846 (JSC::Yarr::ByteTerm::invert):
8847 (JSC::Yarr::ByteTerm::capture):
8848 (JSC::Yarr::ByteDisjunction::ByteDisjunction):
8849 (JSC::Yarr::BytecodePattern::BytecodePattern):
8850 (JSC::Yarr::BytecodePattern::~BytecodePattern):
8851 * yarr/RegexJIT.cpp: Added.
8852 (JSC::Yarr::RegexGenerator::optimizeAlternative):
8853 (JSC::Yarr::RegexGenerator::matchCharacterClassRange):
8854 (JSC::Yarr::RegexGenerator::matchCharacterClass):
8855 (JSC::Yarr::RegexGenerator::jumpIfNoAvailableInput):
8856 (JSC::Yarr::RegexGenerator::jumpIfAvailableInput):
8857 (JSC::Yarr::RegexGenerator::checkInput):
8858 (JSC::Yarr::RegexGenerator::atEndOfInput):
8859 (JSC::Yarr::RegexGenerator::notAtEndOfInput):
8860 (JSC::Yarr::RegexGenerator::jumpIfCharEquals):
8861 (JSC::Yarr::RegexGenerator::jumpIfCharNotEquals):
8862 (JSC::Yarr::RegexGenerator::readCharacter):
8863 (JSC::Yarr::RegexGenerator::storeToFrame):
8864 (JSC::Yarr::RegexGenerator::loadFromFrame):
8865 (JSC::Yarr::RegexGenerator::TermGenerationState::TermGenerationState):
8866 (JSC::Yarr::RegexGenerator::TermGenerationState::resetAlternative):
8867 (JSC::Yarr::RegexGenerator::TermGenerationState::alternativeValid):
8868 (JSC::Yarr::RegexGenerator::TermGenerationState::nextAlternative):
8869 (JSC::Yarr::RegexGenerator::TermGenerationState::alternative):
8870 (JSC::Yarr::RegexGenerator::TermGenerationState::resetTerm):
8871 (JSC::Yarr::RegexGenerator::TermGenerationState::termValid):
8872 (JSC::Yarr::RegexGenerator::TermGenerationState::nextTerm):
8873 (JSC::Yarr::RegexGenerator::TermGenerationState::term):
8874 (JSC::Yarr::RegexGenerator::TermGenerationState::lookaheadTerm):
8875 (JSC::Yarr::RegexGenerator::TermGenerationState::isSinglePatternCharacterLookaheadTerm):
8876 (JSC::Yarr::RegexGenerator::TermGenerationState::inputOffset):
8877 (JSC::Yarr::RegexGenerator::TermGenerationState::jumpToBacktrack):
8878 (JSC::Yarr::RegexGenerator::TermGenerationState::setBacktrackGenerated):
8879 (JSC::Yarr::RegexGenerator::jumpToBacktrackCheckEmitPending):
8880 (JSC::Yarr::RegexGenerator::genertateAssertionBOL):
8881 (JSC::Yarr::RegexGenerator::genertateAssertionEOL):
8882 (JSC::Yarr::RegexGenerator::matchAssertionWordchar):
8883 (JSC::Yarr::RegexGenerator::genertateAssertionWordBoundary):
8884 (JSC::Yarr::RegexGenerator::genertatePatternCharacterSingle):
8885 (JSC::Yarr::RegexGenerator::genertatePatternCharacterPair):
8886 (JSC::Yarr::RegexGenerator::genertatePatternCharacterFixed):
8887 (JSC::Yarr::RegexGenerator::genertatePatternCharacterGreedy):
8888 (JSC::Yarr::RegexGenerator::genertatePatternCharacterNonGreedy):
8889 (JSC::Yarr::RegexGenerator::genertateCharacterClassSingle):
8890 (JSC::Yarr::RegexGenerator::genertateCharacterClassFixed):
8891 (JSC::Yarr::RegexGenerator::genertateCharacterClassGreedy):
8892 (JSC::Yarr::RegexGenerator::genertateCharacterClassNonGreedy):
8893 (JSC::Yarr::RegexGenerator::generateParenthesesSingleDisjunctionOneAlternative):
8894 (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
8895 (JSC::Yarr::RegexGenerator::generateTerm):
8896 (JSC::Yarr::RegexGenerator::generateDisjunction):
8897 (JSC::Yarr::RegexGenerator::RegexGenerator):
8898 (JSC::Yarr::RegexGenerator::generate):
8899 (JSC::Yarr::jitCompileRegex):
8900 (JSC::Yarr::executeRegex):
8901 * yarr/RegexJIT.h: Added.
8902 (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
8903 * yarr/RegexParser.h: Added.
8905 (JSC::Yarr::Parser::):
8906 (JSC::Yarr::Parser::CharacterClassParserDelegate::CharacterClassParserDelegate):
8907 (JSC::Yarr::Parser::CharacterClassParserDelegate::begin):
8908 (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacterUnescaped):
8909 (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
8910 (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
8911 (JSC::Yarr::Parser::CharacterClassParserDelegate::end):
8912 (JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
8913 (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
8914 (JSC::Yarr::Parser::CharacterClassParserDelegate::flush):
8915 (JSC::Yarr::Parser::CharacterClassParserDelegate::):
8916 (JSC::Yarr::Parser::Parser):
8917 (JSC::Yarr::Parser::parseEscape):
8918 (JSC::Yarr::Parser::parseAtomEscape):
8919 (JSC::Yarr::Parser::parseCharacterClassEscape):
8920 (JSC::Yarr::Parser::parseCharacterClass):
8921 (JSC::Yarr::Parser::parseParenthesesBegin):
8922 (JSC::Yarr::Parser::parseParenthesesEnd):
8923 (JSC::Yarr::Parser::parseQuantifier):
8924 (JSC::Yarr::Parser::parseTokens):
8925 (JSC::Yarr::Parser::parse):
8926 (JSC::Yarr::Parser::saveState):
8927 (JSC::Yarr::Parser::restoreState):
8928 (JSC::Yarr::Parser::atEndOfPattern):
8929 (JSC::Yarr::Parser::peek):
8930 (JSC::Yarr::Parser::peekIsDigit):
8931 (JSC::Yarr::Parser::peekDigit):
8932 (JSC::Yarr::Parser::consume):
8933 (JSC::Yarr::Parser::consumeDigit):
8934 (JSC::Yarr::Parser::consumeNumber):
8935 (JSC::Yarr::Parser::consumeOctal):
8936 (JSC::Yarr::Parser::tryConsume):
8937 (JSC::Yarr::Parser::tryConsumeHex):
8939 * yarr/RegexPattern.h: Added.
8940 (JSC::Yarr::CharacterRange::CharacterRange):
8942 (JSC::Yarr::PatternTerm::):
8943 (JSC::Yarr::PatternTerm::PatternTerm):
8944 (JSC::Yarr::PatternTerm::BOL):
8945 (JSC::Yarr::PatternTerm::EOL):
8946 (JSC::Yarr::PatternTerm::WordBoundary):
8947 (JSC::Yarr::PatternTerm::invert):
8948 (JSC::Yarr::PatternTerm::capture):
8949 (JSC::Yarr::PatternTerm::quantify):
8950 (JSC::Yarr::PatternAlternative::PatternAlternative):
8951 (JSC::Yarr::PatternAlternative::lastTerm):
8952 (JSC::Yarr::PatternAlternative::removeLastTerm):
8953 (JSC::Yarr::PatternDisjunction::PatternDisjunction):
8954 (JSC::Yarr::PatternDisjunction::~PatternDisjunction):
8955 (JSC::Yarr::PatternDisjunction::addNewAlternative):
8956 (JSC::Yarr::RegexPattern::RegexPattern):
8957 (JSC::Yarr::RegexPattern::~RegexPattern):
8958 (JSC::Yarr::RegexPattern::reset):
8959 (JSC::Yarr::RegexPattern::containsIllegalBackReference):
8960 (JSC::Yarr::RegexPattern::newlineCharacterClass):
8961 (JSC::Yarr::RegexPattern::digitsCharacterClass):
8962 (JSC::Yarr::RegexPattern::spacesCharacterClass):
8963 (JSC::Yarr::RegexPattern::wordcharCharacterClass):
8964 (JSC::Yarr::RegexPattern::nondigitsCharacterClass):
8965 (JSC::Yarr::RegexPattern::nonspacesCharacterClass):
8966 (JSC::Yarr::RegexPattern::nonwordcharCharacterClass):
8968 2009-04-13 Oliver Hunt <oliver@apple.com>
8970 Reviewed by NOBODY (Missed code from last patch).
8972 * runtime/InternalFunction.cpp:
8973 (JSC::InternalFunction::displayName):
8974 (JSC::InternalFunction::calculatedDisplayName):
8975 * runtime/InternalFunction.h:
8977 2009-04-13 Francisco Tolmasky <francisco@280north.com>
8979 Reviewed by Oliver Hunt.
8981 BUG 25171: It should be possible to manually set the name of an anonymous function
8982 <https://bugs.webkit.org/show_bug.cgi?id=25171>
8984 This change adds the displayName property to functions, which when set overrides the
8985 normal name when appearing in the console.
8987 * profiler/Profiler.cpp:
8988 (JSC::createCallIdentifierFromFunctionImp): Changed call to InternalFunction::name to InternalFunction::calculatedDisplayName
8989 * runtime/CommonIdentifiers.h: Added displayName common identifier.
8990 * runtime/InternalFunction.cpp:
8991 (JSC::InternalFunction::displayName): Access to user settable displayName property
8992 (JSC::InternalFunction::calculatedDisplayName): Returns displayName if it exists, if not then the natural name
8994 2009-04-13 Geoffrey Garen <ggaren@apple.com>
8996 Reviewed by Sam Weinig.
8998 Disabled another JavaScriptCore test because it fails on Windows but
8999 not Mac, so it makes the bots red.
9001 * tests/mozilla/expected.html:
9003 2009-04-13 Geoffrey Garen <ggaren@apple.com>
9005 Reviewed by Sam Weinig.
9007 Disabled two JavaScriptCore tests because they fail on Window or Mac but
9008 not both, so they make the bots red.
9010 * tests/mozilla/expected.html: Updated expected results.
9012 2009-04-09 Ben Murdoch <benm@google.com>
9014 Reviewed by Alexey Proskuryakov.
9016 https://bugs.webkit.org/show_bug.cgi?id=25091
9017 The Android platform requires threads to be registered with the VM.
9018 This patch implements this behaviour inside ThreadingPthreads.cpp.
9020 * wtf/ThreadingPthreads.cpp: Add a level above threadEntryPoint that takes care of (un)registering threads with the VM.
9021 (WTF::runThreadWithRegistration): register the thread and run entryPoint. Unregister the thread afterwards.
9022 (WTF::createThreadInternal): call runThreadWithRegistration instead of entryPoint directly.
9024 2009-04-09 David Kilzer <ddkilzer@apple.com>
9026 Reinstating <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
9028 Rolled r42345 back in. The build failure was caused by an
9029 internal script which had not been updated the same way that
9030 build-webkit was updated.
9032 * Configurations/JavaScriptCore.xcconfig:
9034 2009-04-09 Alexey Proskuryakov <ap@webkit.org>
9036 Reverting <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings.
9037 It broke Mac build, and I don't know how to fix it.
9039 * Configurations/JavaScriptCore.xcconfig:
9041 2009-04-09 Xan Lopez <xlopez@igalia.com>
9043 Unreviewed build fix.
9045 Checking for __GLIBCXX__ being bigger than some date is not enough
9046 to get std::tr1, C++0x has to be in use too. Add another check for
9047 __GXX_EXPERIMENTAL_CXX0X__.
9051 2009-04-08 Oliver Hunt <oliver@apple.com>
9053 Reviewed by Adam Roben.
9055 Fix assertion failure in function.apply
9057 The result of excess arguments to function.apply is irrelevant
9058 so we don't need to provide a result register. We were providing
9059 temporary result register but not ref'ing it resulting in an
9063 (JSC::ApplyFunctionCallDotNode::emitBytecode):
9065 2009-04-08 David Kilzer <ddkilzer@apple.com>
9067 <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
9069 Reviewed by Darin Adler and Maciej Stachowiak.
9071 Introduce the ENABLE_SVG_DOM_OBJC_BINDINGS feature define so
9072 that SVG DOM Objective-C bindings may be optionally disabled.
9074 * Configurations/JavaScriptCore.xcconfig: Added
9075 ENABLE_SVG_DOM_OBJC_BINDINGS variable and use it in
9078 2009-04-08 Paul Pedriana <ppedriana@ea.com>
9080 Reviewed by Darin Adler.
9082 https://bugs.webkit.org/show_bug.cgi?id=20422
9083 Allow custom memory allocation control.
9085 * wtf/FastAllocBase.h:
9086 New added file. Implements allocation base class.
9088 Augments existing type traits support as needed by FastAllocBase.
9090 Changed to support FastMalloc match validation.
9091 * wtf/FastMalloc.cpp:
9092 Changed to support FastMalloc match validation.
9094 Added ENABLE_FAST_MALLOC_MATCH_VALIDATION; defaults to 0.
9096 Updated to include added FastAllocBase.h.
9097 * JavaScriptCore.xcodeproj/project.pbxproj:
9098 Updated to include added FastAllocBase.h.
9099 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
9100 Updated to include added FastAllocBase.h.
9102 2009-04-07 Oliver Hunt <oliver@apple.com>
9104 Reviewed by Geoff Garen.
9106 Improve function.apply performance
9108 Jump through a few hoops to improve performance of function.apply in the general case.
9110 In the case of zero or one arguments, or if there are only two arguments and the
9111 second is an array literal we treat function.apply as function.call.
9113 Otherwise we use the new opcodes op_load_varargs and op_call_varargs to do the .apply call
9114 without re-entering the virtual machine.
9116 * bytecode/CodeBlock.cpp:
9117 (JSC::CodeBlock::dump):
9118 * bytecode/Opcode.h:
9119 * bytecompiler/BytecodeGenerator.cpp:
9120 (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
9121 (JSC::BytecodeGenerator::emitLoadVarargs):
9122 (JSC::BytecodeGenerator::emitCallVarargs):
9123 * bytecompiler/BytecodeGenerator.h:
9124 * interpreter/Interpreter.cpp:
9125 (JSC::Interpreter::privateExecute):
9127 (JSC::JIT::privateCompileMainPass):
9128 (JSC::JIT::privateCompileSlowCases):
9131 (JSC::JIT::compileOpCallSetupArgs):
9132 (JSC::JIT::compileOpCallVarargsSetupArgs):
9133 (JSC::JIT::compileOpCallVarargs):
9134 (JSC::JIT::compileOpCallVarargsSlowCase):
9136 (JSC::JITStubs::cti_op_load_varargs):
9140 (JSC::ArrayNode::isSimpleArray):
9141 (JSC::ArrayNode::toArgumentList):
9142 (JSC::CallFunctionCallDotNode::emitBytecode):
9143 (JSC::ApplyFunctionCallDotNode::emitBytecode):
9145 (JSC::ExpressionNode::):
9146 (JSC::ApplyFunctionCallDotNode::):
9147 * runtime/Arguments.cpp:
9148 (JSC::Arguments::copyToRegisters):
9149 (JSC::Arguments::fillArgList):
9150 * runtime/Arguments.h:
9151 (JSC::Arguments::numProvidedArguments):
9152 * runtime/FunctionPrototype.cpp:
9153 (JSC::FunctionPrototype::addFunctionProperties):
9154 * runtime/FunctionPrototype.h:
9155 * runtime/JSArray.cpp:
9156 (JSC::JSArray::copyToRegisters):
9157 * runtime/JSArray.h:
9158 * runtime/JSGlobalObject.cpp:
9159 (JSC::JSGlobalObject::reset):
9160 (JSC::JSGlobalObject::mark):
9161 * runtime/JSGlobalObject.h:
9163 2009-04-08 Alexey Proskuryakov <ap@webkit.org>
9165 Reviewed by Darin Adler.
9167 https://bugs.webkit.org/show_bug.cgi?id=25073
9168 JavaScriptCore tests don't run if time zone is not PST
9170 * API/tests/testapi.c:
9171 (timeZoneIsPST): Added a function that checks whether the time zone is PST, using the same
9172 method as functions in DateMath.cpp do for formatting the result.
9173 (main): Skip date string format test if the time zone is not PST.
9175 2009-04-07 David Levin <levin@chromium.org>
9177 Reviewed by Sam Weinig and Geoff Garen.
9179 https://bugs.webkit.org/show_bug.cgi?id=25039
9180 UString refactoring to support UChar* sharing.
9182 No change in sunspider perf.
9184 * runtime/SmallStrings.cpp:
9185 (JSC::SmallStringsStorage::SmallStringsStorage):
9186 * runtime/UString.cpp:
9187 (JSC::initializeStaticBaseString):
9188 (JSC::initializeUString):
9189 (JSC::UString::BaseString::isShared):
9190 Encapsulate the meaning behind the refcount == 1 checks because
9191 this needs to do slightly more when sharing is added.
9193 (JSC::UString::append):
9194 (JSC::UString::operator=):
9195 * runtime/UString.h:
9196 Make m_baseString part of a union to get rid of casts, but make it protected because
9197 it is tricky to use it correctly since it is only valid when the Rep is not a BaseString.
9198 The void* will be filled in when sharing is added.
9200 Add constructors due to the making members protected and it make ensuring proper
9201 initialization work better (like in SmallStringsStorage).
9202 (JSC::UString::Rep::create):
9203 (JSC::UString::Rep::Rep):
9204 (JSC::UString::Rep::):
9205 (JSC::UString::BaseString::BaseString):
9206 (JSC::UString::Rep::setBaseString):
9207 (JSC::UString::Rep::baseString):
9209 2009-04-04 Xan Lopez <xlopez@igalia.com>
9211 Reviewed by Alexey Proskuryakov.
9213 https://bugs.webkit.org/show_bug.cgi?id=25033
9214 dtoa.cpp segfaults with g++ 4.4.0
9216 g++ 4.4.0 seems to be more strict about aliasing rules, so it
9217 produces incorrect code if dtoa.cpp is compiled with
9218 -fstrict-aliasing (it also emits a ton of warnings, so fair enough
9219 I guess). The problem was that we were only casting variables to
9220 union types in order to do type punning, but GCC and the C
9221 standard require that we actually use a union to store the value.
9223 This patch does just that, the code is mostly copied from the dtoa
9225 http://gcc.gnu.org/viewcvs/trunk/libjava/classpath/native/fdlibm/dtoa.c?view=markup.
9235 2009-04-04 Kevin Ollivier <kevino@theolliviers.com>
9237 wx build fix for Win port. Build the assembler sources to get missing functions.
9239 * JavaScriptCoreSources.bkl:
9243 2009-04-02 Darin Adler <darin@apple.com>
9245 Reviewed by Kevin Decker.
9247 <rdar://problem/6744471> crash in GC due to uninitialized callFunction pointer
9249 * runtime/JSGlobalObject.h:
9250 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Initialize
9251 callFunction as we do the other data members that are used in the mark function.
9253 2009-04-02 Yael Aharon <yael.aharon@nokia.com>
9255 Reviewed by Simon Hausmann
9257 https://bugs.webkit.org/show_bug.cgi?id=24490
9259 Implement WTF::ThreadSpecific in the Qt build using
9262 * wtf/ThreadSpecific.h:
9264 2009-04-01 Greg Bolsinga <bolsinga@apple.com>
9266 Reviewed by Mark Rowe.
9268 https://bugs.webkit.org/show_bug.cgi?id=24990
9269 Put SECTORDER_FLAGS into xcconfig files.
9271 * Configurations/Base.xcconfig:
9272 * Configurations/DebugRelease.xcconfig:
9273 * JavaScriptCore.xcodeproj/project.pbxproj:
9275 2009-03-27 Oliver Hunt <oliver@apple.com>
9277 Reviewed by NOBODY (Build fix).
9279 Fix non-AllInOneFile builds.
9281 * bytecompiler/BytecodeGenerator.cpp:
9283 2009-03-27 Oliver Hunt <oliver@apple.com>
9285 Reviewed by Gavin Barraclough.
9287 Improve performance of Function.prototype.call
9288 <https://bugs.webkit.org/show_bug.cgi?id=24907>
9290 Optimistically assume that expression.call(..) is going to be a call to
9291 Function.prototype.call, and handle it specially to attempt to reduce the
9292 degree of VM reentrancy.
9294 When everything goes right this removes the vm reentry improving .call()
9295 by around a factor of 10.
9297 * JavaScriptCore.xcodeproj/project.pbxproj:
9298 * bytecode/CodeBlock.cpp:
9299 (JSC::CodeBlock::dump):
9300 * bytecode/Opcode.h:
9301 * bytecompiler/BytecodeGenerator.cpp:
9302 (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
9303 * bytecompiler/BytecodeGenerator.h:
9304 * interpreter/Interpreter.cpp:
9305 (JSC::Interpreter::privateExecute):
9307 (JSC::JIT::privateCompileMainPass):
9310 (JSC::CallFunctionCallDotNode::emitBytecode):
9312 (JSC::CallFunctionCallDotNode::):
9313 * runtime/FunctionPrototype.cpp:
9314 (JSC::FunctionPrototype::addFunctionProperties):
9315 * runtime/FunctionPrototype.h:
9316 * runtime/JSGlobalObject.cpp:
9317 (JSC::JSGlobalObject::reset):
9318 (JSC::JSGlobalObject::mark):
9319 * runtime/JSGlobalObject.h:
9321 2009-03-27 Laszlo Gombos <laszlo.1.gombos@nokia.com>
9323 Reviewed by Darin Adler.
9325 Bug 24884: Include strings.h for strcasecmp()
9326 https://bugs.webkit.org/show_bug.cgi?id=24884
9328 * runtime/DateMath.cpp: Reversed previous change including strings.h
9329 * wtf/StringExtras.h: Include strings.h here is available
9331 2009-03-26 Adam Roben <aroben@apple.com>
9333 Copy testapi.js to $WebKitOutputDir on Windows
9335 Part of Bug 24856: run-javascriptcore-tests should run testapi on
9337 <https://bugs.webkit.org/show_bug.cgi?id=24856>
9339 This matches what Mac does, which will help once we enable running
9340 testapi from run-javascriptcore-tests on Windows.
9342 Reviewed by Steve Falkenburg.
9344 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Copy testapi.js next
9347 2009-03-25 Oliver Hunt <oliver@apple.com>
9349 Reviewed by Geoff Garen.
9351 Fix exception handling for instanceof in the interpreter.
9353 * interpreter/Interpreter.cpp:
9354 (JSC::Interpreter::privateExecute):
9356 2009-03-25 Geoffrey Garen <ggaren@apple.com>
9358 Reviewed by Cameron Zwarich.
9360 Fixed <rdar://problem/6724011> Write to freed memory in JSC::Label::deref
9361 when reloading http://helpme.att.net/speedtest/
9363 * bytecompiler/BytecodeGenerator.h: Reversed the declaration order for
9364 m_labelScopes and m_labels to reverse their destruction order.
9365 m_labelScopes has references to memory within m_labels, so its destructor
9368 2009-03-24 Eli Fidler <eli.fidler@torchmobile.com>
9370 Reviewed by George Staikos.
9372 Correct warnings which in some environments are treated as errors.
9380 2009-03-24 Kevin Ollivier <kevino@theolliviers.com>
9382 Reviewed by Darin Adler.
9384 Explicitly define HAVE_LANGINFO_H on Darwin. Fixes the wx build bot jscore
9387 https://bugs.webkit.org/show_bug.cgi?id=24780
9391 2009-03-23 Oliver Hunt <oliver@apple.com>
9393 Reviewed by Cameron Zwarich.
9395 Fix className() for API defined class
9397 * API/JSCallbackObjectFunctions.h:
9399 * API/tests/testapi.c:
9400 (EmptyObject_class):
9402 * API/tests/testapi.js:
9404 2009-03-23 Oliver Hunt <oliver@apple.com>
9406 Reviewed by Geoff Garen.
9408 Make testapi assertions run in release builds, so that testapi actually
9409 works in a release build.
9411 Many of the testapi assertions have side effects that are necessary, and
9412 given testapi is a testing program, perf impact of an assertion is not
9413 important, so it makes sense to apply the assertions in release builds
9416 * API/tests/testapi.c:
9417 (EvilExceptionObject_hasInstance):
9419 2009-03-23 David Kilzer <ddkilzer@apple.com>
9421 Provide JavaScript exception information after slow script timeout
9423 Reviewed by Oliver Hunt.
9425 * runtime/Completion.cpp:
9426 (JSC::evaluate): Set the exception object as the Completion
9427 object's value for slow script timeouts. This is used in
9428 WebCore when reporting the exception.
9429 * runtime/ExceptionHelpers.cpp:
9430 (JSC::InterruptedExecutionError::toString): Added. Provides a
9431 description message for the exception when it is reported.
9433 2009-03-23 Gustavo Noronha Silva <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
9435 Reviewed by Adam Roben.
9437 https://bugs.webkit.org/show_bug.cgi?id=24674
9438 Crashes in !PLATFORM(MAC)'s formatLocaleDate, in very specific situations
9440 Make sure strftime never returns 2-digits years to avoid ambiguity
9441 and a crash. We wrap this new code option in HAVE_LANGINFO_H,
9442 since it is apparently not available in all platforms.
9444 * runtime/DatePrototype.cpp:
9445 (JSC::formatLocaleDate):
9448 2009-03-22 Oliver Hunt <oliver@apple.com>
9450 Reviewed by Cameron Zwarich.
9452 Fix exception handling in API
9454 We can't just use the ExecState exception slot for returning exceptions
9455 from class introspection functions provided through the API as many JSC
9456 functions will explicitly clear the ExecState exception when returning.
9458 * API/JSCallbackObjectFunctions.h:
9459 (JSC::JSCallbackObject<Base>::getOwnPropertySlot):
9460 (JSC::JSCallbackObject<Base>::put):
9461 (JSC::JSCallbackObject<Base>::deleteProperty):
9462 (JSC::JSCallbackObject<Base>::construct):
9463 (JSC::JSCallbackObject<Base>::hasInstance):
9464 (JSC::JSCallbackObject<Base>::call):
9465 (JSC::JSCallbackObject<Base>::toNumber):
9466 (JSC::JSCallbackObject<Base>::toString):
9467 (JSC::JSCallbackObject<Base>::staticValueGetter):
9468 (JSC::JSCallbackObject<Base>::callbackGetter):
9469 * API/tests/testapi.c:
9470 (MyObject_hasProperty):
9471 (MyObject_getProperty):
9472 (MyObject_setProperty):
9473 (MyObject_deleteProperty):
9474 (MyObject_callAsFunction):
9475 (MyObject_callAsConstructor):
9476 (MyObject_hasInstance):
9477 (EvilExceptionObject_hasInstance):
9478 (EvilExceptionObject_convertToType):
9479 (EvilExceptionObject_class):
9481 * API/tests/testapi.js:
9482 (EvilExceptionObject.hasInstance):
9483 (EvilExceptionObject.toNumber):
9484 (EvilExceptionObject.toStringExplicit):
9486 2009-03-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
9488 Reviewed by Oliver Hunt.
9490 Bug 20049: testapi failure: MyObject - 0 should be NaN but instead is 1.
9491 <https://bugs.webkit.org/show_bug.cgi?id=20049>
9492 <rdar://problem/6079127>
9494 In this case, the test is wrong. According to the ECMA spec, subtraction
9495 uses ToNumber, not ToPrimitive. Change the test to match the spec.
9497 * API/tests/testapi.js:
9499 2009-03-21 Oliver Hunt <oliver@apple.com>
9501 Reviewed by Cameron Zwarich.
9503 Ensure that JSObjectMakeFunction doesn't produce incorrect line numbers.
9505 Also make test api correctly propagate failures.
9507 * API/tests/testapi.c:
9509 * runtime/FunctionConstructor.cpp:
9510 (JSC::constructFunction):
9512 2009-03-21 Oliver Hunt <oliver@apple.com>
9514 Reviewed by Mark Rowe.
9516 Improve testapi by making it report failures in a way we can pick up
9517 from our test scripts.
9519 * API/tests/testapi.c:
9520 (assertEqualsAsBoolean):
9521 (assertEqualsAsNumber):
9522 (assertEqualsAsUTF8String):
9523 (assertEqualsAsCharactersPtr):
9525 * API/tests/testapi.js:
9531 2009-03-20 Norbert Leser <norbert.leser@nokia.com>
9533 Reviewed by Darin Adler.
9535 https://bugs.webkit.org/show_bug.cgi?id=24535
9537 Fixes missing line terminator character (;) after macro call.
9538 It is common practice to add the trailing ";" where macros are substituted
9539 and not where they are defined with #define.
9540 This change is consistent with other macro declarations across webkit,
9541 and it also solves compilation failure with symbian compilers.
9543 * runtime/UString.cpp:
9546 2009-03-20 Geoffrey Garen <ggaren@apple.com>
9548 Reviewed by Darin Adler.
9550 Fixed a JavaScriptCore crash on the Windows buildbot.
9552 * bytecompiler/BytecodeGenerator.h: Reduced the AST recursion limit.
9553 Apparently, Windows has small stacks.
9555 2009-03-20 Geoffrey Garen <ggaren@apple.com>
9557 Reviewed by Oliver Hunt.
9559 A little cleanup in the RegisterFile code.
9561 Moved large inline functions out of the class declaration, to make it
9564 Switched over to using the roundUpAllocationSize function to avoid
9565 duplicate code and subtle bugs.
9567 Renamed m_maxCommitted to m_commitEnd, to match m_end.
9569 Renamed allocationSize to commitSize because it's the chunk size for
9570 committing memory, not allocating memory.
9572 SunSpider reports no change.
9574 * interpreter/RegisterFile.h:
9575 (JSC::RegisterFile::RegisterFile):
9576 (JSC::RegisterFile::shrink):
9577 (JSC::RegisterFile::grow):
9578 * jit/ExecutableAllocator.h:
9579 (JSC::roundUpAllocationSize):
9581 2009-03-19 Geoffrey Garen <ggaren@apple.com>
9583 Reviewed by Oliver Hunt.
9585 Fixed <rdar://problem/6033712> -- a little bit of hardening in the Collector.
9587 SunSpider reports no change. I also verified in the disassembly that
9588 we end up with a single compare to constant.
9590 * runtime/Collector.cpp:
9591 (JSC::Heap::heapAllocate):
9593 2009-03-19 Geoffrey Garen <ggaren@apple.com>
9595 Reviewed by Cameron Zwarich and Oliver Hunt.
9597 Fixed <rdar://problem/6406045> REGRESSION: Stack overflow on PowerPC on
9598 fast/workers/use-machine-stack.html (22531)
9600 Dialed down the re-entry allowance to 64 (from 128).
9602 On a 512K stack, this leaves about 64K for other code on the stack while
9603 JavaScript is running. Not perfect, but it solves our crash on PPC.
9605 Different platforms may want to dial this down even more.
9607 Also, substantially shrunk BytecodeGenerator. Since we allocate one on
9608 the stack in order to throw a stack overflow exception -- well, let's
9609 just say the old code had an appreciation for irony.
9611 SunSpider reports no change.
9613 * bytecompiler/BytecodeGenerator.h:
9614 * interpreter/Interpreter.h:
9617 2009-03-19 Cameron Zwarich <cwzwarich@uwaterloo.ca>
9619 Reviewed by Oliver Hunt.
9621 Bug 24350: REGRESSION: Safari 4 breaks SPAW wysiwyg editor multiple instances
9622 <https://bugs.webkit.org/show_bug.cgi?id=24350>
9623 <rdar://problem/6674182>
9625 The SPAW editor's JavaScript assumes that toString() on a function
9626 constructed with the Function constructor produces a function with
9627 a newline after the opening brace.
9629 * runtime/FunctionConstructor.cpp:
9630 (JSC::constructFunction): Add a newline after the opening brace of the
9631 function's source code.
9633 2009-03-19 Cameron Zwarich <cwzwarich@uwaterloo.ca>
9635 Reviewed by Geoff Garen.
9637 Bug 23771: REGRESSION (r36016): JSObjectHasProperty freezes on global class without kJSClassAttributeNoAutomaticPrototype
9638 <https://bugs.webkit.org/show_bug.cgi?id=23771>
9639 <rdar://problem/6561016>
9641 * API/tests/testapi.c:
9642 (main): Add a test for this bug.
9643 * runtime/JSGlobalObject.cpp:
9644 (JSC::JSGlobalObject::resetPrototype): Don't set the prototype of the
9645 last object in the prototype chain to the object prototype when the
9646 object prototype is already the last object in the prototype chain.
9648 2009-03-19 Timothy Hatcher <timothy@apple.com>
9650 <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers
9652 Reviewed by Darin Adler.
9654 * wtf/Platform.h: Added HAVE_RUNLOOP_TIMER for PLATFORM(MAC).
9656 2009-03-19 Geoffrey Garen <ggaren@apple.com>
9658 Reviewed by Oliver Hunt.
9660 Fixed <rdar://problem/6279213> Regular expression run-time complexity
9661 limit too low for long inputs (21485)
9663 I raised PCRE's "matchLimit" (limit on backtracking) by an order of
9664 magnitude. This fixes all the reported examples of timing out on legitimate
9665 regular expression matches.
9667 In my testing on a Core Duo MacBook Pro, the longest you can get stuck
9668 trying to match a string is still under 1s, so this seems like a safe change.
9670 I can think of a number of better solutions that are more complicated,
9671 but this is a good improvement for now.
9673 * pcre/pcre_exec.cpp:
9675 2009-03-19 Geoffrey Garen <ggaren@apple.com>
9677 Reviewed by Sam Weinig.
9679 Fixed <rdar://problem/6603562> REGRESSION (Safari 4): regular expression
9680 pattern size limit lower than Safari 3.2, other browsers, breaks SAP (14873)
9682 Bumped the pattern size limit to 1MB, and standardized it between PCRE
9683 and WREC. (Empirical testing says that we can easily compile a 1MB regular
9684 expression without risking a hang. Other browsers support bigger regular
9685 expressions, but also hang.)
9687 SunSpider reports no change.
9689 I started with a patch posted to Bugzilla by Erik Corry (erikcorry@google.com).
9691 * pcre/pcre_internal.h:
9694 (put3ByteValueAndAdvance):
9695 (putLinkValueAllowZero):
9696 (getLinkValueAllowZero): Made PCRE's "LINK_SIZE" (the number of bytes
9697 used to record jumps between bytecodes) 3, to accomodate larger potential
9698 jumps. Bumped PCRE's "MAX_PATTERN_SIZE" to 1MB. (Technically, at this
9699 LINK_SIZE, we can support even larger patterns, but we risk a hang during
9700 compilation, and it's not clear that such large patterns are important
9704 (JSC::WREC::Generator::compileRegExp): Match PCRE's maximum pattern size,
9705 to avoid quirks between platforms.
9707 2009-03-18 Ada Chan <adachan@apple.com>
9709 Rolling out r41818 since it broke the windows build.
9710 Error: ..\..\runtime\DatePrototype.cpp(30) : fatal error C1083: Cannot open include file: 'langinfo.h': No such file or directory
9712 * runtime/DatePrototype.cpp:
9713 (JSC::formatLocaleDate):
9715 2009-03-17 Oliver Hunt <oliver@apple.com>
9717 Reviewed by Cameron Zwarich.
9719 <rdar://problem/6692138> REGRESSION (Safari 4): Incorrect function return value when using IE "try ... finally" memory leak work-around (24654)
9720 <https://bugs.webkit.org/show_bug.cgi?id=24654>
9722 If the return value for a function is in a local register we need
9723 to copy it before executing any finalisers, otherwise it is possible
9724 for the finaliser to clobber the result.
9726 * bytecompiler/BytecodeGenerator.h:
9727 (JSC::BytecodeGenerator::hasFinaliser):
9729 (JSC::ReturnNode::emitBytecode):
9731 2009-03-17 Kevin Ollivier <kevino@theolliviers.com>
9733 Reviewed by Mark Rowe.
9735 Move BUILDING_ON_* defines into Platform.h to make them available to other ports.
9736 Also tweak the defines so that they work with the default values set by
9737 AvailabilityMacros.h.
9739 https://bugs.webkit.org/show_bug.cgi?id=24630
9741 * JavaScriptCorePrefix.h:
9744 2009-03-15 Simon Fraser <simon.fraser@apple.com>
9746 Revert r41718 because it broke DumpRenderTree on Tiger.
9748 * JavaScriptCorePrefix.h:
9751 2009-03-15 Kevin Ollivier <kevino@theolliviers.com>
9753 Non-Apple Mac ports build fix. Move defines for the BUILDING_ON_ macros into
9754 Platform.h so that they're defined for all ports building on Mac, and tweak
9755 the definitions of those macros based on Mark Rowe's suggestions to accomodate
9756 cases where the values may not be <= to the .0 release for that version.
9758 * JavaScriptCorePrefix.h:
9761 2009-03-13 Mark Rowe <mrowe@apple.com>
9763 Rubber-stamped by Dan Bernstein.
9765 Take advantage of the ability of recent versions of Xcode to easily switch the active
9768 * Configurations/DebugRelease.xcconfig:
9770 2009-03-13 Mark Rowe <mrowe@apple.com>
9772 Reviewed by David Kilzer.
9774 Prevent AllInOneFile.cpp and ProfileGenerator.cpp from rebuilding unnecessarily when
9775 switching between building in Xcode and via build-webkit.
9777 build-webkit passes FEATURE_DEFINES to xcodebuild, resulting in it being present in the
9778 Derived Sources build settings. When building in Xcode, this setting isn't present so
9779 Xcode reruns the script build phases. This results in a new version of TracingDtrace.h
9780 being generated, and the files that include it being rebuilt.
9782 * JavaScriptCore.xcodeproj/project.pbxproj: Don't regenerate TracingDtrace.h if it is
9783 already newer than the input file.
9785 2009-03-13 Norbert Leser <norbert.leser@nokia.com>
9787 Reviewed by Darin Adler.
9789 Resolved name conflict with globally defined tzname in Symbian.
9790 Replaced with different name instead of using namespace qualifier
9791 (appeared to be less clumsy).
9793 * runtime/DateMath.cpp:
9795 2009-03-12 Mark Rowe <mrowe@apple.com>
9797 Reviewed by Darin Adler.
9799 <rdar://problem/6548446> TCMalloc_SystemRelease should use madvise rather than re-mmaping span of pages
9801 * wtf/FastMalloc.cpp:
9802 (WTF::mergeDecommittedStates): If either of the spans has been released to the system, release the other
9803 span as well so that the flag in the merged span is accurate.
9805 * wtf/TCSystemAlloc.cpp: Track decommitted spans when using MADV_FREE_REUSABLE / MADV_FREE_REUSE.
9806 (TCMalloc_SystemRelease): Use madvise with MADV_FREE_REUSABLE when it is available.
9807 (TCMalloc_SystemCommit): Use madvise with MADV_FREE_REUSE when it is available.
9808 * wtf/TCSystemAlloc.h:
9810 2009-03-12 Adam Treat <adam.treat@torchmobile.com>
9812 Reviewed by NOBODY (Build fix).
9814 Include string.h for strlen usage.
9816 * wtf/Threading.cpp:
9818 2009-03-12 David Kilzer <ddkilzer@apple.com>
9820 Add NO_RETURN attribute to runInteractive() when not using readline
9822 Reviewed by Darin Adler.
9825 (runInteractive): If the readline library is not used, this method
9826 will never return, thus the NO_RETURN attribute is needed to prevent
9829 2009-03-12 Adam Roben <aroben@apple.com>
9831 Adopt setThreadNameInternal on Windows
9833 Also changed a Windows-only assertion about thread name length to an
9834 all-platform log message.
9836 Reviewed by Adam Treat.
9838 * wtf/Threading.cpp:
9839 (WTF::createThread): Warn if the thread name is longer than 31
9840 characters, as Visual Studio will truncate names longer than that
9843 * wtf/ThreadingWin.cpp:
9844 (WTF::setThreadNameInternal): Renamed from setThreadName and changed
9845 to always operate on the current thread.
9846 (WTF::initializeThreading): Changed to use setThreadNameInternal.
9847 (WTF::createThreadInternal): Removed call to setThreadName. This is
9848 now handled by threadEntryPoint and setThreadNameInternal.
9850 2009-03-11 David Kilzer <ddkilzer@apple.com>
9852 Clarify comments regarding order of FEATURE_DEFINES
9854 Rubber-stamped by Mark Rowe.
9856 * Configurations/JavaScriptCore.xcconfig: Added warning about
9857 the consequences when FEATURE_DEFINES are not kept in sync.
9859 2009-03-11 Dan Bernstein <mitz@apple.com>
9861 Reviewed by Darin Adler.
9863 - WTF support for fixing <rdar://problem/3919124> Thai text selection
9864 in Safari is incorrect
9866 * wtf/unicode/icu/UnicodeIcu.h:
9867 (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added. Returns
9868 whether the character has Unicode line breaking property value SA
9869 ("Complex Context").
9870 * wtf/unicode/qt4/UnicodeQt4.h:
9871 (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added an
9872 implementation that always returns false.
9874 2009-03-11 Darin Adler <darin@apple.com>
9876 Reviewed by Mark Rowe.
9878 Give threads names on platforms with pthread_setname_np.
9880 * wtf/Threading.cpp:
9881 (WTF::NewThreadContext::NewThreadContext): Initialize thread name.
9882 (WTF::threadEntryPoint): Call setThreadNameInternal.
9883 (WTF::createThread): Pass thread name.
9885 * wtf/Threading.h: Added new comments, setThreadNameInternal.
9887 * wtf/ThreadingGtk.cpp:
9888 (WTF::setThreadNameInternal): Added. Empty.
9889 * wtf/ThreadingNone.cpp:
9890 (WTF::setThreadNameInternal): Added. Empty.
9891 * wtf/ThreadingPthreads.cpp:
9892 (WTF::setThreadNameInternal): Call pthread_setname_np when available.
9893 * wtf/ThreadingQt.cpp:
9894 (WTF::setThreadNameInternal): Added. Empty.
9895 * wtf/ThreadingWin.cpp:
9896 (WTF::setThreadNameInternal): Added. Empty.
9898 2009-03-11 Adam Roben <aroben@apple.com>
9900 Change the Windows implementation of ThreadSpecific to use functions
9901 instead of extern globals
9903 This will make it easier to export ThreadSpecific from WebKit.
9905 Reviewed by John Sullivan.
9909 Touched this file to force ThreadSpecific.h to be copied into
9912 * wtf/ThreadSpecific.h: Replaced g_tls_key_count with tlsKeyCount()
9913 and g_tls_keys with tlsKeys().
9915 (WTF::::ThreadSpecific):
9916 (WTF::::~ThreadSpecific):
9920 Updated to use the new functions.
9922 * wtf/ThreadSpecificWin.cpp:
9927 (WTF::ThreadSpecificThreadExit): Changed to use the new functions.
9929 2009-03-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
9931 Reviewed by Geoff Garen.
9933 Bug 24291: REGRESSION (r38635): Single line JavaScript comment prevents HTML button click handler execution
9934 <https://bugs.webkit.org/show_bug.cgi?id=24291>
9935 <rdar://problem/6663472>
9937 Add an extra newline to the end of the body of the program text constructed
9938 by the Function constructor for parsing. This allows single line comments to
9939 be handled correctly by the parser.
9941 * runtime/FunctionConstructor.cpp:
9942 (JSC::constructFunction):
9944 2009-03-09 Oliver Hunt <oliver@apple.com>
9946 Reviewed by Gavin Barraclough.
9948 Bug 24447: REGRESSION (r41508): Google Maps does not complete initialization
9949 <rdar://problem/6657774>
9951 r41508 actually exposed a pre-existing bug where we were not invalidating the result
9952 register cache at jump targets. This causes problems when condition loads occur in an
9953 expression -- namely through the ?: and || operators. This patch corrects these issues
9954 by marking the target of all forward jumps as being a jump target, and then clears the
9955 result register cache when ever it starts generating code for a targeted instruction.
9957 I do not believe it is possible to cause this class of failure outside of a single
9958 expression, and expressions only provide forward branches, so this should resolve this
9959 entire class of bug. That said i've included a test case that gets as close as possible
9960 to hitting this bug with a back branch, to hopefully prevent anyone from introducing the
9963 * assembler/AbstractMacroAssembler.h:
9964 (JSC::AbstractMacroAssembler::Label::isUsed):
9965 (JSC::AbstractMacroAssembler::Label::used):
9966 * assembler/X86Assembler.h:
9967 (JSC::X86Assembler::JmpDst::JmpDst):
9968 (JSC::X86Assembler::JmpDst::isUsed):
9969 (JSC::X86Assembler::JmpDst::used):
9971 (JSC::JIT::privateCompileMainPass):
9973 2009-03-09 David Levin <levin@chromium.org>
9975 Reviewed by Darin Adler.
9977 Bug 23175: String and UString should be able to share a UChar* buffer.
9978 <https://bugs.webkit.org/show_bug.cgi?id=23175>
9980 Add CrossThreadRefCounted.
9982 * wtf/CrossThreadRefCounted.h: Added.
9983 (WTF::CrossThreadRefCounted::create):
9984 (WTF::CrossThreadRefCounted::isShared):
9985 (WTF::CrossThreadRefCounted::dataAccessMustBeThreadSafe):
9986 (WTF::CrossThreadRefCounted::mayBePassedToAnotherThread):
9987 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
9988 (WTF::CrossThreadRefCounted::~CrossThreadRefCounted):
9989 (WTF::CrossThreadRefCounted::ref):
9990 (WTF::CrossThreadRefCounted::deref):
9991 (WTF::CrossThreadRefCounted::release):
9992 (WTF::CrossThreadRefCounted::copy):
9993 (WTF::CrossThreadRefCounted::threadSafeDeref):
9996 (WTF::ThreadSafeSharedBase::ThreadSafeSharedBase):
9997 (WTF::ThreadSafeSharedBase::derefBase):
9998 (WTF::ThreadSafeShared::ThreadSafeShared):
9999 (WTF::ThreadSafeShared::deref):
10001 2009-03-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
10003 Reviewed by George Staikos.
10005 https://bugs.webkit.org/show_bug.cgi?id=24353
10006 Allow to overrule default build options for Qt build.
10008 * JavaScriptCore.pri: Allow to overrule ENABLE_JIT
10010 2009-03-08 Oliver Hunt <oliver@apple.com>
10012 Reviewed by NOBODY (build fix).
10016 * runtime/ArrayPrototype.cpp:
10017 (JSC::arrayProtoFuncConcat):
10019 2009-03-01 Oliver Hunt <oliver@apple.com>
10021 Reviewed by Cameron Zwarich.
10023 Bug 24268: RuntimeArray is not a fully implemented JSArray
10024 <https://bugs.webkit.org/show_bug.cgi?id=24268>
10026 Don't cast a type to JSArray, just because it reportsArray as a supertype
10027 in the JS type system. Doesn't appear feasible to create a testcase
10028 unfortunately as setting up the failure conditions requires internal access
10029 to JSC not present in DRT.
10031 * runtime/ArrayPrototype.cpp:
10032 (JSC::arrayProtoFuncConcat):
10034 2009-03-06 Gavin Barraclough <barraclough@apple.com>
10036 Reviewed by Oliver Hunt.
10038 When preforming an op_mov, preserve any existing register mapping.
10040 ~0.5% progression on v8 tests x86-64.
10043 (JSC::JIT::privateCompileMainPass):
10045 2009-03-05 Simone Fiorentino <simone.fiorentino@consulenti.fastweb.it>
10047 Bug 24382: request to add SH4 platform
10049 <https://bugs.webkit.org/show_bug.cgi?id=24382>
10051 Reviewed by David Kilzer.
10053 * wtf/Platform.h: Added support for SH4 platform.
10055 2009-03-05 Gavin Barraclough <barraclough@apple.com>
10057 Reviewed by Oliver Hunt.
10059 Writes of constant values to SF registers should be made with direct memory
10060 writes where possible, rather than moving the value via a hardware register.
10062 ~3% win on SunSpider tests on x86, ~1.5% win on v8 tests on x86-64.
10064 * assembler/MacroAssemblerX86_64.h:
10065 (JSC::MacroAssemblerX86_64::storePtr):
10066 * assembler/X86Assembler.h:
10067 (JSC::X86Assembler::movq_i32m):
10069 (JSC::JIT::privateCompileMainPass):
10071 2009-03-05 Mark Rowe <mrowe@apple.com>
10075 Sprinkle "static" around NumberConstructor.cpp in order to please the compiler.
10077 * runtime/NumberConstructor.cpp:
10078 (JSC::numberConstructorNaNValue):
10079 (JSC::numberConstructorNegInfinity):
10080 (JSC::numberConstructorPosInfinity):
10081 (JSC::numberConstructorMaxValue):
10082 (JSC::numberConstructorMinValue):
10084 2009-03-04 Mark Rowe <mrowe@apple.com>
10086 Reviewed by Oliver Hunt.
10088 <rdar://problem/6354858> FastMallocZone's enumeration code reports fragmented administration space
10090 The handling of MALLOC_ADMIN_REGION_RANGE_TYPE in FastMalloc's zone was incorrect. It was attempting
10091 to record the memory containing and individual span as an administrative region, when all memory
10092 allocated via MetaDataAlloc should in fact be recorded. This was causing memory regions allocated
10093 via MetaDataAlloc to appear as "VM_ALLOCATE ?" in vmmap output. They are now correctly reported as
10094 "MALLOC_OTHER" regions associated with the JavaScriptCore FastMalloc zone.
10096 Memory is allocated via MetaDataAlloc from two locations: PageHeapAllocator, and TCMalloc_PageMap{2,3}.
10097 These two cases are handled differently.
10099 PageHeapAllocator is extended to keep a linked list of memory regions that it has allocated. The
10100 first object in an allocated region contains the link to the previously allocated region. To record
10101 the administrative regions of a PageHeapAllocator we can simply walk the linked list and record
10102 each allocated region we encounter.
10104 TCMalloc_PageMaps allocate memory via MetaDataAlloc to store each level of the radix tree. To record
10105 the administrative regions of a TCMalloc_PageMap we walk the tree and record the storage used for nodes
10106 at each position rather than the nodes themselves.
10108 A small performance improvement is achieved by coalescing adjacent memory regions inside the PageMapMemoryUsageRecorder
10109 so that fewer calls in to the range recorder are necessary. We further reduce the number of calls to the
10110 range recorder by aggregating the in-use ranges of a given memory region into a local buffer before recording
10111 them with a single call. A similar approach is also used by AdminRegionRecorder.
10113 * wtf/FastMalloc.cpp:
10114 (WTF::PageHeapAllocator::Init):
10115 (WTF::PageHeapAllocator::New):
10116 (WTF::PageHeapAllocator::recordAdministrativeRegions):
10117 (WTF::TCMallocStats::FreeObjectFinder::isFreeObject):
10118 (WTF::TCMallocStats::PageMapMemoryUsageRecorder::~PageMapMemoryUsageRecorder):
10119 (WTF::TCMallocStats::PageMapMemoryUsageRecorder::recordPendingRegions):
10120 (WTF::TCMallocStats::PageMapMemoryUsageRecorder::visit):
10121 (WTF::TCMallocStats::AdminRegionRecorder::AdminRegionRecorder):
10122 (WTF::TCMallocStats::AdminRegionRecorder::recordRegion):
10123 (WTF::TCMallocStats::AdminRegionRecorder::visit):
10124 (WTF::TCMallocStats::AdminRegionRecorder::recordPendingRegions):
10125 (WTF::TCMallocStats::AdminRegionRecorder::~AdminRegionRecorder):
10126 (WTF::TCMallocStats::FastMallocZone::enumerate):
10127 (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
10128 (WTF::TCMallocStats::FastMallocZone::init):
10130 (TCMalloc_PageMap2::visitValues):
10131 (TCMalloc_PageMap2::visitAllocations):
10132 (TCMalloc_PageMap3::visitValues):
10133 (TCMalloc_PageMap3::visitAllocations):
10135 2009-03-04 Antti Koivisto <antti@apple.com>
10137 Reviewed by Dave Hyatt.
10139 https://bugs.webkit.org/show_bug.cgi?id=24359
10140 Repaint throttling mechanism
10142 Set ENABLE_REPAINT_THROTTLING to 0 by default.
10146 2009-03-03 David Kilzer <ddkilzer@apple.com>
10148 <rdar://problem/6581203> WebCore and WebKit should install the same set of headers during installhdrs phase as build phase
10150 Reviewed by Mark Rowe.
10152 * Configurations/Base.xcconfig: Defined REAL_PLATFORM_NAME based
10153 on PLATFORM_NAME to work around the missing definition on Tiger.
10154 Updated HAVE_DTRACE to use REAL_PLATFORM_NAME.
10156 2009-03-03 Kevin McCullough <kmccullough@apple.com>
10158 Reviewed by Oliver Hunt.
10160 <rdar://problem/6639110> console.profile() doesn't work without a title
10162 * profiler/Profiler.cpp:
10163 (JSC::Profiler::startProfiling): assert if there is not title to ensure
10164 we don't start profiling without one.
10166 2009-03-02 Sam Weinig <sam@webkit.org>
10168 Reviewed by Mark Rowe.
10170 Enable Geolocation (except on Tiger and Leopard).
10172 * Configurations/JavaScriptCore.xcconfig:
10174 2009-03-01 David Kilzer <ddkilzer@apple.com>
10176 <rdar://problem/6635688> Move HAVE_DTRACE check to Base.xcconfig
10178 Reviewed by Mark Rowe.
10180 * Configurations/Base.xcconfig: Set HAVE_DTRACE Xcode variable
10181 based on PLATFORM_NAME and MAC_OS_X_VERSION_MAJOR. Also define
10182 it as a preprocessor macro by modifying
10183 GCC_PREPROCESSOR_DEFINITIONS.
10184 * JavaScriptCore.xcodeproj/project.pbxproj: Changed "Generate
10185 DTrace header" script phase to check for HAVE_DTRACE instead of
10186 MACOSX_DEPLOYMENT_TARGET.
10187 * wtf/Platform.h: Removed definition of HAVE_DTRACE macro since
10188 it's defined in Base.xcconfig now.
10190 2009-03-01 Horia Olaru <olaru@adobe.com>
10192 By looking in grammar.y there are only a few types of statement nodes
10193 on which the debugger should stop.
10195 Removed isBlock and isLoop virtual calls. No need to emit debug hooks in
10196 the "statementListEmitCode" method as long as the necessary hooks can be
10197 added in each "emitCode".
10199 https://bugs.webkit.org/show_bug.cgi?id=21073
10201 Reviewed by Kevin McCullough.
10203 * parser/Nodes.cpp:
10204 (JSC::ConstStatementNode::emitBytecode):
10205 (JSC::statementListEmitCode):
10206 (JSC::EmptyStatementNode::emitBytecode):
10207 (JSC::ExprStatementNode::emitBytecode):
10208 (JSC::VarStatementNode::emitBytecode):
10209 (JSC::IfNode::emitBytecode):
10210 (JSC::IfElseNode::emitBytecode):
10211 (JSC::DoWhileNode::emitBytecode):
10212 (JSC::WhileNode::emitBytecode):
10213 (JSC::ForNode::emitBytecode):
10214 (JSC::ForInNode::emitBytecode):
10215 (JSC::ContinueNode::emitBytecode):
10216 (JSC::BreakNode::emitBytecode):
10217 (JSC::ReturnNode::emitBytecode):
10218 (JSC::WithNode::emitBytecode):
10219 (JSC::SwitchNode::emitBytecode):
10220 (JSC::LabelNode::emitBytecode):
10221 (JSC::ThrowNode::emitBytecode):
10222 (JSC::TryNode::emitBytecode):
10225 2009-02-26 Gavin Barraclough <barraclough@apple.com>
10227 Reviewed by Geoff Garen.
10229 Fix bug #23614. Switches on double precision values were incorrectly
10230 truncating the scrutinee value. E.g.:
10232 switch (1.1) { case 1: print("FAIL"); }
10234 Was resulting in FAIL.
10236 * interpreter/Interpreter.cpp:
10237 (JSC::Interpreter::privateExecute):
10238 * jit/JITStubs.cpp:
10239 (JSC::JITStubs::cti_op_switch_imm):
10241 2009-02-26 Gavin Barraclough <barraclough@apple.com>
10243 Reviewed by Oliver Hunt.
10245 Integer Immediate representation need not be canonical in x86 JIT code.
10246 On x86-64 we already have loosened the requirement that the int immediate
10247 representation in canonical, we should bring x86 into line.
10249 This patch is a minor (~0.5%) improvement on sunspider & v8-tests, and
10250 should reduce memory footoprint (reduces JIT code size).
10253 (JSC::JIT::compileOpStrictEq):
10254 (JSC::JIT::privateCompileSlowCases):
10256 (JSC::JIT::emitJumpIfImmediateNumber):
10257 (JSC::JIT::emitJumpIfNotImmediateNumber):
10258 * jit/JITArithmetic.cpp:
10259 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
10260 (JSC::JIT::compileBinaryArithOp):
10262 2009-02-26 Carol Szabo <carol.szabo@nokia.com>
10264 Reviewed by Darin Adler.
10266 https://bugs.webkit.org/show_bug.cgi?id=24099
10267 ARM Compiler Warnings in pcre_exec.cpp
10269 * pcre/pcre_exec.cpp:
10272 2009-02-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>
10274 Reviewed by Gavin Barraclough.
10276 Bug 24086: Regression (r40993): WebKit crashes after logging in to lists.zenbe
10277 <https://bugs.webkit.org/show_bug.cgi?id=24086>
10278 <rdar://problem/6625111>
10280 The numeric sort optimization in r40993 generated bytecode for a function
10281 without generating JIT code. This breaks an assumption in some parts of
10282 the JIT's function calling logic that the presence of a CodeBlock implies
10283 the existence of JIT code.
10285 In order to fix this, we simply generate JIT code whenever we check whether
10286 a function is a numeric sort function. This only incurs an additional cost
10287 in the case when the function is a numeric sort function, in which case it
10288 is not expensive to generate JIT code for it.
10290 * runtime/ArrayPrototype.cpp:
10291 (JSC::isNumericCompareFunction):
10293 2009-02-25 Geoffrey Garen <ggaren@apple.com>
10295 Reviewed by Maciej Stachowiak.
10297 Fixed <rdar://problem/6611174> REGRESSION (r36701): Unable to select
10298 messages on hotmail (24052)
10300 The bug was that for-in enumeration used a cached prototype chain without
10301 validating that it was up-to-date.
10303 This led me to refactor prototype chain caching so it was easier to work
10304 with and harder to get wrong.
10306 After a bit of inlining, this patch is performance-neutral on SunSpider
10307 and the v8 benchmarks.
10309 * interpreter/Interpreter.cpp:
10310 (JSC::Interpreter::tryCachePutByID):
10311 (JSC::Interpreter::tryCacheGetByID):
10312 * jit/JITStubs.cpp:
10313 (JSC::JITStubs::tryCachePutByID):
10314 (JSC::JITStubs::tryCacheGetByID):
10315 (JSC::JITStubs::cti_op_get_by_id_proto_list): Use the new refactored goodness. See
10316 lines beginning with "-" and smile.
10318 * runtime/JSGlobalObject.h:
10319 (JSC::Structure::prototypeForLookup): A shout out to const.
10321 * runtime/JSPropertyNameIterator.h:
10322 (JSC::JSPropertyNameIterator::next): We can use a pointer comparison to
10323 see if our cached structure chain is equal to the object's structure chain,
10324 since in the case of a cache hit, we share references to the same structure
10327 * runtime/Operations.h:
10328 (JSC::countPrototypeChainEntriesAndCheckForProxies): Use the new refactored
10331 * runtime/PropertyNameArray.h:
10332 (JSC::PropertyNameArray::PropertyNameArray):
10333 (JSC::PropertyNameArray::setShouldCache):
10334 (JSC::PropertyNameArray::shouldCache): Renamed "cacheable" to "shouldCache"
10335 to communicate that the client is specifying a recommendation, not a
10338 * runtime/Structure.cpp:
10339 (JSC::Structure::Structure): No need to initialize a RefPtr.
10340 (JSC::Structure::getEnumerablePropertyNames): Moved some code into helper
10343 (JSC::Structure::prototypeChain): New centralized accessor for a prototype
10344 chain. Revalidates on every access, since the objects in the prototype
10345 chain may have mutated.
10347 (JSC::Structure::isValid): Helper function for revalidating a cached
10350 (JSC::Structure::getEnumerableNamesFromPropertyTable):
10351 (JSC::Structure::getEnumerableNamesFromClassInfoTable): Factored out of
10352 getEnumerablePropertyNames.
10354 * runtime/Structure.h:
10356 * runtime/StructureChain.cpp:
10357 (JSC::StructureChain::StructureChain):
10358 * runtime/StructureChain.h:
10359 (JSC::StructureChain::create): No need for structureChainsAreEqual, since
10360 we use pointer equality now. Refactored StructureChain to make a little
10361 more sense and eliminate special cases for null prototypes.
10363 2009-02-25 Steve Falkenburg <sfalken@apple.com>
10365 Use timeBeginPeriod to enable timing resolution greater than 16ms in command line jsc for Windows.
10366 Allows more accurate reporting of benchmark times via command line jsc.exe. Doesn't affect WebKit's use of JavaScriptCore.
10368 Reviewed by Adam Roben.
10373 2009-02-24 Geoffrey Garen <ggaren@apple.com>
10379 2009-02-24 Mark Rowe <mrowe@apple.com>
10381 Reviewed by Oliver Hunt.
10383 <rdar://problem/6259220> Rename AVAILABLE_AFTER_WEBKIT_VERSION_3_1 (etc.) to match the other macros
10385 * API/JSBasePrivate.h:
10386 * API/JSContextRef.h:
10387 * API/JSObjectRef.h:
10388 * API/WebKitAvailability.h:
10390 2009-02-23 Geoffrey Garen <ggaren@apple.com>
10392 Reviewed by Sam Weinig.
10394 Next step in splitting JIT functionality out of the Interpreter class:
10395 Moved vptr storage from Interpreter to JSGlobalData, so it could be shared
10396 between Interpreter and JITStubs, and moved the *Trampoline JIT stubs
10397 into the JITStubs class. Also added a VPtrSet class to encapsulate vptr
10398 hacks during JSGlobalData initialization.
10400 SunSpider says 0.4% faster. Meh.
10402 * JavaScriptCore.exp:
10403 * JavaScriptCore.xcodeproj/project.pbxproj:
10404 * interpreter/Interpreter.cpp:
10405 (JSC::Interpreter::Interpreter):
10406 (JSC::Interpreter::tryCacheGetByID):
10407 (JSC::Interpreter::privateExecute):
10408 * interpreter/Interpreter.h:
10410 (JSC::JIT::privateCompileMainPass):
10411 (JSC::JIT::privateCompile):
10412 (JSC::JIT::privateCompileCTIMachineTrampolines):
10414 (JSC::JIT::compileCTIMachineTrampolines):
10416 (JSC::JIT::compileOpCall):
10417 (JSC::JIT::compileOpCallSlowCase):
10418 * jit/JITPropertyAccess.cpp:
10419 (JSC::JIT::privateCompilePatchGetArrayLength):
10420 * jit/JITStubs.cpp:
10421 (JSC::JITStubs::JITStubs):
10422 (JSC::JITStubs::tryCacheGetByID):
10423 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
10424 (JSC::JITStubs::cti_op_get_by_val):
10425 (JSC::JITStubs::cti_op_get_by_val_byte_array):
10426 (JSC::JITStubs::cti_op_put_by_val):
10427 (JSC::JITStubs::cti_op_put_by_val_array):
10428 (JSC::JITStubs::cti_op_put_by_val_byte_array):
10429 (JSC::JITStubs::cti_op_is_string):
10431 (JSC::JITStubs::ctiArrayLengthTrampoline):
10432 (JSC::JITStubs::ctiStringLengthTrampoline):
10433 (JSC::JITStubs::ctiVirtualCallPreLink):
10434 (JSC::JITStubs::ctiVirtualCallLink):
10435 (JSC::JITStubs::ctiVirtualCall):
10436 * runtime/ArrayPrototype.cpp:
10437 (JSC::arrayProtoFuncPop):
10438 (JSC::arrayProtoFuncPush):
10439 * runtime/FunctionPrototype.cpp:
10440 (JSC::functionProtoFuncApply):
10441 * runtime/JSArray.h:
10443 * runtime/JSByteArray.h:
10444 (JSC::asByteArray):
10445 (JSC::isJSByteArray):
10446 * runtime/JSCell.h:
10447 * runtime/JSFunction.h:
10448 * runtime/JSGlobalData.cpp:
10449 (JSC::VPtrSet::VPtrSet):
10450 (JSC::JSGlobalData::JSGlobalData):
10451 (JSC::JSGlobalData::create):
10452 (JSC::JSGlobalData::sharedInstance):
10453 * runtime/JSGlobalData.h:
10454 * runtime/JSString.h:
10456 * runtime/Operations.h:
10460 (JSC::WREC::Generator::compileRegExp):
10462 2009-02-23 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
10464 Reviewed by Oliver Hunt.
10466 Bug 23787: Allow JIT to generate SSE2 code if using GCC
10467 <https://bugs.webkit.org/show_bug.cgi?id=23787>
10469 GCC version of the cpuid check.
10471 * jit/JITArithmetic.cpp:
10472 (JSC::isSSE2Present): previous assembly code fixed.
10474 2009-02-23 David Levin <levin@chromium.org>
10476 Reviewed by Alexey Proskuryakov.
10478 Bug 24047: Need to simplify nested if's in WorkerRunLoop::runInMode
10479 <https://bugs.webkit.org/show_bug.cgi?id=24047>
10481 * wtf/MessageQueue.h:
10482 (WTF::MessageQueue::infiniteTime):
10483 Allows for one to call waitForMessageFilteredWithTimeout and wait forever.
10485 (WTF::MessageQueue::alwaysTruePredicate):
10486 (WTF::MessageQueue::waitForMessage):
10487 Made waitForMessage call waitForMessageFilteredWithTimeout, so that there is less
10490 (WTF::MessageQueue::waitForMessageFilteredWithTimeout):
10492 * wtf/ThreadingQt.cpp:
10493 (WTF::ThreadCondition::timedWait):
10494 * wtf/ThreadingWin.cpp:
10495 (WTF::ThreadCondition::timedWait):
10496 Made these two implementations consistent with the pthread and gtk implementations.
10497 Currently, the time calculations would overflow when passed large values.
10499 2009-02-23 Jeremy Moskovich <jeremy@chromium.org>
10501 Reviewed by Adam Roben.
10503 https://bugs.webkit.org/show_bug.cgi?id=24096
10504 PLATFORM(MAC)->PLATFORM(CF) since we want to use the CF functions in Chrome on OS X.
10506 * wtf/CurrentTime.cpp:
10508 2009-02-22 Geoffrey Garen <ggaren@apple.com>
10514 2009-02-22 Geoffrey Garen <ggaren@apple.com>
10520 2009-02-22 Geoffrey Garen <ggaren@apple.com>
10522 Reviewed by Sam Weinig.
10524 Next step in splitting JIT functionality out of the Interpreter class:
10525 Created a JITStubs class and renamed Interpreter::cti_* to JITStubs::cti_*.
10527 Also, moved timeout checking into its own class, located in JSGlobalData,
10528 so both the Interpreter and the JIT could have access to it.
10530 * JavaScriptCore.exp:
10531 * JavaScriptCore.pri:
10532 * JavaScriptCore.scons:
10533 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10534 * JavaScriptCore.xcodeproj/project.pbxproj:
10535 * JavaScriptCoreSources.bkl:
10536 * interpreter/CallFrame.h:
10537 * interpreter/Interpreter.cpp:
10538 (JSC::Interpreter::Interpreter):
10539 (JSC::Interpreter::privateExecute):
10540 * interpreter/Interpreter.h:
10541 * interpreter/Register.h:
10544 (JSC::JIT::emitTimeoutCheck):
10545 (JSC::JIT::privateCompileMainPass):
10546 (JSC::JIT::privateCompileSlowCases):
10547 (JSC::JIT::privateCompile):
10548 (JSC::JIT::privateCompileCTIMachineTrampolines):
10550 * jit/JITArithmetic.cpp:
10551 (JSC::JIT::compileFastArithSlow_op_lshift):
10552 (JSC::JIT::compileFastArithSlow_op_rshift):
10553 (JSC::JIT::compileFastArithSlow_op_bitand):
10554 (JSC::JIT::compileFastArithSlow_op_mod):
10555 (JSC::JIT::compileFastArith_op_mod):
10556 (JSC::JIT::compileFastArithSlow_op_post_inc):
10557 (JSC::JIT::compileFastArithSlow_op_post_dec):
10558 (JSC::JIT::compileFastArithSlow_op_pre_inc):
10559 (JSC::JIT::compileFastArithSlow_op_pre_dec):
10560 (JSC::JIT::compileFastArith_op_add):
10561 (JSC::JIT::compileFastArith_op_mul):
10562 (JSC::JIT::compileFastArith_op_sub):
10563 (JSC::JIT::compileBinaryArithOpSlowCase):
10564 (JSC::JIT::compileFastArithSlow_op_add):
10565 (JSC::JIT::compileFastArithSlow_op_mul):
10567 (JSC::JIT::compileOpCall):
10568 (JSC::JIT::compileOpCallSlowCase):
10569 * jit/JITPropertyAccess.cpp:
10570 (JSC::JIT::compileGetByIdHotPath):
10571 (JSC::JIT::compilePutByIdHotPath):
10572 (JSC::JIT::compileGetByIdSlowCase):
10573 (JSC::JIT::compilePutByIdSlowCase):
10574 (JSC::JIT::privateCompilePutByIdTransition):
10575 (JSC::JIT::patchGetByIdSelf):
10576 (JSC::JIT::patchPutByIdReplace):
10577 (JSC::JIT::privateCompilePatchGetArrayLength):
10578 (JSC::JIT::privateCompileGetByIdSelf):
10579 (JSC::JIT::privateCompileGetByIdProto):
10580 (JSC::JIT::privateCompileGetByIdChain):
10581 (JSC::JIT::privateCompilePutByIdReplace):
10582 * jit/JITStubs.cpp:
10583 (JSC::JITStubs::tryCachePutByID):
10584 (JSC::JITStubs::tryCacheGetByID):
10585 (JSC::JITStubs::cti_op_convert_this):
10586 (JSC::JITStubs::cti_op_end):
10587 (JSC::JITStubs::cti_op_add):
10588 (JSC::JITStubs::cti_op_pre_inc):
10589 (JSC::JITStubs::cti_timeout_check):
10590 (JSC::JITStubs::cti_register_file_check):
10591 (JSC::JITStubs::cti_op_loop_if_less):
10592 (JSC::JITStubs::cti_op_loop_if_lesseq):
10593 (JSC::JITStubs::cti_op_new_object):
10594 (JSC::JITStubs::cti_op_put_by_id_generic):
10595 (JSC::JITStubs::cti_op_get_by_id_generic):
10596 (JSC::JITStubs::cti_op_put_by_id):
10597 (JSC::JITStubs::cti_op_put_by_id_second):
10598 (JSC::JITStubs::cti_op_put_by_id_fail):
10599 (JSC::JITStubs::cti_op_get_by_id):
10600 (JSC::JITStubs::cti_op_get_by_id_second):
10601 (JSC::JITStubs::cti_op_get_by_id_self_fail):
10602 (JSC::JITStubs::cti_op_get_by_id_proto_list):
10603 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
10604 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
10605 (JSC::JITStubs::cti_op_get_by_id_array_fail):
10606 (JSC::JITStubs::cti_op_get_by_id_string_fail):
10607 (JSC::JITStubs::cti_op_instanceof):
10608 (JSC::JITStubs::cti_op_del_by_id):
10609 (JSC::JITStubs::cti_op_mul):
10610 (JSC::JITStubs::cti_op_new_func):
10611 (JSC::JITStubs::cti_op_call_JSFunction):
10612 (JSC::JITStubs::cti_op_call_arityCheck):
10613 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
10614 (JSC::JITStubs::cti_vm_lazyLinkCall):
10615 (JSC::JITStubs::cti_op_push_activation):
10616 (JSC::JITStubs::cti_op_call_NotJSFunction):
10617 (JSC::JITStubs::cti_op_create_arguments):
10618 (JSC::JITStubs::cti_op_create_arguments_no_params):
10619 (JSC::JITStubs::cti_op_tear_off_activation):
10620 (JSC::JITStubs::cti_op_tear_off_arguments):
10621 (JSC::JITStubs::cti_op_profile_will_call):
10622 (JSC::JITStubs::cti_op_profile_did_call):
10623 (JSC::JITStubs::cti_op_ret_scopeChain):
10624 (JSC::JITStubs::cti_op_new_array):
10625 (JSC::JITStubs::cti_op_resolve):
10626 (JSC::JITStubs::cti_op_construct_JSConstruct):
10627 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
10628 (JSC::JITStubs::cti_op_get_by_val):
10629 (JSC::JITStubs::cti_op_get_by_val_byte_array):
10630 (JSC::JITStubs::cti_op_resolve_func):
10631 (JSC::JITStubs::cti_op_sub):
10632 (JSC::JITStubs::cti_op_put_by_val):
10633 (JSC::JITStubs::cti_op_put_by_val_array):
10634 (JSC::JITStubs::cti_op_put_by_val_byte_array):
10635 (JSC::JITStubs::cti_op_lesseq):
10636 (JSC::JITStubs::cti_op_loop_if_true):
10637 (JSC::JITStubs::cti_op_negate):
10638 (JSC::JITStubs::cti_op_resolve_base):
10639 (JSC::JITStubs::cti_op_resolve_skip):
10640 (JSC::JITStubs::cti_op_resolve_global):
10641 (JSC::JITStubs::cti_op_div):
10642 (JSC::JITStubs::cti_op_pre_dec):
10643 (JSC::JITStubs::cti_op_jless):
10644 (JSC::JITStubs::cti_op_not):
10645 (JSC::JITStubs::cti_op_jtrue):
10646 (JSC::JITStubs::cti_op_post_inc):
10647 (JSC::JITStubs::cti_op_eq):
10648 (JSC::JITStubs::cti_op_lshift):
10649 (JSC::JITStubs::cti_op_bitand):
10650 (JSC::JITStubs::cti_op_rshift):
10651 (JSC::JITStubs::cti_op_bitnot):
10652 (JSC::JITStubs::cti_op_resolve_with_base):
10653 (JSC::JITStubs::cti_op_new_func_exp):
10654 (JSC::JITStubs::cti_op_mod):
10655 (JSC::JITStubs::cti_op_less):
10656 (JSC::JITStubs::cti_op_neq):
10657 (JSC::JITStubs::cti_op_post_dec):
10658 (JSC::JITStubs::cti_op_urshift):
10659 (JSC::JITStubs::cti_op_bitxor):
10660 (JSC::JITStubs::cti_op_new_regexp):
10661 (JSC::JITStubs::cti_op_bitor):
10662 (JSC::JITStubs::cti_op_call_eval):
10663 (JSC::JITStubs::cti_op_throw):
10664 (JSC::JITStubs::cti_op_get_pnames):
10665 (JSC::JITStubs::cti_op_next_pname):
10666 (JSC::JITStubs::cti_op_push_scope):
10667 (JSC::JITStubs::cti_op_pop_scope):
10668 (JSC::JITStubs::cti_op_typeof):
10669 (JSC::JITStubs::cti_op_is_undefined):
10670 (JSC::JITStubs::cti_op_is_boolean):
10671 (JSC::JITStubs::cti_op_is_number):
10672 (JSC::JITStubs::cti_op_is_string):
10673 (JSC::JITStubs::cti_op_is_object):
10674 (JSC::JITStubs::cti_op_is_function):
10675 (JSC::JITStubs::cti_op_stricteq):
10676 (JSC::JITStubs::cti_op_nstricteq):
10677 (JSC::JITStubs::cti_op_to_jsnumber):
10678 (JSC::JITStubs::cti_op_in):
10679 (JSC::JITStubs::cti_op_push_new_scope):
10680 (JSC::JITStubs::cti_op_jmp_scopes):
10681 (JSC::JITStubs::cti_op_put_by_index):
10682 (JSC::JITStubs::cti_op_switch_imm):
10683 (JSC::JITStubs::cti_op_switch_char):
10684 (JSC::JITStubs::cti_op_switch_string):
10685 (JSC::JITStubs::cti_op_del_by_val):
10686 (JSC::JITStubs::cti_op_put_getter):
10687 (JSC::JITStubs::cti_op_put_setter):
10688 (JSC::JITStubs::cti_op_new_error):
10689 (JSC::JITStubs::cti_op_debug):
10690 (JSC::JITStubs::cti_vm_throw):
10693 * runtime/JSFunction.h:
10694 * runtime/JSGlobalData.cpp:
10695 (JSC::JSGlobalData::JSGlobalData):
10696 * runtime/JSGlobalData.h:
10697 * runtime/JSGlobalObject.cpp:
10698 * runtime/JSGlobalObject.h:
10699 * runtime/TimeoutChecker.cpp: Copied from interpreter/Interpreter.cpp.
10700 (JSC::TimeoutChecker::TimeoutChecker):
10701 (JSC::TimeoutChecker::reset):
10702 (JSC::TimeoutChecker::didTimeOut):
10703 * runtime/TimeoutChecker.h: Copied from interpreter/Interpreter.h.
10704 (JSC::TimeoutChecker::setTimeoutInterval):
10705 (JSC::TimeoutChecker::ticksUntilNextCheck):
10706 (JSC::TimeoutChecker::start):
10707 (JSC::TimeoutChecker::stop):
10709 2009-02-20 Gustavo Noronha Silva <gns@gnome.org>
10711 Unreviewed build fix after r41100.
10715 2009-02-20 Oliver Hunt <oliver@apple.com>
10717 Reviewed by Mark Rowe.
10719 <rdar://problem/6606660> 2==null returns true in 64bit jit
10721 Code for op_eq_null and op_neq_null was incorrectly performing
10722 a 32bit compare, which truncated the type tag from an integer
10723 immediate, leading to incorrect behaviour.
10725 * assembler/MacroAssembler.h:
10726 (JSC::MacroAssembler::setPtr):
10727 * assembler/MacroAssemblerX86_64.h:
10728 (JSC::MacroAssemblerX86_64::setPtr):
10730 (JSC::JIT::privateCompileMainPass):
10732 2009-02-19 Geoffrey Garen <ggaren@apple.com>
10734 Reviewed by Gavin Barraclough.
10736 First step in splitting JIT functionality out of the Interpreter class:
10737 Created JITStubs.h/.cpp, and moved Interpreter::cti_* into JITStubs.cpp.
10739 Functions that the Interpreter and JITStubs share moved to Operations.h/.cpp.
10742 * JavaScriptCore.pri:
10743 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10744 * JavaScriptCore.xcodeproj/project.pbxproj:
10745 * interpreter/Interpreter.cpp:
10746 (JSC::Interpreter::resolveBase):
10747 (JSC::Interpreter::checkTimeout):
10748 (JSC::Interpreter::privateExecute):
10749 * interpreter/Interpreter.h:
10750 * jit/JITStubs.cpp: Copied from interpreter/Interpreter.cpp.
10751 (JSC::Interpreter::cti_op_resolve_base):
10752 * jit/JITStubs.h: Copied from interpreter/Interpreter.h.
10753 * runtime/Operations.cpp:
10754 (JSC::jsAddSlowCase):
10755 (JSC::jsTypeStringForValue):
10756 (JSC::jsIsObjectType):
10757 (JSC::jsIsFunctionType):
10758 * runtime/Operations.h:
10762 (JSC::cachePrototypeChain):
10763 (JSC::countPrototypeChainEntriesAndCheckForProxies):
10764 (JSC::resolveBase):
10766 2009-02-19 Gavin Barraclough <barraclough@apple.com>
10768 Reviewed by Oliver Hunt.
10770 Fix for x86-64. Where the JavaScriptCore text segment lies outside
10771 a 2gb range of the heap containing JIT generated code, callbacks
10772 from JIT code to the stub functions in Interpreter will be incorrectly
10775 No performance impact on Sunspider, 1% regression on v8-tests,
10776 due to a 3% regression on richards.
10778 * assembler/AbstractMacroAssembler.h:
10779 (JSC::AbstractMacroAssembler::Call::Call):
10780 (JSC::AbstractMacroAssembler::Jump::link):
10781 (JSC::AbstractMacroAssembler::Jump::linkTo):
10782 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
10783 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
10784 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
10785 (JSC::AbstractMacroAssembler::PatchBuffer::link):
10786 (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
10787 (JSC::AbstractMacroAssembler::differenceBetween):
10788 * assembler/MacroAssembler.h:
10789 (JSC::MacroAssembler::tailRecursiveCall):
10790 (JSC::MacroAssembler::makeTailRecursiveCall):
10791 * assembler/MacroAssemblerX86.h:
10792 (JSC::MacroAssemblerX86::call):
10793 * assembler/MacroAssemblerX86Common.h:
10794 * assembler/MacroAssemblerX86_64.h:
10795 (JSC::MacroAssemblerX86_64::call):
10796 (JSC::MacroAssemblerX86_64::moveWithPatch):
10797 (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
10798 (JSC::MacroAssemblerX86_64::storePtrWithPatch):
10799 * assembler/X86Assembler.h:
10800 (JSC::X86Assembler::jmp_r):
10801 (JSC::X86Assembler::linkJump):
10802 (JSC::X86Assembler::patchJump):
10803 (JSC::X86Assembler::patchCall):
10804 (JSC::X86Assembler::linkCall):
10805 (JSC::X86Assembler::patchAddress):
10806 * interpreter/Interpreter.cpp:
10807 (JSC::Interpreter::tryCTICachePutByID):
10809 (JSC::JIT::privateCompile):
10810 (JSC::JIT::privateCompileCTIMachineTrampolines):
10812 * jit/JITArithmetic.cpp:
10813 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
10814 (JSC::JIT::compileBinaryArithOp):
10815 * jit/JITPropertyAccess.cpp:
10816 (JSC::JIT::privateCompilePutByIdTransition):
10817 (JSC::JIT::privateCompileGetByIdSelf):
10818 (JSC::JIT::privateCompilePutByIdReplace):
10820 2009-02-18 Geoffrey Garen <ggaren@apple.com>
10822 Reviewed by Oliver Hunt.
10824 Simplified .call and .apply in preparation for optimizing them. Also,
10827 * runtime/FunctionPrototype.cpp:
10828 (JSC::functionProtoFuncApply):
10829 (JSC::functionProtoFuncCall): No need to do any specific conversion on
10830 'this' -- op_convert_this will do it if necessary.
10832 * runtime/JSImmediate.cpp:
10833 (JSC::JSImmediate::toThisObject): Slightly relaxed the rules on
10834 toThisObject to allow for 'undefined', which can be passed through
10837 2009-02-19 David Levin <levin@chromium.org>
10839 Reviewed by Alexey Proskuryakov.
10841 Bug 23976: MessageQueue needs a way to wait for a message that satisfies an arbitrary criteria.
10842 <https://bugs.webkit.org/show_bug.cgi?id=23976>
10845 (WTF::Deque<T>::findIf):
10846 * wtf/MessageQueue.h:
10847 (WTF::MessageQueue<T>::waitForMessageFiltered):
10849 2009-02-18 David Levin <levin@chromium.org>
10851 Reviewed by Alexey Proskuryakov.
10853 Bug 23974: Deque::Remove would be a useful method.
10854 <https://bugs.webkit.org/show_bug.cgi?id=23974>
10856 Add Deque::remove and DequeIteratorBase<T>::operator=.
10858 Why was operator= added? Every concrete iterator (DequeIterator..DequeConstReverseIterator)
10859 was calling DequeIteratorBase::assign(), which called Base::operator=(). Base::operator=()
10860 was not implemented. This went unnoticed because the iterator copy code has been unused.
10863 (WTF::Deque<T>::remove):
10864 (WTF::DequeIteratorBase<T>::removeFromIteratorsList):
10865 (WTF::DequeIteratorBase<T>::operator=):
10866 (WTF::DequeIteratorBase<T>::~DequeIteratorBase):
10868 2009-02-18 Gustavo Noronha Silva <gns@gnome.org>
10870 Reviewed by Holger Freyther.
10872 Fix symbols.filter location, and add other missing files to the
10873 autotools build, so that make dist works.
10877 2009-02-17 Geoffrey Garen <ggaren@apple.com>
10879 Reviewed by Sam Weinig.
10881 Fixed failure in js1_5/Regress/regress-168347.js, as seen on the Oliver
10884 Technically, both behaviors are OK, but we might as well keep this test
10887 * runtime/FunctionPrototype.cpp:
10888 (JSC::insertSemicolonIfNeeded): No need to add a trailing semicolon
10889 after a trailing '}', since '}' ends a block, indicating the end of a
10892 2009-02-17 Geoffrey Garen <ggaren@apple.com>
10896 * runtime/FunctionPrototype.cpp:
10898 2009-02-17 Oliver Hunt <oliver@apple.com>
10900 Reviewed by Geoff Garen.
10902 Add assertion to guard against oversized pc relative calls.
10904 * assembler/X86Assembler.h:
10905 (JSC::X86Assembler::link):
10907 2009-02-17 Geoffrey Garen <ggaren@apple.com>
10909 Reviewed by Sam Weinig.
10911 Fixed <rdar://problem/6595040> REGRESSION: http://www.amnestyusa.org/
10914 amnestyusa.org uses the Optimist JavaScript library, which adds event
10915 listeners by concatenating string-ified functions. This is only sure to
10916 be syntactically valid if the string-ified functions end in semicolons.
10918 * parser/Lexer.cpp:
10919 (JSC::Lexer::isWhiteSpace):
10921 (JSC::Lexer::isWhiteSpace):
10922 (JSC::Lexer::isLineTerminator): Added some helper functions for examining
10925 * runtime/FunctionPrototype.cpp:
10926 (JSC::appendSemicolonIfNeeded):
10927 (JSC::functionProtoFuncToString): When string-ifying a function, insert
10928 a semicolon in the last non-whitespace position, if one doesn't already exist.
10930 2009-02-16 Oliver Hunt <oliver@apple.com>
10932 Reviewed by NOBODY (Build fix).
10934 Roll out r41022 as it breaks qt and gtk builds
10936 * jit/JITArithmetic.cpp:
10937 (JSC::isSSE2Present):
10939 2009-02-16 Sam Weinig <sam@webkit.org>
10941 Reviewed by Geoffrey Garen.
10943 Fix for <rdar://problem/6468156>
10944 REGRESSION (r36779): Adding link, images, flash in TinyMCE blocks entire page (21382)
10946 No performance regression.
10948 * runtime/Arguments.cpp:
10949 (JSC::Arguments::fillArgList): Add codepath for when the "length" property has been
10952 2009-02-16 Mark Rowe <mrowe@apple.com>
10956 * wtf/FastMalloc.cpp:
10957 (WTF::TCMallocStats::):
10958 (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
10960 2009-02-16 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
10962 Reviewed by Oliver Hunt.
10964 Bug 23787: Allow JIT to generate SSE2 code if using GCC
10965 <https://bugs.webkit.org/show_bug.cgi?id=23787>
10967 GCC version of the cpuid check.
10969 * jit/JITArithmetic.cpp:
10970 (JSC::isSSE2Present): GCC assembly code added.
10971 6.6% progression on x86 Linux with JIT and WREC on SunSpider if using SSE2 capable machine.
10973 2009-02-13 Adam Treat <adam.treat@torchmobile.com>
10975 Reviewed by George Staikos.
10977 https://bugs.webkit.org/show_bug.cgi?id=23960
10980 Don't depend on 'initializeThreading()' to come before a call to 'isMainThread()'
10981 as QtWebKit only calls 'initializeThreading()' during QWebPage construction.
10983 A client app may well make a call to QWebSettings::iconForUrl() for instance
10984 before creating a QWebPage and that call to QWebSettings triggers an
10985 ASSERT(isMainThread()) deep within WebCore.
10987 * wtf/ThreadingQt.cpp:
10988 (WTF::isMainThread):
10990 2009-02-13 Gavin Barraclough <barraclough@apple.com>
10992 Reviewed by Darin Adler.
10994 Some data in the instruction stream is potentially uninitialized - fix this.
10996 Change the OperandTypes constructor so that uninitialized memory in the int
10997 is zeroed, and modify the Instruction constructor taking an Opcode so that
10998 if !HAVE(COMPUTED_GOTO) (i.e. when Opcode is an enum, and is potentially only
10999 a byte) it zeros the Instruction first before writing the opcode.
11001 * bytecode/Instruction.h:
11002 (JSC::Instruction::Instruction):
11003 * parser/ResultType.h:
11004 (JSC::OperandTypes::OperandTypes):
11006 2009-02-13 Geoffrey Garen <ggaren@apple.com>
11008 Build fix for non_JIT platforms.
11010 * bytecode/CodeBlock.h:
11011 (JSC::CodeBlock::setIsNumericCompareFunction):
11012 (JSC::CodeBlock::isNumericCompareFunction):
11014 2009-02-13 Geoffrey Garen <ggaren@apple.com>
11016 Reviewed by Darin Adler.
11018 Fixed <rdar://problem/6584057> Optimize sort by JS numeric comparison
11019 function not to run the comparison function
11021 * bytecode/CodeBlock.cpp:
11022 (JSC::CodeBlock::CodeBlock):
11023 * bytecode/CodeBlock.h:
11024 (JSC::CodeBlock::setIsNumericCompareFunction):
11025 (JSC::CodeBlock::isNumericCompareFunction): Added the ability to track
11026 whether a CodeBlock performs a sort-like numeric comparison.
11028 * bytecompiler/BytecodeGenerator.cpp:
11029 (JSC::BytecodeGenerator::generate): Set the isNumericCompareFunction bit
11032 * parser/Nodes.cpp:
11033 (JSC::FunctionBodyNode::emitBytecode): Fixed a bug that caused us to
11034 codegen an extra return at the end of all functions (eek!), since this
11035 made it harder / weirder to detect the numeric comparison pattern in
11038 * runtime/ArrayPrototype.cpp:
11039 (JSC::arrayProtoFuncSort): Use the isNumericCompareFunction bit to do
11040 a faster sort if we can.
11042 * runtime/FunctionConstructor.cpp:
11043 (JSC::extractFunctionBody):
11044 (JSC::constructFunction):
11045 * runtime/FunctionConstructor.h: Renamed and exported extractFunctionBody for
11046 use in initializing lazyNumericCompareFunction.
11048 * runtime/JSArray.cpp:
11049 (JSC::compareNumbersForQSort):
11050 (JSC::compareByStringPairForQSort):
11051 (JSC::JSArray::sortNumeric):
11052 (JSC::JSArray::sort):
11053 * runtime/JSArray.h: Added a fast numeric sort. Renamed ArrayQSortPair
11054 to be more specific since we do different kinds of qsort now.
11056 * runtime/JSGlobalData.cpp:
11057 (JSC::JSGlobalData::JSGlobalData):
11058 (JSC::JSGlobalData::numericCompareFunction):
11059 (JSC::JSGlobalData::ClientData::~ClientData):
11060 * runtime/JSGlobalData.h: Added helper data for computing the
11061 isNumericCompareFunction bit.
11063 2009-02-13 Darin Adler <darin@apple.com>
11065 * Configurations/JavaScriptCore.xcconfig: Undo accidental commit of this file.
11067 2009-02-12 Darin Adler <darin@apple.com>
11069 Reviewed by Oliver Hunt and Alexey Proskuryakov.
11071 Speed up a couple string functions.
11073 * runtime/StringPrototype.cpp:
11074 (JSC::stringProtoFuncIndexOf): Added a fast path for cases where the second
11075 argument is either missing or an integer.
11076 (JSC::stringProtoFuncBig): Use jsNontrivialString since the string is guaranteed
11077 to be 2 or more characters long.
11078 (JSC::stringProtoFuncSmall): Ditto.
11079 (JSC::stringProtoFuncBlink): Ditto.
11080 (JSC::stringProtoFuncBold): Ditto.
11081 (JSC::stringProtoFuncItalics): Ditto.
11082 (JSC::stringProtoFuncStrike): Ditto.
11083 (JSC::stringProtoFuncSub): Ditto.
11084 (JSC::stringProtoFuncSup): Ditto.
11085 (JSC::stringProtoFuncFontcolor): Ditto.
11086 (JSC::stringProtoFuncFontsize): Make the fast path Sam recently added even faster
11087 by avoiding all but the minimum memory allocation.
11088 (JSC::stringProtoFuncAnchor): Use jsNontrivialString.
11089 (JSC::stringProtoFuncLink): Added a fast path.
11091 * runtime/UString.cpp:
11092 (JSC::UString::find): Added a fast path for single-character search strings.
11094 2009-02-13 David Levin <levin@chromium.org>
11096 Reviewed by Darin Adler.
11098 Bug 23926: Race condition in callOnMainThreadAndWait
11099 <https://bugs.webkit.org/show_bug.cgi?id=23926>
11101 * wtf/MainThread.cpp:
11102 Removed callOnMainThreadAndWait since it isn't used.
11104 2009-02-13 Oliver Hunt <oliver@apple.com>
11106 Reviewed by Jon Honeycutt.
11108 Math.random is really slow on windows.
11110 Math.random calls WTF::randomNumber which is implemented as
11111 the secure rand_s on windows. Unfortunately rand_s is an order
11112 of magnitude slower than arc4random. For this reason I've
11113 added "weakRandomNumber" for use by JavaScript's Math Object.
11114 In the long term we should look at using our own secure PRNG
11115 in place of the system, but this will do for now.
11117 30% win on SunSpider on Windows, resolving most of the remaining
11120 * runtime/MathObject.cpp:
11121 (JSC::MathObject::MathObject):
11122 (JSC::mathProtoFuncRandom):
11123 * wtf/RandomNumber.cpp:
11124 (WTF::weakRandomNumber):
11125 (WTF::randomNumber):
11126 * wtf/RandomNumber.h:
11127 * wtf/RandomNumberSeed.h:
11128 (WTF::initializeWeakRandomNumberGenerator):
11130 2009-02-12 Mark Rowe <mrowe@apple.com>
11132 Fix the build for other platforms.
11134 * wtf/RandomNumber.cpp:
11135 (WTF::randomNumber):
11137 2009-02-12 Gavin Barraclough <barraclough@apple.com>
11139 Reviewed by Sam Weinig.
11141 Remove (/reduce) use of hard-wired register names from the JIT.
11142 Currently there is no abstraction of registers used in the JIT,
11143 which has a number of negative consequences. Hard-wiring x86
11144 register names makes the JIT less portable to other platforms,
11145 and prevents us from performing dynamic register allocation to
11146 attempt to maintain more temporary values in machine registers.
11147 (The latter will be more important on x86-64, where we have more
11148 registers to make use of).
11150 Also, remove MacroAssembler::mod32. This was not providing a
11151 useful abstraction, and was not in keeping with the rest of the
11152 MacroAssembler interface, in having specific register requirements.
11154 * assembler/MacroAssemblerX86Common.h:
11156 (JSC::JIT::compileOpStrictEq):
11157 (JSC::JIT::emitSlowScriptCheck):
11158 (JSC::JIT::privateCompileMainPass):
11159 (JSC::JIT::privateCompileSlowCases):
11160 (JSC::JIT::privateCompile):
11161 (JSC::JIT::privateCompileCTIMachineTrampolines):
11163 * jit/JITArithmetic.cpp:
11164 (JSC::JIT::compileFastArith_op_lshift):
11165 (JSC::JIT::compileFastArithSlow_op_lshift):
11166 (JSC::JIT::compileFastArith_op_rshift):
11167 (JSC::JIT::compileFastArithSlow_op_rshift):
11168 (JSC::JIT::compileFastArith_op_bitand):
11169 (JSC::JIT::compileFastArithSlow_op_bitand):
11170 (JSC::JIT::compileFastArith_op_mod):
11171 (JSC::JIT::compileFastArithSlow_op_mod):
11172 (JSC::JIT::compileFastArith_op_post_inc):
11173 (JSC::JIT::compileFastArithSlow_op_post_inc):
11174 (JSC::JIT::compileFastArith_op_post_dec):
11175 (JSC::JIT::compileFastArithSlow_op_post_dec):
11176 (JSC::JIT::compileFastArith_op_pre_inc):
11177 (JSC::JIT::compileFastArithSlow_op_pre_inc):
11178 (JSC::JIT::compileFastArith_op_pre_dec):
11179 (JSC::JIT::compileFastArithSlow_op_pre_dec):
11180 (JSC::JIT::compileFastArith_op_add):
11181 (JSC::JIT::compileFastArith_op_mul):
11182 (JSC::JIT::compileFastArith_op_sub):
11183 (JSC::JIT::compileBinaryArithOp):
11185 (JSC::JIT::compileOpCallInitializeCallFrame):
11186 (JSC::JIT::compileOpCallSetupArgs):
11187 (JSC::JIT::compileOpCallEvalSetupArgs):
11188 (JSC::JIT::compileOpConstructSetupArgs):
11189 (JSC::JIT::compileOpCall):
11190 (JSC::JIT::compileOpCallSlowCase):
11191 * jit/JITInlineMethods.h:
11192 (JSC::JIT::emitGetVirtualRegister):
11193 (JSC::JIT::emitPutVirtualRegister):
11194 (JSC::JIT::emitNakedCall):
11195 (JSC::JIT::restoreArgumentReference):
11196 (JSC::JIT::restoreArgumentReferenceForTrampoline):
11197 * jit/JITPropertyAccess.cpp:
11198 (JSC::JIT::compileGetByIdHotPath):
11199 (JSC::JIT::compilePutByIdHotPath):
11200 (JSC::JIT::compileGetByIdSlowCase):
11201 (JSC::JIT::compilePutByIdSlowCase):
11202 (JSC::JIT::privateCompilePutByIdTransition):
11203 (JSC::JIT::privateCompilePatchGetArrayLength):
11204 (JSC::JIT::privateCompileGetByIdSelf):
11205 (JSC::JIT::privateCompileGetByIdProto):
11206 (JSC::JIT::privateCompileGetByIdSelfList):
11207 (JSC::JIT::privateCompileGetByIdProtoList):
11208 (JSC::JIT::privateCompileGetByIdChainList):
11209 (JSC::JIT::privateCompileGetByIdChain):
11210 (JSC::JIT::privateCompilePutByIdReplace):
11212 2009-02-12 Horia Olaru <olaru@adobe.com>
11214 Reviewed by Oliver Hunt.
11216 https://bugs.webkit.org/show_bug.cgi?id=23400
11218 When throwing an exception within an eval argument string, the dst parameter was
11219 modified in the functions below and the return value for eval was altered. Changed
11220 the emitNode call in JSC::ThrowNode::emitBytecode to use a temporary register
11221 to store its results instead of dst. The JSC::FunctionCallResolveNode::emitBytecode
11222 would load the function within the dst registry, also altering the result returned
11223 by eval. Replaced it with another temporary.
11225 * parser/Nodes.cpp:
11226 (JSC::FunctionCallResolveNode::emitBytecode):
11227 (JSC::ThrowNode::emitBytecode):
11229 2009-02-12 Sam Weinig <sam@webkit.org>
11231 Reviewed by Geoffrey Garen.
11233 Speed up String.prototype.fontsize.
11235 * runtime/StringPrototype.cpp:
11236 (JSC::stringProtoFuncFontsize): Specialize for defined/commonly used values.
11238 2009-02-12 Geoffrey Garen <ggaren@apple.com>
11240 Reviewed by Sam Weinig.
11244 * wtf/RandomNumber.cpp:
11245 (WTF::randomNumber): Divide by the maximum representable value, which
11246 is different on each platform now, to get values between 0 and 1.
11248 2009-02-12 Geoffrey Garen <ggaren@apple.com>
11252 * wtf/RandomNumber.cpp:
11253 (WTF::randomNumber):
11255 2009-02-12 Geoffrey Garen <ggaren@apple.com>
11257 Reviewed by Sam Weinig.
11259 Fixed <rdar://problem/6582048>.
11261 * wtf/RandomNumber.cpp:
11262 (WTF::randomNumber): Make only one call to the random number generator
11263 on platforms where the generator is cryptographically secure. The value
11264 of randomness over and above cryptographically secure randomness is not
11265 clear, and it caused some performance problems.
11267 2009-02-12 Adam Roben <aroben@apple.com>
11269 Fix lots of Perl warnings when building JavaScriptCoreGenerated on
11272 Reviewed by John Sullivan.
11274 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
11275 Create the docs/ directory so that we can write bytecode.html into it.
11276 This matches what JavaScriptCore.xcodeproj does.
11278 2009-02-12 Simon Hausmann <simon.hausmann@nokia.com>
11280 Rubber-stamped by Lars.
11282 Re-enable the JIT in the Qt build with -fno-stack-protector on Linux.
11284 * JavaScriptCore.pri:
11286 2009-02-11 Dmitry Titov <dimich@chromium.org>
11288 Reviewed by Alexey Proskuryakov.
11290 https://bugs.webkit.org/show_bug.cgi?id=23705
11291 Fix the UI freeze caused by Worker generating a flood of messages.
11292 Measure time we spend in executing posted work items. If too much time is spent
11293 without returning to the run loop, exit and reschedule.
11295 * wtf/MainThread.h:
11296 Added initializeMainThreadPlatform() to initialize low-level mechanism for posting
11297 work items from thread to thread. This removes #ifdefs for WIN and CHROMIUM from platform-independent code.
11299 * wtf/MainThread.cpp:
11300 (WTF::initializeMainThread):
11301 (WTF::dispatchFunctionsFromMainThread):
11302 Instead of dispatching all work items in the queue, dispatch them one by one
11303 and measure elapsed time. After a threshold, reschedule and quit.
11305 (WTF::callOnMainThread):
11306 (WTF::callOnMainThreadAndWait):
11307 Only schedule dispatch if the queue was empty - to avoid many posted messages in the run loop queue.
11309 * wtf/mac/MainThreadMac.mm:
11310 (WTF::scheduleDispatchFunctionsOnMainThread):
11311 Use static instance of the mainThreadCaller instead of allocating and releasing it each time.
11312 (WTF::initializeMainThreadPlatform):
11313 * wtf/gtk/MainThreadChromium.cpp:
11314 (WTF::initializeMainThreadPlatform):
11315 * wtf/gtk/MainThreadGtk.cpp:
11316 (WTF::initializeMainThreadPlatform):
11317 * wtf/qt/MainThreadQt.cpp:
11318 (WTF::initializeMainThreadPlatform):
11319 * wtf/win/MainThreadWin.cpp:
11320 (WTF::initializeMainThreadPlatform):
11321 * wtf/wx/MainThreadWx.cpp:
11322 (WTF::initializeMainThreadPlatform):
11324 2009-02-11 Sam Weinig <sam@webkit.org>
11326 Reviewed by Gavin Barraclough.
11330 * assembler/AbstractMacroAssembler.h:
11331 (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
11332 (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
11333 (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
11334 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
11335 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
11336 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
11337 (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
11338 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
11339 (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
11340 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
11341 (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
11342 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
11343 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
11344 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
11345 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
11346 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
11347 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
11348 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
11349 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
11350 (JSC::AbstractMacroAssembler::PatchBuffer::link):
11351 (JSC::::CodeLocationCommon::labelAtOffset):
11352 (JSC::::CodeLocationCommon::jumpAtOffset):
11353 (JSC::::CodeLocationCommon::callAtOffset):
11354 (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
11355 (JSC::::CodeLocationCommon::dataLabel32AtOffset):
11357 2009-02-11 Sam Weinig <sam@webkit.org>
11359 Reviewed by Gavin Barraclough.
11361 * assembler/AbstractMacroAssembler.h: Fix comments.
11363 2009-02-11 Alexey Proskuryakov <ap@webkit.org>
11365 Trying to fix wx build.
11367 * bytecode/JumpTable.h: Include "MacroAssembler.h", not <MacroAssembler.h>.
11368 * jscore.bkl: Added assembler directory to search paths.
11370 2009-02-10 Gavin Barraclough <barraclough@apple.com>
11379 * bytecode/Instruction.h:
11380 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
11381 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
11383 2009-02-10 Gavin Barraclough <barraclough@apple.com>
11385 Reviewed by Oliver Hunt.
11387 Reduce use of void* / reinterpret_cast in JIT repatching code,
11388 add strong types for Calls and for the various types of pointers
11389 we retain into the JIT generated instruction stream.
11391 No performance impact.
11393 * assembler/AbstractMacroAssembler.h:
11394 (JSC::AbstractMacroAssembler::ImmPtr::ImmPtr):
11395 (JSC::AbstractMacroAssembler::ImmPtr::asIntptr):
11396 (JSC::AbstractMacroAssembler::Imm32::Imm32):
11397 (JSC::AbstractMacroAssembler::Label::Label):
11398 (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
11399 (JSC::AbstractMacroAssembler::Call::Call):
11400 (JSC::AbstractMacroAssembler::Call::link):
11401 (JSC::AbstractMacroAssembler::Call::linkTo):
11402 (JSC::AbstractMacroAssembler::Jump::Jump):
11403 (JSC::AbstractMacroAssembler::Jump::linkTo):
11404 (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
11405 (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
11406 (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
11407 (JSC::AbstractMacroAssembler::CodeLocationLabel::CodeLocationLabel):
11408 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
11409 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
11410 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
11411 (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
11412 (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
11413 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
11414 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
11415 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
11416 (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
11417 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
11418 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
11419 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
11420 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
11421 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
11422 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
11423 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
11424 (JSC::AbstractMacroAssembler::PatchBuffer::entry):
11425 (JSC::AbstractMacroAssembler::PatchBuffer::trampolineAt):
11426 (JSC::AbstractMacroAssembler::PatchBuffer::link):
11427 (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
11428 (JSC::AbstractMacroAssembler::PatchBuffer::patch):
11429 (JSC::AbstractMacroAssembler::PatchBuffer::locationOf):
11430 (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
11431 (JSC::AbstractMacroAssembler::differenceBetween):
11432 (JSC::::CodeLocationCommon::labelAtOffset):
11433 (JSC::::CodeLocationCommon::jumpAtOffset):
11434 (JSC::::CodeLocationCommon::callAtOffset):
11435 (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
11436 (JSC::::CodeLocationCommon::dataLabel32AtOffset):
11437 * assembler/MacroAssemblerX86Common.h:
11438 (JSC::MacroAssemblerX86Common::call):
11439 * assembler/X86Assembler.h:
11440 (JSC::X86Assembler::getCallReturnOffset):
11441 * bytecode/CodeBlock.h:
11442 (JSC::CallLinkInfo::CallLinkInfo):
11443 (JSC::getStructureStubInfoReturnLocation):
11444 (JSC::getCallLinkInfoReturnLocation):
11445 * bytecode/Instruction.h:
11446 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
11447 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
11448 * bytecode/JumpTable.h:
11449 (JSC::StringJumpTable::ctiForValue):
11450 (JSC::SimpleJumpTable::ctiForValue):
11451 * bytecode/StructureStubInfo.h:
11452 (JSC::StructureStubInfo::StructureStubInfo):
11453 * bytecompiler/BytecodeGenerator.cpp:
11454 (JSC::BytecodeGenerator::emitCatch):
11455 (JSC::prepareJumpTableForStringSwitch):
11456 * interpreter/Interpreter.cpp:
11457 (JSC::Interpreter::cti_op_get_by_id_self_fail):
11458 (JSC::getPolymorphicAccessStructureListSlot):
11459 (JSC::Interpreter::cti_op_throw):
11460 (JSC::Interpreter::cti_op_switch_imm):
11461 (JSC::Interpreter::cti_op_switch_char):
11462 (JSC::Interpreter::cti_op_switch_string):
11463 (JSC::Interpreter::cti_vm_throw):
11465 (JSC::ctiSetReturnAddress):
11466 (JSC::ctiPatchCallByReturnAddress):
11467 (JSC::JIT::privateCompile):
11468 (JSC::JIT::privateCompileCTIMachineTrampolines):
11470 (JSC::CallRecord::CallRecord):
11471 (JSC::JIT::compileGetByIdSelf):
11472 (JSC::JIT::compileGetByIdProto):
11473 (JSC::JIT::compileGetByIdChain):
11474 (JSC::JIT::compilePutByIdReplace):
11475 (JSC::JIT::compilePutByIdTransition):
11476 (JSC::JIT::compilePatchGetArrayLength):
11477 (JSC::JIT::emitCTICall):
11479 (JSC::JIT::unlinkCall):
11480 (JSC::JIT::linkCall):
11481 * jit/JITInlineMethods.h:
11482 (JSC::JIT::emitNakedCall):
11483 (JSC::JIT::emitCTICall_internal):
11484 * jit/JITPropertyAccess.cpp:
11485 (JSC::JIT::compileGetByIdSlowCase):
11486 (JSC::JIT::compilePutByIdSlowCase):
11487 (JSC::JIT::privateCompilePutByIdTransition):
11488 (JSC::JIT::patchGetByIdSelf):
11489 (JSC::JIT::patchPutByIdReplace):
11490 (JSC::JIT::privateCompilePatchGetArrayLength):
11491 (JSC::JIT::privateCompileGetByIdSelf):
11492 (JSC::JIT::privateCompileGetByIdProto):
11493 (JSC::JIT::privateCompileGetByIdSelfList):
11494 (JSC::JIT::privateCompileGetByIdProtoList):
11495 (JSC::JIT::privateCompileGetByIdChainList):
11496 (JSC::JIT::privateCompileGetByIdChain):
11497 (JSC::JIT::privateCompilePutByIdReplace):
11499 2009-02-10 Adam Roben <aroben@apple.com>
11501 Windows build fix after r40813
11503 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added profiler/ to the include
11504 path so that Profiler.h can be found.
11506 2009-02-09 Gavin Barraclough <barraclough@apple.com>
11508 Reviewed by Oliver Hunt.
11510 Provide a class type for a generated block of JIT code.
11511 Also changes the return address -> bytecode index map to
11512 track the return addess as an unsigned offset into the code
11513 instead of a ptrdiff_t in terms of void**s - the latter is
11514 equal to the actual offset / sizeof(void*), making it a
11515 potentially lossy representation.
11517 * JavaScriptCore.xcodeproj/project.pbxproj:
11518 * assembler/AbstractMacroAssembler.h:
11519 (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
11520 * assembler/X86Assembler.h:
11521 (JSC::X86Assembler::getCallReturnOffset):
11522 * bytecode/CodeBlock.h:
11523 (JSC::CallReturnOffsetToBytecodeIndex::CallReturnOffsetToBytecodeIndex):
11524 (JSC::getCallReturnOffset):
11525 (JSC::CodeBlock::getBytecodeIndex):
11526 (JSC::CodeBlock::jitCode):
11527 (JSC::CodeBlock::callReturnIndexVector):
11528 * interpreter/Interpreter.cpp:
11529 (JSC::Interpreter::execute):
11530 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
11531 (JSC::Interpreter::cti_vm_lazyLinkCall):
11533 (JSC::JIT::privateCompile):
11537 (JSC::JIT::linkCall):
11538 * jit/JITCode.h: Added.
11540 (JSC::JITCode::JITCode):
11541 (JSC::JITCode::operator bool):
11542 (JSC::JITCode::addressForCall):
11543 (JSC::JITCode::offsetOf):
11544 (JSC::JITCode::execute):
11546 2009-02-09 John Grabowski <jrg@chromium.org>
11548 Reviewed by Darin Adler.
11550 https://bugs.webkit.org/show_bug.cgi?id=23856
11551 Change the definition of "main thread" for Chromium on OSX.
11552 It does not match the DARWIN definition.
11554 * wtf/ThreadingPthreads.cpp:
11555 (WTF::initializeThreading):
11556 (WTF::isMainThread):
11558 2009-02-09 Gavin Barraclough <barraclough@apple.com>
11560 Reviewed by Oliver Hunt.
11562 Minor bugfix, incorrect check meant that subtraction causing integer overflow
11563 would be missed on x86-64 JIT.
11565 * jit/JITArithmetic.cpp:
11566 (JSC::JIT::compileBinaryArithOp):
11568 2009-02-09 Gavin Barraclough <barraclough@apple.com>
11570 Reviewed by Oliver Hunt.
11572 A more sensible register allocation for x86-64.
11574 When WREC was ported to x86-64 it stuck with the same register allocation as x86.
11575 This requires registers to be reordered on entry into WREC generated code, since
11576 argument passing is different on x86-64 and x86 (regparm(3)). This patch switches
11577 x86-64 to use a native register allocation, that does not require argument registers
11580 * wrec/WRECGenerator.cpp:
11581 (JSC::WREC::Generator::generateEnter):
11582 (JSC::WREC::Generator::generateReturnSuccess):
11583 (JSC::WREC::Generator::generateReturnFailure):
11584 * wrec/WRECGenerator.h:
11586 2009-02-05 Adam Roben <aroben@apple.com>
11590 Rubberstamped by Sam Weinig.
11592 * wtf/TypeTraits.h: Include Platform.h, since this header uses macros
11595 2009-02-05 Dimitri Glazkov <dglazkov@chromium.org>
11597 Reviewed by Eric Seidel.
11599 https://bugs.webkit.org/show_bug.cgi?id=23747
11600 Add Chromium threading-related files.
11602 * wtf/MainThread.cpp: Added platform guard to initializeMainThread.
11603 * wtf/chromium/ChromiumThreading.h: Added.
11604 * wtf/chromium/MainThreadChromium.cpp: Added.
11605 (WTF::initializeMainThread):
11606 (WTF::scheduleDispatchFunctionsOnMainThread):
11608 2009-02-05 David Levin <levin@chromium.org>
11610 Reviewed by Darin Adler.
11612 Bug 23713: COMPILE_ASSERTS should be moved out of TypeTraits.h and into .cpp file
11613 <https://bugs.webkit.org/show_bug.cgi?id=23713>
11616 * JavaScriptCore.pri:
11617 * JavaScriptCore.scons:
11618 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
11619 * JavaScriptCore.xcodeproj/project.pbxproj:
11620 * JavaScriptCoreSources.bkl:
11622 * wtf/HashTraits.h:
11623 Remove unnecessary header file that I missed when moving out the type traits form this file.
11625 * wtf/TypeTraits.cpp: Added.
11627 * wtf/TypeTraits.h:
11628 Moved the compile asserts into TypeTraits.cpp file.
11630 2009-02-04 Gavin Barraclough <barraclough@apple.com>
11632 Reviewed by Oliver 'the nun' Hunt.
11634 Add -e switch to jsc to enable evaluation of scripts passed on the command line.
11639 (printUsageStatement):
11643 2009-02-04 Gavin Barraclough <barraclough@apple.com>
11645 Rubber stamped by Sam 'Big Mac' Weinig.
11647 * assembler/AbstractMacroAssembler.h: Copied from assembler/MacroAssembler.h.
11648 * assembler/MacroAssemblerX86.h: Copied from assembler/MacroAssembler.h.
11649 * assembler/MacroAssemblerX86Common.h: Copied from assembler/MacroAssembler.h.
11650 * assembler/MacroAssemblerX86_64.h: Copied from assembler/MacroAssembler.h.
11652 2009-02-04 Gavin Barraclough <barraclough@apple.com>
11654 Reviewed by Sam Weinig.
11656 This patch tidies up the MacroAssembler, cleaning up the code and refactoring out the
11657 platform-specific parts. The MacroAssembler gets split up like a beef burger, with the
11658 platform-agnostic data types being the lower bun (in the form of the class AbstractMacroAssembler),
11659 the plaform-specific code generation forming a big meaty patty of methods like 'add32',
11660 'branch32', etc (MacroAssemblerX86), and finally topped off with the bun-lid of the
11661 MacroAssembler class itself, providing covenience methods such as the stack peek & poke,
11662 and backwards branch methods, all of which can be described in a platform independent
11663 way using methods from the base class. The AbstractMacroAssembler is templated on the
11664 type of the assembler class that will be used for code generation, and the three layers
11665 are held together with the cocktail stick of inheritance.
11667 The above description is a slight simplification since the MacroAssemblerX86 is actually
11668 formed from two layers (in effect giving us a kind on bacon double cheeseburger) - with the
11669 bulk of methods that are common between x86 & x86-64 implemented in MacroAssemblerX86Common,
11670 which forms a base class for MacroAssemblerX86 and MacroAssemblerX86_64 (which add the methods
11671 specific to the given platform).
11673 I'm landing these changes first without splitting the classes across multiple files,
11674 I will follow up with a second patch to split up the file MacroAssembler.h.
11676 * assembler/MacroAssembler.h:
11677 (JSC::AbstractMacroAssembler::):
11678 (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
11679 (JSC::AbstractMacroAssembler::DataLabelPtr::patch):
11680 (JSC::AbstractMacroAssembler::DataLabel32::DataLabel32):
11681 (JSC::AbstractMacroAssembler::DataLabel32::patch):
11682 (JSC::AbstractMacroAssembler::Label::Label):
11683 (JSC::AbstractMacroAssembler::Jump::Jump):
11684 (JSC::AbstractMacroAssembler::Jump::link):
11685 (JSC::AbstractMacroAssembler::Jump::linkTo):
11686 (JSC::AbstractMacroAssembler::Jump::patch):
11687 (JSC::AbstractMacroAssembler::JumpList::link):
11688 (JSC::AbstractMacroAssembler::JumpList::linkTo):
11689 (JSC::AbstractMacroAssembler::PatchBuffer::link):
11690 (JSC::AbstractMacroAssembler::PatchBuffer::addressOf):
11691 (JSC::AbstractMacroAssembler::PatchBuffer::setPtr):
11692 (JSC::AbstractMacroAssembler::size):
11693 (JSC::AbstractMacroAssembler::copyCode):
11694 (JSC::AbstractMacroAssembler::label):
11695 (JSC::AbstractMacroAssembler::align):
11696 (JSC::AbstractMacroAssembler::differenceBetween):
11697 (JSC::MacroAssemblerX86Common::xor32):
11698 (JSC::MacroAssemblerX86Common::load32WithAddressOffsetPatch):
11699 (JSC::MacroAssemblerX86Common::store32WithAddressOffsetPatch):
11700 (JSC::MacroAssemblerX86Common::move):
11701 (JSC::MacroAssemblerX86Common::swap):
11702 (JSC::MacroAssemblerX86Common::signExtend32ToPtr):
11703 (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr):
11704 (JSC::MacroAssemblerX86Common::branch32):
11705 (JSC::MacroAssemblerX86Common::jump):
11706 (JSC::MacroAssemblerX86_64::add32):
11707 (JSC::MacroAssemblerX86_64::sub32):
11708 (JSC::MacroAssemblerX86_64::load32):
11709 (JSC::MacroAssemblerX86_64::store32):
11710 (JSC::MacroAssemblerX86_64::addPtr):
11711 (JSC::MacroAssemblerX86_64::andPtr):
11712 (JSC::MacroAssemblerX86_64::orPtr):
11713 (JSC::MacroAssemblerX86_64::rshiftPtr):
11714 (JSC::MacroAssemblerX86_64::subPtr):
11715 (JSC::MacroAssemblerX86_64::xorPtr):
11716 (JSC::MacroAssemblerX86_64::loadPtr):
11717 (JSC::MacroAssemblerX86_64::loadPtrWithAddressOffsetPatch):
11718 (JSC::MacroAssemblerX86_64::storePtr):
11719 (JSC::MacroAssemblerX86_64::storePtrWithAddressOffsetPatch):
11720 (JSC::MacroAssemblerX86_64::branchPtr):
11721 (JSC::MacroAssemblerX86_64::branchTestPtr):
11722 (JSC::MacroAssemblerX86_64::branchAddPtr):
11723 (JSC::MacroAssemblerX86_64::branchSubPtr):
11724 (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
11725 (JSC::MacroAssemblerX86_64::storePtrWithPatch):
11726 (JSC::MacroAssemblerX86::add32):
11727 (JSC::MacroAssemblerX86::sub32):
11728 (JSC::MacroAssemblerX86::load32):
11729 (JSC::MacroAssemblerX86::store32):
11730 (JSC::MacroAssemblerX86::branch32):
11731 (JSC::MacroAssemblerX86::branchPtrWithPatch):
11732 (JSC::MacroAssemblerX86::storePtrWithPatch):
11733 (JSC::MacroAssembler::pop):
11734 (JSC::MacroAssembler::peek):
11735 (JSC::MacroAssembler::poke):
11736 (JSC::MacroAssembler::branchPtr):
11737 (JSC::MacroAssembler::branch32):
11738 (JSC::MacroAssembler::branch16):
11739 (JSC::MacroAssembler::branchTestPtr):
11740 (JSC::MacroAssembler::addPtr):
11741 (JSC::MacroAssembler::andPtr):
11742 (JSC::MacroAssembler::orPtr):
11743 (JSC::MacroAssembler::rshiftPtr):
11744 (JSC::MacroAssembler::subPtr):
11745 (JSC::MacroAssembler::xorPtr):
11746 (JSC::MacroAssembler::loadPtr):
11747 (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
11748 (JSC::MacroAssembler::storePtr):
11749 (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
11750 (JSC::MacroAssembler::branchAddPtr):
11751 (JSC::MacroAssembler::branchSubPtr):
11752 * jit/JITArithmetic.cpp:
11753 (JSC::JIT::compileBinaryArithOp):
11755 2009-02-04 Alexey Proskuryakov <ap@webkit.org>
11757 Reviewed by Sam Weinig.
11759 https://bugs.webkit.org/show_bug.cgi?id=23681
11760 Worker tests crash in debug builds if run --singly
11762 The crash happened because worker threads continued running while debug-only static objects
11763 were already being destroyed on main thread.
11765 * runtime/Structure.cpp: Create static debug-only sets in heap, so that they don't get
11768 * wtf/ThreadingPthreads.cpp: Changed assertions to conventional form.
11770 2009-02-03 Gavin Barraclough <barraclough@apple.com>
11772 Reviewed by Geoff Garen.
11774 https://bugs.webkit.org/show_bug.cgi?id=23715
11776 Simplify MacroAssembler interface, by combining comparison methods.
11777 Seprate operations are combined as follows:
11778 jz32/jnz32/jzPtr/jnzPtr -> branchTest32/branchTestPtr,
11779 j*(Add|Mul|Sub)32/j*(Add|Mul|Sub)Ptr -> branch(Add|Mul|Sub)32/branch(Add|Mul|Sub)Ptr
11780 j*32/j*Ptr (all other two op combparisons) -> branch32/brnachPtr
11783 Also, represent the Scale of BaseIndex addresses as a plain enum (0,1,2,3),
11784 instead of as multiplicands (1,2,4,8).
11786 This patch singificantly reduces replication of code, and increases functionality supported
11787 by the MacroAssembler. No performance impact.
11789 * assembler/MacroAssembler.h:
11790 (JSC::MacroAssembler::):
11791 (JSC::MacroAssembler::branchPtr):
11792 (JSC::MacroAssembler::branchPtrWithPatch):
11793 (JSC::MacroAssembler::branch32):
11794 (JSC::MacroAssembler::branch16):
11795 (JSC::MacroAssembler::branchTestPtr):
11796 (JSC::MacroAssembler::branchTest32):
11797 (JSC::MacroAssembler::branchAddPtr):
11798 (JSC::MacroAssembler::branchAdd32):
11799 (JSC::MacroAssembler::branchMul32):
11800 (JSC::MacroAssembler::branchSubPtr):
11801 (JSC::MacroAssembler::branchSub32):
11802 (JSC::MacroAssembler::set32):
11803 (JSC::MacroAssembler::setTest32):
11804 * assembler/X86Assembler.h:
11805 (JSC::X86Assembler::):
11806 (JSC::X86Assembler::jccRel32):
11807 (JSC::X86Assembler::setccOpcode):
11808 (JSC::X86Assembler::cmpq_mr):
11809 (JSC::X86Assembler::setcc_r):
11810 (JSC::X86Assembler::sete_r):
11811 (JSC::X86Assembler::setne_r):
11812 (JSC::X86Assembler::jne):
11813 (JSC::X86Assembler::je):
11814 (JSC::X86Assembler::jl):
11815 (JSC::X86Assembler::jb):
11816 (JSC::X86Assembler::jle):
11817 (JSC::X86Assembler::jbe):
11818 (JSC::X86Assembler::jge):
11819 (JSC::X86Assembler::jg):
11820 (JSC::X86Assembler::ja):
11821 (JSC::X86Assembler::jae):
11822 (JSC::X86Assembler::jo):
11823 (JSC::X86Assembler::jp):
11824 (JSC::X86Assembler::js):
11825 (JSC::X86Assembler::jcc):
11826 (JSC::X86Assembler::X86InstructionFormatter::putModRmSib):
11828 (JSC::JIT::compileOpStrictEq):
11829 (JSC::JIT::emitSlowScriptCheck):
11830 (JSC::JIT::privateCompileMainPass):
11831 (JSC::JIT::privateCompileSlowCases):
11832 (JSC::JIT::privateCompile):
11833 (JSC::JIT::privateCompileCTIMachineTrampolines):
11834 * jit/JITArithmetic.cpp:
11835 (JSC::JIT::compileFastArith_op_lshift):
11836 (JSC::JIT::compileFastArith_op_mod):
11837 (JSC::JIT::compileFastArith_op_post_inc):
11838 (JSC::JIT::compileFastArith_op_post_dec):
11839 (JSC::JIT::compileFastArith_op_pre_inc):
11840 (JSC::JIT::compileFastArith_op_pre_dec):
11841 (JSC::JIT::compileBinaryArithOp):
11842 (JSC::JIT::compileFastArith_op_add):
11843 (JSC::JIT::compileFastArith_op_mul):
11845 (JSC::JIT::compileOpCall):
11846 (JSC::JIT::compileOpCallSlowCase):
11847 * jit/JITInlineMethods.h:
11848 (JSC::JIT::checkStructure):
11849 (JSC::JIT::emitJumpIfJSCell):
11850 (JSC::JIT::emitJumpIfNotJSCell):
11851 (JSC::JIT::emitJumpIfImmediateNumber):
11852 (JSC::JIT::emitJumpIfNotImmediateNumber):
11853 (JSC::JIT::emitJumpIfImmediateInteger):
11854 (JSC::JIT::emitJumpIfNotImmediateInteger):
11855 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
11856 * jit/JITPropertyAccess.cpp:
11857 (JSC::JIT::compileGetByIdHotPath):
11858 (JSC::JIT::compilePutByIdHotPath):
11859 (JSC::JIT::privateCompilePutByIdTransition):
11860 (JSC::JIT::privateCompilePatchGetArrayLength):
11861 (JSC::JIT::privateCompileGetByIdProto):
11862 (JSC::JIT::privateCompileGetByIdProtoList):
11863 (JSC::JIT::privateCompileGetByIdChainList):
11864 (JSC::JIT::privateCompileGetByIdChain):
11865 * runtime/RegExp.cpp:
11866 (JSC::RegExp::match):
11867 * wrec/WRECGenerator.cpp:
11868 (JSC::WREC::Generator::generateEnter):
11869 (JSC::WREC::Generator::generateIncrementIndex):
11870 (JSC::WREC::Generator::generateLoadCharacter):
11871 (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
11872 (JSC::WREC::Generator::generateBackreferenceQuantifier):
11873 (JSC::WREC::Generator::generateNonGreedyQuantifier):
11874 (JSC::WREC::Generator::generateGreedyQuantifier):
11875 (JSC::WREC::Generator::generatePatternCharacterPair):
11876 (JSC::WREC::Generator::generatePatternCharacter):
11877 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
11878 (JSC::WREC::Generator::generateCharacterClassInverted):
11879 (JSC::WREC::Generator::generateAssertionBOL):
11880 (JSC::WREC::Generator::generateAssertionEOL):
11881 (JSC::WREC::Generator::generateAssertionWordBoundary):
11882 (JSC::WREC::Generator::generateBackreference):
11884 2009-02-03 David Hyatt <hyatt@apple.com>
11886 Fix a bug in Vector's shrinkCapacity method. It did not properly copy elements into the inline buffer
11887 when shrinking down from a size that was greater than the inline capacity.
11892 (WTF::VectorBuffer::VectorBuffer):
11893 (WTF::VectorBuffer::allocateBuffer):
11895 2009-02-03 Simon Hausmann <simon.hausmann@nokia.com>
11897 Reviewed by Tor Arne Vestbø.
11899 Added accessor for JSByteArray storage.
11901 * runtime/JSByteArray.h:
11902 (JSC::JSByteArray::storage):
11904 2009-02-03 Dmitry Titov <dimich@chromium.org>
11906 Reviewed by Alexey Proskuryakov.
11908 https://bugs.webkit.org/show_bug.cgi?id=23560
11909 Implement SharedTimer on WorkerRunLoop
11911 * JavaScriptCore.exp:
11912 Forgot to expose ThreadCondition::timedWait() in one of previous patches.
11914 2009-02-02 Oliver Hunt <oliver@apple.com>
11916 Reviewed by Gavin Barraclough.
11918 <https://bugs.webkit.org/show_bug.cgi?id=21414> REGRESSION: Regular Expressions and character classes, shorthands and ranges
11919 <rdar://problem/6543487>
11921 In certain circumstances when WREC::Generator::generateCharacterClassInvertedRange invokes
11922 itself recursively, it will incorrectly emit (and thus consume) the next single character
11923 match in the current character class. As WREC uses a binary search this out of sequence
11924 codegen could result in a character match being missed and so cause the regex to produce
11927 * wrec/WRECGenerator.cpp:
11928 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
11930 2009-02-02 Darin Adler <darin@apple.com>
11932 Reviewed by Dave Hyatt.
11934 Bug 23676: Speed up uses of reserveCapacity on new vectors by adding a new reserveInitialCapacity
11935 https://bugs.webkit.org/show_bug.cgi?id=23676
11937 * API/JSObjectRef.cpp:
11938 (JSObjectCopyPropertyNames): Use reserveInitialCapacity.
11939 * parser/Lexer.cpp:
11940 (JSC::Lexer::Lexer): Ditto.
11941 (JSC::Lexer::clear): Ditto.
11943 * wtf/Vector.h: Added reserveInitialCapacity, a more efficient version of
11944 reserveCapacity for use when the vector is brand new (still size 0 with no
11945 capacity other than the inline capacity).
11947 2009-01-30 Mark Rowe <mrowe@apple.com>
11949 Rubber-stamped by Oliver Hunt.
11951 <rdar://problem/6391501> Enable the JIT on Mac OS X x86_64 as it passes all tests.
11955 2009-01-30 Oliver Hunt <oliver@apple.com>
11957 Reviewed by Mark Rowe and Sam Weinig.
11959 Finally fix load() to propagate exceptions correctly.
11964 2009-01-30 David Levin <levin@chromium.org>
11966 Reviewed by Darin Adler.
11968 https://bugs.webkit.org/show_bug.cgi?id=23618
11969 Templated worker tasks should be more error proof to use.
11970 Fix Chromium build.
11972 * wtf/TypeTraits.h:
11973 (WTF::IsConvertibleToInteger::IsConvertibleToDouble):
11974 Avoid "possible loss of data" warning when using Microsoft's C++ compiler
11975 by avoiding an implicit conversion of int types to doubles.
11977 2009-01-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
11979 Reviewed by Simon Hausmann.
11981 Bug 23580: GNU mode RVCT compilation support
11982 <https://bugs.webkit.org/show_bug.cgi?id=23580>
11984 * pcre/pcre_exec.cpp: Use COMPILER(GCC) instead of __GNUC__.
11985 * wtf/FastMalloc.cpp: Ditto.
11986 (WTF::TCMallocStats::):
11987 * wtf/Platform.h: Don't define COMPILER(GCC) with RVCT --gnu.
11989 2009-01-30 David Levin <levin@chromium.org>
11991 Reviewed by Alexey Proskuryakov.
11993 Bug 23618: Templated worker tasks should be more error proof to use
11994 <https://bugs.webkit.org/show_bug.cgi?id=23618>
11996 Add the type traits needed for the generic worker tasks
11997 and compile asserts for them.
11999 Add a summary header to the TypeTraits.h file to explain what is in there.
12001 Add a note to explain IsPod's deficiencies.
12003 * wtf/TypeTraits.h:
12005 2009-01-30 David Levin <levin@chromium.org>
12007 Reviewed by Alexey Proskuryakov.
12009 Bug 23616: Various "template helpers" should be consolidated from isolated files in JavaScriptCore.
12010 <https://bugs.webkit.org/show_bug.cgi?id=23616>
12012 * wtf/TypeTraits.h: Moved RemovePointer, IsPod, IsInteger to this file.
12014 * wtf/OwnPtr.h: Use RemovePointer from TypeTraits.h.
12015 * wtf/RetainPtr.h: Ditto.
12017 * wtf/HashTraits.h: Use IsInteger from TypeTraits.h.
12019 * wtf/VectorTraits.h: Use IsPod from TypeTraits.h.
12022 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
12023 * JavaScriptCore.xcodeproj/project.pbxproj:
12024 Added TypeTraits.h.
12026 2009-01-29 Stephanie Lewis <slewis@apple.com>
12030 Update the order files.
12032 * JavaScriptCore.order:
12034 2009-01-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
12036 Reviewed by Oliver Hunt.
12038 Bug 23551: Crash on page load with profiler enabled and running
12039 <https://bugs.webkit.org/show_bug.cgi?id=23551>
12040 <rdar://problem/6529521>
12042 Interpreter::execute(FunctionBodyNode*, ...) calls Profiler::didExecute()
12043 with a stale CallFrame. If some part of the scope chain has already been
12044 freed, Profiler::didExecute() will crash when attempting to get the lexical
12045 global object. The fix is to make the didExecute() call use the caller's
12046 CallFrame, not the one made for the function call. In this case, the
12047 willExecute() call should also be changed to match.
12049 Since this occurs in the actual inspector JS, it is difficult to reduce.
12050 I couldn't make a layout test.
12052 * interpreter/Interpreter.cpp:
12053 (JSC::Interpreter::execute):
12055 2009-01-28 Sam Weinig <sam@webkit.org>
12057 Reviewed by Gavin Barraclough.
12059 Fix for <rdar://problem/6525537>
12060 Hang occurs when closing Installer window (iTunes, Aperture)
12062 * JavaScriptCore.exp: Export JSGlobalData::sharedInstance.
12064 2009-01-28 Sam Weinig <sam@webkit.org>
12066 Reviewed by Geoff Garen.
12068 Initial patch by Mark Rowe.
12070 <rdar://problem/6519356>
12071 REGRESSION (r36006): "out of memory" alert running dromaeo on Windows
12073 Report the cost of the ArrayStorage vector more accurately/often.
12075 * runtime/JSArray.cpp:
12076 (JSC::JSArray::JSArray): Report the extra cost even for a filled array
12077 because JSString using the single character optimization and immediates
12078 wont increase the cost themselves.
12079 (JSC::JSArray::putSlowCase): Update the cost when increasing the size of
12081 (JSC::JSArray::increaseVectorLength): Ditto.
12083 2009-01-28 Sam Weinig <sam@webkit.org>
12085 Reviewed by Geoff Garen.
12087 Fix for <rdar://problem/6129678>
12088 REGRESSION (Safari 3-4): Local variable not accessible from Dashcode console or variables view
12090 Iterating the properties of activation objects accessed through the WebKit debugging
12091 APIs was broken by forced conversion of JSActivation to the global object. To fix this,
12092 we use a proxy activation object that acts more like a normal JSObject.
12094 * debugger/DebuggerActivation.cpp: Added.
12095 (JSC::DebuggerActivation::DebuggerActivation):
12096 (JSC::DebuggerActivation::mark):
12097 (JSC::DebuggerActivation::className):
12098 (JSC::DebuggerActivation::getOwnPropertySlot):
12099 (JSC::DebuggerActivation::put):
12100 (JSC::DebuggerActivation::putWithAttributes):
12101 (JSC::DebuggerActivation::deleteProperty):
12102 (JSC::DebuggerActivation::getPropertyNames):
12103 (JSC::DebuggerActivation::getPropertyAttributes):
12104 (JSC::DebuggerActivation::defineGetter):
12105 (JSC::DebuggerActivation::defineSetter):
12106 (JSC::DebuggerActivation::lookupGetter):
12107 (JSC::DebuggerActivation::lookupSetter):
12108 * debugger/DebuggerActivation.h: Added.
12109 Proxy JSActivation object for Debugging.
12111 * runtime/JSActivation.h:
12112 (JSC::JSActivation::isActivationObject): Added.
12113 * runtime/JSObject.h:
12114 (JSC::JSObject::isActivationObject): Added.
12116 2009-01-28 David Kilzer <ddkilzer@apple.com>
12118 Bug 23490: Remove initialRefCount argument from RefCounted class
12120 <https://bugs.webkit.org/show_bug.cgi?id=23490>
12122 Reviewed by Darin Adler.
12124 RefCountedBase now always starts with a ref count of 1, so there
12125 is no need to pass the initialRefCount into the class anymore.
12128 (WTF::ByteArray::ByteArray): Removed call to RefCounted(1).
12129 * wtf/RefCounted.h:
12130 (WTF::RefCountedBase::RefCountedBase): Changed to start with a
12132 (WTF::RefCounted::RefCounted): Removed initialRefCount argument
12133 and removed call to RefCounted(1).
12135 2009-01-26 Adele Peterson <adele@apple.com>
12139 * debugger/Debugger.cpp:
12141 2009-01-26 Gavin Barraclough <barraclough@apple.com>
12143 Reviewed by Darin Adler.
12145 Fixes for eq null & neq null, on 64-bit JIT.
12146 https://bugs.webkit.org/show_bug.cgi?id=23559
12148 This patch degrades 64-bit JIT performance on some benchmarks,
12149 due to the whole not-being-incorrect thing.
12152 (JSC::JIT::privateCompileMainPass):
12154 2009-01-26 Cameron Zwarich <cwzwarich@uwaterloo.ca>
12156 Reviewed by Gavin Barraclough.
12158 Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames
12159 <https://bugs.webkit.org/show_bug.cgi?id=23552>
12160 <rdar://problem/6398839>
12162 * JavaScriptCore.exp:
12163 * debugger/Debugger.cpp:
12164 (JSC::evaluateInGlobalCallFrame): Added so that WebScriptCallFrame can
12165 evaluate JS starting from a global call frame.
12166 * debugger/Debugger.h:
12168 2009-01-25 Mark Rowe <mrowe@apple.com>
12170 Rubber-stamped by Dan Bernstein.
12172 Improve the consistency of settings in our .xcconfig files.
12174 * Configurations/Base.xcconfig: Enable GCC_OBJC_CALL_CXX_CDTORS to match other projects.
12176 2009-01-25 Darin Adler <darin@apple.com>
12178 Reviewed by Mark Rowe.
12180 Bug 23352: Turn on more compiler warnings in the Mac build
12181 https://bugs.webkit.org/show_bug.cgi?id=23352
12183 Turn on the following warnings:
12193 * Configurations/Base.xcconfig: Added the new warnings. Switched to -Wextra instead of
12194 -W for clarity since we don't have to support the older versions of gcc that require the
12195 old -W syntax. Since we now use -Wformat=2, removed -Wformat-security. Also removed
12196 -Wno-format-y2k since we can have that one on now.
12198 2009-01-25 Judit Jasz <jasy@inf.u-szeged.hu>
12200 Reviewed by Darin Adler.
12202 Compilation problem fixing
12203 http://bugs.webkit.org/show_bug.cgi?id=23497
12206 (JSC::JIT::compileOpCall): Use JSValuePtr::encode.
12208 2009-01-25 Darin Adler <darin@apple.com>
12210 Reviewed by Sam Weinig.
12212 Bug 23352: Turn on more compiler warnings in the Mac build
12213 https://bugs.webkit.org/show_bug.cgi?id=23352
12215 Fourth patch: Deal with the last few stray warnings.
12217 * parser/Parser.cpp: Only declare jscyyparse if it's not already declared.
12218 This makes both separate compilation and all-in-one compilation work with the
12219 -Wredundant-decls warning.
12221 2009-01-25 Darin Adler <darin@apple.com>
12223 Reviewed by Sam Weinig.
12225 Bug 23352: Turn on more compiler warnings in the Mac build
12226 https://bugs.webkit.org/show_bug.cgi?id=23352
12228 Third patch: Use the noreturn attribute on functions that don't
12229 return to prepare for the use of the -Wmissing-noreturn warning.
12232 (JSC::unreachable): Added NO_RETURN.
12234 (functionQuit): Ditto.
12235 (printUsageStatement): Ditto.
12236 * wtf/AlwaysInline.h: Added definition of NO_RETURN.
12238 2009-01-24 Oliver Hunt <oliver@apple.com>
12240 Reviewed by Maciej Stachowiak.
12242 Force inlining of Lexer::matchPunctuator
12244 2.2% win when parsing jQuery, Mootools, Prototype, etc
12248 2009-01-23 Gavin Barraclough <barraclough@apple.com>
12250 Reviewed by Geoff Garen.
12252 Fix for <rdar://problem/6126212>
12253 Ensure that callbacks out from the JSC interface are only allowed
12254 to return in reverse-chronological order to that in which they were
12255 made. If we allow earlier callbacks to return first, then this may
12256 result in setions of the RegisterFile in use by another thread
12259 See uber-comment in JSLock.h for details.
12261 * runtime/JSLock.cpp:
12262 (JSC::JSLock::DropAllLocks::DropAllLocks):
12263 (JSC::JSLock::DropAllLocks::~DropAllLocks):
12265 2009-01-23 Darin Adler <darin@apple.com>
12267 Try to fix WX build.
12269 * runtime/JSGlobalObjectFunctions.h: Include <wtf/unicode/Unicode.h>
12270 for the definition of UChar.
12272 2009-01-23 Anders Carlsson <andersca@apple.com>
12274 * Configurations/Base.xcconfig:
12277 * runtime/JSNumberCell.h:
12280 2009-01-23 Anders Carlsson <andersca@apple.com>
12282 Reviewed by Sam Weinig.
12284 Turn on -Wmissing-prototypes and fix the warnings.
12286 * API/JSClassRef.cpp:
12287 (clearReferenceToPrototype):
12288 * Configurations/Base.xcconfig:
12289 * runtime/Collector.cpp:
12290 (JSC::getPlatformThreadRegisters):
12291 * runtime/ExceptionHelpers.cpp:
12292 (JSC::createError):
12293 * runtime/JSGlobalObjectFunctions.h:
12294 * runtime/JSNumberCell.h:
12295 * runtime/UString.cpp:
12296 (JSC::initializeStaticBaseString):
12298 * wtf/FastMalloc.cpp:
12299 * wtf/Threading.cpp:
12301 2009-01-22 Mark Rowe <mrowe@apple.com>
12303 Rubber-stamped by Anders Carlsson.
12305 Disable GCC_WARN_ABOUT_MISSING_PROTOTYPES temporarily.
12307 Current versions of Xcode only respect it for C and Objective-C files,
12308 and our code doesn't currently compile if it is applied to C++ and
12309 Objective-C++ files.
12311 * Configurations/Base.xcconfig:
12313 2009-01-22 Steve Falkenburg <sfalken@apple.com>
12315 https://bugs.webkit.org/show_bug.cgi?id=23489
12317 Return currentTime() in correct units for the two early return cases.
12319 Reviewed by Mark Rowe.
12321 * wtf/CurrentTime.cpp:
12322 (WTF::currentTime):
12324 2009-01-22 Sam Weinig <sam@webkit.org>
12326 Reviewed by Mark Rowe.
12328 Fix for <rdar://problem/6439247>
12329 FastMalloc allocating an extra 4MB of meta-data on 64-bit
12331 Rely on the fact that on all known x86-64 platforms only use 48 bits of
12332 address space to shrink the initial size of the PageMap from ~4MB to 120K.
12333 For 64-bit we still use a 3-level radix tree, but now each level is only 12
12336 No performance change.
12338 * wtf/FastMalloc.cpp:
12339 (WTF::MapSelector): Add specialization for 64 bit that takes into account the
12340 16 bits of unused address space on x86-64.
12342 2009-01-22 Beth Dakin <bdakin@apple.com>
12344 Reviewed by Sam Weinig.
12346 Fix for https://bugs.webkit.org/show_bug.cgi?id=23461 LayoutTests/
12347 fast/js/numeric-conversion.html is broken, and corresponding
12348 <rdar://problem/6514842>
12350 The basic problem here is that parseInt(Infinity) should be NaN,
12351 but we were returning 0. NaN matches Safari 3.2.1 and Firefox.
12353 * runtime/JSGlobalObjectFunctions.cpp:
12354 (JSC::globalFuncParseInt):
12356 2009-01-22 Oliver Hunt <oliver@apple.com>
12358 Reviewed by Geoff Garen.
12360 <rdar://problem/6516853> (r39682-r39736) JSFunFuzz: crash on "(function(){({ x2: x }), })()"
12361 <https://bugs.webkit.org/show_bug.cgi?id=23479>
12363 Automatic semicolon insertion was resulting in this being accepted in the initial
12364 nodeless parsing, but subsequent reparsing for code generation would fail, leading
12365 to a crash. The solution is to ensure that reparsing a function performs parsing
12366 in the same state as the initial parse. We do this by modifying the saved source
12367 ranges to include rather than exclude the opening and closing braces.
12369 * bytecode/CodeBlock.cpp:
12370 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): add an assertion for successful recompile
12372 (JSC::Lexer::sourceCode): include rather than exclude braces.
12374 (JSC::FunctionBodyNode::toSourceString): No need to append braces anymore.
12376 2009-01-22 Dmitry Titov <dimich@chromium.org>
12378 Reviewed by Alexey Proskuryakov.
12380 https://bugs.webkit.org/show_bug.cgi?id=23373
12382 Implement ThreadCondition::timedWait().
12383 Since we borrow the code for condition variables from other sources,
12384 I did the same for timedWait(). See comments in ThreadingWin.cpp for
12385 rationale and more info.
12387 * wtf/CONTRIBUTORS.pthreads-win32:
12388 Added. A list of Pthreads-win32 contributors mentioned in their license. The license itself
12389 is included into wtf/ThreadingWin32.cpp.
12392 * wtf/ThreadingWin.cpp:
12393 Additional info and Pthreads-win32 license at the beginning.
12394 (WTF::PlatformCondition::timedWait): new method, derived from Pthreads-win32.
12395 (WTF::PlatformCondition::signal): same
12396 (WTF::ThreadCondition::ThreadCondition):
12397 (WTF::ThreadCondition::~ThreadCondition):
12398 (WTF::ThreadCondition::wait): this now calls PlatformCondition::timedWait.
12399 (WTF::ThreadCondition::timedWait): same
12400 (WTF::ThreadCondition::signal): this now calls PlatformCondition::signal.
12401 (WTF::ThreadCondition::broadcast): same
12403 2009-01-21 Gavin Barraclough <barraclough@apple.com>
12405 Reviewed by Oliver Hunt.
12407 Fix for https://bugs.webkit.org/show_bug.cgi?id=23469.
12409 We need to check all numbers in integer switches, not just those
12410 represented as integer JSImmediates.
12412 * interpreter/Interpreter.cpp:
12413 (JSC::Interpreter::privateExecute):
12414 (JSC::Interpreter::cti_op_switch_imm):
12416 2009-01-21 Gavin Barraclough <barraclough@apple.com>
12418 Reviewed by Geoff Garen.
12420 Fix for https://bugs.webkit.org/show_bug.cgi?id=23468.
12422 * interpreter/Interpreter.cpp:
12423 (JSC::Interpreter::privateExecute):
12425 2009-01-21 Alexey Proskuryakov <ap@webkit.org>
12427 Suggested by Oliver Hunt. Reviewed by Oliver Hunt.
12429 https://bugs.webkit.org/show_bug.cgi?id=23456
12430 Function argument names leak
12432 * parser/Nodes.cpp: (JSC::FunctionBodyNode::~FunctionBodyNode): Destruct parameter names.
12434 2009-01-20 Oliver Hunt <oliver@apple.com>
12436 Reviewed by NOBODY (Build fix).
12440 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
12442 2009-01-20 Gavin Barraclough <barraclough@apple.com>
12444 Reviewed by Mark Rowe.
12446 Structure property table deleted offset maps are being leaked.
12447 Probably shouldn't be doing that.
12449 https://bugs.webkit.org/show_bug.cgi?id=23442
12451 * runtime/Structure.cpp:
12452 (JSC::Structure::~Structure):
12454 2009-01-20 Oliver Hunt <oliver@apple.com>
12456 Reviewed by NOBODY (build fix).
12458 Attempt to fix gtk build
12462 2009-01-20 Darin Adler <darin@apple.com>
12464 * runtime/StringPrototype.cpp:
12465 (JSC::substituteBackreferences): Add back the initialization to fix the build.
12467 2009-01-20 Darin Adler <darin@apple.com>
12469 Reviewed by Mark Rowe.
12471 Bug 23352: Turn on more compiler warnings in the Mac build
12472 https://bugs.webkit.org/show_bug.cgi?id=23352
12474 First patch: Fix some simple cases of various warnings.
12476 * pcre/pcre_compile.cpp:
12477 (jsRegExpCompile): Use const_cast to change const-ness.
12479 * runtime/StringPrototype.cpp:
12480 (JSC::substituteBackreferences): Remove unneeded initialization and
12481 use UChar instead of unsigned short for UTF-16 values.
12484 (WTF::strtod): Use const_cast to change const-ness.
12486 2009-01-20 Oliver Hunt <oliver@apple.com>
12488 Reviewed by NOBODY (build fix).
12490 Whoops, remove runtime/ByteArray references from .pri and .scons builds, update .bkl
12492 * JavaScriptCore.pri:
12493 * JavaScriptCore.scons:
12494 * JavaScriptCoreSources.bkl:
12496 2009-01-20 Oliver Hunt <oliver@apple.com>
12500 Move runtime/ByteArray to wtf/ByteArray
12503 * JavaScriptCore.exp:
12504 * JavaScriptCore.pri:
12505 * JavaScriptCore.scons:
12506 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
12507 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
12508 * JavaScriptCore.xcodeproj/project.pbxproj:
12509 * runtime/JSByteArray.cpp:
12510 * runtime/JSByteArray.h:
12511 * wtf/ByteArray.cpp: Renamed from JavaScriptCore/runtime/ByteArray.cpp.
12512 (WTF::ByteArray::create):
12513 * wtf/ByteArray.h: Renamed from JavaScriptCore/runtime/ByteArray.h.
12514 (WTF::ByteArray::length):
12515 (WTF::ByteArray::set):
12516 (WTF::ByteArray::get):
12517 (WTF::ByteArray::data):
12518 (WTF::ByteArray::deref):
12519 (WTF::ByteArray::ByteArray):
12521 2009-01-19 Sam Weinig <sam@webkit.org>
12523 Rubber-stamped by Gavin Barraclough.
12525 Remove temporary operator-> from JSValuePtr.
12527 * API/JSCallbackFunction.cpp:
12528 (JSC::JSCallbackFunction::call):
12529 * API/JSCallbackObjectFunctions.h:
12533 * API/JSObjectRef.cpp:
12534 (JSObjectSetPrototype):
12535 * API/JSValueRef.cpp:
12537 (JSValueIsUndefined):
12539 (JSValueIsBoolean):
12543 (JSValueIsObjectOfClass):
12544 (JSValueToBoolean):
12546 (JSValueToStringCopy):
12548 * bytecode/CodeBlock.cpp:
12549 (JSC::valueToSourceString):
12550 (JSC::CodeBlock::mark):
12551 * bytecode/CodeBlock.h:
12552 (JSC::CodeBlock::isKnownNotImmediate):
12553 * bytecompiler/BytecodeGenerator.cpp:
12554 (JSC::BytecodeGenerator::emitEqualityOp):
12555 (JSC::keyForImmediateSwitch):
12556 * interpreter/Interpreter.cpp:
12559 (JSC::jsAddSlowCase):
12561 (JSC::jsTypeStringForValue):
12562 (JSC::jsIsObjectType):
12563 (JSC::jsIsFunctionType):
12564 (JSC::isNotObject):
12565 (JSC::Interpreter::callEval):
12566 (JSC::Interpreter::throwException):
12567 (JSC::cachePrototypeChain):
12568 (JSC::Interpreter::tryCachePutByID):
12569 (JSC::countPrototypeChainEntriesAndCheckForProxies):
12570 (JSC::Interpreter::tryCacheGetByID):
12571 (JSC::Interpreter::privateExecute):
12572 (JSC::Interpreter::tryCTICachePutByID):
12573 (JSC::Interpreter::tryCTICacheGetByID):
12574 (JSC::Interpreter::cti_op_convert_this):
12575 (JSC::Interpreter::cti_op_add):
12576 (JSC::Interpreter::cti_op_pre_inc):
12577 (JSC::Interpreter::cti_op_put_by_id_generic):
12578 (JSC::Interpreter::cti_op_get_by_id_generic):
12579 (JSC::Interpreter::cti_op_put_by_id):
12580 (JSC::Interpreter::cti_op_put_by_id_second):
12581 (JSC::Interpreter::cti_op_put_by_id_fail):
12582 (JSC::Interpreter::cti_op_get_by_id):
12583 (JSC::Interpreter::cti_op_get_by_id_second):
12584 (JSC::Interpreter::cti_op_get_by_id_self_fail):
12585 (JSC::Interpreter::cti_op_get_by_id_proto_list):
12586 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
12587 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
12588 (JSC::Interpreter::cti_op_get_by_id_array_fail):
12589 (JSC::Interpreter::cti_op_get_by_id_string_fail):
12590 (JSC::Interpreter::cti_op_instanceof):
12591 (JSC::Interpreter::cti_op_del_by_id):
12592 (JSC::Interpreter::cti_op_mul):
12593 (JSC::Interpreter::cti_op_call_JSFunction):
12594 (JSC::Interpreter::cti_op_call_NotJSFunction):
12595 (JSC::Interpreter::cti_op_construct_JSConstruct):
12596 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
12597 (JSC::Interpreter::cti_op_get_by_val):
12598 (JSC::Interpreter::cti_op_get_by_val_byte_array):
12599 (JSC::Interpreter::cti_op_sub):
12600 (JSC::Interpreter::cti_op_put_by_val):
12601 (JSC::Interpreter::cti_op_put_by_val_array):
12602 (JSC::Interpreter::cti_op_put_by_val_byte_array):
12603 (JSC::Interpreter::cti_op_loop_if_true):
12604 (JSC::Interpreter::cti_op_negate):
12605 (JSC::Interpreter::cti_op_div):
12606 (JSC::Interpreter::cti_op_pre_dec):
12607 (JSC::Interpreter::cti_op_not):
12608 (JSC::Interpreter::cti_op_jtrue):
12609 (JSC::Interpreter::cti_op_post_inc):
12610 (JSC::Interpreter::cti_op_lshift):
12611 (JSC::Interpreter::cti_op_bitand):
12612 (JSC::Interpreter::cti_op_rshift):
12613 (JSC::Interpreter::cti_op_bitnot):
12614 (JSC::Interpreter::cti_op_mod):
12615 (JSC::Interpreter::cti_op_post_dec):
12616 (JSC::Interpreter::cti_op_urshift):
12617 (JSC::Interpreter::cti_op_bitxor):
12618 (JSC::Interpreter::cti_op_bitor):
12619 (JSC::Interpreter::cti_op_push_scope):
12620 (JSC::Interpreter::cti_op_is_undefined):
12621 (JSC::Interpreter::cti_op_is_boolean):
12622 (JSC::Interpreter::cti_op_is_number):
12623 (JSC::Interpreter::cti_op_to_jsnumber):
12624 (JSC::Interpreter::cti_op_in):
12625 (JSC::Interpreter::cti_op_put_by_index):
12626 (JSC::Interpreter::cti_op_switch_imm):
12627 (JSC::Interpreter::cti_op_switch_char):
12628 (JSC::Interpreter::cti_op_switch_string):
12629 (JSC::Interpreter::cti_op_del_by_val):
12630 (JSC::Interpreter::cti_op_put_getter):
12631 (JSC::Interpreter::cti_op_put_setter):
12632 (JSC::Interpreter::cti_op_new_error):
12633 * interpreter/Interpreter.h:
12634 (JSC::Interpreter::isJSArray):
12635 (JSC::Interpreter::isJSString):
12636 (JSC::Interpreter::isJSByteArray):
12637 * interpreter/Register.h:
12638 (JSC::Register::marked):
12639 (JSC::Register::mark):
12640 * jit/JITInlineMethods.h:
12641 (JSC::JIT::getConstantOperandImmediateInt):
12642 (JSC::JIT::isOperandConstantImmediateInt):
12650 * parser/Nodes.cpp:
12651 (JSC::processClauseList):
12652 * profiler/ProfileGenerator.cpp:
12653 (JSC::ProfileGenerator::addParentForConsoleStart):
12654 * profiler/Profiler.cpp:
12655 (JSC::Profiler::createCallIdentifier):
12656 * runtime/ArrayConstructor.cpp:
12657 (JSC::constructArrayWithSizeQuirk):
12658 * runtime/ArrayPrototype.cpp:
12659 (JSC::arrayProtoFuncToString):
12660 (JSC::arrayProtoFuncToLocaleString):
12661 (JSC::arrayProtoFuncJoin):
12662 (JSC::arrayProtoFuncConcat):
12663 (JSC::arrayProtoFuncPop):
12664 (JSC::arrayProtoFuncPush):
12665 (JSC::arrayProtoFuncReverse):
12666 (JSC::arrayProtoFuncShift):
12667 (JSC::arrayProtoFuncSlice):
12668 (JSC::arrayProtoFuncSort):
12669 (JSC::arrayProtoFuncSplice):
12670 (JSC::arrayProtoFuncUnShift):
12671 (JSC::arrayProtoFuncFilter):
12672 (JSC::arrayProtoFuncMap):
12673 (JSC::arrayProtoFuncEvery):
12674 (JSC::arrayProtoFuncForEach):
12675 (JSC::arrayProtoFuncSome):
12676 (JSC::arrayProtoFuncIndexOf):
12677 (JSC::arrayProtoFuncLastIndexOf):
12678 * runtime/BooleanConstructor.cpp:
12679 (JSC::constructBoolean):
12680 (JSC::callBooleanConstructor):
12681 * runtime/BooleanPrototype.cpp:
12682 (JSC::booleanProtoFuncToString):
12683 (JSC::booleanProtoFuncValueOf):
12684 * runtime/Collector.cpp:
12685 (JSC::Heap::protect):
12686 (JSC::Heap::unprotect):
12688 (JSC::Heap::collect):
12690 * runtime/Completion.cpp:
12692 * runtime/DateConstructor.cpp:
12693 (JSC::constructDate):
12696 * runtime/DateInstance.h:
12697 (JSC::DateInstance::internalNumber):
12698 * runtime/DatePrototype.cpp:
12699 (JSC::formatLocaleDate):
12700 (JSC::fillStructuresUsingTimeArgs):
12701 (JSC::fillStructuresUsingDateArgs):
12702 (JSC::dateProtoFuncToString):
12703 (JSC::dateProtoFuncToUTCString):
12704 (JSC::dateProtoFuncToDateString):
12705 (JSC::dateProtoFuncToTimeString):
12706 (JSC::dateProtoFuncToLocaleString):
12707 (JSC::dateProtoFuncToLocaleDateString):
12708 (JSC::dateProtoFuncToLocaleTimeString):
12709 (JSC::dateProtoFuncGetTime):
12710 (JSC::dateProtoFuncGetFullYear):
12711 (JSC::dateProtoFuncGetUTCFullYear):
12712 (JSC::dateProtoFuncToGMTString):
12713 (JSC::dateProtoFuncGetMonth):
12714 (JSC::dateProtoFuncGetUTCMonth):
12715 (JSC::dateProtoFuncGetDate):
12716 (JSC::dateProtoFuncGetUTCDate):
12717 (JSC::dateProtoFuncGetDay):
12718 (JSC::dateProtoFuncGetUTCDay):
12719 (JSC::dateProtoFuncGetHours):
12720 (JSC::dateProtoFuncGetUTCHours):
12721 (JSC::dateProtoFuncGetMinutes):
12722 (JSC::dateProtoFuncGetUTCMinutes):
12723 (JSC::dateProtoFuncGetSeconds):
12724 (JSC::dateProtoFuncGetUTCSeconds):
12725 (JSC::dateProtoFuncGetMilliSeconds):
12726 (JSC::dateProtoFuncGetUTCMilliseconds):
12727 (JSC::dateProtoFuncGetTimezoneOffset):
12728 (JSC::dateProtoFuncSetTime):
12729 (JSC::setNewValueFromTimeArgs):
12730 (JSC::setNewValueFromDateArgs):
12731 (JSC::dateProtoFuncSetYear):
12732 (JSC::dateProtoFuncGetYear):
12733 * runtime/ErrorConstructor.cpp:
12734 (JSC::constructError):
12735 * runtime/ErrorPrototype.cpp:
12736 (JSC::errorProtoFuncToString):
12737 * runtime/ExceptionHelpers.cpp:
12738 (JSC::createError):
12739 (JSC::createErrorMessage):
12740 * runtime/FunctionConstructor.cpp:
12741 (JSC::constructFunction):
12742 * runtime/FunctionPrototype.cpp:
12743 (JSC::functionProtoFuncToString):
12744 (JSC::functionProtoFuncApply):
12745 (JSC::functionProtoFuncCall):
12746 * runtime/GetterSetter.cpp:
12747 (JSC::GetterSetter::toObject):
12748 * runtime/JSActivation.cpp:
12749 (JSC::JSActivation::getOwnPropertySlot):
12750 * runtime/JSArray.cpp:
12751 (JSC::JSArray::put):
12752 (JSC::JSArray::mark):
12753 (JSC::JSArray::sort):
12754 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
12755 (JSC::JSArray::compactForSorting):
12756 * runtime/JSByteArray.h:
12757 (JSC::JSByteArray::setIndex):
12758 * runtime/JSCell.h:
12760 * runtime/JSFunction.cpp:
12761 (JSC::JSFunction::call):
12762 (JSC::JSFunction::construct):
12763 * runtime/JSGlobalObject.cpp:
12764 (JSC::markIfNeeded):
12765 (JSC::lastInPrototypeChain):
12766 * runtime/JSGlobalObjectFunctions.cpp:
12769 (JSC::globalFuncEval):
12770 (JSC::globalFuncParseInt):
12771 (JSC::globalFuncParseFloat):
12772 (JSC::globalFuncIsNaN):
12773 (JSC::globalFuncIsFinite):
12774 (JSC::globalFuncEscape):
12775 (JSC::globalFuncUnescape):
12776 (JSC::globalFuncJSCPrint):
12777 * runtime/JSImmediate.cpp:
12778 (JSC::JSImmediate::toThisObject):
12779 (JSC::JSImmediate::toObject):
12780 (JSC::JSImmediate::prototype):
12781 (JSC::JSImmediate::toString):
12782 * runtime/JSImmediate.h:
12783 * runtime/JSObject.cpp:
12784 (JSC::JSObject::mark):
12785 (JSC::JSObject::put):
12786 (JSC::callDefaultValueFunction):
12787 (JSC::JSObject::getPrimitiveNumber):
12788 (JSC::JSObject::defineGetter):
12789 (JSC::JSObject::defineSetter):
12790 (JSC::JSObject::lookupGetter):
12791 (JSC::JSObject::lookupSetter):
12792 (JSC::JSObject::hasInstance):
12793 (JSC::JSObject::toNumber):
12794 (JSC::JSObject::toString):
12795 * runtime/JSObject.h:
12796 (JSC::JSObject::JSObject):
12797 (JSC::JSObject::inlineGetOwnPropertySlot):
12798 (JSC::JSObject::getOwnPropertySlotForWrite):
12799 (JSC::JSObject::getPropertySlot):
12800 (JSC::JSValuePtr::get):
12801 * runtime/JSPropertyNameIterator.h:
12802 (JSC::JSPropertyNameIterator::create):
12803 * runtime/JSString.cpp:
12804 (JSC::JSString::getOwnPropertySlot):
12805 * runtime/JSValue.h:
12806 * runtime/JSWrapperObject.cpp:
12807 (JSC::JSWrapperObject::mark):
12808 * runtime/JSWrapperObject.h:
12809 (JSC::JSWrapperObject::setInternalValue):
12810 * runtime/MathObject.cpp:
12811 (JSC::mathProtoFuncAbs):
12812 (JSC::mathProtoFuncACos):
12813 (JSC::mathProtoFuncASin):
12814 (JSC::mathProtoFuncATan):
12815 (JSC::mathProtoFuncATan2):
12816 (JSC::mathProtoFuncCeil):
12817 (JSC::mathProtoFuncCos):
12818 (JSC::mathProtoFuncExp):
12819 (JSC::mathProtoFuncFloor):
12820 (JSC::mathProtoFuncLog):
12821 (JSC::mathProtoFuncMax):
12822 (JSC::mathProtoFuncMin):
12823 (JSC::mathProtoFuncPow):
12824 (JSC::mathProtoFuncRound):
12825 (JSC::mathProtoFuncSin):
12826 (JSC::mathProtoFuncSqrt):
12827 (JSC::mathProtoFuncTan):
12828 * runtime/NativeErrorConstructor.cpp:
12829 (JSC::NativeErrorConstructor::NativeErrorConstructor):
12830 (JSC::NativeErrorConstructor::construct):
12831 * runtime/NumberConstructor.cpp:
12832 (JSC::constructWithNumberConstructor):
12833 (JSC::callNumberConstructor):
12834 * runtime/NumberPrototype.cpp:
12835 (JSC::numberProtoFuncToString):
12836 (JSC::numberProtoFuncToLocaleString):
12837 (JSC::numberProtoFuncValueOf):
12838 (JSC::numberProtoFuncToFixed):
12839 (JSC::numberProtoFuncToExponential):
12840 (JSC::numberProtoFuncToPrecision):
12841 * runtime/ObjectConstructor.cpp:
12842 (JSC::constructObject):
12843 * runtime/ObjectPrototype.cpp:
12844 (JSC::objectProtoFuncValueOf):
12845 (JSC::objectProtoFuncHasOwnProperty):
12846 (JSC::objectProtoFuncIsPrototypeOf):
12847 (JSC::objectProtoFuncDefineGetter):
12848 (JSC::objectProtoFuncDefineSetter):
12849 (JSC::objectProtoFuncLookupGetter):
12850 (JSC::objectProtoFuncLookupSetter):
12851 (JSC::objectProtoFuncPropertyIsEnumerable):
12852 (JSC::objectProtoFuncToLocaleString):
12853 (JSC::objectProtoFuncToString):
12854 * runtime/Operations.h:
12855 (JSC::JSValuePtr::equalSlowCaseInline):
12856 (JSC::JSValuePtr::strictEqual):
12857 (JSC::JSValuePtr::strictEqualSlowCaseInline):
12858 * runtime/Protect.h:
12860 (JSC::gcUnprotect):
12861 * runtime/RegExpConstructor.cpp:
12862 (JSC::setRegExpConstructorInput):
12863 (JSC::setRegExpConstructorMultiline):
12864 (JSC::constructRegExp):
12865 * runtime/RegExpObject.cpp:
12866 (JSC::setRegExpObjectLastIndex):
12867 (JSC::RegExpObject::match):
12868 * runtime/RegExpPrototype.cpp:
12869 (JSC::regExpProtoFuncTest):
12870 (JSC::regExpProtoFuncExec):
12871 (JSC::regExpProtoFuncCompile):
12872 (JSC::regExpProtoFuncToString):
12873 * runtime/StringConstructor.cpp:
12874 (JSC::stringFromCharCodeSlowCase):
12875 (JSC::stringFromCharCode):
12876 (JSC::constructWithStringConstructor):
12877 (JSC::callStringConstructor):
12878 * runtime/StringPrototype.cpp:
12879 (JSC::stringProtoFuncReplace):
12880 (JSC::stringProtoFuncToString):
12881 (JSC::stringProtoFuncCharAt):
12882 (JSC::stringProtoFuncCharCodeAt):
12883 (JSC::stringProtoFuncConcat):
12884 (JSC::stringProtoFuncIndexOf):
12885 (JSC::stringProtoFuncLastIndexOf):
12886 (JSC::stringProtoFuncMatch):
12887 (JSC::stringProtoFuncSearch):
12888 (JSC::stringProtoFuncSlice):
12889 (JSC::stringProtoFuncSplit):
12890 (JSC::stringProtoFuncSubstr):
12891 (JSC::stringProtoFuncSubstring):
12892 (JSC::stringProtoFuncToLowerCase):
12893 (JSC::stringProtoFuncToUpperCase):
12894 (JSC::stringProtoFuncLocaleCompare):
12895 (JSC::stringProtoFuncBig):
12896 (JSC::stringProtoFuncSmall):
12897 (JSC::stringProtoFuncBlink):
12898 (JSC::stringProtoFuncBold):
12899 (JSC::stringProtoFuncFixed):
12900 (JSC::stringProtoFuncItalics):
12901 (JSC::stringProtoFuncStrike):
12902 (JSC::stringProtoFuncSub):
12903 (JSC::stringProtoFuncSup):
12904 (JSC::stringProtoFuncFontcolor):
12905 (JSC::stringProtoFuncFontsize):
12906 (JSC::stringProtoFuncAnchor):
12907 (JSC::stringProtoFuncLink):
12908 * runtime/Structure.cpp:
12909 (JSC::Structure::Structure):
12910 (JSC::Structure::getEnumerablePropertyNames):
12911 (JSC::Structure::createCachedPrototypeChain):
12912 * runtime/Structure.h:
12913 (JSC::Structure::mark):
12914 * runtime/StructureChain.cpp:
12915 (JSC::StructureChain::StructureChain):
12917 2009-01-19 Darin Adler <darin@apple.com>
12919 Reviewed by Sam Weinig.
12921 Bug 23409: REGRESSION: RegExp 'replace()' function improperly processes '$$'
12922 <https://bugs.webkit.org/show_bug.cgi?id=23409>
12923 <rdar://problem/6505723>
12925 Test: fast/js/string-replace-3.html
12927 * runtime/StringPrototype.cpp:
12928 (JSC::substituteBackreferences): Remove code that adds an extra $ -- not sure
12929 how this ever worked.
12931 2009-01-16 Gavin Barraclough <barraclough@apple.com>
12933 Reviewed by Oliver Hunt.
12935 On x86-64 jit, cache JSImmedate::TagMask & JSImmedate::TagTypeNumber in
12936 registers, save reloading them every time they're used.
12938 Draws x86-64 jit performance close to that of i386 jit.
12940 * assembler/MacroAssembler.h:
12941 (JSC::MacroAssembler::subPtr):
12942 (JSC::MacroAssembler::jnzPtr):
12943 (JSC::MacroAssembler::jzPtr):
12945 (JSC::JIT::privateCompileMainPass):
12947 * jit/JITArithmetic.cpp:
12948 (JSC::JIT::compileBinaryArithOpSlowCase):
12949 * jit/JITInlineMethods.h:
12950 (JSC::JIT::emitJumpIfJSCell):
12951 (JSC::JIT::emitJumpIfNotJSCell):
12952 (JSC::JIT::emitJumpIfImmediateNumber):
12953 (JSC::JIT::emitJumpIfNotImmediateNumber):
12954 (JSC::JIT::emitJumpIfImmediateInteger):
12955 (JSC::JIT::emitJumpIfNotImmediateInteger):
12956 (JSC::JIT::emitFastArithIntToImmNoCheck):
12958 2009-01-16 Gavin Barraclough <barraclough@apple.com>
12960 Reviewed by Oliver Hunt.
12962 Add support to x86-64 JIT for inline double precision arithmetic ops.
12963 +5/6% on x86-64, JIT enabled, sunspider.
12965 * assembler/MacroAssembler.h:
12966 (JSC::MacroAssembler::addPtr):
12967 * assembler/X86Assembler.h:
12968 (JSC::X86Assembler::movq_rr):
12970 * jit/JITArithmetic.cpp:
12971 (JSC::JIT::compileFastArith_op_pre_inc):
12972 (JSC::JIT::compileBinaryArithOp):
12973 (JSC::JIT::compileBinaryArithOpSlowCase):
12974 (JSC::JIT::compileFastArith_op_add):
12975 (JSC::JIT::compileFastArithSlow_op_add):
12976 (JSC::JIT::compileFastArith_op_mul):
12977 (JSC::JIT::compileFastArithSlow_op_mul):
12978 (JSC::JIT::compileFastArith_op_sub):
12979 (JSC::JIT::compileFastArithSlow_op_sub):
12980 * parser/ResultType.h:
12981 (JSC::ResultType::isReusable):
12982 (JSC::ResultType::isInt32):
12983 (JSC::ResultType::definitelyIsNumber):
12984 (JSC::ResultType::mightBeNumber):
12985 (JSC::ResultType::isNotNumber):
12986 (JSC::ResultType::unknownType):
12988 2009-01-16 Gavin Barraclough <barraclough@apple.com>
12990 Reviewed by Geoff Garen.
12992 Fixes for SamplingTool.
12994 https://bugs.webkit.org/show_bug.cgi?id=23390
12996 * assembler/MacroAssembler.h:
12997 (JSC::MacroAssembler::storePtr):
12998 * bytecode/SamplingTool.cpp:
12999 (JSC::SamplingTool::run):
13000 (JSC::SamplingTool::dump):
13001 * bytecode/SamplingTool.h:
13002 (JSC::SamplingTool::encodeSample):
13004 (JSC::JIT::privateCompileMainPass):
13005 (JSC::JIT::privateCompile):
13007 (JSC::JIT::samplingToolTrackCodeBlock):
13009 (JSC::JIT::compileOpCall):
13010 (JSC::JIT::compileOpCallSlowCase):
13011 * jit/JITInlineMethods.h:
13012 (JSC::JIT::emitCTICall_internal):
13014 2009-01-16 Geoffrey Garen <ggaren@apple.com>
13016 Reviewed by Darin Adler.
13018 Fixed <rdar://problem/6452301> REGRESSION: Latest WebKit nightlies
13019 turn "c" into "" when stripping \\c_ character
13021 * wrec/WRECParser.cpp:
13022 (JSC::WREC::Parser::consumeEscape): Mimic a Firefox quirk when parsing
13023 control escapes inside character classes.
13025 2009-01-16 Adam Roben <aroben@apple.com>
13029 * wrec/WRECParser.cpp:
13030 (JSC::WREC::Parser::parseParentheses): Removed unreachable code.
13032 2009-01-15 Geoffrey Garen <ggaren@apple.com>
13034 Reviewed by Cameron Zwarich.
13036 Fixed <rdar://problem/6471394> REGRESSION (r39164): Discarding quantifier
13037 on assertion gives incorrect result (23075)
13039 https://bugs.webkit.org/show_bug.cgi?id=23075
13041 * pcre/pcre_compile.cpp:
13042 (compileBranch): Throw away an assertion if it's followed by a quantifier
13043 with a 0 minimum, to match SpiderMonkey, v8, and the ECMA spec.
13045 * wrec/WRECParser.cpp:
13046 (JSC::WREC::Parser::parseParentheses): Fall back on PCRE for the rare
13047 case of an assertion with a quantifier with a 0 minimum, since we
13048 don't handle quantified subexpressions yet, and in this special case,
13049 we can't just throw away the quantifier.
13051 2009-01-15 Gavin Barraclough <barraclough@apple.com>
13053 Reviewed by Oliver Hunt.
13055 Add support in ResultType to track that the results of bitops
13056 are always of type int32_t.
13058 * parser/Nodes.cpp:
13059 (JSC::ReadModifyResolveNode::emitBytecode):
13060 (JSC::ReadModifyDotNode::emitBytecode):
13061 (JSC::ReadModifyBracketNode::emitBytecode):
13063 (JSC::ExpressionNode::):
13064 (JSC::BooleanNode::):
13065 (JSC::NumberNode::):
13066 (JSC::StringNode::):
13067 (JSC::PrePostResolveNode::):
13068 (JSC::TypeOfResolveNode::):
13069 (JSC::TypeOfValueNode::):
13070 (JSC::UnaryPlusNode::):
13071 (JSC::NegateNode::):
13072 (JSC::BitwiseNotNode::):
13073 (JSC::LogicalNotNode::):
13078 (JSC::LeftShiftNode::):
13079 (JSC::RightShiftNode::):
13080 (JSC::UnsignedRightShiftNode::):
13082 (JSC::GreaterNode::):
13083 (JSC::LessEqNode::):
13084 (JSC::GreaterEqNode::):
13085 (JSC::InstanceOfNode::):
13086 (JSC::EqualNode::):
13087 (JSC::NotEqualNode::):
13088 (JSC::StrictEqualNode::):
13089 (JSC::NotStrictEqualNode::):
13090 (JSC::BitAndNode::):
13091 (JSC::BitOrNode::):
13092 (JSC::BitXOrNode::):
13093 (JSC::LogicalOpNode::):
13094 * parser/ResultType.h:
13095 (JSC::ResultType::isInt32):
13096 (JSC::ResultType::isNotNumber):
13097 (JSC::ResultType::booleanType):
13098 (JSC::ResultType::numberType):
13099 (JSC::ResultType::numberTypeCanReuse):
13100 (JSC::ResultType::numberTypeCanReuseIsInt32):
13101 (JSC::ResultType::stringOrNumberTypeCanReuse):
13102 (JSC::ResultType::stringType):
13103 (JSC::ResultType::unknownType):
13104 (JSC::ResultType::forAdd):
13105 (JSC::ResultType::forBitOp):
13106 (JSC::OperandTypes::OperandTypes):
13108 2009-01-15 Gavin Barraclough <barraclough@apple.com>
13110 Reviewed by Oliver Hunt.
13112 Add support for integer addition, subtraction and multiplication
13113 in JIT code on x86-64.
13115 * assembler/MacroAssembler.h:
13116 (JSC::MacroAssembler::mul32):
13117 (JSC::MacroAssembler::sub32):
13118 (JSC::MacroAssembler::joMul32):
13119 (JSC::MacroAssembler::joSub32):
13121 (JSC::JIT::privateCompileMainPass):
13122 (JSC::JIT::privateCompileSlowCases):
13124 * jit/JITArithmetic.cpp:
13125 (JSC::JIT::compileFastArith_op_add):
13126 (JSC::JIT::compileFastArithSlow_op_add):
13127 (JSC::JIT::compileFastArith_op_mul):
13128 (JSC::JIT::compileFastArithSlow_op_mul):
13129 (JSC::JIT::compileFastArith_op_sub):
13130 (JSC::JIT::compileFastArithSlow_op_sub):
13132 2009-01-15 Gavin Barraclough <barraclough@apple.com>
13134 Reviewed by Geoff Garen.
13136 On x86-64 allow JSImmediate to encode 64-bit double precision values.
13137 This patch only affects builds that set USE(ALTERNATE_JSIMMEDIATE).
13138 Updates the implementation of JSValuePtr:: and JSImmediate:: methods
13139 that operate on neumeric values to be be aware of the new representation.
13140 When this representation is in use, the class JSNumberCell is redundant
13141 and is compiled out.
13143 The format of the new immediate representation is documented in JSImmediate.h.
13145 * JavaScriptCore.exp:
13146 * assembler/MacroAssembler.h:
13147 (JSC::MacroAssembler::subPtr):
13148 * assembler/X86Assembler.h:
13149 (JSC::X86Assembler::):
13150 (JSC::X86Assembler::subq_rr):
13151 (JSC::X86Assembler::movq_rr):
13152 (JSC::X86Assembler::ucomisd_rr):
13153 (JSC::X86Assembler::X86InstructionFormatter::twoByteOp64):
13154 * interpreter/Interpreter.cpp:
13155 (JSC::Interpreter::cti_op_stricteq):
13156 (JSC::Interpreter::cti_op_nstricteq):
13158 (JSC::JIT::compileOpStrictEq):
13159 (JSC::JIT::privateCompileMainPass):
13160 (JSC::JIT::privateCompileSlowCases):
13162 * jit/JITArithmetic.cpp:
13163 (JSC::JIT::compileFastArith_op_lshift):
13164 (JSC::JIT::compileFastArith_op_rshift):
13165 (JSC::JIT::compileFastArith_op_bitand):
13166 (JSC::JIT::compileFastArith_op_mod):
13167 (JSC::JIT::compileFastArith_op_add):
13168 (JSC::JIT::compileFastArith_op_mul):
13169 (JSC::JIT::compileFastArith_op_post_inc):
13170 (JSC::JIT::compileFastArith_op_post_dec):
13171 (JSC::JIT::compileFastArith_op_pre_inc):
13172 (JSC::JIT::compileFastArith_op_pre_dec):
13173 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
13174 (JSC::JIT::compileBinaryArithOp):
13175 * jit/JITInlineMethods.h:
13176 (JSC::JIT::emitJumpIfBothJSCells):
13177 (JSC::JIT::emitJumpIfEitherNumber):
13178 (JSC::JIT::emitJumpIfNotEitherNumber):
13179 (JSC::JIT::emitJumpIfImmediateIntegerNumber):
13180 (JSC::JIT::emitJumpIfNotImmediateIntegerNumber):
13181 (JSC::JIT::emitJumpIfNotImmediateIntegerNumbers):
13182 (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumber):
13183 (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumbers):
13184 (JSC::JIT::emitFastArithDeTagImmediate):
13185 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
13186 (JSC::JIT::emitFastArithReTagImmediate):
13187 (JSC::JIT::emitFastArithIntToImmNoCheck):
13188 * runtime/JSCell.h:
13189 * runtime/JSGlobalData.cpp:
13190 (JSC::JSGlobalData::JSGlobalData):
13191 * runtime/JSImmediate.cpp:
13192 (JSC::JSImmediate::toThisObject):
13193 (JSC::JSImmediate::toObject):
13194 (JSC::JSImmediate::toString):
13195 * runtime/JSImmediate.h:
13196 (JSC::wtf_reinterpret_cast):
13197 (JSC::JSImmediate::isNumber):
13198 (JSC::JSImmediate::isIntegerNumber):
13199 (JSC::JSImmediate::isDoubleNumber):
13200 (JSC::JSImmediate::isPositiveIntegerNumber):
13201 (JSC::JSImmediate::areBothImmediateIntegerNumbers):
13202 (JSC::JSImmediate::makeInt):
13203 (JSC::JSImmediate::makeDouble):
13204 (JSC::JSImmediate::doubleValue):
13205 (JSC::doubleToBoolean):
13206 (JSC::JSImmediate::toBoolean):
13207 (JSC::JSImmediate::getTruncatedUInt32):
13208 (JSC::JSImmediate::makeOutOfIntegerRange):
13209 (JSC::JSImmediate::from):
13210 (JSC::JSImmediate::getTruncatedInt32):
13211 (JSC::JSImmediate::toDouble):
13212 (JSC::JSImmediate::getUInt32):
13213 (JSC::JSValuePtr::isInt32Fast):
13214 (JSC::JSValuePtr::isUInt32Fast):
13215 (JSC::JSValuePtr::areBothInt32Fast):
13216 (JSC::JSFastMath::canDoFastBitwiseOperations):
13217 (JSC::JSFastMath::xorImmediateNumbers):
13218 (JSC::JSFastMath::canDoFastRshift):
13219 (JSC::JSFastMath::canDoFastUrshift):
13220 (JSC::JSFastMath::rightShiftImmediateNumbers):
13221 (JSC::JSFastMath::canDoFastAdditiveOperations):
13222 (JSC::JSFastMath::addImmediateNumbers):
13223 (JSC::JSFastMath::subImmediateNumbers):
13224 * runtime/JSNumberCell.cpp:
13225 (JSC::jsNumberCell):
13226 * runtime/JSNumberCell.h:
13227 (JSC::createNumberStructure):
13228 (JSC::isNumberCell):
13229 (JSC::asNumberCell):
13231 (JSC::JSValuePtr::isDoubleNumber):
13232 (JSC::JSValuePtr::getDoubleNumber):
13233 (JSC::JSValuePtr::isNumber):
13234 (JSC::JSValuePtr::uncheckedGetNumber):
13236 (JSC::JSValuePtr::getNumber):
13237 (JSC::JSValuePtr::numberToInt32):
13238 (JSC::JSValuePtr::numberToUInt32):
13239 * runtime/JSValue.h:
13240 * runtime/NumberConstructor.cpp:
13241 (JSC::numberConstructorNegInfinity):
13242 (JSC::numberConstructorPosInfinity):
13243 (JSC::numberConstructorMaxValue):
13244 (JSC::numberConstructorMinValue):
13245 * runtime/NumberObject.cpp:
13246 (JSC::constructNumber):
13247 * runtime/NumberObject.h:
13248 * runtime/Operations.h:
13249 (JSC::JSValuePtr::equal):
13250 (JSC::JSValuePtr::equalSlowCaseInline):
13251 (JSC::JSValuePtr::strictEqual):
13252 (JSC::JSValuePtr::strictEqualSlowCaseInline):
13255 2009-01-15 Sam Weinig <sam@webkit.org>
13257 Reviewed by Geoffrey Garen.
13259 <rdar://problem/6045018>
13260 REGRESSION (r34838): JavaScript objects appear to be leaked after loading google.com
13262 Subtract the number of JSStrings cached in SmallStrings when calculating the
13263 number of live JSObjects.
13265 * runtime/Collector.cpp:
13266 (JSC::Heap::objectCount):
13267 * runtime/SmallStrings.cpp:
13268 (JSC::SmallStrings::count):
13269 * runtime/SmallStrings.h:
13271 2009-01-15 Sam Weinig <sam@webkit.org>
13275 * runtime/Collector.cpp:
13277 2009-01-15 Sam Weinig <sam@webkit.org>
13279 Reviewed by Gavin Barraclough.
13281 Fix crash seen running fast/canvas.
13283 Make sure to mark the ScopeNode and CodeBlock being created
13284 in the re-parse for exception information.
13286 * bytecode/CodeBlock.cpp:
13287 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
13289 (JSC::ScopeNode::mark):
13290 * runtime/Collector.cpp:
13291 (JSC::Heap::collect):
13292 * runtime/JSGlobalData.cpp:
13293 (JSC::JSGlobalData::JSGlobalData):
13294 * runtime/JSGlobalData.h:
13296 2009-01-15 Craig Schlenter <craig.schlenter@gmail.com>
13298 Reviewed by Darin Adler.
13300 https://bugs.webkit.org/show_bug.cgi?id=23347
13301 Compilation of JavaScriptCore/wtf/ThreadingPthreads.cpp fails on Linux
13303 * wtf/ThreadingPthreads.cpp: included limits.h as INT_MAX is defined there.
13305 2009-01-15 Oliver Hunt <oliver@apple.com>
13307 Reviewed by Geoff Garen.
13309 Bug 23225: REGRESSION: Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com
13310 <https://bugs.webkit.org/show_bug.cgi?id=23225> <rdar://problem/6487432>
13312 Character position for open and closing brace was incorrectly referencing m_position to
13313 record their position in a source document, however this is unsafe as BOMs may lead to
13314 m_position being an arbitrary position from the real position of the current character.
13316 * parser/Lexer.cpp:
13317 (JSC::Lexer::matchPunctuator):
13319 2009-01-14 David Kilzer <ddkilzer@apple.com>
13321 Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html
13323 <https://bugs.webkit.org/show_bug.cgi?id=23153>
13325 Reviewed by Darin Adler.
13327 Instead of building bytecode.html into ${SRCROOT}/docs/bytecode.html, build it
13328 into ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore/docs/bytecode.html.
13330 Also fixes make-bytecode-docs.pl to actually generate documentation.
13332 * DerivedSources.make: Changed bytecode.html to be built into local docs
13333 directory in ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore.
13334 * JavaScriptCore.xcodeproj/project.pbxproj: Added "/docs" to the end of the
13335 "mkdir -p" command so that the docs subdirectory is automatically created.
13336 * docs/make-bytecode-docs.pl: Changed BEGIN_OPCODE to DEFINE_OPCODE so that
13337 documentation is actually generated.
13339 2009-01-14 Adam Treat <adam.treat@torchmobile.com>
13341 Build fix for Qt from Dmitry Titov.
13343 * wtf/ThreadingQt.cpp:
13344 (WTF::ThreadCondition::timedWait):
13346 2009-01-14 Oliver Hunt <oliver@apple.com>
13348 Reviewed by Cameron Zwarich.
13350 Bug 22903: REGRESSION (r36267): visiting this site reliably crashes WebKit nightly
13352 EvalCodeBlock's do not reference the functions that are declared inside the eval
13353 code, this means that simply marking the EvalCodeBlock through the global object
13354 is insufficient to mark the declared functions. This patch corrects this by
13355 explicitly marking the CodeBlocks of all the functions declared in the cached
13358 * bytecode/CodeBlock.cpp:
13359 (JSC::CodeBlock::mark):
13360 * bytecode/CodeBlock.h:
13361 (JSC::CodeBlock::hasFunctions):
13362 * bytecode/EvalCodeCache.h:
13363 (JSC::EvalCodeCache::mark):
13364 * parser/Nodes.cpp:
13365 (JSC::ScopeNodeData::mark):
13366 (JSC::EvalNode::mark):
13369 2009-01-14 Dmitry Titov <dimich@chromium.org>
13371 Reviewed by Alexey Proskuryakov.
13373 https://bugs.webkit.org/show_bug.cgi?id=23312
13374 Implement MessageQueue::waitForMessageTimed()
13375 Also fixed ThreadCondition::timedWait() to take absolute time, as discussed on webkit-dev.
13376 Win32 version of timedWait still has to be implemented.
13378 * wtf/MessageQueue.h:
13379 (WTF::MessageQueueWaitResult: new enum for the result of MessageQueue::waitForMessageTimed.
13380 (WTF::MessageQueue::waitForMessage):
13381 (WTF::MessageQueue::waitForMessageTimed): New method.
13383 * wtf/ThreadingGtk.cpp:
13384 (WTF::ThreadCondition::timedWait): changed to use absolute time instead of interval.
13385 * wtf/ThreadingNone.cpp:
13386 (WTF::ThreadCondition::timedWait): ditto.
13387 * wtf/ThreadingPthreads.cpp:
13388 (WTF::ThreadCondition::timedWait): ditto.
13389 * wtf/ThreadingQt.cpp:
13390 (WTF::ThreadCondition::timedWait): ditto.
13391 * wtf/ThreadingWin.cpp:
13392 (WTF::ThreadCondition::timedWait): ditto. The actual Win32 code is still to be implemented.
13394 2009-01-14 Dean McNamee <deanm@chromium.org>
13396 Reviewed by Darin Adler and Oliver hunt.
13398 Correctly match allocation functions by implementing a custom deref().
13400 https://bugs.webkit.org/show_bug.cgi?id=23315
13402 * runtime/ByteArray.h:
13403 (JSC::ByteArray::deref):
13404 (JSC::ByteArray::ByteArray):
13406 2009-01-14 Dan Bernstein <mitz@apple.com>
13408 Reviewed by John Sullivan.
13414 2009-01-13 Beth Dakin <bdakin@apple.com>
13416 Reviewed by Darin Adler and Oliver Hunt.
13418 <rdar://problem/6489314> REGRESSION: Business widget's front side
13419 fails to render correctly when flipping widget
13421 The problem here is that parseInt was parsing NaN as 0. This patch
13422 corrects that by parsing NaN as NaN. This matches our old behavior
13425 * runtime/JSGlobalObjectFunctions.cpp:
13426 (JSC::globalFuncParseInt):
13428 2009-01-13 Gavin Barraclough <barraclough@apple.com>
13430 Reviewed by Oliver Hunt.
13432 Fix for: https://bugs.webkit.org/show_bug.cgi?id=23292
13434 Implementation of two argument canDoFastAdditiveOperations does not correlate well with reality.
13436 * runtime/JSImmediate.h:
13437 (JSC::JSFastMath::canDoFastAdditiveOperations):
13439 2009-01-13 Zalan Bujtas <zbujtas@gmail.com>
13441 Reviewed by Darin Adler.
13443 https://bugs.webkit.org/show_bug.cgi?id=23290
13444 Fix JSImmediate::isImmediate(src) to !src->isCell()
13446 * interpreter/Interpreter.cpp:
13447 (JSC::Interpreter::privateExecute):
13449 2009-01-13 Dmitry Titov <dimich@chromium.org>
13451 Reviewed by Darin Adler.
13453 https://bugs.webkit.org/show_bug.cgi?id=23281
13454 Fix the Chromium Win build.
13455 Need to use PLATFORM(WIN_OS) instead of PLATFORM(WIN).
13456 Moved GTK and WX up in #if sequence because they could come with WIN_OS too,
13457 while they have their own implementation even on Windows.
13459 * wtf/CurrentTime.cpp:
13460 (WTF::currentTime):
13462 2009-01-12 Gavin Barraclough <barraclough@apple.com>
13464 Reviewed by Oliver Hunt.
13466 Make the JSImmediate interface private.
13468 All manipulation of JS values should be through the JSValuePtr class, not by using JSImmediate
13469 directly. The key missing methods on JSValuePtr are:
13471 * isCell() - check for values that are JSCell*s, and as such where asCell() may be used.
13472 * isInt32Fast() getInt32Fast() - fast check/access for integer immediates.
13473 * isUInt32Fast() getUInt32Fast() - ditto for unsigned integer immediates.
13475 The JIT is allowed full access to JSImmediate, since it needs to be able to directly
13476 manipulate JSValuePtrs. The Interpreter is provided access to perform operations directly
13477 on JSValuePtrs through the new JSFastMath interface.
13479 No performance impact.
13481 * API/JSCallbackObjectFunctions.h:
13483 * API/JSValueRef.cpp:
13485 (JSValueIsStrictEqual):
13486 * JavaScriptCore.exp:
13487 * bytecode/CodeBlock.h:
13488 (JSC::CodeBlock::isKnownNotImmediate):
13489 * bytecompiler/BytecodeGenerator.cpp:
13490 (JSC::keyForImmediateSwitch):
13491 * bytecompiler/BytecodeGenerator.h:
13492 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
13493 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
13494 * interpreter/Interpreter.cpp:
13498 (JSC::jsIsObjectType):
13499 (JSC::cachePrototypeChain):
13500 (JSC::Interpreter::tryCachePutByID):
13501 (JSC::Interpreter::tryCacheGetByID):
13502 (JSC::Interpreter::privateExecute):
13503 (JSC::Interpreter::tryCTICachePutByID):
13504 (JSC::Interpreter::tryCTICacheGetByID):
13505 (JSC::Interpreter::cti_op_add):
13506 (JSC::Interpreter::cti_op_get_by_id_self_fail):
13507 (JSC::Interpreter::cti_op_get_by_id_proto_list):
13508 (JSC::Interpreter::cti_op_instanceof):
13509 (JSC::Interpreter::cti_op_mul):
13510 (JSC::Interpreter::cti_op_get_by_val):
13511 (JSC::Interpreter::cti_op_get_by_val_byte_array):
13512 (JSC::Interpreter::cti_op_sub):
13513 (JSC::Interpreter::cti_op_put_by_val):
13514 (JSC::Interpreter::cti_op_put_by_val_array):
13515 (JSC::Interpreter::cti_op_put_by_val_byte_array):
13516 (JSC::Interpreter::cti_op_negate):
13517 (JSC::Interpreter::cti_op_div):
13518 (JSC::Interpreter::cti_op_eq):
13519 (JSC::Interpreter::cti_op_lshift):
13520 (JSC::Interpreter::cti_op_bitand):
13521 (JSC::Interpreter::cti_op_rshift):
13522 (JSC::Interpreter::cti_op_bitnot):
13523 (JSC::Interpreter::cti_op_neq):
13524 (JSC::Interpreter::cti_op_urshift):
13525 (JSC::Interpreter::cti_op_call_eval):
13526 (JSC::Interpreter::cti_op_throw):
13527 (JSC::Interpreter::cti_op_is_undefined):
13528 (JSC::Interpreter::cti_op_stricteq):
13529 (JSC::Interpreter::cti_op_nstricteq):
13530 (JSC::Interpreter::cti_op_switch_imm):
13531 (JSC::Interpreter::cti_vm_throw):
13532 * interpreter/Interpreter.h:
13533 (JSC::Interpreter::isJSArray):
13534 (JSC::Interpreter::isJSString):
13535 (JSC::Interpreter::isJSByteArray):
13537 (JSC::JIT::compileOpStrictEq):
13538 (JSC::JIT::privateCompileMainPass):
13540 (JSC::JIT::isStrictEqCaseHandledInJITCode):
13541 * jit/JITArithmetic.cpp:
13542 (JSC::JIT::compileFastArith_op_rshift):
13543 (JSC::JIT::compileFastArith_op_bitand):
13544 (JSC::JIT::compileFastArith_op_mod):
13546 (JSC::JIT::unlinkCall):
13547 (JSC::JIT::compileOpCall):
13548 * jit/JITInlineMethods.h:
13549 (JSC::JIT::getConstantOperandImmediateInt):
13550 (JSC::JIT::isOperandConstantImmediateInt):
13551 * parser/Nodes.cpp:
13552 (JSC::processClauseList):
13553 * runtime/ArrayPrototype.cpp:
13554 (JSC::arrayProtoFuncIndexOf):
13555 (JSC::arrayProtoFuncLastIndexOf):
13556 * runtime/BooleanPrototype.cpp:
13557 (JSC::booleanProtoFuncValueOf):
13558 * runtime/Collector.cpp:
13559 (JSC::Heap::protect):
13560 (JSC::Heap::unprotect):
13562 * runtime/JSByteArray.cpp:
13563 (JSC::JSByteArray::getOwnPropertySlot):
13564 * runtime/JSByteArray.h:
13565 (JSC::JSByteArray::getIndex):
13566 * runtime/JSCell.cpp:
13567 * runtime/JSCell.h:
13568 (JSC::JSValuePtr::isNumberCell):
13569 (JSC::JSValuePtr::asCell):
13570 (JSC::JSValuePtr::isNumber):
13571 * runtime/JSGlobalObjectFunctions.cpp:
13572 (JSC::globalFuncParseInt):
13573 * runtime/JSImmediate.h:
13575 (JSC::jsImpossibleValue):
13576 (JSC::JSValuePtr::toInt32):
13577 (JSC::JSValuePtr::toUInt32):
13578 (JSC::JSValuePtr::isCell):
13579 (JSC::JSValuePtr::isInt32Fast):
13580 (JSC::JSValuePtr::getInt32Fast):
13581 (JSC::JSValuePtr::isUInt32Fast):
13582 (JSC::JSValuePtr::getUInt32Fast):
13583 (JSC::JSValuePtr::makeInt32Fast):
13584 (JSC::JSValuePtr::areBothInt32Fast):
13585 (JSC::JSFastMath::canDoFastBitwiseOperations):
13586 (JSC::JSFastMath::equal):
13587 (JSC::JSFastMath::notEqual):
13588 (JSC::JSFastMath::andImmediateNumbers):
13589 (JSC::JSFastMath::xorImmediateNumbers):
13590 (JSC::JSFastMath::orImmediateNumbers):
13591 (JSC::JSFastMath::canDoFastRshift):
13592 (JSC::JSFastMath::canDoFastUrshift):
13593 (JSC::JSFastMath::rightShiftImmediateNumbers):
13594 (JSC::JSFastMath::canDoFastAdditiveOperations):
13595 (JSC::JSFastMath::addImmediateNumbers):
13596 (JSC::JSFastMath::subImmediateNumbers):
13597 (JSC::JSFastMath::incImmediateNumber):
13598 (JSC::JSFastMath::decImmediateNumber):
13599 * runtime/JSNumberCell.h:
13600 (JSC::JSValuePtr::asNumberCell):
13602 (JSC::JSValuePtr::uncheckedGetNumber):
13603 (JSC::JSNumberCell::toInt32):
13604 (JSC::JSNumberCell::toUInt32):
13605 (JSC::JSValuePtr::toJSNumber):
13606 (JSC::JSValuePtr::getNumber):
13607 (JSC::JSValuePtr::numberToInt32):
13608 (JSC::JSValuePtr::numberToUInt32):
13609 * runtime/JSObject.h:
13610 (JSC::JSValuePtr::isObject):
13611 (JSC::JSValuePtr::get):
13612 (JSC::JSValuePtr::put):
13613 * runtime/JSValue.cpp:
13614 (JSC::JSValuePtr::toInteger):
13615 (JSC::JSValuePtr::toIntegerPreserveNaN):
13616 * runtime/JSValue.h:
13617 * runtime/Operations.cpp:
13618 (JSC::JSValuePtr::equalSlowCase):
13619 (JSC::JSValuePtr::strictEqualSlowCase):
13620 * runtime/Operations.h:
13621 (JSC::JSValuePtr::equal):
13622 (JSC::JSValuePtr::equalSlowCaseInline):
13623 (JSC::JSValuePtr::strictEqual):
13624 (JSC::JSValuePtr::strictEqualSlowCaseInline):
13625 * runtime/Protect.h:
13627 (JSC::gcUnprotect):
13628 * runtime/StringPrototype.cpp:
13629 (JSC::stringProtoFuncCharAt):
13630 (JSC::stringProtoFuncCharCodeAt):
13631 * runtime/Structure.cpp:
13632 (JSC::Structure::createCachedPrototypeChain):
13634 2009-01-12 Kevin Ollivier <kevino@theolliviers.com>
13636 Since date time functions have moved here, now the wx port JSC
13637 needs to depend on wx.
13641 2009-01-11 David Levin <levin@chromium.org>
13643 Reviewed by Darin Adler.
13645 https://bugs.webkit.org/show_bug.cgi?id=23245
13647 Add initializeThreading to key places in JS API to ensure that
13648 UString is properly initialized.
13650 * API/JSContextRef.cpp:
13651 (JSContextGroupCreate):
13652 (JSGlobalContextCreate):
13653 * API/JSObjectRef.cpp:
13655 * API/JSStringRef.cpp:
13656 (JSStringCreateWithCharacters):
13657 (JSStringCreateWithUTF8CString):
13658 * API/JSStringRefCF.cpp:
13659 (JSStringCreateWithCFString):
13661 2009-01-11 David Levin <levin@chromium.org>
13663 Reviewed by Darin Adler.
13665 https://bugs.webkit.org/show_bug.cgi?id=23175
13667 Separate out BaseString information from UString::Rep and make all baseString access go through
13668 a member function, so that it may be used for something else (in the future) in the BaseString
13671 * runtime/SmallStrings.cpp:
13672 (JSC::SmallStringsStorage::rep):
13673 (JSC::SmallStringsStorage::SmallStringsStorage):
13674 (JSC::SmallStrings::SmallStrings):
13675 (JSC::SmallStrings::mark):
13676 Adjust to account for the changes in UString and put the UString in place in
13677 SmallStringsStorage to aid in locality of reference among the UChar[] and UString::Rep's.
13679 * runtime/SmallStrings.h:
13680 * runtime/UString.cpp:
13681 (JSC::initializeStaticBaseString):
13682 (JSC::initializeUString):
13683 (JSC::UString::Rep::create):
13684 (JSC::UString::Rep::destroy):
13685 (JSC::UString::Rep::checkConsistency):
13686 (JSC::expandCapacity):
13687 (JSC::UString::expandPreCapacity):
13688 (JSC::concatenate):
13689 (JSC::UString::append):
13690 (JSC::UString::operator=):
13691 * runtime/UString.h:
13692 (JSC::UString::Rep::baseIsSelf):
13693 (JSC::UString::Rep::setBaseString):
13694 (JSC::UString::Rep::baseString):
13695 (JSC::UString::Rep::):
13696 (JSC::UString::Rep::null):
13697 (JSC::UString::Rep::empty):
13698 (JSC::UString::Rep::data):
13699 (JSC::UString::cost):
13700 Separate out the items out used by base strings from those used in Rep's that only
13701 point to base strings. (This potentially saves 24 bytes per Rep.)
13703 2009-01-11 Darin Adler <darin@apple.com>
13705 Reviewed by Dan Bernstein.
13707 Bug 23239: improve handling of unused arguments in JavaScriptCore
13708 https://bugs.webkit.org/show_bug.cgi?id=23239
13710 * runtime/DatePrototype.cpp: Moved LocaleDateTimeFormat enum outside #if
13711 so we can use this on all platforms. Changed valueOf to share the same
13712 function with getTime, since the contents of the two are identical. Removed
13713 a FIXME since the idea isn't really specific enough or helpful enough to
13714 need to sit here in the source code.
13715 (JSC::formatLocaleDate): Changed the Mac version of this function to take
13716 the same arguments as the non-Mac version so the caller doesn't have to
13717 special-case the two platforms. Also made the formatString array be const;
13718 before the characters were, but the array was a modifiable global variable.
13719 (JSC::dateProtoFuncToLocaleString): Changed to call the new unified
13720 version of formatLocaleDate and remove the ifdef.
13721 (JSC::dateProtoFuncToLocaleDateString): Ditto.
13722 (JSC::dateProtoFuncToLocaleTimeString): Ditto.
13724 * runtime/JSNotAnObject.cpp:
13725 (JSC::JSNotAnObject::toObject): Use the new ASSERT_UNUSED instead of the
13728 * runtime/RegExp.cpp:
13729 (JSC::RegExp::RegExp): Changed to only use UNUSED_PARAM when the parameter
13730 is actually unused.
13732 * wtf/TCSystemAlloc.cpp:
13733 (TCMalloc_SystemRelease): Changed to only use UNUSED_PARAM when the parameter
13734 is actually unused.
13735 (TCMalloc_SystemCommit): Changed to omit the argument names instead of using
13738 2009-01-11 Oliver Hunt <oliver@apple.com>
13740 Reviewed by NOBODY (Build fix).
13742 Fix the build (whoops)
13744 * interpreter/Interpreter.cpp:
13745 (JSC::Interpreter::cti_op_get_by_val):
13747 2009-01-11 Oliver Hunt <oliver@apple.com>
13749 Reviewed by Darin Adler and Anders Carlsson
13751 Bug 23128: get/put_by_val need to respecialise in the face of ByteArray
13753 Restructure the code slightly, and add comments per Darin's suggestions
13755 * interpreter/Interpreter.cpp:
13756 (JSC::Interpreter::cti_op_get_by_val):
13757 (JSC::Interpreter::cti_op_get_by_val_byte_array):
13758 (JSC::Interpreter::cti_op_put_by_val):
13759 (JSC::Interpreter::cti_op_put_by_val_byte_array):
13761 2009-01-11 Oliver Hunt <oliver@apple.com>
13763 Reviewed by Anders Carlsson.
13765 Whoops, I accidentally removed an exception check from fast the
13766 fast path for string indexing when i originally landed the
13769 * interpreter/Interpreter.cpp:
13770 (JSC::Interpreter::cti_op_get_by_val):
13772 2009-01-11 Oliver Hunt <oliver@apple.com>
13774 Reviewed by Anders Carlsson.
13776 Bug 23128: get/put_by_val need to respecialise in the face of ByteArray
13777 <https://bugs.webkit.org/show_bug.cgi?id=23128>
13779 Fairly simple patch, add specialised versions of cti_op_get/put_by_val
13780 that assume ByteArray, thus avoiding a few branches in the case of bytearray
13783 No effect on SunSpider. 15% win on the original testcase.
13785 * interpreter/Interpreter.cpp:
13786 (JSC::Interpreter::cti_op_get_by_val):
13787 (JSC::Interpreter::cti_op_get_by_val_byte_array):
13788 (JSC::Interpreter::cti_op_put_by_val):
13789 (JSC::Interpreter::cti_op_put_by_val_byte_array):
13790 * interpreter/Interpreter.h:
13792 2009-01-11 Alexey Proskuryakov <ap@webkit.org>
13794 Try to fix Windows build.
13796 * wtf/CurrentTime.cpp: Added a definition of msPerSecond (previously, this code was in
13797 DateMath.cpp, with constant definition in DateTime.h)
13799 2009-01-11 Alexey Proskuryakov <ap@webkit.org>
13801 Try to fix Windows build.
13803 * wtf/CurrentTime.cpp: Include <sys/types.h> and <sys/timeb.h>, as MSDN says to.
13805 2009-01-11 Dmitry Titov <dimich@chromium.org>
13807 Reviewed by Darin Adler.
13809 https://bugs.webkit.org/show_bug.cgi?id=23207
13810 Moved currentTime() to from WebCore to WTF.
13813 * JavaScriptCore.exp: added export for WTF::currentTime()
13814 * JavaScriptCore.pri:
13815 * JavaScriptCore.scons:
13816 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
13817 * JavaScriptCore.xcodeproj/project.pbxproj:
13818 * JavaScriptCoreSources.bkl:
13819 * runtime/DateMath.cpp:
13820 (JSC::getCurrentUTCTimeWithMicroseconds): This function had another implementation of currentTime(), essentially. Now uses WTF version.
13821 * wtf/CurrentTime.cpp: Added.
13822 (WTF::currentTime):
13823 (WTF::highResUpTime):
13824 (WTF::lowResUTCTime):
13825 (WTF::qpcAvailable):
13826 * wtf/CurrentTime.h: Added.
13828 2009-01-09 Gavin Barraclough <barraclough@apple.com>
13830 Reviewed by Oliver Hunt.
13832 Stage two of converting JSValue from a pointer to a class type.
13833 Remove the class JSValue. The functionallity has been transitioned
13834 into the wrapper class type JSValuePtr.
13836 The last stage will be to rename JSValuePtr to JSValue, remove the
13837 overloaded -> operator, and switch operations on JSValuePtrs from
13838 using '->' to use '.' instead.
13841 * JavaScriptCore.exp:
13842 * runtime/JSCell.h:
13844 (JSC::JSValuePtr::asCell):
13845 (JSC::JSValuePtr::isNumber):
13846 (JSC::JSValuePtr::isString):
13847 (JSC::JSValuePtr::isGetterSetter):
13848 (JSC::JSValuePtr::isObject):
13849 (JSC::JSValuePtr::getNumber):
13850 (JSC::JSValuePtr::getString):
13851 (JSC::JSValuePtr::getObject):
13852 (JSC::JSValuePtr::getCallData):
13853 (JSC::JSValuePtr::getConstructData):
13854 (JSC::JSValuePtr::getUInt32):
13855 (JSC::JSValuePtr::getTruncatedInt32):
13856 (JSC::JSValuePtr::getTruncatedUInt32):
13857 (JSC::JSValuePtr::mark):
13858 (JSC::JSValuePtr::marked):
13859 (JSC::JSValuePtr::toPrimitive):
13860 (JSC::JSValuePtr::getPrimitiveNumber):
13861 (JSC::JSValuePtr::toBoolean):
13862 (JSC::JSValuePtr::toNumber):
13863 (JSC::JSValuePtr::toString):
13864 (JSC::JSValuePtr::toObject):
13865 (JSC::JSValuePtr::toThisObject):
13866 (JSC::JSValuePtr::needsThisConversion):
13867 (JSC::JSValuePtr::toThisString):
13868 (JSC::JSValuePtr::getJSNumber):
13869 * runtime/JSImmediate.h:
13870 (JSC::JSValuePtr::isUndefined):
13871 (JSC::JSValuePtr::isNull):
13872 (JSC::JSValuePtr::isUndefinedOrNull):
13873 (JSC::JSValuePtr::isBoolean):
13874 (JSC::JSValuePtr::getBoolean):
13875 (JSC::JSValuePtr::toInt32):
13876 (JSC::JSValuePtr::toUInt32):
13877 * runtime/JSNumberCell.h:
13878 (JSC::JSValuePtr::uncheckedGetNumber):
13879 (JSC::JSValuePtr::toJSNumber):
13880 * runtime/JSObject.h:
13881 (JSC::JSValuePtr::isObject):
13882 (JSC::JSValuePtr::get):
13883 (JSC::JSValuePtr::put):
13884 * runtime/JSString.h:
13885 (JSC::JSValuePtr::toThisJSString):
13886 * runtime/JSValue.cpp:
13887 (JSC::JSValuePtr::toInteger):
13888 (JSC::JSValuePtr::toIntegerPreserveNaN):
13889 (JSC::JSValuePtr::toInt32SlowCase):
13890 (JSC::JSValuePtr::toUInt32SlowCase):
13891 * runtime/JSValue.h:
13892 (JSC::JSValuePtr::makeImmediate):
13893 (JSC::JSValuePtr::immediateValue):
13894 (JSC::JSValuePtr::JSValuePtr):
13895 (JSC::JSValuePtr::operator->):
13896 (JSC::JSValuePtr::operator bool):
13897 (JSC::JSValuePtr::operator==):
13898 (JSC::JSValuePtr::operator!=):
13899 (JSC::JSValuePtr::encode):
13900 (JSC::JSValuePtr::decode):
13901 (JSC::JSValuePtr::toFloat):
13902 (JSC::JSValuePtr::asValue):
13906 2009-01-09 David Levin <levin@chromium.org>
13908 Reviewed by Oliver Hunt.
13910 https://bugs.webkit.org/show_bug.cgi?id=23175
13912 Adjustment to previous patch. Remove call to initilizeThreading from JSGlobalCreate
13913 and fix jsc.cpp instead.
13918 * runtime/JSGlobalData.cpp:
13919 (JSC::JSGlobalData::create):
13921 2009-01-09 Sam Weinig <sam@webkit.org>
13923 Roll r39720 back in with a working interpreted mode.
13925 2009-01-09 David Levin <levin@chromium.org>
13927 Reviewed by Oliver Hunt.
13929 https://bugs.webkit.org/show_bug.cgi?id=23175
13931 Added a template to make the pointer and flags combination
13932 in UString more readable and less error prone.
13935 * JavaScriptCore.exp:
13936 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
13937 * JavaScriptCore.xcodeproj/project.pbxproj:
13938 Added PtrAndFlags.h (and sorted the xcode project file).
13940 * runtime/Identifier.cpp:
13941 (JSC::Identifier::add):
13942 (JSC::Identifier::addSlowCase):
13943 * runtime/InitializeThreading.cpp:
13944 (JSC::initializeThreadingOnce):
13945 Made the init threading initialize the UString globals. Before
13946 these were initilized using {} but that became harder due to the
13947 addition of this tempalte class.
13949 * runtime/JSGlobalData.cpp:
13950 (JSC::JSGlobalData::create):
13951 * runtime/PropertyNameArray.cpp:
13952 (JSC::PropertyNameArray::add):
13953 * runtime/UString.cpp:
13954 (JSC::initializeStaticBaseString):
13955 (JSC::initializeUString):
13956 (JSC::UString::Rep::create):
13957 (JSC::UString::Rep::createFromUTF8):
13959 (JSC::UString::UString):
13960 (JSC::concatenate):
13961 (JSC::UString::operator=):
13962 (JSC::UString::makeNull):
13963 (JSC::UString::nullRep):
13964 * runtime/UString.h:
13965 (JSC::UString::Rep::identifierTable):
13966 (JSC::UString::Rep::setIdentifierTable):
13967 (JSC::UString::Rep::isStatic):
13968 (JSC::UString::Rep::setStatic):
13969 (JSC::UString::Rep::):
13970 (JSC::UString::Rep::null):
13971 (JSC::UString::Rep::empty):
13972 (JSC::UString::isNull):
13973 (JSC::UString::null):
13974 (JSC::UString::UString):
13976 * wtf/PtrAndFlags.h: Added.
13977 (WTF::PtrAndFlags::PtrAndFlags):
13978 (WTF::PtrAndFlags::isFlagSet):
13979 (WTF::PtrAndFlags::setFlag):
13980 (WTF::PtrAndFlags::clearFlag):
13981 (WTF::PtrAndFlags::get):
13982 (WTF::PtrAndFlags::set):
13983 A simple way to layer together a pointer and 2 flags. It relies on the pointer being 4 byte aligned,
13984 which should happen for all allocators (due to aligning pointers, int's, etc. on 4 byte boundaries).
13986 2009-01-08 Gavin Barraclough <barraclough@apple.com>
13988 Reviewed by -O-l-i-v-e-r- -H-u-n-t- Sam Weinig (sorry, Sam!).
13990 Encode immediates in the low word of JSValuePtrs, on x86-64.
13992 On 32-bit platforms a JSValuePtr may represent a 31-bit signed integer.
13993 On 64-bit platforms, if USE(ALTERNATE_JSIMMEDIATE) is defined, a full
13994 32-bit integer may be stored in an immediate.
13996 Presently USE(ALTERNATE_JSIMMEDIATE) uses the same encoding as the default
13997 immediate format - the value is left shifted by one, so a one bit tag can
13998 be added to indicate the value is an immediate. However this means that
13999 values must be commonly be detagged (by right shifting by one) before
14000 arithmetic operations can be performed on immediates. This patch modifies
14001 the formattting so the the high bits of the immediate mark values as being
14004 * assembler/MacroAssembler.h:
14005 (JSC::MacroAssembler::not32):
14006 (JSC::MacroAssembler::orPtr):
14007 (JSC::MacroAssembler::zeroExtend32ToPtr):
14008 (JSC::MacroAssembler::jaePtr):
14009 (JSC::MacroAssembler::jbPtr):
14010 (JSC::MacroAssembler::jnzPtr):
14011 (JSC::MacroAssembler::jzPtr):
14012 * assembler/X86Assembler.h:
14013 (JSC::X86Assembler::):
14014 (JSC::X86Assembler::notl_r):
14015 (JSC::X86Assembler::testq_i32r):
14017 (JSC::JIT::privateCompileMainPass):
14018 (JSC::JIT::privateCompileSlowCases):
14019 (JSC::JIT::privateCompileCTIMachineTrampolines):
14021 * jit/JITArithmetic.cpp:
14022 (JSC::JIT::compileFastArith_op_lshift):
14023 (JSC::JIT::compileFastArith_op_rshift):
14024 (JSC::JIT::compileFastArith_op_bitand):
14025 (JSC::JIT::compileFastArithSlow_op_bitand):
14026 (JSC::JIT::compileFastArith_op_mod):
14027 (JSC::JIT::compileFastArithSlow_op_mod):
14028 (JSC::JIT::compileFastArith_op_add):
14029 (JSC::JIT::compileFastArith_op_mul):
14030 (JSC::JIT::compileFastArith_op_post_inc):
14031 (JSC::JIT::compileFastArith_op_post_dec):
14032 (JSC::JIT::compileFastArith_op_pre_inc):
14033 (JSC::JIT::compileFastArith_op_pre_dec):
14034 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
14035 (JSC::JIT::compileBinaryArithOp):
14037 (JSC::JIT::compileOpCallSlowCase):
14038 * jit/JITInlineMethods.h:
14039 (JSC::JIT::emitJumpIfJSCell):
14040 (JSC::JIT::emitJumpIfNotJSCell):
14041 (JSC::JIT::emitJumpIfImmNum):
14042 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
14043 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
14044 (JSC::JIT::emitFastArithDeTagImmediate):
14045 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
14046 (JSC::JIT::emitFastArithReTagImmediate):
14047 (JSC::JIT::emitFastArithImmToInt):
14048 (JSC::JIT::emitFastArithIntToImmNoCheck):
14049 (JSC::JIT::emitTagAsBoolImmediate):
14050 * jit/JITPropertyAccess.cpp:
14051 (JSC::resizePropertyStorage):
14052 (JSC::JIT::privateCompilePutByIdTransition):
14053 (JSC::JIT::privateCompilePatchGetArrayLength):
14054 (JSC::JIT::privateCompileGetByIdSelf):
14055 (JSC::JIT::privateCompileGetByIdProto):
14056 (JSC::JIT::privateCompileGetByIdChain):
14057 (JSC::JIT::privateCompilePutByIdReplace):
14058 * runtime/JSImmediate.h:
14059 (JSC::JSImmediate::isNumber):
14060 (JSC::JSImmediate::isPositiveNumber):
14061 (JSC::JSImmediate::areBothImmediateNumbers):
14062 (JSC::JSImmediate::xorImmediateNumbers):
14063 (JSC::JSImmediate::rightShiftImmediateNumbers):
14064 (JSC::JSImmediate::canDoFastAdditiveOperations):
14065 (JSC::JSImmediate::addImmediateNumbers):
14066 (JSC::JSImmediate::subImmediateNumbers):
14067 (JSC::JSImmediate::makeInt):
14068 (JSC::JSImmediate::toBoolean):
14071 2009-01-08 Sam Weinig <sam@webkit.org>
14073 Revert r39720. It broke Interpreted mode.
14075 2009-01-08 Sam Weinig <sam@webkit.org>
14077 Reviewed by Oliver Hunt.
14079 Fix for https://bugs.webkit.org/show_bug.cgi?id=23197
14080 Delay creating the PCVector until an exception is thrown
14081 Part of <rdar://problem/6469060>
14082 Don't store exception information for a CodeBlock until first exception is thrown
14084 - Change the process for re-parsing/re-generating bytecode for exception information
14085 to use data from the original CodeBlock (offsets of GlobalResolve instructions) to
14086 aid in creating an identical instruction stream on re-parse, instead of padding
14087 interchangeable opcodes, which would result in different JITed code.
14088 - Fix bug where the wrong ScopeChainNode was used when re-parsing/regenerating from
14089 within some odd modified scope chains.
14090 - Lazily create the pcVector by re-JITing the regenerated CodeBlock and stealing the
14091 the pcVector from it.
14093 Saves ~2MB on Membuster head.
14095 * bytecode/CodeBlock.cpp:
14096 (JSC::CodeBlock::dump):
14097 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
14098 (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
14099 (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
14100 * bytecode/CodeBlock.h:
14101 (JSC::JITCodeRef::JITCodeRef):
14102 (JSC::GlobalResolveInfo::GlobalResolveInfo):
14103 (JSC::CodeBlock::getBytecodeIndex):
14104 (JSC::CodeBlock::addGlobalResolveInstruction):
14105 (JSC::CodeBlock::addGlobalResolveInfo):
14106 (JSC::CodeBlock::addFunctionRegisterInfo):
14107 (JSC::CodeBlock::hasExceptionInfo):
14108 (JSC::CodeBlock::pcVector):
14109 (JSC::EvalCodeBlock::EvalCodeBlock):
14110 (JSC::EvalCodeBlock::baseScopeDepth):
14111 * bytecode/Opcode.h:
14112 * bytecompiler/BytecodeGenerator.cpp:
14113 (JSC::BytecodeGenerator::BytecodeGenerator):
14114 (JSC::BytecodeGenerator::emitResolve):
14115 (JSC::BytecodeGenerator::emitGetScopedVar):
14116 * bytecompiler/BytecodeGenerator.h:
14117 (JSC::BytecodeGenerator::setRegeneratingForExceptionInfo):
14118 * interpreter/Interpreter.cpp:
14119 (JSC::bytecodeOffsetForPC):
14120 (JSC::Interpreter::unwindCallFrame):
14121 (JSC::Interpreter::privateExecute):
14122 (JSC::Interpreter::retrieveLastCaller):
14123 (JSC::Interpreter::cti_op_instanceof):
14124 (JSC::Interpreter::cti_op_call_NotJSFunction):
14125 (JSC::Interpreter::cti_op_resolve):
14126 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
14127 (JSC::Interpreter::cti_op_resolve_func):
14128 (JSC::Interpreter::cti_op_resolve_skip):
14129 (JSC::Interpreter::cti_op_resolve_global):
14130 (JSC::Interpreter::cti_op_resolve_with_base):
14131 (JSC::Interpreter::cti_op_throw):
14132 (JSC::Interpreter::cti_op_in):
14133 (JSC::Interpreter::cti_vm_throw):
14135 (JSC::JIT::privateCompile):
14136 * parser/Nodes.cpp:
14137 (JSC::EvalNode::generateBytecode):
14138 (JSC::EvalNode::bytecodeForExceptionInfoReparse):
14139 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
14142 2009-01-08 Jian Li <jianli@chromium.org>
14144 Reviewed by Alexey Proskuryakov.
14146 Add Win32 implementation of ThreadSpecific.
14147 https://bugs.webkit.org/show_bug.cgi?id=22614
14149 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
14150 * wtf/ThreadSpecific.h:
14151 (WTF::ThreadSpecific::ThreadSpecific):
14152 (WTF::ThreadSpecific::~ThreadSpecific):
14153 (WTF::ThreadSpecific::get):
14154 (WTF::ThreadSpecific::set):
14155 (WTF::ThreadSpecific::destroy):
14156 * wtf/ThreadSpecificWin.cpp: Added.
14157 (WTF::ThreadSpecificThreadExit):
14158 * wtf/ThreadingWin.cpp:
14159 (WTF::wtfThreadEntryPoint):
14161 2009-01-08 Justin McPherson <justin.mcpherson@nokia.com>
14163 Reviewed by Simon Hausmann.
14165 Fix compilation with Qt on NetBSD.
14167 * runtime/Collector.cpp:
14168 (JSC::currentThreadStackBase): Use PLATFORM(NETBSD) to enter the
14169 code path to retrieve the stack base using pthread_attr_get_np.
14170 The PTHREAD_NP_H define is not used because the header file does
14171 not exist on NetBSD, but the function is declared nevertheless.
14172 * wtf/Platform.h: Introduce WTF_PLATFORM_NETBSD.
14174 2009-01-07 Sam Weinig <sam@webkit.org>
14176 Reviewed by Geoffrey Garen.
14178 <rdar://problem/6469060> Don't store exception information for a CodeBlock until first exception is thrown
14180 Don't initially store exception information (lineNumber/expressionRange/getByIdExcecptionInfo)
14181 in CodeBlocks blocks. Instead, re-parse for the data on demand and cache it then.
14183 One important change that was needed to make this work was to pad op_get_global_var with nops to
14184 be the same length as op_resolve_global, since one could be replaced for the other on re-parsing,
14185 and we want to keep the offsets bytecode offsets the same.
14187 1.3MB improvement on Membuster head.
14189 * bytecode/CodeBlock.cpp:
14190 (JSC::CodeBlock::dump): Update op_get_global_var to account for the padding.
14191 (JSC::CodeBlock::dumpStatistics): Add more statistic dumping.
14192 (JSC::CodeBlock::CodeBlock): Initialize m_exceptionInfo.
14193 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): Re-parses the CodeBlocks
14194 associated SourceCode and steals the ExceptionInfo from it.
14195 (JSC::CodeBlock::lineNumberForBytecodeOffset): Creates the exception info on demand.
14196 (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
14197 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
14198 * bytecode/CodeBlock.h:
14199 (JSC::CodeBlock::numberOfExceptionHandlers): Updated to account for m_exceptionInfo indirection.
14200 (JSC::CodeBlock::addExceptionHandler): Ditto.
14201 (JSC::CodeBlock::exceptionHandler): Ditto.
14202 (JSC::CodeBlock::clearExceptionInfo): Ditto.
14203 (JSC::CodeBlock::addExpressionInfo): Ditto.
14204 (JSC::CodeBlock::addGetByIdExceptionInfo): Ditto.
14205 (JSC::CodeBlock::numberOfLineInfos): Ditto.
14206 (JSC::CodeBlock::addLineInfo): Ditto.
14207 (JSC::CodeBlock::lastLineInfo): Ditto.
14209 * bytecode/Opcode.h: Change length of op_get_global_var to match op_resolve_global.
14211 * bytecode/SamplingTool.cpp:
14212 (JSC::SamplingTool::dump): Add comment indicating why it is okay not to pass a CallFrame.
14214 * bytecompiler/BytecodeGenerator.cpp:
14215 (JSC::BytecodeGenerator::generate): Clear the exception info after generation for Function and Eval
14216 Code when not in regenerate for exception info mode.
14217 (JSC::BytecodeGenerator::BytecodeGenerator): Initialize m_regeneratingForExceptionInfo to false.
14218 (JSC::BytecodeGenerator::emitGetScopedVar): Pad op_get_global_var with 2 nops.
14219 * bytecompiler/BytecodeGenerator.h:
14220 (JSC::BytecodeGenerator::setRegeneratingForExcpeptionInfo): Added.
14222 * interpreter/Interpreter.cpp:
14223 (JSC::Interpreter::throwException): Pass the CallFrame to exception info accessors.
14224 (JSC::Interpreter::privateExecute): Ditto.
14225 (JSC::Interpreter::retrieveLastCaller): Ditto.
14226 (JSC::Interpreter::cti_op_new_error): Ditto.
14229 (JSC::JIT::privateCompileMainPass): Pass the current bytecode offset instead of hard coding the
14230 line number, the stub will do the accessing if it gets called.
14232 * parser/Nodes.cpp:
14233 (JSC::ProgramNode::emitBytecode): Moved.
14234 (JSC::ProgramNode::generateBytecode): Moved.
14235 (JSC::EvalNode::create): Moved.
14236 (JSC::EvalNode::bytecodeForExceptionInfoReparse): Added.
14237 (JSC::FunctionBodyNode::generateBytecode): Rename reparse to reparseInPlace.
14238 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse): Addded.
14241 (JSC::ScopeNode::features): Added getter.
14242 * parser/Parser.cpp:
14243 (JSC::Parser::reparseInPlace): Renamed from reparse.
14245 (JSC::Parser::reparse): Added. Re-parses the passed in Node into
14247 * runtime/ExceptionHelpers.cpp:
14248 (JSC::createUndefinedVariableError): Pass along CallFrame.
14249 (JSC::createInvalidParamError): Ditto.
14250 (JSC::createNotAConstructorError): Ditto.
14251 (JSC::createNotAFunctionError): Ditto.
14252 (JSC::createNotAnObjectError): Ditto.
14254 2009-01-06 Gavin Barraclough <baraclough@apple.com>
14256 Reviewed by Maciej Stachowiak.
14258 Replace accidentally removed references in BytecodeGenerator, deleting these
14259 will be hindering the sharing of constant numbers and strings.
14261 The code to add a new constant (either number or string) to their respective
14262 map works by attempting to add a null entry, then checking the result of the
14263 add for null. The first time, this should return the null (or noValue).
14264 The code checks for null (to see if this is the initial add), and then allocates
14265 a new number / string object. This code relies on the result returned from
14266 the add to the map being stored as a reference, such that the allocated object
14267 will be stored in the map, and will be resused if the same constant is encountered
14268 again. By failing to use a reference we will be leaking GC object for each
14269 additional entry added to the map. As GC objects they should be clollected,
14270 be we should no be allocatin them in the first place.
14272 https://bugs.webkit.org/show_bug.cgi?id=23158
14274 * bytecompiler/BytecodeGenerator.cpp:
14275 (JSC::BytecodeGenerator::emitLoad):
14277 2009-01-06 Oliver Hunt <oliver@apple.com>
14279 Reviewed by Gavin Barraclough.
14281 <rdar://problem/6040850> JavaScript register file should use VirtualAlloc on Windows
14283 Fairly simple, just reserve 4Mb of address space for the
14284 register file, and then commit one section at a time. We
14285 don't release committed memory as we drop back, but then
14286 mac doesn't either so this probably not too much of a
14289 * interpreter/RegisterFile.cpp:
14290 (JSC::RegisterFile::~RegisterFile):
14291 * interpreter/RegisterFile.h:
14292 (JSC::RegisterFile::RegisterFile):
14293 (JSC::RegisterFile::grow):
14295 2009-01-06 Alexey Proskuryakov <ap@webkit.org>
14297 Reviewed by Darin Adler.
14299 https://bugs.webkit.org/show_bug.cgi?id=23142
14300 ThreadGlobalData leaks seen on buildbot
14302 * wtf/ThreadSpecific.h: (WTF::ThreadSpecific::destroy): Temporarily reset the thread
14303 specific value to make getter work on Mac OS X.
14305 * wtf/Platform.h: Touch this file again to make sure all Windows builds use the most recent
14306 version of ThreadSpecific.h.
14308 2009-01-05 Gavin Barraclough <baraclough@apple.com>
14310 Reviewed by Oliver Hunt.
14312 Replace all uses of JSValue* with a new smart pointer type, JSValuePtr.
14314 A JavaScript value may be a heap object or boxed primitive, represented by a
14315 pointer, or may be an unboxed immediate value, such as an integer. Since a
14316 value may dynamically need to contain either a pointer value or an immediate,
14317 we encode immediates as pointer values (since all valid JSCell pointers are
14318 allocated at alligned addesses, unaligned addresses are available to encode
14319 immediates). As such all JavaScript values are represented using a JSValue*.
14321 This implementation is encumbered by a number of constraints. It ties the
14322 JSValue representation to the size of pointer on the platform, which, for
14323 example, means that we currently can represent different ranges of integers
14324 as immediates on x86 and x86-64. It also prevents us from overloading the
14325 to-boolean conversion used to test for noValue() - effectively forcing us
14326 to represent noValue() as 0. This would potentially be problematic were we
14327 to wish to encode integer values differently (e.g. were we to use the v8
14328 encoding, where pointers are tagged with 1 and integers with 0, then the
14329 immediate integer 0 would conflict with noValue()).
14331 This patch replaces all usage of JSValue* with a new class, JSValuePtr,
14332 which encapsulates the pointer. JSValuePtr maintains the same interface as
14333 JSValue*, overloading operator-> and operator bool such that previous
14334 operations in the code on variables of type JSValue* are still supported.
14336 In order to provide a ProtectPtr<> type with support for the new value
14337 representation (without using the internal JSValue type directly), a new
14338 ProtectJSValuePtr type has been added, equivalent to the previous type
14339 ProtectPtr<JSValue>.
14341 This patch is likely the first in a sequence of three changes. With the
14342 value now encapsulated it will likely make sense to migrate the functionality
14343 from JSValue into JSValuePtr, such that the internal pointer representation
14344 need not be exposed. Through migrating the functionality to the wrapper
14345 class the existing JSValue should be rendered redundant, and the class is
14346 likely to be removed (the JSValuePtr now wrapping a pointer to a JSCell).
14347 At this stage it will likely make sense to rename JSValuePtr to JSValue.
14349 https://bugs.webkit.org/show_bug.cgi?id=23114
14355 (JSEvaluateScript):
14356 * API/JSCallbackConstructor.h:
14357 (JSC::JSCallbackConstructor::createStructure):
14358 * API/JSCallbackFunction.cpp:
14359 (JSC::JSCallbackFunction::call):
14360 * API/JSCallbackFunction.h:
14361 (JSC::JSCallbackFunction::createStructure):
14362 * API/JSCallbackObject.h:
14363 (JSC::JSCallbackObject::createStructure):
14364 * API/JSCallbackObjectFunctions.h:
14365 (JSC::::asCallbackObject):
14367 (JSC::::hasInstance):
14369 (JSC::::staticValueGetter):
14370 (JSC::::staticFunctionGetter):
14371 (JSC::::callbackGetter):
14372 * API/JSContextRef.cpp:
14373 * API/JSObjectRef.cpp:
14374 (JSObjectMakeConstructor):
14375 (JSObjectSetPrototype):
14376 (JSObjectGetProperty):
14377 (JSObjectSetProperty):
14378 (JSObjectGetPropertyAtIndex):
14379 (JSObjectSetPropertyAtIndex):
14380 * API/JSValueRef.cpp:
14382 (JSValueIsUndefined):
14384 (JSValueIsBoolean):
14388 (JSValueIsObjectOfClass):
14390 (JSValueIsStrictEqual):
14391 (JSValueIsInstanceOfConstructor):
14392 (JSValueToBoolean):
14394 (JSValueToStringCopy):
14397 (JSValueUnprotect):
14398 * JavaScriptCore.exp:
14399 * bytecode/CodeBlock.cpp:
14400 (JSC::valueToSourceString):
14401 (JSC::constantName):
14402 (JSC::CodeBlock::dump):
14403 * bytecode/CodeBlock.h:
14404 (JSC::CodeBlock::getConstant):
14405 (JSC::CodeBlock::addUnexpectedConstant):
14406 (JSC::CodeBlock::unexpectedConstant):
14407 * bytecode/EvalCodeCache.h:
14408 (JSC::EvalCodeCache::get):
14409 * bytecompiler/BytecodeGenerator.cpp:
14410 (JSC::BytecodeGenerator::BytecodeGenerator):
14411 (JSC::BytecodeGenerator::addConstant):
14412 (JSC::BytecodeGenerator::addUnexpectedConstant):
14413 (JSC::BytecodeGenerator::emitLoad):
14414 (JSC::BytecodeGenerator::emitLoadJSV):
14415 (JSC::BytecodeGenerator::emitGetScopedVar):
14416 (JSC::BytecodeGenerator::emitPutScopedVar):
14417 (JSC::BytecodeGenerator::emitNewError):
14418 (JSC::keyForImmediateSwitch):
14419 * bytecompiler/BytecodeGenerator.h:
14420 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
14421 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
14422 * debugger/DebuggerCallFrame.cpp:
14423 (JSC::DebuggerCallFrame::evaluate):
14424 * debugger/DebuggerCallFrame.h:
14425 (JSC::DebuggerCallFrame::DebuggerCallFrame):
14426 (JSC::DebuggerCallFrame::exception):
14427 * interpreter/CallFrame.cpp:
14428 (JSC::CallFrame::thisValue):
14429 * interpreter/CallFrame.h:
14430 (JSC::ExecState::setException):
14431 (JSC::ExecState::exception):
14432 (JSC::ExecState::exceptionSlot):
14433 (JSC::ExecState::hadException):
14434 * interpreter/Interpreter.cpp:
14435 (JSC::fastIsNumber):
14436 (JSC::fastToInt32):
14437 (JSC::fastToUInt32):
14440 (JSC::jsAddSlowCase):
14442 (JSC::jsTypeStringForValue):
14443 (JSC::jsIsObjectType):
14444 (JSC::jsIsFunctionType):
14445 (JSC::Interpreter::resolve):
14446 (JSC::Interpreter::resolveSkip):
14447 (JSC::Interpreter::resolveGlobal):
14448 (JSC::inlineResolveBase):
14449 (JSC::Interpreter::resolveBase):
14450 (JSC::Interpreter::resolveBaseAndProperty):
14451 (JSC::Interpreter::resolveBaseAndFunc):
14452 (JSC::isNotObject):
14453 (JSC::Interpreter::callEval):
14454 (JSC::Interpreter::unwindCallFrame):
14455 (JSC::Interpreter::throwException):
14456 (JSC::Interpreter::execute):
14457 (JSC::Interpreter::checkTimeout):
14458 (JSC::Interpreter::createExceptionScope):
14459 (JSC::cachePrototypeChain):
14460 (JSC::Interpreter::tryCachePutByID):
14461 (JSC::countPrototypeChainEntriesAndCheckForProxies):
14462 (JSC::Interpreter::tryCacheGetByID):
14463 (JSC::Interpreter::privateExecute):
14464 (JSC::Interpreter::retrieveArguments):
14465 (JSC::Interpreter::retrieveCaller):
14466 (JSC::Interpreter::retrieveLastCaller):
14467 (JSC::Interpreter::tryCTICachePutByID):
14468 (JSC::Interpreter::tryCTICacheGetByID):
14469 (JSC::returnToThrowTrampoline):
14470 (JSC::Interpreter::cti_op_convert_this):
14471 (JSC::Interpreter::cti_op_add):
14472 (JSC::Interpreter::cti_op_pre_inc):
14473 (JSC::Interpreter::cti_op_loop_if_less):
14474 (JSC::Interpreter::cti_op_loop_if_lesseq):
14475 (JSC::Interpreter::cti_op_get_by_id_generic):
14476 (JSC::Interpreter::cti_op_get_by_id):
14477 (JSC::Interpreter::cti_op_get_by_id_second):
14478 (JSC::Interpreter::cti_op_get_by_id_self_fail):
14479 (JSC::Interpreter::cti_op_get_by_id_proto_list):
14480 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
14481 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
14482 (JSC::Interpreter::cti_op_get_by_id_array_fail):
14483 (JSC::Interpreter::cti_op_get_by_id_string_fail):
14484 (JSC::Interpreter::cti_op_instanceof):
14485 (JSC::Interpreter::cti_op_del_by_id):
14486 (JSC::Interpreter::cti_op_mul):
14487 (JSC::Interpreter::cti_op_call_NotJSFunction):
14488 (JSC::Interpreter::cti_op_resolve):
14489 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
14490 (JSC::Interpreter::cti_op_get_by_val):
14491 (JSC::Interpreter::cti_op_resolve_func):
14492 (JSC::Interpreter::cti_op_sub):
14493 (JSC::Interpreter::cti_op_put_by_val):
14494 (JSC::Interpreter::cti_op_put_by_val_array):
14495 (JSC::Interpreter::cti_op_lesseq):
14496 (JSC::Interpreter::cti_op_loop_if_true):
14497 (JSC::Interpreter::cti_op_negate):
14498 (JSC::Interpreter::cti_op_resolve_base):
14499 (JSC::Interpreter::cti_op_resolve_skip):
14500 (JSC::Interpreter::cti_op_resolve_global):
14501 (JSC::Interpreter::cti_op_div):
14502 (JSC::Interpreter::cti_op_pre_dec):
14503 (JSC::Interpreter::cti_op_jless):
14504 (JSC::Interpreter::cti_op_not):
14505 (JSC::Interpreter::cti_op_jtrue):
14506 (JSC::Interpreter::cti_op_post_inc):
14507 (JSC::Interpreter::cti_op_eq):
14508 (JSC::Interpreter::cti_op_lshift):
14509 (JSC::Interpreter::cti_op_bitand):
14510 (JSC::Interpreter::cti_op_rshift):
14511 (JSC::Interpreter::cti_op_bitnot):
14512 (JSC::Interpreter::cti_op_resolve_with_base):
14513 (JSC::Interpreter::cti_op_mod):
14514 (JSC::Interpreter::cti_op_less):
14515 (JSC::Interpreter::cti_op_neq):
14516 (JSC::Interpreter::cti_op_post_dec):
14517 (JSC::Interpreter::cti_op_urshift):
14518 (JSC::Interpreter::cti_op_bitxor):
14519 (JSC::Interpreter::cti_op_bitor):
14520 (JSC::Interpreter::cti_op_call_eval):
14521 (JSC::Interpreter::cti_op_throw):
14522 (JSC::Interpreter::cti_op_next_pname):
14523 (JSC::Interpreter::cti_op_typeof):
14524 (JSC::Interpreter::cti_op_is_undefined):
14525 (JSC::Interpreter::cti_op_is_boolean):
14526 (JSC::Interpreter::cti_op_is_number):
14527 (JSC::Interpreter::cti_op_is_string):
14528 (JSC::Interpreter::cti_op_is_object):
14529 (JSC::Interpreter::cti_op_is_function):
14530 (JSC::Interpreter::cti_op_stricteq):
14531 (JSC::Interpreter::cti_op_nstricteq):
14532 (JSC::Interpreter::cti_op_to_jsnumber):
14533 (JSC::Interpreter::cti_op_in):
14534 (JSC::Interpreter::cti_op_switch_imm):
14535 (JSC::Interpreter::cti_op_switch_char):
14536 (JSC::Interpreter::cti_op_switch_string):
14537 (JSC::Interpreter::cti_op_del_by_val):
14538 (JSC::Interpreter::cti_op_new_error):
14539 (JSC::Interpreter::cti_vm_throw):
14540 * interpreter/Interpreter.h:
14541 (JSC::Interpreter::isJSArray):
14542 (JSC::Interpreter::isJSString):
14543 * interpreter/Register.h:
14545 (JSC::Register::Register):
14546 (JSC::Register::jsValue):
14547 (JSC::Register::getJSValue):
14550 (JSC::JIT::compileOpStrictEq):
14551 (JSC::JIT::privateCompileMainPass):
14552 (JSC::JIT::privateCompileSlowCases):
14555 (JSC::JIT::execute):
14556 * jit/JITArithmetic.cpp:
14557 (JSC::JIT::compileFastArith_op_rshift):
14558 (JSC::JIT::compileFastArithSlow_op_rshift):
14560 (JSC::JIT::unlinkCall):
14561 (JSC::JIT::compileOpCallInitializeCallFrame):
14562 (JSC::JIT::compileOpCall):
14563 * jit/JITInlineMethods.h:
14564 (JSC::JIT::emitGetVirtualRegister):
14565 (JSC::JIT::getConstantOperand):
14566 (JSC::JIT::isOperandConstant31BitImmediateInt):
14567 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
14568 (JSC::JIT::emitInitRegister):
14569 * jit/JITPropertyAccess.cpp:
14570 (JSC::resizePropertyStorage):
14571 (JSC::JIT::privateCompilePutByIdTransition):
14572 (JSC::JIT::patchGetByIdSelf):
14573 (JSC::JIT::patchPutByIdReplace):
14574 (JSC::JIT::privateCompileGetByIdSelf):
14575 (JSC::JIT::privateCompileGetByIdProto):
14576 (JSC::JIT::privateCompileGetByIdSelfList):
14577 (JSC::JIT::privateCompileGetByIdProtoList):
14578 (JSC::JIT::privateCompileGetByIdChainList):
14579 (JSC::JIT::privateCompileGetByIdChain):
14580 (JSC::JIT::privateCompilePutByIdReplace):
14588 (functionReadline):
14590 * parser/Nodes.cpp:
14591 (JSC::NullNode::emitBytecode):
14592 (JSC::ArrayNode::emitBytecode):
14593 (JSC::FunctionCallValueNode::emitBytecode):
14594 (JSC::FunctionCallResolveNode::emitBytecode):
14595 (JSC::VoidNode::emitBytecode):
14596 (JSC::ConstDeclNode::emitCodeSingle):
14597 (JSC::ReturnNode::emitBytecode):
14598 (JSC::processClauseList):
14599 (JSC::EvalNode::emitBytecode):
14600 (JSC::FunctionBodyNode::emitBytecode):
14601 (JSC::ProgramNode::emitBytecode):
14602 * profiler/ProfileGenerator.cpp:
14603 (JSC::ProfileGenerator::addParentForConsoleStart):
14604 * profiler/Profiler.cpp:
14605 (JSC::Profiler::willExecute):
14606 (JSC::Profiler::didExecute):
14607 (JSC::Profiler::createCallIdentifier):
14608 * profiler/Profiler.h:
14609 * runtime/ArgList.cpp:
14610 (JSC::ArgList::slowAppend):
14611 * runtime/ArgList.h:
14612 (JSC::ArgList::at):
14613 (JSC::ArgList::append):
14614 * runtime/Arguments.cpp:
14615 (JSC::Arguments::put):
14616 * runtime/Arguments.h:
14617 (JSC::Arguments::createStructure):
14618 (JSC::asArguments):
14619 * runtime/ArrayConstructor.cpp:
14620 (JSC::callArrayConstructor):
14621 * runtime/ArrayPrototype.cpp:
14622 (JSC::getProperty):
14623 (JSC::putProperty):
14624 (JSC::arrayProtoFuncToString):
14625 (JSC::arrayProtoFuncToLocaleString):
14626 (JSC::arrayProtoFuncJoin):
14627 (JSC::arrayProtoFuncConcat):
14628 (JSC::arrayProtoFuncPop):
14629 (JSC::arrayProtoFuncPush):
14630 (JSC::arrayProtoFuncReverse):
14631 (JSC::arrayProtoFuncShift):
14632 (JSC::arrayProtoFuncSlice):
14633 (JSC::arrayProtoFuncSort):
14634 (JSC::arrayProtoFuncSplice):
14635 (JSC::arrayProtoFuncUnShift):
14636 (JSC::arrayProtoFuncFilter):
14637 (JSC::arrayProtoFuncMap):
14638 (JSC::arrayProtoFuncEvery):
14639 (JSC::arrayProtoFuncForEach):
14640 (JSC::arrayProtoFuncSome):
14641 (JSC::arrayProtoFuncIndexOf):
14642 (JSC::arrayProtoFuncLastIndexOf):
14643 * runtime/BooleanConstructor.cpp:
14644 (JSC::callBooleanConstructor):
14645 (JSC::constructBooleanFromImmediateBoolean):
14646 * runtime/BooleanConstructor.h:
14647 * runtime/BooleanObject.h:
14648 (JSC::asBooleanObject):
14649 * runtime/BooleanPrototype.cpp:
14650 (JSC::booleanProtoFuncToString):
14651 (JSC::booleanProtoFuncValueOf):
14652 * runtime/CallData.cpp:
14654 * runtime/CallData.h:
14655 * runtime/Collector.cpp:
14656 (JSC::Heap::protect):
14657 (JSC::Heap::unprotect):
14659 (JSC::Heap::collect):
14660 * runtime/Collector.h:
14661 * runtime/Completion.cpp:
14663 * runtime/Completion.h:
14664 (JSC::Completion::Completion):
14665 (JSC::Completion::value):
14666 (JSC::Completion::setValue):
14667 (JSC::Completion::isValueCompletion):
14668 * runtime/ConstructData.cpp:
14670 * runtime/ConstructData.h:
14671 * runtime/DateConstructor.cpp:
14672 (JSC::constructDate):
14677 * runtime/DateInstance.h:
14678 (JSC::asDateInstance):
14679 * runtime/DatePrototype.cpp:
14680 (JSC::dateProtoFuncToString):
14681 (JSC::dateProtoFuncToUTCString):
14682 (JSC::dateProtoFuncToDateString):
14683 (JSC::dateProtoFuncToTimeString):
14684 (JSC::dateProtoFuncToLocaleString):
14685 (JSC::dateProtoFuncToLocaleDateString):
14686 (JSC::dateProtoFuncToLocaleTimeString):
14687 (JSC::dateProtoFuncValueOf):
14688 (JSC::dateProtoFuncGetTime):
14689 (JSC::dateProtoFuncGetFullYear):
14690 (JSC::dateProtoFuncGetUTCFullYear):
14691 (JSC::dateProtoFuncToGMTString):
14692 (JSC::dateProtoFuncGetMonth):
14693 (JSC::dateProtoFuncGetUTCMonth):
14694 (JSC::dateProtoFuncGetDate):
14695 (JSC::dateProtoFuncGetUTCDate):
14696 (JSC::dateProtoFuncGetDay):
14697 (JSC::dateProtoFuncGetUTCDay):
14698 (JSC::dateProtoFuncGetHours):
14699 (JSC::dateProtoFuncGetUTCHours):
14700 (JSC::dateProtoFuncGetMinutes):
14701 (JSC::dateProtoFuncGetUTCMinutes):
14702 (JSC::dateProtoFuncGetSeconds):
14703 (JSC::dateProtoFuncGetUTCSeconds):
14704 (JSC::dateProtoFuncGetMilliSeconds):
14705 (JSC::dateProtoFuncGetUTCMilliseconds):
14706 (JSC::dateProtoFuncGetTimezoneOffset):
14707 (JSC::dateProtoFuncSetTime):
14708 (JSC::setNewValueFromTimeArgs):
14709 (JSC::setNewValueFromDateArgs):
14710 (JSC::dateProtoFuncSetMilliSeconds):
14711 (JSC::dateProtoFuncSetUTCMilliseconds):
14712 (JSC::dateProtoFuncSetSeconds):
14713 (JSC::dateProtoFuncSetUTCSeconds):
14714 (JSC::dateProtoFuncSetMinutes):
14715 (JSC::dateProtoFuncSetUTCMinutes):
14716 (JSC::dateProtoFuncSetHours):
14717 (JSC::dateProtoFuncSetUTCHours):
14718 (JSC::dateProtoFuncSetDate):
14719 (JSC::dateProtoFuncSetUTCDate):
14720 (JSC::dateProtoFuncSetMonth):
14721 (JSC::dateProtoFuncSetUTCMonth):
14722 (JSC::dateProtoFuncSetFullYear):
14723 (JSC::dateProtoFuncSetUTCFullYear):
14724 (JSC::dateProtoFuncSetYear):
14725 (JSC::dateProtoFuncGetYear):
14726 * runtime/DatePrototype.h:
14727 (JSC::DatePrototype::createStructure):
14728 * runtime/ErrorConstructor.cpp:
14729 (JSC::callErrorConstructor):
14730 * runtime/ErrorPrototype.cpp:
14731 (JSC::errorProtoFuncToString):
14732 * runtime/ExceptionHelpers.cpp:
14733 (JSC::createInterruptedExecutionException):
14734 (JSC::createError):
14735 (JSC::createStackOverflowError):
14736 (JSC::createUndefinedVariableError):
14737 (JSC::createErrorMessage):
14738 (JSC::createInvalidParamError):
14739 (JSC::createNotAConstructorError):
14740 (JSC::createNotAFunctionError):
14741 * runtime/ExceptionHelpers.h:
14742 * runtime/FunctionConstructor.cpp:
14743 (JSC::callFunctionConstructor):
14744 * runtime/FunctionPrototype.cpp:
14745 (JSC::callFunctionPrototype):
14746 (JSC::functionProtoFuncToString):
14747 (JSC::functionProtoFuncApply):
14748 (JSC::functionProtoFuncCall):
14749 * runtime/FunctionPrototype.h:
14750 (JSC::FunctionPrototype::createStructure):
14751 * runtime/GetterSetter.cpp:
14752 (JSC::GetterSetter::toPrimitive):
14753 (JSC::GetterSetter::getPrimitiveNumber):
14754 * runtime/GetterSetter.h:
14755 (JSC::asGetterSetter):
14756 * runtime/InitializeThreading.cpp:
14757 * runtime/InternalFunction.h:
14758 (JSC::InternalFunction::createStructure):
14759 (JSC::asInternalFunction):
14760 * runtime/JSActivation.cpp:
14761 (JSC::JSActivation::getOwnPropertySlot):
14762 (JSC::JSActivation::put):
14763 (JSC::JSActivation::putWithAttributes):
14764 (JSC::JSActivation::argumentsGetter):
14765 * runtime/JSActivation.h:
14766 (JSC::JSActivation::createStructure):
14767 (JSC::asActivation):
14768 * runtime/JSArray.cpp:
14769 (JSC::storageSize):
14770 (JSC::JSArray::JSArray):
14771 (JSC::JSArray::getOwnPropertySlot):
14772 (JSC::JSArray::put):
14773 (JSC::JSArray::putSlowCase):
14774 (JSC::JSArray::deleteProperty):
14775 (JSC::JSArray::getPropertyNames):
14776 (JSC::JSArray::setLength):
14777 (JSC::JSArray::pop):
14778 (JSC::JSArray::push):
14779 (JSC::JSArray::mark):
14780 (JSC::JSArray::sort):
14781 (JSC::JSArray::compactForSorting):
14782 (JSC::JSArray::checkConsistency):
14783 (JSC::constructArray):
14784 * runtime/JSArray.h:
14785 (JSC::JSArray::getIndex):
14786 (JSC::JSArray::setIndex):
14787 (JSC::JSArray::createStructure):
14789 * runtime/JSCell.cpp:
14790 (JSC::JSCell::put):
14791 (JSC::JSCell::getJSNumber):
14792 * runtime/JSCell.h:
14794 (JSC::JSValue::asCell):
14795 (JSC::JSValue::toPrimitive):
14796 (JSC::JSValue::getPrimitiveNumber):
14797 (JSC::JSValue::getJSNumber):
14798 * runtime/JSFunction.cpp:
14799 (JSC::JSFunction::call):
14800 (JSC::JSFunction::argumentsGetter):
14801 (JSC::JSFunction::callerGetter):
14802 (JSC::JSFunction::lengthGetter):
14803 (JSC::JSFunction::getOwnPropertySlot):
14804 (JSC::JSFunction::put):
14805 (JSC::JSFunction::construct):
14806 * runtime/JSFunction.h:
14807 (JSC::JSFunction::createStructure):
14809 * runtime/JSGlobalData.h:
14810 * runtime/JSGlobalObject.cpp:
14811 (JSC::markIfNeeded):
14812 (JSC::JSGlobalObject::put):
14813 (JSC::JSGlobalObject::putWithAttributes):
14814 (JSC::JSGlobalObject::reset):
14815 (JSC::JSGlobalObject::resetPrototype):
14816 * runtime/JSGlobalObject.h:
14817 (JSC::JSGlobalObject::createStructure):
14818 (JSC::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo):
14819 (JSC::asGlobalObject):
14820 (JSC::Structure::prototypeForLookup):
14821 * runtime/JSGlobalObjectFunctions.cpp:
14824 (JSC::globalFuncEval):
14825 (JSC::globalFuncParseInt):
14826 (JSC::globalFuncParseFloat):
14827 (JSC::globalFuncIsNaN):
14828 (JSC::globalFuncIsFinite):
14829 (JSC::globalFuncDecodeURI):
14830 (JSC::globalFuncDecodeURIComponent):
14831 (JSC::globalFuncEncodeURI):
14832 (JSC::globalFuncEncodeURIComponent):
14833 (JSC::globalFuncEscape):
14834 (JSC::globalFuncUnescape):
14835 (JSC::globalFuncJSCPrint):
14836 * runtime/JSGlobalObjectFunctions.h:
14837 * runtime/JSImmediate.cpp:
14838 (JSC::JSImmediate::toThisObject):
14839 (JSC::JSImmediate::toObject):
14840 (JSC::JSImmediate::prototype):
14841 (JSC::JSImmediate::toString):
14842 * runtime/JSImmediate.h:
14843 (JSC::JSImmediate::isImmediate):
14844 (JSC::JSImmediate::isNumber):
14845 (JSC::JSImmediate::isPositiveNumber):
14846 (JSC::JSImmediate::isBoolean):
14847 (JSC::JSImmediate::isUndefinedOrNull):
14848 (JSC::JSImmediate::isNegative):
14849 (JSC::JSImmediate::isEitherImmediate):
14850 (JSC::JSImmediate::isAnyImmediate):
14851 (JSC::JSImmediate::areBothImmediate):
14852 (JSC::JSImmediate::areBothImmediateNumbers):
14853 (JSC::JSImmediate::andImmediateNumbers):
14854 (JSC::JSImmediate::xorImmediateNumbers):
14855 (JSC::JSImmediate::orImmediateNumbers):
14856 (JSC::JSImmediate::rightShiftImmediateNumbers):
14857 (JSC::JSImmediate::canDoFastAdditiveOperations):
14858 (JSC::JSImmediate::addImmediateNumbers):
14859 (JSC::JSImmediate::subImmediateNumbers):
14860 (JSC::JSImmediate::incImmediateNumber):
14861 (JSC::JSImmediate::decImmediateNumber):
14862 (JSC::JSImmediate::makeValue):
14863 (JSC::JSImmediate::makeInt):
14864 (JSC::JSImmediate::makeBool):
14865 (JSC::JSImmediate::makeUndefined):
14866 (JSC::JSImmediate::makeNull):
14867 (JSC::JSImmediate::intValue):
14868 (JSC::JSImmediate::uintValue):
14869 (JSC::JSImmediate::boolValue):
14870 (JSC::JSImmediate::rawValue):
14871 (JSC::JSImmediate::trueImmediate):
14872 (JSC::JSImmediate::falseImmediate):
14873 (JSC::JSImmediate::undefinedImmediate):
14874 (JSC::JSImmediate::nullImmediate):
14875 (JSC::JSImmediate::zeroImmediate):
14876 (JSC::JSImmediate::oneImmediate):
14877 (JSC::JSImmediate::impossibleValue):
14878 (JSC::JSImmediate::toBoolean):
14879 (JSC::JSImmediate::getTruncatedUInt32):
14880 (JSC::JSImmediate::from):
14881 (JSC::JSImmediate::getTruncatedInt32):
14882 (JSC::JSImmediate::toDouble):
14883 (JSC::JSImmediate::getUInt32):
14886 (JSC::jsUndefined):
14887 (JSC::JSValue::isUndefined):
14888 (JSC::JSValue::isNull):
14889 (JSC::JSValue::isUndefinedOrNull):
14890 (JSC::JSValue::isBoolean):
14891 (JSC::JSValue::getBoolean):
14892 (JSC::JSValue::toInt32):
14893 (JSC::JSValue::toUInt32):
14896 * runtime/JSNotAnObject.cpp:
14897 (JSC::JSNotAnObject::toPrimitive):
14898 (JSC::JSNotAnObject::getPrimitiveNumber):
14899 (JSC::JSNotAnObject::put):
14900 * runtime/JSNotAnObject.h:
14901 (JSC::JSNotAnObject::createStructure):
14902 * runtime/JSNumberCell.cpp:
14903 (JSC::JSNumberCell::toPrimitive):
14904 (JSC::JSNumberCell::getPrimitiveNumber):
14905 (JSC::JSNumberCell::getJSNumber):
14906 (JSC::jsNumberCell):
14908 * runtime/JSNumberCell.h:
14909 (JSC::JSNumberCell::createStructure):
14910 (JSC::asNumberCell):
14912 (JSC::JSValue::toJSNumber):
14913 * runtime/JSObject.cpp:
14914 (JSC::JSObject::mark):
14915 (JSC::JSObject::put):
14916 (JSC::JSObject::putWithAttributes):
14917 (JSC::callDefaultValueFunction):
14918 (JSC::JSObject::getPrimitiveNumber):
14919 (JSC::JSObject::defaultValue):
14920 (JSC::JSObject::defineGetter):
14921 (JSC::JSObject::defineSetter):
14922 (JSC::JSObject::lookupGetter):
14923 (JSC::JSObject::lookupSetter):
14924 (JSC::JSObject::hasInstance):
14925 (JSC::JSObject::toNumber):
14926 (JSC::JSObject::toString):
14927 (JSC::JSObject::fillGetterPropertySlot):
14928 * runtime/JSObject.h:
14929 (JSC::JSObject::getDirect):
14930 (JSC::JSObject::getDirectLocation):
14931 (JSC::JSObject::offsetForLocation):
14932 (JSC::JSObject::locationForOffset):
14933 (JSC::JSObject::getDirectOffset):
14934 (JSC::JSObject::putDirectOffset):
14935 (JSC::JSObject::createStructure):
14937 (JSC::JSObject::prototype):
14938 (JSC::JSObject::setPrototype):
14939 (JSC::JSObject::inlineGetOwnPropertySlot):
14940 (JSC::JSObject::getOwnPropertySlotForWrite):
14941 (JSC::JSObject::getPropertySlot):
14942 (JSC::JSObject::get):
14943 (JSC::JSObject::putDirect):
14944 (JSC::JSObject::putDirectWithoutTransition):
14945 (JSC::JSObject::toPrimitive):
14946 (JSC::JSValue::get):
14947 (JSC::JSValue::put):
14948 (JSC::JSObject::allocatePropertyStorageInline):
14949 * runtime/JSPropertyNameIterator.cpp:
14950 (JSC::JSPropertyNameIterator::toPrimitive):
14951 (JSC::JSPropertyNameIterator::getPrimitiveNumber):
14952 * runtime/JSPropertyNameIterator.h:
14953 (JSC::JSPropertyNameIterator::create):
14954 (JSC::JSPropertyNameIterator::next):
14955 * runtime/JSStaticScopeObject.cpp:
14956 (JSC::JSStaticScopeObject::put):
14957 (JSC::JSStaticScopeObject::putWithAttributes):
14958 * runtime/JSStaticScopeObject.h:
14959 (JSC::JSStaticScopeObject::JSStaticScopeObject):
14960 (JSC::JSStaticScopeObject::createStructure):
14961 * runtime/JSString.cpp:
14962 (JSC::JSString::toPrimitive):
14963 (JSC::JSString::getPrimitiveNumber):
14964 (JSC::JSString::getOwnPropertySlot):
14965 * runtime/JSString.h:
14966 (JSC::JSString::createStructure):
14968 * runtime/JSValue.h:
14969 (JSC::JSValuePtr::makeImmediate):
14970 (JSC::JSValuePtr::immediateValue):
14971 (JSC::JSValuePtr::JSValuePtr):
14972 (JSC::JSValuePtr::operator->):
14973 (JSC::JSValuePtr::hasValue):
14974 (JSC::JSValuePtr::operator==):
14975 (JSC::JSValuePtr::operator!=):
14976 (JSC::JSValuePtr::encode):
14977 (JSC::JSValuePtr::decode):
14978 (JSC::JSValue::asValue):
14982 * runtime/JSVariableObject.h:
14983 (JSC::JSVariableObject::symbolTablePut):
14984 (JSC::JSVariableObject::symbolTablePutWithAttributes):
14985 * runtime/JSWrapperObject.cpp:
14986 (JSC::JSWrapperObject::mark):
14987 * runtime/JSWrapperObject.h:
14988 (JSC::JSWrapperObject::internalValue):
14989 (JSC::JSWrapperObject::setInternalValue):
14990 * runtime/Lookup.cpp:
14991 (JSC::setUpStaticFunctionSlot):
14992 * runtime/Lookup.h:
14994 * runtime/MathObject.cpp:
14995 (JSC::mathProtoFuncAbs):
14996 (JSC::mathProtoFuncACos):
14997 (JSC::mathProtoFuncASin):
14998 (JSC::mathProtoFuncATan):
14999 (JSC::mathProtoFuncATan2):
15000 (JSC::mathProtoFuncCeil):
15001 (JSC::mathProtoFuncCos):
15002 (JSC::mathProtoFuncExp):
15003 (JSC::mathProtoFuncFloor):
15004 (JSC::mathProtoFuncLog):
15005 (JSC::mathProtoFuncMax):
15006 (JSC::mathProtoFuncMin):
15007 (JSC::mathProtoFuncPow):
15008 (JSC::mathProtoFuncRandom):
15009 (JSC::mathProtoFuncRound):
15010 (JSC::mathProtoFuncSin):
15011 (JSC::mathProtoFuncSqrt):
15012 (JSC::mathProtoFuncTan):
15013 * runtime/MathObject.h:
15014 (JSC::MathObject::createStructure):
15015 * runtime/NativeErrorConstructor.cpp:
15016 (JSC::callNativeErrorConstructor):
15017 * runtime/NumberConstructor.cpp:
15018 (JSC::numberConstructorNaNValue):
15019 (JSC::numberConstructorNegInfinity):
15020 (JSC::numberConstructorPosInfinity):
15021 (JSC::numberConstructorMaxValue):
15022 (JSC::numberConstructorMinValue):
15023 (JSC::callNumberConstructor):
15024 * runtime/NumberConstructor.h:
15025 (JSC::NumberConstructor::createStructure):
15026 * runtime/NumberObject.cpp:
15027 (JSC::NumberObject::getJSNumber):
15028 (JSC::constructNumberFromImmediateNumber):
15029 * runtime/NumberObject.h:
15030 * runtime/NumberPrototype.cpp:
15031 (JSC::numberProtoFuncToString):
15032 (JSC::numberProtoFuncToLocaleString):
15033 (JSC::numberProtoFuncValueOf):
15034 (JSC::numberProtoFuncToFixed):
15035 (JSC::numberProtoFuncToExponential):
15036 (JSC::numberProtoFuncToPrecision):
15037 * runtime/ObjectConstructor.cpp:
15038 (JSC::constructObject):
15039 (JSC::callObjectConstructor):
15040 * runtime/ObjectPrototype.cpp:
15041 (JSC::objectProtoFuncValueOf):
15042 (JSC::objectProtoFuncHasOwnProperty):
15043 (JSC::objectProtoFuncIsPrototypeOf):
15044 (JSC::objectProtoFuncDefineGetter):
15045 (JSC::objectProtoFuncDefineSetter):
15046 (JSC::objectProtoFuncLookupGetter):
15047 (JSC::objectProtoFuncLookupSetter):
15048 (JSC::objectProtoFuncPropertyIsEnumerable):
15049 (JSC::objectProtoFuncToLocaleString):
15050 (JSC::objectProtoFuncToString):
15051 * runtime/ObjectPrototype.h:
15052 * runtime/Operations.cpp:
15054 (JSC::equalSlowCase):
15055 (JSC::strictEqual):
15056 (JSC::strictEqualSlowCase):
15057 (JSC::throwOutOfMemoryError):
15058 * runtime/Operations.h:
15059 (JSC::equalSlowCaseInline):
15060 (JSC::strictEqualSlowCaseInline):
15061 * runtime/PropertySlot.cpp:
15062 (JSC::PropertySlot::functionGetter):
15063 * runtime/PropertySlot.h:
15064 (JSC::PropertySlot::PropertySlot):
15065 (JSC::PropertySlot::getValue):
15066 (JSC::PropertySlot::putValue):
15067 (JSC::PropertySlot::setValueSlot):
15068 (JSC::PropertySlot::setValue):
15069 (JSC::PropertySlot::setCustom):
15070 (JSC::PropertySlot::setCustomIndex):
15071 (JSC::PropertySlot::slotBase):
15072 (JSC::PropertySlot::setBase):
15073 (JSC::PropertySlot::):
15074 * runtime/Protect.h:
15076 (JSC::gcUnprotect):
15077 (JSC::ProtectedPtr::ProtectedPtr):
15078 (JSC::ProtectedPtr::operator JSValuePtr):
15079 (JSC::ProtectedJSValuePtr::ProtectedJSValuePtr):
15080 (JSC::ProtectedJSValuePtr::get):
15081 (JSC::ProtectedJSValuePtr::operator JSValuePtr):
15082 (JSC::ProtectedJSValuePtr::operator->):
15083 (JSC::::ProtectedPtr):
15084 (JSC::::~ProtectedPtr):
15086 (JSC::ProtectedJSValuePtr::~ProtectedJSValuePtr):
15087 (JSC::ProtectedJSValuePtr::operator=):
15090 * runtime/RegExpConstructor.cpp:
15091 (JSC::RegExpConstructor::getBackref):
15092 (JSC::RegExpConstructor::getLastParen):
15093 (JSC::RegExpConstructor::getLeftContext):
15094 (JSC::RegExpConstructor::getRightContext):
15095 (JSC::regExpConstructorDollar1):
15096 (JSC::regExpConstructorDollar2):
15097 (JSC::regExpConstructorDollar3):
15098 (JSC::regExpConstructorDollar4):
15099 (JSC::regExpConstructorDollar5):
15100 (JSC::regExpConstructorDollar6):
15101 (JSC::regExpConstructorDollar7):
15102 (JSC::regExpConstructorDollar8):
15103 (JSC::regExpConstructorDollar9):
15104 (JSC::regExpConstructorInput):
15105 (JSC::regExpConstructorMultiline):
15106 (JSC::regExpConstructorLastMatch):
15107 (JSC::regExpConstructorLastParen):
15108 (JSC::regExpConstructorLeftContext):
15109 (JSC::regExpConstructorRightContext):
15110 (JSC::RegExpConstructor::put):
15111 (JSC::setRegExpConstructorInput):
15112 (JSC::setRegExpConstructorMultiline):
15113 (JSC::constructRegExp):
15114 (JSC::callRegExpConstructor):
15115 * runtime/RegExpConstructor.h:
15116 (JSC::RegExpConstructor::createStructure):
15117 (JSC::asRegExpConstructor):
15118 * runtime/RegExpMatchesArray.h:
15119 (JSC::RegExpMatchesArray::put):
15120 * runtime/RegExpObject.cpp:
15121 (JSC::regExpObjectGlobal):
15122 (JSC::regExpObjectIgnoreCase):
15123 (JSC::regExpObjectMultiline):
15124 (JSC::regExpObjectSource):
15125 (JSC::regExpObjectLastIndex):
15126 (JSC::RegExpObject::put):
15127 (JSC::setRegExpObjectLastIndex):
15128 (JSC::RegExpObject::test):
15129 (JSC::RegExpObject::exec):
15130 (JSC::callRegExpObject):
15131 * runtime/RegExpObject.h:
15132 (JSC::RegExpObject::createStructure):
15133 (JSC::asRegExpObject):
15134 * runtime/RegExpPrototype.cpp:
15135 (JSC::regExpProtoFuncTest):
15136 (JSC::regExpProtoFuncExec):
15137 (JSC::regExpProtoFuncCompile):
15138 (JSC::regExpProtoFuncToString):
15139 * runtime/StringConstructor.cpp:
15140 (JSC::stringFromCharCodeSlowCase):
15141 (JSC::stringFromCharCode):
15142 (JSC::callStringConstructor):
15143 * runtime/StringObject.cpp:
15144 (JSC::StringObject::put):
15145 * runtime/StringObject.h:
15146 (JSC::StringObject::createStructure):
15147 (JSC::asStringObject):
15148 * runtime/StringObjectThatMasqueradesAsUndefined.h:
15149 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
15150 * runtime/StringPrototype.cpp:
15151 (JSC::stringProtoFuncReplace):
15152 (JSC::stringProtoFuncToString):
15153 (JSC::stringProtoFuncCharAt):
15154 (JSC::stringProtoFuncCharCodeAt):
15155 (JSC::stringProtoFuncConcat):
15156 (JSC::stringProtoFuncIndexOf):
15157 (JSC::stringProtoFuncLastIndexOf):
15158 (JSC::stringProtoFuncMatch):
15159 (JSC::stringProtoFuncSearch):
15160 (JSC::stringProtoFuncSlice):
15161 (JSC::stringProtoFuncSplit):
15162 (JSC::stringProtoFuncSubstr):
15163 (JSC::stringProtoFuncSubstring):
15164 (JSC::stringProtoFuncToLowerCase):
15165 (JSC::stringProtoFuncToUpperCase):
15166 (JSC::stringProtoFuncLocaleCompare):
15167 (JSC::stringProtoFuncBig):
15168 (JSC::stringProtoFuncSmall):
15169 (JSC::stringProtoFuncBlink):
15170 (JSC::stringProtoFuncBold):
15171 (JSC::stringProtoFuncFixed):
15172 (JSC::stringProtoFuncItalics):
15173 (JSC::stringProtoFuncStrike):
15174 (JSC::stringProtoFuncSub):
15175 (JSC::stringProtoFuncSup):
15176 (JSC::stringProtoFuncFontcolor):
15177 (JSC::stringProtoFuncFontsize):
15178 (JSC::stringProtoFuncAnchor):
15179 (JSC::stringProtoFuncLink):
15180 * runtime/Structure.cpp:
15181 (JSC::Structure::Structure):
15182 (JSC::Structure::changePrototypeTransition):
15183 (JSC::Structure::createCachedPrototypeChain):
15184 * runtime/Structure.h:
15185 (JSC::Structure::create):
15186 (JSC::Structure::setPrototypeWithoutTransition):
15187 (JSC::Structure::storedPrototype):
15189 2009-01-06 Oliver Hunt <oliver@apple.com>
15191 Reviewed by Cameron Zwarich.
15193 <https://bugs.webkit.org/show_bug.cgi?id=23085> [jsfunfuzz] Over released ScopeChainNode
15194 <rdar://problem/6474110>
15196 So this delightful bug was caused by our unwind code using a ScopeChain to perform
15197 the unwind. The ScopeChain would ref the initial top of the scope chain, then deref
15198 the resultant top of scope chain, which is incorrect.
15200 This patch removes the dependency on ScopeChain for the unwind, and i've filed
15201 <https://bugs.webkit.org/show_bug.cgi?id=23144> to look into the unintuitive
15202 ScopeChain behaviour.
15204 * interpreter/Interpreter.cpp:
15205 (JSC::Interpreter::throwException):
15207 2009-01-06 Adam Roben <aroben@apple.com>
15209 Hopeful Windows crash-on-launch fix
15211 * wtf/Platform.h: Force a world rebuild by touching this file.
15213 2009-01-06 Holger Hans Peter Freyther <zecke@selfish.org>
15215 Reviewed by NOBODY (Build fix).
15217 * GNUmakefile.am:Add ByteArray.cpp too
15219 2009-01-06 Holger Hans Peter Freyther <zecke@selfish.org>
15221 Reviewed by NOBODY (Speculative build fix).
15223 AllInOneFile.cpp does not include the JSByteArray.cpp include it...
15227 2009-01-05 Oliver Hunt <oliver@apple.com>
15229 Reviewed by NOBODY (Build fix).
15233 * JavaScriptCoreSources.bkl:
15235 2009-01-05 Oliver Hunt <oliver@apple.com>
15237 Windows build fixes
15239 Rubber-stamped by Alice Liu.
15241 * interpreter/Interpreter.cpp:
15242 (JSC::Interpreter::Interpreter):
15243 * runtime/ByteArray.cpp:
15244 (JSC::ByteArray::create):
15245 * runtime/ByteArray.h:
15247 2009-01-05 Oliver Hunt <oliver@apple.com>
15249 Reviewed by Gavin Barraclough.
15251 CanvasPixelArray performance is too slow
15252 <https://bugs.webkit.org/show_bug.cgi?id=23123>
15254 The fix to this is to devirtualise get and put in a manner similar to
15255 JSString and JSArray. To do this I've added a ByteArray implementation
15256 and JSByteArray wrapper to JSC. We can then do vptr comparisons to
15257 devirtualise the calls.
15259 This devirtualisation improves performance by 1.5-2x in my somewhat ad
15263 * JavaScriptCore.exp:
15264 * JavaScriptCore.pri:
15265 * JavaScriptCore.scons:
15266 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
15267 * JavaScriptCore.xcodeproj/project.pbxproj:
15268 * interpreter/Interpreter.cpp:
15269 (JSC::Interpreter::Interpreter):
15270 (JSC::Interpreter::privateExecute):
15271 (JSC::Interpreter::cti_op_get_by_val):
15272 (JSC::Interpreter::cti_op_put_by_val):
15273 * interpreter/Interpreter.h:
15274 (JSC::Interpreter::isJSByteArray):
15275 * runtime/ByteArray.cpp: Added.
15276 (JSC::ByteArray::create):
15277 * runtime/ByteArray.h: Added.
15278 (JSC::ByteArray::length):
15279 (JSC::ByteArray::set):
15280 (JSC::ByteArray::get):
15281 (JSC::ByteArray::data):
15282 (JSC::ByteArray::ByteArray):
15283 * runtime/JSByteArray.cpp: Added.
15285 (JSC::JSByteArray::JSByteArray):
15286 (JSC::JSByteArray::createStructure):
15287 (JSC::JSByteArray::getOwnPropertySlot):
15288 (JSC::JSByteArray::put):
15289 (JSC::JSByteArray::getPropertyNames):
15290 * runtime/JSByteArray.h: Added.
15291 (JSC::JSByteArray::canAccessIndex):
15292 (JSC::JSByteArray::getIndex):
15293 (JSC::JSByteArray::setIndex):
15294 (JSC::JSByteArray::classInfo):
15295 (JSC::JSByteArray::length):
15296 (JSC::JSByteArray::):
15297 (JSC::JSByteArray::JSByteArray):
15298 (JSC::asByteArray):
15300 2009-01-05 Alexey Proskuryakov <ap@webkit.org>
15302 Reviewed by Darin Adler.
15304 https://bugs.webkit.org/show_bug.cgi?id=23073
15305 <rdar://problem/6471129> Workers crash on Windows Release builds
15307 * wtf/ThreadSpecific.h:
15308 (WTF::ThreadSpecific::destroy): Changed to clear the pointer only after data object
15309 destruction is finished - otherwise, WebCore::ThreadGlobalData destructor was re-creating
15310 the object in order to access atomic string table.
15311 (WTF::ThreadSpecific::operator T*): Symmetrically, set up the per-thread pointer before
15312 data constructor is called.
15314 * wtf/ThreadingWin.cpp: (WTF::wtfThreadEntryPoint): Remove a Windows-only hack to finalize
15315 a thread - pthreadVC2 is a DLL, so it gets thread detached messages, and cleans up thread
15316 specific data automatically. Besides, this code wasn't even compiled in for some time now.
15318 2009-01-05 Alexey Proskuryakov <ap@webkit.org>
15320 Reviewed by Darin Adler.
15322 https://bugs.webkit.org/show_bug.cgi?id=23115
15323 Create a version of ASSERT for use with otherwise unused variables
15325 * wtf/Assertions.h: Added ASSERT_UNUSED.
15327 * jit/ExecutableAllocatorPosix.cpp:
15328 (JSC::ExecutablePool::systemRelease):
15329 * runtime/Collector.cpp:
15330 (JSC::Heap::destroy):
15331 (JSC::Heap::heapAllocate):
15332 * runtime/JSNotAnObject.cpp:
15333 (JSC::JSNotAnObject::toPrimitive):
15334 (JSC::JSNotAnObject::getPrimitiveNumber):
15335 (JSC::JSNotAnObject::toBoolean):
15336 (JSC::JSNotAnObject::toNumber):
15337 (JSC::JSNotAnObject::toString):
15338 (JSC::JSNotAnObject::getOwnPropertySlot):
15339 (JSC::JSNotAnObject::put):
15340 (JSC::JSNotAnObject::deleteProperty):
15341 (JSC::JSNotAnObject::getPropertyNames):
15342 * wtf/TCSystemAlloc.cpp:
15343 (TCMalloc_SystemRelease):
15344 Use it in some places that used other idioms for this purpose.
15346 2009-01-04 Alice Liu <alice.liu@apple.com>
15348 <rdar://problem/6341776> Merge m_transitionCount and m_offset in Structure.
15350 Reviewed by Darin Adler.
15352 * runtime/Structure.cpp:
15353 (JSC::Structure::Structure): Remove m_transitionCount
15354 (JSC::Structure::addPropertyTransitionToExistingStructure): No need to wait until after the assignment to offset to assert if it's notFound; move it up.
15355 (JSC::Structure::addPropertyTransition): Use method for transitionCount instead of m_transitionCount. Remove line that maintains the m_transitionCount.
15356 (JSC::Structure::changePrototypeTransition): Remove line that maintains the m_transitionCount.
15357 (JSC::Structure::getterSetterTransition): Remove line that maintains the m_transitionCount.
15358 * runtime/Structure.h:
15359 Changed s_maxTransitionLength and m_offset from size_t to signed char. m_offset will never become greater than 64
15360 because the structure transitions to a dictionary at that time.
15361 (JSC::Structure::transitionCount): method to replace the data member
15363 2009-01-04 Darin Adler <darin@apple.com>
15365 Reviewed by David Kilzer.
15367 Bug 15114: Provide compile-time assertions for sizeof(UChar), sizeof(DeprecatedChar), etc.
15368 https://bugs.webkit.org/show_bug.cgi?id=15114
15370 * wtf/unicode/Unicode.h: Assert size of UChar. There is no DeprecatedChar any more.
15372 2009-01-03 Sam Weinig <sam@webkit.org>
15374 Reviewed by Oliver Hunt.
15376 Change the pcVector from storing native code pointers to storing offsets
15377 from the base pointer. This will allow us to generate the pcVector on demand
15380 * bytecode/CodeBlock.h:
15382 (JSC::getNativePCOffset):
15383 (JSC::CodeBlock::getBytecodeIndex):
15385 (JSC::JIT::privateCompile):
15387 2009-01-02 Oliver Hunt <oliver@apple.com>
15389 Reviewed by NOBODY (Build fix).
15391 * runtime/ScopeChain.cpp:
15393 2009-01-02 Oliver Hunt <oliver@apple.com>
15395 Reviewed by Gavin Barraclough.
15397 [jsfunfuzz] unwind logic for exceptions in eval fails to account for dynamic scope external to the eval
15398 https://bugs.webkit.org/show_bug.cgi?id=23078
15400 This bug was caused by eval codeblocks being generated without accounting
15401 for the depth of the scope chain they inherited. This meant that exception
15402 handlers would understate their expected scope chain depth, which in turn
15403 led to incorrectly removing nodes from the scope chain.
15405 * bytecompiler/BytecodeGenerator.cpp:
15406 (JSC::BytecodeGenerator::BytecodeGenerator):
15407 (JSC::BytecodeGenerator::emitCatch):
15408 * bytecompiler/BytecodeGenerator.h:
15409 * interpreter/Interpreter.cpp:
15411 * runtime/ScopeChain.cpp:
15412 (JSC::ScopeChain::localDepth):
15413 * runtime/ScopeChain.h:
15414 (JSC::ScopeChainNode::deref):
15415 (JSC::ScopeChainNode::ref):
15417 2009-01-02 David Smith <catfish.man@gmail.com>
15419 Reviewed by Darin Adler.
15421 https://bugs.webkit.org/show_bug.cgi?id=22699
15422 Enable NodeList caching for getElementsByTagName
15424 * wtf/HashFunctions.h: Moved the definition of PHI here and renamed to stringHashingStartValue
15426 2009-01-02 David Kilzer <ddkilzer@apple.com>
15428 Attempt to fix Qt Linux build after r39553
15430 * wtf/RandomNumberSeed.h: Include <sys/time.h> for gettimeofday().
15431 Include <sys/types.h> and <unistd.h> for getpid().
15433 2009-01-02 David Kilzer <ddkilzer@apple.com>
15435 Bug 23081: These files are no longer part of the KDE libraries
15437 <https://bugs.webkit.org/show_bug.cgi?id=23081>
15439 Reviewed by Darin Adler.
15441 Removed "This file is part of the KDE libraries" comment from
15442 source files. Added or updated Apple copyrights as well.
15445 * wtf/HashCountedSet.h:
15447 * wtf/VectorTraits.h:
15449 2009-01-02 David Kilzer <ddkilzer@apple.com>
15451 Bug 23080: Remove last vestiges of KJS references
15453 <https://bugs.webkit.org/show_bug.cgi?id=23080>
15455 Reviewed by Darin Adler.
15457 Also updated Apple copyright statements.
15459 * DerivedSources.make: Changed bison "kjsyy" prefix to "jscyy".
15460 * GNUmakefile.am: Ditto.
15461 * JavaScriptCore.pri: Ditto. Also changed KJSBISON to JSCBISON
15462 and kjsbison to jscbison.
15464 * JavaScriptCoreSources.bkl: Changed JSCORE_KJS_SOURCES to
15465 JSCORE_JSC_SOURCES.
15466 * jscore.bkl: Ditto.
15468 * create_hash_table: Updated copyright and removed old comment.
15470 * parser/Grammar.y: Changed "kjsyy" prefix to "jscyy" prefix.
15471 * parser/Lexer.cpp: Ditto. Also changed KJS_DEBUG_LEX to
15475 * parser/Parser.cpp: Ditto.
15476 (JSC::Parser::parse):
15478 * pcre/dftables: Changed "kjs_pcre_" prefix to "jsc_pcre_".
15479 * pcre/pcre_compile.cpp: Ditto.
15480 (getOthercaseRange):
15483 (calculateCompiledPatternLength):
15484 * pcre/pcre_exec.cpp: Ditto.
15486 (getUTF8CharAndIncrementLength):
15488 * pcre/pcre_internal.h: Ditto.
15491 (classBitmapForChar):
15493 * pcre/pcre_tables.cpp: Ditto.
15494 * pcre/pcre_ucp_searchfuncs.cpp: Ditto.
15495 (jsc_pcre_ucp_othercase):
15496 * pcre/pcre_xclass.cpp: Ditto.
15497 (getUTF8CharAndAdvancePointer):
15500 * runtime/Collector.h: Updated header guards using the
15501 clean-header-guards script.
15502 * runtime/CollectorHeapIterator.h: Added missing header guard.
15503 * runtime/Identifier.h: Updated header guards.
15504 * runtime/JSFunction.h: Fixed end-of-namespace comment.
15506 * runtime/JSGlobalObject.cpp:
15507 (JSC::JSGlobalObject::reset): Renamed "kjsprint" debug function
15508 to "jscprint". Changed implementation method from
15509 globalFuncKJSPrint() to globalFuncJSCPrint().
15510 * runtime/JSGlobalObjectFunctions.cpp:
15511 (JSC::globalFuncJSCPrint): Renamed from globalFuncKJSPrint().
15512 * runtime/JSGlobalObjectFunctions.h: Ditto.
15514 * runtime/JSImmediate.h: Updated header guards.
15515 * runtime/JSLock.h: Ditto.
15516 * runtime/JSType.h: Ditto.
15517 * runtime/JSWrapperObject.h: Ditto.
15518 * runtime/Lookup.h: Ditto.
15519 * runtime/Operations.h: Ditto.
15520 * runtime/Protect.h: Ditto.
15521 * runtime/RegExp.h: Ditto.
15522 * runtime/UString.h: Ditto.
15524 * tests/mozilla/js1_5/Array/regress-157652.js: Changed "KJS"
15525 reference in comment to "JSC".
15527 * wrec/CharacterClassConstructor.cpp: Change "kjs_pcre_" function
15528 prefixes to "jsc_pcre_".
15529 (JSC::WREC::CharacterClassConstructor::put):
15530 (JSC::WREC::CharacterClassConstructor::flush):
15532 * wtf/unicode/Unicode.h: Change "KJS_" header guard to "WTF_".
15533 * wtf/unicode/icu/UnicodeIcu.h: Ditto.
15534 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
15536 2009-01-02 Oliver Hunt <oliver@apple.com>
15538 Reviewed by Maciej Stachowiak.
15540 Make randomNumber generate 2^53 values instead of 2^32 (or 2^31 for rand() platforms)
15542 * wtf/RandomNumber.cpp:
15543 (WTF::randomNumber):
15545 2009-01-02 David Kilzer <ddkilzer@apple.com>
15547 Remove declaration for JSC::Identifier::initializeIdentifierThreading()
15549 Reviewed by Alexey Proskuryakov.
15551 * runtime/Identifier.h:
15552 (JSC::Identifier::initializeIdentifierThreading): Removed
15553 declaration since the implementation was removed in r34412.
15555 2009-01-01 Darin Adler <darin@apple.com>
15557 Reviewed by Oliver Hunt.
15559 String.replace does not support $& replacement metacharacter when search term is not a RegExp
15560 <https://bugs.webkit.org/show_bug.cgi?id=21431>
15561 <rdar://problem/6274993>
15563 Test: fast/js/string-replace-3.html
15565 * runtime/StringPrototype.cpp:
15566 (JSC::substituteBackreferences): Added a null check here so we won't try to handle $$-$9
15567 backreferences when the search term is a string, not a RegExp. Added a check for 0 so we
15568 won't try to handle $0 or $00 as a backreference.
15569 (JSC::stringProtoFuncReplace): Added a call to substituteBackreferences.
15571 2009-01-01 Gavin Barraclough <barraclough@apple.com>
15573 Reviewed by Darin Adler.
15575 Allow 32-bit integers to be stored in JSImmediates, on x64-bit.
15576 Presently the top 32-bits of a 64-bit JSImmediate serve as a sign extension of a 31-bit
15577 int stored in the low word (shifted left by one, to make room for a tag). In the new
15578 format, the top 31-bits serve as a sign extension of a 32-bit int, still shifted left by
15581 The new behavior is enabled using a flag in Platform.h, 'WTF_USE_ALTERNATE_JSIMMEDIATE'.
15582 When this is set the constants defining the range of ints allowed to be stored as
15583 JSImmediate values is extended. The code in JSImmediate.h can safely operate on either
15584 format. This patch updates the JIT so that it can also operate with the new format.
15586 ~2% progression on x86-64, with & without the JIT, on sunspider & v8 tests.
15588 * assembler/MacroAssembler.h:
15589 (JSC::MacroAssembler::addPtr):
15590 (JSC::MacroAssembler::orPtr):
15591 (JSC::MacroAssembler::or32):
15592 (JSC::MacroAssembler::rshiftPtr):
15593 (JSC::MacroAssembler::rshift32):
15594 (JSC::MacroAssembler::subPtr):
15595 (JSC::MacroAssembler::xorPtr):
15596 (JSC::MacroAssembler::xor32):
15597 (JSC::MacroAssembler::move):
15598 (JSC::MacroAssembler::compareImm64ForBranch):
15599 (JSC::MacroAssembler::compareImm64ForBranchEquality):
15600 (JSC::MacroAssembler::jePtr):
15601 (JSC::MacroAssembler::jgePtr):
15602 (JSC::MacroAssembler::jlPtr):
15603 (JSC::MacroAssembler::jlePtr):
15604 (JSC::MacroAssembler::jnePtr):
15605 (JSC::MacroAssembler::jnzSubPtr):
15606 (JSC::MacroAssembler::joAddPtr):
15607 (JSC::MacroAssembler::jzSubPtr):
15608 * assembler/X86Assembler.h:
15609 (JSC::X86Assembler::addq_rr):
15610 (JSC::X86Assembler::orq_ir):
15611 (JSC::X86Assembler::subq_ir):
15612 (JSC::X86Assembler::xorq_rr):
15613 (JSC::X86Assembler::sarq_CLr):
15614 (JSC::X86Assembler::sarq_i8r):
15615 (JSC::X86Assembler::cmpq_ir):
15617 (JSC::JIT::compileOpStrictEq):
15618 (JSC::JIT::privateCompileMainPass):
15619 (JSC::JIT::privateCompileSlowCases):
15620 (JSC::JIT::privateCompileCTIMachineTrampolines):
15622 * jit/JITArithmetic.cpp:
15623 (JSC::JIT::compileFastArith_op_lshift):
15624 (JSC::JIT::compileFastArithSlow_op_lshift):
15625 (JSC::JIT::compileFastArith_op_rshift):
15626 (JSC::JIT::compileFastArithSlow_op_rshift):
15627 (JSC::JIT::compileFastArith_op_bitand):
15628 (JSC::JIT::compileFastArithSlow_op_bitand):
15629 (JSC::JIT::compileFastArith_op_mod):
15630 (JSC::JIT::compileFastArithSlow_op_mod):
15631 (JSC::JIT::compileFastArith_op_add):
15632 (JSC::JIT::compileFastArithSlow_op_add):
15633 (JSC::JIT::compileFastArith_op_mul):
15634 (JSC::JIT::compileFastArithSlow_op_mul):
15635 (JSC::JIT::compileFastArith_op_post_inc):
15636 (JSC::JIT::compileFastArithSlow_op_post_inc):
15637 (JSC::JIT::compileFastArith_op_post_dec):
15638 (JSC::JIT::compileFastArithSlow_op_post_dec):
15639 (JSC::JIT::compileFastArith_op_pre_inc):
15640 (JSC::JIT::compileFastArithSlow_op_pre_inc):
15641 (JSC::JIT::compileFastArith_op_pre_dec):
15642 (JSC::JIT::compileFastArithSlow_op_pre_dec):
15643 (JSC::JIT::compileBinaryArithOp):
15644 * jit/JITInlineMethods.h:
15645 (JSC::JIT::getConstantOperand):
15646 (JSC::JIT::getConstantOperandImmediateInt):
15647 (JSC::JIT::isOperandConstantImmediateInt):
15648 (JSC::JIT::isOperandConstant31BitImmediateInt):
15649 (JSC::JIT::emitFastArithDeTagImmediate):
15650 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
15651 (JSC::JIT::emitFastArithReTagImmediate):
15652 (JSC::JIT::emitFastArithImmToInt):
15653 (JSC::JIT::emitFastArithIntToImmNoCheck):
15654 * runtime/JSImmediate.h:
15655 (JSC::JSImmediate::isPositiveNumber):
15656 (JSC::JSImmediate::isNegative):
15657 (JSC::JSImmediate::rightShiftImmediateNumbers):
15658 (JSC::JSImmediate::canDoFastAdditiveOperations):
15659 (JSC::JSImmediate::makeValue):
15660 (JSC::JSImmediate::makeInt):
15661 (JSC::JSImmediate::makeBool):
15662 (JSC::JSImmediate::intValue):
15663 (JSC::JSImmediate::rawValue):
15664 (JSC::JSImmediate::toBoolean):
15665 (JSC::JSImmediate::from):
15668 2008-12-31 Oliver Hunt <oliver@apple.com>
15670 Reviewed by Cameron Zwarich.
15672 [jsfunfuzz] Assertion + incorrect behaviour with dynamically created local variable in a catch block
15673 <https://bugs.webkit.org/show_bug.cgi?id=23063>
15675 Eval inside a catch block attempts to use the catch block's static scope in
15676 an unsafe way by attempting to add new properties to the scope. This patch
15677 fixes this issue simply by preventing the catch block from using a static
15678 scope if it contains an eval.
15680 * parser/Grammar.y:
15681 * parser/Nodes.cpp:
15682 (JSC::TryNode::emitBytecode):
15686 2008-12-31 Oliver Hunt <oliver@apple.com>
15688 Reviewed by Gavin Barraclough.
15690 [jsfunfuzz] Computed exception offset wrong when first instruction is attempt to resolve deleted eval
15691 <https://bugs.webkit.org/show_bug.cgi?id=23062>
15693 This was caused by the expression information for the initial resolve of
15694 eval not being emitted. If this resolve was the first instruction that
15695 could throw an exception the information search would fail leading to an
15696 assertion failure. If it was not the first throwable opcode the wrong
15697 expression information would used.
15699 Fix is simply to emit the expression info.
15701 * parser/Nodes.cpp:
15702 (JSC::EvalFunctionCallNode::emitBytecode):
15704 2008-12-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15706 Reviewed by Oliver Hunt.
15708 Bug 23054: Caching of global lookups occurs even when the global object has become a dictionary
15709 <https://bugs.webkit.org/show_bug.cgi?id=23054>
15710 <rdar://problem/6469905>
15712 * interpreter/Interpreter.cpp:
15713 (JSC::Interpreter::resolveGlobal): Do not cache lookup if the global
15714 object has transitioned to a dictionary.
15715 (JSC::Interpreter::cti_op_resolve_global): Do not cache lookup if the
15716 global object has transitioned to a dictionary.
15718 2008-12-30 Oliver Hunt <oliver@apple.com>
15720 Reviewed by Darin Adler.
15722 <https://bugs.webkit.org/show_bug.cgi?id=23049> [jsfunfuzz] With blocks do not correctly protect their scope object
15723 <rdar://problem/6469742> Crash in JSC::TypeInfo::hasStandardGetOwnPropertySlot() running jsfunfuzz
15725 The problem that caused this was that with nodes were not correctly protecting
15726 the final object that was placed in the scope chain. We correct this by forcing
15727 the use of a temporary register (which stops us relying on a local register
15728 protecting the scope) and changing the behaviour of op_push_scope so that it
15729 will store the final scope object.
15731 * bytecompiler/BytecodeGenerator.cpp:
15732 (JSC::BytecodeGenerator::emitPushScope):
15733 * interpreter/Interpreter.cpp:
15734 (JSC::Interpreter::privateExecute):
15735 (JSC::Interpreter::cti_op_push_scope):
15736 * interpreter/Interpreter.h:
15738 (JSC::JIT::privateCompileMainPass):
15739 * parser/Nodes.cpp:
15740 (JSC::WithNode::emitBytecode):
15742 2008-12-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15744 Reviewed by Sam Weinig.
15746 Bug 23037: Parsing and reparsing disagree on automatic semicolon insertion
15747 <https://bugs.webkit.org/show_bug.cgi?id=23037>
15748 <rdar://problem/6467124>
15750 Parsing and reparsing disagree about automatic semicolon insertion, so that a
15753 function() { a = 1, }
15755 is parsed as being syntactically valid but gets a syntax error upon reparsing.
15756 This leads to an assertion failure in Parser::reparse(). It is not that big of
15757 an issue in practice, because in a Release build such a function will return
15758 'undefined' when called.
15760 In this case, we are not following the spec and it should be a syntax error.
15761 However, unless there is a newline separating the ',' and the '}', WebKit would
15762 not treat it as a syntax error in the past either. It would be a bit of work to
15763 make the automatic semicolon insertion match the spec exactly, so this patch
15764 changes it to match our past behaviour.
15766 The problem is that even during reparsing, the Lexer adds a semicolon at the
15767 end of the input, which confuses allowAutomaticSemicolon(), because it is
15768 expecting either a '}', the end of input, or a terminator like a newline.
15770 * parser/Lexer.cpp:
15771 (JSC::Lexer::Lexer): Initialize m_isReparsing to false.
15772 (JSC::Lexer::lex): Do not perform automatic semicolon insertion in the Lexer if
15773 we are in the middle of reparsing.
15774 (JSC::Lexer::clear): Set m_isReparsing to false.
15776 (JSC::Lexer::setIsReparsing): Added.
15777 * parser/Parser.cpp:
15778 (JSC::Parser::reparse): Call Lexer::setIsReparsing() to notify the Lexer of
15781 2008-12-29 Oliver Hunt <oliver@apple.com>
15783 Reviewed by NOBODY (Build fix).
15785 Yet another attempt to fix Tiger.
15787 * wtf/RandomNumber.cpp:
15788 (WTF::randomNumber):
15790 2008-12-29 Oliver Hunt <oliver@apple.com>
15792 Reviewed by NOBODY (Build fix).
15794 Tiger build fix (correct this time)
15796 * wtf/RandomNumber.cpp:
15798 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15800 Rubber-stamped by Alexey Proskuryakov.
15802 Revert r39509, because kjsyydebug is used in the generated code if YYDEBUG is 1.
15804 * parser/Grammar.y:
15806 2008-12-29 Oliver Hunt <oliver@apple.com>
15808 Reviewed by NOBODY (Build fix).
15812 * wtf/RandomNumber.cpp:
15814 2008-12-29 Oliver Hunt <oliver@apple.com>
15816 Reviewed by Mark Rowe.
15818 <rdar://problem/6358108> Insecure randomness in Math.random() leads to user tracking
15820 Switch to arc4random on PLATFORM(DARWIN), this is ~1.5x slower than random(), but the
15821 it is still so fast that there is no fathomable way it could be a bottleneck for anything.
15823 randomNumber is called in two places
15824 * During form submission where it is called once per form
15825 * Math.random in JSC. For this difference to show up you have to be looping on
15826 a cached local copy of random, for a large (>10000) calls.
15828 No change in SunSpider.
15830 * wtf/RandomNumber.cpp:
15831 (WTF::randomNumber):
15832 * wtf/RandomNumberSeed.h:
15833 (WTF::initializeRandomNumberGenerator):
15835 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15837 Rubber-stamped by Sam Weinig.
15839 Remove unused kjsyydebug #define.
15841 * parser/Grammar.y:
15843 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15845 Reviewed by Oliver Hunt and Sam Weinig.
15847 Bug 23029: REGRESSION (r39337): jsfunfuzz generates identical test files
15848 <https://bugs.webkit.org/show_bug.cgi?id=23029>
15849 <rdar://problem/6469185>
15851 The unification of random number generation in r39337 resulted in random()
15852 being initialized on Darwin, but rand() actually being used. Fix this by
15853 making randomNumber() use random() instead of rand() on Darwin.
15855 * wtf/RandomNumber.cpp:
15856 (WTF::randomNumber):
15858 2008-12-29 Sam Weinig <sam@webkit.org>
15862 * runtime/Structure.cpp:
15864 2008-12-29 Sam Weinig <sam@webkit.org>
15866 Reviewed by Oliver Hunt.
15868 Patch for https://bugs.webkit.org/show_bug.cgi?id=23026
15869 Move the deleted offsets vector into the PropertyMap
15871 Saves 3 words per Structure.
15873 * runtime/PropertyMapHashTable.h:
15874 * runtime/Structure.cpp:
15875 (JSC::Structure::addPropertyTransition):
15876 (JSC::Structure::changePrototypeTransition):
15877 (JSC::Structure::getterSetterTransition):
15878 (JSC::Structure::toDictionaryTransition):
15879 (JSC::Structure::fromDictionaryTransition):
15880 (JSC::Structure::copyPropertyTable):
15881 (JSC::Structure::put):
15882 (JSC::Structure::remove):
15883 (JSC::Structure::rehashPropertyMapHashTable):
15884 * runtime/Structure.h:
15885 (JSC::Structure::propertyStorageSize):
15887 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15889 Reviewed by Oliver Hunt.
15891 Change code using m_body.get() as a boolean to take advantage of the
15892 implicit conversion of RefPtr to boolean.
15894 * runtime/JSFunction.cpp:
15895 (JSC::JSFunction::~JSFunction):
15897 2008-12-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15899 Reviewed by Oliver Hunt.
15901 Bug 22840: REGRESSION (r38349): Gmail doesn't load with profiling enabled
15902 <https://bugs.webkit.org/show_bug.cgi?id=22840>
15903 <rdar://problem/6468077>
15905 * bytecompiler/BytecodeGenerator.cpp:
15906 (JSC::BytecodeGenerator::emitNewArray): Add an assertion that the range
15907 of registers passed to op_new_array is sequential.
15908 (JSC::BytecodeGenerator::emitCall): Correct the relocation of registers
15909 when emitting profiler hooks so that registers aren't leaked. Also, add
15910 an assertion that the 'this' register is always ref'd (because it is),
15911 remove the needless protection of the 'this' register when relocating,
15912 and add an assertion that the range of registers passed to op_call for
15913 function call arguments is sequential.
15914 (JSC::BytecodeGenerator::emitConstruct): Correct the relocation of
15915 registers when emitting profiler hooks so that registers aren't leaked.
15916 Also, add an assertion that the range of registers passed to op_construct
15917 for function call arguments is sequential.
15919 2008-12-26 Mark Rowe <mrowe@apple.com>
15921 Reviewed by Alexey Proskuryakov.
15923 <rdar://problem/6467376> Race condition in WTF::currentThread can lead to a thread using two different identifiers during its lifetime
15925 If a newly-created thread calls WTF::currentThread() before WTF::createThread calls establishIdentifierForPthreadHandle
15926 then more than one identifier will be used for the same thread. We can avoid this by adding some extra synchronization
15927 during thread creation that delays the execution of the thread function until the thread identifier has been set up, and
15928 an assertion to catch this problem should it reappear in the future.
15930 * wtf/Threading.cpp: Added.
15931 (WTF::NewThreadContext::NewThreadContext):
15932 (WTF::threadEntryPoint):
15933 (WTF::createThread): Add cross-platform createThread function that delays the execution of the thread function until
15934 after the thread identifier has been set up.
15936 * wtf/ThreadingGtk.cpp:
15937 (WTF::establishIdentifierForThread):
15938 (WTF::createThreadInternal):
15939 * wtf/ThreadingNone.cpp:
15940 (WTF::createThreadInternal):
15941 * wtf/ThreadingPthreads.cpp:
15942 (WTF::establishIdentifierForPthreadHandle):
15943 (WTF::createThreadInternal):
15944 * wtf/ThreadingQt.cpp:
15945 (WTF::identifierByQthreadHandle):
15946 (WTF::establishIdentifierForThread):
15947 (WTF::createThreadInternal):
15948 * wtf/ThreadingWin.cpp:
15949 (WTF::storeThreadHandleByIdentifier):
15950 (WTF::createThreadInternal):
15952 Add Threading.cpp to the build.
15955 * JavaScriptCore.pri:
15956 * JavaScriptCore.scons:
15957 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
15958 * JavaScriptCore.xcodeproj/project.pbxproj:
15959 * JavaScriptCoreSources.bkl:
15961 2008-12-26 Sam Weinig <sam@webkit.org>
15963 Reviewed by Alexey Proskuryakov.
15965 Remove unused method.
15967 * runtime/Structure.h: Remove mutableTypeInfo.
15969 2008-12-22 Gavin Barraclough <barraclough@apple.com>
15971 Reviewed by Oliver Hunt.
15973 Fix rounding / bounds / signed comparison bug in ExecutableAllocator.
15975 ExecutableAllocator::alloc assumed that m_freePtr would be aligned. This was
15976 not always true, since the first allocation from an additional pool would not
15977 be rounded up. Subsequent allocations would be unaligned, and too much memory
15978 could be erroneously allocated from the pool, when the size requested was
15979 available, but the size rounded up to word granularity was not available in the
15980 pool. This may result in the value of m_freePtr being greater than m_end.
15982 Under these circumstances, the unsigned check for space will always pass,
15983 resulting in pointers to memory outside of the arena being returned, and
15984 ultimately segfaulty goodness when attempting to memcpy the hot freshly jitted
15985 code from the AssemblerBuffer.
15987 https://bugs.webkit.org/show_bug.cgi?id=22974
15988 ... and probably many, many more.
15990 * jit/ExecutableAllocator.h:
15991 (JSC::ExecutablePool::alloc):
15992 (JSC::ExecutablePool::roundUpAllocationSize):
15993 (JSC::ExecutablePool::ExecutablePool):
15994 (JSC::ExecutablePool::poolAllocate):
15996 2008-12-22 Sam Weinig <sam@webkit.org>
15998 Reviewed by Gavin Barraclough.
16000 Rename all uses of the term "repatch" to "patch".
16002 * assembler/MacroAssembler.h:
16003 (JSC::MacroAssembler::DataLabelPtr::patch):
16004 (JSC::MacroAssembler::DataLabel32::patch):
16005 (JSC::MacroAssembler::Jump::patch):
16006 (JSC::MacroAssembler::PatchBuffer::PatchBuffer):
16007 (JSC::MacroAssembler::PatchBuffer::setPtr):
16008 (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
16009 (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
16010 (JSC::MacroAssembler::storePtrWithPatch):
16011 (JSC::MacroAssembler::jnePtrWithPatch):
16012 * assembler/X86Assembler.h:
16013 (JSC::X86Assembler::patchAddress):
16014 (JSC::X86Assembler::patchImmediate):
16015 (JSC::X86Assembler::patchPointer):
16016 (JSC::X86Assembler::patchBranchOffset):
16017 * interpreter/Interpreter.cpp:
16018 (JSC::Interpreter::tryCTICachePutByID):
16019 (JSC::Interpreter::tryCTICacheGetByID):
16020 (JSC::Interpreter::cti_op_put_by_id):
16021 (JSC::Interpreter::cti_op_get_by_id):
16022 (JSC::Interpreter::cti_op_get_by_id_self_fail):
16023 (JSC::Interpreter::cti_op_get_by_id_proto_list):
16024 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
16026 (JSC::ctiPatchCallByReturnAddress):
16027 (JSC::JIT::privateCompileMainPass):
16028 (JSC::JIT::privateCompile):
16029 (JSC::JIT::privateCompileCTIMachineTrampolines):
16032 (JSC::JIT::unlinkCall):
16033 (JSC::JIT::linkCall):
16034 (JSC::JIT::compileOpCall):
16035 * jit/JITPropertyAccess.cpp:
16036 (JSC::JIT::compileGetByIdHotPath):
16037 (JSC::JIT::compilePutByIdHotPath):
16038 (JSC::JIT::compileGetByIdSlowCase):
16039 (JSC::JIT::compilePutByIdSlowCase):
16040 (JSC::JIT::privateCompilePutByIdTransition):
16041 (JSC::JIT::patchGetByIdSelf):
16042 (JSC::JIT::patchPutByIdReplace):
16043 (JSC::JIT::privateCompilePatchGetArrayLength):
16044 (JSC::JIT::privateCompileGetByIdSelf):
16045 (JSC::JIT::privateCompileGetByIdProto):
16046 (JSC::JIT::privateCompileGetByIdSelfList):
16047 (JSC::JIT::privateCompileGetByIdProtoList):
16048 (JSC::JIT::privateCompileGetByIdChainList):
16049 (JSC::JIT::privateCompileGetByIdChain):
16050 (JSC::JIT::privateCompilePutByIdReplace):
16052 2008-12-22 Adam Roben <aroben@apple.com>
16054 Build fix after r39428
16057 (JSC::JIT::compileOpCallSlowCase): Added a missing MacroAssembler::
16059 2008-12-22 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
16061 Rubber-stamped by George Staikos.
16063 Unify all TorchMobile copyright lines. Consolidate in a single line, as requested by Mark Rowe, some time ago.
16065 * wtf/RandomNumber.cpp:
16066 * wtf/RandomNumber.h:
16067 * wtf/RandomNumberSeed.h:
16069 2008-12-21 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
16071 Rubber-stamped by George Staikos.
16073 Fix copyright of the new RandomNumber* files.
16075 * wtf/RandomNumber.cpp:
16076 * wtf/RandomNumber.h:
16077 * wtf/RandomNumberSeed.h:
16079 2008-12-21 Gavin Barraclough <barraclough@apple.com>
16081 Reviewed by Oliver Hunt & Cameron Zwarich.
16083 Add support for call and property access repatching on x86-64.
16085 No change in performance on current configurations (2x impovement on v8-tests with JIT enabled on x86-64).
16087 * assembler/MacroAssembler.h:
16088 (JSC::MacroAssembler::DataLabelPtr::repatch):
16089 (JSC::MacroAssembler::DataLabelPtr::operator X86Assembler::JmpDst):
16090 (JSC::MacroAssembler::DataLabel32::repatch):
16091 (JSC::MacroAssembler::RepatchBuffer::addressOf):
16092 (JSC::MacroAssembler::add32):
16093 (JSC::MacroAssembler::sub32):
16094 (JSC::MacroAssembler::loadPtrWithAddressOffsetRepatch):
16095 (JSC::MacroAssembler::storePtrWithAddressOffsetRepatch):
16096 (JSC::MacroAssembler::jePtr):
16097 (JSC::MacroAssembler::jnePtr):
16098 (JSC::MacroAssembler::jnePtrWithRepatch):
16099 (JSC::MacroAssembler::differenceBetween):
16100 * assembler/X86Assembler.h:
16101 (JSC::X86Assembler::addl_im):
16102 (JSC::X86Assembler::subl_im):
16103 (JSC::X86Assembler::cmpl_rm):
16104 (JSC::X86Assembler::movq_rm_disp32):
16105 (JSC::X86Assembler::movq_mr_disp32):
16106 (JSC::X86Assembler::repatchPointer):
16107 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp32):
16109 (JSC::JIT::privateCompile):
16110 (JSC::JIT::privateCompileCTIMachineTrampolines):
16113 (JSC::JIT::unlinkCall):
16114 (JSC::JIT::linkCall):
16115 (JSC::JIT::compileOpCall):
16116 (JSC::JIT::compileOpCallSlowCase):
16117 * jit/JITInlineMethods.h:
16118 (JSC::JIT::restoreArgumentReferenceForTrampoline):
16119 * jit/JITPropertyAccess.cpp:
16120 (JSC::JIT::compileGetByIdHotPath):
16121 (JSC::JIT::compileGetByIdSlowCase):
16122 (JSC::JIT::compilePutByIdHotPath):
16123 (JSC::JIT::compilePutByIdSlowCase):
16124 (JSC::resizePropertyStorage):
16125 (JSC::JIT::privateCompilePutByIdTransition):
16126 (JSC::JIT::privateCompileGetByIdProto):
16127 (JSC::JIT::privateCompileGetByIdProtoList):
16128 (JSC::JIT::privateCompileGetByIdChainList):
16129 (JSC::JIT::privateCompileGetByIdChain):
16132 2008-12-20 Gavin Barraclough <barraclough@apple.com>
16134 Reviewed by Oliver Hunt.
16136 Port optimized property access generation to the MacroAssembler.
16138 * assembler/MacroAssembler.h:
16139 (JSC::MacroAssembler::AbsoluteAddress::AbsoluteAddress):
16140 (JSC::MacroAssembler::DataLabelPtr::repatch):
16141 (JSC::MacroAssembler::DataLabel32::DataLabel32):
16142 (JSC::MacroAssembler::DataLabel32::repatch):
16143 (JSC::MacroAssembler::Label::operator X86Assembler::JmpDst):
16144 (JSC::MacroAssembler::Jump::repatch):
16145 (JSC::MacroAssembler::JumpList::empty):
16146 (JSC::MacroAssembler::RepatchBuffer::link):
16147 (JSC::MacroAssembler::add32):
16148 (JSC::MacroAssembler::and32):
16149 (JSC::MacroAssembler::sub32):
16150 (JSC::MacroAssembler::loadPtrWithAddressRepatch):
16151 (JSC::MacroAssembler::storePtrWithAddressRepatch):
16152 (JSC::MacroAssembler::push):
16153 (JSC::MacroAssembler::ja32):
16154 (JSC::MacroAssembler::jePtr):
16155 (JSC::MacroAssembler::jnePtr):
16156 (JSC::MacroAssembler::jnePtrWithRepatch):
16157 (JSC::MacroAssembler::align):
16158 (JSC::MacroAssembler::differenceBetween):
16159 * assembler/X86Assembler.h:
16160 (JSC::X86Assembler::movl_rm_disp32):
16161 (JSC::X86Assembler::movl_mr_disp32):
16162 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp32):
16163 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
16165 (JSC::ctiRepatchCallByReturnAddress):
16166 (JSC::JIT::privateCompileMainPass):
16167 (JSC::JIT::privateCompile):
16168 (JSC::JIT::privateCompileCTIMachineTrampolines):
16170 * jit/JITPropertyAccess.cpp:
16171 (JSC::JIT::compileGetByIdHotPath):
16172 (JSC::JIT::compileGetByIdSlowCase):
16173 (JSC::JIT::compilePutByIdHotPath):
16174 (JSC::JIT::compilePutByIdSlowCase):
16175 (JSC::resizePropertyStorage):
16176 (JSC::JIT::privateCompilePutByIdTransition):
16177 (JSC::JIT::patchGetByIdSelf):
16178 (JSC::JIT::patchPutByIdReplace):
16179 (JSC::JIT::privateCompilePatchGetArrayLength):
16180 (JSC::JIT::privateCompileGetByIdSelf):
16181 (JSC::JIT::privateCompileGetByIdProto):
16182 (JSC::JIT::privateCompileGetByIdSelfList):
16183 (JSC::JIT::privateCompileGetByIdProtoList):
16184 (JSC::JIT::privateCompileGetByIdChainList):
16185 (JSC::JIT::privateCompileGetByIdChain):
16186 (JSC::JIT::privateCompilePutByIdReplace):
16187 * wtf/RefCounted.h:
16188 (WTF::RefCountedBase::addressOfCount):
16190 2008-12-19 Gustavo Noronha Silva <gns@gnome.org>
16192 Reviewed by Holger Freyther.
16194 https://bugs.webkit.org/show_bug.cgi?id=22686
16196 Added file which was missing to the javascriptcore_sources
16197 variable, so that it shows up in the tarball created by `make
16202 2008-12-19 Holger Hans Peter Freyther <zecke@selfish.org>
16204 Reviewed by Antti Koivisto.
16206 Build fix when building JS API tests with a c89 c compiler
16208 Do not use C++ style comments and convert them to C comments.
16212 2008-12-18 Gavin Barraclough <barraclough@apple.com>
16214 Reviewed by Sam Weinig.
16216 Same as last revision, adding cases for pre & post inc & dec.
16218 https://bugs.webkit.org/show_bug.cgi?id=22928
16221 (JSC::JIT::privateCompileMainPass):
16223 2008-12-18 Gavin Barraclough <barraclough@apple.com>
16225 Reviewed by Sam Weinig.
16227 Fixes for the JIT's handling of JSImmediate values on x86-64.
16228 On 64-bit systems, the code in JSImmediate.h relies on the upper
16229 bits of a JSImmediate being a sign extension of the low 32-bits.
16230 This was not being enforced by the JIT, since a number of inline
16231 operations were being performed on 32-bit values in registers, and
16232 when a 32-bit result is written to a register on x86-64 the value
16233 is zero-extended to 64-bits.
16235 This fix honors previous behavoir. A better fix in the long run
16236 (when the JIT is enabled by default) may be to change JSImmediate.h
16237 so it no longer relies on the upper bits of the pointer,... though
16238 if we're going to change JSImmediate.h for 64-bit, we probably may
16239 as well change the format so that the full range of 32-bit ints can
16240 be stored, rather than just 31-bits.
16242 https://bugs.webkit.org/show_bug.cgi?id=22925
16244 * assembler/MacroAssembler.h:
16245 (JSC::MacroAssembler::addPtr):
16246 (JSC::MacroAssembler::andPtr):
16247 (JSC::MacroAssembler::orPtr):
16248 (JSC::MacroAssembler::or32):
16249 (JSC::MacroAssembler::xor32):
16250 (JSC::MacroAssembler::xorPtr):
16251 (JSC::MacroAssembler::signExtend32ToPtr):
16252 * assembler/X86Assembler.h:
16253 (JSC::X86Assembler::):
16254 (JSC::X86Assembler::andq_rr):
16255 (JSC::X86Assembler::andq_ir):
16256 (JSC::X86Assembler::orq_rr):
16257 (JSC::X86Assembler::xorq_ir):
16258 (JSC::X86Assembler::movsxd_rr):
16260 (JSC::JIT::privateCompileMainPass):
16261 * jit/JITInlineMethods.h:
16262 (JSC::JIT::emitFastArithReTagImmediate):
16263 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
16264 (JSC::JIT::emitFastArithImmToInt):
16266 2008-12-18 Gavin Barraclough <barraclough@apple.com>
16268 Reviewed by Sam Weinig.
16270 Just a tidy up - rename & refactor some the #defines configuring the JIT.
16272 * interpreter/Interpreter.cpp:
16273 (JSC::Interpreter::cti_op_convert_this):
16274 (JSC::Interpreter::cti_op_end):
16275 (JSC::Interpreter::cti_op_add):
16276 (JSC::Interpreter::cti_op_pre_inc):
16277 (JSC::Interpreter::cti_timeout_check):
16278 (JSC::Interpreter::cti_register_file_check):
16279 (JSC::Interpreter::cti_op_loop_if_less):
16280 (JSC::Interpreter::cti_op_loop_if_lesseq):
16281 (JSC::Interpreter::cti_op_new_object):
16282 (JSC::Interpreter::cti_op_put_by_id_generic):
16283 (JSC::Interpreter::cti_op_get_by_id_generic):
16284 (JSC::Interpreter::cti_op_put_by_id):
16285 (JSC::Interpreter::cti_op_put_by_id_second):
16286 (JSC::Interpreter::cti_op_put_by_id_fail):
16287 (JSC::Interpreter::cti_op_get_by_id):
16288 (JSC::Interpreter::cti_op_get_by_id_second):
16289 (JSC::Interpreter::cti_op_get_by_id_self_fail):
16290 (JSC::Interpreter::cti_op_get_by_id_proto_list):
16291 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
16292 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
16293 (JSC::Interpreter::cti_op_get_by_id_array_fail):
16294 (JSC::Interpreter::cti_op_get_by_id_string_fail):
16295 (JSC::Interpreter::cti_op_instanceof):
16296 (JSC::Interpreter::cti_op_del_by_id):
16297 (JSC::Interpreter::cti_op_mul):
16298 (JSC::Interpreter::cti_op_new_func):
16299 (JSC::Interpreter::cti_op_call_JSFunction):
16300 (JSC::Interpreter::cti_op_call_arityCheck):
16301 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
16302 (JSC::Interpreter::cti_vm_lazyLinkCall):
16303 (JSC::Interpreter::cti_op_push_activation):
16304 (JSC::Interpreter::cti_op_call_NotJSFunction):
16305 (JSC::Interpreter::cti_op_create_arguments):
16306 (JSC::Interpreter::cti_op_create_arguments_no_params):
16307 (JSC::Interpreter::cti_op_tear_off_activation):
16308 (JSC::Interpreter::cti_op_tear_off_arguments):
16309 (JSC::Interpreter::cti_op_profile_will_call):
16310 (JSC::Interpreter::cti_op_profile_did_call):
16311 (JSC::Interpreter::cti_op_ret_scopeChain):
16312 (JSC::Interpreter::cti_op_new_array):
16313 (JSC::Interpreter::cti_op_resolve):
16314 (JSC::Interpreter::cti_op_construct_JSConstruct):
16315 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
16316 (JSC::Interpreter::cti_op_get_by_val):
16317 (JSC::Interpreter::cti_op_resolve_func):
16318 (JSC::Interpreter::cti_op_sub):
16319 (JSC::Interpreter::cti_op_put_by_val):
16320 (JSC::Interpreter::cti_op_put_by_val_array):
16321 (JSC::Interpreter::cti_op_lesseq):
16322 (JSC::Interpreter::cti_op_loop_if_true):
16323 (JSC::Interpreter::cti_op_negate):
16324 (JSC::Interpreter::cti_op_resolve_base):
16325 (JSC::Interpreter::cti_op_resolve_skip):
16326 (JSC::Interpreter::cti_op_resolve_global):
16327 (JSC::Interpreter::cti_op_div):
16328 (JSC::Interpreter::cti_op_pre_dec):
16329 (JSC::Interpreter::cti_op_jless):
16330 (JSC::Interpreter::cti_op_not):
16331 (JSC::Interpreter::cti_op_jtrue):
16332 (JSC::Interpreter::cti_op_post_inc):
16333 (JSC::Interpreter::cti_op_eq):
16334 (JSC::Interpreter::cti_op_lshift):
16335 (JSC::Interpreter::cti_op_bitand):
16336 (JSC::Interpreter::cti_op_rshift):
16337 (JSC::Interpreter::cti_op_bitnot):
16338 (JSC::Interpreter::cti_op_resolve_with_base):
16339 (JSC::Interpreter::cti_op_new_func_exp):
16340 (JSC::Interpreter::cti_op_mod):
16341 (JSC::Interpreter::cti_op_less):
16342 (JSC::Interpreter::cti_op_neq):
16343 (JSC::Interpreter::cti_op_post_dec):
16344 (JSC::Interpreter::cti_op_urshift):
16345 (JSC::Interpreter::cti_op_bitxor):
16346 (JSC::Interpreter::cti_op_new_regexp):
16347 (JSC::Interpreter::cti_op_bitor):
16348 (JSC::Interpreter::cti_op_call_eval):
16349 (JSC::Interpreter::cti_op_throw):
16350 (JSC::Interpreter::cti_op_get_pnames):
16351 (JSC::Interpreter::cti_op_next_pname):
16352 (JSC::Interpreter::cti_op_push_scope):
16353 (JSC::Interpreter::cti_op_pop_scope):
16354 (JSC::Interpreter::cti_op_typeof):
16355 (JSC::Interpreter::cti_op_is_undefined):
16356 (JSC::Interpreter::cti_op_is_boolean):
16357 (JSC::Interpreter::cti_op_is_number):
16358 (JSC::Interpreter::cti_op_is_string):
16359 (JSC::Interpreter::cti_op_is_object):
16360 (JSC::Interpreter::cti_op_is_function):
16361 (JSC::Interpreter::cti_op_stricteq):
16362 (JSC::Interpreter::cti_op_nstricteq):
16363 (JSC::Interpreter::cti_op_to_jsnumber):
16364 (JSC::Interpreter::cti_op_in):
16365 (JSC::Interpreter::cti_op_push_new_scope):
16366 (JSC::Interpreter::cti_op_jmp_scopes):
16367 (JSC::Interpreter::cti_op_put_by_index):
16368 (JSC::Interpreter::cti_op_switch_imm):
16369 (JSC::Interpreter::cti_op_switch_char):
16370 (JSC::Interpreter::cti_op_switch_string):
16371 (JSC::Interpreter::cti_op_del_by_val):
16372 (JSC::Interpreter::cti_op_put_getter):
16373 (JSC::Interpreter::cti_op_put_setter):
16374 (JSC::Interpreter::cti_op_new_error):
16375 (JSC::Interpreter::cti_op_debug):
16376 (JSC::Interpreter::cti_vm_throw):
16377 * interpreter/Interpreter.h:
16380 (JSC::JIT::privateCompileMainPass):
16381 (JSC::JIT::privateCompile):
16383 * jit/JITInlineMethods.h:
16384 (JSC::JIT::restoreArgumentReference):
16385 (JSC::JIT::restoreArgumentReferenceForTrampoline):
16388 2008-12-18 Cameron Zwarich <zwarich@apple.com>
16390 Reviewed by Geoff Garen.
16392 Bug 21855: REGRESSION (r37323): Gmail complains about popup blocking when opening a link
16393 <https://bugs.webkit.org/show_bug.cgi?id=21855>
16394 <rdar://problem/6278244>
16396 Move DynamicGlobalObjectScope to JSGlobalObject.h so that it can be used
16399 * interpreter/Interpreter.cpp:
16400 * runtime/JSGlobalObject.h:
16401 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
16402 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
16404 2008-12-17 Geoffrey Garen <ggaren@apple.com>
16406 Reviewed by Gavin Barraclough.
16408 Fixed https://bugs.webkit.org/show_bug.cgi?id=22393
16409 Segfault when caching property accesses to primitive cells.
16411 Changed some asObject casts to asCell casts in cases where a primitive
16412 value may be a cell and not an object.
16414 Re-enabled property caching for primitives in cases where it had been
16415 disabled because of this bug.
16417 Updated a comment to better explain something Darin thought needed
16418 explaining in an old patch review.
16420 * interpreter/Interpreter.cpp:
16421 (JSC::countPrototypeChainEntriesAndCheckForProxies):
16422 (JSC::Interpreter::tryCacheGetByID):
16423 (JSC::Interpreter::tryCTICacheGetByID):
16424 (JSC::Interpreter::cti_op_get_by_id_self_fail):
16425 (JSC::Interpreter::cti_op_get_by_id_proto_list):
16427 2008-12-17 Gavin Barraclough <barraclough@apple.com>
16429 Reviewed by Cameron Zwarich.
16431 Fixes for Sunspider failures with the JIT enabled on x86-64.
16433 * assembler/MacroAssembler.h:
16434 Switch the order of the RegisterID & Address form of je32, to keep it consistent with jne32.
16437 * jit/JITInlineMethods.h:
16438 Port the m_ctiVirtualCall tramopline generation to use the MacroAssembler interface.
16440 Fix bug in the non-optimizing code path, vptr check should have been to the memory address pointer
16441 to by the register, not to the register itself.
16442 * wrec/WRECGenerator.cpp:
16443 See assembler/MacroAssembler.h, above.
16445 2008-12-17 Gavin Barraclough <barraclough@apple.com>
16447 Reviewed by Sam Weinig.
16449 print("Hello, 64-bit jitted world!");
16450 Get hello-world working through the JIT, on x86-64.
16452 * assembler/X86Assembler.h:
16453 Fix encoding of opcode + RegisterID format instructions for 64-bit.
16454 * interpreter/Interpreter.cpp:
16455 * interpreter/Interpreter.h:
16456 Make VoidPtrPair actually be a pair of void*s.
16457 (Possibly should make this change for 32-bit Mac platforms, too - but won't change 32-bit behaviour in this patch).
16460 Provide names for the timeoutCheckRegister & callFrameRegister on x86-64,
16461 force x86-64 ctiTrampoline arguments onto the stack,
16462 implement the asm trampolines for x86-64,
16463 implement the restoreArgumentReference methods for x86-64 calling conventions.
16465 * jit/JITInlineMethods.h:
16467 Add switch settings to ENABLE(JIT), on PLATFORM(X86_64) (currently still disabled).
16469 2008-12-17 Sam Weinig <sam@webkit.org>
16471 Reviewed by Gavin Barraclough.
16473 Add more CodeBlock statistics.
16475 * bytecode/CodeBlock.cpp:
16476 (JSC::CodeBlock::dumpStatistics):
16478 2008-12-17 Sam Weinig <sam@webkit.org>
16480 Reviewed by Darin Adler.
16482 Fix for https://bugs.webkit.org/show_bug.cgi?id=22897
16483 <rdar://problem/6428342>
16484 Look into feasibility of discarding bytecode after native codegen
16486 Clear the bytecode Instruction vector at the end JIT generation.
16488 Saves 4.8 MB on Membuster head.
16490 * bytecode/CodeBlock.cpp:
16491 (JSC::CodeBlock::dump): Add logging for the case that someone tries
16492 to dump the instructions of a CodeBlock that has had its bytecode
16494 (JSC::CodeBlock::CodeBlock): Initialize the instructionCount
16495 (JSC::CodeBlock::handlerForBytecodeOffset): Use instructionCount instead
16496 of the size of the instruction vector in the assertion.
16497 (JSC::CodeBlock::lineNumberForBytecodeOffset): Ditto.
16498 (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
16499 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
16500 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Ditto.
16501 * bytecode/CodeBlock.h:
16502 (JSC::CodeBlock::setInstructionCount): Store the instruction vector size
16503 in debug builds for assertions.
16504 * bytecompiler/BytecodeGenerator.cpp:
16505 (JSC::BytecodeGenerator::generate):
16507 (JSC::JIT::privateCompile): Clear the bytecode vector unless we
16508 have compiled with Opcode sampling where we will continue to require it
16510 2008-12-17 Cary Clark <caryclark@google.com>
16512 Reviewed by Darin Adler.
16513 Landed by Adam Barth.
16515 Add ENABLE_TEXT_CARET to permit the ANDROID platform
16516 to invalidate and draw the caret in a separate thread.
16519 Default ENABLE_TEXT_CARET to 1.
16521 2008-12-17 Alexey Proskuryakov <ap@webkit.org>
16523 Reviewed by Darin Adler.
16525 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard, take two.
16527 * API/JSContextRef.cpp: The previous patch that claimed to do this was making Tiger and
16528 Leopard always use unique context group instead.
16530 2008-12-16 Sam Weinig <sam@webkit.org>
16532 Reviewed by Geoffrey Garen.
16534 Fix for https://bugs.webkit.org/show_bug.cgi?id=22838
16535 Remove dependency on the bytecode Instruction buffer in Interpreter::throwException
16536 Part of <rdar://problem/6428342>
16538 * bytecode/CodeBlock.cpp:
16539 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Added. Function to get
16540 a function Register index in a callFrame for a bytecode offset.
16541 (JSC::CodeBlock::shrinkToFit): Shrink m_getByIdExceptionInfo and m_functionRegisterInfos.
16542 * bytecode/CodeBlock.h:
16543 (JSC::FunctionRegisterInfo::FunctionRegisterInfo): Added.
16544 (JSC::CodeBlock::addFunctionRegisterInfo):
16545 * bytecompiler/BytecodeGenerator.cpp:
16546 (JSC::BytecodeGenerator::emitCall):
16547 * interpreter/Interpreter.cpp:
16548 (JSC::Interpreter::throwException): Use functionRegisterForBytecodeOffset in JIT
16551 2008-12-16 Sam Weinig <sam@webkit.org>
16553 Reviewed by Gavin Barraclough.
16555 Fix for https://bugs.webkit.org/show_bug.cgi?id=22837
16556 Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction
16557 Part of <rdar://problem/6428342>
16559 * interpreter/CallFrame.h: Added comment regarding returnPC storing a void*.
16560 * interpreter/Interpreter.cpp:
16561 (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC
16562 being in the instruction stream for JIT, so we can remove the check.
16563 (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS
16564 as the call frame returnPC as it is only necessary for looking up when
16565 throwing an exception.
16566 * interpreter/RegisterFile.h:
16567 (JSC::RegisterFile::): Added comment regarding returnPC storing a void*.
16568 * jit/JIT.h: Remove ARG_instr4.
16570 (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer.
16572 2008-12-16 Darin Adler <darin@apple.com>
16574 Reviewed and landed by Cameron Zwarich.
16576 Preparatory work for fixing
16578 Bug 22887: Make UString::Rep use RefCounted rather than implementing its own ref counting
16579 <https://bugs.webkit.org/show_bug.cgi?id=22887>
16581 Change the various string translators used by Identifier:add() so that
16582 they never zero the ref count of a newly created UString::Rep.
16584 * runtime/Identifier.cpp:
16585 (JSC::CStringTranslator::translate):
16586 (JSC::Identifier::add):
16587 (JSC::UCharBufferTranslator::translate):
16589 2008-12-16 Gavin Barraclough <barraclough@apple.com>
16591 Build fix for 'doze.
16593 * assembler/AssemblerBuffer.h:
16595 2008-12-16 Gavin Barraclough <barraclough@apple.com>
16597 Reviewed by Cameron Zwarich.
16599 Make the JIT compile on x86-64.
16600 This largely involves populting the missing calls in MacroAssembler.h.
16601 In addition some reinterpret_casts need removing from the JIT, and the
16602 repatching property access code will need to be fully compiled out for
16603 now. The changes in interpret.cpp are to reorder the functions so that
16604 the _generic forms come before all other property access methods, and
16605 then to place all property access methods other than the generic forms
16606 under control of the ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS macro.
16608 No performance impact.
16610 * assembler/AssemblerBuffer.h:
16611 (JSC::AssemblerBuffer::putInt64Unchecked):
16612 * assembler/MacroAssembler.h:
16613 (JSC::MacroAssembler::loadPtr):
16614 (JSC::MacroAssembler::load32):
16615 (JSC::MacroAssembler::storePtr):
16616 (JSC::MacroAssembler::storePtrWithRepatch):
16617 (JSC::MacroAssembler::store32):
16618 (JSC::MacroAssembler::poke):
16619 (JSC::MacroAssembler::move):
16620 (JSC::MacroAssembler::testImm64):
16621 (JSC::MacroAssembler::jePtr):
16622 (JSC::MacroAssembler::jnePtr):
16623 (JSC::MacroAssembler::jnzPtr):
16624 (JSC::MacroAssembler::jzPtr):
16625 * assembler/X86Assembler.h:
16626 (JSC::X86Assembler::):
16627 (JSC::X86Assembler::cmpq_rr):
16628 (JSC::X86Assembler::cmpq_rm):
16629 (JSC::X86Assembler::cmpq_im):
16630 (JSC::X86Assembler::testq_i32m):
16631 (JSC::X86Assembler::movl_mEAX):
16632 (JSC::X86Assembler::movl_i32r):
16633 (JSC::X86Assembler::movl_EAXm):
16634 (JSC::X86Assembler::movq_rm):
16635 (JSC::X86Assembler::movq_mEAX):
16636 (JSC::X86Assembler::movq_mr):
16637 (JSC::X86Assembler::movq_i64r):
16638 (JSC::X86Assembler::movl_mr):
16639 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64):
16640 (JSC::X86Assembler::X86InstructionFormatter::immediate64):
16641 * interpreter/Interpreter.cpp:
16642 (JSC::Interpreter::cti_op_put_by_id_generic):
16643 (JSC::Interpreter::cti_op_get_by_id_generic):
16644 (JSC::Interpreter::cti_op_put_by_id):
16645 (JSC::Interpreter::cti_op_put_by_id_second):
16647 (JSC::JIT::privateCompileMainPass):
16648 (JSC::JIT::privateCompile):
16649 (JSC::JIT::privateCompileCTIMachineTrampolines):
16651 (JSC::JIT::compileOpCallSetupArgs):
16652 (JSC::JIT::compileOpCall):
16653 * jit/JITPropertyAccess.cpp:
16654 (JSC::JIT::compileGetByIdHotPath):
16655 (JSC::JIT::compilePutByIdHotPath):
16656 * runtime/JSImmediate.h:
16657 (JSC::JSImmediate::makeInt):
16659 2008-12-16 Cameron Zwarich <zwarich@apple.com>
16661 Reviewed by Darin Adler.
16663 Bug 22869: REGRESSION (r38407): http://news.cnet.com/8301-13579_3-9953533-37.html crashes
16664 <https://bugs.webkit.org/show_bug.cgi?id=22869>
16665 <rdar://problem/6402499>
16667 Before r38407, Structure::m_nameInPrevious was ref'd due to it being
16668 stored in a PropertyMap. However, PropertyMaps are created lazily after
16669 r38407, so Structure::m_nameInPrevious is not necessarily ref'd while
16670 it is being used. Making it a RefPtr instead of a raw pointer fixes
16673 Unfortunately, the crash in the bug is rather intermittent, and it is
16674 impossible to add an assertion in UString::Ref::ref() to catch this bug
16675 because some users of UString::Rep deliberately zero out the reference
16676 count. Therefore, there is no layout test accompanying this bug fix.
16678 * runtime/Structure.cpp:
16679 (JSC::Structure::~Structure): Use get().
16680 (JSC::Structure::materializePropertyMap): Use get().
16681 (JSC::Structure::addPropertyTransitionToExistingStructure): Use get().
16682 (JSC::Structure::addPropertyTransition): Use get().
16683 * runtime/Structure.h: Make Structure::m_nameInPrevious a RefPtr instead
16686 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
16688 Not reviewed. Attempt to fix win build. No 'using namespace WTF' in this file, needs manual WTF:: prefix.
16689 Not sure why the build works as is here.
16691 * runtime/MathObject.cpp:
16692 (JSC::mathProtoFuncRandom):
16694 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
16696 Reviewed by Darin Adler.
16698 Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876
16700 Unify random number generation in JavaScriptCore & WebCore, by introducing
16701 wtf/RandomNumber.h and moving wtf_random/wtf_random_init out of MathExtras.h.
16703 wtf_random_init() has been renamed to initializeRandomNumberGenerator() and
16704 lives in it's own private header: wtf/RandomNumberSeed.h, only intended to
16705 be used from within JavaScriptCore.
16707 wtf_random() has been renamed to randomNumber() and lives in a public header
16708 wtf/RandomNumber.h, usable from within JavaScriptCore & WebCore. It encapsulates
16709 the code taking care of initializing the random number generator (only when
16710 building without ENABLE(JSC_MULTIPLE_THREADS), otherwhise initializeThreading()
16711 already took care of that).
16713 Functional change on darwin: Use random() instead of rand(), as it got a larger
16714 period (more randomness). HTMLFormElement already contains this implementation
16715 and I just moved it in randomNumber(), as special case for PLATFORM(DARWIN).
16717 * GNUmakefile.am: Add RandomNumber.(cpp/h) / RandomNumberSeed.h.
16718 * JavaScriptCore.exp: Ditto.
16719 * JavaScriptCore.pri: Ditto.
16720 * JavaScriptCore.scons: Ditto.
16721 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
16722 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
16723 * JavaScriptCoreSources.bkl: Ditto.
16724 * runtime/MathObject.cpp: Use new WTF::randomNumber() functionality.
16725 (JSC::mathProtoFuncRandom):
16726 * wtf/MathExtras.h: Move wtf_random / wtf_random_init to new files.
16727 * wtf/RandomNumber.cpp: Added.
16728 (WTF::randomNumber):
16729 * wtf/RandomNumber.h: Added.
16730 * wtf/RandomNumberSeed.h: Added. Internal usage within JSC only.
16731 (WTF::initializeRandomNumberGenerator):
16732 * wtf/ThreadingGtk.cpp: Rename wtf_random_init() to initializeRandomNumberGenerator().
16733 (WTF::initializeThreading):
16734 * wtf/ThreadingPthreads.cpp: Ditto.
16735 (WTF::initializeThreading):
16736 * wtf/ThreadingQt.cpp: Ditto.
16737 (WTF::initializeThreading):
16738 * wtf/ThreadingWin.cpp: Ditto.
16739 (WTF::initializeThreading):
16741 2008-12-16 Yael Aharon <yael.aharon@nokia.com>
16743 Reviewed by Tor Arne Vestbø.
16747 * JavaScriptCore.pri:
16749 2008-12-15 Mark Rowe <mrowe@apple.com>
16751 Reviewed by Cameron Zwarich.
16753 Fix the build with GCC 4.0.
16755 * Configurations/JavaScriptCore.xcconfig: GCC 4.0 appears to have a bug when compiling with -funwind-tables on,
16756 so don't use it with that compiler version.
16758 2008-12-15 Mark Rowe <mrowe@apple.com>
16760 Rubber-stamped by Cameron Zwarich.
16762 <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard.
16764 * Configurations/Base.xcconfig:
16765 * Configurations/DebugRelease.xcconfig:
16767 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
16769 Reviewed by Darin Adler.
16771 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard.
16773 * API/JSContextRef.cpp: (JSGlobalContextCreate):
16775 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
16777 Reviewed by Darin Adler.
16779 <rdar://problem/6445089> Mach ports leak from worker threads
16781 * interpreter/Interpreter.cpp: (JSC::getCPUTime):
16782 Deallocate the thread self port.
16784 2008-12-15 Gavin Barraclough <barraclough@apple.com>
16786 Reviewed by Mark Rowe.
16788 Construct stack frames in JIT code, so that backtracing can still work.
16789 <rdar://problem/6447870> JIT should play nice with attempts to take stack traces
16793 (JSC::JIT::privateCompileMainPass):
16795 2008-12-15 Mark Rowe <mrowe@apple.com>
16797 Reviewed by Gavin Barraclough.
16799 <rdar://problem/6402262> JavaScriptCore needs exception handling tables in order to get stack traces without frame pointers
16801 * Configurations/JavaScriptCore.xcconfig:
16803 2008-12-15 Gavin Barraclough <barraclough@apple.com>
16805 Rubber stamped by Mark Rowe.
16807 Revert r39226 / Bug 22818: Unify JIT callback argument access OS X / Windows
16808 This causes Acid3 failures – reverting for now & will revisit later.
16809 https://bugs.webkit.org/show_bug.cgi?id=22873
16811 * interpreter/Interpreter.h:
16813 (JSC::JIT::privateCompileCTIMachineTrampolines):
16815 * jit/JITInlineMethods.h:
16816 (JSC::JIT::restoreArgumentReference):
16817 (JSC::JIT::restoreArgumentReferenceForTrampoline):
16818 (JSC::JIT::emitCTICall_internal):
16819 * jit/JITPropertyAccess.cpp:
16820 (JSC::JIT::privateCompilePutByIdTransition):
16823 2008-12-15 Darin Adler <darin@apple.com>
16825 Reviewed by Sam Weinig.
16827 - fix <rdar://problem/6427048> crash due to infinite recursion after setting window.__proto__ = window
16829 Replaced toGlobalObject with the more generally useful unwrappedObject and used it to
16830 fix the cycle detection code in put(__proto__).
16832 * JavaScriptCore.exp: Updated.
16834 * runtime/JSGlobalObject.cpp: Removed toGlobalObject. We now use unwrappedObject instead.
16835 * runtime/JSGlobalObject.h:
16836 (JSC::JSGlobalObject::isGlobalObject): Ditto.
16838 * runtime/JSGlobalObjectFunctions.cpp:
16839 (JSC::globalFuncEval): Use unwrappedObject and isGlobalObject here rather than toGlobalObject.
16841 * runtime/JSObject.cpp:
16842 (JSC::JSObject::put): Rewrote prototype cycle checking loop. Use unwrappedObject in the loop now.
16843 (JSC::JSObject::unwrappedObject): Replaced toGlobalObject with this new function.
16844 * runtime/JSObject.h: More of the same.
16846 2008-12-15 Steve Falkenburg <sfalken@apple.com>
16850 Visual Studio requires visibility of forward declarations to match class declaration.
16852 * assembler/X86Assembler.h:
16854 2008-12-15 Gustavo Noronha Silva <kov@kov.eti.br>
16856 Reviewed by Mark Rowe.
16858 https://bugs.webkit.org/show_bug.cgi?id=22686
16864 2008-12-15 Gavin Barraclough <barraclough@apple.com>
16866 Reviewed by Geoff Garen.
16868 Add support to X86Assembler emitting instructions that access all 16 registers on x86-64.
16869 Add a new formating class, that is reponsible for both emitting the opcode bytes and the
16870 ModRm bytes of an instruction in a single call; this can insert the REX byte as necessary
16871 before the opcode, but has access to the register numbers to build the REX.
16873 * assembler/AssemblerBuffer.h:
16874 (JSC::AssemblerBuffer::isAligned):
16875 (JSC::AssemblerBuffer::data):
16876 * assembler/MacroAssembler.h:
16877 (JSC::MacroAssembler::addPtr):
16878 (JSC::MacroAssembler::add32):
16879 (JSC::MacroAssembler::and32):
16880 (JSC::MacroAssembler::or32):
16881 (JSC::MacroAssembler::sub32):
16882 (JSC::MacroAssembler::xor32):
16883 (JSC::MacroAssembler::loadPtr):
16884 (JSC::MacroAssembler::load32):
16885 (JSC::MacroAssembler::load16):
16886 (JSC::MacroAssembler::storePtr):
16887 (JSC::MacroAssembler::storePtrWithRepatch):
16888 (JSC::MacroAssembler::store32):
16889 (JSC::MacroAssembler::pop):
16890 (JSC::MacroAssembler::push):
16891 (JSC::MacroAssembler::compareImm32ForBranch):
16892 (JSC::MacroAssembler::compareImm32ForBranchEquality):
16893 (JSC::MacroAssembler::testImm32):
16894 (JSC::MacroAssembler::jae32):
16895 (JSC::MacroAssembler::jb32):
16896 (JSC::MacroAssembler::je16):
16897 (JSC::MacroAssembler::jg32):
16898 (JSC::MacroAssembler::jnePtr):
16899 (JSC::MacroAssembler::jne32):
16900 (JSC::MacroAssembler::jump):
16901 * assembler/X86Assembler.h:
16903 (JSC::X86Assembler::):
16904 (JSC::X86Assembler::size):
16905 (JSC::X86Assembler::push_r):
16906 (JSC::X86Assembler::pop_r):
16907 (JSC::X86Assembler::push_i32):
16908 (JSC::X86Assembler::push_m):
16909 (JSC::X86Assembler::pop_m):
16910 (JSC::X86Assembler::addl_rr):
16911 (JSC::X86Assembler::addl_mr):
16912 (JSC::X86Assembler::addl_ir):
16913 (JSC::X86Assembler::addq_ir):
16914 (JSC::X86Assembler::addl_im):
16915 (JSC::X86Assembler::andl_rr):
16916 (JSC::X86Assembler::andl_ir):
16917 (JSC::X86Assembler::orl_rr):
16918 (JSC::X86Assembler::orl_mr):
16919 (JSC::X86Assembler::orl_ir):
16920 (JSC::X86Assembler::subl_rr):
16921 (JSC::X86Assembler::subl_mr):
16922 (JSC::X86Assembler::subl_ir):
16923 (JSC::X86Assembler::subl_im):
16924 (JSC::X86Assembler::xorl_rr):
16925 (JSC::X86Assembler::xorl_ir):
16926 (JSC::X86Assembler::sarl_i8r):
16927 (JSC::X86Assembler::sarl_CLr):
16928 (JSC::X86Assembler::shll_i8r):
16929 (JSC::X86Assembler::shll_CLr):
16930 (JSC::X86Assembler::imull_rr):
16931 (JSC::X86Assembler::imull_i32r):
16932 (JSC::X86Assembler::idivl_r):
16933 (JSC::X86Assembler::cmpl_rr):
16934 (JSC::X86Assembler::cmpl_rm):
16935 (JSC::X86Assembler::cmpl_mr):
16936 (JSC::X86Assembler::cmpl_ir):
16937 (JSC::X86Assembler::cmpl_ir_force32):
16938 (JSC::X86Assembler::cmpl_im):
16939 (JSC::X86Assembler::cmpl_im_force32):
16940 (JSC::X86Assembler::cmpw_rm):
16941 (JSC::X86Assembler::testl_rr):
16942 (JSC::X86Assembler::testl_i32r):
16943 (JSC::X86Assembler::testl_i32m):
16944 (JSC::X86Assembler::testq_rr):
16945 (JSC::X86Assembler::testq_i32r):
16946 (JSC::X86Assembler::testb_i8r):
16947 (JSC::X86Assembler::sete_r):
16948 (JSC::X86Assembler::setz_r):
16949 (JSC::X86Assembler::setne_r):
16950 (JSC::X86Assembler::setnz_r):
16951 (JSC::X86Assembler::cdq):
16952 (JSC::X86Assembler::xchgl_rr):
16953 (JSC::X86Assembler::movl_rr):
16954 (JSC::X86Assembler::movl_rm):
16955 (JSC::X86Assembler::movl_mr):
16956 (JSC::X86Assembler::movl_i32r):
16957 (JSC::X86Assembler::movl_i32m):
16958 (JSC::X86Assembler::movq_rr):
16959 (JSC::X86Assembler::movq_rm):
16960 (JSC::X86Assembler::movq_mr):
16961 (JSC::X86Assembler::movzwl_mr):
16962 (JSC::X86Assembler::movzbl_rr):
16963 (JSC::X86Assembler::leal_mr):
16964 (JSC::X86Assembler::call):
16965 (JSC::X86Assembler::jmp):
16966 (JSC::X86Assembler::jmp_r):
16967 (JSC::X86Assembler::jmp_m):
16968 (JSC::X86Assembler::jne):
16969 (JSC::X86Assembler::jnz):
16970 (JSC::X86Assembler::je):
16971 (JSC::X86Assembler::jl):
16972 (JSC::X86Assembler::jb):
16973 (JSC::X86Assembler::jle):
16974 (JSC::X86Assembler::jbe):
16975 (JSC::X86Assembler::jge):
16976 (JSC::X86Assembler::jg):
16977 (JSC::X86Assembler::ja):
16978 (JSC::X86Assembler::jae):
16979 (JSC::X86Assembler::jo):
16980 (JSC::X86Assembler::jp):
16981 (JSC::X86Assembler::js):
16982 (JSC::X86Assembler::addsd_rr):
16983 (JSC::X86Assembler::addsd_mr):
16984 (JSC::X86Assembler::cvtsi2sd_rr):
16985 (JSC::X86Assembler::cvttsd2si_rr):
16986 (JSC::X86Assembler::movd_rr):
16987 (JSC::X86Assembler::movsd_rm):
16988 (JSC::X86Assembler::movsd_mr):
16989 (JSC::X86Assembler::mulsd_rr):
16990 (JSC::X86Assembler::mulsd_mr):
16991 (JSC::X86Assembler::pextrw_irr):
16992 (JSC::X86Assembler::subsd_rr):
16993 (JSC::X86Assembler::subsd_mr):
16994 (JSC::X86Assembler::ucomis_rr):
16995 (JSC::X86Assembler::int3):
16996 (JSC::X86Assembler::ret):
16997 (JSC::X86Assembler::predictNotTaken):
16998 (JSC::X86Assembler::label):
16999 (JSC::X86Assembler::align):
17000 (JSC::X86Assembler::link):
17001 (JSC::X86Assembler::executableCopy):
17002 (JSC::X86Assembler::X86InstructionFormater::prefix):
17003 (JSC::X86Assembler::X86InstructionFormater::oneByteOp):
17004 (JSC::X86Assembler::X86InstructionFormater::twoByteOp):
17005 (JSC::X86Assembler::X86InstructionFormater::oneByteOp64):
17006 (JSC::X86Assembler::X86InstructionFormater::oneByteOp8):
17007 (JSC::X86Assembler::X86InstructionFormater::twoByteOp8):
17008 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate8):
17009 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate32):
17010 (JSC::X86Assembler::X86InstructionFormater::instructionRel32):
17011 (JSC::X86Assembler::X86InstructionFormater::size):
17012 (JSC::X86Assembler::X86InstructionFormater::isAligned):
17013 (JSC::X86Assembler::X86InstructionFormater::data):
17014 (JSC::X86Assembler::X86InstructionFormater::executableCopy):
17015 (JSC::X86Assembler::X86InstructionFormater::registerModRM):
17016 (JSC::X86Assembler::X86InstructionFormater::memoryModRM):
17018 (JSC::JIT::privateCompileMainPass):
17019 (JSC::JIT::privateCompile):
17020 (JSC::JIT::privateCompileCTIMachineTrampolines):
17021 * jit/JITArithmetic.cpp:
17022 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
17023 (JSC::JIT::compileBinaryArithOp):
17025 (JSC::JIT::compileOpCall):
17026 (JSC::JIT::compileOpCallSlowCase):
17027 * jit/JITPropertyAccess.cpp:
17028 (JSC::JIT::compileGetByIdHotPath):
17029 (JSC::JIT::compilePutByIdHotPath):
17030 (JSC::JIT::privateCompilePutByIdTransition):
17031 (JSC::JIT::privateCompilePatchGetArrayLength):
17032 (JSC::JIT::privateCompileGetByIdProto):
17033 (JSC::JIT::privateCompileGetByIdProtoList):
17034 (JSC::JIT::privateCompileGetByIdChainList):
17035 (JSC::JIT::privateCompileGetByIdChain):
17037 2008-12-15 Darin Adler <darin@apple.com>
17039 * interpreter/RegisterFile.h: Tweak include formatting.
17041 2008-12-15 Holger Hans Peter Freyther <zecke@selfish.org>
17043 Build fix for Gtk+.
17045 * interpreter/RegisterFile.h: Include stdio.h for fprintf
17047 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
17049 Reviewed by Oliver Hunt.
17051 <rdar://problem/6444455> Worker Thread crash running multiple workers for a moderate amount of time
17053 * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile):
17054 Improve error handling: if mmap fails, crash immediately, and print out the reason.
17056 2008-12-13 Gavin Barraclough <barraclough@apple.com>
17058 Reviewed by Cameron Zwarich.
17060 Re-enable WREC on 64-bit.
17061 Implements one of the MacroAssembler::jnzPtr methods, previously only implemented for 32-bit x86.
17063 https://bugs.webkit.org/show_bug.cgi?id=22849
17065 * assembler/MacroAssembler.h:
17066 (JSC::MacroAssembler::testImm64):
17067 (JSC::MacroAssembler::jnzPtr):
17068 * assembler/X86Assembler.h:
17069 (JSC::X86Assembler::testq_i32r):
17070 (JSC::X86Assembler::testq_rr):
17073 2008-12-13 Gavin Barraclough <barraclough@apple.com>
17077 * assembler/MacroAssembler.h:
17079 2008-12-13 Gavin Barraclough <barraclough@apple.com>
17081 Build fix only, no review.
17083 * bytecode/CodeBlock.h:
17085 2008-12-13 Gavin Barraclough <barraclough@apple.com>
17087 Reviewed by Cameron Zwarich.
17089 Port the remainder of the JIT, bar calling convention related code, and code
17090 implementing optimizations which can be disabled, to use the MacroAssembler.
17092 * assembler/MacroAssembler.h:
17093 (JSC::MacroAssembler::DataLabelPtr::DataLabelPtr):
17094 (JSC::MacroAssembler::RepatchBuffer::RepatchBuffer):
17095 (JSC::MacroAssembler::RepatchBuffer::link):
17096 (JSC::MacroAssembler::RepatchBuffer::addressOf):
17097 (JSC::MacroAssembler::RepatchBuffer::setPtr):
17098 (JSC::MacroAssembler::addPtr):
17099 (JSC::MacroAssembler::lshift32):
17100 (JSC::MacroAssembler::mod32):
17101 (JSC::MacroAssembler::rshift32):
17102 (JSC::MacroAssembler::storePtrWithRepatch):
17103 (JSC::MacroAssembler::jnzPtr):
17104 (JSC::MacroAssembler::jzPtr):
17105 (JSC::MacroAssembler::jump):
17106 (JSC::MacroAssembler::label):
17107 * assembler/X86Assembler.h:
17108 (JSC::X86Assembler::):
17109 (JSC::X86Assembler::xchgl_rr):
17110 (JSC::X86Assembler::jmp_m):
17111 (JSC::X86Assembler::repatchAddress):
17112 (JSC::X86Assembler::getRelocatedAddress):
17113 * bytecode/CodeBlock.cpp:
17114 (JSC::CodeBlock::CodeBlock):
17115 * bytecode/CodeBlock.h:
17116 (JSC::JITCodeRef::JITCodeRef):
17117 (JSC::CodeBlock::setJITCode):
17118 (JSC::CodeBlock::jitCode):
17119 (JSC::CodeBlock::executablePool):
17121 (JSC::JIT::privateCompileMainPass):
17122 (JSC::JIT::privateCompileLinkPass):
17123 (JSC::JIT::privateCompile):
17124 (JSC::JIT::privateCompileCTIMachineTrampolines):
17126 (JSC::CallRecord::CallRecord):
17127 (JSC::JumpTable::JumpTable):
17128 (JSC::JIT::emitCTICall):
17129 (JSC::JIT::JSRInfo::JSRInfo):
17130 * jit/JITArithmetic.cpp:
17132 * jit/JITInlineMethods.h:
17133 (JSC::JIT::emitNakedCall):
17134 (JSC::JIT::emitCTICall_internal):
17135 (JSC::JIT::checkStructure):
17136 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
17137 (JSC::JIT::addSlowCase):
17138 (JSC::JIT::addJump):
17139 (JSC::JIT::emitJumpSlowToHot):
17140 * jit/JITPropertyAccess.cpp:
17141 (JSC::JIT::privateCompileGetByIdChainList):
17142 (JSC::JIT::privateCompileGetByIdChain):
17144 2008-12-12 Cameron Zwarich <zwarich@apple.com>
17146 Reviewed by Sam Weinig.
17148 Fix the failures of the following layout tests, which regressed in
17151 fast/dom/StyleSheet/ownerNode-lifetime-2.html
17152 fast/xsl/transform-xhr-doc.xhtml
17154 The binary search in CodeBlock::getByIdExceptionInfoForBytecodeOffset()
17155 doesn't guarantee that it actually finds a match, so add an explicit check
17158 * bytecode/CodeBlock.cpp:
17159 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
17161 2008-12-12 Gavin Barraclough <barraclough@apple.com>
17163 Reviewed by Cameron Zwarich.
17165 Replace emitPutCallArg methods with emitPutJITStubArg methods. Primarily to make the argument numbering
17166 more sensible (1-based incrementing by 1, rather than 0-based incrementing by 4). The CTI name also seems
17167 to be being deprecated from the code generally.
17170 (JSC::JIT::privateCompileMainPass):
17171 (JSC::JIT::privateCompileSlowCases):
17172 (JSC::JIT::privateCompileCTIMachineTrampolines):
17174 * jit/JITArithmetic.cpp:
17175 (JSC::JIT::compileBinaryArithOp):
17176 (JSC::JIT::compileBinaryArithOpSlowCase):
17178 (JSC::JIT::compileOpCallSetupArgs):
17179 (JSC::JIT::compileOpCallEvalSetupArgs):
17180 (JSC::JIT::compileOpConstructSetupArgs):
17181 (JSC::JIT::compileOpCall):
17182 * jit/JITInlineMethods.h:
17183 (JSC::JIT::emitPutJITStubArg):
17184 (JSC::JIT::emitPutJITStubArgConstant):
17185 (JSC::JIT::emitGetJITStubArg):
17186 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
17187 * jit/JITPropertyAccess.cpp:
17188 (JSC::JIT::compileGetByIdHotPath):
17189 (JSC::JIT::compilePutByIdHotPath):
17190 (JSC::JIT::compileGetByIdSlowCase):
17191 (JSC::JIT::compilePutByIdSlowCase):
17193 2008-12-12 Gavin Barraclough <barraclough@apple.com>
17195 Fix windows builds.
17198 (JSC::JIT::privateCompileMainPass):
17199 (JSC::JIT::privateCompileSlowCases):
17200 (JSC::JIT::privateCompile):
17202 2008-12-12 Gavin Barraclough <barraclough@apple.com>
17204 Reviewed by Geoff Garen.
17206 Remove loop counter 'i' from the JIT generation passes, replace with a member m_bytecodeIndex.
17208 No impact on performance.
17211 (JSC::JIT::compileOpStrictEq):
17212 (JSC::JIT::emitSlowScriptCheck):
17213 (JSC::JIT::privateCompileMainPass):
17214 (JSC::JIT::privateCompileSlowCases):
17215 (JSC::JIT::privateCompile):
17217 (JSC::CallRecord::CallRecord):
17218 (JSC::JmpTable::JmpTable):
17219 (JSC::JIT::emitCTICall):
17220 * jit/JITArithmetic.cpp:
17221 (JSC::JIT::compileBinaryArithOp):
17222 (JSC::JIT::compileBinaryArithOpSlowCase):
17224 (JSC::JIT::compileOpCall):
17225 (JSC::JIT::compileOpCallSlowCase):
17226 * jit/JITInlineMethods.h:
17227 (JSC::JIT::emitGetVirtualRegister):
17228 (JSC::JIT::emitGetVirtualRegisters):
17229 (JSC::JIT::emitNakedCall):
17230 (JSC::JIT::emitCTICall_internal):
17231 (JSC::JIT::emitJumpSlowCaseIfJSCell):
17232 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
17233 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
17234 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
17235 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
17236 (JSC::JIT::addSlowCase):
17237 (JSC::JIT::addJump):
17238 (JSC::JIT::emitJumpSlowToHot):
17239 * jit/JITPropertyAccess.cpp:
17240 (JSC::JIT::compileGetByIdHotPath):
17241 (JSC::JIT::compileGetByIdSlowCase):
17242 (JSC::JIT::compilePutByIdHotPath):
17243 (JSC::JIT::compilePutByIdSlowCase):
17245 2008-12-12 Sam Weinig <sam@webkit.org>
17247 Reviewed by Cameron Zwarich.
17249 <rdar://problem/6428342> Look into feasibility of discarding bytecode after native codegen
17251 Move more JIT functionality to using offsets into the Instruction buffer
17252 instead of raw pointers. Two to go!
17254 * interpreter/Interpreter.cpp:
17255 (JSC::bytecodeOffsetForPC): Rename from vPCForPC.
17256 (JSC::Interpreter::resolve): Pass offset to exception helper.
17257 (JSC::Interpreter::resolveSkip): Ditto.
17258 (JSC::Interpreter::resolveGlobal): Ditto.
17259 (JSC::Interpreter::resolveBaseAndProperty): Ditto.
17260 (JSC::Interpreter::resolveBaseAndFunc): Ditto.
17261 (JSC::isNotObject): Ditto.
17262 (JSC::Interpreter::unwindCallFrame): Call bytecodeOffsetForPC.
17263 (JSC::Interpreter::throwException): Use offsets instead of vPCs.
17264 (JSC::Interpreter::privateExecute): Pass offset to exception helper.
17265 (JSC::Interpreter::retrieveLastCaller): Ditto.
17266 (JSC::Interpreter::cti_op_instanceof): Ditto.
17267 (JSC::Interpreter::cti_op_call_NotJSFunction): Ditto.
17268 (JSC::Interpreter::cti_op_resolve): Pass offset to exception helper.
17269 (JSC::Interpreter::cti_op_construct_NotJSConstruct): Ditto.
17270 (JSC::Interpreter::cti_op_resolve_func): Ditto.
17271 (JSC::Interpreter::cti_op_resolve_skip): Ditto.
17272 (JSC::Interpreter::cti_op_resolve_global): Ditto.
17273 (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
17274 (JSC::Interpreter::cti_op_throw): Ditto.
17275 (JSC::Interpreter::cti_op_in): Ditto.
17276 (JSC::Interpreter::cti_vm_throw): Ditto.
17277 * interpreter/Interpreter.h:
17280 (JSC::JIT::privateCompileMainPass): Don't pass unnecessary vPC to stub.
17281 * jit/JIT.h: Remove ARG_instr1 - ARG_instr3 and ARG_instr5 - ARG_instr6.
17283 (JSC::JIT::compileOpCallEvalSetupArgs): Don't pass unnecessary vPC to stub..
17284 (JSC::JIT::compileOpConstructSetupArgs): Ditto.
17286 * runtime/ExceptionHelpers.cpp:
17287 (JSC::createUndefinedVariableError): Take an offset instead of vPC.
17288 (JSC::createInvalidParamError): Ditto.
17289 (JSC::createNotAConstructorError): Ditto.
17290 (JSC::createNotAFunctionError): Ditto.
17291 (JSC::createNotAnObjectError): Ditto.
17292 * runtime/ExceptionHelpers.h:
17294 2008-12-12 Cameron Zwarich <zwarich@apple.com>
17296 Reviewed by Oliver Hunt.
17298 Bug 22835: Crash during bytecode generation when comparing to null
17299 <https://bugs.webkit.org/show_bug.cgi?id=22835>
17300 <rdar://problem/6286749>
17302 Change the special cases in bytecode generation for comparison to null
17303 to use tempDestination().
17305 * parser/Nodes.cpp:
17306 (JSC::BinaryOpNode::emitBytecode):
17307 (JSC::EqualNode::emitBytecode):
17309 2008-12-12 Gavin Barraclough <barraclough@apple.com>
17311 Reviewed by Geoff Garen.
17313 Move slow-cases of JIT code generation over to the MacroAssembler interface.
17315 * assembler/MacroAssembler.h:
17316 (JSC::MacroAssembler::Label::Label):
17317 (JSC::MacroAssembler::jae32):
17318 (JSC::MacroAssembler::jg32):
17319 (JSC::MacroAssembler::jzPtr):
17321 (JSC::JIT::privateCompileSlowCases):
17322 (JSC::JIT::privateCompile):
17323 (JSC::JIT::emitGetVariableObjectRegister):
17324 (JSC::JIT::emitPutVariableObjectRegister):
17326 (JSC::SlowCaseEntry::SlowCaseEntry):
17327 (JSC::JIT::getSlowCase):
17328 (JSC::JIT::linkSlowCase):
17329 * jit/JITArithmetic.cpp:
17330 (JSC::JIT::compileBinaryArithOpSlowCase):
17332 (JSC::JIT::compileOpCallInitializeCallFrame):
17333 (JSC::JIT::compileOpCall):
17334 (JSC::JIT::compileOpCallSlowCase):
17335 * jit/JITInlineMethods.h:
17336 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
17337 (JSC::JIT::linkSlowCaseIfNotJSCell):
17338 * jit/JITPropertyAccess.cpp:
17339 (JSC::JIT::compileGetByIdHotPath):
17340 (JSC::JIT::compilePutByIdHotPath):
17341 (JSC::JIT::compileGetByIdSlowCase):
17342 (JSC::JIT::compilePutByIdSlowCase):
17344 2008-12-12 Cameron Zwarich <zwarich@apple.com>
17346 Reviewed by Sam Weinig.
17348 Bug 22828: Do not inspect bytecode instruction stream for op_get_by_id exception information
17349 <https://bugs.webkit.org/show_bug.cgi?id=22828>
17351 In order to remove the bytecode instruction stream after generating
17352 native code, all inspection of bytecode instructions at runtime must
17353 be removed. One particular instance of this is the special handling of
17354 exceptions thrown by the op_get_by_id emitted directly before an
17355 op_construct or an op_instanceof. This patch moves that information to
17356 an auxiliary data structure in CodeBlock.
17358 * bytecode/CodeBlock.cpp:
17359 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
17360 * bytecode/CodeBlock.h:
17361 (JSC::CodeBlock::addGetByIdExceptionInfo):
17362 * bytecompiler/BytecodeGenerator.cpp:
17363 (JSC::BytecodeGenerator::emitConstruct):
17364 * bytecompiler/BytecodeGenerator.h:
17365 (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
17366 * parser/Nodes.cpp:
17367 (JSC::InstanceOfNode::emitBytecode):
17368 * runtime/ExceptionHelpers.cpp:
17369 (JSC::createNotAnObjectError):
17371 2008-12-12 Sam Weinig <sam@webkit.org>
17373 Reviewed by Geoffrey Garen.
17375 Change exception information accessors to take offsets into the bytecode
17376 instruction buffer instead of pointers so that they can work even even
17377 if the bytecode buffer is purged.
17379 * bytecode/CodeBlock.cpp:
17380 (JSC::instructionOffsetForNth):
17381 (JSC::CodeBlock::handlerForBytecodeOffset):
17382 (JSC::CodeBlock::lineNumberForBytecodeOffset):
17383 (JSC::CodeBlock::expressionRangeForBytecodeOffset):
17384 * bytecode/CodeBlock.h:
17385 * bytecode/SamplingTool.cpp:
17386 (JSC::SamplingTool::dump):
17387 * interpreter/Interpreter.cpp:
17388 (JSC::Interpreter::throwException):
17389 (JSC::Interpreter::privateExecute):
17390 (JSC::Interpreter::retrieveLastCaller):
17392 (JSC::JIT::privateCompileMainPass):
17393 * runtime/ExceptionHelpers.cpp:
17394 (JSC::createUndefinedVariableError):
17395 (JSC::createInvalidParamError):
17396 (JSC::createNotAConstructorError):
17397 (JSC::createNotAFunctionError):
17398 (JSC::createNotAnObjectError):
17400 2008-12-12 Geoffrey Garen <ggaren@apple.com>
17402 Reviewed by Cameron Zwarich.
17404 Tiny bit of refactoring in quantifier generation.
17406 * wrec/WRECGenerator.cpp:
17407 (JSC::WREC::Generator::generateNonGreedyQuantifier):
17408 (JSC::WREC::Generator::generateGreedyQuantifier):
17410 2008-12-11 Sam Weinig <sam@webkit.org>
17412 Reviewed by Geoffrey Garen.
17414 Remove dependancy on having the Instruction buffer in order to
17415 deref Structures used for property access and global resolves.
17416 Instead, we put references to the necessary Structures in auxiliary
17417 data structures on the CodeBlock. This is not an ideal solution,
17418 as we still pay for having the Structures in two places and we
17419 would like to eventually just hold on to offsets into the machine
17422 - Also removes CodeBlock bloat in non-JIT by #ifdefing the JIT
17423 only data structures.
17426 * JavaScriptCore.pri:
17427 * JavaScriptCore.scons:
17428 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
17429 * JavaScriptCore.xcodeproj/project.pbxproj:
17430 * JavaScriptCoreSources.bkl:
17431 * bytecode/CodeBlock.cpp:
17432 (JSC::isGlobalResolve):
17433 (JSC::isPropertyAccess):
17434 (JSC::instructionOffsetForNth):
17435 (JSC::printGlobalResolveInfo):
17436 (JSC::printStructureStubInfo):
17437 (JSC::CodeBlock::printStructures):
17438 (JSC::CodeBlock::dump):
17439 (JSC::CodeBlock::~CodeBlock):
17440 (JSC::CodeBlock::shrinkToFit):
17441 * bytecode/CodeBlock.h:
17442 (JSC::GlobalResolveInfo::GlobalResolveInfo):
17443 (JSC::getNativePC):
17444 (JSC::CodeBlock::instructions):
17445 (JSC::CodeBlock::getStubInfo):
17446 (JSC::CodeBlock::getBytecodeIndex):
17447 (JSC::CodeBlock::addPropertyAccessInstruction):
17448 (JSC::CodeBlock::addGlobalResolveInstruction):
17449 (JSC::CodeBlock::numberOfStructureStubInfos):
17450 (JSC::CodeBlock::addStructureStubInfo):
17451 (JSC::CodeBlock::structureStubInfo):
17452 (JSC::CodeBlock::addGlobalResolveInfo):
17453 (JSC::CodeBlock::globalResolveInfo):
17454 (JSC::CodeBlock::numberOfCallLinkInfos):
17455 (JSC::CodeBlock::addCallLinkInfo):
17456 (JSC::CodeBlock::callLinkInfo):
17457 * bytecode/Instruction.h:
17458 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
17459 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
17460 * bytecode/Opcode.h:
17462 * bytecode/StructureStubInfo.cpp: Copied from bytecode/CodeBlock.cpp.
17463 (JSC::StructureStubInfo::deref):
17464 * bytecode/StructureStubInfo.h: Copied from bytecode/CodeBlock.h.
17465 (JSC::StructureStubInfo::StructureStubInfo):
17466 (JSC::StructureStubInfo::initGetByIdSelf):
17467 (JSC::StructureStubInfo::initGetByIdProto):
17468 (JSC::StructureStubInfo::initGetByIdChain):
17469 (JSC::StructureStubInfo::initGetByIdSelfList):
17470 (JSC::StructureStubInfo::initGetByIdProtoList):
17471 (JSC::StructureStubInfo::initPutByIdTransition):
17472 (JSC::StructureStubInfo::initPutByIdReplace):
17473 (JSC::StructureStubInfo::):
17474 * bytecompiler/BytecodeGenerator.cpp:
17475 (JSC::BytecodeGenerator::emitResolve):
17476 (JSC::BytecodeGenerator::emitGetById):
17477 (JSC::BytecodeGenerator::emitPutById):
17478 (JSC::BytecodeGenerator::emitCall):
17479 (JSC::BytecodeGenerator::emitConstruct):
17480 (JSC::BytecodeGenerator::emitCatch):
17481 * interpreter/Interpreter.cpp:
17482 (JSC::Interpreter::tryCTICachePutByID):
17483 (JSC::Interpreter::tryCTICacheGetByID):
17484 (JSC::Interpreter::cti_op_get_by_id_self_fail):
17485 (JSC::getPolymorphicAccessStructureListSlot):
17486 (JSC::Interpreter::cti_op_get_by_id_proto_list):
17487 (JSC::Interpreter::cti_op_resolve_global):
17490 (JSC::JIT::privateCompileMainPass):
17491 (JSC::JIT::privateCompileSlowCases):
17492 (JSC::JIT::privateCompile):
17493 * jit/JITPropertyAccess.cpp:
17494 (JSC::JIT::compileGetByIdHotPath):
17495 (JSC::JIT::compilePutByIdHotPath):
17496 (JSC::JIT::compileGetByIdSlowCase):
17497 (JSC::JIT::compilePutByIdSlowCase):
17498 (JSC::JIT::privateCompileGetByIdSelfList):
17499 (JSC::JIT::privateCompileGetByIdProtoList):
17500 (JSC::JIT::privateCompileGetByIdChainList):
17502 2008-12-11 Gavin Barraclough <barraclough@apple.com>
17504 Reviewed by Oliver Hunt.
17506 Remove CTI_ARGUMENTS mode, use va_start implementation on Windows,
17507 unifying JIT callback (cti_*) argument access on OS X & Windows
17509 No performance impact.
17511 * interpreter/Interpreter.h:
17513 (JSC::JIT::privateCompileCTIMachineTrampolines):
17515 * jit/JITInlineMethods.h:
17516 (JSC::JIT::emitCTICall):
17517 * jit/JITPropertyAccess.cpp:
17518 (JSC::JIT::privateCompilePutByIdTransition):
17521 2008-12-11 Holger Freyther <zecke@selfish.org>
17523 Reviewed by Simon Hausmann.
17525 https://bugs.webkit.org/show_bug.cgi?id=20953
17527 For Qt it is not pratical to have a FontCache and GlyphPageTreeNode
17528 implementation. This is one of the reasons why the Qt port is currently not
17529 using WebCore/platform/graphics/Font.cpp. By allowing to not use
17530 the simple/fast-path the Qt port will be able to use it.
17532 Introduce USE(FONT_FAST_PATH) and define it for every port but the
17535 * wtf/Platform.h: Enable USE(FONT_FAST_PATH)
17537 2008-12-11 Gabor Loki <loki@inf.u-szeged.hu>
17539 Reviewed by Darin Adler and landed by Holger Freyther.
17541 <https://bugs.webkit.org/show_bug.cgi?id=22648>
17542 Fix threading on Qt-port and Gtk-port for Sampling tool.
17544 * wtf/ThreadingGtk.cpp:
17545 (WTF::waitForThreadCompletion):
17546 * wtf/ThreadingQt.cpp:
17547 (WTF::waitForThreadCompletion):
17549 2008-12-10 Cameron Zwarich <zwarich@apple.com>
17551 Reviewed by Oliver Hunt.
17553 Bug 22734: Debugger crashes when stepping into a function call in a return statement
17554 <https://bugs.webkit.org/show_bug.cgi?id=22734>
17555 <rdar://problem/6426796>
17557 * bytecompiler/BytecodeGenerator.cpp:
17558 (JSC::BytecodeGenerator::BytecodeGenerator): The DebuggerCallFrame uses
17559 the 'this' value stored in a callFrame, so op_convert_this should be
17560 emitted at the beginning of a function body when generating bytecode
17562 * debugger/DebuggerCallFrame.cpp:
17563 (JSC::DebuggerCallFrame::thisObject): The assertion inherent in the call
17564 to asObject() here is valid, because any 'this' value should have been
17565 converted to a JSObject*.
17567 2008-12-10 Gavin Barraclough <barraclough@apple.com>
17569 Reviewed by Geoff Garen.
17571 Port more of the JIT to use the MacroAssembler interface.
17573 Everything in the main pass, bar a few corner cases (operations with required
17574 registers, or calling convention code). Slightly refactors array creation,
17575 moving the offset calculation into the callFrame into C code (reducing code
17578 Overall this appears to be a 1% win on v8-tests, due to the smaller immediates
17579 being planted (in jfalse in particular).
17581 * interpreter/Interpreter.cpp:
17582 (JSC::Interpreter::cti_op_new_array):
17584 (JSC::JIT::privateCompileMainPass):
17585 (JSC::JIT::privateCompileSlowCases):
17587 * wrec/WRECGenerator.cpp:
17588 (JSC::WREC::Generator::generateEnter):
17590 2008-12-10 Sam Weinig <sam@webkit.org>
17592 Fix non-JIT builds.
17594 * bytecode/CodeBlock.h:
17596 2008-12-10 Sam Weinig <sam@webkit.org>
17598 Reviewed by Geoffrey Garen.
17600 <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
17604 Convert the return address table from a HashMap to a sorted Vector. This
17605 reduces the size of the data structure by ~4.5MB on Membuster head.
17607 SunSpider reports a 0.5% progression.
17609 * bytecode/CodeBlock.cpp:
17610 (JSC::sizeInBytes): Generic method to get the cost of a Vector.
17611 (JSC::CodeBlock::dumpStatistics): Add dumping of member sizes.
17612 * bytecode/CodeBlock.h:
17613 (JSC::PC::PC): Struct representing NativePC -> VirtualPC mappings.
17614 (JSC::getNativePC): Helper for binary chop.
17615 (JSC::CodeBlock::getBytecodeIndex): Used to get the VirtualPC from a
17616 NativePC using a binary chop of the pcVector.
17617 (JSC::CodeBlock::pcVector): Accessor.
17619 * interpreter/Interpreter.cpp:
17620 (JSC::vPCForPC): Use getBytecodeIndex instead of jitReturnAddressVPCMap().get().
17621 (JSC::Interpreter::cti_op_instanceof): Ditto.
17622 (JSC::Interpreter::cti_op_resolve): Ditto.
17623 (JSC::Interpreter::cti_op_resolve_func): Ditto.
17624 (JSC::Interpreter::cti_op_resolve_skip): Ditto.
17625 (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
17626 (JSC::Interpreter::cti_op_throw): Ditto.
17627 (JSC::Interpreter::cti_op_in): Ditto.
17628 (JSC::Interpreter::cti_vm_throw): Ditto.
17631 (JSC::JIT::privateCompile): Reserve exact capacity and fill the pcVector.
17633 2008-12-09 Geoffrey Garen <ggaren@apple.com>
17635 Reviewed by Oliver Hunt.
17637 Added WREC support for an assertion followed by a quantifier. Fixed
17640 * wrec/WRECParser.cpp:
17641 (JSC::WREC::Parser::parseParentheses): Throw away the quantifier, since
17642 it's meaningless. (Firefox does the same.)
17644 * pcre/pcre_compile.cpp:
17645 (compileBranch): ditto.
17647 2008-12-09 Geoffrey Garen <ggaren@apple.com>
17649 Reviewed by Cameron Zwarich.
17651 In preparation for compiling WREC without PCRE:
17653 Further relaxed WREC's parsing to be more web-compatible. Fixed PCRE to
17654 match in cases where it didn't already.
17656 Changed JavaScriptCore to report syntax errors detected by WREC, rather
17657 than falling back on PCRE any time WREC sees an error.
17659 * pcre/pcre_compile.cpp:
17660 (checkEscape): Relaxed parsing of \c and \N escapes to be more
17663 * runtime/RegExp.cpp:
17664 (JSC::RegExp::RegExp): Only fall back on PCRE if WREC has not reported
17668 (JSC::WREC::Generator::compileRegExp): Fixed some error reporting to
17671 * wrec/WRECParser.cpp: Added error messages that match PCRE.
17673 (JSC::WREC::Parser::consumeGreedyQuantifier):
17674 (JSC::WREC::Parser::parseParentheses):
17675 (JSC::WREC::Parser::parseCharacterClass):
17676 (JSC::WREC::Parser::parseNonCharacterEscape): Updated the above functions to
17677 use the new setError API.
17679 (JSC::WREC::Parser::consumeEscape): Relaxed parsing of \c \N \u \x \B
17680 to be more web-compatible.
17682 (JSC::WREC::Parser::parseAlternative): Distinguish between a malformed
17683 quantifier and a quantifier with no prefix, like PCRE does.
17685 (JSC::WREC::Parser::consumeParenthesesType): Updated to use the new setError API.
17687 * wrec/WRECParser.h:
17688 (JSC::WREC::Parser::error):
17689 (JSC::WREC::Parser::syntaxError):
17690 (JSC::WREC::Parser::parsePattern):
17691 (JSC::WREC::Parser::reset):
17692 (JSC::WREC::Parser::setError): Store error messages instead of error codes,
17693 to provide for exception messages. Use a setter for reporting errors, so
17694 errors detected early are not overwritten by errors detected later.
17696 2008-12-09 Gavin Barraclough <barraclough@apple.com>
17698 Reviewed by Oliver Hunt.
17700 Use va_args to access cti function arguments.
17701 https://bugs.webkit.org/show_bug.cgi?id=22774
17703 This may be a minor regression, but we'll take the hit if so to reduce fragility.
17705 * interpreter/Interpreter.cpp:
17706 * interpreter/Interpreter.h:
17708 2008-12-09 Sam Weinig <sam@webkit.org>
17710 Reviewed twice by Cameron Zwarich.
17712 Fix for https://bugs.webkit.org/show_bug.cgi?id=22752
17713 Clear SymbolTable after codegen for Function codeblocks that
17714 don't require an activation
17716 This is a ~1.5MB improvement on Membuster-head.
17718 * bytecode/CodeBlock.cpp:
17719 (JSC::CodeBlock::dumpStatistics): Add logging of non-empty symbol tables
17720 and total size used by symbol tables.
17721 * bytecompiler/BytecodeGenerator.cpp:
17722 (JSC::BytecodeGenerator::generate): Clear the symbol table here.
17724 2008-12-09 Sam Weinig <sam@webkit.org>
17726 Reviewed by Geoffrey Garen.
17728 Remove unnecessary extra lookup when throwing an exception.
17729 We used to first lookup the target offset using getHandlerForVPC
17730 and then we would lookup the native code stub using
17731 nativeExceptionCodeForHandlerVPC. Instead, we can just pass around
17734 * bytecode/CodeBlock.cpp:
17735 (JSC::CodeBlock::handlerForVPC): Return the HandlerInfo.
17736 * bytecode/CodeBlock.h: Remove nativeExceptionCodeForHandlerVPC.
17738 * interpreter/Interpreter.cpp:
17739 (JSC::Interpreter::throwException): Return a HandlerInfo instead of
17740 and Instruction offset.
17741 (JSC::Interpreter::privateExecute): Get the offset from HandlerInfo.
17742 (JSC::Interpreter::cti_op_throw): Get the native code from the HandleInfo.
17743 (JSC::Interpreter::cti_vm_throw): Ditto.
17744 * interpreter/Interpreter.h:
17746 2008-12-09 Eric Seidel <eric@webkit.org>
17748 Build fix only, no review.
17750 Speculative fix for the Chromium-Windows bot.
17751 Add JavaScriptCore/os-win32 to the include path (for stdint.h)
17752 Strangely it builds fine on my local windows box (or at least doesn't hit this error)
17754 * JavaScriptCore.scons:
17756 2008-12-09 Eric Seidel <eric@webkit.org>
17758 No review, build fix only.
17760 Add ExecutableAllocator files missing from Scons build.
17762 * JavaScriptCore.scons:
17764 2008-12-09 Dimitri Glazkov <dglazkov@chromium.org>
17766 Reviewed by Timothy Hatcher.
17768 https://bugs.webkit.org/show_bug.cgi?id=22631
17769 Allow ScriptCallFrame query names of functions in the call stack.
17771 * JavaScriptCore.exp: added InternalFunction::name and
17772 UString operator==() as exported symbol
17774 2008-12-08 Judit Jasz <jasy@inf.u-szeged.hu>
17776 Reviewed and tweaked by Cameron Zwarich.
17778 Bug 22352: Annotate opcodes with their length
17779 <https://bugs.webkit.org/show_bug.cgi?id=22352>
17781 * bytecode/Opcode.cpp:
17782 * bytecode/Opcode.h:
17783 * interpreter/Interpreter.cpp:
17784 (JSC::Interpreter::privateExecute):
17786 (JSC::JIT::privateCompileMainPass):
17787 (JSC::JIT::privateCompileSlowCases):
17789 2008-12-08 Geoffrey Garen <ggaren@apple.com>
17791 Reviewed by Oliver Hunt.
17793 Implemented more of the relaxed and somewhat weird rules for deciding
17794 how to interpret a non-pattern-character.
17797 (JSC::WREC::Escape::):
17798 (JSC::WREC::Escape::Escape): Eliminated Escape::None because it was
17799 unused. If you see an '\\', it's either a valid escape or an error.
17801 * wrec/Quantifier.h:
17802 (JSC::WREC::Quantifier::Quantifier):
17803 * wrec/WRECGenerator.cpp:
17804 (JSC::WREC::Generator::generateNonGreedyQuantifier):
17805 (JSC::WREC::Generator::generateGreedyQuantifier): Renamed "noMaxSpecified"
17806 to "Infinity", since that's what it means.
17808 * wrec/WRECParser.cpp:
17809 (JSC::WREC::Parser::consumeGreedyQuantifier): Re-wrote {n,m} parsing rules
17810 because they were too strict before. Added support for backtracking
17811 in the case where the {n,m} fails to parse as a quantifier, and yet is
17812 not a syntax error.
17814 (JSC::WREC::Parser::parseCharacterClass):
17815 (JSC::WREC::Parser::parseNonCharacterEscape): Eliminated Escape::None,
17818 (JSC::WREC::Parser::consumeEscape): Don't treat ASCII and _ escapes
17819 as syntax errors. See fast/regex/non-pattern-characters.html.
17821 * wrec/WRECParser.h:
17822 (JSC::WREC::Parser::SavedState::SavedState):
17823 (JSC::WREC::Parser::SavedState::restore): Added a state backtracker,
17824 since parsing {n,m} forms requires backtracking if the form turns out
17825 not to be a quantifier.
17827 2008-12-08 Geoffrey Garen <ggaren@apple.com>
17829 Reviewed by Oliver Hunt.
17831 Refactored WREC parsing so that only one piece of code needs to know
17832 the relaxed and somewhat weird rules for deciding how to interpret a
17833 non-pattern-character, in preparation for implementing those rules.
17835 Also, implemented the relaxed and somewhat weird rules for '}' and ']'.
17837 * wrec/WREC.cpp: Reduced the regular expression size limit. Now that
17838 WREC handles ']' properly, it compiles fast/js/regexp-charclass-crash.html,
17839 which makes it hang at the old limit. (The old limit was based on the
17840 misimpression that the same value in PCRE limited the regular expression
17841 pattern size; in reality, it limited the expected compiled regular
17842 expression size. WREC doesn't have a way to calculate an expected
17843 compiled regular expression size, but this should be good enough.)
17845 * wrec/WRECParser.cpp:
17846 (JSC::WREC::parsePatternCharacterSequence): Nixed this function because
17847 it contained a second copy of the logic for handling non-pattern-characters,
17848 which is about to get a lot more complicated.
17850 (JSC::WREC::PatternCharacterSequence::PatternCharacterSequence):
17851 (JSC::WREC::PatternCharacterSequence::size):
17852 (JSC::WREC::PatternCharacterSequence::append):
17853 (JSC::WREC::PatternCharacterSequence::flush): Helper object for generating
17854 an optimized sequence of pattern characters.
17856 (JSC::WREC::Parser::parseNonCharacterEscape): Renamed to reflect the fact
17857 that the main parseAlternative loop handles character escapes.
17859 (JSC::WREC::Parser::parseAlternative): Moved pattern character sequence
17860 logic from parsePatternCharacterSequence to here, using
17861 PatternCharacterSequence to help with the details.
17863 * wrec/WRECParser.h: Updated for renames.
17865 2008-12-08 Alexey Proskuryakov <ap@webkit.org>
17867 Reviewed by Geoff Garen.
17869 <rdar://problem/6166088> Give JSGlobalContextCreate a behavior that is concurrency aware,
17870 and un-deprecate it
17872 * API/JSContextRef.cpp: (JSGlobalContextCreate):
17873 * API/JSContextRef.h:
17874 Use a unique context group for the context, unless the application was linked against old
17877 2008-12-08 Sam Weinig <sam@webkit.org>
17879 Reviewed by Cameron Zwarich.
17881 Fix for <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
17885 Remove use of jitReturnAddressVPCMap when looking for vPC to store Structures
17886 in for cached lookup. Instead, use the offset in the StructureStubInfo that is
17889 * bytecode/CodeBlock.cpp:
17890 (JSC::CodeBlock::dumpStatistics): Fix extraneous semicolon.
17891 * interpreter/Interpreter.cpp:
17892 (JSC::Interpreter::tryCTICachePutByID):
17893 (JSC::Interpreter::tryCTICacheGetByID):
17894 (JSC::Interpreter::cti_op_get_by_id_self_fail):
17895 (JSC::Interpreter::cti_op_get_by_id_proto_list):
17897 (JSC::JIT::compileGetByIdSelf):
17898 (JSC::JIT::compileGetByIdProto):
17899 (JSC::JIT::compileGetByIdChain):
17900 (JSC::JIT::compilePutByIdReplace):
17901 (JSC::JIT::compilePutByIdTransition):
17902 * jit/JITPropertyAccess.cpp:
17903 (JSC::JIT::privateCompilePutByIdTransition):
17904 (JSC::JIT::patchGetByIdSelf):
17905 (JSC::JIT::patchPutByIdReplace):
17906 (JSC::JIT::privateCompilePatchGetArrayLength): Remove extra call to getStubInfo.
17907 (JSC::JIT::privateCompileGetByIdSelf):
17908 (JSC::JIT::privateCompileGetByIdProto):
17909 (JSC::JIT::privateCompileGetByIdChain):
17910 (JSC::JIT::privateCompilePutByIdReplace):
17912 2008-12-08 Gavin Barraclough <barraclough@apple.com>
17914 Reviewed by Oliver Hunt.
17916 Port the op_j?n?eq_null JIT code generation to use the MacroAssembler,
17917 and clean up slightly at the same time. The 'j' forms currently compare,
17918 then set a register, then compare again, then branch. Branch directly on
17919 the result of the first compare.
17921 Around a 1% progression on deltablue, crypto & early boyer, for about 1/2%
17922 overall on v8-tests.
17925 (JSC::JIT::privateCompileMainPass):
17926 * jit/JITPropertyAccess.cpp:
17927 (JSC::JIT::compileGetByIdSlowCase):
17929 2008-12-08 Gavin Barraclough <barraclough@apple.com>
17931 Reviewed by Geoff Garen.
17933 Expand MacroAssembler to support more operations, required by the JIT.
17935 Generally adds more operations and permutations of operands to the existing
17936 interface. Rename 'jset' to 'jnz' and 'jnset' to 'jz', which seem clearer,
17937 and require that immediate pointer operands (though not pointer addresses to
17938 load and store instructions) are wrapped in a ImmPtr() type, akin to Imm32().
17940 No performance impact.
17942 * assembler/MacroAssembler.h:
17943 (JSC::MacroAssembler::):
17944 (JSC::MacroAssembler::ImmPtr::ImmPtr):
17945 (JSC::MacroAssembler::add32):
17946 (JSC::MacroAssembler::and32):
17947 (JSC::MacroAssembler::or32):
17948 (JSC::MacroAssembler::sub32):
17949 (JSC::MacroAssembler::xor32):
17950 (JSC::MacroAssembler::loadPtr):
17951 (JSC::MacroAssembler::load32):
17952 (JSC::MacroAssembler::storePtr):
17953 (JSC::MacroAssembler::store32):
17954 (JSC::MacroAssembler::poke):
17955 (JSC::MacroAssembler::move):
17956 (JSC::MacroAssembler::testImm32):
17957 (JSC::MacroAssembler::jae32):
17958 (JSC::MacroAssembler::jb32):
17959 (JSC::MacroAssembler::jePtr):
17960 (JSC::MacroAssembler::je32):
17961 (JSC::MacroAssembler::jnePtr):
17962 (JSC::MacroAssembler::jne32):
17963 (JSC::MacroAssembler::jnzPtr):
17964 (JSC::MacroAssembler::jnz32):
17965 (JSC::MacroAssembler::jzPtr):
17966 (JSC::MacroAssembler::jz32):
17967 (JSC::MacroAssembler::joSub32):
17968 (JSC::MacroAssembler::jump):
17969 (JSC::MacroAssembler::sete32):
17970 (JSC::MacroAssembler::setne32):
17971 (JSC::MacroAssembler::setnz32):
17972 (JSC::MacroAssembler::setz32):
17973 * assembler/X86Assembler.h:
17974 (JSC::X86Assembler::addl_mr):
17975 (JSC::X86Assembler::andl_i8r):
17976 (JSC::X86Assembler::cmpl_rm):
17977 (JSC::X86Assembler::cmpl_mr):
17978 (JSC::X86Assembler::cmpl_i8m):
17979 (JSC::X86Assembler::subl_mr):
17980 (JSC::X86Assembler::testl_i32m):
17981 (JSC::X86Assembler::xorl_i32r):
17982 (JSC::X86Assembler::movl_rm):
17983 (JSC::X86Assembler::modRm_opmsib):
17985 (JSC::JIT::privateCompileMainPass):
17986 * jit/JITInlineMethods.h:
17987 (JSC::JIT::emitGetVirtualRegister):
17988 (JSC::JIT::emitPutCTIArgConstant):
17989 (JSC::JIT::emitPutCTIParam):
17990 (JSC::JIT::emitPutImmediateToCallFrameHeader):
17991 (JSC::JIT::emitInitRegister):
17992 (JSC::JIT::checkStructure):
17993 (JSC::JIT::emitJumpIfJSCell):
17994 (JSC::JIT::emitJumpIfNotJSCell):
17995 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
17997 2008-12-08 Geoffrey Garen <ggaren@apple.com>
17999 Reviewed by Sam Weinig.
18001 Fixed a bug where WREC would allow a quantifier whose minimum was
18002 greater than its maximum.
18004 * wrec/Quantifier.h:
18005 (JSC::WREC::Quantifier::Quantifier): ASSERT that the quantifier is not
18008 * wrec/WRECParser.cpp:
18009 (JSC::WREC::Parser::consumeGreedyQuantifier): Verify that the minimum
18010 is not greater than the maximum.
18012 2008-12-08 Eric Seidel <eric@webkit.org>
18014 Build fix only, no review.
18016 * JavaScriptCore.scons: add bytecode/JumpTable.cpp
18018 2008-12-08 Sam Weinig <sam@webkit.org>
18020 Reviewed by Geoffrey Garen.
18022 Patch for https://bugs.webkit.org/show_bug.cgi?id=22716
18023 <rdar://problem/6428315>
18024 Add RareData structure to CodeBlock for infrequently used auxiliary data
18027 Reduces memory on Membuster-head by ~.5MB
18029 * bytecode/CodeBlock.cpp:
18030 (JSC::CodeBlock::dump):
18031 (JSC::CodeBlock::dumpStatistics):
18032 (JSC::CodeBlock::mark):
18033 (JSC::CodeBlock::getHandlerForVPC):
18034 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
18035 (JSC::CodeBlock::shrinkToFit):
18036 * bytecode/CodeBlock.h:
18037 (JSC::CodeBlock::numberOfExceptionHandlers):
18038 (JSC::CodeBlock::addExceptionHandler):
18039 (JSC::CodeBlock::exceptionHandler):
18040 (JSC::CodeBlock::addFunction):
18041 (JSC::CodeBlock::function):
18042 (JSC::CodeBlock::addUnexpectedConstant):
18043 (JSC::CodeBlock::unexpectedConstant):
18044 (JSC::CodeBlock::addRegExp):
18045 (JSC::CodeBlock::regexp):
18046 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
18047 (JSC::CodeBlock::addImmediateSwitchJumpTable):
18048 (JSC::CodeBlock::immediateSwitchJumpTable):
18049 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
18050 (JSC::CodeBlock::addCharacterSwitchJumpTable):
18051 (JSC::CodeBlock::characterSwitchJumpTable):
18052 (JSC::CodeBlock::numberOfStringSwitchJumpTables):
18053 (JSC::CodeBlock::addStringSwitchJumpTable):
18054 (JSC::CodeBlock::stringSwitchJumpTable):
18055 (JSC::CodeBlock::evalCodeCache):
18056 (JSC::CodeBlock::createRareDataIfNecessary):
18058 2008-11-26 Peter Kasting <pkasting@google.com>
18060 Reviewed by Anders Carlsson.
18062 https://bugs.webkit.org/show_bug.cgi?id=16814
18063 Allow ports to disable ActiveX->NPAPI conversion for Media Player.
18064 Improve handling of miscellaneous ActiveX objects.
18066 * wtf/Platform.h: Add another ENABLE(...).
18068 2008-12-08 Sam Weinig <sam@webkit.org>
18070 Reviewed by Mark Rowe.
18072 Add dumping of CodeBlock member structure usage.
18074 * bytecode/CodeBlock.cpp:
18075 (JSC::CodeBlock::dumpStatistics):
18076 * bytecode/EvalCodeCache.h:
18077 (JSC::EvalCodeCache::isEmpty):
18079 2008-12-08 David Kilzer <ddkilzer@apple.com>
18081 Bug 22555: Sort "children" sections in Xcode project files
18083 <https://bugs.webkit.org/show_bug.cgi?id=22555>
18085 Reviewed by Eric Seidel.
18087 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted.
18089 2008-12-08 Tony Chang <tony@chromium.org>
18091 Reviewed by Eric Seidel.
18093 Enable Pan scrolling only when building on PLATFORM(WIN_OS)
18094 Previously platforms like Apple Windows WebKit, Cairo Windows WebKit,
18095 Wx and Chromium were enabling it explicitly, now we just turn it on
18096 for all WIN_OS, later platforms can turn it off as needed on Windows
18097 (or turn it on under Linux, etc.)
18098 https://bugs.webkit.org/show_bug.cgi?id=22698
18102 2008-12-08 Sam Weinig <sam@webkit.org>
18104 Reviewed by Cameron Zwarich.
18106 Add basic memory statistics dumping for CodeBlock.
18108 * bytecode/CodeBlock.cpp:
18109 (JSC::CodeBlock::dumpStatistics):
18110 (JSC::CodeBlock::CodeBlock):
18111 (JSC::CodeBlock::~CodeBlock):
18112 * bytecode/CodeBlock.h:
18114 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
18116 Fix the Linux build with newer gcc/glibc.
18118 * jit/ExecutableAllocatorPosix.cpp: Include unistd.h for
18119 getpagesize(), according to
18120 http://opengroup.org/onlinepubs/007908775/xsh/getpagesize.html
18122 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
18124 Fix the build with Qt on Windows.
18126 * JavaScriptCore.pri: Compile ExecutableAllocatorWin.cpp on Windows.
18128 2008-12-07 Oliver Hunt <oliver@apple.com>
18130 Reviewed by NOBODY (Buildfix).
18132 Fix non-WREC builds
18134 * runtime/RegExp.cpp:
18135 (JSC::RegExp::RegExp):
18137 2008-12-07 Oliver Hunt <oliver@apple.com>
18139 Reviewed by NOBODY (Build fix).
18141 Put ENABLE(ASSEMBLER) guards around use of ExecutableAllocator in global data
18143 Correct Qt and Gtk project files
18146 * JavaScriptCore.pri:
18147 * runtime/JSGlobalData.h:
18149 2008-12-07 Oliver Hunt <oliver@apple.com>
18151 Reviewed by NOBODY (Build fix).
18153 Add new files to other projects.
18156 * JavaScriptCore.pri:
18157 * JavaScriptCore.pro:
18159 2008-12-07 Oliver Hunt <oliver@apple.com>
18161 Rubber stamped by Mark Rowe.
18163 Rename ExecutableAllocatorMMAP to the more sensible ExecutableAllocatorPosix
18165 * JavaScriptCore.xcodeproj/project.pbxproj:
18166 * jit/ExecutableAllocator.h:
18167 * jit/ExecutableAllocatorPosix.cpp: Renamed from JavaScriptCore/jit/ExecutableAllocatorMMAP.cpp.
18168 (JSC::ExecutableAllocator::intializePageSize):
18169 (JSC::ExecutablePool::systemAlloc):
18170 (JSC::ExecutablePool::systemRelease):
18172 2008-12-07 Oliver Hunt <oliver@apple.com>
18174 Reviewed by Cameron Zwarich and Sam Weinig
18176 <rdar://problem/6309878> Need more granular control over allocation of executable memory (21783)
18177 <https://bugs.webkit.org/show_bug.cgi?id=21783>
18179 Add a new allocator for use by the JIT that provides executable pages, so
18180 we can get rid of the current hack that makes the entire heap executable.
18182 1-2% progression on SunSpider-v8, 1% on SunSpider. Reduces memory usage as well!
18184 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
18185 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
18186 * JavaScriptCore.xcodeproj/project.pbxproj:
18187 * assembler/AssemblerBuffer.h:
18188 (JSC::AssemblerBuffer::size):
18189 (JSC::AssemblerBuffer::executableCopy):
18190 * assembler/MacroAssembler.h:
18191 (JSC::MacroAssembler::size):
18192 (JSC::MacroAssembler::copyCode):
18193 * assembler/X86Assembler.h:
18194 (JSC::X86Assembler::size):
18195 (JSC::X86Assembler::executableCopy):
18196 * bytecode/CodeBlock.cpp:
18197 (JSC::CodeBlock::~CodeBlock):
18198 * bytecode/CodeBlock.h:
18199 (JSC::CodeBlock::executablePool):
18200 (JSC::CodeBlock::setExecutablePool):
18201 * bytecode/Instruction.h:
18202 (JSC::PolymorphicAccessStructureList::derefStructures):
18203 * interpreter/Interpreter.cpp:
18204 (JSC::Interpreter::~Interpreter):
18205 * interpreter/Interpreter.h:
18206 * jit/ExecutableAllocator.cpp: Added.
18207 * jit/ExecutableAllocator.h: Added.
18208 (JSC::ExecutablePool::create):
18209 (JSC::ExecutablePool::alloc):
18210 (JSC::ExecutablePool::~ExecutablePool):
18211 (JSC::ExecutablePool::available):
18212 (JSC::ExecutablePool::ExecutablePool):
18213 (JSC::ExecutablePool::poolAllocate):
18214 (JSC::ExecutableAllocator::ExecutableAllocator):
18215 (JSC::ExecutableAllocator::poolForSize):
18216 (JSC::ExecutablePool::sizeForAllocation):
18217 * jit/ExecutableAllocatorMMAP.cpp: Added.
18218 (JSC::ExecutableAllocator::intializePageSize):
18219 (JSC::ExecutablePool::systemAlloc):
18220 (JSC::ExecutablePool::systemRelease):
18221 * jit/ExecutableAllocatorWin.cpp: Added.
18222 (JSC::ExecutableAllocator::intializePageSize):
18223 (JSC::ExecutablePool::systemAlloc):
18224 (JSC::ExecutablePool::systemRelease):
18226 (JSC::JIT::privateCompile):
18227 (JSC::JIT::privateCompileCTIMachineTrampolines):
18229 (JSC::JIT::compileCTIMachineTrampolines):
18230 * jit/JITPropertyAccess.cpp:
18231 (JSC::JIT::privateCompilePutByIdTransition):
18232 (JSC::JIT::privateCompilePatchGetArrayLength):
18233 (JSC::JIT::privateCompileGetByIdSelf):
18234 (JSC::JIT::privateCompileGetByIdProto):
18235 (JSC::JIT::privateCompileGetByIdSelfList):
18236 (JSC::JIT::privateCompileGetByIdProtoList):
18237 (JSC::JIT::privateCompileGetByIdChainList):
18238 (JSC::JIT::privateCompileGetByIdChain):
18239 (JSC::JIT::privateCompilePutByIdReplace):
18240 * parser/Nodes.cpp:
18241 (JSC::RegExpNode::emitBytecode):
18242 * runtime/JSGlobalData.h:
18243 (JSC::JSGlobalData::poolForSize):
18244 * runtime/RegExp.cpp:
18245 (JSC::RegExp::RegExp):
18246 (JSC::RegExp::create):
18247 (JSC::RegExp::~RegExp):
18248 * runtime/RegExp.h:
18249 * runtime/RegExpConstructor.cpp:
18250 (JSC::constructRegExp):
18251 * runtime/RegExpPrototype.cpp:
18252 (JSC::regExpProtoFuncCompile):
18253 * runtime/StringPrototype.cpp:
18254 (JSC::stringProtoFuncMatch):
18255 (JSC::stringProtoFuncSearch):
18257 (JSC::WREC::Generator::compileRegExp):
18258 * wrec/WRECGenerator.h:
18259 * wtf/FastMalloc.cpp:
18260 * wtf/FastMalloc.h:
18261 * wtf/TCSystemAlloc.cpp:
18265 (TCMalloc_SystemRelease):
18267 2008-12-06 Sam Weinig <sam@webkit.org>
18271 * jit/JITPropertyAccess.cpp:
18272 (JSC::JIT::compileGetByIdHotPath):
18273 (JSC::JIT::compilePutByIdHotPath):
18275 2008-12-06 Sam Weinig <sam@webkit.org>
18277 Reviewed by Cameron Zwarich,
18279 Move CodeBlock constructor into the .cpp file.
18281 Sunspider reports a .7% progression, but I can only assume this
18284 * bytecode/CodeBlock.cpp:
18285 (JSC::CodeBlock::CodeBlock):
18286 * bytecode/CodeBlock.h:
18288 2008-12-06 Sam Weinig <sam@webkit.org>
18290 Reviewed by Cameron Zwarich.
18292 Split JumpTable code into its own file.
18295 * JavaScriptCore.pri:
18296 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
18297 * JavaScriptCore.xcodeproj/project.pbxproj:
18298 * JavaScriptCoreSources.bkl:
18299 * bytecode/CodeBlock.cpp:
18300 * bytecode/CodeBlock.h:
18301 * bytecode/JumpTable.cpp: Copied from bytecode/CodeBlock.cpp.
18302 * bytecode/JumpTable.h: Copied from bytecode/CodeBlock.h.
18304 2008-12-05 Sam Weinig <sam@webkit.org>
18306 Reviewed by Cameron Zwarich.
18308 Fix for https://bugs.webkit.org/show_bug.cgi?id=22715
18309 Encapsulate more CodeBlock members in preparation
18310 of moving some of them to a rare data structure.
18312 * bytecode/CodeBlock.cpp:
18313 (JSC::locationForOffset):
18314 (JSC::printConditionalJump):
18315 (JSC::printGetByIdOp):
18316 (JSC::printPutByIdOp):
18317 (JSC::CodeBlock::printStructure):
18318 (JSC::CodeBlock::printStructures):
18319 (JSC::CodeBlock::dump):
18320 (JSC::CodeBlock::~CodeBlock):
18321 (JSC::CodeBlock::unlinkCallers):
18322 (JSC::CodeBlock::derefStructures):
18323 (JSC::CodeBlock::refStructures):
18324 (JSC::CodeBlock::mark):
18325 (JSC::CodeBlock::getHandlerForVPC):
18326 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
18327 (JSC::CodeBlock::lineNumberForVPC):
18328 (JSC::CodeBlock::expressionRangeForVPC):
18329 (JSC::CodeBlock::shrinkToFit):
18330 * bytecode/CodeBlock.h:
18331 (JSC::CodeBlock::CodeBlock):
18332 (JSC::CodeBlock::addCaller):
18333 (JSC::CodeBlock::removeCaller):
18334 (JSC::CodeBlock::isKnownNotImmediate):
18335 (JSC::CodeBlock::isConstantRegisterIndex):
18336 (JSC::CodeBlock::getConstant):
18337 (JSC::CodeBlock::isTemporaryRegisterIndex):
18338 (JSC::CodeBlock::getStubInfo):
18339 (JSC::CodeBlock::getCallLinkInfo):
18340 (JSC::CodeBlock::instructions):
18341 (JSC::CodeBlock::setJITCode):
18342 (JSC::CodeBlock::jitCode):
18343 (JSC::CodeBlock::ownerNode):
18344 (JSC::CodeBlock::setGlobalData):
18345 (JSC::CodeBlock::setThisRegister):
18346 (JSC::CodeBlock::thisRegister):
18347 (JSC::CodeBlock::setNeedsFullScopeChain):
18348 (JSC::CodeBlock::needsFullScopeChain):
18349 (JSC::CodeBlock::setUsesEval):
18350 (JSC::CodeBlock::usesEval):
18351 (JSC::CodeBlock::setUsesArguments):
18352 (JSC::CodeBlock::usesArguments):
18353 (JSC::CodeBlock::codeType):
18354 (JSC::CodeBlock::source):
18355 (JSC::CodeBlock::sourceOffset):
18356 (JSC::CodeBlock::addGlobalResolveInstruction):
18357 (JSC::CodeBlock::numberOfPropertyAccessInstructions):
18358 (JSC::CodeBlock::addPropertyAccessInstruction):
18359 (JSC::CodeBlock::propertyAccessInstruction):
18360 (JSC::CodeBlock::numberOfCallLinkInfos):
18361 (JSC::CodeBlock::addCallLinkInfo):
18362 (JSC::CodeBlock::callLinkInfo):
18363 (JSC::CodeBlock::numberOfJumpTargets):
18364 (JSC::CodeBlock::addJumpTarget):
18365 (JSC::CodeBlock::jumpTarget):
18366 (JSC::CodeBlock::lastJumpTarget):
18367 (JSC::CodeBlock::numberOfExceptionHandlers):
18368 (JSC::CodeBlock::addExceptionHandler):
18369 (JSC::CodeBlock::exceptionHandler):
18370 (JSC::CodeBlock::addExpressionInfo):
18371 (JSC::CodeBlock::numberOfLineInfos):
18372 (JSC::CodeBlock::addLineInfo):
18373 (JSC::CodeBlock::lastLineInfo):
18374 (JSC::CodeBlock::jitReturnAddressVPCMap):
18375 (JSC::CodeBlock::numberOfIdentifiers):
18376 (JSC::CodeBlock::addIdentifier):
18377 (JSC::CodeBlock::identifier):
18378 (JSC::CodeBlock::numberOfConstantRegisters):
18379 (JSC::CodeBlock::addConstantRegister):
18380 (JSC::CodeBlock::constantRegister):
18381 (JSC::CodeBlock::addFunction):
18382 (JSC::CodeBlock::function):
18383 (JSC::CodeBlock::addFunctionExpression):
18384 (JSC::CodeBlock::functionExpression):
18385 (JSC::CodeBlock::addUnexpectedConstant):
18386 (JSC::CodeBlock::unexpectedConstant):
18387 (JSC::CodeBlock::addRegExp):
18388 (JSC::CodeBlock::regexp):
18389 (JSC::CodeBlock::symbolTable):
18390 (JSC::CodeBlock::evalCodeCache):
18391 New inline setters/getters.
18393 (JSC::ProgramCodeBlock::ProgramCodeBlock):
18394 (JSC::ProgramCodeBlock::~ProgramCodeBlock):
18395 (JSC::ProgramCodeBlock::clearGlobalObject):
18396 * bytecode/SamplingTool.cpp:
18397 (JSC::ScopeSampleRecord::sample):
18398 (JSC::SamplingTool::dump):
18399 * bytecompiler/BytecodeGenerator.cpp:
18400 * bytecompiler/BytecodeGenerator.h:
18401 * bytecompiler/Label.h:
18402 * interpreter/CallFrame.cpp:
18403 * interpreter/Interpreter.cpp:
18406 * jit/JITInlineMethods.h:
18407 * jit/JITPropertyAccess.cpp:
18408 * parser/Nodes.cpp:
18409 * runtime/Arguments.h:
18410 * runtime/ExceptionHelpers.cpp:
18411 * runtime/JSActivation.cpp:
18412 * runtime/JSActivation.h:
18413 * runtime/JSGlobalObject.cpp:
18414 Change direct access to use new getter/setters.
18416 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18418 Reviewed by Oliver Hunt.
18420 Prevent GCC4.2 from hanging when trying to compile Interpreter.cpp.
18421 Added "-fno-var-tracking" compiler flag.
18423 https://bugs.webkit.org/show_bug.cgi?id=22704
18425 * JavaScriptCore.xcodeproj/project.pbxproj:
18427 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18429 Reviewed by Oliver Hunt.
18431 Ordering of branch operands in MacroAssembler in unnecessarily inconsistent.
18433 je, jg etc take an immediate operand as the second argument, but for the
18434 equality branches (je, jne) the immediate operand was the first argument. This
18435 was unnecessarily inconsistent. Change je, jne methods to take the immediate
18436 as the second argument.
18438 https://bugs.webkit.org/show_bug.cgi?id=22703
18440 * assembler/MacroAssembler.h:
18441 (JSC::MacroAssembler::je32):
18442 (JSC::MacroAssembler::jne32):
18444 (JSC::JIT::compileOpStrictEq):
18445 * wrec/WRECGenerator.cpp:
18446 (JSC::WREC::Generator::generateEnter):
18447 (JSC::WREC::Generator::generateNonGreedyQuantifier):
18448 (JSC::WREC::Generator::generateGreedyQuantifier):
18449 (JSC::WREC::Generator::generatePatternCharacterPair):
18450 (JSC::WREC::Generator::generatePatternCharacter):
18451 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
18452 (JSC::WREC::Generator::generateCharacterClassInverted):
18453 (JSC::WREC::Generator::generateAssertionBOL):
18454 (JSC::WREC::Generator::generateAssertionWordBoundary):
18456 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18458 Reviewed by Geoff Garen.
18460 Second tranche of porting JIT.cpp to MacroAssembler interface.
18462 * assembler/MacroAssembler.h:
18463 (JSC::MacroAssembler::mul32):
18464 (JSC::MacroAssembler::jl32):
18465 (JSC::MacroAssembler::jnzSub32):
18466 (JSC::MacroAssembler::joAdd32):
18467 (JSC::MacroAssembler::joMul32):
18468 (JSC::MacroAssembler::jzSub32):
18470 (JSC::JIT::emitSlowScriptCheck):
18471 (JSC::JIT::privateCompileMainPass):
18472 (JSC::JIT::privateCompileSlowCases):
18473 (JSC::JIT::privateCompileCTIMachineTrampolines):
18475 * jit/JITInlineMethods.h:
18476 (JSC::JIT::emitJumpIfNotJSCell):
18477 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
18479 2008-12-05 David Kilzer <ddkilzer@apple.com>
18481 Bug 22609: Provide a build-time choice when generating hash tables for properties of built-in DOM objects
18483 <https://bugs.webkit.org/show_bug.cgi?id=22609>
18484 <rdar://problem/6331749>
18486 Reviewed by Darin Adler.
18488 Initial patch by Yosen Lin. Adapted for ToT WebKit by David Kilzer.
18490 Added back the code that generates a "compact" hash (instead of a
18491 perfect hash) as a build-time option using the
18492 ENABLE(PERFECT_HASH_SIZE) macro as defined in Lookup.h.
18494 * create_hash_table: Rename variables to differentiate perfect hash
18495 values from compact hash values. Added back code to compute compact
18496 hash tables. Generate both hash table sizes and emit
18497 conditionalized code based on ENABLE(PERFECT_HASH_SIZE).
18498 * runtime/Lookup.cpp:
18499 (JSC::HashTable::createTable): Added version of createTable() for
18500 use with compact hash tables.
18501 (JSC::HashTable::deleteTable): Updated to work with compact hash
18503 * runtime/Lookup.h: Defined ENABLE(PERFECT_HASH_SIZE) macro here.
18504 (JSC::HashEntry::initialize): Set m_next to zero when using compact
18506 (JSC::HashEntry::setNext): Added for compact hash tables.
18507 (JSC::HashEntry::next): Added for compact hash tables.
18508 (JSC::HashTable::entry): Added version of entry() for use with
18509 compact hash tables.
18510 * runtime/Structure.cpp:
18511 (JSC::Structure::getEnumerablePropertyNames): Updated to work with
18512 compact hash tables.
18514 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18516 Reviewed by Geoff Garen.
18518 Remove redundant calls to JIT::emitSlowScriptCheck.
18519 This is checked in the hot path, so is not needed on the slow path - and the code
18520 was being planted before the start of the slow case, so was completely unreachable!
18523 (JSC::JIT::privateCompileSlowCases):
18525 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18527 Reviewed by Geoff Garen.
18529 Move JIT::compileOpStrictEq to MacroAssembler interface.
18531 The rewrite also looks like a small (<1%) performance progression.
18533 https://bugs.webkit.org/show_bug.cgi?id=22697
18536 (JSC::JIT::compileOpStrictEq):
18537 (JSC::JIT::privateCompileSlowCases):
18539 * jit/JITInlineMethods.h:
18540 (JSC::JIT::emitJumpIfJSCell):
18541 (JSC::JIT::emitJumpSlowCaseIfJSCell):
18543 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18545 Reviewed by Geoff Garen.
18547 Remove m_assembler from MacroAssembler::Jump.
18548 Keeping a pointer allowed for some syntactic sugar - "link()" looks nicer
18549 than "link(this)". But maintaining this doubles the size of Jump, which
18550 is even more unfortunate for the JIT, since there are many large structures
18551 holding JmpSrcs. Probably best to remove it.
18553 https://bugs.webkit.org/show_bug.cgi?id=22693
18555 * assembler/MacroAssembler.h:
18556 (JSC::MacroAssembler::Jump::Jump):
18557 (JSC::MacroAssembler::Jump::link):
18558 (JSC::MacroAssembler::Jump::linkTo):
18559 (JSC::MacroAssembler::JumpList::link):
18560 (JSC::MacroAssembler::JumpList::linkTo):
18561 (JSC::MacroAssembler::jae32):
18562 (JSC::MacroAssembler::je32):
18563 (JSC::MacroAssembler::je16):
18564 (JSC::MacroAssembler::jg32):
18565 (JSC::MacroAssembler::jge32):
18566 (JSC::MacroAssembler::jl32):
18567 (JSC::MacroAssembler::jle32):
18568 (JSC::MacroAssembler::jnePtr):
18569 (JSC::MacroAssembler::jne32):
18570 (JSC::MacroAssembler::jnset32):
18571 (JSC::MacroAssembler::jset32):
18572 (JSC::MacroAssembler::jump):
18573 (JSC::MacroAssembler::jzSub32):
18574 (JSC::MacroAssembler::joAdd32):
18575 (JSC::MacroAssembler::call):
18577 (JSC::WREC::Generator::compileRegExp):
18578 * wrec/WRECGenerator.cpp:
18579 (JSC::WREC::Generator::generateEnter):
18580 (JSC::WREC::Generator::generateBackreferenceQuantifier):
18581 (JSC::WREC::Generator::generateNonGreedyQuantifier):
18582 (JSC::WREC::Generator::generateGreedyQuantifier):
18583 (JSC::WREC::Generator::generatePatternCharacter):
18584 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
18585 (JSC::WREC::Generator::generateCharacterClassInverted):
18586 (JSC::WREC::Generator::generateCharacterClass):
18587 (JSC::WREC::Generator::generateParenthesesAssertion):
18588 (JSC::WREC::Generator::generateParenthesesInvertedAssertion):
18589 (JSC::WREC::Generator::generateParenthesesNonGreedy):
18590 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
18591 (JSC::WREC::Generator::generateAssertionBOL):
18592 (JSC::WREC::Generator::generateAssertionEOL):
18593 (JSC::WREC::Generator::generateAssertionWordBoundary):
18594 (JSC::WREC::Generator::generateBackreference):
18595 (JSC::WREC::Generator::terminateAlternative):
18596 (JSC::WREC::Generator::terminateDisjunction):
18597 * wrec/WRECParser.h:
18599 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18601 Reviewed by Geoffrey Garen.
18603 Simplify JIT generated checks for timeout code, by moving more work into the C function.
18604 https://bugs.webkit.org/show_bug.cgi?id=22688
18606 * interpreter/Interpreter.cpp:
18607 (JSC::Interpreter::cti_timeout_check):
18608 * interpreter/Interpreter.h:
18610 (JSC::JIT::emitSlowScriptCheck):
18612 2008-12-05 Sam Weinig <sam@webkit.org>
18614 Reviewed by Geoffrey Garen.
18616 Encapsulate access to jump tables in the CodeBlock in preparation
18617 of moving them to a rare data structure.
18619 * bytecode/CodeBlock.cpp:
18620 (JSC::CodeBlock::dump):
18621 (JSC::CodeBlock::shrinkToFit):
18622 * bytecode/CodeBlock.h:
18623 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
18624 (JSC::CodeBlock::addImmediateSwitchJumpTable):
18625 (JSC::CodeBlock::immediateSwitchJumpTable):
18626 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
18627 (JSC::CodeBlock::addCharacterSwitchJumpTable):
18628 (JSC::CodeBlock::characterSwitchJumpTable):
18629 (JSC::CodeBlock::numberOfStringSwitchJumpTables):
18630 (JSC::CodeBlock::addStringSwitchJumpTable):
18631 (JSC::CodeBlock::stringSwitchJumpTable):
18632 * bytecompiler/BytecodeGenerator.cpp:
18633 (JSC::BytecodeGenerator::generate):
18634 (JSC::BytecodeGenerator::endSwitch):
18635 * interpreter/Interpreter.cpp:
18636 (JSC::Interpreter::privateExecute):
18637 (JSC::Interpreter::cti_op_switch_imm):
18638 (JSC::Interpreter::cti_op_switch_char):
18639 (JSC::Interpreter::cti_op_switch_string):
18641 (JSC::JIT::privateCompileMainPass):
18643 2008-12-05 Adam Roben <aroben@apple.com>
18645 Windows build fix after r39020
18647 * jit/JITInlineMethods.h:
18648 (JSC::JIT::restoreArgumentReference):
18649 (JSC::JIT::restoreArgumentReferenceForTrampoline):
18650 Add some apparently-missing __.
18652 2008-12-04 Geoffrey Garen <ggaren@apple.com>
18654 Reviewed by Darin Adler.
18656 https://bugs.webkit.org/show_bug.cgi?id=22673
18658 Added support for the assertion (?=) and inverted assertion (?!) atoms
18661 * wrec/WRECGenerator.cpp:
18662 (JSC::WREC::Generator::generateParenthesesAssertion):
18663 (JSC::WREC::Generator::generateParenthesesInvertedAssertion): Split the
18664 old (unused) generateParentheses into these two functions, with more
18665 limited capabilities.
18667 * wrec/WRECGenerator.h:
18668 (JSC::WREC::Generator::): Moved an enum to the top of the class definition,
18669 to match the WebKit style, and removed a defunct comment.
18671 * wrec/WRECParser.cpp:
18672 (JSC::WREC::Parser::parseParentheses):
18673 (JSC::WREC::Parser::consumeParenthesesType):
18674 * wrec/WRECParser.h:
18675 (JSC::WREC::Parser::): Added support for parsing (?=) and (?!).
18677 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
18679 Rubber-stamped by Tor Arne Vestbø.
18681 Disable the JIT for the Qt build alltogether again, after observing
18682 more miscompilations in a wider range of newer gcc versions.
18684 * JavaScriptCore.pri:
18686 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
18688 Reviewed by Tor Arne Vestbø.
18690 Disable the JIT for the Qt build on Linux unless gcc is >= 4.2,
18691 due to miscompilations.
18693 * JavaScriptCore.pri:
18695 2008-12-04 Gavin Barraclough <barraclough@apple.com>
18697 Reviewed by Geoff Garen.
18699 Start porting the JIT to use the MacroAssembler.
18701 https://bugs.webkit.org/show_bug.cgi?id=22671
18702 No change in performance.
18704 * assembler/MacroAssembler.h:
18705 (JSC::MacroAssembler::Jump::operator X86Assembler::JmpSrc):
18706 (JSC::MacroAssembler::add32):
18707 (JSC::MacroAssembler::and32):
18708 (JSC::MacroAssembler::lshift32):
18709 (JSC::MacroAssembler::rshift32):
18710 (JSC::MacroAssembler::storePtr):
18711 (JSC::MacroAssembler::store32):
18712 (JSC::MacroAssembler::poke):
18713 (JSC::MacroAssembler::move):
18714 (JSC::MacroAssembler::compareImm32ForBranchEquality):
18715 (JSC::MacroAssembler::jnePtr):
18716 (JSC::MacroAssembler::jnset32):
18717 (JSC::MacroAssembler::jset32):
18718 (JSC::MacroAssembler::jzeroSub32):
18719 (JSC::MacroAssembler::joverAdd32):
18720 (JSC::MacroAssembler::call):
18721 * assembler/X86Assembler.h:
18722 (JSC::X86Assembler::shll_i8r):
18724 (JSC::JIT::privateCompileMainPass):
18725 (JSC::JIT::privateCompile):
18726 (JSC::JIT::privateCompileCTIMachineTrampolines):
18728 * jit/JITArithmetic.cpp:
18729 (JSC::JIT::compileBinaryArithOp):
18730 * jit/JITInlineMethods.h:
18731 (JSC::JIT::emitGetVirtualRegister):
18732 (JSC::JIT::emitPutCTIArg):
18733 (JSC::JIT::emitPutCTIArgConstant):
18734 (JSC::JIT::emitGetCTIArg):
18735 (JSC::JIT::emitPutCTIArgFromVirtualRegister):
18736 (JSC::JIT::emitPutCTIParam):
18737 (JSC::JIT::emitGetCTIParam):
18738 (JSC::JIT::emitPutToCallFrameHeader):
18739 (JSC::JIT::emitPutImmediateToCallFrameHeader):
18740 (JSC::JIT::emitGetFromCallFrameHeader):
18741 (JSC::JIT::emitPutVirtualRegister):
18742 (JSC::JIT::emitInitRegister):
18743 (JSC::JIT::emitNakedCall):
18744 (JSC::JIT::restoreArgumentReference):
18745 (JSC::JIT::restoreArgumentReferenceForTrampoline):
18746 (JSC::JIT::emitCTICall):
18747 (JSC::JIT::checkStructure):
18748 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
18749 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
18750 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
18751 (JSC::JIT::emitFastArithDeTagImmediate):
18752 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
18753 (JSC::JIT::emitFastArithReTagImmediate):
18754 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
18755 (JSC::JIT::emitFastArithImmToInt):
18756 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
18757 (JSC::JIT::emitFastArithIntToImmNoCheck):
18758 (JSC::JIT::emitTagAsBoolImmediate):
18759 * jit/JITPropertyAccess.cpp:
18760 (JSC::JIT::privateCompilePutByIdTransition):
18762 2008-12-04 Geoffrey Garen <ggaren@apple.com>
18764 Reviewed by Oliver Hunt.
18766 Some refactoring for generateGreedyQuantifier.
18768 SunSpider reports no change (possibly a 0.3% speedup).
18770 * wrec/WRECGenerator.cpp:
18771 (JSC::WREC::Generator::generateGreedyQuantifier): Clarified label
18772 meanings and unified some logic to simplify things.
18774 * wrec/WRECParser.h:
18775 (JSC::WREC::Parser::parseAlternative): Added a version of parseAlternative
18776 that can jump to a Label, instead of a JumpList, upon failure. (Eventually,
18777 when we have a true Label class, this will be redundant.) This makes
18778 things easier for generateGreedyQuantifier, because it can avoid
18779 explicitly linking things.
18781 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
18783 Reviewed by Holger Freyther.
18785 Fix crashes in the Qt build on Linux/i386 with non-executable memory
18786 by enabling TCSystemAlloc and the PROT_EXEC flag for mmap.
18788 * JavaScriptCore.pri: Enable the use of TCSystemAlloc if the JIT is
18790 * wtf/TCSystemAlloc.cpp: Extend the PROT_EXEC permissions to
18793 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
18795 Reviewed by Tor Arne Vestbø.
18797 Enable ENABLE_JIT_OPTIMIZE_CALL, ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
18798 and ENABLE_JIT_OPTIMIZE_ARITHMETIC, as suggested by Niko.
18800 * JavaScriptCore.pri:
18802 2008-12-04 Kent Hansen <khansen@trolltech.com>
18804 Reviewed by Simon Hausmann.
18806 Enable the JSC jit for the Qt build by default for release builds on
18807 linux-g++ and win32-msvc.
18809 * JavaScriptCore.pri:
18811 2008-12-04 Gavin Barraclough <barraclough@apple.com>
18813 Reviewed by Oliver Hunt.
18815 Allow JIT to function without property access repatching and arithmetic optimizations.
18816 Controlled by ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS and ENABLE_JIT_OPTIMIZE_ARITHMETIC switches.
18818 https://bugs.webkit.org/show_bug.cgi?id=22643
18820 * JavaScriptCore.xcodeproj/project.pbxproj:
18822 (JSC::JIT::privateCompileMainPass):
18823 (JSC::JIT::privateCompileSlowCases):
18825 * jit/JITArithmetic.cpp: Copied from jit/JIT.cpp.
18826 (JSC::JIT::compileBinaryArithOp):
18827 (JSC::JIT::compileBinaryArithOpSlowCase):
18828 * jit/JITPropertyAccess.cpp: Copied from jit/JIT.cpp.
18829 (JSC::JIT::compileGetByIdHotPath):
18830 (JSC::JIT::compileGetByIdSlowCase):
18831 (JSC::JIT::compilePutByIdHotPath):
18832 (JSC::JIT::compilePutByIdSlowCase):
18833 (JSC::resizePropertyStorage):
18834 (JSC::transitionWillNeedStorageRealloc):
18835 (JSC::JIT::privateCompilePutByIdTransition):
18836 (JSC::JIT::patchGetByIdSelf):
18837 (JSC::JIT::patchPutByIdReplace):
18838 (JSC::JIT::privateCompilePatchGetArrayLength):
18841 2008-12-03 Geoffrey Garen <ggaren@apple.com>
18843 Reviewed by Oliver Hunt.
18845 Optimized sequences of characters in regular expressions by comparing
18846 two characters at a time.
18848 1-2% speedup on SunSpider, 19-25% speedup on regexp-dna.
18850 * assembler/MacroAssembler.h:
18851 (JSC::MacroAssembler::load32):
18852 (JSC::MacroAssembler::jge32): Filled out a few more macro methods.
18854 * assembler/X86Assembler.h:
18855 (JSC::X86Assembler::movl_mr): Added a verion of movl_mr that operates
18856 without an offset, to allow the macro assembler to optmize for that case.
18859 (JSC::WREC::Generator::compileRegExp): Test the saved value of index
18860 instead of the index register when checking for "end of input." The
18861 index register doesn't increment by 1 in an orderly fashion, so testing
18862 it for == "end of input" is not valid.
18864 Also, jump all the way to "return failure" upon reaching "end of input,"
18865 instead of executing the next alternative. This is more logical, and
18866 it's a slight optimization in the case of an expression with many alternatives.
18868 * wrec/WRECGenerator.cpp:
18869 (JSC::WREC::Generator::generateIncrementIndex): Added support for
18870 jumping to a failure label in the case where the index has reached "end
18873 (JSC::WREC::Generator::generatePatternCharacterSequence):
18874 (JSC::WREC::Generator::generatePatternCharacterPair): This is the
18875 optmization. It's basically like generatePatternCharacter, but it runs two
18876 characters at a time.
18878 (JSC::WREC::Generator::generatePatternCharacter): Changed to use isASCII,
18879 since it's clearer than comparing to a magic hex value.
18881 * wrec/WRECGenerator.h:
18883 2008-12-03 Gavin Barraclough <barraclough@apple.com>
18885 Reviewed by Cameron Zwarich.
18887 Allow JIT to operate without the call-repatching optimization.
18888 Controlled by ENABLE(JIT_OPTIMIZE_CALL), defaults on, disabling
18889 this leads to significant performance regression.
18891 https://bugs.webkit.org/show_bug.cgi?id=22639
18893 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
18894 * JavaScriptCore.xcodeproj/project.pbxproj:
18896 (JSC::JIT::privateCompileSlowCases):
18898 * jit/JITCall.cpp: Copied from jit/JIT.cpp.
18899 (JSC::JIT::compileOpCallInitializeCallFrame):
18900 (JSC::JIT::compileOpCallSetupArgs):
18901 (JSC::JIT::compileOpCallEvalSetupArgs):
18902 (JSC::JIT::compileOpConstructSetupArgs):
18903 (JSC::JIT::compileOpCall):
18904 (JSC::JIT::compileOpCallSlowCase):
18905 (JSC::unreachable):
18906 * jit/JITInlineMethods.h: Copied from jit/JIT.cpp.
18907 (JSC::JIT::checkStructure):
18908 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
18909 (JSC::JIT::emitTagAsBoolImmediate):
18912 2008-12-03 Eric Seidel <eric@webkit.org>
18914 Rubber-stamped by David Hyatt.
18916 Make HAVE_ACCESSIBILITY only define if !defined
18920 2008-12-03 Sam Weinig <sam@webkit.org>
18924 * assembler/X86Assembler.h:
18925 (JSC::X86Assembler::orl_i32r):
18927 2008-12-03 Sam Weinig <sam@webkit.org>
18929 Reviewed by Geoffrey Garen.
18931 Remove shared AssemblerBuffer 1MB buffer and instead give AssemblerBuffer
18932 an 256 byte inline capacity.
18934 1% progression on Sunspider.
18936 * assembler/AssemblerBuffer.h:
18937 (JSC::AssemblerBuffer::AssemblerBuffer):
18938 (JSC::AssemblerBuffer::~AssemblerBuffer):
18939 (JSC::AssemblerBuffer::grow):
18940 * assembler/MacroAssembler.h:
18941 (JSC::MacroAssembler::MacroAssembler):
18942 * assembler/X86Assembler.h:
18943 (JSC::X86Assembler::X86Assembler):
18944 * interpreter/Interpreter.cpp:
18945 (JSC::Interpreter::Interpreter):
18946 * interpreter/Interpreter.h:
18949 * parser/Nodes.cpp:
18950 (JSC::RegExpNode::emitBytecode):
18951 * runtime/RegExp.cpp:
18952 (JSC::RegExp::RegExp):
18953 (JSC::RegExp::create):
18954 * runtime/RegExp.h:
18955 * runtime/RegExpConstructor.cpp:
18956 (JSC::constructRegExp):
18957 * runtime/RegExpPrototype.cpp:
18958 (JSC::regExpProtoFuncCompile):
18959 * runtime/StringPrototype.cpp:
18960 (JSC::stringProtoFuncMatch):
18961 (JSC::stringProtoFuncSearch):
18963 (JSC::WREC::Generator::compileRegExp):
18964 * wrec/WRECGenerator.h:
18965 (JSC::WREC::Generator::Generator):
18966 * wrec/WRECParser.h:
18967 (JSC::WREC::Parser::Parser):
18969 2008-12-03 Geoffrey Garen <ggaren@apple.com>
18971 Reviewed by Oliver Hunt, with help from Gavin Barraclough.
18973 orl_i32r was actually coded as an 8bit OR. So, I renamed orl_i32r to
18974 orl_i8r, changed all orl_i32r clients to use orl_i8r, and then added
18975 a new orl_i32r that actually does a 32bit OR.
18977 (32bit OR is currently unused, but a patch I'm working on uses it.)
18979 * assembler/MacroAssembler.h:
18980 (JSC::MacroAssembler::or32): Updated to choose between 8bit and 32bit OR.
18982 * assembler/X86Assembler.h:
18983 (JSC::X86Assembler::orl_i8r): The old orl_i32r.
18984 (JSC::X86Assembler::orl_i32r): The new orl_i32r.
18987 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
18988 (JSC::JIT::emitTagAsBoolImmediate): Use orl_i8r, since we're ORing 8bit
18991 2008-12-03 Dean Jackson <dino@apple.com>
18993 Reviewed by Dan Bernstein.
18995 Helper functions for turn -> degrees.
18996 https://bugs.webkit.org/show_bug.cgi?id=22497
18998 * wtf/MathExtras.h:
19002 2008-12-02 Cameron Zwarich <zwarich@apple.com>
19004 Reviewed by Geoff Garen.
19006 Bug 22504: Crashes during code generation occur due to refing of ignoredResult()
19007 <https://bugs.webkit.org/show_bug.cgi?id=22504>
19009 Since ignoredResult() was implemented by casting 1 to a RegisterID*, any
19010 attempt to ref ignoredResult() results in a crash. This will occur in
19011 code generation of a function body where a node emits another node with
19012 the dst that was passed to it, and then refs the returned RegisterID*.
19014 To fix this problem, make ignoredResult() a member function of
19015 BytecodeGenerator that simply returns a pointe to a fixed RegisterID
19016 member of BytecodeGenerator.
19018 * bytecompiler/BytecodeGenerator.h:
19019 (JSC::BytecodeGenerator::ignoredResult):
19020 * bytecompiler/RegisterID.h:
19021 * parser/Nodes.cpp:
19022 (JSC::NullNode::emitBytecode):
19023 (JSC::BooleanNode::emitBytecode):
19024 (JSC::NumberNode::emitBytecode):
19025 (JSC::StringNode::emitBytecode):
19026 (JSC::RegExpNode::emitBytecode):
19027 (JSC::ThisNode::emitBytecode):
19028 (JSC::ResolveNode::emitBytecode):
19029 (JSC::ObjectLiteralNode::emitBytecode):
19030 (JSC::PostfixResolveNode::emitBytecode):
19031 (JSC::PostfixBracketNode::emitBytecode):
19032 (JSC::PostfixDotNode::emitBytecode):
19033 (JSC::DeleteValueNode::emitBytecode):
19034 (JSC::VoidNode::emitBytecode):
19035 (JSC::TypeOfResolveNode::emitBytecode):
19036 (JSC::TypeOfValueNode::emitBytecode):
19037 (JSC::PrefixResolveNode::emitBytecode):
19038 (JSC::AssignResolveNode::emitBytecode):
19039 (JSC::CommaNode::emitBytecode):
19040 (JSC::ForNode::emitBytecode):
19041 (JSC::ForInNode::emitBytecode):
19042 (JSC::ReturnNode::emitBytecode):
19043 (JSC::ThrowNode::emitBytecode):
19044 (JSC::FunctionBodyNode::emitBytecode):
19045 (JSC::FuncDeclNode::emitBytecode):
19047 2008-12-02 Geoffrey Garen <ggaren@apple.com>
19049 Reviewed by Cameron Zwarich.
19051 Fixed https://bugs.webkit.org/show_bug.cgi?id=22537
19052 REGRESSION (r38745): Assertion failure in jsSubstring() at ge.com
19054 The bug was that index would become greater than length, so our
19055 "end of input" checks, which all check "index == length", would fail.
19057 The solution is to check for end of input before incrementing index,
19058 to ensure that index is always <= length.
19060 As a side benefit, generateJumpIfEndOfInput can now use je instead of
19061 jg, which should be slightly faster.
19064 (JSC::WREC::Generator::compileRegExp):
19065 * wrec/WRECGenerator.cpp:
19066 (JSC::WREC::Generator::generateJumpIfEndOfInput):
19068 2008-12-02 Gavin Barraclough <barraclough@apple.com>
19070 Reviewed by Geoffrey Garen.
19072 Plant shift right immediate instructions, which are awesome.
19073 https://bugs.webkit.org/show_bug.cgi?id=22610
19074 ~5% on the v8-crypto test.
19077 (JSC::JIT::privateCompileMainPass):
19078 (JSC::JIT::privateCompileSlowCases):
19080 2008-12-02 Geoffrey Garen <ggaren@apple.com>
19082 Reviewed by Sam Weinig.
19084 Cleaned up SegmentedVector by abstracting segment access into helper
19087 SunSpider reports no change.
19089 * bytecompiler/SegmentedVector.h:
19090 (JSC::SegmentedVector::SegmentedVector):
19091 (JSC::SegmentedVector::~SegmentedVector):
19092 (JSC::SegmentedVector::size):
19093 (JSC::SegmentedVector::at):
19094 (JSC::SegmentedVector::operator[]):
19095 (JSC::SegmentedVector::last):
19096 (JSC::SegmentedVector::append):
19097 (JSC::SegmentedVector::removeLast):
19098 (JSC::SegmentedVector::grow):
19099 (JSC::SegmentedVector::clear):
19100 (JSC::SegmentedVector::deleteAllSegments):
19101 (JSC::SegmentedVector::segmentFor):
19102 (JSC::SegmentedVector::subscriptFor):
19103 (JSC::SegmentedVector::ensureSegmentsFor):
19104 (JSC::SegmentedVector::ensureSegment):
19106 2008-12-02 Geoffrey Garen <ggaren@apple.com>
19108 Reviewed by Geoffrey Garen. (Patch by Cameron Zwarich <zwarich@apple.com>.)
19110 Fixed https://bugs.webkit.org/show_bug.cgi?id=22482
19111 REGRESSION (r37991): Occasionally see "Scene rendered incorrectly"
19112 message when running the V8 Raytrace benchmark
19114 Rolled out r37991. It didn't properly save xmm0, which is caller-save,
19115 before calling helper functions.
19117 SunSpider and v8 benchmarks show little change -- possibly a .2%
19118 SunSpider regression, possibly a .2% v8 benchmark speedup.
19120 * assembler/X86Assembler.h:
19121 (JSC::X86Assembler::):
19122 * bytecode/CodeBlock.cpp:
19123 (JSC::CodeBlock::dump):
19124 * bytecode/Instruction.h:
19125 (JSC::Instruction::):
19126 * bytecompiler/BytecodeGenerator.cpp:
19127 (JSC::BytecodeGenerator::emitUnaryOp):
19128 * bytecompiler/BytecodeGenerator.h:
19129 (JSC::BytecodeGenerator::emitToJSNumber):
19130 (JSC::BytecodeGenerator::emitTypeOf):
19131 (JSC::BytecodeGenerator::emitGetPropertyNames):
19132 * interpreter/Interpreter.cpp:
19133 (JSC::Interpreter::privateExecute):
19134 * interpreter/Interpreter.h:
19136 (JSC::JIT::privateCompileMainPass):
19137 (JSC::JIT::privateCompileSlowCases):
19139 * parser/Nodes.cpp:
19140 (JSC::UnaryOpNode::emitBytecode):
19141 (JSC::BinaryOpNode::emitBytecode):
19142 (JSC::EqualNode::emitBytecode):
19143 * parser/ResultType.h:
19144 (JSC::ResultType::isReusable):
19145 (JSC::ResultType::mightBeNumber):
19146 * runtime/JSNumberCell.h:
19148 2008-12-01 Gavin Barraclough <barraclough@apple.com>
19150 Reviewed by Geoffrey Garen.
19152 Remove unused (sampling only, and derivable) argument to JIT::emitCTICall.
19153 https://bugs.webkit.org/show_bug.cgi?id=22587
19156 (JSC::JIT::emitCTICall):
19157 (JSC::JIT::compileOpCall):
19158 (JSC::JIT::emitSlowScriptCheck):
19159 (JSC::JIT::compileBinaryArithOpSlowCase):
19160 (JSC::JIT::privateCompileMainPass):
19161 (JSC::JIT::privateCompileSlowCases):
19162 (JSC::JIT::privateCompile):
19165 2008-12-02 Dimitri Glazkov <dglazkov@chromium.org>
19167 Reviewed by Eric Seidel.
19169 Fix the inheritance chain for JSFunction.
19171 * runtime/JSFunction.cpp:
19172 (JSC::JSFunction::info): Add InternalFunction::info as parent class
19174 2008-12-02 Simon Hausmann <hausmann@webkit.org>
19176 Reviewed by Tor Arne Vestbø.
19178 Fix ability to include JavaScriptCore.pri from other .pro files.
19180 * JavaScriptCore.pri: Moved -O3 setting into the .pro files.
19181 * JavaScriptCore.pro:
19184 2008-12-01 Geoffrey Garen <ggaren@apple.com>
19186 Reviewed by Cameron Zwarich, with help from Gavin Barraclough.
19188 Fixed https://bugs.webkit.org/show_bug.cgi?id=22583.
19190 Refactored regular expression parsing to parse sequences of characters
19191 as a single unit, in preparation for optimizing sequences of characters.
19193 SunSpider reports no change.
19195 * JavaScriptCore.xcodeproj/project.pbxproj:
19196 * wrec/Escapes.h: Added. Set of classes for representing an escaped
19197 token in a pattern.
19199 * wrec/Quantifier.h:
19200 (JSC::WREC::Quantifier::Quantifier): Simplified this constructor slightly,
19201 to match the new Escape constructor.
19203 * wrec/WRECGenerator.cpp:
19204 (JSC::WREC::Generator::generatePatternCharacterSequence):
19205 * wrec/WRECGenerator.h: Added an interface for generating a sequence
19206 of pattern characters at a time. It doesn't do anything special yet.
19208 * wrec/WRECParser.cpp:
19209 (JSC::WREC::Parser::consumeGreedyQuantifier):
19210 (JSC::WREC::Parser::consumeQuantifier): Renamed "parse" to "consume" in
19211 these functions, to match "consumeEscape."
19213 (JSC::WREC::Parser::parsePatternCharacterSequence): New function for
19214 iteratively aggregating a sequence of characters in a pattern.
19216 (JSC::WREC::Parser::parseCharacterClassQuantifier):
19217 (JSC::WREC::Parser::parseBackreferenceQuantifier): Renamed "parse" to
19218 "consume" in these functions, to match "consumeEscape."
19220 (JSC::WREC::Parser::parseCharacterClass): Refactored to use the common
19221 escape processing code in consumeEscape.
19223 (JSC::WREC::Parser::parseEscape): Refactored to use the common
19224 escape processing code in consumeEscape.
19226 (JSC::WREC::Parser::consumeEscape): Factored escaped token processing
19227 into a common function, since we were doing this in a few places.
19229 (JSC::WREC::Parser::parseTerm): Refactored to use the common
19230 escape processing code in consumeEscape.
19232 * wrec/WRECParser.h:
19233 (JSC::WREC::Parser::consumeOctal): Refactored to use a helper function
19234 for reading a digit.
19236 2008-12-01 Cameron Zwarich <zwarich@apple.com>
19238 Reviewed by Oliver Hunt.
19240 Bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
19241 <https://bugs.webkit.org/show_bug.cgi?id=20340>
19243 SegmentedVector currently frees segments and reallocates them when used
19244 as a stack. This can lead to unsafe use of pointers into freed segments.
19246 In order to fix this problem, SegmentedVector will be changed to only
19247 grow and never shrink. Also, rename the reserveCapacity() member
19248 function to grow() to match the actual usage in BytecodeGenerator, where
19249 this function is used to allocate a group of registers at once, rather
19250 than merely saving space for them.
19252 * bytecompiler/BytecodeGenerator.cpp:
19253 (JSC::BytecodeGenerator::BytecodeGenerator): Use grow() instead of
19255 * bytecompiler/SegmentedVector.h:
19256 (JSC::SegmentedVector::SegmentedVector):
19257 (JSC::SegmentedVector::last):
19258 (JSC::SegmentedVector::append):
19259 (JSC::SegmentedVector::removeLast):
19260 (JSC::SegmentedVector::grow): Renamed from reserveCapacity().
19261 (JSC::SegmentedVector::clear):
19263 2008-12-01 Mark Rowe <mrowe@apple.com>
19265 Rubber-stamped by Anders Carlsson.
19267 Disable WREC for x86_64 since memory allocated by the system allocator is not marked executable,
19268 which causes 64-bit debug builds to crash. Once we have a dedicated allocator for executable
19269 memory we can turn this back on.
19273 2008-12-01 Antti Koivisto <antti@apple.com>
19275 Reviewed by Maciej Stachowiak.
19277 Restore inline buffer after vector is shrunk back below its inline capacity.
19281 (WTF::VectorBuffer::restoreInlineBufferIfNeeded):
19282 (WTF::::shrinkCapacity):
19284 2008-11-30 Antti Koivisto <antti@apple.com>
19286 Reviewed by Mark Rowe.
19288 Try to return free pages in the current thread cache too.
19290 * wtf/FastMalloc.cpp:
19291 (WTF::TCMallocStats::releaseFastMallocFreeMemory):
19293 2008-12-01 David Levin <levin@chromium.org>
19295 Reviewed by Alexey Proskuryakov.
19297 https://bugs.webkit.org/show_bug.cgi?id=22567
19298 Make HashTable work as expected with respect to threads. Specifically, it has class-level
19299 thread safety and constant methods work on constant objects without synchronization.
19301 No observable change in behavior, so no test. This only affects debug builds.
19303 * wtf/HashTable.cpp:
19304 (WTF::hashTableStatsMutex):
19305 (WTF::HashTableStats::~HashTableStats):
19306 (WTF::HashTableStats::recordCollisionAtCount):
19307 Guarded variable access with a mutex.
19311 (WTF::::lookupForWriting):
19312 (WTF::::fullLookupForWriting):
19317 Changed increments of static variables to use atomicIncrement.
19319 (WTF::::invalidateIterators):
19320 (WTF::addIterator):
19321 (WTF::removeIterator):
19322 Guarded mutable access with a mutex.
19324 2008-11-29 Gavin Barraclough <barraclough@apple.com>
19326 Reviewed by Cameron Zwarich.
19328 Enable WREC on PLATFORM(X86_64). This change predominantly requires changes to the
19329 WREC::Generator::generateEnter method to support the x86-64 ABI, and addition of
19330 support for a limited number of quadword operations in the X86Assembler.
19332 This patch will cause the JS heap to be allocated with RWX permissions on 64-bit Mac
19333 platforms. This is a regression with respect to previous 64-bit behaviour, but is no
19334 more permissive than on 32-bit builds. This issue should be addressed at some point.
19335 (This is tracked by bug #21783.)
19337 https://bugs.webkit.org/show_bug.cgi?id=22554
19338 Greater than 4x speedup on regexp-dna, on x86-64.
19340 * assembler/MacroAssembler.h:
19341 (JSC::MacroAssembler::addPtr):
19342 (JSC::MacroAssembler::loadPtr):
19343 (JSC::MacroAssembler::storePtr):
19344 (JSC::MacroAssembler::pop):
19345 (JSC::MacroAssembler::push):
19346 (JSC::MacroAssembler::move):
19347 * assembler/X86Assembler.h:
19348 (JSC::X86Assembler::):
19349 (JSC::X86Assembler::movq_rr):
19350 (JSC::X86Assembler::addl_i8m):
19351 (JSC::X86Assembler::addl_i32r):
19352 (JSC::X86Assembler::addq_i8r):
19353 (JSC::X86Assembler::addq_i32r):
19354 (JSC::X86Assembler::movq_mr):
19355 (JSC::X86Assembler::movq_rm):
19357 * wrec/WRECGenerator.cpp:
19358 (JSC::WREC::Generator::generateEnter):
19359 (JSC::WREC::Generator::generateReturnSuccess):
19360 (JSC::WREC::Generator::generateReturnFailure):
19362 * wtf/TCSystemAlloc.cpp:
19364 2008-12-01 Cameron Zwarich <zwarich@apple.com>
19366 Reviewed by Sam Weinig.
19368 Preliminary work for bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
19369 <https://bugs.webkit.org/show_bug.cgi?id=20340>
19371 SegmentedVector currently frees segments and reallocates them when used
19372 as a stack. This can lead to unsafe use of pointers into freed segments.
19374 In order to fix this problem, SegmentedVector will be changed to only
19375 grow and never shrink, with the sole exception of clearing all of its
19376 data, a capability that is required by Lexer. This patch changes the
19377 public interface to only allow for these capabilities.
19379 * bytecompiler/BytecodeGenerator.cpp:
19380 (JSC::BytecodeGenerator::BytecodeGenerator): Use reserveCapacity()
19381 instead of resize() for m_globals and m_parameters.
19382 * bytecompiler/SegmentedVector.h:
19383 (JSC::SegmentedVector::resize): Removed.
19384 (JSC::SegmentedVector::reserveCapacity): Added.
19385 (JSC::SegmentedVector::clear): Added.
19386 (JSC::SegmentedVector::shrink): Removed.
19387 (JSC::SegmentedVector::grow): Removed.
19388 * parser/Lexer.cpp:
19389 (JSC::Lexer::clear): Use clear() instead of resize(0).
19391 2008-11-30 Sam Weinig <sam@webkit.org>
19393 Reviewed by Mark Rowe.
19395 Renames jumps to m_jumps in JumpList.
19397 * assembler/MacroAssembler.h:
19398 (JSC::MacroAssembler::JumpList::link):
19399 (JSC::MacroAssembler::JumpList::linkTo):
19400 (JSC::MacroAssembler::JumpList::append):
19402 2008-11-30 Antti Koivisto <antti@apple.com>
19404 Reviewed by Mark Rowe.
19406 https://bugs.webkit.org/show_bug.cgi?id=22557
19408 Report free size in central and thread caches too.
19410 * wtf/FastMalloc.cpp:
19411 (WTF::TCMallocStats::fastMallocStatistics):
19412 * wtf/FastMalloc.h:
19414 2008-11-29 Antti Koivisto <antti@apple.com>
19416 Reviewed by Dan Bernstein.
19418 https://bugs.webkit.org/show_bug.cgi?id=22557
19419 Add statistics for JavaScript GC heap.
19421 * JavaScriptCore.exp:
19422 * runtime/Collector.cpp:
19423 (JSC::Heap::objectCount):
19424 (JSC::addToStatistics):
19425 (JSC::Heap::statistics):
19426 * runtime/Collector.h:
19428 2008-11-29 Antti Koivisto <antti@apple.com>
19430 Fix debug build by adding a stub method.
19432 * wtf/FastMalloc.cpp:
19433 (WTF::fastMallocStatistics):
19435 2008-11-29 Antti Koivisto <antti@apple.com>
19437 Reviewed by Alexey Proskuryakov.
19439 https://bugs.webkit.org/show_bug.cgi?id=22557
19441 Add function for getting basic statistics from FastMalloc.
19443 * JavaScriptCore.exp:
19444 * wtf/FastMalloc.cpp:
19446 (WTF::TCMalloc_PageHeap::ReturnedBytes):
19447 (WTF::TCMallocStats::fastMallocStatistics):
19448 * wtf/FastMalloc.h:
19450 2008-11-29 Cameron Zwarich <zwarich@apple.com>
19454 The C++ standard does not automatically grant the friendships of an
19455 enclosing class to its nested subclasses, so we should do so explicitly.
19456 This fixes the GCC 4.0 build, although both GCC 4.2 and Visual C++ 2005
19457 accept the incorrect code as it is.
19459 * assembler/MacroAssembler.h:
19461 2008-11-29 Gavin Barraclough <barraclough@apple.com>
19463 Reviewed by Cameron Zwarich.
19465 Add the class MacroAssembler to provide some abstraction of code generation,
19466 and change WREC to make use of this class, rather than directly accessing
19469 This patch also allows WREC to be compiled without the rest of the JIT enabled.
19471 * JavaScriptCore.xcodeproj/project.pbxproj:
19472 * assembler/MacroAssembler.h: Added.
19473 (JSC::MacroAssembler::):
19474 (JSC::MacroAssembler::MacroAssembler):
19475 (JSC::MacroAssembler::copyCode):
19476 (JSC::MacroAssembler::Address::Address):
19477 (JSC::MacroAssembler::ImplicitAddress::ImplicitAddress):
19478 (JSC::MacroAssembler::BaseIndex::BaseIndex):
19479 (JSC::MacroAssembler::Label::Label):
19480 (JSC::MacroAssembler::Jump::Jump):
19481 (JSC::MacroAssembler::Jump::link):
19482 (JSC::MacroAssembler::Jump::linkTo):
19483 (JSC::MacroAssembler::JumpList::link):
19484 (JSC::MacroAssembler::JumpList::linkTo):
19485 (JSC::MacroAssembler::JumpList::append):
19486 (JSC::MacroAssembler::Imm32::Imm32):
19487 (JSC::MacroAssembler::add32):
19488 (JSC::MacroAssembler::or32):
19489 (JSC::MacroAssembler::sub32):
19490 (JSC::MacroAssembler::loadPtr):
19491 (JSC::MacroAssembler::load32):
19492 (JSC::MacroAssembler::load16):
19493 (JSC::MacroAssembler::storePtr):
19494 (JSC::MacroAssembler::store32):
19495 (JSC::MacroAssembler::pop):
19496 (JSC::MacroAssembler::push):
19497 (JSC::MacroAssembler::peek):
19498 (JSC::MacroAssembler::poke):
19499 (JSC::MacroAssembler::move):
19500 (JSC::MacroAssembler::compareImm32ForBranch):
19501 (JSC::MacroAssembler::compareImm32ForBranchEquality):
19502 (JSC::MacroAssembler::jae32):
19503 (JSC::MacroAssembler::je32):
19504 (JSC::MacroAssembler::je16):
19505 (JSC::MacroAssembler::jg32):
19506 (JSC::MacroAssembler::jge32):
19507 (JSC::MacroAssembler::jl32):
19508 (JSC::MacroAssembler::jle32):
19509 (JSC::MacroAssembler::jne32):
19510 (JSC::MacroAssembler::jump):
19511 (JSC::MacroAssembler::breakpoint):
19512 (JSC::MacroAssembler::ret):
19513 * assembler/X86Assembler.h:
19514 (JSC::X86Assembler::cmpw_rm):
19515 * interpreter/Interpreter.cpp:
19516 (JSC::Interpreter::Interpreter):
19517 * interpreter/Interpreter.h:
19518 (JSC::Interpreter::assemblerBuffer):
19519 * runtime/RegExp.cpp:
19520 (JSC::RegExp::RegExp):
19522 (JSC::WREC::Generator::compileRegExp):
19524 * wrec/WRECFunctors.cpp:
19525 (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom):
19526 (JSC::WREC::GenerateCharacterClassFunctor::generateAtom):
19527 (JSC::WREC::GenerateBackreferenceFunctor::generateAtom):
19528 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
19529 * wrec/WRECFunctors.h:
19530 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
19531 * wrec/WRECGenerator.cpp:
19532 (JSC::WREC::Generator::generateEnter):
19533 (JSC::WREC::Generator::generateReturnSuccess):
19534 (JSC::WREC::Generator::generateSaveIndex):
19535 (JSC::WREC::Generator::generateIncrementIndex):
19536 (JSC::WREC::Generator::generateLoadCharacter):
19537 (JSC::WREC::Generator::generateJumpIfEndOfInput):
19538 (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
19539 (JSC::WREC::Generator::generateReturnFailure):
19540 (JSC::WREC::Generator::generateBacktrack1):
19541 (JSC::WREC::Generator::generateBacktrackBackreference):
19542 (JSC::WREC::Generator::generateBackreferenceQuantifier):
19543 (JSC::WREC::Generator::generateNonGreedyQuantifier):
19544 (JSC::WREC::Generator::generateGreedyQuantifier):
19545 (JSC::WREC::Generator::generatePatternCharacter):
19546 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
19547 (JSC::WREC::Generator::generateCharacterClassInverted):
19548 (JSC::WREC::Generator::generateCharacterClass):
19549 (JSC::WREC::Generator::generateParentheses):
19550 (JSC::WREC::Generator::generateParenthesesNonGreedy):
19551 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
19552 (JSC::WREC::Generator::generateAssertionBOL):
19553 (JSC::WREC::Generator::generateAssertionEOL):
19554 (JSC::WREC::Generator::generateAssertionWordBoundary):
19555 (JSC::WREC::Generator::generateBackreference):
19556 (JSC::WREC::Generator::terminateAlternative):
19557 (JSC::WREC::Generator::terminateDisjunction):
19558 * wrec/WRECGenerator.h:
19559 (JSC::WREC::Generator::Generator):
19560 * wrec/WRECParser.cpp:
19561 (JSC::WREC::Parser::parsePatternCharacterQualifier):
19562 (JSC::WREC::Parser::parseCharacterClassQuantifier):
19563 (JSC::WREC::Parser::parseBackreferenceQuantifier):
19564 (JSC::WREC::Parser::parseParentheses):
19565 (JSC::WREC::Parser::parseCharacterClass):
19566 (JSC::WREC::Parser::parseOctalEscape):
19567 (JSC::WREC::Parser::parseEscape):
19568 (JSC::WREC::Parser::parseTerm):
19569 (JSC::WREC::Parser::parseDisjunction):
19570 * wrec/WRECParser.h:
19571 (JSC::WREC::Parser::Parser):
19572 (JSC::WREC::Parser::parsePattern):
19573 (JSC::WREC::Parser::parseAlternative):
19576 2008-11-28 Simon Hausmann <hausmann@webkit.org>
19578 Reviewed by Tor Arne Vestbø.
19580 Fix compilation on Windows CE
19582 Port away from the use of errno after calling strtol(), instead
19583 detect conversion errors by checking the result and the stop
19586 * runtime/DateMath.cpp:
19590 2008-11-28 Joerg Bornemann <joerg.bornemann@trolltech.com>
19592 Reviewed by Simon Hausmann.
19594 Implement lowResUTCTime() on Windows CE using GetSystemTime as _ftime() is not available.
19596 * runtime/DateMath.cpp:
19597 (JSC::lowResUTCTime):
19599 2008-11-28 Simon Hausmann <hausmann@webkit.org>
19601 Rubber-stamped by Tor Arne Vestbø.
19603 Removed unnecessary inclusion of errno.h, which also fixes compilation on Windows CE.
19605 * runtime/JSGlobalObjectFunctions.cpp:
19607 2008-11-27 Cameron Zwarich <zwarich@apple.com>
19611 r38825 made JSFunction::m_body private, but some inspector code in
19612 WebCore sets the field. Add setters for it.
19614 * runtime/JSFunction.h:
19615 (JSC::JSFunction::setBody):
19617 2008-11-27 Sam Weinig <sam@webkit.org>
19619 Reviewed by Cameron Zwarich.
19621 Fix FIXME by adding accessor for JSFunction's m_body property.
19623 * interpreter/Interpreter.cpp:
19624 (JSC::Interpreter::cti_op_call_JSFunction):
19625 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
19626 (JSC::Interpreter::cti_vm_lazyLinkCall):
19627 * profiler/Profiler.cpp:
19628 (JSC::createCallIdentifierFromFunctionImp):
19629 * runtime/Arguments.h:
19630 (JSC::Arguments::getArgumentsData):
19631 (JSC::Arguments::Arguments):
19632 * runtime/FunctionPrototype.cpp:
19633 (JSC::functionProtoFuncToString):
19634 * runtime/JSFunction.h:
19635 (JSC::JSFunction::JSFunction):
19636 (JSC::JSFunction::body):
19638 2008-11-27 Sam Weinig <sam@webkit.org>
19640 Reviewed by Oliver Hunt.
19642 Remove unused member variables from ProgramNode.
19646 2008-11-27 Brent Fulgham <bfulgham@gmail.com>
19648 Reviewed by Alexey Proskuryakov.
19650 Enable mouse panning feaure on Windows Cairo build.
19651 See http://bugs.webkit.org/show_bug.cgi?id=22525
19653 * wtf/Platform.h: Enable mouse panning feaure on Windows Cairo build.
19655 2008-11-27 Alp Toker <alp@nuanti.com>
19657 Change recently introduced C++ comments in Platform.h to C comments to
19658 fix the minidom build with traditional C.
19660 Build GtkLauncher and minidom with the '-ansi' compiler flag to detect
19661 API header breakage at build time.
19666 2008-11-27 Alp Toker <alp@nuanti.com>
19668 Remove C++ comment from JavaScriptCore API headers (introduced r35449).
19669 Fixes build for ANSI C applications using the public API.
19671 * API/WebKitAvailability.h:
19673 2008-11-26 Eric Seidel <eric@webkit.org>
19675 No review, build fix only.
19677 Fix the JSC Chromium Mac build by adding JavaScriptCore/icu into the include path
19679 * JavaScriptCore.scons:
19681 2008-11-25 Cameron Zwarich <zwarich@apple.com>
19683 Reviewed by Maciej Stachowiak.
19685 Remove the unused member function JSFunction::getParameterName().
19687 * runtime/JSFunction.cpp:
19688 * runtime/JSFunction.h:
19690 2008-11-24 Gavin Barraclough <barraclough@apple.com>
19692 Reviewed by Geoff Garen.
19694 Polymorpic caching for get by id chain. Similar to the polymorphic caching already implemented
19695 for self and proto accesses (implemented by allowing multiple trampolines to be JIT genertaed,
19696 and linked together) - the get by id chain caching is implemented as a genericization of the
19697 proto list caching, allowing cached access lists to contain a mix of proto and proto chain
19698 accesses (since in JS style inheritance hierarchies you may commonly see a mix of properties
19699 being overridden on the direct prototype, or higher up its prototype chain).
19701 In order to allow this patch to compile there is a fix to appease gcc 4.2 compiler issues
19702 (removing the jumps between fall-through cases in privateExecute).
19704 This patch also removes redundant immediate checking from the reptach code, and fixes a related
19705 memory leak (failure to deallocate trampolines).
19707 ~2% progression on v8 tests (bulk on the win on deltablue)
19709 * bytecode/Instruction.h:
19710 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::):
19711 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
19712 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
19713 (JSC::PolymorphicAccessStructureList::derefStructures):
19714 * interpreter/Interpreter.cpp:
19715 (JSC::countPrototypeChainEntriesAndCheckForProxies):
19716 (JSC::Interpreter::tryCacheGetByID):
19717 (JSC::Interpreter::privateExecute):
19718 (JSC::Interpreter::tryCTICacheGetByID):
19719 (JSC::Interpreter::cti_op_get_by_id_self_fail):
19720 (JSC::getPolymorphicAccessStructureListSlot):
19721 (JSC::Interpreter::cti_op_get_by_id_proto_list):
19722 * interpreter/Interpreter.h:
19724 (JSC::JIT::privateCompileGetByIdProto):
19725 (JSC::JIT::privateCompileGetByIdSelfList):
19726 (JSC::JIT::privateCompileGetByIdProtoList):
19727 (JSC::JIT::privateCompileGetByIdChainList):
19728 (JSC::JIT::privateCompileGetByIdChain):
19729 (JSC::JIT::privateCompilePatchGetArrayLength):
19731 (JSC::JIT::compileGetByIdChainList):
19733 2008-11-25 Cameron Zwarich <zwarich@apple.com>
19735 Reviewed by Alexey Proskuryakov.
19737 Move the collect() call in Heap::heapAllocate() that is conditionally
19738 compiled under COLLECT_ON_EVERY_ALLOCATION so that it is before we get
19739 information about the heap. This was causing assertion failures for me
19740 while I was reducing a bug.
19742 * runtime/Collector.cpp:
19743 (JSC::Heap::heapAllocate):
19745 2008-11-24 Cameron Zwarich <zwarich@apple.com>
19747 Reviewed by Geoff Garen.
19749 Bug 13790: Function declarations are not treated as statements (used to affect starcraft2.com)
19750 <https://bugs.webkit.org/show_bug.cgi?id=13790>
19752 Modify the parser to treat function declarations as statements,
19753 simplifying the grammar in the process. Technically, according to the
19754 grammar in the ECMA spec, function declarations are not statements and
19755 can not be used everywhere that statements can, but it is not worth the
19756 possibility compatibility issues just to stick to the spec in this case.
19758 * parser/Grammar.y:
19759 * parser/Nodes.cpp:
19760 (JSC::FuncDeclNode::emitBytecode): Avoid returning ignoredResult()
19761 as a result, because it causes a crash in DoWhileNode::emitBytecode().
19763 2008-11-24 Geoffrey Garen <ggaren@apple.com>
19765 Reviewed by Sam Weinig.
19767 Unroll the regexp matching loop by 1. 10% speedup on simple matching
19768 stress test. No change on SunSpider.
19770 (I decided not to unroll to arbitrary levels because the returns diminsh
19774 (JSC::WREC::compileRegExp):
19775 * wrec/WRECGenerator.cpp:
19776 (JSC::WREC::Generator::generateJumpIfEndOfInput):
19777 (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
19778 * wrec/WRECGenerator.h:
19779 * wrec/WRECParser.h:
19780 (JSC::WREC::Parser::error):
19781 (JSC::WREC::Parser::parsePattern):
19783 2008-11-24 Geoffrey Garen <ggaren@apple.com>
19785 Reviewed by Sam Weinig.
19787 Removed some unnecessary "Generator::" prefixes.
19789 * wrec/WRECGenerator.cpp:
19790 (JSC::WREC::Generator::generateEnter):
19791 (JSC::WREC::Generator::generateReturnSuccess):
19792 (JSC::WREC::Generator::generateSaveIndex):
19793 (JSC::WREC::Generator::generateIncrementIndex):
19794 (JSC::WREC::Generator::generateLoopIfNotEndOfInput):
19795 (JSC::WREC::Generator::generateReturnFailure):
19797 2008-11-24 Geoffrey Garen <ggaren@apple.com>
19799 Reviewed by Sam Weinig.
19801 Made a bunch of WREC::Parser functions private, and added an explicit
19802 "reset()" function, so a parser can be reused.
19804 * wrec/WRECParser.h:
19805 (JSC::WREC::Parser::Parser):
19806 (JSC::WREC::Parser::generator):
19807 (JSC::WREC::Parser::ignoreCase):
19808 (JSC::WREC::Parser::multiline):
19809 (JSC::WREC::Parser::recordSubpattern):
19810 (JSC::WREC::Parser::numSubpatterns):
19811 (JSC::WREC::Parser::parsePattern):
19812 (JSC::WREC::Parser::parseAlternative):
19813 (JSC::WREC::Parser::reset):
19815 2008-11-24 Gavin Barraclough <barraclough@apple.com>
19817 Reviewed by Cameron Zwarich.
19819 Implement repatching for get by id chain.
19820 Previously the access is performed in a function stub, in the repatch form
19821 the trampoline is not called to; instead the hot path is relinked to jump
19822 directly to the trampoline, if it fails it will jump to the slow case.
19824 https://bugs.webkit.org/show_bug.cgi?id=22449
19825 3% progression on deltablue.
19828 (JSC::JIT::privateCompileGetByIdProto):
19829 (JSC::JIT::privateCompileGetByIdChain):
19831 2008-11-24 Joerg Bornemann <joerg.bornemann@trolltech.com>
19833 Reviewed by Simon Hausmann.
19835 https://bugs.webkit.org/show_bug.cgi?id=20746
19837 Various small compilation fixes to make the Qt port of WebKit
19838 compile on Windows CE.
19840 * config.h: Don't set _CRT_RAND_S for CE, it's not available.
19841 * jsc.cpp: Disabled use of debugger includes for CE. It
19842 does not have the debugging functions.
19843 * runtime/DateMath.cpp: Use localtime() on Windows CE.
19844 * wtf/Assertions.cpp: Compile on Windows CE without debugger.
19845 * wtf/Assertions.h: Include windows.h before defining ASSERT.
19846 * wtf/MathExtras.h: Include stdlib.h instead of xmath.h.
19847 * wtf/Platform.h: Disable ERRNO_H and detect endianess based
19848 on the Qt endianess. On Qt for Windows CE the endianess is
19849 defined by the vendor specific build spec.
19850 * wtf/Threading.h: Use the volatile-less atomic functions.
19851 * wtf/dtoa.cpp: Compile without errno.
19852 * wtf/win/MainThreadWin.cpp: Don't include windows.h on CE after
19853 Assertions.h due to the redefinition of ASSERT.
19855 2008-11-22 Gavin Barraclough <barraclough@apple.com>
19857 Reviewed by Cameron Zwarich.
19859 Replace accidentally deleted immediate check from get by id chain trampoline.
19860 https://bugs.webkit.org/show_bug.cgi?id=22413
19863 (JSC::JIT::privateCompileGetByIdChain):
19865 2008-11-21 Gavin Barraclough <barraclough@apple.com>
19867 Reviewed by Oliver Hunt.
19869 Add (really) polymorphic caching for get by id self.
19870 Very similar to caching of prototype accesses, described below.
19872 Oh, also, probably shouldn't have been leaking those structure list objects.
19874 4% preogression on deltablue.
19876 * bytecode/CodeBlock.cpp:
19877 (JSC::CodeBlock::dump):
19878 (JSC::CodeBlock::derefStructures):
19879 (JSC::PrototypeStructureList::derefStructures):
19880 * bytecode/Instruction.h:
19881 * bytecode/Opcode.h:
19882 * interpreter/Interpreter.cpp:
19883 (JSC::Interpreter::privateExecute):
19884 (JSC::Interpreter::cti_op_get_by_id_self_fail):
19886 (JSC::JIT::privateCompileMainPass):
19887 (JSC::JIT::privateCompileGetByIdSelfList):
19888 (JSC::JIT::patchGetByIdSelf):
19890 (JSC::JIT::compileGetByIdSelfList):
19892 2008-11-21 Geoffrey Garen <ggaren@apple.com>
19894 Reviewed by Sam Weinig.
19896 Fixed many crashes seen 'round the world (but only in release builds).
19898 Update outputParameter offset to reflect slight re-ordering of push
19899 instructions in r38669.
19901 * wrec/WRECGenerator.cpp:
19903 2008-11-21 Geoffrey Garen <ggaren@apple.com>
19905 Reviewed by Sam Weinig.
19907 A little more RegExp refactoring.
19909 Deployed a helper function for reading the next character. Used the "link
19910 vector of jumps" helper in a place I missed before.
19912 * wrec/WRECGenerator.cpp:
19913 (JSC::WREC::Generator::generateLoadCharacter):
19914 (JSC::WREC::Generator::generatePatternCharacter):
19915 (JSC::WREC::Generator::generateCharacterClass):
19916 (JSC::WREC::Generator::generateAssertionEOL):
19917 (JSC::WREC::Generator::generateAssertionWordBoundary):
19918 * wrec/WRECGenerator.h:
19920 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
19922 Reviewed by Dan Bernstein.
19924 https://bugs.webkit.org/show_bug.cgi?id=22402
19925 Replace abort() with CRASH()
19927 * wtf/Assertions.h: Added a different method to crash, which should work even is 0xbbadbeef
19928 is a valid memory address.
19930 * runtime/Collector.cpp:
19931 * wtf/FastMalloc.cpp:
19932 * wtf/FastMalloc.h:
19933 * wtf/TCSpinLock.h:
19934 Replace abort() with CRASH().
19936 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
19938 Reverted fix for bug 22042 (Replace abort() with CRASH()), because it was breaking
19939 FOR_EACH_OPCODE_ID macro somehow, making Safari crash.
19941 * runtime/Collector.cpp:
19942 (JSC::Heap::heapAllocate):
19943 (JSC::Heap::collect):
19944 * wtf/Assertions.h:
19945 * wtf/FastMalloc.cpp:
19948 (WTF::fastRealloc):
19949 (WTF::InitSizeClasses):
19950 (WTF::PageHeapAllocator::New):
19951 (WTF::TCMallocStats::do_malloc):
19952 * wtf/FastMalloc.h:
19953 * wtf/TCSpinLock.h:
19954 (TCMalloc_SpinLock::Init):
19955 (TCMalloc_SpinLock::Finalize):
19956 (TCMalloc_SpinLock::Lock):
19957 (TCMalloc_SpinLock::Unlock):
19959 2008-11-21 Geoffrey Garen <ggaren@apple.com>
19961 Reviewed by Sam Weinig.
19963 A little more RegExp refactoring.
19965 Moved all assembly from WREC.cpp into WRECGenerator helper functions.
19966 This should help with portability and readability.
19968 Removed ASSERTs after calls to executableCopy(), and changed
19969 executableCopy() to ASSERT instead.
19971 * assembler/X86Assembler.h:
19972 (JSC::X86Assembler::executableCopy):
19974 (JSC::JIT::privateCompile):
19975 (JSC::JIT::privateCompileGetByIdSelf):
19976 (JSC::JIT::privateCompileGetByIdProto):
19977 (JSC::JIT::privateCompileGetByIdChain):
19978 (JSC::JIT::privateCompilePutByIdReplace):
19979 (JSC::JIT::privateCompilePutByIdTransition):
19980 (JSC::JIT::privateCompileCTIMachineTrampolines):
19981 (JSC::JIT::privateCompilePatchGetArrayLength):
19983 (JSC::WREC::compileRegExp):
19984 * wrec/WRECGenerator.cpp:
19985 (JSC::WREC::Generator::generateEnter):
19986 (JSC::WREC::Generator::generateReturnSuccess):
19987 (JSC::WREC::Generator::generateSaveIndex):
19988 (JSC::WREC::Generator::generateIncrementIndex):
19989 (JSC::WREC::Generator::generateLoopIfNotEndOfInput):
19990 (JSC::WREC::Generator::generateReturnFailure):
19991 * wrec/WRECGenerator.h:
19992 * wrec/WRECParser.h:
19993 (JSC::WREC::Parser::ignoreCase):
19994 (JSC::WREC::Parser::generator):
19996 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
20000 * wtf/Assertions.h: Use ::abort for C++ code.
20002 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
20004 Reviewed by Sam Weinig.
20006 https://bugs.webkit.org/show_bug.cgi?id=22402
20007 Replace abort() with CRASH()
20009 * wtf/Assertions.h: Added abort() after an attempt to crash for extra safety.
20011 * runtime/Collector.cpp:
20012 * wtf/FastMalloc.cpp:
20013 * wtf/FastMalloc.h:
20014 * wtf/TCSpinLock.h:
20015 Replace abort() with CRASH().
20017 2008-11-21 Geoffrey Garen <ggaren@apple.com>
20019 Reviewed by Sam Weinig.
20021 Renamed wrec => generator.
20023 * wrec/WRECFunctors.cpp:
20024 (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom):
20025 (JSC::WREC::GeneratePatternCharacterFunctor::backtrack):
20026 (JSC::WREC::GenerateCharacterClassFunctor::generateAtom):
20027 (JSC::WREC::GenerateCharacterClassFunctor::backtrack):
20028 (JSC::WREC::GenerateBackreferenceFunctor::generateAtom):
20029 (JSC::WREC::GenerateBackreferenceFunctor::backtrack):
20030 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
20032 2008-11-19 Gavin Barraclough <barraclough@apple.com>
20034 Reviewed by Darin Adler.
20036 Add support for (really) polymorphic caching of prototype accesses.
20038 If a cached prototype access misses, cti_op_get_by_id_proto_list is called.
20039 When this occurs the Structure pointers from the instruction stream are copied
20040 off into a new ProtoStubInfo object. A second prototype access trampoline is
20041 generated, and chained onto the first. Subsequent missed call to
20042 cti_op_get_by_id_proto_list_append, which append futher new trampolines, up to
20043 PROTOTYPE_LIST_CACHE_SIZE (currently 4). If any of the misses result in an
20044 access other than to a direct prototype property, list formation is halted (or
20045 for the initial miss, does not take place at all).
20047 Separate fail case functions are provided for each access since this contributes
20048 to the performance progression (enables better processor branch prediction).
20050 Overall this is a near 5% progression on v8, with around 10% wins on richards
20053 * bytecode/CodeBlock.cpp:
20054 (JSC::CodeBlock::dump):
20055 (JSC::CodeBlock::derefStructures):
20056 * bytecode/Instruction.h:
20057 (JSC::ProtoStructureList::ProtoStubInfo::set):
20058 (JSC::ProtoStructureList::ProtoStructureList):
20059 (JSC::Instruction::Instruction):
20060 (JSC::Instruction::):
20061 * bytecode/Opcode.h:
20062 * interpreter/Interpreter.cpp:
20063 (JSC::Interpreter::privateExecute):
20064 (JSC::Interpreter::tryCTICacheGetByID):
20065 (JSC::Interpreter::cti_op_put_by_id_fail):
20066 (JSC::Interpreter::cti_op_get_by_id_self_fail):
20067 (JSC::Interpreter::cti_op_get_by_id_proto_list):
20068 (JSC::Interpreter::cti_op_get_by_id_proto_list_append):
20069 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
20070 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
20071 (JSC::Interpreter::cti_op_get_by_id_chain_fail):
20072 (JSC::Interpreter::cti_op_get_by_id_array_fail):
20073 (JSC::Interpreter::cti_op_get_by_id_string_fail):
20074 * interpreter/Interpreter.h:
20076 (JSC::JIT::privateCompileMainPass):
20077 (JSC::JIT::privateCompileGetByIdSelf):
20078 (JSC::JIT::privateCompileGetByIdProto):
20079 (JSC::JIT::privateCompileGetByIdProtoList):
20080 (JSC::JIT::privateCompileGetByIdChain):
20081 (JSC::JIT::privateCompileCTIMachineTrampolines):
20082 (JSC::JIT::privateCompilePatchGetArrayLength):
20084 (JSC::JIT::compileGetByIdProtoList):
20086 2008-11-20 Sam Weinig <sam@webkit.org>
20088 Try and fix the tiger build.
20090 * parser/Grammar.y:
20092 2008-11-20 Eric Seidel <eric@webkit.org>
20094 Reviewed by Darin Adler.
20096 Make JavaScriptCore Chromium build under Windows (cmd only, cygwin almost works)
20097 https://bugs.webkit.org/show_bug.cgi?id=22347
20099 * JavaScriptCore.scons:
20100 * parser/Parser.cpp: Add using std::auto_ptr since we use auto_ptr
20102 2008-11-20 Steve Falkenburg <sfalken@apple.com>
20106 Reviewed by Sam Weinig.
20108 * parser/Parser.cpp:
20109 (JSC::Parser::reparse):
20111 2008-11-20 Geoffrey Garen <ggaren@apple.com>
20113 Reviewed by Sam Weinig.
20115 A little more RegExp refactoring.
20117 Created a helper function in the assembler for linking a vector of
20118 JmpSrc to a location, and deployed it in a bunch of places.
20120 * JavaScriptCore.xcodeproj/project.pbxproj:
20121 * assembler/X86Assembler.h:
20122 (JSC::X86Assembler::link):
20124 (JSC::WREC::compileRegExp):
20125 * wrec/WRECGenerator.cpp:
20126 (JSC::WREC::Generator::generateNonGreedyQuantifier):
20127 (JSC::WREC::Generator::generateGreedyQuantifier):
20128 (JSC::WREC::Generator::generateCharacterClassInverted):
20129 (JSC::WREC::Generator::generateParentheses):
20130 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
20131 (JSC::WREC::Generator::generateAssertionBOL):
20132 (JSC::WREC::Generator::generateAssertionEOL):
20133 (JSC::WREC::Generator::generateAssertionWordBoundary):
20134 (JSC::WREC::Generator::terminateAlternative):
20135 (JSC::WREC::Generator::terminateDisjunction):
20136 * wrec/WRECParser.cpp:
20137 * wrec/WRECParser.h:
20138 (JSC::WREC::Parser::consumeHex):
20140 2008-11-20 Sam Weinig <sam@webkit.org>
20142 Fix non-mac builds.
20144 * parser/Lexer.cpp:
20145 * parser/Parser.cpp:
20147 2008-11-20 Sam Weinig <sam@webkit.org>
20149 Reviewed by Darin Adler.
20151 Patch for https://bugs.webkit.org/show_bug.cgi?id=22385
20152 <rdar://problem/6390179>
20153 Lazily reparse FunctionBodyNodes on first execution.
20155 - Saves 57MB on Membuster head.
20157 * bytecompiler/BytecodeGenerator.cpp:
20158 (JSC::BytecodeGenerator::generate): Remove vector shrinking since this is now
20159 handled by destroying the ScopeNodeData after generation.
20161 * parser/Grammar.y: Add alternate NoNode version of the grammar
20162 that does not create nodes. This is used to lazily create FunctionBodyNodes
20163 on first execution.
20165 * parser/Lexer.cpp:
20166 (JSC::Lexer::setCode): Fix bug where on reparse, the Lexer was confused about
20167 what position and length meant. Position is the current position in the original
20168 data buffer (important for getting correct line/column information) and length
20169 the end offset in the original buffer.
20171 (JSC::Lexer::sourceCode): Positions are relative to the beginning of the buffer.
20173 * parser/Nodes.cpp:
20174 (JSC::ScopeNodeData::ScopeNodeData): Move initialization of ScopeNode data here.
20175 (JSC::ScopeNode::ScopeNode): Add constructor that only sets the JSGlobalData
20176 for FunctionBodyNode stubs.
20177 (JSC::ScopeNode::~ScopeNode): Release m_children now that we don't inherit from
20179 (JSC::ScopeNode::releaseNodes): Ditto.
20180 (JSC::EvalNode::generateBytecode): Only shrink m_children, as we need to keep around
20181 the rest of the data.
20182 (JSC::FunctionBodyNode::FunctionBodyNode): Add constructor that only sets the
20184 (JSC::FunctionBodyNode::create): Ditto.
20185 (JSC::FunctionBodyNode::generateBytecode): If we don't have the data, do a reparse
20186 to construct it. Then after generation, destroy the data.
20187 (JSC::ProgramNode::generateBytecode): After generation, destroy the AST data.
20189 (JSC::ExpressionNode::): Add isFuncExprNode for FunctionConstructor.
20190 (JSC::StatementNode::): Add isExprStatementNode for FunctionConstructor.
20191 (JSC::ExprStatementNode::): Ditto.
20192 (JSC::ExprStatementNode::expr): Add accessor for FunctionConstructor.
20193 (JSC::FuncExprNode::): Add isFuncExprNode for FunctionConstructor
20195 (JSC::ScopeNode::adoptData): Adopts a ScopeNodeData.
20196 (JSC::ScopeNode::data): Accessor for ScopeNodeData.
20197 (JSC::ScopeNode::destroyData): Deletes the ScopeNodeData.
20198 (JSC::ScopeNode::setFeatures): Added.
20199 (JSC::ScopeNode::varStack): Added assert.
20200 (JSC::ScopeNode::functionStack): Ditto.
20201 (JSC::ScopeNode::children): Ditto.
20202 (JSC::ScopeNode::neededConstants): Ditto.
20203 Factor m_varStack, m_functionStack, m_children and m_numConstants into ScopeNodeData.
20205 * parser/Parser.cpp:
20206 (JSC::Parser::reparse): Reparse the SourceCode in the FunctionBodyNode and set
20207 set up the ScopeNodeData for it.
20210 * parser/SourceCode.h:
20211 (JSC::SourceCode::endOffset): Added for use in the lexer.
20213 * runtime/FunctionConstructor.cpp:
20214 (JSC::getFunctionBody): Assuming a ProgramNode with one FunctionExpression in it,
20215 get the FunctionBodyNode. Any issues signifies a parse failure in constructFunction.
20216 (JSC::constructFunction): Make parsing functions in the form new Function(""), easier
20217 by concatenating the strings together (with some glue) and parsing the function expression
20218 as a ProgramNode from which we can receive the FunctionBodyNode. This has the added benefit
20219 of not having special parsing code for the arguments and lazily constructing the
20220 FunctionBodyNode's AST on first execution.
20222 * runtime/Identifier.h:
20223 (JSC::operator!=): Added.
20225 2008-11-20 Sam Weinig <sam@webkit.org>
20227 Reviewed by Geoffrey Garen.
20229 Speedup the lexer to offset coming re-parsing patch.
20231 - .6% progression on Sunspider.
20233 * bytecompiler/SegmentedVector.h:
20234 (JSC::SegmentedVector::shrink): Fixed bug where m_size would not be
20235 set when shrinking to 0.
20237 * parser/Lexer.cpp:
20238 (JSC::Lexer::Lexer):
20239 (JSC::Lexer::isIdentStart): Use isASCIIAlpha and isASCII to avoid going into ICU in the common cases.
20240 (JSC::Lexer::isIdentPart): Use isASCIIAlphanumeric and isASCII to avoid going into ICU in the common cases
20241 (JSC::isDecimalDigit): Use version in ASCIICType.h. Inlining it was a regression.
20242 (JSC::Lexer::isHexDigit): Ditto.
20243 (JSC::Lexer::isOctalDigit): Ditto.
20244 (JSC::Lexer::clear): Resize the m_identifiers SegmentedVector to initial
20246 * parser/Lexer.h: Remove unused m_strings vector. Make m_identifiers
20247 a SegmentedVector<Identifier> to avoid allocating a new Identifier* for
20248 each identifier found. The SegmentedVector is need so we can passes
20249 references to the Identifier to the parser, which remain valid even when
20250 the vector is resized.
20251 (JSC::Lexer::makeIdentifier): Inline and return a reference to the added
20254 2008-11-20 Sam Weinig <sam@webkit.org>
20256 Reviewed by Darin Adler.
20258 Add isASCII to ASCIICType. Use coming soon!
20260 * wtf/ASCIICType.h:
20263 2008-11-20 Sam Weinig <sam@webkit.org>
20265 Reviewed by Darin Adler.
20267 Add OwnPtr constructor and OwnPtr::adopt that take an auto_ptr.
20270 (WTF::OwnPtr::OwnPtr):
20271 (WTF::OwnPtr::adopt):
20273 2008-11-20 Alexey Proskuryakov <ap@webkit.org>
20275 Reviewed by Darin Adler.
20277 https://bugs.webkit.org/show_bug.cgi?id=22364
20278 Crashes seen on Tiger buildbots due to worker threads exhausting pthread keys
20280 * runtime/Collector.cpp:
20282 (JSC::Heap::destroy):
20283 (JSC::Heap::makeUsableFromMultipleThreads):
20284 (JSC::Heap::registerThread):
20285 * runtime/Collector.h:
20286 Pthread key for tracking threads is only created on request now, because this is a limited
20287 resource, and thread tracking is not needed for worker heaps, or for WebCore heap.
20289 * API/JSContextRef.cpp: (JSGlobalContextCreateInGroup): Call makeUsableFromMultipleThreads().
20291 * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::sharedInstance): Ditto.
20293 * runtime/JSGlobalData.h: (JSC::JSGlobalData::makeUsableFromMultipleThreads): Just forward
20294 the call to Heap, which clients need not know about, ideally.
20296 2008-11-20 Geoffrey Garen <ggaren@apple.com>
20298 Reviewed by Sam Weinig.
20300 A little more WREC refactoring.
20302 Removed the "Register" suffix from register names in WREC, and renamed:
20303 currentPosition => index
20304 currentValue => character
20305 quantifierCount => repeatCount
20307 Added a top-level parsePattern function to the WREC parser, which
20308 allowed me to remove the error() and atEndOfPattern() accessors.
20310 Factored out an MSVC customization into a constant.
20312 Renamed nextLabel => beginPattern.
20315 (JSC::WREC::compileRegExp):
20316 * wrec/WRECGenerator.cpp:
20317 (JSC::WREC::Generator::generateBacktrack1):
20318 (JSC::WREC::Generator::generateBacktrackBackreference):
20319 (JSC::WREC::Generator::generateBackreferenceQuantifier):
20320 (JSC::WREC::Generator::generateNonGreedyQuantifier):
20321 (JSC::WREC::Generator::generateGreedyQuantifier):
20322 (JSC::WREC::Generator::generatePatternCharacter):
20323 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
20324 (JSC::WREC::Generator::generateCharacterClassInverted):
20325 (JSC::WREC::Generator::generateCharacterClass):
20326 (JSC::WREC::Generator::generateParentheses):
20327 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
20328 (JSC::WREC::Generator::generateAssertionBOL):
20329 (JSC::WREC::Generator::generateAssertionEOL):
20330 (JSC::WREC::Generator::generateAssertionWordBoundary):
20331 (JSC::WREC::Generator::generateBackreference):
20332 (JSC::WREC::Generator::generateDisjunction):
20333 (JSC::WREC::Generator::terminateDisjunction):
20334 * wrec/WRECGenerator.h:
20335 * wrec/WRECParser.h:
20336 (JSC::WREC::Parser::parsePattern):
20338 2008-11-19 Geoffrey Garen <ggaren@apple.com>
20340 Reviewed by Darin Adler.
20342 https://bugs.webkit.org/show_bug.cgi?id=22361
20343 A little more RegExp refactoring.
20345 Consistently named variables holding the starting position at which
20346 regexp matching should begin to "startOffset".
20348 A few more "regExpObject" => "regExpConstructor" changes.
20350 Refactored RegExpObject::match for clarity, and replaced a slow "get"
20351 of the "global" property with a fast access to the global bit.
20353 Made the error message you see when RegExpObject::match has no input a
20354 little more informative, as in Firefox.
20356 * runtime/RegExp.cpp:
20357 (JSC::RegExp::match):
20358 * runtime/RegExp.h:
20359 * runtime/RegExpObject.cpp:
20360 (JSC::RegExpObject::match):
20361 * runtime/StringPrototype.cpp:
20362 (JSC::stringProtoFuncReplace):
20363 (JSC::stringProtoFuncMatch):
20364 (JSC::stringProtoFuncSearch):
20366 2008-11-19 Geoffrey Garen <ggaren@apple.com>
20368 Reviewed by Sam Weinig.
20370 A little more refactoring.
20372 Removed the "emit" and "emitUnlinked" prefixes from the assembler.
20374 Moved the JmpSrc and JmpDst class definitions to the top of the X86
20375 assembler class, in accordance with WebKit style guidelines.
20377 * assembler/X86Assembler.h:
20378 (JSC::X86Assembler::JmpSrc::JmpSrc):
20379 (JSC::X86Assembler::JmpDst::JmpDst):
20380 (JSC::X86Assembler::int3):
20381 (JSC::X86Assembler::pushl_m):
20382 (JSC::X86Assembler::popl_m):
20383 (JSC::X86Assembler::movl_rr):
20384 (JSC::X86Assembler::addl_rr):
20385 (JSC::X86Assembler::addl_i8r):
20386 (JSC::X86Assembler::addl_i8m):
20387 (JSC::X86Assembler::addl_i32r):
20388 (JSC::X86Assembler::addl_mr):
20389 (JSC::X86Assembler::andl_rr):
20390 (JSC::X86Assembler::andl_i32r):
20391 (JSC::X86Assembler::cmpl_i8r):
20392 (JSC::X86Assembler::cmpl_rr):
20393 (JSC::X86Assembler::cmpl_rm):
20394 (JSC::X86Assembler::cmpl_mr):
20395 (JSC::X86Assembler::cmpl_i32r):
20396 (JSC::X86Assembler::cmpl_i32m):
20397 (JSC::X86Assembler::cmpl_i8m):
20398 (JSC::X86Assembler::cmpw_rm):
20399 (JSC::X86Assembler::orl_rr):
20400 (JSC::X86Assembler::orl_mr):
20401 (JSC::X86Assembler::orl_i32r):
20402 (JSC::X86Assembler::subl_rr):
20403 (JSC::X86Assembler::subl_i8r):
20404 (JSC::X86Assembler::subl_i8m):
20405 (JSC::X86Assembler::subl_i32r):
20406 (JSC::X86Assembler::subl_mr):
20407 (JSC::X86Assembler::testl_i32r):
20408 (JSC::X86Assembler::testl_i32m):
20409 (JSC::X86Assembler::testl_rr):
20410 (JSC::X86Assembler::xorl_i8r):
20411 (JSC::X86Assembler::xorl_rr):
20412 (JSC::X86Assembler::sarl_i8r):
20413 (JSC::X86Assembler::sarl_CLr):
20414 (JSC::X86Assembler::shl_i8r):
20415 (JSC::X86Assembler::shll_CLr):
20416 (JSC::X86Assembler::imull_rr):
20417 (JSC::X86Assembler::imull_i32r):
20418 (JSC::X86Assembler::idivl_r):
20419 (JSC::X86Assembler::negl_r):
20420 (JSC::X86Assembler::movl_mr):
20421 (JSC::X86Assembler::movzbl_rr):
20422 (JSC::X86Assembler::movzwl_mr):
20423 (JSC::X86Assembler::movl_rm):
20424 (JSC::X86Assembler::movl_i32r):
20425 (JSC::X86Assembler::movl_i32m):
20426 (JSC::X86Assembler::leal_mr):
20427 (JSC::X86Assembler::jmp_r):
20428 (JSC::X86Assembler::jmp_m):
20429 (JSC::X86Assembler::movsd_mr):
20430 (JSC::X86Assembler::xorpd_mr):
20431 (JSC::X86Assembler::movsd_rm):
20432 (JSC::X86Assembler::movd_rr):
20433 (JSC::X86Assembler::cvtsi2sd_rr):
20434 (JSC::X86Assembler::cvttsd2si_rr):
20435 (JSC::X86Assembler::addsd_mr):
20436 (JSC::X86Assembler::subsd_mr):
20437 (JSC::X86Assembler::mulsd_mr):
20438 (JSC::X86Assembler::addsd_rr):
20439 (JSC::X86Assembler::subsd_rr):
20440 (JSC::X86Assembler::mulsd_rr):
20441 (JSC::X86Assembler::ucomis_rr):
20442 (JSC::X86Assembler::pextrw_irr):
20443 (JSC::X86Assembler::call):
20444 (JSC::X86Assembler::jmp):
20445 (JSC::X86Assembler::jne):
20446 (JSC::X86Assembler::jnz):
20447 (JSC::X86Assembler::je):
20448 (JSC::X86Assembler::jl):
20449 (JSC::X86Assembler::jb):
20450 (JSC::X86Assembler::jle):
20451 (JSC::X86Assembler::jbe):
20452 (JSC::X86Assembler::jge):
20453 (JSC::X86Assembler::jg):
20454 (JSC::X86Assembler::ja):
20455 (JSC::X86Assembler::jae):
20456 (JSC::X86Assembler::jo):
20457 (JSC::X86Assembler::jp):
20458 (JSC::X86Assembler::js):
20459 (JSC::X86Assembler::predictNotTaken):
20460 (JSC::X86Assembler::convertToFastCall):
20461 (JSC::X86Assembler::restoreArgumentReference):
20462 (JSC::X86Assembler::restoreArgumentReferenceForTrampoline):
20463 (JSC::X86Assembler::modRm_rr):
20464 (JSC::X86Assembler::modRm_rr_Unchecked):
20465 (JSC::X86Assembler::modRm_rm):
20466 (JSC::X86Assembler::modRm_rm_Unchecked):
20467 (JSC::X86Assembler::modRm_rmsib):
20468 (JSC::X86Assembler::modRm_opr):
20469 (JSC::X86Assembler::modRm_opr_Unchecked):
20470 (JSC::X86Assembler::modRm_opm):
20471 (JSC::X86Assembler::modRm_opm_Unchecked):
20472 (JSC::X86Assembler::modRm_opmsib):
20474 (JSC::JIT::emitNakedCall):
20475 (JSC::JIT::emitNakedFastCall):
20476 (JSC::JIT::emitCTICall):
20477 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
20478 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
20479 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
20480 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
20481 (JSC::JIT::emitArithIntToImmWithJump):
20482 (JSC::JIT::compileOpCall):
20483 (JSC::JIT::compileOpStrictEq):
20484 (JSC::JIT::emitSlowScriptCheck):
20485 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
20486 (JSC::JIT::compileBinaryArithOp):
20487 (JSC::JIT::privateCompileMainPass):
20488 (JSC::JIT::privateCompileSlowCases):
20489 (JSC::JIT::privateCompile):
20490 (JSC::JIT::privateCompileGetByIdSelf):
20491 (JSC::JIT::privateCompileGetByIdProto):
20492 (JSC::JIT::privateCompileGetByIdChain):
20493 (JSC::JIT::privateCompilePutByIdReplace):
20494 (JSC::JIT::privateCompilePutByIdTransition):
20495 (JSC::JIT::privateCompileCTIMachineTrampolines):
20496 (JSC::JIT::privateCompilePatchGetArrayLength):
20498 (JSC::WREC::compileRegExp):
20499 * wrec/WRECGenerator.cpp:
20500 (JSC::WREC::Generator::generateBackreferenceQuantifier):
20501 (JSC::WREC::Generator::generateNonGreedyQuantifier):
20502 (JSC::WREC::Generator::generateGreedyQuantifier):
20503 (JSC::WREC::Generator::generatePatternCharacter):
20504 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
20505 (JSC::WREC::Generator::generateCharacterClassInverted):
20506 (JSC::WREC::Generator::generateCharacterClass):
20507 (JSC::WREC::Generator::generateParentheses):
20508 (JSC::WREC::Generator::generateParenthesesNonGreedy):
20509 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
20510 (JSC::WREC::Generator::generateAssertionBOL):
20511 (JSC::WREC::Generator::generateAssertionEOL):
20512 (JSC::WREC::Generator::generateAssertionWordBoundary):
20513 (JSC::WREC::Generator::generateBackreference):
20514 (JSC::WREC::Generator::generateDisjunction):
20516 2008-11-19 Simon Hausmann <hausmann@webkit.org>
20518 Sun CC build fix, removed trailing comman for last enum value.
20520 * wtf/unicode/qt4/UnicodeQt4.h:
20523 2008-11-19 Mark Rowe <mrowe@apple.com>
20525 Reviewed by Alexey Proskuryakov.
20527 Expand the workaround for Apple GCC compiler bug <rdar://problem/6354696> to all versions of GCC 4.0.1.
20528 It has been observed with builds 5465 (Xcode 3.0) and 5484 (Xcode 3.1), and there is no evidence
20529 that it has been fixed in newer builds of GCC 4.0.1.
20531 This addresses <https://bugs.webkit.org/show_bug.cgi?id=22351> (WebKit nightly crashes on launch on 10.4.11).
20533 * wtf/StdLibExtras.h:
20535 2008-11-18 Cameron Zwarich <zwarich@apple.com>
20537 Reviewed by Maciej Stachowiak and Geoff Garen.
20539 Bug 22287: ASSERTION FAILED: Not enough jumps linked in slow case codegen in CTI::privateCompileSlowCases())
20540 <https://bugs.webkit.org/show_bug.cgi?id=22287>
20542 Fix a typo in the number cell reuse code where the first and second
20543 operands are sometimes confused.
20546 (JSC::JIT::compileBinaryArithOpSlowCase):
20548 2008-11-18 Dan Bernstein <mitz@apple.com>
20550 - try to fix the Windows build
20552 * interpreter/Interpreter.cpp:
20553 (JSC::Interpreter::privateExecute):
20555 2008-11-18 Geoffrey Garen <ggaren@apple.com>
20557 Reviewed by Sam Weinig.
20559 Minor RegExp cleanup.
20561 SunSpider says no change.
20563 * runtime/RegExpObject.cpp:
20564 (JSC::RegExpObject::match): Renamed "regExpObj" to "regExpConstructor".
20567 (JSC::WREC::compileRegExp): Instead of checking for a NULL output vector,
20568 ASSERT that the output vector is not NULL. (The rest of WREC is not
20569 safe to use with a NULL output vector, and we probably don't want to
20570 spend the time and/or performance to make it safe.)
20572 2008-11-18 Geoffrey Garen <ggaren@apple.com>
20574 Reviewed by Darin Adler.
20576 A little more renaming and refactoring.
20578 VM_CHECK_EXCEPTION() => CHECK_FOR_EXCEPTION().
20579 NEXT_INSTRUCTION => NEXT_INSTRUCTION().
20581 Removed the "Error_" and "TempError_" prefixes from WREC error types.
20583 Refactored the WREC parser so it doesn't need a "setError" function,
20584 and changed "isEndOfPattern" and its use -- they read kind of backwards
20587 Changed our "TODO:" error messages at least to say something, since you
20588 can't say "TODO:" in shipping software.
20590 * interpreter/Interpreter.cpp:
20591 (JSC::Interpreter::privateExecute):
20592 (JSC::Interpreter::cti_op_convert_this):
20593 (JSC::Interpreter::cti_op_add):
20594 (JSC::Interpreter::cti_op_pre_inc):
20595 (JSC::Interpreter::cti_op_loop_if_less):
20596 (JSC::Interpreter::cti_op_loop_if_lesseq):
20597 (JSC::Interpreter::cti_op_put_by_id):
20598 (JSC::Interpreter::cti_op_put_by_id_second):
20599 (JSC::Interpreter::cti_op_put_by_id_generic):
20600 (JSC::Interpreter::cti_op_put_by_id_fail):
20601 (JSC::Interpreter::cti_op_get_by_id):
20602 (JSC::Interpreter::cti_op_get_by_id_second):
20603 (JSC::Interpreter::cti_op_get_by_id_generic):
20604 (JSC::Interpreter::cti_op_get_by_id_fail):
20605 (JSC::Interpreter::cti_op_instanceof):
20606 (JSC::Interpreter::cti_op_del_by_id):
20607 (JSC::Interpreter::cti_op_mul):
20608 (JSC::Interpreter::cti_op_call_NotJSFunction):
20609 (JSC::Interpreter::cti_op_resolve):
20610 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
20611 (JSC::Interpreter::cti_op_get_by_val):
20612 (JSC::Interpreter::cti_op_resolve_func):
20613 (JSC::Interpreter::cti_op_sub):
20614 (JSC::Interpreter::cti_op_put_by_val):
20615 (JSC::Interpreter::cti_op_put_by_val_array):
20616 (JSC::Interpreter::cti_op_lesseq):
20617 (JSC::Interpreter::cti_op_loop_if_true):
20618 (JSC::Interpreter::cti_op_negate):
20619 (JSC::Interpreter::cti_op_resolve_skip):
20620 (JSC::Interpreter::cti_op_resolve_global):
20621 (JSC::Interpreter::cti_op_div):
20622 (JSC::Interpreter::cti_op_pre_dec):
20623 (JSC::Interpreter::cti_op_jless):
20624 (JSC::Interpreter::cti_op_not):
20625 (JSC::Interpreter::cti_op_jtrue):
20626 (JSC::Interpreter::cti_op_post_inc):
20627 (JSC::Interpreter::cti_op_eq):
20628 (JSC::Interpreter::cti_op_lshift):
20629 (JSC::Interpreter::cti_op_bitand):
20630 (JSC::Interpreter::cti_op_rshift):
20631 (JSC::Interpreter::cti_op_bitnot):
20632 (JSC::Interpreter::cti_op_resolve_with_base):
20633 (JSC::Interpreter::cti_op_mod):
20634 (JSC::Interpreter::cti_op_less):
20635 (JSC::Interpreter::cti_op_neq):
20636 (JSC::Interpreter::cti_op_post_dec):
20637 (JSC::Interpreter::cti_op_urshift):
20638 (JSC::Interpreter::cti_op_bitxor):
20639 (JSC::Interpreter::cti_op_bitor):
20640 (JSC::Interpreter::cti_op_push_scope):
20641 (JSC::Interpreter::cti_op_to_jsnumber):
20642 (JSC::Interpreter::cti_op_in):
20643 (JSC::Interpreter::cti_op_del_by_val):
20645 (JSC::WREC::compileRegExp):
20646 * wrec/WRECParser.cpp:
20647 (JSC::WREC::Parser::parseGreedyQuantifier):
20648 (JSC::WREC::Parser::parseParentheses):
20649 (JSC::WREC::Parser::parseCharacterClass):
20650 (JSC::WREC::Parser::parseEscape):
20651 * wrec/WRECParser.h:
20652 (JSC::WREC::Parser::):
20653 (JSC::WREC::Parser::atEndOfPattern):
20655 2008-11-18 Alexey Proskuryakov <ap@webkit.org>
20657 Reviewed by Darin Adler.
20659 https://bugs.webkit.org/show_bug.cgi?id=22337
20660 Enable workers by default
20662 * Configurations/JavaScriptCore.xcconfig: Define ENABLE_WORKERS.
20664 2008-11-18 Alexey Proskuryakov <ap@webkit.org>
20666 - Windows build fix
20668 * wrec/WRECFunctors.h:
20669 * wrec/WRECGenerator.h:
20670 * wrec/WRECParser.h:
20671 CharacterClass is a struct, not a class, fix forward declarations.
20673 2008-11-18 Dan Bernstein <mitz@apple.com>
20675 - Windows build fix
20677 * assembler/X86Assembler.h:
20679 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20683 Try to fix gtk build.
20685 * wrec/Quantifier.h:
20687 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20691 Try to fix gtk build.
20693 * assembler/AssemblerBuffer.h:
20695 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20697 Reviewed by Sam Weinig.
20699 Split WREC classes out into individual files, with a few modifications
20700 to more closely match the WebKit coding style.
20703 * JavaScriptCore.scons:
20704 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20705 * JavaScriptCore.xcodeproj/project.pbxproj:
20706 * assembler/X86Assembler.h:
20707 * runtime/RegExp.cpp:
20708 * wrec/CharacterClass.cpp: Copied from wrec/CharacterClassConstructor.cpp.
20709 (JSC::WREC::CharacterClass::newline):
20710 (JSC::WREC::CharacterClass::digits):
20711 (JSC::WREC::CharacterClass::spaces):
20712 (JSC::WREC::CharacterClass::wordchar):
20713 (JSC::WREC::CharacterClass::nondigits):
20714 (JSC::WREC::CharacterClass::nonspaces):
20715 (JSC::WREC::CharacterClass::nonwordchar):
20716 * wrec/CharacterClass.h: Copied from wrec/CharacterClassConstructor.h.
20717 * wrec/CharacterClassConstructor.cpp:
20718 (JSC::WREC::CharacterClassConstructor::addSortedRange):
20719 (JSC::WREC::CharacterClassConstructor::append):
20720 * wrec/CharacterClassConstructor.h:
20721 * wrec/Quantifier.h: Copied from wrec/WREC.h.
20723 (JSC::WREC::compileRegExp):
20725 * wrec/WRECFunctors.cpp: Copied from wrec/WREC.cpp.
20726 * wrec/WRECFunctors.h: Copied from wrec/WREC.cpp.
20727 (JSC::WREC::GenerateAtomFunctor::~GenerateAtomFunctor):
20728 (JSC::WREC::GeneratePatternCharacterFunctor::GeneratePatternCharacterFunctor):
20729 (JSC::WREC::GenerateCharacterClassFunctor::GenerateCharacterClassFunctor):
20730 (JSC::WREC::GenerateBackreferenceFunctor::GenerateBackreferenceFunctor):
20731 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
20732 * wrec/WRECGenerator.cpp: Copied from wrec/WREC.cpp.
20733 (JSC::WREC::Generator::generatePatternCharacter):
20734 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
20735 (JSC::WREC::Generator::generateCharacterClassInverted):
20736 (JSC::WREC::Generator::generateCharacterClass):
20737 (JSC::WREC::Generator::generateParentheses):
20738 (JSC::WREC::Generator::generateAssertionBOL):
20739 (JSC::WREC::Generator::generateAssertionEOL):
20740 (JSC::WREC::Generator::generateAssertionWordBoundary):
20741 * wrec/WRECGenerator.h: Copied from wrec/WREC.h.
20742 * wrec/WRECParser.cpp: Copied from wrec/WREC.cpp.
20743 (JSC::WREC::Parser::parseGreedyQuantifier):
20744 (JSC::WREC::Parser::parseCharacterClassQuantifier):
20745 (JSC::WREC::Parser::parseParentheses):
20746 (JSC::WREC::Parser::parseCharacterClass):
20747 (JSC::WREC::Parser::parseEscape):
20748 (JSC::WREC::Parser::parseTerm):
20749 * wrec/WRECParser.h: Copied from wrec/WREC.h.
20750 (JSC::WREC::Parser::):
20751 (JSC::WREC::Parser::Parser):
20752 (JSC::WREC::Parser::setError):
20753 (JSC::WREC::Parser::error):
20754 (JSC::WREC::Parser::recordSubpattern):
20755 (JSC::WREC::Parser::numSubpatterns):
20756 (JSC::WREC::Parser::ignoreCase):
20757 (JSC::WREC::Parser::multiline):
20759 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20763 Try to fix a few builds.
20765 * JavaScriptCoreSources.bkl:
20767 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20771 Try to fix a few builds.
20773 * JavaScriptCore.pri:
20774 * JavaScriptCore.scons:
20775 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20777 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20779 Reviewed by Sam Weinig.
20781 Moved VM/CTI.* => jit/JIT.*.
20786 * JavaScriptCore.pri:
20787 * JavaScriptCore.scons:
20788 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20789 * JavaScriptCore.xcodeproj/project.pbxproj:
20790 * VM/CTI.cpp: Removed.
20791 * VM/CTI.h: Removed.
20792 * bytecode/CodeBlock.cpp:
20793 * interpreter/Interpreter.cpp:
20795 * jit/JIT.cpp: Copied from VM/CTI.cpp.
20796 * jit/JIT.h: Copied from VM/CTI.h.
20797 * runtime/RegExp.cpp:
20799 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20801 Reviewed by Sam Weinig.
20803 Moved runtime/ExecState.* => interpreter/CallFrame.*.
20806 * API/OpaqueJSString.cpp:
20808 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20809 * JavaScriptCore.xcodeproj/project.pbxproj:
20810 * debugger/DebuggerCallFrame.h:
20811 * interpreter/CallFrame.cpp: Copied from runtime/ExecState.cpp.
20812 * interpreter/CallFrame.h: Copied from runtime/ExecState.h.
20813 * interpreter/Interpreter.cpp:
20814 * parser/Nodes.cpp:
20815 * profiler/ProfileGenerator.cpp:
20816 * profiler/Profiler.cpp:
20817 * runtime/ClassInfo.h:
20818 * runtime/Collector.cpp:
20819 * runtime/Completion.cpp:
20820 * runtime/ExceptionHelpers.cpp:
20821 * runtime/ExecState.cpp: Removed.
20822 * runtime/ExecState.h: Removed.
20823 * runtime/Identifier.cpp:
20824 * runtime/JSFunction.cpp:
20825 * runtime/JSGlobalObjectFunctions.cpp:
20826 * runtime/JSLock.cpp:
20827 * runtime/JSNumberCell.h:
20828 * runtime/JSObject.h:
20829 * runtime/JSString.h:
20830 * runtime/Lookup.h:
20831 * runtime/PropertyNameArray.h:
20833 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20837 Try to fix Windows build.
20841 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20845 Try to fix Windows build.
20848 * runtime/ExecState.h:
20850 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20852 Reviewed by Sam Weinig.
20854 Moved VM/SamplingTool.* => bytecode/SamplingTool.*.
20857 * JavaScriptCore.pri:
20858 * JavaScriptCore.scons:
20859 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20860 * JavaScriptCore.xcodeproj/project.pbxproj:
20861 * JavaScriptCoreSources.bkl:
20862 * VM/SamplingTool.cpp: Removed.
20863 * VM/SamplingTool.h: Removed.
20864 * bytecode/SamplingTool.cpp: Copied from VM/SamplingTool.cpp.
20865 * bytecode/SamplingTool.h: Copied from VM/SamplingTool.h.
20869 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20873 Try to fix Windows build.
20875 * runtime/ExecState.h:
20877 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20879 Reviewed by Sam Weinig.
20881 Moved VM/ExceptionHelpers.cpp => runtime/ExceptionHelpers.cpp.
20884 * JavaScriptCore.pri:
20885 * JavaScriptCore.scons:
20886 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20887 * JavaScriptCore.xcodeproj/project.pbxproj:
20888 * JavaScriptCoreSources.bkl:
20889 * VM/ExceptionHelpers.cpp: Removed.
20890 * runtime/ExceptionHelpers.cpp: Copied from VM/ExceptionHelpers.cpp.
20892 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20894 Reviewed by Sam Weinig.
20896 Moved VM/RegisterFile.cpp => interpreter/RegisterFile.cpp.
20898 * AllInOneFile.cpp:
20900 * JavaScriptCore.pri:
20901 * JavaScriptCore.scons:
20902 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20903 * JavaScriptCore.xcodeproj/project.pbxproj:
20904 * JavaScriptCoreSources.bkl:
20905 * VM/RegisterFile.cpp: Removed.
20906 * interpreter/RegisterFile.cpp: Copied from VM/RegisterFile.cpp.
20908 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20912 Try to fix Windows build.
20914 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20916 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20920 Try to fix Windows build.
20922 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
20924 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20928 Try to fix Windows build.
20930 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20932 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20934 Reviewed by Sam Weinig.
20937 VM/ExceptionHelpers.h => runtime/ExceptionHelpers.h
20938 VM/Register.h => interpreter/Register.h
20939 VM/RegisterFile.h => interpreter/RegisterFile.h
20943 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20944 * JavaScriptCore.xcodeproj/project.pbxproj:
20945 * VM/ExceptionHelpers.h: Removed.
20946 * VM/Register.h: Removed.
20947 * VM/RegisterFile.h: Removed.
20948 * interpreter/Register.h: Copied from VM/Register.h.
20949 * interpreter/RegisterFile.h: Copied from VM/RegisterFile.h.
20950 * runtime/ExceptionHelpers.h: Copied from VM/ExceptionHelpers.h.
20952 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20956 Try to fix Qt build.
20958 * JavaScriptCore.pri:
20960 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20962 Reviewed by Sam Weinig.
20964 Moved VM/Machine.cpp => interpreter/Interpreter.cpp.
20966 * DerivedSources.make:
20968 * JavaScriptCore.pri:
20969 * JavaScriptCore.scons:
20970 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20971 * JavaScriptCore.xcodeproj/project.pbxproj:
20972 * JavaScriptCoreSources.bkl:
20973 * VM/Machine.cpp: Removed.
20974 * interpreter/Interpreter.cpp: Copied from VM/Machine.cpp.
20976 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20978 Reviewed by Sam Weinig.
20980 Moved VM/Machine.h => interpreter/Interpreter.h
20983 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20984 * JavaScriptCore.xcodeproj/project.pbxproj:
20987 * VM/ExceptionHelpers.cpp:
20989 * VM/Machine.h: Removed.
20990 * VM/SamplingTool.cpp:
20991 * bytecode/CodeBlock.cpp:
20992 * bytecompiler/BytecodeGenerator.cpp:
20993 * bytecompiler/BytecodeGenerator.h:
20994 * debugger/DebuggerCallFrame.cpp:
20995 * interpreter: Added.
20996 * interpreter/Interpreter.h: Copied from VM/Machine.h.
20997 * profiler/ProfileGenerator.cpp:
20998 * runtime/Arguments.h:
20999 * runtime/ArrayPrototype.cpp:
21000 * runtime/Collector.cpp:
21001 * runtime/Completion.cpp:
21002 * runtime/ExecState.h:
21003 * runtime/FunctionPrototype.cpp:
21004 * runtime/JSActivation.cpp:
21005 * runtime/JSFunction.cpp:
21006 * runtime/JSGlobalData.cpp:
21007 * runtime/JSGlobalObject.cpp:
21008 * runtime/JSGlobalObjectFunctions.cpp:
21011 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21013 Reviewed by Sam Weinig.
21015 Moved runtime/Interpreter.cpp => runtime/Completion.cpp.
21017 Moved functions from Interpreter.h to Completion.h, and removed
21018 Interpreter.h from the project.
21021 * AllInOneFile.cpp:
21023 * JavaScriptCore.pri:
21024 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21025 * JavaScriptCore.xcodeproj/project.pbxproj:
21026 * JavaScriptCoreSources.bkl:
21028 * runtime/Completion.cpp: Copied from runtime/Interpreter.cpp.
21029 * runtime/Completion.h:
21030 * runtime/Interpreter.cpp: Removed.
21031 * runtime/Interpreter.h: Removed.
21033 2008-11-17 Gabor Loki <loki@inf.u-szeged.hu>
21035 Reviewed by Darin Adler.
21037 <https://bugs.webkit.org/show_bug.cgi?id=22312>
21038 Fix PCRE include path problem on Qt-port
21040 * JavaScriptCore.pri:
21043 2008-11-17 Gabor Loki <loki@inf.u-szeged.hu>
21045 Reviewed by Darin Adler.
21047 <https://bugs.webkit.org/show_bug.cgi?id=22313>
21048 Add missing CTI source to the build system on Qt-port
21050 * JavaScriptCore.pri:
21052 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21056 Try to fix JSGlue build.
21058 * JavaScriptCore.xcodeproj/project.pbxproj:
21060 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21064 Try to fix Qt build.
21068 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21072 Try to fix Qt build.
21074 * JavaScriptCore.pri:
21076 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21080 Try to fix Qt build.
21082 * JavaScriptCore.pri:
21084 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21086 Reviewed by Sam Weinig.
21090 VM/CodeBlock.* => bytecode/CodeBlock.*
21091 VM/EvalCodeCache.h => bytecode/EvalCodeCache.h
21092 VM/Instruction.h => bytecode/Instruction.h
21093 VM/Opcode.* => bytecode/Opcode.*
21096 * JavaScriptCore.scons:
21097 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21098 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
21099 * JavaScriptCore.xcodeproj/project.pbxproj:
21100 * JavaScriptCoreSources.bkl:
21101 * VM/CodeBlock.cpp: Removed.
21102 * VM/CodeBlock.h: Removed.
21103 * VM/EvalCodeCache.h: Removed.
21104 * VM/Instruction.h: Removed.
21105 * VM/Opcode.cpp: Removed.
21106 * VM/Opcode.h: Removed.
21108 * bytecode/CodeBlock.cpp: Copied from VM/CodeBlock.cpp.
21109 * bytecode/CodeBlock.h: Copied from VM/CodeBlock.h.
21110 * bytecode/EvalCodeCache.h: Copied from VM/EvalCodeCache.h.
21111 * bytecode/Instruction.h: Copied from VM/Instruction.h.
21112 * bytecode/Opcode.cpp: Copied from VM/Opcode.cpp.
21113 * bytecode/Opcode.h: Copied from VM/Opcode.h.
21117 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21121 Try to fix a few more builds.
21124 * JavaScriptCore.pri:
21125 * JavaScriptCore.scons:
21126 * JavaScriptCoreSources.bkl:
21128 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21132 Try to fix gtk build.
21136 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21140 Try to fix Windows build.
21142 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21144 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21146 Reviewed by Sam Weinig.
21150 VM/LabelID.h => bytecompiler/Label.h
21151 VM/RegisterID.h => bytecompiler/RegisterID.h
21152 VM/SegmentedVector.h => bytecompiler/SegmentedVector.h
21153 bytecompiler/CodeGenerator.* => bytecompiler/BytecodeGenerator.*
21155 * AllInOneFile.cpp:
21156 * JavaScriptCore.xcodeproj/project.pbxproj:
21157 * VM/LabelID.h: Removed.
21158 * VM/RegisterID.h: Removed.
21159 * VM/SegmentedVector.h: Removed.
21160 * bytecompiler/BytecodeGenerator.cpp: Copied from bytecompiler/CodeGenerator.cpp.
21161 * bytecompiler/BytecodeGenerator.h: Copied from bytecompiler/CodeGenerator.h.
21162 * bytecompiler/CodeGenerator.cpp: Removed.
21163 * bytecompiler/CodeGenerator.h: Removed.
21164 * bytecompiler/Label.h: Copied from VM/LabelID.h.
21165 * bytecompiler/LabelScope.h:
21166 * bytecompiler/RegisterID.h: Copied from VM/RegisterID.h.
21167 * bytecompiler/SegmentedVector.h: Copied from VM/SegmentedVector.h.
21169 * parser/Nodes.cpp:
21171 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21175 Try to fix Windows build.
21177 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21179 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21183 Try to fix Windows build.
21185 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21187 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21191 Try to fix Windows build.
21193 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21195 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21199 Try to fix Windows build.
21201 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
21203 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21207 Try to fix Windows build.
21209 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21211 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21213 Reviewed by Sam Weinig.
21215 Moved masm => assembler and split "AssemblerBuffer.h" out of "X86Assembler.h".
21217 Also renamed ENABLE_MASM to ENABLE_ASSEMBLER.
21220 * JavaScriptCore.xcodeproj/project.pbxproj:
21221 * assembler: Added.
21222 * assembler/AssemblerBuffer.h: Copied from masm/X86Assembler.h.
21223 (JSC::AssemblerBuffer::AssemblerBuffer):
21224 (JSC::AssemblerBuffer::~AssemblerBuffer):
21225 (JSC::AssemblerBuffer::ensureSpace):
21226 (JSC::AssemblerBuffer::isAligned):
21227 (JSC::AssemblerBuffer::putByteUnchecked):
21228 (JSC::AssemblerBuffer::putByte):
21229 (JSC::AssemblerBuffer::putShortUnchecked):
21230 (JSC::AssemblerBuffer::putShort):
21231 (JSC::AssemblerBuffer::putIntUnchecked):
21232 (JSC::AssemblerBuffer::putInt):
21233 (JSC::AssemblerBuffer::data):
21234 (JSC::AssemblerBuffer::size):
21235 (JSC::AssemblerBuffer::reset):
21236 (JSC::AssemblerBuffer::executableCopy):
21237 (JSC::AssemblerBuffer::grow):
21238 * assembler/X86Assembler.h: Copied from masm/X86Assembler.h.
21240 * masm/X86Assembler.h: Removed.
21243 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21247 Try to fix gtk build.
21251 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21259 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21263 Try to fix windows build.
21267 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21271 Try to fix gtk build.
21275 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21277 Reviewed by Sam Weinig.
21279 Renamed ENABLE_CTI and ENABLE(CTI) to ENABLE_JIT and ENABLE(JIT).
21283 * VM/CodeBlock.cpp:
21284 (JSC::CodeBlock::~CodeBlock):
21286 (JSC::CodeBlock::CodeBlock):
21288 (JSC::Interpreter::Interpreter):
21289 (JSC::Interpreter::initialize):
21290 (JSC::Interpreter::~Interpreter):
21291 (JSC::Interpreter::execute):
21292 (JSC::Interpreter::privateExecute):
21294 * bytecompiler/CodeGenerator.cpp:
21295 (JSC::prepareJumpTableForStringSwitch):
21296 * runtime/JSFunction.cpp:
21297 (JSC::JSFunction::~JSFunction):
21298 * runtime/JSGlobalData.h:
21301 * wtf/TCSystemAlloc.cpp:
21303 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21307 Try to fix gtk build.
21311 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21313 Reviewed by a few people on squirrelfish-dev.
21315 Renamed CTI => JIT.
21318 (JSC::JIT::killLastResultRegister):
21319 (JSC::JIT::emitGetVirtualRegister):
21320 (JSC::JIT::emitGetVirtualRegisters):
21321 (JSC::JIT::emitPutCTIArgFromVirtualRegister):
21322 (JSC::JIT::emitPutCTIArg):
21323 (JSC::JIT::emitGetCTIArg):
21324 (JSC::JIT::emitPutCTIArgConstant):
21325 (JSC::JIT::getConstantImmediateNumericArg):
21326 (JSC::JIT::emitPutCTIParam):
21327 (JSC::JIT::emitGetCTIParam):
21328 (JSC::JIT::emitPutToCallFrameHeader):
21329 (JSC::JIT::emitGetFromCallFrameHeader):
21330 (JSC::JIT::emitPutVirtualRegister):
21331 (JSC::JIT::emitInitRegister):
21332 (JSC::JIT::printBytecodeOperandTypes):
21333 (JSC::JIT::emitAllocateNumber):
21334 (JSC::JIT::emitNakedCall):
21335 (JSC::JIT::emitNakedFastCall):
21336 (JSC::JIT::emitCTICall):
21337 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
21338 (JSC::JIT::linkSlowCaseIfNotJSCell):
21339 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
21340 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
21341 (JSC::JIT::getDeTaggedConstantImmediate):
21342 (JSC::JIT::emitFastArithDeTagImmediate):
21343 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
21344 (JSC::JIT::emitFastArithReTagImmediate):
21345 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
21346 (JSC::JIT::emitFastArithImmToInt):
21347 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
21348 (JSC::JIT::emitFastArithIntToImmNoCheck):
21349 (JSC::JIT::emitArithIntToImmWithJump):
21350 (JSC::JIT::emitTagAsBoolImmediate):
21352 (JSC::JIT::compileOpCallInitializeCallFrame):
21353 (JSC::JIT::compileOpCallSetupArgs):
21354 (JSC::JIT::compileOpCallEvalSetupArgs):
21355 (JSC::JIT::compileOpConstructSetupArgs):
21356 (JSC::JIT::compileOpCall):
21357 (JSC::JIT::compileOpStrictEq):
21358 (JSC::JIT::emitSlowScriptCheck):
21359 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
21360 (JSC::JIT::compileBinaryArithOp):
21361 (JSC::JIT::compileBinaryArithOpSlowCase):
21362 (JSC::JIT::privateCompileMainPass):
21363 (JSC::JIT::privateCompileLinkPass):
21364 (JSC::JIT::privateCompileSlowCases):
21365 (JSC::JIT::privateCompile):
21366 (JSC::JIT::privateCompileGetByIdSelf):
21367 (JSC::JIT::privateCompileGetByIdProto):
21368 (JSC::JIT::privateCompileGetByIdChain):
21369 (JSC::JIT::privateCompilePutByIdReplace):
21370 (JSC::JIT::privateCompilePutByIdTransition):
21371 (JSC::JIT::unlinkCall):
21372 (JSC::JIT::linkCall):
21373 (JSC::JIT::privateCompileCTIMachineTrampolines):
21374 (JSC::JIT::freeCTIMachineTrampolines):
21375 (JSC::JIT::patchGetByIdSelf):
21376 (JSC::JIT::patchPutByIdReplace):
21377 (JSC::JIT::privateCompilePatchGetArrayLength):
21378 (JSC::JIT::emitGetVariableObjectRegister):
21379 (JSC::JIT::emitPutVariableObjectRegister):
21381 (JSC::JIT::compile):
21382 (JSC::JIT::compileGetByIdSelf):
21383 (JSC::JIT::compileGetByIdProto):
21384 (JSC::JIT::compileGetByIdChain):
21385 (JSC::JIT::compilePutByIdReplace):
21386 (JSC::JIT::compilePutByIdTransition):
21387 (JSC::JIT::compileCTIMachineTrampolines):
21388 (JSC::JIT::compilePatchGetArrayLength):
21389 * VM/CodeBlock.cpp:
21390 (JSC::CodeBlock::unlinkCallers):
21392 (JSC::Interpreter::initialize):
21393 (JSC::Interpreter::~Interpreter):
21394 (JSC::Interpreter::execute):
21395 (JSC::Interpreter::tryCTICachePutByID):
21396 (JSC::Interpreter::tryCTICacheGetByID):
21397 (JSC::Interpreter::cti_op_call_JSFunction):
21398 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
21399 (JSC::Interpreter::cti_vm_lazyLinkCall):
21401 * VM/RegisterFile.h:
21403 * runtime/JSArray.h:
21404 * runtime/JSCell.h:
21405 * runtime/JSFunction.h:
21406 * runtime/JSImmediate.h:
21407 * runtime/JSNumberCell.h:
21408 * runtime/JSObject.h:
21409 * runtime/JSString.h:
21410 * runtime/JSVariableObject.h:
21411 * runtime/ScopeChain.h:
21412 * runtime/Structure.h:
21413 * runtime/TypeInfo.h:
21414 * runtime/UString.h:
21416 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21420 Try to fix wx build.
21424 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21426 Reviewed by Sam Weinig.
21428 Nixed X86:: and X86Assembler:: prefixes in a lot of places using typedefs.
21431 (JSC::CTI::emitGetVirtualRegister):
21432 (JSC::CTI::emitGetVirtualRegisters):
21433 (JSC::CTI::emitPutCTIArgFromVirtualRegister):
21434 (JSC::CTI::emitPutCTIArg):
21435 (JSC::CTI::emitGetCTIArg):
21436 (JSC::CTI::emitPutCTIParam):
21437 (JSC::CTI::emitGetCTIParam):
21438 (JSC::CTI::emitPutToCallFrameHeader):
21439 (JSC::CTI::emitGetFromCallFrameHeader):
21440 (JSC::CTI::emitPutVirtualRegister):
21441 (JSC::CTI::emitNakedCall):
21442 (JSC::CTI::emitNakedFastCall):
21443 (JSC::CTI::emitCTICall):
21444 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
21445 (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
21446 (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
21447 (JSC::CTI::emitFastArithDeTagImmediate):
21448 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
21449 (JSC::CTI::emitFastArithReTagImmediate):
21450 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
21451 (JSC::CTI::emitFastArithImmToInt):
21452 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
21453 (JSC::CTI::emitFastArithIntToImmNoCheck):
21454 (JSC::CTI::emitArithIntToImmWithJump):
21455 (JSC::CTI::emitTagAsBoolImmediate):
21456 (JSC::CTI::compileOpCall):
21457 (JSC::CTI::compileOpStrictEq):
21458 (JSC::CTI::emitSlowScriptCheck):
21459 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
21460 (JSC::CTI::compileBinaryArithOp):
21461 (JSC::CTI::compileBinaryArithOpSlowCase):
21462 (JSC::CTI::privateCompileMainPass):
21463 (JSC::CTI::privateCompileSlowCases):
21464 (JSC::CTI::privateCompile):
21465 (JSC::CTI::privateCompileGetByIdSelf):
21466 (JSC::CTI::privateCompileGetByIdProto):
21467 (JSC::CTI::privateCompileGetByIdChain):
21468 (JSC::CTI::privateCompilePutByIdReplace):
21469 (JSC::CTI::privateCompilePutByIdTransition):
21470 (JSC::CTI::privateCompileCTIMachineTrampolines):
21471 (JSC::CTI::privateCompilePatchGetArrayLength):
21472 (JSC::CTI::emitGetVariableObjectRegister):
21473 (JSC::CTI::emitPutVariableObjectRegister):
21475 (JSC::CallRecord::CallRecord):
21476 (JSC::JmpTable::JmpTable):
21477 (JSC::SlowCaseEntry::SlowCaseEntry):
21478 (JSC::CTI::JSRInfo::JSRInfo):
21481 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21485 Try to fix Qt build.
21487 * JavaScriptCore.pri:
21489 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21491 Reviewed by Sam Weinig.
21493 Renamed OBJECT_OFFSET => FIELD_OFFSET
21495 Nixed use of OBJECT_OFFSET outside of CTI.cpp by making CTI a friend in
21499 (JSC::CTI::compileOpCallInitializeCallFrame):
21500 (JSC::CTI::compileOpCall):
21501 (JSC::CTI::emitSlowScriptCheck):
21502 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
21503 (JSC::CTI::compileBinaryArithOp):
21504 (JSC::CTI::privateCompileMainPass):
21505 (JSC::CTI::privateCompileSlowCases):
21506 (JSC::CTI::privateCompile):
21507 (JSC::CTI::privateCompileGetByIdSelf):
21508 (JSC::CTI::privateCompileGetByIdProto):
21509 (JSC::CTI::privateCompileGetByIdChain):
21510 (JSC::CTI::privateCompilePutByIdReplace):
21511 (JSC::CTI::privateCompilePutByIdTransition):
21512 (JSC::CTI::privateCompileCTIMachineTrampolines):
21513 (JSC::CTI::privateCompilePatchGetArrayLength):
21514 (JSC::CTI::emitGetVariableObjectRegister):
21515 (JSC::CTI::emitPutVariableObjectRegister):
21516 * runtime/JSValue.h:
21517 * runtime/JSVariableObject.h:
21519 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21521 Reviewed by Sam Weinig.
21525 X86Assembler::copy => X86Assembler::executableCopy
21526 AssemblerBuffer::copy => AssemblerBuffer::executableCopy
21529 (JSC::CTI::privateCompile):
21530 (JSC::CTI::privateCompileGetByIdSelf):
21531 (JSC::CTI::privateCompileGetByIdProto):
21532 (JSC::CTI::privateCompileGetByIdChain):
21533 (JSC::CTI::privateCompilePutByIdReplace):
21534 (JSC::CTI::privateCompilePutByIdTransition):
21535 (JSC::CTI::privateCompileCTIMachineTrampolines):
21536 (JSC::CTI::privateCompilePatchGetArrayLength):
21537 * masm/X86Assembler.h:
21538 (JSC::AssemblerBuffer::executableCopy):
21539 (JSC::X86Assembler::executableCopy):
21541 (JSC::WREC::compileRegExp):
21543 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21545 Reviewed by Sam Weinig.
21547 Renamed WREC => JSC::WREC, removing JSC:: prefix in a lot of places.
21548 Renamed WRECFunction => WREC::CompiledRegExp, and deployed this type
21549 name in place of a few casts.
21551 * runtime/RegExp.cpp:
21552 (JSC::RegExp::RegExp):
21553 (JSC::RegExp::~RegExp):
21554 (JSC::RegExp::match):
21555 * runtime/RegExp.h:
21556 * wrec/CharacterClassConstructor.cpp:
21557 * wrec/CharacterClassConstructor.h:
21559 (JSC::WREC::compileRegExp):
21561 (JSC::WREC::Generator::Generator):
21562 (JSC::WREC::Parser::Parser):
21563 (JSC::WREC::Parser::parseAlternative):
21565 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21567 Reviewed by Sam Weinig.
21569 Renamed BytecodeInterpreter => Interpreter.
21571 * JavaScriptCore.exp:
21574 (JSC::CTI::compileOpCall):
21575 (JSC::CTI::emitSlowScriptCheck):
21576 (JSC::CTI::compileBinaryArithOpSlowCase):
21577 (JSC::CTI::privateCompileMainPass):
21578 (JSC::CTI::privateCompileSlowCases):
21579 (JSC::CTI::privateCompile):
21580 (JSC::CTI::privateCompileGetByIdSelf):
21581 (JSC::CTI::privateCompileGetByIdProto):
21582 (JSC::CTI::privateCompileGetByIdChain):
21583 (JSC::CTI::privateCompilePutByIdReplace):
21584 (JSC::CTI::privateCompilePutByIdTransition):
21585 (JSC::CTI::privateCompileCTIMachineTrampolines):
21586 (JSC::CTI::freeCTIMachineTrampolines):
21587 (JSC::CTI::patchGetByIdSelf):
21588 (JSC::CTI::patchPutByIdReplace):
21589 (JSC::CTI::privateCompilePatchGetArrayLength):
21591 * VM/CodeBlock.cpp:
21592 (JSC::CodeBlock::printStructures):
21593 (JSC::CodeBlock::derefStructures):
21594 (JSC::CodeBlock::refStructures):
21598 (JSC::Interpreter::resolve):
21599 (JSC::Interpreter::resolveSkip):
21600 (JSC::Interpreter::resolveGlobal):
21601 (JSC::Interpreter::resolveBase):
21602 (JSC::Interpreter::resolveBaseAndProperty):
21603 (JSC::Interpreter::resolveBaseAndFunc):
21604 (JSC::Interpreter::slideRegisterWindowForCall):
21605 (JSC::Interpreter::callEval):
21606 (JSC::Interpreter::Interpreter):
21607 (JSC::Interpreter::initialize):
21608 (JSC::Interpreter::~Interpreter):
21609 (JSC::Interpreter::dumpCallFrame):
21610 (JSC::Interpreter::dumpRegisters):
21611 (JSC::Interpreter::isOpcode):
21612 (JSC::Interpreter::unwindCallFrame):
21613 (JSC::Interpreter::throwException):
21614 (JSC::Interpreter::execute):
21615 (JSC::Interpreter::debug):
21616 (JSC::Interpreter::resetTimeoutCheck):
21617 (JSC::Interpreter::checkTimeout):
21618 (JSC::Interpreter::createExceptionScope):
21619 (JSC::Interpreter::tryCachePutByID):
21620 (JSC::Interpreter::uncachePutByID):
21621 (JSC::Interpreter::tryCacheGetByID):
21622 (JSC::Interpreter::uncacheGetByID):
21623 (JSC::Interpreter::privateExecute):
21624 (JSC::Interpreter::retrieveArguments):
21625 (JSC::Interpreter::retrieveCaller):
21626 (JSC::Interpreter::retrieveLastCaller):
21627 (JSC::Interpreter::findFunctionCallFrame):
21628 (JSC::Interpreter::tryCTICachePutByID):
21629 (JSC::Interpreter::tryCTICacheGetByID):
21630 (JSC::Interpreter::cti_op_convert_this):
21631 (JSC::Interpreter::cti_op_end):
21632 (JSC::Interpreter::cti_op_add):
21633 (JSC::Interpreter::cti_op_pre_inc):
21634 (JSC::Interpreter::cti_timeout_check):
21635 (JSC::Interpreter::cti_register_file_check):
21636 (JSC::Interpreter::cti_op_loop_if_less):
21637 (JSC::Interpreter::cti_op_loop_if_lesseq):
21638 (JSC::Interpreter::cti_op_new_object):
21639 (JSC::Interpreter::cti_op_put_by_id):
21640 (JSC::Interpreter::cti_op_put_by_id_second):
21641 (JSC::Interpreter::cti_op_put_by_id_generic):
21642 (JSC::Interpreter::cti_op_put_by_id_fail):
21643 (JSC::Interpreter::cti_op_get_by_id):
21644 (JSC::Interpreter::cti_op_get_by_id_second):
21645 (JSC::Interpreter::cti_op_get_by_id_generic):
21646 (JSC::Interpreter::cti_op_get_by_id_fail):
21647 (JSC::Interpreter::cti_op_instanceof):
21648 (JSC::Interpreter::cti_op_del_by_id):
21649 (JSC::Interpreter::cti_op_mul):
21650 (JSC::Interpreter::cti_op_new_func):
21651 (JSC::Interpreter::cti_op_call_JSFunction):
21652 (JSC::Interpreter::cti_op_call_arityCheck):
21653 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
21654 (JSC::Interpreter::cti_vm_lazyLinkCall):
21655 (JSC::Interpreter::cti_op_push_activation):
21656 (JSC::Interpreter::cti_op_call_NotJSFunction):
21657 (JSC::Interpreter::cti_op_create_arguments):
21658 (JSC::Interpreter::cti_op_create_arguments_no_params):
21659 (JSC::Interpreter::cti_op_tear_off_activation):
21660 (JSC::Interpreter::cti_op_tear_off_arguments):
21661 (JSC::Interpreter::cti_op_profile_will_call):
21662 (JSC::Interpreter::cti_op_profile_did_call):
21663 (JSC::Interpreter::cti_op_ret_scopeChain):
21664 (JSC::Interpreter::cti_op_new_array):
21665 (JSC::Interpreter::cti_op_resolve):
21666 (JSC::Interpreter::cti_op_construct_JSConstruct):
21667 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
21668 (JSC::Interpreter::cti_op_get_by_val):
21669 (JSC::Interpreter::cti_op_resolve_func):
21670 (JSC::Interpreter::cti_op_sub):
21671 (JSC::Interpreter::cti_op_put_by_val):
21672 (JSC::Interpreter::cti_op_put_by_val_array):
21673 (JSC::Interpreter::cti_op_lesseq):
21674 (JSC::Interpreter::cti_op_loop_if_true):
21675 (JSC::Interpreter::cti_op_negate):
21676 (JSC::Interpreter::cti_op_resolve_base):
21677 (JSC::Interpreter::cti_op_resolve_skip):
21678 (JSC::Interpreter::cti_op_resolve_global):
21679 (JSC::Interpreter::cti_op_div):
21680 (JSC::Interpreter::cti_op_pre_dec):
21681 (JSC::Interpreter::cti_op_jless):
21682 (JSC::Interpreter::cti_op_not):
21683 (JSC::Interpreter::cti_op_jtrue):
21684 (JSC::Interpreter::cti_op_post_inc):
21685 (JSC::Interpreter::cti_op_eq):
21686 (JSC::Interpreter::cti_op_lshift):
21687 (JSC::Interpreter::cti_op_bitand):
21688 (JSC::Interpreter::cti_op_rshift):
21689 (JSC::Interpreter::cti_op_bitnot):
21690 (JSC::Interpreter::cti_op_resolve_with_base):
21691 (JSC::Interpreter::cti_op_new_func_exp):
21692 (JSC::Interpreter::cti_op_mod):
21693 (JSC::Interpreter::cti_op_less):
21694 (JSC::Interpreter::cti_op_neq):
21695 (JSC::Interpreter::cti_op_post_dec):
21696 (JSC::Interpreter::cti_op_urshift):
21697 (JSC::Interpreter::cti_op_bitxor):
21698 (JSC::Interpreter::cti_op_new_regexp):
21699 (JSC::Interpreter::cti_op_bitor):
21700 (JSC::Interpreter::cti_op_call_eval):
21701 (JSC::Interpreter::cti_op_throw):
21702 (JSC::Interpreter::cti_op_get_pnames):
21703 (JSC::Interpreter::cti_op_next_pname):
21704 (JSC::Interpreter::cti_op_push_scope):
21705 (JSC::Interpreter::cti_op_pop_scope):
21706 (JSC::Interpreter::cti_op_typeof):
21707 (JSC::Interpreter::cti_op_is_undefined):
21708 (JSC::Interpreter::cti_op_is_boolean):
21709 (JSC::Interpreter::cti_op_is_number):
21710 (JSC::Interpreter::cti_op_is_string):
21711 (JSC::Interpreter::cti_op_is_object):
21712 (JSC::Interpreter::cti_op_is_function):
21713 (JSC::Interpreter::cti_op_stricteq):
21714 (JSC::Interpreter::cti_op_nstricteq):
21715 (JSC::Interpreter::cti_op_to_jsnumber):
21716 (JSC::Interpreter::cti_op_in):
21717 (JSC::Interpreter::cti_op_push_new_scope):
21718 (JSC::Interpreter::cti_op_jmp_scopes):
21719 (JSC::Interpreter::cti_op_put_by_index):
21720 (JSC::Interpreter::cti_op_switch_imm):
21721 (JSC::Interpreter::cti_op_switch_char):
21722 (JSC::Interpreter::cti_op_switch_string):
21723 (JSC::Interpreter::cti_op_del_by_val):
21724 (JSC::Interpreter::cti_op_put_getter):
21725 (JSC::Interpreter::cti_op_put_setter):
21726 (JSC::Interpreter::cti_op_new_error):
21727 (JSC::Interpreter::cti_op_debug):
21728 (JSC::Interpreter::cti_vm_throw):
21731 * VM/SamplingTool.h:
21732 (JSC::SamplingTool::SamplingTool):
21733 * bytecompiler/CodeGenerator.cpp:
21734 (JSC::BytecodeGenerator::generate):
21735 (JSC::BytecodeGenerator::BytecodeGenerator):
21738 * runtime/ExecState.h:
21739 (JSC::ExecState::interpreter):
21740 * runtime/JSCell.h:
21741 * runtime/JSFunction.h:
21742 * runtime/JSGlobalData.cpp:
21743 (JSC::JSGlobalData::JSGlobalData):
21744 * runtime/JSGlobalData.h:
21745 * runtime/JSString.h:
21747 (WREC::compileRegExp):
21750 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21752 Roll out r38461 (my last patch) because it broke the world.
21754 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21756 Reviewed by Sam Weinig.
21758 A few more renames:
21760 BytecodeInterpreter => Interpreter
21761 WREC => JSC::WREC, removing JSC:: prefix in a lot of places
21762 X86Assembler::copy => X86Assembler::executableCopy
21763 AssemblerBuffer::copy => AssemblerBuffer::executableCopy
21764 WRECFunction => WREC::RegExpFunction
21765 OBJECT_OFFSET => FIELD_OFFSET
21769 Nixed use of OBJECT_OFFSET outside of CTI.cpp by making CTI a friend in more places.
21770 Nixed X86:: and X86Assembler:: prefixes in a lot of places using typedefs
21772 * JavaScriptCore.exp:
21775 (JSC::CTI::emitGetVirtualRegister):
21776 (JSC::CTI::emitGetVirtualRegisters):
21777 (JSC::CTI::emitPutCTIArgFromVirtualRegister):
21778 (JSC::CTI::emitPutCTIArg):
21779 (JSC::CTI::emitGetCTIArg):
21780 (JSC::CTI::emitPutCTIParam):
21781 (JSC::CTI::emitGetCTIParam):
21782 (JSC::CTI::emitPutToCallFrameHeader):
21783 (JSC::CTI::emitGetFromCallFrameHeader):
21784 (JSC::CTI::emitPutVirtualRegister):
21785 (JSC::CTI::emitNakedCall):
21786 (JSC::CTI::emitNakedFastCall):
21787 (JSC::CTI::emitCTICall):
21788 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
21789 (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
21790 (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
21791 (JSC::CTI::emitFastArithDeTagImmediate):
21792 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
21793 (JSC::CTI::emitFastArithReTagImmediate):
21794 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
21795 (JSC::CTI::emitFastArithImmToInt):
21796 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
21797 (JSC::CTI::emitFastArithIntToImmNoCheck):
21798 (JSC::CTI::emitArithIntToImmWithJump):
21799 (JSC::CTI::emitTagAsBoolImmediate):
21800 (JSC::CTI::compileOpCallInitializeCallFrame):
21801 (JSC::CTI::compileOpCall):
21802 (JSC::CTI::compileOpStrictEq):
21803 (JSC::CTI::emitSlowScriptCheck):
21804 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
21805 (JSC::CTI::compileBinaryArithOp):
21806 (JSC::CTI::compileBinaryArithOpSlowCase):
21807 (JSC::CTI::privateCompileMainPass):
21808 (JSC::CTI::privateCompileSlowCases):
21809 (JSC::CTI::privateCompile):
21810 (JSC::CTI::privateCompileGetByIdSelf):
21811 (JSC::CTI::privateCompileGetByIdProto):
21812 (JSC::CTI::privateCompileGetByIdChain):
21813 (JSC::CTI::privateCompilePutByIdReplace):
21814 (JSC::CTI::privateCompilePutByIdTransition):
21815 (JSC::CTI::privateCompileCTIMachineTrampolines):
21816 (JSC::CTI::freeCTIMachineTrampolines):
21817 (JSC::CTI::patchGetByIdSelf):
21818 (JSC::CTI::patchPutByIdReplace):
21819 (JSC::CTI::privateCompilePatchGetArrayLength):
21820 (JSC::CTI::emitGetVariableObjectRegister):
21821 (JSC::CTI::emitPutVariableObjectRegister):
21823 (JSC::CallRecord::CallRecord):
21824 (JSC::JmpTable::JmpTable):
21825 (JSC::SlowCaseEntry::SlowCaseEntry):
21826 (JSC::CTI::JSRInfo::JSRInfo):
21827 * VM/CodeBlock.cpp:
21828 (JSC::CodeBlock::printStructures):
21829 (JSC::CodeBlock::derefStructures):
21830 (JSC::CodeBlock::refStructures):
21834 (JSC::Interpreter::resolve):
21835 (JSC::Interpreter::resolveSkip):
21836 (JSC::Interpreter::resolveGlobal):
21837 (JSC::Interpreter::resolveBase):
21838 (JSC::Interpreter::resolveBaseAndProperty):
21839 (JSC::Interpreter::resolveBaseAndFunc):
21840 (JSC::Interpreter::slideRegisterWindowForCall):
21841 (JSC::Interpreter::callEval):
21842 (JSC::Interpreter::Interpreter):
21843 (JSC::Interpreter::initialize):
21844 (JSC::Interpreter::~Interpreter):
21845 (JSC::Interpreter::dumpCallFrame):
21846 (JSC::Interpreter::dumpRegisters):
21847 (JSC::Interpreter::isOpcode):
21848 (JSC::Interpreter::unwindCallFrame):
21849 (JSC::Interpreter::throwException):
21850 (JSC::Interpreter::execute):
21851 (JSC::Interpreter::debug):
21852 (JSC::Interpreter::resetTimeoutCheck):
21853 (JSC::Interpreter::checkTimeout):
21854 (JSC::Interpreter::createExceptionScope):
21855 (JSC::Interpreter::tryCachePutByID):
21856 (JSC::Interpreter::uncachePutByID):
21857 (JSC::Interpreter::tryCacheGetByID):
21858 (JSC::Interpreter::uncacheGetByID):
21859 (JSC::Interpreter::privateExecute):
21860 (JSC::Interpreter::retrieveArguments):
21861 (JSC::Interpreter::retrieveCaller):
21862 (JSC::Interpreter::retrieveLastCaller):
21863 (JSC::Interpreter::findFunctionCallFrame):
21864 (JSC::Interpreter::tryCTICachePutByID):
21865 (JSC::Interpreter::tryCTICacheGetByID):
21867 (JSC::Interpreter::cti_op_convert_this):
21868 (JSC::Interpreter::cti_op_end):
21869 (JSC::Interpreter::cti_op_add):
21870 (JSC::Interpreter::cti_op_pre_inc):
21871 (JSC::Interpreter::cti_timeout_check):
21872 (JSC::Interpreter::cti_register_file_check):
21873 (JSC::Interpreter::cti_op_loop_if_less):
21874 (JSC::Interpreter::cti_op_loop_if_lesseq):
21875 (JSC::Interpreter::cti_op_new_object):
21876 (JSC::Interpreter::cti_op_put_by_id):
21877 (JSC::Interpreter::cti_op_put_by_id_second):
21878 (JSC::Interpreter::cti_op_put_by_id_generic):
21879 (JSC::Interpreter::cti_op_put_by_id_fail):
21880 (JSC::Interpreter::cti_op_get_by_id):
21881 (JSC::Interpreter::cti_op_get_by_id_second):
21882 (JSC::Interpreter::cti_op_get_by_id_generic):
21883 (JSC::Interpreter::cti_op_get_by_id_fail):
21884 (JSC::Interpreter::cti_op_instanceof):
21885 (JSC::Interpreter::cti_op_del_by_id):
21886 (JSC::Interpreter::cti_op_mul):
21887 (JSC::Interpreter::cti_op_new_func):
21888 (JSC::Interpreter::cti_op_call_JSFunction):
21889 (JSC::Interpreter::cti_op_call_arityCheck):
21890 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
21891 (JSC::Interpreter::cti_vm_lazyLinkCall):
21892 (JSC::Interpreter::cti_op_push_activation):
21893 (JSC::Interpreter::cti_op_call_NotJSFunction):
21894 (JSC::Interpreter::cti_op_create_arguments):
21895 (JSC::Interpreter::cti_op_create_arguments_no_params):
21896 (JSC::Interpreter::cti_op_tear_off_activation):
21897 (JSC::Interpreter::cti_op_tear_off_arguments):
21898 (JSC::Interpreter::cti_op_profile_will_call):
21899 (JSC::Interpreter::cti_op_profile_did_call):
21900 (JSC::Interpreter::cti_op_ret_scopeChain):
21901 (JSC::Interpreter::cti_op_new_array):
21902 (JSC::Interpreter::cti_op_resolve):
21903 (JSC::Interpreter::cti_op_construct_JSConstruct):
21904 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
21905 (JSC::Interpreter::cti_op_get_by_val):
21906 (JSC::Interpreter::cti_op_resolve_func):
21907 (JSC::Interpreter::cti_op_sub):
21908 (JSC::Interpreter::cti_op_put_by_val):
21909 (JSC::Interpreter::cti_op_put_by_val_array):
21910 (JSC::Interpreter::cti_op_lesseq):
21911 (JSC::Interpreter::cti_op_loop_if_true):
21912 (JSC::Interpreter::cti_op_negate):
21913 (JSC::Interpreter::cti_op_resolve_base):
21914 (JSC::Interpreter::cti_op_resolve_skip):
21915 (JSC::Interpreter::cti_op_resolve_global):
21916 (JSC::Interpreter::cti_op_div):
21917 (JSC::Interpreter::cti_op_pre_dec):
21918 (JSC::Interpreter::cti_op_jless):
21919 (JSC::Interpreter::cti_op_not):
21920 (JSC::Interpreter::cti_op_jtrue):
21921 (JSC::Interpreter::cti_op_post_inc):
21922 (JSC::Interpreter::cti_op_eq):
21923 (JSC::Interpreter::cti_op_lshift):
21924 (JSC::Interpreter::cti_op_bitand):
21925 (JSC::Interpreter::cti_op_rshift):
21926 (JSC::Interpreter::cti_op_bitnot):
21927 (JSC::Interpreter::cti_op_resolve_with_base):
21928 (JSC::Interpreter::cti_op_new_func_exp):
21929 (JSC::Interpreter::cti_op_mod):
21930 (JSC::Interpreter::cti_op_less):
21931 (JSC::Interpreter::cti_op_neq):
21932 (JSC::Interpreter::cti_op_post_dec):
21933 (JSC::Interpreter::cti_op_urshift):
21934 (JSC::Interpreter::cti_op_bitxor):
21935 (JSC::Interpreter::cti_op_new_regexp):
21936 (JSC::Interpreter::cti_op_bitor):
21937 (JSC::Interpreter::cti_op_call_eval):
21938 (JSC::Interpreter::cti_op_throw):
21939 (JSC::Interpreter::cti_op_get_pnames):
21940 (JSC::Interpreter::cti_op_next_pname):
21941 (JSC::Interpreter::cti_op_push_scope):
21942 (JSC::Interpreter::cti_op_pop_scope):
21943 (JSC::Interpreter::cti_op_typeof):
21944 (JSC::Interpreter::cti_op_is_undefined):
21945 (JSC::Interpreter::cti_op_is_boolean):
21946 (JSC::Interpreter::cti_op_is_number):
21947 (JSC::Interpreter::cti_op_is_string):
21948 (JSC::Interpreter::cti_op_is_object):
21949 (JSC::Interpreter::cti_op_is_function):
21950 (JSC::Interpreter::cti_op_stricteq):
21951 (JSC::Interpreter::cti_op_nstricteq):
21952 (JSC::Interpreter::cti_op_to_jsnumber):
21953 (JSC::Interpreter::cti_op_in):
21954 (JSC::Interpreter::cti_op_push_new_scope):
21955 (JSC::Interpreter::cti_op_jmp_scopes):
21956 (JSC::Interpreter::cti_op_put_by_index):
21957 (JSC::Interpreter::cti_op_switch_imm):
21958 (JSC::Interpreter::cti_op_switch_char):
21959 (JSC::Interpreter::cti_op_switch_string):
21960 (JSC::Interpreter::cti_op_del_by_val):
21961 (JSC::Interpreter::cti_op_put_getter):
21962 (JSC::Interpreter::cti_op_put_setter):
21963 (JSC::Interpreter::cti_op_new_error):
21964 (JSC::Interpreter::cti_op_debug):
21965 (JSC::Interpreter::cti_vm_throw):
21968 * VM/SamplingTool.cpp:
21969 (JSC::SamplingTool::dump):
21970 * VM/SamplingTool.h:
21971 (JSC::SamplingTool::SamplingTool):
21972 * bytecompiler/CodeGenerator.cpp:
21973 (JSC::BytecodeGenerator::generate):
21974 (JSC::BytecodeGenerator::BytecodeGenerator):
21977 * masm/X86Assembler.h:
21978 (JSC::AssemblerBuffer::executableCopy):
21979 (JSC::X86Assembler::executableCopy):
21980 * runtime/ExecState.h:
21981 (JSC::ExecState::interpreter):
21982 * runtime/JSCell.h:
21983 * runtime/JSFunction.h:
21984 * runtime/JSGlobalData.cpp:
21985 (JSC::JSGlobalData::JSGlobalData):
21986 * runtime/JSGlobalData.h:
21987 * runtime/JSImmediate.h:
21988 * runtime/JSString.h:
21989 * runtime/JSValue.h:
21990 * runtime/JSVariableObject.h:
21991 * runtime/RegExp.cpp:
21992 (JSC::RegExp::RegExp):
21993 (JSC::RegExp::~RegExp):
21994 (JSC::RegExp::match):
21995 * runtime/RegExp.h:
21996 * wrec/CharacterClassConstructor.cpp:
21997 * wrec/CharacterClassConstructor.h:
21999 (JSC::WREC::compileRegExp):
22001 (JSC::WREC::Generator::Generator):
22002 (JSC::WREC::Parser::):
22003 (JSC::WREC::Parser::Parser):
22004 (JSC::WREC::Parser::parseAlternative):
22006 2008-11-16 Greg Bolsinga <bolsinga@apple.com>
22008 Reviewed by Darin Adler.
22010 https://bugs.webkit.org/show_bug.cgi?id=21810
22011 Remove use of static C++ objects that are destroyed at exit time (destructors)
22013 Conditionally have the DEFINE_STATIC_LOCAL workaround <rdar://problem/6354696>
22014 (Codegen issue with C++ static reference in gcc build 5465) based upon the compiler
22015 build versions. It will use the:
22016 static T& = *new T;
22017 style for all other compilers.
22019 * wtf/StdLibExtras.h:
22021 2008-11-16 Alexey Proskuryakov <ap@webkit.org>
22023 Reviewed by Dan Bernstein.
22025 https://bugs.webkit.org/show_bug.cgi?id=22290
22026 Remove cross-heap GC and MessagePort multi-threading support
22028 It is broken (and may not be implementable at all), and no longer needed, as we
22029 don't use MessagePorts for communication with workers any more.
22031 * JavaScriptCore.exp:
22032 * runtime/Collector.cpp:
22033 (JSC::Heap::collect):
22034 * runtime/JSGlobalObject.cpp:
22035 * runtime/JSGlobalObject.h:
22036 Remove hooks for cross-heap GC.
22038 2008-11-15 Sam Weinig <sam@webkit.org>
22040 Reviewed by Cameron Zwarich.
22042 Cleanup jsc command line code a little.
22046 (main): Use standard exit status macros
22047 (cleanupGlobalData): Factor out cleanup code into this function.
22048 (printUsageStatement): Use standard exit status macros.
22050 2008-11-15 Sam Weinig <sam@webkit.org>
22052 Reviewed by Cameron Zwarich.
22054 Cleanup BytecodeGenerator constructors.
22056 * bytecompiler/CodeGenerator.cpp:
22057 (JSC::BytecodeGenerator::BytecodeGenerator):
22058 * bytecompiler/CodeGenerator.h:
22059 * parser/Nodes.cpp:
22060 (JSC::ProgramNode::generateBytecode):
22062 2008-11-15 Darin Adler <darin@apple.com>
22064 Rubber stamped by Geoff Garen.
22066 - do the long-planned StructureID -> Structure rename
22068 * API/JSCallbackConstructor.cpp:
22069 (JSC::JSCallbackConstructor::JSCallbackConstructor):
22070 * API/JSCallbackConstructor.h:
22071 (JSC::JSCallbackConstructor::createStructure):
22072 * API/JSCallbackFunction.h:
22073 (JSC::JSCallbackFunction::createStructure):
22074 * API/JSCallbackObject.h:
22075 (JSC::JSCallbackObject::createStructure):
22076 * API/JSCallbackObjectFunctions.h:
22077 (JSC::::JSCallbackObject):
22078 * API/JSValueRef.cpp:
22079 (JSValueIsInstanceOfConstructor):
22081 * JavaScriptCore.exp:
22082 * JavaScriptCore.pri:
22083 * JavaScriptCore.scons:
22084 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
22085 * JavaScriptCore.xcodeproj/project.pbxproj:
22086 * JavaScriptCoreSources.bkl:
22088 (JSC::CTI::compileBinaryArithOp):
22089 (JSC::CTI::privateCompileMainPass):
22090 (JSC::CTI::privateCompileGetByIdSelf):
22091 (JSC::CTI::privateCompileGetByIdProto):
22092 (JSC::CTI::privateCompileGetByIdChain):
22093 (JSC::CTI::privateCompilePutByIdReplace):
22094 (JSC::transitionWillNeedStorageRealloc):
22095 (JSC::CTI::privateCompilePutByIdTransition):
22096 (JSC::CTI::patchGetByIdSelf):
22097 (JSC::CTI::patchPutByIdReplace):
22099 (JSC::CTI::compileGetByIdSelf):
22100 (JSC::CTI::compileGetByIdProto):
22101 (JSC::CTI::compileGetByIdChain):
22102 (JSC::CTI::compilePutByIdReplace):
22103 (JSC::CTI::compilePutByIdTransition):
22104 * VM/CodeBlock.cpp:
22105 (JSC::CodeBlock::printStructure):
22106 (JSC::CodeBlock::printStructures):
22107 (JSC::CodeBlock::dump):
22108 (JSC::CodeBlock::~CodeBlock):
22109 (JSC::CodeBlock::derefStructures):
22110 (JSC::CodeBlock::refStructures):
22112 * VM/Instruction.h:
22113 (JSC::Instruction::Instruction):
22114 (JSC::Instruction::):
22116 (JSC::jsTypeStringForValue):
22117 (JSC::jsIsObjectType):
22118 (JSC::BytecodeInterpreter::resolveGlobal):
22119 (JSC::BytecodeInterpreter::BytecodeInterpreter):
22120 (JSC::cachePrototypeChain):
22121 (JSC::BytecodeInterpreter::tryCachePutByID):
22122 (JSC::BytecodeInterpreter::uncachePutByID):
22123 (JSC::BytecodeInterpreter::tryCacheGetByID):
22124 (JSC::BytecodeInterpreter::uncacheGetByID):
22125 (JSC::BytecodeInterpreter::privateExecute):
22126 (JSC::BytecodeInterpreter::tryCTICachePutByID):
22127 (JSC::BytecodeInterpreter::tryCTICacheGetByID):
22128 (JSC::BytecodeInterpreter::cti_op_instanceof):
22129 (JSC::BytecodeInterpreter::cti_op_construct_JSConstruct):
22130 (JSC::BytecodeInterpreter::cti_op_resolve_global):
22131 (JSC::BytecodeInterpreter::cti_op_is_undefined):
22132 * runtime/Arguments.h:
22133 (JSC::Arguments::createStructure):
22134 * runtime/ArrayConstructor.cpp:
22135 (JSC::ArrayConstructor::ArrayConstructor):
22136 * runtime/ArrayConstructor.h:
22137 * runtime/ArrayPrototype.cpp:
22138 (JSC::ArrayPrototype::ArrayPrototype):
22139 * runtime/ArrayPrototype.h:
22140 * runtime/BatchedTransitionOptimizer.h:
22141 (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
22142 (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):
22143 * runtime/BooleanConstructor.cpp:
22144 (JSC::BooleanConstructor::BooleanConstructor):
22145 * runtime/BooleanConstructor.h:
22146 * runtime/BooleanObject.cpp:
22147 (JSC::BooleanObject::BooleanObject):
22148 * runtime/BooleanObject.h:
22149 * runtime/BooleanPrototype.cpp:
22150 (JSC::BooleanPrototype::BooleanPrototype):
22151 * runtime/BooleanPrototype.h:
22152 * runtime/DateConstructor.cpp:
22153 (JSC::DateConstructor::DateConstructor):
22154 * runtime/DateConstructor.h:
22155 * runtime/DateInstance.cpp:
22156 (JSC::DateInstance::DateInstance):
22157 * runtime/DateInstance.h:
22158 * runtime/DatePrototype.cpp:
22159 (JSC::DatePrototype::DatePrototype):
22160 * runtime/DatePrototype.h:
22161 (JSC::DatePrototype::createStructure):
22162 * runtime/ErrorConstructor.cpp:
22163 (JSC::ErrorConstructor::ErrorConstructor):
22164 * runtime/ErrorConstructor.h:
22165 * runtime/ErrorInstance.cpp:
22166 (JSC::ErrorInstance::ErrorInstance):
22167 * runtime/ErrorInstance.h:
22168 * runtime/ErrorPrototype.cpp:
22169 (JSC::ErrorPrototype::ErrorPrototype):
22170 * runtime/ErrorPrototype.h:
22171 * runtime/FunctionConstructor.cpp:
22172 (JSC::FunctionConstructor::FunctionConstructor):
22173 * runtime/FunctionConstructor.h:
22174 * runtime/FunctionPrototype.cpp:
22175 (JSC::FunctionPrototype::FunctionPrototype):
22176 (JSC::FunctionPrototype::addFunctionProperties):
22177 * runtime/FunctionPrototype.h:
22178 (JSC::FunctionPrototype::createStructure):
22179 * runtime/GlobalEvalFunction.cpp:
22180 (JSC::GlobalEvalFunction::GlobalEvalFunction):
22181 * runtime/GlobalEvalFunction.h:
22182 * runtime/Identifier.h:
22183 * runtime/InternalFunction.cpp:
22184 (JSC::InternalFunction::InternalFunction):
22185 * runtime/InternalFunction.h:
22186 (JSC::InternalFunction::createStructure):
22187 (JSC::InternalFunction::InternalFunction):
22188 * runtime/JSActivation.cpp:
22189 (JSC::JSActivation::JSActivation):
22190 * runtime/JSActivation.h:
22191 (JSC::JSActivation::createStructure):
22192 * runtime/JSArray.cpp:
22193 (JSC::JSArray::JSArray):
22194 * runtime/JSArray.h:
22195 (JSC::JSArray::createStructure):
22196 * runtime/JSCell.h:
22197 (JSC::JSCell::JSCell):
22198 (JSC::JSCell::isObject):
22199 (JSC::JSCell::isString):
22200 (JSC::JSCell::structure):
22201 (JSC::JSValue::needsThisConversion):
22202 * runtime/JSFunction.cpp:
22203 (JSC::JSFunction::construct):
22204 * runtime/JSFunction.h:
22205 (JSC::JSFunction::JSFunction):
22206 (JSC::JSFunction::createStructure):
22207 * runtime/JSGlobalData.cpp:
22208 (JSC::JSGlobalData::JSGlobalData):
22209 (JSC::JSGlobalData::createLeaked):
22210 * runtime/JSGlobalData.h:
22211 * runtime/JSGlobalObject.cpp:
22212 (JSC::markIfNeeded):
22213 (JSC::JSGlobalObject::reset):
22214 * runtime/JSGlobalObject.h:
22215 (JSC::JSGlobalObject::JSGlobalObject):
22216 (JSC::JSGlobalObject::argumentsStructure):
22217 (JSC::JSGlobalObject::arrayStructure):
22218 (JSC::JSGlobalObject::booleanObjectStructure):
22219 (JSC::JSGlobalObject::callbackConstructorStructure):
22220 (JSC::JSGlobalObject::callbackFunctionStructure):
22221 (JSC::JSGlobalObject::callbackObjectStructure):
22222 (JSC::JSGlobalObject::dateStructure):
22223 (JSC::JSGlobalObject::emptyObjectStructure):
22224 (JSC::JSGlobalObject::errorStructure):
22225 (JSC::JSGlobalObject::functionStructure):
22226 (JSC::JSGlobalObject::numberObjectStructure):
22227 (JSC::JSGlobalObject::prototypeFunctionStructure):
22228 (JSC::JSGlobalObject::regExpMatchesArrayStructure):
22229 (JSC::JSGlobalObject::regExpStructure):
22230 (JSC::JSGlobalObject::stringObjectStructure):
22231 (JSC::JSGlobalObject::createStructure):
22232 (JSC::Structure::prototypeForLookup):
22233 * runtime/JSNotAnObject.h:
22234 (JSC::JSNotAnObject::createStructure):
22235 * runtime/JSNumberCell.h:
22236 (JSC::JSNumberCell::createStructure):
22237 (JSC::JSNumberCell::JSNumberCell):
22238 * runtime/JSObject.cpp:
22239 (JSC::JSObject::mark):
22240 (JSC::JSObject::put):
22241 (JSC::JSObject::deleteProperty):
22242 (JSC::JSObject::defineGetter):
22243 (JSC::JSObject::defineSetter):
22244 (JSC::JSObject::getPropertyAttributes):
22245 (JSC::JSObject::getPropertyNames):
22246 (JSC::JSObject::removeDirect):
22247 (JSC::JSObject::createInheritorID):
22248 * runtime/JSObject.h:
22249 (JSC::JSObject::getDirect):
22250 (JSC::JSObject::getDirectLocation):
22251 (JSC::JSObject::hasCustomProperties):
22252 (JSC::JSObject::hasGetterSetterProperties):
22253 (JSC::JSObject::createStructure):
22254 (JSC::JSObject::JSObject):
22255 (JSC::JSObject::~JSObject):
22256 (JSC::JSObject::prototype):
22257 (JSC::JSObject::setPrototype):
22258 (JSC::JSObject::setStructure):
22259 (JSC::JSObject::inheritorID):
22260 (JSC::JSObject::inlineGetOwnPropertySlot):
22261 (JSC::JSObject::getOwnPropertySlotForWrite):
22262 (JSC::JSCell::fastGetOwnPropertySlot):
22263 (JSC::JSObject::putDirect):
22264 (JSC::JSObject::putDirectWithoutTransition):
22265 (JSC::JSObject::transitionTo):
22266 * runtime/JSPropertyNameIterator.h:
22267 (JSC::JSPropertyNameIterator::next):
22268 * runtime/JSStaticScopeObject.h:
22269 (JSC::JSStaticScopeObject::JSStaticScopeObject):
22270 (JSC::JSStaticScopeObject::createStructure):
22271 * runtime/JSString.h:
22272 (JSC::JSString::JSString):
22273 (JSC::JSString::createStructure):
22274 * runtime/JSVariableObject.h:
22275 (JSC::JSVariableObject::JSVariableObject):
22276 * runtime/JSWrapperObject.h:
22277 (JSC::JSWrapperObject::JSWrapperObject):
22278 * runtime/MathObject.cpp:
22279 (JSC::MathObject::MathObject):
22280 * runtime/MathObject.h:
22281 (JSC::MathObject::createStructure):
22282 * runtime/NativeErrorConstructor.cpp:
22283 (JSC::NativeErrorConstructor::NativeErrorConstructor):
22284 * runtime/NativeErrorConstructor.h:
22285 * runtime/NativeErrorPrototype.cpp:
22286 (JSC::NativeErrorPrototype::NativeErrorPrototype):
22287 * runtime/NativeErrorPrototype.h:
22288 * runtime/NumberConstructor.cpp:
22289 (JSC::NumberConstructor::NumberConstructor):
22290 * runtime/NumberConstructor.h:
22291 (JSC::NumberConstructor::createStructure):
22292 * runtime/NumberObject.cpp:
22293 (JSC::NumberObject::NumberObject):
22294 * runtime/NumberObject.h:
22295 * runtime/NumberPrototype.cpp:
22296 (JSC::NumberPrototype::NumberPrototype):
22297 * runtime/NumberPrototype.h:
22298 * runtime/ObjectConstructor.cpp:
22299 (JSC::ObjectConstructor::ObjectConstructor):
22300 * runtime/ObjectConstructor.h:
22301 * runtime/ObjectPrototype.cpp:
22302 (JSC::ObjectPrototype::ObjectPrototype):
22303 * runtime/ObjectPrototype.h:
22304 * runtime/Operations.h:
22305 (JSC::equalSlowCaseInline):
22306 * runtime/PropertyNameArray.h:
22307 (JSC::PropertyNameArrayData::setCachedStructure):
22308 (JSC::PropertyNameArrayData::cachedStructure):
22309 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
22310 (JSC::PropertyNameArrayData::cachedPrototypeChain):
22311 (JSC::PropertyNameArrayData::PropertyNameArrayData):
22312 * runtime/PrototypeFunction.cpp:
22313 (JSC::PrototypeFunction::PrototypeFunction):
22314 * runtime/PrototypeFunction.h:
22315 * runtime/RegExpConstructor.cpp:
22316 (JSC::RegExpConstructor::RegExpConstructor):
22317 * runtime/RegExpConstructor.h:
22318 (JSC::RegExpConstructor::createStructure):
22319 * runtime/RegExpObject.cpp:
22320 (JSC::RegExpObject::RegExpObject):
22321 * runtime/RegExpObject.h:
22322 (JSC::RegExpObject::createStructure):
22323 * runtime/RegExpPrototype.cpp:
22324 (JSC::RegExpPrototype::RegExpPrototype):
22325 * runtime/RegExpPrototype.h:
22326 * runtime/StringConstructor.cpp:
22327 (JSC::StringConstructor::StringConstructor):
22328 * runtime/StringConstructor.h:
22329 * runtime/StringObject.cpp:
22330 (JSC::StringObject::StringObject):
22331 * runtime/StringObject.h:
22332 (JSC::StringObject::createStructure):
22333 * runtime/StringObjectThatMasqueradesAsUndefined.h:
22334 (JSC::StringObjectThatMasqueradesAsUndefined::create):
22335 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
22336 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
22337 * runtime/StringPrototype.cpp:
22338 (JSC::StringPrototype::StringPrototype):
22339 * runtime/StringPrototype.h:
22340 * runtime/Structure.cpp: Copied from JavaScriptCore/runtime/StructureID.cpp.
22341 (JSC::Structure::dumpStatistics):
22342 (JSC::Structure::Structure):
22343 (JSC::Structure::~Structure):
22344 (JSC::Structure::startIgnoringLeaks):
22345 (JSC::Structure::stopIgnoringLeaks):
22346 (JSC::Structure::materializePropertyMap):
22347 (JSC::Structure::getEnumerablePropertyNames):
22348 (JSC::Structure::clearEnumerationCache):
22349 (JSC::Structure::growPropertyStorageCapacity):
22350 (JSC::Structure::addPropertyTransitionToExistingStructure):
22351 (JSC::Structure::addPropertyTransition):
22352 (JSC::Structure::removePropertyTransition):
22353 (JSC::Structure::changePrototypeTransition):
22354 (JSC::Structure::getterSetterTransition):
22355 (JSC::Structure::toDictionaryTransition):
22356 (JSC::Structure::fromDictionaryTransition):
22357 (JSC::Structure::addPropertyWithoutTransition):
22358 (JSC::Structure::removePropertyWithoutTransition):
22359 (JSC::Structure::createCachedPrototypeChain):
22360 (JSC::Structure::checkConsistency):
22361 (JSC::Structure::copyPropertyTable):
22362 (JSC::Structure::get):
22363 (JSC::Structure::put):
22364 (JSC::Structure::remove):
22365 (JSC::Structure::insertIntoPropertyMapHashTable):
22366 (JSC::Structure::createPropertyMapHashTable):
22367 (JSC::Structure::expandPropertyMapHashTable):
22368 (JSC::Structure::rehashPropertyMapHashTable):
22369 (JSC::Structure::getEnumerablePropertyNamesInternal):
22370 * runtime/Structure.h: Copied from JavaScriptCore/runtime/StructureID.h.
22371 (JSC::Structure::create):
22372 (JSC::Structure::previousID):
22373 (JSC::Structure::setCachedPrototypeChain):
22374 (JSC::Structure::cachedPrototypeChain):
22375 (JSC::Structure::):
22376 (JSC::Structure::get):
22377 * runtime/StructureChain.cpp: Copied from JavaScriptCore/runtime/StructureIDChain.cpp.
22378 (JSC::StructureChain::StructureChain):
22379 (JSC::structureChainsAreEqual):
22380 * runtime/StructureChain.h: Copied from JavaScriptCore/runtime/StructureIDChain.h.
22381 (JSC::StructureChain::create):
22382 (JSC::StructureChain::head):
22383 * runtime/StructureID.cpp: Removed.
22384 * runtime/StructureID.h: Removed.
22385 * runtime/StructureIDChain.cpp: Removed.
22386 * runtime/StructureIDChain.h: Removed.
22387 * runtime/StructureIDTransitionTable.h: Removed.
22388 * runtime/StructureTransitionTable.h: Copied from JavaScriptCore/runtime/StructureIDTransitionTable.h.
22390 2008-11-15 Darin Adler <darin@apple.com>
22392 - fix non-WREC build
22394 * runtime/RegExp.cpp: Put "using namespace WREC" inside #if ENABLE(WREC).
22396 2008-11-15 Kevin Ollivier <kevino@theolliviers.com>
22398 Reviewed by Timothy Hatcher.
22400 As ThreadingNone doesn't implement threads, isMainThread should return true,
22403 https://bugs.webkit.org/show_bug.cgi?id=22285
22405 * wtf/ThreadingNone.cpp:
22406 (WTF::isMainThread):
22408 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22410 Reviewed by Sam Weinig.
22412 Moved all WREC-related code into WREC.cpp and put it in a WREC namespace.
22413 Removed the WREC prefix from class names.
22418 (JSC::BytecodeInterpreter::assemblerBuffer):
22419 * masm/X86Assembler.h:
22420 * runtime/RegExp.cpp:
22421 (JSC::RegExp::RegExp):
22422 * wrec/CharacterClassConstructor.cpp:
22423 * wrec/CharacterClassConstructor.h:
22425 (WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
22426 (WREC::GeneratePatternCharacterFunctor::generateAtom):
22427 (WREC::GeneratePatternCharacterFunctor::backtrack):
22428 (WREC::GenerateCharacterClassFunctor::generateAtom):
22429 (WREC::GenerateCharacterClassFunctor::backtrack):
22430 (WREC::GenerateBackreferenceFunctor::generateAtom):
22431 (WREC::GenerateBackreferenceFunctor::backtrack):
22432 (WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
22433 (WREC::GenerateParenthesesNonGreedyFunctor::backtrack):
22434 (WREC::Generator::generateBacktrack1):
22435 (WREC::Generator::generateBacktrackBackreference):
22436 (WREC::Generator::generateBackreferenceQuantifier):
22437 (WREC::Generator::generateNonGreedyQuantifier):
22438 (WREC::Generator::generateGreedyQuantifier):
22439 (WREC::Generator::generatePatternCharacter):
22440 (WREC::Generator::generateCharacterClassInvertedRange):
22441 (WREC::Generator::generateCharacterClassInverted):
22442 (WREC::Generator::generateCharacterClass):
22443 (WREC::Generator::generateParentheses):
22444 (WREC::Generator::generateParenthesesNonGreedy):
22445 (WREC::Generator::generateParenthesesResetTrampoline):
22446 (WREC::Generator::generateAssertionBOL):
22447 (WREC::Generator::generateAssertionEOL):
22448 (WREC::Generator::generateAssertionWordBoundary):
22449 (WREC::Generator::generateBackreference):
22450 (WREC::Generator::generateDisjunction):
22451 (WREC::Generator::terminateDisjunction):
22452 (WREC::Parser::parseGreedyQuantifier):
22453 (WREC::Parser::parseQuantifier):
22454 (WREC::Parser::parsePatternCharacterQualifier):
22455 (WREC::Parser::parseCharacterClassQuantifier):
22456 (WREC::Parser::parseBackreferenceQuantifier):
22457 (WREC::Parser::parseParentheses):
22458 (WREC::Parser::parseCharacterClass):
22459 (WREC::Parser::parseOctalEscape):
22460 (WREC::Parser::parseEscape):
22461 (WREC::Parser::parseTerm):
22462 (WREC::Parser::parseDisjunction):
22463 (WREC::compileRegExp):
22465 (WREC::Generator::Generator):
22466 (WREC::Parser::Parser):
22467 (WREC::Parser::parseAlternative):
22469 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22471 Reviewed by Sam Weinig.
22473 Changed another case of "m_jit" to "m_assembler".
22478 (JSC::WRECGenerator::WRECGenerator):
22479 (JSC::WRECParser::WRECParser):
22481 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22483 Reviewed by Sam Weinig.
22485 Renamed "jit" to "assembler" and, for brevity, replaced *jit.* with __
22489 (JSC::CTI::emitGetVirtualRegister):
22490 (JSC::CTI::emitPutCTIArgFromVirtualRegister):
22491 (JSC::CTI::emitPutCTIArg):
22492 (JSC::CTI::emitGetCTIArg):
22493 (JSC::CTI::emitPutCTIArgConstant):
22494 (JSC::CTI::emitPutCTIParam):
22495 (JSC::CTI::emitGetCTIParam):
22496 (JSC::CTI::emitPutToCallFrameHeader):
22497 (JSC::CTI::emitGetFromCallFrameHeader):
22498 (JSC::CTI::emitPutVirtualRegister):
22499 (JSC::CTI::emitInitRegister):
22500 (JSC::CTI::emitAllocateNumber):
22501 (JSC::CTI::emitNakedCall):
22502 (JSC::CTI::emitNakedFastCall):
22503 (JSC::CTI::emitCTICall):
22504 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
22505 (JSC::CTI::linkSlowCaseIfNotJSCell):
22506 (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
22507 (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
22508 (JSC::CTI::emitFastArithDeTagImmediate):
22509 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
22510 (JSC::CTI::emitFastArithReTagImmediate):
22511 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
22512 (JSC::CTI::emitFastArithImmToInt):
22513 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
22514 (JSC::CTI::emitFastArithIntToImmNoCheck):
22515 (JSC::CTI::emitArithIntToImmWithJump):
22516 (JSC::CTI::emitTagAsBoolImmediate):
22518 (JSC::CTI::compileOpCallInitializeCallFrame):
22519 (JSC::CTI::compileOpCall):
22520 (JSC::CTI::compileOpStrictEq):
22521 (JSC::CTI::emitSlowScriptCheck):
22522 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
22523 (JSC::CTI::compileBinaryArithOp):
22524 (JSC::CTI::compileBinaryArithOpSlowCase):
22525 (JSC::CTI::privateCompileMainPass):
22526 (JSC::CTI::privateCompileLinkPass):
22527 (JSC::CTI::privateCompileSlowCases):
22528 (JSC::CTI::privateCompile):
22529 (JSC::CTI::privateCompileGetByIdSelf):
22530 (JSC::CTI::privateCompileGetByIdProto):
22531 (JSC::CTI::privateCompileGetByIdChain):
22532 (JSC::CTI::privateCompilePutByIdReplace):
22533 (JSC::CTI::privateCompilePutByIdTransition):
22534 (JSC::CTI::privateCompileCTIMachineTrampolines):
22535 (JSC::CTI::privateCompilePatchGetArrayLength):
22536 (JSC::CTI::emitGetVariableObjectRegister):
22537 (JSC::CTI::emitPutVariableObjectRegister):
22538 (JSC::CTI::compileRegExp):
22541 (JSC::WRECGenerator::generateBacktrack1):
22542 (JSC::WRECGenerator::generateBacktrackBackreference):
22543 (JSC::WRECGenerator::generateBackreferenceQuantifier):
22544 (JSC::WRECGenerator::generateNonGreedyQuantifier):
22545 (JSC::WRECGenerator::generateGreedyQuantifier):
22546 (JSC::WRECGenerator::generatePatternCharacter):
22547 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
22548 (JSC::WRECGenerator::generateCharacterClassInverted):
22549 (JSC::WRECGenerator::generateCharacterClass):
22550 (JSC::WRECGenerator::generateParentheses):
22551 (JSC::WRECGenerator::generateParenthesesNonGreedy):
22552 (JSC::WRECGenerator::generateParenthesesResetTrampoline):
22553 (JSC::WRECGenerator::generateAssertionBOL):
22554 (JSC::WRECGenerator::generateAssertionEOL):
22555 (JSC::WRECGenerator::generateAssertionWordBoundary):
22556 (JSC::WRECGenerator::generateBackreference):
22557 (JSC::WRECGenerator::generateDisjunction):
22558 (JSC::WRECGenerator::terminateDisjunction):
22560 2008-11-15 Sam Weinig <sam@webkit.org>
22562 Reviewed by Geoffrey Garen.
22564 Remove dead method declaration.
22566 * bytecompiler/CodeGenerator.h:
22568 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22570 Reviewed by Sam Weinig.
22572 Renamed LabelID to Label, Label::isForwardLabel to Label::isForward.
22575 (JSC::Label::Label):
22576 (JSC::Label::isForward):
22577 * bytecompiler/CodeGenerator.cpp:
22578 (JSC::BytecodeGenerator::newLabel):
22579 (JSC::BytecodeGenerator::emitLabel):
22580 (JSC::BytecodeGenerator::emitJump):
22581 (JSC::BytecodeGenerator::emitJumpIfTrue):
22582 (JSC::BytecodeGenerator::emitJumpIfFalse):
22583 (JSC::BytecodeGenerator::pushFinallyContext):
22584 (JSC::BytecodeGenerator::emitComplexJumpScopes):
22585 (JSC::BytecodeGenerator::emitJumpScopes):
22586 (JSC::BytecodeGenerator::emitNextPropertyName):
22587 (JSC::BytecodeGenerator::emitCatch):
22588 (JSC::BytecodeGenerator::emitJumpSubroutine):
22589 (JSC::prepareJumpTableForImmediateSwitch):
22590 (JSC::prepareJumpTableForCharacterSwitch):
22591 (JSC::prepareJumpTableForStringSwitch):
22592 (JSC::BytecodeGenerator::endSwitch):
22593 * bytecompiler/CodeGenerator.h:
22594 * bytecompiler/LabelScope.h:
22595 (JSC::LabelScope::LabelScope):
22596 (JSC::LabelScope::breakTarget):
22597 (JSC::LabelScope::continueTarget):
22598 * parser/Nodes.cpp:
22599 (JSC::LogicalOpNode::emitBytecode):
22600 (JSC::ConditionalNode::emitBytecode):
22601 (JSC::IfNode::emitBytecode):
22602 (JSC::IfElseNode::emitBytecode):
22603 (JSC::DoWhileNode::emitBytecode):
22604 (JSC::WhileNode::emitBytecode):
22605 (JSC::ForNode::emitBytecode):
22606 (JSC::ForInNode::emitBytecode):
22607 (JSC::ReturnNode::emitBytecode):
22608 (JSC::CaseBlockNode::emitBytecodeForBlock):
22609 (JSC::TryNode::emitBytecode):
22611 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22613 Reviewed by Sam Weinig.
22615 Renamed JITCodeBuffer to AssemblerBuffer and renamed its data members
22616 to be more like the rest of our buffer classes, with a size and a
22619 Added an assert in the unchecked put case to match the test in the checked
22622 Changed a C-style cast to a C++-style cast.
22624 Renamed MAX_INSTRUCTION_SIZE to maxInstructionSize.
22628 (JSC::CTI::compileRegExp):
22630 (JSC::BytecodeInterpreter::BytecodeInterpreter):
22632 (JSC::BytecodeInterpreter::assemblerBuffer):
22633 * masm/X86Assembler.h:
22634 (JSC::AssemblerBuffer::AssemblerBuffer):
22635 (JSC::AssemblerBuffer::~AssemblerBuffer):
22636 (JSC::AssemblerBuffer::ensureSpace):
22637 (JSC::AssemblerBuffer::isAligned):
22638 (JSC::AssemblerBuffer::putByteUnchecked):
22639 (JSC::AssemblerBuffer::putByte):
22640 (JSC::AssemblerBuffer::putShortUnchecked):
22641 (JSC::AssemblerBuffer::putShort):
22642 (JSC::AssemblerBuffer::putIntUnchecked):
22643 (JSC::AssemblerBuffer::putInt):
22644 (JSC::AssemblerBuffer::data):
22645 (JSC::AssemblerBuffer::size):
22646 (JSC::AssemblerBuffer::reset):
22647 (JSC::AssemblerBuffer::copy):
22648 (JSC::AssemblerBuffer::grow):
22649 (JSC::X86Assembler::):
22650 (JSC::X86Assembler::X86Assembler):
22651 (JSC::X86Assembler::testl_i32r):
22652 (JSC::X86Assembler::movl_mr):
22653 (JSC::X86Assembler::movl_rm):
22654 (JSC::X86Assembler::movl_i32m):
22655 (JSC::X86Assembler::emitCall):
22656 (JSC::X86Assembler::label):
22657 (JSC::X86Assembler::emitUnlinkedJmp):
22658 (JSC::X86Assembler::emitUnlinkedJne):
22659 (JSC::X86Assembler::emitUnlinkedJe):
22660 (JSC::X86Assembler::emitUnlinkedJl):
22661 (JSC::X86Assembler::emitUnlinkedJb):
22662 (JSC::X86Assembler::emitUnlinkedJle):
22663 (JSC::X86Assembler::emitUnlinkedJbe):
22664 (JSC::X86Assembler::emitUnlinkedJge):
22665 (JSC::X86Assembler::emitUnlinkedJg):
22666 (JSC::X86Assembler::emitUnlinkedJa):
22667 (JSC::X86Assembler::emitUnlinkedJae):
22668 (JSC::X86Assembler::emitUnlinkedJo):
22669 (JSC::X86Assembler::emitUnlinkedJp):
22670 (JSC::X86Assembler::emitUnlinkedJs):
22671 (JSC::X86Assembler::link):
22672 (JSC::X86Assembler::emitModRm_rr):
22673 (JSC::X86Assembler::emitModRm_rm):
22674 (JSC::X86Assembler::emitModRm_opr):
22676 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22678 Suggested by Maciej Stachowiak.
22680 Reverted most "opcode" => "bytecode" renames. We use "bytecode" as a
22681 mass noun to refer to a stream of instructions. Each instruction may be
22682 an opcode or an operand.
22685 (JSC::CTI::emitCTICall):
22686 (JSC::CTI::compileOpCall):
22687 (JSC::CTI::compileBinaryArithOp):
22688 (JSC::CTI::compileBinaryArithOpSlowCase):
22689 (JSC::CTI::privateCompileMainPass):
22690 (JSC::CTI::privateCompileSlowCases):
22691 (JSC::CTI::privateCompile):
22693 * VM/CodeBlock.cpp:
22694 (JSC::CodeBlock::printStructureIDs):
22695 (JSC::CodeBlock::dump):
22696 (JSC::CodeBlock::derefStructureIDs):
22697 (JSC::CodeBlock::refStructureIDs):
22699 * VM/ExceptionHelpers.cpp:
22700 (JSC::createNotAnObjectError):
22701 * VM/Instruction.h:
22702 (JSC::Instruction::Instruction):
22703 (JSC::Instruction::):
22705 (JSC::BytecodeInterpreter::isOpcode):
22706 (JSC::BytecodeInterpreter::throwException):
22707 (JSC::BytecodeInterpreter::tryCachePutByID):
22708 (JSC::BytecodeInterpreter::uncachePutByID):
22709 (JSC::BytecodeInterpreter::tryCacheGetByID):
22710 (JSC::BytecodeInterpreter::uncacheGetByID):
22711 (JSC::BytecodeInterpreter::privateExecute):
22712 (JSC::BytecodeInterpreter::tryCTICachePutByID):
22713 (JSC::BytecodeInterpreter::tryCTICacheGetByID):
22715 (JSC::BytecodeInterpreter::getOpcode):
22716 (JSC::BytecodeInterpreter::getOpcodeID):
22717 (JSC::BytecodeInterpreter::isCallBytecode):
22720 (JSC::OpcodeStats::OpcodeStats):
22721 (JSC::compareOpcodeIndices):
22722 (JSC::compareOpcodePairIndices):
22723 (JSC::OpcodeStats::~OpcodeStats):
22724 (JSC::OpcodeStats::recordInstruction):
22725 (JSC::OpcodeStats::resetLastInstruction):
22728 (JSC::padOpcodeName):
22729 * VM/SamplingTool.cpp:
22730 (JSC::ScopeSampleRecord::sample):
22731 (JSC::SamplingTool::run):
22732 (JSC::compareOpcodeIndicesSampling):
22733 (JSC::SamplingTool::dump):
22734 * VM/SamplingTool.h:
22735 (JSC::ScopeSampleRecord::ScopeSampleRecord):
22736 (JSC::SamplingTool::SamplingTool):
22737 * bytecompiler/CodeGenerator.cpp:
22738 (JSC::BytecodeGenerator::BytecodeGenerator):
22739 (JSC::BytecodeGenerator::emitLabel):
22740 (JSC::BytecodeGenerator::emitOpcode):
22741 (JSC::BytecodeGenerator::emitJump):
22742 (JSC::BytecodeGenerator::emitJumpIfTrue):
22743 (JSC::BytecodeGenerator::emitJumpIfFalse):
22744 (JSC::BytecodeGenerator::emitMove):
22745 (JSC::BytecodeGenerator::emitUnaryOp):
22746 (JSC::BytecodeGenerator::emitPreInc):
22747 (JSC::BytecodeGenerator::emitPreDec):
22748 (JSC::BytecodeGenerator::emitPostInc):
22749 (JSC::BytecodeGenerator::emitPostDec):
22750 (JSC::BytecodeGenerator::emitBinaryOp):
22751 (JSC::BytecodeGenerator::emitEqualityOp):
22752 (JSC::BytecodeGenerator::emitUnexpectedLoad):
22753 (JSC::BytecodeGenerator::emitInstanceOf):
22754 (JSC::BytecodeGenerator::emitResolve):
22755 (JSC::BytecodeGenerator::emitGetScopedVar):
22756 (JSC::BytecodeGenerator::emitPutScopedVar):
22757 (JSC::BytecodeGenerator::emitResolveBase):
22758 (JSC::BytecodeGenerator::emitResolveWithBase):
22759 (JSC::BytecodeGenerator::emitResolveFunction):
22760 (JSC::BytecodeGenerator::emitGetById):
22761 (JSC::BytecodeGenerator::emitPutById):
22762 (JSC::BytecodeGenerator::emitPutGetter):
22763 (JSC::BytecodeGenerator::emitPutSetter):
22764 (JSC::BytecodeGenerator::emitDeleteById):
22765 (JSC::BytecodeGenerator::emitGetByVal):
22766 (JSC::BytecodeGenerator::emitPutByVal):
22767 (JSC::BytecodeGenerator::emitDeleteByVal):
22768 (JSC::BytecodeGenerator::emitPutByIndex):
22769 (JSC::BytecodeGenerator::emitNewObject):
22770 (JSC::BytecodeGenerator::emitNewArray):
22771 (JSC::BytecodeGenerator::emitNewFunction):
22772 (JSC::BytecodeGenerator::emitNewRegExp):
22773 (JSC::BytecodeGenerator::emitNewFunctionExpression):
22774 (JSC::BytecodeGenerator::emitCall):
22775 (JSC::BytecodeGenerator::emitReturn):
22776 (JSC::BytecodeGenerator::emitUnaryNoDstOp):
22777 (JSC::BytecodeGenerator::emitConstruct):
22778 (JSC::BytecodeGenerator::emitPopScope):
22779 (JSC::BytecodeGenerator::emitDebugHook):
22780 (JSC::BytecodeGenerator::emitComplexJumpScopes):
22781 (JSC::BytecodeGenerator::emitJumpScopes):
22782 (JSC::BytecodeGenerator::emitNextPropertyName):
22783 (JSC::BytecodeGenerator::emitCatch):
22784 (JSC::BytecodeGenerator::emitNewError):
22785 (JSC::BytecodeGenerator::emitJumpSubroutine):
22786 (JSC::BytecodeGenerator::emitSubroutineReturn):
22787 (JSC::BytecodeGenerator::emitPushNewScope):
22788 (JSC::BytecodeGenerator::beginSwitch):
22789 * bytecompiler/CodeGenerator.h:
22792 * masm/X86Assembler.h:
22793 (JSC::X86Assembler::):
22794 (JSC::X86Assembler::emitModRm_opr):
22795 (JSC::X86Assembler::emitModRm_opr_Unchecked):
22796 (JSC::X86Assembler::emitModRm_opm):
22797 (JSC::X86Assembler::emitModRm_opm_Unchecked):
22798 (JSC::X86Assembler::emitModRm_opmsib):
22799 * parser/Nodes.cpp:
22800 (JSC::UnaryOpNode::emitBytecode):
22801 (JSC::BinaryOpNode::emitBytecode):
22802 (JSC::ReverseBinaryOpNode::emitBytecode):
22803 (JSC::ThrowableBinaryOpNode::emitBytecode):
22804 (JSC::emitReadModifyAssignment):
22805 (JSC::ScopeNode::ScopeNode):
22807 (JSC::UnaryPlusNode::):
22808 (JSC::NegateNode::):
22809 (JSC::BitwiseNotNode::):
22810 (JSC::LogicalNotNode::):
22816 (JSC::LeftShiftNode::):
22817 (JSC::RightShiftNode::):
22818 (JSC::UnsignedRightShiftNode::):
22820 (JSC::GreaterNode::):
22821 (JSC::LessEqNode::):
22822 (JSC::GreaterEqNode::):
22823 (JSC::InstanceOfNode::):
22825 (JSC::EqualNode::):
22826 (JSC::NotEqualNode::):
22827 (JSC::StrictEqualNode::):
22828 (JSC::NotStrictEqualNode::):
22829 (JSC::BitAndNode::):
22830 (JSC::BitOrNode::):
22831 (JSC::BitXOrNode::):
22832 * runtime/StructureID.cpp:
22833 (JSC::StructureID::fromDictionaryTransition):
22836 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22838 Reviewed by Sam Weinig.
22842 CodeGenerator => BytecodeGenerator
22843 emitCodeForBlock => emitBytecodeForBlock
22844 generatedByteCode => generatedBytecode
22845 generateCode => generateBytecode
22847 * JavaScriptCore.exp:
22848 * bytecompiler/CodeGenerator.cpp:
22849 (JSC::BytecodeGenerator::setDumpsGeneratedCode):
22850 (JSC::BytecodeGenerator::generate):
22851 (JSC::BytecodeGenerator::addVar):
22852 (JSC::BytecodeGenerator::addGlobalVar):
22853 (JSC::BytecodeGenerator::allocateConstants):
22854 (JSC::BytecodeGenerator::BytecodeGenerator):
22855 (JSC::BytecodeGenerator::addParameter):
22856 (JSC::BytecodeGenerator::registerFor):
22857 (JSC::BytecodeGenerator::constRegisterFor):
22858 (JSC::BytecodeGenerator::isLocal):
22859 (JSC::BytecodeGenerator::isLocalConstant):
22860 (JSC::BytecodeGenerator::newRegister):
22861 (JSC::BytecodeGenerator::newTemporary):
22862 (JSC::BytecodeGenerator::highestUsedRegister):
22863 (JSC::BytecodeGenerator::newLabelScope):
22864 (JSC::BytecodeGenerator::newLabel):
22865 (JSC::BytecodeGenerator::emitLabel):
22866 (JSC::BytecodeGenerator::emitBytecode):
22867 (JSC::BytecodeGenerator::retrieveLastBinaryOp):
22868 (JSC::BytecodeGenerator::retrieveLastUnaryOp):
22869 (JSC::BytecodeGenerator::rewindBinaryOp):
22870 (JSC::BytecodeGenerator::rewindUnaryOp):
22871 (JSC::BytecodeGenerator::emitJump):
22872 (JSC::BytecodeGenerator::emitJumpIfTrue):
22873 (JSC::BytecodeGenerator::emitJumpIfFalse):
22874 (JSC::BytecodeGenerator::addConstant):
22875 (JSC::BytecodeGenerator::addUnexpectedConstant):
22876 (JSC::BytecodeGenerator::addRegExp):
22877 (JSC::BytecodeGenerator::emitMove):
22878 (JSC::BytecodeGenerator::emitUnaryOp):
22879 (JSC::BytecodeGenerator::emitPreInc):
22880 (JSC::BytecodeGenerator::emitPreDec):
22881 (JSC::BytecodeGenerator::emitPostInc):
22882 (JSC::BytecodeGenerator::emitPostDec):
22883 (JSC::BytecodeGenerator::emitBinaryOp):
22884 (JSC::BytecodeGenerator::emitEqualityOp):
22885 (JSC::BytecodeGenerator::emitLoad):
22886 (JSC::BytecodeGenerator::emitUnexpectedLoad):
22887 (JSC::BytecodeGenerator::findScopedProperty):
22888 (JSC::BytecodeGenerator::emitInstanceOf):
22889 (JSC::BytecodeGenerator::emitResolve):
22890 (JSC::BytecodeGenerator::emitGetScopedVar):
22891 (JSC::BytecodeGenerator::emitPutScopedVar):
22892 (JSC::BytecodeGenerator::emitResolveBase):
22893 (JSC::BytecodeGenerator::emitResolveWithBase):
22894 (JSC::BytecodeGenerator::emitResolveFunction):
22895 (JSC::BytecodeGenerator::emitGetById):
22896 (JSC::BytecodeGenerator::emitPutById):
22897 (JSC::BytecodeGenerator::emitPutGetter):
22898 (JSC::BytecodeGenerator::emitPutSetter):
22899 (JSC::BytecodeGenerator::emitDeleteById):
22900 (JSC::BytecodeGenerator::emitGetByVal):
22901 (JSC::BytecodeGenerator::emitPutByVal):
22902 (JSC::BytecodeGenerator::emitDeleteByVal):
22903 (JSC::BytecodeGenerator::emitPutByIndex):
22904 (JSC::BytecodeGenerator::emitNewObject):
22905 (JSC::BytecodeGenerator::emitNewArray):
22906 (JSC::BytecodeGenerator::emitNewFunction):
22907 (JSC::BytecodeGenerator::emitNewRegExp):
22908 (JSC::BytecodeGenerator::emitNewFunctionExpression):
22909 (JSC::BytecodeGenerator::emitCall):
22910 (JSC::BytecodeGenerator::emitCallEval):
22911 (JSC::BytecodeGenerator::emitReturn):
22912 (JSC::BytecodeGenerator::emitUnaryNoDstOp):
22913 (JSC::BytecodeGenerator::emitConstruct):
22914 (JSC::BytecodeGenerator::emitPushScope):
22915 (JSC::BytecodeGenerator::emitPopScope):
22916 (JSC::BytecodeGenerator::emitDebugHook):
22917 (JSC::BytecodeGenerator::pushFinallyContext):
22918 (JSC::BytecodeGenerator::popFinallyContext):
22919 (JSC::BytecodeGenerator::breakTarget):
22920 (JSC::BytecodeGenerator::continueTarget):
22921 (JSC::BytecodeGenerator::emitComplexJumpScopes):
22922 (JSC::BytecodeGenerator::emitJumpScopes):
22923 (JSC::BytecodeGenerator::emitNextPropertyName):
22924 (JSC::BytecodeGenerator::emitCatch):
22925 (JSC::BytecodeGenerator::emitNewError):
22926 (JSC::BytecodeGenerator::emitJumpSubroutine):
22927 (JSC::BytecodeGenerator::emitSubroutineReturn):
22928 (JSC::BytecodeGenerator::emitPushNewScope):
22929 (JSC::BytecodeGenerator::beginSwitch):
22930 (JSC::BytecodeGenerator::endSwitch):
22931 (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
22932 * bytecompiler/CodeGenerator.h:
22935 * parser/Nodes.cpp:
22936 (JSC::ThrowableExpressionData::emitThrowError):
22937 (JSC::NullNode::emitBytecode):
22938 (JSC::BooleanNode::emitBytecode):
22939 (JSC::NumberNode::emitBytecode):
22940 (JSC::StringNode::emitBytecode):
22941 (JSC::RegExpNode::emitBytecode):
22942 (JSC::ThisNode::emitBytecode):
22943 (JSC::ResolveNode::isPure):
22944 (JSC::ResolveNode::emitBytecode):
22945 (JSC::ArrayNode::emitBytecode):
22946 (JSC::ObjectLiteralNode::emitBytecode):
22947 (JSC::PropertyListNode::emitBytecode):
22948 (JSC::BracketAccessorNode::emitBytecode):
22949 (JSC::DotAccessorNode::emitBytecode):
22950 (JSC::ArgumentListNode::emitBytecode):
22951 (JSC::NewExprNode::emitBytecode):
22952 (JSC::EvalFunctionCallNode::emitBytecode):
22953 (JSC::FunctionCallValueNode::emitBytecode):
22954 (JSC::FunctionCallResolveNode::emitBytecode):
22955 (JSC::FunctionCallBracketNode::emitBytecode):
22956 (JSC::FunctionCallDotNode::emitBytecode):
22957 (JSC::emitPreIncOrDec):
22958 (JSC::emitPostIncOrDec):
22959 (JSC::PostfixResolveNode::emitBytecode):
22960 (JSC::PostfixBracketNode::emitBytecode):
22961 (JSC::PostfixDotNode::emitBytecode):
22962 (JSC::PostfixErrorNode::emitBytecode):
22963 (JSC::DeleteResolveNode::emitBytecode):
22964 (JSC::DeleteBracketNode::emitBytecode):
22965 (JSC::DeleteDotNode::emitBytecode):
22966 (JSC::DeleteValueNode::emitBytecode):
22967 (JSC::VoidNode::emitBytecode):
22968 (JSC::TypeOfResolveNode::emitBytecode):
22969 (JSC::TypeOfValueNode::emitBytecode):
22970 (JSC::PrefixResolveNode::emitBytecode):
22971 (JSC::PrefixBracketNode::emitBytecode):
22972 (JSC::PrefixDotNode::emitBytecode):
22973 (JSC::PrefixErrorNode::emitBytecode):
22974 (JSC::UnaryOpNode::emitBytecode):
22975 (JSC::BinaryOpNode::emitBytecode):
22976 (JSC::EqualNode::emitBytecode):
22977 (JSC::StrictEqualNode::emitBytecode):
22978 (JSC::ReverseBinaryOpNode::emitBytecode):
22979 (JSC::ThrowableBinaryOpNode::emitBytecode):
22980 (JSC::InstanceOfNode::emitBytecode):
22981 (JSC::LogicalOpNode::emitBytecode):
22982 (JSC::ConditionalNode::emitBytecode):
22983 (JSC::emitReadModifyAssignment):
22984 (JSC::ReadModifyResolveNode::emitBytecode):
22985 (JSC::AssignResolveNode::emitBytecode):
22986 (JSC::AssignDotNode::emitBytecode):
22987 (JSC::ReadModifyDotNode::emitBytecode):
22988 (JSC::AssignErrorNode::emitBytecode):
22989 (JSC::AssignBracketNode::emitBytecode):
22990 (JSC::ReadModifyBracketNode::emitBytecode):
22991 (JSC::CommaNode::emitBytecode):
22992 (JSC::ConstDeclNode::emitCodeSingle):
22993 (JSC::ConstDeclNode::emitBytecode):
22994 (JSC::ConstStatementNode::emitBytecode):
22995 (JSC::statementListEmitCode):
22996 (JSC::BlockNode::emitBytecode):
22997 (JSC::EmptyStatementNode::emitBytecode):
22998 (JSC::DebuggerStatementNode::emitBytecode):
22999 (JSC::ExprStatementNode::emitBytecode):
23000 (JSC::VarStatementNode::emitBytecode):
23001 (JSC::IfNode::emitBytecode):
23002 (JSC::IfElseNode::emitBytecode):
23003 (JSC::DoWhileNode::emitBytecode):
23004 (JSC::WhileNode::emitBytecode):
23005 (JSC::ForNode::emitBytecode):
23006 (JSC::ForInNode::emitBytecode):
23007 (JSC::ContinueNode::emitBytecode):
23008 (JSC::BreakNode::emitBytecode):
23009 (JSC::ReturnNode::emitBytecode):
23010 (JSC::WithNode::emitBytecode):
23011 (JSC::CaseBlockNode::emitBytecodeForBlock):
23012 (JSC::SwitchNode::emitBytecode):
23013 (JSC::LabelNode::emitBytecode):
23014 (JSC::ThrowNode::emitBytecode):
23015 (JSC::TryNode::emitBytecode):
23016 (JSC::EvalNode::emitBytecode):
23017 (JSC::EvalNode::generateBytecode):
23018 (JSC::FunctionBodyNode::generateBytecode):
23019 (JSC::FunctionBodyNode::emitBytecode):
23020 (JSC::ProgramNode::emitBytecode):
23021 (JSC::ProgramNode::generateBytecode):
23022 (JSC::FuncDeclNode::emitBytecode):
23023 (JSC::FuncExprNode::emitBytecode):
23025 (JSC::ExpressionNode::):
23026 (JSC::BooleanNode::):
23027 (JSC::NumberNode::):
23028 (JSC::StringNode::):
23029 (JSC::ProgramNode::):
23031 (JSC::FunctionBodyNode::):
23032 * runtime/Arguments.h:
23033 (JSC::Arguments::getArgumentsData):
23034 (JSC::JSActivation::copyRegisters):
23035 * runtime/JSActivation.cpp:
23036 (JSC::JSActivation::mark):
23037 * runtime/JSActivation.h:
23038 (JSC::JSActivation::JSActivationData::JSActivationData):
23039 * runtime/JSFunction.cpp:
23040 (JSC::JSFunction::~JSFunction):
23042 2008-11-15 Geoffrey Garen <ggaren@apple.com>
23044 Reviewed by Sam Weinig.
23046 Renamed all forms of "byte code" "opcode" "op code" "code" "bitcode"
23047 etc. to "bytecode".
23050 (JSC::CTI::printBytecodeOperandTypes):
23051 (JSC::CTI::emitAllocateNumber):
23052 (JSC::CTI::emitNakedCall):
23053 (JSC::CTI::emitNakedFastCall):
23054 (JSC::CTI::emitCTICall):
23055 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
23056 (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
23057 (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
23058 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
23059 (JSC::CTI::compileOpCall):
23060 (JSC::CTI::emitSlowScriptCheck):
23061 (JSC::CTI::compileBinaryArithOp):
23062 (JSC::CTI::compileBinaryArithOpSlowCase):
23063 (JSC::CTI::privateCompileMainPass):
23064 (JSC::CTI::privateCompileSlowCases):
23065 (JSC::CTI::privateCompile):
23067 (JSC::CallRecord::CallRecord):
23068 (JSC::SwitchRecord::SwitchRecord):
23069 * VM/CodeBlock.cpp:
23070 (JSC::CodeBlock::printStructureIDs):
23071 (JSC::CodeBlock::dump):
23072 (JSC::CodeBlock::~CodeBlock):
23073 (JSC::CodeBlock::derefStructureIDs):
23074 (JSC::CodeBlock::refStructureIDs):
23076 (JSC::StructureStubInfo::StructureStubInfo):
23077 * VM/ExceptionHelpers.cpp:
23078 (JSC::createNotAnObjectError):
23079 * VM/Instruction.h:
23080 (JSC::Instruction::Instruction):
23081 (JSC::Instruction::):
23083 (JSC::BytecodeInterpreter::isBytecode):
23084 (JSC::BytecodeInterpreter::throwException):
23085 (JSC::BytecodeInterpreter::execute):
23086 (JSC::BytecodeInterpreter::tryCachePutByID):
23087 (JSC::BytecodeInterpreter::uncachePutByID):
23088 (JSC::BytecodeInterpreter::tryCacheGetByID):
23089 (JSC::BytecodeInterpreter::uncacheGetByID):
23090 (JSC::BytecodeInterpreter::privateExecute):
23091 (JSC::BytecodeInterpreter::tryCTICachePutByID):
23092 (JSC::BytecodeInterpreter::tryCTICacheGetByID):
23093 (JSC::BytecodeInterpreter::cti_op_call_JSFunction):
23094 (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall):
23095 (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall):
23097 (JSC::BytecodeInterpreter::getBytecode):
23098 (JSC::BytecodeInterpreter::getBytecodeID):
23099 (JSC::BytecodeInterpreter::isCallBytecode):
23102 (JSC::BytecodeStats::BytecodeStats):
23103 (JSC::compareBytecodeIndices):
23104 (JSC::compareBytecodePairIndices):
23105 (JSC::BytecodeStats::~BytecodeStats):
23106 (JSC::BytecodeStats::recordInstruction):
23107 (JSC::BytecodeStats::resetLastInstruction):
23110 (JSC::padBytecodeName):
23111 * VM/SamplingTool.cpp:
23112 (JSC::ScopeSampleRecord::sample):
23113 (JSC::SamplingTool::run):
23114 (JSC::compareBytecodeIndicesSampling):
23115 (JSC::SamplingTool::dump):
23116 * VM/SamplingTool.h:
23117 (JSC::ScopeSampleRecord::ScopeSampleRecord):
23118 (JSC::SamplingTool::SamplingTool):
23119 * bytecompiler/CodeGenerator.cpp:
23120 (JSC::CodeGenerator::generate):
23121 (JSC::CodeGenerator::CodeGenerator):
23122 (JSC::CodeGenerator::emitLabel):
23123 (JSC::CodeGenerator::emitBytecode):
23124 (JSC::CodeGenerator::emitJump):
23125 (JSC::CodeGenerator::emitJumpIfTrue):
23126 (JSC::CodeGenerator::emitJumpIfFalse):
23127 (JSC::CodeGenerator::emitMove):
23128 (JSC::CodeGenerator::emitUnaryOp):
23129 (JSC::CodeGenerator::emitPreInc):
23130 (JSC::CodeGenerator::emitPreDec):
23131 (JSC::CodeGenerator::emitPostInc):
23132 (JSC::CodeGenerator::emitPostDec):
23133 (JSC::CodeGenerator::emitBinaryOp):
23134 (JSC::CodeGenerator::emitEqualityOp):
23135 (JSC::CodeGenerator::emitUnexpectedLoad):
23136 (JSC::CodeGenerator::emitInstanceOf):
23137 (JSC::CodeGenerator::emitResolve):
23138 (JSC::CodeGenerator::emitGetScopedVar):
23139 (JSC::CodeGenerator::emitPutScopedVar):
23140 (JSC::CodeGenerator::emitResolveBase):
23141 (JSC::CodeGenerator::emitResolveWithBase):
23142 (JSC::CodeGenerator::emitResolveFunction):
23143 (JSC::CodeGenerator::emitGetById):
23144 (JSC::CodeGenerator::emitPutById):
23145 (JSC::CodeGenerator::emitPutGetter):
23146 (JSC::CodeGenerator::emitPutSetter):
23147 (JSC::CodeGenerator::emitDeleteById):
23148 (JSC::CodeGenerator::emitGetByVal):
23149 (JSC::CodeGenerator::emitPutByVal):
23150 (JSC::CodeGenerator::emitDeleteByVal):
23151 (JSC::CodeGenerator::emitPutByIndex):
23152 (JSC::CodeGenerator::emitNewObject):
23153 (JSC::CodeGenerator::emitNewArray):
23154 (JSC::CodeGenerator::emitNewFunction):
23155 (JSC::CodeGenerator::emitNewRegExp):
23156 (JSC::CodeGenerator::emitNewFunctionExpression):
23157 (JSC::CodeGenerator::emitCall):
23158 (JSC::CodeGenerator::emitReturn):
23159 (JSC::CodeGenerator::emitUnaryNoDstOp):
23160 (JSC::CodeGenerator::emitConstruct):
23161 (JSC::CodeGenerator::emitPopScope):
23162 (JSC::CodeGenerator::emitDebugHook):
23163 (JSC::CodeGenerator::emitComplexJumpScopes):
23164 (JSC::CodeGenerator::emitJumpScopes):
23165 (JSC::CodeGenerator::emitNextPropertyName):
23166 (JSC::CodeGenerator::emitCatch):
23167 (JSC::CodeGenerator::emitNewError):
23168 (JSC::CodeGenerator::emitJumpSubroutine):
23169 (JSC::CodeGenerator::emitSubroutineReturn):
23170 (JSC::CodeGenerator::emitPushNewScope):
23171 (JSC::CodeGenerator::beginSwitch):
23172 (JSC::CodeGenerator::endSwitch):
23173 * bytecompiler/CodeGenerator.h:
23174 (JSC::CodeGenerator::emitNode):
23177 * masm/X86Assembler.h:
23178 (JSC::X86Assembler::):
23179 (JSC::X86Assembler::emitModRm_opr):
23180 (JSC::X86Assembler::emitModRm_opr_Unchecked):
23181 (JSC::X86Assembler::emitModRm_opm):
23182 (JSC::X86Assembler::emitModRm_opm_Unchecked):
23183 (JSC::X86Assembler::emitModRm_opmsib):
23184 * parser/Nodes.cpp:
23185 (JSC::NullNode::emitBytecode):
23186 (JSC::BooleanNode::emitBytecode):
23187 (JSC::NumberNode::emitBytecode):
23188 (JSC::StringNode::emitBytecode):
23189 (JSC::RegExpNode::emitBytecode):
23190 (JSC::ThisNode::emitBytecode):
23191 (JSC::ResolveNode::emitBytecode):
23192 (JSC::ArrayNode::emitBytecode):
23193 (JSC::ObjectLiteralNode::emitBytecode):
23194 (JSC::PropertyListNode::emitBytecode):
23195 (JSC::BracketAccessorNode::emitBytecode):
23196 (JSC::DotAccessorNode::emitBytecode):
23197 (JSC::ArgumentListNode::emitBytecode):
23198 (JSC::NewExprNode::emitBytecode):
23199 (JSC::EvalFunctionCallNode::emitBytecode):
23200 (JSC::FunctionCallValueNode::emitBytecode):
23201 (JSC::FunctionCallResolveNode::emitBytecode):
23202 (JSC::FunctionCallBracketNode::emitBytecode):
23203 (JSC::FunctionCallDotNode::emitBytecode):
23204 (JSC::PostfixResolveNode::emitBytecode):
23205 (JSC::PostfixBracketNode::emitBytecode):
23206 (JSC::PostfixDotNode::emitBytecode):
23207 (JSC::PostfixErrorNode::emitBytecode):
23208 (JSC::DeleteResolveNode::emitBytecode):
23209 (JSC::DeleteBracketNode::emitBytecode):
23210 (JSC::DeleteDotNode::emitBytecode):
23211 (JSC::DeleteValueNode::emitBytecode):
23212 (JSC::VoidNode::emitBytecode):
23213 (JSC::TypeOfResolveNode::emitBytecode):
23214 (JSC::TypeOfValueNode::emitBytecode):
23215 (JSC::PrefixResolveNode::emitBytecode):
23216 (JSC::PrefixBracketNode::emitBytecode):
23217 (JSC::PrefixDotNode::emitBytecode):
23218 (JSC::PrefixErrorNode::emitBytecode):
23219 (JSC::UnaryOpNode::emitBytecode):
23220 (JSC::BinaryOpNode::emitBytecode):
23221 (JSC::EqualNode::emitBytecode):
23222 (JSC::StrictEqualNode::emitBytecode):
23223 (JSC::ReverseBinaryOpNode::emitBytecode):
23224 (JSC::ThrowableBinaryOpNode::emitBytecode):
23225 (JSC::InstanceOfNode::emitBytecode):
23226 (JSC::LogicalOpNode::emitBytecode):
23227 (JSC::ConditionalNode::emitBytecode):
23228 (JSC::emitReadModifyAssignment):
23229 (JSC::ReadModifyResolveNode::emitBytecode):
23230 (JSC::AssignResolveNode::emitBytecode):
23231 (JSC::AssignDotNode::emitBytecode):
23232 (JSC::ReadModifyDotNode::emitBytecode):
23233 (JSC::AssignErrorNode::emitBytecode):
23234 (JSC::AssignBracketNode::emitBytecode):
23235 (JSC::ReadModifyBracketNode::emitBytecode):
23236 (JSC::CommaNode::emitBytecode):
23237 (JSC::ConstDeclNode::emitBytecode):
23238 (JSC::ConstStatementNode::emitBytecode):
23239 (JSC::BlockNode::emitBytecode):
23240 (JSC::EmptyStatementNode::emitBytecode):
23241 (JSC::DebuggerStatementNode::emitBytecode):
23242 (JSC::ExprStatementNode::emitBytecode):
23243 (JSC::VarStatementNode::emitBytecode):
23244 (JSC::IfNode::emitBytecode):
23245 (JSC::IfElseNode::emitBytecode):
23246 (JSC::DoWhileNode::emitBytecode):
23247 (JSC::WhileNode::emitBytecode):
23248 (JSC::ForNode::emitBytecode):
23249 (JSC::ForInNode::emitBytecode):
23250 (JSC::ContinueNode::emitBytecode):
23251 (JSC::BreakNode::emitBytecode):
23252 (JSC::ReturnNode::emitBytecode):
23253 (JSC::WithNode::emitBytecode):
23254 (JSC::SwitchNode::emitBytecode):
23255 (JSC::LabelNode::emitBytecode):
23256 (JSC::ThrowNode::emitBytecode):
23257 (JSC::TryNode::emitBytecode):
23258 (JSC::ScopeNode::ScopeNode):
23259 (JSC::EvalNode::emitBytecode):
23260 (JSC::FunctionBodyNode::emitBytecode):
23261 (JSC::ProgramNode::emitBytecode):
23262 (JSC::FuncDeclNode::emitBytecode):
23263 (JSC::FuncExprNode::emitBytecode):
23265 (JSC::UnaryPlusNode::):
23266 (JSC::NegateNode::):
23267 (JSC::BitwiseNotNode::):
23268 (JSC::LogicalNotNode::):
23274 (JSC::LeftShiftNode::):
23275 (JSC::RightShiftNode::):
23276 (JSC::UnsignedRightShiftNode::):
23278 (JSC::GreaterNode::):
23279 (JSC::LessEqNode::):
23280 (JSC::GreaterEqNode::):
23281 (JSC::InstanceOfNode::):
23283 (JSC::EqualNode::):
23284 (JSC::NotEqualNode::):
23285 (JSC::StrictEqualNode::):
23286 (JSC::NotStrictEqualNode::):
23287 (JSC::BitAndNode::):
23288 (JSC::BitOrNode::):
23289 (JSC::BitXOrNode::):
23290 (JSC::ProgramNode::):
23292 (JSC::FunctionBodyNode::):
23293 * runtime/JSNotAnObject.h:
23294 * runtime/StructureID.cpp:
23295 (JSC::StructureID::fromDictionaryTransition):
23298 2008-11-15 Geoffrey Garen <ggaren@apple.com>
23300 Reviewed by Sam Weinig.
23302 Renamed Machine to BytecodeInterpreter.
23304 Nixed the Interpreter class, and changed its two functions to stand-alone
23307 * JavaScriptCore.exp:
23310 (JSC::CTI::emitCTICall):
23312 (JSC::CTI::compileOpCall):
23313 (JSC::CTI::emitSlowScriptCheck):
23314 (JSC::CTI::compileBinaryArithOpSlowCase):
23315 (JSC::CTI::privateCompileMainPass):
23316 (JSC::CTI::privateCompileSlowCases):
23317 (JSC::CTI::privateCompile):
23318 (JSC::CTI::privateCompileGetByIdSelf):
23319 (JSC::CTI::privateCompileGetByIdProto):
23320 (JSC::CTI::privateCompileGetByIdChain):
23321 (JSC::CTI::privateCompilePutByIdReplace):
23322 (JSC::CTI::privateCompilePutByIdTransition):
23323 (JSC::CTI::privateCompileCTIMachineTrampolines):
23324 (JSC::CTI::freeCTIMachineTrampolines):
23325 (JSC::CTI::patchGetByIdSelf):
23326 (JSC::CTI::patchPutByIdReplace):
23327 (JSC::CTI::privateCompilePatchGetArrayLength):
23328 (JSC::CTI::compileRegExp):
23330 * VM/CodeBlock.cpp:
23331 (JSC::CodeBlock::printStructureIDs):
23332 (JSC::CodeBlock::dump):
23333 (JSC::CodeBlock::derefStructureIDs):
23334 (JSC::CodeBlock::refStructureIDs):
23335 * VM/ExceptionHelpers.cpp:
23336 (JSC::createNotAnObjectError):
23340 (JSC::BytecodeInterpreter::resolve):
23341 (JSC::BytecodeInterpreter::resolveSkip):
23342 (JSC::BytecodeInterpreter::resolveGlobal):
23343 (JSC::BytecodeInterpreter::resolveBase):
23344 (JSC::BytecodeInterpreter::resolveBaseAndProperty):
23345 (JSC::BytecodeInterpreter::resolveBaseAndFunc):
23346 (JSC::BytecodeInterpreter::slideRegisterWindowForCall):
23347 (JSC::BytecodeInterpreter::callEval):
23348 (JSC::BytecodeInterpreter::BytecodeInterpreter):
23349 (JSC::BytecodeInterpreter::initialize):
23350 (JSC::BytecodeInterpreter::~BytecodeInterpreter):
23351 (JSC::BytecodeInterpreter::dumpCallFrame):
23352 (JSC::BytecodeInterpreter::dumpRegisters):
23353 (JSC::BytecodeInterpreter::isOpcode):
23354 (JSC::BytecodeInterpreter::unwindCallFrame):
23355 (JSC::BytecodeInterpreter::throwException):
23356 (JSC::BytecodeInterpreter::execute):
23357 (JSC::BytecodeInterpreter::debug):
23358 (JSC::BytecodeInterpreter::resetTimeoutCheck):
23359 (JSC::BytecodeInterpreter::checkTimeout):
23360 (JSC::BytecodeInterpreter::createExceptionScope):
23361 (JSC::BytecodeInterpreter::tryCachePutByID):
23362 (JSC::BytecodeInterpreter::uncachePutByID):
23363 (JSC::BytecodeInterpreter::tryCacheGetByID):
23364 (JSC::BytecodeInterpreter::uncacheGetByID):
23365 (JSC::BytecodeInterpreter::privateExecute):
23366 (JSC::BytecodeInterpreter::retrieveArguments):
23367 (JSC::BytecodeInterpreter::retrieveCaller):
23368 (JSC::BytecodeInterpreter::retrieveLastCaller):
23369 (JSC::BytecodeInterpreter::findFunctionCallFrame):
23370 (JSC::BytecodeInterpreter::tryCTICachePutByID):
23371 (JSC::BytecodeInterpreter::tryCTICacheGetByID):
23372 (JSC::BytecodeInterpreter::cti_op_convert_this):
23373 (JSC::BytecodeInterpreter::cti_op_end):
23374 (JSC::BytecodeInterpreter::cti_op_add):
23375 (JSC::BytecodeInterpreter::cti_op_pre_inc):
23376 (JSC::BytecodeInterpreter::cti_timeout_check):
23377 (JSC::BytecodeInterpreter::cti_register_file_check):
23378 (JSC::BytecodeInterpreter::cti_op_loop_if_less):
23379 (JSC::BytecodeInterpreter::cti_op_loop_if_lesseq):
23380 (JSC::BytecodeInterpreter::cti_op_new_object):
23381 (JSC::BytecodeInterpreter::cti_op_put_by_id):
23382 (JSC::BytecodeInterpreter::cti_op_put_by_id_second):
23383 (JSC::BytecodeInterpreter::cti_op_put_by_id_generic):
23384 (JSC::BytecodeInterpreter::cti_op_put_by_id_fail):
23385 (JSC::BytecodeInterpreter::cti_op_get_by_id):
23386 (JSC::BytecodeInterpreter::cti_op_get_by_id_second):
23387 (JSC::BytecodeInterpreter::cti_op_get_by_id_generic):
23388 (JSC::BytecodeInterpreter::cti_op_get_by_id_fail):
23389 (JSC::BytecodeInterpreter::cti_op_instanceof):
23390 (JSC::BytecodeInterpreter::cti_op_del_by_id):
23391 (JSC::BytecodeInterpreter::cti_op_mul):
23392 (JSC::BytecodeInterpreter::cti_op_new_func):
23393 (JSC::BytecodeInterpreter::cti_op_call_JSFunction):
23394 (JSC::BytecodeInterpreter::cti_op_call_arityCheck):
23395 (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall):
23396 (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall):
23397 (JSC::BytecodeInterpreter::cti_op_push_activation):
23398 (JSC::BytecodeInterpreter::cti_op_call_NotJSFunction):
23399 (JSC::BytecodeInterpreter::cti_op_create_arguments):
23400 (JSC::BytecodeInterpreter::cti_op_create_arguments_no_params):
23401 (JSC::BytecodeInterpreter::cti_op_tear_off_activation):
23402 (JSC::BytecodeInterpreter::cti_op_tear_off_arguments):
23403 (JSC::BytecodeInterpreter::cti_op_profile_will_call):
23404 (JSC::BytecodeInterpreter::cti_op_profile_did_call):
23405 (JSC::BytecodeInterpreter::cti_op_ret_scopeChain):
23406 (JSC::BytecodeInterpreter::cti_op_new_array):
23407 (JSC::BytecodeInterpreter::cti_op_resolve):
23408 (JSC::BytecodeInterpreter::cti_op_construct_JSConstruct):
23409 (JSC::BytecodeInterpreter::cti_op_construct_NotJSConstruct):
23410 (JSC::BytecodeInterpreter::cti_op_get_by_val):
23411 (JSC::BytecodeInterpreter::cti_op_resolve_func):
23412 (JSC::BytecodeInterpreter::cti_op_sub):
23413 (JSC::BytecodeInterpreter::cti_op_put_by_val):
23414 (JSC::BytecodeInterpreter::cti_op_put_by_val_array):
23415 (JSC::BytecodeInterpreter::cti_op_lesseq):
23416 (JSC::BytecodeInterpreter::cti_op_loop_if_true):
23417 (JSC::BytecodeInterpreter::cti_op_negate):
23418 (JSC::BytecodeInterpreter::cti_op_resolve_base):
23419 (JSC::BytecodeInterpreter::cti_op_resolve_skip):
23420 (JSC::BytecodeInterpreter::cti_op_resolve_global):
23421 (JSC::BytecodeInterpreter::cti_op_div):
23422 (JSC::BytecodeInterpreter::cti_op_pre_dec):
23423 (JSC::BytecodeInterpreter::cti_op_jless):
23424 (JSC::BytecodeInterpreter::cti_op_not):
23425 (JSC::BytecodeInterpreter::cti_op_jtrue):
23426 (JSC::BytecodeInterpreter::cti_op_post_inc):
23427 (JSC::BytecodeInterpreter::cti_op_eq):
23428 (JSC::BytecodeInterpreter::cti_op_lshift):
23429 (JSC::BytecodeInterpreter::cti_op_bitand):
23430 (JSC::BytecodeInterpreter::cti_op_rshift):
23431 (JSC::BytecodeInterpreter::cti_op_bitnot):
23432 (JSC::BytecodeInterpreter::cti_op_resolve_with_base):
23433 (JSC::BytecodeInterpreter::cti_op_new_func_exp):
23434 (JSC::BytecodeInterpreter::cti_op_mod):
23435 (JSC::BytecodeInterpreter::cti_op_less):
23436 (JSC::BytecodeInterpreter::cti_op_neq):
23437 (JSC::BytecodeInterpreter::cti_op_post_dec):
23438 (JSC::BytecodeInterpreter::cti_op_urshift):
23439 (JSC::BytecodeInterpreter::cti_op_bitxor):
23440 (JSC::BytecodeInterpreter::cti_op_new_regexp):
23441 (JSC::BytecodeInterpreter::cti_op_bitor):
23442 (JSC::BytecodeInterpreter::cti_op_call_eval):
23443 (JSC::BytecodeInterpreter::cti_op_throw):
23444 (JSC::BytecodeInterpreter::cti_op_get_pnames):
23445 (JSC::BytecodeInterpreter::cti_op_next_pname):
23446 (JSC::BytecodeInterpreter::cti_op_push_scope):
23447 (JSC::BytecodeInterpreter::cti_op_pop_scope):
23448 (JSC::BytecodeInterpreter::cti_op_typeof):
23449 (JSC::BytecodeInterpreter::cti_op_is_undefined):
23450 (JSC::BytecodeInterpreter::cti_op_is_boolean):
23451 (JSC::BytecodeInterpreter::cti_op_is_number):
23452 (JSC::BytecodeInterpreter::cti_op_is_string):
23453 (JSC::BytecodeInterpreter::cti_op_is_object):
23454 (JSC::BytecodeInterpreter::cti_op_is_function):
23455 (JSC::BytecodeInterpreter::cti_op_stricteq):
23456 (JSC::BytecodeInterpreter::cti_op_nstricteq):
23457 (JSC::BytecodeInterpreter::cti_op_to_jsnumber):
23458 (JSC::BytecodeInterpreter::cti_op_in):
23459 (JSC::BytecodeInterpreter::cti_op_push_new_scope):
23460 (JSC::BytecodeInterpreter::cti_op_jmp_scopes):
23461 (JSC::BytecodeInterpreter::cti_op_put_by_index):
23462 (JSC::BytecodeInterpreter::cti_op_switch_imm):
23463 (JSC::BytecodeInterpreter::cti_op_switch_char):
23464 (JSC::BytecodeInterpreter::cti_op_switch_string):
23465 (JSC::BytecodeInterpreter::cti_op_del_by_val):
23466 (JSC::BytecodeInterpreter::cti_op_put_getter):
23467 (JSC::BytecodeInterpreter::cti_op_put_setter):
23468 (JSC::BytecodeInterpreter::cti_op_new_error):
23469 (JSC::BytecodeInterpreter::cti_op_debug):
23470 (JSC::BytecodeInterpreter::cti_vm_throw):
23473 * VM/SamplingTool.cpp:
23474 (JSC::SamplingTool::run):
23475 * VM/SamplingTool.h:
23476 (JSC::SamplingTool::SamplingTool):
23477 * bytecompiler/CodeGenerator.cpp:
23478 (JSC::CodeGenerator::generate):
23479 (JSC::CodeGenerator::CodeGenerator):
23480 (JSC::CodeGenerator::emitOpcode):
23481 * debugger/DebuggerCallFrame.cpp:
23482 (JSC::DebuggerCallFrame::evaluate):
23485 * parser/Nodes.cpp:
23486 (JSC::ScopeNode::ScopeNode):
23487 * profiler/ProfileGenerator.cpp:
23488 (JSC::ProfileGenerator::addParentForConsoleStart):
23489 * runtime/ArrayPrototype.cpp:
23490 (JSC::arrayProtoFuncPop):
23491 (JSC::arrayProtoFuncPush):
23492 * runtime/Collector.cpp:
23493 (JSC::Heap::collect):
23494 * runtime/ExecState.h:
23495 (JSC::ExecState::interpreter):
23496 * runtime/FunctionPrototype.cpp:
23497 (JSC::functionProtoFuncApply):
23498 * runtime/Interpreter.cpp:
23499 (JSC::Interpreter::evaluate):
23500 * runtime/JSCell.h:
23501 * runtime/JSFunction.cpp:
23502 (JSC::JSFunction::call):
23503 (JSC::JSFunction::argumentsGetter):
23504 (JSC::JSFunction::callerGetter):
23505 (JSC::JSFunction::construct):
23506 * runtime/JSFunction.h:
23507 * runtime/JSGlobalData.cpp:
23508 (JSC::JSGlobalData::JSGlobalData):
23509 (JSC::JSGlobalData::~JSGlobalData):
23510 * runtime/JSGlobalData.h:
23511 * runtime/JSGlobalObject.cpp:
23512 (JSC::JSGlobalObject::~JSGlobalObject):
23513 (JSC::JSGlobalObject::setTimeoutTime):
23514 (JSC::JSGlobalObject::startTimeoutCheck):
23515 (JSC::JSGlobalObject::stopTimeoutCheck):
23516 (JSC::JSGlobalObject::mark):
23517 * runtime/JSGlobalObjectFunctions.cpp:
23518 (JSC::globalFuncEval):
23519 * runtime/JSString.h:
23520 * runtime/RegExp.cpp:
23521 (JSC::RegExp::RegExp):
23523 2008-11-15 Maciej Stachowiak <mjs@apple.com>
23525 Reviewed by Sam Weinig.
23527 - Remove SymbolTable from FunctionBodyNode and move it to CodeBlock
23529 It's not needed for functions that have never been executed, so no
23530 need to waste the memory. Saves ~4M on membuster after 30 pages.
23534 (JSC::Machine::retrieveArguments):
23535 * parser/Nodes.cpp:
23536 (JSC::EvalNode::generateCode):
23537 (JSC::FunctionBodyNode::generateCode):
23539 * runtime/JSActivation.h:
23540 (JSC::JSActivation::JSActivationData::JSActivationData):
23542 2008-11-14 Cameron Zwarich <zwarich@apple.com>
23544 Reviewed by Darin Adler.
23546 Bug 22259: Make all opcodes use eax as their final result register
23547 <https://bugs.webkit.org/show_bug.cgi?id=22259>
23549 Change one case of op_add (and the corresponding slow case) to use eax
23550 rather than edx. Also, change the order in which the two results of
23551 resolve_func and resolve_base are emitted so that the retrieved value is
23554 This gives no performance change on SunSpider or the V8 benchmark suite
23555 when run in either harness.
23558 (JSC::CTI::privateCompileMainPass):
23559 (JSC::CTI::privateCompileSlowCases):
23561 2008-11-14 Gavin Barraclough <barraclough@apple.com>
23563 Reviewed by Geoff Garen.
23565 Geoff has this wacky notion that emitGetArg and emitPutArg should be related to
23566 doing the same thing. Crazy.
23568 Rename the methods for accessing virtual registers to say 'VirtualRegister' in the
23569 name, and those for setting up the arguments for CTI methods to contain 'CTIArg'.
23572 (JSC::CTI::emitGetVirtualRegister):
23573 (JSC::CTI::emitGetVirtualRegisters):
23574 (JSC::CTI::emitPutCTIArgFromVirtualRegister):
23575 (JSC::CTI::emitPutCTIArg):
23576 (JSC::CTI::emitGetCTIArg):
23577 (JSC::CTI::emitPutCTIArgConstant):
23578 (JSC::CTI::emitPutVirtualRegister):
23579 (JSC::CTI::compileOpCallSetupArgs):
23580 (JSC::CTI::compileOpCallEvalSetupArgs):
23581 (JSC::CTI::compileOpConstructSetupArgs):
23582 (JSC::CTI::compileOpCall):
23583 (JSC::CTI::compileOpStrictEq):
23584 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
23585 (JSC::CTI::compileBinaryArithOp):
23586 (JSC::CTI::compileBinaryArithOpSlowCase):
23587 (JSC::CTI::privateCompileMainPass):
23588 (JSC::CTI::privateCompileSlowCases):
23589 (JSC::CTI::privateCompileCTIMachineTrampolines):
23592 2008-11-14 Greg Bolsinga <bolsinga@apple.com>
23594 Reviewed by Antti Koivisto
23596 Fix potential build break by adding StdLibExtras.h
23599 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
23601 2008-11-14 Gavin Barraclough <barraclough@apple.com>
23603 Reviewed by Geoff Garen.
23605 Generate less code for the slow cases of op_call and op_construct.
23606 https://bugs.webkit.org/show_bug.cgi?id=22272
23608 1% progression on v8 tests.
23611 (JSC::CTI::emitRetrieveArg):
23612 (JSC::CTI::emitNakedCall):
23613 (JSC::CTI::compileOpCallInitializeCallFrame):
23614 (JSC::CTI::compileOpCall):
23615 (JSC::CTI::privateCompileSlowCases):
23616 (JSC::CTI::privateCompileCTIMachineTrampolines):
23619 (JSC::getCallLinkInfoReturnLocation):
23620 (JSC::CodeBlock::getCallLinkInfo):
23622 (JSC::Machine::Machine):
23623 (JSC::Machine::cti_vm_dontLazyLinkCall):
23624 (JSC::Machine::cti_vm_lazyLinkCall):
23627 2008-11-14 Greg Bolsinga <bolsinga@apple.com>
23629 Reviewed by Darin Alder.
23631 https://bugs.webkit.org/show_bug.cgi?id=21810
23632 Remove use of static C++ objects that are destroyed at exit time (destructors)
23634 Create DEFINE_STATIC_LOCAL macro. Change static local objects to leak to avoid
23635 exit-time destructor. Update code that was changed to fix this issue that ran
23636 into a gcc bug (<rdar://problem/6354696> Codegen issue with C++ static reference
23637 in gcc build 5465). Also typdefs for template types needed to be added in some
23638 cases so the type could make it through the macro successfully.
23640 Basically code of the form:
23643 DEFINE_STATIC_LOCAL(T, m, ());
23645 Also any code of the form:
23646 static T& m = *new T;
23648 DEFINE_STATIC_LOCAL(T, m, ());
23650 * JavaScriptCore.xcodeproj/project.pbxproj:
23651 * wtf/MainThread.cpp:
23652 (WTF::mainThreadFunctionQueueMutex):
23653 (WTF::functionQueue):
23654 * wtf/StdLibExtras.h: Added. Add DEFINE_STATIC_LOCAL macro
23655 * wtf/ThreadingPthreads.cpp:
23656 (WTF::threadMapMutex):
23658 (WTF::identifierByPthreadHandle):
23660 2008-11-13 Sam Weinig <sam@webkit.org>
23662 Reviewed by Darin Adler
23664 Fix for https://bugs.webkit.org/show_bug.cgi?id=22269
23665 Reduce PropertyMap usage
23667 From observation of StructureID statistics, it became clear that many
23668 StructureID's were not being used as StructureIDs themselves, but rather
23669 only being necessary as links in the transition chain. Acknowledging this
23670 and that PropertyMaps stored in StructureIDs can be treated as caches, that
23671 is that they can be reconstructed on demand, it became clear that we could
23672 reduce the memory consumption of StructureIDs by only keeping PropertyMaps
23673 for the StructureIDs that need them the most.
23675 The specific strategy used to reduce the number of StructureIDs with
23676 PropertyMaps is to take the previous StructureIDs PropertyMap when initially
23677 transitioning (addPropertyTransition) from it and clearing out the pointer
23678 in the process. The next time we need to do the same transition, for instance
23679 repeated calls to the same constructor, we use the new addPropertyTransitionToExistingStructure
23680 first, which allows us not to need the PropertyMap to determine if the property
23681 exists already, since a transition to that property would require it not already
23682 be present in the StructureID. Should there be no transition, the PropertyMap
23683 can be constructed on demand (via materializePropertyMap) to determine if the put is a
23684 replace or a transition to a new StructureID.
23686 Reduces memory use on Membuster head test (30 pages open) by ~15MB.
23688 * JavaScriptCore.exp:
23689 * runtime/JSObject.h:
23690 (JSC::JSObject::putDirect): First use addPropertyTransitionToExistingStructure
23691 so that we can avoid building the PropertyMap on subsequent similar object
23693 * runtime/PropertyMapHashTable.h:
23694 (JSC::PropertyMapEntry::PropertyMapEntry): Add version of constructor which takes
23695 all values to be used when lazily building the PropertyMap.
23696 * runtime/StructureID.cpp:
23697 (JSC::StructureID::dumpStatistics): Add statistics on the number of StructureIDs
23699 (JSC::StructureID::StructureID): Rename m_cachedTransistionOffset to m_offset
23701 (JSC::nextPowerOf2):
23702 (JSC::sizeForKeyCount): Returns the expected size of a PropertyMap for a key count.
23703 (JSC::StructureID::materializePropertyMap): Builds the PropertyMap out of its previous pointer chain.
23704 (JSC::StructureID::addPropertyTransitionToExistingStructure): Only transitions if there is a
23705 an existing transition.
23706 (JSC::StructureID::addPropertyTransition): Instead of always copying the ProperyMap, try and take
23707 it from it previous pointer.
23708 (JSC::StructureID::removePropertyTransition): Simplify by calling toDictionaryTransition() to do
23710 (JSC::StructureID::changePrototypeTransition): Build the PropertyMap if necessary before transitioning
23711 because once you have transitioned, you will not be able to reconstruct it afterwards as there is no
23712 previous pointer, pinning the ProperyMap as well.
23713 (JSC::StructureID::getterSetterTransition): Ditto.
23714 (JSC::StructureID::toDictionaryTransition): Pin the PropertyMap so that it is not destroyed on further transitions.
23715 (JSC::StructureID::fromDictionaryTransition): We can only transition back from a dictionary transition if there
23716 are no deleted offsets.
23717 (JSC::StructureID::addPropertyWithoutTransition): Build PropertyMap on demands and pin.
23718 (JSC::StructureID::removePropertyWithoutTransition): Ditto.
23719 (JSC::StructureID::get): Build on demand.
23720 (JSC::StructureID::createPropertyMapHashTable): Add version of create that takes a size
23721 for on demand building.
23722 (JSC::StructureID::expandPropertyMapHashTable):
23723 (JSC::StructureID::rehashPropertyMapHashTable):
23724 (JSC::StructureID::getEnumerablePropertyNamesInternal): Build PropertyMap on demand.
23725 * runtime/StructureID.h:
23726 (JSC::StructureID::propertyStorageSize): Account for StructureIDs without PropertyMaps.
23727 (JSC::StructureID::isEmpty): Ditto.
23728 (JSC::StructureID::materializePropertyMapIfNecessary):
23729 (JSC::StructureID::get): Build PropertyMap on demand
23731 2008-11-14 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
23733 Reviewed by Simon Hausmann.
23735 <https://bugs.webkit.org/show_bug.cgi?id=21500>
23737 JavaScriptCore build with -O3 flag instead of -O2 (gcc).
23738 2.02% speedup on SunSpider (Qt-port on Linux)
23739 1.10% speedup on V8 (Qt-port on Linux)
23740 3.45% speedup on WindScorpion (Qt-port on Linux)
23742 * JavaScriptCore.pri:
23744 2008-11-14 Kristian Amlie <kristian.amlie@trolltech.com>
23746 Reviewed by Darin Adler.
23748 Compile fix for RVCT.
23750 In reality, it is two fixes:
23752 1. Remove typename. I believe typename can only be used when the named
23753 type depends on the template parameters, which it doesn't in this
23754 case, so I think this is more correct.
23755 2. Replace ::iterator scope with specialized typedef. This is to work
23756 around a bug in RVCT.
23758 https://bugs.webkit.org/show_bug.cgi?id=22260
23760 * wtf/ListHashSet.h:
23763 2008-11-14 Kristian Amlie <kristian.amlie@trolltech.com>
23765 Reviewed by Darin Adler.
23767 Compile fix for WINSCW.
23769 This fix doesn't protect against implicit conversions from bool to
23770 integers, but most likely that will be caught on another platform.
23772 https://bugs.webkit.org/show_bug.cgi?id=22260
23774 * wtf/PassRefPtr.h:
23775 (WTF::PassRefPtr::operator bool):
23777 (WTF::RefPtr::operator bool):
23779 2008-11-14 Cameron Zwarich <zwarich@apple.com>
23781 Reviewed by Darin Adler.
23783 Bug 22245: Move wtf/dtoa.h into the WTF namespace
23784 <https://bugs.webkit.org/show_bug.cgi?id=22245>
23786 Move wtf/dtoa.h into the WTF namespace from the JSC namespace. This
23787 introduces some ambiguities in name lookups, so I changed all uses of
23788 the functions in wtf/dtoa.h to explicitly state the namespace.
23790 * JavaScriptCore.exp:
23791 * parser/Lexer.cpp:
23793 * runtime/InitializeThreading.cpp:
23794 * runtime/JSGlobalObjectFunctions.cpp:
23796 * runtime/NumberPrototype.cpp:
23797 (JSC::integerPartNoExp):
23798 (JSC::numberProtoFuncToExponential):
23799 * runtime/UString.cpp:
23800 (JSC::concatenate):
23801 (JSC::UString::from):
23802 (JSC::UString::toDouble):
23806 2008-11-14 Cameron Zwarich <zwarich@apple.com>
23808 Reviewed by Maciej Stachowiak.
23810 Bug 22257: Enable redundant read optimizations for results generated by compileBinaryArithOp()
23811 <https://bugs.webkit.org/show_bug.cgi?id=22257>
23813 This shows no change in performance on either SunSpider or the V8
23814 benchmark suite, but it removes an ugly special case and allows for
23815 future optimizations to be implemented in a cleaner fashion.
23817 This patch was essentially given to me by Gavin Barraclough upon my
23818 request, but I did regression and performance testing so that he could
23819 work on something else.
23822 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): Move the final
23823 result to eax if it is not already there.
23824 (JSC::CTI::compileBinaryArithOp): Remove the killing of the final result
23825 register that disables the optimization.
23827 2008-11-13 Eric Seidel <eric@webkit.org>
23829 Reviewed by Adam Roben.
23831 Add a Scons-based build system for building
23832 the Chromium-Mac build of JavaScriptCore.
23833 https://bugs.webkit.org/show_bug.cgi?id=21991
23835 * JavaScriptCore.scons: Added.
23836 * SConstruct: Added.
23838 2008-11-13 Eric Seidel <eric@webkit.org>
23840 Reviewed by Adam Roben.
23842 Add PLATFORM(CHROMIUM) to the "we don't use cairo" blacklist
23843 until https://bugs.webkit.org/show_bug.cgi?id=22250 is fixed.
23847 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23849 Reviewed by Sam Weinig.
23851 In r38375 the 'jsc' shell was changed to improve teardown on quit. The
23852 main() function in jsc.cpp uses Structured Exception Handling, so Visual
23853 C++ emits a warning when destructors are used.
23855 In order to speculatively fix the Windows build, this patch changes that
23856 code to use explicit pointer manipulation and locking rather than smart
23862 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23864 Reviewed by Darin Adler.
23866 Bug 22246: Get arguments for opcodes together to eliminate more redundant memory reads
23867 <https://bugs.webkit.org/show_bug.cgi?id=22246>
23869 It is common for opcodes to read their first operand into eax and their
23870 second operand into edx. If the value intended for the second operand is
23871 in eax, we should first move eax to the register for the second operand
23872 and then read the first operand into eax.
23874 This is a 0.5% speedup on SunSpider and a 2.0% speedup on the V8
23875 benchmark suite when measured using the V8 harness.
23878 (JSC::CTI::emitGetArgs):
23879 (JSC::CTI::compileOpStrictEq):
23880 (JSC::CTI::compileBinaryArithOp):
23881 (JSC::CTI::privateCompileMainPass):
23882 (JSC::CTI::privateCompileSlowCases):
23885 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23887 Reviewed by Darin Adler.
23889 Bug 22238: Avoid unnecessary reads of temporaries when the target machine register is not eax
23890 <https://bugs.webkit.org/show_bug.cgi?id=22238>
23892 Enable the optimization of not reading a value back from memory that we
23893 just wrote when the target machine register is not eax. In order to do
23894 this, the code generation for op_put_global_var must be changed to
23895 read its argument into a register before overwriting eax.
23897 This is a 0.5% speedup on SunSpider and shows no change on the V8
23898 benchmark suite when run in either harness.
23901 (JSC::CTI::emitGetArg):
23902 (JSC::CTI::privateCompileMainPass):
23904 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23906 Reviewed by Alexey Proskuryakov.
23908 Perform teardown in the 'jsc' shell in order to suppress annoying and
23909 misleading leak messages. There is still a lone JSC::Node leaking when
23910 quit() is called, but hopefully that can be fixed as well.
23916 2008-11-13 Mike Pinkerton <pinkerton@chromium.org>
23918 Reviewed by Sam Weinig.
23920 Fix for https://bugs.webkit.org/show_bug.cgi?id=22087
23921 Need correct platform defines for Mac Chromium
23923 Set the appropriate platform defines for Mac Chromium, which is
23924 similar to PLATFORM(MAC), but isn't.
23928 2008-11-13 Maciej Stachowiak <mjs@apple.com>
23930 Reviewed by Cameron Zwarich.
23932 - remove immediate checks from native codegen for known non-immediate cases like "this"
23934 ~.5% speedup on v8 benchmarks
23936 In the future we can extend this model to remove all sorts of
23937 typechecks based on local type info or type inference.
23939 I also added an assertion to verify that all slow cases linked as
23940 many slow case jumps as the corresponding fast case generated, and
23941 fixed the pre-existing cases where this was not true.
23944 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
23945 (JSC::CTI::linkSlowCaseIfNotJSCell):
23946 (JSC::CTI::compileBinaryArithOp):
23947 (JSC::CTI::compileBinaryArithOpSlowCase):
23948 (JSC::CTI::privateCompileMainPass):
23949 (JSC::CTI::privateCompileSlowCases):
23952 (JSC::CodeBlock::isKnownNotImmediate):
23954 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23956 Reviewed by Maciej Stachowiak.
23958 Bug 21943: Avoid needless reads of temporary values in CTI code
23959 <https://bugs.webkit.org/show_bug.cgi?id=21943>
23961 If an opcode needs to load a virtual register and a previous opcode left
23962 the contents of that virtual register in a machine register, use the
23963 value in the machine register rather than getting it from memory.
23965 In order to perform this optimization, it is necessary to know the
23966 jump tagets in the CodeBlock. For temporaries, the only problematic
23967 jump targets are binary logical operators and the ternary conditional
23968 operator. However, if this optimization were to be extended to local
23969 variable registers as well, other jump targets would need to be
23970 included, like switch statement cases and the beginnings of catch
23973 This optimization also requires that the fast case and the slow case
23974 of an opcode use emitPutResult() on the same register, which was chosen
23975 to be eax, as that is the register into which we read the first operand
23976 of opcodes. In order to make this the case, we needed to add some mov
23977 instructions to the slow cases of some instructions.
23979 This optimizaton is not applied whenever compileBinaryArithOp() is used
23980 to compile an opcode, because different machine registers may be used to
23981 store the final result. It seems possible to rewrite the code generation
23982 in compileBinaryArithOp() to allow for this optimization.
23984 This optimization is also not applied when generating slow cases,
23985 because some fast cases overwrite the value of eax before jumping to the
23986 slow case. In the future, it may be possible to apply this optimization
23987 to slow cases as well, but it did not seem to be a speedup when testing
23988 an early version of this patch.
23990 This is a 1.0% speedup on SunSpider and a 6.3% speedup on the V8
23994 (JSC::CTI::killLastResultRegister):
23995 (JSC::CTI::emitGetArg):
23996 (JSC::CTI::emitGetPutArg):
23997 (JSC::CTI::emitGetCTIParam):
23998 (JSC::CTI::emitGetFromCallFrameHeader):
23999 (JSC::CTI::emitPutResult):
24000 (JSC::CTI::emitCTICall):
24002 (JSC::CTI::compileOpCall):
24003 (JSC::CTI::compileOpStrictEq):
24004 (JSC::CTI::emitSlowScriptCheck):
24005 (JSC::CTI::compileBinaryArithOp):
24006 (JSC::CTI::privateCompileMainPass):
24007 (JSC::CTI::privateCompileSlowCases):
24008 (JSC::CTI::privateCompileGetByIdProto):
24009 (JSC::CTI::privateCompilePatchGetArrayLength):
24012 (JSC::CodeBlock::isTemporaryRegisterIndex):
24013 * bytecompiler/CodeGenerator.cpp:
24014 (JSC::CodeGenerator::emitLabel):
24016 2008-11-12 Alp Toker <alp@nuanti.com>
24018 autotools build system fix-up only. Add FloatQuad.h to the source
24019 lists and sort them.
24023 2008-11-12 Geoffrey Garen <ggaren@apple.com>
24025 Reviewed by Sam Weinig.
24027 Fixed https://bugs.webkit.org/show_bug.cgi?id=22192
24028 +37 failures in fast/profiler
24030 along with Darin's review comments in
24031 https://bugs.webkit.org/show_bug.cgi?id=22174
24032 Simplified op_call by nixing its responsibility for moving the value of
24033 "this" into the first argument slot
24036 (JSC::returnToThrowTrampoline):
24037 (JSC::throwStackOverflowError):
24038 (JSC::Machine::cti_register_file_check):
24039 (JSC::Machine::cti_op_call_arityCheck):
24040 (JSC::Machine::cti_vm_throw): Moved the throw logic into a function, since
24041 functions are better than macros.
24043 * bytecompiler/CodeGenerator.cpp:
24044 (JSC::CodeGenerator::emitCall):
24045 (JSC::CodeGenerator::emitConstruct): Ensure that the function register
24046 is preserved if profiling is enabled, since the profiler uses that
24049 * runtime/JSGlobalData.h: Renamed throwReturnAddress to exceptionLocation,
24050 because I had a hard time understanding what "throwReturnAddress" meant.
24052 2008-11-12 Geoffrey Garen <ggaren@apple.com>
24054 Reviewed by Sam Weinig.
24056 Roll in r38322, now that test failures have been fixed.
24059 (JSC::CTI::compileOpCallSetupArgs):
24060 (JSC::CTI::compileOpCallEvalSetupArgs):
24061 (JSC::CTI::compileOpConstructSetupArgs):
24062 (JSC::CTI::compileOpCall):
24063 (JSC::CTI::privateCompileMainPass):
24064 (JSC::CTI::privateCompileSlowCases):
24066 * VM/CodeBlock.cpp:
24067 (JSC::CodeBlock::dump):
24069 (JSC::Machine::callEval):
24070 (JSC::Machine::dumpCallFrame):
24071 (JSC::Machine::dumpRegisters):
24072 (JSC::Machine::execute):
24073 (JSC::Machine::privateExecute):
24074 (JSC::Machine::cti_register_file_check):
24075 (JSC::Machine::cti_op_call_arityCheck):
24076 (JSC::Machine::cti_op_call_NotJSFunction):
24077 (JSC::Machine::cti_op_construct_JSConstruct):
24078 (JSC::Machine::cti_op_construct_NotJSConstruct):
24079 (JSC::Machine::cti_op_call_eval):
24080 (JSC::Machine::cti_vm_throw):
24082 * bytecompiler/CodeGenerator.cpp:
24083 (JSC::CodeGenerator::emitCall):
24084 (JSC::CodeGenerator::emitCallEval):
24085 (JSC::CodeGenerator::emitConstruct):
24086 * bytecompiler/CodeGenerator.h:
24087 * parser/Nodes.cpp:
24088 (JSC::EvalFunctionCallNode::emitCode):
24089 (JSC::FunctionCallValueNode::emitCode):
24090 (JSC::FunctionCallResolveNode::emitCode):
24091 (JSC::FunctionCallBracketNode::emitCode):
24092 (JSC::FunctionCallDotNode::emitCode):
24094 (JSC::ScopeNode::neededConstants):
24096 2008-11-12 Gavin Barraclough <barraclough@apple.com>
24098 Reviewed by Cameron Zwarich.
24100 Fix for https://bugs.webkit.org/show_bug.cgi?id=22201
24101 Integer conversion in array.length was safe signed values,
24102 but the length is unsigned.
24105 (JSC::CTI::privateCompilePatchGetArrayLength):
24107 2008-11-12 Cameron Zwarich <zwarich@apple.com>
24109 Rubber-stamped by Mark Rowe.
24111 Roll out r38322 due to test failures on the bots.
24114 (JSC::CTI::compileOpCallSetupArgs):
24115 (JSC::CTI::compileOpCall):
24116 (JSC::CTI::privateCompileMainPass):
24117 (JSC::CTI::privateCompileSlowCases):
24119 * VM/CodeBlock.cpp:
24120 (JSC::CodeBlock::dump):
24122 (JSC::Machine::callEval):
24123 (JSC::Machine::dumpCallFrame):
24124 (JSC::Machine::dumpRegisters):
24125 (JSC::Machine::execute):
24126 (JSC::Machine::privateExecute):
24127 (JSC::Machine::throwStackOverflowPreviousFrame):
24128 (JSC::Machine::cti_register_file_check):
24129 (JSC::Machine::cti_op_call_arityCheck):
24130 (JSC::Machine::cti_op_call_NotJSFunction):
24131 (JSC::Machine::cti_op_construct_JSConstruct):
24132 (JSC::Machine::cti_op_construct_NotJSConstruct):
24133 (JSC::Machine::cti_op_call_eval):
24134 (JSC::Machine::cti_vm_throw):
24136 * bytecompiler/CodeGenerator.cpp:
24137 (JSC::CodeGenerator::emitCall):
24138 (JSC::CodeGenerator::emitCallEval):
24139 (JSC::CodeGenerator::emitConstruct):
24140 * bytecompiler/CodeGenerator.h:
24141 * parser/Nodes.cpp:
24142 (JSC::EvalFunctionCallNode::emitCode):
24143 (JSC::FunctionCallValueNode::emitCode):
24144 (JSC::FunctionCallResolveNode::emitCode):
24145 (JSC::FunctionCallBracketNode::emitCode):
24146 (JSC::FunctionCallDotNode::emitCode):
24148 (JSC::ScopeNode::neededConstants):
24150 2008-11-11 Geoffrey Garen <ggaren@apple.com>
24152 Reviewed by Darin Adler.
24154 Fixed https://bugs.webkit.org/show_bug.cgi?id=22174
24155 Simplified op_call by nixing its responsibility for moving the value of
24156 "this" into the first argument slot.
24158 Instead, the caller emits an explicit load or mov instruction, or relies
24159 on implicit knowledge that "this" is already in the first argument slot.
24160 As a result, two operands to op_call are gone: firstArg and thisVal.
24162 SunSpider and v8 tests show no change in bytecode or CTI.
24165 (JSC::CTI::compileOpCallSetupArgs):
24166 (JSC::CTI::compileOpCallEvalSetupArgs):
24167 (JSC::CTI::compileOpConstructSetupArgs): Split apart these three versions
24168 of setting up arguments to op_call, because they're more different than
24169 they are the same -- even more so with this patch.
24171 (JSC::CTI::compileOpCall): Updated for the fact that op_construct doesn't
24172 match op_call anymore.
24174 (JSC::CTI::privateCompileMainPass):
24175 (JSC::CTI::privateCompileSlowCases): Merged a few call cases. Updated
24176 for changes mentioned above.
24180 * VM/CodeBlock.cpp:
24181 (JSC::CodeBlock::dump): Updated for new bytecode format of call / construct.
24184 (JSC::Machine::callEval): Updated for new bytecode format of call / construct.
24186 (JSC::Machine::dumpCallFrame):
24187 (JSC::Machine::dumpRegisters): Simplified these debugging functions,
24188 taking advantage of the new call frame layout.
24190 (JSC::Machine::execute): Fixed up the eval version of execute to be
24191 friendlier to calls in the new format.
24193 (JSC::Machine::privateExecute): Implemented the new call format in
24196 (JSC::Machine::cti_op_call_NotJSFunction):
24197 (JSC::Machine::cti_op_construct_JSConstruct):
24198 (JSC::Machine::cti_op_construct_NotJSConstruct):
24199 (JSC::Machine::cti_op_call_eval): Updated CTI helpers to match the new
24202 Fixed a latent bug in stack overflow checking that is now hit because
24203 the register layout has changed a bit -- namely: when throwing a stack
24204 overflow exception inside an op_call helper, we need to account for the
24205 fact that the current call frame is only half-constructed, and use the
24206 parent call frame instead.
24210 * bytecompiler/CodeGenerator.cpp:
24211 (JSC::CodeGenerator::emitCall):
24212 (JSC::CodeGenerator::emitCallEval):
24213 (JSC::CodeGenerator::emitConstruct):
24214 * bytecompiler/CodeGenerator.h: Updated codegen to match the new call
24217 * parser/Nodes.cpp:
24218 (JSC::EvalFunctionCallNode::emitCode):
24219 (JSC::FunctionCallValueNode::emitCode):
24220 (JSC::FunctionCallResolveNode::emitCode):
24221 (JSC::FunctionCallBracketNode::emitCode):
24222 (JSC::FunctionCallDotNode::emitCode):
24224 (JSC::ScopeNode::neededConstants): ditto
24226 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24228 Reviewed by Geoff Garen.
24230 Remove an unused forwarding header for a file that no longer exists.
24232 * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
24234 2008-11-11 Mark Rowe <mrowe@apple.com>
24236 Fix broken dependencies building JavaScriptCore on a freezing cold cat, caused
24237 by failure to update all instances of "kjs" to their new locations.
24239 * JavaScriptCore.xcodeproj/project.pbxproj:
24241 2008-11-11 Alexey Proskuryakov <ap@webkit.org>
24243 Rubber-stamped by Adam Roben.
24245 * wtf/AVLTree.h: (WTF::AVLTree::Iterator::start_iter):
24246 Fix indentation a little more.
24248 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24250 Rubber-stamped by Sam Weinig.
24252 Clean up EvalCodeCache to match our coding style a bit more.
24254 * VM/EvalCodeCache.h:
24255 (JSC::EvalCodeCache::get):
24257 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24259 Rubber-stamped by Sam Weinig.
24261 Bug 22179: Move EvalCodeCache from CodeBlock.h into its own file
24262 <https://bugs.webkit.org/show_bug.cgi?id=22179>
24265 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
24266 * JavaScriptCore.xcodeproj/project.pbxproj:
24268 * VM/EvalCodeCache.h: Copied from VM/CodeBlock.h.
24271 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24273 Reviewed by Sam Weinig.
24275 Remove the 'm_' prefix from the fields of the SwitchRecord struct.
24278 (JSC::CTI::privateCompile):
24280 (JSC::SwitchRecord):
24281 (JSC::SwitchRecord::SwitchRecord):
24283 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24285 Rubber-stamped by Sam Weinig.
24287 Make asInteger() a static function so that it has internal linkage.
24292 2008-11-11 Maciej Stachowiak <mjs@apple.com>
24294 Reviewed by Mark Rowe.
24296 - shrink CodeBlock and AST related Vectors to exact fit (5-10M savings on membuster test)
24298 No perf regression combined with the last patch (each seems like a small regression individually)
24300 * bytecompiler/CodeGenerator.cpp:
24301 (JSC::CodeGenerator::generate):
24303 (JSC::SourceElements::releaseContentsIntoVector):
24305 (WTF::Vector::shrinkToFit):
24307 2008-11-11 Maciej Stachowiak <mjs@apple.com>
24309 Reviewed by Mark Rowe.
24311 - remove inline capacity from declaration stacks (15M savings on membuster test)
24313 No perf regression on SunSpider or V8 test combined with other upcoming memory improvement patch.
24315 * JavaScriptCore.exp:
24318 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24320 Reviewed by Oliver Hunt.
24322 While r38286 removed the need for the m_callFrame member variable of
24323 CTI, it should be also be removed.
24327 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24329 Reviewed by Oliver Hunt.
24331 Make CTI::asInteger() a non-member function, since it needs no access to
24332 any of CTI's member variables.
24338 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24340 Reviewed by Maciej Stachowiak.
24342 Use 'value' instead of 'js' in CTI as a name for JSValue* to match our
24343 usual convention elsewhere.
24346 (JSC::CTI::emitGetArg):
24347 (JSC::CTI::emitGetPutArg):
24348 (JSC::CTI::getConstantImmediateNumericArg):
24349 (JSC::CTI::printOpcodeOperandTypes):
24351 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24353 Reviewed by Maciej Stachowiak.
24355 Make CTI::getConstant() a member function of CodeBlock instead.
24358 (JSC::CTI::emitGetArg):
24359 (JSC::CTI::emitGetPutArg):
24360 (JSC::CTI::getConstantImmediateNumericArg):
24361 (JSC::CTI::printOpcodeOperandTypes):
24362 (JSC::CTI::privateCompileMainPass):
24365 (JSC::CodeBlock::getConstant):
24367 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24369 Reviewed by Sam Weinig.
24371 Rename CodeBlock::isConstant() to isConstantRegisterIndex().
24374 (JSC::CTI::emitGetArg):
24375 (JSC::CTI::emitGetPutArg):
24376 (JSC::CTI::getConstantImmediateNumericArg):
24377 (JSC::CTI::printOpcodeOperandTypes):
24378 (JSC::CTI::privateCompileMainPass):
24380 (JSC::CodeBlock::isConstantRegisterIndex):
24381 * bytecompiler/CodeGenerator.cpp:
24382 (JSC::CodeGenerator::emitEqualityOp):
24384 2008-11-10 Gavin Barraclough <barraclough@apple.com>
24386 Build fix for non-CTI builds.
24389 (JSC::Machine::initialize):
24391 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24393 Reviewed by Sam Weinig.
24395 Remove the unused labels member variable of CodeBlock.
24399 (JSC::LabelID::setLocation):
24401 2008-11-10 Gavin Barraclough <barraclough@apple.com>
24403 Reviewed by Cameron Zwarich.
24405 Batch compile the set of static trampolines at the point Machine is constructed, using a single allocation.
24406 Refactor out m_callFrame from CTI, since this is only needed to access the global data (instead store a
24407 pointer to the global data directly, since this is available at the point the Machine is constructed).
24408 Add a method to align the code buffer, to allow JIT generation for multiple trampolines in one block.
24411 (JSC::CTI::getConstant):
24412 (JSC::CTI::emitGetArg):
24413 (JSC::CTI::emitGetPutArg):
24414 (JSC::CTI::getConstantImmediateNumericArg):
24415 (JSC::CTI::printOpcodeOperandTypes):
24417 (JSC::CTI::compileBinaryArithOp):
24418 (JSC::CTI::privateCompileMainPass):
24419 (JSC::CTI::privateCompileGetByIdProto):
24420 (JSC::CTI::privateCompileGetByIdChain):
24421 (JSC::CTI::privateCompileCTIMachineTrampolines):
24422 (JSC::CTI::freeCTIMachineTrampolines):
24424 (JSC::CTI::compile):
24425 (JSC::CTI::compileGetByIdSelf):
24426 (JSC::CTI::compileGetByIdProto):
24427 (JSC::CTI::compileGetByIdChain):
24428 (JSC::CTI::compilePutByIdReplace):
24429 (JSC::CTI::compilePutByIdTransition):
24430 (JSC::CTI::compileCTIMachineTrampolines):
24431 (JSC::CTI::compilePatchGetArrayLength):
24433 (JSC::Machine::initialize):
24434 (JSC::Machine::~Machine):
24435 (JSC::Machine::execute):
24436 (JSC::Machine::tryCTICachePutByID):
24437 (JSC::Machine::tryCTICacheGetByID):
24438 (JSC::Machine::cti_op_call_JSFunction):
24439 (JSC::Machine::cti_vm_lazyLinkCall):
24441 * masm/X86Assembler.h:
24442 (JSC::JITCodeBuffer::isAligned):
24443 (JSC::X86Assembler::):
24444 (JSC::X86Assembler::align):
24445 * runtime/JSGlobalData.cpp:
24446 (JSC::JSGlobalData::JSGlobalData):
24448 2008-11-10 Maciej Stachowiak <mjs@apple.com>
24450 Reviewed by Antti Koivisto.
24452 - Make Vector::clear() release the Vector's memory (1MB savings on membuster)
24453 https://bugs.webkit.org/show_bug.cgi?id=22170
24456 (WTF::VectorBufferBase::deallocateBuffer): Set capacity to 0 as
24457 well as size, otherwise shrinking capacity to 0 can fail to reset
24458 the capacity and thus cause a future crash.
24459 (WTF::Vector::~Vector): Shrink size not capacity; we only need
24460 to call destructors, the buffer will be freed anyway.
24461 (WTF::Vector::clear): Change this to shrinkCapacity(0), not just shrink(0).
24462 (WTF::::shrinkCapacity): Use shrink() instead of resize() for case where
24463 the size is greater than the new capacity, to work with types that have no
24464 default constructor.
24466 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24468 Reviewed by Maciej Stachowiak.
24470 Split multiple definitions into separate lines.
24473 (JSC::CTI::compileBinaryArithOp):
24475 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24477 Reviewed by Geoff Garen.
24479 Bug 22162: Remove cachedValueGetter from the JavaScriptCore API implementation
24480 <https://bugs.webkit.org/show_bug.cgi?id=22162>
24482 There is no more need for the cachedValueGetter hack now that we have
24483 PropertySlot::setValue(), so we should remove it.
24485 * API/JSCallbackObject.h:
24486 * API/JSCallbackObjectFunctions.h:
24487 (JSC::::getOwnPropertySlot):
24489 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24491 Reviewed by Darin Adler.
24493 Bug 22152: Remove asObject() call from JSCallbackObject::getOwnPropertySlot()
24494 <https://bugs.webkit.org/show_bug.cgi?id=22152>
24496 With the recent change to adopt asType() style cast functions with
24497 assertions instead of static_casts in many places, the assertion for
24498 the asObject() call in JSCallbackObject::getOwnPropertySlot() has been
24499 failing when using any nontrivial client of the JavaScriptCore API.
24500 The cast isn't even necessary to call slot.setCustom(), so it should
24503 * API/JSCallbackObjectFunctions.h:
24504 (JSC::JSCallbackObject::getOwnPropertySlot):
24506 2008-11-10 Alexey Proskuryakov <ap@webkit.org>
24508 Reviewed by Adam Roben.
24510 A few coding style fixes for AVLTree.
24512 * wtf/AVLTree.h: Moved to WTF namespace, Removed "KJS_" from include guards.
24513 (WTF::AVLTree::Iterator::start_iter): Fixed indentation
24515 * runtime/JSArray.cpp: Added "using namepace WTF".
24517 2008-11-09 Cameron Zwarich <zwarich@apple.com>
24521 Speculatively fix the non-AllInOne build.
24523 * runtime/NativeErrorConstructor.cpp:
24525 2008-11-09 Darin Adler <darin@apple.com>
24527 Reviewed by Tim Hatcher.
24529 - https://bugs.webkit.org/show_bug.cgi?id=22149
24530 remove unused code from the parser
24532 * AllInOneFile.cpp: Removed nodes2string.cpp.
24533 * GNUmakefile.am: Ditto.
24534 * JavaScriptCore.exp: Ditto.
24535 * JavaScriptCore.pri: Ditto.
24536 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
24537 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
24538 * JavaScriptCoreSources.bkl: Ditto.
24540 * VM/CodeBlock.h: Added include.
24542 * VM/Machine.cpp: (JSC::Machine::execute): Use the types from
24543 DeclarationStacks as DeclarationStacks:: rather than Node:: since
24544 "Node" really has little to do with it.
24545 * bytecompiler/CodeGenerator.cpp:
24546 (JSC::CodeGenerator::CodeGenerator): Ditto.
24549 (Options::Options): Removed prettyPrint option.
24550 (runWithScripts): Ditto.
24551 (printUsageStatement): Ditto.
24552 (parseArguments): Ditto.
24555 * parser/Grammar.y: Removed use of obsolete ImmediateNumberNode.
24557 * parser/Nodes.cpp:
24558 (JSC::ThrowableExpressionData::emitThrowError): Use inline functions
24559 instead of direct member access for ThrowableExpressionData values.
24560 (JSC::BracketAccessorNode::emitCode): Ditto.
24561 (JSC::DotAccessorNode::emitCode): Ditto.
24562 (JSC::NewExprNode::emitCode): Ditto.
24563 (JSC::EvalFunctionCallNode::emitCode): Ditto.
24564 (JSC::FunctionCallValueNode::emitCode): Ditto.
24565 (JSC::FunctionCallResolveNode::emitCode): Ditto.
24566 (JSC::FunctionCallBracketNode::emitCode): Ditto.
24567 (JSC::FunctionCallDotNode::emitCode): Ditto.
24568 (JSC::PostfixResolveNode::emitCode): Ditto.
24569 (JSC::PostfixBracketNode::emitCode): Ditto.
24570 (JSC::PostfixDotNode::emitCode): Ditto.
24571 (JSC::DeleteResolveNode::emitCode): Ditto.
24572 (JSC::DeleteBracketNode::emitCode): Ditto.
24573 (JSC::DeleteDotNode::emitCode): Ditto.
24574 (JSC::PrefixResolveNode::emitCode): Ditto.
24575 (JSC::PrefixBracketNode::emitCode): Ditto.
24576 (JSC::PrefixDotNode::emitCode): Ditto.
24577 (JSC::ThrowableBinaryOpNode::emitCode): Ditto.
24578 (JSC::InstanceOfNode::emitCode): Ditto.
24579 (JSC::ReadModifyResolveNode::emitCode): Ditto.
24580 (JSC::AssignResolveNode::emitCode): Ditto.
24581 (JSC::AssignDotNode::emitCode): Ditto.
24582 (JSC::ReadModifyDotNode::emitCode): Ditto.
24583 (JSC::AssignBracketNode::emitCode): Ditto.
24584 (JSC::ReadModifyBracketNode::emitCode): Ditto.
24585 (JSC::statementListEmitCode): Take a const StatementVector instead
24586 of a non-const one. Also removed unused statementListPushFIFO.
24587 (JSC::ForInNode::emitCode): Inline functions instead of member access.
24588 (JSC::ThrowNode::emitCode): Ditto.
24589 (JSC::EvalNode::emitCode): Ditto.
24590 (JSC::FunctionBodyNode::emitCode): Ditto.
24591 (JSC::ProgramNode::emitCode): Ditto.
24593 * parser/Nodes.h: Removed unused includes and forward declarations.
24594 Removed Precedence enum. Made many more members private instead of
24595 protected or public. Removed unused NodeStack typedef. Moved the
24596 VarStack and FunctionStack typedefs from Node to ScopeNode. Made
24597 Node::emitCode pure virtual and changed classes that don't emit
24598 any code to inherit from ParserRefCounted rather than Node.
24599 Moved isReturnNode from Node to StatementNode. Removed the
24600 streamTo, precedence, and needsParensIfLeftmost functions from
24601 all classes. Removed the ImmediateNumberNode class and make
24602 NumberNode::setValue nonvirtual.
24604 * parser/nodes2string.cpp: Removed.
24606 2008-11-09 Darin Adler <darin@apple.com>
24608 Reviewed by Sam Weinig and Maciej Stachowiak.
24609 Includes some work done by Chris Brichford.
24611 - fix https://bugs.webkit.org/show_bug.cgi?id=14886
24612 Stack overflow due to deeply nested parse tree doing repeated string concatentation
24614 Test: fast/js/large-expressions.html
24616 1) Code generation is recursive, so takes stack proportional to the complexity
24617 of the source code expression. Fixed by setting an arbitrary recursion limit
24620 2) Destruction of the syntax tree was recursive. Fixed by introducing a
24621 non-recursive mechanism for destroying the tree.
24623 * bytecompiler/CodeGenerator.cpp:
24624 (JSC::CodeGenerator::CodeGenerator): Initialize depth to 0.
24625 (JSC::CodeGenerator::emitThrowExpressionTooDeepException): Added. Emits the code
24626 to throw a "too deep" exception.
24627 * bytecompiler/CodeGenerator.h:
24628 (JSC::CodeGenerator::emitNode): Check depth and emit an exception if we exceed
24631 * parser/Nodes.cpp:
24632 (JSC::NodeReleaser::releaseAllNodes): Added. To be called inside node destructors
24633 to avoid recursive calls to destructors for nodes inside this one.
24634 (JSC::NodeReleaser::release): Added. To be called inside releaseNodes functions.
24635 Also added releaseNodes functions and calls to releaseAllNodes inside destructors
24636 for each class derived from Node that has RefPtr to other nodes.
24637 (JSC::NodeReleaser::adopt): Added. Used by the release function.
24638 (JSC::NodeReleaser::adoptFunctionBodyNode): Added.
24640 * parser/Nodes.h: Added declarations of releaseNodes and destructors in all classes
24641 that needed it. Eliminated use of ListRefPtr and releaseNext, which are the two parts
24642 of an older solution to the non-recursive destruction problem that works only for
24643 lists, whereas the new solution works for other graphs. Changed ReverseBinaryOpNode
24644 to use BinaryOpNode as a base class to avoid some duplicated code.
24646 2008-11-08 Kevin Ollivier <kevino@theolliviers.com>
24648 wx build fixes after addition of JSCore parser and bycompiler dirs. Also cleanup
24649 the JSCore Bakefile's group names to be consistent.
24651 * JavaScriptCoreSources.bkl:
24654 2008-11-07 Cameron Zwarich <zwarich@apple.com>
24656 Reviewed by Geoff Garen.
24658 Bug 21801: REGRESSION (r37821): YUI date formatting JavaScript puts the letter 'd' in place of the day
24659 <https://bugs.webkit.org/show_bug.cgi?id=21801>
24661 Fix the constant register check in the 'typeof' optimization in
24662 CodeGenerator, which was completely broken after r37821.
24664 * bytecompiler/CodeGenerator.cpp:
24665 (JSC::CodeGenerator::emitEqualityOp):
24667 2008-11-07 Cameron Zwarich <zwarich@apple.com>
24669 Reviewed by Geoff Garen.
24671 Bug 22129: Move CTI::isConstant() to CodeBlock
24672 <https://bugs.webkit.org/show_bug.cgi?id=22129>
24675 (JSC::CTI::emitGetArg):
24676 (JSC::CTI::emitGetPutArg):
24677 (JSC::CTI::getConstantImmediateNumericArg):
24678 (JSC::CTI::printOpcodeOperandTypes):
24679 (JSC::CTI::privateCompileMainPass):
24682 (JSC::CodeBlock::isConstant):
24684 2008-11-07 Alp Toker <alp@nuanti.com>
24686 autotools fix. Always use the configured perl binary (which may be
24687 different to the one in $PATH) when generating sources.
24691 2008-11-07 Cameron Zwarich <zwarich@apple.com>
24695 Change grammar.cpp to Grammar.cpp and grammar.h to Grammar.h in several
24698 * DerivedSources.make:
24699 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
24700 * JavaScriptCoreSources.bkl:
24702 2008-11-07 Alp Toker <alp@nuanti.com>
24704 More grammar.cpp -> Grammar.cpp build fixes.
24706 * AllInOneFile.cpp:
24709 2008-11-07 Simon Hausmann <hausmann@webkit.org>
24711 Fix the build on case-sensitive file systems. grammar.y was renamed to
24712 Grammar.y but Lexer.cpp includes grammar.h. The build bots didn't
24713 notice this change because of stale files.
24715 * parser/Lexer.cpp:
24717 2008-11-07 Cameron Zwarich <zwarich@apple.com>
24719 Reviewed by Alexey Proskuryakov.
24721 Rename the m_nextGlobal, m_nextParameter, and m_nextConstant member
24722 variables of CodeGenerator to m_nextGlobalIndex, m_nextParameterIndex,
24723 and m_nextConstantIndex respectively. This is to distinguish these from
24724 member variables like m_lastConstant, which are actually RefPtrs to
24727 * bytecompiler/CodeGenerator.cpp:
24728 (JSC::CodeGenerator::addGlobalVar):
24729 (JSC::CodeGenerator::allocateConstants):
24730 (JSC::CodeGenerator::CodeGenerator):
24731 (JSC::CodeGenerator::addParameter):
24732 (JSC::CodeGenerator::addConstant):
24733 * bytecompiler/CodeGenerator.h:
24735 2008-11-06 Gavin Barraclough barraclough@apple.com
24737 Reviewed by Oliver Hunt.
24739 Do not make a cti_* call to perform an op_call unless either:
24740 (1) The codeblock for the function body has not been generated.
24741 (2) The number of arguments passed does not match the callee arity.
24743 ~1% progression on sunspider --v8
24746 (JSC::CTI::compileOpCallInitializeCallFrame):
24747 (JSC::CTI::compileOpCall):
24748 (JSC::CTI::privateCompileSlowCases):
24751 (JSC::Machine::cti_op_call_JSFunction):
24752 (JSC::Machine::cti_op_call_arityCheck):
24753 (JSC::Machine::cti_op_construct_JSConstruct):
24757 2008-11-06 Cameron Zwarich <zwarich@apple.com>
24759 Reviewed by Geoff Garen.
24761 Move the remaining files in the kjs subdirectory of JavaScriptCore to
24762 a new parser subdirectory, and remove the kjs subdirectory entirely.
24764 * AllInOneFile.cpp:
24765 * DerivedSources.make:
24767 * JavaScriptCore.pri:
24768 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
24769 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
24770 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
24771 * JavaScriptCore.xcodeproj/project.pbxproj:
24772 * JavaScriptCoreSources.bkl:
24774 * VM/ExceptionHelpers.cpp:
24775 * VM/SamplingTool.h:
24776 * bytecompiler/CodeGenerator.h:
24780 * kjs/NodeInfo.h: Removed.
24781 * kjs/Parser.cpp: Removed.
24782 * kjs/Parser.h: Removed.
24783 * kjs/ResultType.h: Removed.
24784 * kjs/SourceCode.h: Removed.
24785 * kjs/SourceProvider.h: Removed.
24786 * kjs/grammar.y: Removed.
24787 * kjs/keywords.table: Removed.
24788 * kjs/lexer.cpp: Removed.
24789 * kjs/lexer.h: Removed.
24790 * kjs/nodes.cpp: Removed.
24791 * kjs/nodes.h: Removed.
24792 * kjs/nodes2string.cpp: Removed.
24794 * parser/Grammar.y: Copied from kjs/grammar.y.
24795 * parser/Keywords.table: Copied from kjs/keywords.table.
24796 * parser/Lexer.cpp: Copied from kjs/lexer.cpp.
24797 * parser/Lexer.h: Copied from kjs/lexer.h.
24798 * parser/NodeInfo.h: Copied from kjs/NodeInfo.h.
24799 * parser/Nodes.cpp: Copied from kjs/nodes.cpp.
24800 * parser/Nodes.h: Copied from kjs/nodes.h.
24801 * parser/Parser.cpp: Copied from kjs/Parser.cpp.
24802 * parser/Parser.h: Copied from kjs/Parser.h.
24803 * parser/ResultType.h: Copied from kjs/ResultType.h.
24804 * parser/SourceCode.h: Copied from kjs/SourceCode.h.
24805 * parser/SourceProvider.h: Copied from kjs/SourceProvider.h.
24806 * parser/nodes2string.cpp: Copied from kjs/nodes2string.cpp.
24808 * pcre/pcre_exec.cpp:
24809 * runtime/FunctionConstructor.cpp:
24810 * runtime/JSActivation.h:
24811 * runtime/JSFunction.h:
24812 * runtime/JSGlobalData.cpp:
24813 * runtime/JSGlobalObjectFunctions.cpp:
24814 * runtime/JSObject.cpp:
24815 (JSC::JSObject::toNumber):
24816 * runtime/RegExp.cpp:
24818 2008-11-06 Adam Roben <aroben@apple.com>
24820 Windows build fix after r38196
24822 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added bytecompiler/ to the
24825 2008-11-06 Cameron Zwarich <zwarich@apple.com>
24827 Rubber-stamped by Sam Weinig.
24829 Create a new bytecompiler subdirectory of JavaScriptCore and move some
24830 relevant files to it.
24832 * AllInOneFile.cpp:
24834 * JavaScriptCore.pri:
24835 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
24836 * JavaScriptCore.xcodeproj/project.pbxproj:
24837 * JavaScriptCoreSources.bkl:
24838 * VM/CodeGenerator.cpp: Removed.
24839 * VM/CodeGenerator.h: Removed.
24840 * bytecompiler: Added.
24841 * bytecompiler/CodeGenerator.cpp: Copied from VM/CodeGenerator.cpp.
24842 * bytecompiler/CodeGenerator.h: Copied from VM/CodeGenerator.h.
24843 * bytecompiler/LabelScope.h: Copied from kjs/LabelScope.h.
24845 * kjs/LabelScope.h: Removed.
24847 2008-11-06 Adam Roben <aroben@apple.com>
24849 Windows clean build fix after r38155
24851 Rubberstamped by Cameron Zwarich.
24853 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update
24854 the post-build event for the move of create_hash_table out of kjs/.
24856 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
24858 Reviewed by Darin Adler.
24860 https://bugs.webkit.org/show_bug.cgi?id=22107
24862 Bug uncovered during RVCT port in functions not used. get_lt() and
24863 get_gt() takes only one argument - remove second argument where
24867 (JSC::AVLTree::remove): Remove second argument of get_lt/get_gt().
24868 (JSC::AVLTree::subst): Ditto.
24870 2008-11-06 Alp Toker <alp@nuanti.com>
24872 Reviewed by Cameron Zwarich.
24874 https://bugs.webkit.org/show_bug.cgi?id=22033
24875 [GTK] CTI/Linux r38064 crashes; JIT requires executable memory
24877 Mark pages allocated by the FastMalloc mmap code path executable with
24878 PROT_EXEC. This fixes crashes seen on CPUs and kernels that enforce
24879 non-executable memory (like ExecShield on Fedora Linux) when the JIT
24882 This patch does not resolve the issue on debug builds so affected
24883 developers may still need to pass --disable-jit to configure.
24885 * wtf/TCSystemAlloc.cpp:
24888 (TCMalloc_SystemRelease):
24890 2008-11-06 Peter Gal <galpeter@inf.u-szeged.hu>
24892 Reviewed by Cameron Zwarich.
24894 Bug 22099: Make the Qt port build the JSC shell in the correct place
24895 <https://bugs.webkit.org/show_bug.cgi?id=22099>
24897 Adjust include paths and build destination dir for the 'jsc' executable
24902 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
24904 Reviewed by Simon Hausmann.
24906 Implemented the block allocation on Symbian through heap allocation.
24908 Unfortunately there is no way to allocate virtual memory. The Posix
24909 layer provides mmap() but no anonymous mapping. So this is a very slow
24910 solution but it should work as a start.
24912 * runtime/Collector.cpp:
24913 (JSC::allocateBlock):
24916 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
24918 Reviewed by Simon Hausmann.
24920 Borrow some math functions from the MSVC port to the build with the
24923 * wtf/MathExtras.h:
24928 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
24930 Reviewed by Simon Hausmann.
24932 Include strings.h for strncasecmp().
24933 This is needed for compilation inside Symbian and it is also
24934 confirmed by the man-page on Linux.
24936 * runtime/DateMath.cpp:
24938 2008-11-06 Norbert Leser <norbert.leser@nokia.com>
24940 Reviewed by Simon Hausmann.
24942 Implemented currentThreadStackBase for Symbian.
24944 * runtime/Collector.cpp:
24945 (JSC::currentThreadStackBase):
24947 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
24949 Reviewed by Simon Hausmann.
24951 RVCT does not support tm_gmtoff field, so disable that code just like
24954 * runtime/DateMath.h:
24955 (JSC::GregorianDateTime::GregorianDateTime):
24956 (JSC::GregorianDateTime::operator tm):
24958 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
24960 Reviewed by Simon Hausmann.
24962 Define PLATFORM(UNIX) for S60. Effectively WebKit on S60 is compiled
24963 on top of the Posix layer.
24967 2008-11-06 Norbert Leser <norbert.leser@nokia.com>
24969 Reviewed by Simon Hausmann.
24971 Added __SYMBIAN32__ condition for defining PLATFORM(SYMBIAN).
24975 2008-11-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
24977 Reviewed by Simon Hausmann.
24979 Added WINSCW compiler define for Symbian S60.
24983 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
24985 Reviewed by Simon Hausmann.
24987 Use the GCC defines of the WTF_ALIGN* macros for the RVCT and the
24992 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
24994 Reviewed by Simon Hausmann.
24996 Define capabilities of the SYMBIAN platform. Some of the system
24997 headers are actually dependent on RVCT.
25001 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
25003 Reviewed by Simon Hausmann.
25005 Add missing stddef.h header needed for compilation in Symbian.
25007 * runtime/Collector.h:
25009 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
25011 Reviewed by Simon Hausmann.
25013 Added COMPILER(RVCT) to detect the ARM RVCT compiler used in the Symbian environment.
25017 2008-11-06 Simon Hausmann <hausmann@webkit.org>
25019 Fix the Qt build, adjust include paths after move of jsc.pro.
25023 2008-11-06 Cameron Zwarich <zwarich@apple.com>
25025 Rubber-stamped by Sam Weinig.
25027 Move kjs/Shell.cpp to the top level of the JavaScriptCore directory and
25028 rename it to jsc.cpp to reflect the name of the binary compiled from it.
25031 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
25032 * JavaScriptCore.xcodeproj/project.pbxproj:
25033 * jsc.cpp: Copied from kjs/Shell.cpp.
25036 * kjs/Shell.cpp: Removed.
25038 2008-11-06 Cameron Zwarich <zwarich@apple.com>
25040 Rubber-stamped by Sam Weinig.
25042 Move create_hash_table and jsc.pro out of the kjs directory and into the
25043 root directory of JavaScriptCore.
25045 * DerivedSources.make:
25046 * JavaScriptCore.pri:
25047 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25048 * JavaScriptCore.xcodeproj/project.pbxproj:
25049 * create_hash_table: Copied from kjs/create_hash_table.
25050 * jsc.pro: Copied from kjs/jsc.pro.
25051 * kjs/create_hash_table: Removed.
25052 * kjs/jsc.pro: Removed.
25053 * make-generated-sources.sh:
25055 2008-11-05 Gavin Barraclough <barraclough@apple.com>
25057 Reviewed by Maciej Stachowiak.
25059 https://bugs.webkit.org/show_bug.cgi?id=22094
25061 Fix for bug where the callee incorrectly recieves the caller's lexical
25062 global object as this, rather than its own. Implementation closely
25063 follows the spec, passing jsNull, checking in the callee and replacing
25064 with the global object where necessary.
25067 (JSC::CTI::compileOpCall):
25069 (JSC::Machine::cti_op_call_NotJSFunction):
25070 (JSC::Machine::cti_op_call_eval):
25071 * runtime/JSCell.h:
25072 (JSC::JSValue::toThisObject):
25073 * runtime/JSImmediate.cpp:
25074 (JSC::JSImmediate::toThisObject):
25075 * runtime/JSImmediate.h:
25077 2008-11-05 Kevin Ollivier <kevino@theolliviers.com>
25079 wx build fix after Operations.cpp move.
25081 * JavaScriptCoreSources.bkl:
25083 2008-11-05 Cameron Zwarich <zwarich@apple.com>
25087 Fix the build for case-sensitive build systems and wxWindows.
25089 * JavaScriptCoreSources.bkl:
25090 * kjs/create_hash_table:
25092 2008-11-05 Cameron Zwarich <zwarich@apple.com>
25096 Fix the build for case-sensitive build systems.
25098 * JavaScriptCoreSources.bkl:
25100 * runtime/Interpreter.cpp:
25101 * runtime/JSArray.cpp:
25103 2008-11-05 Cameron Zwarich <zwarich@apple.com>
25107 Fix the build for case-sensitive build systems.
25110 * API/JSObjectRef.cpp:
25111 * runtime/CommonIdentifiers.h:
25112 * runtime/Identifier.cpp:
25113 * runtime/InitializeThreading.cpp:
25114 * runtime/InternalFunction.h:
25115 * runtime/JSString.h:
25116 * runtime/Lookup.h:
25117 * runtime/PropertyNameArray.h:
25118 * runtime/PropertySlot.h:
25119 * runtime/StructureID.cpp:
25120 * runtime/StructureID.h:
25121 * runtime/UString.cpp:
25123 2008-11-05 Cameron Zwarich <zwarich@apple.com>
25125 Rubber-stamped by Sam Weinig.
25127 Move more files to the runtime subdirectory of JavaScriptCore.
25131 * API/JSCallbackObject.cpp:
25132 * API/JSClassRef.cpp:
25133 * API/JSClassRef.h:
25134 * API/JSStringRefCF.cpp:
25135 * API/JSValueRef.cpp:
25136 * API/OpaqueJSString.cpp:
25137 * API/OpaqueJSString.h:
25138 * AllInOneFile.cpp:
25140 * JavaScriptCore.pri:
25141 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25142 * JavaScriptCore.xcodeproj/project.pbxproj:
25143 * JavaScriptCoreSources.bkl:
25145 * VM/CodeGenerator.cpp:
25147 * VM/RegisterFile.h:
25148 * debugger/Debugger.h:
25149 * kjs/SourceProvider.h:
25150 * kjs/TypeInfo.h: Removed.
25151 * kjs/collector.cpp: Removed.
25152 * kjs/collector.h: Removed.
25153 * kjs/completion.h: Removed.
25154 * kjs/create_hash_table:
25155 * kjs/identifier.cpp: Removed.
25156 * kjs/identifier.h: Removed.
25157 * kjs/interpreter.cpp: Removed.
25158 * kjs/interpreter.h: Removed.
25161 * kjs/lookup.cpp: Removed.
25162 * kjs/lookup.h: Removed.
25165 * kjs/operations.cpp: Removed.
25166 * kjs/operations.h: Removed.
25167 * kjs/protect.h: Removed.
25168 * kjs/regexp.cpp: Removed.
25169 * kjs/regexp.h: Removed.
25170 * kjs/ustring.cpp: Removed.
25171 * kjs/ustring.h: Removed.
25172 * pcre/pcre_exec.cpp:
25173 * profiler/CallIdentifier.h:
25174 * profiler/Profile.h:
25175 * runtime/ArrayConstructor.cpp:
25176 * runtime/ArrayPrototype.cpp:
25177 * runtime/ArrayPrototype.h:
25178 * runtime/Collector.cpp: Copied from kjs/collector.cpp.
25179 * runtime/Collector.h: Copied from kjs/collector.h.
25180 * runtime/CollectorHeapIterator.h:
25181 * runtime/Completion.h: Copied from kjs/completion.h.
25182 * runtime/ErrorPrototype.cpp:
25183 * runtime/Identifier.cpp: Copied from kjs/identifier.cpp.
25184 * runtime/Identifier.h: Copied from kjs/identifier.h.
25185 * runtime/InitializeThreading.cpp:
25186 * runtime/Interpreter.cpp: Copied from kjs/interpreter.cpp.
25187 * runtime/Interpreter.h: Copied from kjs/interpreter.h.
25188 * runtime/JSCell.h:
25189 * runtime/JSGlobalData.cpp:
25190 * runtime/JSGlobalData.h:
25191 * runtime/JSLock.cpp:
25192 * runtime/JSNumberCell.cpp:
25193 * runtime/JSNumberCell.h:
25194 * runtime/JSObject.cpp:
25195 * runtime/JSValue.h:
25196 * runtime/Lookup.cpp: Copied from kjs/lookup.cpp.
25197 * runtime/Lookup.h: Copied from kjs/lookup.h.
25198 * runtime/MathObject.cpp:
25199 * runtime/NativeErrorPrototype.cpp:
25200 * runtime/NumberPrototype.cpp:
25201 * runtime/Operations.cpp: Copied from kjs/operations.cpp.
25202 * runtime/Operations.h: Copied from kjs/operations.h.
25203 * runtime/PropertyMapHashTable.h:
25204 * runtime/Protect.h: Copied from kjs/protect.h.
25205 * runtime/RegExp.cpp: Copied from kjs/regexp.cpp.
25206 * runtime/RegExp.h: Copied from kjs/regexp.h.
25207 * runtime/RegExpConstructor.cpp:
25208 * runtime/RegExpObject.h:
25209 * runtime/RegExpPrototype.cpp:
25210 * runtime/SmallStrings.h:
25211 * runtime/StringObjectThatMasqueradesAsUndefined.h:
25212 * runtime/StructureID.cpp:
25213 * runtime/StructureID.h:
25214 * runtime/StructureIDTransitionTable.h:
25215 * runtime/SymbolTable.h:
25216 * runtime/TypeInfo.h: Copied from kjs/TypeInfo.h.
25217 * runtime/UString.cpp: Copied from kjs/ustring.cpp.
25218 * runtime/UString.h: Copied from kjs/ustring.h.
25219 * wrec/CharacterClassConstructor.h:
25222 2008-11-05 Geoffrey Garen <ggaren@apple.com>
25224 Suggested by Darin Adler.
25226 Removed two copy constructors that the compiler can generate for us
25230 (JSC::LabelID::setLocation):
25231 (JSC::LabelID::offsetFrom):
25232 (JSC::LabelID::ref):
25233 (JSC::LabelID::refCount):
25234 * kjs/LabelScope.h:
25236 2008-11-05 Anders Carlsson <andersca@apple.com>
25238 Fix Snow Leopard build.
25240 * JavaScriptCore.xcodeproj/project.pbxproj:
25242 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25244 Rubber-stamped by Steve Falkenburg.
25246 Move dtoa.cpp and dtoa.h to the WTF Visual Studio project to reflect
25247 their movement in the filesystem.
25249 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25250 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
25252 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25254 Rubber-stamped by Sam Weinig.
25256 Move kjs/dtoa.h to the wtf subdirectory of JavaScriptCore.
25258 * AllInOneFile.cpp:
25260 * JavaScriptCore.pri:
25261 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25262 * JavaScriptCore.xcodeproj/project.pbxproj:
25263 * JavaScriptCoreSources.bkl:
25264 * kjs/dtoa.cpp: Removed.
25265 * kjs/dtoa.h: Removed.
25266 * wtf/dtoa.cpp: Copied from kjs/dtoa.cpp.
25267 * wtf/dtoa.h: Copied from kjs/dtoa.h.
25269 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25271 Rubber-stamped by Sam Weinig.
25273 Move kjs/config.h to the top level of JavaScriptCore.
25276 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25277 * JavaScriptCore.xcodeproj/project.pbxproj:
25278 * config.h: Copied from kjs/config.h.
25279 * kjs/config.h: Removed.
25281 2008-11-04 Darin Adler <darin@apple.com>
25283 Reviewed by Tim Hatcher.
25285 * wtf/ThreadingNone.cpp: Tweak formatting.
25287 2008-11-03 Darin Adler <darin@apple.com>
25289 Reviewed by Tim Hatcher.
25291 - https://bugs.webkit.org/show_bug.cgi?id=22061
25292 create script to check for exit-time destructors
25294 * JavaScriptCore.exp: Changed to export functions rather than
25295 a global for the atomically initialized static mutex.
25297 * JavaScriptCore.xcodeproj/project.pbxproj: Added a script
25298 phase that runs the check-for-exit-time-destructors script.
25300 * wtf/MainThread.cpp:
25301 (WTF::mainThreadFunctionQueueMutex): Changed to leak an object
25302 rather than using an exit time destructor.
25303 (WTF::functionQueue): Ditto.
25304 * wtf/unicode/icu/CollatorICU.cpp:
25305 (WTF::cachedCollatorMutex): Ditto.
25307 * wtf/Threading.h: Changed other platforms to share the Windows
25308 approach where the mutex is internal and the functions are exported.
25309 * wtf/ThreadingGtk.cpp:
25310 (WTF::lockAtomicallyInitializedStaticMutex): Ditto.
25311 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
25312 * wtf/ThreadingNone.cpp:
25313 (WTF::lockAtomicallyInitializedStaticMutex): Ditto.
25314 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
25315 * wtf/ThreadingPthreads.cpp:
25316 (WTF::threadMapMutex): Changed to leak an object rather than using
25317 an exit time destructor.
25318 (WTF::lockAtomicallyInitializedStaticMutex): Mutex change.
25319 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
25320 (WTF::threadMap): Changed to leak an object rather than using
25321 an exit time destructor.
25322 * wtf/ThreadingQt.cpp:
25323 (WTF::lockAtomicallyInitializedStaticMutex): Mutex change.
25324 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
25325 * wtf/ThreadingWin.cpp:
25326 (WTF::lockAtomicallyInitializedStaticMutex): Added an assertion.
25328 2008-11-04 Adam Roben <aroben@apple.com>
25332 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update
25333 the location of JSStaticScopeObject.{cpp,h}.
25335 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25337 Reviewed by Alexey Proskuryakov.
25339 Move AllInOneFile.cpp to the top level of JavaScriptCore.
25341 * AllInOneFile.cpp: Copied from kjs/AllInOneFile.cpp.
25343 * JavaScriptCore.xcodeproj/project.pbxproj:
25344 * kjs/AllInOneFile.cpp: Removed.
25346 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25348 Rubber-stamped by Alexey Proskuryakov.
25350 Add NodeInfo.h to the JavaScriptCore Xcode project.
25352 * JavaScriptCore.xcodeproj/project.pbxproj:
25354 2008-11-03 Cameron Zwarich <zwarich@apple.com>
25356 Rubber-stamped by Maciej Stachowiak.
25358 Move more files into the runtime subdirectory of JavaScriptCore.
25361 * API/JSCallbackConstructor.cpp:
25362 * API/JSCallbackFunction.cpp:
25363 * API/JSClassRef.cpp:
25364 * API/OpaqueJSString.cpp:
25366 * JavaScriptCore.pri:
25367 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25368 * JavaScriptCore.xcodeproj/project.pbxproj:
25369 * JavaScriptCoreSources.bkl:
25370 * kjs/AllInOneFile.cpp:
25371 * kjs/ArgList.cpp: Removed.
25372 * kjs/ArgList.h: Removed.
25373 * kjs/Arguments.cpp: Removed.
25374 * kjs/Arguments.h: Removed.
25375 * kjs/BatchedTransitionOptimizer.h: Removed.
25376 * kjs/CollectorHeapIterator.h: Removed.
25377 * kjs/CommonIdentifiers.cpp: Removed.
25378 * kjs/CommonIdentifiers.h: Removed.
25379 * kjs/ExecState.cpp: Removed.
25380 * kjs/ExecState.h: Removed.
25381 * kjs/GetterSetter.cpp: Removed.
25382 * kjs/GetterSetter.h: Removed.
25383 * kjs/InitializeThreading.cpp: Removed.
25384 * kjs/InitializeThreading.h: Removed.
25385 * kjs/JSActivation.cpp: Removed.
25386 * kjs/JSActivation.h: Removed.
25387 * kjs/JSGlobalData.cpp: Removed.
25388 * kjs/JSGlobalData.h: Removed.
25389 * kjs/JSLock.cpp: Removed.
25390 * kjs/JSLock.h: Removed.
25391 * kjs/JSStaticScopeObject.cpp: Removed.
25392 * kjs/JSStaticScopeObject.h: Removed.
25393 * kjs/JSType.h: Removed.
25394 * kjs/PropertyNameArray.cpp: Removed.
25395 * kjs/PropertyNameArray.h: Removed.
25396 * kjs/ScopeChain.cpp: Removed.
25397 * kjs/ScopeChain.h: Removed.
25398 * kjs/ScopeChainMark.h: Removed.
25399 * kjs/SymbolTable.h: Removed.
25400 * kjs/Tracing.d: Removed.
25401 * kjs/Tracing.h: Removed.
25402 * runtime/ArgList.cpp: Copied from kjs/ArgList.cpp.
25403 * runtime/ArgList.h: Copied from kjs/ArgList.h.
25404 * runtime/Arguments.cpp: Copied from kjs/Arguments.cpp.
25405 * runtime/Arguments.h: Copied from kjs/Arguments.h.
25406 * runtime/BatchedTransitionOptimizer.h: Copied from kjs/BatchedTransitionOptimizer.h.
25407 * runtime/CollectorHeapIterator.h: Copied from kjs/CollectorHeapIterator.h.
25408 * runtime/CommonIdentifiers.cpp: Copied from kjs/CommonIdentifiers.cpp.
25409 * runtime/CommonIdentifiers.h: Copied from kjs/CommonIdentifiers.h.
25410 * runtime/ExecState.cpp: Copied from kjs/ExecState.cpp.
25411 * runtime/ExecState.h: Copied from kjs/ExecState.h.
25412 * runtime/GetterSetter.cpp: Copied from kjs/GetterSetter.cpp.
25413 * runtime/GetterSetter.h: Copied from kjs/GetterSetter.h.
25414 * runtime/InitializeThreading.cpp: Copied from kjs/InitializeThreading.cpp.
25415 * runtime/InitializeThreading.h: Copied from kjs/InitializeThreading.h.
25416 * runtime/JSActivation.cpp: Copied from kjs/JSActivation.cpp.
25417 * runtime/JSActivation.h: Copied from kjs/JSActivation.h.
25418 * runtime/JSGlobalData.cpp: Copied from kjs/JSGlobalData.cpp.
25419 * runtime/JSGlobalData.h: Copied from kjs/JSGlobalData.h.
25420 * runtime/JSLock.cpp: Copied from kjs/JSLock.cpp.
25421 * runtime/JSLock.h: Copied from kjs/JSLock.h.
25422 * runtime/JSStaticScopeObject.cpp: Copied from kjs/JSStaticScopeObject.cpp.
25423 * runtime/JSStaticScopeObject.h: Copied from kjs/JSStaticScopeObject.h.
25424 * runtime/JSType.h: Copied from kjs/JSType.h.
25425 * runtime/PropertyNameArray.cpp: Copied from kjs/PropertyNameArray.cpp.
25426 * runtime/PropertyNameArray.h: Copied from kjs/PropertyNameArray.h.
25427 * runtime/ScopeChain.cpp: Copied from kjs/ScopeChain.cpp.
25428 * runtime/ScopeChain.h: Copied from kjs/ScopeChain.h.
25429 * runtime/ScopeChainMark.h: Copied from kjs/ScopeChainMark.h.
25430 * runtime/SymbolTable.h: Copied from kjs/SymbolTable.h.
25431 * runtime/Tracing.d: Copied from kjs/Tracing.d.
25432 * runtime/Tracing.h: Copied from kjs/Tracing.h.
25434 2008-11-03 Sam Weinig <sam@webkit.org>
25436 Reviewed by Mark Rowe.
25438 Move #define to turn on dumping StructureID statistics to StructureID.cpp so that
25439 turning it on does not require a full rebuild.
25441 * runtime/StructureID.cpp:
25442 (JSC::StructureID::dumpStatistics):
25443 * runtime/StructureID.h:
25445 2008-11-03 Alp Toker <alp@nuanti.com>
25447 Reviewed by Geoffrey Garen.
25449 Fix warning when building on Darwin without JSC_MULTIPLE_THREADS
25452 * kjs/InitializeThreading.cpp:
25454 2008-11-02 Matt Lilek <webkit@mattlilek.com>
25456 Reviewed by Cameron Zwarich.
25458 Bug 22042: REGRESSION(r38066): ASSERTION FAILED: source in CodeBlock
25459 <https://bugs.webkit.org/show_bug.cgi?id=22042>
25461 Rename parameter name to avoid ASSERT.
25464 (JSC::CodeBlock::CodeBlock):
25465 (JSC::ProgramCodeBlock::ProgramCodeBlock):
25466 (JSC::EvalCodeBlock::EvalCodeBlock):
25468 2008-11-02 Cameron Zwarich <zwarich@apple.com>
25470 Reviewed by Oliver Hunt.
25472 Bug 22035: Remove the '_' suffix on constructor parameter names for structs
25473 <https://bugs.webkit.org/show_bug.cgi?id=22035>
25475 * API/JSCallbackObject.h:
25476 (JSC::JSCallbackObject::JSCallbackObjectData::JSCallbackObjectData):
25478 (JSC::CodeBlock::CodeBlock):
25479 (JSC::ProgramCodeBlock::ProgramCodeBlock):
25480 (JSC::EvalCodeBlock::EvalCodeBlock):
25482 (JSC::Quantifier::Quantifier):
25484 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25486 Rubber-stamped by Geoff Garen.
25488 Rename SourceRange.h to SourceCode.h.
25492 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25493 * JavaScriptCore.xcodeproj/project.pbxproj:
25495 * kjs/SourceCode.h: Copied from kjs/SourceRange.h.
25496 * kjs/SourceRange.h: Removed.
25500 (JSC::ForInNode::ForInNode):
25502 (JSC::ThrowableExpressionData::setExceptionSourceCode):
25504 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25506 Reviewed by Darin Adler.
25508 Bug 22019: Move JSC::Interpreter::shouldPrintExceptions() to WebCore::Console
25509 <https://bugs.webkit.org/show_bug.cgi?id=22019>
25511 The JSC::Interpreter::shouldPrintExceptions() function is not used at
25512 all in JavaScriptCore, so it should be moved to WebCore::Console, its
25515 * JavaScriptCore.exp:
25516 * kjs/interpreter.cpp:
25517 * kjs/interpreter.h:
25519 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25525 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25527 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25529 Rubber-stamped by Sam Weinig.
25531 Remove the call to Interpreter::setShouldPrintExceptions() from the
25532 GlobalObject constructor in the shell. The shouldPrintExceptions()
25533 information is not used anywhere in JavaScriptCore, only in WebCore.
25536 (GlobalObject::GlobalObject):
25538 2008-10-31 Kevin Ollivier <kevino@theolliviers.com>
25544 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25546 Rubber-stamped by Sam Weinig.
25548 Move more files from the kjs subdirectory of JavaScriptCore to the
25549 runtime subdirectory.
25552 * JavaScriptCore.pri:
25553 * JavaScriptCore.xcodeproj/project.pbxproj:
25554 * JavaScriptCoreSources.bkl:
25555 * kjs/AllInOneFile.cpp:
25556 * kjs/RegExpConstructor.cpp: Removed.
25557 * kjs/RegExpConstructor.h: Removed.
25558 * kjs/RegExpMatchesArray.h: Removed.
25559 * kjs/RegExpObject.cpp: Removed.
25560 * kjs/RegExpObject.h: Removed.
25561 * kjs/RegExpPrototype.cpp: Removed.
25562 * kjs/RegExpPrototype.h: Removed.
25563 * runtime/RegExpConstructor.cpp: Copied from kjs/RegExpConstructor.cpp.
25564 * runtime/RegExpConstructor.h: Copied from kjs/RegExpConstructor.h.
25565 * runtime/RegExpMatchesArray.h: Copied from kjs/RegExpMatchesArray.h.
25566 * runtime/RegExpObject.cpp: Copied from kjs/RegExpObject.cpp.
25567 * runtime/RegExpObject.h: Copied from kjs/RegExpObject.h.
25568 * runtime/RegExpPrototype.cpp: Copied from kjs/RegExpPrototype.cpp.
25569 * runtime/RegExpPrototype.h: Copied from kjs/RegExpPrototype.h.
25571 2008-10-31 Mark Rowe <mrowe@apple.com>
25573 Revert an incorrect portion of r38034.
25575 * profiler/ProfilerServer.mm:
25577 2008-10-31 Mark Rowe <mrowe@apple.com>
25579 Fix the 64-bit build.
25581 Disable strict aliasing in ProfilerServer.mm as it leads to the compiler being unhappy
25582 with the common Obj-C idiom self = [super init];
25584 * JavaScriptCore.xcodeproj/project.pbxproj:
25586 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25588 Reviewed by Alexey Proskuryakov.
25590 Change a header guard to match our coding style.
25592 * kjs/InitializeThreading.h:
25594 2008-10-30 Geoffrey Garen <ggaren@apple.com>
25596 Reviewed by Oliver Hunt.
25598 Fixed a small bit of https://bugs.webkit.org/show_bug.cgi?id=21962
25599 AST uses way too much memory
25601 Removed a word from StatementNode by nixing LabelStack and turning it
25602 into a compile-time data structure managed by CodeGenerator.
25604 v8 tests and SunSpider, run by Gavin, report no change.
25607 * JavaScriptCore.order:
25608 * JavaScriptCore.pri:
25609 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25610 * JavaScriptCore.xcodeproj/project.pbxproj:
25611 * kjs/AllInOneFile.cpp:
25612 * JavaScriptCoreSources.bkl: I sure hope this builds!
25614 * VM/CodeGenerator.cpp:
25615 (JSC::CodeGenerator::CodeGenerator):
25616 (JSC::CodeGenerator::newLabelScope):
25617 (JSC::CodeGenerator::breakTarget):
25618 (JSC::CodeGenerator::continueTarget):
25619 * VM/CodeGenerator.h: Nixed the JumpContext system because it depended
25620 on a LabelStack in the AST, and it was a little cumbersome on the client
25621 side. Replaced with LabelScope, which tracks all break / continue
25622 information in the CodeGenerator, just like we track LabelIDs and other
25623 stacks of compile-time data.
25625 * kjs/LabelScope.h: Added.
25626 (JSC::LabelScope::):
25627 (JSC::LabelScope::LabelScope):
25628 (JSC::LabelScope::ref):
25629 (JSC::LabelScope::deref):
25630 (JSC::LabelScope::refCount):
25631 (JSC::LabelScope::breakTarget):
25632 (JSC::LabelScope::continueTarget):
25633 (JSC::LabelScope::type):
25634 (JSC::LabelScope::name):
25635 (JSC::LabelScope::scopeDepth): Simple abstraction for holding everything
25636 you might want to know about a break-able / continue-able scope.
25638 * kjs/LabelStack.cpp: Removed.
25639 * kjs/LabelStack.h: Removed.
25641 * kjs/grammar.y: No need to push labels at parse time -- we don't store
25642 LabelStacks in the AST anymore.
25645 (JSC::DoWhileNode::emitCode):
25646 (JSC::WhileNode::emitCode):
25647 (JSC::ForNode::emitCode):
25648 (JSC::ForInNode::emitCode):
25649 (JSC::ContinueNode::emitCode):
25650 (JSC::BreakNode::emitCode):
25651 (JSC::SwitchNode::emitCode):
25652 (JSC::LabelNode::emitCode):
25654 (JSC::StatementNode::):
25655 (JSC::LabelNode::): Use LabelScope where we used to use JumpContext.
25656 Simplified a bunch of code. Touched up label-related error messages a
25659 * kjs/nodes2string.cpp:
25660 (JSC::LabelNode::streamTo): Updated for rename.
25662 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25664 Reviewed by Darin Adler.
25666 Bug 22005: Move StructureIDChain into its own file
25667 <https://bugs.webkit.org/show_bug.cgi?id=22005>
25670 * JavaScriptCore.pri:
25671 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25672 * JavaScriptCore.xcodeproj/project.pbxproj:
25673 * JavaScriptCoreSources.bkl:
25674 * runtime/StructureID.cpp:
25675 * runtime/StructureID.h:
25676 * runtime/StructureIDChain.cpp: Copied from runtime/StructureID.cpp.
25677 * runtime/StructureIDChain.h: Copied from runtime/StructureID.h.
25679 2008-10-31 Steve Falkenburg <sfalken@apple.com>
25683 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
25685 2008-10-31 Steve Falkenburg <sfalken@apple.com>
25689 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25691 2008-10-31 Darin Adler <darin@apple.com>
25693 Reviewed by Dan Bernstein.
25695 - fix storage leak seen on buildbot
25697 Some other cleanup too. The storage leak was caused by the fact
25698 that HashTraits<CallIdentifier>::needsDestruction was false, so
25699 the call identifier objects didn't get deleted.
25701 * profiler/CallIdentifier.h:
25703 Added a default constructor to create empty call identifiers.
25705 Changed the normal constructor to use const UString&
25706 to avoid extra copying and reference count thrash.
25708 Removed the explicit copy constructor definition, since it's what
25709 the compiler will automatically generate. (Rule of thumb: Either
25710 you need both a custom copy constructor and a custom assignment
25711 operator, or neither.)
25713 Moved the CallIdentifier hash function out of the WTF namespace;
25714 there's no reason to put it there.
25716 Changed the CallIdentifier hash function to be a struct rather than
25717 a specialization of the IntHash struct template. Having it be
25718 a specialization made no sense, since CallIdentifier is not an integer,
25721 Removed explicit definition of emptyValueIsZero in the hash traits,
25722 since inheriting from GenericHashTraits already makes that false.
25724 Removed explicit definition of emptyValue, instead relying on the
25725 default constructor and GenericHashTraits.
25727 Removed explicit definition of needsDestruction, because we want it
25728 to have its default value: true, not false. This fixes the leak!
25730 Changed constructDeletedValue and isDeletedValue to use a line number
25731 of numeric_limits<unsigned>::max() to indicate a value is deleted.
25732 Previously this used empty strings for the empty value and null strings
25733 for the deleted value, but it's more efficient to use null for both.
25735 2008-10-31 Timothy Hatcher <timothy@apple.com>
25737 Emit the WillExecuteStatement debugger hook before the for loop body
25738 when the statement node for the body isn't a block. This allows
25739 breakpoints on those statements in the Web Inspector.
25741 https://bugs.webkit.org/show_bug.cgi?id=22004
25743 Reviewed by Darin Adler.
25746 (JSC::ForNode::emitCode): Emit the WillExecuteStatement
25747 debugger hook before the statement node if isn't a block.
25748 Also emit the WillExecuteStatement debugger hook for the
25749 loop as the first op-code.
25750 (JSC::ForInNode::emitCode): Ditto.
25752 2008-10-31 Timothy Hatcher <timothy@apple.com>
25754 Fixes console warnings about not having an autorelease pool.
25755 Also fixes the build for Snow Leopard, by including individual
25756 Foundation headers instead of Foundation.h.
25758 https://bugs.webkit.org/show_bug.cgi?id=21995
25760 Reviewed by Oliver Hunt.
25762 * profiler/ProfilerServer.mm:
25763 (-[ProfilerServer init]): Create a NSAutoreleasePool and drain it.
25765 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25769 Speculative wxWindows build fix.
25771 * JavaScriptCoreSources.bkl:
25774 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25776 Rubber-stamped by Maciej Stachowiak.
25778 Move VM/JSPropertyNameIterator.cpp and VM/JSPropertyNameIterator.h to
25779 the runtime directory.
25782 * JavaScriptCore.pri:
25783 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25784 * JavaScriptCore.xcodeproj/project.pbxproj:
25785 * JavaScriptCoreSources.bkl:
25786 * VM/JSPropertyNameIterator.cpp: Removed.
25787 * VM/JSPropertyNameIterator.h: Removed.
25788 * runtime/JSPropertyNameIterator.cpp: Copied from VM/JSPropertyNameIterator.cpp.
25789 * runtime/JSPropertyNameIterator.h: Copied from VM/JSPropertyNameIterator.h.
25791 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25795 Speculative wxWindows build fix.
25799 2008-10-30 Mark Rowe <mrowe@apple.com>
25801 Reviewed by Jon Homeycutt.
25803 Explicitly default to building for only the native architecture in debug and release builds.
25805 * Configurations/DebugRelease.xcconfig:
25807 2008-10-30 Cameron Zwarich <zwarich@apple.com>
25809 Rubber-stamped by Sam Weinig.
25811 Create a debugger directory in JavaScriptCore and move the relevant
25815 * JavaScriptCore.pri:
25816 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25817 * JavaScriptCore.xcodeproj/project.pbxproj:
25818 * VM/CodeBlock.cpp:
25819 * VM/CodeGenerator.h:
25822 * debugger/Debugger.cpp: Copied from kjs/debugger.cpp.
25823 * debugger/Debugger.h: Copied from kjs/debugger.h.
25824 * debugger/DebuggerCallFrame.cpp: Copied from kjs/DebuggerCallFrame.cpp.
25825 * debugger/DebuggerCallFrame.h: Copied from kjs/DebuggerCallFrame.h.
25826 * kjs/AllInOneFile.cpp:
25827 * kjs/DebuggerCallFrame.cpp: Removed.
25828 * kjs/DebuggerCallFrame.h: Removed.
25831 * kjs/debugger.cpp: Removed.
25832 * kjs/debugger.h: Removed.
25833 * kjs/interpreter.cpp:
25835 * runtime/FunctionConstructor.cpp:
25836 * runtime/JSGlobalObject.cpp:
25838 2008-10-30 Benjamin K. Stuhl <bks24@cornell.edu>
25840 gcc 4.3.3/linux-x86 generates "suggest parentheses around && within ||"
25841 warnings; add some parentheses to disambiguate things. No functional
25842 changes, so no tests.
25844 https://bugs.webkit.org/show_bug.cgi?id=21973
25845 Add parentheses to clean up some gcc warnings
25847 Reviewed by Dan Bernstein.
25849 * wtf/ASCIICType.h:
25850 (WTF::isASCIIAlphanumeric):
25851 (WTF::isASCIIHexDigit):
25853 2008-10-30 Kevin Lindeman <klindeman@apple.com>
25855 Adds ProfilerServer, which is a distributed notification listener
25856 that allows starting and stopping the profiler remotely for use
25857 in conjunction with the profiler's DTace probes.
25859 https://bugs.webkit.org/show_bug.cgi?id=21719
25861 Reviewed by Timothy Hatcher.
25863 * JavaScriptCore.xcodeproj/project.pbxproj:
25864 * kjs/JSGlobalData.cpp:
25865 (JSC::JSGlobalData::JSGlobalData): Calls startProfilerServerIfNeeded.
25866 * profiler/ProfilerServer.h: Added.
25867 * profiler/ProfilerServer.mm: Added.
25868 (+[ProfilerServer sharedProfileServer]):
25869 (-[ProfilerServer init]):
25870 (-[ProfilerServer startProfiling]):
25871 (-[ProfilerServer stopProfiling]):
25872 (JSC::startProfilerServerIfNeeded):
25874 2008-10-30 Kevin Ollivier <kevino@theolliviers.com>
25876 wx build fix after PropertyMap and StructureID merge.
25878 * JavaScriptCoreSources.bkl:
25880 2008-10-30 Cameron Zwarich <zwarich@apple.com>
25882 Reviewed by Mark Rowe.
25884 Change the JavaScriptCore Xcode project to use relative paths for the
25887 * JavaScriptCore.xcodeproj/project.pbxproj:
25889 2008-10-30 Sam Weinig <sam@webkit.org>
25891 Reviewed by Cameron Zwarich and Geoffrey Garen.
25893 Fix for https://bugs.webkit.org/show_bug.cgi?id=21989
25894 Merge PropertyMap and StructureID
25896 - Move PropertyMap code into StructureID in preparation for lazily
25897 creating the map on gets.
25898 - Make remove with transition explicit by adding removePropertyTransition.
25899 - Make the put/remove without transition explicit.
25900 - Make cache invalidation part of put/remove without transition.
25902 1% speedup on SunSpider; 0.5% speedup on v8 suite.
25905 * JavaScriptCore.exp:
25906 * JavaScriptCore.pri:
25907 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25908 * JavaScriptCore.xcodeproj/project.pbxproj:
25909 * JavaScriptCoreSources.bkl:
25910 * kjs/AllInOneFile.cpp:
25911 * kjs/identifier.h:
25912 * runtime/JSObject.cpp:
25913 (JSC::JSObject::removeDirect):
25914 * runtime/JSObject.h:
25915 (JSC::JSObject::putDirect):
25916 * runtime/PropertyMap.cpp: Removed.
25917 * runtime/PropertyMap.h: Removed.
25918 * runtime/PropertyMapHashTable.h: Copied from runtime/PropertyMap.h.
25919 * runtime/StructureID.cpp:
25920 (JSC::StructureID::dumpStatistics):
25921 (JSC::StructureID::StructureID):
25922 (JSC::StructureID::~StructureID):
25923 (JSC::StructureID::getEnumerablePropertyNames):
25924 (JSC::StructureID::addPropertyTransition):
25925 (JSC::StructureID::removePropertyTransition):
25926 (JSC::StructureID::toDictionaryTransition):
25927 (JSC::StructureID::changePrototypeTransition):
25928 (JSC::StructureID::getterSetterTransition):
25929 (JSC::StructureID::addPropertyWithoutTransition):
25930 (JSC::StructureID::removePropertyWithoutTransition):
25931 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
25932 (JSC::StructureID::checkConsistency):
25933 (JSC::StructureID::copyPropertyTable):
25934 (JSC::StructureID::get):
25935 (JSC::StructureID::put):
25936 (JSC::StructureID::remove):
25937 (JSC::StructureID::insertIntoPropertyMapHashTable):
25938 (JSC::StructureID::expandPropertyMapHashTable):
25939 (JSC::StructureID::createPropertyMapHashTable):
25940 (JSC::StructureID::rehashPropertyMapHashTable):
25941 (JSC::comparePropertyMapEntryIndices):
25942 (JSC::StructureID::getEnumerablePropertyNamesInternal):
25943 * runtime/StructureID.h:
25944 (JSC::StructureID::propertyStorageSize):
25945 (JSC::StructureID::isEmpty):
25946 (JSC::StructureID::get):
25948 2008-10-30 Cameron Zwarich <zwarich@apple.com>
25950 Reviewed by Oliver Hunt.
25952 Bug 21987: CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result register
25953 <https://bugs.webkit.org/show_bug.cgi?id=21987>
25955 CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result
25956 register as ecx, but it should be tempReg1, which is ecx at all of its
25960 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
25962 2008-10-30 Cameron Zwarich <zwarich@apple.com>
25964 Reviewed by Sam Weinig.
25966 Bug 21985: Opcodes should use eax as their destination register whenever possible
25967 <https://bugs.webkit.org/show_bug.cgi?id=21985>
25969 Change more opcodes to use eax as the register for their final result,
25970 and change calls to emitPutResult() that pass eax to rely on the default
25974 (JSC::CTI::privateCompileMainPass):
25976 2008-10-30 Alp Toker <alp@nuanti.com>
25978 Build fix attempt for older gcc on the trunk-mac-intel build bot
25979 (error: initializer for scalar variable requires one element).
25981 Modify the initializer syntax slightly with an additional comma.
25984 (JSC::Machine::cti_op_call_JSFunction):
25985 (JSC::Machine::cti_op_construct_JSConstruct):
25986 (JSC::Machine::cti_op_resolve_func):
25987 (JSC::Machine::cti_op_post_inc):
25988 (JSC::Machine::cti_op_resolve_with_base):
25989 (JSC::Machine::cti_op_post_dec):
25991 2008-10-30 Alp Toker <alp@nuanti.com>
25993 Reviewed by Alexey Proskuryakov.
25995 https://bugs.webkit.org/show_bug.cgi?id=21571
25996 VoidPtrPair breaks CTI on Linux
25998 The VoidPtrPair return change made in r37457 does not work on Linux
25999 since POD structs aren't passed in registers.
26001 This patch uses a union to vectorize VoidPtrPair to a uint64_t and
26002 matches Darwin/MSVC fixing CTI/WREC on Linux.
26004 Alexey reports no measurable change in Mac performance with this fix.
26007 (JSC::Machine::cti_op_call_JSFunction):
26008 (JSC::Machine::cti_op_construct_JSConstruct):
26009 (JSC::Machine::cti_op_resolve_func):
26010 (JSC::Machine::cti_op_post_inc):
26011 (JSC::Machine::cti_op_resolve_with_base):
26012 (JSC::Machine::cti_op_post_dec):
26016 2008-10-29 Oliver Hunt <oliver@apple.com>
26018 Reviewed by Geoff Garen.
26020 Initial work to reduce cost of JSNumberCell allocation
26022 This does the initial work needed to bring more of number
26023 allocation into CTI code directly, rather than just falling
26024 back onto the slow paths if we can't guarantee that a number
26025 cell can be reused.
26027 Initial implementation only used by op_negate to make sure
26028 it all works. In a negate heavy (though not dominated) test
26029 it results in a 10% win in the non-reusable cell case.
26033 (JSC::CTI::emitAllocateNumber):
26034 (JSC::CTI::emitNakedFastCall):
26035 (JSC::CTI::emitArithIntToImmWithJump):
26036 (JSC::CTI::privateCompileMainPass):
26037 (JSC::CTI::privateCompileSlowCases):
26039 * VM/CodeBlock.cpp:
26040 (JSC::CodeBlock::dump):
26041 * VM/CodeGenerator.cpp:
26042 (JSC::CodeGenerator::emitUnaryOp):
26043 * VM/CodeGenerator.h:
26044 (JSC::CodeGenerator::emitToJSNumber):
26045 (JSC::CodeGenerator::emitTypeOf):
26046 (JSC::CodeGenerator::emitGetPropertyNames):
26048 (JSC::Machine::privateExecute):
26050 * kjs/ResultType.h:
26051 (JSC::ResultType::isReusableNumber):
26052 (JSC::ResultType::toInt):
26054 (JSC::UnaryOpNode::emitCode):
26055 (JSC::BinaryOpNode::emitCode):
26056 (JSC::EqualNode::emitCode):
26057 * masm/X86Assembler.h:
26058 (JSC::X86Assembler::):
26059 (JSC::X86Assembler::negl_r):
26060 (JSC::X86Assembler::xorpd_mr):
26061 * runtime/JSNumberCell.h:
26062 (JSC::JSNumberCell::JSNumberCell):
26064 2008-10-29 Steve Falkenburg <sfalken@apple.com>
26066 <rdar://problem/6326563> Crash on launch
26068 For Windows, export explicit functions rather than exporting data for atomicallyInitializedStaticMutex.
26070 Exporting data from a DLL on Windows requires specifying __declspec(dllimport) in the header used by
26071 callers, but __declspec(dllexport) when defined in the DLL implementation. By instead exporting
26072 the explicit lock/unlock functions, we can avoid this.
26074 Fixes a crash on launch, since we were previously erroneously exporting atomicallyInitializedStaticMutex as a function.
26076 Reviewed by Darin Adler.
26079 (WTF::lockAtomicallyInitializedStaticMutex):
26080 (WTF::unlockAtomicallyInitializedStaticMutex):
26081 * wtf/ThreadingWin.cpp:
26082 (WTF::lockAtomicallyInitializedStaticMutex):
26083 (WTF::unlockAtomicallyInitializedStaticMutex):
26085 2008-10-29 Sam Weinig <sam@webkit.org>
26087 Reviewed by Oliver Hunt.
26089 Remove direct use of PropertyMap.
26091 * JavaScriptCore.exp:
26092 * runtime/JSObject.cpp:
26093 (JSC::JSObject::mark):
26094 (JSC::JSObject::put):
26095 (JSC::JSObject::deleteProperty):
26096 (JSC::JSObject::getPropertyAttributes):
26097 (JSC::JSObject::removeDirect):
26098 * runtime/JSObject.h:
26099 (JSC::JSObject::getDirect):
26100 (JSC::JSObject::getDirectLocation):
26101 (JSC::JSObject::hasCustomProperties):
26102 (JSC::JSObject::JSObject):
26103 (JSC::JSObject::putDirect):
26104 * runtime/PropertyMap.cpp:
26105 (JSC::PropertyMap::get):
26106 * runtime/PropertyMap.h:
26107 (JSC::PropertyMap::isEmpty):
26108 (JSC::PropertyMap::get):
26109 * runtime/StructureID.cpp:
26110 (JSC::StructureID::dumpStatistics):
26111 * runtime/StructureID.h:
26112 (JSC::StructureID::propertyStorageSize):
26113 (JSC::StructureID::get):
26114 (JSC::StructureID::put):
26115 (JSC::StructureID::remove):
26116 (JSC::StructureID::isEmpty):
26118 2008-10-29 Sam Weinig <sam@webkit.org>
26120 Reviewed by Geoffrey Garen.
26122 Rename and move the StructureID transition table to its own file.
26125 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26126 * JavaScriptCore.xcodeproj/project.pbxproj:
26127 * runtime/StructureID.cpp:
26128 (JSC::StructureID::addPropertyTransition):
26129 * runtime/StructureID.h:
26130 (JSC::StructureID::):
26131 * runtime/StructureIDTransitionTable.h: Copied from runtime/StructureID.h.
26132 (JSC::StructureIDTransitionTableHash::hash):
26133 (JSC::StructureIDTransitionTableHash::equal):
26135 2008-10-29 Sam Weinig <sam@webkit.org>
26137 Reviewed by Cameron Zwarich.
26139 Fix for https://bugs.webkit.org/show_bug.cgi?id=21958
26140 Pack bits in StructureID to reduce the size of each StructureID by 2 words.
26142 * runtime/PropertyMap.h:
26143 (JSC::PropertyMap::propertyMapSize):
26144 * runtime/StructureID.cpp:
26145 (JSC::StructureID::dumpStatistics): Add additional size statistics when dumping.
26146 (JSC::StructureID::StructureID):
26147 * runtime/StructureID.h:
26149 2008-10-29 Kevin Ollivier <kevino@theolliviers.com>
26151 wx build fixes after addition of runtime and ImageBuffer changes.
26153 * JavaScriptCoreSources.bkl:
26156 2008-10-29 Timothy Hatcher <timothy@apple.com>
26158 Emit the WillExecuteStatement debugger hook before the "else" body
26159 when there is no block for the "else" body. This allows breakpoints
26160 on those statements in the Web Inspector.
26162 https://bugs.webkit.org/show_bug.cgi?id=21944
26164 Reviewed by Maciej Stachowiak.
26167 (JSC::IfElseNode::emitCode): Emit the WillExecuteStatement
26168 debugger hook before the else node if isn't a block.
26170 2008-10-29 Alexey Proskuryakov <ap@webkit.org>
26174 * JavaScriptCore.exp: Export HashTable::deleteTable().
26176 2008-10-28 Alp Toker <alp@nuanti.com>
26178 Fix builddir != srcdir builds after kjs -> runtime breakage. Sources
26179 may now be generated in both kjs/ and runtime/.
26181 Also sort the sources list for readability.
26185 2008-10-28 Alp Toker <alp@nuanti.com>
26187 Reviewed by Cameron Zwarich.
26189 Build fix attempt after kjs -> runtime rename.
26193 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26197 Remove a duplicate includes directory.
26199 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26201 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26205 Attempt to fix the Windows build.
26207 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26208 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
26210 2008-10-28 Dan Bernstein <mitz@apple.com>
26212 Reviewed by Mark Rowe.
26214 - export WTF::atomicallyInitializedStaticMutex
26216 * JavaScriptCore.exp:
26218 2008-10-28 Geoffrey Garen <ggaren@apple.com>
26220 Reviewed by Cameron Zwarich.
26222 Fixed CodeBlock dumping to accurately report constant register indices.
26224 * VM/CodeBlock.cpp:
26225 (JSC::CodeBlock::dump):
26227 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26231 More Qt build fixes.
26233 * JavaScriptCore.pri:
26235 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26239 Fix the Qt build, hopefully for real this time.
26241 * JavaScriptCore.pri:
26243 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26249 * JavaScriptCore.pri:
26251 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26255 Fix the Windows build.
26257 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26259 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26261 Rubber-stamped by Sam Weinig.
26263 Create a runtime directory in JavaScriptCore and begin moving files to
26264 it. This is the first step towards removing the kjs directory and
26265 placing files in more meaningful subdirectories of JavaScriptCore.
26268 * API/JSCallbackConstructor.cpp:
26269 * API/JSCallbackConstructor.h:
26270 * API/JSCallbackFunction.cpp:
26271 * API/JSClassRef.cpp:
26272 * API/JSClassRef.h:
26273 * API/JSStringRefCF.cpp:
26274 * API/JSValueRef.cpp:
26275 * API/OpaqueJSString.cpp:
26276 * DerivedSources.make:
26278 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26279 * JavaScriptCore.xcodeproj/project.pbxproj:
26280 * kjs/AllInOneFile.cpp:
26281 * kjs/ArrayConstructor.cpp: Removed.
26282 * kjs/ArrayConstructor.h: Removed.
26283 * kjs/ArrayPrototype.cpp: Removed.
26284 * kjs/ArrayPrototype.h: Removed.
26285 * kjs/BooleanConstructor.cpp: Removed.
26286 * kjs/BooleanConstructor.h: Removed.
26287 * kjs/BooleanObject.cpp: Removed.
26288 * kjs/BooleanObject.h: Removed.
26289 * kjs/BooleanPrototype.cpp: Removed.
26290 * kjs/BooleanPrototype.h: Removed.
26291 * kjs/CallData.cpp: Removed.
26292 * kjs/CallData.h: Removed.
26293 * kjs/ClassInfo.h: Removed.
26294 * kjs/ConstructData.cpp: Removed.
26295 * kjs/ConstructData.h: Removed.
26296 * kjs/DateConstructor.cpp: Removed.
26297 * kjs/DateConstructor.h: Removed.
26298 * kjs/DateInstance.cpp: Removed.
26299 * kjs/DateInstance.h: Removed.
26300 * kjs/DateMath.cpp: Removed.
26301 * kjs/DateMath.h: Removed.
26302 * kjs/DatePrototype.cpp: Removed.
26303 * kjs/DatePrototype.h: Removed.
26304 * kjs/Error.cpp: Removed.
26305 * kjs/Error.h: Removed.
26306 * kjs/ErrorConstructor.cpp: Removed.
26307 * kjs/ErrorConstructor.h: Removed.
26308 * kjs/ErrorInstance.cpp: Removed.
26309 * kjs/ErrorInstance.h: Removed.
26310 * kjs/ErrorPrototype.cpp: Removed.
26311 * kjs/ErrorPrototype.h: Removed.
26312 * kjs/FunctionConstructor.cpp: Removed.
26313 * kjs/FunctionConstructor.h: Removed.
26314 * kjs/FunctionPrototype.cpp: Removed.
26315 * kjs/FunctionPrototype.h: Removed.
26316 * kjs/GlobalEvalFunction.cpp: Removed.
26317 * kjs/GlobalEvalFunction.h: Removed.
26318 * kjs/InternalFunction.cpp: Removed.
26319 * kjs/InternalFunction.h: Removed.
26320 * kjs/JSArray.cpp: Removed.
26321 * kjs/JSArray.h: Removed.
26322 * kjs/JSCell.cpp: Removed.
26323 * kjs/JSCell.h: Removed.
26324 * kjs/JSFunction.cpp: Removed.
26325 * kjs/JSFunction.h: Removed.
26326 * kjs/JSGlobalObject.cpp: Removed.
26327 * kjs/JSGlobalObject.h: Removed.
26328 * kjs/JSGlobalObjectFunctions.cpp: Removed.
26329 * kjs/JSGlobalObjectFunctions.h: Removed.
26330 * kjs/JSImmediate.cpp: Removed.
26331 * kjs/JSImmediate.h: Removed.
26332 * kjs/JSNotAnObject.cpp: Removed.
26333 * kjs/JSNotAnObject.h: Removed.
26334 * kjs/JSNumberCell.cpp: Removed.
26335 * kjs/JSNumberCell.h: Removed.
26336 * kjs/JSObject.cpp: Removed.
26337 * kjs/JSObject.h: Removed.
26338 * kjs/JSString.cpp: Removed.
26339 * kjs/JSString.h: Removed.
26340 * kjs/JSValue.cpp: Removed.
26341 * kjs/JSValue.h: Removed.
26342 * kjs/JSVariableObject.cpp: Removed.
26343 * kjs/JSVariableObject.h: Removed.
26344 * kjs/JSWrapperObject.cpp: Removed.
26345 * kjs/JSWrapperObject.h: Removed.
26346 * kjs/MathObject.cpp: Removed.
26347 * kjs/MathObject.h: Removed.
26348 * kjs/NativeErrorConstructor.cpp: Removed.
26349 * kjs/NativeErrorConstructor.h: Removed.
26350 * kjs/NativeErrorPrototype.cpp: Removed.
26351 * kjs/NativeErrorPrototype.h: Removed.
26352 * kjs/NumberConstructor.cpp: Removed.
26353 * kjs/NumberConstructor.h: Removed.
26354 * kjs/NumberObject.cpp: Removed.
26355 * kjs/NumberObject.h: Removed.
26356 * kjs/NumberPrototype.cpp: Removed.
26357 * kjs/NumberPrototype.h: Removed.
26358 * kjs/ObjectConstructor.cpp: Removed.
26359 * kjs/ObjectConstructor.h: Removed.
26360 * kjs/ObjectPrototype.cpp: Removed.
26361 * kjs/ObjectPrototype.h: Removed.
26362 * kjs/PropertyMap.cpp: Removed.
26363 * kjs/PropertyMap.h: Removed.
26364 * kjs/PropertySlot.cpp: Removed.
26365 * kjs/PropertySlot.h: Removed.
26366 * kjs/PrototypeFunction.cpp: Removed.
26367 * kjs/PrototypeFunction.h: Removed.
26368 * kjs/PutPropertySlot.h: Removed.
26369 * kjs/SmallStrings.cpp: Removed.
26370 * kjs/SmallStrings.h: Removed.
26371 * kjs/StringConstructor.cpp: Removed.
26372 * kjs/StringConstructor.h: Removed.
26373 * kjs/StringObject.cpp: Removed.
26374 * kjs/StringObject.h: Removed.
26375 * kjs/StringObjectThatMasqueradesAsUndefined.h: Removed.
26376 * kjs/StringPrototype.cpp: Removed.
26377 * kjs/StringPrototype.h: Removed.
26378 * kjs/StructureID.cpp: Removed.
26379 * kjs/StructureID.h: Removed.
26380 * kjs/completion.h:
26381 * kjs/interpreter.h:
26383 * runtime/ArrayConstructor.cpp: Copied from kjs/ArrayConstructor.cpp.
26384 * runtime/ArrayConstructor.h: Copied from kjs/ArrayConstructor.h.
26385 * runtime/ArrayPrototype.cpp: Copied from kjs/ArrayPrototype.cpp.
26386 * runtime/ArrayPrototype.h: Copied from kjs/ArrayPrototype.h.
26387 * runtime/BooleanConstructor.cpp: Copied from kjs/BooleanConstructor.cpp.
26388 * runtime/BooleanConstructor.h: Copied from kjs/BooleanConstructor.h.
26389 * runtime/BooleanObject.cpp: Copied from kjs/BooleanObject.cpp.
26390 * runtime/BooleanObject.h: Copied from kjs/BooleanObject.h.
26391 * runtime/BooleanPrototype.cpp: Copied from kjs/BooleanPrototype.cpp.
26392 * runtime/BooleanPrototype.h: Copied from kjs/BooleanPrototype.h.
26393 * runtime/CallData.cpp: Copied from kjs/CallData.cpp.
26394 * runtime/CallData.h: Copied from kjs/CallData.h.
26395 * runtime/ClassInfo.h: Copied from kjs/ClassInfo.h.
26396 * runtime/ConstructData.cpp: Copied from kjs/ConstructData.cpp.
26397 * runtime/ConstructData.h: Copied from kjs/ConstructData.h.
26398 * runtime/DateConstructor.cpp: Copied from kjs/DateConstructor.cpp.
26399 * runtime/DateConstructor.h: Copied from kjs/DateConstructor.h.
26400 * runtime/DateInstance.cpp: Copied from kjs/DateInstance.cpp.
26401 * runtime/DateInstance.h: Copied from kjs/DateInstance.h.
26402 * runtime/DateMath.cpp: Copied from kjs/DateMath.cpp.
26403 * runtime/DateMath.h: Copied from kjs/DateMath.h.
26404 * runtime/DatePrototype.cpp: Copied from kjs/DatePrototype.cpp.
26405 * runtime/DatePrototype.h: Copied from kjs/DatePrototype.h.
26406 * runtime/Error.cpp: Copied from kjs/Error.cpp.
26407 * runtime/Error.h: Copied from kjs/Error.h.
26408 * runtime/ErrorConstructor.cpp: Copied from kjs/ErrorConstructor.cpp.
26409 * runtime/ErrorConstructor.h: Copied from kjs/ErrorConstructor.h.
26410 * runtime/ErrorInstance.cpp: Copied from kjs/ErrorInstance.cpp.
26411 * runtime/ErrorInstance.h: Copied from kjs/ErrorInstance.h.
26412 * runtime/ErrorPrototype.cpp: Copied from kjs/ErrorPrototype.cpp.
26413 * runtime/ErrorPrototype.h: Copied from kjs/ErrorPrototype.h.
26414 * runtime/FunctionConstructor.cpp: Copied from kjs/FunctionConstructor.cpp.
26415 * runtime/FunctionConstructor.h: Copied from kjs/FunctionConstructor.h.
26416 * runtime/FunctionPrototype.cpp: Copied from kjs/FunctionPrototype.cpp.
26417 * runtime/FunctionPrototype.h: Copied from kjs/FunctionPrototype.h.
26418 * runtime/GlobalEvalFunction.cpp: Copied from kjs/GlobalEvalFunction.cpp.
26419 * runtime/GlobalEvalFunction.h: Copied from kjs/GlobalEvalFunction.h.
26420 * runtime/InternalFunction.cpp: Copied from kjs/InternalFunction.cpp.
26421 * runtime/InternalFunction.h: Copied from kjs/InternalFunction.h.
26422 * runtime/JSArray.cpp: Copied from kjs/JSArray.cpp.
26423 * runtime/JSArray.h: Copied from kjs/JSArray.h.
26424 * runtime/JSCell.cpp: Copied from kjs/JSCell.cpp.
26425 * runtime/JSCell.h: Copied from kjs/JSCell.h.
26426 * runtime/JSFunction.cpp: Copied from kjs/JSFunction.cpp.
26427 * runtime/JSFunction.h: Copied from kjs/JSFunction.h.
26428 * runtime/JSGlobalObject.cpp: Copied from kjs/JSGlobalObject.cpp.
26429 * runtime/JSGlobalObject.h: Copied from kjs/JSGlobalObject.h.
26430 * runtime/JSGlobalObjectFunctions.cpp: Copied from kjs/JSGlobalObjectFunctions.cpp.
26431 * runtime/JSGlobalObjectFunctions.h: Copied from kjs/JSGlobalObjectFunctions.h.
26432 * runtime/JSImmediate.cpp: Copied from kjs/JSImmediate.cpp.
26433 * runtime/JSImmediate.h: Copied from kjs/JSImmediate.h.
26434 * runtime/JSNotAnObject.cpp: Copied from kjs/JSNotAnObject.cpp.
26435 * runtime/JSNotAnObject.h: Copied from kjs/JSNotAnObject.h.
26436 * runtime/JSNumberCell.cpp: Copied from kjs/JSNumberCell.cpp.
26437 * runtime/JSNumberCell.h: Copied from kjs/JSNumberCell.h.
26438 * runtime/JSObject.cpp: Copied from kjs/JSObject.cpp.
26439 * runtime/JSObject.h: Copied from kjs/JSObject.h.
26440 * runtime/JSString.cpp: Copied from kjs/JSString.cpp.
26441 * runtime/JSString.h: Copied from kjs/JSString.h.
26442 * runtime/JSValue.cpp: Copied from kjs/JSValue.cpp.
26443 * runtime/JSValue.h: Copied from kjs/JSValue.h.
26444 * runtime/JSVariableObject.cpp: Copied from kjs/JSVariableObject.cpp.
26445 * runtime/JSVariableObject.h: Copied from kjs/JSVariableObject.h.
26446 * runtime/JSWrapperObject.cpp: Copied from kjs/JSWrapperObject.cpp.
26447 * runtime/JSWrapperObject.h: Copied from kjs/JSWrapperObject.h.
26448 * runtime/MathObject.cpp: Copied from kjs/MathObject.cpp.
26449 * runtime/MathObject.h: Copied from kjs/MathObject.h.
26450 * runtime/NativeErrorConstructor.cpp: Copied from kjs/NativeErrorConstructor.cpp.
26451 * runtime/NativeErrorConstructor.h: Copied from kjs/NativeErrorConstructor.h.
26452 * runtime/NativeErrorPrototype.cpp: Copied from kjs/NativeErrorPrototype.cpp.
26453 * runtime/NativeErrorPrototype.h: Copied from kjs/NativeErrorPrototype.h.
26454 * runtime/NumberConstructor.cpp: Copied from kjs/NumberConstructor.cpp.
26455 * runtime/NumberConstructor.h: Copied from kjs/NumberConstructor.h.
26456 * runtime/NumberObject.cpp: Copied from kjs/NumberObject.cpp.
26457 * runtime/NumberObject.h: Copied from kjs/NumberObject.h.
26458 * runtime/NumberPrototype.cpp: Copied from kjs/NumberPrototype.cpp.
26459 * runtime/NumberPrototype.h: Copied from kjs/NumberPrototype.h.
26460 * runtime/ObjectConstructor.cpp: Copied from kjs/ObjectConstructor.cpp.
26461 * runtime/ObjectConstructor.h: Copied from kjs/ObjectConstructor.h.
26462 * runtime/ObjectPrototype.cpp: Copied from kjs/ObjectPrototype.cpp.
26463 * runtime/ObjectPrototype.h: Copied from kjs/ObjectPrototype.h.
26464 * runtime/PropertyMap.cpp: Copied from kjs/PropertyMap.cpp.
26465 * runtime/PropertyMap.h: Copied from kjs/PropertyMap.h.
26466 * runtime/PropertySlot.cpp: Copied from kjs/PropertySlot.cpp.
26467 * runtime/PropertySlot.h: Copied from kjs/PropertySlot.h.
26468 * runtime/PrototypeFunction.cpp: Copied from kjs/PrototypeFunction.cpp.
26469 * runtime/PrototypeFunction.h: Copied from kjs/PrototypeFunction.h.
26470 * runtime/PutPropertySlot.h: Copied from kjs/PutPropertySlot.h.
26471 * runtime/SmallStrings.cpp: Copied from kjs/SmallStrings.cpp.
26472 * runtime/SmallStrings.h: Copied from kjs/SmallStrings.h.
26473 * runtime/StringConstructor.cpp: Copied from kjs/StringConstructor.cpp.
26474 * runtime/StringConstructor.h: Copied from kjs/StringConstructor.h.
26475 * runtime/StringObject.cpp: Copied from kjs/StringObject.cpp.
26476 * runtime/StringObject.h: Copied from kjs/StringObject.h.
26477 * runtime/StringObjectThatMasqueradesAsUndefined.h: Copied from kjs/StringObjectThatMasqueradesAsUndefined.h.
26478 * runtime/StringPrototype.cpp: Copied from kjs/StringPrototype.cpp.
26479 * runtime/StringPrototype.h: Copied from kjs/StringPrototype.h.
26480 * runtime/StructureID.cpp: Copied from kjs/StructureID.cpp.
26481 * runtime/StructureID.h: Copied from kjs/StructureID.h.
26483 2008-10-28 Geoffrey Garen <ggaren@apple.com>
26485 Reviewed by Sam Weinig.
26487 Fixed https://bugs.webkit.org/show_bug.cgi?id=21919
26488 Sampler reports bogus time in op_enter during 3d-raytrace.js
26490 Fixed a bug where we would pass the incorrect Instruction* during some
26491 parts of CTI codegen.
26494 (JSC::CTI::privateCompileMainPass):
26495 (JSC::CTI::privateCompileSlowCases):
26496 * VM/SamplingTool.cpp:
26497 (JSC::SamplingTool::run):
26500 2008-10-28 Kevin McCullough <kmccullough@apple.com>
26502 Reviewed by Dan Bernstein.
26504 -Removed unused includes.
26505 Apparent .4% speedup in Sunspider
26507 * kjs/JSObject.cpp:
26508 * kjs/interpreter.cpp:
26510 2008-10-28 Alp Toker <alp@nuanti.com>
26512 Include copyright license files in the autotools dist target.
26514 Change suggested by Mike Hommey.
26518 2008-10-27 Geoffrey Garen <ggaren@apple.com>
26520 Reviewed by Maciej Stachowiak.
26522 Stop discarding CodeBlock samples that can't be charged to a specific
26523 opcode. Instead, charge the relevant CodeBlock, and provide a footnote
26524 explaining the situation.
26526 This will help us tell which CodeBlocks are hot, even if we can't
26527 identify specific lines of code within the CodeBlocks.
26529 * VM/SamplingTool.cpp:
26530 (JSC::ScopeSampleRecord::sample):
26531 (JSC::compareScopeSampleRecords):
26532 (JSC::SamplingTool::dump):
26534 * VM/SamplingTool.h:
26535 (JSC::ScopeSampleRecord::ScopeSampleRecord):
26536 (JSC::ScopeSampleRecord::~ScopeSampleRecord):
26538 2008-10-27 Geoffrey Garen <ggaren@apple.com>
26540 Reviewed by Sam Weinig.
26542 Added a mutex around the SamplingTool's ScopeNode* map, to solve a crash
26543 when sampling the v8 tests.
26545 * VM/SamplingTool.cpp:
26546 (JSC::SamplingTool::run):
26547 (JSC::SamplingTool::notifyOfScope):
26548 * VM/SamplingTool.h: Since new ScopeNodes can be created after
26549 the SamplingTools has begun sampling, reads and writes to / from the
26550 map need to be synchronized. Shark says this doesn't measurably increase
26553 2008-10-25 Geoffrey Garen <ggaren@apple.com>
26557 Try to fix Windows build.
26560 (JSC::Machine::privateExecute): Provide a dummy value to the
26561 HostCallRecord in CTI non-sampling builds, to silence compiler warning.
26563 2008-10-25 Geoffrey Garen <ggaren@apple.com>
26567 Try to fix Windows build.
26569 * VM/SamplingTool.h:
26570 (JSC::SamplingTool::encodeSample): Explicitly cast bool to int, to
26571 silence compiler warning.
26573 2008-10-25 Geoffrey Garen <ggaren@apple.com>
26575 Reviewed by Sam Weinig, with Gavin Barraclough's help.
26577 Fixed Sampling Tool:
26578 - Made CodeBlock sampling work with CTI
26579 - Improved accuracy by unifying most sampling data into a single
26580 32bit word, which can be written / read atomically.
26581 - Split out three different #ifdefs for modularity: OPCODE_SAMPLING;
26582 CODEBLOCK_SAMPLING; OPCODE_STATS.
26583 - Improved reporting clarity
26584 - Refactored for code clarity
26586 * JavaScriptCore.exp: Exported another symbol.
26589 (JSC::CTI::emitCTICall):
26590 (JSC::CTI::compileOpCall):
26591 (JSC::CTI::emitSlowScriptCheck):
26592 (JSC::CTI::compileBinaryArithOpSlowCase):
26593 (JSC::CTI::privateCompileMainPass):
26594 (JSC::CTI::privateCompileSlowCases):
26595 (JSC::CTI::privateCompile):
26596 * VM/CTI.h: Updated CTI codegen to use the unified SamplingTool interface
26597 for encoding samples. (This required passing the current vPC to a lot
26598 more functions, since the unified interface samples the current vPC.)
26599 Added hooks for writing the current CodeBlock* on function entry and
26600 after a function call, for the sake of the CodeBlock sampler. Removed
26601 obsolete hook for clearing the current sample inside op_end. Also removed
26602 the custom enum used to differentiate flavors of op_call, since the
26603 OpcodeID enum works just as well. (This was important in an earlier
26604 version of the patch, but now it's just cleanup.)
26606 * VM/CodeBlock.cpp:
26607 (JSC::CodeBlock::lineNumberForVPC):
26608 * VM/CodeBlock.h: Upated for refactored #ifdefs. Changed lineNumberForVPC
26609 to be robust against vPCs not recorded for exception handling, since
26610 the Sampler may ask for an arbitrary vPC.
26613 (JSC::Machine::execute):
26614 (JSC::Machine::privateExecute):
26615 (JSC::Machine::cti_op_call_NotJSFunction):
26616 (JSC::Machine::cti_op_construct_NotJSConstruct):
26618 (JSC::Machine::setSampler):
26619 (JSC::Machine::sampler):
26620 (JSC::Machine::jitCodeBuffer): Upated for refactored #ifdefs. Changed
26621 Machine to use SamplingTool helper objects to record movement in and
26622 out of host code. This makes samples a bit more precise.
26625 (JSC::OpcodeStats::~OpcodeStats):
26626 * VM/Opcode.h: Upated for refactored #ifdefs. Added a little more padding,
26627 to accomodate our more verbose opcode names.
26629 * VM/SamplingTool.cpp:
26630 (JSC::ScopeSampleRecord::sample): Only count a sample toward our total
26631 if we actually record it. This solves cases where a CodeBlock will
26632 claim to have been sampled many times, with reported samples that don't
26635 (JSC::SamplingTool::run): Read the current sample into a Sample helper
26636 object, to ensure that the data doesn't change while we're analyzing it,
26637 and to help decode the data. Only access the CodeBlock sampling hash
26638 table if CodeBlock sampling has been enabled, so non-CodeBlock sampling
26639 runs can operate with even less overhead.
26641 (JSC::SamplingTool::dump): I reorganized this code a lot to print the
26642 most important info at the top, print as a table, annotate and document
26643 the stuff I didn't understand when I started, etc.
26645 * VM/SamplingTool.h: New helper classes, described above.
26651 (JSC::ScopeNode::ScopeNode): Updated for new sampling APIs.
26653 * wtf/Platform.h: Moved sampling #defines here, since our custom is to
26654 put ENABLE #defines into Platform.h. Made explicit the fact that
26655 CODEBLOCK_SAMPLING depends on OPCODE_SAMPLING.
26657 2008-10-25 Jan Michael Alonzo <jmalonzo@webkit.org>
26659 JSC Build fix, not reviewed.
26661 * VM/CTI.cpp: add missing include stdio.h for debug builds
26663 2008-10-24 Eric Seidel <eric@webkit.org>
26665 Reviewed by Darin Adler.
26667 Get rid of a bonus ASSERT when using a null string as a regexp.
26668 Specifically calling: RegularExpression::match() with String::empty()
26669 will hit this ASSERT.
26670 Chromium hits this, but I don't know of any way to make a layout test.
26672 * pcre/pcre_exec.cpp:
26675 2008-10-24 Alexey Proskuryakov <ap@webkit.org>
26677 Suggested and rubber-stamped by Geoff Garen.
26679 Fix a crash when opening Font Picker.
26681 The change also hopefully fixes this bug, which I could never reproduce:
26682 https://bugs.webkit.org/show_bug.cgi?id=20241
26683 <rdar://problem/6290576> Safari crashes at JSValueUnprotect() when fontpicker view close
26685 * API/JSContextRef.cpp: (JSContextGetGlobalObject): Use lexical global object instead of
26688 2008-10-24 Cameron Zwarich <zwarich@apple.com>
26690 Reviewed by Geoff Garen.
26692 Remove ScopeChainNode::bottom() and inline it into its only caller,
26693 ScopeChainnode::globalObject().
26695 * kjs/JSGlobalObject.h:
26696 (JSC::ScopeChainNode::globalObject):
26697 * kjs/ScopeChain.h:
26698 (JSC::ScopeChain::bottom):
26700 2008-10-24 Cameron Zwarich <zwarich@apple.com>
26702 Reviewed by Maciej Stachowiak.
26704 Bug 21862: Create JSFunction prototype property lazily
26705 <https://bugs.webkit.org/show_bug.cgi?id=21862>
26707 This is a 1.5% speedup on SunSpider and a 1.4% speedup on the V8
26708 benchmark suite, including a 3.8% speedup on Earley-Boyer.
26710 * kjs/JSFunction.cpp:
26711 (JSC::JSFunction::getOwnPropertySlot):
26713 (JSC::FuncDeclNode::makeFunction):
26714 (JSC::FuncExprNode::makeFunction):
26716 2008-10-24 Greg Bolsinga <bolsinga@apple.com>
26718 Reviewed by Sam Weinig.
26720 https://bugs.webkit.org/show_bug.cgi?id=21475
26722 Provide support for the Geolocation API
26724 http://dev.w3.org/geo/api/spec-source.html
26726 * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0
26728 2008-10-24 Darin Adler <darin@apple.com>
26730 - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
26733 * API/JSCallbackConstructor.h:
26734 * API/JSCallbackFunction.cpp:
26735 * API/JSCallbackFunction.h:
26736 * API/JSCallbackObject.h:
26737 * API/JSCallbackObjectFunctions.h:
26738 * API/JSContextRef.cpp:
26739 * API/JSObjectRef.cpp:
26740 * API/JSValueRef.cpp:
26743 * VM/CodeBlock.cpp:
26745 * VM/CodeGenerator.cpp:
26746 * VM/CodeGenerator.h:
26747 * VM/ExceptionHelpers.cpp:
26748 * VM/ExceptionHelpers.h:
26749 * VM/JSPropertyNameIterator.cpp:
26750 * VM/JSPropertyNameIterator.h:
26756 * kjs/Arguments.cpp:
26758 * kjs/ArrayConstructor.cpp:
26759 * kjs/ArrayPrototype.cpp:
26760 * kjs/BooleanConstructor.cpp:
26761 * kjs/BooleanConstructor.h:
26762 * kjs/BooleanObject.h:
26763 * kjs/BooleanPrototype.cpp:
26764 * kjs/CallData.cpp:
26766 * kjs/ConstructData.cpp:
26767 * kjs/ConstructData.h:
26768 * kjs/DateConstructor.cpp:
26769 * kjs/DateInstance.h:
26770 * kjs/DatePrototype.cpp:
26771 * kjs/DatePrototype.h:
26772 * kjs/DebuggerCallFrame.cpp:
26773 * kjs/DebuggerCallFrame.h:
26774 * kjs/ErrorConstructor.cpp:
26775 * kjs/ErrorPrototype.cpp:
26776 * kjs/ExecState.cpp:
26778 * kjs/FunctionConstructor.cpp:
26779 * kjs/FunctionPrototype.cpp:
26780 * kjs/FunctionPrototype.h:
26781 * kjs/GetterSetter.cpp:
26782 * kjs/GetterSetter.h:
26783 * kjs/InternalFunction.h:
26784 * kjs/JSActivation.cpp:
26785 * kjs/JSActivation.h:
26790 * kjs/JSFunction.cpp:
26791 * kjs/JSFunction.h:
26792 * kjs/JSGlobalData.h:
26793 * kjs/JSGlobalObject.cpp:
26794 * kjs/JSGlobalObject.h:
26795 * kjs/JSGlobalObjectFunctions.cpp:
26796 * kjs/JSGlobalObjectFunctions.h:
26797 * kjs/JSImmediate.cpp:
26798 * kjs/JSImmediate.h:
26799 * kjs/JSNotAnObject.cpp:
26800 * kjs/JSNotAnObject.h:
26801 * kjs/JSNumberCell.cpp:
26802 * kjs/JSNumberCell.h:
26803 * kjs/JSObject.cpp:
26805 * kjs/JSStaticScopeObject.cpp:
26806 * kjs/JSStaticScopeObject.h:
26807 * kjs/JSString.cpp:
26810 * kjs/JSVariableObject.h:
26811 * kjs/JSWrapperObject.h:
26812 * kjs/MathObject.cpp:
26813 * kjs/MathObject.h:
26814 * kjs/NativeErrorConstructor.cpp:
26815 * kjs/NumberConstructor.cpp:
26816 * kjs/NumberConstructor.h:
26817 * kjs/NumberObject.cpp:
26818 * kjs/NumberObject.h:
26819 * kjs/NumberPrototype.cpp:
26820 * kjs/ObjectConstructor.cpp:
26821 * kjs/ObjectPrototype.cpp:
26822 * kjs/ObjectPrototype.h:
26823 * kjs/PropertyMap.h:
26824 * kjs/PropertySlot.cpp:
26825 * kjs/PropertySlot.h:
26826 * kjs/RegExpConstructor.cpp:
26827 * kjs/RegExpConstructor.h:
26828 * kjs/RegExpMatchesArray.h:
26829 * kjs/RegExpObject.cpp:
26830 * kjs/RegExpObject.h:
26831 * kjs/RegExpPrototype.cpp:
26833 * kjs/StringConstructor.cpp:
26834 * kjs/StringObject.cpp:
26835 * kjs/StringObject.h:
26836 * kjs/StringObjectThatMasqueradesAsUndefined.h:
26837 * kjs/StringPrototype.cpp:
26838 * kjs/StructureID.cpp:
26839 * kjs/StructureID.h:
26840 * kjs/collector.cpp:
26842 * kjs/completion.h:
26844 * kjs/interpreter.cpp:
26845 * kjs/interpreter.h:
26849 * kjs/operations.cpp:
26850 * kjs/operations.h:
26852 * profiler/ProfileGenerator.cpp:
26853 * profiler/Profiler.cpp:
26854 * profiler/Profiler.h:
26855 Use JSValue* instead of JSValuePtr.
26857 2008-10-24 David Kilzer <ddkilzer@apple.com>
26863 2008-10-23 Greg Bolsinga <bolsinga@apple.com>
26865 Reviewed by Sam Weinig.
26867 https://bugs.webkit.org/show_bug.cgi?id=21475
26869 Provide support for the Geolocation API
26871 http://dev.w3.org/geo/api/spec-source.html
26873 * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0
26875 2008-10-23 David Kilzer <ddkilzer@apple.com>
26877 Bug 21832: Fix scripts using 'new File::Temp' for Perl 5.10
26879 <https://bugs.webkit.org/show_bug.cgi?id=21832>
26881 Reviewed by Sam Weinig.
26883 * pcre/dftables: Use imported tempfile() from File::Temp instead of
26884 'new File::Temp' to make the script work with Perl 5.10.
26886 2008-10-23 Gavin Barraclough <barraclough@apple.com>
26888 Reviewed by Oliver Hunt.
26890 Fix hideous pathological case performance when looking up repatch info, bug #21727.
26892 When repatching JIT code to optimize we look up records providing information about
26893 the generated code (also used to track recsources used in linking to be later released).
26894 The lookup was being performed using a linear scan of all such records.
26896 (1) Split up the different types of reptach information. This means we can search them
26897 separately, and in some cases should reduce their size.
26898 (2) In the case of property accesses, search with a binary chop over the data.
26899 (3) In the case of calls, pass a pointer to the repatch info into the relink function.
26903 (JSC::CTI::compileOpCall):
26904 (JSC::CTI::privateCompileMainPass):
26905 (JSC::CTI::privateCompileSlowCases):
26906 (JSC::CTI::privateCompile):
26907 (JSC::CTI::unlinkCall):
26908 (JSC::CTI::linkCall):
26910 * VM/CodeBlock.cpp:
26911 (JSC::CodeBlock::dump):
26912 (JSC::CodeBlock::~CodeBlock):
26913 (JSC::CodeBlock::unlinkCallers):
26914 (JSC::CodeBlock::derefStructureIDs):
26916 (JSC::StructureStubInfo::StructureStubInfo):
26917 (JSC::CallLinkInfo::CallLinkInfo):
26918 (JSC::CallLinkInfo::setUnlinked):
26919 (JSC::CallLinkInfo::isLinked):
26920 (JSC::getStructureStubInfoReturnLocation):
26922 (JSC::CodeBlock::addCaller):
26923 (JSC::CodeBlock::getStubInfo):
26924 * VM/CodeGenerator.cpp:
26925 (JSC::CodeGenerator::emitResolve):
26926 (JSC::CodeGenerator::emitGetById):
26927 (JSC::CodeGenerator::emitPutById):
26928 (JSC::CodeGenerator::emitCall):
26929 (JSC::CodeGenerator::emitConstruct):
26931 (JSC::Machine::cti_vm_lazyLinkCall):
26933 2008-10-23 Peter Kasting <pkasting@google.com>
26935 Reviewed by Adam Roben.
26937 https://bugs.webkit.org/show_bug.cgi?id=21833
26938 Place JavaScript Debugger hooks under #if ENABLE(JAVASCRIPT_DEBUGGER).
26942 2008-10-23 David Kilzer <ddkilzer@apple.com>
26944 Bug 21831: Fix create_hash_table for Perl 5.10
26946 <https://bugs.webkit.org/show_bug.cgi?id=21831>
26948 Reviewed by Sam Weinig.
26950 * kjs/create_hash_table: Escaped square brackets so that Perl 5.10
26951 doesn't try to use @nameEntries.
26953 2008-10-23 Darin Adler <darin@apple.com>
26955 - roll out https://bugs.webkit.org/show_bug.cgi?id=21732
26956 to remove the JSValuePtr class, to fix two problems
26958 1) slowness under MSVC, since it doesn't handle a
26959 class with a single pointer in it as efficiently
26962 2) uninitialized pointers in Vector
26964 * JavaScriptCore.exp: Updated.
26969 (JSC::CTI::asInteger):
26970 * VM/CodeGenerator.cpp:
26971 (JSC::CodeGenerator::addConstant):
26972 * VM/CodeGenerator.h:
26973 (JSC::CodeGenerator::JSValueHashTraits::constructDeletedValue):
26974 (JSC::CodeGenerator::JSValueHashTraits::isDeletedValue):
26976 (JSC::Machine::cti_op_add):
26977 (JSC::Machine::cti_op_pre_inc):
26978 (JSC::Machine::cti_op_get_by_id):
26979 (JSC::Machine::cti_op_get_by_id_second):
26980 (JSC::Machine::cti_op_get_by_id_generic):
26981 (JSC::Machine::cti_op_get_by_id_fail):
26982 (JSC::Machine::cti_op_instanceof):
26983 (JSC::Machine::cti_op_del_by_id):
26984 (JSC::Machine::cti_op_mul):
26985 (JSC::Machine::cti_op_call_NotJSFunction):
26986 (JSC::Machine::cti_op_resolve):
26987 (JSC::Machine::cti_op_construct_NotJSConstruct):
26988 (JSC::Machine::cti_op_get_by_val):
26989 (JSC::Machine::cti_op_sub):
26990 (JSC::Machine::cti_op_lesseq):
26991 (JSC::Machine::cti_op_negate):
26992 (JSC::Machine::cti_op_resolve_base):
26993 (JSC::Machine::cti_op_resolve_skip):
26994 (JSC::Machine::cti_op_resolve_global):
26995 (JSC::Machine::cti_op_div):
26996 (JSC::Machine::cti_op_pre_dec):
26997 (JSC::Machine::cti_op_not):
26998 (JSC::Machine::cti_op_eq):
26999 (JSC::Machine::cti_op_lshift):
27000 (JSC::Machine::cti_op_bitand):
27001 (JSC::Machine::cti_op_rshift):
27002 (JSC::Machine::cti_op_bitnot):
27003 (JSC::Machine::cti_op_mod):
27004 (JSC::Machine::cti_op_less):
27005 (JSC::Machine::cti_op_neq):
27006 (JSC::Machine::cti_op_urshift):
27007 (JSC::Machine::cti_op_bitxor):
27008 (JSC::Machine::cti_op_bitor):
27009 (JSC::Machine::cti_op_call_eval):
27010 (JSC::Machine::cti_op_throw):
27011 (JSC::Machine::cti_op_next_pname):
27012 (JSC::Machine::cti_op_typeof):
27013 (JSC::Machine::cti_op_is_undefined):
27014 (JSC::Machine::cti_op_is_boolean):
27015 (JSC::Machine::cti_op_is_number):
27016 (JSC::Machine::cti_op_is_string):
27017 (JSC::Machine::cti_op_is_object):
27018 (JSC::Machine::cti_op_is_function):
27019 (JSC::Machine::cti_op_stricteq):
27020 (JSC::Machine::cti_op_nstricteq):
27021 (JSC::Machine::cti_op_to_jsnumber):
27022 (JSC::Machine::cti_op_in):
27023 (JSC::Machine::cti_op_del_by_val):
27024 (JSC::Machine::cti_vm_throw):
27025 Removed calls to payload functions.
27028 (JSC::Register::Register): Removed overload for JSCell and call
27029 to payload function.
27031 * kjs/JSCell.h: Changed JSCell to derive from JSValue again.
27032 Removed JSValuePtr constructor.
27033 (JSC::asCell): Changed cast from reinterpret_cast to static_cast.
27035 * kjs/JSImmediate.h: Removed JSValuePtr class. Added typedef back.
27038 (JSC::JSValue::JSValue): Added empty protected inline constructor back.
27039 (JSC::JSValue::~JSValue): Same for destructor.
27040 Removed == and != operator for JSValuePtr.
27042 * kjs/PropertySlot.h:
27043 (JSC::PropertySlot::PropertySlot): Chnaged argument to const JSValue*
27044 and added a const_cast.
27046 * kjs/protect.h: Removed overloads and specialization for JSValuePtr.
27048 2008-10-22 Oliver Hunt <oliver@apple.com>
27050 Reviewed by Maciej Stachowiak.
27052 Really "fix" CTI mode on windows 2k3.
27054 This adds new methods fastMallocExecutable and fastFreeExecutable
27055 to wrap allocation for cti code. This still just makes fastMalloc
27056 return executable memory all the time, which will be fixed in a
27059 However in windows debug builds all executable allocations will be
27060 allocated on separate executable pages, which should resolve any
27061 remaining 2k3 issues. Conveniently the 2k3 bot will now also fail
27062 if there are any fastFree vs. fastFreeExecutable errors.
27065 * VM/CodeBlock.cpp:
27066 (JSC::CodeBlock::~CodeBlock):
27068 (JSC::RegExp::~RegExp):
27069 * masm/X86Assembler.h:
27070 (JSC::JITCodeBuffer::copy):
27071 * wtf/FastMalloc.cpp:
27072 (WTF::fastMallocExecutable):
27073 (WTF::fastFreeExecutable):
27074 (WTF::TCMallocStats::fastMallocExecutable):
27075 (WTF::TCMallocStats::fastFreeExecutable):
27076 * wtf/FastMalloc.h:
27078 2008-10-22 Darin Adler <darin@apple.com>
27080 Reviewed by Sam Weinig.
27082 - fix https://bugs.webkit.org/show_bug.cgi?id=21294
27083 Bug 21294: Devirtualize getOwnPropertySlot()
27085 A bit over 3% faster on V8 tests.
27087 * JavascriptCore.exp: Export leak-related functions..
27089 * API/JSCallbackConstructor.h:
27090 (JSC::JSCallbackConstructor::createStructureID): Set HasStandardGetOwnPropertySlot
27091 since this class doesn't override getPropertySlot.
27092 * API/JSCallbackFunction.h:
27093 (JSC::JSCallbackFunction::createStructureID): Ditto.
27095 * VM/ExceptionHelpers.cpp:
27096 (JSC::InterruptedExecutionError::InterruptedExecutionError): Use a structure
27097 that's created just for this class instead of trying to share a single "null
27098 prototype" structure.
27101 (JSC::Machine::cti_op_create_arguments_no_params): Rename
27102 Arguments::ArgumentsNoParameters to Arguments::NoParameters.
27104 * kjs/Arguments.h: Rename the enum from Arguments::ArgumentsParameters to
27105 Arguments::NoParametersType and the value from Arguments::ArgumentsNoParameters
27106 to Arguments::NoParameters.
27107 (JSC::Arguments::createStructureID): Added. Returns a structure without
27108 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27109 (JSC::Arguments::Arguments): Added an assertion that there are no parameters.
27111 * kjs/DatePrototype.h:
27112 (JSC::DatePrototype::createStructureID): Added. Returns a structure without
27113 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27115 * kjs/FunctionPrototype.h:
27116 (JSC::FunctionPrototype::createStructureID): Set HasStandardGetOwnPropertySlot
27117 since this class doesn't override getPropertySlot.
27118 * kjs/InternalFunction.h:
27119 (JSC::InternalFunction::createStructureID): Ditto.
27122 (JSC::JSArray::createStructureID): Added. Returns a structure without
27123 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27125 * kjs/JSCell.h: Added declaration of fastGetOwnPropertySlot; a non-virtual
27126 version that uses the structure bit to decide whether to call the virtual
27129 * kjs/JSFunction.h:
27130 (JSC::JSFunction::createStructureID): Added. Returns a structure without
27131 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27133 * kjs/JSGlobalData.cpp:
27134 (JSC::JSGlobalData::JSGlobalData): Initialize new structures; removed
27135 nullProtoStructureID.
27136 * kjs/JSGlobalData.h: Added new structures. Removed nullProtoStructureID.
27138 * kjs/JSGlobalObject.h:
27139 (JSC::JSGlobalObject::createStructureID): Added. Returns a structure without
27140 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27142 * kjs/JSNotAnObject.h:
27143 (JSC::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub): Use a structure
27144 that's created just for this class instead of trying to share a single "null
27145 prototype" structure.
27146 (JSC::JSNotAnObjectErrorStub::isNotAnObjectErrorStub): Marked this function
27147 virtual for clarity and made it private since no one should call it if they
27148 already have a pointer to this specific type.
27149 (JSC::JSNotAnObject::JSNotAnObject): Use a structure that's created just
27150 for this class instead of trying to share a single "null prototype" structure.
27151 (JSC::JSNotAnObject::createStructureID): Added. Returns a structure without
27152 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27155 (JSC::JSObject::createStructureID): Added HasStandardGetOwnPropertySlot.
27156 (JSC::JSObject::inlineGetOwnPropertySlot): Added. Used so we can share code
27157 between getOwnPropertySlot and fastGetOwnPropertySlot.
27158 (JSC::JSObject::getOwnPropertySlot): Moved so that functions are above the
27159 functions that call them. Moved the guts of this function into
27160 inlineGetOwnPropertySlot.
27161 (JSC::JSCell::fastGetOwnPropertySlot): Added. Checks the
27162 HasStandardGetOwnPropertySlot bit and if it's set, calls
27163 inlineGetOwnPropertySlot, otherwise calls getOwnPropertySlot.
27164 (JSC::JSObject::getPropertySlot): Changed to call fastGetOwnPropertySlot.
27165 (JSC::JSValue::get): Changed to call fastGetOwnPropertySlot.
27167 * kjs/JSWrapperObject.h: Made constructor protected to emphasize that
27168 this class is only a base class and never instantiated.
27170 * kjs/MathObject.h:
27171 (JSC::MathObject::createStructureID): Added. Returns a structure without
27172 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27173 * kjs/NumberConstructor.h:
27174 (JSC::NumberConstructor::createStructureID): Ditto.
27175 * kjs/RegExpConstructor.h:
27176 (JSC::RegExpConstructor::createStructureID): Ditto.
27177 * kjs/RegExpObject.h:
27178 (JSC::RegExpObject::createStructureID): Ditto.
27179 * kjs/StringObject.h:
27180 (JSC::StringObject::createStructureID): Ditto.
27182 * kjs/TypeInfo.h: Added HasStandardGetOwnPropertySlot flag and
27183 hasStandardGetOwnPropertySlot accessor function.
27185 2008-10-22 Cameron Zwarich <zwarich@apple.com>
27187 Reviewed by Geoff Garen.
27189 Bug 21803: Fuse op_jfalse with op_eq_null and op_neq_null
27190 <https://bugs.webkit.org/show_bug.cgi?id=21803>
27192 Fuse op_jfalse with op_eq_null and op_neq_null to make the new opcodes
27193 op_jeq_null and op_jneq_null.
27195 This is a 2.6% speedup on the V8 Raytrace benchmark, and strangely also
27196 a 4.7% speedup on the V8 Arguments benchmark, even though it uses
27197 neither of the two new opcodes.
27200 (JSC::CTI::privateCompileMainPass):
27201 * VM/CodeBlock.cpp:
27202 (JSC::CodeBlock::dump):
27203 * VM/CodeGenerator.cpp:
27204 (JSC::CodeGenerator::emitJumpIfTrue):
27205 (JSC::CodeGenerator::emitJumpIfFalse):
27207 (JSC::Machine::privateExecute):
27210 2008-10-22 Darin Fisher <darin@chromium.org>
27212 Reviewed by Eric Seidel.
27214 Should not define PLATFORM(WIN,MAC,GTK) when PLATFORM(CHROMIUM) is defined
27215 https://bugs.webkit.org/show_bug.cgi?id=21757
27217 PLATFORM(CHROMIUM) implies HAVE_ACCESSIBILITY
27221 2008-10-22 Cameron Zwarich <zwarich@apple.com>
27223 Reviewed by Alexey Proskuryakov.
27225 Correct opcode names in documentation.
27228 (JSC::Machine::privateExecute):
27230 2008-10-21 Oliver Hunt <oliver@apple.com>
27232 RS=Maciej Stachowiak.
27234 Force FastMalloc to make all allocated pages executable in
27235 a vague hope this will allow the Win2k3 bot to be able to
27238 Filed Bug 21783: Need more granular control over allocation of executable memory
27239 to cover a more granular version of this patch.
27241 * wtf/TCSystemAlloc.cpp:
27244 2008-10-21 Alexey Proskuryakov <ap@webkit.org>
27246 Reviewed by Darin Adler.
27248 https://bugs.webkit.org/show_bug.cgi?id=21769
27249 MessagePort should be GC protected if there are messages to be delivered
27251 * wtf/MessageQueue.h:
27252 (WTF::::isEmpty): Added. Also added a warning for methods that return a snapshot of queue
27253 state, thus likely to cause race conditions.
27255 2008-10-21 Darin Adler <darin@apple.com>
27257 Reviewed by Maciej Stachowiak.
27259 - convert post-increment to pre-increment in a couple more places for speed
27261 Speeds up V8 benchmarks a little on most computers. (But, strangely, slows
27262 them down a little on my computer.)
27265 (JSC::statementListEmitCode): Removed default argument, since we always want
27266 to specify this explicitly.
27267 (JSC::ForNode::emitCode): Tolerate ignoredResult() as the dst -- means the
27269 (JSC::ReturnNode::emitCode): Ditto.
27270 (JSC::ThrowNode::emitCode): Ditto.
27271 (JSC::FunctionBodyNode::emitCode): Pass ignoredResult() so that we know we
27272 don't have to compute the result of function statements.
27274 2008-10-21 Peter Kasting <pkasting@google.com>
27276 Reviewed by Maciej Stachowiak.
27278 Fix an include of a non-public header to use "" instead of <>.
27280 * API/JSProfilerPrivate.cpp:
27282 2008-10-20 Sam Weinig <sam@webkit.org>
27284 Reviewed by Cameron Zwarich.
27286 Fix for https://bugs.webkit.org/show_bug.cgi?id=21766
27287 REGRESSION: 12 JSC tests fail
27289 The JSGlobalObject was mutating the shared nullProtoStructureID when
27290 used in jsc. Instead of using nullProtoStructureID, use a new StructureID.
27292 * API/JSCallbackObject.h:
27293 * API/JSCallbackObjectFunctions.h:
27294 (JSC::::JSCallbackObject):
27295 * API/JSContextRef.cpp:
27296 (JSGlobalContextCreateInGroup):
27297 * kjs/JSGlobalObject.h:
27298 (JSC::JSGlobalObject::JSGlobalObject):
27300 (GlobalObject::GlobalObject):
27303 2008-10-20 Cameron Zwarich <zwarich@apple.com>
27305 Reviewed by Maciej Stachowiak.
27307 Remove an untaken branch in CodeGenerator::emitJumpIfFalse(). This
27308 function is never called with a backwards target LabelID, and there is
27309 even an assertion to this effect at the top of the function body.
27311 * VM/CodeGenerator.cpp:
27312 (JSC::CodeGenerator::emitJumpIfFalse):
27314 2008-10-20 Cameron Zwarich <zwarich@apple.com>
27316 Rubber-stamped by Sam Weinig.
27318 Add opcode documentation for undocumented opcodes.
27321 (JSC::Machine::privateExecute):
27323 2008-10-16 Sam Weinig <sam@webkit.org>
27325 Reviewed by Cameron Zwarich.
27327 Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
27328 Don't create intermediate StructureIDs for builtin objects
27330 Second stage in reduce number of StructureIDs created when initializing the
27333 - Use putDirectWithoutTransition for the remaining singleton objects to reduce
27334 the number of StructureIDs create for about:blank from 132 to 73.
27336 * kjs/ArrayConstructor.cpp:
27337 (JSC::ArrayConstructor::ArrayConstructor):
27338 * kjs/BooleanConstructor.cpp:
27339 (JSC::BooleanConstructor::BooleanConstructor):
27340 * kjs/BooleanPrototype.cpp:
27341 (JSC::BooleanPrototype::BooleanPrototype):
27342 * kjs/DateConstructor.cpp:
27343 (JSC::DateConstructor::DateConstructor):
27344 * kjs/ErrorConstructor.cpp:
27345 (JSC::ErrorConstructor::ErrorConstructor):
27346 * kjs/ErrorPrototype.cpp:
27347 (JSC::ErrorPrototype::ErrorPrototype):
27348 * kjs/FunctionConstructor.cpp:
27349 (JSC::FunctionConstructor::FunctionConstructor):
27350 * kjs/FunctionPrototype.cpp:
27351 (JSC::FunctionPrototype::FunctionPrototype):
27352 (JSC::FunctionPrototype::addFunctionProperties):
27353 * kjs/FunctionPrototype.h:
27354 (JSC::FunctionPrototype::createStructureID):
27355 * kjs/InternalFunction.cpp:
27356 * kjs/InternalFunction.h:
27357 (JSC::InternalFunction::InternalFunction):
27358 * kjs/JSGlobalObject.cpp:
27359 (JSC::JSGlobalObject::reset):
27361 * kjs/MathObject.cpp:
27362 (JSC::MathObject::MathObject):
27363 * kjs/NumberConstructor.cpp:
27364 (JSC::NumberConstructor::NumberConstructor):
27365 * kjs/NumberPrototype.cpp:
27366 (JSC::NumberPrototype::NumberPrototype):
27367 * kjs/ObjectConstructor.cpp:
27368 (JSC::ObjectConstructor::ObjectConstructor):
27369 * kjs/RegExpConstructor.cpp:
27370 (JSC::RegExpConstructor::RegExpConstructor):
27371 * kjs/RegExpPrototype.cpp:
27372 (JSC::RegExpPrototype::RegExpPrototype):
27373 * kjs/StringConstructor.cpp:
27374 (JSC::StringConstructor::StringConstructor):
27375 * kjs/StringPrototype.cpp:
27376 (JSC::StringPrototype::StringPrototype):
27377 * kjs/StructureID.cpp:
27378 (JSC::StructureID::dumpStatistics):
27379 * kjs/StructureID.h:
27380 (JSC::StructureID::setPrototypeWithoutTransition):
27382 2008-10-20 Alp Toker <alp@nuanti.com>
27384 Fix autotools dist build target by listing recently added header
27385 files only. Not reviewed.
27389 2008-10-20 Geoffrey Garen <ggaren@apple.com>
27391 Reviewed by Anders Carlsson.
27394 (JSC::Machine::tryCacheGetByID): Removed a redundant and sometimes
27395 incorrect cast, which started ASSERTing after Darin's last checkin.
27397 2008-10-20 Geoffrey Garen <ggaren@apple.com>
27401 Re-enable CTI, which I accidentally disabled while checking in fixes
27406 2008-10-20 Alp Toker <alp@nuanti.com>
27408 Rubber-stamped by Mark Rowe.
27410 Typo fix in function name: mimimum -> minimum.
27412 * kjs/DateMath.cpp:
27413 (JSC::minimumYearForDST):
27414 (JSC::equivalentYearForDST):
27416 2008-10-20 Alp Toker <alp@nuanti.com>
27418 Reviewed by Mark Rowe.
27420 Use pthread instead of GThread where possible in the GTK+ port. This
27421 fixes issues with global initialisation, particularly on GTK+/Win32
27422 where a late g_thread_init() will cause hangs.
27427 * wtf/ThreadingGtk.cpp:
27428 * wtf/ThreadingPthreads.cpp:
27430 2008-10-20 Geoffrey Garen <ggaren@apple.com>
27432 Reviewed by Darin Adler.
27434 Fixed https://bugs.webkit.org/show_bug.cgi?id=21735
27435 Emit profiling instrumentation only if the Web Inspector's profiling
27438 22.2% speedup on empty function call benchmark.
27439 2.9% speedup on v8 benchmark.
27440 0.7% speedup on SunSpider.
27442 Lesser but similar speedups in bytecode.
27445 (JSC::CTI::compileOpCall):
27446 (JSC::CTI::privateCompileMainPass):
27447 (JSC::CTI::privateCompileSlowCases): Nixed JITed profiler hooks. Profiler
27448 hooks now have their own opcodes. Added support for compiling profiler
27451 (JSC::CodeBlock::dump): Dump support for the new profiling opcodes.
27453 * VM/CodeGenerator.h:
27454 * VM/CodeGenerator.cpp:
27455 (JSC::CodeGenerator::CodeGenerator):
27456 (JSC::CodeGenerator::emitCall):
27457 (JSC::CodeGenerator::emitConstruct): Conditionally emit profiling hooks
27458 around call and construct, at the call site. (It's easier to get things
27459 right this way, if you have profiled code calling non-profiled code.
27460 Also, you get a slightly more accurate profile, since you charge the full
27461 cost of the call / construct operation to the callee.)
27463 Also, fixed a bug where construct would fetch the ".prototype" property
27464 from the constructor before evaluating the arguments to the constructor,
27465 incorrectly allowing an "invalid constructor" exception to short-circuit
27466 argument evaluation. I encountered this bug when trying to make
27467 constructor exceptions work with profiling.
27470 (JSC::Machine::callEval): Removed obsolete profiler hooks.
27472 (JSC::Machine::throwException): Added a check for an exception thrown
27473 within a call instruction. We didn't need this before because the call
27474 instruction would check for a valid call before involing the profiler.
27475 (JSC::Machine::execute): Added a didExecute hook at the end of top-level
27476 function invocation, since op_ret no longer does this for us.
27478 (JSC::Machine::privateExecute): Removed obsolete profiler hooks. Added
27479 profiler opcodes. Changed some ++vPC to vPC[x] notation, since the
27480 latter is better for performance, and it makes reasoning about the
27481 current opcode in exception handling much simpler.
27483 (JSC::Machine::cti_op_call_NotJSFunction): Removed obsolete profiler
27486 (JSC::Machine::cti_op_create_arguments_no_params): Added missing
27487 CTI_STACK_HACK that I noticed when adding CTI_STACK_HACK to the new
27488 profiler opcode functions.
27490 (JSC::Machine::cti_op_profile_will_call):
27491 (JSC::Machine::cti_op_profile_did_call): The new profiler opcode
27494 (JSC::Machine::cti_op_construct_NotJSConstruct): Removed obsolete profiler
27498 (JSC::Machine::isCallOpcode): Helper for exception handling.
27500 * VM/Opcode.h: Declare new opcodes.
27502 * kjs/JSGlobalObject.h:
27503 (JSC::JSGlobalObject::supportsProfiling): Added virtual interface that
27504 allows WebCore to specify whether the target global object has the Web
27505 Inspector's profiling feature enabled.
27507 * profiler/Profiler.cpp:
27508 (JSC::Profiler::willExecute):
27509 (JSC::Profiler::didExecute):
27510 (JSC::Profiler::createCallIdentifier):
27511 * profiler/Profiler.h: Added support for invoking the profiler with
27512 an arbitrary JSValue*, and not a known object. We didn't need this
27513 before because the call instruction would check for a valid call before
27514 involing the profiler.
27516 2008-10-20 Darin Adler <darin@apple.com>
27518 Reviewed by Geoff Garen.
27520 - get CTI working on Windows again
27523 (JSC::CTI::emitCTICall): Add an overload for functions that
27525 * VM/CTI.h: Use JSValue* and JSObject* as return types for
27526 cti_op functions. Apparently, MSVC doesn't handle returning
27527 the JSValuePtr struct in a register. We'll have to look into
27531 (JSC::Machine::cti_op_convert_this):
27532 (JSC::Machine::cti_op_add):
27533 (JSC::Machine::cti_op_pre_inc):
27534 (JSC::Machine::cti_op_new_object):
27535 (JSC::Machine::cti_op_get_by_id):
27536 (JSC::Machine::cti_op_get_by_id_second):
27537 (JSC::Machine::cti_op_get_by_id_generic):
27538 (JSC::Machine::cti_op_get_by_id_fail):
27539 (JSC::Machine::cti_op_instanceof):
27540 (JSC::Machine::cti_op_del_by_id):
27541 (JSC::Machine::cti_op_mul):
27542 (JSC::Machine::cti_op_new_func):
27543 (JSC::Machine::cti_op_push_activation):
27544 (JSC::Machine::cti_op_call_NotJSFunction):
27545 (JSC::Machine::cti_op_new_array):
27546 (JSC::Machine::cti_op_resolve):
27547 (JSC::Machine::cti_op_construct_JSConstructFast):
27548 (JSC::Machine::cti_op_construct_NotJSConstruct):
27549 (JSC::Machine::cti_op_get_by_val):
27550 (JSC::Machine::cti_op_sub):
27551 (JSC::Machine::cti_op_lesseq):
27552 (JSC::Machine::cti_op_negate):
27553 (JSC::Machine::cti_op_resolve_base):
27554 (JSC::Machine::cti_op_resolve_skip):
27555 (JSC::Machine::cti_op_resolve_global):
27556 (JSC::Machine::cti_op_div):
27557 (JSC::Machine::cti_op_pre_dec):
27558 (JSC::Machine::cti_op_not):
27559 (JSC::Machine::cti_op_eq):
27560 (JSC::Machine::cti_op_lshift):
27561 (JSC::Machine::cti_op_bitand):
27562 (JSC::Machine::cti_op_rshift):
27563 (JSC::Machine::cti_op_bitnot):
27564 (JSC::Machine::cti_op_new_func_exp):
27565 (JSC::Machine::cti_op_mod):
27566 (JSC::Machine::cti_op_less):
27567 (JSC::Machine::cti_op_neq):
27568 (JSC::Machine::cti_op_urshift):
27569 (JSC::Machine::cti_op_bitxor):
27570 (JSC::Machine::cti_op_new_regexp):
27571 (JSC::Machine::cti_op_bitor):
27572 (JSC::Machine::cti_op_call_eval):
27573 (JSC::Machine::cti_op_throw):
27574 (JSC::Machine::cti_op_next_pname):
27575 (JSC::Machine::cti_op_typeof):
27576 (JSC::Machine::cti_op_is_undefined):
27577 (JSC::Machine::cti_op_is_boolean):
27578 (JSC::Machine::cti_op_is_number):
27579 (JSC::Machine::cti_op_is_string):
27580 (JSC::Machine::cti_op_is_object):
27581 (JSC::Machine::cti_op_is_function):
27582 (JSC::Machine::cti_op_stricteq):
27583 (JSC::Machine::cti_op_nstricteq):
27584 (JSC::Machine::cti_op_to_jsnumber):
27585 (JSC::Machine::cti_op_in):
27586 (JSC::Machine::cti_op_push_new_scope):
27587 (JSC::Machine::cti_op_del_by_val):
27588 (JSC::Machine::cti_op_new_error):
27589 (JSC::Machine::cti_vm_throw):
27590 Change these functions to return pointer types, and never
27592 * VM/Machine.h: Ditto.
27594 2008-10-20 Geoffrey Garen <ggaren@apple.com>
27596 Reviewed by Darin Adler.
27598 Fixed some recent break-age in bytecode mode.
27600 * VM/CodeBlock.cpp:
27601 (JSC::CodeBlock::printStructureIDs): Fixed up an ASSERT caused by
27602 Gavin's last checkin. This is a temporary fix so I can keep on moving.
27603 I'll send email about what I think is an underlying problem soon.
27606 (JSC::Machine::privateExecute): Removed a redundant and sometimes
27607 incorrect cast, which started ASSERTing after Darin's last checkin.
27609 2008-10-20 Darin Adler <darin@apple.com>
27611 - another similar Windows build fix
27613 * VM/CTI.cpp: Changed return type to JSObject* instead of JSValuePtr.
27615 2008-10-20 Darin Adler <darin@apple.com>
27617 - try to fix Windows build
27619 * VM/CTI.cpp: Use JSValue* instead of JSValuePtr for ctiTrampoline.
27622 2008-10-19 Darin Adler <darin@apple.com>
27624 Reviewed by Cameron Zwarich.
27626 - finish https://bugs.webkit.org/show_bug.cgi?id=21732
27627 improve performance by eliminating JSValue as a base class for JSCell
27630 (JSC::Machine::cti_op_call_profiler): Use asFunction.
27631 (JSC::Machine::cti_vm_lazyLinkCall): Ditto.
27632 (JSC::Machine::cti_op_construct_JSConstructFast): Use asObject.
27634 * kjs/JSCell.h: Re-sort friend classes. Eliminate inheritance from
27635 JSValue. Changed cast in asCell from static_cast to reinterpret_cast.
27636 Removed JSValue::getNumber(double&) and one of JSValue::getObject
27639 * kjs/JSValue.h: Made the private constructor and destructor both
27640 non-virtual and also remove the definitions. This class can never
27641 be instantiated or derived.
27643 2008-10-19 Darin Adler <darin@apple.com>
27645 Reviewed by Cameron Zwarich.
27647 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
27648 improve performance by eliminating JSValue as a base class for JSCell
27650 Change JSValuePtr from a typedef into a class. This allows us to support
27651 conversion from JSCell* to JSValuePtr even if JSCell isn't derived from
27654 * JavaScriptCore.exp: Updated symbols that involve JSValuePtr, since
27655 it's now a distinct type.
27658 (toRef): Extract the JSValuePtr payload explicitly since we can't just
27661 (JSC::CTI::asInteger): Ditto.
27663 * VM/CodeGenerator.cpp:
27664 (JSC::CodeGenerator::addConstant): Get at the payload directly.
27665 (JSC::CodeGenerator::emitLoad): Added an overload of JSCell* because
27666 otherwise classes derived from JSValue end up calling the bool
27667 overload instead of JSValuePtr.
27668 * VM/CodeGenerator.h: Ditto. Also update traits to use JSValue*
27669 and the payload functions.
27671 * VM/Register.h: Added a JSCell* overload and use of payload functions.
27674 (JSC::asCell): Use payload function.
27675 (JSC::JSValue::asCell): Use JSValue* instead of JSValuePtr.
27676 (JSC::JSValuePtr::JSValuePtr): Added. Constructor that takes JSCell*
27677 and creates a JSValuePtr.
27679 * kjs/JSImmediate.h: Added JSValuePtr class. Also updated makeValue
27680 and makeInt to work with JSValue* and the payload function.
27682 * kjs/JSValue.h: Added == and != operators for JSValuePtr. Put them
27683 here because eventually all the JSValue functions should go here
27684 except what's needed by JSImmediate. Also fix asValue to use
27685 JSValue* instead of JSValuePtr.
27687 * kjs/PropertySlot.h: Change constructor to take JSValuePtr.
27689 * kjs/protect.h: Update gcProtect functions to work with JSCell*
27690 as well as JSValuePtr. Also updated the ProtectedPtr<JSValuePtr>
27691 specialization to work more directly. Also changed all the call
27692 sites to use gcProtectNullTolerant.
27694 2008-10-19 Darin Adler <darin@apple.com>
27696 Reviewed by Oliver Hunt.
27698 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
27699 improve performance by eliminating JSValue as a base class for JSCell
27701 Remove most uses of JSValue, which will be removed in a future patch.
27704 (JSC::fastToUInt32): Call toUInt32SlowCase function; no longer a member
27706 * kjs/JSNumberCell.h:
27707 (JSC::JSNumberCell::toInt32): Ditto.
27708 (JSC::JSNumberCell::toUInt32): Ditto.
27711 (JSC::toInt32SlowCase): Made a non-member function.
27712 (JSC::JSValue::toInt32SlowCase): Changed to call non-member function.
27713 (JSC::toUInt32SlowCase): More of the same.
27714 (JSC::JSValue::toUInt32SlowCase): Ditto.
27716 * kjs/JSValue.h: Moved static member function so they are no longer
27717 member functions at all.
27719 * VM/CTI.h: Removed forward declaration of JSValue.
27720 * VM/ExceptionHelpers.h: Ditto.
27721 * kjs/CallData.h: Ditto.
27722 * kjs/ConstructData.h: Ditto.
27723 * kjs/JSGlobalObjectFunctions.h: Ditto.
27724 * kjs/PropertyMap.h: Ditto.
27725 * kjs/StructureID.h: Ditto.
27726 * kjs/collector.h: Ditto.
27727 * kjs/completion.h: Ditto.
27730 (JSC::makeBitwiseNotNode): Call new non-member toInt32 function.
27731 (JSC::makeLeftShiftNode): More of the same.
27732 (JSC::makeRightShiftNode): Ditto.
27734 * kjs/protect.h: Added a specialization for ProtectedPtr<JSValuePtr>
27735 so this can be used with JSValuePtr.
27737 2008-10-18 Darin Adler <darin@apple.com>
27739 Reviewed by Oliver Hunt.
27741 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
27742 improve performance by eliminating JSValue as a base class for JSCell
27744 Tweak a little more to get closer to where we can make JSValuePtr a class.
27747 (toJS): Change back to JSValue* here, since we're converting the
27750 (JSC::CTI::unlinkCall): Call asPointer.
27751 * VM/CTI.h: Cast to JSValue* here, since it's a pointer cast.
27752 * kjs/DebuggerCallFrame.h:
27753 (JSC::DebuggerCallFrame::DebuggerCallFrame): Call noValue.
27754 * kjs/JSGlobalData.cpp:
27755 (JSC::JSGlobalData::JSGlobalData): Call noValue.
27756 * kjs/JSImmediate.cpp:
27757 (JSC::JSImmediate::toObject): Remove unneeded const_cast.
27758 * kjs/JSWrapperObject.h:
27759 (JSC::JSWrapperObject::JSWrapperObject): Call noValue.
27761 2008-10-18 Darin Adler <darin@apple.com>
27763 - fix non-all-in-one build
27765 * kjs/completion.h:
27766 (JSC::Completion::Completion): Add include of JSValue.h.
27768 2008-10-18 Darin Adler <darin@apple.com>
27770 Reviewed by Oliver Hunt.
27772 - fix assertions I introduced with my casting changes
27774 These were showing up as failures in the JavaScriptCore tests.
27777 (JSC::Machine::cti_op_instanceof): Remove the bogus asCell casting that
27778 was at the top of the function, and instead cast at the point of use.
27779 (JSC::Machine::cti_op_construct_NotJSConstruct): Moved the cast to
27780 object after checking the construct type.
27782 2008-10-18 Darin Adler <darin@apple.com>
27784 - fix non-all-in-one build
27786 * kjs/JSGlobalObjectFunctions.h: Add include of JSImmedate.h (for now).
27788 2008-10-18 Darin Adler <darin@apple.com>
27792 * kjs/interpreter.h: Include JSValue.h instead of JSImmediate.h.
27794 2008-10-18 Darin Adler <darin@apple.com>
27796 * kjs/interpreter.h: Fix include of JSImmediate.h.
27798 2008-10-18 Darin Adler <darin@apple.com>
27800 - fix non-all-in-one build
27802 * kjs/interpreter.h: Add include of JSImmediate.h.
27804 2008-10-18 Darin Adler <darin@apple.com>
27806 - fix non-all-in-one build
27808 * kjs/ConstructData.h: Add include of JSImmedate.h (for now).
27810 2008-10-18 Darin Adler <darin@apple.com>
27812 - try to fix Windows build
27815 (JSC::Machine::Machine): Use JSCell* type since MSVC seems to only allow
27816 calling ~JSCell directly if it's a JSCell*.
27818 2008-10-18 Darin Adler <darin@apple.com>
27820 Reviewed by Cameron Zwarich.
27822 - next step on https://bugs.webkit.org/show_bug.cgi?id=21732
27823 improve performance by eliminating JSValue as a base class for JSCell
27825 Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
27826 changing JSValuePtr to be a class, and then eventually renaming it
27827 to JSValue once that's done.
27829 * JavaScriptCore.exp: Update entry points, since some now take JSValue*
27830 instead of const JSValue*.
27833 * API/JSCallbackConstructor.h:
27834 * API/JSCallbackFunction.cpp:
27835 * API/JSCallbackFunction.h:
27836 * API/JSCallbackObject.h:
27837 * API/JSCallbackObjectFunctions.h:
27838 * API/JSContextRef.cpp:
27839 * API/JSObjectRef.cpp:
27840 * API/JSValueRef.cpp:
27843 * VM/CodeBlock.cpp:
27845 * VM/CodeGenerator.cpp:
27846 * VM/CodeGenerator.h:
27847 * VM/ExceptionHelpers.cpp:
27848 * VM/ExceptionHelpers.h:
27849 * VM/JSPropertyNameIterator.cpp:
27850 * VM/JSPropertyNameIterator.h:
27856 * kjs/Arguments.cpp:
27858 * kjs/ArrayConstructor.cpp:
27859 * kjs/ArrayPrototype.cpp:
27860 * kjs/BooleanConstructor.cpp:
27861 * kjs/BooleanConstructor.h:
27862 * kjs/BooleanObject.h:
27863 * kjs/BooleanPrototype.cpp:
27864 * kjs/CallData.cpp:
27866 * kjs/ConstructData.cpp:
27867 * kjs/ConstructData.h:
27868 * kjs/DateConstructor.cpp:
27869 * kjs/DateInstance.h:
27870 * kjs/DatePrototype.cpp:
27871 * kjs/DebuggerCallFrame.cpp:
27872 * kjs/DebuggerCallFrame.h:
27873 * kjs/ErrorConstructor.cpp:
27874 * kjs/ErrorPrototype.cpp:
27875 * kjs/ExecState.cpp:
27877 * kjs/FunctionConstructor.cpp:
27878 * kjs/FunctionPrototype.cpp:
27879 * kjs/GetterSetter.cpp:
27880 * kjs/GetterSetter.h:
27881 * kjs/InternalFunction.h:
27882 * kjs/JSActivation.cpp:
27883 * kjs/JSActivation.h:
27888 * kjs/JSFunction.cpp:
27889 * kjs/JSFunction.h:
27890 * kjs/JSGlobalData.h:
27891 * kjs/JSGlobalObject.cpp:
27892 * kjs/JSGlobalObject.h:
27893 * kjs/JSGlobalObjectFunctions.cpp:
27894 * kjs/JSGlobalObjectFunctions.h:
27895 * kjs/JSImmediate.cpp:
27896 * kjs/JSImmediate.h:
27897 * kjs/JSNotAnObject.cpp:
27898 * kjs/JSNotAnObject.h:
27899 * kjs/JSNumberCell.cpp:
27900 * kjs/JSNumberCell.h:
27901 * kjs/JSObject.cpp:
27903 * kjs/JSStaticScopeObject.cpp:
27904 * kjs/JSStaticScopeObject.h:
27905 * kjs/JSString.cpp:
27908 * kjs/JSVariableObject.h:
27909 * kjs/JSWrapperObject.h:
27910 * kjs/MathObject.cpp:
27911 * kjs/NativeErrorConstructor.cpp:
27912 * kjs/NumberConstructor.cpp:
27913 * kjs/NumberConstructor.h:
27914 * kjs/NumberObject.cpp:
27915 * kjs/NumberObject.h:
27916 * kjs/NumberPrototype.cpp:
27917 * kjs/ObjectConstructor.cpp:
27918 * kjs/ObjectPrototype.cpp:
27919 * kjs/ObjectPrototype.h:
27920 * kjs/PropertyMap.h:
27921 * kjs/PropertySlot.cpp:
27922 * kjs/PropertySlot.h:
27923 * kjs/RegExpConstructor.cpp:
27924 * kjs/RegExpConstructor.h:
27925 * kjs/RegExpMatchesArray.h:
27926 * kjs/RegExpObject.cpp:
27927 * kjs/RegExpObject.h:
27928 * kjs/RegExpPrototype.cpp:
27930 * kjs/StringConstructor.cpp:
27931 * kjs/StringObject.cpp:
27932 * kjs/StringObject.h:
27933 * kjs/StringObjectThatMasqueradesAsUndefined.h:
27934 * kjs/StringPrototype.cpp:
27935 * kjs/StructureID.cpp:
27936 * kjs/StructureID.h:
27937 * kjs/collector.cpp:
27939 * kjs/completion.h:
27941 * kjs/interpreter.cpp:
27942 * kjs/interpreter.h:
27946 * kjs/operations.cpp:
27947 * kjs/operations.h:
27949 * profiler/ProfileGenerator.cpp:
27950 Replace JSValue* with JSValuePtr.
27952 2008-10-18 Darin Adler <darin@apple.com>
27955 (JSC::Machine::cti_op_call_eval): Removed stray parentheses from my
27958 2008-10-18 Darin Adler <darin@apple.com>
27960 Reviewed by Oliver Hunt.
27962 - first step of https://bugs.webkit.org/show_bug.cgi?id=21732
27963 improve performance by eliminating JSValue as a base class for JSCell
27965 Remove casts from JSValue* to derived classes, replacing them with
27966 calls to inline casting functions. These functions are also a bit
27967 better than aidrect cast because they also do a runtime assertion.
27969 Removed use of 0 as for JSValue*, changing call sites to use a
27970 noValue() function instead.
27972 Move things needed by classes derived from JSValue out of the class,
27973 since the classes won't be deriving from JSValue any more soon.
27975 I did most of these changes by changing JSValue to not be JSValue* any
27976 more, then fixing a lot of the compilation problems, then rolling out
27977 the JSValue change.
27979 1.011x as fast on SunSpider (presumably due to some of the Machine.cpp changes)
27981 * API/APICast.h: Removed unneeded forward declarations.
27983 * API/JSCallbackObject.h: Added an asCallbackObject function for casting.
27984 * API/JSCallbackObjectFunctions.h:
27985 (JSC::JSCallbackObject::asCallbackObject): Added.
27986 (JSC::JSCallbackObject::getOwnPropertySlot): Use asObject.
27987 (JSC::JSCallbackObject::call): Use noValue.
27988 (JSC::JSCallbackObject::staticValueGetter): Use asCallbackObject.
27989 (JSC::JSCallbackObject::staticFunctionGetter): Ditto.
27990 (JSC::JSCallbackObject::callbackGetter): Ditto.
27992 * JavaScriptCore.exp: Updated.
27994 * JavaScriptCore.xcodeproj/project.pbxproj: Added RegExpMatchesArray.h.
27997 (JSC::CTI::asInteger): Added. For use casting a JSValue to an integer.
27998 (JSC::CTI::emitGetArg): Use asInteger.
27999 (JSC::CTI::emitGetPutArg): Ditto.
28000 (JSC::CTI::getConstantImmediateNumericArg): Ditto. Also use noValue.
28001 (JSC::CTI::emitInitRegister): Use asInteger.
28002 (JSC::CTI::getDeTaggedConstantImmediate): Ditto.
28003 (JSC::CTI::compileOpCallInitializeCallFrame): Ditto.
28004 (JSC::CTI::compileOpCall): Ditto.
28005 (JSC::CTI::compileOpStrictEq): Ditto.
28006 (JSC::CTI::privateCompileMainPass): Ditto.
28007 (JSC::CTI::privateCompileGetByIdProto): Ditto.
28008 (JSC::CTI::privateCompileGetByIdChain): Ditto.
28009 (JSC::CTI::privateCompilePutByIdTransition): Ditto.
28010 * VM/CTI.h: Rewrite the ARG-related macros to use C++ casts instead of
28011 C casts and get rid of some extra parentheses. Addd declaration of
28014 * VM/CodeGenerator.cpp:
28015 (JSC::CodeGenerator::emitEqualityOp): Use asString.
28016 (JSC::CodeGenerator::emitLoad): Use noValue.
28017 (JSC::CodeGenerator::findScopedProperty): Change globalObject argument
28018 to JSObject* instead of JSValue*.
28019 (JSC::CodeGenerator::emitResolve): Remove unneeded cast.
28020 (JSC::CodeGenerator::emitGetScopedVar): Use asCell.
28021 (JSC::CodeGenerator::emitPutScopedVar): Ditto.
28022 * VM/CodeGenerator.h: Changed out argument of findScopedProperty.
28023 Also change the JSValueMap to use PtrHash explicitly instead of
28024 getting it from DefaultHash.
28026 * VM/JSPropertyNameIterator.cpp:
28027 (JSC::JSPropertyNameIterator::toPrimitive): Use noValue.
28028 * VM/JSPropertyNameIterator.h:
28029 (JSC::JSPropertyNameIterator::next): Ditto.
28032 (JSC::fastIsNumber): Moved isImmediate check here instead of
28033 checking for 0 inside Heap::isNumber. Use asCell and asNumberCell.
28034 (JSC::fastToInt32): Ditto.
28035 (JSC::fastToUInt32): Ditto.
28036 (JSC::jsLess): Use asString.
28037 (JSC::jsLessEq): Ditto.
28038 (JSC::jsAdd): Ditto.
28039 (JSC::jsTypeStringForValue): Use asObject.
28040 (JSC::jsIsObjectType): Ditto.
28041 (JSC::jsIsFunctionType): Ditto.
28042 (JSC::inlineResolveBase): Use noValue.
28043 (JSC::Machine::callEval): Use asString. Initialize result to
28045 (JSC::Machine::Machine): Remove unneeded casts to JSCell*.
28046 (JSC::Machine::throwException): Use asObject.
28047 (JSC::Machine::debug): Remove explicit calls to the DebuggerCallFrame
28049 (JSC::Machine::checkTimeout): Use noValue.
28050 (JSC::cachePrototypeChain): Use asObject.
28051 (JSC::Machine::tryCachePutByID): Use asCell.
28052 (JSC::Machine::tryCacheGetByID): Use aCell and asObject.
28053 (JSC::Machine::privateExecute): Use noValue, asCell, asObject, asString,
28054 asArray, asActivation, asFunction. Changed code that creates call frames
28055 for host functions to pass 0 for the function pointer -- the call frame
28056 needs a JSFunction* and a host function object is not one. This was
28057 caught by the assertions in the casting functions. Also remove some
28058 unneeded casts in cases where two values are compared.
28059 (JSC::Machine::retrieveLastCaller): Use noValue.
28060 (JSC::Machine::tryCTICachePutByID): Use asCell.
28061 (JSC::Machine::tryCTICacheGetByID): Use aCell and asObject.
28062 (JSC::setUpThrowTrampolineReturnAddress): Added this function to restore
28063 the PIC-branch-avoidance that was recently lost.
28064 (JSC::Machine::cti_op_add): Use asString.
28065 (JSC::Machine::cti_op_instanceof): Use asCell and asObject.
28066 (JSC::Machine::cti_op_call_JSFunction): Use asFunction.
28067 (JSC::Machine::cti_op_call_NotJSFunction): Changed code to pass 0 for
28068 the function pointer, since we don't have a JSFunction. Use asObject.
28069 (JSC::Machine::cti_op_tear_off_activation): Use asActivation.
28070 (JSC::Machine::cti_op_construct_JSConstruct): Use asFunction and asObject.
28071 (JSC::Machine::cti_op_construct_NotJSConstruct): use asObject.
28072 (JSC::Machine::cti_op_get_by_val): Use asArray and asString.
28073 (JSC::Machine::cti_op_resolve_func): Use asPointer; this helps prepare
28074 us for a situation where JSValue is not a pointer.
28075 (JSC::Machine::cti_op_put_by_val): Use asArray.
28076 (JSC::Machine::cti_op_put_by_val_array): Ditto.
28077 (JSC::Machine::cti_op_resolve_global): Use asGlobalObject.
28078 (JSC::Machine::cti_op_post_inc): Change VM_CHECK_EXCEPTION_2 to
28079 VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
28080 that point. Also use asPointer.
28081 (JSC::Machine::cti_op_resolve_with_base): Use asPointer.
28082 (JSC::Machine::cti_op_post_dec): Change VM_CHECK_EXCEPTION_2 to
28083 VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
28084 that point. Also use asPointer.
28085 (JSC::Machine::cti_op_call_eval): Use asObject, noValue, and change
28086 VM_CHECK_EXCEPTION_ARG to VM_THROW_EXCEPTION_AT_END.
28087 (JSC::Machine::cti_op_throw): Change return value to a JSValue*.
28088 (JSC::Machine::cti_op_in): Use asObject.
28089 (JSC::Machine::cti_op_switch_char): Use asString.
28090 (JSC::Machine::cti_op_switch_string): Ditto.
28091 (JSC::Machine::cti_op_put_getter): Use asObject.
28092 (JSC::Machine::cti_op_put_setter): Ditto.
28093 (JSC::Machine::cti_vm_throw): Change return value to a JSValue*.
28095 * VM/Machine.h: Change return values of both cti_op_throw and
28096 cti_vm_throw to JSValue*.
28098 * VM/Register.h: Remove nullJSValue, which is the same thing
28099 as noValue(). Also removed unneeded definition of JSValue.
28101 * kjs/ArgList.h: Removed unneeded definition of JSValue.
28104 (JSC::asArguments): Added.
28106 * kjs/ArrayPrototype.cpp:
28107 (JSC::getProperty): Use noValue.
28108 (JSC::arrayProtoFuncToString): Use asArray.
28109 (JSC::arrayProtoFuncToLocaleString): Ditto.
28110 (JSC::arrayProtoFuncConcat): Ditto.
28111 (JSC::arrayProtoFuncPop): Ditto. Also removed unneeded initialization
28112 of the result, which is set in both sides of the branch.
28113 (JSC::arrayProtoFuncPush): Ditto.
28114 (JSC::arrayProtoFuncShift): Removed unneeded initialization
28115 of the result, which is set in both sides of the branch.
28116 (JSC::arrayProtoFuncSort): Use asArray.
28118 * kjs/BooleanObject.h:
28119 (JSC::asBooleanObject): Added.
28121 * kjs/BooleanPrototype.cpp:
28122 (JSC::booleanProtoFuncToString): Use asBooleanObject.
28123 (JSC::booleanProtoFuncValueOf): Ditto.
28125 * kjs/CallData.cpp:
28126 (JSC::call): Use asObject and asFunction.
28127 * kjs/ConstructData.cpp:
28128 (JSC::construct): Ditto.
28130 * kjs/DateConstructor.cpp:
28131 (JSC::constructDate): Use asDateInstance.
28133 * kjs/DateInstance.h:
28134 (JSC::asDateInstance): Added.
28136 * kjs/DatePrototype.cpp:
28137 (JSC::dateProtoFuncToString): Use asDateInstance.
28138 (JSC::dateProtoFuncToUTCString): Ditto.
28139 (JSC::dateProtoFuncToDateString): Ditto.
28140 (JSC::dateProtoFuncToTimeString): Ditto.
28141 (JSC::dateProtoFuncToLocaleString): Ditto.
28142 (JSC::dateProtoFuncToLocaleDateString): Ditto.
28143 (JSC::dateProtoFuncToLocaleTimeString): Ditto.
28144 (JSC::dateProtoFuncValueOf): Ditto.
28145 (JSC::dateProtoFuncGetTime): Ditto.
28146 (JSC::dateProtoFuncGetFullYear): Ditto.
28147 (JSC::dateProtoFuncGetUTCFullYear): Ditto.
28148 (JSC::dateProtoFuncToGMTString): Ditto.
28149 (JSC::dateProtoFuncGetMonth): Ditto.
28150 (JSC::dateProtoFuncGetUTCMonth): Ditto.
28151 (JSC::dateProtoFuncGetDate): Ditto.
28152 (JSC::dateProtoFuncGetUTCDate): Ditto.
28153 (JSC::dateProtoFuncGetDay): Ditto.
28154 (JSC::dateProtoFuncGetUTCDay): Ditto.
28155 (JSC::dateProtoFuncGetHours): Ditto.
28156 (JSC::dateProtoFuncGetUTCHours): Ditto.
28157 (JSC::dateProtoFuncGetMinutes): Ditto.
28158 (JSC::dateProtoFuncGetUTCMinutes): Ditto.
28159 (JSC::dateProtoFuncGetSeconds): Ditto.
28160 (JSC::dateProtoFuncGetUTCSeconds): Ditto.
28161 (JSC::dateProtoFuncGetMilliSeconds): Ditto.
28162 (JSC::dateProtoFuncGetUTCMilliseconds): Ditto.
28163 (JSC::dateProtoFuncGetTimezoneOffset): Ditto.
28164 (JSC::dateProtoFuncSetTime): Ditto.
28165 (JSC::setNewValueFromTimeArgs): Ditto.
28166 (JSC::setNewValueFromDateArgs): Ditto.
28167 (JSC::dateProtoFuncSetYear): Ditto.
28168 (JSC::dateProtoFuncGetYear): Ditto.
28170 * kjs/DebuggerCallFrame.cpp:
28171 (JSC::DebuggerCallFrame::thisObject): Use asObject.
28172 (JSC::DebuggerCallFrame::evaluate): Use noValue.
28173 * kjs/DebuggerCallFrame.h: Added a constructor that
28174 takes only a callFrame.
28177 (JSC::ExecState::clearException): Use noValue.
28179 * kjs/FunctionPrototype.cpp:
28180 (JSC::functionProtoFuncToString): Use asFunction.
28181 (JSC::functionProtoFuncApply): Use asArguments and asArray.
28183 * kjs/GetterSetter.cpp:
28184 (JSC::GetterSetter::getPrimitiveNumber): Use noValue.
28186 * kjs/GetterSetter.h:
28187 (JSC::asGetterSetter): Added.
28189 * kjs/InternalFunction.cpp:
28190 (JSC::InternalFunction::name): Use asString.
28192 * kjs/InternalFunction.h:
28193 (JSC::asInternalFunction): Added.
28195 * kjs/JSActivation.cpp:
28196 (JSC::JSActivation::argumentsGetter): Use asActivation.
28198 * kjs/JSActivation.h:
28199 (JSC::asActivation): Added.
28202 (JSC::JSArray::putSlowCase): Use noValue.
28203 (JSC::JSArray::deleteProperty): Ditto.
28204 (JSC::JSArray::increaseVectorLength): Ditto.
28205 (JSC::JSArray::setLength): Ditto.
28206 (JSC::JSArray::pop): Ditto.
28207 (JSC::JSArray::sort): Ditto.
28208 (JSC::JSArray::compactForSorting): Ditto.
28210 (JSC::asArray): Added.
28213 (JSC::JSCell::getJSNumber): Use noValue.
28216 (JSC::asCell): Added.
28217 (JSC::JSValue::asCell): Changed to not preserve const.
28218 Given the wide use of JSValue* and JSCell*, it's not
28219 really useful to use const.
28220 (JSC::JSValue::isNumber): Use asValue.
28221 (JSC::JSValue::isString): Ditto.
28222 (JSC::JSValue::isGetterSetter): Ditto.
28223 (JSC::JSValue::isObject): Ditto.
28224 (JSC::JSValue::getNumber): Ditto.
28225 (JSC::JSValue::getString): Ditto.
28226 (JSC::JSValue::getObject): Ditto.
28227 (JSC::JSValue::getCallData): Ditto.
28228 (JSC::JSValue::getConstructData): Ditto.
28229 (JSC::JSValue::getUInt32): Ditto.
28230 (JSC::JSValue::getTruncatedInt32): Ditto.
28231 (JSC::JSValue::getTruncatedUInt32): Ditto.
28232 (JSC::JSValue::mark): Ditto.
28233 (JSC::JSValue::marked): Ditto.
28234 (JSC::JSValue::toPrimitive): Ditto.
28235 (JSC::JSValue::getPrimitiveNumber): Ditto.
28236 (JSC::JSValue::toBoolean): Ditto.
28237 (JSC::JSValue::toNumber): Ditto.
28238 (JSC::JSValue::toString): Ditto.
28239 (JSC::JSValue::toObject): Ditto.
28240 (JSC::JSValue::toThisObject): Ditto.
28241 (JSC::JSValue::needsThisConversion): Ditto.
28242 (JSC::JSValue::toThisString): Ditto.
28243 (JSC::JSValue::getJSNumber): Ditto.
28245 * kjs/JSFunction.cpp:
28246 (JSC::JSFunction::argumentsGetter): Use asFunction.
28247 (JSC::JSFunction::callerGetter): Ditto.
28248 (JSC::JSFunction::lengthGetter): Ditto.
28249 (JSC::JSFunction::construct): Use asObject.
28251 * kjs/JSFunction.h:
28252 (JSC::asFunction): Added.
28254 * kjs/JSGlobalObject.cpp:
28255 (JSC::lastInPrototypeChain): Use asObject.
28257 * kjs/JSGlobalObject.h:
28258 (JSC::asGlobalObject): Added.
28259 (JSC::ScopeChainNode::globalObject): Use asGlobalObject.
28261 * kjs/JSImmediate.h: Added noValue, asPointer, and makeValue
28262 functions. Use rawValue, makeValue, and noValue consistently
28263 instead of doing reinterpret_cast in various functions.
28265 * kjs/JSNumberCell.h:
28266 (JSC::asNumberCell): Added.
28267 (JSC::JSValue::uncheckedGetNumber): Use asValue and asNumberCell.
28268 (JSC::JSValue::toJSNumber): Use asValue.
28270 * kjs/JSObject.cpp:
28271 (JSC::JSObject::put): Use asObject and asGetterSetter.
28272 (JSC::callDefaultValueFunction): Use noValue.
28273 (JSC::JSObject::defineGetter): Use asGetterSetter.
28274 (JSC::JSObject::defineSetter): Ditto.
28275 (JSC::JSObject::lookupGetter): Ditto. Also use asObject.
28276 (JSC::JSObject::lookupSetter): Ditto.
28277 (JSC::JSObject::hasInstance): Use asObject.
28278 (JSC::JSObject::fillGetterPropertySlot): Use asGetterSetter.
28281 (JSC::JSObject::getDirect): Use noValue.
28282 (JSC::asObject): Added.
28283 (JSC::JSValue::isObject): Use asValue.
28284 (JSC::JSObject::get): Removed unneeded const_cast.
28285 (JSC::JSObject::getPropertySlot): Use asObject.
28286 (JSC::JSValue::get): Removed unneeded const_cast.
28287 Use asValue, asCell, and asObject.
28288 (JSC::JSValue::put): Ditto.
28289 (JSC::JSObject::allocatePropertyStorageInline): Fixed spelling
28290 of "oldPropertStorage".
28292 * kjs/JSString.cpp:
28293 (JSC::JSString::getOwnPropertySlot): Use asObject.
28296 (JSC::asString): Added.
28297 (JSC::JSValue::toThisJSString): Use asValue.
28299 * kjs/JSValue.h: Make PreferredPrimitiveType a top level enum
28300 instead of a member of JSValue. Added an asValue function that
28301 returns this. Removed overload of asCell for const. Use asValue
28302 instead of getting right at this.
28304 * kjs/ObjectPrototype.cpp:
28305 (JSC::objectProtoFuncIsPrototypeOf): Use asObject.
28306 (JSC::objectProtoFuncDefineGetter): Ditto.
28307 (JSC::objectProtoFuncDefineSetter): Ditto.
28309 * kjs/PropertySlot.h:
28310 (JSC::PropertySlot::PropertySlot): Take a const JSValue* so the
28311 callers don't have to worry about const.
28312 (JSC::PropertySlot::clearBase): Use noValue.
28313 (JSC::PropertySlot::clearValue): Ditto.
28315 * kjs/RegExpConstructor.cpp:
28316 (JSC::regExpConstructorDollar1): Use asRegExpConstructor.
28317 (JSC::regExpConstructorDollar2): Ditto.
28318 (JSC::regExpConstructorDollar3): Ditto.
28319 (JSC::regExpConstructorDollar4): Ditto.
28320 (JSC::regExpConstructorDollar5): Ditto.
28321 (JSC::regExpConstructorDollar6): Ditto.
28322 (JSC::regExpConstructorDollar7): Ditto.
28323 (JSC::regExpConstructorDollar8): Ditto.
28324 (JSC::regExpConstructorDollar9): Ditto.
28325 (JSC::regExpConstructorInput): Ditto.
28326 (JSC::regExpConstructorMultiline): Ditto.
28327 (JSC::regExpConstructorLastMatch): Ditto.
28328 (JSC::regExpConstructorLastParen): Ditto.
28329 (JSC::regExpConstructorLeftContext): Ditto.
28330 (JSC::regExpConstructorRightContext): Ditto.
28331 (JSC::setRegExpConstructorInput): Ditto.
28332 (JSC::setRegExpConstructorMultiline): Ditto.
28333 (JSC::constructRegExp): Use asObject.
28335 * kjs/RegExpConstructor.h:
28336 (JSC::asRegExpConstructor): Added.
28338 * kjs/RegExpObject.cpp:
28339 (JSC::regExpObjectGlobal): Use asRegExpObject.
28340 (JSC::regExpObjectIgnoreCase): Ditto.
28341 (JSC::regExpObjectMultiline): Ditto.
28342 (JSC::regExpObjectSource): Ditto.
28343 (JSC::regExpObjectLastIndex): Ditto.
28344 (JSC::setRegExpObjectLastIndex): Ditto.
28345 (JSC::callRegExpObject): Ditto.
28347 * kjs/RegExpObject.h:
28348 (JSC::asRegExpObject): Added.
28350 * kjs/RegExpPrototype.cpp:
28351 (JSC::regExpProtoFuncTest): Use asRegExpObject.
28352 (JSC::regExpProtoFuncExec): Ditto.
28353 (JSC::regExpProtoFuncCompile): Ditto.
28354 (JSC::regExpProtoFuncToString): Ditto.
28356 * kjs/StringObject.h:
28357 (JSC::StringObject::internalValue): Use asString.
28358 (JSC::asStringObject): Added.
28360 * kjs/StringPrototype.cpp:
28361 (JSC::stringProtoFuncReplace): Use asRegExpObject.
28362 (JSC::stringProtoFuncToString): Ue asStringObject.
28363 (JSC::stringProtoFuncMatch): Use asRegExpObject.
28364 (JSC::stringProtoFuncSearch): Ditto.
28365 (JSC::stringProtoFuncSplit): Ditto.
28367 * kjs/StructureID.cpp:
28368 (JSC::StructureID::getEnumerablePropertyNames): Use asObject.
28369 (JSC::StructureID::createCachedPrototypeChain): Ditto.
28370 (JSC::StructureIDChain::StructureIDChain): Use asCell and asObject.
28373 (JSC::Heap::isNumber): Removed null handling. This can only be called
28375 (JSC::Heap::cellBlock): Removed overload for const and non-const.
28376 Whether the JSCell* is const or not really should have no effect on
28377 whether you can modify the collector block it's in.
28379 * kjs/interpreter.cpp:
28380 (JSC::Interpreter::evaluate): Use noValue and noObject.
28383 (JSC::FunctionCallResolveNode::emitCode): Use JSObject for the global
28384 object rather than JSValue.
28385 (JSC::PostfixResolveNode::emitCode): Ditto.
28386 (JSC::PrefixResolveNode::emitCode): Ditto.
28387 (JSC::ReadModifyResolveNode::emitCode): Ditto.
28388 (JSC::AssignResolveNode::emitCode): Ditto.
28390 * kjs/operations.h:
28391 (JSC::equalSlowCaseInline): Use asString, asCell, asNumberCell,
28392 (JSC::strictEqualSlowCaseInline): Ditto.
28394 2008-10-18 Cameron Zwarich <zwarich@apple.com>
28396 Reviewed by Oliver Hunt.
28398 Bug 21702: Special op_create_activation for the case where there are no named parameters
28399 <https://bugs.webkit.org/show_bug.cgi?id=21702>
28401 This is a 2.5% speedup on the V8 Raytrace benchmark and a 1.1% speedup
28402 on the V8 Earley-Boyer benchmark.
28405 (JSC::CTI::privateCompileMainPass):
28407 (JSC::Machine::cti_op_create_arguments_no_params):
28410 (JSC::Arguments::):
28411 (JSC::Arguments::Arguments):
28413 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28415 Reviewed by Cameron Zwarich.
28417 - in debug builds, alter the stack to avoid blowing out MallocStackLogging
28419 (In essence, while executing a CTI function we alter the return
28420 address to jscGeneratedNativeCode so that a single consistent
28421 function is on the stack instead of many random functions without
28426 (JSC::doSetReturnAddress):
28428 (JSC::StackHack::StackHack):
28429 (JSC::StackHack::~StackHack):
28430 (JSC::Machine::cti_op_convert_this):
28431 (JSC::Machine::cti_op_end):
28432 (JSC::Machine::cti_op_add):
28433 (JSC::Machine::cti_op_pre_inc):
28434 (JSC::Machine::cti_timeout_check):
28435 (JSC::Machine::cti_register_file_check):
28436 (JSC::Machine::cti_op_loop_if_less):
28437 (JSC::Machine::cti_op_loop_if_lesseq):
28438 (JSC::Machine::cti_op_new_object):
28439 (JSC::Machine::cti_op_put_by_id):
28440 (JSC::Machine::cti_op_put_by_id_second):
28441 (JSC::Machine::cti_op_put_by_id_generic):
28442 (JSC::Machine::cti_op_put_by_id_fail):
28443 (JSC::Machine::cti_op_get_by_id):
28444 (JSC::Machine::cti_op_get_by_id_second):
28445 (JSC::Machine::cti_op_get_by_id_generic):
28446 (JSC::Machine::cti_op_get_by_id_fail):
28447 (JSC::Machine::cti_op_instanceof):
28448 (JSC::Machine::cti_op_del_by_id):
28449 (JSC::Machine::cti_op_mul):
28450 (JSC::Machine::cti_op_new_func):
28451 (JSC::Machine::cti_op_call_profiler):
28452 (JSC::Machine::cti_op_call_JSFunction):
28453 (JSC::Machine::cti_vm_lazyLinkCall):
28454 (JSC::Machine::cti_vm_compile):
28455 (JSC::Machine::cti_op_push_activation):
28456 (JSC::Machine::cti_op_call_NotJSFunction):
28457 (JSC::Machine::cti_op_create_arguments):
28458 (JSC::Machine::cti_op_tear_off_activation):
28459 (JSC::Machine::cti_op_tear_off_arguments):
28460 (JSC::Machine::cti_op_ret_profiler):
28461 (JSC::Machine::cti_op_ret_scopeChain):
28462 (JSC::Machine::cti_op_new_array):
28463 (JSC::Machine::cti_op_resolve):
28464 (JSC::Machine::cti_op_construct_JSConstructFast):
28465 (JSC::Machine::cti_op_construct_JSConstruct):
28466 (JSC::Machine::cti_op_construct_NotJSConstruct):
28467 (JSC::Machine::cti_op_get_by_val):
28468 (JSC::Machine::cti_op_resolve_func):
28469 (JSC::Machine::cti_op_sub):
28470 (JSC::Machine::cti_op_put_by_val):
28471 (JSC::Machine::cti_op_put_by_val_array):
28472 (JSC::Machine::cti_op_lesseq):
28473 (JSC::Machine::cti_op_loop_if_true):
28474 (JSC::Machine::cti_op_negate):
28475 (JSC::Machine::cti_op_resolve_base):
28476 (JSC::Machine::cti_op_resolve_skip):
28477 (JSC::Machine::cti_op_resolve_global):
28478 (JSC::Machine::cti_op_div):
28479 (JSC::Machine::cti_op_pre_dec):
28480 (JSC::Machine::cti_op_jless):
28481 (JSC::Machine::cti_op_not):
28482 (JSC::Machine::cti_op_jtrue):
28483 (JSC::Machine::cti_op_post_inc):
28484 (JSC::Machine::cti_op_eq):
28485 (JSC::Machine::cti_op_lshift):
28486 (JSC::Machine::cti_op_bitand):
28487 (JSC::Machine::cti_op_rshift):
28488 (JSC::Machine::cti_op_bitnot):
28489 (JSC::Machine::cti_op_resolve_with_base):
28490 (JSC::Machine::cti_op_new_func_exp):
28491 (JSC::Machine::cti_op_mod):
28492 (JSC::Machine::cti_op_less):
28493 (JSC::Machine::cti_op_neq):
28494 (JSC::Machine::cti_op_post_dec):
28495 (JSC::Machine::cti_op_urshift):
28496 (JSC::Machine::cti_op_bitxor):
28497 (JSC::Machine::cti_op_new_regexp):
28498 (JSC::Machine::cti_op_bitor):
28499 (JSC::Machine::cti_op_call_eval):
28500 (JSC::Machine::cti_op_throw):
28501 (JSC::Machine::cti_op_get_pnames):
28502 (JSC::Machine::cti_op_next_pname):
28503 (JSC::Machine::cti_op_push_scope):
28504 (JSC::Machine::cti_op_pop_scope):
28505 (JSC::Machine::cti_op_typeof):
28506 (JSC::Machine::cti_op_is_undefined):
28507 (JSC::Machine::cti_op_is_boolean):
28508 (JSC::Machine::cti_op_is_number):
28509 (JSC::Machine::cti_op_is_string):
28510 (JSC::Machine::cti_op_is_object):
28511 (JSC::Machine::cti_op_is_function):
28512 (JSC::Machine::cti_op_stricteq):
28513 (JSC::Machine::cti_op_nstricteq):
28514 (JSC::Machine::cti_op_to_jsnumber):
28515 (JSC::Machine::cti_op_in):
28516 (JSC::Machine::cti_op_push_new_scope):
28517 (JSC::Machine::cti_op_jmp_scopes):
28518 (JSC::Machine::cti_op_put_by_index):
28519 (JSC::Machine::cti_op_switch_imm):
28520 (JSC::Machine::cti_op_switch_char):
28521 (JSC::Machine::cti_op_switch_string):
28522 (JSC::Machine::cti_op_del_by_val):
28523 (JSC::Machine::cti_op_put_getter):
28524 (JSC::Machine::cti_op_put_setter):
28525 (JSC::Machine::cti_op_new_error):
28526 (JSC::Machine::cti_op_debug):
28527 (JSC::Machine::cti_vm_throw):
28529 2008-10-17 Gavin Barraclough <barraclough@apple.com>
28531 Optimize op_call by allowing call sites to be directly linked to callees.
28533 For the hot path of op_call, CTI now generates a check (initially for an impossible
28534 value), and the first time the call is executed we attempt to link the call directly
28535 to the callee. We can currently only do so if the arity of the caller and callee
28536 match. The (optimized) setup for the call on the hot path is linked directly to
28537 the ctiCode for the callee, without indirection.
28539 Two forms of the slow case of the call are generated, the first will be executed the
28540 first time the call is reached. As well as this path attempting to link the call to
28541 a callee, it also relinks the slow case to a second slow case, which will not continue
28542 to attempt relinking the call. (This policy could be changed in future, but for not
28543 this is intended to prevent thrashing).
28545 If a callee that the caller has been linked to is garbage collected, then the link
28546 in the caller's JIt code will be reset back to a value that cannot match - to prevent
28547 any false positive matches.
28549 ~20% progression on deltablue & richards, >12% overall reduction in v8-tests
28550 runtime, one or two percent progression on sunspider.
28552 Reviewed by Oliver Hunt.
28556 (JSC::CTI::emitNakedCall):
28557 (JSC::unreachable):
28558 (JSC::CTI::compileOpCallInitializeCallFrame):
28559 (JSC::CTI::compileOpCallSetupArgs):
28560 (JSC::CTI::compileOpCall):
28561 (JSC::CTI::privateCompileMainPass):
28562 (JSC::CTI::privateCompileSlowCases):
28563 (JSC::CTI::privateCompile):
28564 (JSC::CTI::unlinkCall):
28565 (JSC::CTI::linkCall):
28567 * VM/CodeBlock.cpp:
28568 (JSC::CodeBlock::~CodeBlock):
28569 (JSC::CodeBlock::unlinkCallers):
28570 (JSC::CodeBlock::derefStructureIDs):
28572 (JSC::StructureStubInfo::StructureStubInfo):
28573 (JSC::CallLinkInfo::CallLinkInfo):
28574 (JSC::CodeBlock::addCaller):
28575 (JSC::CodeBlock::removeCaller):
28576 (JSC::CodeBlock::getStubInfo):
28577 * VM/CodeGenerator.cpp:
28578 (JSC::CodeGenerator::emitCall):
28579 (JSC::CodeGenerator::emitConstruct):
28581 (JSC::Machine::cti_op_call_profiler):
28582 (JSC::Machine::cti_op_call_JSFunction):
28583 (JSC::Machine::cti_vm_lazyLinkCall):
28584 (JSC::Machine::cti_op_construct_JSConstructFast):
28585 (JSC::Machine::cti_op_construct_JSConstruct):
28586 (JSC::Machine::cti_op_construct_NotJSConstruct):
28588 * kjs/JSFunction.cpp:
28589 (JSC::JSFunction::~JSFunction):
28590 * kjs/JSFunction.h:
28592 (JSC::FunctionBodyNode::):
28593 * masm/X86Assembler.h:
28594 (JSC::X86Assembler::getDifferenceBetweenLabels):
28596 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28598 Reviewed by Geoff Garen.
28600 - remove ASSERT that makes the leaks buildbot cry
28602 * kjs/JSFunction.cpp:
28603 (JSC::JSFunction::JSFunction):
28605 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28607 Reviewed by Cameron Zwarich
28609 - don't bother to do arguments tearoff when it will have no effect
28613 * VM/CodeGenerator.cpp:
28614 (JSC::CodeGenerator::emitReturn):
28616 2008-10-17 Marco Barisione <marco.barisione@collabora.co.uk>
28618 Reviewed by Sam Weinig. Landed by Jan Alonzo.
28620 https://bugs.webkit.org/show_bug.cgi?id=21603
28621 [GTK] Minor fixes to GOwnPtr
28628 (WTF::GPatternSpec):
28631 (WTF::freeOwnedGPtr):
28632 (WTF::GOwnPtr::~GOwnPtr):
28633 (WTF::GOwnPtr::outPtr):
28634 (WTF::GOwnPtr::set):
28635 (WTF::GOwnPtr::clear):
28638 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28640 Reviewed by Cameron Zwarich.
28642 - speed up transitions that resize the property storage a fair bit
28644 ~3% speedup on v8 RayTrace benchmark, ~1% on DeltaBlue
28647 (JSC::resizePropertyStorage): renamed from transitionObject, and reduced to just resize
28648 the object's property storage with one inline call.
28649 (JSC::CTI::privateCompilePutByIdTransition): Use a separate function for property storage
28650 resize, but still do all the rest of the work in assembly in that case, and pass the known
28651 compile-time constants of old and new size rather than structureIDs, saving a bunch of
28652 redundant memory access.
28653 * kjs/JSObject.cpp:
28654 (JSC::JSObject::allocatePropertyStorage): Just call the inline version.
28656 (JSC::JSObject::allocatePropertyStorageInline): Inline version of allocatePropertyStorage
28657 * masm/X86Assembler.h:
28658 (JSC::X86Assembler::):
28659 (JSC::X86Assembler::pushl_i32): Add code to assmeble push of a constant; code originally by Cameron Zwarich.
28661 2008-10-17 Cameron Zwarich <zwarich@apple.com>
28663 Reviewed by Maciej Stachowiak.
28665 Remove some C style casts.
28667 * masm/X86Assembler.h:
28668 (JSC::JITCodeBuffer::putIntUnchecked):
28669 (JSC::X86Assembler::link):
28670 (JSC::X86Assembler::linkAbsoluteAddress):
28671 (JSC::X86Assembler::getRelocatedAddress):
28673 2008-10-17 Cameron Zwarich <zwarich@apple.com>
28675 Rubber-stamped by Maciej Stachowiak.
28677 Remove some C style casts.
28680 (JSC::CTI::patchGetByIdSelf):
28681 (JSC::CTI::patchPutByIdReplace):
28683 (JSC::Machine::tryCTICachePutByID):
28684 (JSC::Machine::tryCTICacheGetByID):
28685 (JSC::Machine::cti_op_put_by_id):
28686 (JSC::Machine::cti_op_put_by_id_fail):
28687 (JSC::Machine::cti_op_get_by_id):
28688 (JSC::Machine::cti_op_get_by_id_fail):
28690 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28692 Reviewed by Cameron Zwarich.
28694 - Avoid restoring the caller's 'r' value in op_ret
28695 https://bugs.webkit.org/show_bug.cgi?id=21319
28697 This patch stops writing the call frame at call and return points;
28698 instead it does so immediately before any CTI call.
28700 0.5% speedup or so on the v8 benchmark
28703 (JSC::CTI::emitCTICall):
28704 (JSC::CTI::compileOpCall):
28705 (JSC::CTI::emitSlowScriptCheck):
28706 (JSC::CTI::compileBinaryArithOpSlowCase):
28707 (JSC::CTI::privateCompileMainPass):
28708 (JSC::CTI::privateCompileSlowCases):
28709 (JSC::CTI::privateCompile):
28712 2008-10-17 Cameron Zwarich <zwarich@apple.com>
28714 Reviewed by Sam Weinig.
28716 Make WREC require CTI because it won't actually compile otherwise.
28720 2008-10-16 Maciej Stachowiak <mjs@apple.com>
28722 Reviewed by Geoff Garen.
28724 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
28725 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
28727 This time there is no performance regression; we can avoid having
28728 to use the fastcall calling convention for CTI functions by using
28729 varargs to prevent the compiler from moving things around on the
28732 * Configurations/DebugRelease.xcconfig:
28733 * JavaScriptCore.xcodeproj/project.pbxproj:
28738 2008-10-16 Maciej Stachowiak <mjs@apple.com>
28740 Reviewed by Oliver Hunt.
28742 - fix for REGRESSION: r37631 causing crashes on buildbot
28743 https://bugs.webkit.org/show_bug.cgi?id=21682
28745 * kjs/collector.cpp:
28746 (JSC::Heap::collect): Avoid crashing when a GC occurs while no global objects are live.
28748 2008-10-16 Sam Weinig <sam@webkit.org>
28750 Reviewed by Maciej Stachowiak.
28752 Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
28753 Don't create intermediate StructureIDs for builtin objects
28755 First step in reduce number of StructureIDs created when initializing the
28758 - In order to avoid creating the intermediate StructureIDs use the new putDirectWithoutTransition
28759 and putDirectFunctionWithoutTransition to add properties to JSObjects without transitioning
28760 the StructureID. This patch just implements this strategy for ObjectPrototype but alone
28761 reduces the number of StructureIDs create for about:blank by 10, from 142 to 132.
28763 * kjs/JSGlobalObject.cpp:
28764 (JSC::JSGlobalObject::reset):
28765 * kjs/JSObject.cpp:
28766 (JSC::JSObject::putDirectFunctionWithoutTransition):
28768 (JSC::JSObject::putDirectWithoutTransition):
28769 * kjs/ObjectPrototype.cpp:
28770 (JSC::ObjectPrototype::ObjectPrototype):
28771 * kjs/ObjectPrototype.h:
28772 * kjs/StructureID.cpp:
28773 (JSC::StructureID::addPropertyWithoutTransition):
28774 * kjs/StructureID.h:
28776 2008-10-16 Maciej Stachowiak <mjs@apple.com>
28778 Reviewed by Cameron Zwarich.
28780 - fix for: REGRESSION: over 100 StructureIDs leak loading about:blank (result of fix for bug 21633)
28782 Apparent slight progression (< 0.5%) on v8 benchmarks and SunSpider.
28784 * kjs/StructureID.cpp:
28785 (JSC::StructureID::~StructureID): Don't deref this object's parent's pointer to
28786 itself from the destructor; that doesn't even make sense.
28787 (JSC::StructureID::addPropertyTransition): Don't refer the single transition;
28788 the rule is that parent StructureIDs are ref'd but child ones are not. Refing
28789 the child creates a cycle.
28791 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
28793 Reviewed by Darin Adler.
28795 https://bugs.webkit.org/show_bug.cgi?id=21609
28796 Make MessagePorts protect their peers across heaps
28798 * JavaScriptCore.exp:
28799 * kjs/JSGlobalObject.cpp:
28800 (JSC::JSGlobalObject::markCrossHeapDependentObjects):
28801 * kjs/JSGlobalObject.h:
28802 * kjs/collector.cpp:
28803 (JSC::Heap::collect):
28804 Before GC sweep phase, a function supplied by global object is now called for all global
28805 objects in the heap, making it possible to implement cross-heap dependencies.
28807 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
28809 Reviewed by Darin Adler.
28811 https://bugs.webkit.org/show_bug.cgi?id=21610
28812 run-webkit-threads --threaded crashes in StructureID destructor
28814 * kjs/StructureID.cpp:
28815 (JSC::StructureID::StructureID):
28816 (JSC::StructureID::~StructureID):
28817 Protect access to a static (debug-only) HashSet with a lock.
28819 2008-10-15 Sam Weinig <sam@webkit.org>
28821 Reviewed by Goeffrey Garen.
28823 Add function to dump statistics for StructureIDs.
28825 * kjs/StructureID.cpp:
28826 (JSC::StructureID::dumpStatistics):
28827 (JSC::StructureID::StructureID):
28828 (JSC::StructureID::~StructureID):
28829 * kjs/StructureID.h:
28831 2008-10-15 Cameron Zwarich <zwarich@apple.com>
28833 Reviewed by Maciej Stachowiak.
28835 Bug 21633: Avoid using a HashMap when there is only a single transition
28836 <https://bugs.webkit.org/show_bug.cgi?id=21633>
28838 This is a 0.8% speedup on SunSpider and between a 0.5% and 1.0% speedup
28839 on the V8 benchmark suite, depending on which harness we use. It will
28840 also slightly reduce the memory footprint of a StructureID.
28842 * kjs/StructureID.cpp:
28843 (JSC::StructureID::StructureID):
28844 (JSC::StructureID::~StructureID):
28845 (JSC::StructureID::addPropertyTransition):
28846 * kjs/StructureID.h:
28847 (JSC::StructureID::):
28849 2008-10-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
28851 Reviewed by Geoffrey Garen.
28853 1.40% speedup on SunSpider, 1.44% speedup on V8. (Linux)
28858 (JSC::fastIsNumber): ALWAYS_INLINE modifier added.
28860 2008-10-15 Geoffrey Garen <ggaren@apple.com>
28862 Reviewed by Cameron Zwarich.
28864 Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
28865 Start the debugger without reloading the inspected page
28867 * JavaScriptCore.exp: New symbols.
28868 * JavaScriptCore.xcodeproj/project.pbxproj: New files.
28871 (JSC::EvalCodeCache::get): Updated for tweak to parsing API.
28873 * kjs/CollectorHeapIterator.h: Added. An iterator for the object heap,
28874 which we use to find all the live functions and recompile them.
28876 * kjs/DebuggerCallFrame.cpp:
28877 (JSC::DebuggerCallFrame::evaluate): Updated for tweak to parsing API.
28879 * kjs/FunctionConstructor.cpp:
28880 (JSC::constructFunction): Updated for tweak to parsing API.
28882 * kjs/JSFunction.cpp:
28883 (JSC::JSFunction::JSFunction): Try to validate our SourceCode in debug
28884 builds by ASSERTing that it's syntactically valid. This doesn't catch
28885 all SourceCode bugs, but it catches a lot of them.
28887 * kjs/JSGlobalObjectFunctions.cpp:
28888 (JSC::globalFuncEval): Updated for tweak to parsing API.
28891 (JSC::Parser::parse):
28893 (JSC::Parser::parse): Tweaked the parser to make it possible to parse
28894 without an ExecState, and to allow the client to specify a debugger to
28895 notify (or not) about the source we parse. This allows the inspector
28896 to recompile even though no JavaScript is executing, then notify the
28897 debugger about all source code when it's done.
28900 (prettyPrintScript): Updated for tweak to parsing API.
28902 * kjs/SourceRange.h:
28903 (JSC::SourceCode::isNull): Added to help with ASSERTs.
28905 * kjs/collector.cpp:
28906 (JSC::Heap::heapAllocate):
28907 (JSC::Heap::sweep):
28908 (JSC::Heap::primaryHeapBegin):
28909 (JSC::Heap::primaryHeapEnd):
28911 (JSC::): Moved a bunch of declarations around to enable compilation of
28912 CollectorHeapIterator.
28914 * kjs/interpreter.cpp:
28915 (JSC::Interpreter::checkSyntax):
28916 (JSC::Interpreter::evaluate): Updated for tweak to parsing API.
28919 (JSC::Lexer::sourceCode): BUG FIX: Calculate SourceCode ranges relative
28920 to the SourceCode range in which we're lexing, otherwise nested functions
28921 that are compiled individually get SourceCode ranges that don't reflect
28925 (JSC::FunctionBodyNode::FunctionBodyNode):
28926 (JSC::FunctionBodyNode::finishParsing):
28927 (JSC::FunctionBodyNode::create):
28928 (JSC::FunctionBodyNode::copyParameters):
28930 (JSC::ScopeNode::setSource):
28931 (JSC::FunctionBodyNode::parameterCount): Added some helper functions for
28932 copying one FunctionBodyNode's parameters to another. The recompiler uses
28933 these when calling "finishParsing".
28935 2008-10-15 Joerg Bornemann <joerg.bornemann@trolltech.com>
28937 Reviewed by Darin Adler.
28939 - part of https://bugs.webkit.org/show_bug.cgi?id=20746
28940 Fix compilation on Windows CE.
28942 str(n)icmp, strdup and vsnprintf are not available on Windows CE,
28943 they are called _str(n)icmp, etc. instead
28945 * wtf/StringExtras.h: Added inline function implementations.
28947 2008-10-15 Gabor Loki <loki@inf.u-szeged.hu>
28949 Reviewed by Cameron Zwarich.
28951 <https://bugs.webkit.org/show_bug.cgi?id=20912>
28952 Use simple uint32_t multiplication on op_mul if both operands are
28953 immediate number and they are between zero and 0x7FFF.
28956 (JSC::Machine::privateExecute):
28958 2008-10-09 Darin Fisher <darin@chromium.org>
28960 Reviewed by Sam Weinig.
28962 Make pan scrolling a platform configurable option.
28963 https://bugs.webkit.org/show_bug.cgi?id=21515
28965 * wtf/Platform.h: Add ENABLE_PAN_SCROLLING
28967 2008-10-14 Maciej Stachowiak <mjs@apple.com>
28969 Rubber stamped by Sam Weinig.
28971 - revert r37572 and r37581 for now
28973 Turns out GCC 4.2 is still a (small) regression, we'll have to do
28974 more work to turn it on.
28976 * Configurations/DebugRelease.xcconfig:
28977 * JavaScriptCore.xcodeproj/project.pbxproj:
28981 (JSC::Machine::cti_op_convert_this):
28982 (JSC::Machine::cti_op_end):
28983 (JSC::Machine::cti_op_add):
28984 (JSC::Machine::cti_op_pre_inc):
28985 (JSC::Machine::cti_timeout_check):
28986 (JSC::Machine::cti_register_file_check):
28987 (JSC::Machine::cti_op_loop_if_less):
28988 (JSC::Machine::cti_op_loop_if_lesseq):
28989 (JSC::Machine::cti_op_new_object):
28990 (JSC::Machine::cti_op_put_by_id):
28991 (JSC::Machine::cti_op_put_by_id_second):
28992 (JSC::Machine::cti_op_put_by_id_generic):
28993 (JSC::Machine::cti_op_put_by_id_fail):
28994 (JSC::Machine::cti_op_get_by_id):
28995 (JSC::Machine::cti_op_get_by_id_second):
28996 (JSC::Machine::cti_op_get_by_id_generic):
28997 (JSC::Machine::cti_op_get_by_id_fail):
28998 (JSC::Machine::cti_op_instanceof):
28999 (JSC::Machine::cti_op_del_by_id):
29000 (JSC::Machine::cti_op_mul):
29001 (JSC::Machine::cti_op_new_func):
29002 (JSC::Machine::cti_op_call_JSFunction):
29003 (JSC::Machine::cti_vm_compile):
29004 (JSC::Machine::cti_op_push_activation):
29005 (JSC::Machine::cti_op_call_NotJSFunction):
29006 (JSC::Machine::cti_op_create_arguments):
29007 (JSC::Machine::cti_op_tear_off_activation):
29008 (JSC::Machine::cti_op_tear_off_arguments):
29009 (JSC::Machine::cti_op_ret_profiler):
29010 (JSC::Machine::cti_op_ret_scopeChain):
29011 (JSC::Machine::cti_op_new_array):
29012 (JSC::Machine::cti_op_resolve):
29013 (JSC::Machine::cti_op_construct_JSConstruct):
29014 (JSC::Machine::cti_op_construct_NotJSConstruct):
29015 (JSC::Machine::cti_op_get_by_val):
29016 (JSC::Machine::cti_op_resolve_func):
29017 (JSC::Machine::cti_op_sub):
29018 (JSC::Machine::cti_op_put_by_val):
29019 (JSC::Machine::cti_op_put_by_val_array):
29020 (JSC::Machine::cti_op_lesseq):
29021 (JSC::Machine::cti_op_loop_if_true):
29022 (JSC::Machine::cti_op_negate):
29023 (JSC::Machine::cti_op_resolve_base):
29024 (JSC::Machine::cti_op_resolve_skip):
29025 (JSC::Machine::cti_op_resolve_global):
29026 (JSC::Machine::cti_op_div):
29027 (JSC::Machine::cti_op_pre_dec):
29028 (JSC::Machine::cti_op_jless):
29029 (JSC::Machine::cti_op_not):
29030 (JSC::Machine::cti_op_jtrue):
29031 (JSC::Machine::cti_op_post_inc):
29032 (JSC::Machine::cti_op_eq):
29033 (JSC::Machine::cti_op_lshift):
29034 (JSC::Machine::cti_op_bitand):
29035 (JSC::Machine::cti_op_rshift):
29036 (JSC::Machine::cti_op_bitnot):
29037 (JSC::Machine::cti_op_resolve_with_base):
29038 (JSC::Machine::cti_op_new_func_exp):
29039 (JSC::Machine::cti_op_mod):
29040 (JSC::Machine::cti_op_less):
29041 (JSC::Machine::cti_op_neq):
29042 (JSC::Machine::cti_op_post_dec):
29043 (JSC::Machine::cti_op_urshift):
29044 (JSC::Machine::cti_op_bitxor):
29045 (JSC::Machine::cti_op_new_regexp):
29046 (JSC::Machine::cti_op_bitor):
29047 (JSC::Machine::cti_op_call_eval):
29048 (JSC::Machine::cti_op_throw):
29049 (JSC::Machine::cti_op_get_pnames):
29050 (JSC::Machine::cti_op_next_pname):
29051 (JSC::Machine::cti_op_push_scope):
29052 (JSC::Machine::cti_op_pop_scope):
29053 (JSC::Machine::cti_op_typeof):
29054 (JSC::Machine::cti_op_is_undefined):
29055 (JSC::Machine::cti_op_is_boolean):
29056 (JSC::Machine::cti_op_is_number):
29057 (JSC::Machine::cti_op_is_string):
29058 (JSC::Machine::cti_op_is_object):
29059 (JSC::Machine::cti_op_is_function):
29060 (JSC::Machine::cti_op_stricteq):
29061 (JSC::Machine::cti_op_nstricteq):
29062 (JSC::Machine::cti_op_to_jsnumber):
29063 (JSC::Machine::cti_op_in):
29064 (JSC::Machine::cti_op_push_new_scope):
29065 (JSC::Machine::cti_op_jmp_scopes):
29066 (JSC::Machine::cti_op_put_by_index):
29067 (JSC::Machine::cti_op_switch_imm):
29068 (JSC::Machine::cti_op_switch_char):
29069 (JSC::Machine::cti_op_switch_string):
29070 (JSC::Machine::cti_op_del_by_val):
29071 (JSC::Machine::cti_op_put_getter):
29072 (JSC::Machine::cti_op_put_setter):
29073 (JSC::Machine::cti_op_new_error):
29074 (JSC::Machine::cti_op_debug):
29075 (JSC::Machine::cti_vm_throw):
29077 * masm/X86Assembler.h:
29078 (JSC::X86Assembler::emitRestoreArgumentReference):
29079 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
29082 2008-10-14 Alexey Proskuryakov <ap@webkit.org>
29084 Reviewed by Darin Adler.
29086 https://bugs.webkit.org/show_bug.cgi?id=20256
29087 Array.push and other standard methods disappear
29089 * kjs/JSGlobalData.cpp:
29090 (JSC::JSGlobalData::JSGlobalData):
29091 (JSC::JSGlobalData::~JSGlobalData):
29092 Don't use static hash tables even on platforms that don't enable JSC_MULTIPLE_THREADS -
29093 these tables reference IdentifierTable, which is always per-GlobalData.
29095 2008-10-14 Maciej Stachowiak <mjs@apple.com>
29097 Reviewed by Cameron Zwarich.
29099 - always use CTI_ARGUMENTS and CTI_ARGUMENTS_FASTCALL
29101 This is a small regression for GCC 4.0, but simplifies the code
29102 for future improvements and lets us focus on GCC 4.2+ and MSVC.
29107 (JSC::Machine::cti_op_convert_this):
29108 (JSC::Machine::cti_op_end):
29109 (JSC::Machine::cti_op_add):
29110 (JSC::Machine::cti_op_pre_inc):
29111 (JSC::Machine::cti_timeout_check):
29112 (JSC::Machine::cti_register_file_check):
29113 (JSC::Machine::cti_op_loop_if_less):
29114 (JSC::Machine::cti_op_loop_if_lesseq):
29115 (JSC::Machine::cti_op_new_object):
29116 (JSC::Machine::cti_op_put_by_id):
29117 (JSC::Machine::cti_op_put_by_id_second):
29118 (JSC::Machine::cti_op_put_by_id_generic):
29119 (JSC::Machine::cti_op_put_by_id_fail):
29120 (JSC::Machine::cti_op_get_by_id):
29121 (JSC::Machine::cti_op_get_by_id_second):
29122 (JSC::Machine::cti_op_get_by_id_generic):
29123 (JSC::Machine::cti_op_get_by_id_fail):
29124 (JSC::Machine::cti_op_instanceof):
29125 (JSC::Machine::cti_op_del_by_id):
29126 (JSC::Machine::cti_op_mul):
29127 (JSC::Machine::cti_op_new_func):
29128 (JSC::Machine::cti_op_call_JSFunction):
29129 (JSC::Machine::cti_vm_compile):
29130 (JSC::Machine::cti_op_push_activation):
29131 (JSC::Machine::cti_op_call_NotJSFunction):
29132 (JSC::Machine::cti_op_create_arguments):
29133 (JSC::Machine::cti_op_tear_off_activation):
29134 (JSC::Machine::cti_op_tear_off_arguments):
29135 (JSC::Machine::cti_op_ret_profiler):
29136 (JSC::Machine::cti_op_ret_scopeChain):
29137 (JSC::Machine::cti_op_new_array):
29138 (JSC::Machine::cti_op_resolve):
29139 (JSC::Machine::cti_op_construct_JSConstruct):
29140 (JSC::Machine::cti_op_construct_NotJSConstruct):
29141 (JSC::Machine::cti_op_get_by_val):
29142 (JSC::Machine::cti_op_resolve_func):
29143 (JSC::Machine::cti_op_sub):
29144 (JSC::Machine::cti_op_put_by_val):
29145 (JSC::Machine::cti_op_put_by_val_array):
29146 (JSC::Machine::cti_op_lesseq):
29147 (JSC::Machine::cti_op_loop_if_true):
29148 (JSC::Machine::cti_op_negate):
29149 (JSC::Machine::cti_op_resolve_base):
29150 (JSC::Machine::cti_op_resolve_skip):
29151 (JSC::Machine::cti_op_resolve_global):
29152 (JSC::Machine::cti_op_div):
29153 (JSC::Machine::cti_op_pre_dec):
29154 (JSC::Machine::cti_op_jless):
29155 (JSC::Machine::cti_op_not):
29156 (JSC::Machine::cti_op_jtrue):
29157 (JSC::Machine::cti_op_post_inc):
29158 (JSC::Machine::cti_op_eq):
29159 (JSC::Machine::cti_op_lshift):
29160 (JSC::Machine::cti_op_bitand):
29161 (JSC::Machine::cti_op_rshift):
29162 (JSC::Machine::cti_op_bitnot):
29163 (JSC::Machine::cti_op_resolve_with_base):
29164 (JSC::Machine::cti_op_new_func_exp):
29165 (JSC::Machine::cti_op_mod):
29166 (JSC::Machine::cti_op_less):
29167 (JSC::Machine::cti_op_neq):
29168 (JSC::Machine::cti_op_post_dec):
29169 (JSC::Machine::cti_op_urshift):
29170 (JSC::Machine::cti_op_bitxor):
29171 (JSC::Machine::cti_op_new_regexp):
29172 (JSC::Machine::cti_op_bitor):
29173 (JSC::Machine::cti_op_call_eval):
29174 (JSC::Machine::cti_op_throw):
29175 (JSC::Machine::cti_op_get_pnames):
29176 (JSC::Machine::cti_op_next_pname):
29177 (JSC::Machine::cti_op_push_scope):
29178 (JSC::Machine::cti_op_pop_scope):
29179 (JSC::Machine::cti_op_typeof):
29180 (JSC::Machine::cti_op_is_undefined):
29181 (JSC::Machine::cti_op_is_boolean):
29182 (JSC::Machine::cti_op_is_number):
29183 (JSC::Machine::cti_op_is_string):
29184 (JSC::Machine::cti_op_is_object):
29185 (JSC::Machine::cti_op_is_function):
29186 (JSC::Machine::cti_op_stricteq):
29187 (JSC::Machine::cti_op_nstricteq):
29188 (JSC::Machine::cti_op_to_jsnumber):
29189 (JSC::Machine::cti_op_in):
29190 (JSC::Machine::cti_op_push_new_scope):
29191 (JSC::Machine::cti_op_jmp_scopes):
29192 (JSC::Machine::cti_op_put_by_index):
29193 (JSC::Machine::cti_op_switch_imm):
29194 (JSC::Machine::cti_op_switch_char):
29195 (JSC::Machine::cti_op_switch_string):
29196 (JSC::Machine::cti_op_del_by_val):
29197 (JSC::Machine::cti_op_put_getter):
29198 (JSC::Machine::cti_op_put_setter):
29199 (JSC::Machine::cti_op_new_error):
29200 (JSC::Machine::cti_op_debug):
29201 (JSC::Machine::cti_vm_throw):
29203 * masm/X86Assembler.h:
29204 (JSC::X86Assembler::emitRestoreArgumentReference):
29205 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
29208 2008-10-13 Maciej Stachowiak <mjs@apple.com>
29210 Reviewed by Cameron Zwarich.
29212 - make Machine::getArgumentsData an Arguments method and inline it
29218 (JSC::Machine::getArgumentsData):
29220 2008-10-13 Alp Toker <alp@nuanti.com>
29222 Fix autotools dist build target by listing recently added header
29223 files only. Not reviewed.
29227 2008-10-13 Maciej Stachowiak <mjs@apple.com>
29229 Rubber stamped by Mark Rowe.
29231 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
29232 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
29234 * Configurations/DebugRelease.xcconfig:
29235 * JavaScriptCore.xcodeproj/project.pbxproj:
29237 2008-10-13 Cameron Zwarich <zwarich@apple.com>
29239 Reviewed by Geoff Garen.
29241 Bug 21541: Move RegisterFile growth check to callee
29242 <https://bugs.webkit.org/show_bug.cgi?id=21541>
29244 Move the RegisterFile growth check to the callee in the common case,
29245 where some of the information is known statically at JIT time. There is
29246 still a check in the caller in the case where the caller provides too
29249 This is a 2.1% speedup on the V8 benchmark, including a 5.1% speedup on
29250 the Richards benchmark, a 4.1% speedup on the DeltaBlue benchmark, and a
29251 1.4% speedup on the Earley-Boyer benchmark. It is also a 0.5% speedup on
29255 (JSC::CTI::privateCompile):
29257 (JSC::Machine::cti_register_file_check):
29258 (JSC::Machine::cti_op_call_JSFunction):
29259 (JSC::Machine::cti_op_construct_JSConstruct):
29261 * VM/RegisterFile.h:
29262 * masm/X86Assembler.h:
29263 (JSC::X86Assembler::):
29264 (JSC::X86Assembler::cmpl_mr):
29265 (JSC::X86Assembler::emitUnlinkedJg):
29267 2008-10-13 Sam Weinig <sam@webkit.org>
29269 Reviewed by Dan Bernstein.
29271 Fix for https://bugs.webkit.org/show_bug.cgi?id=21577
29272 5 false positive StructureID leaks
29274 - Add leak ignore set to StructureID to selectively ignore leaking some StructureIDs.
29275 - Add create method to JSGlolalData to be used when the data will be intentionally
29276 leaked and ignore all leaks caused the StructureIDs stored in it.
29278 * JavaScriptCore.exp:
29279 * kjs/JSGlobalData.cpp:
29280 (JSC::JSGlobalData::createLeaked):
29281 * kjs/JSGlobalData.h:
29282 * kjs/StructureID.cpp:
29283 (JSC::StructureID::StructureID):
29284 (JSC::StructureID::~StructureID):
29285 (JSC::StructureID::startIgnoringLeaks):
29286 (JSC::StructureID::stopIgnoringLeaks):
29287 * kjs/StructureID.h:
29289 2008-10-13 Marco Barisione <marco.barisione@collabora.co.uk>
29291 Reviewed by Darin Adler. Landed by Jan Alonzo.
29293 WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?)
29294 http://bugs.webkit.org/show_bug.cgi?id=20483
29296 Add a GOwnPtr smart pointer (similar to OwnPtr) to handle memory
29297 allocated by GLib and start the conversion to use it.
29300 * wtf/GOwnPtr.cpp: Added.
29305 (WTF::GPatternSpec):
29307 * wtf/GOwnPtr.h: Added.
29308 (WTF::freeOwnedPtr):
29309 (WTF::GOwnPtr::GOwnPtr):
29310 (WTF::GOwnPtr::~GOwnPtr):
29311 (WTF::GOwnPtr::get):
29312 (WTF::GOwnPtr::release):
29313 (WTF::GOwnPtr::rawPtr):
29314 (WTF::GOwnPtr::set):
29315 (WTF::GOwnPtr::clear):
29316 (WTF::GOwnPtr::operator*):
29317 (WTF::GOwnPtr::operator->):
29318 (WTF::GOwnPtr::operator!):
29319 (WTF::GOwnPtr::operator UnspecifiedBoolType):
29320 (WTF::GOwnPtr::swap):
29326 * wtf/ThreadingGtk.cpp:
29327 (WTF::Mutex::~Mutex):
29328 (WTF::Mutex::lock):
29329 (WTF::Mutex::tryLock):
29330 (WTF::Mutex::unlock):
29331 (WTF::ThreadCondition::~ThreadCondition):
29332 (WTF::ThreadCondition::wait):
29333 (WTF::ThreadCondition::timedWait):
29334 (WTF::ThreadCondition::signal):
29335 (WTF::ThreadCondition::broadcast):
29337 2008-10-12 Gabriella Toth <gtoth@inf.u-szeged.hu>
29339 Reviewed by Darin Adler.
29341 - part of https://bugs.webkit.org/show_bug.cgi?id=21055
29342 Bug 21055: not invoked functions
29344 * kjs/nodes.cpp: Deleted a function that is not invoked:
29345 statementListInitializeVariableAccessStack.
29347 2008-10-12 Darin Adler <darin@apple.com>
29349 Reviewed by Sam Weinig.
29351 * wtf/unicode/icu/UnicodeIcu.h: Fixed indentation to match WebKit coding style.
29352 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
29354 2008-10-12 Darin Adler <darin@apple.com>
29356 Reviewed by Sam Weinig.
29358 - https://bugs.webkit.org/show_bug.cgi?id=21556
29359 Bug 21556: non-ASCII digits are allowed in places where only ASCII should be
29361 * wtf/unicode/icu/UnicodeIcu.h: Removed isDigit, digitValue, and isFormatChar.
29362 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
29364 2008-10-12 Anders Carlsson <andersca@apple.com>
29366 Reviewed by Darin Adler.
29368 Make the append method that takes a Vector more strict - it now requires the elements
29369 of the vector to be appended same type as the elements of the Vector they're being appended to.
29371 This would cause problems when dealing with Vectors containing other Vectors.
29376 2008-10-11 Cameron Zwarich <zwarich@apple.com>
29378 Reviewed by Sam Weinig.
29380 Clean up RegExpMatchesArray.h to match our coding style.
29382 * kjs/RegExpMatchesArray.h:
29383 (JSC::RegExpMatchesArray::getOwnPropertySlot):
29384 (JSC::RegExpMatchesArray::put):
29385 (JSC::RegExpMatchesArray::deleteProperty):
29386 (JSC::RegExpMatchesArray::getPropertyNames):
29388 2008-10-11 Cameron Zwarich <zwarich@apple.com>
29390 Reviewed by Sam Weinig.
29392 Bug 21525: 55 StructureID leaks on Wikitravel's main page
29393 <https://bugs.webkit.org/show_bug.cgi?id=21525>
29395 Bug 21533: Simple JavaScript code leaks StructureIDs
29396 <https://bugs.webkit.org/show_bug.cgi?id=21533>
29398 StructureID::getEnumerablePropertyNames() ends up calling back to itself
29399 via JSObject::getPropertyNames(), which causes the PropertyNameArray to
29400 be cached twice. This leads to a memory leak in almost every use of
29401 JSObject::getPropertyNames() on an object. The fix here is based on a
29402 suggestion of Sam Weinig.
29404 This patch also fixes every StructureID leaks that occurs while running
29405 the Mozilla MemBuster test.
29407 * kjs/PropertyNameArray.h:
29408 (JSC::PropertyNameArray::PropertyNameArray):
29409 (JSC::PropertyNameArray::setCacheable):
29410 (JSC::PropertyNameArray::cacheable):
29411 * kjs/StructureID.cpp:
29412 (JSC::StructureID::getEnumerablePropertyNames):
29414 2008-10-10 Oliver Hunt <oliver@apple.com>
29416 Reviewed by Cameron Zwarich.
29418 Use fastcall calling convention on GCC > 4.0
29420 Results in a 2-3% improvement in GCC 4.2 performance, so
29421 that it is no longer a regression vs. GCC 4.0
29427 2008-10-10 Sam Weinig <sam@webkit.org>
29429 Reviewed by Darin Adler.
29431 - Add a workaround for a bug in ceil in Darwin libc.
29432 - Remove old workarounds for JS math functions that are not needed
29435 The math functions are heavily tested by fast/js/math.html.
29437 * kjs/MathObject.cpp:
29438 (JSC::mathProtoFuncAbs): Remove workaround.
29439 (JSC::mathProtoFuncCeil): Ditto.
29440 (JSC::mathProtoFuncFloor): Ditto.
29441 * wtf/MathExtras.h:
29442 (wtf_ceil): Add ceil workaround for darwin.
29444 2008-10-10 Sam Weinig <sam@webkit.org>
29446 Reviewed by Darin Adler
29448 Add Assertions to JSObject constructor.
29451 (JSC::JSObject::JSObject):
29453 2008-10-10 Sam Weinig <sam@webkit.org>
29455 Reviewed by Cameron Zwarich.
29457 Remove now unused m_getterSetterFlag variable from PropertyMap.
29459 * kjs/PropertyMap.cpp:
29460 (JSC::PropertyMap::operator=):
29461 * kjs/PropertyMap.h:
29462 (JSC::PropertyMap::PropertyMap):
29464 2008-10-09 Sam Weinig <sam@webkit.org>
29466 Reviewed by Maciej Stachowiak.
29468 Add leaks checking to StructureID.
29470 * kjs/StructureID.cpp:
29471 (JSC::StructureID::StructureID):
29472 (JSC::StructureID::~StructureID):
29474 2008-10-09 Alp Toker <alp@nuanti.com>
29476 Reviewed by Mark Rowe.
29478 https://bugs.webkit.org/show_bug.cgi?id=20760
29479 Implement support for x86 Linux in CTI
29481 Prepare to enable CTI/WREC on supported architectures.
29483 Make it possible to use the CTI_ARGUMENT workaround with GCC as well
29484 as MSVC by fixing some preprocessor conditionals.
29486 Note that CTI/WREC no longer requires CTI_ARGUMENT on Linux so we
29487 don't actually enable it except when building with MSVC. GCC on Win32
29490 Adapt inline ASM code to use the global symbol underscore prefix only
29491 on Darwin and to call the properly mangled Machine::cti_vm_throw
29492 symbol name depending on CTI_ARGUMENT.
29494 Also avoid global inclusion of the JIT infrastructure headers
29495 throughout WebCore and WebKit causing recompilation of about ~1500
29496 source files after modification to X86Assembler.h, CTI.h, WREC.h,
29497 which are only used deep inside JavaScriptCore.
29505 (JSC::RegExp::RegExp):
29506 (JSC::RegExp::~RegExp):
29507 (JSC::RegExp::match):
29509 * masm/X86Assembler.h:
29510 (JSC::X86Assembler::emitConvertToFastCall):
29511 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
29512 (JSC::X86Assembler::emitRestoreArgumentReference):
29514 2008-10-09 Gavin Barraclough <barraclough@apple.com>
29516 Reviewed by Cameron Zwarich.
29518 Fix for bug #21160, x=0;1/(x*-1) == -Infinity
29522 (JSC::CTI::emitFastArithDeTagImmediate):
29523 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
29524 (JSC::CTI::compileBinaryArithOp):
29525 (JSC::CTI::compileBinaryArithOpSlowCase):
29526 (JSC::CTI::privateCompileMainPass):
29527 (JSC::CTI::privateCompileSlowCases):
29529 * masm/X86Assembler.h:
29530 (JSC::X86Assembler::):
29531 (JSC::X86Assembler::emitUnlinkedJs):
29533 2008-10-09 Cameron Zwarich <zwarich@apple.com>
29535 Reviewed by Oliver Hunt.
29537 Bug 21459: REGRESSION (r37324): Safari crashes inside JavaScriptCore while browsing hulu.com
29538 <https://bugs.webkit.org/show_bug.cgi?id=21459>
29540 After r37324, an Arguments object does not mark an associated activation
29541 object. This change was made because Arguments no longer directly used
29542 the activation object in any way. However, if an activation is torn off,
29543 then the backing store of Arguments becomes the register array of the
29544 activation object. Arguments directly marks all of the arguments, but
29545 the activation object is being collected, which causes its register
29546 array to be freed and new memory to be allocated in its place.
29548 Unfortunately, it does not seem possible to reproduce this issue in a
29551 * kjs/Arguments.cpp:
29552 (JSC::Arguments::mark):
29554 (JSC::Arguments::setActivation):
29555 (JSC::Arguments::Arguments):
29556 (JSC::JSActivation::copyRegisters):
29558 2008-10-09 Ariya Hidayat <ariya.hidayat@trolltech.com>
29562 Build fix for MinGW.
29564 * wtf/AlwaysInline.h:
29566 2008-10-08 Cameron Zwarich <zwarich@apple.com>
29568 Reviewed by Maciej Stachowiak.
29570 Bug 21497: REGRESSION (r37433): Bytecode JSC tests are severely broken
29571 <https://bugs.webkit.org/show_bug.cgi?id=21497>
29573 Fix a typo in r37433 that causes the failure of a large number of JSC
29574 tests with the bytecode interpreter enabled.
29577 (JSC::Machine::privateExecute):
29579 2008-10-08 Mark Rowe <mrowe@apple.com>
29584 (JSC::): Update type of argument to ctiTrampoline.
29586 2008-10-08 Darin Adler <darin@apple.com>
29588 Reviewed by Cameron Zwarich.
29590 - https://bugs.webkit.org/show_bug.cgi?id=21403
29591 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
29593 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
29594 client over to the new name.
29596 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
29597 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
29598 accessor functions to get at things in the frame.
29600 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
29601 JSGlobalData* and in other cases eliminating them entirely.
29603 * API/JSObjectRef.cpp:
29604 (JSObjectMakeFunctionWithCallback):
29605 (JSObjectMakeFunction):
29606 (JSObjectHasProperty):
29607 (JSObjectGetProperty):
29608 (JSObjectSetProperty):
29609 (JSObjectDeleteProperty):
29610 * API/OpaqueJSString.cpp:
29611 * API/OpaqueJSString.h:
29613 (JSC::CTI::getConstant):
29614 (JSC::CTI::emitGetArg):
29615 (JSC::CTI::emitGetPutArg):
29616 (JSC::CTI::getConstantImmediateNumericArg):
29617 (JSC::CTI::printOpcodeOperandTypes):
29619 (JSC::CTI::compileOpCall):
29620 (JSC::CTI::compileBinaryArithOp):
29621 (JSC::CTI::privateCompileMainPass):
29622 (JSC::CTI::privateCompile):
29623 (JSC::CTI::privateCompileGetByIdProto):
29624 (JSC::CTI::privateCompileGetByIdChain):
29625 (JSC::CTI::compileRegExp):
29628 * VM/CodeGenerator.cpp:
29629 (JSC::CodeGenerator::emitEqualityOp):
29630 (JSC::CodeGenerator::emitLoad):
29631 (JSC::CodeGenerator::emitUnexpectedLoad):
29632 (JSC::CodeGenerator::emitConstruct):
29633 * VM/CodeGenerator.h:
29637 (JSC::jsAddSlowCase):
29639 (JSC::jsTypeStringForValue):
29640 (JSC::Machine::resolve):
29641 (JSC::Machine::resolveSkip):
29642 (JSC::Machine::resolveGlobal):
29643 (JSC::inlineResolveBase):
29644 (JSC::Machine::resolveBase):
29645 (JSC::Machine::resolveBaseAndProperty):
29646 (JSC::Machine::resolveBaseAndFunc):
29647 (JSC::Machine::slideRegisterWindowForCall):
29648 (JSC::isNotObject):
29649 (JSC::Machine::callEval):
29650 (JSC::Machine::dumpCallFrame):
29651 (JSC::Machine::dumpRegisters):
29652 (JSC::Machine::unwindCallFrame):
29653 (JSC::Machine::throwException):
29654 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
29655 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
29656 (JSC::Machine::execute):
29657 (JSC::Machine::debug):
29658 (JSC::Machine::createExceptionScope):
29659 (JSC::cachePrototypeChain):
29660 (JSC::Machine::tryCachePutByID):
29661 (JSC::Machine::tryCacheGetByID):
29662 (JSC::Machine::privateExecute):
29663 (JSC::Machine::retrieveArguments):
29664 (JSC::Machine::retrieveCaller):
29665 (JSC::Machine::retrieveLastCaller):
29666 (JSC::Machine::findFunctionCallFrame):
29667 (JSC::Machine::getArgumentsData):
29668 (JSC::Machine::tryCTICachePutByID):
29669 (JSC::Machine::getCTIArrayLengthTrampoline):
29670 (JSC::Machine::getCTIStringLengthTrampoline):
29671 (JSC::Machine::tryCTICacheGetByID):
29672 (JSC::Machine::cti_op_convert_this):
29673 (JSC::Machine::cti_op_end):
29674 (JSC::Machine::cti_op_add):
29675 (JSC::Machine::cti_op_pre_inc):
29676 (JSC::Machine::cti_timeout_check):
29677 (JSC::Machine::cti_op_loop_if_less):
29678 (JSC::Machine::cti_op_loop_if_lesseq):
29679 (JSC::Machine::cti_op_new_object):
29680 (JSC::Machine::cti_op_put_by_id):
29681 (JSC::Machine::cti_op_put_by_id_second):
29682 (JSC::Machine::cti_op_put_by_id_generic):
29683 (JSC::Machine::cti_op_put_by_id_fail):
29684 (JSC::Machine::cti_op_get_by_id):
29685 (JSC::Machine::cti_op_get_by_id_second):
29686 (JSC::Machine::cti_op_get_by_id_generic):
29687 (JSC::Machine::cti_op_get_by_id_fail):
29688 (JSC::Machine::cti_op_instanceof):
29689 (JSC::Machine::cti_op_del_by_id):
29690 (JSC::Machine::cti_op_mul):
29691 (JSC::Machine::cti_op_new_func):
29692 (JSC::Machine::cti_op_call_JSFunction):
29693 (JSC::Machine::cti_vm_compile):
29694 (JSC::Machine::cti_op_push_activation):
29695 (JSC::Machine::cti_op_call_NotJSFunction):
29696 (JSC::Machine::cti_op_create_arguments):
29697 (JSC::Machine::cti_op_tear_off_activation):
29698 (JSC::Machine::cti_op_tear_off_arguments):
29699 (JSC::Machine::cti_op_ret_profiler):
29700 (JSC::Machine::cti_op_ret_scopeChain):
29701 (JSC::Machine::cti_op_new_array):
29702 (JSC::Machine::cti_op_resolve):
29703 (JSC::Machine::cti_op_construct_JSConstruct):
29704 (JSC::Machine::cti_op_construct_NotJSConstruct):
29705 (JSC::Machine::cti_op_get_by_val):
29706 (JSC::Machine::cti_op_resolve_func):
29707 (JSC::Machine::cti_op_sub):
29708 (JSC::Machine::cti_op_put_by_val):
29709 (JSC::Machine::cti_op_put_by_val_array):
29710 (JSC::Machine::cti_op_lesseq):
29711 (JSC::Machine::cti_op_loop_if_true):
29712 (JSC::Machine::cti_op_negate):
29713 (JSC::Machine::cti_op_resolve_base):
29714 (JSC::Machine::cti_op_resolve_skip):
29715 (JSC::Machine::cti_op_resolve_global):
29716 (JSC::Machine::cti_op_div):
29717 (JSC::Machine::cti_op_pre_dec):
29718 (JSC::Machine::cti_op_jless):
29719 (JSC::Machine::cti_op_not):
29720 (JSC::Machine::cti_op_jtrue):
29721 (JSC::Machine::cti_op_post_inc):
29722 (JSC::Machine::cti_op_eq):
29723 (JSC::Machine::cti_op_lshift):
29724 (JSC::Machine::cti_op_bitand):
29725 (JSC::Machine::cti_op_rshift):
29726 (JSC::Machine::cti_op_bitnot):
29727 (JSC::Machine::cti_op_resolve_with_base):
29728 (JSC::Machine::cti_op_new_func_exp):
29729 (JSC::Machine::cti_op_mod):
29730 (JSC::Machine::cti_op_less):
29731 (JSC::Machine::cti_op_neq):
29732 (JSC::Machine::cti_op_post_dec):
29733 (JSC::Machine::cti_op_urshift):
29734 (JSC::Machine::cti_op_bitxor):
29735 (JSC::Machine::cti_op_new_regexp):
29736 (JSC::Machine::cti_op_bitor):
29737 (JSC::Machine::cti_op_call_eval):
29738 (JSC::Machine::cti_op_throw):
29739 (JSC::Machine::cti_op_get_pnames):
29740 (JSC::Machine::cti_op_next_pname):
29741 (JSC::Machine::cti_op_push_scope):
29742 (JSC::Machine::cti_op_pop_scope):
29743 (JSC::Machine::cti_op_typeof):
29744 (JSC::Machine::cti_op_to_jsnumber):
29745 (JSC::Machine::cti_op_in):
29746 (JSC::Machine::cti_op_push_new_scope):
29747 (JSC::Machine::cti_op_jmp_scopes):
29748 (JSC::Machine::cti_op_put_by_index):
29749 (JSC::Machine::cti_op_switch_imm):
29750 (JSC::Machine::cti_op_switch_char):
29751 (JSC::Machine::cti_op_switch_string):
29752 (JSC::Machine::cti_op_del_by_val):
29753 (JSC::Machine::cti_op_put_getter):
29754 (JSC::Machine::cti_op_put_setter):
29755 (JSC::Machine::cti_op_new_error):
29756 (JSC::Machine::cti_op_debug):
29757 (JSC::Machine::cti_vm_throw):
29760 * VM/RegisterFile.h:
29762 * kjs/DebuggerCallFrame.cpp:
29763 (JSC::DebuggerCallFrame::functionName):
29764 (JSC::DebuggerCallFrame::type):
29765 (JSC::DebuggerCallFrame::thisObject):
29766 (JSC::DebuggerCallFrame::evaluate):
29767 * kjs/DebuggerCallFrame.h:
29768 * kjs/ExecState.cpp:
29769 (JSC::CallFrame::thisValue):
29771 * kjs/FunctionConstructor.cpp:
29772 (JSC::constructFunction):
29773 * kjs/JSActivation.cpp:
29774 (JSC::JSActivation::JSActivation):
29775 (JSC::JSActivation::argumentsGetter):
29776 * kjs/JSActivation.h:
29777 * kjs/JSGlobalObject.cpp:
29778 (JSC::JSGlobalObject::init):
29779 * kjs/JSGlobalObjectFunctions.cpp:
29780 (JSC::globalFuncEval):
29781 * kjs/JSVariableObject.h:
29783 (JSC::Parser::parse):
29784 * kjs/RegExpConstructor.cpp:
29785 (JSC::constructRegExp):
29786 * kjs/RegExpPrototype.cpp:
29787 (JSC::regExpProtoFuncCompile):
29789 (prettyPrintScript):
29790 * kjs/StringPrototype.cpp:
29791 (JSC::stringProtoFuncMatch):
29792 (JSC::stringProtoFuncSearch):
29793 * kjs/identifier.cpp:
29794 (JSC::Identifier::checkSameIdentifierTable):
29795 * kjs/interpreter.cpp:
29796 (JSC::Interpreter::checkSyntax):
29797 (JSC::Interpreter::evaluate):
29799 (JSC::ThrowableExpressionData::emitThrowError):
29800 (JSC::RegExpNode::emitCode):
29801 (JSC::ArrayNode::emitCode):
29802 (JSC::InstanceOfNode::emitCode):
29805 (JSC::RegExp::RegExp):
29806 (JSC::RegExp::create):
29808 * profiler/HeavyProfile.h:
29809 * profiler/Profile.h:
29813 2008-10-08 Mark Rowe <mrowe@apple.com>
29815 Typed by Maciej Stachowiak, reviewed by Mark Rowe.
29817 Fix crash in fast/js/constant-folding.html with CTI disabled.
29820 (JSC::Machine::privateExecute):
29822 2008-10-08 Timothy Hatcher <timothy@apple.com>
29824 Roll out r37427 because it causes an infinite recursion loading about:blank.
29826 https://bugs.webkit.org/show_bug.cgi?id=21476
29828 2008-10-08 Darin Adler <darin@apple.com>
29830 Reviewed by Cameron Zwarich.
29832 - https://bugs.webkit.org/show_bug.cgi?id=21403
29833 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
29835 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
29836 client over to the new name.
29838 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
29839 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
29840 accessor functions to get at things in the frame.
29842 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
29843 JSGlobalData* and in other cases eliminating them entirely.
29845 * API/JSObjectRef.cpp:
29846 (JSObjectMakeFunctionWithCallback):
29847 (JSObjectMakeFunction):
29848 (JSObjectHasProperty):
29849 (JSObjectGetProperty):
29850 (JSObjectSetProperty):
29851 (JSObjectDeleteProperty):
29852 * API/OpaqueJSString.cpp:
29853 * API/OpaqueJSString.h:
29855 (JSC::CTI::getConstant):
29856 (JSC::CTI::emitGetArg):
29857 (JSC::CTI::emitGetPutArg):
29858 (JSC::CTI::getConstantImmediateNumericArg):
29859 (JSC::CTI::printOpcodeOperandTypes):
29861 (JSC::CTI::compileOpCall):
29862 (JSC::CTI::compileBinaryArithOp):
29863 (JSC::CTI::privateCompileMainPass):
29864 (JSC::CTI::privateCompile):
29865 (JSC::CTI::privateCompileGetByIdProto):
29866 (JSC::CTI::privateCompileGetByIdChain):
29867 (JSC::CTI::compileRegExp):
29870 * VM/CodeGenerator.cpp:
29871 (JSC::CodeGenerator::emitEqualityOp):
29872 (JSC::CodeGenerator::emitLoad):
29873 (JSC::CodeGenerator::emitUnexpectedLoad):
29874 (JSC::CodeGenerator::emitConstruct):
29875 * VM/CodeGenerator.h:
29879 (JSC::jsAddSlowCase):
29881 (JSC::jsTypeStringForValue):
29882 (JSC::Machine::resolve):
29883 (JSC::Machine::resolveSkip):
29884 (JSC::Machine::resolveGlobal):
29885 (JSC::inlineResolveBase):
29886 (JSC::Machine::resolveBase):
29887 (JSC::Machine::resolveBaseAndProperty):
29888 (JSC::Machine::resolveBaseAndFunc):
29889 (JSC::Machine::slideRegisterWindowForCall):
29890 (JSC::isNotObject):
29891 (JSC::Machine::callEval):
29892 (JSC::Machine::dumpCallFrame):
29893 (JSC::Machine::dumpRegisters):
29894 (JSC::Machine::unwindCallFrame):
29895 (JSC::Machine::throwException):
29896 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
29897 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
29898 (JSC::Machine::execute):
29899 (JSC::Machine::debug):
29900 (JSC::Machine::createExceptionScope):
29901 (JSC::cachePrototypeChain):
29902 (JSC::Machine::tryCachePutByID):
29903 (JSC::Machine::tryCacheGetByID):
29904 (JSC::Machine::privateExecute):
29905 (JSC::Machine::retrieveArguments):
29906 (JSC::Machine::retrieveCaller):
29907 (JSC::Machine::retrieveLastCaller):
29908 (JSC::Machine::findFunctionCallFrame):
29909 (JSC::Machine::getArgumentsData):
29910 (JSC::Machine::tryCTICachePutByID):
29911 (JSC::Machine::getCTIArrayLengthTrampoline):
29912 (JSC::Machine::getCTIStringLengthTrampoline):
29913 (JSC::Machine::tryCTICacheGetByID):
29914 (JSC::Machine::cti_op_convert_this):
29915 (JSC::Machine::cti_op_end):
29916 (JSC::Machine::cti_op_add):
29917 (JSC::Machine::cti_op_pre_inc):
29918 (JSC::Machine::cti_timeout_check):
29919 (JSC::Machine::cti_op_loop_if_less):
29920 (JSC::Machine::cti_op_loop_if_lesseq):
29921 (JSC::Machine::cti_op_new_object):
29922 (JSC::Machine::cti_op_put_by_id):
29923 (JSC::Machine::cti_op_put_by_id_second):
29924 (JSC::Machine::cti_op_put_by_id_generic):
29925 (JSC::Machine::cti_op_put_by_id_fail):
29926 (JSC::Machine::cti_op_get_by_id):
29927 (JSC::Machine::cti_op_get_by_id_second):
29928 (JSC::Machine::cti_op_get_by_id_generic):
29929 (JSC::Machine::cti_op_get_by_id_fail):
29930 (JSC::Machine::cti_op_instanceof):
29931 (JSC::Machine::cti_op_del_by_id):
29932 (JSC::Machine::cti_op_mul):
29933 (JSC::Machine::cti_op_new_func):
29934 (JSC::Machine::cti_op_call_JSFunction):
29935 (JSC::Machine::cti_vm_compile):
29936 (JSC::Machine::cti_op_push_activation):
29937 (JSC::Machine::cti_op_call_NotJSFunction):
29938 (JSC::Machine::cti_op_create_arguments):
29939 (JSC::Machine::cti_op_tear_off_activation):
29940 (JSC::Machine::cti_op_tear_off_arguments):
29941 (JSC::Machine::cti_op_ret_profiler):
29942 (JSC::Machine::cti_op_ret_scopeChain):
29943 (JSC::Machine::cti_op_new_array):
29944 (JSC::Machine::cti_op_resolve):
29945 (JSC::Machine::cti_op_construct_JSConstruct):
29946 (JSC::Machine::cti_op_construct_NotJSConstruct):
29947 (JSC::Machine::cti_op_get_by_val):
29948 (JSC::Machine::cti_op_resolve_func):
29949 (JSC::Machine::cti_op_sub):
29950 (JSC::Machine::cti_op_put_by_val):
29951 (JSC::Machine::cti_op_put_by_val_array):
29952 (JSC::Machine::cti_op_lesseq):
29953 (JSC::Machine::cti_op_loop_if_true):
29954 (JSC::Machine::cti_op_negate):
29955 (JSC::Machine::cti_op_resolve_base):
29956 (JSC::Machine::cti_op_resolve_skip):
29957 (JSC::Machine::cti_op_resolve_global):
29958 (JSC::Machine::cti_op_div):
29959 (JSC::Machine::cti_op_pre_dec):
29960 (JSC::Machine::cti_op_jless):
29961 (JSC::Machine::cti_op_not):
29962 (JSC::Machine::cti_op_jtrue):
29963 (JSC::Machine::cti_op_post_inc):
29964 (JSC::Machine::cti_op_eq):
29965 (JSC::Machine::cti_op_lshift):
29966 (JSC::Machine::cti_op_bitand):
29967 (JSC::Machine::cti_op_rshift):
29968 (JSC::Machine::cti_op_bitnot):
29969 (JSC::Machine::cti_op_resolve_with_base):
29970 (JSC::Machine::cti_op_new_func_exp):
29971 (JSC::Machine::cti_op_mod):
29972 (JSC::Machine::cti_op_less):
29973 (JSC::Machine::cti_op_neq):
29974 (JSC::Machine::cti_op_post_dec):
29975 (JSC::Machine::cti_op_urshift):
29976 (JSC::Machine::cti_op_bitxor):
29977 (JSC::Machine::cti_op_new_regexp):
29978 (JSC::Machine::cti_op_bitor):
29979 (JSC::Machine::cti_op_call_eval):
29980 (JSC::Machine::cti_op_throw):
29981 (JSC::Machine::cti_op_get_pnames):
29982 (JSC::Machine::cti_op_next_pname):
29983 (JSC::Machine::cti_op_push_scope):
29984 (JSC::Machine::cti_op_pop_scope):
29985 (JSC::Machine::cti_op_typeof):
29986 (JSC::Machine::cti_op_to_jsnumber):
29987 (JSC::Machine::cti_op_in):
29988 (JSC::Machine::cti_op_push_new_scope):
29989 (JSC::Machine::cti_op_jmp_scopes):
29990 (JSC::Machine::cti_op_put_by_index):
29991 (JSC::Machine::cti_op_switch_imm):
29992 (JSC::Machine::cti_op_switch_char):
29993 (JSC::Machine::cti_op_switch_string):
29994 (JSC::Machine::cti_op_del_by_val):
29995 (JSC::Machine::cti_op_put_getter):
29996 (JSC::Machine::cti_op_put_setter):
29997 (JSC::Machine::cti_op_new_error):
29998 (JSC::Machine::cti_op_debug):
29999 (JSC::Machine::cti_vm_throw):
30002 * VM/RegisterFile.h:
30004 * kjs/DebuggerCallFrame.cpp:
30005 (JSC::DebuggerCallFrame::functionName):
30006 (JSC::DebuggerCallFrame::type):
30007 (JSC::DebuggerCallFrame::thisObject):
30008 (JSC::DebuggerCallFrame::evaluate):
30009 * kjs/DebuggerCallFrame.h:
30010 * kjs/ExecState.cpp:
30011 (JSC::CallFrame::thisValue):
30013 * kjs/FunctionConstructor.cpp:
30014 (JSC::constructFunction):
30015 * kjs/JSActivation.cpp:
30016 (JSC::JSActivation::JSActivation):
30017 (JSC::JSActivation::argumentsGetter):
30018 * kjs/JSActivation.h:
30019 * kjs/JSGlobalObject.cpp:
30020 (JSC::JSGlobalObject::init):
30021 * kjs/JSGlobalObjectFunctions.cpp:
30022 (JSC::globalFuncEval):
30023 * kjs/JSVariableObject.h:
30025 (JSC::Parser::parse):
30026 * kjs/RegExpConstructor.cpp:
30027 (JSC::constructRegExp):
30028 * kjs/RegExpPrototype.cpp:
30029 (JSC::regExpProtoFuncCompile):
30031 (prettyPrintScript):
30032 * kjs/StringPrototype.cpp:
30033 (JSC::stringProtoFuncMatch):
30034 (JSC::stringProtoFuncSearch):
30035 * kjs/identifier.cpp:
30036 (JSC::Identifier::checkSameIdentifierTable):
30037 * kjs/interpreter.cpp:
30038 (JSC::Interpreter::checkSyntax):
30039 (JSC::Interpreter::evaluate):
30041 (JSC::ThrowableExpressionData::emitThrowError):
30042 (JSC::RegExpNode::emitCode):
30043 (JSC::ArrayNode::emitCode):
30044 (JSC::InstanceOfNode::emitCode):
30047 (JSC::RegExp::RegExp):
30048 (JSC::RegExp::create):
30050 * profiler/HeavyProfile.h:
30051 * profiler/Profile.h:
30055 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
30057 Reviewed by Oliver Hunt.
30059 Avoid endless loops when compiling without the computed goto
30062 NEXT_OPCODE expands to "continue", which will not work inside
30066 (JSC::Machine::privateExecute):
30068 2008-10-08 Maciej Stachowiak <mjs@apple.com>
30070 Reviewed by Oliver Hunt.
30072 Re-landing the following fix with the crashing bug in it fixed (r37405):
30074 - optimize away multiplication by constant 1.0
30076 2.3% speedup on v8 RayTrace benchmark
30078 Apparently it's not uncommon for JavaScript code to multiply by
30079 constant 1.0 in the mistaken belief that this converts integer to
30080 floating point and that there is any operational difference.
30083 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
30084 case where parameter is already number.
30085 (JSC::CTI::privateCompileSlowCases): ditto
30087 (JSC::Machine::privateExecute): ditto
30089 (makeMultNode): Transform as follows:
30090 +FOO * BAR ==> FOO * BAR
30091 FOO * +BAR ==> FOO * BAR
30094 (makeDivNode): Transform as follows:
30095 +FOO / BAR ==> FOO / BAR
30096 FOO / +BAR ==> FOO / BAR
30097 (makeSubNode): Transform as follows:
30098 +FOO - BAR ==> FOO - BAR
30099 FOO - +BAR ==> FOO - BAR
30101 (JSC::ExpressionNode::stripUnaryPlus): Helper for above
30103 (JSC::UnaryPlusNode::stripUnaryPlus): ditto
30105 2008-10-08 Maciej Stachowiak <mjs@apple.com>
30107 Reviewed by Oliver Hunt.
30109 - correctly handle appending -0 to a string, it should stringify as just 0
30112 (JSC::concatenate):
30114 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
30118 Fix WebKit compilation with VC2008SP1
30120 Apply the TR1 workaround for JavaScriptCore, too.
30122 * JavaScriptCore.pro:
30124 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
30128 Fix compilation errors on VS2008 64Bit
30130 * kjs/collector.cpp:
30131 (JSC::currentThreadStackBase):
30133 2008-10-08 André Pönitz <apoenitz@trolltech.com>
30137 Fix compilation with Qt namespaces.
30141 2008-10-07 Sam Weinig <sam@webkit.org>
30145 2008-10-07 Oliver Hunt <oliver@apple.com>
30147 Reviewed by Cameron Zwarich.
30149 Switch CTI runtime calls to the fastcall calling convention
30151 Basically this means that we get to store the argument for CTI
30152 calls in the ECX register, which saves a register->memory write
30153 and subsequent memory->register read.
30155 This is a 1.7% progression in SunSpider and 2.4% on commandline
30156 v8 tests on Windows
30160 (JSC::CTI::privateCompilePutByIdTransition):
30161 (JSC::CTI::privateCompilePatchGetArrayLength):
30164 * masm/X86Assembler.h:
30165 (JSC::X86Assembler::emitRestoreArgumentReference):
30166 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
30167 We need this to correctly reload ecx from inside certain property access
30171 2008-10-07 Maciej Stachowiak <mjs@apple.com>
30173 Reviewed by Mark Rowe.
30175 - optimize away multiplication by constant 1.0
30177 2.3% speedup on v8 RayTrace benchmark
30179 Apparently it's not uncommon for JavaScript code to multiply by
30180 constant 1.0 in the mistaken belief that this converts integer to
30181 floating point and that there is any operational difference.
30184 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
30185 case where parameter is already number.
30186 (JSC::CTI::privateCompileSlowCases): ditto
30188 (JSC::Machine::privateExecute): ditto
30190 (makeMultNode): Transform as follows:
30191 +FOO * BAR ==> FOO * BAR
30192 FOO * +BAR ==> FOO * BAR
30195 (makeDivNode): Transform as follows:
30196 +FOO / BAR ==> FOO / BAR
30197 FOO / +BAR ==> FOO / BAR
30198 (makeSubNode): Transform as follows:
30199 +FOO - BAR ==> FOO - BAR
30200 FOO - +BAR ==> FOO - BAR
30202 (JSC::ExpressionNode::stripUnaryPlus): Helper for above
30204 (JSC::UnaryPlusNode::stripUnaryPlus): ditto
30206 2008-10-07 Maciej Stachowiak <mjs@apple.com>
30208 Reviewed by Oliver Hunt.
30210 - make constant folding code more consistent
30212 Added a makeSubNode to match add, mult and div; use the makeFooNode functions always,
30213 instead of allocating nodes directly in other places in the grammar.
30217 2008-10-07 Sam Weinig <sam@webkit.org>
30219 Reviewed by Cameron Zwarich.
30221 Move hasGetterSetterProperties flag from PropertyMap to StructureID.
30223 * kjs/JSObject.cpp:
30224 (JSC::JSObject::put):
30225 (JSC::JSObject::defineGetter):
30226 (JSC::JSObject::defineSetter):
30228 (JSC::JSObject::hasGetterSetterProperties):
30229 (JSC::JSObject::getOwnPropertySlotForWrite):
30230 (JSC::JSObject::getOwnPropertySlot):
30231 * kjs/PropertyMap.h:
30232 * kjs/StructureID.cpp:
30233 (JSC::StructureID::StructureID):
30234 (JSC::StructureID::addPropertyTransition):
30235 (JSC::StructureID::toDictionaryTransition):
30236 (JSC::StructureID::changePrototypeTransition):
30237 (JSC::StructureID::getterSetterTransition):
30238 * kjs/StructureID.h:
30239 (JSC::StructureID::hasGetterSetterProperties):
30240 (JSC::StructureID::setHasGetterSetterProperties):
30242 2008-10-07 Sam Weinig <sam@webkit.org>
30244 Reviewed by Cameron Zwarich.
30246 Roll r37370 back in with bug fixes.
30248 - PropertyMap::storageSize() should reflect the number of keys + deletedOffsets
30249 and has nothing to do with the internal deletedSentinel count anymore.
30251 2008-10-07 Gavin Barraclough <barraclough@apple.com>
30253 Reviewed by Oliver Hunt.
30255 Move callframe initialization into JIT code, again.
30257 As a part of the restructuring the second result from functions is now
30258 returned in edx, allowing the new value of 'r' to be returned via a
30259 register, and stored to the stack from JIT code, too.
30261 4.5% progression on v8-tests. (3% in their harness)
30265 (JSC::CTI::emitCall):
30266 (JSC::CTI::compileOpCall):
30267 (JSC::CTI::privateCompileMainPass):
30268 (JSC::CTI::privateCompileSlowCases):
30269 (JSC::CTI::privateCompile):
30271 (JSC::CallRecord::CallRecord):
30273 (JSC::Machine::cti_op_call_JSFunction):
30274 (JSC::Machine::cti_op_construct_JSConstruct):
30275 (JSC::Machine::cti_op_resolve_func):
30276 (JSC::Machine::cti_op_post_inc):
30277 (JSC::Machine::cti_op_resolve_with_base):
30278 (JSC::Machine::cti_op_post_dec):
30280 * kjs/JSFunction.h:
30281 * kjs/ScopeChain.h:
30283 2008-10-07 Mark Rowe <mrowe@apple.com>
30285 Fix typo in method name.
30290 2008-10-07 Cameron Zwarich <zwarich@apple.com>
30292 Rubber-stamped by Mark Rowe.
30296 2008-10-06 Sam Weinig <sam@webkit.org>
30298 Reviewed by Cameron Zwarich.
30300 Fix for https://bugs.webkit.org/show_bug.cgi?id=21415
30301 Improve the division between PropertyStorageArray and PropertyMap
30303 - Rework ProperyMap to store offsets in the value so that they don't
30304 change when rehashing. This allows us not to have to keep the
30305 PropertyStorageArray in sync and thus not have to pass it in.
30306 - Rename PropertyMap::getOffset -> PropertyMap::get since put/remove
30307 now also return offsets.
30308 - A Vector of deleted offsets is now needed since the storage is out of
30311 1% win on SunSpider. Wash on V8 suite.
30313 * JavaScriptCore.exp:
30315 (JSC::transitionWillNeedStorageRealloc):
30317 (JSC::Machine::privateExecute):
30318 Transition logic can be greatly simplified by the fact that
30319 the storage capacity is always known, and is correct for the
30321 * kjs/JSObject.cpp:
30322 (JSC::JSObject::put): Rename getOffset -> get.
30323 (JSC::JSObject::deleteProperty): Ditto.
30324 (JSC::JSObject::getPropertyAttributes): Ditto.
30325 (JSC::JSObject::removeDirect): Use returned offset to
30326 clear the value in the PropertyNameArray.
30327 (JSC::JSObject::allocatePropertyStorage): Add assert.
30329 (JSC::JSObject::getDirect): Rename getOffset -> get
30330 (JSC::JSObject::getDirectLocation): Rename getOffset -> get
30331 (JSC::JSObject::putDirect): Use propertyStorageCapacity to determine whether
30332 or not to resize. Also, since put now returns an offset (and thus
30333 addPropertyTransition does also) setting of the PropertyStorageArray is
30335 (JSC::JSObject::transitionTo):
30336 * kjs/PropertyMap.cpp:
30337 (JSC::PropertyMap::checkConsistency): PropertyStorageArray is no longer
30339 (JSC::PropertyMap::operator=): Copy the delete offsets vector.
30340 (JSC::PropertyMap::put): Instead of setting the PropertyNameArray
30341 explicitly, return the offset where the value should go.
30342 (JSC::PropertyMap::remove): Instead of removing from the PropertyNameArray
30343 explicitly, return the offset where the value should be removed.
30344 (JSC::PropertyMap::get): Switch to using the stored offset, instead
30345 of the implicit one.
30346 (JSC::PropertyMap::insert):
30347 (JSC::PropertyMap::expand): This is never called when m_table is null,
30348 so remove that branch and add it as an assertion.
30349 (JSC::PropertyMap::createTable): Consistency checks no longer take
30350 a PropertyNameArray.
30351 (JSC::PropertyMap::rehash): No need to rehash the PropertyNameArray
30352 now that it is completely out of band.
30353 * kjs/PropertyMap.h:
30354 (JSC::PropertyMapEntry::PropertyMapEntry): Store offset into PropertyNameArray.
30355 (JSC::PropertyMap::get): Switch to using the stored offset, instead
30356 of the implicit one.
30357 * kjs/StructureID.cpp:
30358 (JSC::StructureID::StructureID): Initialize the propertyStorageCapacity to
30359 JSObject::inlineStorageCapacity.
30360 (JSC::StructureID::growPropertyStorageCapacity): Grow the storage capacity as
30362 (JSC::StructureID::addPropertyTransition): Copy the storage capacity.
30363 (JSC::StructureID::toDictionaryTransition): Ditto.
30364 (JSC::StructureID::changePrototypeTransition): Ditto.
30365 (JSC::StructureID::getterSetterTransition): Ditto.
30366 * kjs/StructureID.h:
30367 (JSC::StructureID::propertyStorageCapacity): Add propertyStorageCapacity
30368 which is the current capacity for the JSObjects PropertyStorageArray.
30369 It starts at the JSObject::inlineStorageCapacity (currently 2), then
30370 when it first needs to be resized moves to the JSObject::nonInlineBaseStorageCapacity
30371 (currently 16), and after that doubles each time.
30373 2008-10-06 Cameron Zwarich <zwarich@apple.com>
30375 Reviewed by Oliver Hunt.
30377 Bug 21396: Remove the OptionalCalleeActivation call frame slot
30378 <https://bugs.webkit.org/show_bug.cgi?id=21396>
30380 Remove the OptionalCalleeActivation call frame slot. We have to be
30381 careful to store the activation object in a register, because objects
30382 in the scope chain do not get marked.
30384 This is a 0.3% speedup on both SunSpider and the V8 benchmark.
30387 (JSC::CTI::privateCompileMainPass):
30388 * VM/CodeBlock.cpp:
30389 (JSC::CodeBlock::dump):
30390 * VM/CodeGenerator.cpp:
30391 (JSC::CodeGenerator::CodeGenerator):
30392 (JSC::CodeGenerator::emitReturn):
30393 * VM/CodeGenerator.h:
30395 (JSC::Machine::dumpRegisters):
30396 (JSC::Machine::unwindCallFrame):
30397 (JSC::Machine::privateExecute):
30398 (JSC::Machine::cti_op_call_JSFunction):
30399 (JSC::Machine::cti_op_push_activation):
30400 (JSC::Machine::cti_op_tear_off_activation):
30401 (JSC::Machine::cti_op_construct_JSConstruct):
30403 (JSC::Machine::initializeCallFrame):
30404 * VM/RegisterFile.h:
30405 (JSC::RegisterFile::):
30407 2008-10-06 Tony Chang <tony@chromium.org>
30409 Reviewed by Alexey Proskuryakov.
30411 Chromium doesn't use pthreads on windows, so make its use conditional.
30413 Also convert a WORD to a DWORD to avoid a compiler warning. This
30414 matches the other methods around it.
30416 * wtf/ThreadingWin.cpp:
30417 (WTF::wtfThreadEntryPoint):
30418 (WTF::ThreadCondition::broadcast):
30420 2008-10-06 Mark Mentovai <mark@moxienet.com>
30422 Reviewed by Tim Hatcher.
30424 Allow ENABLE_DASHBOARD_SUPPORT and ENABLE_MAC_JAVA_BRIDGE to be
30425 disabled on the Mac.
30427 https://bugs.webkit.org/show_bug.cgi?id=21333
30431 2008-10-06 Steve Falkenburg <sfalken@apple.com>
30433 https://bugs.webkit.org/show_bug.cgi?id=21416
30434 Pass 0 for size to VirtualAlloc, as documented by MSDN.
30435 Identified by Application Verifier.
30437 Reviewed by Darin Adler.
30439 * kjs/collector.cpp:
30442 2008-10-06 Kevin McCullough <kmccullough@apple.com>
30444 Reviewed by Tim Hatcheri and Oliver Hunt.
30446 https://bugs.webkit.org/show_bug.cgi?id=21412
30447 Bug 21412: Refactor user initiated profile count to be more stable
30448 - Export UString::from for use with creating the profile title.
30450 * JavaScriptCore.exp:
30452 2008-10-06 Maciej Stachowiak <mjs@apple.com>
30454 Not reviewed. Build fix.
30456 - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these
30458 * API/JSValueRef.cpp:
30459 (JSValueToBoolean):
30461 * JavaScriptCore.exp:
30462 * VM/CodeBlock.cpp:
30463 (JSC::CodeBlock::dump):
30465 (JSC::Machine::privateExecute):
30466 (JSC::Machine::cti_op_loop_if_true):
30467 (JSC::Machine::cti_op_not):
30468 (JSC::Machine::cti_op_jtrue):
30469 * kjs/ArrayPrototype.cpp:
30470 (JSC::arrayProtoFuncFilter):
30471 (JSC::arrayProtoFuncEvery):
30472 (JSC::arrayProtoFuncSome):
30473 * kjs/BooleanConstructor.cpp:
30474 (JSC::constructBoolean):
30475 (JSC::callBooleanConstructor):
30476 * kjs/GetterSetter.h:
30478 (JSC::JSValue::toBoolean):
30479 * kjs/JSNumberCell.cpp:
30480 (JSC::JSNumberCell::toBoolean):
30481 * kjs/JSNumberCell.h:
30482 * kjs/JSObject.cpp:
30483 (JSC::JSObject::toBoolean):
30485 * kjs/JSString.cpp:
30486 (JSC::JSString::toBoolean):
30489 * kjs/RegExpConstructor.cpp:
30490 (JSC::setRegExpConstructorMultiline):
30491 * kjs/RegExpObject.cpp:
30492 (JSC::RegExpObject::match):
30493 * kjs/RegExpPrototype.cpp:
30494 (JSC::regExpProtoFuncToString):
30496 2008-10-06 Maciej Stachowiak <mjs@apple.com>
30498 Reviewed by Sam Weinig.
30500 - optimize op_jtrue, op_loop_if_true and op_not in various ways
30501 https://bugs.webkit.org/show_bug.cgi?id=21404
30503 1) Make JSValue::toBoolean nonvirtual and completely inline by
30504 making use of the StructureID type field.
30506 2) Make JSValue::toBoolean not take an ExecState; doesn't need it.
30508 3) Make op_not, op_loop_if_true and op_jtrue not read the
30509 ExecState (toBoolean doesn't need it any more) and not check
30510 exceptions (toBoolean can't throw).
30512 * API/JSValueRef.cpp:
30513 (JSValueToBoolean):
30514 * JavaScriptCore.exp:
30515 * VM/CodeBlock.cpp:
30516 (JSC::CodeBlock::dump):
30518 (JSC::Machine::privateExecute):
30519 (JSC::Machine::cti_op_loop_if_true):
30520 (JSC::Machine::cti_op_not):
30521 (JSC::Machine::cti_op_jtrue):
30522 * kjs/ArrayPrototype.cpp:
30523 (JSC::arrayProtoFuncFilter):
30524 (JSC::arrayProtoFuncEvery):
30525 (JSC::arrayProtoFuncSome):
30526 * kjs/BooleanConstructor.cpp:
30527 (JSC::constructBoolean):
30528 (JSC::callBooleanConstructor):
30529 * kjs/GetterSetter.h:
30531 (JSC::JSValue::toBoolean):
30532 * kjs/JSNumberCell.cpp:
30533 * kjs/JSNumberCell.h:
30534 (JSC::JSNumberCell::toBoolean):
30535 * kjs/JSObject.cpp:
30537 (JSC::JSObject::toBoolean):
30538 (JSC::JSCell::toBoolean):
30539 * kjs/JSString.cpp:
30541 (JSC::JSString::toBoolean):
30543 * kjs/RegExpConstructor.cpp:
30544 (JSC::setRegExpConstructorMultiline):
30545 * kjs/RegExpObject.cpp:
30546 (JSC::RegExpObject::match):
30547 * kjs/RegExpPrototype.cpp:
30548 (JSC::regExpProtoFuncToString):
30550 2008-10-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
30554 Build fix for MinGW.
30556 * JavaScriptCore.pri:
30557 * kjs/DateMath.cpp:
30558 (JSC::highResUpTime):
30560 2008-10-05 Cameron Zwarich <zwarich@apple.com>
30562 Reviewed by Oliver Hunt.
30564 Remove ScopeNode::containsClosures() now that it is unused.
30567 (JSC::ScopeNode::containsClosures):
30569 2008-10-05 Maciej Stachowiak <mjs@apple.com>
30571 Reviewed by Cameron Zwarich.
30573 - fix releas-only test failures caused by the fix to bug 21375
30576 (JSC::Machine::unwindCallFrame): Update ExecState while unwinding call frames;
30577 it now matters more to have a still-valid ExecState, since dynamicGlobalObject
30578 will make use of the ExecState's scope chain.
30581 2008-10-05 Cameron Zwarich <zwarich@apple.com>
30583 Reviewed by Oliver Hunt.
30585 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
30586 <https://bugs.webkit.org/show_bug.cgi?id=21364>
30588 Use information from the parser to detect whether an activation is
30589 needed or 'arguments' is used, and emit explicit instructions to tear
30590 them off before op_ret. This allows a branch to be removed from op_ret
30591 and simplifies some other code. This does cause a small change in the
30592 behaviour of 'f.arguments'; it is no longer live when 'arguments' is not
30593 mentioned in the lexical scope of the function.
30595 It should now be easy to remove the OptionaCalleeActivation slot in the
30596 call frame, but this will be done in a later patch.
30599 (JSC::CTI::privateCompileMainPass):
30600 * VM/CodeBlock.cpp:
30601 (JSC::CodeBlock::dump):
30602 * VM/CodeGenerator.cpp:
30603 (JSC::CodeGenerator::emitReturn):
30604 * VM/CodeGenerator.h:
30606 (JSC::Machine::unwindCallFrame):
30607 (JSC::Machine::privateExecute):
30608 (JSC::Machine::retrieveArguments):
30609 (JSC::Machine::cti_op_create_arguments):
30610 (JSC::Machine::cti_op_tear_off_activation):
30611 (JSC::Machine::cti_op_tear_off_arguments):
30614 * kjs/Arguments.cpp:
30615 (JSC::Arguments::mark):
30617 (JSC::Arguments::isTornOff):
30618 (JSC::Arguments::Arguments):
30619 (JSC::Arguments::copyRegisters):
30620 (JSC::JSActivation::copyRegisters):
30621 * kjs/JSActivation.cpp:
30622 (JSC::JSActivation::argumentsGetter):
30623 * kjs/JSActivation.h:
30625 2008-10-05 Maciej Stachowiak <mjs@apple.com>
30627 Reviewed by Oliver Hunt.
30629 - fixed "REGRESSION (r37297): fast/js/deep-recursion-test takes too long and times out"
30630 https://bugs.webkit.org/show_bug.cgi?id=21375
30632 The problem is that dynamicGlobalObject had become O(N) in number
30633 of call frames, but unwinding the stack for an exception called it
30634 for every call frame, resulting in O(N^2) behavior for an
30635 exception thrown from inside deep recursion.
30637 Instead of doing it that way, stash the dynamic global object in JSGlobalData.
30639 * JavaScriptCore.exp:
30641 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Helper class to temporarily
30642 store and later restore a dynamicGlobalObject in JSGlobalData.
30643 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
30644 (JSC::Machine::execute): In each version, establish a DynamicGlobalObjectScope.
30645 For ProgramNode, always establish set new dynamicGlobalObject, for FunctionBody and Eval,
30646 only if none is currently set.
30649 * kjs/JSGlobalData.cpp:
30650 (JSC::JSGlobalData::JSGlobalData): Ininitalize new dynamicGlobalObject field to 0.
30651 * kjs/JSGlobalData.h:
30652 * kjs/JSGlobalObject.h:
30653 (JSC::ExecState::dynamicGlobalObject): Moved here from ExecState for benefit of inlining.
30654 Return lexical global object if this is a globalExec(), otherwise look in JSGlobalData
30655 for the one stashed there.
30657 2008-10-05 Sam Weinig <sam@webkit.org>
30659 Reviewed by Maciej Stachowiak.
30661 Avoid an extra lookup when transitioning to an existing StructureID
30662 by caching the offset of property that caused the transition.
30664 1% win on V8 suite. Wash on SunSpider.
30666 * kjs/PropertyMap.cpp:
30667 (JSC::PropertyMap::put):
30668 * kjs/PropertyMap.h:
30669 * kjs/StructureID.cpp:
30670 (JSC::StructureID::StructureID):
30671 (JSC::StructureID::addPropertyTransition):
30672 * kjs/StructureID.h:
30673 (JSC::StructureID::setCachedTransistionOffset):
30674 (JSC::StructureID::cachedTransistionOffset):
30676 2008-10-05 Cameron Zwarich <zwarich@apple.com>
30678 Reviewed by Maciej Stachowiak.
30680 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
30681 <https://bugs.webkit.org/show_bug.cgi?id=21364>
30683 This patch does not yet remove the branch, but it does a bit of refactoring
30684 so that a CodeGenerator now knows whether the associated CodeBlock will need
30685 a full scope before doing any code generation. This makes it possible to emit
30686 explicit tear-off instructions before every op_ret.
30689 (JSC::CodeBlock::CodeBlock):
30690 * VM/CodeGenerator.cpp:
30691 (JSC::CodeGenerator::generate):
30692 (JSC::CodeGenerator::CodeGenerator):
30693 (JSC::CodeGenerator::emitPushScope):
30694 (JSC::CodeGenerator::emitPushNewScope):
30696 (JSC::ScopeNode::needsActivation):
30698 2008-10-05 Gavin Barraclough <barraclough@apple.com>
30700 Reviewed by Cameron Zwarich.
30702 Fix for bug #21387 - using SamplingTool with CTI.
30704 (1) A repatch offset offset changes due to an additional instruction to update SamplingTool state.
30705 (2) Fix an incusion order problem due to ExecState changes.
30706 (3) Change to a MACHINE_SAMPLING macro, use of exec should now be accessing global data.
30709 (JSC::CTI::execute):
30710 * VM/SamplingTool.h:
30711 (JSC::SamplingTool::privateExecuteReturned):
30714 2008-10-04 Mark Rowe <mrowe@apple.com>
30716 Reviewed by Tim Hatcher.
30718 Add a 'Check For Weak VTables' build phase to catch weak vtables as early as possible.
30720 * JavaScriptCore.xcodeproj/project.pbxproj:
30722 2008-10-04 Sam Weinig <sam@webkit.org>
30724 Reviewed by Oliver Hunt.
30726 Fix https://bugs.webkit.org/show_bug.cgi?id=21320
30727 leaks of PropertyNameArrayData seen on buildbot
30729 - Fix RefPtr cycle by making PropertyNameArrayData's pointer back
30730 to the StructureID a weak pointer.
30732 * kjs/PropertyNameArray.h:
30733 (JSC::PropertyNameArrayData::setCachedStructureID):
30734 (JSC::PropertyNameArrayData::cachedStructureID):
30735 * kjs/StructureID.cpp:
30736 (JSC::StructureID::getEnumerablePropertyNames):
30737 (JSC::StructureID::clearEnumerationCache):
30738 (JSC::StructureID::~StructureID):
30740 2008-10-04 Darin Adler <darin@apple.com>
30742 Reviewed by Cameron Zwarich.
30744 - https://bugs.webkit.org/show_bug.cgi?id=21295
30745 Bug 21295: Replace ExecState with a call frame Register pointer
30747 10% faster on Richards; other v8 benchmarks faster too.
30748 A wash on SunSpider.
30750 This does the minimum necessary to get the speedup. Next step in
30751 cleaning this up is to replace ExecState with a CallFrame class,
30752 and be more judicious about when to pass a call frame and when
30753 to pass a global data pointer, global object pointer, or perhaps
30754 something else entirely.
30756 * VM/CTI.cpp: Remove the debug-only check of the exception in
30757 ctiVMThrowTrampoline -- already checked in the code the trampoline
30758 jumps to, so not all that useful. Removed the exec argument from
30759 ctiTrampoline. Removed emitDebugExceptionCheck -- no longer needed.
30760 (JSC::CTI::emitCall): Removed code to set ExecState::m_callFrame.
30761 (JSC::CTI::privateCompileMainPass): Removed code in catch to extract
30762 the exception from ExecState::m_exception; instead, the code that
30763 jumps into catch will make sure the exception is already in eax.
30764 * VM/CTI.h: Removed exec from the ctiTrampoline. Also removed the
30765 non-helpful "volatile". Temporarily left ARG_exec in as a synonym
30766 for ARG_r; I'll change that on a future cleanup pass when introducing
30767 more use of the CallFrame type.
30768 (JSC::CTI::execute): Removed the ExecState* argument.
30770 * VM/ExceptionHelpers.cpp:
30771 (JSC::InterruptedExecutionError::InterruptedExecutionError): Take
30772 JSGlobalData* instead of ExecState*.
30773 (JSC::createInterruptedExecutionException): Ditto.
30774 * VM/ExceptionHelpers.h: Ditto. Also removed an unneeded include.
30777 (JSC::slideRegisterWindowForCall): Removed the exec and
30778 exceptionValue arguments. Changed to return 0 when there's a stack
30779 overflow rather than using a separate exception argument to cut
30780 down on memory accesses in the calling convention.
30781 (JSC::Machine::unwindCallFrame): Removed the exec argument when
30782 constructing a DebuggerCallFrame. Also removed code to set
30783 ExecState::m_callFrame.
30784 (JSC::Machine::throwException): Removed the exec argument when
30785 construction a DebuggerCallFrame.
30786 (JSC::Machine::execute): Updated to use the register instead of
30787 ExecState and also removed various uses of ExecState.
30788 (JSC::Machine::debug):
30789 (JSC::Machine::privateExecute): Put globalData into a local
30790 variable so it can be used throughout the interpreter. Changed
30791 the VM_CHECK_EXCEPTION to get the exception in globalData instead
30792 of through ExecState.
30793 (JSC::Machine::retrieveLastCaller): Turn exec into a registers
30794 pointer by calling registers() instead of by getting m_callFrame.
30795 (JSC::Machine::callFrame): Ditto.
30796 Tweaked exception macros. Made new versions for when you know
30797 you have an exception. Get at global exception with ARG_globalData.
30798 Got rid of the need to pass in the return value type.
30799 (JSC::Machine::cti_op_add): Update to use new version of exception
30801 (JSC::Machine::cti_op_pre_inc): Ditto.
30802 (JSC::Machine::cti_timeout_check): Ditto.
30803 (JSC::Machine::cti_op_instanceof): Ditto.
30804 (JSC::Machine::cti_op_new_func): Ditto.
30805 (JSC::Machine::cti_op_call_JSFunction): Optimized by using the
30806 ARG values directly instead of through local variables -- this gets
30807 rid of code that just shuffles things around in the stack frame.
30808 Also get rid of ExecState and update for the new way exceptions are
30809 handled in slideRegisterWindowForCall.
30810 (JSC::Machine::cti_vm_compile): Update to make exec out of r since
30811 they are both the same thing now.
30812 (JSC::Machine::cti_op_call_NotJSFunction): Ditto.
30813 (JSC::Machine::cti_op_init_arguments): Ditto.
30814 (JSC::Machine::cti_op_resolve): Ditto.
30815 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
30816 (JSC::Machine::cti_op_construct_NotJSConstruct): Ditto.
30817 (JSC::Machine::cti_op_resolve_func): Ditto.
30818 (JSC::Machine::cti_op_put_by_val): Ditto.
30819 (JSC::Machine::cti_op_put_by_val_array): Ditto.
30820 (JSC::Machine::cti_op_resolve_skip): Ditto.
30821 (JSC::Machine::cti_op_resolve_global): Ditto.
30822 (JSC::Machine::cti_op_post_inc): Ditto.
30823 (JSC::Machine::cti_op_resolve_with_base): Ditto.
30824 (JSC::Machine::cti_op_post_dec): Ditto.
30825 (JSC::Machine::cti_op_call_eval): Ditto.
30826 (JSC::Machine::cti_op_throw): Ditto. Also rearranged to return
30827 the exception value as the return value so it can be used by
30829 (JSC::Machine::cti_op_push_scope): Ditto.
30830 (JSC::Machine::cti_op_in): Ditto.
30831 (JSC::Machine::cti_op_del_by_val): Ditto.
30832 (JSC::Machine::cti_vm_throw): Ditto. Also rearranged to return
30833 the exception value as the return value so it can be used by
30836 * kjs/DebuggerCallFrame.cpp:
30837 (JSC::DebuggerCallFrame::functionName): Pass globalData.
30838 (JSC::DebuggerCallFrame::evaluate): Eliminated code to make a
30840 * kjs/DebuggerCallFrame.h: Removed ExecState argument from
30843 * kjs/ExecState.h: Eliminated all data members and made ExecState
30844 inherit privately from Register instead. Also added a typedef to
30845 the future name for this class, which is CallFrame. It's just a
30846 Register* that knows it's a pointer at a call frame. The new class
30847 can't be constructed or copied. Changed all functions to use
30848 the this pointer instead of m_callFrame. Changed exception-related
30849 functions to access an exception in JSGlobalData. Removed functions
30850 used by CTI to pass the return address to the throw machinery --
30851 this is now done directly with a global in the global data.
30853 * kjs/FunctionPrototype.cpp:
30854 (JSC::functionProtoFuncToString): Pass globalData instead of exec.
30856 * kjs/InternalFunction.cpp:
30857 (JSC::InternalFunction::name): Take globalData instead of exec.
30858 * kjs/InternalFunction.h: Ditto.
30860 * kjs/JSGlobalData.cpp: Initialize the new exception global to 0.
30861 * kjs/JSGlobalData.h: Declare two new globals. One for the current
30862 exception and another for the return address used by CTI to
30863 implement the throw operation.
30865 * kjs/JSGlobalObject.cpp:
30866 (JSC::JSGlobalObject::init): Removed code to set up globalExec,
30867 which is now the same thing as globalCallFrame.
30868 (JSC::JSGlobalObject::reset): Get globalExec from our globalExec
30869 function so we don't have to repeat the logic twice.
30870 (JSC::JSGlobalObject::mark): Removed code to mark the exception;
30871 the exception is now stored in JSGlobalData and marked there.
30872 (JSC::JSGlobalObject::globalExec): Return a pointer to the end
30873 of the global call frame.
30874 * kjs/JSGlobalObject.h: Removed the globalExec data member.
30876 * kjs/JSObject.cpp:
30877 (JSC::JSObject::putDirectFunction): Pass globalData instead of exec.
30879 * kjs/collector.cpp:
30880 (JSC::Heap::collect): Mark the global exception.
30882 * profiler/ProfileGenerator.cpp:
30883 (JSC::ProfileGenerator::addParentForConsoleStart): Pass globalData
30884 instead of exec to createCallIdentifier.
30886 * profiler/Profiler.cpp:
30887 (JSC::Profiler::willExecute): Pass globalData instead of exec to
30888 createCallIdentifier.
30889 (JSC::Profiler::didExecute): Ditto.
30890 (JSC::Profiler::createCallIdentifier): Take globalData instead of
30892 (JSC::createCallIdentifierFromFunctionImp): Ditto.
30893 * profiler/Profiler.h: Change interface to take a JSGlobalData
30894 instead of an ExecState.
30896 2008-10-04 Cameron Zwarich <zwarich@apple.com>
30898 Reviewed by Darin Adler.
30900 Bug 21369: Add opcode documentation for all undocumented opcodes
30901 <https://bugs.webkit.org/show_bug.cgi?id=21369>
30903 This patch adds opcode documentation for all undocumented opcodes, and
30904 it also renames op_init_arguments to op_create_arguments.
30907 (JSC::CTI::privateCompileMainPass):
30908 * VM/CodeBlock.cpp:
30909 (JSC::CodeBlock::dump):
30910 * VM/CodeGenerator.cpp:
30911 (JSC::CodeGenerator::CodeGenerator):
30913 (JSC::Machine::privateExecute):
30914 (JSC::Machine::cti_op_create_arguments):
30918 2008-10-03 Maciej Stachowiak <mjs@apple.com>
30920 Reviewed by Cameron Zwarich.
30922 - "this" object in methods called on primitives should be wrapper object
30923 https://bugs.webkit.org/show_bug.cgi?id=21362
30925 I changed things so that functions which use "this" do a fast
30926 version of toThisObject conversion if needed. Currently we miss
30927 the conversion entirely, at least for primitive types. Using
30928 TypeInfo and the primitive check, I made the fast case bail out
30931 This is inexplicably an 1.007x SunSpider speedup (and a wash on V8 benchmarks).
30933 Also renamed some opcodes for clarity:
30936 init_activation ==> enter_with_activation
30939 (JSC::CTI::privateCompileMainPass):
30940 (JSC::CTI::privateCompileSlowCases):
30941 * VM/CodeBlock.cpp:
30942 (JSC::CodeBlock::dump):
30943 * VM/CodeGenerator.cpp:
30944 (JSC::CodeGenerator::generate):
30945 (JSC::CodeGenerator::CodeGenerator):
30947 (JSC::Machine::privateExecute):
30948 (JSC::Machine::cti_op_convert_this):
30951 * kjs/JSActivation.cpp:
30952 (JSC::JSActivation::JSActivation):
30953 * kjs/JSActivation.h:
30954 (JSC::JSActivation::createStructureID):
30956 (JSC::JSValue::needsThisConversion):
30957 * kjs/JSGlobalData.cpp:
30958 (JSC::JSGlobalData::JSGlobalData):
30959 * kjs/JSGlobalData.h:
30960 * kjs/JSNumberCell.h:
30961 (JSC::JSNumberCell::createStructureID):
30962 * kjs/JSStaticScopeObject.h:
30963 (JSC::JSStaticScopeObject::JSStaticScopeObject):
30964 (JSC::JSStaticScopeObject::createStructureID):
30966 (JSC::JSString::createStructureID):
30969 (JSC::TypeInfo::needsThisConversion):
30971 (JSC::ScopeNode::usesThis):
30973 2008-10-03 Cameron Zwarich <zwarich@apple.com>
30975 Reviewed by Maciej Stachowiak.
30977 Bug 21356: The size of the RegisterFile differs depending on 32-bit / 64-bit and Debug / Release
30978 <https://bugs.webkit.org/show_bug.cgi?id=21356>
30980 The RegisterFile decreases in size (measured in terms of numbers of
30981 Registers) as the size of a Register increases. This causes
30983 js1_5/Regress/regress-159334.js
30985 to fail in 64-bit debug builds. This fix makes the RegisterFile on all
30986 platforms the same size that it is in 32-bit Release builds.
30988 * VM/RegisterFile.h:
30989 (JSC::RegisterFile::RegisterFile):
30991 2008-10-03 Maciej Stachowiak <mjs@apple.com>
30993 Reviewed by Cameron Zwarich.
30995 - Some code cleanup to how we handle code features.
30997 1) Rename FeatureInfo typedef to CodeFeatures.
30998 2) Rename NodeFeatureInfo template to NodeInfo.
30999 3) Keep CodeFeature bitmask in ScopeNode instead of trying to break it out into individual bools.
31000 4) Rename misleadingly named "needsClosure" method to "containsClosures", which better describes the meaning
31002 5) Make setUsersArguments() not take an argument since it only goes one way.
31004 * JavaScriptCore.exp:
31006 (JSC::CodeBlock::CodeBlock):
31009 (JSC::Parser::didFinishParsing):
31011 (JSC::Parser::parse):
31014 (JSC::ScopeNode::ScopeNode):
31015 (JSC::ProgramNode::ProgramNode):
31016 (JSC::ProgramNode::create):
31017 (JSC::EvalNode::EvalNode):
31018 (JSC::EvalNode::create):
31019 (JSC::FunctionBodyNode::FunctionBodyNode):
31020 (JSC::FunctionBodyNode::create):
31022 (JSC::ScopeNode::usesEval):
31023 (JSC::ScopeNode::containsClosures):
31024 (JSC::ScopeNode::usesArguments):
31025 (JSC::ScopeNode::setUsesArguments):
31027 2008-10-03 Cameron Zwarich <zwarich@apple.com>
31029 Reviewed by Maciej Stachowiak.
31031 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit
31032 <https://bugs.webkit.org/show_bug.cgi?id=21343>
31034 A fix was landed for this issue in r37253, and the ChangeLog assumes
31035 that it is a compiler bug, but it turns out that it is a subtle issue
31036 with mixing signed and unsigned 32-bit values in a 64-bit environment.
31037 In order to properly fix this bug, we should convert our signed offsets
31038 into the register file to use ptrdiff_t.
31040 This may not be the only instance of this issue, but I will land this
31041 fix first and look for more later.
31044 (JSC::Machine::getArgumentsData):
31046 * kjs/Arguments.cpp:
31047 (JSC::Arguments::getOwnPropertySlot):
31049 (JSC::Arguments::init):
31051 2008-10-03 Darin Adler <darin@apple.com>
31053 * VM/CTI.cpp: Another Windows build fix. Change the args of ctiTrampoline.
31055 * kjs/JSNumberCell.h: A build fix for newer versions of gcc. Added
31056 declarations of JSGlobalData overloads of jsNumberCell.
31058 2008-10-03 Darin Adler <darin@apple.com>
31060 - try to fix Windows build
31062 * kjs/ScopeChain.h: Add forward declaration of JSGlobalData.
31064 2008-10-03 Darin Adler <darin@apple.com>
31066 Reviewed by Geoff Garen.
31068 - next step of https://bugs.webkit.org/show_bug.cgi?id=21295
31069 Turn ExecState into a call frame pointer.
31071 Remove m_globalObject and m_globalData from ExecState.
31073 SunSpider says this is a wash (slightly faster but not statistically
31074 significant); which is good enough since it's a preparation step and
31075 not supposed to be a spedup.
31077 * API/JSCallbackFunction.cpp:
31078 (JSC::JSCallbackFunction::JSCallbackFunction):
31079 * kjs/ArrayConstructor.cpp:
31080 (JSC::ArrayConstructor::ArrayConstructor):
31081 * kjs/BooleanConstructor.cpp:
31082 (JSC::BooleanConstructor::BooleanConstructor):
31083 * kjs/DateConstructor.cpp:
31084 (JSC::DateConstructor::DateConstructor):
31085 * kjs/ErrorConstructor.cpp:
31086 (JSC::ErrorConstructor::ErrorConstructor):
31087 * kjs/FunctionPrototype.cpp:
31088 (JSC::FunctionPrototype::FunctionPrototype):
31089 * kjs/JSFunction.cpp:
31090 (JSC::JSFunction::JSFunction):
31091 * kjs/NativeErrorConstructor.cpp:
31092 (JSC::NativeErrorConstructor::NativeErrorConstructor):
31093 * kjs/NumberConstructor.cpp:
31094 (JSC::NumberConstructor::NumberConstructor):
31095 * kjs/ObjectConstructor.cpp:
31096 (JSC::ObjectConstructor::ObjectConstructor):
31097 * kjs/PrototypeFunction.cpp:
31098 (JSC::PrototypeFunction::PrototypeFunction):
31099 * kjs/RegExpConstructor.cpp:
31100 (JSC::RegExpConstructor::RegExpConstructor):
31101 * kjs/StringConstructor.cpp:
31102 (JSC::StringConstructor::StringConstructor):
31103 Pass JSGlobalData* instead of ExecState* to the InternalFunction
31106 * API/OpaqueJSString.cpp: Added now-needed include.
31108 * JavaScriptCore.exp: Updated.
31111 (JSC::CTI::emitSlowScriptCheck): Changed to use ARGS_globalData
31112 instead of ARGS_exec.
31114 * VM/CTI.h: Added a new argument to the CTI, the global data pointer.
31115 While it's possible to get to the global data pointer using the
31116 ExecState pointer, it's slow enough that it's better to just keep
31117 it around in the CTI arguments.
31119 * VM/CodeBlock.h: Moved the CodeType enum here from ExecState.h.
31122 (JSC::Machine::execute): Pass fewer arguments when constructing
31123 ExecState, and pass the global data pointer when invoking CTI.
31124 (JSC::Machine::firstCallFrame): Added. Used to get the dynamic global
31125 object, which is in the scope chain of the first call frame.
31126 (JSC::Machine::cti_op_add): Use globalData instead of exec when
31127 possible, to keep fast cases fast, since it's now more expensive to
31128 get to it through the exec pointer.
31129 (JSC::Machine::cti_timeout_check): Ditto.
31130 (JSC::Machine::cti_op_put_by_id_second): Ditto.
31131 (JSC::Machine::cti_op_get_by_id_second): Ditto.
31132 (JSC::Machine::cti_op_mul): Ditto.
31133 (JSC::Machine::cti_vm_compile): Ditto.
31134 (JSC::Machine::cti_op_get_by_val): Ditto.
31135 (JSC::Machine::cti_op_sub): Ditto.
31136 (JSC::Machine::cti_op_put_by_val): Ditto.
31137 (JSC::Machine::cti_op_put_by_val_array): Ditto.
31138 (JSC::Machine::cti_op_negate): Ditto.
31139 (JSC::Machine::cti_op_div): Ditto.
31140 (JSC::Machine::cti_op_pre_dec): Ditto.
31141 (JSC::Machine::cti_op_post_inc): Ditto.
31142 (JSC::Machine::cti_op_lshift): Ditto.
31143 (JSC::Machine::cti_op_bitand): Ditto.
31144 (JSC::Machine::cti_op_rshift): Ditto.
31145 (JSC::Machine::cti_op_bitnot): Ditto.
31146 (JSC::Machine::cti_op_mod): Ditto.
31147 (JSC::Machine::cti_op_post_dec): Ditto.
31148 (JSC::Machine::cti_op_urshift): Ditto.
31149 (JSC::Machine::cti_op_bitxor): Ditto.
31150 (JSC::Machine::cti_op_bitor): Ditto.
31151 (JSC::Machine::cti_op_call_eval): Ditto.
31152 (JSC::Machine::cti_op_throw): Ditto.
31153 (JSC::Machine::cti_op_is_string): Ditto.
31154 (JSC::Machine::cti_op_debug): Ditto.
31155 (JSC::Machine::cti_vm_throw): Ditto.
31157 * VM/Machine.h: Added firstCallFrame.
31159 * kjs/DebuggerCallFrame.cpp:
31160 (JSC::DebuggerCallFrame::evaluate): Pass fewer arguments when
31161 constructing ExecState.
31163 * kjs/ExecState.cpp: Deleted contents. Later we'll remove the
31166 * kjs/ExecState.h: Removed m_globalObject and m_globalData.
31167 Moved CodeType into another header.
31168 (JSC::ExecState::ExecState): Take only a single argument, a
31169 call frame pointer.
31170 (JSC::ExecState::dynamicGlobalObject): Get the object from
31171 the first call frame since it's no longer stored.
31172 (JSC::ExecState::globalData): Get the global data from the
31173 scope chain, since we no longer store a pointer to it here.
31174 (JSC::ExecState::identifierTable): Ditto.
31175 (JSC::ExecState::propertyNames): Ditto.
31176 (JSC::ExecState::emptyList): Ditto.
31177 (JSC::ExecState::lexer): Ditto.
31178 (JSC::ExecState::parser): Ditto.
31179 (JSC::ExecState::machine): Ditto.
31180 (JSC::ExecState::arrayTable): Ditto.
31181 (JSC::ExecState::dateTable): Ditto.
31182 (JSC::ExecState::mathTable): Ditto.
31183 (JSC::ExecState::numberTable): Ditto.
31184 (JSC::ExecState::regExpTable): Ditto.
31185 (JSC::ExecState::regExpConstructorTable): Ditto.
31186 (JSC::ExecState::stringTable): Ditto.
31187 (JSC::ExecState::heap): Ditto.
31189 * kjs/FunctionConstructor.cpp:
31190 (JSC::FunctionConstructor::FunctionConstructor): Pass
31191 JSGlobalData* instead of ExecState* to the InternalFunction
31193 (JSC::constructFunction): Pass the global data pointer when
31194 constructing a new scope chain.
31196 * kjs/InternalFunction.cpp:
31197 (JSC::InternalFunction::InternalFunction): Take a JSGlobalData*
31198 instead of an ExecState*. Later we can change more places to
31199 work this way -- it's more efficient to take the type you need
31200 since the caller might already have it.
31201 * kjs/InternalFunction.h: Ditto.
31204 (JSC::JSCell::operator new): Added an overload that takes a
31205 JSGlobalData* so you can construct without an ExecState*.
31207 * kjs/JSGlobalObject.cpp:
31208 (JSC::JSGlobalObject::init): Moved creation of the global scope
31209 chain in here, since it now requires a pointer to the global data.
31210 Moved the initialization of the call frame in here since it requires
31211 the global scope chain node. Removed the extra argument to ExecState
31212 when creating the global ExecState*.
31213 * kjs/JSGlobalObject.h: Removed initialization of globalScopeChain
31214 and the call frame from the JSGlobalObjectData constructor. Added
31215 a thisValue argument to the init function.
31217 * kjs/JSNumberCell.cpp: Added versions of jsNumberCell that take
31218 JSGlobalData* rather than ExecState*.
31219 * kjs/JSNumberCell.h:
31220 (JSC::JSNumberCell::operator new): Added a version that takes
31222 (JSC::JSNumberCell::JSNumberCell): Ditto.
31223 (JSC::jsNumber): Ditto.
31224 * kjs/JSString.cpp:
31225 (JSC::jsString): Ditto.
31226 (JSC::jsSubstring): Ditto.
31227 (JSC::jsOwnedString): Ditto.
31229 (JSC::JSString::JSString): Changed to take JSGlobalData*.
31230 (JSC::jsEmptyString): Added a version that takes JSGlobalData*.
31231 (JSC::jsSingleCharacterString): Ditto.
31232 (JSC::jsSingleCharacterSubstring): Ditto.
31233 (JSC::jsNontrivialString): Ditto.
31234 (JSC::JSString::getIndex): Ditto.
31235 (JSC::jsString): Ditto.
31236 (JSC::jsSubstring): Ditto.
31237 (JSC::jsOwnedString): Ditto.
31239 * kjs/ScopeChain.h: Added a globalData pointer to each node.
31240 (JSC::ScopeChainNode::ScopeChainNode): Initialize the globalData
31242 (JSC::ScopeChainNode::push): Set the global data pointer in the
31244 (JSC::ScopeChain::ScopeChain): Take a globalData argument.
31246 * kjs/SmallStrings.cpp:
31247 (JSC::SmallStrings::createEmptyString): Take JSGlobalData* instead of
31249 (JSC::SmallStrings::createSingleCharacterString): Ditto.
31250 * kjs/SmallStrings.h:
31251 (JSC::SmallStrings::emptyString): Ditto.
31252 (JSC::SmallStrings::singleCharacterString): Ditto.
31254 2008-10-03 Cameron Zwarich <zwarich@apple.com>
31256 Reviewed by Geoff Garen.
31258 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit
31259 <https://bugs.webkit.org/show_bug.cgi?id=21343>
31261 Add a workaround for a bug in GCC, which affects GCC 4.0, GCC 4.2, and
31262 llvm-gcc 4.2. I put it in an #ifdef because it was a slight regression
31263 on SunSpider in 32-bit, although that might be entirely random.
31265 * kjs/Arguments.cpp:
31266 (JSC::Arguments::getOwnPropertySlot):
31268 2008-10-03 Darin Adler <darin@apple.com>
31270 Rubber stamped by Alexey Proskuryakov.
31272 * kjs/Shell.cpp: (main): Don't delete JSGlobalData. Later, we need to change
31273 this tool to use public JavaScriptCore API instead.
31275 2008-10-03 Darin Adler <darin@apple.com>
31277 Suggested by Alexey Proskuryakov.
31279 * kjs/JSGlobalData.cpp:
31280 (JSC::JSGlobalData::~JSGlobalData): Remove call to heap.destroy() because
31281 it's too late to ref the JSGlobalData object once it's already being
31282 destroyed. In practice this is not a problem because WebCore's JSGlobalData
31283 is never destroyed and JSGlobalContextRelease takes care of calling
31284 heap.destroy() in advance.
31286 2008-10-02 Oliver Hunt <oliver@apple.com>
31288 Reviewed by Maciej Stachowiak.
31290 Replace SSE3 check with an SSE2 check, and implement SSE2 check on windows.
31292 5.6% win on SunSpider on windows.
31295 (JSC::isSSE2Present):
31296 (JSC::CTI::compileBinaryArithOp):
31297 (JSC::CTI::compileBinaryArithOpSlowCase):
31299 2008-10-03 Maciej Stachowiak <mjs@apple.com>
31301 Rubber stamped by Cameron Zwarich.
31303 - fix mistaken change of | to || which caused a big perf regression on EarleyBoyer
31307 2008-10-02 Darin Adler <darin@apple.com>
31309 Reviewed by Geoff Garen.
31311 - https://bugs.webkit.org/show_bug.cgi?id=21321
31312 Bug 21321: speed up JavaScriptCore by inlining Heap in JSGlobalData
31314 1.019x as fast on SunSpider.
31317 (JSEvaluateScript): Use heap. instead of heap-> to work with the heap.
31318 (JSCheckScriptSyntax): Ditto.
31319 (JSGarbageCollect): Ditto.
31320 (JSReportExtraMemoryCost): Ditto.
31321 * API/JSContextRef.cpp:
31322 (JSGlobalContextRetain): Ditto.
31323 (JSGlobalContextRelease): Destroy the heap with the destroy function instead
31324 of the delete operator.
31325 (JSContextGetGlobalObject): Use heap. instead of heap-> to work with the heap.
31326 * API/JSObjectRef.cpp:
31327 (JSObjectMake): Use heap. instead of heap-> to work with the heap.
31328 (JSObjectMakeFunctionWithCallback): Ditto.
31329 (JSObjectMakeConstructor): Ditto.
31330 (JSObjectMakeFunction): Ditto.
31331 (JSObjectMakeArray): Ditto.
31332 (JSObjectMakeDate): Ditto.
31333 (JSObjectMakeError): Ditto.
31334 (JSObjectMakeRegExp): Ditto.
31335 (JSObjectHasProperty): Ditto.
31336 (JSObjectGetProperty): Ditto.
31337 (JSObjectSetProperty): Ditto.
31338 (JSObjectGetPropertyAtIndex): Ditto.
31339 (JSObjectSetPropertyAtIndex): Ditto.
31340 (JSObjectDeleteProperty): Ditto.
31341 (JSObjectCallAsFunction): Ditto.
31342 (JSObjectCallAsConstructor): Ditto.
31343 (JSObjectCopyPropertyNames): Ditto.
31344 (JSPropertyNameAccumulatorAddName): Ditto.
31345 * API/JSValueRef.cpp:
31346 (JSValueIsEqual): Ditto.
31347 (JSValueIsInstanceOfConstructor): Ditto.
31348 (JSValueMakeNumber): Ditto.
31349 (JSValueMakeString): Ditto.
31350 (JSValueToNumber): Ditto.
31351 (JSValueToStringCopy): Ditto.
31352 (JSValueToObject): Ditto.
31353 (JSValueProtect): Ditto.
31354 (JSValueUnprotect): Ditto.
31357 (JSC::ExecState::heap): Update to use the & operator.
31359 * kjs/JSGlobalData.cpp:
31360 (JSC::JSGlobalData::JSGlobalData): Update to initialize a heap member
31361 instead of calling new to make a heap.
31362 (JSC::JSGlobalData::~JSGlobalData): Destroy the heap with the destroy
31363 function instead of the delete operator.
31364 * kjs/JSGlobalData.h: Change from Heap* to a Heap.
31365 * kjs/JSGlobalObject.cpp:
31366 (JSC::JSGlobalObject::mark): Use the & operator here.
31367 (JSC::JSGlobalObject::operator new): Use heap. instead of heap-> to work
31370 2008-10-02 Cameron Zwarich <zwarich@apple.com>
31372 Reviewed by Geoff Garen.
31374 Bug 21317: Replace RegisterFile size and capacity information with Register pointers
31375 <https://bugs.webkit.org/show_bug.cgi?id=21317>
31377 This is a 2.3% speedup on the V8 DeltaBlue benchmark, a 3.3% speedup on
31378 the V8 Raytrace benchmark, and a 1.0% speedup on SunSpider.
31381 (JSC::slideRegisterWindowForCall):
31382 (JSC::Machine::callEval):
31383 (JSC::Machine::execute):
31384 (JSC::Machine::privateExecute):
31385 (JSC::Machine::cti_op_call_JSFunction):
31386 (JSC::Machine::cti_op_construct_JSConstruct):
31387 * VM/RegisterFile.cpp:
31388 (JSC::RegisterFile::~RegisterFile):
31389 * VM/RegisterFile.h:
31390 (JSC::RegisterFile::RegisterFile):
31391 (JSC::RegisterFile::start):
31392 (JSC::RegisterFile::end):
31393 (JSC::RegisterFile::size):
31394 (JSC::RegisterFile::shrink):
31395 (JSC::RegisterFile::grow):
31396 (JSC::RegisterFile::lastGlobal):
31397 (JSC::RegisterFile::markGlobals):
31398 (JSC::RegisterFile::markCallFrames):
31399 * kjs/JSGlobalObject.cpp:
31400 (JSC::JSGlobalObject::copyGlobalsTo):
31402 2008-10-02 Cameron Zwarich <zwarich@apple.com>
31404 Rubber-stamped by Darin Adler.
31406 Change bitwise operations introduced in r37166 to boolean operations. We
31407 only use bitwise operations over boolean operations for increasing
31408 performance in extremely hot code, but that does not apply to anything
31413 2008-10-02 Gavin Barraclough <barraclough@apple.com>
31415 Reviewed by Darin Adler.
31417 Fix for bug #21232 - should reset m_isPendingDash on flush,
31418 and should allow '\-' as beginning or end of a range (though
31419 not to specifiy a range itself).
31422 * wrec/CharacterClassConstructor.cpp:
31423 (JSC::CharacterClassConstructor::put):
31424 (JSC::CharacterClassConstructor::flush):
31425 * wrec/CharacterClassConstructor.h:
31426 (JSC::CharacterClassConstructor::flushBeforeEscapedHyphen):
31428 (JSC::WRECGenerator::generateDisjunction):
31429 (JSC::WRECParser::parseCharacterClass):
31430 (JSC::WRECParser::parseDisjunction):
31433 2008-10-02 Darin Adler <darin@apple.com>
31435 Reviewed by Sam Weinig.
31437 - remove the "static" from declarations in a header file, since we
31438 don't want them to have internal linkage
31440 * VM/Machine.h: Remove the static keyword from the constant and the
31441 three inline functions that Geoff just moved here.
31443 2008-10-02 Geoffrey Garen <ggaren@apple.com>
31445 Reviewed by Sam Weinig.
31447 Fixed https://bugs.webkit.org/show_bug.cgi?id=21283.
31448 Profiler Crashes When Started
31452 (JSC::makeHostCallFramePointer):
31453 (JSC::isHostCallFrame):
31454 (JSC::stripHostCallFrameBit): Moved some things to the header so
31455 JSGlobalObject could use them.
31457 * kjs/JSGlobalObject.h:
31458 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Call the
31459 new makeHostCallFramePointer API, since 0 no longer indicates a host
31462 2008-10-02 Alexey Proskuryakov <ap@webkit.org>
31464 Reviewed by Darin Adler.
31466 https://bugs.webkit.org/show_bug.cgi?id=21304
31467 Stop using a static wrapper map for WebCore JS bindings
31469 * kjs/JSGlobalData.cpp:
31470 (JSC::JSGlobalData::JSGlobalData):
31471 (JSC::JSGlobalData::~JSGlobalData):
31472 (JSC::JSGlobalData::ClientData::~ClientData):
31473 * kjs/JSGlobalData.h:
31474 Added a client data member to JSGlobalData. WebCore will use it to store bindings-related
31477 * JavaScriptCore.exp: Export virtual ClientData destructor.
31479 2008-10-02 Geoffrey Garen <ggaren@apple.com>
31483 Try to fix Qt build.
31487 2008-10-01 Geoffrey Garen <ggaren@apple.com>
31489 Reviewed by Darin Adler and Cameron Zwarich.
31491 Preliminary step toward dynamic recompilation: Standardized and
31492 simplified the parsing interface.
31494 The main goal in this patch is to make it easy to ask for a duplicate
31495 compilation, and get back a duplicate result -- same source URL, same
31496 debugger / profiler ID, same toString behavior, etc.
31498 The basic unit of compilation and evaluation is now SourceCode, which
31499 encompasses a SourceProvider, a range in that provider, and a starting
31502 A SourceProvider now encompasses a source URL, and *is* a source ID,
31503 since a pointer is a unique identifier.
31506 (JSEvaluateScript):
31507 (JSCheckScriptSyntax): Provide a SourceCode to the Interpreter, since
31508 other APIs are no longer supported.
31511 (JSC::EvalCodeCache::get): Provide a SourceCode to the Interpreter, since
31512 other APIs are no longer supported.
31513 (JSC::CodeBlock::CodeBlock): ASSERT something that used to be ASSERTed
31514 by our caller -- this is a better bottleneck.
31516 * VM/CodeGenerator.cpp:
31517 (JSC::CodeGenerator::CodeGenerator): Updated for the fact that
31518 FunctionBodyNode's parameters are no longer a WTF::Vector.
31520 * kjs/Arguments.cpp:
31521 (JSC::Arguments::Arguments): ditto
31523 * kjs/DebuggerCallFrame.cpp:
31524 (JSC::DebuggerCallFrame::evaluate): Provide a SourceCode to the Parser,
31525 since other APIs are no longer supported.
31527 * kjs/FunctionConstructor.cpp:
31528 (JSC::constructFunction): Provide a SourceCode to the Parser, since
31529 other APIs are no longer supported. Adopt FunctionBodyNode's new
31530 "finishParsing" API.
31532 * kjs/JSFunction.cpp:
31533 (JSC::JSFunction::lengthGetter):
31534 (JSC::JSFunction::getParameterName): Updated for the fact that
31535 FunctionBodyNode's parameters are no longer a wtf::Vector.
31537 * kjs/JSFunction.h: Nixed some cruft.
31539 * kjs/JSGlobalObjectFunctions.cpp:
31540 (JSC::globalFuncEval): Provide a SourceCode to the Parser, since
31541 other APIs are no longer supported.
31544 (JSC::Parser::parse): Require a SourceCode argument, instead of a bunch
31545 of broken out parameters. Stop tracking sourceId as an integer, since we
31546 use the SourceProvider pointer for this now. Don't clamp the
31547 startingLineNumber, since SourceCode does that now.
31550 (JSC::Parser::parse): Standardized the parsing interface to require a
31556 (prettyPrintScript):
31558 (runInteractive): Provide a SourceCode to the Interpreter, since
31559 other APIs are no longer supported.
31561 * kjs/SourceProvider.h:
31562 (JSC::SourceProvider::SourceProvider):
31563 (JSC::SourceProvider::url):
31564 (JSC::SourceProvider::asId):
31565 (JSC::UStringSourceProvider::create):
31566 (JSC::UStringSourceProvider::UStringSourceProvider): Added new
31567 responsibilities described above.
31569 * kjs/SourceRange.h:
31570 (JSC::SourceCode::SourceCode):
31571 (JSC::SourceCode::toString):
31572 (JSC::SourceCode::provider):
31573 (JSC::SourceCode::firstLine):
31574 (JSC::SourceCode::data):
31575 (JSC::SourceCode::length): Added new responsibilities described above.
31576 Renamed SourceRange to SourceCode, based on review feedback. Added
31577 a makeSource function for convenience.
31579 * kjs/debugger.h: Provide a SourceCode to the client, since other APIs
31580 are no longer supported.
31582 * kjs/grammar.y: Provide startingLineNumber when creating a SourceCode.
31584 * kjs/debugger.h: Treat sourceId as intptr_t to avoid loss of precision
31585 on 64bit platforms.
31587 * kjs/interpreter.cpp:
31588 (JSC::Interpreter::checkSyntax):
31589 (JSC::Interpreter::evaluate):
31590 * kjs/interpreter.h: Require a SourceCode instead of broken out arguments.
31593 (JSC::Lexer::setCode):
31595 (JSC::Lexer::sourceRange): Fold together the SourceProvider and line number
31596 into a SourceCode. Fixed a bug where the Lexer would accidentally keep
31597 alive the last SourceProvider forever.
31600 (JSC::ScopeNode::ScopeNode):
31601 (JSC::ProgramNode::ProgramNode):
31602 (JSC::ProgramNode::create):
31603 (JSC::EvalNode::EvalNode):
31604 (JSC::EvalNode::generateCode):
31605 (JSC::EvalNode::create):
31606 (JSC::FunctionBodyNode::FunctionBodyNode):
31607 (JSC::FunctionBodyNode::finishParsing):
31608 (JSC::FunctionBodyNode::create):
31609 (JSC::FunctionBodyNode::generateCode):
31610 (JSC::ProgramNode::generateCode):
31611 (JSC::FunctionBodyNode::paramString):
31613 (JSC::ScopeNode::):
31614 (JSC::ScopeNode::sourceId):
31615 (JSC::FunctionBodyNode::):
31616 (JSC::FunctionBodyNode::parameterCount):
31617 (JSC::FuncExprNode::):
31618 (JSC::FuncDeclNode::): Store a SourceCode in all ScopeNodes, since
31619 SourceCode is now responsible for tracking URL, ID, etc. Streamlined
31620 some ad hoc FunctionBodyNode fixups into a "finishParsing" function, to
31621 help make clear what you need to do in order to finish parsing a
31625 (WTF::::releaseBuffer): Don't ASSERT that releaseBuffer() is only called
31626 when buffer is not 0, since FunctionBodyNode is more than happy
31627 to get back a 0 buffer, and other functions like RefPtr::release() allow
31630 2008-10-01 Cameron Zwarich <zwarich@apple.com>
31632 Reviewed by Maciej Stachowiak.
31634 Bug 21289: REGRESSION (r37160): Inspector crashes on load
31635 <https://bugs.webkit.org/show_bug.cgi?id=21289>
31637 The code in Arguments::mark() in r37160 was wrong. It marks indices in
31638 d->registers, but that makes no sense (they are local variables, not
31639 arguments). It should mark those indices in d->registerArray instead.
31641 This patch also changes Arguments::copyRegisters() to use d->numParameters
31642 instead of recomputing it.
31644 * kjs/Arguments.cpp:
31645 (JSC::Arguments::mark):
31647 (JSC::Arguments::copyRegisters):
31649 2008-09-30 Darin Adler <darin@apple.com>
31651 Reviewed by Eric Seidel.
31653 - https://bugs.webkit.org/show_bug.cgi?id=21214
31654 work on getting rid of ExecState
31656 Eliminate some unneeded uses of dynamicGlobalObject.
31658 * API/JSClassRef.cpp:
31659 (OpaqueJSClass::contextData): Changed to use a map in the global data instead
31660 of on the global object. Also fixed to use only a single hash table lookup.
31662 * API/JSObjectRef.cpp:
31663 (JSObjectMakeConstructor): Use lexicalGlobalObject rather than dynamicGlobalObject
31664 to get the object prototype.
31666 * kjs/ArrayPrototype.cpp:
31667 (JSC::arrayProtoFuncToString): Use arrayVisitedElements set in global data rather
31668 than in the global object.
31669 (JSC::arrayProtoFuncToLocaleString): Ditto.
31670 (JSC::arrayProtoFuncJoin): Ditto.
31672 * kjs/JSGlobalData.cpp:
31673 (JSC::JSGlobalData::JSGlobalData): Don't initialize opaqueJSClassData, since
31674 it's no longer a pointer.
31675 (JSC::JSGlobalData::~JSGlobalData): We still need to delete all the values, but
31676 we don't need to delete the map since it's no longer a pointer.
31678 * kjs/JSGlobalData.h: Made opaqueJSClassData a map instead of a pointer to a map.
31679 Also added arrayVisitedElements.
31681 * kjs/JSGlobalObject.h: Removed arrayVisitedElements.
31684 (functionRun): Use lexicalGlobalObject instead of dynamicGlobalObject.
31685 (functionLoad): Ditto.
31687 2008-10-01 Cameron Zwarich <zwarich@apple.com>
31691 Speculative Windows build fix.
31695 2008-10-01 Cameron Zwarich <zwarich@apple.com>
31697 Reviewed by Darin Adler.
31699 Bug 21123: using "arguments" in a function should not force creation of an activation object
31700 <https://bugs.webkit.org/show_bug.cgi?id=21123>
31702 Make the 'arguments' object not require a JSActivation. We store the
31703 'arguments' object in the OptionalCalleeArguments call frame slot. We
31704 need to be able to get the original 'arguments' object to tear it off
31705 when returning from a function, but 'arguments' may be assigned to in a
31708 Therefore, we use the OptionalCalleeArguments slot when we want to get
31709 the original activation or we know that 'arguments' was not assigned a
31710 different value. When 'arguments' may have been assigned a new value,
31711 we use a new local variable that is initialized with 'arguments'. Since
31712 a function parameter named 'arguments' may overwrite the value of
31713 'arguments', we also need to be careful to look up 'arguments' in the
31714 symbol table, so we get the parameter named 'arguments' instead of the
31715 local variable that we have added for holding the 'arguments' object.
31717 This is a 19.1% win on the V8 Raytrace benchmark using the SunSpider
31718 harness, and a 20.7% win using the V8 harness. This amounts to a 6.5%
31719 total speedup on the V8 benchmark suite using the V8 harness.
31722 (JSC::CTI::privateCompileMainPass):
31724 * VM/CodeGenerator.cpp:
31725 (JSC::CodeGenerator::CodeGenerator):
31727 (JSC::Machine::unwindCallFrame):
31728 (JSC::Machine::privateExecute):
31729 (JSC::Machine::retrieveArguments):
31730 (JSC::Machine::cti_op_init_arguments):
31731 (JSC::Machine::cti_op_ret_activation_arguments):
31733 * VM/RegisterFile.h:
31734 (JSC::RegisterFile::):
31735 * kjs/Arguments.cpp:
31736 (JSC::Arguments::mark):
31737 (JSC::Arguments::fillArgList):
31738 (JSC::Arguments::getOwnPropertySlot):
31739 (JSC::Arguments::put):
31741 (JSC::Arguments::setRegisters):
31742 (JSC::Arguments::init):
31743 (JSC::Arguments::Arguments):
31744 (JSC::Arguments::copyRegisters):
31745 (JSC::JSActivation::copyRegisters):
31746 * kjs/JSActivation.cpp:
31747 (JSC::JSActivation::argumentsGetter):
31748 * kjs/JSActivation.h:
31749 (JSC::JSActivation::JSActivationData::JSActivationData):
31752 (JSC::ScopeNode::setUsesArguments):
31753 * masm/X86Assembler.h:
31754 (JSC::X86Assembler::):
31755 (JSC::X86Assembler::orl_mr):
31757 2008-10-01 Kevin McCullough <kmccullough@apple.com>
31759 Rubberstamped by Geoff Garen.
31761 Remove BreakpointCheckStatement because it's not used anymore.
31762 No effect on sunspider or the jsc tests.
31767 2008-09-30 Oliver Hunt <oliver@apple.com>
31769 Reviewed by Geoff Garen.
31771 Improve performance of CTI on windows.
31773 Currently on platforms where the compiler doesn't allow us to safely
31774 index relative to the address of a parameter we need to actually
31775 provide a pointer to CTI runtime call arguments. This patch improves
31776 performance in this case by making the CTI logic for restoring this
31777 parameter much less conservative by only resetting it before we actually
31778 make a call, rather than between each and every SF bytecode we generate
31781 This results in a 3.6% progression on the v8 benchmark when compiled with MSVC.
31784 (JSC::CTI::emitCall):
31785 (JSC::CTI::compileOpCall):
31786 (JSC::CTI::privateCompileMainPass):
31787 (JSC::CTI::privateCompileSlowCases):
31788 (JSC::CTI::privateCompilePutByIdTransition):
31790 * masm/X86Assembler.h:
31793 2008-09-30 Maciej Stachowiak <mjs@apple.com>
31795 Reviewed by Oliver Hunt.
31797 - track uses of "this", "with" and "catch" in the parser
31799 Knowing this up front will be useful for future optimizations.
31801 Perf and correctness remain the same.
31806 2008-09-30 Sam Weinig <sam@webkit.org>
31808 Reviewed by Mark Rowe.
31810 Add WebKitAvailability macros for JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError,
31811 and JSObjectMakeRegExp
31813 * API/JSObjectRef.h:
31815 2008-09-30 Darin Adler <darin@apple.com>
31817 Reviewed by Geoff Garen.
31819 - https://bugs.webkit.org/show_bug.cgi?id=21214
31820 work on getting rid of ExecState
31822 Replaced the m_prev field of ExecState with a bit in the
31823 call frame pointer to indicate "host" call frames.
31826 (JSC::makeHostCallFramePointer): Added. Sets low bit.
31827 (JSC::isHostCallFrame): Added. Checks low bit.
31828 (JSC::stripHostCallFrameBit): Added. Clears low bit.
31829 (JSC::Machine::unwindCallFrame): Replaced null check that was
31830 formerly used to detect host call frames with an isHostCallFrame check.
31831 (JSC::Machine::execute): Pass in a host call frame pointer rather than
31832 always passing 0 when starting execution from the host. This allows us
31833 to follow the entire call frame pointer chain when desired, or to stop
31834 at the host calls when that's desired.
31835 (JSC::Machine::privateExecute): Replaced null check that was
31836 formerly used to detect host call frames with an isHostCallFrame check.
31837 (JSC::Machine::retrieveCaller): Ditto.
31838 (JSC::Machine::retrieveLastCaller): Ditto.
31839 (JSC::Machine::callFrame): Removed the code to walk up m_prev pointers
31840 and replaced it with code that uses the caller pointer and uses the
31841 stripHostCallFrameBit function.
31843 * kjs/ExecState.cpp: Removed m_prev.
31844 * kjs/ExecState.h: Ditto.
31846 2008-09-30 Cameron Zwarich <zwarich@apple.com>
31848 Reviewed by Geoff Garen.
31850 Move all detection of 'arguments' in a lexical scope to the parser, in
31851 preparation for fixing
31853 Bug 21123: using "arguments" in a function should not force creation of an activation object
31854 <https://bugs.webkit.org/show_bug.cgi?id=21123>
31856 * VM/CodeGenerator.cpp:
31857 (JSC::CodeGenerator::CodeGenerator):
31861 2008-09-30 Geoffrey Garen <ggaren@apple.com>
31866 (runWithScripts): Fixed indentation.
31868 2008-09-30 Mark Rowe <mrowe@apple.com>
31870 Rubber-stamped by Sam Weinig.
31872 Build fix. Move InternalFunction::classInfo implementation into the .cpp
31873 file to prevent the vtable for InternalFunction being generated as a weak symbol.
31874 Has no effect on SunSpider.
31876 * kjs/InternalFunction.cpp:
31877 (JSC::InternalFunction::classInfo):
31878 * kjs/InternalFunction.h:
31880 2008-09-29 Maciej Stachowiak <mjs@apple.com>
31882 Reviewed by Darin Adler.
31884 - optimize appending a number to a string
31885 https://bugs.webkit.org/show_bug.cgi?id=21203
31887 It's pretty common in real-world code (and on some of the v8
31888 benchmarks) to append a number to a string, so I made this one of
31889 the fast cases, and also added support to UString to do it
31890 directly without allocating a temporary UString.
31892 ~1% speedup on v8 benchmark.
31895 (JSC::jsAddSlowCase): Make this NEVER_INLINE because somehow otherwise
31896 the change is a regression.
31897 (JSC::jsAdd): Handle number + string special case.
31898 (JSC::Machine::cti_op_add): Integrate much of the logic of jsAdd to
31899 avoid exception check in the str + str, num + num and str + num cases.
31901 (JSC::expandedSize): Make this a non-member function, since it needs to be
31902 called in non-member functions but not outside this file.
31903 (JSC::expandCapacity): Ditto.
31904 (JSC::UString::expandCapacity): Call the non-member version.
31905 (JSC::createRep): Helper to make a rep from a char*.
31906 (JSC::UString::UString): Use above helper.
31907 (JSC::concatenate): Guts of concatenating constructor for cases where first
31908 item is a UString::Rep, and second is a UChar* and length, or a char*.
31909 (JSC::UString::append): Implement for cases where first item is a UString::Rep,
31910 and second is an int or double. Sadly duplicates logic of UString::from(int)
31911 and UString::from(double).
31914 2008-09-29 Darin Adler <darin@apple.com>
31916 Reviewed by Sam Weinig.
31918 - https://bugs.webkit.org/show_bug.cgi?id=21214
31919 work on getting rid of ExecState
31921 * JavaScriptCore.exp: Updated since JSGlobalObject::init
31922 no longer takes a parameter.
31925 (JSC::Machine::execute): Removed m_registerFile argument
31926 for ExecState constructors.
31928 * kjs/DebuggerCallFrame.cpp:
31929 (JSC::DebuggerCallFrame::evaluate): Removed globalThisValue
31930 argument for ExecState constructor.
31932 * kjs/ExecState.cpp:
31933 (JSC::ExecState::ExecState): Removed globalThisValue and
31934 registerFile arguments to constructors.
31936 * kjs/ExecState.h: Removed m_globalThisValue and
31937 m_registerFile data members.
31939 * kjs/JSGlobalObject.cpp:
31940 (JSC::JSGlobalObject::init): Removed globalThisValue
31941 argument for ExecState constructor.
31943 * kjs/JSGlobalObject.h:
31944 (JSC::JSGlobalObject::JSGlobalObject): Got rid of parameter
31945 for the init function.
31947 2008-09-29 Geoffrey Garen <ggaren@apple.com>
31949 Rubber-stamped by Cameron Zwarich.
31951 Fixed https://bugs.webkit.org/show_bug.cgi?id=21225
31952 Machine::retrieveLastCaller should check for a NULL codeBlock
31954 In order to crash, you would need to call retrieveCaller in a situation
31955 where you had two host call frames in a row in the register file. I
31956 don't know how to make that happen, or if it's even possible, so I don't
31957 have a test case -- but better safe than sorry!
31960 (JSC::Machine::retrieveLastCaller):
31962 2008-09-29 Geoffrey Garen <ggaren@apple.com>
31964 Reviewed by Cameron Zwarich.
31966 Store the callee ScopeChain, not the caller ScopeChain, in the call frame
31967 header. Nix the "scopeChain" local variable and ExecState::m_scopeChain, and
31968 access the callee ScopeChain through the call frame header instead.
31970 Profit: call + return are simpler, because they don't have to update the
31971 "scopeChain" local variable, or ExecState::m_scopeChain.
31973 Because CTI keeps "r" in a register, reading the callee ScopeChain relative
31974 to "r" can be very fast, in any cases we care to optimize.
31976 0% speedup on empty function call benchmark. (5.5% speedup in bytecode.)
31977 0% speedup on SunSpider. (7.5% speedup on controlflow-recursive.)
31978 2% speedup on SunSpider --v8.
31979 2% speedup on v8 benchmark.
31981 * VM/CTI.cpp: Changed scope chain access to read the scope chain from
31982 the call frame header. Sped up op_ret by changing it not to fuss with
31983 the "scopeChain" local variable or ExecState::m_scopeChain.
31985 * VM/CTI.h: Updated CTI trampolines not to take a ScopeChainNode*
31986 argument, since that's stored in the call frame header now.
31988 * VM/Machine.cpp: Access "scopeChain" and "codeBlock" through new helper
31989 functions that read from the call frame header. Updated functions operating
31990 on ExecState::m_callFrame to account for / take advantage of the fact that
31991 Exec:m_callFrame is now never NULL.
31993 Fixed a bug in op_construct, where it would use the caller's default
31994 object prototype, rather than the callee's, when constructing a new object.
31996 * VM/Machine.h: Made some helper functions available. Removed
31997 ScopeChainNode* arguments to a lot of functions, since the ScopeChainNode*
31998 is now stored in the call frame header.
32000 * VM/RegisterFile.h: Renamed "CallerScopeChain" to "ScopeChain", since
32001 that's what it is now.
32003 * kjs/DebuggerCallFrame.cpp: Updated for change to ExecState signature.
32005 * kjs/ExecState.cpp:
32006 * kjs/ExecState.h: Nixed ExecState::m_callFrame, along with the unused
32007 isGlobalObject function.
32009 * kjs/JSGlobalObject.cpp:
32010 * kjs/JSGlobalObject.h: Gave the global object a fake call frame in
32011 which to store the global scope chain, since our code now assumes that
32012 it can always read the scope chain out of the ExecState's call frame.
32014 2008-09-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
32016 Reviewed by Sam Weinig.
32018 Remove the isActivationObject() virtual method on JSObject and use
32019 StructureID information instead. This should be slightly faster, but
32020 isActivationObject() is only used in assertions and unwinding the stack
32025 (JSC::Machine::unwindCallFrame):
32026 (JSC::Machine::privateExecute):
32027 (JSC::Machine::cti_op_ret_activation):
32028 * kjs/JSActivation.cpp:
32029 * kjs/JSActivation.h:
32032 2008-09-29 Peter Gal <galpeter@inf.u-szeged.hu>
32034 Reviewed and tweaked by Darin Adler.
32036 Fix build for non-all-in-one platforms.
32038 * kjs/StringPrototype.cpp: Added missing ASCIICType.h include.
32040 2008-09-29 Bradley T. Hughes <bradley.hughes@nokia.com>
32042 Reviewed by Simon Hausmann.
32044 Fix compilation with icpc
32050 2008-09-29 Thiago Macieira <thiago.macieira@nokia.com>
32052 Reviewed by Simon Hausmann.
32054 Changed copyright from Trolltech ASA to Nokia.
32056 Nokia acquired Trolltech ASA, assets were transferred on September 26th 2008.
32059 * wtf/qt/MainThreadQt.cpp:
32061 2008-09-29 Simon Hausmann <hausmann@webkit.org>
32063 Reviewed by Lars Knoll.
32065 Don't accidentially install libJavaScriptCore.a for the build inside
32068 * JavaScriptCore.pro:
32070 2008-09-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
32072 Reviewed by Maciej Stachowiak.
32074 Bug 21200: Allow direct access to 'arguments' without using op_resolve
32075 <https://bugs.webkit.org/show_bug.cgi?id=21200>
32077 Allow fast access to the 'arguments' object by adding an extra slot to
32078 the callframe to store it.
32080 This is a 3.0% speedup on the V8 Raytrace benchmark.
32082 * JavaScriptCore.exp:
32084 (JSC::CTI::privateCompileMainPass):
32085 * VM/CodeBlock.cpp:
32086 (JSC::CodeBlock::dump):
32087 * VM/CodeGenerator.cpp:
32088 (JSC::CodeGenerator::CodeGenerator):
32089 (JSC::CodeGenerator::registerFor):
32090 * VM/CodeGenerator.h:
32091 (JSC::CodeGenerator::registerFor):
32093 (JSC::Machine::initializeCallFrame):
32094 (JSC::Machine::dumpRegisters):
32095 (JSC::Machine::privateExecute):
32096 (JSC::Machine::retrieveArguments):
32097 (JSC::Machine::cti_op_call_JSFunction):
32098 (JSC::Machine::cti_op_create_arguments):
32099 (JSC::Machine::cti_op_construct_JSConstruct):
32102 * VM/RegisterFile.h:
32103 (JSC::RegisterFile::):
32104 * kjs/JSActivation.cpp:
32105 (JSC::JSActivation::mark):
32106 (JSC::JSActivation::argumentsGetter):
32107 * kjs/JSActivation.h:
32108 (JSC::JSActivation::JSActivationData::JSActivationData):
32111 (JSC::Parser::didFinishParsing):
32113 (JSC::Parser::parse):
32116 (JSC::ScopeNode::ScopeNode):
32117 (JSC::ProgramNode::ProgramNode):
32118 (JSC::ProgramNode::create):
32119 (JSC::EvalNode::EvalNode):
32120 (JSC::EvalNode::create):
32121 (JSC::FunctionBodyNode::FunctionBodyNode):
32122 (JSC::FunctionBodyNode::create):
32124 (JSC::ScopeNode::usesArguments):
32126 2008-09-28 Mark Rowe <mrowe@apple.com>
32128 Reviewed by Sam Weinig.
32130 Add an ASCII fast-path to toLowerCase and toUpperCase.
32132 The fast path speeds up the common case of an ASCII-only string by up to 60% while adding a less than 5% penalty
32133 to the less common non-ASCII case.
32135 This also removes stringProtoFuncToLocaleLowerCase and stringProtoFuncToLocaleUpperCase, which were identical
32136 to the non-locale variants of the functions. toLocaleLowerCase and toLocaleUpperCase now use the non-locale
32137 variants of the functions directly.
32139 * kjs/StringPrototype.cpp:
32140 (JSC::stringProtoFuncToLowerCase):
32141 (JSC::stringProtoFuncToUpperCase):
32143 2008-09-28 Mark Rowe <mrowe@apple.com>
32145 Reviewed by Cameron Zwarich.
32147 Speed up parseInt and parseFloat.
32149 Repeatedly indexing into a UString is slow, so retrieve a pointer into the underlying buffer once up front
32150 and use that instead. This is a 7% win on a parseInt/parseFloat micro-benchmark.
32152 * kjs/JSGlobalObjectFunctions.cpp:
32156 2008-09-28 Simon Hausmann <hausmann@webkit.org>
32158 Reviewed by David Hyatt.
32160 In Qt's initializeThreading re-use an existing thread identifier for the main
32161 thread if it exists.
32163 currentThread() implicitly creates new identifiers and it could be that
32164 it is called before initializeThreading().
32166 * wtf/ThreadingQt.cpp:
32167 (WTF::initializeThreading):
32169 2008-09-27 Keishi Hattori <casey.hattori@gmail.com>
32171 Added Machine::retrieveCaller to the export list.
32173 Reviewed by Kevin McCullough and Tim Hatcher.
32175 * JavaScriptCore.exp: Added Machine::retrieveCaller.
32177 2008-09-27 Anders Carlsson <andersca@apple.com>
32184 2008-09-27 Geoffrey Garen <ggaren@apple.com>
32186 Reviewed by Cameron Zwarich.
32188 https://bugs.webkit.org/show_bug.cgi?id=21175
32190 Store the callee CodeBlock, not the caller CodeBlock, in the call frame
32191 header. Nix the "codeBlock" local variable, and access the callee
32192 CodeBlock through the call frame header instead.
32194 Profit: call + return are simpler, because they don't have to update the
32195 "codeBlock" local variable.
32197 Because CTI keeps "r" in a register, reading the callee CodeBlock relative
32198 to "r" can be very fast, in any cases we care to optimize. Presently,
32199 no such cases seem important.
32201 Also, stop writing "dst" to the call frame header. CTI doesn't use it.
32203 21.6% speedup on empty function call benchmark.
32204 3.8% speedup on SunSpider --v8.
32205 2.1% speedup on v8 benchmark.
32206 0.7% speedup on SunSpider (6% speedup on controlflow-recursive).
32208 Small regression in bytecode, because currently every op_ret reads the
32209 callee CodeBlock to check needsFullScopeChain, and bytecode does not
32210 keep "r" in a register. On-balance, this is probably OK, since CTI is
32211 our high-performance execution model. Also, this should go away once
32212 we make needsFullScopeChain statically determinable at parse time.
32215 (JSC::CTI::compileOpCall): The speedup!
32216 (JSC::CTI::privateCompileSlowCases): ditto
32219 (JSC::): Fixed up magic trampoline constants to account for the nixed
32220 "codeBlock" argument.
32221 (JSC::CTI::execute): Changed trampoline function not to take a "codeBlock"
32222 argument, since codeBlock is now stored in the call frame header.
32224 * VM/Machine.cpp: Read the callee CodeBlock from the register file. Use
32225 a NULL CallerRegisters in the call frame header to signal a built-in
32226 caller, since CodeBlock is now never NULL.
32228 * VM/Machine.h: Made some stand-alone functions Machine member functions
32229 so they could call the private codeBlock() accessor in the Register
32230 class, of which Machine is a friend. Renamed "CallerCodeBlock" to
32231 "CodeBlock", since it's no longer the caller's CodeBlock.
32233 * VM/RegisterFile.h: Marked some methods const to accommodate a
32234 const RegisterFile* being passed around in Machine.cpp.
32236 2008-09-26 Jan Michael Alonzo <jmalonzo@webkit.org>
32238 Gtk build fix. Not reviewed.
32240 Narrow-down the target of the JavaScriptCore .lut.h generator so
32241 it won't try to create the WebCore .lut.hs.
32245 2008-09-26 Matt Lilek <webkit@mattlilek.com>
32247 Reviewed by Tim Hatcher.
32249 Update FEATURE_DEFINES after ENABLE_CROSS_DOCUMENT_MESSAGING was removed.
32251 * Configurations/JavaScriptCore.xcconfig:
32253 2008-09-26 Cameron Zwarich <cwzwarich@uwaterloo.ca>
32255 Rubber-stamped by Anders Carlson.
32257 Change the name 'sc' to 'scopeChainNode' in a few places.
32260 (JSC::EvalNode::generateCode):
32261 (JSC::FunctionBodyNode::generateCode):
32262 (JSC::ProgramNode::generateCode):
32264 2008-09-26 Sam Weinig <sam@webkit.org>
32266 Reviewed by Darin Adler.
32268 Patch for https://bugs.webkit.org/show_bug.cgi?id=21152
32269 Speedup static property get/put
32271 Convert getting/setting static property values to use static functions
32272 instead of storing an integer and switching in getValueProperty/putValueProperty.
32274 * kjs/JSObject.cpp:
32275 (JSC::JSObject::deleteProperty):
32276 (JSC::JSObject::getPropertyAttributes):
32277 * kjs/MathObject.cpp:
32278 (JSC::MathObject::getOwnPropertySlot):
32279 * kjs/NumberConstructor.cpp:
32280 (JSC::numberConstructorNaNValue):
32281 (JSC::numberConstructorNegInfinity):
32282 (JSC::numberConstructorPosInfinity):
32283 (JSC::numberConstructorMaxValue):
32284 (JSC::numberConstructorMinValue):
32285 * kjs/PropertySlot.h:
32286 (JSC::PropertySlot::):
32287 * kjs/RegExpConstructor.cpp:
32288 (JSC::regExpConstructorDollar1):
32289 (JSC::regExpConstructorDollar2):
32290 (JSC::regExpConstructorDollar3):
32291 (JSC::regExpConstructorDollar4):
32292 (JSC::regExpConstructorDollar5):
32293 (JSC::regExpConstructorDollar6):
32294 (JSC::regExpConstructorDollar7):
32295 (JSC::regExpConstructorDollar8):
32296 (JSC::regExpConstructorDollar9):
32297 (JSC::regExpConstructorInput):
32298 (JSC::regExpConstructorMultiline):
32299 (JSC::regExpConstructorLastMatch):
32300 (JSC::regExpConstructorLastParen):
32301 (JSC::regExpConstructorLeftContext):
32302 (JSC::regExpConstructorRightContext):
32303 (JSC::setRegExpConstructorInput):
32304 (JSC::setRegExpConstructorMultiline):
32305 (JSC::RegExpConstructor::setInput):
32306 (JSC::RegExpConstructor::setMultiline):
32307 (JSC::RegExpConstructor::multiline):
32308 * kjs/RegExpConstructor.h:
32309 * kjs/RegExpObject.cpp:
32310 (JSC::regExpObjectGlobal):
32311 (JSC::regExpObjectIgnoreCase):
32312 (JSC::regExpObjectMultiline):
32313 (JSC::regExpObjectSource):
32314 (JSC::regExpObjectLastIndex):
32315 (JSC::setRegExpObjectLastIndex):
32316 * kjs/RegExpObject.h:
32317 (JSC::RegExpObject::setLastIndex):
32318 (JSC::RegExpObject::lastIndex):
32319 (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
32320 * kjs/StructureID.cpp:
32321 (JSC::StructureID::getEnumerablePropertyNames):
32322 * kjs/create_hash_table:
32326 (JSC::HashTable::createTable):
32327 (JSC::HashTable::deleteTable):
32328 (JSC::setUpStaticFunctionSlot):
32330 (JSC::HashEntry::initialize):
32331 (JSC::HashEntry::setKey):
32332 (JSC::HashEntry::key):
32333 (JSC::HashEntry::attributes):
32334 (JSC::HashEntry::function):
32335 (JSC::HashEntry::functionLength):
32336 (JSC::HashEntry::propertyGetter):
32337 (JSC::HashEntry::propertyPutter):
32338 (JSC::HashEntry::lexerValue):
32339 (JSC::HashEntry::):
32340 (JSC::HashTable::entry):
32341 (JSC::getStaticPropertySlot):
32342 (JSC::getStaticValueSlot):
32345 2008-09-26 Gavin Barraclough <barraclough@apple.com>
32347 Reviewed by Maciej Stachowiak & Oliver Hunt.
32349 Add support for reusing temporary JSNumberCells. This change is based on the observation
32350 that if the result of certain operations is a JSNumberCell and is consumed by a subsequent
32351 operation that would produce a JSNumberCell, we can reuse the object rather than allocating
32352 a fresh one. E.g. given the expression ((a * b) * c), we can statically determine that
32353 (a * b) will have a numeric result (or else it will have thrown an exception), so the result
32354 will either be a JSNumberCell or a JSImmediate.
32356 This patch changes three areas of JSC:
32357 * The AST now tracks type information about the result of each node.
32358 * This information is consumed in bytecode compilation, and certain bytecode operations
32359 now carry the statically determined type information about their operands.
32360 * CTI uses the information in a number of fashions:
32361 * Where an operand to certain arithmetic operations is reusable, it will plant code
32362 to try to perform the operation in JIT code & reuse the cell, where appropriate.
32363 * Where it can be statically determined that an operand can only be numeric (typically
32364 the result of another arithmetic operation) the code will not redundantly check that
32365 the JSCell is a JSNumberCell.
32366 * Where either of the operands to an add are non-numeric do not plant an optimized
32367 arithmetic code path, just call straight out to the C function.
32369 +6% Sunspider (10% progression on 3D, 16% progression on math, 60% progression on access-nbody),
32370 +1% v8-tests (improvements in raytrace & crypto)
32372 * VM/CTI.cpp: Add optimized code generation with reuse of temporary JSNumberCells.
32374 * kjs/JSNumberCell.h:
32375 * masm/X86Assembler.h:
32377 * VM/CodeBlock.cpp: Add type information to specific bytecodes.
32378 * VM/CodeGenerator.cpp:
32379 * VM/CodeGenerator.h:
32382 * kjs/nodes.cpp: Track static type information for nodes.
32384 * kjs/ResultDescriptor.h: (Added)
32385 * JavaScriptCore.xcodeproj/project.pbxproj:
32387 2008-09-26 Yichao Yin <yichao.yin@torchmobile.com.cn>
32389 Reviewed by George Staikos, Maciej Stachowiak.
32391 Add utility functions needed for upcoming WML code.
32393 * wtf/ASCIICType.h:
32394 (WTF::isASCIIPrintable):
32396 2008-09-26 Geoffrey Garen <ggaren@apple.com>
32398 Reviewed by Darin Adler.
32400 Reverted the part of r36614 that used static data because static data
32401 is not thread-safe.
32403 2008-09-26 Geoffrey Garen <ggaren@apple.com>
32405 Reviewed by Maciej Stachowiak.
32407 Removed dynamic check for whether the callee needs an activation object.
32408 Replaced with callee code to create the activation object.
32410 0.5% speedup on SunSpider.
32411 No change on v8 benchmark. (Might be a speedup, but it's in range of the
32414 0.7% speedup on v8 benchmark in bytecode.
32415 1.3% speedup on empty call benchmark in bytecode.
32418 (JSC::CTI::privateCompileMainPass): Added support for op_init_activation,
32419 the new opcode that specifies that the callee's initialization should
32420 create an activation object.
32421 (JSC::CTI::privateCompile): Removed previous code that did a similar
32422 thing in an ad-hoc way.
32424 * VM/CodeBlock.cpp:
32425 (JSC::CodeBlock::dump): Added a case for dumping op_init_activation.
32427 * VM/CodeGenerator.cpp:
32428 (JSC::CodeGenerator::generate): Added fixup code to change op_init to
32429 op_init_activation if necessary. (With a better parser, we would know
32430 which to use from the beginning.)
32432 * VM/Instruction.h:
32433 (JSC::Instruction::Instruction):
32434 (WTF::): Faster traits for the instruction vector. An earlier version
32435 of this patch relied on inserting at the beginning of the vector, and
32436 depended on this change for speed.
32439 (JSC::Machine::execute): Removed clients of setScopeChain, the old
32440 abstraction for dynamically checking for whether an activation object
32441 needed to be created.
32442 (JSC::Machine::privateExecute): ditto
32444 (JSC::Machine::cti_op_push_activation): Renamed this function from
32445 cti_vm_updateScopeChain, and made it faster by removing the call to
32449 * VM/Opcode.h: Declared op_init_activation.
32451 2008-09-24 Geoffrey Garen <ggaren@apple.com>
32453 Reviewed by Maciej Stachowiak.
32455 Move most of the return code back into the callee, now that the callee
32456 doesn't have to calculate anything dynamically.
32458 11.5% speedup on empty function call benchmark.
32460 SunSpider says 0.3% faster. SunSpider --v8 says no change.
32463 (JSC::CTI::compileOpCall):
32464 (JSC::CTI::privateCompileMainPass):
32465 (JSC::CTI::privateCompileSlowCases):
32467 2008-09-24 Sam Weinig <sam@webkit.org>
32469 Reviewed by Maciej Stachowiak.
32471 Remove staticFunctionGetter. There is only one remaining user of
32472 staticFunctionGetter and it can be converted to use setUpStaticFunctionSlot.
32474 * JavaScriptCore.exp:
32478 2008-09-24 Maciej Stachowiak <mjs@apple.com>
32480 Reviewed by Oliver Hunt.
32482 - inline JIT fast case of op_neq
32483 - remove extra level of function call indirection from slow cases of eq and neq
32485 1% speedup on Richards
32488 (JSC::CTI::privateCompileMainPass):
32489 (JSC::CTI::privateCompileSlowCases):
32491 (JSC::Machine::privateExecute):
32492 (JSC::Machine::cti_op_eq):
32493 (JSC::Machine::cti_op_neq):
32494 * kjs/operations.cpp:
32496 (JSC::equalSlowCase):
32497 * kjs/operations.h:
32498 (JSC::equalSlowCaseInline):
32500 2008-09-24 Sam Weinig <sam@webkit.org>
32502 Reviewed by Darin Adler.
32504 Fix for https://bugs.webkit.org/show_bug.cgi?id=21080
32505 <rdar://problem/6243534>
32506 Crash below Function.apply when using a runtime array as the argument list
32508 Test: plugins/bindings-array-apply-crash.html
32510 * kjs/FunctionPrototype.cpp:
32511 (JSC::functionProtoFuncApply): Revert to the slow case if the object inherits from
32512 JSArray (via ClassInfo) but is not a JSArray.
32514 2008-09-24 Kevin McCullough <kmccullough@apple.com>
32519 (JSC::statementListEmitCode):
32521 2008-09-24 Kevin McCullough <kmccullough@apple.com>
32525 Bug 21031: Breakpoints in the condition of loops only breaks the first
32527 - Now when setting breakpoints in the condition of a loop (for, while,
32528 for in, and do while) will successfully break each time throught the
32530 - For 'for' loops we need a little more complicated behavior that cannot
32531 be accomplished without some more significant changes:
32532 https://bugs.webkit.org/show_bug.cgi?id=21073
32535 (JSC::statementListEmitCode): We don't want to blindly emit a debug hook
32536 at the first line of loops, instead let the loop emit the debug hooks.
32537 (JSC::DoWhileNode::emitCode):
32538 (JSC::WhileNode::emitCode):
32539 (JSC::ForNode::emitCode):
32540 (JSC::ForInNode::emitCode):
32542 (JSC::StatementNode::):
32543 (JSC::DoWhileNode::):
32544 (JSC::WhileNode::):
32545 (JSC::ForInNode::):
32547 2008-09-24 Geoffrey Garen <ggaren@apple.com>
32549 Reviewed by Darin Adler.
32551 Fixed <rdar://problem/5605532> Need a SPI for telling JS the size of
32552 the objects it retains
32554 * API/tests/testapi.c: Test the new SPI a little.
32556 * API/JSSPI.cpp: Add the new SPI.
32557 * API/JSSPI.h: Add the new SPI.
32558 * JavaScriptCore.exp: Add the new SPI.
32559 * JavaScriptCore.xcodeproj/project.pbxproj: Add the new SPI.
32561 2008-09-24 Geoffrey Garen <ggaren@apple.com>
32563 Reviewed by Darin Adler.
32565 * API/JSBase.h: Filled in some missing function names.
32567 2008-09-24 Geoffrey Garen <ggaren@apple.com>
32569 Reviewed by Cameron Zwarich.
32571 Fixed https://bugs.webkit.org/show_bug.cgi?id=21057
32572 Crash in RegisterID::deref() running fast/canvas/canvas-putImageData.html
32574 * VM/CodeGenerator.h: Changed declaration order to ensure the
32575 m_lastConstant, which is a RefPtr that points into m_calleeRegisters,
32576 has its destructor called before the destructor for m_calleeRegisters.
32578 2008-09-24 Darin Adler <darin@apple.com>
32580 Reviewed by Sam Weinig.
32582 - https://bugs.webkit.org/show_bug.cgi?id=21047
32583 speed up ret_activation with inlining
32585 About 1% on v8-raytrace.
32587 * JavaScriptCore.exp: Removed JSVariableObject::setRegisters.
32589 * kjs/JSActivation.cpp: Moved copyRegisters to the header to make it inline.
32590 * kjs/JSActivation.h:
32591 (JSC::JSActivation::copyRegisters): Moved here. Also removed the registerArraySize
32592 argument to setRegisters, since the object doesn't need to store the number of
32595 * kjs/JSGlobalObject.cpp:
32596 (JSC::JSGlobalObject::reset): Removed unnecessary clearing left over from when we
32597 used this on objects that weren't brand new. These days, this function is really
32598 just part of the constructor.
32600 * kjs/JSGlobalObject.h: Added registerArraySize to JSGlobalObjectData, since
32601 JSVariableObjectData no longer needs it. Added a setRegisters override here
32602 that handles storing the size.
32604 * kjs/JSStaticScopeObject.h: Removed code to set registerArraySize, since it
32607 * kjs/JSVariableObject.cpp: Moved copyRegisterArray and setRegisters to the
32608 header to make them inline.
32609 * kjs/JSVariableObject.h: Removed registerArraySize from JSVariableObjectData,
32610 since it was only used for the global object.
32611 (JSC::JSVariableObject::copyRegisterArray): Moved here ot make it inline.
32612 (JSC::JSVariableObject::setRegisters): Moved here to make it inline. Also
32613 removed the code to set registerArraySize and changed an if statement into
32614 an assert to save an unnnecessary branch.
32616 2008-09-24 Maciej Stachowiak <mjs@apple.com>
32618 Reviewed by Oliver Hunt.
32620 - inline PropertyMap::getOffset to speed up polymorphic lookups
32622 ~1.5% speedup on v8 benchmark
32623 no effect on SunSpider
32625 * JavaScriptCore.exp:
32626 * kjs/PropertyMap.cpp:
32627 * kjs/PropertyMap.h:
32628 (JSC::PropertyMap::getOffset):
32630 2008-09-24 Jan Michael Alonzo <jmalonzo@webkit.org>
32632 Reviewed by Alp Toker.
32634 https://bugs.webkit.org/show_bug.cgi?id=20992
32635 Build fails on GTK+ Mac OS
32637 * wtf/ThreadingGtk.cpp: Remove platform ifdef as suggested by
32639 (WTF::initializeThreading):
32641 2008-09-23 Oliver Hunt <oliver@apple.com>
32643 Reviewed by Maciej Stachowiak.
32645 Bug 19968: Slow Script at www.huffingtonpost.com
32646 <https://bugs.webkit.org/show_bug.cgi?id=19968>
32648 Finally found the cause of this accursed issue. It is triggered
32649 by synchronous creation of a new global object from JS. The new
32650 global object resets the timer state in this execution group's
32651 Machine, taking timerCheckCount to 0. Then when JS returns the
32652 timerCheckCount is decremented making it non-zero. The next time
32653 we execute JS we will start the timeout counter, however the non-zero
32654 timeoutCheckCount means we don't reset the timer information. This
32655 means that the timeout check is now checking the cumulative time
32656 since the creation of the global object rather than the time since
32657 JS was last entered. At this point the slow script dialog is guaranteed
32658 to eventually be displayed incorrectly unless a page is loaded
32659 asynchronously (which will reset everything into a sane state).
32661 The fix for this is rather trivial -- the JSGlobalObject constructor
32662 should not be resetting the machine timer state.
32665 (JSC::Machine::Machine):
32666 Now that we can't rely on the GlobalObject initialising the timeout
32667 state, we do it in the Machine constructor.
32670 (JSC::Machine::stopTimeoutCheck):
32671 Add assertions to guard against this happening.
32673 * kjs/JSGlobalObject.cpp:
32674 (JSC::JSGlobalObject::init):
32675 Don't reset the timeout state.
32677 2008-09-23 Geoffrey Garen <ggaren@apple.com>
32679 Reviewed by Oliver Hunt.
32681 Fixed https://bugs.webkit.org/show_bug.cgi?id=21038 | <rdar://problem/6240812>
32682 Uncaught exceptions in regex replace callbacks crash webkit
32684 This was a combination of two problems:
32686 (1) the replace function would continue execution after an exception
32689 (2) In some cases, the Machine would return 0 in the case of an exception,
32690 despite the fact that a few clients dereference the Machine's return
32691 value without first checking for an exception.
32694 (JSC::Machine::execute):
32696 ^ Return jsNull() instead of 0 in the case of an exception, since some
32697 clients depend on using our return value.
32699 ^ ASSERT that execution does not continue after an exception has been
32700 thrown, to help catch problems like this in the future.
32702 * kjs/StringPrototype.cpp:
32703 (JSC::stringProtoFuncReplace):
32705 ^ Stop execution if an exception has been thrown.
32707 2008-09-23 Geoffrey Garen <ggaren@apple.com>
32709 Try to fix the windows build.
32712 (JSC::CTI::compileOpCall):
32713 (JSC::CTI::privateCompileMainPass):
32715 2008-09-23 Alp Toker <alp@nuanti.com>
32721 2008-09-23 Geoffrey Garen <ggaren@apple.com>
32723 Reviewed by Darin Adler.
32725 * wtf/Platform.h: Removed duplicate #if.
32727 2008-09-23 Geoffrey Garen <ggaren@apple.com>
32729 Reviewed by Darin Adler.
32731 Changed the layout of the call frame from
32733 { header, parameters, locals | constants, temporaries }
32737 { parameters, header | locals, constants, temporaries }
32739 This simplifies function entry+exit, and enables a number of future
32742 13.5% speedup on empty call benchmark for bytecode; 23.6% speedup on
32743 empty call benchmark for CTI.
32745 SunSpider says no change. SunSpider --v8 says 1% faster.
32749 Added a bit of abstraction for calculating whether a register is a
32750 constant, since this patch changes that calculation:
32751 (JSC::CTI::isConstant):
32752 (JSC::CTI::getConstant):
32753 (JSC::CTI::emitGetArg):
32754 (JSC::CTI::emitGetPutArg):
32755 (JSC::CTI::getConstantImmediateNumericArg):
32757 Updated for changes to callframe header location:
32758 (JSC::CTI::emitPutToCallFrameHeader):
32759 (JSC::CTI::emitGetFromCallFrameHeader):
32760 (JSC::CTI::printOpcodeOperandTypes):
32762 Renamed to spite Oliver:
32763 (JSC::CTI::emitInitRegister):
32765 Added an abstraction for emitting a call through a register, so that
32766 calls through registers generate exception info, too:
32767 (JSC::CTI::emitCall):
32769 Updated to match the new callframe header layout, and to support calls
32770 through registers, which have no destination address:
32771 (JSC::CTI::compileOpCall):
32772 (JSC::CTI::privateCompileMainPass):
32773 (JSC::CTI::privateCompileSlowCases):
32774 (JSC::CTI::privateCompile):
32779 (JSC::CallRecord::CallRecord):
32781 * VM/CodeBlock.cpp:
32783 Updated for new register layout:
32784 (JSC::registerName):
32785 (JSC::CodeBlock::dump):
32789 Updated CodeBlock to track slightly different information about the
32790 register frame, and tweaked the style of an ASSERT_NOT_REACHED.
32791 (JSC::CodeBlock::CodeBlock):
32792 (JSC::CodeBlock::getStubInfo):
32794 * VM/CodeGenerator.cpp:
32796 Added some abstraction around constant register allocation, since this
32797 patch changes it, changed codegen to account for the new callframe
32798 layout, and added abstraction around register fetching code
32799 that used to assume that all local registers lived at negative indices,
32800 since vars now live at positive indices:
32801 (JSC::CodeGenerator::generate):
32802 (JSC::CodeGenerator::addVar):
32803 (JSC::CodeGenerator::addGlobalVar):
32804 (JSC::CodeGenerator::allocateConstants):
32805 (JSC::CodeGenerator::CodeGenerator):
32806 (JSC::CodeGenerator::addParameter):
32807 (JSC::CodeGenerator::registerFor):
32808 (JSC::CodeGenerator::constRegisterFor):
32809 (JSC::CodeGenerator::newRegister):
32810 (JSC::CodeGenerator::newTemporary):
32811 (JSC::CodeGenerator::highestUsedRegister):
32812 (JSC::CodeGenerator::addConstant):
32814 ASSERT that our caller referenced the registers it passed to us.
32815 Otherwise, we might overwrite them with parameters:
32816 (JSC::CodeGenerator::emitCall):
32817 (JSC::CodeGenerator::emitConstruct):
32819 * VM/CodeGenerator.h:
32821 Added some abstraction for getting a RegisterID for a given index,
32822 since the rules are a little weird:
32823 (JSC::CodeGenerator::registerFor):
32827 Utility function to transform a machine return PC to a virtual machine
32828 return VPC, for the sake of stack unwinding, since both PCs are stored
32829 in the same location now:
32832 Tweaked to account for new call frame:
32833 (JSC::Machine::initializeCallFrame):
32835 Tweaked to account for registerOffset supplied by caller:
32836 (JSC::slideRegisterWindowForCall):
32838 Tweaked to account for new register layout:
32839 (JSC::scopeChainForCall):
32840 (JSC::Machine::callEval):
32841 (JSC::Machine::dumpRegisters):
32842 (JSC::Machine::unwindCallFrame):
32843 (JSC::Machine::execute):
32845 Changed op_call and op_construct to implement the new calling convention:
32846 (JSC::Machine::privateExecute):
32848 Tweaked to account for the new register layout:
32849 (JSC::Machine::retrieveArguments):
32850 (JSC::Machine::retrieveCaller):
32851 (JSC::Machine::retrieveLastCaller):
32852 (JSC::Machine::callFrame):
32853 (JSC::Machine::getArgumentsData):
32855 Changed CTI call helpers to implement the new calling convention:
32856 (JSC::Machine::cti_op_call_JSFunction):
32857 (JSC::Machine::cti_op_call_NotJSFunction):
32858 (JSC::Machine::cti_op_ret_activation):
32859 (JSC::Machine::cti_op_ret_profiler):
32860 (JSC::Machine::cti_op_construct_JSConstruct):
32861 (JSC::Machine::cti_op_construct_NotJSConstruct):
32862 (JSC::Machine::cti_op_call_eval):
32868 Renamed op_initialise_locals to op_init, because this opcode
32869 doesn't initialize all locals, and it doesn't initialize only locals.
32870 Also, to spite Oliver.
32872 * VM/RegisterFile.h:
32874 New call frame enumeration values:
32875 (JSC::RegisterFile::):
32877 Simplified the calculation of whether a RegisterID is a temporary,
32878 since we can no longer assume that all positive non-constant registers
32881 (JSC::RegisterID::RegisterID):
32882 (JSC::RegisterID::setTemporary):
32883 (JSC::RegisterID::isTemporary):
32885 Renamed firstArgumentIndex to firstParameterIndex because the assumption
32886 that this variable pertained to the actual arguments supplied by the
32887 caller caused me to write some buggy code:
32888 * kjs/Arguments.cpp:
32889 (JSC::ArgumentsData::ArgumentsData):
32890 (JSC::Arguments::Arguments):
32891 (JSC::Arguments::fillArgList):
32892 (JSC::Arguments::getOwnPropertySlot):
32893 (JSC::Arguments::put):
32895 Updated for new call frame layout:
32896 * kjs/DebuggerCallFrame.cpp:
32897 (JSC::DebuggerCallFrame::functionName):
32898 (JSC::DebuggerCallFrame::type):
32899 * kjs/DebuggerCallFrame.h:
32901 Changed the activation object to account for the fact that a call frame
32902 header now sits between parameters and local variables. This change
32903 requires all variable objects to do their own marking, since they
32904 now use their register storage differently:
32905 * kjs/JSActivation.cpp:
32906 (JSC::JSActivation::mark):
32907 (JSC::JSActivation::copyRegisters):
32908 (JSC::JSActivation::createArgumentsObject):
32909 * kjs/JSActivation.h:
32911 Updated global object to use the new interfaces required by the change
32912 to JSActivation above:
32913 * kjs/JSGlobalObject.cpp:
32914 (JSC::JSGlobalObject::reset):
32915 (JSC::JSGlobalObject::mark):
32916 (JSC::JSGlobalObject::copyGlobalsFrom):
32917 (JSC::JSGlobalObject::copyGlobalsTo):
32918 * kjs/JSGlobalObject.h:
32919 (JSC::JSGlobalObject::addStaticGlobals):
32921 Updated static scope object to use the new interfaces required by the
32922 change to JSActivation above:
32923 * kjs/JSStaticScopeObject.cpp:
32924 (JSC::JSStaticScopeObject::mark):
32925 (JSC::JSStaticScopeObject::~JSStaticScopeObject):
32926 * kjs/JSStaticScopeObject.h:
32927 (JSC::JSStaticScopeObject::JSStaticScopeObject):
32928 (JSC::JSStaticScopeObject::d):
32930 Updated variable object to use the new interfaces required by the
32931 change to JSActivation above:
32932 * kjs/JSVariableObject.cpp:
32933 (JSC::JSVariableObject::copyRegisterArray):
32934 (JSC::JSVariableObject::setRegisters):
32935 * kjs/JSVariableObject.h:
32937 Changed the bit twiddling in symbol table not to assume that all indices
32938 are negative, since they can be positive now:
32939 * kjs/SymbolTable.h:
32940 (JSC::SymbolTableEntry::SymbolTableEntry):
32941 (JSC::SymbolTableEntry::isNull):
32942 (JSC::SymbolTableEntry::getIndex):
32943 (JSC::SymbolTableEntry::getAttributes):
32944 (JSC::SymbolTableEntry::setAttributes):
32945 (JSC::SymbolTableEntry::isReadOnly):
32946 (JSC::SymbolTableEntry::pack):
32947 (JSC::SymbolTableEntry::isValidIndex):
32949 Changed call and construct nodes to ref their functions and/or bases,
32950 so that emitCall/emitConstruct doesn't overwrite them with parameters.
32951 Also, updated for rename to registerFor:
32953 (JSC::ResolveNode::emitCode):
32954 (JSC::NewExprNode::emitCode):
32955 (JSC::EvalFunctionCallNode::emitCode):
32956 (JSC::FunctionCallValueNode::emitCode):
32957 (JSC::FunctionCallResolveNode::emitCode):
32958 (JSC::FunctionCallBracketNode::emitCode):
32959 (JSC::FunctionCallDotNode::emitCode):
32960 (JSC::PostfixResolveNode::emitCode):
32961 (JSC::DeleteResolveNode::emitCode):
32962 (JSC::TypeOfResolveNode::emitCode):
32963 (JSC::PrefixResolveNode::emitCode):
32964 (JSC::ReadModifyResolveNode::emitCode):
32965 (JSC::AssignResolveNode::emitCode):
32966 (JSC::ConstDeclNode::emitCodeSingle):
32967 (JSC::ForInNode::emitCode):
32969 Added abstraction for getting exception info out of a call through a
32971 * masm/X86Assembler.h:
32972 (JSC::X86Assembler::emitCall):
32974 Removed duplicate #if:
32977 2008-09-23 Kevin McCullough <kmccullough@apple.com>
32981 Bug 21030: The JS debugger breaks on the do of a do-while not the while
32982 (where the conditional statement is)
32983 https://bugs.webkit.org/show_bug.cgi?id=21030
32984 Now the statementListEmitCode detects if a do-while node is being
32985 emited and emits the debug hook on the last line instead of the first.
32987 This change had no effect on sunspider.
32990 (JSC::statementListEmitCode):
32992 (JSC::StatementNode::isDoWhile):
32993 (JSC::DoWhileNode::isDoWhile):
32995 2008-09-23 Maciej Stachowiak <mjs@apple.com>
32997 Reviewed by Cameron Zwarich.
32999 - inline the fast case of instanceof
33000 https://bugs.webkit.org/show_bug.cgi?id=20818
33002 ~2% speedup on EarleyBoyer test.
33005 (JSC::CTI::privateCompileMainPass):
33006 (JSC::CTI::privateCompileSlowCases):
33008 (JSC::Machine::cti_op_instanceof):
33010 2008-09-23 Maciej Stachowiak <mjs@apple.com>
33012 Reviewed by Cameron Zwarich.
33014 - add forgotten slow case logic for !==
33017 (JSC::CTI::privateCompileSlowCases):
33019 2008-09-23 Maciej Stachowiak <mjs@apple.com>
33021 Reviewed by Cameron Zwarich.
33023 - inline the fast cases of !==, same as for ===
33025 2.9% speedup on EarleyBoyer benchmark
33028 (JSC::CTI::compileOpStrictEq): Factored stricteq codegen into this function,
33029 and parameterized so it can do the reverse version as well.
33030 (JSC::CTI::privateCompileMainPass): Use the above for stricteq and nstricteq.
33032 (JSC::CTI::): Declare above stuff.
33034 (JSC::Machine::cti_op_nstricteq): Removed fast cases, now handled inline.
33036 2008-09-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
33038 Reviewed by Oliver Hunt.
33040 Bug 20989: Aguments constructor should put 'callee' and 'length' properties in a more efficient way
33041 <https://bugs.webkit.org/show_bug.cgi?id=20989>
33043 Make special cases for the 'callee' and 'length' properties in the
33046 This is somewhere between a 7.8% speedup and a 10% speedup on the V8
33047 Raytrace benchmark, depending on whether it is run alone or with the
33048 other V8 benchmarks.
33050 * kjs/Arguments.cpp:
33051 (JSC::ArgumentsData::ArgumentsData):
33052 (JSC::Arguments::Arguments):
33053 (JSC::Arguments::mark):
33054 (JSC::Arguments::getOwnPropertySlot):
33055 (JSC::Arguments::put):
33056 (JSC::Arguments::deleteProperty):
33058 2008-09-23 Maciej Stachowiak <mjs@apple.com>
33062 - speed up instanceof some more
33063 https://bugs.webkit.org/show_bug.cgi?id=20818
33065 ~2% speedup on EarleyBoyer
33067 The idea here is to record in the StructureID whether the class
33068 needs a special hasInstance or if it can use the normal logic from
33071 Based on this I inlined the real work directly into
33072 cti_op_instanceof and put the fastest checks up front and the
33073 error handling at the end (so it should be fairly straightforward
33074 to split off the beginning to be inlined if desired).
33076 I only did this for CTI, not the bytecode interpreter.
33078 * API/JSCallbackObject.h:
33079 (JSC::JSCallbackObject::createStructureID):
33082 (JSC::Machine::cti_op_instanceof):
33083 * kjs/JSImmediate.h:
33084 (JSC::JSImmediate::isAnyImmediate):
33086 (JSC::TypeInfo::overridesHasInstance):
33087 (JSC::TypeInfo::flags):
33089 2008-09-22 Darin Adler <darin@apple.com>
33091 Reviewed by Sam Weinig.
33093 - https://bugs.webkit.org/show_bug.cgi?id=21019
33094 make FunctionBodyNode::ref/deref fast
33096 Speeds up v8-raytrace by 7.2%.
33099 (JSC::FunctionBodyNode::FunctionBodyNode): Initialize m_refCount to 0.
33101 (JSC::FunctionBodyNode::ref): Call base class ref once, and thereafter use
33103 (JSC::FunctionBodyNode::deref): Ditto, but the deref side.
33105 2008-09-22 Darin Adler <darin@apple.com>
33107 Pointed out by Sam Weinig.
33109 * kjs/Arguments.cpp:
33110 (JSC::Arguments::fillArgList): Fix bad copy and paste. Oops!
33112 2008-09-22 Darin Adler <darin@apple.com>
33114 Reviewed by Cameron Zwarich.
33116 - https://bugs.webkit.org/show_bug.cgi?id=20983
33117 ArgumentsData should have some room to allocate some extra arguments inline
33119 Speeds up v8-raytrace by 5%.
33121 * kjs/Arguments.cpp:
33122 (JSC::ArgumentsData::ArgumentsData): Use a fixed buffer if there are 4 or fewer
33124 (JSC::Arguments::Arguments): Use a fixed buffer if there are 4 or fewer
33126 (JSC::Arguments::~Arguments): Delete the buffer if necessary.
33127 (JSC::Arguments::mark): Update since extraArguments are now Register.
33128 (JSC::Arguments::fillArgList): Added special case for the only case that's
33129 actually used in the practice, when there are no parameters. There are some
33130 other special cases in there too, but that's the only one that matters.
33131 (JSC::Arguments::getOwnPropertySlot): Updated to use setValueSlot since there's
33132 no operation to get you at the JSValue* inside a Register as a "slot".
33134 2008-09-22 Sam Weinig <sam@webkit.org>
33136 Reviewed by Maciej Stachowiak.
33138 Patch for https://bugs.webkit.org/show_bug.cgi?id=21014
33139 Speed up for..in by using StructureID to avoid calls to hasProperty
33141 Speeds up fasta by 8%.
33143 * VM/JSPropertyNameIterator.cpp:
33144 (JSC::JSPropertyNameIterator::invalidate):
33145 * VM/JSPropertyNameIterator.h:
33146 (JSC::JSPropertyNameIterator::next):
33147 * kjs/PropertyNameArray.h:
33148 (JSC::PropertyNameArrayData::begin):
33149 (JSC::PropertyNameArrayData::end):
33150 (JSC::PropertyNameArrayData::setCachedStructureID):
33151 (JSC::PropertyNameArrayData::cachedStructureID):
33152 * kjs/StructureID.cpp:
33153 (JSC::StructureID::getEnumerablePropertyNames):
33154 (JSC::structureIDChainsAreEqual):
33155 * kjs/StructureID.h:
33157 2008-09-22 Kelvin Sherlock <ksherlock@gmail.com>
33159 Updated and tweaked by Sam Weinig.
33161 Reviewed by Geoffrey Garen.
33163 Bug 20020: Proposed enhancement to JavaScriptCore API
33164 <https://bugs.webkit.org/show_bug.cgi?id=20020>
33166 Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp
33167 functions to create JavaScript Array, Date, Error, and RegExp objects, respectively.
33169 * API/JSObjectRef.cpp: The functions
33170 * API/JSObjectRef.h: Function prototype and documentation
33171 * JavaScriptCore.exp: Added functions to exported function list
33172 * API/tests/testapi.c: Added basic functionality tests.
33174 * kjs/DateConstructor.cpp:
33175 Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
33176 with JSObject* constructDate(ExecState* exec, const ArgList& args).
33177 Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function
33179 * kjs/DateConstructor.h:
33180 added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args)
33182 * kjs/ErrorConstructor.cpp:
33183 removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args)
33185 * kjs/ErrorConstructor.h:
33186 added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args)
33188 * kjs/RegExpConstructor.cpp:
33189 removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args)
33191 * kjs/RegExpConstructor.h:
33192 added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args)
33194 2008-09-22 Matt Lilek <webkit@mattlilek.com>
33196 Not reviewed, Windows build fix.
33198 * kjs/Arguments.cpp:
33199 * kjs/FunctionPrototype.cpp:
33201 2008-09-22 Sam Weinig <sam@webkit.org>
33203 Reviewed by Darin Adler.
33205 Patch for https://bugs.webkit.org/show_bug.cgi?id=20982
33206 Speed up the apply method of functions by special-casing array and 'arguments' objects
33208 1% speedup on v8-raytrace.
33210 Test: fast/js/function-apply.html
33212 * kjs/Arguments.cpp:
33213 (JSC::Arguments::fillArgList):
33215 * kjs/FunctionPrototype.cpp:
33216 (JSC::functionProtoFuncApply):
33218 (JSC::JSArray::fillArgList):
33221 2008-09-22 Darin Adler <darin@apple.com>
33223 Reviewed by Sam Weinig.
33225 - https://bugs.webkit.org/show_bug.cgi?id=20993
33226 Array.push/pop need optimized cases for JSArray
33228 3% or so speedup on DeltaBlue benchmark.
33230 * kjs/ArrayPrototype.cpp:
33231 (JSC::arrayProtoFuncPop): Call JSArray::pop when appropriate.
33232 (JSC::arrayProtoFuncPush): Call JSArray::push when appropriate.
33235 (JSC::JSArray::putSlowCase): Set m_fastAccessCutoff when appropriate, getting
33236 us into the fast code path.
33237 (JSC::JSArray::pop): Added.
33238 (JSC::JSArray::push): Added.
33239 * kjs/JSArray.h: Added push and pop.
33241 * kjs/operations.cpp:
33242 (JSC::throwOutOfMemoryError): Don't inline this. Helps us avoid PIC branches.
33244 2008-09-22 Maciej Stachowiak <mjs@apple.com>
33246 Reviewed by Cameron Zwarich.
33248 - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
33250 Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
33252 2.2% speedup on EarleyBoyer benchmark.
33254 * API/JSCallbackConstructor.cpp:
33255 * API/JSCallbackConstructor.h:
33256 (JSC::JSCallbackConstructor::createStructureID):
33257 * API/JSCallbackFunction.cpp:
33258 * API/JSCallbackFunction.h:
33259 (JSC::JSCallbackFunction::createStructureID):
33260 * API/JSCallbackObject.h:
33261 (JSC::JSCallbackObject::createStructureID):
33262 * API/JSCallbackObjectFunctions.h:
33263 (JSC::::hasInstance):
33264 * API/JSValueRef.cpp:
33265 (JSValueIsInstanceOfConstructor):
33266 * JavaScriptCore.exp:
33268 (JSC::Machine::privateExecute):
33269 (JSC::Machine::cti_op_instanceof):
33270 * kjs/InternalFunction.cpp:
33271 * kjs/InternalFunction.h:
33272 (JSC::InternalFunction::createStructureID):
33273 * kjs/JSObject.cpp:
33276 (JSC::TypeInfo::implementsHasInstance):
33278 2008-09-22 Maciej Stachowiak <mjs@apple.com>
33280 Reviewed by Dave Hyatt.
33282 Based on initial work by Darin Adler.
33284 - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
33285 - use this to JIT inline code for eq_null and neq_null
33286 https://bugs.webkit.org/show_bug.cgi?id=20823
33288 0.5% speedup on SunSpider
33289 ~4% speedup on Richards benchmark
33292 (JSC::CTI::privateCompileMainPass):
33294 (JSC::jsTypeStringForValue):
33295 (JSC::jsIsObjectType):
33296 (JSC::Machine::privateExecute):
33297 (JSC::Machine::cti_op_is_undefined):
33301 * kjs/StringObjectThatMasqueradesAsUndefined.h:
33302 (JSC::StringObjectThatMasqueradesAsUndefined::create):
33303 (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
33304 * kjs/StructureID.h:
33305 (JSC::StructureID::mutableTypeInfo):
33307 (JSC::TypeInfo::TypeInfo):
33308 (JSC::TypeInfo::masqueradesAsUndefined):
33309 * kjs/operations.cpp:
33311 * masm/X86Assembler.h:
33312 (JSC::X86Assembler::):
33313 (JSC::X86Assembler::setne_r):
33314 (JSC::X86Assembler::setnz_r):
33315 (JSC::X86Assembler::testl_i32m):
33317 2008-09-22 Tor Arne Vestbø <tavestbo@trolltech.com>
33321 Initialize QCoreApplication in kjs binary/Shell.cpp
33323 This allows us to use QCoreApplication::instance() to
33324 get the main thread in ThreadingQt.cpp
33328 * wtf/ThreadingQt.cpp:
33329 (WTF::initializeThreading):
33331 2008-09-21 Darin Adler <darin@apple.com>
33333 - blind attempt to fix non-all-in-one builds
33335 * kjs/JSGlobalObject.cpp: Added includes of Arguments.h and RegExpObject.h.
33337 2008-09-21 Darin Adler <darin@apple.com>
33341 * kjs/StructureID.cpp:
33342 (JSC::StructureID::addPropertyTransition): Use typeInfo().type() instead of m_type.
33343 (JSC::StructureID::createCachedPrototypeChain): Ditto.
33345 2008-09-21 Maciej Stachowiak <mjs@apple.com>
33347 Reviewed by Darin Adler.
33349 - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
33350 https://bugs.webkit.org/show_bug.cgi?id=20981
33352 * JavaScriptCore.exp:
33353 * JavaScriptCore.xcodeproj/project.pbxproj:
33355 (JSC::CTI::privateCompileMainPass):
33356 (JSC::CTI::privateCompilePutByIdTransition):
33358 (JSC::jsIsObjectType):
33359 (JSC::Machine::Machine):
33360 * kjs/AllInOneFile.cpp:
33362 (JSC::JSCell::isObject):
33363 (JSC::JSCell::isString):
33364 * kjs/JSGlobalData.cpp:
33365 (JSC::JSGlobalData::JSGlobalData):
33366 * kjs/JSGlobalObject.cpp:
33367 (JSC::JSGlobalObject::reset):
33368 * kjs/JSGlobalObject.h:
33369 (JSC::StructureID::prototypeForLookup):
33370 * kjs/JSNumberCell.h:
33371 (JSC::JSNumberCell::createStructureID):
33372 * kjs/JSObject.cpp:
33373 (JSC::JSObject::createInheritorID):
33375 (JSC::JSObject::createStructureID):
33377 (JSC::JSString::createStructureID):
33378 * kjs/NativeErrorConstructor.cpp:
33379 (JSC::NativeErrorConstructor::NativeErrorConstructor):
33380 * kjs/RegExpConstructor.cpp:
33381 * kjs/RegExpMatchesArray.h: Added.
33382 (JSC::RegExpMatchesArray::getOwnPropertySlot):
33383 (JSC::RegExpMatchesArray::put):
33384 (JSC::RegExpMatchesArray::deleteProperty):
33385 (JSC::RegExpMatchesArray::getPropertyNames):
33386 * kjs/StructureID.cpp:
33387 (JSC::StructureID::StructureID):
33388 (JSC::StructureID::addPropertyTransition):
33389 (JSC::StructureID::toDictionaryTransition):
33390 (JSC::StructureID::changePrototypeTransition):
33391 (JSC::StructureID::getterSetterTransition):
33392 * kjs/StructureID.h:
33393 (JSC::StructureID::create):
33394 (JSC::StructureID::typeInfo):
33395 * kjs/TypeInfo.h: Added.
33396 (JSC::TypeInfo::TypeInfo):
33397 (JSC::TypeInfo::type):
33399 2008-09-21 Darin Adler <darin@apple.com>
33401 Reviewed by Cameron Zwarich.
33403 - fix crash logging into Gmail due to recent Arguments change
33405 * kjs/Arguments.cpp:
33406 (JSC::Arguments::Arguments): Fix window where mark() function could
33407 see d->extraArguments with uninitialized contents.
33408 (JSC::Arguments::mark): Check d->extraArguments for 0 to handle two
33409 cases: 1) Inside the constructor before it's initialized.
33410 2) numArguments <= numParameters.
33412 2008-09-21 Darin Adler <darin@apple.com>
33414 - fix loose end from the "duplicate constant values" patch
33416 * VM/CodeGenerator.cpp:
33417 (JSC::CodeGenerator::emitLoad): Add a special case for values the
33418 hash table can't handle.
33420 2008-09-21 Mark Rowe <mrowe@apple.com>
33422 Fix the non-AllInOneFile build.
33424 * kjs/Arguments.cpp: Add missing #include.
33426 2008-09-21 Darin Adler <darin@apple.com>
33428 Reviewed by Cameron Zwarich and Mark Rowe.
33430 - fix test failure caused by my recent IndexToNameMap patch
33432 * kjs/Arguments.cpp:
33433 (JSC::Arguments::deleteProperty): Added the accidentally-omitted
33434 check of the boolean result from toArrayIndex.
33436 2008-09-21 Darin Adler <darin@apple.com>
33438 Reviewed by Maciej Stachowiak.
33440 - https://bugs.webkit.org/show_bug.cgi?id=20975
33441 inline immediate-number case of ==
33443 * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to
33444 emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.
33446 * VM/CTI.cpp: Updated for new name.
33447 (JSC::CTI::privateCompileMainPass): Added op_eq.
33448 (JSC::CTI::privateCompileSlowCases): Added op_eq.
33451 (JSC::Machine::cti_op_eq): Removed fast case, since it's now
33454 2008-09-21 Peter Gal <galpter@inf.u-szeged.hu>
33456 Reviewed by Tim Hatcher and Eric Seidel.
33458 Fix the QT/Linux JavaScriptCore segmentation fault.
33459 https://bugs.webkit.org/show_bug.cgi?id=20914
33461 * wtf/ThreadingQt.cpp:
33462 (WTF::initializeThreading): Use currentThread() if
33463 platform is not a MAC (like in pre 36541 revisions)
33465 2008-09-21 Darin Adler <darin@apple.com>
33467 Reviewed by Sam Weinig.
33469 * kjs/debugger.h: Removed some unneeded includes and declarations.
33471 2008-09-21 Darin Adler <darin@apple.com>
33473 Reviewed by Sam Weinig.
33475 - https://bugs.webkit.org/show_bug.cgi?id=20972
33476 speed up Arguments further by eliminating the IndexToNameMap
33478 No change on SunSpider. 1.29x as fast on V8 Raytrace.
33480 * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the
33481 indexToNameMap and hadDeletes data members. Changed extraArguments into
33482 an OwnArrayPtr and added deletedArguments, another OwnArrayPtr.
33483 Replaced numExtraArguments with numParameters, since that's what's
33484 used more directly in hot code paths.
33485 (JSC::Arguments::Arguments): Pass in argument count instead of ArgList.
33486 Initialize ArgumentsData the new way.
33487 (JSC::Arguments::mark): Updated.
33488 (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so
33489 we don't have to convert integers to identifiers just to get an argument.
33490 Integrated the deleted case with the fast case.
33491 (JSC::Arguments::put): Ditto.
33492 (JSC::Arguments::deleteProperty): Ditto.
33494 * kjs/Arguments.h: Minimized includes. Made everything private. Added
33495 overloads for the integral property name case. Eliminated mappedIndexSetter.
33496 Moved ArgumentsData into the .cpp file.
33498 * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
33499 * kjs/IndexToNameMap.h: Ditto.
33501 * kjs/JSActivation.cpp:
33502 (JSC::JSActivation::createArgumentsObject): Elminated ArgList.
33505 * JavaScriptCore.pri:
33506 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
33507 * JavaScriptCore.xcodeproj/project.pbxproj:
33508 * JavaScriptCoreSources.bkl:
33509 * kjs/AllInOneFile.cpp:
33510 Removed IndexToNameMap.
33512 2008-09-21 Darin Adler <darin@apple.com>
33514 * VM/CodeGenerator.cpp:
33515 (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly
33518 2008-09-21 Judit Jasz <jasy@inf.u-szeged.hu>
33520 Reviewed and tweaked by Darin Adler.
33522 - https://bugs.webkit.org/show_bug.cgi?id=20645
33523 Elminate duplicate constant values in CodeBlocks.
33525 Seems to be a wash on SunSpider.
33527 * VM/CodeGenerator.cpp:
33528 (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee
33529 we emit the same JSValue* for identical numbers and strings.
33530 * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&.
33531 Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap.
33533 (JSC::StringNode::emitCode): Call the new emitLoad and let it do the
33536 2008-09-21 Paul Pedriana <webkit@pedriana.com>
33538 Reviewed and tweaked by Darin Adler.
33540 - https://bugs.webkit.org/show_bug.cgi?id=16925
33541 Fixed lack of Vector buffer alignment for both GCC and MSVC.
33542 Since there's no portable way to do this, for now we don't support
33545 * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer.
33546 Use AlignedBuffer insteadof an array of char in VectorBuffer.
33548 2008-09-21 Gabor Loki <loki@inf.u-szeged.hu>
33550 Reviewed by Darin Adler.
33552 - https://bugs.webkit.org/show_bug.cgi?id=19408
33553 Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators.
33555 1.008x as fast on SunSpider.
33558 (makeNegateNode): Fold if expression is a number > 0.
33559 (makeBitwiseNotNode): Fold if expression is a number.
33560 (makeMultNode): Fold if expressions are both numbers.
33561 (makeDivNode): Fold if expressions are both numbers.
33562 (makeAddNode): Fold if expressions are both numbers.
33563 (makeLeftShiftNode): Fold if expressions are both numbers.
33564 (makeRightShiftNode): Fold if expressions are both numbers.
33566 2008-09-21 Maciej Stachowiak <mjs@apple.com>
33568 Reviewed by Oliver.
33570 - speed up === operator by generating inline machine code for the fast paths
33571 https://bugs.webkit.org/show_bug.cgi?id=20820
33574 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber):
33575 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers):
33576 (JSC::CTI::emitJumpSlowCaseIfNotImmediates):
33577 (JSC::CTI::emitTagAsBoolImmediate):
33578 (JSC::CTI::privateCompileMainPass):
33579 (JSC::CTI::privateCompileSlowCases):
33582 (JSC::Machine::cti_op_stricteq):
33583 * masm/X86Assembler.h:
33584 (JSC::X86Assembler::):
33585 (JSC::X86Assembler::sete_r):
33586 (JSC::X86Assembler::setz_r):
33587 (JSC::X86Assembler::movzbl_rr):
33588 (JSC::X86Assembler::emitUnlinkedJnz):
33590 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
33592 Reviewed by Maciej Stachowiak.
33594 Free memory allocated for extra arguments in the destructor of the
33597 * kjs/Arguments.cpp:
33598 (JSC::Arguments::~Arguments):
33601 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
33603 Reviewed by Maciej Stachowiak.
33605 Bug 20815: 'arguments' object creation is non-optimal
33606 <https://bugs.webkit.org/show_bug.cgi?id=20815>
33608 Fix our inefficient way of creating the arguments object by only
33609 creating named properties for each of the arguments after a use of the
33610 'delete' statement. This patch also speeds up access to the 'arguments'
33611 object slightly, but it still does not use the array fast path for
33612 indexed access that exists for many opcodes.
33614 This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5%
33615 improvement on the Earley-Boyer benchmark, which gives a 4% improvement
33618 * kjs/Arguments.cpp:
33619 (JSC::Arguments::Arguments):
33620 (JSC::Arguments::mark):
33621 (JSC::Arguments::getOwnPropertySlot):
33622 (JSC::Arguments::put):
33623 (JSC::Arguments::deleteProperty):
33625 (JSC::Arguments::ArgumentsData::ArgumentsData):
33626 * kjs/IndexToNameMap.h:
33627 (JSC::IndexToNameMap::size):
33628 * kjs/JSActivation.cpp:
33629 (JSC::JSActivation::createArgumentsObject):
33630 * kjs/JSActivation.h:
33631 (JSC::JSActivation::uncheckedSymbolTableGet):
33632 (JSC::JSActivation::uncheckedSymbolTableGetValue):
33633 (JSC::JSActivation::uncheckedSymbolTablePut):
33634 * kjs/JSFunction.h:
33635 (JSC::JSFunction::numParameters):
33637 2008-09-20 Darin Adler <darin@apple.com>
33639 Reviewed by Mark Rowe.
33641 - fix crash seen on buildbot
33643 * kjs/JSGlobalObject.cpp:
33644 (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype,
33645 deleted by accident in my recent check-in.
33647 2008-09-20 Maciej Stachowiak <mjs@apple.com>
33649 Not reviewed, build fix.
33651 - speculative fix for non-AllInOne builds
33653 * kjs/operations.h:
33655 2008-09-20 Maciej Stachowiak <mjs@apple.com>
33657 Reviewed by Darin Adler.
33659 - assorted optimizations to === and !== operators
33660 (work towards <https://bugs.webkit.org/show_bug.cgi?id=20820>)
33662 2.5% speedup on earley-boyer test
33665 (JSC::Machine::cti_op_stricteq): Use inline version of
33666 strictEqualSlowCase; remove unneeded exception check.
33667 (JSC::Machine::cti_op_nstricteq): ditto
33668 * kjs/operations.cpp:
33669 (JSC::strictEqual): Use strictEqualSlowCaseInline
33670 (JSC::strictEqualSlowCase): ditto
33671 * kjs/operations.h:
33672 (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined,
33673 since the extra function call indirection is a lose for CTI.
33675 2008-09-20 Darin Adler <darin@apple.com>
33677 Reviewed by Maciej Stachowiak.
33679 - finish https://bugs.webkit.org/show_bug.cgi?id=20858
33680 make each distinct C++ class get a distinct JSC::Structure
33682 This also includes some optimizations that make the change an overall
33683 small speedup. Without those it was a bit of a slowdown.
33685 * API/JSCallbackConstructor.cpp:
33686 (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
33687 * API/JSCallbackConstructor.h: Ditto.
33688 * API/JSCallbackFunction.cpp:
33689 (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
33690 * API/JSCallbackObject.h: Take a structure.
33691 * API/JSCallbackObjectFunctions.h:
33692 (JSC::JSCallbackObject::JSCallbackObject): Ditto.
33694 * API/JSClassRef.cpp:
33695 (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype
33696 if there's a custom prototype involved.
33697 * API/JSObjectRef.cpp:
33698 (JSObjectMake): Ditto.
33699 (JSObjectMakeConstructor): Pass in a structure.
33701 * JavaScriptCore.exp: Updated.
33704 (JSC::jsLess): Added a special case for when both arguments are strings.
33705 This avoids converting both strings to with UString::toDouble.
33706 (JSC::jsLessEq): Ditto.
33707 (JSC::Machine::privateExecute): Pass in a structure.
33708 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
33709 (JSC::Machine::cti_op_new_regexp): Ditto.
33710 (JSC::Machine::cti_op_is_string): Ditto.
33711 * VM/Machine.h: Made isJSString public so it can be used in the CTI.
33713 * kjs/Arguments.cpp:
33714 (JSC::Arguments::Arguments): Pass in a structure.
33716 * kjs/JSCell.h: Mark constructor explicit.
33718 * kjs/JSGlobalObject.cpp:
33719 (JSC::markIfNeeded): Added an overload for marking structures.
33720 (JSC::JSGlobalObject::reset): Eliminate code to set data members to
33721 zero. We now do that in the constructor, and we no longer use this
33722 anywhere except in the constructor. Added code to create structures.
33723 Pass structures rather than prototypes when creating objects.
33724 (JSC::JSGlobalObject::mark): Mark the structures.
33726 * kjs/JSGlobalObject.h: Removed unneeded class declarations.
33727 Added initializers for raw pointers in JSGlobalObjectData so
33728 everything starts with a 0. Added structure data and accessor
33731 * kjs/JSImmediate.cpp:
33732 (JSC::JSImmediate::nonInlineNaN): Added.
33733 * kjs/JSImmediate.h:
33734 (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
33736 * kjs/JSNumberCell.cpp:
33737 (JSC::jsNumberCell): Made non-inline to avoid PIC branches
33738 in functions that call this one.
33739 (JSC::jsNaN): Ditto.
33740 * kjs/JSNumberCell.h: Ditto.
33742 * kjs/JSObject.h: Removed constructor that takes a prototype.
33743 All callers now pass structures.
33745 * kjs/ArrayConstructor.cpp:
33746 (JSC::ArrayConstructor::ArrayConstructor):
33747 (JSC::constructArrayWithSizeQuirk):
33748 * kjs/ArrayConstructor.h:
33749 * kjs/ArrayPrototype.cpp:
33750 (JSC::ArrayPrototype::ArrayPrototype):
33751 * kjs/ArrayPrototype.h:
33752 * kjs/BooleanConstructor.cpp:
33753 (JSC::BooleanConstructor::BooleanConstructor):
33754 (JSC::constructBoolean):
33755 (JSC::constructBooleanFromImmediateBoolean):
33756 * kjs/BooleanConstructor.h:
33757 * kjs/BooleanObject.cpp:
33758 (JSC::BooleanObject::BooleanObject):
33759 * kjs/BooleanObject.h:
33760 * kjs/BooleanPrototype.cpp:
33761 (JSC::BooleanPrototype::BooleanPrototype):
33762 * kjs/BooleanPrototype.h:
33763 * kjs/DateConstructor.cpp:
33764 (JSC::DateConstructor::DateConstructor):
33765 (JSC::constructDate):
33766 * kjs/DateConstructor.h:
33767 * kjs/DateInstance.cpp:
33768 (JSC::DateInstance::DateInstance):
33769 * kjs/DateInstance.h:
33770 * kjs/DatePrototype.cpp:
33771 (JSC::DatePrototype::DatePrototype):
33772 * kjs/DatePrototype.h:
33773 * kjs/ErrorConstructor.cpp:
33774 (JSC::ErrorConstructor::ErrorConstructor):
33775 (JSC::constructError):
33776 * kjs/ErrorConstructor.h:
33777 * kjs/ErrorInstance.cpp:
33778 (JSC::ErrorInstance::ErrorInstance):
33779 * kjs/ErrorInstance.h:
33780 * kjs/ErrorPrototype.cpp:
33781 (JSC::ErrorPrototype::ErrorPrototype):
33782 * kjs/ErrorPrototype.h:
33783 * kjs/FunctionConstructor.cpp:
33784 (JSC::FunctionConstructor::FunctionConstructor):
33785 * kjs/FunctionConstructor.h:
33786 * kjs/FunctionPrototype.cpp:
33787 (JSC::FunctionPrototype::FunctionPrototype):
33788 (JSC::FunctionPrototype::addFunctionProperties):
33789 * kjs/FunctionPrototype.h:
33790 * kjs/GlobalEvalFunction.cpp:
33791 (JSC::GlobalEvalFunction::GlobalEvalFunction):
33792 * kjs/GlobalEvalFunction.h:
33793 * kjs/InternalFunction.cpp:
33794 (JSC::InternalFunction::InternalFunction):
33795 * kjs/InternalFunction.h:
33796 (JSC::InternalFunction::InternalFunction):
33798 (JSC::JSArray::JSArray):
33799 (JSC::constructEmptyArray):
33800 (JSC::constructArray):
33802 * kjs/JSFunction.cpp:
33803 (JSC::JSFunction::JSFunction):
33804 (JSC::JSFunction::construct):
33805 * kjs/JSObject.cpp:
33806 (JSC::constructEmptyObject):
33807 * kjs/JSString.cpp:
33808 (JSC::StringObject::create):
33809 * kjs/JSWrapperObject.h:
33810 * kjs/MathObject.cpp:
33811 (JSC::MathObject::MathObject):
33812 * kjs/MathObject.h:
33813 * kjs/NativeErrorConstructor.cpp:
33814 (JSC::NativeErrorConstructor::NativeErrorConstructor):
33815 (JSC::NativeErrorConstructor::construct):
33816 * kjs/NativeErrorConstructor.h:
33817 * kjs/NativeErrorPrototype.cpp:
33818 (JSC::NativeErrorPrototype::NativeErrorPrototype):
33819 * kjs/NativeErrorPrototype.h:
33820 * kjs/NumberConstructor.cpp:
33821 (JSC::NumberConstructor::NumberConstructor):
33822 (JSC::constructWithNumberConstructor):
33823 * kjs/NumberConstructor.h:
33824 * kjs/NumberObject.cpp:
33825 (JSC::NumberObject::NumberObject):
33826 (JSC::constructNumber):
33827 (JSC::constructNumberFromImmediateNumber):
33828 * kjs/NumberObject.h:
33829 * kjs/NumberPrototype.cpp:
33830 (JSC::NumberPrototype::NumberPrototype):
33831 * kjs/NumberPrototype.h:
33832 * kjs/ObjectConstructor.cpp:
33833 (JSC::ObjectConstructor::ObjectConstructor):
33834 (JSC::constructObject):
33835 * kjs/ObjectConstructor.h:
33836 * kjs/ObjectPrototype.cpp:
33837 (JSC::ObjectPrototype::ObjectPrototype):
33838 * kjs/ObjectPrototype.h:
33839 * kjs/PrototypeFunction.cpp:
33840 (JSC::PrototypeFunction::PrototypeFunction):
33841 * kjs/PrototypeFunction.h:
33842 * kjs/RegExpConstructor.cpp:
33843 (JSC::RegExpConstructor::RegExpConstructor):
33844 (JSC::RegExpMatchesArray::RegExpMatchesArray):
33845 (JSC::constructRegExp):
33846 * kjs/RegExpConstructor.h:
33847 * kjs/RegExpObject.cpp:
33848 (JSC::RegExpObject::RegExpObject):
33849 * kjs/RegExpObject.h:
33850 * kjs/RegExpPrototype.cpp:
33851 (JSC::RegExpPrototype::RegExpPrototype):
33852 * kjs/RegExpPrototype.h:
33854 (GlobalObject::GlobalObject):
33855 * kjs/StringConstructor.cpp:
33856 (JSC::StringConstructor::StringConstructor):
33857 (JSC::constructWithStringConstructor):
33858 * kjs/StringConstructor.h:
33859 * kjs/StringObject.cpp:
33860 (JSC::StringObject::StringObject):
33861 * kjs/StringObject.h:
33862 * kjs/StringObjectThatMasqueradesAsUndefined.h:
33863 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
33864 * kjs/StringPrototype.cpp:
33865 (JSC::StringPrototype::StringPrototype):
33866 * kjs/StringPrototype.h:
33867 Take and pass structures.
33869 2008-09-19 Alp Toker <alp@nuanti.com>
33871 Build fix for the 'gold' linker and recent binutils. New behaviour
33872 requires that we link to used libraries explicitly.
33876 2008-09-19 Sam Weinig <sam@webkit.org>
33878 Roll r36694 back in. It did not cause the crash.
33880 * JavaScriptCore.exp:
33881 * VM/JSPropertyNameIterator.cpp:
33882 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
33883 (JSC::JSPropertyNameIterator::invalidate):
33884 * VM/JSPropertyNameIterator.h:
33885 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
33886 (JSC::JSPropertyNameIterator::create):
33887 * kjs/JSObject.cpp:
33888 (JSC::JSObject::getPropertyNames):
33889 * kjs/PropertyMap.cpp:
33890 (JSC::PropertyMap::getEnumerablePropertyNames):
33891 * kjs/PropertyMap.h:
33892 * kjs/PropertyNameArray.cpp:
33893 (JSC::PropertyNameArray::add):
33894 * kjs/PropertyNameArray.h:
33895 (JSC::PropertyNameArrayData::create):
33896 (JSC::PropertyNameArrayData::propertyNameVector):
33897 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
33898 (JSC::PropertyNameArrayData::cachedPrototypeChain):
33899 (JSC::PropertyNameArrayData::begin):
33900 (JSC::PropertyNameArrayData::end):
33901 (JSC::PropertyNameArrayData::PropertyNameArrayData):
33902 (JSC::PropertyNameArray::PropertyNameArray):
33903 (JSC::PropertyNameArray::addKnownUnique):
33904 (JSC::PropertyNameArray::size):
33905 (JSC::PropertyNameArray::operator[]):
33906 (JSC::PropertyNameArray::begin):
33907 (JSC::PropertyNameArray::end):
33908 (JSC::PropertyNameArray::setData):
33909 (JSC::PropertyNameArray::data):
33910 (JSC::PropertyNameArray::releaseData):
33911 * kjs/StructureID.cpp:
33912 (JSC::structureIDChainsAreEqual):
33913 (JSC::StructureID::getEnumerablePropertyNames):
33914 (JSC::StructureID::clearEnumerationCache):
33915 (JSC::StructureID::createCachedPrototypeChain):
33916 * kjs/StructureID.h:
33918 2008-09-19 Sam Weinig <sam@webkit.org>
33922 * JavaScriptCore.exp:
33923 * VM/JSPropertyNameIterator.cpp:
33924 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
33925 (JSC::JSPropertyNameIterator::invalidate):
33926 * VM/JSPropertyNameIterator.h:
33927 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
33928 (JSC::JSPropertyNameIterator::create):
33929 * kjs/JSObject.cpp:
33930 (JSC::JSObject::getPropertyNames):
33931 * kjs/PropertyMap.cpp:
33932 (JSC::PropertyMap::getEnumerablePropertyNames):
33933 * kjs/PropertyMap.h:
33934 * kjs/PropertyNameArray.cpp:
33935 (JSC::PropertyNameArray::add):
33936 * kjs/PropertyNameArray.h:
33937 (JSC::PropertyNameArray::PropertyNameArray):
33938 (JSC::PropertyNameArray::addKnownUnique):
33939 (JSC::PropertyNameArray::begin):
33940 (JSC::PropertyNameArray::end):
33941 (JSC::PropertyNameArray::size):
33942 (JSC::PropertyNameArray::operator[]):
33943 (JSC::PropertyNameArray::releaseIdentifiers):
33944 * kjs/StructureID.cpp:
33945 (JSC::StructureID::getEnumerablePropertyNames):
33946 * kjs/StructureID.h:
33947 (JSC::StructureID::clearEnumerationCache):
33949 2008-09-19 Oliver Hunt <oliver@apple.com>
33951 Reviewed by Maciej Stachowiak.
33953 Improve peformance of local variable initialisation.
33955 Pull local and constant initialisation out of slideRegisterWindowForCall
33956 and into its own opcode. This allows the JIT to generate the initialisation
33957 code for a function directly into the instruction stream and so avoids a few
33958 branches on function entry.
33960 Results a 1% progression in SunSpider, particularly in a number of the bitop
33961 tests where the called functions are very fast.
33964 (JSC::CTI::emitInitialiseRegister):
33965 (JSC::CTI::privateCompileMainPass):
33967 * VM/CodeBlock.cpp:
33968 (JSC::CodeBlock::dump):
33969 * VM/CodeGenerator.cpp:
33970 (JSC::CodeGenerator::CodeGenerator):
33972 (JSC::slideRegisterWindowForCall):
33973 (JSC::Machine::privateExecute):
33976 2008-09-19 Sam Weinig <sam@webkit.org>
33978 Reviewed by Darin Adler.
33980 Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
33981 Speed up JS property enumeration by caching entire PropertyNameArray
33983 1.3% speedup on Sunspider, 30% on string-fasta.
33985 * JavaScriptCore.exp:
33986 * VM/JSPropertyNameIterator.cpp:
33987 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
33988 (JSC::JSPropertyNameIterator::invalidate):
33989 * VM/JSPropertyNameIterator.h:
33990 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
33991 (JSC::JSPropertyNameIterator::create):
33992 * kjs/JSObject.cpp:
33993 (JSC::JSObject::getPropertyNames):
33994 * kjs/PropertyMap.cpp:
33995 (JSC::PropertyMap::getEnumerablePropertyNames):
33996 * kjs/PropertyMap.h:
33997 * kjs/PropertyNameArray.cpp:
33998 (JSC::PropertyNameArray::add):
33999 * kjs/PropertyNameArray.h:
34000 (JSC::PropertyNameArrayData::create):
34001 (JSC::PropertyNameArrayData::propertyNameVector):
34002 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
34003 (JSC::PropertyNameArrayData::cachedPrototypeChain):
34004 (JSC::PropertyNameArrayData::begin):
34005 (JSC::PropertyNameArrayData::end):
34006 (JSC::PropertyNameArrayData::PropertyNameArrayData):
34007 (JSC::PropertyNameArray::PropertyNameArray):
34008 (JSC::PropertyNameArray::addKnownUnique):
34009 (JSC::PropertyNameArray::size):
34010 (JSC::PropertyNameArray::operator[]):
34011 (JSC::PropertyNameArray::begin):
34012 (JSC::PropertyNameArray::end):
34013 (JSC::PropertyNameArray::setData):
34014 (JSC::PropertyNameArray::data):
34015 (JSC::PropertyNameArray::releaseData):
34016 * kjs/ScopeChain.cpp:
34017 (JSC::ScopeChainNode::print):
34018 * kjs/StructureID.cpp:
34019 (JSC::structureIDChainsAreEqual):
34020 (JSC::StructureID::getEnumerablePropertyNames):
34021 (JSC::StructureID::clearEnumerationCache):
34022 (JSC::StructureID::createCachedPrototypeChain):
34023 * kjs/StructureID.h:
34025 2008-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
34027 Reviewed by Maciej Stachowiak.
34029 Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
34031 * kjs/JSObject.cpp:
34032 (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
34034 2008-09-19 Darin Adler <darin@apple.com>
34036 Reviewed by Sam Weinig.
34038 - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
34039 make each distinct C++ class get a distinct JSC::Structure
34041 * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
34043 * kjs/JSGlobalObject.h: Changed the protected constructor to take a
34044 structure instead of a prototype.
34046 * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
34048 2008-09-19 Julien Chaffraix <jchaffraix@pleyo.com>
34050 Reviewed by Alexey Proskuryakov.
34052 Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
34053 non-template methods' code been copied for each instance of the template.
34054 The patch splits RefCounted between a base class that holds non-template methods and attributes
34055 and the template RefCounted class that keeps the same functionnality.
34057 On my Linux with gcc 4.3 for the Gtk port, this is:
34058 - a ~600KB save on libwebkit.so in release.
34059 - a ~1.6MB save on libwebkit.so in debug.
34061 It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
34062 On the whole, it should be a small win as we reduce the compiled code size and the only
34063 new function call should be inlined by the compiler.
34065 * wtf/RefCounted.h:
34066 (WTF::RefCountedBase::ref): Copied from RefCounted.
34067 (WTF::RefCountedBase::hasOneRef): Ditto.
34068 (WTF::RefCountedBase::refCount): Ditto.
34069 (WTF::RefCountedBase::RefCountedBase): Ditto.
34070 (WTF::RefCountedBase::~RefCountedBase): Ditto.
34071 (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
34073 (WTF::RefCounted::RefCounted):
34074 (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
34075 (WTF::RefCounted::~RefCounted): Keep private destructor.
34077 2008-09-18 Darin Adler <darin@apple.com>
34079 Reviewed by Maciej Stachowiak.
34081 - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
34082 make each distinct C++ class get a distinct JSC::Structure
34084 * kjs/lookup.h: Removed things here that were used only in WebCore:
34085 cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
34086 and JSC_IMPLEMENT_PROTOTYPE.
34088 2008-09-18 Darin Adler <darin@apple.com>
34090 Reviewed by Maciej Stachowiak.
34092 - https://bugs.webkit.org/show_bug.cgi?id=20927
34093 simplify/streamline the code to turn strings into identifiers while parsing
34095 * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
34099 (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
34100 * kjs/lexer.h: Remove makeUString.
34102 * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
34104 * VM/CodeGenerator.cpp:
34105 (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
34106 (JSC::prepareJumpTableForStringSwitch): Ditto.
34108 (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
34109 (JSC::processClauseList): Ditto.
34110 * kjs/nodes2string.cpp:
34111 (JSC::StringNode::streamTo): Ditto.
34113 2008-09-18 Sam Weinig <sam@webkit.org>
34117 * VM/Instruction.h:
34118 (JSC::Instruction::Instruction):
34120 2008-09-18 Oliver Hunt <oliver@apple.com>
34122 Reviewed by Maciej Stachowiak.
34124 Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
34125 <https://bugs.webkit.org/show_bug.cgi?id=20911>
34127 The problem was simply caused by the int constructor for Instruction
34128 failing to initialise the full struct in 64bit builds.
34130 * VM/Instruction.h:
34131 (JSC::Instruction::Instruction):
34133 2008-09-18 Darin Adler <darin@apple.com>
34135 - fix release build
34137 * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
34139 2008-09-18 Darin Adler <darin@apple.com>
34141 Reviewed by Sam Weinig.
34143 * kjs/JSGlobalObject.h: Tiny style guideline tweak.
34145 2008-09-18 Darin Adler <darin@apple.com>
34147 Reviewed by Sam Weinig.
34149 - fix https://bugs.webkit.org/show_bug.cgi?id=20925
34150 LEAK messages appear every time I quit
34152 * JavaScriptCore.exp: Updated, and also added an export
34153 needed for future WebCore use of JSC::StructureID.
34155 * wtf/RefCountedLeakCounter.cpp:
34156 (WTF::RefCountedLeakCounter::suppressMessages): Added.
34157 (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
34158 (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
34159 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
34160 log the reason there was no leak checking done.
34161 (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
34162 (WTF::RefCountedLeakCounter::decrement): Ditto.
34164 * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
34165 new functions, suppressMessages and cancelMessageSuppression. Also
34166 added m_ prefixes to the data member names.
34168 2008-09-18 Holger Hans Peter Freyther <zecke@selfish.org>
34170 Reviewed by Mark Rowe.
34172 https://bugs.webkit.org/show_bug.cgi?id=20437
34174 Add a proper #define to define which XML Parser implementation to use. Client
34175 code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
34176 implementation is going to be used.
34180 2008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34182 Reviewed by Maciej Stachowiak.
34184 Make a Unicode non-breaking space count as a whitespace character in
34185 PCRE. This change was already made in WREC, and it fixes one of the
34186 Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
34187 in a new set of expected test results.
34189 * pcre/pcre_internal.h:
34191 * tests/mozilla/expected.html:
34193 2008-09-18 Stephanie Lewis <slewis@apple.com>
34195 Reviewed by Mark Rowe and Maciej Stachowiak.
34197 add an option use arch to specify which architecture to run.
34199 * tests/mozilla/jsDriver.pl:
34201 2008-09-17 Oliver Hunt <oliver@apple.com>
34203 Correctly restore argument reference prior to SFX runtime calls.
34205 Reviewed by Steve Falkenburg.
34208 (JSC::CTI::privateCompileSlowCases):
34209 (JSC::CTI::privateCompile):
34211 2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34213 Reviewed by Maciej Stachowiak.
34215 Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
34216 <https://bugs.webkit.org/show_bug.cgi?id=20876>
34218 r36417 and r36427 caused an get_by_id opcode to be emitted before the
34219 instanceof and construct opcodes, in order to enable inline caching of
34220 the prototype property. Unfortunately, this regressed some tests dealing
34221 with exceptions thrown by 'instanceof' and the 'new' operator. We fix
34222 these problems by detecting whether an "is not an object" exception is
34223 thrown before op_instanceof or op_construct, and emit the proper
34224 exception in those cases.
34226 * VM/CodeGenerator.cpp:
34227 (JSC::CodeGenerator::emitConstruct):
34228 * VM/CodeGenerator.h:
34229 * VM/ExceptionHelpers.cpp:
34230 (JSC::createInvalidParamError):
34231 (JSC::createNotAConstructorError):
34232 (JSC::createNotAnObjectError):
34233 * VM/ExceptionHelpers.h:
34235 (JSC::Machine::getOpcode):
34236 (JSC::Machine::privateExecute):
34239 (JSC::NewExprNode::emitCode):
34240 (JSC::InstanceOfNode::emitCode):
34242 2008-09-17 Gavin Barraclough <barraclough@apple.com>
34244 Reviewed by Oliver Hunt.
34246 JIT generation cti_op_construct_verify.
34248 Quarter to half percent progression on v8-tests.
34249 Roughly not change on SunSpider (possible minor progression).
34252 (JSC::CTI::privateCompileMainPass):
34256 2008-09-15 Steve Falkenburg <sfalken@apple.com>
34258 Improve timer accuracy for JavaScript Date object on Windows.
34260 Use a combination of ftime and QueryPerformanceCounter.
34261 ftime returns the information we want, but doesn't have sufficient resolution.
34262 QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
34263 To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
34264 QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to
34265 correct for drift if the low-res and high-res elapsed time between calls differs by more
34266 than twice the low-resolution timer resolution.
34268 QueryPerformanceCounter may be inaccurate due to a problems with:
34269 - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
34270 - BIOS bugs (http://support.microsoft.com/kb/895980/)
34271 - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
34273 Reviewed by Darin Adler.
34275 * kjs/DateMath.cpp:
34276 (JSC::highResUpTime):
34277 (JSC::lowResUTCTime):
34278 (JSC::qpcAvailable):
34279 (JSC::getCurrentUTCTimeWithMicroseconds):
34281 2008-09-17 Gavin Barraclough <barraclough@apple.com>
34283 Reviewed by Geoff Garen.
34285 Implement JIT generation of CallFrame initialization, for op_call.
34287 1% sunspider 2.5% v8-tests.
34290 (JSC::CTI::compileOpCall):
34292 (JSC::Machine::cti_op_call_JSFunction):
34293 (JSC::Machine::cti_op_call_NotJSFunction):
34295 2008-09-17 Gavin Barraclough <barraclough@apple.com>
34297 Reviewed by Geoff Garen.
34299 Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code,
34300 move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
34301 functions, instead of checking prior to making the call.
34303 3% on v8-tests (4% on richards, 6% in delta-blue)
34306 (JSC::CTI::compileOpCall):
34307 (JSC::CTI::privateCompileSlowCases):
34308 (JSC::CTI::privateCompile):
34310 (JSC::Machine::execute):
34311 (JSC::Machine::cti_op_call_JSFunction):
34312 (JSC::Machine::cti_vm_compile):
34313 (JSC::Machine::cti_vm_updateScopeChain):
34314 (JSC::Machine::cti_op_construct_JSConstruct):
34317 2008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com>
34319 Fix the QtWebKit/Mac build
34321 * wtf/ThreadingQt.cpp:
34322 (WTF::initializeThreading): use QCoreApplication to get the main thread
34324 2008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34326 Reviewed by Maciej Stachowiak.
34328 Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
34329 <https://bugs.webkit.org/show_bug.cgi?id=20857>
34331 Fix a problem stemming from the slightly unsafe behaviour of the
34332 CodeGenerator::finalDestination() method by putting the "func" argument
34333 of the emitConstruct() method in a RefPtr in its caller. Also, add an
34334 assertion guaranteeing that this is always the case.
34336 CodeGenerator::finalDestination() is still incorrect and can cause
34337 problems with a different allocator; see bug 20340 for more details.
34339 * VM/CodeGenerator.cpp:
34340 (JSC::CodeGenerator::emitConstruct):
34342 (JSC::NewExprNode::emitCode):
34344 2008-09-16 Alice Liu <alice.liu@apple.com>
34349 (JSC::CTI::privateCompileMainPass):
34351 2008-09-16 Gavin Barraclough <barraclough@apple.com>
34353 Reviewed by Geoff Garen.
34355 CTI code generation for op_ret. The majority of the work
34356 (updating variables on the stack & on exec) can be performed
34357 directly in generated code.
34359 We still need to check, & to call out to C-code to handle
34360 activation records, profiling, and full scope chains.
34362 +1.5% Sunspider, +5/6% v8 tests.
34365 (JSC::CTI::emitPutCTIParam):
34366 (JSC::CTI::compileOpCall):
34367 (JSC::CTI::privateCompileMainPass):
34370 (JSC::Machine::cti_op_ret_activation):
34371 (JSC::Machine::cti_op_ret_profiler):
34372 (JSC::Machine::cti_op_ret_scopeChain):
34375 2008-09-16 Dimitri Glazkov <dglazkov@chromium.org>
34377 Fix the Windows build.
34379 Add some extra parentheses to stop MSVC from complaining so much.
34382 (JSC::Machine::privateExecute):
34383 (JSC::Machine::cti_op_stricteq):
34384 (JSC::Machine::cti_op_nstricteq):
34385 * kjs/operations.cpp:
34386 (JSC::strictEqual):
34388 2008-09-15 Maciej Stachowiak <mjs@apple.com>
34390 Reviewed by Cameron Zwarich.
34392 - speed up the === and !== operators by choosing the fast cases better
34394 No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
34397 (JSC::Machine::privateExecute):
34398 (JSC::Machine::cti_op_stricteq):
34399 (JSC::Machine::cti_op_nstricteq):
34400 * kjs/JSImmediate.h:
34401 (JSC::JSImmediate::areBothImmediate):
34402 * kjs/operations.cpp:
34403 (JSC::strictEqual):
34404 (JSC::strictEqualSlowCase):
34405 * kjs/operations.h:
34407 2008-09-15 Oliver Hunt <oliver@apple.com>
34411 Coding style cleanup.
34414 (JSC::Machine::privateExecute):
34416 2008-09-15 Oliver Hunt <oliver@apple.com>
34418 Reviewed by Cameron Zwarich.
34420 Bug 20874: op_resolve does not do any form of caching
34421 <https://bugs.webkit.org/show_bug.cgi?id=20874>
34423 This patch adds an op_resolve_global opcode to handle (and cache)
34424 property lookup we can statically determine must occur on the global
34425 object (if at all).
34427 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
34428 10% in math-partial-sums
34431 (JSC::CTI::privateCompileMainPass):
34433 * VM/CodeBlock.cpp:
34434 (JSC::CodeBlock::dump):
34435 * VM/CodeGenerator.cpp:
34436 (JSC::CodeGenerator::findScopedProperty):
34437 (JSC::CodeGenerator::emitResolve):
34439 (JSC::resolveGlobal):
34440 (JSC::Machine::privateExecute):
34441 (JSC::Machine::cti_op_resolve_global):
34445 2008-09-15 Sam Weinig <sam@webkit.org>
34447 Roll out r36462. It broke document.all.
34450 (JSC::CTI::privateCompileMainPass):
34451 (JSC::CTI::privateCompileSlowCases):
34454 (JSC::Machine::Machine):
34455 (JSC::Machine::cti_op_eq_null):
34456 (JSC::Machine::cti_op_neq_null):
34458 (JSC::Machine::isJSString):
34460 * kjs/JSWrapperObject.h:
34461 * kjs/StringObject.h:
34462 * kjs/StringObjectThatMasqueradesAsUndefined.h:
34464 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34466 Reviewed by Maciej Stachowiak.
34468 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
34469 <https://bugs.webkit.org/show_bug.cgi?id=20863>
34471 r36427 changed the number of arguments to op_construct without changing
34472 the argument index for the vPC in the call to initializeCallFrame() in
34473 the CTI case. This caused a JSC test failure. Correcting the argument
34474 index fixes the test failure.
34477 (JSC::Machine::cti_op_construct_JSConstruct):
34479 2008-09-15 Mark Rowe <mrowe@apple.com>
34485 2008-09-15 Geoffrey Garen <ggaren@apple.com>
34487 Reviewed by Maciej Stachowiak.
34489 Fixed a typo in op_get_by_id_chain that caused it to miss every time
34490 in the interpreter.
34492 Also, a little cleanup.
34495 (JSC::Machine::privateExecute): Set up baseObject before entering the
34496 loop, so we compare against the right values.
34498 2008-09-15 Geoffrey Garen <ggaren@apple.com>
34500 Reviewed by Sam Weinig.
34502 Removed the CalledAsConstructor flag from the call frame header. Now,
34503 we use an explicit opcode at the call site to fix up constructor results.
34505 SunSpider says 0.4% faster.
34507 cti_op_construct_verify is an out-of-line function call for now, but we
34508 can fix that once StructureID holds type information like isObject.
34511 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
34513 * VM/CodeBlock.cpp:
34514 (JSC::CodeBlock::dump):
34516 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
34517 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
34518 (JSC::CodeGenerator::emitConstruct): ... ditto.
34520 * VM/Machine.cpp: No more CalledAsConstructor
34521 (JSC::Machine::privateExecute): Implementation for the new opcode.
34522 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
34523 called as a constructor.
34524 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
34527 * VM/Opcode.h: Declare new opcode.
34529 * VM/RegisterFile.h:
34530 (JSC::RegisterFile::): No more CalledAsConstructor
34532 2008-09-15 Gavin Barraclough <barraclough@apple.com>
34534 Reviewed by Geoff Garen.
34536 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
34537 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
34538 masquerading may be handled differently (through the StructureIDs - see bug
34544 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
34545 (JSC::CTI::privateCompileMainPass):
34546 (JSC::CTI::privateCompileSlowCases):
34549 (JSC::Machine::Machine):
34550 (JSC::Machine::cti_op_eq_null):
34551 (JSC::Machine::cti_op_neq_null):
34553 (JSC::Machine::doesMasqueradesAsUndefined):
34554 * kjs/JSWrapperObject.h:
34555 (JSC::JSWrapperObject::):
34556 (JSC::JSWrapperObject::JSWrapperObject):
34557 * kjs/StringObject.h:
34558 (JSC::StringObject::StringObject):
34559 * kjs/StringObjectThatMasqueradesAsUndefined.h:
34560 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
34562 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34564 Rubber-stamped by Oliver Hunt.
34566 r36427 broke CodeBlock::dump() by changing the number of arguments to
34567 op_construct without changing the code that prints it. This patch fixes
34568 it by printing the additional argument.
34570 * JavaScriptCore.xcodeproj/project.pbxproj:
34571 * VM/CodeBlock.cpp:
34572 (JSC::CodeBlock::dump):
34574 2008-09-15 Adam Roben <aroben@apple.com>
34578 * kjs/StructureID.cpp: Removed a stray semicolon.
34580 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34582 Reviewed by Maciej Stachowiak.
34584 Fix a crash in fast/js/exception-expression-offset.html caused by not
34585 updating all mentions of the length of op_construct in r36427.
34588 (JSC::Machine::cti_op_construct_NotJSConstruct):
34590 2008-09-15 Maciej Stachowiak <mjs@apple.com>
34592 Reviewed by Cameron Zwarich.
34594 - fix layout test failure introduced by fix for 20849
34596 (The failing test was fast/js/delete-then-put.html)
34598 * kjs/JSObject.cpp:
34599 (JSC::JSObject::removeDirect): Clear enumeration cache
34600 in the dictionary case.
34602 (JSC::JSObject::putDirect): Ditto.
34603 * kjs/StructureID.h:
34604 (JSC::StructureID::clearEnumerationCache): Inline to handle the
34607 2008-09-15 Maciej Stachowiak <mjs@apple.com>
34609 Reviewed by Cameron Zwarich.
34611 - fix JSC test failures introduced by fix for 20849
34613 * kjs/PropertyMap.cpp:
34614 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
34616 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34618 Reviewed by Maciej Stachowiak.
34620 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
34621 <https://bugs.webkit.org/show_bug.cgi?id=20851>
34623 r36410 introduced an optimization for parseInt() that is incorrect when
34624 its argument is larger than the range of a 32-bit integer. If the
34625 argument is a number that is not an immediate integer, then the correct
34626 behaviour is to return the floor of its value, unless it is an infinite
34627 value, in which case the correct behaviour is to return 0.
34629 * kjs/JSGlobalObjectFunctions.cpp:
34630 (JSC::globalFuncParseInt):
34632 2008-09-15 Sam Weinig <sam@webkit.org>
34634 Reviewed by Maciej Stachowiak.
34636 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
34637 Cache property names for getEnumerablePropertyNames in the StructureID.
34639 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
34640 on the v8 test suite.
34642 * kjs/JSObject.cpp:
34643 (JSC::JSObject::getPropertyNames):
34644 * kjs/PropertyMap.cpp:
34645 (JSC::PropertyMap::getEnumerablePropertyNames):
34646 * kjs/PropertyMap.h:
34647 * kjs/StructureID.cpp:
34648 (JSC::StructureID::StructureID):
34649 (JSC::StructureID::getEnumerablePropertyNames):
34650 * kjs/StructureID.h:
34652 2008-09-14 Maciej Stachowiak <mjs@apple.com>
34654 Reviewed by Cameron Zwarich.
34656 - speed up JS construction by extracting "prototype" lookup so PIC applies.
34658 ~0.5% speedup on SunSpider
34659 Speeds up some of the V8 tests as well, most notably earley-boyer.
34662 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
34663 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
34664 * VM/CodeGenerator.cpp:
34665 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
34667 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
34668 (JSC::Machine::cti_op_construct_JSConstruct): ditto
34669 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
34671 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
34673 Reviewed by Eric Seidel.
34675 Add a protected destructor for RefCounted.
34677 It is wrong to call its destructor directly, because (1) this should be taken care of by
34678 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
34680 No change in behavior.
34682 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
34684 2008-09-14 Gavin Barraclough <barraclough@apple.com>
34686 Reviewed by Sam Weinig.
34688 Accelerated property accesses.
34690 Inline more of the array access code into the JIT code for get/put_by_val.
34691 Accelerate get/put_by_id by speculatively inlining a disable direct access
34692 into the hot path of the code, and repatch this with the correct StructureID
34693 and property map offset once these are known. In the case of accesses to the
34694 prototype and reading the array-length a trampoline is genertaed, and the
34695 branch to the slow-case is relinked to jump to this.
34697 By repatching, we mean rewriting the x86 instruction stream. Instructions are
34698 only modified in a simple fasion - altering immediate operands, memory access
34699 deisplacements, and branch offsets.
34701 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
34702 instruction's immediate operant is updateded, and a memory access operation's
34703 displacement is updated to access the correct field on the object. In the case
34704 of more complex accesses (array length and get_by_id_prototype) the offset on
34705 the branch to slow-case is updated, to now jump to a trampoline.
34707 +2.8% sunspider, +13% v8-tests
34710 (JSC::CTI::emitCall):
34711 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
34713 (JSC::CTI::privateCompileMainPass):
34714 (JSC::CTI::privateCompileSlowCases):
34715 (JSC::CTI::privateCompile):
34716 (JSC::CTI::privateCompileGetByIdSelf):
34717 (JSC::CTI::privateCompileGetByIdProto):
34718 (JSC::CTI::privateCompileGetByIdChain):
34719 (JSC::CTI::privateCompilePutByIdReplace):
34720 (JSC::CTI::privateCompilePutByIdTransition):
34721 (JSC::CTI::privateCompileArrayLengthTrampoline):
34722 (JSC::CTI::privateCompileStringLengthTrampoline):
34723 (JSC::CTI::patchGetByIdSelf):
34724 (JSC::CTI::patchPutByIdReplace):
34725 (JSC::CTI::privateCompilePatchGetArrayLength):
34726 (JSC::CTI::privateCompilePatchGetStringLength):
34728 (JSC::CTI::compileGetByIdSelf):
34729 (JSC::CTI::compileGetByIdProto):
34730 (JSC::CTI::compileGetByIdChain):
34731 (JSC::CTI::compilePutByIdReplace):
34732 (JSC::CTI::compilePutByIdTransition):
34733 (JSC::CTI::compileArrayLengthTrampoline):
34734 (JSC::CTI::compileStringLengthTrampoline):
34735 (JSC::CTI::compilePatchGetArrayLength):
34736 (JSC::CTI::compilePatchGetStringLength):
34737 * VM/CodeBlock.cpp:
34738 (JSC::CodeBlock::dump):
34739 (JSC::CodeBlock::~CodeBlock):
34741 (JSC::StructureStubInfo::StructureStubInfo):
34742 (JSC::CodeBlock::getStubInfo):
34744 (JSC::Machine::tryCTICachePutByID):
34745 (JSC::Machine::tryCTICacheGetByID):
34746 (JSC::Machine::cti_op_put_by_val_array):
34748 * masm/X86Assembler.h:
34749 (JSC::X86Assembler::):
34750 (JSC::X86Assembler::cmpl_i8m):
34751 (JSC::X86Assembler::emitUnlinkedJa):
34752 (JSC::X86Assembler::getRelocatedAddress):
34753 (JSC::X86Assembler::getDifferenceBetweenLabels):
34754 (JSC::X86Assembler::emitModRm_opmsib):
34756 2008-09-14 Maciej Stachowiak <mjs@apple.com>
34758 Reviewed by Cameron Zwarich.
34760 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
34762 ~5% speedup on v8 earley-boyer test
34764 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
34765 * API/JSCallbackObjectFunctions.h:
34766 (JSC::::hasInstance): Ditto.
34767 * API/JSValueRef.cpp:
34768 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
34769 * JavaScriptCore.exp:
34771 (JSC::CTI::privateCompileMainPass): Pass along prototype.
34772 * VM/CodeBlock.cpp:
34773 (JSC::CodeBlock::dump): Print third arg.
34774 * VM/CodeGenerator.cpp:
34775 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
34776 is a third argument.
34777 * VM/CodeGenerator.h:
34779 (JSC::Machine::privateExecute): Pass along the prototype.
34780 (JSC::Machine::cti_op_instanceof): ditto
34781 * kjs/JSObject.cpp:
34782 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
34785 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
34786 property and pass that register to instanceof.
34789 2008-09-14 Gavin Barraclough <barraclough@apple.com>
34791 Reviewed by Sam Weinig.
34793 Remove unnecessary virtual function call from cti_op_call_JSFunction -
34794 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
34797 (JSC::Machine::cti_op_call_JSFunction):
34799 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34801 Reviewed by Maciej Stachowiak.
34803 Bug 20827: the 'typeof' operator is slow
34804 <https://bugs.webkit.org/show_bug.cgi?id=20827>
34806 Optimize the 'typeof' operator when its result is compared to a constant
34809 This is a 5.5% speedup on the V8 Earley-Boyer test.
34812 (JSC::CTI::privateCompileMainPass):
34813 * VM/CodeBlock.cpp:
34814 (JSC::CodeBlock::dump):
34815 * VM/CodeGenerator.cpp:
34816 (JSC::CodeGenerator::emitEqualityOp):
34817 * VM/CodeGenerator.h:
34819 (JSC::jsIsObjectType):
34820 (JSC::jsIsFunctionType):
34821 (JSC::Machine::privateExecute):
34822 (JSC::Machine::cti_op_is_undefined):
34823 (JSC::Machine::cti_op_is_boolean):
34824 (JSC::Machine::cti_op_is_number):
34825 (JSC::Machine::cti_op_is_string):
34826 (JSC::Machine::cti_op_is_object):
34827 (JSC::Machine::cti_op_is_function):
34831 (JSC::BinaryOpNode::emitCode):
34832 (JSC::EqualNode::emitCode):
34833 (JSC::StrictEqualNode::emitCode):
34836 2008-09-14 Sam Weinig <sam@webkit.org>
34838 Reviewed by Cameron Zwarich.
34840 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
34841 Speed up parseInt for numbers
34843 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
34844 No change on the v8 suite.
34846 * kjs/JSGlobalObjectFunctions.cpp:
34847 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
34848 convert them back to numbers.
34850 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34852 Reviewed by Oliver Hunt.
34854 Bug 20816: op_lesseq should be optimized
34855 <https://bugs.webkit.org/show_bug.cgi?id=20816>
34857 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
34859 This is a 9.4% speedup on the V8 Crypto benchmark.
34862 (JSC::CTI::privateCompileMainPass):
34863 (JSC::CTI::privateCompileSlowCases):
34864 * VM/CodeBlock.cpp:
34865 (JSC::CodeBlock::dump):
34866 * VM/CodeGenerator.cpp:
34867 (JSC::CodeGenerator::emitJumpIfTrue):
34869 (JSC::Machine::privateExecute):
34870 (JSC::Machine::cti_op_loop_if_lesseq):
34874 2008-09-14 Sam Weinig <sam@webkit.org>
34876 Reviewed by Cameron Zwarich.
34878 Cleanup Sampling code.
34881 (JSC::CTI::emitCall):
34882 (JSC::CTI::privateCompileMainPass):
34884 (JSC::CTI::execute):
34885 * VM/SamplingTool.cpp:
34887 (JSC::SamplingTool::run):
34888 (JSC::SamplingTool::dump):
34889 * VM/SamplingTool.h:
34890 (JSC::SamplingTool::callingHostFunction):
34892 2008-09-13 Oliver Hunt <oliver@apple.com>
34894 Reviewed by Cameron Zwarich.
34896 Bug 20821: Cache property transitions to speed up object initialization
34897 https://bugs.webkit.org/show_bug.cgi?id=20821
34899 Implement a transition cache to improve the performance of new properties
34900 being added to objects. This is extremely beneficial in constructors and
34901 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
34905 (JSC::CTI::privateCompileMainPass):
34907 (JSC::transitionWillNeedStorageRealloc):
34908 (JSC::CTI::privateCompilePutByIdTransition):
34910 (JSC::CTI::compilePutByIdTransition):
34911 * VM/CodeBlock.cpp:
34912 (JSC::printPutByIdOp):
34913 (JSC::CodeBlock::printStructureIDs):
34914 (JSC::CodeBlock::dump):
34915 (JSC::CodeBlock::derefStructureIDs):
34916 (JSC::CodeBlock::refStructureIDs):
34917 * VM/CodeGenerator.cpp:
34918 (JSC::CodeGenerator::emitPutById):
34920 (JSC::cachePrototypeChain):
34921 (JSC::Machine::tryCachePutByID):
34922 (JSC::Machine::tryCacheGetByID):
34923 (JSC::Machine::privateExecute):
34924 (JSC::Machine::tryCTICachePutByID):
34925 (JSC::Machine::tryCTICacheGetByID):
34929 (JSC::JSObject::putDirect):
34930 (JSC::JSObject::transitionTo):
34931 * kjs/PutPropertySlot.h:
34932 (JSC::PutPropertySlot::PutPropertySlot):
34933 (JSC::PutPropertySlot::wasTransition):
34934 (JSC::PutPropertySlot::setWasTransition):
34935 * kjs/StructureID.cpp:
34936 (JSC::StructureID::transitionTo):
34937 (JSC::StructureIDChain::StructureIDChain):
34938 * kjs/StructureID.h:
34939 (JSC::StructureID::previousID):
34940 (JSC::StructureID::setCachedPrototypeChain):
34941 (JSC::StructureID::cachedPrototypeChain):
34942 (JSC::StructureID::propertyMap):
34943 * masm/X86Assembler.h:
34944 (JSC::X86Assembler::addl_i8m):
34945 (JSC::X86Assembler::subl_i8m):
34947 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34949 Reviewed by Maciej Stachowiak.
34951 Bug 20819: JSValue::isObject() is slow
34952 <https://bugs.webkit.org/show_bug.cgi?id=20819>
34954 Optimize JSCell::isObject() and JSCell::isString() by making them
34955 non-virtual calls that rely on the StructureID type information.
34957 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
34960 * JavaScriptCore.exp:
34963 (JSC::JSCell::isObject):
34964 (JSC::JSCell::isString):
34965 * kjs/JSObject.cpp:
34967 * kjs/JSString.cpp:
34969 (JSC::JSString::JSString):
34970 * kjs/StructureID.h:
34971 (JSC::StructureID::type):
34973 2008-09-11 Stephanie Lewis <slewis@apple.com>
34975 Reviewed by Oliver Hunt.
34977 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
34978 crash on CNN and on Dromaeo.
34979 Fix Missing close tag in vcproj.
34981 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
34983 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34987 Correct an SVN problem with the last commit and actually add the new
34990 * wrec/CharacterClassConstructor.cpp: Added.
34992 (JSC::getCharacterClassNewline):
34993 (JSC::getCharacterClassDigits):
34994 (JSC::getCharacterClassSpaces):
34995 (JSC::getCharacterClassWordchar):
34996 (JSC::getCharacterClassNondigits):
34997 (JSC::getCharacterClassNonspaces):
34998 (JSC::getCharacterClassNonwordchar):
34999 (JSC::CharacterClassConstructor::addSorted):
35000 (JSC::CharacterClassConstructor::addSortedRange):
35001 (JSC::CharacterClassConstructor::put):
35002 (JSC::CharacterClassConstructor::flush):
35003 (JSC::CharacterClassConstructor::append):
35004 * wrec/CharacterClassConstructor.h: Added.
35005 (JSC::CharacterClassConstructor::CharacterClassConstructor):
35006 (JSC::CharacterClassConstructor::isUpsideDown):
35007 (JSC::CharacterClassConstructor::charClass):
35009 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35011 Reviewed by Maciej Stachowiak.
35013 Bug 20788: Split CharacterClassConstructor into its own file
35014 <https://bugs.webkit.org/show_bug.cgi?id=20788>
35016 Split CharacterClassConstructor into its own file and clean up some
35019 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
35020 * JavaScriptCore.xcodeproj/project.pbxproj:
35021 * wrec/CharacterClassConstructor.cpp: Added.
35023 (JSC::getCharacterClassNewline):
35024 (JSC::getCharacterClassDigits):
35025 (JSC::getCharacterClassSpaces):
35026 (JSC::getCharacterClassWordchar):
35027 (JSC::getCharacterClassNondigits):
35028 (JSC::getCharacterClassNonspaces):
35029 (JSC::getCharacterClassNonwordchar):
35030 (JSC::CharacterClassConstructor::addSorted):
35031 (JSC::CharacterClassConstructor::addSortedRange):
35032 (JSC::CharacterClassConstructor::put):
35033 (JSC::CharacterClassConstructor::flush):
35034 (JSC::CharacterClassConstructor::append):
35035 * wrec/CharacterClassConstructor.h: Added.
35036 (JSC::CharacterClassConstructor::CharacterClassConstructor):
35037 (JSC::CharacterClassConstructor::isUpsideDown):
35038 (JSC::CharacterClassConstructor::charClass):
35040 (JSC::WRECParser::parseCharacterClass):
35042 2008-09-10 Simon Hausmann <hausmann@webkit.org>
35044 Not reviewed but trivial one-liner for yet unused macro.
35046 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
35048 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
35052 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35054 Rubber-stamped by Oliver Hunt.
35056 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
35060 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
35061 * masm/X86Assembler.h:
35062 (JSC::X86Assembler::orl_i32r):
35064 (JSC::WRECGenerator::generatePatternCharacter):
35065 (JSC::WRECGenerator::generateCharacterClassInverted):
35067 2008-09-10 Sam Weinig <sam@webkit.org>
35069 Reviewed by Geoff Garen.
35071 Add inline property storage for JSObject.
35073 1.2% progression on Sunspider. .5% progression on the v8 test suite.
35075 * JavaScriptCore.exp:
35077 (JSC::CTI::privateCompileGetByIdProto):
35078 (JSC::CTI::privateCompileGetByIdChain):
35079 * kjs/JSObject.cpp:
35080 (JSC::JSObject::mark): There is no reason to check storageSize now that
35082 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
35084 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
35085 now so there is no reason to .get()
35086 (JSC::JSObject::usingInlineStorage):
35087 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
35089 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
35091 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
35092 we know that we are about to add a property that will overflow the inline
35094 * kjs/PropertyMap.cpp:
35095 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
35096 now handled by JSObject.
35097 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
35098 * kjs/PropertyMap.h:
35099 (JSC::PropertyMap::storageSize): Rename from markingCount.
35100 * kjs/StructureID.cpp:
35101 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
35102 if we are using inline storage.
35103 * kjs/StructureID.h:
35105 2008-09-10 Oliver Hunt <oliver@apple.com>
35107 Reviewed by Geoff Garen.
35109 Inline immediate number version of op_mul.
35111 Renamed mull_rr to imull_rr as that's what it's
35112 actually doing, and added imull_i32r for the constant
35113 case immediate multiply.
35115 1.1% improvement to SunSpider.
35118 (JSC::CTI::privateCompileMainPass):
35119 (JSC::CTI::privateCompileSlowCases):
35120 * masm/X86Assembler.h:
35121 (JSC::X86Assembler::):
35122 (JSC::X86Assembler::imull_rr):
35123 (JSC::X86Assembler::imull_i32r):
35125 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35131 * JavaScriptCore.xcodeproj/project.pbxproj:
35133 2008-09-09 Oliver Hunt <oliver@apple.com>
35135 Reviewed by Maciej Stachowiak.
35137 Add optimised access to known properties on the global object.
35139 Improve cross scope access to the global object by emitting
35140 code to access it directly rather than by walking the scope chain.
35142 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
35145 (JSC::CTI::privateCompileMainPass):
35146 (JSC::CTI::emitGetVariableObjectRegister):
35147 (JSC::CTI::emitPutVariableObjectRegister):
35149 * VM/CodeBlock.cpp:
35150 (JSC::CodeBlock::dump):
35151 * VM/CodeGenerator.cpp:
35152 (JSC::CodeGenerator::findScopedProperty):
35153 (JSC::CodeGenerator::emitResolve):
35154 (JSC::CodeGenerator::emitGetScopedVar):
35155 (JSC::CodeGenerator::emitPutScopedVar):
35156 * VM/CodeGenerator.h:
35158 (JSC::Machine::privateExecute):
35161 (JSC::FunctionCallResolveNode::emitCode):
35162 (JSC::PostfixResolveNode::emitCode):
35163 (JSC::PrefixResolveNode::emitCode):
35164 (JSC::ReadModifyResolveNode::emitCode):
35165 (JSC::AssignResolveNode::emitCode):
35167 2008-09-10 Maciej Stachowiak <mjs@apple.com>
35169 Reviewed by Oliver.
35171 - enable polymorphic inline caching of properties of primitives
35173 1.012x speedup on SunSpider.
35175 We create special structure IDs for JSString and
35176 JSNumberCell. Unlike normal structure IDs, these cannot hold the
35177 true prototype. Due to JS autoboxing semantics, the prototype used
35178 when looking up string or number properties depends on the lexical
35179 global object of the call site, not the creation site. Thus we
35180 enable StructureIDs to handle this quirk for primitives.
35182 Everything else should be straightforward.
35185 (JSC::CTI::privateCompileGetByIdProto):
35186 (JSC::CTI::privateCompileGetByIdChain):
35188 (JSC::CTI::compileGetByIdProto):
35189 (JSC::CTI::compileGetByIdChain):
35190 * VM/JSPropertyNameIterator.h:
35191 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
35193 (JSC::Machine::Machine):
35194 (JSC::cachePrototypeChain):
35195 (JSC::Machine::tryCachePutByID):
35196 (JSC::Machine::tryCacheGetByID):
35197 (JSC::Machine::privateExecute):
35198 (JSC::Machine::tryCTICachePutByID):
35199 (JSC::Machine::tryCTICacheGetByID):
35200 * kjs/GetterSetter.h:
35201 (JSC::GetterSetter::GetterSetter):
35203 * kjs/JSGlobalData.cpp:
35204 (JSC::JSGlobalData::JSGlobalData):
35205 * kjs/JSGlobalData.h:
35206 * kjs/JSGlobalObject.h:
35207 (JSC::StructureID::prototypeForLookup):
35208 * kjs/JSNumberCell.h:
35209 (JSC::JSNumberCell::JSNumberCell):
35210 (JSC::jsNumberCell):
35212 (JSC::JSObject::prototype):
35213 * kjs/JSString.cpp:
35215 (JSC::jsSubstring):
35216 (JSC::jsOwnedString):
35218 (JSC::JSString::JSString):
35220 (JSC::jsSingleCharacterString):
35221 (JSC::jsSingleCharacterSubstring):
35222 (JSC::jsNontrivialString):
35223 * kjs/SmallStrings.cpp:
35224 (JSC::SmallStrings::createEmptyString):
35225 (JSC::SmallStrings::createSingleCharacterString):
35226 * kjs/StructureID.cpp:
35227 (JSC::StructureID::StructureID):
35228 (JSC::StructureID::addPropertyTransition):
35229 (JSC::StructureID::getterSetterTransition):
35230 (JSC::StructureIDChain::StructureIDChain):
35231 * kjs/StructureID.h:
35232 (JSC::StructureID::create):
35233 (JSC::StructureID::storedPrototype):
35235 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
35237 Reviewed by Sam Weinig.
35239 https://bugs.webkit.org/show_bug.cgi?id=20746
35241 Added WINCE platform macro.
35245 2008-09-09 Sam Weinig <sam@webkit.org>
35247 Reviewed by Mark Rowe.
35249 Remove unnecessary override of getOffset.
35251 Sunspider reports this as a .6% progression.
35253 * JavaScriptCore.exp:
35255 (JSC::JSObject::getDirectLocation):
35256 (JSC::JSObject::getOwnPropertySlotForWrite):
35257 (JSC::JSObject::putDirect):
35258 * kjs/PropertyMap.cpp:
35259 * kjs/PropertyMap.h:
35261 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35263 Reviewed by Maciej Stachowiak.
35265 Bug 20759: Remove MacroAssembler
35266 <https://bugs.webkit.org/show_bug.cgi?id=20759>
35268 Remove MacroAssembler and move its functionality to X86Assembler.
35270 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
35271 * JavaScriptCore.xcodeproj/project.pbxproj:
35273 (JSC::CTI::emitGetArg):
35274 (JSC::CTI::emitGetPutArg):
35275 (JSC::CTI::emitPutArg):
35276 (JSC::CTI::emitPutCTIParam):
35277 (JSC::CTI::emitGetCTIParam):
35278 (JSC::CTI::emitPutToCallFrameHeader):
35279 (JSC::CTI::emitGetFromCallFrameHeader):
35280 (JSC::CTI::emitPutResult):
35281 (JSC::CTI::emitDebugExceptionCheck):
35282 (JSC::CTI::emitJumpSlowCaseIfNotImm):
35283 (JSC::CTI::emitJumpSlowCaseIfNotImms):
35284 (JSC::CTI::emitFastArithDeTagImmediate):
35285 (JSC::CTI::emitFastArithReTagImmediate):
35286 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
35287 (JSC::CTI::emitFastArithImmToInt):
35288 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
35289 (JSC::CTI::emitFastArithIntToImmNoCheck):
35290 (JSC::CTI::compileOpCall):
35291 (JSC::CTI::emitSlowScriptCheck):
35292 (JSC::CTI::privateCompileMainPass):
35293 (JSC::CTI::privateCompileSlowCases):
35294 (JSC::CTI::privateCompile):
35295 (JSC::CTI::privateCompileGetByIdSelf):
35296 (JSC::CTI::privateCompileGetByIdProto):
35297 (JSC::CTI::privateCompileGetByIdChain):
35298 (JSC::CTI::privateCompilePutByIdReplace):
35299 (JSC::CTI::privateArrayLengthTrampoline):
35300 (JSC::CTI::privateStringLengthTrampoline):
35301 (JSC::CTI::compileRegExp):
35303 (JSC::CallRecord::CallRecord):
35304 (JSC::JmpTable::JmpTable):
35305 (JSC::SlowCaseEntry::SlowCaseEntry):
35306 (JSC::CTI::JSRInfo::JSRInfo):
35307 * masm/MacroAssembler.h: Removed.
35308 * masm/MacroAssemblerWin.cpp: Removed.
35309 * masm/X86Assembler.h:
35310 (JSC::X86Assembler::emitConvertToFastCall):
35311 (JSC::X86Assembler::emitRestoreArgumentReference):
35313 (JSC::WRECGenerator::WRECGenerator):
35314 (JSC::WRECParser::WRECParser):
35316 2008-09-09 Sam Weinig <sam@webkit.org>
35318 Reviewed by Cameron Zwarich.
35320 Don't waste the first item in the PropertyStorage.
35322 - Fix typo (makingCount -> markingCount)
35323 - Remove undefined method declaration.
35325 No change on Sunspider.
35327 * kjs/JSObject.cpp:
35328 (JSC::JSObject::mark):
35329 * kjs/PropertyMap.cpp:
35330 (JSC::PropertyMap::put):
35331 (JSC::PropertyMap::remove):
35332 (JSC::PropertyMap::getOffset):
35333 (JSC::PropertyMap::insert):
35334 (JSC::PropertyMap::rehash):
35335 (JSC::PropertyMap::resizePropertyStorage):
35336 (JSC::PropertyMap::checkConsistency):
35337 * kjs/PropertyMap.h:
35338 (JSC::PropertyMap::markingCount): Fix typo.
35340 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35344 Speculative Windows build fix.
35346 * masm/MacroAssemblerWin.cpp:
35347 (JSC::MacroAssembler::emitConvertToFastCall):
35348 (JSC::MacroAssembler::emitRestoreArgumentReference):
35350 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35352 Reviewed by Maciej Stachowiak.
35354 Bug 20755: Create an X86 namespace for register names and other things
35355 <https://bugs.webkit.org/show_bug.cgi?id=20755>
35357 Create an X86 namespace to put X86 register names. Perhaps I will move
35358 opcode names here later as well.
35361 (JSC::CTI::emitGetArg):
35362 (JSC::CTI::emitGetPutArg):
35363 (JSC::CTI::emitPutArg):
35364 (JSC::CTI::emitPutArgConstant):
35365 (JSC::CTI::emitPutCTIParam):
35366 (JSC::CTI::emitGetCTIParam):
35367 (JSC::CTI::emitPutToCallFrameHeader):
35368 (JSC::CTI::emitGetFromCallFrameHeader):
35369 (JSC::CTI::emitPutResult):
35370 (JSC::CTI::emitDebugExceptionCheck):
35371 (JSC::CTI::emitJumpSlowCaseIfNotImms):
35372 (JSC::CTI::compileOpCall):
35373 (JSC::CTI::emitSlowScriptCheck):
35374 (JSC::CTI::privateCompileMainPass):
35375 (JSC::CTI::privateCompileSlowCases):
35376 (JSC::CTI::privateCompile):
35377 (JSC::CTI::privateCompileGetByIdSelf):
35378 (JSC::CTI::privateCompileGetByIdProto):
35379 (JSC::CTI::privateCompileGetByIdChain):
35380 (JSC::CTI::privateCompilePutByIdReplace):
35381 (JSC::CTI::privateArrayLengthTrampoline):
35382 (JSC::CTI::privateStringLengthTrampoline):
35383 (JSC::CTI::compileRegExp):
35385 * masm/X86Assembler.h:
35387 (JSC::X86Assembler::emitModRm_rm):
35388 (JSC::X86Assembler::emitModRm_rm_Unchecked):
35389 (JSC::X86Assembler::emitModRm_rmsib):
35391 (JSC::WRECGenerator::generateNonGreedyQuantifier):
35392 (JSC::WRECGenerator::generateGreedyQuantifier):
35393 (JSC::WRECGenerator::generateParentheses):
35394 (JSC::WRECGenerator::generateBackreference):
35395 (JSC::WRECGenerator::gernerateDisjunction):
35398 2008-09-09 Sam Weinig <sam@webkit.org>
35400 Reviewed by Geoffrey Garen.
35402 Remove unnecessary friend declaration.
35404 * kjs/PropertyMap.h:
35406 2008-09-09 Sam Weinig <sam@webkit.org>
35408 Reviewed by Geoffrey Garen.
35410 Replace uses of PropertyMap::get and PropertyMap::getLocation with
35411 PropertyMap::getOffset.
35413 Sunspider reports this as a .6% improvement.
35415 * JavaScriptCore.exp:
35416 * kjs/JSObject.cpp:
35417 (JSC::JSObject::put):
35418 (JSC::JSObject::deleteProperty):
35419 (JSC::JSObject::getPropertyAttributes):
35421 (JSC::JSObject::getDirect):
35422 (JSC::JSObject::getDirectLocation):
35423 (JSC::JSObject::locationForOffset):
35424 * kjs/PropertyMap.cpp:
35425 (JSC::PropertyMap::remove):
35426 (JSC::PropertyMap::getOffset):
35427 * kjs/PropertyMap.h:
35429 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35431 Reviewed by Sam Weinig.
35433 Bug 20754: Remove emit prefix from assembler opcode methods
35434 <https://bugs.webkit.org/show_bug.cgi?id=20754>
35437 (JSC::CTI::emitGetArg):
35438 (JSC::CTI::emitGetPutArg):
35439 (JSC::CTI::emitPutArg):
35440 (JSC::CTI::emitPutArgConstant):
35441 (JSC::CTI::emitPutCTIParam):
35442 (JSC::CTI::emitGetCTIParam):
35443 (JSC::CTI::emitPutToCallFrameHeader):
35444 (JSC::CTI::emitGetFromCallFrameHeader):
35445 (JSC::CTI::emitPutResult):
35446 (JSC::CTI::emitDebugExceptionCheck):
35447 (JSC::CTI::emitCall):
35448 (JSC::CTI::emitJumpSlowCaseIfNotImm):
35449 (JSC::CTI::emitJumpSlowCaseIfNotImms):
35450 (JSC::CTI::emitFastArithDeTagImmediate):
35451 (JSC::CTI::emitFastArithReTagImmediate):
35452 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
35453 (JSC::CTI::emitFastArithImmToInt):
35454 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
35455 (JSC::CTI::emitFastArithIntToImmNoCheck):
35456 (JSC::CTI::compileOpCall):
35457 (JSC::CTI::emitSlowScriptCheck):
35458 (JSC::CTI::privateCompileMainPass):
35459 (JSC::CTI::privateCompileSlowCases):
35460 (JSC::CTI::privateCompile):
35461 (JSC::CTI::privateCompileGetByIdSelf):
35462 (JSC::CTI::privateCompileGetByIdProto):
35463 (JSC::CTI::privateCompileGetByIdChain):
35464 (JSC::CTI::privateCompilePutByIdReplace):
35465 (JSC::CTI::privateArrayLengthTrampoline):
35466 (JSC::CTI::privateStringLengthTrampoline):
35467 (JSC::CTI::compileRegExp):
35468 * masm/MacroAssemblerWin.cpp:
35469 (JSC::MacroAssembler::emitConvertToFastCall):
35470 (JSC::MacroAssembler::emitRestoreArgumentReference):
35471 * masm/X86Assembler.h:
35472 (JSC::X86Assembler::pushl_r):
35473 (JSC::X86Assembler::pushl_m):
35474 (JSC::X86Assembler::popl_r):
35475 (JSC::X86Assembler::popl_m):
35476 (JSC::X86Assembler::movl_rr):
35477 (JSC::X86Assembler::addl_rr):
35478 (JSC::X86Assembler::addl_i8r):
35479 (JSC::X86Assembler::addl_i32r):
35480 (JSC::X86Assembler::addl_mr):
35481 (JSC::X86Assembler::andl_rr):
35482 (JSC::X86Assembler::andl_i32r):
35483 (JSC::X86Assembler::cmpl_i8r):
35484 (JSC::X86Assembler::cmpl_rr):
35485 (JSC::X86Assembler::cmpl_rm):
35486 (JSC::X86Assembler::cmpl_i32r):
35487 (JSC::X86Assembler::cmpl_i32m):
35488 (JSC::X86Assembler::cmpw_rm):
35489 (JSC::X86Assembler::orl_rr):
35490 (JSC::X86Assembler::subl_rr):
35491 (JSC::X86Assembler::subl_i8r):
35492 (JSC::X86Assembler::subl_i32r):
35493 (JSC::X86Assembler::subl_mr):
35494 (JSC::X86Assembler::testl_i32r):
35495 (JSC::X86Assembler::testl_rr):
35496 (JSC::X86Assembler::xorl_i8r):
35497 (JSC::X86Assembler::xorl_rr):
35498 (JSC::X86Assembler::sarl_i8r):
35499 (JSC::X86Assembler::sarl_CLr):
35500 (JSC::X86Assembler::shl_i8r):
35501 (JSC::X86Assembler::shll_CLr):
35502 (JSC::X86Assembler::mull_rr):
35503 (JSC::X86Assembler::idivl_r):
35504 (JSC::X86Assembler::cdq):
35505 (JSC::X86Assembler::movl_mr):
35506 (JSC::X86Assembler::movzwl_mr):
35507 (JSC::X86Assembler::movl_rm):
35508 (JSC::X86Assembler::movl_i32r):
35509 (JSC::X86Assembler::movl_i32m):
35510 (JSC::X86Assembler::leal_mr):
35511 (JSC::X86Assembler::ret):
35512 (JSC::X86Assembler::jmp_r):
35513 (JSC::X86Assembler::jmp_m):
35514 (JSC::X86Assembler::call_r):
35516 (JSC::WRECGenerator::generateBacktrack1):
35517 (JSC::WRECGenerator::generateBacktrackBackreference):
35518 (JSC::WRECGenerator::generateBackreferenceQuantifier):
35519 (JSC::WRECGenerator::generateNonGreedyQuantifier):
35520 (JSC::WRECGenerator::generateGreedyQuantifier):
35521 (JSC::WRECGenerator::generatePatternCharacter):
35522 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
35523 (JSC::WRECGenerator::generateCharacterClassInverted):
35524 (JSC::WRECGenerator::generateCharacterClass):
35525 (JSC::WRECGenerator::generateParentheses):
35526 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
35527 (JSC::WRECGenerator::generateAssertionBOL):
35528 (JSC::WRECGenerator::generateAssertionEOL):
35529 (JSC::WRECGenerator::generateAssertionWordBoundary):
35530 (JSC::WRECGenerator::generateBackreference):
35531 (JSC::WRECGenerator::gernerateDisjunction):
35533 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35535 Reviewed by Maciej Stachowiak.
35537 Clean up the WREC code some more.
35540 (JSC::CTI::compileRegExp):
35542 (JSC::getCharacterClassNewline):
35543 (JSC::getCharacterClassDigits):
35544 (JSC::getCharacterClassSpaces):
35545 (JSC::getCharacterClassWordchar):
35546 (JSC::getCharacterClassNondigits):
35547 (JSC::getCharacterClassNonspaces):
35548 (JSC::getCharacterClassNonwordchar):
35549 (JSC::WRECGenerator::generateBacktrack1):
35550 (JSC::WRECGenerator::generateBacktrackBackreference):
35551 (JSC::WRECGenerator::generateBackreferenceQuantifier):
35552 (JSC::WRECGenerator::generateNonGreedyQuantifier):
35553 (JSC::WRECGenerator::generateGreedyQuantifier):
35554 (JSC::WRECGenerator::generatePatternCharacter):
35555 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
35556 (JSC::WRECGenerator::generateCharacterClassInverted):
35557 (JSC::WRECGenerator::generateCharacterClass):
35558 (JSC::WRECGenerator::generateParentheses):
35559 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
35560 (JSC::WRECGenerator::generateAssertionBOL):
35561 (JSC::WRECGenerator::generateAssertionEOL):
35562 (JSC::WRECGenerator::generateAssertionWordBoundary):
35563 (JSC::WRECGenerator::generateBackreference):
35564 (JSC::WRECGenerator::gernerateDisjunction):
35565 (JSC::WRECParser::parseCharacterClass):
35566 (JSC::WRECParser::parseEscape):
35567 (JSC::WRECParser::parseTerm):
35570 2008-09-09 Mark Rowe <mrowe@apple.com>
35572 Build fix, rubber-stamped by Anders Carlsson.
35574 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
35576 * JavaScriptCore.xcodeproj/project.pbxproj:
35578 2008-09-09 Mark Rowe <mrowe@apple.com>
35580 Rubber-stamped by Oliver Hunt.
35582 Fix builds using the "debug" variant.
35584 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
35585 and Release configurations.
35587 * Configurations/JavaScriptCore.xcconfig:
35588 * DerivedSources.make:
35589 * JavaScriptCore.Debug.exp: Removed.
35590 * JavaScriptCore.base.exp: Removed.
35591 * JavaScriptCore.exp: Added.
35592 * JavaScriptCore.xcodeproj/project.pbxproj:
35593 * kjs/identifier.cpp:
35594 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
35595 there is no overhead in Release builds.
35596 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
35597 * kjs/identifier.h:
35598 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
35599 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
35601 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35603 Reviewed by Maciej Stachowiak.
35605 Clean up WREC a bit to bring it closer to our coding style guidelines.
35609 (JSC::getCharacterClass_newline):
35610 (JSC::getCharacterClass_d):
35611 (JSC::getCharacterClass_s):
35612 (JSC::getCharacterClass_w):
35613 (JSC::getCharacterClass_D):
35614 (JSC::getCharacterClass_S):
35615 (JSC::getCharacterClass_W):
35616 (JSC::CharacterClassConstructor::append):
35617 (JSC::WRECGenerator::generateNonGreedyQuantifier):
35618 (JSC::WRECGenerator::generateGreedyQuantifier):
35619 (JSC::WRECGenerator::generateCharacterClassInverted):
35620 (JSC::WRECParser::parseQuantifier):
35621 (JSC::WRECParser::parsePatternCharacterQualifier):
35622 (JSC::WRECParser::parseCharacterClassQuantifier):
35623 (JSC::WRECParser::parseBackreferenceQuantifier):
35625 (JSC::Quantifier::):
35626 (JSC::Quantifier::Quantifier):
35628 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
35630 Reviewed by Alexey Proskuryakov.
35632 Try MIME charset names before trying IANA names
35633 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
35635 * wtf/StringExtras.h: (strcasecmp): Added.
35637 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35639 Reviewed by Mark Rowe.
35641 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
35642 <https://bugs.webkit.org/show_bug.cgi?id=20719>
35643 <rdar://problem/6205787>
35645 Fix a typo in the case-insensitive matching of character patterns.
35648 (JSC::WRECGenerator::generatePatternCharacter):
35650 2008-09-09 Maciej Stachowiak <mjs@apple.com>
35652 Reviewed by Sam Weinig.
35654 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
35656 1.012x speedup on SunSpider.
35658 * kjs/MathObject.cpp:
35659 (JSC::MathObject::getOwnPropertySlot):
35661 (JSC::setUpStaticFunctionSlot):
35663 (JSC::getStaticPropertySlot):
35665 2008-09-08 Sam Weinig <sam@webkit.org>
35667 Reviewed by Maciej Stachowiak and Oliver Hunt.
35669 Split storage of properties out of the PropertyMap and into the JSObject
35670 to allow sharing PropertyMap on the StructureID. In order to get this
35671 function correctly, the StructureID's transition mappings were changed to
35672 transition based on property name and attribute pairs, instead of just
35675 - Removes the single property optimization now that the PropertyMap is shared.
35676 This will be replaced by in-lining some values on the JSObject.
35678 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
35680 * JavaScriptCore.base.exp:
35682 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
35683 (JSC::CTI::privateCompileGetByIdProto): Ditto.
35684 (JSC::CTI::privateCompileGetByIdChain): Ditto.
35685 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
35686 * kjs/JSObject.cpp:
35687 (JSC::JSObject::mark): Mark the PropertyStorage.
35688 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
35689 (JSC::JSObject::deleteProperty): Ditto.
35690 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
35691 (JSC::JSObject::defineSetter): Ditto.
35692 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
35693 (JSC::JSObject::getPropertyNames): Ditto.
35694 (JSC::JSObject::removeDirect): Ditto.
35695 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
35696 (JSC::JSObject::propertyStorage): return the PropertyStorage.
35697 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
35698 (JSC::JSObject::getDirectLocation): Ditto.
35699 (JSC::JSObject::offsetForLocation): Compute location directly.
35700 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
35701 (JSC::JSObject::hasGetterSetterProperties): Ditto.
35702 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
35703 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
35704 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
35705 (JSC::JSObject::getOwnPropertySlot): Ditto.
35706 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
35707 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
35708 (JSC::PropertyMap::checkConsistency):
35709 (JSC::PropertyMap::operator=):
35710 (JSC::PropertyMap::~PropertyMap):
35711 (JSC::PropertyMap::get):
35712 (JSC::PropertyMap::getLocation):
35713 (JSC::PropertyMap::put):
35714 (JSC::PropertyMap::getOffset):
35715 (JSC::PropertyMap::insert):
35716 (JSC::PropertyMap::expand):
35717 (JSC::PropertyMap::rehash):
35718 (JSC::PropertyMap::createTable):
35719 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
35720 (JSC::PropertyMap::remove):
35721 (JSC::PropertyMap::getEnumerablePropertyNames):
35722 * kjs/PropertyMap.h:
35723 (JSC::PropertyMapEntry::PropertyMapEntry):
35724 (JSC::PropertyMap::isEmpty):
35725 (JSC::PropertyMap::size):
35726 (JSC::PropertyMap::makingCount):
35727 (JSC::PropertyMap::PropertyMap):
35729 * kjs/StructureID.cpp:
35730 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
35732 (JSC::StructureID::toDictionaryTransition): Copy the map.
35733 (JSC::StructureID::changePrototypeTransition): Copy the map.
35734 (JSC::StructureID::getterSetterTransition): Copy the map.
35735 (JSC::StructureID::~StructureID):
35736 * kjs/StructureID.h:
35737 (JSC::TransitionTableHash::hash): Custom hash for transition map.
35738 (JSC::TransitionTableHash::equal): Ditto.
35739 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
35740 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
35741 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
35742 (JSC::StructureID::propertyMap): Added.
35744 2008-09-08 Oliver Hunt <oliver@apple.com>
35746 Reviewed by Mark Rowe.
35748 Bug 20694: Slow Script error pops up when running Dromaeo tests
35750 Correct error in timeout logic where execution tick count would
35751 be reset to incorrect value due to incorrect offset and indirection.
35752 Codegen for the slow script dialog was factored out into a separate
35753 method (emitSlowScriptCheck) rather than having multiple copies of
35754 the same code. Also added calls to generate slow script checks
35755 for loop_if_less and loop_if_true opcodes.
35758 (JSC::CTI::emitSlowScriptCheck):
35759 (JSC::CTI::privateCompileMainPass):
35760 (JSC::CTI::privateCompileSlowCases):
35763 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35765 Reviewed by Maciej Stachowiak.
35767 Remove references to the removed WRECompiler class.
35772 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35774 Rubber-stamped by Mark Rowe.
35776 Fix the build with CTI enabled but WREC disabled.
35781 2008-09-08 Dan Bernstein <mitz@apple.com>
35786 (JSC::StatementNode::):
35787 (JSC::BlockNode::):
35789 2008-09-08 Kevin McCullough <kmccullough@apple.com>
35793 <rdar://problem/6134407> Breakpoints in for loops, while loops or
35794 conditions without curly braces don't break. (19306)
35795 -Statement Lists already emit debug hooks but conditionals without
35796 brackets are not lists.
35799 (KJS::IfNode::emitCode):
35800 (KJS::IfElseNode::emitCode):
35801 (KJS::DoWhileNode::emitCode):
35802 (KJS::WhileNode::emitCode):
35803 (KJS::ForNode::emitCode):
35804 (KJS::ForInNode::emitCode):
35806 (KJS::StatementNode::):
35807 (KJS::BlockNode::):
35809 2008-09-08 Maciej Stachowiak <mjs@apple.com>
35811 Reviewed by Anders Carlsson.
35813 - Cache the code generated for eval to speed up SunSpider and web sites
35814 https://bugs.webkit.org/show_bug.cgi?id=20718
35816 1.052x on SunSpider
35817 2.29x on date-format-tofte
35819 Lots of real sites seem to get many hits on this cache as well,
35820 including GMail, Google Spreadsheets, Slate and Digg (the last of
35821 these gets over 100 hits on initial page load).
35824 (JSC::EvalCodeCache::get):
35826 (JSC::Machine::callEval):
35827 (JSC::Machine::privateExecute):
35828 (JSC::Machine::cti_op_call_eval):
35831 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35833 Reviewed by Oliver Hunt.
35835 Bug 20711: Change KJS prefix on preprocessor macros to JSC
35836 <https://bugs.webkit.org/show_bug.cgi?id=20711>
35838 * kjs/CommonIdentifiers.cpp:
35839 (JSC::CommonIdentifiers::CommonIdentifiers):
35840 * kjs/CommonIdentifiers.h:
35841 * kjs/PropertySlot.h:
35842 (JSC::PropertySlot::getValue):
35843 (JSC::PropertySlot::putValue):
35844 (JSC::PropertySlot::setValueSlot):
35845 (JSC::PropertySlot::setValue):
35846 (JSC::PropertySlot::setRegisterSlot):
35851 (JSC::ExpressionNode::):
35852 (JSC::StatementNode::):
35854 (JSC::BooleanNode::):
35855 (JSC::NumberNode::):
35856 (JSC::ImmediateNumberNode::):
35857 (JSC::StringNode::):
35858 (JSC::RegExpNode::):
35860 (JSC::ResolveNode::):
35861 (JSC::ElementNode::):
35862 (JSC::ArrayNode::):
35863 (JSC::PropertyNode::):
35864 (JSC::PropertyListNode::):
35865 (JSC::ObjectLiteralNode::):
35866 (JSC::BracketAccessorNode::):
35867 (JSC::DotAccessorNode::):
35868 (JSC::ArgumentListNode::):
35869 (JSC::ArgumentsNode::):
35870 (JSC::NewExprNode::):
35871 (JSC::EvalFunctionCallNode::):
35872 (JSC::FunctionCallValueNode::):
35873 (JSC::FunctionCallResolveNode::):
35874 (JSC::FunctionCallBracketNode::):
35875 (JSC::FunctionCallDotNode::):
35876 (JSC::PrePostResolveNode::):
35877 (JSC::PostfixResolveNode::):
35878 (JSC::PostfixBracketNode::):
35879 (JSC::PostfixDotNode::):
35880 (JSC::PostfixErrorNode::):
35881 (JSC::DeleteResolveNode::):
35882 (JSC::DeleteBracketNode::):
35883 (JSC::DeleteDotNode::):
35884 (JSC::DeleteValueNode::):
35886 (JSC::TypeOfResolveNode::):
35887 (JSC::TypeOfValueNode::):
35888 (JSC::PrefixResolveNode::):
35889 (JSC::PrefixBracketNode::):
35890 (JSC::PrefixDotNode::):
35891 (JSC::PrefixErrorNode::):
35892 (JSC::UnaryPlusNode::):
35893 (JSC::NegateNode::):
35894 (JSC::BitwiseNotNode::):
35895 (JSC::LogicalNotNode::):
35901 (JSC::LeftShiftNode::):
35902 (JSC::RightShiftNode::):
35903 (JSC::UnsignedRightShiftNode::):
35905 (JSC::GreaterNode::):
35906 (JSC::LessEqNode::):
35907 (JSC::GreaterEqNode::):
35908 (JSC::ThrowableBinaryOpNode::):
35909 (JSC::InstanceOfNode::):
35911 (JSC::EqualNode::):
35912 (JSC::NotEqualNode::):
35913 (JSC::StrictEqualNode::):
35914 (JSC::NotStrictEqualNode::):
35915 (JSC::BitAndNode::):
35916 (JSC::BitOrNode::):
35917 (JSC::BitXOrNode::):
35918 (JSC::LogicalOpNode::):
35919 (JSC::ConditionalNode::):
35920 (JSC::ReadModifyResolveNode::):
35921 (JSC::AssignResolveNode::):
35922 (JSC::ReadModifyBracketNode::):
35923 (JSC::AssignBracketNode::):
35924 (JSC::AssignDotNode::):
35925 (JSC::ReadModifyDotNode::):
35926 (JSC::AssignErrorNode::):
35927 (JSC::CommaNode::):
35928 (JSC::VarDeclCommaNode::):
35929 (JSC::ConstDeclNode::):
35930 (JSC::ConstStatementNode::):
35931 (JSC::EmptyStatementNode::):
35932 (JSC::DebuggerStatementNode::):
35933 (JSC::ExprStatementNode::):
35934 (JSC::VarStatementNode::):
35936 (JSC::IfElseNode::):
35937 (JSC::DoWhileNode::):
35938 (JSC::WhileNode::):
35940 (JSC::ContinueNode::):
35941 (JSC::BreakNode::):
35942 (JSC::ReturnNode::):
35944 (JSC::LabelNode::):
35945 (JSC::ThrowNode::):
35947 (JSC::ParameterNode::):
35948 (JSC::ScopeNode::):
35949 (JSC::ProgramNode::):
35951 (JSC::FunctionBodyNode::):
35952 (JSC::FuncExprNode::):
35953 (JSC::FuncDeclNode::):
35954 (JSC::CaseClauseNode::):
35955 (JSC::ClauseListNode::):
35956 (JSC::CaseBlockNode::):
35957 (JSC::SwitchNode::):
35959 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35961 Reviewed by Maciej Stachowiak.
35963 Bug 20704: Replace the KJS namespace
35964 <https://bugs.webkit.org/show_bug.cgi?id=20704>
35966 Rename the KJS namespace to JSC. There are still some uses of KJS in
35967 preprocessor macros and comments, but these will also be changed some
35968 time in the near future.
35975 * API/JSCallbackConstructor.cpp:
35976 * API/JSCallbackConstructor.h:
35977 * API/JSCallbackFunction.cpp:
35978 * API/JSCallbackFunction.h:
35979 * API/JSCallbackObject.cpp:
35980 * API/JSCallbackObject.h:
35981 * API/JSCallbackObjectFunctions.h:
35982 * API/JSClassRef.cpp:
35983 (OpaqueJSClass::staticValues):
35984 (OpaqueJSClass::staticFunctions):
35985 * API/JSClassRef.h:
35986 * API/JSContextRef.cpp:
35987 * API/JSObjectRef.cpp:
35988 * API/JSProfilerPrivate.cpp:
35989 * API/JSStringRef.cpp:
35990 * API/JSValueRef.cpp:
35992 * API/OpaqueJSString.cpp:
35993 * API/OpaqueJSString.h:
35994 * JavaScriptCore.Debug.exp:
35995 * JavaScriptCore.base.exp:
35999 * VM/CodeBlock.cpp:
36001 * VM/CodeGenerator.cpp:
36002 * VM/CodeGenerator.h:
36003 * VM/ExceptionHelpers.cpp:
36004 * VM/ExceptionHelpers.h:
36005 * VM/Instruction.h:
36006 * VM/JSPropertyNameIterator.cpp:
36007 * VM/JSPropertyNameIterator.h:
36015 * VM/RegisterFile.cpp:
36016 * VM/RegisterFile.h:
36019 * VM/SamplingTool.cpp:
36020 * VM/SamplingTool.h:
36021 * VM/SegmentedVector.h:
36024 * kjs/Arguments.cpp:
36026 * kjs/ArrayConstructor.cpp:
36027 * kjs/ArrayConstructor.h:
36028 * kjs/ArrayPrototype.cpp:
36029 * kjs/ArrayPrototype.h:
36030 * kjs/BatchedTransitionOptimizer.h:
36031 * kjs/BooleanConstructor.cpp:
36032 * kjs/BooleanConstructor.h:
36033 * kjs/BooleanObject.cpp:
36034 * kjs/BooleanObject.h:
36035 * kjs/BooleanPrototype.cpp:
36036 * kjs/BooleanPrototype.h:
36037 * kjs/CallData.cpp:
36040 * kjs/CommonIdentifiers.cpp:
36041 * kjs/CommonIdentifiers.h:
36042 * kjs/ConstructData.cpp:
36043 * kjs/ConstructData.h:
36044 * kjs/DateConstructor.cpp:
36045 * kjs/DateConstructor.h:
36046 * kjs/DateInstance.cpp:
36047 (JSC::DateInstance::msToGregorianDateTime):
36048 * kjs/DateInstance.h:
36049 * kjs/DateMath.cpp:
36051 * kjs/DatePrototype.cpp:
36052 * kjs/DatePrototype.h:
36053 * kjs/DebuggerCallFrame.cpp:
36054 * kjs/DebuggerCallFrame.h:
36057 * kjs/ErrorConstructor.cpp:
36058 * kjs/ErrorConstructor.h:
36059 * kjs/ErrorInstance.cpp:
36060 * kjs/ErrorInstance.h:
36061 * kjs/ErrorPrototype.cpp:
36062 * kjs/ErrorPrototype.h:
36063 * kjs/ExecState.cpp:
36065 * kjs/FunctionConstructor.cpp:
36066 * kjs/FunctionConstructor.h:
36067 * kjs/FunctionPrototype.cpp:
36068 * kjs/FunctionPrototype.h:
36069 * kjs/GetterSetter.cpp:
36070 * kjs/GetterSetter.h:
36071 * kjs/GlobalEvalFunction.cpp:
36072 * kjs/GlobalEvalFunction.h:
36073 * kjs/IndexToNameMap.cpp:
36074 * kjs/IndexToNameMap.h:
36075 * kjs/InitializeThreading.cpp:
36076 * kjs/InitializeThreading.h:
36077 * kjs/InternalFunction.cpp:
36078 * kjs/InternalFunction.h:
36079 (JSC::InternalFunction::InternalFunction):
36080 * kjs/JSActivation.cpp:
36081 * kjs/JSActivation.h:
36086 * kjs/JSFunction.cpp:
36087 * kjs/JSFunction.h:
36088 (JSC::JSFunction::JSFunction):
36089 * kjs/JSGlobalData.cpp:
36090 (JSC::JSGlobalData::JSGlobalData):
36091 * kjs/JSGlobalData.h:
36092 * kjs/JSGlobalObject.cpp:
36093 * kjs/JSGlobalObject.h:
36094 * kjs/JSGlobalObjectFunctions.cpp:
36095 * kjs/JSGlobalObjectFunctions.h:
36096 * kjs/JSImmediate.cpp:
36097 * kjs/JSImmediate.h:
36100 * kjs/JSNotAnObject.cpp:
36101 * kjs/JSNotAnObject.h:
36102 * kjs/JSNumberCell.cpp:
36103 * kjs/JSNumberCell.h:
36104 * kjs/JSObject.cpp:
36106 * kjs/JSStaticScopeObject.cpp:
36107 * kjs/JSStaticScopeObject.h:
36108 * kjs/JSString.cpp:
36113 * kjs/JSVariableObject.cpp:
36114 * kjs/JSVariableObject.h:
36115 * kjs/JSWrapperObject.cpp:
36116 * kjs/JSWrapperObject.h:
36117 * kjs/LabelStack.cpp:
36118 * kjs/LabelStack.h:
36119 * kjs/MathObject.cpp:
36120 * kjs/MathObject.h:
36121 * kjs/NativeErrorConstructor.cpp:
36122 * kjs/NativeErrorConstructor.h:
36123 * kjs/NativeErrorPrototype.cpp:
36124 * kjs/NativeErrorPrototype.h:
36126 * kjs/NumberConstructor.cpp:
36127 * kjs/NumberConstructor.h:
36128 * kjs/NumberObject.cpp:
36129 * kjs/NumberObject.h:
36130 * kjs/NumberPrototype.cpp:
36131 * kjs/NumberPrototype.h:
36132 * kjs/ObjectConstructor.cpp:
36133 * kjs/ObjectConstructor.h:
36134 * kjs/ObjectPrototype.cpp:
36135 * kjs/ObjectPrototype.h:
36138 * kjs/PropertyMap.cpp:
36139 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
36140 * kjs/PropertyMap.h:
36141 * kjs/PropertyNameArray.cpp:
36142 * kjs/PropertyNameArray.h:
36143 * kjs/PropertySlot.cpp:
36144 * kjs/PropertySlot.h:
36145 * kjs/PrototypeFunction.cpp:
36146 * kjs/PrototypeFunction.h:
36147 * kjs/PutPropertySlot.h:
36148 * kjs/RegExpConstructor.cpp:
36149 * kjs/RegExpConstructor.h:
36150 * kjs/RegExpObject.cpp:
36151 * kjs/RegExpObject.h:
36152 * kjs/RegExpPrototype.cpp:
36153 * kjs/RegExpPrototype.h:
36154 * kjs/ScopeChain.cpp:
36155 * kjs/ScopeChain.h:
36156 * kjs/ScopeChainMark.h:
36159 * kjs/SmallStrings.cpp:
36160 * kjs/SmallStrings.h:
36161 * kjs/SourceProvider.h:
36162 * kjs/SourceRange.h:
36163 * kjs/StringConstructor.cpp:
36164 * kjs/StringConstructor.h:
36165 * kjs/StringObject.cpp:
36166 * kjs/StringObject.h:
36167 * kjs/StringObjectThatMasqueradesAsUndefined.h:
36168 * kjs/StringPrototype.cpp:
36169 * kjs/StringPrototype.h:
36170 * kjs/StructureID.cpp:
36171 * kjs/StructureID.h:
36172 * kjs/SymbolTable.h:
36173 * kjs/collector.cpp:
36175 * kjs/completion.h:
36176 * kjs/create_hash_table:
36177 * kjs/debugger.cpp:
36182 * kjs/identifier.cpp:
36183 * kjs/identifier.h:
36184 (JSC::Identifier::equal):
36185 * kjs/interpreter.cpp:
36186 * kjs/interpreter.h:
36188 (JSC::Lexer::Lexer):
36189 (JSC::Lexer::clear):
36190 (JSC::Lexer::makeIdentifier):
36196 * kjs/nodes2string.cpp:
36197 * kjs/operations.cpp:
36198 * kjs/operations.h:
36205 (JSC::IdentifierRepHash::hash):
36207 * masm/MacroAssembler.h:
36208 * masm/MacroAssemblerWin.cpp:
36209 * masm/X86Assembler.h:
36210 * pcre/pcre_exec.cpp:
36211 * profiler/CallIdentifier.h:
36213 * profiler/HeavyProfile.cpp:
36214 * profiler/HeavyProfile.h:
36215 * profiler/Profile.cpp:
36216 * profiler/Profile.h:
36217 * profiler/ProfileGenerator.cpp:
36218 * profiler/ProfileGenerator.h:
36219 * profiler/ProfileNode.cpp:
36220 * profiler/ProfileNode.h:
36221 * profiler/Profiler.cpp:
36222 * profiler/Profiler.h:
36223 * profiler/TreeProfile.cpp:
36224 * profiler/TreeProfile.h:
36229 2008-09-07 Maciej Stachowiak <mjs@apple.com>
36231 Reviewed by Dan Bernstein.
36233 - rename IA32MacroAssembler class to X86Assembler
36235 We otherwise call the platform X86, and also, I don't see any macros.
36237 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
36238 * JavaScriptCore.xcodeproj/project.pbxproj:
36239 * masm/IA32MacroAsm.h: Removed.
36240 * masm/MacroAssembler.h:
36241 (KJS::MacroAssembler::MacroAssembler):
36242 * masm/MacroAssemblerWin.cpp:
36243 (KJS::MacroAssembler::emitRestoreArgumentReference):
36244 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
36245 (KJS::X86Assembler::X86Assembler):
36247 (KJS::WRECGenerator::generateNonGreedyQuantifier):
36248 (KJS::WRECGenerator::generateGreedyQuantifier):
36249 (KJS::WRECGenerator::generateParentheses):
36250 (KJS::WRECGenerator::generateBackreference):
36251 (KJS::WRECGenerator::gernerateDisjunction):
36254 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
36258 Visual C++ seems to have some odd casting rules, so just convert the
36259 offending cast back to a C-style cast for now.
36261 * kjs/collector.cpp:
36262 (KJS::otherThreadStackPointer):
36264 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
36266 Reviewed by Mark Rowe.
36268 Attempt to fix the Windows build by using a const_cast to cast regs.Esp
36269 to a uintptr_t instead of a reinterpret_cast.
36271 * kjs/collector.cpp:
36272 (KJS::otherThreadStackPointer):
36274 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
36276 Reviewed by Sam Weinig.
36278 Remove C-style casts from kjs/collector.cpp.
36280 * kjs/collector.cpp:
36281 (KJS::Heap::heapAllocate):
36282 (KJS::currentThreadStackBase):
36283 (KJS::Heap::markConservatively):
36284 (KJS::otherThreadStackPointer):
36285 (KJS::Heap::markOtherThreadConservatively):
36286 (KJS::Heap::sweep):
36288 2008-09-07 Mark Rowe <mrowe@apple.com>
36290 Build fix for the debug variant.
36292 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
36294 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
36296 Reviewed by Timothy Hatcher.
36298 Remove C-style casts from the CTI code.
36301 (KJS::CTI::emitGetArg):
36302 (KJS::CTI::emitGetPutArg):
36303 (KJS::ctiRepatchCallByReturnAddress):
36304 (KJS::CTI::compileOpCall):
36305 (KJS::CTI::privateCompileMainPass):
36306 (KJS::CTI::privateCompileGetByIdSelf):
36307 (KJS::CTI::privateCompileGetByIdProto):
36308 (KJS::CTI::privateCompileGetByIdChain):
36309 (KJS::CTI::privateCompilePutByIdReplace):
36310 (KJS::CTI::privateArrayLengthTrampoline):
36311 (KJS::CTI::privateStringLengthTrampoline):
36313 === End merge of squirrelfish-extreme ===
36315 2008-09-06 Gavin Barraclough <barraclough@apple.com>
36317 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
36319 - refactor WREC to share more of the JIT infrastructure with CTI
36322 (KJS::CTI::emitGetArg):
36323 (KJS::CTI::emitGetPutArg):
36324 (KJS::CTI::emitPutArg):
36325 (KJS::CTI::emitPutArgConstant):
36326 (KJS::CTI::emitPutCTIParam):
36327 (KJS::CTI::emitGetCTIParam):
36328 (KJS::CTI::emitPutToCallFrameHeader):
36329 (KJS::CTI::emitGetFromCallFrameHeader):
36330 (KJS::CTI::emitPutResult):
36331 (KJS::CTI::emitDebugExceptionCheck):
36332 (KJS::CTI::emitJumpSlowCaseIfNotImm):
36333 (KJS::CTI::emitJumpSlowCaseIfNotImms):
36334 (KJS::CTI::emitFastArithDeTagImmediate):
36335 (KJS::CTI::emitFastArithReTagImmediate):
36336 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
36337 (KJS::CTI::emitFastArithImmToInt):
36338 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
36339 (KJS::CTI::emitFastArithIntToImmNoCheck):
36341 (KJS::CTI::compileOpCall):
36342 (KJS::CTI::privateCompileMainPass):
36343 (KJS::CTI::privateCompileSlowCases):
36344 (KJS::CTI::privateCompile):
36345 (KJS::CTI::privateCompileGetByIdSelf):
36346 (KJS::CTI::privateCompileGetByIdProto):
36347 (KJS::CTI::privateCompileGetByIdChain):
36348 (KJS::CTI::privateCompilePutByIdReplace):
36349 (KJS::CTI::privateArrayLengthTrampoline):
36350 (KJS::CTI::privateStringLengthTrampoline):
36351 (KJS::CTI::compileRegExp):
36353 (KJS::CallRecord::CallRecord):
36354 (KJS::JmpTable::JmpTable):
36355 (KJS::SlowCaseEntry::SlowCaseEntry):
36356 (KJS::CTI::JSRInfo::JSRInfo):
36358 (KJS::RegExp::RegExp):
36360 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
36361 (KJS::GeneratePatternCharacterFunctor::generateAtom):
36362 (KJS::GeneratePatternCharacterFunctor::backtrack):
36363 (KJS::GenerateCharacterClassFunctor::generateAtom):
36364 (KJS::GenerateCharacterClassFunctor::backtrack):
36365 (KJS::GenerateBackreferenceFunctor::generateAtom):
36366 (KJS::GenerateBackreferenceFunctor::backtrack):
36367 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
36368 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
36369 (KJS::WRECGenerate::generateBacktrack1):
36370 (KJS::WRECGenerate::generateBacktrackBackreference):
36371 (KJS::WRECGenerate::generateBackreferenceQuantifier):
36372 (KJS::WRECGenerate::generateNonGreedyQuantifier):
36373 (KJS::WRECGenerate::generateGreedyQuantifier):
36374 (KJS::WRECGenerate::generatePatternCharacter):
36375 (KJS::WRECGenerate::generateCharacterClassInvertedRange):
36376 (KJS::WRECGenerate::generateCharacterClassInverted):
36377 (KJS::WRECGenerate::generateCharacterClass):
36378 (KJS::WRECGenerate::generateParentheses):
36379 (KJS::WRECGenerate::generateParenthesesNonGreedy):
36380 (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
36381 (KJS::WRECGenerate::generateAssertionBOL):
36382 (KJS::WRECGenerate::generateAssertionEOL):
36383 (KJS::WRECGenerate::generateAssertionWordBoundary):
36384 (KJS::WRECGenerate::generateBackreference):
36385 (KJS::WRECGenerate::gernerateDisjunction):
36386 (KJS::WRECGenerate::terminateDisjunction):
36387 (KJS::WRECParser::parseGreedyQuantifier):
36388 (KJS::WRECParser::parseQuantifier):
36389 (KJS::WRECParser::parsePatternCharacterQualifier):
36390 (KJS::WRECParser::parseCharacterClassQuantifier):
36391 (KJS::WRECParser::parseBackreferenceQuantifier):
36392 (KJS::WRECParser::parseParentheses):
36393 (KJS::WRECParser::parseCharacterClass):
36394 (KJS::WRECParser::parseOctalEscape):
36395 (KJS::WRECParser::parseEscape):
36396 (KJS::WRECParser::parseTerm):
36397 (KJS::WRECParser::parseDisjunction):
36399 (KJS::WRECGenerate::WRECGenerate):
36400 (KJS::WRECParser::):
36401 (KJS::WRECParser::WRECParser):
36402 (KJS::WRECParser::parseAlternative):
36403 (KJS::WRECParser::isEndOfPattern):
36405 2008-09-06 Oliver Hunt <oliver@apple.com>
36407 Reviewed by NOBODY (Build fix).
36409 Fix the sampler build.
36411 * VM/SamplingTool.h:
36413 2008-09-06 Oliver Hunt <oliver@apple.com>
36415 Reviewed by Maciej Stachowiak.
36417 Jump through the necessary hoops required to make MSVC cooperate with SFX
36419 We now explicitly declare the calling convention on all cti_op_* cfunctions,
36420 and return int instead of bool where appropriate (despite the cdecl calling
36421 convention seems to state MSVC generates code that returns the result value
36422 through ecx). SFX behaves slightly differently under MSVC, specifically it
36423 stores the base argument address for the cti_op_* functions in the first
36424 argument, and then does the required stack manipulation through that pointer.
36425 This is necessary as MSVC's optimisations assume they have complete control
36426 of the stack, and periodically elide our stack manipulations, or move
36427 values in unexpected ways. MSVC also frequently produces tail calls which may
36428 clobber the first argument, so the MSVC path is slightly less efficient due
36429 to the need to restore it.
36431 * JavaScriptCore.xcodeproj/project.pbxproj:
36434 (KJS::CTI::compileOpCall):
36435 (KJS::CTI::privateCompileMainPass):
36436 (KJS::CTI::privateCompileSlowCases):
36440 * masm/MacroAssembler.h:
36441 (KJS::MacroAssembler::emitConvertToFastCall):
36442 * masm/MacroAssemblerIA32GCC.cpp: Removed.
36443 For performance reasons we need these no-op functions to be inlined.
36445 * masm/MacroAssemblerWin.cpp:
36446 (KJS::MacroAssembler::emitRestoreArgumentReference):
36449 2008-09-05 Geoffrey Garen <ggaren@apple.com>
36451 Reviewed by Maciej Stachowiak, or maybe the other way around.
36453 Added the ability to coalesce JITCode buffer grow operations by first
36454 growing the buffer and then executing unchecked puts to it.
36456 About a 2% speedup on date-format-tofte.
36459 (KJS::CTI::compileOpCall):
36460 * masm/IA32MacroAsm.h:
36461 (KJS::JITCodeBuffer::ensureSpace):
36462 (KJS::JITCodeBuffer::putByteUnchecked):
36463 (KJS::JITCodeBuffer::putByte):
36464 (KJS::JITCodeBuffer::putShortUnchecked):
36465 (KJS::JITCodeBuffer::putShort):
36466 (KJS::JITCodeBuffer::putIntUnchecked):
36467 (KJS::JITCodeBuffer::putInt):
36468 (KJS::IA32MacroAssembler::emitTestl_i32r):
36469 (KJS::IA32MacroAssembler::emitMovl_mr):
36470 (KJS::IA32MacroAssembler::emitMovl_rm):
36471 (KJS::IA32MacroAssembler::emitMovl_i32m):
36472 (KJS::IA32MacroAssembler::emitUnlinkedJe):
36473 (KJS::IA32MacroAssembler::emitModRm_rr):
36474 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
36475 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
36476 (KJS::IA32MacroAssembler::emitModRm_rm):
36477 (KJS::IA32MacroAssembler::emitModRm_opr):
36478 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
36479 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
36481 2008-09-05 Mark Rowe <mrowe@apple.com>
36483 Reviewed by Sam Weinig.
36485 Disable WREC and CTI on platforms that we have not yet had a chance to test with.
36489 2008-09-05 Geoffrey Garen <ggaren@apple.com>
36491 Reviewed by Sam Weinig.
36493 Use jo instead of a mask compare when fetching array.length and
36494 string.length. 4% speedup on array.length / string.length torture
36498 (KJS::CTI::privateArrayLengthTrampoline):
36499 (KJS::CTI::privateStringLengthTrampoline):
36501 2008-09-05 Geoffrey Garen <ggaren@apple.com>
36503 Reviewed by Sam Weinig.
36505 Removed a CTI compilation pass by recording labels during bytecode
36506 generation. This is more to reduce complexity than it is to improve
36509 SunSpider reports no change.
36511 CodeBlock now keeps a "labels" set, which holds the offsets of all the
36512 instructions that can be jumped to.
36514 * VM/CTI.cpp: Nixed a pass.
36516 * VM/CodeBlock.h: Added a "labels" set.
36518 * VM/LabelID.h: No need for a special LableID for holding jump
36519 destinations, since the CodeBlock now knows all jump destinations.
36521 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
36525 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
36527 2008-09-05 Mark Rowe <mrowe@apple.com>
36529 Reviewed by Oliver Hunt and Gavin Barraclough.
36531 Move the JITCodeBuffer onto Machine and remove the static variables.
36533 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
36535 (KJS::Machine::Machine): Allocate a JITCodeBuffer.
36537 * kjs/RegExpConstructor.cpp:
36538 (KJS::constructRegExp): Pass the ExecState through.
36539 * kjs/RegExpPrototype.cpp:
36540 (KJS::regExpProtoFuncCompile): Ditto.
36541 * kjs/StringPrototype.cpp:
36542 (KJS::stringProtoFuncMatch): Ditto.
36543 (KJS::stringProtoFuncSearch): Ditto.
36545 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
36546 so that we have access to an ExecState.
36548 (KJS::RegExpNode::):
36549 * kjs/nodes2string.cpp:
36551 (KJS::RegExp::RegExp): Pass the ExecState through.
36552 (KJS::RegExp::create): Ditto.
36554 * masm/IA32MacroAsm.h:
36555 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
36558 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
36561 2008-09-05 Mark Rowe <mrowe@apple.com>
36563 Reviewed by Oliver Hunt and Gavin Barraclough.
36565 Fix the build when CTI is disabled.
36567 * VM/CodeBlock.cpp:
36568 (KJS::CodeBlock::~CodeBlock):
36569 * VM/CodeGenerator.cpp:
36570 (KJS::prepareJumpTableForStringSwitch):
36572 (KJS::Machine::Machine):
36573 (KJS::Machine::~Machine):
36575 2008-09-05 Gavin Barraclough <barraclough@apple.com>
36577 Reviewed by Mark Rowe.
36579 Fix some windows abi issues.
36582 (KJS::CTI::privateCompileMainPass):
36583 (KJS::CTI::privateCompileSlowCases):
36585 (KJS::CallRecord::CallRecord):
36588 (KJS::Machine::cti_op_resolve_func):
36589 (KJS::Machine::cti_op_post_inc):
36590 (KJS::Machine::cti_op_resolve_with_base):
36591 (KJS::Machine::cti_op_post_dec):
36594 2008-09-05 Mark Rowe <mrowe@apple.com>
36596 Reviewed by Sam Weinig.
36598 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
36601 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
36602 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
36604 2008-09-04 Mark Rowe <mrowe@apple.com>
36606 Reviewed by Sam Weinig.
36608 Fix fast/dom/Window/console-functions.html.
36610 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
36611 such as console.log would use the line number of the last JS function on the call stack.
36614 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
36615 and restore it when the function is done.
36616 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
36618 2008-09-05 Oliver Hunt <oliver@apple.com>
36620 Start bringing up SFX on windows.
36622 Reviewed by Mark Rowe and Sam Weinig
36624 Start doing the work to bring up SFX on windows. Initially
36625 just working on WREC, as it does not make any calls so reduces
36626 the amount of code that needs to be corrected.
36628 Start abstracting the CTI JIT codegen engine.
36631 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
36632 * JavaScriptCore.xcodeproj/project.pbxproj:
36634 * masm/IA32MacroAsm.h:
36635 * masm/MacroAssembler.h: Added.
36636 (KJS::MacroAssembler::MacroAssembler):
36637 * masm/MacroAssemblerIA32GCC.cpp: Added.
36638 (KJS::MacroAssembler::emitConvertToFastCall):
36639 * masm/MacroAssemblerWin.cpp: Added.
36640 (KJS::MacroAssembler::emitConvertToFastCall):
36642 (KJS::WRECompiler::parseGreedyQuantifier):
36643 (KJS::WRECompiler::parseCharacterClass):
36644 (KJS::WRECompiler::parseEscape):
36645 (KJS::WRECompiler::compilePattern):
36648 2008-09-04 Gavin Barraclough <barraclough@apple.com>
36650 Reviewed by Sam Weinig.
36652 Support for slow scripts (timeout checking).
36655 (KJS::CTI::privateCompileMainPass):
36656 (KJS::CTI::privateCompile):
36658 (KJS::slideRegisterWindowForCall):
36659 (KJS::Machine::cti_timeout_check):
36660 (KJS::Machine::cti_vm_throw):
36662 2008-09-04 Sam Weinig <sam@webkit.org>
36664 Reviewed by Mark Rowe.
36666 Third round of style cleanup.
36675 2008-09-04 Sam Weinig <sam@webkit.org>
36677 Reviewed by Jon Honeycutt.
36679 Second round of style cleanup.
36685 2008-09-04 Sam Weinig <sam@webkit.org>
36687 Reviewed by Mark Rowe.
36689 First round of style cleanup.
36693 * masm/IA32MacroAsm.h:
36697 2008-09-04 Geoffrey Garen <ggaren@apple.com>
36699 Reviewed by Mark Rowe.
36701 Merged http://trac.webkit.org/changeset/36081 to work with CTI.
36704 (KJS::Machine::tryCtiCacheGetByID):
36706 2008-09-04 Gavin Barraclough <barraclough@apple.com>
36708 Reviewed by Sam Weinig.
36710 Enable profiling in CTI.
36714 (KJS::CTI::execute):
36716 (KJS::Machine::cti_op_call_JSFunction):
36717 (KJS::Machine::cti_op_call_NotJSFunction):
36718 (KJS::Machine::cti_op_ret):
36719 (KJS::Machine::cti_op_construct_JSConstruct):
36720 (KJS::Machine::cti_op_construct_NotJSConstruct):
36722 2008-09-04 Victor Hernandez <vhernandez@apple.com>
36724 Reviewed by Geoffrey Garen.
36726 Fixed an #if to support using WREC without CTI.
36729 (KJS::RegExp::match):
36731 2008-09-04 Gavin Barraclough <barraclough@apple.com>
36733 Reviewed by Oliver Hunt.
36735 The array/string length trampolines are owned by the Machine, not the codeblock that compiled them.
36738 (KJS::CTI::privateArrayLengthTrampoline):
36739 (KJS::CTI::privateStringLengthTrampoline):
36741 (KJS::Machine::~Machine):
36744 2008-09-04 Mark Rowe <mrowe@apple.com>
36746 Reviewed by Gavin Barraclough and Sam Weinig.
36748 Fix a crash on launch of jsc when GuardMalloc is enabled.
36750 * kjs/ScopeChain.h:
36751 (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain.
36752 (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref.
36754 2008-09-03 Oliver Hunt <oliver@apple.com>
36756 Reviewed by Gavin Barraclough and Geoff Garen.
36758 Fix inspector and fast array access so that it bounds
36762 (KJS::CTI::privateCompile_pass2_Main):
36763 * masm/IA32MacroAsm.h:
36764 (KJS::IA32MacroAssembler::):
36765 (KJS::IA32MacroAssembler::emitUnlinkedJb):
36766 (KJS::IA32MacroAssembler::emitUnlinkedJbe):
36768 2008-09-03 Mark Rowe <mrowe@apple.com>
36770 Move the assertion after the InitializeAndReturn block, as
36771 that is used even when CTI is enabled.
36774 (KJS::Machine::privateExecute):
36776 2008-09-03 Mark Rowe <mrowe@apple.com>
36778 Reviewed by Sam Weinig.
36780 Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED.
36783 (KJS::CTI::privateCompile_pass1_Scan):
36784 (KJS::CTI::privateCompile_pass2_Main):
36785 (KJS::CTI::privateCompile_pass4_SlowCases):
36787 (KJS::Machine::privateExecute):
36788 (KJS::Machine::cti_vm_throw):
36790 2008-09-03 Mark Rowe <mrowe@apple.com>
36792 Reviewed by Sam Weinig.
36794 Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved
36795 by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86)
36800 * VM/CodeBlock.cpp:
36801 (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for
36802 printing a ptrdiff_t.
36806 (KJS::RegExp::RegExp):
36807 (KJS::RegExp::~RegExp):
36808 (KJS::RegExp::match):
36810 * masm/IA32MacroAsm.h:
36813 * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to
36814 track whether any MASM-using features are enabled.
36816 2008-09-03 Gavin Barraclough <barraclough@apple.com>
36818 Reviewed by Oliver Hunt.
36820 Copy Geoff's array/string length optimization for CTI.
36823 (KJS::CTI::privateArrayLengthTrampoline):
36824 (KJS::CTI::privateStringLengthTrampoline):
36826 (KJS::CTI::compileArrayLengthTrampoline):
36827 (KJS::CTI::compileStringLengthTrampoline):
36829 (KJS::Machine::Machine):
36830 (KJS::Machine::getCtiArrayLengthTrampoline):
36831 (KJS::Machine::getCtiStringLengthTrampoline):
36832 (KJS::Machine::tryCtiCacheGetByID):
36833 (KJS::Machine::cti_op_get_by_id_second):
36838 2008-09-03 Gavin Barraclough <barraclough@apple.com>
36840 Reviewed by Oliver Hunt.
36842 Implement fast array accesses in CTI - 2-3% progression on sunspider.
36845 (KJS::CTI::emitFastArithIntToImmNoCheck):
36846 (KJS::CTI::compileOpCall):
36847 (KJS::CTI::privateCompile_pass2_Main):
36848 (KJS::CTI::privateCompile_pass4_SlowCases):
36852 2008-09-02 Gavin Barraclough <barraclough@apple.com>
36854 Reviewed by Oliver Hunt.
36856 Enable fast property access support in CTI.
36859 (KJS::ctiSetReturnAddress):
36860 (KJS::ctiRepatchCallByReturnAddress):
36861 (KJS::CTI::privateCompile_pass2_Main):
36862 (KJS::CTI::privateCompile):
36863 (KJS::CTI::privateCompileGetByIdSelf):
36864 (KJS::CTI::privateCompileGetByIdProto):
36865 (KJS::CTI::privateCompileGetByIdChain):
36866 (KJS::CTI::privateCompilePutByIdReplace):
36868 (KJS::CTI::compileGetByIdSelf):
36869 (KJS::CTI::compileGetByIdProto):
36870 (KJS::CTI::compileGetByIdChain):
36871 (KJS::CTI::compilePutByIdReplace):
36872 * VM/CodeBlock.cpp:
36873 (KJS::CodeBlock::~CodeBlock):
36876 (KJS::doSetReturnAddressVmThrowTrampoline):
36877 (KJS::Machine::tryCtiCachePutByID):
36878 (KJS::Machine::tryCtiCacheGetByID):
36879 (KJS::Machine::cti_op_put_by_id):
36880 (KJS::Machine::cti_op_put_by_id_second):
36881 (KJS::Machine::cti_op_put_by_id_generic):
36882 (KJS::Machine::cti_op_put_by_id_fail):
36883 (KJS::Machine::cti_op_get_by_id):
36884 (KJS::Machine::cti_op_get_by_id_second):
36885 (KJS::Machine::cti_op_get_by_id_generic):
36886 (KJS::Machine::cti_op_get_by_id_fail):
36887 (KJS::Machine::cti_op_throw):
36888 (KJS::Machine::cti_vm_throw):
36892 * kjs/PropertyMap.h:
36893 * kjs/StructureID.cpp:
36894 (KJS::StructureIDChain::StructureIDChain):
36895 * masm/IA32MacroAsm.h:
36896 (KJS::IA32MacroAssembler::emitCmpl_i32m):
36897 (KJS::IA32MacroAssembler::emitMovl_mr):
36898 (KJS::IA32MacroAssembler::emitMovl_rm):
36900 2008-09-02 Sam Weinig <sam@webkit.org>
36902 Reviewed by Gavin Barraclough and Mark Rowe.
36904 A backslash (\) at the of a RegEx should produce an error.
36905 Fixes fast/regex/test1.html.
36908 (KJS::WRECompiler::parseEscape):
36910 2008-09-02 Sam Weinig <sam@webkit.org>
36912 Reviewed by Geoff Garen.
36914 Link jumps for the slow case of op_loop_if_less. Fixes acid3.
36917 (KJS::CTI::privateCompile_pass4_SlowCases):
36919 2008-09-01 Sam Weinig <sam@webkit.org>
36921 Rubber-stamped by Maciej Stachowiak.
36923 Switch WREC on by default.
36927 2008-09-01 Sam Weinig <sam@webkit.org>
36929 Reviewed by Mark Rowe.
36931 Fix two failures in fast/regex/test1.html
36932 - \- in a character class should be treated as a literal -
36933 - A missing max quantifier needs to be treated differently than
36934 a null max quantifier.
36937 (KJS::WRECompiler::generateNonGreedyQuantifier):
36938 (KJS::WRECompiler::generateGreedyQuantifier):
36939 (KJS::WRECompiler::parseCharacterClass):
36941 (KJS::Quantifier::Quantifier):
36943 2008-09-01 Sam Weinig <sam@webkit.org>
36945 Reviewed by Mark Rowe.
36947 Fix crash in fast/js/kde/evil-n.html
36949 * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function.
36951 2008-09-01 Sam Weinig <sam@webkit.org>
36953 Reviewed by Gavin Barraclough and Mark Rowe.
36955 Add pattern length limit fixing one test in fast/js.
36958 (KJS::WRECompiler::compile):
36960 (KJS::WRECompiler::):
36962 2008-09-01 Sam Weinig <sam@webkit.org>
36964 Reviewed by Gavin Barraclough and Mark Rowe.
36966 Make octal escape parsing/back-reference parsing more closely match
36967 prior behavior fixing one test in fast/js.
36970 (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped
36971 (KJS::WRECompiler::parseEscape):
36973 (KJS::WRECompiler::peekDigit):
36975 2008-09-01 Sam Weinig <sam@webkit.org>
36977 Reviewed by Gavin Barraclough and Mark Rowe.
36979 Fix one mozilla test.
36982 (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not
36985 2008-09-01 Sam Weinig <sam@webkit.org>
36987 Reviewed by Gavin Barraclough and Mark Rowe.
36989 Parse octal escapes in character classes fixing one mozilla test.
36992 (KJS::WRECompiler::parseCharacterClass):
36993 (KJS::WRECompiler::parseOctalEscape):
36995 (KJS::WRECompiler::consumeOctal):
36997 2008-09-01 Sam Weinig <sam@webkit.org>
36999 Reviewed by Oliver Hunt.
37001 Fixes two mozilla tests with WREC enabled.
37004 (KJS::CharacterClassConstructor::append): Keep the character class sorted
37005 when appending another character class.
37007 2008-09-01 Sam Weinig <sam@webkit.org>
37009 Reviewed by Gavin Barraclough and Mark Rowe.
37011 Fixes two mozilla tests with WREC enabled.
37014 (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position
37015 instead of appending it to the end.
37017 2008-09-01 Gavin Barraclough <barraclough@apple.com>
37019 Reviewed by Oliver Hunt.
37021 Move cross-compilation unit call into NEVER_INLINE function.
37024 (KJS::doSetReturnAddressVmThrowTrampoline):
37026 2008-09-01 Sam Weinig <sam@webkit.org>
37028 Reviewed by Gavin Barraclough and Geoff Garen.
37030 Fix one test in fast/js.
37033 (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError,
37034 instead of a createNotAFunctionError.
37036 2008-08-31 Gavin Barraclough <barraclough@apple.com>
37038 Reviewed by Maciej Stachowiak.
37040 Zero-cost exception handling. This patch takes the exception checking
37041 back of the hot path. When an exception occurs in a Machine::cti*
37042 method, the return address to JIT code is recorded, and is then
37043 overwritten with a pointer to a trampoline routine. When the method
37044 returns the trampoline will cause the cti_vm_throw method to be invoked.
37046 cti_vm_throw uses the return address preserved above, to discover the
37047 vPC of the bytecode that raised the exception (using a map build during
37048 translation). From the VPC of the faulting bytecode the vPC of a catch
37049 routine may be discovered (unwinding the stack where necesary), and then
37050 a bytecode address for the catch routine is looked up. Final cti_vm_throw
37051 overwrites its return address to JIT code again, to trampoline directly
37052 to the catch routine.
37054 cti_op_throw is handled in a similar fashion.
37057 (KJS::CTI::emitPutCTIParam):
37058 (KJS::CTI::emitPutToCallFrameHeader):
37059 (KJS::CTI::emitGetFromCallFrameHeader):
37060 (KJS::ctiSetReturnAddressForArgs):
37061 (KJS::CTI::emitDebugExceptionCheck):
37062 (KJS::CTI::printOpcodeOperandTypes):
37063 (KJS::CTI::emitCall):
37064 (KJS::CTI::compileOpCall):
37065 (KJS::CTI::privateCompile_pass2_Main):
37066 (KJS::CTI::privateCompile):
37068 (KJS::CallRecord::CallRecord):
37070 (KJS::CTI::execute):
37073 (KJS::Machine::privateExecute):
37074 (KJS::Machine::cti_op_instanceof):
37075 (KJS::Machine::cti_op_call_NotJSFunction):
37076 (KJS::Machine::cti_op_resolve):
37077 (KJS::Machine::cti_op_resolve_func):
37078 (KJS::Machine::cti_op_resolve_skip):
37079 (KJS::Machine::cti_op_resolve_with_base):
37080 (KJS::Machine::cti_op_throw):
37081 (KJS::Machine::cti_op_in):
37082 (KJS::Machine::cti_vm_throw):
37083 * VM/RegisterFile.h:
37084 (KJS::RegisterFile::):
37086 (KJS::ExecState::setCtiReturnAddress):
37087 (KJS::ExecState::ctiReturnAddress):
37088 * masm/IA32MacroAsm.h:
37089 (KJS::IA32MacroAssembler::):
37090 (KJS::IA32MacroAssembler::emitPushl_m):
37091 (KJS::IA32MacroAssembler::emitPopl_m):
37092 (KJS::IA32MacroAssembler::getRelocatedAddress):
37094 2008-08-31 Mark Rowe <mrowe@apple.com>
37096 Reviewed by Oliver Hunt.
37098 Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them.
37101 (KJS::WRECompiler::parseParentheses):
37103 (KJS::WRECompiler::):
37105 2008-08-31 Mark Rowe <mrowe@apple.com>
37107 Reviewed by Oliver Hunt.
37109 Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled.
37112 (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum.
37113 (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register.
37114 (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag.
37116 2008-08-30 Mark Rowe <mrowe@apple.com>
37118 Reviewed by Oliver Hunt.
37120 Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance.
37121 This shows up as a 0.6% progression on SunSpider on my machine.
37123 Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out.
37126 (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc.
37127 * kjs/regexp.cpp: Ditto.
37128 * masm/IA32MacroAsm.h:
37129 (KJS::JITCodeBuffer::growBuffer):
37130 (KJS::JITCodeBuffer::JITCodeBuffer):
37131 (KJS::JITCodeBuffer::~JITCodeBuffer):
37132 (KJS::JITCodeBuffer::putByte):
37133 (KJS::JITCodeBuffer::putShort):
37134 (KJS::JITCodeBuffer::putInt):
37135 (KJS::JITCodeBuffer::reset):
37136 (KJS::JITCodeBuffer::copy):
37138 2008-08-29 Oliver Hunt <oliver@apple.com>
37142 Roll out previous patch as it causes a 5% performance regression
37144 * JavaScriptCore.xcodeproj/project.pbxproj:
37147 (KJS::CTI::privateCompile):
37149 (KJS::CodeBlock::~CodeBlock):
37150 * masm/IA32MacroAsm.h:
37151 (KJS::JITCodeBuffer::JITCodeBuffer):
37152 (KJS::JITCodeBuffer::putByte):
37153 (KJS::JITCodeBuffer::putShort):
37154 (KJS::JITCodeBuffer::putInt):
37155 (KJS::JITCodeBuffer::getEIP):
37156 (KJS::JITCodeBuffer::start):
37157 (KJS::JITCodeBuffer::getOffset):
37158 (KJS::JITCodeBuffer::reset):
37159 (KJS::JITCodeBuffer::copy):
37160 (KJS::IA32MacroAssembler::emitModRm_rr):
37161 (KJS::IA32MacroAssembler::emitModRm_rm):
37162 (KJS::IA32MacroAssembler::emitModRm_rmsib):
37163 (KJS::IA32MacroAssembler::IA32MacroAssembler):
37164 (KJS::IA32MacroAssembler::emitInt3):
37165 (KJS::IA32MacroAssembler::emitPushl_r):
37166 (KJS::IA32MacroAssembler::emitPopl_r):
37167 (KJS::IA32MacroAssembler::emitMovl_rr):
37168 (KJS::IA32MacroAssembler::emitAddl_rr):
37169 (KJS::IA32MacroAssembler::emitAddl_i8r):
37170 (KJS::IA32MacroAssembler::emitAddl_i32r):
37171 (KJS::IA32MacroAssembler::emitAddl_mr):
37172 (KJS::IA32MacroAssembler::emitAndl_rr):
37173 (KJS::IA32MacroAssembler::emitAndl_i32r):
37174 (KJS::IA32MacroAssembler::emitCmpl_i8r):
37175 (KJS::IA32MacroAssembler::emitCmpl_rr):
37176 (KJS::IA32MacroAssembler::emitCmpl_rm):
37177 (KJS::IA32MacroAssembler::emitCmpl_i32r):
37178 (KJS::IA32MacroAssembler::emitCmpl_i32m):
37179 (KJS::IA32MacroAssembler::emitCmpw_rm):
37180 (KJS::IA32MacroAssembler::emitOrl_rr):
37181 (KJS::IA32MacroAssembler::emitOrl_i8r):
37182 (KJS::IA32MacroAssembler::emitSubl_rr):
37183 (KJS::IA32MacroAssembler::emitSubl_i8r):
37184 (KJS::IA32MacroAssembler::emitSubl_i32r):
37185 (KJS::IA32MacroAssembler::emitSubl_mr):
37186 (KJS::IA32MacroAssembler::emitTestl_i32r):
37187 (KJS::IA32MacroAssembler::emitTestl_rr):
37188 (KJS::IA32MacroAssembler::emitXorl_i8r):
37189 (KJS::IA32MacroAssembler::emitXorl_rr):
37190 (KJS::IA32MacroAssembler::emitSarl_i8r):
37191 (KJS::IA32MacroAssembler::emitSarl_CLr):
37192 (KJS::IA32MacroAssembler::emitShl_i8r):
37193 (KJS::IA32MacroAssembler::emitShll_CLr):
37194 (KJS::IA32MacroAssembler::emitMull_rr):
37195 (KJS::IA32MacroAssembler::emitIdivl_r):
37196 (KJS::IA32MacroAssembler::emitCdq):
37197 (KJS::IA32MacroAssembler::emitMovl_mr):
37198 (KJS::IA32MacroAssembler::emitMovzwl_mr):
37199 (KJS::IA32MacroAssembler::emitMovl_rm):
37200 (KJS::IA32MacroAssembler::emitMovl_i32r):
37201 (KJS::IA32MacroAssembler::emitMovl_i32m):
37202 (KJS::IA32MacroAssembler::emitLeal_mr):
37203 (KJS::IA32MacroAssembler::emitRet):
37204 (KJS::IA32MacroAssembler::emitJmpN_r):
37205 (KJS::IA32MacroAssembler::emitJmpN_m):
37206 (KJS::IA32MacroAssembler::emitCall):
37207 (KJS::IA32MacroAssembler::label):
37208 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
37209 (KJS::IA32MacroAssembler::emitUnlinkedJne):
37210 (KJS::IA32MacroAssembler::emitUnlinkedJe):
37211 (KJS::IA32MacroAssembler::emitUnlinkedJl):
37212 (KJS::IA32MacroAssembler::emitUnlinkedJle):
37213 (KJS::IA32MacroAssembler::emitUnlinkedJge):
37214 (KJS::IA32MacroAssembler::emitUnlinkedJae):
37215 (KJS::IA32MacroAssembler::emitUnlinkedJo):
37216 (KJS::IA32MacroAssembler::link):
37218 (KJS::WRECompiler::compilePattern):
37219 (KJS::WRECompiler::compile):
37222 2008-08-29 Mark Rowe <mrowe@apple.com>
37224 Reviewed by Oliver Hunt.
37226 Have JITCodeBuffer manage a Vector containing the generated code so that it can grow
37227 as needed when generating code for a large function. This fixes all six remaining failures
37228 in Mozilla tests in both debug and release builds.
37231 (KJS::CTI::privateCompile):
37233 (KJS::CodeBlock::~CodeBlock):
37234 * masm/IA32MacroAsm.h:
37235 (KJS::JITCodeBuffer::putByte):
37236 (KJS::JITCodeBuffer::putShort):
37237 (KJS::JITCodeBuffer::putInt):
37238 (KJS::JITCodeBuffer::getEIP):
37239 (KJS::JITCodeBuffer::start):
37240 (KJS::JITCodeBuffer::getOffset):
37241 (KJS::JITCodeBuffer::getCode):
37242 (KJS::IA32MacroAssembler::emitModRm_rr):
37244 (KJS::WRECompiler::compilePattern):
37247 2008-08-29 Mark Rowe <mrowe@apple.com>
37249 Reviewed by Oliver Hunt.
37251 Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests.
37254 (KJS::WRECompiler::parseOctalEscape):
37255 (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero.
37256 Add a FIXME about treating invalid backreferences as octal escapes in the future.
37258 (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than
37260 * wtf/ASCIICType.h:
37261 (WTF::isASCIIOctalDigit):
37263 2008-08-29 Sam Weinig <sam@webkit.org>
37265 Reviewed by Mark Rowe.
37267 Pass vPC to instanceof method. Fixes 2 mozilla tests in debug.
37270 (KJS::CTI::privateCompile_pass2_Main):
37272 (KJS::Machine::cti_op_instanceof):
37274 2008-08-29 Sam Weinig <sam@webkit.org>
37276 Reviewed by Mark Rowe.
37278 Pass vPCs to resolve methods for correct exception creation. Fixes
37279 17 mozilla tests in debug.
37282 (KJS::CTI::privateCompile_pass2_Main):
37285 (KJS::Machine::cti_op_resolve):
37286 (KJS::Machine::cti_op_resolve_func):
37287 (KJS::Machine::cti_op_resolve_skip):
37288 (KJS::Machine::cti_op_resolve_with_base):
37290 2008-08-29 Gavin Barraclough <barraclough@apple.com>
37292 Reviewed by Oliver Hunt.
37294 Remembering to actually throw the exception passed to op throw helps.
37295 Regressions 19 -> 6.
37298 (KJS::Machine::cti_op_throw):
37299 (KJS::Machine::cti_vm_throw):
37301 2008-08-29 Gavin Barraclough <barraclough@apple.com>
37303 Reviewed by Sam Weinig.
37305 Support for exception unwinding the stack.
37307 Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address
37308 is now preserved on entry to a JIT code function (if we preserve lazily we need
37309 restore the native return address during exception stack unwind). This takes
37310 the number of regressions down from ~150 to 19.
37314 (KJS::CTI::emitExceptionCheck):
37315 (KJS::CTI::compileOpCall):
37316 (KJS::CTI::privateCompile_pass2_Main):
37317 (KJS::CTI::privateCompile):
37321 (KJS::Machine::throwException):
37322 (KJS::Machine::cti_op_call_JSFunction):
37323 (KJS::Machine::cti_op_call_NotJSFunction):
37324 (KJS::Machine::cti_op_construct_JSConstruct):
37325 (KJS::Machine::cti_op_construct_NotJSConstruct):
37326 (KJS::Machine::cti_op_throw):
37327 (KJS::Machine::cti_vm_throw):
37329 2008-08-29 Mark Rowe <mrowe@apple.com>
37331 Reviewed by Oliver Hunt.
37333 Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled.
37336 (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches
37337 succeeded, jump to failure.
37338 (KJS::WRECompiler::compilePattern): Restore and increment the current position stored
37339 on the stack to ensure that it will be reset to the correct position after a failed
37340 match has consumed input.
37342 2008-08-29 Mark Rowe <mrowe@apple.com>
37344 Reviewed by Oliver Hunt.
37346 Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled.
37347 A backreference with a quantifier would get stuck in an infinite
37348 loop if the captured range was empty.
37351 (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range
37352 was empty, do not attempt to match the backreference.
37353 (KJS::WRECompiler::parseBackreferenceQuantifier):
37355 (KJS::Quantifier::):
37357 2008-08-28 Sam Weinig <sam@webkit.org>
37359 Reviewed by Oliver Hunt.
37361 Implement op_debug.
37364 (KJS::CTI::privateCompile_pass1_Scan):
37365 (KJS::CTI::privateCompile_pass2_Main):
37367 (KJS::Machine::debug):
37368 (KJS::Machine::privateExecute):
37369 (KJS::Machine::cti_op_debug):
37372 2008-08-28 Sam Weinig <sam@webkit.org>
37374 Reviewed by Gavin Barraclough and Geoff Garen.
37376 Implement op_switch_string fixing 1 mozilla test and one test in fast/js.
37379 (KJS::CTI::privateCompile_pass1_Scan):
37380 (KJS::CTI::privateCompile_pass2_Main):
37381 (KJS::CTI::privateCompile):
37383 (KJS::SwitchRecord::):
37384 (KJS::SwitchRecord::SwitchRecord):
37385 * VM/CodeBlock.cpp:
37386 (KJS::CodeBlock::dump):
37388 (KJS::ExpressionRangeInfo::):
37389 (KJS::StringJumpTable::offsetForValue):
37390 (KJS::StringJumpTable::ctiForValue):
37391 (KJS::SimpleJumpTable::add):
37392 (KJS::SimpleJumpTable::ctiForValue):
37393 * VM/CodeGenerator.cpp:
37394 (KJS::prepareJumpTableForStringSwitch):
37396 (KJS::Machine::privateExecute):
37397 (KJS::Machine::cti_op_switch_string):
37400 2008-08-28 Gavin Barraclough <barraclough@apple.com>
37402 Reviewed by Oliver Hunt.
37404 Do not recurse on the machine stack when executing op_call.
37407 (KJS::CTI::emitGetPutArg):
37408 (KJS::CTI::emitPutArg):
37409 (KJS::CTI::emitPutArgConstant):
37410 (KJS::CTI::compileOpCall):
37411 (KJS::CTI::privateCompile_pass2_Main):
37412 (KJS::CTI::privateCompile):
37415 (KJS::CTI::compile):
37416 (KJS::CTI::execute):
37419 (KJS::Machine::Machine):
37420 (KJS::Machine::execute):
37421 (KJS::Machine::cti_op_call_JSFunction):
37422 (KJS::Machine::cti_op_call_NotJSFunction):
37423 (KJS::Machine::cti_op_ret):
37424 (KJS::Machine::cti_op_construct_JSConstruct):
37425 (KJS::Machine::cti_op_construct_NotJSConstruct):
37426 (KJS::Machine::cti_op_call_eval):
37429 (KJS::Register::Register):
37430 * VM/RegisterFile.h:
37431 (KJS::RegisterFile::):
37432 * kjs/InternalFunction.h:
37433 (KJS::InternalFunction::InternalFunction):
37434 * kjs/JSFunction.h:
37435 (KJS::JSFunction::JSFunction):
37436 * kjs/ScopeChain.h:
37437 (KJS::ScopeChain::ScopeChain):
37438 * masm/IA32MacroAsm.h:
37439 (KJS::IA32MacroAssembler::):
37440 (KJS::IA32MacroAssembler::emitModRm_opm):
37441 (KJS::IA32MacroAssembler::emitCmpl_i32m):
37442 (KJS::IA32MacroAssembler::emitCallN_r):
37444 2008-08-28 Sam Weinig <sam@webkit.org>
37446 Reviewed by Mark Rowe.
37448 Exit instead of crashing in ctiUnsupported and ctiTimedOut.
37451 (KJS::ctiUnsupported):
37452 (KJS::ctiTimedOut):
37454 2008-08-28 Oliver Hunt <oliver@apple.com>
37456 Reviewed by Maciej Stachowiak.
37458 Implement codegen for op_jsr and op_sret.
37461 (KJS::CTI::privateCompile_pass1_Scan):
37462 (KJS::CTI::privateCompile_pass2_Main):
37463 (KJS::CTI::privateCompile):
37465 (KJS::CTI::JSRInfo::JSRInfo):
37466 * masm/IA32MacroAsm.h:
37467 (KJS::IA32MacroAssembler::emitJmpN_m):
37468 (KJS::IA32MacroAssembler::linkAbsoluteAddress):
37470 2008-08-28 Gavin Barraclough <barraclough@apple.com>
37472 Reviewed by Oliver Hunt.
37474 Initial support for exceptions (throw / catch must occur in same CodeBlock).
37477 (KJS::CTI::emitExceptionCheck):
37478 (KJS::CTI::emitCall):
37479 (KJS::CTI::privateCompile_pass2_Main):
37480 (KJS::CTI::privateCompile_pass4_SlowCases):
37481 (KJS::CTI::privateCompile):
37483 * VM/CodeBlock.cpp:
37484 (KJS::CodeBlock::nativeExceptionCodeForHandlerVPC):
37486 * VM/CodeGenerator.cpp:
37487 (KJS::CodeGenerator::emitCatch):
37489 (KJS::Machine::throwException):
37490 (KJS::Machine::privateExecute):
37491 (KJS::ctiUnsupported):
37492 (KJS::ctiTimedOut):
37493 (KJS::Machine::cti_op_add):
37494 (KJS::Machine::cti_op_pre_inc):
37495 (KJS::Machine::cti_timeout_check):
37496 (KJS::Machine::cti_op_loop_if_less):
37497 (KJS::Machine::cti_op_put_by_id):
37498 (KJS::Machine::cti_op_get_by_id):
37499 (KJS::Machine::cti_op_instanceof):
37500 (KJS::Machine::cti_op_del_by_id):
37501 (KJS::Machine::cti_op_mul):
37502 (KJS::Machine::cti_op_call):
37503 (KJS::Machine::cti_op_resolve):
37504 (KJS::Machine::cti_op_construct):
37505 (KJS::Machine::cti_op_get_by_val):
37506 (KJS::Machine::cti_op_resolve_func):
37507 (KJS::Machine::cti_op_sub):
37508 (KJS::Machine::cti_op_put_by_val):
37509 (KJS::Machine::cti_op_lesseq):
37510 (KJS::Machine::cti_op_loop_if_true):
37511 (KJS::Machine::cti_op_negate):
37512 (KJS::Machine::cti_op_resolve_skip):
37513 (KJS::Machine::cti_op_div):
37514 (KJS::Machine::cti_op_pre_dec):
37515 (KJS::Machine::cti_op_jless):
37516 (KJS::Machine::cti_op_not):
37517 (KJS::Machine::cti_op_jtrue):
37518 (KJS::Machine::cti_op_post_inc):
37519 (KJS::Machine::cti_op_eq):
37520 (KJS::Machine::cti_op_lshift):
37521 (KJS::Machine::cti_op_bitand):
37522 (KJS::Machine::cti_op_rshift):
37523 (KJS::Machine::cti_op_bitnot):
37524 (KJS::Machine::cti_op_resolve_with_base):
37525 (KJS::Machine::cti_op_mod):
37526 (KJS::Machine::cti_op_less):
37527 (KJS::Machine::cti_op_neq):
37528 (KJS::Machine::cti_op_post_dec):
37529 (KJS::Machine::cti_op_urshift):
37530 (KJS::Machine::cti_op_bitxor):
37531 (KJS::Machine::cti_op_bitor):
37532 (KJS::Machine::cti_op_call_eval):
37533 (KJS::Machine::cti_op_throw):
37534 (KJS::Machine::cti_op_push_scope):
37535 (KJS::Machine::cti_op_stricteq):
37536 (KJS::Machine::cti_op_nstricteq):
37537 (KJS::Machine::cti_op_to_jsnumber):
37538 (KJS::Machine::cti_op_in):
37539 (KJS::Machine::cti_op_del_by_val):
37540 (KJS::Machine::cti_vm_throw):
37543 * masm/IA32MacroAsm.h:
37544 (KJS::IA32MacroAssembler::emitCmpl_i32m):
37546 2008-08-28 Mark Rowe <mrowe@apple.com>
37548 Rubber-stamped by Oliver Hunt.
37550 Print debugging info to stderr so that run-webkit-tests can capture it.
37551 This makes it easy to check whether test failures are due to unimplemented
37552 op codes, missing support for exceptions, etc.
37555 (KJS::CTI::privateCompile_pass1_Scan):
37556 (KJS::CTI::printOpcodeOperandTypes):
37557 (KJS::CTI::privateCompile_pass2_Main):
37558 (KJS::CTI::privateCompile_pass4_SlowCases):
37559 (KJS::CTI::privateCompile):
37561 (KJS::Machine::privateExecute):
37562 (KJS::ctiException):
37563 (KJS::ctiUnsupported):
37564 (KJS::Machine::cti_op_call):
37565 (KJS::Machine::cti_op_resolve):
37566 (KJS::Machine::cti_op_construct):
37567 (KJS::Machine::cti_op_get_by_val):
37568 (KJS::Machine::cti_op_resolve_func):
37569 (KJS::Machine::cti_op_resolve_skip):
37570 (KJS::Machine::cti_op_resolve_with_base):
37571 (KJS::Machine::cti_op_call_eval):
37573 2008-08-27 Mark Rowe <mrowe@apple.com>
37575 Reviewed by Gavin Barraclough and Maciej Stachowiak.
37577 Fix fast/js/bitwise-and-on-undefined.html.
37579 A temporary value in the slow path of op_bitand was being stored in edx, but was
37580 being clobbered by emitGetPutArg before we used it. To fix this, emitGetPutArg
37581 now takes a third argument that specifies the scratch register to use when loading
37582 from memory. This allows us to avoid clobbering the temporary in op_bitand.
37585 (KJS::CTI::emitGetPutArg):
37586 (KJS::CTI::privateCompile_pass2_Main):
37587 (KJS::CTI::privateCompile_pass4_SlowCases):
37590 2008-08-27 Mark Rowe <mrowe@apple.com>
37592 Rubber-stamped by Oliver Hunt.
37594 Switch CTI on by default.
37598 2008-08-27 Mark Rowe <mrowe@apple.com>
37600 Reviewed by Oliver Hunt.
37602 Fix the build of the full WebKit stack.
37604 * JavaScriptCore.xcodeproj/project.pbxproj: Mark two new headers as private so they can be pulled in from WebCore.
37605 * VM/CTI.h: Fix build issues that show up when compiled with GCC 4.2 as part of WebCore.
37606 * wrec/WREC.h: Ditto.
37608 2008-08-27 Mark Rowe <mrowe@apple.com>
37610 Reviewed by Sam Weinig.
37612 Implement op_new_error. Does not fix any tests as it is always followed by the unimplemented op_throw.
37615 (KJS::CTI::privateCompile_pass1_Scan):
37616 (KJS::CTI::privateCompile_pass2_Main):
37618 (KJS::Machine::cti_op_new_error):
37621 2008-08-27 Sam Weinig <sam@webkit.org>
37623 Reviewed by Gavin Barraclough and Geoff Garen.
37625 Implement op_put_getter and op_put_setter.
37628 (KJS::CTI::privateCompile_pass1_Scan):
37629 (KJS::CTI::privateCompile_pass2_Main):
37631 (KJS::Machine::cti_op_put_getter):
37632 (KJS::Machine::cti_op_put_setter):
37635 2008-08-27 Sam Weinig <sam@webkit.org>
37637 Reviewed by Gavin Barraclough and Geoff Garen.
37639 Implement op_del_by_val fixing 3 mozilla tests.
37642 (KJS::CTI::privateCompile_pass1_Scan):
37643 (KJS::CTI::privateCompile_pass2_Main):
37645 (KJS::Machine::cti_op_del_by_val):
37648 2008-08-27 Gavin Barraclough <barraclough@apple.com>
37650 Reviewed by Oliver Hunt.
37652 Quick & dirty fix to get SamplingTool sampling op_call.
37654 * VM/SamplingTool.h:
37655 (KJS::SamplingTool::callingHostFunction):
37657 2008-08-27 Sam Weinig <sam@webkit.org>
37659 Reviewed by Gavin Barraclough and Geoff Garen.
37661 Fix op_put_by_index.
37664 (KJS::CTI::privateCompile_pass2_Main): Use emitPutArgConstant instead of emitGetPutArg
37665 for the property value.
37667 (KJS::Machine::cti_op_put_by_index): Get the property value from the correct argument.
37669 2008-08-27 Sam Weinig <sam@webkit.org>
37671 Reviewed by Gavin Barraclough and Geoff Garen.
37673 Implement op_switch_imm in the CTI fixing 13 mozilla tests.
37676 (KJS::CTI::privateCompile_pass1_Scan):
37677 (KJS::CTI::privateCompile_pass2_Main):
37679 (KJS::Machine::cti_op_switch_imm):
37682 2008-08-27 Gavin Barraclough <barraclough@apple.com>
37684 Reviewed by Oliver Hunt.
37686 Implement op_switch_char in CTI.
37689 (KJS::CTI::emitCall):
37690 (KJS::CTI::privateCompile_pass1_Scan):
37691 (KJS::CTI::privateCompile_pass2_Main):
37692 (KJS::CTI::privateCompile):
37694 (KJS::CallRecord::CallRecord):
37695 (KJS::SwitchRecord::SwitchRecord):
37697 (KJS::SimpleJumpTable::SimpleJumpTable::ctiForValue):
37699 (KJS::Machine::cti_op_switch_char):
37701 * masm/IA32MacroAsm.h:
37702 (KJS::IA32MacroAssembler::):
37703 (KJS::IA32MacroAssembler::emitJmpN_r):
37704 (KJS::IA32MacroAssembler::getRelocatedAddress):
37707 2008-08-26 Sam Weinig <sam@webkit.org>
37709 Reviewed by Mark Rowe.
37711 Implement op_put_by_index to fix 1 mozilla test.
37714 (KJS::CTI::privateCompile_pass1_Scan):
37715 (KJS::CTI::privateCompile_pass2_Main):
37717 (KJS::Machine::cti_op_put_by_index):
37720 2008-08-26 Gavin Barraclough <barraclough@apple.com>
37722 Reviewed by Geoff Garen.
37724 More fixes from Geoff's review.
37727 (KJS::CTI::emitGetArg):
37728 (KJS::CTI::emitGetPutArg):
37729 (KJS::CTI::emitPutArg):
37730 (KJS::CTI::emitPutArgConstant):
37731 (KJS::CTI::getConstantImmediateNumericArg):
37732 (KJS::CTI::emitGetCTIParam):
37733 (KJS::CTI::emitPutResult):
37734 (KJS::CTI::emitCall):
37735 (KJS::CTI::emitJumpSlowCaseIfNotImm):
37736 (KJS::CTI::emitJumpSlowCaseIfNotImms):
37737 (KJS::CTI::getDeTaggedConstantImmediate):
37738 (KJS::CTI::emitFastArithDeTagImmediate):
37739 (KJS::CTI::emitFastArithReTagImmediate):
37740 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
37741 (KJS::CTI::emitFastArithImmToInt):
37742 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
37743 (KJS::CTI::privateCompile_pass2_Main):
37744 (KJS::CTI::privateCompile_pass4_SlowCases):
37745 (KJS::CTI::privateCompile):
37748 2008-08-26 Mark Rowe <mrowe@apple.com>
37750 Reviewed by Gavin Barraclough and Geoff Garen.
37752 Implement op_jmp_scopes to fix 2 Mozilla tests.
37755 (KJS::CTI::privateCompile_pass1_Scan):
37756 (KJS::CTI::privateCompile_pass2_Main):
37758 (KJS::Machine::cti_op_push_new_scope): Update ExecState::m_scopeChain after calling ARG_setScopeChain.
37759 (KJS::Machine::cti_op_jmp_scopes):
37762 2008-08-26 Gavin Barraclough <barraclough@apple.com>
37764 Reviewed by Oliver Hunt.
37766 WebKit Regular Expression Compiler. (set ENABLE_WREC = 1 in Platform.h).
37768 * JavaScriptCore.xcodeproj/project.pbxproj:
37772 * wrec/WREC.cpp: Added.
37773 * wrec/WREC.h: Added.
37776 2008-08-26 Sam Weinig <sam@webkit.org>
37778 Rubber-stamped by Oliver Hunt.
37780 Remove bogus assertion.
37783 (KJS::Machine::cti_op_del_by_id):
37785 2008-08-26 Mark Rowe <mrowe@apple.com>
37787 Reviewed by Sam Weinig.
37789 Implement op_push_new_scope and stub out op_catch. This fixes 11 Mozilla tests.
37792 (KJS::CTI::privateCompile_pass1_Scan):
37793 (KJS::CTI::privateCompile_pass2_Main):
37795 (KJS::Machine::cti_op_push_new_scope):
37796 (KJS::Machine::cti_op_catch):
37799 2008-08-26 Mark Rowe <mrowe@apple.com>
37801 Reviewed by Sam Weinig.
37803 Clean up op_resolve_base so that it shares its implementation with the bytecode interpreter.
37806 (KJS::inlineResolveBase):
37807 (KJS::resolveBase):
37809 2008-08-26 Oliver Hunt <oliver@apple.com>
37811 Reviewed by Sam Weinig.
37813 Add codegen support for op_instanceof, fixing 15 mozilla tests.
37816 (KJS::CTI::privateCompile_pass1_Scan):
37817 (KJS::CTI::privateCompile_pass2_Main):
37819 (KJS::Machine::cti_op_instanceof):
37820 (KJS::Machine::cti_op_del_by_id):
37824 2008-08-26 Gavin Barraclough <barraclough@apple.com>
37826 Reviewed by Geoff Garen.
37828 Fixes for initial review comments.
37831 (KJS::CTI::ctiCompileGetArg):
37832 (KJS::CTI::ctiCompileGetPutArg):
37833 (KJS::CTI::ctiCompilePutResult):
37834 (KJS::CTI::ctiCompileCall):
37836 (KJS::CTI::privateCompile_pass1_Scan):
37837 (KJS::CTI::printOpcodeOperandTypes):
37838 (KJS::CTI::privateCompile_pass2_Main):
37839 (KJS::CTI::privateCompile_pass4_SlowCases):
37840 (KJS::CTI::privateCompile):
37845 2008-08-26 Sam Weinig <sam@webkit.org>
37847 Reviewed by Gavin Barraclough and Geoff Garen.
37849 Fix up exception checking code.
37852 (KJS::Machine::cti_op_call):
37853 (KJS::Machine::cti_op_resolve):
37854 (KJS::Machine::cti_op_construct):
37855 (KJS::Machine::cti_op_resolve_func):
37856 (KJS::Machine::cti_op_resolve_skip):
37857 (KJS::Machine::cti_op_resolve_with_base):
37858 (KJS::Machine::cti_op_call_eval):
37860 2008-08-26 Sam Weinig <sam@webkit.org>
37862 Reviewed by Oliver Hunt.
37864 Fix slowcase for op_post_inc and op_post_dec fixing 2 mozilla tests.
37867 (KJS::CTI::privateCompile_pass4_SlowCases):
37869 2008-08-26 Mark Rowe <mrowe@apple.com>
37871 Reviewed by Sam Weinig.
37873 Implement op_in, fixing 8 mozilla tests.
37876 (KJS::CTI::privateCompile_pass1_Scan):
37877 (KJS::CTI::privateCompile_pass2_Main):
37879 (KJS::Machine::cti_op_in):
37882 2008-08-26 Mark Rowe <mrowe@apple.com>
37884 Rubber-stamped by Oliver Hunt.
37886 Don't hardcode the size of a Register for op_new_array. Fixes a crash
37887 seen during the Mozilla tests.
37890 (KJS::CTI::privateCompile_pass2_Main):
37892 2008-08-26 Sam Weinig <sam@webkit.org>
37894 Reviewed by Gavin Barraclough and Geoff Garen.
37896 Add support for op_push_scope and op_pop_scope, fixing 20 mozilla tests.
37899 (KJS::CTI::privateCompile_pass1_Scan):
37900 (KJS::CTI::privateCompile_pass2_Main):
37903 (KJS::Machine::cti_op_push_scope):
37904 (KJS::Machine::cti_op_pop_scope):
37907 2008-08-26 Oliver Hunt <oliver@apple.com>
37909 Reviewed by Maciej Stachowiak.
37911 Add codegen support for op_del_by_id, fixing 49 mozilla tests.
37914 (KJS::CTI::privateCompile_pass1_Scan):
37915 (KJS::CTI::privateCompile_pass2_Main):
37917 (KJS::Machine::cti_op_del_by_id):
37920 2008-08-26 Sam Weinig <sam@webkit.org>
37922 Reviewed by Gavin Barraclough and Geoff Garen.
37924 Don't hardcode the size of a Register for op_get_scoped_var and op_put_scoped_var
37925 fixing 513 mozilla tests in debug build.
37928 (KJS::CTI::privateCompile_pass2_Main):
37930 2008-08-26 Oliver Hunt <oliver@apple.com>
37932 Reviewed by Maciej Stachowiak.
37934 Added code generator support for op_loop, fixing around 60 mozilla tests.
37937 (KJS::CTI::privateCompile_pass1_Scan):
37938 (KJS::CTI::privateCompile_pass2_Main):
37940 2008-08-26 Mark Rowe <mrowe@apple.com>
37942 Reviewed by Sam Weinig.
37944 Set -fomit-frame-pointer in the correct location.
37946 * Configurations/JavaScriptCore.xcconfig:
37947 * JavaScriptCore.xcodeproj/project.pbxproj:
37949 2008-08-26 Gavin Barraclough <barraclough@apple.com>
37951 Reviewed by Geoff Garen.
37953 Inital cut of CTI, Geoff's review fixes to follow.
37955 * JavaScriptCore.xcodeproj/project.pbxproj:
37956 * VM/CTI.cpp: Added.
37958 (KJS::CTI::ctiCompileGetArg):
37959 (KJS::CTI::ctiCompileGetPutArg):
37960 (KJS::CTI::ctiCompilePutArg):
37961 (KJS::CTI::ctiCompilePutArgImm):
37962 (KJS::CTI::ctiImmediateNumericArg):
37963 (KJS::CTI::ctiCompileGetCTIParam):
37964 (KJS::CTI::ctiCompilePutResult):
37965 (KJS::CTI::ctiCompileCall):
37966 (KJS::CTI::slowCaseIfNotImm):
37967 (KJS::CTI::slowCaseIfNotImms):
37968 (KJS::CTI::ctiFastArithDeTagConstImmediate):
37969 (KJS::CTI::ctiFastArithDeTagImmediate):
37970 (KJS::CTI::ctiFastArithReTagImmediate):
37971 (KJS::CTI::ctiFastArithPotentiallyReTagImmediate):
37972 (KJS::CTI::ctiFastArithImmToInt):
37973 (KJS::CTI::ctiFastArithIntToImmOrSlowCase):
37975 (KJS::CTI::privateCompile_pass1_Scan):
37976 (KJS::CTI::ctiCompileAdd):
37977 (KJS::CTI::ctiCompileAddImm):
37978 (KJS::CTI::ctiCompileAddImmNotInt):
37979 (KJS::CTI::TEMP_HACK_PRINT_TYPES):
37980 (KJS::CTI::privateCompile_pass2_Main):
37981 (KJS::CTI::privateCompile_pass3_Link):
37982 (KJS::CTI::privateCompile_pass4_SlowCases):
37983 (KJS::CTI::privateCompile):
37985 (KJS::CTI2Result::CTI2Result):
37986 (KJS::CallRecord::CallRecord):
37987 (KJS::JmpTable::JmpTable):
37988 (KJS::SlowCaseEntry::SlowCaseEntry):
37989 (KJS::CTI::compile):
37990 (KJS::CTI::LabelInfo::LabelInfo):
37992 (KJS::CodeBlock::CodeBlock):
37993 (KJS::CodeBlock::~CodeBlock):
37995 (KJS::Machine::execute):
37996 (KJS::Machine::privateExecute):
37997 (KJS::ctiException):
37998 (KJS::ctiUnsupported):
37999 (KJS::ctiTimedOut):
38000 (KJS::Machine::cti_op_end):
38001 (KJS::Machine::cti_op_add):
38002 (KJS::Machine::cti_op_pre_inc):
38003 (KJS::Machine::cti_timeout_check):
38004 (KJS::Machine::cti_op_loop_if_less):
38005 (KJS::Machine::cti_op_new_object):
38006 (KJS::Machine::cti_op_put_by_id):
38007 (KJS::Machine::cti_op_get_by_id):
38008 (KJS::Machine::cti_op_mul):
38009 (KJS::Machine::cti_op_new_func):
38010 (KJS::Machine::cti_op_call):
38011 (KJS::Machine::cti_op_ret):
38012 (KJS::Machine::cti_op_new_array):
38013 (KJS::Machine::cti_op_resolve):
38014 (KJS::Machine::cti_op_construct):
38015 (KJS::Machine::cti_op_get_by_val):
38016 (KJS::Machine::cti_op_resolve_func):
38017 (KJS::Machine::cti_op_sub):
38018 (KJS::Machine::cti_op_put_by_val):
38019 (KJS::Machine::cti_op_lesseq):
38020 (KJS::Machine::cti_op_loop_if_true):
38021 (KJS::Machine::cti_op_negate):
38022 (KJS::Machine::cti_op_resolve_base):
38023 (KJS::Machine::cti_op_resolve_skip):
38024 (KJS::Machine::cti_op_div):
38025 (KJS::Machine::cti_op_pre_dec):
38026 (KJS::Machine::cti_op_jless):
38027 (KJS::Machine::cti_op_not):
38028 (KJS::Machine::cti_op_jtrue):
38029 (KJS::Machine::cti_op_post_inc):
38030 (KJS::Machine::cti_op_eq):
38031 (KJS::Machine::cti_op_lshift):
38032 (KJS::Machine::cti_op_bitand):
38033 (KJS::Machine::cti_op_rshift):
38034 (KJS::Machine::cti_op_bitnot):
38035 (KJS::Machine::cti_op_resolve_with_base):
38036 (KJS::Machine::cti_op_new_func_exp):
38037 (KJS::Machine::cti_op_mod):
38038 (KJS::Machine::cti_op_less):
38039 (KJS::Machine::cti_op_neq):
38040 (KJS::Machine::cti_op_post_dec):
38041 (KJS::Machine::cti_op_urshift):
38042 (KJS::Machine::cti_op_bitxor):
38043 (KJS::Machine::cti_op_new_regexp):
38044 (KJS::Machine::cti_op_bitor):
38045 (KJS::Machine::cti_op_call_eval):
38046 (KJS::Machine::cti_op_throw):
38047 (KJS::Machine::cti_op_get_pnames):
38048 (KJS::Machine::cti_op_next_pname):
38049 (KJS::Machine::cti_op_typeof):
38050 (KJS::Machine::cti_op_stricteq):
38051 (KJS::Machine::cti_op_nstricteq):
38052 (KJS::Machine::cti_op_to_jsnumber):
38055 (KJS::Register::jsValue):
38056 (KJS::Register::getJSValue):
38057 (KJS::Register::codeBlock):
38058 (KJS::Register::scopeChain):
38059 (KJS::Register::i):
38060 (KJS::Register::r):
38061 (KJS::Register::vPC):
38062 (KJS::Register::jsPropertyNameIterator):
38063 * VM/SamplingTool.cpp:
38065 (KJS::SamplingTool::run):
38066 (KJS::SamplingTool::dump):
38067 * VM/SamplingTool.h:
38068 * kjs/JSImmediate.h:
38069 (KJS::JSImmediate::zeroImmediate):
38070 (KJS::JSImmediate::oneImmediate):
38072 * kjs/JSVariableObject.h:
38073 (KJS::JSVariableObject::JSVariableObjectData::offsetOf_registers):
38074 (KJS::JSVariableObject::offsetOf_d):
38075 (KJS::JSVariableObject::offsetOf_Data_registers):
38077 * masm/IA32MacroAsm.h: Added.
38078 (KJS::JITCodeBuffer::JITCodeBuffer):
38079 (KJS::JITCodeBuffer::putByte):
38080 (KJS::JITCodeBuffer::putShort):
38081 (KJS::JITCodeBuffer::putInt):
38082 (KJS::JITCodeBuffer::getEIP):
38083 (KJS::JITCodeBuffer::start):
38084 (KJS::JITCodeBuffer::getOffset):
38085 (KJS::JITCodeBuffer::reset):
38086 (KJS::JITCodeBuffer::copy):
38087 (KJS::IA32MacroAssembler::):
38088 (KJS::IA32MacroAssembler::emitModRm_rr):
38089 (KJS::IA32MacroAssembler::emitModRm_rm):
38090 (KJS::IA32MacroAssembler::emitModRm_rmsib):
38091 (KJS::IA32MacroAssembler::emitModRm_opr):
38092 (KJS::IA32MacroAssembler::emitModRm_opm):
38093 (KJS::IA32MacroAssembler::IA32MacroAssembler):
38094 (KJS::IA32MacroAssembler::emitInt3):
38095 (KJS::IA32MacroAssembler::emitPushl_r):
38096 (KJS::IA32MacroAssembler::emitPopl_r):
38097 (KJS::IA32MacroAssembler::emitMovl_rr):
38098 (KJS::IA32MacroAssembler::emitAddl_rr):
38099 (KJS::IA32MacroAssembler::emitAddl_i8r):
38100 (KJS::IA32MacroAssembler::emitAddl_i32r):
38101 (KJS::IA32MacroAssembler::emitAddl_mr):
38102 (KJS::IA32MacroAssembler::emitAndl_rr):
38103 (KJS::IA32MacroAssembler::emitAndl_i32r):
38104 (KJS::IA32MacroAssembler::emitCmpl_i8r):
38105 (KJS::IA32MacroAssembler::emitCmpl_rr):
38106 (KJS::IA32MacroAssembler::emitCmpl_rm):
38107 (KJS::IA32MacroAssembler::emitCmpl_i32r):
38108 (KJS::IA32MacroAssembler::emitCmpw_rm):
38109 (KJS::IA32MacroAssembler::emitOrl_rr):
38110 (KJS::IA32MacroAssembler::emitOrl_i8r):
38111 (KJS::IA32MacroAssembler::emitSubl_rr):
38112 (KJS::IA32MacroAssembler::emitSubl_i8r):
38113 (KJS::IA32MacroAssembler::emitSubl_i32r):
38114 (KJS::IA32MacroAssembler::emitSubl_mr):
38115 (KJS::IA32MacroAssembler::emitTestl_i32r):
38116 (KJS::IA32MacroAssembler::emitTestl_rr):
38117 (KJS::IA32MacroAssembler::emitXorl_i8r):
38118 (KJS::IA32MacroAssembler::emitXorl_rr):
38119 (KJS::IA32MacroAssembler::emitSarl_i8r):
38120 (KJS::IA32MacroAssembler::emitSarl_CLr):
38121 (KJS::IA32MacroAssembler::emitShl_i8r):
38122 (KJS::IA32MacroAssembler::emitShll_CLr):
38123 (KJS::IA32MacroAssembler::emitMull_rr):
38124 (KJS::IA32MacroAssembler::emitIdivl_r):
38125 (KJS::IA32MacroAssembler::emitCdq):
38126 (KJS::IA32MacroAssembler::emitMovl_mr):
38127 (KJS::IA32MacroAssembler::emitMovzwl_mr):
38128 (KJS::IA32MacroAssembler::emitMovl_rm):
38129 (KJS::IA32MacroAssembler::emitMovl_i32r):
38130 (KJS::IA32MacroAssembler::emitMovl_i32m):
38131 (KJS::IA32MacroAssembler::emitLeal_mr):
38132 (KJS::IA32MacroAssembler::emitRet):
38133 (KJS::IA32MacroAssembler::JmpSrc::JmpSrc):
38134 (KJS::IA32MacroAssembler::JmpDst::JmpDst):
38135 (KJS::IA32MacroAssembler::emitCall):
38136 (KJS::IA32MacroAssembler::label):
38137 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
38138 (KJS::IA32MacroAssembler::emitUnlinkedJne):
38139 (KJS::IA32MacroAssembler::emitUnlinkedJe):
38140 (KJS::IA32MacroAssembler::emitUnlinkedJl):
38141 (KJS::IA32MacroAssembler::emitUnlinkedJle):
38142 (KJS::IA32MacroAssembler::emitUnlinkedJge):
38143 (KJS::IA32MacroAssembler::emitUnlinkedJae):
38144 (KJS::IA32MacroAssembler::emitUnlinkedJo):
38145 (KJS::IA32MacroAssembler::emitPredictionNotTaken):
38146 (KJS::IA32MacroAssembler::link):
38147 (KJS::IA32MacroAssembler::copy):
38150 2008-08-26 Oliver Hunt <oliver@apple.com>
38154 Enabled -fomit-frame-pointer on Release and Production builds, add additional Profiling build config for shark, etc.
38156 * JavaScriptCore.xcodeproj/project.pbxproj:
38158 === Start merge of squirrelfish-extreme ===
38160 2008-09-06 Cameron Zwarich <cwzwarich@uwaterloo.ca>
38162 Reviewed by Maciej Stachowiak.
38164 Fix the Mac Debug build by adding symbols that are exported only in a
38165 Debug configuration.
38167 * Configurations/JavaScriptCore.xcconfig:
38168 * DerivedSources.make:
38169 * JavaScriptCore.Debug.exp: Added.
38170 * JavaScriptCore.base.exp: Copied from JavaScriptCore.exp.
38171 * JavaScriptCore.exp: Removed.
38172 * JavaScriptCore.xcodeproj/project.pbxproj:
38174 2008-09-05 Darin Adler <darin@apple.com>
38176 Reviewed by Cameron Zwarich.
38178 - https://bugs.webkit.org/show_bug.cgi?id=20681
38179 JSPropertyNameIterator functions need to be inlined
38181 1.007x as fast on SunSpider overall
38182 1.081x as fast on SunSpider math-cordic
38184 * VM/JSPropertyNameIterator.cpp: Moved functions out of here.
38185 * VM/JSPropertyNameIterator.h:
38186 (KJS::JSPropertyNameIterator::JSPropertyNameIterator): Moved
38187 this into the header and marked it inline.
38188 (KJS::JSPropertyNameIterator::create): Ditto.
38189 (KJS::JSPropertyNameIterator::next): Ditto.
38191 2008-09-05 Darin Adler <darin@apple.com>
38193 Reviewed by Geoffrey Garen.
38195 - fix https://bugs.webkit.org/show_bug.cgi?id=20673
38196 single-character strings are churning in the Identifier table
38198 1.007x as fast on SunSpider overall
38199 1.167x as fast on SunSpider string-fasta
38201 * JavaScriptCore.exp: Updated.
38202 * kjs/SmallStrings.cpp:
38203 (KJS::SmallStrings::singleCharacterStringRep): Added.
38204 * kjs/SmallStrings.h: Added singleCharacterStringRep for clients that
38205 need just a UString, not a JSString.
38206 * kjs/identifier.cpp:
38207 (KJS::Identifier::add): Added special cases for single character strings
38208 so that the UString::Rep that ends up in the identifier table is the one
38209 from the single-character string optimization; otherwise we end up having
38210 to look it up in the identifier table over and over again.
38211 (KJS::Identifier::addSlowCase): Ditto.
38212 (KJS::Identifier::checkSameIdentifierTable): Made this function an empty
38213 inline in release builds so that callers don't have to put #ifndef NDEBUG
38215 * kjs/identifier.h:
38216 (KJS::Identifier::add): Removed #ifndef NDEBUG around the calls to
38217 checkSameIdentifierTable.
38218 (KJS::Identifier::checkSameIdentifierTable): Added. Empty inline version
38221 2008-09-05 Mark Rowe <mrowe@apple.com>
38225 * kjs/JSObject.h: Move the inline virtual destructor after a non-inline
38226 virtual function so that the symbol for the vtable is not marked as a
38227 weakly exported symbol.
38229 2008-09-05 Darin Adler <darin@apple.com>
38231 Reviewed by Sam Weinig.
38233 - fix https://bugs.webkit.org/show_bug.cgi?id=20671
38234 JavaScriptCore string manipulation spends too much time in memcpy
38236 1.011x as fast on SunSpider overall
38237 1.028x as fast on SunSpider string tests
38239 For small strings, use a loop rather than calling memcpy. The loop can
38240 be faster because there's no function call overhead, and because it can
38241 assume the pointers are aligned instead of checking that. Currently the
38242 threshold is set at 20 characters, based on some testing on one particular
38243 computer. Later we can tune this for various platforms by setting
38244 USTRING_COPY_CHARS_INLINE_CUTOFF appropriately, but it does no great harm
38245 if not perfectly tuned.
38248 (KJS::overflowIndicator): Removed bogus const.
38249 (KJS::maxUChars): Ditto.
38250 (KJS::copyChars): Added.
38251 (KJS::UString::Rep::createCopying): Call copyChars instead of memcpy.
38252 Also eliminated need for const_cast.
38253 (KJS::UString::expandPreCapacity): Ditto.
38254 (KJS::concatenate): Ditto.
38255 (KJS::UString::spliceSubstringsWithSeparators): Ditto.
38256 (KJS::UString::append): Ditto.
38258 2008-09-05 Kevin McCullough <kmccullough@apple.com>
38260 Reviewed by Sam and Alexey.
38262 Make the profiler work with a null exec state. This will allow other
38263 applications start the profiler to get DTrace probes going without
38267 * profiler/ProfileGenerator.cpp:
38268 (KJS::ProfileGenerator::ProfileGenerator):
38269 (KJS::ProfileGenerator::willExecute):
38270 (KJS::ProfileGenerator::didExecute):
38271 * profiler/Profiler.cpp:
38272 (KJS::Profiler::startProfiling):
38273 (KJS::Profiler::stopProfiling):
38274 (KJS::dispatchFunctionToProfiles):
38276 2008-09-04 Gavin Barraclough <barraclough@apple.com>
38278 Reviewed by Geoffrey Garen.
38280 Fixed an off-by-one error that would cause the StructureIDChain to
38281 be one object too short.
38283 Can't construct a test case because other factors make this not crash
38286 * kjs/StructureID.cpp:
38287 (KJS::StructureIDChain::StructureIDChain):
38289 2008-09-04 Kevin Ollivier <kevino@theolliviers.com>
38293 * JavaScriptCoreSources.bkl:
38295 2008-09-04 Mark Rowe <mrowe@apple.com>
38297 Reviewed by Eric Seidel.
38299 Fix https://bugs.webkit.org/show_bug.cgi?id=20639.
38300 Bug 20639: ENABLE_DASHBOARD_SUPPORT does not need to be a FEATURE_DEFINE
38302 * Configurations/JavaScriptCore.xcconfig: Remove ENABLE_DASHBOARD_SUPPORT from FEATURE_DEFINES.
38303 * wtf/Platform.h: Set ENABLE_DASHBOARD_SUPPORT for PLATFORM(MAC).
38305 2008-09-04 Adele Peterson <adele@apple.com>
38309 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
38310 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
38311 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
38313 2008-09-04 Mark Rowe <mrowe@apple.com>
38317 * kjs/config.h: Only check the value of HAVE_CONFIG_H if it is defined.
38319 2008-09-04 Marco Barisione <marco.barisione@collabora.co.uk>
38321 Reviewed by Eric Seidel.
38323 http://bugs.webkit.org/show_bug.cgi?id=20380
38324 [GTK][AUTOTOOLS] Include autotoolsconfig.h from config.h
38326 * kjs/config.h: Include the configuration header generated by
38327 autotools if available.
38329 2008-09-04 Tor Arne Vestbø <tavestbo@trolltech.com>
38333 Fix the QtWebKit build to match changes in r36016
38335 * JavaScriptCore.pri:
38337 2008-09-04 Mark Rowe <mrowe@apple.com>
38339 Fix the 64-bit build.
38341 * VM/CodeBlock.cpp:
38342 (KJS::CodeBlock::printStructureID): Store the instruction offset into an unsigned local
38343 to avoid a warning related to format specifiers.
38344 (KJS::CodeBlock::printStructureIDs): Ditto.
38346 2008-09-04 Cameron Zwarich <cwzwarich@uwaterloo.ca>
38348 Rubber-stamped by Oliver Hunt.
38350 Correct the spelling of 'entryIndices'.
38352 * kjs/PropertyMap.cpp:
38353 (KJS::PropertyMap::get):
38354 (KJS::PropertyMap::getLocation):
38355 (KJS::PropertyMap::put):
38356 (KJS::PropertyMap::insert):
38357 (KJS::PropertyMap::remove):
38358 (KJS::PropertyMap::checkConsistency):
38359 * kjs/PropertyMap.h:
38360 (KJS::PropertyMapHashTable::entries):
38361 (KJS::PropertyMap::getOffset):
38362 (KJS::PropertyMap::putOffset):
38363 (KJS::PropertyMap::offsetForTableLocation):
38365 2008-09-03 Geoffrey Garen <ggaren@apple.com>
38367 Reviewed by Cameron Zwarich.
38369 Fixed <rdar://problem/6193925> REGRESSION: Crash occurs at
38370 KJS::Machine::privateExecute() when attempting to load my Mobile Gallery
38371 (http://www.me.com/gallery/#home)
38375 https://bugs.webkit.org/show_bug.cgi?id=20633 Crash in privateExecute
38378 The underlying problem was that we would cache prototype properties
38379 even if the prototype was a dictionary.
38381 The fix is to transition a prototype back from dictionary to normal
38382 status when an opcode caches access to it. (This is better than just
38383 refusing to cache, since a heavily accessed prototype is almost
38384 certainly not a true dictionary.)
38387 (KJS::Machine::tryCacheGetByID):
38390 2008-09-03 Eric Seidel <eric@webkit.org>
38394 Clean up Platform.h and add PLATFORM(CHROMIUM), PLATFORM(SKIA) and USE(V8_BINDINGS)
38396 * Configurations/JavaScriptCore.xcconfig: add missing ENABLE_*
38397 * wtf/ASCIICType.h: include <wtf/Assertions.h> since it depends on it.
38400 2008-09-03 Kevin McCullough <kmccullough@apple.com>
38404 Remove the rest of the "zombie" code from the profiler.
38405 - There is no longer a need for the ProfilerClient callback mechanism.
38407 * API/JSProfilerPrivate.cpp:
38408 (JSStartProfiling):
38409 * JavaScriptCore.exp:
38410 * profiler/HeavyProfile.h:
38411 * profiler/ProfileGenerator.cpp:
38412 (KJS::ProfileGenerator::create):
38413 (KJS::ProfileGenerator::ProfileGenerator):
38414 * profiler/ProfileGenerator.h:
38415 (KJS::ProfileGenerator::profileGroup):
38416 * profiler/Profiler.cpp:
38417 (KJS::Profiler::startProfiling):
38418 (KJS::Profiler::stopProfiling): Immediately return the profile when
38419 stopped instead of using a callback.
38420 * profiler/Profiler.h:
38421 * profiler/TreeProfile.h:
38423 2008-09-03 Adele Peterson <adele@apple.com>
38427 * wtf/win/MainThreadWin.cpp:
38429 2008-09-02 Kevin McCullough <kmccullough@apple.com>
38431 Reviewed by Darin and Tim.
38433 Remove most of the "zombie" mode from the profiler. Next we will need
38434 to remove the client callback mechanism in profiles.
38436 - This simplifies the code, leverages the recent changes I've made in
38437 getting line numbers from SquirrelFish, and is a slight speed
38438 improvement on SunSpider.
38439 - Also the "zombie" mode was a constant source of odd edge cases and
38440 obscure bugs so it's good to remove since all of its issues may not have
38443 * API/JSProfilerPrivate.cpp: No need to call didFinishAllExecution() any
38446 * JavaScriptCore.exp: Export the new signature of retrieveLastCaller()
38448 (KJS::Machine::execute): No need to call didFinishAllExecution() any
38450 (KJS::Machine::retrieveCaller): Now operates on InternalFunctions now
38451 since the RegisterFile is no longer guaranteeded to store only
38453 (KJS::Machine::retrieveLastCaller): Now also retrieve the function's
38455 (KJS::Machine::callFrame): A result of changing retrieveCaller()
38458 * kjs/JSGlobalObject.cpp:
38459 (KJS::JSGlobalObject::~JSGlobalObject):
38461 * profiler/ProfileGenerator.cpp:
38462 (KJS::ProfileGenerator::create): Now pass the original exec and get the
38463 global exec and client when necessary. We need the original exec so we
38464 can have the stack frame where profiling started.
38465 (KJS::ProfileGenerator::ProfileGenerator): ditto.
38466 (KJS::ProfileGenerator::addParentForConsoleStart): This is where the
38467 parent to star of the profile is added, if there is one.
38468 (KJS::ProfileGenerator::willExecute): Remove uglyness!
38469 (KJS::ProfileGenerator::didExecute): Ditto!
38470 (KJS::ProfileGenerator::stopProfiling):
38471 (KJS::ProfileGenerator::removeProfileStart): Use a better way to find
38472 and remove the function we are looking for.
38473 (KJS::ProfileGenerator::removeProfileEnd): Ditto.
38474 * profiler/ProfileGenerator.h:
38475 (KJS::ProfileGenerator::client):
38476 * profiler/ProfileNode.cpp:
38477 (KJS::ProfileNode::removeChild): Add a better way to remove a child from
38479 (KJS::ProfileNode::stopProfiling):
38480 (KJS::ProfileNode::debugPrintData): Modified a debug-only diagnostic
38481 function to be sane.
38482 * profiler/ProfileNode.h:
38483 * profiler/Profiler.cpp: Change to pass the original exec state.
38484 (KJS::Profiler::startProfiling):
38485 (KJS::Profiler::stopProfiling):
38486 (KJS::Profiler::willExecute):
38487 (KJS::Profiler::didExecute):
38488 (KJS::Profiler::createCallIdentifier):
38489 * profiler/Profiler.h:
38491 2008-09-01 Alexey Proskuryakov <ap@webkit.org>
38493 Reviewed by Darin Adler.
38495 Implement callOnMainThreadAndWait().
38497 This will be useful when a background thread needs to perform UI calls synchronously
38498 (e.g. an openDatabase() call cannot return until the user answers to a confirmation dialog).
38500 * wtf/MainThread.cpp:
38501 (WTF::FunctionWithContext::FunctionWithContext): Added a ThreadCondition member. When
38502 non-zero, the condition is signalled after the function is called.
38503 (WTF::mainThreadFunctionQueueMutex): Renamed from functionQueueMutex, sinc this is no longer
38504 static. Changed to be initialized from initializeThreading() to avoid lock contention.
38505 (WTF::initializeMainThread): On non-Windows platforms, just call mainThreadFunctionQueueMutex.
38506 (WTF::dispatchFunctionsFromMainThread): Signal synchronous calls when done.
38507 (WTF::callOnMainThread): Updated for functionQueueMutex rename.
38508 (WTF::callOnMainThreadAndWait): Added.
38510 * wtf/MainThread.h: Added callOnMainThreadAndWait(); initializeMainThread() now exists on
38513 * wtf/win/MainThreadWin.cpp: (WTF::initializeMainThread): Added a callOnMainThreadAndWait()
38514 call to initialize function queue mutex.
38516 * wtf/ThreadingGtk.cpp: (WTF::initializeThreading):
38517 * wtf/ThreadingPthreads.cpp: (WTF::initializeThreading):
38518 * wtf/ThreadingQt.cpp: (WTF::initializeThreading):
38519 Only initialize mainThreadIdentifier on non-Darwin platforms. It was not guaranteed to be
38520 accurate on Darwin.
38522 2008-09-03 Geoffrey Garen <ggaren@apple.com>
38524 Reviewed by Darin Adler.
38526 Use isUndefinedOrNull() instead of separate checks for each in op_eq_null
38530 (KJS::Machine::privateExecute):
38532 2008-09-02 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
38534 Reviewed by Darin Adler.
38536 Bug 20296: OpcodeStats doesn't build on platforms which don't have mergesort().
38537 <https://bugs.webkit.org/show_bug.cgi?id=20296>
38540 (KJS::OpcodeStats::~OpcodeStats): mergesort() replaced with qsort()
38542 2008-09-02 Geoffrey Garen <ggaren@apple.com>
38544 Reviewed by Oliver Hunt.
38546 Fast path for array.length and string.length.
38548 SunSpider says 0.5% faster.
38550 2008-09-02 Geoffrey Garen <ggaren@apple.com>
38552 Reviewed by Anders Carlsson.
38554 Added optimized paths for comparing to null.
38556 SunSpider says 0.5% faster.
38558 2008-09-02 Geoffrey Garen <ggaren@apple.com>
38560 Reviewed by Sam Weinig.
38562 Changed jsDriver.pl to dump the exact text you would need in order to
38563 reproduce a test result. This enables a fast workflow where you copy
38564 and paste a test failure in the terminal.
38566 * tests/mozilla/jsDriver.pl:
38568 2008-09-02 Geoffrey Garen <ggaren@apple.com>
38570 Reviewed by Sam Weinig.
38572 Implemented the rest of Darin's review comments for the 09-01 inline
38575 SunSpider says 0.5% faster, but that seems like noise.
38577 * JavaScriptCore.xcodeproj/project.pbxproj: Put PutPropertySlot into
38578 its own file, and added BatchedTransitionOptimizer.
38580 * VM/CodeBlock.cpp:
38581 (KJS::CodeBlock::~CodeBlock): Use array indexing instead of a pointer
38584 * VM/CodeGenerator.cpp:
38585 (KJS::CodeGenerator::CodeGenerator): Used BatchedTransitionOptimizer to
38586 make batched put and remove for declared variables fast, without forever
38587 pessimizing the global object. Removed the old getDirect/removeDirect hack
38588 that tried to do the same in a more limited way.
38590 * VM/CodeGenerator.h: Moved IdentifierRepHash to the KJS namespace since
38591 it doesn't specialize anything in WTF.
38594 (KJS::Machine::Machine): Nixed the DummyConstruct tag because it was
38597 (KJS::Machine::execute): Used BatchedTransitionOptimizer, as above. Fixed
38600 (KJS::cachePrototypeChain): Cast to JSObject*, since it's more specific.
38602 (KJS::Machine::tryCachePutByID): Use isNull() instead of comparing to
38603 jsNull(), since isNull() leaves more options open for the future.
38604 (KJS::Machine::tryCacheGetByID): ditto
38605 (KJS::Machine::privateExecute): ditto
38607 * VM/SamplingTool.cpp:
38608 (KJS::SamplingTool::dump): Use C++-style cast, to match our style
38611 * kjs/BatchedTransitionOptimizer.h: Added. New class that allows host
38612 code to add a batch of properties to an object in an efficient way.
38614 * kjs/JSActivation.cpp: Use isNull(), as above.
38616 * kjs/JSArray.cpp: Get rid of DummyConstruct tag, as above.
38619 * kjs/JSGlobalData.cpp: Nixed two unused StructureIDs.
38620 * kjs/JSGlobalData.h:
38622 * kjs/JSImmediate.cpp: Use isNull(), as above.
38624 * kjs/JSObject.cpp:
38625 (KJS::JSObject::mark): Moved mark tracing code elsewhere, to make this
38626 function more readable.
38628 (KJS::JSObject::put): Use isNull(), as above.
38630 (KJS::JSObject::createInheritorID): Return a raw pointer, since the
38631 object is owned by a data member, not necessarily the caller.
38634 * kjs/JSString.cpp: Use isNull(), as above.
38636 * kjs/PropertyMap.h: Updated to use PropertySlot::invalidOffset.
38638 * kjs/PropertySlot.h: Changed KJS_INVALID_OFFSET to WTF::notFound
38639 because C macros are so 80's.
38641 * kjs/PutPropertySlot.h: Added. Split out of PropertySlot.h. Also renamed
38642 PutPropertySlot::SlotType to PutPropertySlot::Type, and slotBase to base,
38643 since "slot" was redundant.
38645 * kjs/StructureID.cpp: Added a new transition *away* from dictionary
38646 status, to support BatchedTransitionOptimizer.
38648 (KJS::StructureIDChain::StructureIDChain): No need to store m_size as
38649 a data member, so keep it in a local, which might be faster.
38650 * kjs/StructureID.h:
38652 * kjs/SymbolTable.h: Moved IdentifierRepHash to KJS namespace, as above.
38655 2008-09-02 Adam Roben <aroben@apple.com>
38657 Windows build fixes
38659 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
38660 StructureID.{cpp,h} to the project. Also let VS reorder this file.
38661 * VM/CodeBlock.cpp: Include StringExtras so that snprintf will be
38662 defined on Windows.
38664 2008-09-01 Sam Weinig <sam@webkit.org>
38668 * JavaScriptCore.exp:
38670 2008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
38672 Reviewed by Oliver Hunt.
38677 * kjs/PropertyMap.cpp: rename Identifier.h to identifier.h
38678 * kjs/StructureID.cpp: include JSObject.h
38680 2008-09-01 Geoffrey Garen <ggaren@apple.com>
38682 Reviewed by Darin Adler.
38684 First cut at inline caching for access to vanilla JavaScript properties.
38686 SunSpider says 4% faster. Tests heavy on dictionary-like access have
38687 regressed a bit -- we have a lot of room to improve in this area,
38688 but this patch is over-ripe as-is.
38690 JSCells now have a StructureID that uniquely identifies their layout,
38691 and holds their prototype.
38693 JSValue::put takes a PropertySlot& argument, so it can fill in details
38694 about where it put a value, for the sake of caching.
38696 * VM/CodeGenerator.cpp:
38697 (KJS::CodeGenerator::CodeGenerator): Avoid calling removeDirect if we
38698 can, since it disables inline caching in the global object. This can
38699 probably improve in the future.
38701 * kjs/JSGlobalObject.cpp: Nixed reset(), since it complicates caching, and
38702 wasn't really necessary.
38704 * kjs/JSObject.cpp: Tweaked getter / setter behavior not to rely on the
38705 IsGetterSetter flag, since the flag was buggy. This is necessary in order
38706 to avoid accidentally accessing a getter / setter as a normal property.
38708 Also changed getter / setter creation to honor ReadOnly, matching Mozilla.
38710 * kjs/PropertyMap.cpp: Nixed clear(), since it complicates caching and
38713 * kjs/Shell.cpp: Moved SamplingTool dumping outside the loop. This allows
38714 you to aggregate sampling of multiple files (or the same file repeatedly),
38715 which helped me track down regressions.
38717 * kjs/ustring.h: Moved IdentifierRepHash here to share it.
38719 2008-09-01 Geoffrey Garen <ggaren@apple.com>
38721 Reviewed by Sam Weinig.
38723 Eagerly allocate the Math object's numeric constants. This avoids
38724 constantly reallocating them in loops, and also ensures that the Math
38725 object will not use the single property optimization, which makes
38726 properties ineligible for caching.
38728 SunSpider reports a small speedup, in combination with inline caching.
38730 * kjs/MathObject.cpp:
38731 (KJS::MathObject::MathObject):
38732 (KJS::MathObject::getOwnPropertySlot):
38733 * kjs/MathObject.h:
38735 2008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
38737 Gtk build fix, not reviewed.
38739 * GNUmakefile.am: Add SmallStrings.cpp in both release and debug builds
38741 2008-08-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
38743 Reviewed by Maciej Stachowiak.
38745 Bug 20577: REGRESSION (r36006): Gmail is broken
38746 <https://bugs.webkit.org/show_bug.cgi?id=20577>
38748 r36006 changed stringProtoFuncSubstr() so that it is uses the more
38749 efficient jsSubstring(), rather than using UString::substr() and then
38750 calling jsString(). However, the change did not account for the case
38751 where the start and the length of the substring extend beyond the length
38752 of the original string. This patch corrects that.
38754 * kjs/StringPrototype.cpp:
38755 (KJS::stringProtoFuncSubstr):
38757 2008-08-31 Simon Hausmann <hausmann@wekit.org>
38759 Unreviewed build fix (with gcc 4.3)
38761 * kjs/ustring.h: Properly forward declare operator== for UString and
38762 the the concatenate functions inside the KJS namespace.
38764 2008-08-30 Darin Adler <darin@apple.com>
38766 Reviewed by Maciej.
38768 - https://bugs.webkit.org/show_bug.cgi?id=20333
38769 improve JavaScript speed when handling single-character strings
38771 1.035x as fast on SunSpider overall.
38772 1.127x as fast on SunSpider string tests.
38773 1.910x as fast on SunSpider string-base64 test.
38775 * API/JSObjectRef.cpp:
38776 (JSObjectMakeFunction): Removed unneeded explicit construction of UString.
38778 * GNUmakefile.am: Added SmallStrings.h and SmallStrings.cpp.
38779 * JavaScriptCore.pri: Ditto.
38780 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
38782 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
38783 * JavaScriptCoreSources.bkl: Ditto.
38785 * JavaScriptCore.exp: Updated.
38788 (KJS::jsAddSlowCase): Changed to use a code path that doesn't involve
38789 a UString constructor. This avoids an extra jump caused by the "in charge"
38790 vs. "not in charge" constructors.
38791 (KJS::jsAdd): Ditto.
38792 (KJS::jsTypeStringForValue): Adopted jsNontrivialString.
38794 * kjs/ArrayPrototype.cpp:
38795 (KJS::arrayProtoFuncToString): Adopted jsEmptyString.
38796 (KJS::arrayProtoFuncToLocaleString): Ditto.
38797 (KJS::arrayProtoFuncJoin): Ditto.
38798 * kjs/BooleanPrototype.cpp:
38799 (KJS::booleanProtoFuncToString): Adopted jsNontrivialString.
38800 * kjs/DateConstructor.cpp:
38801 (KJS::callDate): Ditto.
38802 * kjs/DatePrototype.cpp:
38803 (KJS::formatLocaleDate): Adopted jsEmptyString and jsNontrivialString.
38804 (KJS::dateProtoFuncToString): Ditto.
38805 (KJS::dateProtoFuncToUTCString): Ditto.
38806 (KJS::dateProtoFuncToDateString): Ditto.
38807 (KJS::dateProtoFuncToTimeString): Ditto.
38808 (KJS::dateProtoFuncToLocaleString): Ditto.
38809 (KJS::dateProtoFuncToLocaleDateString): Ditto.
38810 (KJS::dateProtoFuncToLocaleTimeString): Ditto.
38811 (KJS::dateProtoFuncToGMTString): Ditto.
38813 * kjs/ErrorPrototype.cpp:
38814 (KJS::ErrorPrototype::ErrorPrototype): Ditto.
38815 (KJS::errorProtoFuncToString): Ditto.
38817 * kjs/JSGlobalData.h: Added SmallStrings.
38819 * kjs/JSString.cpp:
38820 (KJS::jsString): Eliminated the overload that takes a const char*.
38821 Added code to use SmallStrings to get strings of small sizes rather
38822 than creating a new JSString every time.
38823 (KJS::jsSubstring): Added. Used when creating a string from a substring
38824 to avoid creating a JSString in cases where the substring will end up
38825 empty or as one character.
38826 (KJS::jsOwnedString): Added the same code as in jsString.
38828 * kjs/JSString.h: Added new functions jsEmptyString, jsSingleCharacterString,
38829 jsSingleCharacterSubstring, jsSubstring, and jsNontrivialString for various
38830 cases where we want to create JSString, and want special handling for small
38832 (KJS::JSString::JSString): Added an overload that takes a PassRefPtr of
38833 a UString::Rep so you don't have to construct a UString; PassRefPtr can be
38835 (KJS::jsEmptyString): Added.
38836 (KJS::jsSingleCharacterString): Added.
38837 (KJS::jsSingleCharacterSubstring): Added.
38838 (KJS::jsNontrivialString): Added.
38839 (KJS::JSString::getIndex): Adopted jsSingleCharacterSubstring.
38840 (KJS::JSString::getStringPropertySlot): Ditto.
38842 * kjs/NumberPrototype.cpp:
38843 (KJS::numberProtoFuncToFixed): Adopted jsNontrivialString.
38844 (KJS::numberProtoFuncToExponential): Ditto.
38845 (KJS::numberProtoFuncToPrecision): Ditto.
38847 * kjs/ObjectPrototype.cpp:
38848 (KJS::objectProtoFuncToLocaleString): Adopted toThisJSString.
38849 (KJS::objectProtoFuncToString): Adopted jsNontrivialString.
38851 * kjs/RegExpConstructor.cpp: Separated the lastInput value that's used
38852 with the lastOvector to return matches from the input value that can be
38853 changed via JavaScript. They will be equal in many cases, but not all.
38854 (KJS::RegExpConstructor::performMatch): Set input.
38855 (KJS::RegExpMatchesArray::RegExpMatchesArray): Ditto.
38856 (KJS::RegExpMatchesArray::fillArrayInstance): Adopted jsSubstring. Also,
38857 use input rather than lastInput in the appropriate place.
38858 (KJS::RegExpConstructor::getBackref): Adopted jsSubstring and jsEmptyString.
38859 Added code to handle the case where there is no backref -- before this
38860 depended on range checking in UString::substr which is not present in
38862 (KJS::RegExpConstructor::getLastParen): Ditto.
38863 (KJS::RegExpConstructor::getLeftContext): Ditto.
38864 (KJS::RegExpConstructor::getRightContext): Ditto.
38865 (KJS::RegExpConstructor::getValueProperty): Use input rather than lastInput.
38866 Also adopt jsEmptyString.
38867 (KJS::RegExpConstructor::putValueProperty): Ditto.
38868 (KJS::RegExpConstructor::input): Ditto.
38870 * kjs/RegExpPrototype.cpp:
38871 (KJS::regExpProtoFuncToString): Adopt jsNonTrivialString. Also changed to
38872 use UString::append to append single characters rather than using += and
38875 * kjs/SmallStrings.cpp: Added.
38876 (KJS::SmallStringsStorage::SmallStringsStorage): Construct the
38877 buffer and UString::Rep for all 256 single-character strings for
38878 the U+0000 through U+00FF. This covers all the values used in
38879 the base64 test as well as most values seen elsewhere on the web
38880 as well. It's possible that later we might fix this to only work
38881 for U+0000 through U+007F but the others are used quite a bit in
38882 the current version of the base64 test.
38883 (KJS::SmallStringsStorage::~SmallStringsStorage): Free memory.
38884 (KJS::SmallStrings::SmallStrings): Create a set of small strings,
38885 initially not created; created later when they are used.
38886 (KJS::SmallStrings::~SmallStrings): Deallocate. Not left compiler
38887 generated because the SmallStringsStorage class's destructor needs
38889 (KJS::SmallStrings::mark): Mark all the strings.
38890 (KJS::SmallStrings::createEmptyString): Create a cell for the
38891 empty string. Called only the first time.
38892 (KJS::SmallStrings::createSingleCharacterString): Create a cell
38893 for one of the single-character strings. Called only the first time.
38894 * kjs/SmallStrings.h: Added.
38896 * kjs/StringConstructor.cpp:
38897 (KJS::stringFromCharCodeSlowCase): Factored out of strinFromCharCode.
38898 Only used for cases where the caller does not pass exactly one argument.
38899 (KJS::stringFromCharCode): Adopted jsSingleCharacterString.
38900 (KJS::callStringConstructor): Adopted jsEmptyString.
38902 * kjs/StringObject.cpp:
38903 (KJS::StringObject::StringObject): Adopted jsEmptyString.
38905 * kjs/StringPrototype.cpp:
38906 (KJS::stringProtoFuncReplace): Adopted jsSubstring.
38907 (KJS::stringProtoFuncCharAt): Adopted jsEmptyString and
38908 jsSingleCharacterSubstring and also added a special case when the
38909 index is an immediate number to avoid conversion to and from floating
38910 point, since that's the common case.
38911 (KJS::stringProtoFuncCharCodeAt): Ditto.
38912 (KJS::stringProtoFuncMatch): Adopted jsSubstring and jsEmptyString.
38913 (KJS::stringProtoFuncSlice): Adopted jsSubstring and
38914 jsSingleCharacterSubstring. Also got rid of some unneeded locals and
38915 removed unneeded code to set the length property of the array, since it
38916 is automatically updated as values are added to the array.
38917 (KJS::stringProtoFuncSplit): Adopted jsEmptyString.
38918 (KJS::stringProtoFuncSubstr): Adopted jsSubstring.
38919 (KJS::stringProtoFuncSubstring): Ditto.
38921 * kjs/collector.cpp:
38922 (KJS::Heap::collect): Added a call to mark SmallStrings.
38925 (KJS::UString::expandedSize): Made this a static member function since
38926 it doesn't need to look at any data members.
38927 (KJS::UString::expandCapacity): Use a non-inline function, makeNull, to
38928 set the rep to null in failure cases. This avoids adding a PIC branch for
38929 the normal case when there is no failure.
38930 (KJS::UString::expandPreCapacity): Ditto.
38931 (KJS::UString::UString): Ditto.
38932 (KJS::concatenate): Refactored the concatenation constructor into this
38933 separate function. Calling the concatenation constructor was leading to
38934 an extra branch because of the in-charge vs. not-in-charge versions not
38935 both being inlined, and this was showing up as nearly 1% on Shark. Also
38936 added a special case for when the second string is a single character,
38937 since it's a common idiom to build up a string that way and we can do
38938 things much more quickly, without involving memcpy for example. Also
38939 adopted the non-inline function, nullRep, for the same reason given for
38941 (KJS::UString::append): Adopted makeNull for failure cases.
38942 (KJS::UString::operator=): Ditto.
38943 (KJS::UString::toDouble): Added a special case for converting single
38944 character strings to numbers. We're doing this a ton of times while
38945 running the base64 test.
38946 (KJS::operator==): Added special cases so we can compare single-character
38947 strings without calling memcmp. Later we might want to special case other
38948 short lengths similarly.
38949 (KJS::UString::makeNull): Added.
38950 (KJS::UString::nullRep): Added.
38951 * kjs/ustring.h: Added declarations for the nullRep and makeNull. Changed
38952 expandedSize to be a static member function. Added a declaration of the
38953 concatenate function. Removed the concatenation constructor. Rewrote
38954 operator+ to use the concatenate function.
38956 2008-08-29 Anders Carlsson <andersca@apple.com>
38963 2008-08-29 Anders Carlsson <andersca@apple.com>
38965 Reviewed by Darin Adler.
38967 <rdar://problem/6174667>
38968 When a machine is under heavy load, the Slow Script dialog often comes up many times and just gets in the way
38970 Instead of using clock time, use the CPU time spent executing the current thread when
38971 determining if the script has been running for too long.
38975 (KJS::Machine::checkTimeout):
38977 2008-08-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
38979 Rubber-stamped by Sam Weinig.
38981 Change 'term' to 'expr' in variable names to standardize terminology.
38984 (KJS::BinaryOpNode::emitCode):
38985 (KJS::ReverseBinaryOpNode::emitCode):
38986 (KJS::ThrowableBinaryOpNode::emitCode):
38988 (KJS::BinaryOpNode::BinaryOpNode):
38989 (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
38995 (KJS::LeftShiftNode::):
38996 (KJS::RightShiftNode::):
38997 (KJS::UnsignedRightShiftNode::):
38999 (KJS::GreaterNode::):
39000 (KJS::LessEqNode::):
39001 (KJS::GreaterEqNode::):
39002 (KJS::ThrowableBinaryOpNode::):
39003 (KJS::InstanceOfNode::):
39005 (KJS::EqualNode::):
39006 (KJS::NotEqualNode::):
39007 (KJS::StrictEqualNode::):
39008 (KJS::NotStrictEqualNode::):
39009 (KJS::BitAndNode::):
39010 (KJS::BitOrNode::):
39011 (KJS::BitXOrNode::):
39012 * kjs/nodes2string.cpp:
39013 (KJS::MultNode::streamTo):
39014 (KJS::DivNode::streamTo):
39015 (KJS::ModNode::streamTo):
39016 (KJS::AddNode::streamTo):
39017 (KJS::SubNode::streamTo):
39018 (KJS::LeftShiftNode::streamTo):
39019 (KJS::RightShiftNode::streamTo):
39020 (KJS::UnsignedRightShiftNode::streamTo):
39021 (KJS::LessNode::streamTo):
39022 (KJS::GreaterNode::streamTo):
39023 (KJS::LessEqNode::streamTo):
39024 (KJS::GreaterEqNode::streamTo):
39025 (KJS::InstanceOfNode::streamTo):
39026 (KJS::InNode::streamTo):
39027 (KJS::EqualNode::streamTo):
39028 (KJS::NotEqualNode::streamTo):
39029 (KJS::StrictEqualNode::streamTo):
39030 (KJS::NotStrictEqualNode::streamTo):
39031 (KJS::BitAndNode::streamTo):
39032 (KJS::BitXOrNode::streamTo):
39033 (KJS::BitOrNode::streamTo):
39035 2008-08-28 Alp Toker <alp@nuanti.com>
39037 GTK+ dist/build fix. List newly added header files.
39041 2008-08-28 Sam Weinig <sam@webkit.org>
39043 Reviewed by Oliver Hunt.
39045 Change to throw a ReferenceError at runtime instead of a ParseError
39046 at parse time, when the left hand side expression of a for-in statement
39051 (KJS::ForInNode::emitCode):
39053 2008-08-28 Alexey Proskuryakov <ap@webkit.org>
39055 Not reviewed, build fix (at least for OpenBSD, posssibly more).
39057 https://bugs.webkit.org/show_bug.cgi?id=20545
39058 missing #include <unistd.h> in JavaScriptCore/VM/SamplingTool.cpp
39060 * VM/SamplingTool.cpp: add the missing include.
39062 2008-08-26 Kevin McCullough <kmccullough@apple.com>
39064 Reviewed by Geoff and Cameron.
39066 <rdar://problem/6174603> Hitting assertion in Register::codeBlock when
39067 loading facebook (20516).
39069 - This was a result of my line numbers change. After a host function is
39070 called the stack does not get reset correctly.
39071 - Oddly this also appears to be a slight speedup on SunSpider.
39074 (KJS::Machine::privateExecute):
39076 2008-08-26 Alexey Proskuryakov <ap@webkit.org>
39078 Reviewed by Geoff and Tim.
39080 Export new API methods.
39082 * JavaScriptCore.exp:
39084 2008-08-25 Kevin McCullough <kmccullough@apple.com>
39086 Reviewed by Geoff, Tim and Mark.
39088 <rdar://problem/6150623> JSProfiler: It would be nice if the profiles
39089 in the console said what file and line number they came from
39090 - Lay the foundation for getting line numbers and other data from the
39091 JavaScript engine. With the cleanup in kjs/ExecState this is actually
39092 a slight performance improvement.
39094 * JavaScriptCore.exp: Export retrieveLastCaller() for WebCore.
39095 * JavaScriptCore.xcodeproj/project.pbxproj:
39096 * VM/Machine.cpp: Now Host and JS functions set a call frame on the
39097 exec state, so this and the profiler code were pulled out of the
39099 (KJS::Machine::privateExecute):
39100 (KJS::Machine::retrieveLastCaller): This get's the lineNumber, sourceID
39101 and sourceURL for the previously called function.
39103 * kjs/ExecState.cpp: Remove references to JSFunction since it's not used
39107 2008-08-25 Alexey Proskuryakov <ap@webkit.org>
39109 Reviewed by Darin Adler.
39111 Ensure that JSGlobalContextRelease() performs garbage collection, even if there are other
39112 contexts in the current context's group.
39114 This is only really necessary when the last reference is released, but there is no way to
39115 determine that, and no harm in collecting slightly more often.
39117 * API/JSContextRef.cpp: (JSGlobalContextRelease): Explicitly collect the heap if it is not
39120 2008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39122 Reviewed by Oliver Hunt.
39124 Bug 20093: JSC shell does not clear exceptions after it executes toString on an expression
39125 <https://bugs.webkit.org/show_bug.cgi?id=20093>
39127 Clear exceptions after evaluating any code in the JSC shell. We do not
39128 report exceptions that are caused by calling toString on the final
39129 valued, but at least we avoid incorrect behaviour.
39131 Also, print any exceptions that occurred while evaluating code at the
39132 interactive prompt, not just while evaluating code from a file.
39138 2008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39140 Reviewed by Oliver.
39142 Remove an unnecessary RefPtr to a RegisterID.
39145 (KJS::DeleteBracketNode::emitCode):
39147 2008-08-24 Mark Rowe <mrowe@apple.com>
39149 Reviewed by Oliver Hunt.
39151 Use the correct version number for when JSGlobalContextCreate was introduced.
39153 * API/JSContextRef.h:
39155 2008-08-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39157 Rubber-stamped by Mark Rowe.
39163 * API/JSCallbackConstructor.cpp:
39164 * API/JSCallbackConstructor.h:
39165 * API/JSCallbackFunction.cpp:
39166 * API/JSCallbackFunction.h:
39167 * API/JSCallbackObject.cpp:
39168 * API/JSCallbackObject.h:
39169 * API/JSCallbackObjectFunctions.h:
39170 * API/JSClassRef.cpp:
39171 * API/JSContextRef.cpp:
39172 * API/JSObjectRef.cpp:
39173 * API/JSProfilerPrivate.cpp:
39174 * API/JSStringRef.cpp:
39175 * API/JSStringRefBSTR.cpp:
39176 * API/JSStringRefCF.cpp:
39177 * API/JSValueRef.cpp:
39178 * API/tests/JSNode.c:
39179 * API/tests/JSNode.h:
39180 * API/tests/JSNodeList.c:
39181 * API/tests/JSNodeList.h:
39182 * API/tests/Node.c:
39183 * API/tests/Node.h:
39184 * API/tests/NodeList.c:
39185 * API/tests/NodeList.h:
39186 * API/tests/minidom.c:
39187 * API/tests/minidom.js:
39188 * API/tests/testapi.c:
39189 * API/tests/testapi.js:
39190 * JavaScriptCore.pro:
39191 * kjs/FunctionConstructor.h:
39192 * kjs/FunctionPrototype.h:
39195 * kjs/JSWrapperObject.cpp:
39196 * kjs/NumberConstructor.h:
39197 * kjs/NumberObject.h:
39198 * kjs/NumberPrototype.h:
39201 * wtf/Assertions.cpp:
39202 * wtf/Assertions.h:
39203 * wtf/HashCountedSet.h:
39204 * wtf/HashFunctions.h:
39205 * wtf/HashIterators.h:
39209 * wtf/HashTraits.h:
39210 * wtf/ListHashSet.h:
39211 * wtf/ListRefPtr.h:
39212 * wtf/Noncopyable.h:
39213 * wtf/OwnArrayPtr.h:
39215 * wtf/PassRefPtr.h:
39218 * wtf/RefPtrHashMap.h:
39220 * wtf/UnusedParam.h:
39222 * wtf/VectorTraits.h:
39223 * wtf/unicode/Unicode.h:
39224 * wtf/unicode/icu/UnicodeIcu.h:
39226 2008-08-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39228 Reviewed by Oliver.
39230 Some cleanup to match our coding style.
39232 * VM/CodeGenerator.h:
39234 (KJS::Machine::privateExecute):
39235 * kjs/ExecState.cpp:
39237 * kjs/completion.h:
39238 * kjs/identifier.cpp:
39239 (KJS::Identifier::equal):
39240 (KJS::CStringTranslator::hash):
39241 (KJS::CStringTranslator::equal):
39242 (KJS::CStringTranslator::translate):
39243 (KJS::UCharBufferTranslator::equal):
39244 (KJS::UCharBufferTranslator::translate):
39245 (KJS::Identifier::remove):
39246 * kjs/operations.h:
39248 2008-08-20 Alexey Proskuryakov <ap@webkit.org>
39252 * API/WebKitAvailability.h: Define DEPRECATED_ATTRIBUTE.
39254 2008-08-19 Alexey Proskuryakov <ap@webkit.org>
39256 Reviewed by Geoff Garen.
39258 Bring back shared JSGlobalData and implicit locking, because too many clients rely on it.
39260 * kjs/JSGlobalData.cpp:
39261 (KJS::JSGlobalData::~JSGlobalData):
39262 (KJS::JSGlobalData::JSGlobalData): Re-add shared instance.
39263 (KJS::JSGlobalData::sharedInstanceExists): Ditto.
39264 (KJS::JSGlobalData::sharedInstance): Ditto.
39265 (KJS::JSGlobalData::sharedInstanceInternal): Ditto.
39267 * API/JSContextRef.h: Deprecated JSGlobalContextCreate(). Added a very conservative
39268 description of its threading model (nothing is allowed).
39270 * API/JSContextRef.cpp:
39271 (JSGlobalContextCreate): Use shared JSGlobalData.
39272 (JSGlobalContextCreateInGroup): Support passing NULL group to request a unique one.
39273 (JSGlobalContextRetain): Added back locking.
39274 (JSGlobalContextRelease): Ditto.
39275 (JSContextGetGlobalObject): Ditto.
39277 * API/tests/minidom.c: (main):
39278 * API/tests/testapi.c: (main):
39279 Switched to JSGlobalContextCreateInGroup() to avoid deprecation warnings.
39281 * JavaScriptCore.exp: Re-added JSLock methods. Added JSGlobalContextCreateInGroup (d'oh!).
39284 (JSEvaluateScript):
39285 (JSCheckScriptSyntax):
39286 (JSGarbageCollect):
39287 * API/JSCallbackConstructor.cpp:
39288 (KJS::constructJSCallback):
39289 * API/JSCallbackFunction.cpp:
39290 (KJS::JSCallbackFunction::call):
39291 * API/JSCallbackObjectFunctions.h:
39293 (KJS::::getOwnPropertySlot):
39295 (KJS::::deleteProperty):
39296 (KJS::::construct):
39297 (KJS::::hasInstance):
39299 (KJS::::getPropertyNames):
39302 (KJS::::staticValueGetter):
39303 (KJS::::callbackGetter):
39304 * API/JSObjectRef.cpp:
39306 (JSObjectMakeFunctionWithCallback):
39307 (JSObjectMakeConstructor):
39308 (JSObjectMakeFunction):
39309 (JSObjectHasProperty):
39310 (JSObjectGetProperty):
39311 (JSObjectSetProperty):
39312 (JSObjectGetPropertyAtIndex):
39313 (JSObjectSetPropertyAtIndex):
39314 (JSObjectDeleteProperty):
39315 (JSObjectCallAsFunction):
39316 (JSObjectCallAsConstructor):
39317 (JSObjectCopyPropertyNames):
39318 (JSPropertyNameArrayRelease):
39319 (JSPropertyNameAccumulatorAddName):
39320 * API/JSValueRef.cpp:
39322 (JSValueIsInstanceOfConstructor):
39323 (JSValueMakeNumber):
39324 (JSValueMakeString):
39326 (JSValueToStringCopy):
39329 (JSValueUnprotect):
39330 * ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
39332 * JavaScriptCore.pri:
39333 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
39334 * JavaScriptCore.xcodeproj/project.pbxproj:
39335 * JavaScriptCoreSources.bkl:
39336 * kjs/AllInOneFile.cpp:
39337 * kjs/JSGlobalData.h:
39338 * kjs/JSGlobalObject.cpp:
39339 (KJS::JSGlobalObject::~JSGlobalObject):
39340 (KJS::JSGlobalObject::init):
39341 * kjs/JSLock.cpp: Added.
39342 (KJS::createJSLockCount):
39343 (KJS::JSLock::lockCount):
39344 (KJS::setLockCount):
39345 (KJS::JSLock::JSLock):
39346 (KJS::JSLock::lock):
39347 (KJS::JSLock::unlock):
39348 (KJS::JSLock::currentThreadIsHoldingLock):
39349 (KJS::JSLock::DropAllLocks::DropAllLocks):
39350 (KJS::JSLock::DropAllLocks::~DropAllLocks):
39351 * kjs/JSLock.h: Added.
39352 (KJS::JSLock::JSLock):
39353 (KJS::JSLock::~JSLock):
39357 * kjs/collector.cpp:
39358 (KJS::Heap::~Heap):
39359 (KJS::Heap::heapAllocate):
39360 (KJS::Heap::setGCProtectNeedsLocking):
39361 (KJS::Heap::protect):
39362 (KJS::Heap::unprotect):
39363 (KJS::Heap::collect):
39364 * kjs/identifier.cpp:
39365 * kjs/interpreter.cpp:
39366 (KJS::Interpreter::checkSyntax):
39367 (KJS::Interpreter::evaluate):
39368 Re-added implicit locking.
39370 2008-08-19 Kevin McCullough <kmccullough@apple.com>
39372 Reviewed by Tim and Mark.
39374 Implement DTrace hooks for dashcode and instruments.
39376 * API/JSProfilerPrivate.cpp: Added. Expose SPI so that profiling can be
39377 turned on from a client. The DTrace probes were added within the
39378 profiler mechanism for performance reasons so the profiler must be
39379 started to enable tracing.
39380 (JSStartProfiling):
39382 * API/JSProfilerPrivate.h: Added. Ditto.
39383 * JavaScriptCore.exp: Exposing the start/stop methods to clients.
39384 * JavaScriptCore.xcodeproj/project.pbxproj:
39385 * kjs/Tracing.d: Define the DTrace probes.
39386 * kjs/Tracing.h: Ditto.
39387 * profiler/ProfileGenerator.cpp: Implement the DTrace probes in the
39389 (KJS::ProfileGenerator::willExecute):
39390 (KJS::ProfileGenerator::didExecute):
39392 2008-08-19 Steve Falkenburg <sfalken@apple.com>
39396 * kjs/operations.cpp:
39399 2008-08-18 Timothy Hatcher <timothy@apple.com>
39401 Fix an assertion when generating a heavy profile because the
39402 empty value and deleted value of CallIdentifier where equal.
39404 https://bugs.webkit.org/show_bug.cgi?id=20439
39406 Reviewed by Dan Bernstein.
39408 * profiler/CallIdentifier.h: Make the emptyValue for CallIdentifier
39409 use empty strings for URL and function name.
39411 2008-08-12 Darin Adler <darin@apple.com>
39415 - eliminate JSValue::type()
39417 This will make it slightly easier to change the JSImmediate design without
39418 having to touch so many call sites.
39420 SunSpider says this change is a wash (looked like a slight speedup, but not
39421 statistically significant).
39423 * API/JSStringRef.cpp: Removed include of JSType.h.
39424 * API/JSValueRef.cpp: Removed include of JSType.h.
39425 (JSValueGetType): Replaced use of JSValue::type() with
39426 JSValue::is functions.
39428 * JavaScriptCore.exp: Updated.
39430 * VM/JSPropertyNameIterator.cpp: Removed type() implementation.
39431 (KJS::JSPropertyNameIterator::toPrimitive): Changed to take
39432 PreferredPrimitiveType argument instead of JSType.
39433 * VM/JSPropertyNameIterator.h: Ditto.
39436 (KJS::fastIsNumber): Updated for name change.
39437 (KJS::fastToInt32): Ditto.
39438 (KJS::fastToUInt32): Ditto.
39439 (KJS::jsAddSlowCase): Updated toPrimitive caller for change from
39440 JSType to PreferredPrimitiveType.
39441 (KJS::jsAdd): Replaced calls to JSValue::type() with calls to
39442 JSValue::isString().
39443 (KJS::jsTypeStringForValue): Replaced calls to JSValue::type()
39444 with multiple calls to JSValue::is -- we could make this a
39445 virtual function instead if we want to have faster performance.
39446 (KJS::Machine::privateExecute): Renamed JSImmediate::toTruncatedUInt32
39447 to JSImmediate::getTruncatedUInt32 for consistency with other functions.
39448 Changed two calls of JSValue::type() to JSValue::isString().
39450 * kjs/GetterSetter.cpp:
39451 (KJS::GetterSetter::toPrimitive): Changed to take
39452 PreferredPrimitiveType argument instead of JSType.
39453 (KJS::GetterSetter::isGetterSetter): Added.
39454 * kjs/GetterSetter.h:
39457 (KJS::JSCell::isString): Added.
39458 (KJS::JSCell::isGetterSetter): Added.
39459 (KJS::JSCell::isObject): Added.
39461 * kjs/JSCell.h: Eliminated type function. Added isGetterSetter.
39462 Made isString and isObject virtual. Changed toPrimitive to take
39463 PreferredPrimitiveType argument instead of JSType.
39464 (KJS::JSCell::isNumber): Use Heap::isNumber for faster performance.
39465 (KJS::JSValue::isGetterSetter): Added.
39466 (KJS::JSValue::toPrimitive): Changed to take
39467 PreferredPrimitiveType argument instead of JSType.
39469 * kjs/JSImmediate.h: Removed JSValue::type() and replaced
39470 JSValue::toTruncatedUInt32 with JSValue::getTruncatedUInt32.
39471 (KJS::JSImmediate::isEitherImmediate): Added.
39473 * kjs/JSNotAnObject.cpp:
39474 (KJS::JSNotAnObject::toPrimitive): Changed to take
39475 PreferredPrimitiveType argument instead of JSType.
39476 * kjs/JSNotAnObject.h: Ditto.
39477 * kjs/JSNumberCell.cpp:
39478 (KJS::JSNumberCell::toPrimitive): Ditto.
39479 * kjs/JSNumberCell.h:
39480 (KJS::JSNumberCell::toInt32): Renamed from fastToInt32. There's no
39481 other "slow" version of this once you have a JSNumberCell, so there's
39482 no need for "fast" in the name. It's a feature that this hides the
39483 base class toInt32, which does the same job less efficiently (and has
39484 an additional ExecState argument).
39485 (KJS::JSNumberCell::toUInt32): Ditto.
39487 * kjs/JSObject.cpp:
39488 (KJS::callDefaultValueFunction): Use isGetterSetter instead of type.
39489 (KJS::JSObject::getPrimitiveNumber): Use PreferredPrimitiveType.
39490 (KJS::JSObject::defaultValue): Ditto.
39491 (KJS::JSObject::defineGetter): Use isGetterSetter.
39492 (KJS::JSObject::defineSetter): Ditto.
39493 (KJS::JSObject::lookupGetter): Ditto.
39494 (KJS::JSObject::lookupSetter): Ditto.
39495 (KJS::JSObject::toNumber): Use PreferredPrimitiveType.
39496 (KJS::JSObject::toString): Ditto.
39497 (KJS::JSObject::isObject): Added.
39500 (KJS::JSObject::inherits): Call the isObject from JSCell; it's now
39501 hidden by our override of isObject.
39502 (KJS::JSObject::getOwnPropertySlotForWrite): Use isGetterSetter
39504 (KJS::JSObject::getOwnPropertySlot): Ditto.
39505 (KJS::JSObject::toPrimitive): Use PreferredPrimitiveType.
39507 * kjs/JSString.cpp:
39508 (KJS::JSString::toPrimitive): Use PreferredPrimitiveType.
39509 (KJS::JSString::isString): Added.
39510 * kjs/JSString.h: Ditto.
39512 * kjs/JSValue.h: Removed type(), added isGetterSetter(). Added
39513 PreferredPrimitiveType enum and used it as the argument for the
39514 toPrimitive function.
39515 (KJS::JSValue::getBoolean): Simplified a bit an removed a branch.
39517 * kjs/collector.cpp:
39518 (KJS::typeName): Changed to use JSCell::is functions instead of
39519 calling JSCell::type.
39522 (KJS::Heap::isNumber): Renamed from fastIsNumber.
39524 * kjs/nodes.h: Added now-needed include of JSType, since the type
39525 is used here to record types of values in the tree.
39527 * kjs/operations.cpp:
39528 (KJS::equal): Rewrote to no longer depend on type().
39529 (KJS::strictEqual): Ditto.
39531 2008-08-18 Kevin McCullough <kmccullough@apple.com>
39535 If there are no nodes in a profile all the time should be attributed to
39538 * profiler/Profile.cpp: If ther are no nodes make sure we still process
39540 (KJS::Profile::forEach):
39541 * profiler/ProfileGenerator.cpp: Remove some useless code.
39542 (KJS::ProfileGenerator::stopProfiling):
39544 2008-08-18 Alexey Proskuryakov <ap@webkit.org>
39546 Reviewed by Maciej.
39548 Make JSGlobalContextRetain/Release actually work.
39550 * API/JSContextRef.cpp:
39551 (JSGlobalContextRetain):
39552 (JSGlobalContextRelease):
39553 Ref/deref global data to give checking for globalData.refCount() some sense.
39555 * API/tests/testapi.c: (main): Added a test for this bug.
39557 * kjs/JSGlobalData.cpp:
39558 (KJS::JSGlobalData::~JSGlobalData):
39559 While checking for memory leaks, found that JSGlobalData::emptyList has changed to
39560 a pointer, but it was not destructed, causing a huge leak in run-webkit-tests --threaded.
39562 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39564 Reviewed by Maciej.
39566 Change the counting of constants so that preincrement and predecrement of
39567 const local variables are considered unexpected loads.
39570 (KJS::PrefixResolveNode::emitCode):
39572 (KJS::ScopeNode::neededConstants):
39574 2008-08-17 Oliver Hunt <oliver@apple.com>
39576 Reviewed by Cameron Zwarich.
39578 <rdar://problem/6150322> In Gmail, a crash occurs at KJS::Machine::privateExecute() when applying list styling to text after a quote had been removed
39579 <https://bugs.webkit.org/show_bug.cgi?id=20386>
39581 This crash was caused by "depth()" incorrectly determining the scope depth
39582 of a 0 depth function without a full scope chain. Because such a function
39583 would not have an activation the depth function would return the scope depth
39584 of the parent frame, thus triggering an incorrect unwind. Any subsequent
39585 look up that walked the scope chain would result in incorrect behaviour,
39586 leading to a crash or incorrect variable resolution. This can only actually
39587 happen in try...finally statements as that's the only path that can result in
39588 the need to unwind the scope chain, but not force the function to need a
39591 The fix is simply to check for this case before attempting to walk the scope chain.
39595 (KJS::Machine::throwException):
39597 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39599 Reviewed by Maciej.
39601 Bug 20419: Remove op_jless
39602 <https://bugs.webkit.org/show_bug.cgi?id=20419>
39604 Remove op_jless, which is rarely used now that we have op_loop_if_less.
39606 * VM/CodeBlock.cpp:
39607 (KJS::CodeBlock::dump):
39608 * VM/CodeGenerator.cpp:
39609 (KJS::CodeGenerator::emitJumpIfTrue):
39611 (KJS::Machine::privateExecute):
39614 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39616 Reviewed by Dan Bernstein.
39618 Fix a typo in r35807 that is also causing build failures for
39619 non-AllInOne builds.
39621 * kjs/NumberConstructor.cpp:
39623 2008-08-17 Geoffrey Garen <ggaren@apple.com>
39625 Reviewed by Cameron Zwarich.
39627 Made room for a free word in JSCell.
39629 SunSpider says no change.
39631 I changed JSCallbackObjectData, Arguments, JSArray, and RegExpObject to
39632 store auxiliary data in a secondary structure.
39634 I changed InternalFunction to store the function's name in the property
39637 I changed JSGlobalObjectData to use a virtual destructor, so WebCore's
39638 JSDOMWindowBaseData could inherit from it safely. (It's a strange design
39639 for JSDOMWindowBase to allocate an object that JSGlobalObject deletes,
39640 but that's really our only option, given the size constraint.)
39642 I also added a bunch of compile-time ASSERTs, and removed lots of comments
39643 in JSObject.h because they were often out of date, and they got in the
39644 way of reading what was actually going on.
39646 Also renamed JSArray::getLength to JSArray::length, to match our style
39649 2008-08-16 Geoffrey Garen <ggaren@apple.com>
39651 Reviewed by Oliver Hunt.
39653 Sped up property access for array.length and string.length by adding a
39654 mechanism for returning a temporary value directly instead of returning
39655 a pointer to a function that retrieves the value.
39657 Also removed some unused cruft from PropertySlot.
39659 SunSpider says 0.5% - 1.2% faster.
39661 NOTE: This optimization is not a good idea in general, because it's
39662 actually a pessimization in the case of resolve for assignment,
39663 and it may get in the way of other optimizations in the future.
39665 2008-08-16 Dan Bernstein <mitz@apple.com>
39667 Reviewed by Geoffrey Garen.
39669 Disable dead code stripping in debug builds.
39671 * Configurations/Base.xcconfig:
39672 * JavaScriptCore.xcodeproj/project.pbxproj:
39674 2008-08-15 Mark Rowe <mrowe@apple.com>
39676 Reviewed by Oliver Hunt.
39678 <rdar://problem/6143072> FastMallocZone's enumeration code makes assumptions about handling of remote memory regions that overlap
39680 * wtf/FastMalloc.cpp:
39681 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Don't directly compare pointers mapped into the local process with
39682 a pointer that has not been mapped. Instead, calculate a local address for the pointer and compare with that.
39683 (WTF::TCMallocStats::FreeObjectFinder::findFreeObjects): Pass in the remote address of the central free list so that it can
39684 be used when calculating local addresses.
39685 (WTF::TCMallocStats::FastMallocZone::enumerate): Ditto.
39687 2008-08-15 Mark Rowe <mrowe@apple.com>
39689 Rubber-stamped by Geoff Garen.
39691 <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework
39693 * Configurations/Base.xcconfig: Factor out the debug-only settings so that they can shared
39694 between the Debug configuration and debug Production variant.
39695 * JavaScriptCore.xcodeproj/project.pbxproj: Enable the debug variant.
39697 2008-08-15 Mark Rowe <mrowe@apple.com>
39699 Fix the 64-bit build.
39701 Add extra cast to avoid warnings about loss of precision when casting from
39702 JSValue* to an integer type.
39704 * kjs/JSImmediate.h:
39705 (KJS::JSImmediate::intValue):
39706 (KJS::JSImmediate::uintValue):
39708 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39710 Still fixing Windows build.
39712 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added OpaqueJSString
39713 to yet another place.
39715 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39717 Trying to fix non-Apple builds.
39719 * ForwardingHeaders/JavaScriptCore/OpaqueJSString.h: Added.
39721 2008-08-15 Gavin Barraclough <barraclough@apple.com>
39723 Reviewed by Geoff Garen.
39725 Allow JSImmediate to hold 31 bit signed integer immediate values. The low two bits of a
39726 JSValue* are a tag, with the tag value 00 indicating the JSValue* is a pointer to a
39727 JSCell. Non-zero tag values used to indicate that the JSValue* is not a real pointer,
39728 but instead holds an immediate value encoded within the pointer. This patch changes the
39729 encoding so both the tag values 01 and 11 indicate the value is a signed integer, allowing
39730 a 31 bit value to be stored. All other immediates are tagged with the value 10, and
39731 distinguished by a secondary tag.
39733 Roughly +2% on SunSpider.
39735 * kjs/JSImmediate.h: Encoding of JSImmediates has changed - see comment at head of file for
39736 descption of new layout.
39738 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39742 * API/OpaqueJSString.h: Add a namespace to friend declaration to appease MSVC.
39743 * API/JSStringRefCF.h: (JSStringCreateWithCFString) Cast UniChar* to UChar* explicitly.
39744 * JavaScriptCore.exp: Added OpaqueJSString::create(const KJS::UString&) to fix WebCore build.
39746 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39750 * JavaScriptCore.xcodeproj/project.pbxproj: Marked OpaqueJSString as private
39752 * kjs/identifier.cpp:
39753 (KJS::Identifier::checkSameIdentifierTable):
39754 * kjs/identifier.h:
39755 (KJS::Identifier::add):
39756 Since checkSameIdentifierTable is exported for debug build's sake, gcc wants it to be
39757 non-inline in release builds, too.
39759 * JavaScriptCore.exp: Don't export inline OpaqueJSString destructor.
39761 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39763 Reviewed by Geoff Garen.
39765 JSStringRef is created context-free, but can get linked to one via an identifier table,
39766 breaking an implicit API contract.
39768 Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString.
39770 * API/APICast.h: Removed toRef/toJS conversions for JSStringRef, as this is no longer a
39773 * kjs/identifier.cpp:
39774 (KJS::Identifier::checkSameIdentifierTable):
39775 * kjs/identifier.h:
39776 (KJS::Identifier::add):
39777 (KJS::UString::checkSameIdentifierTable):
39778 Added assertions to verify that an identifier is not being added to a different JSGlobalData.
39780 * API/JSObjectRef.cpp:
39781 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray): Changed OpaqueJSPropertyNameArray to
39782 hold JSStringRefs. This is necessary to avoid having to construct (and leak) a new instance
39783 in JSPropertyNameArrayGetNameAtIndex(), now that making a JSStringRef is not just a typecast.
39785 * API/OpaqueJSString.cpp: Added.
39786 (OpaqueJSString::create):
39787 (OpaqueJSString::ustring):
39788 (OpaqueJSString::identifier):
39789 * API/OpaqueJSString.h: Added.
39790 (OpaqueJSString::create):
39791 (OpaqueJSString::characters):
39792 (OpaqueJSString::length):
39793 (OpaqueJSString::OpaqueJSString):
39794 (OpaqueJSString::~OpaqueJSString):
39797 (JSEvaluateScript):
39798 (JSCheckScriptSyntax):
39799 * API/JSCallbackObjectFunctions.h:
39800 (KJS::::getOwnPropertySlot):
39802 (KJS::::deleteProperty):
39803 (KJS::::staticValueGetter):
39804 (KJS::::callbackGetter):
39805 * API/JSStringRef.cpp:
39806 (JSStringCreateWithCharacters):
39807 (JSStringCreateWithUTF8CString):
39810 (JSStringGetLength):
39811 (JSStringGetCharactersPtr):
39812 (JSStringGetMaximumUTF8CStringSize):
39813 (JSStringGetUTF8CString):
39815 * API/JSStringRefCF.cpp:
39816 (JSStringCreateWithCFString):
39817 (JSStringCopyCFString):
39818 * API/JSValueRef.cpp:
39819 (JSValueMakeString):
39820 (JSValueToStringCopy):
39821 Updated to use OpaqueJSString.
39824 * JavaScriptCore.exp:
39825 * JavaScriptCore.pri:
39826 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
39827 * JavaScriptCore.xcodeproj/project.pbxproj:
39828 * JavaScriptCoreSources.bkl:
39829 Added OpaqueJSString.
39831 2008-08-14 Kevin McCullough <kmccullough@apple.com>
39835 <rdar://problem/6115819> Notify of profile in console
39836 - Profiles now have a unique ID so that they can be linked to the
39837 console message that announces that a profile completed.
39839 * profiler/HeavyProfile.cpp:
39840 (KJS::HeavyProfile::HeavyProfile):
39841 * profiler/Profile.cpp:
39842 (KJS::Profile::create):
39843 (KJS::Profile::Profile):
39844 * profiler/Profile.h:
39845 (KJS::Profile::uid):
39846 * profiler/ProfileGenerator.cpp:
39847 (KJS::ProfileGenerator::create):
39848 (KJS::ProfileGenerator::ProfileGenerator):
39849 * profiler/ProfileGenerator.h:
39850 * profiler/Profiler.cpp:
39851 (KJS::Profiler::startProfiling):
39852 * profiler/TreeProfile.cpp:
39853 (KJS::TreeProfile::create):
39854 (KJS::TreeProfile::TreeProfile):
39855 * profiler/TreeProfile.h:
39857 2008-08-13 Geoffrey Garen <ggaren@apple.com>
39859 Reviewed by Oliver Hunt.
39861 Nixed a PIC branch from JSObject::getOwnPropertySlot, by forcing
39862 fillGetterProperty, which references a global function pointer,
39865 .2% SunSpider speedup, 4.3% access-nbody speedup, 8.7% speedup on a
39866 custom property access benchmark for objects with one property.
39868 * kjs/JSObject.cpp:
39869 (KJS::JSObject::fillGetterPropertySlot):
39871 2008-08-13 Alp Toker <alp@nuanti.com>
39873 Reviewed by Eric Seidel.
39875 https://bugs.webkit.org/show_bug.cgi?id=20349
39876 WTF::initializeThreading() fails if threading is already initialized
39878 Fix threading initialization logic to support cases where
39879 g_thread_init() has already been called elsewhere.
39881 Resolves database-related crashers reported in several applications.
39883 * wtf/ThreadingGtk.cpp:
39884 (WTF::initializeThreading):
39886 2008-08-13 Brad Hughes <bhughes@trolltech.com>
39890 Fix compiling of QtWebKit in release mode with the Intel C++ Compiler for Linux
39892 The latest upgrade of the intel compiler allows us to compile all of
39893 Qt with optimizations enabled (yay!).
39895 * JavaScriptCore.pro:
39897 2008-08-12 Oliver Hunt <oliver@apple.com>
39899 Reviewed by Geoff Garen.
39901 Add peephole optimisation to 'op_not... jfalse...' (eg. if(!...) )
39903 This is a very slight win in sunspider, and a fairly substantial win
39904 in hot code that does if(!...), etc.
39906 * VM/CodeGenerator.cpp:
39907 (KJS::CodeGenerator::retrieveLastUnaryOp):
39908 (KJS::CodeGenerator::rewindBinaryOp):
39909 (KJS::CodeGenerator::rewindUnaryOp):
39910 (KJS::CodeGenerator::emitJumpIfFalse):
39911 * VM/CodeGenerator.h:
39913 2008-08-12 Dan Bernstein <mitz@apple.com>
39915 - JavaScriptCore part of <rdar://problem/6121636>
39916 Make fast*alloc() abort() on failure and add "try" variants that
39917 return NULL on failure.
39919 Reviewed by Darin Adler.
39921 * JavaScriptCore.exp: Exported tryFastCalloc().
39922 * VM/RegisterFile.h:
39923 (KJS::RegisterFile::RegisterFile): Removed an ASSERT().
39925 (KJS::JSArray::putSlowCase): Changed to use tryFastRealloc().
39926 (KJS::JSArray::increaseVectorLength): Ditto.
39928 (KJS::allocChars): Changed to use tryFastMalloc().
39929 (KJS::reallocChars): Changed to use tryFastRealloc().
39930 * wtf/FastMalloc.cpp:
39931 (WTF::fastZeroedMalloc): Removed null checking of fastMalloc()'s result
39932 and removed extra call to InvokeNewHook().
39933 (WTF::tryFastZeroedMalloc): Added. Uses tryFastMalloc().
39934 (WTF::tryFastMalloc): Renamed fastMalloc() to this.
39935 (WTF::fastMalloc): Added. This version abort()s if allocation fails.
39936 (WTF::tryFastCalloc): Renamed fastCalloc() to this.
39937 (WTF::fastCalloc): Added. This version abort()s if allocation fails.
39938 (WTF::tryFastRealloc): Renamed fastRealloc() to this.
39939 (WTF::fastRealloc): Added. This version abort()s if allocation fails.
39940 (WTF::do_malloc): Made this a function template. When the abortOnFailure
39941 template parameter is set, the function abort()s on failure to allocate.
39942 Otherwise, it sets errno to ENOMEM and returns zero.
39943 (WTF::TCMallocStats::fastMalloc): Defined to abort() on failure.
39944 (WTF::TCMallocStats::tryFastMalloc): Added. Does not abort() on
39946 (WTF::TCMallocStats::fastCalloc): Defined to abort() on failure.
39947 (WTF::TCMallocStats::tryFastCalloc): Added. Does not abort() on
39949 (WTF::TCMallocStats::fastRealloc): Defined to abort() on failure.
39950 (WTF::TCMallocStats::tryFastRealloc): Added. Does not abort() on
39952 * wtf/FastMalloc.h: Declared the "try" variants.
39954 2008-08-11 Adam Roben <aroben@apple.com>
39956 Move WTF::notFound into its own header so that it can be used
39957 independently of Vector
39959 Rubberstamped by Darin Adler.
39961 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
39962 * JavaScriptCore.xcodeproj/project.pbxproj:
39963 Added NotFound.h to the project.
39964 * wtf/NotFound.h: Added. Moved the notFound constant here...
39965 * wtf/Vector.h: ...from here.
39967 2008-08-11 Alexey Proskuryakov <ap@webkit.org>
39969 Reviewed by Mark Rowe.
39971 <rdar://problem/6130393> REGRESSION: PhotoBooth hangs after launching under TOT Webkit
39973 * API/JSContextRef.cpp: (JSGlobalContextRelease): Corrected a comment.
39975 * kjs/collector.cpp: (KJS::Heap::~Heap): Ensure that JSGlobalData is not deleted while
39978 == Rolled over to ChangeLog-2008-08-10 ==