1 2008-10-22 Darin Adler <darin@apple.com>
3 Reviewed by Sam Weinig.
5 - fix https://bugs.webkit.org/show_bug.cgi?id=21294
6 Bug 21294: Devirtualize getOwnPropertySlot()
8 A bit over 3% faster on V8 tests.
10 * JavascriptCore.exp: Export leak-related functions..
12 * API/JSCallbackConstructor.h:
13 (JSC::JSCallbackConstructor::createStructureID): Set HasStandardGetOwnPropertySlot
14 since this class doesn't override getPropertySlot.
15 * API/JSCallbackFunction.h:
16 (JSC::JSCallbackFunction::createStructureID): Ditto.
18 * VM/ExceptionHelpers.cpp:
19 (JSC::InterruptedExecutionError::InterruptedExecutionError): Use a structure
20 that's created just for this class instead of trying to share a single "null
24 (JSC::Machine::cti_op_create_arguments_no_params): Rename
25 Arguments::ArgumentsNoParameters to Arguments::NoParameters.
27 * kjs/Arguments.h: Rename the enum from Arguments::ArgumentsParameters to
28 Arguments::NoParametersType and the value from Arguments::ArgumentsNoParameters
29 to Arguments::NoParameters.
30 (JSC::Arguments::createStructureID): Added. Returns a structure without
31 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
32 (JSC::Arguments::Arguments): Added an assertion that there are no parameters.
34 * kjs/DatePrototype.h:
35 (JSC::DatePrototype::createStructureID): Added. Returns a structure without
36 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
38 * kjs/FunctionPrototype.h:
39 (JSC::FunctionPrototype::createStructureID): Set HasStandardGetOwnPropertySlot
40 since this class doesn't override getPropertySlot.
41 * kjs/InternalFunction.h:
42 (JSC::InternalFunction::createStructureID): Ditto.
45 (JSC::JSArray::createStructureID): Added. Returns a structure without
46 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
48 * kjs/JSCell.h: Added declaration of fastGetOwnPropertySlot; a non-virtual
49 version that uses the structure bit to decide whether to call the virtual
53 (JSC::JSFunction::createStructureID): Added. Returns a structure without
54 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
56 * kjs/JSGlobalData.cpp:
57 (JSC::JSGlobalData::JSGlobalData): Initialize new structures; removed
59 * kjs/JSGlobalData.h: Added new structures. Removed nullProtoStructureID.
61 * kjs/JSGlobalObject.h:
62 (JSC::JSGlobalObject::createStructureID): Added. Returns a structure without
63 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
65 * kjs/JSNotAnObject.h:
66 (JSC::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub): Use a structure
67 that's created just for this class instead of trying to share a single "null
69 (JSC::JSNotAnObjectErrorStub::isNotAnObjectErrorStub): Marked this function
70 virtual for clarity and made it private since no one should call it if they
71 already have a pointer to this specific type.
72 (JSC::JSNotAnObject::JSNotAnObject): Use a structure that's created just
73 for this class instead of trying to share a single "null prototype" structure.
74 (JSC::JSNotAnObject::createStructureID): Added. Returns a structure without
75 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
78 (JSC::JSObject::createStructureID): Added HasStandardGetOwnPropertySlot.
79 (JSC::JSObject::inlineGetOwnPropertySlot): Added. Used so we can share code
80 between getOwnPropertySlot and fastGetOwnPropertySlot.
81 (JSC::JSObject::getOwnPropertySlot): Moved so that functions are above the
82 functions that call them. Moved the guts of this function into
83 inlineGetOwnPropertySlot.
84 (JSC::JSCell::fastGetOwnPropertySlot): Added. Checks the
85 HasStandardGetOwnPropertySlot bit and if it's set, calls
86 inlineGetOwnPropertySlot, otherwise calls getOwnPropertySlot.
87 (JSC::JSObject::getPropertySlot): Changed to call fastGetOwnPropertySlot.
88 (JSC::JSValue::get): Changed to call fastGetOwnPropertySlot.
90 * kjs/JSWrapperObject.h: Made constructor protected to emphasize that
91 this class is only a base class and never instantiated.
94 (JSC::MathObject::createStructureID): Added. Returns a structure without
95 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
96 * kjs/NumberConstructor.h:
97 (JSC::NumberConstructor::createStructureID): Ditto.
98 * kjs/RegExpConstructor.h:
99 (JSC::RegExpConstructor::createStructureID): Ditto.
100 * kjs/RegExpObject.h:
101 (JSC::RegExpObject::createStructureID): Ditto.
102 * kjs/StringObject.h:
103 (JSC::StringObject::createStructureID): Ditto.
105 * kjs/TypeInfo.h: Added HasStandardGetOwnPropertySlot flag and
106 hasStandardGetOwnPropertySlot accessor function.
108 2008-10-22 Cameron Zwarich <zwarich@apple.com>
110 Reviewed by Geoff Garen.
112 Bug 21803: Fuse op_jfalse with op_eq_null and op_neq_null
113 <https://bugs.webkit.org/show_bug.cgi?id=21803>
115 Fuse op_jfalse with op_eq_null and op_neq_null to make the new opcodes
116 op_jeq_null and op_jneq_null.
118 This is a 2.6% speedup on the V8 Raytrace benchmark, and strangely also
119 a 4.7% speedup on the V8 Arguments benchmark, even though it uses
120 neither of the two new opcodes.
123 (JSC::CTI::privateCompileMainPass):
125 (JSC::CodeBlock::dump):
126 * VM/CodeGenerator.cpp:
127 (JSC::CodeGenerator::emitJumpIfTrue):
128 (JSC::CodeGenerator::emitJumpIfFalse):
130 (JSC::Machine::privateExecute):
133 2008-10-22 Darin Fisher <darin@chromium.org>
135 Reviewed by Eric Seidel.
137 Should not define PLATFORM(WIN,MAC,GTK) when PLATFORM(CHROMIUM) is defined
138 https://bugs.webkit.org/show_bug.cgi?id=21757
140 PLATFORM(CHROMIUM) implies HAVE_ACCESSIBILITY
144 2008-10-22 Cameron Zwarich <zwarich@apple.com>
146 Reviewed by Alexey Proskuryakov.
148 Correct opcode names in documentation.
151 (JSC::Machine::privateExecute):
153 2008-10-21 Oliver Hunt <oliver@apple.com>
155 RS=Maciej Stachowiak.
157 Force FastMalloc to make all allocated pages executable in
158 a vague hope this will allow the Win2k3 bot to be able to
161 Filed Bug 21783: Need more granular control over allocation of executable memory
162 to cover a more granular version of this patch.
164 * wtf/TCSystemAlloc.cpp:
167 2008-10-21 Alexey Proskuryakov <ap@webkit.org>
169 Reviewed by Darin Adler.
171 https://bugs.webkit.org/show_bug.cgi?id=21769
172 MessagePort should be GC protected if there are messages to be delivered
174 * wtf/MessageQueue.h:
175 (WTF::::isEmpty): Added. Also added a warning for methods that return a snapshot of queue
176 state, thus likely to cause race conditions.
178 2008-10-21 Darin Adler <darin@apple.com>
180 Reviewed by Maciej Stachowiak.
182 - convert post-increment to pre-increment in a couple more places for speed
184 Speeds up V8 benchmarks a little on most computers. (But, strangely, slows
185 them down a little on my computer.)
188 (JSC::statementListEmitCode): Removed default argument, since we always want
189 to specify this explicitly.
190 (JSC::ForNode::emitCode): Tolerate ignoredResult() as the dst -- means the
192 (JSC::ReturnNode::emitCode): Ditto.
193 (JSC::ThrowNode::emitCode): Ditto.
194 (JSC::FunctionBodyNode::emitCode): Pass ignoredResult() so that we know we
195 don't have to compute the result of function statements.
197 2008-10-21 Peter Kasting <pkasting@google.com>
199 Reviewed by Maciej Stachowiak.
201 Fix an include of a non-public header to use "" instead of <>.
203 * API/JSProfilerPrivate.cpp:
205 2008-10-20 Sam Weinig <sam@webkit.org>
207 Reviewed by Cameron Zwarich.
209 Fix for https://bugs.webkit.org/show_bug.cgi?id=21766
210 REGRESSION: 12 JSC tests fail
212 The JSGlobalObject was mutating the shared nullProtoStructureID when
213 used in jsc. Instead of using nullProtoStructureID, use a new StructureID.
215 * API/JSCallbackObject.h:
216 * API/JSCallbackObjectFunctions.h:
217 (JSC::::JSCallbackObject):
218 * API/JSContextRef.cpp:
219 (JSGlobalContextCreateInGroup):
220 * kjs/JSGlobalObject.h:
221 (JSC::JSGlobalObject::JSGlobalObject):
223 (GlobalObject::GlobalObject):
226 2008-10-20 Cameron Zwarich <zwarich@apple.com>
228 Reviewed by Maciej Stachowiak.
230 Remove an untaken branch in CodeGenerator::emitJumpIfFalse(). This
231 function is never called with a backwards target LabelID, and there is
232 even an assertion to this effect at the top of the function body.
234 * VM/CodeGenerator.cpp:
235 (JSC::CodeGenerator::emitJumpIfFalse):
237 2008-10-20 Cameron Zwarich <zwarich@apple.com>
239 Rubber-stamped by Sam Weinig.
241 Add opcode documentation for undocumented opcodes.
244 (JSC::Machine::privateExecute):
246 2008-10-16 Sam Weinig <sam@webkit.org>
248 Reviewed by Cameron Zwarich.
250 Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
251 Don't create intermediate StructureIDs for builtin objects
253 Second stage in reduce number of StructureIDs created when initializing the
256 - Use putDirectWithoutTransition for the remaining singleton objects to reduce
257 the number of StructureIDs create for about:blank from 132 to 73.
259 * kjs/ArrayConstructor.cpp:
260 (JSC::ArrayConstructor::ArrayConstructor):
261 * kjs/BooleanConstructor.cpp:
262 (JSC::BooleanConstructor::BooleanConstructor):
263 * kjs/BooleanPrototype.cpp:
264 (JSC::BooleanPrototype::BooleanPrototype):
265 * kjs/DateConstructor.cpp:
266 (JSC::DateConstructor::DateConstructor):
267 * kjs/ErrorConstructor.cpp:
268 (JSC::ErrorConstructor::ErrorConstructor):
269 * kjs/ErrorPrototype.cpp:
270 (JSC::ErrorPrototype::ErrorPrototype):
271 * kjs/FunctionConstructor.cpp:
272 (JSC::FunctionConstructor::FunctionConstructor):
273 * kjs/FunctionPrototype.cpp:
274 (JSC::FunctionPrototype::FunctionPrototype):
275 (JSC::FunctionPrototype::addFunctionProperties):
276 * kjs/FunctionPrototype.h:
277 (JSC::FunctionPrototype::createStructureID):
278 * kjs/InternalFunction.cpp:
279 * kjs/InternalFunction.h:
280 (JSC::InternalFunction::InternalFunction):
281 * kjs/JSGlobalObject.cpp:
282 (JSC::JSGlobalObject::reset):
284 * kjs/MathObject.cpp:
285 (JSC::MathObject::MathObject):
286 * kjs/NumberConstructor.cpp:
287 (JSC::NumberConstructor::NumberConstructor):
288 * kjs/NumberPrototype.cpp:
289 (JSC::NumberPrototype::NumberPrototype):
290 * kjs/ObjectConstructor.cpp:
291 (JSC::ObjectConstructor::ObjectConstructor):
292 * kjs/RegExpConstructor.cpp:
293 (JSC::RegExpConstructor::RegExpConstructor):
294 * kjs/RegExpPrototype.cpp:
295 (JSC::RegExpPrototype::RegExpPrototype):
296 * kjs/StringConstructor.cpp:
297 (JSC::StringConstructor::StringConstructor):
298 * kjs/StringPrototype.cpp:
299 (JSC::StringPrototype::StringPrototype):
300 * kjs/StructureID.cpp:
301 (JSC::StructureID::dumpStatistics):
303 (JSC::StructureID::setPrototypeWithoutTransition):
305 2008-10-20 Alp Toker <alp@nuanti.com>
307 Fix autotools dist build target by listing recently added header
308 files only. Not reviewed.
312 2008-10-20 Geoffrey Garen <ggaren@apple.com>
314 Reviewed by Anders Carlsson.
317 (JSC::Machine::tryCacheGetByID): Removed a redundant and sometimes
318 incorrect cast, which started ASSERTing after Darin's last checkin.
320 2008-10-20 Geoffrey Garen <ggaren@apple.com>
324 Re-enable CTI, which I accidentally disabled while checking in fixes
329 2008-10-20 Alp Toker <alp@nuanti.com>
331 Rubber-stamped by Mark Rowe.
333 Typo fix in function name: mimimum -> minimum.
336 (JSC::minimumYearForDST):
337 (JSC::equivalentYearForDST):
339 2008-10-20 Alp Toker <alp@nuanti.com>
341 Reviewed by Mark Rowe.
343 Use pthread instead of GThread where possible in the GTK+ port. This
344 fixes issues with global initialisation, particularly on GTK+/Win32
345 where a late g_thread_init() will cause hangs.
350 * wtf/ThreadingGtk.cpp:
351 * wtf/ThreadingPthreads.cpp:
353 2008-10-20 Geoffrey Garen <ggaren@apple.com>
355 Reviewed by Darin Adler.
357 Fixed https://bugs.webkit.org/show_bug.cgi?id=21735
358 Emit profiling instrumentation only if the Web Inspector's profiling
361 22.2% speedup on empty function call benchmark.
362 2.9% speedup on v8 benchmark.
363 0.7% speedup on SunSpider.
365 Lesser but similar speedups in bytecode.
368 (JSC::CTI::compileOpCall):
369 (JSC::CTI::privateCompileMainPass):
370 (JSC::CTI::privateCompileSlowCases): Nixed JITed profiler hooks. Profiler
371 hooks now have their own opcodes. Added support for compiling profiler
374 (JSC::CodeBlock::dump): Dump support for the new profiling opcodes.
376 * VM/CodeGenerator.h:
377 * VM/CodeGenerator.cpp:
378 (JSC::CodeGenerator::CodeGenerator):
379 (JSC::CodeGenerator::emitCall):
380 (JSC::CodeGenerator::emitConstruct): Conditionally emit profiling hooks
381 around call and construct, at the call site. (It's easier to get things
382 right this way, if you have profiled code calling non-profiled code.
383 Also, you get a slightly more accurate profile, since you charge the full
384 cost of the call / construct operation to the callee.)
386 Also, fixed a bug where construct would fetch the ".prototype" property
387 from the constructor before evaluating the arguments to the constructor,
388 incorrectly allowing an "invalid constructor" exception to short-circuit
389 argument evaluation. I encountered this bug when trying to make
390 constructor exceptions work with profiling.
393 (JSC::Machine::callEval): Removed obsolete profiler hooks.
395 (JSC::Machine::throwException): Added a check for an exception thrown
396 within a call instruction. We didn't need this before because the call
397 instruction would check for a valid call before involing the profiler.
398 (JSC::Machine::execute): Added a didExecute hook at the end of top-level
399 function invocation, since op_ret no longer does this for us.
401 (JSC::Machine::privateExecute): Removed obsolete profiler hooks. Added
402 profiler opcodes. Changed some ++vPC to vPC[x] notation, since the
403 latter is better for performance, and it makes reasoning about the
404 current opcode in exception handling much simpler.
406 (JSC::Machine::cti_op_call_NotJSFunction): Removed obsolete profiler
409 (JSC::Machine::cti_op_create_arguments_no_params): Added missing
410 CTI_STACK_HACK that I noticed when adding CTI_STACK_HACK to the new
411 profiler opcode functions.
413 (JSC::Machine::cti_op_profile_will_call):
414 (JSC::Machine::cti_op_profile_did_call): The new profiler opcode
417 (JSC::Machine::cti_op_construct_NotJSConstruct): Removed obsolete profiler
421 (JSC::Machine::isCallOpcode): Helper for exception handling.
423 * VM/Opcode.h: Declare new opcodes.
425 * kjs/JSGlobalObject.h:
426 (JSC::JSGlobalObject::supportsProfiling): Added virtual interface that
427 allows WebCore to specify whether the target global object has the Web
428 Inspector's profiling feature enabled.
430 * profiler/Profiler.cpp:
431 (JSC::Profiler::willExecute):
432 (JSC::Profiler::didExecute):
433 (JSC::Profiler::createCallIdentifier):
434 * profiler/Profiler.h: Added support for invoking the profiler with
435 an arbitrary JSValue*, and not a known object. We didn't need this
436 before because the call instruction would check for a valid call before
437 involing the profiler.
439 2008-10-20 Darin Adler <darin@apple.com>
441 Reviewed by Geoff Garen.
443 - get CTI working on Windows again
446 (JSC::CTI::emitCTICall): Add an overload for functions that
448 * VM/CTI.h: Use JSValue* and JSObject* as return types for
449 cti_op functions. Apparently, MSVC doesn't handle returning
450 the JSValuePtr struct in a register. We'll have to look into
454 (JSC::Machine::cti_op_convert_this):
455 (JSC::Machine::cti_op_add):
456 (JSC::Machine::cti_op_pre_inc):
457 (JSC::Machine::cti_op_new_object):
458 (JSC::Machine::cti_op_get_by_id):
459 (JSC::Machine::cti_op_get_by_id_second):
460 (JSC::Machine::cti_op_get_by_id_generic):
461 (JSC::Machine::cti_op_get_by_id_fail):
462 (JSC::Machine::cti_op_instanceof):
463 (JSC::Machine::cti_op_del_by_id):
464 (JSC::Machine::cti_op_mul):
465 (JSC::Machine::cti_op_new_func):
466 (JSC::Machine::cti_op_push_activation):
467 (JSC::Machine::cti_op_call_NotJSFunction):
468 (JSC::Machine::cti_op_new_array):
469 (JSC::Machine::cti_op_resolve):
470 (JSC::Machine::cti_op_construct_JSConstructFast):
471 (JSC::Machine::cti_op_construct_NotJSConstruct):
472 (JSC::Machine::cti_op_get_by_val):
473 (JSC::Machine::cti_op_sub):
474 (JSC::Machine::cti_op_lesseq):
475 (JSC::Machine::cti_op_negate):
476 (JSC::Machine::cti_op_resolve_base):
477 (JSC::Machine::cti_op_resolve_skip):
478 (JSC::Machine::cti_op_resolve_global):
479 (JSC::Machine::cti_op_div):
480 (JSC::Machine::cti_op_pre_dec):
481 (JSC::Machine::cti_op_not):
482 (JSC::Machine::cti_op_eq):
483 (JSC::Machine::cti_op_lshift):
484 (JSC::Machine::cti_op_bitand):
485 (JSC::Machine::cti_op_rshift):
486 (JSC::Machine::cti_op_bitnot):
487 (JSC::Machine::cti_op_new_func_exp):
488 (JSC::Machine::cti_op_mod):
489 (JSC::Machine::cti_op_less):
490 (JSC::Machine::cti_op_neq):
491 (JSC::Machine::cti_op_urshift):
492 (JSC::Machine::cti_op_bitxor):
493 (JSC::Machine::cti_op_new_regexp):
494 (JSC::Machine::cti_op_bitor):
495 (JSC::Machine::cti_op_call_eval):
496 (JSC::Machine::cti_op_throw):
497 (JSC::Machine::cti_op_next_pname):
498 (JSC::Machine::cti_op_typeof):
499 (JSC::Machine::cti_op_is_undefined):
500 (JSC::Machine::cti_op_is_boolean):
501 (JSC::Machine::cti_op_is_number):
502 (JSC::Machine::cti_op_is_string):
503 (JSC::Machine::cti_op_is_object):
504 (JSC::Machine::cti_op_is_function):
505 (JSC::Machine::cti_op_stricteq):
506 (JSC::Machine::cti_op_nstricteq):
507 (JSC::Machine::cti_op_to_jsnumber):
508 (JSC::Machine::cti_op_in):
509 (JSC::Machine::cti_op_push_new_scope):
510 (JSC::Machine::cti_op_del_by_val):
511 (JSC::Machine::cti_op_new_error):
512 (JSC::Machine::cti_vm_throw):
513 Change these functions to return pointer types, and never
515 * VM/Machine.h: Ditto.
517 2008-10-20 Geoffrey Garen <ggaren@apple.com>
519 Reviewed by Darin Adler.
521 Fixed some recent break-age in bytecode mode.
524 (JSC::CodeBlock::printStructureIDs): Fixed up an ASSERT caused by
525 Gavin's last checkin. This is a temporary fix so I can keep on moving.
526 I'll send email about what I think is an underlying problem soon.
529 (JSC::Machine::privateExecute): Removed a redundant and sometimes
530 incorrect cast, which started ASSERTing after Darin's last checkin.
532 2008-10-20 Darin Adler <darin@apple.com>
534 - another similar Windows build fix
536 * VM/CTI.cpp: Changed return type to JSObject* instead of JSValuePtr.
538 2008-10-20 Darin Adler <darin@apple.com>
540 - try to fix Windows build
542 * VM/CTI.cpp: Use JSValue* instead of JSValuePtr for ctiTrampoline.
545 2008-10-19 Darin Adler <darin@apple.com>
547 Reviewed by Cameron Zwarich.
549 - finish https://bugs.webkit.org/show_bug.cgi?id=21732
550 improve performance by eliminating JSValue as a base class for JSCell
553 (JSC::Machine::cti_op_call_profiler): Use asFunction.
554 (JSC::Machine::cti_vm_lazyLinkCall): Ditto.
555 (JSC::Machine::cti_op_construct_JSConstructFast): Use asObject.
557 * kjs/JSCell.h: Re-sort friend classes. Eliminate inheritance from
558 JSValue. Changed cast in asCell from static_cast to reinterpret_cast.
559 Removed JSValue::getNumber(double&) and one of JSValue::getObject
562 * kjs/JSValue.h: Made the private constructor and destructor both
563 non-virtual and also remove the definitions. This class can never
564 be instantiated or derived.
566 2008-10-19 Darin Adler <darin@apple.com>
568 Reviewed by Cameron Zwarich.
570 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
571 improve performance by eliminating JSValue as a base class for JSCell
573 Change JSValuePtr from a typedef into a class. This allows us to support
574 conversion from JSCell* to JSValuePtr even if JSCell isn't derived from
577 * JavaScriptCore.exp: Updated symbols that involve JSValuePtr, since
578 it's now a distinct type.
581 (toRef): Extract the JSValuePtr payload explicitly since we can't just
584 (JSC::CTI::asInteger): Ditto.
586 * VM/CodeGenerator.cpp:
587 (JSC::CodeGenerator::addConstant): Get at the payload directly.
588 (JSC::CodeGenerator::emitLoad): Added an overload of JSCell* because
589 otherwise classes derived from JSValue end up calling the bool
590 overload instead of JSValuePtr.
591 * VM/CodeGenerator.h: Ditto. Also update traits to use JSValue*
592 and the payload functions.
594 * VM/Register.h: Added a JSCell* overload and use of payload functions.
597 (JSC::asCell): Use payload function.
598 (JSC::JSValue::asCell): Use JSValue* instead of JSValuePtr.
599 (JSC::JSValuePtr::JSValuePtr): Added. Constructor that takes JSCell*
600 and creates a JSValuePtr.
602 * kjs/JSImmediate.h: Added JSValuePtr class. Also updated makeValue
603 and makeInt to work with JSValue* and the payload function.
605 * kjs/JSValue.h: Added == and != operators for JSValuePtr. Put them
606 here because eventually all the JSValue functions should go here
607 except what's needed by JSImmediate. Also fix asValue to use
608 JSValue* instead of JSValuePtr.
610 * kjs/PropertySlot.h: Change constructor to take JSValuePtr.
612 * kjs/protect.h: Update gcProtect functions to work with JSCell*
613 as well as JSValuePtr. Also updated the ProtectedPtr<JSValuePtr>
614 specialization to work more directly. Also changed all the call
615 sites to use gcProtectNullTolerant.
617 2008-10-19 Darin Adler <darin@apple.com>
619 Reviewed by Oliver Hunt.
621 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
622 improve performance by eliminating JSValue as a base class for JSCell
624 Remove most uses of JSValue, which will be removed in a future patch.
627 (JSC::fastToUInt32): Call toUInt32SlowCase function; no longer a member
629 * kjs/JSNumberCell.h:
630 (JSC::JSNumberCell::toInt32): Ditto.
631 (JSC::JSNumberCell::toUInt32): Ditto.
634 (JSC::toInt32SlowCase): Made a non-member function.
635 (JSC::JSValue::toInt32SlowCase): Changed to call non-member function.
636 (JSC::toUInt32SlowCase): More of the same.
637 (JSC::JSValue::toUInt32SlowCase): Ditto.
639 * kjs/JSValue.h: Moved static member function so they are no longer
640 member functions at all.
642 * VM/CTI.h: Removed forward declaration of JSValue.
643 * VM/ExceptionHelpers.h: Ditto.
644 * kjs/CallData.h: Ditto.
645 * kjs/ConstructData.h: Ditto.
646 * kjs/JSGlobalObjectFunctions.h: Ditto.
647 * kjs/PropertyMap.h: Ditto.
648 * kjs/StructureID.h: Ditto.
649 * kjs/collector.h: Ditto.
650 * kjs/completion.h: Ditto.
653 (JSC::makeBitwiseNotNode): Call new non-member toInt32 function.
654 (JSC::makeLeftShiftNode): More of the same.
655 (JSC::makeRightShiftNode): Ditto.
657 * kjs/protect.h: Added a specialization for ProtectedPtr<JSValuePtr>
658 so this can be used with JSValuePtr.
660 2008-10-18 Darin Adler <darin@apple.com>
662 Reviewed by Oliver Hunt.
664 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
665 improve performance by eliminating JSValue as a base class for JSCell
667 Tweak a little more to get closer to where we can make JSValuePtr a class.
670 (toJS): Change back to JSValue* here, since we're converting the
673 (JSC::CTI::unlinkCall): Call asPointer.
674 * VM/CTI.h: Cast to JSValue* here, since it's a pointer cast.
675 * kjs/DebuggerCallFrame.h:
676 (JSC::DebuggerCallFrame::DebuggerCallFrame): Call noValue.
677 * kjs/JSGlobalData.cpp:
678 (JSC::JSGlobalData::JSGlobalData): Call noValue.
679 * kjs/JSImmediate.cpp:
680 (JSC::JSImmediate::toObject): Remove unneeded const_cast.
681 * kjs/JSWrapperObject.h:
682 (JSC::JSWrapperObject::JSWrapperObject): Call noValue.
684 2008-10-18 Darin Adler <darin@apple.com>
686 - fix non-all-in-one build
689 (JSC::Completion::Completion): Add include of JSValue.h.
691 2008-10-18 Darin Adler <darin@apple.com>
693 Reviewed by Oliver Hunt.
695 - fix assertions I introduced with my casting changes
697 These were showing up as failures in the JavaScriptCore tests.
700 (JSC::Machine::cti_op_instanceof): Remove the bogus asCell casting that
701 was at the top of the function, and instead cast at the point of use.
702 (JSC::Machine::cti_op_construct_NotJSConstruct): Moved the cast to
703 object after checking the construct type.
705 2008-10-18 Darin Adler <darin@apple.com>
707 - fix non-all-in-one build
709 * kjs/JSGlobalObjectFunctions.h: Add include of JSImmedate.h (for now).
711 2008-10-18 Darin Adler <darin@apple.com>
715 * kjs/interpreter.h: Include JSValue.h instead of JSImmediate.h.
717 2008-10-18 Darin Adler <darin@apple.com>
719 * kjs/interpreter.h: Fix include of JSImmediate.h.
721 2008-10-18 Darin Adler <darin@apple.com>
723 - fix non-all-in-one build
725 * kjs/interpreter.h: Add include of JSImmediate.h.
727 2008-10-18 Darin Adler <darin@apple.com>
729 - fix non-all-in-one build
731 * kjs/ConstructData.h: Add include of JSImmedate.h (for now).
733 2008-10-18 Darin Adler <darin@apple.com>
735 - try to fix Windows build
738 (JSC::Machine::Machine): Use JSCell* type since MSVC seems to only allow
739 calling ~JSCell directly if it's a JSCell*.
741 2008-10-18 Darin Adler <darin@apple.com>
743 Reviewed by Cameron Zwarich.
745 - next step on https://bugs.webkit.org/show_bug.cgi?id=21732
746 improve performance by eliminating JSValue as a base class for JSCell
748 Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
749 changing JSValuePtr to be a class, and then eventually renaming it
750 to JSValue once that's done.
752 * JavaScriptCore.exp: Update entry points, since some now take JSValue*
753 instead of const JSValue*.
756 * API/JSCallbackConstructor.h:
757 * API/JSCallbackFunction.cpp:
758 * API/JSCallbackFunction.h:
759 * API/JSCallbackObject.h:
760 * API/JSCallbackObjectFunctions.h:
761 * API/JSContextRef.cpp:
762 * API/JSObjectRef.cpp:
763 * API/JSValueRef.cpp:
768 * VM/CodeGenerator.cpp:
769 * VM/CodeGenerator.h:
770 * VM/ExceptionHelpers.cpp:
771 * VM/ExceptionHelpers.h:
772 * VM/JSPropertyNameIterator.cpp:
773 * VM/JSPropertyNameIterator.h:
781 * kjs/ArrayConstructor.cpp:
782 * kjs/ArrayPrototype.cpp:
783 * kjs/BooleanConstructor.cpp:
784 * kjs/BooleanConstructor.h:
785 * kjs/BooleanObject.h:
786 * kjs/BooleanPrototype.cpp:
789 * kjs/ConstructData.cpp:
790 * kjs/ConstructData.h:
791 * kjs/DateConstructor.cpp:
792 * kjs/DateInstance.h:
793 * kjs/DatePrototype.cpp:
794 * kjs/DebuggerCallFrame.cpp:
795 * kjs/DebuggerCallFrame.h:
796 * kjs/ErrorConstructor.cpp:
797 * kjs/ErrorPrototype.cpp:
800 * kjs/FunctionConstructor.cpp:
801 * kjs/FunctionPrototype.cpp:
802 * kjs/GetterSetter.cpp:
803 * kjs/GetterSetter.h:
804 * kjs/InternalFunction.h:
805 * kjs/JSActivation.cpp:
806 * kjs/JSActivation.h:
811 * kjs/JSFunction.cpp:
813 * kjs/JSGlobalData.h:
814 * kjs/JSGlobalObject.cpp:
815 * kjs/JSGlobalObject.h:
816 * kjs/JSGlobalObjectFunctions.cpp:
817 * kjs/JSGlobalObjectFunctions.h:
818 * kjs/JSImmediate.cpp:
820 * kjs/JSNotAnObject.cpp:
821 * kjs/JSNotAnObject.h:
822 * kjs/JSNumberCell.cpp:
823 * kjs/JSNumberCell.h:
826 * kjs/JSStaticScopeObject.cpp:
827 * kjs/JSStaticScopeObject.h:
831 * kjs/JSVariableObject.h:
832 * kjs/JSWrapperObject.h:
833 * kjs/MathObject.cpp:
834 * kjs/NativeErrorConstructor.cpp:
835 * kjs/NumberConstructor.cpp:
836 * kjs/NumberConstructor.h:
837 * kjs/NumberObject.cpp:
838 * kjs/NumberObject.h:
839 * kjs/NumberPrototype.cpp:
840 * kjs/ObjectConstructor.cpp:
841 * kjs/ObjectPrototype.cpp:
842 * kjs/ObjectPrototype.h:
844 * kjs/PropertySlot.cpp:
845 * kjs/PropertySlot.h:
846 * kjs/RegExpConstructor.cpp:
847 * kjs/RegExpConstructor.h:
848 * kjs/RegExpMatchesArray.h:
849 * kjs/RegExpObject.cpp:
850 * kjs/RegExpObject.h:
851 * kjs/RegExpPrototype.cpp:
853 * kjs/StringConstructor.cpp:
854 * kjs/StringObject.cpp:
855 * kjs/StringObject.h:
856 * kjs/StringObjectThatMasqueradesAsUndefined.h:
857 * kjs/StringPrototype.cpp:
858 * kjs/StructureID.cpp:
864 * kjs/interpreter.cpp:
869 * kjs/operations.cpp:
872 * profiler/ProfileGenerator.cpp:
873 Replace JSValue* with JSValuePtr.
875 2008-10-18 Darin Adler <darin@apple.com>
878 (JSC::Machine::cti_op_call_eval): Removed stray parentheses from my
881 2008-10-18 Darin Adler <darin@apple.com>
883 Reviewed by Oliver Hunt.
885 - first step of https://bugs.webkit.org/show_bug.cgi?id=21732
886 improve performance by eliminating JSValue as a base class for JSCell
888 Remove casts from JSValue* to derived classes, replacing them with
889 calls to inline casting functions. These functions are also a bit
890 better than aidrect cast because they also do a runtime assertion.
892 Removed use of 0 as for JSValue*, changing call sites to use a
893 noValue() function instead.
895 Move things needed by classes derived from JSValue out of the class,
896 since the classes won't be deriving from JSValue any more soon.
898 I did most of these changes by changing JSValue to not be JSValue* any
899 more, then fixing a lot of the compilation problems, then rolling out
902 1.011x as fast on SunSpider (presumably due to some of the Machine.cpp changes)
904 * API/APICast.h: Removed unneeded forward declarations.
906 * API/JSCallbackObject.h: Added an asCallbackObject function for casting.
907 * API/JSCallbackObjectFunctions.h:
908 (JSC::JSCallbackObject::asCallbackObject): Added.
909 (JSC::JSCallbackObject::getOwnPropertySlot): Use asObject.
910 (JSC::JSCallbackObject::call): Use noValue.
911 (JSC::JSCallbackObject::staticValueGetter): Use asCallbackObject.
912 (JSC::JSCallbackObject::staticFunctionGetter): Ditto.
913 (JSC::JSCallbackObject::callbackGetter): Ditto.
915 * JavaScriptCore.exp: Updated.
917 * JavaScriptCore.xcodeproj/project.pbxproj: Added RegExpMatchesArray.h.
920 (JSC::CTI::asInteger): Added. For use casting a JSValue to an integer.
921 (JSC::CTI::emitGetArg): Use asInteger.
922 (JSC::CTI::emitGetPutArg): Ditto.
923 (JSC::CTI::getConstantImmediateNumericArg): Ditto. Also use noValue.
924 (JSC::CTI::emitInitRegister): Use asInteger.
925 (JSC::CTI::getDeTaggedConstantImmediate): Ditto.
926 (JSC::CTI::compileOpCallInitializeCallFrame): Ditto.
927 (JSC::CTI::compileOpCall): Ditto.
928 (JSC::CTI::compileOpStrictEq): Ditto.
929 (JSC::CTI::privateCompileMainPass): Ditto.
930 (JSC::CTI::privateCompileGetByIdProto): Ditto.
931 (JSC::CTI::privateCompileGetByIdChain): Ditto.
932 (JSC::CTI::privateCompilePutByIdTransition): Ditto.
933 * VM/CTI.h: Rewrite the ARG-related macros to use C++ casts instead of
934 C casts and get rid of some extra parentheses. Addd declaration of
937 * VM/CodeGenerator.cpp:
938 (JSC::CodeGenerator::emitEqualityOp): Use asString.
939 (JSC::CodeGenerator::emitLoad): Use noValue.
940 (JSC::CodeGenerator::findScopedProperty): Change globalObject argument
941 to JSObject* instead of JSValue*.
942 (JSC::CodeGenerator::emitResolve): Remove unneeded cast.
943 (JSC::CodeGenerator::emitGetScopedVar): Use asCell.
944 (JSC::CodeGenerator::emitPutScopedVar): Ditto.
945 * VM/CodeGenerator.h: Changed out argument of findScopedProperty.
946 Also change the JSValueMap to use PtrHash explicitly instead of
947 getting it from DefaultHash.
949 * VM/JSPropertyNameIterator.cpp:
950 (JSC::JSPropertyNameIterator::toPrimitive): Use noValue.
951 * VM/JSPropertyNameIterator.h:
952 (JSC::JSPropertyNameIterator::next): Ditto.
955 (JSC::fastIsNumber): Moved isImmediate check here instead of
956 checking for 0 inside Heap::isNumber. Use asCell and asNumberCell.
957 (JSC::fastToInt32): Ditto.
958 (JSC::fastToUInt32): Ditto.
959 (JSC::jsLess): Use asString.
960 (JSC::jsLessEq): Ditto.
962 (JSC::jsTypeStringForValue): Use asObject.
963 (JSC::jsIsObjectType): Ditto.
964 (JSC::jsIsFunctionType): Ditto.
965 (JSC::inlineResolveBase): Use noValue.
966 (JSC::Machine::callEval): Use asString. Initialize result to
968 (JSC::Machine::Machine): Remove unneeded casts to JSCell*.
969 (JSC::Machine::throwException): Use asObject.
970 (JSC::Machine::debug): Remove explicit calls to the DebuggerCallFrame
972 (JSC::Machine::checkTimeout): Use noValue.
973 (JSC::cachePrototypeChain): Use asObject.
974 (JSC::Machine::tryCachePutByID): Use asCell.
975 (JSC::Machine::tryCacheGetByID): Use aCell and asObject.
976 (JSC::Machine::privateExecute): Use noValue, asCell, asObject, asString,
977 asArray, asActivation, asFunction. Changed code that creates call frames
978 for host functions to pass 0 for the function pointer -- the call frame
979 needs a JSFunction* and a host function object is not one. This was
980 caught by the assertions in the casting functions. Also remove some
981 unneeded casts in cases where two values are compared.
982 (JSC::Machine::retrieveLastCaller): Use noValue.
983 (JSC::Machine::tryCTICachePutByID): Use asCell.
984 (JSC::Machine::tryCTICacheGetByID): Use aCell and asObject.
985 (JSC::setUpThrowTrampolineReturnAddress): Added this function to restore
986 the PIC-branch-avoidance that was recently lost.
987 (JSC::Machine::cti_op_add): Use asString.
988 (JSC::Machine::cti_op_instanceof): Use asCell and asObject.
989 (JSC::Machine::cti_op_call_JSFunction): Use asFunction.
990 (JSC::Machine::cti_op_call_NotJSFunction): Changed code to pass 0 for
991 the function pointer, since we don't have a JSFunction. Use asObject.
992 (JSC::Machine::cti_op_tear_off_activation): Use asActivation.
993 (JSC::Machine::cti_op_construct_JSConstruct): Use asFunction and asObject.
994 (JSC::Machine::cti_op_construct_NotJSConstruct): use asObject.
995 (JSC::Machine::cti_op_get_by_val): Use asArray and asString.
996 (JSC::Machine::cti_op_resolve_func): Use asPointer; this helps prepare
997 us for a situation where JSValue is not a pointer.
998 (JSC::Machine::cti_op_put_by_val): Use asArray.
999 (JSC::Machine::cti_op_put_by_val_array): Ditto.
1000 (JSC::Machine::cti_op_resolve_global): Use asGlobalObject.
1001 (JSC::Machine::cti_op_post_inc): Change VM_CHECK_EXCEPTION_2 to
1002 VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
1003 that point. Also use asPointer.
1004 (JSC::Machine::cti_op_resolve_with_base): Use asPointer.
1005 (JSC::Machine::cti_op_post_dec): Change VM_CHECK_EXCEPTION_2 to
1006 VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
1007 that point. Also use asPointer.
1008 (JSC::Machine::cti_op_call_eval): Use asObject, noValue, and change
1009 VM_CHECK_EXCEPTION_ARG to VM_THROW_EXCEPTION_AT_END.
1010 (JSC::Machine::cti_op_throw): Change return value to a JSValue*.
1011 (JSC::Machine::cti_op_in): Use asObject.
1012 (JSC::Machine::cti_op_switch_char): Use asString.
1013 (JSC::Machine::cti_op_switch_string): Ditto.
1014 (JSC::Machine::cti_op_put_getter): Use asObject.
1015 (JSC::Machine::cti_op_put_setter): Ditto.
1016 (JSC::Machine::cti_vm_throw): Change return value to a JSValue*.
1018 * VM/Machine.h: Change return values of both cti_op_throw and
1019 cti_vm_throw to JSValue*.
1021 * VM/Register.h: Remove nullJSValue, which is the same thing
1022 as noValue(). Also removed unneeded definition of JSValue.
1024 * kjs/ArgList.h: Removed unneeded definition of JSValue.
1027 (JSC::asArguments): Added.
1029 * kjs/ArrayPrototype.cpp:
1030 (JSC::getProperty): Use noValue.
1031 (JSC::arrayProtoFuncToString): Use asArray.
1032 (JSC::arrayProtoFuncToLocaleString): Ditto.
1033 (JSC::arrayProtoFuncConcat): Ditto.
1034 (JSC::arrayProtoFuncPop): Ditto. Also removed unneeded initialization
1035 of the result, which is set in both sides of the branch.
1036 (JSC::arrayProtoFuncPush): Ditto.
1037 (JSC::arrayProtoFuncShift): Removed unneeded initialization
1038 of the result, which is set in both sides of the branch.
1039 (JSC::arrayProtoFuncSort): Use asArray.
1041 * kjs/BooleanObject.h:
1042 (JSC::asBooleanObject): Added.
1044 * kjs/BooleanPrototype.cpp:
1045 (JSC::booleanProtoFuncToString): Use asBooleanObject.
1046 (JSC::booleanProtoFuncValueOf): Ditto.
1049 (JSC::call): Use asObject and asFunction.
1050 * kjs/ConstructData.cpp:
1051 (JSC::construct): Ditto.
1053 * kjs/DateConstructor.cpp:
1054 (JSC::constructDate): Use asDateInstance.
1056 * kjs/DateInstance.h:
1057 (JSC::asDateInstance): Added.
1059 * kjs/DatePrototype.cpp:
1060 (JSC::dateProtoFuncToString): Use asDateInstance.
1061 (JSC::dateProtoFuncToUTCString): Ditto.
1062 (JSC::dateProtoFuncToDateString): Ditto.
1063 (JSC::dateProtoFuncToTimeString): Ditto.
1064 (JSC::dateProtoFuncToLocaleString): Ditto.
1065 (JSC::dateProtoFuncToLocaleDateString): Ditto.
1066 (JSC::dateProtoFuncToLocaleTimeString): Ditto.
1067 (JSC::dateProtoFuncValueOf): Ditto.
1068 (JSC::dateProtoFuncGetTime): Ditto.
1069 (JSC::dateProtoFuncGetFullYear): Ditto.
1070 (JSC::dateProtoFuncGetUTCFullYear): Ditto.
1071 (JSC::dateProtoFuncToGMTString): Ditto.
1072 (JSC::dateProtoFuncGetMonth): Ditto.
1073 (JSC::dateProtoFuncGetUTCMonth): Ditto.
1074 (JSC::dateProtoFuncGetDate): Ditto.
1075 (JSC::dateProtoFuncGetUTCDate): Ditto.
1076 (JSC::dateProtoFuncGetDay): Ditto.
1077 (JSC::dateProtoFuncGetUTCDay): Ditto.
1078 (JSC::dateProtoFuncGetHours): Ditto.
1079 (JSC::dateProtoFuncGetUTCHours): Ditto.
1080 (JSC::dateProtoFuncGetMinutes): Ditto.
1081 (JSC::dateProtoFuncGetUTCMinutes): Ditto.
1082 (JSC::dateProtoFuncGetSeconds): Ditto.
1083 (JSC::dateProtoFuncGetUTCSeconds): Ditto.
1084 (JSC::dateProtoFuncGetMilliSeconds): Ditto.
1085 (JSC::dateProtoFuncGetUTCMilliseconds): Ditto.
1086 (JSC::dateProtoFuncGetTimezoneOffset): Ditto.
1087 (JSC::dateProtoFuncSetTime): Ditto.
1088 (JSC::setNewValueFromTimeArgs): Ditto.
1089 (JSC::setNewValueFromDateArgs): Ditto.
1090 (JSC::dateProtoFuncSetYear): Ditto.
1091 (JSC::dateProtoFuncGetYear): Ditto.
1093 * kjs/DebuggerCallFrame.cpp:
1094 (JSC::DebuggerCallFrame::thisObject): Use asObject.
1095 (JSC::DebuggerCallFrame::evaluate): Use noValue.
1096 * kjs/DebuggerCallFrame.h: Added a constructor that
1097 takes only a callFrame.
1100 (JSC::ExecState::clearException): Use noValue.
1102 * kjs/FunctionPrototype.cpp:
1103 (JSC::functionProtoFuncToString): Use asFunction.
1104 (JSC::functionProtoFuncApply): Use asArguments and asArray.
1106 * kjs/GetterSetter.cpp:
1107 (JSC::GetterSetter::getPrimitiveNumber): Use noValue.
1109 * kjs/GetterSetter.h:
1110 (JSC::asGetterSetter): Added.
1112 * kjs/InternalFunction.cpp:
1113 (JSC::InternalFunction::name): Use asString.
1115 * kjs/InternalFunction.h:
1116 (JSC::asInternalFunction): Added.
1118 * kjs/JSActivation.cpp:
1119 (JSC::JSActivation::argumentsGetter): Use asActivation.
1121 * kjs/JSActivation.h:
1122 (JSC::asActivation): Added.
1125 (JSC::JSArray::putSlowCase): Use noValue.
1126 (JSC::JSArray::deleteProperty): Ditto.
1127 (JSC::JSArray::increaseVectorLength): Ditto.
1128 (JSC::JSArray::setLength): Ditto.
1129 (JSC::JSArray::pop): Ditto.
1130 (JSC::JSArray::sort): Ditto.
1131 (JSC::JSArray::compactForSorting): Ditto.
1133 (JSC::asArray): Added.
1136 (JSC::JSCell::getJSNumber): Use noValue.
1139 (JSC::asCell): Added.
1140 (JSC::JSValue::asCell): Changed to not preserve const.
1141 Given the wide use of JSValue* and JSCell*, it's not
1142 really useful to use const.
1143 (JSC::JSValue::isNumber): Use asValue.
1144 (JSC::JSValue::isString): Ditto.
1145 (JSC::JSValue::isGetterSetter): Ditto.
1146 (JSC::JSValue::isObject): Ditto.
1147 (JSC::JSValue::getNumber): Ditto.
1148 (JSC::JSValue::getString): Ditto.
1149 (JSC::JSValue::getObject): Ditto.
1150 (JSC::JSValue::getCallData): Ditto.
1151 (JSC::JSValue::getConstructData): Ditto.
1152 (JSC::JSValue::getUInt32): Ditto.
1153 (JSC::JSValue::getTruncatedInt32): Ditto.
1154 (JSC::JSValue::getTruncatedUInt32): Ditto.
1155 (JSC::JSValue::mark): Ditto.
1156 (JSC::JSValue::marked): Ditto.
1157 (JSC::JSValue::toPrimitive): Ditto.
1158 (JSC::JSValue::getPrimitiveNumber): Ditto.
1159 (JSC::JSValue::toBoolean): Ditto.
1160 (JSC::JSValue::toNumber): Ditto.
1161 (JSC::JSValue::toString): Ditto.
1162 (JSC::JSValue::toObject): Ditto.
1163 (JSC::JSValue::toThisObject): Ditto.
1164 (JSC::JSValue::needsThisConversion): Ditto.
1165 (JSC::JSValue::toThisString): Ditto.
1166 (JSC::JSValue::getJSNumber): Ditto.
1168 * kjs/JSFunction.cpp:
1169 (JSC::JSFunction::argumentsGetter): Use asFunction.
1170 (JSC::JSFunction::callerGetter): Ditto.
1171 (JSC::JSFunction::lengthGetter): Ditto.
1172 (JSC::JSFunction::construct): Use asObject.
1175 (JSC::asFunction): Added.
1177 * kjs/JSGlobalObject.cpp:
1178 (JSC::lastInPrototypeChain): Use asObject.
1180 * kjs/JSGlobalObject.h:
1181 (JSC::asGlobalObject): Added.
1182 (JSC::ScopeChainNode::globalObject): Use asGlobalObject.
1184 * kjs/JSImmediate.h: Added noValue, asPointer, and makeValue
1185 functions. Use rawValue, makeValue, and noValue consistently
1186 instead of doing reinterpret_cast in various functions.
1188 * kjs/JSNumberCell.h:
1189 (JSC::asNumberCell): Added.
1190 (JSC::JSValue::uncheckedGetNumber): Use asValue and asNumberCell.
1191 (JSC::JSValue::toJSNumber): Use asValue.
1194 (JSC::JSObject::put): Use asObject and asGetterSetter.
1195 (JSC::callDefaultValueFunction): Use noValue.
1196 (JSC::JSObject::defineGetter): Use asGetterSetter.
1197 (JSC::JSObject::defineSetter): Ditto.
1198 (JSC::JSObject::lookupGetter): Ditto. Also use asObject.
1199 (JSC::JSObject::lookupSetter): Ditto.
1200 (JSC::JSObject::hasInstance): Use asObject.
1201 (JSC::JSObject::fillGetterPropertySlot): Use asGetterSetter.
1204 (JSC::JSObject::getDirect): Use noValue.
1205 (JSC::asObject): Added.
1206 (JSC::JSValue::isObject): Use asValue.
1207 (JSC::JSObject::get): Removed unneeded const_cast.
1208 (JSC::JSObject::getPropertySlot): Use asObject.
1209 (JSC::JSValue::get): Removed unneeded const_cast.
1210 Use asValue, asCell, and asObject.
1211 (JSC::JSValue::put): Ditto.
1212 (JSC::JSObject::allocatePropertyStorageInline): Fixed spelling
1213 of "oldPropertStorage".
1216 (JSC::JSString::getOwnPropertySlot): Use asObject.
1219 (JSC::asString): Added.
1220 (JSC::JSValue::toThisJSString): Use asValue.
1222 * kjs/JSValue.h: Make PreferredPrimitiveType a top level enum
1223 instead of a member of JSValue. Added an asValue function that
1224 returns this. Removed overload of asCell for const. Use asValue
1225 instead of getting right at this.
1227 * kjs/ObjectPrototype.cpp:
1228 (JSC::objectProtoFuncIsPrototypeOf): Use asObject.
1229 (JSC::objectProtoFuncDefineGetter): Ditto.
1230 (JSC::objectProtoFuncDefineSetter): Ditto.
1232 * kjs/PropertySlot.h:
1233 (JSC::PropertySlot::PropertySlot): Take a const JSValue* so the
1234 callers don't have to worry about const.
1235 (JSC::PropertySlot::clearBase): Use noValue.
1236 (JSC::PropertySlot::clearValue): Ditto.
1238 * kjs/RegExpConstructor.cpp:
1239 (JSC::regExpConstructorDollar1): Use asRegExpConstructor.
1240 (JSC::regExpConstructorDollar2): Ditto.
1241 (JSC::regExpConstructorDollar3): Ditto.
1242 (JSC::regExpConstructorDollar4): Ditto.
1243 (JSC::regExpConstructorDollar5): Ditto.
1244 (JSC::regExpConstructorDollar6): Ditto.
1245 (JSC::regExpConstructorDollar7): Ditto.
1246 (JSC::regExpConstructorDollar8): Ditto.
1247 (JSC::regExpConstructorDollar9): Ditto.
1248 (JSC::regExpConstructorInput): Ditto.
1249 (JSC::regExpConstructorMultiline): Ditto.
1250 (JSC::regExpConstructorLastMatch): Ditto.
1251 (JSC::regExpConstructorLastParen): Ditto.
1252 (JSC::regExpConstructorLeftContext): Ditto.
1253 (JSC::regExpConstructorRightContext): Ditto.
1254 (JSC::setRegExpConstructorInput): Ditto.
1255 (JSC::setRegExpConstructorMultiline): Ditto.
1256 (JSC::constructRegExp): Use asObject.
1258 * kjs/RegExpConstructor.h:
1259 (JSC::asRegExpConstructor): Added.
1261 * kjs/RegExpObject.cpp:
1262 (JSC::regExpObjectGlobal): Use asRegExpObject.
1263 (JSC::regExpObjectIgnoreCase): Ditto.
1264 (JSC::regExpObjectMultiline): Ditto.
1265 (JSC::regExpObjectSource): Ditto.
1266 (JSC::regExpObjectLastIndex): Ditto.
1267 (JSC::setRegExpObjectLastIndex): Ditto.
1268 (JSC::callRegExpObject): Ditto.
1270 * kjs/RegExpObject.h:
1271 (JSC::asRegExpObject): Added.
1273 * kjs/RegExpPrototype.cpp:
1274 (JSC::regExpProtoFuncTest): Use asRegExpObject.
1275 (JSC::regExpProtoFuncExec): Ditto.
1276 (JSC::regExpProtoFuncCompile): Ditto.
1277 (JSC::regExpProtoFuncToString): Ditto.
1279 * kjs/StringObject.h:
1280 (JSC::StringObject::internalValue): Use asString.
1281 (JSC::asStringObject): Added.
1283 * kjs/StringPrototype.cpp:
1284 (JSC::stringProtoFuncReplace): Use asRegExpObject.
1285 (JSC::stringProtoFuncToString): Ue asStringObject.
1286 (JSC::stringProtoFuncMatch): Use asRegExpObject.
1287 (JSC::stringProtoFuncSearch): Ditto.
1288 (JSC::stringProtoFuncSplit): Ditto.
1290 * kjs/StructureID.cpp:
1291 (JSC::StructureID::getEnumerablePropertyNames): Use asObject.
1292 (JSC::StructureID::createCachedPrototypeChain): Ditto.
1293 (JSC::StructureIDChain::StructureIDChain): Use asCell and asObject.
1296 (JSC::Heap::isNumber): Removed null handling. This can only be called
1298 (JSC::Heap::cellBlock): Removed overload for const and non-const.
1299 Whether the JSCell* is const or not really should have no effect on
1300 whether you can modify the collector block it's in.
1302 * kjs/interpreter.cpp:
1303 (JSC::Interpreter::evaluate): Use noValue and noObject.
1306 (JSC::FunctionCallResolveNode::emitCode): Use JSObject for the global
1307 object rather than JSValue.
1308 (JSC::PostfixResolveNode::emitCode): Ditto.
1309 (JSC::PrefixResolveNode::emitCode): Ditto.
1310 (JSC::ReadModifyResolveNode::emitCode): Ditto.
1311 (JSC::AssignResolveNode::emitCode): Ditto.
1314 (JSC::equalSlowCaseInline): Use asString, asCell, asNumberCell,
1315 (JSC::strictEqualSlowCaseInline): Ditto.
1317 2008-10-18 Cameron Zwarich <zwarich@apple.com>
1319 Reviewed by Oliver Hunt.
1321 Bug 21702: Special op_create_activation for the case where there are no named parameters
1322 <https://bugs.webkit.org/show_bug.cgi?id=21702>
1324 This is a 2.5% speedup on the V8 Raytrace benchmark and a 1.1% speedup
1325 on the V8 Earley-Boyer benchmark.
1328 (JSC::CTI::privateCompileMainPass):
1330 (JSC::Machine::cti_op_create_arguments_no_params):
1334 (JSC::Arguments::Arguments):
1336 2008-10-17 Maciej Stachowiak <mjs@apple.com>
1338 Reviewed by Cameron Zwarich.
1340 - in debug builds, alter the stack to avoid blowing out MallocStackLogging
1342 (In essence, while executing a CTI function we alter the return
1343 address to jscGeneratedNativeCode so that a single consistent
1344 function is on the stack instead of many random functions without
1349 (JSC::doSetReturnAddress):
1351 (JSC::StackHack::StackHack):
1352 (JSC::StackHack::~StackHack):
1353 (JSC::Machine::cti_op_convert_this):
1354 (JSC::Machine::cti_op_end):
1355 (JSC::Machine::cti_op_add):
1356 (JSC::Machine::cti_op_pre_inc):
1357 (JSC::Machine::cti_timeout_check):
1358 (JSC::Machine::cti_register_file_check):
1359 (JSC::Machine::cti_op_loop_if_less):
1360 (JSC::Machine::cti_op_loop_if_lesseq):
1361 (JSC::Machine::cti_op_new_object):
1362 (JSC::Machine::cti_op_put_by_id):
1363 (JSC::Machine::cti_op_put_by_id_second):
1364 (JSC::Machine::cti_op_put_by_id_generic):
1365 (JSC::Machine::cti_op_put_by_id_fail):
1366 (JSC::Machine::cti_op_get_by_id):
1367 (JSC::Machine::cti_op_get_by_id_second):
1368 (JSC::Machine::cti_op_get_by_id_generic):
1369 (JSC::Machine::cti_op_get_by_id_fail):
1370 (JSC::Machine::cti_op_instanceof):
1371 (JSC::Machine::cti_op_del_by_id):
1372 (JSC::Machine::cti_op_mul):
1373 (JSC::Machine::cti_op_new_func):
1374 (JSC::Machine::cti_op_call_profiler):
1375 (JSC::Machine::cti_op_call_JSFunction):
1376 (JSC::Machine::cti_vm_lazyLinkCall):
1377 (JSC::Machine::cti_vm_compile):
1378 (JSC::Machine::cti_op_push_activation):
1379 (JSC::Machine::cti_op_call_NotJSFunction):
1380 (JSC::Machine::cti_op_create_arguments):
1381 (JSC::Machine::cti_op_tear_off_activation):
1382 (JSC::Machine::cti_op_tear_off_arguments):
1383 (JSC::Machine::cti_op_ret_profiler):
1384 (JSC::Machine::cti_op_ret_scopeChain):
1385 (JSC::Machine::cti_op_new_array):
1386 (JSC::Machine::cti_op_resolve):
1387 (JSC::Machine::cti_op_construct_JSConstructFast):
1388 (JSC::Machine::cti_op_construct_JSConstruct):
1389 (JSC::Machine::cti_op_construct_NotJSConstruct):
1390 (JSC::Machine::cti_op_get_by_val):
1391 (JSC::Machine::cti_op_resolve_func):
1392 (JSC::Machine::cti_op_sub):
1393 (JSC::Machine::cti_op_put_by_val):
1394 (JSC::Machine::cti_op_put_by_val_array):
1395 (JSC::Machine::cti_op_lesseq):
1396 (JSC::Machine::cti_op_loop_if_true):
1397 (JSC::Machine::cti_op_negate):
1398 (JSC::Machine::cti_op_resolve_base):
1399 (JSC::Machine::cti_op_resolve_skip):
1400 (JSC::Machine::cti_op_resolve_global):
1401 (JSC::Machine::cti_op_div):
1402 (JSC::Machine::cti_op_pre_dec):
1403 (JSC::Machine::cti_op_jless):
1404 (JSC::Machine::cti_op_not):
1405 (JSC::Machine::cti_op_jtrue):
1406 (JSC::Machine::cti_op_post_inc):
1407 (JSC::Machine::cti_op_eq):
1408 (JSC::Machine::cti_op_lshift):
1409 (JSC::Machine::cti_op_bitand):
1410 (JSC::Machine::cti_op_rshift):
1411 (JSC::Machine::cti_op_bitnot):
1412 (JSC::Machine::cti_op_resolve_with_base):
1413 (JSC::Machine::cti_op_new_func_exp):
1414 (JSC::Machine::cti_op_mod):
1415 (JSC::Machine::cti_op_less):
1416 (JSC::Machine::cti_op_neq):
1417 (JSC::Machine::cti_op_post_dec):
1418 (JSC::Machine::cti_op_urshift):
1419 (JSC::Machine::cti_op_bitxor):
1420 (JSC::Machine::cti_op_new_regexp):
1421 (JSC::Machine::cti_op_bitor):
1422 (JSC::Machine::cti_op_call_eval):
1423 (JSC::Machine::cti_op_throw):
1424 (JSC::Machine::cti_op_get_pnames):
1425 (JSC::Machine::cti_op_next_pname):
1426 (JSC::Machine::cti_op_push_scope):
1427 (JSC::Machine::cti_op_pop_scope):
1428 (JSC::Machine::cti_op_typeof):
1429 (JSC::Machine::cti_op_is_undefined):
1430 (JSC::Machine::cti_op_is_boolean):
1431 (JSC::Machine::cti_op_is_number):
1432 (JSC::Machine::cti_op_is_string):
1433 (JSC::Machine::cti_op_is_object):
1434 (JSC::Machine::cti_op_is_function):
1435 (JSC::Machine::cti_op_stricteq):
1436 (JSC::Machine::cti_op_nstricteq):
1437 (JSC::Machine::cti_op_to_jsnumber):
1438 (JSC::Machine::cti_op_in):
1439 (JSC::Machine::cti_op_push_new_scope):
1440 (JSC::Machine::cti_op_jmp_scopes):
1441 (JSC::Machine::cti_op_put_by_index):
1442 (JSC::Machine::cti_op_switch_imm):
1443 (JSC::Machine::cti_op_switch_char):
1444 (JSC::Machine::cti_op_switch_string):
1445 (JSC::Machine::cti_op_del_by_val):
1446 (JSC::Machine::cti_op_put_getter):
1447 (JSC::Machine::cti_op_put_setter):
1448 (JSC::Machine::cti_op_new_error):
1449 (JSC::Machine::cti_op_debug):
1450 (JSC::Machine::cti_vm_throw):
1452 2008-10-17 Gavin Barraclough <barraclough@apple.com>
1454 Optimize op_call by allowing call sites to be directly linked to callees.
1456 For the hot path of op_call, CTI now generates a check (initially for an impossible
1457 value), and the first time the call is executed we attempt to link the call directly
1458 to the callee. We can currently only do so if the arity of the caller and callee
1459 match. The (optimized) setup for the call on the hot path is linked directly to
1460 the ctiCode for the callee, without indirection.
1462 Two forms of the slow case of the call are generated, the first will be executed the
1463 first time the call is reached. As well as this path attempting to link the call to
1464 a callee, it also relinks the slow case to a second slow case, which will not continue
1465 to attempt relinking the call. (This policy could be changed in future, but for not
1466 this is intended to prevent thrashing).
1468 If a callee that the caller has been linked to is garbage collected, then the link
1469 in the caller's JIt code will be reset back to a value that cannot match - to prevent
1470 any false positive matches.
1472 ~20% progression on deltablue & richards, >12% overall reduction in v8-tests
1473 runtime, one or two percent progression on sunspider.
1475 Reviewed by Oliver Hunt.
1479 (JSC::CTI::emitNakedCall):
1481 (JSC::CTI::compileOpCallInitializeCallFrame):
1482 (JSC::CTI::compileOpCallSetupArgs):
1483 (JSC::CTI::compileOpCall):
1484 (JSC::CTI::privateCompileMainPass):
1485 (JSC::CTI::privateCompileSlowCases):
1486 (JSC::CTI::privateCompile):
1487 (JSC::CTI::unlinkCall):
1488 (JSC::CTI::linkCall):
1491 (JSC::CodeBlock::~CodeBlock):
1492 (JSC::CodeBlock::unlinkCallers):
1493 (JSC::CodeBlock::derefStructureIDs):
1495 (JSC::StructureStubInfo::StructureStubInfo):
1496 (JSC::CallLinkInfo::CallLinkInfo):
1497 (JSC::CodeBlock::addCaller):
1498 (JSC::CodeBlock::removeCaller):
1499 (JSC::CodeBlock::getStubInfo):
1500 * VM/CodeGenerator.cpp:
1501 (JSC::CodeGenerator::emitCall):
1502 (JSC::CodeGenerator::emitConstruct):
1504 (JSC::Machine::cti_op_call_profiler):
1505 (JSC::Machine::cti_op_call_JSFunction):
1506 (JSC::Machine::cti_vm_lazyLinkCall):
1507 (JSC::Machine::cti_op_construct_JSConstructFast):
1508 (JSC::Machine::cti_op_construct_JSConstruct):
1509 (JSC::Machine::cti_op_construct_NotJSConstruct):
1511 * kjs/JSFunction.cpp:
1512 (JSC::JSFunction::~JSFunction):
1515 (JSC::FunctionBodyNode::):
1516 * masm/X86Assembler.h:
1517 (JSC::X86Assembler::getDifferenceBetweenLabels):
1519 2008-10-17 Maciej Stachowiak <mjs@apple.com>
1521 Reviewed by Geoff Garen.
1523 - remove ASSERT that makes the leaks buildbot cry
1525 * kjs/JSFunction.cpp:
1526 (JSC::JSFunction::JSFunction):
1528 2008-10-17 Maciej Stachowiak <mjs@apple.com>
1530 Reviewed by Cameron Zwarich
1532 - don't bother to do arguments tearoff when it will have no effect
1536 * VM/CodeGenerator.cpp:
1537 (JSC::CodeGenerator::emitReturn):
1539 2008-10-17 Marco Barisione <marco.barisione@collabora.co.uk>
1541 Reviewed by Sam Weinig. Landed by Jan Alonzo.
1543 https://bugs.webkit.org/show_bug.cgi?id=21603
1544 [GTK] Minor fixes to GOwnPtr
1551 (WTF::GPatternSpec):
1554 (WTF::freeOwnedGPtr):
1555 (WTF::GOwnPtr::~GOwnPtr):
1556 (WTF::GOwnPtr::outPtr):
1557 (WTF::GOwnPtr::set):
1558 (WTF::GOwnPtr::clear):
1561 2008-10-17 Maciej Stachowiak <mjs@apple.com>
1563 Reviewed by Cameron Zwarich.
1565 - speed up transitions that resize the property storage a fair bit
1567 ~3% speedup on v8 RayTrace benchmark, ~1% on DeltaBlue
1570 (JSC::resizePropertyStorage): renamed from transitionObject, and reduced to just resize
1571 the object's property storage with one inline call.
1572 (JSC::CTI::privateCompilePutByIdTransition): Use a separate function for property storage
1573 resize, but still do all the rest of the work in assembly in that case, and pass the known
1574 compile-time constants of old and new size rather than structureIDs, saving a bunch of
1575 redundant memory access.
1577 (JSC::JSObject::allocatePropertyStorage): Just call the inline version.
1579 (JSC::JSObject::allocatePropertyStorageInline): Inline version of allocatePropertyStorage
1580 * masm/X86Assembler.h:
1581 (JSC::X86Assembler::):
1582 (JSC::X86Assembler::pushl_i32): Add code to assmeble push of a constant; code originally by Cameron Zwarich.
1584 2008-10-17 Cameron Zwarich <zwarich@apple.com>
1586 Reviewed by Maciej Stachowiak.
1588 Remove some C style casts.
1590 * masm/X86Assembler.h:
1591 (JSC::JITCodeBuffer::putIntUnchecked):
1592 (JSC::X86Assembler::link):
1593 (JSC::X86Assembler::linkAbsoluteAddress):
1594 (JSC::X86Assembler::getRelocatedAddress):
1596 2008-10-17 Cameron Zwarich <zwarich@apple.com>
1598 Rubber-stamped by Maciej Stachowiak.
1600 Remove some C style casts.
1603 (JSC::CTI::patchGetByIdSelf):
1604 (JSC::CTI::patchPutByIdReplace):
1606 (JSC::Machine::tryCTICachePutByID):
1607 (JSC::Machine::tryCTICacheGetByID):
1608 (JSC::Machine::cti_op_put_by_id):
1609 (JSC::Machine::cti_op_put_by_id_fail):
1610 (JSC::Machine::cti_op_get_by_id):
1611 (JSC::Machine::cti_op_get_by_id_fail):
1613 2008-10-17 Maciej Stachowiak <mjs@apple.com>
1615 Reviewed by Cameron Zwarich.
1617 - Avoid restoring the caller's 'r' value in op_ret
1618 https://bugs.webkit.org/show_bug.cgi?id=21319
1620 This patch stops writing the call frame at call and return points;
1621 instead it does so immediately before any CTI call.
1623 0.5% speedup or so on the v8 benchmark
1626 (JSC::CTI::emitCTICall):
1627 (JSC::CTI::compileOpCall):
1628 (JSC::CTI::emitSlowScriptCheck):
1629 (JSC::CTI::compileBinaryArithOpSlowCase):
1630 (JSC::CTI::privateCompileMainPass):
1631 (JSC::CTI::privateCompileSlowCases):
1632 (JSC::CTI::privateCompile):
1635 2008-10-17 Cameron Zwarich <zwarich@apple.com>
1637 Reviewed by Sam Weinig.
1639 Make WREC require CTI because it won't actually compile otherwise.
1643 2008-10-16 Maciej Stachowiak <mjs@apple.com>
1645 Reviewed by Geoff Garen.
1647 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
1648 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
1650 This time there is no performance regression; we can avoid having
1651 to use the fastcall calling convention for CTI functions by using
1652 varargs to prevent the compiler from moving things around on the
1655 * Configurations/DebugRelease.xcconfig:
1656 * JavaScriptCore.xcodeproj/project.pbxproj:
1661 2008-10-16 Maciej Stachowiak <mjs@apple.com>
1663 Reviewed by Oliver Hunt.
1665 - fix for REGRESSION: r37631 causing crashes on buildbot
1666 https://bugs.webkit.org/show_bug.cgi?id=21682
1668 * kjs/collector.cpp:
1669 (JSC::Heap::collect): Avoid crashing when a GC occurs while no global objects are live.
1671 2008-10-16 Sam Weinig <sam@webkit.org>
1673 Reviewed by Maciej Stachowiak.
1675 Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
1676 Don't create intermediate StructureIDs for builtin objects
1678 First step in reduce number of StructureIDs created when initializing the
1681 - In order to avoid creating the intermediate StructureIDs use the new putDirectWithoutTransition
1682 and putDirectFunctionWithoutTransition to add properties to JSObjects without transitioning
1683 the StructureID. This patch just implements this strategy for ObjectPrototype but alone
1684 reduces the number of StructureIDs create for about:blank by 10, from 142 to 132.
1686 * kjs/JSGlobalObject.cpp:
1687 (JSC::JSGlobalObject::reset):
1689 (JSC::JSObject::putDirectFunctionWithoutTransition):
1691 (JSC::JSObject::putDirectWithoutTransition):
1692 * kjs/ObjectPrototype.cpp:
1693 (JSC::ObjectPrototype::ObjectPrototype):
1694 * kjs/ObjectPrototype.h:
1695 * kjs/StructureID.cpp:
1696 (JSC::StructureID::addPropertyWithoutTransition):
1697 * kjs/StructureID.h:
1699 2008-10-16 Maciej Stachowiak <mjs@apple.com>
1701 Reviewed by Cameron Zwarich.
1703 - fix for: REGRESSION: over 100 StructureIDs leak loading about:blank (result of fix for bug 21633)
1705 Apparent slight progression (< 0.5%) on v8 benchmarks and SunSpider.
1707 * kjs/StructureID.cpp:
1708 (JSC::StructureID::~StructureID): Don't deref this object's parent's pointer to
1709 itself from the destructor; that doesn't even make sense.
1710 (JSC::StructureID::addPropertyTransition): Don't refer the single transition;
1711 the rule is that parent StructureIDs are ref'd but child ones are not. Refing
1712 the child creates a cycle.
1714 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
1716 Reviewed by Darin Adler.
1718 https://bugs.webkit.org/show_bug.cgi?id=21609
1719 Make MessagePorts protect their peers across heaps
1721 * JavaScriptCore.exp:
1722 * kjs/JSGlobalObject.cpp:
1723 (JSC::JSGlobalObject::markCrossHeapDependentObjects):
1724 * kjs/JSGlobalObject.h:
1725 * kjs/collector.cpp:
1726 (JSC::Heap::collect):
1727 Before GC sweep phase, a function supplied by global object is now called for all global
1728 objects in the heap, making it possible to implement cross-heap dependencies.
1730 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
1732 Reviewed by Darin Adler.
1734 https://bugs.webkit.org/show_bug.cgi?id=21610
1735 run-webkit-threads --threaded crashes in StructureID destructor
1737 * kjs/StructureID.cpp:
1738 (JSC::StructureID::StructureID):
1739 (JSC::StructureID::~StructureID):
1740 Protect access to a static (debug-only) HashSet with a lock.
1742 2008-10-15 Sam Weinig <sam@webkit.org>
1744 Reviewed by Goeffrey Garen.
1746 Add function to dump statistics for StructureIDs.
1748 * kjs/StructureID.cpp:
1749 (JSC::StructureID::dumpStatistics):
1750 (JSC::StructureID::StructureID):
1751 (JSC::StructureID::~StructureID):
1752 * kjs/StructureID.h:
1754 2008-10-15 Cameron Zwarich <zwarich@apple.com>
1756 Reviewed by Maciej Stachowiak.
1758 Bug 21633: Avoid using a HashMap when there is only a single transition
1759 <https://bugs.webkit.org/show_bug.cgi?id=21633>
1761 This is a 0.8% speedup on SunSpider and between a 0.5% and 1.0% speedup
1762 on the V8 benchmark suite, depending on which harness we use. It will
1763 also slightly reduce the memory footprint of a StructureID.
1765 * kjs/StructureID.cpp:
1766 (JSC::StructureID::StructureID):
1767 (JSC::StructureID::~StructureID):
1768 (JSC::StructureID::addPropertyTransition):
1769 * kjs/StructureID.h:
1770 (JSC::StructureID::):
1772 2008-10-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
1774 Reviewed by Geoffrey Garen.
1776 1.40% speedup on SunSpider, 1.44% speedup on V8. (Linux)
1781 (JSC::fastIsNumber): ALWAYS_INLINE modifier added.
1783 2008-10-15 Geoffrey Garen <ggaren@apple.com>
1785 Reviewed by Cameron Zwarich.
1787 Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
1788 Start the debugger without reloading the inspected page
1790 * JavaScriptCore.exp: New symbols.
1791 * JavaScriptCore.xcodeproj/project.pbxproj: New files.
1794 (JSC::EvalCodeCache::get): Updated for tweak to parsing API.
1796 * kjs/CollectorHeapIterator.h: Added. An iterator for the object heap,
1797 which we use to find all the live functions and recompile them.
1799 * kjs/DebuggerCallFrame.cpp:
1800 (JSC::DebuggerCallFrame::evaluate): Updated for tweak to parsing API.
1802 * kjs/FunctionConstructor.cpp:
1803 (JSC::constructFunction): Updated for tweak to parsing API.
1805 * kjs/JSFunction.cpp:
1806 (JSC::JSFunction::JSFunction): Try to validate our SourceCode in debug
1807 builds by ASSERTing that it's syntactically valid. This doesn't catch
1808 all SourceCode bugs, but it catches a lot of them.
1810 * kjs/JSGlobalObjectFunctions.cpp:
1811 (JSC::globalFuncEval): Updated for tweak to parsing API.
1814 (JSC::Parser::parse):
1816 (JSC::Parser::parse): Tweaked the parser to make it possible to parse
1817 without an ExecState, and to allow the client to specify a debugger to
1818 notify (or not) about the source we parse. This allows the inspector
1819 to recompile even though no JavaScript is executing, then notify the
1820 debugger about all source code when it's done.
1823 (prettyPrintScript): Updated for tweak to parsing API.
1825 * kjs/SourceRange.h:
1826 (JSC::SourceCode::isNull): Added to help with ASSERTs.
1828 * kjs/collector.cpp:
1829 (JSC::Heap::heapAllocate):
1831 (JSC::Heap::primaryHeapBegin):
1832 (JSC::Heap::primaryHeapEnd):
1834 (JSC::): Moved a bunch of declarations around to enable compilation of
1835 CollectorHeapIterator.
1837 * kjs/interpreter.cpp:
1838 (JSC::Interpreter::checkSyntax):
1839 (JSC::Interpreter::evaluate): Updated for tweak to parsing API.
1842 (JSC::Lexer::sourceCode): BUG FIX: Calculate SourceCode ranges relative
1843 to the SourceCode range in which we're lexing, otherwise nested functions
1844 that are compiled individually get SourceCode ranges that don't reflect
1848 (JSC::FunctionBodyNode::FunctionBodyNode):
1849 (JSC::FunctionBodyNode::finishParsing):
1850 (JSC::FunctionBodyNode::create):
1851 (JSC::FunctionBodyNode::copyParameters):
1853 (JSC::ScopeNode::setSource):
1854 (JSC::FunctionBodyNode::parameterCount): Added some helper functions for
1855 copying one FunctionBodyNode's parameters to another. The recompiler uses
1856 these when calling "finishParsing".
1858 2008-10-15 Joerg Bornemann <joerg.bornemann@trolltech.com>
1860 Reviewed by Darin Adler.
1862 - part of https://bugs.webkit.org/show_bug.cgi?id=20746
1863 Fix compilation on Windows CE.
1865 str(n)icmp, strdup and vsnprintf are not available on Windows CE,
1866 they are called _str(n)icmp, etc. instead
1868 * wtf/StringExtras.h: Added inline function implementations.
1870 2008-10-15 Gabor Loki <loki@inf.u-szeged.hu>
1872 Reviewed by Cameron Zwarich.
1874 <https://bugs.webkit.org/show_bug.cgi?id=20912>
1875 Use simple uint32_t multiplication on op_mul if both operands are
1876 immediate number and they are between zero and 0x7FFF.
1879 (JSC::Machine::privateExecute):
1881 2008-10-09 Darin Fisher <darin@chromium.org>
1883 Reviewed by Sam Weinig.
1885 Make pan scrolling a platform configurable option.
1886 https://bugs.webkit.org/show_bug.cgi?id=21515
1888 * wtf/Platform.h: Add ENABLE_PAN_SCROLLING
1890 2008-10-14 Maciej Stachowiak <mjs@apple.com>
1892 Rubber stamped by Sam Weinig.
1894 - revert r37572 and r37581 for now
1896 Turns out GCC 4.2 is still a (small) regression, we'll have to do
1897 more work to turn it on.
1899 * Configurations/DebugRelease.xcconfig:
1900 * JavaScriptCore.xcodeproj/project.pbxproj:
1904 (JSC::Machine::cti_op_convert_this):
1905 (JSC::Machine::cti_op_end):
1906 (JSC::Machine::cti_op_add):
1907 (JSC::Machine::cti_op_pre_inc):
1908 (JSC::Machine::cti_timeout_check):
1909 (JSC::Machine::cti_register_file_check):
1910 (JSC::Machine::cti_op_loop_if_less):
1911 (JSC::Machine::cti_op_loop_if_lesseq):
1912 (JSC::Machine::cti_op_new_object):
1913 (JSC::Machine::cti_op_put_by_id):
1914 (JSC::Machine::cti_op_put_by_id_second):
1915 (JSC::Machine::cti_op_put_by_id_generic):
1916 (JSC::Machine::cti_op_put_by_id_fail):
1917 (JSC::Machine::cti_op_get_by_id):
1918 (JSC::Machine::cti_op_get_by_id_second):
1919 (JSC::Machine::cti_op_get_by_id_generic):
1920 (JSC::Machine::cti_op_get_by_id_fail):
1921 (JSC::Machine::cti_op_instanceof):
1922 (JSC::Machine::cti_op_del_by_id):
1923 (JSC::Machine::cti_op_mul):
1924 (JSC::Machine::cti_op_new_func):
1925 (JSC::Machine::cti_op_call_JSFunction):
1926 (JSC::Machine::cti_vm_compile):
1927 (JSC::Machine::cti_op_push_activation):
1928 (JSC::Machine::cti_op_call_NotJSFunction):
1929 (JSC::Machine::cti_op_create_arguments):
1930 (JSC::Machine::cti_op_tear_off_activation):
1931 (JSC::Machine::cti_op_tear_off_arguments):
1932 (JSC::Machine::cti_op_ret_profiler):
1933 (JSC::Machine::cti_op_ret_scopeChain):
1934 (JSC::Machine::cti_op_new_array):
1935 (JSC::Machine::cti_op_resolve):
1936 (JSC::Machine::cti_op_construct_JSConstruct):
1937 (JSC::Machine::cti_op_construct_NotJSConstruct):
1938 (JSC::Machine::cti_op_get_by_val):
1939 (JSC::Machine::cti_op_resolve_func):
1940 (JSC::Machine::cti_op_sub):
1941 (JSC::Machine::cti_op_put_by_val):
1942 (JSC::Machine::cti_op_put_by_val_array):
1943 (JSC::Machine::cti_op_lesseq):
1944 (JSC::Machine::cti_op_loop_if_true):
1945 (JSC::Machine::cti_op_negate):
1946 (JSC::Machine::cti_op_resolve_base):
1947 (JSC::Machine::cti_op_resolve_skip):
1948 (JSC::Machine::cti_op_resolve_global):
1949 (JSC::Machine::cti_op_div):
1950 (JSC::Machine::cti_op_pre_dec):
1951 (JSC::Machine::cti_op_jless):
1952 (JSC::Machine::cti_op_not):
1953 (JSC::Machine::cti_op_jtrue):
1954 (JSC::Machine::cti_op_post_inc):
1955 (JSC::Machine::cti_op_eq):
1956 (JSC::Machine::cti_op_lshift):
1957 (JSC::Machine::cti_op_bitand):
1958 (JSC::Machine::cti_op_rshift):
1959 (JSC::Machine::cti_op_bitnot):
1960 (JSC::Machine::cti_op_resolve_with_base):
1961 (JSC::Machine::cti_op_new_func_exp):
1962 (JSC::Machine::cti_op_mod):
1963 (JSC::Machine::cti_op_less):
1964 (JSC::Machine::cti_op_neq):
1965 (JSC::Machine::cti_op_post_dec):
1966 (JSC::Machine::cti_op_urshift):
1967 (JSC::Machine::cti_op_bitxor):
1968 (JSC::Machine::cti_op_new_regexp):
1969 (JSC::Machine::cti_op_bitor):
1970 (JSC::Machine::cti_op_call_eval):
1971 (JSC::Machine::cti_op_throw):
1972 (JSC::Machine::cti_op_get_pnames):
1973 (JSC::Machine::cti_op_next_pname):
1974 (JSC::Machine::cti_op_push_scope):
1975 (JSC::Machine::cti_op_pop_scope):
1976 (JSC::Machine::cti_op_typeof):
1977 (JSC::Machine::cti_op_is_undefined):
1978 (JSC::Machine::cti_op_is_boolean):
1979 (JSC::Machine::cti_op_is_number):
1980 (JSC::Machine::cti_op_is_string):
1981 (JSC::Machine::cti_op_is_object):
1982 (JSC::Machine::cti_op_is_function):
1983 (JSC::Machine::cti_op_stricteq):
1984 (JSC::Machine::cti_op_nstricteq):
1985 (JSC::Machine::cti_op_to_jsnumber):
1986 (JSC::Machine::cti_op_in):
1987 (JSC::Machine::cti_op_push_new_scope):
1988 (JSC::Machine::cti_op_jmp_scopes):
1989 (JSC::Machine::cti_op_put_by_index):
1990 (JSC::Machine::cti_op_switch_imm):
1991 (JSC::Machine::cti_op_switch_char):
1992 (JSC::Machine::cti_op_switch_string):
1993 (JSC::Machine::cti_op_del_by_val):
1994 (JSC::Machine::cti_op_put_getter):
1995 (JSC::Machine::cti_op_put_setter):
1996 (JSC::Machine::cti_op_new_error):
1997 (JSC::Machine::cti_op_debug):
1998 (JSC::Machine::cti_vm_throw):
2000 * masm/X86Assembler.h:
2001 (JSC::X86Assembler::emitRestoreArgumentReference):
2002 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
2005 2008-10-14 Alexey Proskuryakov <ap@webkit.org>
2007 Reviewed by Darin Adler.
2009 https://bugs.webkit.org/show_bug.cgi?id=20256
2010 Array.push and other standard methods disappear
2012 * kjs/JSGlobalData.cpp:
2013 (JSC::JSGlobalData::JSGlobalData):
2014 (JSC::JSGlobalData::~JSGlobalData):
2015 Don't use static hash tables even on platforms that don't enable JSC_MULTIPLE_THREADS -
2016 these tables reference IdentifierTable, which is always per-GlobalData.
2018 2008-10-14 Maciej Stachowiak <mjs@apple.com>
2020 Reviewed by Cameron Zwarich.
2022 - always use CTI_ARGUMENTS and CTI_ARGUMENTS_FASTCALL
2024 This is a small regression for GCC 4.0, but simplifies the code
2025 for future improvements and lets us focus on GCC 4.2+ and MSVC.
2030 (JSC::Machine::cti_op_convert_this):
2031 (JSC::Machine::cti_op_end):
2032 (JSC::Machine::cti_op_add):
2033 (JSC::Machine::cti_op_pre_inc):
2034 (JSC::Machine::cti_timeout_check):
2035 (JSC::Machine::cti_register_file_check):
2036 (JSC::Machine::cti_op_loop_if_less):
2037 (JSC::Machine::cti_op_loop_if_lesseq):
2038 (JSC::Machine::cti_op_new_object):
2039 (JSC::Machine::cti_op_put_by_id):
2040 (JSC::Machine::cti_op_put_by_id_second):
2041 (JSC::Machine::cti_op_put_by_id_generic):
2042 (JSC::Machine::cti_op_put_by_id_fail):
2043 (JSC::Machine::cti_op_get_by_id):
2044 (JSC::Machine::cti_op_get_by_id_second):
2045 (JSC::Machine::cti_op_get_by_id_generic):
2046 (JSC::Machine::cti_op_get_by_id_fail):
2047 (JSC::Machine::cti_op_instanceof):
2048 (JSC::Machine::cti_op_del_by_id):
2049 (JSC::Machine::cti_op_mul):
2050 (JSC::Machine::cti_op_new_func):
2051 (JSC::Machine::cti_op_call_JSFunction):
2052 (JSC::Machine::cti_vm_compile):
2053 (JSC::Machine::cti_op_push_activation):
2054 (JSC::Machine::cti_op_call_NotJSFunction):
2055 (JSC::Machine::cti_op_create_arguments):
2056 (JSC::Machine::cti_op_tear_off_activation):
2057 (JSC::Machine::cti_op_tear_off_arguments):
2058 (JSC::Machine::cti_op_ret_profiler):
2059 (JSC::Machine::cti_op_ret_scopeChain):
2060 (JSC::Machine::cti_op_new_array):
2061 (JSC::Machine::cti_op_resolve):
2062 (JSC::Machine::cti_op_construct_JSConstruct):
2063 (JSC::Machine::cti_op_construct_NotJSConstruct):
2064 (JSC::Machine::cti_op_get_by_val):
2065 (JSC::Machine::cti_op_resolve_func):
2066 (JSC::Machine::cti_op_sub):
2067 (JSC::Machine::cti_op_put_by_val):
2068 (JSC::Machine::cti_op_put_by_val_array):
2069 (JSC::Machine::cti_op_lesseq):
2070 (JSC::Machine::cti_op_loop_if_true):
2071 (JSC::Machine::cti_op_negate):
2072 (JSC::Machine::cti_op_resolve_base):
2073 (JSC::Machine::cti_op_resolve_skip):
2074 (JSC::Machine::cti_op_resolve_global):
2075 (JSC::Machine::cti_op_div):
2076 (JSC::Machine::cti_op_pre_dec):
2077 (JSC::Machine::cti_op_jless):
2078 (JSC::Machine::cti_op_not):
2079 (JSC::Machine::cti_op_jtrue):
2080 (JSC::Machine::cti_op_post_inc):
2081 (JSC::Machine::cti_op_eq):
2082 (JSC::Machine::cti_op_lshift):
2083 (JSC::Machine::cti_op_bitand):
2084 (JSC::Machine::cti_op_rshift):
2085 (JSC::Machine::cti_op_bitnot):
2086 (JSC::Machine::cti_op_resolve_with_base):
2087 (JSC::Machine::cti_op_new_func_exp):
2088 (JSC::Machine::cti_op_mod):
2089 (JSC::Machine::cti_op_less):
2090 (JSC::Machine::cti_op_neq):
2091 (JSC::Machine::cti_op_post_dec):
2092 (JSC::Machine::cti_op_urshift):
2093 (JSC::Machine::cti_op_bitxor):
2094 (JSC::Machine::cti_op_new_regexp):
2095 (JSC::Machine::cti_op_bitor):
2096 (JSC::Machine::cti_op_call_eval):
2097 (JSC::Machine::cti_op_throw):
2098 (JSC::Machine::cti_op_get_pnames):
2099 (JSC::Machine::cti_op_next_pname):
2100 (JSC::Machine::cti_op_push_scope):
2101 (JSC::Machine::cti_op_pop_scope):
2102 (JSC::Machine::cti_op_typeof):
2103 (JSC::Machine::cti_op_is_undefined):
2104 (JSC::Machine::cti_op_is_boolean):
2105 (JSC::Machine::cti_op_is_number):
2106 (JSC::Machine::cti_op_is_string):
2107 (JSC::Machine::cti_op_is_object):
2108 (JSC::Machine::cti_op_is_function):
2109 (JSC::Machine::cti_op_stricteq):
2110 (JSC::Machine::cti_op_nstricteq):
2111 (JSC::Machine::cti_op_to_jsnumber):
2112 (JSC::Machine::cti_op_in):
2113 (JSC::Machine::cti_op_push_new_scope):
2114 (JSC::Machine::cti_op_jmp_scopes):
2115 (JSC::Machine::cti_op_put_by_index):
2116 (JSC::Machine::cti_op_switch_imm):
2117 (JSC::Machine::cti_op_switch_char):
2118 (JSC::Machine::cti_op_switch_string):
2119 (JSC::Machine::cti_op_del_by_val):
2120 (JSC::Machine::cti_op_put_getter):
2121 (JSC::Machine::cti_op_put_setter):
2122 (JSC::Machine::cti_op_new_error):
2123 (JSC::Machine::cti_op_debug):
2124 (JSC::Machine::cti_vm_throw):
2126 * masm/X86Assembler.h:
2127 (JSC::X86Assembler::emitRestoreArgumentReference):
2128 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
2131 2008-10-13 Maciej Stachowiak <mjs@apple.com>
2133 Reviewed by Cameron Zwarich.
2135 - make Machine::getArgumentsData an Arguments method and inline it
2141 (JSC::Machine::getArgumentsData):
2143 2008-10-13 Alp Toker <alp@nuanti.com>
2145 Fix autotools dist build target by listing recently added header
2146 files only. Not reviewed.
2150 2008-10-13 Maciej Stachowiak <mjs@apple.com>
2152 Rubber stamped by Mark Rowe.
2154 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
2155 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
2157 * Configurations/DebugRelease.xcconfig:
2158 * JavaScriptCore.xcodeproj/project.pbxproj:
2160 2008-10-13 Cameron Zwarich <zwarich@apple.com>
2162 Reviewed by Geoff Garen.
2164 Bug 21541: Move RegisterFile growth check to callee
2165 <https://bugs.webkit.org/show_bug.cgi?id=21541>
2167 Move the RegisterFile growth check to the callee in the common case,
2168 where some of the information is known statically at JIT time. There is
2169 still a check in the caller in the case where the caller provides too
2172 This is a 2.1% speedup on the V8 benchmark, including a 5.1% speedup on
2173 the Richards benchmark, a 4.1% speedup on the DeltaBlue benchmark, and a
2174 1.4% speedup on the Earley-Boyer benchmark. It is also a 0.5% speedup on
2178 (JSC::CTI::privateCompile):
2180 (JSC::Machine::cti_register_file_check):
2181 (JSC::Machine::cti_op_call_JSFunction):
2182 (JSC::Machine::cti_op_construct_JSConstruct):
2184 * VM/RegisterFile.h:
2185 * masm/X86Assembler.h:
2186 (JSC::X86Assembler::):
2187 (JSC::X86Assembler::cmpl_mr):
2188 (JSC::X86Assembler::emitUnlinkedJg):
2190 2008-10-13 Sam Weinig <sam@webkit.org>
2192 Reviewed by Dan Bernstein.
2194 Fix for https://bugs.webkit.org/show_bug.cgi?id=21577
2195 5 false positive StructureID leaks
2197 - Add leak ignore set to StructureID to selectively ignore leaking some StructureIDs.
2198 - Add create method to JSGlolalData to be used when the data will be intentionally
2199 leaked and ignore all leaks caused the StructureIDs stored in it.
2201 * JavaScriptCore.exp:
2202 * kjs/JSGlobalData.cpp:
2203 (JSC::JSGlobalData::createLeaked):
2204 * kjs/JSGlobalData.h:
2205 * kjs/StructureID.cpp:
2206 (JSC::StructureID::StructureID):
2207 (JSC::StructureID::~StructureID):
2208 (JSC::StructureID::startIgnoringLeaks):
2209 (JSC::StructureID::stopIgnoringLeaks):
2210 * kjs/StructureID.h:
2212 2008-10-13 Marco Barisione <marco.barisione@collabora.co.uk>
2214 Reviewed by Darin Adler. Landed by Jan Alonzo.
2216 WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?)
2217 http://bugs.webkit.org/show_bug.cgi?id=20483
2219 Add a GOwnPtr smart pointer (similar to OwnPtr) to handle memory
2220 allocated by GLib and start the conversion to use it.
2223 * wtf/GOwnPtr.cpp: Added.
2228 (WTF::GPatternSpec):
2230 * wtf/GOwnPtr.h: Added.
2231 (WTF::freeOwnedPtr):
2232 (WTF::GOwnPtr::GOwnPtr):
2233 (WTF::GOwnPtr::~GOwnPtr):
2234 (WTF::GOwnPtr::get):
2235 (WTF::GOwnPtr::release):
2236 (WTF::GOwnPtr::rawPtr):
2237 (WTF::GOwnPtr::set):
2238 (WTF::GOwnPtr::clear):
2239 (WTF::GOwnPtr::operator*):
2240 (WTF::GOwnPtr::operator->):
2241 (WTF::GOwnPtr::operator!):
2242 (WTF::GOwnPtr::operator UnspecifiedBoolType):
2243 (WTF::GOwnPtr::swap):
2249 * wtf/ThreadingGtk.cpp:
2250 (WTF::Mutex::~Mutex):
2252 (WTF::Mutex::tryLock):
2253 (WTF::Mutex::unlock):
2254 (WTF::ThreadCondition::~ThreadCondition):
2255 (WTF::ThreadCondition::wait):
2256 (WTF::ThreadCondition::timedWait):
2257 (WTF::ThreadCondition::signal):
2258 (WTF::ThreadCondition::broadcast):
2260 2008-10-12 Gabriella Toth <gtoth@inf.u-szeged.hu>
2262 Reviewed by Darin Adler.
2264 - part of https://bugs.webkit.org/show_bug.cgi?id=21055
2265 Bug 21055: not invoked functions
2267 * kjs/nodes.cpp: Deleted a function that is not invoked:
2268 statementListInitializeVariableAccessStack.
2270 2008-10-12 Darin Adler <darin@apple.com>
2272 Reviewed by Sam Weinig.
2274 * wtf/unicode/icu/UnicodeIcu.h: Fixed indentation to match WebKit coding style.
2275 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
2277 2008-10-12 Darin Adler <darin@apple.com>
2279 Reviewed by Sam Weinig.
2281 - https://bugs.webkit.org/show_bug.cgi?id=21556
2282 Bug 21556: non-ASCII digits are allowed in places where only ASCII should be
2284 * wtf/unicode/icu/UnicodeIcu.h: Removed isDigit, digitValue, and isFormatChar.
2285 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
2287 2008-10-12 Anders Carlsson <andersca@apple.com>
2289 Reviewed by Darin Adler.
2291 Make the append method that takes a Vector more strict - it now requires the elements
2292 of the vector to be appended same type as the elements of the Vector they're being appended to.
2294 This would cause problems when dealing with Vectors containing other Vectors.
2299 2008-10-11 Cameron Zwarich <zwarich@apple.com>
2301 Reviewed by Sam Weinig.
2303 Clean up RegExpMatchesArray.h to match our coding style.
2305 * kjs/RegExpMatchesArray.h:
2306 (JSC::RegExpMatchesArray::getOwnPropertySlot):
2307 (JSC::RegExpMatchesArray::put):
2308 (JSC::RegExpMatchesArray::deleteProperty):
2309 (JSC::RegExpMatchesArray::getPropertyNames):
2311 2008-10-11 Cameron Zwarich <zwarich@apple.com>
2313 Reviewed by Sam Weinig.
2315 Bug 21525: 55 StructureID leaks on Wikitravel's main page
2316 <https://bugs.webkit.org/show_bug.cgi?id=21525>
2318 Bug 21533: Simple JavaScript code leaks StructureIDs
2319 <https://bugs.webkit.org/show_bug.cgi?id=21533>
2321 StructureID::getEnumerablePropertyNames() ends up calling back to itself
2322 via JSObject::getPropertyNames(), which causes the PropertyNameArray to
2323 be cached twice. This leads to a memory leak in almost every use of
2324 JSObject::getPropertyNames() on an object. The fix here is based on a
2325 suggestion of Sam Weinig.
2327 This patch also fixes every StructureID leaks that occurs while running
2328 the Mozilla MemBuster test.
2330 * kjs/PropertyNameArray.h:
2331 (JSC::PropertyNameArray::PropertyNameArray):
2332 (JSC::PropertyNameArray::setCacheable):
2333 (JSC::PropertyNameArray::cacheable):
2334 * kjs/StructureID.cpp:
2335 (JSC::StructureID::getEnumerablePropertyNames):
2337 2008-10-10 Oliver Hunt <oliver@apple.com>
2339 Reviewed by Cameron Zwarich.
2341 Use fastcall calling convention on GCC > 4.0
2343 Results in a 2-3% improvement in GCC 4.2 performance, so
2344 that it is no longer a regression vs. GCC 4.0
2350 2008-10-10 Sam Weinig <sam@webkit.org>
2352 Reviewed by Darin Adler.
2354 - Add a workaround for a bug in ceil in Darwin libc.
2355 - Remove old workarounds for JS math functions that are not needed
2358 The math functions are heavily tested by fast/js/math.html.
2360 * kjs/MathObject.cpp:
2361 (JSC::mathProtoFuncAbs): Remove workaround.
2362 (JSC::mathProtoFuncCeil): Ditto.
2363 (JSC::mathProtoFuncFloor): Ditto.
2365 (wtf_ceil): Add ceil workaround for darwin.
2367 2008-10-10 Sam Weinig <sam@webkit.org>
2369 Reviewed by Darin Adler
2371 Add Assertions to JSObject constructor.
2374 (JSC::JSObject::JSObject):
2376 2008-10-10 Sam Weinig <sam@webkit.org>
2378 Reviewed by Cameron Zwarich.
2380 Remove now unused m_getterSetterFlag variable from PropertyMap.
2382 * kjs/PropertyMap.cpp:
2383 (JSC::PropertyMap::operator=):
2384 * kjs/PropertyMap.h:
2385 (JSC::PropertyMap::PropertyMap):
2387 2008-10-09 Sam Weinig <sam@webkit.org>
2389 Reviewed by Maciej Stachowiak.
2391 Add leaks checking to StructureID.
2393 * kjs/StructureID.cpp:
2394 (JSC::StructureID::StructureID):
2395 (JSC::StructureID::~StructureID):
2397 2008-10-09 Alp Toker <alp@nuanti.com>
2399 Reviewed by Mark Rowe.
2401 https://bugs.webkit.org/show_bug.cgi?id=20760
2402 Implement support for x86 Linux in CTI
2404 Prepare to enable CTI/WREC on supported architectures.
2406 Make it possible to use the CTI_ARGUMENT workaround with GCC as well
2407 as MSVC by fixing some preprocessor conditionals.
2409 Note that CTI/WREC no longer requires CTI_ARGUMENT on Linux so we
2410 don't actually enable it except when building with MSVC. GCC on Win32
2413 Adapt inline ASM code to use the global symbol underscore prefix only
2414 on Darwin and to call the properly mangled Machine::cti_vm_throw
2415 symbol name depending on CTI_ARGUMENT.
2417 Also avoid global inclusion of the JIT infrastructure headers
2418 throughout WebCore and WebKit causing recompilation of about ~1500
2419 source files after modification to X86Assembler.h, CTI.h, WREC.h,
2420 which are only used deep inside JavaScriptCore.
2428 (JSC::RegExp::RegExp):
2429 (JSC::RegExp::~RegExp):
2430 (JSC::RegExp::match):
2432 * masm/X86Assembler.h:
2433 (JSC::X86Assembler::emitConvertToFastCall):
2434 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
2435 (JSC::X86Assembler::emitRestoreArgumentReference):
2437 2008-10-09 Gavin Barraclough <barraclough@apple.com>
2439 Reviewed by Cameron Zwarich.
2441 Fix for bug #21160, x=0;1/(x*-1) == -Infinity
2445 (JSC::CTI::emitFastArithDeTagImmediate):
2446 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
2447 (JSC::CTI::compileBinaryArithOp):
2448 (JSC::CTI::compileBinaryArithOpSlowCase):
2449 (JSC::CTI::privateCompileMainPass):
2450 (JSC::CTI::privateCompileSlowCases):
2452 * masm/X86Assembler.h:
2453 (JSC::X86Assembler::):
2454 (JSC::X86Assembler::emitUnlinkedJs):
2456 2008-10-09 Cameron Zwarich <zwarich@apple.com>
2458 Reviewed by Oliver Hunt.
2460 Bug 21459: REGRESSION (r37324): Safari crashes inside JavaScriptCore while browsing hulu.com
2461 <https://bugs.webkit.org/show_bug.cgi?id=21459>
2463 After r37324, an Arguments object does not mark an associated activation
2464 object. This change was made because Arguments no longer directly used
2465 the activation object in any way. However, if an activation is torn off,
2466 then the backing store of Arguments becomes the register array of the
2467 activation object. Arguments directly marks all of the arguments, but
2468 the activation object is being collected, which causes its register
2469 array to be freed and new memory to be allocated in its place.
2471 Unfortunately, it does not seem possible to reproduce this issue in a
2474 * kjs/Arguments.cpp:
2475 (JSC::Arguments::mark):
2477 (JSC::Arguments::setActivation):
2478 (JSC::Arguments::Arguments):
2479 (JSC::JSActivation::copyRegisters):
2481 2008-10-09 Ariya Hidayat <ariya.hidayat@trolltech.com>
2485 Build fix for MinGW.
2487 * wtf/AlwaysInline.h:
2489 2008-10-08 Cameron Zwarich <zwarich@apple.com>
2491 Reviewed by Maciej Stachowiak.
2493 Bug 21497: REGRESSION (r37433): Bytecode JSC tests are severely broken
2494 <https://bugs.webkit.org/show_bug.cgi?id=21497>
2496 Fix a typo in r37433 that causes the failure of a large number of JSC
2497 tests with the bytecode interpreter enabled.
2500 (JSC::Machine::privateExecute):
2502 2008-10-08 Mark Rowe <mrowe@apple.com>
2507 (JSC::): Update type of argument to ctiTrampoline.
2509 2008-10-08 Darin Adler <darin@apple.com>
2511 Reviewed by Cameron Zwarich.
2513 - https://bugs.webkit.org/show_bug.cgi?id=21403
2514 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
2516 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
2517 client over to the new name.
2519 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
2520 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
2521 accessor functions to get at things in the frame.
2523 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
2524 JSGlobalData* and in other cases eliminating them entirely.
2526 * API/JSObjectRef.cpp:
2527 (JSObjectMakeFunctionWithCallback):
2528 (JSObjectMakeFunction):
2529 (JSObjectHasProperty):
2530 (JSObjectGetProperty):
2531 (JSObjectSetProperty):
2532 (JSObjectDeleteProperty):
2533 * API/OpaqueJSString.cpp:
2534 * API/OpaqueJSString.h:
2536 (JSC::CTI::getConstant):
2537 (JSC::CTI::emitGetArg):
2538 (JSC::CTI::emitGetPutArg):
2539 (JSC::CTI::getConstantImmediateNumericArg):
2540 (JSC::CTI::printOpcodeOperandTypes):
2542 (JSC::CTI::compileOpCall):
2543 (JSC::CTI::compileBinaryArithOp):
2544 (JSC::CTI::privateCompileMainPass):
2545 (JSC::CTI::privateCompile):
2546 (JSC::CTI::privateCompileGetByIdProto):
2547 (JSC::CTI::privateCompileGetByIdChain):
2548 (JSC::CTI::compileRegExp):
2551 * VM/CodeGenerator.cpp:
2552 (JSC::CodeGenerator::emitEqualityOp):
2553 (JSC::CodeGenerator::emitLoad):
2554 (JSC::CodeGenerator::emitUnexpectedLoad):
2555 (JSC::CodeGenerator::emitConstruct):
2556 * VM/CodeGenerator.h:
2560 (JSC::jsAddSlowCase):
2562 (JSC::jsTypeStringForValue):
2563 (JSC::Machine::resolve):
2564 (JSC::Machine::resolveSkip):
2565 (JSC::Machine::resolveGlobal):
2566 (JSC::inlineResolveBase):
2567 (JSC::Machine::resolveBase):
2568 (JSC::Machine::resolveBaseAndProperty):
2569 (JSC::Machine::resolveBaseAndFunc):
2570 (JSC::Machine::slideRegisterWindowForCall):
2572 (JSC::Machine::callEval):
2573 (JSC::Machine::dumpCallFrame):
2574 (JSC::Machine::dumpRegisters):
2575 (JSC::Machine::unwindCallFrame):
2576 (JSC::Machine::throwException):
2577 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
2578 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
2579 (JSC::Machine::execute):
2580 (JSC::Machine::debug):
2581 (JSC::Machine::createExceptionScope):
2582 (JSC::cachePrototypeChain):
2583 (JSC::Machine::tryCachePutByID):
2584 (JSC::Machine::tryCacheGetByID):
2585 (JSC::Machine::privateExecute):
2586 (JSC::Machine::retrieveArguments):
2587 (JSC::Machine::retrieveCaller):
2588 (JSC::Machine::retrieveLastCaller):
2589 (JSC::Machine::findFunctionCallFrame):
2590 (JSC::Machine::getArgumentsData):
2591 (JSC::Machine::tryCTICachePutByID):
2592 (JSC::Machine::getCTIArrayLengthTrampoline):
2593 (JSC::Machine::getCTIStringLengthTrampoline):
2594 (JSC::Machine::tryCTICacheGetByID):
2595 (JSC::Machine::cti_op_convert_this):
2596 (JSC::Machine::cti_op_end):
2597 (JSC::Machine::cti_op_add):
2598 (JSC::Machine::cti_op_pre_inc):
2599 (JSC::Machine::cti_timeout_check):
2600 (JSC::Machine::cti_op_loop_if_less):
2601 (JSC::Machine::cti_op_loop_if_lesseq):
2602 (JSC::Machine::cti_op_new_object):
2603 (JSC::Machine::cti_op_put_by_id):
2604 (JSC::Machine::cti_op_put_by_id_second):
2605 (JSC::Machine::cti_op_put_by_id_generic):
2606 (JSC::Machine::cti_op_put_by_id_fail):
2607 (JSC::Machine::cti_op_get_by_id):
2608 (JSC::Machine::cti_op_get_by_id_second):
2609 (JSC::Machine::cti_op_get_by_id_generic):
2610 (JSC::Machine::cti_op_get_by_id_fail):
2611 (JSC::Machine::cti_op_instanceof):
2612 (JSC::Machine::cti_op_del_by_id):
2613 (JSC::Machine::cti_op_mul):
2614 (JSC::Machine::cti_op_new_func):
2615 (JSC::Machine::cti_op_call_JSFunction):
2616 (JSC::Machine::cti_vm_compile):
2617 (JSC::Machine::cti_op_push_activation):
2618 (JSC::Machine::cti_op_call_NotJSFunction):
2619 (JSC::Machine::cti_op_create_arguments):
2620 (JSC::Machine::cti_op_tear_off_activation):
2621 (JSC::Machine::cti_op_tear_off_arguments):
2622 (JSC::Machine::cti_op_ret_profiler):
2623 (JSC::Machine::cti_op_ret_scopeChain):
2624 (JSC::Machine::cti_op_new_array):
2625 (JSC::Machine::cti_op_resolve):
2626 (JSC::Machine::cti_op_construct_JSConstruct):
2627 (JSC::Machine::cti_op_construct_NotJSConstruct):
2628 (JSC::Machine::cti_op_get_by_val):
2629 (JSC::Machine::cti_op_resolve_func):
2630 (JSC::Machine::cti_op_sub):
2631 (JSC::Machine::cti_op_put_by_val):
2632 (JSC::Machine::cti_op_put_by_val_array):
2633 (JSC::Machine::cti_op_lesseq):
2634 (JSC::Machine::cti_op_loop_if_true):
2635 (JSC::Machine::cti_op_negate):
2636 (JSC::Machine::cti_op_resolve_base):
2637 (JSC::Machine::cti_op_resolve_skip):
2638 (JSC::Machine::cti_op_resolve_global):
2639 (JSC::Machine::cti_op_div):
2640 (JSC::Machine::cti_op_pre_dec):
2641 (JSC::Machine::cti_op_jless):
2642 (JSC::Machine::cti_op_not):
2643 (JSC::Machine::cti_op_jtrue):
2644 (JSC::Machine::cti_op_post_inc):
2645 (JSC::Machine::cti_op_eq):
2646 (JSC::Machine::cti_op_lshift):
2647 (JSC::Machine::cti_op_bitand):
2648 (JSC::Machine::cti_op_rshift):
2649 (JSC::Machine::cti_op_bitnot):
2650 (JSC::Machine::cti_op_resolve_with_base):
2651 (JSC::Machine::cti_op_new_func_exp):
2652 (JSC::Machine::cti_op_mod):
2653 (JSC::Machine::cti_op_less):
2654 (JSC::Machine::cti_op_neq):
2655 (JSC::Machine::cti_op_post_dec):
2656 (JSC::Machine::cti_op_urshift):
2657 (JSC::Machine::cti_op_bitxor):
2658 (JSC::Machine::cti_op_new_regexp):
2659 (JSC::Machine::cti_op_bitor):
2660 (JSC::Machine::cti_op_call_eval):
2661 (JSC::Machine::cti_op_throw):
2662 (JSC::Machine::cti_op_get_pnames):
2663 (JSC::Machine::cti_op_next_pname):
2664 (JSC::Machine::cti_op_push_scope):
2665 (JSC::Machine::cti_op_pop_scope):
2666 (JSC::Machine::cti_op_typeof):
2667 (JSC::Machine::cti_op_to_jsnumber):
2668 (JSC::Machine::cti_op_in):
2669 (JSC::Machine::cti_op_push_new_scope):
2670 (JSC::Machine::cti_op_jmp_scopes):
2671 (JSC::Machine::cti_op_put_by_index):
2672 (JSC::Machine::cti_op_switch_imm):
2673 (JSC::Machine::cti_op_switch_char):
2674 (JSC::Machine::cti_op_switch_string):
2675 (JSC::Machine::cti_op_del_by_val):
2676 (JSC::Machine::cti_op_put_getter):
2677 (JSC::Machine::cti_op_put_setter):
2678 (JSC::Machine::cti_op_new_error):
2679 (JSC::Machine::cti_op_debug):
2680 (JSC::Machine::cti_vm_throw):
2683 * VM/RegisterFile.h:
2685 * kjs/DebuggerCallFrame.cpp:
2686 (JSC::DebuggerCallFrame::functionName):
2687 (JSC::DebuggerCallFrame::type):
2688 (JSC::DebuggerCallFrame::thisObject):
2689 (JSC::DebuggerCallFrame::evaluate):
2690 * kjs/DebuggerCallFrame.h:
2691 * kjs/ExecState.cpp:
2692 (JSC::CallFrame::thisValue):
2694 * kjs/FunctionConstructor.cpp:
2695 (JSC::constructFunction):
2696 * kjs/JSActivation.cpp:
2697 (JSC::JSActivation::JSActivation):
2698 (JSC::JSActivation::argumentsGetter):
2699 * kjs/JSActivation.h:
2700 * kjs/JSGlobalObject.cpp:
2701 (JSC::JSGlobalObject::init):
2702 * kjs/JSGlobalObjectFunctions.cpp:
2703 (JSC::globalFuncEval):
2704 * kjs/JSVariableObject.h:
2706 (JSC::Parser::parse):
2707 * kjs/RegExpConstructor.cpp:
2708 (JSC::constructRegExp):
2709 * kjs/RegExpPrototype.cpp:
2710 (JSC::regExpProtoFuncCompile):
2712 (prettyPrintScript):
2713 * kjs/StringPrototype.cpp:
2714 (JSC::stringProtoFuncMatch):
2715 (JSC::stringProtoFuncSearch):
2716 * kjs/identifier.cpp:
2717 (JSC::Identifier::checkSameIdentifierTable):
2718 * kjs/interpreter.cpp:
2719 (JSC::Interpreter::checkSyntax):
2720 (JSC::Interpreter::evaluate):
2722 (JSC::ThrowableExpressionData::emitThrowError):
2723 (JSC::RegExpNode::emitCode):
2724 (JSC::ArrayNode::emitCode):
2725 (JSC::InstanceOfNode::emitCode):
2728 (JSC::RegExp::RegExp):
2729 (JSC::RegExp::create):
2731 * profiler/HeavyProfile.h:
2732 * profiler/Profile.h:
2736 2008-10-08 Mark Rowe <mrowe@apple.com>
2738 Typed by Maciej Stachowiak, reviewed by Mark Rowe.
2740 Fix crash in fast/js/constant-folding.html with CTI disabled.
2743 (JSC::Machine::privateExecute):
2745 2008-10-08 Timothy Hatcher <timothy@apple.com>
2747 Roll out r37427 because it causes an infinite recursion loading about:blank.
2749 https://bugs.webkit.org/show_bug.cgi?id=21476
2751 2008-10-08 Darin Adler <darin@apple.com>
2753 Reviewed by Cameron Zwarich.
2755 - https://bugs.webkit.org/show_bug.cgi?id=21403
2756 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
2758 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
2759 client over to the new name.
2761 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
2762 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
2763 accessor functions to get at things in the frame.
2765 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
2766 JSGlobalData* and in other cases eliminating them entirely.
2768 * API/JSObjectRef.cpp:
2769 (JSObjectMakeFunctionWithCallback):
2770 (JSObjectMakeFunction):
2771 (JSObjectHasProperty):
2772 (JSObjectGetProperty):
2773 (JSObjectSetProperty):
2774 (JSObjectDeleteProperty):
2775 * API/OpaqueJSString.cpp:
2776 * API/OpaqueJSString.h:
2778 (JSC::CTI::getConstant):
2779 (JSC::CTI::emitGetArg):
2780 (JSC::CTI::emitGetPutArg):
2781 (JSC::CTI::getConstantImmediateNumericArg):
2782 (JSC::CTI::printOpcodeOperandTypes):
2784 (JSC::CTI::compileOpCall):
2785 (JSC::CTI::compileBinaryArithOp):
2786 (JSC::CTI::privateCompileMainPass):
2787 (JSC::CTI::privateCompile):
2788 (JSC::CTI::privateCompileGetByIdProto):
2789 (JSC::CTI::privateCompileGetByIdChain):
2790 (JSC::CTI::compileRegExp):
2793 * VM/CodeGenerator.cpp:
2794 (JSC::CodeGenerator::emitEqualityOp):
2795 (JSC::CodeGenerator::emitLoad):
2796 (JSC::CodeGenerator::emitUnexpectedLoad):
2797 (JSC::CodeGenerator::emitConstruct):
2798 * VM/CodeGenerator.h:
2802 (JSC::jsAddSlowCase):
2804 (JSC::jsTypeStringForValue):
2805 (JSC::Machine::resolve):
2806 (JSC::Machine::resolveSkip):
2807 (JSC::Machine::resolveGlobal):
2808 (JSC::inlineResolveBase):
2809 (JSC::Machine::resolveBase):
2810 (JSC::Machine::resolveBaseAndProperty):
2811 (JSC::Machine::resolveBaseAndFunc):
2812 (JSC::Machine::slideRegisterWindowForCall):
2814 (JSC::Machine::callEval):
2815 (JSC::Machine::dumpCallFrame):
2816 (JSC::Machine::dumpRegisters):
2817 (JSC::Machine::unwindCallFrame):
2818 (JSC::Machine::throwException):
2819 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
2820 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
2821 (JSC::Machine::execute):
2822 (JSC::Machine::debug):
2823 (JSC::Machine::createExceptionScope):
2824 (JSC::cachePrototypeChain):
2825 (JSC::Machine::tryCachePutByID):
2826 (JSC::Machine::tryCacheGetByID):
2827 (JSC::Machine::privateExecute):
2828 (JSC::Machine::retrieveArguments):
2829 (JSC::Machine::retrieveCaller):
2830 (JSC::Machine::retrieveLastCaller):
2831 (JSC::Machine::findFunctionCallFrame):
2832 (JSC::Machine::getArgumentsData):
2833 (JSC::Machine::tryCTICachePutByID):
2834 (JSC::Machine::getCTIArrayLengthTrampoline):
2835 (JSC::Machine::getCTIStringLengthTrampoline):
2836 (JSC::Machine::tryCTICacheGetByID):
2837 (JSC::Machine::cti_op_convert_this):
2838 (JSC::Machine::cti_op_end):
2839 (JSC::Machine::cti_op_add):
2840 (JSC::Machine::cti_op_pre_inc):
2841 (JSC::Machine::cti_timeout_check):
2842 (JSC::Machine::cti_op_loop_if_less):
2843 (JSC::Machine::cti_op_loop_if_lesseq):
2844 (JSC::Machine::cti_op_new_object):
2845 (JSC::Machine::cti_op_put_by_id):
2846 (JSC::Machine::cti_op_put_by_id_second):
2847 (JSC::Machine::cti_op_put_by_id_generic):
2848 (JSC::Machine::cti_op_put_by_id_fail):
2849 (JSC::Machine::cti_op_get_by_id):
2850 (JSC::Machine::cti_op_get_by_id_second):
2851 (JSC::Machine::cti_op_get_by_id_generic):
2852 (JSC::Machine::cti_op_get_by_id_fail):
2853 (JSC::Machine::cti_op_instanceof):
2854 (JSC::Machine::cti_op_del_by_id):
2855 (JSC::Machine::cti_op_mul):
2856 (JSC::Machine::cti_op_new_func):
2857 (JSC::Machine::cti_op_call_JSFunction):
2858 (JSC::Machine::cti_vm_compile):
2859 (JSC::Machine::cti_op_push_activation):
2860 (JSC::Machine::cti_op_call_NotJSFunction):
2861 (JSC::Machine::cti_op_create_arguments):
2862 (JSC::Machine::cti_op_tear_off_activation):
2863 (JSC::Machine::cti_op_tear_off_arguments):
2864 (JSC::Machine::cti_op_ret_profiler):
2865 (JSC::Machine::cti_op_ret_scopeChain):
2866 (JSC::Machine::cti_op_new_array):
2867 (JSC::Machine::cti_op_resolve):
2868 (JSC::Machine::cti_op_construct_JSConstruct):
2869 (JSC::Machine::cti_op_construct_NotJSConstruct):
2870 (JSC::Machine::cti_op_get_by_val):
2871 (JSC::Machine::cti_op_resolve_func):
2872 (JSC::Machine::cti_op_sub):
2873 (JSC::Machine::cti_op_put_by_val):
2874 (JSC::Machine::cti_op_put_by_val_array):
2875 (JSC::Machine::cti_op_lesseq):
2876 (JSC::Machine::cti_op_loop_if_true):
2877 (JSC::Machine::cti_op_negate):
2878 (JSC::Machine::cti_op_resolve_base):
2879 (JSC::Machine::cti_op_resolve_skip):
2880 (JSC::Machine::cti_op_resolve_global):
2881 (JSC::Machine::cti_op_div):
2882 (JSC::Machine::cti_op_pre_dec):
2883 (JSC::Machine::cti_op_jless):
2884 (JSC::Machine::cti_op_not):
2885 (JSC::Machine::cti_op_jtrue):
2886 (JSC::Machine::cti_op_post_inc):
2887 (JSC::Machine::cti_op_eq):
2888 (JSC::Machine::cti_op_lshift):
2889 (JSC::Machine::cti_op_bitand):
2890 (JSC::Machine::cti_op_rshift):
2891 (JSC::Machine::cti_op_bitnot):
2892 (JSC::Machine::cti_op_resolve_with_base):
2893 (JSC::Machine::cti_op_new_func_exp):
2894 (JSC::Machine::cti_op_mod):
2895 (JSC::Machine::cti_op_less):
2896 (JSC::Machine::cti_op_neq):
2897 (JSC::Machine::cti_op_post_dec):
2898 (JSC::Machine::cti_op_urshift):
2899 (JSC::Machine::cti_op_bitxor):
2900 (JSC::Machine::cti_op_new_regexp):
2901 (JSC::Machine::cti_op_bitor):
2902 (JSC::Machine::cti_op_call_eval):
2903 (JSC::Machine::cti_op_throw):
2904 (JSC::Machine::cti_op_get_pnames):
2905 (JSC::Machine::cti_op_next_pname):
2906 (JSC::Machine::cti_op_push_scope):
2907 (JSC::Machine::cti_op_pop_scope):
2908 (JSC::Machine::cti_op_typeof):
2909 (JSC::Machine::cti_op_to_jsnumber):
2910 (JSC::Machine::cti_op_in):
2911 (JSC::Machine::cti_op_push_new_scope):
2912 (JSC::Machine::cti_op_jmp_scopes):
2913 (JSC::Machine::cti_op_put_by_index):
2914 (JSC::Machine::cti_op_switch_imm):
2915 (JSC::Machine::cti_op_switch_char):
2916 (JSC::Machine::cti_op_switch_string):
2917 (JSC::Machine::cti_op_del_by_val):
2918 (JSC::Machine::cti_op_put_getter):
2919 (JSC::Machine::cti_op_put_setter):
2920 (JSC::Machine::cti_op_new_error):
2921 (JSC::Machine::cti_op_debug):
2922 (JSC::Machine::cti_vm_throw):
2925 * VM/RegisterFile.h:
2927 * kjs/DebuggerCallFrame.cpp:
2928 (JSC::DebuggerCallFrame::functionName):
2929 (JSC::DebuggerCallFrame::type):
2930 (JSC::DebuggerCallFrame::thisObject):
2931 (JSC::DebuggerCallFrame::evaluate):
2932 * kjs/DebuggerCallFrame.h:
2933 * kjs/ExecState.cpp:
2934 (JSC::CallFrame::thisValue):
2936 * kjs/FunctionConstructor.cpp:
2937 (JSC::constructFunction):
2938 * kjs/JSActivation.cpp:
2939 (JSC::JSActivation::JSActivation):
2940 (JSC::JSActivation::argumentsGetter):
2941 * kjs/JSActivation.h:
2942 * kjs/JSGlobalObject.cpp:
2943 (JSC::JSGlobalObject::init):
2944 * kjs/JSGlobalObjectFunctions.cpp:
2945 (JSC::globalFuncEval):
2946 * kjs/JSVariableObject.h:
2948 (JSC::Parser::parse):
2949 * kjs/RegExpConstructor.cpp:
2950 (JSC::constructRegExp):
2951 * kjs/RegExpPrototype.cpp:
2952 (JSC::regExpProtoFuncCompile):
2954 (prettyPrintScript):
2955 * kjs/StringPrototype.cpp:
2956 (JSC::stringProtoFuncMatch):
2957 (JSC::stringProtoFuncSearch):
2958 * kjs/identifier.cpp:
2959 (JSC::Identifier::checkSameIdentifierTable):
2960 * kjs/interpreter.cpp:
2961 (JSC::Interpreter::checkSyntax):
2962 (JSC::Interpreter::evaluate):
2964 (JSC::ThrowableExpressionData::emitThrowError):
2965 (JSC::RegExpNode::emitCode):
2966 (JSC::ArrayNode::emitCode):
2967 (JSC::InstanceOfNode::emitCode):
2970 (JSC::RegExp::RegExp):
2971 (JSC::RegExp::create):
2973 * profiler/HeavyProfile.h:
2974 * profiler/Profile.h:
2978 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
2980 Reviewed by Oliver Hunt.
2982 Avoid endless loops when compiling without the computed goto
2985 NEXT_OPCODE expands to "continue", which will not work inside
2989 (JSC::Machine::privateExecute):
2991 2008-10-08 Maciej Stachowiak <mjs@apple.com>
2993 Reviewed by Oliver Hunt.
2995 Re-landing the following fix with the crashing bug in it fixed (r37405):
2997 - optimize away multiplication by constant 1.0
2999 2.3% speedup on v8 RayTrace benchmark
3001 Apparently it's not uncommon for JavaScript code to multiply by
3002 constant 1.0 in the mistaken belief that this converts integer to
3003 floating point and that there is any operational difference.
3006 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
3007 case where parameter is already number.
3008 (JSC::CTI::privateCompileSlowCases): ditto
3010 (JSC::Machine::privateExecute): ditto
3012 (makeMultNode): Transform as follows:
3013 +FOO * BAR ==> FOO * BAR
3014 FOO * +BAR ==> FOO * BAR
3017 (makeDivNode): Transform as follows:
3018 +FOO / BAR ==> FOO / BAR
3019 FOO / +BAR ==> FOO / BAR
3020 (makeSubNode): Transform as follows:
3021 +FOO - BAR ==> FOO - BAR
3022 FOO - +BAR ==> FOO - BAR
3024 (JSC::ExpressionNode::stripUnaryPlus): Helper for above
3026 (JSC::UnaryPlusNode::stripUnaryPlus): ditto
3028 2008-10-08 Maciej Stachowiak <mjs@apple.com>
3030 Reviewed by Oliver Hunt.
3032 - correctly handle appending -0 to a string, it should stringify as just 0
3037 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
3041 Fix WebKit compilation with VC2008SP1
3043 Apply the TR1 workaround for JavaScriptCore, too.
3045 * JavaScriptCore.pro:
3047 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
3051 Fix compilation errors on VS2008 64Bit
3053 * kjs/collector.cpp:
3054 (JSC::currentThreadStackBase):
3056 2008-10-08 André Pönitz <apoenitz@trolltech.com>
3060 Fix compilation with Qt namespaces.
3064 2008-10-07 Sam Weinig <sam@webkit.org>
3068 2008-10-07 Oliver Hunt <oliver@apple.com>
3070 Reviewed by Cameron Zwarich.
3072 Switch CTI runtime calls to the fastcall calling convention
3074 Basically this means that we get to store the argument for CTI
3075 calls in the ECX register, which saves a register->memory write
3076 and subsequent memory->register read.
3078 This is a 1.7% progression in SunSpider and 2.4% on commandline
3083 (JSC::CTI::privateCompilePutByIdTransition):
3084 (JSC::CTI::privateCompilePatchGetArrayLength):
3087 * masm/X86Assembler.h:
3088 (JSC::X86Assembler::emitRestoreArgumentReference):
3089 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
3090 We need this to correctly reload ecx from inside certain property access
3094 2008-10-07 Maciej Stachowiak <mjs@apple.com>
3096 Reviewed by Mark Rowe.
3098 - optimize away multiplication by constant 1.0
3100 2.3% speedup on v8 RayTrace benchmark
3102 Apparently it's not uncommon for JavaScript code to multiply by
3103 constant 1.0 in the mistaken belief that this converts integer to
3104 floating point and that there is any operational difference.
3107 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
3108 case where parameter is already number.
3109 (JSC::CTI::privateCompileSlowCases): ditto
3111 (JSC::Machine::privateExecute): ditto
3113 (makeMultNode): Transform as follows:
3114 +FOO * BAR ==> FOO * BAR
3115 FOO * +BAR ==> FOO * BAR
3118 (makeDivNode): Transform as follows:
3119 +FOO / BAR ==> FOO / BAR
3120 FOO / +BAR ==> FOO / BAR
3121 (makeSubNode): Transform as follows:
3122 +FOO - BAR ==> FOO - BAR
3123 FOO - +BAR ==> FOO - BAR
3125 (JSC::ExpressionNode::stripUnaryPlus): Helper for above
3127 (JSC::UnaryPlusNode::stripUnaryPlus): ditto
3129 2008-10-07 Maciej Stachowiak <mjs@apple.com>
3131 Reviewed by Oliver Hunt.
3133 - make constant folding code more consistent
3135 Added a makeSubNode to match add, mult and div; use the makeFooNode functions always,
3136 instead of allocating nodes directly in other places in the grammar.
3140 2008-10-07 Sam Weinig <sam@webkit.org>
3142 Reviewed by Cameron Zwarich.
3144 Move hasGetterSetterProperties flag from PropertyMap to StructureID.
3147 (JSC::JSObject::put):
3148 (JSC::JSObject::defineGetter):
3149 (JSC::JSObject::defineSetter):
3151 (JSC::JSObject::hasGetterSetterProperties):
3152 (JSC::JSObject::getOwnPropertySlotForWrite):
3153 (JSC::JSObject::getOwnPropertySlot):
3154 * kjs/PropertyMap.h:
3155 * kjs/StructureID.cpp:
3156 (JSC::StructureID::StructureID):
3157 (JSC::StructureID::addPropertyTransition):
3158 (JSC::StructureID::toDictionaryTransition):
3159 (JSC::StructureID::changePrototypeTransition):
3160 (JSC::StructureID::getterSetterTransition):
3161 * kjs/StructureID.h:
3162 (JSC::StructureID::hasGetterSetterProperties):
3163 (JSC::StructureID::setHasGetterSetterProperties):
3165 2008-10-07 Sam Weinig <sam@webkit.org>
3167 Reviewed by Cameron Zwarich.
3169 Roll r37370 back in with bug fixes.
3171 - PropertyMap::storageSize() should reflect the number of keys + deletedOffsets
3172 and has nothing to do with the internal deletedSentinel count anymore.
3174 2008-10-07 Gavin Barraclough <barraclough@apple.com>
3176 Reviewed by Oliver Hunt.
3178 Move callframe initialization into JIT code, again.
3180 As a part of the restructuring the second result from functions is now
3181 returned in edx, allowing the new value of 'r' to be returned via a
3182 register, and stored to the stack from JIT code, too.
3184 4.5% progression on v8-tests. (3% in their harness)
3188 (JSC::CTI::emitCall):
3189 (JSC::CTI::compileOpCall):
3190 (JSC::CTI::privateCompileMainPass):
3191 (JSC::CTI::privateCompileSlowCases):
3192 (JSC::CTI::privateCompile):
3194 (JSC::CallRecord::CallRecord):
3196 (JSC::Machine::cti_op_call_JSFunction):
3197 (JSC::Machine::cti_op_construct_JSConstruct):
3198 (JSC::Machine::cti_op_resolve_func):
3199 (JSC::Machine::cti_op_post_inc):
3200 (JSC::Machine::cti_op_resolve_with_base):
3201 (JSC::Machine::cti_op_post_dec):
3206 2008-10-07 Mark Rowe <mrowe@apple.com>
3208 Fix typo in method name.
3213 2008-10-07 Cameron Zwarich <zwarich@apple.com>
3215 Rubber-stamped by Mark Rowe.
3219 2008-10-06 Sam Weinig <sam@webkit.org>
3221 Reviewed by Cameron Zwarich.
3223 Fix for https://bugs.webkit.org/show_bug.cgi?id=21415
3224 Improve the division between PropertyStorageArray and PropertyMap
3226 - Rework ProperyMap to store offsets in the value so that they don't
3227 change when rehashing. This allows us not to have to keep the
3228 PropertyStorageArray in sync and thus not have to pass it in.
3229 - Rename PropertyMap::getOffset -> PropertyMap::get since put/remove
3230 now also return offsets.
3231 - A Vector of deleted offsets is now needed since the storage is out of
3234 1% win on SunSpider. Wash on V8 suite.
3236 * JavaScriptCore.exp:
3238 (JSC::transitionWillNeedStorageRealloc):
3240 (JSC::Machine::privateExecute):
3241 Transition logic can be greatly simplified by the fact that
3242 the storage capacity is always known, and is correct for the
3245 (JSC::JSObject::put): Rename getOffset -> get.
3246 (JSC::JSObject::deleteProperty): Ditto.
3247 (JSC::JSObject::getPropertyAttributes): Ditto.
3248 (JSC::JSObject::removeDirect): Use returned offset to
3249 clear the value in the PropertyNameArray.
3250 (JSC::JSObject::allocatePropertyStorage): Add assert.
3252 (JSC::JSObject::getDirect): Rename getOffset -> get
3253 (JSC::JSObject::getDirectLocation): Rename getOffset -> get
3254 (JSC::JSObject::putDirect): Use propertyStorageCapacity to determine whether
3255 or not to resize. Also, since put now returns an offset (and thus
3256 addPropertyTransition does also) setting of the PropertyStorageArray is
3258 (JSC::JSObject::transitionTo):
3259 * kjs/PropertyMap.cpp:
3260 (JSC::PropertyMap::checkConsistency): PropertyStorageArray is no longer
3262 (JSC::PropertyMap::operator=): Copy the delete offsets vector.
3263 (JSC::PropertyMap::put): Instead of setting the PropertyNameArray
3264 explicitly, return the offset where the value should go.
3265 (JSC::PropertyMap::remove): Instead of removing from the PropertyNameArray
3266 explicitly, return the offset where the value should be removed.
3267 (JSC::PropertyMap::get): Switch to using the stored offset, instead
3268 of the implicit one.
3269 (JSC::PropertyMap::insert):
3270 (JSC::PropertyMap::expand): This is never called when m_table is null,
3271 so remove that branch and add it as an assertion.
3272 (JSC::PropertyMap::createTable): Consistency checks no longer take
3273 a PropertyNameArray.
3274 (JSC::PropertyMap::rehash): No need to rehash the PropertyNameArray
3275 now that it is completely out of band.
3276 * kjs/PropertyMap.h:
3277 (JSC::PropertyMapEntry::PropertyMapEntry): Store offset into PropertyNameArray.
3278 (JSC::PropertyMap::get): Switch to using the stored offset, instead
3279 of the implicit one.
3280 * kjs/StructureID.cpp:
3281 (JSC::StructureID::StructureID): Initialize the propertyStorageCapacity to
3282 JSObject::inlineStorageCapacity.
3283 (JSC::StructureID::growPropertyStorageCapacity): Grow the storage capacity as
3285 (JSC::StructureID::addPropertyTransition): Copy the storage capacity.
3286 (JSC::StructureID::toDictionaryTransition): Ditto.
3287 (JSC::StructureID::changePrototypeTransition): Ditto.
3288 (JSC::StructureID::getterSetterTransition): Ditto.
3289 * kjs/StructureID.h:
3290 (JSC::StructureID::propertyStorageCapacity): Add propertyStorageCapacity
3291 which is the current capacity for the JSObjects PropertyStorageArray.
3292 It starts at the JSObject::inlineStorageCapacity (currently 2), then
3293 when it first needs to be resized moves to the JSObject::nonInlineBaseStorageCapacity
3294 (currently 16), and after that doubles each time.
3296 2008-10-06 Cameron Zwarich <zwarich@apple.com>
3298 Reviewed by Oliver Hunt.
3300 Bug 21396: Remove the OptionalCalleeActivation call frame slot
3301 <https://bugs.webkit.org/show_bug.cgi?id=21396>
3303 Remove the OptionalCalleeActivation call frame slot. We have to be
3304 careful to store the activation object in a register, because objects
3305 in the scope chain do not get marked.
3307 This is a 0.3% speedup on both SunSpider and the V8 benchmark.
3310 (JSC::CTI::privateCompileMainPass):
3312 (JSC::CodeBlock::dump):
3313 * VM/CodeGenerator.cpp:
3314 (JSC::CodeGenerator::CodeGenerator):
3315 (JSC::CodeGenerator::emitReturn):
3316 * VM/CodeGenerator.h:
3318 (JSC::Machine::dumpRegisters):
3319 (JSC::Machine::unwindCallFrame):
3320 (JSC::Machine::privateExecute):
3321 (JSC::Machine::cti_op_call_JSFunction):
3322 (JSC::Machine::cti_op_push_activation):
3323 (JSC::Machine::cti_op_tear_off_activation):
3324 (JSC::Machine::cti_op_construct_JSConstruct):
3326 (JSC::Machine::initializeCallFrame):
3327 * VM/RegisterFile.h:
3328 (JSC::RegisterFile::):
3330 2008-10-06 Tony Chang <tony@chromium.org>
3332 Reviewed by Alexey Proskuryakov.
3334 Chromium doesn't use pthreads on windows, so make its use conditional.
3336 Also convert a WORD to a DWORD to avoid a compiler warning. This
3337 matches the other methods around it.
3339 * wtf/ThreadingWin.cpp:
3340 (WTF::wtfThreadEntryPoint):
3341 (WTF::ThreadCondition::broadcast):
3343 2008-10-06 Mark Mentovai <mark@moxienet.com>
3345 Reviewed by Tim Hatcher.
3347 Allow ENABLE_DASHBOARD_SUPPORT and ENABLE_MAC_JAVA_BRIDGE to be
3348 disabled on the Mac.
3350 https://bugs.webkit.org/show_bug.cgi?id=21333
3354 2008-10-06 Steve Falkenburg <sfalken@apple.com>
3356 https://bugs.webkit.org/show_bug.cgi?id=21416
3357 Pass 0 for size to VirtualAlloc, as documented by MSDN.
3358 Identified by Application Verifier.
3360 Reviewed by Darin Adler.
3362 * kjs/collector.cpp:
3365 2008-10-06 Kevin McCullough <kmccullough@apple.com>
3367 Reviewed by Tim Hatcheri and Oliver Hunt.
3369 https://bugs.webkit.org/show_bug.cgi?id=21412
3370 Bug 21412: Refactor user initiated profile count to be more stable
3371 - Export UString::from for use with creating the profile title.
3373 * JavaScriptCore.exp:
3375 2008-10-06 Maciej Stachowiak <mjs@apple.com>
3377 Not reviewed. Build fix.
3379 - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these
3381 * API/JSValueRef.cpp:
3384 * JavaScriptCore.exp:
3386 (JSC::CodeBlock::dump):
3388 (JSC::Machine::privateExecute):
3389 (JSC::Machine::cti_op_loop_if_true):
3390 (JSC::Machine::cti_op_not):
3391 (JSC::Machine::cti_op_jtrue):
3392 * kjs/ArrayPrototype.cpp:
3393 (JSC::arrayProtoFuncFilter):
3394 (JSC::arrayProtoFuncEvery):
3395 (JSC::arrayProtoFuncSome):
3396 * kjs/BooleanConstructor.cpp:
3397 (JSC::constructBoolean):
3398 (JSC::callBooleanConstructor):
3399 * kjs/GetterSetter.h:
3401 (JSC::JSValue::toBoolean):
3402 * kjs/JSNumberCell.cpp:
3403 (JSC::JSNumberCell::toBoolean):
3404 * kjs/JSNumberCell.h:
3406 (JSC::JSObject::toBoolean):
3409 (JSC::JSString::toBoolean):
3412 * kjs/RegExpConstructor.cpp:
3413 (JSC::setRegExpConstructorMultiline):
3414 * kjs/RegExpObject.cpp:
3415 (JSC::RegExpObject::match):
3416 * kjs/RegExpPrototype.cpp:
3417 (JSC::regExpProtoFuncToString):
3419 2008-10-06 Maciej Stachowiak <mjs@apple.com>
3421 Reviewed by Sam Weinig.
3423 - optimize op_jtrue, op_loop_if_true and op_not in various ways
3424 https://bugs.webkit.org/show_bug.cgi?id=21404
3426 1) Make JSValue::toBoolean nonvirtual and completely inline by
3427 making use of the StructureID type field.
3429 2) Make JSValue::toBoolean not take an ExecState; doesn't need it.
3431 3) Make op_not, op_loop_if_true and op_jtrue not read the
3432 ExecState (toBoolean doesn't need it any more) and not check
3433 exceptions (toBoolean can't throw).
3435 * API/JSValueRef.cpp:
3437 * JavaScriptCore.exp:
3439 (JSC::CodeBlock::dump):
3441 (JSC::Machine::privateExecute):
3442 (JSC::Machine::cti_op_loop_if_true):
3443 (JSC::Machine::cti_op_not):
3444 (JSC::Machine::cti_op_jtrue):
3445 * kjs/ArrayPrototype.cpp:
3446 (JSC::arrayProtoFuncFilter):
3447 (JSC::arrayProtoFuncEvery):
3448 (JSC::arrayProtoFuncSome):
3449 * kjs/BooleanConstructor.cpp:
3450 (JSC::constructBoolean):
3451 (JSC::callBooleanConstructor):
3452 * kjs/GetterSetter.h:
3454 (JSC::JSValue::toBoolean):
3455 * kjs/JSNumberCell.cpp:
3456 * kjs/JSNumberCell.h:
3457 (JSC::JSNumberCell::toBoolean):
3460 (JSC::JSObject::toBoolean):
3461 (JSC::JSCell::toBoolean):
3464 (JSC::JSString::toBoolean):
3466 * kjs/RegExpConstructor.cpp:
3467 (JSC::setRegExpConstructorMultiline):
3468 * kjs/RegExpObject.cpp:
3469 (JSC::RegExpObject::match):
3470 * kjs/RegExpPrototype.cpp:
3471 (JSC::regExpProtoFuncToString):
3473 2008-10-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
3477 Build fix for MinGW.
3479 * JavaScriptCore.pri:
3481 (JSC::highResUpTime):
3483 2008-10-05 Cameron Zwarich <zwarich@apple.com>
3485 Reviewed by Oliver Hunt.
3487 Remove ScopeNode::containsClosures() now that it is unused.
3490 (JSC::ScopeNode::containsClosures):
3492 2008-10-05 Maciej Stachowiak <mjs@apple.com>
3494 Reviewed by Cameron Zwarich.
3496 - fix releas-only test failures caused by the fix to bug 21375
3499 (JSC::Machine::unwindCallFrame): Update ExecState while unwinding call frames;
3500 it now matters more to have a still-valid ExecState, since dynamicGlobalObject
3501 will make use of the ExecState's scope chain.
3504 2008-10-05 Cameron Zwarich <zwarich@apple.com>
3506 Reviewed by Oliver Hunt.
3508 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
3509 <https://bugs.webkit.org/show_bug.cgi?id=21364>
3511 Use information from the parser to detect whether an activation is
3512 needed or 'arguments' is used, and emit explicit instructions to tear
3513 them off before op_ret. This allows a branch to be removed from op_ret
3514 and simplifies some other code. This does cause a small change in the
3515 behaviour of 'f.arguments'; it is no longer live when 'arguments' is not
3516 mentioned in the lexical scope of the function.
3518 It should now be easy to remove the OptionaCalleeActivation slot in the
3519 call frame, but this will be done in a later patch.
3522 (JSC::CTI::privateCompileMainPass):
3524 (JSC::CodeBlock::dump):
3525 * VM/CodeGenerator.cpp:
3526 (JSC::CodeGenerator::emitReturn):
3527 * VM/CodeGenerator.h:
3529 (JSC::Machine::unwindCallFrame):
3530 (JSC::Machine::privateExecute):
3531 (JSC::Machine::retrieveArguments):
3532 (JSC::Machine::cti_op_create_arguments):
3533 (JSC::Machine::cti_op_tear_off_activation):
3534 (JSC::Machine::cti_op_tear_off_arguments):
3537 * kjs/Arguments.cpp:
3538 (JSC::Arguments::mark):
3540 (JSC::Arguments::isTornOff):
3541 (JSC::Arguments::Arguments):
3542 (JSC::Arguments::copyRegisters):
3543 (JSC::JSActivation::copyRegisters):
3544 * kjs/JSActivation.cpp:
3545 (JSC::JSActivation::argumentsGetter):
3546 * kjs/JSActivation.h:
3548 2008-10-05 Maciej Stachowiak <mjs@apple.com>
3550 Reviewed by Oliver Hunt.
3552 - fixed "REGRESSION (r37297): fast/js/deep-recursion-test takes too long and times out"
3553 https://bugs.webkit.org/show_bug.cgi?id=21375
3555 The problem is that dynamicGlobalObject had become O(N) in number
3556 of call frames, but unwinding the stack for an exception called it
3557 for every call frame, resulting in O(N^2) behavior for an
3558 exception thrown from inside deep recursion.
3560 Instead of doing it that way, stash the dynamic global object in JSGlobalData.
3562 * JavaScriptCore.exp:
3564 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Helper class to temporarily
3565 store and later restore a dynamicGlobalObject in JSGlobalData.
3566 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
3567 (JSC::Machine::execute): In each version, establish a DynamicGlobalObjectScope.
3568 For ProgramNode, always establish set new dynamicGlobalObject, for FunctionBody and Eval,
3569 only if none is currently set.
3572 * kjs/JSGlobalData.cpp:
3573 (JSC::JSGlobalData::JSGlobalData): Ininitalize new dynamicGlobalObject field to 0.
3574 * kjs/JSGlobalData.h:
3575 * kjs/JSGlobalObject.h:
3576 (JSC::ExecState::dynamicGlobalObject): Moved here from ExecState for benefit of inlining.
3577 Return lexical global object if this is a globalExec(), otherwise look in JSGlobalData
3578 for the one stashed there.
3580 2008-10-05 Sam Weinig <sam@webkit.org>
3582 Reviewed by Maciej Stachowiak.
3584 Avoid an extra lookup when transitioning to an existing StructureID
3585 by caching the offset of property that caused the transition.
3587 1% win on V8 suite. Wash on SunSpider.
3589 * kjs/PropertyMap.cpp:
3590 (JSC::PropertyMap::put):
3591 * kjs/PropertyMap.h:
3592 * kjs/StructureID.cpp:
3593 (JSC::StructureID::StructureID):
3594 (JSC::StructureID::addPropertyTransition):
3595 * kjs/StructureID.h:
3596 (JSC::StructureID::setCachedTransistionOffset):
3597 (JSC::StructureID::cachedTransistionOffset):
3599 2008-10-05 Cameron Zwarich <zwarich@apple.com>
3601 Reviewed by Maciej Stachowiak.
3603 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
3604 <https://bugs.webkit.org/show_bug.cgi?id=21364>
3606 This patch does not yet remove the branch, but it does a bit of refactoring
3607 so that a CodeGenerator now knows whether the associated CodeBlock will need
3608 a full scope before doing any code generation. This makes it possible to emit
3609 explicit tear-off instructions before every op_ret.
3612 (JSC::CodeBlock::CodeBlock):
3613 * VM/CodeGenerator.cpp:
3614 (JSC::CodeGenerator::generate):
3615 (JSC::CodeGenerator::CodeGenerator):
3616 (JSC::CodeGenerator::emitPushScope):
3617 (JSC::CodeGenerator::emitPushNewScope):
3619 (JSC::ScopeNode::needsActivation):
3621 2008-10-05 Gavin Barraclough <barraclough@apple.com>
3623 Reviewed by Cameron Zwarich.
3625 Fix for bug #21387 - using SamplingTool with CTI.
3627 (1) A repatch offset offset changes due to an additional instruction to update SamplingTool state.
3628 (2) Fix an incusion order problem due to ExecState changes.
3629 (3) Change to a MACHINE_SAMPLING macro, use of exec should now be accessing global data.
3632 (JSC::CTI::execute):
3633 * VM/SamplingTool.h:
3634 (JSC::SamplingTool::privateExecuteReturned):
3637 2008-10-04 Mark Rowe <mrowe@apple.com>
3639 Reviewed by Tim Hatcher.
3641 Add a 'Check For Weak VTables' build phase to catch weak vtables as early as possible.
3643 * JavaScriptCore.xcodeproj/project.pbxproj:
3645 2008-10-04 Sam Weinig <sam@webkit.org>
3647 Reviewed by Oliver Hunt.
3649 Fix https://bugs.webkit.org/show_bug.cgi?id=21320
3650 leaks of PropertyNameArrayData seen on buildbot
3652 - Fix RefPtr cycle by making PropertyNameArrayData's pointer back
3653 to the StructureID a weak pointer.
3655 * kjs/PropertyNameArray.h:
3656 (JSC::PropertyNameArrayData::setCachedStructureID):
3657 (JSC::PropertyNameArrayData::cachedStructureID):
3658 * kjs/StructureID.cpp:
3659 (JSC::StructureID::getEnumerablePropertyNames):
3660 (JSC::StructureID::clearEnumerationCache):
3661 (JSC::StructureID::~StructureID):
3663 2008-10-04 Darin Adler <darin@apple.com>
3665 Reviewed by Cameron Zwarich.
3667 - https://bugs.webkit.org/show_bug.cgi?id=21295
3668 Bug 21295: Replace ExecState with a call frame Register pointer
3670 10% faster on Richards; other v8 benchmarks faster too.
3671 A wash on SunSpider.
3673 This does the minimum necessary to get the speedup. Next step in
3674 cleaning this up is to replace ExecState with a CallFrame class,
3675 and be more judicious about when to pass a call frame and when
3676 to pass a global data pointer, global object pointer, or perhaps
3677 something else entirely.
3679 * VM/CTI.cpp: Remove the debug-only check of the exception in
3680 ctiVMThrowTrampoline -- already checked in the code the trampoline
3681 jumps to, so not all that useful. Removed the exec argument from
3682 ctiTrampoline. Removed emitDebugExceptionCheck -- no longer needed.
3683 (JSC::CTI::emitCall): Removed code to set ExecState::m_callFrame.
3684 (JSC::CTI::privateCompileMainPass): Removed code in catch to extract
3685 the exception from ExecState::m_exception; instead, the code that
3686 jumps into catch will make sure the exception is already in eax.
3687 * VM/CTI.h: Removed exec from the ctiTrampoline. Also removed the
3688 non-helpful "volatile". Temporarily left ARG_exec in as a synonym
3689 for ARG_r; I'll change that on a future cleanup pass when introducing
3690 more use of the CallFrame type.
3691 (JSC::CTI::execute): Removed the ExecState* argument.
3693 * VM/ExceptionHelpers.cpp:
3694 (JSC::InterruptedExecutionError::InterruptedExecutionError): Take
3695 JSGlobalData* instead of ExecState*.
3696 (JSC::createInterruptedExecutionException): Ditto.
3697 * VM/ExceptionHelpers.h: Ditto. Also removed an unneeded include.
3700 (JSC::slideRegisterWindowForCall): Removed the exec and
3701 exceptionValue arguments. Changed to return 0 when there's a stack
3702 overflow rather than using a separate exception argument to cut
3703 down on memory accesses in the calling convention.
3704 (JSC::Machine::unwindCallFrame): Removed the exec argument when
3705 constructing a DebuggerCallFrame. Also removed code to set
3706 ExecState::m_callFrame.
3707 (JSC::Machine::throwException): Removed the exec argument when
3708 construction a DebuggerCallFrame.
3709 (JSC::Machine::execute): Updated to use the register instead of
3710 ExecState and also removed various uses of ExecState.
3711 (JSC::Machine::debug):
3712 (JSC::Machine::privateExecute): Put globalData into a local
3713 variable so it can be used throughout the interpreter. Changed
3714 the VM_CHECK_EXCEPTION to get the exception in globalData instead
3715 of through ExecState.
3716 (JSC::Machine::retrieveLastCaller): Turn exec into a registers
3717 pointer by calling registers() instead of by getting m_callFrame.
3718 (JSC::Machine::callFrame): Ditto.
3719 Tweaked exception macros. Made new versions for when you know
3720 you have an exception. Get at global exception with ARG_globalData.
3721 Got rid of the need to pass in the return value type.
3722 (JSC::Machine::cti_op_add): Update to use new version of exception
3724 (JSC::Machine::cti_op_pre_inc): Ditto.
3725 (JSC::Machine::cti_timeout_check): Ditto.
3726 (JSC::Machine::cti_op_instanceof): Ditto.
3727 (JSC::Machine::cti_op_new_func): Ditto.
3728 (JSC::Machine::cti_op_call_JSFunction): Optimized by using the
3729 ARG values directly instead of through local variables -- this gets
3730 rid of code that just shuffles things around in the stack frame.
3731 Also get rid of ExecState and update for the new way exceptions are
3732 handled in slideRegisterWindowForCall.
3733 (JSC::Machine::cti_vm_compile): Update to make exec out of r since
3734 they are both the same thing now.
3735 (JSC::Machine::cti_op_call_NotJSFunction): Ditto.
3736 (JSC::Machine::cti_op_init_arguments): Ditto.
3737 (JSC::Machine::cti_op_resolve): Ditto.
3738 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
3739 (JSC::Machine::cti_op_construct_NotJSConstruct): Ditto.
3740 (JSC::Machine::cti_op_resolve_func): Ditto.
3741 (JSC::Machine::cti_op_put_by_val): Ditto.
3742 (JSC::Machine::cti_op_put_by_val_array): Ditto.
3743 (JSC::Machine::cti_op_resolve_skip): Ditto.
3744 (JSC::Machine::cti_op_resolve_global): Ditto.
3745 (JSC::Machine::cti_op_post_inc): Ditto.
3746 (JSC::Machine::cti_op_resolve_with_base): Ditto.
3747 (JSC::Machine::cti_op_post_dec): Ditto.
3748 (JSC::Machine::cti_op_call_eval): Ditto.
3749 (JSC::Machine::cti_op_throw): Ditto. Also rearranged to return
3750 the exception value as the return value so it can be used by
3752 (JSC::Machine::cti_op_push_scope): Ditto.
3753 (JSC::Machine::cti_op_in): Ditto.
3754 (JSC::Machine::cti_op_del_by_val): Ditto.
3755 (JSC::Machine::cti_vm_throw): Ditto. Also rearranged to return
3756 the exception value as the return value so it can be used by
3759 * kjs/DebuggerCallFrame.cpp:
3760 (JSC::DebuggerCallFrame::functionName): Pass globalData.
3761 (JSC::DebuggerCallFrame::evaluate): Eliminated code to make a
3763 * kjs/DebuggerCallFrame.h: Removed ExecState argument from
3766 * kjs/ExecState.h: Eliminated all data members and made ExecState
3767 inherit privately from Register instead. Also added a typedef to
3768 the future name for this class, which is CallFrame. It's just a
3769 Register* that knows it's a pointer at a call frame. The new class
3770 can't be constructed or copied. Changed all functions to use
3771 the this pointer instead of m_callFrame. Changed exception-related
3772 functions to access an exception in JSGlobalData. Removed functions
3773 used by CTI to pass the return address to the throw machinery --
3774 this is now done directly with a global in the global data.
3776 * kjs/FunctionPrototype.cpp:
3777 (JSC::functionProtoFuncToString): Pass globalData instead of exec.
3779 * kjs/InternalFunction.cpp:
3780 (JSC::InternalFunction::name): Take globalData instead of exec.
3781 * kjs/InternalFunction.h: Ditto.
3783 * kjs/JSGlobalData.cpp: Initialize the new exception global to 0.
3784 * kjs/JSGlobalData.h: Declare two new globals. One for the current
3785 exception and another for the return address used by CTI to
3786 implement the throw operation.
3788 * kjs/JSGlobalObject.cpp:
3789 (JSC::JSGlobalObject::init): Removed code to set up globalExec,
3790 which is now the same thing as globalCallFrame.
3791 (JSC::JSGlobalObject::reset): Get globalExec from our globalExec
3792 function so we don't have to repeat the logic twice.
3793 (JSC::JSGlobalObject::mark): Removed code to mark the exception;
3794 the exception is now stored in JSGlobalData and marked there.
3795 (JSC::JSGlobalObject::globalExec): Return a pointer to the end
3796 of the global call frame.
3797 * kjs/JSGlobalObject.h: Removed the globalExec data member.
3800 (JSC::JSObject::putDirectFunction): Pass globalData instead of exec.
3802 * kjs/collector.cpp:
3803 (JSC::Heap::collect): Mark the global exception.
3805 * profiler/ProfileGenerator.cpp:
3806 (JSC::ProfileGenerator::addParentForConsoleStart): Pass globalData
3807 instead of exec to createCallIdentifier.
3809 * profiler/Profiler.cpp:
3810 (JSC::Profiler::willExecute): Pass globalData instead of exec to
3811 createCallIdentifier.
3812 (JSC::Profiler::didExecute): Ditto.
3813 (JSC::Profiler::createCallIdentifier): Take globalData instead of
3815 (JSC::createCallIdentifierFromFunctionImp): Ditto.
3816 * profiler/Profiler.h: Change interface to take a JSGlobalData
3817 instead of an ExecState.
3819 2008-10-04 Cameron Zwarich <zwarich@apple.com>
3821 Reviewed by Darin Adler.
3823 Bug 21369: Add opcode documentation for all undocumented opcodes
3824 <https://bugs.webkit.org/show_bug.cgi?id=21369>
3826 This patch adds opcode documentation for all undocumented opcodes, and
3827 it also renames op_init_arguments to op_create_arguments.
3830 (JSC::CTI::privateCompileMainPass):
3832 (JSC::CodeBlock::dump):
3833 * VM/CodeGenerator.cpp:
3834 (JSC::CodeGenerator::CodeGenerator):
3836 (JSC::Machine::privateExecute):
3837 (JSC::Machine::cti_op_create_arguments):
3841 2008-10-03 Maciej Stachowiak <mjs@apple.com>
3843 Reviewed by Cameron Zwarich.
3845 - "this" object in methods called on primitives should be wrapper object
3846 https://bugs.webkit.org/show_bug.cgi?id=21362
3848 I changed things so that functions which use "this" do a fast
3849 version of toThisObject conversion if needed. Currently we miss
3850 the conversion entirely, at least for primitive types. Using
3851 TypeInfo and the primitive check, I made the fast case bail out
3854 This is inexplicably an 1.007x SunSpider speedup (and a wash on V8 benchmarks).
3856 Also renamed some opcodes for clarity:
3859 init_activation ==> enter_with_activation
3862 (JSC::CTI::privateCompileMainPass):
3863 (JSC::CTI::privateCompileSlowCases):
3865 (JSC::CodeBlock::dump):
3866 * VM/CodeGenerator.cpp:
3867 (JSC::CodeGenerator::generate):
3868 (JSC::CodeGenerator::CodeGenerator):
3870 (JSC::Machine::privateExecute):
3871 (JSC::Machine::cti_op_convert_this):
3874 * kjs/JSActivation.cpp:
3875 (JSC::JSActivation::JSActivation):
3876 * kjs/JSActivation.h:
3877 (JSC::JSActivation::createStructureID):
3879 (JSC::JSValue::needsThisConversion):
3880 * kjs/JSGlobalData.cpp:
3881 (JSC::JSGlobalData::JSGlobalData):
3882 * kjs/JSGlobalData.h:
3883 * kjs/JSNumberCell.h:
3884 (JSC::JSNumberCell::createStructureID):
3885 * kjs/JSStaticScopeObject.h:
3886 (JSC::JSStaticScopeObject::JSStaticScopeObject):
3887 (JSC::JSStaticScopeObject::createStructureID):
3889 (JSC::JSString::createStructureID):
3892 (JSC::TypeInfo::needsThisConversion):
3894 (JSC::ScopeNode::usesThis):
3896 2008-10-03 Cameron Zwarich <zwarich@apple.com>
3898 Reviewed by Maciej Stachowiak.
3900 Bug 21356: The size of the RegisterFile differs depending on 32-bit / 64-bit and Debug / Release
3901 <https://bugs.webkit.org/show_bug.cgi?id=21356>
3903 The RegisterFile decreases in size (measured in terms of numbers of
3904 Registers) as the size of a Register increases. This causes
3906 js1_5/Regress/regress-159334.js
3908 to fail in 64-bit debug builds. This fix makes the RegisterFile on all
3909 platforms the same size that it is in 32-bit Release builds.
3911 * VM/RegisterFile.h:
3912 (JSC::RegisterFile::RegisterFile):
3914 2008-10-03 Maciej Stachowiak <mjs@apple.com>
3916 Reviewed by Cameron Zwarich.
3918 - Some code cleanup to how we handle code features.
3920 1) Rename FeatureInfo typedef to CodeFeatures.
3921 2) Rename NodeFeatureInfo template to NodeInfo.
3922 3) Keep CodeFeature bitmask in ScopeNode instead of trying to break it out into individual bools.
3923 4) Rename misleadingly named "needsClosure" method to "containsClosures", which better describes the meaning
3925 5) Make setUsersArguments() not take an argument since it only goes one way.
3927 * JavaScriptCore.exp:
3929 (JSC::CodeBlock::CodeBlock):
3932 (JSC::Parser::didFinishParsing):
3934 (JSC::Parser::parse):
3937 (JSC::ScopeNode::ScopeNode):
3938 (JSC::ProgramNode::ProgramNode):
3939 (JSC::ProgramNode::create):
3940 (JSC::EvalNode::EvalNode):
3941 (JSC::EvalNode::create):
3942 (JSC::FunctionBodyNode::FunctionBodyNode):
3943 (JSC::FunctionBodyNode::create):
3945 (JSC::ScopeNode::usesEval):
3946 (JSC::ScopeNode::containsClosures):
3947 (JSC::ScopeNode::usesArguments):
3948 (JSC::ScopeNode::setUsesArguments):
3950 2008-10-03 Cameron Zwarich <zwarich@apple.com>
3952 Reviewed by Maciej Stachowiak.
3954 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit
3955 <https://bugs.webkit.org/show_bug.cgi?id=21343>
3957 A fix was landed for this issue in r37253, and the ChangeLog assumes
3958 that it is a compiler bug, but it turns out that it is a subtle issue
3959 with mixing signed and unsigned 32-bit values in a 64-bit environment.
3960 In order to properly fix this bug, we should convert our signed offsets
3961 into the register file to use ptrdiff_t.
3963 This may not be the only instance of this issue, but I will land this
3964 fix first and look for more later.
3967 (JSC::Machine::getArgumentsData):
3969 * kjs/Arguments.cpp:
3970 (JSC::Arguments::getOwnPropertySlot):
3972 (JSC::Arguments::init):
3974 2008-10-03 Darin Adler <darin@apple.com>
3976 * VM/CTI.cpp: Another Windows build fix. Change the args of ctiTrampoline.
3978 * kjs/JSNumberCell.h: A build fix for newer versions of gcc. Added
3979 declarations of JSGlobalData overloads of jsNumberCell.
3981 2008-10-03 Darin Adler <darin@apple.com>
3983 - try to fix Windows build
3985 * kjs/ScopeChain.h: Add forward declaration of JSGlobalData.
3987 2008-10-03 Darin Adler <darin@apple.com>
3989 Reviewed by Geoff Garen.
3991 - next step of https://bugs.webkit.org/show_bug.cgi?id=21295
3992 Turn ExecState into a call frame pointer.
3994 Remove m_globalObject and m_globalData from ExecState.
3996 SunSpider says this is a wash (slightly faster but not statistically
3997 significant); which is good enough since it's a preparation step and
3998 not supposed to be a spedup.
4000 * API/JSCallbackFunction.cpp:
4001 (JSC::JSCallbackFunction::JSCallbackFunction):
4002 * kjs/ArrayConstructor.cpp:
4003 (JSC::ArrayConstructor::ArrayConstructor):
4004 * kjs/BooleanConstructor.cpp:
4005 (JSC::BooleanConstructor::BooleanConstructor):
4006 * kjs/DateConstructor.cpp:
4007 (JSC::DateConstructor::DateConstructor):
4008 * kjs/ErrorConstructor.cpp:
4009 (JSC::ErrorConstructor::ErrorConstructor):
4010 * kjs/FunctionPrototype.cpp:
4011 (JSC::FunctionPrototype::FunctionPrototype):
4012 * kjs/JSFunction.cpp:
4013 (JSC::JSFunction::JSFunction):
4014 * kjs/NativeErrorConstructor.cpp:
4015 (JSC::NativeErrorConstructor::NativeErrorConstructor):
4016 * kjs/NumberConstructor.cpp:
4017 (JSC::NumberConstructor::NumberConstructor):
4018 * kjs/ObjectConstructor.cpp:
4019 (JSC::ObjectConstructor::ObjectConstructor):
4020 * kjs/PrototypeFunction.cpp:
4021 (JSC::PrototypeFunction::PrototypeFunction):
4022 * kjs/RegExpConstructor.cpp:
4023 (JSC::RegExpConstructor::RegExpConstructor):
4024 * kjs/StringConstructor.cpp:
4025 (JSC::StringConstructor::StringConstructor):
4026 Pass JSGlobalData* instead of ExecState* to the InternalFunction
4029 * API/OpaqueJSString.cpp: Added now-needed include.
4031 * JavaScriptCore.exp: Updated.
4034 (JSC::CTI::emitSlowScriptCheck): Changed to use ARGS_globalData
4035 instead of ARGS_exec.
4037 * VM/CTI.h: Added a new argument to the CTI, the global data pointer.
4038 While it's possible to get to the global data pointer using the
4039 ExecState pointer, it's slow enough that it's better to just keep
4040 it around in the CTI arguments.
4042 * VM/CodeBlock.h: Moved the CodeType enum here from ExecState.h.
4045 (JSC::Machine::execute): Pass fewer arguments when constructing
4046 ExecState, and pass the global data pointer when invoking CTI.
4047 (JSC::Machine::firstCallFrame): Added. Used to get the dynamic global
4048 object, which is in the scope chain of the first call frame.
4049 (JSC::Machine::cti_op_add): Use globalData instead of exec when
4050 possible, to keep fast cases fast, since it's now more expensive to
4051 get to it through the exec pointer.
4052 (JSC::Machine::cti_timeout_check): Ditto.
4053 (JSC::Machine::cti_op_put_by_id_second): Ditto.
4054 (JSC::Machine::cti_op_get_by_id_second): Ditto.
4055 (JSC::Machine::cti_op_mul): Ditto.
4056 (JSC::Machine::cti_vm_compile): Ditto.
4057 (JSC::Machine::cti_op_get_by_val): Ditto.
4058 (JSC::Machine::cti_op_sub): Ditto.
4059 (JSC::Machine::cti_op_put_by_val): Ditto.
4060 (JSC::Machine::cti_op_put_by_val_array): Ditto.
4061 (JSC::Machine::cti_op_negate): Ditto.
4062 (JSC::Machine::cti_op_div): Ditto.
4063 (JSC::Machine::cti_op_pre_dec): Ditto.
4064 (JSC::Machine::cti_op_post_inc): Ditto.
4065 (JSC::Machine::cti_op_lshift): Ditto.
4066 (JSC::Machine::cti_op_bitand): Ditto.
4067 (JSC::Machine::cti_op_rshift): Ditto.
4068 (JSC::Machine::cti_op_bitnot): Ditto.
4069 (JSC::Machine::cti_op_mod): Ditto.
4070 (JSC::Machine::cti_op_post_dec): Ditto.
4071 (JSC::Machine::cti_op_urshift): Ditto.
4072 (JSC::Machine::cti_op_bitxor): Ditto.
4073 (JSC::Machine::cti_op_bitor): Ditto.
4074 (JSC::Machine::cti_op_call_eval): Ditto.
4075 (JSC::Machine::cti_op_throw): Ditto.
4076 (JSC::Machine::cti_op_is_string): Ditto.
4077 (JSC::Machine::cti_op_debug): Ditto.
4078 (JSC::Machine::cti_vm_throw): Ditto.
4080 * VM/Machine.h: Added firstCallFrame.
4082 * kjs/DebuggerCallFrame.cpp:
4083 (JSC::DebuggerCallFrame::evaluate): Pass fewer arguments when
4084 constructing ExecState.
4086 * kjs/ExecState.cpp: Deleted contents. Later we'll remove the
4089 * kjs/ExecState.h: Removed m_globalObject and m_globalData.
4090 Moved CodeType into another header.
4091 (JSC::ExecState::ExecState): Take only a single argument, a
4093 (JSC::ExecState::dynamicGlobalObject): Get the object from
4094 the first call frame since it's no longer stored.
4095 (JSC::ExecState::globalData): Get the global data from the
4096 scope chain, since we no longer store a pointer to it here.
4097 (JSC::ExecState::identifierTable): Ditto.
4098 (JSC::ExecState::propertyNames): Ditto.
4099 (JSC::ExecState::emptyList): Ditto.
4100 (JSC::ExecState::lexer): Ditto.
4101 (JSC::ExecState::parser): Ditto.
4102 (JSC::ExecState::machine): Ditto.
4103 (JSC::ExecState::arrayTable): Ditto.
4104 (JSC::ExecState::dateTable): Ditto.
4105 (JSC::ExecState::mathTable): Ditto.
4106 (JSC::ExecState::numberTable): Ditto.
4107 (JSC::ExecState::regExpTable): Ditto.
4108 (JSC::ExecState::regExpConstructorTable): Ditto.
4109 (JSC::ExecState::stringTable): Ditto.
4110 (JSC::ExecState::heap): Ditto.
4112 * kjs/FunctionConstructor.cpp:
4113 (JSC::FunctionConstructor::FunctionConstructor): Pass
4114 JSGlobalData* instead of ExecState* to the InternalFunction
4116 (JSC::constructFunction): Pass the global data pointer when
4117 constructing a new scope chain.
4119 * kjs/InternalFunction.cpp:
4120 (JSC::InternalFunction::InternalFunction): Take a JSGlobalData*
4121 instead of an ExecState*. Later we can change more places to
4122 work this way -- it's more efficient to take the type you need
4123 since the caller might already have it.
4124 * kjs/InternalFunction.h: Ditto.
4127 (JSC::JSCell::operator new): Added an overload that takes a