1 2009-12-10 Adam Barth <abarth@webkit.org>
3 No review, rolling out r51975.
4 http://trac.webkit.org/changeset/51975
7 (JSC::DEFINE_STUB_FUNCTION):
9 (JSC::JSString::JSString):
10 (JSC::JSString::appendStringInConstruct):
11 * runtime/Operations.cpp:
13 * runtime/Operations.h:
17 2009-12-10 Oliver Hunt <oliver@apple.com>
19 Reviewed by Gavin Barraclough.
21 Incorrect caching of prototype lookup with dictionary base
22 https://bugs.webkit.org/show_bug.cgi?id=32402
24 Make sure we don't add cached prototype lookup to the proto_list
25 lookup chain if the top level object is a dictionary.
28 (JSC::JITThunks::tryCacheGetByID):
30 2009-12-10 Gavin Barraclough <barraclough@apple.com>
32 Reviewed by Oliver Hunt.
34 https://bugs.webkit.org/show_bug.cgi?id=32400
35 Switch remaining cases of string addition to use ropes.
37 ~1% progression on Sunspidey.
40 (JSC::DEFINE_STUB_FUNCTION):
42 (JSC::JSString::JSString):
43 (JSC::JSString::appendStringInConstruct):
44 * runtime/Operations.cpp:
46 * runtime/Operations.h:
50 2009-12-10 Kent Hansen <kent.hansen@nokia.com>
52 Reviewed by Geoffrey Garen.
54 Remove JSObject::getPropertyAttributes() and all usage of it.
55 https://bugs.webkit.org/show_bug.cgi?id=31933
57 getOwnPropertyDescriptor() should be used instead.
60 * JavaScriptCore.order:
61 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
62 * debugger/DebuggerActivation.cpp:
63 (JSC::DebuggerActivation::getOwnPropertyDescriptor):
64 * debugger/DebuggerActivation.h:
65 * runtime/JSObject.cpp:
66 (JSC::JSObject::propertyIsEnumerable):
68 * runtime/JSVariableObject.cpp:
69 * runtime/JSVariableObject.h:
71 2009-12-10 Gavin Barraclough <barraclough@apple.com>
73 Reviewed by Oliver Hunt & Mark Rowe.
75 https://bugs.webkit.org/show_bug.cgi?id=32367
76 Add support for short Ropes (up to 3 entries) inline within JSString.
77 (rather than externally allocating an object to hold the rope).
78 Switch jsAdd of (JSString* + JSString*) to now make use of Ropes.
80 ~1% progression on Sunspidey.
82 * interpreter/Interpreter.cpp:
83 (JSC::Interpreter::privateExecute):
85 (JSC::JIT::privateCompileCTIMachineTrampolines):
87 (JSC::DEFINE_STUB_FUNCTION):
88 * runtime/JSString.cpp:
89 (JSC::JSString::resolveRope):
90 (JSC::JSString::toBoolean):
91 (JSC::JSString::getStringPropertyDescriptor):
93 (JSC::JSString::Rope::Fiber::deref):
94 (JSC::JSString::Rope::Fiber::ref):
95 (JSC::JSString::Rope::Fiber::refAndGetLength):
96 (JSC::JSString::Rope::append):
97 (JSC::JSString::JSString):
98 (JSC::JSString::~JSString):
99 (JSC::JSString::value):
100 (JSC::JSString::tryGetValue):
101 (JSC::JSString::length):
102 (JSC::JSString::canGetIndex):
103 (JSC::JSString::appendStringInConstruct):
104 (JSC::JSString::appendValueInConstructAndIncrementLength):
105 (JSC::JSString::isRope):
106 (JSC::JSString::string):
107 (JSC::JSString::ropeLength):
108 (JSC::JSString::getStringPropertySlot):
109 * runtime/Operations.h:
114 2009-12-09 Anders Carlsson <andersca@apple.com>
116 Reviewed by Geoffrey Garen.
118 Fix three more things found by compiling with clang++.
120 * runtime/Structure.h:
121 (JSC::StructureTransitionTable::reifySingleTransition):
122 Add the 'std' qualifier to the call to make_pair.
125 (WTF::initializeDates):
126 Incrementing a bool is deprecated according to the C++ specification.
129 (WTF::PtrAndFlags::PtrAndFlags):
130 Name lookup should not be done in dependent bases, so explicitly qualify the call to set.
132 2009-12-09 Maciej Stachowiak <mjs@apple.com>
134 Reviewed by Oliver Hunt.
136 Google reader gets stuck in the "Loading..." state and does not complete
137 https://bugs.webkit.org/show_bug.cgi?id=32256
138 <rdar://problem/7456388>
140 * jit/JITArithmetic.cpp:
141 (JSC::JIT::emitSlow_op_jless): Fix some backward branches.
143 2009-12-09 Gavin Barraclough <barraclough@apple.com>
145 Reviewed by Oliver Hunt.
147 https://bugs.webkit.org/show_bug.cgi?id=32228
148 Make destruction of ropes non-recursive to prevent stack exhaustion.
149 Also, pass a UString& into initializeFiber rather than a Ustring::Rep*,
150 since the Rep is not being ref counted this could result in usage of a
151 Rep with refcount zero (where the Rep comes from a temporary UString
152 returned from a function).
154 * runtime/JSString.cpp:
155 (JSC::JSString::Rope::destructNonRecursive):
156 (JSC::JSString::Rope::~Rope):
157 * runtime/JSString.h:
158 (JSC::JSString::Rope::initializeFiber):
159 * runtime/Operations.h:
160 (JSC::concatenateStrings):
162 2009-12-09 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
164 Reviewed by Eric Seidel.
166 https://bugs.webkit.org/show_bug.cgi?id=31930
168 Update to r51457. ASSERTs changed to COMPILE_ASSERTs.
171 * runtime/JSGlobalData.cpp:
172 (JSC::VPtrSet::VPtrSet):
174 2009-12-09 Steve Block <steveblock@google.com>
176 Reviewed by Adam Barth.
178 Updates Android Makefiles with latest additions.
179 https://bugs.webkit.org/show_bug.cgi?id=32278
181 * Android.mk: Modified.
182 * Android.v8.wtf.mk: Modified.
184 2009-12-09 Sam Weinig <sam@webkit.org>
186 Reviewed by Gavin Barraclough.
188 Fix a bug found while trying to compile JavaScriptCore with clang++.
190 * yarr/RegexPattern.h:
191 (JSC::Yarr::PatternTerm::PatternTerm): Don't self assign here. Use false instead.
193 2009-12-09 Anders Carlsson <andersca@apple.com>
195 Reviewed by Sam Weinig.
197 Attempt to fix the Windows build.
201 2009-12-09 Anders Carlsson <andersca@apple.com>
203 Reviewed by Sam Weinig.
205 Fix some things found while trying to compile JavaScriptCore with clang++.
208 Add correct exception specifications for the allocation/deallocation operators.
211 * wtf/VectorTraits.h:
212 Fix a bunch of struct/class mismatches.
214 2009-12-08 Maciej Stachowiak <mjs@apple.com>
216 Reviewed by Darin Adler.
218 move code generation portions of Nodes.cpp to bytecompiler directory
219 https://bugs.webkit.org/show_bug.cgi?id=32284
221 * bytecompiler/NodesCodegen.cpp: Copied from parser/Nodes.cpp. Removed parts that
222 are not about codegen.
223 * parser/Nodes.cpp: Removed everything that is about codegen.
225 Update build systems:
229 * JavaScriptCore.gypi:
230 * JavaScriptCore.pri:
231 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
232 * JavaScriptCore.xcodeproj/project.pbxproj:
233 * JavaScriptCoreSources.bkl:
235 2009-12-08 Kevin Watters <kevinwatters@gmail.com>
237 Reviewed by Kevin Ollivier.
239 [wx] Mac plugins support.
241 https://bugs.webkit.org/show_bug.cgi?id=32236
245 2009-12-08 Dmitry Titov <dimich@chromium.org>
247 Rubber-stamped by David Levin.
249 Revert and reopen "Add asserts to RefCounted to make sure ref/deref happens on the right thread."
250 It may have caused massive increase of reported leaks on the bots.
251 https://bugs.webkit.org/show_bug.cgi?id=31639
254 * JavaScriptCore.gypi:
255 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
256 * JavaScriptCore.xcodeproj/project.pbxproj:
257 * runtime/Structure.cpp:
258 (JSC::Structure::Structure):
260 (WTF::RefCountedBase::ref):
261 (WTF::RefCountedBase::hasOneRef):
262 (WTF::RefCountedBase::refCount):
263 (WTF::RefCountedBase::derefBase):
264 * wtf/ThreadVerifier.h: Removed.
266 2009-12-08 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
268 Reviewed by Darin Adler.
270 Make WebKit build correctly on FreeBSD, IA64, and Alpha.
271 Based on work by Petr Salinger <Petr.Salinger@seznam.cz>,
272 and Colin Watson <cjwatson@ubuntu.com>.
276 2009-12-08 Dmitry Titov <dimich@chromium.org>
278 Reviewed by Darin Adler.
280 Add asserts to RefCounted to make sure ref/deref happens on the right thread.
281 https://bugs.webkit.org/show_bug.cgi?id=31639
283 * runtime/Structure.cpp:
284 (JSC::Structure::Structure): Disable thread verification on this class since it uses addressOfCount().
286 (WTF::RefCountedBase::ref): Add ASSERT.
287 (WTF::RefCountedBase::hasOneRef): Ditto.
288 (WTF::RefCountedBase::refCount): Ditto.
289 (WTF::RefCountedBase::derefBase): Ditto.
290 (WTF::RefCountedBase::disableThreadVerification): delegate to ThreadVerifier method.
291 * wtf/ThreadVerifier.h: Added.
292 (WTF::ThreadVerifier::ThreadVerifier): New Debug-only class to verify that ref/deref of RefCounted is done on the same thread.
293 (WTF::ThreadVerifier::activate): Activates checks. Called when ref count becomes above 2.
294 (WTF::ThreadVerifier::deactivate): Deactivates checks. Called when ref count drops below 2.
295 (WTF::ThreadVerifier::disableThreadVerification): used on objects that should not be checked (StringImpl etc)
296 (WTF::ThreadVerifier::verifyThread):
297 * GNUmakefile.am: Add ThreadVerifier.h to the build file.
298 * JavaScriptCore.gypi: Ditto.
299 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
300 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
302 2009-12-08 Steve Block <steveblock@google.com>
304 Reviewed by Adam Barth.
306 [Android] Adds Makefiles for Android port.
307 https://bugs.webkit.org/show_bug.cgi?id=31325
310 * Android.v8.wtf.mk: Added.
312 2009-12-07 Dmitry Titov <dimich@chromium.org>
314 Rubber-stamped by Darin Adler.
316 Remove ENABLE_SHARED_SCRIPT flags
317 https://bugs.webkit.org/show_bug.cgi?id=32245
318 This patch was obtained by "git revert" command and then un-reverting of ChangeLog files.
320 * Configurations/FeatureDefines.xcconfig:
323 2009-12-07 Gavin Barraclough <barraclough@apple.com>
325 Reviewed by NOBODY (Windows build fixage part I).
327 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
329 2009-12-05 Gavin Barraclough <barraclough@apple.com>
331 Reviewed by Oliver Hunt.
333 https://bugs.webkit.org/show_bug.cgi?id=32184
334 Handle out-of-memory conditions with JSC Ropes with a JS exception, rather than crashing.
335 Switch from using fastMalloc to tryFastMalloc, pass an ExecState to record the exception on.
337 * API/JSCallbackObjectFunctions.h:
339 * API/JSValueRef.cpp:
340 (JSValueIsStrictEqual):
341 * JavaScriptCore.exp:
342 * bytecompiler/BytecodeGenerator.cpp:
343 (JSC::BytecodeGenerator::emitEqualityOp):
344 * debugger/DebuggerCallFrame.cpp:
345 (JSC::DebuggerCallFrame::functionName):
346 (JSC::DebuggerCallFrame::calculatedFunctionName):
347 * interpreter/Interpreter.cpp:
348 (JSC::Interpreter::callEval):
349 (JSC::Interpreter::privateExecute):
351 (JSC::DEFINE_STUB_FUNCTION):
352 * profiler/ProfileGenerator.cpp:
353 (JSC::ProfileGenerator::addParentForConsoleStart):
354 * profiler/Profiler.cpp:
355 (JSC::Profiler::willExecute):
356 (JSC::Profiler::didExecute):
357 (JSC::Profiler::createCallIdentifier):
358 (JSC::createCallIdentifierFromFunctionImp):
359 * profiler/Profiler.h:
360 * runtime/ArrayPrototype.cpp:
361 (JSC::arrayProtoFuncIndexOf):
362 (JSC::arrayProtoFuncLastIndexOf):
363 * runtime/DateConstructor.cpp:
364 (JSC::constructDate):
365 * runtime/FunctionPrototype.cpp:
366 (JSC::functionProtoFuncToString):
367 * runtime/InternalFunction.cpp:
368 (JSC::InternalFunction::name):
369 (JSC::InternalFunction::displayName):
370 (JSC::InternalFunction::calculatedDisplayName):
371 * runtime/InternalFunction.h:
372 * runtime/JSCell.cpp:
373 (JSC::JSCell::getString):
375 (JSC::JSValue::getString):
376 * runtime/JSONObject.cpp:
378 (JSC::Stringifier::Stringifier):
379 (JSC::Stringifier::appendStringifiedValue):
380 * runtime/JSObject.cpp:
381 (JSC::JSObject::putDirectFunction):
382 (JSC::JSObject::putDirectFunctionWithoutTransition):
383 (JSC::JSObject::defineOwnProperty):
384 * runtime/JSObject.h:
385 * runtime/JSPropertyNameIterator.cpp:
386 (JSC::JSPropertyNameIterator::get):
387 * runtime/JSString.cpp:
388 (JSC::JSString::Rope::~Rope):
389 (JSC::JSString::resolveRope):
390 (JSC::JSString::getPrimitiveNumber):
391 (JSC::JSString::toNumber):
392 (JSC::JSString::toString):
393 (JSC::JSString::toThisString):
394 (JSC::JSString::getStringPropertyDescriptor):
395 * runtime/JSString.h:
396 (JSC::JSString::Rope::createOrNull):
397 (JSC::JSString::Rope::operator new):
398 (JSC::JSString::value):
399 (JSC::JSString::tryGetValue):
400 (JSC::JSString::getIndex):
401 (JSC::JSString::getStringPropertySlot):
402 (JSC::JSValue::toString):
404 * runtime/NativeErrorConstructor.cpp:
405 (JSC::NativeErrorConstructor::NativeErrorConstructor):
406 * runtime/Operations.cpp:
407 (JSC::JSValue::strictEqualSlowCase):
408 * runtime/Operations.h:
409 (JSC::JSValue::equalSlowCaseInline):
410 (JSC::JSValue::strictEqualSlowCaseInline):
411 (JSC::JSValue::strictEqual):
415 (JSC::concatenateStrings):
416 * runtime/PropertyDescriptor.cpp:
417 (JSC::PropertyDescriptor::equalTo):
418 * runtime/PropertyDescriptor.h:
419 * runtime/StringPrototype.cpp:
420 (JSC::stringProtoFuncReplace):
421 (JSC::stringProtoFuncToLowerCase):
422 (JSC::stringProtoFuncToUpperCase):
424 2009-12-07 Nikolas Zimmermann <nzimmermann@rim.com>
426 Reviewed by Holger Freyther.
428 Turn on (SVG) Filters support, by default.
429 https://bugs.webkit.org/show_bug.cgi?id=32224
431 * Configurations/FeatureDefines.xcconfig: Enable FILTERS build flag.
433 2009-12-07 Steve Falkenburg <sfalken@apple.com>
435 Build fix. Be flexible about which version of ICU is used on Windows.
437 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Add optional xcopy commands to copy ICU 4.2.
439 2009-12-07 Maciej Stachowiak <mjs@apple.com>
441 Reviewed by Oliver Hunt.
443 op_loop_if_less JIT codegen is broken for 64-bit
444 https://bugs.webkit.org/show_bug.cgi?id=32221
446 * jit/JITOpcodes.cpp:
447 (JSC::JIT::emit_op_loop_if_false): Fix codegen in this version - test was backwards.
449 2009-12-07 Oliver Hunt <oliver@apple.com>
451 Reviewed by Maciej Stachowiak.
453 Object.create fails if properties on the descriptor are getters
454 https://bugs.webkit.org/show_bug.cgi?id=32219
456 Correctly initialise the PropertySlots with the descriptor object.
458 * runtime/ObjectConstructor.cpp:
459 (JSC::toPropertyDescriptor):
461 2009-12-06 Maciej Stachowiak <mjs@apple.com>
463 Not reviewed, build fix.
465 Actually tested 64-bit *and* 32-bit build this time.
467 * jit/JITOpcodes.cpp:
468 (JSC::JIT::emit_op_loop_if_false):
470 2009-12-06 Maciej Stachowiak <mjs@apple.com>
472 Not reviewed, build fix.
474 Really really fix 64-bit build for prior patch (actually tested this time).
476 * jit/JITOpcodes.cpp:
477 (JSC::JIT::emit_op_loop_if_false):
478 (JSC::JIT::emitSlow_op_loop_if_false):
480 2009-12-06 Maciej Stachowiak <mjs@apple.com>
482 Not reviewed, build fix.
484 Really fix 64-bit build for prior patch.
486 * jit/JITArithmetic.cpp:
487 (JSC::JIT::emitSlow_op_jless):
489 2009-12-06 Maciej Stachowiak <mjs@apple.com>
491 Not reviewed, build fix.
493 Fix 64-bit build for prior patch.
495 * jit/JITOpcodes.cpp:
496 (JSC::JIT::emitSlow_op_loop_if_less):
498 2009-12-05 Maciej Stachowiak <mjs@apple.com>
500 Reviewed by Oliver Hunt.
502 conway benchmark spends half it's time in op_less (jump fusion fails)
503 https://bugs.webkit.org/show_bug.cgi?id=32190
505 <1% speedup on SunSpider and V8
506 2x speedup on "conway" benchmark
509 1) Improve codegen for logical operators &&, || and ! in a condition context
511 When generating code for combinations of &&, || and !, in a
512 condition context (i.e. in an if statement or loop condition), we
513 used to produce a value, and then separately jump based on its
514 truthiness. Now we pass the false and true targets in, and let the
515 logical operators generate jumps directly. This helps in four
518 a) Individual clauses of a short-circuit logical operator can now
519 jump directly to the then or else clause of an if statement (or to
520 the top or exit of a loop) instead of jumping to a jump.
522 b) It used to be that jump fusion with the condition of the first
523 clause of a logical operator was inhibited, because the register
524 was ref'd to be used later, in the actual condition jump; this no
525 longer happens since a jump straight to the final target is
528 c) It used to be that jump fusion with the condition of the second
529 clause of a logical operator was inhibited, because there was a
530 jump target right after the second clause and before the actual
531 condition jump. But now it's no longer necessary for the first
532 clause to jump there so jump fusion is not blocked.
534 d) We avoid generating excess mov statements in some cases.
536 As a concrete example this source:
538 if (!((x < q && y < q) || (t < q && z < q))) {
542 Used to generate this bytecode:
544 [ 34] less r1, r-15, r-19
545 [ 38] jfalse r1, 7(->45)
546 [ 41] less r1, r-16, r-19
547 [ 45] jtrue r1, 14(->59)
548 [ 48] less r1, r-17, r-19
549 [ 52] jfalse r1, 7(->59)
550 [ 55] less r1, r-18, r-19
551 [ 59] jtrue r1, 17(->76)
553 And now generates this bytecode (also taking advantage of the second optimization below):
555 [ 34] jnless r-15, r-19, 8(->42)
556 [ 38] jless r-16, r-19, 26(->64)
557 [ 42] jnless r-17, r-19, 8(->50)
558 [ 46] jless r-18, r-19, 18(->64)
560 Note the jump fusion and the fact that there's less jump
561 indirection - three of the four jumps go straight to the target
562 clause instead of indirecting through another jump.
564 2) Implement jless opcode to take advantage of the above, since we'll now often generate
565 a less followed by a jtrue where fusion is not forbidden.
568 (JSC::ExpressionNode::hasConditionContextCodegen): Helper function to determine
569 whether a node supports special conditional codegen. Return false as this is the default.
570 (JSC::ExpressionNode::emitBytecodeInConditionContext): Assert not reached - only really
571 defined for nodes that do have conditional codegen.
572 (JSC::UnaryOpNode::expr): Add const version.
573 (JSC::LogicalNotNode::hasConditionContextCodegen): Returne true only if subexpression
575 (JSC::LogicalOpNode::hasConditionContextCodegen): Return true.
577 (JSC::LogicalNotNode::emitBytecodeInConditionContext): Implemented - just swap
578 the true and false targets for the child node.
579 (JSC::LogicalOpNode::emitBytecodeInConditionContext): Implemented - handle jumps
580 directly, improving codegen quality. Also handles further nested conditional codegen.
581 (JSC::ConditionalNode::emitBytecode): Use condition context codegen when available.
582 (JSC::IfNode::emitBytecode): ditto
583 (JSC::IfElseNode::emitBytecode): ditto
584 (JSC::DoWhileNode::emitBytecode): ditto
585 (JSC::WhileNode::emitBytecode): ditto
586 (JSC::ForNode::emitBytecode): ditto
589 - Added loop_if_false opcode - needed now that falsey jumps can be backwards.
590 - Added jless opcode to take advantage of new fusion opportunities.
591 * bytecode/CodeBlock.cpp:
592 (JSC::CodeBlock::dump): Handle above.
593 * bytecompiler/BytecodeGenerator.cpp:
594 (JSC::BytecodeGenerator::emitJumpIfTrue): Add peephole for less + jtrue ==> jless.
595 (JSC::BytecodeGenerator::emitJumpIfFalse): Add handling of backwrds falsey jumps.
596 * bytecompiler/BytecodeGenerator.h:
597 (JSC::BytecodeGenerator::emitNodeInConditionContext): Wrapper to handle tracking of
598 overly deep expressions etc.
599 * interpreter/Interpreter.cpp:
600 (JSC::Interpreter::privateExecute): Implement the two new opcodes (loop_if_false, jless).
602 (JSC::JIT::privateCompileMainPass): Implement JIT support for the two new opcodes.
603 (JSC::JIT::privateCompileSlowCases): ditto
605 * jit/JITArithmetic.cpp:
606 (JSC::JIT::emit_op_jless):
607 (JSC::JIT::emitSlow_op_jless): ditto
608 (JSC::JIT::emitBinaryDoubleOp): ditto
609 * jit/JITOpcodes.cpp:
610 (JSC::JIT::emitSlow_op_loop_if_less): ditto
611 (JSC::JIT::emit_op_loop_if_false): ditto
612 (JSC::JIT::emitSlow_op_loop_if_false): ditto
617 2009-12-04 Kent Hansen <kent.hansen@nokia.com>
619 Reviewed by Darin Adler.
621 JavaScript delete operator should return false for string properties
622 https://bugs.webkit.org/show_bug.cgi?id=32012
624 * runtime/StringObject.cpp:
625 (JSC::StringObject::deleteProperty):
627 2009-12-03 Drew Wilson <atwilson@chromium.org>
629 Rolled back r51633 because it causes a perf regression in Chromium.
633 2009-12-03 Gavin Barraclough <barraclough@apple.com>
635 Try and fix the Windows build.
637 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a symbol that should be exported.
639 2009-12-03 Mark Rowe <mrowe@apple.com>
641 Try and fix the Mac build.
643 * JavaScriptCore.exp: Export a symbol that should be exported.
645 2009-12-03 Oliver Hunt <oliver@apple.com>
647 Reviewed by Gavin Barraclough.
649 REGRESSION(4.0.3-48777): Crash in JSC::ExecState::propertyNames() (Debug-only?)
650 https://bugs.webkit.org/show_bug.cgi?id=32133
652 Work around odd GCC-ism and correct the scopechain for use by
653 calls made while a cachedcall is active on the callstack.
655 * interpreter/CachedCall.h:
656 (JSC::CachedCall::newCallFrame):
657 * runtime/JSArray.cpp:
658 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
659 * runtime/StringPrototype.cpp:
660 (JSC::stringProtoFuncReplace):
662 2009-12-03 Gavin Barraclough <barraclough@apple.com>
664 Reviewed by Oliver "Brraaaaiiiinnnnnzzzzzzzz" Hunt.
666 https://bugs.webkit.org/show_bug.cgi?id=32136
667 Add a rope representation to JSString. Presently JSString always holds its data in UString form.
668 Instead, allow the result of a string concatenation to be represented in a tree form - with a
669 variable sized, reference-counted rope node retaining a set of UString::Reps (or other rope nopes).
671 Strings must still currently be resolved down to a flat UString representation before being used,
672 but by holding the string in a rope representation during construction we can avoid copying data
673 until we know the final size of the string.
675 ~2% progression on SunSpider (~25% on date-format-xparb, ~20% on string-validate-input).
677 * JavaScriptCore.exp:
681 * interpreter/Interpreter.cpp:
682 (JSC::Interpreter::privateExecute):
684 - Make use of new JSString::length() method to avoid prematurely resolving ropes.
686 * jit/JITOpcodes.cpp:
687 (JSC::JIT::privateCompileCTIMachineTrampolines):
689 - Switch the string length trampoline to read the length directly from JSString::m_length,
690 rather than from the JSString's UString::Rep's 'len' property.
693 (JSC::DEFINE_STUB_FUNCTION):
695 - Modify op_add such that addition of two strings, where either or both strings are already
696 in rope representation, produces a rope as a result.
698 * runtime/JSString.cpp:
699 (JSC::JSString::Rope::~Rope):
701 (JSC::JSString::resolveRope):
702 (JSC::JSString::getPrimitiveNumber):
703 (JSC::JSString::toBoolean):
704 (JSC::JSString::toNumber):
705 (JSC::JSString::toString):
706 (JSC::JSString::toThisString):
707 (JSC::JSString::getStringPropertyDescriptor):
708 * runtime/JSString.h:
709 (JSC::JSString::Rope::Fiber::Fiber):
710 (JSC::JSString::Rope::Fiber::destroy):
711 (JSC::JSString::Rope::Fiber::isRope):
712 (JSC::JSString::Rope::Fiber::rope):
713 (JSC::JSString::Rope::Fiber::string):
714 (JSC::JSString::Rope::create):
715 (JSC::JSString::Rope::initializeFiber):
716 (JSC::JSString::Rope::ropeLength):
717 (JSC::JSString::Rope::stringLength):
718 (JSC::JSString::Rope::fibers):
719 (JSC::JSString::Rope::Rope):
720 (JSC::JSString::Rope::operator new):
721 (JSC::JSString::JSString):
722 (JSC::JSString::value):
723 (JSC::JSString::length):
724 (JSC::JSString::isRope):
725 (JSC::JSString::rope):
726 (JSC::JSString::string):
727 (JSC::JSString::canGetIndex):
728 (JSC::jsSingleCharacterSubstring):
729 (JSC::JSString::getIndex):
731 (JSC::JSString::getStringPropertySlot):
735 * runtime/Operations.h:
737 (JSC::concatenateStrings):
739 - Update string concatenation, and addition of ropes, to produce ropes.
741 * runtime/StringObject.cpp:
742 (JSC::StringObject::getOwnPropertyNames):
744 - Make use of new JSString::length() method to avoid prematurely resolving ropes.
746 2009-11-23 Jeremy Moskovich <jeremy@chromium.org>
748 Reviewed by Eric Seidel.
750 Switch Chrome/Mac to use Core Text APIs rather than ATSUI APIs.
751 https://bugs.webkit.org/show_bug.cgi?id=31802
753 No test since this is already covered by existing pixel tests.
755 * wtf/Platform.h: #define USE_CORE_TEXT for Chrome/Mac.
757 2009-12-02 Oliver Hunt <oliver@apple.com>
759 Reviewed by Gavin Barraclough.
761 Add files missed in prior patch.
763 * runtime/JSZombie.cpp:
765 (JSC::JSZombie::leakedZombieStructure):
766 * runtime/JSZombie.h: Added.
767 (JSC::JSZombie::JSZombie):
768 (JSC::JSZombie::isZombie):
769 (JSC::JSZombie::classInfo):
770 (JSC::JSZombie::isGetterSetter):
771 (JSC::JSZombie::isAPIValueWrapper):
772 (JSC::JSZombie::isPropertyNameIterator):
773 (JSC::JSZombie::getCallData):
774 (JSC::JSZombie::getConstructData):
775 (JSC::JSZombie::getUInt32):
776 (JSC::JSZombie::toPrimitive):
777 (JSC::JSZombie::getPrimitiveNumber):
778 (JSC::JSZombie::toBoolean):
779 (JSC::JSZombie::toNumber):
780 (JSC::JSZombie::toString):
781 (JSC::JSZombie::toObject):
782 (JSC::JSZombie::markChildren):
783 (JSC::JSZombie::put):
784 (JSC::JSZombie::deleteProperty):
785 (JSC::JSZombie::toThisObject):
786 (JSC::JSZombie::toThisString):
787 (JSC::JSZombie::toThisJSString):
788 (JSC::JSZombie::getJSNumber):
789 (JSC::JSZombie::getOwnPropertySlot):
791 2009-12-02 Oliver Hunt <oliver@apple.com>
793 Reviewed by Gavin Barraclough.
796 https://bugs.webkit.org/show_bug.cgi?id=32103
798 Add a compile time flag to make the JSC collector replace "unreachable"
799 objects with zombie objects. The zombie object is a JSCell subclass that
800 ASSERTs on any attempt to use the JSCell methods. In addition there are
801 a number of additional assertions in bottleneck code to catch zombie usage
802 as quickly as possible.
806 * JavaScriptCore.xcodeproj/project.pbxproj:
807 * interpreter/Register.h:
808 (JSC::Register::Register):
810 (JSC::MarkedArgumentBuffer::append):
811 (JSC::ArgList::ArgList):
812 * runtime/Collector.cpp:
813 (JSC::Heap::destroy):
815 * runtime/Collector.h:
817 (JSC::JSCell::isZombie):
818 (JSC::JSValue::isZombie):
820 (JSC::JSValue::decode):
821 (JSC::JSValue::JSValue):
824 2009-12-01 Jens Alfke <snej@chromium.org>
826 Reviewed by Darin Adler.
828 Added variants of find/contains/add that allow a foreign key type to be used.
829 This will allow AtomicString-keyed maps to be queried by C string without
830 having to create a temporary AtomicString (see HTTPHeaderMap.)
831 The code for this is adapted from the equivalent in HashSet.h.
834 (WTF::HashMap::find):
835 (WTF::HashMap::contains):
837 * wtf/HashSet.h: Changed "method" to "function member" in a comment.
839 2009-12-01 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
841 Revert 51551 because it broke GTK+.
845 2009-11-30 Gavin Barraclough <barraclough@apple.com>
847 Windows Build fix. Reviewed by NOBODY.
849 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
851 2009-11-24 Gavin Barraclough <barraclough@apple.com>
853 Reviewed by Geoff Garen.
855 Bug 31859 - Make world selection for JSC IsolatedWorlds automagical.
857 WebCore presently has to explicitly specify the world before entering into JSC,
858 which is a little fragile (particularly since property access via a
859 getter/setter might invoke execution). Instead derive the current world from
860 the lexical global object.
862 Remove the temporary duct tape of willExecute/didExecute virtual hooks on the JSGlobalData::ClientData - these are no longer necessary.
866 * API/JSObjectRef.cpp:
867 (JSObjectCallAsFunction):
868 * JavaScriptCore.exp:
869 * runtime/JSGlobalData.cpp:
870 * runtime/JSGlobalData.h:
872 2009-11-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
874 Reviewed by Kenneth Rohde Christiansen.
876 [Qt] Remove obsolete PLATFORM(KDE) code
877 https://bugs.webkit.org/show_bug.cgi?id=31958
879 KDE is now using unpatched QtWebKit.
881 * parser/Lexer.cpp: Remove obsolete KDE_USE_FINAL guard
882 * wtf/Platform.h: Remove PLATFORM(KDE) definition and code
883 section that is guarded with it.
885 2009-11-30 Jan-Arve Sæther <jan-arve.saether@nokia.com>
887 Reviewed by Simon Hausmann.
889 [Qt] Fix compilation with win32-icc
891 The Intel compiler does not support the __has_trivial_constructor type
892 trait. The Intel Compiler can report itself as _MSC_VER >= 1400. The
893 reason for that is that the Intel Compiler depends on the Microsoft
894 Platform SDK, and in order to try to be "fully" MS compatible it will
895 "pretend" to be the same MS compiler as was shipped with the MS PSDK.
896 (Thus, compiling with win32-icc with VC8 SDK will make the source code
897 "think" the compiler at hand supports this type trait).
901 2009-11-29 Laszlo Gombos <laszlo.1.gombos@nokia.com>
903 Reviewed by Eric Seidel.
905 [Qt] Mac build has JIT disabled
906 https://bugs.webkit.org/show_bug.cgi?id=31828
908 * wtf/Platform.h: Enable JIT for Qt Mac builds
910 2009-11-28 Laszlo Gombos <laszlo.1.gombos@nokia.com>
912 Reviewed by Eric Seidel.
914 Apply workaround for the limitation of VirtualFree with MEM_RELEASE to all ports running on Windows
915 https://bugs.webkit.org/show_bug.cgi?id=31943
917 * runtime/MarkStack.h:
918 (JSC::MarkStack::MarkStackArray::shrinkAllocation):
920 2009-11-28 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
922 Reviewed by Gavin Barraclough.
924 https://bugs.webkit.org/show_bug.cgi?id=31930
926 Seems a typo. We don't need ~270k memory to determine the vptrs.
928 * runtime/JSGlobalData.cpp:
929 (JSC::VPtrSet::VPtrSet):
931 2009-11-27 Shinichiro Hamaji <hamaji@chromium.org>
935 Move GOwnPtr* from wtf to wtf/gtk
936 https://bugs.webkit.org/show_bug.cgi?id=31793
938 Build fix for chromium after r51423.
939 Exclude gtk directory from chromium build.
941 * JavaScriptCore.gyp/JavaScriptCore.gyp:
943 2009-11-25 Oliver Hunt <oliver@apple.com>
945 Reviewed by Gavin Barraclough.
947 Incorrect behaviour of jneq_null in the interpreter
948 https://bugs.webkit.org/show_bug.cgi?id=31901
950 Correct the logic of jneq_null. This is already covered by existing tests.
952 * interpreter/Interpreter.cpp:
953 (JSC::Interpreter::privateExecute):
955 2009-11-26 Laszlo Gombos <laszlo.1.gombos@nokia.com>
957 Reviewed by Oliver Hunt.
959 Move GOwnPtr* from wtf to wtf/gtk
960 https://bugs.webkit.org/show_bug.cgi?id=31793
962 * GNUmakefile.am: Change the path for GOwnPtr.*.
963 * JavaScriptCore.gyp/JavaScriptCore.gyp: Remove
964 GOwnPtr.cpp from the exclude list.
965 * JavaScriptCore.gypi: Change the path for GOwnPtr.*.
966 * wscript: Remove GOwnPtr.cpp from the exclude list.
967 * wtf/GOwnPtr.cpp: Removed.
968 * wtf/GOwnPtr.h: Removed.
969 * wtf/Threading.h: Change the path for GOwnPtr.h.
970 * wtf/gtk/GOwnPtr.cpp: Copied from JavaScriptCore/wtf/GOwnPtr.cpp.
971 * wtf/gtk/GOwnPtr.h: Copied from JavaScriptCore/wtf/GOwnPtr.h.
972 * wtf/unicode/glib/UnicodeGLib.h: Change the path for GOwnPtr.h.
974 2009-11-24 Dmitry Titov <dimich@chromium.org>
976 Reviewed by Eric Seidel.
978 Add ENABLE_SHARED_SCRIPT feature define and flag for build-webkit
979 https://bugs.webkit.org/show_bug.cgi?id=31444
981 * Configurations/FeatureDefines.xcconfig:
984 2009-11-24 Chris Marrin <cmarrin@apple.com>
986 Reviewed by Simon Fraser.
988 Add ability to enable ACCELERATED_COMPOSITING on Windows (currently disabled)
989 https://bugs.webkit.org/show_bug.cgi?id=27314
993 2009-11-24 Jason Smith <dark.panda@gmail.com>
995 Reviewed by Alexey Proskuryakov.
997 RegExp#exec's returned Array-like object behaves differently from
999 https://bugs.webkit.org/show_bug.cgi?id=31689
1001 * JavaScriptCore/runtime/RegExpConstructor.cpp: ensure that undefined
1002 values are added to the returned RegExpMatchesArray
1004 2009-11-24 Oliver Hunt <oliver@apple.com>
1006 Reviewed by Alexey Proskuryakov.
1008 JSON.stringify performance on undefined is very poor
1009 https://bugs.webkit.org/show_bug.cgi?id=31839
1011 Switch from a UString to a Vector<UChar> when building
1012 the JSON string, allowing us to safely remove the substr-copy
1013 we otherwise did when unwinding an undefined property.
1015 Also turns out to be a ~5% speedup on stringification.
1017 * runtime/JSONObject.cpp:
1018 (JSC::Stringifier::StringBuilder::append):
1019 (JSC::Stringifier::stringify):
1020 (JSC::Stringifier::Holder::appendNextProperty):
1022 2009-11-24 Mark Rowe <mrowe@apple.com>
1024 Fix production builds where the source tree may be read-only.
1026 * JavaScriptCore.xcodeproj/project.pbxproj:
1028 2009-11-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1030 Reviewed by Kenneth Rohde Christiansen.
1032 Include "config.h" to meet Coding Style Guidelines
1033 https://bugs.webkit.org/show_bug.cgi?id=31792
1035 * wtf/unicode/UTF8.cpp:
1036 * wtf/unicode/glib/UnicodeGLib.cpp:
1037 * wtf/unicode/wince/UnicodeWince.cpp:
1039 2009-11-23 Geoffrey Garen <ggaren@apple.com>
1041 Reviewed by Oliver Hunt.
1043 Streamlined some Math functions where we expect or know the result not
1044 to be representable as an int.
1046 SunSpider says 0.6% faster.
1048 * runtime/JSNumberCell.h:
1049 (JSC::JSValue::JSValue):
1050 * runtime/JSValue.h:
1052 (JSC::jsDoubleNumber):
1053 (JSC::JSValue::JSValue): Added a function for making a numeric JSValue
1054 and skipping the "can I encode this as an int?" check, avoiding the
1055 overhead of int <-> double roundtripping and double <-> double comparison
1058 * runtime/MathObject.cpp:
1059 (JSC::mathProtoFuncACos):
1060 (JSC::mathProtoFuncASin):
1061 (JSC::mathProtoFuncATan):
1062 (JSC::mathProtoFuncATan2):
1063 (JSC::mathProtoFuncCos):
1064 (JSC::mathProtoFuncExp):
1065 (JSC::mathProtoFuncLog):
1066 (JSC::mathProtoFuncRandom):
1067 (JSC::mathProtoFuncSin):
1068 (JSC::mathProtoFuncSqrt):
1069 (JSC::mathProtoFuncTan): For these functions, which we expect or know
1070 to produce results not representable as ints, call jsDoubleNumber instead
1073 2009-11-23 Mark Rowe <mrowe@apple.com>
1075 Unreviewed. Unbreak the regression tests after r51329.
1078 (JSEvaluateScript): Null-check clientData before dereferencing it.
1079 * API/JSObjectRef.cpp:
1080 (JSObjectCallAsFunction): Ditto.
1082 2009-11-23 Gavin Barraclough <barraclough@apple.com>
1084 Reviewed by Geoff Garen.
1086 Part 1/3 of <rdar://problem/7377477> REGRESSION: Many web pages fail to render after interesting script runs in isolated world
1088 Some clients of the JavaScriptCore API expect to be able to make callbacks over the JSC API,
1089 and for this to automagically cause execution to take place in the world associated with the
1090 global object associated with the ExecState (JSContextRef) passed. However this is not how
1091 things work - the world must be explicitly set within WebCore.
1093 Making this work just for API calls to evaluate & call will be a far from perfect solution,
1094 since direct (non-API) use of JSC still relies on WebCore setting the current world correctly.
1095 A better solution would be to make this all work automagically all throughout WebCore, but this
1096 will require more refactoring.
1098 Since the API is in JSC but worlds only exist in WebCore, add callbacks on the JSGlobalData::ClientData
1099 to allow it to update the current world on entry/exit via the JSC API. This is temporary duck
1100 tape, and should be removed once the current world no longer needs to be explicitly tracked.
1104 * API/JSObjectRef.cpp:
1105 (JSObjectCallAsFunction):
1106 * JavaScriptCore.exp:
1107 * runtime/JSGlobalData.cpp:
1108 (JSC::JSGlobalData::ClientData::beginningExecution):
1109 (JSC::JSGlobalData::ClientData::completedExecution):
1110 * runtime/JSGlobalData.h:
1112 2009-11-23 Steve Block <steveblock@google.com>
1114 Reviewed by Dmitry Titov.
1116 Adds MainThreadAndroid.cpp with Android-specific WTF threading functions.
1117 https://bugs.webkit.org/show_bug.cgi?id=31807
1119 * wtf/android: Added.
1120 * wtf/android/MainThreadAndroid.cpp: Added.
1121 (WTF::timeoutFired):
1122 (WTF::initializeMainThreadPlatform):
1123 (WTF::scheduleDispatchFunctionsOnMainThread):
1125 2009-11-23 Alexey Proskuryakov <ap@apple.com>
1127 Reviewed by Brady Eidson.
1129 https://bugs.webkit.org/show_bug.cgi?id=31748
1130 Make WebSocketHandleCFNet respect proxy auto-configuration files via CFProxySupport
1132 * JavaScriptCore.exp: Export callOnMainThreadAndWait.
1134 2009-11-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1136 Reviewed by Kenneth Rohde Christiansen.
1138 [Symbian] Fix lastIndexOf() for Symbian
1139 https://bugs.webkit.org/show_bug.cgi?id=31773
1141 Symbian soft floating point library has problems with operators
1142 comparing NaN to numbers. Without a workaround lastIndexOf()
1143 function does not work.
1145 Patch developed by David Leong.
1147 * runtime/StringPrototype.cpp:
1148 (JSC::stringProtoFuncLastIndexOf):Add an extra test
1149 to check for NaN for Symbian.
1151 2009-11-23 Steve Block <steveblock@google.com>
1153 Reviewed by Eric Seidel.
1155 Android port lacks implementation of atomicIncrement and atomicDecrement.
1156 https://bugs.webkit.org/show_bug.cgi?id=31715
1158 * wtf/Threading.h: Modified.
1159 (WTF::atomicIncrement): Added Android implementation.
1160 (WTF::atomicDecrement): Added Android implementation.
1162 2009-11-22 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1166 [Qt] Sort source lists and remove obsolete comments
1167 from the build system.
1169 * JavaScriptCore.pri:
1171 2009-11-21 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1173 Reviewed by Eric Seidel.
1175 [Qt][Mac] Turn on multiple JavaScript threads for QtWebkit on Mac
1176 https://bugs.webkit.org/show_bug.cgi?id=31753
1180 2009-11-19 Steve Block <steveblock@google.com>
1182 Android port lacks configuration in Platform.h and config.h.
1183 https://bugs.webkit.org/show_bug.cgi?id=31671
1185 * wtf/Platform.h: Modified. Added Android-specific configuration.
1187 2009-11-19 Alexey Proskuryakov <ap@apple.com>
1189 Reviewed by Darin Adler.
1191 https://bugs.webkit.org/show_bug.cgi?id=31690
1192 Make SocketStreamHandleCFNet work on Windows
1194 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1195 * wtf/MainThread.cpp:
1196 (WTF::FunctionWithContext::FunctionWithContext):
1197 (WTF::dispatchFunctionsFromMainThread):
1198 (WTF::callOnMainThreadAndWait):
1200 Re-add callOnMainThreadAndWait(), which was removed in bug 23926.
1202 2009-11-19 Dmitry Titov <dimich@chromium.org>
1204 Reviewed by David Levin.
1206 isMainThread() on Chromium (Mac and Linux) is so slow it timeouts LayoutTests..
1207 https://bugs.webkit.org/show_bug.cgi?id=31693
1209 * wtf/ThreadingPthreads.cpp:
1210 (WTF::initializeThreading): grab and use the pthread_t of the main thread instead of ThreadIdentifier.
1211 (WTF::isMainThread): Ditto.
1213 2009-11-19 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1215 Reviewed by Darin Adler.
1217 Remove HAVE(STRING_H) guard from JavaScriptCore
1218 https://bugs.webkit.org/show_bug.cgi?id=31668
1221 * runtime/UString.cpp:
1223 2009-11-19 Dumitru Daniliuc <dumi@chromium.org>
1225 Reviewed by Dmitry Titov.
1227 Fixing a bug in MessageQueue::removeIf() that leads to an
1230 https://bugs.webkit.org/show_bug.cgi?id=31657
1232 * wtf/MessageQueue.h:
1233 (WTF::MessageQueue::removeIf):
1235 2009-11-19 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1237 Reviewed by Darin Adler.
1239 Remove HAVE(FLOAT_H) guard
1240 https://bugs.webkit.org/show_bug.cgi?id=31661
1242 JavaScriptCore has a dependency on float.h, there is
1243 no need to guard float.h.
1245 * runtime/DatePrototype.cpp: Remove include directive
1246 for float.h as it is included in MathExtras.h already.
1247 * runtime/Operations.cpp: Ditto.
1248 * runtime/UString.cpp: Ditto.
1249 * wtf/dtoa.cpp: Ditto.
1250 * wtf/MathExtras.h: Remove HAVE(FLOAT_H) guard.
1251 * wtf/Platform.h: Ditto.
1253 2009-11-19 Thiago Macieira <thiago.macieira@nokia.com>
1255 Reviewed by Simon Hausmann.
1257 Build fix for 32-bit Sparc machines: these machines are big-endian.
1261 2009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1263 Reviewed by Kenneth Rohde Christiansen.
1265 [Qt] Remove support for Qt v4.3 or older versions
1266 https://bugs.webkit.org/show_bug.cgi?id=29469
1268 * JavaScriptCore.pro:
1270 * wtf/unicode/qt4/UnicodeQt4.h:
1272 2009-11-18 Kent Tamura <tkent@chromium.org>
1274 Reviewed by Darin Adler.
1276 Move UString::from(double) implementation to new
1277 WTF::doubleToStringInJavaScriptFormat(), and expose it because WebCore
1279 https://bugs.webkit.org/show_bug.cgi?id=31330
1281 - Introduce new function createRep(const char*, unsigned) and
1282 UString::UString(const char*, unsigned) to reduce 2 calls to strlen().
1283 - Fix a bug that dtoa() doesn't update *rve if the input value is NaN
1286 No new tests because this doesn't change the behavior.
1288 * JavaScriptCore.exp:
1289 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1290 * runtime/UString.cpp:
1292 (JSC::UString::UString):
1293 (JSC::UString::from): Move the code to doubleToStringInJavaScriptFormat().
1294 * runtime/UString.h:
1296 (WTF::dtoa): Fix a bug about rve.
1297 (WTF::append): A helper for doubleToStringInJavaScriptFormat().
1298 (WTF::doubleToStringInJavaScriptFormat): Move the code from UString::from(double).
1301 2009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1303 Reviewed by Kenneth Rohde Christiansen.
1305 [Qt] Remove WTF_USE_JAVASCRIPTCORE_BINDINGS as it is no longer used
1306 https://bugs.webkit.org/show_bug.cgi?id=31643
1308 * JavaScriptCore.pro:
1310 2009-11-18 Nate Chapin <japhet@chromium.org>
1312 Reviewed by Darin Fisher.
1314 Remove Chromium's unnecessary dependency on wtf's tcmalloc files.
1316 https://bugs.webkit.org/show_bug.cgi?id=31648
1318 * JavaScriptCore.gyp/JavaScriptCore.gyp:
1320 2009-11-18 Thiago Macieira <thiago.macieira@nokia.com>
1322 Reviewed by Gavin Barraclough.
1324 [Qt] Implement symbol hiding for JSC's JIT functions.
1326 These functions are implemented directly in assembly, so they need the
1327 proper directives to enable/disable visibility. On ELF systems, it's
1328 .hidden, whereas on Mach-O systems (Mac) it's .private_extern. On
1329 Windows, it's not necessary since you have to explicitly export. I
1330 also implemented the AIX idiom, though it's unlikely anyone will
1331 implement AIX/POWER JIT.
1332 https://bugs.webkit.org/show_bug.cgi?id=30864
1336 2009-11-18 Oliver Hunt <oliver@apple.com>
1338 Reviewed by Alexey Proskuryakov.
1340 Interpreter may do an out of range access when throwing an exception in the profiler.
1341 https://bugs.webkit.org/show_bug.cgi?id=31635
1345 * interpreter/Interpreter.cpp:
1346 (JSC::Interpreter::throwException):
1348 2009-11-18 Gabor Loki <loki@inf.u-szeged.hu>
1350 Reviewed by Darin Adler.
1352 Fix the clobber list of cacheFlush for ARM and Thumb2 on Linux
1353 https://bugs.webkit.org/show_bug.cgi?id=31631
1355 * jit/ExecutableAllocator.h:
1356 (JSC::ExecutableAllocator::cacheFlush):
1358 2009-11-18 Harald Fernengel <harald.fernengel@nokia.com>
1360 Reviewed by Simon Hausmann.
1362 [Qt] Fix detection of linux-g++
1364 Never use "linux-g++*" to check for linux-g++, since this will break embedded
1365 builds which use linux-arm-g++ and friends. Use 'linux*-g++*' to check for any
1366 g++ on linux mkspec.
1368 * JavaScriptCore.pri:
1370 2009-11-17 Jon Honeycutt <jhoneycutt@apple.com>
1372 Add JSContextRefPrivate.h to list of copied files.
1374 Reviewed by Mark Rowe.
1376 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
1378 2009-11-17 Martin Robinson <martin.james.robinson@gmail.com>
1380 Reviewed by Adam Barth.
1382 [GTK] Style cleanup for GOwnPtr
1383 https://bugs.webkit.org/show_bug.cgi?id=31506
1385 Remove forward declaration in GOwnPtr and do some style cleanup.
1389 (WTF::GOwnPtr::GOwnPtr):
1390 (WTF::GOwnPtr::~GOwnPtr):
1391 (WTF::GOwnPtr::get):
1392 (WTF::GOwnPtr::release):
1393 (WTF::GOwnPtr::outPtr):
1394 (WTF::GOwnPtr::set):
1395 (WTF::GOwnPtr::clear):
1396 (WTF::GOwnPtr::operator*):
1397 (WTF::GOwnPtr::operator->):
1398 (WTF::GOwnPtr::operator!):
1399 (WTF::GOwnPtr::operator UnspecifiedBoolType):
1400 (WTF::GOwnPtr::swap):
1405 (WTF::freeOwnedGPtr):
1407 2009-11-17 Oliver Hunt <oliver@apple.com>
1409 Reviewed by Maciej Stachowiak.
1411 Incorrect use of JavaScriptCore API in DumpRenderTree
1412 https://bugs.webkit.org/show_bug.cgi?id=31577
1414 Add assertions to the 'toJS' functions to catch mistakes like
1415 this early. Restructure existing code which blindly passed potentially
1416 null values to toJS when forwarding exceptions so that a null check is
1422 * API/JSCallbackObjectFunctions.h:
1423 (JSC::::getOwnPropertySlot):
1425 (JSC::::deleteProperty):
1427 (JSC::::hasInstance):
1431 (JSC::::staticValueGetter):
1432 (JSC::::callbackGetter):
1433 * API/tests/testapi.c: Fix errors in the API tester.
1434 (MyObject_getProperty):
1435 (MyObject_convertToType):
1436 (EvilExceptionObject_convertToType):
1438 2009-11-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
1440 Reviewed by Gavin Barraclough.
1442 https://bugs.webkit.org/show_bug.cgi?id=31050
1444 Minor fixes for JSVALUE32_64: branchConvertDoubleToInt32
1445 failed on a CortexA8 CPU, but not on a simulator; and
1446 JITCall.cpp modifications was somehow not committed to mainline.
1448 * assembler/ARMAssembler.h:
1449 (JSC::ARMAssembler::fmrs_r):
1450 * assembler/MacroAssemblerARM.h:
1451 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
1453 (JSC::JIT::compileOpCall):
1455 2009-11-16 Joerg Bornemann <joerg.bornemann@trolltech.com>
1457 Reviewed by Simon Hausmann.
1459 Fix Qt build on Windows CE 6.
1461 * JavaScriptCore.pri: Add missing include path.
1462 * wtf/Platform.h: Include ce_time.h for Windows CE 6.
1464 2009-11-13 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
1466 Reviewed by Gavin Barraclough.
1468 https://bugs.webkit.org/show_bug.cgi?id=31050
1470 Adding optimization support for mode JSVALUE32_64
1475 (JSC::JIT::compileOpCall):
1476 * jit/JITPropertyAccess.cpp:
1477 (JSC::JIT::emit_op_method_check):
1478 (JSC::JIT::compileGetByIdHotPath):
1479 (JSC::JIT::compileGetByIdSlowCase):
1480 (JSC::JIT::emit_op_put_by_id):
1482 2009-11-14 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
1484 Reviewed by Gavin Barraclough.
1486 https://bugs.webkit.org/show_bug.cgi?id=31050
1488 Adding JSVALUE32_64 support for ARM (but not turning it
1489 on by default). All optimizations must be disabled, since
1490 this patch is only the first of a series of patches.
1492 During the work, a lot of x86 specific code revealed and
1493 made platform independent.
1494 See revisions: 50531 50541 50593 50594 50595
1496 * assembler/ARMAssembler.h:
1497 (JSC::ARMAssembler::):
1498 (JSC::ARMAssembler::fdivd_r):
1499 * assembler/MacroAssemblerARM.h:
1500 (JSC::MacroAssemblerARM::lshift32):
1501 (JSC::MacroAssemblerARM::neg32):
1502 (JSC::MacroAssemblerARM::rshift32):
1503 (JSC::MacroAssemblerARM::branchOr32):
1504 (JSC::MacroAssemblerARM::set8):
1505 (JSC::MacroAssemblerARM::setTest8):
1506 (JSC::MacroAssemblerARM::loadDouble):
1507 (JSC::MacroAssemblerARM::divDouble):
1508 (JSC::MacroAssemblerARM::convertInt32ToDouble):
1509 (JSC::MacroAssemblerARM::zeroDouble):
1512 * jit/JITOpcodes.cpp:
1513 (JSC::JIT::privateCompileCTIMachineTrampolines):
1515 * wtf/StdLibExtras.h:
1517 2009-11-13 Dominik Röttsches <dominik.roettsches@access-company.com>
1519 Reviewed by Eric Seidel.
1521 Unify TextBoundaries implementations by only relying on WTF Unicode abstractions
1522 https://bugs.webkit.org/show_bug.cgi?id=31468
1524 Adding isAlphanumeric abstraction, required
1525 by TextBoundaries.cpp.
1527 * wtf/unicode/glib/UnicodeGLib.h:
1528 (WTF::Unicode::isAlphanumeric):
1529 * wtf/unicode/icu/UnicodeIcu.h:
1530 (WTF::Unicode::isAlphanumeric):
1532 2009-11-13 Norbert Leser <norbert.leser&nokia.com>
1534 Reviewed by Eric Seidel.
1536 Added macros for USERINCLUDE paths within symbian blocks
1537 to guarantee inclusion of respective header files from local path
1538 first (to avoid clashes with same names of header files in system include path).
1540 * JavaScriptCore.pri:
1542 2009-11-13 Oliver Hunt <oliver@apple.com>
1544 Reviewed by Geoff Garen.
1546 JSValueProtect and JSValueUnprotect don't protect API wrapper values
1547 https://bugs.webkit.org/show_bug.cgi?id=31485
1549 Make JSValueProtect/Unprotect use a new 'toJS' function, 'toJSForGC' that
1550 does not attempt to to strip out API wrapper objects.
1554 * API/JSValueRef.cpp:
1557 * API/tests/testapi.c:
1558 (makeGlobalNumberValue):
1561 2009-11-13 İsmail Dönmez <ismail@namtrac.org>
1563 Reviewed by Antti Koivisto.
1565 Fix typo, ce_time.cpp should be ce_time.c
1567 * JavaScriptCore.pri:
1569 2009-11-12 Steve VanDeBogart <vandebo@chromium.org>
1571 Reviewed by Adam Barth.
1573 Calculate the time offset only if we were able to parse
1574 the date string. This saves an IPC in Chromium for
1575 invalid date strings.
1576 https://bugs.webkit.org/show_bug.cgi?id=31416
1579 (WTF::parseDateFromNullTerminatedCharacters):
1580 (JSC::parseDateFromNullTerminatedCharacters):
1582 2009-11-12 Oliver Hunt <oliver@apple.com>
1584 Rollout r50896 until i can work out why it causes failures.
1586 * bytecompiler/BytecodeGenerator.cpp:
1587 (JSC::BytecodeGenerator::emitReturn):
1588 * interpreter/Interpreter.cpp:
1589 (JSC::Interpreter::execute):
1591 (JSC::EvalNode::emitBytecode):
1593 2009-11-12 Steve Falkenburg <sfalken@apple.com>
1595 Reviewed by Stephanie Lewis.
1597 Remove LIBRARY directive from def file to fix Debug_All target.
1599 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1601 2009-11-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
1603 Rubber-stamped by Holger Freyther.
1605 Revert r50204, since it makes DRT crash on 32 bits release builds
1610 2009-11-12 Oliver Hunt <oliver@apple.com>
1612 Reviewed by Gavin Barraclough.
1614 Start unifying entry logic for function and eval code.
1616 Eval now uses a ret instruction to end execution, and sets up
1617 a callframe more in line with what we do for function entry.
1619 * bytecompiler/BytecodeGenerator.cpp:
1620 (JSC::BytecodeGenerator::emitReturn):
1621 * interpreter/Interpreter.cpp:
1622 (JSC::Interpreter::execute):
1624 (JSC::EvalNode::emitBytecode):
1626 2009-11-12 Richard Moe Gustavsen <richard.gustavsen@nokia.com>
1628 Reviewed by Kenneth Rohde Christiansen.
1630 [Qt] Disable pthread_setname_np.
1632 This allows Qt builds on Mac from 10.6 to run on earlier version
1633 where this symbol is not present.
1634 https://bugs.webkit.org/show_bug.cgi?id=31403
1638 2009-11-12 Thiago Macieira <thiago.macieira@nokia.com>
1640 Reviewed by Kenneth Rohde Christiansen.
1642 [Qt] Fix linking on Linux 32-bit.
1644 It was missing the ".text" directive at the top of the file,
1645 indicating that code would follow. Without it, the assembler created
1646 "NOTYPE" symbols, which would result in linker errors.
1647 https://bugs.webkit.org/show_bug.cgi?id=30863
1651 2009-11-11 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1653 Reviewed by Alexey Proskuryakov.
1655 Refactor multiple JavaScriptCore threads
1656 https://bugs.webkit.org/show_bug.cgi?id=31328
1658 Remove the id field from the PlatformThread structure
1661 * runtime/Collector.cpp:
1662 (JSC::getCurrentPlatformThread):
1663 (JSC::suspendThread):
1664 (JSC::resumeThread):
1665 (JSC::getPlatformThreadRegisters):
1667 2009-11-10 Geoffrey Garen <ggaren@apple.com>
1669 Linux build fix: Added an #include for UINT_MAX.
1671 * runtime/WeakRandom.h:
1673 2009-11-10 Geoffrey Garen <ggaren@apple.com>
1675 JavaScriptGlue build fix: Marked a file 'private' instead of 'project'.
1677 * JavaScriptCore.xcodeproj/project.pbxproj:
1679 2009-11-10 Geoffrey Garen <ggaren@apple.com>
1681 Reviewed by Gavin "avGni arBalroguch" Barraclough.
1683 Faster Math.random, based on GameRand.
1685 SunSpider says 1.4% faster.
1688 * JavaScriptCore.gypi:
1689 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1690 * JavaScriptCore.xcodeproj/project.pbxproj: Added the header to the project.
1692 * runtime/JSGlobalData.cpp:
1693 (JSC::JSGlobalData::JSGlobalData):
1694 * runtime/JSGlobalData.h: Use an object to track random number generation
1695 state, initialized to the current time.
1697 * runtime/MathObject.cpp:
1698 (JSC::MathObject::MathObject):
1699 (JSC::mathProtoFuncRandom): Use the new hotness.
1701 * runtime/WeakRandom.h: Added.
1702 (JSC::WeakRandom::WeakRandom):
1703 (JSC::WeakRandom::get):
1704 (JSC::WeakRandom::advance): The new hotness.
1706 2009-11-09 Geoffrey Garen <ggaren@apple.com>
1708 Reviewed by Oliver Hunt.
1710 Imported the v8 DST cache.
1712 SunSpider says 1.5% faster.
1714 * runtime/JSGlobalData.cpp:
1715 (JSC::JSGlobalData::resetDateCache): Reset the DST cache when resetting
1718 * runtime/JSGlobalData.h:
1719 (JSC::DSTOffsetCache::DSTOffsetCache):
1720 (JSC::DSTOffsetCache::reset): Added a struct for the DST cache.
1723 (WTF::calculateDSTOffsetSimple):
1724 (WTF::calculateDSTOffset):
1725 (WTF::parseDateFromNullTerminatedCharacters):
1726 (JSC::getDSTOffset):
1727 (JSC::gregorianDateTimeToMS):
1728 (JSC::msToGregorianDateTime):
1729 (JSC::parseDateFromNullTerminatedCharacters):
1730 * wtf/DateMath.h: The imported code for probing and updating the cache.
1732 2009-11-09 Geoffrey Garen <ggaren@apple.com>
1734 Reviewed by Oliver Hunt.
1736 Fixed an edge case that could cause the engine not to notice a timezone
1739 No test because this case would require manual intervention to change
1740 the timezone during the test.
1742 SunSpider reports no change.
1744 * runtime/DateInstanceCache.h:
1745 (JSC::DateInstanceCache::DateInstanceCache):
1746 (JSC::DateInstanceCache::reset): Added a helper function for resetting
1747 this cache. Also, shrank the cache, since we'll be resetting it often.
1749 * runtime/JSGlobalData.cpp:
1750 (JSC::JSGlobalData::resetDateCache): Include resetting the DateInstanceCache
1751 in resetting Date data. (Otherwise, a cache hit could bypass a necessary
1752 timezone update check.)
1754 2009-11-09 Geoffrey Garen <ggaren@apple.com>
1756 Reviewed by Sam Weinig.
1758 Some manual inlining and constant propogation in Date code.
1760 SunSpider reports a 0.4% speedup on date-*, no overall speedup. Shark
1761 says some previously evident stalls are now gone.
1763 * runtime/DateConstructor.cpp:
1765 * runtime/DateConversion.cpp:
1767 (JSC::formatTimeUTC): Split formatTime into UTC and non-UTC variants.
1769 * runtime/DateConversion.h:
1770 * runtime/DateInstance.cpp:
1771 (JSC::DateInstance::calculateGregorianDateTime):
1772 (JSC::DateInstance::calculateGregorianDateTimeUTC):
1773 * runtime/DateInstance.h:
1774 (JSC::DateInstance::gregorianDateTime):
1775 (JSC::DateInstance::gregorianDateTimeUTC): Split gregorianDateTime into
1776 a UTC and non-UTC variant, and split each variant into a fast inline
1777 case and a slow out-of-line case.
1779 * runtime/DatePrototype.cpp:
1780 (JSC::formatLocaleDate):
1781 (JSC::dateProtoFuncToString):
1782 (JSC::dateProtoFuncToUTCString):
1783 (JSC::dateProtoFuncToISOString):
1784 (JSC::dateProtoFuncToDateString):
1785 (JSC::dateProtoFuncToTimeString):
1786 (JSC::dateProtoFuncGetFullYear):
1787 (JSC::dateProtoFuncGetUTCFullYear):
1788 (JSC::dateProtoFuncToGMTString):
1789 (JSC::dateProtoFuncGetMonth):
1790 (JSC::dateProtoFuncGetUTCMonth):
1791 (JSC::dateProtoFuncGetDate):
1792 (JSC::dateProtoFuncGetUTCDate):
1793 (JSC::dateProtoFuncGetDay):
1794 (JSC::dateProtoFuncGetUTCDay):
1795 (JSC::dateProtoFuncGetHours):
1796 (JSC::dateProtoFuncGetUTCHours):
1797 (JSC::dateProtoFuncGetMinutes):
1798 (JSC::dateProtoFuncGetUTCMinutes):
1799 (JSC::dateProtoFuncGetSeconds):
1800 (JSC::dateProtoFuncGetUTCSeconds):
1801 (JSC::dateProtoFuncGetTimezoneOffset):
1802 (JSC::setNewValueFromTimeArgs):
1803 (JSC::setNewValueFromDateArgs):
1804 (JSC::dateProtoFuncSetYear):
1805 (JSC::dateProtoFuncGetYear): Updated for the gregorianDateTime change above.
1807 2009-11-09 Geoffrey Garen <ggaren@apple.com>
1809 Build fix: export a new symbol.
1811 * JavaScriptCore.exp:
1812 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1814 2009-11-09 Geoffrey Garen <ggaren@apple.com>
1816 Reviewed by Sam "Home Wrecker" Weinig.
1818 Added a tiny cache for Date parsing.
1820 SunSpider says 1.2% faster.
1822 * runtime/DateConversion.cpp:
1823 (JSC::parseDate): Try to reuse the last parsed Date, if present.
1825 * runtime/JSGlobalData.cpp:
1826 (JSC::JSGlobalData::resetDateCache):
1827 * runtime/JSGlobalData.h: Added storage for last parsed Date. Refactored
1828 this code to make resetting the date cache easier.
1830 * runtime/JSGlobalObject.h:
1831 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for
1835 (JSC::parseDateFromNullTerminatedCharacters):
1836 * wtf/DateMath.h: Changed ExecState to be first parameter, as is the JSC custom.
1838 2009-11-09 Oliver Hunt <oliver@apple.com>
1840 Reviewed by Gavin Barraclough.
1842 Can cache prototype lookups on uncacheable dictionaries.
1843 https://bugs.webkit.org/show_bug.cgi?id=31198
1845 Replace fromDictionaryTransition with flattenDictionaryObject and
1846 flattenDictionaryStructure. This change is necessary as we need to
1847 guarantee that our attempt to convert away from a dictionary structure
1848 will definitely succeed, and in some cases this requires mutating the
1849 object storage itself.
1851 * interpreter/Interpreter.cpp:
1852 (JSC::Interpreter::tryCacheGetByID):
1854 (JSC::JITThunks::tryCacheGetByID):
1855 (JSC::DEFINE_STUB_FUNCTION):
1856 * runtime/BatchedTransitionOptimizer.h:
1857 (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):
1858 * runtime/JSObject.h:
1859 (JSC::JSObject::flattenDictionaryObject):
1860 * runtime/Operations.h:
1861 (JSC::normalizePrototypeChain):
1862 * runtime/Structure.cpp:
1863 (JSC::Structure::flattenDictionaryStructure):
1864 (JSC::comparePropertyMapEntryIndices):
1865 * runtime/Structure.h:
1867 2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1869 Not reviewed, build fix.
1871 Remove extra character from r50701.
1873 * JavaScriptCore.pri:
1875 2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1877 Not reviewed, build fix.
1879 Revert r50695 because it broke QtWebKit (clean builds).
1881 * JavaScriptCore.pri:
1883 2009-11-09 Norbert Leser <norbert.leser@nokia.com>
1885 Reviewed by Kenneth Rohde Christiansen.
1887 Prepended $$PWD to GENERATED_SOURCES_DIR to avoid potential ambiguities when included from WebCore.pro.
1888 Some preprocessors consider this GENERATED_SOURCES_DIR relative to current invoking dir (e.g., ./WebCore),
1889 and not the working dir of JavaCriptCore.pri (i.e., ../JavaScriptCore/).
1891 * JavaScriptCore.pri:
1893 2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1895 Reviewed by Kenneth Rohde Christiansen.
1897 Use explicit parentheses to silence gcc 4.4 -Wparentheses warnings
1898 https://bugs.webkit.org/show_bug.cgi?id=31040
1900 * interpreter/Interpreter.cpp:
1901 (JSC::Interpreter::privateExecute):
1903 2009-11-08 David Levin <levin@chromium.org>
1905 Reviewed by NOBODY (speculative snow leopard and windows build fixes).
1908 (WTF::parseDateFromNullTerminatedCharacters):
1909 (JSC::gregorianDateTimeToMS):
1910 (JSC::msToGregorianDateTime):
1911 (JSC::parseDateFromNullTerminatedCharacters):
1913 (JSC::GregorianDateTime::GregorianDateTime):
1915 2009-11-08 David Levin <levin@chromium.org>
1917 Reviewed by NOBODY (chromium build fix).
1919 Hopefully, the last build fix.
1921 Create better separation in DateMath about the JSC
1922 and non-JSC portions. Also, only expose the non-JSC
1923 version in the exports.
1925 * JavaScriptCore.exp:
1926 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1928 (WTF::parseDateFromNullTerminatedCharacters):
1929 (JSC::getUTCOffset):
1930 (JSC::gregorianDateTimeToMS):
1931 (JSC::msToGregorianDateTime):
1932 (JSC::parseDateFromNullTerminatedCharacters):
1936 2009-11-08 David Levin <levin@chromium.org>
1938 Reviewed by NOBODY (chromium build fix).
1940 For the change in DateMath.
1945 2009-11-06 Geoffrey Garen <ggaren@apple.com>
1947 Windows build fix: export some symbols.
1949 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1951 2009-11-06 Geoffrey Garen <ggaren@apple.com>
1953 Build fix: updated export file.
1955 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1957 2009-11-06 Geoffrey Garen <ggaren@apple.com>
1959 Build fix: added some #includes.
1961 * wtf/CurrentTime.h:
1964 2009-11-06 Geoffrey Garen <ggaren@apple.com>
1966 Reviewed by Oliver Hunt.
1968 https://bugs.webkit.org/show_bug.cgi?id=31197
1969 Implemented a timezone cache not based on Mac OS X's notify_check API.
1971 If the VM calculates the local timezone offset from UTC, it caches the
1972 result until the end of the current VM invocation. (We don't want to cache
1973 forever, because the user's timezone may change over time.)
1975 This removes notify_* overhead on Mac, and, more significantly, removes
1976 OS time and date call overhead on non-Mac platforms.
1978 ~8% speedup on Date microbenchmark on Mac. SunSpider reports maybe a tiny
1979 speedup on Mac. (Speedup on non-Mac platforms should be even more noticeable.)
1981 * JavaScriptCore.exp:
1983 * interpreter/CachedCall.h:
1984 (JSC::CachedCall::CachedCall):
1985 * interpreter/Interpreter.cpp:
1986 (JSC::Interpreter::execute):
1987 * runtime/JSGlobalObject.h:
1988 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Made the
1989 DynamicGlobalObjectScope constructor responsible for checking whether a
1990 dynamicGlobalObject has already been set. This eliminated some duplicate
1991 client code, and allowed me to avoid adding even more duplicate client
1992 code. Made DynamicGlobalObjectScope responsible for resetting the
1993 local timezone cache upon first entry to the VM.
1995 * runtime/DateConstructor.cpp:
1996 (JSC::constructDate):
2000 * runtime/DateConversion.cpp:
2002 * runtime/DateConversion.h:
2003 * runtime/DateInstance.cpp:
2004 (JSC::DateInstance::gregorianDateTime):
2005 * runtime/DateInstance.h:
2006 * runtime/DateInstanceCache.h:
2007 * runtime/DatePrototype.cpp:
2008 (JSC::setNewValueFromTimeArgs):
2009 (JSC::setNewValueFromDateArgs):
2010 (JSC::dateProtoFuncSetYear):
2011 * runtime/InitializeThreading.cpp:
2012 (JSC::initializeThreadingOnce):
2013 * runtime/JSGlobalData.cpp:
2014 (JSC::JSGlobalData::JSGlobalData):
2015 * runtime/JSGlobalData.h:
2017 (WTF::getCurrentUTCTime):
2018 (WTF::getCurrentUTCTimeWithMicroseconds):
2019 (WTF::getLocalTime):
2020 (JSC::getUTCOffset): Use the new cache. Also, see below.
2021 (JSC::gregorianDateTimeToMS):
2022 (JSC::msToGregorianDateTime):
2023 (JSC::initializeDates):
2024 (JSC::parseDateFromNullTerminatedCharacters): Simplified the way this function
2025 accounts for the local timezone offset, to accomodate our new caching API,
2026 and a (possibly misguided) caller in WebCore. Also, see below.
2028 (JSC::GregorianDateTime::GregorianDateTime): Moved most of the code in
2029 DateMath.* into the JSC namespace. The code needed to move so it could
2030 naturally interact with ExecState and JSGlobalData to support caching.
2031 Logically, it seemed right to move it, too, since this code is not really
2032 as low-level as the WTF namespace might imply -- it implements a set of
2033 date parsing and conversion quirks that are finely tuned to the JavaScript
2034 language. Also removed the Mac OS X notify_* infrastructure.
2036 * wtf/CurrentTime.h:
2037 (WTF::currentTimeMS):
2038 (WTF::getLocalTime): Moved the rest of the DateMath code here, and renamed
2039 it to make it consistent with WTF's currentTime function.
2041 2009-11-06 Gabor Loki <loki@inf.u-szeged.hu>
2043 Unreviewed trivial buildfix after r50595.
2045 Rename the remaining rshiftPtr calls to rshift32
2047 * jit/JITArithmetic.cpp:
2048 (JSC::JIT::emit_op_rshift):
2049 * jit/JITInlineMethods.h:
2050 (JSC::JIT::emitFastArithImmToInt):
2052 2009-11-06 Gavin Barraclough <barraclough@apple.com>
2054 Reviewed by Oliver Hunt.
2056 Tidy up the shift methods on the macro-assembler interface.
2058 Currently behaviour of shifts of a magnitude > 0x1f is undefined.
2059 Instead defined that all shifts are masked to this range. This makes a lot of
2060 practical sense, both since having undefined behaviour is not particularly
2061 desirable, and because this behaviour is commonly required (particularly since
2062 it is required bt ECMA-262 for shifts).
2064 Update the ARM assemblers to provide this behaviour. Remove (now) redundant
2065 masks from JITArithmetic, and remove rshiftPtr (this was used in case that
2066 could be rewritten in a simpler form using rshift32, only optimized JSVALUE32
2067 on x86-64, which uses JSVALUE64!)
2069 * assembler/MacroAssembler.h:
2070 * assembler/MacroAssemblerARM.h:
2071 (JSC::MacroAssemblerARM::lshift32):
2072 (JSC::MacroAssemblerARM::rshift32):
2073 * assembler/MacroAssemblerARMv7.h:
2074 (JSC::MacroAssemblerARMv7::lshift32):
2075 (JSC::MacroAssemblerARMv7::rshift32):
2076 * assembler/MacroAssemblerX86_64.h:
2077 * jit/JITArithmetic.cpp:
2078 (JSC::JIT::emit_op_lshift):
2079 (JSC::JIT::emit_op_rshift):
2081 2009-11-05 Gavin Barraclough <barraclough@apple.com>
2083 Rubber Stamped by Oliver Hunt.
2085 Remove a magic number (1) from the JIT, instead compute the value with OBJECT_OFFSET.
2087 * jit/JITInlineMethods.h:
2088 (JSC::JIT::emitPutJITStubArg):
2089 (JSC::JIT::emitPutJITStubArgConstant):
2090 (JSC::JIT::emitGetJITStubArg):
2091 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
2092 * jit/JITStubCall.h:
2093 (JSC::JITStubCall::JITStubCall):
2094 (JSC::JITStubCall::getArgument):
2097 2009-11-05 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
2099 Reviewed by Gavin Barraclough.
2101 https://bugs.webkit.org/show_bug.cgi?id=31159
2102 Fix branchDouble behaviour on ARM THUMB2 JIT.
2104 The x86 branchDouble behaviour is reworked, and all JIT
2105 ports should follow the x86 port. See bug 31104 and 31151
2107 This patch contains a fix for the traditional ARM port
2109 * assembler/ARMAssembler.h:
2110 (JSC::ARMAssembler::):
2111 (JSC::ARMAssembler::fmrs_r):
2112 (JSC::ARMAssembler::ftosid_r):
2113 * assembler/MacroAssemblerARM.h:
2114 (JSC::MacroAssemblerARM::):
2115 (JSC::MacroAssemblerARM::branchDouble):
2116 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
2118 2009-11-05 Chris Jerdonek <chris.jerdonek@gmail.com>
2120 Reviewed by Eric Seidel.
2122 Removed the "this is part of the KDE project" comments from
2123 all *.h, *.cpp, *.idl, and *.pm files.
2125 https://bugs.webkit.org/show_bug.cgi?id=31167
2127 The maintenance and architecture page in the project wiki lists
2130 This change includes no changes or additions to test cases
2131 since the change affects only comments.
2133 * wtf/wince/FastMallocWince.h:
2135 2009-11-05 Gabor Loki <loki@inf.u-szeged.hu>
2137 Reviewed by Gavin Barraclough.
2139 Use ARMv7 specific encoding for immediate constants on ARMv7 target
2140 https://bugs.webkit.org/show_bug.cgi?id=31060
2142 * assembler/ARMAssembler.cpp:
2143 (JSC::ARMAssembler::getOp2): Use INVALID_IMM
2144 (JSC::ARMAssembler::getImm): Use encodeComplexImm for complex immediate
2145 (JSC::ARMAssembler::moveImm): Ditto.
2146 (JSC::ARMAssembler::encodeComplexImm): Encode a constant by one or two
2147 instructions or a PC relative load.
2148 * assembler/ARMAssembler.h: Use INVALID_IMM if a constant cannot be
2149 encoded as an immediate constant.
2150 (JSC::ARMAssembler::):
2151 (JSC::ARMAssembler::movw_r): 16-bit immediate load
2152 (JSC::ARMAssembler::movt_r): High halfword 16-bit immediate load
2153 (JSC::ARMAssembler::getImm16Op2): Encode immediate constant for
2156 2009-11-04 Mark Mentovai <mark@chromium.org>
2158 Reviewed by Mark Rowe.
2160 Provide TARGETING_TIGER and TARGETING_LEOPARD as analogues to
2161 BUILDING_ON_TIGER and BUILDING_ON_LEOPARD. The TARGETING_ macros
2162 consider the deployment target; the BUILDING_ON_ macros consider the
2163 headers being built against.
2167 2009-11-04 Gavin Barraclough <barraclough@apple.com>
2169 Reviewed by Oliver Hunt.
2171 https://bugs.webkit.org/show_bug.cgi?id=31151
2172 Fix branchDouble behaviour on ARM THUMB2 JIT.
2174 The ARMv7 JIT is currently using ARMv7Assembler::ConditionEQ to branch
2175 for DoubleEqualOrUnordered, however this is incorrect – ConditionEQ won't
2176 branch on unordered operands. Similarly, DoubleLessThanOrUnordered &
2177 DoubleLessThanOrEqualOrUnordered use ARMv7Assembler::ConditionLO &
2178 ARMv7Assembler::ConditionLS, whereas they should be using
2179 ARMv7Assembler::ConditionLT & ARMv7Assembler::ConditionLE.
2181 Fix these, and fill out the missing DoubleConditions.
2183 * assembler/MacroAssemblerARMv7.h:
2184 (JSC::MacroAssemblerARMv7::):
2185 (JSC::MacroAssemblerARMv7::branchDouble):
2187 2009-11-04 Gavin Barraclough <barraclough@apple.com>
2189 Rubber Stamped by Oliver Hunt.
2191 Enable native call optimizations on ARMv7. (Existing ARM_TRADITIONAL
2192 implementation was generic, worked perfectly, just needed turning on).
2194 * jit/JITOpcodes.cpp:
2197 2009-11-04 Gavin Barraclough <barraclough@apple.com>
2199 Rubber Stamped by Mark Rowe, Oliver Hunt, and Sam Weinig.
2201 Add a missing assert to the ARMv7 JIT.
2203 * assembler/ARMv7Assembler.h:
2204 (JSC::ARMThumbImmediate::ARMThumbImmediate):
2206 2009-11-04 Mark Rowe <mrowe@apple.com>
2208 Rubber-stamped by Oliver Hunt.
2210 Remove bogus op_ prefix on dumped version of three opcodes.
2212 * bytecode/CodeBlock.cpp:
2213 (JSC::CodeBlock::dump):
2215 2009-11-04 Mark Rowe <mrowe@apple.com>
2217 Reviewed by Sam Weinig.
2219 Fix dumping of constants in bytecode so that they aren't printed as large positive register numbers.
2221 We do this by having the registerName function return information about the constant if the register
2222 number corresponds to a constant. This requires that registerName, and several functions that call it,
2223 be converted to member functions of CodeBlock so that the constant value can be retrieved. The
2224 ExecState also needs to be threaded down through these functions so that it can be passed on to
2225 constantName when needed.
2227 * bytecode/CodeBlock.cpp:
2228 (JSC::constantName):
2229 (JSC::CodeBlock::registerName):
2230 (JSC::CodeBlock::printUnaryOp):
2231 (JSC::CodeBlock::printBinaryOp):
2232 (JSC::CodeBlock::printConditionalJump):
2233 (JSC::CodeBlock::printGetByIdOp):
2234 (JSC::CodeBlock::printPutByIdOp):
2235 (JSC::CodeBlock::dump):
2236 * bytecode/CodeBlock.h:
2237 (JSC::CodeBlock::isConstantRegisterIndex):
2239 2009-11-04 Pavel Heimlich <tropikhajma@gmail.com>
2241 Reviewed by Alexey Proskuryakov.
2243 https://bugs.webkit.org/show_bug.cgi?id=30647
2244 Solaris build failure due to strnstr.
2246 * wtf/StringExtras.h: Enable strnstr on Solaris, too.
2248 2009-11-04 Gavin Barraclough <barraclough@apple.com>
2250 Reviewed by Oliver Hunt.
2252 https://bugs.webkit.org/show_bug.cgi?id=31104
2253 Refactor x86-specific behaviour out of the JIT.
2255 - Add explicit double branch conditions for ordered and unordered comparisons (presently the brehaviour is a mix).
2256 - Refactor double to int conversion out into the MacroAssembler.
2257 - Remove broken double to int conversion for !JSVALUE32_64 builds - this code was broken and slowing us down, fixing it showed it not to be an improvement.
2258 - Remove exclusion of double to int conversion from (1 % X) cases in JSVALUE32_64 builds - if this was of benefit this is no longer the case; simplify.
2260 * assembler/MacroAssemblerARM.h:
2261 (JSC::MacroAssemblerARM::):
2262 * assembler/MacroAssemblerARMv7.h:
2263 (JSC::MacroAssemblerARMv7::):
2264 * assembler/MacroAssemblerX86Common.h:
2265 (JSC::MacroAssemblerX86Common::):
2266 (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
2267 (JSC::MacroAssemblerX86Common::branchDouble):
2268 (JSC::MacroAssemblerX86Common::branchConvertDoubleToInt32):
2269 * jit/JITArithmetic.cpp:
2270 (JSC::JIT::emitBinaryDoubleOp):
2271 (JSC::JIT::emit_op_div):
2272 (JSC::JIT::emitSlow_op_jnless):
2273 (JSC::JIT::emitSlow_op_jnlesseq):
2274 * jit/JITOpcodes.cpp:
2275 (JSC::JIT::emit_op_jfalse):
2277 2009-11-04 Mark Mentovai <mark@chromium.org>
2279 Reviewed by Eric Seidel.
2281 Remove BUILDING_ON_LEOPARD from JavaScriptCore.gyp. This is supposed
2282 to be set as needed only in wtf/Platform.h.
2284 * JavaScriptCore.gyp/JavaScriptCore.gyp:
2286 2009-11-02 Oliver Hunt <oliver@apple.com>
2288 Reviewed by Gavin Barraclough.
2290 REGRESSION (r48573): JSC may incorrectly cache chain lookups with a dictionary at the head of the chain
2291 https://bugs.webkit.org/show_bug.cgi?id=31045
2293 Add guards to prevent caching of prototype chain lookups with dictionaries at the
2294 head of the chain. Also add a few tighter assertions to cached prototype lookups
2295 to catch this in future.
2297 * interpreter/Interpreter.cpp:
2298 (JSC::Interpreter::tryCacheGetByID):
2299 (JSC::Interpreter::privateExecute):
2301 (JSC::JITThunks::tryCacheGetByID):
2303 2009-11-02 Laszlo Gombos <laszlo.1.gombos@nokia.com>
2305 Reviewed by Darin Adler.
2307 PLATFORM(CF) should be set when building for Qt on Darwin
2308 https://bugs.webkit.org/show_bug.cgi?id=23671
2310 * wtf/Platform.h: Turn on CF support if both QT and DARWIN
2311 platforms are defined.
2313 2009-11-02 Dmitry Titov <dimich@chromium.org>
2315 Reviewed by David Levin.
2317 Remove threadsafe refcounting from tasks used with WTF::MessageQueue.
2318 https://bugs.webkit.org/show_bug.cgi?id=30612
2320 * wtf/MessageQueue.h:
2321 (WTF::MessageQueue::alwaysTruePredicate):
2322 (WTF::MessageQueue::~MessageQueue):
2323 (WTF::MessageQueue::append):
2324 (WTF::MessageQueue::appendAndCheckEmpty):
2325 (WTF::MessageQueue::prepend):
2326 (WTF::MessageQueue::waitForMessage):
2327 (WTF::MessageQueue::waitForMessageFilteredWithTimeout):
2328 (WTF::MessageQueue::tryGetMessage):
2329 (WTF::MessageQueue::removeIf):
2330 The MessageQueue is changed to act as a queue of OwnPtr<DataType>. It takes ownership
2331 of posted tasks and passes it to the new owner (in another thread) when the task is fetched.
2332 All methods have arguments of type PassOwnPtr<DataType> and return the same type.
2334 * wtf/Threading.cpp:
2335 (WTF::createThread):
2336 Superficial change to trigger rebuild of JSC project on Windows,
2337 workaround for https://bugs.webkit.org/show_bug.cgi?id=30890
2339 2009-10-30 Geoffrey Garen <ggaren@apple.com>
2341 Reviewed by Oliver Hunt.
2343 Fixed failing layout test: restore a special case I accidentally deleted.
2345 * runtime/DatePrototype.cpp:
2346 (JSC::setNewValueFromDateArgs): In the case of applying a change to a date
2347 that is NaN, reset the date to 0 *and* then apply the change; don't just
2348 reset the date to 0.
2350 2009-10-30 Geoffrey Garen <ggaren@apple.com>
2352 Windows build fix: update for object-to-pointer change.
2354 * runtime/DatePrototype.cpp:
2355 (JSC::formatLocaleDate):
2357 2009-10-29 Geoffrey Garen <ggaren@apple.com>
2359 Reviewed by Darin Adler.
2361 https://bugs.webkit.org/show_bug.cgi?id=30942
2362 Use pointers instead of copies to pass GregorianDateTime objects around.
2364 SunSpider reports a shocking 4.5% speedup on date-format-xparb, and 1.3%
2365 speedup on date-format-tofte.
2367 * runtime/DateInstance.cpp:
2368 (JSC::DateInstance::gregorianDateTime):
2369 * runtime/DateInstance.h:
2370 * runtime/DatePrototype.cpp:
2371 (JSC::formatLocaleDate):
2372 (JSC::dateProtoFuncToString):
2373 (JSC::dateProtoFuncToUTCString):
2374 (JSC::dateProtoFuncToISOString):
2375 (JSC::dateProtoFuncToDateString):
2376 (JSC::dateProtoFuncToTimeString):
2377 (JSC::dateProtoFuncGetFullYear):
2378 (JSC::dateProtoFuncGetUTCFullYear):
2379 (JSC::dateProtoFuncToGMTString):
2380 (JSC::dateProtoFuncGetMonth):
2381 (JSC::dateProtoFuncGetUTCMonth):
2382 (JSC::dateProtoFuncGetDate):
2383 (JSC::dateProtoFuncGetUTCDate):
2384 (JSC::dateProtoFuncGetDay):
2385 (JSC::dateProtoFuncGetUTCDay):
2386 (JSC::dateProtoFuncGetHours):
2387 (JSC::dateProtoFuncGetUTCHours):
2388 (JSC::dateProtoFuncGetMinutes):
2389 (JSC::dateProtoFuncGetUTCMinutes):
2390 (JSC::dateProtoFuncGetSeconds):
2391 (JSC::dateProtoFuncGetUTCSeconds):
2392 (JSC::dateProtoFuncGetTimezoneOffset):
2393 (JSC::setNewValueFromTimeArgs):
2394 (JSC::setNewValueFromDateArgs):
2395 (JSC::dateProtoFuncSetYear):
2396 (JSC::dateProtoFuncGetYear): Renamed getGregorianDateTime to gregorianDateTime,
2397 since it no longer has an out parameter. Uses 0 to indicate invalid dates.
2399 2009-10-30 Zoltan Horvath <zoltan@webkit.org>
2401 Reviewed by Darin Adler.
2403 Allow custom memory allocation control for JavaScriptCore's ListHashSet
2404 https://bugs.webkit.org/show_bug.cgi?id=30853
2406 Inherits ListHashSet class from FastAllocBase because it is
2407 instantiated by 'new' in WebCore/rendering/RenderBlock.cpp:1813.
2409 * wtf/ListHashSet.h:
2411 2009-10-30 Oliver Hunt <oliver@apple.com>
2413 Reviewed by Gavin Barraclough.
2415 Regression: crash enumerating properties of an object with getters or setters
2416 https://bugs.webkit.org/show_bug.cgi?id=30948
2418 Add a guard to prevent us trying to cache property enumeration on
2419 objects with getters or setters.
2421 * runtime/JSPropertyNameIterator.cpp:
2422 (JSC::JSPropertyNameIterator::create):
2424 2009-10-30 Roland Steiner <rolandsteiner@chromium.org>
2426 Reviewed by Eric Seidel.
2428 Remove ENABLE_RUBY guards as discussed with Dave Hyatt and Maciej Stachowiak.
2430 Bug 28420 - Implement HTML5 <ruby> rendering
2431 (https://bugs.webkit.org/show_bug.cgi?id=28420)
2433 No new tests (no functional change).
2435 * Configurations/FeatureDefines.xcconfig:
2437 2009-10-29 Oliver Hunt <oliver@apple.com>
2439 Reviewed by Maciej Stachowiak.
2441 REGRESSION (r50218-r50262): E*TRADE accounts page is missing content
2442 https://bugs.webkit.org/show_bug.cgi?id=30947
2443 <rdar://problem/7348833>
2445 The logic for flagging that a structure has non-enumerable properties
2446 was in addPropertyWithoutTransition, rather than in the core Structure::put
2447 method. Despite this I was unable to produce a testcase that caused
2448 the failure that etrade was experiencing, but the new assertion in
2449 getEnumerablePropertyNames triggers on numerous layout tests without
2450 the fix, so in effecti all for..in enumeration in any test ends up
2451 doing the required consistency check.
2453 * runtime/Structure.cpp:
2454 (JSC::Structure::addPropertyWithoutTransition):
2455 (JSC::Structure::put):
2456 (JSC::Structure::getEnumerablePropertyNames):
2457 (JSC::Structure::checkConsistency):
2459 2009-10-29 Gabor Loki <loki@inf.u-szeged.hu>
2461 Reviewed by Gavin Barraclough.
2463 Add cacheFlush support for Thumb-2 on Linux
2464 https://bugs.webkit.org/show_bug.cgi?id=30865
2466 * jit/ExecutableAllocator.h:
2467 (JSC::ExecutableAllocator::cacheFlush):
2469 2009-10-28 Gavin Barraclough <barraclough@apple.com>
2471 Reviewed by Oliver Hunt.
2473 JSC JIT on ARMv7 cannot link jumps >16Mb range
2474 https://bugs.webkit.org/show_bug.cgi?id=30891
2476 Start planing all relative jumps as move-32-bit-immediate-to-register-BX.
2477 In the cases where the jump would fall within a relative jump range, use a relative jump.
2479 * JavaScriptCore.xcodeproj/project.pbxproj:
2480 * assembler/ARMv7Assembler.h:
2481 (JSC::ARMv7Assembler::~ARMv7Assembler):
2482 (JSC::ARMv7Assembler::LinkRecord::LinkRecord):
2483 (JSC::ARMv7Assembler::):
2484 (JSC::ARMv7Assembler::executableCopy):
2485 (JSC::ARMv7Assembler::linkJump):
2486 (JSC::ARMv7Assembler::relinkJump):
2487 (JSC::ARMv7Assembler::setInt32):
2488 (JSC::ARMv7Assembler::isB):
2489 (JSC::ARMv7Assembler::isBX):
2490 (JSC::ARMv7Assembler::isMOV_imm_T3):
2491 (JSC::ARMv7Assembler::isMOVT):
2492 (JSC::ARMv7Assembler::isNOP_T1):
2493 (JSC::ARMv7Assembler::isNOP_T2):
2494 (JSC::ARMv7Assembler::linkJumpAbsolute):
2495 (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmFirst):
2496 (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmSecond):
2497 (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp5i6Imm4Reg4EncodedImm):
2498 * assembler/MacroAssemblerARMv7.h:
2499 (JSC::MacroAssemblerARMv7::makeJump):
2500 (JSC::MacroAssemblerARMv7::makeBranch):
2504 2009-10-28 Oliver Hunt <oliver@apple.com>
2506 Reviewed by Geoff Garen.
2508 Improve for..in enumeration performance
2509 https://bugs.webkit.org/show_bug.cgi?id=30887
2511 Improve indexing of an object with a for..in iterator by
2512 identifying cases where get_by_val is being used with a iterator
2513 as the subscript and replace it with a new get_by_pname
2514 bytecode. get_by_pname then optimizes lookups that directly access
2517 * bytecode/CodeBlock.cpp:
2518 (JSC::CodeBlock::dump):
2519 * bytecode/Opcode.h:
2520 * bytecompiler/BytecodeGenerator.cpp:
2521 (JSC::BytecodeGenerator::emitGetByVal):
2522 * bytecompiler/BytecodeGenerator.h:
2523 (JSC::BytecodeGenerator::pushOptimisedForIn):
2524 (JSC::BytecodeGenerator::popOptimisedForIn):
2525 * interpreter/Interpreter.cpp:
2526 (JSC::Interpreter::privateExecute):
2528 (JSC::JIT::privateCompileMainPass):
2529 (JSC::JIT::privateCompileSlowCases):
2531 * jit/JITPropertyAccess.cpp:
2532 (JSC::JIT::compileGetDirectOffset):
2533 (JSC::JIT::emit_op_get_by_pname):
2534 (JSC::JIT::emitSlow_op_get_by_pname):
2536 (JSC::ForInNode::emitBytecode):
2537 * runtime/JSObject.h:
2538 * runtime/JSPropertyNameIterator.cpp:
2539 (JSC::JSPropertyNameIterator::create):
2540 * runtime/JSPropertyNameIterator.h:
2541 (JSC::JSPropertyNameIterator::getOffset):
2542 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
2543 * runtime/JSValue.h:
2545 * runtime/Structure.cpp:
2546 (JSC::Structure::addPropertyTransition):
2547 (JSC::Structure::changePrototypeTransition):
2548 (JSC::Structure::despecifyFunctionTransition):
2549 (JSC::Structure::addAnonymousSlotsTransition):
2550 (JSC::Structure::getterSetterTransition):
2551 (JSC::Structure::toDictionaryTransition):
2552 (JSC::Structure::addPropertyWithoutTransition):
2553 Track the existence (or not) of non-enumerable properties.
2554 * runtime/Structure.h:
2555 (JSC::Structure::propertyStorageCapacity):
2556 (JSC::Structure::propertyStorageSize):
2557 (JSC::Structure::hasNonEnumerableProperties):
2558 (JSC::Structure::hasAnonymousSlots):
2560 2009-10-28 Dmitry Titov <dimich@chromium.org>
2562 Not reviewed, attemp to fix Windows build.
2564 Touch the cpp file to cause recompile.
2566 * wtf/Threading.cpp:
2567 (WTF::threadEntryPoint):
2569 2009-10-28 Dmitry Titov <dimich@chromium.org>
2571 Reviewed by David Levin.
2573 https://bugs.webkit.org/show_bug.cgi?id=30805
2574 Add MessageQueue::removeIf(Predicate&) to remove certain tasks without pulling them from the queue.
2575 Existing Database tests cover this since Database removes tasks when it is stopped.
2577 * wtf/MessageQueue.h:
2580 2009-10-28 Afonso R. Costa Jr. <afonso.costa@openbossa.org>
2582 Reviewed by Oliver Hunt.
2584 [Qt] Enable YARR when YARR_JIT is enabled
2585 https://bugs.webkit.org/show_bug.cgi?id=30730
2587 When enabling or disabling JIT using JAVASCRIPTCORE_JIT, the ENABLE_YARR should
2590 * JavaScriptCore.pri:
2592 2009-10-24 Martin Robinson <martin.james.robinson@gmail.com>
2594 Reviewed by Oliver Hunt.
2596 Fix strict aliasing warning by switching reinterpret_cast to bitwise_cast.
2598 strict-aliasing warnings in JSFunction.h
2599 https://bugs.webkit.org/show_bug.cgi?id=27869
2601 * runtime/JSFunction.h:
2602 (JSC::JSFunction::nativeFunction):
2603 (JSC::JSFunction::scopeChain):
2604 (JSC::JSFunction::setScopeChain):
2605 (JSC::JSFunction::setNativeFunction):
2607 2009-10-28 Jan-Arve Sæther <jan-arve.saether@nokia.com>
2609 Reviewed by Tor Arne Vestbø.
2611 Build-fix for 64-bit Windows
2613 * wtf/Platform.h: Make sure to use WTF_USE_JSVALUE64
2615 2009-10-28 Gavin Barraclough <barraclough@apple.com>
2617 Reviewed by NOBODY (build fix!).
2621 2009-10-26 Holger Hans Peter Freyther <zecke@selfish.org>
2623 Rubber-stamped by Darin Adler.
2625 Export fastMalloc, fastCalloc, fastRealloc and fastFree on GCC/Unix
2626 https://bugs.webkit.org/show_bug.cgi?id=30769
2628 When using -fvisibility=hidden to hide all internal symbols by default
2629 the malloc symbols will be hidden as well. For memory instrumentation
2630 it is needed to provide an instrumented version of these symbols and
2631 override the normal routines and by changing the visibility back to
2632 default this becomes possible.
2634 The only other solution would be to use system malloc instead of the
2635 TCmalloc implementation but this will not allow to analyze memory
2636 behavior with the default allocator.
2638 * wtf/FastMalloc.h: Define WTF_FAST_MALLOC_EXPORT for GCC and !darwin
2640 2009-10-27 Gavin Barraclough <barraclough@apple.com>
2642 Rubber Stamped by Samuel Q. Weinig.
2644 Make the asserts protecting the offsets in the JIT more descriptive.
2648 (JSC::JIT::compileOpCall):
2649 * jit/JITPropertyAccess.cpp:
2650 (JSC::JIT::emit_op_method_check):
2651 (JSC::JIT::compileGetByIdHotPath):
2652 (JSC::JIT::compileGetByIdSlowCase):
2653 (JSC::JIT::emit_op_put_by_id):
2655 2009-10-27 Geoffrey Garen <ggaren@apple.com>
2657 Reviewed by Sam Weinig.
2659 A little bit of refactoring in the date code.
2661 * JavaScriptCore.exp: Don't export this unused symbol.
2663 * runtime/DateConstructor.cpp:
2664 (JSC::constructDate):
2666 * runtime/DateInstance.cpp:
2667 (JSC::DateInstance::DateInstance):
2668 * runtime/DateInstance.h: Removed some unused functions. Changed the default
2669 constructor to ensure that a DateInstance is always initialized.
2671 * runtime/DatePrototype.cpp:
2672 (JSC::DatePrototype::DatePrototype): Pass an initializer to our constructor,
2673 since it now requires one.
2676 (WTF::msToGregorianDateTime): Only compute our offset from UTC if our
2677 output will require it. Otherwise, our offset is 0.
2679 2009-10-27 Geoffrey Garen <ggaren@apple.com>
2681 Build fix: Mark DateInstaceCache.h private, so other frameworks can see it.
2683 * JavaScriptCore.xcodeproj/project.pbxproj:
2685 2009-10-27 Geoffrey Garen <ggaren@apple.com>
2687 Build fix: re-readded this file.
2689 * runtime/DateInstanceCache.h: Added.
2690 (JSC::DateInstanceData::create):
2691 (JSC::DateInstanceData::DateInstanceData):
2692 (JSC::DateInstanceCache::DateInstanceCache):
2693 (JSC::DateInstanceCache::add):
2694 (JSC::DateInstanceCache::lookup):
2696 2009-10-27 Geoffrey Garen <ggaren@apple.com>
2698 Reviewed by Darin Adler and Oliver Hunt.
2700 https://bugs.webkit.org/show_bug.cgi?id=30800
2701 Cache recently computed date data.
2703 SunSpider reports a ~0.5% speedup, mostly from date-format-tofte.js.
2706 * JavaScriptCore.gypi:
2707 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2708 * JavaScriptCore.xcodeproj/project.pbxproj: Added new file.
2710 * runtime/DateInstance.cpp:
2711 (JSC::DateInstance::DateInstance):
2712 (JSC::DateInstance::getGregorianDateTime): Use the shared cache.
2714 * runtime/DateInstance.h: Renamed m_cache to m_data, to avoid the confusion
2717 * runtime/DatePrototype.cpp:
2718 (JSC::formatLocaleDate):
2719 (JSC::dateProtoFuncToString):
2720 (JSC::dateProtoFuncToUTCString):
2721 (JSC::dateProtoFuncToISOString):
2722 (JSC::dateProtoFuncToDateString):
2723 (JSC::dateProtoFuncToTimeString):
2724 (JSC::dateProtoFuncGetFullYear):
2725 (JSC::dateProtoFuncGetUTCFullYear):
2726 (JSC::dateProtoFuncToGMTString):
2727 (JSC::dateProtoFuncGetMonth):
2728 (JSC::dateProtoFuncGetUTCMonth):
2729 (JSC::dateProtoFuncGetDate):
2730 (JSC::dateProtoFuncGetUTCDate):
2731 (JSC::dateProtoFuncGetDay):
2732 (JSC::dateProtoFuncGetUTCDay):
2733 (JSC::dateProtoFuncGetHours):
2734 (JSC::dateProtoFuncGetUTCHours):
2735 (JSC::dateProtoFuncGetMinutes):
2736 (JSC::dateProtoFuncGetUTCMinutes):
2737 (JSC::dateProtoFuncGetSeconds):
2738 (JSC::dateProtoFuncGetUTCSeconds):
2739 (JSC::dateProtoFuncGetTimezoneOffset):
2740 (JSC::setNewValueFromTimeArgs):
2741 (JSC::setNewValueFromDateArgs):
2742 (JSC::dateProtoFuncSetYear):
2743 (JSC::dateProtoFuncGetYear): Pass an ExecState to these functions, so they
2744 can access the DateInstanceCache.
2746 * runtime/JSGlobalData.h: Keep a DateInstanceCache.
2748 2009-10-27 James Robinson <jamesr@chromium.org>
2750 Reviewed by Darin Fisher.
2752 Ensures that JavaScriptCore/wtf/CurrentTime.cpp is not built in PLATFORM(CHROMIUM) builds.
2754 Chromium uses a different method to calculate the current time than is used in
2755 JavaScriptCore/wtf/CurrentTime.cpp. This can lead to time skew when calls to currentTime() and Chromium's time
2756 function are mixed. In particular, timers can get scheduled in the past which leads to 100% CPU use.
2757 See http://code.google.com/p/chromium/issues/detail?id=25892 for an example.
2759 https://bugs.webkit.org/show_bug.cgi?id=30833
2761 * JavaScriptCore.gyp/JavaScriptCore.gyp:
2762 * wtf/CurrentTime.cpp:
2764 2009-10-27 Peter Varga <pvarga@inf.u-szeged.hu>
2766 Rubber-stamped by Tor Arne Vestbø.
2768 Fix typo in RegexInterpreter.cpp and RegexJIT.cpp alterantive to
2771 * yarr/RegexInterpreter.cpp:
2772 (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction):
2773 (JSC::Yarr::ByteCompiler::alternativeDisjunction):
2774 (JSC::Yarr::ByteCompiler::emitDisjunction):
2775 * yarr/RegexJIT.cpp:
2776 (JSC::Yarr::RegexGenerator::generateDisjunction):
2778 2009-10-26 Laszlo Gombos <laszlo.1.gombos@nokia.com>
2780 Reviewed by Darin Adler.
2782 Make .rc files compile on Windows without depending on MFC headers
2783 https://bugs.webkit.org/show_bug.cgi?id=30750
2785 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Use
2786 winresrc.h because it exists even when MFC is not installed, and is
2787 all that's needed here.
2789 2009-10-26 Gabor Loki <loki@inf.u-szeged.hu>
2791 Reviewed by Gavin Barraclough.
2793 The thunkReturnAddress is on JITStackFrame on ARM JIT as well
2794 https://bugs.webkit.org/show_bug.cgi?id=30782
2796 Move the thunkReturnAddress from top of the stack into the JITStackFrame
2797 structure. This is a requirement for JSValue32_64 support on ARM.
2799 * assembler/MacroAssemblerARM.h:
2800 (JSC::MacroAssemblerARM::ret): Return with link register
2801 (JSC::MacroAssemblerARM::prepareCall): Store the return address in link register
2802 * jit/JIT.h: Remove unused ctiReturnRegister
2803 * jit/JITInlineMethods.h: Same as ARMv7
2804 (JSC::JIT::restoreArgumentReference): Ditto.
2805 (JSC::JIT::restoreArgumentReferenceForTrampoline): Ditto.
2806 * jit/JITOpcodes.cpp: Remove ctiReturnRegister related instruction
2807 * jit/JITStubs.cpp: Store thunkReturnAddress on JITStackFrame. Use
2808 small trampoline functions which handle return addresses for each
2810 * jit/JITStubs.h: Store thunkReturnAddress on JITStackFrame
2811 (JSC::JITStackFrame::returnAddressSlot): Return with the address of thunkReturnAddress
2812 * yarr/RegexJIT.cpp:
2813 (JSC::Yarr::RegexGenerator::generateEnter): Remove the unnecessary instruction
2815 2009-10-26 Steve Block <steveblock@google.com>
2817 Reviewed by Darin Adler.
2819 Adds ability to disable ReadWriteLock on platforms (eg Android) that use pthreads but do not support pthread_rwlock.
2820 https://bugs.webkit.org/show_bug.cgi?id=30713
2822 * wtf/Platform.h: Modified. Defines HAVE_PTHREAD_RWLOCK for all platforms currently using pthreads.
2823 * wtf/Threading.h: Modified. Use pthread_rwlock_t only when HAVE_PTHREAD_RWLOCK is defined.
2824 * wtf/ThreadingPthreads.cpp: Modified. Build ReadWriteLock methods only when HAVE_PTHREAD_RWLOCK is defined.
2826 2009-10-24 Laszlo Gombos <laszlo.1.gombos@nokia.com>
2828 Reviewed by Holger Freyther.
2830 [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian
2831 https://bugs.webkit.org/show_bug.cgi?id=30476
2833 Assign ReadUserData WriteUserData NetworkServices Symbian capabilities
2838 2009-10-23 Steve Block <steveblock@google.com>
2840 Reviewed by Dmitry Titov.
2842 Fixes a leak in createThreadInternal on Android.
2843 https://bugs.webkit.org/show_bug.cgi?id=30698
2845 * wtf/ThreadingPthreads.cpp: Modified.
2846 (WTF::createThreadInternal): Avoid leaking a ThreadData object on failure.
2848 2009-10-22 Geoffrey Garen <ggaren@apple.com>
2850 Reviewed by Alexey Proskuryakov.
2852 Fixed ASSERT when opening Safari's Caches window while the Web Inspector
2855 * runtime/Collector.cpp:
2856 (JSC::typeName): Added two new types to the type name list in the Collector.
2857 These types have been around for a while, but nobody remembered to consider them here.
2860 (JSC::JSCell::isPropertyNameIterator):
2861 * runtime/JSPropertyNameIterator.h:
2862 (JSC::JSPropertyNameIterator::isPropertyNameIterator): Give the Collector
2863 a way to tell if a cell is a JSPropertyNameIterator.
2865 2009-10-22 Steve Falkenburg <sfalken@apple.com>
2867 Reviewed by Jon Honeycutt.
2869 https://bugs.webkit.org/show_bug.cgi?id=30686
2870 Remove debug-specific def file.
2871 Only Debug_All target uses JavaScriptCore_debug.dll naming, and since
2872 that target is only used internally, maintaining two files just to
2873 suppress a single link warning isn't worthwhile.
2875 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2876 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Removed.
2878 2009-10-21 Jon Honeycutt <jhoneycutt@apple.com>
2880 <rdar://problem/7270320> Screenshots of off-screen plug-ins are blank
2881 <rdar://problem/7270314> After halting a transparent PluginView on
2882 Windows, the transparency is applied twice
2884 Reviewed by Dan Bernstein.
2886 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2887 Export WTF::deleteOwnedPtr(HDC).
2889 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2892 2009-10-20 Geoffrey Garen <ggaren@apple.com>
2894 Windows build fix: updated variable name.
2896 * runtime/DatePrototype.cpp:
2897 (JSC::formatLocaleDate):
2899 2009-10-20 Geoffrey Garen <ggaren@apple.com>
2901 Reviewed by Mark Rowe.
2903 * jit/JITOpcodes.cpp:
2904 (JSC::JIT::emit_op_next_pname): Slightly tweaked this #ifdef to match the
2905 size of a JSValue because m_jsStrings is an array of JSValues.
2907 2009-10-20 Geoffrey Garen <ggaren@apple.com>
2909 Reviewed by Mark Rowe.
2911 Fixed a 64-bit regression caused by the fix for
2912 https://bugs.webkit.org/show_bug.cgi?id=30570.
2914 * jit/JITOpcodes.cpp:
2915 (JSC::JIT::emit_op_next_pname): Use TimesEight stepping on 64-bit, since
2916 64-bit pointers are eight bytes long.
2918 2009-10-20 Geoffrey Garen <ggaren@apple.com>
2920 Reviewed by Sam Weinig.
2922 Refactored DateInstance::msToGregorianDateTime so that a DateInstance's
2923 caller doesn't need to supply the DateInstance's own internal value to
2926 * runtime/DateInstance.cpp:
2927 (JSC::DateInstance::getGregorianDateTime): Renamed from "msToGregorianDateTime".
2929 * runtime/DateInstance.h:
2930 * runtime/DatePrototype.cpp:
2931 (JSC::formatLocaleDate):
2932 (JSC::dateProtoFuncToString):
2933 (JSC::dateProtoFuncToUTCString):
2934 (JSC::dateProtoFuncToISOString):
2935 (JSC::dateProtoFuncToDateString):
2936 (JSC::dateProtoFuncToTimeString):
2937 (JSC::dateProtoFuncToLocaleString):
2938 (JSC::dateProtoFuncToLocaleDateString):
2939 (JSC::dateProtoFuncToLocaleTimeString):
2940 (JSC::dateProtoFuncGetTime):
2941 (JSC::dateProtoFuncGetFullYear):
2942 (JSC::dateProtoFuncGetUTCFullYear):
2943 (JSC::dateProtoFuncToGMTString):
2944 (JSC::dateProtoFuncGetMonth):
2945 (JSC::dateProtoFuncGetUTCMonth):
2946 (JSC::dateProtoFuncGetDate):
2947 (JSC::dateProtoFuncGetUTCDate):
2948 (JSC::dateProtoFuncGetDay):
2949 (JSC::dateProtoFuncGetUTCDay):
2950 (JSC::dateProtoFuncGetHours):
2951 (JSC::dateProtoFuncGetUTCHours):
2952 (JSC::dateProtoFuncGetMinutes):
2953 (JSC::dateProtoFuncGetUTCMinutes):
2954 (JSC::dateProtoFuncGetSeconds):
2955 (JSC::dateProtoFuncGetUTCSeconds):
2956 (JSC::dateProtoFuncGetTimezoneOffset):
2957 (JSC::setNewValueFromTimeArgs):
2958 (JSC::setNewValueFromDateArgs):
2959 (JSC::dateProtoFuncSetYear):
2960 (JSC::dateProtoFuncGetYear): Also renamed "utc" to "outputIsUTC", for clarity.
2962 2009-10-20 Gabor Loki <loki@inf.u-szeged.hu>
2964 Reviewed by Geoffrey Garen.
2966 The op_next_pname should use 4 bytes addressing mode in case of JSValue32
2967 https://bugs.webkit.org/show_bug.cgi?id=30570
2969 * jit/JITOpcodes.cpp:
2970 (JSC::JIT::emit_op_next_pname):
2972 2009-10-20 Gabor Loki <loki@inf.u-szeged.hu>
2974 Reviewed by Oliver Hunt.
2976 Move OverridesMarkChildren flag from DatePrototype to its parent class
2977 https://bugs.webkit.org/show_bug.cgi?id=30372
2979 * runtime/DateInstance.h:
2980 (JSC::DateInstance::createStructure):
2981 * runtime/DatePrototype.h:
2983 2009-10-19 Geoffrey Garen <ggaren@apple.com>
2985 Reviewed by Oliver Hunt.
2987 Tightened up some put_by_id_transition code generation.
2988 https://bugs.webkit.org/show_bug.cgi?id=30539
2991 * jit/JITPropertyAccess.cpp:
2992 (JSC::JIT::testPrototype):
2993 (JSC::JIT::privateCompilePutByIdTransition): No need to do object type
2994 checks or read Structures and prototypes from objects: they're all known
2995 constants at compile time.
2997 2009-10-19 Geoffrey Garen <ggaren@apple.com>
2999 Reviewed by Sam Weinig.
3001 Added a private API for getting a global context from a context, for
3002 clients who want to preserve a context for a later callback.
3005 (toGlobalRef): Added an ASSERT, since this function is used more often
3008 * API/JSContextRef.cpp:
3009 * API/JSContextRefPrivate.h: Added. The new API.
3011 * API/tests/testapi.c:
3012 (print_callAsFunction):
3013 (main): Test the new API.
3015 * JavaScriptCore.exp:
3016 * JavaScriptCore.xcodeproj/project.pbxproj: Build and export the new API.
3018 2009-10-17 Geoffrey Garen <ggaren@apple.com>
3020 Reviewed by Oliver Hunt.
3022 Tightened up some instanceof code generation.
3023 https://bugs.webkit.org/show_bug.cgi?id=30488
3025 * jit/JITOpcodes.cpp:
3026 (JSC::JIT::emit_op_instanceof):
3027 (JSC::JIT::emitSlow_op_instanceof): No need to do object type checks -
3028 cell type checks and ImplementsDefaultHasIntance checks implicitly
3029 supersede object type checks.
3031 2009-10-18 Kwang Yul Seo <skyul@company100.net>
3033 Reviewed by Darin Adler.
3035 Use _stricmp and _strnicmp instead of deprecated stricmp and strnicmp.
3036 https://bugs.webkit.org/show_bug.cgi?id=30474
3038 stricmp and strnicmp are deprecated beginning in Visual
3039 C++ 2005. Use _stricmp and _strnicmp instead in StringExtras.h.
3041 * wtf/StringExtras.h:
3045 2009-10-16 Geoffrey Garen <ggaren@apple.com>
3047 Build fix: apparently we shouldn't export those symbols?
3049 * JavaScriptCore.exp:
3051 2009-10-16 Geoffrey Garen <ggaren@apple.com>
3053 Build fix: export some symbols.
3055 * JavaScriptCore.exp:
3057 2009-10-16 Oliver Hunt <oliver@apple.com>
3059 Reviewed by Gavin Barraclough.
3061 structure typeinfo flags should be inherited.
3062 https://bugs.webkit.org/show_bug.cgi?id=30468
3064 Add StructureFlag constant to the various JSC classes and use
3065 it for the TypeInfo construction. This allows us to simply
3066 accumulate flags by basing each classes StructureInfo on its parents.
3068 * API/JSCallbackConstructor.h:
3069 (JSC::JSCallbackConstructor::createStructure):
3070 * API/JSCallbackFunction.h:
3071 (JSC::JSCallbackFunction::createStructure):
3072 * API/JSCallbackObject.h:
3073 (JSC::JSCallbackObject::createStructure):
3074 * debugger/DebuggerActivation.h:
3075 (JSC::DebuggerActivation::createStructure):
3076 * runtime/Arguments.h:
3077 (JSC::Arguments::createStructure):
3078 * runtime/BooleanObject.h:
3079 (JSC::BooleanObject::createStructure):
3080 * runtime/DatePrototype.h:
3081 (JSC::DatePrototype::createStructure):
3082 * runtime/FunctionPrototype.h:
3083 (JSC::FunctionPrototype::createStructure):
3084 * runtime/GlobalEvalFunction.h:
3085 (JSC::GlobalEvalFunction::createStructure):
3086 * runtime/InternalFunction.h:
3087 (JSC::InternalFunction::createStructure):
3088 * runtime/JSActivation.h:
3089 (JSC::JSActivation::createStructure):
3090 * runtime/JSArray.h:
3091 (JSC::JSArray::createStructure):
3092 * runtime/JSByteArray.cpp:
3093 (JSC::JSByteArray::createStructure):
3094 * runtime/JSByteArray.h:
3095 * runtime/JSFunction.h:
3096 (JSC::JSFunction::createStructure):
3097 * runtime/JSGlobalObject.h:
3098 (JSC::JSGlobalObject::createStructure):
3099 * runtime/JSNotAnObject.h:
3100 (JSC::JSNotAnObject::createStructure):
3101 * runtime/JSONObject.h:
3102 (JSC::JSONObject::createStructure):
3103 * runtime/JSObject.h:
3104 (JSC::JSObject::createStructure):
3105 * runtime/JSStaticScopeObject.h:
3106 (JSC::JSStaticScopeObject::createStructure):
3107 * runtime/JSVariableObject.h:
3108 (JSC::JSVariableObject::createStructure):
3109 * runtime/JSWrapperObject.h:
3110 (JSC::JSWrapperObject::createStructure):
3111 * runtime/MathObject.h:
3112 (JSC::MathObject::createStructure):
3113 * runtime/NumberConstructor.h:
3114 (JSC::NumberConstructor::createStructure):
3115 * runtime/NumberObject.h:
3116 (JSC::NumberObject::createStructure):
3117 * runtime/RegExpConstructor.h:
3118 (JSC::RegExpConstructor::createStructure):
3119 * runtime/RegExpObject.h:
3120 (JSC::RegExpObject::createStructure):
3121 * runtime/StringObject.h:
3122 (JSC::StringObject::createStructure):
3123 * runtime/StringObjectThatMasqueradesAsUndefined.h:
3124 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
3126 2009-10-16 Geoffrey Garen <ggaren@apple.com>
3128 Reviewed by Oliver Hunt.
3130 Fast for-in enumeration: Cache JSPropertyNameIterator; cache JSStrings
3131 in JSPropertyNameIterator; inline more code.
3133 1.024x as fast on SunSpider (fasta: 1.43x as fast).
3135 * bytecode/CodeBlock.cpp:
3136 (JSC::CodeBlock::dump):
3137 * bytecode/Opcode.h:
3138 * bytecompiler/BytecodeGenerator.cpp:
3139 (JSC::BytecodeGenerator::emitGetPropertyNames):
3140 (JSC::BytecodeGenerator::emitNextPropertyName):
3141 * bytecompiler/BytecodeGenerator.h: Added a few extra operands to
3142 op_get_pnames and op_next_pname so that we can track iteration state
3143 in the register file instead of in the JSPropertyNameIterator. (To be
3144 cacheable, the JSPropertyNameIterator must be stateless.)
3146 * interpreter/Interpreter.cpp:
3147 (JSC::Interpreter::tryCachePutByID):
3148 (JSC::Interpreter::tryCacheGetByID): Updated for rename to
3149 "normalizePrototypeChain" and removal of "isCacheable".
3151 (JSC::Interpreter::privateExecute): Updated for in-RegisterFile
3152 iteration state tracking.
3155 (JSC::JIT::privateCompileMainPass):
3157 * jit/JITOpcodes.cpp:
3158 (JSC::JIT::emit_op_get_pnames): Updated for in-RegisterFile
3159 iteration state tracking.
3161 (JSC::JIT::emit_op_next_pname): Inlined code generation for op_next_pname.
3164 (JSC::JITThunks::tryCachePutByID):
3165 (JSC::JITThunks::tryCacheGetByID): Updated for rename to
3166 "normalizePrototypeChain" and removal of "isCacheable".
3168 (JSC::DEFINE_STUB_FUNCTION):
3170 (JSC::): Added has_property and to_object stubs. Removed op_next_pname
3171 stub, since has_property is all we need anymore.
3174 (JSC::ForInNode::emitBytecode): Updated for in-RegisterFile
3175 iteration state tracking.
3178 * runtime/JSObject.cpp:
3179 (JSC::JSObject::getPropertyNames): Don't do caching at this layer
3180 anymore, since we don't create a JSPropertyNameIterator at this layer.
3182 * runtime/JSPropertyNameIterator.cpp:
3183 (JSC::JSPropertyNameIterator::create): Do do caching at this layer.
3184 (JSC::JSPropertyNameIterator::get): Updated for in-RegisterFile
3185 iteration state tracking.
3186 (JSC::JSPropertyNameIterator::markChildren): Mark our JSStrings.
3188 * runtime/JSPropertyNameIterator.h:
3189 (JSC::JSPropertyNameIterator::size):
3190 (JSC::JSPropertyNameIterator::setCachedStructure):
3191 (JSC::JSPropertyNameIterator::cachedStructure):
3192 (JSC::JSPropertyNameIterator::setCachedPrototypeChain):
3193 (JSC::JSPropertyNameIterator::cachedPrototypeChain):
3194 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
3195 (JSC::Structure::setEnumerationCache): Don't store iteration state in
3196 a JSPropertyNameIterator. Do cache a JSPropertyNameIterator in a
3199 * runtime/JSValue.h:
3201 * runtime/MarkStack.h: Make those mischievous #include gods happy.
3203 * runtime/ObjectConstructor.cpp:
3205 * runtime/Operations.h:
3206 (JSC::normalizePrototypeChain): Renamed countPrototypeChainEntriesAndCheckForProxies
3207 to normalizePrototypeChain, since it changes dictionary prototypes to
3208 non-dictionary objects.
3210 * runtime/PropertyNameArray.cpp:
3211 (JSC::PropertyNameArray::add):
3212 * runtime/PropertyNameArray.h:
3213 (JSC::PropertyNameArrayData::PropertyNameArrayData):
3214 (JSC::PropertyNameArray::data):
3215 (JSC::PropertyNameArray::size):
3216 (JSC::PropertyNameArray::begin):
3217 (JSC::PropertyNameArray::end): Simplified some code here to help with
3218 current and future refactoring.
3220 * runtime/Protect.h:
3221 * runtime/Structure.cpp:
3222 (JSC::Structure::~Structure):
3223 (JSC::Structure::addPropertyWithoutTransition):
3224 (JSC::Structure::removePropertyWithoutTransition): No need to clear
3225 the enumeration cache with adding / removing properties without
3226 transition. It is an error to add / remove properties without transition
3227 once an object has been observed, and we can ASSERT to catch that.
3229 * runtime/Structure.h:
3230 (JSC::Structure::enumerationCache): Changed the enumeration cache to
3231 hold a JSPropertyNameIterator.
3233 * runtime/StructureChain.cpp:
3234 * runtime/StructureChain.h:
3235 (JSC::StructureChain::head): Removed StructureChain::isCacheable because
3236 it was wrong-headed in two ways: (1) It gave up when a prototype was a
3237 dictionary, but instead we want un-dictionary heavily accessed
3238 prototypes; (2) It folded a test for hasDefaultGetPropertyNames() into
3239 a generic test for "cacheable-ness", but hasDefaultGetPropertyNames()
3240 is only releavant to for-in caching.
3242 2009-10-16 Steve Falkenburg <sfalken@apple.com>
3244 Reviewed by Adam Roben.
3246 Add a Debug_All configuration to build entire stack as debug.
3247 Change Debug_Internal to:
3248 - stop using _debug suffix for all WebKit/Safari binaries
3249 - not use _debug as a DLL naming suffix
3250 - use non-debug C runtime lib.
3252 * JavaScriptCore.vcproj/JavaScriptCore.make: Debug build in makefile should build Debug_All.
3253 * JavaScriptCore.vcproj/JavaScriptCore.sln: Add Debug_All configuration.
3254 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add Debug_All configuration.
3255 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Renamed single configuration from "Release" to "all".
3256 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Add Debug_All configuration.
3257 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add Debug_All configuration.
3258 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_All configuration.
3259 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_All configuration.
3261 2009-10-16 Oliver Hunt <oliver@apple.com>
3263 Reviewed by Gavin Barraclough.
3265 Make typeinfo flags default to false
3266 https://bugs.webkit.org/show_bug.cgi?id=30372
3268 Last part -- replace HasDefaultGetPropertyNames with OverridesGetPropertyNames
3271 * API/JSCallbackConstructor.h:
3272 (JSC::JSCallbackConstructor::createStructure):
3273 * API/JSCallbackObject.h:
3274 (JSC::JSCallbackObject::createStructure):
3275 * debugger/DebuggerActivation.h:
3276 (JSC::DebuggerActivation::createStructure):
3277 * runtime/Arguments.h:
3278 (JSC::Arguments::createStructure):
3279 * runtime/BooleanObject.h:
3280 (JSC::BooleanObject::createStructure):
3281 * runtime/DatePrototype.h:
3282 (JSC::DatePrototype::createStructure):
3283 * runtime/FunctionPrototype.h:
3284 (JSC::FunctionPrototype::createStructure):
3285 * runtime/GlobalEvalFunction.h:
3286 (JSC::GlobalEvalFunction::createStructure):
3287 * runtime/JSAPIValueWrapper.h:
3288 (JSC::JSAPIValueWrapper::createStructure):
3289 * runtime/JSActivation.h:
3290 (JSC::JSActivation::createStructure):
3291 * runtime/JSArray.h:
3292 (JSC::JSArray::createStructure):
3293 * runtime/JSByteArray.cpp:
3294 (JSC::JSByteArray::createStructure):
3295 * runtime/JSFunction.h:
3296 (JSC::JSFunction::createStructure):
3297 * runtime/JSGlobalObject.h:
3298 (JSC::JSGlobalObject::createStructure):
3299 * runtime/JSNotAnObject.h:
3300 (JSC::JSNotAnObject::createStructure):
3301 * runtime/JSONObject.h:
3302 (JSC::JSONObject::createStructure):
3303 * runtime/JSObject.cpp:
3304 (JSC::JSObject::getPropertyNames):
3305 * runtime/JSObject.h:
3306 (JSC::JSObject::createStructure):
3307 * runtime/JSStaticScopeObject.h:
3308 (JSC::JSStaticScopeObject::createStructure):
3309 * runtime/JSTypeInfo.h:
3310 (JSC::TypeInfo::overridesGetPropertyNames):
3311 * runtime/JSVariableObject.h:
3312 (JSC::JSVariableObject::createStructure):
3313 * runtime/JSWrapperObject.h:
3314 (JSC::JSWrapperObject::createStructure):
3315 * runtime/MathObject.h:
3316 (JSC::MathObject::createStructure):
3317 * runtime/NumberConstructor.h:
3318 (JSC::NumberConstructor::createStructure):
3319 * runtime/NumberObject.h:
3320 (JSC::NumberObject::createStructure):
3321 * runtime/RegExpConstructor.h:
3322 (JSC::RegExpConstructor::createStructure):
3323 * runtime/RegExpObject.h:
3324 (JSC::RegExpObject::createStructure):
3325 * runtime/StringObject.h:
3326 (JSC::StringObject::createStructure):
3327 * runtime/StringObjectThatMasqueradesAsUndefined.h:
3328 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
3329 * runtime/StructureChain.cpp:
3330 (JSC::StructureChain::isCacheable):
3332 2009-10-16 Kevin Ollivier <kevino@theolliviers.com>
3334 wxMSW build fix, we can't use the simple hash there because the PlatformModuleVersion
3339 2009-10-16 Laszlo Gombos <laszlo.1.gombos@nokia.com>
3341 Reviewed by Simon Hausmann.
3343 [Qt] Implement ExecutableAllocator for Symbian
3344 https://bugs.webkit.org/show_bug.cgi?id=29946
3346 Tested with YARR JIT enabled for Symbian;
3347 This patch does not (yet) enable YARR JIT by default.
3349 * JavaScriptCore.pri:
3350 * jit/ExecutableAllocator.h:
3351 * jit/ExecutableAllocatorSymbian.cpp: Added.
3352 (JSC::ExecutableAllocator::intializePageSize):
3353 (JSC::ExecutablePool::systemAlloc):
3354 (JSC::ExecutablePool::systemRelease):
3356 2009-10-15 Oliver Hunt <oliver@apple.com>
3358 Reviewed by Darin Adler.
3360 Make typeinfo flags default to false
3361 https://bugs.webkit.org/show_bug.cgi?id=30372
3363 Part 2 -- Reverse the TypeInfo HasDefaultMark flag to OverridesMarkChildren, etc
3365 * API/JSCallbackConstructor.h:
3366 (JSC::JSCallbackConstructor::createStructure):
3367 * API/JSCallbackFunction.h:
3368 (JSC::JSCallbackFunction::createStructure):
3369 * API/JSCallbackObject.h:
3370 (JSC::JSCallbackObject::createStructure):
3371 * debugger/DebuggerActivation.h:
3372 (JSC::DebuggerActivation::createStructure):
3373 * runtime/Arguments.h:
3374 (JSC::Arguments::createStructure):
3375 * runtime/BooleanObject.h:
3376 (JSC::BooleanObject::createStructure):
3377 * runtime/DatePrototype.h:
3378 (JSC::DatePrototype::createStructure):
3379 * runtime/FunctionPrototype.h:
3380 (JSC::FunctionPrototype::createStructure):
3381 * runtime/GetterSetter.h:
3382 (JSC::GetterSetter::createStructure):
3383 * runtime/GlobalEvalFunction.h:
3384 (JSC::GlobalEvalFunction::createStructure):
3385 * runtime/InternalFunction.h:
3386 (JSC::InternalFunction::createStructure):
3387 * runtime/JSAPIValueWrapper.h:
3388 (JSC::JSAPIValueWrapper::createStructure):
3389 * runtime/JSActivation.h:
3390 (JSC::JSActivation::createStructure):
3391 * runtime/JSArray.h:
3392 (JSC::JSArray::createStructure):
3393 (JSC::MarkStack::markChildren):
3394 * runtime/JSByteArray.cpp:
3395 (JSC::JSByteArray::createStructure):
3396 * runtime/JSFunction.h:
3397 (JSC::JSFunction::createStructure):
3398 * runtime/JSGlobalObject.h:
3399 (JSC::JSGlobalObject::createStructure):
3400 * runtime/JSNotAnObject.h:
3401 (JSC::JSNotAnObject::createStructure):
3402 * runtime/JSNumberCell.h:
3403 (JSC::JSNumberCell::createStructure):
3404 * runtime/JSONObject.h:
3405 (JSC::JSONObject::createStructure):
3406 * runtime/JSObject.h:
3407 (JSC::JSObject::createStructure):
3408 * runtime/JSPropertyNameIterator.h:
3409 (JSC::JSPropertyNameIterator::createStructure):
3410 * runtime/JSStaticScopeObject.h:
3411 (JSC::JSStaticScopeObject::createStructure):
3412 * runtime/JSString.h:
3413 (JSC::JSString::createStructure):
3414 * runtime/JSTypeInfo.h:
3415 (JSC::TypeInfo::overridesMarkChildren):
3416 * runtime/JSVariableObject.h:
3417 (JSC::JSVariableObject::createStructure):
3418 * runtime/JSWrapperObject.h:
3419 (JSC::JSWrapperObject::createStructure):
3420 * runtime/MathObject.h:
3421 (JSC::MathObject::createStructure):
3422 * runtime/NumberConstructor.h:
3423 (JSC::NumberConstructor::createStructure):
3424 * runtime/NumberObject.h:
3425 (JSC::NumberObject::createStructure):
3426 * runtime/RegExpConstructor.h:
3427 (JSC::RegExpConstructor::createStructure):
3428 * runtime/RegExpObject.h:
3429 (JSC::RegExpObject::createStructure):
3430 * runtime/StringObject.h:
3431 (JSC::StringObject::createStructure):
3432 * runtime/StringObjectThatMasqueradesAsUndefined.h:
3433 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
3435 2009-10-14 Oliver Hunt <oliver@apple.com>
3437 Reviewed by Geoff Garen.
3439 Make typeinfo flags default to false
3440 https://bugs.webkit.org/show_bug.cgi?id=30372
3442 Part 1. Reverse the HasStandardGetOwnPropertySlot flag.
3444 * API/JSCallbackConstructor.h:
3445 (JSC::JSCallbackConstructor::createStructure):
3446 * API/JSCallbackFunction.h:
3447 (JSC::JSCallbackFunction::createStructure):
3448 * API/JSCallbackObject.h:
3449 (JSC::JSCallbackObject::createStructure):
3450 * debugger/DebuggerActivation.h:
3451 (JSC::DebuggerActivation::createStructure):
3453 (JSC::DEFINE_STUB_FUNCTION):
3454 * runtime/Arguments.h:
3455 (JSC::Arguments::createStructure):
3456 * runtime/BooleanObject.h:
3457 (JSC::BooleanObject::createStructure):
3458 * runtime/DatePrototype.h:
3459 (JSC::DatePrototype::createStructure):
3460 * runtime/FunctionPrototype.h:
3461 (JSC::FunctionPrototype::createStructure):
3462 * runtime/GlobalEvalFunction.h:
3463 (JSC::GlobalEvalFunction::createStructure):
3464 * runtime/InternalFunction.h:
3465 (JSC::InternalFunction::createStructure):
3466 * runtime/JSActivation.h:
3467 (JSC::JSActivation::createStructure):
3468 * runtime/JSArray.h:
3469 (JSC::JSArray::createStructure):
3470 * runtime/JSByteArray.cpp:
3471 (JSC::JSByteArray::createStructure):
3472 * runtime/JSFunction.h:
3473 (JSC::JSFunction::createStructure):
3474 * runtime/JSGlobalObject.h:
3475 (JSC::JSGlobalObject::createStructure):
3476 * runtime/JSNumberCell.h:
3477 (JSC::JSNumberCell::createStructure):
3478 * runtime/JSONObject.h:
3479 (JSC::JSONObject::createStructure):
3480 * runtime/JSObject.h:
3481 (JSC::JSObject::createStructure):
3482 (JSC::JSCell::fastGetOwnPropertySlot):
3483 * runtime/JSStaticScopeObject.h:
3484 (JSC::JSStaticScopeObject::createStructure):
3485 * runtime/JSString.h:
3486 (JSC::JSString::createStructure):
3487 * runtime/JSTypeInfo.h:
3488 (JSC::TypeInfo::overridesGetOwnPropertySlot):
3489 * runtime/JSVariableObject.h:
3490 (JSC::JSVariableObject::createStructure):
3491 * runtime/JSWrapperObject.h:
3492 (JSC::JSWrapperObject::createStructure):
3493 * runtime/MathObject.h:
3494 (JSC::MathObject::createStructure):
3495 * runtime/NumberConstructor.h:
3496 (JSC::NumberConstructor::createStructure):
3497 * runtime/NumberObject.h:
3498 (JSC::NumberObject::createStructure):
3499 * runtime/RegExpConstructor.h:
3500 (JSC::RegExpConstructor::createStructure):
3501 * runtime/RegExpObject.h:
3502 (JSC::RegExpObject::createStructure):
3503 * runtime/StringObject.h:
3504 (JSC::StringObject::createStructure):
3505 * runtime/StringObjectThatMasqueradesAsUndefined.h:
3506 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
3508 2009-10-14 Kevin Ollivier <kevino@theolliviers.com>
3509 2009-10-14 Darin Adler <darin@apple.com>
3511 Additions so fix for https://bugs.webkit.org/show_bug.cgi?id=18994
3512 can build on Windows.
3514 * wtf/MathExtras.h: Added llround and llroundf for Windows.
3516 2009-10-14 Kevin Ollivier <kevino@theolliviers.com>
3518 wx build fix. Set ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH for plugins while we're still building stubs.
3522 2009-10-13 Laszlo Gombos <laszlo.1.gombos@nokia.com>
3524 Reviewed by Simon Hausmann.
3526 Refactor ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH
3527 https://bugs.webkit.org/show_bug.cgi?id=30278
3529 Move the definition of ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH
3530 from the make system into common code.
3534 2009-10-13 Laszlo Gombos <laszlo.1.gombos@nokia.com>
3536 Reviewed by Darin Adler.
3538 ARM compiler does not understand reinterpret_cast<void*>
3539 https://bugs.webkit.org/show_bug.cgi?id=29034
3541 Change reinterpret_cast<void*> to regular C style (void*) cast
3542 for the ARM RVCT compiler.
3544 * assembler/MacroAssemblerCodeRef.h:
3545 (JSC::FunctionPtr::FunctionPtr):
3546 * jit/JITOpcodes.cpp: Cast to FunctionPtr first
3547 instead of directly casting to reinterpret_cast
3548 * jit/JITStubCall.h: Ditto + change the type of m_stub
3549 from void* to FunctionPtr.
3550 (JSC::JITStubCall::JITStubCall):
3551 (JSC::JITStubCall::call):
3552 * jit/JITStubs.cpp: Ditto.
3553 (JSC::DEFINE_STUB_FUNCTION(EncodedJSValue, op_throw)):
3555 2009-10-11 Oliver Hunt <oliver@apple.com>
3561 2009-10-10 Oliver Hunt <oliver@apple.com>
3563 Reviewed by Maciej Stachowiak.
3565 Support for String.trim(), String.trimLeft() and String.trimRight() methods
3566 https://bugs.webkit.org/show_bug.cgi?id=26590
3568 Implement trim, trimLeft, and trimRight
3570 * runtime/StringPrototype.cpp:
3571 (JSC::isTrimWhitespace):
3572 Our normal string whitespace function does not include U+200B which
3573 is needed for compatibility with mozilla's implementation of trim.
3574 U+200B does not appear to be expected according to spec, however I am
3575 choosing to be lax, and match mozilla behavior so have added this
3579 2009-10-09 Geoffrey Garen <ggaren@apple.com>
3581 Reviewed by Oliver Hunt.
3583 Eliminated some legacy bytecode weirdness.
3585 Use vPC[x] subscripting instead of ++vPC to access instruction operands.
3586 This is simpler, and often more efficient.
3588 To support this, and to remove use of hard-coded offsets in bytecode and
3589 JIT code generation and dumping, calculate jump offsets from the beginning
3590 of an instruction, rather than the middle or end.
3592 Also, use OPCODE_LENGTH instead of hard-coded constants for the sizes of
3595 SunSpider reports no change in JIT mode, and a 1.01x speedup in Interpreter
3598 * bytecode/CodeBlock.cpp:
3599 (JSC::printConditionalJump):
3600 (JSC::CodeBlock::dump):
3601 * bytecompiler/BytecodeGenerator.cpp:
3602 (JSC::BytecodeGenerator::emitJump):
3603 (JSC::BytecodeGenerator::emitJumpIfTrue):
3604 (JSC::BytecodeGenerator::emitJumpIfFalse):
3605 (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
3606 (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
3607 (JSC::BytecodeGenerator::emitComplexJumpScopes):
3608 (JSC::BytecodeGenerator::emitJumpScopes):
3609 (JSC::BytecodeGenerator::emitNextPropertyName):
3610 (JSC::BytecodeGenerator::emitCatch):
3611 (JSC::BytecodeGenerator::emitJumpSubroutine):
3612 (JSC::prepareJumpTableForImmediateSwitch):
3613 (JSC::prepareJumpTableForCharacterSwitch):
3614 (JSC::prepareJumpTableForStringSwitch):
3615 (JSC::BytecodeGenerator::endSwitch):
3616 * bytecompiler/Label.h:
3617 (JSC::Label::setLocation):
3619 * interpreter/Interpreter.cpp:
3620 (JSC::Interpreter::resolve):
3621 (JSC::Interpreter::resolveSkip):
3622 (JSC::Interpreter::resolveGlobal):
3623 (JSC::Interpreter::resolveBase):
3624 (JSC::Interpreter::resolveBaseAndProperty):
3625 (JSC::Interpreter::createExceptionScope):
3626 (JSC::Interpreter::privateExecute):
3627 * interpreter/Interpreter.h:
3629 (JSC::JIT::privateCompile):
3630 * jit/JITArithmetic.cpp:
3631 (JSC::JIT::emit_op_jnless):
3632 (JSC::JIT::emitSlow_op_jnless):
3633 (JSC::JIT::emit_op_jnlesseq):
3634 (JSC::JIT::emitSlow_op_jnlesseq):
3635 (JSC::JIT::emitBinaryDoubleOp):
3636 * jit/JITOpcodes.cpp:
3637 (JSC::JIT::emit_op_jmp):
3638 (JSC::JIT::emit_op_loop):
3639 (JSC::JIT::emit_op_loop_if_less):
3640 (JSC::JIT::emitSlow_op_loop_if_less):
3641 (JSC::JIT::emit_op_loop_if_lesseq):
3642 (JSC::JIT::emitSlow_op_loop_if_lesseq):
3643 (JSC::JIT::emit_op_loop_if_true):
3644 (JSC::JIT::emitSlow_op_loop_if_true):
3645 (JSC::JIT::emit_op_jfalse):
3646 (JSC::JIT::emitSlow_op_jfalse):
3647 (JSC::JIT::emit_op_jtrue):
3648 (JSC::JIT::emitSlow_op_jtrue):
3649 (JSC::JIT::emit_op_jeq_null):
3650 (JSC::JIT::emit_op_jneq_null):
3651 (JSC::JIT::emit_op_jneq_ptr):
3652 (JSC::JIT::emit_op_jsr):
3653 (JSC::JIT::emit_op_next_pname):
3654 (JSC::JIT::emit_op_jmp_scopes):
3656 2009-10-09 Geoffrey Garen <ggaren@apple.com>
3658 Reviewed by Sam Weinig.
3660 Migrated some code that didn't belong out of Structure.
3662 SunSpider says maybe 1.03x faster.
3664 * runtime/JSCell.h: Nixed Structure::markAggregate, and made marking of
3665 a Structure's prototype the direct responsility of the object using it.
3666 (Giving Structure a mark function was misleading because it implied that
3667 all live structures get marked during GC, when they don't.)
3669 * runtime/JSGlobalObject.cpp:
3670 (JSC::markIfNeeded):
3671 (JSC::JSGlobalObject::markChildren): Added code to mark prototypes stored
3672 on the global object. Maybe this wasn't necessary, but now we don't have
3675 * runtime/JSObject.cpp:
3676 (JSC::JSObject::getPropertyNames):
3677 (JSC::JSObject::getOwnPropertyNames):
3678 (JSC::JSObject::getEnumerableNamesFromClassInfoTable):
3679 * runtime/JSObject.h:
3680 (JSC::JSObject::markChildrenDirect):
3681 * runtime/PropertyNameArray.h:
3682 * runtime/Structure.cpp:
3683 * runtime/Structure.h:
3684 (JSC::Structure::setEnumerationCache):
3685 (JSC::Structure::enumerationCache): Moved property name gathering code
3686 from Structure to JSObject because having a Structure iterate its JSObject
3687 was a layering violation. A JSObject is implemented using a Structure; not
3688 the other way around.
3690 2009-10-09 Mark Rowe <mrowe@apple.com>
3692 Attempt to fix the GTK release build.
3694 * GNUmakefile.am: Include Grammar.cpp in release builds now that
3695 AllInOneFile.cpp is gone.
3697 2009-10-09 Gabor Loki <loki@inf.u-szeged.hu>
3699 Rubber-stamped by Eric Seidel.
3701 Add ARM JIT support for Gtk port (disabled by default)
3702 https://bugs.webkit.org/show_bug.cgi?id=30228
3706 2009-10-08 Geoffrey Garen <ggaren@apple.com>
3708 Tiger build fix: added a few more variable initializations.
3710 * runtime/StringPrototype.cpp:
3711 (JSC::stringProtoFuncReplace):
3712 (JSC::stringProtoFuncSearch):
3714 2009-10-08 Geoffrey Garen <ggaren@apple.com>
3716 Qt build fix: added missing #include.
3720 2009-10-08 Geoffrey Garen <ggaren@apple.com>
3722 Tiger build fix: initialize variable whose initialization the compiler
3723 can't otherwise figure out.
3725 * runtime/RegExpObject.cpp:
3726 (JSC::RegExpObject::match):
3728 2009-10-08 Geoffrey Garen <ggaren@apple.com>
3730 Windows build fix: updated exports.
3732 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3733 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3735 2009-10-08 Geoffrey Garen <ggaren@apple.com>
3737 Tiger build fix: fixed file name case.
3739 * JavaScriptCore.xcodeproj/project.pbxproj:
3741 2009-10-08 Geoffrey Garen <ggaren@apple.com>
3743 Reviewed by Maciej Stachowiak.
3745 At long last, I pronounce the death of AllInOneFile.cpp.
3747 SunSpider reports a 1.01x speedup.
3749 * AllInOneFile.cpp: Removed.
3751 * JavaScriptCore.exp:
3752 * JavaScriptCore.gypi:
3753 * JavaScriptCore.xcodeproj/project.pbxproj: Added missing project files
3754 to compilation stages.
3760 * runtime/ArrayConstructor.cpp:
3761 (JSC::constructArrayWithSizeQuirk):
3762 * runtime/Collector.h:
3763 * runtime/JSCell.cpp:
3764 (JSC::JSCell::operator new):
3766 (JSC::JSCell::operator new):
3767 * runtime/JSGlobalObject.cpp:
3768 (JSC::JSGlobalObject::operator new):
3769 * runtime/JSNumberCell.h:
3770 (JSC::JSNumberCell::operator new):
3771 * runtime/JSString.cpp:
3772 * runtime/JSString.h:
3775 (JSC::jsOwnedString):
3776 * runtime/RegExpConstructor.cpp:
3777 * runtime/RegExpConstructor.h:
3778 (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
3779 (JSC::RegExpConstructorPrivate::lastOvector):
3780 (JSC::RegExpConstructorPrivate::tempOvector):
3781 (JSC::RegExpConstructorPrivate::changeLastOvector):
3782 (JSC::RegExpConstructor::performMatch):
3783 * runtime/StringPrototype.cpp:
3784 (JSC::stringProtoFuncMatch):
3785 * yarr/RegexJIT.cpp:
3787 (JSC::Yarr::executeRegex): Inlined a few things that Shark said
3788 were hot, on the presumption that AllInOneFile.cpp used to inline them
3791 2009-10-08 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
3793 Reviewed by Gavin Barraclough.
3795 Fix for JIT'ed op_call instructions (evals, constructs, etc.)
3796 when !ENABLE(JIT_OPTIMIZE_CALL) && USE(JSVALUE32_64)
3798 https://bugs.webkit.org/show_bug.cgi?id=30201
3801 (JSC::JIT::compileOpCall):
3803 2009-10-07 Geoffrey Garen <ggaren@apple.com>
3805 Windows build fix: removed no longer exported symbol.
3807 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3808 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3810 2009-10-07 Geoffrey Garen <ggaren@apple.com>
3812 Reviewed by Oliver Hunt.
3814 Fixed <rdar://problem/5751979> Database code takes JSLock on secondary
3815 thread, permanently slowing down JavaScript
3817 Removed the optional lock from Heap::protect, Heap::unprotect, and friends,
3818 since WebCore no longer uses it.
3820 * JavaScriptCore.exp:
3821 * runtime/Collector.cpp:
3822 (JSC::Heap::protect):
3823 (JSC::Heap::unprotect):
3824 (JSC::Heap::markProtectedObjects):
3825 (JSC::Heap::protectedGlobalObjectCount):
3826 (JSC::Heap::protectedObjectCount):
3827 (JSC::Heap::protectedObjectTypeCounts):
3828 * runtime/Collector.h:
3830 2009-10-07 Zoltan Horvath <zoltan@webkit.org>
3832 Reviewed by Darin Adler.
3834 Allow custom memory allocation control for JavaScriptCore's IdentifierArena
3835 https://bugs.webkit.org/show_bug.cgi?id=30158
3837 Inherits IdentifierArena class from FastAllocBase because it has been
3838 instantiated by 'new' in JavaScriptCore/parser/ParserArena.cpp:36.
3840 * parser/ParserArena.h:
3842 2009-10-07 Adam Roben <aroben@apple.com>
3844 Export DateInstance::info in a way that works on Windows
3846 Fixes <http://webkit.org/b/30171>
3847 fast/dom/Window/window-postmessage-clone.html fails on Windows
3849 Reviewed by Anders Carlsson.
3851 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3852 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3853 Removed the export of DateInstance::info from here.
3855 * runtime/DateInstance.h: Use JS_EXPORTDATA to export
3856 DateInstance::info, which is the required way of exporting data on
3859 2009-10-07 Jørgen Lind <jorgen.lind@nokia.com>
3861 Reviewed by Simon Hausmann.
3863 When enabling or disabling the JIT through .qmake.cache, make sure
3864 to also toggle ENABLE_YARR_JIT.
3866 * JavaScriptCore.pri:
3868 2009-10-06 Priit Laes <plaes@plaes.org>
3870 Reviewed by Gavin Barraclough.
3872 Linking fails with "relocation R_X86_64_PC32 against symbol
3874 https://bugs.webkit.org/show_bug.cgi?id=28422
3877 Mark cti_vm_throw symbol as PLT-indirect symbol, so it doesn't end up
3878 in text segment causing relocation errors on amd64 architecture.
3879 Introduced new define SYMBOL_STRING_RELOCATION for such symbols.
3881 2009-10-06 Oliver Hunt <oliver@apple.com>
3885 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3886 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3888 2009-10-06 Oliver Hunt <oliver@apple.com>
3890 Reviewed by NOBODY (build fix).
3894 * runtime/DateInstance.cpp:
3896 2009-10-05 Oliver Hunt <oliver@apple.com>
3898 Reviewed by Gavin Barraclough.
3900 It should be possible to post (clone) built-in JS objects to Workers
3901 https://bugs.webkit.org/show_bug.cgi?id=22878
3903 Expose helpers to throw correct exceptions during object graph walk
3904 used for cloning and add a helper function to create Date instances
3905 without going through the JS Date constructor function.
3907 * JavaScriptCore.exp:
3908 * JavaScriptCore.xcodeproj/project.pbxproj:
3909 * runtime/DateInstance.cpp:
3910 (JSC::DateInstance::DateInstance):
3911 * runtime/DateInstance.h:
3912 * runtime/ExceptionHelpers.cpp:
3913 (JSC::createTypeError):
3914 * runtime/ExceptionHelpers.h:
3916 2009-10-06 David Levin <levin@chromium.org>
3918 Reviewed by Oliver Hunt.
3920 StringImpl needs a method to get an instance for another thread which doesn't copy the underlying buffer.
3921 https://bugs.webkit.org/show_bug.cgi?id=30095
3923 * wtf/CrossThreadRefCounted.h:
3924 Removed an unused function and assert improvement.
3925 (WTF::CrossThreadRefCounted::isOwnedByCurrentThread): Moved out common code from asserts.
3926 (WTF::CrossThreadRefCounted::ref): Changed assert to use the common method.
3927 (WTF::CrossThreadRefCounted::deref): Changed assert to use the common method.
3928 (WTF::CrossThreadRefCounted::crossThreadCopy): Since this includes a potentially
3929 non-threadsafe operation, add an assert that the class is owned by the current thread.
3931 2009-10-05 Kevin Ollivier <kevino@theolliviers.com>
3933 wx build fix. Add Symbian files to the list of excludes.
3937 2009-10-05 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
3939 Reviewed by Simon Hausmann.
3941 [Qt] Remove precompiled header from JavaScriptCore compilation to
3942 prevent qmake warning during autonomous compilation.
3943 https://bugs.webkit.org/show_bug.cgi?id=30069
3945 * JavaScriptCore.pro:
3947 2009-10-02 Geoffrey Garen <ggaren@apple.com>
3949 Reviewed by Sam Weinig.
3951 Removed the concept of a "fast access cutoff" in arrays, because it
3952 punished some patterns of array access too much, and made things too
3953 complex for inlining in some cases.
3955 1.3% speedup on SunSpider.
3957 * jit/JITOpcodes.cpp:
3958 (JSC::JIT::emitSlow_op_get_by_val):
3959 (JSC::JIT::emitSlow_op_put_by_val):
3960 * jit/JITPropertyAccess.cpp:
3961 (JSC::JIT::emit_op_get_by_val):
3962 (JSC::JIT::emitSlow_op_get_by_val):
3963 (JSC::JIT::emit_op_put_by_val):
3964 (JSC::JIT::emitSlow_op_put_by_val):
3967 (JSC::): Check m_vectorLength instead of m_fastAccessCutoff when
3968 getting / putting from / to an array. Inline putting past the end of
3971 * runtime/JSArray.cpp:
3972 (JSC::JSArray::JSArray):
3973 (JSC::JSArray::getOwnPropertySlot):
3974 (JSC::JSArray::getOwnPropertyDescriptor):
3975 (JSC::JSArray::put):
3976 (JSC::JSArray::putSlowCase):
3977 (JSC::JSArray::deleteProperty):
3978 (JSC::JSArray::getOwnPropertyNames):
3979 (JSC::JSArray::increaseVectorLength):
3980 (JSC::JSArray::setLength):
3981 (JSC::JSArray::pop):
3982 (JSC::JSArray::push):
3983 (JSC::JSArray::sort):
3984 (JSC::JSArray::fillArgList):
3985 (JSC::JSArray::copyToRegisters):
3986 (JSC::JSArray::compactForSorting):
3987 (JSC::JSArray::checkConsistency):
3988 * runtime/JSArray.h:
3989 (JSC::JSArray::canGetIndex):
3990 (JSC::JSArray::canSetIndex):
3991 (JSC::JSArray::setIndex):
3992 (JSC::JSArray::markChildrenDirect): Removed m_fastAccessCutoff, and
3993 replaced with checks for JSValue() to detect reads and writes from / to
3994 uninitialized parts of the array.
3996 2009-10-02 Jonni Rainisto <jonni.rainisto@nokia.com>
3998 Reviewed by Darin Adler.
4000 Math.random() gives too low values on Win32 when _CRT_RAND_S is not defined
4001 https://bugs.webkit.org/show_bug.cgi?id=29956
4003 * wtf/RandomNumber.cpp:
4004 (WTF::randomNumber): Added PLATFORM(WIN_OS) to handle 15bit rand()
4006 2009-10-02 Geoffrey Garen <ggaren@apple.com>
4008 Reviewed by Sam Weinig.
4010 Take one branch instead of two to test for JSValue().
4012 1.1% SunSpider speedup.
4015 (JSC::JIT::compileOpCall):
4016 * jit/JITOpcodes.cpp:
4017 (JSC::JIT::emit_op_to_jsnumber):
4018 (JSC::JIT::emit_op_create_arguments):
4019 * jit/JITPropertyAccess.cpp:
4020 (JSC::JIT::emitSlow_op_get_by_val):
4021 (JSC::JIT::emit_op_put_by_val): Test for the empty value tag, instead
4022 of testing for the cell tag with a 0 payload.
4024 * runtime/JSValue.cpp:
4025 (JSC::JSValue::description): Added support for dumping the new empty value,
4026 and deleted values, in debug builds.
4028 * runtime/JSValue.h:
4029 (JSC::JSValue::JSValue()): Construct JSValue() with the empty value tag.
4031 (JSC::JSValue::JSValue(JSCell*)): Convert null pointer to the empty value
4032 tag, to avoid having two different c++ versions of null / empty.
4034 (JSC::JSValue::operator bool): Test for the empty value tag, instead
4035 of testing for the cell tag with a 0 payload.
4037 2009-10-02 Steve Falkenburg <sfalken@apple.com>
4039 Reviewed by Mark Rowe.
4041 <https://bugs.webkit.org/show_bug.cgi?id=29989>
4042 Safari version number shouldn't be exposed in WebKit code
4044 For a WebKit version of 532.3.4:
4045 Product version is: 5.32.3.4 (was 4.0.3.0)
4046 File version is: 5.32.3.4 (was 4.532.3.4)
4048 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc:
4050 2009-10-02 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
4052 Rubber-stamped by Simon Hausmann.
4054 Fix the Qt on Mac OS X build.
4056 * wtf/FastMalloc.cpp:
4058 2009-10-02 Jørgen Lind <jorgen.lind@nokia.com>
4060 Reviewed by Simon Hausmann.
4062 Allow enabling and disabling of the JIT through a qmake variable.
4064 Qt's configure may set this variable through .qmake.cache if a
4065 commandline option is given and/or the compile test for hwcap.h
4068 * JavaScriptCore.pri:
4070 2009-10-01 Mark Rowe <mrowe@apple.com>
4072 Fix the Tiger build. Don't unconditionally enable 3D canvas as it is not supported on Tiger.
4074 * Configurations/FeatureDefines.xcconfig:
4076 2009-10-01 Yongjun Zhang <yongjun.zhang@nokia.com>
4078 Reviewed by Darin Adler.
4080 https://bugs.webkit.org/show_bug.cgi?id=29187
4082 Don't inline ~ListRefPtr() to work around winscw compiler forward declaration
4083 bug regarding templated classes.
4085 The compiler bug is reported at:
4086 https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812
4088 The change will be reverted when the above bug is fixed in winscw compiler.
4091 (WTF::::~ListRefPtr):
4093 2009-10-01 Zoltan Horvath <zoltan@webkit.org>
4095 Reviewed by Simon Hausmann.
4097 [Qt] Allow custom memory allocation control for the whole JavaScriptCore
4098 https://bugs.webkit.org/show_bug.cgi?id=27029
4100 Since in JavaScriptCore almost every class which has been instantiated by operator new is
4101 inherited from FastAllocBase (bug #20422), we disable customizing global operator new for the Qt-port
4102 when USE_SYSTEM_MALLOC=0.
4104 Add #include <unistd.h> to FastMalloc.cpp because it's used by TCMalloc_PageHeap::scavengerThread().
4105 (It's needed for the functionality of TCmalloc.)
4107 Add TCSystemAlloc.cpp to JavaScriptCore.pri if USE_SYSTEM_MALLOC is disabled.
4109 * JavaScriptCore.pri:
4110 * wtf/FastMalloc.cpp:
4114 2009-09-30 Gabor Loki <loki@inf.u-szeged.hu>
4116 Reviewed by George Staikos.
4118 Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
4119 https://bugs.webkit.org/show_bug.cgi?id=29122
4121 Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
4122 macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
4123 when Thumb-2 instruction set is the required target. The
4124 PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
4125 case where the code is common the PLATFORM(ARM) have to be used.
4127 Modified by George Wright <gwright@rim.com> to correctly work
4128 with the RVCT-defined __TARGET_ARCH_ARM and __TARGET_ARCH_THUMB
4129 compiler macros, as well as adding readability changes.
4133 2009-09-30 Oliver Hunt <oliver@apple.com>
4135 Reviewed by Geoff Garen.
4137 Devirtualise array toString conversion
4139 Tweak the implementation of Array.prototype.toString to have a fast path
4140 when acting on a true JSArray.
4142 * runtime/ArrayPrototype.cpp:
4143 (JSC::arrayProtoFuncToString):
4145 2009-09-30 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
4147 Reviewed by Geoffrey Garen.
4149 Buildfix for platforms using JSVALUE32.
4150 https://bugs.webkit.org/show_bug.cgi?id=29915
4152 After http://trac.webkit.org/changeset/48905 the build broke in JSVALUE32 case.
4153 Also removed unreachable code.
4155 * jit/JITArithmetic.cpp:
4156 (JSC::JIT::emit_op_add):
4157 - Declaration of "OperandTypes types" moved before first use.
4158 - Typos fixed: dst modified to result, regT2 added.
4159 - Unreachable code removed.
4160 (JSC::JIT::emitSlow_op_add):
4161 - Missing declaration of "OperandTypes types" added.
4163 2009-09-30 Janne Koskinen <janne.p.koskinen@digia.com>
4165 Reviewed by Simon Hausmann.
4167 Reduce heap size on Symbian from 64MB to 8MB.
4169 This is not a perfect fix, it requires more fine tuning.
4170 But this makes it possible again to debug in the emulator,
4171 which is more important in order to be able to fix other
4174 * runtime/Collector.h:
4176 2009-09-30 Janne Koskinen <janne.p.koskinen@digia.com>
4178 Reviewed by Simon Hausmann.
4180 Fix CRASH() macro for Symbian build.
4182 * wtf/Assertions.h: Added missing }
4184 2009-09-29 Geoffrey Garen <ggaren@apple.com>
4186 Reviewed by Gavin Barraclough.
4188 Inlined a few math operations.
4190 ~1% SunSpider speedup.
4193 * jit/JITArithmetic.cpp:
4194 (JSC::JIT::compileBinaryArithOpSlowCase):
4195 (JSC::JIT::emitSlow_op_add):
4196 (JSC::JIT::emitSlow_op_mul):
4197 (JSC::JIT::emit_op_sub):
4198 (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on
4199 a constant int and a double.
4201 2009-09-28 Oliver Hunt <oliver@apple.com>
4203 Reviewed by Gavin Barraclough.
4205 Tidy up codeblock sampler
4206 https://bugs.webkit.org/show_bug.cgi?id=29836
4208 Some rather simple refactoring of codeblock sampler so that
4209 it's easier for us to use it to find problems in non-jsc
4212 * JavaScriptCore.exp:
4213 * bytecode/SamplingTool.h:
4214 * debugger/Debugger.cpp:
4215 (JSC::evaluateInGlobalCallFrame):
4216 * debugger/DebuggerCallFrame.cpp:
4217 (JSC::DebuggerCallFrame::evaluate):
4218 * interpreter/Interpreter.cpp:
4219 (JSC::Interpreter::Interpreter):
4220 (JSC::Interpreter::execute):
4221 (JSC::Interpreter::privateExecute):
4222 (JSC::Interpreter::enableSampler):
4223 (JSC::Interpreter::dumpSampleData):
4224 (JSC::Interpreter::startSampling):
4225 (JSC::Interpreter::stopSampling):
4226 * interpreter/Interpreter.h:
4227 (JSC::Interpreter::sampler):
4231 * runtime/Completion.cpp:
4234 * runtime/Executable.h:
4235 (JSC::EvalExecutable::EvalExecutable):
4236 (JSC::ProgramExecutable::create):
4237 (JSC::ProgramExecutable::ProgramExecutable):
4238 * runtime/JSGlobalData.cpp:
4239 (JSC::JSGlobalData::startSampling):
4240 (JSC::JSGlobalData::stopSampling):
4241 (JSC::JSGlobalData::dumpSampleData):
4242 * runtime/JSGlobalData.h:
4243 * runtime/JSGlobalObjectFunctions.cpp:
4244 (JSC::globalFuncEval):
4246 2009-09-29 Jeremy Orlow <jorlow@chromium.org>
4248 Reviewed by Dimitri Glazkov.
4250 Add GYP generated files to svn:ignore
4251 https://bugs.webkit.org/show_bug.cgi?id=29895
4253 The following files are generated by JavaScriptCore's GYP file and should be ignored:
4263 * JavaScriptCore.gyp: Changed property svn:ignore.
4265 2009-09-29 Geoffrey Garen <ggaren@apple.com>
4267 Reviewed by Sam Weinig.
4269 Standardized an optimization for adding non-numbers.
4271 SunSpider says maybe a tiny speedup.
4273 * jit/JITArithmetic.cpp:
4274 (JSC::JIT::emit_op_add):
4275 (JSC::JIT::emitSlow_op_add):
4277 2009-09-29 Geoffrey Garen <ggaren@apple.com>
4279 Windows build fix: export a new symbol.
4281 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4282 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4284 2009-09-28 Geoffrey Garen <ggaren@apple.com>
4286 Reviewed by Sam Weinig.
4288 Removed virtual destructor from JSGlobalObjectData to eliminate pointer
4289 fix-ups when accessing JSGlobalObject::d.
4291 Replaced with an explicit destructor function pointer.
4293 6% speedup on bench-alloc-nonretained.js.
4295 * JavaScriptCore.exp:
4296 * runtime/JSGlobalObject.cpp:
4297 (JSC::JSGlobalObject::~JSGlobalObject):
4298 (JSC::JSGlobalObject::destroyJSGlobalObjectData):
4299 * runtime/JSGlobalObject.h:
4300 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
4301 (JSC::JSGlobalObject::JSGlobalObject):
4303 2009-09-29 Janne Koskinen <janne.p.koskinen@digia.com>
4305 Reviewed by David Kilzer.
4307 [Qt] Assert messages prints visible in Symbian
4308 https://bugs.webkit.org/show_bug.cgi?id=29808
4310 Asserts use vprintf to print the messages to stderr.
4311 In Symbian Open C it is not possible to see stderr so
4312 I routed the messages to stdout instead.
4314 * wtf/Assertions.cpp:
4316 2009-09-29 Janne Koskinen <janne.p.koskinen@digia.com>
4318 Reviewed by Darin Adler.
4320 [Qt] Symbian CRASH macro implementation
4322 Added Symbian specific crash macro that
4323 stops to crash line if JIT debugging is used.
4324 Additional differentiation of access violation
4325 (KERN-EXEC 3) and CRASH panic.
4329 2009-09-28 Mark Rowe <mrowe@apple.com>
4331 Fix the PowerPC build.
4333 * JavaScriptCore.exp:
4335 2009-09-28 Mark Rowe <mrowe@apple.com>
4337 Reviewed by Gavin Barraclough.
4339 <rdar://problem/7195704> JavaScriptCore fails to mark registers when built for x86_64 using LLVM GCC.
4341 * runtime/Collector.cpp:
4342 (JSC::Heap::markCurrentThreadConservatively): Force jmp_buf to use the appropriate alignment for a pointer
4343 to ensure that we correctly interpret the contents of registers during marking.
4345 2009-09-28 Geoffrey Garen <ggaren@apple.com>
4347 Windows build fix: added new exports.
4349 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4350 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4352 2009-09-28 Geoffrey Garen <ggaren@apple.com>
4354 Windows build fix: removed exports that no longer exist.
4356 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4357 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4359 2009-09-28 Geoffrey Garen <ggaren@apple.com>
4361 Reviewed by Darin Adler.
4363 NotNullPassRefPtr: smart pointer optimized for passing references that are not null
4364 https://bugs.webkit.org/show_bug.cgi?id=29822
4366 Added NotNullPassRefPtr, and deployed it in all places that initialize
4369 2.2% speedup on bench-allocate-nonretained.js.
4371 * API/JSCallbackConstructor.cpp:
4372 (JSC::JSCallbackConstructor::JSCallbackConstructor):
4373 * API/JSCallbackConstructor.h:
4374 * API/JSCallbackObject.h:
4375 * API/JSCallbackObjectFunctions.h:
4376 (JSC::JSCallbackObject::JSCallbackObject):
4377 * JavaScriptCore.exp:
4378 * bytecode/CodeBlock.h:
4379 (JSC::CodeBlock::addFunctionDecl):
4380 (JSC::CodeBlock::addFunctionExpr):
4381 * runtime/ArrayConstructor.cpp:
4382 (JSC::ArrayConstructor::ArrayConstructor):
4383 * runtime/ArrayConstructor.h:
4384 * runtime/ArrayPrototype.cpp:
4385 (JSC::ArrayPrototype::ArrayPrototype):
4386 * runtime/ArrayPrototype.h:
4387 * runtime/BooleanConstructor.cpp:
4388 (JSC::BooleanConstructor::BooleanConstructor):
4389 * runtime/BooleanConstructor.h:
4390 * runtime/BooleanObject.cpp:
4391 (JSC::BooleanObject::BooleanObject):
4392 * runtime/BooleanObject.h:
4393 * runtime/BooleanPrototype.cpp:
4394 (JSC::BooleanPrototype::BooleanPrototype):
4395 * runtime/BooleanPrototype.h:
4396 * runtime/DateConstructor.cpp:
4397 (JSC::DateConstructor::DateConstructor):
4398 * runtime/DateConstructor.h:
4399 * runtime/DateInstance.cpp:
4400 (JSC::DateInstance::DateInstance):
4401 * runtime/DateInstance.h:
4402 * runtime/DatePrototype.cpp:
4403 (JSC::DatePrototype::DatePrototype):
4404 * runtime/DatePrototype.h:
4405 * runtime/ErrorConstructor.cpp:
4406 (JSC::ErrorConstructor::ErrorConstructor):
4407 * runtime/ErrorConstructor.h:
4408 * runtime/ErrorInstance.cpp:
4409 (JSC::ErrorInstance::ErrorInstance):
4410 * runtime/ErrorInstance.h:
4411 * runtime/ErrorPrototype.cpp:
4412 (JSC::ErrorPrototype::ErrorPrototype):
4413 * runtime/ErrorPrototype.h:
4414 * runtime/FunctionConstructor.cpp:
4415 (JSC::FunctionConstructor::FunctionConstructor):
4416 * runtime/FunctionConstructor.h:
4417 * runtime/FunctionPrototype.cpp:
4418 (JSC::FunctionPrototype::FunctionPrototype):
4419 * runtime/FunctionPrototype.h:
4420 * runtime/GlobalEvalFunction.cpp:
4421 (JSC::GlobalEvalFunction::GlobalEvalFunction):
4422 * runtime/GlobalEvalFunction.h:
4423 * runtime/InternalFunction.cpp:
4424 (JSC::InternalFunction::InternalFunction):
4425 * runtime/InternalFunction.h:
4426 (JSC::InternalFunction::InternalFunction):
4427 * runtime/JSActivation.cpp:
4428 (JSC::JSActivation::JSActivation):
4429 * runtime/JSActivation.h:
4430 (JSC::JSActivation::JSActivationData::JSActivationData):
4431 * runtime/JSArray.cpp:
4432 (JSC::JSArray::JSArray):
4433 * runtime/JSArray.h:
4434 * runtime/JSByteArray.cpp:
4435 (JSC::JSByteArray::JSByteArray):
4436 * runtime/JSByteArray.h:
4437 * runtime/JSFunction.cpp:
4438 (JSC::JSFunction::JSFunction):
4439 * runtime/JSFunction.h:
4440 * runtime/JSGlobalObject.h:
4441 (JSC::JSGlobalObject::JSGlobalObject):
4442 * runtime/JSONObject.h:
4443 (JSC::JSONObject::JSONObject):
4444 * runtime/JSObject.h:
4445 (JSC::JSObject::JSObject):
4446 (JSC::JSObject::setStructure):
4447 * runtime/JSVariableObject.h:
4448 (JSC::JSVariableObject::JSVariableObject):
4449 * runtime/JSWrapperObject.h:
4450 (JSC::JSWrapperObject::JSWrapperObject):
4451 * runtime/MathObject.cpp:
4452 (JSC::MathObject::MathObject):
4453 * runtime/MathObject.h:
4454 * runtime/NativeErrorConstructor.cpp:
4455 (JSC::NativeErrorConstructor::NativeErrorConstructor):
4456 * runtime/NativeErrorConstructor.h:
4457 * runtime/NativeErrorPrototype.cpp:
4458 (JSC::NativeErrorPrototype::NativeErrorPrototype):
4459 * runtime/NativeErrorPrototype.h:
4460 * runtime/NumberConstructor.cpp:
4461 (JSC::NumberConstructor::NumberConstructor):
4462 * runtime/NumberConstructor.h:
4463 * runtime/NumberObject.cpp:
4464 (JSC::NumberObject::NumberObject):
4465 * runtime/NumberObject.h:
4466 * runtime/NumberPrototype.cpp:
4467 (JSC::NumberPrototype::NumberPrototype):
4468 * runtime/NumberPrototype.h:
4469 * runtime/ObjectConstructor.cpp:
4470 (JSC::ObjectConstructor::ObjectConstructor):
4471 * runtime/ObjectConstructor.h:
4472 * runtime/ObjectPrototype.cpp:
4473 (JSC::ObjectPrototype::ObjectPrototype):
4474 * runtime/ObjectPrototype.h:
4475 * runtime/PropertyNameArray.h:
4476 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
4477 * runtime/PrototypeFunction.cpp:
4478 (JSC::PrototypeFunction::PrototypeFunction):
4479 * runtime/PrototypeFunction.h:
4480 * runtime/RegExpConstructor.cpp:
4481 (JSC::RegExpConstructor::RegExpConstructor):
4482 * runtime/RegExpConstructor.h:
4483 * runtime/RegExpObject.cpp:
4484 (JSC::RegExpObject::RegExpObject):
4485 * runtime/RegExpObject.h:
4486 (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
4487 * runtime/RegExpPrototype.cpp:
4488 (JSC::RegExpPrototype::RegExpPrototype):
4489 * runtime/RegExpPrototype.h:
4490 * runtime/StringConstructor.cpp:
4491 (JSC::StringConstructor::StringConstructor):
4492 * runtime/StringConstructor.h:
4493 * runtime/StringObject.cpp:
4494 (JSC::StringObject::StringObject):
4495 * runtime/StringObject.h:
4496 * runtime/StringObjectThatMasqueradesAsUndefined.h:
4497 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
4498 * runtime/StringPrototype.cpp:
4499 (JSC::StringPrototype::StringPrototype):
4500 * runtime/StringPrototype.h:
4502 (WTF::NotNullPassRefPtr::NotNullPassRefPtr):
4503 (WTF::NotNullPassRefPtr::~NotNullPassRefPtr):
4504 (WTF::NotNullPassRefPtr::get):
4505 (WTF::NotNullPassRefPtr::clear):
4506 (WTF::NotNullPassRefPtr::releaseRef):
4507 (WTF::NotNullPassRefPtr::operator*):
4508 (WTF::NotNullPassRefPtr::operator->):
4509 (WTF::NotNullPassRefPtr::operator!):
4510 (WTF::NotNullPassRefPtr::operator UnspecifiedBoolType):
4512 (WTF::RefPtr::RefPtr):
4515 2009-09-28 Oliver Hunt <oliver@apple.com>
4517 Reviewed by Geoff Garen.
4519 Hard dependency on SSE2 instruction set with JIT
4520 https://bugs.webkit.org/show_bug.cgi?id=29779
4522 Add floating point support checks to op_jfalse and op_jtrue, and
4523 fix the logic for the slow case of op_add
4525 * jit/JITArithmetic.cpp:
4526 (JSC::JIT::emitSlow_op_add):
4527 * jit/JITOpcodes.cpp:
4528 (JSC::JIT::emit_op_jfalse):
4529 (JSC::JIT::emit_op_jtrue):
4531 2009-09-28 Yaar Schnitman <yaar@chromium.org>
4533 Reviewed by Dimitri Glazkov.
4535 Chromium port - recognize we are being built independently
4536 of chromium and look for dependencies under webkit/chromium rather
4539 https://bugs.webkit.org/show_bug.cgi?id=29722
4541 * JavaScriptCore.gyp/JavaScriptCore.gyp:
4543 2009-09-28 Jakub Wieczorek <faw217@gmail.com>
4545 Reviewed by Simon Hausmann.
4547 [Qt] Implement XSLT support with QtXmlPatterns.
4548 https://bugs.webkit.org/show_bug.cgi?id=28303
4550 * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define.
4552 2009-09-28 Gabor Loki <loki@inf.u-szeged.hu>
4554 Reviewed by Simon Hausmann.
4556 Remove __clear_cache which is an internal function of GCC
4557 https://bugs.webkit.org/show_bug.cgi?id=28886
4559 Although __clear_cache is exported from GCC, this is an internal
4560 function. GCC makes no promises about it.
4562 * jit/ExecutableAllocator.h:
4563 (JSC::ExecutableAllocator::cacheFlush):
4565 2009-09-28 Sam Weinig <sam@webkit.org>
4567 Reviewed by Oliver Hunt.
4569 Fix an absolute path to somewhere in Oliver's machine to a relative path
4570 for derived JSONObject.lut.h.
4572 * JavaScriptCore.xcodeproj/project.pbxproj:
4574 2009-09-28 Joerg Bornemann <joerg.bornemann@nokia.com>
4576 Reviewed by Simon Hausmann.
4578 Add ARM version detection for Windows CE.
4582 2009-09-26 Yongjun Zhang <yongjun.zhang@nokia.com>
4584 Reviewed by Simon Hausmann.
4586 Add MarkStackSymbian.cpp to build JavascriptCore for Symbian.
4588 Re-use Windows shrinkAllocation implementation because Symbian doesn't
4589 support releasing part of memory region.
4591 Use fastMalloc and fastFree to implement allocateStack and releaseStack
4594 * JavaScriptCore.pri:
4595 * runtime/MarkStack.h:
4596 (JSC::MarkStack::MarkStackArray::shrinkAllocation):
4597 * runtime/MarkStackSymbian.cpp: Added.
4598 (JSC::MarkStack::initializePagesize):
4599 (JSC::MarkStack::allocateStack):
4600 (JSC::MarkStack::releaseStack):
4602 2009-09-25 Gabor Loki <loki@inf.u-szeged.hu>
4604 Reviewed by Gavin Barraclough.
4606 Fix unaligned data access in YARR_JIT on ARMv5 and below.
4607 https://bugs.webkit.org/show_bug.cgi?id=29695
4609 On ARMv5 and below all data access should be naturally aligned.
4610 In the YARR_JIT there is a case when character pairs are
4611 loaded from the input string, but this data access is not
4612 naturally aligned. This fix introduces load32WithUnalignedHalfWords
4613 and branch32WithUnalignedHalfWords functions which contain
4614 naturally aligned memory loads - half word loads - on ARMv5 and below.
4616 * assembler/MacroAssemblerARM.cpp:
4617 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
4618 * assembler/MacroAssemblerARM.h:
4619 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
4620 (JSC::MacroAssemblerARM::branch32WithUnalignedHalfWords):
4621 * assembler/MacroAssemblerARMv7.h:
4622 (JSC::MacroAssemblerARMv7::load32WithUnalignedHalfWords):
4623 (JSC::MacroAssemblerARMv7::branch32):
4624 (JSC::MacroAssemblerARMv7::branch32WithUnalignedHalfWords):
4625 * assembler/MacroAssemblerX86Common.h:
4626 (JSC::MacroAssemblerX86Common::load32WithUnalignedHalfWords):
4627 (JSC::MacroAssemblerX86Common::branch32WithUnalignedHalfWords):
4629 * yarr/RegexJIT.cpp:
4630 (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
4632 2009-09-25 Jeremy Orlow <jorlow@chromium.org>
4634 This is breaking Chromium try bots, so I'm counting this as a build fix.
4636 Add more svn:ignore exceptions. On different platforms, these files are
4637 generated with different case for JavaScriptCore. Also there are some
4638 wtf project files that get built apparently.
4640 * JavaScriptCore.gyp: Changed property svn:ignore.
4642 2009-09-25 Ada Chan <adachan@apple.com>
4646 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4647 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4649 2009-09-25 Geoffrey Garen <ggaren@apple.com>
4651 Reviewed by Darin Adler.
4653 Inlined some object creation code, including lexicalGlobalObject access
4654 https://bugs.webkit.org/show_bug.cgi?id=29750
4656 SunSpider says 0.5% faster.
4658 0.8% speedup on bench-alloc-nonretained.js.
4659 2.5% speedup on v8-splay.js.
4661 * interpreter/CachedCall.h:
4662 (JSC::CachedCall::CachedCall):
4663 * interpreter/CallFrame.h:
4664 (JSC::ExecState::lexicalGlobalObject):
4665 (JSC::ExecState::globalThisValue):
4666 * interpreter/Interpreter.cpp:
4667 (JSC::Interpreter::dumpRegisters):
4668 (JSC::Interpreter::execute):
4669 (JSC::Interpreter::privateExecute):
4671 (JSC::DEFINE_STUB_FUNCTION):
4672 * runtime/FunctionConstructor.cpp:
4673 (JSC::constructFunction):
4674 * runtime/ScopeChain.cpp:
4675 (JSC::ScopeChainNode::print):
4676 * runtime/ScopeChain.h:
4677 (JSC::ScopeChainNode::ScopeChainNode):
4678 (JSC::ScopeChainNode::~ScopeChainNode):
4679 (JSC::ScopeChainNode::push):
4680 (JSC::ScopeChain::ScopeChain):
4681 (JSC::ScopeChain::globalObject): Added a globalObject data member to ScopeChainNode.
4682 Replaced accessor function for globalObject() with data member. Replaced
4683 globalThisObject() accessor with direct access to globalThis, to match.
4685 * runtime/JSGlobalObject.cpp:
4686 (JSC::JSGlobalObject::init):
4687 * runtime/JSGlobalObject.h: Inlined array and object construction.
4689 2009-09-25 Laszlo Gombos <laszlo.1.gombos@nokia.com>
4691 Reviewed by Gavin Barraclough.
4693 Add ARM version detection rules for Symbian
4694 https://bugs.webkit.org/show_bug.cgi?id=29715
4698 2009-09-24 Xan Lopez <xlopez@igalia.com>
4700 Reviewed by Mark "Do It!" Rowe.
4702 Some GCC versions don't like C++-style comments in preprocessor
4703 directives, change to C-style to shut them up.
4707 2009-09-24 Oliver Hunt <oliver@apple.com>
4709 Reviewed by Gavin Barraclough.
4711 Division is needlessly slow in 64-bit
4712 https://bugs.webkit.org/show_bug.cgi?id=29723
4714 Add codegen for op_div on x86-64
4717 (JSC::JIT::privateCompileMainPass):
4718 (JSC::JIT::privateCompileSlowCases):
4720 * jit/JITArithmetic.cpp:
4721 (JSC::JIT::compileBinaryArithOpSlowCase):
4722 (JSC::JIT::emit_op_div):
4723 (JSC::JIT::emitSlow_op_div):
4724 * jit/JITInlineMethods.h:
4725 (JSC::JIT::isOperandConstantImmediateDouble):
4726 (JSC::JIT::addressFor):
4727 (JSC::JIT::emitLoadDouble):
4728 (JSC::JIT::emitLoadInt32ToDouble):
4729 (JSC::JIT::emitJumpSlowCaseIfNotImmediateNumber):
4731 2009-09-24 Jeremy Orlow <jorlow@chromium.org>
4733 Reviewed by Dimitri Glazkov.
4735 Add GYP generated files to svn:ignore
4736 https://bugs.webkit.org/show_bug.cgi?id=29724
4738 Adding the following files to the svn:ignore list (all in the
4739 JavaScriptCore/JavaScriptCore.gyp directory)
4741 JavaScriptCore.xcodeproj
4743 JavaScriptCore.vcproj
4744 JavaScriptCore_Debug.rules
4745 JavaScriptCore_Release.rules
4746 JavaScriptCore_Release - no tcmalloc.rules
4747 JavaScriptCore_Purify.rules
4749 JavaScriptCore_Debug_rules.mk
4750 JavaScriptCore_Release_rules.mk
4751 JavaScriptCore_Release - no tcmalloc_rules.mk
4752 JavaScriptCore_Purify_rules.mk
4753 JavaScriptCore.scons
4754 JavaScriptCore_main.scons
4756 * JavaScriptCore.gyp: Changed property svn:ignore.
4758 2009-09-24 Yong Li <yong.li@torchmobile.com>
4760 Reviewed by Adam Barth.
4762 Replace platform-dependent code with WTF::currentTime()
4763 https://bugs.webkit.org/show_bug.cgi?id=29148
4768 (StopWatch::getElapsedMS):
4769 * runtime/TimeoutChecker.cpp:
4772 2009-09-24 Mark Rowe <mrowe@apple.com>
4774 Reviewed by Sam Weinig.
4776 <rdar://problem/7215058> FastMalloc scavenging thread should be named
4778 * wtf/FastMalloc.cpp:
4779 (WTF::TCMalloc_PageHeap::scavengerThread): Set the thread name.
4780 * wtf/Platform.h: Move the knowledge of whether pthread_setname_np exists to here as HAVE(PTHREAD_SETNAME_NP).
4781 * wtf/ThreadingPthreads.cpp:
4782 (WTF::setThreadNameInternal): Use HAVE(PTHREAD_SETNAME_NP).
4784 2009-09-24 Geoffrey Garen <ggaren@apple.com>
4786 Reviewed by Sam Weinig.
4788 Renamed clear to removeAll, as suggested by Darin Adler.
4790 * wtf/HashCountedSet.h:
4793 2009-09-24 Mark Rowe <mrowe@apple.com>
4795 Reviewed by Gavin Barraclough.
4797 Fix FastMalloc to build with assertions enabled.
4799 * wtf/FastMalloc.cpp:
4800 (WTF::TCMalloc_Central_FreeList::ReleaseToSpans):
4802 (TCMalloc_SpinLock::IsHeld):
4804 2009-09-24 Geoffrey Garen <ggaren@apple.com>
4806 Suggested by Darin Adler.
4808 Removed some unnecessary parameter names.
4810 * wtf/HashCountedSet.h:
4812 2009-09-24 Janne Koskinen <janne.p.koskinen@digia.com>
4814 Reviewed by Simon Hausmann.
4816 On Windows JSChar is typedef'ed to wchar_t.
4818 When building with WINSCW for Symbian we need to do the
4821 * API/JSStringRef.h:
4823 2009-09-23 Geoffrey Garen <ggaren@apple.com>
4825 A piece of my last patch that I forgot.
4827 * wtf/HashCountedSet.h:
4828 (WTF::::clear): Added HashCountedSet::clear.
4830 2009-09-24 Gabor Loki <loki@inf.u-szeged.hu>
4832 Reviewed by Gavin Barraclough.
4834 Avoid __clear_cache built-in function if DISABLE_BUILTIN_CLEAR_CACHE define is set
4835 https://bugs.webkit.org/show_bug.cgi?id=28886
4837 There are some GCC packages (for example GCC-2006q3 from CodeSourcery)
4838 which contain __clear_cache built-in function only for C while the C++
4839 version of __clear_cache is missing on ARM architectures.
4841 Fixed a small bug in the inline assembly of cacheFlush function on
4844 * jit/ExecutableAllocator.h:
4845 (JSC::ExecutableAllocator::cacheFlush):
4847 2009-09-23 Geoffrey Garen <ggaren@apple.com>
4849 Reviewed by Sam Weinig.
4851 Added the ability to swap vectors with inline capacities, so you can
4852 store a vector with inline capacity in a hash table.
4856 (WTF::VectorBuffer::swap):
4858 2009-09-23 David Kilzer <ddkilzer@apple.com>
4860 Move definition of USE(PLUGIN_HOST_PROCESS) from WebKitPrefix.h to Platform.h
4862 Reviewed by Mark Rowe.
4864 * wtf/Platform.h: Define WTF_USE_PLUGIN_HOST_PROCESS to 1 when
4865 building on 64-bit SnowLeopard. Define to 0 elsewhere.
4867 2009-09-22 Oliver Hunt <oliver@apple.com>
4869 Reviewed by Geoff Garen.
4871 Code sampling builds are broken.
4872 https://bugs.webkit.org/show_bug.cgi?id=29662
4876 * bytecode/EvalCodeCache.h:
4877 (JSC::EvalCodeCache::get):
4878 * bytecode/SamplingTool.cpp:
4879 (JSC::ScriptSampleRecord::sample):
4880 (JSC::SamplingTool::doRun):
4881 (JSC::SamplingTool::notifyOfScope):
4882 (JSC::compareScriptSampleRecords):
4883 (JSC::SamplingTool::dump):
4884 * bytecode/SamplingTool.h:
4885 (JSC::ScriptSampleRecord::ScriptSampleRecord):
4886 (JSC::ScriptSampleRecord::~ScriptSampleRecord):
4887 (JSC::SamplingTool::SamplingTool):
4888 * bytecompiler/BytecodeGenerator.cpp:
4889 (JSC::BytecodeGenerator::BytecodeGenerator):
4890 (JSC::BytecodeGenerator::emitNewFunction):
4891 (JSC::BytecodeGenerator::emitNewFunctionExpression):
4892 * bytecompiler/BytecodeGenerator.h:
4893 (JSC::BytecodeGenerator::makeFunction):
4894 * debugger/Debugger.cpp:
4895 (JSC::evaluateInGlobalCallFrame):
4896 * debugger/DebuggerCallFrame.cpp:
4897 (JSC::DebuggerCallFrame::evaluate):
4899 (JSC::ScopeNode::ScopeNode):
4900 * runtime/Completion.cpp:
4903 * runtime/Executable.cpp:
4904 (JSC::FunctionExecutable::fromGlobalCode):
4905 * runtime/Executable.h:
4906 (JSC::ScriptExecutable::ScriptExecutable):
4907 (JSC::EvalExecutable::EvalExecutable):
4908 (JSC::EvalExecutable::create):
4909 (JSC::ProgramExecutable::ProgramExecutable):
4910 (JSC::FunctionExecutable::create):
4911 (JSC::FunctionExecutable::FunctionExecutable):
4912 * runtime/JSGlobalObjectFunctions.cpp:
4913 (JSC::globalFuncEval):
4915 2009-09-22 Darin Adler <darin@apple.com>
4917 Reviewed by Sam Weinig.
4919 * wtf/Forward.h: Added PassOwnPtr.
4921 2009-09-22 Yaar Schnitman <yaar@chromium.org>
4923 Reviewed by David Levin.
4925 Ported chromium.org's javascriptcore.gyp for the webkit chromium port.
4927 https://bugs.webkit.org/show_bug.cgi?id=29617
4929 * JavaScriptCore.gyp/JavaScriptCore.gyp: Added.
4931 2009-09-22 Thiago Macieira <thiago.macieira@nokia.com>
4933 Reviewed by Simon Hausmann.
4935 Fix compilation with WINSCW: no varargs macros
4937 Disable variadic arguments for WINSCW just like we do
4942 2009-09-22 Kent Hansen <khansen@trolltech.com>
4944 Reviewed by Simon Hausmann.
4946 Disable variadic macros on MSVC7.
4948 This was originally added in r26589 but not extended
4949 when LOG_DISABLED/ASSERT_DISABLED was introduced.
4953 2009-09-22 Simon Hausmann <simon.hausmann@nokia.com>
4955 Unreviewed build fix for Windows CE < 5
4957 Define WINCEBASIC to disable the IsDebuggerPresent() code in
4960 * JavaScriptCore.pri:
4962 2009-09-22 Joerg Bornemann <joerg.bornemann@nokia.com>
4964 Reviewed by Simon Hausmann.
4966 Fix major memory leak in JavaScriptCore RegisterFile on Windows CE
4968 https://bugs.webkit.org/show_bug.cgi?id=29367
4970 On Widows CE we must decommit all committed pages before we release
4971 them. See VirtualFree documentation.
4972 Desktop Windows behaves much smoother in this situation.
4974 * interpreter/RegisterFile.cpp:
4975 (JSC::RegisterFile::~RegisterFile):
4977 2009-09-21 Greg Bolsinga <bolsinga@apple.com>
4979 Reviewed by Simon Fraser & Sam Weinig.
4981 Add ENABLE(ORIENTATION_EVENTS)
4982 https://bugs.webkit.org/show_bug.cgi?id=29508
4984 * wtf/Platform.h: Also sort PLATFORM(IPHONE) #defines.
4986 2009-09-21 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
4988 Reviewed by Eric Seidel.
4990 [Fix] SourceCode's uninitialized member
4992 Potential source of crashes and bugs was fixed. Default constructor
4993 didn't initialized m_provider member.
4995 https://bugs.webkit.org/show_bug.cgi?id=29364
4997 * parser/SourceCode.h:
4998 (JSC::SourceCode::SourceCode):
5000 2009-09-21 Oliver Hunt <oliver@apple.com>
5002 Reviewed by Geoff Garen.
5004 REGRESSION (r48582): Crash in StructureStubInfo::initPutByIdTransition when reloading trac.webkit.org
5005 https://bugs.webkit.org/show_bug.cgi?id=29599
5007 It is unsafe to attempt to cache new property transitions on
5008 dictionaries of any type.
5010 * interpreter/Interpreter.cpp:
5011 (JSC::Interpreter::tryCachePutByID):
5013 (JSC::JITThunks::tryCachePutByID):
5015 2009-09-21 Oliver Hunt <oliver@apple.com>
5017 RS=Maciej Stachowiak.
5019 Re-land SNES fix with corrected assertion.
5021 * interpreter/Interpreter.cpp:
5022 (JSC::Interpreter::resolveGlobal):
5023 (JSC::Interpreter::tryCachePutByID):
5024 (JSC::Interpreter::tryCacheGetByID):
5026 (JSC::JITThunks::tryCachePutByID):
5027 (JSC::JITThunks::tryCacheGetByID):
5028 (JSC::DEFINE_STUB_FUNCTION):
5029 * runtime/BatchedTransitionOptimizer.h:
5030 (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
5031 * runtime/JSObject.cpp:
5032 (JSC::JSObject::removeDirect):
5033 * runtime/Structure.cpp:
5034 (JSC::Structure::Structure):
5035 (JSC::Structure::getEnumerablePropertyNames):
5036 (JSC::Structure::despecifyDictionaryFunction):
5037 (JSC::Structure::addPropertyTransitionToExistingStructure):
5038 (JSC::Structure::addPropertyTransition):
5039 (JSC::Structure::removePropertyTransition):
5040 (JSC::Structure::toDictionaryTransition):
5041 (JSC::Structure::toCacheableDictionaryTransition):
5042 (JSC::Structure::toUncacheableDictionaryTransition):
5043 (JSC::Structure::fromDictionaryTransition):
5044 (JSC::Structure::removePropertyWithoutTransition):
5045 * runtime/Structure.h:
5046 (JSC::Structure::isDictionary):
5047 (JSC::Structure::isUncacheableDictionary):
5049 * runtime/StructureChain.cpp:
5050 (JSC::StructureChain::isCacheable):
5052 2009-09-21 Adam Roben <aroben@apple.com>
5054 Revert r48573, as it caused many assertion failures
5056 * interpreter/Interpreter.cpp:
5058 * runtime/BatchedTransitionOptimizer.h:
5059 * runtime/JSObject.cpp:
5060 * runtime/Structure.cpp:
5061 * runtime/Structure.h:
5062 * runtime/StructureChain.cpp:
5064 2009-09-21 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
5066 Unreviewed make dist build fix. Missing files.
5070 2009-09-19 Gavin Barraclough <barraclough@apple.com>
5072 Reviewed by Sam 'Cabin Boy' Weinig.
5074 Fix stack alignment with ARM THUMB2 JIT.
5075 https://bugs.webkit.org/show_bug.cgi?id=29526
5077 Stack is currently being decremented by 0x3c, bump this to 0x40 to make this a
5078 multiple of 16 bytes.
5081 (JSC::JITThunks::JITThunks):
5084 2009-09-20 Oliver Hunt <oliver@apple.com>
5086 Reviewed by Maciej Stachowiak.
5089 https://bugs.webkit.org/show_bug.cgi?id=29534
5091 The problem was that the emulator used multiple classes with
5092 more properties than our dictionary cutoff allowed, this resulted
5093 in more or less all critical logic inside the emulator requiring
5094 uncached property access.
5096 Rather than simply bumping the dictionary cutoff, this patch
5097 recognises that there are two ways to create a "dictionary"
5098 structure. Either by adding a large number of properties, or
5099 by removing a property. In the case of adding properties we
5100 know all the existing properties will maintain their existing
5101 offsets, so we could cache access to those properties, if we
5102 know they won't be removed.
5104 To make this possible, this patch adds the logic required to
5105 distinguish a dictionary created by addition from one created
5106 by removal. With this logic in place we can now cache access
5107 to objects with large numbers of properties.
5109 SNES performance improved by more than 6x.
5111 * interpreter/Interpreter.cpp:
5112 (JSC::Interpreter::resolveGlobal):
5113 (JSC::Interpreter::tryCachePutByID):
5114 (JSC::Interpreter::tryCacheGetByID):
5116 (JSC::JITThunks::tryCachePutByID):
5117 (JSC::JITThunks::tryCacheGetByID):
5118 (JSC::DEFINE_STUB_FUNCTION):
5119 * runtime/BatchedTransitionOptimizer.h:
5120 (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
5121 * runtime/JSObject.cpp:
5122 (JSC::JSObject::removeDirect):
5123 * runtime/Structure.cpp:
5124 (JSC::Structure::Structure):
5125 (JSC::Structure::getEnumerablePropertyNames):
5126 (JSC::Structure::despecifyDictionaryFunction):
5127 (JSC::Structure::addPropertyTransitionToExistingStructure):
5128 (JSC::Structure::addPropertyTransition):
5129 (JSC::Structure::removePropertyTransition):
5130 (JSC::Structure::toDictionaryTransition):
5131 (JSC::Structure::toCacheableDictionaryTransition):
5132 (JSC::Structure::toUncacheableDictionaryTransition):
5133 (JSC::Structure::fromDictionaryTransition):
5134 (JSC::Structure::removePropertyWithoutTransition):
5135 * runtime/Structure.h:
5136 (JSC::Structure::isDictionary):
5137 (JSC::Structure::isUncacheableDictionary):
5139 * runtime/StructureChain.cpp:
5140 (JSC::StructureChain::isCacheable):
5142 2009-09-19 Oliver Hunt <oliver@apple.com>
5144 Reviewed by Maciej Stachowiak.
5146 Implement ES5 Object.create function
5147 https://bugs.webkit.org/show_bug.cgi?id=29524
5149 Implement Object.create. Very simple patch, effectively Object.defineProperties
5150 only creating the target object itself.
5152 * runtime/CommonIdentifiers.h:
5153 * runtime/ObjectConstructor.cpp:
5154 (JSC::ObjectConstructor::ObjectConstructor):
5155 (JSC::objectConstructorCreate):
5157 2009-09-19 Dan Bernstein <mitz@apple.com>
5159 Fix clean debug builds.
5161 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5163 2009-09-19 Joerg Bornemann <joerg.bornemann@nokia.com>
5165 Reviewed by George Staikos.
5167 QtWebKit Windows CE compile fix
5169 https://bugs.webkit.org/show_bug.cgi?id=29379
5171 There is no _aligned_alloc or _aligned_free on Windows CE.
5172 We just use the Windows code that was there before and use VirtualAlloc.
5173 But that also means that the BLOCK_SIZE must be 64K as this function
5174 allocates on 64K boundaries.
5176 * runtime/Collector.cpp:
5177 (JSC::Heap::allocateBlock):
5178 (JSC::Heap::freeBlock):
5179 * runtime/Collector.h:
5181 2009-09-19 Oliver Hunt <oliver@apple.com>
5183 Reviewed by Sam Weinig.
5185 Implement ES5 Object.defineProperties function
5186 https://bugs.webkit.org/show_bug.cgi?id=29522
5188 Implement Object.defineProperties. Fairly simple patch, simply makes use of
5189 existing functionality used for defineProperty.
5191 * runtime/CommonIdentifiers.h:
5192 * runtime/ObjectConstructor.cpp:
5193 (JSC::ObjectConstructor::ObjectConstructor):
5194 (JSC::defineProperties):
5195 (JSC::objectConstructorDefineProperties):
5197 2009-09-19 Oliver Hunt <oliver@apple.com>
5199 Reviewed by NOBODY (Build fix).
5201 Windows build fix part2
5203 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5204 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5206 2009-09-19 Oliver Hunt <oliver@apple.com>
5208 Reviewed by NOBODY (Buildfix).
5210 Windows build fix part 1.
5212 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5213 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5215 2009-09-18 Oliver Hunt <oliver@apple.com>
5217 Reviewed by Geoff Garen.
5219 Implement ES5 Object.defineProperty function
5220 https://bugs.webkit.org/show_bug.cgi?id=29503
5222 Implement Object.defineProperty. This requires adding the API to
5223 ObjectConstructor, along with a helper function that implements the
5224 ES5 internal [[ToPropertyDescriptor]] function. It then adds
5225 JSObject::defineOwnProperty that implements the appropriate ES5 semantics.
5226 Currently defineOwnProperty uses a delete followed by a put to redefine
5227 attributes of a property, clearly this is less efficient than it could be
5228 but we can improve this if it needs to be possible in future.
5230 * JavaScriptCore.exp:
5231 * debugger/DebuggerActivation.cpp:
5232 (JSC::DebuggerActivation::defineGetter):
5233 (JSC::DebuggerActivation::defineSetter):
5234 * debugger/DebuggerActivation.h:
5235 * interpreter/Interpreter.cpp:
5236 (JSC::Interpreter::privateExecute):
5238 Update defineGetter/Setter calls
5239 * runtime/CommonIdentifiers.h:
5240 * runtime/JSArray.cpp:
5241 (JSC::JSArray::getOwnPropertySlot):
5242 * runtime/JSGlobalObject.cpp:
5243 (JSC::JSGlobalObject::defineGetter):
5244 (JSC::JSGlobalObject::defineSetter):
5245 * runtime/JSGlobalObject.h:
5246 * runtime/JSObject.cpp:
5247 (JSC::JSObject::defineGetter):
5248 (JSC::JSObject::defineSetter):
5249 (JSC::putDescriptor):
5250 (JSC::JSObject::defineOwnProperty):
5251 * runtime/JSObject.h:
5252 * runtime/ObjectConstructor.cpp:
5253 (JSC::ObjectConstructor::ObjectConstructor):
5254 (JSC::objectConstructorGetOwnPropertyDescriptor):
5255 (JSC::toPropertyDescriptor):
5256 (JSC::objectConstructorDefineProperty):
5257 * runtime/ObjectPrototype.cpp:
5258 (JSC::objectProtoFuncDefineGetter):
5259 (JSC::objectProtoFuncDefineSetter):
5260 * runtime/PropertyDescriptor.cpp:
5261 (JSC::PropertyDescriptor::writable):
5262 (JSC::PropertyDescriptor::enumerable):
5263 (JSC::PropertyDescriptor::configurable):
5264 (JSC::PropertyDescriptor::isDataDescriptor):
5265 (JSC::PropertyDescriptor::isGenericDescriptor):
5266 (JSC::PropertyDescriptor::isAccessorDescriptor):
5267 (JSC::PropertyDescriptor::getter):
5268 (JSC::PropertyDescriptor::setter):
5269 (JSC::PropertyDescriptor::setDescriptor):
5270 (JSC::PropertyDescriptor::setAccessorDescriptor):
5271 (JSC::PropertyDescriptor::setWritable):
5272 (JSC::PropertyDescriptor::setEnumerable):
5273 (JSC::PropertyDescriptor::setConfigurable):
5274 (JSC::PropertyDescriptor::setSetter):
5275 (JSC::PropertyDescriptor::setGetter):
5276 (JSC::PropertyDescriptor::equalTo):
5277 (JSC::PropertyDescriptor::attributesEqual):
5278 (JSC::PropertyDescriptor::attributesWithOverride):
5279 * runtime/PropertyDescriptor.h:
5280 (JSC::PropertyDescriptor::PropertyDescriptor):
5281 (JSC::PropertyDescriptor::value):
5282 (JSC::PropertyDescriptor::setValue):
5283 (JSC::PropertyDescriptor::isEmpty):
5284 (JSC::PropertyDescriptor::writablePresent):
5285 (JSC::PropertyDescriptor::enumerablePresent):
5286 (JSC::PropertyDescriptor::configurablePresent):
5287 (JSC::PropertyDescriptor::setterPresent):
5288 (JSC::PropertyDescriptor::getterPresent):
5289 (JSC::PropertyDescriptor::operator==):
5290 (JSC::PropertyDescriptor::):
5292 2009-09-18 Gabor Loki <loki@inf.u-szeged.hu>
5294 Reviewed by Gavin Barraclough.
5296 Build fix to enable ARM_THUMB2 on Linux
5297 https://bugs.webkit.org/show_bug.cgi?id=
5299 * jit/ExecutableAllocator.h:
5300 (JSC::ExecutableAllocator::cacheFlush):
5304 2009-09-18 Gabor Loki <loki@inf.u-szeged.hu>
5306 Reviewed by Gavin Barraclough.
5308 Defines two pseudo-platforms for ARM and Thumb-2 instruction set.
5309 https://bugs.webkit.org/show_bug.cgi?id=29122
5311 Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2
5312 macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used
5313 when Thumb-2 instruction set is the required target. The
5314 PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In
5315 case where the code is common the PLATFORM(ARM) have to be used.
5317 * assembler/ARMAssembler.cpp:
5318 * assembler/ARMAssembler.h:
5319 * assembler/ARMv7Assembler.h:
5320 * assembler/MacroAssembler.h:
5321 * assembler/MacroAssemblerARM.cpp:
5322 * assembler/MacroAssemblerARM.h:
5323 * assembler/MacroAssemblerCodeRef.h:
5324 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
5325 * jit/ExecutableAllocator.h:
5327 * jit/JITInlineMethods.h:
5328 (JSC::JIT::beginUninterruptedSequence):
5329 (JSC::JIT::preserveReturnAddressAfterCall):
5330 (JSC::JIT::restoreReturnAddressBeforeReturn):
5331 (JSC::JIT::restoreArgumentReference):
5332 (JSC::JIT::restoreArgumentReferenceForTrampoline):
5333 * jit/JITOpcodes.cpp:
5335 (JSC::JITThunks::JITThunks):
5338 * yarr/RegexJIT.cpp:
5339 (JSC::Yarr::RegexGenerator::generateEnter):
5341 2009-09-18 Joerg Bornemann <joerg.bornemann@nokia.com>
5343 Reviewed by Simon Hausmann.
5345 Fix the Qt/Windows CE build.
5347 * JavaScriptCore.pri: Build the ce_time.cpp functions from
5348 within Qt externally.
5349 * wtf/DateMath.cpp: Removed unnecessary Qt #ifdef, for the
5350 Qt build these functions are no external, too.
5352 2009-09-17 Janne Koskinen <janne.p.koskinen@digia.com>
5354 Reviewed by Simon Hausmann.
5356 Symbian/WINSCW build fox.
5358 Repeat Q_OS_WIN wchar_t hack for WINSCW, similar to
5361 WINSCW defines wchar_t, thus UChar has to be wchar_t
5363 * wtf/unicode/qt4/UnicodeQt4.h:
5365 2009-09-17 Janne Koskinen <janne.p.koskinen@digia.com>
5367 Reviewed by Simon Hausmann.
5369 Symbian/WINSCW build fix.
5371 https://bugs.webkit.org/show_bug.cgi?id=29186
5373 WINSCW Template specialisation name in declaration must the be the same as in implementation.
5375 * runtime/LiteralParser.h:
5377 2009-09-15 Norbert Leser <norbert.leser@nokia.com>
5379 Reviewed by Darin Adler.
5381 https://bugs.webkit.org/show_bug.cgi?id=27060
5383 Symbian compiler for emulator target (WINSCW) fails with
5384 "illegal operand" for m_attributesInPrevious in structure.ccp
5385 (when calling make_pair functions).
5386 This error is apparently due to the compiler not properly
5387 resolving the unsigned type of the declared bitfield.
5389 Initial patch explicitly casted m_attributesInPrevious
5390 to unsigned, but since bitfield optimization is not critical for
5391 the emulator target, this conditional change in header file
5392 appears to be least intrusive.
5394 * runtime/Structure.h:
5396 2009-09-16 Gabor Loki <loki@inf.u-szeged.hu>
5398 Reviewed by Darin Adler.
5400 Fix GCC warnings on ARM_THUMB2 platform
5402 * assembler/ARMv7Assembler.h:
5403 (JSC::ARMThumbImmediate::countLeadingZerosPartial):
5404 * assembler/MacroAssemblerARMv7.h:
5405 (JSC::MacroAssemblerARMv7::branchTruncateDoubleToInt32):
5406 (JSC::MacroAssemblerARMv7::moveFixedWidthEncoding):
5408 2009-09-16 Greg Bolsinga <bolsinga@apple.com>
5410 Add ENABLE(INSPECTOR)
5411 https://bugs.webkit.org/show_bug.cgi?id=29260
5413 Reviewed by David Kilzer.
5417 2009-09-16 Greg Bolsinga <bolsinga@apple.com>
5419 Add ENABLE(CONTEXT_MENUS)
5420 https://bugs.webkit.org/show_bug.cgi?id=29225
5422 Reviewed by David Kilzer.
5426 2009-09-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
5428 Reviewed by Eric Seidel.
5430 The webkit stdint and stdbool headers exists because
5431 the compiler MSVC doesn't include them. The check
5432 should not check for PLATFORM(WIN_OS) but for MSVC.
5434 * os-win32/stdbool.h:
5435 * os-win32/stdint.h:
5437 2009-09-16 Greg Bolsinga <bolsinga@apple.com>
5439 Add ENABLE(DRAG_SUPPORT)
5440 https://bugs.webkit.org/show_bug.cgi?id=29233
5442 Reviewed by David Kilzer.
5446 2009-09-16 Kevin Ollivier <kevino@theolliviers.com>
5448 waf build fix after flag was moved to correct place.
5452 2009-09-16 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
5454 Reviewed by Simon Hausmann.
5456 [Qt] Build fix for 64-bit Qt on Mac OS X
5458 * wtf/Platform.h: Use JSVALUE64 on DARWIN, not only on MAC
5460 2009-09-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
5462 Reviewed by Simon Hausmann.
5464 [Qt] Fix wtf/ThreadSpecific.h under Qt to free thread local objects.
5465 https://bugs.webkit.org/show_bug.cgi?id=29295
5467 This is an important fix when JavaScript workers are in use, since
5468 unfreed ThreadGlobalDatas leak a big amount of memory (50-100k each).
5469 QThreadStorage calls the destructor of a given object, which is the
5470 ThreadSpecific::Data. Unlike pthread, Qt is object oriented, and does
5471 not support the calling of a static utility function when the thread
5472 is about to close. In this patch we call the ThreadSpecific::destroy()
5473 utility function from the destructor of ThreadSpecific::Data. Moreover,
5474 since Qt resets all thread local values to 0 before the calling of the
5475 appropriate destructors, we set back the pointer to its original value.
5476 This is necessary because the get() method of the ThreadSpecific
5477 object may be called during the exuction of the destructor.
5479 * wtf/ThreadSpecific.h:
5480 (WTF::ThreadSpecific::Data::~Data):
5481 (WTF::::~ThreadSpecific):
5485 2009-09-10 Oliver Hunt <oliver@apple.com>
5487 Reviewed by Geoff Garen.
5489 Allow anonymous storage inside JSObject
5490 https://bugs.webkit.org/show_bug.cgi?id=29168
5492 Add the concept of anonymous slots to Structures so that it is
5493 possible to store references to values that need marking in the
5494 standard JSObject storage buffer. This allows us to reduce the
5495 malloc overhead of some objects (by allowing them to store JS
5496 values in the inline storage of the object) and reduce the
5497 dependence of custom mark functions (if all an objects children
5498 are in the standard object property storage there's no need to
5499 mark them manually).
5501 * JavaScriptCore.exp:
5502 * runtime/JSObject.h:
5503 (JSC::JSObject::putAnonymousValue):
5504 (JSC::JSObject::getAnonymousValue):
5505 (JSC::JSObject::addAnonymousSlots):
5506 * runtime/JSWrapperObject.h:
5507 (JSC::JSWrapperObject::createStructure):
5508 (JSC::JSWrapperObject::JSWrapperObject):
5509 (JSC::JSWrapperObject::setInternalValue):
5510 * runtime/PropertyMapHashTable.h:
5511 * runtime/Structure.cpp:
5512 (JSC::Structure::~Structure):
5513 (JSC::Structure::materializePropertyMap):
5514 (JSC::Structure::addAnonymousSlotsTransition):
5515 (JSC::Structure::copyPropertyTable):
5516 (JSC::Structure::put):
5517 (JSC::Structure::rehashPropertyMapHashTable):
5518 * runtime/Structure.h:
5519 (JSC::Structure::propertyStorageSize):
5520 (JSC::StructureTransitionTable::reifySingleTransition):
5521 * runtime/StructureTransitionTable.h:
5522 (JSC::StructureTransitionTable::TransitionTable::addSlotTransition):
5523 (JSC::StructureTransitionTable::TransitionTable::removeSlotTransition):
5524 (JSC::StructureTransitionTable::TransitionTable::getSlotTransition):
5525 (JSC::StructureTransitionTable::getAnonymousSlotTransition):
5526 (JSC::StructureTransitionTable::addAnonymousSlotTransition):
5527 (JSC::StructureTransitionTable::removeAnonymousSlotTransition):
5529 2009-09-15 Alex Milowski <alex@milowski.com>
5531 Reviewed by Tor Arne Vestbø.
5533 Added the ENABLE_MATHML define to the features
5535 * Configurations/FeatureDefines.xcconfig:
5537 2009-09-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
5539 Reviewed by Tor Arne Vestbø.
5541 [Qt] Build fix for windows.
5543 After http://trac.webkit.org/changeset/47795 the MinGW build broke,
5544 because MinGW has __mingw_aligned_malloc instead of _aligned_malloc.
5546 * runtime/Collector.cpp:
5547 (JSC::Heap::allocateBlock): MinGW case added.
5548 (JSC::Heap::freeBlock): MinGW case added.
5550 2009-09-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
5552 Reviewed by Tor Arne Vestbø.
5554 [Qt] Build fix for Windows/MinGW
5556 https://bugs.webkit.org/show_bug.cgi?id=29268
5558 * wtf/Platform.h: JSVALUE32_64 temporarily disabled on PLATFORM(WIN_OS) with COMPILER(MINGW)
5560 2009-09-14 Gabor Loki <loki@inf.u-szeged.hu>
5562 Reviewed by Gavin Barraclough.
5564 Detect VFP at runtime in generic ARM port on Linux platform.
5565 https://bugs.webkit.org/show_bug.cgi?id=29076
5567 * JavaScriptCore.pri:
5568 * assembler/MacroAssemblerARM.cpp: Added.
5569 (JSC::isVFPPresent):
5570 * assembler/MacroAssemblerARM.h:
5571 (JSC::MacroAssemblerARM::supportsFloatingPoint):
5573 2009-09-14 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
5575 Reviewed by Tor Arne Vestbø.
5577 [Qt] Build fix for windows build.
5579 * JavaScriptCore.pri: Correct a logic error.
5580 * pcre/dftables: Add missing paranthesis for tmpdir function.
5582 2009-09-12 Oliver Hunt <oliver@apple.com>
5584 Reviewed by NOBODY (Build fix).
5586 Build fix for windows exports (again).
5588 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5589 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5591 2009-09-12 Oliver Hunt <oliver@apple.com>
5593 Reviewed by NOBODY (Build fix).
5595 Build fix for windows exports.
5597 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5598 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5600 2009-09-12 Oliver Hunt <oliver@apple.com>
5602 Reviewed by NOBODY (Build fix).
5604 Correct fix for non-allinonefile builds
5606 * runtime/ObjectConstructor.cpp:
5608 2009-09-12 Oliver Hunt <oliver@apple.com>
5610 Reviewed by NOBODY (Build fix).
5612 Fix non-allinonefile builds
5614 * runtime/ObjectConstructor.cpp:
5616 2009-09-12 Oliver Hunt <oliver@apple.com>
5618 Reviewed by Maciej Stachowiak.
5620 [ES5] Implement Object.keys
5621 https://bugs.webkit.org/show_bug.cgi?id=29170
5623 This patch basically requires two separate steps, the first is to split getPropertyNames
5624 into two functions -- getOwnPropertyNames and getPropertyNames, basically making them behave
5625 in the same way as getOwnPropertySlot and getPropertySlot. In essence getOwnPropertyNames
5626 produces the list of properties on an object excluding its prototype chain and getPropertyNames
5627 just iterates the the object and its prototype chain calling getOwnPropertyNames at each level.
5629 * API/JSCallbackObject.h:
5630 * API/JSCallbackObjectFunctions.h:
5631 (JSC::::getOwnPropertyNames):
5632 * JavaScriptCore.exp:
5633 * debugger/DebuggerActivation.cpp:
5634 (JSC::DebuggerActivation::getOwnPropertyNames):
5635 * debugger/DebuggerActivation.h:
5636 * runtime/CommonIdentifiers.h:
5637 * runtime/JSArray.cpp:
5638 (JSC::JSArray::getOwnPropertyNames):
5639 * runtime/JSArray.h:
5640 * runtime/JSByteArray.cpp:
5641 (JSC::JSByteArray::getOwnPropertyNames):
5642 * runtime/JSByteArray.h:
5643 * runtime/JSNotAnObject.cpp:
5644 (JSC::JSNotAnObject::getOwnPropertyNames):
5645 * runtime/JSNotAnObject.h:
5646 * runtime/JSObject.cpp:
5647 (JSC::JSObject::getOwnPropertyNames):
5648 * runtime/JSObject.h:
5649 * runtime/JSVariableObject.cpp:
5650 (JSC::JSVariableObject::getOwnPropertyNames):
5651 * runtime/JSVariableObject.h:
5652 * runtime/ObjectConstructor.cpp:
5653 (JSC::ObjectConstructor::ObjectConstructor):
5654 (JSC::objectConstructorKeys):
5655 * runtime/RegExpMatchesArray.h:
5656 (JSC::RegExpMatchesArray::getOwnPropertyNames):
5657 * runtime/StringObject.cpp:
5658 (JSC::StringObject::getOwnPropertyNames):
5659 * runtime/StringObject.h:
5660 * runtime/Structure.cpp:
5661 (JSC::Structure::getOwnEnumerablePropertyNames):
5662 (JSC::Structure::getEnumerablePropertyNames):
5663 * runtime/Structure.h:
5665 2009-09-11 Oliver Hunt <oliver@apple.com>
5667 Reviewed by Sam Weinig.
5669 getPropertyNames caching is invalid when the prototype chain contains objects with custom getPropertyNames
5670 https://bugs.webkit.org/show_bug.cgi?id=29214
5672 Add a flag to TypeInfo to indicate whether a type overrides getPropertyNames.
5673 This flag is used to make sure that caching of the property name data is safe.
5675 * API/JSCallbackConstructor.h:
5676 (JSC::JSCallbackConstructor::createStructure):
5677 * debugger/DebuggerActivation.h:
5678 (JSC::DebuggerActivation::createStructure):
5679 * runtime/BooleanObject.h:
5680 (JSC::BooleanObject::createStructure):
5681 * runtime/DatePrototype.h:
5682 (JSC::DatePrototype::createStructure):
5683 * runtime/FunctionPrototype.h:
5684 (JSC::FunctionPrototype::createStructure):
5685 * runtime/JSONObject.h:
5686 (JSC::JSONObject::createStructure):
5687 * runtime/JSObject.h:
5688 (JSC::JSObject::createStructure):
5689 * runtime/JSTypeInfo.h:
5690 (JSC::TypeInfo::hasDefaultGetPropertyNames):
5691 * runtime/JSVariableObject.h:
5692 (JSC::JSVariableObject::createStructure):
5693 * runtime/JSWrapperObject.h:
5694 (JSC::JSWrapperObject::createStructure):
5695 * runtime/MathObject.h:
5696 (JSC::MathObject::createStructure):
5697 * runtime/NumberConstructor.h:
5698 (JSC::NumberConstructor::createStructure):
5699 * runtime/NumberObject.h:
5700 (JSC::NumberObject::createStructure):
5701 * runtime/RegExpConstructor.h:
5702 (JSC::RegExpConstructor::createStructure):
5703 * runtime/RegExpObject.h:
5704 (JSC::RegExpObject::createStructure):
5705 * runtime/StructureChain.cpp:
5706 (JSC::StructureChain::isCacheable):
5708 2009-09-11 Alexey Proskuryakov <ap@webkit.org>
5710 Reviewed by Geoff Garen.
5712 https://bugs.webkit.org/show_bug.cgi?id=29207
5713 Add checks for using WebCore JS context on secondary threads
5715 * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
5716 * runtime/JSGlobalData.h:
5717 Added a new mainThreadOnly flag that WebCore would set.
5719 * runtime/Collector.cpp: (JSC::Heap::registerThread): JSC API methods always call this,
5720 so this is a good place to check that the API isn't used form a wrong thread.
5722 2009-09-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
5724 Reviewed by Simon Hausmann.
5726 Compiling JavaScriptCore on sparc 64 with gcc fails.
5728 ThreadSafeShared uses the atomic __gnu_cxx::__exchange_and_add with an int,
5729 however on sparc 64 the _Atomic_word argument is typedefed to long (8 bytes).
5731 The patch disables WTF_USE_LOCKFREE_THREADSAFESHARED in ThreadSafeShared to use
5732 a mutex instead when compiling for sparc 64 with gcc.
5734 https://bugs.webkit.org/show_bug.cgi?id=29175
5737 __sparc64__ is not defined on all OS.
5738 Uses instead: __sparc__ && __arch64__ || __sparcv9
5741 2009-09-11 Prasanth Ullattil <prasanth.ullattil@nokia.com>
5743 Reviewed by Simon Hausmann.
5745 Fix compile error on Windows7(64Bit) with latest SDK.
5747 Added the missing include file.
5749 * runtime/UString.cpp:
5751 2009-09-11 Joerg Bornemann <joerg.bornemann@trolltech.com>
5753 Reviewed by Simon Hausmann.
5755 Qt/Windows CE compile fix, include the executable allocator and
5756 markstack implementation in the windows build.
5758 * JavaScriptCore.pri:
5760 2009-09-08 John Abd-El-Malek <jam@chromium.org>
5762 Reviewed by Dimitri Glazkov.
5764 Remove unneeded define for ActiveX.
5765 https://bugs.webkit.org/show_bug.cgi?id=29054
5769 2009-09-10 Mark Rowe <mrowe@apple.com>
5771 Rubber-stamped by Sam Weinig.
5773 Update JavaScriptCore and WebKit's FeatureDefines.xcconfig so that they are in sync with WebCore as they need to be.
5775 * Configurations/FeatureDefines.xcconfig:
5777 2009-09-10 Fumitoshi Ukai <ukai@chromium.org>
5779 Reviewed by Alexey Proskuryakov.
5781 Export WTF::tryFastMalloc used in WebSocketChannel.
5782 https://bugs.webkit.org/show_bug.cgi?id=28038
5784 * JavaScriptCore.exp:
5785 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5786 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5788 2009-09-10 Oliver Hunt <oliver@apple.com>
5790 Reviewed by NOBODY (Build fix).
5792 Make StructureTransitionTable use an enum for the PtrAndFlags member
5793 used for the single transition slot optimisation.
5795 * runtime/StructureTransitionTable.h:
5796 (JSC::StructureTransitionTable::StructureTransitionTable):
5797 (JSC::StructureTransitionTable::usingSingleTransitionSlot):
5798 (JSC::StructureTransitionTable::):
5800 2009-09-10 Oliver Hunt <oliver@apple.com>
5802 Reviewed by Geoff Garen.
5804 Refactor StructureTransitionTable and Structure to unify handling of the single slot optimization
5805 https://bugs.webkit.org/show_bug.cgi?id=29141
5807 Make StructureTransitionTable encapsulate the single transition slot optimization.
5809 * runtime/Structure.cpp:
5810 (JSC::Structure::Structure):
5811 (JSC::Structure::~Structure):
5812 (JSC::Structure::addPropertyTransitionToExistingStructure):
5813 (JSC::Structure::addPropertyTransition):
5814 (JSC::Structure::addPropertyWithoutTransition):
5815 (JSC::Structure::removePropertyWithoutTransition):
5816 (JSC::Structure::hasTransition):
5817 * runtime/Structure.h:
5818 (JSC::StructureTransitionTable::contains):
5819 (JSC::StructureTransitionTable::get):
5820 (JSC::StructureTransitionTable::hasTransition):
5821 (JSC::StructureTransitionTable::reifySingleTransition):
5822 * runtime/StructureTransitionTable.h:
5823 (JSC::StructureTransitionTable::StructureTransitionTable):
5824 (JSC::StructureTransitionTable::~StructureTransitionTable):
5825 (JSC::StructureTransitionTable::remove):
5826 (JSC::StructureTransitionTable::add):
5827 (JSC::StructureTransitionTable::table):
5828 (JSC::StructureTransitionTable::singleTransition):
5829 (JSC::StructureTransitionTable::usingSingleTransitionSlot):
5830 (JSC::StructureTransitionTable::setSingleTransition):
5831 (JSC::StructureTransitionTable::setTransitionTable):
5832 (JSC::StructureTransitionTable::):
5833 * wtf/PtrAndFlags.h:
5834 (WTF::PtrAndFlags::PtrAndFlags):
5836 2009-09-10 Zoltan Horvath <zoltan@webkit.org>
5838 Reviewed by Darin Adler.
5840 Implement fastDeleteSkippingDestructor for FastAllocBase and fastDeleteAllValues for HashSet
5841 https://bugs.webkit.org/show_bug.cgi?id=25930
5843 FastAllocBase has been extended with fastDeleteSkippingDestructor function which
5844 releases memory without destructor call. fastDeleteAllValues has been implemented
5845 similar as deleteAllValues but it uses fastDelete function to release memory.
5847 * wtf/FastAllocBase.h:
5848 (WTF::fastDeleteSkippingDestructor):
5850 (WTF::fastDeleteAllValues):
5852 2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
5854 Reviewed by Darin Adler.
5856 ARM compiler does not understand GCC visibility attribute
5857 https://bugs.webkit.org/show_bug.cgi?id=29079
5859 * API/JSBase.h: Make the test more specific to hit only
5862 2009-09-10 Adam Barth <abarth@webkit.org>
5864 Unreviewed revert of the previous change. It broke the tests.
5869 2009-09-10 Ben Laurie <benl@google.com>
5871 Reviewed by Adam Barth.
5873 <https://bugs.webkit.org/show_bug.cgi?id=26836>
5875 If dtoa was given a small buffer and the number was either infinite or
5876 NaN, then the buffer would be overflowed.
5880 2009-09-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
5882 Reviewed by Darin Adler.
5884 Change reinterpret_cast to static_cast in r48212.
5886 * jit/ExecutableAllocator.h:
5887 (JSC::ExecutableAllocator::cacheFlush):
5889 2009-09-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
5891 Reviewed by Darin Adler.
5893 Remove WTF_PLATFORM_FORCE_PACK as it is no longer used
5894 https://bugs.webkit.org/show_bug.cgi?id=29066
5898 2009-09-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
5900 Reviewed by Ariya Hidayat.
5902 Implement flushing the instruction cache for Symbian
5903 https://bugs.webkit.org/show_bug.cgi?id=29075
5905 * jit/ExecutableAllocator.h:
5906 (JSC::ExecutableAllocator::cacheFlush): Call IMB_Range to flush
5907 the instruction cache on Symbian
5909 2009-09-09 Kent Hansen <khansen@trolltech.com>
5911 Reviewed by Darin Adler.
5913 https://bugs.webkit.org/show_bug.cgi?id=29024
5914 Make JavaScriptCore compile on platforms with case-insensitive file systems and typeinfo.h in STL
5916 These platforms include Microsoft Visual Studio 2003, and Symbian with Metrowerks compiler.
5918 * JavaScriptCore.gypi:
5919 * JavaScriptCore.xcodeproj/project.pbxproj:
5920 * runtime/JSTypeInfo.h: Copied from JavaScriptCore/runtime/TypeInfo.h.
5921 * runtime/Structure.h:
5922 * runtime/TypeInfo.h: Removed.
5924 2009-09-08 Oliver Hunt <oliver@apple.com>
5926 Reviewed by Maciej Stachowiak.
5928 JSON.stringify(Date) loses the milliseconds information
5929 https://bugs.webkit.org/show_bug.cgi?id=29063
5931 Make sure we include milliseconds in the output of toISOString.
5933 * runtime/DatePrototype.cpp:
5934 (JSC::dateProtoFuncToISOString):
5936 2009-09-08 Kevin Ollivier <kevino@theolliviers.com>
5938 wx build fix, generate derived sources earlier in order to make sure
5939 they're found by the build system when generating the list of sources to build.
5943 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
5945 Reviewed by Simon Hausmann.
5947 Build fix when USE(LOCKFREE_THREADSAFESHARED) is not defined
5948 https://bugs.webkit.org/show_bug.cgi?id=29011
5950 * wtf/Threading.h: Use LOCKFREE_THREADSAFESHARED guard for
5951 atomicIncrement and atomicDecrement
5953 2009-09-07 Zoltan Horvath <zoltan@webkit.org>
5955 Reviewed by Darin Adler.
5957 Allow custom memory allocation control in Yarr's RegexInterpreter
5958 https://bugs.webkit.org/show_bug.cgi?id=29025
5960 Inherits RegexInterpreter classes from FastAllocBase (bug #20422), which has
5961 been instantiated by 'new':
5963 class ByteDisjunction
5964 -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1462
5966 struct BytecodePattern
5967 -> instantiated in JavaScriptCore/yarr/RegexInterpreter.cpp:1279
5969 * yarr/RegexInterpreter.h:
5971 2009-09-07 Drew Wilson <atwilson@google.com>
5973 Reverting r48121 to fix Windows build errors.
5975 * JavaScriptCore.exp:
5977 2009-09-07 Drew Wilson <atwilson@google.com>
5979 Reviewed by David Levin.
5981 Enable SHARED_WORKERS by default
5982 https://bugs.webkit.org/show_bug.cgi?id=28959
5984 * Configurations/FeatureDefines.xcconfig:
5986 2009-09-07 Fumitoshi Ukai <ukai@chromium.org>
5988 Reviewed by Alexey Proskuryakov.
5990 Export WTF::tryFastMalloc used in WebSocketChannel.
5991 https://bugs.webkit.org/show_bug.cgi?id=28038
5993 * JavaScriptCore.exp:
5995 2009-09-04 Oliver Hunt <oliver@apple.com>
5997 Reviewed by NOBODY (Build fix).
5999 Fix windows export files
6001 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6002 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6004 2009-09-04 Oliver Hunt <oliver@apple.com>
6006 Reviewed by Gavin Barraclough.
6008 [[ToString]] conversion should use the actual toString function for String objects.
6010 Remove incorrect specialisations of toString conversions on StringObject.
6012 * JavaScriptCore.exp:
6013 * runtime/StringObject.cpp:
6014 * runtime/StringObject.h:
6016 2009-09-04 Steve Falkenburg <sfalken@apple.com>
6020 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Add new export.
6021 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Add new export.
6023 2009-09-04 Steve Falkenburg <sfalken@apple.com>
6027 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove unneeded export.
6028 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Remove unneeded export.
6030 2009-09-04 Darin Adler <darin@apple.com>
6032 Reviewed by Geoff Garen.
6034 DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32)
6035 https://bugs.webkit.org/show_bug.cgi?id=28909
6039 Make some improvements to garbage collection code:
6041 1) Create a runtime assertion that catches any classes that
6042 override markChildren but have the HasDefaultMark bit set.
6043 2) Remove checks of the mark bit outside the MarkStack::append
6044 function; they are redundant.
6045 3) Improve the efficiency of the asObject and asArray functions
6046 when called on JSCell* to avoid a round trip to JSValue.
6047 4) Make more callers use the checked asCell and asObject
6048 casting functions rather than unchecked casts.
6049 5) Removed the JSCell::marked function and other GC-related
6050 functions because these operations are no longer things that
6051 code other than the core GC code needs to do directly. Fixed
6052 callers that were calling them.
6054 * runtime/Collector.cpp:
6055 (JSC::Heap::markConservatively): Removed unneeded call to MarkStack::drain.
6056 (JSC::Heap::markProtectedObjects): Removed unneeded check of the mark
6057 bit and call to MarkStack::drain.
6058 (JSC::Heap::collect): Removed unneeded checks of the mark bit and also
6059 changed call to SmallStrings::mark to call markChildren instead to match
6060 the rest of the objects.
6061 (JSC::typeName): Removed unneeded cast to JSObject*.
6063 * runtime/JSArray.h:
6064 (JSC::asArray): Added an overload for JSCell* and changed the JSValue
6065 version to call it. Removed some unneeded casts.
6066 (JSC::JSArray::markChildrenDirect): Marked this function inline. It's in
6067 a header, and if not marked inline this could lead to linking problems.
6068 (JSC::MarkStack::markChildren): Added. This helper function is used by
6069 the drain function to avoid repating code. Also added the code here to
6070 check fro default mark violations in debug code. If a markChildren
6071 function adds something to the mark stack, but the type info claimed
6072 hasDefaultMark was true, then we will get an assertion now. Also fixed
6073 the assertion about the mark bit to use the Heap function directly
6074 because we don't have a JSCell::marked function any more.
6075 (JSC::MarkStack::drain): Changed a local variable from "v" to "value",
6076 and from "currentCell" to "cell". Changed to call markChildren in two
6077 places instead of repeating a chain of if statements twice. Changed
6078 code that reads and writes the mark bit to use Heap::isCellMarked and
6079 Heap::markCell so we can eliminate the JSCell::marked and
6080 JSCell::markCellDirect functions.
6082 * runtime/JSCell.h: Removed JSCell's markCellDirect and marked member
6083 functions. Added a comment explaining that asCell should be deprecated
6084 in favor of the JSValue asCell member function.
6085 (JSC::MarkStack::append): Added the assertion that catches callers
6086 that have set the HasDefaultMark bit incorrectly. Changed
6087 code that reads and writes the mark bit to use Heap::isCellMarked and
6088 Heap::markCell so we can eliminate the JSCell::marked and
6089 JSCell::markCellDirect functions. Moved the overload of
6090 MarkStack::append for JSValue here so it can call through to the cell
6091 version. The old version had a copy of all the code instead, but that
6092 repeated the conversion from JSValue to JSCell* and the check for
6093 whether a value is a cell multiple times.
6094 (JSC::Structure::markAggregate): Moved this function here to avoid
6095 dependencies for Structure.h, since this calls MarkStack::append.
6097 * runtime/JSObject.cpp:
6098 (JSC::JSObject::markChildren): Added code to clear
6099 m_isCheckingForDefaultMarkViolation so the marking done by JSObject
6100 doesn't trigger the assertion.
6102 * runtime/JSValue.h: Moved some stray includes that were outside the
6103 header guard inside it. Not sure how that happened! Removed the
6104 GC-related member functions markChildren, hasChildren, marked, and
6107 * runtime/JSWrapperObject.h: Made markChildren private.
6108 (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the
6109 HasDefaultMark bit was set.
6111 * runtime/MarkStack.h: Added m_isCheckingForDefaultMarkViolation and
6112 initialized it to false. Moved the append function body from here to
6113 JSCell.h. Added a declaration of a private markChildren function used
6114 inside the drain function.
6116 * runtime/SmallStrings.cpp:
6117 (JSC::SmallStrings::markChildren): Changed the name and style of this
6118 function to match other functions. This allows us to share the normal
6119 mark stack code path.
6121 * runtime/SmallStrings.h: Changed the name and interface of mark to
6122 the more-normal markChildren style.
6124 * runtime/Structure.h: Moved the body of markAggregate into the
6125 JSCell.h to avoid a circular dependency with JSCell.h.
6127 2009-09-04 Darin Adler <darin@apple.com>
6129 Reviewed by Geoff Garen.
6131 DateInstance object collected on ARM JIT (JSValue: WTF_USE_JSVALUE32)
6132 https://bugs.webkit.org/show_bug.cgi?id=28909
6136 Make some improvements to garbage collection code:
6138 1) Fix the two classes that had the default mark bit set but
6140 2) Remove checks of the mark bit outside the MarkStack::append
6141 function; they are redundant.
6142 3) Make more callers use the checked asCell and asObject
6143 casting functions rather than unchecked casts.
6144 4) Removed some GC-related functions because these operations are
6145 no longer things that code other than the core GC code needs
6146 to do directly. Fixed callers that were calling them.
6148 * bytecode/CodeBlock.cpp:
6149 (JSC::CodeBlock::markAggregate): Removed unneeded check of the mark
6150 bit before calling MarkStack::append.
6152 * interpreter/Register.h: Removed unneeded marked and markChildren
6156 (op_eq): Removed unneeded assertions, instead using checked casting
6157 functions such as asObject.
6159 * runtime/ArgList.h: Added now-needed forward declaration of MarkStack.
6161 * runtime/GetterSetter.cpp:
6162 (JSC::GetterSetter::markChildren): Remmoved unneeded check of the mark bit.
6164 * runtime/GlobalEvalFunction.h:
6165 (JSC::GlobalEvalFunction::createStructure): Added. Fixes a bug where the
6166 HasDefaultMark bit was set.
6168 * runtime/JSCell.cpp:
6169 (JSC::JSCell::getObject): Use asObject to avoid a direct static_cast.
6171 * runtime/JSObject.h:
6172 (JSC::asObject): Added an overload for JSCell* and changed the JSValue
6174 (JSC::JSValue::get): Use asObject to avoid a direct static_cast.
6176 * runtime/JSWrapperObject.h: Made markChildren private.
6177 (JSC::JSWrapperObject::createStructure): Added. Fixes a bug where the
6178 HasDefaultMark bit was set. Later we may want to optimize this for
6179 wrapper types that never have cells in their internal values, but there
6180 is no measured performance regression in SunSpider or V8 doing this
6183 * runtime/MarkStack.cpp: Tweaked formatting.
6185 2009-09-04 Kevin Ollivier <kevino@theolliviers.com>
6187 wx build fix. Switch USE_ defines over to the compiler so that they can be
6188 checked by files not including config.h (like WebCorePrefix.h).
6192 2009-09-03 Yong Li <yong.li@torchmobile.com>
6194 Reviewed by David Levin.
6196 Remove unnecessary dependency on unistd.h
6197 https://bugs.webkit.org/show_bug.cgi?id=28962
6199 * runtime/Completion.cpp:
6201 2009-09-03 Fumitoshi Ukai <ukai@chromium.org>
6203 Reviewed by Eric Seidel.
6205 Add strnstr for Linux and Windows in StringExtras.h
6206 https://bugs.webkit.org/show_bug.cgi?id=28901
6208 * wtf/StringExtras.h:
6211 2009-09-03 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
6213 Reviewed by Darin Adler.
6215 Allow custom memory allocation control for JavaScriptCore's HashEntry class
6216 https://bugs.webkit.org/show_bug.cgi?id=27830
6218 Inherits HashEntry class from FastAllocBase because it has been
6219 instantiated by 'new' JavaScriptCore/runtime/Lookup.cpp:32.
6223 2009-09-02 Gavin Barraclough <barraclough@apple.com>
6225 Should crash if JIT code buffer allocation fails.
6227 https://bugs.webkit.org/show_bug.cgi?id=28926
6228 <rdar://problem/7031922>
6230 * jit/ExecutableAllocatorPosix.cpp:
6231 (JSC::ExecutablePool::systemAlloc):
6232 * jit/ExecutableAllocatorWin.cpp:
6233 (JSC::ExecutablePool::systemAlloc):
6235 2009-09-02 Kevin Ollivier <kevino@theolliviers.com>
6237 waf build fixes for Windows/MSVC.
6241 2009-09-02 Kevin Ollivier <kevino@theolliviers.com>
6243 Build fix for building on Windows.
6245 * wtf/ThreadingPthreads.cpp:
6247 2009-09-02 Norbert Leser <norbert.leser@nokia.com>
6249 Reviewed by Eric Seidel.
6251 Use fastMalloc when neither MMAP nor VIRTUALALLOC are enabled
6253 RegisterFile constructor currently throws #error when both
6254 MMAP and VIRTUALALLOC conditions fail.
6255 On any platform that does not provide these features
6256 (for instance, Symbian),
6257 the fallback should be regular malloc (or fastMalloc).
6258 It is functionally equivalent in this case, even though it may
6259 have certain drawbacks such as lack of dynamic pre-allocation.
6261 * interpreter/RegisterFile.cpp:
6262 (JSC::RegisterFile::~RegisterFile):
6263 * interpreter/RegisterFile.h:
6264 (JSC::RegisterFile::RegisterFile):
6266 2009-08-31 Robert Agoston <Agoston.Robert@stud.u-szeged.hu>
6268 Reviewed by Gavin Barraclough.
6271 https://bugs.webkit.org/show_bug.cgi?id=28691
6274 (JSC::Parser::parse):
6276 2009-08-27 Oliver Hunt <oliver@apple.com>
6278 Reviewed by Maciej Stachowiak.
6280 JSON Stringifier does not follow ES5 spec for handling of Number, String and Boolean objects
6281 https://bugs.webkit.org/show_bug.cgi?id=28797
6283 Fixed unwrapBoxedPrimitive to do the right thing, which necessitated a couple of new exception
6284 checks, and corrected the logic in gap to correctly convert Number and String objects.
6286 * runtime/JSONObject.cpp:
6287 (JSC::unwrapBoxedPrimitive):
6289 (JSC::Stringifier::Stringifier):
6290 (JSC::Stringifier::appendStringifiedValue):
6292 2009-08-27 Oliver Hunt <oliver@apple.com>
6294 Reviewed by Adam Roben.
6296 JSON.stringify replacer array does not accept values that are not string primitives.
6297 https://bugs.webkit.org/show_bug.cgi?id=28788
6299 Update the JSON stringifier to initialise its replacer array according to the most
6300 recent version of the spec.
6302 * runtime/Identifier.h:
6303 (JSC::Identifier::from):
6304 * runtime/JSONObject.cpp:
6305 (JSC::Stringifier::Stringifier):
6307 2009-08-27 Alexey Proskuryakov <ap@apple.com>
6309 Reviewed by Oliver Hunt.
6311 https://bugs.webkit.org/show_bug.cgi?id=28753
6312 <rdar://problem/7173448> Excessive number of threads (and a crash)
6314 * wtf/Threading.h: (WTF::atomicIncrement): Changed atomicIncrement to match decrement
6315 and return the new value. Also added using directives for these functions, to match
6318 2009-08-27 Brent Fulgham <bfulgham@webkit.org>
6320 Reviewed by Adam Roben.
6322 Link the testapi against CFLite when building the WinCairo port.
6324 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add new Release_CFLite
6325 target. Update all targets to inherit from either the
6326 JavaScriptCF.vsprops (Apple target) or the JavaScriptCFLite.vsprops
6327 file (WinCairo target).
6328 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Remove
6329 input file CoreFoundation.lib. This is provided by either the
6330 JavaScriptCF.vsprops or JavaScriptCFLite.vsprops file.
6332 2009-08-27 Steve Falkenburg <sfalken@apple.com>
6334 Reviewed by Geoff Garen.
6336 Fix Windows-specific crash due to missing memory clearing call.
6338 * runtime/Collector.cpp:
6339 (JSC::Heap::allocateBlock):
6341 2009-08-27 Brent Fulgham <bfulgham@webkit.org>
6343 Build fix: JavaScriptCore_debug.def missing some exports. Apple
6344 Windows build does not use this file, so it was not noticed previously.
6346 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6348 2009-08-27 Gavin Barraclough <barraclough@apple.com>
6350 Reviewed by Oliver Hunt.
6352 x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates.
6353 https://bugs.webkit.org/show_bug.cgi?id=28317
6355 Missed one, fix part II.
6357 * assembler/MacroAssemblerX86Common.h:
6358 (JSC::MacroAssemblerX86Common::move):
6359 * assembler/X86Assembler.h:
6360 (JSC::CAN_SIGN_EXTEND_8_32):
6362 2009-08-27 Oliver Hunt <oliver@apple.com>
6364 Reviewed by Adam Roben.
6366 JSON.stringify replacer array does not accept values that are not string primitives.
6367 https://bugs.webkit.org/show_bug.cgi?id=28788
6369 Update the JSON stringifier to initialise its replacer array according to the most
6370 recent version of the spec.
6372 * runtime/Identifier.h:
6373 (JSC::Identifier::from):
6374 * runtime/JSONObject.cpp:
6375 (JSC::Stringifier::Stringifier):
6377 2009-08-27 Oliver Hunt <oliver@apple.com>
6379 Reviewed by Alexey Proskuryakov.
6381 JSON parser accepts trailing comma in array literals
6382 https://bugs.webkit.org/show_bug.cgi?id=28779
6384 Update parser to correctly fail if there's a trailing comma.
6386 * runtime/LiteralParser.cpp:
6387 (JSC::LiteralParser::parse):
6389 2009-08-26 Oliver Hunt <oliver@apple.com>
6391 Reviewed by Gavin Barraclough.
6393 'this' in JSON.parse reviver is the global object
6394 https://bugs.webkit.org/show_bug.cgi?id=28752
6396 This is a technically simple change, we merely update the code for calling
6397 the reviver function to pass the correct this object. Doing so however
6398 exposes the holder to arbitrary mutation by the reviver function so it is
6399 necessary for us to now guard all property accesses against the possibility
6402 * runtime/JSArray.h:
6403 JSON needs to delete a property from the array, so we friend its
6404 Walker class so that we can make a non-virtual call to the arrays
6405 delete and getOwnPropertySlot methods.
6406 * runtime/JSONObject.cpp:
6407 (JSC::Walker::callReviver):
6408 We need to pass the correct this object
6409 (JSC::Walker::walk):
6410 Update calls to callReviver, and update property logic logic
6411 to correctly handle the holder being mutated by the reviver
6414 2009-08-26 Alice Liu <alice.liu@apple.com>
6416 Windows build fix: added some exported symbols
6418 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6419 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6421 2009-08-26 Geoffrey Garen <ggaren@apple.com>
6423 Windows build fix: Removed some exported symbols that no longer exist.
6425 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6426 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6428 2009-08-26 Gavin Barraclough <barraclough@apple.com>
6430 Reviewed by Olliejver Hunt.
6432 x86-64 GTK broken due to code offsets changing, pointers sometimes packed into immediates.
6433 https://bugs.webkit.org/show_bug.cgi?id=28317
6435 We rely on a slightly OS X specific behaviour, that x86-64 applications have a 4Gb zero page,
6436 so pointers are never representable as a 32-bit integer, and always have to be represented by
6437 a separate immediate load instruction, rather than within the immediate field of an arithmetic
6438 or memory operation.
6440 We explicitly check for a couple of cases where a value might be representable in 32-bit, but
6441 these probably never kick in on Mac OS, and only kick in to hose GTK. Deleting these does not
6442 show a performance degradation on SunSpider. Remove.
6444 * assembler/MacroAssemblerX86_64.h:
6445 (JSC::MacroAssemblerX86_64::storePtr):
6446 (JSC::MacroAssemblerX86_64::branchPtr):
6448 2009-08-26 Geoffrey Garen <ggaren@apple.com>
6450 Reviewed by Oliver Hunt.
6452 A bit of Collector refatoring.
6454 SunSpider says no change. v8 says 1.003x faster (1.02x faster on splay).
6456 * JavaScriptCore.exp:
6458 * runtime/JSCell.cpp:
6459 (JSC::JSCell::toPrimitive):
6460 (JSC::JSCell::getPrimitiveNumber):
6461 (JSC::JSCell::toBoolean):
6462 (JSC::JSCell::toNumber):
6463 (JSC::JSCell::toString):
6464 (JSC::JSCell::toObject): Removed pure virtual functions from
6465 JSCell, so the collector can construct one. This allowed
6466 me to remove a bunch of ASSERT_NOT_REACHED throughout the
6470 (JSC::JSCell::JSCell): ditto
6471 (JSC::Heap::heap): Inlined this function because it's trivial.
6473 * JavaScriptCore.exp:
6475 * runtime/Collector.cpp:
6476 (JSC::Heap::destroy):
6477 (JSC::Heap::allocateBlock):
6478 (JSC::Heap::freeBlock):
6479 (JSC::Heap::freeBlocks): Renamed freeHeap to freeBlocks, since
6480 it doesn't actually free the Heap object.
6481 (JSC::Heap::heapAllocate):
6483 * runtime/Collector.h: Refactored block allocation and destruction
6484 into helper functions.
6486 * runtime/GetterSetter.cpp:
6487 * runtime/JSAPIValueWrapper.cpp:
6488 * runtime/JSPropertyNameIterator.cpp: Removed dummy implementations
6489 of pure virtual functions. (See above.)
6491 === End re-roll-in of r47738:47740 with Windows crash fixed ===
6493 2009-08-26 Geoffrey Garen <ggaren@apple.com>
6495 Build fix: start out with a 32-bit value to avoid a shortening warning.
6497 * runtime/Collector.cpp:
6500 2009-08-24 Geoffrey Garen <ggaren@apple.com>
6502 Reviewed by Oliver Hunt.
6504 Substantially reduced VM thrash in the GC heap.
6506 1.08x faster on v8 (1.60x faster on v8-splay).
6508 1.40x faster on bench-alloc-nonretained.
6510 1.90x faster on bench-alloc-retained.
6512 SunSpider says no change.
6514 * runtime/Collector.cpp:
6515 (JSC::Heap::heapAllocate): Fixed a long-standing bug: update a few local
6516 variables unconditionally after calling collect(), since they may be used
6517 even if we don't "goto scan". (In the bug I saw, usedBlocks got out of
6518 sync with heap.usedBlocks).
6519 (JSC::Heap::sweep): Keep enough free heap space to accomodate
6520 the number of objects we'll allocate before the next GC, plus 25%, for
6522 * runtime/Collector.h: Bumped the block size to 256k. This seems to give
6523 the best cache performance, and it prevents us from initiating lots of
6524 VM traffic to recover very small chunks of memory.
6526 === Begin re-roll-in of r47738:47740 with Windows crash fixed ===
6528 2009-08-25 Drew Wilson <atwilson@google.com>
6530 Reviewed by David Levin.
6532 postMessage() spec now supports sending arrays of ports
6533 https://bugs.webkit.org/show_bug.cgi?id=26902
6535 Added OwnPtr to VectorTraits so we can store OwnPtrs in Vectors.
6537 * wtf/VectorTraits.h:
6539 2009-08-26 Xan Lopez <xlopez@igalia.com>
6541 Rubber-stamped by Gustavo Noronha.
6543 Remove duplicated files from file list.
6547 2009-08-26 Oliver Hunt <oliver@apple.com>
6549 Reviewed by NOBODY (Build fix).
6553 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6554 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6556 2009-08-26 Oliver Hunt <oliver@apple.com>
6558 Reviewed by NOBODY (Build fix).
6560 Hopefully fix all the exports from JSC on windows
6562 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6563 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6565 2009-08-26 Oliver Hunt <oliver@apple.com>
6567 Reviewed by NOBODY (Build fixes).
6569 Forgot I added files to JavaScriptCore.
6572 * JavaScriptCore.gypi:
6573 * JavaScriptCore.pri:
6574 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6575 * JavaScriptCoreSources.bkl:
6577 2009-08-25 Oliver Hunt <oliver@apple.com>
6579 Reviewed by Gavin Barraclough.
6581 [ES5] Implement getOwnPropertyDescriptor
6582 https://bugs.webkit.org/show_bug.cgi?id=28724
6584 Implement the core runtime support for getOwnPropertyDescriptor.
6585 This adds a virtual getOwnPropertyDescriptor method to every class
6586 that implements getOwnPropertySlot that shadows the behaviour of
6587 getOwnPropertySlot. The alternative would be to make getOwnPropertySlot
6588 (or PropertySlots in general) provide property attribute information,
6589 but quick testing showed this to be a regression.
6591 * JavaScriptCore.exp:
6592 * JavaScriptCore.xcodeproj/project.pbxproj:
6593 * runtime/Arguments.cpp:
6594 (JSC::Arguments::getOwnPropertyDescriptor):
6595 * runtime/Arguments.h:
6596 * runtime/ArrayPrototype.cpp:
6597 (JSC::ArrayPrototype::getOwnPropertyDescriptor):
6598 * runtime/ArrayPrototype.h:
6599 * runtime/CommonIdentifiers.h:
6600 * runtime/DatePrototype.cpp:
6601 (JSC::DatePrototype::getOwnPropertyDescriptor):
6602 * runtime/DatePrototype.h:
6603 * runtime/JSArray.cpp:
6604 (JSC::JSArray::getOwnPropertyDescriptor):
6605 * runtime/JSArray.h:
6606 * runtime/JSByteArray.cpp:
6607 (JSC::JSByteArray::getOwnPropertyDescriptor):
6608 * runtime/JSByteArray.h:
6609 * runtime/JSFunction.cpp:
6610 (JSC::JSFunction::getOwnPropertyDescriptor):
6611 * runtime/JSFunction.h:
6612 * runtime/JSGlobalObject.h:
6613 (JSC::JSGlobalObject::getOwnPropertyDescriptor):
6614 * runtime/JSNotAnObject.cpp:
6615 (JSC::JSNotAnObject::getOwnPropertyDescriptor):
6616 * runtime/JSNotAnObject.h:
6617 * runtime/JSONObject.cpp:
6618 (JSC::JSONObject::getOwnPropertySlot):
6619 (JSC::JSONObject::getOwnPropertyDescriptor):
6620 * runtime/JSONObject.h:
6621 * runtime/JSObject.cpp:
6622 (JSC::JSObject::getOwnPropertyDescriptor):
6623 (JSC::JSObject::getPropertyDescriptor):
6624 * runtime/JSObject.h:
6625 * runtime/JSString.cpp:
6626 (JSC::JSString::getStringPropertyDescriptor):
6627 (JSC::JSString::getOwnPropertyDescriptor):
6628 * runtime/JSString.h:
6629 * runtime/JSVariableObject.cpp:
6630 (JSC::JSVariableObject::symbolTableGet):
6631 * runtime/JSVariableObject.h:
6633 (JSC::getStaticPropertyDescriptor):
6634 (JSC::getStaticFunctionDescriptor):
6635 (JSC::getStaticValueDescriptor):
6636 Add property descriptor equivalents of the lookup
6637 table access functions
6639 * runtime/MathObject.cpp:
6640 (JSC::MathObject::getOwnPropertySlot):
6641 (JSC::MathObject::getOwnPropertyDescriptor):
6642 * runtime/MathObject.h:
6643 * runtime/NumberConstructor.cpp:
6644 (JSC::NumberConstructor::getOwnPropertyDescriptor):
6645 * runtime/NumberConstructor.h:
6646 * runtime/ObjectConstructor.cpp:
6647 (JSC::ObjectConstructor::ObjectConstructor):
6648 (JSC::objectConstructorGetOwnPropertyDescriptor):
6649 * runtime/PropertyDescriptor.cpp: Added.
6650 (JSC::PropertyDescriptor::writable):
6651 (JSC::PropertyDescriptor::enumerable):
6652 (JSC::PropertyDescriptor::configurable):
6653 (JSC::PropertyDescriptor::hasAccessors):
6654 (JSC::PropertyDescriptor::setUndefined):
6655 (JSC::PropertyDescriptor::getter):
6656 (JSC::PropertyDescriptor::setter):
6657 (JSC::PropertyDescriptor::setDescriptor):
6658 (JSC::PropertyDescriptor::setAccessorDescriptor):
6659 * runtime/PropertyDescriptor.h: Added.
6660 (JSC::PropertyDescriptor::PropertyDescriptor):
6661 (JSC::PropertyDescriptor::attributes):
6662 (JSC::PropertyDescriptor::isValid):
6663 (JSC::PropertyDescriptor::value):
6664 * runtime/RegExpConstructor.cpp:
6665 (JSC::RegExpConstructor::getOwnPropertyDescriptor):
6666 * runtime/RegExpConstructor.h:
6667 * runtime/RegExpMatchesArray.h:
6668 (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
6669 * runtime/RegExpObject.cpp:
6670 (JSC::RegExpObject::getOwnPropertyDescriptor):
6671 * runtime/RegExpObject.h:
6672 * runtime/StringObject.cpp:
6673 (JSC::StringObject::getOwnPropertyDescriptor):
6674 * runtime/StringObject.h:
6675 * runtime/StringPrototype.cpp:
6676 (JSC::StringPrototype::getOwnPropertyDescriptor):
6677 * runtime/StringPrototype.h:
6679 2009-08-24 Gavin Barraclough <barraclough@apple.com>
6681 Reviewed by Darin Adler.
6683 How many copies of the parameters do you need?
6684 https://bugs.webkit.org/show_bug.cgi?id=28701
6686 The function parameters in JSC get copied a lot - and unnecessarily so.
6688 Originally this happened due to duplicating FunctionBodyNodes on recompilation,
6689 though the problem has been exacerbated by copying the parameters from the
6690 original function body onto the executable, then back onto the real body that
6691 will be generated (this happens on every function). And this is all made worse
6692 since the data structures in question are a little ugly - C style arrays of C++
6693 objects containing ref counts, so they need a full copy-construct (rather than
6696 This can all be greatly simplified by just punting the parameters off into
6697 their own ref-counted object, and forgoing all the copying.
6699 ~no performance change, possible slight progression.
6701 * bytecompiler/BytecodeGenerator.cpp:
6702 (JSC::BytecodeGenerator::BytecodeGenerator):
6703 * bytecompiler/BytecodeGenerator.h:
6704 (JSC::BytecodeGenerator::makeFunction):
6706 (JSC::FunctionParameters::FunctionParameters):
6707 (JSC::FunctionBodyNode::FunctionBodyNode):
6708 (JSC::FunctionBodyNode::finishParsing):
6710 (JSC::FunctionBodyNode::parameters):
6711 (JSC::FunctionBodyNode::parameterCount):
6712 * runtime/Executable.cpp:
6713 (JSC::FunctionExecutable::~FunctionExecutable):
6714 (JSC::FunctionExecutable::compile):
6715 (JSC::FunctionExecutable::reparseExceptionInfo):
6716 (JSC::FunctionExecutable::fromGlobalCode):
6717 (JSC::FunctionExecutable::paramString):
6718 * runtime/Executable.h:
6719 (JSC::FunctionExecutable::FunctionExecutable):
6720 (JSC::FunctionExecutable::parameterCount):
6722 2009-08-25 Brent Fulgham <bfulgham@webkit.org>
6724 Reviewed by NOBODY (Buildfix).
6726 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_CFLite target
6727 that inherits from the debug_wincairo property sheet and therefore
6728 links to the proper debug library.
6729 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_CFLite target
6730 that inherits from the debug_wincairo property sheet and therefore
6731 links to the proper debug library.
6733 2009-08-25 Chris Marrin <cmarrin@apple.com>
6735 Reviewed by Simon Fraser.
6737 Export tryFastMalloc for Canvas3D work
6738 https://bugs.webkit.org/show_bug.cgi?id=28018
6740 * JavaScriptCore.exp:
6742 2009-08-25 David Levin <levin@chromium.org>
6744 Reviewed by Adam Roben.
6746 PLATFORM(CFNETWORK) should be USE(CFNETWORK).
6747 https://bugs.webkit.org/show_bug.cgi?id=28713
6749 * wtf/Platform.h: Added a #define to catch this issue in the
6750 future. The define would generate an error on gcc without the
6751 space in the expansion, but Visual C++ needs the space to cause an error.
6753 2009-08-24 Brent Fulgham <bfulgham@webkit.org>
6755 Reviewed by Steve Falkenburg.
6757 Revise CFLite Debug build to emit DLL's with _debug label.
6758 https://bugs.webkit.org/show_bug.cgi?id=28695.
6760 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Modify
6761 Cairo debug build to inherit from new debug_cairo property sheet.
6762 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops:
6763 Modify to look for debug CFLite when in debug build.
6765 2009-08-24 Gavin Barraclough <barraclough@apple.com>
6767 Reviewed by Oliver Adler & Darin Hunt.
6769 https://bugs.webkit.org/show_bug.cgi?id=28691
6770 Do not retain ScopeNodes outside of parsing
6772 There is now no need for these to exist outside of parsing - their use in the runtime is replaced by Executable types.
6774 * bytecode/EvalCodeCache.h:
6775 (JSC::EvalCodeCache::get):
6776 * bytecompiler/BytecodeGenerator.cpp:
6777 (JSC::BytecodeGenerator::BytecodeGenerator):
6778 (JSC::BytecodeGenerator::emitNewFunction):
6779 (JSC::BytecodeGenerator::emitNewFunctionExpression):
6780 * bytecompiler/BytecodeGenerator.h:
6781 (JSC::BytecodeGenerator::makeFunction):
6782 * debugger/Debugger.cpp:
6783 (JSC::Debugger::recompileAllJSFunctions):
6784 (JSC::evaluateInGlobalCallFrame):
6785 * debugger/DebuggerCallFrame.cpp:
6786 (JSC::DebuggerCallFrame::evaluate):
6787 * interpreter/Interpreter.cpp:
6788 (JSC::Interpreter::execute):
6789 (JSC::Interpreter::prepareForRepeatCall):
6790 (JSC::Interpreter::privateExecute):
6792 (JSC::DEFINE_STUB_FUNCTION):
6794 (JSC::ScopeNodeData::ScopeNodeData):
6795 (JSC::ProgramNode::create):
6796 (JSC::EvalNode::create):
6797 (JSC::FunctionBodyNode::create):
6799 (JSC::ScopeNode::adoptData):
6800 (JSC::FunctionBodyNode::parameterCount):
6801 * parser/Parser.cpp:
6803 (JSC::Parser::arena):
6804 (JSC::Parser::Parser):
6805 (JSC::Parser::parse):
6806 * runtime/ArrayPrototype.cpp:
6807 (JSC::isNumericCompareFunction):
6808 (JSC::arrayProtoFuncSort):
6809 * runtime/Completion.cpp:
6812 * runtime/Executable.cpp:
6813 (JSC::FunctionExecutable::~FunctionExecutable):
6814 (JSC::EvalExecutable::compile):
6815 (JSC::ProgramExecutable::checkSyntax):
6816 (JSC::ProgramExecutable::compile):
6817 (JSC::FunctionExecutable::compile):
6818 (JSC::EvalExecutable::generateJITCode):
6819 (JSC::ProgramExecutable::generateJITCode):
6820 (JSC::FunctionExecutable::generateJITCode):
6821 (JSC::FunctionExecutable::reparseExceptionInfo):
6822 (JSC::EvalExecutable::reparseExceptionInfo):
6823 (JSC::FunctionExecutable::recompile):
6824 (JSC::FunctionExecutable::fromGlobalCode):
6825 (JSC::FunctionExecutable::copyParameters):
6826 (JSC::FunctionExecutable::paramString):
6827 * runtime/Executable.h:
6828 (JSC::ScriptExecutable::ScriptExecutable):
6829 (JSC::ScriptExecutable::sourceID):
6830 (JSC::ScriptExecutable::sourceURL):
6831 (JSC::ScriptExecutable::lineNo):
6832 (JSC::ScriptExecutable::lastLine):
6833 (JSC::ScriptExecutable::usesEval):
6834 (JSC::ScriptExecutable::usesArguments):
6835 (JSC::ScriptExecutable::needsActivation):
6836 (JSC::ScriptExecutable::recordParse):
6837 (JSC::EvalExecutable::bytecode):
6838 (JSC::EvalExecutable::jitCode):
6839 (JSC::ProgramExecutable::bytecode):
6840 (JSC::ProgramExecutable::reparseExceptionInfo):
6841 (JSC::ProgramExecutable::jitCode):
6842 (JSC::FunctionExecutable::FunctionExecutable):
6843 (JSC::FunctionExecutable::make):
6844 (JSC::FunctionExecutable::bytecode):
6845 (JSC::FunctionExecutable::isGenerated):
6846 (JSC::FunctionExecutable::name):
6847 (JSC::FunctionExecutable::parameterCount):
6848 (JSC::FunctionExecutable::jitCode):
6849 * runtime/FunctionConstructor.cpp:
6850 (JSC::constructFunction):
6851 * runtime/JSGlobalData.cpp:
6852 (JSC::JSGlobalData::numericCompareFunction):
6853 * runtime/JSGlobalObjectFunctions.cpp:
6854 (JSC::globalFuncEval):
6856 2009-08-24 Darin Adler <darin@apple.com>
6858 * runtime/ObjectPrototype.cpp:
6859 (JSC::ObjectPrototype::put): Landed revised version I had tested but forgot
6860 to land. Leave out the branch, since we don't need one.
6862 2009-08-24 Darin Adler <darin@apple.com>
6864 Reviewed by Geoff Garen.
6866 Array index miss case creates a string every time
6867 https://bugs.webkit.org/show_bug.cgi?id=28664
6869 SunSpider test results I saw:
6872 1% faster on crypto-aes
6873 20% faster on crypto-md5
6874 13% faster on crypto-sha1
6876 * runtime/ObjectPrototype.cpp:
6877 (JSC::ObjectPrototype::ObjectPrototype): Initialize m_hasNoPropertiesWithUInt32Names
6879 (JSC::ObjectPrototype::put): Clearly m_hasNoPropertiesWithUInt32Names if the new
6880 property has a name that is the string form of a UInt32.
6881 (JSC::ObjectPrototype::getOwnPropertySlot): Don't call JSObject::getOwnPropertySlot
6882 if m_hasNoPropertiesWithUInt32Names is true, and it is highly likely to be true.
6884 * runtime/ObjectPrototype.h: Added declarations for the above.
6886 2009-08-24 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
6888 Unreviewed. Fix a typo in my distcheck build fix.
6892 2009-08-23 Gustavo Noronha Silva <gns@gnome.org>
6894 Unreviewed build fix for make distcheck.
6896 * GNUmakefile.am: Added files required for the build.
6898 2009-08-22 Maciej Stachowiak <mjs@apple.com>
6900 Reviewed by Mark Rowe.
6902 REGRESSION(r47639-r47660): Webkit crashes on launch on PowerPC
6903 https://bugs.webkit.org/show_bug.cgi?id=28655
6905 * runtime/JSFunction.cpp:
6906 (JSC::JSFunction::JSFunction): Initialize properly with a VPtrHackExecutable.
6909 2009-08-22 Darin Adler <darin@apple.com>
6911 Fix storage leak from syntax tree arena allocation patch.
6913 * parser/Nodes.h: CommaNode needs to inherit from ParserArenaDeletable
6914 because it has a vector.
6916 2009-08-21 Darin Adler <darin@apple.com>
6921 (JSC::ScopeNodeData::ScopeNodeData): Made non-inline again.
6922 This is used outside Nodes.cpp so can't be inline unless
6923 it is in the header.
6925 2009-08-21 Darin Adler <darin@apple.com>
6927 Two loose ends from the last commit.
6929 * JavaScriptCore.xcodeproj/project.pbxproj: Made ParserArena.h
6930 and create_hash_table project-internal instead of "private".
6931 * runtime/Executable.h: Removed accidentally-added constructor.
6933 2009-08-21 Darin Adler <darin@apple.com>
6935 Reviewed by Gavin Barraclough.
6937 Syntax tree nodes should use arena allocation
6938 https://bugs.webkit.org/show_bug.cgi?id=25674
6940 Use an actual arena now. 0.6% speedup on SunSpider.
6942 New and improved with 100% less leaking of the universe.
6944 * JavaScriptCore.exp:
6945 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6946 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6947 Removed all exports involving the class FunctionBodyNode, which no
6948 longer needs to be used outside JavaScriptCore.
6950 * JavaScriptCore.xcodeproj/project.pbxproj: Made Nodes.h and
6951 Executable.h project-internal instead of "private".
6953 * bytecompiler/BytecodeGenerator.cpp:
6954 (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
6955 contains const Identifier* now.
6957 * parser/Grammar.y: Made identifiers from the lexer be const
6958 Identifier* and updated since VarStack contains const Identifier* now.
6961 (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
6962 (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
6963 and changed to call ParserArena.
6964 (JSC::Lexer::clear): Removed the code to manage m_identifiers and
6965 added code to set m_arena to 0.
6966 * parser/Lexer.h: Updated for changes above.
6968 * parser/NodeConstructors.h:
6969 (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
6971 (JSC::ParserArenaDeletable::operator new): Changed to call the
6972 allocateDeletable function on the arena instead of deleteWithArena.
6973 (JSC::PropertyNode::PropertyNode): Added new constructor that makes
6974 numeric identifiers. Some day we might want to optimize this for
6975 integers so it doesn't create a string for each one.
6976 (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
6977 since it's now a const Identifier& so it can't be left uninitialized.
6978 (JSC::BreakNode::BreakNode): Ditto.
6979 (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
6980 to keep track of the statements rather than a separate statement vector.
6981 (JSC::BlockNode::BlockNode): Ditto.
6982 (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
6984 * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
6985 It seemed strangely out of place in the header.
6986 (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
6987 UString as well as Identifier.
6988 (JSC::SourceElements::singleStatement): Added.
6989 (JSC::SourceElements::lastStatement): Added.
6990 (JSC::RegExpNode::emitBytecode): Changed the throwError code to use
6991 the substitution mechanism instead of doing a string append.
6992 (JSC::SourceElements::emitBytecode): Added. Replaces the old
6993 statementListEmitCode function, since we now keep the SourceElements
6995 (JSC::BlockNode::lastStatement): Added.
6996 (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
6997 statementListEmitCode.
6998 (JSC::CaseClauseNode::emitBytecode): Added.
6999 (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
7000 instead of statementListEmitCode.
7001 (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
7002 SourceElements* instead of using releaseContentsIntoVector.
7003 (JSC::ScopeNode::emitStatementsBytecode): Added.
7004 (JSC::ScopeNode::singleStatement): Added.
7005 (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
7006 of statementListEmitCode.
7007 (JSC::EvalNode::emitBytecode): Ditto.
7008 (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
7009 insetad of statementListEmitCode and check for the return node using
7012 * parser/Nodes.h: Changed VarStack to store const Identifier* instead
7013 of Identifier and rely on the arena to control lifetime. Added a new
7014 ParserArenaFreeable class. Made ParserArenaDeletable inherit from
7015 FastAllocBase instead of having its own operator new. Base the Node
7016 class on ParserArenaFreeable. Changed the various Node classes
7017 to use const Identifier& instead of Identifier to avoid the need to
7018 call their destructors and allow them to function as "freeable" in the
7019 arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
7020 Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
7021 CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
7022 as a base class since they do not descend from Node. Eliminated the
7023 StatementVector type and instead have various classes use SourceElements*
7024 instead of StatementVector. This prevents those classes from having to
7025 use ParserArenaDeletable to make sure the vector destructor is called.
7027 * parser/Parser.cpp:
7028 (JSC::Parser::parse): Pass the arena to the lexer.
7030 * parser/Parser.h: Added an include of ParserArena.h, which is no longer
7031 included by Nodes.h.
7032 (JSC::Parser::parseFunctionFromGlobalCode): Changed to use the
7033 singleStatement function, since there is no longer any children function.
7034 Removed some unneeded use of RefPtr.
7036 * parser/ParserArena.cpp:
7037 (JSC::ParserArena::ParserArena): Added. Initializes the new members,
7038 m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
7039 (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
7040 since we store only the current pointer and the end of pool pointer.
7041 (JSC::ParserArena::deallocateObjects): Added. Contains the common
7042 memory-deallocation logic used by both the destructor and the
7044 (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
7045 (JSC::ParserArena::reset): Ditto. Also added code to zero out the
7046 new structures, and switched to use clear() instead of shrink(0) since
7047 we don't really reuse arenas.
7048 (JSC::ParserArena::makeNumericIdentifier): Added.
7049 (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
7051 (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
7052 since this is used only for assertions at the moment.
7053 (JSC::ParserArena::derefWithArena): Make non-inline.
7055 * parser/ParserArena.h: Added an actual arena of "freeable" objects,
7056 ones that don't need destructors to be called. Also added a separate
7057 IdentifierArena object, a segmented vector of identifiers that used
7060 * runtime/Executable.h: Moved the definition of the
7061 FunctionExecutable::make function here. It can't go in JSFunction.h
7062 since that header has to be used outside JavaScriptCore and so can't
7063 include this, which includes Nodes.h. The function could be moved
7064 elswhere if we don't want to include JSFunction.h in this header, but
7065 for now this seems to be the best place.
7067 * runtime/JSFunction.h: Removed the include of Executable.h and
7068 definition of the FunctionExecutable::make function.
7070 * wtf/FastMalloc.cpp: Fixed an incorrect comment.
7072 2009-08-21 Mark Rowe <mrowe@apple.com>
7074 Fix the non-JIT build.
7076 * runtime/Executable.cpp:
7077 * runtime/Executable.h:
7079 2009-08-21 Gavin Barraclough <barraclough@apple.com>
7081 Speculative QuickTime build fix.
7083 * runtime/JSArray.cpp:
7085 2009-08-21 Gavin Barraclough <barraclough@apple.com>
7087 Speculative QT build fix.
7089 * runtime/StringPrototype.cpp:
7091 2009-08-21 Gavin Barraclough <barraclough@apple.com>
7093 Reviewed by Oliver Hunt.
7095 Restructure Executable types so that host functions do not hold a FunctionExecutable.
7096 https://bugs.webkit.org/show_bug.cgi?id=28621
7098 All JSFunction objects have a pointer to an Executable*. This is currently always a
7099 FunctionExecutable, however this has a couple of drawbacks. Host functions do not
7100 store a range of information that the FunctionExecutable provides (source, name,
7101 CodeBlock & information presently held on the FunctionBodyNode).
7103 [ * nearly all... see below! ]
7105 Instead, make JSFunctions hold a pointer to an ExecutableBase, move fields specific
7106 to JS sourced executable types (source, node) into a new subclass (ScriptExecutable),
7107 and create a new NativeExecutable type. We now provide a new method in JSFunction
7108 to access & downcast to FunctionExecutable, but in doing so we can make an early
7109 check (with an ASSERT) to ensure that the Executable read from a function will only
7110 be treated as a FunctionExecutable (and thus the JS sepcific fields will only be
7111 accessed) if the JSFunction is not a host function.
7113 There is one JSFunction that currently does not have an Executable, which is the
7114 object created to allow us to read out the vtable pointer. By making this change
7115 we can also add a new Executable type fror this object (VPtrHackExecutable).
7116 Since this means that really all JSFunctions have an Executable we no longer have
7117 to null-check m_executable before us it - particularly in isHostFunction().
7119 This patch removes CacheableEvalExecutable, since all subclasses of ExecutableBase
7120 can now be ref-counted - since both JSFunction holds (and ref-counts) an ExecutableBase
7121 that might be a FunctionExecutable or a NativeExecutable. This does now mean that all
7122 ProgramExecutables and EvalExecutables (unnecessarily) provide an interface to be
7123 ref-counted, however this seems less-bad than host functions unnecessarily providing
7124 interface to access non-host specific information.
7126 The class hierarcy has changed from this:
7131 - CacheableEvalExecutable (also RefCounted by multiple-inheritance)
7132 - FunctionExecutable (also RefCounted by multiple-inheritance, 'special' FunctionExecutable also used for host functions)
7139 - VPtrHackExecutable
7143 - FunctionExecutable
7145 This patch speeds up sunspidey by a couple of ms (presumably due to the changes to isHostFunction()).
7147 * bytecode/CodeBlock.cpp:
7148 (JSC::CodeBlock::CodeBlock):
7149 * bytecode/CodeBlock.h:
7150 (JSC::CodeBlock::ownerExecutable):
7151 (JSC::GlobalCodeBlock::GlobalCodeBlock):
7152 * bytecode/EvalCodeCache.h:
7153 (JSC::EvalCodeCache::get):
7154 * debugger/Debugger.cpp:
7155 (JSC::Debugger::recompileAllJSFunctions):
7156 * interpreter/CachedCall.h:
7157 (JSC::CachedCall::CachedCall):
7158 * interpreter/Interpreter.cpp:
7159 (JSC::Interpreter::callEval):
7160 (JSC::Interpreter::privateExecute):
7162 (JSC::DEFINE_STUB_FUNCTION):
7163 * profiler/Profiler.cpp:
7164 (JSC::createCallIdentifierFromFunctionImp):
7165 * runtime/Arguments.h:
7166 (JSC::Arguments::getArgumentsData):
7167 (JSC::Arguments::Arguments):
7168 * runtime/Executable.cpp:
7169 (JSC::NativeExecutable::~NativeExecutable):
7170 (JSC::VPtrHackExecutable::~VPtrHackExecutable):
7171 * runtime/Executable.h:
7172 (JSC::ExecutableBase::ExecutableBase):
7173 (JSC::ExecutableBase::~ExecutableBase):
7174 (JSC::ExecutableBase::isHostFunction):
7175 (JSC::NativeExecutable::NativeExecutable):
7176 (JSC::VPtrHackExecutable::VPtrHackExecutable):
7177 (JSC::ScriptExecutable::ScriptExecutable):
7178 (JSC::ScriptExecutable::source):
7179 (JSC::ScriptExecutable::sourceID):
7180 (JSC::ScriptExecutable::sourceURL):
7181 (JSC::ScriptExecutable::lineNo):
7182 (JSC::ScriptExecutable::lastLine):
7183 (JSC::ScriptExecutable::usesEval):
7184 (JSC::ScriptExecutable::usesArguments):
7185 (JSC::ScriptExecutable::needsActivation):
7186 (JSC::EvalExecutable::EvalExecutable):
7187 (JSC::EvalExecutable::create):
7188 (JSC::ProgramExecutable::ProgramExecutable):
7189 (JSC::FunctionExecutable::FunctionExecutable):
7190 * runtime/FunctionPrototype.cpp:
7191 (JSC::functionProtoFuncToString):
7192 * runtime/JSFunction.cpp:
7193 (JSC::JSFunction::JSFunction):
7194 (JSC::JSFunction::~JSFunction):
7195 (JSC::JSFunction::markChildren):
7196 (JSC::JSFunction::getCallData):
7197 (JSC::JSFunction::call):
7198 (JSC::JSFunction::lengthGetter):
7199 (JSC::JSFunction::getConstructData):
7200 (JSC::JSFunction::construct):
7201 * runtime/JSFunction.h:
7202 (JSC::JSFunction::executable):
7203 (JSC::JSFunction::jsExecutable):
7204 (JSC::JSFunction::isHostFunction):
7206 2009-08-20 Oliver Hunt <oliver@apple.com>
7208 Reviewed by Maciej Stachowiak.
7210 Browser hangs on opening Web Inspector.
7211 https://bugs.webkit.org/show_bug.cgi?id=28438
7213 Code generation needs to be able to walk the entire scopechain in some
7214 cases, however the symbol table used by activations was a member of the
7215 codeblock. Following recompilation this may no longer exist, leading
7216 to a crash or hang on lookup.
7218 We fix this by introducing a refcounted SymbolTable subclass, SharedSymbolTable,
7219 for the CodeBlocks used by function code. This allows activations to
7220 maintain ownership of a copy of the symbol table even after recompilation so
7221 they can continue to work.
7223 * bytecode/CodeBlock.cpp:
7224 (JSC::CodeBlock::CodeBlock):
7225 * bytecode/CodeBlock.h:
7226 (JSC::CodeBlock::symbolTable):
7227 (JSC::CodeBlock::sharedSymbolTable):
7228 (JSC::GlobalCodeBlock::GlobalCodeBlock):
7229 (JSC::FunctionCodeBlock::FunctionCodeBlock):
7230 (JSC::FunctionCodeBlock::~FunctionCodeBlock):
7231 * interpreter/Interpreter.cpp:
7232 (JSC::Interpreter::retrieveArguments):
7233 * runtime/Executable.cpp:
7234 (JSC::EvalExecutable::generateBytecode):
7235 (JSC::FunctionExecutable::generateBytecode):
7236 (JSC::FunctionExecutable::reparseExceptionInfo):
7237 (JSC::EvalExecutable::reparseExceptionInfo):
7238 * runtime/JSActivation.h:
7239 (JSC::JSActivation::JSActivationData::JSActivationData):
7240 (JSC::JSActivation::JSActivationData::~JSActivationData):
7241 * runtime/SymbolTable.h:
7243 2009-08-20 Xan Lopez <xlopez@igalia.com>
7245 Add new file to GTK+ build.
7249 2009-08-20 Geoffrey Garen <ggaren@apple.com>
7251 Reviewed by Maciej Stachowiak.
7253 Added a number => string cache.
7255 1.07x faster on v8 (1.7x faster on v8-splay).
7256 1.004x faster on SunSpider.
7258 * runtime/JSCell.h: Moved JSValue::toString to JSString.h.
7259 * runtime/JSGlobalData.h: Holds the cache.
7260 * runtime/JSNumberCell.cpp:
7261 (JSC::JSNumberCell::toString):
7262 (JSC::JSNumberCell::toThisString): Removed -0 special case.
7263 UString handles this now, since too many clients were
7266 * runtime/JSString.h:
7267 (JSC::JSValue::toString): Use the cache when converting
7268 an int or double to string.
7270 * runtime/Operations.h:
7271 (JSC::concatenateStrings): Call toString to take advantage
7274 * runtime/SmallStrings.h:
7275 (JSC::NumericStrings::add):
7276 (JSC::NumericStrings::lookup): The cache.
7278 * runtime/UString.cpp:
7279 (JSC::UString::from): Added -0 special case mentioned above.
7280 Removed appendNumeric because it's mutually exclusive with the
7283 2009-08-20 Oliver Hunt <oliver@apple.com>
7285 Reviewed by Gavin Barraclough.
7287 REGRESSION: fast/profiler/call.html is crashing occasionally
7288 https://bugs.webkit.org/show_bug.cgi?id=28476
7290 Using the codeblock for information about how many parameters and
7291 locals a function has is unsafe in certain circumstances. The
7292 basic scenario is all function code being cleared in response to
7293 the debugger or profiler being enabled, and then an activation is
7294 marked before its associated function is re-executed.
7296 To deal with this scenario we store the variable count of a function
7297 directly in the FunctionExecutable, and then use that information.
7299 * runtime/Arguments.h:
7300 (JSC::Arguments::getArgumentsData):
7301 * runtime/Executable.cpp:
7302 (JSC::FunctionExecutable::generateBytecode):
7303 * runtime/Executable.h:
7304 (JSC::FunctionExecutable::FunctionExecutable):
7305 (JSC::FunctionExecutable::variableCount):
7306 * runtime/JSActivation.cpp:
7307 (JSC::JSActivation::markChildren):
7309 2009-08-20 Gavin Barraclough <barraclough@apple.com>
7311 Reviewed by Oliver Hunt.
7313 Numbering of arguments to emitGetJITStubArg/emitPutJITStubArg incorrect
7314 <bug lost in the great bug disasteroony of 08/20/09!>
7316 The argumentNumber argument to emitGetJITStubArg/emitPutJITStubArg should match
7317 the argument number used within the stub functions in JITStubs.cpp, but it doesn't.
7319 Firstly, all the numbers changed when we added a void* 'reserved' as the first slot
7320 (rather than leaving argument 0 unused), and secondly in 32_64 builds the index to
7321 peek/poke needs to be multiplies by 2 (since the argument to peek/poke is a number
7322 of machine words, and on 32_64 build the argument slots to stub functions are two
7327 (JSC::JIT::compileOpCallSetupArgs):
7328 (JSC::JIT::compileOpConstructSetupArgs):
7329 (JSC::JIT::compileOpCallVarargsSetupArgs):
7330 (JSC::JIT::compileOpCall):
7331 * jit/JITInlineMethods.h:
7332 (JSC::JIT::emitPutJITStubArg):
7333 (JSC::JIT::emitPutJITStubArgConstant):
7334 (JSC::JIT::emitGetJITStubArg):
7335 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
7336 * jit/JITOpcodes.cpp:
7337 (JSC::JIT::privateCompileCTIMachineTrampolines):
7338 * jit/JITPropertyAccess.cpp:
7339 (JSC::JIT::privateCompilePutByIdTransition):
7341 2009-08-20 Oliver Hunt <oliver@apple.com>
7343 Reviewed by Geoff Garen.
7345 REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest
7346 https://bugs.webkit.org/show_bug.cgi?id=28332
7348 Follow up style fixes that were missed in review.
7350 * runtime/Structure.cpp:
7351 (JSC::Structure::hasTransition):
7352 * runtime/Structure.h:
7353 (JSC::Structure::get):
7354 (JSC::StructureTransitionTable::contains):
7355 * runtime/StructureTransitionTable.h:
7356 (JSC::StructureTransitionTable::add):
7358 2009-08-20 Oliver Hunt <oliver@apple.com>
7360 Add new exports to windows jsc build
7362 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7363 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
7365 2009-08-20 Oliver Hunt <oliver@apple.com>
7367 Reviewed by Gavin Barraclough.
7369 REGRESSION: significant slowdown on Celtic Kane "AJAX declaration" subtest
7370 https://bugs.webkit.org/show_bug.cgi?id=28332
7372 The method check optimisation made transitions aware of the value being
7373 assigned when a transition was assigning a function. This had the side
7374 effect of making every assignment of a function expression result in a
7375 new transition, and thus a new Structure. The net result of this is that
7376 the common JS idiom of
7378 function MyObject() {
7379 this.myFunction = function(...){...};
7383 Will produce a unique structure on every iteration, meaning that all
7384 caching is defeated and there is a significant amount of structure churn.
7386 The fix is to return the transition to its original form where it is
7387 keyed off a property name + attributes tuple, but have each transition
7388 support an optional transition on a specific value.
7390 * JavaScriptCore.exp:
7391 * runtime/JSObject.h:
7392 (JSC::JSObject::putDirectInternal):
7393 * runtime/Structure.cpp:
7394 (JSC::Structure::~Structure):
7395 (JSC::Structure::addPropertyTransitionToExistingStructure):
7396 (JSC::Structure::addPropertyTransition):
7397 (JSC::Structure::hasTransition):
7398 * runtime/Structure.h:
7399 (JSC::Structure::transitionedFor):
7400 (JSC::Structure::hasTransition):
7402 (JSC::StructureTransitionTable::contains):
7403 (JSC::StructureTransitionTable::get):
7404 * runtime/StructureTransitionTable.h:
7405 (JSC::StructureTransitionTableHashTraits::emptyValue):
7406 (JSC::StructureTransitionTable::hasTransition):
7407 (JSC::StructureTransitionTable::remove):
7408 (JSC::StructureTransitionTable::add):
7410 2009-08-20 Gavin Barraclough <barraclough@apple.com>
7412 Reviewed by Oliver Hunt.
7414 Remove FunctionCodeBlock.
7415 https://bugs.webkit.org/show_bug.cgi?id=28502
7417 These only exist to allow JIT code to dereference properties off the
7418 CodeBlock for any callee, regardless of whether it is a host function.
7420 Instead just use the FunctionExecutable. Copy the m_parameters field
7421 from the CodeBlock into the Executable, and use this to distinguish
7422 between host functions, functions that have been bytecompiled, and
7423 functions that have not.
7425 m_parameters is moved to ExecutableBase rather than FunctionExecutable
7426 so that (as a separate change) we can move make a separate class of
7427 executable for host code, which is not devived from FunctionExecutable
7428 (host code does not feature any of the properties that normal executable
7429 do and will provide, such as source, attributes, and a parsed name).
7431 1% win on v8 tests, 0.5% on sunspider.
7433 * bytecode/CodeBlock.cpp:
7434 (JSC::CodeBlock::derefStructures):
7435 (JSC::CodeBlock::refStructures):
7436 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
7437 (JSC::CodeBlock::handlerForBytecodeOffset):
7438 (JSC::CodeBlock::lineNumberForBytecodeOffset):
7439 (JSC::CodeBlock::expressionRangeForBytecodeOffset):
7440 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
7441 (JSC::CodeBlock::functionRegisterForBytecodeOffset):
7442 (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
7443 (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
7444 * bytecode/CodeBlock.h:
7446 (JSC::CodeBlock::source):
7447 (JSC::CodeBlock::sourceOffset):
7448 (JSC::CodeBlock::evalCodeCache):
7449 (JSC::CodeBlock::createRareDataIfNecessary):
7451 remove NativeCodeBlocks and the NativeCode code type.
7454 (JSC::JIT::linkCall):
7456 Revert to previous behaviour (as currently still commented!) that Hhost functions have a null codeblock.
7459 (JSC::JIT::compileOpCallInitializeCallFrame):
7460 (JSC::JIT::compileOpCallSetupArgs):
7461 (JSC::JIT::compileOpCallVarargsSetupArgs):
7462 (JSC::JIT::compileOpConstructSetupArgs):
7463 (JSC::JIT::compileOpCallVarargs):
7464 (JSC::JIT::compileOpCall):
7465 (JSC::JIT::compileOpCallSlowCase):
7467 Bring the 32_64 & non-32_64 JITs into line with each other, callee in regT0.
7469 * jit/JITOpcodes.cpp:
7470 (JSC::JIT::privateCompileCTIMachineTrampolines):
7472 Rewrite call trampolines to not use the CodeBlock.
7475 (JSC::DEFINE_STUB_FUNCTION):
7477 Make call_JSFunction & call_arityCheck return the callee, don't expect to be passed the CodeBlock.
7479 * runtime/Executable.cpp:
7480 (JSC::FunctionExecutable::generateBytecode):
7481 (JSC::FunctionExecutable::recompile):
7482 (JSC::FunctionExecutable::FunctionExecutable):
7483 * runtime/Executable.h:
7484 (JSC::ExecutableBase::):
7485 (JSC::ExecutableBase::ExecutableBase):
7486 (JSC::FunctionExecutable::isHostFunction):
7488 Add m_numParameters.
7490 * runtime/JSFunction.cpp:
7491 (JSC::JSFunction::~JSFunction):
7493 Only call generatedBytecode() on JSFunctions non-host FunctionExecutables.
7495 2009-08-20 Yongjun Zhang <yongjun.zhang@nokia.com>
7497 Reviewed by Eric Seidel.
7499 https://bugs.webkit.org/show_bug.cgi?id=28054
7501 Use a helper function to work around winscw compiler forward declaration bug
7502 regarding templated classes.
7504 Add parenthesis around (PassRefPtr::*UnspecifiedBoolType) to make winscw compiler
7505 work with the default UnSpecifiedBoolType() operator, which removes the winscw
7506 specific bool cast hack.
7509 (WTF::derefIfNotNull):
7510 (WTF::PassRefPtr::~PassRefPtr):
7512 2009-08-19 Yong Li <yong.li@torchmobile.com>
7514 Reviewed by Gavin Barraclough.
7516 Change namespace ARM to ARMRegisters
7517 X86 to X86Registers to avoid conflict with macros
7518 https://bugs.webkit.org/show_bug.cgi?id=28428
7520 * assembler/ARMAssembler.cpp:
7521 * assembler/ARMAssembler.h:
7522 * assembler/ARMv7Assembler.h:
7523 * assembler/MacroAssemblerARM.h:
7524 * assembler/MacroAssemblerARMv7.h:
7525 * assembler/MacroAssemblerX86Common.h:
7526 * assembler/MacroAssemblerX86_64.h:
7527 * assembler/X86Assembler.h:
7529 * jit/JITArithmetic.cpp:
7530 * jit/JITInlineMethods.h:
7531 * jit/JITOpcodes.cpp:
7532 * wrec/WRECGenerator.cpp:
7533 * wrec/WRECGenerator.h:
7534 * yarr/RegexJIT.cpp:
7536 2009-08-19 Oliver Hunt <oliver@apple.com>
7538 Reviewed by Gavin Barraclough.
7540 Devirtualise marking
7541 https://bugs.webkit.org/show_bug.cgi?id=28294
7543 We actually need to mark the value in a number object if we're using the
7544 32bit number representation.
7546 * runtime/NumberObject.h:
7547 (JSC::NumberObject::createStructure):
7549 2009-08-19 Gavin Barraclough <barraclough@apple.com>
7551 Reviewed by Darin Adler.
7553 We probably shouldn't be keeping the AST for eval nodes around forevar.
7554 https://bugs.webkit.org/show_bug.cgi?id=28469
7556 EvalNodes don't destroyData() (delete their parser data) since they need to hold onto
7557 their varStack. Copy a list of variable onto EvalCodeBlock, and this can go away.
7559 * bytecode/CodeBlock.h:
7560 (JSC::EvalCodeBlock::variable):
7561 (JSC::EvalCodeBlock::numVariables):
7562 (JSC::EvalCodeBlock::adoptVariables):
7563 * bytecompiler/BytecodeGenerator.cpp:
7564 (JSC::BytecodeGenerator::BytecodeGenerator):
7565 * interpreter/Interpreter.cpp:
7566 (JSC::Interpreter::execute):
7568 * runtime/Executable.cpp:
7569 (JSC::EvalExecutable::generateBytecode):
7570 * runtime/Executable.h:
7572 2009-08-19 Jungshik Shin <jshin@chromium.org>
7574 Reviewed by Darin Adler.
7576 http://bugs.webkit.org/show_bug.cgi?id=28441
7578 Fix a build issue with ICU 4.2 or later on Windows with Visual C++.
7579 Instead of defining all isXXX and toupper/tolower as
7580 WTF_Please_use_ASCIICType_instead_of_ctype_see_comment_in_ASCIICType_h,
7581 #define them to be different by prepending 'WTF_...ASCIIType_h' with
7582 the originial names like 'toupper_WTF_...ASCIIType_h'.
7584 * wtf/DisallowCType.h:
7586 2009-08-18 Oliver Hunt <oliver@apple.com>
7588 Reviewed by Gavin Barraclough.
7590 Assigning a function to an object should always use the existing transition, even if the transition is not specialized
7591 https://bugs.webkit.org/show_bug.cgi?id=28442
7593 Check for an unspecialized transition as an alternative to always failing if specialisation does not match.
7595 * runtime/Structure.cpp:
7596 (JSC::Structure::addPropertyTransitionToExistingStructure):
7598 2009-08-18 Dirk Schulze <krit@webkit.org>
7600 Reviewed by Oliver Hunt.
7602 Added additional getter to ByteArray with an unsigned char as return.
7603 ByteArray can take unsigned char directly now.
7606 (WTF::ByteArray::set):
7607 (WTF::ByteArray::get):
7609 2009-08-18 Peter Kasting <pkasting@google.com>
7611 Reviewed by Eric Seidel.
7613 https://bugs.webkit.org/show_bug.cgi?id=28415
7614 Set svn:eol-style CRLF on all .sln and .vcproj files that don't already
7617 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
7618 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
7620 2009-08-18 Xan Lopez <xlopez@igalia.com>
7622 Try to fix the GTK+ build.
7626 2009-08-17 Gavin Barraclough <barraclough@apple.com>
7628 Reviewed by Sam Weinig.
7630 No, silly runtime, AST nodes are not for you.
7632 We still use AST nodes (ScopeNodes, particularly FunctionBodyNodes) within
7633 the runtime, which means that these nodes must be persisted outside of the
7634 arena, contain both parser & runtime data, etc. This is all a bit of a mess.
7636 Move functionality into a new FunctionExecutable class.
7638 * API/JSCallbackFunction.cpp:
7639 * API/JSObjectRef.cpp:
7640 * JavaScriptCore.exp:
7641 * JavaScriptCore.xcodeproj/project.pbxproj:
7642 * bytecode/CodeBlock.cpp:
7643 (JSC::CodeBlock::CodeBlock):
7644 (JSC::CodeBlock::markAggregate):
7645 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
7646 (JSC::CodeBlock::lineNumberForBytecodeOffset):
7647 (JSC::CodeBlock::shrinkToFit):
7648 * bytecode/CodeBlock.h:
7649 (JSC::CodeBlock::getBytecodeIndex):
7650 (JSC::CodeBlock::discardBytecode):
7651 (JSC::CodeBlock::instructionCount):
7652 (JSC::CodeBlock::getJITCode):
7653 (JSC::CodeBlock::executablePool):
7654 (JSC::CodeBlock::ownerExecutable):
7655 (JSC::CodeBlock::extractExceptionInfo):
7656 (JSC::CodeBlock::addFunctionDecl):
7657 (JSC::CodeBlock::functionDecl):
7658 (JSC::CodeBlock::numberOfFunctionDecls):
7659 (JSC::CodeBlock::addFunctionExpr):
7660 (JSC::CodeBlock::functionExpr):
7661 (JSC::GlobalCodeBlock::GlobalCodeBlock):
7662 (JSC::ProgramCodeBlock::ProgramCodeBlock):
7663 (JSC::EvalCodeBlock::EvalCodeBlock):
7664 (JSC::FunctionCodeBlock::FunctionCodeBlock):
7665 (JSC::NativeCodeBlock::NativeCodeBlock):
7666 * bytecode/EvalCodeCache.h:
7667 * bytecode/SamplingTool.cpp:
7668 (JSC::SamplingTool::doRun):
7669 * bytecompiler/BytecodeGenerator.cpp:
7670 (JSC::BytecodeGenerator::BytecodeGenerator):
7671 (JSC::BytecodeGenerator::emitNewFunction):
7672 (JSC::BytecodeGenerator::emitNewFunctionExpression):
7673 * bytecompiler/BytecodeGenerator.h:
7674 * debugger/Debugger.cpp:
7675 (JSC::Debugger::recompileAllJSFunctions):
7676 * interpreter/CachedCall.h:
7677 (JSC::CachedCall::CachedCall):
7678 * interpreter/CallFrameClosure.h:
7679 * interpreter/Interpreter.cpp:
7680 (JSC::Interpreter::unwindCallFrame):
7681 (JSC::Interpreter::throwException):
7682 (JSC::Interpreter::execute):
7683 (JSC::Interpreter::prepareForRepeatCall):
7684 (JSC::Interpreter::debug):
7685 (JSC::Interpreter::privateExecute):
7686 (JSC::Interpreter::retrieveLastCaller):
7687 * interpreter/Interpreter.h:
7689 (JSC::JIT::privateCompile):
7691 (JSC::JIT::compile):
7692 * jit/JITOpcodes.cpp:
7693 (JSC::JIT::privateCompileCTIMachineTrampolines):
7694 (JSC::JIT::emit_op_new_func):
7695 (JSC::JIT::emit_op_new_func_exp):
7697 (JSC::DEFINE_STUB_FUNCTION):
7701 (JSC::FunctionBodyNode::reparseDataIfNecessary):
7703 (JSC::EvalNode::partialDestroyData):
7705 * profiler/ProfileGenerator.cpp:
7706 * profiler/Profiler.cpp:
7707 (JSC::Profiler::createCallIdentifier):
7708 (JSC::createCallIdentifierFromFunctionImp):
7709 * runtime/Arguments.h:
7710 (JSC::Arguments::getArgumentsData):
7711 (JSC::Arguments::Arguments):
7712 (JSC::JSActivation::copyRegisters):
7713 * runtime/ArrayPrototype.cpp:
7714 (JSC::isNumericCompareFunction):
7715 * runtime/CallData.h:
7717 * runtime/Collector.cpp:
7718 (JSC::Heap::collect):
7719 * runtime/ConstructData.h:
7721 * runtime/ExceptionHelpers.cpp:
7722 (JSC::createUndefinedVariableError):
7723 (JSC::createInvalidParamError):
7724 (JSC::createNotAConstructorError):
7725 (JSC::createNotAFunctionError):
7726 (JSC::createNotAnObjectError):
7727 * runtime/Executable.cpp: Added.
7728 (JSC::EvalExecutable::generateBytecode):
7729 (JSC::ProgramExecutable::generateBytecode):
7730 (JSC::FunctionExecutable::generateBytecode):
7731 (JSC::EvalExecutable::generateJITCode):
7732 (JSC::ProgramExecutable::generateJITCode):
7733 (JSC::FunctionExecutable::generateJITCode):
7734 (JSC::FunctionExecutable::isHostFunction):
7735 (JSC::FunctionExecutable::markAggregate):
7736 (JSC::FunctionExecutable::reparseExceptionInfo):
7737 (JSC::EvalExecutable::reparseExceptionInfo):
7738 (JSC::FunctionExecutable::recompile):
7739 (JSC::FunctionExecutable::FunctionExecutable):
7740 * runtime/Executable.h:
7741 (JSC::ExecutableBase::~ExecutableBase):
7742 (JSC::ExecutableBase::ExecutableBase):
7743 (JSC::ExecutableBase::source):
7744 (JSC::ExecutableBase::sourceID):
7745 (JSC::ExecutableBase::lastLine):
7746 (JSC::ExecutableBase::usesEval):
7747 (JSC::ExecutableBase::usesArguments):
7748 (JSC::ExecutableBase::needsActivation):
7749 (JSC::ExecutableBase::astNode):
7750 (JSC::ExecutableBase::generatedJITCode):
7751 (JSC::ExecutableBase::getExecutablePool):
7752 (JSC::EvalExecutable::EvalExecutable):
7753 (JSC::EvalExecutable::bytecode):
7754 (JSC::EvalExecutable::varStack):
7755 (JSC::EvalExecutable::evalNode):
7756 (JSC::EvalExecutable::jitCode):
7757 (JSC::ProgramExecutable::ProgramExecutable):
7758 (JSC::ProgramExecutable::reparseExceptionInfo):
7759 (JSC::ProgramExecutable::bytecode):
7760 (JSC::ProgramExecutable::programNode):
7761 (JSC::ProgramExecutable::jitCode):
7762 (JSC::FunctionExecutable::FunctionExecutable):
7763 (JSC::FunctionExecutable::name):
7764 (JSC::FunctionExecutable::bytecode):
7765 (JSC::FunctionExecutable::generatedBytecode):
7766 (JSC::FunctionExecutable::usesEval):
7767 (JSC::FunctionExecutable::usesArguments):
7768 (JSC::FunctionExecutable::parameterCount):
7769 (JSC::FunctionExecutable::paramString):
7770 (JSC::FunctionExecutable::isGenerated):
7771 (JSC::FunctionExecutable::body):
7772 (JSC::FunctionExecutable::jitCode):
7773 (JSC::FunctionExecutable::createNativeThunk):
7774 * runtime/FunctionConstructor.cpp:
7775 (JSC::constructFunction):
7776 * runtime/FunctionPrototype.cpp:
7777 (JSC::functionProtoFuncToString):
7778 * runtime/JSActivation.cpp:
7779 (JSC::JSActivation::JSActivation):
7780 (JSC::JSActivation::markChildren):
7781 (JSC::JSActivation::isDynamicScope):
7782 (JSC::JSActivation::argumentsGetter):
7783 * runtime/JSActivation.h:
7784 (JSC::JSActivation::JSActivationData::JSActivationData):
7785 * runtime/JSFunction.cpp:
7786 (JSC::JSFunction::isHostFunction):
7787 (JSC::JSFunction::JSFunction):
7788 (JSC::JSFunction::~JSFunction):
7789 (JSC::JSFunction::markChildren):
7790 (JSC::JSFunction::getCallData):
7791 (JSC::JSFunction::call):
7792 (JSC::JSFunction::lengthGetter):
7793 (JSC::JSFunction::getConstructData):
7794 (JSC::JSFunction::construct):
7795 * runtime/JSFunction.h:
7796 (JSC::JSFunction::executable):
7797 (JSC::FunctionExecutable::make):
7798 * runtime/JSGlobalData.cpp:
7799 (JSC::JSGlobalData::JSGlobalData):
7800 (JSC::JSGlobalData::numericCompareFunction):
7801 * runtime/JSGlobalData.h:
7803 2009-08-17 Mark Rowe <mrowe@apple.com>
7805 Reviewed by Darin Adler.
7807 Fix 300,000+ leaks seen during the regression tests.
7809 EvalCodeCache::get was heap-allocating an EvalExecutable instance without adopting the initial reference.
7810 While fixing this we noticed that EvalExecutable was a RefCounted type that was sometimes stack allocated.
7811 To make this cleaner and to prevent clients from attempting to ref a stack-allocated instance, we move the
7812 refcounting down to a new CacheableEvalExecutable class that derives from EvalExecutable. EvalCodeCache::get
7813 now uses CacheableEvalExecutable::create and avoids the leak.
7815 * bytecode/EvalCodeCache.h:
7816 (JSC::EvalCodeCache::get):
7817 * interpreter/Interpreter.cpp:
7818 (JSC::Interpreter::callEval):
7819 * runtime/Executable.h:
7820 (JSC::CacheableEvalExecutable::create):
7821 (JSC::CacheableEvalExecutable::CacheableEvalExecutable):
7823 2009-08-17 Oliver Hunt <oliver@apple.com>
7827 REGRESSION (r47292): Prototype.js is broken by ES5 Arguments changes
7828 https://bugs.webkit.org/show_bug.cgi?id=28341
7829 <rdar://problem/7145615>
7831 Reverting r47292. Alas Prototype.js breaks with Arguments inheriting
7832 from Array as ES5 attempted. Prototype.js defines $A in terms of a
7833 function it places on (among other global objects) the Array prototype,
7834 thus breaking $A for arrays.
7836 * runtime/Arguments.h:
7837 (JSC::Arguments::Arguments):
7838 * runtime/JSGlobalObject.cpp:
7839 (JSC::JSGlobalObject::reset):
7840 (JSC::JSGlobalObject::markChildren):
7841 * runtime/JSGlobalObject.h:
7842 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
7843 * runtime/ObjectPrototype.cpp:
7844 (JSC::ObjectPrototype::ObjectPrototype):
7845 * runtime/ObjectPrototype.h:
7846 * tests/mozilla/ecma_3/Function/arguments-001.js:
7848 2009-08-17 Peter Kasting <pkasting@google.com>
7850 Reviewed by Steve Falkenburg.
7852 https://bugs.webkit.org/show_bug.cgi?id=27323
7853 Only add Cygwin to the path when it isn't already there. This avoids
7854 causing problems for people who purposefully have non-Cygwin versions of
7855 executables like svn in front of the Cygwin ones in their paths.
7857 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
7858 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
7859 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
7860 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
7861 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
7863 2009-08-17 Xan Lopez <xlopez@igalia.com>
7865 Reviewed by Mark Rowe.
7867 Fix build with FAST_MALLOC_MATCH_VALIDATION enabled.
7869 * wtf/FastMalloc.cpp:
7874 2009-08-16 Holger Hans Peter Freyther <zecke@selfish.org>
7876 Reviewed by Mark Rowe.
7878 Fix crash on ./ecma_2/RegExp/exec-002.js.
7879 https://bugs.webkit.org/show_bug.cgi?id=28353
7881 Change the order of freeParenthesesDisjunctionContext and
7882 popParenthesesDisjunctionContext on all call sites as the pop
7883 method is accessing backTrack->lastContext which is the context
7884 that is about to be freed.
7886 * yarr/RegexInterpreter.cpp:
7887 (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
7888 (JSC::Yarr::Interpreter::backtrackParentheses):
7890 2009-08-16 Holger Hans Peter Freyther <zecke@selfish.org>
7892 Reviewed by Mark Rowe.
7894 https://bugs.webkit.org/show_bug.cgi?id=28352
7896 Fix coding style violations. Use m_ for C++ class members. Remove
7897 trailing whitespace on empty lines.
7899 * yarr/RegexInterpreter.cpp:
7900 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
7901 (JSC::Yarr::Interpreter::tryConsumeCharacter):
7902 (JSC::Yarr::Interpreter::tryConsumeBackReference):
7903 (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
7904 (JSC::Yarr::Interpreter::backtrackParentheses):
7905 (JSC::Yarr::ByteCompiler::ByteCompiler):
7906 (JSC::Yarr::ByteCompiler::compile):
7907 (JSC::Yarr::ByteCompiler::checkInput):
7908 (JSC::Yarr::ByteCompiler::assertionBOL):
7909 (JSC::Yarr::ByteCompiler::assertionEOL):
7910 (JSC::Yarr::ByteCompiler::assertionWordBoundary):
7911 (JSC::Yarr::ByteCompiler::atomPatternCharacter):
7912 (JSC::Yarr::ByteCompiler::atomCharacterClass):
7913 (JSC::Yarr::ByteCompiler::atomBackReference):
7914 (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
7915 (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
7916 (JSC::Yarr::ByteCompiler::popParenthesesStack):
7917 (JSC::Yarr::ByteCompiler::closeAlternative):
7918 (JSC::Yarr::ByteCompiler::closeBodyAlternative):
7919 (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
7920 (JSC::Yarr::ByteCompiler::regexBegin):
7921 (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction):
7922 (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
7923 (JSC::Yarr::ByteCompiler::emitDisjunction):
7925 2009-08-15 Mark Rowe <mrowe@apple.com>
7927 Fix the build with JIT disabled.
7929 * runtime/Arguments.h: Only compile the jitCode method when the JIT is enabled.
7930 * runtime/Executable.h: Include PrototypeFunction.h so the compiler knows what
7931 NativeFunctionWrapper is when the JIT is disabled.
7933 2009-08-15 Adam Bergkvist <adam.bergkvist@ericsson.com>
7935 Reviewed by Sam Weinig.
7937 Added ENABLE_EVENTSOURCE flag.
7938 https://bugs.webkit.org/show_bug.cgi?id=14997
7940 * Configurations/FeatureDefines.xcconfig:
7942 2009-08-14 Gavin Barraclough <barraclough@apple.com>
7945 (JSC::EvalExecutable::parse):
7946 (JSC::ProgramExecutable::parse):
7947 * runtime/Executable.h:
7949 2009-08-14 Gavin Barraclough <barraclough@apple.com>
7951 Reviewed by Oliver Hunt.
7953 Remove AST nodes from use within the Runtime (outside of parsing), stage 1
7954 https://bugs.webkit.org/show_bug.cgi?id=28330
7956 Remove the EvalNode and ProgramNode from use in the runtime. They still exist
7957 after this patch, but are hidden behind EvalExecutable and FunctionExecutable,
7958 and are also still reachable behind CodeBlock::m_ownerNode.
7960 The next step will be to beat back FunctionBodyNode in the same fashion.
7961 Then remove the usage via CodeBlock, then only construct these nodes only on
7962 demand during bytecode generation.
7964 * JavaScriptCore.xcodeproj/project.pbxproj:
7965 * bytecode/CodeBlock.h:
7966 (JSC::GlobalCodeBlock::GlobalCodeBlock):
7967 (JSC::GlobalCodeBlock::~GlobalCodeBlock):
7968 (JSC::ProgramCodeBlock::ProgramCodeBlock):
7969 (JSC::EvalCodeBlock::EvalCodeBlock):
7970 (JSC::FunctionCodeBlock::FunctionCodeBlock):
7971 (JSC::NativeCodeBlock::NativeCodeBlock):
7972 * bytecode/EvalCodeCache.h:
7973 (JSC::EvalCodeCache::get):
7974 * debugger/Debugger.cpp:
7975 (JSC::evaluateInGlobalCallFrame):
7976 * debugger/DebuggerCallFrame.cpp:
7977 (JSC::DebuggerCallFrame::evaluate):
7978 * interpreter/Interpreter.cpp:
7979 (JSC::Interpreter::callEval):
7980 (JSC::Interpreter::execute):
7981 * interpreter/Interpreter.h:
7983 (JSC::FunctionBodyNode::createNativeThunk):
7984 (JSC::FunctionBodyNode::generateBytecode):
7985 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
7987 (JSC::Parser::parse):
7988 (JSC::Parser::reparse):
7989 (JSC::Parser::parseFunctionFromGlobalCode):
7991 * runtime/Completion.cpp:
7994 * runtime/Error.cpp:
7997 * runtime/Executable.h: Added.
7998 (JSC::TemplateExecutable::TemplateExecutable):
7999 (JSC::TemplateExecutable::markAggregate):
8000 (JSC::TemplateExecutable::sourceURL):
8001 (JSC::TemplateExecutable::lineNo):
8002 (JSC::TemplateExecutable::bytecode):
8003 (JSC::TemplateExecutable::jitCode):
8004 (JSC::EvalExecutable::EvalExecutable):
8005 (JSC::ProgramExecutable::ProgramExecutable):
8006 * runtime/FunctionConstructor.cpp:
8007 (JSC::constructFunction):
8008 * runtime/FunctionConstructor.h:
8009 * runtime/JSGlobalData.cpp:
8010 (JSC::JSGlobalData::numericCompareFunction):
8011 * runtime/JSGlobalObject.cpp:
8012 (JSC::JSGlobalObject::~JSGlobalObject):
8013 (JSC::JSGlobalObject::markChildren):
8014 * runtime/JSGlobalObject.h:
8015 (JSC::JSGlobalObject::codeBlocks):
8016 * runtime/JSGlobalObjectFunctions.cpp:
8017 (JSC::globalFuncEval):
8019 2009-08-14 Darin Adler <darin@apple.com>
8021 Reviewed by Sam Weinig.
8023 Rename the confusing isObject(<class>) to inherits(<class>).
8024 It still works on non-objects, returning false.
8026 * runtime/ArrayConstructor.cpp:
8027 (JSC::arrayConstructorIsArray): Removed unneeded isObject call
8028 and updated remaining isObject call to new name, inherits.
8030 * runtime/JSCell.h: Renamed isObject(<class>) to inherits(<class>)
8031 but more importantly, made it non-virtual (it was already inline)
8032 so it is now as fast as JSObject::inherits was.
8034 * runtime/JSObject.h: Removed inherits function since the one
8035 in the base class is fine as-is. Also made various JSCell functions
8036 that should not be called on JSObject uncallable by making them
8037 both private and not implemented.
8038 (JSC::JSCell::inherits): Updated name.
8039 (JSC::JSValue::inherits): Ditto.
8041 * debugger/Debugger.cpp:
8042 (JSC::Debugger::recompileAllJSFunctions):
8043 * interpreter/Interpreter.cpp:
8044 (JSC::Interpreter::unwindCallFrame):
8045 * runtime/ArrayPrototype.cpp:
8046 (JSC::arrayProtoFuncToString):
8047 (JSC::arrayProtoFuncToLocaleString):
8048 (JSC::arrayProtoFuncConcat):
8049 * runtime/BooleanPrototype.cpp:
8050 (JSC::booleanProtoFuncToString):
8051 (JSC::booleanProtoFuncValueOf):
8052 * runtime/DateConstructor.cpp:
8053 (JSC::constructDate):
8054 * runtime/DatePrototype.cpp:
8055 (JSC::dateProtoFuncToString):
8056 (JSC::dateProtoFuncToUTCString):
8057 (JSC::dateProtoFuncToISOString):
8058 (JSC::dateProtoFuncToDateString):
8059 (JSC::dateProtoFuncToTimeString):
8060 (JSC::dateProtoFuncToLocaleString):
8061 (JSC::dateProtoFuncToLocaleDateString):
8062 (JSC::dateProtoFuncToLocaleTimeString):
8063 (JSC::dateProtoFuncGetTime):
8064 (JSC::dateProtoFuncGetFullYear):
8065 (JSC::dateProtoFuncGetUTCFullYear):
8066 (JSC::dateProtoFuncToGMTString):
8067 (JSC::dateProtoFuncGetMonth):
8068 (JSC::dateProtoFuncGetUTCMonth):
8069 (JSC::dateProtoFuncGetDate):
8070 (JSC::dateProtoFuncGetUTCDate):
8071 (JSC::dateProtoFuncGetDay):
8072 (JSC::dateProtoFuncGetUTCDay):
8073 (JSC::dateProtoFuncGetHours):
8074 (JSC::dateProtoFuncGetUTCHours):
8075 (JSC::dateProtoFuncGetMinutes):
8076 (JSC::dateProtoFuncGetUTCMinutes):
8077 (JSC::dateProtoFuncGetSeconds):
8078 (JSC::dateProtoFuncGetUTCSeconds):
8079 (JSC::dateProtoFuncGetMilliSeconds):
8080 (JSC::dateProtoFuncGetUTCMilliseconds):
8081 (JSC::dateProtoFuncGetTimezoneOffset):
8082 (JSC::dateProtoFuncSetTime):
8083 (JSC::setNewValueFromTimeArgs):
8084 (JSC::setNewValueFromDateArgs):
8085 (JSC::dateProtoFuncSetYear):
8086 (JSC::dateProtoFuncGetYear):
8087 * runtime/FunctionPrototype.cpp:
8088 (JSC::functionProtoFuncToString):
8089 * runtime/JSActivation.cpp:
8090 (JSC::JSActivation::argumentsGetter):
8091 * runtime/JSValue.h:
8092 * runtime/RegExpConstructor.cpp:
8093 (JSC::constructRegExp):
8094 * runtime/RegExpPrototype.cpp:
8095 (JSC::regExpProtoFuncTest):
8096 (JSC::regExpProtoFuncExec):
8097 (JSC::regExpProtoFuncCompile):
8098 (JSC::regExpProtoFuncToString):
8099 * runtime/ScopeChain.cpp:
8100 (JSC::ScopeChain::localDepth):
8101 * runtime/StringPrototype.cpp:
8102 (JSC::stringProtoFuncReplace):
8103 (JSC::stringProtoFuncToString):
8104 (JSC::stringProtoFuncMatch):
8105 (JSC::stringProtoFuncSearch):
8106 (JSC::stringProtoFuncSplit):
8107 Updated to new name, inherits, from old name, isObject.
8109 2009-07-31 Harald Fernengel <harald.fernengel@nokia.com>
8111 Reviewed by Simon Hausmann.
8113 Adding QNX as a platform. Currently only tested with Qt.
8115 https://bugs.webkit.org/show_bug.cgi?id=27885
8117 * JavaScriptCore/runtime/Collector.cpp: Added retrieving of stack base
8118 since QNX doesn't have the pthread _nt functions
8119 * JavaScriptCore/wtf/Platform.h: Added WTF_PLATFORM_QNX and corresponding
8121 * WebCore/bridge/npapi.h: Build fix for missing typedefs on QNX
8123 2009-08-14 Gabor Loki <loki@inf.u-szeged.hu>
8125 Reviewed by Simon Hausmann.
8127 Currently generic ARM and ARMv7 platforms work only with JSVALUE32
8128 https://bugs.webkit.org/show_bug.cgi?id=28300
8132 2009-08-14 Gabor Loki <loki@inf.u-szeged.hu>
8134 Reviewed by Simon Hausmann.
8136 Enable JIT on ARM for QT by default
8137 https://bugs.webkit.org/show_bug.cgi?id=28259
8141 2009-08-14 Gabor Loki <loki@inf.u-szeged.hu>
8143 Reviewed by Simon Hausmann.
8145 Enable YARR_JIT on ARM for QT by default
8146 https://bugs.webkit.org/show_bug.cgi?id=28259
8150 2009-08-14 Oliver Hunt <oliver@apple.com>
8152 Reviewed by Gavin Barraclough.
8154 [ES5] Arguments object should inherit from Array
8155 https://bugs.webkit.org/show_bug.cgi?id=28298
8157 Make the Arguments object conform to the behaviour specified in ES5.
8158 The simple portion of this is to make Arguments use Array.prototype
8159 as its prototype rather than Object.prototype.
8161 The spec then requires us to set instance.constructor to the pristine
8162 Object constructor, and instance.toString and instance.toLocaleString
8163 to the pristine versions from Object.prototype. To do this we now
8164 make the ObjectPrototype constructor return its toString and
8165 toLocaleString functions (similar to the call and apply functions
8166 from FunctionPrototype).
8168 Oddly enough this reports itself as a slight win, but given the code
8169 isn't hit in the tests that claim to have improved I put this down to
8172 * runtime/Arguments.h:
8173 (JSC::Arguments::Arguments):
8174 (JSC::Arguments::initializeStandardProperties):
8175 * runtime/JSGlobalObject.cpp:
8176 (JSC::JSGlobalObject::reset):
8177 (JSC::JSGlobalObject::markChildren):
8178 * runtime/JSGlobalObject.h:
8179 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
8180 (JSC::JSGlobalObject::objectConstructor):
8181 (JSC::JSGlobalObject::objectToStringFunction):
8182 (JSC::JSGlobalObject::objectToLocaleStringFunction):
8183 * runtime/ObjectPrototype.cpp:
8184 (JSC::ObjectPrototype::ObjectPrototype):
8185 * runtime/ObjectPrototype.h:
8186 * tests/mozilla/ecma_3/Function/arguments-001.js:
8187 Update test to new es5 behaviour
8189 2009-08-14 Oliver Hunt <oliver@apple.com>
8191 Remove MarkStack::drain from the JSC exports file
8193 MarkStack::drain is now marked inline, the including it in the exports file
8194 produces an ld warning
8196 * JavaScriptCore.exp:
8198 2009-08-13 Sam Weinig <sam@webkit.org>
8200 Reviewed by Oliver Hunt.
8202 Remove accidentally left in debugging statement.
8204 * runtime/JSArray.h:
8205 (JSC::MarkStack::drain):
8207 2009-08-13 Oliver Hunt <oliver@apple.com>
8209 Reviewed by Maciej Stachowiak.
8211 [ES5] Implement Array.isArray
8212 https://bugs.webkit.org/show_bug.cgi?id=28296
8214 Add support for Array.isArray to the Array constructor
8216 * runtime/ArrayConstructor.cpp:
8217 (JSC::ArrayConstructor::ArrayConstructor):
8218 (JSC::arrayConstructorIsArray):
8219 * runtime/ArrayConstructor.h:
8220 * runtime/CommonIdentifiers.h:
8221 * runtime/JSArray.h:
8222 (JSC::MarkStack::drain):
8223 * runtime/JSGlobalObject.cpp:
8224 (JSC::JSGlobalObject::reset):
8226 2009-08-13 Oliver Hunt <oliver@apple.com>
8228 Reviewed by NOBODY (Buildfix).
8230 Attempt to fix windows build
8232 * runtime/Collector.cpp:
8234 2009-08-13 Oliver Hunt <oliver@apple.com>
8236 Reviewed by Maciej Stachowiak.
8238 Devirtualise marking
8239 https://bugs.webkit.org/show_bug.cgi?id=28294
8241 Add a bit to TypeInfo to indicate that an object uses the standard
8242 JSObject::markChildren method. This allows us to devirtualise marking
8243 of most objects (though a branch is still needed). We also add a branch
8244 to identify arrays thus devirtualising marking in that case as well.
8246 In order to make the best use of this devirtualisation I've also reworked
8247 the MarkStack::drain() logic to make the iteration more efficient.
8249 * API/JSCallbackConstructor.h:
8250 (JSC::JSCallbackConstructor::createStructure):
8251 * API/JSCallbackFunction.h:
8252 (JSC::JSCallbackFunction::createStructure):
8253 * JavaScriptCore.exp:
8254 * runtime/BooleanObject.h:
8255 (JSC::BooleanObject::createStructure):
8256 * runtime/FunctionPrototype.h:
8257 (JSC::FunctionPrototype::createStructure):
8258 * runtime/InternalFunction.h:
8259 (JSC::InternalFunction::createStructure):
8260 * runtime/JSAPIValueWrapper.h:
8261 (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
8262 * runtime/JSArray.cpp:
8263 (JSC::JSArray::markChildren):
8264 * runtime/JSArray.h:
8265 (JSC::JSArray::markChildrenDirect):
8266 (JSC::MarkStack::drain):
8267 * runtime/JSByteArray.cpp:
8268 (JSC::JSByteArray::createStructure):
8270 (JSC::MarkStack::append):
8271 * runtime/JSGlobalData.cpp:
8272 (JSC::JSGlobalData::JSGlobalData):
8273 * runtime/JSNumberCell.h:
8274 (JSC::JSNumberCell::createStructure):
8275 * runtime/JSONObject.h:
8276 (JSC::JSONObject::createStructure):
8277 * runtime/JSObject.cpp:
8278 (JSC::JSObject::markChildren):
8279 * runtime/JSObject.h:
8280 (JSC::JSObject::markChildrenDirect):
8281 (JSC::JSObject::createStructure):
8282 * runtime/JSString.h:
8283 (JSC::JSString::createStructure):
8286 * runtime/MarkStack.h:
8287 (JSC::MarkStack::MarkStack):
8288 (JSC::MarkStack::MarkSet::MarkSet):
8289 (JSC::MarkStack::MarkStackArray::last):
8290 * runtime/MathObject.h:
8291 (JSC::MathObject::createStructure):
8292 * runtime/NumberConstructor.h:
8293 (JSC::NumberConstructor::createStructure):
8294 * runtime/NumberObject.h:
8295 (JSC::NumberObject::createStructure):
8296 * runtime/RegExpConstructor.h:
8297 (JSC::RegExpConstructor::createStructure):
8298 * runtime/RegExpObject.h:
8299 (JSC::RegExpObject::createStructure):
8300 * runtime/StringObjectThatMasqueradesAsUndefined.h:
8301 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
8302 * runtime/TypeInfo.h:
8303 (JSC::TypeInfo::hasDefaultMark):
8305 2009-08-13 Darin Adler <darin@apple.com>
8307 Reviewed by Mark Rowe.
8309 Some small bits of housekeeping.
8311 * JavaScriptCore.xcodeproj/project.pbxproj: Make Parser.h
8312 project instead of private. Remove JSONObject.lut.h.
8314 * assembler/ARMAssembler.h: Remove unneeded WTF prefix.
8315 * assembler/AssemblerBufferWithConstantPool.h: Ditto.
8316 * bytecompiler/BytecodeGenerator.h: Ditto.
8318 * wtf/SegmentedVector.h: Add a "using" statement as we do
8319 with the other WTF headers.
8321 2009-08-13 Darin Adler <darin@apple.com>
8325 * parser/Grammar.y: Use a template function so we can compile
8326 setStatementLocation even if it comes before YYLTYPE is defined.
8328 2009-08-13 Darin Adler <darin@apple.com>
8330 Reviewed by George Staikos.
8332 Too much use of void* in Grammar.y
8333 https://bugs.webkit.org/show_bug.cgi?id=28287
8335 * parser/Grammar.y: Changed all the helper functions to
8336 take a JSGlobalData* instead of a void*. A couple formatting
8337 tweaks that I missed when breaking this into pieces.
8339 2009-08-13 Darin Adler <darin@apple.com>
8341 Reviewed by George Staikos.
8343 Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
8345 * parser/Grammar.y: Reduced and sorted includes. Tweaked comment
8346 format. Marked a few more functions inline.
8348 2009-08-13 Darin Adler <darin@apple.com>
8350 Reviewed by George Staikos.
8352 Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
8354 * parser/Grammar.y: Pass the number to the PropertyNode instead of
8355 first turning it into an Identifier.
8357 * parser/NodeConstructors.h:
8358 (JSC::PropertyNode::PropertyNode): Add an overload that takes a double
8359 so the code to convert to a string can be here instead of Grammar.y.
8360 * parser/Nodes.h: Ditto.
8362 2009-08-13 Darin Adler <darin@apple.com>
8364 Reviewed by George Staikos.
8366 Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
8368 * parser/Grammar.y: Eliminate the DBG macro.
8370 2009-08-13 Darin Adler <darin@apple.com>
8372 Reviewed by George Staikos.
8374 Another part of https://bugs.webkit.org/show_bug.cgi?id=28287
8376 * parser/Grammar.y: Eliminate the SET_EXCEPTION_LOCATION macro.
8378 2009-08-13 Darin Adler <darin@apple.com>
8380 Reviewed by George Staikos.
8382 George asked me to break the patch from
8383 https://bugs.webkit.org/show_bug.cgi?id=28287
8384 into smaller pieces and land it in stages.
8386 * parser/Grammar.y: Eliminate the LEXER macro.
8388 2009-08-13 Mark Rowe <mrowe@apple.com>
8390 Try some more to fix the Windows build.
8392 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol.
8393 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto.
8395 2009-08-13 Mark Rowe <mrowe@apple.com>
8397 Try and fix the Windows build.
8399 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a new symbol.
8400 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Ditto.
8402 2009-08-13 Darin Adler <darin@apple.com>
8404 Reviewed by David Levin.
8406 JavaScriptCore tweaks to get ready for the parser arena
8407 https://bugs.webkit.org/show_bug.cgi?id=28243
8409 Eliminate dependencies on Nodes.h outside JavaScriptCore,
8410 and cut down on them inside JavaScriptCore.
8412 Change regular expression parsing to use identifiers as
8413 with other strings we parse.
8415 Fix a couple things that are needed to use const Identifier
8416 more, which will be part of the parser arena work.
8418 * JavaScriptCore.exp: Resorted and updated.
8420 * JavaScriptCore.xcodeproj/project.pbxproj: Changed
8421 CollectorHeapIterator.h to be project-internal.
8423 * bytecompiler/BytecodeGenerator.cpp:
8424 (JSC::BytecodeGenerator::emitPushNewScope): Added const.
8425 * bytecompiler/BytecodeGenerator.h: Ditto.
8427 * debugger/Debugger.cpp:
8428 (JSC::Debugger::recompileAllJSFunctions): Moved this function
8429 here from WebCore. Here is better since it uses so many internals.
8430 Removed unimportant optimization for the no listener case.
8431 * debugger/Debugger.h: Ditto. Also removed unneeded include
8432 and tweaked formatting and comments.
8434 * debugger/DebuggerCallFrame.cpp:
8435 (JSC::DebuggerCallFrame::functionName): Call asFunction instead
8436 of doing the unchecked static_cast.
8437 (JSC::DebuggerCallFrame::calculatedFunctionName): Ditto.
8440 (JSC::op_call_JSFunction): Call isHostFunction on the body rather
8441 than on the JSFunction.
8442 (JSC::vm_lazyLinkCall): Ditto.
8443 (JSC::op_construct_JSConstruct): Ditto.
8445 * parser/Grammar.y: Changed callers to use new scanRegExp with
8446 out arguments instead of relying on state in the Lexer. And
8447 callers that just want to skip a regular expression to use
8451 (JSC::Lexer::scanRegExp): Changed to use out arguments, and to
8452 add a prefix argument so we can add in the "=" character as needed.
8453 Also rewrote to streamline the logic a bit inspired by suggestions
8455 (JSC::Lexer::skipRegExp): Added. Version of the function above that
8456 does not actually put the regular expression into a string.
8457 (JSC::Lexer::clear): Removed code to clear m_pattern and m_flags.
8458 * parser/Lexer.h: Changed scanRegExp to have out arguments. Added
8459 skipRegExp. Eliminated pattern, flags, m_pattern, and m_flags.
8461 * parser/NodeConstructors.h:
8462 (JSC::RegExpNode::RegExpNode): Changed to take const Identifier&.
8464 (JSC::RegExpNode::emitBytecode): Changed since m_pattern and
8465 m_flags are now Identifier instead of UString.
8466 (JSC::FunctionBodyNode::make): Moved this function here instead
8467 of putting it in the JSFunction.h header.
8468 * parser/Nodes.h: Changed RegExpNode to use Identifier.
8470 * profiler/Profiler.cpp:
8471 (JSC::Profiler::createCallIdentifier): Changed to use isHostFunction
8472 on the body instead of on the JSFunction object.
8473 * runtime/FunctionPrototype.cpp:
8474 (JSC::functionProtoFuncToString): Ditto.
8476 * runtime/JSFunction.cpp:
8477 (JSC::JSFunction::isHostFunction): Moved here from header.
8478 (JSC::JSFunction::isHostFunctionNonInline): Added.
8479 (JSC::JSFunction::JSFunction): Removed unneeded initialization of
8481 (JSC::JSFunction::setBody): Moved here from header.
8483 * runtime/JSFunction.h: Removed unneeded includes. Moved private
8484 constructor down to the private section. Made virtual functions
8485 private. Removed unneeded overload of setBody and moved the body
8486 of the function into the .cpp file. Changed assertions to use
8487 the non-inline version of isHostFunction.
8489 * runtime/PropertySlot.cpp:
8490 (JSC::PropertySlot::functionGetter): Use asFunction instead
8491 of doing the unchecked static_cast.
8493 * wtf/SegmentedVector.h:
8494 (WTF::SegmentedVector::isEmpty): Added.
8496 2009-08-13 Mark Rowe <mrowe@apple.com>
8498 Rubber-stamped by Darin Adler.
8500 Use the version of operator new that takes a JSGlobalData when allocating FuncDeclNode and FuncExprNode
8501 from within the grammar to prevent these nodes from being leaked.
8505 2009-08-13 Simon Hausmann <simon.hausmann@nokia.com>
8507 Reviewed by Ariya Hidayat.
8509 Remove the special-case for Qt wrt JSVALUE_32 introduced in
8510 r46709. It must've been a dependency issue on the bot, as
8511 after a manual build all the tests pass on amd64 and ia32.
8515 2009-08-12 Gabor Loki <loki@inf.u-szeged.hu>
8517 Reviewed by Gavin Barraclough.
8519 Add optimize call and property access support for ARM JIT.
8520 https://bugs.webkit.org/show_bug.cgi?id=24986
8522 For tightly coupled sequences the BEGIN_UNINTERRUPTED_SEQUENCE and
8523 END_UNINTERRUPTED_SEQUENCE macros have been introduced which ensure
8524 space for instructions and constants of the named sequence. This
8525 method is vital for those architecture which are using constant pool.
8527 The 'latePatch' method - which was linked to JmpSrc - is replaced with
8528 a port specific solution (each calls are marked to place their address
8529 on the constant pool).
8531 * assembler/ARMAssembler.cpp:
8532 (JSC::ARMAssembler::linkBranch):
8533 (JSC::ARMAssembler::executableCopy): Add extra align for constant pool.
8534 * assembler/ARMAssembler.h:
8535 (JSC::ARMAssembler::JmpSrc::JmpSrc):
8536 (JSC::ARMAssembler::sizeOfConstantPool):
8537 (JSC::ARMAssembler::jmp):
8538 (JSC::ARMAssembler::linkCall):
8539 * assembler/ARMv7Assembler.h:
8540 * assembler/AbstractMacroAssembler.h:
8541 * assembler/AssemblerBufferWithConstantPool.h:
8542 (JSC::AssemblerBufferWithConstantPool::flushIfNoSpaceFor): Fix the
8543 computation of the remaining space.
8544 * assembler/MacroAssemblerARM.h:
8545 (JSC::MacroAssemblerARM::branch32):
8546 (JSC::MacroAssemblerARM::nearCall):
8547 (JSC::MacroAssemblerARM::call):
8548 (JSC::MacroAssemblerARM::branchPtrWithPatch):
8549 (JSC::MacroAssemblerARM::ensureSpace):
8550 (JSC::MacroAssemblerARM::sizeOfConstantPool):
8551 (JSC::MacroAssemblerARM::prepareCall):
8552 * assembler/X86Assembler.h:
8555 (JSC::JIT::compileOpCall):
8556 * jit/JITInlineMethods.h:
8557 (JSC::JIT::beginUninterruptedSequence):
8558 (JSC::JIT::endUninterruptedSequence):
8559 * jit/JITPropertyAccess.cpp:
8560 (JSC::JIT::emit_op_method_check):
8561 (JSC::JIT::compileGetByIdHotPath):
8562 (JSC::JIT::compileGetByIdSlowCase):
8563 (JSC::JIT::emit_op_put_by_id):
8565 2009-08-12 Gavin Barraclough <barraclough@apple.com>
8567 Rubber Stamped by Dave Kilzer.
8569 Disable WTF_USE_JSVALUE32_64 on iPhone for now (support not yet added for ARMv7).
8573 2009-08-12 Gavin Barraclough <barraclough@apple.com>
8575 Reviewed by Maciej Stachoviak.
8577 Ooops - moved code that had been accidentally added to op_new_func instead of
8578 op_new_func_exp, to where it shoulds be.
8580 * interpreter/Interpreter.cpp:
8581 (JSC::Interpreter::privateExecute):
8584 2009-08-12 Ada Chan <adachan@apple.com>
8586 Added workaround for the limitation that VirtualFree with MEM_RELEASE
8587 can only accept the base address returned by VirtualAlloc when the region
8588 was reserved and it can only free the entire region, and not a part of it.
8590 Reviewed by Oliver Hunt.
8592 * runtime/MarkStack.h:
8593 (JSC::MarkStack::MarkStackArray::shrinkAllocation):
8594 * runtime/MarkStackWin.cpp:
8595 (JSC::MarkStack::releaseStack):
8597 2009-08-12 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu>
8599 Reviewed by Ariya Hidayat.
8601 Build fix: use std::numeric_limits<long long>::min() instead of LLONG_MIN
8602 since LLONG_MIN is not defined in standard c++.
8604 * runtime/UString.cpp:
8605 (JSC::UString::from):
8607 2009-08-12 Benjamin Otte <otte@gnome.org>
8609 Reviewed by Jan Alonzo.
8611 Buildfix for Gtk platforms debug builds.
8613 * GNUmakefile.am: Choose MarkStackPosix.cpp or MarkStackWin.cpp
8614 depending on platform.
8616 2009-08-12 Simon Hausmann <simon.hausmann@nokia.com>
8618 Prospective build fix for Mac and 32-bit Windows.
8620 * runtime/UString.cpp: Include wtf/StringExtras.h for snprintf.
8621 (JSC::UString::from): Use %lld instead of %I64d for snprintf
8622 on non-windows platforms.
8624 2009-08-12 Prasanth Ullattil <prasanth.ullattil@nokia.com>
8626 Reviewed by Simon Hausmann.
8628 Fix compile error on 64Bit Windows, when UString::from
8629 is called with an intptr_t.
8631 Added new UString::From overload with long long parameter.
8633 Thanks to Holger for the long long idea.
8635 * runtime/UString.cpp:
8636 (JSC::UString::from):
8637 * runtime/UString.h:
8639 2009-08-11 Oliver Hunt <oliver@apple.com>
8641 Reviewed by Mark Rowe.
8645 * runtime/UString.h:
8646 (JSC::UString::Rep::createEmptyBuffer):
8648 (WTF::TryMallocReturnValue::getValue):
8650 2009-08-11 Oliver Hunt <oliver@apple.com>
8652 Reviewed by Gavin Barraclough.
8654 Make it harder to misuse try* allocation routines
8655 https://bugs.webkit.org/show_bug.cgi?id=27469
8657 Jump through a few hoops to make it much harder to accidentally
8658 miss null-checking of values returned by the try-* allocation
8661 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8662 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8663 * JavaScriptCore.xcodeproj/project.pbxproj:
8664 * runtime/JSArray.cpp:
8665 (JSC::JSArray::putSlowCase):
8666 (JSC::JSArray::increaseVectorLength):
8667 * runtime/StringPrototype.cpp:
8668 (JSC::stringProtoFuncFontsize):
8669 (JSC::stringProtoFuncLink):
8670 * runtime/UString.cpp:
8672 (JSC::reallocChars):
8673 (JSC::expandCapacity):
8674 (JSC::UString::Rep::reserveCapacity):
8675 (JSC::UString::expandPreCapacity):
8678 (JSC::UString::spliceSubstringsWithSeparators):
8679 (JSC::UString::replaceRange):
8680 (JSC::UString::append):
8681 (JSC::UString::operator=):
8682 * runtime/UString.h:
8683 (JSC::UString::Rep::createEmptyBuffer):
8684 * wtf/FastMalloc.cpp:
8685 (WTF::tryFastZeroedMalloc):
8686 (WTF::tryFastMalloc):
8687 (WTF::tryFastCalloc):
8688 (WTF::tryFastRealloc):
8689 (WTF::TCMallocStats::tryFastMalloc):
8690 (WTF::TCMallocStats::tryFastCalloc):
8691 (WTF::TCMallocStats::tryFastRealloc):
8693 (WTF::TryMallocReturnValue::TryMallocReturnValue):
8694 (WTF::TryMallocReturnValue::~TryMallocReturnValue):
8695 (WTF::TryMallocReturnValue::operator PossiblyNull<T>):
8696 (WTF::TryMallocReturnValue::getValue):
8698 * wtf/PossiblyNull.h: Added.
8699 (WTF::PossiblyNull::PossiblyNull):
8700 (WTF::PossiblyNull::~PossiblyNull):
8703 2009-08-11 Gavin Barraclough <barraclough@apple.com>
8705 Reviewed by NOBODY (build fix part deux).
8707 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8708 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8710 2009-08-11 Gavin Barraclough <barraclough@apple.com>
8712 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8713 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8715 2009-08-11 Gavin Barraclough <barraclough@apple.com>
8717 Reviewed by Oliver Hunt.
8719 Restrict use of FuncDeclNode & FuncExprNode to the parser.
8720 https://bugs.webkit.org/show_bug.cgi?id=28209
8722 These objects were also being referenced from the CodeBlock. By changing this
8723 to just retain pointers to FunctionBodyNodes these classes can be restricted to
8726 No performance impact (or sub-percent progression).
8728 * JavaScriptCore.exp:
8731 * bytecode/CodeBlock.cpp:
8732 (JSC::CodeBlock::mark):
8733 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
8734 (JSC::CodeBlock::shrinkToFit):
8735 * bytecode/CodeBlock.h:
8736 (JSC::CodeBlock::addFunction):
8737 (JSC::CodeBlock::function):
8738 Unify m_functions & m_functionExpressions into a single Vector<RefPtr<FuncExprNode> >.
8740 * bytecompiler/BytecodeGenerator.cpp:
8741 (JSC::BytecodeGenerator::BytecodeGenerator):
8742 (JSC::BytecodeGenerator::addConstant):
8743 (JSC::BytecodeGenerator::emitNewFunction):
8744 (JSC::BytecodeGenerator::emitNewFunctionExpression):
8745 * bytecompiler/BytecodeGenerator.h:
8746 FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes.
8748 * interpreter/Interpreter.cpp:
8749 (JSC::Interpreter::execute):
8750 (JSC::Interpreter::privateExecute):
8751 Update to reflect chnages in CodeBlock.
8753 * jit/JITOpcodes.cpp:
8754 (JSC::JIT::emit_op_new_func_exp):
8756 (JSC::DEFINE_STUB_FUNCTION):
8759 Update to reflect chnages in CodeBlock.
8762 FunctionStacks now contain FunctionBodyNodes not FuncDeclNodes.
8764 * parser/NodeConstructors.h:
8765 (JSC::FuncExprNode::FuncExprNode):
8766 (JSC::FuncDeclNode::FuncDeclNode):
8768 (JSC::ScopeNodeData::mark):
8769 (JSC::FunctionBodyNode::finishParsing):
8771 (JSC::FunctionBodyNode::ident):
8772 Move m_ident & make methods from FuncDeclNode & FuncExprNode to FunctionBodyNode.
8774 * runtime/JSFunction.h:
8775 (JSC::FunctionBodyNode::make):
8776 Make this method inline (was FuncDeclNode::makeFunction).
8778 2009-08-11 Oliver Hunt <oliver@apple.com>
8780 Reviewed by Gavin Barraclough.
8782 Native JSON.stringify does not omit functions
8783 https://bugs.webkit.org/show_bug.cgi?id=28117
8785 Objects that are callable should be treated as undefined when
8786 serialising to JSON.
8788 * runtime/JSONObject.cpp:
8789 (JSC::Stringifier::appendStringifiedValue):
8791 2009-08-11 Oliver Hunt <oliver@apple.com>
8793 Reviewed by Geoff Garen.
8795 REGRESSION: Hang/crash in BytecodeGenerator::constRegisterFor loading simple page
8796 https://bugs.webkit.org/show_bug.cgi?id=28169
8798 Handle the case where someone has attempted to shadow a property
8799 on the global object with a constant.
8801 * bytecompiler/BytecodeGenerator.cpp:
8802 (JSC::BytecodeGenerator::constRegisterFor):
8804 (JSC::ConstDeclNode::emitCodeSingle):
8806 2009-08-11 John Gregg <johnnyg@google.com>
8808 Reviewed by Maciej Stachowiak.
8810 Desktop Notifications API
8811 https://bugs.webkit.org/show_bug.cgi?id=25463
8813 Adds ENABLE_NOTIFICATION flag.
8815 * Configurations/FeatureDefines.xcconfig:
8818 2009-08-11 Maxime Simon <simon.maxime@gmail.com>
8820 Reviewed by Eric Seidel.
8822 Modifications on JavaScriptCore to allow Haiku port.
8823 https://bugs.webkit.org/show_bug.cgi?id=28121
8825 * runtime/Collector.cpp: Haiku doesn't have sys/mman.h, using OS.h instead.
8826 (JSC::currentThreadStackBase): Haiku uses its own threading system.
8827 * wtf/Platform.h: Defining all Haiku platform values.
8828 * wtf/haiku/MainThreadHaiku.cpp: Adding a missing header (NotImplemented.h).
8830 2009-08-11 Jessie Berlin <jberlin@apple.com>
8832 Reviewed by Adam Roben.
8836 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8838 2009-08-11 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
8840 Reviewed by Tor Arne Vestbø.
8842 Buildfix for Qt-win platforms.
8844 * JavaScriptCore.pri: Choose MarkStackPosix.cpp or MarkStackWin.cpp depend on platform.
8846 2009-08-10 Oliver Hunt <oliver@apple.com>
8848 Reviewed by NOBODY (And another build fix).
8850 Add new exports for MSVC
8852 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8853 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8854 * JavaScriptCore.xcodeproj/project.pbxproj:
8856 2009-08-10 Oliver Hunt <oliver@apple.com>
8858 Reviewed by NOBODY (yet another build fix).
8860 Remove obsolete entries from MSVC exports file
8862 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8863 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
8865 2009-08-10 Oliver Hunt <oliver@apple.com>
8867 Add includes needed for non-allinonefile builds
8869 * runtime/GetterSetter.h:
8870 * runtime/ScopeChain.h:
8872 2009-08-10 Oliver Hunt <oliver@apple.com>
8874 Fix export file for last build fix
8876 * JavaScriptCore.exp:
8878 2009-08-10 Oliver Hunt <oliver@apple.com>
8880 Hoist page size initialization into platform specific code.
8882 * jit/ExecutableAllocatorPosix.cpp:
8883 * jit/ExecutableAllocatorWin.cpp:
8884 * runtime/MarkStack.h:
8885 (JSC::MarkStack::pageSize):
8886 * runtime/MarkStackPosix.cpp:
8887 (JSC::MarkStack::initializePagesize):
8888 * runtime/MarkStackWin.cpp:
8889 (JSC::MarkStack::initializePagesize):
8891 2009-08-07 Oliver Hunt <oliver@apple.com>
8893 Reviewed by Gavin Barraclough.
8895 Stack overflow crash in JavaScript garbage collector mark pass
8896 https://bugs.webkit.org/show_bug.cgi?id=12216
8898 Make the GC mark phase iterative by using an explicit mark stack.
8899 To do this marking any single object is performed in multiple stages
8900 * The object is appended to the MarkStack, this sets the marked
8901 bit for the object using the new markDirect() function, and then
8903 * When the MarkStack is drain()ed the object is popped off the stack
8904 and markChildren(MarkStack&) is called on the object to collect
8905 all of its children. drain() then repeats until the stack is empty.
8907 Additionally I renamed a number of methods from 'mark' to 'markAggregate'
8908 in order to make it more clear that marking of those object was not
8909 going to result in an actual recursive mark.
8912 * JavaScriptCore.exp:
8913 * JavaScriptCore.gypi:
8914 * JavaScriptCore.pri:
8915 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8916 * JavaScriptCore.xcodeproj/project.pbxproj:
8917 * bytecode/CodeBlock.cpp:
8918 (JSC::CodeBlock::markAggregate):
8919 * bytecode/CodeBlock.h:
8920 * bytecode/EvalCodeCache.h:
8921 (JSC::EvalCodeCache::markAggregate):
8922 * debugger/DebuggerActivation.cpp:
8923 (JSC::DebuggerActivation::markChildren):
8924 * debugger/DebuggerActivation.h:
8925 * interpreter/Register.h:
8926 * interpreter/RegisterFile.h:
8927 (JSC::RegisterFile::markGlobals):
8928 (JSC::RegisterFile::markCallFrames):
8930 (JSC::ScopeNodeData::markAggregate):
8931 (JSC::EvalNode::markAggregate):
8932 (JSC::FunctionBodyNode::markAggregate):
8934 (JSC::ScopeNode::markAggregate):
8935 * runtime/ArgList.cpp:
8936 (JSC::MarkedArgumentBuffer::markLists):
8937 * runtime/ArgList.h:
8938 * runtime/Arguments.cpp:
8939 (JSC::Arguments::markChildren):
8940 * runtime/Arguments.h:
8941 * runtime/Collector.cpp:
8942 (JSC::Heap::markConservatively):
8943 (JSC::Heap::markCurrentThreadConservativelyInternal):
8944 (JSC::Heap::markCurrentThreadConservatively):
8945 (JSC::Heap::markOtherThreadConservatively):
8946 (JSC::Heap::markStackObjectsConservatively):
8947 (JSC::Heap::markProtectedObjects):
8948 (JSC::Heap::collect):
8949 * runtime/Collector.h:
8950 * runtime/GetterSetter.cpp:
8951 (JSC::GetterSetter::markChildren):
8952 * runtime/GetterSetter.h:
8953 (JSC::GetterSetter::GetterSetter):
8954 (JSC::GetterSetter::createStructure):
8955 * runtime/GlobalEvalFunction.cpp:
8956 (JSC::GlobalEvalFunction::markChildren):
8957 * runtime/GlobalEvalFunction.h:
8958 * runtime/JSActivation.cpp:
8959 (JSC::JSActivation::markChildren):
8960 * runtime/JSActivation.h:
8961 * runtime/JSArray.cpp:
8962 (JSC::JSArray::markChildren):
8963 * runtime/JSArray.h:
8965 (JSC::JSCell::markCellDirect):
8966 (JSC::JSCell::markChildren):
8967 (JSC::JSValue::markDirect):
8968 (JSC::JSValue::markChildren):
8969 (JSC::JSValue::hasChildren):
8970 (JSC::MarkStack::append):
8971 (JSC::MarkStack::drain):
8972 * runtime/JSFunction.cpp:
8973 (JSC::JSFunction::markChildren):
8974 * runtime/JSFunction.h:
8975 * runtime/JSGlobalData.cpp:
8976 (JSC::JSGlobalData::JSGlobalData):
8977 * runtime/JSGlobalData.h:
8978 * runtime/JSGlobalObject.cpp:
8979 (JSC::markIfNeeded):
8980 (JSC::JSGlobalObject::markChildren):
8981 * runtime/JSGlobalObject.h:
8982 * runtime/JSNotAnObject.cpp:
8983 (JSC::JSNotAnObject::markChildren):
8984 * runtime/JSNotAnObject.h:
8985 * runtime/JSONObject.cpp:
8986 (JSC::Stringifier::markAggregate):
8987 (JSC::JSONObject::markStringifiers):
8988 * runtime/JSONObject.h:
8989 * runtime/JSObject.cpp:
8990 (JSC::JSObject::markChildren):
8991 (JSC::JSObject::defineGetter):
8992 (JSC::JSObject::defineSetter):
8993 * runtime/JSObject.h:
8994 * runtime/JSPropertyNameIterator.cpp:
8995 (JSC::JSPropertyNameIterator::markChildren):
8996 * runtime/JSPropertyNameIterator.h:
8997 (JSC::JSPropertyNameIterator::createStructure):
8998 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
8999 (JSC::JSPropertyNameIterator::create):
9000 * runtime/JSStaticScopeObject.cpp:
9001 (JSC::JSStaticScopeObject::markChildren):
9002 * runtime/JSStaticScopeObject.h:
9005 * runtime/JSValue.h:
9006 * runtime/JSWrapperObject.cpp:
9007 (JSC::JSWrapperObject::markChildren):
9008 * runtime/JSWrapperObject.h:
9009 * runtime/MarkStack.cpp: Added.
9010 (JSC::MarkStack::compact):
9011 * runtime/MarkStack.h: Added.
9013 (JSC::MarkStack::MarkStack):
9014 (JSC::MarkStack::append):
9015 (JSC::MarkStack::appendValues):
9016 (JSC::MarkStack::~MarkStack):
9017 (JSC::MarkStack::MarkSet::MarkSet):
9018 (JSC::MarkStack::pageSize):
9020 MarkStackArray is a non-shrinking, mmap-based vector type
9021 used for storing objects to be marked.
9022 (JSC::MarkStack::MarkStackArray::MarkStackArray):
9023 (JSC::MarkStack::MarkStackArray::~MarkStackArray):
9024 (JSC::MarkStack::MarkStackArray::expand):
9025 (JSC::MarkStack::MarkStackArray::append):
9026 (JSC::MarkStack::MarkStackArray::removeLast):
9027 (JSC::MarkStack::MarkStackArray::isEmpty):
9028 (JSC::MarkStack::MarkStackArray::size):
9029 (JSC::MarkStack::MarkStackArray::shrinkAllocation):
9030 * runtime/MarkStackPosix.cpp: Added.
9031 (JSC::MarkStack::allocateStack):
9032 (JSC::MarkStack::releaseStack):
9033 * runtime/MarkStackWin.cpp: Added.
9034 (JSC::MarkStack::allocateStack):
9035 (JSC::MarkStack::releaseStack):
9037 * runtime/ScopeChain.h:
9038 * runtime/ScopeChainMark.h:
9039 (JSC::ScopeChain::markAggregate):
9040 * runtime/SmallStrings.cpp:
9041 (JSC::SmallStrings::mark):
9042 * runtime/Structure.h:
9043 (JSC::Structure::markAggregate):
9045 2009-08-10 Mark Rowe <mrowe@apple.com>
9047 Reviewed by Darin Adler.
9049 Fix hundreds of "pointer being freed was not allocated" errors seen on the build bot.
9051 * wtf/FastMalloc.h: Implement nothrow variants of the delete and delete[] operators since
9052 we implement the nothrow variants of new and new[]. The nothrow variant of delete is called
9053 explicitly in the implementation of std::sort which was resulting in FastMalloc-allocated
9054 memory being passed to the system allocator to free.
9056 2009-08-10 Jan Michael Alonzo <jmalonzo@webkit.org>
9058 [Gtk] Unreviewed build fix. Move JSAPIValueWrapper.cpp/.h in the debug
9059 section. This file is already part of AllInOneFile in Release builds.
9063 2009-08-10 Darin Adler <darin@apple.com>
9065 * wtf/FastMalloc.h: Fix build.
9067 2009-08-10 Darin Adler <darin@apple.com>
9069 Reviewed by Mark Rowe.
9071 FastMalloc.h has cross-platform code but marked as WinCE-only
9072 https://bugs.webkit.org/show_bug.cgi?id=28160
9074 1) The support for nothrow was inside #if PLATFORM(WINCE) even though it is
9075 not platform-specific.
9076 2) The code tried to override operator delete nothrow, which does not exist.
9077 3) The code in the header checks the value of USE_SYSTEM_MALLOC, but the code
9078 in FastMalloc.cpp checks only if the macro is defined.
9080 * wtf/FastMalloc.h: See above.
9081 * wtf/FastMalloc.cpp: Ditto.
9083 2009-08-10 Sam Weinig <sam@webkit.org>
9085 Reviewed by Anders Carlsson.
9087 Fix an annoying indentation issue.
9089 * runtime/DateConstructor.cpp:
9090 (JSC::constructDate):
9092 2009-08-10 Xan Lopez <xlopez@igalia.com>
9094 Unreviewed build fix.
9096 Add new files to makefile.
9100 2009-08-10 Simon Hausmann <simon.hausmann@nokia.com>
9102 Fix compilation with the interpreter instead of the JIT by including
9103 PrototypeFunction.h as forward-declared through NativeFunctionWrapper.h.
9105 * runtime/ObjectConstructor.cpp:
9107 2009-08-09 Oliver Hunt <oliver@apple.com>
9109 Reviewed by George Staikos.
9111 JSON.stringify replacer returning undefined does not omit object properties
9112 https://bugs.webkit.org/show_bug.cgi?id=28118
9114 Correct behaviour of stringify when using a replacer function that returns
9115 undefined. This is a simple change to move the undefined value check to
9116 after the replacer function is called. This means that the replacer function
9117 is now called for properties with the value undefined, however i've confirmed
9118 that this behaviour is correct.
9120 In addition I've made the cyclic object exception have a more useful error
9123 * runtime/JSONObject.cpp:
9124 (JSC::Stringifier::appendStringifiedValue):
9126 2009-08-08 Oliver Hunt <oliver@apple.com>
9128 Reviewed by Eric Seidel and Sam Weinig.
9130 [ES5] Implement Object.getPrototypeOf
9131 https://bugs.webkit.org/show_bug.cgi?id=28114
9133 Implement getPrototypeOf
9135 * runtime/CommonIdentifiers.h:
9136 * runtime/JSGlobalObject.cpp:
9137 (JSC::JSGlobalObject::reset):
9138 * runtime/ObjectConstructor.cpp:
9139 (JSC::ObjectConstructor::ObjectConstructor):
9140 (JSC::objectConsGetPrototypeOf):
9141 * runtime/ObjectConstructor.h:
9143 2009-08-07 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
9145 Reviewed by Eric Seidel.
9147 Allow custom memory allocation control for Noncopyable class
9148 https://bugs.webkit.org/show_bug.cgi?id=27879
9150 Several classes which are inherited from Noncopyable are instantiated by
9151 operator new, so Noncopyable class has been inherited from FastAllocBase.
9153 * wtf/Noncopyable.h:
9155 2009-08-07 George Staikos <george.staikos@torchmobile.com>
9157 Reviewed by Eric Seidel.
9159 https://bugs.webkit.org/show_bug.cgi?id=27305
9160 Implement WinCE-specific unicode layer.
9161 Written by George Staikos <george.staikos@torchmobile.com>
9162 with bug fixes by Yong Li <yong.li@torchmobile.com>
9163 refactored by Joe Mason <joe.mason@torchmobile.com>
9166 * wtf/unicode/Unicode.h:
9167 * wtf/unicode/wince/UnicodeWince.cpp: Added.
9168 (WTF::Unicode::toLower):
9169 (WTF::Unicode::toUpper):
9170 (WTF::Unicode::foldCase):
9171 (WTF::Unicode::isPrintableChar):
9172 (WTF::Unicode::isSpace):
9173 (WTF::Unicode::isLetter):
9174 (WTF::Unicode::isUpper):
9175 (WTF::Unicode::isLower):
9176 (WTF::Unicode::isDigit):
9177 (WTF::Unicode::isPunct):
9178 (WTF::Unicode::toTitleCase):
9179 (WTF::Unicode::direction):
9180 (WTF::Unicode::category):
9181 (WTF::Unicode::decompositionType):
9182 (WTF::Unicode::combiningClass):
9183 (WTF::Unicode::mirroredChar):
9184 (WTF::Unicode::digitValue):
9185 * wtf/unicode/wince/UnicodeWince.h: Added.
9187 (WTF::Unicode::isSeparatorSpace):
9188 (WTF::Unicode::isHighSurrogate):
9189 (WTF::Unicode::isLowSurrogate):
9190 (WTF::Unicode::isArabicChar):
9191 (WTF::Unicode::hasLineBreakingPropertyComplexContext):
9192 (WTF::Unicode::umemcasecmp):
9193 (WTF::Unicode::surrogateToUcs4):
9195 2009-08-07 Yongjun Zhang <yongjun.zhang@nokia.com>
9197 Reviewed by Eric Seidel.
9199 https://bugs.webkit.org/show_bug.cgi?id=28069
9201 Add inline to help winscw compiler resolve specialized argument in
9202 templated functions.
9204 * runtime/LiteralParser.cpp:
9205 (JSC::LiteralParser::Lexer::lexString):
9207 2009-08-07 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
9209 Reviewed by Eric Seidel.
9211 Allow custom memory allocation control for RegExpObjectData struct
9212 http://bugs.webkit.org/show_bug.cgi?id=26750
9214 Inherits RegExpObjectData struct from FastAllocBase because
9215 it has been instantiated by 'new' in JavaScriptCore/runtime/RegExpObject.cpp:62
9217 * runtime/RegExpObject.h:
9219 2009-08-06 Norbert Leser <norbert.leser@nokia.com>
9221 Reviewed by Darin Adler.
9223 Updated patch for bug #27059:
9224 Symbian platform always uses little endian encoding,
9225 regardless of compiler.
9226 We need to make sure that we correctly detect EABI architecture
9227 for armv5 targets on Symbian,
9228 where __EABI__ is set but not __ARM_EABI__
9232 2009-08-06 Adam Barth <abarth@webkit.org>
9236 http://bugs.webkit.org/show_bug.cgi?id=27879
9238 Revert 46877 because it broke GTK.
9240 * wtf/Noncopyable.h:
9242 2009-08-06 Gavin Barraclough <barraclough@apple.com>
9244 Reviewed by Oliver Hunt.
9246 Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification.
9247 ( https://bugs.webkit.org/show_bug.cgi?id=27635 )
9249 This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%.
9250 (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled).
9252 * bytecode/CodeBlock.cpp:
9253 (JSC::printStructureStubInfo):
9254 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
9256 * bytecode/CodeBlock.h:
9258 (JSC::CallLinkInfo::seenOnce):
9259 (JSC::CallLinkInfo::setSeen):
9260 (JSC::MethodCallLinkInfo::seenOnce):
9261 (JSC::MethodCallLinkInfo::setSeen):
9262 - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once.
9264 * bytecode/StructureStubInfo.cpp:
9265 (JSC::StructureStubInfo::deref):
9266 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
9268 * bytecode/StructureStubInfo.h:
9269 (JSC::StructureStubInfo::StructureStubInfo):
9270 (JSC::StructureStubInfo::initGetByIdSelf):
9271 (JSC::StructureStubInfo::initGetByIdProto):
9272 (JSC::StructureStubInfo::initGetByIdChain):
9273 (JSC::StructureStubInfo::initGetByIdSelfList):
9274 (JSC::StructureStubInfo::initGetByIdProtoList):
9275 (JSC::StructureStubInfo::initPutByIdTransition):
9276 (JSC::StructureStubInfo::initPutByIdReplace):
9277 (JSC::StructureStubInfo::seenOnce):
9278 (JSC::StructureStubInfo::setSeen):
9279 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once.
9281 * bytecompiler/BytecodeGenerator.cpp:
9282 (JSC::BytecodeGenerator::emitGetById):
9283 (JSC::BytecodeGenerator::emitPutById):
9284 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
9287 (JSC::JIT::privateCompileCTIMachineTrampolines):
9288 (JSC::JIT::unlinkCall):
9289 - Remove the "don't lazy link" stage of calls.
9292 (JSC::JIT::compileCTIMachineTrampolines):
9293 - Remove the "don't lazy link" stage of calls.
9296 (JSC::JIT::compileOpCallSlowCase):
9297 - Remove the "don't lazy link" stage of calls.
9300 (JSC::JITThunks::JITThunks):
9301 (JSC::JITThunks::tryCachePutByID):
9302 (JSC::JITThunks::tryCacheGetByID):
9303 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
9304 (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
9305 - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
9308 (JSC::JITThunks::ctiStringLengthTrampoline):
9310 - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
9312 * wtf/PtrAndFlags.h:
9313 (WTF::PtrAndFlags::PtrAndFlags):
9314 (WTF::PtrAndFlags::operator!):
9315 (WTF::PtrAndFlags::operator->):
9316 - Add ! and -> operators, add constuctor with pointer argument.
9318 2009-08-06 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
9320 Reviewed by Adam Barth.
9322 Allow custom memory allocation control for Noncopyable class
9323 https://bugs.webkit.org/show_bug.cgi?id=27879
9325 Several classes which inherited from Noncopyable are instantiated by
9326 operator new, so Noncopyable class has been inherited from FastAllocBase.
9328 * wtf/Noncopyable.h:
9330 2009-08-06 Mark Rowe <mrowe@apple.com>
9332 Rubber-stamped by Sam Weinig.
9334 Add explicit dependencies for our build verification scripts to ensure that they always run after linking has completed.
9336 * JavaScriptCore.xcodeproj/project.pbxproj:
9338 2009-08-06 Mark Rowe <mrowe@apple.com>
9340 Bring a little order to our otherwise out of control lives.
9342 * JavaScriptCore.xcodeproj/project.pbxproj:
9344 2009-08-06 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
9346 Reviewed by Darin Adler.
9348 Allow custom memory allocation control for JavaScriptCore's PolymorphicAccessStructureList struct
9349 https://bugs.webkit.org/show_bug.cgi?id=27877
9351 Inherits PolymorphicAccessStructureList struct from FastAllocBase because it has been instantiated by
9352 'new' in JavaScriptCore/jit/JITStubs.cpp:1229.
9354 * bytecode/Instruction.h:
9356 2009-08-05 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
9358 Reviewed by Darin Adler.
9360 Allow custom memory allocation control for JavaScriptCore's ScopeNodeData struct
9361 https://bugs.webkit.org/show_bug.cgi?id=27875
9363 Inherits ScopeNodeData struct from FastAllocBase because it has been instantiated by
9364 'new' in JavaScriptCore/parser/Nodes.cpp:1848.
9368 2009-08-05 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
9370 Reviewed by Gavin Barraclough.
9372 Add floating point support for generic ARM port.
9373 https://bugs.webkit.org/show_bug.cgi?id=24986
9375 * assembler/ARMAssembler.cpp:
9376 (JSC::ARMAssembler::doubleTransfer):
9377 * assembler/ARMAssembler.h:
9379 (JSC::ARMAssembler::):
9380 (JSC::ARMAssembler::faddd_r):
9381 (JSC::ARMAssembler::fsubd_r):
9382 (JSC::ARMAssembler::fmuld_r):
9383 (JSC::ARMAssembler::fcmpd_r):
9384 (JSC::ARMAssembler::fdtr_u):
9385 (JSC::ARMAssembler::fdtr_d):
9386 (JSC::ARMAssembler::fmsr_r):
9387 (JSC::ARMAssembler::fsitod_r):
9388 (JSC::ARMAssembler::fmstat):
9389 * assembler/MacroAssemblerARM.h:
9390 (JSC::MacroAssemblerARM::):
9391 (JSC::MacroAssemblerARM::supportsFloatingPoint):
9392 (JSC::MacroAssemblerARM::loadDouble):
9393 (JSC::MacroAssemblerARM::storeDouble):
9394 (JSC::MacroAssemblerARM::addDouble):
9395 (JSC::MacroAssemblerARM::subDouble):
9396 (JSC::MacroAssemblerARM::mulDouble):
9397 (JSC::MacroAssemblerARM::convertInt32ToDouble):
9398 (JSC::MacroAssemblerARM::branchDouble):
9401 2009-08-05 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
9403 Reviewed by Gavin Barraclough.
9405 Add JIT support for generic ARM port without optimizations.
9406 https://bugs.webkit.org/show_bug.cgi?id=24986
9408 All JIT optimizations are disabled.
9410 Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
9411 Signed off by Gabor Loki <loki@inf.u-szeged.hu>
9413 * assembler/ARMAssembler.cpp:
9414 (JSC::ARMAssembler::baseIndexTransfer32):
9415 * assembler/AbstractMacroAssembler.h:
9416 (JSC::AbstractMacroAssembler::Imm32::Imm32):
9417 * assembler/MacroAssemblerARM.h:
9418 (JSC::MacroAssemblerARM::store32):
9419 (JSC::MacroAssemblerARM::move):
9420 (JSC::MacroAssemblerARM::branch32):
9421 (JSC::MacroAssemblerARM::add32):
9422 (JSC::MacroAssemblerARM::sub32):
9423 (JSC::MacroAssemblerARM::load32):
9424 * bytecode/CodeBlock.h:
9425 (JSC::CodeBlock::getBytecodeIndex):
9427 * jit/JITInlineMethods.h:
9428 (JSC::JIT::restoreArgumentReference):
9429 * jit/JITOpcodes.cpp:
9432 (JSC::JITStackFrame::returnAddressSlot):
9435 2009-08-04 Gavin Barraclough <barraclough@apple.com>
9437 Rubber Stamped by Oiver Hunt.
9439 Revert r46643 since this breaks the Yarr::Interpreter running the v8 tests.
9440 https://bugs.webkit.org/show_bug.cgi?id=27874
9442 * yarr/RegexInterpreter.cpp:
9443 (JSC::Yarr::Interpreter::allocDisjunctionContext):
9444 (JSC::Yarr::Interpreter::freeDisjunctionContext):
9445 (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
9446 (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
9448 2009-08-04 Oliver Hunt <oliver@apple.com>
9454 2009-08-04 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
9456 Reviewed by Adam Treat
9458 Explicitly include limits.h header when using INT_MAX and INT_MIN
9460 * interpreter/Interpreter.cpp
9462 2009-08-03 Harald Fernengel <harald.fernengel@nokia.com>
9464 Reviewed by Darin Adler.
9466 Fix compile error for ambigous call to abs()
9467 https://bugs.webkit.org/show_bug.cgi?id=27873
9469 Fix ambiguity in abs(long int) call by calling labs() instead
9471 * wtf/DateMath.cpp: replace call to abs() with labs()
9473 2009-08-03 Laszlo Gombos <laszlo.1.gombos@nokia.com>
9475 Reviewed by Eric Seidel.
9477 [Qt] Consolidate common gcc flags to WebKit.pri
9478 https://bugs.webkit.org/show_bug.cgi?id=27934
9480 * JavaScriptCore.pro:
9482 2009-08-03 Ada Chan <adachan@apple.com>
9484 Fixed the Tiger build.
9486 * wtf/FastMalloc.cpp:
9488 2009-08-03 Ada Chan <adachan@apple.com>
9490 Reviewed by Darin Adler.
9492 Don't use background thread to scavenge memory on Tiger until we figure out why it causes a crash.
9493 https://bugs.webkit.org/show_bug.cgi?id=27900
9495 * wtf/FastMalloc.cpp:
9497 2009-08-03 Fumitoshi Ukai <ukai@chromium.org>
9499 Reviewed by Jan Alonzo.
9501 Fix build break on Gtk/x86_64.
9502 https://bugs.webkit.org/show_bug.cgi?id=27936
9504 Use JSVALUE64 for X86_64 LINUX, except Qt.
9508 2009-08-02 Xan Lopez <xlopez@igalia.com>
9514 2009-08-02 Geoffrey Garen <ggaren@apple.com>
9516 Reviewed by Sam Weinig.
9518 Disabled JSVALUE32_64 on Qt builds, since all layout tests mysteriously
9519 crash with it enabled.
9523 2009-08-02 Geoffrey Garen <ggaren@apple.com>
9527 Added JSAPIValueWrapper.cpp to the build.
9529 * JavaScriptCore.pri:
9531 2009-08-02 Geoffrey Garen <ggaren@apple.com>
9535 Exported symbols for JSAPIValueWrapper.
9537 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9538 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
9540 2009-08-02 Geoffrey Garen <ggaren@apple.com>
9544 * jit/JITStubs.cpp: #include <stdarg.h>, for a definition of va_start.
9546 2009-08-02 Geoffrey Garen <ggaren@apple.com>
9550 * runtime/Collector.cpp: #include <limits.h>, for a definition of ULONG_MAX.
9552 2009-08-02 Geoffrey Garen <ggaren@apple.com>
9554 Windows build fix: Nixed JSImmediate::prototype, JSImmediate::toObject,
9555 and JSImmediate::toThisObject, and removed their exported symbols.
9557 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9558 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
9559 * runtime/JSImmediate.cpp:
9560 * runtime/JSImmediate.h:
9562 2009-08-02 Geoffrey Garen <ggaren@apple.com>
9564 Reviewed by Mark Rowe.
9566 Enabled JSVALUE32_64 by default on all platforms other than x86_64 (which uses JSVALUE64).
9570 2009-08-02 Kevin Ollivier <kevino@theolliviers.com>
9572 Reviewed by Jan Alonzo.
9574 Script for building the JavaScriptCore library for wx.
9575 https://bugs.webkit.org/show_bug.cgi?id=27619
9579 2009-08-02 Yong Li <yong.li@torchmobile.com>
9581 Reviewed by George Staikos.
9583 DateMath depends on strftime and localtime, which need to be imported manually on WinCE
9584 https://bugs.webkit.org/show_bug.cgi?id=26558
9588 2009-08-01 David Kilzer <ddkilzer@apple.com>
9590 wtf/Threading.h: added include of Platform.h
9592 Reviewed by Mark Rowe.
9594 * wtf/Threading.h: Added #include "Platform.h" since this header
9595 uses PLATFORM() and other macros.
9597 2009-08-01 Mark Rowe <mrowe@apple.com>
9599 Rubber-stamped by Oliver Hunt.
9601 Roll out r46668 as it was misinformed. ScopeChain is only used with placement new.
9603 * runtime/ScopeChain.h:
9605 2009-08-01 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
9607 Allow custom memory allocation control for JavaScriptCore's HashMap class
9608 http://bugs.webkit.org/show_bug.cgi?id=27871
9610 Inherits HashMap class from FastAllocBase because it has been
9611 instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:148.
9613 * wtf/RefPtrHashMap.h:
9616 2009-08-01 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
9618 Allow custom memory allocation control for JavaScriptCore's ScopeChain class
9619 https://bugs.webkit.org/show_bug.cgi?id=27834
9621 Inherits ScopeChain class from FastAllocBase because it has been
9622 instantiated by 'new' in JavaScriptCore/runtime/JSFunction.h:109.
9624 * runtime/ScopeChain.h:
9626 2009-08-01 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
9628 Reviewed by Darin Adler.
9630 Allow custom memory allocation control for JavaScriptCore's RegExpConstructorPrivate struct
9631 https://bugs.webkit.org/show_bug.cgi?id=27833
9633 Inherits RegExpConstructorPrivate class from FastAllocBase because it has been
9634 instantiated by 'new' in JavaScriptCore/runtime/RegExpConstructor.cpp:152.
9636 * runtime/RegExpConstructor.cpp:
9638 2009-07-31 Yong Li <yong.li@torchmobile.com>
9640 Reviewed by George Staikos.
9642 Resurrect the old GetTickCount implementation of currentTime, controlled by WTF_USE_QUERY_PERFORMANCE_COUNTER
9643 currentSystemTime taken from older WebKit; currentTime written by Yong Li <yong.li@torchmobile.com>; cleanup by Joe Mason <joe.mason@torchmobile.com>
9644 https://bugs.webkit.org/show_bug.cgi?id=27848
9646 * wtf/CurrentTime.cpp:
9647 (WTF::currentSystemTime): get current time with GetCurrentFT
9648 (WTF::currentTime): track msec elapsed since first currentSystemTime call using GetTickCount
9651 2009-07-31 Ada Chan <adachan@apple.com>
9653 Fixes the Windows release-PGO build.
9655 Reviewed by Jon Honeycutt.
9657 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Suppresses the warning about unreachable code that we get by adding "return 0" to WTF::TCMalloc_PageHeap::runScavengerThread().
9658 * wtf/FastMalloc.cpp:
9659 (WTF::TCMalloc_PageHeap::runScavengerThread): Fixes the error about the method not returning a value in the release-PGO build.
9661 2009-07-31 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
9663 Change malloc to fastMalloc and free to fastFree in Yarr's RegexInterpreter.cpp
9664 https://bugs.webkit.org/show_bug.cgi?id=27874
9666 Use fastMalloc and fastFree instead of malloc and free in RegexInterpreter.cpp's methods.
9668 * yarr/RegexInterpreter.cpp:
9669 (JSC::Yarr::Interpreter::allocDisjunctionContext):
9670 (JSC::Yarr::Interpreter::freeDisjunctionContext):
9671 (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
9672 (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
9674 2009-07-30 Xan Lopez <xlopez@igalia.com>
9676 Reviewed by Jan Alonzo.
9678 Fix compiler warning.
9680 GCC does not like C++-style comments in preprocessor directives.
9684 2009-07-30 John McCall <rjmccall@apple.com>
9686 Reviewed by Gavin Barraclough.
9688 Optimize the X86_64 trampolines: avoid the need for filler arguments
9689 and move the stub-args area closer to the stack pointer.
9691 * jit/JIT.h: adjust patch offsets because of slight code-size change
9693 (JSC::JITCode::execute): don't pass filler args
9695 (ctiTrampoline): (X86_64): push args onto stack, use args directly
9696 (ctiVMThrowTrampoline): (X86_64): adjust %rsp by correct displacement
9697 (ctiOpThrowNotCaught): (X86_64): adjust %rsp by correct displacement
9699 (JITStackFrame): (X86_64): move args area earlier
9700 (ctiTrampoline): remove filler args from prototype
9702 2009-07-30 Gavin Barraclough <barraclough@apple.com>
9704 Temporarily revert r46618 since this is b0rking on Linux.
9706 2009-07-23 Gavin Barraclough <barraclough@apple.com>
9708 Reviewed by Oliver Hunt.
9710 Make get_by_id/put_by_id/method_check/call defer optimization using a data flag rather than a code modification.
9711 ( https://bugs.webkit.org/show_bug.cgi?id=27635 )
9713 This improves performance of ENABLE(ASSEMBLER_WX_EXCLUSIVE) builds by 2-2.5%, reducing the overhead to about 2.5%.
9714 (No performance impact with ASSEMBLER_WX_EXCLUSIVE disabled).
9716 * bytecode/CodeBlock.cpp:
9717 (JSC::printStructureStubInfo):
9718 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
9720 * bytecode/CodeBlock.h:
9722 (JSC::CallLinkInfo::seenOnce):
9723 (JSC::CallLinkInfo::setSeen):
9724 (JSC::MethodCallLinkInfo::seenOnce):
9725 (JSC::MethodCallLinkInfo::setSeen):
9726 - Change a pointer in CallLinkInfo/MethodCallLinkInfo to use a PtrAndFlags, use a flag to track when an op has been executed once.
9728 * bytecode/StructureStubInfo.cpp:
9729 (JSC::StructureStubInfo::deref):
9730 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
9732 * bytecode/StructureStubInfo.h:
9733 (JSC::StructureStubInfo::StructureStubInfo):
9734 (JSC::StructureStubInfo::initGetByIdSelf):
9735 (JSC::StructureStubInfo::initGetByIdProto):
9736 (JSC::StructureStubInfo::initGetByIdChain):
9737 (JSC::StructureStubInfo::initGetByIdSelfList):
9738 (JSC::StructureStubInfo::initGetByIdProtoList):
9739 (JSC::StructureStubInfo::initPutByIdTransition):
9740 (JSC::StructureStubInfo::initPutByIdReplace):
9741 (JSC::StructureStubInfo::seenOnce):
9742 (JSC::StructureStubInfo::setSeen):
9743 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID, add a flag to track when an op has been executed once.
9745 * bytecompiler/BytecodeGenerator.cpp:
9746 (JSC::BytecodeGenerator::emitGetById):
9747 (JSC::BytecodeGenerator::emitPutById):
9748 - Make StructureStubInfo store the type as an integer, rather than an OpcodeID.
9751 (JSC::JIT::privateCompileCTIMachineTrampolines):
9752 (JSC::JIT::unlinkCall):
9753 - Remove the "don't lazy link" stage of calls.
9756 (JSC::JIT::compileCTIMachineTrampolines):
9757 - Remove the "don't lazy link" stage of calls.
9760 (JSC::JIT::compileOpCallSlowCase):
9761 - Remove the "don't lazy link" stage of calls.
9764 (JSC::JITThunks::JITThunks):
9765 (JSC::JITThunks::tryCachePutByID):
9766 (JSC::JITThunks::tryCacheGetByID):
9767 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
9768 (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
9769 - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
9772 (JSC::JITThunks::ctiStringLengthTrampoline):
9774 - Remove the "don't lazy link" stage of calls, and the "_second" stage of get_by_id/put_by_id/method_check.
9776 * wtf/PtrAndFlags.h:
9777 (WTF::PtrAndFlags::PtrAndFlags):
9778 (WTF::PtrAndFlags::operator!):
9779 (WTF::PtrAndFlags::operator->):
9780 - Add ! and -> operators, add constuctor with pointer argument.
9782 2009-07-30 Geoffrey Garen <ggaren@apple.com>
9784 Reviewed by Gavin Barraclough.
9786 Fixed failing tests seen on Windows buildbot.
9789 (JSC::DEFINE_STUB_FUNCTION):
9791 (JSC::): Use "int" instead of "bool" to guarantee a 32-bit result,
9792 regardless of compiler. gcc on mac uses 32-bit values for bool,
9793 but gcc on linux and MSVC on Windows use 8-bit values.
9795 2009-07-30 Geoffrey Garen <ggaren@apple.com>
9797 Windows build fix: added missing symbols on Windows.
9799 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9800 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
9802 2009-07-30 Geoffrey Garen <ggaren@apple.com>
9804 Windows build fix: removed stale symbols on Windows.
9806 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9807 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
9809 === End merge of nitro-extreme branch 2009-07-30 ===
9811 2009-07-20 Geoffrey Garen <ggaren@apple.com>
9813 Fixed a post-review typo in r46066 that caused tons of test failures.
9815 SunSpider reports no change.
9817 * runtime/JSArray.cpp:
9818 (JSC::JSArray::JSArray): Initialize the full vector capacity, to avoid
9819 uninitialized members at the end.
9821 2009-07-20 Geoffrey Garen <ggaren@apple.com>
9823 Windows WebKit build fix: Added some missing exports.
9825 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9826 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
9828 2009-07-17 Geoffrey Garen <ggaren@apple.com>
9830 Reviewed by Sam Weinig.
9832 Get the branch working on windows.
9833 https://bugs.webkit.org/show_bug.cgi?id=27391
9835 SunSpider says 0.3% faster.
9837 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
9838 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Updated
9839 MSVC export lists to fix linker errors.
9841 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added / removed
9842 new / old project files.
9845 (JSC::JIT::privateCompileCTIMachineTrampolines): Used #pragma pack to tell
9846 MSVC that these structures represent actual memory layout, and should not be
9847 automatically aligned. Changed the return value load to load a 64bit quantity
9848 into the canonical registers.
9850 * jit/JIT.h: Moved OBJECT_OFFSETOF definition to StdLibExtras.h because
9851 it's needed by more than just the JIT, and it supplements a standard library
9855 (JSC::JIT::compileOpCallInitializeCallFrame): Fixed an incorrectly signed
9856 cast to resolve an MSVC warning.
9858 * jit/JITStubs.h: Used #pragma pack to tell MSVC that these structures
9859 represent actual memory layout, and should not be automatically aligned.
9861 * runtime/JSArray.cpp:
9862 (JSC::JSArray::JSArray): Replaced memset_pattern8 with a for loop, since
9863 memset_pattern8 is not portable. (I verified that this version of the loop
9864 gives the best performance / generated code in GCC.)
9866 * runtime/JSObject.h:
9867 (JSC::JSObject::JSObject): Removed accidental usage of FIELD_OFFSET --
9868 OBJECT_OFFSETOF is our new macro name. (FIELD_OFFSET conflicts with a
9869 definition in winnt.h.)
9871 * runtime/JSValue.cpp: Added some headers needed by non-all-in-one builds.
9873 * runtime/JSValue.h:
9874 (JSC::JSValue::): Made the tag signed, to match MSVC's signed enum values.
9875 (GCC doesn't seem to care one way or the other.)
9877 * wtf/MainThread.cpp: Moved the StdLibExtras.h #include -- I did this a
9878 while ago to resolve a conflict with winnt.h. I can't remember if it's truly
9879 still needed, but what the heck.
9881 * wtf/StdLibExtras.h: Moved OBJECT_OFFSETOF definition here.
9883 2009-07-06 Geoffrey Garen <ggaren@apple.com>
9885 Reviewed by Sam Weinig (?).
9887 Fixed an assertion seen during the stress test.
9889 Don't assume that, if op1 is constant, op2 is not, and vice versa. Sadly,
9890 not all constants get folded.
9892 * jit/JITArithmetic.cpp:
9893 (JSC::JIT::emit_op_jnless):
9894 (JSC::JIT::emitSlow_op_jnless):
9895 (JSC::JIT::emit_op_jnlesseq):
9896 (JSC::JIT::emitSlow_op_jnlesseq):
9898 2009-07-06 Geoffrey Garen <ggaren@apple.com>
9900 Reviewed by Sam Weinig.
9902 Include op_convert_this in result caching.
9904 No change on SunSpider or v8.
9906 * jit/JITOpcodes.cpp:
9907 (JSC::JIT::emit_op_convert_this):
9910 (JSC::DEFINE_STUB_FUNCTION):
9912 (JSC::): Made the op_convert_this JIT stub return an EncodedJSValue, so
9913 to maintain the result caching contract that { tag, payload } can be
9914 found in { regT1, regT0 }.
9916 2009-07-06 Geoffrey Garen <ggaren@apple.com>
9918 Reviewed by Sam Weinig.
9920 Implemented result chaining.
9922 1% faster on SunSpider. 4%-5% faster on v8.
9924 * assembler/MacroAssemblerX86Common.h:
9925 (JSC::MacroAssemblerX86Common::move):
9926 * assembler/X86Assembler.h:
9927 (JSC::X86Assembler::movl_rr): Added an optimization to eliminate
9928 no-op mov instructions, to simplify chaining.
9932 * jit/JIT.h: Added data members and helper functions for recording
9933 chained results. We record both a mapping from virtual to machine register
9934 and the opcode for which the mapping is valid, to help ensure that the
9935 mapping isn't used after the mapped register has been stomped by other
9939 (JSC::JIT::compileOpCallVarargs):
9940 (JSC::JIT::compileOpCallVarargsSlowCase):
9941 (JSC::JIT::emit_op_ret):
9942 (JSC::JIT::emit_op_construct_verify):
9943 (JSC::JIT::compileOpCall):
9944 (JSC::JIT::compileOpCallSlowCase): Chain function call results.
9946 * jit/JITInlineMethods.h:
9947 (JSC::JIT::emitLoadTag):
9948 (JSC::JIT::emitLoadPayload):
9949 (JSC::JIT::emitLoad):
9950 (JSC::JIT::emitLoad2):
9951 (JSC::JIT::isLabeled):
9954 (JSC::JIT::isMapped):
9955 (JSC::JIT::getMappedPayload):
9956 (JSC::JIT::getMappedTag): Use helper functions when loading virtual
9957 registers into machine registers, in case the loads can be eliminated
9960 * jit/JITOpcodes.cpp:
9961 (JSC::JIT::emit_op_mov):
9962 (JSC::JIT::emit_op_end):
9963 (JSC::JIT::emit_op_instanceof):
9964 (JSC::JIT::emit_op_get_global_var):
9965 (JSC::JIT::emit_op_put_global_var):
9966 (JSC::JIT::emit_op_get_scoped_var):
9967 (JSC::JIT::emit_op_put_scoped_var):
9968 (JSC::JIT::emit_op_to_primitive):
9969 (JSC::JIT::emit_op_resolve_global):
9970 (JSC::JIT::emit_op_jneq_ptr):
9971 (JSC::JIT::emit_op_next_pname):
9972 (JSC::JIT::emit_op_to_jsnumber):
9973 (JSC::JIT::emit_op_catch): Chain results from these opcodes.
9975 (JSC::JIT::emit_op_profile_will_call):
9976 (JSC::JIT::emit_op_profile_did_call): Load the profiler into regT2 to
9977 avoid stomping a chained result.
9979 * jit/JITPropertyAccess.cpp:
9980 (JSC::JIT::emit_op_method_check):
9981 (JSC::JIT::emit_op_get_by_val):
9982 (JSC::JIT::emit_op_get_by_id): Chain results from these opcodes.
9984 * jit/JITStubCall.h:
9985 (JSC::JITStubCall::addArgument): Always use { regT1, regT0 }, to facilitate
9988 (JSC::JITStubCall::call): Unmap all mapped registers, since our callee
9989 stub might stomp them.
9991 2009-07-01 Sam Weinig <sam@webkit.org>
9993 Reviewed by Gavin Barraclough.
9995 Don't reload values in emitBinaryDoubleOp.
9997 SunSpider reports a 0.6% progression.
10000 * jit/JITArithmetic.cpp:
10001 (JSC::JIT::emit_op_jnless):
10002 (JSC::JIT::emit_op_jnlesseq):
10003 (JSC::JIT::emitBinaryDoubleOp):
10005 2009-07-01 Sam Weinig <sam@webkit.org>
10007 Reviewed by Geoffrey Garen.
10009 Convert op_div to load op1 and op2 up front.
10011 * jit/JITArithmetic.cpp:
10012 (JSC::JIT::emit_op_div):
10014 2009-07-01 Sam Weinig <sam@webkit.org>
10016 Reviewed by Geoffrey Garen.
10018 Don't emit code in emitBinaryDoubleOp if code is unreachable, observable
10019 via an empty (unlinked) jumplist passed in. This only effects op_jnless
10020 and op_jnlesseq at present.
10022 * jit/JITArithmetic.cpp:
10023 (JSC::JIT::emitSlow_op_jnless):
10024 (JSC::JIT::emitSlow_op_jnlesseq):
10025 (JSC::JIT::emitBinaryDoubleOp):
10027 2009-07-01 Geoffrey Garen <ggaren@apple.com>
10029 Reviewed by Sam Weinig.
10031 Converted op_mod to put { tag, payload } in { regT1, regT0 }, and
10032 tidied up its constant case.
10034 SunSpider reports a 0.2% regression, but a micro-benchmark of op_mod
10035 shows a 12% speedup, and the SunSpider test that uses op_mod most should
10036 benefit a lot from result caching in the end, since it almost always
10037 performs (expression) % constant.
10039 * jit/JITArithmetic.cpp:
10040 (JSC::JIT::emit_op_mod):
10041 (JSC::JIT::emitSlow_op_mod):
10043 2009-06-30 Sam Weinig <sam@webkit.org>
10045 Reviewed by Geoffrey Garen.
10047 Converted some more arithmetic ops to put { tag, payload } in
10050 * jit/JITArithmetic.cpp:
10051 (JSC::JIT::emit_op_mul):
10052 (JSC::JIT::emitSlow_op_mul):
10054 2009-06-30 Geoffrey Garen <ggaren@apple.com>
10056 Reviewed by Sam Weinig.
10058 Converted some more arithmetic ops to put { tag, payload } in
10059 { regT1, regT0 }, and added a case for subtract constant.
10061 SunSpider says no change. v8 says 0.3% slower.
10064 * jit/JITArithmetic.cpp:
10065 (JSC::JIT::emit_op_add):
10066 (JSC::JIT::emitAdd32Constant):
10067 (JSC::JIT::emitSlow_op_add):
10068 (JSC::JIT::emit_op_sub):
10069 (JSC::JIT::emitSub32Constant):
10070 (JSC::JIT::emitSlow_op_sub):
10072 2009-06-30 Gavin Barraclough <barraclough@apple.com>
10074 Reviewed by Sam Weinig.
10076 Remove more uses of addressFor(), load double constants directly from
10077 the constantpool in the CodeBlock, rather than from the register file.
10079 * jit/JITArithmetic.cpp:
10080 (JSC::JIT::emitAdd32Constant):
10081 (JSC::JIT::emitBinaryDoubleOp):
10083 2009-06-30 Geoffrey Garen <ggaren@apple.com>
10085 Reviewed by Sam Weinig.
10087 Fixed a bug in postfix ops, where we would treat x = x++ and x = x--
10088 as a no-op, even if x were not an int, and the ++/-- could have side-effects.
10090 * jit/JITArithmetic.cpp:
10091 (JSC::JIT::emit_op_post_inc):
10092 (JSC::JIT::emitSlow_op_post_inc):
10093 (JSC::JIT::emit_op_post_dec):
10094 (JSC::JIT::emitSlow_op_post_dec):
10096 2009-06-30 Geoffrey Garen <ggaren@apple.com>
10098 Reviewed by Sam Weinig.
10100 Converted some arithmetic ops to put { tag, payload } in
10103 SunSpider says 0.7% faster. v8 says no change.
10106 * jit/JITArithmetic.cpp:
10107 (JSC::JIT::emit_op_jnless):
10108 (JSC::JIT::emit_op_jnlesseq):
10109 (JSC::JIT::emit_op_lshift):
10110 (JSC::JIT::emit_op_rshift):
10111 (JSC::JIT::emit_op_bitand):
10112 (JSC::JIT::emit_op_bitor):
10113 (JSC::JIT::emit_op_bitxor):
10114 * jit/JITInlineMethods.h:
10115 (JSC::JIT::isOperandConstantImmediateInt):
10116 (JSC::JIT::getOperandConstantImmediateInt):
10118 2009-06-30 Gavin Barraclough <barraclough@apple.com>
10120 Reviewed by Sam Weinig.
10122 Start removing cases of addressFor().
10125 * jit/JITArithmetic.cpp:
10126 (JSC::JIT::emitAdd32Constant):
10127 (JSC::JIT::emitBinaryDoubleOp):
10128 (JSC::JIT::emit_op_div):
10129 * jit/JITInlineMethods.h:
10130 (JSC::JIT::emitLoadDouble):
10131 (JSC::JIT::emitLoadInt32ToDouble):
10132 (JSC::JIT::emitStoreDouble):
10133 * jit/JITOpcodes.cpp:
10134 (JSC::JIT::emit_op_jfalse):
10135 (JSC::JIT::emit_op_jtrue):
10137 2009-06-30 Geoffrey Garen <ggaren@apple.com>
10139 Rolled back in my last patch with regression fixed.
10142 (JSC::JIT::privateCompileSlowCases):
10144 * jit/JITOpcodes.cpp:
10145 (JSC::JIT::emit_op_loop_if_less):
10146 (JSC::JIT::emit_op_loop_if_lesseq):
10147 (JSC::JIT::emit_op_resolve_global):
10148 (JSC::JIT::emitSlow_op_resolve_global):
10149 (JSC::JIT::emit_op_eq):
10150 (JSC::JIT::emitSlow_op_eq):
10151 (JSC::JIT::emit_op_neq):
10152 (JSC::JIT::emitSlow_op_neq):
10154 2009-06-30 Geoffrey Garen <ggaren@apple.com>
10156 Rolled out my last patch because it was a 2% SunSpider regression.
10159 (JSC::JIT::privateCompileSlowCases):
10161 * jit/JITOpcodes.cpp:
10162 (JSC::JIT::emit_op_loop_if_less):
10163 (JSC::JIT::emit_op_loop_if_lesseq):
10164 (JSC::JIT::emit_op_resolve_global):
10165 (JSC::JIT::emit_op_eq):
10166 (JSC::JIT::emitSlow_op_eq):
10167 (JSC::JIT::emit_op_neq):
10168 (JSC::JIT::emitSlow_op_neq):
10170 2009-06-30 Geoffrey Garen <ggaren@apple.com>
10172 Reviewed by Gavin "Sam Weinig" Barraclough.
10174 Standardized the rest of our opcodes to put { tag, payload } in
10175 { regT1, regT0 } where possible.
10178 (JSC::JIT::privateCompileSlowCases):
10180 * jit/JITOpcodes.cpp:
10181 (JSC::JIT::emit_op_loop_if_less):
10182 (JSC::JIT::emit_op_loop_if_lesseq):
10183 (JSC::JIT::emit_op_resolve_global):
10184 (JSC::JIT::emitSlow_op_resolve_global):
10185 (JSC::JIT::emit_op_eq):
10186 (JSC::JIT::emitSlow_op_eq):
10187 (JSC::JIT::emit_op_neq):
10188 (JSC::JIT::emitSlow_op_neq):
10190 2009-06-30 Gavin Barraclough <barraclough@apple.com>
10192 Reviewed by Geoffrey Garen.
10194 Replace calls to store32(tagFor()) and store32(payloadFor())
10195 with emitStoreInt32(), emitStoreBool(), and emitStoreCell().
10198 * jit/JITArithmetic.cpp:
10199 (JSC::JIT::emit_op_negate):
10200 (JSC::JIT::emit_op_lshift):
10201 (JSC::JIT::emit_op_rshift):
10202 (JSC::JIT::emit_op_bitand):
10203 (JSC::JIT::emitBitAnd32Constant):
10204 (JSC::JIT::emit_op_bitor):
10205 (JSC::JIT::emitBitOr32Constant):
10206 (JSC::JIT::emit_op_bitxor):
10207 (JSC::JIT::emitBitXor32Constant):
10208 (JSC::JIT::emit_op_bitnot):
10209 (JSC::JIT::emit_op_post_inc):
10210 (JSC::JIT::emit_op_post_dec):
10211 (JSC::JIT::emit_op_pre_inc):
10212 (JSC::JIT::emit_op_pre_dec):
10213 (JSC::JIT::emit_op_add):
10214 (JSC::JIT::emitAdd32Constant):
10215 (JSC::JIT::emit_op_sub):
10216 (JSC::JIT::emitSub32ConstantLeft):
10217 (JSC::JIT::emitSub32ConstantRight):
10218 (JSC::JIT::emit_op_mul):
10219 (JSC::JIT::emitSlow_op_mul):
10220 (JSC::JIT::emit_op_div):
10221 (JSC::JIT::emit_op_mod):
10223 (JSC::JIT::emit_op_load_varargs):
10224 * jit/JITInlineMethods.h:
10225 (JSC::JIT::emitStoreInt32):
10226 (JSC::JIT::emitStoreCell):
10227 (JSC::JIT::emitStoreBool):
10228 (JSC::JIT::emitStore):
10229 * jit/JITOpcodes.cpp:
10230 (JSC::JIT::emit_op_instanceof):
10231 (JSC::JIT::emit_op_not):
10232 (JSC::JIT::emit_op_eq):
10233 (JSC::JIT::emitSlow_op_eq):
10234 (JSC::JIT::emit_op_neq):
10235 (JSC::JIT::emitSlow_op_neq):
10236 (JSC::JIT::compileOpStrictEq):
10237 (JSC::JIT::emit_op_eq_null):
10238 (JSC::JIT::emit_op_neq_null):
10239 * jit/JITStubCall.h:
10240 (JSC::JITStubCall::call):
10242 2009-06-30 Geoffrey Garen <ggaren@apple.com>
10244 Reviewed by Sam Weinig.
10246 Standardized the rest of the property access instructions to put { tag,
10247 payload } in { regT1, regT0 }.
10249 Small v8 speedup, 0.2% SunSpider slowdown.
10252 * jit/JITInlineMethods.h:
10253 (JSC::JIT::emitLoad):
10254 (JSC::JIT::emitLoad2):
10255 * jit/JITPropertyAccess.cpp:
10256 (JSC::JIT::emit_op_get_by_val):
10257 (JSC::JIT::emitSlow_op_get_by_val):
10258 (JSC::JIT::emit_op_put_by_val):
10259 (JSC::JIT::emitSlow_op_put_by_val):
10260 (JSC::JIT::emit_op_put_by_id):
10261 (JSC::JIT::emitSlow_op_put_by_id):
10262 (JSC::JIT::patchPutByIdReplace):
10264 2009-06-29 Sam Weinig <sam@webkit.org>
10266 Reviewed by Gavin Barraclough.
10269 - Use fpRegT* instead of X86::xmm*.
10270 - Use a switch statement in emitBinaryDoubleOp instead of a bunch of
10273 * jit/JITArithmetic.cpp:
10274 (JSC::JIT::emitAdd32Constant):
10275 (JSC::JIT::emitBinaryDoubleOp):
10276 (JSC::JIT::emit_op_div):
10278 2009-06-29 Sam Weinig <sam@webkit.org>
10280 Reviewed by Geoffrey Garen.
10282 Add inline code dealing with doubles for op_jfalse and op_jtrue.
10284 * assembler/MacroAssemblerX86Common.h:
10285 (JSC::MacroAssemblerX86Common::):
10286 (JSC::MacroAssemblerX86Common::zeroDouble):
10287 * jit/JITOpcodes.cpp:
10288 (JSC::JIT::emit_op_jfalse):
10289 (JSC::JIT::emit_op_jtrue):
10291 2009-06-28 Geoffrey Garen <ggaren@apple.com>
10293 Reviewed by Sam Weinig.
10295 Standardized op_get_by_id to put { tag, payload } in { regT1, regT0 }.
10297 SunSpider and v8 report maybe 0.2%-0.4% regressions, but the optimization
10298 this enables will win much more than that back.
10301 (JSC::JIT::privateCompileCTIMachineTrampolines):
10303 * jit/JITPropertyAccess.cpp:
10304 (JSC::JIT::emit_op_method_check):
10305 (JSC::JIT::emit_op_get_by_id):
10306 (JSC::JIT::compileGetByIdHotPath):
10307 (JSC::JIT::compileGetByIdSlowCase):
10308 (JSC::JIT::patchGetByIdSelf):
10309 (JSC::JIT::privateCompilePatchGetArrayLength):
10310 (JSC::JIT::privateCompileGetByIdProto):
10311 (JSC::JIT::privateCompileGetByIdSelfList):
10312 (JSC::JIT::privateCompileGetByIdProtoList):
10313 (JSC::JIT::privateCompileGetByIdChainList):
10314 (JSC::JIT::privateCompileGetByIdChain):
10316 2009-06-26 Geoffrey Garen <ggaren@apple.com>
10318 Reviewed by Maciej Stachowiak.
10320 Standardized op_call to put { tag, payload } in { regT1, regT0 }.
10322 SunSpider and v8 report no change.
10325 (JSC::JIT::privateCompileCTIMachineTrampolines):
10327 (JSC::JIT::compileOpCallInitializeCallFrame):
10328 (JSC::JIT::compileOpCallSetupArgs):
10329 (JSC::JIT::compileOpConstructSetupArgs):
10330 (JSC::JIT::compileOpCallVarargsSetupArgs):
10331 (JSC::JIT::compileOpCallVarargs):
10332 (JSC::JIT::compileOpCall):
10333 (JSC::JIT::compileOpCallSlowCase):
10335 2009-06-26 Sam Weinig <sam@webkit.org>
10337 Reviewed by Geoffrey Garen.
10339 Handle multiplying by zero a little better by
10340 inlining the case that both operands are non-negative
10343 * assembler/MacroAssemblerX86Common.h:
10344 (JSC::MacroAssemblerX86Common::branchOr32):
10345 * jit/JITArithmetic.cpp:
10346 (JSC::JIT::emit_op_mul):
10347 (JSC::JIT::emitSlow_op_mul):
10349 2009-06-25 Geoffrey Garen <ggaren@apple.com>
10351 Reviewed by Sam Weinig.
10353 Optimize x++ to ++x inside for loops.
10355 Sadly, no measurable speedup, but this should help with result chaining.
10357 * parser/Nodes.cpp:
10358 (JSC::ForNode::emitBytecode):
10360 2009-06-25 Geoffrey Garen <ggaren@apple.com>
10362 Reviewed by Sam Weinig.
10364 Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
10366 * jit/JITArithmetic.cpp:
10367 (JSC::JIT::emitSlow_op_bitnot):
10368 (JSC::JIT::emit_op_post_inc):
10370 2009-06-25 Geoffrey Garen <ggaren@apple.com>
10372 Reviewed by Sam Weinig.
10374 Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
10376 * jit/JITArithmetic.cpp:
10377 (JSC::JIT::emit_op_bitnot):
10378 (JSC::JIT::emit_op_post_dec):
10379 (JSC::JIT::emit_op_pre_inc):
10380 (JSC::JIT::emitSlow_op_pre_inc):
10381 (JSC::JIT::emit_op_pre_dec):
10382 (JSC::JIT::emitSlow_op_pre_dec):
10384 2009-06-25 Geoffrey Garen <ggaren@apple.com>
10386 Reviewed by Sam Weinig.
10388 Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
10390 * jit/JITArithmetic.cpp:
10391 (JSC::JIT::emit_op_negate):
10392 (JSC::JIT::emitSlow_op_negate):
10394 (JSC::JIT::emit_op_construct_verify):
10395 (JSC::JIT::emitSlow_op_construct_verify):
10397 2009-06-25 Geoffrey Garen <ggaren@apple.com>
10399 Reviewed by Sam Weinig.
10401 Standardized some more opcodes to put { tag, payload } in { regT1, regT0 }.
10403 * jit/JITOpcodes.cpp:
10404 (JSC::JIT::emit_op_loop_if_true):
10405 (JSC::JIT::emit_op_jfalse):
10406 (JSC::JIT::emit_op_jtrue):
10407 (JSC::JIT::emit_op_jeq_null):
10408 (JSC::JIT::emit_op_jneq_null):
10409 (JSC::JIT::emit_op_eq_null):
10410 (JSC::JIT::emit_op_neq_null):
10412 2009-06-25 Geoffrey Garen <ggaren@apple.com>
10414 Reviewed by Sam Weinig (sort of, maybe).
10416 Fixed some ASSERTs in http/tests/security.
10418 These ASSERTs were introduced by http://trac.webkit.org/changeset/45057,
10419 but the underlying problem was actually older. http://trac.webkit.org/changeset/45057
10420 just exposed the problem by enabling optimization in more cases.
10422 The ASSERTs fired because we tested PropertySlot::slotBase() for validity,
10423 but slotBase() ASSERTs if it's invalid, so we would ASSERT before
10424 the test could happen. Solution: Remove the ASSERT. Maybe it was valid
10425 once, but it clearly goes against a pattern we've deployed of late.
10427 The underlying problem was that WebCore would re-use a PropertySlot in
10428 the case of a forwarding access, and the second use would not completely
10429 overwrite the first use. Solution: Make sure to overwrite m_offset when
10430 setting a value on a PropertySlot. (Other values already get implicitly
10431 overwritten during reuse.)
10433 * runtime/PropertySlot.h:
10434 (JSC::PropertySlot::PropertySlot):
10435 (JSC::PropertySlot::setValueSlot):
10436 (JSC::PropertySlot::setValue):
10437 (JSC::PropertySlot::setRegisterSlot):
10438 (JSC::PropertySlot::setUndefined):
10439 (JSC::PropertySlot::slotBase):
10440 (JSC::PropertySlot::clearOffset):
10442 2009-06-24 Gavin Barraclough <barraclough@apple.com>
10444 Reviewed by Geoff Garen.
10446 Enable JIT_OPTIMIZE_METHOD_CALLS on the branch, implementation matches current implemenatation in ToT.
10449 * jit/JITPropertyAccess.cpp:
10450 (JSC::JIT::emit_op_method_check):
10451 (JSC::JIT::emitSlow_op_method_check):
10452 (JSC::JIT::emit_op_get_by_id):
10453 (JSC::JIT::compileGetByIdHotPath):
10454 (JSC::JIT::emitSlow_op_get_by_id):
10455 (JSC::JIT::compileGetByIdSlowCase):
10457 2009-06-23 Geoffrey Garen <ggaren@apple.com>
10459 Reviewed by Sam Weinig.
10461 Bit off a tiny bit more of standardizing opcode behavior to help with result
10464 SunSpider reports no change, v8 maybe a tiny speedup.
10466 * jit/JITOpcodes.cpp:
10467 (JSC::JIT::emit_op_to_jsnumber):
10468 (JSC::JIT::emitSlow_op_to_jsnumber):
10469 (JSC::JIT::emit_op_convert_this):
10470 (JSC::JIT::emitSlow_op_convert_this):
10472 2009-06-23 Geoffrey Garen <ggaren@apple.com>
10474 Reviewed by Sam Weinig.
10476 Bit off a tiny bit more of standardizing opcode behavior to help with result
10477 caching -- including removing my old enemy, op_resolve_function, because
10478 it was non-standard, and removing it felt better than helping it limp along.
10480 SunSpider reports no change, v8 maybe a tiny speedup.
10482 * bytecode/CodeBlock.cpp:
10483 (JSC::CodeBlock::dump):
10484 * bytecode/Opcode.h:
10485 * bytecompiler/BytecodeGenerator.cpp:
10486 * bytecompiler/BytecodeGenerator.h:
10487 * interpreter/Interpreter.cpp:
10488 (JSC::Interpreter::privateExecute):
10490 (JSC::JIT::privateCompileMainPass):
10492 * jit/JITOpcodes.cpp:
10493 (JSC::JIT::emit_op_get_scoped_var):
10494 (JSC::JIT::emit_op_put_scoped_var):
10495 (JSC::JIT::emit_op_to_primitive):
10496 (JSC::JIT::emitSlow_op_to_primitive):
10497 * jit/JITStubs.cpp:
10499 * parser/Nodes.cpp:
10500 (JSC::FunctionCallResolveNode::emitBytecode):
10502 2009-06-23 Geoffrey Garen <ggaren@apple.com>
10504 Reviewed by Sam Weinig.
10506 Bit off a tiny bit of standardizing opcode behavior to help with result
10509 0.6% SunSpider speedup. 0.3% v8 speedup.
10511 * jit/JITInlineMethods.h:
10512 (JSC::JIT::emitLoad): Accomodate a base register that overlaps with payload
10513 by loading tag before payload, to avoid stomping base/payload.
10515 * jit/JITOpcodes.cpp:
10516 (JSC::JIT::emit_op_mov): Abide by the standard "tag in regT1, payload in
10519 (JSC::JIT::emit_op_get_global_var):
10520 (JSC::JIT::emit_op_put_global_var): Ditto. Also, removed some irrelevent
10521 loads while I was at it. The global object's "d" pointer never changes
10522 after construction.
10524 2009-06-23 Gavin Barraclough <barraclough@apple.com>
10526 Reviewed by Sam Weinig.
10528 Remove 'arguments' field from Register union (again).
10529 This time do so without breaking tests (radical, I know).
10531 * interpreter/CallFrame.h:
10532 (JSC::ExecState::optionalCalleeArguments):
10533 (JSC::ExecState::setArgumentCount):
10534 (JSC::ExecState::init):
10535 * interpreter/Interpreter.cpp:
10536 (JSC::Interpreter::dumpRegisters):
10537 (JSC::Interpreter::unwindCallFrame):
10538 (JSC::Interpreter::privateExecute):
10539 (JSC::Interpreter::retrieveArguments):
10540 * interpreter/Register.h:
10541 (JSC::Register::withInt):
10543 (JSC::Register::Register):
10544 (JSC::Register::i):
10545 * jit/JITStubs.cpp:
10546 (JSC::JITStubs::cti_op_tear_off_arguments):
10547 * runtime/Arguments.h:
10548 (JSC::JSActivation::copyRegisters):
10549 (JSC::Register::arguments):
10550 * runtime/JSActivation.cpp:
10551 (JSC::JSActivation::argumentsGetter):
10552 * runtime/JSActivation.h:
10554 2009-06-23 Geoffrey Garen <ggaren@apple.com>
10556 Reviewed by Sam Weinig.
10558 Removed some result register tracking cruft in preparation for a new
10559 result tracking mechanism.
10561 SunSpider reports no change.
10563 * assembler/AbstractMacroAssembler.h:
10564 * assembler/X86Assembler.h:
10565 (JSC::X86Assembler::JmpDst::JmpDst): No need to track jump targets in
10566 machine code; we already do this in bytecode.
10570 (JSC::JIT::emitTimeoutCheck): Make sure to save and restore the result
10571 registers, so an opcode with a timeout check can still benefit from result
10574 (JSC::JIT::privateCompileMainPass):
10575 (JSC::JIT::privateCompileSlowCases): Removed calls to killLastResultRegister()
10576 in preparation for something new.
10579 * jit/JITArithmetic.cpp:
10580 (JSC::JIT::emit_op_jnless):
10581 (JSC::JIT::emit_op_jnlesseq):
10582 * jit/JITInlineMethods.h:
10583 (JSC::JIT::emitGetFromCallFrameHeaderPtr):
10584 (JSC::JIT::emitGetFromCallFrameHeader32):
10585 * jit/JITOpcodes.cpp:
10586 (JSC::JIT::emit_op_jmp):
10587 (JSC::JIT::emit_op_jfalse):
10588 (JSC::JIT::emit_op_jtrue):
10589 (JSC::JIT::emit_op_jeq_null):
10590 (JSC::JIT::emit_op_jneq_null):
10591 (JSC::JIT::emit_op_jneq_ptr):
10592 (JSC::JIT::emit_op_jsr):
10593 (JSC::JIT::emit_op_sret):
10594 (JSC::JIT::emit_op_jmp_scopes): ditto
10596 * jit/JITStubCall.h:
10597 (JSC::JITStubCall::JITStubCall):
10598 (JSC::JITStubCall::getArgument): added a mechanism for reloading an argument
10599 you passed to a JIT stub, for use in emitTimeoutCheck.
10601 2009-06-23 Sam Weinig <sam@webkit.org>
10603 Reviewed by Geoffrey Garen.
10605 Remove now-useless inplace variants of binary ops.
10608 * jit/JITArithmetic.cpp:
10609 (JSC::JIT::emit_op_bitand):
10610 (JSC::JIT::emit_op_bitor):
10611 (JSC::JIT::emit_op_bitxor):
10612 (JSC::JIT::emit_op_add):
10613 (JSC::JIT::emit_op_sub):
10614 (JSC::JIT::emit_op_mul):
10616 2009-06-23 Sam Weinig <sam@webkit.org>
10618 Reviewed by Geoffrey Garen.
10620 Move off memory operands to aid in re-enabling result caching.
10622 - No regression measured.
10625 * jit/JITArithmetic.cpp:
10626 (JSC::JIT::emit_op_negate):
10627 (JSC::JIT::emit_op_jnless):
10628 (JSC::JIT::emit_op_jnlesseq):
10629 (JSC::JIT::emit_op_lshift):
10630 (JSC::JIT::emit_op_rshift):
10631 (JSC::JIT::emit_op_bitand):
10632 (JSC::JIT::emitBitAnd32Constant):
10633 (JSC::JIT::emitBitAnd32InPlace):
10634 (JSC::JIT::emit_op_bitor):
10635 (JSC::JIT::emitBitOr32Constant):
10636 (JSC::JIT::emitBitOr32InPlace):
10637 (JSC::JIT::emit_op_bitxor):
10638 (JSC::JIT::emitBitXor32Constant):
10639 (JSC::JIT::emitBitXor32InPlace):
10640 (JSC::JIT::emit_op_bitnot):
10641 (JSC::JIT::emit_op_post_inc):
10642 (JSC::JIT::emit_op_post_dec):
10643 (JSC::JIT::emit_op_pre_inc):
10644 (JSC::JIT::emitSlow_op_pre_inc):
10645 (JSC::JIT::emit_op_pre_dec):
10646 (JSC::JIT::emitSlow_op_pre_dec):
10647 (JSC::JIT::emit_op_add):
10648 (JSC::JIT::emitAdd32Constant):
10649 (JSC::JIT::emitAdd32InPlace):
10650 (JSC::JIT::emitSlow_op_add):
10651 (JSC::JIT::emitSlowAdd32Constant):
10652 (JSC::JIT::emit_op_sub):
10653 (JSC::JIT::emitSlow_op_sub):
10654 (JSC::JIT::emitSub32ConstantLeft):
10655 (JSC::JIT::emitSub32ConstantRight):
10656 (JSC::JIT::emitSub32InPlaceLeft):
10657 (JSC::JIT::emitSub32InPlaceRight):
10658 (JSC::JIT::emitBinaryDoubleOp):
10659 (JSC::JIT::emit_op_mul):
10660 (JSC::JIT::emitMul32InPlace):
10661 (JSC::JIT::emit_op_div):
10662 (JSC::JIT::emit_op_mod):
10664 (JSC::JIT::compileOpCallVarargs):
10665 * jit/JITOpcodes.cpp:
10666 (JSC::JIT::emit_op_loop_if_less):
10667 (JSC::JIT::emit_op_loop_if_lesseq):
10668 (JSC::JIT::emit_op_instanceof):
10669 (JSC::JIT::emit_op_to_primitive):
10670 (JSC::JIT::emit_op_not):
10671 (JSC::JIT::emit_op_jneq_ptr):
10672 (JSC::JIT::emit_op_eq):
10673 (JSC::JIT::emit_op_neq):
10674 (JSC::JIT::emit_op_to_jsnumber):
10675 * jit/JITPropertyAccess.cpp:
10676 (JSC::JIT::emit_op_get_by_val):
10677 (JSC::JIT::emit_op_put_by_val):
10679 2009-06-23 Geoffrey Garen <ggaren@apple.com>
10681 Reviewed by Sam Weinig.
10683 Fixed some missing and/or misplaced labels in bytecode generation, so
10684 we don't have to work around them in JIT code generation.
10686 * bytecompiler/BytecodeGenerator.cpp:
10687 (JSC::BytecodeGenerator::emitJumpSubroutine):
10688 * parser/Nodes.cpp:
10689 (JSC::TryNode::emitBytecode):
10691 2009-06-22 Geoffrey Garen <ggaren@apple.com>
10693 Reviewed by Sam Weinig.
10695 For member function calls, emit "this" directly into the "this" slot
10696 for the function call, instead of moving it there later. This reduces
10697 time spent in op_mov during certain calls, like "a.b.c()".
10699 1%-2% speedup on v8, mostly richards and delta-blue.
10701 * parser/Nodes.cpp:
10702 (JSC::FunctionCallDotNode::emitBytecode):
10704 2009-06-22 Gavin Barraclough <barraclough@apple.com>
10706 Reviewed by Sam Weinig.
10708 Remove 'arguments' field from Register union. Having JSCell derived types in the union is
10709 dangerous since it opens the possibility for the field to be written as a raw pointer but
10710 then read as a JSValue. This will lead to statle data being read for the tag, which may
10711 be dangerous. Having removed Arguments* types form Register, all arguments objects must
10712 always explicitly be stored in the register file as JSValues.
10714 * interpreter/CallFrame.h:
10715 (JSC::ExecState::optionalCalleeArguments):
10716 * interpreter/Interpreter.cpp:
10717 (JSC::Interpreter::unwindCallFrame):
10718 (JSC::Interpreter::privateExecute):
10719 (JSC::Interpreter::retrieveArguments):
10720 * interpreter/Register.h:
10722 * jit/JITStubs.cpp:
10723 (JSC::JITStubs::cti_op_tear_off_arguments):
10724 * runtime/Arguments.h:
10725 (JSC::JSActivation::copyRegisters):
10726 * runtime/JSActivation.cpp:
10727 (JSC::JSActivation::argumentsGetter):
10728 * runtime/JSActivation.h:
10730 2009-06-03 Sam Weinig <sam@webkit.org>
10732 Reviewed by Geoffrey Garen.
10734 Add back known this value optimization by abstracting
10735 slow case if not JSCell jumps.
10739 (JSC::JIT::compileOpCallVarargs):
10740 (JSC::JIT::compileOpCallVarargsSlowCase):
10741 (JSC::JIT::compileOpCall):
10742 (JSC::JIT::compileOpCallSlowCase):
10743 * jit/JITInlineMethods.h:
10744 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
10745 (JSC::JIT::linkSlowCaseIfNotJSCell):
10746 * jit/JITOpcodes.cpp:
10747 (JSC::JIT::emit_op_instanceof):
10748 (JSC::JIT::emitSlow_op_instanceof):
10749 * jit/JITPropertyAccess.cpp:
10750 (JSC::JIT::emit_op_get_by_val):
10751 (JSC::JIT::emitSlow_op_get_by_val):
10752 (JSC::JIT::emit_op_put_by_val):
10753 (JSC::JIT::emitSlow_op_put_by_val):
10754 (JSC::JIT::emit_op_get_by_id):
10755 (JSC::JIT::emitSlow_op_get_by_id):
10756 (JSC::JIT::emit_op_put_by_id):
10757 (JSC::JIT::emitSlow_op_put_by_id):
10759 2009-06-01 Geoffrey Garen <ggaren@apple.com>
10761 Reviewed by Sam Weinig.
10763 Fixed some of the regression in crypto-aes.js. (8.5% speedup in
10766 SunSpider reports no change overall.
10768 Division was producing double results, which took the slow path through
10771 Strangely, all my attempts at versions of this patch that modified array
10772 access code to accept ints encoded as doubles along the fast or slow paths
10773 were regressions. So I did this instead.
10775 * jit/JITArithmetic.cpp:
10776 (JSC::JIT::emit_op_div): When dividing an int by an int, go ahead and try
10777 to turn the result into an int. Don't just do int division, though, because
10778 testing shows it to be slower than SSE double division, and the corner
10779 cases are pretty complicated / lengthy on top of that. Also, don't try
10780 to canonicalize division of known tiny numerators into ints, since that's a
10783 2009-05-26 Geoffrey Garen <ggaren@apple.com>
10785 Reviewed by Oliver Hunt.
10787 Fixed a regression caused by my recent fix for NaN.
10789 * jit/JITArithmetic.cpp:
10790 (JSC::JIT::emitBinaryDoubleOp): Actually do the comparison in reverse
10791 order, like the ChangeLog said we would, bokay?
10793 2009-05-26 Geoffrey Garen <ggaren@apple.com>
10795 Reviewed by Sam Weinig and Oliver Hunt.
10797 Fixed two edge cases in %:
10799 - Don't do -2147483648 % x as a fast case, since you might do -2147483648 % -1,
10800 which will signal a hardware exception due to overflow.
10802 - In the case of a zero remainder, be sure to store negative zero if the
10805 SunSpider reports no change.
10807 * jit/JITArithmetic.cpp:
10808 (JSC::JIT::emit_op_mod):
10809 (JSC::JIT::emitSlow_op_mod):
10811 2009-05-25 Geoffrey Garen <ggaren@apple.com>
10813 Reviewed by Maciej Stachowiak.
10815 Fixed a regression when comparing to NaN.
10817 * jit/JITArithmetic.cpp:
10818 (JSC::JIT::emitBinaryDoubleOp): For op_jnless and op_jnless_eq, do the
10819 comparison in reverse order, and jump if the result is below or
10820 below-or-equal. This ensures that we do jump in the case of NaN.
10822 2009-05-25 Geoffrey Garen <ggaren@apple.com>
10824 Reviewed by Oliver Hunt.
10826 SunSpider says no change.
10828 Fixed regressions in fast/js/var-declarations-shadowing.html and
10829 fast/js/equality.html, caused by recent == and != optimizations.
10831 * jit/JITStubs.cpp:
10832 (JSC::JITStubs::cti_op_eq): Don't treat "compare to string" as always
10833 numeric or string comparison. If the second operand is an object, you
10834 need to ToPrimitive it, and start all over again. Also, I wrote out each
10835 of the possible cases explicitly, to cut down on redundant branching.
10837 2009-05-25 Sam Weinig <sam@webkit.org>
10839 Reviewed by Mark Rowe.
10841 Fix bug in fast/js/constant-folding.html where we were not negating
10844 * jit/JITArithmetic.cpp:
10845 (JSC::JIT::emit_op_negate):
10847 2009-05-23 Geoffrey Garen <ggaren@apple.com>
10849 Reviewed by Oliver Hunt.
10851 Refactored new slow case codegen for == and !=.
10853 SunSpider reports no change, maybe a tiny speedup.
10855 * jit/JITOpcodes.cpp:
10856 (JSC::JIT::emitSlow_op_eq):
10857 (JSC::JIT::emitSlow_op_neq): Made a vptr comparison a *Ptr operation,
10858 instead of *32, to make it portable to 64bit. Reorganized the string
10859 and generic cases to make their control flow a little clearer.
10861 2009-05-23 Geoffrey Garen <ggaren@apple.com>
10863 Reviewed by Maciej Stachowiak.
10865 Optimized == and != for our new value representation -- especially for strings.
10867 14% speedup on date-format-tofte.
10869 * jit/JITOpcodes.cpp:
10870 (JSC::JIT::emit_op_eq):
10871 (JSC::JIT::emitSlow_op_eq):
10872 (JSC::JIT::emit_op_neq):
10873 (JSC::JIT::emitSlow_op_neq):
10874 * jit/JITStubCall.h:
10875 (JSC::JITStubCall::JITStubCall):
10876 * jit/JITStubs.cpp:
10877 (JSC::JITStubs::cti_op_eq):
10878 (JSC::JITStubs::cti_op_eq_strings):
10879 (JSC::JITStubs::cti_op_call_eval):
10882 * runtime/JSValue.h:
10884 2009-05-22 Sam Weinig <sam@webkit.org>
10886 Reviewed by Gavin Barraclough.
10888 Fix non-SSE enabled builds.
10890 * jit/JITArithmetic.cpp:
10891 (JSC::JIT::emitSlow_op_add): Don't early return here, we still need to call the JIT stub.
10892 (JSC::JIT::emitSlow_op_sub): Ditto.
10894 2009-05-22 Geoffrey Garen <ggaren@apple.com>
10896 Reviewed by Sam Weinig.
10898 Here's a thought: let's not take a jit stub call just to multiply by 1,
10901 imul doesn't set the zero flag, so to test for a zero result, we need
10902 an explicit instruction. (Luckily, it does set the overflow flag, so
10903 we can still use that.)
10906 * jit/JITArithmetic.cpp:
10907 (JSC::JIT::emit_op_mul):
10908 (JSC::JIT::emitSlow_op_mul):
10909 (JSC::JIT::emitMul32InPlace):
10911 2009-05-22 Sam Weinig <sam@webkit.org>
10913 Reviewed by Geoffrey "Premature Commit" Garen.
10915 Add back constant integer cases for op_add.
10918 * jit/JITArithmetic.cpp:
10919 (JSC::JIT::emit_op_add):
10920 (JSC::JIT::emitAdd32Constant):
10921 (JSC::JIT::emitSlow_op_add):
10922 (JSC::JIT::emitSlowAdd32Constant):
10923 * jit/JITInlineMethods.h:
10924 (JSC::JIT::getConstantOperandImmediateDouble):
10925 (JSC::JIT::isOperandConstantImmediateDouble):
10927 2009-05-22 Geoffrey Garen <ggaren@apple.com>
10929 Reviewed by Sam Weinig.
10931 Added fast double cases for op_jnless and op_jnlesseq.
10933 * assembler/AbstractMacroAssembler.h:
10934 (JSC::AbstractMacroAssembler::JumpList::jumps): New accesor, used by
10937 * assembler/X86Assembler.h:
10938 (JSC::X86Assembler::ucomisd_rm): New method for comparing register to
10942 * jit/JITArithmetic.cpp:
10943 (JSC::JIT::emit_op_jnless):
10944 (JSC::JIT::emitSlow_op_jnless):
10945 (JSC::JIT::emit_op_jnlesseq):
10946 (JSC::JIT::emitSlow_op_jnlesseq):
10947 (JSC::JIT::emit_op_add):
10948 (JSC::JIT::emit_op_sub):
10949 (JSC::JIT::emitBinaryDoubleOp):
10950 (JSC::JIT::emit_op_mul):
10951 (JSC::JIT::emit_op_div): Modified emitBinaryDoubleOp to accept comparison/jump
10952 operations in addition to operations with explicit result registers.
10954 * jit/JITInlineMethods.h:
10955 (JSC::JIT::addSlowCase): Added an "addSlowCase" for JumpLists, so clients
10956 can track multiple jumps to the same slow case condition together.
10958 2009-05-21 Sam Weinig <sam@webkit.org>
10960 Reviewed by Gavin Barraclough.
10962 Implement op_negate inline fast cases.
10964 * assembler/MacroAssemblerX86Common.h:
10965 (JSC::MacroAssemblerX86Common::neg32):
10966 * assembler/X86Assembler.h:
10967 (JSC::X86Assembler::):
10968 (JSC::X86Assembler::negl_m):
10969 (JSC::X86Assembler::xorpd_rr):
10971 (JSC::JIT::privateCompileMainPass):
10972 (JSC::JIT::privateCompileSlowCases):
10974 * jit/JITArithmetic.cpp:
10975 (JSC::JIT::emit_op_negate):
10976 (JSC::JIT::emitSlow_op_negate):
10978 2009-05-20 Sam Weinig <sam@webkit.org>
10980 Reviewed by Gavin Barraclough.
10982 Update the patchOffsetGetByIdSlowCaseCall constant for the
10983 case that OPCODE_SAMPLING is enabled.
10987 2009-05-20 Geoffrey Garen <ggaren@apple.com>
10989 Reviewed by Sam Weinig.
10991 Added support for inline subtraction of doubles.
10993 * jit/JITArithmetic.cpp:
10994 (JSC::JIT::emit_op_sub):
10995 (JSC::JIT::emitSlow_op_sub):
10996 (JSC::JIT::emitSlowSub32InPlaceLeft):
10997 (JSC::JIT::emitBinaryDoubleOp):
10999 2009-05-20 Sam Weinig <sam@webkit.org>
11001 Reviewed by Geoffrey Garen.
11003 Added support for inline division.
11005 * assembler/X86Assembler.h:
11006 (JSC::X86Assembler::):
11007 (JSC::X86Assembler::divsd_rr):
11008 (JSC::X86Assembler::divsd_mr):
11009 * bytecode/CodeBlock.cpp:
11010 (JSC::CodeBlock::dump):
11011 * bytecode/Opcode.h:
11012 * bytecompiler/BytecodeGenerator.cpp:
11013 (JSC::BytecodeGenerator::emitBinaryOp):
11014 * interpreter/Interpreter.cpp:
11015 (JSC::Interpreter::privateExecute):
11017 (JSC::JIT::privateCompileMainPass):
11018 (JSC::JIT::privateCompileSlowCases):
11020 * jit/JITArithmetic.cpp:
11021 (JSC::JIT::emitBinaryDoubleOp):
11022 (JSC::JIT::emit_op_div):
11023 (JSC::JIT::emitSlow_op_div):
11025 2009-05-20 Geoffrey Garen <ggaren@apple.com>
11027 Reviewed by Sam Weinig.
11029 Added support for inline addition of doubles.
11031 * jit/JITArithmetic.cpp:
11032 (JSC::JIT::emit_op_add):
11033 (JSC::JIT::emitSlow_op_add):
11034 (JSC::JIT::emitSlowAdd32InPlace):
11035 (JSC::JIT::emitBinaryDoubleOp):
11036 (JSC::JIT::emit_op_mul):
11037 (JSC::JIT::emitSlow_op_mul):
11039 2009-05-20 Geoffrey Garen <ggaren@apple.com>
11041 Reviewed by Sam Weinig.
11043 Factored inline double operations into a helper function, so that we
11044 can reuse this code for other math operations.
11047 * jit/JITArithmetic.cpp:
11048 (JSC::JIT::emitBinaryDoubleOp):
11049 (JSC::JIT::emit_op_mul):
11051 (JSC::JIT::compileOpCallInitializeCallFrame):
11053 2009-05-20 Geoffrey Garen <ggaren@apple.com>
11055 Reviewed by Sam Weinig.
11057 Added support for inline multiplication of doubles.
11059 * assembler/X86Assembler.h:
11060 (JSC::X86Assembler::cvtsi2sd_mr): New function, useful for loading an
11061 int32 into a double register.
11063 * jit/JITArithmetic.cpp:
11064 (JSC::JIT::emit_op_mul):
11065 (JSC::JIT::emitSlow_op_mul): Filled out these cases for double arithmetic.
11068 * jit/JITInlineMethods.h:
11069 (JSC::JIT::addressFor): New function, useful for addressing a JSValue's
11070 full 64bits as a double.
11072 2009-05-19 Sam Weinig <sam@webkit.org>
11074 Reviewed by Geoffrey Garen.
11076 Implement and enable optimized calls.
11079 (JSC::JIT::privateCompileCTIMachineTrampolines): Add ENABLE(JIT_OPTIMIZE_CALL) guards
11080 around the the optimize call only trampolines (virtualCallPreLink and virtualCallLink).
11081 Update the trampolines to account for the new JSValue representation.
11082 (JSC::JIT::unlinkCall): Use NULL instead of JSValue noValue.
11085 (JSC::JIT::compileOpCall): Update to account for the new JSValue representation
11086 (JSC::JIT::compileOpCallSlowCase): Ditto.
11088 * jit/JITStubs.h: Remove incorrect !ENABLE(JIT_OPTIMIZE_CALL) guard.
11090 * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_CALL.
11092 2009-05-19 Sam Weinig <sam@webkit.org>
11094 Reviewed by Geoffrey Garen.
11096 Implement and enable optimized property access.
11098 * assembler/AbstractMacroAssembler.h: Fix comment.
11100 (JSC::JIT::privateCompileCTIMachineTrampolines): Remove array length trampoline
11101 and implement the string length trampoline.
11102 * jit/JIT.h: Add new constants for patch offsets.
11103 * jit/JITInlineMethods.h: Remove FIELD_OFFSET which is now in StdLibExtras.h.
11104 * jit/JITPropertyAccess.cpp:
11105 (JSC::JIT::emit_op_get_by_id):
11106 (JSC::JIT::emitSlow_op_get_by_id):
11107 (JSC::JIT::emit_op_put_by_id):
11108 (JSC::JIT::emitSlow_op_put_by_id):
11109 (JSC::JIT::compilePutDirectOffset):
11110 (JSC::JIT::compileGetDirectOffset):
11111 (JSC::JIT::privateCompilePutByIdTransition):
11112 (JSC::JIT::patchGetByIdSelf):
11113 (JSC::JIT::patchPutByIdReplace):
11114 (JSC::JIT::privateCompilePatchGetArrayLength):
11115 (JSC::JIT::privateCompileGetByIdProto):
11116 (JSC::JIT::privateCompileGetByIdSelfList):
11117 (JSC::JIT::privateCompileGetByIdProtoList):
11118 (JSC::JIT::privateCompileGetByIdChainList):
11119 (JSC::JIT::privateCompileGetByIdChain):
11120 * jit/JITStubCall.h:
11121 (JSC::JITStubCall::addArgument): Add version of addArgument that takes
11122 two registers for the tag and payload.
11123 * jit/JITStubs.cpp:
11124 (JSC::JITStubs::JITStubs): Remove array length trampoline pointer.
11125 (JSC::JITStubs::cti_op_get_by_id_self_fail):
11127 * runtime/JSObject.h:
11128 (JSC::JSObject::JSObject): Move m_inheritorID below the property storage
11129 to align it to a 16 byte boundary.
11130 * wtf/Platform.h: Enable ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
11131 * wtf/StdLibExtras.h: Move FIELD_OFFSET here.
11133 2009-05-17 Sam Weinig <sam@webkit.org>
11135 Reviewed by Geoffrey Garen.
11137 Remove unneeded ExecState parameter from the number JSValue constructors.
11139 * runtime/JSValue.h:
11142 (JSC::JSValue::JSValue):
11144 2009-05-15 Sam Weinig <sam@webkit.org>
11146 Reviewed by Geoffrey Garen.
11148 Implemented fast path for op_put_by_val when putting to arrays.
11150 * jit/JITPropertyAccess.cpp:
11151 (JSC::JIT::emit_op_put_by_val):
11152 (JSC::JIT::emitSlow_op_put_by_val):
11154 2009-05-15 Geoffrey Garen <ggaren@apple.com> (Mostly by Sam)
11156 Reviewed by Sam Weinig.
11158 Implemented fast path for op_get_by_val when accessing array.
11161 * jit/JITPropertyAccess.cpp:
11162 (JSC::JIT::emit_op_get_by_val):
11163 (JSC::JIT::emitSlow_op_get_by_val):
11165 2009-05-14 Geoffrey Garen <ggaren@apple.com>
11167 Reviewed by Sam Weinig.
11169 Fixed a failure in fast/js/math-transforms.html caused by failing to
11170 preserve -0 in multiplication.
11172 * assembler/X86Assembler.h:
11173 (JSC::X86Assembler::jz):
11174 * jit/JITArithmetic.cpp:
11175 (JSC::JIT::emit_op_mul):
11176 (JSC::JIT::emitSlow_op_mul):
11177 (JSC::JIT::emitMul32Constant):
11178 (JSC::JIT::emitMul32InPlace): Check both for overflow and for zero when
11179 doing multiplication. Use a slow case to get these right.
11181 2009-05-14 Geoffrey Garen <ggaren@apple.com>
11183 Reviewed by Sam Weinig.
11185 Fixed a bug in the varargs calling convention.
11188 (JSC::JIT::compileOpCallVarargs): Move the argument count into regT1,
11189 since that's where ctiVirtualCall expects it to be.
11191 2009-05-14 Geoffrey Garen <ggaren@apple.com>
11193 Reviewed by Sam Weinig.
11195 Fixed a small bug in instanceof's looping code.
11197 * jit/JITOpcodes.cpp:
11198 (JSC::JIT::emit_op_instanceof): NULL means the object has no prototype,
11199 so only loop when *not* equal to NULL.
11201 2009-05-14 Geoffrey Garen <ggaren@apple.com>
11203 Reviewed by Sam Weinig.
11205 Fixed a small bug in instanceof's result writing code.
11207 * jit/JITOpcodes.cpp:
11208 (JSC::JIT::emit_op_instanceof): Make sure to fill out the payload bits
11211 2009-05-14 Sam Weinig <sam@webkit.org>
11213 Reviewed by Geoffrey Garen.
11215 Removed an invalid assertion in cti_op_urshift which
11216 depended on a fast path for op_urshift which has
11219 * jit/JITStubs.cpp:
11220 (JSC::JITStubs::cti_op_urshift):
11222 2009-05-14 Geoffrey Garen <ggaren@apple.com>
11224 Reviewed by Sam Weinig.
11226 Fixed loop_if_true, which had the same reversed test that jtrue had.
11228 * jit/JITOpcodes.cpp:
11229 (JSC::JIT::emit_op_loop_if_true):
11231 2009-05-14 Sam Weinig <sam@webkit.org>
11233 Reviewed by Geoffrey Garen.
11235 In op_neq, we apparently want to check that one value
11236 does *not* equal another. Go figure.
11238 * jit/JITOpcodes.cpp:
11239 (JSC::JIT::emit_op_neq):
11241 2009-05-14 Sam Weinig <sam@webkit.org>
11243 Reviewed by Geoffrey Garen.
11245 The slow case of op_mod should call op_mod's jit stub,
11246 not op_mul. That would be dumb.
11248 * jit/JITArithmetic.cpp:
11249 (JSC::JIT::emitSlow_op_mod):
11251 2009-05-14 Geoffrey Garen <ggaren@apple.com>
11253 Reviewed by Sam Weinig.
11255 Fixed problems when using 'arguments' due to a half-initialized register.
11257 * interpreter/CallFrame.h:
11258 (JSC::ExecState::setCalleeArguments):
11259 (JSC::ExecState::init): Require a full JSValue when setting up the
11260 'arguments' virtual register, since this register is accessible from JIT
11261 code and bytecode, and needs to be a true JSValue.
11263 * interpreter/CallFrameClosure.h:
11264 (JSC::CallFrameClosure::resetCallFrame): ditto
11266 * interpreter/Interpreter.cpp:
11267 (JSC::Interpreter::privateExecute): ditto
11269 * interpreter/Register.h: Removed the constructor that allowed assignment
11270 of a JSArguments* to a register. That is not safe. See above.
11272 * jit/JITStubs.cpp:
11273 (JSC::JITStubs::cti_op_create_arguments):
11274 (JSC::JITStubs::cti_op_create_arguments_no_params): ditto
11276 2009-05-14 Sam Weinig <sam@webkit.org>
11278 Reviewed by Geoffrey Garen.
11280 We really want to go to the slow case in op_jfalse and
11281 op_jtrue if the value is *not* boolean.
11283 * jit/JITOpcodes.cpp:
11284 (JSC::JIT::emit_op_jfalse):
11285 (JSC::JIT::emit_op_jtrue):
11287 2009-05-14 Sam Weinig <sam@webkit.org>
11289 Reviewed by Geoffrey Garen.
11291 Flipped the condition when emitting a an op_loop_if_less or op_loop_if_lesseq
11292 if the first operand is a constant.
11294 * jit/JITOpcodes.cpp:
11295 (JSC::JIT::emit_op_loop_if_less):
11296 (JSC::JIT::emit_op_loop_if_lesseq):
11298 2009-05-14 Sam Weinig <sam@webkit.org>
11300 Reviewed by Geoffrey Garen.
11302 Added missing return in op_jnless and op_jnlesseq.
11304 * jit/JITArithmetic.cpp:
11305 (JSC::JIT::emit_op_jnless):
11306 (JSC::JIT::emit_op_jnlesseq):
11308 2009-05-14 Sam Weinig <sam@webkit.org>
11310 Reviewed by Geoffrey Garen.
11312 Load constants into the the register file as a temporary measure to
11313 aid bring up. This allows us to use to treat constants like any
11314 other virtual register.
11316 * jit/JITOpcodes.cpp:
11317 (JSC::JIT::emit_op_enter):
11318 (JSC::JIT::emit_op_enter_with_activation):
11320 2009-05-14 Geoffrey Garen <ggaren@apple.com>
11322 Reviewed by Sam Weinig.
11324 Implemented op_strict_eq. Original patch by Snowy, by way of Sam and Gavin.
11326 * assembler/MacroAssemblerX86Common.h:
11327 (JSC::MacroAssemblerX86Common::set8): Added set8, since it's slightly
11328 faster than set32, and the new value representation usually doesn't
11333 * jit/JITInlineMethods.h:
11334 (JSC::JIT::emitLoadTag):
11335 (JSC::JIT::emitLoadPayload): Added helper functions for dealing with
11336 constants. Eventually, we should write special cases for all constants,
11337 but these are helpful in the short term.
11339 * jit/JITOpcodes.cpp:
11340 (JSC::JIT::compileOpStrictEq):
11341 (JSC::JIT::emitSlow_op_stricteq):
11342 (JSC::JIT::emitSlow_op_nstricteq): teh opcodez.
11344 * runtime/JSValue.h:
11346 (JSC::JSValue::isDouble): Added a LowestTag for clarity.
11348 2009-05-13 Geoffrey Garen <ggaren@apple.com>
11350 Reviewed by Sam Weinig.
11352 Fixed some bugs in host function calls.
11354 testapi now passes!
11356 * jit/JIT.cpp: Changed some registers around to avoid overwriting edx:eax,
11357 which is how JSValues are now returned. Also changed the code that
11358 passes thisValue to pass the full 64bits of the value. Also added
11359 an #error compiler directive to other platform builds, since the JSValue
11360 return signature probably won't return in edx:eax on those platforms,
11361 and we'll have to investigate a solution.
11363 2009-05-13 Geoffrey Garen <ggaren@apple.com>
11365 Reviewed by Sam Weinig.
11367 Removed parameters from functions that are intended never to use their
11370 * jit/JITPropertyAccess.cpp:
11371 (JSC::JIT::emitSlow_op_get_by_val):
11372 (JSC::JIT::emitSlow_op_put_by_val):
11374 2009-05-13 Geoffrey Garen <ggaren@apple.com>
11376 Reviewed by Sam Weinig.
11378 Ported op_instance_of from TOT. It's basically the same, but some register
11379 stuff changed to memory stuff.
11381 * jit/JITInlineMethods.h:
11382 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
11383 (JSC::JIT::emitStore): Changed to use helper functions.
11385 * jit/JITOpcodes.cpp:
11386 (JSC::JIT::emit_op_instanceof):
11387 (JSC::JIT::emitSlow_op_instanceof): Ported from TOT.
11389 2009-05-13 Geoffrey Garen <ggaren@apple.com>
11391 Reviewed by Gavin Barraclough.
11393 Added a comment to explain an exception-handling subtelty that we found
11394 hard to remember when reviewing my last patch.
11396 * jit/JITOpcodes.cpp:
11397 (JSC::JIT::emit_op_catch):
11399 2009-05-13 Geoffrey Garen <ggaren@apple.com>
11401 Reviewed by Sam Weinig.
11403 Implemented try/catch.
11405 * jit/JITOpcodes.cpp:
11406 (JSC::JIT::emit_op_throw): Updated to use JITStackFrame abstraction.
11407 (JSC::JIT::emit_op_catch): Filled out.
11409 2009-05-13 Sam Weinig <sam@webkit.org>
11411 Reviewed by Geoffrey Garen.
11413 Implemented op_loop_if_true, op_jfalse, op_jtrue, op_jeq_null and op_jneq_null
11415 * jit/JITOpcodes.cpp:
11416 (JSC::JIT::emitSlow_op_instanceof): Moved from below to be next to its
11419 (JSC::JIT::emit_op_loop_if_true): Similar to the old version
11420 in that it tries to do the integer case first and reduce the
11421 number of jumps you might need to take.
11422 (JSC::JIT::emitSlow_op_loop_if_true):
11424 (JSC::JIT::emit_op_jfalse): Very similar to op_loop_if_true, only
11425 the inverse and without a timeout check.
11426 (JSC::JIT::emitSlow_op_jfalse):
11428 (JSC::JIT::emit_op_jtrue): Very similar to op_loop_if_true except
11429 without the timeout check.
11430 (JSC::JIT::emitSlow_op_jtrue):
11432 (JSC::JIT::emit_op_jeq_null): Very similar to the implementation
11433 of op_eq, except it takes jumps instead of copying the condition
11435 (JSC::JIT::emit_op_jneq_null): Ditto but for op_neq.
11437 2009-05-13 Geoffrey Garen <ggaren@apple.com>
11439 Reviewed by Sam Weinig.
11441 Implemented op_call_varargs.
11444 (JSC::JIT::compileOpCallVarargsSetupArgs):
11445 (JSC::JIT::compileOpCallVarargs):
11446 (JSC::JIT::emit_op_call):
11447 (JSC::JIT::emit_op_call_eval):
11448 (JSC::JIT::emit_op_load_varargs):
11449 (JSC::JIT::emit_op_call_varargs):
11450 (JSC::JIT::emit_op_construct):
11451 * jit/JITOpcodes.cpp:
11452 (JSC::JIT::emit_op_jneq_ptr):
11454 2009-05-13 Geoffrey Garen <ggaren@apple.com>
11456 Reviewed by Sam Weinig.
11458 Implemented op_call_eval.
11461 (JSC::JIT::compileOpCallVarargsSetupArgs):
11462 (JSC::JIT::compileOpCall):
11463 * jit/JITStubCall.h:
11464 (JSC::CallEvalJITStub::CallEvalJITStub):
11466 2009-05-13 Sam Weinig <sam@webkit.org>
11468 Reviewed by Gavin Barraclough.
11470 Implemented op_not. (Gavin did most of the work!)
11472 * jit/JITOpcodes.cpp:
11473 (JSC::JIT::emit_op_not):
11474 (JSC::JIT::emitSlow_op_not):
11476 2009-05-13 Geoffrey Garen <ggaren@apple.com>
11478 Reviewed by Sam Weinig.
11480 Implemented op_global_resolve.
11482 * jit/JITOpcodes.cpp:
11483 (JSC::JIT::emit_op_loop_if_less):
11484 (JSC::JIT::emit_op_loop_if_lesseq): Added back accidentally removed
11487 (JSC::JIT::emit_op_resolve_global):
11488 * jit/JITStubs.cpp:
11489 (JSC::JITStubs::cti_op_resolve_global): Pretty similar to the old code,
11490 but we need two reads and a TimesEight step in order to account for the
11494 (JSC::): Slightly tweaked this code to specialize for a JSGlobalObject*,
11495 to avoid having to pass an irrelevant tag pointer to the stub.
11497 2009-05-13 Sam Weinig <sam@webkit.org>
11499 Reviewed by Geoffrey Garen.
11501 Implemented op_to_jsnumber.
11503 * jit/JITOpcodes.cpp:
11504 (JSC::JIT::emit_op_to_jsnumber):
11505 (JSC::JIT::emitSlow_op_to_jsnumber):
11507 2009-05-13 Sam Weinig <sam@webkit.org>
11509 Reviewed by Geoffrey Garen.
11511 Implemented op_convert_this.
11513 * jit/JITOpcodes.cpp:
11514 (JSC::JIT::emit_op_convert_this):
11515 (JSC::JIT::emitSlow_op_convert_this):
11517 2009-05-13 Geoffrey Garen <ggaren@apple.com>
11519 Reviewed by Sam Weinig.
11521 Got basic JS function and constructor calls working.
11524 (JSC::JIT::privateCompileCTIMachineTrampolines):
11527 (JSC::JIT::compileOpCallSetupArgs):
11528 (JSC::JIT::compileOpCallVarargsSetupArgs):
11529 (JSC::JIT::compileOpConstructSetupArgs):
11530 (JSC::JIT::emit_op_ret):
11531 (JSC::JIT::emit_op_construct_verify):
11532 (JSC::JIT::emitSlow_op_construct_verify):
11533 (JSC::JIT::emitSlow_op_call):
11534 (JSC::JIT::emitSlow_op_call_eval):
11535 (JSC::JIT::emitSlow_op_call_varargs):
11536 (JSC::JIT::emitSlow_op_construct):
11537 (JSC::JIT::compileOpCall): Filled out these cases, with call_eval #if'd out.
11539 * jit/JITInlineMethods.h:
11540 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
11541 (JSC::JIT::emitLoad): Restored some legacy "*CTIArg*" functions,
11542 since I wanted to avoid the complexity of revamping the API here while
11543 trying to bring it up. Eventually, we should re-remove all of these functions.
11545 (JSC::JIT::recordJumpTarget): Removed unnecessary macro cruft. You will
11546 not silence me, Sam Weinig! The world will know that you are a crufty,
11547 crufty, crufty programmer!!!
11549 * jit/JITOpcodes.cpp:
11550 * jit/JITStubs.cpp:
11552 * jit/JITStubs.h: Changed up some offsets in the JITStackFrame class, since
11553 and off-by-one error was causing stack misalignment.
11555 2009-05-13 Sam Weinig <sam@webkit.org>
11557 Reviewed by Geoffrey Garen.
11559 Implement op_eq_null and op_neq_null.
11561 * assembler/MacroAssemblerX86Common.h:
11562 (JSC::MacroAssemblerX86Common::set8):
11563 (JSC::MacroAssemblerX86Common::setTest8):
11564 * jit/JITOpcodes.cpp:
11565 (JSC::JIT::emit_op_stricteq):
11566 (JSC::JIT::emitSlow_op_stricteq):
11567 (JSC::JIT::emit_op_nstricteq):
11568 (JSC::JIT::emitSlow_op_nstricteq):
11569 (JSC::JIT::emit_op_eq_null):
11570 (JSC::JIT::emit_op_neq_null):
11573 2009-05-12 Sam Weinig <sam@webkit.org>
11575 Reviewed by Geoffrey Garen.
11577 Implement op_new_error.
11579 * jit/JITOpcodes.cpp:
11580 (JSC::JIT::emit_op_new_error):
11581 * jit/JITStubCall.h:
11582 (JSC::JITStubCall::addArgument): Add a version of addArgument
11583 that takes a constant JSValue.
11585 2009-05-12 Sam Weinig <sam@webkit.org>
11587 Reviewed by Geoffrey Garen.
11589 Remove now unused emitGetVariableObjectRegister and emitPutVariableObjectRegister.
11594 2009-05-12 Sam Weinig <sam@webkit.org>
11596 Reviewed by Geoffrey Garen.
11598 Implement op_to_primitive and op_next_pname.
11600 * jit/JITOpcodes.cpp:
11601 (JSC::JIT::emitSlow_op_construct_verify):
11602 (JSC::JIT::emit_op_to_primitive):
11603 (JSC::JIT::emitSlow_op_to_primitive):
11604 (JSC::JIT::emitSlow_op_loop_if_true):
11605 (JSC::JIT::emit_op_jtrue):
11606 (JSC::JIT::emit_op_next_pname):
11608 2009-05-12 Sam Weinig <sam@webkit.org>
11610 Reviewed by Geoffrey Garen.
11612 Add op_get_global_var, op_put_global_var, emit_op_get_scoped_var, emit_op_put_scoped_var and
11613 op_unexpected_load.
11616 * jit/JITInlineMethods.h:
11617 (JSC::JIT::tagFor):
11618 (JSC::JIT::payloadFor):
11619 (JSC::JIT::emitLoad):
11620 (JSC::JIT::emitStore):
11621 (JSC::JIT::emitLoadReturnValue):
11622 * jit/JITOpcodes.cpp:
11623 (JSC::JIT::emit_op_get_global_var):
11624 (JSC::JIT::emit_op_put_global_var):
11625 (JSC::JIT::emit_op_get_scoped_var):
11626 (JSC::JIT::emit_op_put_scoped_var):
11627 (JSC::JIT::emit_op_unexpected_load):
11629 2009-05-12 Geoffrey Garen <ggaren@apple.com>
11631 Reviewed by Sam Weinig.
11633 Added overflow handling to op_sub.
11636 * jit/JITArithmetic.cpp:
11637 (JSC::JIT::emitSlow_op_sub):
11638 (JSC::JIT::emitSlowSub32InPlaceLeft):
11640 2009-05-12 Sam Weinig <sam@webkit.org>
11642 Reviewed by Geoffrey Garen.
11644 Remove a function call by folding op_get_by_id and op_put_by_id into
11645 their respective compile functions.
11648 * jit/JITPropertyAccess.cpp:
11649 (JSC::JIT::emit_op_get_by_id):
11650 (JSC::JIT::emitSlow_op_get_by_id):
11651 (JSC::JIT::emit_op_put_by_id):
11652 (JSC::JIT::emitSlow_op_put_by_id):
11654 2009-05-12 Sam Weinig <sam@webkit.org>
11656 Reviewed by Geoffrey Garen.
11658 Make JITStubCall work in 64bit by making the stack index
11659 step dependent on the size of void*.
11661 * jit/JITStubCall.h:
11662 (JSC::JITStubCall::JITStubCall):
11663 (JSC::JITStubCall::addArgument):
11665 2009-05-12 Sam Weinig <sam@webkit.org>
11667 Reviewed by Geoffrey Garen.
11669 Implement simple version of property access opcodes
11670 which just call a stub functions.
11672 * jit/JITOpcodes.cpp:
11673 * jit/JITPropertyAccess.cpp:
11674 (JSC::JIT::emitSlow_op_put_by_id):
11675 (JSC::JIT::emitSlow_op_get_by_id):
11676 (JSC::JIT::emit_op_get_by_val):
11677 (JSC::JIT::emitSlow_op_get_by_val):
11678 (JSC::JIT::emit_op_put_by_val):
11679 (JSC::JIT::emitSlow_op_put_by_val):
11680 (JSC::JIT::emit_op_put_by_index):
11681 (JSC::JIT::emit_op_put_getter):
11682 (JSC::JIT::emit_op_put_setter):
11683 (JSC::JIT::emit_op_del_by_id):
11684 (JSC::JIT::compileGetByIdHotPath):
11685 (JSC::JIT::compilePutByIdHotPath):
11686 * jit/JITStubCall.h:
11687 (JSC::JITStubCall::addArgument):
11690 2009-05-12 Geoffrey Garen <ggaren@apple.com>
11692 Reviewed by Sam Weinig.
11694 Added work-around for XCode debugging echo problem.
11699 2009-05-12 Geoffrey Garen <ggaren@apple.com>
11701 Reviewed by Sam Weinig.
11703 Added overflow handling to op_add.
11706 * jit/JITArithmetic.cpp:
11707 (JSC::JIT::emitSlow_op_add):
11708 (JSC::JIT::emitSlowAdd32InPlace):
11710 2009-05-12 Sam Weinig <sam@webkit.org>
11712 Reviewed by Geoffrey Garen.
11714 Add slow cases for op_jnless or emit_op_jnlesseq.
11716 * jit/JITArithmetic.cpp:
11717 (JSC::JIT::emitSlow_op_jnless):
11718 (JSC::JIT::emitSlow_op_jnlesseq):
11720 2009-05-12 Sam Weinig <sam@webkit.org>
11722 Reviewed by Geoffrey Garen.
11724 Add implementations for op_jnless, emit_op_jnlesseq, op_loop_if_less and op_loop_if_lesseq.
11725 No slow cases for op_jnless or emit_op_jnlesseq yet.
11727 * jit/JITArithmetic.cpp:
11728 (JSC::JIT::emit_op_jnless):
11729 (JSC::JIT::emitSlow_op_jnless):
11730 (JSC::JIT::emit_op_jnlesseq):
11731 (JSC::JIT::emitSlow_op_jnlesseq):
11732 * jit/JITOpcodes.cpp:
11733 (JSC::JIT::emit_op_loop_if_less):
11734 (JSC::JIT::emitSlow_op_loop_if_less):
11735 (JSC::JIT::emit_op_loop_if_lesseq):
11736 (JSC::JIT::emitSlow_op_loop_if_lesseq):
11738 2009-05-12 Sam Weinig <sam@webkit.org>
11740 Reviewed by Geoffrey Garen.
11742 Turn the RECORD_JUMP_TARGET macro into an inline function.
11745 * jit/JITInlineMethods.h:
11746 (JSC::JIT::recordJumpTarget):
11747 * jit/JITOpcodes.cpp:
11748 (JSC::JIT::emit_op_jmp):
11749 (JSC::JIT::emit_op_jsr):
11750 (JSC::JIT::emit_op_jmp_scopes):
11752 2009-05-12 Sam Weinig <sam@webkit.org>
11754 Add MacroAssemblerX86Common::set8 to fix the build.
11756 * assembler/MacroAssemblerX86Common.h:
11757 (JSC::MacroAssemblerX86Common::set8):
11759 2009-05-12 Geoffrey Garen <ggaren@apple.com>
11761 Reviewed by Sam Weinig.
11763 Added overflow recovery for pre_inc and pre_dec.
11765 Turned some short-circuit code into early returns, as is the WebKit style.
11767 * jit/JITArithmetic.cpp:
11768 (JSC::JIT::emit_op_post_inc):
11769 (JSC::JIT::emitSlow_op_post_inc):
11770 (JSC::JIT::emit_op_post_dec):
11771 (JSC::JIT::emitSlow_op_post_dec):
11772 (JSC::JIT::emitSlow_op_pre_inc):
11773 (JSC::JIT::emitSlow_op_pre_dec):
11775 2009-05-12 Sam Weinig <sam@webkit.org>
11777 Reviewed by Geoffrey Garen.
11779 Implement op_jmp, op_loop, op_eq and op_neq.
11781 * jit/JITOpcodes.cpp:
11782 (JSC::JIT::emit_op_jmp):
11783 (JSC::JIT::emit_op_loop):
11784 (JSC::JIT::emit_op_eq):
11785 (JSC::JIT::emitSlow_op_eq):
11786 (JSC::JIT::emit_op_neq):
11787 (JSC::JIT::emitSlow_op_neq):
11788 (JSC::JIT::emit_op_enter):
11789 (JSC::JIT::emit_op_enter_with_activation):
11791 2009-05-12 Sam Weinig <sam@webkit.org>
11793 Reviewed by Geoffrey Garen.
11795 Implement the slow cases for arithmetic opcodes.
11797 * jit/JITArithmetic.cpp:
11798 (JSC::JIT::emitSlow_op_lshift):
11799 (JSC::JIT::emitSlow_op_rshift):
11800 (JSC::JIT::emitSlow_op_bitand):
11801 (JSC::JIT::emitSlow_op_bitor):
11802 (JSC::JIT::emitSlow_op_bitxor):
11803 (JSC::JIT::emitSlow_op_bitnot):
11804 (JSC::JIT::emitSlow_op_sub):
11805 (JSC::JIT::emitSlow_op_mul):
11806 (JSC::JIT::emitSlow_op_mod):
11807 (JSC::JIT::emit_op_mod):
11809 2009-05-12 Sam Weinig <sam@webkit.org>
11811 Reviewed by Geoffrey Garen.
11813 Implement op_bitnot.
11815 * assembler/MacroAssemblerX86Common.h:
11816 (JSC::MacroAssemblerX86Common::not32):
11817 * assembler/X86Assembler.h:
11818 (JSC::X86Assembler::notl_m):
11819 * jit/JITArithmetic.cpp:
11820 (JSC::JIT::emit_op_bitnot):
11822 2009-05-12 Sam Weinig <sam@webkit.org>
11824 Reviewed by Geoffrey Garen.
11826 Add arithmetic opcode implementations from the old nitro-extreme branch.
11829 * jit/JITArithmetic.cpp:
11830 (JSC::JIT::emit_op_jnless):
11831 (JSC::JIT::emitSlow_op_jnless):
11832 (JSC::JIT::emit_op_jnlesseq):
11833 (JSC::JIT::emitSlow_op_jnlesseq):
11834 (JSC::JIT::emit_op_lshift):
11835 (JSC::JIT::emitSlow_op_lshift):
11836 (JSC::JIT::emit_op_rshift):
11837 (JSC::JIT::emitSlow_op_rshift):
11838 (JSC::JIT::emit_op_bitand):
11839 (JSC::JIT::emitBitAnd32Constant):
11840 (JSC::JIT::emitBitAnd32InPlace):
11841 (JSC::JIT::emit_op_bitor):
11842 (JSC::JIT::emitSlow_op_bitor):
11843 (JSC::JIT::emitBitOr32Constant):
11844 (JSC::JIT::emitBitOr32InPlace):
11845 (JSC::JIT::emit_op_bitxor):
11846 (JSC::JIT::emitSlow_op_bitxor):
11847 (JSC::JIT::emitBitXor32Constant):
11848 (JSC::JIT::emitBitXor32InPlace):
11849 (JSC::JIT::emit_op_bitnot):
11850 (JSC::JIT::emitSlow_op_bitnot):
11851 (JSC::JIT::emit_op_post_inc):
11852 (JSC::JIT::emitSlow_op_post_inc):
11853 (JSC::JIT::emit_op_post_dec):
11854 (JSC::JIT::emitSlow_op_post_dec):
11855 (JSC::JIT::emit_op_pre_inc):
11856 (JSC::JIT::emitSlow_op_pre_inc):
11857 (JSC::JIT::emit_op_pre_dec):
11858 (JSC::JIT::emitSlow_op_pre_dec):
11859 (JSC::JIT::emit_op_add):
11860 (JSC::JIT::emitAdd32Constant):
11861 (JSC::JIT::emitAdd32InPlace):
11862 (JSC::JIT::emitSlow_op_add):
11863 (JSC::JIT::emit_op_sub):
11864 (JSC::JIT::emitSlow_op_sub):
11865 (JSC::JIT::emitSub32ConstantLeft):
11866 (JSC::JIT::emitSub32ConstantRight):
11867 (JSC::JIT::emitSub32InPlaceLeft):
11868 (JSC::JIT::emitSub32InPlaceRight):
11869 (JSC::JIT::emit_op_mul):
11870 (JSC::JIT::emitSlow_op_mul):
11871 (JSC::JIT::emitMul32Constant):
11872 (JSC::JIT::emitMul32InPlace):
11873 (JSC::JIT::emit_op_mod):
11874 (JSC::JIT::emitSlow_op_mod):
11875 * jit/JITOpcodes.cpp:
11877 2009-05-12 Geoffrey Garen <ggaren@apple.com>
11879 Removed JIT_OPTIMIZE_ARITHMETIC setting, since it was all about 32bit
11880 value representations.
11882 Added JSAPIValueWrapper to the repository.
11885 * jit/JITArithmetic.cpp:
11886 * runtime/JSAPIValueWrapper.cpp: Added.
11887 (JSC::JSAPIValueWrapper::toPrimitive):
11888 (JSC::JSAPIValueWrapper::getPrimitiveNumber):
11889 (JSC::JSAPIValueWrapper::toBoolean):
11890 (JSC::JSAPIValueWrapper::toNumber):
11891 (JSC::JSAPIValueWrapper::toString):
11892 (JSC::JSAPIValueWrapper::toObject):
11893 * runtime/JSAPIValueWrapper.h: Added.
11894 (JSC::JSAPIValueWrapper::value):
11895 (JSC::JSAPIValueWrapper::isAPIValueWrapper):
11896 (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
11897 (JSC::jsAPIValueWrapper):
11900 2009-05-12 Geoffrey Garen <ggaren@apple.com>
11902 Turned on the JIT and got it building and running the most trivial of
11905 All configurable optimizations are turned off, and a few opcodes are ad
11908 So far, I've only merged op_mov and op_end, but some stub-reliant
11909 opcodes work as-is from TOT.
11911 * bytecode/CodeBlock.cpp:
11912 (JSC::CodeBlock::~CodeBlock):
11913 * bytecode/CodeBlock.h:
11915 (JSC::JIT::compileOpStrictEq):
11917 * jit/JITArithmetic.cpp:
11918 (JSC::JIT::emit_op_lshift):
11919 (JSC::JIT::emitSlow_op_lshift):
11920 (JSC::JIT::emit_op_rshift):
11921 (JSC::JIT::emitSlow_op_rshift):
11922 (JSC::JIT::emit_op_jnless):
11923 (JSC::JIT::emitSlow_op_jnless):
11924 (JSC::JIT::emit_op_jnlesseq):
11925 (JSC::JIT::emitSlow_op_jnlesseq):
11926 (JSC::JIT::emit_op_bitand):
11927 (JSC::JIT::emitSlow_op_bitand):
11928 (JSC::JIT::emit_op_post_inc):
11929 (JSC::JIT::emitSlow_op_post_inc):
11930 (JSC::JIT::emit_op_post_dec):
11931 (JSC::JIT::emitSlow_op_post_dec):
11932 (JSC::JIT::emit_op_pre_inc):
11933 (JSC::JIT::emitSlow_op_pre_inc):
11934 (JSC::JIT::emit_op_pre_dec):
11935 (JSC::JIT::emitSlow_op_pre_dec):
11936 (JSC::JIT::emit_op_mod):
11937 (JSC::JIT::emitSlow_op_mod):
11938 (JSC::JIT::emit_op_add):
11939 (JSC::JIT::emit_op_mul):
11940 (JSC::JIT::emit_op_sub):
11941 (JSC::JIT::compileBinaryArithOpSlowCase):
11942 (JSC::JIT::emitSlow_op_add):
11943 (JSC::JIT::emitSlow_op_mul):
11945 (JSC::JIT::compileOpCallInitializeCallFrame):
11946 (JSC::JIT::compileOpConstructSetupArgs):
11947 (JSC::JIT::compileOpCallVarargs):
11948 (JSC::JIT::compileOpCall):
11949 (JSC::JIT::compileOpCallSlowCase):
11950 * jit/JITInlineMethods.h:
11951 (JSC::JIT::getConstantOperandImmediateInt):
11952 (JSC::JIT::isOperandConstantImmediateInt):
11953 (JSC::JIT::emitInitRegister):
11954 (JSC::JIT::addSlowCase):
11955 (JSC::JIT::addJump):
11956 (JSC::JIT::emitJumpSlowToHot):
11957 (JSC::JIT::tagFor):
11958 (JSC::JIT::payloadFor):
11959 (JSC::JIT::emitLoad):
11960 (JSC::JIT::emitLoadReturnValue):
11961 (JSC::JIT::emitStore):
11962 (JSC::JIT::emitStoreReturnValue):
11963 * jit/JITOpcodes.cpp:
11964 (JSC::JIT::emit_op_mov):
11965 (JSC::JIT::emit_op_end):
11966 (JSC::JIT::emit_op_jmp):
11967 (JSC::JIT::emit_op_loop):
11968 (JSC::JIT::emit_op_loop_if_less):
11969 (JSC::JIT::emit_op_loop_if_lesseq):
11970 (JSC::JIT::emit_op_instanceof):
11971 (JSC::JIT::emit_op_get_global_var):
11972 (JSC::JIT::emit_op_put_global_var):
11973 (JSC::JIT::emit_op_get_scoped_var):
11974 (JSC::JIT::emit_op_put_scoped_var):
11975 (JSC::JIT::emit_op_tear_off_activation):
11976 (JSC::JIT::emit_op_ret):
11977 (JSC::JIT::emit_op_construct_verify):
11978 (JSC::JIT::emit_op_to_primitive):
11979 (JSC::JIT::emit_op_loop_if_true):
11980 (JSC::JIT::emit_op_resolve_global):
11981 (JSC::JIT::emit_op_not):
11982 (JSC::JIT::emit_op_jfalse):
11983 (JSC::JIT::emit_op_jeq_null):
11984 (JSC::JIT::emit_op_jneq_null):
11985 (JSC::JIT::emit_op_jneq_ptr):
11986 (JSC::JIT::emit_op_unexpected_load):
11987 (JSC::JIT::emit_op_eq):
11988 (JSC::JIT::emit_op_bitnot):
11989 (JSC::JIT::emit_op_jtrue):
11990 (JSC::JIT::emit_op_neq):
11991 (JSC::JIT::emit_op_bitxor):
11992 (JSC::JIT::emit_op_bitor):
11993 (JSC::JIT::emit_op_throw):
11994 (JSC::JIT::emit_op_next_pname):
11995 (JSC::JIT::emit_op_push_scope):
11996 (JSC::JIT::emit_op_to_jsnumber):
11997 (JSC::JIT::emit_op_push_new_scope):
11998 (JSC::JIT::emit_op_catch):
11999 (JSC::JIT::emit_op_switch_imm):
12000 (JSC::JIT::emit_op_switch_char):
12001 (JSC::JIT::emit_op_switch_string):
12002 (JSC::JIT::emit_op_new_error):
12003 (JSC::JIT::emit_op_eq_null):
12004 (JSC::JIT::emit_op_neq_null):
12005 (JSC::JIT::emit_op_convert_this):
12006 (JSC::JIT::emit_op_profile_will_call):
12007 (JSC::JIT::emit_op_profile_did_call):
12008 (JSC::JIT::emitSlow_op_construct_verify):
12009 (JSC::JIT::emitSlow_op_get_by_val):
12010 (JSC::JIT::emitSlow_op_loop_if_less):
12011 (JSC::JIT::emitSlow_op_loop_if_lesseq):
12012 (JSC::JIT::emitSlow_op_put_by_val):
12013 (JSC::JIT::emitSlow_op_not):
12014 (JSC::JIT::emitSlow_op_instanceof):
12015 * jit/JITPropertyAccess.cpp:
12016 (JSC::JIT::emit_op_get_by_val):
12017 (JSC::JIT::emit_op_put_by_val):
12018 (JSC::JIT::emit_op_put_by_index):
12019 (JSC::JIT::emit_op_put_getter):
12020 (JSC::JIT::emit_op_put_setter):
12021 (JSC::JIT::emit_op_del_by_id):
12022 (JSC::JIT::compileGetByIdHotPath):
12023 (JSC::JIT::compilePutByIdHotPath):
12024 * jit/JITStubCall.h:
12025 (JSC::JITStubCall::JITStubCall):
12026 (JSC::JITStubCall::addArgument):
12027 (JSC::JITStubCall::call):
12028 (JSC::JITStubCall::):
12029 (JSC::CallEvalJITStub::CallEvalJITStub):
12030 * jit/JITStubs.cpp:
12032 (JSC::JITStubs::cti_op_add):
12033 (JSC::JITStubs::cti_op_pre_inc):
12034 (JSC::JITStubs::cti_op_mul):
12035 (JSC::JITStubs::cti_op_get_by_val):
12036 (JSC::JITStubs::cti_op_get_by_val_string):
12037 (JSC::JITStubs::cti_op_get_by_val_byte_array):
12038 (JSC::JITStubs::cti_op_sub):
12039 (JSC::JITStubs::cti_op_put_by_val):
12040 (JSC::JITStubs::cti_op_put_by_val_array):
12041 (JSC::JITStubs::cti_op_put_by_val_byte_array):
12042 (JSC::JITStubs::cti_op_negate):
12043 (JSC::JITStubs::cti_op_div):
12044 (JSC::JITStubs::cti_op_pre_dec):
12045 (JSC::JITStubs::cti_op_post_inc):
12046 (JSC::JITStubs::cti_op_eq):
12047 (JSC::JITStubs::cti_op_lshift):
12048 (JSC::JITStubs::cti_op_bitand):
12049 (JSC::JITStubs::cti_op_rshift):
12050 (JSC::JITStubs::cti_op_bitnot):
12051 (JSC::JITStubs::cti_op_mod):
12052 (JSC::JITStubs::cti_op_neq):
12053 (JSC::JITStubs::cti_op_post_dec):
12054 (JSC::JITStubs::cti_op_urshift):
12055 (JSC::JITStubs::cti_op_bitxor):
12056 (JSC::JITStubs::cti_op_bitor):
12057 (JSC::JITStubs::cti_op_switch_imm):
12059 * runtime/JSArray.cpp:
12060 (JSC::JSArray::JSArray):
12061 * runtime/JSFunction.cpp:
12062 (JSC::JSFunction::~JSFunction):
12063 * runtime/JSValue.h:
12064 (JSC::JSValue::payload):
12067 2009-05-07 Sam Weinig <sam@webkit.org>
12069 Reviewed by Geoffrey Garen.
12071 Add some new MacroAssembler and assembler functions that will be needed shortly.
12073 * assembler/MacroAssemblerX86Common.h:
12074 (JSC::MacroAssemblerX86Common::add32):
12075 (JSC::MacroAssemblerX86Common::and32):
12076 (JSC::MacroAssemblerX86Common::mul32):
12077 (JSC::MacroAssemblerX86Common::neg32):
12078 (JSC::MacroAssemblerX86Common::or32):
12079 (JSC::MacroAssemblerX86Common::sub32):
12080 (JSC::MacroAssemblerX86Common::xor32):
12081 (JSC::MacroAssemblerX86Common::branchAdd32):
12082 (JSC::MacroAssemblerX86Common::branchMul32):
12083 (JSC::MacroAssemblerX86Common::branchSub32):
12084 * assembler/X86Assembler.h:
12085 (JSC::X86Assembler::):
12086 (JSC::X86Assembler::addl_rm):
12087 (JSC::X86Assembler::andl_mr):
12088 (JSC::X86Assembler::andl_rm):
12089 (JSC::X86Assembler::andl_im):
12090 (JSC::X86Assembler::negl_r):
12091 (JSC::X86Assembler::notl_r):
12092 (JSC::X86Assembler::orl_rm):
12093 (JSC::X86Assembler::orl_im):
12094 (JSC::X86Assembler::subl_rm):
12095 (JSC::X86Assembler::xorl_mr):
12096 (JSC::X86Assembler::xorl_rm):
12097 (JSC::X86Assembler::xorl_im):
12098 (JSC::X86Assembler::imull_mr):
12100 2009-05-11 Sam Weinig <sam@webkit.org>
12102 Reviewed by Cameron Zwarich.
12104 Remove the NumberHeap.
12106 * JavaScriptCore.exp:
12107 * runtime/Collector.cpp:
12109 (JSC::Heap::destroy):
12110 (JSC::Heap::recordExtraCost):
12111 (JSC::Heap::heapAllocate):
12112 (JSC::Heap::markConservatively):
12113 (JSC::Heap::sweep):
12114 (JSC::Heap::collect):
12115 (JSC::Heap::objectCount):
12116 (JSC::Heap::statistics):
12118 (JSC::Heap::isBusy):
12119 * runtime/Collector.h:
12120 (JSC::Heap::globalData):
12121 * runtime/JSCell.h:
12123 2009-05-11 Geoffrey Garen <ggaren@apple.com>
12125 Reviewed by Sam Weinig.
12127 Land initial commit of new number representation for 32 bit platforms,
12133 * API/JSCallbackObjectFunctions.h:
12134 (JSC::::hasInstance):
12137 * API/tests/testapi.c:
12138 (EvilExceptionObject_convertToType):
12139 * AllInOneFile.cpp:
12140 * JavaScriptCore.exp:
12141 * JavaScriptCore.xcodeproj/project.pbxproj:
12142 * bytecode/CodeBlock.cpp:
12143 (JSC::valueToSourceString):
12144 * bytecompiler/BytecodeGenerator.cpp:
12145 (JSC::BytecodeGenerator::emitLoad):
12146 (JSC::BytecodeGenerator::emitUnexpectedLoad):
12147 (JSC::keyForImmediateSwitch):
12148 * bytecompiler/BytecodeGenerator.h:
12149 * interpreter/Interpreter.cpp:
12150 (JSC::Interpreter::dumpRegisters):
12151 (JSC::Interpreter::privateExecute):
12152 * parser/Nodes.cpp:
12153 (JSC::ArrayNode::emitBytecode):
12154 (JSC::processClauseList):
12155 * runtime/ArgList.h:
12156 * runtime/Collector.h:
12158 * runtime/DateMath.cpp:
12159 * runtime/ExceptionHelpers.h:
12160 * runtime/InitializeThreading.cpp:
12161 * runtime/JSArray.cpp:
12162 (JSC::JSArray::JSArray):
12163 * runtime/JSCell.cpp:
12164 * runtime/JSCell.h:
12165 (JSC::JSCell::isAPIValueWrapper):
12166 (JSC::JSValue::isString):
12167 (JSC::JSValue::isGetterSetter):
12168 (JSC::JSValue::isObject):
12169 (JSC::JSValue::getString):
12170 (JSC::JSValue::getObject):
12171 (JSC::JSValue::getCallData):
12172 (JSC::JSValue::getConstructData):
12173 (JSC::JSValue::getUInt32):
12174 (JSC::JSValue::marked):
12175 (JSC::JSValue::toPrimitive):
12176 (JSC::JSValue::getPrimitiveNumber):
12177 (JSC::JSValue::toBoolean):
12178 (JSC::JSValue::toNumber):
12179 (JSC::JSValue::toString):
12180 (JSC::JSValue::needsThisConversion):
12181 (JSC::JSValue::toThisString):
12182 (JSC::JSValue::getJSNumber):
12183 (JSC::JSValue::toObject):
12184 (JSC::JSValue::toThisObject):
12185 * runtime/JSGlobalData.cpp:
12186 (JSC::JSGlobalData::JSGlobalData):
12187 * runtime/JSGlobalData.h:
12188 * runtime/JSGlobalObject.h:
12189 (JSC::Structure::prototypeForLookup):
12190 * runtime/JSGlobalObjectFunctions.cpp:
12191 (JSC::globalFuncParseInt):
12192 * runtime/JSImmediate.h:
12193 * runtime/JSNumberCell.cpp: Removed.
12194 * runtime/JSNumberCell.h: Removed.
12195 * runtime/JSObject.h:
12196 (JSC::JSValue::get):
12197 (JSC::JSValue::put):
12198 * runtime/JSString.h:
12199 (JSC::JSValue::toThisJSString):
12200 * runtime/JSValue.cpp:
12201 (JSC::JSValue::toInteger):
12202 (JSC::JSValue::toIntegerPreserveNaN):
12203 (JSC::JSValue::toObjectSlowCase):
12204 (JSC::JSValue::toThisObjectSlowCase):
12205 (JSC::JSValue::synthesizeObject):
12206 (JSC::JSValue::synthesizePrototype):
12207 (JSC::JSValue::description):
12208 (JSC::nonInlineNaN):
12209 * runtime/JSValue.h:
12211 (JSC::EncodedJSValueHashTraits::emptyValue):
12217 (JSC::JSValue::encode):
12218 (JSC::JSValue::decode):
12219 (JSC::JSValue::JSValue):
12220 (JSC::JSValue::operator bool):
12221 (JSC::JSValue::operator==):
12222 (JSC::JSValue::operator!=):
12223 (JSC::JSValue::isUndefined):
12224 (JSC::JSValue::isNull):
12225 (JSC::JSValue::isUndefinedOrNull):
12226 (JSC::JSValue::isCell):
12227 (JSC::JSValue::isInt32):
12228 (JSC::JSValue::isUInt32):
12229 (JSC::JSValue::isDouble):
12230 (JSC::JSValue::isTrue):
12231 (JSC::JSValue::isFalse):
12232 (JSC::JSValue::tag):
12233 (JSC::JSValue::asInt32):
12234 (JSC::JSValue::asUInt32):
12235 (JSC::JSValue::asDouble):
12236 (JSC::JSValue::asCell):
12237 (JSC::JSValue::isNumber):
12238 (JSC::JSValue::isBoolean):
12239 (JSC::JSValue::getBoolean):
12240 (JSC::JSValue::uncheckedGetNumber):
12241 (JSC::JSValue::toJSNumber):
12242 (JSC::JSValue::getNumber):
12243 (JSC::JSValue::toInt32):
12244 (JSC::JSValue::toUInt32):
12245 * runtime/Operations.h:
12246 (JSC::JSValue::equal):
12247 (JSC::JSValue::equalSlowCaseInline):
12248 (JSC::JSValue::strictEqual):
12249 (JSC::JSValue::strictEqualSlowCaseInline):
12253 * runtime/PropertySlot.h:
12254 * runtime/StringPrototype.cpp:
12255 (JSC::stringProtoFuncCharAt):
12256 (JSC::stringProtoFuncCharCodeAt):
12257 (JSC::stringProtoFuncIndexOf):
12260 === Start merge of nitro-extreme branch 2009-07-30 ===
12262 2009-07-29 Laszlo Gombos <laszlo.1.gombos@nokia.com>
12264 Reviewed by George Staikos.
12266 Resolve class/struct mixup in forward declarations
12267 https://bugs.webkit.org/show_bug.cgi?id=27708
12269 * API/JSClassRef.h:
12270 * bytecode/SamplingTool.h:
12271 * interpreter/Interpreter.h:
12273 * profiler/ProfileGenerator.h:
12274 * profiler/Profiler.h:
12275 * runtime/ClassInfo.h:
12276 * runtime/ExceptionHelpers.h:
12277 * runtime/JSByteArray.h:
12278 * runtime/JSCell.h:
12279 * runtime/JSFunction.h:
12280 * runtime/JSGlobalData.h:
12281 * runtime/JSObject.h:
12282 * runtime/JSString.h:
12284 2009-07-28 Ada Chan <adachan@apple.com>
12286 Reviewed by Darin Adler.
12288 https://bugs.webkit.org/show_bug.cgi?id=27236
12289 - Implement TCMalloc_SystemRelease and TCMalloc_SystemCommit for Windows.
12290 - Use a background thread to periodically scavenge memory to release back to the system.
12292 * wtf/FastMalloc.cpp:
12293 (WTF::TCMalloc_PageHeap::init):
12294 (WTF::TCMalloc_PageHeap::runScavengerThread):
12295 (WTF::TCMalloc_PageHeap::scavenge):
12296 (WTF::TCMalloc_PageHeap::shouldContinueScavenging):
12297 (WTF::TCMalloc_PageHeap::New):
12298 (WTF::TCMalloc_PageHeap::AllocLarge):
12299 (WTF::TCMalloc_PageHeap::Delete):
12300 (WTF::TCMalloc_PageHeap::GrowHeap):
12302 (WTF::TCMalloc_PageHeap::scavengerThread):
12303 * wtf/TCSystemAlloc.cpp:
12304 (TCMalloc_SystemRelease):
12305 (TCMalloc_SystemCommit):
12306 * wtf/TCSystemAlloc.h:
12308 2009-07-28 Xan Lopez <xlopez@igalia.com>
12310 Add new files, fixes distcheck.
12314 2009-07-28 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
12316 Reviewed by Simon Hausmann.
12318 [Qt] Determining whether to use JIT or interpreter
12319 moved from JavaScriptCore.pri to Platform.h
12321 * JavaScriptCore.pri:
12324 2009-07-27 Brian Weinstein <bweinstein@apple.com>
12326 Fix of misuse of sort command.
12328 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12329 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
12331 2009-07-27 Brian Weinstein <bweinstein@apple.com>
12333 Build fix for Windows.
12335 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12336 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
12338 2009-07-27 Gavin Barraclough <barraclough@apple.com>
12340 Rubber stamped by Oliver Hunt.
12342 Fix tyop in JIT, renamed preverveReturnAddressAfterCall -> preserveReturnAddressAfterCall.
12345 (JSC::JIT::privateCompile):
12346 (JSC::JIT::privateCompileCTIMachineTrampolines):
12348 * jit/JITInlineMethods.h:
12349 (JSC::JIT::preserveReturnAddressAfterCall):
12350 * jit/JITPropertyAccess.cpp:
12351 (JSC::JIT::privateCompilePutByIdTransition):
12353 2009-07-27 Alexey Proskuryakov <ap@webkit.org>
12357 * runtime/JSLock.cpp: (JSC::JSLock::JSLock): Fix "no threading" case.
12359 2009-07-27 Alexey Proskuryakov <ap@webkit.org>
12363 * runtime/JSLock.h: (JSC::JSLock::~JSLock):
12365 2009-07-27 Alexey Proskuryakov <ap@webkit.org>
12367 Reviewed by Darin Adler.
12369 https://bugs.webkit.org/show_bug.cgi?id=27735
12370 Give a helpful name to JSLock constructor argument
12373 (JSGarbageCollect):
12374 * API/JSContextRef.cpp:
12375 * API/JSObjectRef.cpp:
12376 (JSPropertyNameArrayRelease):
12377 (JSPropertyNameAccumulatorAddName):
12378 * JavaScriptCore.exp:
12381 (cleanupGlobalData):
12383 * runtime/Collector.cpp:
12384 (JSC::Heap::destroy):
12385 * runtime/JSLock.cpp:
12386 (JSC::JSLock::JSLock):
12387 (JSC::JSLock::lock):
12388 (JSC::JSLock::unlock):
12389 (JSC::JSLock::DropAllLocks::DropAllLocks):
12390 (JSC::JSLock::DropAllLocks::~DropAllLocks):
12391 * runtime/JSLock.h:
12393 (JSC::JSLock::JSLock):
12394 (JSC::JSLock::~JSLock):
12396 2009-07-25 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
12398 Reviewed by Eric Seidel.
12400 Allow custom memory allocation control for OpaqueJSPropertyNameArray struct
12401 https://bugs.webkit.org/show_bug.cgi?id=27342
12403 Inherits OpaqueJSPropertyNameArray struct from FastAllocBase because it has been
12404 instantiated by 'new' JavaScriptCore/API/JSObjectRef.cpp:473.
12406 * API/JSObjectRef.cpp:
12408 2009-07-24 Ada Chan <adachan@apple.com>
12410 In preparation for https://bugs.webkit.org/show_bug.cgi?id=27236:
12411 Remove TCMALLOC_TRACK_DECOMMITED_SPANS. We'll always track decommitted spans.
12412 We have tested this and show it has little impact on performance.
12414 Reviewed by Mark Rowe.
12416 * wtf/FastMalloc.cpp:
12417 (WTF::TCMalloc_PageHeap::New):
12418 (WTF::TCMalloc_PageHeap::AllocLarge):
12419 (WTF::propagateDecommittedState):
12420 (WTF::mergeDecommittedStates):
12421 (WTF::TCMalloc_PageHeap::Delete):
12422 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
12424 2009-07-24 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
12426 Reviewed by Darin Adler and Adam Barth.
12428 Build fix for x86 platforms.
12429 https://bugs.webkit.org/show_bug.cgi?id=27602
12433 2009-07-23 Kevin Ollivier <kevino@theolliviers.com>
12435 wx build fix, adding missing header.
12439 2009-07-22 Yong Li <yong.li@torchmobile.com>
12441 Reviewed by George Staikos.
12443 Add wince specific memory files into wtf/wince
12444 https://bugs.webkit.org/show_bug.cgi?id=27550
12446 * wtf/wince/FastMallocWince.h: Added.
12447 * wtf/wince/MemoryManager.cpp: Added.
12448 * wtf/wince/MemoryManager.h: Added.
12450 2009-07-23 Norbert Leser <norbert.leser@nokia.com>
12452 Reviewed by Simon Hausmann.
12454 Fix for missing mmap features in Symbian
12455 https://bugs.webkit.org/show_bug.cgi?id=24540
12457 Fix, conditionally for PLATFORM(SYMBIAN), as an alternative
12458 to missing support for the MAP_ANON property flag in mmap.
12459 It utilizes Symbian specific memory allocation features.
12461 * runtime/Collector.cpp
12463 2009-07-22 Gavin Barraclough <barraclough@apple.com>
12465 Reviewed by Sam Weinig.
12467 With ENABLE(ASSEMBLER_WX_EXCLUSIVE), only change permissions once per repatch event.
12468 ( https://bugs.webkit.org/show_bug.cgi?id=27564 )
12470 Currently we change permissions forwards and backwards for each instruction modified,
12471 instead we should only change permissions once per complete repatching event.
12473 2.5% progression running with ENABLE(ASSEMBLER_WX_EXCLUSIVE) enabled,
12474 which recoups 1/3 of the penalty of running with this mode enabled.
12476 * assembler/ARMAssembler.cpp:
12477 (JSC::ARMAssembler::linkBranch):
12478 - Replace usage of MakeWritable with cacheFlush.
12480 * assembler/ARMAssembler.h:
12481 (JSC::ARMAssembler::patchPointerInternal):
12482 (JSC::ARMAssembler::repatchLoadPtrToLEA):
12483 - Replace usage of MakeWritable with cacheFlush.
12485 * assembler/ARMv7Assembler.h:
12486 (JSC::ARMv7Assembler::relinkJump):
12487 (JSC::ARMv7Assembler::relinkCall):
12488 (JSC::ARMv7Assembler::repatchInt32):
12489 (JSC::ARMv7Assembler::repatchPointer):
12490 (JSC::ARMv7Assembler::repatchLoadPtrToLEA):
12491 (JSC::ARMv7Assembler::setInt32):
12492 - Replace usage of MakeWritable with cacheFlush.
12494 * assembler/LinkBuffer.h:
12495 (JSC::LinkBuffer::performFinalization):
12496 - Make explicit call to cacheFlush.
12498 * assembler/MacroAssemblerCodeRef.h:
12499 (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
12500 - Make size always available.
12502 * assembler/RepatchBuffer.h:
12503 (JSC::RepatchBuffer::RepatchBuffer):
12504 (JSC::RepatchBuffer::~RepatchBuffer):
12505 - Add calls to MakeWritable & makeExecutable.
12507 * assembler/X86Assembler.h:
12508 (JSC::X86Assembler::relinkJump):
12509 (JSC::X86Assembler::relinkCall):
12510 (JSC::X86Assembler::repatchInt32):
12511 (JSC::X86Assembler::repatchPointer):
12512 (JSC::X86Assembler::repatchLoadPtrToLEA):
12513 - Remove usage of MakeWritable.
12515 * bytecode/CodeBlock.h:
12516 (JSC::CodeBlock::getJITCode):
12517 - Provide access to CodeBlock's JITCode.
12519 * jit/ExecutableAllocator.h:
12520 (JSC::ExecutableAllocator::makeExecutable):
12521 (JSC::ExecutableAllocator::cacheFlush):
12522 - Remove MakeWritable, make cacheFlush public.
12525 (JSC::ctiPatchNearCallByReturnAddress):
12526 (JSC::ctiPatchCallByReturnAddress):
12527 (JSC::JIT::privateCompile):
12528 (JSC::JIT::unlinkCall):
12529 (JSC::JIT::linkCall):
12530 - Add CodeBlock argument to RepatchBuffer.
12533 - Pass CodeBlock argument for use by RepatchBuffer.
12536 (JSC::JITCode::start):
12537 (JSC::JITCode::size):
12538 - Provide access to code start & size.
12540 * jit/JITPropertyAccess.cpp:
12541 (JSC::JIT::privateCompilePutByIdTransition):
12542 (JSC::JIT::patchGetByIdSelf):
12543 (JSC::JIT::patchMethodCallProto):
12544 (JSC::JIT::patchPutByIdReplace):
12545 (JSC::JIT::privateCompilePatchGetArrayLength):
12546 (JSC::JIT::privateCompileGetByIdProto):
12547 (JSC::JIT::privateCompileGetByIdSelfList):
12548 (JSC::JIT::privateCompileGetByIdProtoList):
12549 (JSC::JIT::privateCompileGetByIdChainList):
12550 (JSC::JIT::privateCompileGetByIdChain):
12551 - Add CodeBlock argument to RepatchBuffer.
12553 * jit/JITStubs.cpp:
12554 (JSC::JITThunks::tryCachePutByID):
12555 (JSC::JITThunks::tryCacheGetByID):
12556 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
12557 - Pass CodeBlock argument for use by RepatchBuffer.
12559 2009-07-21 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
12561 Reviewed by Gavin Barraclough.
12563 Cache not only the structure of the method, but the
12564 structure of its prototype as well.
12565 https://bugs.webkit.org/show_bug.cgi?id=27077
12567 * bytecode/CodeBlock.cpp:
12568 (JSC::CodeBlock::~CodeBlock):
12569 * bytecode/CodeBlock.h:
12570 (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
12571 * jit/JITPropertyAccess.cpp:
12572 (JSC::JIT::patchMethodCallProto):
12574 2009-07-21 Gavin Barraclough <barraclough@apple.com>
12576 Reviewed by Sam Weinig.
12578 Move call linking / repatching down from AbstractMacroAssembler into MacroAssemblerARCH classes.
12579 ( https://bugs.webkit.org/show_bug.cgi?id=27527 )
12581 This allows the implementation to be defined per architecture. Specifically this addresses the
12582 fact that x86-64 MacroAssembler implements far calls as a load to register, followed by a call
12583 to register. Patching the call actually requires the pointer load to be patched, rather than
12584 the call to be patched. This is implementation detail specific to MacroAssemblerX86_64, and as
12585 such is best handled there.
12587 * assembler/AbstractMacroAssembler.h:
12588 * assembler/MacroAssemblerARM.h:
12589 (JSC::MacroAssemblerARM::linkCall):
12590 (JSC::MacroAssemblerARM::repatchCall):
12591 * assembler/MacroAssemblerARMv7.h:
12592 (JSC::MacroAssemblerARMv7::linkCall):
12593 (JSC::MacroAssemblerARMv7::repatchCall):
12594 * assembler/MacroAssemblerX86.h:
12595 (JSC::MacroAssemblerX86::linkCall):
12596 (JSC::MacroAssemblerX86::repatchCall):
12597 * assembler/MacroAssemblerX86_64.h:
12598 (JSC::MacroAssemblerX86_64::linkCall):
12599 (JSC::MacroAssemblerX86_64::repatchCall):
12601 2009-07-21 Adam Treat <adam.treat@torchmobile.com>
12603 Reviewed by George Staikos.
12605 Every wtf file includes other wtf files with <> style includes
12606 except this one. Fix the exception.
12610 2009-07-21 Gavin Barraclough <barraclough@apple.com>
12612 Reviewed by Oliver Hunt.
12614 Move LinkBuffer/RepatchBuffer out of AbstractMacroAssembler.
12615 ( https://bugs.webkit.org/show_bug.cgi?id=27485 )
12617 This change is the first step in a process to move code that should be in
12618 the architecture-specific MacroAssembler classes up out of Assmbler and
12619 AbstractMacroAssembler.
12621 * JavaScriptCore.xcodeproj/project.pbxproj:
12624 * assembler/ARMAssembler.h:
12625 (JSC::ARMAssembler::linkPointer):
12626 - rename patchPointer to bring it in line with the current link/repatch naming scheme
12628 * assembler/ARMv7Assembler.h:
12629 (JSC::ARMv7Assembler::linkCall):
12630 (JSC::ARMv7Assembler::linkPointer):
12631 (JSC::ARMv7Assembler::relinkCall):
12632 (JSC::ARMv7Assembler::repatchInt32):
12633 (JSC::ARMv7Assembler::repatchPointer):
12634 (JSC::ARMv7Assembler::setInt32):
12635 (JSC::ARMv7Assembler::setPointer):
12636 - rename patchPointer to bring it in line with the current link/repatch naming scheme
12638 * assembler/AbstractMacroAssembler.h:
12639 (JSC::AbstractMacroAssembler::linkJump):
12640 (JSC::AbstractMacroAssembler::linkCall):
12641 (JSC::AbstractMacroAssembler::linkPointer):
12642 (JSC::AbstractMacroAssembler::getLinkerAddress):
12643 (JSC::AbstractMacroAssembler::getLinkerCallReturnOffset):
12644 (JSC::AbstractMacroAssembler::repatchJump):
12645 (JSC::AbstractMacroAssembler::repatchCall):
12646 (JSC::AbstractMacroAssembler::repatchNearCall):
12647 (JSC::AbstractMacroAssembler::repatchInt32):
12648 (JSC::AbstractMacroAssembler::repatchPointer):
12649 (JSC::AbstractMacroAssembler::repatchLoadPtrToLEA):
12650 - remove the LinkBuffer/RepatchBuffer classes, but leave a set of (private, friended) methods to interface to the Assembler
12652 * assembler/LinkBuffer.h: Added.
12653 (JSC::LinkBuffer::LinkBuffer):
12654 (JSC::LinkBuffer::~LinkBuffer):
12655 (JSC::LinkBuffer::link):
12656 (JSC::LinkBuffer::patch):
12657 (JSC::LinkBuffer::locationOf):
12658 (JSC::LinkBuffer::locationOfNearCall):
12659 (JSC::LinkBuffer::returnAddressOffset):
12660 (JSC::LinkBuffer::finalizeCode):
12661 (JSC::LinkBuffer::finalizeCodeAddendum):
12662 (JSC::LinkBuffer::code):
12663 (JSC::LinkBuffer::performFinalization):
12664 - new file containing the LinkBuffer class, previously a member of AbstractMacroAssembler
12666 * assembler/RepatchBuffer.h: Added.
12667 (JSC::RepatchBuffer::RepatchBuffer):
12668 (JSC::RepatchBuffer::relink):
12669 (JSC::RepatchBuffer::repatch):
12670 (JSC::RepatchBuffer::repatchLoadPtrToLEA):
12671 (JSC::RepatchBuffer::relinkCallerToTrampoline):
12672 (JSC::RepatchBuffer::relinkCallerToFunction):
12673 (JSC::RepatchBuffer::relinkNearCallerToTrampoline):
12674 - new file containing the RepatchBuffer class, previously a member of AbstractMacroAssembler
12676 * assembler/X86Assembler.h:
12677 (JSC::X86Assembler::linkJump):
12678 (JSC::X86Assembler::linkCall):
12679 (JSC::X86Assembler::linkPointerForCall):
12680 (JSC::X86Assembler::linkPointer):
12681 (JSC::X86Assembler::relinkJump):
12682 (JSC::X86Assembler::relinkCall):
12683 (JSC::X86Assembler::repatchInt32):
12684 (JSC::X86Assembler::repatchPointer):
12685 (JSC::X86Assembler::setPointer):
12686 (JSC::X86Assembler::setInt32):
12687 (JSC::X86Assembler::setRel32):
12688 - rename patchPointer to bring it in line with the current link/repatch naming scheme
12691 (JSC::ctiPatchNearCallByReturnAddress):
12692 (JSC::ctiPatchCallByReturnAddress):
12693 - include new headers
12694 - remove MacroAssembler:: specification from RepatchBuffer usage
12696 * jit/JITPropertyAccess.cpp:
12697 * yarr/RegexJIT.cpp:
12698 - include new headers
12700 2009-07-21 Robert Agoston <Agoston.Robert@stud.u-szeged.hu>
12702 Reviewed by David Levin.
12705 https://bugs.webkit.org/show_bug.cgi?id=27506
12707 * bytecode/Opcode.h:
12709 2009-07-21 Adam Roben <aroben@apple.com>
12711 Roll out r46153, r46154, and r46155
12713 These changes were causing build failures and assertion failures on
12716 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12717 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
12718 * JavaScriptCore.xcodeproj/project.pbxproj:
12719 * runtime/JSArray.cpp:
12720 * runtime/StringPrototype.cpp:
12721 * runtime/UString.cpp:
12722 * runtime/UString.h:
12723 * wtf/FastMalloc.cpp:
12724 * wtf/FastMalloc.h:
12726 * wtf/PossiblyNull.h: Removed.
12728 2009-07-21 Roland Steiner <rolandsteiner@google.com>
12730 Reviewed by David Levin.
12732 Add ENABLE_RUBY to list of build options
12733 https://bugs.webkit.org/show_bug.cgi?id=27324
12735 * Configurations/FeatureDefines.xcconfig: Added flag ENABLE_RUBY.
12737 2009-07-20 Oliver Hunt <oliver@apple.com>
12739 Build fix attempt #2
12741 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12742 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
12744 2009-07-20 Oliver Hunt <oliver@apple.com>
12746 Build fix attempt #1
12748 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12749 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
12751 2009-07-20 Oliver Hunt <oliver@apple.com>
12753 Reviewed by Gavin Barraclough.
12755 Make it harder to misuse try* allocation routines
12756 https://bugs.webkit.org/show_bug.cgi?id=27469
12758 Jump through a few hoops to make it much harder to accidentally
12759 miss null-checking of values returned by the try-* allocation
12762 * JavaScriptCore.xcodeproj/project.pbxproj:
12763 * runtime/JSArray.cpp:
12764 (JSC::JSArray::putSlowCase):
12765 (JSC::JSArray::increaseVectorLength):
12766 * runtime/StringPrototype.cpp:
12767 (JSC::stringProtoFuncFontsize):
12768 (JSC::stringProtoFuncLink):
12769 * runtime/UString.cpp:
12771 (JSC::reallocChars):
12772 (JSC::expandCapacity):
12773 (JSC::UString::Rep::reserveCapacity):
12774 (JSC::UString::expandPreCapacity):
12776 (JSC::concatenate):
12777 (JSC::UString::spliceSubstringsWithSeparators):
12778 (JSC::UString::replaceRange):
12779 (JSC::UString::append):
12780 (JSC::UString::operator=):
12781 * runtime/UString.h:
12782 (JSC::UString::Rep::createEmptyBuffer):
12783 * wtf/FastMalloc.cpp:
12784 (WTF::tryFastZeroedMalloc):
12785 (WTF::tryFastMalloc):
12786 (WTF::tryFastCalloc):
12787 (WTF::tryFastRealloc):
12788 (WTF::TCMallocStats::tryFastMalloc):
12789 (WTF::TCMallocStats::tryFastCalloc):
12790 (WTF::TCMallocStats::tryFastRealloc):
12791 * wtf/FastMalloc.h:
12792 (WTF::TryMallocReturnValue::TryMallocReturnValue):
12793 (WTF::TryMallocReturnValue::~TryMallocReturnValue):
12794 (WTF::TryMallocReturnValue::operator Maybe<T>):
12795 (WTF::TryMallocReturnValue::getValue):
12796 * wtf/PossiblyNull.h:
12797 (WTF::PossiblyNull::PossiblyNull):
12798 (WTF::PossiblyNull::~PossiblyNull):
12799 (WTF::PossiblyNull::getValue):
12802 2009-07-20 Gavin Barraclough <barraclough@apple.com>
12806 Add ARM assembler files to xcodeproj, for convenience editing.
12808 * JavaScriptCore.xcodeproj/project.pbxproj:
12810 2009-07-20 Jessie Berlin <jberlin@apple.com>
12812 Reviewed by David Levin.
12814 Fix an incorrect assertion in Vector::remove.
12816 https://bugs.webkit.org/show_bug.cgi?id=27477
12820 Assert that the position at which to start removing elements + the
12821 length (the number of elements to remove) is less than or equal to the
12822 size of the entire Vector.
12824 2009-07-20 Peter Kasting <pkasting@google.com>
12826 Reviewed by Mark Rowe.
12828 https://bugs.webkit.org/show_bug.cgi?id=27468
12829 Back out r46060, which caused problems for some Apple developers.
12831 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
12832 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
12833 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
12834 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
12835 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
12837 2009-07-20 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
12839 Reviewed by Oliver Hunt.
12841 Allow custom memory allocation control in NewThreadContext
12842 https://bugs.webkit.org/show_bug.cgi?id=27338
12844 Inherits NewThreadContext struct from FastAllocBase because it
12845 has been instantiated by 'new' JavaScriptCore/wtf/Threading.cpp:76.
12847 * wtf/Threading.cpp:
12849 2009-07-20 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
12851 Reviewed by Oliver Hunt.
12853 Allow custom memory allocation control in JavaScriptCore's JSClassRef.h
12854 https://bugs.webkit.org/show_bug.cgi?id=27340
12856 Inherit StaticValueEntry and StaticFunctionEntry struct from FastAllocBase because these
12857 have been instantiated by 'new' in JavaScriptCore/API/JSClassRef.cpp:153
12858 and in JavaScriptCore/API/JSClassRef.cpp:166.
12860 * API/JSClassRef.h:
12862 2009-07-20 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
12864 Reviewed by Darin Adler.
12866 Allow custom memory allocation control in JavaScriptCore's RegexPattern.h
12867 https://bugs.webkit.org/show_bug.cgi?id=27343
12869 Inherits RegexPattern.h's structs (which have been instantiated by operator new) from FastAllocBase:
12871 CharacterClass (new call: JavaScriptCore/yarr/RegexCompiler.cpp:144)
12872 PatternAlternative (new call: JavaScriptCore/yarr/RegexPattern.h:221)
12873 PatternDisjunction (new call: JavaScriptCore/yarr/RegexCompiler.cpp:446)
12875 * yarr/RegexPattern.h:
12877 2009-07-20 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
12879 Reviewed by Darin Adler.
12881 Allow custom memory allocation control for JavaScriptCore's MatchFrame struct
12882 https://bugs.webkit.org/show_bug.cgi?id=27344
12884 Inherits MatchFrame struct from FastAllocBase because it has
12885 been instantiated by 'new' JavaScriptCore/pcre/pcre_exec.cpp:359.
12887 * pcre/pcre_exec.cpp:
12889 2009-07-20 Laszlo Gombos <laszlo.1.gombos@nokia.com>
12891 Reviewed by Holger Freyther.
12893 Remove some outdated S60 platform specific code
12894 https://bugs.webkit.org/show_bug.cgi?id=27423
12898 2009-07-20 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
12900 Reviewed by Simon Hausmann.
12902 Qt build fix with MSVC and MinGW.
12904 * jsc.pro: Make sure jsc is a console application, and turn off
12905 exceptions and stl support to fix the build.
12907 2009-07-20 Xan Lopez <xlopez@igalia.com>
12909 Reviewed by Gustavo Noronha.
12911 Do not use C++-style comments in preprocessor directives.
12913 GCC does not like this in some configurations, using C-style
12918 2009-07-17 Peter Kasting <pkasting@google.com>
12920 Reviewed by Steve Falkenburg.
12922 https://bugs.webkit.org/show_bug.cgi?id=27323
12923 Only add Cygwin to the path when it isn't already there. This avoids
12924 causing problems for people who purposefully have non-Cygwin versions of
12925 executables like svn in front of the Cygwin ones in their paths.
12927 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
12928 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
12929 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
12930 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
12931 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
12933 2009-07-17 Gabor Loki <loki@inf.u-szeged.hu>
12935 Reviewed by Gavin Barraclough.
12937 Add YARR support for generic ARM platforms (disabled by default).
12938 https://bugs.webkit.org/show_bug.cgi?id=24986
12940 Add generic ARM port for MacroAssembler. It supports the whole
12941 MacroAssembler functionality except floating point.
12943 The class JmpSrc is extended with a flag which enables to patch
12944 the jump destination offset during execution. This feature is
12945 required for generic ARM port.
12947 Signed off by Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
12948 Signed off by Gabor Loki <loki@inf.u-szeged.hu>
12950 * JavaScriptCore.pri:
12951 * assembler/ARMAssembler.cpp: Added.
12952 (JSC::ARMAssembler::getLdrImmAddress):
12953 (JSC::ARMAssembler::linkBranch):
12954 (JSC::ARMAssembler::patchConstantPoolLoad):
12955 (JSC::ARMAssembler::getOp2):
12956 (JSC::ARMAssembler::genInt):
12957 (JSC::ARMAssembler::getImm):
12958 (JSC::ARMAssembler::moveImm):
12959 (JSC::ARMAssembler::dataTransfer32):
12960 (JSC::ARMAssembler::baseIndexTransfer32):
12961 (JSC::ARMAssembler::executableCopy):
12962 * assembler/ARMAssembler.h: Added.
12964 (JSC::ARMAssembler::ARMAssembler):
12965 (JSC::ARMAssembler::):
12966 (JSC::ARMAssembler::JmpSrc::JmpSrc):
12967 (JSC::ARMAssembler::JmpSrc::enableLatePatch):
12968 (JSC::ARMAssembler::JmpDst::JmpDst):
12969 (JSC::ARMAssembler::JmpDst::isUsed):
12970 (JSC::ARMAssembler::JmpDst::used):
12971 (JSC::ARMAssembler::emitInst):
12972 (JSC::ARMAssembler::and_r):
12973 (JSC::ARMAssembler::ands_r):
12974 (JSC::ARMAssembler::eor_r):
12975 (JSC::ARMAssembler::eors_r):
12976 (JSC::ARMAssembler::sub_r):
12977 (JSC::ARMAssembler::subs_r):
12978 (JSC::ARMAssembler::rsb_r):
12979 (JSC::ARMAssembler::rsbs_r):
12980 (JSC::ARMAssembler::add_r):
12981 (JSC::ARMAssembler::adds_r):
12982 (JSC::ARMAssembler::adc_r):
12983 (JSC::ARMAssembler::adcs_r):
12984 (JSC::ARMAssembler::sbc_r):
12985 (JSC::ARMAssembler::sbcs_r):
12986 (JSC::ARMAssembler::rsc_r):
12987 (JSC::ARMAssembler::rscs_r):
12988 (JSC::ARMAssembler::tst_r):
12989 (JSC::ARMAssembler::teq_r):
12990 (JSC::ARMAssembler::cmp_r):
12991 (JSC::ARMAssembler::orr_r):
12992 (JSC::ARMAssembler::orrs_r):
12993 (JSC::ARMAssembler::mov_r):
12994 (JSC::ARMAssembler::movs_r):
12995 (JSC::ARMAssembler::bic_r):
12996 (JSC::ARMAssembler::bics_r):
12997 (JSC::ARMAssembler::mvn_r):
12998 (JSC::ARMAssembler::mvns_r):
12999 (JSC::ARMAssembler::mul_r):
13000 (JSC::ARMAssembler::muls_r):
13001 (JSC::ARMAssembler::mull_r):
13002 (JSC::ARMAssembler::ldr_imm):
13003 (JSC::ARMAssembler::ldr_un_imm):
13004 (JSC::ARMAssembler::dtr_u):
13005 (JSC::ARMAssembler::dtr_ur):
13006 (JSC::ARMAssembler::dtr_d):
13007 (JSC::ARMAssembler::dtr_dr):
13008 (JSC::ARMAssembler::ldrh_r):
13009 (JSC::ARMAssembler::ldrh_d):
13010 (JSC::ARMAssembler::ldrh_u):
13011 (JSC::ARMAssembler::strh_r):
13012 (JSC::ARMAssembler::push_r):
13013 (JSC::ARMAssembler::pop_r):
13014 (JSC::ARMAssembler::poke_r):
13015 (JSC::ARMAssembler::peek_r):
13016 (JSC::ARMAssembler::clz_r):
13017 (JSC::ARMAssembler::bkpt):
13018 (JSC::ARMAssembler::lsl):
13019 (JSC::ARMAssembler::lsr):
13020 (JSC::ARMAssembler::asr):
13021 (JSC::ARMAssembler::lsl_r):
13022 (JSC::ARMAssembler::lsr_r):
13023 (JSC::ARMAssembler::asr_r):
13024 (JSC::ARMAssembler::size):
13025 (JSC::ARMAssembler::ensureSpace):
13026 (JSC::ARMAssembler::label):
13027 (JSC::ARMAssembler::align):
13028 (JSC::ARMAssembler::jmp):
13029 (JSC::ARMAssembler::patchPointerInternal):
13030 (JSC::ARMAssembler::patchConstantPoolLoad):
13031 (JSC::ARMAssembler::patchPointer):
13032 (JSC::ARMAssembler::repatchInt32):
13033 (JSC::ARMAssembler::repatchPointer):
13034 (JSC::ARMAssembler::repatchLoadPtrToLEA):
13035 (JSC::ARMAssembler::linkJump):
13036 (JSC::ARMAssembler::relinkJump):
13037 (JSC::ARMAssembler::linkCall):
13038 (JSC::ARMAssembler::relinkCall):
13039 (JSC::ARMAssembler::getRelocatedAddress):
13040 (JSC::ARMAssembler::getDifferenceBetweenLabels):
13041 (JSC::ARMAssembler::getCallReturnOffset):
13042 (JSC::ARMAssembler::getOp2Byte):
13043 (JSC::ARMAssembler::placeConstantPoolBarrier):
13044 (JSC::ARMAssembler::RM):
13045 (JSC::ARMAssembler::RS):
13046 (JSC::ARMAssembler::RD):
13047 (JSC::ARMAssembler::RN):
13048 (JSC::ARMAssembler::getConditionalField):
13049 * assembler/ARMv7Assembler.h:
13050 (JSC::ARMv7Assembler::JmpSrc::enableLatePatch):
13051 * assembler/AbstractMacroAssembler.h:
13052 (JSC::AbstractMacroAssembler::Call::enableLatePatch):
13053 (JSC::AbstractMacroAssembler::Jump::enableLatePatch):
13054 * assembler/MacroAssembler.h:
13055 * assembler/MacroAssemblerARM.h: Added.
13056 (JSC::MacroAssemblerARM::):
13057 (JSC::MacroAssemblerARM::add32):
13058 (JSC::MacroAssemblerARM::and32):
13059 (JSC::MacroAssemblerARM::lshift32):
13060 (JSC::MacroAssemblerARM::mul32):
13061 (JSC::MacroAssemblerARM::not32):
13062 (JSC::MacroAssemblerARM::or32):
13063 (JSC::MacroAssemblerARM::rshift32):
13064 (JSC::MacroAssemblerARM::sub32):
13065 (JSC::MacroAssemblerARM::xor32):
13066 (JSC::MacroAssemblerARM::load32):
13067 (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
13068 (JSC::MacroAssemblerARM::loadPtrWithPatchToLEA):
13069 (JSC::MacroAssemblerARM::load16):
13070 (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
13071 (JSC::MacroAssemblerARM::store32):
13072 (JSC::MacroAssemblerARM::pop):
13073 (JSC::MacroAssemblerARM::push):
13074 (JSC::MacroAssemblerARM::move):
13075 (JSC::MacroAssemblerARM::swap):
13076 (JSC::MacroAssemblerARM::signExtend32ToPtr):
13077 (JSC::MacroAssemblerARM::zeroExtend32ToPtr):
13078 (JSC::MacroAssemblerARM::branch32):
13079 (JSC::MacroAssemblerARM::branch16):
13080 (JSC::MacroAssemblerARM::branchTest32):
13081 (JSC::MacroAssemblerARM::jump):
13082 (JSC::MacroAssemblerARM::branchAdd32):
13083 (JSC::MacroAssemblerARM::mull32):
13084 (JSC::MacroAssemblerARM::branchMul32):
13085 (JSC::MacroAssemblerARM::branchSub32):
13086 (JSC::MacroAssemblerARM::breakpoint):
13087 (JSC::MacroAssemblerARM::nearCall):
13088 (JSC::MacroAssemblerARM::call):
13089 (JSC::MacroAssemblerARM::ret):
13090 (JSC::MacroAssemblerARM::set32):
13091 (JSC::MacroAssemblerARM::setTest32):
13092 (JSC::MacroAssemblerARM::tailRecursiveCall):
13093 (JSC::MacroAssemblerARM::makeTailRecursiveCall):
13094 (JSC::MacroAssemblerARM::moveWithPatch):
13095 (JSC::MacroAssemblerARM::branchPtrWithPatch):
13096 (JSC::MacroAssemblerARM::storePtrWithPatch):
13097 (JSC::MacroAssemblerARM::supportsFloatingPoint):
13098 (JSC::MacroAssemblerARM::supportsFloatingPointTruncate):
13099 (JSC::MacroAssemblerARM::loadDouble):
13100 (JSC::MacroAssemblerARM::storeDouble):
13101 (JSC::MacroAssemblerARM::addDouble):
13102 (JSC::MacroAssemblerARM::subDouble):
13103 (JSC::MacroAssemblerARM::mulDouble):
13104 (JSC::MacroAssemblerARM::convertInt32ToDouble):
13105 (JSC::MacroAssemblerARM::branchDouble):
13106 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
13107 (JSC::MacroAssemblerARM::ARMCondition):
13108 (JSC::MacroAssemblerARM::prepareCall):
13109 (JSC::MacroAssemblerARM::call32):
13110 * assembler/X86Assembler.h:
13111 (JSC::X86Assembler::JmpSrc::enableLatePatch):
13112 * jit/ExecutableAllocator.h:
13113 (JSC::ExecutableAllocator::cacheFlush):
13115 * yarr/RegexJIT.cpp:
13116 (JSC::Yarr::RegexGenerator::generateEnter):
13117 (JSC::Yarr::RegexGenerator::generateReturn):
13119 2009-07-17 Gabor Loki <loki@inf.u-szeged.hu>
13121 Reviewed by Gavin Barraclough.
13123 Extend AssemblerBuffer with constant pool handling mechanism.
13124 https://bugs.webkit.org/show_bug.cgi?id=24986
13126 Add a platform independed constant pool framework.
13127 This pool can store 32 or 64 bits values which is enough to hold
13128 any integer, pointer or double constant.
13130 * assembler/AssemblerBuffer.h:
13131 (JSC::AssemblerBuffer::putIntUnchecked):
13132 (JSC::AssemblerBuffer::putInt64Unchecked):
13133 (JSC::AssemblerBuffer::append):
13134 (JSC::AssemblerBuffer::grow):
13135 * assembler/AssemblerBufferWithConstantPool.h: Added.
13138 2009-07-17 Eric Roman <eroman@chromium.org>
13140 Reviewed by Darin Adler.
13142 Build fix for non-Darwin.
13143 Add a guard for inclusion of RetainPtr.h which includes CoreFoundation.h
13145 https://bugs.webkit.org/show_bug.cgi?id=27382
13147 * wtf/unicode/icu/CollatorICU.cpp:
13149 2009-07-17 Alexey Proskuryakov <ap@webkit.org>
13151 Reviewed by John Sullivan.
13153 Get user default collation order via a CFLocale API when available.
13155 * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::userDefault):
13157 2009-07-17 Laszlo Gombos <laszlo.1.gombos@nokia.com>
13159 Reviewed by Simon Hausmann.
13161 [Qt] Fix the include path for the Symbian port
13162 https://bugs.webkit.org/show_bug.cgi?id=27358
13164 * JavaScriptCore.pri:
13166 2009-07-17 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
13168 Reviewed by David Levin.
13170 Build fix on platforms don't have MMAP.
13171 https://bugs.webkit.org/show_bug.cgi?id=27365
13173 * interpreter/RegisterFile.h: Including stdio.h irrespectively of HAVE(MMAP)
13175 2009-07-16 Fumitoshi Ukai <ukai@chromium.org>
13177 Reviewed by David Levin.
13179 Add --web-sockets flag and ENABLE_WEB_SOCKETS define.
13180 https://bugs.webkit.org/show_bug.cgi?id=27206
13182 Add ENABLE_WEB_SOCKETS
13184 * Configurations/FeatureDefines.xcconfig: add ENABLE_WEB_SOCKETS
13186 2009-07-16 Maxime Simon <simon.maxime@gmail.com>
13188 Reviewed by Eric Seidel.
13190 Added Haiku-specific files for JavaScriptCore.
13191 https://bugs.webkit.org/show_bug.cgi?id=26620
13193 * wtf/haiku/MainThreadHaiku.cpp: Added.
13194 (WTF::initializeMainThreadPlatform):
13195 (WTF::scheduleDispatchFunctionsOnMainThread):
13197 2009-07-16 Gavin Barraclough <barraclough@apple.com>
13201 Revert r45969, this fix does not appear to be valid.
13202 https://bugs.webkit.org/show_bug.cgi?id=27077
13204 * bytecode/CodeBlock.cpp:
13205 (JSC::CodeBlock::~CodeBlock):
13206 (JSC::CodeBlock::unlinkCallers):
13210 2009-07-16 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
13212 Reviewed by Oliver Hunt.
13214 Allow custom memory allocation control in ExceptionInfo and RareData struct
13215 https://bugs.webkit.org/show_bug.cgi?id=27336
13217 Inherits ExceptionInfo and RareData struct from FastAllocBase because these
13218 have been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.cpp:1289 and
13219 in JavaScriptCore/bytecode/CodeBlock.h:453.
13221 Remove unnecessary WTF:: namespace from CodeBlock inheritance.
13223 * bytecode/CodeBlock.h:
13225 2009-07-16 Mark Rowe <mrowe@apple.com>
13227 Rubber-stamped by Geoff Garen.
13229 Fix FeatureDefines.xcconfig to not be out of sync with the rest of the world.
13231 * Configurations/FeatureDefines.xcconfig:
13233 2009-07-16 Yong Li <yong.li@torchmobile.com>
13235 Reviewed by George Staikos.
13237 https://bugs.webkit.org/show_bug.cgi?id=27320
13238 _countof is only included in CE6; for CE5 we need to define it ourself
13242 2009-07-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
13244 Reviewed by Oliver Hunt.
13246 Workers + garbage collector: weird crashes
13247 https://bugs.webkit.org/show_bug.cgi?id=27077
13249 We need to unlink cached method call sites when a function is destroyed.
13251 * JavaScriptCore.xcodeproj/project.pbxproj:
13252 * bytecode/CodeBlock.cpp:
13253 (JSC::CodeBlock::~CodeBlock):
13254 (JSC::CodeBlock::unlinkCallers):
13256 (JSC::JIT::unlinkMethodCall):
13259 2009-07-15 Steve Falkenburg <sfalken@apple.com>
13263 Visual Studio reset our intermediate directory on us.
13266 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
13267 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
13269 2009-07-15 Kwang Yul Seo <skyul@company100.net>
13271 Reviewed by Eric Seidel.
13273 https://bugs.webkit.org/show_bug.cgi?id=26794
13274 Make Yacc-generated parsers to use fastMalloc/fastFree.
13276 Define YYMALLOC and YYFREE to fastMalloc and fastFree
13279 * parser/Grammar.y:
13281 2009-07-15 Darin Adler <darin@apple.com>
13283 Fix a build for a particular Apple configuration.
13285 * wtf/FastAllocBase.h: Change include to use "" style for
13286 including another wtf header. This is the style we use for
13287 including other public headers in the same directory.
13289 2009-07-15 George Staikos <george.staikos@torchmobile.com>
13291 Reviewed by Adam Treat.
13293 https://bugs.webkit.org/show_bug.cgi?id=27303
13294 Implement createThreadInternal for WinCE.
13295 Contains changes by George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
13297 * wtf/ThreadingWin.cpp:
13298 (WTF::createThreadInternal):
13300 2009-07-15 Joe Mason <joe.mason@torchmobile.com>
13302 Reviewed by George Staikos.
13304 https://bugs.webkit.org/show_bug.cgi?id=27298
13305 Platform defines for WINCE.
13306 Contains changes by Yong Li <yong.li@torchmobile.com>,
13307 George Staikos <george.staikos@torchmobile.com> and Joe Mason <joe.mason@torchmobile.com>
13311 2009-07-15 Yong Li <yong.li@torchmobile.com>
13313 Reviewed by Adam Treat.
13315 https://bugs.webkit.org/show_bug.cgi?id=27306
13316 Use RegisterClass instead of RegisterClassEx on WinCE.
13318 * wtf/win/MainThreadWin.cpp:
13319 (WTF::initializeMainThreadPlatform):
13321 2009-07-15 Yong Li <yong.li@torchmobile.com>
13323 Reviewed by George Staikos.
13325 https://bugs.webkit.org/show_bug.cgi?id=27301
13326 Use OutputDebugStringW on WinCE since OutputDebugStringA is not supported
13327 Originally written by Yong Li <yong.li@torchmobile.com> and refactored by
13328 Joe Mason <joe.mason@torchmobile.com>
13330 * wtf/Assertions.cpp: vprintf_stderr_common
13332 2009-07-15 Yong Li <yong.li@torchmobile.com>
13334 Reviewed by George Staikos.
13336 https://bugs.webkit.org/show_bug.cgi?id=27020
13337 msToGregorianDateTime should set utcOffset to 0 when outputIsUTC is false
13339 * wtf/DateMath.cpp:
13340 (WTF::gregorianDateTimeToMS):
13342 2009-07-15 Laszlo Gombos <laszlo.1.gombos@nokia.com>
13344 Reviewed by Simon Hausmann.
13346 [Qt] Cleanup - Remove obsolete code from the make system
13347 https://bugs.webkit.org/show_bug.cgi?id=27299
13349 * JavaScriptCore.pro:
13352 2009-07-07 Norbert Leser <norbert.leser@nokia.com>
13354 Reviewed by Simon Hausmann.
13356 https://bugs.webkit.org/show_bug.cgi?id=27056
13358 Alternate bool operator for codewarrior compiler (WINSCW).
13359 Compiler (latest b482) reports error for UnspecifiedBoolType construct:
13360 "illegal explicit conversion from 'WTF::OwnArrayPtr<JSC::Register>' to 'bool'"
13362 Same fix as in r38391.
13364 * JavaScriptCore/wtf/OwnArrayPtr.h:
13366 2009-07-15 Norbert Leser <norbert.leser@nokia.com>
13368 Reviewed by Darin Adler.
13370 Qualify include path with wtf to fix compilation
13372 https://bugs.webkit.org/show_bug.cgi?id=27055
13374 * interpreter/Interpreter.h:
13376 2009-07-15 Laszlo Gombos <laszlo.1.gombos@nokia.com>
13378 Reviewed by Dave Kilzer.
13380 Turn off non-portable date manipulations for SYMBIAN
13381 https://bugs.webkit.org/show_bug.cgi?id=27064
13383 Introduce HAVE(TM_GMTOFF), HAVE(TM_ZONE) and HAVE(TIMEGM) guards
13384 and place the rules for controlling the guards in Platform.h.
13385 Turn off these newly introduced guards for SYMBIAN.
13387 * wtf/DateMath.cpp:
13388 (WTF::calculateUTCOffset):
13390 (WTF::GregorianDateTime::GregorianDateTime):
13391 (WTF::GregorianDateTime::operator tm):
13394 2009-07-15 Norbert Leser <norbert.leser@nokia.com>
13396 Reviewed by Simon Hausmann.
13398 Undef ASSERT on Symbian, to avoid excessive warnings
13399 https://bugs.webkit.org/show_bug.cgi?id=27052
13401 * wtf/Assertions.h:
13403 2009-07-15 Oliver Hunt <oliver@apple.com>
13405 Reviewed by Simon Hausmann.
13407 REGRESSION: fast/js/postfix-syntax.html fails with interpreter
13408 https://bugs.webkit.org/show_bug.cgi?id=27294
13410 When postfix operators operating on locals assign to the same local
13411 the order of operations has to be to store the incremented value, then
13412 store the unmodified number. Rather than implementing this subtle
13413 semantic in the interpreter I've just made the logic explicit in the
13414 bytecode generator, so x=x++ effectively becomes x=ToNumber(x) (for a
13417 * parser/Nodes.cpp:
13418 (JSC::emitPostIncOrDec):
13420 2009-07-15 Oliver Hunt <oliver@apple.com>
13422 Reviewed by Simon Hausmann.
13424 REGRESSION(43559): fast/js/kde/arguments-scope.html fails with interpreter
13425 https://bugs.webkit.org/show_bug.cgi?id=27259
13427 The interpreter was incorrectly basing its need to create the arguments object
13428 based on the presence of the callframe's argument reference rather than the local
13429 arguments reference. Based on this it then overrode the local variable reference.
13431 * interpreter/Interpreter.cpp:
13432 (JSC::Interpreter::privateExecute):
13434 2009-07-14 Steve Falkenburg <sfalken@apple.com>
13436 Reorganize JavaScriptCore headers into:
13437 API: include/JavaScriptCore/
13438 Private: include/private/JavaScriptCore/
13440 Reviewed by Darin Adler.
13442 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
13443 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
13444 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
13445 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
13446 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
13448 2009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
13450 Reviewed by Darin Adler.
13452 Change JSCell's superclass to NoncopyableCustomAllocated
13453 https://bugs.webkit.org/show_bug.cgi?id=27248
13455 JSCell class customizes operator new, since Noncopyable will be
13456 inherited from FastAllocBase, NoncopyableCustomAllocated has
13459 * runtime/JSCell.h:
13461 2009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
13463 Reviewed by Darin Adler.
13465 Change all Noncopyable inheriting visibility to public.
13466 https://bugs.webkit.org/show_bug.cgi?id=27225
13468 Change all Noncopyable inheriting visibility to public because
13469 it is needed to the custom allocation framework (bug #20422).
13471 * bytecode/SamplingTool.h:
13472 * bytecompiler/RegisterID.h:
13473 * interpreter/CachedCall.h:
13474 * interpreter/RegisterFile.h:
13477 * runtime/ArgList.h:
13478 * runtime/BatchedTransitionOptimizer.h:
13479 * runtime/Collector.h:
13480 * runtime/CommonIdentifiers.h:
13481 * runtime/JSCell.h:
13482 * runtime/JSGlobalObject.h:
13483 * runtime/JSLock.h:
13484 * runtime/JSONObject.cpp:
13485 * runtime/SmallStrings.cpp:
13486 * runtime/SmallStrings.h:
13487 * wtf/CrossThreadRefCounted.h:
13490 * wtf/MessageQueue.h:
13491 * wtf/OwnArrayPtr.h:
13492 * wtf/OwnFastMallocPtr.h:
13494 * wtf/RefCounted.h:
13495 * wtf/ThreadSpecific.h:
13498 * wtf/unicode/Collator.h:
13500 2009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
13502 Reviewed by Darin Adler.
13504 Change ParserArenaRefCounted's superclass to RefCountedCustomAllocated
13505 https://bugs.webkit.org/show_bug.cgi?id=27249
13507 ParserArenaDeletable customizes operator new, to avoid double inheritance
13508 ParserArenaDeletable's superclass has been changed to RefCountedCustomAllocated.
13512 2009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
13514 Reviewed by Darin Adler.
13516 Add RefCountedCustomAllocated to RefCounted.h
13517 https://bugs.webkit.org/show_bug.cgi?id=27232
13519 Some class which are inherited from RefCounted customize
13520 operator new, but RefCounted is inherited from Noncopyable
13521 which will be inherited from FastAllocBase. To avoid
13522 conflicts Noncopyable inheriting was moved down to RefCounted
13523 and to avoid double inheritance this class has been added.
13525 * wtf/RefCounted.h:
13526 (WTF::RefCountedCustomAllocated::deref):
13527 (WTF::RefCountedCustomAllocated::~RefCountedCustomAllocated):
13529 2009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
13531 Reviewed by Darin Adler.
13533 Add NoncopyableCustomAllocated to Noncopyable.h.
13534 https://bugs.webkit.org/show_bug.cgi?id=27228
13536 Some classes which inherited from Noncopyable overrides operator new
13537 since Noncopyable'll be inherited from FastAllocBase, Noncopyable.h
13538 needs to be extended with this new class to support the overriding.
13540 * wtf/Noncopyable.h:
13541 (WTFNoncopyable::NoncopyableCustomAllocated::NoncopyableCustomAllocated):
13542 (WTFNoncopyable::NoncopyableCustomAllocated::~NoncopyableCustomAllocated):
13544 2009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
13546 Reviewed by Darin Adler.
13548 Allow custom memory allocation control for JavaScriptCore's IdentifierTable class
13549 https://bugs.webkit.org/show_bug.cgi?id=27260
13551 Inherits IdentifierTable class from FastAllocBase because it has been
13552 instantiated by 'new' in JavaScriptCore/runtime/Identifier.cpp:70.
13554 * runtime/Identifier.cpp:
13556 2009-07-14 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
13558 Reviewed by Darin Adler.
13560 Allow custom memory allocation control for JavaScriptCore's Profiler class
13561 https://bugs.webkit.org/show_bug.cgi?id=27253
13563 Inherits Profiler class from FastAllocBase because it has been instantiated by
13564 'new' in JavaScriptCore/profiler/Profiler.cpp:56.
13566 * profiler/Profiler.h:
13568 2009-07-06 George Staikos <george.staikos@torchmobile.com>
13570 Reviewed by Adam Treat.
13572 Authors: George Staikos <george.staikos@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>, Makoto Matsumoto <matumoto@math.keio.ac.jp>, Takuji Nishimura
13574 https://bugs.webkit.org/show_bug.cgi?id=27030
13575 Implement custom RNG for WinCE using Mersenne Twister
13577 * wtf/RandomNumber.cpp:
13578 (WTF::randomNumber):
13579 * wtf/RandomNumberSeed.h:
13580 (WTF::initializeRandomNumberGenerator):
13581 * wtf/wince/mt19937ar.c: Added.
13591 2009-07-13 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
13593 Unreviewed make dist build fix.
13597 2009-07-13 Drew Wilson <atwilson@google.com>
13599 Reviewed by David Levin.
13601 Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs
13602 https://bugs.webkit.org/show_bug.cgi?id=26932
13604 Added ENABLE(SHARED_WORKERS) flag (off by default).
13606 * Configurations/FeatureDefines.xcconfig:
13608 2009-07-07 Norbert Leser <norbert.leser@nokia.com>
13610 Reviewed by Maciej Stachoviak.
13612 https://bugs.webkit.org/show_bug.cgi?id=27058
13614 Removed superfluous parenthesis around single expression.
13615 Compilers on Symbian platform fail to properly parse and compile.
13617 * JavaScriptCore/wtf/Platform.h:
13619 2009-07-13 Norbert Leser <norbert.leser@nokia.com>
13621 Reviewed by Maciej Stachoviak.
13623 https://bugs.webkit.org/show_bug.cgi?id=27054
13625 Renamed Translator to HashTranslator
13627 Codewarrior compiler (WINSCW) latest b482 cannot resolve typename
13628 mismatch between template declaration and definition
13629 (HashTranslator / Translator)
13633 2009-07-13 Norbert Leser <norbert.leser@nokia.com>
13635 Reviewed by Eric Seidel.
13637 https://bugs.webkit.org/show_bug.cgi?id=27053
13639 Ambiguity in LabelScope initialization
13641 Codewarrior compiler (WINSCW) latest b482 on Symbian cannot resolve
13642 type of "0" unambiguously. Set expression explicitly to
13643 PassRefPtr<Label>::PassRefPtr()
13645 * bytecompiler/BytecodeGenerator.cpp
13647 2009-07-11 Simon Fraser <simon.fraser@apple.com>
13649 Enable support for accelerated compositing and 3d transforms on Leopard.
13650 <https://bugs.webkit.org/show_bug.cgi?id=20166>
13651 <rdar://problem/6120614>
13653 Reviewed by Oliver Hunt.
13655 * Configurations/FeatureDefines.xcconfig:
13658 2009-07-10 Mark Rowe <mrowe@apple.com>
13660 Second part of the "make Windows happier" dance.
13662 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
13663 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
13665 2009-07-10 Mark Rowe <mrowe@apple.com>
13667 Try and make the Windows build happy.
13669 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
13670 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
13672 2009-07-10 Kevin McCullough <kmccullough@apple.com>
13674 Reviewed by Geoffrey Garen.
13676 * debugger/Debugger.h: Made this function virtual for use in WebCore's
13679 2009-07-10 Kwang Yul Seo <skyul@company100.net>
13681 Reviewed by Darin Adler.
13683 ParserArenaDeletable should override delete
13684 https://bugs.webkit.org/show_bug.cgi?id=26790
13686 ParserArenaDeletable overrides new, but it does not override delete.
13687 ParserArenaDeletable must be freed by fastFree
13688 because it is allocated by fastMalloc.
13690 * parser/NodeConstructors.h:
13691 (JSC::ParserArenaDeletable::operator delete):
13694 2009-07-10 Adam Roben <aroben@apple.com>
13696 Sort all our Xcode projects
13698 Accomplished using sort-Xcode-project-file.
13700 Requested by Dave Kilzer.
13702 * JavaScriptCore.xcodeproj/project.pbxproj:
13704 2009-07-09 Maciej Stachowiak <mjs@apple.com>
13706 Not reviewed, build fix.
13708 Windows build fix for the last change.
13710 * wtf/dtoa.cpp: Forgot to include Vector.h
13712 2009-07-09 Maciej Stachowiak <mjs@apple.com>
13714 Reviewed by Darin Adler.
13716 REGRESSION: crash in edge cases of floating point parsing.
13717 https://bugs.webkit.org/show_bug.cgi?id=27110
13718 <rdar://problem/7044458>
13720 Tests: fast/css/number-parsing-crash.html
13721 fast/css/number-parsing-crash.html
13722 fast/js/number-parsing-crash.html
13725 (WTF::BigInt::BigInt): Converted this to more a proper class, using a Vector
13726 with inline capacity
13728 (WTF::lshift): Rearranged logic somewhat nontrivially to deal with the new way of sizing BigInts.
13729 Added an assertion to verify that invariants are maintained.
13731 All other functions are adapted fairly mechanically to the above changes.
13732 (WTF::BigInt::clear):
13733 (WTF::BigInt::size):
13734 (WTF::BigInt::resize):
13735 (WTF::BigInt::words):
13736 (WTF::BigInt::append):
13750 2009-07-09 Drew Wilson <atwilson@google.com>
13752 Reviewed by Alexey Proskuryakov.
13754 Turned on CHANNEL_MESSAGING by default because the MessageChannel API
13755 can now be implemented for Web Workers and is reasonably stable.
13757 * Configurations/FeatureDefines.xcconfig:
13759 2009-07-09 Oliver Hunt <oliver@apple.com>
13761 * interpreter/Interpreter.cpp:
13762 (JSC::Interpreter::privateExecute):
13764 2009-07-09 Oliver Hunt <oliver@apple.com>
13766 Reviewed by Darin Adler.
13768 Bug 27016 - Interpreter crashes due to invalid array indexes
13769 <https://bugs.webkit.org/show_bug.cgi?id=27016>
13771 Unsigned vs signed conversions results in incorrect behaviour in
13772 64bit interpreter builds.
13774 * interpreter/Interpreter.cpp:
13775 (JSC::Interpreter::privateExecute):
13777 2009-07-09 Dimitri Glazkov <dglazkov@chromium.org>
13779 Reviewed by Darin Fisher.
13781 [Chromium] Upstream JavaScriptCore.gypi, the project file for Chromium build.
13782 https://bugs.webkit.org/show_bug.cgi?id=27135
13784 * JavaScriptCore.gypi: Added.
13786 2009-07-09 Joe Mason <joe.mason@torchmobile.com>
13788 Reviewed by George Staikos.
13790 Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
13792 https://bugs.webkit.org/show_bug.cgi?id=27031
13793 Add an override for deleteOwnedPtr(HDC) on Windows
13795 * wtf/OwnPtrCommon.h:
13796 * wtf/OwnPtrWin.cpp:
13797 (WTF::deleteOwnedPtr):
13799 2009-07-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
13801 Reviewed by Darin Adler.
13803 Guard singal.h dependency with HAVE(SIGNAL_H) to enable building jsc
13806 https://bugs.webkit.org/show_bug.cgi?id=27026
13808 Based on Norbert Leser's work.
13811 (printUsageStatement):
13815 2009-07-07 Gavin Barraclough <barraclough@apple.com>
13817 Reviewed by Sam Weinig.
13819 Stop loading constants into the register file.
13821 Instead, use high register values (highest bit bar the sign bit set) to indicate
13822 constants in the instruction stream, and when we encounter such a value load it
13823 directly from the CodeBlock.
13825 Since constants are no longer copied into the register file, this patch renders
13826 the 'unexpected constant' mechanism redundant, and removes it.
13828 2% improvement, thanks to Sam Weinig.
13830 * bytecode/CodeBlock.cpp:
13831 (JSC::CodeBlock::dump):
13832 (JSC::CodeBlock::CodeBlock):
13833 (JSC::CodeBlock::mark):
13834 (JSC::CodeBlock::shrinkToFit):
13835 * bytecode/CodeBlock.h:
13836 (JSC::CodeBlock::isTemporaryRegisterIndex):
13837 (JSC::CodeBlock::constantRegister):
13838 (JSC::CodeBlock::isConstantRegisterIndex):
13839 (JSC::CodeBlock::getConstant):
13840 (JSC::ExecState::r):
13841 * bytecode/Opcode.h:
13842 * bytecompiler/BytecodeGenerator.cpp:
13843 (JSC::BytecodeGenerator::preserveLastVar):
13844 (JSC::BytecodeGenerator::BytecodeGenerator):
13845 (JSC::BytecodeGenerator::addConstantValue):
13846 (JSC::BytecodeGenerator::emitEqualityOp):
13847 (JSC::BytecodeGenerator::emitLoad):
13848 (JSC::BytecodeGenerator::emitResolveBase):
13849 (JSC::BytecodeGenerator::emitResolveWithBase):
13850 (JSC::BytecodeGenerator::emitNewError):
13851 * bytecompiler/BytecodeGenerator.h:
13852 (JSC::BytecodeGenerator::emitNode):
13853 * interpreter/CallFrame.h:
13854 (JSC::ExecState::noCaller):
13855 (JSC::ExecState::hasHostCallFrameFlag):
13856 (JSC::ExecState::addHostCallFrameFlag):
13857 (JSC::ExecState::removeHostCallFrameFlag):
13858 * interpreter/Interpreter.cpp:
13859 (JSC::Interpreter::resolve):
13860 (JSC::Interpreter::resolveSkip):
13861 (JSC::Interpreter::resolveGlobal):
13862 (JSC::Interpreter::resolveBase):
13863 (JSC::Interpreter::resolveBaseAndProperty):
13864 (JSC::Interpreter::resolveBaseAndFunc):
13865 (JSC::Interpreter::dumpRegisters):
13866 (JSC::Interpreter::throwException):
13867 (JSC::Interpreter::createExceptionScope):
13868 (JSC::Interpreter::privateExecute):
13869 (JSC::Interpreter::retrieveArguments):
13871 (JSC::JIT::privateCompileMainPass):
13872 * jit/JITInlineMethods.h:
13873 (JSC::JIT::emitLoadDouble):
13874 (JSC::JIT::emitLoadInt32ToDouble):
13875 * jit/JITOpcodes.cpp:
13876 (JSC::JIT::emit_op_new_error):
13877 (JSC::JIT::emit_op_enter):
13878 (JSC::JIT::emit_op_enter_with_activation):
13879 * parser/Nodes.cpp:
13880 (JSC::DeleteResolveNode::emitBytecode):
13881 (JSC::DeleteValueNode::emitBytecode):
13882 (JSC::PrefixResolveNode::emitBytecode):
13883 * runtime/JSActivation.cpp:
13884 (JSC::JSActivation::JSActivation):
13887 2009-07-07 Mark Rowe <mrowe@apple.com>
13889 Reviewed by Darin Adler.
13891 Fix <https://bugs.webkit.org/show_bug.cgi?id=27025> / <rdar://problem/7033448>.
13892 Bug 27025: Crashes and regression test failures related to regexps in 64-bit
13894 For x86_64 RegexGenerator uses rbx, a callee-save register, as a scratch register but
13895 neglects to save and restore it. The change in handling of the output vector in r45545
13896 altered code generation so that the RegExp::match was now storing important data in rbx,
13897 which caused crashes and bogus results when it was clobbered.
13899 * yarr/RegexJIT.cpp:
13900 (JSC::Yarr::RegexGenerator::generateEnter): Save rbx.
13901 (JSC::Yarr::RegexGenerator::generateReturn): Restore rbx.
13903 2009-07-06 Ada Chan <adachan@apple.com>
13905 Reviewed by Darin Adler and Mark Rowe.
13907 Decommitted spans are added to the list of normal spans rather than
13908 the returned spans in TCMalloc_PageHeap::Delete().
13909 https://bugs.webkit.org/show_bug.cgi?id=26998
13911 In TCMalloc_PageHeap::Delete(), the deleted span can be decommitted in
13912 the process of merging with neighboring spans that are also decommitted.
13913 The merged span needs to be placed in the list of returned spans (spans
13914 whose memory has been returned to the system). Right now it's always added
13915 to the list of the normal spans which can theoretically cause thrashing.
13917 * wtf/FastMalloc.cpp:
13918 (WTF::TCMalloc_PageHeap::Delete):
13920 2009-07-05 Lars Knoll <lars.knoll@nokia.com>
13922 Reviewed by Maciej Stachowiak.
13924 https://bugs.webkit.org/show_bug.cgi?id=26843
13926 Fix run-time crashes in JavaScriptCore with the Metrowerks compiler on Symbian.
13928 The Metrowerks compiler on the Symbian platform moves the globally
13929 defined Hashtables into read-only memory, despite one of the members
13930 being mutable. This causes crashes at run-time due to write access to
13933 Avoid the use of const with this compiler by introducing the
13934 JSC_CONST_HASHTABLE macro.
13936 Based on idea by Norbert Leser.
13938 * runtime/Lookup.h: Define JSC_CONST_HASHTABLE as const for !WINSCW.
13939 * create_hash_table: Use JSC_CONST_HASHTABLE for hashtables.
13940 * runtime/JSGlobalData.cpp: Import various global hashtables via the macro.
13942 2009-07-04 Dan Bernstein <mitz@apple.com>
13946 * runtime/RegExpConstructor.cpp:
13947 (JSC::RegExpConstructor::getLastParen):
13949 2009-07-03 Yong Li <yong.li@torchmobile.com>
13951 Reviewed by Maciej Stachowiak (and revised slightly)
13953 RegExp::match to be optimized
13954 https://bugs.webkit.org/show_bug.cgi?id=26957
13956 Allow regexp matching to use Vectors with inline capacity instead of
13957 allocating a new ovector buffer every time.
13959 ~5% speedup on SunSpider string-unpack-code test, 0.3% on SunSpider overall.
13961 * runtime/RegExp.cpp:
13962 (JSC::RegExp::match):
13963 * runtime/RegExp.h:
13964 * runtime/RegExpConstructor.cpp:
13965 (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate):
13966 (JSC::RegExpConstructorPrivate::lastOvector):
13967 (JSC::RegExpConstructorPrivate::tempOvector):
13968 (JSC::RegExpConstructorPrivate::changeLastOvector):
13969 (JSC::RegExpConstructor::performMatch):
13970 (JSC::RegExpMatchesArray::RegExpMatchesArray):
13971 (JSC::RegExpMatchesArray::fillArrayInstance):
13972 (JSC::RegExpConstructor::getBackref):
13973 (JSC::RegExpConstructor::getLastParen):
13974 (JSC::RegExpConstructor::getLeftContext):
13975 (JSC::RegExpConstructor::getRightContext):
13976 * runtime/StringPrototype.cpp:
13977 (JSC::stringProtoFuncSplit):
13979 2009-06-30 Kwang Yul Seo <skyul@company100.net>
13981 Reviewed by Eric Seidel.
13983 Override operator new/delete with const std::nothrow_t& as the second
13985 https://bugs.webkit.org/show_bug.cgi?id=26792
13987 On Windows CE, operator new/delete, new[]/delete[] with const
13988 std::nothrow_t& must be overrided because some standard template
13989 libraries use these operators.
13991 The problem occurs when memory allocated by new(size_t s, const
13992 std::nothrow_t&) is freed by delete(void* p). This causes the umatched
13993 malloc/free problem.
13995 The patch overrides all new, delete, new[] and delete[] to use
13996 fastMaloc and fastFree consistently.
13998 * wtf/FastMalloc.h:
14001 2009-06-30 Gabor Loki <loki@inf.u-szeged.hu>
14003 Reviewed by Sam Weinig.
14005 <https://bugs.webkit.org/show_bug.cgi?id=24986>
14007 Remove unnecessary references to AssemblerBuffer.
14009 * interpreter/Interpreter.cpp:
14010 * interpreter/Interpreter.h:
14012 2009-06-29 David Levin <levin@chromium.org>
14014 Reviewed by Oliver Hunt.
14016 Still seeing occasional leaks from UString::sharedBuffer code
14017 https://bugs.webkit.org/show_bug.cgi?id=26420
14019 The problem is that the pointer to the memory allocation isn't visible
14020 by "leaks" due to the lower bits being used as flags. The fix is to
14021 make the pointer visible in memory (in debug only). The downside of
14022 this fix that the memory allocated by sharedBuffer will still look like
14023 a leak in non-debug builds when any flags are set.
14025 * wtf/PtrAndFlags.h:
14026 (WTF::PtrAndFlags::set):
14028 2009-06-29 Sam Weinig <sam@webkit.org>
14030 Reviewed by Mark Rowe.
14032 Remove more unused scons support.
14034 * SConstruct: Removed.
14036 2009-06-29 Oliver Hunt <oliver@apple.com>
14038 Reviewed by Gavin Barraclough.
14040 <rdar://problem/7016214> JSON.parse fails to parse valid JSON with most Unicode characters
14041 <https://bugs.webkit.org/show_bug.cgi?id=26802>
14043 In the original JSON.parse patch unicode was handled correctly, however in some last
14044 minute "clean up" I oversimplified isSafeStringCharacter. This patch corrects this bug.
14046 * runtime/LiteralParser.cpp:
14047 (JSC::isSafeStringCharacter):
14048 (JSC::LiteralParser::Lexer::lexString):
14050 2009-06-26 Oliver Hunt <oliver@apple.com>
14052 Reviewed by Dan Bernstein.
14054 <rdar://problem/7009684> REGRESSION(r45039): Crashes inside JSEvent::put on PowerPC (26746)
14055 <https://bugs.webkit.org/show_bug.cgi?id=26746>
14057 Fix for r45039 incorrectly uncached a get_by_id by converting it to put_by_id. Clearly this
14058 is less than correct. This patch corrects that error.
14060 * interpreter/Interpreter.cpp:
14061 (JSC::Interpreter::tryCacheGetByID):
14063 2009-06-26 Eric Seidel <eric@webkit.org>
14065 No review, only rolling out r45259.
14067 Roll out r45259 after crash appeared on the bots:
14068 plugins/undefined-property-crash.html
14069 ASSERTION FAILED: s <= HeapConstants<heapType>::cellSize
14070 (leopard-intel-debug-tests/build/JavaScriptCore/runtime/Collector.cpp:278
14071 void* JSC::Heap::heapAllocate(size_t) [with JSC::HeapType heapType = PrimaryHeap])
14073 * runtime/DateInstance.cpp:
14074 * runtime/Identifier.cpp:
14075 * runtime/Lookup.h:
14076 * runtime/RegExpConstructor.cpp:
14077 * runtime/RegExpObject.h:
14078 * runtime/ScopeChain.h:
14079 * runtime/UString.h:
14081 2009-06-26 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
14083 Reviewed by Simon Hausmann.
14085 Add support for QDataStream operators to Vector.
14091 2009-06-24 Sam Weinig <sam@webkit.org>
14093 Reviewed by Gavin Barraclough.
14095 Make the opcode sampler work once again.
14098 (JSC::JIT::compileGetByIdProto):
14099 (JSC::JIT::compileGetByIdSelfList):
14100 (JSC::JIT::compileGetByIdProtoList):
14101 (JSC::JIT::compileGetByIdChainList):
14102 (JSC::JIT::compileGetByIdChain):
14103 (JSC::JIT::compilePutByIdTransition):
14104 (JSC::JIT::compileCTIMachineTrampolines):
14105 (JSC::JIT::compilePatchGetArrayLength):
14106 * jit/JITStubCall.h:
14107 (JSC::JITStubCall::call):
14109 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14111 Reviewed by Maciej Stachowiak.
14113 Extend FastAllocBase.h with 'using WTF::FastAllocBase' to avoid
14114 unnecessary WTF:: usings.
14115 Remove existing unnecessary WTF:: usings.
14117 * interpreter/Interpreter.h:
14118 * profiler/CallIdentifier.h:
14119 * runtime/ScopeChain.h:
14120 * wtf/FastAllocBase.h:
14122 2009-06-24 David Levin <levin@chromium.org>
14126 * bytecode/CodeBlock.h:
14127 * bytecompiler/BytecodeGenerator.h:
14128 * interpreter/Register.h:
14130 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14132 Reviewed by Maciej Stachowiak.
14134 https://bugs.webkit.org/show_bug.cgi?id=26677
14136 Inherits CodeBlock class from FastAllocBase because it
14137 has been instantiated by 'new' in JavaScriptCore/bytecode/CodeBlock.h:217.
14139 * bytecode/CodeBlock.h:
14141 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14143 Reviewed by Maciej Stachowiak.
14145 https://bugs.webkit.org/show_bug.cgi?id=26676
14147 Inherits BytecodeGenerator class from FastAllocBase because it has been
14148 instantiated by 'new' in JavaScriptCore/parser/Nodes.cpp:1892.
14150 * bytecompiler/BytecodeGenerator.h:
14152 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14154 Reviewed by Maciej Stachowiak.
14156 https://bugs.webkit.org/show_bug.cgi?id=26675
14158 Inherits Register class from FastAllocBase because it has been
14159 instantiated by 'new' in JavaScriptCore/runtime/JSVariableObject.h:149.
14161 * interpreter/Register.h:
14163 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14165 Reviewed by Darin Adler.
14167 https://bugs.webkit.org/show_bug.cgi?id=26674
14169 Inherits HashMap class from FastAllocBase because it has been
14170 instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:458.
14174 2009-06-24 Oliver Hunt <oliver@apple.com>
14176 Reviewed by Darin Adler.
14178 <rdar://problem/6940519> REGRESSION (Safari 4 Public Beta - TOT): google.com/adplanner shows blank page instead of site details in "basic research'
14180 The problem was caused by the page returned with a function using a
14181 var declaration list containing around ~3000 variables. The solution
14182 to this is to flatten the comma expression representation and make
14183 codegen comma expressions and initializer lists iterative rather than
14186 * parser/Grammar.y:
14187 * parser/NodeConstructors.h:
14188 (JSC::CommaNode::CommaNode):
14189 * parser/Nodes.cpp:
14190 (JSC::CommaNode::emitBytecode):
14192 (JSC::ExpressionNode::isCommaNode):
14193 (JSC::CommaNode::isCommaNode):
14194 (JSC::CommaNode::append):
14196 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14198 Reviewed by Maciej Stachowiak.
14200 https://bugs.webkit.org/show_bug.cgi?id=26645
14202 Inherits ScopeChainNode class from FastAllocBase because it has been
14203 instantiated by 'new' in JavaScriptCore/runtime/ScopeChain.h:95.
14207 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14209 Reviewed by Darin Adler.
14211 https://bugs.webkit.org/show_bug.cgi?id=26648
14213 Inherits Deque class from FastAllocBase because it has been
14214 instantiated by 'new' with DEFINE_STATIC_LOCAL macro in
14215 JavaScriptCore/wtf/MainThread.cpp:62.
14219 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14221 Reviewed by Darin Adler.
14223 https://bugs.webkit.org/show_bug.cgi?id=26644
14225 Inherits RefPtr class from FastAllocBase because it has been
14226 instantiated by 'new' in JavaScriptCore/runtime/StructureChain.cpp:41.
14230 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14232 Reviewed by Darin Adler.
14234 Inherits HashSet class from FastAllocBase, because it has been
14235 instantiated by 'new' in JavaScriptCore/runtime/Collector.h:116.
14239 2009-06-24 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14241 Reviewed by Darin Adler.
14243 Inherits Vector class from FastAllocBase because it has been
14244 instantiated by 'new' in JavaScriptCore/runtime/Structure.cpp:633.
14248 2009-06-24 Norbert Leser <norbert.leser@nokia.com>
14250 Reviewed by Maciej Stachoviak.
14252 The BytecodeGenerator objects were instantiated on stack, which takes up ~38kB per instance
14253 (each instance includes copy of JSC::CodeBlock with large SymbolTable, etc.).
14254 Specifically, since there is nested invocation (e.g., GlobalCode --> FunctionCode),
14255 the stack overflows immediately on Symbian hardware (max. 80 kB).
14256 Proposed change allocates generator objects on heap.
14257 Performance impact (if any) should be negligible and change is proposed as general fix,
14258 rather than ifdef'd for SYMBIAN.
14260 * parser/Nodes.cpp:
14261 (JSC::ProgramNode::generateBytecode):
14262 (JSC::EvalNode::generateBytecode):
14263 (JSC::EvalNode::bytecodeForExceptionInfoReparse):
14264 (JSC::FunctionBodyNode::generateBytecode):
14265 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
14267 2009-06-23 Oliver Hunt <oliver@apple.com>
14269 Reviewed by Gavin Barraclough.
14271 <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593)
14272 <https://bugs.webkit.org/show_bug.cgi?id=26593>
14274 Do not attempt to cache structure chains if they contain a dictionary at any level.
14276 * interpreter/Interpreter.cpp:
14277 (JSC::Interpreter::tryCachePutByID):
14278 (JSC::Interpreter::tryCacheGetByID):
14279 * jit/JITStubs.cpp:
14280 (JSC::JITThunks::tryCachePutByID):
14281 * runtime/Structure.cpp:
14282 (JSC::Structure::getEnumerablePropertyNames):
14283 (JSC::Structure::addPropertyTransition):
14284 * runtime/StructureChain.cpp:
14285 (JSC::StructureChain::isCacheable):
14286 * runtime/StructureChain.h:
14288 2009-06-23 Yong Li <yong.li@torchmobile.com>
14290 Reviewed by George Staikos.
14292 https://bugs.webkit.org/show_bug.cgi?id=26654
14293 Add the proper export define for the JavaScriptCore API when building for WINCE.
14297 2009-06-23 Joe Mason <joe.mason@torchmobile.com>
14299 Reviewed by Adam Treat.
14301 Authors: Yong Li <yong.li@torchmobile.com>, Joe Mason <joe.mason@torchmobile.com>
14303 https://bugs.webkit.org/show_bug.cgi?id=26611
14304 Implement currentThreadStackBase on WINCE by adding a global,
14305 g_stackBase, which must be set to the address of a local variable
14306 by the caller before calling any WebKit function that invokes JSC.
14308 * runtime/Collector.cpp:
14309 (JSC::isPageWritable):
14310 (JSC::getStackBase):
14311 Starts at the top of the stack and returns the entire range of
14312 consecutive writable pages as an estimate of the actual stack.
14313 This will be much bigger than the actual stack range, so some
14314 dead objects can't be collected, but it guarantees live objects
14315 aren't collected prematurely.
14317 (JSC::currentThreadStackBase):
14318 On WinCE, returns g_stackBase if set or call getStackBase as a
14321 2009-06-23 Oliver Hunt <oliver@apple.com>
14323 Reviewed by Alexey Proskuryakov.
14325 Fix stupid performance problem in the LiteralParser
14327 The LiteralParser was making a new UString in order to use
14328 toDouble, however UString's toDouble allows a much wider range
14329 of numberic strings than the LiteralParser accepts, and requires
14330 an additional heap allocation or two for the construciton of the
14331 UString. To rectify this we just call WTF::dtoa directly using
14332 a stack allocated buffer to hold the validated numeric literal.
14334 * runtime/LiteralParser.cpp:
14335 (JSC::LiteralParser::Lexer::lexNumber):
14336 (JSC::LiteralParser::parse):
14337 * runtime/LiteralParser.h:
14339 2009-06-22 Oliver Hunt <oliver@apple.com>
14341 Reviewed by Alexey Proskuryakov.
14343 Bug 26640: JSON.stringify needs to special case Boolean objects
14344 <https://bugs.webkit.org/show_bug.cgi?id=26640>
14346 Add special case handling of the Boolean object so we match current
14349 * runtime/JSONObject.cpp:
14350 (JSC::unwrapBoxedPrimitive): renamed from unwrapNumberOrString
14352 (JSC::Stringifier::appendStringifiedValue):
14354 2009-06-22 Oliver Hunt <oliver@apple.com>
14356 Reviewed by Darin Adler.
14358 Bug 26591: Support revivers in JSON.parse
14359 <https://bugs.webkit.org/show_bug.cgi?id=26591>
14361 Add reviver support to JSON.parse. This completes the JSON object.
14363 * runtime/JSONObject.cpp:
14364 (JSC::Walker::Walker):
14365 (JSC::Walker::callReviver):
14366 (JSC::Walker::walk):
14367 (JSC::JSONProtoFuncParse):
14369 2009-06-21 Oliver Hunt <oliver@apple.com>
14371 Reviewed by Darin Adler.
14373 Bug 26592: Support standard toJSON functions
14374 <https://bugs.webkit.org/show_bug.cgi?id=26592>
14376 Add support for the standard Date.toJSON function.
14378 * runtime/DatePrototype.cpp:
14379 (JSC::dateProtoFuncToJSON):
14381 2009-06-21 Oliver Hunt <oliver@apple.com>
14383 Reviewed by Sam Weinig.
14385 Bug 26594: JSC needs to support Date.toISOString
14386 <https://bugs.webkit.org/show_bug.cgi?id=26594>
14388 Add support for Date.toISOString.
14390 * runtime/DatePrototype.cpp:
14391 (JSC::dateProtoFuncToISOString):
14393 2009-06-21 Oliver Hunt <oliver@apple.com>
14397 * runtime/LiteralParser.cpp:
14398 (JSC::LiteralParser::parse):
14400 2009-06-21 Oliver Hunt <oliver@apple.com>
14402 Reviewed by Darin Adler and Cameron Zwarich.
14404 Bug 26587: Support JSON.parse
14405 <https://bugs.webkit.org/show_bug.cgi?id=26587>
14407 Extend the LiteralParser to support the full strict JSON
14408 grammar, fix a few places where the grammar was incorrectly
14409 lenient. Doesn't yet support the JSON.parse reviver function
14410 but that does not block the JSON.parse functionality itself.
14412 * interpreter/Interpreter.cpp:
14413 (JSC::Interpreter::callEval):
14414 * runtime/JSGlobalObjectFunctions.cpp:
14415 (JSC::globalFuncEval):
14416 * runtime/JSONObject.cpp:
14417 (JSC::JSONProtoFuncParse):
14418 * runtime/LiteralParser.cpp:
14419 (JSC::LiteralParser::Lexer::lex):
14420 (JSC::isSafeStringCharacter):
14421 (JSC::LiteralParser::Lexer::lexString):
14422 (JSC::LiteralParser::parse):
14423 * runtime/LiteralParser.h:
14424 (JSC::LiteralParser::LiteralParser):
14425 (JSC::LiteralParser::tryJSONParse):
14426 (JSC::LiteralParser::):
14427 (JSC::LiteralParser::Lexer::Lexer):
14429 2009-06-21 David Levin <levin@chromium.org>
14431 Reviewed by NOBODY (speculative build fix for windows).
14433 Simply removed some whitespace form this file to make windows build wtf and
14434 hopefully copy the new MessageQueque.h so that WebCore picks it up.
14436 * wtf/Assertions.cpp:
14438 2009-06-21 Drew Wilson <atwilson@google.com>
14440 Reviewed by David Levin.
14442 <https://bugs.webkit.org/show_bug.cgi?id=25043>
14443 Added support for multi-threaded MessagePorts.
14445 * wtf/MessageQueue.h:
14446 (WTF::::appendAndCheckEmpty):
14447 Added API to test whether the queue was empty before adding an element.
14449 2009-06-20 David D. Kilzer <ddkilzer@webkit.org>
14451 Fix namespace comment in SegmentedVector.h
14453 * wtf/SegmentedVector.h: Updated namespace comment to reflect
14454 new namespace after r44897.
14456 2009-06-20 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
14458 Bug 24986: ARM JIT port
14459 <https://bugs.webkit.org/show_bug.cgi?id=24986>
14461 Reviewed by Oliver Hunt.
14463 An Iterator added for SegmentedVector. Currently
14464 only the pre ++ operator is supported.
14466 * wtf/SegmentedVector.h:
14467 (WTF::SegmentedVectorIterator::~SegmentedVectorIterator):
14468 (WTF::SegmentedVectorIterator::operator*):
14469 (WTF::SegmentedVectorIterator::operator->):
14470 (WTF::SegmentedVectorIterator::operator++):
14471 (WTF::SegmentedVectorIterator::operator==):
14472 (WTF::SegmentedVectorIterator::operator!=):
14473 (WTF::SegmentedVectorIterator::operator=):
14474 (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
14475 (WTF::SegmentedVector::alloc):
14476 (WTF::SegmentedVector::begin):
14477 (WTF::SegmentedVector::end):
14479 2009-06-20 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
14481 Bug 24986: ARM JIT port
14482 <https://bugs.webkit.org/show_bug.cgi?id=24986>
14484 Reviewed by Oliver Hunt.
14486 Move SegmentedVector to /wtf subdirectory
14487 and change "namespace JSC" to "namespace WTF"
14489 Additional build file updates by David Kilzer.
14491 * GNUmakefile.am: Updated path to SegmentedVector.h.
14492 * JavaScriptCore.order: Updated SegmentedVector namespace from
14493 JSC to WTF in mangled C++ method name.
14494 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
14495 Removed reference to bytecompiler\SegmentedVector.h.
14496 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added reference to
14497 wtf\SegmentedVector.h.
14498 * JavaScriptCore.xcodeproj/project.pbxproj: Moved
14499 SegmentedVector.h definition from bytecompiler subdirectory to
14501 * bytecompiler/BytecodeGenerator.h: Updated #include path to
14502 SegmentedVector.h and prepended WTF:: namespace to its use.
14503 * parser/Lexer.h: Ditto.
14504 * wtf/SegmentedVector.h: Renamed from JavaScriptCore/bytecompiler/SegmentedVector.h.
14505 (WTF::SegmentedVector::SegmentedVector):
14506 (WTF::SegmentedVector::~SegmentedVector):
14507 (WTF::SegmentedVector::size):
14508 (WTF::SegmentedVector::at):
14509 (WTF::SegmentedVector::operator[]):
14510 (WTF::SegmentedVector::last):
14511 (WTF::SegmentedVector::append):
14512 (WTF::SegmentedVector::removeLast):
14513 (WTF::SegmentedVector::grow):
14514 (WTF::SegmentedVector::clear):
14515 (WTF::SegmentedVector::deleteAllSegments):
14516 (WTF::SegmentedVector::segmentExistsFor):
14517 (WTF::SegmentedVector::segmentFor):
14518 (WTF::SegmentedVector::subscriptFor):
14519 (WTF::SegmentedVector::ensureSegmentsFor):
14520 (WTF::SegmentedVector::ensureSegment):
14522 2009-06-19 Gavin Barraclough <barraclough@apple.com>
14524 Reviewed by NOBODY (build fix take 2 - rename FIELD_OFFSET to something that doesn't conflict with winnt.h).
14527 (JSC::JIT::privateCompile):
14528 (JSC::JIT::privateCompileCTIMachineTrampolines):
14529 (JSC::JIT::emitGetVariableObjectRegister):
14530 (JSC::JIT::emitPutVariableObjectRegister):
14532 * jit/JITArithmetic.cpp:
14533 (JSC::JIT::emit_op_rshift):
14534 (JSC::JIT::emitSlow_op_jnless):
14535 (JSC::JIT::emitSlow_op_jnlesseq):
14536 (JSC::JIT::compileBinaryArithOp):
14538 (JSC::JIT::compileOpCallInitializeCallFrame):
14539 (JSC::JIT::compileOpCall):
14540 * jit/JITInlineMethods.h:
14541 (JSC::JIT::restoreArgumentReference):
14542 (JSC::JIT::checkStructure):
14543 * jit/JITOpcodes.cpp:
14544 (JSC::JIT::emit_op_instanceof):
14545 (JSC::JIT::emit_op_get_scoped_var):
14546 (JSC::JIT::emit_op_put_scoped_var):
14547 (JSC::JIT::emit_op_construct_verify):
14548 (JSC::JIT::emit_op_resolve_global):
14549 (JSC::JIT::emit_op_jeq_null):
14550 (JSC::JIT::emit_op_jneq_null):
14551 (JSC::JIT::emit_op_to_jsnumber):
14552 (JSC::JIT::emit_op_catch):
14553 (JSC::JIT::emit_op_eq_null):
14554 (JSC::JIT::emit_op_neq_null):
14555 (JSC::JIT::emit_op_convert_this):
14556 (JSC::JIT::emit_op_profile_will_call):
14557 (JSC::JIT::emit_op_profile_did_call):
14558 (JSC::JIT::emitSlow_op_get_by_val):
14559 * jit/JITPropertyAccess.cpp:
14560 (JSC::JIT::emit_op_get_by_val):
14561 (JSC::JIT::emit_op_put_by_val):
14562 (JSC::JIT::emit_op_method_check):
14563 (JSC::JIT::compileGetByIdHotPath):
14564 (JSC::JIT::emit_op_put_by_id):
14565 (JSC::JIT::compilePutDirectOffset):
14566 (JSC::JIT::compileGetDirectOffset):
14567 (JSC::JIT::privateCompilePutByIdTransition):
14568 (JSC::JIT::privateCompilePatchGetArrayLength):
14569 * jit/JITStubs.cpp:
14570 (JSC::JITThunks::JITThunks):
14572 2009-06-19 Gavin Barraclough <barraclough@apple.com>
14574 Reviewed by NOBODY (Windows build fix).
14577 * jit/JITInlineMethods.h:
14579 2009-06-19 Gabor Loki <loki@inf.u-szeged.hu>
14581 Reviewed by Gavin Barraclough.
14583 Reorganize ARM architecture specific macros.
14584 Use PLATFORM_ARM_ARCH(7) instead of PLATFORM(ARM_V7).
14586 Bug 24986: ARM JIT port
14587 <https://bugs.webkit.org/show_bug.cgi?id=24986>
14589 * assembler/ARMv7Assembler.h:
14590 * assembler/AbstractMacroAssembler.h:
14591 (JSC::AbstractMacroAssembler::Imm32::Imm32):
14592 * assembler/MacroAssembler.h:
14593 * assembler/MacroAssemblerCodeRef.h:
14594 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
14595 * jit/ExecutableAllocator.h:
14596 (JSC::ExecutableAllocator::cacheFlush):
14598 * jit/JITInlineMethods.h:
14599 (JSC::JIT::restoreArgumentReferenceForTrampoline):
14600 * jit/JITStubs.cpp:
14603 * yarr/RegexJIT.cpp:
14604 (JSC::Yarr::RegexGenerator::generateEnter):
14605 (JSC::Yarr::RegexGenerator::generateReturn):
14607 2009-06-19 Gavin Barraclough <barraclough@apple.com>
14609 Reviewed by Oliver Hunt.
14611 Fix armv7 JIT build issues.
14613 Unfortunate the arm compiler does not like the use of offsetof on JITStackFrame (since it now contains non POD types),
14614 and the FIELD_OFFSET macro does not appear constantish enough for it to be happy with its use in COMPILE_ASSERT macros.
14616 * Replace offsetofs with FIELD_OFFSETs (safe on C++ objects).
14617 * Move COMPILE_ASSERTs defending layout of JITStackFrame structure on armv7 into JITThunks constructor.
14621 * jit/JITInlineMethods.h:
14622 (JSC::JIT::restoreArgumentReference):
14623 * jit/JITOpcodes.cpp:
14624 (JSC::JIT::emit_op_catch):
14625 * jit/JITStubs.cpp:
14626 (JSC::JITThunks::JITThunks):
14628 2009-06-19 Adam Treat <adam.treat@torchmobile.com>
14630 Blind attempt at build fix.
14632 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
14633 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
14635 2009-06-19 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14637 Reviewed by Oliver Hunt.
14639 Inherits CallIdentifier struct from FastAllocBase because it has been
14640 instantiated by 'new' in JavaScriptCore/profiler/CallIdentifier.h:86.
14642 * wtf/HashCountedSet.h:
14644 2009-06-19 Adam Treat <adam.treat@torchmobile.com>
14646 Reviewed by Oliver Hunt.
14648 https://bugs.webkit.org/show_bug.cgi?id=26540
14649 Modify the test shell to add a new function 'checkSyntax' that will
14650 only parse the source instead of executing it. In this way we can test
14651 pure parsing performance against some of the larger scripts in the wild.
14654 (GlobalObject::GlobalObject):
14655 (functionCheckSyntax):
14657 2009-06-19 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
14659 Reviewed by Darin Adler.
14661 Inherits HashCountedSet class from FastAllocBase because it has been
14662 instantiated by 'new' in JavaScriptCore/runtime/Collector.cpp:1095.
14664 * wtf/HashCountedSet.h:
14666 2009-06-19 Yong Li <yong.li@torchmobile.com>
14668 Reviewed by George Staikos.
14670 https://bugs.webkit.org/show_bug.cgi?id=26558
14671 Declare these symbols extern for WINCE as they are provided by libce.
14673 * runtime/DateConstructor.cpp:
14674 * runtime/DatePrototype.cpp:
14675 (JSC::formatLocaleDate):
14677 2009-06-19 Oliver Hunt <oliver@apple.com>
14679 Reviewed by Maciej Stachowiak.
14681 <rdar://problem/6988973> ScopeChain leak in interpreter builds
14683 Move the Scopechain destruction code in JSFunction outside of the ENABLE(JIT)
14686 * runtime/JSFunction.cpp:
14687 (JSC::JSFunction::~JSFunction):
14690 2009-06-19 Yong Li <yong.li@torchmobile.com>
14692 Reviewed by George Staikos.
14694 https://bugs.webkit.org/show_bug.cgi?id=26543
14695 Windows CE uses 'GetLastError' instead of 'errno.'
14697 * interpreter/RegisterFile.h:
14698 (JSC::RegisterFile::RegisterFile):
14699 (JSC::RegisterFile::grow):
14701 2009-06-19 David Levin <levin@chromium.org>
14703 Reviewed by NOBODY (Windows build fix).
14705 Add export for Windows corresponding to OSX export done in r44844.
14706 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
14707 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
14709 2009-06-18 Oliver Hunt <oliver@apple.com>
14711 Reviewed by Gavin "Viceroy of Venezuela" Barraclough.
14713 Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
14714 <https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>
14716 We need to make sure that each native function instance correctly unlinks any references to it
14717 when it is collected. Allowing this to happen required a few changes:
14718 * Every native function needs a codeblock to track the link information
14719 * To have this codeblock, every function now also needs its own functionbodynode
14720 so we no longer get to have a single shared instance.
14721 * Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
14723 * JavaScriptCore.exp:
14724 * bytecode/CodeBlock.cpp:
14725 (JSC::CodeBlock::CodeBlock):
14726 Constructor for NativeCode CodeBlock
14727 (JSC::CodeBlock::derefStructures):
14728 (JSC::CodeBlock::refStructures):
14729 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
14730 (JSC::CodeBlock::handlerForBytecodeOffset):
14731 (JSC::CodeBlock::lineNumberForBytecodeOffset):
14732 (JSC::CodeBlock::expressionRangeForBytecodeOffset):
14733 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
14734 (JSC::CodeBlock::functionRegisterForBytecodeOffset):
14735 (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
14736 (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
14737 (JSC::CodeBlock::setJITCode):
14738 Add assertions to ensure we don't try and use NativeCode CodeBlocks as
14739 a normal codeblock.
14741 * bytecode/CodeBlock.h:
14743 (JSC::CodeBlock::source):
14744 (JSC::CodeBlock::sourceOffset):
14745 (JSC::CodeBlock::evalCodeCache):
14746 (JSC::CodeBlock::createRareDataIfNecessary):
14750 (JSC::JIT::privateCompileCTIMachineTrampolines):
14751 (JSC::JIT::linkCall):
14752 Update logic to allow native function caching
14754 * jit/JITStubs.cpp:
14755 * parser/Nodes.cpp:
14756 (JSC::FunctionBodyNode::createNativeThunk):
14757 (JSC::FunctionBodyNode::isHostFunction):
14759 * runtime/JSFunction.cpp:
14760 (JSC::JSFunction::JSFunction):
14761 (JSC::JSFunction::~JSFunction):
14762 (JSC::JSFunction::mark):
14763 * runtime/JSGlobalData.cpp:
14764 (JSC::JSGlobalData::~JSGlobalData):
14765 * runtime/JSGlobalData.h:
14767 2009-06-18 Gavin Barraclough <barraclough@apple.com>
14769 Reviewed by NOBODY (Windows build fix).
14771 * wtf/DateMath.cpp:
14772 (WTF::calculateUTCOffset):
14774 2009-06-18 Gavin Barraclough <barraclough@apple.com>
14776 Reviewed by Geoff Garen.
14778 Timezone calculation incorrect in Venezuela.
14780 https://bugs.webkit.org/show_bug.cgi?id=26531
14781 <rdar://problem/6646169> Time is incorrectly reported to JavaScript in both Safari 3 and Firefox 3
14783 The problem is that we're calculating the timezone relative to 01/01/2000,
14784 but the VET timezone changed from -4 hours to -4:30 hours on 12/09/2007.
14785 According to the spec, section 15.9.1.9 states "the time since the beginning
14786 of the year", presumably meaning the *current* year. Change the calculation
14787 to be based on whatever the current year is, rather than a canned date.
14789 No performance impact.
14791 * wtf/DateMath.cpp:
14792 (WTF::calculateUTCOffset):
14794 2009-06-18 Gavin Barraclough <barraclough@apple.com>
14796 Rubber Stamped by Mark Rowe (originally reviewed by Sam Weinig).
14798 (Reintroducing patch added in r44492, and reverted in r44796.)
14800 Change the implementation of op_throw so the stub function always modifies its
14801 return address - if it doesn't find a 'catch' it will switch to a trampoline
14802 to force a return from JIT execution. This saves memory, by avoiding the need
14803 for a unique return for every op_throw.
14805 * jit/JITOpcodes.cpp:
14806 (JSC::JIT::emit_op_throw):
14807 JITStubs::cti_op_throw now always changes its return address,
14808 remove return code generated after the stub call (this is now
14809 handled by ctiOpThrowNotCaught).
14810 * jit/JITStubs.cpp:
14812 Add ctiOpThrowNotCaught definitions.
14813 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
14814 Change cti_op_throw to always change its return address.
14816 Add ctiOpThrowNotCaught declaration.
14818 2009-06-18 Kevin McCullough <kmccullough@apple.com>
14820 Reviewed by Oliver Hunt.
14822 <rdar://problem/6940880> REGRESSION: Breakpoints don't break in 64-bit
14824 - Exposed functions now needed by WebCore.
14826 * JavaScriptCore.exp:
14828 2009-06-17 Darin Adler <darin@apple.com>
14830 Reviewed by Oliver Hunt.
14832 Bug 26429: Make JSON.stringify non-recursive so it can handle objects
14833 of arbitrary complexity
14834 https://bugs.webkit.org/show_bug.cgi?id=26429
14836 For marking I decided not to use gcProtect, because this is inside the engine
14837 so it's easy enough to just do marking. And that darned gcProtect does locking!
14838 Oliver tried to convince me to used MarkedArgumentBuffer, but the constructor
14839 for that class says "FIXME: Remove all clients of this API, then remove this API."
14841 * runtime/Collector.cpp:
14842 (JSC::Heap::collect): Add a call to JSONObject::markStringifiers.
14844 * runtime/CommonIdentifiers.cpp:
14845 (JSC::CommonIdentifiers::CommonIdentifiers): Added emptyIdentifier.
14846 * runtime/CommonIdentifiers.h: Ditto.
14848 * runtime/JSGlobalData.cpp:
14849 (JSC::JSGlobalData::JSGlobalData): Initialize firstStringifierToMark to 0.
14850 * runtime/JSGlobalData.h: Added firstStringifierToMark.
14852 * runtime/JSONObject.cpp: Cut down the includes to the needed ones only.
14853 (JSC::unwrapNumberOrString): Added. Helper for unwrapping number and string
14854 objects to get their number and string values.
14855 (JSC::ReplacerPropertyName::ReplacerPropertyName): Added. The class is used
14856 to wrap an identifier or integer so we don't have to do any work unless we
14857 actually call a replacer.
14858 (JSC::ReplacerPropertyName::value): Added.
14859 (JSC::gap): Added. Helper function for the Stringifier constructor.
14860 (JSC::PropertyNameForFunctionCall::PropertyNameForFunctionCall): Added.
14861 The class is used to wrap an identifier or integer so we don't have to
14862 allocate a number or string until we actually call toJSON or a replacer.
14863 (JSC::PropertyNameForFunctionCall::asJSValue): Added.
14864 (JSC::Stringifier::Stringifier): Updated and moved out of the class
14865 definition. Added code to hook this into a singly linked list for marking.
14866 (JSC::Stringifier::~Stringifier): Remove from the singly linked list.
14867 (JSC::Stringifier::mark): Mark all the objects in the holder stacks.
14868 (JSC::Stringifier::stringify): Updated.
14869 (JSC::Stringifier::appendQuotedString): Tweaked and streamlined a bit.
14870 (JSC::Stringifier::toJSON): Renamed from toJSONValue.
14871 (JSC::Stringifier::appendStringifiedValue): Renamed from stringify.
14872 Added code to use the m_holderStack to do non-recursive stringify of
14873 objects and arrays. This code also uses the timeout checker since in
14874 pathological cases it could be slow even without calling into the
14875 JavaScript virtual machine.
14876 (JSC::Stringifier::willIndent): Added.
14877 (JSC::Stringifier::indent): Added.
14878 (JSC::Stringifier::unindent): Added.
14879 (JSC::Stringifier::startNewLine): Added.
14880 (JSC::Stringifier::Holder::Holder): Added.
14881 (JSC::Stringifier::Holder::appendNextProperty): Added. This is the
14882 function that handles the format of arrays and objects.
14883 (JSC::JSONObject::getOwnPropertySlot): Moved this down to the bottom
14884 of the file so the JSONObject class is not interleaved with the
14886 (JSC::JSONObject::markStringifiers): Added. Calls mark.
14887 (JSC::JSONProtoFuncStringify): Streamlined the code here. The code
14888 to compute the gap string is now a separate function.
14890 * runtime/JSONObject.h: Made everything private. Added markStringifiers.
14892 2009-06-17 Oliver Hunt <oliver@apple.com>
14894 Reviewed by Gavin Barraclough.
14896 <rdar://problem/6974140> REGRESSION(r43849): Crash in cti_op_call_NotJSFunction when getting directions on maps.google.com
14898 Roll out r43849 as it appears that we cannot rely on the address of
14899 an objects property storage being constant even if the structure is
14903 * jit/JITPropertyAccess.cpp:
14904 (JSC::JIT::compileGetDirectOffset):
14905 (JSC::JIT::privateCompileGetByIdProto):
14906 (JSC::JIT::privateCompileGetByIdProtoList):
14907 (JSC::JIT::privateCompileGetByIdChainList):
14908 (JSC::JIT::privateCompileGetByIdChain):
14910 2009-06-17 Gavin Barraclough <barraclough@apple.com>
14912 Rubber Stamped by Mark Rowe.
14914 Fully revert r44492 & r44748 while we fix a bug they cause on internal builds <rdar://problem/6955963>.
14916 * jit/JITOpcodes.cpp:
14917 (JSC::JIT::emit_op_throw):
14918 * jit/JITStubs.cpp:
14920 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
14923 2009-06-17 Gavin Barraclough <barraclough@apple.com>
14925 Reviewed by Mark Rowe.
14927 <rdar://problem/6947426> sunspider math-cordic.js exhibits different intermediate results running 32-bit vs. 64-bit
14929 On 64-bit, NaN-encoded values must be detagged before they can be used in rshift.
14931 No performance impact.
14933 * jit/JITArithmetic.cpp:
14934 (JSC::JIT::emit_op_rshift):
14936 2009-06-17 Adam Treat <adam.treat@torchmobile.com>
14938 Reviewed by George Staikos.
14940 https://bugs.webkit.org/show_bug.cgi?id=23155
14941 Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
14946 2009-06-17 George Staikos <george.staikos@torchmobile.com>
14948 Reviewed by Adam Treat.
14950 https://bugs.webkit.org/show_bug.cgi?id=23155
14951 Move WIN_CE -> WINCE as previously discussed with Qt WINCE folks.
14955 * wtf/Assertions.cpp:
14956 * wtf/Assertions.h:
14957 * wtf/CurrentTime.cpp:
14958 (WTF::lowResUTCTime):
14959 * wtf/DateMath.cpp:
14960 (WTF::getLocalTime):
14961 * wtf/MathExtras.h:
14963 * wtf/StringExtras.h:
14965 * wtf/win/MainThreadWin.cpp:
14967 2009-06-17 Gavin Barraclough <barraclough@apple.com>
14969 Reviewed by Oliver Hunt.
14971 <rdar://problem/6974175> ASSERT in JITStubs.cpp at appsaccess.apple.com
14973 Remove PropertySlot::putValue - PropertySlots should only be used for getting,
14974 not putting. Rename JSGlobalObject::getOwnPropertySlot to hasOwnPropertyForWrite,
14975 which is what it really was being used to ask, and remove some other getOwnPropertySlot
14976 & getOwnPropertySlotForWrite methods, which were unused and likely to lead to confusion.
14978 * runtime/JSGlobalObject.h:
14979 (JSC::JSGlobalObject::hasOwnPropertyForWrite):
14980 * runtime/JSObject.h:
14981 * runtime/JSStaticScopeObject.cpp:
14982 * runtime/JSStaticScopeObject.h:
14983 * runtime/PropertySlot.h:
14985 2009-06-16 Gavin Barraclough <barraclough@apple.com>
14987 Reviewed by Oliver hunt.
14989 Temporarily partially disable r44492, since this is causing some problems on internal builds.
14991 * jit/JITOpcodes.cpp:
14992 (JSC::JIT::emit_op_throw):
14993 * jit/JITStubs.cpp:
14994 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
14996 2009-06-16 Sam Weinig <sam@webkit.org>
15003 2009-06-16 Sam Weinig <sam@webkit.org>
15005 Reviewed by Oliver Hunt.
15007 Initialize m_bytecodeIndex to -1 in JIT, and correctly initialize
15008 it for each type of stub using the return address to find the correct
15014 (JSC::JIT::compileGetByIdProto):
15015 (JSC::JIT::compileGetByIdSelfList):
15016 (JSC::JIT::compileGetByIdProtoList):
15017 (JSC::JIT::compileGetByIdChainList):
15018 (JSC::JIT::compileGetByIdChain):
15019 (JSC::JIT::compilePutByIdTransition):
15020 (JSC::JIT::compileCTIMachineTrampolines):
15021 (JSC::JIT::compilePatchGetArrayLength):
15022 * jit/JITStubCall.h:
15023 (JSC::JITStubCall::call):
15025 == Rolled over to ChangeLog-2009-06-16 ==