1 2009-07-03 Yong Li <yong.li@torchmobile.com>
3 Reviewed by Maciej Stachowiak (and revised slightly)
5 RegExp::match to be optimized
6 https://bugs.webkit.org/show_bug.cgi?id=26957
8 Allow regexp matching to use Vectors with inline capacity instead of
9 allocating a new ovector buffer every time.
11 ~5% speedup on SunSpider string-unpack-code test, 0.3% on SunSpider overall.
16 * runtime/RegExpConstructor.cpp:
17 (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
18 (JSC::RegExpConstructorPrivate::lastOvector):
19 (JSC::RegExpConstructorPrivate::tempOvector):
20 (JSC::RegExpConstructorPrivate::changeLastOvector):
21 (JSC::RegExpConstructor::performMatch):
22 (JSC::RegExpMatchesArray::RegExpMatchesArray):
23 (JSC::RegExpMatchesArray::fillArrayInstance):
24 (JSC::RegExpConstructor::getBackref):
25 (JSC::RegExpConstructor::getLastParen):
26 (JSC::RegExpConstructor::getLeftContext):
27 (JSC::RegExpConstructor::getRightContext):
28 * runtime/StringPrototype.cpp:
29 (JSC::stringProtoFuncSplit):
31 2009-06-30 Kwang Yul Seo <skyul@company100.net>
33 Reviewed by Eric Seidel.
35 Override operator new/delete with const std::nothrow_t& as the second
37 https://bugs.webkit.org/show_bug.cgi?id=26792
39 On Windows CE, operator new/delete, new[]/delete[] with const
40 std::nothrow_t& must be overrided because some standard template
41 libraries use these operators.
43 The problem occurs when memory allocated by new(size_t s, const
44 std::nothrow_t&) is freed by delete(void* p). This causes the umatched
47 The patch overrides all new, delete, new[] and delete[] to use
48 fastMaloc and fastFree consistently.
53 2009-06-30 Gabor Loki <loki@inf.u-szeged.hu>
55 Reviewed by Sam Weinig.
57 <https://bugs.webkit.org/show_bug.cgi?id=24986>
59 Remove unnecessary references to AssemblerBuffer.
61 * interpreter/Interpreter.cpp:
62 * interpreter/Interpreter.h:
64 2009-06-29 David Levin <levin@chromium.org>
66 Reviewed by Oliver Hunt.
68 Still seeing occasional leaks from UString::sharedBuffer code
69 https://bugs.webkit.org/show_bug.cgi?id=26420
71 The problem is that the pointer to the memory allocation isn't visible
72 by "leaks" due to the lower bits being used as flags. The fix is to
73 make the pointer visible in memory (in debug only). The downside of
74 this fix that the memory allocated by sharedBuffer will still look like
75 a leak in non-debug builds when any flags are set.
78 (WTF::PtrAndFlags::set):
80 2009-06-29 Sam Weinig <sam@webkit.org>
82 Reviewed by Mark Rowe.
84 Remove more unused scons support.
86 * SConstruct: Removed.
88 2009-06-29 Oliver Hunt <oliver@apple.com>
90 Reviewed by Gavin Barraclough.
92 <rdar://problem/7016214> JSON.parse fails to parse valid JSON with most Unicode characters
93 <https://bugs.webkit.org/show_bug.cgi?id=26802>
95 In the original JSON.parse patch unicode was handled correctly, however in some last
96 minute "clean up" I oversimplified isSafeStringCharacter. This patch corrects this bug.
98 * runtime/LiteralParser.cpp:
99 (JSC::isSafeStringCharacter):
100 (JSC::LiteralParser::Lexer::lexString):
102 2009-06-26 Oliver Hunt <oliver@apple.com>
104 Reviewed by Dan Bernstein.
106 <rdar://problem/7009684> REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746)
107 <https://bugs.webkit.org/show_bug.cgi?id=26746>
109 Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id. Clearly this
110 is less than correct. This patch corrects that error.
112 * interpreter/Interpreter.cpp:
113 (JSC::Interpreter::tryCacheGetByID):
115 2009-06-26 Eric Seidel <eric@webkit.org>
117 No review, only rolling out r45259.
119 Roll out r45259 after crash appeared on the bots:
120 plugins/undefined-property-crash.html
121 ASSERTION FAILED: s <= HeapConstants<heapType>::cellSize
122 (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278
123 void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap])
125 * runtime/DateInstance.cpp:
126 * runtime/Identifier.cpp:
128 * runtime/RegExpConstructor.cpp:
129 * runtime/RegExpObject.h:
130 * runtime/ScopeChain.h:
133 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
135 Reviewed by Simon Hausmann.
137 Add support for QDataStream operators to Vector.
143 2009-06-24 Sam Weinig <sam@webkit.org>
145 Reviewed by Gavin Barraclough.
147 Make the opcode sampler work once again.
150 (JSC::JIT::compileGetByIdProto):
151 (JSC::JIT::compileGetByIdSelfList):
152 (JSC::JIT::compileGetByIdProtoList):
153 (JSC::JIT::compileGetByIdChainList):
154 (JSC::JIT::compileGetByIdChain):
155 (JSC::JIT::compilePutByIdTransition):
156 (JSC::JIT::compileCTIMachineTrampolines):
157 (JSC::JIT::compilePatchGetArrayLength):
159 (JSC::JITStubCall::call):
161 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
163 Reviewed by Maciej Stachowiak.
165 Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid
166 unnecessary WTF:: usings.
167 Remove existing unnecessary WTF:: usings.
169 * interpreter/Interpreter.h:
170 * profiler/CallIdentifier.h:
171 * runtime/ScopeChain.h:
172 * wtf/FastAllocBase.h:
174 2009-06-24 David Levin <levin@chromium.org>
178 * bytecode/CodeBlock.h:
179 * bytecompiler/BytecodeGenerator.h:
180 * interpreter/Register.h:
182 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
184 Reviewed by Maciej Stachowiak.
186 https://bugs.webkit.org/show_bug.cgi?id=26677
188 Inherits CodeBlock class from FastAllocBase because it
189 has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217.
191 * bytecode/CodeBlock.h:
193 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
195 Reviewed by Maciej Stachowiak.
197 https://bugs.webkit.org/show_bug.cgi?id=26676
199 Inherits BytecodeGenerator class from FastAllocBase because it has been
200 instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892.
202 * bytecompiler/BytecodeGenerator.h:
204 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
206 Reviewed by Maciej Stachowiak.
208 https://bugs.webkit.org/show_bug.cgi?id=26675
210 Inherits Register class from FastAllocBase because it has been
211 instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149.
213 * interpreter/Register.h:
215 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
217 Reviewed by Darin Adler.
219 https://bugs.webkit.org/show_bug.cgi?id=26674
221 Inherits HashMap class from FastAllocBase because it has been
222 instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458.
226 2009-06-24 Oliver Hunt <oliver@apple.com>
228 Reviewed by Darin Adler.
230 <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research'
232 The problem was caused by the page returned with a function using a
233 var declaration list containing around ~3000 variables. The solution
234 to this is to flatten the comma expression representation and make
235 codegen comma expressions and initializer lists iterative rather than
239 * parser/NodeConstructors.h:
240 (JSC::CommaNode::CommaNode):
242 (JSC::CommaNode::emitBytecode):
244 (JSC::ExpressionNode::isCommaNode):
245 (JSC::CommaNode::isCommaNode):
246 (JSC::CommaNode::append):
248 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
250 Reviewed by Maciej Stachowiak.
252 https://bugs.webkit.org/show_bug.cgi?id=26645
254 Inherits ScopeChainNode class from FastAllocBase because it has been
255 instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95.
259 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
261 Reviewed by Darin Adler.
263 https://bugs.webkit.org/show_bug.cgi?id=26648
265 Inherits Deque class from FastAllocBase because it has been
266 instantiated by 'new' with DEFINE_STATIC_LOCAL macro in
267 JavaScriptCore/wtf/MainThread.cpp:62.
271 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
273 Reviewed by Darin Adler.
275 https://bugs.webkit.org/show_bug.cgi?id=26644
277 Inherits RefPtr class from FastAllocBase because it has been
278 instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41.
282 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
284 Reviewed by Darin Adler.
286 Inherits HashSet class from FastAllocBase, because it has been
287 instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116.
291 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
293 Reviewed by Darin Adler.
295 Inherits Vector class from FastAllocBase because it has been
296 instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633.
300 2009-06-24 Norbert Leser <norbert.leser@nokia.com>
302 Reviewed by Maciej Stachoviak.
304 The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance
305 (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.).
306 Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode),
307 the stack overflows immediately on Symbian hardware (max. 80 kB).
308 Proposed change allocates generator objects on heap.
309 Performance impact (if any) should be negligible and change is proposed as general fix,
310 rather than ifdef'd for SYMBIAN.
313 (JSC::ProgramNode::generateBytecode):
314 (JSC::EvalNode::generateBytecode):
315 (JSC::EvalNode::bytecodeForExceptionInfoReparse):
316 (JSC::FunctionBodyNode::generateBytecode):
317 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
319 2009-06-23 Oliver Hunt <oliver@apple.com>
321 Reviewed by Gavin Barraclough.
323 <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
324 <https://bugs.webkit.org/show_bug.cgi?id=26593>
326 Do not attempt to cache structure chains if they contain a dictionary at any level.
328 * interpreter/Interpreter.cpp:
329 (JSC::Interpreter::tryCachePutByID):
330 (JSC::Interpreter::tryCacheGetByID):
332 (JSC::JITThunks::tryCachePutByID):
333 * runtime/Structure.cpp:
334 (JSC::Structure::getEnumerablePropertyNames):
335 (JSC::Structure::addPropertyTransition):
336 * runtime/StructureChain.cpp:
337 (JSC::StructureChain::isCacheable):
338 * runtime/StructureChain.h:
340 2009-06-23 Yong Li <yong.li@torchmobile.com>
342 Reviewed by George Staikos.
344 https://bugs.webkit.org/show_bug.cgi?id=26654
345 Add the proper export define for the JavaScriptCore API when building for WINCE.
349 2009-06-23 Joe Mason <joe.mason@torchmobile.com>
351 Reviewed by Adam Treat.
353 Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
355 https://bugs.webkit.org/show_bug.cgi?id=26611
356 Implement currentThreadStackBase on WINCE by adding a global,
357 g_stackBase, which must be set to the address of a local variable
358 by the caller before calling any WebKit function that invokes JSC.
360 * runtime/Collector.cpp:
361 (JSC::isPageWritable):
363 Starts at the top of the stack and returns the entire range of
364 consecutive writable pages as an estimate of the actual stack.
365 This will be much bigger than the actual stack range, so some
366 dead objects can't be collected, but it guarantees live objects
367 aren't collected prematurely.
369 (JSC::currentThreadStackBase):
370 On WinCE, returns g_stackBase if set or call getStackBase as a
373 2009-06-23 Oliver Hunt <oliver@apple.com>
375 Reviewed by Alexey Proskuryakov.
377 Fix stupid performance problem in the LiteralParser
379 The LiteralParser was making a new UString in order to use
380 toDouble, however UString's toDouble allows a much wider range
381 of numberic strings than the LiteralParser accepts, and requires
382 an additional heap allocation or two for the construciton of the
383 UString. To rectify this we just call WTF::dtoa directly using
384 a stack allocated buffer to hold the validated numeric literal.
386 * runtime/LiteralParser.cpp:
387 (JSC::LiteralParser::Lexer::lexNumber):
388 (JSC::LiteralParser::parse):
389 * runtime/LiteralParser.h:
391 2009-06-22 Oliver Hunt <oliver@apple.com>
393 Reviewed by Alexey Proskuryakov.
395 Bug 26640: JSON.stringify needs to special case Boolean objects
396 <https://bugs.webkit.org/show_bug.cgi?id=26640>
398 Add special case handling of the Boolean object so we match current
401 * runtime/JSONObject.cpp:
402 (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString
404 (JSC::Stringifier::appendStringifiedValue):
406 2009-06-22 Oliver Hunt <oliver@apple.com>
408 Reviewed by Darin Adler.
410 Bug 26591: Support revivers in JSON.parse
411 <https://bugs.webkit.org/show_bug.cgi?id=26591>
413 Add reviver support to JSON.parse. This completes the JSON object.
415 * runtime/JSONObject.cpp:
416 (JSC::Walker::Walker):
417 (JSC::Walker::callReviver):
419 (JSC::JSONProtoFuncParse):
421 2009-06-21 Oliver Hunt <oliver@apple.com>
423 Reviewed by Darin Adler.
425 Bug 26592: Support standard toJSON functions
426 <https://bugs.webkit.org/show_bug.cgi?id=26592>
428 Add support for the standard Date.toJSON function.
430 * runtime/DatePrototype.cpp:
431 (JSC::dateProtoFuncToJSON):
433 2009-06-21 Oliver Hunt <oliver@apple.com>
435 Reviewed by Sam Weinig.
437 Bug 26594: JSC needs to support Date.toISOString
438 <https://bugs.webkit.org/show_bug.cgi?id=26594>
440 Add support for Date.toISOString.
442 * runtime/DatePrototype.cpp:
443 (JSC::dateProtoFuncToISOString):
445 2009-06-21 Oliver Hunt <oliver@apple.com>
447 Reviewed by NOBODY (Build fix).
451 * runtime/LiteralParser.cpp:
452 (JSC::LiteralParser::parse):
454 2009-06-21 Oliver Hunt <oliver@apple.com>
456 Reviewed by Darin Adler and Cameron Zwarich.
458 Bug 26587: Support JSON.parse
459 <https://bugs.webkit.org/show_bug.cgi?id=26587>
461 Extend the LiteralParser to support the full strict JSON
462 grammar, fix a few places where the grammar was incorrectly
463 lenient. Doesn't yet support the JSON.parse reviver function
464 but that does not block the JSON.parse functionality itself.
466 * interpreter/Interpreter.cpp:
467 (JSC::Interpreter::callEval):
468 * runtime/JSGlobalObjectFunctions.cpp:
469 (JSC::globalFuncEval):
470 * runtime/JSONObject.cpp:
471 (JSC::JSONProtoFuncParse):
472 * runtime/LiteralParser.cpp:
473 (JSC::LiteralParser::Lexer::lex):
474 (JSC::isSafeStringCharacter):
475 (JSC::LiteralParser::Lexer::lexString):
476 (JSC::LiteralParser::parse):
477 * runtime/LiteralParser.h:
478 (JSC::LiteralParser::LiteralParser):
479 (JSC::LiteralParser::tryJSONParse):
480 (JSC::LiteralParser::):
481 (JSC::LiteralParser::Lexer::Lexer):
483 2009-06-21 David Levin <levin@chromium.org>
485 Reviewed by NOBODY (speculative build fix for windows).
487 Simply removed some whitespace form this file to make windows build wtf and
488 hopefully copy the new MessageQueque.h so that WebCore picks it up.
490 * wtf/Assertions.cpp:
492 2009-06-21 Drew Wilson <atwilson@google.com>
494 Reviewed by David Levin.
496 <https://bugs.webkit.org/show_bug.cgi?id=25043>
497 Added support for multi-threaded MessagePorts.
499 * wtf/MessageQueue.h:
500 (WTF::::appendAndCheckEmpty):
501 Added API to test whether the queue was empty before adding an element.
503 2009-06-20 David D. Kilzer <ddkilzer@webkit.org>
505 Fix namespace comment in SegmentedVector.h
507 * wtf/SegmentedVector.h: Updated namespace comment to reflect
508 new namespace after r44897.
510 2009-06-20 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
512 Bug 24986: ARM JIT port
513 <https://bugs.webkit.org/show_bug.cgi?id=24986>
515 Reviewed by Oliver Hunt.
517 An Iterator added for SegmentedVector. Currently
518 only the pre ++ operator is supported.
520 * wtf/SegmentedVector.h:
521 (WTF::SegmentedVectorIterator::~SegmentedVectorIterator):
522 (WTF::SegmentedVectorIterator::operator*):
523 (WTF::SegmentedVectorIterator::operator->):
524 (WTF::SegmentedVectorIterator::operator++):
525 (WTF::SegmentedVectorIterator::operator==):
526 (WTF::SegmentedVectorIterator::operator!=):
527 (WTF::SegmentedVectorIterator::operator=):
528 (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
529 (WTF::SegmentedVector::alloc):
530 (WTF::SegmentedVector::begin):
531 (WTF::SegmentedVector::end):
533 2009-06-20 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
535 Bug 24986: ARM JIT port
536 <https://bugs.webkit.org/show_bug.cgi?id=24986>
538 Reviewed by Oliver Hunt.
540 Move SegmentedVector to /wtf subdirectory
541 and change "namespace JSC" to "namespace WTF"
543 Additional build file updates by David Kilzer.
545 * GNUmakefile.am: Updated path to SegmentedVector.h.
546 * JavaScriptCore.order: Updated SegmentedVector namespace from
547 JSC to WTF in mangled C++ method name.
548 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
549 Removed reference to bytecompiler\SegmentedVector.h.
550 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
551 wtf\SegmentedVector.h.
552 * JavaScriptCore.xcodeproj/project.pbxproj: Moved
553 SegmentedVector.h definition from bytecompiler subdirectory to
555 * bytecompiler/BytecodeGenerator.h: Updated #include path to
556 SegmentedVector.h and prepended WTF:: namespace to its use.
557 * parser/Lexer.h: Ditto.
558 * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
559 (WTF::SegmentedVector::SegmentedVector):
560 (WTF::SegmentedVector::~SegmentedVector):
561 (WTF::SegmentedVector::size):
562 (WTF::SegmentedVector::at):
563 (WTF::SegmentedVector::operator[]):
564 (WTF::SegmentedVector::last):
565 (WTF::SegmentedVector::append):
566 (WTF::SegmentedVector::removeLast):
567 (WTF::SegmentedVector::grow):
568 (WTF::SegmentedVector::clear):
569 (WTF::SegmentedVector::deleteAllSegments):
570 (WTF::SegmentedVector::segmentExistsFor):
571 (WTF::SegmentedVector::segmentFor):
572 (WTF::SegmentedVector::subscriptFor):
573 (WTF::SegmentedVector::ensureSegmentsFor):
574 (WTF::SegmentedVector::ensureSegment):
576 2009-06-19 Gavin Barraclough <barraclough@apple.com>
578 Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
581 (JSC::JIT::privateCompile):
582 (JSC::JIT::privateCompileCTIMachineTrampolines):
583 (JSC::JIT::emitGetVariableObjectRegister):
584 (JSC::JIT::emitPutVariableObjectRegister):
586 * jit/JITArithmetic.cpp:
587 (JSC::JIT::emit_op_rshift):
588 (JSC::JIT::emitSlow_op_jnless):
589 (JSC::JIT::emitSlow_op_jnlesseq):
590 (JSC::JIT::compileBinaryArithOp):
592 (JSC::JIT::compileOpCallInitializeCallFrame):
593 (JSC::JIT::compileOpCall):
594 * jit/JITInlineMethods.h:
595 (JSC::JIT::restoreArgumentReference):
596 (JSC::JIT::checkStructure):
597 * jit/JITOpcodes.cpp:
598 (JSC::JIT::emit_op_instanceof):
599 (JSC::JIT::emit_op_get_scoped_var):
600 (JSC::JIT::emit_op_put_scoped_var):
601 (JSC::JIT::emit_op_construct_verify):
602 (JSC::JIT::emit_op_resolve_global):
603 (JSC::JIT::emit_op_jeq_null):
604 (JSC::JIT::emit_op_jneq_null):
605 (JSC::JIT::emit_op_to_jsnumber):
606 (JSC::JIT::emit_op_catch):
607 (JSC::JIT::emit_op_eq_null):
608 (JSC::JIT::emit_op_neq_null):
609 (JSC::JIT::emit_op_convert_this):
610 (JSC::JIT::emit_op_profile_will_call):
611 (JSC::JIT::emit_op_profile_did_call):
612 (JSC::JIT::emitSlow_op_get_by_val):
613 * jit/JITPropertyAccess.cpp:
614 (JSC::JIT::emit_op_get_by_val):
615 (JSC::JIT::emit_op_put_by_val):
616 (JSC::JIT::emit_op_method_check):
617 (JSC::JIT::compileGetByIdHotPath):
618 (JSC::JIT::emit_op_put_by_id):
619 (JSC::JIT::compilePutDirectOffset):
620 (JSC::JIT::compileGetDirectOffset):
621 (JSC::JIT::privateCompilePutByIdTransition):
622 (JSC::JIT::privateCompilePatchGetArrayLength):
624 (JSC::JITThunks::JITThunks):
626 2009-06-19 Gavin Barraclough <barraclough@apple.com>
628 Reviewed by NOBODY (Windows build fix).
631 * jit/JITInlineMethods.h:
633 2009-06-19 Gabor Loki <loki@inf.u-szeged.hu>
635 Reviewed by Gavin Barraclough.
637 Reorganize ARM architecture specific macros.
638 Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7).
640 Bug 24986: ARM JIT port
641 <https://bugs.webkit.org/show_bug.cgi?id=24986>
643 * assembler/ARMv7Assembler.h:
644 * assembler/AbstractMacroAssembler.h:
645 (JSC::AbstractMacroAssembler::Imm32::Imm32):
646 * assembler/MacroAssembler.h:
647 * assembler/MacroAssemblerCodeRef.h:
648 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
649 * jit/ExecutableAllocator.h:
650 (JSC::ExecutableAllocator::cacheFlush):
652 * jit/JITInlineMethods.h:
653 (JSC::JIT::restoreArgumentReferenceForTrampoline):
658 (JSC::Yarr::RegexGenerator::generateEnter):
659 (JSC::Yarr::RegexGenerator::generateReturn):
661 2009-06-19 Gavin Barraclough <barraclough@apple.com>
663 Reviewed by Oliver Hunt.
665 Fix armv7 JIT build issues.
667 Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types),
668 and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros.
670 * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects).
671 * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor.
675 * jit/JITInlineMethods.h:
676 (JSC::JIT::restoreArgumentReference):
677 * jit/JITOpcodes.cpp:
678 (JSC::JIT::emit_op_catch):
680 (JSC::JITThunks::JITThunks):
682 2009-06-19 Adam Treat <adam.treat@torchmobile.com>
684 Blind attempt at build fix.
686 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
687 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
689 2009-06-19 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
691 Reviewed by Oliver Hunt.
693 Inherits CallIdentifier struct from FastAllocBase because it has been
694 instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86.
696 * wtf/HashCountedSet.h:
698 2009-06-19 Adam Treat <adam.treat@torchmobile.com>
700 Reviewed by Oliver Hunt.
702 https://bugs.webkit.org/show_bug.cgi?id=26540
703 Modify the test shell to add a new function 'checkSyntax' that will
704 only parse the source instead of executing it. In this way we can test
705 pure parsing performance against some of the larger scripts in the wild.
708 (GlobalObject::GlobalObject):
709 (functionCheckSyntax):
711 2009-06-19 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
713 Reviewed by Darin Adler.
715 Inherits HashCountedSet class from FastAllocBase because it has been
716 instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095.
718 * wtf/HashCountedSet.h:
720 2009-06-19 Yong Li <yong.li@torchmobile.com>
722 Reviewed by George Staikos.
724 https://bugs.webkit.org/show_bug.cgi?id=26558
725 Declare these symbols extern for WINCE as they are provided by libce.
727 * runtime/DateConstructor.cpp:
728 * runtime/DatePrototype.cpp:
729 (JSC::formatLocaleDate):
731 2009-06-19 Oliver Hunt <oliver@apple.com>
733 Reviewed by Maciej Stachowiak.
735 <rdar://problem/6988973> ScopeChain leak in interpreter builds
737 Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT)
740 * runtime/JSFunction.cpp:
741 (JSC::JSFunction::~JSFunction):
744 2009-06-19 Yong Li <yong.li@torchmobile.com>
746 Reviewed by George Staikos.
748 https://bugs.webkit.org/show_bug.cgi?id=26543
749 Windows CE uses 'GetLastError' instead of 'errno.'
751 * interpreter/RegisterFile.h:
752 (JSC::RegisterFile::RegisterFile):
753 (JSC::RegisterFile::grow):
755 2009-06-19 David Levin <levin@chromium.org>
757 Reviewed by NOBODY (Windows build fix).
759 Add export for Windows corresponding to OSX export done in r44844.
760 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
761 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
763 2009-06-18 Oliver Hunt <oliver@apple.com>
765 Reviewed by Gavin "Viceroy of Venezuela" Barraclough.
767 Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
768 <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>
770 We need to make sure that each native function instance correctly unlinks any references to it
771 when it is collected. Allowing this to happen required a few changes:
772 * Every native function needs a codeblock to track the link information
773 * To have this codeblock, every function now also needs its own functionbodynode
774 so we no longer get to have a single shared instance.
775 * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
777 * JavaScriptCore.exp:
778 * bytecode/CodeBlock.cpp:
779 (JSC::CodeBlock::CodeBlock):
780 Constructor for NativeCode CodeBlock
781 (JSC::CodeBlock::derefStructures):
782 (JSC::CodeBlock::refStructures):
783 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
784 (JSC::CodeBlock::handlerForBytecodeOffset):
785 (JSC::CodeBlock::lineNumberForBytecodeOffset):
786 (JSC::CodeBlock::expressionRangeForBytecodeOffset):
787 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
788 (JSC::CodeBlock::functionRegisterForBytecodeOffset):
789 (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
790 (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
791 (JSC::CodeBlock::setJITCode):
792 Add assertions to ensure we don't try and use NativeCode CodeBlocks as
795 * bytecode/CodeBlock.h:
797 (JSC::CodeBlock::source):
798 (JSC::CodeBlock::sourceOffset):
799 (JSC::CodeBlock::evalCodeCache):
800 (JSC::CodeBlock::createRareDataIfNecessary):
804 (JSC::JIT::privateCompileCTIMachineTrampolines):
805 (JSC::JIT::linkCall):
806 Update logic to allow native function caching
810 (JSC::FunctionBodyNode::createNativeThunk):
811 (JSC::FunctionBodyNode::isHostFunction):
813 * runtime/JSFunction.cpp:
814 (JSC::JSFunction::JSFunction):
815 (JSC::JSFunction::~JSFunction):
816 (JSC::JSFunction::mark):
817 * runtime/JSGlobalData.cpp:
818 (JSC::JSGlobalData::~JSGlobalData):
819 * runtime/JSGlobalData.h:
821 2009-06-18 Gavin Barraclough <barraclough@apple.com>
823 Reviewed by NOBODY (Windows build fix).
826 (WTF::calculateUTCOffset):
828 2009-06-18 Gavin Barraclough <barraclough@apple.com>
830 Reviewed by Geoff Garen.
832 Timezone calculation incorrect in Venezuela.
834 https://bugs.webkit.org/show_bug.cgi?id=26531
835 <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3
837 The problem is that we're calculating the timezone relative to 01/01/2000,
838 but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007.
839 According to the spec, section 15.9.1.9 states "the time since the beginning
840 of the year", presumably meaning the *current* year. Change the calculation
841 to be based on whatever the current year is, rather than a canned date.
843 No performance impact.
846 (WTF::calculateUTCOffset):
848 2009-06-18 Gavin Barraclough <barraclough@apple.com>
850 Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).
852 (Reintroducing patch added in r44492, and reverted in r44796.)
854 Change the implementation of op_throw so the stub function always modifies its
855 return address - if it doesn't find a 'catch' it will switch to a trampoline
856 to force a return from JIT execution. This saves memory, by avoiding the need
857 for a unique return for every op_throw.
859 * jit/JITOpcodes.cpp:
860 (JSC::JIT::emit_op_throw):
861 JITStubs::cti_op_throw now always changes its return address,
862 remove return code generated after the stub call (this is now
863 handled by ctiOpThrowNotCaught).
866 Add ctiOpThrowNotCaught definitions.
867 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
868 Change cti_op_throw to always change its return address.
870 Add ctiOpThrowNotCaught declaration.
872 2009-06-18 Kevin McCullough <kmccullough@apple.com>
874 Reviewed by Oliver Hunt.
876 <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit
878 - Exposed functions now needed by WebCore.
880 * JavaScriptCore.exp:
882 2009-06-17 Darin Adler <darin@apple.com>
884 Reviewed by Oliver Hunt.
886 Bug 26429: Make JSON.stringify non-recursive so it can handle objects
887 of arbitrary complexity
888 https://bugs.webkit.org/show_bug.cgi?id=26429
890 For marking I decided not to use gcProtect, because this is inside the engine
891 so it's easy enough to just do marking. And that darned gcProtect does locking!
892 Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor
893 for that class says "FIXME: Remove all clients of this API, then remove this API."
895 * runtime/Collector.cpp:
896 (JSC::Heap::collect): Add a call to JSONObject::markStringifiers.
898 * runtime/CommonIdentifiers.cpp:
899 (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier.
900 * runtime/CommonIdentifiers.h: Ditto.
902 * runtime/JSGlobalData.cpp:
903 (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0.
904 * runtime/JSGlobalData.h: Added firstStringifierToMark.
906 * runtime/JSONObject.cpp: Cut down the includes to the needed ones only.
907 (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string
908 objects to get their number and string values.
909 (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used
910 to wrap an identifier or integer so we don't have to do any work unless we
911 actually call a replacer.
912 (JSC::ReplacerPropertyName::value): Added.
913 (JSC::gap): Added. Helper function for the Stringifier constructor.
914 (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added.
915 The class is used to wrap an identifier or integer so we don't have to
916 allocate a number or string until we actually call toJSON or a replacer.
917 (JSC::PropertyNameForFunctionCall::asJSValue): Added.
918 (JSC::Stringifier::Stringifier): Updated and moved out of the class
919 definition. Added code to hook this into a singly linked list for marking.
920 (JSC::Stringifier::~Stringifier): Remove from the singly linked list.
921 (JSC::Stringifier::mark): Mark all the objects in the holder stacks.
922 (JSC::Stringifier::stringify): Updated.
923 (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit.
924 (JSC::Stringifier::toJSON): Renamed from toJSONValue.
925 (JSC::Stringifier::appendStringifiedValue): Renamed from stringify.
926 Added code to use the m_holderStack to do non-recursive stringify of
927 objects and arrays. This code also uses the timeout checker since in
928 pathological cases it could be slow even without calling into the
929 JavaScript virtual machine.
930 (JSC::Stringifier::willIndent): Added.
931 (JSC::Stringifier::indent): Added.
932 (JSC::Stringifier::unindent): Added.
933 (JSC::Stringifier::startNewLine): Added.
934 (JSC::Stringifier::Holder::Holder): Added.
935 (JSC::Stringifier::Holder::appendNextProperty): Added. This is the
936 function that handles the format of arrays and objects.
937 (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom
938 of the file so the JSONObject class is not interleaved with the
940 (JSC::JSONObject::markStringifiers): Added. Calls mark.
941 (JSC::JSONProtoFuncStringify): Streamlined the code here. The code
942 to compute the gap string is now a separate function.
944 * runtime/JSONObject.h: Made everything private. Added markStringifiers.
946 2009-06-17 Oliver Hunt <oliver@apple.com>
948 Reviewed by Gavin Barraclough.
950 <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com
952 Roll out r43849 as it appears that we cannot rely on the address of
953 an objects property storage being constant even if the structure is
957 * jit/JITPropertyAccess.cpp:
958 (JSC::JIT::compileGetDirectOffset):
959 (JSC::JIT::privateCompileGetByIdProto):
960 (JSC::JIT::privateCompileGetByIdProtoList):
961 (JSC::JIT::privateCompileGetByIdChainList):
962 (JSC::JIT::privateCompileGetByIdChain):
964 2009-06-17 Gavin Barraclough <barraclough@apple.com>
966 Rubber Stamped by Mark Rowe.
968 Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>.
970 * jit/JITOpcodes.cpp:
971 (JSC::JIT::emit_op_throw):
974 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
977 2009-06-17 Gavin Barraclough <barraclough@apple.com>
979 Reviewed by Mark Rowe.
981 <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit
983 On 64-bit, NaN-encoded values must be detagged before they can be used in rshift.
985 No performance impact.
987 * jit/JITArithmetic.cpp:
988 (JSC::JIT::emit_op_rshift):
990 2009-06-17 Adam Treat <adam.treat@torchmobile.com>
992 Reviewed by George Staikos.
994 https://bugs.webkit.org/show_bug.cgi?id=23155
995 Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
1000 2009-06-17 George Staikos <george.staikos@torchmobile.com>
1002 Reviewed by Adam Treat.
1004 https://bugs.webkit.org/show_bug.cgi?id=23155
1005 Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
1009 * wtf/Assertions.cpp:
1011 * wtf/CurrentTime.cpp:
1012 (WTF::lowResUTCTime):
1014 (WTF::getLocalTime):
1017 * wtf/StringExtras.h:
1019 * wtf/win/MainThreadWin.cpp:
1021 2009-06-17 Gavin Barraclough <barraclough@apple.com>
1023 Reviewed by Oliver Hunt.
1025 <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com
1027 Remove PropertySlot::putValue - PropertySlots should only be used for getting,
1028 not putting. Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
1029 which is what it really was being used to ask, and remove some other getOwnPropertySlot
1030 & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.
1032 * runtime/JSGlobalObject.h:
1033 (JSC::JSGlobalObject::hasOwnPropertyForWrite):
1034 * runtime/JSObject.h:
1035 * runtime/JSStaticScopeObject.cpp:
1036 * runtime/JSStaticScopeObject.h:
1037 * runtime/PropertySlot.h:
1039 2009-06-16 Gavin Barraclough <barraclough@apple.com>
1041 Reviewed by Oliver hunt.
1043 Temporarily partially disable r44492, since this is causing some problems on internal builds.
1045 * jit/JITOpcodes.cpp:
1046 (JSC::JIT::emit_op_throw):
1048 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1050 2009-06-16 Sam Weinig <sam@webkit.org>
1057 2009-06-16 Sam Weinig <sam@webkit.org>
1059 Reviewed by Oliver Hunt.
1061 Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
1062 it for each type of stub using the return address to find the correct
1068 (JSC::JIT::compileGetByIdProto):
1069 (JSC::JIT::compileGetByIdSelfList):
1070 (JSC::JIT::compileGetByIdProtoList):
1071 (JSC::JIT::compileGetByIdChainList):
1072 (JSC::JIT::compileGetByIdChain):
1073 (JSC::JIT::compilePutByIdTransition):
1074 (JSC::JIT::compileCTIMachineTrampolines):
1075 (JSC::JIT::compilePatchGetArrayLength):
1076 * jit/JITStubCall.h:
1077 (JSC::JITStubCall::call):
1079 == Rolled over to ChangeLog-2009-06-16 ==