1 2008-10-17 Maciej Stachowiak <mjs@apple.com>
3 Reviewed by Cameron Zwarich
5 - don't bother to do arguments tearoff when it will have no effect
9 * VM/CodeGenerator.cpp:
10 (JSC::CodeGenerator::emitReturn):
12 2008-10-17 Marco Barisione <marco.barisione@collabora.co.uk>
14 Reviewed by Sam Weinig. Landed by Jan Alonzo.
16 https://bugs.webkit.org/show_bug.cgi?id=21603
17 [GTK] Minor fixes to GOwnPtr
28 (WTF::GOwnPtr::~GOwnPtr):
29 (WTF::GOwnPtr::outPtr):
31 (WTF::GOwnPtr::clear):
34 2008-10-17 Maciej Stachowiak <mjs@apple.com>
36 Reviewed by Cameron Zwarich.
38 - speed up transitions that resize the property storage a fair bit
40 ~3% speedup on v8 RayTrace benchmark, ~1% on DeltaBlue
43 (JSC::resizePropertyStorage): renamed from transitionObject, and reduced to just resize
44 the object's property storage with one inline call.
45 (JSC::CTI::privateCompilePutByIdTransition): Use a separate function for property storage
46 resize, but still do all the rest of the work in assembly in that case, and pass the known
47 compile-time constants of old and new size rather than structureIDs, saving a bunch of
48 redundant memory access.
50 (JSC::JSObject::allocatePropertyStorage): Just call the inline version.
52 (JSC::JSObject::allocatePropertyStorageInline): Inline version of allocatePropertyStorage
53 * masm/X86Assembler.h:
54 (JSC::X86Assembler::):
55 (JSC::X86Assembler::pushl_i32): Add code to assmeble push of a constant; code originally by Cameron Zwarich.
57 2008-10-17 Cameron Zwarich <zwarich@apple.com>
59 Reviewed by Maciej Stachowiak.
61 Remove some C style casts.
63 * masm/X86Assembler.h:
64 (JSC::JITCodeBuffer::putIntUnchecked):
65 (JSC::X86Assembler::link):
66 (JSC::X86Assembler::linkAbsoluteAddress):
67 (JSC::X86Assembler::getRelocatedAddress):
69 2008-10-17 Cameron Zwarich <zwarich@apple.com>
71 Rubber-stamped by Maciej Stachowiak.
73 Remove some C style casts.
76 (JSC::CTI::patchGetByIdSelf):
77 (JSC::CTI::patchPutByIdReplace):
79 (JSC::Machine::tryCTICachePutByID):
80 (JSC::Machine::tryCTICacheGetByID):
81 (JSC::Machine::cti_op_put_by_id):
82 (JSC::Machine::cti_op_put_by_id_fail):
83 (JSC::Machine::cti_op_get_by_id):
84 (JSC::Machine::cti_op_get_by_id_fail):
86 2008-10-17 Maciej Stachowiak <mjs@apple.com>
88 Reviewed by Cameron Zwarich.
90 - Avoid restoring the caller's 'r' value in op_ret
91 https://bugs.webkit.org/show_bug.cgi?id=21319
93 This patch stops writing the call frame at call and return points;
94 instead it does so immediately before any CTI call.
96 0.5% speedup or so on the v8 benchmark
99 (JSC::CTI::emitCTICall):
100 (JSC::CTI::compileOpCall):
101 (JSC::CTI::emitSlowScriptCheck):
102 (JSC::CTI::compileBinaryArithOpSlowCase):
103 (JSC::CTI::privateCompileMainPass):
104 (JSC::CTI::privateCompileSlowCases):
105 (JSC::CTI::privateCompile):
108 2008-10-17 Cameron Zwarich <zwarich@apple.com>
110 Reviewed by Sam Weinig.
112 Make WREC require CTI because it won't actually compile otherwise.
116 2008-10-16 Maciej Stachowiak <mjs@apple.com>
118 Reviewed by Geoff Garen.
120 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
121 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
123 This time there is no performance regression; we can avoid having
124 to use the fastcall calling convention for CTI functions by using
125 varargs to prevent the compiler from moving things around on the
128 * Configurations/DebugRelease.xcconfig:
129 * JavaScriptCore.xcodeproj/project.pbxproj:
134 2008-10-16 Maciej Stachowiak <mjs@apple.com>
136 Reviewed by Oliver Hunt.
138 - fix for REGRESSION: r37631 causing crashes on buildbot
139 https://bugs.webkit.org/show_bug.cgi?id=21682
142 (JSC::Heap::collect): Avoid crashing when a GC occurs while no global objects are live.
144 2008-10-16 Sam Weinig <sam@webkit.org>
146 Reviewed by Maciej Stachowiak.
148 Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
149 Don't create intermediate StructureIDs for builtin objects
151 First step in reduce number of StructureIDs created when initializing the
154 - In order to avoid creating the intermediate StructureIDs use the new putDirectWithoutTransition
155 and putDirectFunctionWithoutTransition to add properties to JSObjects without transitioning
156 the StructureID. This patch just implements this strategy for ObjectPrototype but alone
157 reduces the number of StructureIDs create for about:blank by 10, from 142 to 132.
159 * kjs/JSGlobalObject.cpp:
160 (JSC::JSGlobalObject::reset):
162 (JSC::JSObject::putDirectFunctionWithoutTransition):
164 (JSC::JSObject::putDirectWithoutTransition):
165 * kjs/ObjectPrototype.cpp:
166 (JSC::ObjectPrototype::ObjectPrototype):
167 * kjs/ObjectPrototype.h:
168 * kjs/StructureID.cpp:
169 (JSC::StructureID::addPropertyWithoutTransition):
172 2008-10-16 Maciej Stachowiak <mjs@apple.com>
174 Reviewed by Cameron Zwarich.
176 - fix for: REGRESSION: over 100 StructureIDs leak loading about:blank (result of fix for bug 21633)
178 Apparent slight progression (< 0.5%) on v8 benchmarks and SunSpider.
180 * kjs/StructureID.cpp:
181 (JSC::StructureID::~StructureID): Don't deref this object's parent's pointer to
182 itself from the destructor; that doesn't even make sense.
183 (JSC::StructureID::addPropertyTransition): Don't refer the single transition;
184 the rule is that parent StructureIDs are ref'd but child ones are not. Refing
185 the child creates a cycle.
187 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
189 Reviewed by Darin Adler.
191 https://bugs.webkit.org/show_bug.cgi?id=21609
192 Make MessagePorts protect their peers across heaps
194 * JavaScriptCore.exp:
195 * kjs/JSGlobalObject.cpp:
196 (JSC::JSGlobalObject::markCrossHeapDependentObjects):
197 * kjs/JSGlobalObject.h:
199 (JSC::Heap::collect):
200 Before GC sweep phase, a function supplied by global object is now called for all global
201 objects in the heap, making it possible to implement cross-heap dependencies.
203 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
205 Reviewed by Darin Adler.
207 https://bugs.webkit.org/show_bug.cgi?id=21610
208 run-webkit-threads --threaded crashes in StructureID destructor
210 * kjs/StructureID.cpp:
211 (JSC::StructureID::StructureID):
212 (JSC::StructureID::~StructureID):
213 Protect access to a static (debug-only) HashSet with a lock.
215 2008-10-15 Sam Weinig <sam@webkit.org>
217 Reviewed by Goeffrey Garen.
219 Add function to dump statistics for StructureIDs.
221 * kjs/StructureID.cpp:
222 (JSC::StructureID::dumpStatistics):
223 (JSC::StructureID::StructureID):
224 (JSC::StructureID::~StructureID):
227 2008-10-15 Cameron Zwarich <zwarich@apple.com>
229 Reviewed by Maciej Stachowiak.
231 Bug 21633: Avoid using a HashMap when there is only a single transition
232 <https://bugs.webkit.org/show_bug.cgi?id=21633>
234 This is a 0.8% speedup on SunSpider and between a 0.5% and 1.0% speedup
235 on the V8 benchmark suite, depending on which harness we use. It will
236 also slightly reduce the memory footprint of a StructureID.
238 * kjs/StructureID.cpp:
239 (JSC::StructureID::StructureID):
240 (JSC::StructureID::~StructureID):
241 (JSC::StructureID::addPropertyTransition):
243 (JSC::StructureID::):
245 2008-10-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
247 Reviewed by Geoffrey Garen.
249 1.40% speedup on SunSpider, 1.44% speedup on V8. (Linux)
254 (JSC::fastIsNumber): ALWAYS_INLINE modifier added.
256 2008-10-15 Geoffrey Garen <ggaren@apple.com>
258 Reviewed by Cameron Zwarich.
260 Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
261 Start the debugger without reloading the inspected page
263 * JavaScriptCore.exp: New symbols.
264 * JavaScriptCore.xcodeproj/project.pbxproj: New files.
267 (JSC::EvalCodeCache::get): Updated for tweak to parsing API.
269 * kjs/CollectorHeapIterator.h: Added. An iterator for the object heap,
270 which we use to find all the live functions and recompile them.
272 * kjs/DebuggerCallFrame.cpp:
273 (JSC::DebuggerCallFrame::evaluate): Updated for tweak to parsing API.
275 * kjs/FunctionConstructor.cpp:
276 (JSC::constructFunction): Updated for tweak to parsing API.
278 * kjs/JSFunction.cpp:
279 (JSC::JSFunction::JSFunction): Try to validate our SourceCode in debug
280 builds by ASSERTing that it's syntactically valid. This doesn't catch
281 all SourceCode bugs, but it catches a lot of them.
283 * kjs/JSGlobalObjectFunctions.cpp:
284 (JSC::globalFuncEval): Updated for tweak to parsing API.
287 (JSC::Parser::parse):
289 (JSC::Parser::parse): Tweaked the parser to make it possible to parse
290 without an ExecState, and to allow the client to specify a debugger to
291 notify (or not) about the source we parse. This allows the inspector
292 to recompile even though no JavaScript is executing, then notify the
293 debugger about all source code when it's done.
296 (prettyPrintScript): Updated for tweak to parsing API.
299 (JSC::SourceCode::isNull): Added to help with ASSERTs.
302 (JSC::Heap::heapAllocate):
304 (JSC::Heap::primaryHeapBegin):
305 (JSC::Heap::primaryHeapEnd):
307 (JSC::): Moved a bunch of declarations around to enable compilation of
308 CollectorHeapIterator.
310 * kjs/interpreter.cpp:
311 (JSC::Interpreter::checkSyntax):
312 (JSC::Interpreter::evaluate): Updated for tweak to parsing API.
315 (JSC::Lexer::sourceCode): BUG FIX: Calculate SourceCode ranges relative
316 to the SourceCode range in which we're lexing, otherwise nested functions
317 that are compiled individually get SourceCode ranges that don't reflect
321 (JSC::FunctionBodyNode::FunctionBodyNode):
322 (JSC::FunctionBodyNode::finishParsing):
323 (JSC::FunctionBodyNode::create):
324 (JSC::FunctionBodyNode::copyParameters):
326 (JSC::ScopeNode::setSource):
327 (JSC::FunctionBodyNode::parameterCount): Added some helper functions for
328 copying one FunctionBodyNode's parameters to another. The recompiler uses
329 these when calling "finishParsing".
331 2008-10-15 Joerg Bornemann <joerg.bornemann@trolltech.com>
333 Reviewed by Darin Adler.
335 - part of https://bugs.webkit.org/show_bug.cgi?id=20746
336 Fix compilation on Windows CE.
338 str(n)icmp, strdup and vsnprintf are not available on Windows CE,
339 they are called _str(n)icmp, etc. instead
341 * wtf/StringExtras.h: Added inline function implementations.
343 2008-10-15 Gabor Loki <loki@inf.u-szeged.hu>
345 Reviewed by Cameron Zwarich.
347 <https://bugs.webkit.org/show_bug.cgi?id=20912>
348 Use simple uint32_t multiplication on op_mul if both operands are
349 immediate number and they are between zero and 0x7FFF.
352 (JSC::Machine::privateExecute):
354 2008-10-09 Darin Fisher <darin@chromium.org>
356 Reviewed by Sam Weinig.
358 Make pan scrolling a platform configurable option.
359 https://bugs.webkit.org/show_bug.cgi?id=21515
361 * wtf/Platform.h: Add ENABLE_PAN_SCROLLING
363 2008-10-14 Maciej Stachowiak <mjs@apple.com>
365 Rubber stamped by Sam Weinig.
367 - revert r37572 and r37581 for now
369 Turns out GCC 4.2 is still a (small) regression, we'll have to do
370 more work to turn it on.
372 * Configurations/DebugRelease.xcconfig:
373 * JavaScriptCore.xcodeproj/project.pbxproj:
377 (JSC::Machine::cti_op_convert_this):
378 (JSC::Machine::cti_op_end):
379 (JSC::Machine::cti_op_add):
380 (JSC::Machine::cti_op_pre_inc):
381 (JSC::Machine::cti_timeout_check):
382 (JSC::Machine::cti_register_file_check):
383 (JSC::Machine::cti_op_loop_if_less):
384 (JSC::Machine::cti_op_loop_if_lesseq):
385 (JSC::Machine::cti_op_new_object):
386 (JSC::Machine::cti_op_put_by_id):
387 (JSC::Machine::cti_op_put_by_id_second):
388 (JSC::Machine::cti_op_put_by_id_generic):
389 (JSC::Machine::cti_op_put_by_id_fail):
390 (JSC::Machine::cti_op_get_by_id):
391 (JSC::Machine::cti_op_get_by_id_second):
392 (JSC::Machine::cti_op_get_by_id_generic):
393 (JSC::Machine::cti_op_get_by_id_fail):
394 (JSC::Machine::cti_op_instanceof):
395 (JSC::Machine::cti_op_del_by_id):
396 (JSC::Machine::cti_op_mul):
397 (JSC::Machine::cti_op_new_func):
398 (JSC::Machine::cti_op_call_JSFunction):
399 (JSC::Machine::cti_vm_compile):
400 (JSC::Machine::cti_op_push_activation):
401 (JSC::Machine::cti_op_call_NotJSFunction):
402 (JSC::Machine::cti_op_create_arguments):
403 (JSC::Machine::cti_op_tear_off_activation):
404 (JSC::Machine::cti_op_tear_off_arguments):
405 (JSC::Machine::cti_op_ret_profiler):
406 (JSC::Machine::cti_op_ret_scopeChain):
407 (JSC::Machine::cti_op_new_array):
408 (JSC::Machine::cti_op_resolve):
409 (JSC::Machine::cti_op_construct_JSConstruct):
410 (JSC::Machine::cti_op_construct_NotJSConstruct):
411 (JSC::Machine::cti_op_get_by_val):
412 (JSC::Machine::cti_op_resolve_func):
413 (JSC::Machine::cti_op_sub):
414 (JSC::Machine::cti_op_put_by_val):
415 (JSC::Machine::cti_op_put_by_val_array):
416 (JSC::Machine::cti_op_lesseq):
417 (JSC::Machine::cti_op_loop_if_true):
418 (JSC::Machine::cti_op_negate):
419 (JSC::Machine::cti_op_resolve_base):
420 (JSC::Machine::cti_op_resolve_skip):
421 (JSC::Machine::cti_op_resolve_global):
422 (JSC::Machine::cti_op_div):
423 (JSC::Machine::cti_op_pre_dec):
424 (JSC::Machine::cti_op_jless):
425 (JSC::Machine::cti_op_not):
426 (JSC::Machine::cti_op_jtrue):
427 (JSC::Machine::cti_op_post_inc):
428 (JSC::Machine::cti_op_eq):
429 (JSC::Machine::cti_op_lshift):
430 (JSC::Machine::cti_op_bitand):
431 (JSC::Machine::cti_op_rshift):
432 (JSC::Machine::cti_op_bitnot):
433 (JSC::Machine::cti_op_resolve_with_base):
434 (JSC::Machine::cti_op_new_func_exp):
435 (JSC::Machine::cti_op_mod):
436 (JSC::Machine::cti_op_less):
437 (JSC::Machine::cti_op_neq):
438 (JSC::Machine::cti_op_post_dec):
439 (JSC::Machine::cti_op_urshift):
440 (JSC::Machine::cti_op_bitxor):
441 (JSC::Machine::cti_op_new_regexp):
442 (JSC::Machine::cti_op_bitor):
443 (JSC::Machine::cti_op_call_eval):
444 (JSC::Machine::cti_op_throw):
445 (JSC::Machine::cti_op_get_pnames):
446 (JSC::Machine::cti_op_next_pname):
447 (JSC::Machine::cti_op_push_scope):
448 (JSC::Machine::cti_op_pop_scope):
449 (JSC::Machine::cti_op_typeof):
450 (JSC::Machine::cti_op_is_undefined):
451 (JSC::Machine::cti_op_is_boolean):
452 (JSC::Machine::cti_op_is_number):
453 (JSC::Machine::cti_op_is_string):
454 (JSC::Machine::cti_op_is_object):
455 (JSC::Machine::cti_op_is_function):
456 (JSC::Machine::cti_op_stricteq):
457 (JSC::Machine::cti_op_nstricteq):
458 (JSC::Machine::cti_op_to_jsnumber):
459 (JSC::Machine::cti_op_in):
460 (JSC::Machine::cti_op_push_new_scope):
461 (JSC::Machine::cti_op_jmp_scopes):
462 (JSC::Machine::cti_op_put_by_index):
463 (JSC::Machine::cti_op_switch_imm):
464 (JSC::Machine::cti_op_switch_char):
465 (JSC::Machine::cti_op_switch_string):
466 (JSC::Machine::cti_op_del_by_val):
467 (JSC::Machine::cti_op_put_getter):
468 (JSC::Machine::cti_op_put_setter):
469 (JSC::Machine::cti_op_new_error):
470 (JSC::Machine::cti_op_debug):
471 (JSC::Machine::cti_vm_throw):
473 * masm/X86Assembler.h:
474 (JSC::X86Assembler::emitRestoreArgumentReference):
475 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
478 2008-10-14 Alexey Proskuryakov <ap@webkit.org>
480 Reviewed by Darin Adler.
482 https://bugs.webkit.org/show_bug.cgi?id=20256
483 Array.push and other standard methods disappear
485 * kjs/JSGlobalData.cpp:
486 (JSC::JSGlobalData::JSGlobalData):
487 (JSC::JSGlobalData::~JSGlobalData):
488 Don't use static hash tables even on platforms that don't enable JSC_MULTIPLE_THREADS -
489 these tables reference IdentifierTable, which is always per-GlobalData.
491 2008-10-14 Maciej Stachowiak <mjs@apple.com>
493 Reviewed by Cameron Zwarich.
495 - always use CTI_ARGUMENTS and CTI_ARGUMENTS_FASTCALL
497 This is a small regression for GCC 4.0, but simplifies the code
498 for future improvements and lets us focus on GCC 4.2+ and MSVC.
503 (JSC::Machine::cti_op_convert_this):
504 (JSC::Machine::cti_op_end):
505 (JSC::Machine::cti_op_add):
506 (JSC::Machine::cti_op_pre_inc):
507 (JSC::Machine::cti_timeout_check):
508 (JSC::Machine::cti_register_file_check):
509 (JSC::Machine::cti_op_loop_if_less):
510 (JSC::Machine::cti_op_loop_if_lesseq):
511 (JSC::Machine::cti_op_new_object):
512 (JSC::Machine::cti_op_put_by_id):
513 (JSC::Machine::cti_op_put_by_id_second):
514 (JSC::Machine::cti_op_put_by_id_generic):
515 (JSC::Machine::cti_op_put_by_id_fail):
516 (JSC::Machine::cti_op_get_by_id):
517 (JSC::Machine::cti_op_get_by_id_second):
518 (JSC::Machine::cti_op_get_by_id_generic):
519 (JSC::Machine::cti_op_get_by_id_fail):
520 (JSC::Machine::cti_op_instanceof):
521 (JSC::Machine::cti_op_del_by_id):
522 (JSC::Machine::cti_op_mul):
523 (JSC::Machine::cti_op_new_func):
524 (JSC::Machine::cti_op_call_JSFunction):
525 (JSC::Machine::cti_vm_compile):
526 (JSC::Machine::cti_op_push_activation):
527 (JSC::Machine::cti_op_call_NotJSFunction):
528 (JSC::Machine::cti_op_create_arguments):
529 (JSC::Machine::cti_op_tear_off_activation):
530 (JSC::Machine::cti_op_tear_off_arguments):
531 (JSC::Machine::cti_op_ret_profiler):
532 (JSC::Machine::cti_op_ret_scopeChain):
533 (JSC::Machine::cti_op_new_array):
534 (JSC::Machine::cti_op_resolve):
535 (JSC::Machine::cti_op_construct_JSConstruct):
536 (JSC::Machine::cti_op_construct_NotJSConstruct):
537 (JSC::Machine::cti_op_get_by_val):
538 (JSC::Machine::cti_op_resolve_func):
539 (JSC::Machine::cti_op_sub):
540 (JSC::Machine::cti_op_put_by_val):
541 (JSC::Machine::cti_op_put_by_val_array):
542 (JSC::Machine::cti_op_lesseq):
543 (JSC::Machine::cti_op_loop_if_true):
544 (JSC::Machine::cti_op_negate):
545 (JSC::Machine::cti_op_resolve_base):
546 (JSC::Machine::cti_op_resolve_skip):
547 (JSC::Machine::cti_op_resolve_global):
548 (JSC::Machine::cti_op_div):
549 (JSC::Machine::cti_op_pre_dec):
550 (JSC::Machine::cti_op_jless):
551 (JSC::Machine::cti_op_not):
552 (JSC::Machine::cti_op_jtrue):
553 (JSC::Machine::cti_op_post_inc):
554 (JSC::Machine::cti_op_eq):
555 (JSC::Machine::cti_op_lshift):
556 (JSC::Machine::cti_op_bitand):
557 (JSC::Machine::cti_op_rshift):
558 (JSC::Machine::cti_op_bitnot):
559 (JSC::Machine::cti_op_resolve_with_base):
560 (JSC::Machine::cti_op_new_func_exp):
561 (JSC::Machine::cti_op_mod):
562 (JSC::Machine::cti_op_less):
563 (JSC::Machine::cti_op_neq):
564 (JSC::Machine::cti_op_post_dec):
565 (JSC::Machine::cti_op_urshift):
566 (JSC::Machine::cti_op_bitxor):
567 (JSC::Machine::cti_op_new_regexp):
568 (JSC::Machine::cti_op_bitor):
569 (JSC::Machine::cti_op_call_eval):
570 (JSC::Machine::cti_op_throw):
571 (JSC::Machine::cti_op_get_pnames):
572 (JSC::Machine::cti_op_next_pname):
573 (JSC::Machine::cti_op_push_scope):
574 (JSC::Machine::cti_op_pop_scope):
575 (JSC::Machine::cti_op_typeof):
576 (JSC::Machine::cti_op_is_undefined):
577 (JSC::Machine::cti_op_is_boolean):
578 (JSC::Machine::cti_op_is_number):
579 (JSC::Machine::cti_op_is_string):
580 (JSC::Machine::cti_op_is_object):
581 (JSC::Machine::cti_op_is_function):
582 (JSC::Machine::cti_op_stricteq):
583 (JSC::Machine::cti_op_nstricteq):
584 (JSC::Machine::cti_op_to_jsnumber):
585 (JSC::Machine::cti_op_in):
586 (JSC::Machine::cti_op_push_new_scope):
587 (JSC::Machine::cti_op_jmp_scopes):
588 (JSC::Machine::cti_op_put_by_index):
589 (JSC::Machine::cti_op_switch_imm):
590 (JSC::Machine::cti_op_switch_char):
591 (JSC::Machine::cti_op_switch_string):
592 (JSC::Machine::cti_op_del_by_val):
593 (JSC::Machine::cti_op_put_getter):
594 (JSC::Machine::cti_op_put_setter):
595 (JSC::Machine::cti_op_new_error):
596 (JSC::Machine::cti_op_debug):
597 (JSC::Machine::cti_vm_throw):
599 * masm/X86Assembler.h:
600 (JSC::X86Assembler::emitRestoreArgumentReference):
601 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
604 2008-10-13 Maciej Stachowiak <mjs@apple.com>
606 Reviewed by Cameron Zwarich.
608 - make Machine::getArgumentsData an Arguments method and inline it
614 (JSC::Machine::getArgumentsData):
616 2008-10-13 Alp Toker <alp@nuanti.com>
618 Fix autotools dist build target by listing recently added header
619 files only. Not reviewed.
623 2008-10-13 Maciej Stachowiak <mjs@apple.com>
625 Rubber stamped by Mark Rowe.
627 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
628 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
630 * Configurations/DebugRelease.xcconfig:
631 * JavaScriptCore.xcodeproj/project.pbxproj:
633 2008-10-13 Cameron Zwarich <zwarich@apple.com>
635 Reviewed by Geoff Garen.
637 Bug 21541: Move RegisterFile growth check to callee
638 <https://bugs.webkit.org/show_bug.cgi?id=21541>
640 Move the RegisterFile growth check to the callee in the common case,
641 where some of the information is known statically at JIT time. There is
642 still a check in the caller in the case where the caller provides too
645 This is a 2.1% speedup on the V8 benchmark, including a 5.1% speedup on
646 the Richards benchmark, a 4.1% speedup on the DeltaBlue benchmark, and a
647 1.4% speedup on the Earley-Boyer benchmark. It is also a 0.5% speedup on
651 (JSC::CTI::privateCompile):
653 (JSC::Machine::cti_register_file_check):
654 (JSC::Machine::cti_op_call_JSFunction):
655 (JSC::Machine::cti_op_construct_JSConstruct):
658 * masm/X86Assembler.h:
659 (JSC::X86Assembler::):
660 (JSC::X86Assembler::cmpl_mr):
661 (JSC::X86Assembler::emitUnlinkedJg):
663 2008-10-13 Sam Weinig <sam@webkit.org>
665 Reviewed by Dan Bernstein.
667 Fix for https://bugs.webkit.org/show_bug.cgi?id=21577
668 5 false positive StructureID leaks
670 - Add leak ignore set to StructureID to selectively ignore leaking some StructureIDs.
671 - Add create method to JSGlolalData to be used when the data will be intentionally
672 leaked and ignore all leaks caused the StructureIDs stored in it.
674 * JavaScriptCore.exp:
675 * kjs/JSGlobalData.cpp:
676 (JSC::JSGlobalData::createLeaked):
677 * kjs/JSGlobalData.h:
678 * kjs/StructureID.cpp:
679 (JSC::StructureID::StructureID):
680 (JSC::StructureID::~StructureID):
681 (JSC::StructureID::startIgnoringLeaks):
682 (JSC::StructureID::stopIgnoringLeaks):
685 2008-10-13 Marco Barisione <marco.barisione@collabora.co.uk>
687 Reviewed by Darin Adler. Landed by Jan Alonzo.
689 WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?)
690 http://bugs.webkit.org/show_bug.cgi?id=20483
692 Add a GOwnPtr smart pointer (similar to OwnPtr) to handle memory
693 allocated by GLib and start the conversion to use it.
696 * wtf/GOwnPtr.cpp: Added.
703 * wtf/GOwnPtr.h: Added.
705 (WTF::GOwnPtr::GOwnPtr):
706 (WTF::GOwnPtr::~GOwnPtr):
708 (WTF::GOwnPtr::release):
709 (WTF::GOwnPtr::rawPtr):
711 (WTF::GOwnPtr::clear):
712 (WTF::GOwnPtr::operator*):
713 (WTF::GOwnPtr::operator->):
714 (WTF::GOwnPtr::operator!):
715 (WTF::GOwnPtr::operator UnspecifiedBoolType):
716 (WTF::GOwnPtr::swap):
722 * wtf/ThreadingGtk.cpp:
723 (WTF::Mutex::~Mutex):
725 (WTF::Mutex::tryLock):
726 (WTF::Mutex::unlock):
727 (WTF::ThreadCondition::~ThreadCondition):
728 (WTF::ThreadCondition::wait):
729 (WTF::ThreadCondition::timedWait):
730 (WTF::ThreadCondition::signal):
731 (WTF::ThreadCondition::broadcast):
733 2008-10-12 Gabriella Toth <gtoth@inf.u-szeged.hu>
735 Reviewed by Darin Adler.
737 - part of https://bugs.webkit.org/show_bug.cgi?id=21055
738 Bug 21055: not invoked functions
740 * kjs/nodes.cpp: Deleted a function that is not invoked:
741 statementListInitializeVariableAccessStack.
743 2008-10-12 Darin Adler <darin@apple.com>
745 Reviewed by Sam Weinig.
747 * wtf/unicode/icu/UnicodeIcu.h: Fixed indentation to match WebKit coding style.
748 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
750 2008-10-12 Darin Adler <darin@apple.com>
752 Reviewed by Sam Weinig.
754 - https://bugs.webkit.org/show_bug.cgi?id=21556
755 Bug 21556: non-ASCII digits are allowed in places where only ASCII should be
757 * wtf/unicode/icu/UnicodeIcu.h: Removed isDigit, digitValue, and isFormatChar.
758 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
760 2008-10-12 Anders Carlsson <andersca@apple.com>
762 Reviewed by Darin Adler.
764 Make the append method that takes a Vector more strict - it now requires the elements
765 of the vector to be appended same type as the elements of the Vector they're being appended to.
767 This would cause problems when dealing with Vectors containing other Vectors.
772 2008-10-11 Cameron Zwarich <zwarich@apple.com>
774 Reviewed by Sam Weinig.
776 Clean up RegExpMatchesArray.h to match our coding style.
778 * kjs/RegExpMatchesArray.h:
779 (JSC::RegExpMatchesArray::getOwnPropertySlot):
780 (JSC::RegExpMatchesArray::put):
781 (JSC::RegExpMatchesArray::deleteProperty):
782 (JSC::RegExpMatchesArray::getPropertyNames):
784 2008-10-11 Cameron Zwarich <zwarich@apple.com>
786 Reviewed by Sam Weinig.
788 Bug 21525: 55 StructureID leaks on Wikitravel's main page
789 <https://bugs.webkit.org/show_bug.cgi?id=21525>
791 Bug 21533: Simple JavaScript code leaks StructureIDs
792 <https://bugs.webkit.org/show_bug.cgi?id=21533>
794 StructureID::getEnumerablePropertyNames() ends up calling back to itself
795 via JSObject::getPropertyNames(), which causes the PropertyNameArray to
796 be cached twice. This leads to a memory leak in almost every use of
797 JSObject::getPropertyNames() on an object. The fix here is based on a
798 suggestion of Sam Weinig.
800 This patch also fixes every StructureID leaks that occurs while running
801 the Mozilla MemBuster test.
803 * kjs/PropertyNameArray.h:
804 (JSC::PropertyNameArray::PropertyNameArray):
805 (JSC::PropertyNameArray::setCacheable):
806 (JSC::PropertyNameArray::cacheable):
807 * kjs/StructureID.cpp:
808 (JSC::StructureID::getEnumerablePropertyNames):
810 2008-10-10 Oliver Hunt <oliver@apple.com>
812 Reviewed by Cameron Zwarich.
814 Use fastcall calling convention on GCC > 4.0
816 Results in a 2-3% improvement in GCC 4.2 performance, so
817 that it is no longer a regression vs. GCC 4.0
823 2008-10-10 Sam Weinig <sam@webkit.org>
825 Reviewed by Darin Adler.
827 - Add a workaround for a bug in ceil in Darwin libc.
828 - Remove old workarounds for JS math functions that are not needed
831 The math functions are heavily tested by fast/js/math.html.
833 * kjs/MathObject.cpp:
834 (JSC::mathProtoFuncAbs): Remove workaround.
835 (JSC::mathProtoFuncCeil): Ditto.
836 (JSC::mathProtoFuncFloor): Ditto.
838 (wtf_ceil): Add ceil workaround for darwin.
840 2008-10-10 Sam Weinig <sam@webkit.org>
842 Reviewed by Darin Adler
844 Add Assertions to JSObject constructor.
847 (JSC::JSObject::JSObject):
849 2008-10-10 Sam Weinig <sam@webkit.org>
851 Reviewed by Cameron Zwarich.
853 Remove now unused m_getterSetterFlag variable from PropertyMap.
855 * kjs/PropertyMap.cpp:
856 (JSC::PropertyMap::operator=):
858 (JSC::PropertyMap::PropertyMap):
860 2008-10-09 Sam Weinig <sam@webkit.org>
862 Reviewed by Maciej Stachowiak.
864 Add leaks checking to StructureID.
866 * kjs/StructureID.cpp:
867 (JSC::StructureID::StructureID):
868 (JSC::StructureID::~StructureID):
870 2008-10-09 Alp Toker <alp@nuanti.com>
872 Reviewed by Mark Rowe.
874 https://bugs.webkit.org/show_bug.cgi?id=20760
875 Implement support for x86 Linux in CTI
877 Prepare to enable CTI/WREC on supported architectures.
879 Make it possible to use the CTI_ARGUMENT workaround with GCC as well
880 as MSVC by fixing some preprocessor conditionals.
882 Note that CTI/WREC no longer requires CTI_ARGUMENT on Linux so we
883 don't actually enable it except when building with MSVC. GCC on Win32
886 Adapt inline ASM code to use the global symbol underscore prefix only
887 on Darwin and to call the properly mangled Machine::cti_vm_throw
888 symbol name depending on CTI_ARGUMENT.
890 Also avoid global inclusion of the JIT infrastructure headers
891 throughout WebCore and WebKit causing recompilation of about ~1500
892 source files after modification to X86Assembler.h, CTI.h, WREC.h,
893 which are only used deep inside JavaScriptCore.
901 (JSC::RegExp::RegExp):
902 (JSC::RegExp::~RegExp):
903 (JSC::RegExp::match):
905 * masm/X86Assembler.h:
906 (JSC::X86Assembler::emitConvertToFastCall):
907 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
908 (JSC::X86Assembler::emitRestoreArgumentReference):
910 2008-10-09 Gavin Barraclough <barraclough@apple.com>
912 Reviewed by Cameron Zwarich.
914 Fix for bug #21160, x=0;1/(x*-1) == -Infinity
918 (JSC::CTI::emitFastArithDeTagImmediate):
919 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
920 (JSC::CTI::compileBinaryArithOp):
921 (JSC::CTI::compileBinaryArithOpSlowCase):
922 (JSC::CTI::privateCompileMainPass):
923 (JSC::CTI::privateCompileSlowCases):
925 * masm/X86Assembler.h:
926 (JSC::X86Assembler::):
927 (JSC::X86Assembler::emitUnlinkedJs):
929 2008-10-09 Cameron Zwarich <zwarich@apple.com>
931 Reviewed by Oliver Hunt.
933 Bug 21459: REGRESSION (r37324): Safari crashes inside JavaScriptCore while browsing hulu.com
934 <https://bugs.webkit.org/show_bug.cgi?id=21459>
936 After r37324, an Arguments object does not mark an associated activation
937 object. This change was made because Arguments no longer directly used
938 the activation object in any way. However, if an activation is torn off,
939 then the backing store of Arguments becomes the register array of the
940 activation object. Arguments directly marks all of the arguments, but
941 the activation object is being collected, which causes its register
942 array to be freed and new memory to be allocated in its place.
944 Unfortunately, it does not seem possible to reproduce this issue in a
948 (JSC::Arguments::mark):
950 (JSC::Arguments::setActivation):
951 (JSC::Arguments::Arguments):
952 (JSC::JSActivation::copyRegisters):
954 2008-10-09 Ariya Hidayat <ariya.hidayat@trolltech.com>
960 * wtf/AlwaysInline.h:
962 2008-10-08 Cameron Zwarich <zwarich@apple.com>
964 Reviewed by Maciej Stachowiak.
966 Bug 21497: REGRESSION (r37433): Bytecode JSC tests are severely broken
967 <https://bugs.webkit.org/show_bug.cgi?id=21497>
969 Fix a typo in r37433 that causes the failure of a large number of JSC
970 tests with the bytecode interpreter enabled.
973 (JSC::Machine::privateExecute):
975 2008-10-08 Mark Rowe <mrowe@apple.com>
980 (JSC::): Update type of argument to ctiTrampoline.
982 2008-10-08 Darin Adler <darin@apple.com>
984 Reviewed by Cameron Zwarich.
986 - https://bugs.webkit.org/show_bug.cgi?id=21403
987 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
989 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
990 client over to the new name.
992 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
993 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
994 accessor functions to get at things in the frame.
996 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
997 JSGlobalData* and in other cases eliminating them entirely.
999 * API/JSObjectRef.cpp:
1000 (JSObjectMakeFunctionWithCallback):
1001 (JSObjectMakeFunction):
1002 (JSObjectHasProperty):
1003 (JSObjectGetProperty):
1004 (JSObjectSetProperty):
1005 (JSObjectDeleteProperty):
1006 * API/OpaqueJSString.cpp:
1007 * API/OpaqueJSString.h:
1009 (JSC::CTI::getConstant):
1010 (JSC::CTI::emitGetArg):
1011 (JSC::CTI::emitGetPutArg):
1012 (JSC::CTI::getConstantImmediateNumericArg):
1013 (JSC::CTI::printOpcodeOperandTypes):
1015 (JSC::CTI::compileOpCall):
1016 (JSC::CTI::compileBinaryArithOp):
1017 (JSC::CTI::privateCompileMainPass):
1018 (JSC::CTI::privateCompile):
1019 (JSC::CTI::privateCompileGetByIdProto):
1020 (JSC::CTI::privateCompileGetByIdChain):
1021 (JSC::CTI::compileRegExp):
1024 * VM/CodeGenerator.cpp:
1025 (JSC::CodeGenerator::emitEqualityOp):
1026 (JSC::CodeGenerator::emitLoad):
1027 (JSC::CodeGenerator::emitUnexpectedLoad):
1028 (JSC::CodeGenerator::emitConstruct):
1029 * VM/CodeGenerator.h:
1033 (JSC::jsAddSlowCase):
1035 (JSC::jsTypeStringForValue):
1036 (JSC::Machine::resolve):
1037 (JSC::Machine::resolveSkip):
1038 (JSC::Machine::resolveGlobal):
1039 (JSC::inlineResolveBase):
1040 (JSC::Machine::resolveBase):
1041 (JSC::Machine::resolveBaseAndProperty):
1042 (JSC::Machine::resolveBaseAndFunc):
1043 (JSC::Machine::slideRegisterWindowForCall):
1045 (JSC::Machine::callEval):
1046 (JSC::Machine::dumpCallFrame):
1047 (JSC::Machine::dumpRegisters):
1048 (JSC::Machine::unwindCallFrame):
1049 (JSC::Machine::throwException):
1050 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
1051 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
1052 (JSC::Machine::execute):
1053 (JSC::Machine::debug):
1054 (JSC::Machine::createExceptionScope):
1055 (JSC::cachePrototypeChain):
1056 (JSC::Machine::tryCachePutByID):
1057 (JSC::Machine::tryCacheGetByID):
1058 (JSC::Machine::privateExecute):
1059 (JSC::Machine::retrieveArguments):
1060 (JSC::Machine::retrieveCaller):
1061 (JSC::Machine::retrieveLastCaller):
1062 (JSC::Machine::findFunctionCallFrame):
1063 (JSC::Machine::getArgumentsData):
1064 (JSC::Machine::tryCTICachePutByID):
1065 (JSC::Machine::getCTIArrayLengthTrampoline):
1066 (JSC::Machine::getCTIStringLengthTrampoline):
1067 (JSC::Machine::tryCTICacheGetByID):
1068 (JSC::Machine::cti_op_convert_this):
1069 (JSC::Machine::cti_op_end):
1070 (JSC::Machine::cti_op_add):
1071 (JSC::Machine::cti_op_pre_inc):
1072 (JSC::Machine::cti_timeout_check):
1073 (JSC::Machine::cti_op_loop_if_less):
1074 (JSC::Machine::cti_op_loop_if_lesseq):
1075 (JSC::Machine::cti_op_new_object):
1076 (JSC::Machine::cti_op_put_by_id):
1077 (JSC::Machine::cti_op_put_by_id_second):
1078 (JSC::Machine::cti_op_put_by_id_generic):
1079 (JSC::Machine::cti_op_put_by_id_fail):
1080 (JSC::Machine::cti_op_get_by_id):
1081 (JSC::Machine::cti_op_get_by_id_second):
1082 (JSC::Machine::cti_op_get_by_id_generic):
1083 (JSC::Machine::cti_op_get_by_id_fail):
1084 (JSC::Machine::cti_op_instanceof):
1085 (JSC::Machine::cti_op_del_by_id):
1086 (JSC::Machine::cti_op_mul):
1087 (JSC::Machine::cti_op_new_func):
1088 (JSC::Machine::cti_op_call_JSFunction):
1089 (JSC::Machine::cti_vm_compile):
1090 (JSC::Machine::cti_op_push_activation):
1091 (JSC::Machine::cti_op_call_NotJSFunction):
1092 (JSC::Machine::cti_op_create_arguments):
1093 (JSC::Machine::cti_op_tear_off_activation):
1094 (JSC::Machine::cti_op_tear_off_arguments):
1095 (JSC::Machine::cti_op_ret_profiler):
1096 (JSC::Machine::cti_op_ret_scopeChain):
1097 (JSC::Machine::cti_op_new_array):
1098 (JSC::Machine::cti_op_resolve):
1099 (JSC::Machine::cti_op_construct_JSConstruct):
1100 (JSC::Machine::cti_op_construct_NotJSConstruct):
1101 (JSC::Machine::cti_op_get_by_val):
1102 (JSC::Machine::cti_op_resolve_func):
1103 (JSC::Machine::cti_op_sub):
1104 (JSC::Machine::cti_op_put_by_val):
1105 (JSC::Machine::cti_op_put_by_val_array):
1106 (JSC::Machine::cti_op_lesseq):
1107 (JSC::Machine::cti_op_loop_if_true):
1108 (JSC::Machine::cti_op_negate):
1109 (JSC::Machine::cti_op_resolve_base):
1110 (JSC::Machine::cti_op_resolve_skip):
1111 (JSC::Machine::cti_op_resolve_global):
1112 (JSC::Machine::cti_op_div):
1113 (JSC::Machine::cti_op_pre_dec):
1114 (JSC::Machine::cti_op_jless):
1115 (JSC::Machine::cti_op_not):
1116 (JSC::Machine::cti_op_jtrue):
1117 (JSC::Machine::cti_op_post_inc):
1118 (JSC::Machine::cti_op_eq):
1119 (JSC::Machine::cti_op_lshift):
1120 (JSC::Machine::cti_op_bitand):
1121 (JSC::Machine::cti_op_rshift):
1122 (JSC::Machine::cti_op_bitnot):
1123 (JSC::Machine::cti_op_resolve_with_base):
1124 (JSC::Machine::cti_op_new_func_exp):
1125 (JSC::Machine::cti_op_mod):
1126 (JSC::Machine::cti_op_less):
1127 (JSC::Machine::cti_op_neq):
1128 (JSC::Machine::cti_op_post_dec):
1129 (JSC::Machine::cti_op_urshift):
1130 (JSC::Machine::cti_op_bitxor):
1131 (JSC::Machine::cti_op_new_regexp):
1132 (JSC::Machine::cti_op_bitor):
1133 (JSC::Machine::cti_op_call_eval):
1134 (JSC::Machine::cti_op_throw):
1135 (JSC::Machine::cti_op_get_pnames):
1136 (JSC::Machine::cti_op_next_pname):
1137 (JSC::Machine::cti_op_push_scope):
1138 (JSC::Machine::cti_op_pop_scope):
1139 (JSC::Machine::cti_op_typeof):
1140 (JSC::Machine::cti_op_to_jsnumber):
1141 (JSC::Machine::cti_op_in):
1142 (JSC::Machine::cti_op_push_new_scope):
1143 (JSC::Machine::cti_op_jmp_scopes):
1144 (JSC::Machine::cti_op_put_by_index):
1145 (JSC::Machine::cti_op_switch_imm):
1146 (JSC::Machine::cti_op_switch_char):
1147 (JSC::Machine::cti_op_switch_string):
1148 (JSC::Machine::cti_op_del_by_val):
1149 (JSC::Machine::cti_op_put_getter):
1150 (JSC::Machine::cti_op_put_setter):
1151 (JSC::Machine::cti_op_new_error):
1152 (JSC::Machine::cti_op_debug):
1153 (JSC::Machine::cti_vm_throw):
1156 * VM/RegisterFile.h:
1158 * kjs/DebuggerCallFrame.cpp:
1159 (JSC::DebuggerCallFrame::functionName):
1160 (JSC::DebuggerCallFrame::type):
1161 (JSC::DebuggerCallFrame::thisObject):
1162 (JSC::DebuggerCallFrame::evaluate):
1163 * kjs/DebuggerCallFrame.h:
1164 * kjs/ExecState.cpp:
1165 (JSC::CallFrame::thisValue):
1167 * kjs/FunctionConstructor.cpp:
1168 (JSC::constructFunction):
1169 * kjs/JSActivation.cpp:
1170 (JSC::JSActivation::JSActivation):
1171 (JSC::JSActivation::argumentsGetter):
1172 * kjs/JSActivation.h:
1173 * kjs/JSGlobalObject.cpp:
1174 (JSC::JSGlobalObject::init):
1175 * kjs/JSGlobalObjectFunctions.cpp:
1176 (JSC::globalFuncEval):
1177 * kjs/JSVariableObject.h:
1179 (JSC::Parser::parse):
1180 * kjs/RegExpConstructor.cpp:
1181 (JSC::constructRegExp):
1182 * kjs/RegExpPrototype.cpp:
1183 (JSC::regExpProtoFuncCompile):
1185 (prettyPrintScript):
1186 * kjs/StringPrototype.cpp:
1187 (JSC::stringProtoFuncMatch):
1188 (JSC::stringProtoFuncSearch):
1189 * kjs/identifier.cpp:
1190 (JSC::Identifier::checkSameIdentifierTable):
1191 * kjs/interpreter.cpp:
1192 (JSC::Interpreter::checkSyntax):
1193 (JSC::Interpreter::evaluate):
1195 (JSC::ThrowableExpressionData::emitThrowError):
1196 (JSC::RegExpNode::emitCode):
1197 (JSC::ArrayNode::emitCode):
1198 (JSC::InstanceOfNode::emitCode):
1201 (JSC::RegExp::RegExp):
1202 (JSC::RegExp::create):
1204 * profiler/HeavyProfile.h:
1205 * profiler/Profile.h:
1209 2008-10-08 Mark Rowe <mrowe@apple.com>
1211 Typed by Maciej Stachowiak, reviewed by Mark Rowe.
1213 Fix crash in fast/js/constant-folding.html with CTI disabled.
1216 (JSC::Machine::privateExecute):
1218 2008-10-08 Timothy Hatcher <timothy@apple.com>
1220 Roll out r37427 because it causes an infinite recursion loading about:blank.
1222 https://bugs.webkit.org/show_bug.cgi?id=21476
1224 2008-10-08 Darin Adler <darin@apple.com>
1226 Reviewed by Cameron Zwarich.
1228 - https://bugs.webkit.org/show_bug.cgi?id=21403
1229 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
1231 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
1232 client over to the new name.
1234 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
1235 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
1236 accessor functions to get at things in the frame.
1238 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
1239 JSGlobalData* and in other cases eliminating them entirely.
1241 * API/JSObjectRef.cpp:
1242 (JSObjectMakeFunctionWithCallback):
1243 (JSObjectMakeFunction):
1244 (JSObjectHasProperty):
1245 (JSObjectGetProperty):
1246 (JSObjectSetProperty):
1247 (JSObjectDeleteProperty):
1248 * API/OpaqueJSString.cpp:
1249 * API/OpaqueJSString.h:
1251 (JSC::CTI::getConstant):
1252 (JSC::CTI::emitGetArg):
1253 (JSC::CTI::emitGetPutArg):
1254 (JSC::CTI::getConstantImmediateNumericArg):
1255 (JSC::CTI::printOpcodeOperandTypes):
1257 (JSC::CTI::compileOpCall):
1258 (JSC::CTI::compileBinaryArithOp):
1259 (JSC::CTI::privateCompileMainPass):
1260 (JSC::CTI::privateCompile):
1261 (JSC::CTI::privateCompileGetByIdProto):
1262 (JSC::CTI::privateCompileGetByIdChain):
1263 (JSC::CTI::compileRegExp):
1266 * VM/CodeGenerator.cpp:
1267 (JSC::CodeGenerator::emitEqualityOp):
1268 (JSC::CodeGenerator::emitLoad):
1269 (JSC::CodeGenerator::emitUnexpectedLoad):
1270 (JSC::CodeGenerator::emitConstruct):
1271 * VM/CodeGenerator.h:
1275 (JSC::jsAddSlowCase):
1277 (JSC::jsTypeStringForValue):
1278 (JSC::Machine::resolve):
1279 (JSC::Machine::resolveSkip):
1280 (JSC::Machine::resolveGlobal):
1281 (JSC::inlineResolveBase):
1282 (JSC::Machine::resolveBase):
1283 (JSC::Machine::resolveBaseAndProperty):
1284 (JSC::Machine::resolveBaseAndFunc):
1285 (JSC::Machine::slideRegisterWindowForCall):
1287 (JSC::Machine::callEval):
1288 (JSC::Machine::dumpCallFrame):
1289 (JSC::Machine::dumpRegisters):
1290 (JSC::Machine::unwindCallFrame):
1291 (JSC::Machine::throwException):
1292 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
1293 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
1294 (JSC::Machine::execute):
1295 (JSC::Machine::debug):
1296 (JSC::Machine::createExceptionScope):
1297 (JSC::cachePrototypeChain):
1298 (JSC::Machine::tryCachePutByID):
1299 (JSC::Machine::tryCacheGetByID):
1300 (JSC::Machine::privateExecute):
1301 (JSC::Machine::retrieveArguments):
1302 (JSC::Machine::retrieveCaller):
1303 (JSC::Machine::retrieveLastCaller):
1304 (JSC::Machine::findFunctionCallFrame):
1305 (JSC::Machine::getArgumentsData):
1306 (JSC::Machine::tryCTICachePutByID):
1307 (JSC::Machine::getCTIArrayLengthTrampoline):
1308 (JSC::Machine::getCTIStringLengthTrampoline):
1309 (JSC::Machine::tryCTICacheGetByID):
1310 (JSC::Machine::cti_op_convert_this):
1311 (JSC::Machine::cti_op_end):
1312 (JSC::Machine::cti_op_add):
1313 (JSC::Machine::cti_op_pre_inc):
1314 (JSC::Machine::cti_timeout_check):
1315 (JSC::Machine::cti_op_loop_if_less):
1316 (JSC::Machine::cti_op_loop_if_lesseq):
1317 (JSC::Machine::cti_op_new_object):
1318 (JSC::Machine::cti_op_put_by_id):
1319 (JSC::Machine::cti_op_put_by_id_second):
1320 (JSC::Machine::cti_op_put_by_id_generic):
1321 (JSC::Machine::cti_op_put_by_id_fail):
1322 (JSC::Machine::cti_op_get_by_id):
1323 (JSC::Machine::cti_op_get_by_id_second):
1324 (JSC::Machine::cti_op_get_by_id_generic):
1325 (JSC::Machine::cti_op_get_by_id_fail):
1326 (JSC::Machine::cti_op_instanceof):
1327 (JSC::Machine::cti_op_del_by_id):
1328 (JSC::Machine::cti_op_mul):
1329 (JSC::Machine::cti_op_new_func):
1330 (JSC::Machine::cti_op_call_JSFunction):
1331 (JSC::Machine::cti_vm_compile):
1332 (JSC::Machine::cti_op_push_activation):
1333 (JSC::Machine::cti_op_call_NotJSFunction):
1334 (JSC::Machine::cti_op_create_arguments):
1335 (JSC::Machine::cti_op_tear_off_activation):
1336 (JSC::Machine::cti_op_tear_off_arguments):
1337 (JSC::Machine::cti_op_ret_profiler):
1338 (JSC::Machine::cti_op_ret_scopeChain):
1339 (JSC::Machine::cti_op_new_array):
1340 (JSC::Machine::cti_op_resolve):
1341 (JSC::Machine::cti_op_construct_JSConstruct):
1342 (JSC::Machine::cti_op_construct_NotJSConstruct):
1343 (JSC::Machine::cti_op_get_by_val):
1344 (JSC::Machine::cti_op_resolve_func):
1345 (JSC::Machine::cti_op_sub):
1346 (JSC::Machine::cti_op_put_by_val):
1347 (JSC::Machine::cti_op_put_by_val_array):
1348 (JSC::Machine::cti_op_lesseq):
1349 (JSC::Machine::cti_op_loop_if_true):
1350 (JSC::Machine::cti_op_negate):
1351 (JSC::Machine::cti_op_resolve_base):
1352 (JSC::Machine::cti_op_resolve_skip):
1353 (JSC::Machine::cti_op_resolve_global):
1354 (JSC::Machine::cti_op_div):
1355 (JSC::Machine::cti_op_pre_dec):
1356 (JSC::Machine::cti_op_jless):
1357 (JSC::Machine::cti_op_not):
1358 (JSC::Machine::cti_op_jtrue):
1359 (JSC::Machine::cti_op_post_inc):
1360 (JSC::Machine::cti_op_eq):
1361 (JSC::Machine::cti_op_lshift):
1362 (JSC::Machine::cti_op_bitand):
1363 (JSC::Machine::cti_op_rshift):
1364 (JSC::Machine::cti_op_bitnot):
1365 (JSC::Machine::cti_op_resolve_with_base):
1366 (JSC::Machine::cti_op_new_func_exp):
1367 (JSC::Machine::cti_op_mod):
1368 (JSC::Machine::cti_op_less):
1369 (JSC::Machine::cti_op_neq):
1370 (JSC::Machine::cti_op_post_dec):
1371 (JSC::Machine::cti_op_urshift):
1372 (JSC::Machine::cti_op_bitxor):
1373 (JSC::Machine::cti_op_new_regexp):
1374 (JSC::Machine::cti_op_bitor):
1375 (JSC::Machine::cti_op_call_eval):
1376 (JSC::Machine::cti_op_throw):
1377 (JSC::Machine::cti_op_get_pnames):
1378 (JSC::Machine::cti_op_next_pname):
1379 (JSC::Machine::cti_op_push_scope):
1380 (JSC::Machine::cti_op_pop_scope):
1381 (JSC::Machine::cti_op_typeof):
1382 (JSC::Machine::cti_op_to_jsnumber):
1383 (JSC::Machine::cti_op_in):
1384 (JSC::Machine::cti_op_push_new_scope):
1385 (JSC::Machine::cti_op_jmp_scopes):
1386 (JSC::Machine::cti_op_put_by_index):
1387 (JSC::Machine::cti_op_switch_imm):
1388 (JSC::Machine::cti_op_switch_char):
1389 (JSC::Machine::cti_op_switch_string):
1390 (JSC::Machine::cti_op_del_by_val):
1391 (JSC::Machine::cti_op_put_getter):
1392 (JSC::Machine::cti_op_put_setter):
1393 (JSC::Machine::cti_op_new_error):
1394 (JSC::Machine::cti_op_debug):
1395 (JSC::Machine::cti_vm_throw):
1398 * VM/RegisterFile.h:
1400 * kjs/DebuggerCallFrame.cpp:
1401 (JSC::DebuggerCallFrame::functionName):
1402 (JSC::DebuggerCallFrame::type):
1403 (JSC::DebuggerCallFrame::thisObject):
1404 (JSC::DebuggerCallFrame::evaluate):
1405 * kjs/DebuggerCallFrame.h:
1406 * kjs/ExecState.cpp:
1407 (JSC::CallFrame::thisValue):
1409 * kjs/FunctionConstructor.cpp:
1410 (JSC::constructFunction):
1411 * kjs/JSActivation.cpp:
1412 (JSC::JSActivation::JSActivation):
1413 (JSC::JSActivation::argumentsGetter):
1414 * kjs/JSActivation.h:
1415 * kjs/JSGlobalObject.cpp:
1416 (JSC::JSGlobalObject::init):
1417 * kjs/JSGlobalObjectFunctions.cpp:
1418 (JSC::globalFuncEval):
1419 * kjs/JSVariableObject.h:
1421 (JSC::Parser::parse):
1422 * kjs/RegExpConstructor.cpp:
1423 (JSC::constructRegExp):
1424 * kjs/RegExpPrototype.cpp:
1425 (JSC::regExpProtoFuncCompile):
1427 (prettyPrintScript):
1428 * kjs/StringPrototype.cpp:
1429 (JSC::stringProtoFuncMatch):
1430 (JSC::stringProtoFuncSearch):
1431 * kjs/identifier.cpp:
1432 (JSC::Identifier::checkSameIdentifierTable):
1433 * kjs/interpreter.cpp:
1434 (JSC::Interpreter::checkSyntax):
1435 (JSC::Interpreter::evaluate):
1437 (JSC::ThrowableExpressionData::emitThrowError):
1438 (JSC::RegExpNode::emitCode):
1439 (JSC::ArrayNode::emitCode):
1440 (JSC::InstanceOfNode::emitCode):
1443 (JSC::RegExp::RegExp):
1444 (JSC::RegExp::create):
1446 * profiler/HeavyProfile.h:
1447 * profiler/Profile.h:
1451 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
1453 Reviewed by Oliver Hunt.
1455 Avoid endless loops when compiling without the computed goto
1458 NEXT_OPCODE expands to "continue", which will not work inside
1462 (JSC::Machine::privateExecute):
1464 2008-10-08 Maciej Stachowiak <mjs@apple.com>
1466 Reviewed by Oliver Hunt.
1468 Re-landing the following fix with the crashing bug in it fixed (r37405):
1470 - optimize away multiplication by constant 1.0
1472 2.3% speedup on v8 RayTrace benchmark
1474 Apparently it's not uncommon for JavaScript code to multiply by
1475 constant 1.0 in the mistaken belief that this converts integer to
1476 floating point and that there is any operational difference.
1479 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
1480 case where parameter is already number.
1481 (JSC::CTI::privateCompileSlowCases): ditto
1483 (JSC::Machine::privateExecute): ditto
1485 (makeMultNode): Transform as follows:
1486 +FOO * BAR ==> FOO * BAR
1487 FOO * +BAR ==> FOO * BAR
1490 (makeDivNode): Transform as follows:
1491 +FOO / BAR ==> FOO / BAR
1492 FOO / +BAR ==> FOO / BAR
1493 (makeSubNode): Transform as follows:
1494 +FOO - BAR ==> FOO - BAR
1495 FOO - +BAR ==> FOO - BAR
1497 (JSC::ExpressionNode::stripUnaryPlus): Helper for above
1499 (JSC::UnaryPlusNode::stripUnaryPlus): ditto
1501 2008-10-08 Maciej Stachowiak <mjs@apple.com>
1503 Reviewed by Oliver Hunt.
1505 - correctly handle appending -0 to a string, it should stringify as just 0
1510 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
1514 Fix WebKit compilation with VC2008SP1
1516 Apply the TR1 workaround for JavaScriptCore, too.
1518 * JavaScriptCore.pro:
1520 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
1524 Fix compilation errors on VS2008 64Bit
1526 * kjs/collector.cpp:
1527 (JSC::currentThreadStackBase):
1529 2008-10-08 André Pönitz <apoenitz@trolltech.com>
1533 Fix compilation with Qt namespaces.
1537 2008-10-07 Sam Weinig <sam@webkit.org>
1541 2008-10-07 Oliver Hunt <oliver@apple.com>
1543 Reviewed by Cameron Zwarich.
1545 Switch CTI runtime calls to the fastcall calling convention
1547 Basically this means that we get to store the argument for CTI
1548 calls in the ECX register, which saves a register->memory write
1549 and subsequent memory->register read.
1551 This is a 1.7% progression in SunSpider and 2.4% on commandline
1556 (JSC::CTI::privateCompilePutByIdTransition):
1557 (JSC::CTI::privateCompilePatchGetArrayLength):
1560 * masm/X86Assembler.h:
1561 (JSC::X86Assembler::emitRestoreArgumentReference):
1562 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
1563 We need this to correctly reload ecx from inside certain property access
1567 2008-10-07 Maciej Stachowiak <mjs@apple.com>
1569 Reviewed by Mark Rowe.
1571 - optimize away multiplication by constant 1.0
1573 2.3% speedup on v8 RayTrace benchmark
1575 Apparently it's not uncommon for JavaScript code to multiply by
1576 constant 1.0 in the mistaken belief that this converts integer to
1577 floating point and that there is any operational difference.
1580 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
1581 case where parameter is already number.
1582 (JSC::CTI::privateCompileSlowCases): ditto
1584 (JSC::Machine::privateExecute): ditto
1586 (makeMultNode): Transform as follows:
1587 +FOO * BAR ==> FOO * BAR
1588 FOO * +BAR ==> FOO * BAR
1591 (makeDivNode): Transform as follows:
1592 +FOO / BAR ==> FOO / BAR
1593 FOO / +BAR ==> FOO / BAR
1594 (makeSubNode): Transform as follows:
1595 +FOO - BAR ==> FOO - BAR
1596 FOO - +BAR ==> FOO - BAR
1598 (JSC::ExpressionNode::stripUnaryPlus): Helper for above
1600 (JSC::UnaryPlusNode::stripUnaryPlus): ditto
1602 2008-10-07 Maciej Stachowiak <mjs@apple.com>
1604 Reviewed by Oliver Hunt.
1606 - make constant folding code more consistent
1608 Added a makeSubNode to match add, mult and div; use the makeFooNode functions always,
1609 instead of allocating nodes directly in other places in the grammar.
1613 2008-10-07 Sam Weinig <sam@webkit.org>
1615 Reviewed by Cameron Zwarich.
1617 Move hasGetterSetterProperties flag from PropertyMap to StructureID.
1620 (JSC::JSObject::put):
1621 (JSC::JSObject::defineGetter):
1622 (JSC::JSObject::defineSetter):
1624 (JSC::JSObject::hasGetterSetterProperties):
1625 (JSC::JSObject::getOwnPropertySlotForWrite):
1626 (JSC::JSObject::getOwnPropertySlot):
1627 * kjs/PropertyMap.h:
1628 * kjs/StructureID.cpp:
1629 (JSC::StructureID::StructureID):
1630 (JSC::StructureID::addPropertyTransition):
1631 (JSC::StructureID::toDictionaryTransition):
1632 (JSC::StructureID::changePrototypeTransition):
1633 (JSC::StructureID::getterSetterTransition):
1634 * kjs/StructureID.h:
1635 (JSC::StructureID::hasGetterSetterProperties):
1636 (JSC::StructureID::setHasGetterSetterProperties):
1638 2008-10-07 Sam Weinig <sam@webkit.org>
1640 Reviewed by Cameron Zwarich.
1642 Roll r37370 back in with bug fixes.
1644 - PropertyMap::storageSize() should reflect the number of keys + deletedOffsets
1645 and has nothing to do with the internal deletedSentinel count anymore.
1647 2008-10-07 Gavin Barraclough <barraclough@apple.com>
1649 Reviewed by Oliver Hunt.
1651 Move callframe initialization into JIT code, again.
1653 As a part of the restructuring the second result from functions is now
1654 returned in edx, allowing the new value of 'r' to be returned via a
1655 register, and stored to the stack from JIT code, too.
1657 4.5% progression on v8-tests. (3% in their harness)
1661 (JSC::CTI::emitCall):
1662 (JSC::CTI::compileOpCall):
1663 (JSC::CTI::privateCompileMainPass):
1664 (JSC::CTI::privateCompileSlowCases):
1665 (JSC::CTI::privateCompile):
1667 (JSC::CallRecord::CallRecord):
1669 (JSC::Machine::cti_op_call_JSFunction):
1670 (JSC::Machine::cti_op_construct_JSConstruct):
1671 (JSC::Machine::cti_op_resolve_func):
1672 (JSC::Machine::cti_op_post_inc):
1673 (JSC::Machine::cti_op_resolve_with_base):
1674 (JSC::Machine::cti_op_post_dec):
1679 2008-10-07 Mark Rowe <mrowe@apple.com>
1681 Fix typo in method name.
1686 2008-10-07 Cameron Zwarich <zwarich@apple.com>
1688 Rubber-stamped by Mark Rowe.
1692 2008-10-06 Sam Weinig <sam@webkit.org>
1694 Reviewed by Cameron Zwarich.
1696 Fix for https://bugs.webkit.org/show_bug.cgi?id=21415
1697 Improve the division between PropertyStorageArray and PropertyMap
1699 - Rework ProperyMap to store offsets in the value so that they don't
1700 change when rehashing. This allows us not to have to keep the
1701 PropertyStorageArray in sync and thus not have to pass it in.
1702 - Rename PropertyMap::getOffset -> PropertyMap::get since put/remove
1703 now also return offsets.
1704 - A Vector of deleted offsets is now needed since the storage is out of
1707 1% win on SunSpider. Wash on V8 suite.
1709 * JavaScriptCore.exp:
1711 (JSC::transitionWillNeedStorageRealloc):
1713 (JSC::Machine::privateExecute):
1714 Transition logic can be greatly simplified by the fact that
1715 the storage capacity is always known, and is correct for the
1718 (JSC::JSObject::put): Rename getOffset -> get.
1719 (JSC::JSObject::deleteProperty): Ditto.
1720 (JSC::JSObject::getPropertyAttributes): Ditto.
1721 (JSC::JSObject::removeDirect): Use returned offset to
1722 clear the value in the PropertyNameArray.
1723 (JSC::JSObject::allocatePropertyStorage): Add assert.
1725 (JSC::JSObject::getDirect): Rename getOffset -> get
1726 (JSC::JSObject::getDirectLocation): Rename getOffset -> get
1727 (JSC::JSObject::putDirect): Use propertyStorageCapacity to determine whether
1728 or not to resize. Also, since put now returns an offset (and thus
1729 addPropertyTransition does also) setting of the PropertyStorageArray is
1731 (JSC::JSObject::transitionTo):
1732 * kjs/PropertyMap.cpp:
1733 (JSC::PropertyMap::checkConsistency): PropertyStorageArray is no longer
1735 (JSC::PropertyMap::operator=): Copy the delete offsets vector.
1736 (JSC::PropertyMap::put): Instead of setting the PropertyNameArray
1737 explicitly, return the offset where the value should go.
1738 (JSC::PropertyMap::remove): Instead of removing from the PropertyNameArray
1739 explicitly, return the offset where the value should be removed.
1740 (JSC::PropertyMap::get): Switch to using the stored offset, instead
1741 of the implicit one.
1742 (JSC::PropertyMap::insert):
1743 (JSC::PropertyMap::expand): This is never called when m_table is null,
1744 so remove that branch and add it as an assertion.
1745 (JSC::PropertyMap::createTable): Consistency checks no longer take
1746 a PropertyNameArray.
1747 (JSC::PropertyMap::rehash): No need to rehash the PropertyNameArray
1748 now that it is completely out of band.
1749 * kjs/PropertyMap.h:
1750 (JSC::PropertyMapEntry::PropertyMapEntry): Store offset into PropertyNameArray.
1751 (JSC::PropertyMap::get): Switch to using the stored offset, instead
1752 of the implicit one.
1753 * kjs/StructureID.cpp:
1754 (JSC::StructureID::StructureID): Initialize the propertyStorageCapacity to
1755 JSObject::inlineStorageCapacity.
1756 (JSC::StructureID::growPropertyStorageCapacity): Grow the storage capacity as
1758 (JSC::StructureID::addPropertyTransition): Copy the storage capacity.
1759 (JSC::StructureID::toDictionaryTransition): Ditto.
1760 (JSC::StructureID::changePrototypeTransition): Ditto.
1761 (JSC::StructureID::getterSetterTransition): Ditto.
1762 * kjs/StructureID.h:
1763 (JSC::StructureID::propertyStorageCapacity): Add propertyStorageCapacity
1764 which is the current capacity for the JSObjects PropertyStorageArray.
1765 It starts at the JSObject::inlineStorageCapacity (currently 2), then
1766 when it first needs to be resized moves to the JSObject::nonInlineBaseStorageCapacity
1767 (currently 16), and after that doubles each time.
1769 2008-10-06 Cameron Zwarich <zwarich@apple.com>
1771 Reviewed by Oliver Hunt.
1773 Bug 21396: Remove the OptionalCalleeActivation call frame slot
1774 <https://bugs.webkit.org/show_bug.cgi?id=21396>
1776 Remove the OptionalCalleeActivation call frame slot. We have to be
1777 careful to store the activation object in a register, because objects
1778 in the scope chain do not get marked.
1780 This is a 0.3% speedup on both SunSpider and the V8 benchmark.
1783 (JSC::CTI::privateCompileMainPass):
1785 (JSC::CodeBlock::dump):
1786 * VM/CodeGenerator.cpp:
1787 (JSC::CodeGenerator::CodeGenerator):
1788 (JSC::CodeGenerator::emitReturn):
1789 * VM/CodeGenerator.h:
1791 (JSC::Machine::dumpRegisters):
1792 (JSC::Machine::unwindCallFrame):
1793 (JSC::Machine::privateExecute):
1794 (JSC::Machine::cti_op_call_JSFunction):
1795 (JSC::Machine::cti_op_push_activation):
1796 (JSC::Machine::cti_op_tear_off_activation):
1797 (JSC::Machine::cti_op_construct_JSConstruct):
1799 (JSC::Machine::initializeCallFrame):
1800 * VM/RegisterFile.h:
1801 (JSC::RegisterFile::):
1803 2008-10-06 Tony Chang <tony@chromium.org>
1805 Reviewed by Alexey Proskuryakov.
1807 Chromium doesn't use pthreads on windows, so make its use conditional.
1809 Also convert a WORD to a DWORD to avoid a compiler warning. This
1810 matches the other methods around it.
1812 * wtf/ThreadingWin.cpp:
1813 (WTF::wtfThreadEntryPoint):
1814 (WTF::ThreadCondition::broadcast):
1816 2008-10-06 Mark Mentovai <mark@moxienet.com>
1818 Reviewed by Tim Hatcher.
1820 Allow ENABLE_DASHBOARD_SUPPORT and ENABLE_MAC_JAVA_BRIDGE to be
1821 disabled on the Mac.
1823 https://bugs.webkit.org/show_bug.cgi?id=21333
1827 2008-10-06 Steve Falkenburg <sfalken@apple.com>
1829 https://bugs.webkit.org/show_bug.cgi?id=21416
1830 Pass 0 for size to VirtualAlloc, as documented by MSDN.
1831 Identified by Application Verifier.
1833 Reviewed by Darin Adler.
1835 * kjs/collector.cpp:
1838 2008-10-06 Kevin McCullough <kmccullough@apple.com>
1840 Reviewed by Tim Hatcheri and Oliver Hunt.
1842 https://bugs.webkit.org/show_bug.cgi?id=21412
1843 Bug 21412: Refactor user initiated profile count to be more stable
1844 - Export UString::from for use with creating the profile title.
1846 * JavaScriptCore.exp:
1848 2008-10-06 Maciej Stachowiak <mjs@apple.com>
1850 Not reviewed. Build fix.
1852 - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these
1854 * API/JSValueRef.cpp:
1857 * JavaScriptCore.exp:
1859 (JSC::CodeBlock::dump):
1861 (JSC::Machine::privateExecute):
1862 (JSC::Machine::cti_op_loop_if_true):
1863 (JSC::Machine::cti_op_not):
1864 (JSC::Machine::cti_op_jtrue):
1865 * kjs/ArrayPrototype.cpp:
1866 (JSC::arrayProtoFuncFilter):
1867 (JSC::arrayProtoFuncEvery):
1868 (JSC::arrayProtoFuncSome):
1869 * kjs/BooleanConstructor.cpp:
1870 (JSC::constructBoolean):
1871 (JSC::callBooleanConstructor):
1872 * kjs/GetterSetter.h:
1874 (JSC::JSValue::toBoolean):
1875 * kjs/JSNumberCell.cpp:
1876 (JSC::JSNumberCell::toBoolean):
1877 * kjs/JSNumberCell.h:
1879 (JSC::JSObject::toBoolean):
1882 (JSC::JSString::toBoolean):
1885 * kjs/RegExpConstructor.cpp:
1886 (JSC::setRegExpConstructorMultiline):
1887 * kjs/RegExpObject.cpp:
1888 (JSC::RegExpObject::match):
1889 * kjs/RegExpPrototype.cpp:
1890 (JSC::regExpProtoFuncToString):
1892 2008-10-06 Maciej Stachowiak <mjs@apple.com>
1894 Reviewed by Sam Weinig.
1896 - optimize op_jtrue, op_loop_if_true and op_not in various ways
1897 https://bugs.webkit.org/show_bug.cgi?id=21404
1899 1) Make JSValue::toBoolean nonvirtual and completely inline by
1900 making use of the StructureID type field.
1902 2) Make JSValue::toBoolean not take an ExecState; doesn't need it.
1904 3) Make op_not, op_loop_if_true and op_jtrue not read the
1905 ExecState (toBoolean doesn't need it any more) and not check
1906 exceptions (toBoolean can't throw).
1908 * API/JSValueRef.cpp:
1910 * JavaScriptCore.exp:
1912 (JSC::CodeBlock::dump):
1914 (JSC::Machine::privateExecute):
1915 (JSC::Machine::cti_op_loop_if_true):
1916 (JSC::Machine::cti_op_not):
1917 (JSC::Machine::cti_op_jtrue):
1918 * kjs/ArrayPrototype.cpp:
1919 (JSC::arrayProtoFuncFilter):
1920 (JSC::arrayProtoFuncEvery):
1921 (JSC::arrayProtoFuncSome):
1922 * kjs/BooleanConstructor.cpp:
1923 (JSC::constructBoolean):
1924 (JSC::callBooleanConstructor):
1925 * kjs/GetterSetter.h:
1927 (JSC::JSValue::toBoolean):
1928 * kjs/JSNumberCell.cpp:
1929 * kjs/JSNumberCell.h:
1930 (JSC::JSNumberCell::toBoolean):
1933 (JSC::JSObject::toBoolean):
1934 (JSC::JSCell::toBoolean):
1937 (JSC::JSString::toBoolean):
1939 * kjs/RegExpConstructor.cpp:
1940 (JSC::setRegExpConstructorMultiline):
1941 * kjs/RegExpObject.cpp:
1942 (JSC::RegExpObject::match):
1943 * kjs/RegExpPrototype.cpp:
1944 (JSC::regExpProtoFuncToString):
1946 2008-10-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
1950 Build fix for MinGW.
1952 * JavaScriptCore.pri:
1954 (JSC::highResUpTime):
1956 2008-10-05 Cameron Zwarich <zwarich@apple.com>
1958 Reviewed by Oliver Hunt.
1960 Remove ScopeNode::containsClosures() now that it is unused.
1963 (JSC::ScopeNode::containsClosures):
1965 2008-10-05 Maciej Stachowiak <mjs@apple.com>
1967 Reviewed by Cameron Zwarich.
1969 - fix releas-only test failures caused by the fix to bug 21375
1972 (JSC::Machine::unwindCallFrame): Update ExecState while unwinding call frames;
1973 it now matters more to have a still-valid ExecState, since dynamicGlobalObject
1974 will make use of the ExecState's scope chain.
1977 2008-10-05 Cameron Zwarich <zwarich@apple.com>
1979 Reviewed by Oliver Hunt.
1981 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
1982 <https://bugs.webkit.org/show_bug.cgi?id=21364>
1984 Use information from the parser to detect whether an activation is
1985 needed or 'arguments' is used, and emit explicit instructions to tear
1986 them off before op_ret. This allows a branch to be removed from op_ret
1987 and simplifies some other code. This does cause a small change in the
1988 behaviour of 'f.arguments'; it is no longer live when 'arguments' is not
1989 mentioned in the lexical scope of the function.
1991 It should now be easy to remove the OptionaCalleeActivation slot in the
1992 call frame, but this will be done in a later patch.
1995 (JSC::CTI::privateCompileMainPass):
1997 (JSC::CodeBlock::dump):
1998 * VM/CodeGenerator.cpp:
1999 (JSC::CodeGenerator::emitReturn):
2000 * VM/CodeGenerator.h:
2002 (JSC::Machine::unwindCallFrame):
2003 (JSC::Machine::privateExecute):
2004 (JSC::Machine::retrieveArguments):
2005 (JSC::Machine::cti_op_create_arguments):
2006 (JSC::Machine::cti_op_tear_off_activation):
2007 (JSC::Machine::cti_op_tear_off_arguments):
2010 * kjs/Arguments.cpp:
2011 (JSC::Arguments::mark):
2013 (JSC::Arguments::isTornOff):
2014 (JSC::Arguments::Arguments):
2015 (JSC::Arguments::copyRegisters):
2016 (JSC::JSActivation::copyRegisters):
2017 * kjs/JSActivation.cpp:
2018 (JSC::JSActivation::argumentsGetter):
2019 * kjs/JSActivation.h:
2021 2008-10-05 Maciej Stachowiak <mjs@apple.com>
2023 Reviewed by Oliver Hunt.
2025 - fixed "REGRESSION (r37297): fast/js/deep-recursion-test takes too long and times out"
2026 https://bugs.webkit.org/show_bug.cgi?id=21375
2028 The problem is that dynamicGlobalObject had become O(N) in number
2029 of call frames, but unwinding the stack for an exception called it
2030 for every call frame, resulting in O(N^2) behavior for an
2031 exception thrown from inside deep recursion.
2033 Instead of doing it that way, stash the dynamic global object in JSGlobalData.
2035 * JavaScriptCore.exp:
2037 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Helper class to temporarily
2038 store and later restore a dynamicGlobalObject in JSGlobalData.
2039 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
2040 (JSC::Machine::execute): In each version, establish a DynamicGlobalObjectScope.
2041 For ProgramNode, always establish set new dynamicGlobalObject, for FunctionBody and Eval,
2042 only if none is currently set.
2045 * kjs/JSGlobalData.cpp:
2046 (JSC::JSGlobalData::JSGlobalData): Ininitalize new dynamicGlobalObject field to 0.
2047 * kjs/JSGlobalData.h:
2048 * kjs/JSGlobalObject.h:
2049 (JSC::ExecState::dynamicGlobalObject): Moved here from ExecState for benefit of inlining.
2050 Return lexical global object if this is a globalExec(), otherwise look in JSGlobalData
2051 for the one stashed there.
2053 2008-10-05 Sam Weinig <sam@webkit.org>
2055 Reviewed by Maciej Stachowiak.
2057 Avoid an extra lookup when transitioning to an existing StructureID
2058 by caching the offset of property that caused the transition.
2060 1% win on V8 suite. Wash on SunSpider.
2062 * kjs/PropertyMap.cpp:
2063 (JSC::PropertyMap::put):
2064 * kjs/PropertyMap.h:
2065 * kjs/StructureID.cpp:
2066 (JSC::StructureID::StructureID):
2067 (JSC::StructureID::addPropertyTransition):
2068 * kjs/StructureID.h:
2069 (JSC::StructureID::setCachedTransistionOffset):
2070 (JSC::StructureID::cachedTransistionOffset):
2072 2008-10-05 Cameron Zwarich <zwarich@apple.com>
2074 Reviewed by Maciej Stachowiak.
2076 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
2077 <https://bugs.webkit.org/show_bug.cgi?id=21364>
2079 This patch does not yet remove the branch, but it does a bit of refactoring
2080 so that a CodeGenerator now knows whether the associated CodeBlock will need
2081 a full scope before doing any code generation. This makes it possible to emit
2082 explicit tear-off instructions before every op_ret.
2085 (JSC::CodeBlock::CodeBlock):
2086 * VM/CodeGenerator.cpp:
2087 (JSC::CodeGenerator::generate):
2088 (JSC::CodeGenerator::CodeGenerator):
2089 (JSC::CodeGenerator::emitPushScope):
2090 (JSC::CodeGenerator::emitPushNewScope):
2092 (JSC::ScopeNode::needsActivation):
2094 2008-10-05 Gavin Barraclough <barraclough@apple.com>
2096 Reviewed by Cameron Zwarich.
2098 Fix for bug #21387 - using SamplingTool with CTI.
2100 (1) A repatch offset offset changes due to an additional instruction to update SamplingTool state.
2101 (2) Fix an incusion order problem due to ExecState changes.
2102 (3) Change to a MACHINE_SAMPLING macro, use of exec should now be accessing global data.
2105 (JSC::CTI::execute):
2106 * VM/SamplingTool.h:
2107 (JSC::SamplingTool::privateExecuteReturned):
2110 2008-10-04 Mark Rowe <mrowe@apple.com>
2112 Reviewed by Tim Hatcher.
2114 Add a 'Check For Weak VTables' build phase to catch weak vtables as early as possible.
2116 * JavaScriptCore.xcodeproj/project.pbxproj:
2118 2008-10-04 Sam Weinig <sam@webkit.org>
2120 Reviewed by Oliver Hunt.
2122 Fix https://bugs.webkit.org/show_bug.cgi?id=21320
2123 leaks of PropertyNameArrayData seen on buildbot
2125 - Fix RefPtr cycle by making PropertyNameArrayData's pointer back
2126 to the StructureID a weak pointer.
2128 * kjs/PropertyNameArray.h:
2129 (JSC::PropertyNameArrayData::setCachedStructureID):
2130 (JSC::PropertyNameArrayData::cachedStructureID):
2131 * kjs/StructureID.cpp:
2132 (JSC::StructureID::getEnumerablePropertyNames):
2133 (JSC::StructureID::clearEnumerationCache):
2134 (JSC::StructureID::~StructureID):
2136 2008-10-04 Darin Adler <darin@apple.com>
2138 Reviewed by Cameron Zwarich.
2140 - https://bugs.webkit.org/show_bug.cgi?id=21295
2141 Bug 21295: Replace ExecState with a call frame Register pointer
2143 10% faster on Richards; other v8 benchmarks faster too.
2144 A wash on SunSpider.
2146 This does the minimum necessary to get the speedup. Next step in
2147 cleaning this up is to replace ExecState with a CallFrame class,
2148 and be more judicious about when to pass a call frame and when
2149 to pass a global data pointer, global object pointer, or perhaps
2150 something else entirely.
2152 * VM/CTI.cpp: Remove the debug-only check of the exception in
2153 ctiVMThrowTrampoline -- already checked in the code the trampoline
2154 jumps to, so not all that useful. Removed the exec argument from
2155 ctiTrampoline. Removed emitDebugExceptionCheck -- no longer needed.
2156 (JSC::CTI::emitCall): Removed code to set ExecState::m_callFrame.
2157 (JSC::CTI::privateCompileMainPass): Removed code in catch to extract
2158 the exception from ExecState::m_exception; instead, the code that
2159 jumps into catch will make sure the exception is already in eax.
2160 * VM/CTI.h: Removed exec from the ctiTrampoline. Also removed the
2161 non-helpful "volatile". Temporarily left ARG_exec in as a synonym
2162 for ARG_r; I'll change that on a future cleanup pass when introducing
2163 more use of the CallFrame type.
2164 (JSC::CTI::execute): Removed the ExecState* argument.
2166 * VM/ExceptionHelpers.cpp:
2167 (JSC::InterruptedExecutionError::InterruptedExecutionError): Take
2168 JSGlobalData* instead of ExecState*.
2169 (JSC::createInterruptedExecutionException): Ditto.
2170 * VM/ExceptionHelpers.h: Ditto. Also removed an unneeded include.
2173 (JSC::slideRegisterWindowForCall): Removed the exec and
2174 exceptionValue arguments. Changed to return 0 when there's a stack
2175 overflow rather than using a separate exception argument to cut
2176 down on memory accesses in the calling convention.
2177 (JSC::Machine::unwindCallFrame): Removed the exec argument when
2178 constructing a DebuggerCallFrame. Also removed code to set
2179 ExecState::m_callFrame.
2180 (JSC::Machine::throwException): Removed the exec argument when
2181 construction a DebuggerCallFrame.
2182 (JSC::Machine::execute): Updated to use the register instead of
2183 ExecState and also removed various uses of ExecState.
2184 (JSC::Machine::debug):
2185 (JSC::Machine::privateExecute): Put globalData into a local
2186 variable so it can be used throughout the interpreter. Changed
2187 the VM_CHECK_EXCEPTION to get the exception in globalData instead
2188 of through ExecState.
2189 (JSC::Machine::retrieveLastCaller): Turn exec into a registers
2190 pointer by calling registers() instead of by getting m_callFrame.
2191 (JSC::Machine::callFrame): Ditto.
2192 Tweaked exception macros. Made new versions for when you know
2193 you have an exception. Get at global exception with ARG_globalData.
2194 Got rid of the need to pass in the return value type.
2195 (JSC::Machine::cti_op_add): Update to use new version of exception
2197 (JSC::Machine::cti_op_pre_inc): Ditto.
2198 (JSC::Machine::cti_timeout_check): Ditto.
2199 (JSC::Machine::cti_op_instanceof): Ditto.
2200 (JSC::Machine::cti_op_new_func): Ditto.
2201 (JSC::Machine::cti_op_call_JSFunction): Optimized by using the
2202 ARG values directly instead of through local variables -- this gets
2203 rid of code that just shuffles things around in the stack frame.
2204 Also get rid of ExecState and update for the new way exceptions are
2205 handled in slideRegisterWindowForCall.
2206 (JSC::Machine::cti_vm_compile): Update to make exec out of r since
2207 they are both the same thing now.
2208 (JSC::Machine::cti_op_call_NotJSFunction): Ditto.
2209 (JSC::Machine::cti_op_init_arguments): Ditto.
2210 (JSC::Machine::cti_op_resolve): Ditto.
2211 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
2212 (JSC::Machine::cti_op_construct_NotJSConstruct): Ditto.
2213 (JSC::Machine::cti_op_resolve_func): Ditto.
2214 (JSC::Machine::cti_op_put_by_val): Ditto.
2215 (JSC::Machine::cti_op_put_by_val_array): Ditto.
2216 (JSC::Machine::cti_op_resolve_skip): Ditto.
2217 (JSC::Machine::cti_op_resolve_global): Ditto.
2218 (JSC::Machine::cti_op_post_inc): Ditto.
2219 (JSC::Machine::cti_op_resolve_with_base): Ditto.
2220 (JSC::Machine::cti_op_post_dec): Ditto.
2221 (JSC::Machine::cti_op_call_eval): Ditto.
2222 (JSC::Machine::cti_op_throw): Ditto. Also rearranged to return
2223 the exception value as the return value so it can be used by
2225 (JSC::Machine::cti_op_push_scope): Ditto.
2226 (JSC::Machine::cti_op_in): Ditto.
2227 (JSC::Machine::cti_op_del_by_val): Ditto.
2228 (JSC::Machine::cti_vm_throw): Ditto. Also rearranged to return
2229 the exception value as the return value so it can be used by
2232 * kjs/DebuggerCallFrame.cpp:
2233 (JSC::DebuggerCallFrame::functionName): Pass globalData.
2234 (JSC::DebuggerCallFrame::evaluate): Eliminated code to make a
2236 * kjs/DebuggerCallFrame.h: Removed ExecState argument from
2239 * kjs/ExecState.h: Eliminated all data members and made ExecState
2240 inherit privately from Register instead. Also added a typedef to
2241 the future name for this class, which is CallFrame. It's just a
2242 Register* that knows it's a pointer at a call frame. The new class
2243 can't be constructed or copied. Changed all functions to use
2244 the this pointer instead of m_callFrame. Changed exception-related
2245 functions to access an exception in JSGlobalData. Removed functions
2246 used by CTI to pass the return address to the throw machinery --
2247 this is now done directly with a global in the global data.
2249 * kjs/FunctionPrototype.cpp:
2250 (JSC::functionProtoFuncToString): Pass globalData instead of exec.
2252 * kjs/InternalFunction.cpp:
2253 (JSC::InternalFunction::name): Take globalData instead of exec.
2254 * kjs/InternalFunction.h: Ditto.
2256 * kjs/JSGlobalData.cpp: Initialize the new exception global to 0.
2257 * kjs/JSGlobalData.h: Declare two new globals. One for the current
2258 exception and another for the return address used by CTI to
2259 implement the throw operation.
2261 * kjs/JSGlobalObject.cpp:
2262 (JSC::JSGlobalObject::init): Removed code to set up globalExec,
2263 which is now the same thing as globalCallFrame.
2264 (JSC::JSGlobalObject::reset): Get globalExec from our globalExec
2265 function so we don't have to repeat the logic twice.
2266 (JSC::JSGlobalObject::mark): Removed code to mark the exception;
2267 the exception is now stored in JSGlobalData and marked there.
2268 (JSC::JSGlobalObject::globalExec): Return a pointer to the end
2269 of the global call frame.
2270 * kjs/JSGlobalObject.h: Removed the globalExec data member.
2273 (JSC::JSObject::putDirectFunction): Pass globalData instead of exec.
2275 * kjs/collector.cpp:
2276 (JSC::Heap::collect): Mark the global exception.
2278 * profiler/ProfileGenerator.cpp:
2279 (JSC::ProfileGenerator::addParentForConsoleStart): Pass globalData
2280 instead of exec to createCallIdentifier.
2282 * profiler/Profiler.cpp:
2283 (JSC::Profiler::willExecute): Pass globalData instead of exec to
2284 createCallIdentifier.
2285 (JSC::Profiler::didExecute): Ditto.
2286 (JSC::Profiler::createCallIdentifier): Take globalData instead of
2288 (JSC::createCallIdentifierFromFunctionImp): Ditto.
2289 * profiler/Profiler.h: Change interface to take a JSGlobalData
2290 instead of an ExecState.
2292 2008-10-04 Cameron Zwarich <zwarich@apple.com>
2294 Reviewed by Darin Adler.
2296 Bug 21369: Add opcode documentation for all undocumented opcodes
2297 <https://bugs.webkit.org/show_bug.cgi?id=21369>
2299 This patch adds opcode documentation for all undocumented opcodes, and
2300 it also renames op_init_arguments to op_create_arguments.
2303 (JSC::CTI::privateCompileMainPass):
2305 (JSC::CodeBlock::dump):
2306 * VM/CodeGenerator.cpp:
2307 (JSC::CodeGenerator::CodeGenerator):
2309 (JSC::Machine::privateExecute):
2310 (JSC::Machine::cti_op_create_arguments):
2314 2008-10-03 Maciej Stachowiak <mjs@apple.com>
2316 Reviewed by Cameron Zwarich.
2318 - "this" object in methods called on primitives should be wrapper object
2319 https://bugs.webkit.org/show_bug.cgi?id=21362
2321 I changed things so that functions which use "this" do a fast
2322 version of toThisObject conversion if needed. Currently we miss
2323 the conversion entirely, at least for primitive types. Using
2324 TypeInfo and the primitive check, I made the fast case bail out
2327 This is inexplicably an 1.007x SunSpider speedup (and a wash on V8 benchmarks).
2329 Also renamed some opcodes for clarity:
2332 init_activation ==> enter_with_activation
2335 (JSC::CTI::privateCompileMainPass):
2336 (JSC::CTI::privateCompileSlowCases):
2338 (JSC::CodeBlock::dump):
2339 * VM/CodeGenerator.cpp:
2340 (JSC::CodeGenerator::generate):
2341 (JSC::CodeGenerator::CodeGenerator):
2343 (JSC::Machine::privateExecute):
2344 (JSC::Machine::cti_op_convert_this):
2347 * kjs/JSActivation.cpp:
2348 (JSC::JSActivation::JSActivation):
2349 * kjs/JSActivation.h:
2350 (JSC::JSActivation::createStructureID):
2352 (JSC::JSValue::needsThisConversion):
2353 * kjs/JSGlobalData.cpp:
2354 (JSC::JSGlobalData::JSGlobalData):
2355 * kjs/JSGlobalData.h:
2356 * kjs/JSNumberCell.h:
2357 (JSC::JSNumberCell::createStructureID):
2358 * kjs/JSStaticScopeObject.h:
2359 (JSC::JSStaticScopeObject::JSStaticScopeObject):
2360 (JSC::JSStaticScopeObject::createStructureID):
2362 (JSC::JSString::createStructureID):
2365 (JSC::TypeInfo::needsThisConversion):
2367 (JSC::ScopeNode::usesThis):
2369 2008-10-03 Cameron Zwarich <zwarich@apple.com>
2371 Reviewed by Maciej Stachowiak.
2373 Bug 21356: The size of the RegisterFile differs depending on 32-bit / 64-bit and Debug / Release
2374 <https://bugs.webkit.org/show_bug.cgi?id=21356>
2376 The RegisterFile decreases in size (measured in terms of numbers of
2377 Registers) as the size of a Register increases. This causes
2379 js1_5/Regress/regress-159334.js
2381 to fail in 64-bit debug builds. This fix makes the RegisterFile on all
2382 platforms the same size that it is in 32-bit Release builds.
2384 * VM/RegisterFile.h:
2385 (JSC::RegisterFile::RegisterFile):
2387 2008-10-03 Maciej Stachowiak <mjs@apple.com>
2389 Reviewed by Cameron Zwarich.
2391 - Some code cleanup to how we handle code features.
2393 1) Rename FeatureInfo typedef to CodeFeatures.
2394 2) Rename NodeFeatureInfo template to NodeInfo.
2395 3) Keep CodeFeature bitmask in ScopeNode instead of trying to break it out into individual bools.
2396 4) Rename misleadingly named "needsClosure" method to "containsClosures", which better describes the meaning
2398 5) Make setUsersArguments() not take an argument since it only goes one way.
2400 * JavaScriptCore.exp:
2402 (JSC::CodeBlock::CodeBlock):
2405 (JSC::Parser::didFinishParsing):
2407 (JSC::Parser::parse):
2410 (JSC::ScopeNode::ScopeNode):
2411 (JSC::ProgramNode::ProgramNode):
2412 (JSC::ProgramNode::create):
2413 (JSC::EvalNode::EvalNode):
2414 (JSC::EvalNode::create):
2415 (JSC::FunctionBodyNode::FunctionBodyNode):
2416 (JSC::FunctionBodyNode::create):
2418 (JSC::ScopeNode::usesEval):
2419 (JSC::ScopeNode::containsClosures):
2420 (JSC::ScopeNode::usesArguments):
2421 (JSC::ScopeNode::setUsesArguments):
2423 2008-10-03 Cameron Zwarich <zwarich@apple.com>
2425 Reviewed by Maciej Stachowiak.
2427 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit
2428 <https://bugs.webkit.org/show_bug.cgi?id=21343>
2430 A fix was landed for this issue in r37253, and the ChangeLog assumes
2431 that it is a compiler bug, but it turns out that it is a subtle issue
2432 with mixing signed and unsigned 32-bit values in a 64-bit environment.
2433 In order to properly fix this bug, we should convert our signed offsets
2434 into the register file to use ptrdiff_t.
2436 This may not be the only instance of this issue, but I will land this
2437 fix first and look for more later.
2440 (JSC::Machine::getArgumentsData):
2442 * kjs/Arguments.cpp:
2443 (JSC::Arguments::getOwnPropertySlot):
2445 (JSC::Arguments::init):
2447 2008-10-03 Darin Adler <darin@apple.com>
2449 * VM/CTI.cpp: Another Windows build fix. Change the args of ctiTrampoline.
2451 * kjs/JSNumberCell.h: A build fix for newer versions of gcc. Added
2452 declarations of JSGlobalData overloads of jsNumberCell.
2454 2008-10-03 Darin Adler <darin@apple.com>
2456 - try to fix Windows build
2458 * kjs/ScopeChain.h: Add forward declaration of JSGlobalData.
2460 2008-10-03 Darin Adler <darin@apple.com>
2462 Reviewed by Geoff Garen.
2464 - next step of https://bugs.webkit.org/show_bug.cgi?id=21295
2465 Turn ExecState into a call frame pointer.
2467 Remove m_globalObject and m_globalData from ExecState.
2469 SunSpider says this is a wash (slightly faster but not statistically
2470 significant); which is good enough since it's a preparation step and
2471 not supposed to be a spedup.
2473 * API/JSCallbackFunction.cpp:
2474 (JSC::JSCallbackFunction::JSCallbackFunction):
2475 * kjs/ArrayConstructor.cpp:
2476 (JSC::ArrayConstructor::ArrayConstructor):
2477 * kjs/BooleanConstructor.cpp:
2478 (JSC::BooleanConstructor::BooleanConstructor):
2479 * kjs/DateConstructor.cpp:
2480 (JSC::DateConstructor::DateConstructor):
2481 * kjs/ErrorConstructor.cpp:
2482 (JSC::ErrorConstructor::ErrorConstructor):
2483 * kjs/FunctionPrototype.cpp:
2484 (JSC::FunctionPrototype::FunctionPrototype):
2485 * kjs/JSFunction.cpp:
2486 (JSC::JSFunction::JSFunction):
2487 * kjs/NativeErrorConstructor.cpp:
2488 (JSC::NativeErrorConstructor::NativeErrorConstructor):
2489 * kjs/NumberConstructor.cpp:
2490 (JSC::NumberConstructor::NumberConstructor):
2491 * kjs/ObjectConstructor.cpp:
2492 (JSC::ObjectConstructor::ObjectConstructor):
2493 * kjs/PrototypeFunction.cpp:
2494 (JSC::PrototypeFunction::PrototypeFunction):
2495 * kjs/RegExpConstructor.cpp:
2496 (JSC::RegExpConstructor::RegExpConstructor):
2497 * kjs/StringConstructor.cpp:
2498 (JSC::StringConstructor::StringConstructor):
2499 Pass JSGlobalData* instead of ExecState* to the InternalFunction
2502 * API/OpaqueJSString.cpp: Added now-needed include.
2504 * JavaScriptCore.exp: Updated.
2507 (JSC::CTI::emitSlowScriptCheck): Changed to use ARGS_globalData
2508 instead of ARGS_exec.
2510 * VM/CTI.h: Added a new argument to the CTI, the global data pointer.
2511 While it's possible to get to the global data pointer using the
2512 ExecState pointer, it's slow enough that it's better to just keep
2513 it around in the CTI arguments.
2515 * VM/CodeBlock.h: Moved the CodeType enum here from ExecState.h.
2518 (JSC::Machine::execute): Pass fewer arguments when constructing
2519 ExecState, and pass the global data pointer when invoking CTI.
2520 (JSC::Machine::firstCallFrame): Added. Used to get the dynamic global
2521 object, which is in the scope chain of the first call frame.
2522 (JSC::Machine::cti_op_add): Use globalData instead of exec when
2523 possible, to keep fast cases fast, since it's now more expensive to
2524 get to it through the exec pointer.
2525 (JSC::Machine::cti_timeout_check): Ditto.
2526 (JSC::Machine::cti_op_put_by_id_second): Ditto.
2527 (JSC::Machine::cti_op_get_by_id_second): Ditto.
2528 (JSC::Machine::cti_op_mul): Ditto.
2529 (JSC::Machine::cti_vm_compile): Ditto.
2530 (JSC::Machine::cti_op_get_by_val): Ditto.
2531 (JSC::Machine::cti_op_sub): Ditto.
2532 (JSC::Machine::cti_op_put_by_val): Ditto.
2533 (JSC::Machine::cti_op_put_by_val_array): Ditto.
2534 (JSC::Machine::cti_op_negate): Ditto.
2535 (JSC::Machine::cti_op_div): Ditto.
2536 (JSC::Machine::cti_op_pre_dec): Ditto.
2537 (JSC::Machine::cti_op_post_inc): Ditto.
2538 (JSC::Machine::cti_op_lshift): Ditto.
2539 (JSC::Machine::cti_op_bitand): Ditto.
2540 (JSC::Machine::cti_op_rshift): Ditto.
2541 (JSC::Machine::cti_op_bitnot): Ditto.
2542 (JSC::Machine::cti_op_mod): Ditto.
2543 (JSC::Machine::cti_op_post_dec): Ditto.
2544 (JSC::Machine::cti_op_urshift): Ditto.
2545 (JSC::Machine::cti_op_bitxor): Ditto.
2546 (JSC::Machine::cti_op_bitor): Ditto.
2547 (JSC::Machine::cti_op_call_eval): Ditto.
2548 (JSC::Machine::cti_op_throw): Ditto.
2549 (JSC::Machine::cti_op_is_string): Ditto.
2550 (JSC::Machine::cti_op_debug): Ditto.
2551 (JSC::Machine::cti_vm_throw): Ditto.
2553 * VM/Machine.h: Added firstCallFrame.
2555 * kjs/DebuggerCallFrame.cpp:
2556 (JSC::DebuggerCallFrame::evaluate): Pass fewer arguments when
2557 constructing ExecState.
2559 * kjs/ExecState.cpp: Deleted contents. Later we'll remove the
2562 * kjs/ExecState.h: Removed m_globalObject and m_globalData.
2563 Moved CodeType into another header.
2564 (JSC::ExecState::ExecState): Take only a single argument, a
2566 (JSC::ExecState::dynamicGlobalObject): Get the object from
2567 the first call frame since it's no longer stored.
2568 (JSC::ExecState::globalData): Get the global data from the
2569 scope chain, since we no longer store a pointer to it here.
2570 (JSC::ExecState::identifierTable): Ditto.
2571 (JSC::ExecState::propertyNames): Ditto.
2572 (JSC::ExecState::emptyList): Ditto.
2573 (JSC::ExecState::lexer): Ditto.
2574 (JSC::ExecState::parser): Ditto.
2575 (JSC::ExecState::machine): Ditto.
2576 (JSC::ExecState::arrayTable): Ditto.
2577 (JSC::ExecState::dateTable): Ditto.
2578 (JSC::ExecState::mathTable): Ditto.
2579 (JSC::ExecState::numberTable): Ditto.
2580 (JSC::ExecState::regExpTable): Ditto.
2581 (JSC::ExecState::regExpConstructorTable): Ditto.
2582 (JSC::ExecState::stringTable): Ditto.
2583 (JSC::ExecState::heap): Ditto.
2585 * kjs/FunctionConstructor.cpp:
2586 (JSC::FunctionConstructor::FunctionConstructor): Pass
2587 JSGlobalData* instead of ExecState* to the InternalFunction
2589 (JSC::constructFunction): Pass the global data pointer when
2590 constructing a new scope chain.
2592 * kjs/InternalFunction.cpp:
2593 (JSC::InternalFunction::InternalFunction): Take a JSGlobalData*
2594 instead of an ExecState*. Later we can change more places to
2595 work this way -- it's more efficient to take the type you need
2596 since the caller might already have it.
2597 * kjs/InternalFunction.h: Ditto.
2600 (JSC::JSCell::operator new): Added an overload that takes a
2601 JSGlobalData* so you can construct without an ExecState*.
2603 * kjs/JSGlobalObject.cpp:
2604 (JSC::JSGlobalObject::init): Moved creation of the global scope
2605 chain in here, since it now requires a pointer to the global data.
2606 Moved the initialization of the call frame in here since it requires
2607 the global scope chain node. Removed the extra argument to ExecState
2608 when creating the global ExecState*.
2609 * kjs/JSGlobalObject.h: Removed initialization of globalScopeChain
2610 and the call frame from the JSGlobalObjectData constructor. Added
2611 a thisValue argument to the init function.
2613 * kjs/JSNumberCell.cpp: Added versions of jsNumberCell that take
2614 JSGlobalData* rather than ExecState*.
2615 * kjs/JSNumberCell.h:
2616 (JSC::JSNumberCell::operator new): Added a version that takes
2618 (JSC::JSNumberCell::JSNumberCell): Ditto.
2619 (JSC::jsNumber): Ditto.
2621 (JSC::jsString): Ditto.
2622 (JSC::jsSubstring): Ditto.
2623 (JSC::jsOwnedString): Ditto.
2625 (JSC::JSString::JSString): Changed to take JSGlobalData*.
2626 (JSC::jsEmptyString): Added a version that takes JSGlobalData*.
2627 (JSC::jsSingleCharacterString): Ditto.
2628 (JSC::jsSingleCharacterSubstring): Ditto.
2629 (JSC::jsNontrivialString): Ditto.
2630 (JSC::JSString::getIndex): Ditto.
2631 (JSC::jsString): Ditto.
2632 (JSC::jsSubstring): Ditto.
2633 (JSC::jsOwnedString): Ditto.
2635 * kjs/ScopeChain.h: Added a globalData pointer to each node.
2636 (JSC::ScopeChainNode::ScopeChainNode): Initialize the globalData
2638 (JSC::ScopeChainNode::push): Set the global data pointer in the
2640 (JSC::ScopeChain::ScopeChain): Take a globalData argument.
2642 * kjs/SmallStrings.cpp:
2643 (JSC::SmallStrings::createEmptyString): Take JSGlobalData* instead of
2645 (JSC::SmallStrings::createSingleCharacterString): Ditto.
2646 * kjs/SmallStrings.h:
2647 (JSC::SmallStrings::emptyString): Ditto.
2648 (JSC::SmallStrings::singleCharacterString): Ditto.
2650 2008-10-03 Cameron Zwarich <zwarich@apple.com>
2652 Reviewed by Geoff Garen.
2654 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit
2655 <https://bugs.webkit.org/show_bug.cgi?id=21343>
2657 Add a workaround for a bug in GCC, which affects GCC 4.0, GCC 4.2, and
2658 llvm-gcc 4.2. I put it in an #ifdef because it was a slight regression
2659 on SunSpider in 32-bit, although that might be entirely random.
2661 * kjs/Arguments.cpp:
2662 (JSC::Arguments::getOwnPropertySlot):
2664 2008-10-03 Darin Adler <darin@apple.com>
2666 Rubber stamped by Alexey Proskuryakov.
2668 * kjs/Shell.cpp: (main): Don't delete JSGlobalData. Later, we need to change
2669 this tool to use public JavaScriptCore API instead.
2671 2008-10-03 Darin Adler <darin@apple.com>
2673 Suggested by Alexey Proskuryakov.
2675 * kjs/JSGlobalData.cpp:
2676 (JSC::JSGlobalData::~JSGlobalData): Remove call to heap.destroy() because
2677 it's too late to ref the JSGlobalData object once it's already being
2678 destroyed. In practice this is not a problem because WebCore's JSGlobalData
2679 is never destroyed and JSGlobalContextRelease takes care of calling
2680 heap.destroy() in advance.
2682 2008-10-02 Oliver Hunt <oliver@apple.com>
2684 Reviewed by Maciej Stachowiak.
2686 Replace SSE3 check with an SSE2 check, and implement SSE2 check on windows.
2688 5.6% win on SunSpider on windows.
2691 (JSC::isSSE2Present):
2692 (JSC::CTI::compileBinaryArithOp):
2693 (JSC::CTI::compileBinaryArithOpSlowCase):
2695 2008-10-03 Maciej Stachowiak <mjs@apple.com>
2697 Rubber stamped by Cameron Zwarich.
2699 - fix mistaken change of | to || which caused a big perf regression on EarleyBoyer
2703 2008-10-02 Darin Adler <darin@apple.com>
2705 Reviewed by Geoff Garen.
2707 - https://bugs.webkit.org/show_bug.cgi?id=21321
2708 Bug 21321: speed up JavaScriptCore by inlining Heap in JSGlobalData
2710 1.019x as fast on SunSpider.
2713 (JSEvaluateScript): Use heap. instead of heap-> to work with the heap.
2714 (JSCheckScriptSyntax): Ditto.
2715 (JSGarbageCollect): Ditto.
2716 (JSReportExtraMemoryCost): Ditto.
2717 * API/JSContextRef.cpp:
2718 (JSGlobalContextRetain): Ditto.
2719 (JSGlobalContextRelease): Destroy the heap with the destroy function instead
2720 of the delete operator.
2721 (JSContextGetGlobalObject): Use heap. instead of heap-> to work with the heap.
2722 * API/JSObjectRef.cpp:
2723 (JSObjectMake): Use heap. instead of heap-> to work with the heap.
2724 (JSObjectMakeFunctionWithCallback): Ditto.
2725 (JSObjectMakeConstructor): Ditto.
2726 (JSObjectMakeFunction): Ditto.
2727 (JSObjectMakeArray): Ditto.
2728 (JSObjectMakeDate): Ditto.
2729 (JSObjectMakeError): Ditto.
2730 (JSObjectMakeRegExp): Ditto.
2731 (JSObjectHasProperty): Ditto.
2732 (JSObjectGetProperty): Ditto.
2733 (JSObjectSetProperty): Ditto.
2734 (JSObjectGetPropertyAtIndex): Ditto.
2735 (JSObjectSetPropertyAtIndex): Ditto.
2736 (JSObjectDeleteProperty): Ditto.
2737 (JSObjectCallAsFunction): Ditto.
2738 (JSObjectCallAsConstructor): Ditto.
2739 (JSObjectCopyPropertyNames): Ditto.
2740 (JSPropertyNameAccumulatorAddName): Ditto.
2741 * API/JSValueRef.cpp:
2742 (JSValueIsEqual): Ditto.
2743 (JSValueIsInstanceOfConstructor): Ditto.
2744 (JSValueMakeNumber): Ditto.
2745 (JSValueMakeString): Ditto.
2746 (JSValueToNumber): Ditto.
2747 (JSValueToStringCopy): Ditto.
2748 (JSValueToObject): Ditto.
2749 (JSValueProtect): Ditto.
2750 (JSValueUnprotect): Ditto.
2753 (JSC::ExecState::heap): Update to use the & operator.
2755 * kjs/JSGlobalData.cpp:
2756 (JSC::JSGlobalData::JSGlobalData): Update to initialize a heap member
2757 instead of calling new to make a heap.
2758 (JSC::JSGlobalData::~JSGlobalData): Destroy the heap with the destroy
2759 function instead of the delete operator.
2760 * kjs/JSGlobalData.h: Change from Heap* to a Heap.
2761 * kjs/JSGlobalObject.cpp:
2762 (JSC::JSGlobalObject::mark): Use the & operator here.
2763 (JSC::JSGlobalObject::operator new): Use heap. instead of heap-> to work
2766 2008-10-02 Cameron Zwarich <zwarich@apple.com>
2768 Reviewed by Geoff Garen.
2770 Bug 21317: Replace RegisterFile size and capacity information with Register pointers
2771 <https://bugs.webkit.org/show_bug.cgi?id=21317>
2773 This is a 2.3% speedup on the V8 DeltaBlue benchmark, a 3.3% speedup on
2774 the V8 Raytrace benchmark, and a 1.0% speedup on SunSpider.
2777 (JSC::slideRegisterWindowForCall):
2778 (JSC::Machine::callEval):
2779 (JSC::Machine::execute):
2780 (JSC::Machine::privateExecute):
2781 (JSC::Machine::cti_op_call_JSFunction):
2782 (JSC::Machine::cti_op_construct_JSConstruct):
2783 * VM/RegisterFile.cpp:
2784 (JSC::RegisterFile::~RegisterFile):
2785 * VM/RegisterFile.h:
2786 (JSC::RegisterFile::RegisterFile):
2787 (JSC::RegisterFile::start):
2788 (JSC::RegisterFile::end):
2789 (JSC::RegisterFile::size):
2790 (JSC::RegisterFile::shrink):
2791 (JSC::RegisterFile::grow):
2792 (JSC::RegisterFile::lastGlobal):
2793 (JSC::RegisterFile::markGlobals):
2794 (JSC::RegisterFile::markCallFrames):
2795 * kjs/JSGlobalObject.cpp:
2796 (JSC::JSGlobalObject::copyGlobalsTo):
2798 2008-10-02 Cameron Zwarich <zwarich@apple.com>
2800 Rubber-stamped by Darin Adler.
2802 Change bitwise operations introduced in r37166 to boolean operations. We
2803 only use bitwise operations over boolean operations for increasing
2804 performance in extremely hot code, but that does not apply to anything
2809 2008-10-02 Gavin Barraclough <barraclough@apple.com>
2811 Reviewed by Darin Adler.
2813 Fix for bug #21232 - should reset m_isPendingDash on flush,
2814 and should allow '\-' as beginning or end of a range (though
2815 not to specifiy a range itself).
2818 * wrec/CharacterClassConstructor.cpp:
2819 (JSC::CharacterClassConstructor::put):
2820 (JSC::CharacterClassConstructor::flush):
2821 * wrec/CharacterClassConstructor.h:
2822 (JSC::CharacterClassConstructor::flushBeforeEscapedHyphen):
2824 (JSC::WRECGenerator::generateDisjunction):
2825 (JSC::WRECParser::parseCharacterClass):
2826 (JSC::WRECParser::parseDisjunction):
2829 2008-10-02 Darin Adler <darin@apple.com>
2831 Reviewed by Sam Weinig.
2833 - remove the "static" from declarations in a header file, since we
2834 don't want them to have internal linkage
2836 * VM/Machine.h: Remove the static keyword from the constant and the
2837 three inline functions that Geoff just moved here.
2839 2008-10-02 Geoffrey Garen <ggaren@apple.com>
2841 Reviewed by Sam Weinig.
2843 Fixed https://bugs.webkit.org/show_bug.cgi?id=21283.
2844 Profiler Crashes When Started
2848 (JSC::makeHostCallFramePointer):
2849 (JSC::isHostCallFrame):
2850 (JSC::stripHostCallFrameBit): Moved some things to the header so
2851 JSGlobalObject could use them.
2853 * kjs/JSGlobalObject.h:
2854 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Call the
2855 new makeHostCallFramePointer API, since 0 no longer indicates a host
2858 2008-10-02 Alexey Proskuryakov <ap@webkit.org>
2860 Reviewed by Darin Adler.
2862 https://bugs.webkit.org/show_bug.cgi?id=21304
2863 Stop using a static wrapper map for WebCore JS bindings
2865 * kjs/JSGlobalData.cpp:
2866 (JSC::JSGlobalData::JSGlobalData):
2867 (JSC::JSGlobalData::~JSGlobalData):
2868 (JSC::JSGlobalData::ClientData::~ClientData):
2869 * kjs/JSGlobalData.h:
2870 Added a client data member to JSGlobalData. WebCore will use it to store bindings-related
2873 * JavaScriptCore.exp: Export virtual ClientData destructor.
2875 2008-10-02 Geoffrey Garen <ggaren@apple.com>
2879 Try to fix Qt build.
2883 2008-10-01 Geoffrey Garen <ggaren@apple.com>
2885 Reviewed by Darin Adler and Cameron Zwarich.
2887 Preliminary step toward dynamic recompilation: Standardized and
2888 simplified the parsing interface.
2890 The main goal in this patch is to make it easy to ask for a duplicate
2891 compilation, and get back a duplicate result -- same source URL, same
2892 debugger / profiler ID, same toString behavior, etc.
2894 The basic unit of compilation and evaluation is now SourceCode, which
2895 encompasses a SourceProvider, a range in that provider, and a starting
2898 A SourceProvider now encompasses a source URL, and *is* a source ID,
2899 since a pointer is a unique identifier.
2903 (JSCheckScriptSyntax): Provide a SourceCode to the Interpreter, since
2904 other APIs are no longer supported.
2907 (JSC::EvalCodeCache::get): Provide a SourceCode to the Interpreter, since
2908 other APIs are no longer supported.
2909 (JSC::CodeBlock::CodeBlock): ASSERT something that used to be ASSERTed
2910 by our caller -- this is a better bottleneck.
2912 * VM/CodeGenerator.cpp:
2913 (JSC::CodeGenerator::CodeGenerator): Updated for the fact that
2914 FunctionBodyNode's parameters are no longer a WTF::Vector.
2916 * kjs/Arguments.cpp:
2917 (JSC::Arguments::Arguments): ditto
2919 * kjs/DebuggerCallFrame.cpp:
2920 (JSC::DebuggerCallFrame::evaluate): Provide a SourceCode to the Parser,
2921 since other APIs are no longer supported.
2923 * kjs/FunctionConstructor.cpp:
2924 (JSC::constructFunction): Provide a SourceCode to the Parser, since
2925 other APIs are no longer supported. Adopt FunctionBodyNode's new
2926 "finishParsing" API.
2928 * kjs/JSFunction.cpp:
2929 (JSC::JSFunction::lengthGetter):
2930 (JSC::JSFunction::getParameterName): Updated for the fact that
2931 FunctionBodyNode's parameters are no longer a wtf::Vector.
2933 * kjs/JSFunction.h: Nixed some cruft.
2935 * kjs/JSGlobalObjectFunctions.cpp:
2936 (JSC::globalFuncEval): Provide a SourceCode to the Parser, since
2937 other APIs are no longer supported.
2940 (JSC::Parser::parse): Require a SourceCode argument, instead of a bunch
2941 of broken out parameters. Stop tracking sourceId as an integer, since we
2942 use the SourceProvider pointer for this now. Don't clamp the
2943 startingLineNumber, since SourceCode does that now.
2946 (JSC::Parser::parse): Standardized the parsing interface to require a
2952 (prettyPrintScript):
2954 (runInteractive): Provide a SourceCode to the Interpreter, since
2955 other APIs are no longer supported.
2957 * kjs/SourceProvider.h:
2958 (JSC::SourceProvider::SourceProvider):
2959 (JSC::SourceProvider::url):
2960 (JSC::SourceProvider::asId):
2961 (JSC::UStringSourceProvider::create):
2962 (JSC::UStringSourceProvider::UStringSourceProvider): Added new
2963 responsibilities described above.
2965 * kjs/SourceRange.h:
2966 (JSC::SourceCode::SourceCode):
2967 (JSC::SourceCode::toString):
2968 (JSC::SourceCode::provider):
2969 (JSC::SourceCode::firstLine):
2970 (JSC::SourceCode::data):
2971 (JSC::SourceCode::length): Added new responsibilities described above.
2972 Renamed SourceRange to SourceCode, based on review feedback. Added
2973 a makeSource function for convenience.
2975 * kjs/debugger.h: Provide a SourceCode to the client, since other APIs
2976 are no longer supported.
2978 * kjs/grammar.y: Provide startingLineNumber when creating a SourceCode.
2980 * kjs/debugger.h: Treat sourceId as intptr_t to avoid loss of precision
2983 * kjs/interpreter.cpp:
2984 (JSC::Interpreter::checkSyntax):
2985 (JSC::Interpreter::evaluate):
2986 * kjs/interpreter.h: Require a SourceCode instead of broken out arguments.
2989 (JSC::Lexer::setCode):
2991 (JSC::Lexer::sourceRange): Fold together the SourceProvider and line number
2992 into a SourceCode. Fixed a bug where the Lexer would accidentally keep
2993 alive the last SourceProvider forever.
2996 (JSC::ScopeNode::ScopeNode):
2997 (JSC::ProgramNode::ProgramNode):
2998 (JSC::ProgramNode::create):
2999 (JSC::EvalNode::EvalNode):
3000 (JSC::EvalNode::generateCode):
3001 (JSC::EvalNode::create):
3002 (JSC::FunctionBodyNode::FunctionBodyNode):
3003 (JSC::FunctionBodyNode::finishParsing):
3004 (JSC::FunctionBodyNode::create):
3005 (JSC::FunctionBodyNode::generateCode):
3006 (JSC::ProgramNode::generateCode):
3007 (JSC::FunctionBodyNode::paramString):
3010 (JSC::ScopeNode::sourceId):
3011 (JSC::FunctionBodyNode::):
3012 (JSC::FunctionBodyNode::parameterCount):
3013 (JSC::FuncExprNode::):
3014 (JSC::FuncDeclNode::): Store a SourceCode in all ScopeNodes, since
3015 SourceCode is now responsible for tracking URL, ID, etc. Streamlined
3016 some ad hoc FunctionBodyNode fixups into a "finishParsing" function, to
3017 help make clear what you need to do in order to finish parsing a
3021 (WTF::::releaseBuffer): Don't ASSERT that releaseBuffer() is only called
3022 when buffer is not 0, since FunctionBodyNode is more than happy
3023 to get back a 0 buffer, and other functions like RefPtr::release() allow
3026 2008-10-01 Cameron Zwarich <zwarich@apple.com>
3028 Reviewed by Maciej Stachowiak.
3030 Bug 21289: REGRESSION (r37160): Inspector crashes on load
3031 <https://bugs.webkit.org/show_bug.cgi?id=21289>
3033 The code in Arguments::mark() in r37160 was wrong. It marks indices in
3034 d->registers, but that makes no sense (they are local variables, not
3035 arguments). It should mark those indices in d->registerArray instead.
3037 This patch also changes Arguments::copyRegisters() to use d->numParameters
3038 instead of recomputing it.
3040 * kjs/Arguments.cpp:
3041 (JSC::Arguments::mark):
3043 (JSC::Arguments::copyRegisters):
3045 2008-09-30 Darin Adler <darin@apple.com>
3047 Reviewed by Eric Seidel.
3049 - https://bugs.webkit.org/show_bug.cgi?id=21214
3050 work on getting rid of ExecState
3052 Eliminate some unneeded uses of dynamicGlobalObject.
3054 * API/JSClassRef.cpp:
3055 (OpaqueJSClass::contextData): Changed to use a map in the global data instead
3056 of on the global object. Also fixed to use only a single hash table lookup.
3058 * API/JSObjectRef.cpp:
3059 (JSObjectMakeConstructor): Use lexicalGlobalObject rather than dynamicGlobalObject
3060 to get the object prototype.
3062 * kjs/ArrayPrototype.cpp:
3063 (JSC::arrayProtoFuncToString): Use arrayVisitedElements set in global data rather
3064 than in the global object.
3065 (JSC::arrayProtoFuncToLocaleString): Ditto.
3066 (JSC::arrayProtoFuncJoin): Ditto.
3068 * kjs/JSGlobalData.cpp:
3069 (JSC::JSGlobalData::JSGlobalData): Don't initialize opaqueJSClassData, since
3070 it's no longer a pointer.
3071 (JSC::JSGlobalData::~JSGlobalData): We still need to delete all the values, but
3072 we don't need to delete the map since it's no longer a pointer.
3074 * kjs/JSGlobalData.h: Made opaqueJSClassData a map instead of a pointer to a map.
3075 Also added arrayVisitedElements.
3077 * kjs/JSGlobalObject.h: Removed arrayVisitedElements.
3080 (functionRun): Use lexicalGlobalObject instead of dynamicGlobalObject.
3081 (functionLoad): Ditto.
3083 2008-10-01 Cameron Zwarich <zwarich@apple.com>
3087 Speculative Windows build fix.
3091 2008-10-01 Cameron Zwarich <zwarich@apple.com>
3093 Reviewed by Darin Adler.
3095 Bug 21123: using "arguments" in a function should not force creation of an activation object
3096 <https://bugs.webkit.org/show_bug.cgi?id=21123>
3098 Make the 'arguments' object not require a JSActivation. We store the
3099 'arguments' object in the OptionalCalleeArguments call frame slot. We
3100 need to be able to get the original 'arguments' object to tear it off
3101 when returning from a function, but 'arguments' may be assigned to in a
3104 Therefore, we use the OptionalCalleeArguments slot when we want to get
3105 the original activation or we know that 'arguments' was not assigned a
3106 different value. When 'arguments' may have been assigned a new value,
3107 we use a new local variable that is initialized with 'arguments'. Since
3108 a function parameter named 'arguments' may overwrite the value of
3109 'arguments', we also need to be careful to look up 'arguments' in the
3110 symbol table, so we get the parameter named 'arguments' instead of the
3111 local variable that we have added for holding the 'arguments' object.
3113 This is a 19.1% win on the V8 Raytrace benchmark using the SunSpider
3114 harness, and a 20.7% win using the V8 harness. This amounts to a 6.5%
3115 total speedup on the V8 benchmark suite using the V8 harness.
3118 (JSC::CTI::privateCompileMainPass):
3120 * VM/CodeGenerator.cpp:
3121 (JSC::CodeGenerator::CodeGenerator):
3123 (JSC::Machine::unwindCallFrame):
3124 (JSC::Machine::privateExecute):
3125 (JSC::Machine::retrieveArguments):
3126 (JSC::Machine::cti_op_init_arguments):
3127 (JSC::Machine::cti_op_ret_activation_arguments):
3129 * VM/RegisterFile.h:
3130 (JSC::RegisterFile::):
3131 * kjs/Arguments.cpp:
3132 (JSC::Arguments::mark):
3133 (JSC::Arguments::fillArgList):
3134 (JSC::Arguments::getOwnPropertySlot):
3135 (JSC::Arguments::put):
3137 (JSC::Arguments::setRegisters):
3138 (JSC::Arguments::init):
3139 (JSC::Arguments::Arguments):
3140 (JSC::Arguments::copyRegisters):
3141 (JSC::JSActivation::copyRegisters):
3142 * kjs/JSActivation.cpp:
3143 (JSC::JSActivation::argumentsGetter):
3144 * kjs/JSActivation.h:
3145 (JSC::JSActivation::JSActivationData::JSActivationData):
3148 (JSC::ScopeNode::setUsesArguments):
3149 * masm/X86Assembler.h:
3150 (JSC::X86Assembler::):
3151 (JSC::X86Assembler::orl_mr):
3153 2008-10-01 Kevin McCullough <kmccullough@apple.com>
3155 Rubberstamped by Geoff Garen.
3157 Remove BreakpointCheckStatement because it's not used anymore.
3158 No effect on sunspider or the jsc tests.
3163 2008-09-30 Oliver Hunt <oliver@apple.com>
3165 Reviewed by Geoff Garen.
3167 Improve performance of CTI on windows.
3169 Currently on platforms where the compiler doesn't allow us to safely
3170 index relative to the address of a parameter we need to actually
3171 provide a pointer to CTI runtime call arguments. This patch improves
3172 performance in this case by making the CTI logic for restoring this
3173 parameter much less conservative by only resetting it before we actually
3174 make a call, rather than between each and every SF bytecode we generate
3177 This results in a 3.6% progression on the v8 benchmark when compiled with MSVC.
3180 (JSC::CTI::emitCall):
3181 (JSC::CTI::compileOpCall):
3182 (JSC::CTI::privateCompileMainPass):
3183 (JSC::CTI::privateCompileSlowCases):
3184 (JSC::CTI::privateCompilePutByIdTransition):
3186 * masm/X86Assembler.h:
3189 2008-09-30 Maciej Stachowiak <mjs@apple.com>
3191 Reviewed by Oliver Hunt.
3193 - track uses of "this", "with" and "catch" in the parser
3195 Knowing this up front will be useful for future optimizations.
3197 Perf and correctness remain the same.
3202 2008-09-30 Sam Weinig <sam@webkit.org>
3204 Reviewed by Mark Rowe.
3206 Add WebKitAvailability macros for JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError,
3207 and JSObjectMakeRegExp
3209 * API/JSObjectRef.h:
3211 2008-09-30 Darin Adler <darin@apple.com>
3213 Reviewed by Geoff Garen.
3215 - https://bugs.webkit.org/show_bug.cgi?id=21214
3216 work on getting rid of ExecState
3218 Replaced the m_prev field of ExecState with a bit in the
3219 call frame pointer to indicate "host" call frames.
3222 (JSC::makeHostCallFramePointer): Added. Sets low bit.
3223 (JSC::isHostCallFrame): Added. Checks low bit.
3224 (JSC::stripHostCallFrameBit): Added. Clears low bit.
3225 (JSC::Machine::unwindCallFrame): Replaced null check that was
3226 formerly used to detect host call frames with an isHostCallFrame check.
3227 (JSC::Machine::execute): Pass in a host call frame pointer rather than
3228 always passing 0 when starting execution from the host. This allows us
3229 to follow the entire call frame pointer chain when desired, or to stop
3230 at the host calls when that's desired.
3231 (JSC::Machine::privateExecute): Replaced null check that was
3232 formerly used to detect host call frames with an isHostCallFrame check.
3233 (JSC::Machine::retrieveCaller): Ditto.
3234 (JSC::Machine::retrieveLastCaller): Ditto.
3235 (JSC::Machine::callFrame): Removed the code to walk up m_prev pointers
3236 and replaced it with code that uses the caller pointer and uses the
3237 stripHostCallFrameBit function.
3239 * kjs/ExecState.cpp: Removed m_prev.
3240 * kjs/ExecState.h: Ditto.
3242 2008-09-30 Cameron Zwarich <zwarich@apple.com>
3244 Reviewed by Geoff Garen.
3246 Move all detection of 'arguments' in a lexical scope to the parser, in
3247 preparation for fixing
3249 Bug 21123: using "arguments" in a function should not force creation of an activation object
3250 <https://bugs.webkit.org/show_bug.cgi?id=21123>
3252 * VM/CodeGenerator.cpp:
3253 (JSC::CodeGenerator::CodeGenerator):
3257 2008-09-30 Geoffrey Garen <ggaren@apple.com>
3262 (runWithScripts): Fixed indentation.
3264 2008-09-30 Mark Rowe <mrowe@apple.com>
3266 Rubber-stamped by Sam Weinig.
3268 Build fix. Move InternalFunction::classInfo implementation into the .cpp
3269 file to prevent the vtable for InternalFunction being generated as a weak symbol.
3270 Has no effect on SunSpider.
3272 * kjs/InternalFunction.cpp:
3273 (JSC::InternalFunction::classInfo):
3274 * kjs/InternalFunction.h:
3276 2008-09-29 Maciej Stachowiak <mjs@apple.com>
3278 Reviewed by Darin Adler.
3280 - optimize appending a number to a string
3281 https://bugs.webkit.org/show_bug.cgi?id=21203
3283 It's pretty common in real-world code (and on some of the v8
3284 benchmarks) to append a number to a string, so I made this one of
3285 the fast cases, and also added support to UString to do it
3286 directly without allocating a temporary UString.
3288 ~1% speedup on v8 benchmark.
3291 (JSC::jsAddSlowCase): Make this NEVER_INLINE because somehow otherwise
3292 the change is a regression.
3293 (JSC::jsAdd): Handle number + string special case.
3294 (JSC::Machine::cti_op_add): Integrate much of the logic of jsAdd to
3295 avoid exception check in the str + str, num + num and str + num cases.
3297 (JSC::expandedSize): Make this a non-member function, since it needs to be
3298 called in non-member functions but not outside this file.
3299 (JSC::expandCapacity): Ditto.
3300 (JSC::UString::expandCapacity): Call the non-member version.
3301 (JSC::createRep): Helper to make a rep from a char*.
3302 (JSC::UString::UString): Use above helper.
3303 (JSC::concatenate): Guts of concatenating constructor for cases where first
3304 item is a UString::Rep, and second is a UChar* and length, or a char*.
3305 (JSC::UString::append): Implement for cases where first item is a UString::Rep,
3306 and second is an int or double. Sadly duplicates logic of UString::from(int)
3307 and UString::from(double).
3310 2008-09-29 Darin Adler <darin@apple.com>
3312 Reviewed by Sam Weinig.
3314 - https://bugs.webkit.org/show_bug.cgi?id=21214
3315 work on getting rid of ExecState
3317 * JavaScriptCore.exp: Updated since JSGlobalObject::init
3318 no longer takes a parameter.
3321 (JSC::Machine::execute): Removed m_registerFile argument
3322 for ExecState constructors.
3324 * kjs/DebuggerCallFrame.cpp:
3325 (JSC::DebuggerCallFrame::evaluate): Removed globalThisValue
3326 argument for ExecState constructor.
3328 * kjs/ExecState.cpp:
3329 (JSC::ExecState::ExecState): Removed globalThisValue and
3330 registerFile arguments to constructors.
3332 * kjs/ExecState.h: Removed m_globalThisValue and
3333 m_registerFile data members.
3335 * kjs/JSGlobalObject.cpp:
3336 (JSC::JSGlobalObject::init): Removed globalThisValue
3337 argument for ExecState constructor.
3339 * kjs/JSGlobalObject.h:
3340 (JSC::JSGlobalObject::JSGlobalObject): Got rid of parameter
3341 for the init function.
3343 2008-09-29 Geoffrey Garen <ggaren@apple.com>
3345 Rubber-stamped by Cameron Zwarich.
3347 Fixed https://bugs.webkit.org/show_bug.cgi?id=21225
3348 Machine::retrieveLastCaller should check for a NULL codeBlock
3350 In order to crash, you would need to call retrieveCaller in a situation
3351 where you had two host call frames in a row in the register file. I
3352 don't know how to make that happen, or if it's even possible, so I don't
3353 have a test case -- but better safe than sorry!
3356 (JSC::Machine::retrieveLastCaller):
3358 2008-09-29 Geoffrey Garen <ggaren@apple.com>
3360 Reviewed by Cameron Zwarich.
3362 Store the callee ScopeChain, not the caller ScopeChain, in the call frame
3363 header. Nix the "scopeChain" local variable and ExecState::m_scopeChain, and
3364 access the callee ScopeChain through the call frame header instead.
3366 Profit: call + return are simpler, because they don't have to update the
3367 "scopeChain" local variable, or ExecState::m_scopeChain.
3369 Because CTI keeps "r" in a register, reading the callee ScopeChain relative
3370 to "r" can be very fast, in any cases we care to optimize.
3372 0% speedup on empty function call benchmark. (5.5% speedup in bytecode.)
3373 0% speedup on SunSpider. (7.5% speedup on controlflow-recursive.)
3374 2% speedup on SunSpider --v8.
3375 2% speedup on v8 benchmark.
3377 * VM/CTI.cpp: Changed scope chain access to read the scope chain from
3378 the call frame header. Sped up op_ret by changing it not to fuss with
3379 the "scopeChain" local variable or ExecState::m_scopeChain.
3381 * VM/CTI.h: Updated CTI trampolines not to take a ScopeChainNode*
3382 argument, since that's stored in the call frame header now.
3384 * VM/Machine.cpp: Access "scopeChain" and "codeBlock" through new helper
3385 functions that read from the call frame header. Updated functions operating
3386 on ExecState::m_callFrame to account for / take advantage of the fact that
3387 Exec:m_callFrame is now never NULL.
3389 Fixed a bug in op_construct, where it would use the caller's default
3390 object prototype, rather than the callee's, when constructing a new object.
3392 * VM/Machine.h: Made some helper functions available. Removed
3393 ScopeChainNode* arguments to a lot of functions, since the ScopeChainNode*
3394 is now stored in the call frame header.
3396 * VM/RegisterFile.h: Renamed "CallerScopeChain" to "ScopeChain", since
3397 that's what it is now.
3399 * kjs/DebuggerCallFrame.cpp: Updated for change to ExecState signature.
3401 * kjs/ExecState.cpp:
3402 * kjs/ExecState.h: Nixed ExecState::m_callFrame, along with the unused
3403 isGlobalObject function.
3405 * kjs/JSGlobalObject.cpp:
3406 * kjs/JSGlobalObject.h: Gave the global object a fake call frame in
3407 which to store the global scope chain, since our code now assumes that
3408 it can always read the scope chain out of the ExecState's call frame.
3410 2008-09-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3412 Reviewed by Sam Weinig.
3414 Remove the isActivationObject() virtual method on JSObject and use
3415 StructureID information instead. This should be slightly faster, but
3416 isActivationObject() is only used in assertions and unwinding the stack
3421 (JSC::Machine::unwindCallFrame):
3422 (JSC::Machine::privateExecute):
3423 (JSC::Machine::cti_op_ret_activation):
3424 * kjs/JSActivation.cpp:
3425 * kjs/JSActivation.h:
3428 2008-09-29 Peter Gal <galpeter@inf.u-szeged.hu>
3430 Reviewed and tweaked by Darin Adler.
3432 Fix build for non-all-in-one platforms.
3434 * kjs/StringPrototype.cpp: Added missing ASCIICType.h include.
3436 2008-09-29 Bradley T. Hughes <bradley.hughes@nokia.com>
3438 Reviewed by Simon Hausmann.
3440 Fix compilation with icpc
3446 2008-09-29 Thiago Macieira <thiago.macieira@nokia.com>
3448 Reviewed by Simon Hausmann.
3450 Changed copyright from Trolltech ASA to Nokia.
3452 Nokia acquired Trolltech ASA, assets were transferred on September 26th 2008.
3455 * wtf/qt/MainThreadQt.cpp:
3457 2008-09-29 Simon Hausmann <hausmann@webkit.org>
3459 Reviewed by Lars Knoll.
3461 Don't accidentially install libJavaScriptCore.a for the build inside
3464 * JavaScriptCore.pro:
3466 2008-09-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3468 Reviewed by Maciej Stachowiak.
3470 Bug 21200: Allow direct access to 'arguments' without using op_resolve
3471 <https://bugs.webkit.org/show_bug.cgi?id=21200>
3473 Allow fast access to the 'arguments' object by adding an extra slot to
3474 the callframe to store it.
3476 This is a 3.0% speedup on the V8 Raytrace benchmark.
3478 * JavaScriptCore.exp:
3480 (JSC::CTI::privateCompileMainPass):
3482 (JSC::CodeBlock::dump):
3483 * VM/CodeGenerator.cpp:
3484 (JSC::CodeGenerator::CodeGenerator):
3485 (JSC::CodeGenerator::registerFor):
3486 * VM/CodeGenerator.h:
3487 (JSC::CodeGenerator::registerFor):
3489 (JSC::Machine::initializeCallFrame):
3490 (JSC::Machine::dumpRegisters):
3491 (JSC::Machine::privateExecute):
3492 (JSC::Machine::retrieveArguments):
3493 (JSC::Machine::cti_op_call_JSFunction):
3494 (JSC::Machine::cti_op_create_arguments):
3495 (JSC::Machine::cti_op_construct_JSConstruct):
3498 * VM/RegisterFile.h:
3499 (JSC::RegisterFile::):
3500 * kjs/JSActivation.cpp:
3501 (JSC::JSActivation::mark):
3502 (JSC::JSActivation::argumentsGetter):
3503 * kjs/JSActivation.h:
3504 (JSC::JSActivation::JSActivationData::JSActivationData):
3507 (JSC::Parser::didFinishParsing):
3509 (JSC::Parser::parse):
3512 (JSC::ScopeNode::ScopeNode):
3513 (JSC::ProgramNode::ProgramNode):
3514 (JSC::ProgramNode::create):
3515 (JSC::EvalNode::EvalNode):
3516 (JSC::EvalNode::create):
3517 (JSC::FunctionBodyNode::FunctionBodyNode):
3518 (JSC::FunctionBodyNode::create):
3520 (JSC::ScopeNode::usesArguments):
3522 2008-09-28 Mark Rowe <mrowe@apple.com>
3524 Reviewed by Sam Weinig.
3526 Add an ASCII fast-path to toLowerCase and toUpperCase.
3528 The fast path speeds up the common case of an ASCII-only string by up to 60% while adding a less than 5% penalty
3529 to the less common non-ASCII case.
3531 This also removes stringProtoFuncToLocaleLowerCase and stringProtoFuncToLocaleUpperCase, which were identical
3532 to the non-locale variants of the functions. toLocaleLowerCase and toLocaleUpperCase now use the non-locale
3533 variants of the functions directly.
3535 * kjs/StringPrototype.cpp:
3536 (JSC::stringProtoFuncToLowerCase):
3537 (JSC::stringProtoFuncToUpperCase):
3539 2008-09-28 Mark Rowe <mrowe@apple.com>
3541 Reviewed by Cameron Zwarich.
3543 Speed up parseInt and parseFloat.
3545 Repeatedly indexing into a UString is slow, so retrieve a pointer into the underlying buffer once up front
3546 and use that instead. This is a 7% win on a parseInt/parseFloat micro-benchmark.
3548 * kjs/JSGlobalObjectFunctions.cpp:
3552 2008-09-28 Simon Hausmann <hausmann@webkit.org>
3554 Reviewed by David Hyatt.
3556 In Qt's initializeThreading re-use an existing thread identifier for the main
3557 thread if it exists.
3559 currentThread() implicitly creates new identifiers and it could be that
3560 it is called before initializeThreading().
3562 * wtf/ThreadingQt.cpp:
3563 (WTF::initializeThreading):
3565 2008-09-27 Keishi Hattori <casey.hattori@gmail.com>
3567 Added Machine::retrieveCaller to the export list.
3569 Reviewed by Kevin McCullough and Tim Hatcher.
3571 * JavaScriptCore.exp: Added Machine::retrieveCaller.
3573 2008-09-27 Anders Carlsson <andersca@apple.com>
3580 2008-09-27 Geoffrey Garen <ggaren@apple.com>
3582 Reviewed by Cameron Zwarich.
3584 https://bugs.webkit.org/show_bug.cgi?id=21175
3586 Store the callee CodeBlock, not the caller CodeBlock, in the call frame
3587 header. Nix the "codeBlock" local variable, and access the callee
3588 CodeBlock through the call frame header instead.
3590 Profit: call + return are simpler, because they don't have to update the
3591 "codeBlock" local variable.
3593 Because CTI keeps "r" in a register, reading the callee CodeBlock relative