1 2012-04-10 Darin Adler <darin@apple.com>
3 Remove unused data member from Lexer class
4 https://bugs.webkit.org/show_bug.cgi?id=83429
6 Reviewed by Kentaro Hara.
8 I noticed that m_delimited was "write-only", so I deleted it.
11 (JSC::Lexer::setCode): Removed code to set m_delimited.
12 (JSC::Lexer::parseIdentifier): Ditto.
13 (JSC::Lexer::parseIdentifierSlowCase): Ditto.
14 (JSC::Lexer::lex): Ditto.
15 * parser/Lexer.h: Deleted m_delimited.
17 2012-04-10 Patrick Gansterer <paroga@webkit.org>
19 [CMake] Enable USE_FOLDERS property
20 https://bugs.webkit.org/show_bug.cgi?id=83571
22 Reviewed by Daniel Bates.
24 Setting the FOLDER property on targets gives more structure
25 to the generated Visual Studio solutions.
26 This does not affect other CMake generators.
29 * shell/CMakeLists.txt:
31 2012-04-10 Filip Pizlo <fpizlo@apple.com>
33 It should be possible to see why a code block was not compiled by the DFG
34 https://bugs.webkit.org/show_bug.cgi?id=83553
36 Reviewed by Geoff Garen.
38 If DFG_ENABLE(DEBUG_VERBOSE) and a code block is rejected, then print the
39 opcode that caused the rejection.
41 * dfg/DFGCapabilities.cpp:
42 (JSC::DFG::debugFail):
44 (JSC::DFG::canHandleOpcodes):
46 2012-04-09 Gavin Barraclough <barraclough@apple.com>
48 If a callback constructor returns a C++ null, throw a type error.
49 https://bugs.webkit.org/show_bug.cgi?id=83537
51 Rubber Stamped by Geoff Garen.
53 * API/JSCallbackConstructor.cpp:
54 (JSC::constructJSCallback):
55 - If a callback constructor returns a C++ null, throw a type error.
56 * API/tests/testapi.c:
57 (Base_returnHardNull):
58 * API/tests/testapi.js:
59 - Add a test case for callback constructors that return a C++ null.
61 2012-04-09 Gavin Barraclough <barraclough@apple.com>
63 If a callback function returns a C++ null, convert to undefined.
64 https://bugs.webkit.org/show_bug.cgi?id=83534
66 Reviewed by Geoff Garen.
68 * API/JSCallbackFunction.cpp:
69 - If a callback function returns a C++ null, convert to undefined.
70 (JSC::JSCallbackFunction::call):
71 * API/tests/testapi.c:
72 (Base_returnHardNull):
73 * API/tests/testapi.js:
74 - Add a test case for callback functions that return a C++ null.
76 2012-04-09 Filip Pizlo <fpizlo@apple.com>
78 Classic interpreter's GC hooks shouldn't attempt to scan instructions for code blocks that
79 are currently being generated
80 https://bugs.webkit.org/show_bug.cgi?id=83531
81 <rdar://problem/11215200>
83 Reviewed by Gavin Barraclough.
85 * bytecode/CodeBlock.cpp:
86 (JSC::CodeBlock::stronglyVisitStrongReferences):
88 2012-04-09 Filip Pizlo <fpizlo@apple.com>
90 Unreviewed, modernize and clean up uses of ARM assembly mnemonics in inline asm blocks.
92 * dfg/DFGOperations.cpp:
94 * offlineasm/armv7.rb:
96 2012-04-09 Patrick Gansterer <paroga@webkit.org>
99 https://bugs.webkit.org/show_bug.cgi?id=83434
101 Reviewed by Kentaro Hara.
103 HAVE_STDINT_H is defined with 1 all the time and we us stdint.h without HAVE(STDINT_H) already.
107 2012-04-08 Filip Pizlo <fpizlo@apple.com>
109 DFG should not load the property storage if it is inline.
110 https://bugs.webkit.org/show_bug.cgi?id=83455
112 Reviewed by Gavin Barraclough.
114 We had previously decided to have all property storage accesses go through
115 the property storage pointer even if they don't "really" have to, because
116 we were thinking this would help GC barriers somehow. Well, we never ended
117 up doing anything with that. Hence, doing these wasted loads of the
118 property storage pointer when the storage is inline is just a waste of CPU
121 This change makes the DFG's inline property accesses (GetByOffset and
122 PutByOffset) go directly to the inline property storage if the structure(s)
123 tell us that it's OK.
125 This looks like an across-the-board 1% win.
127 * bytecode/StructureSet.h:
129 (JSC::StructureSet::allAreUsingInlinePropertyStorage):
131 * dfg/DFGByteCodeParser.cpp:
132 (JSC::DFG::ByteCodeParser::parseBlock):
133 * dfg/DFGSpeculativeJIT.cpp:
134 (JSC::DFG::SpeculativeJIT::fillStorage):
136 2012-04-08 Filip Pizlo <fpizlo@apple.com>
138 Command-line jsc's exception handling should be rationalized
139 https://bugs.webkit.org/show_bug.cgi?id=83437
141 Reviewed by Dan Bernstein.
143 - If an exception is thrown during run() execution, it is now propagated,
144 so that it will terminate program execution unless it is caught.
146 - If program execution terminates with an exception, the exception is now
149 - When printing the exception, the backtrace is now also printed if one is
150 available. It will only not be available if you use something akin to my
151 favorite line of code, 'throw "error"', since primitives don't have
152 properties and hence we cannot attach a "stack" property to them.
158 2012-04-04 Filip Pizlo <fpizlo@apple.com>
160 Forced OSR exits should lead to recompilation based on count, not rate
161 https://bugs.webkit.org/show_bug.cgi?id=83247
162 <rdar://problem/10720925>
164 Reviewed by Geoff Garen.
166 Track which OSR exits happen because of inadequate coverage. Count them
167 separately. If the count reaches a threshold, immediately trigger
170 This is in contrast to the recompilation trigger for all other OSR exits.
171 Normally recomp is triggered when the exit rate exceeds a certain ratio.
173 Looks like a slight V8 speedup (sub 1%).
175 * bytecode/CodeBlock.cpp:
176 (JSC::CodeBlock::CodeBlock):
177 * bytecode/CodeBlock.h:
178 (JSC::CodeBlock::forcedOSRExitCounter):
179 (JSC::CodeBlock::addressOfForcedOSRExitCounter):
180 (JSC::CodeBlock::offsetOfForcedOSRExitCounter):
181 (JSC::CodeBlock::shouldReoptimizeNow):
182 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
184 * bytecode/DFGExitProfile.h:
185 (JSC::DFG::exitKindToString):
186 * dfg/DFGOSRExitCompiler.cpp:
187 (JSC::DFG::OSRExitCompiler::handleExitCounts):
189 * dfg/DFGOSRExitCompiler.h:
191 * dfg/DFGOSRExitCompiler32_64.cpp:
192 (JSC::DFG::OSRExitCompiler::compileExit):
193 * dfg/DFGOSRExitCompiler64.cpp:
194 (JSC::DFG::OSRExitCompiler::compileExit):
195 * dfg/DFGOperations.cpp:
196 * dfg/DFGSpeculativeJIT.cpp:
197 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
198 * dfg/DFGSpeculativeJIT32_64.cpp:
199 (JSC::DFG::SpeculativeJIT::compile):
200 * dfg/DFGSpeculativeJIT64.cpp:
201 (JSC::DFG::SpeculativeJIT::compile):
202 * runtime/Options.cpp:
204 (JSC::Options::initializeOptions):
208 2012-04-06 Benjamin Poulain <bpoulain@apple.com>
210 Do not abuse ArrayStorage's m_length for testing array consistency
211 https://bugs.webkit.org/show_bug.cgi?id=83403
213 Reviewed by Geoffrey Garen.
215 Array creation from a list of values is a 3 steps process:
216 -JSArray::tryCreateUninitialized()
217 -JSArray::initializeIndex() for each values
218 -JSArray::completeInitialization()
220 Previously, the attribute m_length was not set to the final size
221 JSArray::tryCreateUninitialized() because it was used to test the array
222 consistency JSArray::initializeIndex().
224 This caused the initialization loop using JSArray::initializeIndex() maintain
229 This patch fixes this by using the index of the initialization loop for the indinces of
230 JSArray::initializeIndex(). For testing consistency, the variable m_initializationIndex
231 is introduced if CHECK_ARRAY_CONSISTENCY is defined.
233 The patch also fixes minor unrelated build issue when CHECK_ARRAY_CONSISTENCY is defined.
235 This improves the performance of JSArray creation from literals by 8%.
237 * runtime/JSArray.cpp:
238 (JSC::JSArray::tryFinishCreationUninitialized):
239 (JSC::JSArray::checkConsistency):
242 (JSC::JSArray::initializeIndex):
243 (JSC::JSArray::completeInitialization):
245 2012-04-06 Jon Lee <jonlee@apple.com>
247 Build fix for Windows bots.
249 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: export missing symbol.
251 2012-04-06 Geoffrey Garen <ggaren@apple.com>
256 HandleHeap => HandleSet
258 Reviewed by Sam Weinig.
260 These sets do have internal allocators, but it's confusing to call them
261 heaps because they're sub-objects of an object called "heap".
263 * heap/HandleHeap.cpp: Removed.
264 * heap/HandleHeap.h: Removed.
265 * heap/HandleSet.cpp: Copied from JavaScriptCore/heap/HandleHeap.cpp.
266 * heap/WeakHeap.cpp: Removed.
267 * heap/WeakHeap.h: Removed.
268 * heap/WeakSet.cpp: Copied from JavaScriptCore/heap/WeakHeap.cpp.
269 * heap/WeakSet.h: Copied from JavaScriptCore/heap/WeakHeap.h.
271 Plus global rename using grep.
273 2012-04-06 Dan Bernstein <mitz@apple.com>
275 <rdar://problem/10912476> HiDPI: Have canvas use a hidpi backing store, but downsample upon access
277 Reviewed by Sam Weinig.
279 * Configurations/FeatureDefines.xcconfig: Added ENABLE_HIGH_DPI_CANVAS.
281 2012-04-06 Rob Buis <rbuis@rim.com>
283 Fix cast-align warnings in JSC
284 https://bugs.webkit.org/show_bug.cgi?id=80790
286 Reviewed by George Staikos.
288 * assembler/ARMv7Assembler.h:
289 (JSC::ARMv7Assembler::computeJumpType):
290 (JSC::ARMv7Assembler::link):
291 * assembler/LinkBuffer.h:
292 (JSC::LinkBuffer::linkCode):
293 * heap/MarkStack.cpp:
294 (JSC::SlotVisitor::copyAndAppend):
295 * runtime/JSArray.cpp:
296 (JSC::JSArray::visitChildren):
297 * wtf/RefCountedArray.h:
298 (WTF::RefCountedArray::Header::payload):
300 2012-04-06 Darin Adler <darin@apple.com>
302 Streamline strtod and fix some related problems
303 https://bugs.webkit.org/show_bug.cgi?id=82857
305 Reviewed by Geoffrey Garen.
308 (JSC::Lexer<>::lex): Use parseDouble. Since we have already scanned the number
309 and we know it has only correct characters, leading spaces, trailing junk, and
310 trailing spaces are not a possibility. No need to add a trailing null character.
312 * runtime/JSGlobalObjectFunctions.cpp:
313 (JSC::parseInt): Changed overflow based 10 case to use parseDouble. No need
314 to allow trailing junk since the code above already allows only numeric digits
315 in the string. This code path is used only in unusual cases, so it's not
316 optimized for 8-bit strings, but easily could be.
317 (JSC::jsStrDecimalLiteral): Removed the allow trailing junk argument to this
318 function template because all the callers are OK with trailing junk. Use the
319 parseDouble function. No need to copy the data into a byte buffer, because
320 parseDouble handles that.
321 (JSC::toDouble): Got rid of the DisallowTrailingJunk argument to the
322 jsStrDecimalLiteral function template. That's OK because this function
323 already checks for trailing junk and handles it appropriately. The old code
324 path was doing it twice.
325 (JSC::parseFloat): Got rid of the AllowTrailingJunk argument to the
326 jsStrDecimalLiteral function template; the template allows junk unconditionally.
328 * runtime/LiteralParser.cpp:
329 (JSC::::Lexer::lexNumber): Use parseDouble. Since we have already scanned the number
330 and we know it has only correct characters, leading spaces, trailing junk, and
331 trailing spaces are not a possibility. No need to add a trailing null character.
332 No need to copy the data into a byte buffer, because parseDouble handles that.
333 We could optimize the UChar case even more because we know all the characters
334 are ASCII, but not doing that at this time.
336 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Updated.
338 2012-04-06 Patrick Gansterer <paroga@webkit.org>
340 Remove JSC dependency from GregorianDateTime
341 https://bugs.webkit.org/show_bug.cgi?id=83290
343 Reviewed by Geoffrey Garen.
345 This allows us to move it to WTF later.
347 * runtime/DateConstructor.cpp:
349 * runtime/JSDateMath.h:
351 2012-04-05 Michael Saboff <msaboff@apple.com>
353 Call Heap::discardAllCompiledCode() in low memory situations
354 https://bugs.webkit.org/show_bug.cgi?id=83335
356 Reviewed by Geoffrey Garen.
358 Restructured Heap::discardAllCompiledCode() to do the "Is JavaScriptRunning?"
359 check inline so that it can be called directly without this check.
362 (JSC::Heap::discardAllCompiledCode):
363 (JSC::Heap::collectAllGarbage):
364 * heap/Heap.h: Added JS_EXPORT_PRIVATE to discardAllCompiledCode() so it can be
367 * runtime/JSGlobalData.h: Removed unused " void discardAllCompiledCode()" declaration.
370 2012-04-05 Benjamin Poulain <bpoulain@apple.com>
372 Speed up the conversion from JSValue to String for bulk operations
373 https://bugs.webkit.org/show_bug.cgi?id=83243
375 Reviewed by Geoffrey Garen.
377 When making operations on primitive types, we loose some time converting
378 values to JSString in order to extract the string.
380 This patch speeds up some basic Array operations by avoiding the creation
381 of intermediary JSString when possible.
383 For the cases where we need to convert a lot of JSValue in a tight loop,
384 an inline conversion is used.
386 * runtime/ArrayPrototype.cpp:
387 (JSC::arrayProtoFuncToString):
388 (JSC::arrayProtoFuncToLocaleString):
389 (JSC::arrayProtoFuncJoin):
390 (JSC::arrayProtoFuncPush):
391 (JSC::arrayProtoFuncSort):
392 * runtime/CommonIdentifiers.h:
393 * runtime/JSArray.cpp:
394 (JSC::JSArray::sort):
395 * runtime/JSString.h:
396 (JSC::JSValue::toUString):
398 (JSC::inlineJSValueNotStringtoUString):
399 (JSC::JSValue::toUStringInline):
400 * runtime/JSValue.cpp:
401 (JSC::JSValue::toUStringSlowCase):
406 2012-04-05 Benjamin Poulain <bpoulain@apple.com>
408 Use QuickSort when sorting primitive values by string representation
409 https://bugs.webkit.org/show_bug.cgi?id=83312
411 Reviewed by Gavin Barraclough.
413 When the value we are sorting are all primitive values, we do not need to
414 ensure a stable sort as two values with equal string representation are
415 indistinguishable from JavaScript.
417 This gives about 16% performance increase when sorting primitive values.
419 * runtime/JSArray.cpp:
420 (JSC::JSArray::sort):
422 2012-04-05 Oliver Hunt <oliver@apple.com>
424 SIGILL in JavaScriptCore on a Geode processor
425 https://bugs.webkit.org/show_bug.cgi?id=82496
427 Reviewed by Gavin Barraclough.
429 Don't attempt to use the DFG when SSE2 is not available.
431 * dfg/DFGCapabilities.cpp:
432 (JSC::DFG::canCompileOpcodes):
434 2012-04-05 Oliver Hunt <oliver@apple.com>
441 2012-04-05 Oliver Hunt <oliver@apple.com>
443 Replace static_cast with jsCast when casting JSCell subclasses in JSC
444 https://bugs.webkit.org/show_bug.cgi?id=83307
446 Reviewed by Gavin Barraclough.
448 Replace all usage of static_cast<JSCell subtype*> with jsCast<> in JavaScriptCore.
449 This results in assertions when unsafe casts are performed, but simply leaves
450 a static_cast<> in release builds.
454 * API/JSCallbackConstructor.cpp:
455 (JSC::constructJSCallback):
456 * API/JSCallbackFunction.cpp:
457 (JSC::JSCallbackFunction::call):
458 * API/JSCallbackObjectFunctions.h:
459 (JSC::::asCallbackObject):
460 (JSC::::finishCreation):
463 * API/JSObjectRef.cpp:
464 (JSObjectGetPrivate):
465 (JSObjectSetPrivate):
466 (JSObjectGetPrivateProperty):
467 (JSObjectSetPrivateProperty):
468 (JSObjectDeletePrivateProperty):
469 * API/JSValueRef.cpp:
470 (JSValueIsObjectOfClass):
471 * API/JSWeakObjectMapRefPrivate.cpp:
472 * bytecompiler/BytecodeGenerator.cpp:
473 (JSC::BytecodeGenerator::resolve):
474 (JSC::BytecodeGenerator::resolveConstDecl):
475 * debugger/DebuggerActivation.cpp:
476 (JSC::DebuggerActivation::finishCreation):
477 * dfg/DFGOperations.cpp:
478 * interpreter/Interpreter.cpp:
479 (JSC::Interpreter::execute):
480 (JSC::Interpreter::privateExecute):
482 (JSC::DEFINE_STUB_FUNCTION):
483 * runtime/Executable.h:
484 (JSC::isHostFunction):
485 * runtime/JSActivation.h:
487 * runtime/JSArray.cpp:
488 (JSC::JSArray::defineOwnProperty):
491 * runtime/JSBoundFunction.cpp:
492 (JSC::boundFunctionCall):
493 (JSC::boundFunctionConstruct):
494 * runtime/JSByteArray.h:
496 * runtime/JSCell.cpp:
497 (JSC::JSCell::toObject):
500 * runtime/JSGlobalObject.h:
501 (JSC::asGlobalObject):
502 * runtime/JSGlobalObjectFunctions.cpp:
503 (JSC::globalFuncEval):
504 * runtime/JSObject.cpp:
505 (JSC::JSObject::setPrototypeWithCycleCheck):
506 (JSC::JSObject::allowsAccessFrom):
507 (JSC::JSObject::toThisObject):
508 (JSC::JSObject::unwrappedObject):
509 * runtime/JSObject.h:
511 * runtime/JSPropertyNameIterator.h:
512 (JSC::Register::propertyNameIterator):
513 * runtime/JSString.h:
515 (JSC::JSValue::toString):
516 * runtime/StringPrototype.cpp:
517 (JSC::stringProtoFuncSubstr):
519 2012-04-05 Benjamin Poulain <bpoulain@apple.com>
521 Make something faster than JSStringBuilder for joining an array of JSValue
522 https://bugs.webkit.org/show_bug.cgi?id=83180
524 Reviewed by Geoffrey Garen.
526 This patch add the class JSStringJoiner optimized for join() operations.
528 This class makes stricter constraints than JSStringBuilder in order avoid
531 In the best case, the class allocate memory only twice:
532 -Allocate an array to keep a list of UString to join.
533 -Allocate the final string.
535 We also avoid the conversion from 8bits strings to 16bits strings since
536 they are costly and unlikly to help for subsequent calls.
539 * GNUmakefile.list.am:
540 * JavaScriptCore.gypi:
541 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
542 * JavaScriptCore.xcodeproj/project.pbxproj:
544 * runtime/ArrayPrototype.cpp:
545 (JSC::arrayProtoFuncToLocaleString):
546 (JSC::arrayProtoFuncJoin):
547 * runtime/JSStringJoiner.cpp: Added.
549 (JSC::appendStringToData):
551 (JSC::JSStringJoiner::build):
552 * runtime/JSStringJoiner.h: Added.
555 (JSC::JSStringJoiner::JSStringJoiner):
556 (JSC::JSStringJoiner::append):
558 2012-04-05 Gavin Barraclough <barraclough@apple.com>
560 https://bugs.webkit.org/show_bug.cgi?id=77293
563 Rubber stamped by Oliver Hunt.
566 This does break the web - e.g. https://bvi.bnc.ca/index/bnc/indexen.html
567 If we're going to reserve let, we're going to have to do so in a more
570 * parser/Keywords.table:
572 2012-04-05 Michael Saboff <msaboff@apple.com>
574 Rolling out http://trac.webkit.org/changeset/113262.
575 Original code was fine.
577 Rubber-stamped by Oliver Hunt.
579 * assembler/MacroAssembler.h:
580 (JSC::MacroAssembler::additionBlindedConstant):
582 2012-04-05 Patrick Gansterer <paroga@webkit.org>
584 [WinCE] Remove unnecessary function decleration
585 https://bugs.webkit.org/show_bug.cgi?id=83155
587 Reviewed by Kentaro Hara.
589 * runtime/JSDateMath.cpp:
591 2012-04-04 Patrick Gansterer <paroga@webkit.org>
593 Add WTF::getCurrentLocalTime()
594 https://bugs.webkit.org/show_bug.cgi?id=83164
596 Reviewed by Alexey Proskuryakov.
598 Replace the calls to WTF::getLocalTime() with time(0) with the new function.
599 This allows us to use Win32 API on windows to get the same result in a next step.
601 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
602 * runtime/DateConstructor.cpp:
605 2012-04-04 Oliver Hunt <oliver@apple.com>
607 Parser fails to revert some state after parsing expression and object literals.
608 https://bugs.webkit.org/show_bug.cgi?id=83236
610 Reviewed by Gavin Barraclough.
612 Reset left hand side counter after parsing the literals.
615 (JSC::::parseObjectLiteral):
616 (JSC::::parseStrictObjectLiteral):
617 (JSC::::parseArrayLiteral):
619 2012-04-04 Filip Pizlo <fpizlo@apple.com>
621 DFG InstanceOf should not uselessly speculate cell
622 https://bugs.webkit.org/show_bug.cgi?id=83234
624 Reviewed by Oliver Hunt.
626 If InstanceOf is the only user of its child then don't speculate cell, since
627 the not-cell case is super easy to handle.
629 * dfg/DFGSpeculativeJIT.cpp:
630 (JSC::DFG::SpeculativeJIT::compileInstanceOf):
632 2012-04-04 Michael Saboff <msaboff@apple.com>
634 Fixed minor error: "& 3" should be "& 2".
636 Rubber-stamped by Oliver Hunt.
638 * assembler/MacroAssembler.h:
639 (JSC::MacroAssembler::additionBlindedConstant):
641 2012-04-04 Michael Saboff <msaboff@apple.com>
643 Constant Blinding for add/sub immediate crashes in ArmV7 when dest is SP
644 https://bugs.webkit.org/show_bug.cgi?id=83191
646 Reviewed by Oliver Hunt.
648 Make are that blinded constant pairs are similarly aligned to the
649 original immediate values so that instructions that expect that
650 alignment work correctly. One example is ARMv7 add/sub imm to SP.
652 * assembler/ARMv7Assembler.h:
653 (JSC::ARMv7Assembler::add): Added ASSERT that immediate is word aligned.
654 (JSC::ARMv7Assembler::sub): Added ASSERT that immediate is word aligned.
655 (JSC::ARMv7Assembler::sub_S): Added ASSERT that immediate is word aligned.
656 * assembler/MacroAssembler.h:
657 (JSC::MacroAssembler::additionBlindedConstant):
659 2012-04-04 Filip Pizlo <fpizlo@apple.com>
661 DFG should short-circuit Branch(LogicalNot(...))
662 https://bugs.webkit.org/show_bug.cgi?id=83181
664 Reviewed by Geoff Garen.
666 Slight (sub 1%) speed-up on V8.
668 * dfg/DFGFixupPhase.cpp:
669 (JSC::DFG::FixupPhase::fixupNode):
671 2012-04-04 Geoffrey Garen <ggaren@apple.com>
673 [Qt] REGRESSION(r113141): All tests assert on 32 bit debug mode
674 https://bugs.webkit.org/show_bug.cgi?id=83139
676 Reviewed by Sam Weinig.
679 (JSC::::get): 32-bit JSValue treats JSValue(nullptr).asCell() as an error,
680 so work around that here. (Long-term, we should make 32-bit and 64-bit
681 agree on the right behavior.)
683 2012-04-03 Geoffrey Garen <ggaren@apple.com>
685 Updated JSC expected test results to reflect recent bug fixes <disapproving look>.
687 Reviewed by Sam Weinig.
689 * tests/mozilla/expected.html:
691 2012-03-29 Geoffrey Garen <ggaren@apple.com>
693 First step toward incremental Weak<T> finalization
694 https://bugs.webkit.org/show_bug.cgi?id=82670
696 Reviewed by Filip Pizlo.
698 This patch implements a Weak<T> heap that is compatible with incremental
699 finalization, while making as few behavior changes as possible. The behavior
700 changes it makes are:
702 (*) Weak<T>'s raw JSValue no longer reverts to JSValue() automatically --
703 instead, a separate flag indicates that the JSValue is no longer valid.
704 (This is required so that the JSValue can be preserved for later finalization.)
705 Objects dealing with WeakImpls directly must change to check the flag.
707 (*) Weak<T> is no longer a subclass of Handle<T>.
709 (*) DOM GC performance is different -- 9% faster in the geometric mean,
710 but 15% slower in one specific case:
711 gc-dom1.html: 6% faster
712 gc-dom2.html: 23% faster
713 gc-dom3.html: 17% faster
714 gc-dom4.html: 15% *slower*
716 The key features of this new heap are:
718 (*) Each block knows its own state, independent of any other blocks.
720 (*) Each block caches its own sweep result.
722 (*) The heap visits dead Weak<T>s at the end of GC. (It doesn't
723 mark them yet, since that would be a behavior change.)
725 * API/JSCallbackObject.cpp:
726 (JSC::JSCallbackObjectData::finalize):
727 * API/JSCallbackObjectFunctions.h:
728 (JSC::::init): Updated to use the new WeakHeap API.
731 * GNUmakefile.list.am:
732 * JavaScriptCore.gypi:
733 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
734 * JavaScriptCore.xcodeproj/project.pbxproj:
735 * Target.pri: Paid the build system tax since I added some new files.
737 * heap/Handle.h: Made WeakBlock a friend and exposed slot() as public,
738 so we can keep passing a Handle<T> to finalizers, to avoid more surface
739 area change in this patch. A follow-up patch should change the type we
742 * heap/HandleHeap.cpp:
744 (JSC::HandleHeap::writeBarrier):
745 (JSC::HandleHeap::isLiveNode):
750 (JSC::HandleHeap::Node::Node): Removed all code related to Weak<T>, since
751 we have a separate WeakHeap now.
754 (JSC::Heap::Heap): Removed m_extraCost because extra cost is accounted
755 for through our watermark now. Removed m_waterMark because it was unused.
757 (JSC::Heap::destroy): Updated for addition of WeakHeap.
759 (JSC::Heap::reportExtraMemoryCostSlowCase): Changed from using its own
760 variable to participating in the watermark strategy. I wanted to standardize
761 WeakHeap and all other Heap clients on this strategy, to make sure it's
764 (JSC::Heap::markRoots): Updated for addition of WeakHeap. Added WeakHeap
765 dead visit pass, as explained above.
767 (JSC::Heap::collect):
768 (JSC::Heap::resetAllocators): Updated for addition of WeakHeap.
770 (JSC::Heap::addFinalizer):
771 (JSC::Heap::FinalizerOwner::finalize): Updated for new Weak<T> API.
774 (JSC::Heap::weakHeap):
776 (JSC::Heap::addToWaterMark): Added a way to participate in the watermarking
777 strategy, since this is the best way for WeakHeap to report its memory
778 cost. (I plan to update this in a follow-up patch to make it more accurate,
779 but for now it is not less accurate than it used to be.)
781 * heap/MarkedSpace.cpp:
782 (JSC::MarkedSpace::MarkedSpace):
783 (JSC::MarkedSpace::resetAllocators):
784 * heap/MarkedSpace.h:
786 (JSC::MarkedSpace::addToWaterMark):
787 (JSC::MarkedSpace::didConsumeFreeList): Removed m_nurseryWaterMark because
788 it was unused, and I didn't want to update WeakHeap to keep an usused
789 variable working. Added API for above.
800 (JSC::UnspecifiedBoolType):
804 (JSC::Strong::operator!):
806 (JSC::Strong::operator UnspecifiedBoolType*):
812 (JSC::::isHashTableDeletedValue):
817 (JSC::UnspecifiedBoolType):
820 (JSC::::hashTableDeletedValue): Lots of code changes here, but they boil
823 (*) Allocate WeakImpls from the WeakHeap instead of Handles from the HandleHeap.
825 (*) Explicitly check WeakImpl::state() for non-liveness before returning
826 a value (explained above).
828 These files implement the new Weak<T> heap behavior described above:
830 * heap/WeakBlock.cpp: Added.
831 * heap/WeakBlock.h: Added.
832 * heap/WeakHandleOwner.cpp: Added.
833 * heap/WeakHandleOwner.h: Added.
834 * heap/WeakHeap.cpp: Added.
835 * heap/WeakHeap.h: Added.
836 * heap/WeakImpl.h: Added.
838 One interesting difference from the old heap is that we don't allow
839 clients to overwrite a WeakImpl after allocating it, and we don't recycle
840 WeakImpls prior to garbage collection. This is required for lazy finalization,
841 but it will also help us esablish a useful invariant in the future: allocating
842 a WeakImpl will be a binding contract to run a finalizer at some point in the
843 future, even if the WeakImpl is later deallocated.
846 (JSC::JITThunks::hostFunctionStub): Check the Weak<T> for ! instead of
847 its JSValue, since that's our API contract now, and the JSValue might
851 (JSC::jsCast): Allow casting NULL pointers because it's useful and harmless.
853 * runtime/Structure.cpp:
854 (JSC::StructureTransitionTable::add): I can't remember why I did this.
856 * runtime/StructureTransitionTable.h:
857 * runtime/WeakGCMap.h: I had to update these classes because they allocate
858 and deallocate weak pointers manually. They should probably stop doing that.
860 2012-04-03 Keishi Hattori <keishi@webkit.org>
862 Disable ENABLE_DATALIST for now
863 https://bugs.webkit.org/show_bug.cgi?id=82871
865 Reviewed by Kent Tamura.
867 * Configurations/FeatureDefines.xcconfig: Disabled ENABLE_DATALIST.
869 2012-04-02 Filip Pizlo <fpizlo@apple.com>
871 jsr/sret should be removed
872 https://bugs.webkit.org/show_bug.cgi?id=82986
873 <rdar://problem/11017015>
875 Reviewed by Sam Weinig and Geoff Garen.
877 Replaces jsr/sret with finally block inlining.
879 * bytecode/CodeBlock.cpp:
880 (JSC::CodeBlock::dump):
883 (JSC::padOpcodeName):
884 * bytecompiler/BytecodeGenerator.cpp:
885 (JSC::BytecodeGenerator::pushFinallyContext):
886 (JSC::BytecodeGenerator::emitComplexJumpScopes):
888 * bytecompiler/BytecodeGenerator.h:
891 * bytecompiler/NodesCodegen.cpp:
892 (JSC::TryNode::emitBytecode):
893 * interpreter/Interpreter.cpp:
894 (JSC::Interpreter::privateExecute):
896 (JSC::JIT::privateCompileMainPass):
897 (JSC::JIT::privateCompile):
900 * jit/JITOpcodes.cpp:
902 * jit/JITOpcodes32_64.cpp:
904 * llint/LowLevelInterpreter32_64.asm:
905 * llint/LowLevelInterpreter64.asm:
907 2012-04-03 Mark Rowe <mrowe@apple.com>
909 Make it possible to install the JavaScriptCore test tools.
911 Part of <rdar://problem/11158607>.
913 Reviewed by Filip Pizlo.
915 * JavaScriptCore.xcodeproj/project.pbxproj: Introduce an aggregate target named
916 Test Tools that builds testapi, minidom and testRegExp. Switch All from depending on
917 those targets individually to depending on the new aggregate target.
919 2012-04-03 Filip Pizlo <fpizlo@apple.com>
921 Offlineasm ARM backend has a very convoluted way of saying it wants to emit a
922 three-operand multiply instruction
923 https://bugs.webkit.org/show_bug.cgi?id=83100
925 Reviewed by Darin Adler.
927 Changed the "muli"/"mulp" case to call emitArmV7() since that helper method was
928 already smart enough to do the Right Thing for multiply.
930 * offlineasm/armv7.rb:
932 2012-04-03 Filip Pizlo <fpizlo@apple.com>
934 Offlineasm ARM backend uses the wrong mnemonic for multiply
935 https://bugs.webkit.org/show_bug.cgi?id=83098
936 <rdar://problem/11168744>
938 Reviewed by Gavin Barraclough.
940 Use "mul" instead of "muls" since we're passing three operands, not two.
942 * offlineasm/armv7.rb:
944 2012-04-03 Gavin Barraclough <barraclough@apple.com>
946 Linux crashes during boot
947 https://bugs.webkit.org/show_bug.cgi?id=83096
949 Reviewed by Filip Pizlo.
951 The bug here is that we add empty JSValues to the sparse map, and then set them
952 - but a GC may occur before doing so (due to a call to reportExtraMemory cost).
953 We may want to consider making it safe to mark empty JSValues, but the simple &
954 contained fix to this specific bug is to just initialize these values to
955 something other than JSValue().
957 * runtime/JSArray.cpp:
958 (JSC::SparseArrayValueMap::add):
959 - Initialize sparse map entries.
961 2012-04-02 Oliver Hunt <oliver@apple.com>
963 Incorrect liveness information when inlining
964 https://bugs.webkit.org/show_bug.cgi?id=82985
966 Reviewed by Filip Pizlo.
968 Don't remap register numbers that have already been remapped.
970 * dfg/DFGByteCodeParser.cpp:
971 (JSC::DFG::ByteCodeParser::handleInlining):
973 2012-04-02 Filip Pizlo <fpizlo@apple.com>
975 Activation tear-off neglects to copy the callee and scope chain, leading to crashes if we
976 try to create an arguments object from the activation
977 https://bugs.webkit.org/show_bug.cgi?id=82947
978 <rdar://problem/11058598>
980 Reviewed by Gavin Barraclough.
982 We now copy the entire call frame header just to be sure. This is mostly perf-netural,
983 except for a 3.7% slow-down in V8/earley.
985 * runtime/JSActivation.cpp:
986 (JSC::JSActivation::visitChildren):
987 * runtime/JSActivation.h:
988 (JSC::JSActivation::tearOff):
990 2012-04-02 Daniel Bates <dbates@webkit.org>
992 Remove Source/JavaScriptCore/wtf and its empty subdirectories
994 Rubber-stamped by Eric Seidel.
996 Following the move of WTF from Source/JavaScriptCore/wtf to Source/WTF
997 (https://bugs.webkit.org/show_bug.cgi?id=75673), remove directory
998 Source/JavaScriptCore/wtf and its empty subdirectories.
1001 * wtf/android: Removed.
1002 * wtf/blackberry: Removed.
1003 * wtf/chromium: Removed.
1004 * wtf/dtoa: Removed.
1006 * wtf/gobject: Removed.
1010 * wtf/qt/compat: Removed.
1011 * wtf/tests: Removed.
1012 * wtf/text: Removed.
1013 * wtf/threads: Removed.
1014 * wtf/threads/win: Removed.
1015 * wtf/unicode: Removed.
1016 * wtf/unicode/glib: Removed.
1017 * wtf/unicode/icu: Removed.
1018 * wtf/unicode/qt4: Removed.
1019 * wtf/unicode/wince: Removed.
1021 * wtf/url/api: Removed.
1022 * wtf/url/src: Removed.
1024 * wtf/wince: Removed.
1027 2012-04-02 Carlos Garcia Campos <cgarcia@igalia.com>
1029 Unreviewed. Fix make distcheck issues.
1031 * GNUmakefile.list.am: Add missing file.
1033 2012-04-01 Darin Adler <darin@apple.com>
1035 Fix incorrect path for libWTF.a in Mac project file.
1037 * JavaScriptCore.xcodeproj/project.pbxproj: Removed the "../Release" prefix that
1038 would cause other configurations to try to link with the "Release" version of
1039 libWTF.a instead of the correct version.
1041 2012-03-29 Filip Pizlo <fpizlo@apple.com>
1043 DFG should optimize a==b for a being an object and b being either an object or
1044 null/undefined, and vice versa
1045 https://bugs.webkit.org/show_bug.cgi?id=82656
1047 Reviewed by Oliver Hunt.
1049 Implements additional object equality optimizations for the case that one
1050 operand is predicted to be an easily speculated object (like FinalObject or
1051 Array) and the other is either an easily speculated object or Other, i.e.
1054 2-5% speed-up on V8/raytrace, leading to a sub-1% progression on V8.
1056 I also took the opportunity to clean up the control flow for the speculation
1057 decisions in the various Compare opcodes. And to fix a build bug in SamplingTool.
1058 And to remove debug cruft I stupidly committed in my last patch.
1060 * bytecode/SamplingTool.h:
1062 * dfg/DFGAbstractState.cpp:
1063 (JSC::DFG::AbstractState::execute):
1064 * dfg/DFGOperations.cpp:
1065 * dfg/DFGSpeculativeJIT.cpp:
1066 (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
1067 (JSC::DFG::SpeculativeJIT::compare):
1068 * dfg/DFGSpeculativeJIT.h:
1070 * dfg/DFGSpeculativeJIT32_64.cpp:
1071 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
1072 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
1074 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
1075 * dfg/DFGSpeculativeJIT64.cpp:
1076 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
1077 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
1079 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
1081 2012-03-30 David Barr <davidbarr@chromium.org>
1083 Split up top-level .gitignore and .gitattributes
1084 https://bugs.webkit.org/show_bug.cgi?id=82687
1086 Reviewed by Tor Arne Vestbø.
1088 * JavaScriptCore.gyp/.gitignore: Added.
1090 2012-03-30 Steve Falkenburg <sfalken@apple.com>
1092 Windows (make based) build fix.
1094 * JavaScriptCore.vcproj/JavaScriptCore.make: Copy WTF header files into a place where JavaScriptCore build can see them.
1096 2012-03-30 Keishi Hattori <keishi@webkit.org>
1098 Change ENABLE_INPUT_COLOR to ENABLE_INPUT_TYPE_COLOR and enable it for chromium
1099 https://bugs.webkit.org/show_bug.cgi?id=80972
1101 Reviewed by Kent Tamura.
1103 * Configurations/FeatureDefines.xcconfig:
1105 2012-03-29 Mark Hahnenberg <mhahnenberg@apple.com>
1107 Refactor recompileAllJSFunctions() to be less expensive
1108 https://bugs.webkit.org/show_bug.cgi?id=80330
1110 Reviewed by Filip Pizlo.
1112 This change is performance neutral on the JS benchmarks we track. It's mostly to improve page
1113 load performance, which currently does at least a couple full GCs per navigation.
1116 (JSC::Heap::discardAllCompiledCode): Rename recompileAllJSFunctions to discardAllCompiledCode
1117 because the function doesn't actually recompile anything (and never did); it simply throws code
1118 away for it to be recompiled later if we determine we should do so.
1120 (JSC::Heap::collectAllGarbage):
1121 (JSC::Heap::addFunctionExecutable): Adds a newly created FunctionExecutable to the Heap's list.
1122 (JSC::Heap::removeFunctionExecutable): Removes the specified FunctionExecutable from the Heap's list.
1126 * runtime/Executable.cpp: Added next and prev fields to FunctionExecutables so that they can
1127 be used in DoublyLinkedLists.
1128 (JSC::FunctionExecutable::FunctionExecutable):
1129 (JSC::FunctionExecutable::finalize): Removes the FunctionExecutable from the Heap's list.
1130 * runtime/Executable.h:
1131 (FunctionExecutable):
1132 (JSC::FunctionExecutable::create): Adds the FunctionExecutable to the Heap's list.
1133 * runtime/JSGlobalData.cpp: Remove recompileAllJSFunctions, as it's the Heap's job to own and manage
1134 the list of FunctionExecutables.
1135 * runtime/JSGlobalData.h:
1137 * runtime/JSGlobalObject.cpp:
1138 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Use the new discardAllCompiledCode.
1140 2012-03-29 Filip Pizlo <fpizlo@apple.com>
1142 Unreviewed build fix for non-x86 platforms.
1144 * dfg/DFGSpeculativeJIT.cpp:
1145 (JSC::DFG::SpeculativeJIT::compileSoftModulo):
1146 * dfg/DFGSpeculativeJIT.h:
1147 (JSC::DFG::SpeculativeJIT::callOperation):
1148 * jit/JITArithmetic32_64.cpp:
1149 (JSC::JIT::emitSlow_op_mod):
1151 2012-03-29 Gavin Barraclough <barraclough@apple.com>
1153 Windows build fix p2.
1155 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1157 2012-03-29 Gavin Barraclough <barraclough@apple.com>
1159 Windows build fix p1.
1161 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1163 2012-03-29 Gavin Barraclough <barraclough@apple.com>
1165 Template the Yarr::Interpreter on the character type
1166 https://bugs.webkit.org/show_bug.cgi?id=82637
1168 Reviewed by Sam Weinig.
1170 We should be able to call to the interpreter after having already checked the character type,
1171 without having to re-package the character pointer back up into a string!
1173 * runtime/RegExp.cpp:
1174 (JSC::RegExp::match):
1175 (JSC::RegExp::matchCompareWithInterpreter):
1176 - Don't pass length.
1178 - moved function declarations to YarrInterpreter.h.
1179 * yarr/YarrInterpreter.cpp:
1182 (JSC::Yarr::Interpreter::InputStream::InputStream):
1184 (JSC::Yarr::Interpreter::Interpreter):
1185 (JSC::Yarr::interpret):
1186 - templated Interpreter class on CharType.
1187 * yarr/YarrInterpreter.h:
1189 - added function declarations.
1191 2012-03-29 David Kilzer <ddkilzer@apple.com>
1193 Don't use a flattened framework path when building on OS X
1195 Reviewed by Mark Rowe.
1197 * Configurations/ToolExecutable.xcconfig: Use REAL_PLATFORM_NAME
1198 to select different INSTALL_PATH values.
1200 2012-03-29 Kevin Ollivier <kevino@theolliviers.com>
1202 [wx] Unreviewed build fix, add Win-specific sources
1203 the wx port needs after WTF move.
1207 2012-03-29 Andy Estes <aestes@apple.com>
1209 Remove an unused variable that breaks the build with newer versions of clang.
1211 Rubber stamped by Gavin Barraclough.
1214 (JSC::Yarr::YarrGenerator::backtrackCharacterClassNonGreedy):
1216 2012-03-29 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
1218 HashMap<>::add should return a more descriptive object
1219 https://bugs.webkit.org/show_bug.cgi?id=71063
1221 Reviewed by Ryosuke Niwa.
1223 Update code to use AddResult instead of a pair. Note that since WeakGCMap wraps
1224 the iterator type, there's a need for its own AddResult type -- instantiated from
1225 HashTableAddResult template class.
1227 * API/JSCallbackObject.h:
1228 (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
1229 * API/JSClassRef.cpp:
1230 (OpaqueJSClass::contextData):
1231 * bytecompiler/BytecodeGenerator.cpp:
1232 (JSC::BytecodeGenerator::addVar):
1233 (JSC::BytecodeGenerator::addGlobalVar):
1234 (JSC::BytecodeGenerator::addConstant):
1235 (JSC::BytecodeGenerator::addConstantValue):
1236 (JSC::BytecodeGenerator::emitLoad):
1237 (JSC::BytecodeGenerator::addStringConstant):
1238 (JSC::BytecodeGenerator::emitLazyNewFunction):
1239 * bytecompiler/NodesCodegen.cpp:
1240 (JSC::PropertyListNode::emitBytecode):
1241 * debugger/Debugger.cpp:
1242 * dfg/DFGAssemblyHelpers.cpp:
1243 (JSC::DFG::AssemblyHelpers::decodedCodeMapFor):
1244 * dfg/DFGByteCodeParser.cpp:
1245 (JSC::DFG::ByteCodeParser::cellConstant):
1246 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
1248 (JSC::JITThunks::ctiStub):
1249 (JSC::JITThunks::hostFunctionStub):
1250 * parser/Parser.cpp:
1251 (JSC::::parseStrictObjectLiteral):
1253 (JSC::Scope::declareParameter):
1254 * runtime/Identifier.cpp:
1255 (JSC::Identifier::add):
1256 (JSC::Identifier::add8):
1257 (JSC::Identifier::addSlowCase):
1258 * runtime/Identifier.h:
1259 (JSC::Identifier::add):
1260 (JSC::IdentifierTable::add):
1261 * runtime/JSArray.cpp:
1262 (JSC::SparseArrayValueMap::add):
1263 (JSC::SparseArrayValueMap::put):
1264 (JSC::SparseArrayValueMap::putDirect):
1265 (JSC::JSArray::enterDictionaryMode):
1266 (JSC::JSArray::defineOwnNumericProperty):
1267 * runtime/JSArray.h:
1268 (SparseArrayValueMap):
1269 * runtime/PropertyNameArray.cpp:
1270 (JSC::PropertyNameArray::add):
1271 * runtime/StringRecursionChecker.h:
1272 (JSC::StringRecursionChecker::performCheck):
1273 * runtime/Structure.cpp:
1274 (JSC::StructureTransitionTable::add):
1275 * runtime/WeakGCMap.h:
1277 (JSC::WeakGCMap::add):
1278 (JSC::WeakGCMap::set):
1279 * tools/ProfileTreeNode.h:
1280 (JSC::ProfileTreeNode::sampleChild):
1282 2012-03-29 Patrick Gansterer <paroga@webkit.org>
1284 Build fix for !ENABLE(YARR_JIT) after r112454.
1286 * runtime/RegExp.cpp:
1287 (JSC::RegExp::invalidateCode):
1289 2012-03-28 Filip Pizlo <fpizlo@apple.com>
1291 DFG object equality speculations should be simplified
1292 https://bugs.webkit.org/show_bug.cgi?id=82557
1294 Reviewed by Gavin Barraclough.
1297 (JSC::DFG::Node::shouldSpeculateFinalObject):
1298 (JSC::DFG::Node::shouldSpeculateArray):
1300 2012-03-28 David Kilzer <ddkilzer@apple.com>
1302 minidom configurations should be based on ToolExecutable.xcconfig
1303 <http://webkit.org/b/82513>
1305 Reviewed by Mark Rowe.
1307 Note that this patch changes minidom from being installed in
1308 /usr/local/bin to JavaScriptCore.framework/Resources.
1310 * Configurations/ToolExecutable.xcconfig: Add semi-colon.
1311 * JavaScriptCore.xcodeproj/project.pbxproj: Base minidom
1312 configurations on ToolExecutable.xcconfig. Remove redundant
1313 PRODUCT_NAME and SKIP_INSTALL variables.
1315 2012-03-28 Gavin Barraclough <barraclough@apple.com>
1317 Build fix - some compiles generating NORETURN related warnings.
1320 (JSC::Yarr::YarrGenerator::setSubpatternStart):
1321 (JSC::Yarr::YarrGenerator::setSubpatternEnd):
1322 (JSC::Yarr::YarrGenerator::clearSubpatternStart):
1324 2012-03-28 Kevin Ollivier <kevino@theolliviers.com>
1326 [wx] Unreviewed. Build fix, move WTF back into JSCore target
1327 until issues with JSCore not linking in all WTF symbols are resolved.
1331 2012-03-28 Gavin Barraclough <barraclough@apple.com>
1333 Yarr: if we're not using the output array, don't populate it!
1334 https://bugs.webkit.org/show_bug.cgi?id=82519
1336 Reviewed by Sam Weinig.
1338 * runtime/RegExp.cpp:
1340 - Missed review comment! - didn't fully remove RegExpRepresentation.
1342 2012-03-28 Gavin Barraclough <barraclough@apple.com>
1344 Yarr: if we're not using the output array, don't populate it!
1345 https://bugs.webkit.org/show_bug.cgi?id=82519
1347 Reviewed by Sam Weinig.
1349 Add a new variant of the match method to RegExp that returns a MatchResult,
1350 and modify YarrJIT to be able to compile code that doesn't use an output vector.
1352 This is a 3% progression on v8-regexp.
1354 * JavaScriptCore.xcodeproj/project.pbxproj:
1355 - Moved MatchResult into its own header.
1356 * assembler/AbstractMacroAssembler.h:
1357 - Added missing include.
1358 * runtime/MatchResult.h: Added.
1359 (MatchResult::MatchResult):
1361 (MatchResult::failed):
1362 (MatchResult::operator bool):
1363 (MatchResult::empty):
1364 - Moved MatchResult into its own header.
1365 * runtime/RegExp.cpp:
1366 (JSC::RegExp::compile):
1367 (JSC::RegExp::compileIfNecessary):
1368 (JSC::RegExp::match):
1369 - Changed due to execute & representation changes.
1370 (JSC::RegExp::compileMatchOnly):
1371 (JSC::RegExp::compileIfNecessaryMatchOnly):
1372 - Added helper to compile MatchOnly code.
1373 (JSC::RegExp::invalidateCode):
1374 (JSC::RegExp::matchCompareWithInterpreter):
1375 (JSC::RegExp::printTraceData):
1376 - Changed due representation changes.
1379 (JSC::RegExp::hasCode):
1380 - Made YarrCodeBlock a member.
1381 * runtime/RegExpConstructor.h:
1382 (RegExpConstructor):
1383 (JSC::RegExpConstructor::performMatch):
1384 - Added no-ovector form.
1385 * runtime/RegExpMatchesArray.cpp:
1386 (JSC::RegExpMatchesArray::reifyAllProperties):
1387 - Match now takes a reference to ovector, not a pointer.
1388 * runtime/RegExpObject.h:
1390 - Moved MatchResult into its own header.
1391 * runtime/StringPrototype.cpp:
1392 (JSC::stringProtoFuncSplit):
1393 - Match now takes a reference to ovector, not a pointer.
1396 - Match now takes a reference to ovector, not a pointer.
1400 (JSC::Yarr::YarrGenerator::initCallFrame):
1401 (JSC::Yarr::YarrGenerator::removeCallFrame):
1402 (JSC::Yarr::YarrGenerator::setSubpatternStart):
1403 (JSC::Yarr::YarrGenerator::setSubpatternEnd):
1404 (JSC::Yarr::YarrGenerator::clearSubpatternStart):
1405 (JSC::Yarr::YarrGenerator::setMatchStart):
1406 (JSC::Yarr::YarrGenerator::getMatchStart):
1407 - Added helper functions to intermediate access to output.
1408 (JSC::Yarr::YarrGenerator::generateDotStarEnclosure):
1409 (JSC::Yarr::YarrGenerator::generate):
1410 (JSC::Yarr::YarrGenerator::backtrack):
1411 (JSC::Yarr::YarrGenerator::generateEnter):
1412 (JSC::Yarr::YarrGenerator::compile):
1413 - Changed to use the new helpers, only generate subpatterns if IncludeSubpatterns.
1414 (JSC::Yarr::jitCompile):
1415 - Needs to template of MatchOnly or IncludeSubpatterns.
1418 (JSC::Yarr::YarrCodeBlock::set8BitCode):
1419 (JSC::Yarr::YarrCodeBlock::set16BitCode):
1420 (JSC::Yarr::YarrCodeBlock::has8BitCodeMatchOnly):
1421 (JSC::Yarr::YarrCodeBlock::has16BitCodeMatchOnly):
1422 (JSC::Yarr::YarrCodeBlock::set8BitCodeMatchOnly):
1423 (JSC::Yarr::YarrCodeBlock::set16BitCodeMatchOnly):
1424 (JSC::Yarr::YarrCodeBlock::execute):
1425 (JSC::Yarr::YarrCodeBlock::clear):
1426 - Added a second set of CodeRefs, so that we can compile RexExps with/without subpattern matching.
1428 2012-03-27 Filip Pizlo <fpizlo@apple.com>
1430 DFG OSR exit should not generate an exit for variables of inlinees if the
1431 inlinees are not in scope
1432 https://bugs.webkit.org/show_bug.cgi?id=82312
1434 Reviewed by Oliver Hunt.
1436 * bytecode/CodeBlock.h:
1437 (JSC::baselineCodeBlockForInlineCallFrame):
1439 (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
1440 * dfg/DFGOSRExit.cpp:
1441 (JSC::DFG::computeNumVariablesForCodeOrigin):
1443 (JSC::DFG::OSRExit::OSRExit):
1445 2012-03-27 Matt Lilek <mrl@apple.com>
1447 Stop compiling Interpreter.cpp with -fno-var-tracking
1448 https://bugs.webkit.org/show_bug.cgi?id=82299
1450 Reviewed by Anders Carlsson.
1452 * JavaScriptCore.xcodeproj/project.pbxproj:
1454 2012-03-27 Pratik Solanki <psolanki@apple.com>
1456 Compiler warning when JIT is not enabled
1457 https://bugs.webkit.org/show_bug.cgi?id=82352
1459 Reviewed by Filip Pizlo.
1461 * runtime/JSFunction.cpp:
1462 (JSC::JSFunction::create):
1464 2012-03-26 Thouraya ANDOLSI <thouraya.andolsi@st.com>
1466 Unaligned userspace access for SH4 platforms
1467 https://bugs.webkit.org/show_bug.cgi?id=79104
1469 Reviewed by Gavin Barraclough.
1471 * assembler/AbstractMacroAssembler.h:
1473 (JSC::AbstractMacroAssembler::Jump::Jump):
1474 (JSC::AbstractMacroAssembler::Jump::link):
1475 * assembler/MacroAssemblerSH4.h:
1476 (JSC::MacroAssemblerSH4::load16Unaligned):
1477 (JSC::MacroAssemblerSH4::load32WithUnalignedHalfWords):
1478 (JSC::MacroAssemblerSH4::branchDouble):
1479 (JSC::MacroAssemblerSH4::branchTrue):
1480 (JSC::MacroAssemblerSH4::branchFalse):
1481 * assembler/SH4Assembler.h:
1482 (JSC::SH4Assembler::extraInstrForBranch):
1484 (JSC::SH4Assembler::bra):
1485 (JSC::SH4Assembler::linkJump):
1489 (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):
1491 2012-03-26 Ryosuke Niwa <rniwa@webkit.org>
1493 cssText should use shorthand notations
1494 https://bugs.webkit.org/show_bug.cgi?id=81737
1496 Reviewed by Enrica Casucci.
1498 Export symbols of BitVector on Windows.
1500 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1502 2012-03-26 Filip Pizlo <fpizlo@apple.com>
1504 DFG should assert that argument value recoveries can only be
1505 AlreadyInRegisterFile or Constant
1506 https://bugs.webkit.org/show_bug.cgi?id=82249
1508 Reviewed by Michael Saboff.
1510 Made the assertions that the DFG makes for argument value recoveries match
1511 what Arguments expects.
1513 * bytecode/ValueRecovery.h:
1514 (JSC::ValueRecovery::isConstant):
1516 (JSC::ValueRecovery::isAlreadyInRegisterFile):
1517 * dfg/DFGSpeculativeJIT.cpp:
1518 (JSC::DFG::SpeculativeJIT::compile):
1520 2012-03-26 Dan Bernstein <mitz@apple.com>
1522 Tried to fix the Windows build.
1524 * yarr/YarrPattern.cpp:
1525 (JSC::Yarr::CharacterClassConstructor::putRange):
1527 2012-03-26 Gavin Barraclough <barraclough@apple.com>
1529 Unreviewed - speculative Windows build fix.
1531 * yarr/YarrCanonicalizeUCS2.h:
1532 (JSC::Yarr::getCanonicalPair):
1534 2012-03-26 Dan Bernstein <mitz@apple.com>
1536 Fixed builds with assertions disabled.
1538 * yarr/YarrCanonicalizeUCS2.h:
1539 (JSC::Yarr::areCanonicallyEquivalent):
1541 2012-03-26 Gavin Barraclough <barraclough@apple.com>
1543 Unreviewed - errk! - accidentally the whole pbxproj.
1545 * JavaScriptCore.xcodeproj/project.pbxproj:
1547 2012-03-25 Gavin Barraclough <barraclough@apple.com>
1549 Greek sigma is handled wrong in case independent regexp.
1550 https://bugs.webkit.org/show_bug.cgi?id=82063
1552 Reviewed by Oliver Hunt.
1554 The bug here is that we assume that any given codepoint has at most one additional value it
1555 should match under a case insensitive match, and that the pair of codepoints that match (if
1556 a codepoint does not only match itself) can be determined by calling toUpper/toLower on the
1557 given codepoint). Life is not that simple.
1559 Instead, pre-calculate a set of tables mapping from a UCS2 codepoint to the set of characters
1560 it may match, under the ES5.1 case-insensitive matching rules. Since unicode is fairly regular
1561 we can pack this table quite nicely, and get it down to 364 entries. This means we can use a
1562 simple binary search to find an entry in typically eight compares.
1565 * GNUmakefile.list.am:
1566 * JavaScriptCore.gypi:
1567 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1568 * JavaScriptCore.xcodeproj/project.pbxproj:
1570 - Added new files to build systems.
1571 * yarr/YarrCanonicalizeUCS2.cpp: Added.
1572 - New - autogenerated, UCS2 canonicalized comparison tables.
1573 * yarr/YarrCanonicalizeUCS2.h: Added.
1574 (JSC::Yarr::rangeInfoFor):
1575 - Look up the canonicalization info for a UCS2 character.
1576 (JSC::Yarr::getCanonicalPair):
1577 - For a UCS2 character with a single equivalent value, look it up.
1578 (JSC::Yarr::isCanonicallyUnique):
1579 - Returns true if no other UCS2 code points are canonically equal.
1580 (JSC::Yarr::areCanonicallyEquivalent):
1581 - Compare two values, under canonicalization rules.
1582 * yarr/YarrCanonicalizeUCS2.js: Added.
1583 - script used to generate YarrCanonicalizeUCS2.cpp.
1584 * yarr/YarrInterpreter.cpp:
1585 (JSC::Yarr::Interpreter::tryConsumeBackReference):
1586 - Use isCanonicallyUnique, rather than Unicode toUpper/toLower.
1588 (JSC::Yarr::YarrGenerator::jumpIfCharNotEquals):
1589 (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):
1590 (JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
1591 - Use isCanonicallyUnique, rather than Unicode toUpper/toLower.
1592 * yarr/YarrPattern.cpp:
1593 (JSC::Yarr::CharacterClassConstructor::putChar):
1594 - Updated to determine canonical equivalents correctly.
1595 (JSC::Yarr::CharacterClassConstructor::putUnicodeIgnoreCase):
1596 - Added, used to put a non-ascii, non-unique character in a case-insensitive match.
1597 (JSC::Yarr::CharacterClassConstructor::putRange):
1598 - Updated to determine canonical equivalents correctly.
1599 (JSC::Yarr::YarrPatternConstructor::atomPatternCharacter):
1600 - Changed to call putUnicodeIgnoreCase, instead of putChar, avoid a double lookup of rangeInfo.
1602 2012-03-26 Kevin Ollivier <kevino@theolliviers.com>
1604 [wx] Unreviewed build fix. Add the build outputs dir to the list of build dirs,
1605 so we make sure it finds the API headers on all platforms.
1609 2012-03-26 Patrick Gansterer <paroga@webkit.org>
1611 Build fix for WinCE after r112039.
1613 * interpreter/Register.h:
1614 (Register): Removed inline keyword from decleration since
1615 there is an ALWAYS_INLINE at the definition anyway.
1617 2012-03-26 Carlos Garcia Campos <cgarcia@igalia.com>
1619 Unreviewed. Fix make distcheck.
1621 * GNUmakefile.list.am: Add missing files.
1623 2012-03-25 Kevin Ollivier <kevino@theolliviers.com>
1625 [wx] Unreviewed build fix. Move WTF to its own static lib build.
1629 2012-03-25 Filip Pizlo <fpizlo@apple.com>
1631 DFG int-to-double conversion should be revealed to CSE
1632 https://bugs.webkit.org/show_bug.cgi?id=82135
1634 Reviewed by Oliver Hunt.
1636 This introduces the notion of an Int32ToDouble node, which is injected
1637 into the graph anytime we know that we have a double use of a node that
1638 was predicted integer. The Int32ToDouble simplifies double speculation
1639 on integers by skipping the path that would unbox doubles, if we know
1640 that the value is already proven to be an integer. It allows integer to
1641 double conversions to be subjected to common subexpression elimination
1642 (CSE) by allowing the CSE phase to see where these conversions are
1643 occurring. Finally, it allows us to see when a constant is being used
1644 as both a double and an integer. This is a bit odd, since it means that
1645 sometimes a double use of a constant will not refer directly to the
1646 constant. This should not cause problems, for now, but it may require
1647 some canonizalization in the future if we want to support strength
1648 reductions of double operations based on constants.
1650 To allow injection of nodes into the graph, this change introduces the
1651 DFG::InsertionSet, which is a way of lazily inserting elements into a
1652 list. This allows the FixupPhase to remain O(N) despite performing
1653 multiple injections in a single basic block. Without the InsertionSet,
1654 each injection would require performing an insertion into a vector,
1655 which is O(N), leading to O(N^2) performance overall. With the
1656 InsertionSet, each injection simply records what insertion would have
1657 been performed, and all insertions are performed at once (via
1658 InsertionSet::execute) after processing of a basic block is completed.
1660 * JavaScriptCore.xcodeproj/project.pbxproj:
1661 * bytecode/PredictedType.h:
1662 (JSC::isActionableIntMutableArrayPrediction):
1664 (JSC::isActionableFloatMutableArrayPrediction):
1665 (JSC::isActionableTypedMutableArrayPrediction):
1666 (JSC::isActionableMutableArrayPrediction):
1667 * dfg/DFGAbstractState.cpp:
1668 (JSC::DFG::AbstractState::execute):
1669 * dfg/DFGCSEPhase.cpp:
1670 (JSC::DFG::CSEPhase::performNodeCSE):
1672 (JSC::DFG::useKindToString):
1674 * dfg/DFGFixupPhase.cpp:
1675 (JSC::DFG::FixupPhase::run):
1676 (JSC::DFG::FixupPhase::fixupBlock):
1678 (JSC::DFG::FixupPhase::fixupNode):
1679 (JSC::DFG::FixupPhase::fixDoubleEdge):
1681 (JSC::DFG::Graph::dump):
1682 * dfg/DFGInsertionSet.h: Added.
1685 (JSC::DFG::Insertion::Insertion):
1686 (JSC::DFG::Insertion::index):
1687 (JSC::DFG::Insertion::element):
1689 (JSC::DFG::InsertionSet::InsertionSet):
1690 (JSC::DFG::InsertionSet::append):
1691 (JSC::DFG::InsertionSet::execute):
1692 * dfg/DFGNodeType.h:
1694 * dfg/DFGPredictionPropagationPhase.cpp:
1695 (JSC::DFG::PredictionPropagationPhase::propagate):
1696 * dfg/DFGSpeculativeJIT.cpp:
1697 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
1698 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
1699 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
1701 * dfg/DFGSpeculativeJIT.h:
1703 (JSC::DFG::IntegerOperand::IntegerOperand):
1704 (JSC::DFG::DoubleOperand::DoubleOperand):
1705 (JSC::DFG::JSValueOperand::JSValueOperand):
1706 (JSC::DFG::StorageOperand::StorageOperand):
1707 (JSC::DFG::SpeculateIntegerOperand::SpeculateIntegerOperand):
1708 (JSC::DFG::SpeculateStrictInt32Operand::SpeculateStrictInt32Operand):
1709 (JSC::DFG::SpeculateDoubleOperand::SpeculateDoubleOperand):
1710 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
1711 (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand):
1712 * dfg/DFGSpeculativeJIT32_64.cpp:
1713 (JSC::DFG::SpeculativeJIT::compile):
1714 * dfg/DFGSpeculativeJIT64.cpp:
1715 (JSC::DFG::SpeculativeJIT::compile):
1717 2012-03-25 Filip Pizlo <fpizlo@apple.com>
1719 DFGOperands should be moved out of the DFG and into bytecode
1720 https://bugs.webkit.org/show_bug.cgi?id=82151
1722 Reviewed by Dan Bernstein.
1724 * GNUmakefile.list.am:
1725 * JavaScriptCore.xcodeproj/project.pbxproj:
1726 * bytecode/Operands.h: Copied from Source/JavaScriptCore/dfg/DFGOperands.h.
1727 * dfg/DFGBasicBlock.h:
1729 * dfg/DFGOSREntry.h:
1731 * dfg/DFGOperands.h: Removed.
1732 * dfg/DFGVariableAccessData.h:
1734 2012-03-24 Filip Pizlo <fpizlo@apple.com>
1736 DFG 64-bit Branch implementation should not be creating a JSValueOperand that
1737 it isn't going to use
1738 https://bugs.webkit.org/show_bug.cgi?id=82136
1740 Reviewed by Geoff Garen.
1742 * dfg/DFGSpeculativeJIT64.cpp:
1743 (JSC::DFG::SpeculativeJIT::emitBranch):
1745 2012-03-24 Kevin Ollivier <kevino@theolliviers.com>
1747 [wx] Unreviewed. Fix the build after WTF move.
1751 2012-03-23 Filip Pizlo <fpizlo@apple.com>
1753 DFG double voting may be overzealous in the case of variables that end up
1754 being used as integers
1755 https://bugs.webkit.org/show_bug.cgi?id=82008
1757 Reviewed by Oliver Hunt.
1759 Cleaned up propagation, making the intent more explicit in most places.
1760 Back-propagate NodeUsedAsInt for cases where a node was used in a context
1761 that is known to strongly prefer integers.
1763 * dfg/DFGByteCodeParser.cpp:
1764 (JSC::DFG::ByteCodeParser::handleCall):
1765 (JSC::DFG::ByteCodeParser::parseBlock):
1767 (JSC::DFG::Graph::dumpCodeOrigin):
1768 (JSC::DFG::Graph::dump):
1771 * dfg/DFGNodeFlags.cpp:
1772 (JSC::DFG::nodeFlagsAsString):
1773 * dfg/DFGNodeFlags.h:
1775 * dfg/DFGPredictionPropagationPhase.cpp:
1776 (JSC::DFG::PredictionPropagationPhase::run):
1777 (JSC::DFG::PredictionPropagationPhase::propagate):
1778 (PredictionPropagationPhase):
1779 (JSC::DFG::PredictionPropagationPhase::mergeDefaultFlags):
1780 (JSC::DFG::PredictionPropagationPhase::vote):
1781 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
1782 (JSC::DFG::PredictionPropagationPhase::fixupNode):
1783 * dfg/DFGVariableAccessData.h:
1784 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
1786 2012-03-24 Filip Pizlo <fpizlo@apple.com>
1788 DFG::Node::shouldNotSpeculateInteger() should be eliminated
1789 https://bugs.webkit.org/show_bug.cgi?id=82123
1791 Reviewed by Geoff Garen.
1793 * dfg/DFGAbstractState.cpp:
1794 (JSC::DFG::AbstractState::execute):
1797 * dfg/DFGSpeculativeJIT.cpp:
1798 (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
1799 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
1801 2012-03-24 Yong Li <yoli@rim.com>
1803 Increase getByIdSlowCase ConstantSpace/InstructionSpace for CPU(ARM_TRADITIONAL)
1804 https://bugs.webkit.org/show_bug.cgi?id=81521
1806 Increase sequenceGetByIdSlowCaseConstantSpace and sequenceGetByIdSlowCaseInstructionSpace
1807 for CPU(ARM_TRADITIONAL) to fit actual need.
1809 Reviewed by Oliver Hunt.
1814 2012-03-23 Filip Pizlo <fpizlo@apple.com>
1816 DFG Fixup should be able to short-circuit trivial ValueToInt32's
1817 https://bugs.webkit.org/show_bug.cgi?id=82030
1819 Reviewed by Michael Saboff.
1821 Takes the fixup() method of the prediction propagation phase and makes it
1822 into its own phase. Adds the ability to short-circuit trivial ValueToInt32
1823 nodes, and mark pure ValueToInt32's as such.
1826 * GNUmakefile.list.am:
1827 * JavaScriptCore.xcodeproj/project.pbxproj:
1829 * dfg/DFGByteCodeParser.cpp:
1830 (JSC::DFG::ByteCodeParser::makeSafe):
1831 (JSC::DFG::ByteCodeParser::handleCall):
1832 (JSC::DFG::ByteCodeParser::parseBlock):
1834 * dfg/DFGDriver.cpp:
1835 (JSC::DFG::compile):
1836 * dfg/DFGFixupPhase.cpp: Added.
1839 (JSC::DFG::FixupPhase::FixupPhase):
1840 (JSC::DFG::FixupPhase::run):
1841 (JSC::DFG::FixupPhase::fixupNode):
1842 (JSC::DFG::FixupPhase::fixIntEdge):
1843 (JSC::DFG::performFixup):
1844 * dfg/DFGFixupPhase.h: Added.
1846 * dfg/DFGPredictionPropagationPhase.cpp:
1847 (JSC::DFG::PredictionPropagationPhase::run):
1848 (PredictionPropagationPhase):
1850 2012-03-23 Mark Hahnenberg <mhahnenberg@apple.com>
1852 tryReallocate could break the zero-ed memory invariant of CopiedBlocks
1853 https://bugs.webkit.org/show_bug.cgi?id=82087
1855 Reviewed by Filip Pizlo.
1857 Removing this optimization turned out to be ~1% regression on kraken, so I simply
1858 undid the modification to the current block if we fail.
1860 * heap/CopiedSpace.cpp:
1861 (JSC::CopiedSpace::tryReallocate): Undid the reset in the CopiedAllocator if we fail
1862 to reallocate from the current block.
1864 2012-03-23 Alexey Proskuryakov <ap@apple.com>
1866 [Mac] No need for platform-specific ENABLE_BLOB values
1867 https://bugs.webkit.org/show_bug.cgi?id=82102
1869 Reviewed by David Kilzer.
1871 * Configurations/FeatureDefines.xcconfig:
1873 2012-03-23 Michael Saboff <msaboff@apple.com>
1875 DFG::compileValueToInt32 Sometime Generates GPR to FPR reg back to GPR
1876 https://bugs.webkit.org/show_bug.cgi?id=81805
1878 Reviewed by Filip Pizlo.
1880 Added SpeculativeJIT::checkGeneratedType() to determine the current format
1881 of an operand. Used that information in SpeculativeJIT::compileValueToInt32
1882 to generate code that will use integer and JSValue types in integer
1883 format directly without a conversion to double.
1885 * JavaScriptCore.xcodeproj/project.pbxproj:
1886 * dfg/DFGSpeculativeJIT.cpp:
1887 (JSC::DFG::SpeculativeJIT::checkGeneratedType):
1889 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
1890 * dfg/DFGSpeculativeJIT.h:
1894 2012-03-23 Steve Falkenburg <sfalken@apple.com>
1896 Update Apple Windows build files for WTF move
1897 https://bugs.webkit.org/show_bug.cgi?id=82069
1899 Reviewed by Jessie Berlin.
1901 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Removed WTF and WTFGenerated.
1903 2012-03-23 Dean Jackson <dino@apple.com>
1905 Disable CSS_SHADERS in Apple builds
1906 https://bugs.webkit.org/show_bug.cgi?id=81996
1908 Reviewed by Simon Fraser.
1910 Remove ENABLE_CSS_SHADERS from FeatureDefines. It's now in Platform.h.
1912 * Configurations/FeatureDefines.xcconfig:
1914 2012-03-23 Gavin Barraclough <barraclough@apple.com>
1916 RexExp constructor last match properties should not rely on previous ovector
1917 https://bugs.webkit.org/show_bug.cgi?id=82077
1919 Reviewed by Oliver Hunt.
1921 This change simplifies matching, and will enable subpattern results to be fully lazily generated in the future.
1923 This patch changes the scheme used to lazily generate the last match properties of the RegExp object.
1924 Instead of relying on the results in the ovector, we can instead lazily generate the subpatters using
1925 a RegExpMatchesArray. To do so we just need to store the input, the regexp matched, and the match
1926 location (the MatchResult). When the match is accessed or the input is set, we reify results. We use
1927 a special value of setting the saved result to MatchResult::failed() to indicated that we're in a
1928 reified state. This means that next time a match is performed, the store of the result will
1929 automatically blow away the reified value.
1931 * JavaScriptCore.xcodeproj/project.pbxproj:
1933 * runtime/RegExp.cpp:
1934 (JSC::RegExpFunctionalTestCollector::outputOneTest):
1935 - changed 'subPattern' -> 'subpattern' (there was a mix in JSC, 'subpattern' was more common).
1936 * runtime/RegExpCachedResult.cpp: Added.
1937 (JSC::RegExpCachedResult::visitChildren):
1938 (JSC::RegExpCachedResult::lastResult):
1939 (JSC::RegExpCachedResult::setInput):
1940 - New methods, mark GC objects, lazily create the matches array, and record a user provided input (via assignment to RegExp.inupt).
1941 * runtime/RegExpCachedResult.h: Added.
1942 (RegExpCachedResult):
1944 (JSC::RegExpCachedResult::RegExpCachedResult):
1945 (JSC::RegExpCachedResult::record):
1946 (JSC::RegExpCachedResult::input):
1947 - Initialize the object, record the result of a RegExp match, access the stored input property.
1948 * runtime/RegExpConstructor.cpp:
1949 (JSC::RegExpConstructor::RegExpConstructor):
1950 - Initialize m_result/m_multiline properties.
1951 (JSC::RegExpConstructor::visitChildren):
1952 - Make sure the cached results (or lazy source for them) are marked.
1953 (JSC::RegExpConstructor::getBackref):
1954 (JSC::RegExpConstructor::getLastParen):
1955 (JSC::RegExpConstructor::getLeftContext):
1956 (JSC::RegExpConstructor::getRightContext):
1957 - Moved from RegExpConstructor, moved to RegExpCachedResult, and using new caching scheme.
1958 (JSC::regExpConstructorInput):
1959 (JSC::setRegExpConstructorInput):
1960 - Changed to use RegExpCachedResult.
1961 * runtime/RegExpConstructor.h:
1962 (JSC::RegExpConstructor::create):
1963 (RegExpConstructor):
1964 (JSC::RegExpConstructor::setMultiline):
1965 (JSC::RegExpConstructor::multiline):
1966 - Move multiline property onto the constructor object; it is not affected by the last match.
1967 (JSC::RegExpConstructor::setInput):
1968 (JSC::RegExpConstructor::input):
1969 - These defer to RegExpCachedResult.
1970 (JSC::RegExpConstructor::performMatch):
1971 * runtime/RegExpMatchesArray.cpp: Added.
1972 (JSC::RegExpMatchesArray::visitChildren):
1973 - Eeeep! added missing visitChildren!
1974 (JSC::RegExpMatchesArray::finishCreation):
1975 (JSC::RegExpMatchesArray::reifyAllProperties):
1976 (JSC::RegExpMatchesArray::reifyMatchProperty):
1977 - Moved from RegExpConstructor.cpp.
1978 (JSC::RegExpMatchesArray::leftContext):
1979 (JSC::RegExpMatchesArray::rightContext):
1980 - Since the match start/
1981 * runtime/RegExpMatchesArray.h:
1982 (RegExpMatchesArray):
1983 - Declare new methods & structure flags.
1984 * runtime/RegExpObject.cpp:
1985 (JSC::RegExpObject::match):
1986 - performMatch now requires the JSString input, to cache.
1987 * runtime/StringPrototype.cpp:
1988 (JSC::removeUsingRegExpSearch):
1989 (JSC::replaceUsingRegExpSearch):
1990 (JSC::stringProtoFuncMatch):
1991 (JSC::stringProtoFuncSearch):
1992 - performMatch now requires the JSString input, to cache.
1994 2012-03-23 Tony Chang <tony@chromium.org>
1996 [chromium] rename newwtf target back to wtf
1997 https://bugs.webkit.org/show_bug.cgi?id=82064
1999 Reviewed by Adam Barth.
2001 * JavaScriptCore.gyp/JavaScriptCore.gyp:
2003 2012-03-23 Mark Hahnenberg <mhahnenberg@apple.com>
2005 Simplify memory usage tracking in CopiedSpace
2006 https://bugs.webkit.org/show_bug.cgi?id=80705
2008 Reviewed by Filip Pizlo.
2010 * heap/CopiedAllocator.h:
2011 (CopiedAllocator): Rename currentUtilization to currentSize.
2012 (JSC::CopiedAllocator::currentCapacity):
2013 * heap/CopiedBlock.h:
2015 (JSC::CopiedBlock::payload): Move the implementation of payload() out of the class
2018 (JSC::CopiedBlock::size): Add new function to calculate the block's size.
2019 (JSC::CopiedBlock::capacity): Ditto for capacity.
2020 * heap/CopiedSpace.cpp:
2021 (JSC::CopiedSpace::CopiedSpace): Remove old bogus memory stats fields and add a new
2022 field for the water mark.
2023 (JSC::CopiedSpace::init):
2024 (JSC::CopiedSpace::tryAllocateSlowCase): When we fail to allocate from the current
2025 block, we need to update our current water mark with the size of the block.
2026 (JSC::CopiedSpace::tryAllocateOversize): When we allocate a new oversize block, we
2027 need to update our current water mark with the size of the used portion of the block.
2028 (JSC::CopiedSpace::tryReallocate): We don't need to update the water mark when
2029 reallocating because it will either get accounted for when we fill up the block later
2030 in the case of being able to reallocate in the current block or it will get picked up
2031 immediately because we'll have to get a new block.
2032 (JSC::CopiedSpace::tryReallocateOversize): We do, however, need to update in when
2033 realloc-ing an oversize block because we deallocate the old block and allocate a brand
2035 (JSC::CopiedSpace::doneFillingBlock): Update the water mark as blocks are returned to
2036 the CopiedSpace by the SlotVisitors.
2037 (JSC::CopiedSpace::doneCopying): Add in any pinned blocks to the water mark.
2038 (JSC::CopiedSpace::getFreshBlock): We use the Heap's new function to tell us whether or
2039 not we should collect now instead of doing the calculation ourself.
2040 (JSC::CopiedSpace::destroy):
2042 (JSC::CopiedSpace::size): Manually calculate the size of the CopiedSpace, similar to how
2044 (JSC::CopiedSpace::capacity): Ditto for capacity.
2045 * heap/CopiedSpace.h:
2046 (JSC::CopiedSpace::waterMark):
2048 * heap/CopiedSpaceInlineMethods.h:
2049 (JSC::CopiedSpace::startedCopying): Reset water mark to 0 when we start copying during a
2051 (JSC::CopiedSpace::allocateNewBlock):
2052 (JSC::CopiedSpace::fitsInBlock):
2053 (JSC::CopiedSpace::allocateFromBlock):
2055 (JSC::Heap::size): Incorporate size of CopiedSpace into the total size of the Heap.
2056 (JSC::Heap::capacity): Ditto for capacity.
2057 (JSC::Heap::collect):
2060 (JSC::Heap::shouldCollect): New function for other sub-parts of the Heap to use to
2061 determine whether they should initiate a collection or continue to allocate new blocks.
2063 (JSC::Heap::waterMark): Now is the sum of the water marks of the two sub-parts of the
2064 Heap (MarkedSpace and CopiedSpace).
2065 * heap/MarkedAllocator.cpp:
2066 (JSC::MarkedAllocator::allocateSlowCase): Changed to use the Heap's new shouldCollect() function.
2068 2012-03-23 Ryosuke Niwa <rniwa@webkit.org>
2070 BitVector::resizeOutOfLine doesn't memset when converting an inline buffer
2071 https://bugs.webkit.org/show_bug.cgi?id=82012
2073 Reviewed by Filip Pizlo.
2075 Initialize out-of-line buffers while extending an inline buffer. Also export symbols to be used in WebCore.
2077 * wtf/BitVector.cpp:
2078 (WTF::BitVector::resizeOutOfLine):
2083 2012-03-22 Michael Saboff <msaboff@apple.com>
2085 ExecutableAllocator::memoryPressureMultiplier() might can return NaN
2086 https://bugs.webkit.org/show_bug.cgi?id=82002
2088 Reviewed by Filip Pizlo.
2090 Guard against divide by zero and then make sure the return
2093 * jit/ExecutableAllocator.cpp:
2094 (JSC::ExecutableAllocator::memoryPressureMultiplier):
2095 * jit/ExecutableAllocatorFixedVMPool.cpp:
2096 (JSC::ExecutableAllocator::memoryPressureMultiplier):
2098 2012-03-22 Jessie Berlin <jberlin@apple.com>
2100 Windows build fix after r111778.
2102 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2103 Don't include and try to build files owned by WTF.
2104 Also, let VS have its way with the vcproj in terms of file ordering.
2106 2012-03-22 Raphael Kubo da Costa <rakuco@FreeBSD.org>
2108 [CMake] Unreviewed build fix after r111778.
2110 * CMakeLists.txt: Move ${WTF_DIR} after ${JAVASCRIPTCORE_DIR} in
2111 the include paths so that the right config.h is used.
2113 2012-03-22 Tony Chang <tony@chromium.org>
2115 Unreviewed, fix chromium build after wtf move.
2117 Remove old wtf_config and wtf targets.
2119 * JavaScriptCore.gyp/JavaScriptCore.gyp:
2121 2012-03-22 Martin Robinson <mrobinson@igalia.com>
2123 Fixed the GTK+ WTF/JavaScriptCore build after r111778.
2125 * GNUmakefile.list.am: Removed an extra trailing backslash.
2127 2012-03-22 Mark Rowe <mrowe@apple.com>
2131 * Configurations/JavaScriptCore.xcconfig: Tell the linker to pull in all members from static libraries
2132 rather than only those that contain symbols that JavaScriptCore itself uses.
2133 * JavaScriptCore.xcodeproj/project.pbxproj: Remove some bogus settings that crept in to the Xcode project.
2135 2012-03-22 Filip Pizlo <fpizlo@apple.com>
2137 DFG NodeFlags has some duplicate code and naming issues
2138 https://bugs.webkit.org/show_bug.cgi?id=81975
2140 Reviewed by Gavin Barraclough.
2142 Removed most references to "ArithNodeFlags" since those are now just part
2143 of the node flags. Fixed some renaming goofs (EdgedAsNum is once again
2144 NodeUsedAsNum). Got rid of setArithNodeFlags() and mergeArithNodeFlags()
2145 because the former was never called and the latter did the same things as
2148 * dfg/DFGByteCodeParser.cpp:
2149 (JSC::DFG::ByteCodeParser::makeSafe):
2150 (JSC::DFG::ByteCodeParser::makeDivSafe):
2151 (JSC::DFG::ByteCodeParser::handleIntrinsic):
2153 (JSC::DFG::Graph::dump):
2155 (JSC::DFG::Node::arithNodeFlags):
2157 * dfg/DFGNodeFlags.cpp:
2158 (JSC::DFG::nodeFlagsAsString):
2159 * dfg/DFGNodeFlags.h:
2161 (JSC::DFG::nodeUsedAsNumber):
2162 * dfg/DFGPredictionPropagationPhase.cpp:
2163 (JSC::DFG::PredictionPropagationPhase::propagate):
2164 (JSC::DFG::PredictionPropagationPhase::mergeDefaultArithFlags):
2166 2012-03-22 Eric Seidel <eric@webkit.org>
2168 Actually move WTF files to their new home
2169 https://bugs.webkit.org/show_bug.cgi?id=81844
2171 Unreviewed. The details of the port-specific changes
2172 have been seen by contributors from those ports, but
2173 the whole 5MB change isn't very reviewable as-is.
2176 * GNUmakefile.list.am:
2177 * JSCTypedArrayStubs.h:
2178 * JavaScriptCore.gypi:
2179 * JavaScriptCore.xcodeproj/project.pbxproj:
2182 2012-03-22 Kevin Ollivier <kevino@theolliviers.com>
2184 [wx] Unreviewed. Adding Source/WTF to the build.
2188 2012-03-22 Gavin Barraclough <barraclough@apple.com>
2190 Add JSValue::isFunction
2191 https://bugs.webkit.org/show_bug.cgi?id=81935
2193 Reviewed by Geoff Garen.
2195 This would be useful in the WebCore bindings code.
2196 Also, remove asFunction, replace with jsCast<JSFunction*>.
2198 * API/JSContextRef.cpp:
2199 * debugger/Debugger.cpp:
2200 * debugger/DebuggerCallFrame.cpp:
2201 (JSC::DebuggerCallFrame::functionName):
2203 (JSC::DFG::Graph::valueOfFunctionConstant):
2204 * dfg/DFGOperations.cpp:
2205 * interpreter/CallFrame.cpp:
2206 (JSC::CallFrame::isInlineCallFrameSlow):
2207 * interpreter/Interpreter.cpp:
2208 (JSC::Interpreter::privateExecute):
2210 (JSC::DEFINE_STUB_FUNCTION):
2211 (JSC::jitCompileFor):
2213 * llint/LLIntSlowPaths.cpp:
2214 (JSC::LLInt::traceFunctionPrologue):
2215 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2216 (JSC::LLInt::setUpCall):
2217 * runtime/Arguments.h:
2218 (JSC::Arguments::finishCreation):
2219 * runtime/ArrayPrototype.cpp:
2220 (JSC::arrayProtoFuncFilter):
2221 (JSC::arrayProtoFuncMap):
2222 (JSC::arrayProtoFuncEvery):
2223 (JSC::arrayProtoFuncForEach):
2224 (JSC::arrayProtoFuncSome):
2225 (JSC::arrayProtoFuncReduce):
2226 (JSC::arrayProtoFuncReduceRight):
2227 * runtime/CommonSlowPaths.h:
2228 (JSC::CommonSlowPaths::arityCheckFor):
2229 * runtime/Executable.h:
2230 (JSC::FunctionExecutable::compileFor):
2231 (JSC::FunctionExecutable::compileOptimizedFor):
2232 * runtime/FunctionPrototype.cpp:
2233 (JSC::functionProtoFuncToString):
2234 * runtime/JSArray.cpp:
2235 (JSC::JSArray::sort):
2236 * runtime/JSFunction.cpp:
2237 (JSC::JSFunction::argumentsGetter):
2238 (JSC::JSFunction::callerGetter):
2239 (JSC::JSFunction::lengthGetter):
2240 * runtime/JSFunction.h:
2242 (JSC::asJSFunction):
2243 (JSC::JSValue::isFunction):
2244 * runtime/JSGlobalData.cpp:
2245 (WTF::Recompiler::operator()):
2246 (JSC::JSGlobalData::releaseExecutableMemory):
2247 * runtime/JSValue.h:
2248 * runtime/StringPrototype.cpp:
2249 (JSC::replaceUsingRegExpSearch):
2251 2012-03-21 Filip Pizlo <fpizlo@apple.com>
2253 DFG speculation on booleans should be rationalized
2254 https://bugs.webkit.org/show_bug.cgi?id=81840
2256 Reviewed by Gavin Barraclough.
2258 This removes isKnownBoolean() and replaces it with AbstractState-based
2259 optimization, and cleans up the control flow in code gen methods for
2260 Branch and LogicalNot. Also fixes a goof in Node::shouldSpeculateNumber,
2261 and removes isKnownNotBoolean() since that method appeared to be a
2262 helper used solely by 32_64's speculateBooleanOperation().
2264 This is performance-neutral.
2266 * dfg/DFGAbstractState.cpp:
2267 (JSC::DFG::AbstractState::execute):
2269 (JSC::DFG::Node::shouldSpeculateNumber):
2270 * dfg/DFGSpeculativeJIT.cpp:
2272 * dfg/DFGSpeculativeJIT.h:
2274 * dfg/DFGSpeculativeJIT32_64.cpp:
2275 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
2276 (JSC::DFG::SpeculativeJIT::compileLogicalNot):
2277 (JSC::DFG::SpeculativeJIT::emitBranch):
2278 (JSC::DFG::SpeculativeJIT::compile):
2279 * dfg/DFGSpeculativeJIT64.cpp:
2280 (JSC::DFG::SpeculativeJIT::compileLogicalNot):
2281 (JSC::DFG::SpeculativeJIT::emitBranch):
2282 (JSC::DFG::SpeculativeJIT::compile):
2284 2012-03-21 Mark Rowe <mrowe@apple.com>
2288 * wtf/MetaAllocator.h:
2289 (MetaAllocator): Export the destructor.
2291 2012-03-21 Eric Seidel <eric@webkit.org>
2293 Fix remaining WTF includes in JavaScriptCore in preparation for moving WTF headers out of JavaScriptCore
2294 https://bugs.webkit.org/show_bug.cgi?id=81834
2296 Reviewed by Adam Barth.
2299 * os-win32/WinMain.cpp:
2300 * runtime/JSDateMath.cpp:
2301 * runtime/TimeoutChecker.cpp:
2303 * tools/CodeProfiling.cpp:
2305 2012-03-21 Eric Seidel <eric@webkit.org>
2307 WTF::MetaAllocator has a weak vtable (discovered when building wtf as a static library)
2308 https://bugs.webkit.org/show_bug.cgi?id=81838
2310 Reviewed by Geoffrey Garen.
2312 My understanding is that weak vtables happen when the compiler/linker cannot
2313 determine which compilation unit should constain the vtable. In this case
2314 because there were only pure virtual functions as well as an "inline"
2315 virtual destructor (thus the virtual destructor was defined in many compilation
2316 units). Since you can't actually "inline" a virtual function (it still has to
2317 bounce through the vtable), the "inline" on this virutal destructor doesn't
2318 actually help performance, and is only serving to confuse the compiler here.
2319 I've moved the destructor implementation to the .cpp file, thus making
2320 it clear to the compiler where the vtable should be stored, and solving the error.
2322 * wtf/MetaAllocator.cpp:
2323 (WTF::MetaAllocator::~MetaAllocator):
2325 * wtf/MetaAllocator.h:
2327 2012-03-20 Gavin Barraclough <barraclough@apple.com>
2329 RegExpMatchesArray should not copy the ovector
2330 https://bugs.webkit.org/show_bug.cgi?id=81742
2332 Reviewed by Michael Saboff.
2334 Currently, all RegExpMatchesArray object contain Vector<int, 32>, used to hold any sub-pattern results.
2335 This makes allocation/construction/destruction of these objects more expensive. Instead, just store the
2336 main match, and recreate the sub-pattern ranges only if necessary (these are often only used for grouping,
2337 and the results never accessed).
2338 If the main match (index 0) of the RegExpMatchesArray is accessed, reify that value alone.
2340 * dfg/DFGOperations.cpp:
2341 - RegExpObject match renamed back to test (test returns a bool).
2342 * runtime/RegExpConstructor.cpp:
2344 - Removed RegExpResult, RegExpMatchesArray constructor, destroy method.
2345 (JSC::RegExpMatchesArray::finishCreation):
2346 - Removed RegExpConstructorPrivate parameter.
2347 (JSC::RegExpMatchesArray::reifyAllProperties):
2348 - (Was fillArrayInstance) Reify all properties of the RegExpMatchesArray.
2349 If there are sub-pattern properties, the RegExp is re-run to generate their values.
2350 (JSC::RegExpMatchesArray::reifyMatchProperty):
2351 - Reify just the match (index 0) property of the RegExpMatchesArray.
2352 * runtime/RegExpConstructor.h:
2353 (RegExpConstructor):
2354 (JSC::RegExpConstructor::performMatch):
2355 - performMatch now returns a MatchResult, rather than using out-parameters.
2356 * runtime/RegExpMatchesArray.h:
2357 (JSC::RegExpMatchesArray::RegExpMatchesArray):
2358 - Moved from .cpp, stores the input/regExp/result to use when lazily reifying properties.
2359 (RegExpMatchesArray):
2360 (JSC::RegExpMatchesArray::create):
2361 - Now passed the input string matched against, the RegExp, and the MatchResult.
2362 (JSC::RegExpMatchesArray::reifyAllPropertiesIfNecessary):
2363 (JSC::RegExpMatchesArray::reifyMatchPropertyIfNecessary):
2364 - Helpers to conditionally reify properties.
2365 (JSC::RegExpMatchesArray::getOwnPropertySlot):
2366 (JSC::RegExpMatchesArray::getOwnPropertySlotByIndex):
2367 (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
2368 (JSC::RegExpMatchesArray::put):
2369 (JSC::RegExpMatchesArray::putByIndex):
2370 (JSC::RegExpMatchesArray::deleteProperty):
2371 (JSC::RegExpMatchesArray::deletePropertyByIndex):
2372 (JSC::RegExpMatchesArray::getOwnPropertyNames):
2373 (JSC::RegExpMatchesArray::defineOwnProperty):
2374 - Changed to use reifyAllPropertiesIfNecessary/reifyMatchPropertyIfNecessary
2375 (getOwnPropertySlotByIndex calls reifyMatchPropertyIfNecessary if index is 0).
2376 * runtime/RegExpObject.cpp:
2377 (JSC::RegExpObject::exec):
2378 (JSC::RegExpObject::match):
2379 - match now returns a MatchResult.
2380 * runtime/RegExpObject.h:
2381 (JSC::MatchResult::MatchResult):
2382 - Added the result of a match is a start & end tuple.
2383 (JSC::MatchResult::failed):
2384 - A failure is indicated by (notFound, 0).
2385 (JSC::MatchResult::operator bool):
2386 - Evaluates to false if the match failed.
2387 (JSC::MatchResult::empty):
2388 - Evaluates to true if the match succeeded with length 0.
2389 (JSC::RegExpObject::test):
2390 - Now returns a bool.
2391 * runtime/RegExpPrototype.cpp:
2392 (JSC::regExpProtoFuncTest):
2393 - RegExpObject match renamed back to test (test returns a bool).
2394 * runtime/StringPrototype.cpp:
2395 (JSC::removeUsingRegExpSearch):
2396 (JSC::replaceUsingRegExpSearch):
2397 (JSC::stringProtoFuncMatch):
2398 (JSC::stringProtoFuncSearch):
2399 - performMatch now returns a MatchResult, rather than using out-parameters.
2401 2012-03-21 Hojong Han <hojong.han@samsung.com>
2403 Fix out of memory by allowing overcommit
2404 https://bugs.webkit.org/show_bug.cgi?id=81743
2406 Reviewed by Geoffrey Garen.
2408 Garbage collection is not triggered and new blocks are added
2409 because overcommit is allowed by MAP_NORESERVE flag when high water mark is big enough.
2411 * wtf/OSAllocatorPosix.cpp:
2412 (WTF::OSAllocator::reserveAndCommit):
2414 2012-03-21 Jessie Berlin <jberlin@apple.com>
2416 More Windows build fixing.
2418 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2419 Fix the order of the include directories to look in include/private first before looking
2420 in include/private/JavaScriptCore.
2421 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGO.vsprops:
2422 Look in the Production output directory (where the wtf headers will be). This is the same
2423 thing that is done for jsc and testRegExp in ReleasePGO.
2425 2012-03-21 Jessie Berlin <jberlin@apple.com>
2427 WTF headers should be in $(ConfigurationBuildDir)\include\private\wtf, not
2428 $(ConfigurationBuildDir)\include\private\JavaScriptCore\wtf.
2429 https://bugs.webkit.org/show_bug.cgi?id=81739
2431 Reviewed by Dan Bernstein.
2433 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2434 Look for AtomicString.cpp, StringBuilder.cpp, StringImpl.cpp, and WTFString.cpp in the wtf
2435 subdirectory of the build output, not the JavaScriptCore/wtf subdirectory.
2436 * JavaScriptCore.vcproj/testRegExp/testRegExp.vcproj:
2439 * JavaScriptCore.vcproj/testRegExp/testRegExpReleasePGO.vsprops:
2440 Get the headers for those 4 files from the wtf subdirectory of the build output, not the
2441 JavaScriptCore/wtf subdirectory.
2442 * JavaScriptCore.vcproj/jsc/jscReleasePGO.vsprops:
2445 2012-03-20 Eric Seidel <eric@webkit.org>
2447 Move wtf/Platform.h from JavaScriptCore to Source/WTF/wtf
2448 https://bugs.webkit.org/show_bug.cgi?id=80911
2450 Reviewed by Adam Barth.
2452 Update the various build systems to depend on Source/WTF headers
2453 as well as remove references to Platform.h (since it's now moved).
2456 * JavaScriptCore.pri:
2457 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
2458 * JavaScriptCore.xcodeproj/project.pbxproj:
2459 * wtf/CMakeLists.txt:
2461 2012-03-20 Filip Pizlo <fpizlo@apple.com>
2463 op_mod fails on many interesting corner cases
2464 https://bugs.webkit.org/show_bug.cgi?id=81648
2466 Reviewed by Oliver Hunt.
2468 Removed most strength reduction for op_mod, and fixed the integer handling
2469 to do the right thing for corner cases. Oddly, this revealed bugs in OSR,
2470 which this patch also fixes.
2472 This patch is performance neutral on all of the major benchmarks we track.
2474 * dfg/DFGOperations.cpp:
2475 * dfg/DFGOperations.h:
2476 * dfg/DFGSpeculativeJIT.cpp:
2478 (JSC::DFG::SpeculativeJIT::compileSoftModulo):
2479 (JSC::DFG::SpeculativeJIT::compileArithMod):
2482 * jit/JITArithmetic.cpp:
2484 (JSC::JIT::emit_op_mod):
2485 (JSC::JIT::emitSlow_op_mod):
2486 * jit/JITArithmetic32_64.cpp:
2487 (JSC::JIT::emit_op_mod):
2488 (JSC::JIT::emitSlow_op_mod):
2489 * jit/JITOpcodes32_64.cpp:
2490 (JSC::JIT::privateCompileCTIMachineTrampolines):
2493 (TrampolineStructure):
2494 (JSC::JITThunks::ctiNativeConstruct):
2495 * llint/LowLevelInterpreter64.asm:
2497 * wtf/SimpleStats.h:
2498 (WTF::SimpleStats::variance):
2500 2012-03-20 Steve Falkenburg <sfalken@apple.com>
2502 Windows (make based) build fix.
2503 <rdar://problem/11069015>
2505 * JavaScriptCore.vcproj/JavaScriptCore.make: devenv /rebuild doesn't work with JavaScriptCore.vcproj. Use /clean and /build instead.
2507 2012-03-20 Steve Falkenburg <sfalken@apple.com>
2509 Move WTF-related Windows project files out of JavaScriptCore
2510 https://bugs.webkit.org/show_bug.cgi?id=80680
2512 This change only moves the vcproj and related files from JavaScriptCore/JavaScriptCore.vcproj/WTF.
2513 It does not move any source code. This is in preparation for the WTF source move out of
2516 Reviewed by Jessie Berlin.
2518 * JavaScriptCore.vcproj/JavaScriptCore.sln:
2519 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
2520 * JavaScriptCore.vcproj/WTF: Removed.
2521 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Removed.
2522 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: Removed.
2523 * JavaScriptCore.vcproj/WTF/WTFDebug.vsprops: Removed.
2524 * JavaScriptCore.vcproj/WTF/WTFDebugAll.vsprops: Removed.
2525 * JavaScriptCore.vcproj/WTF/WTFDebugCairoCFLite.vsprops: Removed.
2526 * JavaScriptCore.vcproj/WTF/WTFGenerated.make: Removed.
2527 * JavaScriptCore.vcproj/WTF/WTFGenerated.vcproj: Removed.
2528 * JavaScriptCore.vcproj/WTF/WTFGeneratedCommon.vsprops: Removed.
2529 * JavaScriptCore.vcproj/WTF/WTFGeneratedDebug.vsprops: Removed.
2530 * JavaScriptCore.vcproj/WTF/WTFGeneratedDebugAll.vsprops: Removed.
2531 * JavaScriptCore.vcproj/WTF/WTFGeneratedDebugCairoCFLite.vsprops: Removed.
2532 * JavaScriptCore.vcproj/WTF/WTFGeneratedProduction.vsprops: Removed.
2533 * JavaScriptCore.vcproj/WTF/WTFGeneratedRelease.vsprops: Removed.
2534 * JavaScriptCore.vcproj/WTF/WTFGeneratedReleaseCairoCFLite.vsprops: Removed.
2535 * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd: Removed.
2536 * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd: Removed.
2537 * JavaScriptCore.vcproj/WTF/WTFProduction.vsprops: Removed.
2538 * JavaScriptCore.vcproj/WTF/WTFRelease.vsprops: Removed.
2539 * JavaScriptCore.vcproj/WTF/WTFReleaseCairoCFLite.vsprops: Removed.
2540 * JavaScriptCore.vcproj/WTF/build-generated-files.sh: Removed.
2541 * JavaScriptCore.vcproj/WTF/copy-files.cmd: Removed.
2542 * JavaScriptCore.vcproj/WTF/work-around-vs-dependency-tracking-bugs.py: Removed.
2544 2012-03-20 Benjamin Poulain <bpoulain@apple.com>
2546 Cache the type string of JavaScript object
2547 https://bugs.webkit.org/show_bug.cgi?id=81446
2549 Reviewed by Geoffrey Garen.
2551 Instead of creating the JSString every time, we create
2552 lazily the strings in JSGlobalData.
2554 This avoid the construction of the StringImpl and of the JSString,
2555 which gives some performance improvements.
2557 * runtime/CommonIdentifiers.h:
2558 * runtime/JSValue.cpp:
2559 (JSC::JSValue::toStringSlowCase):
2560 * runtime/Operations.cpp:
2561 (JSC::jsTypeStringForValue):
2562 * runtime/SmallStrings.cpp:
2563 (JSC::SmallStrings::SmallStrings):
2564 (JSC::SmallStrings::finalizeSmallStrings):
2565 (JSC::SmallStrings::initialize):
2567 * runtime/SmallStrings.h:
2570 2012-03-20 Oliver Hunt <oliver@apple.com>
2572 Allow LLINT to work even when executable allocation fails.
2573 https://bugs.webkit.org/show_bug.cgi?id=81693
2575 Reviewed by Gavin Barraclough.
2577 Don't crash if executable allocation fails if we can fall back on LLINT
2579 * jit/ExecutableAllocatorFixedVMPool.cpp:
2580 (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
2581 * wtf/OSAllocatorPosix.cpp:
2582 (WTF::OSAllocator::reserveAndCommit):
2584 2012-03-20 Csaba Osztrogonác <ossy@webkit.org>
2586 Division optimizations fail to infer cases of truncated division and mishandle -2147483648/-1
2587 https://bugs.webkit.org/show_bug.cgi?id=81428
2589 32 bit buildfix after r111355.
2591 2147483648 (2^31) isn't valid int literal in ISO C90, because 2147483647 (2^31-1) is the biggest int.
2592 The smallest int is -2147483648 (-2^31) == -2147483647 - 1 == -INT32_MAX-1 == INT32_MIN (stdint.h).
2594 Reviewed by Zoltan Herczeg.
2596 * dfg/DFGSpeculativeJIT.cpp:
2597 (JSC::DFG::SpeculativeJIT::compileIntegerArithDivForX86):
2599 2012-03-19 Jochen Eisinger <jochen@chromium.org>
2601 Split WTFReportBacktrace into WTFReportBacktrace and WTFPrintBacktrace
2602 https://bugs.webkit.org/show_bug.cgi?id=80983
2604 Reviewed by Darin Adler.
2606 This allows printing a backtrace acquired by an earlier WTFGetBacktrace
2607 call which is useful for local debugging.
2609 * wtf/Assertions.cpp:
2612 2012-03-19 Benjamin Poulain <benjamin@webkit.org>
2614 Do not copy the script source in the SourceProvider, just reference the existing string
2615 https://bugs.webkit.org/show_bug.cgi?id=81466
2617 Reviewed by Geoffrey Garen.
2619 * parser/SourceCode.h: Remove the unused, and incorrect, function data().
2620 * parser/SourceProvider.h: Add OVERRIDE for clarity.
2622 2012-03-19 Filip Pizlo <fpizlo@apple.com>
2624 Division optimizations fail to infer cases of truncated division and
2625 mishandle -2147483648/-1
2626 https://bugs.webkit.org/show_bug.cgi?id=81428
2627 <rdar://problem/11067382>
2629 Reviewed by Oliver Hunt.
2631 If you're a division over integers and you're only used as an integer, then you're
2632 an integer division and remainder checks become unnecessary. If you're dividing
2633 -2147483648 by -1, don't crash.
2635 * assembler/MacroAssemblerX86Common.h:
2636 (MacroAssemblerX86Common):
2637 (JSC::MacroAssemblerX86Common::add32):
2638 * dfg/DFGSpeculativeJIT.cpp:
2640 (JSC::DFG::SpeculativeJIT::compileIntegerArithDivForX86):
2641 * dfg/DFGSpeculativeJIT.h:
2643 * dfg/DFGSpeculativeJIT32_64.cpp:
2644 (JSC::DFG::SpeculativeJIT::compile):
2645 * dfg/DFGSpeculativeJIT64.cpp:
2646 (JSC::DFG::SpeculativeJIT::compile):
2647 * llint/LowLevelInterpreter64.asm:
2649 2012-03-19 Benjamin Poulain <bpoulain@apple.com>
2651 Simplify SmallStrings
2652 https://bugs.webkit.org/show_bug.cgi?id=81445
2654 Reviewed by Gavin Barraclough.
2656 SmallStrings had two methods that should not be public: count() and clear().
2658 The method clear() is effectively replaced by finalizeSmallStrings(). The body
2659 of the method was moved to the constructor since the code is obvious.
2661 The method count() is unused.
2663 * runtime/SmallStrings.cpp:
2664 (JSC::SmallStrings::SmallStrings):
2665 * runtime/SmallStrings.h:
2668 2012-03-19 Filip Pizlo <fpizlo@apple.com>
2670 DFG can no longer compile V8-v4/regexp in debug mode
2671 https://bugs.webkit.org/show_bug.cgi?id=81592
2673 Reviewed by Gavin Barraclough.
2675 * dfg/DFGSpeculativeJIT32_64.cpp:
2676 (JSC::DFG::SpeculativeJIT::compile):
2677 * dfg/DFGSpeculativeJIT64.cpp:
2678 (JSC::DFG::SpeculativeJIT::compile):
2680 2012-03-19 Filip Pizlo <fpizlo@apple.com>
2682 Prediction propagation for UInt32ToNumber incorrectly assumes that outs outcome does not
2683 change throughout the fixpoint
2684 https://bugs.webkit.org/show_bug.cgi?id=81583
2686 Reviewed by Michael Saboff.
2688 * dfg/DFGPredictionPropagationPhase.cpp:
2689 (JSC::DFG::PredictionPropagationPhase::propagate):
2691 2012-03-19 Filip Pizlo <fpizlo@apple.com>
2693 GC should not attempt to clear LLInt instruction inline caches for code blocks that are in
2694 the process of being generated
2695 https://bugs.webkit.org/show_bug.cgi?id=81565
2697 Reviewed by Oliver Hunt.
2699 * bytecode/CodeBlock.cpp:
2700 (JSC::CodeBlock::finalizeUnconditionally):
2702 2012-03-19 Eric Seidel <eric@webkit.org>
2704 Fix WTF header include discipline in Chromium WebKit
2705 https://bugs.webkit.org/show_bug.cgi?id=81281
2707 Reviewed by James Robinson.
2709 * JavaScriptCore.gyp/JavaScriptCore.gyp:
2710 * wtf/unicode/icu/CollatorICU.cpp:
2712 2012-03-19 Filip Pizlo <fpizlo@apple.com>
2714 DFG NodeUse should be called Edge and NodeReferenceBlob should be called AdjacencyList
2715 https://bugs.webkit.org/show_bug.cgi?id=81556
2717 Rubber stamped by Gavin Barraclough.
2719 * GNUmakefile.list.am:
2720 * JavaScriptCore.xcodeproj/project.pbxproj:
2721 * dfg/DFGAbstractState.h:
2722 (JSC::DFG::AbstractState::forNode):
2723 * dfg/DFGAdjacencyList.h: Copied from Source/JavaScriptCore/dfg/DFGNodeReferenceBlob.h.
2724 (JSC::DFG::AdjacencyList::AdjacencyList):
2725 (JSC::DFG::AdjacencyList::child):
2726 (JSC::DFG::AdjacencyList::setChild):
2727 (JSC::DFG::AdjacencyList::child1):
2728 (JSC::DFG::AdjacencyList::child2):
2729 (JSC::DFG::AdjacencyList::child3):
2730 (JSC::DFG::AdjacencyList::setChild1):
2731 (JSC::DFG::AdjacencyList::setChild2):
2732 (JSC::DFG::AdjacencyList::setChild3):
2733 (JSC::DFG::AdjacencyList::child1Unchecked):
2734 (JSC::DFG::AdjacencyList::initialize):
2736 * dfg/DFGByteCodeParser.cpp:
2737 (JSC::DFG::ByteCodeParser::addVarArgChild):
2738 (JSC::DFG::ByteCodeParser::processPhiStack):
2739 * dfg/DFGCSEPhase.cpp:
2740 (JSC::DFG::CSEPhase::canonicalize):
2741 (JSC::DFG::CSEPhase::performSubstitution):
2742 * dfg/DFGEdge.h: Copied from Source/JavaScriptCore/dfg/DFGNodeUse.h.
2744 (JSC::DFG::Edge::Edge):
2745 (JSC::DFG::Edge::operator==):
2746 (JSC::DFG::Edge::operator!=):
2748 (JSC::DFG::operator==):
2749 (JSC::DFG::operator!=):
2751 (JSC::DFG::Graph::operator[]):
2752 (JSC::DFG::Graph::at):
2753 (JSC::DFG::Graph::ref):
2754 (JSC::DFG::Graph::deref):
2755 (JSC::DFG::Graph::clearAndDerefChild1):
2756 (JSC::DFG::Graph::clearAndDerefChild2):
2757 (JSC::DFG::Graph::clearAndDerefChild3):
2759 * dfg/DFGJITCompiler.h:
2760 (JSC::DFG::JITCompiler::getPrediction):
2762 (JSC::DFG::Node::Node):
2763 (JSC::DFG::Node::child1):
2764 (JSC::DFG::Node::child1Unchecked):
2765 (JSC::DFG::Node::child2):
2766 (JSC::DFG::Node::child3):
2768 * dfg/DFGNodeFlags.cpp:
2769 (JSC::DFG::arithNodeFlagsAsString):
2770 * dfg/DFGNodeFlags.h:
2772 (JSC::DFG::nodeUsedAsNumber):
2773 * dfg/DFGNodeReferenceBlob.h: Removed.
2774 * dfg/DFGNodeUse.h: Removed.
2775 * dfg/DFGPredictionPropagationPhase.cpp:
2776 (JSC::DFG::PredictionPropagationPhase::propagate):
2777 (JSC::DFG::PredictionPropagationPhase::mergeDefaultArithFlags):
2778 (JSC::DFG::PredictionPropagationPhase::vote):
2779 (JSC::DFG::PredictionPropagationPhase::fixupNode):
2780 * dfg/DFGScoreBoard.h:
2781 (JSC::DFG::ScoreBoard::use):
2782 * dfg/DFGSpeculativeJIT.cpp:
2783 (JSC::DFG::SpeculativeJIT::useChildren):
2784 (JSC::DFG::SpeculativeJIT::writeBarrier):
2785 (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
2786 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
2787 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
2788 (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant):
2789 * dfg/DFGSpeculativeJIT.h:
2790 (JSC::DFG::SpeculativeJIT::at):
2791 (JSC::DFG::SpeculativeJIT::canReuse):
2792 (JSC::DFG::SpeculativeJIT::use):
2794 (JSC::DFG::SpeculativeJIT::speculationCheck):
2795 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
2796 (JSC::DFG::IntegerOperand::IntegerOperand):
2797 (JSC::DFG::DoubleOperand::DoubleOperand):
2798 (JSC::DFG::JSValueOperand::JSValueOperand):
2799 (JSC::DFG::StorageOperand::StorageOperand):
2800 (JSC::DFG::SpeculateIntegerOperand::SpeculateIntegerOperand):
2801 (JSC::DFG::SpeculateStrictInt32Operand::SpeculateStrictInt32Operand):
2802 (JSC::DFG::SpeculateDoubleOperand::SpeculateDoubleOperand):
2803 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
2804 (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand):
2805 * dfg/DFGSpeculativeJIT32_64.cpp:
2806 (JSC::DFG::SpeculativeJIT::cachedPutById):
2807 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
2808 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
2809 (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull):
2810 (JSC::DFG::SpeculativeJIT::emitCall):
2811 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
2812 (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
2813 * dfg/DFGSpeculativeJIT64.cpp:
2814 (JSC::DFG::SpeculativeJIT::cachedPutById):
2815 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
2816 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
2817 (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull):
2818 (JSC::DFG::SpeculativeJIT::emitCall):
2819 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
2820 (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
2822 2012-03-19 Gavin Barraclough <barraclough@apple.com>
2824 Object.freeze broken on latest Nightly
2825 https://bugs.webkit.org/show_bug.cgi?id=80577
2827 Reviewed by Oliver Hunt.
2829 * runtime/Arguments.cpp:
2830 (JSC::Arguments::defineOwnProperty):
2831 - defineOwnProperty was checking for correct behaviour, provided that length/callee hadn't
2832 been overrridden. instead, just reify length/callee & rely on JSObject::defineOwnProperty.
2833 * runtime/JSFunction.cpp:
2834 (JSC::JSFunction::defineOwnProperty):
2835 - for arguments/caller/length properties, defineOwnProperty was incorrectly asserting that
2836 the object must be extensible; this is incorrect since these properties should already exist
2837 on the object. In addition, it was asserting that the arguments/caller values must match the
2838 corresponding magic data properties, but for strict mode function this is incorrect. Instead,
2839 just reify the arguments/caller accessor & defer to JSObject::defineOwnProperty.
2841 2012-03-19 Filip Pizlo <fpizlo@apple.com>
2843 LLInt get_by_pname slow path incorrectly assumes that the operands are not constants
2844 https://bugs.webkit.org/show_bug.cgi?id=81559
2846 Reviewed by Michael Saboff.
2848 * llint/LLIntSlowPaths.cpp:
2849 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2851 2012-03-19 Yong Li <yoli@rim.com>
2853 [BlackBerry] Implement OSAllocator::commit/decommit in the correct way
2854 https://bugs.webkit.org/show_bug.cgi?id=77013
2856 We should use mmap(PROT_NONE, MAP_LAZY) instead of posix_madvise() to
2857 implement memory decommitting for QNX.
2859 Reviewed by Rob Buis.
2861 * wtf/OSAllocatorPosix.cpp:
2862 (WTF::OSAllocator::reserveUncommitted):
2863 (WTF::OSAllocator::commit):
2864 (WTF::OSAllocator::decommit):
2866 2012-03-19 Gavin Barraclough <barraclough@apple.com>
2868 Unreviewed - revent a couple of files accidentally committed.
2870 * runtime/Arguments.cpp:
2871 (JSC::Arguments::defineOwnProperty):
2872 * runtime/JSFunction.cpp:
2873 (JSC::JSFunction::defineOwnProperty):
2875 2012-03-19 Jessie Berlin <jberlin@apple.com>
2877 Another Windows build fix after r111129.
2879 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2881 2012-03-19 Raphael Kubo da Costa <rakuco@FreeBSD.org>
2883 Cross-platform processor core counter: fix build on FreeBSD.
2884 https://bugs.webkit.org/show_bug.cgi?id=81482
2886 Reviewed by Zoltan Herczeg.
2888 The documentation of sysctl(3) shows that <sys/types.h> should be
2889 included before <sys/sysctl.h> (sys/types.h tends to be the first
2890 included header in general).
2892 This should fix the build on FreeBSD and other systems where
2893 sysctl.h really depends on types defined in types.h.
2895 * wtf/NumberOfCores.cpp:
2897 2012-03-19 Jessie Berlin <jberlin@apple.com>
2899 Windows build fix after r111129.
2901 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2903 2012-03-19 Gavin Barraclough <barraclough@apple.com>
2905 JSCallbackFunction::toStringCallback/valueOfCallback do not handle 0 return value from convertToType
2906 https://bugs.webkit.org/show_bug.cgi?id=81468 <rdar://problem/11034745>
2908 Reviewed by Oliver Hunt.
2910 The API specifies that convertToType may opt not to handle a conversion:
2911 "@result The objects's converted value, or NULL if the object was not converted."
2912 In which case, it would propagate first up the JSClass hierarchy, calling its superclass's
2913 conversion functions, and failing that call the JSObject::defaultValue function.
2915 Unfortunately this behaviour was removed in bug#69677/bug#69858, and instead we now rely on
2916 the toStringCallback/valueOfCallback function introduced in bug#69156. Even after a fix in
2917 bug#73368, these will return the result from the first convertToType they find, regardless
2918 of whether this result is null, and if no convertToType method is found in the api class
2919 hierarchy (possible if toStringCallback/valueOfCallback was accessed off the prototype
2920 chain), they will also return a null pointer. This is unsafe.
2922 It would be easy to make the approach based around toStringCallback/valueOfCallback continue
2923 to walk the api class hierarchy, but making the fallback to defaultValue would be problematic
2924 (since defaultValue calls toStringCallback/valueOfCallback, this would infinitely recurse).
2925 Making the fallback work with toString/valueOf methods attached to api objects is probably
2926 not the right thing to do – instead, we should just implement the defaultValue trap for api
2929 In addition, this bug highlights that fact that JSCallbackFunction::call will allow a hard
2930 null to be returned from C to JavaScript - this is not okay. Handle with an exception.
2932 * API/JSCallbackFunction.cpp:
2933 (JSC::JSCallbackFunction::call):
2934 - Should be null checking the return value.
2936 - Remove toStringCallback/valueOfCallback.
2937 * API/JSCallbackFunction.h:
2938 (JSCallbackFunction):
2939 - Remove toStringCallback/valueOfCallback.
2940 * API/JSCallbackObject.h:
2942 - Add defaultValue mthods to JSCallbackObject.
2943 * API/JSCallbackObjectFunctions.h:
2944 (JSC::::defaultValue):
2945 - Add defaultValue mthods to JSCallbackObject.
2946 * API/JSClassRef.cpp:
2947 (OpaqueJSClass::prototype):
2948 - Remove toStringCallback/valueOfCallback.
2949 * API/tests/testapi.js:
2950 - Revert this test, now we no longer artificially introduce a toString method onto the api object.
2952 2012-03-18 Raphael Kubo da Costa <rakuco@FreeBSD.org>
2954 [EFL] Include ICU_INCLUDE_DIRS when building.
2955 https://bugs.webkit.org/show_bug.cgi?id=81483
2957 Reviewed by Daniel Bates.
2959 So far, only the ICU libraries were being included when building
2960 JavaScriptCore, however the include path is also needed, otherwise the
2961 build will fail when ICU is installed into a non-standard location.
2963 * PlatformEfl.cmake: Include ${ICU_INCLUDE_DIRS}.
2965 2012-03-17 Gavin Barraclough <barraclough@apple.com>
2967 Strength reduction, RegExp.exec -> RegExp.test
2968 https://bugs.webkit.org/show_bug.cgi?id=81459
2970 Reviewed by Sam Weinig.
2972 RegExp.prototype.exec & RegExp.prototype.test can both be used to test a regular
2973 expression for a match against a string - however exec is more expensive, since
2974 it allocates a matches array object. In cases where the result is consumed in a
2975 boolean context the allocation of the matches array can be trivially elided.
2980 for (i =0; i < 10000000; ++i)
2985 This is a 2.5x speedup on this example microbenchmark loop.
2987 In a more advanced form of this optimization, we may be able to avoid allocating
2988 the array where access to the array can be observed.
2990 * create_hash_table:
2991 * dfg/DFGAbstractState.cpp:
2992 (JSC::DFG::AbstractState::execute):
2993 * dfg/DFGByteCodeParser.cpp:
2994 (JSC::DFG::ByteCodeParser::handleIntrinsic):
2996 (JSC::DFG::Node::hasHeapPrediction):
2997 * dfg/DFGNodeType.h:
2999 * dfg/DFGOperations.cpp:
3000 * dfg/DFGOperations.h:
3001 * dfg/DFGPredictionPropagationPhase.cpp:
3002 (JSC::DFG::PredictionPropagationPhase::propagate):
3003 * dfg/DFGSpeculativeJIT.cpp:
3004 (JSC::DFG::SpeculativeJIT::compileRegExpExec):
3006 * dfg/DFGSpeculativeJIT.h:
3007 (JSC::DFG::SpeculativeJIT::callOperation):
3008 * dfg/DFGSpeculativeJIT32_64.cpp:
3009 (JSC::DFG::SpeculativeJIT::compile):
3010 * dfg/DFGSpeculativeJIT64.cpp:
3011 (JSC::DFG::SpeculativeJIT::compile):
3013 (GlobalObject::addConstructableFunction):
3014 * runtime/Intrinsic.h:
3015 * runtime/JSFunction.cpp:
3016 (JSC::JSFunction::create):
3018 * runtime/JSFunction.h:
3020 * runtime/Lookup.cpp:
3021 (JSC::setUpStaticFunctionSlot):
3022 * runtime/RegExpObject.cpp:
3023 (JSC::RegExpObject::exec):
3024 (JSC::RegExpObject::match):
3025 * runtime/RegExpObject.h:
3027 * runtime/RegExpPrototype.cpp:
3028 (JSC::regExpProtoFuncTest):
3029 (JSC::regExpProtoFuncExec):
3031 2012-03-16 Michael Saboff <msaboff@apple.com>
3033 Improve diagnostic benefit of JSGlobalData::m_isInitializingObject
3034 https://bugs.webkit.org/show_bug.cgi?id=81244
3036 Rubber stamped by Filip Pizlo.
3038 Changed type and name of JSGlobalData::m_isInitializingObject to
3039 ClassInfo* and m_initializingObjectClass.
3040 Changed JSGlobalData::setInitializingObject to
3041 JSGlobalData::setInitializingObjectClass. This pointer can be used within
3042 the debugger to determine what type of object is being initialized.
3045 (JSC::JSCell::finishCreation):
3046 (JSC::allocateCell):
3047 * runtime/JSGlobalData.cpp:
3048 (JSC::JSGlobalData::JSGlobalData):
3049 * runtime/JSGlobalData.h:
3051 (JSC::JSGlobalData::isInitializingObject):
3052 (JSC::JSGlobalData::setInitializingObjectClass):
3053 * runtime/Structure.h:
3054 (JSC::JSCell::finishCreation):
3056 2012-03-16 Mark Rowe <mrowe@apple.com>
3058 Build fix. Do not preserve owner and group information when installing the WTF headers.
3060 * JavaScriptCore.xcodeproj/project.pbxproj:
3062 2012-03-15 David Dorwin <ddorwin@chromium.org>
3064 Make the array pointer parameters in the Typed Array create() methods const.
3065 https://bugs.webkit.org/show_bug.cgi?id=81147
3067 Reviewed by Kenneth Russell.
3069 This allows const arrays to be passed to these methods.
3070 They use PassRefPtr<Subclass> create(), which already has a const parameter.
3074 (WTF::Int16Array::create):
3077 (WTF::Int32Array::create):
3080 (WTF::Int8Array::create):
3081 * wtf/Uint16Array.h:
3083 (WTF::Uint16Array::create):
3084 * wtf/Uint32Array.h:
3086 (WTF::Uint32Array::create):
3089 (WTF::Uint8Array::create):
3090 * wtf/Uint8ClampedArray.h:
3091 (Uint8ClampedArray):
3092 (WTF::Uint8ClampedArray::create):
3094 2012-03-15 Myles Maxfield <mmaxfield@google.com>
3096 CopiedSpace::tryAllocateOversize assumes system page size
3097 https://bugs.webkit.org/show_bug.cgi?id=80615
3099 Reviewed by Geoffrey Garen.
3101 * heap/CopiedSpace.cpp:
3102 (JSC::CopiedSpace::tryAllocateOversize):
3103 * heap/CopiedSpace.h:
3105 * heap/CopiedSpaceInlineMethods.h:
3106 (JSC::CopiedSpace::oversizeBlockFor):
3107 * wtf/BumpPointerAllocator.h:
3108 (WTF::BumpPointerPool::create):
3109 * wtf/StdLibExtras.h:
3110 (WTF::roundUpToMultipleOf):
3112 2012-03-15 Mark Hahnenberg <mhahnenberg@apple.com>
3114 Fixing Windows build breakage
3116 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3118 2012-03-15 Patrick Gansterer <paroga@webkit.org>
3120 [EFL] Make zlib a general build requirement
3121 https://bugs.webkit.org/show_bug.cgi?id=80153
3123 Reviewed by Hajime Morita.
3125 After r109538 WebSocket module needs zlib to support deflate-frame extension.
3129 2012-03-15 Benjamin Poulain <bpoulain@apple.com>
3131 NumericStrings should be inlined
3132 https://bugs.webkit.org/show_bug.cgi?id=81183
3134 Reviewed by Gavin Barraclough.
3136 NumericStrings is not always inlined. When it is not, the class is not faster
3137 than using UString::number() directly.
3139 * runtime/NumericStrings.h:
3140 (JSC::NumericStrings::add):
3141 (JSC::NumericStrings::lookupSmallString):
3143 2012-03-15 Andras Becsi <andras.becsi@nokia.com>
3145 Fix ARM build after r110792.
3147 Unreviewed build fix.
3149 * jit/ExecutableAllocator.h:
3150 (JSC::ExecutableAllocator::cacheFlush):
3151 Remove superfluous curly brackets.
3153 2012-03-15 Gavin Barraclough <barraclough@apple.com>
3155 ARMv7: prefer vmov(gpr,gpr->double) over vmov(gpr->single)
3156 https://bugs.webkit.org/show_bug.cgi?id=81256
3158 Reviewed by Oliver Hunt.
3160 This is a 0.5% sunspider progression.
3162 * assembler/MacroAssemblerARMv7.h:
3163 (JSC::MacroAssemblerARMv7::convertInt32ToDouble):
3164 - switch which form of vmov we use.
3166 2012-03-15 YoungTaeck Song <youngtaeck.song@samsung.com>
3168 [EFL] Add OwnPtr specialization for Ecore_Timer.
3169 https://bugs.webkit.org/show_bug.cgi?id=80119
3171 Reviewed by Hajime Morita.
3173 Add an overload for deleteOwnedPtr(Ecore_Timer*) on EFL port.
3175 * wtf/OwnPtrCommon.h:
3177 * wtf/efl/OwnPtrEfl.cpp:
3178 (WTF::deleteOwnedPtr):
3181 2012-03-15 Hojong Han <hojong.han@samsung.com>
3183 Linux has madvise enough to support OSAllocator::commit/decommit
3184 https://bugs.webkit.org/show_bug.cgi?id=80505
3186 Reviewed by Geoffrey Garen.
3188 * wtf/OSAllocatorPosix.cpp:
3189 (WTF::OSAllocator::reserveUncommitted):
3190 (WTF::OSAllocator::commit):
3191 (WTF::OSAllocator::decommit):
3193 2012-03-15 Steve Falkenburg <sfalken@apple.com>
3197 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGO.vsprops:
3198 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreReleasePGOOptimize.vsprops:
3199 * JavaScriptCore.vcproj/WTF/copy-files.cmd:
3200 * JavaScriptCore.vcproj/jsc/jscReleasePGO.vsprops:
3202 2012-03-15 Steve Falkenburg <sfalken@apple.com>
3206 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj:
3208 2012-03-15 Kevin Ollivier <kevino@theolliviers.com>
3210 Move wx port to using export macros
3211 https://bugs.webkit.org/show_bug.cgi?id=77279
3213 Reviewed by Hajime Morita.
3218 2012-03-14 Benjamin Poulain <bpoulain@apple.com>
3220 Avoid StringImpl::getData16SlowCase() when sorting array
3221 https://bugs.webkit.org/show_bug.cgi?id=81070
3223 Reviewed by Geoffrey Garen.
3225 The function codePointCompare() is used intensively when sorting strings.
3226 This patch improves its performance by:
3227 -Avoiding character conversion.
3228 -Inlining the function.
3230 This makes Peacekeeper's arrayCombined test 30% faster.
3232 * wtf/text/StringImpl.cpp:
3233 * wtf/text/StringImpl.h:
3235 (WTF::codePointCompare):
3236 (WTF::codePointCompare8):
3237 (WTF::codePointCompare16):
3238 (WTF::codePointCompare8To16):
3240 2012-03-14 Hojong Han <hojong.han@samsung.com>
3242 Fix memory allocation failed by fastmalloc
3243 https://bugs.webkit.org/show_bug.cgi?id=79614
3245 Reviewed by Geoffrey Garen.
3247 Memory allocation failed even if the heap grows successfully.
3248 It is wrong to get the span only from the large list after the heap grows,
3249 because new span could be added in the normal list.
3251 * wtf/FastMalloc.cpp:
3252 (WTF::TCMalloc_PageHeap::New):
3254 2012-03-14 Hojong Han <hojong.han@samsung.com>
3256 Run cacheFlush page by page to assure of flushing all the requested ranges
3257 https://bugs.webkit.org/show_bug.cgi?id=77712
3259 Reviewed by Geoffrey Garen.
3261 Current MetaAllocator concept, always coalesces adjacent free spaces,
3262 doesn't meet memory management of Linux kernel.
3263 In a certain case Linux kernel doesn't regard contiguous virtual memory areas as one but two.
3264 Therefore cacheFlush page by page guarantees a flush-requested range.
3266 * jit/ExecutableAllocator.h:
3267 (JSC::ExecutableAllocator::cacheFlush):
3269 2012-03-14 Oliver Hunt <oliver@apple.com>
3271 Make ARMv7 work again
3272 https://bugs.webkit.org/show_bug.cgi?id=81157
3274 Reviewed by Geoffrey Garen.
3276 We were trying to use the ARMv7 dataRegister as a scratch register in a scenario
3277 where we the ARMv7MacroAssembler would also try to use dataRegister for its own
3280 * assembler/MacroAssembler.h:
3281 (JSC::MacroAssembler::store32):
3282 * assembler/MacroAssemblerARMv7.h:
3283 (MacroAssemblerARMv7):
3285 2012-03-14 Mark Hahnenberg <mhahnenberg@apple.com>
3287 Heap::destroy leaks CopiedSpace
3288 https://bugs.webkit.org/show_bug.cgi?id=81055
3290 Reviewed by Geoffrey Garen.
3292 Added a destroy() function to CopiedSpace that moves all normal size
3293 CopiedBlocks from the CopiedSpace to the Heap's list of free blocks
3294 as well as deallocates all of the oversize blocks in the CopiedSpace.
3295 This function is now called in Heap::destroy().
3297 * heap/CopiedSpace.cpp:
3298 (JSC::CopiedSpace::destroy):
3300 * heap/CopiedSpace.h:
3303 (JSC::Heap::destroy):
3305 2012-03-14 Andrew Lo <anlo@rim.com>
3307 [BlackBerry] Implement REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR using AnimationFrameRateController
3308 https://bugs.webkit.org/show_bug.cgi?id=81000
3310 Enable WTF_USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR for BlackBerry.
3312 Reviewed by Antonio Gomes.
3316 2012-03-13 Filip Pizlo <fpizlo@apple.com>
3318 ValueToInt32 speculation will cause OSR exits even when it does not have to
3319 https://bugs.webkit.org/show_bug.cgi?id=81068
3320 <rdar://problem/11043926>
3322 Reviewed by Anders Carlsson.
3324 Two related changes:
3325 1) ValueToInt32 will now always just defer to the non-speculative path, instead
3326 of exiting, if it doesn't know what speculations to perform.
3327 2) ValueToInt32 will speculate boolean if it sees this to be profitable.
3329 * dfg/DFGAbstractState.cpp:
3330 (JSC::DFG::AbstractState::execute):
3332 (JSC::DFG::Node::shouldSpeculateBoolean):
3334 * dfg/DFGSpeculativeJIT.cpp:
3335 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
3337 2012-03-13 Mark Hahnenberg <mhahnenberg@apple.com>
3339 More Windows build fixing
3341 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3343 2012-03-13 Mark Hahnenberg <mhahnenberg@apple.com>
3347 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3349 2012-03-13 Mark Hahnenberg <mhahnenberg@apple.com>
3351 Type conversion of exponential part failed
3352 https://bugs.webkit.org/show_bug.cgi?id=80673
3354 Reviewed by Geoffrey Garen.
3358 * runtime/JSGlobalObjectFunctions.cpp:
3361 (JSC::jsStrDecimalLiteral): Added another template argument that exposes whether or not
3362 we accept trailing junk to clients of jsStrDecimalLiteral. Also added additional template
3363 parameter for strtod to allow trailing spaces.
3365 (JSC::parseFloat): Accept trailing junk, as per the ECMA 262 spec (15.1.2.3).
3366 * runtime/LiteralParser.cpp:
3367 (JSC::::Lexer::lexNumber):
3368 * tests/mozilla/expected.html: Update the expected page for run-javascriptcore-tests so that
3369 we will run ecma/TypeConversion/9.3.1-3.js as a regression test now.
3372 (WTF::strtod): We also needed to sometimes accept trailing spaces to pass a few other tests that were
3373 broken by changing the default allowance of trailing junk in jsStrDecimalLiteral.
3375 * wtf/dtoa/double-conversion.cc: When the AdvanceToNonspace function was lifted out of the
3376 Chromium codebase, the person porting it only thought to check for spaces when skipping whitespace.
3377 A few of our JSC tests check for other types of trailing whitespace, so I've added checks for those
3378 here to cover those cases (horizontal tab, vertical tab, carriage return, form feed, and line feed).
3379 * wtf/text/WTFString.cpp:
3380 (WTF::toDoubleType): Disallow trailing spaces, as this breaks form input verification stuff.
3382 2012-03-13 Filip Pizlo <fpizlo@apple.com>
3384 Unreviewed, build fix since is_pod<> includes some header that I didn't know about.
3385 Removing the assert for now.
3387 * dfg/DFGOperations.h:
3388 * llint/LLIntSlowPaths.h:
3390 2012-03-13 Filip Pizlo <fpizlo@apple.com>
3392 Functions with C linkage should return POD types
3393 https://bugs.webkit.org/show_bug.cgi?id=81061
3395 Reviewed by Mark Rowe.
3397 * dfg/DFGOperations.h:
3398 * llint/LLIntSlowPaths.h:
3400 (SlowPathReturnType):
3401 (JSC::LLInt::encodeResult):
3403 2012-03-13 Filip Pizlo <fpizlo@apple.com>
3405 Loads from UInt32Arrays should not result in a double up-convert if it isn't necessary
3406 https://bugs.webkit.org/show_bug.cgi?id=80979
3407 <rdar://problem/11036848>
3409 Reviewed by Oliver Hunt.
3411 Also improved DFG IR dumping to include type information in a somewhat more
3414 * bytecode/PredictedType.cpp:
3415 (JSC::predictionToAbbreviatedString):
3417 * bytecode/PredictedType.h:
3419 * dfg/DFGAbstractState.cpp:
3420 (JSC::DFG::AbstractState::execute):
3422 (JSC::DFG::Graph::dump):
3423 * dfg/DFGPredictionPropagationPhase.cpp:
3424 (JSC::DFG::PredictionPropagationPhase::propagate):
3425 * dfg/DFGSpeculativeJIT.cpp:
3426 (JSC::DFG::SpeculativeJIT::compileUInt32ToNumber):
3427 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
3428 * dfg/DFGSpeculativeJIT.h:
3429 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
3431 2012-03-13 George Staikos <staikos@webkit.org>
3433 The callback is only used if SA_RESTART is defined. Compile it out
3434 otherwise to avoid a warning.
3435 https://bugs.webkit.org/show_bug.cgi?id=80926
3437 Reviewed by Alexey Proskuryakov.
3439 * heap/MachineStackMarker.cpp: