1 2009-05-18 Maciej Stachowiak <mjs@apple.com>
3 Reviewed by Oliver Hunt.
5 - tighten up the code for the load_varargs stub
10 (JSC::JITStubs::cti_op_load_varargs): Hoist some loop invariants that
11 the compiler didn't feel like hoisting for us. Remove unneeded exception check.
13 2009-05-18 Maciej Stachowiak <mjs@apple.com>
15 Reviewed by Geoff Garen.
17 - Improve code generation for access to prototype properties
19 ~0.4% speedup on SunSpider.
21 Based on a suggestion from Geoff Garen.
24 * jit/JITPropertyAccess.cpp:
25 (JSC::JIT::compileGetDirectOffset):
26 (JSC::JIT::privateCompileGetByIdProto):
27 (JSC::JIT::privateCompileGetByIdProtoList):
28 (JSC::JIT::privateCompileGetByIdChainList):
29 (JSC::JIT::privateCompileGetByIdChain):
31 2009-05-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
33 Reviewed by Gavin Barraclough.
35 Enable YARR, and disable WREC for GTK+.
40 2009-05-18 Jan Michael Alonzo <jmalonzo@webkit.org>
42 Reviewed by Xan Lopez.
44 [Gtk] Various autotools build refactoring and fixes
45 https://bugs.webkit.org/show_bug.cgi?id=25286
47 Add -no-install and -no-fast-install to programs and tests that we
48 don't install. Also remove -O2 since this is already handled at
53 2009-05-17 Jan Michael Alonzo <jmalonzo@webkit.org>
55 Reviewed by Xan Lopez.
57 [Gtk] Various autotools build refactoring and fixes
58 https://bugs.webkit.org/show_bug.cgi?id=25286
60 Add JavaScriptCore/ to JSC include path only since it's not
61 required when building WebCore.
65 2009-05-17 Steve Falkenburg <sfalken@apple.com>
69 * JavaScriptCore.vcproj/JavaScriptCore.make:
70 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
72 2009-05-15 Gavin Barraclough <barraclough@apple.com>
74 Reviewed by Oliver Hunt.
76 Looking like MSVC doesn't like static variables in inline methods?
77 Make the state of the SSE2 check a static variable on the class
78 MacroAssemblerX86Common as a speculative build fix for Windows.
80 * assembler/MacroAssemblerX86Common.h:
81 (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
82 (JSC::MacroAssemblerX86Common::branchDouble):
83 (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
84 (JSC::MacroAssemblerX86Common::isSSE2Present):
85 (JSC::MacroAssemblerX86Common::):
88 2009-05-15 Adam Roben <aroben@apple.com>
90 Add some assembler headers to JavaScriptCore.vcproj
92 This is just a convenience for Windows developers.
94 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
96 2009-05-15 Gavin Barraclough <barraclough@apple.com>
98 Reviewed by Oliver Hunt.
100 Add FP support to the MacroAssembler, port JITArithmetic over to make use of this. Also add
101 API to determine whether FP support is available 'MacroAssembler::supportsFloatingPoint()',
102 FP is presently only supported on SSE2 platforms, not x87. On platforms where a suitable
103 hardware FPU is not available 'supportsFloatingPoint()' may simply return false, and all
104 other methods ASSERT_NOT_REACHED().
106 * assembler/AbstractMacroAssembler.h:
107 * assembler/MacroAssemblerX86.h:
108 (JSC::MacroAssemblerX86::MacroAssemblerX86):
109 (JSC::MacroAssemblerX86::branch32):
110 (JSC::MacroAssemblerX86::branchPtrWithPatch):
111 (JSC::MacroAssemblerX86::supportsFloatingPoint):
112 * assembler/MacroAssemblerX86Common.h:
113 (JSC::MacroAssemblerX86Common::):
114 (JSC::MacroAssemblerX86Common::loadDouble):
115 (JSC::MacroAssemblerX86Common::storeDouble):
116 (JSC::MacroAssemblerX86Common::addDouble):
117 (JSC::MacroAssemblerX86Common::subDouble):
118 (JSC::MacroAssemblerX86Common::mulDouble):
119 (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
120 (JSC::MacroAssemblerX86Common::branchDouble):
121 (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
122 (JSC::MacroAssemblerX86Common::branch32):
123 (JSC::MacroAssemblerX86Common::branch16):
124 (JSC::MacroAssemblerX86Common::branchTest32):
125 (JSC::MacroAssemblerX86Common::branchAdd32):
126 (JSC::MacroAssemblerX86Common::branchMul32):
127 (JSC::MacroAssemblerX86Common::branchSub32):
128 (JSC::MacroAssemblerX86Common::set32):
129 (JSC::MacroAssemblerX86Common::setTest32):
130 (JSC::MacroAssemblerX86Common::x86Condition):
131 (JSC::MacroAssemblerX86Common::isSSE2Present):
132 * assembler/MacroAssemblerX86_64.h:
133 (JSC::MacroAssemblerX86_64::movePtrToDouble):
134 (JSC::MacroAssemblerX86_64::moveDoubleToPtr):
135 (JSC::MacroAssemblerX86_64::setPtr):
136 (JSC::MacroAssemblerX86_64::branchPtr):
137 (JSC::MacroAssemblerX86_64::branchTestPtr):
138 (JSC::MacroAssemblerX86_64::branchAddPtr):
139 (JSC::MacroAssemblerX86_64::branchSubPtr):
140 (JSC::MacroAssemblerX86_64::supportsFloatingPoint):
141 * assembler/X86Assembler.h:
145 * jit/JITArithmetic.cpp:
146 (JSC::JIT::emit_op_rshift):
147 (JSC::JIT::emitSlow_op_rshift):
148 (JSC::JIT::emitSlow_op_jnless):
149 (JSC::JIT::emitSlow_op_jnlesseq):
150 (JSC::JIT::compileBinaryArithOp):
151 (JSC::JIT::compileBinaryArithOpSlowCase):
152 (JSC::JIT::emit_op_add):
153 (JSC::JIT::emitSlow_op_add):
154 (JSC::JIT::emit_op_mul):
155 (JSC::JIT::emitSlow_op_mul):
156 * jit/JITPropertyAccess.cpp:
157 (JSC::JIT::privateCompilePutByIdTransition):
159 2009-05-15 Francisco Tolmasky <francisco@280north.com>
161 BUG 25467: JavaScript debugger should use function.displayName as the function's name in the call stack
162 <https://bugs.webkit.org/show_bug.cgi?id=25467>
164 Reviewed by Adam Roben.
166 * JavaScriptCore.exp: Added calculatedFunctionName
167 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Added calculatedFunctionName
168 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added calculatedFunctionName
169 * debugger/DebuggerCallFrame.cpp: Added calculatedFunctionName to match existing one in ProfileNode.
170 (JSC::DebuggerCallFrame::calculatedFunctionName):
171 * debugger/DebuggerCallFrame.h: Added calculatedFunctionName to match existing one in ProfileNode.
173 2009-05-14 Gavin Barraclough <barraclough@apple.com>
175 Build fix, not reviewed.
177 Quick fixes for JIT builds with OPTIMIZE flags disabled.
180 (JSC::JIT::compileOpCall):
181 (JSC::JIT::compileOpCallSlowCase):
182 * jit/JITPropertyAccess.cpp:
183 (JSC::JIT::compilePutByIdHotPath):
185 2009-05-14 Steve Falkenburg <sfalken@apple.com>
187 Back out incorrect Windows build fix
189 * JavaScriptCore.vcproj/JavaScriptCore.make:
190 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
192 2009-05-14 Steve Falkenburg <sfalken@apple.com>
196 * JavaScriptCore.vcproj/JavaScriptCore.make:
197 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
199 2009-05-14 Adam Roben <aroben@apple.com>
201 Windows jsc build fix
203 r43648 modified jsc.vcproj's post-build event not to try to copy files
204 that aren't present. Then r43661 mistakenly un-did that modification.
205 This patch restores the modification from r43648, but puts the code in
206 jscCommon.vsprops (where it should have been added in r43648).
208 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Restored empty
209 VCPostBuildEventTool tags.
210 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Modified the post-build
211 event command line to match the one in jsc.vcproj from r43648.
213 2009-05-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
215 Reviewed by Darin Adler.
217 https://bugs.webkit.org/show_bug.cgi?id=25325
219 Make sure pthread_self() is declared before it gets called in Collector.cpp
221 * runtime/Collector.cpp: Include pthread.h in most Unix-like platforms
222 (not just for OPENBSD)
224 2009-05-14 Mark Rowe <mrowe@apple.com>
226 Reviewed by Oliver Hunt.
228 Fix <https://bugs.webkit.org/show_bug.cgi?id=25785>.
229 Bug 25785: Segfault in mark when using JSObjectMakeConstructor
231 * API/JSObjectRef.cpp:
232 (JSObjectMakeConstructor): OpaqueJSClass::prototype can return 0. We need to use the default object prototype when it does.
233 * API/tests/testapi.c:
234 (main): Add a test case.
235 * runtime/JSObject.h:
236 (JSC::JSObject::putDirect): Add a clearer assertion for a null value. The assertion on the next line does catch this,
237 but the cause of the failure is not clear from the assertion itself.
239 2009-05-14 Mark Rowe <mrowe@apple.com>
241 Rubber-stamped by Darin Adler.
243 <rdar://problem/6681868> When building with Xcode 3.1.3 should be using gcc 4.2
245 The meaning of XCODE_VERSION_ACTUAL is more sensible in newer versions of Xcode.
246 Update our logic to select the compiler version to use the more appropriate XCODE_VERSION_MINOR
247 if the version of Xcode supports it, and fall back to XCODE_VERSION_ACTUAL if not.
249 * Configurations/Base.xcconfig:
251 2009-05-14 Gavin Barraclough <barraclough@apple.com>
253 Reviewed by Geoff Garen.
255 Checking register file bounds should be a ptr comparison (m_end is a Register*).
256 Also, the compare should be unsigned, pointers don'ts go negative.
259 (JSC::JIT::privateCompile):
261 2009-05-13 Gavin Barraclough <barraclough@apple.com>
263 Reviewed by Oliver Hunt.
265 Fix <rdar://problem/6882919> REGRESSION: page at Metroauto site crashes in cti_op_loop_if_less (25730)
267 op_loop_if_less (imm < op) was loading op into regT1, but in the slow path spills regT0.
268 This leads to bad happen.
270 * jit/JITOpcodes.cpp:
271 (JSC::JIT::emit_op_loop_if_less):
272 (JSC::JIT::emitSlow_op_loop_if_less):
274 2009-05-13 Dmitry Titov <dimich@chromium.org>
276 Rubber-stamped by Mark Rowe.
278 https://bugs.webkit.org/show_bug.cgi?id=25746
279 Revert http://trac.webkit.org/changeset/43507 which caused crash in PPC nightlies with Safari 4.
281 * JavaScriptCore.exp:
282 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
283 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
284 * bytecode/SamplingTool.cpp:
285 (JSC::SamplingThread::start):
286 (JSC::SamplingThread::stop):
287 * bytecode/SamplingTool.h:
288 * wtf/CrossThreadRefCounted.h:
289 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
293 * wtf/ThreadingNone.cpp:
294 * wtf/ThreadingPthreads.cpp:
295 (WTF::threadMapMutex):
296 (WTF::initializeThreading):
298 (WTF::identifierByPthreadHandle):
299 (WTF::establishIdentifierForPthreadHandle):
300 (WTF::pthreadHandleForIdentifier):
301 (WTF::clearPthreadHandleForIdentifier):
302 (WTF::createThreadInternal):
303 (WTF::waitForThreadCompletion):
305 (WTF::currentThread):
306 * wtf/ThreadingWin.cpp:
307 (WTF::threadMapMutex):
308 (WTF::initializeThreading):
310 (WTF::storeThreadHandleByIdentifier):
311 (WTF::threadHandleForIdentifier):
312 (WTF::clearThreadHandleForIdentifier):
313 (WTF::createThreadInternal):
314 (WTF::waitForThreadCompletion):
316 (WTF::currentThread):
317 * wtf/gtk/ThreadingGtk.cpp:
318 (WTF::threadMapMutex):
319 (WTF::initializeThreading):
321 (WTF::identifierByGthreadHandle):
322 (WTF::establishIdentifierForThread):
323 (WTF::threadForIdentifier):
324 (WTF::clearThreadForIdentifier):
325 (WTF::createThreadInternal):
326 (WTF::waitForThreadCompletion):
327 (WTF::currentThread):
328 * wtf/qt/ThreadingQt.cpp:
329 (WTF::threadMapMutex):
331 (WTF::identifierByQthreadHandle):
332 (WTF::establishIdentifierForThread):
333 (WTF::clearThreadForIdentifier):
334 (WTF::threadForIdentifier):
335 (WTF::initializeThreading):
336 (WTF::createThreadInternal):
337 (WTF::waitForThreadCompletion):
338 (WTF::currentThread):
340 2009-05-13 Darin Adler <darin@apple.com>
342 Revert the parser arena change. It was a slowdown, not a speedup.
343 Better luck next time (I'll break it up into pieces).
345 2009-05-13 Darin Adler <darin@apple.com>
349 * parser/Grammar.y: Add back empty code blocks, needed by older
350 versions of bison on certain rules.
352 2009-05-13 Steve Falkenburg <sfalken@apple.com>
356 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
358 2009-05-13 Adam Roben <aroben@apple.com>
360 Windows build fixes after r43642
362 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
363 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
366 * debugger/Debugger.cpp:
367 * runtime/ArrayConstructor.cpp:
368 * runtime/JSArray.cpp:
369 * runtime/RegExp.cpp:
370 * runtime/RegExpConstructor.cpp:
371 * runtime/RegExpPrototype.cpp:
372 * runtime/StringPrototype.cpp:
373 Added missing #includes.
375 2009-05-13 Darin Adler <darin@apple.com>
377 Reviewed by Cameron Zwarich.
379 Bug 25674: syntax tree nodes should use arena allocation
380 https://bugs.webkit.org/show_bug.cgi?id=25674
382 Step 3: Add some actual arena allocation. About 1% SunSpider speedup.
384 * JavaScriptCore.exp: Updated.
386 * bytecompiler/BytecodeGenerator.cpp:
387 (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
388 contains const Identifier* now.
389 (JSC::BytecodeGenerator::emitPushNewScope): Updated to take a const
391 * bytecompiler/BytecodeGenerator.h: Ditto
393 * bytecompiler/SegmentedVector.h: Added isEmpty.
395 * debugger/Debugger.cpp:
396 (JSC::Debugger::recompileAllJSFunctions): Moved this function here from
397 WebCore so WebCore doesn't need the details of FunctionBodyNode.
398 * debugger/Debugger.h: Ditto.
400 * interpreter/Interpreter.cpp:
401 (JSC::Interpreter::execute): Updated since VarStack contains const
405 (JSC::JITStubs::cti_vm_lazyLinkCall): Call isHostFunction on the body
406 rather than on the function object, since we can't easily have inlined
407 access to the FunctionBodyNode in JSFunction.h since WebCore needs
408 access to that header.
409 (JSC::JITStubs::cti_op_construct_JSConstruct): Ditto.
410 * profiler/Profiler.cpp:
411 (JSC::Profiler::createCallIdentifier): Ditto.
413 * parser/Grammar.y: Use JSGlobalData* to pass the global data pointer
414 around whenever possible instead of using void*. Changed
415 SET_EXCEPTION_LOCATION from a macro to an inline function. Marked
416 the structure-creating functions inline. Changed the VarStack to use
417 identifier pointers instead of actual identifiers. This takes
418 advantage of the fact that all identifier pointers come from the
419 arena and avoids reference count churn. Changed Identifier* to
420 const Identifier* to make sure we don't modify any by accident.
421 Used identifiers for regular expression strings too, using the new
422 scanRegExp that has out parameters instead of the old one that relied
423 on side effects in the Lexer. Move the creation of numeric identifiers
424 out of this file and into the PropertyNode constructor.
427 (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
428 (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
429 and changed to call ParserArena.
430 (JSC::Lexer::scanRegExp): Added out arguments that are const Identifier*
431 as well as a prefix character argument so we can handle the /= case
432 without a string append.
433 (JSC::Lexer::skipRegExp): Added. Skips a regular expression without
434 allocating Identifier objects.
435 (JSC::Lexer::clear): Removed the code to manage m_identifiers, m_pattern,
436 and m_flags, and added code to set m_arena to 0.
437 * parser/Lexer.h: Updated for changes above.
439 * parser/NodeConstructors.h:
440 (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
442 (JSC::ParserArenaDeletable::operator new): Changed to call the
443 allocateDeletable function on the arena instead of deleteWithArena.
444 (JSC::RegExpNode::RegExpNode): Changed arguments to Identifier instead
445 of UString since these come from the parser which makes identifiers.
446 (JSC::PropertyNode::PropertyNode): Added new constructor that makes
447 numeric identifiers. Some day we might want to optimize this for
448 integers so it doesn't create a string for each one.
449 (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
450 since it's now a const Identifier& so it can't be left uninitialized.
451 (JSC::BreakNode::BreakNode): Ditto.
452 (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
453 to keep track of the statements rather than a separate statement vector.
454 (JSC::BlockNode::BlockNode): Ditto.
455 (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
457 * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
458 It seemed strangely out of place in the header.
459 (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
460 UString as well as Identifier.
461 (JSC::SourceElements::singleStatement): Added.
462 (JSC::SourceElements::lastStatement): Added.
463 (JSC::RegExpNode::emitBytecode): Updated since the pattern and flags
464 are now Identifier instead of UString. Also changed the throwError code
465 to use the substitution mechanism instead of doing a string append.
466 (JSC::SourceElements::emitBytecode): Added. Replaces the old
467 statementListEmitCode function, since we now keep the SourceElements
469 (JSC::BlockNode::lastStatement): Added.
470 (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
471 statementListEmitCode.
472 (JSC::CaseClauseNode::emitBytecode): Added.
473 (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
474 instead of statementListEmitCode.
475 (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
476 SourceElements* instead of using releaseContentsIntoVector.
477 (JSC::ScopeNode::emitStatementsBytecode): Added.
478 (JSC::ScopeNode::singleStatement): Added.
479 (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
480 of statementListEmitCode.
481 (JSC::EvalNode::emitBytecode): Ditto.
482 (JSC::EvalNode::generateBytecode): Removed code to clear the children
483 vector. This optimization is no longer possible since everything is in
485 (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
486 insetad of statementListEmitCode and check for the return node using
489 * parser/Nodes.h: Changed VarStack to store const Identifier* instead
490 of Identifier and rely on the arena to control lifetime. Added a new
491 ParserArenaFreeable class. Made ParserArenaDeletable inherit from
492 FastAllocBase instead of having its own operator new. Base the Node
493 class on ParserArenaFreeable. Changed the various Node classes
494 to use const Identifier& instead of Identifier to avoid the need to
495 call their destructors and allow them to function as "freeable" in the
496 arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
497 Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
498 CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
499 as a base class since they do not descend from Node. Eliminated the
500 StatementVector type and instead have various classes use SourceElements*
501 instead of StatementVector. This prevents those classes from having th
502 use ParserArenaDeletable to make sure the vector destructor is called.
505 (JSC::Parser::parse): Pass the arena to the lexer.
507 * parser/Parser.h: Added an include of ParserArena.h, which is no longer
510 * parser/ParserArena.cpp:
511 (JSC::ParserArena::ParserArena): Added. Initializes the new members,
512 m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
513 (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
514 since we store only the current pointer and the end of pool pointer.
515 (JSC::ParserArena::deallocateObjects): Added. Contains the common
516 memory-deallocation logic used by both the destructor and the
518 (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
519 (JSC::ParserArena::reset): Ditto. Also added code to zero out the
520 new structures, and switched to use clear() instead of shrink(0) since
521 we don't really reuse arenas.
522 (JSC::ParserArena::makeNumericIdentifier): Added.
523 (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
525 (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
526 since this is used only for assertions at the moment.
528 * parser/ParserArena.h: Added an actual arena of "freeable" objects,
529 ones that don't need destructors to be called. Also added the segmented
530 vector of identifiers that used to be in the Lexer.
532 * runtime/FunctionConstructor.cpp:
533 (JSC::extractFunctionBody): Use singleStatement function rather than
534 getting at a StatementVector.
536 * runtime/FunctionPrototype.cpp:
537 (JSC::functionProtoFuncToString): Call isHostFunction on the body
538 rather than the function object.
540 * runtime/JSFunction.cpp:
541 (JSC::JSFunction::JSFunction): Moved the structure version of this in
542 here from the header. It's not hot enough that it needs to be inlined.
543 (JSC::JSFunction::isHostFunction): Moved this in here from the header.
544 It's now a helper to be used only within the class.
545 (JSC::JSFunction::setBody): Moved this in here. It's not hot enough that
546 it needs to be inlined, and we want to be able to compile the header
547 without the definition of FunctionBodyNode.
549 * runtime/JSFunction.h: Eliminated the include of "Nodes.h". This was
550 exposing too much JavaScriptCore dependency to WebCore. Because of this
551 change and some changes made to WebCore, we could now export a lot fewer
552 headers from JavaScriptCore, but I have not done that yet in this check-in.
553 Made a couple functions non-inline. Removes some isHostFunction() assertions.
555 * wtf/FastAllocBase.h: Added the conventional using statements we use in
556 WTF so we can use identifiers from the WTF namespace without explicit
557 namespace qualification or namespace directive. This is the usual WTF style,
558 although it's unconventional in the C++ world. We use the namespace primarily
559 for link-time disambiguation, not compile-time.
561 * wtf/FastMalloc.cpp: Fixed an incorrect comment.
563 2009-05-13 Xan Lopez <xlopez@igalia.com>
565 Unreviewed build fix: add JITStubCall.h to files list.
569 2009-05-13 Ariya Hidayat <ariya.hidayat@nokia.com>
571 Unreviewed build fix, as suggested by Yael Aharon <yael.aharon@nokia.com>.
573 * wtf/qt/ThreadingQt.cpp:
574 (WTF::waitForThreadCompletion): renamed IsValid to isValid.
576 2009-05-13 Jan Michael Alonzo <jmalonzo@webkit.org>
578 Revert r43562 - [Gtk] WTF_USE_JSC is already defined in
583 2009-05-12 Gavin Barraclough <barraclough@apple.com>
585 Reviewed by Oliver Hunt.
587 Add SamplingCounter tool to provide a simple mechanism for counting events in JSC
588 (enabled using ENABLE(SAMPLING_COUNTERS)). To count events within a single function
589 use the class 'SamplingCounter', where the counter may be incremented from multiple
590 functions 'GlobalSamplingCounter' may be convenient; all other counters (stack or
591 heap allocated, rather than statically declared) should use the DeletableSamplingCounter.
592 Further description of these classes is provided alongside their definition in
595 Counters may be incremented from c++ by calling the 'count()' method on the counter,
596 or may be incremented by JIT code by using the 'emitCount()' method within the JIT.
598 This patch also fixes CODEBLOCK_SAMPLING, which was missing a null pointer check.
600 * JavaScriptCore.exp:
601 * assembler/MacroAssemblerX86.h:
602 (JSC::MacroAssemblerX86::addWithCarry32):
603 (JSC::MacroAssemblerX86::and32):
604 (JSC::MacroAssemblerX86::or32):
605 * assembler/MacroAssemblerX86Common.h:
606 (JSC::MacroAssemblerX86Common::and32):
607 (JSC::MacroAssemblerX86Common::or32):
608 * assembler/MacroAssemblerX86_64.h:
609 (JSC::MacroAssemblerX86_64::and32):
610 (JSC::MacroAssemblerX86_64::or32):
611 (JSC::MacroAssemblerX86_64::addPtr):
612 * assembler/X86Assembler.h:
613 (JSC::X86Assembler::):
614 (JSC::X86Assembler::adcl_im):
615 (JSC::X86Assembler::addq_im):
616 (JSC::X86Assembler::andl_im):
617 (JSC::X86Assembler::orl_im):
618 * bytecode/SamplingTool.cpp:
619 (JSC::AbstractSamplingCounter::dump):
620 * bytecode/SamplingTool.h:
621 (JSC::AbstractSamplingCounter::count):
622 (JSC::GlobalSamplingCounter::name):
623 (JSC::SamplingCounter::SamplingCounter):
627 * jit/JITInlineMethods.h:
628 (JSC::JIT::setSamplingFlag):
629 (JSC::JIT::clearSamplingFlag):
630 (JSC::JIT::emitCount):
634 (JSC::ScopeNode::ScopeNode):
637 2009-05-13 Steve Falkenburg <sfalken@apple.com>
641 * JavaScriptCore.vcproj/JavaScriptCore.make:
643 2009-05-12 Steve Falkenburg <sfalken@apple.com>
647 * JavaScriptCore.vcproj/JavaScriptCore.make:
649 2009-05-12 Oliver Hunt <oliver@apple.com>
651 Reviewed by Gavin Barraclough.
653 <rdar://problem/6881457> Crash occurs at JSC::Interpreter::execute() when loading http://www.sears.com
655 We created the arguments objects before an op_push_scope but not
656 before op_push_new_scope, this meant a null arguments object could
657 be resolved inside catch blocks.
659 * bytecompiler/BytecodeGenerator.cpp:
660 (JSC::BytecodeGenerator::emitPushNewScope):
662 2009-05-12 Oliver Hunt <oliver@apple.com>
664 Reviewed by Gavin Barraclough.
666 <rdar://problem/6879881> Crash occurs at JSC::JSActivation::mark() when loading http://www.monster.com; http://www.cnet.com
667 <https://bugs.webkit.org/show_bug.cgi?id=25736> Crash loading www.google.dk/ig (and other igoogle's as well)
669 Following on from the lazy arguments creation patch, it's now
670 possible for an activation to to have a null register in the callframe
671 so we can't just blindly mark the local registers in an activation,
672 and must null check first instead.
674 * API/tests/testapi.c:
676 * API/tests/testapi.js:
677 (bludgeonArguments.return.g):
679 * runtime/JSActivation.cpp:
680 (JSC::JSActivation::mark):
682 2009-05-12 Gavin Barraclough <barraclough@apple.com>
684 Rubber stamped by Geoff Garen.
686 WTF_USE_CTI_REPATCH_PIC is no longer used, remove.
691 2009-05-12 Gavin Barraclough <barraclough@apple.com>
693 Reviewed by Maciej Stachowiak.
695 We've run into some problems where changing the size of the class JIT leads to
696 performance fluctuations. Try forcing alignment in an attempt to stabalize this.
700 2009-05-12 Kevin Ollivier <kevino@theolliviers.com>
702 wx build fix. Add ParserArena.cpp to the build.
704 * JavaScriptCoreSources.bkl:
706 2009-05-12 Oliver Hunt <oliver@apple.com>
708 Reviewed by Geoff Garen.
710 Unsigned underflow on 64bit cannot be treated as a negative number
712 This code included some placeswhere we deliberately create negative offsets
713 from unsigned values, on 32bit this is "safe", but in 64bit builds much
714 badness occurs. Solution is to use signed types as nature intended.
717 (JSC::JITStubs::cti_op_load_varargs):
719 2009-05-12 Jan Michael Alonzo <jmalonzo@webkit.org>
721 Reviewed by Holger Freyther.
723 [Gtk] Various autotools build refactoring and fixes
724 https://bugs.webkit.org/show_bug.cgi?id=25286
726 Define WTF_USE_JSC for the Gtk port.
730 2009-05-12 Maciej Stachowiak <mjs@apple.com>
732 Reviewed by Oliver Hunt.
734 - allow all of strictEqual to be inlined into cti_op_stricteq once again
736 We had this optimization once but accidentally lost it at some point.
738 * runtime/Operations.h:
739 (JSC::JSValue::strictEqualSlowCaseInline):
740 (JSC::JSValue::strictEqual):
742 2009-05-12 Gavin Barraclough <barraclough@apple.com>
744 Reviewed by Oliver Hunt.
746 instanceof should throw if the constructor being tested does not implement
747 'HasInstance" (i.e. is a function). Instead we were returning false.
749 * interpreter/Interpreter.cpp:
750 (JSC::isInvalidParamForIn):
751 (JSC::isInvalidParamForInstanceOf):
752 (JSC::Interpreter::privateExecute):
754 (JSC::JITStubs::cti_op_instanceof):
755 * tests/mozilla/ecma_2/instanceof/instanceof-003.js:
756 Fix broken test case.
757 * tests/mozilla/ecma_2/instanceof/regress-7635.js:
758 Remove broken test case (was an exact duplicate of a test in instanceof-003.js).
760 2009-05-12 Oliver Hunt <oliver@apple.com>
762 Reviewed by Gavin Barraclough.
764 Improve function call forwarding performance
766 Make creation of the Arguments object occur lazily, so it
767 is not necessarily created for every function that references
768 it. Then add logic to Function.apply to allow it to avoid
769 allocating the Arguments object at all. Helps a lot with
770 the function forwarding/binding logic in jQuery, Prototype,
771 and numerous other JS libraries.
773 * bytecode/CodeBlock.cpp:
774 (JSC::CodeBlock::dump):
776 * bytecompiler/BytecodeGenerator.cpp:
777 (JSC::BytecodeGenerator::BytecodeGenerator):
778 (JSC::BytecodeGenerator::registerFor):
779 (JSC::BytecodeGenerator::willResolveToArguments):
780 (JSC::BytecodeGenerator::uncheckedRegisterForArguments):
781 (JSC::BytecodeGenerator::createArgumentsIfNecessary):
782 (JSC::BytecodeGenerator::emitCallEval):
783 (JSC::BytecodeGenerator::emitPushScope):
784 * bytecompiler/BytecodeGenerator.h:
785 * interpreter/Interpreter.cpp:
786 (JSC::Interpreter::privateExecute):
787 (JSC::Interpreter::retrieveArguments):
789 (JSC::JIT::privateCompileMainPass):
791 * jit/JITOpcodes.cpp:
792 (JSC::JIT::emit_op_create_arguments):
793 (JSC::JIT::emit_op_init_arguments):
795 (JSC::JITStubs::cti_op_tear_off_arguments):
796 (JSC::JITStubs::cti_op_load_varargs):
798 (JSC::ApplyFunctionCallDotNode::emitBytecode):
800 2009-05-11 Gavin Barraclough <barraclough@apple.com>
802 Reviewed by Oliver Hunt.
804 Enable use of SamplingFlags directly from JIT code.
806 * bytecode/SamplingTool.h:
808 (JSC::JIT::sampleCodeBlock):
809 (JSC::JIT::sampleInstruction):
810 * jit/JITInlineMethods.h:
811 (JSC::JIT::setSamplingFlag):
812 (JSC::JIT::clearSamplingFlag):
814 2009-05-11 Gavin Barraclough <barraclough@apple.com>
816 Reviewed by Cameron Zwarich.
818 Implement JIT generation for instanceof for non-objects (always returns false).
819 Also fixes the sequencing of the prototype and value isObject checks, to no match the spec.
821 0.5% progression on v8 tests overall, due to 3.5% on early-boyer.
824 (JSC::JIT::privateCompileMainPass):
825 (JSC::JIT::privateCompileSlowCases):
826 * runtime/JSObject.cpp:
827 (JSC::JSObject::hasInstance):
828 * runtime/TypeInfo.h:
829 (JSC::TypeInfo::TypeInfo):
831 2009-05-11 Geoffrey Garen <ggaren@apple.com>
833 Reviewed by Sam Weinig.
835 A little more JIT refactoring.
837 Rearranged code to more clearly indicate what's conditionally compiled
838 and why. Now, all shared code is at the top of our JIT files, and all
839 #if'd code is at the bottom. #if'd code is delineated by large comments.
841 Moved functions that relate to the JIT but don't explicitly do codegen
842 into JIT.cpp. Refactored SSE2 check to store its result as a data member
846 (JSC::isSSE2Present):
848 (JSC::JIT::unlinkCall):
849 (JSC::JIT::linkCall):
851 (JSC::JIT::isSSE2Present):
852 * jit/JITArithmetic.cpp:
853 (JSC::JIT::emit_op_mod):
854 (JSC::JIT::emitSlow_op_mod):
856 (JSC::JIT::compileOpCallVarargs):
857 (JSC::JIT::compileOpCallVarargsSlowCase):
859 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
863 * JavaScriptCore.pri: Build the new JITOpcodes.cpp
865 2009-05-11 Sam Weinig <sam@webkit.org>
867 Reviewed by Geoffrey Garen.
869 More re-factoring of JIT code generation. Use a macro to
870 forward the main switch-statement cases to the helper functions.
873 (JSC::JIT::privateCompileMainPass):
874 (JSC::JIT::privateCompileSlowCases):
876 2009-05-11 Sam Weinig <sam@webkit.org>
878 Reviewed by Geoffrey Garen.
880 More re-factoring of JIT code generation to move opcode generation
881 to helper functions outside the main switch-statement and gave those
882 helper functions standardized names. This patch covers the remaining
887 * jit/JITOpcodes.cpp:
889 2009-05-11 Geoffrey Garen <ggaren@apple.com>
893 * GNUmakefile.am: Added JITOpcodes.cpp and JITStubCall.h to the project.
895 2009-05-11 Geoffrey Garen <ggaren@apple.com>
899 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
900 JITOpcodes.cpp and JITStubCall.h to the project.
902 2009-05-11 Geoffrey Garen <ggaren@apple.com>
904 Reviewed by Sam Weinig.
906 Some JIT refactoring.
908 Moved JITStubCall* into its own header.
910 Modified JITStubCall to ASSERT that its return value is handled correctly.
911 Also, replaced function template with explicit instantiations to resolve
914 Replaced all uses of emit{Get,Put}CTIArgument with explicit peeks, pokes,
915 and calls to killLastResultRegister().
917 * JavaScriptCore.xcodeproj/project.pbxproj:
919 (JSC::JIT::privateCompileMainPass):
920 (JSC::JIT::privateCompile):
922 * jit/JITArithmetic.cpp:
924 * jit/JITInlineMethods.h:
925 (JSC::JIT::restoreArgumentReference):
926 * jit/JITPropertyAccess.cpp:
927 * jit/JITStubCall.h: Copied from jit/JIT.h.
928 (JSC::JITStubCall::JITStubCall):
929 (JSC::JITStubCall::addArgument):
930 (JSC::JITStubCall::call):
931 (JSC::JITStubCall::):
933 2009-05-11 Sam Weinig <sam@webkit.org>
935 Reviewed by Geoffrey Garen.
937 Start re-factoring JIT code generation to move opcode generation
938 to helper functions outside the main switch-statement and gave those
939 helper functions standardized names. This patch only covers the main
940 pass and all the arithmetic opcodes in the slow path.
942 * JavaScriptCore.xcodeproj/project.pbxproj:
944 (JSC::JIT::privateCompileMainPass):
945 (JSC::JIT::privateCompileSlowCases):
947 * jit/JITArithmetic.cpp:
948 * jit/JITOpcodes.cpp: Copied from jit/JIT.cpp.
949 * jit/JITPropertyAccess.cpp:
951 2009-05-11 Steve Falkenburg <sfalken@apple.com>
953 Re-add experimental PGO configs.
955 Reviewed by Adam Roben.
957 * JavaScriptCore.vcproj/JavaScriptCore.make:
958 * JavaScriptCore.vcproj/JavaScriptCore.sln:
959 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
960 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
961 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
963 2009-05-11 Sam Weinig <sam@webkit.org>
965 Reviewed by Geoffrey "1" Garen.
967 Rip out the !USE(CTI_REPATCH_PIC) code. It was untested and unused.
970 (JSC::JIT::compileGetByIdChainList):
971 (JSC::JIT::compileGetByIdChain):
972 (JSC::JIT::compileCTIMachineTrampolines):
973 * jit/JITPropertyAccess.cpp:
974 (JSC::JIT::privateCompileGetByIdProto):
975 (JSC::JIT::privateCompileGetByIdChainList):
976 (JSC::JIT::privateCompileGetByIdChain):
978 (JSC::JITStubs::tryCachePutByID):
979 (JSC::JITStubs::tryCacheGetByID):
981 2009-05-11 Dmitry Titov <dimich@chromium.org>
983 GTK build fix - the deprecated waitForThreadCompletion is not needed on GTK.
985 * wtf/ThreadingPthreads.cpp: used #ifdef PLATFORM(DARWIN) around waitForThreadCompletion().
987 2009-05-11 Adam Roben <aroben@apple.com>
989 Build fix for newer versions of GCC
991 * wtf/ThreadingPthreads.cpp: Added a declaration of
992 waitForThreadCompletion before its definition to silence a warning.
994 2009-05-11 Dmitry Titov <dimich@chromium.org>
996 Reviewed by Alexey Proskuryakov and Adam Roben.
998 https://bugs.webkit.org/show_bug.cgi?id=25348
999 Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
1002 (WTF::ThreadIdentifier::ThreadIdentifier):
1003 (WTF::ThreadIdentifier::isValid):
1004 (WTF::ThreadIdentifier::invalidate):
1005 (WTF::ThreadIdentifier::platformId):
1006 ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
1007 methods that are used across the code on thread ids: construction, comparisons,
1008 check for 'valid' state etc. '0' is used as invalid id, which happens to just work
1009 with all platform-specific thread id implementations.
1011 All the following files repeatedly reflect the new ThreadIdentifier for each platform.
1012 We remove ThreadMap and threadMapMutex from all of them, remove the functions that
1013 populated/searched/cleared the map and add platform-specific comparison operators
1014 for ThreadIdentifier.
1016 There are specific temporary workarounds for Safari 4 beta on OSX and Win32 since the
1017 public build uses WTF threading functions with old type of ThreadingIdentifier.
1018 The next time Safari 4 is rebuilt, it will 'automatically' pick up the new type and new
1019 functions so the deprecated ones can be removed.
1021 * wtf/gtk/ThreadingGtk.cpp:
1022 (WTF::ThreadIdentifier::operator==):
1023 (WTF::ThreadIdentifier::operator!=):
1024 (WTF::initializeThreading):
1025 (WTF::createThreadInternal):
1026 (WTF::waitForThreadCompletion):
1027 (WTF::currentThread):
1029 * wtf/ThreadingNone.cpp:
1030 (WTF::ThreadIdentifier::operator==):
1031 (WTF::ThreadIdentifier::operator!=):
1033 * wtf/ThreadingPthreads.cpp:
1034 (WTF::ThreadIdentifier::operator==):
1035 (WTF::ThreadIdentifier::operator!=):
1036 (WTF::initializeThreading):
1037 (WTF::createThreadInternal):
1038 (WTF::waitForThreadCompletion):
1039 (WTF::detachThread):
1040 (WTF::currentThread):
1041 (WTF::waitForThreadCompletion): This is a workaround for Safari 4 beta on Mac.
1042 Safari 4 is linked against old definition of ThreadIdentifier so it treats it as uint32_t.
1043 This 'old' variant of waitForThreadCompletion takes uint32_t and has the old decorated name, so Safari can
1044 load it from JavaScriptCore library. The other functions (CurrentThread() etc) happen to match their previous
1045 decorated names and, while they return pthread_t now, it is a pointer which round-trips through a uint32_t.
1046 This function will be removed as soon as Safari 4 will release next public build.
1048 * wtf/qt/ThreadingQt.cpp:
1049 (WTF::ThreadIdentifier::operator==):
1050 (WTF::ThreadIdentifier::operator!=):
1051 (WTF::initializeThreading):
1052 (WTF::createThreadInternal):
1053 (WTF::waitForThreadCompletion):
1054 (WTF::currentThread):
1056 * wtf/ThreadingWin.cpp:
1057 (WTF::ThreadIdentifier::operator==):
1058 (WTF::ThreadIdentifier::operator!=):
1059 (WTF::initializeThreading):
1060 (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
1061 counter as a thread ID and mapped it into platform ID. Windows was using native thread
1062 id and mapped it into thread handle. Since we can always obtain a thread handle
1063 by thread id, createThread now closes the handle.
1064 (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
1065 it means the thread already exited.
1066 (WTF::detachThread):
1067 (WTF::currentThread):
1068 (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
1069 (WTF::waitForThreadCompletionDeprecated): same.
1070 (WTF::currentThreadDeprecated): same.
1071 (WTF::createThreadDeprecated): same.
1073 * bytecode/SamplingTool.h:
1074 * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
1076 * JavaScriptCore.exp: export lists - updated decorated names of the WTF threading functions
1077 since they now take a different type as a parameter.
1078 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
1079 that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
1080 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
1082 2009-05-11 Darin Adler <darin@apple.com>
1084 Reviewed by Oliver Hunt.
1086 Bug 25560: REGRESSION (r34821): "string value".__proto__ gets the wrong object.
1087 https://bugs.webkit.org/show_bug.cgi?id=25560
1088 rdar://problem/6861069
1090 I missed this case back a year ago when I sped up handling
1091 of JavaScript wrappers. Easy to fix.
1093 * runtime/JSObject.h:
1094 (JSC::JSValue::get): Return the prototype itself if the property name
1096 * runtime/JSString.cpp:
1097 (JSC::JSString::getOwnPropertySlot): Ditto.
1099 2009-05-09 Oliver Hunt <oliver@apple.com>
1101 Reviewed by Maciej Stachowiak.
1103 Rename emitGetFromCallFrameHeader to emitGetFromCallFrameHeaderPtr
1106 (JSC::JIT::privateCompileMainPass):
1107 (JSC::JIT::privateCompileCTIMachineTrampolines):
1109 * jit/JITInlineMethods.h:
1110 (JSC::JIT::emitGetFromCallFrameHeaderPtr):
1111 (JSC::JIT::emitGetFromCallFrameHeader32):
1113 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
1115 Unreviewed build fix. Build ParserAreana.cpp for Qt
1117 * JavaScriptCore.pri:
1119 2009-05-11 Norbert Leser <norbert.leser@nokia.com>
1121 Reviewed by Darin Adler.
1123 https://bugs.webkit.org/show_bug.cgi?id=24536
1125 Symbian compilers cannot resolve WTF::PassRefPtr<JSC::Profile>
1126 unless Profile.h is included.
1128 * profiler/ProfileGenerator.h:
1130 2009-05-11 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
1132 Reviewed by Holger Freyther.
1134 https://bugs.webkit.org/show_bug.cgi?id=24284
1136 * JavaScriptCore.pri: coding style modified
1137 * jsc.pro: duplicated values removed from INCLUDEPATH, DEFINES
1139 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
1141 Reviewed by NOBODY (build fix).
1143 Also add ParserArena, in addition to AllInOne, for release builds,
1144 since adding it to AllInOne breaks Mac.
1148 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
1150 Unreviewed build fix. Adding ParserArena to the autotools build.
1154 2009-05-11 Adam Roben <aroben@apple.com>
1156 More Windows build fixes after r43479
1158 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1159 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1160 Export ParserArena::reset.
1162 2009-05-11 Adam Roben <aroben@apple.com>
1164 Windows build fixes after r43479
1166 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
1167 ParserArena to the project.
1169 * parser/NodeConstructors.h: Added a missing include.
1170 (JSC::ParserArenaDeletable::operator new): Marked these as inline.
1172 2009-05-10 Maciej Stachowiak <mjs@apple.com>
1174 Reviewed by Geoff Garen.
1176 - fixed REGRESSION(r43432): Many JavaScriptCore tests crash in 64-bit
1177 https://bugs.webkit.org/show_bug.cgi?id=25680
1179 Accound for the 64-bit instruction prefix when rewriting mov to lea on 64-bit.
1182 * jit/JITPropertyAccess.cpp:
1183 (JSC::JIT::patchGetByIdSelf):
1184 (JSC::JIT::patchPutByIdReplace):
1186 2009-05-10 Darin Adler <darin@apple.com>
1188 Reviewed by Cameron Zwarich.
1190 Bug 25674: syntax tree nodes should use arena allocation
1191 https://bugs.webkit.org/show_bug.cgi?id=25674
1193 Part two: Remove reference counting from most nodes.
1195 * JavaScriptCore.exp: Updated.
1197 * JavaScriptCore.xcodeproj/project.pbxproj: Added ParserArena.h and .cpp.
1199 * parser/Grammar.y: Replaced uses of ParserRefCountedData with uses of
1200 ParserArenaData. Took out now-nonfunctional code that tries to manually
1201 release declaration list. Changed the new calls that create FuncDeclNode
1202 and FuncExprNode so that they use the proper version of operator new for
1203 the reference-counted idiom, not the deletion idiom.
1205 * parser/NodeConstructors.h:
1206 (JSC::ParserArenaDeletable::operator new): Added.
1207 (JSC::ParserArenaRefCounted::ParserArenaRefCounted): Added.
1208 (JSC::Node::Node): Removed ParserRefCounted initializer.
1209 (JSC::ElementNode::ElementNode): Ditto.
1210 (JSC::PropertyNode::PropertyNode): Ditto.
1211 (JSC::ArgumentsNode::ArgumentsNode): Ditto.
1212 (JSC::SourceElements::SourceElements): Ditto.
1213 (JSC::ParameterNode::ParameterNode): Ditto.
1214 (JSC::FuncExprNode::FuncExprNode): Added ParserArenaRefCounted initializer.
1215 (JSC::FuncDeclNode::FuncDeclNode): Ditto.
1216 (JSC::CaseClauseNode::CaseClauseNode): Removed ParserRefCounted initializer.
1217 (JSC::ClauseListNode::ClauseListNode): Ditto.
1218 (JSC::CaseBlockNode::CaseBlockNode): Ditto.
1220 * parser/NodeInfo.h: Replaced uses of ParserRefCountedData with uses of
1224 (JSC::ScopeNode::ScopeNode): Added ParserArenaRefCounted initializer.
1225 (JSC::ProgramNode::create): Use the proper version of operator new for
1226 the reference-counted idiom, not the deletion idiom. Use the arena
1227 contains function instead of the vecctor find function.
1228 (JSC::EvalNode::create): Use the proper version of operator new for
1229 the reference-counted idiom, not the deletion idiom. Use the arena
1230 reset function instead of the vector shrink function.
1231 (JSC::FunctionBodyNode::createNativeThunk): Use the proper version
1232 of operator new for the reference-counted idiom, not the deletion idiom.
1233 (JSC::FunctionBodyNode::create): More of the same.
1235 * parser/Nodes.h: Added ParserArenaDeletable and ParserArenaRefCounted
1236 to replace ParserRefCounted. Fixed inheritance so only the classes that
1237 need reference counting inherit from ParserArenaRefCounted.
1239 * parser/Parser.cpp:
1240 (JSC::Parser::parse): Set m_sourceElements to 0 since it now starts
1241 uninitialized. Just set it to 0 again in the failure case, since it's
1242 now just a raw pointer, not an owning one.
1243 (JSC::Parser::reparseInPlace): Removed now-unneeded get() function.
1244 (JSC::Parser::didFinishParsing): Replaced uses of ParserRefCountedData
1245 with uses of ParserArenaData.
1247 * parser/Parser.h: Less RefPtr, more arena.
1249 * parser/ParserArena.cpp: Added.
1250 * parser/ParserArena.h: Added.
1252 * runtime/JSGlobalData.cpp:
1253 (JSC::JSGlobalData::~JSGlobalData): Removed arena-related code, since it's
1255 (JSC::JSGlobalData::createLeaked): Removed unneeded #ifndef.
1256 (JSC::JSGlobalData::createNativeThunk): Tweaked #if a bit.
1258 * runtime/JSGlobalData.h: Removed parserArena, which is now in Parser.
1260 * wtf/RefCounted.h: Added deletionHasBegun function, for use in
1261 assertions to catch deletion not done by the deref function.
1263 2009-05-10 David Kilzer <ddkilzer@apple.com>
1265 Part 2: Try to fix the Windows build by adding a symbol which is really just a re-mangling of a changed method signature
1267 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1268 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1270 2009-05-10 David Kilzer <ddkilzer@apple.com>
1272 Try to fix the Windows build by removing an unknown symbol
1274 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1275 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1277 2009-05-10 David Kilzer <ddkilzer@apple.com>
1279 Touch Nodes.cpp to try to fix Windows build
1281 * parser/Nodes.cpp: Removed whitespace.
1283 2009-05-10 Darin Adler <darin@apple.com>
1285 Reviewed by Maciej Stachowiak.
1287 Quick fix for failures seen on buildbot. Maciej plans a better fix later.
1289 * wtf/dtoa.cpp: Change the hardcoded number of 32-bit words in a BigInt
1290 from 32 to 64. Parsing "1e500", for example, requires more than 32 words.
1292 2009-05-10 Darin Adler <darin@apple.com>
1294 Reviewed by Sam Weinig.
1296 Bug 25674: syntax tree nodes should use arena allocation
1297 Part one: Change lifetimes so we won't have to use reference
1298 counting so much, but don't eliminate the reference counts
1301 * JavaScriptCore.exp: Updated.
1303 * bytecompiler/BytecodeGenerator.cpp:
1304 (JSC::BytecodeGenerator::BytecodeGenerator): Update for use of raw pointers
1306 (JSC::BytecodeGenerator::emitCall): Ditto.
1307 (JSC::BytecodeGenerator::emitConstruct): Ditto.
1309 * parser/Grammar.y: Update node creating code to use new (JSGlobalData*)
1310 instead of the plain new. At the moment this is just a hook for future
1311 arena allocation; it's inline and JSGlobalData* is not used.
1313 * parser/NodeConstructors.h: Updated for name change of parserObjects to
1314 parserArena. Also added explicit initialization for raw pointers that used
1315 to be RefPtr. Also removed some uses of get() that aren't needed now that
1316 the pointers are raw pointers. Also eliminated m_parameter from FuncExprNode
1317 and FuncDeclNode. Also changed node-creating code to use new (JSGlobalData*)
1320 * parser/Nodes.cpp: Eliminated NodeReleaser and all use of it.
1321 (JSC::ParserRefCounted::ParserRefCounted): Updated for name change of
1322 parserObjects to parserArena.
1323 (JSC::SourceElements::append): Use raw pointers.
1324 (JSC::ArrayNode::emitBytecode): Ditto.
1325 (JSC::ArrayNode::isSimpleArray): Ditto.
1326 (JSC::ArrayNode::toArgumentList): Ditto.
1327 (JSC::ObjectLiteralNode::emitBytecode): Ditto.
1328 (JSC::PropertyListNode::emitBytecode): Ditto.
1329 (JSC::BracketAccessorNode::emitBytecode): Ditto.
1330 (JSC::DotAccessorNode::emitBytecode): Ditto.
1331 (JSC::ArgumentListNode::emitBytecode): Ditto.
1332 (JSC::NewExprNode::emitBytecode): Ditto.
1333 (JSC::EvalFunctionCallNode::emitBytecode): Ditto.
1334 (JSC::FunctionCallValueNode::emitBytecode): Ditto.
1335 (JSC::FunctionCallResolveNode::emitBytecode): Ditto.
1336 (JSC::FunctionCallBracketNode::emitBytecode): Ditto.
1337 (JSC::FunctionCallDotNode::emitBytecode): Ditto.
1338 (JSC::CallFunctionCallDotNode::emitBytecode): Ditto.
1339 (JSC::ApplyFunctionCallDotNode::emitBytecode): Ditto.
1340 (JSC::PostfixBracketNode::emitBytecode): Ditto.
1341 (JSC::PostfixDotNode::emitBytecode): Ditto.
1342 (JSC::DeleteBracketNode::emitBytecode): Ditto.
1343 (JSC::DeleteDotNode::emitBytecode): Ditto.
1344 (JSC::DeleteValueNode::emitBytecode): Ditto.
1345 (JSC::VoidNode::emitBytecode): Ditto.
1346 (JSC::TypeOfValueNode::emitBytecode): Ditto.
1347 (JSC::PrefixBracketNode::emitBytecode): Ditto.
1348 (JSC::PrefixDotNode::emitBytecode): Ditto.
1349 (JSC::UnaryOpNode::emitBytecode): Ditto.
1350 (JSC::BinaryOpNode::emitStrcat): Ditto.
1351 (JSC::BinaryOpNode::emitBytecode): Ditto.
1352 (JSC::EqualNode::emitBytecode): Ditto.
1353 (JSC::StrictEqualNode::emitBytecode): Ditto.
1354 (JSC::ReverseBinaryOpNode::emitBytecode): Ditto.
1355 (JSC::ThrowableBinaryOpNode::emitBytecode): Ditto.
1356 (JSC::InstanceOfNode::emitBytecode): Ditto.
1357 (JSC::LogicalOpNode::emitBytecode): Ditto.
1358 (JSC::ConditionalNode::emitBytecode): Ditto.
1359 (JSC::ReadModifyResolveNode::emitBytecode): Ditto.
1360 (JSC::AssignResolveNode::emitBytecode): Ditto.
1361 (JSC::AssignDotNode::emitBytecode): Ditto.
1362 (JSC::ReadModifyDotNode::emitBytecode): Ditto.
1363 (JSC::AssignBracketNode::emitBytecode): Ditto.
1364 (JSC::ReadModifyBracketNode::emitBytecode): Ditto.
1365 (JSC::CommaNode::emitBytecode): Ditto.
1366 (JSC::ConstDeclNode::emitCodeSingle): Ditto.
1367 (JSC::ConstDeclNode::emitBytecode): Ditto.
1368 (JSC::ConstStatementNode::emitBytecode): Ditto.
1369 (JSC::statementListEmitCode): Ditto.
1370 (JSC::BlockNode::emitBytecode): Ditto.
1371 (JSC::ExprStatementNode::emitBytecode): Ditto.
1372 (JSC::VarStatementNode::emitBytecode): Ditto.
1373 (JSC::IfNode::emitBytecode): Ditto.
1374 (JSC::IfElseNode::emitBytecode): Ditto.
1375 (JSC::DoWhileNode::emitBytecode): Ditto.
1376 (JSC::WhileNode::emitBytecode): Ditto.
1377 (JSC::ForNode::emitBytecode): Ditto.
1378 (JSC::ForInNode::emitBytecode): Ditto.
1379 (JSC::ReturnNode::emitBytecode): Ditto.
1380 (JSC::WithNode::emitBytecode): Ditto.
1381 (JSC::CaseBlockNode::tryOptimizedSwitch): Ditto.
1382 (JSC::CaseBlockNode::emitBytecodeForBlock): Ditto.
1383 (JSC::SwitchNode::emitBytecode): Ditto.
1384 (JSC::LabelNode::emitBytecode): Ditto.
1385 (JSC::ThrowNode::emitBytecode): Ditto.
1386 (JSC::TryNode::emitBytecode): Ditto.
1387 (JSC::ScopeNodeData::ScopeNodeData): Use swap to transfer ownership
1388 of the arena, varStack and functionStack.
1389 (JSC::ScopeNode::ScopeNode): Pass in the arena when creating the
1391 (JSC::ProgramNode::ProgramNode): Made this inline since it's used
1393 (JSC::ProgramNode::create): Changed this to return a PassRefPtr since
1394 we plan to have the scope nodes be outside the arena, so they will need
1395 some kind of ownership transfer (maybe auto_ptr instead of PassRefPtr
1396 in the future, though). Remove the node from the newly-created arena to
1397 avoid a circular reference. Later we'll keep the node out of the arena
1398 by using a different operator new, but for now it's the ParserRefCounted
1399 constructor that puts the node into the arena, and there's no way to
1401 (JSC::EvalNode::EvalNode): Ditto.
1402 (JSC::EvalNode::create): Ditto.
1403 (JSC::FunctionBodyNode::FunctionBodyNode): Ditto.
1404 (JSC::FunctionBodyNode::createNativeThunk): Moved the code that
1405 reseets the arena here instead of the caller.
1406 (JSC::FunctionBodyNode::create): Same change as the other create
1408 (JSC::FunctionBodyNode::emitBytecode): Use raw pointers.
1410 * parser/Nodes.h: Removed NodeReleaser. Changed FunctionStack to
1411 use raw pointers. Removed the releaseNodes function. Added an override
1412 of operator new that takes a JSGlobalData* to prepare for future arena use.
1413 Use raw pointers instead of RefPtr everywhere possible.
1415 * parser/Parser.cpp:
1416 (JSC::Parser::reparseInPlace): Pass the arena in.
1419 (JSC::Parser::parse): Updated for name change of parserObjects to parserArena.
1420 (JSC::Parser::reparse): Ditto.
1421 * runtime/FunctionConstructor.cpp:
1422 (JSC::extractFunctionBody): Ditto.
1423 * runtime/JSGlobalData.cpp:
1424 (JSC::JSGlobalData::~JSGlobalData): Ditto.
1425 (JSC::JSGlobalData::createNativeThunk): Moved arena manipulation into the
1426 FunctionBodyNode::createNativeThunk function.
1428 * runtime/JSGlobalData.h: Tweaked formatting and renamed parserObjects to
1431 * wtf/NotFound.h: Added the usual "using WTF" to this header to match the
1434 2009-05-10 Dimitri Glazkov <dglazkov@chromium.org>
1436 Reviewed by Geoffrey Garen.
1438 https://bugs.webkit.org/show_bug.cgi?id=25670
1439 Remove no longer valid chunk of code from dtoa.
1442 (WTF::dtoa): Removed invalid code.
1444 2009-05-10 Alexey Proskuryakov <ap@webkit.org>
1446 Reviewed by Geoff Garen.
1448 "Class const *" is the same as "const Class*", use the latter syntax consistently.
1450 See <http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.9>.
1452 * pcre/pcre_compile.cpp:
1453 (calculateCompiledPatternLength):
1454 * runtime/JSObject.h:
1455 (JSC::JSObject::offsetForLocation):
1456 (JSC::JSObject::locationForOffset):
1458 2009-05-10 Maciej Stachowiak <mjs@apple.com>
1460 Reviewed by Alexey Proskuryakov.
1462 - speedup dtoa/strtod
1464 Added a bunch of inlining, and replaced malloc with stack allocation.
1466 0.5% SunSpider speedup (7% on string-tagcloud).
1468 * runtime/NumberPrototype.cpp:
1469 (JSC::integerPartNoExp):
1470 (JSC::numberProtoFuncToExponential):
1471 * runtime/UString.cpp:
1473 (JSC::UString::from):
1475 (WTF::BigInt::BigInt):
1476 (WTF::BigInt::operator=):
1496 2009-05-09 Mike Hommey <glandium@debian.org>
1498 Reviewed by Geoffrey Garen. Landed by Jan Alonzo.
1500 Enable JIT on x86-64 gtk+
1501 https://bugs.webkit.org/show_bug.cgi?id=24724
1505 2009-05-09 Geoffrey Garen <ggaren@apple.com>
1507 Reviewed by Cameron Zwarich.
1509 Removed the last non-call-related manually managed JIT stub call.
1511 * jit/JITArithmetic.cpp:
1512 (JSC::JIT::compileFastArithSlow_op_rshift): Fully use the JITStubCall
1513 abstraction, instead of emitPutJITStubArg.
1515 2009-05-09 Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
1517 Reviewed by Gustavo Noronha.
1519 https://bugs.webkit.org/show_bug.cgi?id=25653
1520 PLATFORM(X86_64) inherits ia64
1522 __ia64__ is defined by gcc in an IA64 arch and has completely
1523 nothing in common with X86-64 exept both are from Intel and have
1524 an 64bit address space. That's it. Since code seems to expect x86
1525 here, ia64 has to go.
1529 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
1531 Suggested by Geoffrey Garen.
1533 Assume SSE2 is present on X86-64 and on MAC X86-32. This fixes a
1534 build breakage on non-Mac X86-64 when JIT is enabled.
1536 * jit/JITArithmetic.cpp:
1538 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
1540 Build fix, adding missing files to make dist.
1544 2009-05-09 Geoffrey Garen <ggaren@apple.com>
1548 * assembler/X86Assembler.h:
1549 (JSC::X86Assembler::patchLoadToLEA):
1551 2009-05-09 Geoffrey Garen <ggaren@apple.com>
1555 * assembler/X86Assembler.h:
1556 (JSC::X86Assembler::patchLoadToLEA):
1558 2009-05-09 Maciej Stachowiak <mjs@apple.com>
1560 Reviewed by Gavin Barraclough.
1562 Original patch by John McCall. Updated by Cameron Zwarich. Further refined by me.
1564 - Assorted speedups to property access
1566 ~.3%-1% speedup on SunSpider
1568 1) When we know from the structure ID that an object is using inline storage, plant direct
1569 loads and stores against it; no need to indirect through storage pointer.
1571 2) Also because of the above, union the property storage pointer with the first inline property
1572 slot and add an extra inline property slot.
1574 * assembler/AbstractMacroAssembler.h:
1575 (JSC::AbstractMacroAssembler::CodeLocationInstruction::CodeLocationInstruction):
1576 (JSC::AbstractMacroAssembler::CodeLocationInstruction::patchLoadToLEA):
1577 (JSC::::CodeLocationCommon::instructionAtOffset):
1578 * assembler/MacroAssembler.h:
1579 (JSC::MacroAssembler::storePtr):
1580 * assembler/MacroAssemblerX86.h:
1581 (JSC::MacroAssemblerX86::store32):
1582 * assembler/MacroAssemblerX86_64.h:
1583 (JSC::MacroAssemblerX86_64::storePtr):
1584 * assembler/X86Assembler.h:
1585 (JSC::X86Assembler::movq_EAXm):
1586 (JSC::X86Assembler::movl_rm):
1587 (JSC::X86Assembler::patchLoadToLEA):
1589 (JSC::JIT::privateCompileMainPass):
1591 * jit/JITPropertyAccess.cpp:
1592 (JSC::JIT::compileGetByIdHotPath):
1593 (JSC::JIT::compilePutByIdHotPath):
1594 (JSC::JIT::compilePutDirectOffset):
1595 (JSC::JIT::compileGetDirectOffset):
1596 (JSC::JIT::privateCompilePutByIdTransition):
1597 (JSC::JIT::patchGetByIdSelf):
1598 (JSC::JIT::patchPutByIdReplace):
1599 (JSC::JIT::privateCompileGetByIdSelf):
1600 (JSC::JIT::privateCompileGetByIdProto):
1601 (JSC::JIT::privateCompileGetByIdSelfList):
1602 (JSC::JIT::privateCompileGetByIdProtoList):
1603 (JSC::JIT::privateCompileGetByIdChainList):
1604 (JSC::JIT::privateCompileGetByIdChain):
1605 (JSC::JIT::privateCompilePutByIdReplace):
1606 * runtime/JSObject.cpp:
1607 (JSC::JSObject::mark):
1608 (JSC::JSObject::removeDirect):
1609 * runtime/JSObject.h:
1610 (JSC::JSObject::propertyStorage):
1611 (JSC::JSObject::getDirect):
1612 (JSC::JSObject::getOffset):
1613 (JSC::JSObject::offsetForLocation):
1614 (JSC::JSObject::locationForOffset):
1615 (JSC::JSObject::getDirectOffset):
1616 (JSC::JSObject::putDirectOffset):
1617 (JSC::JSObject::isUsingInlineStorage):
1619 (JSC::JSObject::JSObject):
1620 (JSC::JSObject::~JSObject):
1621 (JSC::Structure::isUsingInlineStorage):
1622 (JSC::JSObject::putDirect):
1623 (JSC::JSObject::putDirectWithoutTransition):
1624 (JSC::JSObject::allocatePropertyStorageInline):
1625 * runtime/Structure.h:
1627 2009-05-09 Geoffrey Garen <ggaren@apple.com>
1629 Reviewed by Gavin Barraclough.
1631 Changed all our JIT stubs so that they return a maximum of 1 JS value or
1632 two non-JS pointers, and do all other value returning through out
1633 parameters, in preparation for 64bit JS values on a 32bit system.
1635 Stubs that used to return two JSValues now return one JSValue and take
1636 and out parameter specifying where in the register array the second
1639 SunSpider reports no change.
1642 (JSC::JIT::privateCompileMainPass):
1643 * jit/JITArithmetic.cpp:
1644 (JSC::JIT::compileFastArithSlow_op_post_inc):
1645 (JSC::JIT::compileFastArithSlow_op_post_dec):
1647 (JSC::JITStubs::cti_op_call_arityCheck):
1648 (JSC::JITStubs::cti_op_resolve_func):
1649 (JSC::JITStubs::cti_op_post_inc):
1650 (JSC::JITStubs::cti_op_resolve_with_base):
1651 (JSC::JITStubs::cti_op_post_dec):
1655 2009-05-08 Geoffrey Garen <ggaren@apple.com>
1657 Reviewed by Cameron Zwarich.
1659 Fixed <rdar://problem/6634956> CrashTracer: [REGRESSION] >400 crashes
1660 in Safari at com.apple.JavaScriptCore • JSC::BytecodeGenerator::emitComplexJumpScopes + 468
1661 https://bugs.webkit.org/show_bug.cgi?id=25658
1663 * bytecompiler/BytecodeGenerator.cpp:
1664 (JSC::BytecodeGenerator::emitComplexJumpScopes): Guard the whole loop
1665 with a bounds check. The old loop logic would decrement and read topScope
1666 without a bounds check, which could cause crashes on page boundaries.
1668 2009-05-08 Jan Michael Alonzo <jmalonzo@webkit.org>
1670 Reviewed by NOBODY (BuildFix).
1672 Gtk fix: add LiteralParser to the build script per r43424.
1674 Add LiteralParser to the Qt and Wx build scripts too.
1677 * JavaScriptCore.pri:
1678 * JavaScriptCoreSources.bkl:
1680 2009-05-08 Oliver Hunt <oliver@apple.com>
1682 Reviewed by Gavin Barraclough and Darin Adler.
1684 Add a limited literal parser for eval to handle object and array literals fired at eval
1686 This is a simplified parser and lexer that we can throw at strings passed to eval
1687 in case a site is using eval to parse JSON (eg. json2.js). The lexer is intentionally
1688 limited (in effect it's whitelisting a limited "common" subset of the JSON grammar)
1689 as this decreases the likelihood of us wating time attempting to parse any significant
1690 amount of non-JSON content.
1692 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1693 * JavaScriptCore.xcodeproj/project.pbxproj:
1694 * interpreter/Interpreter.cpp:
1695 (JSC::Interpreter::callEval):
1696 * runtime/JSGlobalObjectFunctions.cpp:
1697 (JSC::globalFuncEval):
1698 * runtime/LiteralParser.cpp: Added.
1699 (JSC::isStringCharacter):
1700 (JSC::LiteralParser::Lexer::lex):
1701 (JSC::LiteralParser::Lexer::lexString):
1702 (JSC::LiteralParser::Lexer::lexNumber):
1703 (JSC::LiteralParser::parseStatement):
1704 (JSC::LiteralParser::parseExpression):
1705 (JSC::LiteralParser::parseArray):
1706 (JSC::LiteralParser::parseObject):
1707 (JSC::LiteralParser::StackGuard::StackGuard):
1708 (JSC::LiteralParser::StackGuard::~StackGuard):
1709 (JSC::LiteralParser::StackGuard::isSafe):
1710 * runtime/LiteralParser.h: Added.
1711 (JSC::LiteralParser::LiteralParser):
1712 (JSC::LiteralParser::attemptJSONParse):
1713 (JSC::LiteralParser::):
1714 (JSC::LiteralParser::Lexer::Lexer):
1715 (JSC::LiteralParser::Lexer::next):
1716 (JSC::LiteralParser::Lexer::currentToken):
1717 (JSC::LiteralParser::abortParse):
1719 2009-05-08 Geoffrey Garen <ggaren@apple.com>
1723 Restored a Mozilla JS test I accidentally gutted.
1725 * tests/mozilla/ecma/Array/15.4.4.2.js:
1729 2009-05-08 Geoffrey Garen <ggaren@apple.com>
1731 Reviewed by Gavin Barraclough.
1733 More abstraction for JITStub calls from JITed code.
1735 Added a JITStubCall class that automatically handles things like assigning
1736 arguments to different stack slots and storing return values. Deployed
1737 the class in about a billion places. A bunch more places remain to be
1738 fixed up, but this is a good stopping point for now.
1741 (JSC::JIT::emitTimeoutCheck):
1742 (JSC::JIT::privateCompileMainPass):
1743 (JSC::JIT::privateCompileSlowCases):
1744 (JSC::JIT::privateCompile):
1746 (JSC::JIT::JSRInfo::JSRInfo):
1747 (JSC::JITStubCall::JITStubCall):
1748 (JSC::JITStubCall::addArgument):
1749 (JSC::JITStubCall::call):
1750 (JSC::JITStubCall::):
1751 (JSC::CallEvalJITStub::CallEvalJITStub):
1752 * jit/JITArithmetic.cpp:
1753 (JSC::JIT::compileFastArithSlow_op_lshift):
1754 (JSC::JIT::compileFastArithSlow_op_rshift):
1755 (JSC::JIT::compileFastArithSlow_op_jnless):
1756 (JSC::JIT::compileFastArithSlow_op_bitand):
1757 (JSC::JIT::compileFastArithSlow_op_mod):
1758 (JSC::JIT::compileFastArith_op_mod):
1759 (JSC::JIT::compileFastArithSlow_op_post_inc):
1760 (JSC::JIT::compileFastArithSlow_op_post_dec):
1761 (JSC::JIT::compileFastArithSlow_op_pre_inc):
1762 (JSC::JIT::compileFastArithSlow_op_pre_dec):
1763 (JSC::JIT::compileFastArith_op_add):
1764 (JSC::JIT::compileFastArith_op_mul):
1765 (JSC::JIT::compileFastArith_op_sub):
1766 (JSC::JIT::compileBinaryArithOpSlowCase):
1767 (JSC::JIT::compileFastArithSlow_op_add):
1768 (JSC::JIT::compileFastArithSlow_op_mul):
1770 (JSC::JIT::compileOpCall):
1772 * jit/JITPropertyAccess.cpp:
1773 (JSC::JIT::compileGetByIdHotPath):
1774 (JSC::JIT::compilePutByIdHotPath):
1775 (JSC::JIT::compileGetByIdSlowCase):
1776 (JSC::JIT::compilePutByIdSlowCase):
1778 (JSC::JITStubs::cti_op_resolve_func):
1779 (JSC::JITStubs::cti_op_resolve_with_base):
1781 2009-05-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1783 Reviewed by Maciej Stachowiak.
1785 Add a new opcode jnlesseq, and optimize its compilation in the JIT using
1786 techniques similar to what were used to optimize jnless in r43363.
1788 This gives a 0.7% speedup on SunSpider, particularly on the tests 3d-cube,
1789 control-flow-recursive, date-format-xparb, and string-base64.
1791 * bytecode/CodeBlock.cpp:
1792 (JSC::CodeBlock::dump): Add support for dumping op_jnlesseq.
1793 * bytecode/Opcode.h: Add op_jnlesseq to the list of opcodes.
1794 * bytecompiler/BytecodeGenerator.cpp:
1795 (JSC::BytecodeGenerator::emitJumpIfFalse): Add a peephole optimization
1796 for op_jnlesseq when emitting lesseq followed by a jump.
1797 * interpreter/Interpreter.cpp:
1798 (JSC::Interpreter::privateExecute): Add case for op_jnlesseq.
1800 (JSC::JIT::privateCompileMainPass): Add case for op_jnlesseq.
1801 (JSC::JIT::privateCompileSlowCases): Add case for op_jnlesseq.
1803 * jit/JITArithmetic.cpp:
1804 (JSC::JIT::compileFastArith_op_jnlesseq): Added.
1805 (JSC::JIT::compileFastArithSlow_op_jnlesseq): Added.
1807 (JSC::JITStubs::cti_op_jlesseq): Added.
1810 2009-05-08 Maciej Stachowiak <mjs@apple.com>
1812 Reviewed by Cameron Zwarich.
1814 - fix test failures on 64-bit
1816 * jit/JITArithmetic.cpp:
1817 (JSC::JIT::compileFastArithSlow_op_jnless): Avoid accidentaly treating an
1818 immediate int as an immediate float in the 64-bit value representation.
1820 2009-05-08 Gavin Barraclough <barraclough@apple.com>
1822 Rubber stamped by Oliver Hunt.
1824 Removing an empty constructor and an uncalled, empty function seems to be a
1825 pretty solid 1% regeression on my machine, so I'm going to put them back.
1826 Um. Yeah, this this pretty pointles and makes no sense at all. I officially
1827 lose the will to live in 3... 2...
1829 * bytecode/SamplingTool.cpp:
1830 (JSC::SamplingTool::notifyOfScope):
1831 * bytecode/SamplingTool.h:
1832 (JSC::SamplingTool::~SamplingTool):
1834 2009-05-08 Gavin Barraclough <barraclough@apple.com>
1836 Reviewed by Oliver "I see lots of ifdefs" Hunt.
1838 Fix (kinda) for sampling tool breakage. The codeblock sampling tool has become
1839 b0rked due to recent changes in native function calling. The initialization of
1840 a ScopeNode appears to now occur before the sampling tool (or possibly the
1841 interpreter has been brought into existence, wihich leads to crashyness).
1843 This patch doesn't fix the problem. The crash occurs when tracking a Scope, but
1844 we shouldn't need to track scopes when we're just sampling opcodes, not
1845 codeblocks. Not retaining Scopes when just opcode sampling will reduce sampling
1846 overhead reducing any instrumentation skew, which is a good thing. As a side
1847 benefit this patch also gets the opcode sampling going again, albeit in a bit of
1848 a lame way. Will come back later with a proper fix from codeblock sampling.
1850 * JavaScriptCore.exp:
1851 * bytecode/SamplingTool.cpp:
1852 (JSC::compareLineCountInfoSampling):
1853 (JSC::SamplingTool::dump):
1854 * bytecode/SamplingTool.h:
1855 (JSC::SamplingTool::SamplingTool):
1857 (JSC::ScopeNode::ScopeNode):
1859 2009-05-07 Mark Rowe <mrowe@apple.com>
1861 Rubber-stamped by Oliver Hunt.
1863 Fix <https://bugs.webkit.org/show_bug.cgi?id=25640>.
1864 Bug 25640: Crash on quit in r43384 nightly build on Leopard w/ Safari 4 beta installed
1866 Roll out r43366 as it removed symbols that Safari 4 Beta uses.
1868 * JavaScriptCore.exp:
1869 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1870 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1871 * bytecode/SamplingTool.cpp:
1872 (JSC::SamplingThread::start):
1873 (JSC::SamplingThread::stop):
1874 * bytecode/SamplingTool.h:
1875 * wtf/CrossThreadRefCounted.h:
1876 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
1880 * wtf/ThreadingNone.cpp:
1881 * wtf/ThreadingPthreads.cpp:
1882 (WTF::threadMapMutex):
1883 (WTF::initializeThreading):
1885 (WTF::identifierByPthreadHandle):
1886 (WTF::establishIdentifierForPthreadHandle):
1887 (WTF::pthreadHandleForIdentifier):
1888 (WTF::clearPthreadHandleForIdentifier):
1889 (WTF::createThreadInternal):
1890 (WTF::waitForThreadCompletion):
1891 (WTF::detachThread):
1892 (WTF::currentThread):
1893 * wtf/ThreadingWin.cpp:
1894 (WTF::threadMapMutex):
1895 (WTF::initializeThreading):
1897 (WTF::storeThreadHandleByIdentifier):
1898 (WTF::threadHandleForIdentifier):
1899 (WTF::clearThreadHandleForIdentifier):
1900 (WTF::createThreadInternal):
1901 (WTF::waitForThreadCompletion):
1902 (WTF::detachThread):
1903 (WTF::currentThread):
1904 * wtf/gtk/ThreadingGtk.cpp:
1905 (WTF::threadMapMutex):
1906 (WTF::initializeThreading):
1908 (WTF::identifierByGthreadHandle):
1909 (WTF::establishIdentifierForThread):
1910 (WTF::threadForIdentifier):
1911 (WTF::clearThreadForIdentifier):
1912 (WTF::createThreadInternal):
1913 (WTF::waitForThreadCompletion):
1914 (WTF::currentThread):
1915 * wtf/qt/ThreadingQt.cpp:
1916 (WTF::threadMapMutex):
1918 (WTF::identifierByQthreadHandle):
1919 (WTF::establishIdentifierForThread):
1920 (WTF::clearThreadForIdentifier):
1921 (WTF::threadForIdentifier):
1922 (WTF::initializeThreading):
1923 (WTF::createThreadInternal):
1924 (WTF::waitForThreadCompletion):
1925 (WTF::currentThread):
1927 2009-05-07 Gustavo Noronha Silva <gns@gnome.org>
1929 Suggested by Oliver Hunt.
1931 Also check for Linux for the special-cased calling convention.
1934 (JSC::JIT::privateCompileCTIMachineTrampolines):
1937 2009-05-07 Gavin Barraclough <barraclough@apple.com>
1939 Reviewed by Maciej Stachowiak.
1941 Previously, when appending to an existing string and growing the underlying buffer,
1942 we would actually allocate 110% of the required size in order to give us some space
1943 to expand into. Now we treat strings differently based on their size:
1945 Small Strings (up to 4 pages):
1946 Expand the allocation size to 112.5% of the amount requested. This is largely sicking
1947 to our previous policy, however 112.5% is cheaper to calculate.
1949 Medium Strings (up to 128 pages):
1950 For pages covering multiple pages over-allocation is less of a concern - any unused
1951 space will not be paged in if it is not used, so this is purely a VM overhead. For
1952 these strings allocate 2x the requested size.
1954 Large Strings (to infinity and beyond!):
1955 Revert to our 112.5% policy - probably best to limit the amount of unused VM we allow
1956 any individual string be responsible for.
1958 Additionally, round small allocations up to a multiple of 16 bytes, and medium and
1959 large allocations up to a multiple of page size.
1961 ~1.5% progression on Sunspider, due to 5% improvement on tagcloud & 15% on validate.
1963 * runtime/UString.cpp:
1964 (JSC::expandedSize):
1966 2009-05-07 Geoffrey Garen <ggaren@apple.com>
1968 Reviewed by Cameron Zwarich.
1970 Fixed a minor sequencing error introduced by recent Parser speedups.
1972 * runtime/JSGlobalData.cpp:
1973 (JSC::JSGlobalData::createNativeThunk): Missed a spot in my last patch.
1975 2009-05-07 Geoffrey Garen <ggaren@apple.com>
1979 * wtf/Platform.h: Reverted an accidental (and performance-catastrophic)
1982 2009-05-07 Geoffrey Garen <ggaren@apple.com>
1984 Reviewed by Cameron Zwarich.
1986 Fixed a minor sequencing error introduced by recent Parser speedups.
1988 * parser/Parser.cpp:
1989 (JSC::Parser::reparseInPlace): Missed a spot in my last patch.
1991 2009-05-07 Geoffrey Garen <ggaren@apple.com>
1993 Reviewed by Cameron Zwarich.
1995 Fixed a minor sequencing error introduced by recent Parser speedups.
1997 * parser/Parser.cpp:
1998 (JSC::Parser::parse):
2000 (JSC::Parser::parse):
2001 (JSC::Parser::reparse): Shrink the parsedObjects vector after allocating
2002 the root node, to avoid leaving a stray node in the vector, since that's
2003 a slight memory leak, and it causes problems during JSGlobalData teardown.
2005 * runtime/JSGlobalData.cpp:
2006 (JSC::JSGlobalData::~JSGlobalData): ASSERT that we're not being torn
2007 down while we think we're still parsing, since that would cause lots of
2008 bad memory references during our destruction.
2010 2009-05-07 Geoffrey Garen <ggaren@apple.com>
2012 Reviewed by Cameron Zwarich.
2014 Replaced two more macros with references to the JITStackFrame structure.
2017 (JSC::JIT::privateCompileMainPass):
2018 * jit/JITInlineMethods.h:
2019 (JSC::JIT::restoreArgumentReference):
2024 2009-05-07 Oliver Hunt <oliver@apple.com>
2026 Reviewed by Gavin Barraclough.
2028 Improve native call performance
2030 Fix the windows build by adding calling convention declarations everywhere,
2031 chose fastcall as that seemed most sensible given we were having to declare
2032 the convention explicitly. In addition switched to fastcall on mac in the
2033 deluded belief that documented fastcall behavior on windows would match
2034 actual its actual behavior.
2036 * API/JSCallbackFunction.h:
2037 * API/JSCallbackObject.h:
2038 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2039 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2040 * interpreter/CallFrame.h:
2041 (JSC::ExecState::argumentCount):
2043 (JSC::JIT::privateCompileCTIMachineTrampolines):
2051 (functionSetSamplingFlags):
2052 (functionClearSamplingFlags):
2055 * runtime/ArrayConstructor.cpp:
2056 (JSC::callArrayConstructor):
2057 * runtime/ArrayPrototype.cpp:
2058 (JSC::arrayProtoFuncToString):
2059 (JSC::arrayProtoFuncToLocaleString):
2060 (JSC::arrayProtoFuncJoin):
2061 (JSC::arrayProtoFuncConcat):
2062 (JSC::arrayProtoFuncPop):
2063 (JSC::arrayProtoFuncPush):
2064 (JSC::arrayProtoFuncReverse):
2065 (JSC::arrayProtoFuncShift):
2066 (JSC::arrayProtoFuncSlice):
2067 (JSC::arrayProtoFuncSort):
2068 (JSC::arrayProtoFuncSplice):
2069 (JSC::arrayProtoFuncUnShift):
2070 (JSC::arrayProtoFuncFilter):
2071 (JSC::arrayProtoFuncMap):
2072 (JSC::arrayProtoFuncEvery):
2073 (JSC::arrayProtoFuncForEach):
2074 (JSC::arrayProtoFuncSome):
2075 (JSC::arrayProtoFuncReduce):
2076 (JSC::arrayProtoFuncReduceRight):
2077 (JSC::arrayProtoFuncIndexOf):
2078 (JSC::arrayProtoFuncLastIndexOf):
2079 * runtime/BooleanConstructor.cpp:
2080 (JSC::callBooleanConstructor):
2081 * runtime/BooleanPrototype.cpp:
2082 (JSC::booleanProtoFuncToString):
2083 (JSC::booleanProtoFuncValueOf):
2084 * runtime/CallData.h:
2085 * runtime/DateConstructor.cpp:
2090 * runtime/DatePrototype.cpp:
2091 (JSC::dateProtoFuncToString):
2092 (JSC::dateProtoFuncToUTCString):
2093 (JSC::dateProtoFuncToDateString):
2094 (JSC::dateProtoFuncToTimeString):
2095 (JSC::dateProtoFuncToLocaleString):
2096 (JSC::dateProtoFuncToLocaleDateString):
2097 (JSC::dateProtoFuncToLocaleTimeString):
2098 (JSC::dateProtoFuncGetTime):
2099 (JSC::dateProtoFuncGetFullYear):
2100 (JSC::dateProtoFuncGetUTCFullYear):
2101 (JSC::dateProtoFuncToGMTString):
2102 (JSC::dateProtoFuncGetMonth):
2103 (JSC::dateProtoFuncGetUTCMonth):
2104 (JSC::dateProtoFuncGetDate):
2105 (JSC::dateProtoFuncGetUTCDate):
2106 (JSC::dateProtoFuncGetDay):
2107 (JSC::dateProtoFuncGetUTCDay):
2108 (JSC::dateProtoFuncGetHours):
2109 (JSC::dateProtoFuncGetUTCHours):
2110 (JSC::dateProtoFuncGetMinutes):
2111 (JSC::dateProtoFuncGetUTCMinutes):
2112 (JSC::dateProtoFuncGetSeconds):
2113 (JSC::dateProtoFuncGetUTCSeconds):
2114 (JSC::dateProtoFuncGetMilliSeconds):
2115 (JSC::dateProtoFuncGetUTCMilliseconds):
2116 (JSC::dateProtoFuncGetTimezoneOffset):
2117 (JSC::dateProtoFuncSetTime):
2118 (JSC::dateProtoFuncSetMilliSeconds):
2119 (JSC::dateProtoFuncSetUTCMilliseconds):
2120 (JSC::dateProtoFuncSetSeconds):
2121 (JSC::dateProtoFuncSetUTCSeconds):
2122 (JSC::dateProtoFuncSetMinutes):
2123 (JSC::dateProtoFuncSetUTCMinutes):
2124 (JSC::dateProtoFuncSetHours):
2125 (JSC::dateProtoFuncSetUTCHours):
2126 (JSC::dateProtoFuncSetDate):
2127 (JSC::dateProtoFuncSetUTCDate):
2128 (JSC::dateProtoFuncSetMonth):
2129 (JSC::dateProtoFuncSetUTCMonth):
2130 (JSC::dateProtoFuncSetFullYear):
2131 (JSC::dateProtoFuncSetUTCFullYear):
2132 (JSC::dateProtoFuncSetYear):
2133 (JSC::dateProtoFuncGetYear):
2134 * runtime/ErrorConstructor.cpp:
2135 (JSC::callErrorConstructor):
2136 * runtime/ErrorPrototype.cpp:
2137 (JSC::errorProtoFuncToString):
2138 * runtime/FunctionConstructor.cpp:
2139 (JSC::callFunctionConstructor):
2140 * runtime/FunctionPrototype.cpp:
2141 (JSC::callFunctionPrototype):
2142 (JSC::functionProtoFuncToString):
2143 (JSC::functionProtoFuncApply):
2144 (JSC::functionProtoFuncCall):
2145 * runtime/JSFunction.h:
2146 (JSC::JSFunction::nativeFunction):
2147 (JSC::JSFunction::setScopeChain):
2148 * runtime/JSGlobalObjectFunctions.cpp:
2149 (JSC::globalFuncEval):
2150 (JSC::globalFuncParseInt):
2151 (JSC::globalFuncParseFloat):
2152 (JSC::globalFuncIsNaN):
2153 (JSC::globalFuncIsFinite):
2154 (JSC::globalFuncDecodeURI):
2155 (JSC::globalFuncDecodeURIComponent):
2156 (JSC::globalFuncEncodeURI):
2157 (JSC::globalFuncEncodeURIComponent):
2158 (JSC::globalFuncEscape):
2159 (JSC::globalFuncUnescape):
2160 (JSC::globalFuncJSCPrint):
2161 * runtime/JSGlobalObjectFunctions.h:
2162 * runtime/MathObject.cpp:
2163 (JSC::mathProtoFuncAbs):
2164 (JSC::mathProtoFuncACos):
2165 (JSC::mathProtoFuncASin):
2166 (JSC::mathProtoFuncATan):
2167 (JSC::mathProtoFuncATan2):
2168 (JSC::mathProtoFuncCeil):
2169 (JSC::mathProtoFuncCos):
2170 (JSC::mathProtoFuncExp):
2171 (JSC::mathProtoFuncFloor):
2172 (JSC::mathProtoFuncLog):
2173 (JSC::mathProtoFuncMax):
2174 (JSC::mathProtoFuncMin):
2175 (JSC::mathProtoFuncPow):
2176 (JSC::mathProtoFuncRandom):
2177 (JSC::mathProtoFuncRound):
2178 (JSC::mathProtoFuncSin):
2179 (JSC::mathProtoFuncSqrt):
2180 (JSC::mathProtoFuncTan):
2181 * runtime/NativeErrorConstructor.cpp:
2182 (JSC::callNativeErrorConstructor):
2183 * runtime/NativeFunctionWrapper.h:
2184 * runtime/NumberConstructor.cpp:
2185 (JSC::callNumberConstructor):
2186 * runtime/NumberPrototype.cpp:
2187 (JSC::numberProtoFuncToString):
2188 (JSC::numberProtoFuncToLocaleString):
2189 (JSC::numberProtoFuncValueOf):
2190 (JSC::numberProtoFuncToFixed):
2191 (JSC::numberProtoFuncToExponential):
2192 (JSC::numberProtoFuncToPrecision):
2193 * runtime/ObjectConstructor.cpp:
2194 (JSC::callObjectConstructor):
2195 * runtime/ObjectPrototype.cpp:
2196 (JSC::objectProtoFuncValueOf):
2197 (JSC::objectProtoFuncHasOwnProperty):
2198 (JSC::objectProtoFuncIsPrototypeOf):
2199 (JSC::objectProtoFuncDefineGetter):
2200 (JSC::objectProtoFuncDefineSetter):
2201 (JSC::objectProtoFuncLookupGetter):
2202 (JSC::objectProtoFuncLookupSetter):
2203 (JSC::objectProtoFuncPropertyIsEnumerable):
2204 (JSC::objectProtoFuncToLocaleString):
2205 (JSC::objectProtoFuncToString):
2206 * runtime/ObjectPrototype.h:
2207 * runtime/RegExpConstructor.cpp:
2208 (JSC::callRegExpConstructor):
2209 * runtime/RegExpObject.cpp:
2210 (JSC::callRegExpObject):
2211 * runtime/RegExpPrototype.cpp:
2212 (JSC::regExpProtoFuncTest):
2213 (JSC::regExpProtoFuncExec):
2214 (JSC::regExpProtoFuncCompile):
2215 (JSC::regExpProtoFuncToString):
2216 * runtime/StringConstructor.cpp:
2217 (JSC::stringFromCharCode):
2218 (JSC::callStringConstructor):
2219 * runtime/StringPrototype.cpp:
2220 (JSC::stringProtoFuncReplace):
2221 (JSC::stringProtoFuncToString):
2222 (JSC::stringProtoFuncCharAt):
2223 (JSC::stringProtoFuncCharCodeAt):
2224 (JSC::stringProtoFuncConcat):
2225 (JSC::stringProtoFuncIndexOf):
2226 (JSC::stringProtoFuncLastIndexOf):
2227 (JSC::stringProtoFuncMatch):
2228 (JSC::stringProtoFuncSearch):
2229 (JSC::stringProtoFuncSlice):
2230 (JSC::stringProtoFuncSplit):
2231 (JSC::stringProtoFuncSubstr):
2232 (JSC::stringProtoFuncSubstring):
2233 (JSC::stringProtoFuncToLowerCase):
2234 (JSC::stringProtoFuncToUpperCase):
2235 (JSC::stringProtoFuncLocaleCompare):
2236 (JSC::stringProtoFuncBig):
2237 (JSC::stringProtoFuncSmall):
2238 (JSC::stringProtoFuncBlink):
2239 (JSC::stringProtoFuncBold):
2240 (JSC::stringProtoFuncFixed):
2241 (JSC::stringProtoFuncItalics):
2242 (JSC::stringProtoFuncStrike):
2243 (JSC::stringProtoFuncSub):
2244 (JSC::stringProtoFuncSup):
2245 (JSC::stringProtoFuncFontcolor):
2246 (JSC::stringProtoFuncFontsize):
2247 (JSC::stringProtoFuncAnchor):
2248 (JSC::stringProtoFuncLink):
2251 2009-05-07 Geoffrey Garen <ggaren@apple.com>
2255 Rolled out a portion of r43352 because it broke 64bit.
2259 2009-05-07 Kevin Ollivier <kevino@theolliviers.com>
2261 Build fix for functions reaturning ThreadIdentifier.
2263 * wtf/ThreadingNone.cpp:
2264 (WTF::createThreadInternal):
2265 (WTF::currentThread):
2267 2009-05-07 Maciej Stachowiak <mjs@apple.com>
2269 Reviewed by John Honeycutt.
2271 - enable optimization case im the last patch that I accidentally had disabled.
2273 * jit/JITArithmetic.cpp:
2274 (JSC::JIT::compileFastArithSlow_op_jnless):
2276 2009-05-07 Dmitry Titov <dimich@chromium.org>
2278 Attempt to fix Win build.
2280 * jit/JITArithmetic.cpp:
2281 (JSC::JIT::compileFastArithSlow_op_jnless):
2283 2009-05-07 Dmitry Titov <dimich@chromium.org>
2285 Reviewed by Alexey Proskuryakov and Adam Roben.
2287 https://bugs.webkit.org/show_bug.cgi?id=25348
2288 Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
2291 (WTF::ThreadIdentifier::ThreadIdentifier):
2292 (WTF::ThreadIdentifier::isValid):
2293 (WTF::ThreadIdentifier::invalidate):
2294 (WTF::ThreadIdentifier::platformId):
2295 ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
2296 methods that are used across the code on thread ids: construction, comparisons,
2297 check for 'valid' state etc. '0' is used as invalid id, which happens to just work
2298 with all platform-specific thread id implementations.
2300 All the following files repeatedly reflect the new ThreadIdentifier for each platform.
2301 We remove ThreadMap and threadMapMutex from all of them, remove the functions that
2302 populated/searched/cleared the map and add platform-specific comparison operators
2303 for ThreadIdentifier.
2305 * wtf/gtk/ThreadingGtk.cpp:
2306 (WTF::ThreadIdentifier::operator==):
2307 (WTF::ThreadIdentifier::operator!=):
2308 (WTF::initializeThreading):
2309 (WTF::createThreadInternal):
2310 (WTF::waitForThreadCompletion):
2311 (WTF::currentThread):
2313 * wtf/ThreadingNone.cpp:
2314 (WTF::ThreadIdentifier::operator==):
2315 (WTF::ThreadIdentifier::operator!=):
2317 * wtf/ThreadingPthreads.cpp:
2318 (WTF::ThreadIdentifier::operator==):
2319 (WTF::ThreadIdentifier::operator!=):
2320 (WTF::initializeThreading):
2321 (WTF::createThreadInternal):
2322 (WTF::waitForThreadCompletion):
2323 (WTF::detachThread):
2324 (WTF::currentThread):
2326 * wtf/qt/ThreadingQt.cpp:
2327 (WTF::ThreadIdentifier::operator==):
2328 (WTF::ThreadIdentifier::operator!=):
2329 (WTF::initializeThreading):
2330 (WTF::createThreadInternal):
2331 (WTF::waitForThreadCompletion):
2332 (WTF::currentThread):
2334 * wtf/ThreadingWin.cpp:
2335 (WTF::ThreadIdentifier::operator==):
2336 (WTF::ThreadIdentifier::operator!=):
2337 (WTF::initializeThreading):
2338 (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
2339 counter as a thread ID and mapped it into platform ID. Windows was using native thread
2340 id and mapped it into thread handle. Since we can always obtain a thread handle
2341 by thread id, createThread now closes the handle.
2342 (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
2343 it means the thread already exited.
2344 (WTF::detachThread):
2345 (WTF::currentThread):
2346 (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
2347 (WTF::waitForThreadCompletionDeprecated): same.
2348 (WTF::currentThreadDeprecated): same.
2349 (WTF::createThreadDeprecated): same.
2351 * bytecode/SamplingTool.h:
2352 * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
2354 * JavaScriptCore.exp: export lists - updated the WTF threading functions decorated names
2355 since they now take a different type as a parameter.
2356 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
2357 that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
2358 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
2360 2009-05-07 Maciej Stachowiak <mjs@apple.com>
2362 Reviewed by Sam Weinig.
2364 - optimize various cases of branch-fused less
2366 1% speedup on SunSpider overall
2367 13% speedup on math-cordic
2370 (JSC::JIT::privateCompileMainPass):
2371 op_loop_if_less: Optimize case of constant as first operand, just as case of constant as
2373 op_jnless: Factored out into compileFastArith_op_jnless.
2374 (JSC::JIT::privateCompileSlowCases):
2375 op_jnless: Factored out into compileFastArithSlow_op_jnless.
2377 * jit/JITArithmetic.cpp:
2378 (JSC::JIT::compileFastArith_op_jnless): Factored out from main compile loop.
2379 - Generate inline code for comparison of constant immediate int as first operand to another
2380 immediate int, as for loop_if_less
2382 (JSC::JIT::compileFastArithSlow_op_jnless):
2383 - Generate inline code for comparing two floating point numbers.
2384 - Generate code for both cases of comparing a floating point number to a constant immediate
2386 * bytecode/CodeBlock.cpp:
2387 (JSC::CodeBlock::dump): Fix dumping of op_jnless (tangentially related bugfix).
2389 2009-05-07 Geoffrey Garen <ggaren@apple.com>
2391 Reviewed by Sam Weinig.
2393 Added the return address of a stub function to the JITStackFrame abstraction.
2399 (JSC::StackHack::StackHack):
2400 (JSC::StackHack::~StackHack):
2401 (JSC::returnToThrowTrampoline):
2402 (JSC::JITStubs::cti_op_convert_this):
2403 (JSC::JITStubs::cti_op_end):
2404 (JSC::JITStubs::cti_op_add):
2405 (JSC::JITStubs::cti_op_pre_inc):
2406 (JSC::JITStubs::cti_timeout_check):
2407 (JSC::JITStubs::cti_register_file_check):
2408 (JSC::JITStubs::cti_op_loop_if_less):
2409 (JSC::JITStubs::cti_op_loop_if_lesseq):
2410 (JSC::JITStubs::cti_op_new_object):
2411 (JSC::JITStubs::cti_op_put_by_id_generic):
2412 (JSC::JITStubs::cti_op_get_by_id_generic):
2413 (JSC::JITStubs::cti_op_put_by_id):
2414 (JSC::JITStubs::cti_op_put_by_id_second):
2415 (JSC::JITStubs::cti_op_put_by_id_fail):
2416 (JSC::JITStubs::cti_op_get_by_id):
2417 (JSC::JITStubs::cti_op_get_by_id_second):
2418 (JSC::JITStubs::cti_op_get_by_id_self_fail):
2419 (JSC::JITStubs::cti_op_get_by_id_proto_list):
2420 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
2421 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
2422 (JSC::JITStubs::cti_op_get_by_id_array_fail):
2423 (JSC::JITStubs::cti_op_get_by_id_string_fail):
2424 (JSC::JITStubs::cti_op_instanceof):
2425 (JSC::JITStubs::cti_op_del_by_id):
2426 (JSC::JITStubs::cti_op_mul):
2427 (JSC::JITStubs::cti_op_new_func):
2428 (JSC::JITStubs::cti_op_call_JSFunction):
2429 (JSC::JITStubs::cti_op_call_arityCheck):
2430 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2431 (JSC::JITStubs::cti_vm_lazyLinkCall):
2432 (JSC::JITStubs::cti_op_push_activation):
2433 (JSC::JITStubs::cti_op_call_NotJSFunction):
2434 (JSC::JITStubs::cti_op_create_arguments):
2435 (JSC::JITStubs::cti_op_create_arguments_no_params):
2436 (JSC::JITStubs::cti_op_tear_off_activation):
2437 (JSC::JITStubs::cti_op_tear_off_arguments):
2438 (JSC::JITStubs::cti_op_profile_will_call):
2439 (JSC::JITStubs::cti_op_profile_did_call):
2440 (JSC::JITStubs::cti_op_ret_scopeChain):
2441 (JSC::JITStubs::cti_op_new_array):
2442 (JSC::JITStubs::cti_op_resolve):
2443 (JSC::JITStubs::cti_op_construct_JSConstruct):
2444 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
2445 (JSC::JITStubs::cti_op_get_by_val):
2446 (JSC::JITStubs::cti_op_get_by_val_string):
2447 (JSC::JITStubs::cti_op_get_by_val_byte_array):
2448 (JSC::JITStubs::cti_op_resolve_func):
2449 (JSC::JITStubs::cti_op_sub):
2450 (JSC::JITStubs::cti_op_put_by_val):
2451 (JSC::JITStubs::cti_op_put_by_val_array):
2452 (JSC::JITStubs::cti_op_put_by_val_byte_array):
2453 (JSC::JITStubs::cti_op_lesseq):
2454 (JSC::JITStubs::cti_op_loop_if_true):
2455 (JSC::JITStubs::cti_op_load_varargs):
2456 (JSC::JITStubs::cti_op_negate):
2457 (JSC::JITStubs::cti_op_resolve_base):
2458 (JSC::JITStubs::cti_op_resolve_skip):
2459 (JSC::JITStubs::cti_op_resolve_global):
2460 (JSC::JITStubs::cti_op_div):
2461 (JSC::JITStubs::cti_op_pre_dec):
2462 (JSC::JITStubs::cti_op_jless):
2463 (JSC::JITStubs::cti_op_not):
2464 (JSC::JITStubs::cti_op_jtrue):
2465 (JSC::JITStubs::cti_op_post_inc):
2466 (JSC::JITStubs::cti_op_eq):
2467 (JSC::JITStubs::cti_op_lshift):
2468 (JSC::JITStubs::cti_op_bitand):
2469 (JSC::JITStubs::cti_op_rshift):
2470 (JSC::JITStubs::cti_op_bitnot):
2471 (JSC::JITStubs::cti_op_resolve_with_base):
2472 (JSC::JITStubs::cti_op_new_func_exp):
2473 (JSC::JITStubs::cti_op_mod):
2474 (JSC::JITStubs::cti_op_less):
2475 (JSC::JITStubs::cti_op_neq):
2476 (JSC::JITStubs::cti_op_post_dec):
2477 (JSC::JITStubs::cti_op_urshift):
2478 (JSC::JITStubs::cti_op_bitxor):
2479 (JSC::JITStubs::cti_op_new_regexp):
2480 (JSC::JITStubs::cti_op_bitor):
2481 (JSC::JITStubs::cti_op_call_eval):
2482 (JSC::JITStubs::cti_op_throw):
2483 (JSC::JITStubs::cti_op_get_pnames):
2484 (JSC::JITStubs::cti_op_next_pname):
2485 (JSC::JITStubs::cti_op_push_scope):
2486 (JSC::JITStubs::cti_op_pop_scope):
2487 (JSC::JITStubs::cti_op_typeof):
2488 (JSC::JITStubs::cti_op_is_undefined):
2489 (JSC::JITStubs::cti_op_is_boolean):
2490 (JSC::JITStubs::cti_op_is_number):
2491 (JSC::JITStubs::cti_op_is_string):
2492 (JSC::JITStubs::cti_op_is_object):
2493 (JSC::JITStubs::cti_op_is_function):
2494 (JSC::JITStubs::cti_op_stricteq):
2495 (JSC::JITStubs::cti_op_to_primitive):
2496 (JSC::JITStubs::cti_op_strcat):
2497 (JSC::JITStubs::cti_op_nstricteq):
2498 (JSC::JITStubs::cti_op_to_jsnumber):
2499 (JSC::JITStubs::cti_op_in):
2500 (JSC::JITStubs::cti_op_push_new_scope):
2501 (JSC::JITStubs::cti_op_jmp_scopes):
2502 (JSC::JITStubs::cti_op_put_by_index):
2503 (JSC::JITStubs::cti_op_switch_imm):
2504 (JSC::JITStubs::cti_op_switch_char):
2505 (JSC::JITStubs::cti_op_switch_string):
2506 (JSC::JITStubs::cti_op_del_by_val):
2507 (JSC::JITStubs::cti_op_put_getter):
2508 (JSC::JITStubs::cti_op_put_setter):
2509 (JSC::JITStubs::cti_op_new_error):
2510 (JSC::JITStubs::cti_op_debug):
2511 (JSC::JITStubs::cti_vm_throw):
2513 (JSC::JITStackFrame::returnAddressSlot):
2515 2009-05-07 Darin Adler <darin@apple.com>
2517 Reviewed by Geoff Garen.
2520 (JSC::Lexer::lex): Fix missing braces. This would make us always
2521 take the slower case for string parsing and Visual Studio correctly
2522 noticed unreachable code.
2524 2009-05-07 Darin Adler <darin@apple.com>
2526 Reviewed by Sam Weinig.
2528 Bug 25589: goto instead of state machine in lexer
2529 https://bugs.webkit.org/show_bug.cgi?id=25589
2531 SunSpider is 0.8% faster.
2534 (JSC::Lexer::currentCharacter): Added.
2535 (JSC::Lexer::currentOffset): Changed to call currentCharacter for clarity.
2536 (JSC::Lexer::setCode): Removed code to set now-obsolete m_skipLineEnd.
2537 (JSC::Lexer::shiftLineTerminator): Added. Handles line numbers and the
2538 two-character line terminators.
2539 (JSC::Lexer::makeIdentifier): Changed to take characters and length rather
2540 than a vector, since we now make these directly out of the source buffer
2542 (JSC::Lexer::lastTokenWasRestrKeyword): Added.
2543 (JSC::isNonASCIIIdentStart): Broke out the non-inline part.
2544 (JSC::isIdentStart): Moved here.
2545 (JSC::isNonASCIIIdentPart): Broke out the non-inline part.
2546 (JSC::isIdentPart): Moved here.
2547 (JSC::singleEscape): Moved here, and removed some unneeded cases.
2548 (JSC::Lexer::record8): Moved here.
2549 (JSC::Lexer::record16): Moved here.
2550 (JSC::Lexer::lex): Rewrote this whole function to use goto and not use
2551 a state machine. Got rid of most of the local variables. Also rolled the
2552 matchPunctuator function in here.
2553 (JSC::Lexer::scanRegExp): Changed to use the new version of isLineTerminator.
2554 Clear m_buffer16 after using it instead of before.
2556 * parser/Lexer.h: Removed State enum, setDone function, nextLine function,
2557 lookupKeywordFunction, one of the isLineTerminator functions, m_done data member,
2558 m_skipLineEnd data member, and m_state data member. Added shiftLineTerminator
2559 function, currentCharacter function, and changed the arguments to the makeIdentifier
2560 function. Removed one branch from the isLineTerminator function.
2562 * runtime/StringPrototype.cpp:
2563 (JSC::stringProtoFuncReplace): Streamlined the case where we don't replace anything.
2565 2009-05-07 Geoffrey Garen <ggaren@apple.com>
2567 Reviewed by Gavin Barraclough.
2569 Removed a few more special constants, and replaced them with uses of
2570 the JITStackFrame struct.
2572 Removed one of the two possible definitions of VoidPtrPair. The Mac
2573 definition was more elegant, but SunSpider doesn't think it's any
2574 faster, and it's net less elegant to have two ways of doing things.
2577 (JSC::JIT::privateCompileMainPass):
2578 (JSC::JIT::privateCompile):
2582 2009-05-07 Darin Adler <darin@apple.com>
2584 * runtime/ScopeChain.h:
2585 (JSC::ScopeChainNode::~ScopeChainNode): Tweak formatting.
2587 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
2589 Reviewed by Tor Arne Vestbø.
2591 Fix the build thread stack base determination build on Symbian,
2592 by moving the code block before PLATFORM(UNIX), which is also
2593 enabled on Symbian builds.
2595 * runtime/Collector.cpp:
2596 (JSC::currentThreadStackBase):
2598 2009-05-07 Oliver Hunt <oliver@apple.com>
2600 Reviewed by Gavin Barraclough.
2602 Fix crash due to incorrectly using an invalid scopechain
2604 stringProtoFuncReplace was checking for an exception on a CachedCall
2605 by asking for the cached callframes exception. Unfortunately this
2606 could crash in certain circumstances as CachedCall does not guarantee
2607 a valid callframe following a call. Even more unfortunately the check
2608 was entirely unnecessary as there is only a single exception slot per
2609 global data, so it was already checked via the initial exec->hadException()
2612 To make bugs like this more obvious, i've added a debug only destructor
2613 to ScopeChainNode that 0's all of its fields. This exposed a crash in
2614 the standard javascriptcore tests.
2616 * runtime/ScopeChain.h:
2617 (JSC::ScopeChainNode::~ScopeChainNode):
2618 (JSC::ScopeChain::~ScopeChain):
2619 * runtime/StringPrototype.cpp:
2620 (JSC::stringProtoFuncReplace):
2622 2009-05-07 Gavin Barraclough <barraclough@apple.com>
2624 Reviewed by Geoff Garen.
2626 Enable op_strcat across += assignments. This patch allows the lhs of a read/modify node
2627 to be included within the concatenation operation, and also modifies the implementation
2628 of the concatenation to attempt to reuse and cat onto the leftmost string, rather than
2629 always allocating a new empty output string to copy into (as was previously the behaviour).
2631 ~0.5% progression, due to a 3%-3.5% progression on the string tests (particularly validate).
2634 (JSC::BinaryOpNode::emitStrcat):
2635 (JSC::emitReadModifyAssignment):
2636 (JSC::ReadModifyResolveNode::emitBytecode):
2637 (JSC::ReadModifyDotNode::emitBytecode):
2638 (JSC::ReadModifyBracketNode::emitBytecode):
2640 * runtime/Operations.h:
2641 (JSC::concatenateStrings):
2642 * runtime/UString.cpp:
2643 (JSC::UString::reserveCapacity):
2644 * runtime/UString.h:
2646 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
2648 Reviewed by Oliver Hunt.
2650 Fix the build on Windows without JIT: interpreter/RegisterFile.h needs
2651 roundUpAllocationSize, which is protected by #if ENABLED(ASSEMBLER).
2652 Moved the #ifdef down and always offer the function.
2654 * jit/ExecutableAllocator.h:
2656 2009-05-06 Geoffrey Garen <ggaren@apple.com>
2658 Reviewed by Gavin "++" Barraclough.
2660 Added some abstraction around the JIT stub calling convention by creating
2661 a struct to represent the persistent stack frame JIT code shares with
2664 SunSpider reports no change.
2668 (JSC::JITStubs::cti_op_convert_this):
2669 (JSC::JITStubs::cti_op_end):
2670 (JSC::JITStubs::cti_op_add):
2671 (JSC::JITStubs::cti_op_pre_inc):
2672 (JSC::JITStubs::cti_timeout_check):
2673 (JSC::JITStubs::cti_register_file_check):
2674 (JSC::JITStubs::cti_op_loop_if_less):
2675 (JSC::JITStubs::cti_op_loop_if_lesseq):
2676 (JSC::JITStubs::cti_op_new_object):
2677 (JSC::JITStubs::cti_op_put_by_id_generic):
2678 (JSC::JITStubs::cti_op_get_by_id_generic):
2679 (JSC::JITStubs::cti_op_put_by_id):
2680 (JSC::JITStubs::cti_op_put_by_id_second):
2681 (JSC::JITStubs::cti_op_put_by_id_fail):
2682 (JSC::JITStubs::cti_op_get_by_id):
2683 (JSC::JITStubs::cti_op_get_by_id_second):
2684 (JSC::JITStubs::cti_op_get_by_id_self_fail):
2685 (JSC::JITStubs::cti_op_get_by_id_proto_list):
2686 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
2687 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
2688 (JSC::JITStubs::cti_op_get_by_id_array_fail):
2689 (JSC::JITStubs::cti_op_get_by_id_string_fail):
2690 (JSC::JITStubs::cti_op_instanceof):
2691 (JSC::JITStubs::cti_op_del_by_id):
2692 (JSC::JITStubs::cti_op_mul):
2693 (JSC::JITStubs::cti_op_new_func):
2694 (JSC::JITStubs::cti_op_call_JSFunction):
2695 (JSC::JITStubs::cti_op_call_arityCheck):
2696 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2697 (JSC::JITStubs::cti_vm_lazyLinkCall):
2698 (JSC::JITStubs::cti_op_push_activation):
2699 (JSC::JITStubs::cti_op_call_NotJSFunction):
2700 (JSC::JITStubs::cti_op_create_arguments):
2701 (JSC::JITStubs::cti_op_create_arguments_no_params):
2702 (JSC::JITStubs::cti_op_tear_off_activation):
2703 (JSC::JITStubs::cti_op_tear_off_arguments):
2704 (JSC::JITStubs::cti_op_profile_will_call):
2705 (JSC::JITStubs::cti_op_profile_did_call):
2706 (JSC::JITStubs::cti_op_ret_scopeChain):
2707 (JSC::JITStubs::cti_op_new_array):
2708 (JSC::JITStubs::cti_op_resolve):
2709 (JSC::JITStubs::cti_op_construct_JSConstruct):
2710 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
2711 (JSC::JITStubs::cti_op_get_by_val):
2712 (JSC::JITStubs::cti_op_get_by_val_string):
2713 (JSC::JITStubs::cti_op_get_by_val_byte_array):
2714 (JSC::JITStubs::cti_op_resolve_func):
2715 (JSC::JITStubs::cti_op_sub):
2716 (JSC::JITStubs::cti_op_put_by_val):
2717 (JSC::JITStubs::cti_op_put_by_val_array):
2718 (JSC::JITStubs::cti_op_put_by_val_byte_array):
2719 (JSC::JITStubs::cti_op_lesseq):
2720 (JSC::JITStubs::cti_op_loop_if_true):
2721 (JSC::JITStubs::cti_op_load_varargs):
2722 (JSC::JITStubs::cti_op_negate):
2723 (JSC::JITStubs::cti_op_resolve_base):
2724 (JSC::JITStubs::cti_op_resolve_skip):
2725 (JSC::JITStubs::cti_op_resolve_global):
2726 (JSC::JITStubs::cti_op_div):
2727 (JSC::JITStubs::cti_op_pre_dec):
2728 (JSC::JITStubs::cti_op_jless):
2729 (JSC::JITStubs::cti_op_not):
2730 (JSC::JITStubs::cti_op_jtrue):
2731 (JSC::JITStubs::cti_op_post_inc):
2732 (JSC::JITStubs::cti_op_eq):
2733 (JSC::JITStubs::cti_op_lshift):
2734 (JSC::JITStubs::cti_op_bitand):
2735 (JSC::JITStubs::cti_op_rshift):
2736 (JSC::JITStubs::cti_op_bitnot):
2737 (JSC::JITStubs::cti_op_resolve_with_base):
2738 (JSC::JITStubs::cti_op_new_func_exp):
2739 (JSC::JITStubs::cti_op_mod):
2740 (JSC::JITStubs::cti_op_less):
2741 (JSC::JITStubs::cti_op_neq):
2742 (JSC::JITStubs::cti_op_post_dec):
2743 (JSC::JITStubs::cti_op_urshift):
2744 (JSC::JITStubs::cti_op_bitxor):
2745 (JSC::JITStubs::cti_op_new_regexp):
2746 (JSC::JITStubs::cti_op_bitor):
2747 (JSC::JITStubs::cti_op_call_eval):
2748 (JSC::JITStubs::cti_op_throw):
2749 (JSC::JITStubs::cti_op_get_pnames):
2750 (JSC::JITStubs::cti_op_next_pname):
2751 (JSC::JITStubs::cti_op_push_scope):
2752 (JSC::JITStubs::cti_op_pop_scope):
2753 (JSC::JITStubs::cti_op_typeof):
2754 (JSC::JITStubs::cti_op_is_undefined):
2755 (JSC::JITStubs::cti_op_is_boolean):
2756 (JSC::JITStubs::cti_op_is_number):
2757 (JSC::JITStubs::cti_op_is_string):
2758 (JSC::JITStubs::cti_op_is_object):
2759 (JSC::JITStubs::cti_op_is_function):
2760 (JSC::JITStubs::cti_op_stricteq):
2761 (JSC::JITStubs::cti_op_to_primitive):
2762 (JSC::JITStubs::cti_op_strcat):
2763 (JSC::JITStubs::cti_op_nstricteq):
2764 (JSC::JITStubs::cti_op_to_jsnumber):
2765 (JSC::JITStubs::cti_op_in):
2766 (JSC::JITStubs::cti_op_push_new_scope):
2767 (JSC::JITStubs::cti_op_jmp_scopes):
2768 (JSC::JITStubs::cti_op_put_by_index):
2769 (JSC::JITStubs::cti_op_switch_imm):
2770 (JSC::JITStubs::cti_op_switch_char):
2771 (JSC::JITStubs::cti_op_switch_string):
2772 (JSC::JITStubs::cti_op_del_by_val):
2773 (JSC::JITStubs::cti_op_put_getter):
2774 (JSC::JITStubs::cti_op_put_setter):
2775 (JSC::JITStubs::cti_op_new_error):
2776 (JSC::JITStubs::cti_op_debug):
2777 (JSC::JITStubs::cti_vm_throw):
2781 2009-05-06 Gavin Barraclough <barraclough@apple.com>
2783 Reviewed by Maciej Stachowiak & Darin Adler.
2785 Improve string concatenation (as coded in JS as a sequence of adds).
2787 Detect patterns corresponding to string concatenation, and change the bytecode
2788 generation to emit a new op_strcat instruction. By handling the full set of
2789 additions within a single function we do not need allocate JSString wrappers
2790 for intermediate results, and we can calculate the size of the output string
2791 prior to allocating storage, in order to prevent reallocation of the buffer.
2793 1.5%-2% progression on Sunspider, largely due to a 30% progression on date-format-xparb.
2795 * bytecode/CodeBlock.cpp:
2796 (JSC::CodeBlock::dump):
2798 * bytecode/Opcode.h:
2800 * bytecompiler/BytecodeGenerator.cpp:
2801 (JSC::BytecodeGenerator::emitStrcat):
2802 (JSC::BytecodeGenerator::emitToPrimitive):
2803 Add generation of new opcodes.
2804 * bytecompiler/BytecodeGenerator.h:
2805 Add generation of new opcodes.
2806 * interpreter/Interpreter.cpp:
2807 (JSC::Interpreter::privateExecute):
2808 Add implmentation of new opcodes.
2810 (JSC::JIT::privateCompileMainPass):
2811 (JSC::JIT::privateCompileSlowCases):
2812 Add implmentation of new opcodes.
2814 (JSC::JITStubs::cti_op_to_primitive):
2815 (JSC::JITStubs::cti_op_strcat):
2816 Add implmentation of new opcodes.
2818 Add implmentation of new opcodes.
2820 (JSC::BinaryOpNode::emitStrcat):
2821 (JSC::BinaryOpNode::emitBytecode):
2822 (JSC::ReadModifyResolveNode::emitBytecode):
2823 Add generation of new opcodes.
2825 (JSC::ExpressionNode::):
2827 Add methods to allow identification of add nodes.
2828 * parser/ResultType.h:
2829 (JSC::ResultType::definitelyIsString):
2830 (JSC::ResultType::forAdd):
2831 Fix error in detection of adds that will produce string results.
2832 * runtime/Operations.h:
2833 (JSC::concatenateStrings):
2834 Add implmentation of new opcodes.
2835 * runtime/UString.cpp:
2836 (JSC::UString::appendNumeric):
2837 Add methods to append numbers to an existing string.
2838 * runtime/UString.h:
2839 (JSC::UString::Rep::createEmptyBuffer):
2840 (JSC::UString::BaseString::BaseString):
2841 Add support for creating an empty string with a non-zero capacity available in the BaseString.
2843 2009-05-06 Darin Adler <darin@apple.com>
2845 Reviewed by Sam Weinig.
2847 Made RefCounted::m_refCount private.
2849 * runtime/Structure.h: Removed addressOfCount.
2850 * wtf/RefCounted.h: Made m_refCount private.
2851 Added addressOfCount.
2853 2009-05-06 Darin Adler <darin@apple.com>
2855 Fixed assertion seen a lot!
2858 (JSC::FunctionBodyNode::~FunctionBodyNode): Removed now-bogus assertion.
2860 2009-05-06 Darin Adler <darin@apple.com>
2862 Working with Sam Weinig.
2864 Redo parse tree constructor optimization without breaking the Windows
2865 build the way I did yesterday. The previous try broke the build by adding
2866 an include of Lexer.h and all its dependencies that had to work outside
2867 the JavaScriptCore project.
2869 * GNUmakefile.am: Added NodeConstructors.h.
2870 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
2872 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2873 Removed byteocde directory -- we no longer are trying to include Lexer.h
2874 outside JavaScriptCore.
2876 * JavaScriptCore.xcodeproj/project.pbxproj: Change SegmentedVector.h
2877 and Lexer.h back to internal files. Added NodeConstructors.h.
2879 * parser/Grammar.y: Added include of NodeConstructors.h.
2880 Changed use of ConstDeclNode to use public functions.
2882 * parser/NodeConstructors.h: Copied from parser/Nodes.h.
2883 Just contains the inlined constructors now.
2885 * parser/Nodes.cpp: Added include of NodeConstructors.h.
2886 Moved node constructors into the header.
2887 (JSC::FunctionBodyNode::FunctionBodyNode): Removed m_refCount
2890 * parser/Nodes.h: Removed all the constructor definitions, and also
2891 removed the JSC_FAST_CALL from them since these are all inlined, so the
2892 calling convention is irrelevant. Made more things private. Used a data
2893 member for operator opcodes instead of a virtual function. Removed the
2894 special FunctionBodyNode::ref/deref functions since the default functions
2895 are now just as fast.
2897 * runtime/FunctionConstructor.cpp:
2898 (JSC::extractFunctionBody): Fixed types here so we don't typecast until
2899 after we do type checking.
2901 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
2903 Reviewed by Ariya Hidayat.
2905 Fix the Qt build on Windows.
2907 * JavaScriptCore.pri: Define BUILDING_JavaScriptCore/WTF to get the meaning
2908 of the JS_EXPORTDATA macros correct
2910 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
2912 Reviewed by Ariya Hidayat.
2914 Enable the JIT for the Qt build on Windows.
2916 * JavaScriptCore.pri:
2918 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
2920 Reviewed by Tor Arne Vestbø.
2922 Tweak JavaScriptCore.pri for being able to override the generated sources dir for the
2923 generated_files target.
2925 * JavaScriptCore.pri:
2927 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
2929 Reviewed by Simon Hausmann.
2931 Build QtWebKit as a framework on Mac
2933 This implies both debug and release build by default, unless
2934 one of the --debug or --release config options are passed to
2935 the build-webkit script.
2937 Frameworks can be disabled by passing CONFIG+=webkit_no_framework
2938 to the build-webkit script.
2940 To be able to build both debug and release targets in parallel
2941 we have to use separate output directories for the generated
2942 sources, which is not optimal, but required to avoid race conditions.
2944 An optimization would be to only require this spit-up on Mac.
2946 * JavaScriptCore.pri:
2947 * JavaScriptCore.pro:
2950 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
2952 Reviewed by Simon Hausmann.
2954 [Qt] Use $$GENERATED_SOURCES_DIR as output when running bison
2956 A couple of the generators left the bison output file in the source
2957 tree, and then moved it into $$GENERATED_SOURCES_DIR, which did not
2958 work well when building release and debug configurations in parallel.
2960 * JavaScriptCore.pri:
2962 2009-05-05 Geoffrey Garen <ggaren@apple.com>
2964 Reviewed by Maciej Stachowiak.
2966 Simplified a bit of codegen.
2969 (JSC::JIT::privateCompileMainPass):
2971 2009-05-05 Geoffrey Garen <ggaren@apple.com>
2973 Reviewed by Cameron Zwarich.
2975 Moved all the JIT stub related code into one place.
2984 2009-05-05 Sam Weinig <sam@webkit.org>
2986 Try to fix Windows build.
2988 Move Node constructor to the .cpp file.
2993 2009-05-05 Darin Adler <darin@apple.com>
2995 Try to fix Windows build.
2997 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2998 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3000 Try to fix Mac build.
3002 * JavaScriptCore.xcodeproj/project.pbxproj: Made SegmentedVector.h private.
3004 2009-05-05 Darin Adler <darin@apple.com>
3006 Try to fix Mac build.
3008 * JavaScriptCore.xcodeproj/project.pbxproj: Made Lexer.h private.
3010 2009-05-05 Darin Adler <darin@apple.com>
3012 Reviewed by Sam Weinig.
3014 Bug 25569: make ParserRefCounted use conventional reference counting
3015 https://bugs.webkit.org/show_bug.cgi?id=25569
3017 SunSpider speedup of about 1.6%.
3019 * JavaScriptCore.exp: Updated.
3022 (JSC::NodeReleaser::releaseAllNodes): ALWAYS_INLINE.
3023 (JSC::NodeReleaser::adopt): Ditto.
3024 (JSC::ParserRefCounted::ParserRefCounted): Removed most of the code.
3025 Add the object to a Vector<RefPtr> that gets cleared after parsing.
3026 (JSC::ParserRefCounted::~ParserRefCounted): Removed most of the code.
3028 * parser/Nodes.h: Made ParserRefCounted inherit from RefCounted and
3029 made inline versions of the constructor and destructor. Made the
3030 Node constructor inline.
3032 * parser/Parser.cpp:
3033 (JSC::Parser::parse): Call globalData->parserObjects.shrink(0) after
3034 parsing, where it used to call ParserRefCounted::deleteNewObjects.
3036 * runtime/JSGlobalData.cpp:
3037 (JSC::JSGlobalData::JSGlobalData): Eliminated code to manage the
3038 newParserObjects and parserObjectExtraRefCounts.
3039 (JSC::JSGlobalData::~JSGlobalData): Ditto.
3041 * runtime/JSGlobalData.h: Replaced the HashSet and HashCountedSet
3045 (WTF::PassRefPtr::~PassRefPtr): The most common thing to do with a
3046 PassRefPtr in hot code is to pass it and then destroy it once it's
3047 set to zero. Help the optimizer by telling it that's true.
3049 2009-05-05 Xan Lopez <xlopez@igalia.com> and Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
3051 Reviewed by Oliver Hunt.
3053 Disable the NativeFunctionWrapper for all non-Mac ports for now,
3054 as it is also crashing on Linux/x86.
3056 * runtime/NativeFunctionWrapper.h:
3058 2009-05-05 Steve Falkenburg <sfalken@apple.com>
3062 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3063 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3065 2009-05-05 Oliver Hunt <oliver@apple.com>
3067 Reviewed by Maciej Stachowiak.
3069 Expose toThisObject for the DOM Window
3071 * JavaScriptCore.exp:
3073 2009-05-05 Oliver Hunt <oliver@apple.com>
3075 Reviewed by NOBODY (Make windows go again until i work out the
3076 accursed calling convention).
3078 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3080 * runtime/NativeFunctionWrapper.h:
3082 2009-05-05 Oliver Hunt <oliver@apple.com>
3084 Reviewed by NOBODY (Fix windows debug builds).
3086 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3088 2009-05-05 Oliver Hunt <oliver@apple.com>
3090 Reviewed by NOBODY (Hopefully the last fix).
3092 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3094 2009-05-05 Oliver Hunt <oliver@apple.com>
3096 Reviewed by NOBODY (Fix the build fix caused by a different build fix).
3101 2009-05-05 Oliver Hunt <oliver@apple.com>
3103 Reviewed by NOBODY (No idea how my changes could have broken these).
3105 * runtime/DatePrototype.cpp:
3106 * runtime/RegExpObject.cpp:
3108 2009-05-05 Oliver Hunt <oliver@apple.com>
3110 Reviewed by NOBODY (Why should i expect msvc to list all the errors in a file?).
3114 2009-05-05 Oliver Hunt <oliver@apple.com>
3116 Reviewed by NOBODY (Fix warning, and another missing include).
3121 2009-05-05 Oliver Hunt <oliver@apple.com>
3123 Reviewed by NOBODY (More build fixes).
3125 * runtime/ErrorPrototype.cpp:
3126 * runtime/JSGlobalObject.cpp:
3127 * runtime/NumberPrototype.cpp:
3128 * runtime/ObjectPrototype.cpp:
3129 * runtime/StringConstructor.cpp:
3131 2009-05-05 Oliver Hunt <oliver@apple.com>
3133 Reviewed by NOBODY (Will the fixes never end?).
3135 * runtime/FunctionPrototype.h:
3136 * runtime/Lookup.cpp:
3138 2009-05-05 Oliver Hunt <oliver@apple.com>
3140 Reviewed by NOBODY (More build fixes).
3144 2009-05-05 Oliver Hunt <oliver@apple.com>
3146 Reviewed by NOBODY (More build fixing).
3148 * runtime/CallData.h:
3150 2009-05-05 Oliver Hunt <oliver@apple.com>
3152 Reviewed by NOBODY (Build fix).
3154 * runtime/ArrayConstructor.cpp:
3155 * runtime/BooleanPrototype.cpp:
3156 * runtime/DateConstructor.cpp:
3157 * runtime/Error.cpp:
3158 * runtime/ObjectConstructor.cpp:
3159 * runtime/RegExpPrototype.cpp:
3161 2009-05-05 Oliver Hunt <oliver@apple.com>
3163 Reviewed by NOBODY (Buildfix).
3167 * runtime/NativeFunctionWrapper.h: Copied from JavaScriptCore/jit/ExecutableAllocator.cpp.
3169 2009-05-05 Oliver Hunt <oliver@apple.com>
3171 Reviewed by Gavin Barraclough.
3173 Bug 25559: Improve native function call performance
3174 <https://bugs.webkit.org/show_bug.cgi?id=25559>
3176 In order to cache calls to native functions we now make the standard
3177 prototype functions use a small assembly thunk that converts the JS
3178 calling convention into the native calling convention. As this is
3179 only beneficial in the JIT we use the NativeFunctionWrapper typedef
3180 to alternate between PrototypeFunction and JSFunction to keep the
3181 code sane. This change from PrototypeFunction to NativeFunctionWrapper
3182 is the bulk of this patch.
3184 * JavaScriptCore.exp:
3185 * JavaScriptCore.xcodeproj/project.pbxproj:
3186 * assembler/MacroAssemblerX86Common.h:
3187 (JSC::MacroAssemblerX86Common::call):
3188 * assembler/MacroAssemblerX86_64.h:
3189 (JSC::MacroAssemblerX86_64::addPtr):
3190 * assembler/X86Assembler.h:
3191 (JSC::X86Assembler::leaq_mr):
3192 (JSC::X86Assembler::call_m):
3193 * interpreter/Interpreter.cpp:
3194 (JSC::Interpreter::execute):
3195 (JSC::Interpreter::prepareForRepeatCall):
3197 (JSC::JIT::privateCompileCTIMachineTrampolines):
3199 (JSC::JIT::compileCTIMachineTrampolines):
3201 (JSC::JIT::linkCall):
3202 (JSC::JIT::compileOpCallInitializeCallFrame):
3203 (JSC::JIT::compileOpCall):
3205 (JSC::JITCode::operator bool):
3206 * jit/JITInlineMethods.h:
3207 (JSC::JIT::emitGetFromCallFrameHeader):
3208 (JSC::JIT::emitGetFromCallFrameHeader32):
3210 (JSC::JITStubs::JITStubs):
3211 (JSC::JITStubs::cti_op_call_JSFunction):
3212 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
3213 (JSC::JITStubs::cti_vm_lazyLinkCall):
3214 (JSC::JITStubs::cti_op_construct_JSConstruct):
3216 (JSC::JITStubs::ctiNativeCallThunk):
3218 (GlobalObject::GlobalObject):
3220 (JSC::FunctionBodyNode::FunctionBodyNode):
3221 (JSC::FunctionBodyNode::createNativeThunk):
3222 (JSC::FunctionBodyNode::generateJITCode):
3224 (JSC::FunctionBodyNode::):
3225 (JSC::FunctionBodyNode::generatedJITCode):
3226 (JSC::FunctionBodyNode::jitCode):
3227 * profiler/Profiler.cpp:
3228 (JSC::Profiler::createCallIdentifier):
3229 * runtime/ArgList.h:
3230 * runtime/ArrayPrototype.cpp:
3231 (JSC::isNumericCompareFunction):
3232 * runtime/BooleanPrototype.cpp:
3233 (JSC::BooleanPrototype::BooleanPrototype):
3234 * runtime/DateConstructor.cpp:
3235 (JSC::DateConstructor::DateConstructor):
3236 * runtime/ErrorPrototype.cpp:
3237 (JSC::ErrorPrototype::ErrorPrototype):
3238 * runtime/FunctionPrototype.cpp:
3239 (JSC::FunctionPrototype::addFunctionProperties):
3240 (JSC::functionProtoFuncToString):
3241 * runtime/FunctionPrototype.h:
3242 * runtime/JSFunction.cpp:
3243 (JSC::JSFunction::JSFunction):
3244 (JSC::JSFunction::~JSFunction):
3245 (JSC::JSFunction::mark):
3246 (JSC::JSFunction::getCallData):
3247 (JSC::JSFunction::call):
3248 (JSC::JSFunction::argumentsGetter):
3249 (JSC::JSFunction::callerGetter):
3250 (JSC::JSFunction::lengthGetter):
3251 (JSC::JSFunction::getOwnPropertySlot):
3252 (JSC::JSFunction::put):
3253 (JSC::JSFunction::deleteProperty):
3254 (JSC::JSFunction::getConstructData):
3255 (JSC::JSFunction::construct):
3256 * runtime/JSFunction.h:
3257 (JSC::JSFunction::JSFunction):
3258 (JSC::JSFunction::setScope):
3259 (JSC::JSFunction::scope):
3260 (JSC::JSFunction::isHostFunction):
3261 (JSC::JSFunction::scopeChain):
3262 (JSC::JSFunction::clearScopeChain):
3263 (JSC::JSFunction::setScopeChain):
3264 (JSC::JSFunction::nativeFunction):
3265 (JSC::JSFunction::setNativeFunction):
3266 * runtime/JSGlobalData.cpp:
3267 (JSC::JSGlobalData::~JSGlobalData):
3268 (JSC::JSGlobalData::createNativeThunk):
3269 * runtime/JSGlobalData.h:
3270 (JSC::JSGlobalData::nativeFunctionThunk):
3271 * runtime/JSGlobalObject.cpp:
3272 (JSC::JSGlobalObject::reset):
3273 * runtime/JSGlobalObject.h:
3274 * runtime/Lookup.cpp:
3275 (JSC::setUpStaticFunctionSlot):
3277 * runtime/NumberPrototype.cpp:
3278 (JSC::NumberPrototype::NumberPrototype):
3279 * runtime/ObjectPrototype.cpp:
3280 (JSC::ObjectPrototype::ObjectPrototype):
3281 * runtime/RegExpPrototype.cpp:
3282 (JSC::RegExpPrototype::RegExpPrototype):
3283 * runtime/StringConstructor.cpp:
3284 (JSC::StringConstructor::StringConstructor):
3286 2009-05-05 Gavin Barraclough <barraclough@apple.com>
3288 Reviewed by Oliver Hunt.
3290 For convenience, let the sampling flags tool clear multiple flags at once.
3293 (GlobalObject::GlobalObject):
3294 (functionSetSamplingFlags):
3295 (functionClearSamplingFlags):
3297 2009-05-04 Maciej Stachowiak <mjs@apple.com>
3299 Rubber stamped by Gavin.
3301 - inline Vector::resize for a ~1.5% speedup on string-tagcloud
3304 (WTF::Vector::resize): Inline
3306 2009-05-03 Steve Falkenburg <sfalken@apple.com>
3310 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
3312 2009-05-03 Mark Rowe <mrowe@apple.com>
3314 Fix the 64-bit build.
3319 * runtime/JSNumberCell.cpp:
3320 (JSC::jsAPIMangledNumber):
3321 * runtime/JSNumberCell.h:
3323 2009-05-02 Sam Weinig <sam@webkit.org>
3325 Roll JSC API number marshaling back in one last time (I hope).
3327 2009-05-03 Sam Weinig <sam@webkit.org>
3329 Roll JSC API number marshaling back out. It still breaks windows.
3331 2009-05-03 Sam Weinig <sam@webkit.org>
3333 Roll JSC API number marshaling back in.
3335 2009-05-02 Darin Adler <darin@apple.com>
3337 Reviewed by Maciej Stachowiak.
3339 Bug 25519: streamline lexer by handling BOMs differently
3340 https://bugs.webkit.org/show_bug.cgi?id=25519
3342 Roughly 1% faster SunSpider.
3344 * parser/Grammar.y: Tweak formatting a bit.
3347 (JSC::Lexer::Lexer): Remove unnnecessary initialization of data members
3348 that are set up by setCode.
3349 (JSC::Lexer::currentOffset): Added. Used where the old code would look at
3351 (JSC::Lexer::shift1): Replaces the old shift function. No longer does anything
3352 to handle BOM characters.
3353 (JSC::Lexer::shift2): Ditto.
3354 (JSC::Lexer::shift3): Ditto.
3355 (JSC::Lexer::shift4): Ditto.
3356 (JSC::Lexer::setCode): Updated for name change from yylineno to m_line.
3357 Removed now-unused m_eatNextIdentifier, m_stackToken, and m_restrKeyword.
3358 Replaced m_skipLF and m_skipCR with m_skipLineEnd. Replaced the old
3359 m_length with m_codeEnd and m_currentOffset with m_codeStart. Added code
3360 to scan for a BOM character and call copyCodeWithoutBOMs() if we find any.
3361 (JSC::Lexer::copyCodeWithoutBOMs): Added.
3362 (JSC::Lexer::nextLine): Updated for name change from yylineno to m_line.
3363 (JSC::Lexer::makeIdentifier): Moved up higher in the file.
3364 (JSC::Lexer::matchPunctuator): Moved up higher in the file and changed to
3365 use a switch statement instead of just if statements.
3366 (JSC::Lexer::isLineTerminator): Moved up higher in the file and changed to
3367 have fewer branches.
3368 (JSC::Lexer::lastTokenWasRestrKeyword): Added. This replaces the old
3369 m_restrKeyword boolean.
3370 (JSC::Lexer::isIdentStart): Moved up higher in the file. Changed to use
3371 fewer branches in the ASCII but not identifier case.
3372 (JSC::Lexer::isIdentPart): Ditto.
3373 (JSC::Lexer::singleEscape): Moved up higher in the file.
3374 (JSC::Lexer::convertOctal): Moved up higher in the file.
3375 (JSC::Lexer::convertHex): Moved up higher in the file. Changed to use
3376 toASCIIHexValue instead of rolling our own here.
3377 (JSC::Lexer::convertUnicode): Ditto.
3378 (JSC::Lexer::record8): Moved up higher in the file.
3379 (JSC::Lexer::record16): Moved up higher in the file.
3380 (JSC::Lexer::lex): Changed type of stringType to int. Replaced m_skipLF
3381 and m_skipCR with m_skipLineEnd, which requires fewer branches in the
3382 main lexer loop. Use currentOffset instead of m_currentOffset. Removed
3383 unneeded m_stackToken. Use isASCIIDigit instead of isDecimalDigit.
3384 Split out the two cases for InIdentifierOrKeyword and InIdentifier.
3385 Added special case tight loops for identifiers and other simple states.
3386 Removed a branch from the code that sets m_atLineStart to false using goto.
3387 Streamlined the number-handling code so we don't check for the same types
3388 twice for non-numeric cases and don't add a null to m_buffer8 when it's
3389 not being used. Removed m_eatNextIdentifier, which wasn't working anyway,
3390 and m_restrKeyword, which is redundant with m_lastToken. Set the
3391 m_delimited flag without using a branch.
3392 (JSC::Lexer::scanRegExp): Tweaked style a bit.
3393 (JSC::Lexer::clear): Clear m_codeWithoutBOMs so we don't use memory after
3394 parsing. Clear out UString objects in the more conventional way.
3395 (JSC::Lexer::sourceCode): Made this no-longer inline since it has more
3396 work to do in the case where we stripped BOMs.
3398 * parser/Lexer.h: Renamed yylineno to m_lineNumber. Removed convertHex
3399 function, which is the same as toASCIIHexValue. Removed isHexDigit
3400 function, which is the same as isASCIIHedDigit. Replaced shift with four
3401 separate shift functions. Removed isWhiteSpace function that passes
3402 m_current, instead just passing m_current explicitly. Removed isOctalDigit,
3403 which is the same as isASCIIOctalDigit. Eliminated unused arguments from
3404 matchPunctuator. Added copyCoodeWithoutBOMs and currentOffset. Moved the
3405 makeIdentifier function out of the header. Added lastTokenWasRestrKeyword
3406 function. Added new constants for m_skipLineEnd. Removed unused yycolumn,
3407 m_restrKeyword, m_skipLF, m_skipCR, m_eatNextIdentifier, m_stackToken,
3408 m_position, m_length, m_currentOffset, m_nextOffset1, m_nextOffset2,
3409 m_nextOffset3. Added m_skipLineEnd, m_codeStart, m_codeEnd, and
3412 * parser/SourceProvider.h: Added hasBOMs function. In the future this can
3413 be used to tell the lexer about strings known not to have BOMs.
3415 * runtime/JSGlobalObjectFunctions.cpp:
3416 (JSC::globalFuncUnescape): Changed to use isASCIIHexDigit.
3418 * wtf/ASCIICType.h: Added using statements to match the design of the
3421 2009-05-02 Ada Chan <adachan@apple.com>
3423 Fix windows build (when doing a clean build)
3425 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3427 2009-05-02 Geoffrey Garen <ggaren@apple.com>
3429 Reviewed by Sam Weinig.
3431 Simplified null-ish JSValues.
3433 Replaced calls to noValue() with calls to JSValue() (which is what
3434 noValue() returned). Removed noValue().
3436 Replaced almost all uses of jsImpossibleValue() with uses of JSValue().
3437 Its one remaining use is for construction of hash table deleted values.
3438 For that specific task, I made a new, private constructor with a special
3439 tag. Removed jsImpossibleValue().
3441 Removed "JSValue()" initialiazers, since default construction happens...
3444 * API/JSCallbackObjectFunctions.h:
3446 * bytecompiler/BytecodeGenerator.cpp:
3447 (JSC::BytecodeGenerator::emitLoad):
3448 * bytecompiler/BytecodeGenerator.h:
3449 * debugger/DebuggerCallFrame.cpp:
3450 (JSC::DebuggerCallFrame::evaluate):
3451 * debugger/DebuggerCallFrame.h:
3452 (JSC::DebuggerCallFrame::DebuggerCallFrame):
3453 * interpreter/CallFrame.h:
3454 (JSC::ExecState::clearException):
3455 * interpreter/Interpreter.cpp:
3456 (JSC::Interpreter::privateExecute):
3457 (JSC::Interpreter::retrieveLastCaller):
3458 * interpreter/Register.h:
3459 (JSC::Register::Register):
3461 (JSC::JIT::unlinkCall):
3462 (JSC::JIT::compileOpCallInitializeCallFrame):
3463 (JSC::JIT::compileOpCall):
3465 (JSC::JITStubs::cti_op_call_eval):
3466 (JSC::JITStubs::cti_vm_throw):
3467 * profiler/Profiler.cpp:
3468 (JSC::Profiler::willExecute):
3469 (JSC::Profiler::didExecute):
3470 * runtime/ArrayPrototype.cpp:
3472 * runtime/Completion.cpp:
3474 * runtime/Completion.h:
3475 (JSC::Completion::Completion):
3476 * runtime/GetterSetter.cpp:
3477 (JSC::GetterSetter::getPrimitiveNumber):
3478 * runtime/JSArray.cpp:
3479 (JSC::JSArray::putSlowCase):
3480 (JSC::JSArray::deleteProperty):
3481 (JSC::JSArray::increaseVectorLength):
3482 (JSC::JSArray::setLength):
3483 (JSC::JSArray::pop):
3484 (JSC::JSArray::sort):
3485 (JSC::JSArray::compactForSorting):
3486 * runtime/JSCell.cpp:
3487 (JSC::JSCell::getJSNumber):
3489 (JSC::JSValue::getJSNumber):
3490 * runtime/JSGlobalData.cpp:
3491 (JSC::JSGlobalData::JSGlobalData):
3492 * runtime/JSImmediate.h:
3493 (JSC::JSImmediate::fromNumberOutsideIntegerRange):
3494 (JSC::JSImmediate::from):
3495 * runtime/JSNumberCell.cpp:
3496 (JSC::jsNumberCell):
3497 * runtime/JSObject.cpp:
3498 (JSC::callDefaultValueFunction):
3499 * runtime/JSObject.h:
3500 (JSC::JSObject::getDirect):
3501 * runtime/JSPropertyNameIterator.cpp:
3502 (JSC::JSPropertyNameIterator::toPrimitive):
3503 * runtime/JSPropertyNameIterator.h:
3504 (JSC::JSPropertyNameIterator::next):
3505 * runtime/JSValue.h:
3507 (JSC::JSValueHashTraits::constructDeletedValue):
3508 (JSC::JSValueHashTraits::isDeletedValue):
3509 (JSC::JSValue::JSValue):
3510 * runtime/JSWrapperObject.h:
3511 (JSC::JSWrapperObject::JSWrapperObject):
3512 * runtime/Operations.h:
3514 * runtime/PropertySlot.h:
3515 (JSC::PropertySlot::clearBase):
3516 (JSC::PropertySlot::clearValue):
3518 2009-05-02 Maciej Stachowiak <mjs@apple.com>
3520 Reviewed by Cameron Zwarich.
3522 - speed up the lexer in various ways
3524 ~2% command-line SunSpider speedup
3527 (JSC::Lexer::setCode): Moved below shift() so it can inline.
3528 (JSC::Lexer::scanRegExp): Use resize(0) instead of clear() on Vectors, since the intent
3529 here is not to free the underlying buffer.
3530 (JSC::Lexer::lex): ditto; also, change the loop logic a bit for the main lexing loop
3531 to avoid branching on !m_done twice per iteration. Now we only check it once.
3532 (JSC::Lexer::shift): Make this ALWAYS_INLINE and tag an unusual branch as UNLIKELY
3534 (JSC::Lexer::makeIdentifier): force to be ALWAYS_INLINE
3536 (WTF::::append): force to be ALWAYS_INLINE (may have helped in ways other than parsing but it wasn't
3537 getting inlined in a hot code path in the lexer)
3539 2009-05-01 Steve Falkenburg <sfalken@apple.com>
3543 * JavaScriptCore.vcproj/JavaScriptCore.make:
3545 2009-05-01 Sam Weinig <sam@webkit.org>
3549 * runtime/JSNumberCell.h:
3550 (JSC::JSValue::JSValue):
3551 * runtime/JSValue.h:
3554 2009-05-01 Sam Weinig <sam@webkit.org>
3556 Roll out JavaScriptCore API number marshaling.
3563 (JSCheckScriptSyntax):
3564 * API/JSCallbackConstructor.cpp:
3565 (JSC::constructJSCallback):
3566 * API/JSCallbackFunction.cpp:
3567 (JSC::JSCallbackFunction::call):
3568 * API/JSCallbackObjectFunctions.h:
3569 (JSC::::getOwnPropertySlot):
3571 (JSC::::deleteProperty):
3573 (JSC::::hasInstance):
3577 (JSC::::staticValueGetter):
3578 (JSC::::callbackGetter):
3579 * API/JSObjectRef.cpp:
3580 (JSObjectMakeFunction):
3581 (JSObjectMakeArray):