1 2008-12-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3 Reviewed by Oliver Hunt.
5 Bug 23054: Caching of global lookups occurs even when the global object has become a dictionary
6 <https://bugs.webkit.org/show_bug.cgi?id=23054>
7 <rdar://problem/6469905>
9 * interpreter/Interpreter.cpp:
10 (JSC::Interpreter::resolveGlobal): Do not cache lookup if the global
11 object has transitioned to a dictionary.
12 (JSC::Interpreter::cti_op_resolve_global): Do not cache lookup if the
13 global object has transitioned to a dictionary.
15 2008-12-30 Oliver Hunt <oliver@apple.com>
17 Reviewed by Darin Adler.
19 <https://bugs.webkit.org/show_bug.cgi?id=23049> [jsfunfuzz] With blocks do not correctly protect their scope object
20 <rdar://problem/6469742> Crash in JSC::TypeInfo::hasStandardGetOwnPropertySlot() running jsfunfuzz
22 The problem that caused this was that with nodes were not correctly protecting
23 the final object that was placed in the scope chain. We correct this by forcing
24 the use of a temporary register (which stops us relying on a local register
25 protecting the scope) and changing the behaviour of op_push_scope so that it
26 will store the final scope object.
28 * bytecompiler/BytecodeGenerator.cpp:
29 (JSC::BytecodeGenerator::emitPushScope):
30 * interpreter/Interpreter.cpp:
31 (JSC::Interpreter::privateExecute):
32 (JSC::Interpreter::cti_op_push_scope):
33 * interpreter/Interpreter.h:
35 (JSC::JIT::privateCompileMainPass):
37 (JSC::WithNode::emitBytecode):
39 2008-12-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
41 Reviewed by Sam Weinig.
43 Bug 23037: Parsing and reparsing disagree on automatic semicolon insertion
44 <https://bugs.webkit.org/show_bug.cgi?id=23037>
45 <rdar://problem/6467124>
47 Parsing and reparsing disagree about automatic semicolon insertion, so that a
52 is parsed as being syntactically valid but gets a syntax error upon reparsing.
53 This leads to an assertion failure in Parser::reparse(). It is not that big of
54 an issue in practice, because in a Release build such a function will return
55 'undefined' when called.
57 In this case, we are not following the spec and it should be a syntax error.
58 However, unless there is a newline separating the ',' and the '}', WebKit would
59 not treat it as a syntax error in the past either. It would be a bit of work to
60 make the automatic semicolon insertion match the spec exactly, so this patch
61 changes it to match our past behaviour.
63 The problem is that even during reparsing, the Lexer adds a semicolon at the
64 end of the input, which confuses allowAutomaticSemicolon(), because it is
65 expecting either a '}', the end of input, or a terminator like a newline.
68 (JSC::Lexer::Lexer): Initialize m_isReparsing to false.
69 (JSC::Lexer::lex): Do not perform automatic semicolon insertion in the Lexer if
70 we are in the middle of reparsing.
71 (JSC::Lexer::clear): Set m_isReparsing to false.
73 (JSC::Lexer::setIsReparsing): Added.
75 (JSC::Parser::reparse): Call Lexer::setIsReparsing() to notify the Lexer of
78 2008-12-29 Oliver Hunt <oliver@apple.com>
80 Reviewed by NOBODY (Build fix).
82 Yet another attempt to fix Tiger.
84 * wtf/RandomNumber.cpp:
87 2008-12-29 Oliver Hunt <oliver@apple.com>
89 Reviewed by NOBODY (Build fix).
91 Tiger build fix (correct this time)
93 * wtf/RandomNumber.cpp:
95 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
97 Rubber-stamped by Alexey Proskuryakov.
99 Revert r39509, because kjsyydebug is used in the generated code if YYDEBUG is 1.
103 2008-12-29 Oliver Hunt <oliver@apple.com>
105 Reviewed by NOBODY (Build fix).
109 * wtf/RandomNumber.cpp:
111 2008-12-29 Oliver Hunt <oliver@apple.com>
113 Reviewed by Mark Rowe.
115 <rdar://problem/6358108> Insecure randomness in Math.random() leads to user tracking
117 Switch to arc4random on PLATFORM(DARWIN), this is ~1.5x slower than random(), but the
118 it is still so fast that there is no fathomable way it could be a bottleneck for anything.
120 randomNumber is called in two places
121 * During form submission where it is called once per form
122 * Math.random in JSC. For this difference to show up you have to be looping on
123 a cached local copy of random, for a large (>10000) calls.
125 No change in SunSpider.
127 * wtf/RandomNumber.cpp:
129 * wtf/RandomNumberSeed.h:
130 (WTF::initializeRandomNumberGenerator):
132 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
134 Rubber-stamped by Sam Weinig.
136 Remove unused kjsyydebug #define.
140 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
142 Reviewed by Oliver Hunt and Sam Weinig.
144 Bug 23029: REGRESSION (r39337): jsfunfuzz generates identical test files
145 <https://bugs.webkit.org/show_bug.cgi?id=23029>
146 <rdar://problem/6469185>
148 The unification of random number generation in r39337 resulted in random()
149 being initialized on Darwin, but rand() actually being used. Fix this by
150 making randomNumber() use random() instead of rand() on Darwin.
152 * wtf/RandomNumber.cpp:
155 2008-12-29 Sam Weinig <sam@webkit.org>
159 * runtime/Structure.cpp:
161 2008-12-29 Sam Weinig <sam@webkit.org>
163 Reviewed by Oliver Hunt.
165 Patch for https://bugs.webkit.org/show_bug.cgi?id=23026
166 Move the deleted offsets vector into the PropertyMap
168 Saves 3 words per Structure.
170 * runtime/PropertyMapHashTable.h:
171 * runtime/Structure.cpp:
172 (JSC::Structure::addPropertyTransition):
173 (JSC::Structure::changePrototypeTransition):
174 (JSC::Structure::getterSetterTransition):
175 (JSC::Structure::toDictionaryTransition):
176 (JSC::Structure::fromDictionaryTransition):
177 (JSC::Structure::copyPropertyTable):
178 (JSC::Structure::put):
179 (JSC::Structure::remove):
180 (JSC::Structure::rehashPropertyMapHashTable):
181 * runtime/Structure.h:
182 (JSC::Structure::propertyStorageSize):
184 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
186 Reviewed by Oliver Hunt.
188 Change code using m_body.get() as a boolean to take advantage of the
189 implicit conversion of RefPtr to boolean.
191 * runtime/JSFunction.cpp:
192 (JSC::JSFunction::~JSFunction):
194 2008-12-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
196 Reviewed by Oliver Hunt.
198 Bug 22840: REGRESSION (r38349): Gmail doesn't load with profiling enabled
199 <https://bugs.webkit.org/show_bug.cgi?id=22840>
200 <rdar://problem/6468077>
202 * bytecompiler/BytecodeGenerator.cpp:
203 (JSC::BytecodeGenerator::emitNewArray): Add an assertion that the range
204 of registers passed to op_new_array is sequential.
205 (JSC::BytecodeGenerator::emitCall): Correct the relocation of registers
206 when emitting profiler hooks so that registers aren't leaked. Also, add
207 an assertion that the 'this' register is always ref'd (because it is),
208 remove the needless protection of the 'this' register when relocating,
209 and add an assertion that the range of registers passed to op_call for
210 function call arguments is sequential.
211 (JSC::BytecodeGenerator::emitConstruct): Correct the relocation of
212 registers when emitting profiler hooks so that registers aren't leaked.
213 Also, add an assertion that the range of registers passed to op_construct
214 for function call arguments is sequential.
216 2008-12-26 Mark Rowe <mrowe@apple.com>
218 Reviewed by Alexey Proskuryakov.
220 <rdar://problem/6467376> Race condition in WTF::currentThread can lead to a thread using two different identifiers during its lifetime
222 If a newly-created thread calls WTF::currentThread() before WTF::createThread calls establishIdentifierForPthreadHandle
223 then more than one identifier will be used for the same thread. We can avoid this by adding some extra synchronization
224 during thread creation that delays the execution of the thread function until the thread identifier has been set up, and
225 an assertion to catch this problem should it reappear in the future.
227 * wtf/Threading.cpp: Added.
228 (WTF::NewThreadContext::NewThreadContext):
229 (WTF::threadEntryPoint):
230 (WTF::createThread): Add cross-platform createThread function that delays the execution of the thread function until
231 after the thread identifier has been set up.
233 * wtf/ThreadingGtk.cpp:
234 (WTF::establishIdentifierForThread):
235 (WTF::createThreadInternal):
236 * wtf/ThreadingNone.cpp:
237 (WTF::createThreadInternal):
238 * wtf/ThreadingPthreads.cpp:
239 (WTF::establishIdentifierForPthreadHandle):
240 (WTF::createThreadInternal):
241 * wtf/ThreadingQt.cpp:
242 (WTF::identifierByQthreadHandle):
243 (WTF::establishIdentifierForThread):
244 (WTF::createThreadInternal):
245 * wtf/ThreadingWin.cpp:
246 (WTF::storeThreadHandleByIdentifier):
247 (WTF::createThreadInternal):
249 Add Threading.cpp to the build.
252 * JavaScriptCore.pri:
253 * JavaScriptCore.scons:
254 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
255 * JavaScriptCore.xcodeproj/project.pbxproj:
256 * JavaScriptCoreSources.bkl:
258 2008-12-26 Sam Weinig <sam@webkit.org>
260 Reviewed by Alexey Proskuryakov.
262 Remove unused method.
264 * runtime/Structure.h: Remove mutableTypeInfo.
266 2008-12-22 Gavin Barraclough <barraclough@apple.com>
268 Reviewed by Oliver Hunt.
270 Fix rounding / bounds / signed comparison bug in ExecutableAllocator.
272 ExecutableAllocator::alloc assumed that m_freePtr would be aligned. This was
273 not always true, since the first allocation from an additional pool would not
274 be rounded up. Subsequent allocations would be unaligned, and too much memory
275 could be erroneously allocated from the pool, when the size requested was
276 available, but the size rounded up to word granularity was not available in the
277 pool. This may result in the value of m_freePtr being greater than m_end.
279 Under these circumstances, the unsigned check for space will always pass,
280 resulting in pointers to memory outside of the arena being returned, and
281 ultimately segfaulty goodness when attempting to memcpy the hot freshly jitted
282 code from the AssemblerBuffer.
284 https://bugs.webkit.org/show_bug.cgi?id=22974
285 ... and probably many, many more.
287 * jit/ExecutableAllocator.h:
288 (JSC::ExecutablePool::alloc):
289 (JSC::ExecutablePool::roundUpAllocationSize):
290 (JSC::ExecutablePool::ExecutablePool):
291 (JSC::ExecutablePool::poolAllocate):
293 2008-12-22 Sam Weinig <sam@webkit.org>
295 Reviewed by Gavin Barraclough.
297 Rename all uses of the term "repatch" to "patch".
299 * assembler/MacroAssembler.h:
300 (JSC::MacroAssembler::DataLabelPtr::patch):
301 (JSC::MacroAssembler::DataLabel32::patch):
302 (JSC::MacroAssembler::Jump::patch):
303 (JSC::MacroAssembler::PatchBuffer::PatchBuffer):
304 (JSC::MacroAssembler::PatchBuffer::setPtr):
305 (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
306 (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
307 (JSC::MacroAssembler::storePtrWithPatch):
308 (JSC::MacroAssembler::jnePtrWithPatch):
309 * assembler/X86Assembler.h:
310 (JSC::X86Assembler::patchAddress):
311 (JSC::X86Assembler::patchImmediate):
312 (JSC::X86Assembler::patchPointer):
313 (JSC::X86Assembler::patchBranchOffset):
314 * interpreter/Interpreter.cpp:
315 (JSC::Interpreter::tryCTICachePutByID):
316 (JSC::Interpreter::tryCTICacheGetByID):
317 (JSC::Interpreter::cti_op_put_by_id):
318 (JSC::Interpreter::cti_op_get_by_id):
319 (JSC::Interpreter::cti_op_get_by_id_self_fail):
320 (JSC::Interpreter::cti_op_get_by_id_proto_list):
321 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
323 (JSC::ctiPatchCallByReturnAddress):
324 (JSC::JIT::privateCompileMainPass):
325 (JSC::JIT::privateCompile):
326 (JSC::JIT::privateCompileCTIMachineTrampolines):
329 (JSC::JIT::unlinkCall):
330 (JSC::JIT::linkCall):
331 (JSC::JIT::compileOpCall):
332 * jit/JITPropertyAccess.cpp:
333 (JSC::JIT::compileGetByIdHotPath):
334 (JSC::JIT::compilePutByIdHotPath):
335 (JSC::JIT::compileGetByIdSlowCase):
336 (JSC::JIT::compilePutByIdSlowCase):
337 (JSC::JIT::privateCompilePutByIdTransition):
338 (JSC::JIT::patchGetByIdSelf):
339 (JSC::JIT::patchPutByIdReplace):
340 (JSC::JIT::privateCompilePatchGetArrayLength):
341 (JSC::JIT::privateCompileGetByIdSelf):
342 (JSC::JIT::privateCompileGetByIdProto):
343 (JSC::JIT::privateCompileGetByIdSelfList):
344 (JSC::JIT::privateCompileGetByIdProtoList):
345 (JSC::JIT::privateCompileGetByIdChainList):
346 (JSC::JIT::privateCompileGetByIdChain):
347 (JSC::JIT::privateCompilePutByIdReplace):
349 2008-12-22 Adam Roben <aroben@apple.com>
351 Build fix after r39428
354 (JSC::JIT::compileOpCallSlowCase): Added a missing MacroAssembler::
356 2008-12-22 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
358 Rubber-stamped by George Staikos.
360 Unify all TorchMobile copyright lines. Consolidate in a single line, as requested by Mark Rowe, some time ago.
362 * wtf/RandomNumber.cpp:
363 * wtf/RandomNumber.h:
364 * wtf/RandomNumberSeed.h:
366 2008-12-21 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
368 Rubber-stamped by George Staikos.
370 Fix copyright of the new RandomNumber* files.
372 * wtf/RandomNumber.cpp:
373 * wtf/RandomNumber.h:
374 * wtf/RandomNumberSeed.h:
376 2008-12-21 Gavin Barraclough <barraclough@apple.com>
378 Reviewed by Oliver Hunt & Cameron Zwarich.
380 Add support for call and property access repatching on x86-64.
382 No change in performance on current configurations (2x impovement on v8-tests with JIT enabled on x86-64).
384 * assembler/MacroAssembler.h:
385 (JSC::MacroAssembler::DataLabelPtr::repatch):
386 (JSC::MacroAssembler::DataLabelPtr::operator X86Assembler::JmpDst):
387 (JSC::MacroAssembler::DataLabel32::repatch):
388 (JSC::MacroAssembler::RepatchBuffer::addressOf):
389 (JSC::MacroAssembler::add32):
390 (JSC::MacroAssembler::sub32):
391 (JSC::MacroAssembler::loadPtrWithAddressOffsetRepatch):
392 (JSC::MacroAssembler::storePtrWithAddressOffsetRepatch):
393 (JSC::MacroAssembler::jePtr):
394 (JSC::MacroAssembler::jnePtr):
395 (JSC::MacroAssembler::jnePtrWithRepatch):
396 (JSC::MacroAssembler::differenceBetween):
397 * assembler/X86Assembler.h:
398 (JSC::X86Assembler::addl_im):
399 (JSC::X86Assembler::subl_im):
400 (JSC::X86Assembler::cmpl_rm):
401 (JSC::X86Assembler::movq_rm_disp32):
402 (JSC::X86Assembler::movq_mr_disp32):
403 (JSC::X86Assembler::repatchPointer):
404 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp32):
406 (JSC::JIT::privateCompile):
407 (JSC::JIT::privateCompileCTIMachineTrampolines):
410 (JSC::JIT::unlinkCall):
411 (JSC::JIT::linkCall):
412 (JSC::JIT::compileOpCall):
413 (JSC::JIT::compileOpCallSlowCase):
414 * jit/JITInlineMethods.h:
415 (JSC::JIT::restoreArgumentReferenceForTrampoline):
416 * jit/JITPropertyAccess.cpp:
417 (JSC::JIT::compileGetByIdHotPath):
418 (JSC::JIT::compileGetByIdSlowCase):
419 (JSC::JIT::compilePutByIdHotPath):
420 (JSC::JIT::compilePutByIdSlowCase):
421 (JSC::resizePropertyStorage):
422 (JSC::JIT::privateCompilePutByIdTransition):
423 (JSC::JIT::privateCompileGetByIdProto):
424 (JSC::JIT::privateCompileGetByIdProtoList):
425 (JSC::JIT::privateCompileGetByIdChainList):
426 (JSC::JIT::privateCompileGetByIdChain):
429 2008-12-20 Gavin Barraclough <barraclough@apple.com>
431 Reviewed by Oliver Hunt.
433 Port optimized property access generation to the MacroAssembler.
435 * assembler/MacroAssembler.h:
436 (JSC::MacroAssembler::AbsoluteAddress::AbsoluteAddress):
437 (JSC::MacroAssembler::DataLabelPtr::repatch):
438 (JSC::MacroAssembler::DataLabel32::DataLabel32):
439 (JSC::MacroAssembler::DataLabel32::repatch):
440 (JSC::MacroAssembler::Label::operator X86Assembler::JmpDst):
441 (JSC::MacroAssembler::Jump::repatch):
442 (JSC::MacroAssembler::JumpList::empty):
443 (JSC::MacroAssembler::RepatchBuffer::link):
444 (JSC::MacroAssembler::add32):
445 (JSC::MacroAssembler::and32):
446 (JSC::MacroAssembler::sub32):
447 (JSC::MacroAssembler::loadPtrWithAddressRepatch):
448 (JSC::MacroAssembler::storePtrWithAddressRepatch):
449 (JSC::MacroAssembler::push):
450 (JSC::MacroAssembler::ja32):
451 (JSC::MacroAssembler::jePtr):
452 (JSC::MacroAssembler::jnePtr):
453 (JSC::MacroAssembler::jnePtrWithRepatch):
454 (JSC::MacroAssembler::align):
455 (JSC::MacroAssembler::differenceBetween):
456 * assembler/X86Assembler.h:
457 (JSC::X86Assembler::movl_rm_disp32):
458 (JSC::X86Assembler::movl_mr_disp32):
459 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp32):
460 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
462 (JSC::ctiRepatchCallByReturnAddress):
463 (JSC::JIT::privateCompileMainPass):
464 (JSC::JIT::privateCompile):
465 (JSC::JIT::privateCompileCTIMachineTrampolines):
467 * jit/JITPropertyAccess.cpp:
468 (JSC::JIT::compileGetByIdHotPath):
469 (JSC::JIT::compileGetByIdSlowCase):
470 (JSC::JIT::compilePutByIdHotPath):
471 (JSC::JIT::compilePutByIdSlowCase):
472 (JSC::resizePropertyStorage):
473 (JSC::JIT::privateCompilePutByIdTransition):
474 (JSC::JIT::patchGetByIdSelf):
475 (JSC::JIT::patchPutByIdReplace):
476 (JSC::JIT::privateCompilePatchGetArrayLength):
477 (JSC::JIT::privateCompileGetByIdSelf):
478 (JSC::JIT::privateCompileGetByIdProto):
479 (JSC::JIT::privateCompileGetByIdSelfList):
480 (JSC::JIT::privateCompileGetByIdProtoList):
481 (JSC::JIT::privateCompileGetByIdChainList):
482 (JSC::JIT::privateCompileGetByIdChain):
483 (JSC::JIT::privateCompilePutByIdReplace):
485 (WTF::RefCountedBase::addressOfCount):
487 2008-12-19 Gustavo Noronha Silva <gns@gnome.org>
489 Reviewed by Holger Freyther.
491 https://bugs.webkit.org/show_bug.cgi?id=22686
493 Added file which was missing to the javascriptcore_sources
494 variable, so that it shows up in the tarball created by `make
499 2008-12-19 Holger Hans Peter Freyther <zecke@selfish.org>
501 Reviewed by Antti Koivisto.
503 Build fix when building JS API tests with a c89 c compiler
505 Do not use C++ style comments and convert them to C comments.
509 2008-12-18 Gavin Barraclough <barraclough@apple.com>
511 Reviewed by Sam Weinig.
513 Same as last revision, adding cases for pre & post inc & dec.
515 https://bugs.webkit.org/show_bug.cgi?id=22928
518 (JSC::JIT::privateCompileMainPass):
520 2008-12-18 Gavin Barraclough <barraclough@apple.com>
522 Reviewed by Sam Weinig.
524 Fixes for the JIT's handling of JSImmediate values on x86-64.
525 On 64-bit systems, the code in JSImmediate.h relies on the upper
526 bits of a JSImmediate being a sign extension of the low 32-bits.
527 This was not being enforced by the JIT, since a number of inline
528 operations were being performed on 32-bit values in registers, and
529 when a 32-bit result is written to a register on x86-64 the value
530 is zero-extended to 64-bits.
532 This fix honors previous behavoir. A better fix in the long run
533 (when the JIT is enabled by default) may be to change JSImmediate.h
534 so it no longer relies on the upper bits of the pointer,... though
535 if we're going to change JSImmediate.h for 64-bit, we probably may
536 as well change the format so that the full range of 32-bit ints can
537 be stored, rather than just 31-bits.
539 https://bugs.webkit.org/show_bug.cgi?id=22925
541 * assembler/MacroAssembler.h:
542 (JSC::MacroAssembler::addPtr):
543 (JSC::MacroAssembler::andPtr):
544 (JSC::MacroAssembler::orPtr):
545 (JSC::MacroAssembler::or32):
546 (JSC::MacroAssembler::xor32):
547 (JSC::MacroAssembler::xorPtr):
548 (JSC::MacroAssembler::signExtend32ToPtr):
549 * assembler/X86Assembler.h:
550 (JSC::X86Assembler::):
551 (JSC::X86Assembler::andq_rr):
552 (JSC::X86Assembler::andq_ir):
553 (JSC::X86Assembler::orq_rr):
554 (JSC::X86Assembler::xorq_ir):
555 (JSC::X86Assembler::movsxd_rr):
557 (JSC::JIT::privateCompileMainPass):
558 * jit/JITInlineMethods.h:
559 (JSC::JIT::emitFastArithReTagImmediate):
560 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
561 (JSC::JIT::emitFastArithImmToInt):
563 2008-12-18 Gavin Barraclough <barraclough@apple.com>
565 Reviewed by Sam Weinig.
567 Just a tidy up - rename & refactor some the #defines configuring the JIT.
569 * interpreter/Interpreter.cpp:
570 (JSC::Interpreter::cti_op_convert_this):
571 (JSC::Interpreter::cti_op_end):
572 (JSC::Interpreter::cti_op_add):
573 (JSC::Interpreter::cti_op_pre_inc):
574 (JSC::Interpreter::cti_timeout_check):
575 (JSC::Interpreter::cti_register_file_check):
576 (JSC::Interpreter::cti_op_loop_if_less):
577 (JSC::Interpreter::cti_op_loop_if_lesseq):
578 (JSC::Interpreter::cti_op_new_object):
579 (JSC::Interpreter::cti_op_put_by_id_generic):
580 (JSC::Interpreter::cti_op_get_by_id_generic):
581 (JSC::Interpreter::cti_op_put_by_id):
582 (JSC::Interpreter::cti_op_put_by_id_second):
583 (JSC::Interpreter::cti_op_put_by_id_fail):
584 (JSC::Interpreter::cti_op_get_by_id):
585 (JSC::Interpreter::cti_op_get_by_id_second):
586 (JSC::Interpreter::cti_op_get_by_id_self_fail):
587 (JSC::Interpreter::cti_op_get_by_id_proto_list):
588 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
589 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
590 (JSC::Interpreter::cti_op_get_by_id_array_fail):
591 (JSC::Interpreter::cti_op_get_by_id_string_fail):
592 (JSC::Interpreter::cti_op_instanceof):
593 (JSC::Interpreter::cti_op_del_by_id):
594 (JSC::Interpreter::cti_op_mul):
595 (JSC::Interpreter::cti_op_new_func):
596 (JSC::Interpreter::cti_op_call_JSFunction):
597 (JSC::Interpreter::cti_op_call_arityCheck):
598 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
599 (JSC::Interpreter::cti_vm_lazyLinkCall):
600 (JSC::Interpreter::cti_op_push_activation):
601 (JSC::Interpreter::cti_op_call_NotJSFunction):
602 (JSC::Interpreter::cti_op_create_arguments):
603 (JSC::Interpreter::cti_op_create_arguments_no_params):
604 (JSC::Interpreter::cti_op_tear_off_activation):
605 (JSC::Interpreter::cti_op_tear_off_arguments):
606 (JSC::Interpreter::cti_op_profile_will_call):
607 (JSC::Interpreter::cti_op_profile_did_call):
608 (JSC::Interpreter::cti_op_ret_scopeChain):
609 (JSC::Interpreter::cti_op_new_array):
610 (JSC::Interpreter::cti_op_resolve):
611 (JSC::Interpreter::cti_op_construct_JSConstruct):
612 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
613 (JSC::Interpreter::cti_op_get_by_val):
614 (JSC::Interpreter::cti_op_resolve_func):
615 (JSC::Interpreter::cti_op_sub):
616 (JSC::Interpreter::cti_op_put_by_val):
617 (JSC::Interpreter::cti_op_put_by_val_array):
618 (JSC::Interpreter::cti_op_lesseq):
619 (JSC::Interpreter::cti_op_loop_if_true):
620 (JSC::Interpreter::cti_op_negate):
621 (JSC::Interpreter::cti_op_resolve_base):
622 (JSC::Interpreter::cti_op_resolve_skip):
623 (JSC::Interpreter::cti_op_resolve_global):
624 (JSC::Interpreter::cti_op_div):
625 (JSC::Interpreter::cti_op_pre_dec):
626 (JSC::Interpreter::cti_op_jless):
627 (JSC::Interpreter::cti_op_not):
628 (JSC::Interpreter::cti_op_jtrue):
629 (JSC::Interpreter::cti_op_post_inc):
630 (JSC::Interpreter::cti_op_eq):
631 (JSC::Interpreter::cti_op_lshift):
632 (JSC::Interpreter::cti_op_bitand):
633 (JSC::Interpreter::cti_op_rshift):
634 (JSC::Interpreter::cti_op_bitnot):
635 (JSC::Interpreter::cti_op_resolve_with_base):
636 (JSC::Interpreter::cti_op_new_func_exp):
637 (JSC::Interpreter::cti_op_mod):
638 (JSC::Interpreter::cti_op_less):
639 (JSC::Interpreter::cti_op_neq):
640 (JSC::Interpreter::cti_op_post_dec):
641 (JSC::Interpreter::cti_op_urshift):
642 (JSC::Interpreter::cti_op_bitxor):
643 (JSC::Interpreter::cti_op_new_regexp):
644 (JSC::Interpreter::cti_op_bitor):
645 (JSC::Interpreter::cti_op_call_eval):
646 (JSC::Interpreter::cti_op_throw):
647 (JSC::Interpreter::cti_op_get_pnames):
648 (JSC::Interpreter::cti_op_next_pname):
649 (JSC::Interpreter::cti_op_push_scope):
650 (JSC::Interpreter::cti_op_pop_scope):
651 (JSC::Interpreter::cti_op_typeof):
652 (JSC::Interpreter::cti_op_is_undefined):
653 (JSC::Interpreter::cti_op_is_boolean):
654 (JSC::Interpreter::cti_op_is_number):
655 (JSC::Interpreter::cti_op_is_string):
656 (JSC::Interpreter::cti_op_is_object):
657 (JSC::Interpreter::cti_op_is_function):
658 (JSC::Interpreter::cti_op_stricteq):
659 (JSC::Interpreter::cti_op_nstricteq):
660 (JSC::Interpreter::cti_op_to_jsnumber):
661 (JSC::Interpreter::cti_op_in):
662 (JSC::Interpreter::cti_op_push_new_scope):
663 (JSC::Interpreter::cti_op_jmp_scopes):
664 (JSC::Interpreter::cti_op_put_by_index):
665 (JSC::Interpreter::cti_op_switch_imm):
666 (JSC::Interpreter::cti_op_switch_char):
667 (JSC::Interpreter::cti_op_switch_string):
668 (JSC::Interpreter::cti_op_del_by_val):
669 (JSC::Interpreter::cti_op_put_getter):
670 (JSC::Interpreter::cti_op_put_setter):
671 (JSC::Interpreter::cti_op_new_error):
672 (JSC::Interpreter::cti_op_debug):
673 (JSC::Interpreter::cti_vm_throw):
674 * interpreter/Interpreter.h:
677 (JSC::JIT::privateCompileMainPass):
678 (JSC::JIT::privateCompile):
680 * jit/JITInlineMethods.h:
681 (JSC::JIT::restoreArgumentReference):
682 (JSC::JIT::restoreArgumentReferenceForTrampoline):
685 2008-12-18 Cameron Zwarich <zwarich@apple.com>
687 Reviewed by Geoff Garen.
689 Bug 21855: REGRESSION (r37323): Gmail complains about popup blocking when opening a link
690 <https://bugs.webkit.org/show_bug.cgi?id=21855>
691 <rdar://problem/6278244>
693 Move DynamicGlobalObjectScope to JSGlobalObject.h so that it can be used
696 * interpreter/Interpreter.cpp:
697 * runtime/JSGlobalObject.h:
698 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
699 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
701 2008-12-17 Geoffrey Garen <ggaren@apple.com>
703 Reviewed by Gavin Barraclough.
705 Fixed https://bugs.webkit.org/show_bug.cgi?id=22393
706 Segfault when caching property accesses to primitive cells.
708 Changed some asObject casts to asCell casts in cases where a primitive
709 value may be a cell and not an object.
711 Re-enabled property caching for primitives in cases where it had been
712 disabled because of this bug.
714 Updated a comment to better explain something Darin thought needed
715 explaining in an old patch review.
717 * interpreter/Interpreter.cpp:
718 (JSC::countPrototypeChainEntriesAndCheckForProxies):
719 (JSC::Interpreter::tryCacheGetByID):
720 (JSC::Interpreter::tryCTICacheGetByID):
721 (JSC::Interpreter::cti_op_get_by_id_self_fail):
722 (JSC::Interpreter::cti_op_get_by_id_proto_list):
724 2008-12-17 Gavin Barraclough <barraclough@apple.com>
726 Reviewed by Cameron Zwarich.
728 Fixes for Sunspider failures with the JIT enabled on x86-64.
730 * assembler/MacroAssembler.h:
731 Switch the order of the RegisterID & Address form of je32, to keep it consistent with jne32.
734 * jit/JITInlineMethods.h:
735 Port the m_ctiVirtualCall tramopline generation to use the MacroAssembler interface.
737 Fix bug in the non-optimizing code path, vptr check should have been to the memory address pointer
738 to by the register, not to the register itself.
739 * wrec/WRECGenerator.cpp:
740 See assembler/MacroAssembler.h, above.
742 2008-12-17 Gavin Barraclough <barraclough@apple.com>
744 Reviewed by Sam Weinig.
746 print("Hello, 64-bit jitted world!");
747 Get hello-world working through the JIT, on x86-64.
749 * assembler/X86Assembler.h:
750 Fix encoding of opcode + RegisterID format instructions for 64-bit.
751 * interpreter/Interpreter.cpp:
752 * interpreter/Interpreter.h:
753 Make VoidPtrPair actually be a pair of void*s.
754 (Possibly should make this change for 32-bit Mac platforms, too - but won't change 32-bit behaviour in this patch).
757 Provide names for the timeoutCheckRegister & callFrameRegister on x86-64,
758 force x86-64 ctiTrampoline arguments onto the stack,
759 implement the asm trampolines for x86-64,
760 implement the restoreArgumentReference methods for x86-64 calling conventions.
762 * jit/JITInlineMethods.h:
764 Add switch settings to ENABLE(JIT), on PLATFORM(X86_64) (currently still disabled).
766 2008-12-17 Sam Weinig <sam@webkit.org>
768 Reviewed by Gavin Barraclough.
770 Add more CodeBlock statistics.
772 * bytecode/CodeBlock.cpp:
773 (JSC::CodeBlock::dumpStatistics):
775 2008-12-17 Sam Weinig <sam@webkit.org>
777 Reviewed by Darin Adler.
779 Fix for https://bugs.webkit.org/show_bug.cgi?id=22897
780 <rdar://problem/6428342>
781 Look into feasibility of discarding bytecode after native codegen
783 Clear the bytecode Instruction vector at the end JIT generation.
785 Saves 4.8 MB on Membuster head.
787 * bytecode/CodeBlock.cpp:
788 (JSC::CodeBlock::dump): Add logging for the case that someone tries
789 to dump the instructions of a CodeBlock that has had its bytecode
791 (JSC::CodeBlock::CodeBlock): Initialize the instructionCount
792 (JSC::CodeBlock::handlerForBytecodeOffset): Use instructionCount instead
793 of the size of the instruction vector in the assertion.
794 (JSC::CodeBlock::lineNumberForBytecodeOffset): Ditto.
795 (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
796 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
797 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Ditto.
798 * bytecode/CodeBlock.h:
799 (JSC::CodeBlock::setInstructionCount): Store the instruction vector size
800 in debug builds for assertions.
801 * bytecompiler/BytecodeGenerator.cpp:
802 (JSC::BytecodeGenerator::generate):
804 (JSC::JIT::privateCompile): Clear the bytecode vector unless we
805 have compiled with Opcode sampling where we will continue to require it
807 2008-12-17 Cary Clark <caryclark@google.com>
809 Reviewed by Darin Adler.
810 Landed by Adam Barth.
812 Add ENABLE_TEXT_CARET to permit the ANDROID platform
813 to invalidate and draw the caret in a separate thread.
816 Default ENABLE_TEXT_CARET to 1.
818 2008-12-17 Alexey Proskuryakov <ap@webkit.org>
820 Reviewed by Darin Adler.
822 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard, take two.
824 * API/JSContextRef.cpp: The previous patch that claimed to do this was making Tiger and
825 Leopard always use unique context group instead.
827 2008-12-16 Sam Weinig <sam@webkit.org>
829 Reviewed by Geoffrey Garen.
831 Fix for https://bugs.webkit.org/show_bug.cgi?id=22838
832 Remove dependency on the bytecode Instruction buffer in Interpreter::throwException
833 Part of <rdar://problem/6428342>
835 * bytecode/CodeBlock.cpp:
836 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Added. Function to get
837 a function Register index in a callFrame for a bytecode offset.
838 (JSC::CodeBlock::shrinkToFit): Shrink m_getByIdExceptionInfo and m_functionRegisterInfos.
839 * bytecode/CodeBlock.h:
840 (JSC::FunctionRegisterInfo::FunctionRegisterInfo): Added.
841 (JSC::CodeBlock::addFunctionRegisterInfo):
842 * bytecompiler/BytecodeGenerator.cpp:
843 (JSC::BytecodeGenerator::emitCall):
844 * interpreter/Interpreter.cpp:
845 (JSC::Interpreter::throwException): Use functionRegisterForBytecodeOffset in JIT
848 2008-12-16 Sam Weinig <sam@webkit.org>
850 Reviewed by Gavin Barraclough.
852 Fix for https://bugs.webkit.org/show_bug.cgi?id=22837
853 Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction
854 Part of <rdar://problem/6428342>
856 * interpreter/CallFrame.h: Added comment regarding returnPC storing a void*.
857 * interpreter/Interpreter.cpp:
858 (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC
859 being in the instruction stream for JIT, so we can remove the check.
860 (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS
861 as the call frame returnPC as it is only necessary for looking up when
862 throwing an exception.
863 * interpreter/RegisterFile.h:
864 (JSC::RegisterFile::): Added comment regarding returnPC storing a void*.
865 * jit/JIT.h: Remove ARG_instr4.
867 (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer.
869 2008-12-16 Darin Adler <darin@apple.com>
871 Reviewed and landed by Cameron Zwarich.
873 Preparatory work for fixing
875 Bug 22887: Make UString::Rep use RefCounted rather than implementing its own ref counting
876 <https://bugs.webkit.org/show_bug.cgi?id=22887>
878 Change the various string translators used by Identifier:add() so that
879 they never zero the ref count of a newly created UString::Rep.
881 * runtime/Identifier.cpp:
882 (JSC::CStringTranslator::translate):
883 (JSC::Identifier::add):
884 (JSC::UCharBufferTranslator::translate):
886 2008-12-16 Gavin Barraclough <barraclough@apple.com>
890 * assembler/AssemblerBuffer.h:
892 2008-12-16 Gavin Barraclough <barraclough@apple.com>
894 Reviewed by Cameron Zwarich.
896 Make the JIT compile on x86-64.
897 This largely involves populting the missing calls in MacroAssembler.h.
898 In addition some reinterpret_casts need removing from the JIT, and the
899 repatching property access code will need to be fully compiled out for
900 now. The changes in interpret.cpp are to reorder the functions so that
901 the _generic forms come before all other property access methods, and
902 then to place all property access methods other than the generic forms
903 under control of the ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS macro.
905 No performance impact.
907 * assembler/AssemblerBuffer.h:
908 (JSC::AssemblerBuffer::putInt64Unchecked):
909 * assembler/MacroAssembler.h:
910 (JSC::MacroAssembler::loadPtr):
911 (JSC::MacroAssembler::load32):
912 (JSC::MacroAssembler::storePtr):
913 (JSC::MacroAssembler::storePtrWithRepatch):
914 (JSC::MacroAssembler::store32):
915 (JSC::MacroAssembler::poke):
916 (JSC::MacroAssembler::move):
917 (JSC::MacroAssembler::testImm64):
918 (JSC::MacroAssembler::jePtr):
919 (JSC::MacroAssembler::jnePtr):
920 (JSC::MacroAssembler::jnzPtr):
921 (JSC::MacroAssembler::jzPtr):
922 * assembler/X86Assembler.h:
923 (JSC::X86Assembler::):
924 (JSC::X86Assembler::cmpq_rr):
925 (JSC::X86Assembler::cmpq_rm):
926 (JSC::X86Assembler::cmpq_im):
927 (JSC::X86Assembler::testq_i32m):
928 (JSC::X86Assembler::movl_mEAX):
929 (JSC::X86Assembler::movl_i32r):
930 (JSC::X86Assembler::movl_EAXm):
931 (JSC::X86Assembler::movq_rm):
932 (JSC::X86Assembler::movq_mEAX):
933 (JSC::X86Assembler::movq_mr):
934 (JSC::X86Assembler::movq_i64r):
935 (JSC::X86Assembler::movl_mr):
936 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64):
937 (JSC::X86Assembler::X86InstructionFormatter::immediate64):
938 * interpreter/Interpreter.cpp:
939 (JSC::Interpreter::cti_op_put_by_id_generic):
940 (JSC::Interpreter::cti_op_get_by_id_generic):
941 (JSC::Interpreter::cti_op_put_by_id):
942 (JSC::Interpreter::cti_op_put_by_id_second):
944 (JSC::JIT::privateCompileMainPass):
945 (JSC::JIT::privateCompile):
946 (JSC::JIT::privateCompileCTIMachineTrampolines):
948 (JSC::JIT::compileOpCallSetupArgs):
949 (JSC::JIT::compileOpCall):
950 * jit/JITPropertyAccess.cpp:
951 (JSC::JIT::compileGetByIdHotPath):
952 (JSC::JIT::compilePutByIdHotPath):
953 * runtime/JSImmediate.h:
954 (JSC::JSImmediate::makeInt):
956 2008-12-16 Cameron Zwarich <zwarich@apple.com>
958 Reviewed by Darin Adler.
960 Bug 22869: REGRESSION (r38407): http://news.cnet.com/8301-13579_3-9953533-37.html crashes
961 <https://bugs.webkit.org/show_bug.cgi?id=22869>
962 <rdar://problem/6402499>
964 Before r38407, Structure::m_nameInPrevious was ref'd due to it being
965 stored in a PropertyMap. However, PropertyMaps are created lazily after
966 r38407, so Structure::m_nameInPrevious is not necessarily ref'd while
967 it is being used. Making it a RefPtr instead of a raw pointer fixes
970 Unfortunately, the crash in the bug is rather intermittent, and it is
971 impossible to add an assertion in UString::Ref::ref() to catch this bug
972 because some users of UString::Rep deliberately zero out the reference
973 count. Therefore, there is no layout test accompanying this bug fix.
975 * runtime/Structure.cpp:
976 (JSC::Structure::~Structure): Use get().
977 (JSC::Structure::materializePropertyMap): Use get().
978 (JSC::Structure::addPropertyTransitionToExistingStructure): Use get().
979 (JSC::Structure::addPropertyTransition): Use get().
980 * runtime/Structure.h: Make Structure::m_nameInPrevious a RefPtr instead
983 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
985 Not reviewed. Attempt to fix win build. No 'using namespace WTF' in this file, needs manual WTF:: prefix.
986 Not sure why the build works as is here.
988 * runtime/MathObject.cpp:
989 (JSC::mathProtoFuncRandom):
991 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
993 Reviewed by Darin Adler.
995 Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876
997 Unify random number generation in JavaScriptCore & WebCore, by introducing
998 wtf/RandomNumber.h and moving wtf_random/wtf_random_init out of MathExtras.h.
1000 wtf_random_init() has been renamed to initializeRandomNumberGenerator() and
1001 lives in it's own private header: wtf/RandomNumberSeed.h, only intended to
1002 be used from within JavaScriptCore.
1004 wtf_random() has been renamed to randomNumber() and lives in a public header
1005 wtf/RandomNumber.h, usable from within JavaScriptCore & WebCore. It encapsulates
1006 the code taking care of initializing the random number generator (only when
1007 building without ENABLE(JSC_MULTIPLE_THREADS), otherwhise initializeThreading()
1008 already took care of that).
1010 Functional change on darwin: Use random() instead of rand(), as it got a larger
1011 period (more randomness). HTMLFormElement already contains this implementation
1012 and I just moved it in randomNumber(), as special case for PLATFORM(DARWIN).
1014 * GNUmakefile.am: Add RandomNumber.(cpp/h) / RandomNumberSeed.h.
1015 * JavaScriptCore.exp: Ditto.
1016 * JavaScriptCore.pri: Ditto.
1017 * JavaScriptCore.scons: Ditto.
1018 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
1019 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
1020 * JavaScriptCoreSources.bkl: Ditto.
1021 * runtime/MathObject.cpp: Use new WTF::randomNumber() functionality.
1022 (JSC::mathProtoFuncRandom):
1023 * wtf/MathExtras.h: Move wtf_random / wtf_random_init to new files.
1024 * wtf/RandomNumber.cpp: Added.
1025 (WTF::randomNumber):
1026 * wtf/RandomNumber.h: Added.
1027 * wtf/RandomNumberSeed.h: Added. Internal usage within JSC only.
1028 (WTF::initializeRandomNumberGenerator):
1029 * wtf/ThreadingGtk.cpp: Rename wtf_random_init() to initializeRandomNumberGenerator().
1030 (WTF::initializeThreading):
1031 * wtf/ThreadingPthreads.cpp: Ditto.
1032 (WTF::initializeThreading):
1033 * wtf/ThreadingQt.cpp: Ditto.
1034 (WTF::initializeThreading):
1035 * wtf/ThreadingWin.cpp: Ditto.
1036 (WTF::initializeThreading):
1038 2008-12-16 Yael Aharon <yael.aharon@nokia.com>
1040 Reviewed by Tor Arne Vestbø.
1044 * JavaScriptCore.pri:
1046 2008-12-15 Mark Rowe <mrowe@apple.com>
1048 Reviewed by Cameron Zwarich.
1050 Fix the build with GCC 4.0.
1052 * Configurations/JavaScriptCore.xcconfig: GCC 4.0 appears to have a bug when compiling with -funwind-tables on,
1053 so don't use it with that compiler version.
1055 2008-12-15 Mark Rowe <mrowe@apple.com>
1057 Rubber-stamped by Cameron Zwarich.
1059 <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard.
1061 * Configurations/Base.xcconfig:
1062 * Configurations/DebugRelease.xcconfig:
1064 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
1066 Reviewed by Darin Adler.
1068 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard.
1070 * API/JSContextRef.cpp: (JSGlobalContextCreate):
1072 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
1074 Reviewed by Darin Adler.
1076 <rdar://problem/6445089> Mach ports leak from worker threads
1078 * interpreter/Interpreter.cpp: (JSC::getCPUTime):
1079 Deallocate the thread self port.
1081 2008-12-15 Gavin Barraclough <barraclough@apple.com>
1083 Reviewed by Mark Rowe.
1085 Construct stack frames in JIT code, so that backtracing can still work.
1086 <rdar://problem/6447870> JIT should play nice with attempts to take stack traces
1090 (JSC::JIT::privateCompileMainPass):
1092 2008-12-15 Mark Rowe <mrowe@apple.com>
1094 Reviewed by Gavin Barraclough.
1096 <rdar://problem/6402262> JavaScriptCore needs exception handling tables in order to get stack traces without frame pointers
1098 * Configurations/JavaScriptCore.xcconfig:
1100 2008-12-15 Gavin Barraclough <barraclough@apple.com>
1102 Rubber stamped by Mark Rowe.
1104 Revert r39226 / Bug 22818: Unify JIT callback argument access OS X / Windows
1105 This causes Acid3 failures – reverting for now & will revisit later.
1106 https://bugs.webkit.org/show_bug.cgi?id=22873
1108 * interpreter/Interpreter.h:
1110 (JSC::JIT::privateCompileCTIMachineTrampolines):
1112 * jit/JITInlineMethods.h:
1113 (JSC::JIT::restoreArgumentReference):
1114 (JSC::JIT::restoreArgumentReferenceForTrampoline):
1115 (JSC::JIT::emitCTICall_internal):
1116 * jit/JITPropertyAccess.cpp:
1117 (JSC::JIT::privateCompilePutByIdTransition):
1120 2008-12-15 Darin Adler <darin@apple.com>
1122 Reviewed by Sam Weinig.
1124 - fix <rdar://problem/6427048> crash due to infinite recursion after setting window.__proto__ = window
1126 Replaced toGlobalObject with the more generally useful unwrappedObject and used it to
1127 fix the cycle detection code in put(__proto__).
1129 * JavaScriptCore.exp: Updated.
1131 * runtime/JSGlobalObject.cpp: Removed toGlobalObject. We now use unwrappedObject instead.
1132 * runtime/JSGlobalObject.h:
1133 (JSC::JSGlobalObject::isGlobalObject): Ditto.
1135 * runtime/JSGlobalObjectFunctions.cpp:
1136 (JSC::globalFuncEval): Use unwrappedObject and isGlobalObject here rather than toGlobalObject.
1138 * runtime/JSObject.cpp:
1139 (JSC::JSObject::put): Rewrote prototype cycle checking loop. Use unwrappedObject in the loop now.
1140 (JSC::JSObject::unwrappedObject): Replaced toGlobalObject with this new function.
1141 * runtime/JSObject.h: More of the same.
1143 2008-12-15 Steve Falkenburg <sfalken@apple.com>
1147 Visual Studio requires visibility of forward declarations to match class declaration.
1149 * assembler/X86Assembler.h:
1151 2008-12-15 Gustavo Noronha Silva <kov@kov.eti.br>
1153 Reviewed by Mark Rowe.
1155 https://bugs.webkit.org/show_bug.cgi?id=22686
1161 2008-12-15 Gavin Barraclough <barraclough@apple.com>
1163 Reviewed by Geoff Garen.
1165 Add support to X86Assembler emitting instructions that access all 16 registers on x86-64.
1166 Add a new formating class, that is reponsible for both emitting the opcode bytes and the
1167 ModRm bytes of an instruction in a single call; this can insert the REX byte as necessary
1168 before the opcode, but has access to the register numbers to build the REX.
1170 * assembler/AssemblerBuffer.h:
1171 (JSC::AssemblerBuffer::isAligned):
1172 (JSC::AssemblerBuffer::data):
1173 * assembler/MacroAssembler.h:
1174 (JSC::MacroAssembler::addPtr):
1175 (JSC::MacroAssembler::add32):
1176 (JSC::MacroAssembler::and32):
1177 (JSC::MacroAssembler::or32):
1178 (JSC::MacroAssembler::sub32):
1179 (JSC::MacroAssembler::xor32):
1180 (JSC::MacroAssembler::loadPtr):
1181 (JSC::MacroAssembler::load32):
1182 (JSC::MacroAssembler::load16):
1183 (JSC::MacroAssembler::storePtr):
1184 (JSC::MacroAssembler::storePtrWithRepatch):
1185 (JSC::MacroAssembler::store32):
1186 (JSC::MacroAssembler::pop):
1187 (JSC::MacroAssembler::push):
1188 (JSC::MacroAssembler::compareImm32ForBranch):
1189 (JSC::MacroAssembler::compareImm32ForBranchEquality):
1190 (JSC::MacroAssembler::testImm32):
1191 (JSC::MacroAssembler::jae32):
1192 (JSC::MacroAssembler::jb32):
1193 (JSC::MacroAssembler::je16):
1194 (JSC::MacroAssembler::jg32):
1195 (JSC::MacroAssembler::jnePtr):
1196 (JSC::MacroAssembler::jne32):
1197 (JSC::MacroAssembler::jump):
1198 * assembler/X86Assembler.h:
1200 (JSC::X86Assembler::):
1201 (JSC::X86Assembler::size):
1202 (JSC::X86Assembler::push_r):
1203 (JSC::X86Assembler::pop_r):
1204 (JSC::X86Assembler::push_i32):
1205 (JSC::X86Assembler::push_m):
1206 (JSC::X86Assembler::pop_m):
1207 (JSC::X86Assembler::addl_rr):
1208 (JSC::X86Assembler::addl_mr):
1209 (JSC::X86Assembler::addl_ir):
1210 (JSC::X86Assembler::addq_ir):
1211 (JSC::X86Assembler::addl_im):
1212 (JSC::X86Assembler::andl_rr):
1213 (JSC::X86Assembler::andl_ir):
1214 (JSC::X86Assembler::orl_rr):
1215 (JSC::X86Assembler::orl_mr):
1216 (JSC::X86Assembler::orl_ir):
1217 (JSC::X86Assembler::subl_rr):
1218 (JSC::X86Assembler::subl_mr):
1219 (JSC::X86Assembler::subl_ir):
1220 (JSC::X86Assembler::subl_im):
1221 (JSC::X86Assembler::xorl_rr):
1222 (JSC::X86Assembler::xorl_ir):
1223 (JSC::X86Assembler::sarl_i8r):
1224 (JSC::X86Assembler::sarl_CLr):
1225 (JSC::X86Assembler::shll_i8r):
1226 (JSC::X86Assembler::shll_CLr):
1227 (JSC::X86Assembler::imull_rr):
1228 (JSC::X86Assembler::imull_i32r):
1229 (JSC::X86Assembler::idivl_r):
1230 (JSC::X86Assembler::cmpl_rr):
1231 (JSC::X86Assembler::cmpl_rm):
1232 (JSC::X86Assembler::cmpl_mr):
1233 (JSC::X86Assembler::cmpl_ir):
1234 (JSC::X86Assembler::cmpl_ir_force32):
1235 (JSC::X86Assembler::cmpl_im):
1236 (JSC::X86Assembler::cmpl_im_force32):
1237 (JSC::X86Assembler::cmpw_rm):
1238 (JSC::X86Assembler::testl_rr):
1239 (JSC::X86Assembler::testl_i32r):
1240 (JSC::X86Assembler::testl_i32m):
1241 (JSC::X86Assembler::testq_rr):
1242 (JSC::X86Assembler::testq_i32r):
1243 (JSC::X86Assembler::testb_i8r):
1244 (JSC::X86Assembler::sete_r):
1245 (JSC::X86Assembler::setz_r):
1246 (JSC::X86Assembler::setne_r):
1247 (JSC::X86Assembler::setnz_r):
1248 (JSC::X86Assembler::cdq):
1249 (JSC::X86Assembler::xchgl_rr):
1250 (JSC::X86Assembler::movl_rr):
1251 (JSC::X86Assembler::movl_rm):
1252 (JSC::X86Assembler::movl_mr):
1253 (JSC::X86Assembler::movl_i32r):
1254 (JSC::X86Assembler::movl_i32m):
1255 (JSC::X86Assembler::movq_rr):
1256 (JSC::X86Assembler::movq_rm):
1257 (JSC::X86Assembler::movq_mr):
1258 (JSC::X86Assembler::movzwl_mr):
1259 (JSC::X86Assembler::movzbl_rr):
1260 (JSC::X86Assembler::leal_mr):
1261 (JSC::X86Assembler::call):
1262 (JSC::X86Assembler::jmp):
1263 (JSC::X86Assembler::jmp_r):
1264 (JSC::X86Assembler::jmp_m):
1265 (JSC::X86Assembler::jne):
1266 (JSC::X86Assembler::jnz):
1267 (JSC::X86Assembler::je):
1268 (JSC::X86Assembler::jl):
1269 (JSC::X86Assembler::jb):
1270 (JSC::X86Assembler::jle):
1271 (JSC::X86Assembler::jbe):
1272 (JSC::X86Assembler::jge):
1273 (JSC::X86Assembler::jg):
1274 (JSC::X86Assembler::ja):
1275 (JSC::X86Assembler::jae):
1276 (JSC::X86Assembler::jo):
1277 (JSC::X86Assembler::jp):
1278 (JSC::X86Assembler::js):
1279 (JSC::X86Assembler::addsd_rr):
1280 (JSC::X86Assembler::addsd_mr):
1281 (JSC::X86Assembler::cvtsi2sd_rr):
1282 (JSC::X86Assembler::cvttsd2si_rr):
1283 (JSC::X86Assembler::movd_rr):
1284 (JSC::X86Assembler::movsd_rm):
1285 (JSC::X86Assembler::movsd_mr):
1286 (JSC::X86Assembler::mulsd_rr):
1287 (JSC::X86Assembler::mulsd_mr):
1288 (JSC::X86Assembler::pextrw_irr):
1289 (JSC::X86Assembler::subsd_rr):
1290 (JSC::X86Assembler::subsd_mr):
1291 (JSC::X86Assembler::ucomis_rr):
1292 (JSC::X86Assembler::int3):
1293 (JSC::X86Assembler::ret):
1294 (JSC::X86Assembler::predictNotTaken):
1295 (JSC::X86Assembler::label):
1296 (JSC::X86Assembler::align):
1297 (JSC::X86Assembler::link):
1298 (JSC::X86Assembler::executableCopy):
1299 (JSC::X86Assembler::X86InstructionFormater::prefix):
1300 (JSC::X86Assembler::X86InstructionFormater::oneByteOp):
1301 (JSC::X86Assembler::X86InstructionFormater::twoByteOp):
1302 (JSC::X86Assembler::X86InstructionFormater::oneByteOp64):
1303 (JSC::X86Assembler::X86InstructionFormater::oneByteOp8):
1304 (JSC::X86Assembler::X86InstructionFormater::twoByteOp8):
1305 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate8):
1306 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate32):
1307 (JSC::X86Assembler::X86InstructionFormater::instructionRel32):
1308 (JSC::X86Assembler::X86InstructionFormater::size):
1309 (JSC::X86Assembler::X86InstructionFormater::isAligned):
1310 (JSC::X86Assembler::X86InstructionFormater::data):
1311 (JSC::X86Assembler::X86InstructionFormater::executableCopy):
1312 (JSC::X86Assembler::X86InstructionFormater::registerModRM):
1313 (JSC::X86Assembler::X86InstructionFormater::memoryModRM):
1315 (JSC::JIT::privateCompileMainPass):
1316 (JSC::JIT::privateCompile):
1317 (JSC::JIT::privateCompileCTIMachineTrampolines):
1318 * jit/JITArithmetic.cpp:
1319 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
1320 (JSC::JIT::compileBinaryArithOp):
1322 (JSC::JIT::compileOpCall):
1323 (JSC::JIT::compileOpCallSlowCase):
1324 * jit/JITPropertyAccess.cpp:
1325 (JSC::JIT::compileGetByIdHotPath):
1326 (JSC::JIT::compilePutByIdHotPath):
1327 (JSC::JIT::privateCompilePutByIdTransition):
1328 (JSC::JIT::privateCompilePatchGetArrayLength):
1329 (JSC::JIT::privateCompileGetByIdProto):
1330 (JSC::JIT::privateCompileGetByIdProtoList):
1331 (JSC::JIT::privateCompileGetByIdChainList):
1332 (JSC::JIT::privateCompileGetByIdChain):
1334 2008-12-15 Darin Adler <darin@apple.com>
1336 * interpreter/RegisterFile.h: Tweak include formatting.
1338 2008-12-15 Holger Hans Peter Freyther <zecke@selfish.org>
1342 * interpreter/RegisterFile.h: Include stdio.h for fprintf
1344 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
1346 Reviewed by Oliver Hunt.
1348 <rdar://problem/6444455> Worker Thread crash running multiple workers for a moderate amount of time
1350 * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile):
1351 Improve error handling: if mmap fails, crash immediately, and print out the reason.
1353 2008-12-13 Gavin Barraclough <barraclough@apple.com>
1355 Reviewed by Cameron Zwarich.
1357 Re-enable WREC on 64-bit.
1358 Implements one of the MacroAssembler::jnzPtr methods, previously only implemented for 32-bit x86.
1360 https://bugs.webkit.org/show_bug.cgi?id=22849
1362 * assembler/MacroAssembler.h:
1363 (JSC::MacroAssembler::testImm64):
1364 (JSC::MacroAssembler::jnzPtr):
1365 * assembler/X86Assembler.h:
1366 (JSC::X86Assembler::testq_i32r):
1367 (JSC::X86Assembler::testq_rr):
1370 2008-12-13 Gavin Barraclough <barraclough@apple.com>
1374 * assembler/MacroAssembler.h:
1376 2008-12-13 Gavin Barraclough <barraclough@apple.com>
1378 Build fix only, no review.
1380 * bytecode/CodeBlock.h:
1382 2008-12-13 Gavin Barraclough <barraclough@apple.com>
1384 Reviewed by Cameron Zwarich.
1386 Port the remainder of the JIT, bar calling convention related code, and code
1387 implementing optimizations which can be disabled, to use the MacroAssembler.
1389 * assembler/MacroAssembler.h:
1390 (JSC::MacroAssembler::DataLabelPtr::DataLabelPtr):
1391 (JSC::MacroAssembler::RepatchBuffer::RepatchBuffer):
1392 (JSC::MacroAssembler::RepatchBuffer::link):
1393 (JSC::MacroAssembler::RepatchBuffer::addressOf):
1394 (JSC::MacroAssembler::RepatchBuffer::setPtr):
1395 (JSC::MacroAssembler::addPtr):
1396 (JSC::MacroAssembler::lshift32):
1397 (JSC::MacroAssembler::mod32):
1398 (JSC::MacroAssembler::rshift32):
1399 (JSC::MacroAssembler::storePtrWithRepatch):
1400 (JSC::MacroAssembler::jnzPtr):
1401 (JSC::MacroAssembler::jzPtr):
1402 (JSC::MacroAssembler::jump):
1403 (JSC::MacroAssembler::label):
1404 * assembler/X86Assembler.h:
1405 (JSC::X86Assembler::):
1406 (JSC::X86Assembler::xchgl_rr):
1407 (JSC::X86Assembler::jmp_m):
1408 (JSC::X86Assembler::repatchAddress):
1409 (JSC::X86Assembler::getRelocatedAddress):
1410 * bytecode/CodeBlock.cpp:
1411 (JSC::CodeBlock::CodeBlock):
1412 * bytecode/CodeBlock.h:
1413 (JSC::JITCodeRef::JITCodeRef):
1414 (JSC::CodeBlock::setJITCode):
1415 (JSC::CodeBlock::jitCode):
1416 (JSC::CodeBlock::executablePool):
1418 (JSC::JIT::privateCompileMainPass):
1419 (JSC::JIT::privateCompileLinkPass):
1420 (JSC::JIT::privateCompile):
1421 (JSC::JIT::privateCompileCTIMachineTrampolines):
1423 (JSC::CallRecord::CallRecord):
1424 (JSC::JumpTable::JumpTable):
1425 (JSC::JIT::emitCTICall):
1426 (JSC::JIT::JSRInfo::JSRInfo):
1427 * jit/JITArithmetic.cpp:
1429 * jit/JITInlineMethods.h:
1430 (JSC::JIT::emitNakedCall):
1431 (JSC::JIT::emitCTICall_internal):
1432 (JSC::JIT::checkStructure):
1433 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
1434 (JSC::JIT::addSlowCase):
1435 (JSC::JIT::addJump):
1436 (JSC::JIT::emitJumpSlowToHot):
1437 * jit/JITPropertyAccess.cpp:
1438 (JSC::JIT::privateCompileGetByIdChainList):
1439 (JSC::JIT::privateCompileGetByIdChain):
1441 2008-12-12 Cameron Zwarich <zwarich@apple.com>
1443 Reviewed by Sam Weinig.
1445 Fix the failures of the following layout tests, which regressed in
1448 fast/dom/StyleSheet/ownerNode-lifetime-2.html
1449 fast/xsl/transform-xhr-doc.xhtml
1451 The binary search in CodeBlock::getByIdExceptionInfoForBytecodeOffset()
1452 doesn't guarantee that it actually finds a match, so add an explicit check
1455 * bytecode/CodeBlock.cpp:
1456 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
1458 2008-12-12 Gavin Barraclough <barraclough@apple.com>
1460 Reviewed by Cameron Zwarich.
1462 Replace emitPutCallArg methods with emitPutJITStubArg methods. Primarily to make the argument numbering
1463 more sensible (1-based incrementing by 1, rather than 0-based incrementing by 4). The CTI name also seems
1464 to be being deprecated from the code generally.
1467 (JSC::JIT::privateCompileMainPass):
1468 (JSC::JIT::privateCompileSlowCases):
1469 (JSC::JIT::privateCompileCTIMachineTrampolines):
1471 * jit/JITArithmetic.cpp:
1472 (JSC::JIT::compileBinaryArithOp):
1473 (JSC::JIT::compileBinaryArithOpSlowCase):
1475 (JSC::JIT::compileOpCallSetupArgs):
1476 (JSC::JIT::compileOpCallEvalSetupArgs):
1477 (JSC::JIT::compileOpConstructSetupArgs):
1478 (JSC::JIT::compileOpCall):
1479 * jit/JITInlineMethods.h:
1480 (JSC::JIT::emitPutJITStubArg):
1481 (JSC::JIT::emitPutJITStubArgConstant):
1482 (JSC::JIT::emitGetJITStubArg):
1483 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
1484 * jit/JITPropertyAccess.cpp:
1485 (JSC::JIT::compileGetByIdHotPath):
1486 (JSC::JIT::compilePutByIdHotPath):
1487 (JSC::JIT::compileGetByIdSlowCase):
1488 (JSC::JIT::compilePutByIdSlowCase):
1490 2008-12-12 Gavin Barraclough <barraclough@apple.com>
1495 (JSC::JIT::privateCompileMainPass):
1496 (JSC::JIT::privateCompileSlowCases):
1497 (JSC::JIT::privateCompile):
1499 2008-12-12 Gavin Barraclough <barraclough@apple.com>
1501 Reviewed by Geoff Garen.
1503 Remove loop counter 'i' from the JIT generation passes, replace with a member m_bytecodeIndex.
1505 No impact on performance.
1508 (JSC::JIT::compileOpStrictEq):
1509 (JSC::JIT::emitSlowScriptCheck):
1510 (JSC::JIT::privateCompileMainPass):
1511 (JSC::JIT::privateCompileSlowCases):
1512 (JSC::JIT::privateCompile):
1514 (JSC::CallRecord::CallRecord):
1515 (JSC::JmpTable::JmpTable):
1516 (JSC::JIT::emitCTICall):
1517 * jit/JITArithmetic.cpp:
1518 (JSC::JIT::compileBinaryArithOp):
1519 (JSC::JIT::compileBinaryArithOpSlowCase):
1521 (JSC::JIT::compileOpCall):
1522 (JSC::JIT::compileOpCallSlowCase):
1523 * jit/JITInlineMethods.h:
1524 (JSC::JIT::emitGetVirtualRegister):
1525 (JSC::JIT::emitGetVirtualRegisters):
1526 (JSC::JIT::emitNakedCall):
1527 (JSC::JIT::emitCTICall_internal):
1528 (JSC::JIT::emitJumpSlowCaseIfJSCell):
1529 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
1530 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
1531 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
1532 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
1533 (JSC::JIT::addSlowCase):
1534 (JSC::JIT::addJump):
1535 (JSC::JIT::emitJumpSlowToHot):
1536 * jit/JITPropertyAccess.cpp:
1537 (JSC::JIT::compileGetByIdHotPath):
1538 (JSC::JIT::compileGetByIdSlowCase):
1539 (JSC::JIT::compilePutByIdHotPath):
1540 (JSC::JIT::compilePutByIdSlowCase):
1542 2008-12-12 Sam Weinig <sam@webkit.org>
1544 Reviewed by Cameron Zwarich.
1546 <rdar://problem/6428342> Look into feasibility of discarding bytecode after native codegen
1548 Move more JIT functionality to using offsets into the Instruction buffer
1549 instead of raw pointers. Two to go!
1551 * interpreter/Interpreter.cpp:
1552 (JSC::bytecodeOffsetForPC): Rename from vPCForPC.
1553 (JSC::Interpreter::resolve): Pass offset to exception helper.
1554 (JSC::Interpreter::resolveSkip): Ditto.
1555 (JSC::Interpreter::resolveGlobal): Ditto.
1556 (JSC::Interpreter::resolveBaseAndProperty): Ditto.
1557 (JSC::Interpreter::resolveBaseAndFunc): Ditto.
1558 (JSC::isNotObject): Ditto.
1559 (JSC::Interpreter::unwindCallFrame): Call bytecodeOffsetForPC.
1560 (JSC::Interpreter::throwException): Use offsets instead of vPCs.
1561 (JSC::Interpreter::privateExecute): Pass offset to exception helper.
1562 (JSC::Interpreter::retrieveLastCaller): Ditto.
1563 (JSC::Interpreter::cti_op_instanceof): Ditto.
1564 (JSC::Interpreter::cti_op_call_NotJSFunction): Ditto.
1565 (JSC::Interpreter::cti_op_resolve): Pass offset to exception helper.
1566 (JSC::Interpreter::cti_op_construct_NotJSConstruct): Ditto.
1567 (JSC::Interpreter::cti_op_resolve_func): Ditto.
1568 (JSC::Interpreter::cti_op_resolve_skip): Ditto.
1569 (JSC::Interpreter::cti_op_resolve_global): Ditto.
1570 (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
1571 (JSC::Interpreter::cti_op_throw): Ditto.
1572 (JSC::Interpreter::cti_op_in): Ditto.
1573 (JSC::Interpreter::cti_vm_throw): Ditto.
1574 * interpreter/Interpreter.h:
1577 (JSC::JIT::privateCompileMainPass): Don't pass unnecessary vPC to stub.
1578 * jit/JIT.h: Remove ARG_instr1 - ARG_instr3 and ARG_instr5 - ARG_instr6.
1580 (JSC::JIT::compileOpCallEvalSetupArgs): Don't pass unnecessary vPC to stub..
1581 (JSC::JIT::compileOpConstructSetupArgs): Ditto.
1583 * runtime/ExceptionHelpers.cpp:
1584 (JSC::createUndefinedVariableError): Take an offset instead of vPC.
1585 (JSC::createInvalidParamError): Ditto.
1586 (JSC::createNotAConstructorError): Ditto.
1587 (JSC::createNotAFunctionError): Ditto.
1588 (JSC::createNotAnObjectError): Ditto.
1589 * runtime/ExceptionHelpers.h:
1591 2008-12-12 Cameron Zwarich <zwarich@apple.com>
1593 Reviewed by Oliver Hunt.
1595 Bug 22835: Crash during bytecode generation when comparing to null
1596 <https://bugs.webkit.org/show_bug.cgi?id=22835>
1597 <rdar://problem/6286749>
1599 Change the special cases in bytecode generation for comparison to null
1600 to use tempDestination().
1603 (JSC::BinaryOpNode::emitBytecode):
1604 (JSC::EqualNode::emitBytecode):
1606 2008-12-12 Gavin Barraclough <barraclough@apple.com>
1608 Reviewed by Geoff Garen.
1610 Move slow-cases of JIT code generation over to the MacroAssembler interface.
1612 * assembler/MacroAssembler.h:
1613 (JSC::MacroAssembler::Label::Label):
1614 (JSC::MacroAssembler::jae32):
1615 (JSC::MacroAssembler::jg32):
1616 (JSC::MacroAssembler::jzPtr):
1618 (JSC::JIT::privateCompileSlowCases):
1619 (JSC::JIT::privateCompile):
1620 (JSC::JIT::emitGetVariableObjectRegister):
1621 (JSC::JIT::emitPutVariableObjectRegister):
1623 (JSC::SlowCaseEntry::SlowCaseEntry):
1624 (JSC::JIT::getSlowCase):
1625 (JSC::JIT::linkSlowCase):
1626 * jit/JITArithmetic.cpp:
1627 (JSC::JIT::compileBinaryArithOpSlowCase):
1629 (JSC::JIT::compileOpCallInitializeCallFrame):
1630 (JSC::JIT::compileOpCall):
1631 (JSC::JIT::compileOpCallSlowCase):
1632 * jit/JITInlineMethods.h:
1633 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
1634 (JSC::JIT::linkSlowCaseIfNotJSCell):
1635 * jit/JITPropertyAccess.cpp:
1636 (JSC::JIT::compileGetByIdHotPath):
1637 (JSC::JIT::compilePutByIdHotPath):
1638 (JSC::JIT::compileGetByIdSlowCase):
1639 (JSC::JIT::compilePutByIdSlowCase):
1641 2008-12-12 Cameron Zwarich <zwarich@apple.com>
1643 Reviewed by Sam Weinig.
1645 Bug 22828: Do not inspect bytecode instruction stream for op_get_by_id exception information
1646 <https://bugs.webkit.org/show_bug.cgi?id=22828>
1648 In order to remove the bytecode instruction stream after generating
1649 native code, all inspection of bytecode instructions at runtime must
1650 be removed. One particular instance of this is the special handling of
1651 exceptions thrown by the op_get_by_id emitted directly before an
1652 op_construct or an op_instanceof. This patch moves that information to
1653 an auxiliary data structure in CodeBlock.
1655 * bytecode/CodeBlock.cpp:
1656 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
1657 * bytecode/CodeBlock.h:
1658 (JSC::CodeBlock::addGetByIdExceptionInfo):
1659 * bytecompiler/BytecodeGenerator.cpp:
1660 (JSC::BytecodeGenerator::emitConstruct):
1661 * bytecompiler/BytecodeGenerator.h:
1662 (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
1664 (JSC::InstanceOfNode::emitBytecode):
1665 * runtime/ExceptionHelpers.cpp:
1666 (JSC::createNotAnObjectError):
1668 2008-12-12 Sam Weinig <sam@webkit.org>
1670 Reviewed by Geoffrey Garen.
1672 Change exception information accessors to take offsets into the bytecode
1673 instruction buffer instead of pointers so that they can work even even
1674 if the bytecode buffer is purged.
1676 * bytecode/CodeBlock.cpp:
1677 (JSC::instructionOffsetForNth):
1678 (JSC::CodeBlock::handlerForBytecodeOffset):
1679 (JSC::CodeBlock::lineNumberForBytecodeOffset):
1680 (JSC::CodeBlock::expressionRangeForBytecodeOffset):
1681 * bytecode/CodeBlock.h:
1682 * bytecode/SamplingTool.cpp:
1683 (JSC::SamplingTool::dump):
1684 * interpreter/Interpreter.cpp:
1685 (JSC::Interpreter::throwException):
1686 (JSC::Interpreter::privateExecute):
1687 (JSC::Interpreter::retrieveLastCaller):
1689 (JSC::JIT::privateCompileMainPass):
1690 * runtime/ExceptionHelpers.cpp:
1691 (JSC::createUndefinedVariableError):
1692 (JSC::createInvalidParamError):
1693 (JSC::createNotAConstructorError):
1694 (JSC::createNotAFunctionError):
1695 (JSC::createNotAnObjectError):
1697 2008-12-12 Geoffrey Garen <ggaren@apple.com>
1699 Reviewed by Cameron Zwarich.
1701 Tiny bit of refactoring in quantifier generation.
1703 * wrec/WRECGenerator.cpp:
1704 (JSC::WREC::Generator::generateNonGreedyQuantifier):
1705 (JSC::WREC::Generator::generateGreedyQuantifier):
1707 2008-12-11 Sam Weinig <sam@webkit.org>
1709 Reviewed by Geoffrey Garen.
1711 Remove dependancy on having the Instruction buffer in order to
1712 deref Structures used for property access and global resolves.
1713 Instead, we put references to the necessary Structures in auxiliary
1714 data structures on the CodeBlock. This is not an ideal solution,
1715 as we still pay for having the Structures in two places and we
1716 would like to eventually just hold on to offsets into the machine
1719 - Also removes CodeBlock bloat in non-JIT by #ifdefing the JIT
1720 only data structures.
1723 * JavaScriptCore.pri:
1724 * JavaScriptCore.scons:
1725 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1726 * JavaScriptCore.xcodeproj/project.pbxproj:
1727 * JavaScriptCoreSources.bkl:
1728 * bytecode/CodeBlock.cpp:
1729 (JSC::isGlobalResolve):
1730 (JSC::isPropertyAccess):
1731 (JSC::instructionOffsetForNth):
1732 (JSC::printGlobalResolveInfo):
1733 (JSC::printStructureStubInfo):
1734 (JSC::CodeBlock::printStructures):
1735 (JSC::CodeBlock::dump):
1736 (JSC::CodeBlock::~CodeBlock):
1737 (JSC::CodeBlock::shrinkToFit):
1738 * bytecode/CodeBlock.h:
1739 (JSC::GlobalResolveInfo::GlobalResolveInfo):
1741 (JSC::CodeBlock::instructions):
1742 (JSC::CodeBlock::getStubInfo):
1743 (JSC::CodeBlock::getBytecodeIndex):
1744 (JSC::CodeBlock::addPropertyAccessInstruction):
1745 (JSC::CodeBlock::addGlobalResolveInstruction):
1746 (JSC::CodeBlock::numberOfStructureStubInfos):
1747 (JSC::CodeBlock::addStructureStubInfo):
1748 (JSC::CodeBlock::structureStubInfo):
1749 (JSC::CodeBlock::addGlobalResolveInfo):
1750 (JSC::CodeBlock::globalResolveInfo):
1751 (JSC::CodeBlock::numberOfCallLinkInfos):
1752 (JSC::CodeBlock::addCallLinkInfo):
1753 (JSC::CodeBlock::callLinkInfo):
1754 * bytecode/Instruction.h:
1755 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
1756 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
1757 * bytecode/Opcode.h:
1759 * bytecode/StructureStubInfo.cpp: Copied from bytecode/CodeBlock.cpp.
1760 (JSC::StructureStubInfo::deref):
1761 * bytecode/StructureStubInfo.h: Copied from bytecode/CodeBlock.h.
1762 (JSC::StructureStubInfo::StructureStubInfo):
1763 (JSC::StructureStubInfo::initGetByIdSelf):
1764 (JSC::StructureStubInfo::initGetByIdProto):
1765 (JSC::StructureStubInfo::initGetByIdChain):
1766 (JSC::StructureStubInfo::initGetByIdSelfList):
1767 (JSC::StructureStubInfo::initGetByIdProtoList):
1768 (JSC::StructureStubInfo::initPutByIdTransition):
1769 (JSC::StructureStubInfo::initPutByIdReplace):
1770 (JSC::StructureStubInfo::):
1771 * bytecompiler/BytecodeGenerator.cpp:
1772 (JSC::BytecodeGenerator::emitResolve):
1773 (JSC::BytecodeGenerator::emitGetById):
1774 (JSC::BytecodeGenerator::emitPutById):
1775 (JSC::BytecodeGenerator::emitCall):
1776 (JSC::BytecodeGenerator::emitConstruct):
1777 (JSC::BytecodeGenerator::emitCatch):
1778 * interpreter/Interpreter.cpp:
1779 (JSC::Interpreter::tryCTICachePutByID):
1780 (JSC::Interpreter::tryCTICacheGetByID):
1781 (JSC::Interpreter::cti_op_get_by_id_self_fail):
1782 (JSC::getPolymorphicAccessStructureListSlot):
1783 (JSC::Interpreter::cti_op_get_by_id_proto_list):
1784 (JSC::Interpreter::cti_op_resolve_global):
1787 (JSC::JIT::privateCompileMainPass):
1788 (JSC::JIT::privateCompileSlowCases):
1789 (JSC::JIT::privateCompile):
1790 * jit/JITPropertyAccess.cpp:
1791 (JSC::JIT::compileGetByIdHotPath):
1792 (JSC::JIT::compilePutByIdHotPath):
1793 (JSC::JIT::compileGetByIdSlowCase):
1794 (JSC::JIT::compilePutByIdSlowCase):
1795 (JSC::JIT::privateCompileGetByIdSelfList):
1796 (JSC::JIT::privateCompileGetByIdProtoList):
1797 (JSC::JIT::privateCompileGetByIdChainList):
1799 2008-12-11 Gavin Barraclough <barraclough@apple.com>
1801 Reviewed by Oliver Hunt.
1803 Remove CTI_ARGUMENTS mode, use va_start implementation on Windows,
1804 unifying JIT callback (cti_*) argument access on OS X & Windows
1806 No performance impact.
1808 * interpreter/Interpreter.h:
1810 (JSC::JIT::privateCompileCTIMachineTrampolines):
1812 * jit/JITInlineMethods.h:
1813 (JSC::JIT::emitCTICall):
1814 * jit/JITPropertyAccess.cpp:
1815 (JSC::JIT::privateCompilePutByIdTransition):
1818 2008-12-11 Holger Freyther <zecke@selfish.org>
1820 Reviewed by Simon Hausmann.
1822 https://bugs.webkit.org/show_bug.cgi?id=20953
1824 For Qt it is not pratical to have a FontCache and GlyphPageTreeNode
1825 implementation. This is one of the reasons why the Qt port is currently not
1826 using WebCore/platform/graphics/Font.cpp. By allowing to not use
1827 the simple/fast-path the Qt port will be able to use it.
1829 Introduce USE(FONT_FAST_PATH) and define it for every port but the
1832 * wtf/Platform.h: Enable USE(FONT_FAST_PATH)
1834 2008-12-11 Gabor Loki <loki@inf.u-szeged.hu>
1836 Reviewed by Darin Adler and landed by Holger Freyther.
1838 <https://bugs.webkit.org/show_bug.cgi?id=22648>
1839 Fix threading on Qt-port and Gtk-port for Sampling tool.
1841 * wtf/ThreadingGtk.cpp:
1842 (WTF::waitForThreadCompletion):
1843 * wtf/ThreadingQt.cpp:
1844 (WTF::waitForThreadCompletion):
1846 2008-12-10 Cameron Zwarich <zwarich@apple.com>
1848 Reviewed by Oliver Hunt.
1850 Bug 22734: Debugger crashes when stepping into a function call in a return statement
1851 <https://bugs.webkit.org/show_bug.cgi?id=22734>
1852 <rdar://problem/6426796>
1854 * bytecompiler/BytecodeGenerator.cpp:
1855 (JSC::BytecodeGenerator::BytecodeGenerator): The DebuggerCallFrame uses
1856 the 'this' value stored in a callFrame, so op_convert_this should be
1857 emitted at the beginning of a function body when generating bytecode
1859 * debugger/DebuggerCallFrame.cpp:
1860 (JSC::DebuggerCallFrame::thisObject): The assertion inherent in the call
1861 to asObject() here is valid, because any 'this' value should have been
1862 converted to a JSObject*.
1864 2008-12-10 Gavin Barraclough <barraclough@apple.com>
1866 Reviewed by Geoff Garen.
1868 Port more of the JIT to use the MacroAssembler interface.
1870 Everything in the main pass, bar a few corner cases (operations with required
1871 registers, or calling convention code). Slightly refactors array creation,
1872 moving the offset calculation into the callFrame into C code (reducing code
1875 Overall this appears to be a 1% win on v8-tests, due to the smaller immediates
1876 being planted (in jfalse in particular).
1878 * interpreter/Interpreter.cpp:
1879 (JSC::Interpreter::cti_op_new_array):
1881 (JSC::JIT::privateCompileMainPass):
1882 (JSC::JIT::privateCompileSlowCases):
1884 * wrec/WRECGenerator.cpp:
1885 (JSC::WREC::Generator::generateEnter):
1887 2008-12-10 Sam Weinig <sam@webkit.org>
1891 * bytecode/CodeBlock.h:
1893 2008-12-10 Sam Weinig <sam@webkit.org>
1895 Reviewed by Geoffrey Garen.
1897 <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
1901 Convert the return address table from a HashMap to a sorted Vector. This
1902 reduces the size of the data structure by ~4.5MB on Membuster head.
1904 SunSpider reports a 0.5% progression.
1906 * bytecode/CodeBlock.cpp:
1907 (JSC::sizeInBytes): Generic method to get the cost of a Vector.
1908 (JSC::CodeBlock::dumpStatistics): Add dumping of member sizes.
1909 * bytecode/CodeBlock.h:
1910 (JSC::PC::PC): Struct representing NativePC -> VirtualPC mappings.
1911 (JSC::getNativePC): Helper for binary chop.
1912 (JSC::CodeBlock::getBytecodeIndex): Used to get the VirtualPC from a
1913 NativePC using a binary chop of the pcVector.
1914 (JSC::CodeBlock::pcVector): Accessor.
1916 * interpreter/Interpreter.cpp:
1917 (JSC::vPCForPC): Use getBytecodeIndex instead of jitReturnAddressVPCMap().get().
1918 (JSC::Interpreter::cti_op_instanceof): Ditto.
1919 (JSC::Interpreter::cti_op_resolve): Ditto.
1920 (JSC::Interpreter::cti_op_resolve_func): Ditto.
1921 (JSC::Interpreter::cti_op_resolve_skip): Ditto.
1922 (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
1923 (JSC::Interpreter::cti_op_throw): Ditto.
1924 (JSC::Interpreter::cti_op_in): Ditto.
1925 (JSC::Interpreter::cti_vm_throw): Ditto.
1928 (JSC::JIT::privateCompile): Reserve exact capacity and fill the pcVector.
1930 2008-12-09 Geoffrey Garen <ggaren@apple.com>
1932 Reviewed by Oliver Hunt.
1934 Added WREC support for an assertion followed by a quantifier. Fixed
1937 * wrec/WRECParser.cpp:
1938 (JSC::WREC::Parser::parseParentheses): Throw away the quantifier, since
1939 it's meaningless. (Firefox does the same.)
1941 * pcre/pcre_compile.cpp:
1942 (compileBranch): ditto.
1944 2008-12-09 Geoffrey Garen <ggaren@apple.com>
1946 Reviewed by Cameron Zwarich.
1948 In preparation for compiling WREC without PCRE:
1950 Further relaxed WREC's parsing to be more web-compatible. Fixed PCRE to
1951 match in cases where it didn't already.
1953 Changed JavaScriptCore to report syntax errors detected by WREC, rather
1954 than falling back on PCRE any time WREC sees an error.
1956 * pcre/pcre_compile.cpp:
1957 (checkEscape): Relaxed parsing of \c and \N escapes to be more
1960 * runtime/RegExp.cpp:
1961 (JSC::RegExp::RegExp): Only fall back on PCRE if WREC has not reported
1965 (JSC::WREC::Generator::compileRegExp): Fixed some error reporting to
1968 * wrec/WRECParser.cpp: Added error messages that match PCRE.
1970 (JSC::WREC::Parser::consumeGreedyQuantifier):
1971 (JSC::WREC::Parser::parseParentheses):
1972 (JSC::WREC::Parser::parseCharacterClass):
1973 (JSC::WREC::Parser::parseNonCharacterEscape): Updated the above functions to
1974 use the new setError API.
1976 (JSC::WREC::Parser::consumeEscape): Relaxed parsing of \c \N \u \x \B
1977 to be more web-compatible.
1979 (JSC::WREC::Parser::parseAlternative): Distinguish between a malformed
1980 quantifier and a quantifier with no prefix, like PCRE does.
1982 (JSC::WREC::Parser::consumeParenthesesType): Updated to use the new setError API.
1984 * wrec/WRECParser.h:
1985 (JSC::WREC::Parser::error):
1986 (JSC::WREC::Parser::syntaxError):
1987 (JSC::WREC::Parser::parsePattern):
1988 (JSC::WREC::Parser::reset):
1989 (JSC::WREC::Parser::setError): Store error messages instead of error codes,
1990 to provide for exception messages. Use a setter for reporting errors, so
1991 errors detected early are not overwritten by errors detected later.
1993 2008-12-09 Gavin Barraclough <barraclough@apple.com>
1995 Reviewed by Oliver Hunt.
1997 Use va_args to access cti function arguments.
1998 https://bugs.webkit.org/show_bug.cgi?id=22774
2000 This may be a minor regression, but we'll take the hit if so to reduce fragility.
2002 * interpreter/Interpreter.cpp:
2003 * interpreter/Interpreter.h:
2005 2008-12-09 Sam Weinig <sam@webkit.org>
2007 Reviewed twice by Cameron Zwarich.
2009 Fix for https://bugs.webkit.org/show_bug.cgi?id=22752
2010 Clear SymbolTable after codegen for Function codeblocks that
2011 don't require an activation
2013 This is a ~1.5MB improvement on Membuster-head.
2015 * bytecode/CodeBlock.cpp:
2016 (JSC::CodeBlock::dumpStatistics): Add logging of non-empty symbol tables
2017 and total size used by symbol tables.
2018 * bytecompiler/BytecodeGenerator.cpp:
2019 (JSC::BytecodeGenerator::generate): Clear the symbol table here.
2021 2008-12-09 Sam Weinig <sam@webkit.org>
2023 Reviewed by Geoffrey Garen.
2025 Remove unnecessary extra lookup when throwing an exception.
2026 We used to first lookup the target offset using getHandlerForVPC
2027 and then we would lookup the native code stub using
2028 nativeExceptionCodeForHandlerVPC. Instead, we can just pass around
2031 * bytecode/CodeBlock.cpp:
2032 (JSC::CodeBlock::handlerForVPC): Return the HandlerInfo.
2033 * bytecode/CodeBlock.h: Remove nativeExceptionCodeForHandlerVPC.
2035 * interpreter/Interpreter.cpp:
2036 (JSC::Interpreter::throwException): Return a HandlerInfo instead of
2037 and Instruction offset.
2038 (JSC::Interpreter::privateExecute): Get the offset from HandlerInfo.
2039 (JSC::Interpreter::cti_op_throw): Get the native code from the HandleInfo.
2040 (JSC::Interpreter::cti_vm_throw): Ditto.
2041 * interpreter/Interpreter.h:
2043 2008-12-09 Eric Seidel <eric@webkit.org>
2045 Build fix only, no review.
2047 Speculative fix for the Chromium-Windows bot.
2048 Add JavaScriptCore/os-win32 to the include path (for stdint.h)
2049 Strangely it builds fine on my local windows box (or at least doesn't hit this error)
2051 * JavaScriptCore.scons:
2053 2008-12-09 Eric Seidel <eric@webkit.org>
2055 No review, build fix only.
2057 Add ExecutableAllocator files missing from Scons build.
2059 * JavaScriptCore.scons:
2061 2008-12-09 Dimitri Glazkov <dglazkov@chromium.org>
2063 Reviewed by Timothy Hatcher.
2065 https://bugs.webkit.org/show_bug.cgi?id=22631
2066 Allow ScriptCallFrame query names of functions in the call stack.
2068 * JavaScriptCore.exp: added InternalFunction::name and
2069 UString operator==() as exported symbol
2071 2008-12-08 Judit Jasz <jasy@inf.u-szeged.hu>
2073 Reviewed and tweaked by Cameron Zwarich.
2075 Bug 22352: Annotate opcodes with their length
2076 <https://bugs.webkit.org/show_bug.cgi?id=22352>
2078 * bytecode/Opcode.cpp:
2079 * bytecode/Opcode.h:
2080 * interpreter/Interpreter.cpp:
2081 (JSC::Interpreter::privateExecute):
2083 (JSC::JIT::privateCompileMainPass):
2084 (JSC::JIT::privateCompileSlowCases):
2086 2008-12-08 Geoffrey Garen <ggaren@apple.com>
2088 Reviewed by Oliver Hunt.
2090 Implemented more of the relaxed and somewhat weird rules for deciding
2091 how to interpret a non-pattern-character.
2094 (JSC::WREC::Escape::):
2095 (JSC::WREC::Escape::Escape): Eliminated Escape::None because it was
2096 unused. If you see an '\\', it's either a valid escape or an error.
2098 * wrec/Quantifier.h:
2099 (JSC::WREC::Quantifier::Quantifier):
2100 * wrec/WRECGenerator.cpp:
2101 (JSC::WREC::Generator::generateNonGreedyQuantifier):
2102 (JSC::WREC::Generator::generateGreedyQuantifier): Renamed "noMaxSpecified"
2103 to "Infinity", since that's what it means.
2105 * wrec/WRECParser.cpp:
2106 (JSC::WREC::Parser::consumeGreedyQuantifier): Re-wrote {n,m} parsing rules
2107 because they were too strict before. Added support for backtracking
2108 in the case where the {n,m} fails to parse as a quantifier, and yet is
2111 (JSC::WREC::Parser::parseCharacterClass):
2112 (JSC::WREC::Parser::parseNonCharacterEscape): Eliminated Escape::None,
2115 (JSC::WREC::Parser::consumeEscape): Don't treat ASCII and _ escapes
2116 as syntax errors. See fast/regex/non-pattern-characters.html.
2118 * wrec/WRECParser.h:
2119 (JSC::WREC::Parser::SavedState::SavedState):
2120 (JSC::WREC::Parser::SavedState::restore): Added a state backtracker,
2121 since parsing {n,m} forms requires backtracking if the form turns out
2122 not to be a quantifier.
2124 2008-12-08 Geoffrey Garen <ggaren@apple.com>
2126 Reviewed by Oliver Hunt.
2128 Refactored WREC parsing so that only one piece of code needs to know
2129 the relaxed and somewhat weird rules for deciding how to interpret a
2130 non-pattern-character, in preparation for implementing those rules.
2132 Also, implemented the relaxed and somewhat weird rules for '}' and ']'.
2134 * wrec/WREC.cpp: Reduced the regular expression size limit. Now that
2135 WREC handles ']' properly, it compiles fast/js/regexp-charclass-crash.html,
2136 which makes it hang at the old limit. (The old limit was based on the
2137 misimpression that the same value in PCRE limited the regular expression
2138 pattern size; in reality, it limited the expected compiled regular
2139 expression size. WREC doesn't have a way to calculate an expected
2140 compiled regular expression size, but this should be good enough.)
2142 * wrec/WRECParser.cpp:
2143 (JSC::WREC::parsePatternCharacterSequence): Nixed this function because
2144 it contained a second copy of the logic for handling non-pattern-characters,
2145 which is about to get a lot more complicated.
2147 (JSC::WREC::PatternCharacterSequence::PatternCharacterSequence):
2148 (JSC::WREC::PatternCharacterSequence::size):
2149 (JSC::WREC::PatternCharacterSequence::append):
2150 (JSC::WREC::PatternCharacterSequence::flush): Helper object for generating
2151 an optimized sequence of pattern characters.
2153 (JSC::WREC::Parser::parseNonCharacterEscape): Renamed to reflect the fact
2154 that the main parseAlternative loop handles character escapes.
2156 (JSC::WREC::Parser::parseAlternative): Moved pattern character sequence
2157 logic from parsePatternCharacterSequence to here, using
2158 PatternCharacterSequence to help with the details.
2160 * wrec/WRECParser.h: Updated for renames.
2162 2008-12-08 Alexey Proskuryakov <ap@webkit.org>
2164 Reviewed by Geoff Garen.
2166 <rdar://problem/6166088> Give JSGlobalContextCreate a behavior that is concurrency aware,
2169 * API/JSContextRef.cpp: (JSGlobalContextCreate):
2170 * API/JSContextRef.h:
2171 Use a unique context group for the context, unless the application was linked against old
2174 2008-12-08 Sam Weinig <sam@webkit.org>
2176 Reviewed by Cameron Zwarich.
2178 Fix for <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
2182 Remove use of jitReturnAddressVPCMap when looking for vPC to store Structures
2183 in for cached lookup. Instead, use the offset in the StructureStubInfo that is
2186 * bytecode/CodeBlock.cpp:
2187 (JSC::CodeBlock::dumpStatistics): Fix extraneous semicolon.
2188 * interpreter/Interpreter.cpp:
2189 (JSC::Interpreter::tryCTICachePutByID):
2190 (JSC::Interpreter::tryCTICacheGetByID):
2191 (JSC::Interpreter::cti_op_get_by_id_self_fail):
2192 (JSC::Interpreter::cti_op_get_by_id_proto_list):
2194 (JSC::JIT::compileGetByIdSelf):
2195 (JSC::JIT::compileGetByIdProto):
2196 (JSC::JIT::compileGetByIdChain):
2197 (JSC::JIT::compilePutByIdReplace):
2198 (JSC::JIT::compilePutByIdTransition):
2199 * jit/JITPropertyAccess.cpp:
2200 (JSC::JIT::privateCompilePutByIdTransition):
2201 (JSC::JIT::patchGetByIdSelf):
2202 (JSC::JIT::patchPutByIdReplace):
2203 (JSC::JIT::privateCompilePatchGetArrayLength): Remove extra call to getStubInfo.
2204 (JSC::JIT::privateCompileGetByIdSelf):
2205 (JSC::JIT::privateCompileGetByIdProto):
2206 (JSC::JIT::privateCompileGetByIdChain):
2207 (JSC::JIT::privateCompilePutByIdReplace):
2209 2008-12-08 Gavin Barraclough <barraclough@apple.com>
2211 Reviewed by Oliver Hunt.
2213 Port the op_j?n?eq_null JIT code generation to use the MacroAssembler,
2214 and clean up slightly at the same time. The 'j' forms currently compare,
2215 then set a register, then compare again, then branch. Branch directly on
2216 the result of the first compare.
2218 Around a 1% progression on deltablue, crypto & early boyer, for about 1/2%
2219 overall on v8-tests.
2222 (JSC::JIT::privateCompileMainPass):
2223 * jit/JITPropertyAccess.cpp:
2224 (JSC::JIT::compileGetByIdSlowCase):
2226 2008-12-08 Gavin Barraclough <barraclough@apple.com>
2228 Reviewed by Geoff Garen.
2230 Expand MacroAssembler to support more operations, required by the JIT.
2232 Generally adds more operations and permutations of operands to the existing
2233 interface. Rename 'jset' to 'jnz' and 'jnset' to 'jz', which seem clearer,
2234 and require that immediate pointer operands (though not pointer addresses to
2235 load and store instructions) are wrapped in a ImmPtr() type, akin to Imm32().
2237 No performance impact.
2239 * assembler/MacroAssembler.h:
2240 (JSC::MacroAssembler::):
2241 (JSC::MacroAssembler::ImmPtr::ImmPtr):
2242 (JSC::MacroAssembler::add32):
2243 (JSC::MacroAssembler::and32):
2244 (JSC::MacroAssembler::or32):
2245 (JSC::MacroAssembler::sub32):
2246 (JSC::MacroAssembler::xor32):
2247 (JSC::MacroAssembler::loadPtr):
2248 (JSC::MacroAssembler::load32):
2249 (JSC::MacroAssembler::storePtr):
2250 (JSC::MacroAssembler::store32):
2251 (JSC::MacroAssembler::poke):
2252 (JSC::MacroAssembler::move):
2253 (JSC::MacroAssembler::testImm32):
2254 (JSC::MacroAssembler::jae32):
2255 (JSC::MacroAssembler::jb32):
2256 (JSC::MacroAssembler::jePtr):
2257 (JSC::MacroAssembler::je32):
2258 (JSC::MacroAssembler::jnePtr):
2259 (JSC::MacroAssembler::jne32):
2260 (JSC::MacroAssembler::jnzPtr):
2261 (JSC::MacroAssembler::jnz32):
2262 (JSC::MacroAssembler::jzPtr):
2263 (JSC::MacroAssembler::jz32):
2264 (JSC::MacroAssembler::joSub32):
2265 (JSC::MacroAssembler::jump):
2266 (JSC::MacroAssembler::sete32):
2267 (JSC::MacroAssembler::setne32):
2268 (JSC::MacroAssembler::setnz32):
2269 (JSC::MacroAssembler::setz32):
2270 * assembler/X86Assembler.h:
2271 (JSC::X86Assembler::addl_mr):
2272 (JSC::X86Assembler::andl_i8r):
2273 (JSC::X86Assembler::cmpl_rm):
2274 (JSC::X86Assembler::cmpl_mr):
2275 (JSC::X86Assembler::cmpl_i8m):
2276 (JSC::X86Assembler::subl_mr):
2277 (JSC::X86Assembler::testl_i32m):
2278 (JSC::X86Assembler::xorl_i32r):
2279 (JSC::X86Assembler::movl_rm):
2280 (JSC::X86Assembler::modRm_opmsib):
2282 (JSC::JIT::privateCompileMainPass):
2283 * jit/JITInlineMethods.h:
2284 (JSC::JIT::emitGetVirtualRegister):
2285 (JSC::JIT::emitPutCTIArgConstant):
2286 (JSC::JIT::emitPutCTIParam):
2287 (JSC::JIT::emitPutImmediateToCallFrameHeader):
2288 (JSC::JIT::emitInitRegister):
2289 (JSC::JIT::checkStructure):
2290 (JSC::JIT::emitJumpIfJSCell):
2291 (JSC::JIT::emitJumpIfNotJSCell):
2292 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
2294 2008-12-08 Geoffrey Garen <ggaren@apple.com>
2296 Reviewed by Sam Weinig.
2298 Fixed a bug where WREC would allow a quantifier whose minimum was
2299 greater than its maximum.
2301 * wrec/Quantifier.h:
2302 (JSC::WREC::Quantifier::Quantifier): ASSERT that the quantifier is not
2305 * wrec/WRECParser.cpp:
2306 (JSC::WREC::Parser::consumeGreedyQuantifier): Verify that the minimum
2307 is not greater than the maximum.
2309 2008-12-08 Eric Seidel <eric@webkit.org>
2311 Build fix only, no review.
2313 * JavaScriptCore.scons: add bytecode/JumpTable.cpp
2315 2008-12-08 Sam Weinig <sam@webkit.org>
2317 Reviewed by Geoffrey Garen.
2319 Patch for https://bugs.webkit.org/show_bug.cgi?id=22716
2320 <rdar://problem/6428315>
2321 Add RareData structure to CodeBlock for infrequently used auxiliary data
2324 Reduces memory on Membuster-head by ~.5MB
2326 * bytecode/CodeBlock.cpp:
2327 (JSC::CodeBlock::dump):
2328 (JSC::CodeBlock::dumpStatistics):
2329 (JSC::CodeBlock::mark):
2330 (JSC::CodeBlock::getHandlerForVPC):
2331 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
2332 (JSC::CodeBlock::shrinkToFit):
2333 * bytecode/CodeBlock.h:
2334 (JSC::CodeBlock::numberOfExceptionHandlers):
2335 (JSC::CodeBlock::addExceptionHandler):
2336 (JSC::CodeBlock::exceptionHandler):
2337 (JSC::CodeBlock::addFunction):
2338 (JSC::CodeBlock::function):
2339 (JSC::CodeBlock::addUnexpectedConstant):
2340 (JSC::CodeBlock::unexpectedConstant):
2341 (JSC::CodeBlock::addRegExp):
2342 (JSC::CodeBlock::regexp):
2343 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
2344 (JSC::CodeBlock::addImmediateSwitchJumpTable):
2345 (JSC::CodeBlock::immediateSwitchJumpTable):
2346 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
2347 (JSC::CodeBlock::addCharacterSwitchJumpTable):
2348 (JSC::CodeBlock::characterSwitchJumpTable):
2349 (JSC::CodeBlock::numberOfStringSwitchJumpTables):
2350 (JSC::CodeBlock::addStringSwitchJumpTable):
2351 (JSC::CodeBlock::stringSwitchJumpTable):
2352 (JSC::CodeBlock::evalCodeCache):
2353 (JSC::CodeBlock::createRareDataIfNecessary):
2355 2008-11-26 Peter Kasting <pkasting@google.com>
2357 Reviewed by Anders Carlsson.
2359 https://bugs.webkit.org/show_bug.cgi?id=16814
2360 Allow ports to disable ActiveX->NPAPI conversion for Media Player.
2361 Improve handling of miscellaneous ActiveX objects.
2363 * wtf/Platform.h: Add another ENABLE(...).
2365 2008-12-08 Sam Weinig <sam@webkit.org>
2367 Reviewed by Mark Rowe.
2369 Add dumping of CodeBlock member structure usage.
2371 * bytecode/CodeBlock.cpp:
2372 (JSC::CodeBlock::dumpStatistics):
2373 * bytecode/EvalCodeCache.h:
2374 (JSC::EvalCodeCache::isEmpty):
2376 2008-12-08 David Kilzer <ddkilzer@apple.com>
2378 Bug 22555: Sort "children" sections in Xcode project files
2380 <https://bugs.webkit.org/show_bug.cgi?id=22555>
2382 Reviewed by Eric Seidel.
2384 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted.
2386 2008-12-08 Tony Chang <tony@chromium.org>
2388 Reviewed by Eric Seidel.
2390 Enable Pan scrolling only when building on PLATFORM(WIN_OS)
2391 Previously platforms like Apple Windows WebKit, Cairo Windows WebKit,
2392 Wx and Chromium were enabling it explicitly, now we just turn it on
2393 for all WIN_OS, later platforms can turn it off as needed on Windows
2394 (or turn it on under Linux, etc.)
2395 https://bugs.webkit.org/show_bug.cgi?id=22698
2399 2008-12-08 Sam Weinig <sam@webkit.org>
2401 Reviewed by Cameron Zwarich.
2403 Add basic memory statistics dumping for CodeBlock.
2405 * bytecode/CodeBlock.cpp:
2406 (JSC::CodeBlock::dumpStatistics):
2407 (JSC::CodeBlock::CodeBlock):
2408 (JSC::CodeBlock::~CodeBlock):
2409 * bytecode/CodeBlock.h:
2411 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
2413 Fix the Linux build with newer gcc/glibc.
2415 * jit/ExecutableAllocatorPosix.cpp: Include unistd.h for
2416 getpagesize(), according to
2417 http://opengroup.org/onlinepubs/007908775/xsh/getpagesize.html
2419 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
2421 Fix the build with Qt on Windows.
2423 * JavaScriptCore.pri: Compile ExecutableAllocatorWin.cpp on Windows.
2425 2008-12-07 Oliver Hunt <oliver@apple.com>
2427 Reviewed by NOBODY (Buildfix).
2431 * runtime/RegExp.cpp:
2432 (JSC::RegExp::RegExp):
2434 2008-12-07 Oliver Hunt <oliver@apple.com>
2436 Reviewed by NOBODY (Build fix).
2438 Put ENABLE(ASSEMBLER) guards around use of ExecutableAllocator in global data
2440 Correct Qt and Gtk project files
2443 * JavaScriptCore.pri:
2444 * runtime/JSGlobalData.h:
2446 2008-12-07 Oliver Hunt <oliver@apple.com>
2448 Reviewed by NOBODY (Build fix).
2450 Add new files to other projects.
2453 * JavaScriptCore.pri:
2454 * JavaScriptCore.pro:
2456 2008-12-07 Oliver Hunt <oliver@apple.com>
2458 Rubber stamped by Mark Rowe.
2460 Rename ExecutableAllocatorMMAP to the more sensible ExecutableAllocatorPosix
2462 * JavaScriptCore.xcodeproj/project.pbxproj:
2463 * jit/ExecutableAllocator.h:
2464 * jit/ExecutableAllocatorPosix.cpp: Renamed from JavaScriptCore/jit/ExecutableAllocatorMMAP.cpp.
2465 (JSC::ExecutableAllocator::intializePageSize):
2466 (JSC::ExecutablePool::systemAlloc):
2467 (JSC::ExecutablePool::systemRelease):
2469 2008-12-07 Oliver Hunt <oliver@apple.com>
2471 Reviewed by Cameron Zwarich and Sam Weinig
2473 <rdar://problem/6309878> Need more granular control over allocation of executable memory (21783)
2474 <https://bugs.webkit.org/show_bug.cgi?id=21783>
2476 Add a new allocator for use by the JIT that provides executable pages, so
2477 we can get rid of the current hack that makes the entire heap executable.
2479 1-2% progression on SunSpider-v8, 1% on SunSpider. Reduces memory usage as well!
2481 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2482 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2483 * JavaScriptCore.xcodeproj/project.pbxproj:
2484 * assembler/AssemblerBuffer.h:
2485 (JSC::AssemblerBuffer::size):
2486 (JSC::AssemblerBuffer::executableCopy):
2487 * assembler/MacroAssembler.h:
2488 (JSC::MacroAssembler::size):
2489 (JSC::MacroAssembler::copyCode):
2490 * assembler/X86Assembler.h:
2491 (JSC::X86Assembler::size):
2492 (JSC::X86Assembler::executableCopy):
2493 * bytecode/CodeBlock.cpp:
2494 (JSC::CodeBlock::~CodeBlock):
2495 * bytecode/CodeBlock.h:
2496 (JSC::CodeBlock::executablePool):
2497 (JSC::CodeBlock::setExecutablePool):
2498 * bytecode/Instruction.h:
2499 (JSC::PolymorphicAccessStructureList::derefStructures):
2500 * interpreter/Interpreter.cpp:
2501 (JSC::Interpreter::~Interpreter):
2502 * interpreter/Interpreter.h:
2503 * jit/ExecutableAllocator.cpp: Added.
2504 * jit/ExecutableAllocator.h: Added.
2505 (JSC::ExecutablePool::create):
2506 (JSC::ExecutablePool::alloc):
2507 (JSC::ExecutablePool::~ExecutablePool):
2508 (JSC::ExecutablePool::available):
2509 (JSC::ExecutablePool::ExecutablePool):
2510 (JSC::ExecutablePool::poolAllocate):
2511 (JSC::ExecutableAllocator::ExecutableAllocator):
2512 (JSC::ExecutableAllocator::poolForSize):
2513 (JSC::ExecutablePool::sizeForAllocation):
2514 * jit/ExecutableAllocatorMMAP.cpp: Added.
2515 (JSC::ExecutableAllocator::intializePageSize):
2516 (JSC::ExecutablePool::systemAlloc):
2517 (JSC::ExecutablePool::systemRelease):
2518 * jit/ExecutableAllocatorWin.cpp: Added.
2519 (JSC::ExecutableAllocator::intializePageSize):
2520 (JSC::ExecutablePool::systemAlloc):
2521 (JSC::ExecutablePool::systemRelease):
2523 (JSC::JIT::privateCompile):
2524 (JSC::JIT::privateCompileCTIMachineTrampolines):
2526 (JSC::JIT::compileCTIMachineTrampolines):
2527 * jit/JITPropertyAccess.cpp:
2528 (JSC::JIT::privateCompilePutByIdTransition):
2529 (JSC::JIT::privateCompilePatchGetArrayLength):
2530 (JSC::JIT::privateCompileGetByIdSelf):
2531 (JSC::JIT::privateCompileGetByIdProto):
2532 (JSC::JIT::privateCompileGetByIdSelfList):
2533 (JSC::JIT::privateCompileGetByIdProtoList):
2534 (JSC::JIT::privateCompileGetByIdChainList):
2535 (JSC::JIT::privateCompileGetByIdChain):
2536 (JSC::JIT::privateCompilePutByIdReplace):
2538 (JSC::RegExpNode::emitBytecode):
2539 * runtime/JSGlobalData.h:
2540 (JSC::JSGlobalData::poolForSize):
2541 * runtime/RegExp.cpp:
2542 (JSC::RegExp::RegExp):
2543 (JSC::RegExp::create):
2544 (JSC::RegExp::~RegExp):
2546 * runtime/RegExpConstructor.cpp:
2547 (JSC::constructRegExp):
2548 * runtime/RegExpPrototype.cpp:
2549 (JSC::regExpProtoFuncCompile):
2550 * runtime/StringPrototype.cpp:
2551 (JSC::stringProtoFuncMatch):
2552 (JSC::stringProtoFuncSearch):
2554 (JSC::WREC::Generator::compileRegExp):
2555 * wrec/WRECGenerator.h:
2556 * wtf/FastMalloc.cpp:
2558 * wtf/TCSystemAlloc.cpp:
2562 (TCMalloc_SystemRelease):
2564 2008-12-06 Sam Weinig <sam@webkit.org>
2568 * jit/JITPropertyAccess.cpp:
2569 (JSC::JIT::compileGetByIdHotPath):
2570 (JSC::JIT::compilePutByIdHotPath):
2572 2008-12-06 Sam Weinig <sam@webkit.org>
2574 Reviewed by Cameron Zwarich,
2576 Move CodeBlock constructor into the .cpp file.
2578 Sunspider reports a .7% progression, but I can only assume this
2581 * bytecode/CodeBlock.cpp:
2582 (JSC::CodeBlock::CodeBlock):
2583 * bytecode/CodeBlock.h:
2585 2008-12-06 Sam Weinig <sam@webkit.org>
2587 Reviewed by Cameron Zwarich.
2589 Split JumpTable code into its own file.
2592 * JavaScriptCore.pri:
2593 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2594 * JavaScriptCore.xcodeproj/project.pbxproj:
2595 * JavaScriptCoreSources.bkl:
2596 * bytecode/CodeBlock.cpp:
2597 * bytecode/CodeBlock.h:
2598 * bytecode/JumpTable.cpp: Copied from bytecode/CodeBlock.cpp.
2599 * bytecode/JumpTable.h: Copied from bytecode/CodeBlock.h.
2601 2008-12-05 Sam Weinig <sam@webkit.org>
2603 Reviewed by Cameron Zwarich.
2605 Fix for https://bugs.webkit.org/show_bug.cgi?id=22715
2606 Encapsulate more CodeBlock members in preparation
2607 of moving some of them to a rare data structure.
2609 * bytecode/CodeBlock.cpp:
2610 (JSC::locationForOffset):
2611 (JSC::printConditionalJump):
2612 (JSC::printGetByIdOp):
2613 (JSC::printPutByIdOp):
2614 (JSC::CodeBlock::printStructure):
2615 (JSC::CodeBlock::printStructures):
2616 (JSC::CodeBlock::dump):
2617 (JSC::CodeBlock::~CodeBlock):
2618 (JSC::CodeBlock::unlinkCallers):
2619 (JSC::CodeBlock::derefStructures):
2620 (JSC::CodeBlock::refStructures):
2621 (JSC::CodeBlock::mark):
2622 (JSC::CodeBlock::getHandlerForVPC):
2623 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
2624 (JSC::CodeBlock::lineNumberForVPC):
2625 (JSC::CodeBlock::expressionRangeForVPC):
2626 (JSC::CodeBlock::shrinkToFit):
2627 * bytecode/CodeBlock.h:
2628 (JSC::CodeBlock::CodeBlock):
2629 (JSC::CodeBlock::addCaller):
2630 (JSC::CodeBlock::removeCaller):
2631 (JSC::CodeBlock::isKnownNotImmediate):
2632 (JSC::CodeBlock::isConstantRegisterIndex):
2633 (JSC::CodeBlock::getConstant):
2634 (JSC::CodeBlock::isTemporaryRegisterIndex):
2635 (JSC::CodeBlock::getStubInfo):
2636 (JSC::CodeBlock::getCallLinkInfo):
2637 (JSC::CodeBlock::instructions):
2638 (JSC::CodeBlock::setJITCode):
2639 (JSC::CodeBlock::jitCode):
2640 (JSC::CodeBlock::ownerNode):
2641 (JSC::CodeBlock::setGlobalData):
2642 (JSC::CodeBlock::setThisRegister):
2643 (JSC::CodeBlock::thisRegister):
2644 (JSC::CodeBlock::setNeedsFullScopeChain):
2645 (JSC::CodeBlock::needsFullScopeChain):
2646 (JSC::CodeBlock::setUsesEval):
2647 (JSC::CodeBlock::usesEval):
2648 (JSC::CodeBlock::setUsesArguments):
2649 (JSC::CodeBlock::usesArguments):
2650 (JSC::CodeBlock::codeType):
2651 (JSC::CodeBlock::source):
2652 (JSC::CodeBlock::sourceOffset):
2653 (JSC::CodeBlock::addGlobalResolveInstruction):
2654 (JSC::CodeBlock::numberOfPropertyAccessInstructions):
2655 (JSC::CodeBlock::addPropertyAccessInstruction):
2656 (JSC::CodeBlock::propertyAccessInstruction):
2657 (JSC::CodeBlock::numberOfCallLinkInfos):
2658 (JSC::CodeBlock::addCallLinkInfo):
2659 (JSC::CodeBlock::callLinkInfo):
2660 (JSC::CodeBlock::numberOfJumpTargets):
2661 (JSC::CodeBlock::addJumpTarget):
2662 (JSC::CodeBlock::jumpTarget):
2663 (JSC::CodeBlock::lastJumpTarget):
2664 (JSC::CodeBlock::numberOfExceptionHandlers):
2665 (JSC::CodeBlock::addExceptionHandler):
2666 (JSC::CodeBlock::exceptionHandler):
2667 (JSC::CodeBlock::addExpressionInfo):
2668 (JSC::CodeBlock::numberOfLineInfos):
2669 (JSC::CodeBlock::addLineInfo):
2670 (JSC::CodeBlock::lastLineInfo):
2671 (JSC::CodeBlock::jitReturnAddressVPCMap):
2672 (JSC::CodeBlock::numberOfIdentifiers):
2673 (JSC::CodeBlock::addIdentifier):
2674 (JSC::CodeBlock::identifier):
2675 (JSC::CodeBlock::numberOfConstantRegisters):
2676 (JSC::CodeBlock::addConstantRegister):
2677 (JSC::CodeBlock::constantRegister):
2678 (JSC::CodeBlock::addFunction):
2679 (JSC::CodeBlock::function):
2680 (JSC::CodeBlock::addFunctionExpression):
2681 (JSC::CodeBlock::functionExpression):
2682 (JSC::CodeBlock::addUnexpectedConstant):
2683 (JSC::CodeBlock::unexpectedConstant):
2684 (JSC::CodeBlock::addRegExp):
2685 (JSC::CodeBlock::regexp):
2686 (JSC::CodeBlock::symbolTable):
2687 (JSC::CodeBlock::evalCodeCache):
2688 New inline setters/getters.
2690 (JSC::ProgramCodeBlock::ProgramCodeBlock):
2691 (JSC::ProgramCodeBlock::~ProgramCodeBlock):
2692 (JSC::ProgramCodeBlock::clearGlobalObject):
2693 * bytecode/SamplingTool.cpp:
2694 (JSC::ScopeSampleRecord::sample):
2695 (JSC::SamplingTool::dump):
2696 * bytecompiler/BytecodeGenerator.cpp:
2697 * bytecompiler/BytecodeGenerator.h:
2698 * bytecompiler/Label.h:
2699 * interpreter/CallFrame.cpp:
2700 * interpreter/Interpreter.cpp:
2703 * jit/JITInlineMethods.h:
2704 * jit/JITPropertyAccess.cpp:
2706 * runtime/Arguments.h:
2707 * runtime/ExceptionHelpers.cpp:
2708 * runtime/JSActivation.cpp:
2709 * runtime/JSActivation.h:
2710 * runtime/JSGlobalObject.cpp:
2711 Change direct access to use new getter/setters.
2713 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2715 Reviewed by Oliver Hunt.
2717 Prevent GCC4.2 from hanging when trying to compile Interpreter.cpp.
2718 Added "-fno-var-tracking" compiler flag.
2720 https://bugs.webkit.org/show_bug.cgi?id=22704
2722 * JavaScriptCore.xcodeproj/project.pbxproj:
2724 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2726 Reviewed by Oliver Hunt.
2728 Ordering of branch operands in MacroAssembler in unnecessarily inconsistent.
2730 je, jg etc take an immediate operand as the second argument, but for the
2731 equality branches (je, jne) the immediate operand was the first argument. This
2732 was unnecessarily inconsistent. Change je, jne methods to take the immediate
2733 as the second argument.
2735 https://bugs.webkit.org/show_bug.cgi?id=22703
2737 * assembler/MacroAssembler.h:
2738 (JSC::MacroAssembler::je32):
2739 (JSC::MacroAssembler::jne32):
2741 (JSC::JIT::compileOpStrictEq):
2742 * wrec/WRECGenerator.cpp:
2743 (JSC::WREC::Generator::generateEnter):
2744 (JSC::WREC::Generator::generateNonGreedyQuantifier):
2745 (JSC::WREC::Generator::generateGreedyQuantifier):
2746 (JSC::WREC::Generator::generatePatternCharacterPair):
2747 (JSC::WREC::Generator::generatePatternCharacter):
2748 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
2749 (JSC::WREC::Generator::generateCharacterClassInverted):
2750 (JSC::WREC::Generator::generateAssertionBOL):
2751 (JSC::WREC::Generator::generateAssertionWordBoundary):
2753 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2755 Reviewed by Geoff Garen.
2757 Second tranche of porting JIT.cpp to MacroAssembler interface.
2759 * assembler/MacroAssembler.h:
2760 (JSC::MacroAssembler::mul32):
2761 (JSC::MacroAssembler::jl32):
2762 (JSC::MacroAssembler::jnzSub32):
2763 (JSC::MacroAssembler::joAdd32):
2764 (JSC::MacroAssembler::joMul32):
2765 (JSC::MacroAssembler::jzSub32):
2767 (JSC::JIT::emitSlowScriptCheck):
2768 (JSC::JIT::privateCompileMainPass):
2769 (JSC::JIT::privateCompileSlowCases):
2770 (JSC::JIT::privateCompileCTIMachineTrampolines):
2772 * jit/JITInlineMethods.h:
2773 (JSC::JIT::emitJumpIfNotJSCell):
2774 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
2776 2008-12-05 David Kilzer <ddkilzer@apple.com>
2778 Bug 22609: Provide a build-time choice when generating hash tables for properties of built-in DOM objects
2780 <https://bugs.webkit.org/show_bug.cgi?id=22609>
2781 <rdar://problem/6331749>
2783 Reviewed by Darin Adler.
2785 Initial patch by Yosen Lin. Adapted for ToT WebKit by David Kilzer.
2787 Added back the code that generates a "compact" hash (instead of a
2788 perfect hash) as a build-time option using the
2789 ENABLE(PERFECT_HASH_SIZE) macro as defined in Lookup.h.
2791 * create_hash_table: Rename variables to differentiate perfect hash
2792 values from compact hash values. Added back code to compute compact
2793 hash tables. Generate both hash table sizes and emit
2794 conditionalized code based on ENABLE(PERFECT_HASH_SIZE).
2795 * runtime/Lookup.cpp:
2796 (JSC::HashTable::createTable): Added version of createTable() for
2797 use with compact hash tables.
2798 (JSC::HashTable::deleteTable): Updated to work with compact hash
2800 * runtime/Lookup.h: Defined ENABLE(PERFECT_HASH_SIZE) macro here.
2801 (JSC::HashEntry::initialize): Set m_next to zero when using compact
2803 (JSC::HashEntry::setNext): Added for compact hash tables.
2804 (JSC::HashEntry::next): Added for compact hash tables.
2805 (JSC::HashTable::entry): Added version of entry() for use with
2806 compact hash tables.
2807 * runtime/Structure.cpp:
2808 (JSC::Structure::getEnumerablePropertyNames): Updated to work with
2809 compact hash tables.
2811 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2813 Reviewed by Geoff Garen.
2815 Remove redundant calls to JIT::emitSlowScriptCheck.
2816 This is checked in the hot path, so is not needed on the slow path - and the code
2817 was being planted before the start of the slow case, so was completely unreachable!
2820 (JSC::JIT::privateCompileSlowCases):
2822 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2824 Reviewed by Geoff Garen.
2826 Move JIT::compileOpStrictEq to MacroAssembler interface.
2828 The rewrite also looks like a small (<1%) performance progression.
2830 https://bugs.webkit.org/show_bug.cgi?id=22697
2833 (JSC::JIT::compileOpStrictEq):
2834 (JSC::JIT::privateCompileSlowCases):
2836 * jit/JITInlineMethods.h:
2837 (JSC::JIT::emitJumpIfJSCell):
2838 (JSC::JIT::emitJumpSlowCaseIfJSCell):
2840 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2842 Reviewed by Geoff Garen.
2844 Remove m_assembler from MacroAssembler::Jump.
2845 Keeping a pointer allowed for some syntactic sugar - "link()" looks nicer
2846 than "link(this)". But maintaining this doubles the size of Jump, which
2847 is even more unfortunate for the JIT, since there are many large structures
2848 holding JmpSrcs. Probably best to remove it.
2850 https://bugs.webkit.org/show_bug.cgi?id=22693
2852 * assembler/MacroAssembler.h:
2853 (JSC::MacroAssembler::Jump::Jump):
2854 (JSC::MacroAssembler::Jump::link):
2855 (JSC::MacroAssembler::Jump::linkTo):
2856 (JSC::MacroAssembler::JumpList::link):
2857 (JSC::MacroAssembler::JumpList::linkTo):
2858 (JSC::MacroAssembler::jae32):
2859 (JSC::MacroAssembler::je32):
2860 (JSC::MacroAssembler::je16):
2861 (JSC::MacroAssembler::jg32):
2862 (JSC::MacroAssembler::jge32):
2863 (JSC::MacroAssembler::jl32):
2864 (JSC::MacroAssembler::jle32):
2865 (JSC::MacroAssembler::jnePtr):
2866 (JSC::MacroAssembler::jne32):
2867 (JSC::MacroAssembler::jnset32):
2868 (JSC::MacroAssembler::jset32):
2869 (JSC::MacroAssembler::jump):
2870 (JSC::MacroAssembler::jzSub32):
2871 (JSC::MacroAssembler::joAdd32):
2872 (JSC::MacroAssembler::call):
2874 (JSC::WREC::Generator::compileRegExp):
2875 * wrec/WRECGenerator.cpp:
2876 (JSC::WREC::Generator::generateEnter):
2877 (JSC::WREC::Generator::generateBackreferenceQuantifier):
2878 (JSC::WREC::Generator::generateNonGreedyQuantifier):
2879 (JSC::WREC::Generator::generateGreedyQuantifier):
2880 (JSC::WREC::Generator::generatePatternCharacter):
2881 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
2882 (JSC::WREC::Generator::generateCharacterClassInverted):
2883 (JSC::WREC::Generator::generateCharacterClass):
2884 (JSC::WREC::Generator::generateParenthesesAssertion):
2885 (JSC::WREC::Generator::generateParenthesesInvertedAssertion):
2886 (JSC::WREC::Generator::generateParenthesesNonGreedy):
2887 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
2888 (JSC::WREC::Generator::generateAssertionBOL):
2889 (JSC::WREC::Generator::generateAssertionEOL):
2890 (JSC::WREC::Generator::generateAssertionWordBoundary):
2891 (JSC::WREC::Generator::generateBackreference):
2892 (JSC::WREC::Generator::terminateAlternative):
2893 (JSC::WREC::Generator::terminateDisjunction):
2894 * wrec/WRECParser.h:
2896 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2898 Reviewed by Geoffrey Garen.
2900 Simplify JIT generated checks for timeout code, by moving more work into the C function.
2901 https://bugs.webkit.org/show_bug.cgi?id=22688
2903 * interpreter/Interpreter.cpp:
2904 (JSC::Interpreter::cti_timeout_check):
2905 * interpreter/Interpreter.h:
2907 (JSC::JIT::emitSlowScriptCheck):
2909 2008-12-05 Sam Weinig <sam@webkit.org>
2911 Reviewed by Geoffrey Garen.
2913 Encapsulate access to jump tables in the CodeBlock in preparation
2914 of moving them to a rare data structure.
2916 * bytecode/CodeBlock.cpp:
2917 (JSC::CodeBlock::dump):
2918 (JSC::CodeBlock::shrinkToFit):
2919 * bytecode/CodeBlock.h:
2920 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
2921 (JSC::CodeBlock::addImmediateSwitchJumpTable):
2922 (JSC::CodeBlock::immediateSwitchJumpTable):
2923 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
2924 (JSC::CodeBlock::addCharacterSwitchJumpTable):
2925 (JSC::CodeBlock::characterSwitchJumpTable):
2926 (JSC::CodeBlock::numberOfStringSwitchJumpTables):
2927 (JSC::CodeBlock::addStringSwitchJumpTable):
2928 (JSC::CodeBlock::stringSwitchJumpTable):
2929 * bytecompiler/BytecodeGenerator.cpp:
2930 (JSC::BytecodeGenerator::generate):
2931 (JSC::BytecodeGenerator::endSwitch):
2932 * interpreter/Interpreter.cpp:
2933 (JSC::Interpreter::privateExecute):
2934 (JSC::Interpreter::cti_op_switch_imm):
2935 (JSC::Interpreter::cti_op_switch_char):
2936 (JSC::Interpreter::cti_op_switch_string):
2938 (JSC::JIT::privateCompileMainPass):
2940 2008-12-05 Adam Roben <aroben@apple.com>
2942 Windows build fix after r39020
2944 * jit/JITInlineMethods.h:
2945 (JSC::JIT::restoreArgumentReference):
2946 (JSC::JIT::restoreArgumentReferenceForTrampoline):
2947 Add some apparently-missing __.
2949 2008-12-04 Geoffrey Garen <ggaren@apple.com>
2951 Reviewed by Darin Adler.
2953 https://bugs.webkit.org/show_bug.cgi?id=22673
2955 Added support for the assertion (?=) and inverted assertion (?!) atoms
2958 * wrec/WRECGenerator.cpp:
2959 (JSC::WREC::Generator::generateParenthesesAssertion):
2960 (JSC::WREC::Generator::generateParenthesesInvertedAssertion): Split the
2961 old (unused) generateParentheses into these two functions, with more
2962 limited capabilities.
2964 * wrec/WRECGenerator.h:
2965 (JSC::WREC::Generator::): Moved an enum to the top of the class definition,
2966 to match the WebKit style, and removed a defunct comment.
2968 * wrec/WRECParser.cpp:
2969 (JSC::WREC::Parser::parseParentheses):
2970 (JSC::WREC::Parser::consumeParenthesesType):
2971 * wrec/WRECParser.h:
2972 (JSC::WREC::Parser::): Added support for parsing (?=) and (?!).
2974 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
2976 Rubber-stamped by Tor Arne Vestbø.
2978 Disable the JIT for the Qt build alltogether again, after observing
2979 more miscompilations in a wider range of newer gcc versions.
2981 * JavaScriptCore.pri:
2983 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
2985 Reviewed by Tor Arne Vestbø.
2987 Disable the JIT for the Qt build on Linux unless gcc is >= 4.2,
2988 due to miscompilations.
2990 * JavaScriptCore.pri:
2992 2008-12-04 Gavin Barraclough <barraclough@apple.com>
2994 Reviewed by Geoff Garen.
2996 Start porting the JIT to use the MacroAssembler.
2998 https://bugs.webkit.org/show_bug.cgi?id=22671
2999 No change in performance.
3001 * assembler/MacroAssembler.h:
3002 (JSC::MacroAssembler::Jump::operator X86Assembler::JmpSrc):
3003 (JSC::MacroAssembler::add32):
3004 (JSC::MacroAssembler::and32):
3005 (JSC::MacroAssembler::lshift32):
3006 (JSC::MacroAssembler::rshift32):
3007 (JSC::MacroAssembler::storePtr):
3008 (JSC::MacroAssembler::store32):
3009 (JSC::MacroAssembler::poke):
3010 (JSC::MacroAssembler::move):
3011 (JSC::MacroAssembler::compareImm32ForBranchEquality):
3012 (JSC::MacroAssembler::jnePtr):
3013 (JSC::MacroAssembler::jnset32):
3014 (JSC::MacroAssembler::jset32):
3015 (JSC::MacroAssembler::jzeroSub32):
3016 (JSC::MacroAssembler::joverAdd32):
3017 (JSC::MacroAssembler::call):
3018 * assembler/X86Assembler.h:
3019 (JSC::X86Assembler::shll_i8r):
3021 (JSC::JIT::privateCompileMainPass):
3022 (JSC::JIT::privateCompile):
3023 (JSC::JIT::privateCompileCTIMachineTrampolines):
3025 * jit/JITArithmetic.cpp:
3026 (JSC::JIT::compileBinaryArithOp):
3027 * jit/JITInlineMethods.h:
3028 (JSC::JIT::emitGetVirtualRegister):
3029 (JSC::JIT::emitPutCTIArg):
3030 (JSC::JIT::emitPutCTIArgConstant):
3031 (JSC::JIT::emitGetCTIArg):
3032 (JSC::JIT::emitPutCTIArgFromVirtualRegister):
3033 (JSC::JIT::emitPutCTIParam):
3034 (JSC::JIT::emitGetCTIParam):
3035 (JSC::JIT::emitPutToCallFrameHeader):
3036 (JSC::JIT::emitPutImmediateToCallFrameHeader):
3037 (JSC::JIT::emitGetFromCallFrameHeader):
3038 (JSC::JIT::emitPutVirtualRegister):
3039 (JSC::JIT::emitInitRegister):
3040 (JSC::JIT::emitNakedCall):
3041 (JSC::JIT::restoreArgumentReference):
3042 (JSC::JIT::restoreArgumentReferenceForTrampoline):
3043 (JSC::JIT::emitCTICall):
3044 (JSC::JIT::checkStructure):
3045 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
3046 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
3047 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
3048 (JSC::JIT::emitFastArithDeTagImmediate):
3049 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
3050 (JSC::JIT::emitFastArithReTagImmediate):
3051 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
3052 (JSC::JIT::emitFastArithImmToInt):
3053 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
3054 (JSC::JIT::emitFastArithIntToImmNoCheck):
3055 (JSC::JIT::emitTagAsBoolImmediate):
3056 * jit/JITPropertyAccess.cpp:
3057 (JSC::JIT::privateCompilePutByIdTransition):
3059 2008-12-04 Geoffrey Garen <ggaren@apple.com>
3061 Reviewed by Oliver Hunt.
3063 Some refactoring for generateGreedyQuantifier.
3065 SunSpider reports no change (possibly a 0.3% speedup).
3067 * wrec/WRECGenerator.cpp:
3068 (JSC::WREC::Generator::generateGreedyQuantifier): Clarified label
3069 meanings and unified some logic to simplify things.
3071 * wrec/WRECParser.h:
3072 (JSC::WREC::Parser::parseAlternative): Added a version of parseAlternative
3073 that can jump to a Label, instead of a JumpList, upon failure. (Eventually,
3074 when we have a true Label class, this will be redundant.) This makes
3075 things easier for generateGreedyQuantifier, because it can avoid
3076 explicitly linking things.
3078 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
3080 Reviewed by Holger Freyther.
3082 Fix crashes in the Qt build on Linux/i386 with non-executable memory
3083 by enabling TCSystemAlloc and the PROT_EXEC flag for mmap.
3085 * JavaScriptCore.pri: Enable the use of TCSystemAlloc if the JIT is
3087 * wtf/TCSystemAlloc.cpp: Extend the PROT_EXEC permissions to
3090 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
3092 Reviewed by Tor Arne Vestbø.
3094 Enable ENABLE_JIT_OPTIMIZE_CALL, ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
3095 and ENABLE_JIT_OPTIMIZE_ARITHMETIC, as suggested by Niko.
3097 * JavaScriptCore.pri:
3099 2008-12-04 Kent Hansen <khansen@trolltech.com>
3101 Reviewed by Simon Hausmann.
3103 Enable the JSC jit for the Qt build by default for release builds on
3104 linux-g++ and win32-msvc.
3106 * JavaScriptCore.pri:
3108 2008-12-04 Gavin Barraclough <barraclough@apple.com>
3110 Reviewed by Oliver Hunt.
3112 Allow JIT to function without property access repatching and arithmetic optimizations.
3113 Controlled by ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS and ENABLE_JIT_OPTIMIZE_ARITHMETIC switches.
3115 https://bugs.webkit.org/show_bug.cgi?id=22643
3117 * JavaScriptCore.xcodeproj/project.pbxproj:
3119 (JSC::JIT::privateCompileMainPass):
3120 (JSC::JIT::privateCompileSlowCases):
3122 * jit/JITArithmetic.cpp: Copied from jit/JIT.cpp.
3123 (JSC::JIT::compileBinaryArithOp):
3124 (JSC::JIT::compileBinaryArithOpSlowCase):
3125 * jit/JITPropertyAccess.cpp: Copied from jit/JIT.cpp.
3126 (JSC::JIT::compileGetByIdHotPath):
3127 (JSC::JIT::compileGetByIdSlowCase):
3128 (JSC::JIT::compilePutByIdHotPath):
3129 (JSC::JIT::compilePutByIdSlowCase):
3130 (JSC::resizePropertyStorage):
3131 (JSC::transitionWillNeedStorageRealloc):
3132 (JSC::JIT::privateCompilePutByIdTransition):
3133 (JSC::JIT::patchGetByIdSelf):
3134 (JSC::JIT::patchPutByIdReplace):
3135 (JSC::JIT::privateCompilePatchGetArrayLength):
3138 2008-12-03 Geoffrey Garen <ggaren@apple.com>
3140 Reviewed by Oliver Hunt.
3142 Optimized sequences of characters in regular expressions by comparing
3143 two characters at a time.
3145 1-2% speedup on SunSpider, 19-25% speedup on regexp-dna.
3147 * assembler/MacroAssembler.h:
3148 (JSC::MacroAssembler::load32):
3149 (JSC::MacroAssembler::jge32): Filled out a few more macro methods.
3151 * assembler/X86Assembler.h:
3152 (JSC::X86Assembler::movl_mr): Added a verion of movl_mr that operates
3153 without an offset, to allow the macro assembler to optmize for that case.
3156 (JSC::WREC::Generator::compileRegExp): Test the saved value of index
3157 instead of the index register when checking for "end of input." The
3158 index register doesn't increment by 1 in an orderly fashion, so testing
3159 it for == "end of input" is not valid.
3161 Also, jump all the way to "return failure" upon reaching "end of input,"
3162 instead of executing the next alternative. This is more logical, and
3163 it's a slight optimization in the case of an expression with many alternatives.
3165 * wrec/WRECGenerator.cpp:
3166 (JSC::WREC::Generator::generateIncrementIndex): Added support for
3167 jumping to a failure label in the case where the index has reached "end
3170 (JSC::WREC::Generator::generatePatternCharacterSequence):
3171 (JSC::WREC::Generator::generatePatternCharacterPair): This is the
3172 optmization. It's basically like generatePatternCharacter, but it runs two
3173 characters at a time.
3175 (JSC::WREC::Generator::generatePatternCharacter): Changed to use isASCII,
3176 since it's clearer than comparing to a magic hex value.
3178 * wrec/WRECGenerator.h:
3180 2008-12-03 Gavin Barraclough <barraclough@apple.com>
3182 Reviewed by Cameron Zwarich.
3184 Allow JIT to operate without the call-repatching optimization.
3185 Controlled by ENABLE(JIT_OPTIMIZE_CALL), defaults on, disabling
3186 this leads to significant performance regression.
3188 https://bugs.webkit.org/show_bug.cgi?id=22639
3190 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3191 * JavaScriptCore.xcodeproj/project.pbxproj:
3193 (JSC::JIT::privateCompileSlowCases):
3195 * jit/JITCall.cpp: Copied from jit/JIT.cpp.
3196 (JSC::JIT::compileOpCallInitializeCallFrame):
3197 (JSC::JIT::compileOpCallSetupArgs):
3198 (JSC::JIT::compileOpCallEvalSetupArgs):
3199 (JSC::JIT::compileOpConstructSetupArgs):
3200 (JSC::JIT::compileOpCall):
3201 (JSC::JIT::compileOpCallSlowCase):
3203 * jit/JITInlineMethods.h: Copied from jit/JIT.cpp.
3204 (JSC::JIT::checkStructure):
3205 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
3206 (JSC::JIT::emitTagAsBoolImmediate):
3209 2008-12-03 Eric Seidel <eric@webkit.org>
3211 Rubber-stamped by David Hyatt.
3213 Make HAVE_ACCESSIBILITY only define if !defined
3217 2008-12-03 Sam Weinig <sam@webkit.org>
3221 * assembler/X86Assembler.h:
3222 (JSC::X86Assembler::orl_i32r):
3224 2008-12-03 Sam Weinig <sam@webkit.org>
3226 Reviewed by Geoffrey Garen.
3228 Remove shared AssemblerBuffer 1MB buffer and instead give AssemblerBuffer
3229 an 256 byte inline capacity.
3231 1% progression on Sunspider.
3233 * assembler/AssemblerBuffer.h:
3234 (JSC::AssemblerBuffer::AssemblerBuffer):
3235 (JSC::AssemblerBuffer::~AssemblerBuffer):
3236 (JSC::AssemblerBuffer::grow):
3237 * assembler/MacroAssembler.h:
3238 (JSC::MacroAssembler::MacroAssembler):
3239 * assembler/X86Assembler.h:
3240 (JSC::X86Assembler::X86Assembler):
3241 * interpreter/Interpreter.cpp:
3242 (JSC::Interpreter::Interpreter):
3243 * interpreter/Interpreter.h:
3247 (JSC::RegExpNode::emitBytecode):
3248 * runtime/RegExp.cpp:
3249 (JSC::RegExp::RegExp):
3250 (JSC::RegExp::create):
3252 * runtime/RegExpConstructor.cpp:
3253 (JSC::constructRegExp):
3254 * runtime/RegExpPrototype.cpp:
3255 (JSC::regExpProtoFuncCompile):
3256 * runtime/StringPrototype.cpp:
3257 (JSC::stringProtoFuncMatch):
3258 (JSC::stringProtoFuncSearch):
3260 (JSC::WREC::Generator::compileRegExp):
3261 * wrec/WRECGenerator.h:
3262 (JSC::WREC::Generator::Generator):
3263 * wrec/WRECParser.h:
3264 (JSC::WREC::Parser::Parser):
3266 2008-12-03 Geoffrey Garen <ggaren@apple.com>
3268 Reviewed by Oliver Hunt, with help from Gavin Barraclough.
3270 orl_i32r was actually coded as an 8bit OR. So, I renamed orl_i32r to
3271 orl_i8r, changed all orl_i32r clients to use orl_i8r, and then added
3272 a new orl_i32r that actually does a 32bit OR.
3274 (32bit OR is currently unused, but a patch I'm working on uses it.)
3276 * assembler/MacroAssembler.h:
3277 (JSC::MacroAssembler::or32): Updated to choose between 8bit and 32bit OR.
3279 * assembler/X86Assembler.h:
3280 (JSC::X86Assembler::orl_i8r): The old orl_i32r.
3281 (JSC::X86Assembler::orl_i32r): The new orl_i32r.
3284 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
3285 (JSC::JIT::emitTagAsBoolImmediate): Use orl_i8r, since we're ORing 8bit
3288 2008-12-03 Dean Jackson <dino@apple.com>
3290 Reviewed by Dan Bernstein.
3292 Helper functions for turn -> degrees.
3293 https://bugs.webkit.org/show_bug.cgi?id=22497
3299 2008-12-02 Cameron Zwarich <zwarich@apple.com>
3301 Reviewed by Geoff Garen.
3303 Bug 22504: Crashes during code generation occur due to refing of ignoredResult()
3304 <https://bugs.webkit.org/show_bug.cgi?id=22504>
3306 Since ignoredResult() was implemented by casting 1 to a RegisterID*, any
3307 attempt to ref ignoredResult() results in a crash. This will occur in
3308 code generation of a function body where a node emits another node with
3309 the dst that was passed to it, and then refs the returned RegisterID*.
3311 To fix this problem, make ignoredResult() a member function of
3312 BytecodeGenerator that simply returns a pointe to a fixed RegisterID
3313 member of BytecodeGenerator.
3315 * bytecompiler/BytecodeGenerator.h:
3316 (JSC::BytecodeGenerator::ignoredResult):
3317 * bytecompiler/RegisterID.h:
3319 (JSC::NullNode::emitBytecode):
3320 (JSC::BooleanNode::emitBytecode):
3321 (JSC::NumberNode::emitBytecode):
3322 (JSC::StringNode::emitBytecode):
3323 (JSC::RegExpNode::emitBytecode):
3324 (JSC::ThisNode::emitBytecode):
3325 (JSC::ResolveNode::emitBytecode):
3326 (JSC::ObjectLiteralNode::emitBytecode):
3327 (JSC::PostfixResolveNode::emitBytecode):
3328 (JSC::PostfixBracketNode::emitBytecode):
3329 (JSC::PostfixDotNode::emitBytecode):
3330 (JSC::DeleteValueNode::emitBytecode):
3331 (JSC::VoidNode::emitBytecode):
3332 (JSC::TypeOfResolveNode::emitBytecode):
3333 (JSC::TypeOfValueNode::emitBytecode):
3334 (JSC::PrefixResolveNode::emitBytecode):
3335 (JSC::AssignResolveNode::emitBytecode):
3336 (JSC::CommaNode::emitBytecode):
3337 (JSC::ForNode::emitBytecode):
3338 (JSC::ForInNode::emitBytecode):
3339 (JSC::ReturnNode::emitBytecode):
3340 (JSC::ThrowNode::emitBytecode):
3341 (JSC::FunctionBodyNode::emitBytecode):
3342 (JSC::FuncDeclNode::emitBytecode):
3344 2008-12-02 Geoffrey Garen <ggaren@apple.com>
3346 Reviewed by Cameron Zwarich.
3348 Fixed https://bugs.webkit.org/show_bug.cgi?id=22537
3349 REGRESSION (r38745): Assertion failure in jsSubstring() at ge.com
3351 The bug was that index would become greater than length, so our
3352 "end of input" checks, which all check "index == length", would fail.
3354 The solution is to check for end of input before incrementing index,
3355 to ensure that index is always <= length.
3357 As a side benefit, generateJumpIfEndOfInput can now use je instead of
3358 jg, which should be slightly faster.
3361 (JSC::WREC::Generator::compileRegExp):
3362 * wrec/WRECGenerator.cpp:
3363 (JSC::WREC::Generator::generateJumpIfEndOfInput):
3365 2008-12-02 Gavin Barraclough <barraclough@apple.com>
3367 Reviewed by Geoffrey Garen.
3369 Plant shift right immediate instructions, which are awesome.
3370 https://bugs.webkit.org/show_bug.cgi?id=22610
3371 ~5% on the v8-crypto test.
3374 (JSC::JIT::privateCompileMainPass):
3375 (JSC::JIT::privateCompileSlowCases):
3377 2008-12-02 Geoffrey Garen <ggaren@apple.com>
3379 Reviewed by Sam Weinig.
3381 Cleaned up SegmentedVector by abstracting segment access into helper
3384 SunSpider reports no change.
3386 * bytecompiler/SegmentedVector.h:
3387 (JSC::SegmentedVector::SegmentedVector):
3388 (JSC::SegmentedVector::~SegmentedVector):
3389 (JSC::SegmentedVector::size):
3390 (JSC::SegmentedVector::at):
3391 (JSC::SegmentedVector::operator[]):
3392 (JSC::SegmentedVector::last):
3393 (JSC::SegmentedVector::append):
3394 (JSC::SegmentedVector::removeLast):
3395 (JSC::SegmentedVector::grow):
3396 (JSC::SegmentedVector::clear):
3397 (JSC::SegmentedVector::deleteAllSegments):
3398 (JSC::SegmentedVector::segmentFor):
3399 (JSC::SegmentedVector::subscriptFor):
3400 (JSC::SegmentedVector::ensureSegmentsFor):
3401 (JSC::SegmentedVector::ensureSegment):
3403 2008-12-02 Geoffrey Garen <ggaren@apple.com>
3405 Reviewed by Geoffrey Garen. (Patch by Cameron Zwarich <zwarich@apple.com>.)
3407 Fixed https://bugs.webkit.org/show_bug.cgi?id=22482
3408 REGRESSION (r37991): Occasionally see "Scene rendered incorrectly"
3409 message when running the V8 Raytrace benchmark
3411 Rolled out r37991. It didn't properly save xmm0, which is caller-save,
3412 before calling helper functions.
3414 SunSpider and v8 benchmarks show little change -- possibly a .2%
3415 SunSpider regression, possibly a .2% v8 benchmark speedup.
3417 * assembler/X86Assembler.h:
3418 (JSC::X86Assembler::):
3419 * bytecode/CodeBlock.cpp:
3420 (JSC::CodeBlock::dump):
3421 * bytecode/Instruction.h:
3422 (JSC::Instruction::):
3423 * bytecompiler/BytecodeGenerator.cpp:
3424 (JSC::BytecodeGenerator::emitUnaryOp):
3425 * bytecompiler/BytecodeGenerator.h:
3426 (JSC::BytecodeGenerator::emitToJSNumber):
3427 (JSC::BytecodeGenerator::emitTypeOf):
3428 (JSC::BytecodeGenerator::emitGetPropertyNames):
3429 * interpreter/Interpreter.cpp:
3430 (JSC::Interpreter::privateExecute):
3431 * interpreter/Interpreter.h:
3433 (JSC::JIT::privateCompileMainPass):
3434 (JSC::JIT::privateCompileSlowCases):
3437 (JSC::UnaryOpNode::emitBytecode):
3438 (JSC::BinaryOpNode::emitBytecode):
3439 (JSC::EqualNode::emitBytecode):
3440 * parser/ResultType.h:
3441 (JSC::ResultType::isReusable):
3442 (JSC::ResultType::mightBeNumber):
3443 * runtime/JSNumberCell.h:
3445 2008-12-01 Gavin Barraclough <barraclough@apple.com>
3447 Reviewed by Geoffrey Garen.
3449 Remove unused (sampling only, and derivable) argument to JIT::emitCTICall.
3450 https://bugs.webkit.org/show_bug.cgi?id=22587
3453 (JSC::JIT::emitCTICall):
3454 (JSC::JIT::compileOpCall):
3455 (JSC::JIT::emitSlowScriptCheck):
3456 (JSC::JIT::compileBinaryArithOpSlowCase):
3457 (JSC::JIT::privateCompileMainPass):
3458 (JSC::JIT::privateCompileSlowCases):
3459 (JSC::JIT::privateCompile):
3462 2008-12-02 Dimitri Glazkov <dglazkov@chromium.org>
3464 Reviewed by Eric Seidel.
3466 Fix the inheritance chain for JSFunction.
3468 * runtime/JSFunction.cpp:
3469 (JSC::JSFunction::info): Add InternalFunction::info as parent class
3471 2008-12-02 Simon Hausmann <hausmann@webkit.org>
3473 Reviewed by Tor Arne Vestbø.
3475 Fix ability to include JavaScriptCore.pri from other .pro files.
3477 * JavaScriptCore.pri: Moved -O3 setting into the .pro files.
3478 * JavaScriptCore.pro:
3481 2008-12-01 Geoffrey Garen <ggaren@apple.com>
3483 Reviewed by Cameron Zwarich, with help from Gavin Barraclough.
3485 Fixed https://bugs.webkit.org/show_bug.cgi?id=22583.
3487 Refactored regular expression parsing to parse sequences of characters
3488 as a single unit, in preparation for optimizing sequences of characters.
3490 SunSpider reports no change.
3492 * JavaScriptCore.xcodeproj/project.pbxproj:
3493 * wrec/Escapes.h: Added. Set of classes for representing an escaped
3496 * wrec/Quantifier.h:
3497 (JSC::WREC::Quantifier::Quantifier): Simplified this constructor slightly,
3498 to match the new Escape constructor.
3500 * wrec/WRECGenerator.cpp:
3501 (JSC::WREC::Generator::generatePatternCharacterSequence):
3502 * wrec/WRECGenerator.h: Added an interface for generating a sequence
3503 of pattern characters at a time. It doesn't do anything special yet.
3505 * wrec/WRECParser.cpp:
3506 (JSC::WREC::Parser::consumeGreedyQuantifier):
3507 (JSC::WREC::Parser::consumeQuantifier): Renamed "parse" to "consume" in
3508 these functions, to match "consumeEscape."
3510 (JSC::WREC::Parser::parsePatternCharacterSequence): New function for
3511 iteratively aggregating a sequence of characters in a pattern.
3513 (JSC::WREC::Parser::parseCharacterClassQuantifier):
3514 (JSC::WREC::Parser::parseBackreferenceQuantifier): Renamed "parse" to
3515 "consume" in these functions, to match "consumeEscape."
3517 (JSC::WREC::Parser::parseCharacterClass): Refactored to use the common
3518 escape processing code in consumeEscape.
3520 (JSC::WREC::Parser::parseEscape): Refactored to use the common
3521 escape processing code in consumeEscape.
3523 (JSC::WREC::Parser::consumeEscape): Factored escaped token processing
3524 into a common function, since we were doing this in a few places.
3526 (JSC::WREC::Parser::parseTerm): Refactored to use the common
3527 escape processing code in consumeEscape.
3529 * wrec/WRECParser.h:
3530 (JSC::WREC::Parser::consumeOctal): Refactored to use a helper function
3531 for reading a digit.
3533 2008-12-01 Cameron Zwarich <zwarich@apple.com>
3535 Reviewed by Oliver Hunt.
3537 Bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
3538 <https://bugs.webkit.org/show_bug.cgi?id=20340>
3540 SegmentedVector currently frees segments and reallocates them when used
3541 as a stack. This can lead to unsafe use of pointers into freed segments.
3543 In order to fix this problem, SegmentedVector will be changed to only
3544 grow and never shrink. Also, rename the reserveCapacity() member
3545 function to grow() to match the actual usage in BytecodeGenerator, where
3546 this function is used to allocate a group of registers at once, rather
3547 than merely saving space for them.
3549 * bytecompiler/BytecodeGenerator.cpp:
3550 (JSC::BytecodeGenerator::BytecodeGenerator): Use grow() instead of
3552 * bytecompiler/SegmentedVector.h:
3553 (JSC::SegmentedVector::SegmentedVector):
3554 (JSC::SegmentedVector::last):
3555 (JSC::SegmentedVector::append):
3556 (JSC::SegmentedVector::removeLast):
3557 (JSC::SegmentedVector::grow): Renamed from reserveCapacity().
3558 (JSC::SegmentedVector::clear):
3560 2008-12-01 Mark Rowe <mrowe@apple.com>
3562 Rubber-stamped by Anders Carlsson.
3564 Disable WREC for x86_64 since memory allocated by the system allocator is not marked executable,
3565 which causes 64-bit debug builds to crash. Once we have a dedicated allocator for executable
3566 memory we can turn this back on.
3570 2008-12-01 Antti Koivisto <antti@apple.com>
3572 Reviewed by Maciej Stachowiak.
3574 Restore inline buffer after vector is shrunk back below its inline capacity.
3578 (WTF::VectorBuffer::restoreInlineBufferIfNeeded):
3579 (WTF::::shrinkCapacity):
3581 2008-11-30 Antti Koivisto <antti@apple.com>
3583 Reviewed by Mark Rowe.
3585 Try to return free pages in the current thread cache too.
3587 * wtf/FastMalloc.cpp:
3588 (WTF::TCMallocStats::releaseFastMallocFreeMemory):
3590 2008-12-01 David Levin <levin@chromium.org>
3592 Reviewed by Alexey Proskuryakov.
3594 https://bugs.webkit.org/show_bug.cgi?id=22567
3595 Make HashTable work as expected with respect to threads. Specifically, it has class-level
3596 thread safety and constant methods work on constant objects without synchronization.
3598 No observable change in behavior, so no test. This only affects debug builds.
3600 * wtf/HashTable.cpp:
3601 (WTF::hashTableStatsMutex):
3602 (WTF::HashTableStats::~HashTableStats):
3603 (WTF::HashTableStats::recordCollisionAtCount):
3604 Guarded variable access with a mutex.
3608 (WTF::::lookupForWriting):
3609 (WTF::::fullLookupForWriting):
3614 Changed increments of static variables to use atomicIncrement.
3616 (WTF::::invalidateIterators):
3618 (WTF::removeIterator):
3619 Guarded mutable access with a mutex.
3621 2008-11-29 Gavin Barraclough <barraclough@apple.com>
3623 Reviewed by Cameron Zwarich.
3625 Enable WREC on PLATFORM(X86_64). This change predominantly requires changes to the
3626 WREC::Generator::generateEnter method to support the x86-64 ABI, and addition of
3627 support for a limited number of quadword operations in the X86Assembler.
3629 This patch will cause the JS heap to be allocated with RWX permissions on 64-bit Mac
3630 platforms. This is a regression with respect to previous 64-bit behaviour, but is no
3631 more permissive than on 32-bit builds. This issue should be addressed at some point.
3632 (This is tracked by bug #21783.)
3634 https://bugs.webkit.org/show_bug.cgi?id=22554
3635 Greater than 4x speedup on regexp-dna, on x86-64.
3637 * assembler/MacroAssembler.h:
3638 (JSC::MacroAssembler::addPtr):
3639 (JSC::MacroAssembler::loadPtr):
3640 (JSC::MacroAssembler::storePtr):
3641 (JSC::MacroAssembler::pop):
3642 (JSC::MacroAssembler::push):
3643 (JSC::MacroAssembler::move):
3644 * assembler/X86Assembler.h:
3645 (JSC::X86Assembler::):
3646 (JSC::X86Assembler::movq_rr):
3647 (JSC::X86Assembler::addl_i8m):
3648 (JSC::X86Assembler::addl_i32r):
3649 (JSC::X86Assembler::addq_i8r):
3650 (JSC::X86Assembler::addq_i32r):
3651 (JSC::X86Assembler::movq_mr):
3652 (JSC::X86Assembler::movq_rm):
3654 * wrec/WRECGenerator.cpp:
3655 (JSC::WREC::Generator::generateEnter):
3656 (JSC::WREC::Generator::generateReturnSuccess):
3657 (JSC::WREC::Generator::generateReturnFailure):
3659 * wtf/TCSystemAlloc.cpp:
3661 2008-12-01 Cameron Zwarich <zwarich@apple.com>
3663 Reviewed by Sam Weinig.
3665 Preliminary work for bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
3666 <https://bugs.webkit.org/show_bug.cgi?id=20340>
3668 SegmentedVector currently frees segments and reallocates them when used
3669 as a stack. This can lead to unsafe use of pointers into freed segments.
3671 In order to fix this problem, SegmentedVector will be changed to only
3672 grow and never shrink, with the sole exception of clearing all of its
3673 data, a capability that is required by Lexer. This patch changes the
3674 public interface to only allow for these capabilities.
3676 * bytecompiler/BytecodeGenerator.cpp:
3677 (JSC::BytecodeGenerator::BytecodeGenerator): Use reserveCapacity()
3678 instead of resize() for m_globals and m_parameters.
3679 * bytecompiler/SegmentedVector.h:
3680 (JSC::SegmentedVector::resize): Removed.
3681 (JSC::SegmentedVector::reserveCapacity): Added.
3682 (JSC::SegmentedVector::clear): Added.
3683 (JSC::SegmentedVector::shrink): Removed.
3684 (JSC::SegmentedVector::grow): Removed.
3686 (JSC::Lexer::clear): Use clear() instead of resize(0).
3688 2008-11-30 Sam Weinig <sam@webkit.org>
3690 Reviewed by Mark Rowe.
3692 Renames jumps to m_jumps in JumpList.
3694 * assembler/MacroAssembler.h:
3695 (JSC::MacroAssembler::JumpList::link):
3696 (JSC::MacroAssembler::JumpList::linkTo):
3697 (JSC::MacroAssembler::JumpList::append):
3699 2008-11-30 Antti Koivisto <antti@apple.com>
3701 Reviewed by Mark Rowe.
3703 https://bugs.webkit.org/show_bug.cgi?id=22557
3705 Report free size in central and thread caches too.
3707 * wtf/FastMalloc.cpp:
3708 (WTF::TCMallocStats::fastMallocStatistics):
3711 2008-11-29 Antti Koivisto <antti@apple.com>
3713 Reviewed by Dan Bernstein.
3715 https://bugs.webkit.org/show_bug.cgi?id=22557
3716 Add statistics for JavaScript GC heap.
3718 * JavaScriptCore.exp:
3719 * runtime/Collector.cpp:
3720 (JSC::Heap::objectCount):
3721 (JSC::addToStatistics):
3722 (JSC::Heap::statistics):
3723 * runtime/Collector.h:
3725 2008-11-29 Antti Koivisto <antti@apple.com>
3727 Fix debug build by adding a stub method.
3729 * wtf/FastMalloc.cpp:
3730 (WTF::fastMallocStatistics):
3732 2008-11-29 Antti Koivisto <antti@apple.com>
3734 Reviewed by Alexey Proskuryakov.
3736 https://bugs.webkit.org/show_bug.cgi?id=22557
3738 Add function for getting basic statistics from FastMalloc.
3740 * JavaScriptCore.exp:
3741 * wtf/FastMalloc.cpp:
3743 (WTF::TCMalloc_PageHeap::ReturnedBytes):
3744 (WTF::TCMallocStats::fastMallocStatistics):
3747 2008-11-29 Cameron Zwarich <zwarich@apple.com>
3751 The C++ standard does not automatically grant the friendships of an
3752 enclosing class to its nested subclasses, so we should do so explicitly.
3753 This fixes the GCC 4.0 build, although both GCC 4.2 and Visual C++ 2005
3754 accept the incorrect code as it is.
3756 * assembler/MacroAssembler.h:
3758 2008-11-29 Gavin Barraclough <barraclough@apple.com>
3760 Reviewed by Cameron Zwarich.
3762 Add the class MacroAssembler to provide some abstraction of code generation,
3763 and change WREC to make use of this class, rather than directly accessing
3766 This patch also allows WREC to be compiled without the rest of the JIT enabled.
3768 * JavaScriptCore.xcodeproj/project.pbxproj:
3769 * assembler/MacroAssembler.h: Added.
3770 (JSC::MacroAssembler::):
3771 (JSC::MacroAssembler::MacroAssembler):
3772 (JSC::MacroAssembler::copyCode):
3773 (JSC::MacroAssembler::Address::Address):
3774 (JSC::MacroAssembler::ImplicitAddress::ImplicitAddress):
3775 (JSC::MacroAssembler::BaseIndex::BaseIndex):
3776 (JSC::MacroAssembler::Label::Label):
3777 (JSC::MacroAssembler::Jump::Jump):
3778 (JSC::MacroAssembler::Jump::link):
3779 (JSC::MacroAssembler::Jump::linkTo):
3780 (JSC::MacroAssembler::JumpList::link):
3781 (JSC::MacroAssembler::JumpList::linkTo):
3782 (JSC::MacroAssembler::JumpList::append):
3783 (JSC::MacroAssembler::Imm32::Imm32):
3784 (JSC::MacroAssembler::add32):
3785 (JSC::MacroAssembler::or32):
3786 (JSC::MacroAssembler::sub32):
3787 (JSC::MacroAssembler::loadPtr):
3788 (JSC::MacroAssembler::load32):
3789 (JSC::MacroAssembler::load16):
3790 (JSC::MacroAssembler::storePtr):
3791 (JSC::MacroAssembler::store32):
3792 (JSC::MacroAssembler::pop):
3793 (JSC::MacroAssembler::push):
3794 (JSC::MacroAssembler::peek):
3795 (JSC::MacroAssembler::poke):
3796 (JSC::MacroAssembler::move):
3797 (JSC::MacroAssembler::compareImm32ForBranch):
3798 (JSC::MacroAssembler::compareImm32ForBranchEquality):
3799 (JSC::MacroAssembler::jae32):
3800 (JSC::MacroAssembler::je32):
3801 (JSC::MacroAssembler::je16):
3802 (JSC::MacroAssembler::jg32):
3803 (JSC::MacroAssembler::jge32):
3804 (JSC::MacroAssembler::jl32):
3805 (JSC::MacroAssembler::jle32):
3806 (JSC::MacroAssembler::jne32):
3807 (JSC::MacroAssembler::jump):
3808 (JSC::MacroAssembler::breakpoint):
3809 (JSC::MacroAssembler::ret):
3810 * assembler/X86Assembler.h:
3811 (JSC::X86Assembler::cmpw_rm):
3812 * interpreter/Interpreter.cpp:
3813 (JSC::Interpreter::Interpreter):
3814 * interpreter/Interpreter.h:
3815 (JSC::Interpreter::assemblerBuffer):
3816 * runtime/RegExp.cpp:
3817 (JSC::RegExp::RegExp):
3819 (JSC::WREC::Generator::compileRegExp):
3821 * wrec/WRECFunctors.cpp:
3822 (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom):
3823 (JSC::WREC::GenerateCharacterClassFunctor::generateAtom):
3824 (JSC::WREC::GenerateBackreferenceFunctor::generateAtom):
3825 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
3826 * wrec/WRECFunctors.h:
3827 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
3828 * wrec/WRECGenerator.cpp:
3829 (JSC::WREC::Generator::generateEnter):
3830 (JSC::WREC::Generator::generateReturnSuccess):
3831 (JSC::WREC::Generator::generateSaveIndex):
3832 (JSC::WREC::Generator::generateIncrementIndex):
3833 (JSC::WREC::Generator::generateLoadCharacter):
3834 (JSC::WREC::Generator::generateJumpIfEndOfInput):
3835 (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
3836 (JSC::WREC::Generator::generateReturnFailure):
3837 (JSC::WREC::Generator::generateBacktrack1):
3838 (JSC::WREC::Generator::generateBacktrackBackreference):
3839 (JSC::WREC::Generator::generateBackreferenceQuantifier):
3840 (JSC::WREC::Generator::generateNonGreedyQuantifier):
3841 (JSC::WREC::Generator::generateGreedyQuantifier):
3842 (JSC::WREC::Generator::generatePatternCharacter):
3843 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
3844 (JSC::WREC::Generator::generateCharacterClassInverted):
3845 (JSC::WREC::Generator::generateCharacterClass):
3846 (JSC::WREC::Generator::generateParentheses):
3847 (JSC::WREC::Generator::generateParenthesesNonGreedy):
3848 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
3849 (JSC::WREC::Generator::generateAssertionBOL):
3850 (JSC::WREC::Generator::generateAssertionEOL):
3851 (JSC::WREC::Generator::generateAssertionWordBoundary):
3852 (JSC::WREC::Generator::generateBackreference):
3853 (JSC::WREC::Generator::terminateAlternative):
3854 (JSC::WREC::Generator::terminateDisjunction):
3855 * wrec/WRECGenerator.h:
3856 (JSC::WREC::Generator::Generator):
3857 * wrec/WRECParser.cpp:
3858 (JSC::WREC::Parser::parsePatternCharacterQualifier):
3859 (JSC::WREC::Parser::parseCharacterClassQuantifier):
3860 (JSC::WREC::Parser::parseBackreferenceQuantifier):
3861 (JSC::WREC::Parser::parseParentheses):
3862 (JSC::WREC::Parser::parseCharacterClass):
3863 (JSC::WREC::Parser::parseOctalEscape):
3864 (JSC::WREC::Parser::parseEscape):
3865 (JSC::WREC::Parser::parseTerm):
3866 (JSC::WREC::Parser::parseDisjunction):
3867 * wrec/WRECParser.h:
3868 (JSC::WREC::Parser::Parser):
3869 (JSC::WREC::Parser::parsePattern):
3870 (JSC::WREC::Parser::parseAlternative):
3873 2008-11-28 Simon Hausmann <hausmann@webkit.org>
3875 Reviewed by Tor Arne Vestbø.
3877 Fix compilation on Windows CE
3879 Port away from the use of errno after calling strtol(), instead
3880 detect conversion errors by checking the result and the stop
3883 * runtime/DateMath.cpp:
3887 2008-11-28 Joerg Bornemann <joerg.bornemann@trolltech.com>
3889 Reviewed by Simon Hausmann.
3891 Implement lowResUTCTime() on Windows CE using GetSystemTime as _ftime() is not available.
3893 * runtime/DateMath.cpp:
3894 (JSC::lowResUTCTime):
3896 2008-11-28 Simon Hausmann <hausmann@webkit.org>
3898 Rubber-stamped by Tor Arne Vestbø.
3900 Removed unnecessary inclusion of errno.h, which also fixes compilation on Windows CE.
3902 * runtime/JSGlobalObjectFunctions.cpp:
3904 2008-11-27 Cameron Zwarich <zwarich@apple.com>
3908 r38825 made JSFunction::m_body private, but some inspector code in
3909 WebCore sets the field. Add setters for it.
3911 * runtime/JSFunction.h:
3912 (JSC::JSFunction::setBody):
3914 2008-11-27 Sam Weinig <sam@webkit.org>
3916 Reviewed by Cameron Zwarich.
3918 Fix FIXME by adding accessor for JSFunction's m_body property.
3920 * interpreter/Interpreter.cpp:
3921 (JSC::Interpreter::cti_op_call_JSFunction):
3922 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
3923 (JSC::Interpreter::cti_vm_lazyLinkCall):
3924 * profiler/Profiler.cpp:
3925 (JSC::createCallIdentifierFromFunctionImp):
3926 * runtime/Arguments.h:
3927 (JSC::Arguments::getArgumentsData):
3928 (JSC::Arguments::Arguments):
3929 * runtime/FunctionPrototype.cpp:
3930 (JSC::functionProtoFuncToString):
3931 * runtime/JSFunction.h:
3932 (JSC::JSFunction::JSFunction):
3933 (JSC::JSFunction::body):
3935 2008-11-27 Sam Weinig <sam@webkit.org>
3937 Reviewed by Oliver Hunt.
3939 Remove unused member variables from ProgramNode.
3943 2008-11-27 Brent Fulgham <bfulgham@gmail.com>
3945 Reviewed by Alexey Proskuryakov.
3947 Enable mouse panning feaure on Windows Cairo build.
3948 See http://bugs.webkit.org/show_bug.cgi?id=22525
3950 * wtf/Platform.h: Enable mouse panning feaure on Windows Cairo build.
3952 2008-11-27 Alp Toker <alp@nuanti.com>
3954 Change recently introduced C++ comments in Platform.h to C comments to
3955 fix the minidom build with traditional C.
3957 Build GtkLauncher and minidom with the '-ansi' compiler flag to detect
3958 API header breakage at build time.
3963 2008-11-27 Alp Toker <alp@nuanti.com>
3965 Remove C++ comment from JavaScriptCore API headers (introduced r35449).
3966 Fixes build for ANSI C applications using the public API.
3968 * API/WebKitAvailability.h:
3970 2008-11-26 Eric Seidel <eric@webkit.org>
3972 No review, build fix only.
3974 Fix the JSC Chromium Mac build by adding JavaScriptCore/icu into the include path
3976 * JavaScriptCore.scons:
3978 2008-11-25 Cameron Zwarich <zwarich@apple.com>
3980 Reviewed by Maciej Stachowiak.
3982 Remove the unused member function JSFunction::getParameterName().
3984 * runtime/JSFunction.cpp:
3985 * runtime/JSFunction.h:
3987 2008-11-24 Gavin Barraclough <barraclough@apple.com>
3989 Reviewed by Geoff Garen.
3991 Polymorpic caching for get by id chain. Similar to the polymorphic caching already implemented
3992 for self and proto accesses (implemented by allowing multiple trampolines to be JIT genertaed,
3993 and linked together) - the get by id chain caching is implemented as a genericization of the
3994 proto list caching, allowing cached access lists to contain a mix of proto and proto chain
3995 accesses (since in JS style inheritance hierarchies you may commonly see a mix of properties
3996 being overridden on the direct prototype, or higher up its prototype chain).
3998 In order to allow this patch to compile there is a fix to appease gcc 4.2 compiler issues
3999 (removing the jumps between fall-through cases in privateExecute).
4001 This patch also removes redundant immediate checking from the reptach code, and fixes a related
4002 memory leak (failure to deallocate trampolines).
4004 ~2% progression on v8 tests (bulk on the win on deltablue)
4006 * bytecode/Instruction.h:
4007 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::):
4008 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
4009 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
4010 (JSC::PolymorphicAccessStructureList::derefStructures):
4011 * interpreter/Interpreter.cpp:
4012 (JSC::countPrototypeChainEntriesAndCheckForProxies):
4013 (JSC::Interpreter::tryCacheGetByID):
4014 (JSC::Interpreter::privateExecute):
4015 (JSC::Interpreter::tryCTICacheGetByID):
4016 (JSC::Interpreter::cti_op_get_by_id_self_fail):
4017 (JSC::getPolymorphicAccessStructureListSlot):
4018 (JSC::Interpreter::cti_op_get_by_id_proto_list):
4019 * interpreter/Interpreter.h:
4021 (JSC::JIT::privateCompileGetByIdProto):
4022 (JSC::JIT::privateCompileGetByIdSelfList):
4023 (JSC::JIT::privateCompileGetByIdProtoList):
4024 (JSC::JIT::privateCompileGetByIdChainList):
4025 (JSC::JIT::privateCompileGetByIdChain):
4026 (JSC::JIT::privateCompilePatchGetArrayLength):
4028 (JSC::JIT::compileGetByIdChainList):
4030 2008-11-25 Cameron Zwarich <zwarich@apple.com>
4032 Reviewed by Alexey Proskuryakov.
4034 Move the collect() call in Heap::heapAllocate() that is conditionally
4035 compiled under COLLECT_ON_EVERY_ALLOCATION so that it is before we get
4036 information about the heap. This was causing assertion failures for me
4037 while I was reducing a bug.
4039 * runtime/Collector.cpp:
4040 (JSC::Heap::heapAllocate):
4042 2008-11-24 Cameron Zwarich <zwarich@apple.com>
4044 Reviewed by Geoff Garen.
4046 Bug 13790: Function declarations are not treated as statements (used to affect starcraft2.com)
4047 <https://bugs.webkit.org/show_bug.cgi?id=13790>
4049 Modify the parser to treat function declarations as statements,
4050 simplifying the grammar in the process. Technically, according to the
4051 grammar in the ECMA spec, function declarations are not statements and
4052 can not be used everywhere that statements can, but it is not worth the
4053 possibility compatibility issues just to stick to the spec in this case.
4057 (JSC::FuncDeclNode::emitBytecode): Avoid returning ignoredResult()
4058 as a result, because it causes a crash in DoWhileNode::emitBytecode().
4060 2008-11-24 Geoffrey Garen <ggaren@apple.com>
4062 Reviewed by Sam Weinig.
4064 Unroll the regexp matching loop by 1. 10% speedup on simple matching
4065 stress test. No change on SunSpider.
4067 (I decided not to unroll to arbitrary levels because the returns diminsh
4071 (JSC::WREC::compileRegExp):
4072 * wrec/WRECGenerator.cpp:
4073 (JSC::WREC::Generator::generateJumpIfEndOfInput):
4074 (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
4075 * wrec/WRECGenerator.h:
4076 * wrec/WRECParser.h:
4077 (JSC::WREC::Parser::error):
4078 (JSC::WREC::Parser::parsePattern):
4080 2008-11-24 Geoffrey Garen <ggaren@apple.com>
4082 Reviewed by Sam Weinig.
4084 Removed some unnecessary "Generator::" prefixes.
4086 * wrec/WRECGenerator.cpp:
4087 (JSC::WREC::Generator::generateEnter):
4088 (JSC::WREC::Generator::generateReturnSuccess):
4089 (JSC::WREC::Generator::generateSaveIndex):
4090 (JSC::WREC::Generator::generateIncrementIndex):
4091 (JSC::WREC::Generator::generateLoopIfNotEndOfInput):
4092 (JSC::WREC::Generator::generateReturnFailure):
4094 2008-11-24 Geoffrey Garen <ggaren@apple.com>
4096 Reviewed by Sam Weinig.
4098 Made a bunch of WREC::Parser functions private, and added an explicit
4099 "reset()" function, so a parser can be reused.
4101 * wrec/WRECParser.h:
4102 (JSC::WREC::Parser::Parser):
4103 (JSC::WREC::Parser::generator):
4104 (JSC::WREC::Parser::ignoreCase):
4105 (JSC::WREC::Parser::multiline):
4106 (JSC::WREC::Parser::recordSubpattern):
4107 (JSC::WREC::Parser::numSubpatterns):
4108 (JSC::WREC::Parser::parsePattern):
4109 (JSC::WREC::Parser::parseAlternative):
4110 (JSC::WREC::Parser::reset):
4112 2008-11-24 Gavin Barraclough <barraclough@apple.com>
4114 Reviewed by Cameron Zwarich.
4116 Implement repatching for get by id chain.
4117 Previously the access is performed in a function stub, in the repatch form
4118 the trampoline is not called to; instead the hot path is relinked to jump
4119 directly to the trampoline, if it fails it will jump to the slow case.
4121 https://bugs.webkit.org/show_bug.cgi?id=22449
4122 3% progression on deltablue.
4125 (JSC::JIT::privateCompileGetByIdProto):
4126 (JSC::JIT::privateCompileGetByIdChain):
4128 2008-11-24 Joerg Bornemann <joerg.bornemann@trolltech.com>
4130 Reviewed by Simon Hausmann.
4132 https://bugs.webkit.org/show_bug.cgi?id=20746
4134 Various small compilation fixes to make the Qt port of WebKit
4135 compile on Windows CE.
4137 * config.h: Don't set _CRT_RAND_S for CE, it's not available.
4138 * jsc.cpp: Disabled use of debugger includes for CE. It
4139 does not have the debugging functions.
4140 * runtime/DateMath.cpp: Use localtime() on Windows CE.
4141 * wtf/Assertions.cpp: Compile on Windows CE without debugger.
4142 * wtf/Assertions.h: Include windows.h before defining ASSERT.
4143 * wtf/MathExtras.h: Include stdlib.h instead of xmath.h.
4144 * wtf/Platform.h: Disable ERRNO_H and detect endianess based
4145 on the Qt endianess. On Qt for Windows CE the endianess is
4146 defined by the vendor specific build spec.
4147 * wtf/Threading.h: Use the volatile-less atomic functions.
4148 * wtf/dtoa.cpp: Compile without errno.
4149 * wtf/win/MainThreadWin.cpp: Don't include windows.h on CE after
4150 Assertions.h due to the redefinition of ASSERT.
4152 2008-11-22 Gavin Barraclough <barraclough@apple.com>
4154 Reviewed by Cameron Zwarich.
4156 Replace accidentally deleted immediate check from get by id chain trampoline.
4157 https://bugs.webkit.org/show_bug.cgi?id=22413
4160 (JSC::JIT::privateCompileGetByIdChain):
4162 2008-11-21 Gavin Barraclough <barraclough@apple.com>