1 2009-02-13 Geoffrey Garen <ggaren@apple.com>
3 Reviewed by Darin Adler.
5 Fixed <rdar://problem/6584057> Optimize sort by JS numeric comparison
6 function not to run the comparison function
8 * bytecode/CodeBlock.cpp:
9 (JSC::CodeBlock::CodeBlock):
10 * bytecode/CodeBlock.h:
11 (JSC::CodeBlock::setIsNumericCompareFunction):
12 (JSC::CodeBlock::isNumericCompareFunction): Added the ability to track
13 whether a CodeBlock performs a sort-like numeric comparison.
15 * bytecompiler/BytecodeGenerator.cpp:
16 (JSC::BytecodeGenerator::generate): Set the isNumericCompareFunction bit
20 (JSC::FunctionBodyNode::emitBytecode): Fixed a bug that caused us to
21 codegen an extra return at the end of all functions (eek!), since this
22 made it harder / weirder to detect the numeric comparison pattern in
25 * runtime/ArrayPrototype.cpp:
26 (JSC::arrayProtoFuncSort): Use the isNumericCompareFunction bit to do
27 a faster sort if we can.
29 * runtime/FunctionConstructor.cpp:
30 (JSC::extractFunctionBody):
31 (JSC::constructFunction):
32 * runtime/FunctionConstructor.h: Renamed and exported extractFunctionBody for
33 use in initializing lazyNumericCompareFunction.
35 * runtime/JSArray.cpp:
36 (JSC::compareNumbersForQSort):
37 (JSC::compareByStringPairForQSort):
38 (JSC::JSArray::sortNumeric):
40 * runtime/JSArray.h: Added a fast numeric sort. Renamed ArrayQSortPair
41 to be more specific since we do different kinds of qsort now.
43 * runtime/JSGlobalData.cpp:
44 (JSC::JSGlobalData::JSGlobalData):
45 (JSC::JSGlobalData::numericCompareFunction):
46 (JSC::JSGlobalData::ClientData::~ClientData):
47 * runtime/JSGlobalData.h: Added helper data for computing the
48 isNumericCompareFunction bit.
50 2009-02-13 Darin Adler <darin@apple.com>
52 * Configurations/JavaScriptCore.xcconfig: Undo accidental commit of this file.
54 2009-02-12 Darin Adler <darin@apple.com>
56 Reviewed by Oliver Hunt and Alexey Proskuryakov.
58 Speed up a couple string functions.
60 * runtime/StringPrototype.cpp:
61 (JSC::stringProtoFuncIndexOf): Added a fast path for cases where the second
62 argument is either missing or an integer.
63 (JSC::stringProtoFuncBig): Use jsNontrivialString since the string is guaranteed
64 to be 2 or more characters long.
65 (JSC::stringProtoFuncSmall): Ditto.
66 (JSC::stringProtoFuncBlink): Ditto.
67 (JSC::stringProtoFuncBold): Ditto.
68 (JSC::stringProtoFuncItalics): Ditto.
69 (JSC::stringProtoFuncStrike): Ditto.
70 (JSC::stringProtoFuncSub): Ditto.
71 (JSC::stringProtoFuncSup): Ditto.
72 (JSC::stringProtoFuncFontcolor): Ditto.
73 (JSC::stringProtoFuncFontsize): Make the fast path Sam recently added even faster
74 by avoiding all but the minimum memory allocation.
75 (JSC::stringProtoFuncAnchor): Use jsNontrivialString.
76 (JSC::stringProtoFuncLink): Added a fast path.
78 * runtime/UString.cpp:
79 (JSC::UString::find): Added a fast path for single-character search strings.
81 2009-02-13 David Levin <levin@chromium.org>
83 Reviewed by Darin Adler.
85 Bug 23926: Race condition in callOnMainThreadAndWait
86 <https://bugs.webkit.org/show_bug.cgi?id=23926>
89 Removed callOnMainThreadAndWait since it isn't used.
91 2009-02-13 Oliver Hunt <oliver@apple.com>
93 Reviewed by Jon Honeycutt.
95 Math.random is really slow on windows.
97 Math.random calls WTF::randomNumber which is implemented as
98 the secure rand_s on windows. Unfortunately rand_s is an order
99 of magnitude slower than arc4random. For this reason I've
100 added "weakRandomNumber" for use by JavaScript's Math Object.
101 In the long term we should look at using our own secure PRNG
102 in place of the system, but this will do for now.
104 30% win on SunSpider on Windows, resolving most of the remaining
107 * runtime/MathObject.cpp:
108 (JSC::MathObject::MathObject):
109 (JSC::mathProtoFuncRandom):
110 * wtf/RandomNumber.cpp:
111 (WTF::weakRandomNumber):
113 * wtf/RandomNumber.h:
114 * wtf/RandomNumberSeed.h:
115 (WTF::initializeWeakRandomNumberGenerator):
117 2009-02-12 Mark Rowe <mrowe@apple.com>
119 Fix the build for other platforms.
121 * wtf/RandomNumber.cpp:
124 2009-02-12 Gavin Barraclough <barraclough@apple.com>
126 Reviewed by Sam Weinig.
128 Remove (/reduce) use of hard-wired register names from the JIT.
129 Currently there is no abstraction of registers used in the JIT,
130 which has a number of negative consequences. Hard-wiring x86
131 register names makes the JIT less portable to other platforms,
132 and prevents us from performing dynamic register allocation to
133 attempt to maintain more temporary values in machine registers.
134 (The latter will be more important on x86-64, where we have more
135 registers to make use of).
137 Also, remove MacroAssembler::mod32. This was not providing a
138 useful abstraction, and was not in keeping with the rest of the
139 MacroAssembler interface, in having specific register requirements.
141 * assembler/MacroAssemblerX86Common.h:
143 (JSC::JIT::compileOpStrictEq):
144 (JSC::JIT::emitSlowScriptCheck):
145 (JSC::JIT::privateCompileMainPass):
146 (JSC::JIT::privateCompileSlowCases):
147 (JSC::JIT::privateCompile):
148 (JSC::JIT::privateCompileCTIMachineTrampolines):
150 * jit/JITArithmetic.cpp:
151 (JSC::JIT::compileFastArith_op_lshift):
152 (JSC::JIT::compileFastArithSlow_op_lshift):
153 (JSC::JIT::compileFastArith_op_rshift):
154 (JSC::JIT::compileFastArithSlow_op_rshift):
155 (JSC::JIT::compileFastArith_op_bitand):
156 (JSC::JIT::compileFastArithSlow_op_bitand):
157 (JSC::JIT::compileFastArith_op_mod):
158 (JSC::JIT::compileFastArithSlow_op_mod):
159 (JSC::JIT::compileFastArith_op_post_inc):
160 (JSC::JIT::compileFastArithSlow_op_post_inc):
161 (JSC::JIT::compileFastArith_op_post_dec):
162 (JSC::JIT::compileFastArithSlow_op_post_dec):
163 (JSC::JIT::compileFastArith_op_pre_inc):
164 (JSC::JIT::compileFastArithSlow_op_pre_inc):
165 (JSC::JIT::compileFastArith_op_pre_dec):
166 (JSC::JIT::compileFastArithSlow_op_pre_dec):
167 (JSC::JIT::compileFastArith_op_add):
168 (JSC::JIT::compileFastArith_op_mul):
169 (JSC::JIT::compileFastArith_op_sub):
170 (JSC::JIT::compileBinaryArithOp):
172 (JSC::JIT::compileOpCallInitializeCallFrame):
173 (JSC::JIT::compileOpCallSetupArgs):
174 (JSC::JIT::compileOpCallEvalSetupArgs):
175 (JSC::JIT::compileOpConstructSetupArgs):
176 (JSC::JIT::compileOpCall):
177 (JSC::JIT::compileOpCallSlowCase):
178 * jit/JITInlineMethods.h:
179 (JSC::JIT::emitGetVirtualRegister):
180 (JSC::JIT::emitPutVirtualRegister):
181 (JSC::JIT::emitNakedCall):
182 (JSC::JIT::restoreArgumentReference):
183 (JSC::JIT::restoreArgumentReferenceForTrampoline):
184 * jit/JITPropertyAccess.cpp:
185 (JSC::JIT::compileGetByIdHotPath):
186 (JSC::JIT::compilePutByIdHotPath):
187 (JSC::JIT::compileGetByIdSlowCase):
188 (JSC::JIT::compilePutByIdSlowCase):
189 (JSC::JIT::privateCompilePutByIdTransition):
190 (JSC::JIT::privateCompilePatchGetArrayLength):
191 (JSC::JIT::privateCompileGetByIdSelf):
192 (JSC::JIT::privateCompileGetByIdProto):
193 (JSC::JIT::privateCompileGetByIdSelfList):
194 (JSC::JIT::privateCompileGetByIdProtoList):
195 (JSC::JIT::privateCompileGetByIdChainList):
196 (JSC::JIT::privateCompileGetByIdChain):
197 (JSC::JIT::privateCompilePutByIdReplace):
199 2009-02-12 Horia Olaru <olaru@adobe.com>
201 Reviewed by Oliver Hunt.
203 https://bugs.webkit.org/show_bug.cgi?id=23400
205 When throwing an exception within an eval argument string, the dst parameter was
206 modified in the functions below and the return value for eval was altered. Changed
207 the emitNode call in JSC::ThrowNode::emitBytecode to use a temporary register
208 to store its results instead of dst. The JSC::FunctionCallResolveNode::emitBytecode
209 would load the function within the dst registry, also altering the result returned
210 by eval. Replaced it with another temporary.
213 (JSC::FunctionCallResolveNode::emitBytecode):
214 (JSC::ThrowNode::emitBytecode):
216 2009-02-12 Sam Weinig <sam@webkit.org>
218 Reviewed by Geoffrey Garen.
220 Speed up String.prototype.fontsize.
222 * runtime/StringPrototype.cpp:
223 (JSC::stringProtoFuncFontsize): Specialize for defined/commonly used values.
225 2009-02-12 Geoffrey Garen <ggaren@apple.com>
227 Reviewed by Sam Weinig.
231 * wtf/RandomNumber.cpp:
232 (WTF::randomNumber): Divide by the maximum representable value, which
233 is different on each platform now, to get values between 0 and 1.
235 2009-02-12 Geoffrey Garen <ggaren@apple.com>
239 * wtf/RandomNumber.cpp:
242 2009-02-12 Geoffrey Garen <ggaren@apple.com>
244 Reviewed by Sam Weinig.
246 Fixed <rdar://problem/6582048>.
248 * wtf/RandomNumber.cpp:
249 (WTF::randomNumber): Make only one call to the random number generator
250 on platforms where the generator is cryptographically secure. The value
251 of randomness over and above cryptographically secure randomness is not
252 clear, and it caused some performance problems.
254 2009-02-12 Adam Roben <aroben@apple.com>
256 Fix lots of Perl warnings when building JavaScriptCoreGenerated on
259 Reviewed by John Sullivan.
261 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
262 Create the docs/ directory so that we can write bytecode.html into it.
263 This matches what JavaScriptCore.xcodeproj does.
265 2009-02-12 Simon Hausmann <simon.hausmann@nokia.com>
267 Rubber-stamped by Lars.
269 Re-enable the JIT in the Qt build with -fno-stack-protector on Linux.
271 * JavaScriptCore.pri:
273 2009-02-11 Dmitry Titov <dimich@chromium.org>
275 Reviewed by Alexey Proskuryakov.
277 https://bugs.webkit.org/show_bug.cgi?id=23705
278 Fix the UI freeze caused by Worker generating a flood of messages.
279 Measure time we spend in executing posted work items. If too much time is spent
280 without returning to the run loop, exit and reschedule.
283 Added initializeMainThreadPlatform() to initialize low-level mechanism for posting
284 work items from thread to thread. This removes #ifdefs for WIN and CHROMIUM from platform-independent code.
286 * wtf/MainThread.cpp:
287 (WTF::initializeMainThread):
288 (WTF::dispatchFunctionsFromMainThread):
289 Instead of dispatching all work items in the queue, dispatch them one by one
290 and measure elapsed time. After a threshold, reschedule and quit.
292 (WTF::callOnMainThread):
293 (WTF::callOnMainThreadAndWait):
294 Only schedule dispatch if the queue was empty - to avoid many posted messages in the run loop queue.
296 * wtf/mac/MainThreadMac.mm:
297 (WTF::scheduleDispatchFunctionsOnMainThread):
298 Use static instance of the mainThreadCaller instead of allocating and releasing it each time.
299 (WTF::initializeMainThreadPlatform):
300 * wtf/gtk/MainThreadChromium.cpp:
301 (WTF::initializeMainThreadPlatform):
302 * wtf/gtk/MainThreadGtk.cpp:
303 (WTF::initializeMainThreadPlatform):
304 * wtf/qt/MainThreadQt.cpp:
305 (WTF::initializeMainThreadPlatform):
306 * wtf/win/MainThreadWin.cpp:
307 (WTF::initializeMainThreadPlatform):
308 * wtf/wx/MainThreadWx.cpp:
309 (WTF::initializeMainThreadPlatform):
311 2009-02-11 Sam Weinig <sam@webkit.org>
313 Reviewed by Gavin Barraclough.
317 * assembler/AbstractMacroAssembler.h:
318 (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
319 (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
320 (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
321 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
322 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
323 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
324 (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
325 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
326 (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
327 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
328 (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
329 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
330 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
331 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
332 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
333 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
334 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
335 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
336 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
337 (JSC::AbstractMacroAssembler::PatchBuffer::link):
338 (JSC::::CodeLocationCommon::labelAtOffset):
339 (JSC::::CodeLocationCommon::jumpAtOffset):
340 (JSC::::CodeLocationCommon::callAtOffset):
341 (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
342 (JSC::::CodeLocationCommon::dataLabel32AtOffset):
344 2009-02-11 Sam Weinig <sam@webkit.org>
346 Reviewed by Gavin Barraclough.
348 * assembler/AbstractMacroAssembler.h: Fix comments.
350 2009-02-11 Alexey Proskuryakov <ap@webkit.org>
352 Trying to fix wx build.
354 * bytecode/JumpTable.h: Include "MacroAssembler.h", not <MacroAssembler.h>.
355 * jscore.bkl: Added assembler directory to search paths.
357 2009-02-10 Gavin Barraclough <barraclough@apple.com>
366 * bytecode/Instruction.h:
367 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
368 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
370 2009-02-10 Gavin Barraclough <barraclough@apple.com>
372 Reviewed by Oliver Hunt.
374 Reduce use of void* / reinterpret_cast in JIT repatching code,
375 add strong types for Calls and for the various types of pointers
376 we retain into the JIT generated instruction stream.
378 No performance impact.
380 * assembler/AbstractMacroAssembler.h:
381 (JSC::AbstractMacroAssembler::ImmPtr::ImmPtr):
382 (JSC::AbstractMacroAssembler::ImmPtr::asIntptr):
383 (JSC::AbstractMacroAssembler::Imm32::Imm32):
384 (JSC::AbstractMacroAssembler::Label::Label):
385 (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
386 (JSC::AbstractMacroAssembler::Call::Call):
387 (JSC::AbstractMacroAssembler::Call::link):
388 (JSC::AbstractMacroAssembler::Call::linkTo):
389 (JSC::AbstractMacroAssembler::Jump::Jump):
390 (JSC::AbstractMacroAssembler::Jump::linkTo):
391 (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
392 (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
393 (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
394 (JSC::AbstractMacroAssembler::CodeLocationLabel::CodeLocationLabel):
395 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
396 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
397 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
398 (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
399 (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
400 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
401 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
402 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
403 (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
404 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
405 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
406 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
407 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
408 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
409 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
410 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
411 (JSC::AbstractMacroAssembler::PatchBuffer::entry):
412 (JSC::AbstractMacroAssembler::PatchBuffer::trampolineAt):
413 (JSC::AbstractMacroAssembler::PatchBuffer::link):
414 (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
415 (JSC::AbstractMacroAssembler::PatchBuffer::patch):
416 (JSC::AbstractMacroAssembler::PatchBuffer::locationOf):
417 (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
418 (JSC::AbstractMacroAssembler::differenceBetween):
419 (JSC::::CodeLocationCommon::labelAtOffset):
420 (JSC::::CodeLocationCommon::jumpAtOffset):
421 (JSC::::CodeLocationCommon::callAtOffset):
422 (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
423 (JSC::::CodeLocationCommon::dataLabel32AtOffset):
424 * assembler/MacroAssemblerX86Common.h:
425 (JSC::MacroAssemblerX86Common::call):
426 * assembler/X86Assembler.h:
427 (JSC::X86Assembler::getCallReturnOffset):
428 * bytecode/CodeBlock.h:
429 (JSC::CallLinkInfo::CallLinkInfo):
430 (JSC::getStructureStubInfoReturnLocation):
431 (JSC::getCallLinkInfoReturnLocation):
432 * bytecode/Instruction.h:
433 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
434 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
435 * bytecode/JumpTable.h:
436 (JSC::StringJumpTable::ctiForValue):
437 (JSC::SimpleJumpTable::ctiForValue):
438 * bytecode/StructureStubInfo.h:
439 (JSC::StructureStubInfo::StructureStubInfo):
440 * bytecompiler/BytecodeGenerator.cpp:
441 (JSC::BytecodeGenerator::emitCatch):
442 (JSC::prepareJumpTableForStringSwitch):
443 * interpreter/Interpreter.cpp:
444 (JSC::Interpreter::cti_op_get_by_id_self_fail):
445 (JSC::getPolymorphicAccessStructureListSlot):
446 (JSC::Interpreter::cti_op_throw):
447 (JSC::Interpreter::cti_op_switch_imm):
448 (JSC::Interpreter::cti_op_switch_char):
449 (JSC::Interpreter::cti_op_switch_string):
450 (JSC::Interpreter::cti_vm_throw):
452 (JSC::ctiSetReturnAddress):
453 (JSC::ctiPatchCallByReturnAddress):
454 (JSC::JIT::privateCompile):
455 (JSC::JIT::privateCompileCTIMachineTrampolines):
457 (JSC::CallRecord::CallRecord):
458 (JSC::JIT::compileGetByIdSelf):
459 (JSC::JIT::compileGetByIdProto):
460 (JSC::JIT::compileGetByIdChain):
461 (JSC::JIT::compilePutByIdReplace):
462 (JSC::JIT::compilePutByIdTransition):
463 (JSC::JIT::compilePatchGetArrayLength):
464 (JSC::JIT::emitCTICall):
466 (JSC::JIT::unlinkCall):
467 (JSC::JIT::linkCall):
468 * jit/JITInlineMethods.h:
469 (JSC::JIT::emitNakedCall):
470 (JSC::JIT::emitCTICall_internal):
471 * jit/JITPropertyAccess.cpp:
472 (JSC::JIT::compileGetByIdSlowCase):
473 (JSC::JIT::compilePutByIdSlowCase):
474 (JSC::JIT::privateCompilePutByIdTransition):
475 (JSC::JIT::patchGetByIdSelf):
476 (JSC::JIT::patchPutByIdReplace):
477 (JSC::JIT::privateCompilePatchGetArrayLength):
478 (JSC::JIT::privateCompileGetByIdSelf):
479 (JSC::JIT::privateCompileGetByIdProto):
480 (JSC::JIT::privateCompileGetByIdSelfList):
481 (JSC::JIT::privateCompileGetByIdProtoList):
482 (JSC::JIT::privateCompileGetByIdChainList):
483 (JSC::JIT::privateCompileGetByIdChain):
484 (JSC::JIT::privateCompilePutByIdReplace):
486 2009-02-10 Adam Roben <aroben@apple.com>
488 Windows build fix after r40813
490 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added profiler/ to the include
491 path so that Profiler.h can be found.
493 2009-02-09 Gavin Barraclough <barraclough@apple.com>
495 Reviewed by Oliver Hunt.
497 Provide a class type for a generated block of JIT code.
498 Also changes the return address -> bytecode index map to
499 track the return addess as an unsigned offset into the code
500 instead of a ptrdiff_t in terms of void**s - the latter is
501 equal to the actual offset / sizeof(void*), making it a
502 potentially lossy representation.
504 * JavaScriptCore.xcodeproj/project.pbxproj:
505 * assembler/AbstractMacroAssembler.h:
506 (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
507 * assembler/X86Assembler.h:
508 (JSC::X86Assembler::getCallReturnOffset):
509 * bytecode/CodeBlock.h:
510 (JSC::CallReturnOffsetToBytecodeIndex::CallReturnOffsetToBytecodeIndex):
511 (JSC::getCallReturnOffset):
512 (JSC::CodeBlock::getBytecodeIndex):
513 (JSC::CodeBlock::jitCode):
514 (JSC::CodeBlock::callReturnIndexVector):
515 * interpreter/Interpreter.cpp:
516 (JSC::Interpreter::execute):
517 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
518 (JSC::Interpreter::cti_vm_lazyLinkCall):
520 (JSC::JIT::privateCompile):
524 (JSC::JIT::linkCall):
525 * jit/JITCode.h: Added.
527 (JSC::JITCode::JITCode):
528 (JSC::JITCode::operator bool):
529 (JSC::JITCode::addressForCall):
530 (JSC::JITCode::offsetOf):
531 (JSC::JITCode::execute):
533 2009-02-09 John Grabowski <jrg@chromium.org>
535 Reviewed by Darin Adler.
537 https://bugs.webkit.org/show_bug.cgi?id=23856
538 Change the definition of "main thread" for Chromium on OSX.
539 It does not match the DARWIN definition.
541 * wtf/ThreadingPthreads.cpp:
542 (WTF::initializeThreading):
545 2009-02-09 Gavin Barraclough <barraclough@apple.com>
547 Reviewed by Oliver Hunt.
549 Minor bugfix, incorrect check meant that subtraction causing integer overflow
550 would be missed on x86-64 JIT.
552 * jit/JITArithmetic.cpp:
553 (JSC::JIT::compileBinaryArithOp):
555 2009-02-09 Gavin Barraclough <barraclough@apple.com>
557 Reviewed by Oliver Hunt.
559 A more sensible register allocation for x86-64.
561 When WREC was ported to x86-64 it stuck with the same register allocation as x86.
562 This requires registers to be reordered on entry into WREC generated code, since
563 argument passing is different on x86-64 and x86 (regparm(3)). This patch switches
564 x86-64 to use a native register allocation, that does not require argument registers
567 * wrec/WRECGenerator.cpp:
568 (JSC::WREC::Generator::generateEnter):
569 (JSC::WREC::Generator::generateReturnSuccess):
570 (JSC::WREC::Generator::generateReturnFailure):
571 * wrec/WRECGenerator.h:
573 2009-02-05 Adam Roben <aroben@apple.com>
577 Rubberstamped by Sam Weinig.
579 * wtf/TypeTraits.h: Include Platform.h, since this header uses macros
582 2009-02-05 Dimitri Glazkov <dglazkov@chromium.org>
584 Reviewed by Eric Seidel.
586 https://bugs.webkit.org/show_bug.cgi?id=23747
587 Add Chromium threading-related files.
589 * wtf/MainThread.cpp: Added platform guard to initializeMainThread.
590 * wtf/chromium/ChromiumThreading.h: Added.
591 * wtf/chromium/MainThreadChromium.cpp: Added.
592 (WTF::initializeMainThread):
593 (WTF::scheduleDispatchFunctionsOnMainThread):
595 2009-02-05 David Levin <levin@chromium.org>
597 Reviewed by Darin Adler.
599 Bug 23713: COMPILE_ASSERTS should be moved out of TypeTraits.h and into .cpp file
600 <https://bugs.webkit.org/show_bug.cgi?id=23713>
603 * JavaScriptCore.pri:
604 * JavaScriptCore.scons:
605 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
606 * JavaScriptCore.xcodeproj/project.pbxproj:
607 * JavaScriptCoreSources.bkl:
610 Remove unnecessary header file that I missed when moving out the type traits form this file.
612 * wtf/TypeTraits.cpp: Added.
615 Moved the compile asserts into TypeTraits.cpp file.
617 2009-02-04 Gavin Barraclough <barraclough@apple.com>
619 Reviewed by Oliver 'the nun' Hunt.
621 Add -e switch to jsc to enable evaluation of scripts passed on the command line.
626 (printUsageStatement):
630 2009-02-04 Gavin Barraclough <barraclough@apple.com>
632 Rubber stamped by Sam 'Big Mac' Weinig.
634 * assembler/AbstractMacroAssembler.h: Copied from assembler/MacroAssembler.h.
635 * assembler/MacroAssemblerX86.h: Copied from assembler/MacroAssembler.h.
636 * assembler/MacroAssemblerX86Common.h: Copied from assembler/MacroAssembler.h.
637 * assembler/MacroAssemblerX86_64.h: Copied from assembler/MacroAssembler.h.
639 2009-02-04 Gavin Barraclough <barraclough@apple.com>
641 Reviewed by Sam Weinig.
643 This patch tidies up the MacroAssembler, cleaning up the code and refactoring out the
644 platform-specific parts. The MacroAssembler gets split up like a beef burger, with the
645 platform-agnostic data types being the lower bun (in the form of the class AbstractMacroAssembler),
646 the plaform-specific code generation forming a big meaty patty of methods like 'add32',
647 'branch32', etc (MacroAssemblerX86), and finally topped off with the bun-lid of the
648 MacroAssembler class itself, providing covenience methods such as the stack peek & poke,
649 and backwards branch methods, all of which can be described in a platform independent
650 way using methods from the base class. The AbstractMacroAssembler is templated on the
651 type of the assembler class that will be used for code generation, and the three layers
652 are held together with the cocktail stick of inheritance.
654 The above description is a slight simplification since the MacroAssemblerX86 is actually
655 formed from two layers (in effect giving us a kind on bacon double cheeseburger) - with the
656 bulk of methods that are common between x86 & x86-64 implemented in MacroAssemblerX86Common,
657 which forms a base class for MacroAssemblerX86 and MacroAssemblerX86_64 (which add the methods
658 specific to the given platform).
660 I'm landing these changes first without splitting the classes across multiple files,
661 I will follow up with a second patch to split up the file MacroAssembler.h.
663 * assembler/MacroAssembler.h:
664 (JSC::AbstractMacroAssembler::):
665 (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
666 (JSC::AbstractMacroAssembler::DataLabelPtr::patch):
667 (JSC::AbstractMacroAssembler::DataLabel32::DataLabel32):
668 (JSC::AbstractMacroAssembler::DataLabel32::patch):
669 (JSC::AbstractMacroAssembler::Label::Label):
670 (JSC::AbstractMacroAssembler::Jump::Jump):
671 (JSC::AbstractMacroAssembler::Jump::link):
672 (JSC::AbstractMacroAssembler::Jump::linkTo):
673 (JSC::AbstractMacroAssembler::Jump::patch):
674 (JSC::AbstractMacroAssembler::JumpList::link):
675 (JSC::AbstractMacroAssembler::JumpList::linkTo):
676 (JSC::AbstractMacroAssembler::PatchBuffer::link):
677 (JSC::AbstractMacroAssembler::PatchBuffer::addressOf):
678 (JSC::AbstractMacroAssembler::PatchBuffer::setPtr):
679 (JSC::AbstractMacroAssembler::size):
680 (JSC::AbstractMacroAssembler::copyCode):
681 (JSC::AbstractMacroAssembler::label):
682 (JSC::AbstractMacroAssembler::align):
683 (JSC::AbstractMacroAssembler::differenceBetween):
684 (JSC::MacroAssemblerX86Common::xor32):
685 (JSC::MacroAssemblerX86Common::load32WithAddressOffsetPatch):
686 (JSC::MacroAssemblerX86Common::store32WithAddressOffsetPatch):
687 (JSC::MacroAssemblerX86Common::move):
688 (JSC::MacroAssemblerX86Common::swap):
689 (JSC::MacroAssemblerX86Common::signExtend32ToPtr):
690 (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr):
691 (JSC::MacroAssemblerX86Common::branch32):
692 (JSC::MacroAssemblerX86Common::jump):
693 (JSC::MacroAssemblerX86_64::add32):
694 (JSC::MacroAssemblerX86_64::sub32):
695 (JSC::MacroAssemblerX86_64::load32):
696 (JSC::MacroAssemblerX86_64::store32):
697 (JSC::MacroAssemblerX86_64::addPtr):
698 (JSC::MacroAssemblerX86_64::andPtr):
699 (JSC::MacroAssemblerX86_64::orPtr):
700 (JSC::MacroAssemblerX86_64::rshiftPtr):
701 (JSC::MacroAssemblerX86_64::subPtr):
702 (JSC::MacroAssemblerX86_64::xorPtr):
703 (JSC::MacroAssemblerX86_64::loadPtr):
704 (JSC::MacroAssemblerX86_64::loadPtrWithAddressOffsetPatch):
705 (JSC::MacroAssemblerX86_64::storePtr):
706 (JSC::MacroAssemblerX86_64::storePtrWithAddressOffsetPatch):
707 (JSC::MacroAssemblerX86_64::branchPtr):
708 (JSC::MacroAssemblerX86_64::branchTestPtr):
709 (JSC::MacroAssemblerX86_64::branchAddPtr):
710 (JSC::MacroAssemblerX86_64::branchSubPtr):
711 (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
712 (JSC::MacroAssemblerX86_64::storePtrWithPatch):
713 (JSC::MacroAssemblerX86::add32):
714 (JSC::MacroAssemblerX86::sub32):
715 (JSC::MacroAssemblerX86::load32):
716 (JSC::MacroAssemblerX86::store32):
717 (JSC::MacroAssemblerX86::branch32):
718 (JSC::MacroAssemblerX86::branchPtrWithPatch):
719 (JSC::MacroAssemblerX86::storePtrWithPatch):
720 (JSC::MacroAssembler::pop):
721 (JSC::MacroAssembler::peek):
722 (JSC::MacroAssembler::poke):
723 (JSC::MacroAssembler::branchPtr):
724 (JSC::MacroAssembler::branch32):
725 (JSC::MacroAssembler::branch16):
726 (JSC::MacroAssembler::branchTestPtr):
727 (JSC::MacroAssembler::addPtr):
728 (JSC::MacroAssembler::andPtr):
729 (JSC::MacroAssembler::orPtr):
730 (JSC::MacroAssembler::rshiftPtr):
731 (JSC::MacroAssembler::subPtr):
732 (JSC::MacroAssembler::xorPtr):
733 (JSC::MacroAssembler::loadPtr):
734 (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
735 (JSC::MacroAssembler::storePtr):
736 (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
737 (JSC::MacroAssembler::branchAddPtr):
738 (JSC::MacroAssembler::branchSubPtr):
739 * jit/JITArithmetic.cpp:
740 (JSC::JIT::compileBinaryArithOp):
742 2009-02-04 Alexey Proskuryakov <ap@webkit.org>
744 Reviewed by Sam Weinig.
746 https://bugs.webkit.org/show_bug.cgi?id=23681
747 Worker tests crash in debug builds if run --singly
749 The crash happened because worker threads continued running while debug-only static objects
750 were already being destroyed on main thread.
752 * runtime/Structure.cpp: Create static debug-only sets in heap, so that they don't get
755 * wtf/ThreadingPthreads.cpp: Changed assertions to conventional form.
757 2009-02-03 Gavin Barraclough <barraclough@apple.com>
759 Reviewed by Geoff Garen.
761 https://bugs.webkit.org/show_bug.cgi?id=23715
763 Simplify MacroAssembler interface, by combining comparison methods.
764 Seprate operations are combined as follows:
765 jz32/jnz32/jzPtr/jnzPtr -> branchTest32/branchTestPtr,
766 j*(Add|Mul|Sub)32/j*(Add|Mul|Sub)Ptr -> branch(Add|Mul|Sub)32/branch(Add|Mul|Sub)Ptr
767 j*32/j*Ptr (all other two op combparisons) -> branch32/brnachPtr
770 Also, represent the Scale of BaseIndex addresses as a plain enum (0,1,2,3),
771 instead of as multiplicands (1,2,4,8).
773 This patch singificantly reduces replication of code, and increases functionality supported
774 by the MacroAssembler. No performance impact.
776 * assembler/MacroAssembler.h:
777 (JSC::MacroAssembler::):
778 (JSC::MacroAssembler::branchPtr):
779 (JSC::MacroAssembler::branchPtrWithPatch):
780 (JSC::MacroAssembler::branch32):
781 (JSC::MacroAssembler::branch16):
782 (JSC::MacroAssembler::branchTestPtr):
783 (JSC::MacroAssembler::branchTest32):
784 (JSC::MacroAssembler::branchAddPtr):
785 (JSC::MacroAssembler::branchAdd32):
786 (JSC::MacroAssembler::branchMul32):
787 (JSC::MacroAssembler::branchSubPtr):
788 (JSC::MacroAssembler::branchSub32):
789 (JSC::MacroAssembler::set32):
790 (JSC::MacroAssembler::setTest32):
791 * assembler/X86Assembler.h:
792 (JSC::X86Assembler::):
793 (JSC::X86Assembler::jccRel32):
794 (JSC::X86Assembler::setccOpcode):
795 (JSC::X86Assembler::cmpq_mr):
796 (JSC::X86Assembler::setcc_r):
797 (JSC::X86Assembler::sete_r):
798 (JSC::X86Assembler::setne_r):
799 (JSC::X86Assembler::jne):
800 (JSC::X86Assembler::je):
801 (JSC::X86Assembler::jl):
802 (JSC::X86Assembler::jb):
803 (JSC::X86Assembler::jle):
804 (JSC::X86Assembler::jbe):
805 (JSC::X86Assembler::jge):
806 (JSC::X86Assembler::jg):
807 (JSC::X86Assembler::ja):
808 (JSC::X86Assembler::jae):
809 (JSC::X86Assembler::jo):
810 (JSC::X86Assembler::jp):
811 (JSC::X86Assembler::js):
812 (JSC::X86Assembler::jcc):
813 (JSC::X86Assembler::X86InstructionFormatter::putModRmSib):
815 (JSC::JIT::compileOpStrictEq):
816 (JSC::JIT::emitSlowScriptCheck):
817 (JSC::JIT::privateCompileMainPass):
818 (JSC::JIT::privateCompileSlowCases):
819 (JSC::JIT::privateCompile):
820 (JSC::JIT::privateCompileCTIMachineTrampolines):
821 * jit/JITArithmetic.cpp:
822 (JSC::JIT::compileFastArith_op_lshift):
823 (JSC::JIT::compileFastArith_op_mod):
824 (JSC::JIT::compileFastArith_op_post_inc):
825 (JSC::JIT::compileFastArith_op_post_dec):
826 (JSC::JIT::compileFastArith_op_pre_inc):
827 (JSC::JIT::compileFastArith_op_pre_dec):
828 (JSC::JIT::compileBinaryArithOp):
829 (JSC::JIT::compileFastArith_op_add):
830 (JSC::JIT::compileFastArith_op_mul):
832 (JSC::JIT::compileOpCall):
833 (JSC::JIT::compileOpCallSlowCase):
834 * jit/JITInlineMethods.h:
835 (JSC::JIT::checkStructure):
836 (JSC::JIT::emitJumpIfJSCell):
837 (JSC::JIT::emitJumpIfNotJSCell):
838 (JSC::JIT::emitJumpIfImmediateNumber):
839 (JSC::JIT::emitJumpIfNotImmediateNumber):
840 (JSC::JIT::emitJumpIfImmediateInteger):
841 (JSC::JIT::emitJumpIfNotImmediateInteger):
842 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
843 * jit/JITPropertyAccess.cpp:
844 (JSC::JIT::compileGetByIdHotPath):
845 (JSC::JIT::compilePutByIdHotPath):
846 (JSC::JIT::privateCompilePutByIdTransition):
847 (JSC::JIT::privateCompilePatchGetArrayLength):
848 (JSC::JIT::privateCompileGetByIdProto):
849 (JSC::JIT::privateCompileGetByIdProtoList):
850 (JSC::JIT::privateCompileGetByIdChainList):
851 (JSC::JIT::privateCompileGetByIdChain):
852 * runtime/RegExp.cpp:
853 (JSC::RegExp::match):
854 * wrec/WRECGenerator.cpp:
855 (JSC::WREC::Generator::generateEnter):
856 (JSC::WREC::Generator::generateIncrementIndex):
857 (JSC::WREC::Generator::generateLoadCharacter):
858 (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
859 (JSC::WREC::Generator::generateBackreferenceQuantifier):
860 (JSC::WREC::Generator::generateNonGreedyQuantifier):
861 (JSC::WREC::Generator::generateGreedyQuantifier):
862 (JSC::WREC::Generator::generatePatternCharacterPair):
863 (JSC::WREC::Generator::generatePatternCharacter):
864 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
865 (JSC::WREC::Generator::generateCharacterClassInverted):
866 (JSC::WREC::Generator::generateAssertionBOL):
867 (JSC::WREC::Generator::generateAssertionEOL):
868 (JSC::WREC::Generator::generateAssertionWordBoundary):
869 (JSC::WREC::Generator::generateBackreference):
871 2009-02-03 David Hyatt <hyatt@apple.com>
873 Fix a bug in Vector's shrinkCapacity method. It did not properly copy elements into the inline buffer
874 when shrinking down from a size that was greater than the inline capacity.
879 (WTF::VectorBuffer::VectorBuffer):
880 (WTF::VectorBuffer::allocateBuffer):
882 2009-02-03 Simon Hausmann <simon.hausmann@nokia.com>
884 Reviewed by Tor Arne Vestbø.
886 Added accessor for JSByteArray storage.
888 * runtime/JSByteArray.h:
889 (JSC::JSByteArray::storage):
891 2009-02-03 Dmitry Titov <dimich@chromium.org>
893 Reviewed by Alexey Proskuryakov.
895 https://bugs.webkit.org/show_bug.cgi?id=23560
896 Implement SharedTimer on WorkerRunLoop
898 * JavaScriptCore.exp:
899 Forgot to expose ThreadCondition::timedWait() in one of previous patches.
901 2009-02-02 Oliver Hunt <oliver@apple.com>
903 Reviewed by Gavin Barraclough.
905 <https://bugs.webkit.org/show_bug.cgi?id=21414> REGRESSION: Regular Expressions and character classes, shorthands and ranges
906 <rdar://problem/6543487>
908 In certain circumstances when WREC::Generator::generateCharacterClassInvertedRange invokes
909 itself recursively, it will incorrectly emit (and thus consume) the next single character
910 match in the current character class. As WREC uses a binary search this out of sequence
911 codegen could result in a character match being missed and so cause the regex to produce
914 * wrec/WRECGenerator.cpp:
915 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
917 2009-02-02 Darin Adler <darin@apple.com>
919 Reviewed by Dave Hyatt.
921 Bug 23676: Speed up uses of reserveCapacity on new vectors by adding a new reserveInitialCapacity
922 https://bugs.webkit.org/show_bug.cgi?id=23676
924 * API/JSObjectRef.cpp:
925 (JSObjectCopyPropertyNames): Use reserveInitialCapacity.
927 (JSC::Lexer::Lexer): Ditto.
928 (JSC::Lexer::clear): Ditto.
930 * wtf/Vector.h: Added reserveInitialCapacity, a more efficient version of
931 reserveCapacity for use when the vector is brand new (still size 0 with no
932 capacity other than the inline capacity).
934 2009-01-30 Mark Rowe <mrowe@apple.com>
936 Rubber-stamped by Oliver Hunt.
938 <rdar://problem/6391501> Enable the JIT on Mac OS X x86_64 as it passes all tests.
942 2009-01-30 Oliver Hunt <oliver@apple.com>
944 Reviewed by Mark Rowe and Sam Weinig.
946 Finally fix load() to propagate exceptions correctly.
951 2009-01-30 David Levin <levin@chromium.org>
953 Reviewed by Darin Adler.
955 https://bugs.webkit.org/show_bug.cgi?id=23618
956 Templated worker tasks should be more error proof to use.
960 (WTF::IsConvertibleToInteger::IsConvertibleToDouble):
961 Avoid "possible loss of data" warning when using Microsoft's C++ compiler
962 by avoiding an implicit conversion of int types to doubles.
964 2009-01-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
966 Reviewed by Simon Hausmann.
968 Bug 23580: GNU mode RVCT compilation support
969 <https://bugs.webkit.org/show_bug.cgi?id=23580>
971 * pcre/pcre_exec.cpp: Use COMPILER(GCC) instead of __GNUC__.
972 * wtf/FastMalloc.cpp: Ditto.
973 (WTF::TCMallocStats::):
974 * wtf/Platform.h: Don't define COMPILER(GCC) with RVCT --gnu.
976 2009-01-30 David Levin <levin@chromium.org>
978 Reviewed by Alexey Proskuryakov.
980 Bug 23618: Templated worker tasks should be more error proof to use
981 <https://bugs.webkit.org/show_bug.cgi?id=23618>
983 Add the type traits needed for the generic worker tasks
984 and compile asserts for them.
986 Add a summary header to the TypeTraits.h file to explain what is in there.
988 Add a note to explain IsPod's deficiencies.
992 2009-01-30 David Levin <levin@chromium.org>
994 Reviewed by Alexey Proskuryakov.
996 Bug 23616: Various "template helpers" should be consolidated from isolated files in JavaScriptCore.
997 <https://bugs.webkit.org/show_bug.cgi?id=23616>
999 * wtf/TypeTraits.h: Moved RemovePointer, IsPod, IsInteger to this file.
1001 * wtf/OwnPtr.h: Use RemovePointer from TypeTraits.h.
1002 * wtf/RetainPtr.h: Ditto.
1004 * wtf/HashTraits.h: Use IsInteger from TypeTraits.h.
1006 * wtf/VectorTraits.h: Use IsPod from TypeTraits.h.
1009 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1010 * JavaScriptCore.xcodeproj/project.pbxproj:
1013 2009-01-29 Stephanie Lewis <slewis@apple.com>
1017 Update the order files.
1019 * JavaScriptCore.order:
1021 2009-01-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1023 Reviewed by Oliver Hunt.
1025 Bug 23551: Crash on page load with profiler enabled and running
1026 <https://bugs.webkit.org/show_bug.cgi?id=23551>
1027 <rdar://problem/6529521>
1029 Interpreter::execute(FunctionBodyNode*, ...) calls Profiler::didExecute()
1030 with a stale CallFrame. If some part of the scope chain has already been
1031 freed, Profiler::didExecute() will crash when attempting to get the lexical
1032 global object. The fix is to make the didExecute() call use the caller's
1033 CallFrame, not the one made for the function call. In this case, the
1034 willExecute() call should also be changed to match.
1036 Since this occurs in the actual inspector JS, it is difficult to reduce.
1037 I couldn't make a layout test.
1039 * interpreter/Interpreter.cpp:
1040 (JSC::Interpreter::execute):
1042 2009-01-28 Sam Weinig <sam@webkit.org>
1044 Reviewed by Gavin Barraclough.
1046 Fix for <rdar://problem/6525537>
1047 Hang occurs when closing Installer window (iTunes, Aperture)
1049 * JavaScriptCore.exp: Export JSGlobalData::sharedInstance.
1051 2009-01-28 Sam Weinig <sam@webkit.org>
1053 Reviewed by Geoff Garen.
1055 Initial patch by Mark Rowe.
1057 <rdar://problem/6519356>
1058 REGRESSION (r36006): "out of memory" alert running dromaeo on Windows
1060 Report the cost of the ArrayStorage vector more accurately/often.
1062 * runtime/JSArray.cpp:
1063 (JSC::JSArray::JSArray): Report the extra cost even for a filled array
1064 because JSString using the single character optimization and immediates
1065 wont increase the cost themselves.
1066 (JSC::JSArray::putSlowCase): Update the cost when increasing the size of
1068 (JSC::JSArray::increaseVectorLength): Ditto.
1070 2009-01-28 Sam Weinig <sam@webkit.org>
1072 Reviewed by Geoff Garen.
1074 Fix for <rdar://problem/6129678>
1075 REGRESSION (Safari 3-4): Local variable not accessible from Dashcode console or variables view
1077 Iterating the properties of activation objects accessed through the WebKit debugging
1078 APIs was broken by forced conversion of JSActivation to the global object. To fix this,
1079 we use a proxy activation object that acts more like a normal JSObject.
1081 * debugger/DebuggerActivation.cpp: Added.
1082 (JSC::DebuggerActivation::DebuggerActivation):
1083 (JSC::DebuggerActivation::mark):
1084 (JSC::DebuggerActivation::className):
1085 (JSC::DebuggerActivation::getOwnPropertySlot):
1086 (JSC::DebuggerActivation::put):
1087 (JSC::DebuggerActivation::putWithAttributes):
1088 (JSC::DebuggerActivation::deleteProperty):
1089 (JSC::DebuggerActivation::getPropertyNames):
1090 (JSC::DebuggerActivation::getPropertyAttributes):
1091 (JSC::DebuggerActivation::defineGetter):
1092 (JSC::DebuggerActivation::defineSetter):
1093 (JSC::DebuggerActivation::lookupGetter):
1094 (JSC::DebuggerActivation::lookupSetter):
1095 * debugger/DebuggerActivation.h: Added.
1096 Proxy JSActivation object for Debugging.
1098 * runtime/JSActivation.h:
1099 (JSC::JSActivation::isActivationObject): Added.
1100 * runtime/JSObject.h:
1101 (JSC::JSObject::isActivationObject): Added.
1103 2009-01-28 David Kilzer <ddkilzer@apple.com>
1105 Bug 23490: Remove initialRefCount argument from RefCounted class
1107 <https://bugs.webkit.org/show_bug.cgi?id=23490>
1109 Reviewed by Darin Adler.
1111 RefCountedBase now always starts with a ref count of 1, so there
1112 is no need to pass the initialRefCount into the class anymore.
1115 (WTF::ByteArray::ByteArray): Removed call to RefCounted(1).
1117 (WTF::RefCountedBase::RefCountedBase): Changed to start with a
1119 (WTF::RefCounted::RefCounted): Removed initialRefCount argument
1120 and removed call to RefCounted(1).
1122 2009-01-26 Adele Peterson <adele@apple.com>
1126 * debugger/Debugger.cpp:
1128 2009-01-26 Gavin Barraclough <barraclough@apple.com>
1130 Reviewed by Darin Adler.
1132 Fixes for eq null & neq null, on 64-bit JIT.
1133 https://bugs.webkit.org/show_bug.cgi?id=23559
1135 This patch degrades 64-bit JIT performance on some benchmarks,
1136 due to the whole not-being-incorrect thing.
1139 (JSC::JIT::privateCompileMainPass):
1141 2009-01-26 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1143 Reviewed by Gavin Barraclough.
1145 Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames
1146 <https://bugs.webkit.org/show_bug.cgi?id=23552>
1147 <rdar://problem/6398839>
1149 * JavaScriptCore.exp:
1150 * debugger/Debugger.cpp:
1151 (JSC::evaluateInGlobalCallFrame): Added so that WebScriptCallFrame can
1152 evaluate JS starting from a global call frame.
1153 * debugger/Debugger.h:
1155 2009-01-25 Mark Rowe <mrowe@apple.com>
1157 Rubber-stamped by Dan Bernstein.
1159 Improve the consistency of settings in our .xcconfig files.
1161 * Configurations/Base.xcconfig: Enable GCC_OBJC_CALL_CXX_CDTORS to match other projects.
1163 2009-01-25 Darin Adler <darin@apple.com>
1165 Reviewed by Mark Rowe.
1167 Bug 23352: Turn on more compiler warnings in the Mac build
1168 https://bugs.webkit.org/show_bug.cgi?id=23352
1170 Turn on the following warnings:
1180 * Configurations/Base.xcconfig: Added the new warnings. Switched to -Wextra instead of
1181 -W for clarity since we don't have to support the older versions of gcc that require the
1182 old -W syntax. Since we now use -Wformat=2, removed -Wformat-security. Also removed
1183 -Wno-format-y2k since we can have that one on now.
1185 2009-01-25 Judit Jasz <jasy@inf.u-szeged.hu>
1187 Reviewed by Darin Adler.
1189 Compilation problem fixing
1190 http://bugs.webkit.org/show_bug.cgi?id=23497
1193 (JSC::JIT::compileOpCall): Use JSValuePtr::encode.
1195 2009-01-25 Darin Adler <darin@apple.com>
1197 Reviewed by Sam Weinig.
1199 Bug 23352: Turn on more compiler warnings in the Mac build
1200 https://bugs.webkit.org/show_bug.cgi?id=23352
1202 Fourth patch: Deal with the last few stray warnings.
1204 * parser/Parser.cpp: Only declare jscyyparse if it's not already declared.
1205 This makes both separate compilation and all-in-one compilation work with the
1206 -Wredundant-decls warning.
1208 2009-01-25 Darin Adler <darin@apple.com>
1210 Reviewed by Sam Weinig.
1212 Bug 23352: Turn on more compiler warnings in the Mac build
1213 https://bugs.webkit.org/show_bug.cgi?id=23352
1215 Third patch: Use the noreturn attribute on functions that don't
1216 return to prepare for the use of the -Wmissing-noreturn warning.
1219 (JSC::unreachable): Added NO_RETURN.
1221 (functionQuit): Ditto.
1222 (printUsageStatement): Ditto.
1223 * wtf/AlwaysInline.h: Added definition of NO_RETURN.
1225 2009-01-24 Oliver Hunt <oliver@apple.com>
1227 Reviewed by Maciej Stachowiak.
1229 Force inlining of Lexer::matchPunctuator
1231 2.2% win when parsing jQuery, Mootools, Prototype, etc
1235 2009-01-23 Gavin Barraclough <barraclough@apple.com>
1237 Reviewed by Geoff Garen.
1239 Fix for <rdar://problem/6126212>
1240 Ensure that callbacks out from the JSC interface are only allowed
1241 to return in reverse-chronological order to that in which they were
1242 made. If we allow earlier callbacks to return first, then this may
1243 result in setions of the RegisterFile in use by another thread
1246 See uber-comment in JSLock.h for details.
1248 * runtime/JSLock.cpp:
1249 (JSC::JSLock::DropAllLocks::DropAllLocks):
1250 (JSC::JSLock::DropAllLocks::~DropAllLocks):
1252 2009-01-23 Darin Adler <darin@apple.com>
1254 Try to fix WX build.
1256 * runtime/JSGlobalObjectFunctions.h: Include <wtf/unicode/Unicode.h>
1257 for the definition of UChar.
1259 2009-01-23 Anders Carlsson <andersca@apple.com>
1261 * Configurations/Base.xcconfig:
1264 * runtime/JSNumberCell.h:
1267 2009-01-23 Anders Carlsson <andersca@apple.com>
1269 Reviewed by Sam Weinig.
1271 Turn on -Wmissing-prototypes and fix the warnings.
1273 * API/JSClassRef.cpp:
1274 (clearReferenceToPrototype):
1275 * Configurations/Base.xcconfig:
1276 * runtime/Collector.cpp:
1277 (JSC::getPlatformThreadRegisters):
1278 * runtime/ExceptionHelpers.cpp:
1280 * runtime/JSGlobalObjectFunctions.h:
1281 * runtime/JSNumberCell.h:
1282 * runtime/UString.cpp:
1283 (JSC::initializeStaticBaseString):
1285 * wtf/FastMalloc.cpp:
1286 * wtf/Threading.cpp:
1288 2009-01-22 Mark Rowe <mrowe@apple.com>
1290 Rubber-stamped by Anders Carlsson.
1292 Disable GCC_WARN_ABOUT_MISSING_PROTOTYPES temporarily.
1294 Current versions of Xcode only respect it for C and Objective-C files,
1295 and our code doesn't currently compile if it is applied to C++ and
1296 Objective-C++ files.
1298 * Configurations/Base.xcconfig:
1300 2009-01-22 Steve Falkenburg <sfalken@apple.com>
1302 https://bugs.webkit.org/show_bug.cgi?id=23489
1304 Return currentTime() in correct units for the two early return cases.
1306 Reviewed by Mark Rowe.
1308 * wtf/CurrentTime.cpp:
1311 2009-01-22 Sam Weinig <sam@webkit.org>
1313 Reviewed by Mark Rowe.
1315 Fix for <rdar://problem/6439247>
1316 FastMalloc allocating an extra 4MB of meta-data on 64-bit
1318 Rely on the fact that on all known x86-64 platforms only use 48 bits of
1319 address space to shrink the initial size of the PageMap from ~4MB to 120K.
1320 For 64-bit we still use a 3-level radix tree, but now each level is only 12
1323 No performance change.
1325 * wtf/FastMalloc.cpp:
1326 (WTF::MapSelector): Add specialization for 64 bit that takes into account the
1327 16 bits of unused address space on x86-64.
1329 2009-01-22 Beth Dakin <bdakin@apple.com>
1331 Reviewed by Sam Weinig.
1333 Fix for https://bugs.webkit.org/show_bug.cgi?id=23461 LayoutTests/
1334 fast/js/numeric-conversion.html is broken, and corresponding
1335 <rdar://problem/6514842>
1337 The basic problem here is that parseInt(Infinity) should be NaN,
1338 but we were returning 0. NaN matches Safari 3.2.1 and Firefox.
1340 * runtime/JSGlobalObjectFunctions.cpp:
1341 (JSC::globalFuncParseInt):
1343 2009-01-22 Oliver Hunt <oliver@apple.com>
1345 Reviewed by Geoff Garen.
1347 <rdar://problem/6516853> (r39682-r39736) JSFunFuzz: crash on "(function(){({ x2: x }), })()"
1348 <https://bugs.webkit.org/show_bug.cgi?id=23479>
1350 Automatic semicolon insertion was resulting in this being accepted in the initial
1351 nodeless parsing, but subsequent reparsing for code generation would fail, leading
1352 to a crash. The solution is to ensure that reparsing a function performs parsing
1353 in the same state as the initial parse. We do this by modifying the saved source
1354 ranges to include rather than exclude the opening and closing braces.
1356 * bytecode/CodeBlock.cpp:
1357 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): add an assertion for successful recompile
1359 (JSC::Lexer::sourceCode): include rather than exclude braces.
1361 (JSC::FunctionBodyNode::toSourceString): No need to append braces anymore.
1363 2009-01-22 Dmitry Titov <dimich@chromium.org>
1365 Reviewed by Alexey Proskuryakov.
1367 https://bugs.webkit.org/show_bug.cgi?id=23373
1369 Implement ThreadCondition::timedWait().
1370 Since we borrow the code for condition variables from other sources,
1371 I did the same for timedWait(). See comments in ThreadingWin.cpp for
1372 rationale and more info.
1374 * wtf/CONTRIBUTORS.pthreads-win32:
1375 Added. A list of Pthreads-win32 contributors mentioned in their license. The license itself
1376 is included into wtf/ThreadingWin32.cpp.
1379 * wtf/ThreadingWin.cpp:
1380 Additional info and Pthreads-win32 license at the beginning.
1381 (WTF::PlatformCondition::timedWait): new method, derived from Pthreads-win32.
1382 (WTF::PlatformCondition::signal): same
1383 (WTF::ThreadCondition::ThreadCondition):
1384 (WTF::ThreadCondition::~ThreadCondition):
1385 (WTF::ThreadCondition::wait): this now calls PlatformCondition::timedWait.
1386 (WTF::ThreadCondition::timedWait): same
1387 (WTF::ThreadCondition::signal): this now calls PlatformCondition::signal.
1388 (WTF::ThreadCondition::broadcast): same
1390 2009-01-21 Gavin Barraclough <barraclough@apple.com>
1392 Reviewed by Oliver Hunt.
1394 Fix for https://bugs.webkit.org/show_bug.cgi?id=23469.
1396 We need to check all numbers in integer switches, not just those
1397 represented as integer JSImmediates.
1399 * interpreter/Interpreter.cpp:
1400 (JSC::Interpreter::privateExecute):
1401 (JSC::Interpreter::cti_op_switch_imm):
1403 2009-01-21 Gavin Barraclough <barraclough@apple.com>
1405 Reviewed by Geoff Garen.
1407 Fix for https://bugs.webkit.org/show_bug.cgi?id=23468.
1409 * interpreter/Interpreter.cpp:
1410 (JSC::Interpreter::privateExecute):
1412 2009-01-21 Alexey Proskuryakov <ap@webkit.org>
1414 Suggested by Oliver Hunt. Reviewed by Oliver Hunt.
1416 https://bugs.webkit.org/show_bug.cgi?id=23456
1417 Function argument names leak
1419 * parser/Nodes.cpp: (JSC::FunctionBodyNode::~FunctionBodyNode): Destruct parameter names.
1421 2009-01-20 Oliver Hunt <oliver@apple.com>
1423 Reviewed by NOBODY (Build fix).
1427 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1429 2009-01-20 Gavin Barraclough <barraclough@apple.com>
1431 Reviewed by Mark Rowe.
1433 Structure property table deleted offset maps are being leaked.
1434 Probably shouldn't be doing that.
1436 https://bugs.webkit.org/show_bug.cgi?id=23442
1438 * runtime/Structure.cpp:
1439 (JSC::Structure::~Structure):
1441 2009-01-20 Oliver Hunt <oliver@apple.com>
1443 Reviewed by NOBODY (build fix).
1445 Attempt to fix gtk build
1449 2009-01-20 Darin Adler <darin@apple.com>
1451 * runtime/StringPrototype.cpp:
1452 (JSC::substituteBackreferences): Add back the initialization to fix the build.
1454 2009-01-20 Darin Adler <darin@apple.com>
1456 Reviewed by Mark Rowe.
1458 Bug 23352: Turn on more compiler warnings in the Mac build
1459 https://bugs.webkit.org/show_bug.cgi?id=23352
1461 First patch: Fix some simple cases of various warnings.
1463 * pcre/pcre_compile.cpp:
1464 (jsRegExpCompile): Use const_cast to change const-ness.
1466 * runtime/StringPrototype.cpp:
1467 (JSC::substituteBackreferences): Remove unneeded initialization and
1468 use UChar instead of unsigned short for UTF-16 values.
1471 (WTF::strtod): Use const_cast to change const-ness.
1473 2009-01-20 Oliver Hunt <oliver@apple.com>
1475 Reviewed by NOBODY (build fix).
1477 Whoops, remove runtime/ByteArray references from .pri and .scons builds, update .bkl
1479 * JavaScriptCore.pri:
1480 * JavaScriptCore.scons:
1481 * JavaScriptCoreSources.bkl:
1483 2009-01-20 Oliver Hunt <oliver@apple.com>
1487 Move runtime/ByteArray to wtf/ByteArray
1490 * JavaScriptCore.exp:
1491 * JavaScriptCore.pri:
1492 * JavaScriptCore.scons:
1493 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1494 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1495 * JavaScriptCore.xcodeproj/project.pbxproj:
1496 * runtime/JSByteArray.cpp:
1497 * runtime/JSByteArray.h:
1498 * wtf/ByteArray.cpp: Renamed from JavaScriptCore/runtime/ByteArray.cpp.
1499 (WTF::ByteArray::create):
1500 * wtf/ByteArray.h: Renamed from JavaScriptCore/runtime/ByteArray.h.
1501 (WTF::ByteArray::length):
1502 (WTF::ByteArray::set):
1503 (WTF::ByteArray::get):
1504 (WTF::ByteArray::data):
1505 (WTF::ByteArray::deref):
1506 (WTF::ByteArray::ByteArray):
1508 2009-01-19 Sam Weinig <sam@webkit.org>
1510 Rubber-stamped by Gavin Barraclough.
1512 Remove temporary operator-> from JSValuePtr.
1514 * API/JSCallbackFunction.cpp:
1515 (JSC::JSCallbackFunction::call):
1516 * API/JSCallbackObjectFunctions.h:
1520 * API/JSObjectRef.cpp:
1521 (JSObjectSetPrototype):
1522 * API/JSValueRef.cpp:
1524 (JSValueIsUndefined):
1530 (JSValueIsObjectOfClass):
1533 (JSValueToStringCopy):
1535 * bytecode/CodeBlock.cpp:
1536 (JSC::valueToSourceString):
1537 (JSC::CodeBlock::mark):
1538 * bytecode/CodeBlock.h:
1539 (JSC::CodeBlock::isKnownNotImmediate):
1540 * bytecompiler/BytecodeGenerator.cpp:
1541 (JSC::BytecodeGenerator::emitEqualityOp):
1542 (JSC::keyForImmediateSwitch):
1543 * interpreter/Interpreter.cpp:
1546 (JSC::jsAddSlowCase):
1548 (JSC::jsTypeStringForValue):
1549 (JSC::jsIsObjectType):
1550 (JSC::jsIsFunctionType):
1552 (JSC::Interpreter::callEval):
1553 (JSC::Interpreter::throwException):
1554 (JSC::cachePrototypeChain):
1555 (JSC::Interpreter::tryCachePutByID):
1556 (JSC::countPrototypeChainEntriesAndCheckForProxies):
1557 (JSC::Interpreter::tryCacheGetByID):
1558 (JSC::Interpreter::privateExecute):
1559 (JSC::Interpreter::tryCTICachePutByID):
1560 (JSC::Interpreter::tryCTICacheGetByID):
1561 (JSC::Interpreter::cti_op_convert_this):
1562 (JSC::Interpreter::cti_op_add):
1563 (JSC::Interpreter::cti_op_pre_inc):
1564 (JSC::Interpreter::cti_op_put_by_id_generic):
1565 (JSC::Interpreter::cti_op_get_by_id_generic):
1566 (JSC::Interpreter::cti_op_put_by_id):
1567 (JSC::Interpreter::cti_op_put_by_id_second):
1568 (JSC::Interpreter::cti_op_put_by_id_fail):
1569 (JSC::Interpreter::cti_op_get_by_id):
1570 (JSC::Interpreter::cti_op_get_by_id_second):
1571 (JSC::Interpreter::cti_op_get_by_id_self_fail):
1572 (JSC::Interpreter::cti_op_get_by_id_proto_list):
1573 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
1574 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
1575 (JSC::Interpreter::cti_op_get_by_id_array_fail):
1576 (JSC::Interpreter::cti_op_get_by_id_string_fail):
1577 (JSC::Interpreter::cti_op_instanceof):
1578 (JSC::Interpreter::cti_op_del_by_id):
1579 (JSC::Interpreter::cti_op_mul):
1580 (JSC::Interpreter::cti_op_call_JSFunction):
1581 (JSC::Interpreter::cti_op_call_NotJSFunction):
1582 (JSC::Interpreter::cti_op_construct_JSConstruct):
1583 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
1584 (JSC::Interpreter::cti_op_get_by_val):
1585 (JSC::Interpreter::cti_op_get_by_val_byte_array):
1586 (JSC::Interpreter::cti_op_sub):
1587 (JSC::Interpreter::cti_op_put_by_val):
1588 (JSC::Interpreter::cti_op_put_by_val_array):
1589 (JSC::Interpreter::cti_op_put_by_val_byte_array):
1590 (JSC::Interpreter::cti_op_loop_if_true):
1591 (JSC::Interpreter::cti_op_negate):
1592 (JSC::Interpreter::cti_op_div):
1593 (JSC::Interpreter::cti_op_pre_dec):
1594 (JSC::Interpreter::cti_op_not):
1595 (JSC::Interpreter::cti_op_jtrue):
1596 (JSC::Interpreter::cti_op_post_inc):
1597 (JSC::Interpreter::cti_op_lshift):
1598 (JSC::Interpreter::cti_op_bitand):
1599 (JSC::Interpreter::cti_op_rshift):
1600 (JSC::Interpreter::cti_op_bitnot):
1601 (JSC::Interpreter::cti_op_mod):
1602 (JSC::Interpreter::cti_op_post_dec):
1603 (JSC::Interpreter::cti_op_urshift):
1604 (JSC::Interpreter::cti_op_bitxor):
1605 (JSC::Interpreter::cti_op_bitor):
1606 (JSC::Interpreter::cti_op_push_scope):
1607 (JSC::Interpreter::cti_op_is_undefined):
1608 (JSC::Interpreter::cti_op_is_boolean):
1609 (JSC::Interpreter::cti_op_is_number):
1610 (JSC::Interpreter::cti_op_to_jsnumber):
1611 (JSC::Interpreter::cti_op_in):
1612 (JSC::Interpreter::cti_op_put_by_index):
1613 (JSC::Interpreter::cti_op_switch_imm):
1614 (JSC::Interpreter::cti_op_switch_char):
1615 (JSC::Interpreter::cti_op_switch_string):
1616 (JSC::Interpreter::cti_op_del_by_val):
1617 (JSC::Interpreter::cti_op_put_getter):
1618 (JSC::Interpreter::cti_op_put_setter):
1619 (JSC::Interpreter::cti_op_new_error):
1620 * interpreter/Interpreter.h:
1621 (JSC::Interpreter::isJSArray):
1622 (JSC::Interpreter::isJSString):
1623 (JSC::Interpreter::isJSByteArray):
1624 * interpreter/Register.h:
1625 (JSC::Register::marked):
1626 (JSC::Register::mark):
1627 * jit/JITInlineMethods.h:
1628 (JSC::JIT::getConstantOperandImmediateInt):
1629 (JSC::JIT::isOperandConstantImmediateInt):
1638 (JSC::processClauseList):
1639 * profiler/ProfileGenerator.cpp:
1640 (JSC::ProfileGenerator::addParentForConsoleStart):
1641 * profiler/Profiler.cpp:
1642 (JSC::Profiler::createCallIdentifier):
1643 * runtime/ArrayConstructor.cpp:
1644 (JSC::constructArrayWithSizeQuirk):
1645 * runtime/ArrayPrototype.cpp:
1646 (JSC::arrayProtoFuncToString):
1647 (JSC::arrayProtoFuncToLocaleString):
1648 (JSC::arrayProtoFuncJoin):
1649 (JSC::arrayProtoFuncConcat):
1650 (JSC::arrayProtoFuncPop):
1651 (JSC::arrayProtoFuncPush):
1652 (JSC::arrayProtoFuncReverse):
1653 (JSC::arrayProtoFuncShift):
1654 (JSC::arrayProtoFuncSlice):
1655 (JSC::arrayProtoFuncSort):
1656 (JSC::arrayProtoFuncSplice):
1657 (JSC::arrayProtoFuncUnShift):
1658 (JSC::arrayProtoFuncFilter):
1659 (JSC::arrayProtoFuncMap):
1660 (JSC::arrayProtoFuncEvery):
1661 (JSC::arrayProtoFuncForEach):
1662 (JSC::arrayProtoFuncSome):
1663 (JSC::arrayProtoFuncIndexOf):
1664 (JSC::arrayProtoFuncLastIndexOf):
1665 * runtime/BooleanConstructor.cpp:
1666 (JSC::constructBoolean):
1667 (JSC::callBooleanConstructor):
1668 * runtime/BooleanPrototype.cpp:
1669 (JSC::booleanProtoFuncToString):
1670 (JSC::booleanProtoFuncValueOf):
1671 * runtime/Collector.cpp:
1672 (JSC::Heap::protect):
1673 (JSC::Heap::unprotect):
1675 (JSC::Heap::collect):
1677 * runtime/Completion.cpp:
1679 * runtime/DateConstructor.cpp:
1680 (JSC::constructDate):
1683 * runtime/DateInstance.h:
1684 (JSC::DateInstance::internalNumber):
1685 * runtime/DatePrototype.cpp:
1686 (JSC::formatLocaleDate):
1687 (JSC::fillStructuresUsingTimeArgs):
1688 (JSC::fillStructuresUsingDateArgs):
1689 (JSC::dateProtoFuncToString):
1690 (JSC::dateProtoFuncToUTCString):
1691 (JSC::dateProtoFuncToDateString):
1692 (JSC::dateProtoFuncToTimeString):
1693 (JSC::dateProtoFuncToLocaleString):
1694 (JSC::dateProtoFuncToLocaleDateString):
1695 (JSC::dateProtoFuncToLocaleTimeString):
1696 (JSC::dateProtoFuncGetTime):
1697 (JSC::dateProtoFuncGetFullYear):
1698 (JSC::dateProtoFuncGetUTCFullYear):
1699 (JSC::dateProtoFuncToGMTString):
1700 (JSC::dateProtoFuncGetMonth):
1701 (JSC::dateProtoFuncGetUTCMonth):
1702 (JSC::dateProtoFuncGetDate):
1703 (JSC::dateProtoFuncGetUTCDate):
1704 (JSC::dateProtoFuncGetDay):
1705 (JSC::dateProtoFuncGetUTCDay):
1706 (JSC::dateProtoFuncGetHours):
1707 (JSC::dateProtoFuncGetUTCHours):
1708 (JSC::dateProtoFuncGetMinutes):
1709 (JSC::dateProtoFuncGetUTCMinutes):
1710 (JSC::dateProtoFuncGetSeconds):
1711 (JSC::dateProtoFuncGetUTCSeconds):
1712 (JSC::dateProtoFuncGetMilliSeconds):
1713 (JSC::dateProtoFuncGetUTCMilliseconds):
1714 (JSC::dateProtoFuncGetTimezoneOffset):
1715 (JSC::dateProtoFuncSetTime):
1716 (JSC::setNewValueFromTimeArgs):
1717 (JSC::setNewValueFromDateArgs):
1718 (JSC::dateProtoFuncSetYear):
1719 (JSC::dateProtoFuncGetYear):
1720 * runtime/ErrorConstructor.cpp:
1721 (JSC::constructError):
1722 * runtime/ErrorPrototype.cpp:
1723 (JSC::errorProtoFuncToString):
1724 * runtime/ExceptionHelpers.cpp:
1726 (JSC::createErrorMessage):
1727 * runtime/FunctionConstructor.cpp:
1728 (JSC::constructFunction):
1729 * runtime/FunctionPrototype.cpp:
1730 (JSC::functionProtoFuncToString):
1731 (JSC::functionProtoFuncApply):
1732 (JSC::functionProtoFuncCall):
1733 * runtime/GetterSetter.cpp:
1734 (JSC::GetterSetter::toObject):
1735 * runtime/JSActivation.cpp:
1736 (JSC::JSActivation::getOwnPropertySlot):
1737 * runtime/JSArray.cpp:
1738 (JSC::JSArray::put):
1739 (JSC::JSArray::mark):
1740 (JSC::JSArray::sort):
1741 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
1742 (JSC::JSArray::compactForSorting):
1743 * runtime/JSByteArray.h:
1744 (JSC::JSByteArray::setIndex):
1747 * runtime/JSFunction.cpp:
1748 (JSC::JSFunction::call):
1749 (JSC::JSFunction::construct):
1750 * runtime/JSGlobalObject.cpp:
1751 (JSC::markIfNeeded):
1752 (JSC::lastInPrototypeChain):
1753 * runtime/JSGlobalObjectFunctions.cpp:
1756 (JSC::globalFuncEval):
1757 (JSC::globalFuncParseInt):
1758 (JSC::globalFuncParseFloat):
1759 (JSC::globalFuncIsNaN):
1760 (JSC::globalFuncIsFinite):
1761 (JSC::globalFuncEscape):
1762 (JSC::globalFuncUnescape):
1763 (JSC::globalFuncJSCPrint):
1764 * runtime/JSImmediate.cpp:
1765 (JSC::JSImmediate::toThisObject):
1766 (JSC::JSImmediate::toObject):
1767 (JSC::JSImmediate::prototype):
1768 (JSC::JSImmediate::toString):
1769 * runtime/JSImmediate.h:
1770 * runtime/JSObject.cpp:
1771 (JSC::JSObject::mark):
1772 (JSC::JSObject::put):
1773 (JSC::callDefaultValueFunction):
1774 (JSC::JSObject::getPrimitiveNumber):
1775 (JSC::JSObject::defineGetter):
1776 (JSC::JSObject::defineSetter):
1777 (JSC::JSObject::lookupGetter):
1778 (JSC::JSObject::lookupSetter):
1779 (JSC::JSObject::hasInstance):
1780 (JSC::JSObject::toNumber):
1781 (JSC::JSObject::toString):
1782 * runtime/JSObject.h:
1783 (JSC::JSObject::JSObject):
1784 (JSC::JSObject::inlineGetOwnPropertySlot):
1785 (JSC::JSObject::getOwnPropertySlotForWrite):
1786 (JSC::JSObject::getPropertySlot):
1787 (JSC::JSValuePtr::get):
1788 * runtime/JSPropertyNameIterator.h:
1789 (JSC::JSPropertyNameIterator::create):
1790 * runtime/JSString.cpp:
1791 (JSC::JSString::getOwnPropertySlot):
1792 * runtime/JSValue.h:
1793 * runtime/JSWrapperObject.cpp:
1794 (JSC::JSWrapperObject::mark):
1795 * runtime/JSWrapperObject.h:
1796 (JSC::JSWrapperObject::setInternalValue):
1797 * runtime/MathObject.cpp:
1798 (JSC::mathProtoFuncAbs):
1799 (JSC::mathProtoFuncACos):
1800 (JSC::mathProtoFuncASin):
1801 (JSC::mathProtoFuncATan):
1802 (JSC::mathProtoFuncATan2):
1803 (JSC::mathProtoFuncCeil):
1804 (JSC::mathProtoFuncCos):
1805 (JSC::mathProtoFuncExp):
1806 (JSC::mathProtoFuncFloor):
1807 (JSC::mathProtoFuncLog):
1808 (JSC::mathProtoFuncMax):
1809 (JSC::mathProtoFuncMin):
1810 (JSC::mathProtoFuncPow):
1811 (JSC::mathProtoFuncRound):
1812 (JSC::mathProtoFuncSin):
1813 (JSC::mathProtoFuncSqrt):
1814 (JSC::mathProtoFuncTan):
1815 * runtime/NativeErrorConstructor.cpp:
1816 (JSC::NativeErrorConstructor::NativeErrorConstructor):
1817 (JSC::NativeErrorConstructor::construct):
1818 * runtime/NumberConstructor.cpp:
1819 (JSC::constructWithNumberConstructor):
1820 (JSC::callNumberConstructor):
1821 * runtime/NumberPrototype.cpp:
1822 (JSC::numberProtoFuncToString):
1823 (JSC::numberProtoFuncToLocaleString):
1824 (JSC::numberProtoFuncValueOf):
1825 (JSC::numberProtoFuncToFixed):
1826 (JSC::numberProtoFuncToExponential):
1827 (JSC::numberProtoFuncToPrecision):
1828 * runtime/ObjectConstructor.cpp:
1829 (JSC::constructObject):
1830 * runtime/ObjectPrototype.cpp:
1831 (JSC::objectProtoFuncValueOf):
1832 (JSC::objectProtoFuncHasOwnProperty):
1833 (JSC::objectProtoFuncIsPrototypeOf):
1834 (JSC::objectProtoFuncDefineGetter):
1835 (JSC::objectProtoFuncDefineSetter):
1836 (JSC::objectProtoFuncLookupGetter):
1837 (JSC::objectProtoFuncLookupSetter):
1838 (JSC::objectProtoFuncPropertyIsEnumerable):
1839 (JSC::objectProtoFuncToLocaleString):
1840 (JSC::objectProtoFuncToString):
1841 * runtime/Operations.h:
1842 (JSC::JSValuePtr::equalSlowCaseInline):
1843 (JSC::JSValuePtr::strictEqual):
1844 (JSC::JSValuePtr::strictEqualSlowCaseInline):
1845 * runtime/Protect.h:
1848 * runtime/RegExpConstructor.cpp:
1849 (JSC::setRegExpConstructorInput):
1850 (JSC::setRegExpConstructorMultiline):
1851 (JSC::constructRegExp):
1852 * runtime/RegExpObject.cpp:
1853 (JSC::setRegExpObjectLastIndex):
1854 (JSC::RegExpObject::match):
1855 * runtime/RegExpPrototype.cpp:
1856 (JSC::regExpProtoFuncTest):
1857 (JSC::regExpProtoFuncExec):
1858 (JSC::regExpProtoFuncCompile):
1859 (JSC::regExpProtoFuncToString):
1860 * runtime/StringConstructor.cpp:
1861 (JSC::stringFromCharCodeSlowCase):
1862 (JSC::stringFromCharCode):
1863 (JSC::constructWithStringConstructor):
1864 (JSC::callStringConstructor):
1865 * runtime/StringPrototype.cpp:
1866 (JSC::stringProtoFuncReplace):
1867 (JSC::stringProtoFuncToString):
1868 (JSC::stringProtoFuncCharAt):
1869 (JSC::stringProtoFuncCharCodeAt):
1870 (JSC::stringProtoFuncConcat):
1871 (JSC::stringProtoFuncIndexOf):
1872 (JSC::stringProtoFuncLastIndexOf):
1873 (JSC::stringProtoFuncMatch):
1874 (JSC::stringProtoFuncSearch):
1875 (JSC::stringProtoFuncSlice):
1876 (JSC::stringProtoFuncSplit):
1877 (JSC::stringProtoFuncSubstr):
1878 (JSC::stringProtoFuncSubstring):
1879 (JSC::stringProtoFuncToLowerCase):
1880 (JSC::stringProtoFuncToUpperCase):
1881 (JSC::stringProtoFuncLocaleCompare):
1882 (JSC::stringProtoFuncBig):
1883 (JSC::stringProtoFuncSmall):
1884 (JSC::stringProtoFuncBlink):
1885 (JSC::stringProtoFuncBold):
1886 (JSC::stringProtoFuncFixed):
1887 (JSC::stringProtoFuncItalics):
1888 (JSC::stringProtoFuncStrike):
1889 (JSC::stringProtoFuncSub):
1890 (JSC::stringProtoFuncSup):
1891 (JSC::stringProtoFuncFontcolor):
1892 (JSC::stringProtoFuncFontsize):
1893 (JSC::stringProtoFuncAnchor):
1894 (JSC::stringProtoFuncLink):
1895 * runtime/Structure.cpp:
1896 (JSC::Structure::Structure):
1897 (JSC::Structure::getEnumerablePropertyNames):
1898 (JSC::Structure::createCachedPrototypeChain):
1899 * runtime/Structure.h:
1900 (JSC::Structure::mark):
1901 * runtime/StructureChain.cpp:
1902 (JSC::StructureChain::StructureChain):
1904 2009-01-19 Darin Adler <darin@apple.com>
1906 Reviewed by Sam Weinig.
1908 Bug 23409: REGRESSION: RegExp 'replace()' function improperly processes '$$'
1909 <https://bugs.webkit.org/show_bug.cgi?id=23409>
1910 <rdar://problem/6505723>
1912 Test: fast/js/string-replace-3.html
1914 * runtime/StringPrototype.cpp:
1915 (JSC::substituteBackreferences): Remove code that adds an extra $ -- not sure
1916 how this ever worked.
1918 2009-01-16 Gavin Barraclough <barraclough@apple.com>
1920 Reviewed by Oliver Hunt.
1922 On x86-64 jit, cache JSImmedate::TagMask & JSImmedate::TagTypeNumber in
1923 registers, save reloading them every time they're used.
1925 Draws x86-64 jit performance close to that of i386 jit.
1927 * assembler/MacroAssembler.h:
1928 (JSC::MacroAssembler::subPtr):
1929 (JSC::MacroAssembler::jnzPtr):
1930 (JSC::MacroAssembler::jzPtr):
1932 (JSC::JIT::privateCompileMainPass):
1934 * jit/JITArithmetic.cpp:
1935 (JSC::JIT::compileBinaryArithOpSlowCase):
1936 * jit/JITInlineMethods.h:
1937 (JSC::JIT::emitJumpIfJSCell):
1938 (JSC::JIT::emitJumpIfNotJSCell):
1939 (JSC::JIT::emitJumpIfImmediateNumber):
1940 (JSC::JIT::emitJumpIfNotImmediateNumber):
1941 (JSC::JIT::emitJumpIfImmediateInteger):
1942 (JSC::JIT::emitJumpIfNotImmediateInteger):
1943 (JSC::JIT::emitFastArithIntToImmNoCheck):
1945 2009-01-16 Gavin Barraclough <barraclough@apple.com>
1947 Reviewed by Oliver Hunt.
1949 Add support to x86-64 JIT for inline double precision arithmetic ops.
1950 +5/6% on x86-64, JIT enabled, sunspider.
1952 * assembler/MacroAssembler.h:
1953 (JSC::MacroAssembler::addPtr):
1954 * assembler/X86Assembler.h:
1955 (JSC::X86Assembler::movq_rr):
1957 * jit/JITArithmetic.cpp:
1958 (JSC::JIT::compileFastArith_op_pre_inc):
1959 (JSC::JIT::compileBinaryArithOp):
1960 (JSC::JIT::compileBinaryArithOpSlowCase):
1961 (JSC::JIT::compileFastArith_op_add):
1962 (JSC::JIT::compileFastArithSlow_op_add):
1963 (JSC::JIT::compileFastArith_op_mul):
1964 (JSC::JIT::compileFastArithSlow_op_mul):
1965 (JSC::JIT::compileFastArith_op_sub):
1966 (JSC::JIT::compileFastArithSlow_op_sub):
1967 * parser/ResultType.h:
1968 (JSC::ResultType::isReusable):
1969 (JSC::ResultType::isInt32):
1970 (JSC::ResultType::definitelyIsNumber):
1971 (JSC::ResultType::mightBeNumber):
1972 (JSC::ResultType::isNotNumber):
1973 (JSC::ResultType::unknownType):
1975 2009-01-16 Gavin Barraclough <barraclough@apple.com>
1977 Reviewed by Geoff Garen.
1979 Fixes for SamplingTool.
1981 https://bugs.webkit.org/show_bug.cgi?id=23390
1983 * assembler/MacroAssembler.h:
1984 (JSC::MacroAssembler::storePtr):
1985 * bytecode/SamplingTool.cpp:
1986 (JSC::SamplingTool::run):
1987 (JSC::SamplingTool::dump):
1988 * bytecode/SamplingTool.h:
1989 (JSC::SamplingTool::encodeSample):
1991 (JSC::JIT::privateCompileMainPass):
1992 (JSC::JIT::privateCompile):
1994 (JSC::JIT::samplingToolTrackCodeBlock):
1996 (JSC::JIT::compileOpCall):
1997 (JSC::JIT::compileOpCallSlowCase):
1998 * jit/JITInlineMethods.h:
1999 (JSC::JIT::emitCTICall_internal):
2001 2009-01-16 Geoffrey Garen <ggaren@apple.com>
2003 Reviewed by Darin Adler.
2005 Fixed <rdar://problem/6452301> REGRESSION: Latest WebKit nightlies
2006 turn "c" into "" when stripping \\c_ character
2008 * wrec/WRECParser.cpp:
2009 (JSC::WREC::Parser::consumeEscape): Mimic a Firefox quirk when parsing
2010 control escapes inside character classes.
2012 2009-01-16 Adam Roben <aroben@apple.com>
2016 * wrec/WRECParser.cpp:
2017 (JSC::WREC::Parser::parseParentheses): Removed unreachable code.
2019 2009-01-15 Geoffrey Garen <ggaren@apple.com>
2021 Reviewed by Cameron Zwarich.
2023 Fixed <rdar://problem/6471394> REGRESSION (r39164): Discarding quantifier
2024 on assertion gives incorrect result (23075)
2026 https://bugs.webkit.org/show_bug.cgi?id=23075
2028 * pcre/pcre_compile.cpp:
2029 (compileBranch): Throw away an assertion if it's followed by a quantifier
2030 with a 0 minimum, to match SpiderMonkey, v8, and the ECMA spec.
2032 * wrec/WRECParser.cpp:
2033 (JSC::WREC::Parser::parseParentheses): Fall back on PCRE for the rare
2034 case of an assertion with a quantifier with a 0 minimum, since we
2035 don't handle quantified subexpressions yet, and in this special case,
2036 we can't just throw away the quantifier.
2038 2009-01-15 Gavin Barraclough <barraclough@apple.com>
2040 Reviewed by Oliver Hunt.
2042 Add support in ResultType to track that the results of bitops
2043 are always of type int32_t.
2046 (JSC::ReadModifyResolveNode::emitBytecode):
2047 (JSC::ReadModifyDotNode::emitBytecode):
2048 (JSC::ReadModifyBracketNode::emitBytecode):
2050 (JSC::ExpressionNode::):
2051 (JSC::BooleanNode::):
2052 (JSC::NumberNode::):
2053 (JSC::StringNode::):
2054 (JSC::PrePostResolveNode::):
2055 (JSC::TypeOfResolveNode::):
2056 (JSC::TypeOfValueNode::):
2057 (JSC::UnaryPlusNode::):
2058 (JSC::NegateNode::):
2059 (JSC::BitwiseNotNode::):
2060 (JSC::LogicalNotNode::):
2065 (JSC::LeftShiftNode::):
2066 (JSC::RightShiftNode::):
2067 (JSC::UnsignedRightShiftNode::):
2069 (JSC::GreaterNode::):
2070 (JSC::LessEqNode::):
2071 (JSC::GreaterEqNode::):
2072 (JSC::InstanceOfNode::):
2074 (JSC::NotEqualNode::):
2075 (JSC::StrictEqualNode::):
2076 (JSC::NotStrictEqualNode::):
2077 (JSC::BitAndNode::):
2079 (JSC::BitXOrNode::):
2080 (JSC::LogicalOpNode::):
2081 * parser/ResultType.h:
2082 (JSC::ResultType::isInt32):
2083 (JSC::ResultType::isNotNumber):
2084 (JSC::ResultType::booleanType):
2085 (JSC::ResultType::numberType):
2086 (JSC::ResultType::numberTypeCanReuse):
2087 (JSC::ResultType::numberTypeCanReuseIsInt32):
2088 (JSC::ResultType::stringOrNumberTypeCanReuse):
2089 (JSC::ResultType::stringType):
2090 (JSC::ResultType::unknownType):
2091 (JSC::ResultType::forAdd):
2092 (JSC::ResultType::forBitOp):
2093 (JSC::OperandTypes::OperandTypes):
2095 2009-01-15 Gavin Barraclough <barraclough@apple.com>
2097 Reviewed by Oliver Hunt.
2099 Add support for integer addition, subtraction and multiplication
2100 in JIT code on x86-64.
2102 * assembler/MacroAssembler.h:
2103 (JSC::MacroAssembler::mul32):
2104 (JSC::MacroAssembler::sub32):
2105 (JSC::MacroAssembler::joMul32):
2106 (JSC::MacroAssembler::joSub32):
2108 (JSC::JIT::privateCompileMainPass):
2109 (JSC::JIT::privateCompileSlowCases):
2111 * jit/JITArithmetic.cpp:
2112 (JSC::JIT::compileFastArith_op_add):
2113 (JSC::JIT::compileFastArithSlow_op_add):
2114 (JSC::JIT::compileFastArith_op_mul):
2115 (JSC::JIT::compileFastArithSlow_op_mul):
2116 (JSC::JIT::compileFastArith_op_sub):
2117 (JSC::JIT::compileFastArithSlow_op_sub):
2119 2009-01-15 Gavin Barraclough <barraclough@apple.com>
2121 Reviewed by Geoff Garen.
2123 On x86-64 allow JSImmediate to encode 64-bit double precision values.
2124 This patch only affects builds that set USE(ALTERNATE_JSIMMEDIATE).
2125 Updates the implementation of JSValuePtr:: and JSImmediate:: methods
2126 that operate on neumeric values to be be aware of the new representation.
2127 When this representation is in use, the class JSNumberCell is redundant
2128 and is compiled out.
2130 The format of the new immediate representation is documented in JSImmediate.h.
2132 * JavaScriptCore.exp:
2133 * assembler/MacroAssembler.h:
2134 (JSC::MacroAssembler::subPtr):
2135 * assembler/X86Assembler.h:
2136 (JSC::X86Assembler::):
2137 (JSC::X86Assembler::subq_rr):
2138 (JSC::X86Assembler::movq_rr):
2139 (JSC::X86Assembler::ucomisd_rr):
2140 (JSC::X86Assembler::X86InstructionFormatter::twoByteOp64):
2141 * interpreter/Interpreter.cpp:
2142 (JSC::Interpreter::cti_op_stricteq):
2143 (JSC::Interpreter::cti_op_nstricteq):
2145 (JSC::JIT::compileOpStrictEq):
2146 (JSC::JIT::privateCompileMainPass):
2147 (JSC::JIT::privateCompileSlowCases):
2149 * jit/JITArithmetic.cpp:
2150 (JSC::JIT::compileFastArith_op_lshift):
2151 (JSC::JIT::compileFastArith_op_rshift):
2152 (JSC::JIT::compileFastArith_op_bitand):
2153 (JSC::JIT::compileFastArith_op_mod):
2154 (JSC::JIT::compileFastArith_op_add):
2155 (JSC::JIT::compileFastArith_op_mul):
2156 (JSC::JIT::compileFastArith_op_post_inc):
2157 (JSC::JIT::compileFastArith_op_post_dec):
2158 (JSC::JIT::compileFastArith_op_pre_inc):
2159 (JSC::JIT::compileFastArith_op_pre_dec):
2160 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
2161 (JSC::JIT::compileBinaryArithOp):
2162 * jit/JITInlineMethods.h:
2163 (JSC::JIT::emitJumpIfBothJSCells):
2164 (JSC::JIT::emitJumpIfEitherNumber):
2165 (JSC::JIT::emitJumpIfNotEitherNumber):
2166 (JSC::JIT::emitJumpIfImmediateIntegerNumber):
2167 (JSC::JIT::emitJumpIfNotImmediateIntegerNumber):
2168 (JSC::JIT::emitJumpIfNotImmediateIntegerNumbers):
2169 (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumber):
2170 (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumbers):
2171 (JSC::JIT::emitFastArithDeTagImmediate):
2172 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
2173 (JSC::JIT::emitFastArithReTagImmediate):
2174 (JSC::JIT::emitFastArithIntToImmNoCheck):
2176 * runtime/JSGlobalData.cpp:
2177 (JSC::JSGlobalData::JSGlobalData):
2178 * runtime/JSImmediate.cpp:
2179 (JSC::JSImmediate::toThisObject):
2180 (JSC::JSImmediate::toObject):
2181 (JSC::JSImmediate::toString):
2182 * runtime/JSImmediate.h:
2183 (JSC::wtf_reinterpret_cast):
2184 (JSC::JSImmediate::isNumber):
2185 (JSC::JSImmediate::isIntegerNumber):
2186 (JSC::JSImmediate::isDoubleNumber):
2187 (JSC::JSImmediate::isPositiveIntegerNumber):
2188 (JSC::JSImmediate::areBothImmediateIntegerNumbers):
2189 (JSC::JSImmediate::makeInt):
2190 (JSC::JSImmediate::makeDouble):
2191 (JSC::JSImmediate::doubleValue):
2192 (JSC::doubleToBoolean):
2193 (JSC::JSImmediate::toBoolean):
2194 (JSC::JSImmediate::getTruncatedUInt32):
2195 (JSC::JSImmediate::makeOutOfIntegerRange):
2196 (JSC::JSImmediate::from):
2197 (JSC::JSImmediate::getTruncatedInt32):
2198 (JSC::JSImmediate::toDouble):
2199 (JSC::JSImmediate::getUInt32):
2200 (JSC::JSValuePtr::isInt32Fast):
2201 (JSC::JSValuePtr::isUInt32Fast):
2202 (JSC::JSValuePtr::areBothInt32Fast):
2203 (JSC::JSFastMath::canDoFastBitwiseOperations):
2204 (JSC::JSFastMath::xorImmediateNumbers):
2205 (JSC::JSFastMath::canDoFastRshift):
2206 (JSC::JSFastMath::canDoFastUrshift):
2207 (JSC::JSFastMath::rightShiftImmediateNumbers):
2208 (JSC::JSFastMath::canDoFastAdditiveOperations):
2209 (JSC::JSFastMath::addImmediateNumbers):
2210 (JSC::JSFastMath::subImmediateNumbers):
2211 * runtime/JSNumberCell.cpp:
2212 (JSC::jsNumberCell):
2213 * runtime/JSNumberCell.h:
2214 (JSC::createNumberStructure):
2215 (JSC::isNumberCell):
2216 (JSC::asNumberCell):
2218 (JSC::JSValuePtr::isDoubleNumber):
2219 (JSC::JSValuePtr::getDoubleNumber):
2220 (JSC::JSValuePtr::isNumber):
2221 (JSC::JSValuePtr::uncheckedGetNumber):
2223 (JSC::JSValuePtr::getNumber):
2224 (JSC::JSValuePtr::numberToInt32):
2225 (JSC::JSValuePtr::numberToUInt32):
2226 * runtime/JSValue.h:
2227 * runtime/NumberConstructor.cpp:
2228 (JSC::numberConstructorNegInfinity):
2229 (JSC::numberConstructorPosInfinity):
2230 (JSC::numberConstructorMaxValue):
2231 (JSC::numberConstructorMinValue):
2232 * runtime/NumberObject.cpp:
2233 (JSC::constructNumber):
2234 * runtime/NumberObject.h:
2235 * runtime/Operations.h:
2236 (JSC::JSValuePtr::equal):
2237 (JSC::JSValuePtr::equalSlowCaseInline):
2238 (JSC::JSValuePtr::strictEqual):
2239 (JSC::JSValuePtr::strictEqualSlowCaseInline):
2242 2009-01-15 Sam Weinig <sam@webkit.org>
2244 Reviewed by Geoffrey Garen.
2246 <rdar://problem/6045018>
2247 REGRESSION (r34838): JavaScript objects appear to be leaked after loading google.com
2249 Subtract the number of JSStrings cached in SmallStrings when calculating the
2250 number of live JSObjects.
2252 * runtime/Collector.cpp:
2253 (JSC::Heap::objectCount):
2254 * runtime/SmallStrings.cpp:
2255 (JSC::SmallStrings::count):
2256 * runtime/SmallStrings.h:
2258 2009-01-15 Sam Weinig <sam@webkit.org>
2262 * runtime/Collector.cpp:
2264 2009-01-15 Sam Weinig <sam@webkit.org>
2266 Reviewed by Gavin Barraclough.
2268 Fix crash seen running fast/canvas.
2270 Make sure to mark the ScopeNode and CodeBlock being created
2271 in the re-parse for exception information.
2273 * bytecode/CodeBlock.cpp:
2274 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
2276 (JSC::ScopeNode::mark):
2277 * runtime/Collector.cpp:
2278 (JSC::Heap::collect):
2279 * runtime/JSGlobalData.cpp:
2280 (JSC::JSGlobalData::JSGlobalData):
2281 * runtime/JSGlobalData.h:
2283 2009-01-15 Craig Schlenter <craig.schlenter@gmail.com>
2285 Reviewed by Darin Adler.
2287 https://bugs.webkit.org/show_bug.cgi?id=23347
2288 Compilation of JavaScriptCore/wtf/ThreadingPthreads.cpp fails on Linux
2290 * wtf/ThreadingPthreads.cpp: included limits.h as INT_MAX is defined there.
2292 2009-01-15 Oliver Hunt <oliver@apple.com>
2294 Reviewed by Geoff Garen.
2296 Bug 23225: REGRESSION: Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com
2297 <https://bugs.webkit.org/show_bug.cgi?id=23225> <rdar://problem/6487432>
2299 Character position for open and closing brace was incorrectly referencing m_position to
2300 record their position in a source document, however this is unsafe as BOMs may lead to
2301 m_position being an arbitrary position from the real position of the current character.
2304 (JSC::Lexer::matchPunctuator):
2306 2009-01-14 David Kilzer <ddkilzer@apple.com>
2308 Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html
2310 <https://bugs.webkit.org/show_bug.cgi?id=23153>
2312 Reviewed by Darin Adler.
2314 Instead of building bytecode.html into ${SRCROOT}/docs/bytecode.html, build it
2315 into ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore/docs/bytecode.html.
2317 Also fixes make-bytecode-docs.pl to actually generate documentation.
2319 * DerivedSources.make: Changed bytecode.html to be built into local docs
2320 directory in ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore.
2321 * JavaScriptCore.xcodeproj/project.pbxproj: Added "/docs" to the end of the
2322 "mkdir -p" command so that the docs subdirectory is automatically created.
2323 * docs/make-bytecode-docs.pl: Changed BEGIN_OPCODE to DEFINE_OPCODE so that
2324 documentation is actually generated.
2326 2009-01-14 Adam Treat <adam.treat@torchmobile.com>
2328 Build fix for Qt from Dmitry Titov.
2330 * wtf/ThreadingQt.cpp:
2331 (WTF::ThreadCondition::timedWait):
2333 2009-01-14 Oliver Hunt <oliver@apple.com>
2335 Reviewed by Cameron Zwarich.
2337 Bug 22903: REGRESSION (r36267): visiting this site reliably crashes WebKit nightly
2339 EvalCodeBlock's do not reference the functions that are declared inside the eval
2340 code, this means that simply marking the EvalCodeBlock through the global object
2341 is insufficient to mark the declared functions. This patch corrects this by
2342 explicitly marking the CodeBlocks of all the functions declared in the cached
2345 * bytecode/CodeBlock.cpp:
2346 (JSC::CodeBlock::mark):
2347 * bytecode/CodeBlock.h:
2348 (JSC::CodeBlock::hasFunctions):
2349 * bytecode/EvalCodeCache.h:
2350 (JSC::EvalCodeCache::mark):
2352 (JSC::ScopeNodeData::mark):
2353 (JSC::EvalNode::mark):
2356 2009-01-14 Dmitry Titov <dimich@chromium.org>
2358 Reviewed by Alexey Proskuryakov.
2360 https://bugs.webkit.org/show_bug.cgi?id=23312
2361 Implement MessageQueue::waitForMessageTimed()
2362 Also fixed ThreadCondition::timedWait() to take absolute time, as discussed on webkit-dev.
2363 Win32 version of timedWait still has to be implemented.
2365 * wtf/MessageQueue.h:
2366 (WTF::MessageQueueWaitResult: new enum for the result of MessageQueue::waitForMessageTimed.
2367 (WTF::MessageQueue::waitForMessage):
2368 (WTF::MessageQueue::waitForMessageTimed): New method.
2370 * wtf/ThreadingGtk.cpp:
2371 (WTF::ThreadCondition::timedWait): changed to use absolute time instead of interval.
2372 * wtf/ThreadingNone.cpp:
2373 (WTF::ThreadCondition::timedWait): ditto.
2374 * wtf/ThreadingPthreads.cpp:
2375 (WTF::ThreadCondition::timedWait): ditto.
2376 * wtf/ThreadingQt.cpp:
2377 (WTF::ThreadCondition::timedWait): ditto.
2378 * wtf/ThreadingWin.cpp:
2379 (WTF::ThreadCondition::timedWait): ditto. The actual Win32 code is still to be implemented.
2381 2009-01-14 Dean McNamee <deanm@chromium.org>
2383 Reviewed by Darin Adler and Oliver hunt.
2385 Correctly match allocation functions by implementing a custom deref().
2387 https://bugs.webkit.org/show_bug.cgi?id=23315
2389 * runtime/ByteArray.h:
2390 (JSC::ByteArray::deref):
2391 (JSC::ByteArray::ByteArray):
2393 2009-01-14 Dan Bernstein <mitz@apple.com>
2395 Reviewed by John Sullivan.
2401 2009-01-13 Beth Dakin <bdakin@apple.com>
2403 Reviewed by Darin Adler and Oliver Hunt.
2405 <rdar://problem/6489314> REGRESSION: Business widget's front side
2406 fails to render correctly when flipping widget
2408 The problem here is that parseInt was parsing NaN as 0. This patch
2409 corrects that by parsing NaN as NaN. This matches our old behavior
2412 * runtime/JSGlobalObjectFunctions.cpp:
2413 (JSC::globalFuncParseInt):
2415 2009-01-13 Gavin Barraclough <barraclough@apple.com>
2417 Reviewed by Oliver Hunt.
2419 Fix for: https://bugs.webkit.org/show_bug.cgi?id=23292
2421 Implementation of two argument canDoFastAdditiveOperations does not correlate well with reality.
2423 * runtime/JSImmediate.h:
2424 (JSC::JSFastMath::canDoFastAdditiveOperations):
2426 2009-01-13 Zalan Bujtas <zbujtas@gmail.com>
2428 Reviewed by Darin Adler.
2430 https://bugs.webkit.org/show_bug.cgi?id=23290
2431 Fix JSImmediate::isImmediate(src) to !src->isCell()
2433 * interpreter/Interpreter.cpp:
2434 (JSC::Interpreter::privateExecute):
2436 2009-01-13 Dmitry Titov <dimich@chromium.org>
2438 Reviewed by Darin Adler.
2440 https://bugs.webkit.org/show_bug.cgi?id=23281
2441 Fix the Chromium Win build.
2442 Need to use PLATFORM(WIN_OS) instead of PLATFORM(WIN).
2443 Moved GTK and WX up in #if sequence because they could come with WIN_OS too,
2444 while they have their own implementation even on Windows.
2446 * wtf/CurrentTime.cpp:
2449 2009-01-12 Gavin Barraclough <barraclough@apple.com>
2451 Reviewed by Oliver Hunt.
2453 Make the JSImmediate interface private.
2455 All manipulation of JS values should be through the JSValuePtr class, not by using JSImmediate
2456 directly. The key missing methods on JSValuePtr are:
2458 * isCell() - check for values that are JSCell*s, and as such where asCell() may be used.
2459 * isInt32Fast() getInt32Fast() - fast check/access for integer immediates.
2460 * isUInt32Fast() getUInt32Fast() - ditto for unsigned integer immediates.
2462 The JIT is allowed full access to JSImmediate, since it needs to be able to directly
2463 manipulate JSValuePtrs. The Interpreter is provided access to perform operations directly
2464 on JSValuePtrs through the new JSFastMath interface.
2466 No performance impact.
2468 * API/JSCallbackObjectFunctions.h:
2470 * API/JSValueRef.cpp:
2472 (JSValueIsStrictEqual):
2473 * JavaScriptCore.exp:
2474 * bytecode/CodeBlock.h:
2475 (JSC::CodeBlock::isKnownNotImmediate):
2476 * bytecompiler/BytecodeGenerator.cpp:
2477 (JSC::keyForImmediateSwitch):
2478 * bytecompiler/BytecodeGenerator.h:
2479 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
2480 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
2481 * interpreter/Interpreter.cpp:
2485 (JSC::jsIsObjectType):
2486 (JSC::cachePrototypeChain):
2487 (JSC::Interpreter::tryCachePutByID):
2488 (JSC::Interpreter::tryCacheGetByID):
2489 (JSC::Interpreter::privateExecute):
2490 (JSC::Interpreter::tryCTICachePutByID):
2491 (JSC::Interpreter::tryCTICacheGetByID):
2492 (JSC::Interpreter::cti_op_add):
2493 (JSC::Interpreter::cti_op_get_by_id_self_fail):
2494 (JSC::Interpreter::cti_op_get_by_id_proto_list):
2495 (JSC::Interpreter::cti_op_instanceof):
2496 (JSC::Interpreter::cti_op_mul):
2497 (JSC::Interpreter::cti_op_get_by_val):
2498 (JSC::Interpreter::cti_op_get_by_val_byte_array):
2499 (JSC::Interpreter::cti_op_sub):
2500 (JSC::Interpreter::cti_op_put_by_val):
2501 (JSC::Interpreter::cti_op_put_by_val_array):
2502 (JSC::Interpreter::cti_op_put_by_val_byte_array):
2503 (JSC::Interpreter::cti_op_negate):
2504 (JSC::Interpreter::cti_op_div):
2505 (JSC::Interpreter::cti_op_eq):
2506 (JSC::Interpreter::cti_op_lshift):
2507 (JSC::Interpreter::cti_op_bitand):
2508 (JSC::Interpreter::cti_op_rshift):
2509 (JSC::Interpreter::cti_op_bitnot):
2510 (JSC::Interpreter::cti_op_neq):
2511 (JSC::Interpreter::cti_op_urshift):
2512 (JSC::Interpreter::cti_op_call_eval):
2513 (JSC::Interpreter::cti_op_throw):
2514 (JSC::Interpreter::cti_op_is_undefined):
2515 (JSC::Interpreter::cti_op_stricteq):
2516 (JSC::Interpreter::cti_op_nstricteq):
2517 (JSC::Interpreter::cti_op_switch_imm):
2518 (JSC::Interpreter::cti_vm_throw):
2519 * interpreter/Interpreter.h:
2520 (JSC::Interpreter::isJSArray):
2521 (JSC::Interpreter::isJSString):
2522 (JSC::Interpreter::isJSByteArray):
2524 (JSC::JIT::compileOpStrictEq):
2525 (JSC::JIT::privateCompileMainPass):
2527 (JSC::JIT::isStrictEqCaseHandledInJITCode):
2528 * jit/JITArithmetic.cpp:
2529 (JSC::JIT::compileFastArith_op_rshift):
2530 (JSC::JIT::compileFastArith_op_bitand):
2531 (JSC::JIT::compileFastArith_op_mod):
2533 (JSC::JIT::unlinkCall):
2534 (JSC::JIT::compileOpCall):
2535 * jit/JITInlineMethods.h:
2536 (JSC::JIT::getConstantOperandImmediateInt):
2537 (JSC::JIT::isOperandConstantImmediateInt):
2539 (JSC::processClauseList):
2540 * runtime/ArrayPrototype.cpp:
2541 (JSC::arrayProtoFuncIndexOf):
2542 (JSC::arrayProtoFuncLastIndexOf):
2543 * runtime/BooleanPrototype.cpp:
2544 (JSC::booleanProtoFuncValueOf):
2545 * runtime/Collector.cpp:
2546 (JSC::Heap::protect):
2547 (JSC::Heap::unprotect):
2549 * runtime/JSByteArray.cpp:
2550 (JSC::JSByteArray::getOwnPropertySlot):
2551 * runtime/JSByteArray.h:
2552 (JSC::JSByteArray::getIndex):
2553 * runtime/JSCell.cpp:
2555 (JSC::JSValuePtr::isNumberCell):
2556 (JSC::JSValuePtr::asCell):
2557 (JSC::JSValuePtr::isNumber):
2558 * runtime/JSGlobalObjectFunctions.cpp:
2559 (JSC::globalFuncParseInt):
2560 * runtime/JSImmediate.h:
2562 (JSC::jsImpossibleValue):
2563 (JSC::JSValuePtr::toInt32):
2564 (JSC::JSValuePtr::toUInt32):
2565 (JSC::JSValuePtr::isCell):
2566 (JSC::JSValuePtr::isInt32Fast):
2567 (JSC::JSValuePtr::getInt32Fast):
2568 (JSC::JSValuePtr::isUInt32Fast):
2569 (JSC::JSValuePtr::getUInt32Fast):
2570 (JSC::JSValuePtr::makeInt32Fast):
2571 (JSC::JSValuePtr::areBothInt32Fast):
2572 (JSC::JSFastMath::canDoFastBitwiseOperations):
2573 (JSC::JSFastMath::equal):
2574 (JSC::JSFastMath::notEqual):
2575 (JSC::JSFastMath::andImmediateNumbers):
2576 (JSC::JSFastMath::xorImmediateNumbers):
2577 (JSC::JSFastMath::orImmediateNumbers):
2578 (JSC::JSFastMath::canDoFastRshift):
2579 (JSC::JSFastMath::canDoFastUrshift):
2580 (JSC::JSFastMath::rightShiftImmediateNumbers):
2581 (JSC::JSFastMath::canDoFastAdditiveOperations):
2582 (JSC::JSFastMath::addImmediateNumbers):
2583 (JSC::JSFastMath::subImmediateNumbers):
2584 (JSC::JSFastMath::incImmediateNumber):
2585 (JSC::JSFastMath::decImmediateNumber):
2586 * runtime/JSNumberCell.h:
2587 (JSC::JSValuePtr::asNumberCell):
2589 (JSC::JSValuePtr::uncheckedGetNumber):
2590 (JSC::JSNumberCell::toInt32):
2591 (JSC::JSNumberCell::toUInt32):
2592 (JSC::JSValuePtr::toJSNumber):
2593 (JSC::JSValuePtr::getNumber):
2594 (JSC::JSValuePtr::numberToInt32):
2595 (JSC::JSValuePtr::numberToUInt32):
2596 * runtime/JSObject.h:
2597 (JSC::JSValuePtr::isObject):
2598 (JSC::JSValuePtr::get):
2599 (JSC::JSValuePtr::put):
2600 * runtime/JSValue.cpp:
2601 (JSC::JSValuePtr::toInteger):
2602 (JSC::JSValuePtr::toIntegerPreserveNaN):
2603 * runtime/JSValue.h:
2604 * runtime/Operations.cpp:
2605 (JSC::JSValuePtr::equalSlowCase):
2606 (JSC::JSValuePtr::strictEqualSlowCase):
2607 * runtime/Operations.h:
2608 (JSC::JSValuePtr::equal):
2609 (JSC::JSValuePtr::equalSlowCaseInline):
2610 (JSC::JSValuePtr::strictEqual):
2611 (JSC::JSValuePtr::strictEqualSlowCaseInline):
2612 * runtime/Protect.h:
2615 * runtime/StringPrototype.cpp:
2616 (JSC::stringProtoFuncCharAt):
2617 (JSC::stringProtoFuncCharCodeAt):
2618 * runtime/Structure.cpp:
2619 (JSC::Structure::createCachedPrototypeChain):
2621 2009-01-12 Kevin Ollivier <kevino@theolliviers.com>
2623 Since date time functions have moved here, now the wx port JSC
2624 needs to depend on wx.
2628 2009-01-11 David Levin <levin@chromium.org>
2630 Reviewed by Darin Adler.
2632 https://bugs.webkit.org/show_bug.cgi?id=23245
2634 Add initializeThreading to key places in JS API to ensure that
2635 UString is properly initialized.
2637 * API/JSContextRef.cpp:
2638 (JSContextGroupCreate):
2639 (JSGlobalContextCreate):
2640 * API/JSObjectRef.cpp:
2642 * API/JSStringRef.cpp:
2643 (JSStringCreateWithCharacters):
2644 (JSStringCreateWithUTF8CString):
2645 * API/JSStringRefCF.cpp:
2646 (JSStringCreateWithCFString):
2648 2009-01-11 David Levin <levin@chromium.org>
2650 Reviewed by Darin Adler.
2652 https://bugs.webkit.org/show_bug.cgi?id=23175
2654 Separate out BaseString information from UString::Rep and make all baseString access go through
2655 a member function, so that it may be used for something else (in the future) in the BaseString
2658 * runtime/SmallStrings.cpp:
2659 (JSC::SmallStringsStorage::rep):
2660 (JSC::SmallStringsStorage::SmallStringsStorage):
2661 (JSC::SmallStrings::SmallStrings):
2662 (JSC::SmallStrings::mark):
2663 Adjust to account for the changes in UString and put the UString in place in
2664 SmallStringsStorage to aid in locality of reference among the UChar[] and UString::Rep's.
2666 * runtime/SmallStrings.h:
2667 * runtime/UString.cpp:
2668 (JSC::initializeStaticBaseString):
2669 (JSC::initializeUString):
2670 (JSC::UString::Rep::create):
2671 (JSC::UString::Rep::destroy):
2672 (JSC::UString::Rep::checkConsistency):
2673 (JSC::expandCapacity):
2674 (JSC::UString::expandPreCapacity):
2676 (JSC::UString::append):
2677 (JSC::UString::operator=):
2678 * runtime/UString.h:
2679 (JSC::UString::Rep::baseIsSelf):
2680 (JSC::UString::Rep::setBaseString):
2681 (JSC::UString::Rep::baseString):
2682 (JSC::UString::Rep::):
2683 (JSC::UString::Rep::null):
2684 (JSC::UString::Rep::empty):
2685 (JSC::UString::Rep::data):
2686 (JSC::UString::cost):
2687 Separate out the items out used by base strings from those used in Rep's that only
2688 point to base strings. (This potentially saves 24 bytes per Rep.)
2690 2009-01-11 Darin Adler <darin@apple.com>
2692 Reviewed by Dan Bernstein.
2694 Bug 23239: improve handling of unused arguments in JavaScriptCore
2695 https://bugs.webkit.org/show_bug.cgi?id=23239
2697 * runtime/DatePrototype.cpp: Moved LocaleDateTimeFormat enum outside #if
2698 so we can use this on all platforms. Changed valueOf to share the same
2699 function with getTime, since the contents of the two are identical. Removed
2700 a FIXME since the idea isn't really specific enough or helpful enough to
2701 need to sit here in the source code.
2702 (JSC::formatLocaleDate): Changed the Mac version of this function to take
2703 the same arguments as the non-Mac version so the caller doesn't have to
2704 special-case the two platforms. Also made the formatString array be const;
2705 before the characters were, but the array was a modifiable global variable.
2706 (JSC::dateProtoFuncToLocaleString): Changed to call the new unified
2707 version of formatLocaleDate and remove the ifdef.
2708 (JSC::dateProtoFuncToLocaleDateString): Ditto.
2709 (JSC::dateProtoFuncToLocaleTimeString): Ditto.
2711 * runtime/JSNotAnObject.cpp:
2712 (JSC::JSNotAnObject::toObject): Use the new ASSERT_UNUSED instead of the
2715 * runtime/RegExp.cpp:
2716 (JSC::RegExp::RegExp): Changed to only use UNUSED_PARAM when the parameter
2719 * wtf/TCSystemAlloc.cpp:
2720 (TCMalloc_SystemRelease): Changed to only use UNUSED_PARAM when the parameter
2722 (TCMalloc_SystemCommit): Changed to omit the argument names instead of using
2725 2009-01-11 Oliver Hunt <oliver@apple.com>
2727 Reviewed by NOBODY (Build fix).
2729 Fix the build (whoops)
2731 * interpreter/Interpreter.cpp:
2732 (JSC::Interpreter::cti_op_get_by_val):
2734 2009-01-11 Oliver Hunt <oliver@apple.com>
2736 Reviewed by Darin Adler and Anders Carlsson
2738 Bug 23128: get/put_by_val need to respecialise in the face of ByteArray
2740 Restructure the code slightly, and add comments per Darin's suggestions
2742 * interpreter/Interpreter.cpp:
2743 (JSC::Interpreter::cti_op_get_by_val):
2744 (JSC::Interpreter::cti_op_get_by_val_byte_array):
2745 (JSC::Interpreter::cti_op_put_by_val):
2746 (JSC::Interpreter::cti_op_put_by_val_byte_array):
2748 2009-01-11 Oliver Hunt <oliver@apple.com>
2750 Reviewed by Anders Carlsson.
2752 Whoops, I accidentally removed an exception check from fast the
2753 fast path for string indexing when i originally landed the
2756 * interpreter/Interpreter.cpp:
2757 (JSC::Interpreter::cti_op_get_by_val):
2759 2009-01-11 Oliver Hunt <oliver@apple.com>
2761 Reviewed by Anders Carlsson.
2763 Bug 23128: get/put_by_val need to respecialise in the face of ByteArray
2764 <https://bugs.webkit.org/show_bug.cgi?id=23128>
2766 Fairly simple patch, add specialised versions of cti_op_get/put_by_val
2767 that assume ByteArray, thus avoiding a few branches in the case of bytearray
2770 No effect on SunSpider. 15% win on the original testcase.
2772 * interpreter/Interpreter.cpp:
2773 (JSC::Interpreter::cti_op_get_by_val):
2774 (JSC::Interpreter::cti_op_get_by_val_byte_array):
2775 (JSC::Interpreter::cti_op_put_by_val):
2776 (JSC::Interpreter::cti_op_put_by_val_byte_array):
2777 * interpreter/Interpreter.h:
2779 2009-01-11 Alexey Proskuryakov <ap@webkit.org>
2781 Try to fix Windows build.
2783 * wtf/CurrentTime.cpp: Added a definition of msPerSecond (previously, this code was in
2784 DateMath.cpp, with constant definition in DateTime.h)
2786 2009-01-11 Alexey Proskuryakov <ap@webkit.org>
2788 Try to fix Windows build.
2790 * wtf/CurrentTime.cpp: Include <sys/types.h> and <sys/timeb.h>, as MSDN says to.
2792 2009-01-11 Dmitry Titov <dimich@chromium.org>
2794 Reviewed by Darin Adler.
2796 https://bugs.webkit.org/show_bug.cgi?id=23207
2797 Moved currentTime() to from WebCore to WTF.
2800 * JavaScriptCore.exp: added export for WTF::currentTime()
2801 * JavaScriptCore.pri:
2802 * JavaScriptCore.scons:
2803 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2804 * JavaScriptCore.xcodeproj/project.pbxproj:
2805 * JavaScriptCoreSources.bkl:
2806 * runtime/DateMath.cpp:
2807 (JSC::getCurrentUTCTimeWithMicroseconds): This function had another implementation of currentTime(), essentially. Now uses WTF version.
2808 * wtf/CurrentTime.cpp: Added.
2810 (WTF::highResUpTime):
2811 (WTF::lowResUTCTime):
2812 (WTF::qpcAvailable):
2813 * wtf/CurrentTime.h: Added.
2815 2009-01-09 Gavin Barraclough <barraclough@apple.com>
2817 Reviewed by Oliver Hunt.
2819 Stage two of converting JSValue from a pointer to a class type.
2820 Remove the class JSValue. The functionallity has been transitioned
2821 into the wrapper class type JSValuePtr.
2823 The last stage will be to rename JSValuePtr to JSValue, remove the
2824 overloaded -> operator, and switch operations on JSValuePtrs from
2825 using '->' to use '.' instead.
2828 * JavaScriptCore.exp:
2831 (JSC::JSValuePtr::asCell):
2832 (JSC::JSValuePtr::isNumber):
2833 (JSC::JSValuePtr::isString):
2834 (JSC::JSValuePtr::isGetterSetter):
2835 (JSC::JSValuePtr::isObject):
2836 (JSC::JSValuePtr::getNumber):
2837 (JSC::JSValuePtr::getString):
2838 (JSC::JSValuePtr::getObject):
2839 (JSC::JSValuePtr::getCallData):
2840 (JSC::JSValuePtr::getConstructData):
2841 (JSC::JSValuePtr::getUInt32):
2842 (JSC::JSValuePtr::getTruncatedInt32):
2843 (JSC::JSValuePtr::getTruncatedUInt32):
2844 (JSC::JSValuePtr::mark):
2845 (JSC::JSValuePtr::marked):
2846 (JSC::JSValuePtr::toPrimitive):
2847 (JSC::JSValuePtr::getPrimitiveNumber):
2848 (JSC::JSValuePtr::toBoolean):
2849 (JSC::JSValuePtr::toNumber):
2850 (JSC::JSValuePtr::toString):
2851 (JSC::JSValuePtr::toObject):
2852 (JSC::JSValuePtr::toThisObject):
2853 (JSC::JSValuePtr::needsThisConversion):
2854 (JSC::JSValuePtr::toThisString):
2855 (JSC::JSValuePtr::getJSNumber):
2856 * runtime/JSImmediate.h:
2857 (JSC::JSValuePtr::isUndefined):
2858 (JSC::JSValuePtr::isNull):
2859 (JSC::JSValuePtr::isUndefinedOrNull):
2860 (JSC::JSValuePtr::isBoolean):
2861 (JSC::JSValuePtr::getBoolean):
2862 (JSC::JSValuePtr::toInt32):
2863 (JSC::JSValuePtr::toUInt32):
2864 * runtime/JSNumberCell.h:
2865 (JSC::JSValuePtr::uncheckedGetNumber):
2866 (JSC::JSValuePtr::toJSNumber):
2867 * runtime/JSObject.h:
2868 (JSC::JSValuePtr::isObject):
2869 (JSC::JSValuePtr::get):
2870 (JSC::JSValuePtr::put):
2871 * runtime/JSString.h:
2872 (JSC::JSValuePtr::toThisJSString):
2873 * runtime/JSValue.cpp:
2874 (JSC::JSValuePtr::toInteger):
2875 (JSC::JSValuePtr::toIntegerPreserveNaN):
2876 (JSC::JSValuePtr::toInt32SlowCase):
2877 (JSC::JSValuePtr::toUInt32SlowCase):
2878 * runtime/JSValue.h:
2879 (JSC::JSValuePtr::makeImmediate):
2880 (JSC::JSValuePtr::immediateValue):
2881 (JSC::JSValuePtr::JSValuePtr):
2882 (JSC::JSValuePtr::operator->):
2883 (JSC::JSValuePtr::operator bool):
2884 (JSC::JSValuePtr::operator==):
2885 (JSC::JSValuePtr::operator!=):
2886 (JSC::JSValuePtr::encode):
2887 (JSC::JSValuePtr::decode):
2888 (JSC::JSValuePtr::toFloat):
2889 (JSC::JSValuePtr::asValue):
2893 2009-01-09 David Levin <levin@chromium.org>
2895 Reviewed by Oliver Hunt.
2897 https://bugs.webkit.org/show_bug.cgi?id=23175
2899 Adjustment to previous patch. Remove call to initilizeThreading from JSGlobalCreate
2900 and fix jsc.cpp instead.
2905 * runtime/JSGlobalData.cpp:
2906 (JSC::JSGlobalData::create):
2908 2009-01-09 Sam Weinig <sam@webkit.org>
2910 Roll r39720 back in with a working interpreted mode.
2912 2009-01-09 David Levin <levin@chromium.org>
2914 Reviewed by Oliver Hunt.
2916 https://bugs.webkit.org/show_bug.cgi?id=23175
2918 Added a template to make the pointer and flags combination
2919 in UString more readable and less error prone.
2922 * JavaScriptCore.exp:
2923 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2924 * JavaScriptCore.xcodeproj/project.pbxproj:
2925 Added PtrAndFlags.h (and sorted the xcode project file).
2927 * runtime/Identifier.cpp:
2928 (JSC::Identifier::add):
2929 (JSC::Identifier::addSlowCase):
2930 * runtime/InitializeThreading.cpp:
2931 (JSC::initializeThreadingOnce):
2932 Made the init threading initialize the UString globals. Before
2933 these were initilized using {} but that became harder due to the
2934 addition of this tempalte class.
2936 * runtime/JSGlobalData.cpp:
2937 (JSC::JSGlobalData::create):
2938 * runtime/PropertyNameArray.cpp:
2939 (JSC::PropertyNameArray::add):
2940 * runtime/UString.cpp:
2941 (JSC::initializeStaticBaseString):
2942 (JSC::initializeUString):
2943 (JSC::UString::Rep::create):
2944 (JSC::UString::Rep::createFromUTF8):
2946 (JSC::UString::UString):
2948 (JSC::UString::operator=):
2949 (JSC::UString::makeNull):
2950 (JSC::UString::nullRep):
2951 * runtime/UString.h:
2952 (JSC::UString::Rep::identifierTable):
2953 (JSC::UString::Rep::setIdentifierTable):
2954 (JSC::UString::Rep::isStatic):
2955 (JSC::UString::Rep::setStatic):
2956 (JSC::UString::Rep::):
2957 (JSC::UString::Rep::null):
2958 (JSC::UString::Rep::empty):
2959 (JSC::UString::isNull):
2960 (JSC::UString::null):
2961 (JSC::UString::UString):
2963 * wtf/PtrAndFlags.h: Added.
2964 (WTF::PtrAndFlags::PtrAndFlags):
2965 (WTF::PtrAndFlags::isFlagSet):
2966 (WTF::PtrAndFlags::setFlag):
2967 (WTF::PtrAndFlags::clearFlag):
2968 (WTF::PtrAndFlags::get):
2969 (WTF::PtrAndFlags::set):
2970 A simple way to layer together a pointer and 2 flags. It relies on the pointer being 4 byte aligned,
2971 which should happen for all allocators (due to aligning pointers, int's, etc. on 4 byte boundaries).
2973 2009-01-08 Gavin Barraclough <barraclough@apple.com>
2975 Reviewed by -O-l-i-v-e-r- -H-u-n-t- Sam Weinig (sorry, Sam!).
2977 Encode immediates in the low word of JSValuePtrs, on x86-64.
2979 On 32-bit platforms a JSValuePtr may represent a 31-bit signed integer.
2980 On 64-bit platforms, if USE(ALTERNATE_JSIMMEDIATE) is defined, a full
2981 32-bit integer may be stored in an immediate.
2983 Presently USE(ALTERNATE_JSIMMEDIATE) uses the same encoding as the default
2984 immediate format - the value is left shifted by one, so a one bit tag can
2985 be added to indicate the value is an immediate. However this means that
2986 values must be commonly be detagged (by right shifting by one) before
2987 arithmetic operations can be performed on immediates. This patch modifies
2988 the formattting so the the high bits of the immediate mark values as being
2991 * assembler/MacroAssembler.h:
2992 (JSC::MacroAssembler::not32):
2993 (JSC::MacroAssembler::orPtr):
2994 (JSC::MacroAssembler::zeroExtend32ToPtr):
2995 (JSC::MacroAssembler::jaePtr):
2996 (JSC::MacroAssembler::jbPtr):
2997 (JSC::MacroAssembler::jnzPtr):
2998 (JSC::MacroAssembler::jzPtr):
2999 * assembler/X86Assembler.h:
3000 (JSC::X86Assembler::):
3001 (JSC::X86Assembler::notl_r):
3002 (JSC::X86Assembler::testq_i32r):
3004 (JSC::JIT::privateCompileMainPass):
3005 (JSC::JIT::privateCompileSlowCases):
3006 (JSC::JIT::privateCompileCTIMachineTrampolines):
3008 * jit/JITArithmetic.cpp:
3009 (JSC::JIT::compileFastArith_op_lshift):
3010 (JSC::JIT::compileFastArith_op_rshift):
3011 (JSC::JIT::compileFastArith_op_bitand):
3012 (JSC::JIT::compileFastArithSlow_op_bitand):
3013 (JSC::JIT::compileFastArith_op_mod):
3014 (JSC::JIT::compileFastArithSlow_op_mod):
3015 (JSC::JIT::compileFastArith_op_add):
3016 (JSC::JIT::compileFastArith_op_mul):
3017 (JSC::JIT::compileFastArith_op_post_inc):
3018 (JSC::JIT::compileFastArith_op_post_dec):
3019 (JSC::JIT::compileFastArith_op_pre_inc):
3020 (JSC::JIT::compileFastArith_op_pre_dec):
3021 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
3022 (JSC::JIT::compileBinaryArithOp):
3024 (JSC::JIT::compileOpCallSlowCase):
3025 * jit/JITInlineMethods.h:
3026 (JSC::JIT::emitJumpIfJSCell):
3027 (JSC::JIT::emitJumpIfNotJSCell):
3028 (JSC::JIT::emitJumpIfImmNum):
3029 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
3030 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
3031 (JSC::JIT::emitFastArithDeTagImmediate):
3032 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
3033 (JSC::JIT::emitFastArithReTagImmediate):
3034 (JSC::JIT::emitFastArithImmToInt):
3035 (JSC::JIT::emitFastArithIntToImmNoCheck):
3036 (JSC::JIT::emitTagAsBoolImmediate):
3037 * jit/JITPropertyAccess.cpp:
3038 (JSC::resizePropertyStorage):
3039 (JSC::JIT::privateCompilePutByIdTransition):
3040 (JSC::JIT::privateCompilePatchGetArrayLength):
3041 (JSC::JIT::privateCompileGetByIdSelf):
3042 (JSC::JIT::privateCompileGetByIdProto):
3043 (JSC::JIT::privateCompileGetByIdChain):
3044 (JSC::JIT::privateCompilePutByIdReplace):
3045 * runtime/JSImmediate.h:
3046 (JSC::JSImmediate::isNumber):
3047 (JSC::JSImmediate::isPositiveNumber):
3048 (JSC::JSImmediate::areBothImmediateNumbers):
3049 (JSC::JSImmediate::xorImmediateNumbers):
3050 (JSC::JSImmediate::rightShiftImmediateNumbers):
3051 (JSC::JSImmediate::canDoFastAdditiveOperations):
3052 (JSC::JSImmediate::addImmediateNumbers):
3053 (JSC::JSImmediate::subImmediateNumbers):
3054 (JSC::JSImmediate::makeInt):
3055 (JSC::JSImmediate::toBoolean):
3058 2009-01-08 Sam Weinig <sam@webkit.org>
3060 Revert r39720. It broke Interpreted mode.
3062 2009-01-08 Sam Weinig <sam@webkit.org>
3064 Reviewed by Oliver Hunt.
3066 Fix for https://bugs.webkit.org/show_bug.cgi?id=23197
3067 Delay creating the PCVector until an exception is thrown
3068 Part of <rdar://problem/6469060>
3069 Don't store exception information for a CodeBlock until first exception is thrown
3071 - Change the process for re-parsing/re-generating bytecode for exception information
3072 to use data from the original CodeBlock (offsets of GlobalResolve instructions) to
3073 aid in creating an identical instruction stream on re-parse, instead of padding
3074 interchangeable opcodes, which would result in different JITed code.
3075 - Fix bug where the wrong ScopeChainNode was used when re-parsing/regenerating from
3076 within some odd modified scope chains.
3077 - Lazily create the pcVector by re-JITing the regenerated CodeBlock and stealing the
3078 the pcVector from it.
3080 Saves ~2MB on Membuster head.
3082 * bytecode/CodeBlock.cpp:
3083 (JSC::CodeBlock::dump):
3084 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
3085 (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
3086 (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
3087 * bytecode/CodeBlock.h:
3088 (JSC::JITCodeRef::JITCodeRef):
3089 (JSC::GlobalResolveInfo::GlobalResolveInfo):
3090 (JSC::CodeBlock::getBytecodeIndex):
3091 (JSC::CodeBlock::addGlobalResolveInstruction):
3092 (JSC::CodeBlock::addGlobalResolveInfo):
3093 (JSC::CodeBlock::addFunctionRegisterInfo):
3094 (JSC::CodeBlock::hasExceptionInfo):
3095 (JSC::CodeBlock::pcVector):
3096 (JSC::EvalCodeBlock::EvalCodeBlock):
3097 (JSC::EvalCodeBlock::baseScopeDepth):
3098 * bytecode/Opcode.h:
3099 * bytecompiler/BytecodeGenerator.cpp:
3100 (JSC::BytecodeGenerator::BytecodeGenerator):
3101 (JSC::BytecodeGenerator::emitResolve):
3102 (JSC::BytecodeGenerator::emitGetScopedVar):
3103 * bytecompiler/BytecodeGenerator.h:
3104 (JSC::BytecodeGenerator::setRegeneratingForExceptionInfo):
3105 * interpreter/Interpreter.cpp:
3106 (JSC::bytecodeOffsetForPC):
3107 (JSC::Interpreter::unwindCallFrame):
3108 (JSC::Interpreter::privateExecute):
3109 (JSC::Interpreter::retrieveLastCaller):
3110 (JSC::Interpreter::cti_op_instanceof):
3111 (JSC::Interpreter::cti_op_call_NotJSFunction):
3112 (JSC::Interpreter::cti_op_resolve):
3113 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
3114 (JSC::Interpreter::cti_op_resolve_func):
3115 (JSC::Interpreter::cti_op_resolve_skip):
3116 (JSC::Interpreter::cti_op_resolve_global):
3117 (JSC::Interpreter::cti_op_resolve_with_base):
3118 (JSC::Interpreter::cti_op_throw):
3119 (JSC::Interpreter::cti_op_in):
3120 (JSC::Interpreter::cti_vm_throw):
3122 (JSC::JIT::privateCompile):
3124 (JSC::EvalNode::generateBytecode):
3125 (JSC::EvalNode::bytecodeForExceptionInfoReparse):
3126 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
3129 2009-01-08 Jian Li <jianli@chromium.org>
3131 Reviewed by Alexey Proskuryakov.
3133 Add Win32 implementation of ThreadSpecific.
3134 https://bugs.webkit.org/show_bug.cgi?id=22614
3136 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3137 * wtf/ThreadSpecific.h:
3138 (WTF::ThreadSpecific::ThreadSpecific):
3139 (WTF::ThreadSpecific::~ThreadSpecific):
3140 (WTF::ThreadSpecific::get):
3141 (WTF::ThreadSpecific::set):
3142 (WTF::ThreadSpecific::destroy):
3143 * wtf/ThreadSpecificWin.cpp: Added.
3144 (WTF::ThreadSpecificThreadExit):
3145 * wtf/ThreadingWin.cpp:
3146 (WTF::wtfThreadEntryPoint):
3148 2009-01-08 Justin McPherson <justin.mcpherson@nokia.com>
3150 Reviewed by Simon Hausmann.
3152 Fix compilation with Qt on NetBSD.
3154 * runtime/Collector.cpp:
3155 (JSC::currentThreadStackBase): Use PLATFORM(NETBSD) to enter the
3156 code path to retrieve the stack base using pthread_attr_get_np.
3157 The PTHREAD_NP_H define is not used because the header file does
3158 not exist on NetBSD, but the function is declared nevertheless.
3159 * wtf/Platform.h: Introduce WTF_PLATFORM_NETBSD.
3161 2009-01-07 Sam Weinig <sam@webkit.org>
3163 Reviewed by Geoffrey Garen.
3165 <rdar://problem/6469060> Don't store exception information for a CodeBlock until first exception is thrown
3167 Don't initially store exception information (lineNumber/expressionRange/getByIdExcecptionInfo)
3168 in CodeBlocks blocks. Instead, re-parse for the data on demand and cache it then.
3170 One important change that was needed to make this work was to pad op_get_global_var with nops to
3171 be the same length as op_resolve_global, since one could be replaced for the other on re-parsing,
3172 and we want to keep the offsets bytecode offsets the same.
3174 1.3MB improvement on Membuster head.
3176 * bytecode/CodeBlock.cpp:
3177 (JSC::CodeBlock::dump): Update op_get_global_var to account for the padding.
3178 (JSC::CodeBlock::dumpStatistics): Add more statistic dumping.
3179 (JSC::CodeBlock::CodeBlock): Initialize m_exceptionInfo.
3180 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): Re-parses the CodeBlocks
3181 associated SourceCode and steals the ExceptionInfo from it.
3182 (JSC::CodeBlock::lineNumberForBytecodeOffset): Creates the exception info on demand.
3183 (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
3184 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
3185 * bytecode/CodeBlock.h:
3186 (JSC::CodeBlock::numberOfExceptionHandlers): Updated to account for m_exceptionInfo indirection.
3187 (JSC::CodeBlock::addExceptionHandler): Ditto.
3188 (JSC::CodeBlock::exceptionHandler): Ditto.
3189 (JSC::CodeBlock::clearExceptionInfo): Ditto.
3190 (JSC::CodeBlock::addExpressionInfo): Ditto.
3191 (JSC::CodeBlock::addGetByIdExceptionInfo): Ditto.
3192 (JSC::CodeBlock::numberOfLineInfos): Ditto.
3193 (JSC::CodeBlock::addLineInfo): Ditto.
3194 (JSC::CodeBlock::lastLineInfo): Ditto.
3196 * bytecode/Opcode.h: Change length of op_get_global_var to match op_resolve_global.
3198 * bytecode/SamplingTool.cpp:
3199 (JSC::SamplingTool::dump): Add comment indicating why it is okay not to pass a CallFrame.
3201 * bytecompiler/BytecodeGenerator.cpp:
3202 (JSC::BytecodeGenerator::generate): Clear the exception info after generation for Function and Eval
3203 Code when not in regenerate for exception info mode.
3204 (JSC::BytecodeGenerator::BytecodeGenerator): Initialize m_regeneratingForExceptionInfo to false.
3205 (JSC::BytecodeGenerator::emitGetScopedVar): Pad op_get_global_var with 2 nops.
3206 * bytecompiler/BytecodeGenerator.h:
3207 (JSC::BytecodeGenerator::setRegeneratingForExcpeptionInfo): Added.
3209 * interpreter/Interpreter.cpp:
3210 (JSC::Interpreter::throwException): Pass the CallFrame to exception info accessors.
3211 (JSC::Interpreter::privateExecute): Ditto.
3212 (JSC::Interpreter::retrieveLastCaller): Ditto.
3213 (JSC::Interpreter::cti_op_new_error): Ditto.
3216 (JSC::JIT::privateCompileMainPass): Pass the current bytecode offset instead of hard coding the
3217 line number, the stub will do the accessing if it gets called.
3220 (JSC::ProgramNode::emitBytecode): Moved.
3221 (JSC::ProgramNode::generateBytecode): Moved.
3222 (JSC::EvalNode::create): Moved.
3223 (JSC::EvalNode::bytecodeForExceptionInfoReparse): Added.
3224 (JSC::FunctionBodyNode::generateBytecode): Rename reparse to reparseInPlace.
3225 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse): Addded.
3228 (JSC::ScopeNode::features): Added getter.
3229 * parser/Parser.cpp:
3230 (JSC::Parser::reparseInPlace): Renamed from reparse.
3232 (JSC::Parser::reparse): Added. Re-parses the passed in Node into
3234 * runtime/ExceptionHelpers.cpp:
3235 (JSC::createUndefinedVariableError): Pass along CallFrame.
3236 (JSC::createInvalidParamError): Ditto.
3237 (JSC::createNotAConstructorError): Ditto.
3238 (JSC::createNotAFunctionError): Ditto.
3239 (JSC::createNotAnObjectError): Ditto.
3241 2009-01-06 Gavin Barraclough <baraclough@apple.com>
3243 Reviewed by Maciej Stachowiak.
3245 Replace accidentally removed references in BytecodeGenerator, deleting these
3246 will be hindering the sharing of constant numbers and strings.
3248 The code to add a new constant (either number or string) to their respective
3249 map works by attempting to add a null entry, then checking the result of the
3250 add for null. The first time, this should return the null (or noValue).
3251 The code checks for null (to see if this is the initial add), and then allocates
3252 a new number / string object. This code relies on the result returned from
3253 the add to the map being stored as a reference, such that the allocated object
3254 will be stored in the map, and will be resused if the same constant is encountered
3255 again. By failing to use a reference we will be leaking GC object for each
3256 additional entry added to the map. As GC objects they should be clollected,
3257 be we should no be allocatin them in the first place.
3259 https://bugs.webkit.org/show_bug.cgi?id=23158
3261 * bytecompiler/BytecodeGenerator.cpp:
3262 (JSC::BytecodeGenerator::emitLoad):
3264 2009-01-06 Oliver Hunt <oliver@apple.com>
3266 Reviewed by Gavin Barraclough.
3268 <rdar://problem/6040850> JavaScript register file should use VirtualAlloc on Windows
3270 Fairly simple, just reserve 4Mb of address space for the
3271 register file, and then commit one section at a time. We
3272 don't release committed memory as we drop back, but then
3273 mac doesn't either so this probably not too much of a
3276 * interpreter/RegisterFile.cpp:
3277 (JSC::RegisterFile::~RegisterFile):
3278 * interpreter/RegisterFile.h:
3279 (JSC::RegisterFile::RegisterFile):
3280 (JSC::RegisterFile::grow):
3282 2009-01-06 Alexey Proskuryakov <ap@webkit.org>
3284 Reviewed by Darin Adler.
3286 https://bugs.webkit.org/show_bug.cgi?id=23142
3287 ThreadGlobalData leaks seen on buildbot
3289 * wtf/ThreadSpecific.h: (WTF::ThreadSpecific::destroy): Temporarily reset the thread
3290 specific value to make getter work on Mac OS X.
3292 * wtf/Platform.h: Touch this file again to make sure all Windows builds use the most recent
3293 version of ThreadSpecific.h.
3295 2009-01-05 Gavin Barraclough <baraclough@apple.com>
3297 Reviewed by Oliver Hunt.
3299 Replace all uses of JSValue* with a new smart pointer type, JSValuePtr.
3301 A JavaScript value may be a heap object or boxed primitive, represented by a
3302 pointer, or may be an unboxed immediate value, such as an integer. Since a
3303 value may dynamically need to contain either a pointer value or an immediate,
3304 we encode immediates as pointer values (since all valid JSCell pointers are
3305 allocated at alligned addesses, unaligned addresses are available to encode
3306 immediates). As such all JavaScript values are represented using a JSValue*.
3308 This implementation is encumbered by a number of constraints. It ties the
3309 JSValue representation to the size of pointer on the platform, which, for
3310 example, means that we currently can represent different ranges of integers
3311 as immediates on x86 and x86-64. It also prevents us from overloading the
3312 to-boolean conversion used to test for noValue() - effectively forcing us
3313 to represent noValue() as 0. This would potentially be problematic were we
3314 to wish to encode integer values differently (e.g. were we to use the v8
3315 encoding, where pointers are tagged with 1 and integers with 0, then the
3316 immediate integer 0 would conflict with noValue()).
3318 This patch replaces all usage of JSValue* with a new class, JSValuePtr,
3319 which encapsulates the pointer. JSValuePtr maintains the same interface as
3320 JSValue*, overloading operator-> and operator bool such that previous
3321 operations in the code on variables of type JSValue* are still supported.
3323 In order to provide a ProtectPtr<> type with support for the new value
3324 representation (without using the internal JSValue type directly), a new
3325 ProtectJSValuePtr type has been added, equivalent to the previous type
3326 ProtectPtr<JSValue>.
3328 This patch is likely the first in a sequence of three changes. With the
3329 value now encapsulated it will likely make sense to migrate the functionality
3330 from JSValue into JSValuePtr, such that the internal pointer representation
3331 need not be exposed. Through migrating the functionality to the wrapper
3332 class the existing JSValue should be rendered redundant, and the class is
3333 likely to be removed (the JSValuePtr now wrapping a pointer to a JSCell).
3334 At this stage it will likely make sense to rename JSValuePtr to JSValue.
3336 https://bugs.webkit.org/show_bug.cgi?id=23114
3343 * API/JSCallbackConstructor.h:
3344 (JSC::JSCallbackConstructor::createStructure):
3345 * API/JSCallbackFunction.cpp:
3346 (JSC::JSCallbackFunction::call):
3347 * API/JSCallbackFunction.h:
3348 (JSC::JSCallbackFunction::createStructure):
3349 * API/JSCallbackObject.h:
3350 (JSC::JSCallbackObject::createStructure):
3351 * API/JSCallbackObjectFunctions.h:
3352 (JSC::::asCallbackObject):
3354 (JSC::::hasInstance):
3356 (JSC::::staticValueGetter):
3357 (JSC::::staticFunctionGetter):
3358 (JSC::::callbackGetter):
3359 * API/JSContextRef.cpp:
3360 * API/JSObjectRef.cpp:
3361 (JSObjectMakeConstructor):
3362 (JSObjectSetPrototype):
3363 (JSObjectGetProperty):
3364 (JSObjectSetProperty):
3365 (JSObjectGetPropertyAtIndex):
3366 (JSObjectSetPropertyAtIndex):
3367 * API/JSValueRef.cpp:
3369 (JSValueIsUndefined):
3375 (JSValueIsObjectOfClass):
3377 (JSValueIsStrictEqual):
3378 (JSValueIsInstanceOfConstructor):
3381 (JSValueToStringCopy):
3385 * JavaScriptCore.exp:
3386 * bytecode/CodeBlock.cpp:
3387 (JSC::valueToSourceString):
3388 (JSC::constantName):
3389 (JSC::CodeBlock::dump):
3390 * bytecode/CodeBlock.h:
3391 (JSC::CodeBlock::getConstant):
3392 (JSC::CodeBlock::addUnexpectedConstant):
3393 (JSC::CodeBlock::unexpectedConstant):
3394 * bytecode/EvalCodeCache.h:
3395 (JSC::EvalCodeCache::get):
3396 * bytecompiler/BytecodeGenerator.cpp:
3397 (JSC::BytecodeGenerator::BytecodeGenerator):
3398 (JSC::BytecodeGenerator::addConstant):
3399 (JSC::BytecodeGenerator::addUnexpectedConstant):
3400 (JSC::BytecodeGenerator::emitLoad):
3401 (JSC::BytecodeGenerator::emitLoadJSV):
3402 (JSC::BytecodeGenerator::emitGetScopedVar):
3403 (JSC::BytecodeGenerator::emitPutScopedVar):
3404 (JSC::BytecodeGenerator::emitNewError):
3405 (JSC::keyForImmediateSwitch):
3406 * bytecompiler/BytecodeGenerator.h:
3407 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
3408 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
3409 * debugger/DebuggerCallFrame.cpp:
3410 (JSC::DebuggerCallFrame::evaluate):
3411 * debugger/DebuggerCallFrame.h:
3412 (JSC::DebuggerCallFrame::DebuggerCallFrame):
3413 (JSC::DebuggerCallFrame::exception):
3414 * interpreter/CallFrame.cpp:
3415 (JSC::CallFrame::thisValue):
3416 * interpreter/CallFrame.h:
3417 (JSC::ExecState::setException):
3418 (JSC::ExecState::exception):
3419 (JSC::ExecState::exceptionSlot):
3420 (JSC::ExecState::hadException):
3421 * interpreter/Interpreter.cpp:
3422 (JSC::fastIsNumber):
3424 (JSC::fastToUInt32):
3427 (JSC::jsAddSlowCase):
3429 (JSC::jsTypeStringForValue):
3430 (JSC::jsIsObjectType):
3431 (JSC::jsIsFunctionType):
3432 (JSC::Interpreter::resolve):
3433 (JSC::Interpreter::resolveSkip):
3434 (JSC::Interpreter::resolveGlobal):
3435 (JSC::inlineResolveBase):
3436 (JSC::Interpreter::resolveBase):
3437 (JSC::Interpreter::resolveBaseAndProperty):
3438 (JSC::Interpreter::resolveBaseAndFunc):
3440 (JSC::Interpreter::callEval):
3441 (JSC::Interpreter::unwindCallFrame):
3442 (JSC::Interpreter::throwException):
3443 (JSC::Interpreter::execute):
3444 (JSC::Interpreter::checkTimeout):
3445 (JSC::Interpreter::createExceptionScope):
3446 (JSC::cachePrototypeChain):
3447 (JSC::Interpreter::tryCachePutByID):
3448 (JSC::countPrototypeChainEntriesAndCheckForProxies):
3449 (JSC::Interpreter::tryCacheGetByID):
3450 (JSC::Interpreter::privateExecute):
3451 (JSC::Interpreter::retrieveArguments):
3452 (JSC::Interpreter::retrieveCaller):
3453 (JSC::Interpreter::retrieveLastCaller):
3454 (JSC::Interpreter::tryCTICachePutByID):
3455 (JSC::Interpreter::tryCTICacheGetByID):
3456 (JSC::returnToThrowTrampoline):
3457 (JSC::Interpreter::cti_op_convert_this):
3458 (JSC::Interpreter::cti_op_add):
3459 (JSC::Interpreter::cti_op_pre_inc):
3460 (JSC::Interpreter::cti_op_loop_if_less):
3461 (JSC::Interpreter::cti_op_loop_if_lesseq):
3462 (JSC::Interpreter::cti_op_get_by_id_generic):
3463 (JSC::Interpreter::cti_op_get_by_id):
3464 (JSC::Interpreter::cti_op_get_by_id_second):
3465 (JSC::Interpreter::cti_op_get_by_id_self_fail):
3466 (JSC::Interpreter::cti_op_get_by_id_proto_list):
3467 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
3468 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
3469 (JSC::Interpreter::cti_op_get_by_id_array_fail):
3470 (JSC::Interpreter::cti_op_get_by_id_string_fail):
3471 (JSC::Interpreter::cti_op_instanceof):
3472 (JSC::Interpreter::cti_op_del_by_id):
3473 (JSC::Interpreter::cti_op_mul):
3474 (JSC::Interpreter::cti_op_call_NotJSFunction):
3475 (JSC::Interpreter::cti_op_resolve):
3476 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
3477 (JSC::Interpreter::cti_op_get_by_val):
3478 (JSC::Interpreter::cti_op_resolve_func):
3479 (JSC::Interpreter::cti_op_sub):
3480 (JSC::Interpreter::cti_op_put_by_val):
3481 (JSC::Interpreter::cti_op_put_by_val_array):
3482 (JSC::Interpreter::cti_op_lesseq):
3483 (JSC::Interpreter::cti_op_loop_if_true):
3484 (JSC::Interpreter::cti_op_negate):
3485 (JSC::Interpreter::cti_op_resolve_base):
3486 (JSC::Interpreter::cti_op_resolve_skip):
3487 (JSC::Interpreter::cti_op_resolve_global):
3488 (JSC::Interpreter::cti_op_div):
3489 (JSC::Interpreter::cti_op_pre_dec):
3490 (JSC::Interpreter::cti_op_jless):
3491 (JSC::Interpreter::cti_op_not):
3492 (JSC::Interpreter::cti_op_jtrue):
3493 (JSC::Interpreter::cti_op_post_inc):
3494 (JSC::Interpreter::cti_op_eq):
3495 (JSC::Interpreter::cti_op_lshift):
3496 (JSC::Interpreter::cti_op_bitand):
3497 (JSC::Interpreter::cti_op_rshift):
3498 (JSC::Interpreter::cti_op_bitnot):
3499 (JSC::Interpreter::cti_op_resolve_with_base):
3500 (JSC::Interpreter::cti_op_mod):
3501 (JSC::Interpreter::cti_op_less):
3502 (JSC::Interpreter::cti_op_neq):
3503 (JSC::Interpreter::cti_op_post_dec):
3504 (JSC::Interpreter::cti_op_urshift):
3505 (JSC::Interpreter::cti_op_bitxor):
3506 (JSC::Interpreter::cti_op_bitor):
3507 (JSC::Interpreter::cti_op_call_eval):
3508 (JSC::Interpreter::cti_op_throw):
3509 (JSC::Interpreter::cti_op_next_pname):
3510 (JSC::Interpreter::cti_op_typeof):
3511 (JSC::Interpreter::cti_op_is_undefined):
3512 (JSC::Interpreter::cti_op_is_boolean):
3513 (JSC::Interpreter::cti_op_is_number):
3514 (JSC::Interpreter::cti_op_is_string):
3515 (JSC::Interpreter::cti_op_is_object):
3516 (JSC::Interpreter::cti_op_is_function):
3517 (JSC::Interpreter::cti_op_stricteq):
3518 (JSC::Interpreter::cti_op_nstricteq):
3519 (JSC::Interpreter::cti_op_to_jsnumber):
3520 (JSC::Interpreter::cti_op_in):
3521 (JSC::Interpreter::cti_op_switch_imm):
3522 (JSC::Interpreter::cti_op_switch_char):
3523 (JSC::Interpreter::cti_op_switch_string):
3524 (JSC::Interpreter::cti_op_del_by_val):
3525 (JSC::Interpreter::cti_op_new_error):
3526 (JSC::Interpreter::cti_vm_throw):
3527 * interpreter/Interpreter.h:
3528 (JSC::Interpreter::isJSArray):
3529 (JSC::Interpreter::isJSString):
3530 * interpreter/Register.h: