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