2009-06-25 Dimitri Glazkov <dglazkov@chromium.org>
[webbrowser.git] / JavaScriptCore / ChangeLog
blobeac9335f70d419d48cbff2054c02ab7869854d69
1 2009-06-24  Sam Weinig  <sam@webkit.org>
3         Reviewed by Gavin Barraclough.
5         Make the opcode sampler work once again.
7         * jit/JIT.h:
8         (JSC::JIT::compileGetByIdProto):
9         (JSC::JIT::compileGetByIdSelfList):
10         (JSC::JIT::compileGetByIdProtoList):
11         (JSC::JIT::compileGetByIdChainList):
12         (JSC::JIT::compileGetByIdChain):
13         (JSC::JIT::compilePutByIdTransition):
14         (JSC::JIT::compileCTIMachineTrampolines):
15         (JSC::JIT::compilePatchGetArrayLength):
16         * jit/JITStubCall.h:
17         (JSC::JITStubCall::call):
19 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
21         Reviewed by Maciej Stachowiak.
23         Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid
24         unnecessary WTF:: usings.
25         Remove existing unnecessary WTF:: usings.
27         * interpreter/Interpreter.h:
28         * profiler/CallIdentifier.h:
29         * runtime/ScopeChain.h:
30         * wtf/FastAllocBase.h:
32 2009-06-24  David Levin  <levin@chromium.org>
34         Fix all builds.
36         * bytecode/CodeBlock.h:
37         * bytecompiler/BytecodeGenerator.h:
38         * interpreter/Register.h:
40 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
42         Reviewed by Maciej Stachowiak.
43         
44         https://bugs.webkit.org/show_bug.cgi?id=26677
46         Inherits CodeBlock class from FastAllocBase because it
47         has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217.
49         * bytecode/CodeBlock.h:
51 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
53         Reviewed by Maciej Stachowiak.
54         
55         https://bugs.webkit.org/show_bug.cgi?id=26676
57         Inherits BytecodeGenerator class from FastAllocBase because it has been
58         instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892.
60         * bytecompiler/BytecodeGenerator.h:
62 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
64         Reviewed by Maciej Stachowiak.
65         
66         https://bugs.webkit.org/show_bug.cgi?id=26675
68         Inherits Register class from FastAllocBase because it has been
69         instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149.
71         * interpreter/Register.h:
73 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
75         Reviewed by Darin Adler.
76         
77         https://bugs.webkit.org/show_bug.cgi?id=26674
79         Inherits HashMap class from FastAllocBase because it has been
80         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458.
82         * wtf/HashMap.h:
84 2009-06-24  Oliver Hunt  <oliver@apple.com>
86         Reviewed by Darin Adler.
88         <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research'
90         The problem was caused by the page returned with a function using a
91         var declaration list containing around ~3000 variables.  The solution
92         to this is to flatten the comma expression representation and make
93         codegen comma expressions and initializer lists iterative rather than
94         recursive.
96         * parser/Grammar.y:
97         * parser/NodeConstructors.h:
98         (JSC::CommaNode::CommaNode):
99         * parser/Nodes.cpp:
100         (JSC::CommaNode::emitBytecode):
101         * parser/Nodes.h:
102         (JSC::ExpressionNode::isCommaNode):
103         (JSC::CommaNode::isCommaNode):
104         (JSC::CommaNode::append):
106 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
108         Reviewed by Maciej Stachowiak.
110         https://bugs.webkit.org/show_bug.cgi?id=26645
112         Inherits ScopeChainNode class from FastAllocBase because it has been
113         instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95.
115         * wtf/RefPtr.h:
117 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
119         Reviewed by Darin Adler.
121         https://bugs.webkit.org/show_bug.cgi?id=26648
123         Inherits Deque class from FastAllocBase because it has been
124         instantiated by 'new' with DEFINE_STATIC_LOCAL macro in 
125         JavaScriptCore/wtf/MainThread.cpp:62.
127         * wtf/Deque.h:
129 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
131         Reviewed by Darin Adler.
133         https://bugs.webkit.org/show_bug.cgi?id=26644
135         Inherits RefPtr class from FastAllocBase because it has been
136         instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41.
138         * wtf/RefPtr.h:
140 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
142         Reviewed by Darin Adler.
144         Inherits HashSet class from FastAllocBase, because it has been
145         instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116.
147         * wtf/HashSet.h:
149 2009-06-24  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
151         Reviewed by Darin Adler.
153         Inherits Vector class from FastAllocBase because it has been
154         instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633.
156         * wtf/Vector.h:
158 2009-06-24  Norbert Leser  <norbert.leser@nokia.com>
160         Reviewed by Maciej Stachoviak.
162         The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance
163         (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.).
164         Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode),
165         the stack overflows immediately on Symbian hardware (max. 80 kB).
166         Proposed change allocates generator objects on heap.
167         Performance impact (if any) should be negligible and change is proposed as general fix,
168         rather than ifdef'd for SYMBIAN.
170         * parser/Nodes.cpp:
171         (JSC::ProgramNode::generateBytecode):
172         (JSC::EvalNode::generateBytecode):
173         (JSC::EvalNode::bytecodeForExceptionInfoReparse):
174         (JSC::FunctionBodyNode::generateBytecode):
175         (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
177 2009-06-23  Oliver Hunt  <oliver@apple.com>
179         Reviewed by Gavin Barraclough.
181         <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
182         <https://bugs.webkit.org/show_bug.cgi?id=26593>
184         Do not attempt to cache structure chains if they contain a dictionary at any level.
186         * interpreter/Interpreter.cpp:
187         (JSC::Interpreter::tryCachePutByID):
188         (JSC::Interpreter::tryCacheGetByID):
189         * jit/JITStubs.cpp:
190         (JSC::JITThunks::tryCachePutByID):
191         * runtime/Structure.cpp:
192         (JSC::Structure::getEnumerablePropertyNames):
193         (JSC::Structure::addPropertyTransition):
194         * runtime/StructureChain.cpp:
195         (JSC::StructureChain::isCacheable):
196         * runtime/StructureChain.h:
198 2009-06-23  Yong Li  <yong.li@torchmobile.com>
200         Reviewed by George Staikos.
202         https://bugs.webkit.org/show_bug.cgi?id=26654
203         Add the proper export define for the JavaScriptCore API when building for WINCE.
205         * API/JSBase.h:
207 2009-06-23  Joe Mason  <joe.mason@torchmobile.com>
209         Reviewed by Adam Treat.
211         Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
213         https://bugs.webkit.org/show_bug.cgi?id=26611
214         Implement currentThreadStackBase on WINCE by adding a global,
215         g_stackBase, which must be set to the address of a local variable
216         by the caller before calling any WebKit function that invokes JSC.
218         * runtime/Collector.cpp:
219         (JSC::isPageWritable):
220         (JSC::getStackBase):
221           Starts at the top of the stack and returns the entire range of
222           consecutive writable pages as an estimate of the actual stack.
223           This will be much bigger than the actual stack range, so some
224           dead objects can't be collected, but it guarantees live objects
225           aren't collected prematurely.
227         (JSC::currentThreadStackBase):
228           On WinCE, returns g_stackBase if set or call getStackBase as a
229           fallback if not.
231 2009-06-23  Oliver Hunt  <oliver@apple.com>
233         Reviewed by Alexey Proskuryakov.
235         Fix stupid performance problem in the LiteralParser
237         The LiteralParser was making a new UString in order to use
238         toDouble, however UString's toDouble allows a much wider range
239         of numberic strings than the LiteralParser accepts, and requires
240         an additional heap allocation or two for the construciton of the
241         UString.  To rectify this we just call WTF::dtoa directly using
242         a stack allocated buffer to hold the validated numeric literal.
244         * runtime/LiteralParser.cpp:
245         (JSC::LiteralParser::Lexer::lexNumber):
246         (JSC::LiteralParser::parse):
247         * runtime/LiteralParser.h:
249 2009-06-22  Oliver Hunt  <oliver@apple.com>
251         Reviewed by Alexey Proskuryakov.
253         Bug 26640: JSON.stringify needs to special case Boolean objects
254         <https://bugs.webkit.org/show_bug.cgi?id=26640>
256         Add special case handling of the Boolean object so we match current
257         ES5 errata.
259         * runtime/JSONObject.cpp:
260         (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString
261         (JSC::gap):
262         (JSC::Stringifier::appendStringifiedValue):
264 2009-06-22  Oliver Hunt  <oliver@apple.com>
266         Reviewed by Darin Adler.
268         Bug 26591: Support revivers in JSON.parse
269         <https://bugs.webkit.org/show_bug.cgi?id=26591>
271         Add reviver support to JSON.parse.  This completes the JSON object.
273         * runtime/JSONObject.cpp:
274         (JSC::Walker::Walker):
275         (JSC::Walker::callReviver):
276         (JSC::Walker::walk):
277         (JSC::JSONProtoFuncParse):
279 2009-06-21  Oliver Hunt  <oliver@apple.com>
281         Reviewed by Darin Adler.
283         Bug 26592: Support standard toJSON functions
284         <https://bugs.webkit.org/show_bug.cgi?id=26592>
286         Add support for the standard Date.toJSON function.
288         * runtime/DatePrototype.cpp:
289         (JSC::dateProtoFuncToJSON):
291 2009-06-21  Oliver Hunt  <oliver@apple.com>
293         Reviewed by Sam Weinig.
295         Bug 26594: JSC needs to support Date.toISOString
296         <https://bugs.webkit.org/show_bug.cgi?id=26594>
298         Add support for Date.toISOString.
300         * runtime/DatePrototype.cpp:
301         (JSC::dateProtoFuncToISOString):
303 2009-06-21  Oliver Hunt  <oliver@apple.com>
305         Reviewed by NOBODY (Build fix).
307         Remove dead code.
309         * runtime/LiteralParser.cpp:
310         (JSC::LiteralParser::parse):
312 2009-06-21  Oliver Hunt  <oliver@apple.com>
314         Reviewed by Darin Adler and Cameron Zwarich.
316         Bug 26587: Support JSON.parse
317         <https://bugs.webkit.org/show_bug.cgi?id=26587>
319         Extend the LiteralParser to support the full strict JSON
320         grammar, fix a few places where the grammar was incorrectly
321         lenient.   Doesn't yet support the JSON.parse reviver function
322         but that does not block the JSON.parse functionality itself.
324         * interpreter/Interpreter.cpp:
325         (JSC::Interpreter::callEval):
326         * runtime/JSGlobalObjectFunctions.cpp:
327         (JSC::globalFuncEval):
328         * runtime/JSONObject.cpp:
329         (JSC::JSONProtoFuncParse):
330         * runtime/LiteralParser.cpp:
331         (JSC::LiteralParser::Lexer::lex):
332         (JSC::isSafeStringCharacter):
333         (JSC::LiteralParser::Lexer::lexString):
334         (JSC::LiteralParser::parse):
335         * runtime/LiteralParser.h:
336         (JSC::LiteralParser::LiteralParser):
337         (JSC::LiteralParser::tryJSONParse):
338         (JSC::LiteralParser::):
339         (JSC::LiteralParser::Lexer::Lexer):
341 2009-06-21  David Levin  <levin@chromium.org>
343         Reviewed by NOBODY (speculative build fix for windows).
345         Simply removed some whitespace form this file to make windows build wtf and
346         hopefully copy the new MessageQueque.h so that WebCore picks it up.
348         * wtf/Assertions.cpp:
350 2009-06-21  Drew Wilson  <atwilson@google.com>
352         Reviewed by David Levin.
354         <https://bugs.webkit.org/show_bug.cgi?id=25043>
355         Added support for multi-threaded MessagePorts.
357         * wtf/MessageQueue.h:
358         (WTF::::appendAndCheckEmpty):
359             Added API to test whether the queue was empty before adding an element.
360   
361 2009-06-20  David D. Kilzer  <ddkilzer@webkit.org>
363         Fix namespace comment in SegmentedVector.h
365         * wtf/SegmentedVector.h: Updated namespace comment to reflect
366         new namespace after r44897.
368 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
370         Bug 24986: ARM JIT port
371         <https://bugs.webkit.org/show_bug.cgi?id=24986>
373         Reviewed by Oliver Hunt.
375         An Iterator added for SegmentedVector. Currently
376         only the pre ++ operator is supported.
378         * wtf/SegmentedVector.h:
379         (WTF::SegmentedVectorIterator::~SegmentedVectorIterator):
380         (WTF::SegmentedVectorIterator::operator*):
381         (WTF::SegmentedVectorIterator::operator->):
382         (WTF::SegmentedVectorIterator::operator++):
383         (WTF::SegmentedVectorIterator::operator==):
384         (WTF::SegmentedVectorIterator::operator!=):
385         (WTF::SegmentedVectorIterator::operator=):
386         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
387         (WTF::SegmentedVector::alloc):
388         (WTF::SegmentedVector::begin):
389         (WTF::SegmentedVector::end):
391 2009-06-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
393         Bug 24986: ARM JIT port
394         <https://bugs.webkit.org/show_bug.cgi?id=24986>
396         Reviewed by Oliver Hunt.
398         Move SegmentedVector to /wtf subdirectory
399         and change "namespace JSC" to "namespace WTF"
401         Additional build file updates by David Kilzer.
403         * GNUmakefile.am: Updated path to SegmentedVector.h.
404         * JavaScriptCore.order: Updated SegmentedVector namespace from
405         JSC to WTF in mangled C++ method name.
406         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
407         Removed reference to bytecompiler\SegmentedVector.h.
408         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
409         wtf\SegmentedVector.h.
410         * JavaScriptCore.xcodeproj/project.pbxproj: Moved
411         SegmentedVector.h definition from bytecompiler subdirectory to
412         wtf subdirectory.
413         * bytecompiler/BytecodeGenerator.h: Updated #include path to
414         SegmentedVector.h and prepended WTF:: namespace to its use.
415         * parser/Lexer.h: Ditto.
416         * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
417         (WTF::SegmentedVector::SegmentedVector):
418         (WTF::SegmentedVector::~SegmentedVector):
419         (WTF::SegmentedVector::size):
420         (WTF::SegmentedVector::at):
421         (WTF::SegmentedVector::operator[]):
422         (WTF::SegmentedVector::last):
423         (WTF::SegmentedVector::append):
424         (WTF::SegmentedVector::removeLast):
425         (WTF::SegmentedVector::grow):
426         (WTF::SegmentedVector::clear):
427         (WTF::SegmentedVector::deleteAllSegments):
428         (WTF::SegmentedVector::segmentExistsFor):
429         (WTF::SegmentedVector::segmentFor):
430         (WTF::SegmentedVector::subscriptFor):
431         (WTF::SegmentedVector::ensureSegmentsFor):
432         (WTF::SegmentedVector::ensureSegment):
434 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
436         Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
438         * jit/JIT.cpp:
439         (JSC::JIT::privateCompile):
440         (JSC::JIT::privateCompileCTIMachineTrampolines):
441         (JSC::JIT::emitGetVariableObjectRegister):
442         (JSC::JIT::emitPutVariableObjectRegister):
443         * jit/JIT.h:
444         * jit/JITArithmetic.cpp:
445         (JSC::JIT::emit_op_rshift):
446         (JSC::JIT::emitSlow_op_jnless):
447         (JSC::JIT::emitSlow_op_jnlesseq):
448         (JSC::JIT::compileBinaryArithOp):
449         * jit/JITCall.cpp:
450         (JSC::JIT::compileOpCallInitializeCallFrame):
451         (JSC::JIT::compileOpCall):
452         * jit/JITInlineMethods.h:
453         (JSC::JIT::restoreArgumentReference):
454         (JSC::JIT::checkStructure):
455         * jit/JITOpcodes.cpp:
456         (JSC::JIT::emit_op_instanceof):
457         (JSC::JIT::emit_op_get_scoped_var):
458         (JSC::JIT::emit_op_put_scoped_var):
459         (JSC::JIT::emit_op_construct_verify):
460         (JSC::JIT::emit_op_resolve_global):
461         (JSC::JIT::emit_op_jeq_null):
462         (JSC::JIT::emit_op_jneq_null):
463         (JSC::JIT::emit_op_to_jsnumber):
464         (JSC::JIT::emit_op_catch):
465         (JSC::JIT::emit_op_eq_null):
466         (JSC::JIT::emit_op_neq_null):
467         (JSC::JIT::emit_op_convert_this):
468         (JSC::JIT::emit_op_profile_will_call):
469         (JSC::JIT::emit_op_profile_did_call):
470         (JSC::JIT::emitSlow_op_get_by_val):
471         * jit/JITPropertyAccess.cpp:
472         (JSC::JIT::emit_op_get_by_val):
473         (JSC::JIT::emit_op_put_by_val):
474         (JSC::JIT::emit_op_method_check):
475         (JSC::JIT::compileGetByIdHotPath):
476         (JSC::JIT::emit_op_put_by_id):
477         (JSC::JIT::compilePutDirectOffset):
478         (JSC::JIT::compileGetDirectOffset):
479         (JSC::JIT::privateCompilePutByIdTransition):
480         (JSC::JIT::privateCompilePatchGetArrayLength):
481         * jit/JITStubs.cpp:
482         (JSC::JITThunks::JITThunks):
484 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
486         Reviewed by NOBODY (Windows build fix).
488         * jit/JIT.h:
489         * jit/JITInlineMethods.h:
491 2009-06-19  Gabor Loki  <loki@inf.u-szeged.hu>
493         Reviewed by Gavin Barraclough.
495         Reorganize ARM architecture specific macros.
496         Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7).
498         Bug 24986: ARM JIT port
499         <https://bugs.webkit.org/show_bug.cgi?id=24986>
501         * assembler/ARMv7Assembler.h:
502         * assembler/AbstractMacroAssembler.h:
503         (JSC::AbstractMacroAssembler::Imm32::Imm32):
504         * assembler/MacroAssembler.h:
505         * assembler/MacroAssemblerCodeRef.h:
506         (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
507         * jit/ExecutableAllocator.h:
508         (JSC::ExecutableAllocator::cacheFlush):
509         * jit/JIT.h:
510         * jit/JITInlineMethods.h:
511         (JSC::JIT::restoreArgumentReferenceForTrampoline):
512         * jit/JITStubs.cpp:
513         * jit/JITStubs.h:
514         * wtf/Platform.h:
515         * yarr/RegexJIT.cpp:
516         (JSC::Yarr::RegexGenerator::generateEnter):
517         (JSC::Yarr::RegexGenerator::generateReturn):
519 2009-06-19  Gavin Barraclough  <barraclough@apple.com>
521         Reviewed by Oliver Hunt.
523         Fix armv7 JIT build issues.
525         Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types),
526         and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros.
528         * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects).
529         * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor.
531         * jit/JIT.cpp:
532         * jit/JIT.h:
533         * jit/JITInlineMethods.h:
534         (JSC::JIT::restoreArgumentReference):
535         * jit/JITOpcodes.cpp:
536         (JSC::JIT::emit_op_catch):
537         * jit/JITStubs.cpp:
538         (JSC::JITThunks::JITThunks):
540 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
542         Blind attempt at build fix.
544         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
545         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
547 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
549         Reviewed by Oliver Hunt.
551         Inherits CallIdentifier struct from FastAllocBase because it has been
552         instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86.
554         * wtf/HashCountedSet.h:
556 2009-06-19  Adam Treat  <adam.treat@torchmobile.com>
558         Reviewed by Oliver Hunt.
560         https://bugs.webkit.org/show_bug.cgi?id=26540
561         Modify the test shell to add a new function 'checkSyntax' that will
562         only parse the source instead of executing it. In this way we can test
563         pure parsing performance against some of the larger scripts in the wild.
565         * jsc.cpp:
566         (GlobalObject::GlobalObject):
567         (functionCheckSyntax):
569 2009-06-19  Zoltan Horvath  <hzoltan@inf.u-szeged.hu>
571         Reviewed by Darin Adler.
572         
573         Inherits HashCountedSet class from FastAllocBase because it has been
574         instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095.
576         * wtf/HashCountedSet.h:
578 2009-06-19  Yong Li  <yong.li@torchmobile.com>
580         Reviewed by George Staikos.
582         https://bugs.webkit.org/show_bug.cgi?id=26558
583         Declare these symbols extern for WINCE as they are provided by libce.
585         * runtime/DateConstructor.cpp:
586         * runtime/DatePrototype.cpp:
587         (JSC::formatLocaleDate):
589 2009-06-19  Oliver Hunt  <oliver@apple.com>
591         Reviewed by Maciej Stachowiak.
593         <rdar://problem/6988973> ScopeChain leak in interpreter builds
595         Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT)
596         path.
598         * runtime/JSFunction.cpp:
599         (JSC::JSFunction::~JSFunction):
600         * wtf/Platform.h:
602 2009-06-19  Yong Li  <yong.li@torchmobile.com>
604         Reviewed by George Staikos.
606         https://bugs.webkit.org/show_bug.cgi?id=26543
607         Windows CE uses 'GetLastError' instead of 'errno.'
609         * interpreter/RegisterFile.h:
610         (JSC::RegisterFile::RegisterFile):
611         (JSC::RegisterFile::grow):
613 2009-06-19  David Levin  <levin@chromium.org>
615         Reviewed by NOBODY (Windows build fix).
617         Add export for Windows corresponding to OSX export done in r44844.
618         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
619         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
621 2009-06-18  Oliver Hunt  <oliver@apple.com>
623         Reviewed by Gavin "Viceroy of Venezuela" Barraclough.
625         Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
626         <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>
628         We need to make sure that each native function instance correctly unlinks any references to it
629         when it is collected.  Allowing this to happen required a few changes:
630             * Every native function needs a codeblock to track the link information
631             * To have this codeblock, every function now also needs its own functionbodynode
632               so we no longer get to have a single shared instance.
633             * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
635         * JavaScriptCore.exp:
636         * bytecode/CodeBlock.cpp:
637         (JSC::CodeBlock::CodeBlock):
638            Constructor for NativeCode CodeBlock
639         (JSC::CodeBlock::derefStructures):
640         (JSC::CodeBlock::refStructures):
641         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
642         (JSC::CodeBlock::handlerForBytecodeOffset):
643         (JSC::CodeBlock::lineNumberForBytecodeOffset):
644         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
645         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
646         (JSC::CodeBlock::functionRegisterForBytecodeOffset):
647         (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
648         (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
649         (JSC::CodeBlock::setJITCode):
650            Add assertions to ensure we don't try and use NativeCode CodeBlocks as
651            a normal codeblock.
653         * bytecode/CodeBlock.h:
654         (JSC::):
655         (JSC::CodeBlock::source):
656         (JSC::CodeBlock::sourceOffset):
657         (JSC::CodeBlock::evalCodeCache):
658         (JSC::CodeBlock::createRareDataIfNecessary):
659           More assertions.
661         * jit/JIT.cpp:
662         (JSC::JIT::privateCompileCTIMachineTrampolines):
663         (JSC::JIT::linkCall):
664           Update logic to allow native function caching
666         * jit/JITStubs.cpp:
667         * parser/Nodes.cpp:
668         (JSC::FunctionBodyNode::createNativeThunk):
669         (JSC::FunctionBodyNode::isHostFunction):
670         * parser/Nodes.h:
671         * runtime/JSFunction.cpp:
672         (JSC::JSFunction::JSFunction):
673         (JSC::JSFunction::~JSFunction):
674         (JSC::JSFunction::mark):
675         * runtime/JSGlobalData.cpp:
676         (JSC::JSGlobalData::~JSGlobalData):
677         * runtime/JSGlobalData.h:
679 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
681         Reviewed by NOBODY (Windows build fix).
683         * wtf/DateMath.cpp:
684         (WTF::calculateUTCOffset):
686 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
688         Reviewed by Geoff Garen.
690         Timezone calculation incorrect in Venezuela.
692         https://bugs.webkit.org/show_bug.cgi?id=26531
693         <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3
695         The problem is that we're calculating the timezone relative to 01/01/2000,
696         but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007.
697         According to the spec, section 15.9.1.9 states "the time since the beginning
698         of the year", presumably meaning the *current* year.  Change the calculation
699         to be based on whatever the current year is, rather than a canned date.
701         No performance impact.
703         * wtf/DateMath.cpp:
704         (WTF::calculateUTCOffset):
706 2009-06-18  Gavin Barraclough  <barraclough@apple.com>
708         Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).
710         (Reintroducing patch added in r44492, and reverted in r44796.)
712         Change the implementation of op_throw so the stub function always modifies its
713         return address - if it doesn't find a 'catch' it will switch to a trampoline
714         to force a return from JIT execution.  This saves memory, by avoiding the need
715         for a unique return for every op_throw.
717         * jit/JITOpcodes.cpp:
718         (JSC::JIT::emit_op_throw):
719             JITStubs::cti_op_throw now always changes its return address,
720             remove return code generated after the stub call (this is now
721             handled by ctiOpThrowNotCaught).
722         * jit/JITStubs.cpp:
723         (JSC::):
724             Add ctiOpThrowNotCaught definitions.
725         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
726             Change cti_op_throw to always change its return address.
727         * jit/JITStubs.h:
728             Add ctiOpThrowNotCaught declaration.
730 2009-06-18  Kevin McCullough  <kmccullough@apple.com>
732         Reviewed by Oliver Hunt.
734         <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit
736         - Exposed functions now needed by WebCore.
738         * JavaScriptCore.exp:
740 2009-06-17  Darin Adler  <darin@apple.com>
742         Reviewed by Oliver Hunt.
744         Bug 26429: Make JSON.stringify non-recursive so it can handle objects
745         of arbitrary complexity
746         https://bugs.webkit.org/show_bug.cgi?id=26429
748         For marking I decided not to use gcProtect, because this is inside the engine
749         so it's easy enough to just do marking. And that darned gcProtect does locking!
750         Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor
751         for that class says "FIXME: Remove all clients of this API, then remove this API."
753         * runtime/Collector.cpp:
754         (JSC::Heap::collect): Add a call to JSONObject::markStringifiers.
756         * runtime/CommonIdentifiers.cpp:
757         (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier.
758         * runtime/CommonIdentifiers.h: Ditto.
760         * runtime/JSGlobalData.cpp:
761         (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0.
762         * runtime/JSGlobalData.h: Added firstStringifierToMark.
764         * runtime/JSONObject.cpp: Cut down the includes to the needed ones only.
765         (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string
766         objects to get their number and string values.
767         (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used
768         to wrap an identifier or integer so we don't have to do any work unless we
769         actually call a replacer.
770         (JSC::ReplacerPropertyName::value): Added.
771         (JSC::gap): Added. Helper function for the Stringifier constructor.
772         (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added.
773         The class is used to wrap an identifier or integer so we don't have to
774         allocate a number or string until we actually call toJSON or a replacer.
775         (JSC::PropertyNameForFunctionCall::asJSValue): Added.
776         (JSC::Stringifier::Stringifier): Updated and moved out of the class
777         definition. Added code to hook this into a singly linked list for marking.
778         (JSC::Stringifier::~Stringifier): Remove from the singly linked list.
779         (JSC::Stringifier::mark): Mark all the objects in the holder stacks.
780         (JSC::Stringifier::stringify): Updated.
781         (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit.
782         (JSC::Stringifier::toJSON): Renamed from toJSONValue.
783         (JSC::Stringifier::appendStringifiedValue): Renamed from stringify.
784         Added code to use the m_holderStack to do non-recursive stringify of
785         objects and arrays. This code also uses the timeout checker since in
786         pathological cases it could be slow even without calling into the
787         JavaScript virtual machine.
788         (JSC::Stringifier::willIndent): Added.
789         (JSC::Stringifier::indent): Added.
790         (JSC::Stringifier::unindent): Added.
791         (JSC::Stringifier::startNewLine): Added.
792         (JSC::Stringifier::Holder::Holder): Added.
793         (JSC::Stringifier::Holder::appendNextProperty): Added. This is the
794         function that handles the format of arrays and objects.
795         (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom
796         of the file so the JSONObject class is not interleaved with the
797         Stringifier class.
798         (JSC::JSONObject::markStringifiers): Added. Calls mark.
799         (JSC::JSONProtoFuncStringify): Streamlined the code here. The code
800         to compute the gap string is now a separate function.
802         * runtime/JSONObject.h: Made everything private. Added markStringifiers.
804 2009-06-17  Oliver Hunt  <oliver@apple.com>
806         Reviewed by Gavin Barraclough.
808         <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com
810         Roll out r43849 as it appears that we cannot rely on the address of
811         an objects property storage being constant even if the structure is
812         unchanged.
814         * jit/JIT.h:
815         * jit/JITPropertyAccess.cpp:
816         (JSC::JIT::compileGetDirectOffset):
817         (JSC::JIT::privateCompileGetByIdProto):
818         (JSC::JIT::privateCompileGetByIdProtoList):
819         (JSC::JIT::privateCompileGetByIdChainList):
820         (JSC::JIT::privateCompileGetByIdChain):
822 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
824         Rubber Stamped by Mark Rowe.
826         Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>.
828         * jit/JITOpcodes.cpp:
829         (JSC::JIT::emit_op_throw):
830         * jit/JITStubs.cpp:
831         (JSC::):
832         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
833         * jit/JITStubs.h:
835 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
837         Reviewed by Mark Rowe.
839         <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit
841         On 64-bit, NaN-encoded values must be detagged before they can be used in rshift.
843         No performance impact.
845         * jit/JITArithmetic.cpp:
846         (JSC::JIT::emit_op_rshift):
848 2009-06-17  Adam Treat  <adam.treat@torchmobile.com>
850         Reviewed by George Staikos.
852         https://bugs.webkit.org/show_bug.cgi?id=23155
853         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
855         * jsc.cpp:
856         (main):
858 2009-06-17  George Staikos  <george.staikos@torchmobile.com>
860         Reviewed by Adam Treat.
862         https://bugs.webkit.org/show_bug.cgi?id=23155
863         Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
865         * config.h:
866         * jsc.cpp:
867         * wtf/Assertions.cpp:
868         * wtf/Assertions.h:
869         * wtf/CurrentTime.cpp:
870         (WTF::lowResUTCTime):
871         * wtf/DateMath.cpp:
872         (WTF::getLocalTime):
873         * wtf/MathExtras.h:
874         * wtf/Platform.h:
875         * wtf/StringExtras.h:
876         * wtf/Threading.h:
877         * wtf/win/MainThreadWin.cpp:
879 2009-06-17  Gavin Barraclough  <barraclough@apple.com>
881         Reviewed by Oliver Hunt.
883         <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com
885         Remove PropertySlot::putValue - PropertySlots should only be used for getting,
886         not putting.  Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
887         which is what it really was being used to ask, and remove some other getOwnPropertySlot
888         & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.
890         * runtime/JSGlobalObject.h:
891         (JSC::JSGlobalObject::hasOwnPropertyForWrite):
892         * runtime/JSObject.h:
893         * runtime/JSStaticScopeObject.cpp:
894         * runtime/JSStaticScopeObject.h:
895         * runtime/PropertySlot.h:
897 2009-06-16  Gavin Barraclough  <barraclough@apple.com>
899         Reviewed by Oliver hunt.
901         Temporarily partially disable r44492, since this is causing some problems on internal builds.
903         * jit/JITOpcodes.cpp:
904         (JSC::JIT::emit_op_throw):
905         * jit/JITStubs.cpp:
906         (JSC::JITStubs::DEFINE_STUB_FUNCTION):
908 2009-06-16  Sam Weinig  <sam@webkit.org>
910         Fix windows build.
912         * jit/JIT.cpp:
913         (JSC::JIT::JIT):
915 2009-06-16  Sam Weinig  <sam@webkit.org>
917         Reviewed by Oliver Hunt.
919         Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
920         it for each type of stub using the return address to find the correct
921         offset.
923         * jit/JIT.cpp:
924         (JSC::JIT::JIT):
925         * jit/JIT.h:
926         (JSC::JIT::compileGetByIdProto):
927         (JSC::JIT::compileGetByIdSelfList):
928         (JSC::JIT::compileGetByIdProtoList):
929         (JSC::JIT::compileGetByIdChainList):
930         (JSC::JIT::compileGetByIdChain):
931         (JSC::JIT::compilePutByIdTransition):
932         (JSC::JIT::compileCTIMachineTrampolines):
933         (JSC::JIT::compilePatchGetArrayLength):
934         * jit/JITStubCall.h:
935         (JSC::JITStubCall::call):
937 == Rolled over to ChangeLog-2009-06-16 ==