1 2008-12-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
3 Reviewed by Sam Weinig.
5 Bug 23037: Parsing and reparsing disagree on automatic semicolon insertion
6 <https://bugs.webkit.org/show_bug.cgi?id=23037>
7 <rdar://problem/6467124>
9 Parsing and reparsing disagree about automatic semicolon insertion, so that a
14 is parsed as being syntactically valid but gets a syntax error upon reparsing.
15 This leads to an assertion failure in Parser::reparse(). It is not that big of
16 an issue in practice, because in a Release build such a function will return
17 'undefined' when called.
19 In this case, we are not following the spec and it should be a syntax error.
20 However, unless there is a newline separating the ',' and the '}', WebKit would
21 not treat it as a syntax error in the past either. It would be a bit of work to
22 make the automatic semicolon insertion match the spec exactly, so this patch
23 changes it to match our past behaviour.
25 The problem is that even during reparsing, the Lexer adds a semicolon at the
26 end of the input, which confuses allowAutomaticSemicolon(), because it is
27 expecting either a '}', the end of input, or a terminator like a newline.
30 (JSC::Lexer::Lexer): Initialize m_isReparsing to false.
31 (JSC::Lexer::lex): Do not perform automatic semicolon insertion in the Lexer if
32 we are in the middle of reparsing.
33 (JSC::Lexer::clear): Set m_isReparsing to false.
35 (JSC::Lexer::setIsReparsing): Added.
37 (JSC::Parser::reparse): Call Lexer::setIsReparsing() to notify the Lexer of
40 2008-12-29 Oliver Hunt <oliver@apple.com>
42 Reviewed by NOBODY (Build fix).
44 Yet another attempt to fix Tiger.
46 * wtf/RandomNumber.cpp:
49 2008-12-29 Oliver Hunt <oliver@apple.com>
51 Reviewed by NOBODY (Build fix).
53 Tiger build fix (correct this time)
55 * wtf/RandomNumber.cpp:
57 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
59 Rubber-stamped by Alexey Proskuryakov.
61 Revert r39509, because kjsyydebug is used in the generated code if YYDEBUG is 1.
65 2008-12-29 Oliver Hunt <oliver@apple.com>
67 Reviewed by NOBODY (Build fix).
71 * wtf/RandomNumber.cpp:
73 2008-12-29 Oliver Hunt <oliver@apple.com>
75 Reviewed by Mark Rowe.
77 <rdar://problem/6358108> Insecure randomness in Math.random() leads to user tracking
79 Switch to arc4random on PLATFORM(DARWIN), this is ~1.5x slower than random(), but the
80 it is still so fast that there is no fathomable way it could be a bottleneck for anything.
82 randomNumber is called in two places
83 * During form submission where it is called once per form
84 * Math.random in JSC. For this difference to show up you have to be looping on
85 a cached local copy of random, for a large (>10000) calls.
87 No change in SunSpider.
89 * wtf/RandomNumber.cpp:
91 * wtf/RandomNumberSeed.h:
92 (WTF::initializeRandomNumberGenerator):
94 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
96 Rubber-stamped by Sam Weinig.
98 Remove unused kjsyydebug #define.
102 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
104 Reviewed by Oliver Hunt and Sam Weinig.
106 Bug 23029: REGRESSION (r39337): jsfunfuzz generates identical test files
107 <https://bugs.webkit.org/show_bug.cgi?id=23029>
108 <rdar://problem/6469185>
110 The unification of random number generation in r39337 resulted in random()
111 being initialized on Darwin, but rand() actually being used. Fix this by
112 making randomNumber() use random() instead of rand() on Darwin.
114 * wtf/RandomNumber.cpp:
117 2008-12-29 Sam Weinig <sam@webkit.org>
121 * runtime/Structure.cpp:
123 2008-12-29 Sam Weinig <sam@webkit.org>
125 Reviewed by Oliver Hunt.
127 Patch for https://bugs.webkit.org/show_bug.cgi?id=23026
128 Move the deleted offsets vector into the PropertyMap
130 Saves 3 words per Structure.
132 * runtime/PropertyMapHashTable.h:
133 * runtime/Structure.cpp:
134 (JSC::Structure::addPropertyTransition):
135 (JSC::Structure::changePrototypeTransition):
136 (JSC::Structure::getterSetterTransition):
137 (JSC::Structure::toDictionaryTransition):
138 (JSC::Structure::fromDictionaryTransition):
139 (JSC::Structure::copyPropertyTable):
140 (JSC::Structure::put):
141 (JSC::Structure::remove):
142 (JSC::Structure::rehashPropertyMapHashTable):
143 * runtime/Structure.h:
144 (JSC::Structure::propertyStorageSize):
146 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
148 Reviewed by Oliver Hunt.
150 Change code using m_body.get() as a boolean to take advantage of the
151 implicit conversion of RefPtr to boolean.
153 * runtime/JSFunction.cpp:
154 (JSC::JSFunction::~JSFunction):
156 2008-12-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
158 Reviewed by Oliver Hunt.
160 Bug 22840: REGRESSION (r38349): Gmail doesn't load with profiling enabled
161 <https://bugs.webkit.org/show_bug.cgi?id=22840>
162 <rdar://problem/6468077>
164 * bytecompiler/BytecodeGenerator.cpp:
165 (JSC::BytecodeGenerator::emitNewArray): Add an assertion that the range
166 of registers passed to op_new_array is sequential.
167 (JSC::BytecodeGenerator::emitCall): Correct the relocation of registers
168 when emitting profiler hooks so that registers aren't leaked. Also, add
169 an assertion that the 'this' register is always ref'd (because it is),
170 remove the needless protection of the 'this' register when relocating,
171 and add an assertion that the range of registers passed to op_call for
172 function call arguments is sequential.
173 (JSC::BytecodeGenerator::emitConstruct): Correct the relocation of
174 registers when emitting profiler hooks so that registers aren't leaked.
175 Also, add an assertion that the range of registers passed to op_construct
176 for function call arguments is sequential.
178 2008-12-26 Mark Rowe <mrowe@apple.com>
180 Reviewed by Alexey Proskuryakov.
182 <rdar://problem/6467376> Race condition in WTF::currentThread can lead to a thread using two different identifiers during its lifetime
184 If a newly-created thread calls WTF::currentThread() before WTF::createThread calls establishIdentifierForPthreadHandle
185 then more than one identifier will be used for the same thread. We can avoid this by adding some extra synchronization
186 during thread creation that delays the execution of the thread function until the thread identifier has been set up, and
187 an assertion to catch this problem should it reappear in the future.
189 * wtf/Threading.cpp: Added.
190 (WTF::NewThreadContext::NewThreadContext):
191 (WTF::threadEntryPoint):
192 (WTF::createThread): Add cross-platform createThread function that delays the execution of the thread function until
193 after the thread identifier has been set up.
195 * wtf/ThreadingGtk.cpp:
196 (WTF::establishIdentifierForThread):
197 (WTF::createThreadInternal):
198 * wtf/ThreadingNone.cpp:
199 (WTF::createThreadInternal):
200 * wtf/ThreadingPthreads.cpp:
201 (WTF::establishIdentifierForPthreadHandle):
202 (WTF::createThreadInternal):
203 * wtf/ThreadingQt.cpp:
204 (WTF::identifierByQthreadHandle):
205 (WTF::establishIdentifierForThread):
206 (WTF::createThreadInternal):
207 * wtf/ThreadingWin.cpp:
208 (WTF::storeThreadHandleByIdentifier):
209 (WTF::createThreadInternal):
211 Add Threading.cpp to the build.
214 * JavaScriptCore.pri:
215 * JavaScriptCore.scons:
216 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
217 * JavaScriptCore.xcodeproj/project.pbxproj:
218 * JavaScriptCoreSources.bkl:
220 2008-12-26 Sam Weinig <sam@webkit.org>
222 Reviewed by Alexey Proskuryakov.
224 Remove unused method.
226 * runtime/Structure.h: Remove mutableTypeInfo.
228 2008-12-22 Gavin Barraclough <barraclough@apple.com>
230 Reviewed by Oliver Hunt.
232 Fix rounding / bounds / signed comparison bug in ExecutableAllocator.
234 ExecutableAllocator::alloc assumed that m_freePtr would be aligned. This was
235 not always true, since the first allocation from an additional pool would not
236 be rounded up. Subsequent allocations would be unaligned, and too much memory
237 could be erroneously allocated from the pool, when the size requested was
238 available, but the size rounded up to word granularity was not available in the
239 pool. This may result in the value of m_freePtr being greater than m_end.
241 Under these circumstances, the unsigned check for space will always pass,
242 resulting in pointers to memory outside of the arena being returned, and
243 ultimately segfaulty goodness when attempting to memcpy the hot freshly jitted
244 code from the AssemblerBuffer.
246 https://bugs.webkit.org/show_bug.cgi?id=22974
247 ... and probably many, many more.
249 * jit/ExecutableAllocator.h:
250 (JSC::ExecutablePool::alloc):
251 (JSC::ExecutablePool::roundUpAllocationSize):
252 (JSC::ExecutablePool::ExecutablePool):
253 (JSC::ExecutablePool::poolAllocate):
255 2008-12-22 Sam Weinig <sam@webkit.org>
257 Reviewed by Gavin Barraclough.
259 Rename all uses of the term "repatch" to "patch".
261 * assembler/MacroAssembler.h:
262 (JSC::MacroAssembler::DataLabelPtr::patch):
263 (JSC::MacroAssembler::DataLabel32::patch):
264 (JSC::MacroAssembler::Jump::patch):
265 (JSC::MacroAssembler::PatchBuffer::PatchBuffer):
266 (JSC::MacroAssembler::PatchBuffer::setPtr):
267 (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
268 (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
269 (JSC::MacroAssembler::storePtrWithPatch):
270 (JSC::MacroAssembler::jnePtrWithPatch):
271 * assembler/X86Assembler.h:
272 (JSC::X86Assembler::patchAddress):
273 (JSC::X86Assembler::patchImmediate):
274 (JSC::X86Assembler::patchPointer):
275 (JSC::X86Assembler::patchBranchOffset):
276 * interpreter/Interpreter.cpp:
277 (JSC::Interpreter::tryCTICachePutByID):
278 (JSC::Interpreter::tryCTICacheGetByID):
279 (JSC::Interpreter::cti_op_put_by_id):
280 (JSC::Interpreter::cti_op_get_by_id):
281 (JSC::Interpreter::cti_op_get_by_id_self_fail):
282 (JSC::Interpreter::cti_op_get_by_id_proto_list):
283 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
285 (JSC::ctiPatchCallByReturnAddress):
286 (JSC::JIT::privateCompileMainPass):
287 (JSC::JIT::privateCompile):
288 (JSC::JIT::privateCompileCTIMachineTrampolines):
291 (JSC::JIT::unlinkCall):
292 (JSC::JIT::linkCall):
293 (JSC::JIT::compileOpCall):
294 * jit/JITPropertyAccess.cpp:
295 (JSC::JIT::compileGetByIdHotPath):
296 (JSC::JIT::compilePutByIdHotPath):
297 (JSC::JIT::compileGetByIdSlowCase):
298 (JSC::JIT::compilePutByIdSlowCase):
299 (JSC::JIT::privateCompilePutByIdTransition):
300 (JSC::JIT::patchGetByIdSelf):
301 (JSC::JIT::patchPutByIdReplace):
302 (JSC::JIT::privateCompilePatchGetArrayLength):
303 (JSC::JIT::privateCompileGetByIdSelf):
304 (JSC::JIT::privateCompileGetByIdProto):
305 (JSC::JIT::privateCompileGetByIdSelfList):
306 (JSC::JIT::privateCompileGetByIdProtoList):
307 (JSC::JIT::privateCompileGetByIdChainList):
308 (JSC::JIT::privateCompileGetByIdChain):
309 (JSC::JIT::privateCompilePutByIdReplace):
311 2008-12-22 Adam Roben <aroben@apple.com>
313 Build fix after r39428
316 (JSC::JIT::compileOpCallSlowCase): Added a missing MacroAssembler::
318 2008-12-22 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
320 Rubber-stamped by George Staikos.
322 Unify all TorchMobile copyright lines. Consolidate in a single line, as requested by Mark Rowe, some time ago.
324 * wtf/RandomNumber.cpp:
325 * wtf/RandomNumber.h:
326 * wtf/RandomNumberSeed.h:
328 2008-12-21 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
330 Rubber-stamped by George Staikos.
332 Fix copyright of the new RandomNumber* files.
334 * wtf/RandomNumber.cpp:
335 * wtf/RandomNumber.h:
336 * wtf/RandomNumberSeed.h:
338 2008-12-21 Gavin Barraclough <barraclough@apple.com>
340 Reviewed by Oliver Hunt & Cameron Zwarich.
342 Add support for call and property access repatching on x86-64.
344 No change in performance on current configurations (2x impovement on v8-tests with JIT enabled on x86-64).
346 * assembler/MacroAssembler.h:
347 (JSC::MacroAssembler::DataLabelPtr::repatch):
348 (JSC::MacroAssembler::DataLabelPtr::operator X86Assembler::JmpDst):
349 (JSC::MacroAssembler::DataLabel32::repatch):
350 (JSC::MacroAssembler::RepatchBuffer::addressOf):
351 (JSC::MacroAssembler::add32):
352 (JSC::MacroAssembler::sub32):
353 (JSC::MacroAssembler::loadPtrWithAddressOffsetRepatch):
354 (JSC::MacroAssembler::storePtrWithAddressOffsetRepatch):
355 (JSC::MacroAssembler::jePtr):
356 (JSC::MacroAssembler::jnePtr):
357 (JSC::MacroAssembler::jnePtrWithRepatch):
358 (JSC::MacroAssembler::differenceBetween):
359 * assembler/X86Assembler.h:
360 (JSC::X86Assembler::addl_im):
361 (JSC::X86Assembler::subl_im):
362 (JSC::X86Assembler::cmpl_rm):
363 (JSC::X86Assembler::movq_rm_disp32):
364 (JSC::X86Assembler::movq_mr_disp32):
365 (JSC::X86Assembler::repatchPointer):
366 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp32):
368 (JSC::JIT::privateCompile):
369 (JSC::JIT::privateCompileCTIMachineTrampolines):
372 (JSC::JIT::unlinkCall):
373 (JSC::JIT::linkCall):
374 (JSC::JIT::compileOpCall):
375 (JSC::JIT::compileOpCallSlowCase):
376 * jit/JITInlineMethods.h:
377 (JSC::JIT::restoreArgumentReferenceForTrampoline):
378 * jit/JITPropertyAccess.cpp:
379 (JSC::JIT::compileGetByIdHotPath):
380 (JSC::JIT::compileGetByIdSlowCase):
381 (JSC::JIT::compilePutByIdHotPath):
382 (JSC::JIT::compilePutByIdSlowCase):
383 (JSC::resizePropertyStorage):
384 (JSC::JIT::privateCompilePutByIdTransition):
385 (JSC::JIT::privateCompileGetByIdProto):
386 (JSC::JIT::privateCompileGetByIdProtoList):
387 (JSC::JIT::privateCompileGetByIdChainList):
388 (JSC::JIT::privateCompileGetByIdChain):
391 2008-12-20 Gavin Barraclough <barraclough@apple.com>
393 Reviewed by Oliver Hunt.
395 Port optimized property access generation to the MacroAssembler.
397 * assembler/MacroAssembler.h:
398 (JSC::MacroAssembler::AbsoluteAddress::AbsoluteAddress):
399 (JSC::MacroAssembler::DataLabelPtr::repatch):
400 (JSC::MacroAssembler::DataLabel32::DataLabel32):
401 (JSC::MacroAssembler::DataLabel32::repatch):
402 (JSC::MacroAssembler::Label::operator X86Assembler::JmpDst):
403 (JSC::MacroAssembler::Jump::repatch):
404 (JSC::MacroAssembler::JumpList::empty):
405 (JSC::MacroAssembler::RepatchBuffer::link):
406 (JSC::MacroAssembler::add32):
407 (JSC::MacroAssembler::and32):
408 (JSC::MacroAssembler::sub32):
409 (JSC::MacroAssembler::loadPtrWithAddressRepatch):
410 (JSC::MacroAssembler::storePtrWithAddressRepatch):
411 (JSC::MacroAssembler::push):
412 (JSC::MacroAssembler::ja32):
413 (JSC::MacroAssembler::jePtr):
414 (JSC::MacroAssembler::jnePtr):
415 (JSC::MacroAssembler::jnePtrWithRepatch):
416 (JSC::MacroAssembler::align):
417 (JSC::MacroAssembler::differenceBetween):
418 * assembler/X86Assembler.h:
419 (JSC::X86Assembler::movl_rm_disp32):
420 (JSC::X86Assembler::movl_mr_disp32):
421 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp32):
422 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
424 (JSC::ctiRepatchCallByReturnAddress):
425 (JSC::JIT::privateCompileMainPass):
426 (JSC::JIT::privateCompile):
427 (JSC::JIT::privateCompileCTIMachineTrampolines):
429 * jit/JITPropertyAccess.cpp:
430 (JSC::JIT::compileGetByIdHotPath):
431 (JSC::JIT::compileGetByIdSlowCase):
432 (JSC::JIT::compilePutByIdHotPath):
433 (JSC::JIT::compilePutByIdSlowCase):
434 (JSC::resizePropertyStorage):
435 (JSC::JIT::privateCompilePutByIdTransition):
436 (JSC::JIT::patchGetByIdSelf):
437 (JSC::JIT::patchPutByIdReplace):
438 (JSC::JIT::privateCompilePatchGetArrayLength):
439 (JSC::JIT::privateCompileGetByIdSelf):
440 (JSC::JIT::privateCompileGetByIdProto):
441 (JSC::JIT::privateCompileGetByIdSelfList):
442 (JSC::JIT::privateCompileGetByIdProtoList):
443 (JSC::JIT::privateCompileGetByIdChainList):
444 (JSC::JIT::privateCompileGetByIdChain):
445 (JSC::JIT::privateCompilePutByIdReplace):
447 (WTF::RefCountedBase::addressOfCount):
449 2008-12-19 Gustavo Noronha Silva <gns@gnome.org>
451 Reviewed by Holger Freyther.
453 https://bugs.webkit.org/show_bug.cgi?id=22686
455 Added file which was missing to the javascriptcore_sources
456 variable, so that it shows up in the tarball created by `make
461 2008-12-19 Holger Hans Peter Freyther <zecke@selfish.org>
463 Reviewed by Antti Koivisto.
465 Build fix when building JS API tests with a c89 c compiler
467 Do not use C++ style comments and convert them to C comments.
471 2008-12-18 Gavin Barraclough <barraclough@apple.com>
473 Reviewed by Sam Weinig.
475 Same as last revision, adding cases for pre & post inc & dec.
477 https://bugs.webkit.org/show_bug.cgi?id=22928
480 (JSC::JIT::privateCompileMainPass):
482 2008-12-18 Gavin Barraclough <barraclough@apple.com>
484 Reviewed by Sam Weinig.
486 Fixes for the JIT's handling of JSImmediate values on x86-64.
487 On 64-bit systems, the code in JSImmediate.h relies on the upper
488 bits of a JSImmediate being a sign extension of the low 32-bits.
489 This was not being enforced by the JIT, since a number of inline
490 operations were being performed on 32-bit values in registers, and
491 when a 32-bit result is written to a register on x86-64 the value
492 is zero-extended to 64-bits.
494 This fix honors previous behavoir. A better fix in the long run
495 (when the JIT is enabled by default) may be to change JSImmediate.h
496 so it no longer relies on the upper bits of the pointer,... though
497 if we're going to change JSImmediate.h for 64-bit, we probably may
498 as well change the format so that the full range of 32-bit ints can
499 be stored, rather than just 31-bits.
501 https://bugs.webkit.org/show_bug.cgi?id=22925
503 * assembler/MacroAssembler.h:
504 (JSC::MacroAssembler::addPtr):
505 (JSC::MacroAssembler::andPtr):
506 (JSC::MacroAssembler::orPtr):
507 (JSC::MacroAssembler::or32):
508 (JSC::MacroAssembler::xor32):
509 (JSC::MacroAssembler::xorPtr):
510 (JSC::MacroAssembler::signExtend32ToPtr):
511 * assembler/X86Assembler.h:
512 (JSC::X86Assembler::):
513 (JSC::X86Assembler::andq_rr):
514 (JSC::X86Assembler::andq_ir):
515 (JSC::X86Assembler::orq_rr):
516 (JSC::X86Assembler::xorq_ir):
517 (JSC::X86Assembler::movsxd_rr):
519 (JSC::JIT::privateCompileMainPass):
520 * jit/JITInlineMethods.h:
521 (JSC::JIT::emitFastArithReTagImmediate):
522 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
523 (JSC::JIT::emitFastArithImmToInt):
525 2008-12-18 Gavin Barraclough <barraclough@apple.com>
527 Reviewed by Sam Weinig.
529 Just a tidy up - rename & refactor some the #defines configuring the JIT.
531 * interpreter/Interpreter.cpp:
532 (JSC::Interpreter::cti_op_convert_this):
533 (JSC::Interpreter::cti_op_end):
534 (JSC::Interpreter::cti_op_add):
535 (JSC::Interpreter::cti_op_pre_inc):
536 (JSC::Interpreter::cti_timeout_check):
537 (JSC::Interpreter::cti_register_file_check):
538 (JSC::Interpreter::cti_op_loop_if_less):
539 (JSC::Interpreter::cti_op_loop_if_lesseq):
540 (JSC::Interpreter::cti_op_new_object):
541 (JSC::Interpreter::cti_op_put_by_id_generic):
542 (JSC::Interpreter::cti_op_get_by_id_generic):
543 (JSC::Interpreter::cti_op_put_by_id):
544 (JSC::Interpreter::cti_op_put_by_id_second):
545 (JSC::Interpreter::cti_op_put_by_id_fail):
546 (JSC::Interpreter::cti_op_get_by_id):
547 (JSC::Interpreter::cti_op_get_by_id_second):
548 (JSC::Interpreter::cti_op_get_by_id_self_fail):
549 (JSC::Interpreter::cti_op_get_by_id_proto_list):
550 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
551 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
552 (JSC::Interpreter::cti_op_get_by_id_array_fail):
553 (JSC::Interpreter::cti_op_get_by_id_string_fail):
554 (JSC::Interpreter::cti_op_instanceof):
555 (JSC::Interpreter::cti_op_del_by_id):
556 (JSC::Interpreter::cti_op_mul):
557 (JSC::Interpreter::cti_op_new_func):
558 (JSC::Interpreter::cti_op_call_JSFunction):
559 (JSC::Interpreter::cti_op_call_arityCheck):
560 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
561 (JSC::Interpreter::cti_vm_lazyLinkCall):
562 (JSC::Interpreter::cti_op_push_activation):
563 (JSC::Interpreter::cti_op_call_NotJSFunction):
564 (JSC::Interpreter::cti_op_create_arguments):
565 (JSC::Interpreter::cti_op_create_arguments_no_params):
566 (JSC::Interpreter::cti_op_tear_off_activation):
567 (JSC::Interpreter::cti_op_tear_off_arguments):
568 (JSC::Interpreter::cti_op_profile_will_call):
569 (JSC::Interpreter::cti_op_profile_did_call):
570 (JSC::Interpreter::cti_op_ret_scopeChain):
571 (JSC::Interpreter::cti_op_new_array):
572 (JSC::Interpreter::cti_op_resolve):
573 (JSC::Interpreter::cti_op_construct_JSConstruct):
574 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
575 (JSC::Interpreter::cti_op_get_by_val):
576 (JSC::Interpreter::cti_op_resolve_func):
577 (JSC::Interpreter::cti_op_sub):
578 (JSC::Interpreter::cti_op_put_by_val):
579 (JSC::Interpreter::cti_op_put_by_val_array):
580 (JSC::Interpreter::cti_op_lesseq):
581 (JSC::Interpreter::cti_op_loop_if_true):
582 (JSC::Interpreter::cti_op_negate):
583 (JSC::Interpreter::cti_op_resolve_base):
584 (JSC::Interpreter::cti_op_resolve_skip):
585 (JSC::Interpreter::cti_op_resolve_global):
586 (JSC::Interpreter::cti_op_div):
587 (JSC::Interpreter::cti_op_pre_dec):
588 (JSC::Interpreter::cti_op_jless):
589 (JSC::Interpreter::cti_op_not):
590 (JSC::Interpreter::cti_op_jtrue):
591 (JSC::Interpreter::cti_op_post_inc):
592 (JSC::Interpreter::cti_op_eq):
593 (JSC::Interpreter::cti_op_lshift):
594 (JSC::Interpreter::cti_op_bitand):
595 (JSC::Interpreter::cti_op_rshift):
596 (JSC::Interpreter::cti_op_bitnot):
597 (JSC::Interpreter::cti_op_resolve_with_base):
598 (JSC::Interpreter::cti_op_new_func_exp):
599 (JSC::Interpreter::cti_op_mod):
600 (JSC::Interpreter::cti_op_less):
601 (JSC::Interpreter::cti_op_neq):
602 (JSC::Interpreter::cti_op_post_dec):
603 (JSC::Interpreter::cti_op_urshift):
604 (JSC::Interpreter::cti_op_bitxor):
605 (JSC::Interpreter::cti_op_new_regexp):
606 (JSC::Interpreter::cti_op_bitor):
607 (JSC::Interpreter::cti_op_call_eval):
608 (JSC::Interpreter::cti_op_throw):
609 (JSC::Interpreter::cti_op_get_pnames):
610 (JSC::Interpreter::cti_op_next_pname):
611 (JSC::Interpreter::cti_op_push_scope):
612 (JSC::Interpreter::cti_op_pop_scope):
613 (JSC::Interpreter::cti_op_typeof):
614 (JSC::Interpreter::cti_op_is_undefined):
615 (JSC::Interpreter::cti_op_is_boolean):
616 (JSC::Interpreter::cti_op_is_number):
617 (JSC::Interpreter::cti_op_is_string):
618 (JSC::Interpreter::cti_op_is_object):
619 (JSC::Interpreter::cti_op_is_function):
620 (JSC::Interpreter::cti_op_stricteq):
621 (JSC::Interpreter::cti_op_nstricteq):
622 (JSC::Interpreter::cti_op_to_jsnumber):
623 (JSC::Interpreter::cti_op_in):
624 (JSC::Interpreter::cti_op_push_new_scope):
625 (JSC::Interpreter::cti_op_jmp_scopes):
626 (JSC::Interpreter::cti_op_put_by_index):
627 (JSC::Interpreter::cti_op_switch_imm):
628 (JSC::Interpreter::cti_op_switch_char):
629 (JSC::Interpreter::cti_op_switch_string):
630 (JSC::Interpreter::cti_op_del_by_val):
631 (JSC::Interpreter::cti_op_put_getter):
632 (JSC::Interpreter::cti_op_put_setter):
633 (JSC::Interpreter::cti_op_new_error):
634 (JSC::Interpreter::cti_op_debug):
635 (JSC::Interpreter::cti_vm_throw):
636 * interpreter/Interpreter.h:
639 (JSC::JIT::privateCompileMainPass):
640 (JSC::JIT::privateCompile):
642 * jit/JITInlineMethods.h:
643 (JSC::JIT::restoreArgumentReference):
644 (JSC::JIT::restoreArgumentReferenceForTrampoline):
647 2008-12-18 Cameron Zwarich <zwarich@apple.com>
649 Reviewed by Geoff Garen.
651 Bug 21855: REGRESSION (r37323): Gmail complains about popup blocking when opening a link
652 <https://bugs.webkit.org/show_bug.cgi?id=21855>
653 <rdar://problem/6278244>
655 Move DynamicGlobalObjectScope to JSGlobalObject.h so that it can be used
658 * interpreter/Interpreter.cpp:
659 * runtime/JSGlobalObject.h:
660 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
661 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
663 2008-12-17 Geoffrey Garen <ggaren@apple.com>
665 Reviewed by Gavin Barraclough.
667 Fixed https://bugs.webkit.org/show_bug.cgi?id=22393
668 Segfault when caching property accesses to primitive cells.
670 Changed some asObject casts to asCell casts in cases where a primitive
671 value may be a cell and not an object.
673 Re-enabled property caching for primitives in cases where it had been
674 disabled because of this bug.
676 Updated a comment to better explain something Darin thought needed
677 explaining in an old patch review.
679 * interpreter/Interpreter.cpp:
680 (JSC::countPrototypeChainEntriesAndCheckForProxies):
681 (JSC::Interpreter::tryCacheGetByID):
682 (JSC::Interpreter::tryCTICacheGetByID):
683 (JSC::Interpreter::cti_op_get_by_id_self_fail):
684 (JSC::Interpreter::cti_op_get_by_id_proto_list):
686 2008-12-17 Gavin Barraclough <barraclough@apple.com>
688 Reviewed by Cameron Zwarich.
690 Fixes for Sunspider failures with the JIT enabled on x86-64.
692 * assembler/MacroAssembler.h:
693 Switch the order of the RegisterID & Address form of je32, to keep it consistent with jne32.
696 * jit/JITInlineMethods.h:
697 Port the m_ctiVirtualCall tramopline generation to use the MacroAssembler interface.
699 Fix bug in the non-optimizing code path, vptr check should have been to the memory address pointer
700 to by the register, not to the register itself.
701 * wrec/WRECGenerator.cpp:
702 See assembler/MacroAssembler.h, above.
704 2008-12-17 Gavin Barraclough <barraclough@apple.com>
706 Reviewed by Sam Weinig.
708 print("Hello, 64-bit jitted world!");
709 Get hello-world working through the JIT, on x86-64.
711 * assembler/X86Assembler.h:
712 Fix encoding of opcode + RegisterID format instructions for 64-bit.
713 * interpreter/Interpreter.cpp:
714 * interpreter/Interpreter.h:
715 Make VoidPtrPair actually be a pair of void*s.
716 (Possibly should make this change for 32-bit Mac platforms, too - but won't change 32-bit behaviour in this patch).
719 Provide names for the timeoutCheckRegister & callFrameRegister on x86-64,
720 force x86-64 ctiTrampoline arguments onto the stack,
721 implement the asm trampolines for x86-64,
722 implement the restoreArgumentReference methods for x86-64 calling conventions.
724 * jit/JITInlineMethods.h:
726 Add switch settings to ENABLE(JIT), on PLATFORM(X86_64) (currently still disabled).
728 2008-12-17 Sam Weinig <sam@webkit.org>
730 Reviewed by Gavin Barraclough.
732 Add more CodeBlock statistics.
734 * bytecode/CodeBlock.cpp:
735 (JSC::CodeBlock::dumpStatistics):
737 2008-12-17 Sam Weinig <sam@webkit.org>
739 Reviewed by Darin Adler.
741 Fix for https://bugs.webkit.org/show_bug.cgi?id=22897
742 <rdar://problem/6428342>
743 Look into feasibility of discarding bytecode after native codegen
745 Clear the bytecode Instruction vector at the end JIT generation.
747 Saves 4.8 MB on Membuster head.
749 * bytecode/CodeBlock.cpp:
750 (JSC::CodeBlock::dump): Add logging for the case that someone tries
751 to dump the instructions of a CodeBlock that has had its bytecode
753 (JSC::CodeBlock::CodeBlock): Initialize the instructionCount
754 (JSC::CodeBlock::handlerForBytecodeOffset): Use instructionCount instead
755 of the size of the instruction vector in the assertion.
756 (JSC::CodeBlock::lineNumberForBytecodeOffset): Ditto.
757 (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
758 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
759 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Ditto.
760 * bytecode/CodeBlock.h:
761 (JSC::CodeBlock::setInstructionCount): Store the instruction vector size
762 in debug builds for assertions.
763 * bytecompiler/BytecodeGenerator.cpp:
764 (JSC::BytecodeGenerator::generate):
766 (JSC::JIT::privateCompile): Clear the bytecode vector unless we
767 have compiled with Opcode sampling where we will continue to require it
769 2008-12-17 Cary Clark <caryclark@google.com>
771 Reviewed by Darin Adler.
772 Landed by Adam Barth.
774 Add ENABLE_TEXT_CARET to permit the ANDROID platform
775 to invalidate and draw the caret in a separate thread.
778 Default ENABLE_TEXT_CARET to 1.
780 2008-12-17 Alexey Proskuryakov <ap@webkit.org>
782 Reviewed by Darin Adler.
784 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard, take two.
786 * API/JSContextRef.cpp: The previous patch that claimed to do this was making Tiger and
787 Leopard always use unique context group instead.
789 2008-12-16 Sam Weinig <sam@webkit.org>
791 Reviewed by Geoffrey Garen.
793 Fix for https://bugs.webkit.org/show_bug.cgi?id=22838
794 Remove dependency on the bytecode Instruction buffer in Interpreter::throwException
795 Part of <rdar://problem/6428342>
797 * bytecode/CodeBlock.cpp:
798 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Added. Function to get
799 a function Register index in a callFrame for a bytecode offset.
800 (JSC::CodeBlock::shrinkToFit): Shrink m_getByIdExceptionInfo and m_functionRegisterInfos.
801 * bytecode/CodeBlock.h:
802 (JSC::FunctionRegisterInfo::FunctionRegisterInfo): Added.
803 (JSC::CodeBlock::addFunctionRegisterInfo):
804 * bytecompiler/BytecodeGenerator.cpp:
805 (JSC::BytecodeGenerator::emitCall):
806 * interpreter/Interpreter.cpp:
807 (JSC::Interpreter::throwException): Use functionRegisterForBytecodeOffset in JIT
810 2008-12-16 Sam Weinig <sam@webkit.org>
812 Reviewed by Gavin Barraclough.
814 Fix for https://bugs.webkit.org/show_bug.cgi?id=22837
815 Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction
816 Part of <rdar://problem/6428342>
818 * interpreter/CallFrame.h: Added comment regarding returnPC storing a void*.
819 * interpreter/Interpreter.cpp:
820 (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC
821 being in the instruction stream for JIT, so we can remove the check.
822 (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS
823 as the call frame returnPC as it is only necessary for looking up when
824 throwing an exception.
825 * interpreter/RegisterFile.h:
826 (JSC::RegisterFile::): Added comment regarding returnPC storing a void*.
827 * jit/JIT.h: Remove ARG_instr4.
829 (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer.
831 2008-12-16 Darin Adler <darin@apple.com>
833 Reviewed and landed by Cameron Zwarich.
835 Preparatory work for fixing
837 Bug 22887: Make UString::Rep use RefCounted rather than implementing its own ref counting
838 <https://bugs.webkit.org/show_bug.cgi?id=22887>
840 Change the various string translators used by Identifier:add() so that
841 they never zero the ref count of a newly created UString::Rep.
843 * runtime/Identifier.cpp:
844 (JSC::CStringTranslator::translate):
845 (JSC::Identifier::add):
846 (JSC::UCharBufferTranslator::translate):
848 2008-12-16 Gavin Barraclough <barraclough@apple.com>
852 * assembler/AssemblerBuffer.h:
854 2008-12-16 Gavin Barraclough <barraclough@apple.com>
856 Reviewed by Cameron Zwarich.
858 Make the JIT compile on x86-64.
859 This largely involves populting the missing calls in MacroAssembler.h.
860 In addition some reinterpret_casts need removing from the JIT, and the
861 repatching property access code will need to be fully compiled out for
862 now. The changes in interpret.cpp are to reorder the functions so that
863 the _generic forms come before all other property access methods, and
864 then to place all property access methods other than the generic forms
865 under control of the ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS macro.
867 No performance impact.
869 * assembler/AssemblerBuffer.h:
870 (JSC::AssemblerBuffer::putInt64Unchecked):
871 * assembler/MacroAssembler.h:
872 (JSC::MacroAssembler::loadPtr):
873 (JSC::MacroAssembler::load32):
874 (JSC::MacroAssembler::storePtr):
875 (JSC::MacroAssembler::storePtrWithRepatch):
876 (JSC::MacroAssembler::store32):
877 (JSC::MacroAssembler::poke):
878 (JSC::MacroAssembler::move):
879 (JSC::MacroAssembler::testImm64):
880 (JSC::MacroAssembler::jePtr):
881 (JSC::MacroAssembler::jnePtr):
882 (JSC::MacroAssembler::jnzPtr):
883 (JSC::MacroAssembler::jzPtr):
884 * assembler/X86Assembler.h:
885 (JSC::X86Assembler::):
886 (JSC::X86Assembler::cmpq_rr):
887 (JSC::X86Assembler::cmpq_rm):
888 (JSC::X86Assembler::cmpq_im):
889 (JSC::X86Assembler::testq_i32m):
890 (JSC::X86Assembler::movl_mEAX):
891 (JSC::X86Assembler::movl_i32r):
892 (JSC::X86Assembler::movl_EAXm):
893 (JSC::X86Assembler::movq_rm):
894 (JSC::X86Assembler::movq_mEAX):
895 (JSC::X86Assembler::movq_mr):
896 (JSC::X86Assembler::movq_i64r):
897 (JSC::X86Assembler::movl_mr):
898 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64):
899 (JSC::X86Assembler::X86InstructionFormatter::immediate64):
900 * interpreter/Interpreter.cpp:
901 (JSC::Interpreter::cti_op_put_by_id_generic):
902 (JSC::Interpreter::cti_op_get_by_id_generic):
903 (JSC::Interpreter::cti_op_put_by_id):
904 (JSC::Interpreter::cti_op_put_by_id_second):
906 (JSC::JIT::privateCompileMainPass):
907 (JSC::JIT::privateCompile):
908 (JSC::JIT::privateCompileCTIMachineTrampolines):
910 (JSC::JIT::compileOpCallSetupArgs):
911 (JSC::JIT::compileOpCall):
912 * jit/JITPropertyAccess.cpp:
913 (JSC::JIT::compileGetByIdHotPath):
914 (JSC::JIT::compilePutByIdHotPath):
915 * runtime/JSImmediate.h:
916 (JSC::JSImmediate::makeInt):
918 2008-12-16 Cameron Zwarich <zwarich@apple.com>
920 Reviewed by Darin Adler.
922 Bug 22869: REGRESSION (r38407): http://news.cnet.com/8301-13579_3-9953533-37.html crashes
923 <https://bugs.webkit.org/show_bug.cgi?id=22869>
924 <rdar://problem/6402499>
926 Before r38407, Structure::m_nameInPrevious was ref'd due to it being
927 stored in a PropertyMap. However, PropertyMaps are created lazily after
928 r38407, so Structure::m_nameInPrevious is not necessarily ref'd while
929 it is being used. Making it a RefPtr instead of a raw pointer fixes
932 Unfortunately, the crash in the bug is rather intermittent, and it is
933 impossible to add an assertion in UString::Ref::ref() to catch this bug
934 because some users of UString::Rep deliberately zero out the reference
935 count. Therefore, there is no layout test accompanying this bug fix.
937 * runtime/Structure.cpp:
938 (JSC::Structure::~Structure): Use get().
939 (JSC::Structure::materializePropertyMap): Use get().
940 (JSC::Structure::addPropertyTransitionToExistingStructure): Use get().
941 (JSC::Structure::addPropertyTransition): Use get().
942 * runtime/Structure.h: Make Structure::m_nameInPrevious a RefPtr instead
945 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
947 Not reviewed. Attempt to fix win build. No 'using namespace WTF' in this file, needs manual WTF:: prefix.
948 Not sure why the build works as is here.
950 * runtime/MathObject.cpp:
951 (JSC::mathProtoFuncRandom):
953 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
955 Reviewed by Darin Adler.
957 Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876
959 Unify random number generation in JavaScriptCore & WebCore, by introducing
960 wtf/RandomNumber.h and moving wtf_random/wtf_random_init out of MathExtras.h.
962 wtf_random_init() has been renamed to initializeRandomNumberGenerator() and
963 lives in it's own private header: wtf/RandomNumberSeed.h, only intended to
964 be used from within JavaScriptCore.
966 wtf_random() has been renamed to randomNumber() and lives in a public header
967 wtf/RandomNumber.h, usable from within JavaScriptCore & WebCore. It encapsulates
968 the code taking care of initializing the random number generator (only when
969 building without ENABLE(JSC_MULTIPLE_THREADS), otherwhise initializeThreading()
970 already took care of that).
972 Functional change on darwin: Use random() instead of rand(), as it got a larger
973 period (more randomness). HTMLFormElement already contains this implementation
974 and I just moved it in randomNumber(), as special case for PLATFORM(DARWIN).
976 * GNUmakefile.am: Add RandomNumber.(cpp/h) / RandomNumberSeed.h.
977 * JavaScriptCore.exp: Ditto.
978 * JavaScriptCore.pri: Ditto.
979 * JavaScriptCore.scons: Ditto.
980 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
981 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
982 * JavaScriptCoreSources.bkl: Ditto.
983 * runtime/MathObject.cpp: Use new WTF::randomNumber() functionality.
984 (JSC::mathProtoFuncRandom):
985 * wtf/MathExtras.h: Move wtf_random / wtf_random_init to new files.
986 * wtf/RandomNumber.cpp: Added.
988 * wtf/RandomNumber.h: Added.
989 * wtf/RandomNumberSeed.h: Added. Internal usage within JSC only.
990 (WTF::initializeRandomNumberGenerator):
991 * wtf/ThreadingGtk.cpp: Rename wtf_random_init() to initializeRandomNumberGenerator().
992 (WTF::initializeThreading):
993 * wtf/ThreadingPthreads.cpp: Ditto.
994 (WTF::initializeThreading):
995 * wtf/ThreadingQt.cpp: Ditto.
996 (WTF::initializeThreading):
997 * wtf/ThreadingWin.cpp: Ditto.
998 (WTF::initializeThreading):
1000 2008-12-16 Yael Aharon <yael.aharon@nokia.com>
1002 Reviewed by Tor Arne Vestbø.
1006 * JavaScriptCore.pri:
1008 2008-12-15 Mark Rowe <mrowe@apple.com>
1010 Reviewed by Cameron Zwarich.
1012 Fix the build with GCC 4.0.
1014 * Configurations/JavaScriptCore.xcconfig: GCC 4.0 appears to have a bug when compiling with -funwind-tables on,
1015 so don't use it with that compiler version.
1017 2008-12-15 Mark Rowe <mrowe@apple.com>
1019 Rubber-stamped by Cameron Zwarich.
1021 <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard.
1023 * Configurations/Base.xcconfig:
1024 * Configurations/DebugRelease.xcconfig:
1026 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
1028 Reviewed by Darin Adler.
1030 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard.
1032 * API/JSContextRef.cpp: (JSGlobalContextCreate):
1034 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
1036 Reviewed by Darin Adler.
1038 <rdar://problem/6445089> Mach ports leak from worker threads
1040 * interpreter/Interpreter.cpp: (JSC::getCPUTime):
1041 Deallocate the thread self port.
1043 2008-12-15 Gavin Barraclough <barraclough@apple.com>
1045 Reviewed by Mark Rowe.
1047 Construct stack frames in JIT code, so that backtracing can still work.
1048 <rdar://problem/6447870> JIT should play nice with attempts to take stack traces
1052 (JSC::JIT::privateCompileMainPass):
1054 2008-12-15 Mark Rowe <mrowe@apple.com>
1056 Reviewed by Gavin Barraclough.
1058 <rdar://problem/6402262> JavaScriptCore needs exception handling tables in order to get stack traces without frame pointers
1060 * Configurations/JavaScriptCore.xcconfig:
1062 2008-12-15 Gavin Barraclough <barraclough@apple.com>
1064 Rubber stamped by Mark Rowe.
1066 Revert r39226 / Bug 22818: Unify JIT callback argument access OS X / Windows
1067 This causes Acid3 failures – reverting for now & will revisit later.
1068 https://bugs.webkit.org/show_bug.cgi?id=22873
1070 * interpreter/Interpreter.h:
1072 (JSC::JIT::privateCompileCTIMachineTrampolines):
1074 * jit/JITInlineMethods.h:
1075 (JSC::JIT::restoreArgumentReference):
1076 (JSC::JIT::restoreArgumentReferenceForTrampoline):
1077 (JSC::JIT::emitCTICall_internal):
1078 * jit/JITPropertyAccess.cpp:
1079 (JSC::JIT::privateCompilePutByIdTransition):
1082 2008-12-15 Darin Adler <darin@apple.com>
1084 Reviewed by Sam Weinig.
1086 - fix <rdar://problem/6427048> crash due to infinite recursion after setting window.__proto__ = window
1088 Replaced toGlobalObject with the more generally useful unwrappedObject and used it to
1089 fix the cycle detection code in put(__proto__).
1091 * JavaScriptCore.exp: Updated.
1093 * runtime/JSGlobalObject.cpp: Removed toGlobalObject. We now use unwrappedObject instead.
1094 * runtime/JSGlobalObject.h:
1095 (JSC::JSGlobalObject::isGlobalObject): Ditto.
1097 * runtime/JSGlobalObjectFunctions.cpp:
1098 (JSC::globalFuncEval): Use unwrappedObject and isGlobalObject here rather than toGlobalObject.
1100 * runtime/JSObject.cpp:
1101 (JSC::JSObject::put): Rewrote prototype cycle checking loop. Use unwrappedObject in the loop now.
1102 (JSC::JSObject::unwrappedObject): Replaced toGlobalObject with this new function.
1103 * runtime/JSObject.h: More of the same.
1105 2008-12-15 Steve Falkenburg <sfalken@apple.com>
1109 Visual Studio requires visibility of forward declarations to match class declaration.
1111 * assembler/X86Assembler.h:
1113 2008-12-15 Gustavo Noronha Silva <kov@kov.eti.br>
1115 Reviewed by Mark Rowe.
1117 https://bugs.webkit.org/show_bug.cgi?id=22686
1123 2008-12-15 Gavin Barraclough <barraclough@apple.com>
1125 Reviewed by Geoff Garen.
1127 Add support to X86Assembler emitting instructions that access all 16 registers on x86-64.
1128 Add a new formating class, that is reponsible for both emitting the opcode bytes and the
1129 ModRm bytes of an instruction in a single call; this can insert the REX byte as necessary
1130 before the opcode, but has access to the register numbers to build the REX.
1132 * assembler/AssemblerBuffer.h:
1133 (JSC::AssemblerBuffer::isAligned):
1134 (JSC::AssemblerBuffer::data):
1135 * assembler/MacroAssembler.h:
1136 (JSC::MacroAssembler::addPtr):
1137 (JSC::MacroAssembler::add32):
1138 (JSC::MacroAssembler::and32):
1139 (JSC::MacroAssembler::or32):
1140 (JSC::MacroAssembler::sub32):
1141 (JSC::MacroAssembler::xor32):
1142 (JSC::MacroAssembler::loadPtr):
1143 (JSC::MacroAssembler::load32):
1144 (JSC::MacroAssembler::load16):
1145 (JSC::MacroAssembler::storePtr):
1146 (JSC::MacroAssembler::storePtrWithRepatch):
1147 (JSC::MacroAssembler::store32):
1148 (JSC::MacroAssembler::pop):
1149 (JSC::MacroAssembler::push):
1150 (JSC::MacroAssembler::compareImm32ForBranch):
1151 (JSC::MacroAssembler::compareImm32ForBranchEquality):
1152 (JSC::MacroAssembler::testImm32):
1153 (JSC::MacroAssembler::jae32):
1154 (JSC::MacroAssembler::jb32):
1155 (JSC::MacroAssembler::je16):
1156 (JSC::MacroAssembler::jg32):
1157 (JSC::MacroAssembler::jnePtr):
1158 (JSC::MacroAssembler::jne32):
1159 (JSC::MacroAssembler::jump):
1160 * assembler/X86Assembler.h:
1162 (JSC::X86Assembler::):
1163 (JSC::X86Assembler::size):
1164 (JSC::X86Assembler::push_r):
1165 (JSC::X86Assembler::pop_r):
1166 (JSC::X86Assembler::push_i32):
1167 (JSC::X86Assembler::push_m):
1168 (JSC::X86Assembler::pop_m):
1169 (JSC::X86Assembler::addl_rr):
1170 (JSC::X86Assembler::addl_mr):
1171 (JSC::X86Assembler::addl_ir):
1172 (JSC::X86Assembler::addq_ir):
1173 (JSC::X86Assembler::addl_im):
1174 (JSC::X86Assembler::andl_rr):
1175 (JSC::X86Assembler::andl_ir):
1176 (JSC::X86Assembler::orl_rr):
1177 (JSC::X86Assembler::orl_mr):
1178 (JSC::X86Assembler::orl_ir):
1179 (JSC::X86Assembler::subl_rr):
1180 (JSC::X86Assembler::subl_mr):
1181 (JSC::X86Assembler::subl_ir):
1182 (JSC::X86Assembler::subl_im):
1183 (JSC::X86Assembler::xorl_rr):
1184 (JSC::X86Assembler::xorl_ir):
1185 (JSC::X86Assembler::sarl_i8r):
1186 (JSC::X86Assembler::sarl_CLr):
1187 (JSC::X86Assembler::shll_i8r):
1188 (JSC::X86Assembler::shll_CLr):
1189 (JSC::X86Assembler::imull_rr):
1190 (JSC::X86Assembler::imull_i32r):
1191 (JSC::X86Assembler::idivl_r):
1192 (JSC::X86Assembler::cmpl_rr):
1193 (JSC::X86Assembler::cmpl_rm):
1194 (JSC::X86Assembler::cmpl_mr):
1195 (JSC::X86Assembler::cmpl_ir):
1196 (JSC::X86Assembler::cmpl_ir_force32):
1197 (JSC::X86Assembler::cmpl_im):
1198 (JSC::X86Assembler::cmpl_im_force32):
1199 (JSC::X86Assembler::cmpw_rm):
1200 (JSC::X86Assembler::testl_rr):
1201 (JSC::X86Assembler::testl_i32r):
1202 (JSC::X86Assembler::testl_i32m):
1203 (JSC::X86Assembler::testq_rr):
1204 (JSC::X86Assembler::testq_i32r):
1205 (JSC::X86Assembler::testb_i8r):
1206 (JSC::X86Assembler::sete_r):
1207 (JSC::X86Assembler::setz_r):
1208 (JSC::X86Assembler::setne_r):
1209 (JSC::X86Assembler::setnz_r):
1210 (JSC::X86Assembler::cdq):
1211 (JSC::X86Assembler::xchgl_rr):
1212 (JSC::X86Assembler::movl_rr):
1213 (JSC::X86Assembler::movl_rm):
1214 (JSC::X86Assembler::movl_mr):
1215 (JSC::X86Assembler::movl_i32r):
1216 (JSC::X86Assembler::movl_i32m):
1217 (JSC::X86Assembler::movq_rr):
1218 (JSC::X86Assembler::movq_rm):
1219 (JSC::X86Assembler::movq_mr):
1220 (JSC::X86Assembler::movzwl_mr):
1221 (JSC::X86Assembler::movzbl_rr):
1222 (JSC::X86Assembler::leal_mr):
1223 (JSC::X86Assembler::call):
1224 (JSC::X86Assembler::jmp):
1225 (JSC::X86Assembler::jmp_r):
1226 (JSC::X86Assembler::jmp_m):
1227 (JSC::X86Assembler::jne):
1228 (JSC::X86Assembler::jnz):
1229 (JSC::X86Assembler::je):
1230 (JSC::X86Assembler::jl):
1231 (JSC::X86Assembler::jb):
1232 (JSC::X86Assembler::jle):
1233 (JSC::X86Assembler::jbe):
1234 (JSC::X86Assembler::jge):
1235 (JSC::X86Assembler::jg):
1236 (JSC::X86Assembler::ja):
1237 (JSC::X86Assembler::jae):
1238 (JSC::X86Assembler::jo):
1239 (JSC::X86Assembler::jp):
1240 (JSC::X86Assembler::js):
1241 (JSC::X86Assembler::addsd_rr):
1242 (JSC::X86Assembler::addsd_mr):
1243 (JSC::X86Assembler::cvtsi2sd_rr):
1244 (JSC::X86Assembler::cvttsd2si_rr):
1245 (JSC::X86Assembler::movd_rr):
1246 (JSC::X86Assembler::movsd_rm):
1247 (JSC::X86Assembler::movsd_mr):
1248 (JSC::X86Assembler::mulsd_rr):
1249 (JSC::X86Assembler::mulsd_mr):
1250 (JSC::X86Assembler::pextrw_irr):
1251 (JSC::X86Assembler::subsd_rr):
1252 (JSC::X86Assembler::subsd_mr):
1253 (JSC::X86Assembler::ucomis_rr):
1254 (JSC::X86Assembler::int3):
1255 (JSC::X86Assembler::ret):
1256 (JSC::X86Assembler::predictNotTaken):
1257 (JSC::X86Assembler::label):
1258 (JSC::X86Assembler::align):
1259 (JSC::X86Assembler::link):
1260 (JSC::X86Assembler::executableCopy):
1261 (JSC::X86Assembler::X86InstructionFormater::prefix):
1262 (JSC::X86Assembler::X86InstructionFormater::oneByteOp):
1263 (JSC::X86Assembler::X86InstructionFormater::twoByteOp):
1264 (JSC::X86Assembler::X86InstructionFormater::oneByteOp64):
1265 (JSC::X86Assembler::X86InstructionFormater::oneByteOp8):
1266 (JSC::X86Assembler::X86InstructionFormater::twoByteOp8):
1267 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate8):
1268 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate32):
1269 (JSC::X86Assembler::X86InstructionFormater::instructionRel32):
1270 (JSC::X86Assembler::X86InstructionFormater::size):
1271 (JSC::X86Assembler::X86InstructionFormater::isAligned):
1272 (JSC::X86Assembler::X86InstructionFormater::data):
1273 (JSC::X86Assembler::X86InstructionFormater::executableCopy):
1274 (JSC::X86Assembler::X86InstructionFormater::registerModRM):
1275 (JSC::X86Assembler::X86InstructionFormater::memoryModRM):
1277 (JSC::JIT::privateCompileMainPass):
1278 (JSC::JIT::privateCompile):
1279 (JSC::JIT::privateCompileCTIMachineTrampolines):
1280 * jit/JITArithmetic.cpp:
1281 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
1282 (JSC::JIT::compileBinaryArithOp):
1284 (JSC::JIT::compileOpCall):
1285 (JSC::JIT::compileOpCallSlowCase):
1286 * jit/JITPropertyAccess.cpp:
1287 (JSC::JIT::compileGetByIdHotPath):
1288 (JSC::JIT::compilePutByIdHotPath):
1289 (JSC::JIT::privateCompilePutByIdTransition):
1290 (JSC::JIT::privateCompilePatchGetArrayLength):
1291 (JSC::JIT::privateCompileGetByIdProto):
1292 (JSC::JIT::privateCompileGetByIdProtoList):
1293 (JSC::JIT::privateCompileGetByIdChainList):
1294 (JSC::JIT::privateCompileGetByIdChain):
1296 2008-12-15 Darin Adler <darin@apple.com>
1298 * interpreter/RegisterFile.h: Tweak include formatting.
1300 2008-12-15 Holger Hans Peter Freyther <zecke@selfish.org>
1304 * interpreter/RegisterFile.h: Include stdio.h for fprintf
1306 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
1308 Reviewed by Oliver Hunt.
1310 <rdar://problem/6444455> Worker Thread crash running multiple workers for a moderate amount of time
1312 * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile):
1313 Improve error handling: if mmap fails, crash immediately, and print out the reason.
1315 2008-12-13 Gavin Barraclough <barraclough@apple.com>
1317 Reviewed by Cameron Zwarich.
1319 Re-enable WREC on 64-bit.
1320 Implements one of the MacroAssembler::jnzPtr methods, previously only implemented for 32-bit x86.
1322 https://bugs.webkit.org/show_bug.cgi?id=22849
1324 * assembler/MacroAssembler.h:
1325 (JSC::MacroAssembler::testImm64):
1326 (JSC::MacroAssembler::jnzPtr):
1327 * assembler/X86Assembler.h:
1328 (JSC::X86Assembler::testq_i32r):
1329 (JSC::X86Assembler::testq_rr):
1332 2008-12-13 Gavin Barraclough <barraclough@apple.com>
1336 * assembler/MacroAssembler.h:
1338 2008-12-13 Gavin Barraclough <barraclough@apple.com>
1340 Build fix only, no review.
1342 * bytecode/CodeBlock.h:
1344 2008-12-13 Gavin Barraclough <barraclough@apple.com>
1346 Reviewed by Cameron Zwarich.
1348 Port the remainder of the JIT, bar calling convention related code, and code
1349 implementing optimizations which can be disabled, to use the MacroAssembler.
1351 * assembler/MacroAssembler.h:
1352 (JSC::MacroAssembler::DataLabelPtr::DataLabelPtr):
1353 (JSC::MacroAssembler::RepatchBuffer::RepatchBuffer):
1354 (JSC::MacroAssembler::RepatchBuffer::link):
1355 (JSC::MacroAssembler::RepatchBuffer::addressOf):
1356 (JSC::MacroAssembler::RepatchBuffer::setPtr):
1357 (JSC::MacroAssembler::addPtr):
1358 (JSC::MacroAssembler::lshift32):
1359 (JSC::MacroAssembler::mod32):
1360 (JSC::MacroAssembler::rshift32):
1361 (JSC::MacroAssembler::storePtrWithRepatch):
1362 (JSC::MacroAssembler::jnzPtr):
1363 (JSC::MacroAssembler::jzPtr):
1364 (JSC::MacroAssembler::jump):
1365 (JSC::MacroAssembler::label):
1366 * assembler/X86Assembler.h:
1367 (JSC::X86Assembler::):
1368 (JSC::X86Assembler::xchgl_rr):
1369 (JSC::X86Assembler::jmp_m):
1370 (JSC::X86Assembler::repatchAddress):
1371 (JSC::X86Assembler::getRelocatedAddress):
1372 * bytecode/CodeBlock.cpp:
1373 (JSC::CodeBlock::CodeBlock):
1374 * bytecode/CodeBlock.h:
1375 (JSC::JITCodeRef::JITCodeRef):
1376 (JSC::CodeBlock::setJITCode):
1377 (JSC::CodeBlock::jitCode):
1378 (JSC::CodeBlock::executablePool):
1380 (JSC::JIT::privateCompileMainPass):
1381 (JSC::JIT::privateCompileLinkPass):
1382 (JSC::JIT::privateCompile):
1383 (JSC::JIT::privateCompileCTIMachineTrampolines):
1385 (JSC::CallRecord::CallRecord):
1386 (JSC::JumpTable::JumpTable):
1387 (JSC::JIT::emitCTICall):
1388 (JSC::JIT::JSRInfo::JSRInfo):
1389 * jit/JITArithmetic.cpp:
1391 * jit/JITInlineMethods.h:
1392 (JSC::JIT::emitNakedCall):
1393 (JSC::JIT::emitCTICall_internal):
1394 (JSC::JIT::checkStructure):
1395 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
1396 (JSC::JIT::addSlowCase):
1397 (JSC::JIT::addJump):
1398 (JSC::JIT::emitJumpSlowToHot):
1399 * jit/JITPropertyAccess.cpp:
1400 (JSC::JIT::privateCompileGetByIdChainList):
1401 (JSC::JIT::privateCompileGetByIdChain):
1403 2008-12-12 Cameron Zwarich <zwarich@apple.com>
1405 Reviewed by Sam Weinig.
1407 Fix the failures of the following layout tests, which regressed in
1410 fast/dom/StyleSheet/ownerNode-lifetime-2.html
1411 fast/xsl/transform-xhr-doc.xhtml
1413 The binary search in CodeBlock::getByIdExceptionInfoForBytecodeOffset()
1414 doesn't guarantee that it actually finds a match, so add an explicit check
1417 * bytecode/CodeBlock.cpp:
1418 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
1420 2008-12-12 Gavin Barraclough <barraclough@apple.com>
1422 Reviewed by Cameron Zwarich.
1424 Replace emitPutCallArg methods with emitPutJITStubArg methods. Primarily to make the argument numbering
1425 more sensible (1-based incrementing by 1, rather than 0-based incrementing by 4). The CTI name also seems
1426 to be being deprecated from the code generally.
1429 (JSC::JIT::privateCompileMainPass):
1430 (JSC::JIT::privateCompileSlowCases):
1431 (JSC::JIT::privateCompileCTIMachineTrampolines):
1433 * jit/JITArithmetic.cpp:
1434 (JSC::JIT::compileBinaryArithOp):
1435 (JSC::JIT::compileBinaryArithOpSlowCase):
1437 (JSC::JIT::compileOpCallSetupArgs):
1438 (JSC::JIT::compileOpCallEvalSetupArgs):
1439 (JSC::JIT::compileOpConstructSetupArgs):
1440 (JSC::JIT::compileOpCall):
1441 * jit/JITInlineMethods.h:
1442 (JSC::JIT::emitPutJITStubArg):
1443 (JSC::JIT::emitPutJITStubArgConstant):
1444 (JSC::JIT::emitGetJITStubArg):
1445 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
1446 * jit/JITPropertyAccess.cpp:
1447 (JSC::JIT::compileGetByIdHotPath):
1448 (JSC::JIT::compilePutByIdHotPath):
1449 (JSC::JIT::compileGetByIdSlowCase):
1450 (JSC::JIT::compilePutByIdSlowCase):
1452 2008-12-12 Gavin Barraclough <barraclough@apple.com>
1457 (JSC::JIT::privateCompileMainPass):
1458 (JSC::JIT::privateCompileSlowCases):
1459 (JSC::JIT::privateCompile):
1461 2008-12-12 Gavin Barraclough <barraclough@apple.com>
1463 Reviewed by Geoff Garen.
1465 Remove loop counter 'i' from the JIT generation passes, replace with a member m_bytecodeIndex.
1467 No impact on performance.
1470 (JSC::JIT::compileOpStrictEq):
1471 (JSC::JIT::emitSlowScriptCheck):
1472 (JSC::JIT::privateCompileMainPass):
1473 (JSC::JIT::privateCompileSlowCases):
1474 (JSC::JIT::privateCompile):
1476 (JSC::CallRecord::CallRecord):
1477 (JSC::JmpTable::JmpTable):
1478 (JSC::JIT::emitCTICall):
1479 * jit/JITArithmetic.cpp:
1480 (JSC::JIT::compileBinaryArithOp):
1481 (JSC::JIT::compileBinaryArithOpSlowCase):
1483 (JSC::JIT::compileOpCall):
1484 (JSC::JIT::compileOpCallSlowCase):
1485 * jit/JITInlineMethods.h:
1486 (JSC::JIT::emitGetVirtualRegister):
1487 (JSC::JIT::emitGetVirtualRegisters):
1488 (JSC::JIT::emitNakedCall):
1489 (JSC::JIT::emitCTICall_internal):
1490 (JSC::JIT::emitJumpSlowCaseIfJSCell):
1491 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
1492 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
1493 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
1494 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
1495 (JSC::JIT::addSlowCase):
1496 (JSC::JIT::addJump):
1497 (JSC::JIT::emitJumpSlowToHot):
1498 * jit/JITPropertyAccess.cpp:
1499 (JSC::JIT::compileGetByIdHotPath):
1500 (JSC::JIT::compileGetByIdSlowCase):
1501 (JSC::JIT::compilePutByIdHotPath):
1502 (JSC::JIT::compilePutByIdSlowCase):
1504 2008-12-12 Sam Weinig <sam@webkit.org>
1506 Reviewed by Cameron Zwarich.
1508 <rdar://problem/6428342> Look into feasibility of discarding bytecode after native codegen
1510 Move more JIT functionality to using offsets into the Instruction buffer
1511 instead of raw pointers. Two to go!
1513 * interpreter/Interpreter.cpp:
1514 (JSC::bytecodeOffsetForPC): Rename from vPCForPC.
1515 (JSC::Interpreter::resolve): Pass offset to exception helper.
1516 (JSC::Interpreter::resolveSkip): Ditto.
1517 (JSC::Interpreter::resolveGlobal): Ditto.
1518 (JSC::Interpreter::resolveBaseAndProperty): Ditto.
1519 (JSC::Interpreter::resolveBaseAndFunc): Ditto.
1520 (JSC::isNotObject): Ditto.
1521 (JSC::Interpreter::unwindCallFrame): Call bytecodeOffsetForPC.
1522 (JSC::Interpreter::throwException): Use offsets instead of vPCs.
1523 (JSC::Interpreter::privateExecute): Pass offset to exception helper.
1524 (JSC::Interpreter::retrieveLastCaller): Ditto.
1525 (JSC::Interpreter::cti_op_instanceof): Ditto.
1526 (JSC::Interpreter::cti_op_call_NotJSFunction): Ditto.
1527 (JSC::Interpreter::cti_op_resolve): Pass offset to exception helper.
1528 (JSC::Interpreter::cti_op_construct_NotJSConstruct): Ditto.
1529 (JSC::Interpreter::cti_op_resolve_func): Ditto.
1530 (JSC::Interpreter::cti_op_resolve_skip): Ditto.
1531 (JSC::Interpreter::cti_op_resolve_global): Ditto.
1532 (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
1533 (JSC::Interpreter::cti_op_throw): Ditto.
1534 (JSC::Interpreter::cti_op_in): Ditto.
1535 (JSC::Interpreter::cti_vm_throw): Ditto.
1536 * interpreter/Interpreter.h:
1539 (JSC::JIT::privateCompileMainPass): Don't pass unnecessary vPC to stub.
1540 * jit/JIT.h: Remove ARG_instr1 - ARG_instr3 and ARG_instr5 - ARG_instr6.
1542 (JSC::JIT::compileOpCallEvalSetupArgs): Don't pass unnecessary vPC to stub..
1543 (JSC::JIT::compileOpConstructSetupArgs): Ditto.
1545 * runtime/ExceptionHelpers.cpp:
1546 (JSC::createUndefinedVariableError): Take an offset instead of vPC.
1547 (JSC::createInvalidParamError): Ditto.
1548 (JSC::createNotAConstructorError): Ditto.
1549 (JSC::createNotAFunctionError): Ditto.
1550 (JSC::createNotAnObjectError): Ditto.
1551 * runtime/ExceptionHelpers.h:
1553 2008-12-12 Cameron Zwarich <zwarich@apple.com>
1555 Reviewed by Oliver Hunt.
1557 Bug 22835: Crash during bytecode generation when comparing to null
1558 <https://bugs.webkit.org/show_bug.cgi?id=22835>
1559 <rdar://problem/6286749>
1561 Change the special cases in bytecode generation for comparison to null
1562 to use tempDestination().
1565 (JSC::BinaryOpNode::emitBytecode):
1566 (JSC::EqualNode::emitBytecode):
1568 2008-12-12 Gavin Barraclough <barraclough@apple.com>
1570 Reviewed by Geoff Garen.
1572 Move slow-cases of JIT code generation over to the MacroAssembler interface.
1574 * assembler/MacroAssembler.h:
1575 (JSC::MacroAssembler::Label::Label):
1576 (JSC::MacroAssembler::jae32):
1577 (JSC::MacroAssembler::jg32):
1578 (JSC::MacroAssembler::jzPtr):
1580 (JSC::JIT::privateCompileSlowCases):
1581 (JSC::JIT::privateCompile):
1582 (JSC::JIT::emitGetVariableObjectRegister):
1583 (JSC::JIT::emitPutVariableObjectRegister):
1585 (JSC::SlowCaseEntry::SlowCaseEntry):
1586 (JSC::JIT::getSlowCase):
1587 (JSC::JIT::linkSlowCase):
1588 * jit/JITArithmetic.cpp:
1589 (JSC::JIT::compileBinaryArithOpSlowCase):
1591 (JSC::JIT::compileOpCallInitializeCallFrame):
1592 (JSC::JIT::compileOpCall):
1593 (JSC::JIT::compileOpCallSlowCase):
1594 * jit/JITInlineMethods.h:
1595 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
1596 (JSC::JIT::linkSlowCaseIfNotJSCell):
1597 * jit/JITPropertyAccess.cpp:
1598 (JSC::JIT::compileGetByIdHotPath):
1599 (JSC::JIT::compilePutByIdHotPath):
1600 (JSC::JIT::compileGetByIdSlowCase):
1601 (JSC::JIT::compilePutByIdSlowCase):
1603 2008-12-12 Cameron Zwarich <zwarich@apple.com>
1605 Reviewed by Sam Weinig.
1607 Bug 22828: Do not inspect bytecode instruction stream for op_get_by_id exception information
1608 <https://bugs.webkit.org/show_bug.cgi?id=22828>
1610 In order to remove the bytecode instruction stream after generating
1611 native code, all inspection of bytecode instructions at runtime must
1612 be removed. One particular instance of this is the special handling of
1613 exceptions thrown by the op_get_by_id emitted directly before an
1614 op_construct or an op_instanceof. This patch moves that information to
1615 an auxiliary data structure in CodeBlock.
1617 * bytecode/CodeBlock.cpp:
1618 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
1619 * bytecode/CodeBlock.h:
1620 (JSC::CodeBlock::addGetByIdExceptionInfo):
1621 * bytecompiler/BytecodeGenerator.cpp:
1622 (JSC::BytecodeGenerator::emitConstruct):
1623 * bytecompiler/BytecodeGenerator.h:
1624 (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
1626 (JSC::InstanceOfNode::emitBytecode):
1627 * runtime/ExceptionHelpers.cpp:
1628 (JSC::createNotAnObjectError):
1630 2008-12-12 Sam Weinig <sam@webkit.org>
1632 Reviewed by Geoffrey Garen.
1634 Change exception information accessors to take offsets into the bytecode
1635 instruction buffer instead of pointers so that they can work even even
1636 if the bytecode buffer is purged.
1638 * bytecode/CodeBlock.cpp:
1639 (JSC::instructionOffsetForNth):
1640 (JSC::CodeBlock::handlerForBytecodeOffset):
1641 (JSC::CodeBlock::lineNumberForBytecodeOffset):
1642 (JSC::CodeBlock::expressionRangeForBytecodeOffset):
1643 * bytecode/CodeBlock.h:
1644 * bytecode/SamplingTool.cpp:
1645 (JSC::SamplingTool::dump):
1646 * interpreter/Interpreter.cpp:
1647 (JSC::Interpreter::throwException):
1648 (JSC::Interpreter::privateExecute):
1649 (JSC::Interpreter::retrieveLastCaller):
1651 (JSC::JIT::privateCompileMainPass):
1652 * runtime/ExceptionHelpers.cpp:
1653 (JSC::createUndefinedVariableError):
1654 (JSC::createInvalidParamError):
1655 (JSC::createNotAConstructorError):
1656 (JSC::createNotAFunctionError):
1657 (JSC::createNotAnObjectError):
1659 2008-12-12 Geoffrey Garen <ggaren@apple.com>
1661 Reviewed by Cameron Zwarich.
1663 Tiny bit of refactoring in quantifier generation.
1665 * wrec/WRECGenerator.cpp:
1666 (JSC::WREC::Generator::generateNonGreedyQuantifier):
1667 (JSC::WREC::Generator::generateGreedyQuantifier):
1669 2008-12-11 Sam Weinig <sam@webkit.org>
1671 Reviewed by Geoffrey Garen.
1673 Remove dependancy on having the Instruction buffer in order to
1674 deref Structures used for property access and global resolves.
1675 Instead, we put references to the necessary Structures in auxiliary
1676 data structures on the CodeBlock. This is not an ideal solution,
1677 as we still pay for having the Structures in two places and we
1678 would like to eventually just hold on to offsets into the machine
1681 - Also removes CodeBlock bloat in non-JIT by #ifdefing the JIT
1682 only data structures.
1685 * JavaScriptCore.pri:
1686 * JavaScriptCore.scons:
1687 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1688 * JavaScriptCore.xcodeproj/project.pbxproj:
1689 * JavaScriptCoreSources.bkl:
1690 * bytecode/CodeBlock.cpp:
1691 (JSC::isGlobalResolve):
1692 (JSC::isPropertyAccess):
1693 (JSC::instructionOffsetForNth):
1694 (JSC::printGlobalResolveInfo):
1695 (JSC::printStructureStubInfo):
1696 (JSC::CodeBlock::printStructures):
1697 (JSC::CodeBlock::dump):
1698 (JSC::CodeBlock::~CodeBlock):
1699 (JSC::CodeBlock::shrinkToFit):
1700 * bytecode/CodeBlock.h:
1701 (JSC::GlobalResolveInfo::GlobalResolveInfo):
1703 (JSC::CodeBlock::instructions):
1704 (JSC::CodeBlock::getStubInfo):
1705 (JSC::CodeBlock::getBytecodeIndex):
1706 (JSC::CodeBlock::addPropertyAccessInstruction):
1707 (JSC::CodeBlock::addGlobalResolveInstruction):
1708 (JSC::CodeBlock::numberOfStructureStubInfos):
1709 (JSC::CodeBlock::addStructureStubInfo):
1710 (JSC::CodeBlock::structureStubInfo):
1711 (JSC::CodeBlock::addGlobalResolveInfo):
1712 (JSC::CodeBlock::globalResolveInfo):
1713 (JSC::CodeBlock::numberOfCallLinkInfos):
1714 (JSC::CodeBlock::addCallLinkInfo):
1715 (JSC::CodeBlock::callLinkInfo):
1716 * bytecode/Instruction.h:
1717 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
1718 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
1719 * bytecode/Opcode.h:
1721 * bytecode/StructureStubInfo.cpp: Copied from bytecode/CodeBlock.cpp.
1722 (JSC::StructureStubInfo::deref):
1723 * bytecode/StructureStubInfo.h: Copied from bytecode/CodeBlock.h.
1724 (JSC::StructureStubInfo::StructureStubInfo):
1725 (JSC::StructureStubInfo::initGetByIdSelf):
1726 (JSC::StructureStubInfo::initGetByIdProto):
1727 (JSC::StructureStubInfo::initGetByIdChain):
1728 (JSC::StructureStubInfo::initGetByIdSelfList):
1729 (JSC::StructureStubInfo::initGetByIdProtoList):
1730 (JSC::StructureStubInfo::initPutByIdTransition):
1731 (JSC::StructureStubInfo::initPutByIdReplace):
1732 (JSC::StructureStubInfo::):
1733 * bytecompiler/BytecodeGenerator.cpp:
1734 (JSC::BytecodeGenerator::emitResolve):
1735 (JSC::BytecodeGenerator::emitGetById):
1736 (JSC::BytecodeGenerator::emitPutById):
1737 (JSC::BytecodeGenerator::emitCall):
1738 (JSC::BytecodeGenerator::emitConstruct):
1739 (JSC::BytecodeGenerator::emitCatch):
1740 * interpreter/Interpreter.cpp:
1741 (JSC::Interpreter::tryCTICachePutByID):
1742 (JSC::Interpreter::tryCTICacheGetByID):
1743 (JSC::Interpreter::cti_op_get_by_id_self_fail):
1744 (JSC::getPolymorphicAccessStructureListSlot):
1745 (JSC::Interpreter::cti_op_get_by_id_proto_list):
1746 (JSC::Interpreter::cti_op_resolve_global):
1749 (JSC::JIT::privateCompileMainPass):
1750 (JSC::JIT::privateCompileSlowCases):
1751 (JSC::JIT::privateCompile):
1752 * jit/JITPropertyAccess.cpp:
1753 (JSC::JIT::compileGetByIdHotPath):
1754 (JSC::JIT::compilePutByIdHotPath):
1755 (JSC::JIT::compileGetByIdSlowCase):
1756 (JSC::JIT::compilePutByIdSlowCase):
1757 (JSC::JIT::privateCompileGetByIdSelfList):
1758 (JSC::JIT::privateCompileGetByIdProtoList):
1759 (JSC::JIT::privateCompileGetByIdChainList):
1761 2008-12-11 Gavin Barraclough <barraclough@apple.com>
1763 Reviewed by Oliver Hunt.
1765 Remove CTI_ARGUMENTS mode, use va_start implementation on Windows,
1766 unifying JIT callback (cti_*) argument access on OS X & Windows
1768 No performance impact.
1770 * interpreter/Interpreter.h:
1772 (JSC::JIT::privateCompileCTIMachineTrampolines):
1774 * jit/JITInlineMethods.h:
1775 (JSC::JIT::emitCTICall):
1776 * jit/JITPropertyAccess.cpp:
1777 (JSC::JIT::privateCompilePutByIdTransition):
1780 2008-12-11 Holger Freyther <zecke@selfish.org>
1782 Reviewed by Simon Hausmann.
1784 https://bugs.webkit.org/show_bug.cgi?id=20953
1786 For Qt it is not pratical to have a FontCache and GlyphPageTreeNode
1787 implementation. This is one of the reasons why the Qt port is currently not
1788 using WebCore/platform/graphics/Font.cpp. By allowing to not use
1789 the simple/fast-path the Qt port will be able to use it.
1791 Introduce USE(FONT_FAST_PATH) and define it for every port but the
1794 * wtf/Platform.h: Enable USE(FONT_FAST_PATH)
1796 2008-12-11 Gabor Loki <loki@inf.u-szeged.hu>
1798 Reviewed by Darin Adler and landed by Holger Freyther.
1800 <https://bugs.webkit.org/show_bug.cgi?id=22648>
1801 Fix threading on Qt-port and Gtk-port for Sampling tool.
1803 * wtf/ThreadingGtk.cpp:
1804 (WTF::waitForThreadCompletion):
1805 * wtf/ThreadingQt.cpp:
1806 (WTF::waitForThreadCompletion):
1808 2008-12-10 Cameron Zwarich <zwarich@apple.com>
1810 Reviewed by Oliver Hunt.
1812 Bug 22734: Debugger crashes when stepping into a function call in a return statement
1813 <https://bugs.webkit.org/show_bug.cgi?id=22734>
1814 <rdar://problem/6426796>
1816 * bytecompiler/BytecodeGenerator.cpp:
1817 (JSC::BytecodeGenerator::BytecodeGenerator): The DebuggerCallFrame uses
1818 the 'this' value stored in a callFrame, so op_convert_this should be
1819 emitted at the beginning of a function body when generating bytecode
1821 * debugger/DebuggerCallFrame.cpp:
1822 (JSC::DebuggerCallFrame::thisObject): The assertion inherent in the call
1823 to asObject() here is valid, because any 'this' value should have been
1824 converted to a JSObject*.
1826 2008-12-10 Gavin Barraclough <barraclough@apple.com>
1828 Reviewed by Geoff Garen.
1830 Port more of the JIT to use the MacroAssembler interface.
1832 Everything in the main pass, bar a few corner cases (operations with required
1833 registers, or calling convention code). Slightly refactors array creation,
1834 moving the offset calculation into the callFrame into C code (reducing code
1837 Overall this appears to be a 1% win on v8-tests, due to the smaller immediates
1838 being planted (in jfalse in particular).
1840 * interpreter/Interpreter.cpp:
1841 (JSC::Interpreter::cti_op_new_array):
1843 (JSC::JIT::privateCompileMainPass):
1844 (JSC::JIT::privateCompileSlowCases):
1846 * wrec/WRECGenerator.cpp:
1847 (JSC::WREC::Generator::generateEnter):
1849 2008-12-10 Sam Weinig <sam@webkit.org>
1853 * bytecode/CodeBlock.h:
1855 2008-12-10 Sam Weinig <sam@webkit.org>
1857 Reviewed by Geoffrey Garen.
1859 <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
1863 Convert the return address table from a HashMap to a sorted Vector. This
1864 reduces the size of the data structure by ~4.5MB on Membuster head.
1866 SunSpider reports a 0.5% progression.
1868 * bytecode/CodeBlock.cpp:
1869 (JSC::sizeInBytes): Generic method to get the cost of a Vector.
1870 (JSC::CodeBlock::dumpStatistics): Add dumping of member sizes.
1871 * bytecode/CodeBlock.h:
1872 (JSC::PC::PC): Struct representing NativePC -> VirtualPC mappings.
1873 (JSC::getNativePC): Helper for binary chop.
1874 (JSC::CodeBlock::getBytecodeIndex): Used to get the VirtualPC from a
1875 NativePC using a binary chop of the pcVector.
1876 (JSC::CodeBlock::pcVector): Accessor.
1878 * interpreter/Interpreter.cpp:
1879 (JSC::vPCForPC): Use getBytecodeIndex instead of jitReturnAddressVPCMap().get().
1880 (JSC::Interpreter::cti_op_instanceof): Ditto.
1881 (JSC::Interpreter::cti_op_resolve): Ditto.
1882 (JSC::Interpreter::cti_op_resolve_func): Ditto.
1883 (JSC::Interpreter::cti_op_resolve_skip): Ditto.
1884 (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
1885 (JSC::Interpreter::cti_op_throw): Ditto.
1886 (JSC::Interpreter::cti_op_in): Ditto.
1887 (JSC::Interpreter::cti_vm_throw): Ditto.
1890 (JSC::JIT::privateCompile): Reserve exact capacity and fill the pcVector.
1892 2008-12-09 Geoffrey Garen <ggaren@apple.com>
1894 Reviewed by Oliver Hunt.
1896 Added WREC support for an assertion followed by a quantifier. Fixed
1899 * wrec/WRECParser.cpp:
1900 (JSC::WREC::Parser::parseParentheses): Throw away the quantifier, since
1901 it's meaningless. (Firefox does the same.)
1903 * pcre/pcre_compile.cpp:
1904 (compileBranch): ditto.
1906 2008-12-09 Geoffrey Garen <ggaren@apple.com>
1908 Reviewed by Cameron Zwarich.
1910 In preparation for compiling WREC without PCRE:
1912 Further relaxed WREC's parsing to be more web-compatible. Fixed PCRE to
1913 match in cases where it didn't already.
1915 Changed JavaScriptCore to report syntax errors detected by WREC, rather
1916 than falling back on PCRE any time WREC sees an error.
1918 * pcre/pcre_compile.cpp:
1919 (checkEscape): Relaxed parsing of \c and \N escapes to be more
1922 * runtime/RegExp.cpp:
1923 (JSC::RegExp::RegExp): Only fall back on PCRE if WREC has not reported
1927 (JSC::WREC::Generator::compileRegExp): Fixed some error reporting to
1930 * wrec/WRECParser.cpp: Added error messages that match PCRE.
1932 (JSC::WREC::Parser::consumeGreedyQuantifier):
1933 (JSC::WREC::Parser::parseParentheses):
1934 (JSC::WREC::Parser::parseCharacterClass):
1935 (JSC::WREC::Parser::parseNonCharacterEscape): Updated the above functions to
1936 use the new setError API.
1938 (JSC::WREC::Parser::consumeEscape): Relaxed parsing of \c \N \u \x \B
1939 to be more web-compatible.
1941 (JSC::WREC::Parser::parseAlternative): Distinguish between a malformed
1942 quantifier and a quantifier with no prefix, like PCRE does.
1944 (JSC::WREC::Parser::consumeParenthesesType): Updated to use the new setError API.
1946 * wrec/WRECParser.h:
1947 (JSC::WREC::Parser::error):
1948 (JSC::WREC::Parser::syntaxError):
1949 (JSC::WREC::Parser::parsePattern):
1950 (JSC::WREC::Parser::reset):
1951 (JSC::WREC::Parser::setError): Store error messages instead of error codes,
1952 to provide for exception messages. Use a setter for reporting errors, so
1953 errors detected early are not overwritten by errors detected later.
1955 2008-12-09 Gavin Barraclough <barraclough@apple.com>
1957 Reviewed by Oliver Hunt.
1959 Use va_args to access cti function arguments.
1960 https://bugs.webkit.org/show_bug.cgi?id=22774
1962 This may be a minor regression, but we'll take the hit if so to reduce fragility.
1964 * interpreter/Interpreter.cpp:
1965 * interpreter/Interpreter.h:
1967 2008-12-09 Sam Weinig <sam@webkit.org>
1969 Reviewed twice by Cameron Zwarich.
1971 Fix for https://bugs.webkit.org/show_bug.cgi?id=22752
1972 Clear SymbolTable after codegen for Function codeblocks that
1973 don't require an activation
1975 This is a ~1.5MB improvement on Membuster-head.
1977 * bytecode/CodeBlock.cpp:
1978 (JSC::CodeBlock::dumpStatistics): Add logging of non-empty symbol tables
1979 and total size used by symbol tables.
1980 * bytecompiler/BytecodeGenerator.cpp:
1981 (JSC::BytecodeGenerator::generate): Clear the symbol table here.
1983 2008-12-09 Sam Weinig <sam@webkit.org>
1985 Reviewed by Geoffrey Garen.
1987 Remove unnecessary extra lookup when throwing an exception.
1988 We used to first lookup the target offset using getHandlerForVPC
1989 and then we would lookup the native code stub using
1990 nativeExceptionCodeForHandlerVPC. Instead, we can just pass around
1993 * bytecode/CodeBlock.cpp:
1994 (JSC::CodeBlock::handlerForVPC): Return the HandlerInfo.
1995 * bytecode/CodeBlock.h: Remove nativeExceptionCodeForHandlerVPC.
1997 * interpreter/Interpreter.cpp:
1998 (JSC::Interpreter::throwException): Return a HandlerInfo instead of
1999 and Instruction offset.
2000 (JSC::Interpreter::privateExecute): Get the offset from HandlerInfo.
2001 (JSC::Interpreter::cti_op_throw): Get the native code from the HandleInfo.
2002 (JSC::Interpreter::cti_vm_throw): Ditto.
2003 * interpreter/Interpreter.h:
2005 2008-12-09 Eric Seidel <eric@webkit.org>
2007 Build fix only, no review.
2009 Speculative fix for the Chromium-Windows bot.
2010 Add JavaScriptCore/os-win32 to the include path (for stdint.h)
2011 Strangely it builds fine on my local windows box (or at least doesn't hit this error)
2013 * JavaScriptCore.scons:
2015 2008-12-09 Eric Seidel <eric@webkit.org>
2017 No review, build fix only.
2019 Add ExecutableAllocator files missing from Scons build.
2021 * JavaScriptCore.scons:
2023 2008-12-09 Dimitri Glazkov <dglazkov@chromium.org>
2025 Reviewed by Timothy Hatcher.
2027 https://bugs.webkit.org/show_bug.cgi?id=22631
2028 Allow ScriptCallFrame query names of functions in the call stack.
2030 * JavaScriptCore.exp: added InternalFunction::name and
2031 UString operator==() as exported symbol
2033 2008-12-08 Judit Jasz <jasy@inf.u-szeged.hu>
2035 Reviewed and tweaked by Cameron Zwarich.
2037 Bug 22352: Annotate opcodes with their length
2038 <https://bugs.webkit.org/show_bug.cgi?id=22352>
2040 * bytecode/Opcode.cpp:
2041 * bytecode/Opcode.h:
2042 * interpreter/Interpreter.cpp:
2043 (JSC::Interpreter::privateExecute):
2045 (JSC::JIT::privateCompileMainPass):
2046 (JSC::JIT::privateCompileSlowCases):
2048 2008-12-08 Geoffrey Garen <ggaren@apple.com>
2050 Reviewed by Oliver Hunt.
2052 Implemented more of the relaxed and somewhat weird rules for deciding
2053 how to interpret a non-pattern-character.
2056 (JSC::WREC::Escape::):
2057 (JSC::WREC::Escape::Escape): Eliminated Escape::None because it was
2058 unused. If you see an '\\', it's either a valid escape or an error.
2060 * wrec/Quantifier.h:
2061 (JSC::WREC::Quantifier::Quantifier):
2062 * wrec/WRECGenerator.cpp:
2063 (JSC::WREC::Generator::generateNonGreedyQuantifier):
2064 (JSC::WREC::Generator::generateGreedyQuantifier): Renamed "noMaxSpecified"
2065 to "Infinity", since that's what it means.
2067 * wrec/WRECParser.cpp:
2068 (JSC::WREC::Parser::consumeGreedyQuantifier): Re-wrote {n,m} parsing rules
2069 because they were too strict before. Added support for backtracking
2070 in the case where the {n,m} fails to parse as a quantifier, and yet is
2073 (JSC::WREC::Parser::parseCharacterClass):
2074 (JSC::WREC::Parser::parseNonCharacterEscape): Eliminated Escape::None,
2077 (JSC::WREC::Parser::consumeEscape): Don't treat ASCII and _ escapes
2078 as syntax errors. See fast/regex/non-pattern-characters.html.
2080 * wrec/WRECParser.h:
2081 (JSC::WREC::Parser::SavedState::SavedState):
2082 (JSC::WREC::Parser::SavedState::restore): Added a state backtracker,
2083 since parsing {n,m} forms requires backtracking if the form turns out
2084 not to be a quantifier.
2086 2008-12-08 Geoffrey Garen <ggaren@apple.com>
2088 Reviewed by Oliver Hunt.
2090 Refactored WREC parsing so that only one piece of code needs to know
2091 the relaxed and somewhat weird rules for deciding how to interpret a
2092 non-pattern-character, in preparation for implementing those rules.
2094 Also, implemented the relaxed and somewhat weird rules for '}' and ']'.
2096 * wrec/WREC.cpp: Reduced the regular expression size limit. Now that
2097 WREC handles ']' properly, it compiles fast/js/regexp-charclass-crash.html,
2098 which makes it hang at the old limit. (The old limit was based on the
2099 misimpression that the same value in PCRE limited the regular expression
2100 pattern size; in reality, it limited the expected compiled regular
2101 expression size. WREC doesn't have a way to calculate an expected
2102 compiled regular expression size, but this should be good enough.)
2104 * wrec/WRECParser.cpp:
2105 (JSC::WREC::parsePatternCharacterSequence): Nixed this function because
2106 it contained a second copy of the logic for handling non-pattern-characters,
2107 which is about to get a lot more complicated.
2109 (JSC::WREC::PatternCharacterSequence::PatternCharacterSequence):
2110 (JSC::WREC::PatternCharacterSequence::size):
2111 (JSC::WREC::PatternCharacterSequence::append):
2112 (JSC::WREC::PatternCharacterSequence::flush): Helper object for generating
2113 an optimized sequence of pattern characters.
2115 (JSC::WREC::Parser::parseNonCharacterEscape): Renamed to reflect the fact
2116 that the main parseAlternative loop handles character escapes.
2118 (JSC::WREC::Parser::parseAlternative): Moved pattern character sequence
2119 logic from parsePatternCharacterSequence to here, using
2120 PatternCharacterSequence to help with the details.
2122 * wrec/WRECParser.h: Updated for renames.
2124 2008-12-08 Alexey Proskuryakov <ap@webkit.org>
2126 Reviewed by Geoff Garen.
2128 <rdar://problem/6166088> Give JSGlobalContextCreate a behavior that is concurrency aware,
2131 * API/JSContextRef.cpp: (JSGlobalContextCreate):
2132 * API/JSContextRef.h:
2133 Use a unique context group for the context, unless the application was linked against old
2136 2008-12-08 Sam Weinig <sam@webkit.org>
2138 Reviewed by Cameron Zwarich.
2140 Fix for <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
2144 Remove use of jitReturnAddressVPCMap when looking for vPC to store Structures
2145 in for cached lookup. Instead, use the offset in the StructureStubInfo that is
2148 * bytecode/CodeBlock.cpp:
2149 (JSC::CodeBlock::dumpStatistics): Fix extraneous semicolon.
2150 * interpreter/Interpreter.cpp:
2151 (JSC::Interpreter::tryCTICachePutByID):
2152 (JSC::Interpreter::tryCTICacheGetByID):
2153 (JSC::Interpreter::cti_op_get_by_id_self_fail):
2154 (JSC::Interpreter::cti_op_get_by_id_proto_list):
2156 (JSC::JIT::compileGetByIdSelf):
2157 (JSC::JIT::compileGetByIdProto):
2158 (JSC::JIT::compileGetByIdChain):
2159 (JSC::JIT::compilePutByIdReplace):
2160 (JSC::JIT::compilePutByIdTransition):
2161 * jit/JITPropertyAccess.cpp:
2162 (JSC::JIT::privateCompilePutByIdTransition):
2163 (JSC::JIT::patchGetByIdSelf):
2164 (JSC::JIT::patchPutByIdReplace):
2165 (JSC::JIT::privateCompilePatchGetArrayLength): Remove extra call to getStubInfo.
2166 (JSC::JIT::privateCompileGetByIdSelf):
2167 (JSC::JIT::privateCompileGetByIdProto):
2168 (JSC::JIT::privateCompileGetByIdChain):
2169 (JSC::JIT::privateCompilePutByIdReplace):
2171 2008-12-08 Gavin Barraclough <barraclough@apple.com>
2173 Reviewed by Oliver Hunt.
2175 Port the op_j?n?eq_null JIT code generation to use the MacroAssembler,
2176 and clean up slightly at the same time. The 'j' forms currently compare,
2177 then set a register, then compare again, then branch. Branch directly on
2178 the result of the first compare.
2180 Around a 1% progression on deltablue, crypto & early boyer, for about 1/2%
2181 overall on v8-tests.
2184 (JSC::JIT::privateCompileMainPass):
2185 * jit/JITPropertyAccess.cpp:
2186 (JSC::JIT::compileGetByIdSlowCase):
2188 2008-12-08 Gavin Barraclough <barraclough@apple.com>
2190 Reviewed by Geoff Garen.
2192 Expand MacroAssembler to support more operations, required by the JIT.
2194 Generally adds more operations and permutations of operands to the existing
2195 interface. Rename 'jset' to 'jnz' and 'jnset' to 'jz', which seem clearer,
2196 and require that immediate pointer operands (though not pointer addresses to
2197 load and store instructions) are wrapped in a ImmPtr() type, akin to Imm32().
2199 No performance impact.
2201 * assembler/MacroAssembler.h:
2202 (JSC::MacroAssembler::):
2203 (JSC::MacroAssembler::ImmPtr::ImmPtr):
2204 (JSC::MacroAssembler::add32):
2205 (JSC::MacroAssembler::and32):
2206 (JSC::MacroAssembler::or32):
2207 (JSC::MacroAssembler::sub32):
2208 (JSC::MacroAssembler::xor32):
2209 (JSC::MacroAssembler::loadPtr):
2210 (JSC::MacroAssembler::load32):
2211 (JSC::MacroAssembler::storePtr):
2212 (JSC::MacroAssembler::store32):
2213 (JSC::MacroAssembler::poke):
2214 (JSC::MacroAssembler::move):
2215 (JSC::MacroAssembler::testImm32):
2216 (JSC::MacroAssembler::jae32):
2217 (JSC::MacroAssembler::jb32):
2218 (JSC::MacroAssembler::jePtr):
2219 (JSC::MacroAssembler::je32):
2220 (JSC::MacroAssembler::jnePtr):
2221 (JSC::MacroAssembler::jne32):
2222 (JSC::MacroAssembler::jnzPtr):
2223 (JSC::MacroAssembler::jnz32):
2224 (JSC::MacroAssembler::jzPtr):
2225 (JSC::MacroAssembler::jz32):
2226 (JSC::MacroAssembler::joSub32):
2227 (JSC::MacroAssembler::jump):
2228 (JSC::MacroAssembler::sete32):
2229 (JSC::MacroAssembler::setne32):
2230 (JSC::MacroAssembler::setnz32):
2231 (JSC::MacroAssembler::setz32):
2232 * assembler/X86Assembler.h:
2233 (JSC::X86Assembler::addl_mr):
2234 (JSC::X86Assembler::andl_i8r):
2235 (JSC::X86Assembler::cmpl_rm):
2236 (JSC::X86Assembler::cmpl_mr):
2237 (JSC::X86Assembler::cmpl_i8m):
2238 (JSC::X86Assembler::subl_mr):
2239 (JSC::X86Assembler::testl_i32m):
2240 (JSC::X86Assembler::xorl_i32r):
2241 (JSC::X86Assembler::movl_rm):
2242 (JSC::X86Assembler::modRm_opmsib):
2244 (JSC::JIT::privateCompileMainPass):
2245 * jit/JITInlineMethods.h:
2246 (JSC::JIT::emitGetVirtualRegister):
2247 (JSC::JIT::emitPutCTIArgConstant):
2248 (JSC::JIT::emitPutCTIParam):
2249 (JSC::JIT::emitPutImmediateToCallFrameHeader):
2250 (JSC::JIT::emitInitRegister):
2251 (JSC::JIT::checkStructure):
2252 (JSC::JIT::emitJumpIfJSCell):
2253 (JSC::JIT::emitJumpIfNotJSCell):
2254 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
2256 2008-12-08 Geoffrey Garen <ggaren@apple.com>
2258 Reviewed by Sam Weinig.
2260 Fixed a bug where WREC would allow a quantifier whose minimum was
2261 greater than its maximum.
2263 * wrec/Quantifier.h:
2264 (JSC::WREC::Quantifier::Quantifier): ASSERT that the quantifier is not
2267 * wrec/WRECParser.cpp:
2268 (JSC::WREC::Parser::consumeGreedyQuantifier): Verify that the minimum
2269 is not greater than the maximum.
2271 2008-12-08 Eric Seidel <eric@webkit.org>
2273 Build fix only, no review.
2275 * JavaScriptCore.scons: add bytecode/JumpTable.cpp
2277 2008-12-08 Sam Weinig <sam@webkit.org>
2279 Reviewed by Geoffrey Garen.
2281 Patch for https://bugs.webkit.org/show_bug.cgi?id=22716
2282 <rdar://problem/6428315>
2283 Add RareData structure to CodeBlock for infrequently used auxiliary data
2286 Reduces memory on Membuster-head by ~.5MB
2288 * bytecode/CodeBlock.cpp:
2289 (JSC::CodeBlock::dump):
2290 (JSC::CodeBlock::dumpStatistics):
2291 (JSC::CodeBlock::mark):
2292 (JSC::CodeBlock::getHandlerForVPC):
2293 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
2294 (JSC::CodeBlock::shrinkToFit):
2295 * bytecode/CodeBlock.h:
2296 (JSC::CodeBlock::numberOfExceptionHandlers):
2297 (JSC::CodeBlock::addExceptionHandler):
2298 (JSC::CodeBlock::exceptionHandler):
2299 (JSC::CodeBlock::addFunction):
2300 (JSC::CodeBlock::function):
2301 (JSC::CodeBlock::addUnexpectedConstant):
2302 (JSC::CodeBlock::unexpectedConstant):
2303 (JSC::CodeBlock::addRegExp):
2304 (JSC::CodeBlock::regexp):
2305 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
2306 (JSC::CodeBlock::addImmediateSwitchJumpTable):
2307 (JSC::CodeBlock::immediateSwitchJumpTable):
2308 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
2309 (JSC::CodeBlock::addCharacterSwitchJumpTable):
2310 (JSC::CodeBlock::characterSwitchJumpTable):
2311 (JSC::CodeBlock::numberOfStringSwitchJumpTables):
2312 (JSC::CodeBlock::addStringSwitchJumpTable):
2313 (JSC::CodeBlock::stringSwitchJumpTable):
2314 (JSC::CodeBlock::evalCodeCache):
2315 (JSC::CodeBlock::createRareDataIfNecessary):
2317 2008-11-26 Peter Kasting <pkasting@google.com>
2319 Reviewed by Anders Carlsson.
2321 https://bugs.webkit.org/show_bug.cgi?id=16814
2322 Allow ports to disable ActiveX->NPAPI conversion for Media Player.
2323 Improve handling of miscellaneous ActiveX objects.
2325 * wtf/Platform.h: Add another ENABLE(...).
2327 2008-12-08 Sam Weinig <sam@webkit.org>
2329 Reviewed by Mark Rowe.
2331 Add dumping of CodeBlock member structure usage.
2333 * bytecode/CodeBlock.cpp:
2334 (JSC::CodeBlock::dumpStatistics):
2335 * bytecode/EvalCodeCache.h:
2336 (JSC::EvalCodeCache::isEmpty):
2338 2008-12-08 David Kilzer <ddkilzer@apple.com>
2340 Bug 22555: Sort "children" sections in Xcode project files
2342 <https://bugs.webkit.org/show_bug.cgi?id=22555>
2344 Reviewed by Eric Seidel.
2346 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted.
2348 2008-12-08 Tony Chang <tony@chromium.org>
2350 Reviewed by Eric Seidel.
2352 Enable Pan scrolling only when building on PLATFORM(WIN_OS)
2353 Previously platforms like Apple Windows WebKit, Cairo Windows WebKit,
2354 Wx and Chromium were enabling it explicitly, now we just turn it on
2355 for all WIN_OS, later platforms can turn it off as needed on Windows
2356 (or turn it on under Linux, etc.)
2357 https://bugs.webkit.org/show_bug.cgi?id=22698
2361 2008-12-08 Sam Weinig <sam@webkit.org>
2363 Reviewed by Cameron Zwarich.
2365 Add basic memory statistics dumping for CodeBlock.
2367 * bytecode/CodeBlock.cpp:
2368 (JSC::CodeBlock::dumpStatistics):
2369 (JSC::CodeBlock::CodeBlock):
2370 (JSC::CodeBlock::~CodeBlock):
2371 * bytecode/CodeBlock.h:
2373 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
2375 Fix the Linux build with newer gcc/glibc.
2377 * jit/ExecutableAllocatorPosix.cpp: Include unistd.h for
2378 getpagesize(), according to
2379 http://opengroup.org/onlinepubs/007908775/xsh/getpagesize.html
2381 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
2383 Fix the build with Qt on Windows.
2385 * JavaScriptCore.pri: Compile ExecutableAllocatorWin.cpp on Windows.
2387 2008-12-07 Oliver Hunt <oliver@apple.com>
2389 Reviewed by NOBODY (Buildfix).
2393 * runtime/RegExp.cpp:
2394 (JSC::RegExp::RegExp):
2396 2008-12-07 Oliver Hunt <oliver@apple.com>
2398 Reviewed by NOBODY (Build fix).
2400 Put ENABLE(ASSEMBLER) guards around use of ExecutableAllocator in global data
2402 Correct Qt and Gtk project files
2405 * JavaScriptCore.pri:
2406 * runtime/JSGlobalData.h:
2408 2008-12-07 Oliver Hunt <oliver@apple.com>
2410 Reviewed by NOBODY (Build fix).
2412 Add new files to other projects.
2415 * JavaScriptCore.pri:
2416 * JavaScriptCore.pro:
2418 2008-12-07 Oliver Hunt <oliver@apple.com>
2420 Rubber stamped by Mark Rowe.
2422 Rename ExecutableAllocatorMMAP to the more sensible ExecutableAllocatorPosix
2424 * JavaScriptCore.xcodeproj/project.pbxproj:
2425 * jit/ExecutableAllocator.h:
2426 * jit/ExecutableAllocatorPosix.cpp: Renamed from JavaScriptCore/jit/ExecutableAllocatorMMAP.cpp.
2427 (JSC::ExecutableAllocator::intializePageSize):
2428 (JSC::ExecutablePool::systemAlloc):
2429 (JSC::ExecutablePool::systemRelease):
2431 2008-12-07 Oliver Hunt <oliver@apple.com>
2433 Reviewed by Cameron Zwarich and Sam Weinig
2435 <rdar://problem/6309878> Need more granular control over allocation of executable memory (21783)
2436 <https://bugs.webkit.org/show_bug.cgi?id=21783>
2438 Add a new allocator for use by the JIT that provides executable pages, so
2439 we can get rid of the current hack that makes the entire heap executable.
2441 1-2% progression on SunSpider-v8, 1% on SunSpider. Reduces memory usage as well!
2443 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2444 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2445 * JavaScriptCore.xcodeproj/project.pbxproj:
2446 * assembler/AssemblerBuffer.h:
2447 (JSC::AssemblerBuffer::size):
2448 (JSC::AssemblerBuffer::executableCopy):
2449 * assembler/MacroAssembler.h:
2450 (JSC::MacroAssembler::size):
2451 (JSC::MacroAssembler::copyCode):
2452 * assembler/X86Assembler.h:
2453 (JSC::X86Assembler::size):
2454 (JSC::X86Assembler::executableCopy):
2455 * bytecode/CodeBlock.cpp:
2456 (JSC::CodeBlock::~CodeBlock):
2457 * bytecode/CodeBlock.h:
2458 (JSC::CodeBlock::executablePool):
2459 (JSC::CodeBlock::setExecutablePool):
2460 * bytecode/Instruction.h:
2461 (JSC::PolymorphicAccessStructureList::derefStructures):
2462 * interpreter/Interpreter.cpp:
2463 (JSC::Interpreter::~Interpreter):
2464 * interpreter/Interpreter.h:
2465 * jit/ExecutableAllocator.cpp: Added.
2466 * jit/ExecutableAllocator.h: Added.
2467 (JSC::ExecutablePool::create):
2468 (JSC::ExecutablePool::alloc):
2469 (JSC::ExecutablePool::~ExecutablePool):
2470 (JSC::ExecutablePool::available):
2471 (JSC::ExecutablePool::ExecutablePool):
2472 (JSC::ExecutablePool::poolAllocate):
2473 (JSC::ExecutableAllocator::ExecutableAllocator):
2474 (JSC::ExecutableAllocator::poolForSize):
2475 (JSC::ExecutablePool::sizeForAllocation):
2476 * jit/ExecutableAllocatorMMAP.cpp: Added.
2477 (JSC::ExecutableAllocator::intializePageSize):
2478 (JSC::ExecutablePool::systemAlloc):
2479 (JSC::ExecutablePool::systemRelease):
2480 * jit/ExecutableAllocatorWin.cpp: Added.
2481 (JSC::ExecutableAllocator::intializePageSize):
2482 (JSC::ExecutablePool::systemAlloc):
2483 (JSC::ExecutablePool::systemRelease):
2485 (JSC::JIT::privateCompile):
2486 (JSC::JIT::privateCompileCTIMachineTrampolines):
2488 (JSC::JIT::compileCTIMachineTrampolines):
2489 * jit/JITPropertyAccess.cpp:
2490 (JSC::JIT::privateCompilePutByIdTransition):
2491 (JSC::JIT::privateCompilePatchGetArrayLength):
2492 (JSC::JIT::privateCompileGetByIdSelf):
2493 (JSC::JIT::privateCompileGetByIdProto):
2494 (JSC::JIT::privateCompileGetByIdSelfList):
2495 (JSC::JIT::privateCompileGetByIdProtoList):
2496 (JSC::JIT::privateCompileGetByIdChainList):
2497 (JSC::JIT::privateCompileGetByIdChain):
2498 (JSC::JIT::privateCompilePutByIdReplace):
2500 (JSC::RegExpNode::emitBytecode):
2501 * runtime/JSGlobalData.h:
2502 (JSC::JSGlobalData::poolForSize):
2503 * runtime/RegExp.cpp:
2504 (JSC::RegExp::RegExp):
2505 (JSC::RegExp::create):
2506 (JSC::RegExp::~RegExp):
2508 * runtime/RegExpConstructor.cpp:
2509 (JSC::constructRegExp):
2510 * runtime/RegExpPrototype.cpp:
2511 (JSC::regExpProtoFuncCompile):
2512 * runtime/StringPrototype.cpp:
2513 (JSC::stringProtoFuncMatch):
2514 (JSC::stringProtoFuncSearch):
2516 (JSC::WREC::Generator::compileRegExp):
2517 * wrec/WRECGenerator.h:
2518 * wtf/FastMalloc.cpp:
2520 * wtf/TCSystemAlloc.cpp:
2524 (TCMalloc_SystemRelease):
2526 2008-12-06 Sam Weinig <sam@webkit.org>
2530 * jit/JITPropertyAccess.cpp:
2531 (JSC::JIT::compileGetByIdHotPath):
2532 (JSC::JIT::compilePutByIdHotPath):
2534 2008-12-06 Sam Weinig <sam@webkit.org>
2536 Reviewed by Cameron Zwarich,
2538 Move CodeBlock constructor into the .cpp file.
2540 Sunspider reports a .7% progression, but I can only assume this
2543 * bytecode/CodeBlock.cpp:
2544 (JSC::CodeBlock::CodeBlock):
2545 * bytecode/CodeBlock.h:
2547 2008-12-06 Sam Weinig <sam@webkit.org>
2549 Reviewed by Cameron Zwarich.
2551 Split JumpTable code into its own file.
2554 * JavaScriptCore.pri:
2555 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2556 * JavaScriptCore.xcodeproj/project.pbxproj:
2557 * JavaScriptCoreSources.bkl:
2558 * bytecode/CodeBlock.cpp:
2559 * bytecode/CodeBlock.h:
2560 * bytecode/JumpTable.cpp: Copied from bytecode/CodeBlock.cpp.
2561 * bytecode/JumpTable.h: Copied from bytecode/CodeBlock.h.
2563 2008-12-05 Sam Weinig <sam@webkit.org>
2565 Reviewed by Cameron Zwarich.
2567 Fix for https://bugs.webkit.org/show_bug.cgi?id=22715
2568 Encapsulate more CodeBlock members in preparation
2569 of moving some of them to a rare data structure.
2571 * bytecode/CodeBlock.cpp:
2572 (JSC::locationForOffset):
2573 (JSC::printConditionalJump):
2574 (JSC::printGetByIdOp):
2575 (JSC::printPutByIdOp):
2576 (JSC::CodeBlock::printStructure):
2577 (JSC::CodeBlock::printStructures):
2578 (JSC::CodeBlock::dump):
2579 (JSC::CodeBlock::~CodeBlock):
2580 (JSC::CodeBlock::unlinkCallers):
2581 (JSC::CodeBlock::derefStructures):
2582 (JSC::CodeBlock::refStructures):
2583 (JSC::CodeBlock::mark):
2584 (JSC::CodeBlock::getHandlerForVPC):
2585 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
2586 (JSC::CodeBlock::lineNumberForVPC):
2587 (JSC::CodeBlock::expressionRangeForVPC):
2588 (JSC::CodeBlock::shrinkToFit):
2589 * bytecode/CodeBlock.h:
2590 (JSC::CodeBlock::CodeBlock):
2591 (JSC::CodeBlock::addCaller):
2592 (JSC::CodeBlock::removeCaller):
2593 (JSC::CodeBlock::isKnownNotImmediate):
2594 (JSC::CodeBlock::isConstantRegisterIndex):
2595 (JSC::CodeBlock::getConstant):
2596 (JSC::CodeBlock::isTemporaryRegisterIndex):
2597 (JSC::CodeBlock::getStubInfo):
2598 (JSC::CodeBlock::getCallLinkInfo):
2599 (JSC::CodeBlock::instructions):
2600 (JSC::CodeBlock::setJITCode):
2601 (JSC::CodeBlock::jitCode):
2602 (JSC::CodeBlock::ownerNode):
2603 (JSC::CodeBlock::setGlobalData):
2604 (JSC::CodeBlock::setThisRegister):
2605 (JSC::CodeBlock::thisRegister):
2606 (JSC::CodeBlock::setNeedsFullScopeChain):
2607 (JSC::CodeBlock::needsFullScopeChain):
2608 (JSC::CodeBlock::setUsesEval):
2609 (JSC::CodeBlock::usesEval):
2610 (JSC::CodeBlock::setUsesArguments):
2611 (JSC::CodeBlock::usesArguments):
2612 (JSC::CodeBlock::codeType):
2613 (JSC::CodeBlock::source):
2614 (JSC::CodeBlock::sourceOffset):
2615 (JSC::CodeBlock::addGlobalResolveInstruction):
2616 (JSC::CodeBlock::numberOfPropertyAccessInstructions):
2617 (JSC::CodeBlock::addPropertyAccessInstruction):
2618 (JSC::CodeBlock::propertyAccessInstruction):
2619 (JSC::CodeBlock::numberOfCallLinkInfos):
2620 (JSC::CodeBlock::addCallLinkInfo):
2621 (JSC::CodeBlock::callLinkInfo):
2622 (JSC::CodeBlock::numberOfJumpTargets):
2623 (JSC::CodeBlock::addJumpTarget):
2624 (JSC::CodeBlock::jumpTarget):
2625 (JSC::CodeBlock::lastJumpTarget):
2626 (JSC::CodeBlock::numberOfExceptionHandlers):
2627 (JSC::CodeBlock::addExceptionHandler):
2628 (JSC::CodeBlock::exceptionHandler):
2629 (JSC::CodeBlock::addExpressionInfo):
2630 (JSC::CodeBlock::numberOfLineInfos):
2631 (JSC::CodeBlock::addLineInfo):
2632 (JSC::CodeBlock::lastLineInfo):
2633 (JSC::CodeBlock::jitReturnAddressVPCMap):
2634 (JSC::CodeBlock::numberOfIdentifiers):
2635 (JSC::CodeBlock::addIdentifier):
2636 (JSC::CodeBlock::identifier):
2637 (JSC::CodeBlock::numberOfConstantRegisters):
2638 (JSC::CodeBlock::addConstantRegister):
2639 (JSC::CodeBlock::constantRegister):
2640 (JSC::CodeBlock::addFunction):
2641 (JSC::CodeBlock::function):
2642 (JSC::CodeBlock::addFunctionExpression):
2643 (JSC::CodeBlock::functionExpression):
2644 (JSC::CodeBlock::addUnexpectedConstant):
2645 (JSC::CodeBlock::unexpectedConstant):
2646 (JSC::CodeBlock::addRegExp):
2647 (JSC::CodeBlock::regexp):
2648 (JSC::CodeBlock::symbolTable):
2649 (JSC::CodeBlock::evalCodeCache):
2650 New inline setters/getters.
2652 (JSC::ProgramCodeBlock::ProgramCodeBlock):
2653 (JSC::ProgramCodeBlock::~ProgramCodeBlock):
2654 (JSC::ProgramCodeBlock::clearGlobalObject):
2655 * bytecode/SamplingTool.cpp:
2656 (JSC::ScopeSampleRecord::sample):
2657 (JSC::SamplingTool::dump):
2658 * bytecompiler/BytecodeGenerator.cpp:
2659 * bytecompiler/BytecodeGenerator.h:
2660 * bytecompiler/Label.h:
2661 * interpreter/CallFrame.cpp:
2662 * interpreter/Interpreter.cpp:
2665 * jit/JITInlineMethods.h:
2666 * jit/JITPropertyAccess.cpp:
2668 * runtime/Arguments.h:
2669 * runtime/ExceptionHelpers.cpp:
2670 * runtime/JSActivation.cpp:
2671 * runtime/JSActivation.h:
2672 * runtime/JSGlobalObject.cpp:
2673 Change direct access to use new getter/setters.
2675 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2677 Reviewed by Oliver Hunt.
2679 Prevent GCC4.2 from hanging when trying to compile Interpreter.cpp.
2680 Added "-fno-var-tracking" compiler flag.
2682 https://bugs.webkit.org/show_bug.cgi?id=22704
2684 * JavaScriptCore.xcodeproj/project.pbxproj:
2686 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2688 Reviewed by Oliver Hunt.
2690 Ordering of branch operands in MacroAssembler in unnecessarily inconsistent.
2692 je, jg etc take an immediate operand as the second argument, but for the
2693 equality branches (je, jne) the immediate operand was the first argument. This
2694 was unnecessarily inconsistent. Change je, jne methods to take the immediate
2695 as the second argument.
2697 https://bugs.webkit.org/show_bug.cgi?id=22703
2699 * assembler/MacroAssembler.h:
2700 (JSC::MacroAssembler::je32):
2701 (JSC::MacroAssembler::jne32):
2703 (JSC::JIT::compileOpStrictEq):
2704 * wrec/WRECGenerator.cpp:
2705 (JSC::WREC::Generator::generateEnter):
2706 (JSC::WREC::Generator::generateNonGreedyQuantifier):
2707 (JSC::WREC::Generator::generateGreedyQuantifier):
2708 (JSC::WREC::Generator::generatePatternCharacterPair):
2709 (JSC::WREC::Generator::generatePatternCharacter):
2710 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
2711 (JSC::WREC::Generator::generateCharacterClassInverted):
2712 (JSC::WREC::Generator::generateAssertionBOL):
2713 (JSC::WREC::Generator::generateAssertionWordBoundary):
2715 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2717 Reviewed by Geoff Garen.
2719 Second tranche of porting JIT.cpp to MacroAssembler interface.
2721 * assembler/MacroAssembler.h:
2722 (JSC::MacroAssembler::mul32):
2723 (JSC::MacroAssembler::jl32):
2724 (JSC::MacroAssembler::jnzSub32):
2725 (JSC::MacroAssembler::joAdd32):
2726 (JSC::MacroAssembler::joMul32):
2727 (JSC::MacroAssembler::jzSub32):
2729 (JSC::JIT::emitSlowScriptCheck):
2730 (JSC::JIT::privateCompileMainPass):
2731 (JSC::JIT::privateCompileSlowCases):
2732 (JSC::JIT::privateCompileCTIMachineTrampolines):
2734 * jit/JITInlineMethods.h:
2735 (JSC::JIT::emitJumpIfNotJSCell):
2736 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
2738 2008-12-05 David Kilzer <ddkilzer@apple.com>
2740 Bug 22609: Provide a build-time choice when generating hash tables for properties of built-in DOM objects
2742 <https://bugs.webkit.org/show_bug.cgi?id=22609>
2743 <rdar://problem/6331749>
2745 Reviewed by Darin Adler.
2747 Initial patch by Yosen Lin. Adapted for ToT WebKit by David Kilzer.
2749 Added back the code that generates a "compact" hash (instead of a
2750 perfect hash) as a build-time option using the
2751 ENABLE(PERFECT_HASH_SIZE) macro as defined in Lookup.h.
2753 * create_hash_table: Rename variables to differentiate perfect hash
2754 values from compact hash values. Added back code to compute compact
2755 hash tables. Generate both hash table sizes and emit
2756 conditionalized code based on ENABLE(PERFECT_HASH_SIZE).
2757 * runtime/Lookup.cpp:
2758 (JSC::HashTable::createTable): Added version of createTable() for
2759 use with compact hash tables.
2760 (JSC::HashTable::deleteTable): Updated to work with compact hash
2762 * runtime/Lookup.h: Defined ENABLE(PERFECT_HASH_SIZE) macro here.
2763 (JSC::HashEntry::initialize): Set m_next to zero when using compact
2765 (JSC::HashEntry::setNext): Added for compact hash tables.
2766 (JSC::HashEntry::next): Added for compact hash tables.
2767 (JSC::HashTable::entry): Added version of entry() for use with
2768 compact hash tables.
2769 * runtime/Structure.cpp:
2770 (JSC::Structure::getEnumerablePropertyNames): Updated to work with
2771 compact hash tables.
2773 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2775 Reviewed by Geoff Garen.
2777 Remove redundant calls to JIT::emitSlowScriptCheck.
2778 This is checked in the hot path, so is not needed on the slow path - and the code
2779 was being planted before the start of the slow case, so was completely unreachable!
2782 (JSC::JIT::privateCompileSlowCases):
2784 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2786 Reviewed by Geoff Garen.
2788 Move JIT::compileOpStrictEq to MacroAssembler interface.
2790 The rewrite also looks like a small (<1%) performance progression.
2792 https://bugs.webkit.org/show_bug.cgi?id=22697
2795 (JSC::JIT::compileOpStrictEq):
2796 (JSC::JIT::privateCompileSlowCases):
2798 * jit/JITInlineMethods.h:
2799 (JSC::JIT::emitJumpIfJSCell):
2800 (JSC::JIT::emitJumpSlowCaseIfJSCell):
2802 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2804 Reviewed by Geoff Garen.
2806 Remove m_assembler from MacroAssembler::Jump.
2807 Keeping a pointer allowed for some syntactic sugar - "link()" looks nicer
2808 than "link(this)". But maintaining this doubles the size of Jump, which
2809 is even more unfortunate for the JIT, since there are many large structures
2810 holding JmpSrcs. Probably best to remove it.
2812 https://bugs.webkit.org/show_bug.cgi?id=22693
2814 * assembler/MacroAssembler.h:
2815 (JSC::MacroAssembler::Jump::Jump):
2816 (JSC::MacroAssembler::Jump::link):
2817 (JSC::MacroAssembler::Jump::linkTo):
2818 (JSC::MacroAssembler::JumpList::link):
2819 (JSC::MacroAssembler::JumpList::linkTo):
2820 (JSC::MacroAssembler::jae32):
2821 (JSC::MacroAssembler::je32):
2822 (JSC::MacroAssembler::je16):
2823 (JSC::MacroAssembler::jg32):
2824 (JSC::MacroAssembler::jge32):
2825 (JSC::MacroAssembler::jl32):
2826 (JSC::MacroAssembler::jle32):
2827 (JSC::MacroAssembler::jnePtr):
2828 (JSC::MacroAssembler::jne32):
2829 (JSC::MacroAssembler::jnset32):
2830 (JSC::MacroAssembler::jset32):
2831 (JSC::MacroAssembler::jump):
2832 (JSC::MacroAssembler::jzSub32):
2833 (JSC::MacroAssembler::joAdd32):
2834 (JSC::MacroAssembler::call):
2836 (JSC::WREC::Generator::compileRegExp):
2837 * wrec/WRECGenerator.cpp:
2838 (JSC::WREC::Generator::generateEnter):
2839 (JSC::WREC::Generator::generateBackreferenceQuantifier):
2840 (JSC::WREC::Generator::generateNonGreedyQuantifier):
2841 (JSC::WREC::Generator::generateGreedyQuantifier):
2842 (JSC::WREC::Generator::generatePatternCharacter):
2843 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
2844 (JSC::WREC::Generator::generateCharacterClassInverted):
2845 (JSC::WREC::Generator::generateCharacterClass):
2846 (JSC::WREC::Generator::generateParenthesesAssertion):
2847 (JSC::WREC::Generator::generateParenthesesInvertedAssertion):
2848 (JSC::WREC::Generator::generateParenthesesNonGreedy):
2849 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
2850 (JSC::WREC::Generator::generateAssertionBOL):
2851 (JSC::WREC::Generator::generateAssertionEOL):
2852 (JSC::WREC::Generator::generateAssertionWordBoundary):
2853 (JSC::WREC::Generator::generateBackreference):
2854 (JSC::WREC::Generator::terminateAlternative):
2855 (JSC::WREC::Generator::terminateDisjunction):
2856 * wrec/WRECParser.h:
2858 2008-12-05 Gavin Barraclough <barraclough@apple.com>
2860 Reviewed by Geoffrey Garen.
2862 Simplify JIT generated checks for timeout code, by moving more work into the C function.
2863 https://bugs.webkit.org/show_bug.cgi?id=22688
2865 * interpreter/Interpreter.cpp:
2866 (JSC::Interpreter::cti_timeout_check):
2867 * interpreter/Interpreter.h:
2869 (JSC::JIT::emitSlowScriptCheck):
2871 2008-12-05 Sam Weinig <sam@webkit.org>
2873 Reviewed by Geoffrey Garen.
2875 Encapsulate access to jump tables in the CodeBlock in preparation
2876 of moving them to a rare data structure.
2878 * bytecode/CodeBlock.cpp:
2879 (JSC::CodeBlock::dump):
2880 (JSC::CodeBlock::shrinkToFit):
2881 * bytecode/CodeBlock.h:
2882 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
2883 (JSC::CodeBlock::addImmediateSwitchJumpTable):
2884 (JSC::CodeBlock::immediateSwitchJumpTable):
2885 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
2886 (JSC::CodeBlock::addCharacterSwitchJumpTable):
2887 (JSC::CodeBlock::characterSwitchJumpTable):
2888 (JSC::CodeBlock::numberOfStringSwitchJumpTables):
2889 (JSC::CodeBlock::addStringSwitchJumpTable):
2890 (JSC::CodeBlock::stringSwitchJumpTable):
2891 * bytecompiler/BytecodeGenerator.cpp:
2892 (JSC::BytecodeGenerator::generate):
2893 (JSC::BytecodeGenerator::endSwitch):
2894 * interpreter/Interpreter.cpp:
2895 (JSC::Interpreter::privateExecute):
2896 (JSC::Interpreter::cti_op_switch_imm):
2897 (JSC::Interpreter::cti_op_switch_char):
2898 (JSC::Interpreter::cti_op_switch_string):
2900 (JSC::JIT::privateCompileMainPass):
2902 2008-12-05 Adam Roben <aroben@apple.com>
2904 Windows build fix after r39020
2906 * jit/JITInlineMethods.h:
2907 (JSC::JIT::restoreArgumentReference):
2908 (JSC::JIT::restoreArgumentReferenceForTrampoline):
2909 Add some apparently-missing __.
2911 2008-12-04 Geoffrey Garen <ggaren@apple.com>
2913 Reviewed by Darin Adler.
2915 https://bugs.webkit.org/show_bug.cgi?id=22673
2917 Added support for the assertion (?=) and inverted assertion (?!) atoms
2920 * wrec/WRECGenerator.cpp:
2921 (JSC::WREC::Generator::generateParenthesesAssertion):
2922 (JSC::WREC::Generator::generateParenthesesInvertedAssertion): Split the
2923 old (unused) generateParentheses into these two functions, with more
2924 limited capabilities.
2926 * wrec/WRECGenerator.h:
2927 (JSC::WREC::Generator::): Moved an enum to the top of the class definition,
2928 to match the WebKit style, and removed a defunct comment.
2930 * wrec/WRECParser.cpp:
2931 (JSC::WREC::Parser::parseParentheses):
2932 (JSC::WREC::Parser::consumeParenthesesType):
2933 * wrec/WRECParser.h:
2934 (JSC::WREC::Parser::): Added support for parsing (?=) and (?!).
2936 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
2938 Rubber-stamped by Tor Arne Vestbø.
2940 Disable the JIT for the Qt build alltogether again, after observing
2941 more miscompilations in a wider range of newer gcc versions.
2943 * JavaScriptCore.pri:
2945 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
2947 Reviewed by Tor Arne Vestbø.
2949 Disable the JIT for the Qt build on Linux unless gcc is >= 4.2,
2950 due to miscompilations.
2952 * JavaScriptCore.pri:
2954 2008-12-04 Gavin Barraclough <barraclough@apple.com>
2956 Reviewed by Geoff Garen.
2958 Start porting the JIT to use the MacroAssembler.
2960 https://bugs.webkit.org/show_bug.cgi?id=22671
2961 No change in performance.
2963 * assembler/MacroAssembler.h:
2964 (JSC::MacroAssembler::Jump::operator X86Assembler::JmpSrc):
2965 (JSC::MacroAssembler::add32):
2966 (JSC::MacroAssembler::and32):
2967 (JSC::MacroAssembler::lshift32):
2968 (JSC::MacroAssembler::rshift32):
2969 (JSC::MacroAssembler::storePtr):
2970 (JSC::MacroAssembler::store32):
2971 (JSC::MacroAssembler::poke):
2972 (JSC::MacroAssembler::move):
2973 (JSC::MacroAssembler::compareImm32ForBranchEquality):
2974 (JSC::MacroAssembler::jnePtr):
2975 (JSC::MacroAssembler::jnset32):
2976 (JSC::MacroAssembler::jset32):
2977 (JSC::MacroAssembler::jzeroSub32):
2978 (JSC::MacroAssembler::joverAdd32):
2979 (JSC::MacroAssembler::call):
2980 * assembler/X86Assembler.h:
2981 (JSC::X86Assembler::shll_i8r):
2983 (JSC::JIT::privateCompileMainPass):
2984 (JSC::JIT::privateCompile):
2985 (JSC::JIT::privateCompileCTIMachineTrampolines):
2987 * jit/JITArithmetic.cpp:
2988 (JSC::JIT::compileBinaryArithOp):
2989 * jit/JITInlineMethods.h:
2990 (JSC::JIT::emitGetVirtualRegister):
2991 (JSC::JIT::emitPutCTIArg):
2992 (JSC::JIT::emitPutCTIArgConstant):
2993 (JSC::JIT::emitGetCTIArg):
2994 (JSC::JIT::emitPutCTIArgFromVirtualRegister):
2995 (JSC::JIT::emitPutCTIParam):
2996 (JSC::JIT::emitGetCTIParam):
2997 (JSC::JIT::emitPutToCallFrameHeader):
2998 (JSC::JIT::emitPutImmediateToCallFrameHeader):
2999 (JSC::JIT::emitGetFromCallFrameHeader):
3000 (JSC::JIT::emitPutVirtualRegister):
3001 (JSC::JIT::emitInitRegister):
3002 (JSC::JIT::emitNakedCall):
3003 (JSC::JIT::restoreArgumentReference):
3004 (JSC::JIT::restoreArgumentReferenceForTrampoline):
3005 (JSC::JIT::emitCTICall):
3006 (JSC::JIT::checkStructure):
3007 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
3008 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
3009 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
3010 (JSC::JIT::emitFastArithDeTagImmediate):
3011 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
3012 (JSC::JIT::emitFastArithReTagImmediate):
3013 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
3014 (JSC::JIT::emitFastArithImmToInt):
3015 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
3016 (JSC::JIT::emitFastArithIntToImmNoCheck):
3017 (JSC::JIT::emitTagAsBoolImmediate):
3018 * jit/JITPropertyAccess.cpp:
3019 (JSC::JIT::privateCompilePutByIdTransition):
3021 2008-12-04 Geoffrey Garen <ggaren@apple.com>
3023 Reviewed by Oliver Hunt.
3025 Some refactoring for generateGreedyQuantifier.
3027 SunSpider reports no change (possibly a 0.3% speedup).
3029 * wrec/WRECGenerator.cpp:
3030 (JSC::WREC::Generator::generateGreedyQuantifier): Clarified label
3031 meanings and unified some logic to simplify things.
3033 * wrec/WRECParser.h:
3034 (JSC::WREC::Parser::parseAlternative): Added a version of parseAlternative
3035 that can jump to a Label, instead of a JumpList, upon failure. (Eventually,
3036 when we have a true Label class, this will be redundant.) This makes
3037 things easier for generateGreedyQuantifier, because it can avoid
3038 explicitly linking things.
3040 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
3042 Reviewed by Holger Freyther.
3044 Fix crashes in the Qt build on Linux/i386 with non-executable memory
3045 by enabling TCSystemAlloc and the PROT_EXEC flag for mmap.
3047 * JavaScriptCore.pri: Enable the use of TCSystemAlloc if the JIT is
3049 * wtf/TCSystemAlloc.cpp: Extend the PROT_EXEC permissions to
3052 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
3054 Reviewed by Tor Arne Vestbø.
3056 Enable ENABLE_JIT_OPTIMIZE_CALL, ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
3057 and ENABLE_JIT_OPTIMIZE_ARITHMETIC, as suggested by Niko.
3059 * JavaScriptCore.pri:
3061 2008-12-04 Kent Hansen <khansen@trolltech.com>
3063 Reviewed by Simon Hausmann.
3065 Enable the JSC jit for the Qt build by default for release builds on
3066 linux-g++ and win32-msvc.
3068 * JavaScriptCore.pri:
3070 2008-12-04 Gavin Barraclough <barraclough@apple.com>
3072 Reviewed by Oliver Hunt.
3074 Allow JIT to function without property access repatching and arithmetic optimizations.
3075 Controlled by ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS and ENABLE_JIT_OPTIMIZE_ARITHMETIC switches.
3077 https://bugs.webkit.org/show_bug.cgi?id=22643
3079 * JavaScriptCore.xcodeproj/project.pbxproj:
3081 (JSC::JIT::privateCompileMainPass):
3082 (JSC::JIT::privateCompileSlowCases):
3084 * jit/JITArithmetic.cpp: Copied from jit/JIT.cpp.
3085 (JSC::JIT::compileBinaryArithOp):
3086 (JSC::JIT::compileBinaryArithOpSlowCase):
3087 * jit/JITPropertyAccess.cpp: Copied from jit/JIT.cpp.
3088 (JSC::JIT::compileGetByIdHotPath):
3089 (JSC::JIT::compileGetByIdSlowCase):
3090 (JSC::JIT::compilePutByIdHotPath):
3091 (JSC::JIT::compilePutByIdSlowCase):
3092 (JSC::resizePropertyStorage):
3093 (JSC::transitionWillNeedStorageRealloc):
3094 (JSC::JIT::privateCompilePutByIdTransition):
3095 (JSC::JIT::patchGetByIdSelf):
3096 (JSC::JIT::patchPutByIdReplace):
3097 (JSC::JIT::privateCompilePatchGetArrayLength):
3100 2008-12-03 Geoffrey Garen <ggaren@apple.com>
3102 Reviewed by Oliver Hunt.
3104 Optimized sequences of characters in regular expressions by comparing
3105 two characters at a time.
3107 1-2% speedup on SunSpider, 19-25% speedup on regexp-dna.
3109 * assembler/MacroAssembler.h:
3110 (JSC::MacroAssembler::load32):
3111 (JSC::MacroAssembler::jge32): Filled out a few more macro methods.
3113 * assembler/X86Assembler.h:
3114 (JSC::X86Assembler::movl_mr): Added a verion of movl_mr that operates
3115 without an offset, to allow the macro assembler to optmize for that case.
3118 (JSC::WREC::Generator::compileRegExp): Test the saved value of index
3119 instead of the index register when checking for "end of input." The
3120 index register doesn't increment by 1 in an orderly fashion, so testing
3121 it for == "end of input" is not valid.
3123 Also, jump all the way to "return failure" upon reaching "end of input,"
3124 instead of executing the next alternative. This is more logical, and
3125 it's a slight optimization in the case of an expression with many alternatives.
3127 * wrec/WRECGenerator.cpp:
3128 (JSC::WREC::Generator::generateIncrementIndex): Added support for
3129 jumping to a failure label in the case where the index has reached "end
3132 (JSC::WREC::Generator::generatePatternCharacterSequence):
3133 (JSC::WREC::Generator::generatePatternCharacterPair): This is the
3134 optmization. It's basically like generatePatternCharacter, but it runs two
3135 characters at a time.
3137 (JSC::WREC::Generator::generatePatternCharacter): Changed to use isASCII,
3138 since it's clearer than comparing to a magic hex value.
3140 * wrec/WRECGenerator.h:
3142 2008-12-03 Gavin Barraclough <barraclough@apple.com>
3144 Reviewed by Cameron Zwarich.
3146 Allow JIT to operate without the call-repatching optimization.
3147 Controlled by ENABLE(JIT_OPTIMIZE_CALL), defaults on, disabling
3148 this leads to significant performance regression.
3150 https://bugs.webkit.org/show_bug.cgi?id=22639
3152 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3153 * JavaScriptCore.xcodeproj/project.pbxproj:
3155 (JSC::JIT::privateCompileSlowCases):
3157 * jit/JITCall.cpp: Copied from jit/JIT.cpp.
3158 (JSC::JIT::compileOpCallInitializeCallFrame):
3159 (JSC::JIT::compileOpCallSetupArgs):
3160 (JSC::JIT::compileOpCallEvalSetupArgs):
3161 (JSC::JIT::compileOpConstructSetupArgs):
3162 (JSC::JIT::compileOpCall):
3163 (JSC::JIT::compileOpCallSlowCase):
3165 * jit/JITInlineMethods.h: Copied from jit/JIT.cpp.
3166 (JSC::JIT::checkStructure):
3167 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
3168 (JSC::JIT::emitTagAsBoolImmediate):
3171 2008-12-03 Eric Seidel <eric@webkit.org>
3173 Rubber-stamped by David Hyatt.
3175 Make HAVE_ACCESSIBILITY only define if !defined
3179 2008-12-03 Sam Weinig <sam@webkit.org>
3183 * assembler/X86Assembler.h:
3184 (JSC::X86Assembler::orl_i32r):
3186 2008-12-03 Sam Weinig <sam@webkit.org>
3188 Reviewed by Geoffrey Garen.
3190 Remove shared AssemblerBuffer 1MB buffer and instead give AssemblerBuffer
3191 an 256 byte inline capacity.
3193 1% progression on Sunspider.
3195 * assembler/AssemblerBuffer.h:
3196 (JSC::AssemblerBuffer::AssemblerBuffer):
3197 (JSC::AssemblerBuffer::~AssemblerBuffer):
3198 (JSC::AssemblerBuffer::grow):
3199 * assembler/MacroAssembler.h:
3200 (JSC::MacroAssembler::MacroAssembler):
3201 * assembler/X86Assembler.h:
3202 (JSC::X86Assembler::X86Assembler):
3203 * interpreter/Interpreter.cpp:
3204 (JSC::Interpreter::Interpreter):
3205 * interpreter/Interpreter.h:
3209 (JSC::RegExpNode::emitBytecode):
3210 * runtime/RegExp.cpp:
3211 (JSC::RegExp::RegExp):
3212 (JSC::RegExp::create):
3214 * runtime/RegExpConstructor.cpp:
3215 (JSC::constructRegExp):
3216 * runtime/RegExpPrototype.cpp:
3217 (JSC::regExpProtoFuncCompile):
3218 * runtime/StringPrototype.cpp:
3219 (JSC::stringProtoFuncMatch):
3220 (JSC::stringProtoFuncSearch):
3222 (JSC::WREC::Generator::compileRegExp):
3223 * wrec/WRECGenerator.h:
3224 (JSC::WREC::Generator::Generator):
3225 * wrec/WRECParser.h:
3226 (JSC::WREC::Parser::Parser):
3228 2008-12-03 Geoffrey Garen <ggaren@apple.com>
3230 Reviewed by Oliver Hunt, with help from Gavin Barraclough.
3232 orl_i32r was actually coded as an 8bit OR. So, I renamed orl_i32r to
3233 orl_i8r, changed all orl_i32r clients to use orl_i8r, and then added
3234 a new orl_i32r that actually does a 32bit OR.
3236 (32bit OR is currently unused, but a patch I'm working on uses it.)
3238 * assembler/MacroAssembler.h:
3239 (JSC::MacroAssembler::or32): Updated to choose between 8bit and 32bit OR.
3241 * assembler/X86Assembler.h:
3242 (JSC::X86Assembler::orl_i8r): The old orl_i32r.
3243 (JSC::X86Assembler::orl_i32r): The new orl_i32r.
3246 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
3247 (JSC::JIT::emitTagAsBoolImmediate): Use orl_i8r, since we're ORing 8bit
3250 2008-12-03 Dean Jackson <dino@apple.com>
3252 Reviewed by Dan Bernstein.
3254 Helper functions for turn -> degrees.
3255 https://bugs.webkit.org/show_bug.cgi?id=22497
3261 2008-12-02 Cameron Zwarich <zwarich@apple.com>
3263 Reviewed by Geoff Garen.
3265 Bug 22504: Crashes during code generation occur due to refing of ignoredResult()
3266 <https://bugs.webkit.org/show_bug.cgi?id=22504>
3268 Since ignoredResult() was implemented by casting 1 to a RegisterID*, any
3269 attempt to ref ignoredResult() results in a crash. This will occur in
3270 code generation of a function body where a node emits another node with
3271 the dst that was passed to it, and then refs the returned RegisterID*.
3273 To fix this problem, make ignoredResult() a member function of
3274 BytecodeGenerator that simply returns a pointe to a fixed RegisterID
3275 member of BytecodeGenerator.
3277 * bytecompiler/BytecodeGenerator.h:
3278 (JSC::BytecodeGenerator::ignoredResult):
3279 * bytecompiler/RegisterID.h:
3281 (JSC::NullNode::emitBytecode):
3282 (JSC::BooleanNode::emitBytecode):
3283 (JSC::NumberNode::emitBytecode):
3284 (JSC::StringNode::emitBytecode):
3285 (JSC::RegExpNode::emitBytecode):
3286 (JSC::ThisNode::emitBytecode):
3287 (JSC::ResolveNode::emitBytecode):
3288 (JSC::ObjectLiteralNode::emitBytecode):
3289 (JSC::PostfixResolveNode::emitBytecode):
3290 (JSC::PostfixBracketNode::emitBytecode):
3291 (JSC::PostfixDotNode::emitBytecode):
3292 (JSC::DeleteValueNode::emitBytecode):
3293 (JSC::VoidNode::emitBytecode):
3294 (JSC::TypeOfResolveNode::emitBytecode):
3295 (JSC::TypeOfValueNode::emitBytecode):
3296 (JSC::PrefixResolveNode::emitBytecode):
3297 (JSC::AssignResolveNode::emitBytecode):
3298 (JSC::CommaNode::emitBytecode):
3299 (JSC::ForNode::emitBytecode):
3300 (JSC::ForInNode::emitBytecode):
3301 (JSC::ReturnNode::emitBytecode):
3302 (JSC::ThrowNode::emitBytecode):
3303 (JSC::FunctionBodyNode::emitBytecode):
3304 (JSC::FuncDeclNode::emitBytecode):
3306 2008-12-02 Geoffrey Garen <ggaren@apple.com>
3308 Reviewed by Cameron Zwarich.
3310 Fixed https://bugs.webkit.org/show_bug.cgi?id=22537
3311 REGRESSION (r38745): Assertion failure in jsSubstring() at ge.com
3313 The bug was that index would become greater than length, so our
3314 "end of input" checks, which all check "index == length", would fail.
3316 The solution is to check for end of input before incrementing index,
3317 to ensure that index is always <= length.
3319 As a side benefit, generateJumpIfEndOfInput can now use je instead of
3320 jg, which should be slightly faster.
3323 (JSC::WREC::Generator::compileRegExp):
3324 * wrec/WRECGenerator.cpp:
3325 (JSC::WREC::Generator::generateJumpIfEndOfInput):
3327 2008-12-02 Gavin Barraclough <barraclough@apple.com>
3329 Reviewed by Geoffrey Garen.
3331 Plant shift right immediate instructions, which are awesome.
3332 https://bugs.webkit.org/show_bug.cgi?id=22610
3333 ~5% on the v8-crypto test.
3336 (JSC::JIT::privateCompileMainPass):
3337 (JSC::JIT::privateCompileSlowCases):
3339 2008-12-02 Geoffrey Garen <ggaren@apple.com>
3341 Reviewed by Sam Weinig.
3343 Cleaned up SegmentedVector by abstracting segment access into helper
3346 SunSpider reports no change.
3348 * bytecompiler/SegmentedVector.h:
3349 (JSC::SegmentedVector::SegmentedVector):
3350 (JSC::SegmentedVector::~SegmentedVector):
3351 (JSC::SegmentedVector::size):
3352 (JSC::SegmentedVector::at):
3353 (JSC::SegmentedVector::operator[]):
3354 (JSC::SegmentedVector::last):
3355 (JSC::SegmentedVector::append):
3356 (JSC::SegmentedVector::removeLast):
3357 (JSC::SegmentedVector::grow):
3358 (JSC::SegmentedVector::clear):
3359 (JSC::SegmentedVector::deleteAllSegments):
3360 (JSC::SegmentedVector::segmentFor):
3361 (JSC::SegmentedVector::subscriptFor):
3362 (JSC::SegmentedVector::ensureSegmentsFor):
3363 (JSC::SegmentedVector::ensureSegment):
3365 2008-12-02 Geoffrey Garen <ggaren@apple.com>
3367 Reviewed by Geoffrey Garen. (Patch by Cameron Zwarich <zwarich@apple.com>.)
3369 Fixed https://bugs.webkit.org/show_bug.cgi?id=22482
3370 REGRESSION (r37991): Occasionally see "Scene rendered incorrectly"
3371 message when running the V8 Raytrace benchmark
3373 Rolled out r37991. It didn't properly save xmm0, which is caller-save,
3374 before calling helper functions.
3376 SunSpider and v8 benchmarks show little change -- possibly a .2%
3377 SunSpider regression, possibly a .2% v8 benchmark speedup.
3379 * assembler/X86Assembler.h:
3380 (JSC::X86Assembler::):
3381 * bytecode/CodeBlock.cpp:
3382 (JSC::CodeBlock::dump):
3383 * bytecode/Instruction.h:
3384 (JSC::Instruction::):
3385 * bytecompiler/BytecodeGenerator.cpp:
3386 (JSC::BytecodeGenerator::emitUnaryOp):
3387 * bytecompiler/BytecodeGenerator.h:
3388 (JSC::BytecodeGenerator::emitToJSNumber):
3389 (JSC::BytecodeGenerator::emitTypeOf):
3390 (JSC::BytecodeGenerator::emitGetPropertyNames):
3391 * interpreter/Interpreter.cpp:
3392 (JSC::Interpreter::privateExecute):
3393 * interpreter/Interpreter.h:
3395 (JSC::JIT::privateCompileMainPass):
3396 (JSC::JIT::privateCompileSlowCases):
3399 (JSC::UnaryOpNode::emitBytecode):
3400 (JSC::BinaryOpNode::emitBytecode):
3401 (JSC::EqualNode::emitBytecode):
3402 * parser/ResultType.h:
3403 (JSC::ResultType::isReusable):
3404 (JSC::ResultType::mightBeNumber):
3405 * runtime/JSNumberCell.h:
3407 2008-12-01 Gavin Barraclough <barraclough@apple.com>
3409 Reviewed by Geoffrey Garen.
3411 Remove unused (sampling only, and derivable) argument to JIT::emitCTICall.
3412 https://bugs.webkit.org/show_bug.cgi?id=22587
3415 (JSC::JIT::emitCTICall):
3416 (JSC::JIT::compileOpCall):
3417 (JSC::JIT::emitSlowScriptCheck):
3418 (JSC::JIT::compileBinaryArithOpSlowCase):
3419 (JSC::JIT::privateCompileMainPass):
3420 (JSC::JIT::privateCompileSlowCases):
3421 (JSC::JIT::privateCompile):
3424 2008-12-02 Dimitri Glazkov <dglazkov@chromium.org>
3426 Reviewed by Eric Seidel.
3428 Fix the inheritance chain for JSFunction.
3430 * runtime/JSFunction.cpp:
3431 (JSC::JSFunction::info): Add InternalFunction::info as parent class
3433 2008-12-02 Simon Hausmann <hausmann@webkit.org>
3435 Reviewed by Tor Arne Vestbø.
3437 Fix ability to include JavaScriptCore.pri from other .pro files.
3439 * JavaScriptCore.pri: Moved -O3 setting into the .pro files.
3440 * JavaScriptCore.pro:
3443 2008-12-01 Geoffrey Garen <ggaren@apple.com>
3445 Reviewed by Cameron Zwarich, with help from Gavin Barraclough.
3447 Fixed https://bugs.webkit.org/show_bug.cgi?id=22583.
3449 Refactored regular expression parsing to parse sequences of characters
3450 as a single unit, in preparation for optimizing sequences of characters.
3452 SunSpider reports no change.
3454 * JavaScriptCore.xcodeproj/project.pbxproj:
3455 * wrec/Escapes.h: Added. Set of classes for representing an escaped
3458 * wrec/Quantifier.h:
3459 (JSC::WREC::Quantifier::Quantifier): Simplified this constructor slightly,
3460 to match the new Escape constructor.
3462 * wrec/WRECGenerator.cpp:
3463 (JSC::WREC::Generator::generatePatternCharacterSequence):
3464 * wrec/WRECGenerator.h: Added an interface for generating a sequence
3465 of pattern characters at a time. It doesn't do anything special yet.
3467 * wrec/WRECParser.cpp:
3468 (JSC::WREC::Parser::consumeGreedyQuantifier):
3469 (JSC::WREC::Parser::consumeQuantifier): Renamed "parse" to "consume" in
3470 these functions, to match "consumeEscape."
3472 (JSC::WREC::Parser::parsePatternCharacterSequence): New function for
3473 iteratively aggregating a sequence of characters in a pattern.
3475 (JSC::WREC::Parser::parseCharacterClassQuantifier):
3476 (JSC::WREC::Parser::parseBackreferenceQuantifier): Renamed "parse" to
3477 "consume" in these functions, to match "consumeEscape."
3479 (JSC::WREC::Parser::parseCharacterClass): Refactored to use the common
3480 escape processing code in consumeEscape.
3482 (JSC::WREC::Parser::parseEscape): Refactored to use the common
3483 escape processing code in consumeEscape.
3485 (JSC::WREC::Parser::consumeEscape): Factored escaped token processing
3486 into a common function, since we were doing this in a few places.
3488 (JSC::WREC::Parser::parseTerm): Refactored to use the common
3489 escape processing code in consumeEscape.
3491 * wrec/WRECParser.h:
3492 (JSC::WREC::Parser::consumeOctal): Refactored to use a helper function
3493 for reading a digit.
3495 2008-12-01 Cameron Zwarich <zwarich@apple.com>
3497 Reviewed by Oliver Hunt.
3499 Bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
3500 <https://bugs.webkit.org/show_bug.cgi?id=20340>
3502 SegmentedVector currently frees segments and reallocates them when used
3503 as a stack. This can lead to unsafe use of pointers into freed segments.
3505 In order to fix this problem, SegmentedVector will be changed to only
3506 grow and never shrink. Also, rename the reserveCapacity() member
3507 function to grow() to match the actual usage in BytecodeGenerator, where
3508 this function is used to allocate a group of registers at once, rather
3509 than merely saving space for them.
3511 * bytecompiler/BytecodeGenerator.cpp:
3512 (JSC::BytecodeGenerator::BytecodeGenerator): Use grow() instead of
3514 * bytecompiler/SegmentedVector.h:
3515 (JSC::SegmentedVector::SegmentedVector):
3516 (JSC::SegmentedVector::last):
3517 (JSC::SegmentedVector::append):
3518 (JSC::SegmentedVector::removeLast):
3519 (JSC::SegmentedVector::grow): Renamed from reserveCapacity().
3520 (JSC::SegmentedVector::clear):
3522 2008-12-01 Mark Rowe <mrowe@apple.com>
3524 Rubber-stamped by Anders Carlsson.
3526 Disable WREC for x86_64 since memory allocated by the system allocator is not marked executable,
3527 which causes 64-bit debug builds to crash. Once we have a dedicated allocator for executable
3528 memory we can turn this back on.
3532 2008-12-01 Antti Koivisto <antti@apple.com>
3534 Reviewed by Maciej Stachowiak.
3536 Restore inline buffer after vector is shrunk back below its inline capacity.
3540 (WTF::VectorBuffer::restoreInlineBufferIfNeeded):
3541 (WTF::::shrinkCapacity):