Build fix: Removed an incorrect symbol on Windows.
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2011-06-16  Geoffrey Garen  <ggaren@apple.com>
2
3         Build fix: Removed an incorrect symbol on Windows.
4
5         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6
7 2011-06-16  Geoffrey Garen  <ggaren@apple.com>
8
9         Build fix: Removed an accidental commit from the future.
10
11         * CMakeLists.txt:
12
13 2011-06-16  Geoffrey Garen  <ggaren@apple.com>
14
15         Reviewed by Oliver Hunt.
16
17         Introduced SlotVisitor into the project
18         https://bugs.webkit.org/show_bug.cgi?id=62820
19         
20         This resolves a class vs typedef forward declaration issue, and gives all
21         exported symbols the correct names.
22
23         * CMakeLists.txt:
24         * GNUmakefile.list.am:
25         * JavaScriptCore.exp:
26         * JavaScriptCore.gypi:
27         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
28         * JavaScriptCore.xcodeproj/project.pbxproj: Build!
29
30         * bytecode/EvalCodeCache.h:
31         * heap/HandleHeap.h:
32         * heap/Heap.cpp:
33         (JSC::Heap::Heap):
34         (JSC::Heap::markRoots):
35         * heap/Heap.h:
36         * heap/HeapRootVisitor.h: Replaced MarkStack with SlotVisitor. Now no
37         clients operate on a MarkStack.
38
39         * heap/MarkStack.cpp:
40         (JSC::SlotVisitor::visitChildren):
41         (JSC::SlotVisitor::drain):
42         * heap/SlotVisitor.h: Added.
43         (JSC::SlotVisitor::SlotVisitor): Used 'protected' and a little cheesy
44         inheritance to give SlotVisitor all the attributes of MarkStack without
45         making this change giant. Over time, we will move more behavior into
46         SlotVisitor and its subclasses.
47
48         * heap/MarkStack.h:
49         * heap/NewSpace.h: Replaced MarkStack with SlotVisitor. Now no
50         clients operate on a MarkStack.
51
52         * runtime/ArgList.h:
53         * runtime/JSCell.h:
54         * runtime/JSObject.h:
55         * runtime/ScopeChain.h:
56         * runtime/SmallStrings.h:
57         * runtime/Structure.h: Replaced MarkStack with SlotVisitor. Now no
58         clients operate on a MarkStack.
59
60 2011-06-15  Oliver Hunt  <oliver@apple.com>
61
62         Reviewed by Geoffrey Garen.
63
64         Reduce memory usage of resolve_global
65         https://bugs.webkit.org/show_bug.cgi?id=62765
66
67         If we have a large number of resolve_globals in a single
68         block start planting plain resolve instructions instead 
69         whenever we aren't in a loop.  This allows us to reduce
70         the code size for extremely large functions without
71         losing the performance benefits of op_resolve_global.
72
73         * bytecode/CodeBlock.h:
74         (JSC::CodeBlock::globalResolveInfoCount):
75         * bytecompiler/BytecodeGenerator.cpp:
76         (JSC::BytecodeGenerator::shouldAvoidResolveGlobal):
77         (JSC::BytecodeGenerator::emitResolve):
78         (JSC::BytecodeGenerator::emitResolveWithBase):
79         * bytecompiler/BytecodeGenerator.h:
80
81 2011-06-16  Qi Zhang  <qi.2.zhang@nokia.com>
82
83         Reviewed by Laszlo Gombos.
84
85         [Qt] Fix building with CONFIG(use_system_icu)
86         https://bugs.webkit.org/show_bug.cgi?id=62744
87
88         Do not define WTF_USE_QT4_UNICODE if WTF_USE_ICU_UNICODE is set.
89
90         * wtf/Platform.h:
91
92 2011-06-15  Darin Adler  <darin@apple.com>
93
94         Reviewed by Adam Barth.
95
96         Remove obsolete LOOSE_OWN_PTR code
97         https://bugs.webkit.org/show_bug.cgi?id=59909
98
99         The internal Apple dependency on this is gone now.
100
101         * wtf/OwnArrayPtr.h: Removed constructor that takes a raw pointer,
102         set function that takes a raw pointer.
103
104         * wtf/OwnPtr.h: Removed constructor that takes a raw pointer,
105         set functino that takes a raw pointer.
106
107         * wtf/PassOwnArrayPtr.h: Made constructor that takes a nullptr
108         and assignment operator that takes a nullptr unconditional.
109         Made constructor that takes a raw pointer private and explicit,
110         and removed assignment operator that takes a raw pointer.
111
112         * wtf/PassOwnPtr.h: Made assignment operator that takes a nullptr
113         unconditional. Made constructor that takes a raw pointer private
114         and explicit, and removed assignment operator that takes a raw pointer.
115
116 2011-06-15  Sam Weinig  <sam@webkit.org>
117
118         Reviewed by Geoffrey Garen and Gavin Barraclough.
119
120         Make access-nseive ~9x faster on the non-speculative path by
121         adding special casing for doubles that can lossless-ly be converted
122         to a uint32_t in getByVal and putByVal. This avoids calls to stringification
123         and the hash lookup.  Long term, we should try and get property of a getByVal
124         and putByVal to be an integer immediate even in the non-speculative path.
125
126         * dfg/DFGOperations.cpp:
127         (JSC::DFG::putByVal):
128         (JSC::DFG::operationPutByValInternal):
129
130 2011-06-15  Oliver Hunt  <oliver@apple.com>
131
132         Reviewed by Darin Adler.
133
134         REGRESSION (r88719): 5by5.tv schedule is not visible
135         https://bugs.webkit.org/show_bug.cgi?id=62720
136
137         Problem here is that the lexer wasn't considering '$' to be
138         a valid character in an identifier.
139
140         * parser/Lexer.h:
141         (JSC::Lexer::lexExpectIdentifier):
142
143 2011-06-15  Oliver Hunt  <oliver@apple.com>
144
145         Reviewed by Sam Weinig.
146
147         Reduce the size of global_resolve
148         https://bugs.webkit.org/show_bug.cgi?id=62738
149
150         Reduce the code size of global_resolve in the JIT by replacing
151         multiple pointer loads with a single pointer move + two offset
152         loads.
153
154         * jit/JITOpcodes.cpp:
155         (JSC::JIT::emit_op_resolve_global):
156         * jit/JITOpcodes32_64.cpp:
157         (JSC::JIT::emit_op_resolve_global):
158
159 2011-06-14  Geoffrey Garen  <ggaren@apple.com>
160
161         Reviewed by Dan Bernstein.
162
163         Fixed an inavlid ASSERT I found while investigating
164         <rdar://problem/9580254> Crash in JSC::HandleHeap::finalizeWeakHandles + 92
165         https://bugs.webkit.org/show_bug.cgi?id=62699        
166
167         No test since we don't know of a way to get WebCore to deallocate the
168         next-to-finalize handle, which is also the last handle in the list,
169         while finalizing the second-to-last handle in the list.
170
171         * heap/HandleHeap.h:
172         (JSC::HandleHeap::deallocate): Don't ASSERT that m_nextToFinalize has a
173         non-0 next() after updating it, since it is valid to update m_nextToFinalize
174         to point to the tail sentinel.
175         
176         Do ASSERT that m_nextToFinalize has a non-0 next() before updating it,
177         since it is not valid to update m_nextToFinalize to point past the tail
178         sentinel.
179         
180         Also, use m_nextToFinalize consistently for clarity.
181
182 2011-06-14  Gavin Barraclough  <barraclough@apple.com>
183
184         Reviewed by Sam Weinig.
185
186         https://bugs.webkit.org/show_bug.cgi?id=43841
187         SegmentedVector::operator== typo
188
189         * wtf/SegmentedVector.h:
190         (WTF::SegmentedVectorIterator::operator==):
191         (WTF::SegmentedVectorIterator::operator!=):
192
193 2011-06-14  Oliver Hunt  <oliver@apple.com>
194
195         Reviewed by Gavin Barraclough.
196
197         Constant array literals result in unnecessarily large amounts of code
198         https://bugs.webkit.org/show_bug.cgi?id=62658
199
200         Add a new version of op_new_array that simply copies values from a buffer
201         we hang off of the CodeBlock, rather than generating code to place each
202         entry into the registerfile, and then copying it from the registerfile into
203         the array.  This is a slight improvement on some sunspider tests, but no
204         measurable overall change.  That's okay though as our goal was to reduce
205         code size without hurting performance.
206
207         * bytecode/CodeBlock.cpp:
208         (JSC::CodeBlock::dump):
209         * bytecode/CodeBlock.h:
210         (JSC::CodeBlock::addImmediateBuffer):
211         (JSC::CodeBlock::immediateBuffer):
212         * bytecode/Opcode.h:
213         * bytecompiler/BytecodeGenerator.cpp:
214         (JSC::BytecodeGenerator::addImmediateBuffer):
215         (JSC::BytecodeGenerator::emitNewArray):
216         * bytecompiler/BytecodeGenerator.h:
217         * bytecompiler/NodesCodegen.cpp:
218         (JSC::ArrayNode::emitBytecode):
219         * interpreter/Interpreter.cpp:
220         (JSC::Interpreter::privateExecute):
221         * jit/JIT.cpp:
222         (JSC::JIT::privateCompileMainPass):
223         * jit/JIT.h:
224         * jit/JITOpcodes.cpp:
225         (JSC::JIT::emit_op_new_array):
226         (JSC::JIT::emit_op_new_array_buffer):
227         * jit/JITOpcodes32_64.cpp:
228         * jit/JITStubs.cpp:
229         (JSC::DEFINE_STUB_FUNCTION):
230         * jit/JITStubs.h:
231
232 2011-06-14  Sheriff Bot  <webkit.review.bot@gmail.com>
233
234         Unreviewed, rolling out r88841.
235         http://trac.webkit.org/changeset/88841
236         https://bugs.webkit.org/show_bug.cgi?id=62672
237
238         Caused many tests to crash (Requested by rniwa on #webkit).
239
240         * bytecode/CodeBlock.cpp:
241         (JSC::CodeBlock::dump):
242         * bytecode/CodeBlock.h:
243         * bytecode/Opcode.h:
244         * bytecompiler/BytecodeGenerator.cpp:
245         (JSC::BytecodeGenerator::emitNewArray):
246         * bytecompiler/BytecodeGenerator.h:
247         * bytecompiler/NodesCodegen.cpp:
248         (JSC::ArrayNode::emitBytecode):
249         * interpreter/Interpreter.cpp:
250         (JSC::Interpreter::privateExecute):
251         * jit/JIT.cpp:
252         (JSC::JIT::privateCompileMainPass):
253         * jit/JIT.h:
254         * jit/JITOpcodes.cpp:
255         (JSC::JIT::emit_op_new_array):
256         * jit/JITOpcodes32_64.cpp:
257         (JSC::JIT::emit_op_new_array):
258         * jit/JITStubs.cpp:
259         * jit/JITStubs.h:
260
261 2011-06-14  Oliver Hunt  <oliver@apple.com>
262
263         Reviewed by Gavin Barraclough.
264
265         Constant array literals result in unnecessarily large amounts of code
266         https://bugs.webkit.org/show_bug.cgi?id=62658
267
268         Add a new version of op_new_array that simply copies values from a buffer
269         we hang off of the CodeBlock, rather than generating code to place each
270         entry into the registerfile, and then copying it from the registerfile into
271         the array.  This is a slight improvement on some sunspider tests, but no
272         measurable overall change.  That's okay though as our goal was to reduce
273         code size without hurting performance.
274
275         * bytecode/CodeBlock.cpp:
276         (JSC::CodeBlock::dump):
277         * bytecode/CodeBlock.h:
278         (JSC::CodeBlock::addImmediateBuffer):
279         (JSC::CodeBlock::immediateBuffer):
280         * bytecode/Opcode.h:
281         * bytecompiler/BytecodeGenerator.cpp:
282         (JSC::BytecodeGenerator::addImmediateBuffer):
283         (JSC::BytecodeGenerator::emitNewArray):
284         * bytecompiler/BytecodeGenerator.h:
285         * bytecompiler/NodesCodegen.cpp:
286         (JSC::ArrayNode::emitBytecode):
287         * interpreter/Interpreter.cpp:
288         (JSC::Interpreter::privateExecute):
289         * jit/JIT.cpp:
290         (JSC::JIT::privateCompileMainPass):
291         * jit/JIT.h:
292         * jit/JITOpcodes.cpp:
293         (JSC::JIT::emit_op_new_array):
294         (JSC::JIT::emit_op_new_array_buffer):
295         * jit/JITOpcodes32_64.cpp:
296         * jit/JITStubs.cpp:
297         (JSC::DEFINE_STUB_FUNCTION):
298         * jit/JITStubs.h:
299
300 2011-06-14  Stephanie Lewis  <slewis@apple.com>
301
302         Rubber stamped by Oliver Hunt.
303
304         <rdar://problem/9511169>
305         Update order files.
306
307         * JavaScriptCore.order:
308
309 2011-06-14  Sam Weinig  <sam@webkit.org>
310
311         Reviewed by Geoffrey Garen.
312
313         Fix dumping of constants to have the correct constant number.
314
315         * bytecode/CodeBlock.cpp:
316         (JSC::CodeBlock::dump):
317
318 2011-06-14  Benjamin Poulain  <benjamin@webkit.org>
319
320         Reviewed by Eric Seidel.
321
322         KeywordLookupGenerator's Trie does not work with Python 3
323         https://bugs.webkit.org/show_bug.cgi?id=62635
324
325         With Python 3, dict.items() return an iterator. Since the iterator
326         protocol changed between Python 2 and 3, the easiest way to get the
327         values is to have something that use the iterator implicitely, like a
328         for() loop.
329
330         * KeywordLookupGenerator.py:
331
332 2011-06-13  Oliver Hunt  <oliver@apple.com>
333
334         Reviewed by Gavin Barraclough.
335
336         Fix llocp and lvalp names in the lexer to something more meaningful
337         https://bugs.webkit.org/show_bug.cgi?id=62605
338
339         A simple rename
340
341         * parser/Lexer.cpp:
342         (JSC::Lexer::parseIdentifier):
343         (JSC::Lexer::parseString):
344         (JSC::Lexer::lex):
345         * parser/Lexer.h:
346         (JSC::Lexer::lexExpectIdentifier):
347
348 2011-06-13  Oliver Hunt  <oliver@apple.com>
349
350         Reviewed by Gavin Barraclough.
351
352         Make it possible to inline the common case of identifier lexing
353         https://bugs.webkit.org/show_bug.cgi?id=62600
354
355         Add a lexing function that expects to lex an "normal" alpha numeric
356         identifier (that ignores keywords) so it's possible to inline the
357         common parsing cases.  This comes out as a reasonable parsing speed
358         boost.
359
360         * parser/JSParser.cpp:
361         (JSC::JSParser::nextExpectIdentifier):
362         (JSC::JSParser::parseProperty):
363         (JSC::JSParser::parseMemberExpression):
364         * parser/Lexer.cpp:
365         * parser/Lexer.h:
366         (JSC::Lexer::makeIdentifier):
367         (JSC::Lexer::lexExpectIdentifier):
368
369 2011-06-13  Xan Lopez  <xlopez@igalia.com>
370
371         Reviewed by Martin Robinson.
372
373         Distcheck fixes.
374
375         * GNUmakefile.am:
376         * GNUmakefile.list.am:
377
378 2011-06-13  Oliver Hunt  <oliver@apple.com>
379
380         Reviewed by Simon Fraser.
381
382         Make it possible to inline Identifier::equal
383         https://bugs.webkit.org/show_bug.cgi?id=62584
384
385         Move Identifier::equal to the Identifier header file.
386
387         * runtime/Identifier.cpp:
388         * runtime/Identifier.h:
389         (JSC::Identifier::equal):
390
391 2011-06-13  Tony Chang  <tony@chromium.org>
392
393         Reviewed by Dimitri Glazkov.
394
395         rename ENABLE_NEW_FLEXBOX to ENABLE_CSS3_FLEXBOX
396         https://bugs.webkit.org/show_bug.cgi?id=62578
397
398         * Configurations/FeatureDefines.xcconfig:
399
400 2011-06-13  Tony Chang  <tony@chromium.org>
401
402         Reviewed by Adam Barth.
403
404         rename ENABLE_FLEXBOX to ENABLE_NEW_FLEXBOX
405         https://bugs.webkit.org/show_bug.cgi?id=62545
406
407         * Configurations/FeatureDefines.xcconfig:
408
409 2011-06-12  Patrick Gansterer  <paroga@webkit.org>
410
411         Unreviewed. Build fix for !ENABLE(JIT) after r88604.
412
413         * bytecode/CodeBlock.cpp:
414         (JSC::CodeBlock::visitAggregate):
415
416 2011-06-11  Gavin Barraclough  <barraclough@apple.com>
417
418         Reviewed by Darin Adler.
419
420         https://bugs.webkit.org/show_bug.cgi?id=16777
421
422         Remove #define NaN per Darin's comments.
423
424         * runtime/JSGlobalObjectFunctions.cpp:
425         (JSC::parseIntOverflow):
426         (JSC::parseInt):
427         (JSC::jsStrDecimalLiteral):
428         (JSC::jsToNumber):
429         (JSC::parseFloat):
430         * wtf/DateMath.cpp:
431         (WTF::equivalentYearForDST):
432         (WTF::parseES5DateFromNullTerminatedCharacters):
433         (WTF::parseDateFromNullTerminatedCharacters):
434         (WTF::timeClip):
435         (JSC::parseDateFromNullTerminatedCharacters):
436
437 2011-06-11  Gavin Barraclough  <barraclough@apple.com>
438
439         Rubber stamped by Geoff Garen.
440
441         https://bugs.webkit.org/show_bug.cgi?id=62503
442         Remove JIT_OPTIMIZE_* switches
443
444         The alternative code paths are untested, and not well maintained.
445         These were useful when there was more churn in the JIT, but now
446         are a maintenance overhead. Time to move on, removing.
447
448         * bytecode/CodeBlock.cpp:
449         (JSC::CodeBlock::visitAggregate):
450         * jit/JIT.cpp:
451         (JSC::JIT::privateCompileSlowCases):
452         (JSC::JIT::privateCompile):
453         (JSC::JIT::linkConstruct):
454         * jit/JIT.h:
455         * jit/JITCall.cpp:
456         * jit/JITCall32_64.cpp:
457         * jit/JITOpcodes.cpp:
458         (JSC::JIT::privateCompileCTIMachineTrampolines):
459         (JSC::JIT::privateCompileCTINativeCall):
460         * jit/JITOpcodes32_64.cpp:
461         (JSC::JIT::privateCompileCTIMachineTrampolines):
462         (JSC::JIT::privateCompileCTINativeCall):
463         (JSC::JIT::softModulo):
464         * jit/JITPropertyAccess.cpp:
465         * jit/JITPropertyAccess32_64.cpp:
466         * jit/JITStubs.cpp:
467         (JSC::DEFINE_STUB_FUNCTION):
468         * runtime/Lookup.cpp:
469         (JSC::setUpStaticFunctionSlot):
470         * runtime/Lookup.h:
471         * wtf/Platform.h:
472
473 2011-06-10  Gavin Barraclough  <barraclough@apple.com>
474
475         Reviewed by Sam Weinig.
476
477         https://bugs.webkit.org/show_bug.cgi?id=16777
478         Eliminate JSC::NaN and JSC::Inf
479
480         There's no good reason for -K-J-S- JSC to have its own NAN and infinity constants.
481         The ones in std::numeric_limits are perfectly good.
482         Remove JSC::Inf, JSC::NaN, switch some cases of (isnan || isinf) to !isfinite.
483
484         * API/JSCallbackObjectFunctions.h:
485         (JSC::::toNumber):
486         * API/JSValueRef.cpp:
487         (JSValueMakeNumber):
488         (JSValueToNumber):
489         * JavaScriptCore.exp:
490         * runtime/CachedTranscendentalFunction.h:
491         (JSC::CachedTranscendentalFunction::initialize):
492         * runtime/DateConstructor.cpp:
493         (JSC::constructDate):
494         * runtime/DateInstanceCache.h:
495         (JSC::DateInstanceData::DateInstanceData):
496         (JSC::DateInstanceCache::reset):
497         * runtime/JSCell.cpp:
498         * runtime/JSCell.h:
499         (JSC::JSCell::JSValue::getPrimitiveNumber):
500         (JSC::JSCell::JSValue::toNumber):
501         * runtime/JSGlobalData.cpp:
502         (JSC::JSGlobalData::JSGlobalData):
503         (JSC::JSGlobalData::resetDateCache):
504         * runtime/JSGlobalObject.cpp:
505         (JSC::JSGlobalObject::reset):
506         * runtime/JSGlobalObjectFunctions.cpp:
507         (JSC::globalFuncParseInt):
508         (JSC::globalFuncIsFinite):
509         * runtime/JSNotAnObject.cpp:
510         (JSC::JSNotAnObject::toNumber):
511         * runtime/JSValue.cpp:
512         * runtime/JSValue.h:
513         * runtime/JSValueInlineMethods.h:
514         (JSC::jsNaN):
515         * runtime/MathObject.cpp:
516         (JSC::mathProtoFuncMax):
517         (JSC::mathProtoFuncMin):
518         * runtime/NumberConstructor.cpp:
519         (JSC::numberConstructorNegInfinity):
520         (JSC::numberConstructorPosInfinity):
521         * runtime/NumberPrototype.cpp:
522         (JSC::numberProtoFuncToExponential):
523         (JSC::numberProtoFuncToFixed):
524         (JSC::numberProtoFuncToPrecision):
525         (JSC::numberProtoFuncToString):
526         * runtime/UString.cpp:
527         * wtf/DecimalNumber.h:
528         (WTF::DecimalNumber::DecimalNumber):
529         * wtf/dtoa.cpp:
530         (WTF::dtoa):
531
532 2011-06-10  Tony Chang  <tony@chromium.org>
533
534         Reviewed by Ojan Vafai.
535
536         add a compile guard ENABLE(FLEXBOX)
537         https://bugs.webkit.org/show_bug.cgi?id=62049
538
539         * Configurations/FeatureDefines.xcconfig:
540
541 2011-06-10  Gavin Barraclough  <barraclough@apple.com>
542
543         Reviewed by Sam Weinig.
544
545         https://bugs.webkit.org/show_bug.cgi?id=55347
546         "name" and "message" enumerable on *Error.prototype
547
548         This arises from chapter 15 of the spec:
549             "Every other property described in this clause has the attributes
550             { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
551             unless otherwise specified."
552         Standardized properties are not enumerable.
553
554         * runtime/ErrorInstance.cpp:
555         (JSC::ErrorInstance::ErrorInstance):
556         * runtime/NativeErrorPrototype.cpp:
557         (JSC::NativeErrorPrototype::NativeErrorPrototype):
558
559 2011-06-09  Geoffrey Garen  <ggaren@apple.com>
560
561         Build fix: Corrected header spelling.
562
563         * heap/OldSpace.h:
564
565 2011-06-09  Geoffrey Garen  <ggaren@apple.com>
566
567         Reviewed by Oliver Hunt.
568
569         Added OldSpace to the project
570         https://bugs.webkit.org/show_bug.cgi?id=62417
571         
572         Currently unused.
573         
574         Added OldSpace, the ability to iterate NewSpace vs OldSpace, and a
575         per-block flag for testing whether you're in NewSpace vs OldSpace.
576
577         * CMakeLists.txt:
578         * GNUmakefile.list.am:
579         * JavaScriptCore.gypi:
580         * JavaScriptCore.pro:
581         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
582         * JavaScriptCore.xcodeproj/project.pbxproj: Build!
583
584         * heap/MarkedBlock.cpp:
585         (JSC::MarkedBlock::MarkedBlock):
586         * heap/MarkedBlock.h:
587         (JSC::MarkedBlock::inNewSpace):
588         (JSC::MarkedBlock::setInNewSpace): Added inNewSpace flag, for use in
589         write barrier.
590
591         * heap/NewSpace.cpp:
592         (JSC::NewSpace::addBlock):
593         (JSC::NewSpace::removeBlock):
594         * heap/NewSpace.h:
595         (JSC::NewSpace::forEachBlock): Added forEachBlock, to use for
596         NewSpace-specific operations.
597
598         * heap/OldSpace.cpp: Added.
599         (JSC::OldSpace::OldSpace):
600         (JSC::OldSpace::addBlock):
601         (JSC::OldSpace::removeBlock):
602         * heap/OldSpace.h: Added.
603         (JSC::OldSpace::forEachBlock): New class for holding promoted blocks.
604         Not in use yet.
605
606 2011-06-09  Hyowon Kim  <hw1008.kim@samsung.com>
607
608         Reviewed by Antonio Gomes.
609
610         [EFL] Make accelerated compositing build in Webkit-EFL
611         https://bugs.webkit.org/show_bug.cgi?id=62361
612
613         Add PLATFORM(EFL) to enable ACCELERATED_COMPOSITING on EFL port.
614
615         * wtf/Platform.h:
616
617 2011-06-09  Gavin Barraclough  <barraclough@apple.com>
618
619         Reviewed by Geoff Garen.
620
621         Bug 62405 - Fix integer overflow in Array.prototype.push
622
623         Fix geoff's review comments re static_cast.
624
625         * runtime/ArrayPrototype.cpp:
626         (JSC::arrayProtoFuncPush):
627
628 2011-06-09  Geoffrey Garen  <ggaren@apple.com>
629
630         Reviewed by Oliver Hunt.
631
632         Factored MarkedBlock set management into a helper class with a fast case Bloom filter
633         https://bugs.webkit.org/show_bug.cgi?id=62413
634         
635         SunSpider reports a small speedup.
636         
637         This is in preparation for having ConservativeSet operate on arbitrary
638         sets of MarkedBlocks, and in preparation for conservative scanning
639         becoming proportionally more important than other GC activities.
640
641         * GNUmakefile.list.am:
642         * JavaScriptCore.gypi:
643         * JavaScriptCore.xcodeproj/project.pbxproj: Build-o.
644
645         * heap/ConservativeRoots.cpp:
646         (JSC::ConservativeRoots::add):
647         * heap/ConservativeRoots.h:
648         (JSC::ConservativeRoots::ConservativeRoots): Operate on a MarkedBlockSet
649         directly, instead of a Heap, so we can operate on subsets of the Heap
650         instead.
651         
652         Use a TinyBloomFilter for single-cycle exclusion of most pointers. This
653         is particularly important since we expect not to find our subject pointer
654         in the MarkedBlock hash, and hash misses are more expensive than typical
655         hash lookups because they have high collision rates.
656         
657         No need for single-pointer add() to be public anymore, since nobody uses it.
658
659         * heap/Heap.cpp:
660         (JSC::Heap::markRoots):
661         * heap/Heap.h:
662         (JSC::Heap::forEachCell):
663         (JSC::Heap::forEachBlock): Use MarkedBlockSet since that's what
664         ConservativeRoots relies on.
665         
666         Nixed contains(), since nobody uses it anymore.
667
668         * heap/MarkedBlock.h:
669         (WTF::MarkedBlockHash::hash): Added a faster hash taking advantage of
670         the VM layout properties of MarkedBlocks.
671
672         * heap/MarkedBlockSet.h: Added.
673         (JSC::MarkedBlockSet::add):
674         (JSC::MarkedBlockSet::remove):
675         (JSC::MarkedBlockSet::recomputeFilter):
676         (JSC::MarkedBlockSet::filter):
677         (JSC::MarkedBlockSet::set):
678         * heap/TinyBloomFilter.h: Added.
679         (JSC::TinyBloomFilter::TinyBloomFilter):
680         (JSC::TinyBloomFilter::add):
681         (JSC::TinyBloomFilter::ruleOut): New helper class, used above.
682
683         * interpreter/RegisterFile.cpp:
684         (JSC::RegisterFile::gatherConservativeRoots): No need to specifically
685         exclude values by tag -- the tiny bloom filter is already a register-register
686         compare, so adding another "rule out" factor just slows things down.
687
688 2011-06-09  Gavin Barraclough  <barraclough@apple.com>
689
690         Reviewed by Oliver Hunt.
691
692         Bug 62405 - Fix integer overflow in Array.prototype.push
693
694         There are three integer overflows here, leading to safe (not a security risk)
695         but incorrect (non-spec-compliant) behaviour.
696
697         Two overflows occur when calculating the new length after pushing (one in the
698         fast version of push in JSArray, one in the generic version in ArrayPrototype).
699         The other occurs calculating indices to write to when multiple items are pushed.
700
701         These errors result in three test-262 failures.
702
703         * runtime/ArrayPrototype.cpp:
704         (JSC::arrayProtoFuncPush):
705         * runtime/JSArray.cpp:
706         (JSC::JSArray::put):
707         (JSC::JSArray::push):
708
709 2011-06-09  Dan Bernstein  <mitz@apple.com>
710
711         Reviewed by Anders Carlsson.
712
713         Add Vector::reverse()
714         https://bugs.webkit.org/show_bug.cgi?id=62393
715
716         * wtf/Vector.h:
717         (WTF::Vector::reverse): Added
718
719 2011-06-08  Geoffrey Garen  <ggaren@apple.com>
720
721         Reviewed by Oliver Hunt.
722
723         Factored a bunch of Heap functionality into stand-alone functors
724         https://bugs.webkit.org/show_bug.cgi?id=62337
725         
726         This is in preparation for making these functors operate on arbitrary
727         sets of MarkedBlocks.
728
729         * JavaScriptCore.exp: This file is a small tragedy.
730
731         * debugger/Debugger.cpp:
732         (JSC::Debugger::recompileAllJSFunctions): Updated for type change and rename.
733
734         * heap/HandleHeap.h:
735         (JSC::HandleHeap::forEachStrongHandle): New function for iterating all
736         strong handles, so we can play along in the functor game.
737
738         * heap/Heap.cpp:
739         (JSC::CountFunctor::CountFunctor::CountFunctor):
740         (JSC::CountFunctor::CountFunctor::count):
741         (JSC::CountFunctor::CountFunctor::returnValue):
742         (JSC::CountFunctor::ClearMarks::operator()):
743         (JSC::CountFunctor::ResetAllocator::operator()):
744         (JSC::CountFunctor::Sweep::operator()):
745         (JSC::CountFunctor::MarkCount::operator()):
746         (JSC::CountFunctor::Size::operator()):
747         (JSC::CountFunctor::Capacity::operator()):
748         (JSC::CountFunctor::Count::operator()):
749         (JSC::CountFunctor::CountIfGlobalObject::operator()):
750         (JSC::CountFunctor::TakeIfEmpty::TakeIfEmpty):
751         (JSC::CountFunctor::TakeIfEmpty::operator()):
752         (JSC::CountFunctor::TakeIfEmpty::returnValue):
753         (JSC::CountFunctor::RecordType::RecordType):
754         (JSC::CountFunctor::RecordType::typeName):
755         (JSC::CountFunctor::RecordType::operator()):
756         (JSC::CountFunctor::RecordType::returnValue): These functors factor out
757         behavior that used to be in the functions below.
758
759         (JSC::Heap::clearMarks):
760         (JSC::Heap::sweep):
761         (JSC::Heap::objectCount):
762         (JSC::Heap::size):
763         (JSC::Heap::capacity):
764         (JSC::Heap::protectedGlobalObjectCount):
765         (JSC::Heap::protectedObjectCount):
766         (JSC::Heap::protectedObjectTypeCounts):
767         (JSC::Heap::objectTypeCounts):
768         (JSC::Heap::resetAllocator):
769         (JSC::Heap::freeBlocks):
770         (JSC::Heap::shrink): Factored out behavior into the functors above.
771
772         * heap/Heap.h:
773         (JSC::Heap::forEachProtectedCell):
774         (JSC::Heap::forEachCell):
775         (JSC::Heap::forEachBlock): Added forEach* iteration templates. I chose
776         functor-based templates instead of plain iterators because they're simpler
777         to implement in this case and they require a lot less code at the call site.
778
779         * heap/MarkedBlock.h:
780         (JSC::MarkedBlock::VoidFunctor::returnValue): Default parent class for
781         trivial functors.
782
783         (JSC::MarkedBlock::forEachCell): Renamed forEach to forEachCell because
784         we have a few different kind of "for each" now.
785
786         * runtime/JSGlobalData.cpp:
787         (WTF::Recompile::operator()):
788         (JSC::JSGlobalData::JSGlobalData):
789         (JSC::JSGlobalData::recompileAllJSFunctions): Updated for type change and rename.
790
791         * runtime/JSGlobalData.h: Removed globalObjectCount because it was unused.
792
793 2011-06-08  Mikołaj Małecki  <m.malecki@samsung.com>
794
795         Reviewed by Pavel Feldman.
796
797         Web Inspector: Crash by buffer overrun crash when serializing inspector object tree.
798         https://bugs.webkit.org/show_bug.cgi?id=52791
799
800         No new tests. The problem can be reproduced by trying to create InspectorValue
801         from 1.0e-100 and call ->toJSONString() on this.
802
803         * JavaScriptCore.exp:
804         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
805         export 2 functions DecimalNumber::bufferLengthForStringExponential and
806         DecimalNumber::toStringExponential.
807
808 2011-06-08  Sheriff Bot  <webkit.review.bot@gmail.com>
809
810         Unreviewed, rolling out r88404.
811         http://trac.webkit.org/changeset/88404
812         https://bugs.webkit.org/show_bug.cgi?id=62342
813
814         broke win and mac build (Requested by tony^work on #webkit).
815
816         * JavaScriptCore.gyp/JavaScriptCore.gyp:
817
818 2011-06-08  Evan Martin  <evan@chromium.org>
819
820         Reviewed by Adam Barth.
821
822         [chromium] use gyp 'settings' type for settings target
823         https://bugs.webkit.org/show_bug.cgi?id=62323
824
825         The 'settings' gyp target type is for targets that exist solely
826         for their settings (no build rules).  The comment above this target
827         says it's for this, but it incorrectly uses 'none'.
828
829         * JavaScriptCore.gyp/JavaScriptCore.gyp:
830
831 2011-06-08  Sailesh Agrawal  <sail@chromium.org>
832
833         Reviewed by Mihai Parparita.
834
835         Chromium Mac: Enable overlay scrollbars
836         https://bugs.webkit.org/show_bug.cgi?id=59756
837
838         Enable WTF_USE_WK_SCROLLBAR_PAINTER for Chromium Mac. This allows us to use overlay scrollbars on future versions of Mac OS X.
839
840         * wtf/Platform.h:
841
842 2011-06-08  Oliver Hunt  <oliver@apple.com>
843
844         Reviewed by Geoffrey Garen.
845
846         Add faster lookup cache for multi character identifiers
847         https://bugs.webkit.org/show_bug.cgi?id=62327
848
849         Add a non-hash lookup for mutiple character identifiers.  This saves us from
850         adding repeated identifiers to the ParserArena's identifier list as people
851         tend to not start all their variables and properties with the same character
852         and happily identifier locality works in our favour.
853
854         * parser/ParserArena.h:
855         (JSC::IdentifierArena::isEmpty):
856         (JSC::IdentifierArena::clear):
857         (JSC::IdentifierArena::makeIdentifier):
858
859 2011-06-08  Geoffrey Garen  <ggaren@apple.com>
860
861         Reviewed by Oliver Hunt.
862
863         Took some responsibilities away from NewSpace
864         https://bugs.webkit.org/show_bug.cgi?id=62325
865         
866         NewSpace is basically just an allocator now.
867         
868         Heap acts as a controller, responsible for managing the set of all
869         MarkedBlocks.
870         
871         This is in preparation for moving parts of the controller logic into
872         separate helper classes that can act on arbitrary sets of MarkedBlocks
873         that may or may not be in NewSpace.
874
875         * heap/Heap.cpp:
876         (JSC::Heap::Heap):
877         (JSC::Heap::destroy):
878         (JSC::Heap::allocate):
879         (JSC::Heap::markRoots):
880         (JSC::Heap::clearMarks):
881         (JSC::Heap::sweep):
882         (JSC::Heap::objectCount):
883         (JSC::Heap::size):
884         (JSC::Heap::capacity):
885         (JSC::Heap::collect):
886         (JSC::Heap::resetAllocator):
887         (JSC::Heap::allocateBlock):
888         (JSC::Heap::freeBlocks):
889         (JSC::Heap::shrink): Moved the set of MarkedBlocks from NewSpace to Heap,
890         along with all functions that operate on the set of MarkedBlocks. Also
891         moved responsibility for deciding whether to allocate a new MarkedBlock,
892         and for allocating it.
893
894         * heap/Heap.h:
895         (JSC::Heap::contains):
896         (JSC::Heap::forEach): Ditto.
897
898         * heap/NewSpace.cpp:
899         (JSC::NewSpace::addBlock):
900         (JSC::NewSpace::removeBlock):
901         (JSC::NewSpace::resetAllocator):
902         * heap/NewSpace.h:
903         (JSC::NewSpace::waterMark):
904         (JSC::NewSpace::allocate): Ditto.
905
906 2011-06-08  Geoffrey Garen  <ggaren@apple.com>
907
908         Reviewed by Oliver Hunt.
909
910         Some more MarkedSpace => NewSpace renaming
911         https://bugs.webkit.org/show_bug.cgi?id=62305
912
913         * JavaScriptCore.exp:
914         * JavaScriptCore.order:
915         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
916         * heap/Heap.cpp:
917         (JSC::Heap::Heap):
918         (JSC::Heap::destroy):
919         (JSC::Heap::reportExtraMemoryCostSlowCase):
920         (JSC::Heap::allocate):
921         (JSC::Heap::markRoots):
922         (JSC::Heap::objectCount):
923         (JSC::Heap::size):
924         (JSC::Heap::capacity):
925         (JSC::Heap::collect):
926         (JSC::Heap::isValidAllocation):
927         * heap/Heap.h:
928         (JSC::Heap::markedSpace):
929         (JSC::Heap::contains):
930         (JSC::Heap::forEach):
931         (JSC::Heap::allocate):
932         * runtime/JSCell.h:
933
934 2011-06-08  Kevin Ollivier  <kevino@theolliviers.com>
935
936         Reviewed by Eric Seidel.
937
938         Add export macros to profiler headers.
939         https://bugs.webkit.org/show_bug.cgi?id=27551
940
941         * profiler/Profiler.h:
942
943 2011-06-08  Kevin Ollivier  <kevino@theolliviers.com>
944
945         Reviewed by Eric Seidel.
946
947         Add export symbols to parser headers.
948         https://bugs.webkit.org/show_bug.cgi?id=27551
949
950         * parser/SourceProviderCache.h:
951
952 2011-06-08  Kevin Ollivier  <kevino@theolliviers.com>
953
954         Reviewed by Eric Seidel.
955
956         Add export symbols to interpreter headers.
957         https://bugs.webkit.org/show_bug.cgi?id=27551
958
959         * interpreter/Interpreter.h:
960
961 2011-06-08  Kevin Ollivier  <kevino@theolliviers.com>
962
963         Reviewed by Eric Seidel.
964
965         Add export symbols to debugger headers.
966         https://bugs.webkit.org/show_bug.cgi?id=27551
967
968         * debugger/Debugger.h:
969         * debugger/DebuggerCallFrame.h:
970
971 2011-06-08  Geoffrey Garen  <ggaren@apple.com>
972
973         Reviewed by Darin Adler.
974
975         Moved MarkedSpace.* to NewSpace.* in preparation for more renaming
976         https://bugs.webkit.org/show_bug.cgi?id=62268
977
978         * CMakeLists.txt:
979         * GNUmakefile.list.am:
980         * JavaScriptCore.gypi:
981         * JavaScriptCore.pro:
982         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
983         * JavaScriptCore.xcodeproj/project.pbxproj:
984         * heap/Heap.h:
985         * heap/MarkedBlock.h:
986         * heap/MarkedSpace.cpp: Removed.
987         * heap/MarkedSpace.h: Removed.
988         * heap/NewSpace.cpp: Copied from Source/JavaScriptCore/heap/MarkedSpace.cpp.
989         * heap/NewSpace.h: Copied from Source/JavaScriptCore/heap/MarkedSpace.h.
990
991 2011-06-08  Sheriff Bot  <webkit.review.bot@gmail.com>
992
993         Unreviewed, rolling out r88365.
994         http://trac.webkit.org/changeset/88365
995         https://bugs.webkit.org/show_bug.cgi?id=62301
996
997         windows bots broken (Requested by loislo_ on #webkit).
998
999         * JavaScriptCore.exp:
1000
1001 2011-06-08  Ryan Sleevi  <rsleevi@chromium.org>
1002
1003         Reviewed by Tony Chang.
1004
1005         Suppress C++0x compat warnings when compiling Chromium port with GCC 4.6
1006
1007         Compiling Chromium port under GCC 4.6 produces warnings about nullptr
1008         https://bugs.webkit.org/show_bug.cgi?id=62242
1009
1010         * JavaScriptCore.gyp/JavaScriptCore.gyp:
1011
1012 2011-06-08  Ademar de Souza Reis Jr.  <ademar.reis@openbossa.org>
1013
1014         Reviewed by Andreas Kling.
1015
1016         Webkit on SPARC Solaris has wrong endian
1017         https://bugs.webkit.org/show_bug.cgi?id=29407
1018
1019         Bug 57256 fixed one crash on misaligned reads on sparc/solaris, but
1020         there are more ocurrences of the same code pattern in webkit.
1021
1022         This patch includes the check on these other parts of the code.
1023
1024         This is a speculative fix, I don't have a sparc machine to test and
1025         don't know which kind of test would trigger a crash (but it's quite
1026         obvious that it's the same code duplicated in different files).
1027
1028         * runtime/UString.h:
1029         (JSC::UStringHash::equal):
1030         * wtf/text/StringHash.h:
1031         (WTF::StringHash::equal):
1032
1033 2011-06-08  Yael Aharon  <yael.aharon@nokia.com>
1034
1035         Reviewed by Andreas Kling.
1036
1037         [Qt] Build fix for building QtWebKit inside of Qt.
1038         https://bugs.webkit.org/show_bug.cgi?id=62280
1039
1040         Remove CONFIG=staticlib, because it causes the configure script to add -ljavascriptcore
1041         into QtWebKit.prl.
1042
1043         No new tests, as this is just a build fix.
1044
1045         * JavaScriptCore.pri:
1046
1047 2011-06-07  Geoffrey Garen  <ggaren@apple.com>
1048
1049         Reviewed by Oliver Hunt.
1050
1051         Split 'reset' into 'collect' and 'resetAllocator'
1052         https://bugs.webkit.org/show_bug.cgi?id=62267
1053
1054         * heap/Heap.cpp:
1055         (JSC::Heap::allocate):
1056         (JSC::Heap::collectAllGarbage):
1057         (JSC::Heap::collect):
1058         * heap/Heap.h:
1059         * heap/MarkedBlock.h:
1060         (JSC::MarkedBlock::resetAllocator):
1061         * heap/MarkedSpace.cpp:
1062         (JSC::MarkedSpace::resetAllocator):
1063         * heap/MarkedSpace.h:
1064         (JSC::MarkedSpace::SizeClass::resetAllocator):
1065
1066 2011-06-07  Geoffrey Garen  <ggaren@apple.com>
1067
1068         Reviewed by Sam Weinig.
1069
1070         Renamed some more marks to visits
1071         https://bugs.webkit.org/show_bug.cgi?id=62254
1072
1073         * heap/HandleHeap.cpp:
1074         (JSC::HandleHeap::visitStrongHandles):
1075         (JSC::HandleHeap::visitWeakHandles):
1076         * heap/HandleHeap.h:
1077         * heap/HandleStack.cpp:
1078         (JSC::HandleStack::visit):
1079         * heap/HandleStack.h:
1080         * heap/Heap.cpp:
1081         (JSC::Heap::markProtectedObjects):
1082         (JSC::Heap::markTempSortVectors):
1083         (JSC::Heap::markRoots):
1084         * heap/HeapRootVisitor.h:
1085         (JSC::HeapRootVisitor::visit):
1086         * runtime/ArgList.cpp:
1087         (JSC::MarkedArgumentBuffer::markLists):
1088
1089 2011-06-07  Gavin Barraclough  <barraclough@apple.com>
1090
1091         Reviewed by Sam Weinig
1092
1093         https://bugs.webkit.org/show_bug.cgi?id=55537
1094         Functions claim to have 'callee' which they actually don't (and shouldn't)
1095
1096         * JavaScriptCore.xcodeproj/project.pbxproj:
1097         * runtime/JSFunction.cpp:
1098         (JSC::JSFunction::getOwnPropertyNames):
1099
1100 2011-06-07  Juan C. Montemayor  <jmont@apple.com>
1101
1102         Reviewed by Darin Adler.
1103
1104         Make JSStaticFunction and JSStaticValue less "const"
1105         https://bugs.webkit.org/show_bug.cgi?id=62222
1106
1107         * API/JSObjectRef.h:
1108         * API/tests/testapi.c:
1109         (checkConstnessInJSObjectNames):
1110         (main):
1111         * JavaScriptCore.xcodeproj/project.pbxproj:
1112
1113 2011-06-07  Gavin Barraclough  <barraclough@apple.com>
1114
1115         Reviewed by Sam Weinig.
1116
1117         https://bugs.webkit.org/show_bug.cgi?id=62240
1118         DFG JIT - add support for for-loop array initialization.
1119
1120         Support put by val beyond vector length.
1121         Add a operationPutByValBeyondArrayBounds operation, make
1122         PutValVal call this if the vector length check fails.
1123
1124         * dfg/DFGJITCodeGenerator.h:
1125         (JSC::DFG::JITCodeGenerator::silentSpillGPR):
1126         (JSC::DFG::JITCodeGenerator::silentFillGPR):
1127         (JSC::DFG::JITCodeGenerator::silentSpillAllRegisters):
1128         (JSC::DFG::JITCodeGenerator::isDoubleConstantWithInt32Value):
1129         (JSC::DFG::JITCodeGenerator::isJSConstantWithInt32Value):
1130         (JSC::DFG::JITCodeGenerator::isIntegerConstant):
1131         (JSC::DFG::JITCodeGenerator::valueOfIntegerConstant):
1132         * dfg/DFGOperations.cpp:
1133         (JSC::DFG::operationPutByValInternal):
1134         * dfg/DFGOperations.h:
1135         * dfg/DFGSpeculativeJIT.cpp:
1136         (JSC::DFG::SpeculativeJIT::compile):
1137         * dfg/DFGSpeculativeJIT.h:
1138
1139 2011-06-06  James Simonsen  <simonjam@chromium.org>
1140
1141         Reviewed by James Robinson.
1142
1143         Add monotonicallyIncreasingTime() to get monotonically increasing time
1144         https://bugs.webkit.org/show_bug.cgi?id=37743
1145
1146         * wtf/CurrentTime.cpp: Add monotonicallyIncreasingTime() for mac and a fallback implementation that just wraps currentTime().
1147         (WTF::monotonicallyIncreasingTime):
1148         * wtf/CurrentTime.h: Add monotonicallyIncreasingTime().
1149
1150 2011-06-06  Alexandru Chiculita  <achicu@adobe.com>
1151
1152         Reviewed by Kent Tamura.
1153
1154         Add ENABLE_CSS_EXCLUSIONS support for build-webkit script
1155         https://bugs.webkit.org/show_bug.cgi?id=61628
1156
1157         * Configurations/FeatureDefines.xcconfig:
1158
1159 2011-06-06  Mihnea Ovidenie  <mihnea@adobe.com>
1160
1161         Reviewed by Kent Tamura.
1162
1163         Add ENABLE(CSS_REGIONS) guard for CSS Regions support
1164         https://bugs.webkit.org/show_bug.cgi?id=61631
1165
1166         * Configurations/FeatureDefines.xcconfig:
1167
1168 2011-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1169
1170         Unreviewed. Fix the GTK+ build.
1171
1172         * GNUmakefile.am: Add javascriptcore_cflags variable.
1173
1174 2011-06-04  Kevin Ollivier  <kevino@theolliviers.com>
1175
1176         [wx] Unreviewed build fix. Restore the PPC build and allow users to specify architectures
1177         to build on Mac.
1178
1179         * wtf/Platform.h:
1180
1181 2011-06-04  Gustavo Noronha Silva  <gns@gnome.org>
1182
1183         Unreviewed, MIPS build fix.
1184
1185         WebKitGTK+ tarball fails to build on MIPS.
1186         https://buildd.debian.org/status/fetch.php?pkg=webkitgtk%2B&arch=mips&ver=1.4.0-1&stamp=1304786691
1187
1188         * GNUmakefile.list.am: Add missing MIPS-related file to the list
1189         of files that are added to the tarball on make dist, and fix
1190         sorting.
1191
1192 2011-06-04  Sam Weinig  <sam@webkit.org>
1193
1194         Reviewed by Darin Adler.
1195
1196         Fix formatting of the output generated by KeywordLookupGenerator.py
1197         https://bugs.webkit.org/show_bug.cgi?id=62083
1198
1199         - Uses correct year for copyright.
1200         - Puts ending brace on same line as "else if"
1201         - Puts starting brace of function on its own line.
1202         - Adds some tasteful whitespace.
1203         - Adds comments to make clear that scopes are ending
1204         - Make macros actually split on two lines.
1205
1206         * KeywordLookupGenerator.py:
1207
1208 2011-06-04  Adam Barth  <abarth@webkit.org>
1209
1210         Reviewed by Eric Seidel.
1211
1212         KeywordLookupGenerator.py spams stdout in Chromium Linux build
1213         https://bugs.webkit.org/show_bug.cgi?id=62087
1214
1215         This action does not appear to be needed.
1216
1217         * JavaScriptCore.gyp/JavaScriptCore.gyp:
1218
1219 2011-06-03  Oliver Hunt  <oliver@apple.com>
1220
1221         Reviewed by Maciej Stachowiak.
1222
1223         Lexer needs to provide Identifier for reserved words
1224         https://bugs.webkit.org/show_bug.cgi?id=62086
1225
1226         Alas it is necessary to provide an Identifier reference for keywords
1227         so that we can do the right thing when they're used in object literals.
1228         We now keep Identifiers for all reserved words in the CommonIdentifiers
1229         structure so that we can access them without a hash lookup.
1230
1231         * KeywordLookupGenerator.py:
1232         * parser/Lexer.cpp:
1233         (JSC::Lexer::parseIdentifier):
1234         * parser/Lexer.h:
1235         * runtime/CommonIdentifiers.cpp:
1236         (JSC::CommonIdentifiers::CommonIdentifiers):
1237         * runtime/CommonIdentifiers.h:
1238
1239 2011-06-03  Gavin Barraclough  <barraclough@apple.com>
1240
1241         Reviewed by Sam Weinig.
1242
1243         Add debug code to break on speculation failures.
1244
1245         * dfg/DFGJITCompiler.cpp:
1246         (JSC::DFG::JITCompiler::jumpFromSpeculativeToNonSpeculative):
1247         (JSC::DFG::JITCompiler::compileFunction):
1248         * dfg/DFGNode.h:
1249
1250 2011-06-03  Gavin Barraclough  <barraclough@apple.com>
1251
1252         Reviewed by Sam Weinig.
1253
1254         https://bugs.webkit.org/show_bug.cgi?id=62082
1255         DFG JIT - bug passing arguments that need swap
1256
1257         This is really just a typo.
1258         When setting up the arguments for a call out to a C operation, we'll
1259         fail to swap arguments where this is necessary. For example, in the
1260         case of 2 arg calls, where the first argument is in %rdx & the second
1261         is in %rsi we should swap (exec will be passed in %rdi), but we don't.
1262
1263         This can also affect function calls passing three arguments.
1264
1265         * dfg/DFGJITCodeGenerator.h:
1266         (JSC::DFG::JITCodeGenerator::setupTwoStubArgs):
1267             - Call swap with the correct arguments.
1268
1269 2011-06-03  Oliver Hunt  <oliver@apple.com>
1270
1271         Reviewed by Gavin Barraclough.
1272
1273         Force inlining of some hot lexer functions
1274         https://bugs.webkit.org/show_bug.cgi?id=62079
1275
1276         Fix more GCC stupidity
1277
1278         * parser/Lexer.h:
1279         (JSC::Lexer::isWhiteSpace):
1280         (JSC::Lexer::isLineTerminator):
1281
1282 2011-06-03  Oliver Hunt  <oliver@apple.com>
1283
1284         Reviewed by Gavin Barraclough.
1285
1286         GCC not inlining some functions that it really should be
1287         https://bugs.webkit.org/show_bug.cgi?id=62075
1288
1289         Add ALWAYS_INLINE to a number of parsing and lexing functions
1290         that should always be inlined.  This gets us ~1.4% on my ad hoc
1291         parser test.
1292
1293         * KeywordLookupGenerator.py:
1294         * parser/JSParser.cpp:
1295         (JSC::JSParser::next):
1296         (JSC::JSParser::nextTokenIsColon):
1297         (JSC::JSParser::consume):
1298         (JSC::JSParser::match):
1299         (JSC::JSParser::tokenStart):
1300         (JSC::JSParser::tokenLine):
1301         (JSC::JSParser::tokenEnd):
1302         * parser/Lexer.cpp:
1303         (JSC::isIdentPart):
1304
1305 2011-06-03  Oliver Hunt  <oliver@apple.com>
1306
1307         Whoops, fix last minute bug.
1308
1309         * parser/Lexer.cpp:
1310         (JSC::Lexer::parseIdentifier):
1311
1312 2011-06-03  Martin Robinson  <mrobinson@igalia.com>
1313
1314         Try to fix the GTK+ build.
1315
1316         * GNUmakefile.am: Clean up some spaces that should be tabs.
1317         * GNUmakefile.list.am: Add KeywordLookup.h to the source list
1318         and clean up some spaces that should be tabs.
1319
1320 2011-06-03  Oliver Hunt  <oliver@apple.com>
1321
1322         Reviewed by Geoffrey Garen.
1323
1324         Improve keyword lookup
1325         https://bugs.webkit.org/show_bug.cgi?id=61913
1326
1327         Rather than doing multiple hash lookups as we currently
1328         do when trying to identify keywords we now use an 
1329         automatically generated decision tree (essentially it's
1330         a hard coded patricia trie).  We still use the regular
1331         lookup table for the last few characters of an input as
1332         this allows us to completely skip all bounds checks.
1333
1334         * CMakeLists.txt:
1335         * DerivedSources.make:
1336         * DerivedSources.pro:
1337         * GNUmakefile.am:
1338         * JavaScriptCore.gyp/JavaScriptCore.gyp:
1339         * JavaScriptCore.xcodeproj/project.pbxproj:
1340         * KeywordLookupGenerator.py: Added.
1341         * make-generated-sources.sh:
1342         * parser/Lexer.cpp:
1343         (JSC::Lexer::internalShift):
1344         (JSC::Lexer::shift):
1345         (JSC::Lexer::parseIdentifier):
1346         * parser/Lexer.h:
1347
1348 2011-06-03  Siddharth Mathur  <siddharth.mathur@nokia.com>
1349
1350         Reviewed by Benjamin Poulain.
1351
1352         [Qt] Build flag for experimental ICU library support
1353         https://bugs.webkit.org/show_bug.cgi?id=60786
1354
1355         Adds a build-time flag (CONFIG+=use_system_icu) that enables experimental 
1356         ICU powered Unicode support. 
1357
1358         * JavaScriptCore.pri: Support for use_system_icu CONFIG flag.
1359         * wtf/unicode/qt4/UnicodeQt4.h: Guard an include file with USE(ICU_UNICODE). 
1360
1361 2011-06-03  Alexis Menard  <alexis.menard@openbossa.org>
1362
1363         Reviewed by Benjamin Poulain.
1364
1365         [Qt] Build fix of QtWebKit 2.2 when inside Qt tree with GCC 4.6.
1366         https://bugs.webkit.org/show_bug.cgi?id=61957
1367
1368         When building inside the Qt source tree, qmake always append the mkspecs
1369         defines after ours. We have to workaround and make sure that we append 
1370         our flags after the qmake variable used inside Qt. This workaround was provided 
1371         by our qmake folks. We need to append in both case because qmake behave differently
1372         when called with -spec or via SUBDIR+=. This patch unbreak r87950 on Mac for Qt port.
1373
1374         * JavaScriptCore.pro:
1375
1376 2011-06-02  Jay Civelli  <jcivelli@chromium.org>
1377
1378         Reviewed by Adam Barth.
1379
1380         Added a method to generate RFC 2822 compliant date strings.
1381         https://bugs.webkit.org/show_bug.cgi?id=7169
1382
1383         * wtf/DateMath.cpp:
1384         (WTF::twoDigitStringFromNumber):
1385         (WTF::makeRFC2822DateString):
1386         * wtf/DateMath.h:
1387
1388 2011-06-02  Alexis Menard  <alexis.menard@openbossa.org>
1389
1390         Reviewed by Andreas Kling.
1391
1392         [Qt] Build fix of QtWebKit 2.2 when inside Qt tree with GCC 4.6.
1393         https://bugs.webkit.org/show_bug.cgi?id=61957
1394
1395         When building inside the Qt source tree, qmake always append the mkspecs
1396         defines after ours. We have to workaround and make sure that we append  
1397         our flags after the qmake variable used inside Qt. This workaround was provided
1398         by our qmake folks.
1399
1400         * JavaScriptCore.pro:
1401
1402 2011-06-01  Oliver Hunt  <oliver@apple.com>
1403
1404         Reviewed by Geoffrey Garen.
1405
1406         Add single character lookup cache to IdentifierArena
1407         https://bugs.webkit.org/show_bug.cgi?id=61879
1408
1409         Add a simple lookup cache for single ascii character
1410         identifiers.  Produces around a 2% improvement in parse
1411         time for my adhoc parser test.
1412
1413         * parser/ParserArena.h:
1414         (JSC::IdentifierArena::IdentifierArena):
1415         (JSC::IdentifierArena::clear):
1416         (JSC::IdentifierArena::makeIdentifier):
1417
1418 2011-05-31  Oliver Hunt  <oliver@apple.com>
1419
1420         Reviewed by Geoffrey Garen.
1421
1422         Freezing a function and its prototype causes browser to crash.
1423         https://bugs.webkit.org/show_bug.cgi?id=61758
1424
1425         Make JSObject::preventExtensions virtual so that we can override it
1426         and instantiate all lazy
1427
1428         * JavaScriptCore.exp:
1429         * runtime/JSFunction.cpp:
1430         (JSC::createPrototypeProperty):
1431         (JSC::JSFunction::preventExtensions):
1432         (JSC::JSFunction::getOwnPropertySlot):
1433         * runtime/JSFunction.h:
1434         * runtime/JSObject.h:
1435         * runtime/JSObject.cpp:
1436         (JSC::JSObject::seal):
1437         (JSC::JSObject::seal):
1438
1439 2011-06-01  Sheriff Bot  <webkit.review.bot@gmail.com>
1440
1441         Unreviewed, rolling out r87788.
1442         http://trac.webkit.org/changeset/87788
1443         https://bugs.webkit.org/show_bug.cgi?id=61856
1444
1445         breaks windows chromium canary (Requested by jknotten on
1446         #webkit).
1447
1448         * wtf/DateMath.cpp:
1449         (WTF::timeClip):
1450         * wtf/DateMath.h:
1451
1452 2011-06-01  Jay Civelli  <jcivelli@chromium.org>
1453
1454         Reviewed by Adam Barth.
1455
1456         Added a method to generate RFC 2822 compliant date strings.
1457         https://bugs.webkit.org/show_bug.cgi?id=7169
1458
1459         * wtf/DateMath.cpp:
1460         (WTF::twoDigitStringFromNumber):
1461         (WTF::makeRFC2822DateString):
1462         * wtf/DateMath.h:
1463
1464 2011-05-31  Yong Li  <yoli@rim.com>
1465
1466         Reviewed by Eric Seidel.
1467
1468         https://bugs.webkit.org/show_bug.cgi?id=54807
1469         We have been assuming plain bitfields (like "int a : 31") are always signed integers.
1470         However some compilers can treat them as unsigned. For example, RVCT 4.0 states plain
1471         bitfields (declared without either signed or unsigned qualifiers) are treats as unsigned.
1472         http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0348c/Babjddhe.html
1473         Although we can use "--signed-bitfields" flag to make RVCT 4.0 behave as most other compilers,
1474         always using "signed"/"unsigned" qualifier to declare integral type bitfields is still a good
1475         rule we should have in order to make our code independent from compilers and compiler flags.
1476
1477         No new test added because this change is not known to fix any issue.
1478
1479         * bytecode/StructureStubInfo.h:
1480
1481 2011-05-30  Hojong Han  <hojong.han@samsung.com>
1482
1483         Reviewed by Geoffrey Garen.
1484
1485         [JSC] malfunction during arithmetic condition check with negative number (-2147483648)
1486         https://bugs.webkit.org/show_bug.cgi?id=61416
1487
1488         * assembler/MacroAssemblerARM.h:
1489         (JSC::MacroAssemblerARM::branch32):
1490         * tests/mozilla/ecma/Expressions/11.12-1.js:
1491         (getTestCases):
1492
1493 2011-05-29  Geoffrey Garen  <ggaren@apple.com>
1494
1495         Reviewed by Sam Weinig.
1496
1497         Some heap refactoring
1498         https://bugs.webkit.org/show_bug.cgi?id=61704
1499         
1500         SunSpider says no change.
1501
1502         * JavaScriptCore.exp: Export!
1503
1504         * heap/Heap.cpp: COLLECT_ON_EVERY_ALLOCATION can actually do so now.
1505
1506         (JSC::Heap::Heap): Changed Heap sub-objects to point to the heap.
1507
1508         (JSC::Heap::allocate): Changed inline allocation code to only select the
1509         size class, since this can be optimized out at compile time -- everything
1510         else is now inlined into this out-of-line function.
1511         
1512         No need to duplicate ASSERTs made in our caller.
1513
1514         * heap/Heap.h:
1515         (JSC::Heap::heap):
1516         (JSC::Heap::isMarked):
1517         (JSC::Heap::testAndSetMarked):
1518         (JSC::Heap::testAndClearMarked):
1519         (JSC::Heap::setMarked): Call directly into MarkedBlock instead of adding
1520         a layer of indirection through MarkedSpace.
1521
1522         (JSC::Heap::allocate): See above.
1523
1524         * heap/MarkedBlock.cpp:
1525         (JSC::MarkedBlock::create):
1526         (JSC::MarkedBlock::MarkedBlock):
1527         * heap/MarkedBlock.h: Changed Heap sub-objects to point to the heap.
1528
1529         * heap/MarkedSpace.cpp:
1530         (JSC::MarkedSpace::MarkedSpace):
1531         (JSC::MarkedSpace::allocateBlock):
1532         * heap/MarkedSpace.h:
1533         (JSC::MarkedSpace::allocate): Updated to match changes above.
1534
1535 2011-05-28  David Kilzer  <ddkilzer@apple.com>
1536
1537         BUILD FIX when building only the interpreter
1538
1539         Fixes the following compiler warning:
1540
1541             JavaScriptCore/runtime/JSGlobalData.cpp:462:6: error: no previous prototype for function 'releaseExecutableMemory' [-Werror,-Wmissing-prototypes,3]
1542              void releaseExecutableMemory(JSGlobalData& globalData)
1543                   ^
1544
1545         * jit/ExecutableAllocator.h: Moved declaration of
1546         JSC::releaseExecutableMemory().
1547
1548 2011-05-28  David Kilzer  <ddkilzer@apple.com>
1549
1550         BUILD FIX after r87527 with ENABLE(BRANCH_COMPACTION)
1551
1552         * assembler/LinkBuffer.h:
1553         (JSC::LinkBuffer::linkCode): Added missing argument.
1554
1555 2011-05-27  Geoffrey Garen  <ggaren@apple.com>
1556
1557         Reviewed by Oliver Hunt.
1558
1559         JS API is too aggressive about throwing exceptions for NULL get or set operations
1560         https://bugs.webkit.org/show_bug.cgi?id=61678
1561
1562         * API/JSCallbackObject.h: Changed our staticValueGetter to a regular
1563         function that returns a JSValue, so it can fail and still forward to
1564         normal property lookup.
1565
1566         * API/JSCallbackObjectFunctions.h:
1567         (JSC::::getOwnPropertySlot): Don't throw an exception when failing to
1568         access a static property -- just forward the access. This allows objects
1569         to observe get/set operations but still let the JS object manage lifetime.
1570
1571         (JSC::::put): Ditto.
1572
1573         (JSC::::getStaticValue): Same as JSCallbackObject.h.
1574
1575         * API/tests/testapi.c:
1576         (MyObject_set_nullGetForwardSet):
1577         * API/tests/testapi.js: Updated tests to reflect slightly less strict
1578         behavior, which matches headerdoc claims.
1579
1580 2011-05-27  Geoffrey Garen  <ggaren@apple.com>
1581
1582         Reviewed by Oliver Hunt.
1583
1584         Property caching is too aggressive for API objects
1585         https://bugs.webkit.org/show_bug.cgi?id=61677
1586
1587         * API/JSCallbackObject.h: Opt in to ProhibitsPropertyCaching, since our
1588         callback APIs allow the client to change its mind about our propertis at
1589         any time.
1590
1591         * API/tests/testapi.c:
1592         (PropertyCatchalls_getProperty):
1593         (PropertyCatchalls_setProperty):
1594         (PropertyCatchalls_getPropertyNames):
1595         (PropertyCatchalls_class):
1596         (main):
1597         * API/tests/testapi.js: Some tests for dynamic API objects.
1598
1599         * interpreter/Interpreter.cpp:
1600         (JSC::Interpreter::tryCachePutByID):
1601         (JSC::Interpreter::tryCacheGetByID):
1602         * jit/JITStubs.cpp:
1603         (JSC::JITThunks::tryCachePutByID):
1604         (JSC::JITThunks::tryCacheGetByID):
1605         (JSC::DEFINE_STUB_FUNCTION): Opt out of property caching if the client
1606         requires it.
1607
1608         * runtime/JSTypeInfo.h:
1609         (JSC::TypeInfo::TypeInfo):
1610         (JSC::TypeInfo::isFinal):
1611         (JSC::TypeInfo::prohibitsPropertyCaching):
1612         (JSC::TypeInfo::flags): Added a flag to track opting out of property
1613         caching. Fixed an "&&" vs "&" typo that was previously harmless, but
1614         is now harmful since m_flags2 can have more than one bit set.
1615
1616 2011-05-27  Stephanie Lewis  <slewis@apple.com>
1617
1618         Unreviewed.
1619
1620         Fix a typo in the order_file flag.
1621
1622         * Configurations/Base.xcconfig:
1623
1624 2011-05-27  Patrick Gansterer  <paroga@webkit.org>
1625
1626         Unreviewed. Build fix for !ENABLE(ASSEMBLER) after r87527.
1627
1628         * runtime/JSGlobalData.cpp:
1629         (JSGlobalData::JSGlobalData):
1630
1631 2011-05-27  Oliver Hunt  <oliver@apple.com>
1632
1633         Reviewed by Geoffrey Garen.
1634
1635         Add a few validity assertions to JSCallbackObject
1636         https://bugs.webkit.org/show_bug.cgi?id=61659
1637
1638         * API/JSCallbackObject.h:
1639         (JSC::JSCallbackObject::visitChildren):
1640
1641 2011-05-27  Oliver Hunt  <oliver@apple.com>
1642
1643         Build fix
1644
1645         * runtime/RegExpCache.cpp:
1646         (JSC::RegExpCache::invalidateCode):
1647
1648 2011-05-27  Oliver Hunt  <oliver@apple.com>
1649
1650         Reviewed by Geoffrey Garen.
1651
1652         Try to release unused executable memory when the FixedVMPool allocator is under pressure
1653         https://bugs.webkit.org/show_bug.cgi?id=61651
1654
1655         Rather than crashing when full the FixedVMPool allocator now returns a null
1656         allocation.  We replace the code that used to CRASH() on null allocations
1657         with logic that asks the provided globalData to release any executable memory
1658         that it can.  Currently this just means throwing away all regexp code, but
1659         in future we'll try to be more aggressive.
1660
1661         * assembler/ARMAssembler.cpp:
1662         (JSC::ARMAssembler::executableCopy):
1663         * assembler/ARMAssembler.h:
1664         * assembler/AssemblerBuffer.h:
1665         (JSC::AssemblerBuffer::executableCopy):
1666         * assembler/AssemblerBufferWithConstantPool.h:
1667         * assembler/LinkBuffer.h:
1668         (JSC::LinkBuffer::LinkBuffer):
1669         (JSC::LinkBuffer::linkCode):
1670         * assembler/MIPSAssembler.h:
1671         (JSC::MIPSAssembler::executableCopy):
1672         * assembler/SH4Assembler.h:
1673         (JSC::SH4Assembler::executableCopy):
1674         * assembler/X86Assembler.h:
1675         (JSC::X86Assembler::executableCopy):
1676         (JSC::X86Assembler::X86InstructionFormatter::executableCopy):
1677         * dfg/DFGJITCompiler.cpp:
1678         (JSC::DFG::JITCompiler::compileFunction):
1679         * jit/ExecutableAllocator.h:
1680         (JSC::ExecutablePool::create):
1681         (JSC::ExecutablePool::alloc):
1682         (JSC::ExecutableAllocator::ExecutableAllocator):
1683         (JSC::ExecutableAllocator::poolForSize):
1684         (JSC::ExecutablePool::ExecutablePool):
1685         (JSC::ExecutablePool::poolAllocate):
1686         * jit/ExecutableAllocatorFixedVMPool.cpp:
1687         (JSC::FixedVMPoolAllocator::alloc):
1688         * jit/JIT.cpp:
1689         (JSC::JIT::privateCompile):
1690         * jit/JITOpcodes.cpp:
1691         (JSC::JIT::privateCompileCTIMachineTrampolines):
1692         * jit/JITOpcodes32_64.cpp:
1693         (JSC::JIT::privateCompileCTIMachineTrampolines):
1694         (JSC::JIT::privateCompileCTINativeCall):
1695         * jit/JITPropertyAccess.cpp:
1696         (JSC::JIT::stringGetByValStubGenerator):
1697         (JSC::JIT::privateCompilePutByIdTransition):
1698         (JSC::JIT::privateCompilePatchGetArrayLength):
1699         (JSC::JIT::privateCompileGetByIdProto):
1700         (JSC::JIT::privateCompileGetByIdSelfList):
1701         (JSC::JIT::privateCompileGetByIdProtoList):
1702         (JSC::JIT::privateCompileGetByIdChainList):
1703         (JSC::JIT::privateCompileGetByIdChain):
1704         * jit/JITPropertyAccess32_64.cpp:
1705         (JSC::JIT::stringGetByValStubGenerator):
1706         (JSC::JIT::privateCompilePutByIdTransition):
1707         (JSC::JIT::privateCompilePatchGetArrayLength):
1708         (JSC::JIT::privateCompileGetByIdProto):
1709         (JSC::JIT::privateCompileGetByIdSelfList):
1710         (JSC::JIT::privateCompileGetByIdProtoList):
1711         (JSC::JIT::privateCompileGetByIdChainList):
1712         (JSC::JIT::privateCompileGetByIdChain):
1713         * jit/SpecializedThunkJIT.h:
1714         (JSC::SpecializedThunkJIT::finalize):
1715         * jit/ThunkGenerators.cpp:
1716         (JSC::charCodeAtThunkGenerator):
1717         (JSC::charAtThunkGenerator):
1718         (JSC::fromCharCodeThunkGenerator):
1719         (JSC::sqrtThunkGenerator):
1720         (JSC::powThunkGenerator):
1721         * runtime/JSGlobalData.cpp:
1722         (JSC::JSGlobalData::JSGlobalData):
1723         (JSC::JSGlobalData::releaseExecutableMemory):
1724         (JSC::releaseExecutableMemory):
1725         * runtime/JSGlobalData.h:
1726         * runtime/RegExpCache.cpp:
1727         (JSC::RegExpCache::invalidateCode):
1728         * runtime/RegExpCache.h:
1729         * yarr/YarrJIT.cpp:
1730         (JSC::Yarr::YarrGenerator::compile):
1731
1732 2011-05-26  Geoffrey Garen  <ggaren@apple.com>
1733
1734         Reviewed by Oliver Hunt.
1735
1736         Optimized ConservativeSet to avoid double-visiting objects
1737         https://bugs.webkit.org/show_bug.cgi?id=61592
1738         
1739         SunSpider thinks this might be a 1% speedup
1740
1741         * heap/ConservativeRoots.h:
1742         (JSC::ConservativeRoots::add): Use testAndClearMarked to avoid double-visiting
1743         an object.
1744
1745         * heap/Heap.h:
1746         (JSC::Heap::isMarked):
1747         (JSC::Heap::testAndSetMarked):
1748         (JSC::Heap::testAndClearMarked):
1749         (JSC::Heap::setMarked): Added testAndClearMarked. Changed argument type
1750         to void*, since clients want to ask questions about arbitrary pointers
1751         into the heap, even when they aren't known to be JSCells.
1752
1753         * heap/MarkedBlock.h:
1754         (JSC::MarkedBlock::testAndClearMarked):
1755         * heap/MarkedSpace.h:
1756         (JSC::MarkedSpace::isMarked):
1757         (JSC::MarkedSpace::testAndSetMarked):
1758         (JSC::MarkedSpace::testAndClearMarked):
1759         (JSC::MarkedSpace::setMarked):
1760         (JSC::MarkedSpace::contains): Ditto.
1761
1762         * wtf/Bitmap.h:
1763         (WTF::::testAndClear): New function for ConservativeRoots's inverted
1764         marking pass.
1765
1766 2011-05-27  Stephanie Lewis  <slewis@apple.com>
1767
1768         Rubber Stamped by Adam Roben.
1769
1770         Update Order Files.  Use -order_file flag since it can order more of the binary.
1771
1772         * Configurations/Base.xcconfig:
1773         * JavaScriptCore.order:
1774
1775 2011-05-26  Geoffrey Garen  <ggaren@apple.com>
1776
1777         Reviewed by Oliver Hunt.
1778
1779         Renamed heapRootMarker to heapRootVisitor to match its class name
1780         https://bugs.webkit.org/show_bug.cgi?id=61584
1781
1782         * heap/Heap.cpp:
1783         (JSC::Heap::markProtectedObjects):
1784         (JSC::Heap::markTempSortVectors):
1785         (JSC::Heap::markRoots):
1786
1787 2011-05-26  Geoffrey Garen  <ggaren@apple.com>
1788
1789         Reviewed by Oliver Hunt.
1790
1791         Removed some interdependency between Heap and SmallStrings by simplifying
1792         the SmallStrings lifetime model
1793         https://bugs.webkit.org/show_bug.cgi?id=61579
1794         
1795         SunSpider reports no change.
1796         
1797         Using Weak<T> could accomplish this too, but we're not sure it will give
1798         us the performance we need. This is a first step, and it accomplishes
1799         most of the value of using Weak<T>.
1800
1801         * heap/Heap.cpp:
1802         (JSC::Heap::destroy):
1803         (JSC::Heap::markRoots):
1804         (JSC::Heap::reset): Finalize small strings just like other weak handles.
1805
1806         * runtime/SmallStrings.cpp:
1807         (JSC::finalize):
1808         (JSC::SmallStrings::finalizeSmallStrings):
1809         * runtime/SmallStrings.h: Make all small strings trivially weak, instead
1810         of having an "all for one, one for all" memory model.
1811
1812 2011-05-26  Oliver Hunt  <oliver@apple.com>
1813
1814         Reviewed by Geoffrey Garen.
1815
1816         Make RegExpCache a weak map
1817         https://bugs.webkit.org/show_bug.cgi?id=61554
1818
1819         Switch to a weak map for the regexp cache, and hide that
1820         behaviour behind RegExp::create.
1821
1822         When a RegExp is compiled it attempts to add itself to
1823         the "strong" cache.  This cache is a simple round-robin
1824         buffer as was the old strong cache.  Happily this can
1825         be smaller than the old strong cache as RegExps are only
1826         added when they're compiled so it is under less pressure
1827         to evict.
1828
1829         * bytecompiler/NodesCodegen.cpp:
1830         (JSC::RegExpNode::emitBytecode):
1831         * runtime/RegExp.cpp:
1832         (JSC::RegExp::RegExp):
1833         (JSC::RegExp::create):
1834         (JSC::RegExp::match):
1835         * runtime/RegExp.h:
1836         (JSC::RegExp::gcShouldInvalidateCode):
1837         (JSC::RegExp::hasCode):
1838         (JSC::RegExp::key):
1839         * runtime/RegExpCache.cpp:
1840         (JSC::RegExpCache::lookupOrCreate):
1841         (JSC::RegExpCache::RegExpCache):
1842         (JSC::RegExpCache::isReachableFromOpaqueRoots):
1843         (JSC::RegExpCache::finalize):
1844         * runtime/RegExpCache.h:
1845         * runtime/RegExpConstructor.cpp:
1846         (JSC::constructRegExp):
1847         * runtime/RegExpPrototype.cpp:
1848         (JSC::regExpProtoFuncCompile):
1849         * runtime/StringPrototype.cpp:
1850         (JSC::stringProtoFuncMatch):
1851         (JSC::stringProtoFuncSearch):
1852
1853 2011-05-26  Geoffrey Garen  <ggaren@apple.com>
1854
1855         Reviewed by Oliver Hunt.
1856
1857         Moved Heap-related functions out of JSCell.h and into respective header files
1858         https://bugs.webkit.org/show_bug.cgi?id=61567
1859
1860         * heap/Heap.h:
1861         (JSC::Heap::allocate):
1862         (JSC::Heap::heap):
1863         * heap/MarkedBlock.h:
1864         (JSC::MarkedBlock::allocate):
1865         * heap/MarkedSpace.h:
1866         (JSC::MarkedSpace::sizeClassFor):
1867         (JSC::MarkedSpace::allocate):
1868         * runtime/JSCell.h:
1869         (JSC::JSCell::destructor):
1870
1871 2011-05-26  Geoffrey Garen  <ggaren@apple.com>
1872
1873         Try to fix Windows build.
1874
1875         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1876
1877 2011-05-26  Ryosuke Niwa  <rniwa@webkit.org>
1878
1879         Reviewed by Eric Seidel.
1880
1881         [debug feature] WTFString should have show() method
1882         https://bugs.webkit.org/show_bug.cgi?id=61149
1883
1884         Added String::show and AtomicString::show in NDEBUG.
1885
1886         * wtf/text/AtomicString.cpp:
1887         (WTF::AtomicString::show):
1888         * wtf/text/AtomicString.h:
1889         * wtf/text/WTFString.cpp:
1890         (String::show):
1891         * wtf/text/WTFString.h:
1892
1893 2011-05-26  Geoffrey Garen  <ggaren@apple.com>
1894
1895         Reviewed by Geoffrey Garen.
1896
1897         Factored out some Heap ASSERTs
1898         https://bugs.webkit.org/show_bug.cgi?id=61565
1899
1900         * JavaScriptCore.exp:
1901         * heap/Heap.cpp:
1902         (JSC::isValidSharedInstanceThreadState):
1903         (JSC::isValidThreadState):
1904         (JSC::Heap::markRoots):
1905         (JSC::Heap::isValidAllocation):
1906         * heap/Heap.h:
1907         * runtime/JSCell.h:
1908         (JSC::JSCell::Heap::allocate):
1909
1910 2011-05-26  Gavin Barraclough  <barraclough@apple.com>
1911
1912         Reviewed by Geoff Garen.
1913
1914         https://bugs.webkit.org/show_bug.cgi?id=61508
1915         DFG JIT - Add support for get by id self caching.
1916
1917         Change the call out to be an unexpected call (using silent spill/fill functions),
1918         add a structure check & compact load to the JIT code, and add repatching mechanisms.
1919         Since DFGOperations may want to be be implemented in asm, make these symbols be extern
1920         "C". Add an asm wrapper to pass the return address to the optimizing get-by-id operation,
1921         so that it can look up its StructureStubInfo.
1922
1923         * JavaScriptCore.xcodeproj/project.pbxproj:
1924             - Added new files.
1925         * bytecode/StructureStubInfo.h:
1926             - Added 'unset' entries to union.
1927         * dfg/DFGJITCodeGenerator.h:
1928         (JSC::DFG::JITCodeGenerator::appendCallWithExceptionCheck):
1929             - Return the call, we need this to populate the StructureStubInfo.
1930         * dfg/DFGJITCompiler.cpp:
1931         (JSC::DFG::JITCompiler::compileFunction):
1932             - Populate the CodebBlock's StructureStubInfo Vector.
1933         * dfg/DFGJITCompiler.h:
1934         (JSC::DFG::JITCompiler::appendCallWithExceptionCheck):
1935             - Return the call, we need this to populate the StructureStubInfo.
1936         (JSC::DFG::JITCompiler::addPropertyAccess):
1937         (JSC::DFG::JITCompiler::PropertyAccessRecord::PropertyAccessRecord):
1938             - Add structures to record property access info during compilation.
1939         * dfg/DFGOperations.cpp:
1940             - Made all external methods extern "C".
1941         (JSC::DFG::operationPutByValInternal):
1942             - Moved outside of the extern "C" block.
1943         * dfg/DFGOperations.h:
1944             - Made all external methods extern "C".
1945         * dfg/DFGRepatch.cpp: Added.
1946         (JSC::DFG::dfgRepatchCall):
1947             - repatch a call to link to a new callee function.
1948         (JSC::DFG::dfgRepatchGetByIdSelf):
1949             - Modify the JIT code to optimize self accesses.
1950         (JSC::DFG::tryCacheGetByID):
1951             - Internal implementation of dfgRepatchGetByID (factor out failing cases).
1952         (JSC::DFG::dfgRepatchGetByID):
1953             - Used to optimize 'operationGetByIdOptimize' - repatches to 'operationGetById', and tries to optimize self accesses!
1954         * dfg/DFGRepatch.h: Added.
1955             - Expose dfgRepatchGetByID.
1956         * dfg/DFGSpeculativeJIT.cpp:
1957         (JSC::DFG::SpeculativeJIT::compile):
1958             - Changed implementation of GetById ops.
1959
1960 2011-05-26  Geoffrey Garen  <ggaren@apple.com>
1961
1962         Rolled back in http://trac.webkit.org/changeset/87408 with Windows build fixed.
1963
1964         * heap/MarkedBlock.cpp:
1965         (JSC::MarkedBlock::MarkedBlock):
1966         * heap/MarkedBlock.h:
1967         * wtf/DoublyLinkedList.h:
1968         (WTF::::DoublyLinkedListNode):
1969         (WTF::::setPrev):
1970         (WTF::::setNext):
1971         (WTF::::prev):
1972         (WTF::::next):
1973         (WTF::::DoublyLinkedList):
1974         (WTF::::isEmpty):
1975         (WTF::::size):
1976         (WTF::::clear):
1977         (WTF::::head):
1978         (WTF::::append):
1979         (WTF::::remove):
1980         (WTF::::removeHead):
1981
1982 2011-05-26  Geoffrey Garen  <ggaren@apple.com>
1983
1984         Rolled out http://trac.webkit.org/changeset/87408 because it broke the
1985         Windows build.
1986
1987         * heap/MarkedBlock.cpp:
1988         (JSC::MarkedBlock::MarkedBlock):
1989         * heap/MarkedBlock.h:
1990         (JSC::MarkedBlock::setPrev):
1991         (JSC::MarkedBlock::setNext):
1992         (JSC::MarkedBlock::prev):
1993         (JSC::MarkedBlock::next):
1994         * wtf/DoublyLinkedList.h:
1995         (WTF::::DoublyLinkedList):
1996         (WTF::::isEmpty):
1997         (WTF::::head):
1998         (WTF::::append):
1999         (WTF::::remove):
2000
2001 2011-05-26  Geoffrey Garen  <ggaren@apple.com>
2002
2003         Reviewed by Oliver Hunt.
2004
2005         Provide a real owner when copying a property table, for the sake of
2006         write barriers.
2007         https://bugs.webkit.org/show_bug.cgi?id=61547
2008         
2009         No test because we can't enable the writeBarrier() ASSERT just yet.
2010
2011         * runtime/Structure.cpp:
2012         (JSC::Structure::addPropertyTransition):
2013
2014 2011-05-26  Adam Roben  <aroben@apple.com>
2015
2016         Windows build fix after r87346
2017
2018         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Fixed up exports to match
2019         reality.
2020
2021 2011-05-26  Patrick Gansterer  <paroga@webkit.org>
2022
2023         Reviewed by Adam Barth.
2024
2025         ASSERT(isMainThread()) when using single threaded jsc executable
2026         https://bugs.webkit.org/show_bug.cgi?id=60846
2027
2028         Remove the ASSERT since we do not have the concept of MainThread in JSC.
2029
2030         * wtf/CryptographicallyRandomNumber.cpp:
2031         (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomNumber):
2032         (WTF::ARC4Stream::ARC4RandomNumberGenerator::randomValues):
2033
2034 2011-05-25  Gavin Barraclough  <barraclough@apple.com>
2035
2036         Reviewed by Sam Weinig.
2037
2038         https://bugs.webkit.org/show_bug.cgi?id=61506
2039
2040         Move the silent spill/fill methods in the DFG JIT to the JITCodeGenerator
2041         so that they are available to the SpeculativeJIT.
2042
2043         * dfg/DFGJITCodeGenerator.h:
2044         (JSC::DFG::JITCodeGenerator::silentSpillGPR):
2045         (JSC::DFG::JITCodeGenerator::silentSpillFPR):
2046         (JSC::DFG::JITCodeGenerator::silentFillGPR):
2047         (JSC::DFG::JITCodeGenerator::silentFillFPR):
2048         (JSC::DFG::JITCodeGenerator::silentSpillAllRegisters):
2049         (JSC::DFG::JITCodeGenerator::silentFillAllRegisters):
2050         * dfg/DFGNonSpeculativeJIT.h:
2051
2052 2011-05-25  Ryosuke Niwa  <rniwa@webkit.org>
2053
2054         An attempt to revive Windows bots.
2055
2056         * runtime/RegExp.cpp:
2057         * runtime/RegExp.h:
2058
2059 2011-05-25  Gavin Barraclough  <barraclough@apple.com>
2060
2061         Reviewed by Sam Weinig.
2062
2063         Bug 61503 - Move population of CodeBlock::m_structureStubInfos into JIT
2064
2065         This data structure, used at runtime by the JIT, is currently unnecessarily populated
2066         with default entries during byte compilation.
2067
2068         Aside from meaning that there is JIT specific code in the bytecompiler, this also ties
2069         us to one entry per corresponding bytecode op, which may be undesirable. Instead,
2070         populate this array from the JIT.
2071
2072         The type StructureStubInfo has two unused states, one for gets & one for puts. Unify
2073         these, so that the class can have a default constructor (and to simply switch statements
2074         in code walking over the table).
2075
2076         This change has ramification for the DFG JIT, in that the DFG JIT used this datastructure
2077         to check for functions containing property access. Instead do so in the DFGByteCodeParser.
2078
2079         * bytecode/CodeBlock.cpp:
2080         (JSC::printStructureStubInfo):
2081         * bytecode/CodeBlock.h:
2082         (JSC::CodeBlock::setNumberOfStructureStubInfos):
2083         (JSC::CodeBlock::numberOfStructureStubInfos):
2084         * bytecode/StructureStubInfo.cpp:
2085         (JSC::StructureStubInfo::deref):
2086         (JSC::StructureStubInfo::visitAggregate):
2087         * bytecode/StructureStubInfo.h:
2088         (JSC::StructureStubInfo::StructureStubInfo):
2089         * bytecompiler/BytecodeGenerator.cpp:
2090         (JSC::BytecodeGenerator::emitGetById):
2091         (JSC::BytecodeGenerator::emitPutById):
2092         (JSC::BytecodeGenerator::emitDirectPutById):
2093         * dfg/DFGByteCodeParser.cpp:
2094         (JSC::DFG::ByteCodeParser::parseBlock):
2095         * jit/JIT.cpp:
2096         (JSC::JIT::JIT):
2097         (JSC::JIT::privateCompileMainPass):
2098         (JSC::JIT::privateCompileSlowCases):
2099         (JSC::JIT::privateCompile):
2100         * jit/JIT.h:
2101         * jit/JITPropertyAccess.cpp:
2102         (JSC::JIT::emit_op_get_by_id):
2103         (JSC::JIT::emit_op_put_by_id):
2104         (JSC::JIT::emit_op_method_check):
2105         (JSC::JIT::compileGetByIdHotPath):
2106         (JSC::JIT::compileGetByIdSlowCase):
2107         (JSC::JIT::emitSlow_op_put_by_id):
2108         * jit/JITPropertyAccess32_64.cpp:
2109         (JSC::JIT::emit_op_get_by_id):
2110         (JSC::JIT::emitSlow_op_get_by_id):
2111         (JSC::JIT::emit_op_put_by_id):
2112         (JSC::JIT::emitSlow_op_put_by_id):
2113         (JSC::JIT::emit_op_method_check):
2114         (JSC::JIT::compileGetByIdHotPath):
2115         (JSC::JIT::compileGetByIdSlowCase):
2116         * runtime/Executable.cpp:
2117         (JSC::tryDFGCompile):
2118
2119 2011-05-25  Gavin Barraclough  <barraclough@apple.com>
2120
2121         Reviewed by Sam Weinig.
2122
2123         Bug 61501 - Unify AbstractMacroAssembler::differenceBetween methods.
2124
2125         * assembler/AbstractMacroAssembler.h:
2126         (JSC::AbstractMacroAssembler::Call::Call):
2127         (JSC::AbstractMacroAssembler::Call::fromTailJump):
2128         (JSC::AbstractMacroAssembler::Jump::Jump):
2129         (JSC::AbstractMacroAssembler::Jump::link):
2130         (JSC::AbstractMacroAssembler::Jump::linkTo):
2131         (JSC::AbstractMacroAssembler::Jump::isSet):
2132         (JSC::AbstractMacroAssembler::differenceBetween):
2133         (JSC::AbstractMacroAssembler::linkJump):
2134         (JSC::AbstractMacroAssembler::getLinkerCallReturnOffset):
2135         * assembler/LinkBuffer.h:
2136         (JSC::LinkBuffer::link):
2137         (JSC::LinkBuffer::locationOf):
2138         (JSC::LinkBuffer::locationOfNearCall):
2139         (JSC::LinkBuffer::returnAddressOffset):
2140         * assembler/MacroAssemblerARM.h:
2141         (JSC::MacroAssemblerARM::linkCall):
2142         * assembler/MacroAssemblerARMv7.h:
2143         (JSC::MacroAssemblerARMv7::linkCall):
2144         * assembler/MacroAssemblerMIPS.h:
2145         (JSC::MacroAssemblerMIPS::linkCall):
2146         * assembler/MacroAssemblerSH4.cpp:
2147         (JSC::MacroAssemblerSH4::linkCall):
2148         * assembler/MacroAssemblerX86.h:
2149         (JSC::MacroAssemblerX86::linkCall):
2150         * assembler/MacroAssemblerX86_64.h:
2151         (JSC::MacroAssemblerX86_64::linkCall):
2152
2153 2011-05-25  Gavin Barraclough  <barraclough@apple.com>
2154
2155         Reviewed by Sam Weinig.
2156
2157         https://bugs.webkit.org/show_bug.cgi?id=61500
2158         Add JSObject::offsetOfPropertyStorage
2159
2160         * jit/JITPropertyAccess.cpp:
2161         (JSC::JIT::compileGetDirectOffset):
2162         (JSC::JIT::compileGetByIdHotPath):
2163         (JSC::JIT::emit_op_put_by_id):
2164         (JSC::JIT::compilePutDirectOffset):
2165         * jit/JITPropertyAccess32_64.cpp:
2166         (JSC::JIT::compileGetByIdHotPath):
2167         (JSC::JIT::emit_op_put_by_id):
2168         (JSC::JIT::compilePutDirectOffset):
2169         (JSC::JIT::compileGetDirectOffset):
2170         * runtime/JSObject.h:
2171         (JSC::JSObject::offsetOfPropertyStorage):
2172
2173 2011-05-25  Oliver Hunt  <oliver@apple.com>
2174
2175         Reviewed by Geoffrey Garen.
2176
2177         Make RegExp GC allocated
2178         https://bugs.webkit.org/show_bug.cgi?id=61490
2179
2180         Make RegExp GC allocated.  Basically mechanical change to replace
2181         most use of [Pass]RefPtr<RegExp> with RegExp* or WriteBarrier<RegExp>
2182         where actual ownership happens.
2183
2184         Made the RegExpCache use Strong<> references currently to avoid any
2185         changes in behaviour.
2186
2187         * JavaScriptCore.exp:
2188         * bytecode/CodeBlock.cpp:
2189         (JSC::CodeBlock::visitAggregate):
2190         * bytecode/CodeBlock.h:
2191         (JSC::CodeBlock::addRegExp):
2192         * bytecompiler/BytecodeGenerator.cpp:
2193         (JSC::BytecodeGenerator::addRegExp):
2194         (JSC::BytecodeGenerator::emitNewRegExp):
2195         * bytecompiler/BytecodeGenerator.h:
2196         * runtime/JSCell.h:
2197         * runtime/JSGlobalData.cpp:
2198         (JSC::JSGlobalData::JSGlobalData):
2199         (JSC::JSGlobalData::clearBuiltinStructures):
2200         (JSC::JSGlobalData::addRegExpToTrace):
2201         * runtime/JSGlobalData.h:
2202         * runtime/JSGlobalObject.cpp:
2203         (JSC::JSGlobalObject::reset):
2204         * runtime/RegExp.cpp:
2205         (JSC::RegExp::RegExp):
2206         (JSC::RegExp::create):
2207         (JSC::RegExp::invalidateCode):
2208         * runtime/RegExp.h:
2209         (JSC::RegExp::createStructure):
2210         * runtime/RegExpCache.cpp:
2211         (JSC::RegExpCache::lookupOrCreate):
2212         (JSC::RegExpCache::create):
2213         * runtime/RegExpCache.h:
2214         * runtime/RegExpConstructor.cpp:
2215         (JSC::constructRegExp):
2216         * runtime/RegExpObject.cpp:
2217         (JSC::RegExpObject::RegExpObject):
2218         (JSC::RegExpObject::visitChildren):
2219         * runtime/RegExpObject.h:
2220         (JSC::RegExpObject::setRegExp):
2221         (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
2222         * runtime/RegExpPrototype.cpp:
2223         (JSC::RegExpPrototype::RegExpPrototype):
2224         (JSC::regExpProtoFuncCompile):
2225         * runtime/RegExpPrototype.h:
2226         * runtime/StringPrototype.cpp:
2227         (JSC::stringProtoFuncMatch):
2228         (JSC::stringProtoFuncSearch):
2229
2230 2011-05-25  Oliver Hunt  <oliver@apple.com>
2231
2232         Reviewed by Geoffrey Garen.
2233
2234         Generate regexp code lazily
2235         https://bugs.webkit.org/show_bug.cgi?id=61476
2236
2237         RegExp construction now simply validates the RegExp, it does
2238         not perform actual codegen.
2239
2240         * runtime/RegExp.cpp:
2241         (JSC::RegExp::RegExp):
2242         (JSC::RegExp::recompile):
2243         (JSC::RegExp::compile):
2244         (JSC::RegExp::match):
2245         * runtime/RegExp.h:
2246         (JSC::RegExp::recompileIfNecessary):
2247         * runtime/RegExpConstructor.h:
2248         (JSC::RegExpConstructor::performMatch):
2249         * runtime/RegExpObject.cpp:
2250         (JSC::RegExpObject::match):
2251         * runtime/StringPrototype.cpp:
2252         (JSC::stringProtoFuncReplace):
2253         (JSC::stringProtoFuncMatch):
2254         (JSC::stringProtoFuncSearch):
2255         (JSC::stringProtoFuncSplit):
2256
2257 2011-05-24  Geoffrey Garen  <ggaren@apple.com>
2258
2259         Reviewed by Geoffrey Garen.
2260
2261         Removed MarkSetProperties because it was unused
2262         https://bugs.webkit.org/show_bug.cgi?id=61418
2263
2264         * heap/MarkStack.h:
2265         (JSC::MarkSet::MarkSet):
2266         (JSC::MarkStack::append):
2267         * runtime/JSActivation.cpp:
2268         (JSC::JSActivation::visitChildren):
2269         * runtime/JSArray.h:
2270         (JSC::JSArray::visitChildrenDirect):
2271         * runtime/JSPropertyNameIterator.cpp:
2272         (JSC::JSPropertyNameIterator::visitChildren):
2273         * runtime/WriteBarrier.h:
2274         (JSC::MarkStack::appendValues):
2275
2276 2011-05-25  Oliver Hunt  <oliver@apple.com>
2277
2278         Reviewed by Geoffrey Garen.
2279
2280         Make allocations with guard pages ensure that the allocation succeeded
2281         https://bugs.webkit.org/show_bug.cgi?id=61453
2282
2283         Add null checks, and make PageBlock's operator bool() use
2284         the realbase, rather than the start of usable memory.
2285
2286         * wtf/OSAllocatorPosix.cpp:
2287         (WTF::OSAllocator::reserveAndCommit):
2288         * wtf/PageBlock.h:
2289         (WTF::PageBlock::operator bool):
2290         (WTF::PageBlock::PageBlock):
2291
2292 2011-04-10  Kevin Ollivier  <kevino@theolliviers.com>
2293
2294         Reviewed by Eric Seidel.
2295
2296         Add JS_EXPORT_PRIVATE macro for exported methods in bytecompiler headers.
2297         
2298         https://bugs.webkit.org/show_bug.cgi?id=27551
2299
2300         * bytecompiler/BytecodeGenerator.h:
2301
2302 2011-05-24  Keishi Hattori  <keishi@webkit.org>
2303
2304         Reviewed by Kent Tamura.
2305
2306         Disable textfield implementation of <input type=color>. Add INPUT_COLOR feature flag. Add input color sanitizer.
2307         https://bugs.webkit.org/show_bug.cgi?id=61273
2308
2309         * Configurations/FeatureDefines.xcconfig: Added COLOR_INPUT feature flag.
2310
2311 2011-05-24  Kevin Ollivier  <kevino@theolliviers.com>
2312
2313         Reviewed by Eric Seidel.
2314
2315         Add export macros to WTFString.h.
2316         
2317         https://bugs.webkit.org/show_bug.cgi?id=27551
2318
2319         * wtf/text/WTFString.h:
2320         (WTF::String::String):
2321         (WTF::String::findIgnoringCase):
2322         (WTF::String::isHashTableDeletedValue):
2323
2324 2011-05-24  Geoffrey Garen  <ggaren@apple.com>
2325
2326         Maybe fix the Mac build now?
2327
2328         * JavaScriptCore.xcodeproj/project.pbxproj:
2329
2330 2011-05-24  Geoffrey Garen  <ggaren@apple.com>
2331
2332         Maybe fix the Mac build?
2333         
2334         * JavaScriptCore.xcodeproj/project.pbxproj:
2335
2336 2011-05-24  Geoffrey Garen  <ggaren@apple.com>
2337
2338         Reviewed by Oliver Hunt.
2339
2340         Split HeapRootVisitor into its own class
2341         https://bugs.webkit.org/show_bug.cgi?id=61399
2342
2343         * GNUmakefile.list.am:
2344         * JavaScriptCore.gypi:
2345         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2346         * JavaScriptCore.xcodeproj/project.pbxproj:
2347         * heap/HandleHeap.cpp:
2348         * heap/HandleStack.cpp:
2349         * heap/Heap.cpp:
2350         * heap/HeapRootVisitor.h: Copied from Source/JavaScriptCore/heap/MarkStack.h.
2351         * heap/MarkStack.h:
2352         * runtime/ArgList.cpp:
2353         * runtime/SmallStrings.cpp:
2354
2355 2011-05-24  Jay Civelli  <jcivelli@chromium.org>
2356
2357         Rubberstamped by David Kilzer.
2358
2359         Updated some files that I forgot in my previous MHTML CL.
2360
2361         * Configurations/FeatureDefines.xcconfig:
2362
2363 2011-05-24  Geoffrey Garen  <ggaren@apple.com>
2364
2365         Fix the Mac build: Yes, please do remove these files, svn.
2366
2367         * JavaScriptCore.xcodeproj/project.pbxproj:
2368
2369 2011-05-24  Geoffrey Garen  <ggaren@apple.com>
2370
2371         Reviewed by Oliver Hunt.
2372
2373         Let's just have one way to get the system page size, bokay?
2374         https://bugs.webkit.org/show_bug.cgi?id=61384
2375
2376         * CMakeListsEfl.txt:
2377         * CMakeListsWinCE.txt:
2378         * GNUmakefile.list.am:
2379         * JavaScriptCore.exp:
2380         * JavaScriptCore.gypi:
2381         * JavaScriptCore.pro:
2382         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: MarkStack[Platform].cpp
2383         is gone completely now, since it only existed to provide a duplicate way
2384         to access the system page size.
2385
2386         * heap/MarkStack.cpp:
2387         (JSC::MarkStack::reset):
2388         * heap/MarkStack.h:
2389         (JSC::::MarkStackArray):
2390         (JSC::::shrinkAllocation): Use WTF::pageSize.
2391
2392         * heap/MarkStackPosix.cpp:
2393         * heap/MarkStackSymbian.cpp:
2394         * heap/MarkStackWin.cpp: Removed now-empty files.
2395
2396         * jit/ExecutableAllocator.cpp:
2397         (JSC::ExecutableAllocator::reprotectRegion):
2398         * jit/ExecutableAllocator.h:
2399         (JSC::ExecutableAllocator::ExecutableAllocator):
2400         (JSC::ExecutablePool::ExecutablePool):
2401         (JSC::ExecutablePool::poolAllocate):
2402         * jit/ExecutableAllocatorFixedVMPool.cpp: Use WTF::pageSize.
2403
2404         * wscript: Removed now-empty files.
2405
2406         * wtf/PageBlock.cpp:
2407         (WTF::systemPageSize): Integrated questionable Symbian page size rule
2408         from ExecutableAllocator, because that seems like what the original
2409         author should have done.
2410
2411 2011-05-24  Oliver Hunt  <oliver@apple.com>
2412
2413         Reviewed by Gavin Barraclough.
2414
2415         Interpreter crashes with gc validation enabled due to failure to mark initial cache structure
2416         https://bugs.webkit.org/show_bug.cgi?id=61385
2417
2418         The interpreter uses the structure slot of get_by_id and put_by_id to hold
2419         the initial structure it encountered so that it can identify whether a
2420         given access is stable.
2421
2422         When marking though we only visit the slot when we've decided to cache, and
2423         so this value could die.  This was "safe" as the value was only used for a
2424         pointer compare, but it was incorrect.  We now just mark the slot like we
2425         should have been doing already.
2426
2427         * bytecode/CodeBlock.cpp:
2428         (JSC::CodeBlock::visitStructures):
2429
2430 2011-05-24  Adam Roben  <aroben@apple.com>
2431
2432         Windows build fix
2433
2434         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Removed now-inline functions.
2435
2436 2011-05-24  Geoffrey Garen  <ggaren@apple.com>
2437
2438         Windows build fix: update the #if OS(WINDOWS) section to match my last patch.
2439
2440         * heap/MarkStack.h:
2441         (JSC::::shrinkAllocation):
2442
2443 2011-05-24  Geoffrey Garen  <ggaren@apple.com>
2444
2445         Rubber-stamped by Oliver Hunt.
2446
2447         Split out function definitions and class definitions from class
2448         declarations in MarkStack.h, for readability.
2449
2450         * heap/MarkStack.h:
2451         (JSC::MarkStack::MarkStack):
2452         (JSC::MarkStack::~MarkStack):
2453         (JSC::MarkStack::addOpaqueRoot):
2454         (JSC::MarkStack::containsOpaqueRoot):
2455         (JSC::MarkStack::opaqueRootCount):
2456         (JSC::MarkSet::MarkSet):
2457         (JSC::MarkStack::allocateStack):
2458         (JSC::MarkStack::releaseStack):
2459         (JSC::MarkStack::pageSize):
2460         (JSC::::MarkStackArray):
2461         (JSC::::~MarkStackArray):
2462         (JSC::::expand):
2463         (JSC::::append):
2464         (JSC::::removeLast):
2465         (JSC::::last):
2466         (JSC::::isEmpty):
2467         (JSC::::size):
2468         (JSC::::shrinkAllocation):
2469
2470 2011-05-24  Oliver Hunt  <oliver@apple.com>
2471
2472         Reviewed by Geoffrey Garen.
2473
2474         Avoid creating unnecessary identifiers and strings in the syntax checker
2475         https://bugs.webkit.org/show_bug.cgi?id=61378
2476
2477         Selectively tell the lexer that there are some places it does not need to
2478         do the real work of creating Identifiers for IDENT and STRING tokens.
2479
2480         Make parseString and parseIdentifier templatized on whether they should
2481         do real work, or merely validate the tokens.
2482
2483         SunSpider --parse-only reports ~5-8% win depending on hardware.
2484
2485         * parser/ASTBuilder.h:
2486         (JSC::ASTBuilder::createDotAccess):
2487         * parser/JSParser.cpp:
2488         (JSC::JSParser::next):
2489         (JSC::JSParser::consume):
2490         (JSC::JSParser::parseVarDeclarationList):
2491         (JSC::JSParser::parseConstDeclarationList):
2492         (JSC::JSParser::parseExpression):
2493         (JSC::JSParser::parseAssignmentExpression):
2494         (JSC::JSParser::parseConditionalExpression):
2495         (JSC::JSParser::parseBinaryExpression):
2496         (JSC::JSParser::parseProperty):
2497         (JSC::JSParser::parseObjectLiteral):
2498         (JSC::JSParser::parseArrayLiteral):
2499         (JSC::JSParser::parseArguments):
2500         (JSC::JSParser::parseMemberExpression):
2501         * parser/Lexer.cpp:
2502         (JSC::Lexer::parseIdentifier):
2503         (JSC::Lexer::parseString):
2504         (JSC::Lexer::lex):
2505         * parser/Lexer.h:
2506         * parser/SyntaxChecker.h:
2507         (JSC::SyntaxChecker::createDotAccess):
2508         (JSC::SyntaxChecker::createProperty):
2509
2510 2011-05-23  Michael Saboff  <msaboff@apple.com>
2511
2512         Reviewed by Mark Rowe.
2513
2514         Safari often freezes when clicking "Return free memory" in Caches dialog
2515         https://bugs.webkit.org/show_bug.cgi?id=61325
2516
2517         There are two fixes and improvement in instrumentation code used to find 
2518         one of the problems.
2519         Changed ReleaseFreeList() to set the "decommitted" bit when releasing
2520         pages to the system and moving Spans from the normal list to the returned 
2521         list.
2522         Added a "not making forward progress" check to TCMalloc_PageHeap::scavenge
2523         to eliminate an infinite loop if we can't meet the pagesToRelease target.
2524         Added a check for the decommitted bit being set properly in 
2525         TCMalloc_PageHeap::CheckList.
2526
2527         * wtf/FastMalloc.cpp:
2528         (WTF::TCMalloc_PageHeap::scavenge):
2529         (WTF::TCMalloc_PageHeap::Check):
2530         (WTF::TCMalloc_PageHeap::CheckList):
2531         (WTF::ReleaseFreeList):
2532
2533 2011-05-23  Gavin Barraclough  <barraclough@apple.com>
2534
2535         Reviewed by Geoff Garen.
2536
2537         https://bugs.webkit.org/show_bug.cgi?id=61306
2538
2539         The begin characters optimization currently has issues (#61129),
2540         and does not appear to still be a performance win. The prudent
2541         next step seems to be to disable while we ascertain whether this
2542         is still a useful performance optimization.
2543
2544         * yarr/YarrInterpreter.cpp:
2545         (JSC::Yarr::Interpreter::matchDisjunction):
2546         (JSC::Yarr::Interpreter::interpret):
2547         * yarr/YarrInterpreter.h:
2548         (JSC::Yarr::BytecodePattern::BytecodePattern):
2549         * yarr/YarrPattern.cpp:
2550         (JSC::Yarr::YarrPatternConstructor::YarrPatternConstructor):
2551         (JSC::Yarr::YarrPattern::compile):
2552         (JSC::Yarr::YarrPattern::YarrPattern):
2553         * yarr/YarrPattern.h:
2554         (JSC::Yarr::YarrPattern::reset):
2555
2556 2011-05-23  Matthew Delaney  <mdelaney@apple.com>
2557
2558         Reviewed by Simon Fraser.
2559
2560         Remove safeFloatToInt() in FloatRect.cpp and replace with working version of clampToInteger()
2561         https://bugs.webkit.org/show_bug.cgi?id=58216
2562
2563         * wtf/MathExtras.h:
2564         (clampToInteger):
2565         (clampToPositiveInteger):
2566
2567 2011-05-23  Ruben  <chromium@hybridsource.org>
2568
2569         Reviewed by Tony Chang.
2570
2571         Chromium gyp patch to use new POSIX defines toolkit_uses_gtk and os_posix
2572         https://bugs.webkit.org/show_bug.cgi?id=61219
2573
2574         * JavaScriptCore.gyp/JavaScriptCore.gyp:
2575
2576 2011-05-23  Thouraya ANDOLSI  <thouraya.andolsi@st.com>
2577
2578         Reviewed by Gavin Barraclough.
2579
2580         [SH4] AssemblerLabel does not name a type
2581         https://bugs.webkit.org/show_bug.cgi?id=59927
2582
2583         SH4Assembler.h file shoold be included before AbstractMacroAssembler.h.
2584
2585         * assembler/MacroAssemblerSH4.h:
2586
2587 2011-05-23  Ryuan Choi  <ryuan.choi@samsung.com>
2588
2589         Rubber stamped by Eric Seidel.
2590
2591         [CMAKE] Refactoring wtf related code.
2592         https://bugs.webkit.org/show_bug.cgi?id=60146
2593
2594         Move wtf-files to Source/JavaScriptCore/wtf/CMakeLists.txt.
2595
2596         * CMakeLists.txt:
2597         * CMakeListsEfl.txt:
2598         * wtf/CMakeLists.txt:
2599         * wtf/CMakeListsEfl.txt:
2600
2601 2011-05-22  Adam Barth  <abarth@webkit.org>
2602
2603         Enable strict PassOwnPtr for everyone.  I expect this patch will need
2604         some followups to make the GTK and EFL bots green again.
2605
2606         * wtf/PassOwnPtr.h:
2607
2608 2011-05-20  Oliver Hunt  <oliver@apple.com>
2609
2610         Reviewed by Gavin Barraclough.
2611
2612         Reduce size of inline cache path of get_by_id on ARMv7
2613         https://bugs.webkit.org/show_bug.cgi?id=61221
2614
2615         This reduces the code size of get_by_id by 20 bytes
2616
2617         * assembler/ARMv7Assembler.h:
2618         (JSC::ARMv7Assembler::ldrCompact):
2619         (JSC::ARMv7Assembler::repatchCompact):
2620         (JSC::ARMv7Assembler::setUInt7ForLoad):
2621         * assembler/MacroAssemblerARMv7.h:
2622         (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
2623         * jit/JIT.h:
2624
2625 2011-05-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
2626
2627         Reviewed by Oliver Hunt.
2628
2629         Zombies should "live" forever
2630         https://bugs.webkit.org/show_bug.cgi?id=61170
2631
2632         Reusing zombie cells could still hide garbage
2633         collected cell related bugs.
2634
2635         * JavaScriptCore.pro:
2636         * heap/MarkedBlock.cpp:
2637         (JSC::MarkedBlock::clearMarks):
2638         * heap/MarkedBlock.h:
2639         * heap/MarkedSpace.cpp:
2640         (JSC::MarkedSpace::destroy):
2641         * runtime/JSCell.h:
2642         (JSC::JSCell::JSValue::isZombie):
2643         * runtime/JSZombie.h:
2644         (JSC::JSZombie::~JSZombie):
2645         * runtime/WriteBarrier.h:
2646         (JSC::WriteBarrierBase::setWithoutWriteBarrier):
2647
2648 2011-05-20  Brady Eidson  <beidson@apple.com>
2649
2650         Reviewed by Sam Weinig.
2651
2652         <rdar://problem/9472883> and https://bugs.webkit.org/show_bug.cgi?id=61203
2653         Horrendous bug in callOnMainThreadAndWait
2654
2655         * wtf/MainThread.cpp:
2656         (WTF::dispatchFunctionsFromMainThread): Before signaling the background thread with the
2657           syncFlag condition, reacquire the mutex first.
2658
2659 2011-05-20  Oliver Hunt  <oliver@apple.com>
2660
2661         Reviewed by Sam Weinig.
2662
2663         Remove unnecessary double->int conversion at the end of op_div
2664         https://bugs.webkit.org/show_bug.cgi?id=61198
2665
2666         We don't attempt this conversion on 64bit, removing it actually speeds
2667         up sunspider and v8 slightly, and it reduces code size.
2668
2669         * jit/JITArithmetic32_64.cpp:
2670         (JSC::JIT::emit_op_div):
2671
2672 2011-05-19  Evan Martin  <evan@chromium.org>
2673
2674         Reviewed by Tony Chang.
2675
2676         [chromium] remove <(library) variable
2677         https://bugs.webkit.org/show_bug.cgi?id=61158
2678
2679         This was for a build experiment; we can just use the correct value now.
2680
2681         * JavaScriptCore.gyp/JavaScriptCore.gyp:
2682
2683 2011-05-20  Oliver Hunt  <oliver@apple.com>
2684
2685         Reviewed by Sam Weinig.
2686
2687         Interpreter uses wrong bytecode offset for determining exception handler
2688         https://bugs.webkit.org/show_bug.cgi?id=61191
2689
2690         The bytecode offset given for the returnPC from the JIT is
2691         actually the offset for the start of the instruction triggering
2692         the call, whereas in the interpreter it is the actual return
2693         VPC.  This means if the next instruction following a call was
2694         in an exception region we would incorrectly redirect to its
2695         handler.  Long term we want to completely redo how exceptions
2696         are handled anyway so the simplest and lowest risk fix here is
2697         to simply subtract one from the return vPC so that we have an
2698         offset in the triggering instruction.
2699
2700         It turns out this is caught by a couple of tests already.
2701
2702         * interpreter/Interpreter.cpp:
2703         (JSC::Interpreter::unwindCallFrame):
2704
2705 2011-05-20  Xan Lopez  <xlopez@igalia.com>
2706
2707         Reviewed by Oliver Hunt.
2708
2709         JIT requires VM overcommit (particularly on x86-64), Linux does not by default support this without swap?
2710         https://bugs.webkit.org/show_bug.cgi?id=42756
2711
2712         Use the MAP_NORESERVE flag for mmap on Linux to skip the kernel
2713         check of the available memory. This should give us an
2714         overcommit-like behavior in most systems, which is what we want.
2715
2716         * wtf/OSAllocatorPosix.cpp:
2717         (WTF::OSAllocator::reserveAndCommit): pass MAP_NORSERVE to mmap.
2718
2719 2011-05-19  Gabor Loki  <loki@webkit.org>
2720
2721         Fix ARM build after r86919
2722
2723         * assembler/ARMAssembler.h:
2724         (JSC::ARMAssembler::nop):
2725
2726 2011-05-19  Oliver Hunt  <oliver@apple.com>
2727
2728         Reviewed by Gavin Barraclough.
2729
2730         Randomise code starting location a little
2731         https://bugs.webkit.org/show_bug.cgi?id=61161
2732
2733         Add a nop() function to the Assemblers so that we
2734         can randomise code offsets slightly at no real cost.
2735
2736         * assembler/ARMAssembler.h:
2737         (JSC::ARMAssembler::nop):
2738         * assembler/ARMv7Assembler.h:
2739         (JSC::ARMv7Assembler::nop):
2740         * assembler/MacroAssemblerARM.h:
2741         (JSC::MacroAssemblerARM::nop):
2742         * assembler/MacroAssemblerARMv7.h:
2743         (JSC::MacroAssemblerARMv7::nop):
2744         * assembler/MacroAssemblerMIPS.h:
2745         (JSC::MacroAssemblerMIPS::nop):
2746         * assembler/MacroAssemblerSH4.h:
2747         (JSC::MacroAssemblerSH4::nop):
2748         * assembler/MacroAssemblerX86Common.h:
2749         (JSC::MacroAssemblerX86Common::nop):
2750         * assembler/X86Assembler.h:
2751         (JSC::X86Assembler::nop):
2752         * jit/JIT.cpp:
2753         (JSC::JIT::JIT):
2754         (JSC::JIT::privateCompile):
2755         * jit/JIT.h:
2756         * runtime/WeakRandom.h:
2757         (JSC::WeakRandom::getUint32):
2758
2759 2011-05-19  Oliver Hunt  <oliver@apple.com>
2760
2761         Fix windows build.
2762
2763         * wtf/OSAllocatorWin.cpp:
2764         (WTF::OSAllocator::reserveUncommitted):
2765         (WTF::OSAllocator::reserveAndCommit):
2766
2767 2011-05-19  Oliver Hunt  <oliver@apple.com>
2768
2769         Reviewed by Gavin Barraclough.
2770
2771         Add guard pages to each end of the memory region used by the fixedvm allocator
2772         https://bugs.webkit.org/show_bug.cgi?id=61150
2773
2774         Add mechanism to notify the OSAllocator that pages at either end of an
2775         allocation should be considered guard pages.  Update PageReservation,
2776         PageAllocation, etc to handle this.
2777
2778         * JavaScriptCore.exp:
2779         * jit/ExecutableAllocatorFixedVMPool.cpp:
2780         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
2781         * wtf/OSAllocator.h:
2782         * wtf/OSAllocatorPosix.cpp:
2783         (WTF::OSAllocator::reserveUncommitted):
2784         (WTF::OSAllocator::reserveAndCommit):
2785         * wtf/PageAllocation.h:
2786         (WTF::PageAllocation::PageAllocation):
2787         * wtf/PageAllocationAligned.h:
2788         (WTF::PageAllocationAligned::PageAllocationAligned):
2789         * wtf/PageBlock.h:
2790         (WTF::PageBlock::PageBlock):
2791         * wtf/PageReservation.h:
2792         (WTF::PageReservation::reserve):
2793         (WTF::PageReservation::reserveWithGuardPages):
2794             Add a new function to make a reservation that will add guard
2795             pages to the ends of an allocation.
2796         (WTF::PageReservation::PageReservation):
2797
2798 2011-05-19  Oliver Hunt  <oliver@apple.com>
2799
2800         Reviewed by Geoffrey Garen.
2801
2802         Make Executables release their JIT code as soon as they become dead
2803         https://bugs.webkit.org/show_bug.cgi?id=61134
2804
2805         Add an ability to clear an Executable's jit code without requiring
2806         it to be destroyed, and then call that from a finalizer.
2807
2808         * heap/Weak.h:
2809         (JSC::Weak::Weak):
2810         (JSC::Weak::leak):
2811         * jit/JITCode.h:
2812         (JSC::JITCode::clear):
2813         * runtime/Executable.cpp:
2814         (JSC::ExecutableFinalizer::finalize):
2815         (JSC::ExecutableBase::executableFinalizer):
2816         * runtime/Executable.h:
2817         (JSC::ExecutableBase::ExecutableBase):
2818         (JSC::ExecutableBase::clearExecutableCode):
2819
2820 2011-05-19  Adam Roben  <aroben@apple.com>
2821
2822         Remove a redundant and broken data export
2823
2824         Data can't be exported from JavaScriptCore.dll by listing it in the .def file. The
2825         JS_EXPORTDATA macro must be used instead. (In this case it was already being used, leading
2826         to a linker warning about multiple definitions.)
2827
2828         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Removed JSGlobalData::s_info.
2829
2830 2011-05-18  Oliver Hunt  <oliver@apple.com>
2831
2832         Reviewed by Gavin Barraclough.
2833
2834         Some tests crashing in JSC::MarkStack::validateValue beneath ScriptController::clearWindowShell on SnowLeopard Intel Release (WebKit2 Tests)
2835         https://bugs.webkit.org/show_bug.cgi?id=61064
2836
2837         Switch NonFinalObject to using WriteBarrier<> rather than WriteBarrierBase<>
2838         for its inline storage.  This resolves the problem of GC occurring before
2839         a subclass has initialised its anonymous storage.
2840
2841         * runtime/JSObject.h:
2842
2843 2011-05-18  Adam Barth  <abarth@webkit.org>
2844
2845         Reviewed by Sam Weinig.
2846
2847         Delete WTFURL
2848         https://bugs.webkit.org/show_bug.cgi?id=61084
2849
2850         It's been a year and we've failed to complete this project.  It's time
2851         to throw in the towel.
2852
2853         * JavaScriptCore.xcodeproj/project.pbxproj:
2854         * wtf/url: Removed.
2855         * wtf/url/api: Removed.
2856         * wtf/url/api/ParsedURL.cpp: Removed.
2857         * wtf/url/api/ParsedURL.h: Removed.
2858         * wtf/url/api/URLString.h: Removed.
2859         * wtf/url/src: Removed.
2860         * wtf/url/src/RawURLBuffer.h: Removed.
2861         * wtf/url/src/URLBuffer.h: Removed.
2862         * wtf/url/src/URLCharacterTypes.cpp: Removed.
2863         * wtf/url/src/URLCharacterTypes.h: Removed.
2864         * wtf/url/src/URLComponent.h: Removed.
2865         * wtf/url/src/URLEscape.cpp: Removed.
2866         * wtf/url/src/URLEscape.h: Removed.
2867         * wtf/url/src/URLParser.h: Removed.
2868         * wtf/url/src/URLQueryCanonicalizer.h: Removed.
2869         * wtf/url/src/URLSegments.cpp: Removed.
2870         * wtf/url/src/URLSegments.h: Removed.
2871         * wtf/url/wtfurl.gyp: Removed.
2872
2873 2011-05-18  Oliver Hunt  <oliver@apple.com>
2874
2875         Reviewed by Sam Weinig.
2876
2877         JSGlobalObject and some others do GC allocation during initialization, which can cause heap corruption
2878         https://bugs.webkit.org/show_bug.cgi?id=61090
2879
2880         Remove the Structure-free JSGlobalObject constructor and instead always
2881         pass the structure into the JSGlobalObject constructor.
2882         Stop DebuggerActivation creating a new structure every time, and simply
2883         use a single shared structure held by the GlobalData.
2884
2885         * API/JSContextRef.cpp:
2886         * debugger/DebuggerActivation.cpp:
2887         (JSC::DebuggerActivation::DebuggerActivation):
2888         * jsc.cpp:
2889         (GlobalObject::GlobalObject):
2890         (functionRun):
2891         (jscmain):
2892         * runtime/JSGlobalData.cpp:
2893         (JSC::JSGlobalData::JSGlobalData):
2894         (JSC::JSGlobalData::clearBuiltinStructures):
2895         * runtime/JSGlobalData.h:
2896         * runtime/JSGlobalObject.h:
2897
2898 2011-05-18  Oliver Hunt  <oliver@apple.com>
2899
2900         Reviewed by Adam Roben.
2901
2902         Disable gc validation in release builds
2903         https://bugs.webkit.org/show_bug.cgi?id=60680
2904
2905         Add back the NDEBUG check
2906
2907         * wtf/Platform.h:
2908
2909 2011-05-17  Geoffrey Garen  <ggaren@apple.com>
2910
2911         Rolled out attempts to fix EFL build because they're not enough -- the
2912         build script needs to be fixed.
2913
2914         * runtime/BooleanPrototype.cpp:
2915         * runtime/DateConstructor.cpp:
2916         * runtime/ErrorPrototype.cpp:
2917
2918 2011-05-17  Geoffrey Garen  <ggaren@apple.com>
2919
2920         More attempts to work around the EFL build system being borken.
2921
2922         * runtime/DateConstructor.cpp:
2923         * runtime/ErrorPrototype.cpp:
2924
2925 2011-05-17  Geoffrey Garen  <ggaren@apple.com>
2926
2927         Try to fix the EFL build.
2928
2929         * runtime/BooleanPrototype.cpp:
2930
2931 2011-05-16  Geoffrey Garen  <ggaren@apple.com>
2932
2933         Rolling back in r86653 with build fixed.
2934
2935         Reviewed by Gavin Barraclough and Oliver Hunt.
2936
2937         Global object initialization is expensive
2938         https://bugs.webkit.org/show_bug.cgi?id=60933
2939         
2940         Changed a bunch of globals to allocate their properties lazily, and changed
2941         the global object to allocate a bunch of its globals lazily.
2942         
2943         This reduces the footprint of a global object from 287 objects with 58
2944         functions for 24K to 173 objects with 20 functions for 15K.
2945
2946         Large patch, but it's all mechanical.
2947
2948         * DerivedSources.make:
2949         * JavaScriptCore.exp: Build!
2950
2951         * create_hash_table: Added a special case for fromCharCode, since it uses
2952         a custom "thunk generator".
2953
2954         * heap/Heap.cpp:
2955         (JSC::TypeCounter::operator()): Fixed a bug where the type counter would
2956         overcount objects that were owned through more than one mechanism because
2957         it was getting in the way of counting the results for this patch.
2958
2959         * interpreter/CallFrame.h:
2960         (JSC::ExecState::arrayConstructorTable):
2961         (JSC::ExecState::arrayPrototypeTable):
2962         (JSC::ExecState::booleanPrototypeTable):
2963         (JSC::ExecState::dateConstructorTable):
2964         (JSC::ExecState::errorPrototypeTable):
2965         (JSC::ExecState::globalObjectTable):
2966         (JSC::ExecState::numberConstructorTable):
2967         (JSC::ExecState::numberPrototypeTable):
2968         (JSC::ExecState::objectPrototypeTable):
2969         (JSC::ExecState::regExpPrototypeTable):
2970         (JSC::ExecState::stringConstructorTable): Added new tables.
2971
2972         * runtime/ArrayConstructor.cpp:
2973         (JSC::ArrayConstructor::ArrayConstructor):
2974         (JSC::ArrayConstructor::getOwnPropertySlot):
2975         (JSC::ArrayConstructor::getOwnPropertyDescriptor):
2976         * runtime/ArrayConstructor.h:
2977         (JSC::ArrayConstructor::createStructure):
2978         * runtime/ArrayPrototype.cpp:
2979         (JSC::ArrayPrototype::getOwnPropertySlot):
2980         (JSC::ArrayPrototype::getOwnPropertyDescriptor):
2981         * runtime/ArrayPrototype.h:
2982         * runtime/BooleanPrototype.cpp:
2983         (JSC::BooleanPrototype::BooleanPrototype):
2984         (JSC::BooleanPrototype::getOwnPropertySlot):
2985         (JSC::BooleanPrototype::getOwnPropertyDescriptor):
2986         * runtime/BooleanPrototype.h:
2987         (JSC::BooleanPrototype::createStructure):
2988         * runtime/DateConstructor.cpp:
2989         (JSC::DateConstructor::DateConstructor):
2990         (JSC::DateConstructor::getOwnPropertySlot):
2991         (JSC::DateConstructor::getOwnPropertyDescriptor):
2992         * runtime/DateConstructor.h:
2993         (JSC::DateConstructor::createStructure):
2994         * runtime/ErrorPrototype.cpp:
2995         (JSC::ErrorPrototype::ErrorPrototype):
2996         (JSC::ErrorPrototype::getOwnPropertySlot):
2997         (JSC::ErrorPrototype::getOwnPropertyDescriptor):
2998         * runtime/ErrorPrototype.h:
2999         (JSC::ErrorPrototype::createStructure): Standardized these objects
3000         to use static tables for function properties.
3001
3002         * runtime/JSGlobalData.cpp:
3003         (JSC::JSGlobalData::JSGlobalData):
3004         (JSC::JSGlobalData::~JSGlobalData):
3005         * runtime/JSGlobalData.h: Added new tables.
3006
3007         * runtime/JSGlobalObject.cpp:
3008         (JSC::JSGlobalObject::reset):
3009         (JSC::JSGlobalObject::addStaticGlobals):
3010         (JSC::JSGlobalObject::getOwnPropertySlot):
3011         (JSC::JSGlobalObject::getOwnPropertyDescriptor):
3012         * runtime/JSGlobalObject.h:
3013         * runtime/JSGlobalObjectFunctions.cpp:
3014         * runtime/JSGlobalObjectFunctions.h: Changed JSGlobalObject to use a
3015         static table for its global functions. This required uninlining some
3016         things to avoid a circular header dependency. However, those things
3017         probably shouldn't have been inlined in the first place.
3018         
3019         Even more global object properties can be made lazy, but that requires
3020         more in-depth changes.
3021
3022         * runtime/MathObject.cpp:
3023         * runtime/NumberConstructor.cpp:
3024         (JSC::NumberConstructor::getOwnPropertySlot):
3025         (JSC::NumberConstructor::getOwnPropertyDescriptor):
3026         * runtime/NumberPrototype.cpp:
3027         (JSC::NumberPrototype::NumberPrototype):
3028         (JSC::NumberPrototype::getOwnPropertySlot):
3029         (JSC::NumberPrototype::getOwnPropertyDescriptor):
3030         * runtime/NumberPrototype.h:
3031         (JSC::NumberPrototype::createStructure):
3032         * runtime/ObjectPrototype.cpp:
3033         (JSC::ObjectPrototype::ObjectPrototype):
3034         (JSC::ObjectPrototype::put):
3035         (JSC::ObjectPrototype::getOwnPropertySlot):
3036         (JSC::ObjectPrototype::getOwnPropertyDescriptor):
3037         * runtime/ObjectPrototype.h:
3038         (JSC::ObjectPrototype::createStructure):
3039         * runtime/RegExpPrototype.cpp:
3040         (JSC::RegExpPrototype::RegExpPrototype):
3041         (JSC::RegExpPrototype::getOwnPropertySlot):
3042         (JSC::RegExpPrototype::getOwnPropertyDescriptor):
3043         * runtime/RegExpPrototype.h:
3044         (JSC::RegExpPrototype::createStructure):
3045         * runtime/StringConstructor.cpp:
3046         (JSC::StringConstructor::StringConstructor):
3047         (JSC::StringConstructor::getOwnPropertySlot):
3048         (JSC::StringConstructor::getOwnPropertyDescriptor):
3049         * runtime/StringConstructor.h:
3050         (JSC::StringConstructor::createStructure): Standardized these objects
3051         to use static tables for function properties.
3052
3053 2011-05-17  Sam Weinig  <sam@webkit.org>
3054
3055         Reviewed by Oliver Hunt.
3056
3057         JSGlobalContextRelease should not trigger a synchronous garbage collection
3058         https://bugs.webkit.org/show_bug.cgi?id=60990
3059
3060         * API/JSContextRef.cpp:
3061         Change synchronous call to collectAllGarbage to a call to trigger the
3062         activityCallback.
3063
3064 2011-05-16  Oliver Hunt  <oliver@apple.com>
3065
3066         Reviewed by Gavin Barraclough.
3067
3068         Reduce code size for inline cache
3069         https://bugs.webkit.org/show_bug.cgi?id=60942
3070
3071         This patch introduces the concept of a "compact" address that
3072         allows individual architectures to control the maximum offset
3073         used for the inline path of get_by_id.  This reduces the code
3074         size of get_by_id by 3 bytes on x86 and x86_64 and slightly
3075         improves performance on v8 tests.
3076
3077         * assembler/ARMAssembler.h:
3078         (JSC::ARMAssembler::repatchCompact):
3079         * assembler/ARMv7Assembler.h:
3080         (JSC::ARMv7Assembler::repatchCompact):
3081         * assembler/AbstractMacroAssembler.h:
3082         (JSC::AbstractMacroAssembler::DataLabelCompact::DataLabelCompact):
3083         (JSC::AbstractMacroAssembler::differenceBetween):
3084         (JSC::AbstractMacroAssembler::repatchCompact):
3085         * assembler/CodeLocation.h:
3086         (JSC::CodeLocationDataLabelCompact::CodeLocationDataLabelCompact):
3087         (JSC::CodeLocationCommon::dataLabelCompactAtOffset):
3088         * assembler/LinkBuffer.h:
3089         (JSC::LinkBuffer::locationOf):
3090         * assembler/MIPSAssembler.h:
3091         (JSC::MIPSAssembler::repatchCompact):
3092         * assembler/MacroAssembler.h:
3093         (JSC::MacroAssembler::loadPtrWithCompactAddressOffsetPatch):
3094         * assembler/MacroAssemblerARM.h:
3095         (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
3096         * assembler/MacroAssemblerARMv7.h:
3097         (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
3098         * assembler/MacroAssemblerMIPS.h:
3099         (JSC::MacroAssemblerMIPS::load32WithCompactAddressOffsetPatch):
3100         * assembler/MacroAssemblerSH4.h:
3101         (JSC::MacroAssemblerSH4::load32WithAddressOffsetPatch):
3102         * assembler/MacroAssemblerX86.h:
3103         (JSC::MacroAssemblerX86::repatchCompact):
3104         * assembler/MacroAssemblerX86Common.h:
3105         (JSC::MacroAssemblerX86Common::loadCompactWithAddressOffsetPatch):
3106         * assembler/MacroAssemblerX86_64.h:
3107         (JSC::MacroAssemblerX86_64::loadPtrWithCompactAddressOffsetPatch):
3108         * assembler/RepatchBuffer.h:
3109         (JSC::RepatchBuffer::repatch):
3110         * assembler/SH4Assembler.h:
3111         (JSC::SH4Assembler::repatchCompact):
3112         * assembler/X86Assembler.h:
3113         (JSC::X86Assembler::movl_mr_disp8):
3114         (JSC::X86Assembler::movq_mr_disp8):
3115         (JSC::X86Assembler::repatchCompact):
3116         (JSC::X86Assembler::setInt8):
3117         (JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp8):
3118         (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp8):
3119         (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
3120         * jit/JIT.h:
3121         * jit/JITPropertyAccess.cpp:
3122         (JSC::JIT::compileGetByIdHotPath):
3123         (JSC::JIT::emit_op_put_by_id):
3124         (JSC::JIT::patchGetByIdSelf):
3125         * jit/JITPropertyAccess32_64.cpp:
3126         (JSC::JIT::compileGetByIdHotPath):
3127         (JSC::JIT::emit_op_put_by_id):
3128         (JSC::JIT::patchGetByIdSelf):
3129         * jit/JITStubs.cpp:
3130         (JSC::JITThunks::tryCacheGetByID):
3131
3132 2011-05-16  Sheriff Bot  <webkit.review.bot@gmail.com>
3133
3134         Unreviewed, rolling out r86653.
3135         http://trac.webkit.org/changeset/86653
3136         https://bugs.webkit.org/show_bug.cgi?id=60944
3137
3138         "Caused regressions on Windows, OSX and EFL" (Requested by
3139         yutak on #webkit).
3140
3141         * DerivedSources.make:
3142         * DerivedSources.pro:
3143         * GNUmakefile.am:
3144         * GNUmakefile.list.am:
3145         * JavaScriptCore.exp:
3146         * JavaScriptCore.gypi:
3147         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3148         * create_hash_table:
3149         * heap/Heap.cpp:
3150         (JSC::TypeCounter::operator()):
3151         * interpreter/CallFrame.h:
3152         (JSC::ExecState::arrayTable):
3153         (JSC::ExecState::numberTable):
3154         * runtime/ArrayConstructor.cpp:
3155         (JSC::ArrayConstructor::ArrayConstructor):
3156         * runtime/ArrayConstructor.h:
3157         * runtime/ArrayPrototype.cpp:
3158         (JSC::ArrayPrototype::getOwnPropertySlot):
3159         (JSC::ArrayPrototype::getOwnPropertyDescriptor):
3160         * runtime/ArrayPrototype.h:
3161         * runtime/BooleanPrototype.cpp:
3162         (JSC::BooleanPrototype::BooleanPrototype):
3163         * runtime/BooleanPrototype.h:
3164         * runtime/DateConstructor.cpp:
3165         (JSC::DateConstructor::DateConstructor):
3166         * runtime/DateConstructor.h:
3167         * runtime/ErrorPrototype.cpp:
3168         (JSC::ErrorPrototype::ErrorPrototype):
3169         * runtime/ErrorPrototype.h:
3170         * runtime/JSGlobalData.cpp:
3171         (JSC::JSGlobalData::JSGlobalData):
3172         (JSC::JSGlobalData::~JSGlobalData):
3173         * runtime/JSGlobalData.h:
3174         * runtime/JSGlobalObject.cpp:
3175         (JSC::JSGlobalObject::reset):
3176         * runtime/JSGlobalObject.h:
3177         (JSC::JSGlobalObject::addStaticGlobals):
3178         (JSC::JSGlobalObject::getOwnPropertySlot):
3179         (JSC::JSGlobalObject::getOwnPropertyDescriptor):
3180         * runtime/JSGlobalObjectFunctions.cpp:
3181         (JSC::globalFuncJSCPrint):
3182         * runtime/JSGlobalObjectFunctions.h:
3183         * runtime/MathObject.cpp:
3184         * runtime/NumberConstructor.cpp:
3185         (JSC::NumberConstructor::getOwnPropertySlot):
3186         (JSC::NumberConstructor::getOwnPropertyDescriptor):
3187         * runtime/NumberPrototype.cpp:
3188         (JSC::NumberPrototype::NumberPrototype):
3189         * runtime/NumberPrototype.h:
3190         * runtime/ObjectPrototype.cpp:
3191         (JSC::ObjectPrototype::ObjectPrototype):
3192         (JSC::ObjectPrototype::put):
3193         (JSC::ObjectPrototype::getOwnPropertySlot):
3194         * runtime/ObjectPrototype.h:
3195         * runtime/RegExpPrototype.cpp:
3196         (JSC::RegExpPrototype::RegExpPrototype):
3197         * runtime/RegExpPrototype.h:
3198         * runtime/StringConstructor.cpp:
3199         (JSC::StringConstructor::StringConstructor):
3200         * runtime/StringConstructor.h:
3201
3202 2011-05-16  Geoffrey Garen  <ggaren@apple.com>
3203
3204         Reviewed by Geoffrey Garen.
3205
3206         Global object initialization is expensive
3207         https://bugs.webkit.org/show_bug.cgi?id=60933
3208         
3209         Changed a bunch of globals to allocate their properties lazily, and changed
3210         the global object to allocate a bunch of its globals lazily.
3211         
3212         This reduces the footprint of a global object from 287 objects with 58
3213         functions for 24K to 173 objects with 20 functions for 15K.
3214
3215         Large patch, but it's all mechanical.
3216
3217         * DerivedSources.make:
3218         * JavaScriptCore.exp: Build!
3219
3220         * create_hash_table: Added a special case for fromCharCode, since it uses
3221         a custom "thunk generator".
3222
3223         * heap/Heap.cpp:
3224         (JSC::TypeCounter::operator()): Fixed a bug where the type counter would
3225         overcount objects that were owned through more than one mechanism because
3226         it was getting in the way of counting the results for this patch.
3227
3228         * interpreter/CallFrame.h:
3229         (JSC::ExecState::arrayConstructorTable):
3230         (JSC::ExecState::arrayPrototypeTable):
3231         (JSC::ExecState::booleanPrototypeTable):
3232         (JSC::ExecState::dateConstructorTable):
3233         (JSC::ExecState::errorPrototypeTable):
3234         (JSC::ExecState::globalObjectTable):
3235         (JSC::ExecState::numberConstructorTable):
3236         (JSC::ExecState::numberPrototypeTable):
3237         (JSC::ExecState::objectPrototypeTable):
3238         (JSC::ExecState::regExpPrototypeTable):
3239         (JSC::ExecState::stringConstructorTable): Added new tables.
3240
3241         * runtime/ArrayConstructor.cpp:
3242         (JSC::ArrayConstructor::ArrayConstructor):
3243         (JSC::ArrayConstructor::getOwnPropertySlot):
3244         (JSC::ArrayConstructor::getOwnPropertyDescriptor):
3245         * runtime/ArrayConstructor.h:
3246         (JSC::ArrayConstructor::createStructure):
3247         * runtime/ArrayPrototype.cpp:
3248         (JSC::ArrayPrototype::getOwnPropertySlot):
3249         (JSC::ArrayPrototype::getOwnPropertyDescriptor):
3250         * runtime/ArrayPrototype.h:
3251         * runtime/BooleanPrototype.cpp:
3252         (JSC::BooleanPrototype::BooleanPrototype):
3253         (JSC::BooleanPrototype::getOwnPropertySlot):
3254         (JSC::BooleanPrototype::getOwnPropertyDescriptor):
3255         * runtime/BooleanPrototype.h:
3256         (JSC::BooleanPrototype::createStructure):
3257         * runtime/DateConstructor.cpp:
3258         (JSC::DateConstructor::DateConstructor):
3259         (JSC::DateConstructor::getOwnPropertySlot):
3260         (JSC::DateConstructor::getOwnPropertyDescriptor):
3261         * runtime/DateConstructor.h:
3262         (JSC::DateConstructor::createStructure):
3263         * runtime/ErrorPrototype.cpp:
3264         (JSC::ErrorPrototype::ErrorPrototype):
3265         (JSC::ErrorPrototype::getOwnPropertySlot):
3266         (JSC::ErrorPrototype::getOwnPropertyDescriptor):
3267         * runtime/ErrorPrototype.h:
3268         (JSC::ErrorPrototype::createStructure): Standardized these objects
3269         to use static tables for function properties.
3270
3271         * runtime/JSGlobalData.cpp:
3272         (JSC::JSGlobalData::JSGlobalData):
3273         (JSC::JSGlobalData::~JSGlobalData):
3274         * runtime/JSGlobalData.h: Added new tables.
3275
3276         * runtime/JSGlobalObject.cpp:
3277         (JSC::JSGlobalObject::reset):
3278         (JSC::JSGlobalObject::addStaticGlobals):
3279         (JSC::JSGlobalObject::getOwnPropertySlot):
3280         (JSC::JSGlobalObject::getOwnPropertyDescriptor):
3281         * runtime/JSGlobalObject.h:
3282         * runtime/JSGlobalObjectFunctions.cpp:
3283         * runtime/JSGlobalObjectFunctions.h: Changed JSGlobalObject to use a
3284         static table for its global functions. This required uninlining some
3285         things to avoid a circular header dependency. However, those things
3286         probably shouldn't have been inlined in the first place.
3287         
3288         Even more global object properties can be made lazy, but that requires
3289         more in-depth changes.
3290
3291         * runtime/MathObject.cpp:
3292         * runtime/NumberConstructor.cpp:
3293         (JSC::NumberConstructor::getOwnPropertySlot):
3294         (JSC::NumberConstructor::getOwnPropertyDescriptor):
3295         * runtime/NumberPrototype.cpp:
3296         (JSC::NumberPrototype::NumberPrototype):
3297         (JSC::NumberPrototype::getOwnPropertySlot):
3298         (JSC::NumberPrototype::getOwnPropertyDescriptor):
3299         * runtime/NumberPrototype.h:
3300         (JSC::NumberPrototype::createStructure):
3301         * runtime/ObjectPrototype.cpp:
3302         (JSC::ObjectPrototype::ObjectPrototype):
3303         (JSC::ObjectPrototype::put):
3304         (JSC::ObjectPrototype::getOwnPropertySlot):
3305         (JSC::ObjectPrototype::getOwnPropertyDescriptor):
3306         * runtime/ObjectPrototype.h:
3307         (JSC::ObjectPrototype::createStructure):
3308         * runtime/RegExpPrototype.cpp:
3309         (JSC::RegExpPrototype::RegExpPrototype):
3310         (JSC::RegExpPrototype::getOwnPropertySlot):
3311         (JSC::RegExpPrototype::getOwnPropertyDescriptor):
3312         * runtime/RegExpPrototype.h:
3313         (JSC::RegExpPrototype::createStructure):
3314         * runtime/StringConstructor.cpp:
3315         (JSC::StringConstructor::StringConstructor):
3316         (JSC::StringConstructor::getOwnPropertySlot):
3317         (JSC::StringConstructor::getOwnPropertyDescriptor):
3318         * runtime/StringConstructor.h:
3319         (JSC::StringConstructor::createStructure): Standardized these objects
3320         to use static tables for function properties.
3321
3322 2011-05-16  David Kilzer  <ddkilzer@apple.com>
3323
3324         <http://webkit.org/b/60913> C++ exceptions should not be enabled when building with llvm-gcc-4.2
3325         <rdar://problem/9446430>
3326
3327         Reviewed by Mark Rowe.
3328
3329         * Configurations/Base.xcconfig: Fixed typo.
3330
3331 2011-05-16  Oliver Hunt  <oliver@apple.com>
3332
3333         Reviewed by Geoffrey Garen.
3334
3335         JSWeakObjectMap finalisation may occur while gc is in inconsistent state
3336         https://bugs.webkit.org/show_bug.cgi?id=60908
3337         <rdar://problem/9409491>
3338
3339         We need to ensure that we have called all the weak map finalizers while
3340         the global object (and hence global context) is still in a consistent
3341         state.  The best way to achieve this is to simply use a weak handle and
3342         finalizer on the global object.
3343
3344         * JavaScriptCore.exp:
3345         * runtime/JSGlobalObject.cpp:
3346         (JSC::JSGlobalObject::WeakMapFinalizer::finalize):
3347         * runtime/JSGlobalObject.h:
3348         (JSC::JSGlobalObject::registerWeakMap):
3349
3350 2011-05-16  Siddharth Mathur  <siddharth.mathur@nokia.com>
3351
3352         Reviewed by Laszlo Gombos.
3353
3354         [Qt][WK2][Symbian] Shared memory implementation for Symbian
3355         https://bugs.webkit.org/show_bug.cgi?id=55875
3356
3357         * wtf/Platform.h: Exclude Symbian OS from USE(UNIX_DOMAIN_SOCKETS) users
3358
3359 2011-05-16  Gavin Barraclough  <barraclough@apple.com>
3360
3361         Rubber stamped by Geoff Garen.
3362
3363         https://bugs.webkit.org/show_bug.cgi?id=60866
3364         Evaluation order broken for empty alternatives in subpatterns
3365
3366         Reverting https://bugs.webkit.org/show_bug.cgi?id=51395
3367
3368         * yarr/YarrPattern.cpp:
3369         (JSC::Yarr::YarrPatternConstructor::atomParenthesesEnd):
3370
3371 2011-05-15  Gavin Barraclough  <barraclough@apple.com>
3372
3373         Reviewed by Geoff Garen & Michael Saboff.
3374
3375         https://bugs.webkit.org/show_bug.cgi?id=60860
3376         Simplify backtracking in YARR JIT
3377
3378         YARR JIT currently performs a single pass of code generation over the pattern,
3379         with special handling to allow the code generation for some backtracking code
3380         out of line. We can simplify things by moving to a common mechanism whereby all
3381         forwards matching code is generated in one pass, and all backtracking code is
3382         generated in another. Backtracking code can be generated in reverse order, to
3383         optimized the common fall-through case.
3384
3385         To make it easier to walk over the pattern, we can first convert to a more
3386         byte-code like format before JIT generating. In time we should unify this with
3387         the YARR interpreter to more closely unify the two.
3388
3389         * yarr/YarrJIT.cpp:
3390         (JSC::Yarr::YarrGenerator::jumpIfNoAvailableInput):
3391         (JSC::Yarr::YarrGenerator::YarrOp::YarrOp):
3392         (JSC::Yarr::YarrGenerator::BacktrackingState::BacktrackingState):
3393         (JSC::Yarr::YarrGenerator::BacktrackingState::append):
3394         (JSC::Yarr::YarrGenerator::BacktrackingState::fallthrough):
3395         (JSC::Yarr::YarrGenerator::BacktrackingState::link):
3396         (JSC::Yarr::YarrGenerator::BacktrackingState::linkTo):
3397         (JSC::Yarr::YarrGenerator::BacktrackingState::takeBacktracksToJumpList):
3398         (JSC::Yarr::YarrGenerator::BacktrackingState::isEmpty):
3399         (JSC::Yarr::YarrGenerator::BacktrackingState::linkDataLabels):
3400         (JSC::Yarr::YarrGenerator::BacktrackingState::ReturnAddressRecord::ReturnAddressRecord):
3401         (JSC::Yarr::YarrGenerator::generateAssertionBOL):
3402         (JSC::Yarr::YarrGenerator::backtrackAssertionBOL):
3403         (JSC::Yarr::YarrGenerator::generateAssertionEOL):
3404         (JSC::Yarr::YarrGenerator::backtrackAssertionEOL):
3405         (JSC::Yarr::YarrGenerator::matchAssertionWordchar):
3406         (JSC::Yarr::YarrGenerator::generateAssertionWordBoundary):
3407         (JSC::Yarr::YarrGenerator::backtrackAssertionWordBoundary):
3408         (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):
3409         (JSC::Yarr::YarrGenerator::backtrackPatternCharacterOnce):
3410         (JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
3411         (JSC::Yarr::YarrGenerator::backtrackPatternCharacterFixed):
3412         (JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
3413         (JSC::Yarr::YarrGenerator::backtrackPatternCharacterGreedy):
3414         (JSC::Yarr::YarrGenerator::generatePatternCharacterNonGreedy):
3415         (JSC::Yarr::YarrGenerator::backtrackPatternCharacterNonGreedy):
3416         (JSC::Yarr::YarrGenerator::generateCharacterClassOnce):
3417         (JSC::Yarr::YarrGenerator::backtrackCharacterClassOnce):
3418         (JSC::Yarr::YarrGenerator::generateCharacterClassFixed):
3419         (JSC::Yarr::YarrGenerator::backtrackCharacterClassFixed):
3420         (JSC::Yarr::YarrGenerator::generateCharacterClassGreedy):
3421         (JSC::Yarr::YarrGenerator::backtrackCharacterClassGreedy):
3422         (JSC::Yarr::YarrGenerator::generateCharacterClassNonGreedy):
3423         (JSC::Yarr::YarrGenerator::backtrackCharacterClassNonGreedy):
3424         (JSC::Yarr::YarrGenerator::generateTerm):
3425         (JSC::Yarr::YarrGenerator::backtrackTerm):
3426         (JSC::Yarr::YarrGenerator::generate):
3427         (JSC::Yarr::YarrGenerator::backtrack):
3428         (JSC::Yarr::YarrGenerator::opCompileParenthesesSubpattern):
3429         (JSC::Yarr::YarrGenerator::opCompileParentheticalAssertion):
3430         (JSC::Yarr::YarrGenerator::opCompileAlternative):
3431         (JSC::Yarr::YarrGenerator::opCompileBody):
3432         (JSC::Yarr::YarrGenerator::YarrGenerator):
3433         (JSC::Yarr::YarrGenerator::compile):
3434
3435 2011-05-15  Adam Barth  <abarth@webkit.org>
3436
3437         Enable strict PassOwnPtr on Qt.  (Build fixes to follow.)
3438
3439         * wtf/PassOwnPtr.h:
3440
3441 2011-05-15  Geoffrey Garen  <ggaren@apple.com>
3442
3443         Reviewed by Maciej Stachowiak.
3444
3445         Partial fix for <rdar://problem/9417875> REGRESSION: SunSpider ~17% slower
3446         in browser than on command line
3447         
3448         This patch fixes a few issues in generated code that could unreasonably
3449         prolong object lifetimes.
3450
3451         * heap/Heap.cpp:
3452         (JSC::Heap::collectAllGarbage): Throw away all function code before doing
3453         a major collection. We want to clear polymorphic caches, since they can
3454         keep alive large object graphs that have gone "stale". For the same reason,
3455         but to a lesser extent, we also want to clear linked functions and other
3456         one-off caches.
3457
3458         This has the side-benefit of reducing memory footprint from run-once
3459         functions, and of allowing predictions and caches that have failed to
3460         re-specialize.
3461
3462         Eventually, if compilation costs rise far enough, we may want a more
3463         limited strategy for de-specializing code without throwing it away
3464         completely, but this works for now, and it's the simplest solution.
3465
3466         * jit/JITStubs.cpp:
3467         (JSC::JITThunks::hostFunctionStub):
3468         * jit/JITStubs.h:
3469         * runtime/JSFunction.cpp: Made the host function stub cache weak --
3470         otherwise it's effectively a memory leak that can seriously fragment the
3471         GC and JIT heaps.
3472
3473         (JSC::JSFunction::JSFunction):
3474         (JSC::JSFunction::visitChildren): Cleared up some comments that confused
3475         me when working with this code.
3476
3477 2011-05-13  Oliver Hunt  <oliver@apple.com>
3478
3479         Reviewed by Geoffrey Garen.
3480
3481         Make GC validation more aggressive
3482         https://bugs.webkit.org/show_bug.cgi?id=60802
3483
3484         This patch makes the checks performed under GC_VALIDATION
3485         much more aggressive, and adds the checks to more places
3486         in order to allow us to catch GC bugs much closer to the
3487         point of failure.
3488
3489         * JavaScriptCore.exp:
3490         * JavaScriptCore.xcodeproj/project.pbxproj:
3491         * debugger/DebuggerActivation.cpp:
3492         (JSC::DebuggerActivation::visitChildren):
3493         * heap/MarkedBlock.cpp:
3494         (JSC::MarkedBlock::MarkedBlock):
3495         * heap/MarkedSpace.cpp: