1 2009-05-18 Maciej Stachowiak <mjs@apple.com>
3 Reviewed by Gavin Barraclough.
5 - for polymorphic prototype lookups, increase the number of slots from 4 to 8
7 ~4% faster on v8 raytrace benchmark
9 * bytecode/Instruction.h:
11 2009-05-18 Maciej Stachowiak <mjs@apple.com>
13 Reviewed by Oliver Hunt.
15 - tighten up the code for the load_varargs stub
20 (JSC::JITStubs::cti_op_load_varargs): Hoist some loop invariants that
21 the compiler didn't feel like hoisting for us. Remove unneeded exception check.
23 2009-05-18 Maciej Stachowiak <mjs@apple.com>
25 Reviewed by Geoff Garen.
27 - Improve code generation for access to prototype properties
29 ~0.4% speedup on SunSpider.
31 Based on a suggestion from Geoff Garen.
34 * jit/JITPropertyAccess.cpp:
35 (JSC::JIT::compileGetDirectOffset):
36 (JSC::JIT::privateCompileGetByIdProto):
37 (JSC::JIT::privateCompileGetByIdProtoList):
38 (JSC::JIT::privateCompileGetByIdChainList):
39 (JSC::JIT::privateCompileGetByIdChain):
41 2009-05-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
43 Reviewed by Gavin Barraclough.
45 Enable YARR, and disable WREC for GTK+.
50 2009-05-18 Jan Michael Alonzo <jmalonzo@webkit.org>
52 Reviewed by Xan Lopez.
54 [Gtk] Various autotools build refactoring and fixes
55 https://bugs.webkit.org/show_bug.cgi?id=25286
57 Add -no-install and -no-fast-install to programs and tests that we
58 don't install. Also remove -O2 since this is already handled at
63 2009-05-17 Jan Michael Alonzo <jmalonzo@webkit.org>
65 Reviewed by Xan Lopez.
67 [Gtk] Various autotools build refactoring and fixes
68 https://bugs.webkit.org/show_bug.cgi?id=25286
70 Add JavaScriptCore/ to JSC include path only since it's not
71 required when building WebCore.
75 2009-05-17 Steve Falkenburg <sfalken@apple.com>
79 * JavaScriptCore.vcproj/JavaScriptCore.make:
80 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
82 2009-05-15 Gavin Barraclough <barraclough@apple.com>
84 Reviewed by Oliver Hunt.
86 Looking like MSVC doesn't like static variables in inline methods?
87 Make the state of the SSE2 check a static variable on the class
88 MacroAssemblerX86Common as a speculative build fix for Windows.
90 * assembler/MacroAssemblerX86Common.h:
91 (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
92 (JSC::MacroAssemblerX86Common::branchDouble):
93 (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
94 (JSC::MacroAssemblerX86Common::isSSE2Present):
95 (JSC::MacroAssemblerX86Common::):
98 2009-05-15 Adam Roben <aroben@apple.com>
100 Add some assembler headers to JavaScriptCore.vcproj
102 This is just a convenience for Windows developers.
104 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
106 2009-05-15 Gavin Barraclough <barraclough@apple.com>
108 Reviewed by Oliver Hunt.
110 Add FP support to the MacroAssembler, port JITArithmetic over to make use of this. Also add
111 API to determine whether FP support is available 'MacroAssembler::supportsFloatingPoint()',
112 FP is presently only supported on SSE2 platforms, not x87. On platforms where a suitable
113 hardware FPU is not available 'supportsFloatingPoint()' may simply return false, and all
114 other methods ASSERT_NOT_REACHED().
116 * assembler/AbstractMacroAssembler.h:
117 * assembler/MacroAssemblerX86.h:
118 (JSC::MacroAssemblerX86::MacroAssemblerX86):
119 (JSC::MacroAssemblerX86::branch32):
120 (JSC::MacroAssemblerX86::branchPtrWithPatch):
121 (JSC::MacroAssemblerX86::supportsFloatingPoint):
122 * assembler/MacroAssemblerX86Common.h:
123 (JSC::MacroAssemblerX86Common::):
124 (JSC::MacroAssemblerX86Common::loadDouble):
125 (JSC::MacroAssemblerX86Common::storeDouble):
126 (JSC::MacroAssemblerX86Common::addDouble):
127 (JSC::MacroAssemblerX86Common::subDouble):
128 (JSC::MacroAssemblerX86Common::mulDouble):
129 (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
130 (JSC::MacroAssemblerX86Common::branchDouble):
131 (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
132 (JSC::MacroAssemblerX86Common::branch32):
133 (JSC::MacroAssemblerX86Common::branch16):
134 (JSC::MacroAssemblerX86Common::branchTest32):
135 (JSC::MacroAssemblerX86Common::branchAdd32):
136 (JSC::MacroAssemblerX86Common::branchMul32):
137 (JSC::MacroAssemblerX86Common::branchSub32):
138 (JSC::MacroAssemblerX86Common::set32):
139 (JSC::MacroAssemblerX86Common::setTest32):
140 (JSC::MacroAssemblerX86Common::x86Condition):
141 (JSC::MacroAssemblerX86Common::isSSE2Present):
142 * assembler/MacroAssemblerX86_64.h:
143 (JSC::MacroAssemblerX86_64::movePtrToDouble):
144 (JSC::MacroAssemblerX86_64::moveDoubleToPtr):
145 (JSC::MacroAssemblerX86_64::setPtr):
146 (JSC::MacroAssemblerX86_64::branchPtr):
147 (JSC::MacroAssemblerX86_64::branchTestPtr):
148 (JSC::MacroAssemblerX86_64::branchAddPtr):
149 (JSC::MacroAssemblerX86_64::branchSubPtr):
150 (JSC::MacroAssemblerX86_64::supportsFloatingPoint):
151 * assembler/X86Assembler.h:
155 * jit/JITArithmetic.cpp:
156 (JSC::JIT::emit_op_rshift):
157 (JSC::JIT::emitSlow_op_rshift):
158 (JSC::JIT::emitSlow_op_jnless):
159 (JSC::JIT::emitSlow_op_jnlesseq):
160 (JSC::JIT::compileBinaryArithOp):
161 (JSC::JIT::compileBinaryArithOpSlowCase):
162 (JSC::JIT::emit_op_add):
163 (JSC::JIT::emitSlow_op_add):
164 (JSC::JIT::emit_op_mul):
165 (JSC::JIT::emitSlow_op_mul):
166 * jit/JITPropertyAccess.cpp:
167 (JSC::JIT::privateCompilePutByIdTransition):
169 2009-05-15 Francisco Tolmasky <francisco@280north.com>
171 BUG 25467: JavaScript debugger should use function.displayName as the function's name in the call stack
172 <https://bugs.webkit.org/show_bug.cgi?id=25467>
174 Reviewed by Adam Roben.
176 * JavaScriptCore.exp: Added calculatedFunctionName
177 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Added calculatedFunctionName
178 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added calculatedFunctionName
179 * debugger/DebuggerCallFrame.cpp: Added calculatedFunctionName to match existing one in ProfileNode.
180 (JSC::DebuggerCallFrame::calculatedFunctionName):
181 * debugger/DebuggerCallFrame.h: Added calculatedFunctionName to match existing one in ProfileNode.
183 2009-05-14 Gavin Barraclough <barraclough@apple.com>
185 Build fix, not reviewed.
187 Quick fixes for JIT builds with OPTIMIZE flags disabled.
190 (JSC::JIT::compileOpCall):
191 (JSC::JIT::compileOpCallSlowCase):
192 * jit/JITPropertyAccess.cpp:
193 (JSC::JIT::compilePutByIdHotPath):
195 2009-05-14 Steve Falkenburg <sfalken@apple.com>
197 Back out incorrect Windows build fix
199 * JavaScriptCore.vcproj/JavaScriptCore.make:
200 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
202 2009-05-14 Steve Falkenburg <sfalken@apple.com>
206 * JavaScriptCore.vcproj/JavaScriptCore.make:
207 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
209 2009-05-14 Adam Roben <aroben@apple.com>
211 Windows jsc build fix
213 r43648 modified jsc.vcproj's post-build event not to try to copy files
214 that aren't present. Then r43661 mistakenly un-did that modification.
215 This patch restores the modification from r43648, but puts the code in
216 jscCommon.vsprops (where it should have been added in r43648).
218 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Restored empty
219 VCPostBuildEventTool tags.
220 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Modified the post-build
221 event command line to match the one in jsc.vcproj from r43648.
223 2009-05-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
225 Reviewed by Darin Adler.
227 https://bugs.webkit.org/show_bug.cgi?id=25325
229 Make sure pthread_self() is declared before it gets called in Collector.cpp
231 * runtime/Collector.cpp: Include pthread.h in most Unix-like platforms
232 (not just for OPENBSD)
234 2009-05-14 Mark Rowe <mrowe@apple.com>
236 Reviewed by Oliver Hunt.
238 Fix <https://bugs.webkit.org/show_bug.cgi?id=25785>.
239 Bug 25785: Segfault in mark when using JSObjectMakeConstructor
241 * API/JSObjectRef.cpp:
242 (JSObjectMakeConstructor): OpaqueJSClass::prototype can return 0. We need to use the default object prototype when it does.
243 * API/tests/testapi.c:
244 (main): Add a test case.
245 * runtime/JSObject.h:
246 (JSC::JSObject::putDirect): Add a clearer assertion for a null value. The assertion on the next line does catch this,
247 but the cause of the failure is not clear from the assertion itself.
249 2009-05-14 Mark Rowe <mrowe@apple.com>
251 Rubber-stamped by Darin Adler.
253 <rdar://problem/6681868> When building with Xcode 3.1.3 should be using gcc 4.2
255 The meaning of XCODE_VERSION_ACTUAL is more sensible in newer versions of Xcode.
256 Update our logic to select the compiler version to use the more appropriate XCODE_VERSION_MINOR
257 if the version of Xcode supports it, and fall back to XCODE_VERSION_ACTUAL if not.
259 * Configurations/Base.xcconfig:
261 2009-05-14 Gavin Barraclough <barraclough@apple.com>
263 Reviewed by Geoff Garen.
265 Checking register file bounds should be a ptr comparison (m_end is a Register*).
266 Also, the compare should be unsigned, pointers don'ts go negative.
269 (JSC::JIT::privateCompile):
271 2009-05-13 Gavin Barraclough <barraclough@apple.com>
273 Reviewed by Oliver Hunt.
275 Fix <rdar://problem/6882919> REGRESSION: page at Metroauto site crashes in cti_op_loop_if_less (25730)
277 op_loop_if_less (imm < op) was loading op into regT1, but in the slow path spills regT0.
278 This leads to bad happen.
280 * jit/JITOpcodes.cpp:
281 (JSC::JIT::emit_op_loop_if_less):
282 (JSC::JIT::emitSlow_op_loop_if_less):
284 2009-05-13 Dmitry Titov <dimich@chromium.org>
286 Rubber-stamped by Mark Rowe.
288 https://bugs.webkit.org/show_bug.cgi?id=25746
289 Revert http://trac.webkit.org/changeset/43507 which caused crash in PPC nightlies with Safari 4.
291 * JavaScriptCore.exp:
292 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
293 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
294 * bytecode/SamplingTool.cpp:
295 (JSC::SamplingThread::start):
296 (JSC::SamplingThread::stop):
297 * bytecode/SamplingTool.h:
298 * wtf/CrossThreadRefCounted.h:
299 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
303 * wtf/ThreadingNone.cpp:
304 * wtf/ThreadingPthreads.cpp:
305 (WTF::threadMapMutex):
306 (WTF::initializeThreading):
308 (WTF::identifierByPthreadHandle):
309 (WTF::establishIdentifierForPthreadHandle):
310 (WTF::pthreadHandleForIdentifier):
311 (WTF::clearPthreadHandleForIdentifier):
312 (WTF::createThreadInternal):
313 (WTF::waitForThreadCompletion):
315 (WTF::currentThread):
316 * wtf/ThreadingWin.cpp:
317 (WTF::threadMapMutex):
318 (WTF::initializeThreading):
320 (WTF::storeThreadHandleByIdentifier):
321 (WTF::threadHandleForIdentifier):
322 (WTF::clearThreadHandleForIdentifier):
323 (WTF::createThreadInternal):
324 (WTF::waitForThreadCompletion):
326 (WTF::currentThread):
327 * wtf/gtk/ThreadingGtk.cpp:
328 (WTF::threadMapMutex):
329 (WTF::initializeThreading):
331 (WTF::identifierByGthreadHandle):
332 (WTF::establishIdentifierForThread):
333 (WTF::threadForIdentifier):
334 (WTF::clearThreadForIdentifier):
335 (WTF::createThreadInternal):
336 (WTF::waitForThreadCompletion):
337 (WTF::currentThread):
338 * wtf/qt/ThreadingQt.cpp:
339 (WTF::threadMapMutex):
341 (WTF::identifierByQthreadHandle):
342 (WTF::establishIdentifierForThread):
343 (WTF::clearThreadForIdentifier):
344 (WTF::threadForIdentifier):
345 (WTF::initializeThreading):
346 (WTF::createThreadInternal):
347 (WTF::waitForThreadCompletion):
348 (WTF::currentThread):
350 2009-05-13 Darin Adler <darin@apple.com>
352 Revert the parser arena change. It was a slowdown, not a speedup.
353 Better luck next time (I'll break it up into pieces).
355 2009-05-13 Darin Adler <darin@apple.com>
359 * parser/Grammar.y: Add back empty code blocks, needed by older
360 versions of bison on certain rules.
362 2009-05-13 Steve Falkenburg <sfalken@apple.com>
366 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
368 2009-05-13 Adam Roben <aroben@apple.com>
370 Windows build fixes after r43642
372 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
373 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
376 * debugger/Debugger.cpp:
377 * runtime/ArrayConstructor.cpp:
378 * runtime/JSArray.cpp:
379 * runtime/RegExp.cpp:
380 * runtime/RegExpConstructor.cpp:
381 * runtime/RegExpPrototype.cpp:
382 * runtime/StringPrototype.cpp:
383 Added missing #includes.
385 2009-05-13 Darin Adler <darin@apple.com>
387 Reviewed by Cameron Zwarich.
389 Bug 25674: syntax tree nodes should use arena allocation
390 https://bugs.webkit.org/show_bug.cgi?id=25674
392 Step 3: Add some actual arena allocation. About 1% SunSpider speedup.
394 * JavaScriptCore.exp: Updated.
396 * bytecompiler/BytecodeGenerator.cpp:
397 (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
398 contains const Identifier* now.
399 (JSC::BytecodeGenerator::emitPushNewScope): Updated to take a const
401 * bytecompiler/BytecodeGenerator.h: Ditto
403 * bytecompiler/SegmentedVector.h: Added isEmpty.
405 * debugger/Debugger.cpp:
406 (JSC::Debugger::recompileAllJSFunctions): Moved this function here from
407 WebCore so WebCore doesn't need the details of FunctionBodyNode.
408 * debugger/Debugger.h: Ditto.
410 * interpreter/Interpreter.cpp:
411 (JSC::Interpreter::execute): Updated since VarStack contains const
415 (JSC::JITStubs::cti_vm_lazyLinkCall): Call isHostFunction on the body
416 rather than on the function object, since we can't easily have inlined
417 access to the FunctionBodyNode in JSFunction.h since WebCore needs
418 access to that header.
419 (JSC::JITStubs::cti_op_construct_JSConstruct): Ditto.
420 * profiler/Profiler.cpp:
421 (JSC::Profiler::createCallIdentifier): Ditto.
423 * parser/Grammar.y: Use JSGlobalData* to pass the global data pointer
424 around whenever possible instead of using void*. Changed
425 SET_EXCEPTION_LOCATION from a macro to an inline function. Marked
426 the structure-creating functions inline. Changed the VarStack to use
427 identifier pointers instead of actual identifiers. This takes
428 advantage of the fact that all identifier pointers come from the
429 arena and avoids reference count churn. Changed Identifier* to
430 const Identifier* to make sure we don't modify any by accident.
431 Used identifiers for regular expression strings too, using the new
432 scanRegExp that has out parameters instead of the old one that relied
433 on side effects in the Lexer. Move the creation of numeric identifiers
434 out of this file and into the PropertyNode constructor.
437 (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
438 (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
439 and changed to call ParserArena.
440 (JSC::Lexer::scanRegExp): Added out arguments that are const Identifier*
441 as well as a prefix character argument so we can handle the /= case
442 without a string append.
443 (JSC::Lexer::skipRegExp): Added. Skips a regular expression without
444 allocating Identifier objects.
445 (JSC::Lexer::clear): Removed the code to manage m_identifiers, m_pattern,
446 and m_flags, and added code to set m_arena to 0.
447 * parser/Lexer.h: Updated for changes above.
449 * parser/NodeConstructors.h:
450 (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
452 (JSC::ParserArenaDeletable::operator new): Changed to call the
453 allocateDeletable function on the arena instead of deleteWithArena.
454 (JSC::RegExpNode::RegExpNode): Changed arguments to Identifier instead
455 of UString since these come from the parser which makes identifiers.
456 (JSC::PropertyNode::PropertyNode): Added new constructor that makes
457 numeric identifiers. Some day we might want to optimize this for
458 integers so it doesn't create a string for each one.
459 (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
460 since it's now a const Identifier& so it can't be left uninitialized.
461 (JSC::BreakNode::BreakNode): Ditto.
462 (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
463 to keep track of the statements rather than a separate statement vector.
464 (JSC::BlockNode::BlockNode): Ditto.
465 (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
467 * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
468 It seemed strangely out of place in the header.
469 (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
470 UString as well as Identifier.
471 (JSC::SourceElements::singleStatement): Added.
472 (JSC::SourceElements::lastStatement): Added.
473 (JSC::RegExpNode::emitBytecode): Updated since the pattern and flags
474 are now Identifier instead of UString. Also changed the throwError code
475 to use the substitution mechanism instead of doing a string append.
476 (JSC::SourceElements::emitBytecode): Added. Replaces the old
477 statementListEmitCode function, since we now keep the SourceElements
479 (JSC::BlockNode::lastStatement): Added.
480 (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
481 statementListEmitCode.
482 (JSC::CaseClauseNode::emitBytecode): Added.
483 (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
484 instead of statementListEmitCode.
485 (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
486 SourceElements* instead of using releaseContentsIntoVector.
487 (JSC::ScopeNode::emitStatementsBytecode): Added.
488 (JSC::ScopeNode::singleStatement): Added.
489 (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
490 of statementListEmitCode.
491 (JSC::EvalNode::emitBytecode): Ditto.
492 (JSC::EvalNode::generateBytecode): Removed code to clear the children
493 vector. This optimization is no longer possible since everything is in
495 (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
496 insetad of statementListEmitCode and check for the return node using
499 * parser/Nodes.h: Changed VarStack to store const Identifier* instead
500 of Identifier and rely on the arena to control lifetime. Added a new
501 ParserArenaFreeable class. Made ParserArenaDeletable inherit from
502 FastAllocBase instead of having its own operator new. Base the Node
503 class on ParserArenaFreeable. Changed the various Node classes
504 to use const Identifier& instead of Identifier to avoid the need to
505 call their destructors and allow them to function as "freeable" in the
506 arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
507 Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
508 CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
509 as a base class since they do not descend from Node. Eliminated the
510 StatementVector type and instead have various classes use SourceElements*
511 instead of StatementVector. This prevents those classes from having th
512 use ParserArenaDeletable to make sure the vector destructor is called.
515 (JSC::Parser::parse): Pass the arena to the lexer.
517 * parser/Parser.h: Added an include of ParserArena.h, which is no longer
520 * parser/ParserArena.cpp:
521 (JSC::ParserArena::ParserArena): Added. Initializes the new members,
522 m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
523 (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
524 since we store only the current pointer and the end of pool pointer.
525 (JSC::ParserArena::deallocateObjects): Added. Contains the common
526 memory-deallocation logic used by both the destructor and the
528 (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
529 (JSC::ParserArena::reset): Ditto. Also added code to zero out the
530 new structures, and switched to use clear() instead of shrink(0) since
531 we don't really reuse arenas.
532 (JSC::ParserArena::makeNumericIdentifier): Added.
533 (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
535 (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
536 since this is used only for assertions at the moment.
538 * parser/ParserArena.h: Added an actual arena of "freeable" objects,
539 ones that don't need destructors to be called. Also added the segmented
540 vector of identifiers that used to be in the Lexer.
542 * runtime/FunctionConstructor.cpp:
543 (JSC::extractFunctionBody): Use singleStatement function rather than
544 getting at a StatementVector.
546 * runtime/FunctionPrototype.cpp:
547 (JSC::functionProtoFuncToString): Call isHostFunction on the body
548 rather than the function object.
550 * runtime/JSFunction.cpp:
551 (JSC::JSFunction::JSFunction): Moved the structure version of this in
552 here from the header. It's not hot enough that it needs to be inlined.
553 (JSC::JSFunction::isHostFunction): Moved this in here from the header.
554 It's now a helper to be used only within the class.
555 (JSC::JSFunction::setBody): Moved this in here. It's not hot enough that
556 it needs to be inlined, and we want to be able to compile the header
557 without the definition of FunctionBodyNode.
559 * runtime/JSFunction.h: Eliminated the include of "Nodes.h". This was
560 exposing too much JavaScriptCore dependency to WebCore. Because of this
561 change and some changes made to WebCore, we could now export a lot fewer
562 headers from JavaScriptCore, but I have not done that yet in this check-in.
563 Made a couple functions non-inline. Removes some isHostFunction() assertions.
565 * wtf/FastAllocBase.h: Added the conventional using statements we use in
566 WTF so we can use identifiers from the WTF namespace without explicit
567 namespace qualification or namespace directive. This is the usual WTF style,
568 although it's unconventional in the C++ world. We use the namespace primarily
569 for link-time disambiguation, not compile-time.
571 * wtf/FastMalloc.cpp: Fixed an incorrect comment.
573 2009-05-13 Xan Lopez <xlopez@igalia.com>
575 Unreviewed build fix: add JITStubCall.h to files list.
579 2009-05-13 Ariya Hidayat <ariya.hidayat@nokia.com>
581 Unreviewed build fix, as suggested by Yael Aharon <yael.aharon@nokia.com>.
583 * wtf/qt/ThreadingQt.cpp:
584 (WTF::waitForThreadCompletion): renamed IsValid to isValid.
586 2009-05-13 Jan Michael Alonzo <jmalonzo@webkit.org>
588 Revert r43562 - [Gtk] WTF_USE_JSC is already defined in
593 2009-05-12 Gavin Barraclough <barraclough@apple.com>
595 Reviewed by Oliver Hunt.
597 Add SamplingCounter tool to provide a simple mechanism for counting events in JSC
598 (enabled using ENABLE(SAMPLING_COUNTERS)). To count events within a single function
599 use the class 'SamplingCounter', where the counter may be incremented from multiple
600 functions 'GlobalSamplingCounter' may be convenient; all other counters (stack or
601 heap allocated, rather than statically declared) should use the DeletableSamplingCounter.
602 Further description of these classes is provided alongside their definition in
605 Counters may be incremented from c++ by calling the 'count()' method on the counter,
606 or may be incremented by JIT code by using the 'emitCount()' method within the JIT.
608 This patch also fixes CODEBLOCK_SAMPLING, which was missing a null pointer check.
610 * JavaScriptCore.exp:
611 * assembler/MacroAssemblerX86.h:
612 (JSC::MacroAssemblerX86::addWithCarry32):
613 (JSC::MacroAssemblerX86::and32):
614 (JSC::MacroAssemblerX86::or32):
615 * assembler/MacroAssemblerX86Common.h:
616 (JSC::MacroAssemblerX86Common::and32):
617 (JSC::MacroAssemblerX86Common::or32):
618 * assembler/MacroAssemblerX86_64.h:
619 (JSC::MacroAssemblerX86_64::and32):
620 (JSC::MacroAssemblerX86_64::or32):
621 (JSC::MacroAssemblerX86_64::addPtr):
622 * assembler/X86Assembler.h:
623 (JSC::X86Assembler::):
624 (JSC::X86Assembler::adcl_im):
625 (JSC::X86Assembler::addq_im):
626 (JSC::X86Assembler::andl_im):
627 (JSC::X86Assembler::orl_im):
628 * bytecode/SamplingTool.cpp:
629 (JSC::AbstractSamplingCounter::dump):
630 * bytecode/SamplingTool.h:
631 (JSC::AbstractSamplingCounter::count):
632 (JSC::GlobalSamplingCounter::name):
633 (JSC::SamplingCounter::SamplingCounter):
637 * jit/JITInlineMethods.h:
638 (JSC::JIT::setSamplingFlag):
639 (JSC::JIT::clearSamplingFlag):
640 (JSC::JIT::emitCount):
644 (JSC::ScopeNode::ScopeNode):
647 2009-05-13 Steve Falkenburg <sfalken@apple.com>
651 * JavaScriptCore.vcproj/JavaScriptCore.make:
653 2009-05-12 Steve Falkenburg <sfalken@apple.com>
657 * JavaScriptCore.vcproj/JavaScriptCore.make:
659 2009-05-12 Oliver Hunt <oliver@apple.com>
661 Reviewed by Gavin Barraclough.
663 <rdar://problem/6881457> Crash occurs at JSC::Interpreter::execute() when loading http://www.sears.com
665 We created the arguments objects before an op_push_scope but not
666 before op_push_new_scope, this meant a null arguments object could
667 be resolved inside catch blocks.
669 * bytecompiler/BytecodeGenerator.cpp:
670 (JSC::BytecodeGenerator::emitPushNewScope):
672 2009-05-12 Oliver Hunt <oliver@apple.com>
674 Reviewed by Gavin Barraclough.
676 <rdar://problem/6879881> Crash occurs at JSC::JSActivation::mark() when loading http://www.monster.com; http://www.cnet.com
677 <https://bugs.webkit.org/show_bug.cgi?id=25736> Crash loading www.google.dk/ig (and other igoogle's as well)
679 Following on from the lazy arguments creation patch, it's now
680 possible for an activation to to have a null register in the callframe
681 so we can't just blindly mark the local registers in an activation,
682 and must null check first instead.
684 * API/tests/testapi.c:
686 * API/tests/testapi.js:
687 (bludgeonArguments.return.g):
689 * runtime/JSActivation.cpp:
690 (JSC::JSActivation::mark):
692 2009-05-12 Gavin Barraclough <barraclough@apple.com>
694 Rubber stamped by Geoff Garen.
696 WTF_USE_CTI_REPATCH_PIC is no longer used, remove.
701 2009-05-12 Gavin Barraclough <barraclough@apple.com>
703 Reviewed by Maciej Stachowiak.
705 We've run into some problems where changing the size of the class JIT leads to
706 performance fluctuations. Try forcing alignment in an attempt to stabalize this.
710 2009-05-12 Kevin Ollivier <kevino@theolliviers.com>
712 wx build fix. Add ParserArena.cpp to the build.
714 * JavaScriptCoreSources.bkl:
716 2009-05-12 Oliver Hunt <oliver@apple.com>
718 Reviewed by Geoff Garen.
720 Unsigned underflow on 64bit cannot be treated as a negative number
722 This code included some placeswhere we deliberately create negative offsets
723 from unsigned values, on 32bit this is "safe", but in 64bit builds much
724 badness occurs. Solution is to use signed types as nature intended.
727 (JSC::JITStubs::cti_op_load_varargs):
729 2009-05-12 Jan Michael Alonzo <jmalonzo@webkit.org>
731 Reviewed by Holger Freyther.
733 [Gtk] Various autotools build refactoring and fixes
734 https://bugs.webkit.org/show_bug.cgi?id=25286
736 Define WTF_USE_JSC for the Gtk port.
740 2009-05-12 Maciej Stachowiak <mjs@apple.com>
742 Reviewed by Oliver Hunt.
744 - allow all of strictEqual to be inlined into cti_op_stricteq once again
746 We had this optimization once but accidentally lost it at some point.
748 * runtime/Operations.h:
749 (JSC::JSValue::strictEqualSlowCaseInline):
750 (JSC::JSValue::strictEqual):
752 2009-05-12 Gavin Barraclough <barraclough@apple.com>
754 Reviewed by Oliver Hunt.
756 instanceof should throw if the constructor being tested does not implement
757 'HasInstance" (i.e. is a function). Instead we were returning false.
759 * interpreter/Interpreter.cpp:
760 (JSC::isInvalidParamForIn):
761 (JSC::isInvalidParamForInstanceOf):
762 (JSC::Interpreter::privateExecute):
764 (JSC::JITStubs::cti_op_instanceof):
765 * tests/mozilla/ecma_2/instanceof/instanceof-003.js:
766 Fix broken test case.
767 * tests/mozilla/ecma_2/instanceof/regress-7635.js:
768 Remove broken test case (was an exact duplicate of a test in instanceof-003.js).
770 2009-05-12 Oliver Hunt <oliver@apple.com>
772 Reviewed by Gavin Barraclough.
774 Improve function call forwarding performance
776 Make creation of the Arguments object occur lazily, so it
777 is not necessarily created for every function that references
778 it. Then add logic to Function.apply to allow it to avoid
779 allocating the Arguments object at all. Helps a lot with
780 the function forwarding/binding logic in jQuery, Prototype,
781 and numerous other JS libraries.
783 * bytecode/CodeBlock.cpp:
784 (JSC::CodeBlock::dump):
786 * bytecompiler/BytecodeGenerator.cpp:
787 (JSC::BytecodeGenerator::BytecodeGenerator):
788 (JSC::BytecodeGenerator::registerFor):
789 (JSC::BytecodeGenerator::willResolveToArguments):
790 (JSC::BytecodeGenerator::uncheckedRegisterForArguments):
791 (JSC::BytecodeGenerator::createArgumentsIfNecessary):
792 (JSC::BytecodeGenerator::emitCallEval):
793 (JSC::BytecodeGenerator::emitPushScope):
794 * bytecompiler/BytecodeGenerator.h:
795 * interpreter/Interpreter.cpp:
796 (JSC::Interpreter::privateExecute):
797 (JSC::Interpreter::retrieveArguments):
799 (JSC::JIT::privateCompileMainPass):
801 * jit/JITOpcodes.cpp:
802 (JSC::JIT::emit_op_create_arguments):
803 (JSC::JIT::emit_op_init_arguments):
805 (JSC::JITStubs::cti_op_tear_off_arguments):
806 (JSC::JITStubs::cti_op_load_varargs):
808 (JSC::ApplyFunctionCallDotNode::emitBytecode):
810 2009-05-11 Gavin Barraclough <barraclough@apple.com>
812 Reviewed by Oliver Hunt.
814 Enable use of SamplingFlags directly from JIT code.
816 * bytecode/SamplingTool.h:
818 (JSC::JIT::sampleCodeBlock):
819 (JSC::JIT::sampleInstruction):
820 * jit/JITInlineMethods.h:
821 (JSC::JIT::setSamplingFlag):
822 (JSC::JIT::clearSamplingFlag):
824 2009-05-11 Gavin Barraclough <barraclough@apple.com>
826 Reviewed by Cameron Zwarich.
828 Implement JIT generation for instanceof for non-objects (always returns false).
829 Also fixes the sequencing of the prototype and value isObject checks, to no match the spec.
831 0.5% progression on v8 tests overall, due to 3.5% on early-boyer.
834 (JSC::JIT::privateCompileMainPass):
835 (JSC::JIT::privateCompileSlowCases):
836 * runtime/JSObject.cpp:
837 (JSC::JSObject::hasInstance):
838 * runtime/TypeInfo.h:
839 (JSC::TypeInfo::TypeInfo):
841 2009-05-11 Geoffrey Garen <ggaren@apple.com>
843 Reviewed by Sam Weinig.
845 A little more JIT refactoring.
847 Rearranged code to more clearly indicate what's conditionally compiled
848 and why. Now, all shared code is at the top of our JIT files, and all
849 #if'd code is at the bottom. #if'd code is delineated by large comments.
851 Moved functions that relate to the JIT but don't explicitly do codegen
852 into JIT.cpp. Refactored SSE2 check to store its result as a data member
856 (JSC::isSSE2Present):
858 (JSC::JIT::unlinkCall):
859 (JSC::JIT::linkCall):
861 (JSC::JIT::isSSE2Present):
862 * jit/JITArithmetic.cpp:
863 (JSC::JIT::emit_op_mod):
864 (JSC::JIT::emitSlow_op_mod):
866 (JSC::JIT::compileOpCallVarargs):
867 (JSC::JIT::compileOpCallVarargsSlowCase):
869 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
873 * JavaScriptCore.pri: Build the new JITOpcodes.cpp
875 2009-05-11 Sam Weinig <sam@webkit.org>
877 Reviewed by Geoffrey Garen.
879 More re-factoring of JIT code generation. Use a macro to
880 forward the main switch-statement cases to the helper functions.
883 (JSC::JIT::privateCompileMainPass):
884 (JSC::JIT::privateCompileSlowCases):
886 2009-05-11 Sam Weinig <sam@webkit.org>
888 Reviewed by Geoffrey Garen.
890 More re-factoring of JIT code generation to move opcode generation
891 to helper functions outside the main switch-statement and gave those
892 helper functions standardized names. This patch covers the remaining
897 * jit/JITOpcodes.cpp:
899 2009-05-11 Geoffrey Garen <ggaren@apple.com>
903 * GNUmakefile.am: Added JITOpcodes.cpp and JITStubCall.h to the project.
905 2009-05-11 Geoffrey Garen <ggaren@apple.com>
909 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
910 JITOpcodes.cpp and JITStubCall.h to the project.
912 2009-05-11 Geoffrey Garen <ggaren@apple.com>
914 Reviewed by Sam Weinig.
916 Some JIT refactoring.
918 Moved JITStubCall* into its own header.
920 Modified JITStubCall to ASSERT that its return value is handled correctly.
921 Also, replaced function template with explicit instantiations to resolve
924 Replaced all uses of emit{Get,Put}CTIArgument with explicit peeks, pokes,
925 and calls to killLastResultRegister().
927 * JavaScriptCore.xcodeproj/project.pbxproj:
929 (JSC::JIT::privateCompileMainPass):
930 (JSC::JIT::privateCompile):
932 * jit/JITArithmetic.cpp:
934 * jit/JITInlineMethods.h:
935 (JSC::JIT::restoreArgumentReference):
936 * jit/JITPropertyAccess.cpp:
937 * jit/JITStubCall.h: Copied from jit/JIT.h.
938 (JSC::JITStubCall::JITStubCall):
939 (JSC::JITStubCall::addArgument):
940 (JSC::JITStubCall::call):
941 (JSC::JITStubCall::):
943 2009-05-11 Sam Weinig <sam@webkit.org>
945 Reviewed by Geoffrey Garen.
947 Start re-factoring JIT code generation to move opcode generation
948 to helper functions outside the main switch-statement and gave those
949 helper functions standardized names. This patch only covers the main
950 pass and all the arithmetic opcodes in the slow path.
952 * JavaScriptCore.xcodeproj/project.pbxproj:
954 (JSC::JIT::privateCompileMainPass):
955 (JSC::JIT::privateCompileSlowCases):
957 * jit/JITArithmetic.cpp:
958 * jit/JITOpcodes.cpp: Copied from jit/JIT.cpp.
959 * jit/JITPropertyAccess.cpp:
961 2009-05-11 Steve Falkenburg <sfalken@apple.com>
963 Re-add experimental PGO configs.
965 Reviewed by Adam Roben.
967 * JavaScriptCore.vcproj/JavaScriptCore.make:
968 * JavaScriptCore.vcproj/JavaScriptCore.sln:
969 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
970 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
971 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
973 2009-05-11 Sam Weinig <sam@webkit.org>
975 Reviewed by Geoffrey "1" Garen.
977 Rip out the !USE(CTI_REPATCH_PIC) code. It was untested and unused.
980 (JSC::JIT::compileGetByIdChainList):
981 (JSC::JIT::compileGetByIdChain):
982 (JSC::JIT::compileCTIMachineTrampolines):
983 * jit/JITPropertyAccess.cpp:
984 (JSC::JIT::privateCompileGetByIdProto):
985 (JSC::JIT::privateCompileGetByIdChainList):
986 (JSC::JIT::privateCompileGetByIdChain):
988 (JSC::JITStubs::tryCachePutByID):
989 (JSC::JITStubs::tryCacheGetByID):
991 2009-05-11 Dmitry Titov <dimich@chromium.org>
993 GTK build fix - the deprecated waitForThreadCompletion is not needed on GTK.
995 * wtf/ThreadingPthreads.cpp: used #ifdef PLATFORM(DARWIN) around waitForThreadCompletion().
997 2009-05-11 Adam Roben <aroben@apple.com>
999 Build fix for newer versions of GCC
1001 * wtf/ThreadingPthreads.cpp: Added a declaration of
1002 waitForThreadCompletion before its definition to silence a warning.
1004 2009-05-11 Dmitry Titov <dimich@chromium.org>
1006 Reviewed by Alexey Proskuryakov and Adam Roben.
1008 https://bugs.webkit.org/show_bug.cgi?id=25348
1009 Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
1012 (WTF::ThreadIdentifier::ThreadIdentifier):
1013 (WTF::ThreadIdentifier::isValid):
1014 (WTF::ThreadIdentifier::invalidate):
1015 (WTF::ThreadIdentifier::platformId):
1016 ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
1017 methods that are used across the code on thread ids: construction, comparisons,
1018 check for 'valid' state etc. '0' is used as invalid id, which happens to just work
1019 with all platform-specific thread id implementations.
1021 All the following files repeatedly reflect the new ThreadIdentifier for each platform.
1022 We remove ThreadMap and threadMapMutex from all of them, remove the functions that
1023 populated/searched/cleared the map and add platform-specific comparison operators
1024 for ThreadIdentifier.
1026 There are specific temporary workarounds for Safari 4 beta on OSX and Win32 since the
1027 public build uses WTF threading functions with old type of ThreadingIdentifier.
1028 The next time Safari 4 is rebuilt, it will 'automatically' pick up the new type and new
1029 functions so the deprecated ones can be removed.
1031 * wtf/gtk/ThreadingGtk.cpp:
1032 (WTF::ThreadIdentifier::operator==):
1033 (WTF::ThreadIdentifier::operator!=):
1034 (WTF::initializeThreading):
1035 (WTF::createThreadInternal):
1036 (WTF::waitForThreadCompletion):
1037 (WTF::currentThread):
1039 * wtf/ThreadingNone.cpp:
1040 (WTF::ThreadIdentifier::operator==):
1041 (WTF::ThreadIdentifier::operator!=):
1043 * wtf/ThreadingPthreads.cpp:
1044 (WTF::ThreadIdentifier::operator==):
1045 (WTF::ThreadIdentifier::operator!=):
1046 (WTF::initializeThreading):
1047 (WTF::createThreadInternal):
1048 (WTF::waitForThreadCompletion):
1049 (WTF::detachThread):
1050 (WTF::currentThread):
1051 (WTF::waitForThreadCompletion): This is a workaround for Safari 4 beta on Mac.
1052 Safari 4 is linked against old definition of ThreadIdentifier so it treats it as uint32_t.
1053 This 'old' variant of waitForThreadCompletion takes uint32_t and has the old decorated name, so Safari can
1054 load it from JavaScriptCore library. The other functions (CurrentThread() etc) happen to match their previous
1055 decorated names and, while they return pthread_t now, it is a pointer which round-trips through a uint32_t.
1056 This function will be removed as soon as Safari 4 will release next public build.
1058 * wtf/qt/ThreadingQt.cpp:
1059 (WTF::ThreadIdentifier::operator==):
1060 (WTF::ThreadIdentifier::operator!=):
1061 (WTF::initializeThreading):
1062 (WTF::createThreadInternal):
1063 (WTF::waitForThreadCompletion):
1064 (WTF::currentThread):
1066 * wtf/ThreadingWin.cpp:
1067 (WTF::ThreadIdentifier::operator==):
1068 (WTF::ThreadIdentifier::operator!=):
1069 (WTF::initializeThreading):
1070 (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
1071 counter as a thread ID and mapped it into platform ID. Windows was using native thread
1072 id and mapped it into thread handle. Since we can always obtain a thread handle
1073 by thread id, createThread now closes the handle.
1074 (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
1075 it means the thread already exited.
1076 (WTF::detachThread):
1077 (WTF::currentThread):
1078 (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
1079 (WTF::waitForThreadCompletionDeprecated): same.
1080 (WTF::currentThreadDeprecated): same.
1081 (WTF::createThreadDeprecated): same.
1083 * bytecode/SamplingTool.h:
1084 * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
1086 * JavaScriptCore.exp: export lists - updated decorated names of the WTF threading functions
1087 since they now take a different type as a parameter.
1088 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
1089 that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
1090 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
1092 2009-05-11 Darin Adler <darin@apple.com>
1094 Reviewed by Oliver Hunt.
1096 Bug 25560: REGRESSION (r34821): "string value".__proto__ gets the wrong object.
1097 https://bugs.webkit.org/show_bug.cgi?id=25560
1098 rdar://problem/6861069
1100 I missed this case back a year ago when I sped up handling
1101 of JavaScript wrappers. Easy to fix.
1103 * runtime/JSObject.h:
1104 (JSC::JSValue::get): Return the prototype itself if the property name
1106 * runtime/JSString.cpp:
1107 (JSC::JSString::getOwnPropertySlot): Ditto.
1109 2009-05-09 Oliver Hunt <oliver@apple.com>
1111 Reviewed by Maciej Stachowiak.
1113 Rename emitGetFromCallFrameHeader to emitGetFromCallFrameHeaderPtr
1116 (JSC::JIT::privateCompileMainPass):
1117 (JSC::JIT::privateCompileCTIMachineTrampolines):
1119 * jit/JITInlineMethods.h:
1120 (JSC::JIT::emitGetFromCallFrameHeaderPtr):
1121 (JSC::JIT::emitGetFromCallFrameHeader32):
1123 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
1125 Unreviewed build fix. Build ParserAreana.cpp for Qt
1127 * JavaScriptCore.pri:
1129 2009-05-11 Norbert Leser <norbert.leser@nokia.com>
1131 Reviewed by Darin Adler.
1133 https://bugs.webkit.org/show_bug.cgi?id=24536
1135 Symbian compilers cannot resolve WTF::PassRefPtr<JSC::Profile>
1136 unless Profile.h is included.
1138 * profiler/ProfileGenerator.h:
1140 2009-05-11 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
1142 Reviewed by Holger Freyther.
1144 https://bugs.webkit.org/show_bug.cgi?id=24284
1146 * JavaScriptCore.pri: coding style modified
1147 * jsc.pro: duplicated values removed from INCLUDEPATH, DEFINES
1149 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
1151 Reviewed by NOBODY (build fix).
1153 Also add ParserArena, in addition to AllInOne, for release builds,
1154 since adding it to AllInOne breaks Mac.
1158 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
1160 Unreviewed build fix. Adding ParserArena to the autotools build.
1164 2009-05-11 Adam Roben <aroben@apple.com>
1166 More Windows build fixes after r43479
1168 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1169 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1170 Export ParserArena::reset.
1172 2009-05-11 Adam Roben <aroben@apple.com>
1174 Windows build fixes after r43479
1176 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
1177 ParserArena to the project.
1179 * parser/NodeConstructors.h: Added a missing include.
1180 (JSC::ParserArenaDeletable::operator new): Marked these as inline.
1182 2009-05-10 Maciej Stachowiak <mjs@apple.com>
1184 Reviewed by Geoff Garen.
1186 - fixed REGRESSION(r43432): Many JavaScriptCore tests crash in 64-bit
1187 https://bugs.webkit.org/show_bug.cgi?id=25680
1189 Accound for the 64-bit instruction prefix when rewriting mov to lea on 64-bit.
1192 * jit/JITPropertyAccess.cpp:
1193 (JSC::JIT::patchGetByIdSelf):
1194 (JSC::JIT::patchPutByIdReplace):
1196 2009-05-10 Darin Adler <darin@apple.com>
1198 Reviewed by Cameron Zwarich.
1200 Bug 25674: syntax tree nodes should use arena allocation
1201 https://bugs.webkit.org/show_bug.cgi?id=25674
1203 Part two: Remove reference counting from most nodes.
1205 * JavaScriptCore.exp: Updated.
1207 * JavaScriptCore.xcodeproj/project.pbxproj: Added ParserArena.h and .cpp.
1209 * parser/Grammar.y: Replaced uses of ParserRefCountedData with uses of
1210 ParserArenaData. Took out now-nonfunctional code that tries to manually
1211 release declaration list. Changed the new calls that create FuncDeclNode
1212 and FuncExprNode so that they use the proper version of operator new for
1213 the reference-counted idiom, not the deletion idiom.
1215 * parser/NodeConstructors.h:
1216 (JSC::ParserArenaDeletable::operator new): Added.
1217 (JSC::ParserArenaRefCounted::ParserArenaRefCounted): Added.
1218 (JSC::Node::Node): Removed ParserRefCounted initializer.
1219 (JSC::ElementNode::ElementNode): Ditto.
1220 (JSC::PropertyNode::PropertyNode): Ditto.
1221 (JSC::ArgumentsNode::ArgumentsNode): Ditto.
1222 (JSC::SourceElements::SourceElements): Ditto.
1223 (JSC::ParameterNode::ParameterNode): Ditto.
1224 (JSC::FuncExprNode::FuncExprNode): Added ParserArenaRefCounted initializer.
1225 (JSC::FuncDeclNode::FuncDeclNode): Ditto.
1226 (JSC::CaseClauseNode::CaseClauseNode): Removed ParserRefCounted initializer.
1227 (JSC::ClauseListNode::ClauseListNode): Ditto.
1228 (JSC::CaseBlockNode::CaseBlockNode): Ditto.
1230 * parser/NodeInfo.h: Replaced uses of ParserRefCountedData with uses of
1234 (JSC::ScopeNode::ScopeNode): Added ParserArenaRefCounted initializer.
1235 (JSC::ProgramNode::create): Use the proper version of operator new for
1236 the reference-counted idiom, not the deletion idiom. Use the arena
1237 contains function instead of the vecctor find function.
1238 (JSC::EvalNode::create): Use the proper version of operator new for
1239 the reference-counted idiom, not the deletion idiom. Use the arena
1240 reset function instead of the vector shrink function.
1241 (JSC::FunctionBodyNode::createNativeThunk): Use the proper version
1242 of operator new for the reference-counted idiom, not the deletion idiom.
1243 (JSC::FunctionBodyNode::create): More of the same.
1245 * parser/Nodes.h: Added ParserArenaDeletable and ParserArenaRefCounted
1246 to replace ParserRefCounted. Fixed inheritance so only the classes that
1247 need reference counting inherit from ParserArenaRefCounted.
1249 * parser/Parser.cpp:
1250 (JSC::Parser::parse): Set m_sourceElements to 0 since it now starts
1251 uninitialized. Just set it to 0 again in the failure case, since it's
1252 now just a raw pointer, not an owning one.
1253 (JSC::Parser::reparseInPlace): Removed now-unneeded get() function.
1254 (JSC::Parser::didFinishParsing): Replaced uses of ParserRefCountedData
1255 with uses of ParserArenaData.
1257 * parser/Parser.h: Less RefPtr, more arena.
1259 * parser/ParserArena.cpp: Added.
1260 * parser/ParserArena.h: Added.
1262 * runtime/JSGlobalData.cpp:
1263 (JSC::JSGlobalData::~JSGlobalData): Removed arena-related code, since it's
1265 (JSC::JSGlobalData::createLeaked): Removed unneeded #ifndef.
1266 (JSC::JSGlobalData::createNativeThunk): Tweaked #if a bit.
1268 * runtime/JSGlobalData.h: Removed parserArena, which is now in Parser.
1270 * wtf/RefCounted.h: Added deletionHasBegun function, for use in
1271 assertions to catch deletion not done by the deref function.
1273 2009-05-10 David Kilzer <ddkilzer@apple.com>
1275 Part 2: Try to fix the Windows build by adding a symbol which is really just a re-mangling of a changed method signature
1277 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1278 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1280 2009-05-10 David Kilzer <ddkilzer@apple.com>
1282 Try to fix the Windows build by removing an unknown symbol
1284 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1285 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1287 2009-05-10 David Kilzer <ddkilzer@apple.com>
1289 Touch Nodes.cpp to try to fix Windows build
1291 * parser/Nodes.cpp: Removed whitespace.
1293 2009-05-10 Darin Adler <darin@apple.com>
1295 Reviewed by Maciej Stachowiak.
1297 Quick fix for failures seen on buildbot. Maciej plans a better fix later.
1299 * wtf/dtoa.cpp: Change the hardcoded number of 32-bit words in a BigInt
1300 from 32 to 64. Parsing "1e500", for example, requires more than 32 words.
1302 2009-05-10 Darin Adler <darin@apple.com>
1304 Reviewed by Sam Weinig.
1306 Bug 25674: syntax tree nodes should use arena allocation
1307 Part one: Change lifetimes so we won't have to use reference
1308 counting so much, but don't eliminate the reference counts
1311 * JavaScriptCore.exp: Updated.
1313 * bytecompiler/BytecodeGenerator.cpp:
1314 (JSC::BytecodeGenerator::BytecodeGenerator): Update for use of raw pointers
1316 (JSC::BytecodeGenerator::emitCall): Ditto.
1317 (JSC::BytecodeGenerator::emitConstruct): Ditto.
1319 * parser/Grammar.y: Update node creating code to use new (JSGlobalData*)
1320 instead of the plain new. At the moment this is just a hook for future
1321 arena allocation; it's inline and JSGlobalData* is not used.
1323 * parser/NodeConstructors.h: Updated for name change of parserObjects to
1324 parserArena. Also added explicit initialization for raw pointers that used
1325 to be RefPtr. Also removed some uses of get() that aren't needed now that
1326 the pointers are raw pointers. Also eliminated m_parameter from FuncExprNode
1327 and FuncDeclNode. Also changed node-creating code to use new (JSGlobalData*)
1330 * parser/Nodes.cpp: Eliminated NodeReleaser and all use of it.
1331 (JSC::ParserRefCounted::ParserRefCounted): Updated for name change of
1332 parserObjects to parserArena.
1333 (JSC::SourceElements::append): Use raw pointers.
1334 (JSC::ArrayNode::emitBytecode): Ditto.
1335 (JSC::ArrayNode::isSimpleArray): Ditto.
1336 (JSC::ArrayNode::toArgumentList): Ditto.
1337 (JSC::ObjectLiteralNode::emitBytecode): Ditto.
1338 (JSC::PropertyListNode::emitBytecode): Ditto.
1339 (JSC::BracketAccessorNode::emitBytecode): Ditto.
1340 (JSC::DotAccessorNode::emitBytecode): Ditto.
1341 (JSC::ArgumentListNode::emitBytecode): Ditto.
1342 (JSC::NewExprNode::emitBytecode): Ditto.
1343 (JSC::EvalFunctionCallNode::emitBytecode): Ditto.
1344 (JSC::FunctionCallValueNode::emitBytecode): Ditto.
1345 (JSC::FunctionCallResolveNode::emitBytecode): Ditto.
1346 (JSC::FunctionCallBracketNode::emitBytecode): Ditto.
1347 (JSC::FunctionCallDotNode::emitBytecode): Ditto.
1348 (JSC::CallFunctionCallDotNode::emitBytecode): Ditto.
1349 (JSC::ApplyFunctionCallDotNode::emitBytecode): Ditto.
1350 (JSC::PostfixBracketNode::emitBytecode): Ditto.
1351 (JSC::PostfixDotNode::emitBytecode): Ditto.
1352 (JSC::DeleteBracketNode::emitBytecode): Ditto.
1353 (JSC::DeleteDotNode::emitBytecode): Ditto.
1354 (JSC::DeleteValueNode::emitBytecode): Ditto.
1355 (JSC::VoidNode::emitBytecode): Ditto.
1356 (JSC::TypeOfValueNode::emitBytecode): Ditto.
1357 (JSC::PrefixBracketNode::emitBytecode): Ditto.
1358 (JSC::PrefixDotNode::emitBytecode): Ditto.
1359 (JSC::UnaryOpNode::emitBytecode): Ditto.
1360 (JSC::BinaryOpNode::emitStrcat): Ditto.
1361 (JSC::BinaryOpNode::emitBytecode): Ditto.
1362 (JSC::EqualNode::emitBytecode): Ditto.
1363 (JSC::StrictEqualNode::emitBytecode): Ditto.
1364 (JSC::ReverseBinaryOpNode::emitBytecode): Ditto.
1365 (JSC::ThrowableBinaryOpNode::emitBytecode): Ditto.
1366 (JSC::InstanceOfNode::emitBytecode): Ditto.
1367 (JSC::LogicalOpNode::emitBytecode): Ditto.
1368 (JSC::ConditionalNode::emitBytecode): Ditto.
1369 (JSC::ReadModifyResolveNode::emitBytecode): Ditto.
1370 (JSC::AssignResolveNode::emitBytecode): Ditto.
1371 (JSC::AssignDotNode::emitBytecode): Ditto.
1372 (JSC::ReadModifyDotNode::emitBytecode): Ditto.
1373 (JSC::AssignBracketNode::emitBytecode): Ditto.
1374 (JSC::ReadModifyBracketNode::emitBytecode): Ditto.
1375 (JSC::CommaNode::emitBytecode): Ditto.
1376 (JSC::ConstDeclNode::emitCodeSingle): Ditto.
1377 (JSC::ConstDeclNode::emitBytecode): Ditto.
1378 (JSC::ConstStatementNode::emitBytecode): Ditto.
1379 (JSC::statementListEmitCode): Ditto.
1380 (JSC::BlockNode::emitBytecode): Ditto.
1381 (JSC::ExprStatementNode::emitBytecode): Ditto.
1382 (JSC::VarStatementNode::emitBytecode): Ditto.
1383 (JSC::IfNode::emitBytecode): Ditto.
1384 (JSC::IfElseNode::emitBytecode): Ditto.
1385 (JSC::DoWhileNode::emitBytecode): Ditto.
1386 (JSC::WhileNode::emitBytecode): Ditto.
1387 (JSC::ForNode::emitBytecode): Ditto.
1388 (JSC::ForInNode::emitBytecode): Ditto.
1389 (JSC::ReturnNode::emitBytecode): Ditto.
1390 (JSC::WithNode::emitBytecode): Ditto.
1391 (JSC::CaseBlockNode::tryOptimizedSwitch): Ditto.
1392 (JSC::CaseBlockNode::emitBytecodeForBlock): Ditto.
1393 (JSC::SwitchNode::emitBytecode): Ditto.
1394 (JSC::LabelNode::emitBytecode): Ditto.
1395 (JSC::ThrowNode::emitBytecode): Ditto.
1396 (JSC::TryNode::emitBytecode): Ditto.
1397 (JSC::ScopeNodeData::ScopeNodeData): Use swap to transfer ownership
1398 of the arena, varStack and functionStack.
1399 (JSC::ScopeNode::ScopeNode): Pass in the arena when creating the
1401 (JSC::ProgramNode::ProgramNode): Made this inline since it's used
1403 (JSC::ProgramNode::create): Changed this to return a PassRefPtr since
1404 we plan to have the scope nodes be outside the arena, so they will need
1405 some kind of ownership transfer (maybe auto_ptr instead of PassRefPtr
1406 in the future, though). Remove the node from the newly-created arena to
1407 avoid a circular reference. Later we'll keep the node out of the arena
1408 by using a different operator new, but for now it's the ParserRefCounted
1409 constructor that puts the node into the arena, and there's no way to
1411 (JSC::EvalNode::EvalNode): Ditto.
1412 (JSC::EvalNode::create): Ditto.
1413 (JSC::FunctionBodyNode::FunctionBodyNode): Ditto.
1414 (JSC::FunctionBodyNode::createNativeThunk): Moved the code that
1415 reseets the arena here instead of the caller.
1416 (JSC::FunctionBodyNode::create): Same change as the other create
1418 (JSC::FunctionBodyNode::emitBytecode): Use raw pointers.
1420 * parser/Nodes.h: Removed NodeReleaser. Changed FunctionStack to
1421 use raw pointers. Removed the releaseNodes function. Added an override
1422 of operator new that takes a JSGlobalData* to prepare for future arena use.
1423 Use raw pointers instead of RefPtr everywhere possible.
1425 * parser/Parser.cpp:
1426 (JSC::Parser::reparseInPlace): Pass the arena in.
1429 (JSC::Parser::parse): Updated for name change of parserObjects to parserArena.
1430 (JSC::Parser::reparse): Ditto.
1431 * runtime/FunctionConstructor.cpp:
1432 (JSC::extractFunctionBody): Ditto.
1433 * runtime/JSGlobalData.cpp:
1434 (JSC::JSGlobalData::~JSGlobalData): Ditto.
1435 (JSC::JSGlobalData::createNativeThunk): Moved arena manipulation into the
1436 FunctionBodyNode::createNativeThunk function.
1438 * runtime/JSGlobalData.h: Tweaked formatting and renamed parserObjects to
1441 * wtf/NotFound.h: Added the usual "using WTF" to this header to match the
1444 2009-05-10 Dimitri Glazkov <dglazkov@chromium.org>
1446 Reviewed by Geoffrey Garen.
1448 https://bugs.webkit.org/show_bug.cgi?id=25670
1449 Remove no longer valid chunk of code from dtoa.
1452 (WTF::dtoa): Removed invalid code.
1454 2009-05-10 Alexey Proskuryakov <ap@webkit.org>
1456 Reviewed by Geoff Garen.
1458 "Class const *" is the same as "const Class*", use the latter syntax consistently.
1460 See <http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.9>.
1462 * pcre/pcre_compile.cpp:
1463 (calculateCompiledPatternLength):
1464 * runtime/JSObject.h:
1465 (JSC::JSObject::offsetForLocation):
1466 (JSC::JSObject::locationForOffset):
1468 2009-05-10 Maciej Stachowiak <mjs@apple.com>
1470 Reviewed by Alexey Proskuryakov.
1472 - speedup dtoa/strtod
1474 Added a bunch of inlining, and replaced malloc with stack allocation.
1476 0.5% SunSpider speedup (7% on string-tagcloud).
1478 * runtime/NumberPrototype.cpp:
1479 (JSC::integerPartNoExp):
1480 (JSC::numberProtoFuncToExponential):
1481 * runtime/UString.cpp:
1483 (JSC::UString::from):
1485 (WTF::BigInt::BigInt):
1486 (WTF::BigInt::operator=):
1506 2009-05-09 Mike Hommey <glandium@debian.org>
1508 Reviewed by Geoffrey Garen. Landed by Jan Alonzo.
1510 Enable JIT on x86-64 gtk+
1511 https://bugs.webkit.org/show_bug.cgi?id=24724
1515 2009-05-09 Geoffrey Garen <ggaren@apple.com>
1517 Reviewed by Cameron Zwarich.
1519 Removed the last non-call-related manually managed JIT stub call.
1521 * jit/JITArithmetic.cpp:
1522 (JSC::JIT::compileFastArithSlow_op_rshift): Fully use the JITStubCall
1523 abstraction, instead of emitPutJITStubArg.
1525 2009-05-09 Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
1527 Reviewed by Gustavo Noronha.
1529 https://bugs.webkit.org/show_bug.cgi?id=25653
1530 PLATFORM(X86_64) inherits ia64
1532 __ia64__ is defined by gcc in an IA64 arch and has completely
1533 nothing in common with X86-64 exept both are from Intel and have
1534 an 64bit address space. That's it. Since code seems to expect x86
1535 here, ia64 has to go.
1539 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
1541 Suggested by Geoffrey Garen.
1543 Assume SSE2 is present on X86-64 and on MAC X86-32. This fixes a
1544 build breakage on non-Mac X86-64 when JIT is enabled.
1546 * jit/JITArithmetic.cpp:
1548 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
1550 Build fix, adding missing files to make dist.
1554 2009-05-09 Geoffrey Garen <ggaren@apple.com>
1558 * assembler/X86Assembler.h:
1559 (JSC::X86Assembler::patchLoadToLEA):
1561 2009-05-09 Geoffrey Garen <ggaren@apple.com>
1565 * assembler/X86Assembler.h:
1566 (JSC::X86Assembler::patchLoadToLEA):
1568 2009-05-09 Maciej Stachowiak <mjs@apple.com>
1570 Reviewed by Gavin Barraclough.
1572 Original patch by John McCall. Updated by Cameron Zwarich. Further refined by me.
1574 - Assorted speedups to property access
1576 ~.3%-1% speedup on SunSpider
1578 1) When we know from the structure ID that an object is using inline storage, plant direct
1579 loads and stores against it; no need to indirect through storage pointer.
1581 2) Also because of the above, union the property storage pointer with the first inline property
1582 slot and add an extra inline property slot.
1584 * assembler/AbstractMacroAssembler.h:
1585 (JSC::AbstractMacroAssembler::CodeLocationInstruction::CodeLocationInstruction):
1586 (JSC::AbstractMacroAssembler::CodeLocationInstruction::patchLoadToLEA):
1587 (JSC::::CodeLocationCommon::instructionAtOffset):
1588 * assembler/MacroAssembler.h:
1589 (JSC::MacroAssembler::storePtr):
1590 * assembler/MacroAssemblerX86.h:
1591 (JSC::MacroAssemblerX86::store32):
1592 * assembler/MacroAssemblerX86_64.h:
1593 (JSC::MacroAssemblerX86_64::storePtr):
1594 * assembler/X86Assembler.h:
1595 (JSC::X86Assembler::movq_EAXm):
1596 (JSC::X86Assembler::movl_rm):
1597 (JSC::X86Assembler::patchLoadToLEA):
1599 (JSC::JIT::privateCompileMainPass):
1601 * jit/JITPropertyAccess.cpp:
1602 (JSC::JIT::compileGetByIdHotPath):
1603 (JSC::JIT::compilePutByIdHotPath):
1604 (JSC::JIT::compilePutDirectOffset):
1605 (JSC::JIT::compileGetDirectOffset):
1606 (JSC::JIT::privateCompilePutByIdTransition):
1607 (JSC::JIT::patchGetByIdSelf):
1608 (JSC::JIT::patchPutByIdReplace):
1609 (JSC::JIT::privateCompileGetByIdSelf):
1610 (JSC::JIT::privateCompileGetByIdProto):
1611 (JSC::JIT::privateCompileGetByIdSelfList):
1612 (JSC::JIT::privateCompileGetByIdProtoList):
1613 (JSC::JIT::privateCompileGetByIdChainList):
1614 (JSC::JIT::privateCompileGetByIdChain):
1615 (JSC::JIT::privateCompilePutByIdReplace):
1616 * runtime/JSObject.cpp:
1617 (JSC::JSObject::mark):
1618 (JSC::JSObject::removeDirect):
1619 * runtime/JSObject.h:
1620 (JSC::JSObject::propertyStorage):
1621 (JSC::JSObject::getDirect):
1622 (JSC::JSObject::getOffset):
1623 (JSC::JSObject::offsetForLocation):
1624 (JSC::JSObject::locationForOffset):
1625 (JSC::JSObject::getDirectOffset):
1626 (JSC::JSObject::putDirectOffset):
1627 (JSC::JSObject::isUsingInlineStorage):
1629 (JSC::JSObject::JSObject):
1630 (JSC::JSObject::~JSObject):
1631 (JSC::Structure::isUsingInlineStorage):
1632 (JSC::JSObject::putDirect):
1633 (JSC::JSObject::putDirectWithoutTransition):
1634 (JSC::JSObject::allocatePropertyStorageInline):
1635 * runtime/Structure.h:
1637 2009-05-09 Geoffrey Garen <ggaren@apple.com>
1639 Reviewed by Gavin Barraclough.
1641 Changed all our JIT stubs so that they return a maximum of 1 JS value or
1642 two non-JS pointers, and do all other value returning through out
1643 parameters, in preparation for 64bit JS values on a 32bit system.
1645 Stubs that used to return two JSValues now return one JSValue and take
1646 and out parameter specifying where in the register array the second
1649 SunSpider reports no change.
1652 (JSC::JIT::privateCompileMainPass):
1653 * jit/JITArithmetic.cpp:
1654 (JSC::JIT::compileFastArithSlow_op_post_inc):
1655 (JSC::JIT::compileFastArithSlow_op_post_dec):
1657 (JSC::JITStubs::cti_op_call_arityCheck):
1658 (JSC::JITStubs::cti_op_resolve_func):
1659 (JSC::JITStubs::cti_op_post_inc):
1660 (JSC::JITStubs::cti_op_resolve_with_base):
1661 (JSC::JITStubs::cti_op_post_dec):
1665 2009-05-08 Geoffrey Garen <ggaren@apple.com>
1667 Reviewed by Cameron Zwarich.
1669 Fixed <rdar://problem/6634956> CrashTracer: [REGRESSION] >400 crashes
1670 in Safari at com.apple.JavaScriptCore • JSC::BytecodeGenerator::emitComplexJumpScopes + 468
1671 https://bugs.webkit.org/show_bug.cgi?id=25658
1673 * bytecompiler/BytecodeGenerator.cpp:
1674 (JSC::BytecodeGenerator::emitComplexJumpScopes): Guard the whole loop
1675 with a bounds check. The old loop logic would decrement and read topScope
1676 without a bounds check, which could cause crashes on page boundaries.
1678 2009-05-08 Jan Michael Alonzo <jmalonzo@webkit.org>
1680 Reviewed by NOBODY (BuildFix).
1682 Gtk fix: add LiteralParser to the build script per r43424.
1684 Add LiteralParser to the Qt and Wx build scripts too.
1687 * JavaScriptCore.pri:
1688 * JavaScriptCoreSources.bkl:
1690 2009-05-08 Oliver Hunt <oliver@apple.com>
1692 Reviewed by Gavin Barraclough and Darin Adler.
1694 Add a limited literal parser for eval to handle object and array literals fired at eval
1696 This is a simplified parser and lexer that we can throw at strings passed to eval
1697 in case a site is using eval to parse JSON (eg. json2.js). The lexer is intentionally
1698 limited (in effect it's whitelisting a limited "common" subset of the JSON grammar)
1699 as this decreases the likelihood of us wating time attempting to parse any significant
1700 amount of non-JSON content.
1702 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1703 * JavaScriptCore.xcodeproj/project.pbxproj:
1704 * interpreter/Interpreter.cpp:
1705 (JSC::Interpreter::callEval):
1706 * runtime/JSGlobalObjectFunctions.cpp:
1707 (JSC::globalFuncEval):
1708 * runtime/LiteralParser.cpp: Added.
1709 (JSC::isStringCharacter):
1710 (JSC::LiteralParser::Lexer::lex):
1711 (JSC::LiteralParser::Lexer::lexString):
1712 (JSC::LiteralParser::Lexer::lexNumber):
1713 (JSC::LiteralParser::parseStatement):
1714 (JSC::LiteralParser::parseExpression):
1715 (JSC::LiteralParser::parseArray):
1716 (JSC::LiteralParser::parseObject):
1717 (JSC::LiteralParser::StackGuard::StackGuard):
1718 (JSC::LiteralParser::StackGuard::~StackGuard):
1719 (JSC::LiteralParser::StackGuard::isSafe):
1720 * runtime/LiteralParser.h: Added.
1721 (JSC::LiteralParser::LiteralParser):
1722 (JSC::LiteralParser::attemptJSONParse):
1723 (JSC::LiteralParser::):
1724 (JSC::LiteralParser::Lexer::Lexer):
1725 (JSC::LiteralParser::Lexer::next):
1726 (JSC::LiteralParser::Lexer::currentToken):
1727 (JSC::LiteralParser::abortParse):
1729 2009-05-08 Geoffrey Garen <ggaren@apple.com>
1733 Restored a Mozilla JS test I accidentally gutted.
1735 * tests/mozilla/ecma/Array/15.4.4.2.js:
1739 2009-05-08 Geoffrey Garen <ggaren@apple.com>
1741 Reviewed by Gavin Barraclough.
1743 More abstraction for JITStub calls from JITed code.
1745 Added a JITStubCall class that automatically handles things like assigning
1746 arguments to different stack slots and storing return values. Deployed
1747 the class in about a billion places. A bunch more places remain to be
1748 fixed up, but this is a good stopping point for now.
1751 (JSC::JIT::emitTimeoutCheck):
1752 (JSC::JIT::privateCompileMainPass):
1753 (JSC::JIT::privateCompileSlowCases):
1754 (JSC::JIT::privateCompile):
1756 (JSC::JIT::JSRInfo::JSRInfo):
1757 (JSC::JITStubCall::JITStubCall):
1758 (JSC::JITStubCall::addArgument):
1759 (JSC::JITStubCall::call):
1760 (JSC::JITStubCall::):
1761 (JSC::CallEvalJITStub::CallEvalJITStub):
1762 * jit/JITArithmetic.cpp:
1763 (JSC::JIT::compileFastArithSlow_op_lshift):
1764 (JSC::JIT::compileFastArithSlow_op_rshift):
1765 (JSC::JIT::compileFastArithSlow_op_jnless):
1766 (JSC::JIT::compileFastArithSlow_op_bitand):
1767 (JSC::JIT::compileFastArithSlow_op_mod):
1768 (JSC::JIT::compileFastArith_op_mod):
1769 (JSC::JIT::compileFastArithSlow_op_post_inc):
1770 (JSC::JIT::compileFastArithSlow_op_post_dec):
1771 (JSC::JIT::compileFastArithSlow_op_pre_inc):
1772 (JSC::JIT::compileFastArithSlow_op_pre_dec):
1773 (JSC::JIT::compileFastArith_op_add):
1774 (JSC::JIT::compileFastArith_op_mul):
1775 (JSC::JIT::compileFastArith_op_sub):
1776 (JSC::JIT::compileBinaryArithOpSlowCase):
1777 (JSC::JIT::compileFastArithSlow_op_add):
1778 (JSC::JIT::compileFastArithSlow_op_mul):
1780 (JSC::JIT::compileOpCall):
1782 * jit/JITPropertyAccess.cpp:
1783 (JSC::JIT::compileGetByIdHotPath):
1784 (JSC::JIT::compilePutByIdHotPath):
1785 (JSC::JIT::compileGetByIdSlowCase):
1786 (JSC::JIT::compilePutByIdSlowCase):
1788 (JSC::JITStubs::cti_op_resolve_func):
1789 (JSC::JITStubs::cti_op_resolve_with_base):
1791 2009-05-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
1793 Reviewed by Maciej Stachowiak.
1795 Add a new opcode jnlesseq, and optimize its compilation in the JIT using
1796 techniques similar to what were used to optimize jnless in r43363.
1798 This gives a 0.7% speedup on SunSpider, particularly on the tests 3d-cube,
1799 control-flow-recursive, date-format-xparb, and string-base64.
1801 * bytecode/CodeBlock.cpp:
1802 (JSC::CodeBlock::dump): Add support for dumping op_jnlesseq.
1803 * bytecode/Opcode.h: Add op_jnlesseq to the list of opcodes.
1804 * bytecompiler/BytecodeGenerator.cpp:
1805 (JSC::BytecodeGenerator::emitJumpIfFalse): Add a peephole optimization
1806 for op_jnlesseq when emitting lesseq followed by a jump.
1807 * interpreter/Interpreter.cpp:
1808 (JSC::Interpreter::privateExecute): Add case for op_jnlesseq.
1810 (JSC::JIT::privateCompileMainPass): Add case for op_jnlesseq.
1811 (JSC::JIT::privateCompileSlowCases): Add case for op_jnlesseq.
1813 * jit/JITArithmetic.cpp:
1814 (JSC::JIT::compileFastArith_op_jnlesseq): Added.
1815 (JSC::JIT::compileFastArithSlow_op_jnlesseq): Added.
1817 (JSC::JITStubs::cti_op_jlesseq): Added.
1820 2009-05-08 Maciej Stachowiak <mjs@apple.com>
1822 Reviewed by Cameron Zwarich.
1824 - fix test failures on 64-bit
1826 * jit/JITArithmetic.cpp:
1827 (JSC::JIT::compileFastArithSlow_op_jnless): Avoid accidentaly treating an
1828 immediate int as an immediate float in the 64-bit value representation.
1830 2009-05-08 Gavin Barraclough <barraclough@apple.com>
1832 Rubber stamped by Oliver Hunt.
1834 Removing an empty constructor and an uncalled, empty function seems to be a
1835 pretty solid 1% regeression on my machine, so I'm going to put them back.
1836 Um. Yeah, this this pretty pointles and makes no sense at all. I officially
1837 lose the will to live in 3... 2...
1839 * bytecode/SamplingTool.cpp:
1840 (JSC::SamplingTool::notifyOfScope):
1841 * bytecode/SamplingTool.h:
1842 (JSC::SamplingTool::~SamplingTool):
1844 2009-05-08 Gavin Barraclough <barraclough@apple.com>
1846 Reviewed by Oliver "I see lots of ifdefs" Hunt.
1848 Fix (kinda) for sampling tool breakage. The codeblock sampling tool has become
1849 b0rked due to recent changes in native function calling. The initialization of
1850 a ScopeNode appears to now occur before the sampling tool (or possibly the
1851 interpreter has been brought into existence, wihich leads to crashyness).
1853 This patch doesn't fix the problem. The crash occurs when tracking a Scope, but
1854 we shouldn't need to track scopes when we're just sampling opcodes, not
1855 codeblocks. Not retaining Scopes when just opcode sampling will reduce sampling
1856 overhead reducing any instrumentation skew, which is a good thing. As a side
1857 benefit this patch also gets the opcode sampling going again, albeit in a bit of
1858 a lame way. Will come back later with a proper fix from codeblock sampling.
1860 * JavaScriptCore.exp:
1861 * bytecode/SamplingTool.cpp:
1862 (JSC::compareLineCountInfoSampling):
1863 (JSC::SamplingTool::dump):
1864 * bytecode/SamplingTool.h:
1865 (JSC::SamplingTool::SamplingTool):
1867 (JSC::ScopeNode::ScopeNode):
1869 2009-05-07 Mark Rowe <mrowe@apple.com>
1871 Rubber-stamped by Oliver Hunt.
1873 Fix <https://bugs.webkit.org/show_bug.cgi?id=25640>.
1874 Bug 25640: Crash on quit in r43384 nightly build on Leopard w/ Safari 4 beta installed
1876 Roll out r43366 as it removed symbols that Safari 4 Beta uses.
1878 * JavaScriptCore.exp:
1879 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1880 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1881 * bytecode/SamplingTool.cpp:
1882 (JSC::SamplingThread::start):
1883 (JSC::SamplingThread::stop):
1884 * bytecode/SamplingTool.h:
1885 * wtf/CrossThreadRefCounted.h:
1886 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
1890 * wtf/ThreadingNone.cpp:
1891 * wtf/ThreadingPthreads.cpp:
1892 (WTF::threadMapMutex):
1893 (WTF::initializeThreading):
1895 (WTF::identifierByPthreadHandle):
1896 (WTF::establishIdentifierForPthreadHandle):
1897 (WTF::pthreadHandleForIdentifier):
1898 (WTF::clearPthreadHandleForIdentifier):
1899 (WTF::createThreadInternal):
1900 (WTF::waitForThreadCompletion):
1901 (WTF::detachThread):
1902 (WTF::currentThread):
1903 * wtf/ThreadingWin.cpp:
1904 (WTF::threadMapMutex):
1905 (WTF::initializeThreading):
1907 (WTF::storeThreadHandleByIdentifier):
1908 (WTF::threadHandleForIdentifier):
1909 (WTF::clearThreadHandleForIdentifier):
1910 (WTF::createThreadInternal):
1911 (WTF::waitForThreadCompletion):
1912 (WTF::detachThread):
1913 (WTF::currentThread):
1914 * wtf/gtk/ThreadingGtk.cpp:
1915 (WTF::threadMapMutex):
1916 (WTF::initializeThreading):
1918 (WTF::identifierByGthreadHandle):
1919 (WTF::establishIdentifierForThread):
1920 (WTF::threadForIdentifier):
1921 (WTF::clearThreadForIdentifier):
1922 (WTF::createThreadInternal):
1923 (WTF::waitForThreadCompletion):
1924 (WTF::currentThread):
1925 * wtf/qt/ThreadingQt.cpp:
1926 (WTF::threadMapMutex):
1928 (WTF::identifierByQthreadHandle):
1929 (WTF::establishIdentifierForThread):
1930 (WTF::clearThreadForIdentifier):
1931 (WTF::threadForIdentifier):
1932 (WTF::initializeThreading):
1933 (WTF::createThreadInternal):
1934 (WTF::waitForThreadCompletion):
1935 (WTF::currentThread):
1937 2009-05-07 Gustavo Noronha Silva <gns@gnome.org>
1939 Suggested by Oliver Hunt.
1941 Also check for Linux for the special-cased calling convention.
1944 (JSC::JIT::privateCompileCTIMachineTrampolines):
1947 2009-05-07 Gavin Barraclough <barraclough@apple.com>
1949 Reviewed by Maciej Stachowiak.
1951 Previously, when appending to an existing string and growing the underlying buffer,
1952 we would actually allocate 110% of the required size in order to give us some space
1953 to expand into. Now we treat strings differently based on their size:
1955 Small Strings (up to 4 pages):
1956 Expand the allocation size to 112.5% of the amount requested. This is largely sicking
1957 to our previous policy, however 112.5% is cheaper to calculate.
1959 Medium Strings (up to 128 pages):
1960 For pages covering multiple pages over-allocation is less of a concern - any unused
1961 space will not be paged in if it is not used, so this is purely a VM overhead. For
1962 these strings allocate 2x the requested size.
1964 Large Strings (to infinity and beyond!):
1965 Revert to our 112.5% policy - probably best to limit the amount of unused VM we allow
1966 any individual string be responsible for.
1968 Additionally, round small allocations up to a multiple of 16 bytes, and medium and
1969 large allocations up to a multiple of page size.
1971 ~1.5% progression on Sunspider, due to 5% improvement on tagcloud & 15% on validate.
1973 * runtime/UString.cpp:
1974 (JSC::expandedSize):
1976 2009-05-07 Geoffrey Garen <ggaren@apple.com>
1978 Reviewed by Cameron Zwarich.
1980 Fixed a minor sequencing error introduced by recent Parser speedups.
1982 * runtime/JSGlobalData.cpp:
1983 (JSC::JSGlobalData::createNativeThunk): Missed a spot in my last patch.
1985 2009-05-07 Geoffrey Garen <ggaren@apple.com>
1989 * wtf/Platform.h: Reverted an accidental (and performance-catastrophic)
1992 2009-05-07 Geoffrey Garen <ggaren@apple.com>
1994 Reviewed by Cameron Zwarich.
1996 Fixed a minor sequencing error introduced by recent Parser speedups.
1998 * parser/Parser.cpp:
1999 (JSC::Parser::reparseInPlace): Missed a spot in my last patch.
2001 2009-05-07 Geoffrey Garen <ggaren@apple.com>
2003 Reviewed by Cameron Zwarich.
2005 Fixed a minor sequencing error introduced by recent Parser speedups.
2007 * parser/Parser.cpp:
2008 (JSC::Parser::parse):
2010 (JSC::Parser::parse):
2011 (JSC::Parser::reparse): Shrink the parsedObjects vector after allocating
2012 the root node, to avoid leaving a stray node in the vector, since that's
2013 a slight memory leak, and it causes problems during JSGlobalData teardown.
2015 * runtime/JSGlobalData.cpp:
2016 (JSC::JSGlobalData::~JSGlobalData): ASSERT that we're not being torn
2017 down while we think we're still parsing, since that would cause lots of
2018 bad memory references during our destruction.
2020 2009-05-07 Geoffrey Garen <ggaren@apple.com>
2022 Reviewed by Cameron Zwarich.
2024 Replaced two more macros with references to the JITStackFrame structure.
2027 (JSC::JIT::privateCompileMainPass):
2028 * jit/JITInlineMethods.h:
2029 (JSC::JIT::restoreArgumentReference):
2034 2009-05-07 Oliver Hunt <oliver@apple.com>
2036 Reviewed by Gavin Barraclough.
2038 Improve native call performance
2040 Fix the windows build by adding calling convention declarations everywhere,
2041 chose fastcall as that seemed most sensible given we were having to declare
2042 the convention explicitly. In addition switched to fastcall on mac in the
2043 deluded belief that documented fastcall behavior on windows would match
2044 actual its actual behavior.
2046 * API/JSCallbackFunction.h:
2047 * API/JSCallbackObject.h:
2048 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2049 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2050 * interpreter/CallFrame.h:
2051 (JSC::ExecState::argumentCount):
2053 (JSC::JIT::privateCompileCTIMachineTrampolines):
2061 (functionSetSamplingFlags):
2062 (functionClearSamplingFlags):
2065 * runtime/ArrayConstructor.cpp:
2066 (JSC::callArrayConstructor):
2067 * runtime/ArrayPrototype.cpp:
2068 (JSC::arrayProtoFuncToString):
2069 (JSC::arrayProtoFuncToLocaleString):
2070 (JSC::arrayProtoFuncJoin):
2071 (JSC::arrayProtoFuncConcat):
2072 (JSC::arrayProtoFuncPop):
2073 (JSC::arrayProtoFuncPush):
2074 (JSC::arrayProtoFuncReverse):
2075 (JSC::arrayProtoFuncShift):
2076 (JSC::arrayProtoFuncSlice):
2077 (JSC::arrayProtoFuncSort):
2078 (JSC::arrayProtoFuncSplice):
2079 (JSC::arrayProtoFuncUnShift):
2080 (JSC::arrayProtoFuncFilter):
2081 (JSC::arrayProtoFuncMap):
2082 (JSC::arrayProtoFuncEvery):
2083 (JSC::arrayProtoFuncForEach):
2084 (JSC::arrayProtoFuncSome):
2085 (JSC::arrayProtoFuncReduce):
2086 (JSC::arrayProtoFuncReduceRight):
2087 (JSC::arrayProtoFuncIndexOf):
2088 (JSC::arrayProtoFuncLastIndexOf):
2089 * runtime/BooleanConstructor.cpp:
2090 (JSC::callBooleanConstructor):
2091 * runtime/BooleanPrototype.cpp:
2092 (JSC::booleanProtoFuncToString):
2093 (JSC::booleanProtoFuncValueOf):
2094 * runtime/CallData.h:
2095 * runtime/DateConstructor.cpp:
2100 * runtime/DatePrototype.cpp:
2101 (JSC::dateProtoFuncToString):
2102 (JSC::dateProtoFuncToUTCString):
2103 (JSC::dateProtoFuncToDateString):
2104 (JSC::dateProtoFuncToTimeString):
2105 (JSC::dateProtoFuncToLocaleString):
2106 (JSC::dateProtoFuncToLocaleDateString):
2107 (JSC::dateProtoFuncToLocaleTimeString):
2108 (JSC::dateProtoFuncGetTime):
2109 (JSC::dateProtoFuncGetFullYear):
2110 (JSC::dateProtoFuncGetUTCFullYear):
2111 (JSC::dateProtoFuncToGMTString):
2112 (JSC::dateProtoFuncGetMonth):
2113 (JSC::dateProtoFuncGetUTCMonth):
2114 (JSC::dateProtoFuncGetDate):
2115 (JSC::dateProtoFuncGetUTCDate):
2116 (JSC::dateProtoFuncGetDay):
2117 (JSC::dateProtoFuncGetUTCDay):
2118 (JSC::dateProtoFuncGetHours):
2119 (JSC::dateProtoFuncGetUTCHours):
2120 (JSC::dateProtoFuncGetMinutes):
2121 (JSC::dateProtoFuncGetUTCMinutes):
2122 (JSC::dateProtoFuncGetSeconds):
2123 (JSC::dateProtoFuncGetUTCSeconds):
2124 (JSC::dateProtoFuncGetMilliSeconds):
2125 (JSC::dateProtoFuncGetUTCMilliseconds):
2126 (JSC::dateProtoFuncGetTimezoneOffset):
2127 (JSC::dateProtoFuncSetTime):
2128 (JSC::dateProtoFuncSetMilliSeconds):
2129 (JSC::dateProtoFuncSetUTCMilliseconds):
2130 (JSC::dateProtoFuncSetSeconds):
2131 (JSC::dateProtoFuncSetUTCSeconds):
2132 (JSC::dateProtoFuncSetMinutes):
2133 (JSC::dateProtoFuncSetUTCMinutes):
2134 (JSC::dateProtoFuncSetHours):
2135 (JSC::dateProtoFuncSetUTCHours):
2136 (JSC::dateProtoFuncSetDate):
2137 (JSC::dateProtoFuncSetUTCDate):
2138 (JSC::dateProtoFuncSetMonth):
2139 (JSC::dateProtoFuncSetUTCMonth):
2140 (JSC::dateProtoFuncSetFullYear):
2141 (JSC::dateProtoFuncSetUTCFullYear):
2142 (JSC::dateProtoFuncSetYear):
2143 (JSC::dateProtoFuncGetYear):
2144 * runtime/ErrorConstructor.cpp:
2145 (JSC::callErrorConstructor):
2146 * runtime/ErrorPrototype.cpp:
2147 (JSC::errorProtoFuncToString):
2148 * runtime/FunctionConstructor.cpp:
2149 (JSC::callFunctionConstructor):
2150 * runtime/FunctionPrototype.cpp:
2151 (JSC::callFunctionPrototype):
2152 (JSC::functionProtoFuncToString):
2153 (JSC::functionProtoFuncApply):
2154 (JSC::functionProtoFuncCall):
2155 * runtime/JSFunction.h:
2156 (JSC::JSFunction::nativeFunction):
2157 (JSC::JSFunction::setScopeChain):
2158 * runtime/JSGlobalObjectFunctions.cpp:
2159 (JSC::globalFuncEval):
2160 (JSC::globalFuncParseInt):
2161 (JSC::globalFuncParseFloat):
2162 (JSC::globalFuncIsNaN):
2163 (JSC::globalFuncIsFinite):
2164 (JSC::globalFuncDecodeURI):
2165 (JSC::globalFuncDecodeURIComponent):
2166 (JSC::globalFuncEncodeURI):
2167 (JSC::globalFuncEncodeURIComponent):
2168 (JSC::globalFuncEscape):
2169 (JSC::globalFuncUnescape):
2170 (JSC::globalFuncJSCPrint):
2171 * runtime/JSGlobalObjectFunctions.h:
2172 * runtime/MathObject.cpp:
2173 (JSC::mathProtoFuncAbs):
2174 (JSC::mathProtoFuncACos):
2175 (JSC::mathProtoFuncASin):
2176 (JSC::mathProtoFuncATan):
2177 (JSC::mathProtoFuncATan2):
2178 (JSC::mathProtoFuncCeil):
2179 (JSC::mathProtoFuncCos):
2180 (JSC::mathProtoFuncExp):
2181 (JSC::mathProtoFuncFloor):
2182 (JSC::mathProtoFuncLog):
2183 (JSC::mathProtoFuncMax):
2184 (JSC::mathProtoFuncMin):
2185 (JSC::mathProtoFuncPow):
2186 (JSC::mathProtoFuncRandom):
2187 (JSC::mathProtoFuncRound):
2188 (JSC::mathProtoFuncSin):
2189 (JSC::mathProtoFuncSqrt):
2190 (JSC::mathProtoFuncTan):
2191 * runtime/NativeErrorConstructor.cpp:
2192 (JSC::callNativeErrorConstructor):
2193 * runtime/NativeFunctionWrapper.h:
2194 * runtime/NumberConstructor.cpp:
2195 (JSC::callNumberConstructor):
2196 * runtime/NumberPrototype.cpp:
2197 (JSC::numberProtoFuncToString):
2198 (JSC::numberProtoFuncToLocaleString):
2199 (JSC::numberProtoFuncValueOf):
2200 (JSC::numberProtoFuncToFixed):
2201 (JSC::numberProtoFuncToExponential):
2202 (JSC::numberProtoFuncToPrecision):
2203 * runtime/ObjectConstructor.cpp:
2204 (JSC::callObjectConstructor):
2205 * runtime/ObjectPrototype.cpp:
2206 (JSC::objectProtoFuncValueOf):
2207 (JSC::objectProtoFuncHasOwnProperty):
2208 (JSC::objectProtoFuncIsPrototypeOf):
2209 (JSC::objectProtoFuncDefineGetter):
2210 (JSC::objectProtoFuncDefineSetter):
2211 (JSC::objectProtoFuncLookupGetter):
2212 (JSC::objectProtoFuncLookupSetter):
2213 (JSC::objectProtoFuncPropertyIsEnumerable):
2214 (JSC::objectProtoFuncToLocaleString):
2215 (JSC::objectProtoFuncToString):
2216 * runtime/ObjectPrototype.h:
2217 * runtime/RegExpConstructor.cpp:
2218 (JSC::callRegExpConstructor):
2219 * runtime/RegExpObject.cpp:
2220 (JSC::callRegExpObject):
2221 * runtime/RegExpPrototype.cpp:
2222 (JSC::regExpProtoFuncTest):
2223 (JSC::regExpProtoFuncExec):
2224 (JSC::regExpProtoFuncCompile):
2225 (JSC::regExpProtoFuncToString):
2226 * runtime/StringConstructor.cpp:
2227 (JSC::stringFromCharCode):
2228 (JSC::callStringConstructor):
2229 * runtime/StringPrototype.cpp:
2230 (JSC::stringProtoFuncReplace):
2231 (JSC::stringProtoFuncToString):
2232 (JSC::stringProtoFuncCharAt):
2233 (JSC::stringProtoFuncCharCodeAt):
2234 (JSC::stringProtoFuncConcat):
2235 (JSC::stringProtoFuncIndexOf):
2236 (JSC::stringProtoFuncLastIndexOf):
2237 (JSC::stringProtoFuncMatch):
2238 (JSC::stringProtoFuncSearch):
2239 (JSC::stringProtoFuncSlice):
2240 (JSC::stringProtoFuncSplit):
2241 (JSC::stringProtoFuncSubstr):
2242 (JSC::stringProtoFuncSubstring):
2243 (JSC::stringProtoFuncToLowerCase):
2244 (JSC::stringProtoFuncToUpperCase):
2245 (JSC::stringProtoFuncLocaleCompare):
2246 (JSC::stringProtoFuncBig):
2247 (JSC::stringProtoFuncSmall):
2248 (JSC::stringProtoFuncBlink):
2249 (JSC::stringProtoFuncBold):
2250 (JSC::stringProtoFuncFixed):
2251 (JSC::stringProtoFuncItalics):
2252 (JSC::stringProtoFuncStrike):
2253 (JSC::stringProtoFuncSub):
2254 (JSC::stringProtoFuncSup):
2255 (JSC::stringProtoFuncFontcolor):
2256 (JSC::stringProtoFuncFontsize):
2257 (JSC::stringProtoFuncAnchor):
2258 (JSC::stringProtoFuncLink):
2261 2009-05-07 Geoffrey Garen <ggaren@apple.com>
2265 Rolled out a portion of r43352 because it broke 64bit.
2269 2009-05-07 Kevin Ollivier <kevino@theolliviers.com>
2271 Build fix for functions reaturning ThreadIdentifier.
2273 * wtf/ThreadingNone.cpp:
2274 (WTF::createThreadInternal):
2275 (WTF::currentThread):
2277 2009-05-07 Maciej Stachowiak <mjs@apple.com>
2279 Reviewed by John Honeycutt.
2281 - enable optimization case im the last patch that I accidentally had disabled.
2283 * jit/JITArithmetic.cpp:
2284 (JSC::JIT::compileFastArithSlow_op_jnless):
2286 2009-05-07 Dmitry Titov <dimich@chromium.org>
2288 Attempt to fix Win build.
2290 * jit/JITArithmetic.cpp:
2291 (JSC::JIT::compileFastArithSlow_op_jnless):
2293 2009-05-07 Dmitry Titov <dimich@chromium.org>
2295 Reviewed by Alexey Proskuryakov and Adam Roben.
2297 https://bugs.webkit.org/show_bug.cgi?id=25348
2298 Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
2301 (WTF::ThreadIdentifier::ThreadIdentifier):
2302 (WTF::ThreadIdentifier::isValid):
2303 (WTF::ThreadIdentifier::invalidate):
2304 (WTF::ThreadIdentifier::platformId):
2305 ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
2306 methods that are used across the code on thread ids: construction, comparisons,
2307 check for 'valid' state etc. '0' is used as invalid id, which happens to just work
2308 with all platform-specific thread id implementations.
2310 All the following files repeatedly reflect the new ThreadIdentifier for each platform.
2311 We remove ThreadMap and threadMapMutex from all of them, remove the functions that
2312 populated/searched/cleared the map and add platform-specific comparison operators
2313 for ThreadIdentifier.
2315 * wtf/gtk/ThreadingGtk.cpp:
2316 (WTF::ThreadIdentifier::operator==):
2317 (WTF::ThreadIdentifier::operator!=):
2318 (WTF::initializeThreading):
2319 (WTF::createThreadInternal):
2320 (WTF::waitForThreadCompletion):
2321 (WTF::currentThread):
2323 * wtf/ThreadingNone.cpp:
2324 (WTF::ThreadIdentifier::operator==):
2325 (WTF::ThreadIdentifier::operator!=):
2327 * wtf/ThreadingPthreads.cpp:
2328 (WTF::ThreadIdentifier::operator==):
2329 (WTF::ThreadIdentifier::operator!=):
2330 (WTF::initializeThreading):
2331 (WTF::createThreadInternal):
2332 (WTF::waitForThreadCompletion):
2333 (WTF::detachThread):
2334 (WTF::currentThread):
2336 * wtf/qt/ThreadingQt.cpp:
2337 (WTF::ThreadIdentifier::operator==):
2338 (WTF::ThreadIdentifier::operator!=):
2339 (WTF::initializeThreading):
2340 (WTF::createThreadInternal):
2341 (WTF::waitForThreadCompletion):
2342 (WTF::currentThread):
2344 * wtf/ThreadingWin.cpp:
2345 (WTF::ThreadIdentifier::operator==):
2346 (WTF::ThreadIdentifier::operator!=):
2347 (WTF::initializeThreading):
2348 (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
2349 counter as a thread ID and mapped it into platform ID. Windows was using native thread
2350 id and mapped it into thread handle. Since we can always obtain a thread handle
2351 by thread id, createThread now closes the handle.
2352 (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
2353 it means the thread already exited.
2354 (WTF::detachThread):
2355 (WTF::currentThread):
2356 (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
2357 (WTF::waitForThreadCompletionDeprecated): same.
2358 (WTF::currentThreadDeprecated): same.
2359 (WTF::createThreadDeprecated): same.
2361 * bytecode/SamplingTool.h:
2362 * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
2364 * JavaScriptCore.exp: export lists - updated the WTF threading functions decorated names
2365 since they now take a different type as a parameter.
2366 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
2367 that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
2368 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
2370 2009-05-07 Maciej Stachowiak <mjs@apple.com>
2372 Reviewed by Sam Weinig.
2374 - optimize various cases of branch-fused less
2376 1% speedup on SunSpider overall
2377 13% speedup on math-cordic
2380 (JSC::JIT::privateCompileMainPass):
2381 op_loop_if_less: Optimize case of constant as first operand, just as case of constant as
2383 op_jnless: Factored out into compileFastArith_op_jnless.
2384 (JSC::JIT::privateCompileSlowCases):
2385 op_jnless: Factored out into compileFastArithSlow_op_jnless.
2387 * jit/JITArithmetic.cpp:
2388 (JSC::JIT::compileFastArith_op_jnless): Factored out from main compile loop.
2389 - Generate inline code for comparison of constant immediate int as first operand to another
2390 immediate int, as for loop_if_less
2392 (JSC::JIT::compileFastArithSlow_op_jnless):
2393 - Generate inline code for comparing two floating point numbers.
2394 - Generate code for both cases of comparing a floating point number to a constant immediate
2396 * bytecode/CodeBlock.cpp:
2397 (JSC::CodeBlock::dump): Fix dumping of op_jnless (tangentially related bugfix).
2399 2009-05-07 Geoffrey Garen <ggaren@apple.com>
2401 Reviewed by Sam Weinig.
2403 Added the return address of a stub function to the JITStackFrame abstraction.
2409 (JSC::StackHack::StackHack):
2410 (JSC::StackHack::~StackHack):
2411 (JSC::returnToThrowTrampoline):
2412 (JSC::JITStubs::cti_op_convert_this):
2413 (JSC::JITStubs::cti_op_end):
2414 (JSC::JITStubs::cti_op_add):
2415 (JSC::JITStubs::cti_op_pre_inc):
2416 (JSC::JITStubs::cti_timeout_check):
2417 (JSC::JITStubs::cti_register_file_check):
2418 (JSC::JITStubs::cti_op_loop_if_less):
2419 (JSC::JITStubs::cti_op_loop_if_lesseq):
2420 (JSC::JITStubs::cti_op_new_object):
2421 (JSC::JITStubs::cti_op_put_by_id_generic):
2422 (JSC::JITStubs::cti_op_get_by_id_generic):
2423 (JSC::JITStubs::cti_op_put_by_id):
2424 (JSC::JITStubs::cti_op_put_by_id_second):
2425 (JSC::JITStubs::cti_op_put_by_id_fail):
2426 (JSC::JITStubs::cti_op_get_by_id):
2427 (JSC::JITStubs::cti_op_get_by_id_second):
2428 (JSC::JITStubs::cti_op_get_by_id_self_fail):
2429 (JSC::JITStubs::cti_op_get_by_id_proto_list):
2430 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
2431 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
2432 (JSC::JITStubs::cti_op_get_by_id_array_fail):
2433 (JSC::JITStubs::cti_op_get_by_id_string_fail):
2434 (JSC::JITStubs::cti_op_instanceof):
2435 (JSC::JITStubs::cti_op_del_by_id):
2436 (JSC::JITStubs::cti_op_mul):
2437 (JSC::JITStubs::cti_op_new_func):
2438 (JSC::JITStubs::cti_op_call_JSFunction):
2439 (JSC::JITStubs::cti_op_call_arityCheck):
2440 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2441 (JSC::JITStubs::cti_vm_lazyLinkCall):
2442 (JSC::JITStubs::cti_op_push_activation):
2443 (JSC::JITStubs::cti_op_call_NotJSFunction):
2444 (JSC::JITStubs::cti_op_create_arguments):
2445 (JSC::JITStubs::cti_op_create_arguments_no_params):
2446 (JSC::JITStubs::cti_op_tear_off_activation):
2447 (JSC::JITStubs::cti_op_tear_off_arguments):
2448 (JSC::JITStubs::cti_op_profile_will_call):
2449 (JSC::JITStubs::cti_op_profile_did_call):
2450 (JSC::JITStubs::cti_op_ret_scopeChain):
2451 (JSC::JITStubs::cti_op_new_array):
2452 (JSC::JITStubs::cti_op_resolve):
2453 (JSC::JITStubs::cti_op_construct_JSConstruct):
2454 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
2455 (JSC::JITStubs::cti_op_get_by_val):
2456 (JSC::JITStubs::cti_op_get_by_val_string):
2457 (JSC::JITStubs::cti_op_get_by_val_byte_array):
2458 (JSC::JITStubs::cti_op_resolve_func):
2459 (JSC::JITStubs::cti_op_sub):
2460 (JSC::JITStubs::cti_op_put_by_val):
2461 (JSC::JITStubs::cti_op_put_by_val_array):
2462 (JSC::JITStubs::cti_op_put_by_val_byte_array):
2463 (JSC::JITStubs::cti_op_lesseq):
2464 (JSC::JITStubs::cti_op_loop_if_true):
2465 (JSC::JITStubs::cti_op_load_varargs):
2466 (JSC::JITStubs::cti_op_negate):
2467 (JSC::JITStubs::cti_op_resolve_base):
2468 (JSC::JITStubs::cti_op_resolve_skip):
2469 (JSC::JITStubs::cti_op_resolve_global):
2470 (JSC::JITStubs::cti_op_div):
2471 (JSC::JITStubs::cti_op_pre_dec):
2472 (JSC::JITStubs::cti_op_jless):
2473 (JSC::JITStubs::cti_op_not):
2474 (JSC::JITStubs::cti_op_jtrue):
2475 (JSC::JITStubs::cti_op_post_inc):
2476 (JSC::JITStubs::cti_op_eq):
2477 (JSC::JITStubs::cti_op_lshift):
2478 (JSC::JITStubs::cti_op_bitand):
2479 (JSC::JITStubs::cti_op_rshift):
2480 (JSC::JITStubs::cti_op_bitnot):
2481 (JSC::JITStubs::cti_op_resolve_with_base):
2482 (JSC::JITStubs::cti_op_new_func_exp):
2483 (JSC::JITStubs::cti_op_mod):
2484 (JSC::JITStubs::cti_op_less):
2485 (JSC::JITStubs::cti_op_neq):
2486 (JSC::JITStubs::cti_op_post_dec):
2487 (JSC::JITStubs::cti_op_urshift):
2488 (JSC::JITStubs::cti_op_bitxor):
2489 (JSC::JITStubs::cti_op_new_regexp):
2490 (JSC::JITStubs::cti_op_bitor):
2491 (JSC::JITStubs::cti_op_call_eval):
2492 (JSC::JITStubs::cti_op_throw):
2493 (JSC::JITStubs::cti_op_get_pnames):
2494 (JSC::JITStubs::cti_op_next_pname):
2495 (JSC::JITStubs::cti_op_push_scope):
2496 (JSC::JITStubs::cti_op_pop_scope):
2497 (JSC::JITStubs::cti_op_typeof):
2498 (JSC::JITStubs::cti_op_is_undefined):
2499 (JSC::JITStubs::cti_op_is_boolean):
2500 (JSC::JITStubs::cti_op_is_number):
2501 (JSC::JITStubs::cti_op_is_string):
2502 (JSC::JITStubs::cti_op_is_object):
2503 (JSC::JITStubs::cti_op_is_function):
2504 (JSC::JITStubs::cti_op_stricteq):
2505 (JSC::JITStubs::cti_op_to_primitive):
2506 (JSC::JITStubs::cti_op_strcat):
2507 (JSC::JITStubs::cti_op_nstricteq):
2508 (JSC::JITStubs::cti_op_to_jsnumber):
2509 (JSC::JITStubs::cti_op_in):
2510 (JSC::JITStubs::cti_op_push_new_scope):
2511 (JSC::JITStubs::cti_op_jmp_scopes):
2512 (JSC::JITStubs::cti_op_put_by_index):
2513 (JSC::JITStubs::cti_op_switch_imm):
2514 (JSC::JITStubs::cti_op_switch_char):
2515 (JSC::JITStubs::cti_op_switch_string):
2516 (JSC::JITStubs::cti_op_del_by_val):
2517 (JSC::JITStubs::cti_op_put_getter):
2518 (JSC::JITStubs::cti_op_put_setter):
2519 (JSC::JITStubs::cti_op_new_error):
2520 (JSC::JITStubs::cti_op_debug):
2521 (JSC::JITStubs::cti_vm_throw):
2523 (JSC::JITStackFrame::returnAddressSlot):
2525 2009-05-07 Darin Adler <darin@apple.com>
2527 Reviewed by Geoff Garen.
2530 (JSC::Lexer::lex): Fix missing braces. This would make us always
2531 take the slower case for string parsing and Visual Studio correctly
2532 noticed unreachable code.
2534 2009-05-07 Darin Adler <darin@apple.com>
2536 Reviewed by Sam Weinig.
2538 Bug 25589: goto instead of state machine in lexer
2539 https://bugs.webkit.org/show_bug.cgi?id=25589
2541 SunSpider is 0.8% faster.
2544 (JSC::Lexer::currentCharacter): Added.
2545 (JSC::Lexer::currentOffset): Changed to call currentCharacter for clarity.
2546 (JSC::Lexer::setCode): Removed code to set now-obsolete m_skipLineEnd.
2547 (JSC::Lexer::shiftLineTerminator): Added. Handles line numbers and the
2548 two-character line terminators.
2549 (JSC::Lexer::makeIdentifier): Changed to take characters and length rather
2550 than a vector, since we now make these directly out of the source buffer
2552 (JSC::Lexer::lastTokenWasRestrKeyword): Added.
2553 (JSC::isNonASCIIIdentStart): Broke out the non-inline part.
2554 (JSC::isIdentStart): Moved here.
2555 (JSC::isNonASCIIIdentPart): Broke out the non-inline part.
2556 (JSC::isIdentPart): Moved here.
2557 (JSC::singleEscape): Moved here, and removed some unneeded cases.
2558 (JSC::Lexer::record8): Moved here.
2559 (JSC::Lexer::record16): Moved here.
2560 (JSC::Lexer::lex): Rewrote this whole function to use goto and not use
2561 a state machine. Got rid of most of the local variables. Also rolled the
2562 matchPunctuator function in here.
2563 (JSC::Lexer::scanRegExp): Changed to use the new version of isLineTerminator.
2564 Clear m_buffer16 after using it instead of before.
2566 * parser/Lexer.h: Removed State enum, setDone function, nextLine function,
2567 lookupKeywordFunction, one of the isLineTerminator functions, m_done data member,
2568 m_skipLineEnd data member, and m_state data member. Added shiftLineTerminator
2569 function, currentCharacter function, and changed the arguments to the makeIdentifier
2570 function. Removed one branch from the isLineTerminator function.
2572 * runtime/StringPrototype.cpp:
2573 (JSC::stringProtoFuncReplace): Streamlined the case where we don't replace anything.
2575 2009-05-07 Geoffrey Garen <ggaren@apple.com>
2577 Reviewed by Gavin Barraclough.
2579 Removed a few more special constants, and replaced them with uses of
2580 the JITStackFrame struct.
2582 Removed one of the two possible definitions of VoidPtrPair. The Mac
2583 definition was more elegant, but SunSpider doesn't think it's any
2584 faster, and it's net less elegant to have two ways of doing things.
2587 (JSC::JIT::privateCompileMainPass):
2588 (JSC::JIT::privateCompile):
2592 2009-05-07 Darin Adler <darin@apple.com>
2594 * runtime/ScopeChain.h:
2595 (JSC::ScopeChainNode::~ScopeChainNode): Tweak formatting.
2597 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
2599 Reviewed by Tor Arne Vestbø.
2601 Fix the build thread stack base determination build on Symbian,
2602 by moving the code block before PLATFORM(UNIX), which is also
2603 enabled on Symbian builds.
2605 * runtime/Collector.cpp:
2606 (JSC::currentThreadStackBase):
2608 2009-05-07 Oliver Hunt <oliver@apple.com>
2610 Reviewed by Gavin Barraclough.
2612 Fix crash due to incorrectly using an invalid scopechain
2614 stringProtoFuncReplace was checking for an exception on a CachedCall
2615 by asking for the cached callframes exception. Unfortunately this
2616 could crash in certain circumstances as CachedCall does not guarantee
2617 a valid callframe following a call. Even more unfortunately the check
2618 was entirely unnecessary as there is only a single exception slot per
2619 global data, so it was already checked via the initial exec->hadException()
2622 To make bugs like this more obvious, i've added a debug only destructor
2623 to ScopeChainNode that 0's all of its fields. This exposed a crash in
2624 the standard javascriptcore tests.
2626 * runtime/ScopeChain.h:
2627 (JSC::ScopeChainNode::~ScopeChainNode):
2628 (JSC::ScopeChain::~ScopeChain):
2629 * runtime/StringPrototype.cpp:
2630 (JSC::stringProtoFuncReplace):
2632 2009-05-07 Gavin Barraclough <barraclough@apple.com>
2634 Reviewed by Geoff Garen.
2636 Enable op_strcat across += assignments. This patch allows the lhs of a read/modify node
2637 to be included within the concatenation operation, and also modifies the implementation
2638 of the concatenation to attempt to reuse and cat onto the leftmost string, rather than
2639 always allocating a new empty output string to copy into (as was previously the behaviour).
2641 ~0.5% progression, due to a 3%-3.5% progression on the string tests (particularly validate).
2644 (JSC::BinaryOpNode::emitStrcat):
2645 (JSC::emitReadModifyAssignment):
2646 (JSC::ReadModifyResolveNode::emitBytecode):
2647 (JSC::ReadModifyDotNode::emitBytecode):
2648 (JSC::ReadModifyBracketNode::emitBytecode):
2650 * runtime/Operations.h:
2651 (JSC::concatenateStrings):
2652 * runtime/UString.cpp:
2653 (JSC::UString::reserveCapacity):
2654 * runtime/UString.h:
2656 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
2658 Reviewed by Oliver Hunt.
2660 Fix the build on Windows without JIT: interpreter/RegisterFile.h needs
2661 roundUpAllocationSize, which is protected by #if ENABLED(ASSEMBLER).
2662 Moved the #ifdef down and always offer the function.
2664 * jit/ExecutableAllocator.h:
2666 2009-05-06 Geoffrey Garen <ggaren@apple.com>
2668 Reviewed by Gavin "++" Barraclough.
2670 Added some abstraction around the JIT stub calling convention by creating
2671 a struct to represent the persistent stack frame JIT code shares with
2674 SunSpider reports no change.
2678 (JSC::JITStubs::cti_op_convert_this):
2679 (JSC::JITStubs::cti_op_end):
2680 (JSC::JITStubs::cti_op_add):
2681 (JSC::JITStubs::cti_op_pre_inc):
2682 (JSC::JITStubs::cti_timeout_check):
2683 (JSC::JITStubs::cti_register_file_check):
2684 (JSC::JITStubs::cti_op_loop_if_less):
2685 (JSC::JITStubs::cti_op_loop_if_lesseq):
2686 (JSC::JITStubs::cti_op_new_object):
2687 (JSC::JITStubs::cti_op_put_by_id_generic):
2688 (JSC::JITStubs::cti_op_get_by_id_generic):
2689 (JSC::JITStubs::cti_op_put_by_id):
2690 (JSC::JITStubs::cti_op_put_by_id_second):
2691 (JSC::JITStubs::cti_op_put_by_id_fail):
2692 (JSC::JITStubs::cti_op_get_by_id):
2693 (JSC::JITStubs::cti_op_get_by_id_second):
2694 (JSC::JITStubs::cti_op_get_by_id_self_fail):
2695 (JSC::JITStubs::cti_op_get_by_id_proto_list):
2696 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
2697 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
2698 (JSC::JITStubs::cti_op_get_by_id_array_fail):
2699 (JSC::JITStubs::cti_op_get_by_id_string_fail):
2700 (JSC::JITStubs::cti_op_instanceof):
2701 (JSC::JITStubs::cti_op_del_by_id):
2702 (JSC::JITStubs::cti_op_mul):
2703 (JSC::JITStubs::cti_op_new_func):
2704 (JSC::JITStubs::cti_op_call_JSFunction):
2705 (JSC::JITStubs::cti_op_call_arityCheck):
2706 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2707 (JSC::JITStubs::cti_vm_lazyLinkCall):
2708 (JSC::JITStubs::cti_op_push_activation):
2709 (JSC::JITStubs::cti_op_call_NotJSFunction):
2710 (JSC::JITStubs::cti_op_create_arguments):
2711 (JSC::JITStubs::cti_op_create_arguments_no_params):
2712 (JSC::JITStubs::cti_op_tear_off_activation):
2713 (JSC::JITStubs::cti_op_tear_off_arguments):
2714 (JSC::JITStubs::cti_op_profile_will_call):
2715 (JSC::JITStubs::cti_op_profile_did_call):
2716 (JSC::JITStubs::cti_op_ret_scopeChain):
2717 (JSC::JITStubs::cti_op_new_array):
2718 (JSC::JITStubs::cti_op_resolve):
2719 (JSC::JITStubs::cti_op_construct_JSConstruct):
2720 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
2721 (JSC::JITStubs::cti_op_get_by_val):
2722 (JSC::JITStubs::cti_op_get_by_val_string):
2723 (JSC::JITStubs::cti_op_get_by_val_byte_array):
2724 (JSC::JITStubs::cti_op_resolve_func):
2725 (JSC::JITStubs::cti_op_sub):
2726 (JSC::JITStubs::cti_op_put_by_val):
2727 (JSC::JITStubs::cti_op_put_by_val_array):
2728 (JSC::JITStubs::cti_op_put_by_val_byte_array):
2729 (JSC::JITStubs::cti_op_lesseq):
2730 (JSC::JITStubs::cti_op_loop_if_true):
2731 (JSC::JITStubs::cti_op_load_varargs):
2732 (JSC::JITStubs::cti_op_negate):
2733 (JSC::JITStubs::cti_op_resolve_base):
2734 (JSC::JITStubs::cti_op_resolve_skip):
2735 (JSC::JITStubs::cti_op_resolve_global):
2736 (JSC::JITStubs::cti_op_div):
2737 (JSC::JITStubs::cti_op_pre_dec):
2738 (JSC::JITStubs::cti_op_jless):
2739 (JSC::JITStubs::cti_op_not):
2740 (JSC::JITStubs::cti_op_jtrue):
2741 (JSC::JITStubs::cti_op_post_inc):
2742 (JSC::JITStubs::cti_op_eq):
2743 (JSC::JITStubs::cti_op_lshift):
2744 (JSC::JITStubs::cti_op_bitand):
2745 (JSC::JITStubs::cti_op_rshift):
2746 (JSC::JITStubs::cti_op_bitnot):
2747 (JSC::JITStubs::cti_op_resolve_with_base):
2748 (JSC::JITStubs::cti_op_new_func_exp):
2749 (JSC::JITStubs::cti_op_mod):
2750 (JSC::JITStubs::cti_op_less):
2751 (JSC::JITStubs::cti_op_neq):
2752 (JSC::JITStubs::cti_op_post_dec):
2753 (JSC::JITStubs::cti_op_urshift):
2754 (JSC::JITStubs::cti_op_bitxor):
2755 (JSC::JITStubs::cti_op_new_regexp):
2756 (JSC::JITStubs::cti_op_bitor):
2757 (JSC::JITStubs::cti_op_call_eval):
2758 (JSC::JITStubs::cti_op_throw):
2759 (JSC::JITStubs::cti_op_get_pnames):
2760 (JSC::JITStubs::cti_op_next_pname):
2761 (JSC::JITStubs::cti_op_push_scope):
2762 (JSC::JITStubs::cti_op_pop_scope):
2763 (JSC::JITStubs::cti_op_typeof):
2764 (JSC::JITStubs::cti_op_is_undefined):
2765 (JSC::JITStubs::cti_op_is_boolean):
2766 (JSC::JITStubs::cti_op_is_number):
2767 (JSC::JITStubs::cti_op_is_string):
2768 (JSC::JITStubs::cti_op_is_object):
2769 (JSC::JITStubs::cti_op_is_function):
2770 (JSC::JITStubs::cti_op_stricteq):
2771 (JSC::JITStubs::cti_op_to_primitive):
2772 (JSC::JITStubs::cti_op_strcat):
2773 (JSC::JITStubs::cti_op_nstricteq):
2774 (JSC::JITStubs::cti_op_to_jsnumber):
2775 (JSC::JITStubs::cti_op_in):
2776 (JSC::JITStubs::cti_op_push_new_scope):
2777 (JSC::JITStubs::cti_op_jmp_scopes):
2778 (JSC::JITStubs::cti_op_put_by_index):
2779 (JSC::JITStubs::cti_op_switch_imm):
2780 (JSC::JITStubs::cti_op_switch_char):
2781 (JSC::JITStubs::cti_op_switch_string):
2782 (JSC::JITStubs::cti_op_del_by_val):
2783 (JSC::JITStubs::cti_op_put_getter):
2784 (JSC::JITStubs::cti_op_put_setter):
2785 (JSC::JITStubs::cti_op_new_error):
2786 (JSC::JITStubs::cti_op_debug):
2787 (JSC::JITStubs::cti_vm_throw):
2791 2009-05-06 Gavin Barraclough <barraclough@apple.com>
2793 Reviewed by Maciej Stachowiak & Darin Adler.
2795 Improve string concatenation (as coded in JS as a sequence of adds).
2797 Detect patterns corresponding to string concatenation, and change the bytecode
2798 generation to emit a new op_strcat instruction. By handling the full set of
2799 additions within a single function we do not need allocate JSString wrappers
2800 for intermediate results, and we can calculate the size of the output string
2801 prior to allocating storage, in order to prevent reallocation of the buffer.
2803 1.5%-2% progression on Sunspider, largely due to a 30% progression on date-format-xparb.
2805 * bytecode/CodeBlock.cpp:
2806 (JSC::CodeBlock::dump):
2808 * bytecode/Opcode.h:
2810 * bytecompiler/BytecodeGenerator.cpp:
2811 (JSC::BytecodeGenerator::emitStrcat):
2812 (JSC::BytecodeGenerator::emitToPrimitive):
2813 Add generation of new opcodes.
2814 * bytecompiler/BytecodeGenerator.h:
2815 Add generation of new opcodes.
2816 * interpreter/Interpreter.cpp:
2817 (JSC::Interpreter::privateExecute):
2818 Add implmentation of new opcodes.
2820 (JSC::JIT::privateCompileMainPass):
2821 (JSC::JIT::privateCompileSlowCases):
2822 Add implmentation of new opcodes.
2824 (JSC::JITStubs::cti_op_to_primitive):
2825 (JSC::JITStubs::cti_op_strcat):
2826 Add implmentation of new opcodes.
2828 Add implmentation of new opcodes.
2830 (JSC::BinaryOpNode::emitStrcat):
2831 (JSC::BinaryOpNode::emitBytecode):
2832 (JSC::ReadModifyResolveNode::emitBytecode):
2833 Add generation of new opcodes.
2835 (JSC::ExpressionNode::):
2837 Add methods to allow identification of add nodes.
2838 * parser/ResultType.h:
2839 (JSC::ResultType::definitelyIsString):
2840 (JSC::ResultType::forAdd):
2841 Fix error in detection of adds that will produce string results.
2842 * runtime/Operations.h:
2843 (JSC::concatenateStrings):
2844 Add implmentation of new opcodes.
2845 * runtime/UString.cpp:
2846 (JSC::UString::appendNumeric):
2847 Add methods to append numbers to an existing string.
2848 * runtime/UString.h:
2849 (JSC::UString::Rep::createEmptyBuffer):
2850 (JSC::UString::BaseString::BaseString):
2851 Add support for creating an empty string with a non-zero capacity available in the BaseString.
2853 2009-05-06 Darin Adler <darin@apple.com>
2855 Reviewed by Sam Weinig.
2857 Made RefCounted::m_refCount private.
2859 * runtime/Structure.h: Removed addressOfCount.
2860 * wtf/RefCounted.h: Made m_refCount private.
2861 Added addressOfCount.
2863 2009-05-06 Darin Adler <darin@apple.com>
2865 Fixed assertion seen a lot!
2868 (JSC::FunctionBodyNode::~FunctionBodyNode): Removed now-bogus assertion.
2870 2009-05-06 Darin Adler <darin@apple.com>
2872 Working with Sam Weinig.
2874 Redo parse tree constructor optimization without breaking the Windows
2875 build the way I did yesterday. The previous try broke the build by adding
2876 an include of Lexer.h and all its dependencies that had to work outside
2877 the JavaScriptCore project.
2879 * GNUmakefile.am: Added NodeConstructors.h.
2880 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
2882 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2883 Removed byteocde directory -- we no longer are trying to include Lexer.h
2884 outside JavaScriptCore.
2886 * JavaScriptCore.xcodeproj/project.pbxproj: Change SegmentedVector.h
2887 and Lexer.h back to internal files. Added NodeConstructors.h.
2889 * parser/Grammar.y: Added include of NodeConstructors.h.
2890 Changed use of ConstDeclNode to use public functions.
2892 * parser/NodeConstructors.h: Copied from parser/Nodes.h.
2893 Just contains the inlined constructors now.
2895 * parser/Nodes.cpp: Added include of NodeConstructors.h.
2896 Moved node constructors into the header.
2897 (JSC::FunctionBodyNode::FunctionBodyNode): Removed m_refCount
2900 * parser/Nodes.h: Removed all the constructor definitions, and also
2901 removed the JSC_FAST_CALL from them since these are all inlined, so the
2902 calling convention is irrelevant. Made more things private. Used a data
2903 member for operator opcodes instead of a virtual function. Removed the
2904 special FunctionBodyNode::ref/deref functions since the default functions
2905 are now just as fast.
2907 * runtime/FunctionConstructor.cpp:
2908 (JSC::extractFunctionBody): Fixed types here so we don't typecast until
2909 after we do type checking.
2911 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
2913 Reviewed by Ariya Hidayat.
2915 Fix the Qt build on Windows.
2917 * JavaScriptCore.pri: Define BUILDING_JavaScriptCore/WTF to get the meaning
2918 of the JS_EXPORTDATA macros correct
2920 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
2922 Reviewed by Ariya Hidayat.
2924 Enable the JIT for the Qt build on Windows.
2926 * JavaScriptCore.pri:
2928 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
2930 Reviewed by Tor Arne Vestbø.
2932 Tweak JavaScriptCore.pri for being able to override the generated sources dir for the
2933 generated_files target.
2935 * JavaScriptCore.pri:
2937 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
2939 Reviewed by Simon Hausmann.
2941 Build QtWebKit as a framework on Mac
2943 This implies both debug and release build by default, unless
2944 one of the --debug or --release config options are passed to
2945 the build-webkit script.
2947 Frameworks can be disabled by passing CONFIG+=webkit_no_framework
2948 to the build-webkit script.
2950 To be able to build both debug and release targets in parallel
2951 we have to use separate output directories for the generated
2952 sources, which is not optimal, but required to avoid race conditions.
2954 An optimization would be to only require this spit-up on Mac.
2956 * JavaScriptCore.pri:
2957 * JavaScriptCore.pro:
2960 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
2962 Reviewed by Simon Hausmann.
2964 [Qt] Use $$GENERATED_SOURCES_DIR as output when running bison
2966 A couple of the generators left the bison output file in the source
2967 tree, and then moved it into $$GENERATED_SOURCES_DIR, which did not
2968 work well when building release and debug configurations in parallel.
2970 * JavaScriptCore.pri:
2972 2009-05-05 Geoffrey Garen <ggaren@apple.com>
2974 Reviewed by Maciej Stachowiak.
2976 Simplified a bit of codegen.
2979 (JSC::JIT::privateCompileMainPass):
2981 2009-05-05 Geoffrey Garen <ggaren@apple.com>
2983 Reviewed by Cameron Zwarich.
2985 Moved all the JIT stub related code into one place.
2994 2009-05-05 Sam Weinig <sam@webkit.org>
2996 Try to fix Windows build.
2998 Move Node constructor to the .cpp file.
3003 2009-05-05 Darin Adler <darin@apple.com>
3005 Try to fix Windows build.
3007 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3008 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3010 Try to fix Mac build.
3012 * JavaScriptCore.xcodeproj/project.pbxproj: Made SegmentedVector.h private.
3014 2009-05-05 Darin Adler <darin@apple.com>
3016 Try to fix Mac build.
3018 * JavaScriptCore.xcodeproj/project.pbxproj: Made Lexer.h private.
3020 2009-05-05 Darin Adler <darin@apple.com>
3022 Reviewed by Sam Weinig.
3024 Bug 25569: make ParserRefCounted use conventional reference counting
3025 https://bugs.webkit.org/show_bug.cgi?id=25569
3027 SunSpider speedup of about 1.6%.
3029 * JavaScriptCore.exp: Updated.
3032 (JSC::NodeReleaser::releaseAllNodes): ALWAYS_INLINE.
3033 (JSC::NodeReleaser::adopt): Ditto.
3034 (JSC::ParserRefCounted::ParserRefCounted): Removed most of the code.
3035 Add the object to a Vector<RefPtr> that gets cleared after parsing.
3036 (JSC::ParserRefCounted::~ParserRefCounted): Removed most of the code.
3038 * parser/Nodes.h: Made ParserRefCounted inherit from RefCounted and
3039 made inline versions of the constructor and destructor. Made the
3040 Node constructor inline.
3042 * parser/Parser.cpp:
3043 (JSC::Parser::parse): Call globalData->parserObjects.shrink(0) after
3044 parsing, where it used to call ParserRefCounted::deleteNewObjects.
3046 * runtime/JSGlobalData.cpp:
3047 (JSC::JSGlobalData::JSGlobalData): Eliminated code to manage the
3048 newParserObjects and parserObjectExtraRefCounts.
3049 (JSC::JSGlobalData::~JSGlobalData): Ditto.
3051 * runtime/JSGlobalData.h: Replaced the HashSet and HashCountedSet
3055 (WTF::PassRefPtr::~PassRefPtr): The most common thing to do with a
3056 PassRefPtr in hot code is to pass it and then destroy it once it's
3057 set to zero. Help the optimizer by telling it that's true.
3059 2009-05-05 Xan Lopez <xlopez@igalia.com> and Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
3061 Reviewed by Oliver Hunt.
3063 Disable the NativeFunctionWrapper for all non-Mac ports for now,
3064 as it is also crashing on Linux/x86.
3066 * runtime/NativeFunctionWrapper.h:
3068 2009-05-05 Steve Falkenburg <sfalken@apple.com>
3072 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3073 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3075 2009-05-05 Oliver Hunt <oliver@apple.com>
3077 Reviewed by Maciej Stachowiak.
3079 Expose toThisObject for the DOM Window
3081 * JavaScriptCore.exp:
3083 2009-05-05 Oliver Hunt <oliver@apple.com>
3085 Reviewed by NOBODY (Make windows go again until i work out the
3086 accursed calling convention).
3088 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3090 * runtime/NativeFunctionWrapper.h:
3092 2009-05-05 Oliver Hunt <oliver@apple.com>
3094 Reviewed by NOBODY (Fix windows debug builds).
3096 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3098 2009-05-05 Oliver Hunt <oliver@apple.com>
3100 Reviewed by NOBODY (Hopefully the last fix).
3102 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3104 2009-05-05 Oliver Hunt <oliver@apple.com>
3106 Reviewed by NOBODY (Fix the build fix caused by a different build fix).
3111 2009-05-05 Oliver Hunt <oliver@apple.com>
3113 Reviewed by NOBODY (No idea how my changes could have broken these).
3115 * runtime/DatePrototype.cpp:
3116 * runtime/RegExpObject.cpp:
3118 2009-05-05 Oliver Hunt <oliver@apple.com>
3120 Reviewed by NOBODY (Why should i expect msvc to list all the errors in a file?).
3124 2009-05-05 Oliver Hunt <oliver@apple.com>
3126 Reviewed by NOBODY (Fix warning, and another missing include).
3131 2009-05-05 Oliver Hunt <oliver@apple.com>
3133 Reviewed by NOBODY (More build fixes).
3135 * runtime/ErrorPrototype.cpp:
3136 * runtime/JSGlobalObject.cpp:
3137 * runtime/NumberPrototype.cpp:
3138 * runtime/ObjectPrototype.cpp:
3139 * runtime/StringConstructor.cpp:
3141 2009-05-05 Oliver Hunt <oliver@apple.com>
3143 Reviewed by NOBODY (Will the fixes never end?).
3145 * runtime/FunctionPrototype.h:
3146 * runtime/Lookup.cpp:
3148 2009-05-05 Oliver Hunt <oliver@apple.com>
3150 Reviewed by NOBODY (More build fixes).
3154 2009-05-05 Oliver Hunt <oliver@apple.com>
3156 Reviewed by NOBODY (More build fixing).
3158 * runtime/CallData.h:
3160 2009-05-05 Oliver Hunt <oliver@apple.com>
3162 Reviewed by NOBODY (Build fix).
3164 * runtime/ArrayConstructor.cpp:
3165 * runtime/BooleanPrototype.cpp:
3166 * runtime/DateConstructor.cpp:
3167 * runtime/Error.cpp:
3168 * runtime/ObjectConstructor.cpp:
3169 * runtime/RegExpPrototype.cpp:
3171 2009-05-05 Oliver Hunt <oliver@apple.com>
3173 Reviewed by NOBODY (Buildfix).
3177 * runtime/NativeFunctionWrapper.h: Copied from JavaScriptCore/jit/ExecutableAllocator.cpp.
3179 2009-05-05 Oliver Hunt <oliver@apple.com>
3181 Reviewed by Gavin Barraclough.
3183 Bug 25559: Improve native function call performance
3184 <https://bugs.webkit.org/show_bug.cgi?id=25559>
3186 In order to cache calls to native functions we now make the standard
3187 prototype functions use a small assembly thunk that converts the JS
3188 calling convention into the native calling convention. As this is
3189 only beneficial in the JIT we use the NativeFunctionWrapper typedef
3190 to alternate between PrototypeFunction and JSFunction to keep the
3191 code sane. This change from PrototypeFunction to NativeFunctionWrapper
3192 is the bulk of this patch.
3194 * JavaScriptCore.exp:
3195 * JavaScriptCore.xcodeproj/project.pbxproj:
3196 * assembler/MacroAssemblerX86Common.h:
3197 (JSC::MacroAssemblerX86Common::call):
3198 * assembler/MacroAssemblerX86_64.h:
3199 (JSC::MacroAssemblerX86_64::addPtr):
3200 * assembler/X86Assembler.h:
3201 (JSC::X86Assembler::leaq_mr):
3202 (JSC::X86Assembler::call_m):
3203 * interpreter/Interpreter.cpp:
3204 (JSC::Interpreter::execute):
3205 (JSC::Interpreter::prepareForRepeatCall):
3207 (JSC::JIT::privateCompileCTIMachineTrampolines):
3209 (JSC::JIT::compileCTIMachineTrampolines):
3211 (JSC::JIT::linkCall):
3212 (JSC::JIT::compileOpCallInitializeCallFrame):
3213 (JSC::JIT::compileOpCall):
3215 (JSC::JITCode::operator bool):
3216 * jit/JITInlineMethods.h:
3217 (JSC::JIT::emitGetFromCallFrameHeader):
3218 (JSC::JIT::emitGetFromCallFrameHeader32):
3220 (JSC::JITStubs::JITStubs):
3221 (JSC::JITStubs::cti_op_call_JSFunction):
3222 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
3223 (JSC::JITStubs::cti_vm_lazyLinkCall):
3224 (JSC::JITStubs::cti_op_construct_JSConstruct):
3226 (JSC::JITStubs::ctiNativeCallThunk):
3228 (GlobalObject::GlobalObject):
3230 (JSC::FunctionBodyNode::FunctionBodyNode):
3231 (JSC::FunctionBodyNode::createNativeThunk):
3232 (JSC::FunctionBodyNode::generateJITCode):
3234 (JSC::FunctionBodyNode::):
3235 (JSC::FunctionBodyNode::generatedJITCode):
3236 (JSC::FunctionBodyNode::jitCode):
3237 * profiler/Profiler.cpp:
3238 (JSC::Profiler::createCallIdentifier):
3239 * runtime/ArgList.h:
3240 * runtime/ArrayPrototype.cpp:
3241 (JSC::isNumericCompareFunction):
3242 * runtime/BooleanPrototype.cpp:
3243 (JSC::BooleanPrototype::BooleanPrototype):
3244 * runtime/DateConstructor.cpp:
3245 (JSC::DateConstructor::DateConstructor):
3246 * runtime/ErrorPrototype.cpp:
3247 (JSC::ErrorPrototype::ErrorPrototype):
3248 * runtime/FunctionPrototype.cpp:
3249 (JSC::FunctionPrototype::addFunctionProperties):
3250 (JSC::functionProtoFuncToString):
3251 * runtime/FunctionPrototype.h:
3252 * runtime/JSFunction.cpp:
3253 (JSC::JSFunction::JSFunction):
3254 (JSC::JSFunction::~JSFunction):
3255 (JSC::JSFunction::mark):
3256 (JSC::JSFunction::getCallData):
3257 (JSC::JSFunction::call):
3258 (JSC::JSFunction::argumentsGetter):
3259 (JSC::JSFunction::callerGetter):
3260 (JSC::JSFunction::lengthGetter):
3261 (JSC::JSFunction::getOwnPropertySlot):
3262 (JSC::JSFunction::put):
3263 (JSC::JSFunction::deleteProperty):
3264 (JSC::JSFunction::getConstructData):
3265 (JSC::JSFunction::construct):
3266 * runtime/JSFunction.h:
3267 (JSC::JSFunction::JSFunction):
3268 (JSC::JSFunction::setScope):
3269 (JSC::JSFunction::scope):
3270 (JSC::JSFunction::isHostFunction):
3271 (JSC::JSFunction::scopeChain):
3272 (JSC::JSFunction::clearScopeChain):
3273 (JSC::JSFunction::setScopeChain):
3274 (JSC::JSFunction::nativeFunction):
3275 (JSC::JSFunction::setNativeFunction):
3276 * runtime/JSGlobalData.cpp:
3277 (JSC::JSGlobalData::~JSGlobalData):
3278 (JSC::JSGlobalData::createNativeThunk):
3279 * runtime/JSGlobalData.h:
3280 (JSC::JSGlobalData::nativeFunctionThunk):
3281 * runtime/JSGlobalObject.cpp:
3282 (JSC::JSGlobalObject::reset):
3283 * runtime/JSGlobalObject.h:
3284 * runtime/Lookup.cpp:
3285 (JSC::setUpStaticFunctionSlot):
3287 * runtime/NumberPrototype.cpp:
3288 (JSC::NumberPrototype::NumberPrototype):
3289 * runtime/ObjectPrototype.cpp:
3290 (JSC::ObjectPrototype::ObjectPrototype):
3291 * runtime/RegExpPrototype.cpp:
3292 (JSC::RegExpPrototype::RegExpPrototype):
3293 * runtime/StringConstructor.cpp:
3294 (JSC::StringConstructor::StringConstructor):
3296 2009-05-05 Gavin Barraclough <barraclough@apple.com>
3298 Reviewed by Oliver Hunt.
3300 For convenience, let the sampling flags tool clear multiple flags at once.
3303 (GlobalObject::GlobalObject):
3304 (functionSetSamplingFlags):
3305 (functionClearSamplingFlags):
3307 2009-05-04 Maciej Stachowiak <mjs@apple.com>
3309 Rubber stamped by Gavin.
3311 - inline Vector::resize for a ~1.5% speedup on string-tagcloud
3314 (WTF::Vector::resize): Inline
3316 2009-05-03 Steve Falkenburg <sfalken@apple.com>
3320 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
3322 2009-05-03 Mark Rowe <mrowe@apple.com>
3324 Fix the 64-bit build.
3329 * runtime/JSNumberCell.cpp:
3330 (JSC::jsAPIMangledNumber):
3331 * runtime/JSNumberCell.h:
3333 2009-05-02 Sam Weinig <sam@webkit.org>
3335 Roll JSC API number marshaling back in one last time (I hope).
3337 2009-05-03 Sam Weinig <sam@webkit.org>
3339 Roll JSC API number marshaling back out. It still breaks windows.
3341 2009-05-03 Sam Weinig <sam@webkit.org>
3343 Roll JSC API number marshaling back in.
3345 2009-05-02 Darin Adler <darin@apple.com>
3347 Reviewed by Maciej Stachowiak.
3349 Bug 25519: streamline lexer by handling BOMs differently
3350 https://bugs.webkit.org/show_bug.cgi?id=25519
3352 Roughly 1% faster SunSpider.
3354 * parser/Grammar.y: Tweak formatting a bit.
3357 (JSC::Lexer::Lexer): Remove unnnecessary initialization of data members
3358 that are set up by setCode.
3359 (JSC::Lexer::currentOffset): Added. Used where the old code would look at
3361 (JSC::Lexer::shift1): Replaces the old shift function. No longer does anything
3362 to handle BOM characters.
3363 (JSC::Lexer::shift2): Ditto.
3364 (JSC::Lexer::shift3): Ditto.
3365 (JSC::Lexer::shift4): Ditto.
3366 (JSC::Lexer::setCode): Updated for name change from yylineno to m_line.
3367 Removed now-unused m_eatNextIdentifier, m_stackToken, and m_restrKeyword.
3368 Replaced m_skipLF and m_skipCR with m_skipLineEnd. Replaced the old
3369 m_length with m_codeEnd and m_currentOffset with m_codeStart. Added code
3370 to scan for a BOM character and call copyCodeWithoutBOMs() if we find any.
3371 (JSC::Lexer::copyCodeWithoutBOMs): Added.
3372 (JSC::Lexer::nextLine): Updated for name change from yylineno to m_line.
3373 (JSC::Lexer::makeIdentifier): Moved up higher in the file.
3374 (JSC::Lexer::matchPunctuator): Moved up higher in the file and changed to
3375 use a switch statement instead of just if statements.
3376 (JSC::Lexer::isLineTerminator): Moved up higher in the file and changed to
3377 have fewer branches.
3378 (JSC::Lexer::lastTokenWasRestrKeyword): Added. This replaces the old
3379 m_restrKeyword boolean.
3380 (JSC::Lexer::isIdentStart): Moved up higher in the file. Changed to use
3381 fewer branches in the ASCII but not identifier case.
3382 (JSC::Lexer::isIdentPart): Ditto.
3383 (JSC::Lexer::singleEscape): Moved up higher in the file.
3384 (JSC::Lexer::convertOctal): Moved up higher in the file.
3385 (JSC::Lexer::convertHex): Moved up higher in the file. Changed to use
3386 toASCIIHexValue instead of rolling our own here.
3387 (JSC::Lexer::convertUnicode): Ditto.
3388 (JSC::Lexer::record8): Moved up higher in the file.
3389 (JSC::Lexer::record16): Moved up higher in the file.
3390 (JSC::Lexer::lex): Changed type of stringType to int. Replaced m_skipLF
3391 and m_skipCR with m_skipLineEnd, which requires fewer branches in the
3392 main lexer loop. Use currentOffset instead of m_currentOffset. Removed
3393 unneeded m_stackToken. Use isASCIIDigit instead of isDecimalDigit.
3394 Split out the two cases for InIdentifierOrKeyword and InIdentifier.
3395 Added special case tight loops for identifiers and other simple states.
3396 Removed a branch from the code that sets m_atLineStart to false using goto.
3397 Streamlined the number-handling code so we don't check for the same types
3398 twice for non-numeric cases and don't add a null to m_buffer8 when it's
3399 not being used. Removed m_eatNextIdentifier, which wasn't working anyway,
3400 and m_restrKeyword, which is redundant with m_lastToken. Set the
3401 m_delimited flag without using a branch.
3402 (JSC::Lexer::scanRegExp): Tweaked style a bit.
3403 (JSC::Lexer::clear): Clear m_codeWithoutBOMs so we don't use memory after
3404 parsing. Clear out UString objects in the more conventional way.
3405 (JSC::Lexer::sourceCode): Made this no-longer inline since it has more
3406 work to do in the case where we stripped BOMs.
3408 * parser/Lexer.h: Renamed yylineno to m_lineNumber. Removed convertHex
3409 function, which is the same as toASCIIHexValue. Removed isHexDigit
3410 function, which is the same as isASCIIHedDigit. Replaced shift with four
3411 separate shift functions. Removed isWhiteSpace function that passes
3412 m_current, instead just passing m_current explicitly. Removed isOctalDigit,
3413 which is the same as isASCIIOctalDigit. Eliminated unused arguments from
3414 matchPunctuator. Added copyCoodeWithoutBOMs and currentOffset. Moved the
3415 makeIdentifier function out of the header. Added lastTokenWasRestrKeyword
3416 function. Added new constants for m_skipLineEnd. Removed unused yycolumn,
3417 m_restrKeyword, m_skipLF, m_skipCR, m_eatNextIdentifier, m_stackToken,
3418 m_position, m_length, m_currentOffset, m_nextOffset1, m_nextOffset2,
3419 m_nextOffset3. Added m_skipLineEnd, m_codeStart, m_codeEnd, and
3422 * parser/SourceProvider.h: Added hasBOMs function. In the future this can
3423 be used to tell the lexer about strings known not to have BOMs.
3425 * runtime/JSGlobalObjectFunctions.cpp:
3426 (JSC::globalFuncUnescape): Changed to use isASCIIHexDigit.
3428 * wtf/ASCIICType.h: Added using statements to match the design of the
3431 2009-05-02 Ada Chan <adachan@apple.com>
3433 Fix windows build (when doing a clean build)
3435 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3437 2009-05-02 Geoffrey Garen <ggaren@apple.com>
3439 Reviewed by Sam Weinig.
3441 Simplified null-ish JSValues.
3443 Replaced calls to noValue() with calls to JSValue() (which is what
3444 noValue() returned). Removed noValue().
3446 Replaced almost all uses of jsImpossibleValue() with uses of JSValue().
3447 Its one remaining use is for construction of hash table deleted values.
3448 For that specific task, I made a new, private constructor with a special
3449 tag. Removed jsImpossibleValue().
3451 Removed "JSValue()" initialiazers, since default construction happens...
3454 * API/JSCallbackObjectFunctions.h:
3456 * bytecompiler/BytecodeGenerator.cpp:
3457 (JSC::BytecodeGenerator::emitLoad):
3458 * bytecompiler/BytecodeGenerator.h:
3459 * debugger/DebuggerCallFrame.cpp:
3460 (JSC::DebuggerCallFrame::evaluate):
3461 * debugger/DebuggerCallFrame.h:
3462 (JSC::DebuggerCallFrame::DebuggerCallFrame):
3463 * interpreter/CallFrame.h:
3464 (JSC::ExecState::clearException):
3465 * interpreter/Interpreter.cpp:
3466 (JSC::Interpreter::privateExecute):
3467 (JSC::Interpreter::retrieveLastCaller):
3468 * interpreter/Register.h:
3469 (JSC::Register::Register):
3471 (JSC::JIT::unlinkCall):
3472 (JSC::JIT::compileOpCallInitializeCallFrame):
3473 (JSC::JIT::compileOpCall):
3475 (JSC::JITStubs::cti_op_call_eval):
3476 (JSC::JITStubs::cti_vm_throw):
3477 * profiler/Profiler.cpp:
3478 (JSC::Profiler::willExecute):
3479 (JSC::Profiler::didExecute):
3480 * runtime/ArrayPrototype.cpp:
3482 * runtime/Completion.cpp:
3484 * runtime/Completion.h:
3485 (JSC::Completion::Completion):
3486 * runtime/GetterSetter.cpp:
3487 (JSC::GetterSetter::getPrimitiveNumber):
3488 * runtime/JSArray.cpp:
3489 (JSC::JSArray::putSlowCase):
3490 (JSC::JSArray::deleteProperty):
3491 (JSC::JSArray::increaseVectorLength):
3492 (JSC::JSArray::setLength):
3493 (JSC::JSArray::pop):
3494 (JSC::JSArray::sort):
3495 (JSC::JSArray::compactForSorting):
3496 * runtime/JSCell.cpp:
3497 (JSC::JSCell::getJSNumber):
3499 (JSC::JSValue::getJSNumber):
3500 * runtime/JSGlobalData.cpp:
3501 (JSC::JSGlobalData::JSGlobalData):
3502 * runtime/JSImmediate.h:
3503 (JSC::JSImmediate::fromNumberOutsideIntegerRange):
3504 (JSC::JSImmediate::from):
3505 * runtime/JSNumberCell.cpp:
3506 (JSC::jsNumberCell):
3507 * runtime/JSObject.cpp:
3508 (JSC::callDefaultValueFunction):
3509 * runtime/JSObject.h:
3510 (JSC::JSObject::getDirect):
3511 * runtime/JSPropertyNameIterator.cpp:
3512 (JSC::JSPropertyNameIterator::toPrimitive):
3513 * runtime/JSPropertyNameIterator.h:
3514 (JSC::JSPropertyNameIterator::next):
3515 * runtime/JSValue.h:
3517 (JSC::JSValueHashTraits::constructDeletedValue):
3518 (JSC::JSValueHashTraits::isDeletedValue):
3519 (JSC::JSValue::JSValue):
3520 * runtime/JSWrapperObject.h:
3521 (JSC::JSWrapperObject::JSWrapperObject):
3522 * runtime/Operations.h:
3524 * runtime/PropertySlot.h:
3525 (JSC::PropertySlot::clearBase):
3526 (JSC::PropertySlot::clearValue):
3528 2009-05-02 Maciej Stachowiak <mjs@apple.com>
3530 Reviewed by Cameron Zwarich.
3532 - speed up the lexer in various ways
3534 ~2% command-line SunSpider speedup
3537 (JSC::Lexer::setCode): Moved below shift() so it can inline.
3538 (JSC::Lexer::scanRegExp): Use resize(0) instead of clear() on Vectors, since the intent
3539 here is not to free the underlying buffer.
3540 (JSC::Lexer::lex): ditto; also, change the loop logic a bit for the main lexing loop
3541 to avoid branching on !m_done twice per iteration. Now we only check it once.
3542 (JSC::Lexer::shift): Make this ALWAYS_INLINE and tag an unusual branch as UNLIKELY
3544 (JSC::Lexer::makeIdentifier): force to be ALWAYS_INLINE
3546 (WTF::::append): force to be ALWAYS_INLINE (may have helped in ways other than parsing but it wasn't
3547 getting inlined in a hot code path in the lexer)
3549 2009-05-01 Steve Falkenburg <sfalken@apple.com>
3553 * JavaScriptCore.vcproj/JavaScriptCore.make:
3555 2009-05-01 Sam Weinig <sam@webkit.org>
3559 * runtime/JSNumberCell.h:
3560 (JSC::JSValue::JSValue):
3561 * runtime/JSValue.h:
3564 2009-05-01 Sam Weinig <sam@webkit.org>
3566 Roll out JavaScriptCore API number marshaling.
3573 (JSCheckScriptSyntax):
3574 * API/JSCallbackConstructor.cpp:
3575 (JSC::constructJSCallback):
3576 * API/JSCallbackFunction.cpp:
3577 (JSC::JSCallbackFunction::call):
3578 * API/JSCallbackObjectFunctions.h:
3579 (JSC::::getOwnPropertySlot):
3581 (JSC::::deleteProperty):
3583 (JSC::::hasInstance):