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