eefcf40d2966a368784115ab7e28d6d57e754a46
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2010-07-13  Gavin Barraclough  <barraclough@apple.com>
2
3         Reviewed by Oliver Hunt.
4
5         Bug 42182 - Change how numeric compare functions are detected
6
7         There are three problems with the current mechanism:
8           * It requires that a function executable be bytecode compiled without
9             being JIT generated (in order to copy the bytecode from the numeric
10             compare function).  This is a problem since we have an invariant when
11             running with the JIT that functions are never bytecode compiled without
12             also being JIT generated (after checking the codeblock we assume the
13             function has JIT code).  To help maintain this invariant 
14           * This implementation will prevent us from experimenting with alternate
15             compilation paths which do not compile via bytecode.
16           * It doesn't work.  Functions passing more than two arguments will match
17             if they are comparing their last two arguments, not the first two.
18             Generally the mapping back from bytecode to semantics may be more
19             complex then initially expected.
20
21         * bytecompiler/BytecodeGenerator.cpp:
22         (JSC::BytecodeGenerator::generate):
23         (JSC::BytecodeGenerator::setIsNumericCompareFunction):
24         (JSC::BytecodeGenerator::argumentNumberFor):
25         * bytecompiler/BytecodeGenerator.h:
26         * bytecompiler/NodesCodegen.cpp:
27         (JSC::BlockNode::singleStatement):
28         (JSC::FunctionBodyNode::emitBytecode):
29         * parser/Nodes.h:
30         (JSC::ExpressionNode::isSubtract):
31         (JSC::BinaryOpNode::lhs):
32         (JSC::BinaryOpNode::rhs):
33         (JSC::SubNode::isSubtract):
34         (JSC::ReturnNode::value):
35         * runtime/JSGlobalData.cpp:
36         (JSC::JSGlobalData::JSGlobalData):
37         * runtime/JSGlobalData.h:
38
39 2010-07-12  Oliver Hunt  <oliver@apple.com>
40
41         Reviewed by Gavin Barraclough.
42
43         REGRESSION: Crash at JSC::JIT::privateCompile(JSC::MacroAssemblerCodePtr*)
44         https://bugs.webkit.org/show_bug.cgi?id=41763
45
46         There are two parts to this patch, the first is to fix the actual
47         problem.  When calling copyStringWithoutBOMs on a string we know
48         to contain BOMs we return a value indicating that there are no
49         BOMs.
50
51         The second part of this fix is simply to harden the path that
52         led to a crash when parsing failed.
53
54         * jit/JITOpcodes.cpp:
55         (JSC::JIT::privateCompileCTIMachineTrampolines):
56         * jit/JITOpcodes32_64.cpp:
57         (JSC::JIT::privateCompileCTIMachineTrampolines):
58         * jit/JITStubs.cpp:
59         (JSC::DEFINE_STUB_FUNCTION):
60            Harden compilation stubs against parser failure.
61         * parser/Lexer.cpp:
62         (JSC::Lexer::sourceCode):
63            Add assertions to ensure that subranges into a source provider
64            are always actually braces.  Hopefully this should catch similar
65            failures in future.  These assertions fire on existing tests
66            without this fix.
67         * runtime/Executable.h:
68         (JSC::FunctionExecutable::tryJitCodeForCall):
69         (JSC::FunctionExecutable::tryJitCodeForConstruct):
70         * wtf/text/StringImpl.h:
71         (WebCore::StringImpl::copyStringWithoutBOMs):
72            Make copyStringWithBOMs do the right thing.
73
74 2010-07-13  Gabor Loki  <loki@webkit.org>
75
76         Reviewed by Gavin Barraclough.
77
78         Fix the constant encoding in data transfer instructions on ARM
79         https://bugs.webkit.org/show_bug.cgi?id=42166
80
81         The getImm function is designed to produce modified immediate constant
82         for data processing instructions. It should not be used to encode
83         any constant for data transfer. In the current situation there is no
84         way to use any immediate constant for data transfer. So, the moveImm
85         function is the desired method to pass the offset value to the data
86         transfer instructions.
87
88         Reported by Jacob Bramley.
89
90         * assembler/ARMAssembler.cpp:
91         (JSC::ARMAssembler::dataTransfer32):
92         * assembler/MacroAssemblerARM.h:
93         (JSC::MacroAssemblerARM::call32):
94
95 2010-07-09  Darin Adler  <darin@apple.com>
96
97         Reviewed by Geoffrey Garen.
98
99         String to number coercion is not spec compliant
100         https://bugs.webkit.org/show_bug.cgi?id=31349
101
102         ToNumber should ignore NBSP (\u00a0)
103         https://bugs.webkit.org/show_bug.cgi?id=25490
104
105         * runtime/JSGlobalObjectFunctions.cpp:
106         (JSC::parseIntOverflow): Added a version that works on UChar.
107         * runtime/JSGlobalObjectFunctions.h: Ditto.
108
109         * runtime/UString.cpp:
110         (JSC::isInfinity): Added helper functions.
111         (JSC::UString::toDouble): Use isStrWhiteSpace instead of
112         isSASCIISpace to define what we should skip. Got rid of the
113         code that used CString and UTF8String, instead processing the
114         UChar of the string directly, except for when we call strtod.
115         For strtod, use our own home-grown conversion function that
116         does not try to do any UTF-16 processing. Tidied up the logic
117         a bit as well.
118
119 2010-07-12  Martin Robinson  <mrobinson@igalia.com>
120
121         Reviewed by Xan Lopez.
122
123         [GTK] make dist is broken because of missing headers and other miscellaneous reasons
124         https://bugs.webkit.org/show_bug.cgi?id=42107
125
126         * GNUmakefile.am: Add missing header to the sources list.
127
128 2010-07-12  Adam Roben  <aroben@apple.com>
129
130         Stop generating stripped symbols for Release builds
131
132         It turns out we can strip the symbols after-the-fact using PDBCopy.
133
134         Fixes <http://webkit.org/b/42085>.
135
136         Reviewed by Steve Falkenburg.
137
138         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
139         Removed the pre-link event, which just created the public\sym
140         directory.
141
142 2010-07-12  Anders Carlsson  <andersca@apple.com>
143
144         Reviewed by Dan Bernstein.
145
146         Add WARN_UNUSED_RETURN to the smart pointer "leak" member functions
147         https://bugs.webkit.org/show_bug.cgi?id=42086
148
149         * wtf/OwnPtr.h:
150         * wtf/PassOwnPtr.h:
151         * wtf/PassRefPtr.h:
152         (WTF::PassRefPtr::releaseRef):
153         (WTF::NonNullPassRefPtr::leakRef):
154         (WTF::NonNullPassRefPtr::releaseRef):
155         * wtf/RetainPtr.h:
156         (WTF::RetainPtr::releaseRef):
157
158 2010-07-10  Oliver Hunt  <oliver@apple.com>
159
160         Reviewed by Maciej Stachowiak.
161
162         HAVE_COMPUTED_GOTO is dependent on the interpreter being enabled
163         https://bugs.webkit.org/show_bug.cgi?id=42039
164
165         Separate the existence of computed goto support in the compiler
166         from whether or not we are using the interpreter.  All the current
167         HAVE(COMPUTED_GOTO) guards are for the interpreter, but I'd like
168         the option of using it elsewhere.  The interpreter now uses
169         ENABLE(COMPUTED_GOTO_INTERPRETER) 
170
171         * bytecode/Instruction.h:
172         (JSC::Instruction::Instruction):
173         * bytecode/Opcode.h:
174         * interpreter/Interpreter.cpp:
175         (JSC::Interpreter::Interpreter):
176         (JSC::Interpreter::isOpcode):
177         (JSC::Interpreter::privateExecute):
178         * interpreter/Interpreter.h:
179         (JSC::Interpreter::getOpcode):
180         (JSC::Interpreter::getOpcodeID):
181         * wtf/Platform.h:
182
183 2010-07-10  Oliver Hunt  <oliver@apple.com>
184
185         Reviewed by Gavin Barraclough.
186
187         Remove switches from inner expression loops in the parser
188         https://bugs.webkit.org/show_bug.cgi?id=42035
189
190         Use bitmasks and flags on the token types to identify unary and
191         binary operators, rather than switching on the token type to
192         identify them.
193
194         * parser/JSParser.cpp:
195         (JSC::isUnaryOp):
196         (JSC::JSParser::isBinaryOperator):
197         * parser/JSParser.h:
198         (JSC::):
199
200 2010-07-09  Leon Clarke  <leonclarke@google.com>
201
202         Reviewed by Adam Barth.
203
204         add support for link prefetching
205         https://bugs.webkit.org/show_bug.cgi?id=3652
206
207         * Configurations/FeatureDefines.xcconfig:
208
209 2010-07-09  Oliver Hunt  <oliver@apple.com>
210
211         Reviewed by Darin Adler.
212
213         Tidy up lexer token ids
214         https://bugs.webkit.org/show_bug.cgi?id=42014
215
216         Stop using character literals to identify single character tokens
217         and instead use symbolic names for all tokens.
218
219         * parser/ASTBuilder.h:
220         (JSC::ASTBuilder::makeBinaryNode):
221         * parser/JSParser.cpp:
222         (JSC::JSParser::consume):
223         (JSC::JSParser::match):
224         (JSC::JSParser::autoSemiColon):
225         (JSC::JSParser::JSParser):
226         (JSC::JSParser::parseProgram):
227         (JSC::JSParser::allowAutomaticSemicolon):
228         (JSC::JSParser::parseDoWhileStatement):
229         (JSC::JSParser::parseWhileStatement):
230         (JSC::JSParser::parseVarDeclarationList):
231         (JSC::JSParser::parseConstDeclarationList):
232         (JSC::JSParser::parseForStatement):
233         (JSC::JSParser::parseReturnStatement):
234         (JSC::JSParser::parseWithStatement):
235         (JSC::JSParser::parseSwitchStatement):
236         (JSC::JSParser::parseSwitchClauses):
237         (JSC::JSParser::parseSwitchDefaultClause):
238         (JSC::JSParser::parseTryStatement):
239         (JSC::JSParser::parseDebuggerStatement):
240         (JSC::JSParser::parseStatement):
241         (JSC::JSParser::parseFormalParameters):
242         (JSC::JSParser::parseFunctionInfo):
243         (JSC::JSParser::parseExpressionOrLabelStatement):
244         (JSC::JSParser::parseIfStatement):
245         (JSC::JSParser::parseExpression):
246         (JSC::JSParser::parseAssignmentExpression):
247         (JSC::JSParser::parseConditionalExpression):
248         (JSC::isUnaryOp):
249         (JSC::JSParser::isBinaryOperator):
250         (JSC::JSParser::parseBinaryExpression):
251         (JSC::JSParser::parseProperty):
252         (JSC::JSParser::parseObjectLiteral):
253         (JSC::JSParser::parseStrictObjectLiteral):
254         (JSC::JSParser::parseArrayLiteral):
255         (JSC::JSParser::parsePrimaryExpression):
256         (JSC::JSParser::parseArguments):
257         (JSC::JSParser::parseMemberExpression):
258         (JSC::JSParser::parseUnaryExpression):
259         * parser/JSParser.h:
260         (JSC::):
261         * parser/Lexer.cpp:
262         (JSC::):
263         (JSC::Lexer::lex):
264         * parser/Lexer.h:
265
266 2010-07-09  Gavin Barraclough  <barraclough@apple.com>
267
268         Reviewed by Oliver Hunt.
269
270         Bug 42015 - Enable JSValue32_64 on ARMv7
271
272         * Configurations/JavaScriptCore.xcconfig:
273         * jit/JIT.h:
274         * jit/JITStubs.cpp:
275         * wtf/Platform.h:
276
277 2010-07-09  Kenneth Russell  <kbr@google.com>
278
279         Reviewed by Dimitri Glazkov.
280
281         Assertion failure in String::utf8() for certain invalid UTF16 inputs
282         https://bugs.webkit.org/show_bug.cgi?id=41983
283
284         * wtf/text/WTFString.cpp:
285         (WebCore::String::utf8):
286          - Fixed assertion when sourceExhausted is returned from convertUTF16ToUTF8.
287
288 2010-07-09  Oliver Hunt  <oliver@apple.com>
289
290         Reviewed by Geoffrey Garen.
291
292         Remove a couple of excess writes from the lexer
293         https://bugs.webkit.org/show_bug.cgi?id=41981
294
295         Remove a couple of fields from JSTokenInfo, and rename the remaining ones
296         to something more accurate
297
298         * parser/JSParser.cpp:
299         (JSC::JSParser::next):
300         (JSC::JSParser::tokenStart):
301         (JSC::JSParser::tokenLine):
302         (JSC::JSParser::tokenEnd):
303         * parser/JSParser.h:
304         (JSC::JSTokenInfo::JSTokenInfo):
305         * parser/Lexer.cpp:
306         (JSC::Lexer::lex):
307
308 2010-07-08  Oliver Hunt  <oliver@apple.com>
309
310         Reviewed by Sam Weinig.
311
312         Property declarations in an object literal should not consider the prototype chain when being added to the new object
313         https://bugs.webkit.org/show_bug.cgi?id=41929
314
315         To fix this all we need to do is ensure that all new properties are
316         added with putDirect rather than a fully generic call to put.  This
317         is safe as an object literal is by definition going to produce a
318         completely normal object.
319
320         Rather than duplicating all the put_by_id logic we add an additional
321         flag to op_put_by_id to indicate it should be using putDirect.  In
322         the interpreter this adds a runtime branch, but in the jit this is
323         essentially free as the branch is taken at compile time.  This does
324         actually improve object literal creation time even in the interpreter
325         as we no longer need to walk the prototype chain to verify that the
326         cached put is safe.
327
328         We still emit normal put_by_id code when emitting __proto__ as we want
329         to get the correct handling for changing the prototype.
330
331         Sunspider claims this is a 0.7% speedup which is conceivably real due
332         to the performance improvement in object literals, but I suspect its
333         really just the result of code motion.
334
335         * bytecode/Opcode.h:
336         * bytecompiler/BytecodeGenerator.cpp:
337         (JSC::BytecodeGenerator::emitPutById):
338         (JSC::BytecodeGenerator::emitDirectPutById):
339         * bytecompiler/BytecodeGenerator.h:
340         * bytecompiler/NodesCodegen.cpp:
341         (JSC::PropertyListNode::emitBytecode):
342         * interpreter/Interpreter.cpp:
343         (JSC::Interpreter::privateExecute):
344         * jit/JIT.h:
345         (JSC::JIT::compilePutByIdTransition):
346         * jit/JITPropertyAccess.cpp:
347         (JSC::JIT::emit_op_put_by_id):
348         (JSC::JIT::emitSlow_op_put_by_id):
349         (JSC::JIT::privateCompilePutByIdTransition):
350         (JSC::JIT::patchPutByIdReplace):
351         * jit/JITPropertyAccess32_64.cpp:
352         (JSC::JIT::emitSlow_op_put_by_id):
353         (JSC::JIT::privateCompilePutByIdTransition):
354         (JSC::JIT::patchPutByIdReplace):
355         * jit/JITStubs.cpp:
356         (JSC::JITThunks::tryCachePutByID):
357         (JSC::DEFINE_STUB_FUNCTION):
358         * jit/JITStubs.h:
359         (JSC::):
360         * runtime/JSGlobalData.cpp:
361         (JSC::JSGlobalData::JSGlobalData):
362         * runtime/JSObject.h:
363         (JSC::JSObject::putDirect):
364         (JSC::JSValue::putDirect):
365         * runtime/JSValue.h:
366
367 2010-07-08  Gavin Barraclough  <barraclough@apple.com>
368
369         Reviewed by Sam Weinig.
370
371         String.prototype methods should CheckObjectCoercible (test this is not null or undefined).
372
373         * runtime/StringPrototype.cpp:
374         (JSC::stringProtoFuncCharAt):
375         (JSC::stringProtoFuncCharCodeAt):
376         (JSC::stringProtoFuncConcat):
377         (JSC::stringProtoFuncIndexOf):
378         (JSC::stringProtoFuncLastIndexOf):
379         (JSC::stringProtoFuncMatch):
380         (JSC::stringProtoFuncSearch):
381         (JSC::stringProtoFuncSlice):
382         (JSC::stringProtoFuncSplit):
383         (JSC::stringProtoFuncSubstr):
384         (JSC::stringProtoFuncSubstring):
385         (JSC::stringProtoFuncToLowerCase):
386         (JSC::stringProtoFuncToUpperCase):
387         (JSC::stringProtoFuncLocaleCompare):
388         (JSC::trimString):
389
390 2010-07-08  Gavin Barraclough  <barraclough@apple.com>
391
392         Reviewed by Sam Weinig.
393
394         Date.prototype.toJSON takes one argument, report this correctly.
395
396         * runtime/DatePrototype.cpp:
397
398 2010-07-08  Gavin Barraclough  <barraclough@apple.com>
399
400         Reviewed by Sam Weinig.
401
402         RegExp's prototype should be an object of type RegExp.
403
404         * runtime/RegExpPrototype.cpp:
405         (JSC::RegExpPrototype::RegExpPrototype):
406         * runtime/RegExpPrototype.h:
407
408 2010-07-08  Oliver Hunt  <oliver@apple.com>
409
410         Reviewed by Gavin Barraclough.
411
412         JavaScript parser violates ECMA automatic semicolon insertion rule
413         https://bugs.webkit.org/show_bug.cgi?id=41844
414
415         Remove (very) old and bogus logic that automatically inserted a semicolon
416         at the end of a script's source.
417
418         * parser/Lexer.cpp:
419         (JSC::Lexer::lex):
420
421 2010-07-08  Oliver Hunt  <oliver@apple.com>
422
423         Reviewed by Anders Carlson.
424
425         Tidy up the lexer
426
427         Remove some of the old yacc/lex-isms still present in the lexer
428
429         * parser/JSParser.h:
430         (JSC::):
431         * parser/Lexer.cpp:
432         (JSC::Lexer::parseString):
433         (JSC::Lexer::lex):
434         * parser/Lexer.h:
435
436 2010-07-08  Oliver Hunt  <oliver@apple.com>
437
438         Reviewed by Gavin Barraclough.
439
440         Make object-literal parsing conformant with the spec.
441         https://bugs.webkit.org/show_bug.cgi?id=41892
442
443         Bring our parsing of object literals into conformance with the ES5 spec.
444         Basically disallow conflicting accessor vs. normal property definitions
445         The bulk of this patch is just fiddling to maintain performance.
446
447         * parser/ASTBuilder.h:
448         (JSC::ASTBuilder::createGetterOrSetterProperty):
449         (JSC::ASTBuilder::createProperty):
450         (JSC::ASTBuilder::getName):
451         (JSC::ASTBuilder::getType):
452         * parser/JSParser.cpp:
453         (JSC::jsParse):
454         (JSC::JSParser::JSParser):
455         (JSC::JSParser::parseProperty):
456         (JSC::JSParser::parseObjectLiteral):
457         (JSC::JSParser::parseStrictObjectLiteral):
458         * parser/JSParser.h:
459         * parser/Lexer.cpp:
460         (JSC::Lexer::clear):
461         * parser/Lexer.h:
462         (JSC::Lexer::currentOffset):
463         (JSC::Lexer::setOffset):
464           Add logic to allow us to roll the lexer back in the input stream.
465         * parser/Nodes.h:
466         (JSC::PropertyNode::):
467         (JSC::PropertyNode::type):
468         * parser/Parser.cpp:
469         (JSC::Parser::parse):
470         * parser/SourceProvider.h:
471         (JSC::SourceProvider::SourceProvider):
472         (JSC::SourceProvider::isValid):
473         (JSC::SourceProvider::setValid):
474           SourceProvider now records whether the input text
475           has already been validated.
476         * parser/SyntaxChecker.h:
477         (JSC::SyntaxChecker::SyntaxChecker):
478         (JSC::SyntaxChecker::Property::Property):
479         (JSC::SyntaxChecker::Property::operator!):
480         (JSC::SyntaxChecker::createProperty):
481         (JSC::SyntaxChecker::createPropertyList):
482         (JSC::SyntaxChecker::createGetterOrSetterProperty):
483           The SyntaxChecker mode now needs to maintain a bit more information
484           to ensure that we can validate object literals correctly.
485
486 2010-07-08  Darin Adler  <darin@apple.com>
487
488         * runtime/JSGlobalData.cpp:
489         (JSC::JSGlobalData::sharedInstance): Fix typo.
490
491 2010-07-08  Darin Adler  <darin@apple.com>
492
493         Reviewed by Oliver Hunt.
494
495         Fix assertion seen on the Leopard buildbot.
496         The single shared instance of JSGlobalData was not being
497         adopted after creation.
498
499         * runtime/JSGlobalData.cpp:
500         (JSC::JSGlobalData::sharedInstance): Do adoptRef and then leakRef.
501
502 2010-07-08  Gavin Barraclough  <barraclough@apple.com>
503
504         Reviewed by Sam Weinig.
505
506         BOMs are whitespace.
507
508         * runtime/JSGlobalObjectFunctions.cpp:
509         (JSC::isStrWhiteSpace):
510
511 2010-07-08  Martin Robinson  <mrobinson@igalia.com>
512
513         Unreviewed.
514
515         Try fix the GTK+ build by touching this file.
516
517         * jit/ExecutableAllocatorFixedVMPool.cpp:
518
519 2010-07-08  Gavin Barraclough  <barraclough@apple.com>
520
521         GTK build fix take two.
522
523         * GNUmakefile.am:
524
525 2010-07-08  Gavin Barraclough  <barraclough@apple.com>
526
527         GTK build fix.
528
529         * GNUmakefile.am:
530
531 2010-07-08  Gavin Barraclough  <barraclough@apple.com>
532
533         Reviewed by Sam Weinig.
534
535         https://bugs.webkit.org/show_bug.cgi?id=41641
536
537         Update compile flags to allow use of ExecutableAllocatorFixedVMPool on platforms
538         other than x86-64 (this may be useful on 32-bit platforms, too).
539
540         Simplify ifdefs by dividing into thwo broad allocation strategies
541         (ENABLE_EXECUTABLE_ALLOCATOR_FIXED & ENABLE_EXECUTABLE_ALLOCATOR_DEMAND).
542
543         Rename constant used in the code to have names descriptive of their purpose,
544         rather than their specific value on a given platform.
545
546         * jit/ExecutableAllocator.cpp:
547         (JSC::ExecutableAllocator::reprotectRegion):
548         (JSC::ExecutableAllocator::cacheFlush):
549         * jit/ExecutableAllocatorFixedVMPool.cpp:
550         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
551         (JSC::FixedVMPoolAllocator::free):
552         (JSC::ExecutablePool::systemAlloc):
553         * jit/ExecutableAllocatorPosix.cpp:
554         * jit/ExecutableAllocatorSymbian.cpp:
555         * jit/ExecutableAllocatorWin.cpp:
556         * wtf/Platform.h:
557
558 2010-07-08  Xan Lopez  <xlopez@igalia.com>
559
560         Reviewed by Gustavo Noronha.
561
562         Silence a few noisy build rules.
563
564         * GNUmakefile.am:
565
566 2010-07-08  Sheriff Bot  <webkit.review.bot@gmail.com>
567
568         Unreviewed, rolling out r62765.
569         http://trac.webkit.org/changeset/62765
570         https://bugs.webkit.org/show_bug.cgi?id=41840
571
572         All jscore and layout tests crash on Qt bot (Requested by Ossy
573         on #webkit).
574
575         * wtf/FastMalloc.cpp:
576         (WTF::TCMalloc_PageHeap::initializeScavenger):
577         (WTF::TCMalloc_PageHeap::signalScavenger):
578         (WTF::TCMalloc_PageHeap::scavengerThread):
579
580 2010-07-08  Andreas Kling  <andreas.kling@nokia.com>
581
582         Reviewed by Oliver Hunt.
583
584         Interpreter: Crash in op_load_varargs on 64-bit
585         https://bugs.webkit.org/show_bug.cgi?id=41795
586
587         Added missing cast of argCount to int32_t in op_load_varargs.
588
589         * interpreter/Interpreter.cpp:
590         (JSC::Interpreter::privateExecute):
591
592 2010-07-08  Patrick Gansterer  <paroga@paroga.com>
593
594         Reviewed by Geoffrey Garen.
595
596         Make FastMalloc more portable.
597         https://bugs.webkit.org/show_bug.cgi?id=41790
598
599         Use WTF::Mutex instead of pthread_mutex_t and
600         replace pthread_cond_t with WTF::ThreadCondition.
601
602         * wtf/FastMalloc.cpp:
603         (WTF::TCMalloc_PageHeap::initializeScavenger):
604         (WTF::TCMalloc_PageHeap::signalScavenger):
605         (WTF::TCMalloc_PageHeap::scavengerThread):
606
607 2010-07-08  Patrick Gansterer  <paroga@paroga.com>
608
609         Reviewed by Darin Adler.
610
611         Remove needless #include <fcntl.h> from TCSystemAlloc.cpp.
612         https://bugs.webkit.org/show_bug.cgi?id=41777
613
614         * wtf/TCSystemAlloc.cpp:
615
616 2010-07-07  Darin Adler  <darin@apple.com>
617
618         Fixed build in configurations like PowerPC.
619
620         * runtime/RegExpConstructor.cpp: Added include of PassOwnPtr.h.
621         * runtime/RegExpObject.cpp: Ditto.
622         * wtf/SizeLimits.cpp: Changed compile time assertion to work
623         even on platforms where two bool members do not end up taking
624         the same size as one int member!
625
626 2010-07-07  Oliver Hunt  <oliver@apple.com>
627
628         Reviewed by Geoffrey Garen.
629
630         Lazy mode of parser allows invalid syntax in object literals.
631         https://bugs.webkit.org/show_bug.cgi?id=41809
632
633         Make the parser itself validate getter and setter syntax rather
634         than offloading it to the AST builder.
635
636         * parser/ASTBuilder.h:
637         (JSC::ASTBuilder::createGetterOrSetterProperty):
638         * parser/JSParser.cpp:
639         (JSC::JSParser::parseProperty):
640
641 2010-07-07  Dumitru Daniliuc  <dumi@chromium.org>
642
643         Reviewed by Adam Roben.
644
645         Revert r62689.
646         https://bugs.webkit.org/show_bug.cgi?id=41804
647
648         * runtime/Collector.cpp:
649         (JSC::Heap::freeBlocks):
650
651 2010-07-07  Adam Barth  <abarth@webkit.org>
652
653         Reviewed by Sam Weinig.
654
655         Add reverseFind to Vector and deploy in HTML5 parser
656         https://bugs.webkit.org/show_bug.cgi?id=41778
657
658         This method seems generally useful.  I'm slightly surprised we don't
659         have it already.
660
661         * wtf/Vector.h:
662         (WTF::::reverseFind):
663
664 2010-07-07  Darin Adler  <darin@apple.com>
665
666         Reviewed by Adam Barth.
667
668         Turn on adoptRef assertion for RefCounted
669         https://bugs.webkit.org/show_bug.cgi?id=41547
670
671         * wtf/CrossThreadRefCounted.h: Fixed include style. Includes of other
672         WTF headers should use "" includes; consistent in most WTF headers.
673         Added a call to relaxAdoptionRequirement.
674
675         * wtf/RefCounted.h: Fixed include style. Removed LOOSE_REF_COUNTED.
676         Added relaxAdoptionRequirement.
677
678 2010-07-07  Anders Carlsson  <andersca@apple.com>
679
680         Try to fix the Windows build.
681
682         * runtime/Collector.cpp:
683         (JSC::Heap::freeBlocks):
684
685 2010-07-07  Darin Adler  <darin@apple.com>
686
687         Reviewed by Adam Barth.
688
689         More OwnPtr work
690         https://bugs.webkit.org/show_bug.cgi?id=41727
691
692         * API/JSCallbackObject.h:
693         (JSC::JSCallbackObjectData::setPrivateProperty): Use adoptPtr.
694         * API/JSCallbackObjectFunctions.h:
695         (JSC::JSCallbackObject::JSCallbackObject): Ditto.
696         * bytecode/CodeBlock.cpp:
697         (JSC::CodeBlock::CodeBlock): Ditto.
698         * bytecode/CodeBlock.h:
699         (JSC::CodeBlock::createRareDataIfNecessary): Ditto.
700         * parser/Nodes.cpp:
701         (JSC::ScopeNode::ScopeNode): Ditto.
702         * parser/ParserArena.cpp:
703         (JSC::ParserArena::ParserArena): Ditto.
704         * runtime/Arguments.h:
705         (JSC::Arguments::Arguments): Ditto.
706         * runtime/Executable.cpp:
707         (JSC::EvalExecutable::compile): Ditto.
708         (JSC::ProgramExecutable::compile): Ditto.
709         (JSC::FunctionExecutable::compileForCall): Ditto.
710         (JSC::FunctionExecutable::compileForConstruct): Ditto.
711         (JSC::FunctionExecutable::reparseExceptionInfo): Ditto.
712         (JSC::EvalExecutable::reparseExceptionInfo): Ditto.
713         * runtime/JSArray.cpp:
714         (JSC::JSArray::sort): Ditto.
715         * runtime/RegExpConstructor.cpp:
716         (JSC::RegExpConstructor::RegExpConstructor): Ditto.
717         * runtime/RegExpObject.cpp:
718         (JSC::RegExpObject::RegExpObject): Ditto.
719         * runtime/SmallStrings.cpp:
720         (JSC::SmallStrings::createSingleCharacterString): Ditto.
721         (JSC::SmallStrings::singleCharacterStringRep): Ditto.
722
723         * wtf/unicode/icu/CollatorICU.cpp:
724         (WTF::Collator::userDefault): Use adoptPtr.
725         * yarr/RegexInterpreter.cpp:
726         (JSC::Yarr::ByteCompiler::ByteCompiler): Ditto.
727         (JSC::Yarr::ByteCompiler::compile): Ditto.
728         (JSC::Yarr::ByteCompiler::regexBegin): Ditto.
729         (JSC::Yarr::byteCompileRegex): Ditto.
730         * yarr/RegexInterpreter.h:
731         (JSC::Yarr::BytecodePattern::BytecodePattern): Ditto.
732
733 2010-07-07  Darin Adler  <darin@apple.com>
734
735         Reviewed by Adam Barth.
736
737         Make clear set the pointer to 0 before deletion
738         https://bugs.webkit.org/show_bug.cgi?id=41727
739
740         * wtf/OwnArrayPtr.h: Changed code so we always set the pointer to its new
741         value before deleting the old one, including in the set function and the
742         clear function. This required changing safeDelete.
743         * wtf/OwnPtr.h: Ditto. Also removed some extra null checks.
744         * wtf/PassOwnPtr.h: Ditto.
745
746         * wtf/PassRefPtr.h: Changed code so we always set the pointer to its new
747         value before deref'ing the old one in the clear function. Also added a
748         leakRef function for NonNullPassRefPtr.
749         * wtf/RefPtr.h: Ditto.
750
751         * wtf/gobject/GOwnPtr.h: More of the same.
752         * wtf/gobject/GRefPtr.h: Ditto.
753
754 2010-07-07  Zoltan Herczeg  <zherczeg@webkit.org>
755
756         Reviewed by Oliver Hunt.
757
758         Refactored string parsing inside the lexer
759         https://bugs.webkit.org/show_bug.cgi?id=41606
760
761         Does not use goto. Although the last sunspider
762         parse-only tests yields 1.044x speedup, I think the
763         patch can have a slight improvement at most.
764
765         * parser/Lexer.cpp:
766         (JSC::singleEscape):
767         (JSC::Lexer::parseString):
768         (JSC::Lexer::lex):
769         * parser/Lexer.h:
770
771 2010-07-06  Oliver Hunt  <oliver@apple.com>
772
773         Reviewed by Maciej Stachowiak.
774
775         Make it possible to have both the JIT and Interpreter available in a single build
776         https://bugs.webkit.org/show_bug.cgi?id=41722
777
778         Separate the concept of !ENABLE(JIT) and ENABLE(INTERPRETER) and make it possible
779         to have both JIT and INTERPRETER enabled at the same time.  This doesn't add
780         support for mix mode execution, but it does allow a single build to contain all
781         the code needed to use either the interpreter or the jit.
782
783         If both ENABLE(INTERPRETER) and ENABLE(JIT) are true then setting the environment
784         variable JSC_FORCE_INTERPRETER will force JSC to use the interpreter.
785
786         This patch basically consists of replacing !ENABLE(JIT) with ENABLE(INTERPRETER),
787         or converting #if ENABLE(JIT) ... #else ... into #if ENABLE(JIT) ... #endif
788         #if ENABLE(INTERPRETER), etc.  There are also a few functions that need to be
789         renamed to resolve return type ambiguity.
790
791         * bytecode/CodeBlock.cpp:
792         (JSC::CodeBlock::~CodeBlock):
793         (JSC::CodeBlock::shrinkToFit):
794         * bytecode/CodeBlock.h:
795         * interpreter/CallFrame.h:
796         (JSC::ExecState::returnVPC):
797         * interpreter/Interpreter.cpp:
798         (JSC::Interpreter::unwindCallFrame):
799         (JSC::Interpreter::throwException):
800         (JSC::Interpreter::execute):
801         (JSC::Interpreter::executeCall):
802         (JSC::Interpreter::executeConstruct):
803         (JSC::Interpreter::prepareForRepeatCall):
804         (JSC::Interpreter::privateExecute):
805         (JSC::Interpreter::retrieveLastCaller):
806         * interpreter/Interpreter.h:
807         * runtime/ArrayPrototype.cpp:
808         (JSC::isNumericCompareFunction):
809         * runtime/Executable.cpp:
810         (JSC::EvalExecutable::generateJITCode):
811         (JSC::ProgramExecutable::generateJITCode):
812         (JSC::FunctionExecutable::generateJITCodeForCall):
813         (JSC::FunctionExecutable::generateJITCodeForConstruct):
814         (JSC::FunctionExecutable::reparseExceptionInfo):
815         (JSC::EvalExecutable::reparseExceptionInfo):
816         * runtime/JSFunction.cpp:
817         * runtime/JSGlobalData.cpp:
818         (JSC::JSGlobalData::JSGlobalData):
819         * runtime/JSGlobalData.h:
820         (JSC::JSGlobalData::canUseJIT):
821         * wtf/Platform.h:
822
823 2010-07-06  Darin Adler  <darin@apple.com>
824
825         Reviewed by Adam Barth.
826
827         Add adoptPtr and leakPtr functions for OwnPtr and PassOwnPtr
828         https://bugs.webkit.org/show_bug.cgi?id=41320
829
830         * bytecode/CodeBlock.cpp:
831         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): Use assignment
832         instead of set since the result of reparseExceptionInfo is now a
833         PassOwnPtr.
834
835         * bytecode/CodeBlock.h: Change extractExceptionInfo to return a
836         PassOwnPtr instead of a raw pointer.
837
838         * runtime/Executable.cpp:
839         (JSC::FunctionExecutable::reparseExceptionInfo): Return a PassOwnPtr.
840         (JSC::EvalExecutable::reparseExceptionInfo): Ditto.
841         (JSC::ProgramExecutable::reparseExceptionInfo): Added. This was
842         in the header before, but it's better to not have it there to reduce
843         header dependencies. Return a PassOwnPtr.
844
845         * runtime/Executable.h: Made reparseExceptionInfo return a PassOwnPtr,
846         and put it in the private sections of classes other than the base class.
847
848         * wtf/MessageQueue.h:
849         (WTF::MessageQueue::append): Use leakPtr instead of release.
850         (WTF::MessageQueue::appendAndCheckEmpty): Ditto.
851         (WTF::MessageQueue::prepend): Ditto.
852
853         * wtf/OwnPtr.h: Tweaked formatting. Changed the release function to return
854         a PassOwnPtr rather than a raw pointer. Added a leakPtr function that
855         returns a raw pointer. Put the constructor that takes a raw pointer and
856         the set function into a section guarded by LOOSE_OWN_PTR. Adapted to the
857         new adoptPtr function from PassOwnPtr.h.
858
859         * wtf/PassOwnPtr.h: Tweaked formatting. Renamed the release function
860         to leakPtr. Added an adoptPtr function that creates a new PassOwnPtr.
861         Put the constructor and assignment operators that take a raw pointer
862         into a section guarded by LOOSE_PASS_OWN_PTR.
863
864 2010-07-06  Sam Weinig  <sam@webkit.org>
865
866         Reviewed by Darin Adler
867
868         Update comment in StringExtras.h to be more accurate.
869
870         * wtf/StringExtras.h:
871
872 2010-07-06  Sheriff Bot  <webkit.review.bot@gmail.com>
873
874         Unreviewed, rolling out r62511.
875         http://trac.webkit.org/changeset/62511
876         https://bugs.webkit.org/show_bug.cgi?id=41686
877
878         Breaks Linux/64bit compilation (Requested by xan_ on #webkit).
879
880         * jit/ExecutableAllocator.cpp:
881         * jit/ExecutableAllocatorFixedVMPool.cpp:
882         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
883         (JSC::FixedVMPoolAllocator::free):
884         (JSC::ExecutablePool::systemAlloc):
885         * jit/ExecutableAllocatorPosix.cpp:
886         (JSC::ExecutableAllocator::reprotectRegion):
887         (JSC::ExecutableAllocator::cacheFlush):
888         * jit/ExecutableAllocatorSymbian.cpp:
889         * jit/ExecutableAllocatorWin.cpp:
890         * wtf/Platform.h:
891
892 2010-07-05  Gavin Barraclough  <barraclough@apple.com>
893
894         Reviewed by Sam Weinig.
895
896         https://bugs.webkit.org/show_bug.cgi?id=41641
897
898         Update compile flags to allow use of ExecutableAllocatorFixedVMPool on platforms
899         other than x86-64 (this may be useful on 32-bit platforms, too).
900
901         Simplify ifdefs by dividing into thwo broad allocation strategies
902         (ENABLE_EXECUTABLE_ALLOCATOR_FIXED & ENABLE_EXECUTABLE_ALLOCATOR_DEMAND).
903
904         Rename constant used in the code to have names descriptive of their purpose,
905         rather than their specific value on a given platform.
906
907         * jit/ExecutableAllocator.cpp:
908         (JSC::ExecutableAllocator::reprotectRegion):
909         (JSC::ExecutableAllocator::cacheFlush):
910         * jit/ExecutableAllocatorFixedVMPool.cpp:
911         (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
912         (JSC::FixedVMPoolAllocator::free):
913         (JSC::ExecutablePool::systemAlloc):
914         * jit/ExecutableAllocatorPosix.cpp:
915         * jit/ExecutableAllocatorSymbian.cpp:
916         * jit/ExecutableAllocatorWin.cpp:
917         * wtf/Platform.h:
918
919 2010-07-05  Steve Block  <steveblock@google.com>
920
921         Reviewed by Darin Adler.
922
923         ThreadingPthreads.cpp should use JNIUtility.h on Android, not outdated jni_utility.h
924         https://bugs.webkit.org/show_bug.cgi?id=41594
925
926         * wtf/ThreadingPthreads.cpp:
927
928 2010-07-04  Mark Rowe  <mrowe@apple.com>
929
930         Build fix after r62456.
931
932         * interpreter/Interpreter.cpp:
933         (JSC::Interpreter::privateExecute): Be slightly more consistent in using uint32_t to prevent
934         warnings about comparisons between signed and unsigned types, and attempts to call an overload
935         of std::min that doesn't exist.
936
937 2010-07-02  Sam Weinig  <sam@webkit.org>
938
939         Reviewed by Darin Adler.
940
941         Patch for https://bugs.webkit.org/show_bug.cgi?id=41553
942         Make StringExtras.h versions of snprintf and vsnprintf match the unix versions.
943
944         - MSVC does not ensure the buffers are null terminated as the unix versions do.
945
946         * runtime/JSGlobalObjectFunctions.cpp: Cleanup includes.
947         * runtime/UString.cpp: Clean up includes.
948         (JSC::UString::from): Don't pass sizeof(buf) - 1, that is wrong.
949         * wtf/StringExtras.h:
950         (snprintf): Ensure null termination of buffer.
951         (vsnprintf): Ditto.
952
953 2010-07-03  Yong Li  <yoli@rim.com>
954
955         Reviewed by Darin Adler.
956
957         Make Arguments::MaxArguments clamping work for numbers >= 0x80000000 in
958         the interpreter as well as the JIT.
959
960         https://bugs.webkit.org/show_bug.cgi?id=41351
961         rdar://problem/8142141
962
963         * interpreter/Interpreter.cpp:
964         (JSC::Interpreter::privateExecute): Fix signed integer overflow problem
965         in op_load_varargs handling. 0xFFFFFFFF was read as -1.
966
967 2010-06-26  Jeremy Orlow  <jorlow@chromium.org>
968
969         Reviewed by Dumitru Daniliuc.
970
971         Support for keys and in-memory storage for IndexedDB
972         https://bugs.webkit.org/show_bug.cgi?id=41252
973
974         Set the role to Private.
975
976         * JavaScriptCore.xcodeproj/project.pbxproj:
977
978 2010-07-02  Oliver Hunt  <oliver@apple.com>
979
980         Reviewed by Geoffrey Garen.
981
982         Move BOM handling out of the lexer and parser
983         https://bugs.webkit.org/show_bug.cgi?id=41539
984
985         Doing the BOM stripping in the lexer meant that we could
986         end up having to strip the BOMs from a source multiple times.
987         To deal with this we now require all strings provided by
988         a SourceProvider to already have had the BOMs stripped.
989         This also simplifies some of the lexer logic.
990
991         * parser/Lexer.cpp:
992         (JSC::Lexer::setCode):
993         (JSC::Lexer::sourceCode):
994         * parser/SourceProvider.h:
995         (JSC::SourceProvider::SourceProvider):
996         (JSC::UStringSourceProvider::create):
997         (JSC::UStringSourceProvider::getRange):
998         (JSC::UStringSourceProvider::UStringSourceProvider):
999         * wtf/text/StringImpl.h:
1000         (WebCore::StringImpl::copyStringWithoutBOMs):
1001
1002 2010-07-03  Patrick Gansterer  <paroga@paroga.com>
1003
1004         Reviewed by Kent Tamura.
1005
1006         [WINCE] Implement Unicode::isAlphanumeric and Unicode::isArabicChar.
1007         https://bugs.webkit.org/show_bug.cgi?id=41411
1008
1009         * wtf/unicode/wince/UnicodeWince.cpp:
1010         (WTF::Unicode::isAlphanumeric):
1011         * wtf/unicode/wince/UnicodeWince.h:
1012         (WTF::Unicode::isArabicChar):
1013
1014 2010-07-03  Kwang Yul Seo  <skyul@company100.net>
1015
1016         Reviewed by Kent Tamura.
1017
1018         [BREWMP] Change the CRASH() macro to print "WebKit CRASH" log.
1019         https://bugs.webkit.org/show_bug.cgi?id=41524
1020
1021         Print "WebKit CRASH" before crashing.
1022
1023         * wtf/Assertions.h:
1024
1025 2010-07-02  Gavin Barraclough  <barraclough@apple.com>
1026
1027         Reviewed by Oliver Hunt.
1028
1029         Bug 41565 - Repatching in ARMv7Assembler::repatchLoadPtrToLEA is broken
1030
1031         This method tried to repatch a LDR (T2) into an ADD (T3) - but it only
1032         repatches the first instruction word.  The layout of the fields in the
1033         second word is different, and also needs repatching.
1034
1035         * assembler/ARMv7Assembler.h:
1036         (JSC::ARMv7Assembler::repatchLoadPtrToLEA):
1037
1038 2010-07-02  Oliver Hunt  <oliver@apple.com>
1039
1040         Reviewed by Gavin Barraclough.
1041
1042         Clamp the number of arguments supported by function.apply
1043         https://bugs.webkit.org/show_bug.cgi?id=41351
1044         <rdar://problem/8142141>
1045
1046         Add clamping logic to function.apply similar to that
1047         enforced by firefox.  We have a smaller clamp than
1048         firefox as our calling convention means that stack
1049         usage is proportional to argument count -- the firefox
1050         limit is larger than you could actually call.
1051
1052         * interpreter/Interpreter.cpp:
1053         (JSC::Interpreter::privateExecute):
1054         * jit/JITStubs.cpp:
1055         (JSC::DEFINE_STUB_FUNCTION):
1056         * runtime/Arguments.h:
1057         (JSC::Arguments::):
1058
1059 2010-07-02  Chao-ying Fu  <fu@mips.com>
1060
1061         Reviewed by Oliver Hunt.
1062
1063         Re-enable JIT_OPTIMIZE_NATIVE_CALL on MIPS
1064         https://bugs.webkit.org/show_bug.cgi?id=40179
1065
1066         Add the MIPS part to re-enable JIT_OPTIMIZE_NATIVE_CALL.
1067
1068         * jit/JITOpcodes.cpp:
1069         (JSC::JIT::privateCompileCTINativeCall):
1070         * wtf/Platform.h:
1071
1072 2010-07-02  Gavin Barraclough  <barraclough@apple.com>
1073
1074         Reviewed by Oliver Hunt.
1075
1076         Bug 41552 - Clean up ARMv7 vfp code generation
1077         Emit separate opcode individually, remove magic numbers.
1078
1079         Also remove invalid assert from JSImmediate (number cells are not CELL_MASK aligned).
1080
1081         * assembler/ARMv7Assembler.h:
1082         (JSC::ARMv7Assembler::):
1083         (JSC::ARMv7Assembler::vadd_F64):
1084         (JSC::ARMv7Assembler::vcmp_F64):
1085         (JSC::ARMv7Assembler::vcvt_F64_S32):
1086         (JSC::ARMv7Assembler::vcvtr_S32_F64):
1087         (JSC::ARMv7Assembler::vdiv_F64):
1088         (JSC::ARMv7Assembler::vldr):
1089         (JSC::ARMv7Assembler::vmov_F64_0):
1090         (JSC::ARMv7Assembler::vmov):
1091         (JSC::ARMv7Assembler::vmrs):
1092         (JSC::ARMv7Assembler::vmul_F64):
1093         (JSC::ARMv7Assembler::vstr):
1094         (JSC::ARMv7Assembler::vsub_F64):
1095         (JSC::ARMv7Assembler::VFPOperand::VFPOperand):
1096         (JSC::ARMv7Assembler::VFPOperand::bits1):
1097         (JSC::ARMv7Assembler::VFPOperand::bits4):
1098         (JSC::ARMv7Assembler::vcvtOp):
1099         (JSC::ARMv7Assembler::ARMInstructionFormatter::vfpOp):
1100         (JSC::ARMv7Assembler::ARMInstructionFormatter::vfpMemOp):
1101         * assembler/MacroAssemblerARMv7.h:
1102         (JSC::MacroAssemblerARMv7::branchDouble):
1103         * runtime/JSImmediate.h:
1104         (JSC::JSValue::isCell):
1105
1106 2010-07-02  Sheriff Bot  <webkit.review.bot@gmail.com>
1107
1108         Unreviewed, rolling out r62410.
1109         http://trac.webkit.org/changeset/62410
1110         https://bugs.webkit.org/show_bug.cgi?id=41549
1111
1112         accursed last minute changes (Requested by olliej on #webkit).
1113
1114         * parser/Lexer.cpp:
1115         (JSC::Lexer::setCode):
1116         (JSC::Lexer::copyCodeWithoutBOMs):
1117         (JSC::Lexer::sourceCode):
1118         * parser/SourceProvider.h:
1119         (JSC::):
1120         (JSC::SourceProvider::SourceProvider):
1121         (JSC::SourceProvider::hasBOMs):
1122         (JSC::UStringSourceProvider::create):
1123         (JSC::UStringSourceProvider::getRange):
1124         (JSC::UStringSourceProvider::UStringSourceProvider):
1125         * wtf/text/StringImpl.h:
1126
1127 2010-07-02  Sam Weinig  <sam@webkit.org>
1128
1129         Reviewed by Geoffrey Garen.
1130
1131         Patch for https://bugs.webkit.org/show_bug.cgi?id=41548
1132         Use snprintf instead of sprintf everywhere in JavaScriptCore
1133
1134         * runtime/JSGlobalObjectFunctions.cpp:
1135         (JSC::encode):
1136         (JSC::globalFuncEscape):
1137         * runtime/UString.cpp:
1138         (JSC::UString::from):
1139
1140 2010-07-02  Oliver Hunt  <oliver@apple.com>
1141
1142         Reviewed by Geoffrey Garen.
1143
1144         Move BOM handling out of the lexer and parser
1145         https://bugs.webkit.org/show_bug.cgi?id=41539
1146
1147         Doing the BOM stripping in the lexer meant that we could
1148         end up having to strip the BOMs from a source multiple times.
1149         To deal with this we now require all strings provided by
1150         a SourceProvider to already have had the BOMs stripped.
1151         This also simplifies some of the lexer logic.
1152
1153         * parser/Lexer.cpp:
1154         (JSC::Lexer::setCode):
1155         (JSC::Lexer::sourceCode):
1156         * parser/SourceProvider.h:
1157         (JSC::SourceProvider::SourceProvider):
1158         (JSC::UStringSourceProvider::create):
1159         (JSC::UStringSourceProvider::getRange):
1160         (JSC::UStringSourceProvider::UStringSourceProvider):
1161         * wtf/text/StringImpl.h:
1162         (WebCore::StringImpl::copyStringWithoutBOMs):
1163
1164 2010-07-02  Renata Hodovan  <reni@inf.u-szeged.hu>
1165
1166         Reviewed by Oliver Hunt.
1167         
1168         [ Updated after rollout. ]
1169
1170         Merged RegExp constructor and RegExp::create methods.
1171         Both functions are called with three parameters and check whether 
1172         flags (the third param) is given or not.
1173         Avoid extra hash lookups in RegExpCache::create by passing a pre-computed
1174         iterator parameter.
1175         https://bugs.webkit.org/show_bug.cgi?id=41055
1176
1177         * runtime/RegExp.cpp:
1178         (JSC::RegExp::RegExp):
1179         * runtime/RegExp.h:
1180         * runtime/RegExpCache.cpp:
1181         (JSC::RegExpCache::lookupOrCreate):
1182         (JSC::RegExpCache::create):
1183         * runtime/RegExpCache.h:
1184
1185 2010-07-02  Martin Robinson  <mrobinson@igalia.com>
1186
1187         Unreviewed. Build fix for GTK+.
1188
1189         Build Lexer.lut.h with the rest of the .lut.h files. Later these should
1190         all probably be moved to DerivedSources.
1191
1192         * GNUmakefile.am:
1193
1194 2010-06-23  Martin Robinson  <mrobinson@igalia.com>
1195
1196         Reviewed by Gustavo Noronha Silva.
1197
1198         [GTK] Separate DerivedSources per-project
1199         https://bugs.webkit.org/show_bug.cgi?id=41109
1200
1201         Generate JavaScriptCore derived sources in <builddir>/DerivedSources/JavaScriptCore.
1202
1203         * GNUmakefile.am:
1204
1205 2010-07-02  Peter Varga  <pvarga@inf.u-szeged.hu>
1206
1207         Reviewed by Oliver Hunt.
1208
1209         The alternativeFrameLocation value is wrong in the emitDisjunction function in
1210         case of PatternTerm::TypeParentheticalAssertion. This value needs to be
1211         computed from term.frameLocation instead of term.inputPosition. This mistake caused glibc
1212         memory corruption in some cases.
1213         Layout test added for checking of TypeParentheticalAssertion case.
1214         https://bugs.webkit.org/show_bug.cgi?id=41458
1215
1216         * yarr/RegexInterpreter.cpp:
1217         (JSC::Yarr::ByteCompiler::emitDisjunction):
1218
1219 2010-07-01  Oliver Hunt  <oliver@apple.com>
1220
1221         Reviewed by Maciej Stachowiak.
1222
1223         Add a FixedArray template to encapsulate fixed length arrays
1224         https://bugs.webkit.org/show_bug.cgi?id=41506
1225
1226         This new type is used in place of fixed length C arrays so
1227         that debug builds can guard against attempts to go beyond
1228         the end of the array.
1229
1230         * JavaScriptCore.xcodeproj/project.pbxproj:
1231         * bytecode/Opcode.cpp:
1232         (JSC::OpcodeStats::~OpcodeStats):
1233         * pcre/pcre_compile.cpp:
1234         (calculateCompiledPatternLength):
1235         * runtime/Collector.cpp:
1236         (JSC::Heap::allocateBlock):
1237         (JSC::Heap::allocate):
1238         * runtime/Collector.h:
1239         (JSC::CollectorBitmap::clearAll):
1240         * runtime/CollectorHeapIterator.h:
1241         (JSC::CollectorHeapIterator::operator*):
1242         * runtime/DateInstanceCache.h:
1243         * runtime/JSString.cpp:
1244         (JSC::JSString::replaceCharacter):
1245         * runtime/JSString.h:
1246         (JSC::RopeBuilder::JSStringFinalizerStruct::):
1247         * runtime/NumericStrings.h:
1248         * runtime/RegExpCache.h:
1249         * runtime/SmallStrings.h:
1250         (JSC::SmallStrings::singleCharacterStrings):
1251         * wtf/AVLTree.h:
1252         * wtf/FixedArray.h: Added.
1253         (WTF::FixedArray::operator[]):
1254         (WTF::FixedArray::data):
1255
1256 2010-07-01  Zoltan Herczeg  <zherczeg@webkit.org>
1257
1258         Reviewed by Oliver Hunt.
1259
1260         Improve the main lexer switch by mapping input characters to their type
1261         https://bugs.webkit.org/show_bug.cgi?id=41459
1262
1263         Sunsipder: no change (from 532.9ms to 531.5ms)
1264         SunSpider --parse-only: 1.025x as fast (from 33.1ms to 32.3ms)
1265
1266         * parser/Lexer.cpp:
1267         (JSC::):
1268         (JSC::Lexer::lex):
1269
1270 2010-07-01  Sam Weinig  <sam@webkit.org>
1271
1272         Rubber-stamped by Ander Carlsson.
1273
1274         Define HAVE_HOSTED_CORE_ANIMATION on Snow Leopard.
1275
1276         * wtf/Platform.h:
1277
1278 2010-07-01  Gavin Barraclough  <barraclough@apple.com>
1279
1280         Reviewed by Oliver Hunt.
1281
1282         Bug 41490 - Add missing operations to MacroAssemblerARMv7
1283         Also, make single, double, quad register numbers in ARMv7Assembler distinct & strongly typed.
1284
1285         * assembler/ARMv7Assembler.h:
1286         (JSC::ARMRegisters::):
1287         (JSC::ARMRegisters::asSingle):
1288         (JSC::ARMRegisters::asDouble):
1289         (JSC::VFPImmediate::VFPImmediate):
1290         (JSC::VFPImmediate::isValid):
1291         (JSC::VFPImmediate::value):
1292         (JSC::ARMv7Assembler::singleRegisterMask):
1293         (JSC::ARMv7Assembler::doubleRegisterMask):
1294         (JSC::ARMv7Assembler::):
1295         (JSC::ARMv7Assembler::add_S):
1296         (JSC::ARMv7Assembler::neg):
1297         (JSC::ARMv7Assembler::orr_S):
1298         (JSC::ARMv7Assembler::sub):
1299         (JSC::ARMv7Assembler::sub_S):
1300         (JSC::ARMv7Assembler::vadd_F64):
1301         (JSC::ARMv7Assembler::vcmp_F64):
1302         (JSC::ARMv7Assembler::vcvt_F64_S32):
1303         (JSC::ARMv7Assembler::vcvtr_S32_F64):
1304         (JSC::ARMv7Assembler::vdiv_F64):
1305         (JSC::ARMv7Assembler::vldr):
1306         (JSC::ARMv7Assembler::vmov_F64_0):
1307         (JSC::ARMv7Assembler::vmov):
1308         (JSC::ARMv7Assembler::vmul_F64):
1309         (JSC::ARMv7Assembler::vstr):
1310         (JSC::ARMv7Assembler::vsub_F64):
1311         (JSC::ARMv7Assembler::vcvt):
1312         (JSC::ARMv7Assembler::vmem):
1313         * assembler/AbstractMacroAssembler.h:
1314         * assembler/MacroAssemblerARM.h:
1315         * assembler/MacroAssemblerARMv7.h:
1316         (JSC::MacroAssemblerARMv7::fpTempRegisterAsSingle):
1317         (JSC::MacroAssemblerARMv7::neg32):
1318         (JSC::MacroAssemblerARMv7::loadDouble):
1319         (JSC::MacroAssemblerARMv7::divDouble):
1320         (JSC::MacroAssemblerARMv7::convertInt32ToDouble):
1321         (JSC::MacroAssemblerARMv7::branchConvertDoubleToInt32):
1322         (JSC::MacroAssemblerARMv7::zeroDouble):
1323         (JSC::MacroAssemblerARMv7::branchOr32):
1324         (JSC::MacroAssemblerARMv7::set32):
1325         (JSC::MacroAssemblerARMv7::set8):
1326         * assembler/MacroAssemblerMIPS.h:
1327         * assembler/MacroAssemblerX86Common.h:
1328
1329 2010-07-01  Oliver Hunt  <oliver@apple.com>
1330
1331         Reviewed by Geoff Garen.
1332
1333         Improve reentrancy logic in polymorphic cache stubs
1334         <https://bugs.webkit.org/show_bug.cgi?id=41482>
1335         <rdar://problem/8094380>
1336
1337         Make the polymorphic cache stubs handle reentrancy
1338         better.
1339
1340         * jit/JITStubs.cpp:
1341         (JSC::DEFINE_STUB_FUNCTION):
1342         (JSC::getPolymorphicAccessStructureListSlot):
1343
1344 2010-07-01  Antti Koivisto  <koivisto@iki.fi>
1345
1346         Revert accidental commit.
1347
1348         * runtime/Collector.cpp:
1349         (JSC::Heap::allocateBlock):
1350
1351 2010-06-30  Darin Adler  <darin@apple.com>
1352
1353         Reviewed by Adam Barth.
1354
1355         Add assertion, off by default, for when you forget to do adoptRef
1356         https://bugs.webkit.org/show_bug.cgi?id=41422
1357
1358         * wtf/PassRefPtr.h: Tweaked formatting. Added a new adopted
1359         function, called on the pointer by adoptRef, with an empty inline
1360         default version, meant to be overloaded. Unified the inlining
1361         with a macro named REF_DEREF_INLINE to make it clearer what's
1362         going on in the refIfNotNull/derefIfNotNull functions. Renamed
1363         releaseRef to leakRef, but left the old name in for compatibility
1364         for now.
1365
1366         * wtf/RefCounted.h: Added code to require adoption and assert if
1367         you don't call adoptRef. For now, it is turned off because of the
1368         LOOSE_REF_COUNTED define in this header. Later we can turn it on
1369         once we get everything working without asserting.
1370
1371 2010-06-29  Michael Saboff  <msaboff@apple.com>
1372
1373         Reviewed by Darin Adler.
1374
1375         Bug 41238 - RegExp performance slow on Dromaeo benchmark
1376
1377         Other javascript engines appear to cache prior results of regular 
1378         expression operations.
1379
1380         Suggest adding some sort of caching mechanism to regular expression 
1381         processing.
1382
1383         Added a single entry cache of match() results to RegExp class.
1384
1385         Also added performance improvements to UString == operator.
1386         First check the impls for equality.  Then get the length of
1387         each of the non-null impls.  Next check the sizes for equality.
1388         Then check the data for the case of different impls that point 
1389         to the same data (most likely due to substrings from the beginning of
1390         another string).  Lastly we check the underlying data for equality.
1391
1392         * runtime/RegExp.cpp:
1393         (JSC::RegExp::RegExp):
1394         (JSC::RegExp::match):
1395         * runtime/RegExp.h:
1396         * runtime/UString.h:
1397         (JSC::operator==):
1398
1399 2010-06-29  Nathan Lawrence  <nlawrence@apple.com>
1400
1401         Reviewed by Geoffrey Garen.
1402
1403         WTF::HashSet iterators are quasi-mutable.  Changing the value through
1404         dereferencing an iterator will not change the behavior of methods like
1405         contains or find, but will change the behavior of iterating.
1406
1407         * wtf/HashSet.h:
1408         (WTF::::begin):
1409         (WTF::::end):
1410         (WTF::::find):
1411         (WTF::::remove):
1412         * wtf/HashTable.h:
1413
1414 2010-06-29  Martin Robinson  <mrobinson@igalia.com>
1415
1416         Reviewed by Xan Lopez.
1417
1418         [GTK] Clean up the source lists in the GNUMakefile.am files
1419         https://bugs.webkit.org/show_bug.cgi?id=41229
1420
1421         Clean up the GNUMakefile.am a little bit. Alphabetize and conglomerate
1422         the source lists.
1423
1424         * GNUmakefile.am:
1425
1426 2010-06-29  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
1427
1428         Reviewed by Kenneth Rohde Christiansen.
1429
1430         [Qt] Fix QtScript build after QScriptValuePrivate ctor changes
1431         https://bugs.webkit.org/show_bug.cgi?id=41307
1432
1433         * qt/api/qscriptvalue_p.h:
1434         (QScriptValuePrivate::prototype):
1435         * qt/benchmarks/qscriptengine/qscriptengine.pro:
1436
1437 2010-06-28  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
1438
1439         Reviewed by Kenneth Rohde Christiansen.
1440
1441         [Qt] QScriptEngine API should contain a newArray function
1442         https://bugs.webkit.org/show_bug.cgi?id=39115
1443
1444         * qt/api/qscriptengine.cpp:
1445         (QScriptEngine::newArray):
1446         * qt/api/qscriptengine.h:
1447         * qt/api/qscriptengine_p.cpp:
1448         (QScriptEnginePrivate::newArray):
1449         * qt/api/qscriptengine_p.h:
1450         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
1451         (tst_QScriptEngine::newArray):
1452
1453 2010-06-28  Xan Lopez  <xlopez@igalia.com>
1454
1455         Reviewed by Gustavo Noronha.
1456
1457         Install jsc as jsc-X where X is the major API version to allow
1458         parallel installation of both GTK+ 2.x and 3.x versions.
1459
1460         * GNUmakefile.am:
1461
1462 2010-06-28  John Gregg  <johnnyg@google.com>
1463
1464         Reviewed by Kent Tamura.
1465
1466         add ENABLE_DIRECTORY_UPLOAD build support
1467         https://bugs.webkit.org/show_bug.cgi?id=41100
1468
1469         * Configurations/FeatureDefines.xcconfig:
1470
1471 2010-06-28  Xan Lopez  <xlopez@igalia.com>
1472
1473         Revert to build jsc, since the tests expect this.
1474
1475         * GNUmakefile.am:
1476
1477 2010-06-28  Zoltan Herczeg  <zherczeg@webkit.org>
1478
1479         Reviewed by Oliver Hunt.
1480
1481         Only one character lookahead should be enough for the lexer
1482         https://bugs.webkit.org/show_bug.cgi?id=41213
1483
1484         The lexer had 4 character lookahead before, which required
1485         a complex shifting mechanism. This can be improved by using
1486         only one character lookahead for most decisions, and a
1487         peek() function as a fallback when it is absolutely necessary.
1488
1489         * parser/Lexer.cpp:
1490         (JSC::Lexer::currentCharacter):
1491         (JSC::Lexer::currentOffset):
1492         (JSC::Lexer::setCode):
1493         (JSC::Lexer::shift):
1494         (JSC::Lexer::peek):
1495         (JSC::Lexer::getUnicodeCharacter):
1496         (JSC::Lexer::shiftLineTerminator):
1497         (JSC::Lexer::lastTokenWasRestrKeyword):
1498         (JSC::Lexer::lex):
1499         (JSC::Lexer::scanRegExp):
1500         (JSC::Lexer::skipRegExp):
1501         * parser/Lexer.h:
1502
1503 2010-06-28  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
1504
1505         Unreviewed build fix.
1506
1507         [EFL] Build fix for latest version of Ecore library.
1508         Ecore recently changed return type of callbacks from int to Eina_Bool.
1509
1510         * wtf/efl/MainThreadEfl.cpp:
1511         (WTF::timeoutFired): Return Eina_Bool instead of int.
1512
1513 2010-06-28  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
1514
1515         Reviewed by Kenneth Rohde Christiansen.
1516
1517         [Qt] QScriptValue should have API for accessing object properties
1518         https://bugs.webkit.org/show_bug.cgi?id=40903
1519
1520         Make possible to access properties inside QScriptValues. While this
1521         still doesn't support the ResolveLocal parameter, it is already useful
1522         for testing the API.
1523
1524         The tests from upstream QtScript weren't imported since most of them
1525         depend on the setProperty() function as well. A simple test was created.
1526
1527         * qt/api/qscriptvalue.cpp:
1528         (QScriptValue::property):
1529         * qt/api/qscriptvalue.h:
1530         (QScriptValue::):
1531         * qt/api/qscriptvalue_p.h:
1532         (QScriptValuePrivate::property):
1533         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
1534         (tst_QScriptValue::propertySimple):
1535         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
1536
1537 2010-06-28  Xan Lopez  <xlopez@igalia.com>
1538
1539         Reviewed by Gustavo Noronha.
1540
1541         [GTK] Add support for GTK+3
1542         https://bugs.webkit.org/show_bug.cgi?id=41253
1543
1544         Suffix jsc with the API version of the library, so that
1545         libwebkitgtk 1.x and 3.x can install jsc.
1546
1547         * GNUmakefile.am:
1548
1549 2010-06-27  Kwang Yul Seo  <skyul@company100.net>
1550
1551         Reviewed by Kent Tamura.
1552
1553         [BREWMP] Turn ENABLE(SINGLE_THREADED) on.
1554         https://bugs.webkit.org/show_bug.cgi?id=41135
1555
1556         Brew MP does not support preemptive multi-threading.
1557         Disable threading for Brew MP.
1558
1559         * wtf/Platform.h:
1560
1561 2010-06-26  Tony Gentilcore  <tonyg@chromium.org>
1562
1563         Reviewed by Dimitri Glazkov.
1564
1565         Add an ENABLE_WEB_TIMING option for enabling Web Timing support.
1566         https://bugs.webkit.org/show_bug.cgi?id=38924
1567
1568         * Configurations/FeatureDefines.xcconfig:
1569
1570 2010-06-25  Nathan Lawrence  <nlawrence@apple.com>
1571
1572         Reviewed by Geoffrey Garen.
1573
1574         We assume in testapi.c that the value aHeapRef refers to will not be
1575         moved.  When we have movable objects, this will not be the case.
1576
1577         * API/tests/testapi.c:
1578         (main):
1579
1580 2010-06-25  Sheriff Bot  <webkit.review.bot@gmail.com>
1581
1582         Unreviewed, rolling out r61924.
1583         http://trac.webkit.org/changeset/61924
1584         https://bugs.webkit.org/show_bug.cgi?id=41240
1585
1586         It was rolled out, but cq+ wasn't removed (Requested by Ossy_
1587         on #webkit).
1588
1589         * runtime/RegExp.cpp:
1590         (JSC::RegExp::RegExp):
1591         (JSC::RegExp::create):
1592         * runtime/RegExp.h:
1593         * runtime/RegExpCache.cpp:
1594         (JSC::RegExpCache::lookupOrCreate):
1595         (JSC::RegExpCache::create):
1596         * runtime/RegExpCache.h:
1597
1598 2010-06-25  Renata Hodovan  <reni@inf.u-szeged.hu>
1599
1600         Reviewed by Geoffrey Garen.
1601
1602         Merge RegExp constructor and RegExp::create methods into one.
1603         Both of function are called with tree parameters and check whether 
1604         flags (the third param) is given or not.
1605         Simplify hash lookups in RegExpCache::create with giving them an extra 
1606         iterator parameter.
1607         https://bugs.webkit.org/show_bug.cgi?id=41055
1608
1609         * runtime/RegExp.cpp:
1610         (JSC::RegExp::RegExp):
1611         * runtime/RegExp.h:
1612         * runtime/RegExpCache.cpp:
1613         (JSC::RegExpCache::lookupOrCreate):
1614         (JSC::RegExpCache::create):
1615         * runtime/RegExpCache.h:
1616
1617 2010-06-25  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
1618
1619         Reviewed by Simon Hausmann.
1620
1621         Introduce QtScript benchmarks.
1622
1623         The QtScript performance should be tested regularly. The patch introduces
1624         micro benchmarks for existing API.
1625
1626         [Qt] Performance of the QtScript API is not tested.
1627         https://bugs.webkit.org/show_bug.cgi?id=40911
1628
1629         * qt/benchmarks/benchmarks.pri: Copied from JavaScriptCore/qt/tests/tests.pri.
1630         * qt/benchmarks/benchmarks.pro: Added.
1631         * qt/benchmarks/qscriptengine/qscriptengine.pro: Added.
1632         * qt/benchmarks/qscriptengine/tst_qscriptengine.cpp: Added.
1633         (tst_QScriptEngine::checkSyntax_data):
1634         (tst_QScriptEngine::checkSyntax):
1635         (tst_QScriptEngine::constructor):
1636         (tst_QScriptEngine::evaluateString_data):
1637         (tst_QScriptEngine::evaluateString):
1638         (tst_QScriptEngine::evaluateProgram_data):
1639         (tst_QScriptEngine::evaluateProgram):
1640         (tst_QScriptEngine::newObject):
1641         (tst_QScriptEngine::nullValue):
1642         (tst_QScriptEngine::undefinedValue):
1643         (tst_QScriptEngine::globalObject):
1644         (tst_QScriptEngine::toStringHandle):
1645         * qt/benchmarks/qscriptvalue/qscriptvalue.pro: Added.
1646         * qt/benchmarks/qscriptvalue/tst_qscriptvalue.cpp: Added.
1647         (tst_QScriptValue::tst_QScriptValue):
1648         (tst_QScriptValue::~tst_QScriptValue):
1649         (tst_QScriptValue::values_data):
1650         (tst_QScriptValue::ctorBool):
1651         (tst_QScriptValue::ctorReal):
1652         (tst_QScriptValue::ctorNumber):
1653         (tst_QScriptValue::ctorQString):
1654         (tst_QScriptValue::ctorCString):
1655         (tst_QScriptValue::ctorSpecial):
1656         (tst_QScriptValue::ctorQScriptValue):
1657         (tst_QScriptValue::isValid_data):
1658         (tst_QScriptValue::isValid):
1659         (tst_QScriptValue::isBool_data):
1660         (tst_QScriptValue::isBool):
1661         (tst_QScriptValue::isNumber_data):
1662         (tst_QScriptValue::isNumber):
1663         (tst_QScriptValue::isFunction_data):
1664         (tst_QScriptValue::isFunction):
1665         (tst_QScriptValue::isNull_data):
1666         (tst_QScriptValue::isNull):
1667         (tst_QScriptValue::isString_data):
1668         (tst_QScriptValue::isString):
1669         (tst_QScriptValue::isUndefined_data):
1670         (tst_QScriptValue::isUndefined):
1671         (tst_QScriptValue::isObject_data):
1672         (tst_QScriptValue::isObject):
1673         (tst_QScriptValue::isError_data):
1674         (tst_QScriptValue::isError):
1675         (tst_QScriptValue::toString_data):
1676         (tst_QScriptValue::toString):
1677         (tst_QScriptValue::toNumber_data):
1678         (tst_QScriptValue::toNumber):
1679         (tst_QScriptValue::toBool_data):
1680         (tst_QScriptValue::toBool):
1681         (tst_QScriptValue::toInteger_data):
1682         (tst_QScriptValue::toInteger):
1683         (tst_QScriptValue::toInt32_data):
1684         (tst_QScriptValue::toInt32):
1685         (tst_QScriptValue::toUInt32_data):
1686         (tst_QScriptValue::toUInt32):
1687         (tst_QScriptValue::toUInt16_data):
1688         (tst_QScriptValue::toUInt16):
1689         (tst_QScriptValue::toObject_data):
1690         (tst_QScriptValue::toObject):
1691         (tst_QScriptValue::equals_data):
1692         (tst_QScriptValue::equals):
1693         (tst_QScriptValue::strictlyEquals_data):
1694         (tst_QScriptValue::strictlyEquals):
1695         (tst_QScriptValue::instanceOf_data):
1696         (tst_QScriptValue::instanceOf):
1697
1698 2010-06-25  Oliver Hunt  <oliver@apple.com>
1699
1700         Reviewed by Geoffrey Garen.
1701
1702         Remove old js parser
1703         https://bugs.webkit.org/show_bug.cgi?id=41222
1704
1705         Remove the old yacc parser, this also solves the tiger problem.  Which
1706         was a conflict between yacc generated token values and those in the
1707         custom parser
1708
1709         * Android.mk:
1710         * CMakeLists.txt:
1711         * DerivedSources.make:
1712         * DerivedSources.pro:
1713         * GNUmakefile.am:
1714         * JavaScriptCore.pro:
1715         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1716         * JavaScriptCore.xcodeproj/project.pbxproj:
1717         * parser/Grammar.y: Removed.
1718         * parser/JSParser.cpp:
1719         * parser/JSParser.h:
1720         * parser/Lexer.cpp:
1721         * parser/NodeConstructors.h:
1722         (JSC::Node::Node):
1723         * parser/Parser.cpp:
1724         (JSC::Parser::parse):
1725         * wtf/Platform.h:
1726
1727 2010-06-25  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
1728
1729         Reviewed by Simon Hausmann.
1730
1731         New QtScript API; setPrototype() and prototype().
1732
1733         This patch implements QScriptValue's prototype accessors.
1734
1735         [Qt] QScriptValue should have accessors to a prototype.
1736         https://bugs.webkit.org/show_bug.cgi?id=39356
1737
1738         * qt/api/qscriptvalue.cpp:
1739         (QScriptValue::prototype):
1740         (QScriptValue::setPrototype):
1741         * qt/api/qscriptvalue.h:
1742         * qt/api/qscriptvalue_p.h:
1743         (QScriptValuePrivate::prototype):
1744         (QScriptValuePrivate::setPrototype):
1745         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
1746         (tst_QScriptValue::getSetPrototype):
1747         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
1748
1749 2010-06-25  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
1750
1751         Reviewed by Kenneth Rohde Christiansen.
1752
1753         [CMake] Add option to enable JIT.
1754         JIT is disabled by default, but now it's possible to enable it through
1755         an option to CMake: -DENABLE_JIT will enable it.
1756         https://bugs.webkit.org/show_bug.cgi?id=40936
1757
1758         * CMakeLists.txt: Add missing files and re-sort.
1759
1760 2010-06-25  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
1761
1762         Reviewed by Gustavo Noronha Silva.
1763
1764         [CMake] Remove unused variable in EFL build system. It was previously
1765         being used to set the flags of each port but it was superseded by
1766         other flags.
1767         https://bugs.webkit.org/show_bug.cgi?id=40931
1768
1769         * jsc/CMakeLists.txt:
1770
1771 2010-06-25  Nathan Lawrence  <nlawrence@apple.com>
1772
1773         Reviewed by Geoffrey Garen.
1774
1775         Aligning AssemblerBuffer to 128 bytes gives a 0.4% speedup on
1776         sunspider.
1777
1778         * assembler/AssemblerBuffer.h:
1779         (JSC::AssemblerBuffer::AssemblerBuffer):
1780
1781 2010-06-25  Sheriff Bot  <webkit.review.bot@gmail.com>
1782
1783         Unreviewed, rolling out r61842.
1784         http://trac.webkit.org/changeset/61842
1785         https://bugs.webkit.org/show_bug.cgi?id=41208
1786
1787         It broke Windows build (Requested by Ossy_ on #webkit).
1788
1789         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
1790         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1791         * wtf/OwnPtrCommon.h:
1792         * wtf/brew/OwnPtrBrew.h: Removed.
1793         * wtf/win/OwnPtrWin.h: Removed.
1794
1795 2010-06-25  Sheriff Bot  <webkit.review.bot@gmail.com>
1796
1797         Unreviewed, rolling out r61833.
1798         http://trac.webkit.org/changeset/61833
1799         https://bugs.webkit.org/show_bug.cgi?id=41205
1800
1801         It broke Leopard and GTK (Requested by Ossy_ on #webkit).
1802
1803         * runtime/RegExp.cpp:
1804         (JSC::RegExp::RegExp):
1805         (JSC::RegExp::create):
1806         * runtime/RegExp.h:
1807         * runtime/RegExpCache.cpp:
1808         (JSC::RegExpCache::lookupOrCreate):
1809         (JSC::RegExpCache::create):
1810         * runtime/RegExpCache.h:
1811
1812 2010-06-25  Kwang Yul Seo  <skyul@company100.net>
1813
1814         Reviewed by Adam Barth.
1815
1816         Change OwnPtrCommon to include platform-specific headers
1817         https://bugs.webkit.org/show_bug.cgi?id=40279
1818
1819         Adding new type to OwnPtrCommon needlessly causes all ports to do full rebuilds.
1820         Change OwnPtrCommon to include platform-specific headers to avoid all ports rebuilds.
1821
1822         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
1823         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1824         * wtf/OwnPtrCommon.h:
1825         * wtf/brew/OwnPtrBrew.h: Added.
1826         * wtf/win/OwnPtrWin.h: Added.
1827
1828 2010-06-25  Patrick Gansterer  <paroga@paroga.com>
1829
1830         Reviewed by Darin Adler.
1831
1832         Add the possibility for a head and footer section to create_jit_stubs.
1833         https://bugs.webkit.org/show_bug.cgi?id=36050
1834
1835         * create_jit_stubs:
1836
1837 2010-06-24  Renata Hodovan  <reni@inf.u-szeged.hu>
1838
1839         Reviewed by Geoffrey Garen.
1840
1841         Merge RegExp constructor and RegExp::create methods into one.
1842         Both of function are called with tree parameters and check whether 
1843         flags (the third param) is given or not.
1844         Simplify hash lookups in RegExpCache::create with giving them an extra 
1845         iterator parameter.
1846         https://bugs.webkit.org/show_bug.cgi?id=41055
1847
1848         * runtime/RegExp.cpp:
1849         (JSC::RegExp::RegExp):
1850         * runtime/RegExp.h:
1851         * runtime/RegExpCache.cpp:
1852         (JSC::RegExpCache::lookupOrCreate):
1853         (JSC::RegExpCache::create):
1854         * runtime/RegExpCache.h:
1855
1856 2010-06-24  Oliver Hunt  <oliver@apple.com>
1857
1858         Reviewed by Maciej Stachowiak.
1859
1860         Incorrect use of '+ 4' and 0 instead of tag and payload offsets in JSValue32_64
1861         https://bugs.webkit.org/show_bug.cgi?id=41193
1862
1863         I noticed a use of '+ 4' in some of the 32_64 code paths and realised there
1864         were a few places where endianness was being hardcoded.  This patch fixes
1865         the errors i could find through code inspection.
1866
1867         * jit/JITOpcodes32_64.cpp:
1868         (JSC::JIT::emit_op_resolve_global):
1869         * jit/JITPropertyAccess32_64.cpp:
1870         (JSC::JIT::emit_op_get_by_val):
1871         (JSC::JIT::emit_op_put_by_val):
1872         (JSC::JIT::compileGetDirectOffset):
1873         (JSC::JIT::privateCompilePutByIdTransition):
1874         (JSC::JIT::patchGetByIdSelf):
1875         (JSC::JIT::patchPutByIdReplace):
1876
1877 2010-06-24  Oliver Hunt  <oliver@apple.com>
1878
1879         Build fix
1880
1881         Temporarily get the tiger bot working again by disabling the
1882         new JS parser.  GCC on tiger is miscompiling the parser and
1883         I don't have access to a tiger machine right now.
1884
1885         * wtf/Platform.h:
1886
1887  2010-06-21  Nathan Lawrence  <nlawrence@apple.com>
1888
1889          Reviewed by Geoff Garen.
1890
1891          https://bugs.webkit.org/show_bug.cgi?id=40128
1892          Fixed broken debug functionality.
1893
1894          * interpreter/Interpreter.cpp:
1895          (JSC::Interpreter::dumpRegisters):
1896              Fixed to work with updated call frame.
1897          * runtime/JSImmediate.h:
1898          (JSC::JSValue::isCell):
1899              Added assert for aligned cell.
1900          * runtime/JSValue.cpp:
1901          (JSC::JSValue::description):
1902              Fixed to work with current JSValue implementation.
1903          * runtime/JSZombie.cpp:
1904          (JSC::JSZombie::leakedZombieStructure):
1905              JSombies compile again.
1906
1907 2010-06-24  Leandro Pereira  <leandro@profusion.mobi>
1908
1909         Unreviewed build fix.
1910
1911         * CMakeLists.txt: Add JSParser.cpp.
1912
1913 2010-06-24  Oliver Hunt  <oliver@apple.com>
1914
1915         Reviewed by Maciej Stachowiak.
1916
1917         Single character string replacement may replace too many characters
1918         https://bugs.webkit.org/show_bug.cgi?id=41138
1919         <rdar://problem/8097496>
1920
1921         Simple fix to stop the rope path of single character replacement
1922         once the first replacement occurs.
1923
1924         * runtime/JSString.cpp:
1925         (JSC::JSString::replaceCharacter):
1926
1927 2010-06-24  Gabor Loki  <loki@webkit.org>
1928
1929         Reviewed by Gavin Barraclough.
1930
1931         Fix the length of instruction stream controlled by constant pool
1932         https://bugs.webkit.org/show_bug.cgi?id=40293
1933
1934         The initial/maximum length of instruction stream (m_maxDistance) should
1935         be set when the first constant arrives to the constant pool. Otherwise
1936         the constant pool could be placed into an uninterrupted sequence.
1937
1938         * assembler/AssemblerBufferWithConstantPool.h:
1939         (JSC::):
1940
1941 2010-06-24  Oliver Hunt  <oliver@apple.com>
1942
1943         Reviewed by Gavin Barraclough.
1944
1945         We assume bytecodeOffset will always return a value > 1,
1946         so we adjust the failure case to return 1 instead of 0.
1947
1948         * bytecode/CodeBlock.h:
1949         (JSC::CodeBlock::bytecodeOffset):
1950
1951 2010-06-23  Oliver Hunt  <oliver@apple.com>
1952
1953         Reviewed by Gavin Barraclough.
1954
1955         Custom-written JavaScript parser
1956         https://bugs.webkit.org/show_bug.cgi?id=34019
1957
1958         Implement a recursive descent parser similar to that used by V8 and
1959         SpiderMonkey.  Greater than 2x improvement in SunSpider parsing tests.
1960
1961         The parser consists of a JSParser class that uses a TreeBuilder to actually
1962         build the AST.  There are currently two builders -- the ASTBuilder and
1963         SyntaxChecker which separate the job of building an AST for code generation
1964         and simply checking syntactic correctness.
1965
1966         There's still some less than ideal code remaining in the parser to allow
1967         us to retain the existing lexing code with minimal changes.  We'll tidy
1968         this up at a later date.
1969
1970         * GNUmakefile.am:
1971         * JavaScriptCore.gypi:
1972         * JavaScriptCore.pro:
1973         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1974         * JavaScriptCore.xcodeproj/project.pbxproj:
1975         * parser/ASTBuilder.h: Added.
1976         (JSC::ASTBuilder::BinaryOpInfo::BinaryOpInfo):
1977         (JSC::ASTBuilder::AssignmentInfo::AssignmentInfo):
1978         (JSC::ASTBuilder::ASTBuilder):
1979         (JSC::ASTBuilder::createSourceElements):
1980         (JSC::ASTBuilder::varDeclarations):
1981         (JSC::ASTBuilder::funcDeclarations):
1982         (JSC::ASTBuilder::features):
1983         (JSC::ASTBuilder::numConstants):
1984         (JSC::ASTBuilder::appendToComma):
1985         (JSC::ASTBuilder::createCommaExpr):
1986         (JSC::ASTBuilder::createLogicalNot):
1987         (JSC::ASTBuilder::createUnaryPlus):
1988         (JSC::ASTBuilder::createVoid):
1989         (JSC::ASTBuilder::thisExpr):
1990         (JSC::ASTBuilder::createResolve):
1991         (JSC::ASTBuilder::createObjectLiteral):
1992         (JSC::ASTBuilder::createArray):
1993         (JSC::ASTBuilder::createNumberExpr):
1994         (JSC::ASTBuilder::createString):
1995         (JSC::ASTBuilder::createBoolean):
1996         (JSC::ASTBuilder::createNull):
1997         (JSC::ASTBuilder::createBracketAccess):
1998         (JSC::ASTBuilder::createDotAccess):
1999         (JSC::ASTBuilder::createRegex):
2000         (JSC::ASTBuilder::createNewExpr):
2001         (JSC::ASTBuilder::createConditionalExpr):
2002         (JSC::ASTBuilder::createAssignResolve):
2003         (JSC::ASTBuilder::createFunctionExpr):
2004         (JSC::ASTBuilder::createFunctionBody):
2005         (JSC::ASTBuilder::createGetterOrSetterProperty):
2006         (JSC::ASTBuilder::createArguments):
2007         (JSC::ASTBuilder::createArgumentsList):
2008         (JSC::ASTBuilder::createProperty):
2009         (JSC::ASTBuilder::createPropertyList):
2010         (JSC::ASTBuilder::createElementList):
2011         (JSC::ASTBuilder::createFormalParameterList):
2012         (JSC::ASTBuilder::createClause):
2013         (JSC::ASTBuilder::createClauseList):
2014         (JSC::ASTBuilder::setUsesArguments):
2015         (JSC::ASTBuilder::createFuncDeclStatement):
2016         (JSC::ASTBuilder::createBlockStatement):
2017         (JSC::ASTBuilder::createExprStatement):
2018         (JSC::ASTBuilder::createIfStatement):
2019         (JSC::ASTBuilder::createForLoop):
2020         (JSC::ASTBuilder::createForInLoop):
2021         (JSC::ASTBuilder::createEmptyStatement):
2022         (JSC::ASTBuilder::createVarStatement):
2023         (JSC::ASTBuilder::createReturnStatement):
2024         (JSC::ASTBuilder::createBreakStatement):
2025         (JSC::ASTBuilder::createContinueStatement):
2026         (JSC::ASTBuilder::createTryStatement):
2027         (JSC::ASTBuilder::createSwitchStatement):
2028         (JSC::ASTBuilder::createWhileStatement):
2029         (JSC::ASTBuilder::createDoWhileStatement):
2030         (JSC::ASTBuilder::createLabelStatement):
2031         (JSC::ASTBuilder::createWithStatement):
2032         (JSC::ASTBuilder::createThrowStatement):
2033         (JSC::ASTBuilder::createDebugger):
2034         (JSC::ASTBuilder::createConstStatement):
2035         (JSC::ASTBuilder::appendConstDecl):
2036         (JSC::ASTBuilder::appendStatement):
2037         (JSC::ASTBuilder::addVar):
2038         (JSC::ASTBuilder::combineCommaNodes):
2039         (JSC::ASTBuilder::evalCount):
2040         (JSC::ASTBuilder::appendBinaryExpressionInfo):
2041         (JSC::ASTBuilder::operatorStackPop):
2042         (JSC::ASTBuilder::operatorStackHasHigherPrecedence):
2043         (JSC::ASTBuilder::getFromOperandStack):
2044         (JSC::ASTBuilder::shrinkOperandStackBy):
2045         (JSC::ASTBuilder::appendBinaryOperation):
2046         (JSC::ASTBuilder::operatorStackAppend):
2047         (JSC::ASTBuilder::popOperandStack):
2048         (JSC::ASTBuilder::appendUnaryToken):
2049         (JSC::ASTBuilder::unaryTokenStackLastType):
2050         (JSC::ASTBuilder::unaryTokenStackLastStart):
2051         (JSC::ASTBuilder::unaryTokenStackRemoveLast):
2052         (JSC::ASTBuilder::assignmentStackAppend):
2053         (JSC::ASTBuilder::createAssignment):
2054         (JSC::ASTBuilder::Scope::Scope):
2055         (JSC::ASTBuilder::setExceptionLocation):
2056         (JSC::ASTBuilder::incConstants):
2057         (JSC::ASTBuilder::usesThis):
2058         (JSC::ASTBuilder::usesCatch):
2059         (JSC::ASTBuilder::usesClosures):
2060         (JSC::ASTBuilder::usesArguments):
2061         (JSC::ASTBuilder::usesAssignment):
2062         (JSC::ASTBuilder::usesWith):
2063         (JSC::ASTBuilder::usesEval):
2064         (JSC::ASTBuilder::createNumber):
2065         (JSC::ASTBuilder::makeTypeOfNode):
2066         (JSC::ASTBuilder::makeDeleteNode):
2067         (JSC::ASTBuilder::makeNegateNode):
2068         (JSC::ASTBuilder::makeBitwiseNotNode):
2069         (JSC::ASTBuilder::makeMultNode):
2070         (JSC::ASTBuilder::makeDivNode):
2071         (JSC::ASTBuilder::makeAddNode):
2072         (JSC::ASTBuilder::makeSubNode):
2073         (JSC::ASTBuilder::makeLeftShiftNode):
2074         (JSC::ASTBuilder::makeRightShiftNode):
2075         (JSC::ASTBuilder::makeFunctionCallNode):
2076         (JSC::ASTBuilder::makeBinaryNode):
2077         (JSC::ASTBuilder::makeAssignNode):
2078         (JSC::ASTBuilder::makePrefixNode):
2079         (JSC::ASTBuilder::makePostfixNode):
2080         * parser/JSParser.cpp: Added.
2081         (JSC::JSParser::AllowInOverride::AllowInOverride):
2082         (JSC::JSParser::AllowInOverride::~AllowInOverride):
2083         (JSC::JSParser::token):
2084         (JSC::JSParser::next):
2085         (JSC::JSParser::consume):
2086         (JSC::JSParser::match):
2087         (JSC::JSParser::tokenStart):
2088         (JSC::JSParser::tokenLine):
2089         (JSC::JSParser::tokenEnd):
2090         (JSC::JSParser::):
2091         (JSC::JSParser::autoSemiColon):
2092         (JSC::JSParser::canRecurse):
2093         (JSC::JSParser::lastTokenEnd):
2094         (JSC::jsParse):
2095         (JSC::JSParser::JSParser):
2096         (JSC::JSParser::parseProgram):
2097         (JSC::JSParser::allowAutomaticSemicolon):
2098         (JSC::JSParser::parseSourceElements):
2099         (JSC::JSParser::parseVarDeclaration):
2100         (JSC::JSParser::parseConstDeclaration):
2101         (JSC::JSParser::parseDoWhileStatement):
2102         (JSC::JSParser::parseWhileStatement):
2103         (JSC::JSParser::parseVarDeclarationList):
2104         (JSC::JSParser::parseConstDeclarationList):
2105         (JSC::JSParser::parseForStatement):
2106         (JSC::JSParser::parseBreakStatement):
2107         (JSC::JSParser::parseContinueStatement):
2108         (JSC::JSParser::parseReturnStatement):
2109         (JSC::JSParser::parseThrowStatement):
2110         (JSC::JSParser::parseWithStatement):
2111         (JSC::JSParser::parseSwitchStatement):
2112         (JSC::JSParser::parseSwitchClauses):
2113         (JSC::JSParser::parseSwitchDefaultClause):
2114         (JSC::JSParser::parseTryStatement):
2115         (JSC::JSParser::parseDebuggerStatement):
2116         (JSC::JSParser::parseBlockStatement):
2117         (JSC::JSParser::parseStatement):
2118         (JSC::JSParser::parseFormalParameters):
2119         (JSC::JSParser::parseFunctionBody):
2120         (JSC::JSParser::parseFunctionInfo):
2121         (JSC::JSParser::parseFunctionDeclaration):
2122         (JSC::JSParser::parseExpressionOrLabelStatement):
2123         (JSC::JSParser::parseExpressionStatement):
2124         (JSC::JSParser::parseIfStatement):
2125         (JSC::JSParser::parseExpression):
2126         (JSC::JSParser::parseAssignmentExpression):
2127         (JSC::JSParser::parseConditionalExpression):
2128         (JSC::isUnaryOp):
2129         (JSC::JSParser::isBinaryOperator):
2130         (JSC::JSParser::parseBinaryExpression):
2131         (JSC::JSParser::parseProperty):
2132         (JSC::JSParser::parseObjectLiteral):
2133         (JSC::JSParser::parseArrayLiteral):
2134         (JSC::JSParser::parsePrimaryExpression):
2135         (JSC::JSParser::parseArguments):
2136         (JSC::JSParser::parseMemberExpression):
2137         (JSC::JSParser::parseUnaryExpression):
2138         * parser/JSParser.h: Added.
2139         (JSC::):
2140         (JSC::JSTokenInfo::JSTokenInfo):
2141         * parser/Lexer.cpp:
2142         (JSC::Lexer::lex):
2143         * parser/Lexer.h:
2144         (JSC::Lexer::setLastLineNumber):
2145         (JSC::Lexer::lastLineNumber):
2146         * parser/NodeConstructors.h:
2147         (JSC::Node::Node):
2148         * parser/Parser.cpp:
2149         (JSC::Parser::parse):
2150         * parser/SyntaxChecker.h: Added.
2151         (JSC::SyntaxChecker::SyntaxChecker):
2152         (JSC::SyntaxChecker::createSourceElements):
2153         (JSC::SyntaxChecker::makeFunctionCallNode):
2154         (JSC::SyntaxChecker::appendToComma):
2155         (JSC::SyntaxChecker::createCommaExpr):
2156         (JSC::SyntaxChecker::makeAssignNode):
2157         (JSC::SyntaxChecker::makePrefixNode):
2158         (JSC::SyntaxChecker::makePostfixNode):
2159         (JSC::SyntaxChecker::makeTypeOfNode):
2160         (JSC::SyntaxChecker::makeDeleteNode):
2161         (JSC::SyntaxChecker::makeNegateNode):
2162         (JSC::SyntaxChecker::makeBitwiseNotNode):
2163         (JSC::SyntaxChecker::createLogicalNot):
2164         (JSC::SyntaxChecker::createUnaryPlus):
2165         (JSC::SyntaxChecker::createVoid):
2166         (JSC::SyntaxChecker::thisExpr):
2167         (JSC::SyntaxChecker::createResolve):
2168         (JSC::SyntaxChecker::createObjectLiteral):
2169         (JSC::SyntaxChecker::createArray):
2170         (JSC::SyntaxChecker::createNumberExpr):
2171         (JSC::SyntaxChecker::createString):
2172         (JSC::SyntaxChecker::createBoolean):
2173         (JSC::SyntaxChecker::createNull):
2174         (JSC::SyntaxChecker::createBracketAccess):
2175         (JSC::SyntaxChecker::createDotAccess):
2176         (JSC::SyntaxChecker::createRegex):
2177         (JSC::SyntaxChecker::createNewExpr):
2178         (JSC::SyntaxChecker::createConditionalExpr):
2179         (JSC::SyntaxChecker::createAssignResolve):
2180         (JSC::SyntaxChecker::createFunctionExpr):
2181         (JSC::SyntaxChecker::createFunctionBody):
2182         (JSC::SyntaxChecker::createArguments):
2183         (JSC::SyntaxChecker::createArgumentsList):
2184         (JSC::SyntaxChecker::createProperty):
2185         (JSC::SyntaxChecker::createPropertyList):
2186         (JSC::SyntaxChecker::createElementList):
2187         (JSC::SyntaxChecker::createFormalParameterList):
2188         (JSC::SyntaxChecker::createClause):
2189         (JSC::SyntaxChecker::createClauseList):
2190         (JSC::SyntaxChecker::setUsesArguments):
2191         (JSC::SyntaxChecker::createFuncDeclStatement):
2192         (JSC::SyntaxChecker::createBlockStatement):
2193         (JSC::SyntaxChecker::createExprStatement):
2194         (JSC::SyntaxChecker::createIfStatement):
2195         (JSC::SyntaxChecker::createForLoop):
2196         (JSC::SyntaxChecker::createForInLoop):
2197         (JSC::SyntaxChecker::createEmptyStatement):
2198         (JSC::SyntaxChecker::createVarStatement):
2199         (JSC::SyntaxChecker::createReturnStatement):
2200         (JSC::SyntaxChecker::createBreakStatement):
2201         (JSC::SyntaxChecker::createContinueStatement):
2202         (JSC::SyntaxChecker::createTryStatement):
2203         (JSC::SyntaxChecker::createSwitchStatement):
2204         (JSC::SyntaxChecker::createWhileStatement):
2205         (JSC::SyntaxChecker::createWithStatement):
2206         (JSC::SyntaxChecker::createDoWhileStatement):
2207         (JSC::SyntaxChecker::createLabelStatement):
2208         (JSC::SyntaxChecker::createThrowStatement):
2209         (JSC::SyntaxChecker::createDebugger):
2210         (JSC::SyntaxChecker::createConstStatement):
2211         (JSC::SyntaxChecker::appendConstDecl):
2212         (JSC::SyntaxChecker::createGetterOrSetterProperty):
2213         (JSC::SyntaxChecker::appendStatement):
2214         (JSC::SyntaxChecker::addVar):
2215         (JSC::SyntaxChecker::combineCommaNodes):
2216         (JSC::SyntaxChecker::evalCount):
2217         (JSC::SyntaxChecker::appendBinaryExpressionInfo):
2218         (JSC::SyntaxChecker::operatorStackPop):
2219         * runtime/JSGlobalData.h:
2220         * wtf/Platform.h:
2221         * wtf/ThreadSpecific.h:
2222         (WTF::T):
2223
2224 2010-06-23  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
2225
2226         Reviewed by Simon Hausmann.
2227
2228         Optimization of the QScriptValuePrivate.
2229
2230         Patch change only internals of the QScriptValuePrivate.
2231         Most of the QScriptValuePrivate's attributes were moved
2232         into an union.
2233
2234         [Qt] Optimization of the QScriptVAluePrivate.
2235         https://bugs.webkit.org/show_bug.cgi?id=40415
2236
2237         * qt/api/qscriptengine_p.cpp:
2238         (QScriptEnginePrivate::globalObject):
2239         * qt/api/qscriptvalue_p.h:
2240         (QScriptValuePrivate::):
2241         (QScriptValuePrivate::~QScriptValuePrivate):
2242         (QScriptValuePrivate::QScriptValuePrivate):
2243         (QScriptValuePrivate::toString):
2244         (QScriptValuePrivate::toNumber):
2245         (QScriptValuePrivate::toBool):
2246         (QScriptValuePrivate::toObject):
2247         (QScriptValuePrivate::equals):
2248         (QScriptValuePrivate::strictlyEquals):
2249         (QScriptValuePrivate::assignEngine):
2250         (QScriptValuePrivate::operator JSValueRef):
2251         (QScriptValuePrivate::operator JSObjectRef):
2252         (QScriptValuePrivate::refinedJSValue):
2253
2254 2010-06-23  Kwang Yul Seo  <skyul@company100.net>
2255
2256         Reviewed by Oliver Hunt.
2257
2258         [GTK] Implement ThreadSpecific with glib
2259         https://bugs.webkit.org/show_bug.cgi?id=39829
2260
2261         Implement ThreadSpecific with glib's GStaticPrivate.
2262         This patch makes it possible to build GTK port without pthread.
2263
2264         * wtf/ThreadSpecific.h:
2265         (WTF::::ThreadSpecific):
2266         (WTF::::~ThreadSpecific):
2267         (WTF::::get):
2268         (WTF::::set):
2269         (WTF::::destroy):
2270
2271 2010-06-23  Leandro Pereira  <leandro@profusion.mobi>
2272
2273         Unreviewed build fix.
2274
2275         * CMakeLists.txt: Add runtime/RegExpCache.cpp.
2276
2277 2010-06-22  Renata Hodovan  <hodovan@inf.u-szeged.hu>
2278
2279         Reviewed by Geoffrey Garen.
2280
2281         Adding regular expression caching to JavaScriptCore
2282         https://bugs.webkit.org/show_bug.cgi?id=38142
2283
2284         The cache is based on Round Robin eviction policy, and
2285         can cache at most 256 character long regular expressions,
2286         and at most 256 of them. These values can be changed at compile time.
2287
2288         * GNUmakefile.am:
2289         * JavaScriptCore.gypi:
2290         * JavaScriptCore.pro:
2291         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2292         * JavaScriptCore.xcodeproj/project.pbxproj:
2293         * bytecompiler/NodesCodegen.cpp:
2294         (JSC::RegExpNode::emitBytecode):
2295         * runtime/JSGlobalData.cpp:
2296         (JSC::JSGlobalData::JSGlobalData):
2297         (JSC::JSGlobalData::~JSGlobalData):
2298         * runtime/JSGlobalData.h:
2299         (JSC::JSGlobalData::regExpCache):
2300         * runtime/RegExpCache.cpp: Added.
2301         (JSC::RegExpCache::lookupOrCreate):
2302         (JSC::RegExpCache::create):
2303         (JSC::RegExpCache::RegExpCache):
2304         * runtime/RegExpCache.h: Added.
2305         * runtime/RegExpConstructor.cpp:
2306         (JSC::constructRegExp):
2307         * runtime/RegExpKey.h: Added.
2308         (JSC::RegExpKey::RegExpKey):
2309         (JSC::RegExpKey::getFlagsValue):
2310         (WTF::operator==):
2311         (WTF::):
2312         * runtime/RegExpPrototype.cpp:
2313         (JSC::regExpProtoFuncCompile):
2314         * runtime/StringPrototype.cpp:
2315         (JSC::stringProtoFuncMatch):
2316         (JSC::stringProtoFuncSearch):
2317
2318 2010-06-22  Gabor Loki  <loki@webkit.org>
2319
2320         Reviewed by Geoffrey Garen.
2321
2322         Add native call support for ARM and Thumb-2 JIT.
2323         https://bugs.webkit.org/show_bug.cgi?id=40231
2324
2325         * jit/JITOpcodes.cpp:
2326         (JSC::JIT::privateCompileCTINativeCall):
2327         * jit/JITOpcodes32_64.cpp:
2328         (JSC::JIT::privateCompileCTINativeCall):
2329         * wtf/Platform.h:
2330
2331 2010-06-21  Oliver Hunt  <oliver@apple.com>
2332
2333         Reviewed by Geoffrey Garen.
2334
2335         Make JSC more resilient in the face of parse failures
2336         https://bugs.webkit.org/show_bug.cgi?id=40951
2337
2338         A number of recent bugs have occurred due to issues like miscounting
2339         BOMs, etc which lead to interesting crashes later on.  Adding this
2340         logic hardens JSC in the face of these errors, and has no impact on
2341         performance (32bit jit actually gets 0.7% faster but I put that down
2342         to cache effects).
2343
2344         * bytecode/CodeBlock.cpp:
2345         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
2346         (JSC::CodeBlock::lineNumberForBytecodeOffset):
2347         (JSC::CodeBlock::expressionRangeForBytecodeOffset):
2348         (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
2349         * bytecode/CodeBlock.h:
2350         (JSC::CodeBlock::bytecodeOffset):
2351         * interpreter/Interpreter.cpp:
2352         (JSC::Interpreter::execute):
2353         (JSC::Interpreter::executeCall):
2354         (JSC::Interpreter::executeConstruct):
2355         (JSC::Interpreter::prepareForRepeatCall):
2356         (JSC::Interpreter::privateExecute):
2357         * jit/JITOpcodes.cpp:
2358         (JSC::JIT::privateCompileCTIMachineTrampolines):
2359         * jit/JITOpcodes32_64.cpp:
2360         (JSC::JIT::privateCompileCTIMachineTrampolines):
2361         * jit/JITStubs.cpp:
2362         (JSC::DEFINE_STUB_FUNCTION):
2363         * runtime/ArrayPrototype.cpp:
2364         (JSC::isNumericCompareFunction):
2365         * runtime/Executable.cpp:
2366         (JSC::FunctionExecutable::compileForCall):
2367         (JSC::FunctionExecutable::compileForConstruct):
2368         (JSC::FunctionExecutable::generateJITCodeForCall):
2369         (JSC::FunctionExecutable::generateJITCodeForConstruct):
2370         (JSC::FunctionExecutable::reparseExceptionInfo):
2371         (JSC::EvalExecutable::reparseExceptionInfo):
2372         * runtime/Executable.h:
2373         (JSC::FunctionExecutable::bytecodeForCall):
2374         (JSC::FunctionExecutable::bytecodeForConstruct):
2375         * runtime/JSGlobalData.cpp:
2376         (JSC::JSGlobalData::numericCompareFunction):
2377
2378 2010-06-21  John Sullivan  <sullivan@apple.com>
2379
2380         Reviewed by Adam Roben.
2381
2382         RetainPtr can't be used in HashMaps or HashSets
2383         <https://bugs.webkit.org/show_bug.cgi?id=40938>
2384         
2385         Added hashing knowledge similar to that in COMPtr.h.
2386
2387         * wtf/RetainPtr.h:
2388         (WTF::RetainPtr::RetainPtr):
2389         New function, copied from COMPtr.h but for the type change.
2390         (WTF::RetainPtr::isHashTableDeletedValue):
2391         Ditto.
2392         (WTF::RetainPtr::hashTableDeletedValue):
2393         Ditto.
2394         Added template code for HashTraits and PtrHash copied from COMPtr.h but for the type change.
2395         The only difference is that constructDeletedValue() matches the RefPtr implementation (in HashTraits.h)
2396         rather than the COMPtr implementation.
2397
2398 2010-06-19  Oliver Hunt  <oliver@apple.com>
2399
2400         Reviewed by Geoffrey Garen.
2401
2402         Need to ensure that we grow the RegisterFile when creating a callframe for host code
2403         https://bugs.webkit.org/show_bug.cgi?id=40858
2404         <rdar://problem/8108986>
2405
2406         In the past the use of the callframe in hostcode was much more
2407         limited.  Now that we expect the callframe to always be valid
2408         we need to grow the RegisterFile so that this is actually the
2409         case.  In this particular case the problem was failing to grow
2410         the registerfile could lead to a callframe that extended beyond
2411         RegisterFiler::end(), so vm re-entry would clobber the callframe
2412         other scenarios could also lead to badness.
2413
2414         I was unable to construct a simple testcase to trigger badness,
2415         and any such testcase would be so dependent on exact vm stack
2416         layout that it would be unlikely to work as a testcase following
2417         any callframe or register allocation changes anyway.
2418
2419         Thankfully the new assertion I added should help to catch these
2420         failures in future, and triggers on a couple of tests currently.
2421
2422         * interpreter/CallFrame.cpp:
2423         (JSC::CallFrame::registerFile):
2424         * interpreter/CallFrame.h:
2425         (JSC::ExecState::init):
2426         * interpreter/Interpreter.cpp:
2427         (JSC::Interpreter::privateExecute):
2428         * jit/JITStubs.cpp:
2429         (JSC::DEFINE_STUB_FUNCTION):
2430
2431 2010-06-21  Satish Sampath  <satish@chromium.org>
2432
2433         Reviewed by Steve Block.
2434
2435         Speech Input Patch 0: Added compilation argument to conditionally compile pending patches.
2436         https://bugs.webkit.org/show_bug.cgi?id=40878
2437
2438         * Configurations/FeatureDefines.xcconfig:
2439
2440 2010-06-21  Kwang Yul Seo  <skyul@company100.net>
2441
2442         Reviewed by Kent Tamura.
2443
2444         [BREWMP] Use global new/delete operator overloading with USE_SYSTEM_MALLOC=1
2445         https://bugs.webkit.org/show_bug.cgi?id=40653
2446
2447         Currently, other ports do not use global new/delete operator overloading
2448         when USE_SYSTEM_MALLOC=1. Brew MP uses system malloc, but it needs to enable
2449         "global fastMalloc new" because the default new/delete causes crash on device.
2450         We need to replace them with Brew MP's MALLOC/FREE.
2451
2452         * wtf/FastMalloc.h:
2453
2454 2010-06-18  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2455
2456         Reviewed by Simon Hausmann.
2457
2458         [Qt] Work around a build problem with libjscore on Symbian.
2459         https://bugs.webkit.org/show_bug.cgi?id=40840
2460
2461         Sbsv2 sometimes have problems with debug/release configuration
2462         determination causing QtWebKit in release to try linking with the debug
2463         JavaScriptCore static library. This patch limit the jscore/jscored
2464         r58306 fix necessary for mac builds only to the mac platform to prevent the
2465         different name problem.
2466
2467         The real fix would be to fix qmake or the toolchain, this patch might
2468         help meanwhile.
2469
2470         * JavaScriptCore.pri:
2471
2472 2010-06-21  Patrick Gansterer  <paroga@paroga.com>
2473
2474         Reviewed by Kent Tamura.
2475
2476         Buildfix after r61338.
2477         https://bugs.webkit.org/show_bug.cgi?id=40888
2478
2479         roundUpAllocationSize is needed in RegisterFile.h.
2480
2481         * jit/ExecutableAllocator.h:
2482
2483 2010-06-19  Kwang Yul Seo  <skyul@company100.net>
2484
2485         Reviewed by Darin Adler.
2486
2487         Include <string.h> in StringExtras.h
2488         https://bugs.webkit.org/show_bug.cgi?id=40808
2489
2490         Without string.h, RVCT 2.2 can't compile StringExtras.h.
2491         It can't find strlen and strncmp.
2492
2493         * wtf/StringExtras.h:
2494
2495 2010-06-19  Thiago Macieira <thiago.macieira@nokia.com>
2496
2497         Reviewed by Kenneth Rohde Christiansen.
2498
2499         Don't use __attribute__((may_alias)) with the Intel compiler,
2500         as it doesn't understand it.
2501
2502         * wtf/Vector.h:
2503
2504 2010-06-19  Thiago Macieira <thiago.macieira@nokia.com>
2505
2506         Reviewed by Kenneth Rohde Christiansen.
2507
2508         Fix compilation with the Intel C++ compiler (11.1.072).
2509
2510         Like RVCT, label pointers must be void*, not const void*.
2511
2512         * bytecode/Opcode.h:
2513
2514 2010-06-19  Thiago Macieira <thiago.macieira@nokia.com>
2515
2516         Reviewed by Kenneth Rohde Christiansen.
2517
2518         Add the WTF_COMPILER_INTEL for when the Intel compiler is used
2519         for building. Usually, the Intel compiler masquerades as
2520         another compiler in the system and gets away with it, but some
2521         times specific fixes are required (such as when using language
2522         extensions).
2523
2524         * wtf/Platform.h:
2525
2526 2010-06-18  Oliver Hunt  <oliver@apple.com>
2527
2528         Reviewed by Geoffrey Garen.
2529
2530         Incorrect handling of multiple BOMs scattered through a file.
2531         https://bugs.webkit.org/show_bug.cgi?id=40865
2532
2533         When determining the offset of open and close braces in a source
2534         with BOMs we were finishing our count early as we failed to account
2535         for BOMs prior to the open/close brace positions effecting those
2536         positions.
2537
2538         * parser/Lexer.cpp:
2539         (JSC::Lexer::sourceCode):
2540
2541 2010-06-17  Oliver Hunt  <oliver@apple.com>
2542
2543         Reviewed by Sam Weinig.
2544
2545         Don't throw away exception information for functions that use exceptions
2546         https://bugs.webkit.org/show_bug.cgi?id=40786
2547
2548         Simple patch to stop JSC from throwing away the exception information
2549         of a function that uses "exceptiony" features like try and throw.  This
2550         is a speed up for catching expressions but it's difficult to quantify as
2551         the old cost of reparsing is amortised over all exceptions caught in the
2552         effected function.
2553
2554         * bytecode/CodeBlock.cpp:
2555         (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
2556         * bytecompiler/BytecodeGenerator.cpp:
2557         (JSC::BytecodeGenerator::generate):
2558         (JSC::BytecodeGenerator::emitCatch):
2559         * bytecompiler/BytecodeGenerator.h:
2560         (JSC::BytecodeGenerator::emitThrow):
2561
2562 2010-06-18  Anders Carlsson  <andersca@apple.com>
2563
2564         Reviewed by Sam Weinig.
2565
2566         Add PlatformStrategies and PluginStrategy classes.
2567         https://bugs.webkit.org/show_bug.cgi?id=40850
2568
2569         * wtf/Platform.h:
2570
2571 2010-06-18  Leandro Pereira  <leandro@profusion.mobi>
2572
2573         [EFL] Unreviewed build fix.
2574
2575         * wtf/CMakeLists.txt: Add MD5.cpp.
2576
2577 2010-06-17  Shu Chang  <chang.shu@nokia.com>
2578
2579         Reviewed by Kenneth Rohde Christiansen.
2580
2581         [Qt] Fix the link error on symbian with ENABLE_JIT=0.
2582         1. Add "#if ENABLE(JIT)" in the header file;
2583         2. Put feature enable/disable logic to a common.pri so
2584         that both JavaScriptCore.pri and WebCore.pri can share.
2585
2586         https://bugs.webkit.org/show_bug.cgi?id=40780
2587
2588         * JavaScriptCore.pri:
2589         * jit/ExecutableAllocator.h:
2590
2591 2010-06-17  Darin Adler  <darin@apple.com>
2592
2593         Reviewed by Sam Weinig.
2594
2595         Use adoptRef and create functions in more code paths
2596         https://bugs.webkit.org/show_bug.cgi?id=40760
2597
2598         * API/JSClassRef.h: Removed unneeded include of RefCounted.h.
2599         * API/JSWeakObjectMapRefPrivate.cpp: Ditto.
2600
2601         * bytecode/CodeBlock.h:
2602         (JSC::FunctionCodeBlock::FunctionCodeBlock): Use the
2603         SharedSymbolTable::create function instead of calling new directly.
2604
2605         * runtime/SymbolTable.h: Added a create function to the SharedSymbolTable
2606         class and made the constructor private.
2607
2608 2010-06-17  Mark Brand  <mabrand@mabrand.nl>
2609
2610         Reviewed by Simon Hausmann.
2611
2612         [Qt] use "win32-g++*" scope to match all MinGW makespecs
2613
2614         The scope "win32-g++" comes from the name of the makespec. However, it
2615         is frequently used to check for MinGW. This works fine as long as
2616         win32-g++ is the only makespec for MinGW. Now we need the wildcard
2617         to cover "win32-g++-cross" as well.
2618
2619         * JavaScriptCore.pro:
2620
2621 2010-06-16  Darin Adler  <darin@apple.com>
2622
2623         Reviewed by David Levin.
2624
2625         Deploy adoptRef in more places, including all HTML and MathML elements
2626         https://bugs.webkit.org/show_bug.cgi?id=39941
2627
2628         * wtf/ThreadSafeShared.h: Made the constructor protected and removed the
2629         unneeded support for initial reference counts other than 1.
2630
2631 2010-06-16  Peter Varga  <pvarga@inf.u-szeged.hu>
2632
2633         Reviewed by Geoffrey Garen.
2634
2635         Store matchBegin directly in the array of output instead of the stack.
2636         https://bugs.webkit.org/show_bug.cgi?id=38988
2637
2638         * yarr/RegexJIT.cpp:
2639         (JSC::Yarr::RegexGenerator::generateDisjunction):
2640         (JSC::Yarr::RegexGenerator::generate):
2641
2642 2010-06-15  Anders Carlsson  <andersca@apple.com>
2643
2644         Reviewed by Sam Weinig.
2645
2646         Make JavaScriptCore build with clang++.
2647
2648         * jit/JITInlineMethods.h:
2649         (JSC::JIT::emitPutVirtualRegister):
2650         Explicitly cast to an int.
2651
2652         * yarr/RegexCompiler.cpp:
2653         (JSC::Yarr::compileRegex):
2654         Return 0 instead of false.
2655
2656 2010-06-15  Adam Roben  <aroben@apple.com>
2657
2658         Make WebCore's and JavaScriptCore's DerivedSources available for debugging in production builds
2659
2660         Fixes <http://webkit.org/b/40626> <rdar://problem/8094205>.
2661
2662         Reviewed by Sam Weinig.
2663
2664         * JavaScriptCore.vcproj/JavaScriptCore.make: Copy the contents of
2665         JavaScriptCore's DerivedSources directory to
2666         AppleInternal/Sources/JavaScriptCore.
2667
2668 2010-06-15  Gabor Loki  <loki@webkit.org>
2669
2670         Rubber-stamped by Eric Seidel.
2671
2672         Fix invalid access to non-static data member warning in JITPropertyAccess32_64 on ARM
2673         https://bugs.webkit.org/show_bug.cgi?id=40423
2674
2675         Using OBJECT_OFFSETOF macro instead of objectof to bypass access to
2676         non-static data member warning.
2677
2678         * jit/JITPropertyAccess32_64.cpp:
2679         (JSC::JIT::privateCompilePutByIdTransition):
2680
2681 2010-06-11  Eric Seidel  <eric@webkit.org>
2682
2683         Reviewed by Adam Barth.
2684
2685         Rename the rest of the *Tokenizer classes to *DocumentParser
2686         https://bugs.webkit.org/show_bug.cgi?id=40507
2687
2688         * wtf/Platform.h:
2689          - fixed a comment to match new names.
2690
2691 2010-06-11  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
2692
2693         Reviewed by Simon Hausmann.
2694
2695         [Qt] Explicit conversions from QtScript types to JSC opaque types were removed.
2696         https://bugs.webkit.org/show_bug.cgi?id=40412
2697
2698         Conversion between a JSC C types and a QtScript private types, takes
2699         main part of the source code. In most cases a mapping between the types
2700         is one to one. New cast operators were added to simplify the code.
2701
2702         The QScriptValuePrivate could be casted to the JSValueRef and the JSObjectRef.
2703         The QScriptEnginePrivate could be casted to the JSGlobalContext.
2704         The QScriptProgramPrivate could be casted to the JSStringRef.
2705
2706         * qt/api/qscriptengine_p.cpp:
2707         (QScriptEnginePrivate::evaluate):
2708         (QScriptEnginePrivate::newObject):
2709         (QScriptEnginePrivate::globalObject):
2710         * qt/api/qscriptengine_p.h:
2711         (QScriptEnginePrivate::operator JSGlobalContextRef):
2712         * qt/api/qscriptprogram_p.h:
2713         (QScriptProgramPrivate::operator JSStringRef):
2714         * qt/api/qscriptsyntaxcheckresult.cpp:
2715         (QScriptSyntaxCheckResultPrivate::~QScriptSyntaxCheckResultPrivate):
2716         (QScriptSyntaxCheckResultPrivate::errorMessage):
2717         (QScriptSyntaxCheckResultPrivate::errorLineNumber):
2718         * qt/api/qscriptvalue_p.h:
2719         (QScriptValuePrivate::~QScriptValuePrivate):
2720         (QScriptValuePrivate::QScriptValuePrivate):
2721         (QScriptValuePrivate::isBool):
2722         (QScriptValuePrivate::isNumber):
2723         (QScriptValuePrivate::isNull):
2724         (QScriptValuePrivate::isString):
2725         (QScriptValuePrivate::isUndefined):
2726         (QScriptValuePrivate::isFunction):
2727         (QScriptValuePrivate::toString):
2728         (QScriptValuePrivate::toNumber):
2729         (QScriptValuePrivate::toBool):
2730         (QScriptValuePrivate::toObject):
2731         (QScriptValuePrivate::equals):
2732         (QScriptValuePrivate::strictlyEquals):
2733         (QScriptValuePrivate::instanceOf):
2734         (QScriptValuePrivate::call):
2735         (QScriptValuePrivate::operator JSValueRef):
2736         (QScriptValuePrivate::operator JSObjectRef):
2737         (QScriptValuePrivate::setValue):
2738         (QScriptValuePrivate::inherits):
2739         (QScriptValuePrivate::refinedJSValue):
2740
2741 2010-05-31  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2742
2743         Reviewed by Simon Hausmann.
2744
2745         [Qt] Implement the simple text code path.
2746         https://bugs.webkit.org/show_bug.cgi?id=40077
2747
2748         Remove the FONT_FAST_PATH macro and use the Qt's
2749         fast text implementation instead of the one of WebKit.
2750
2751         The Qt::TextBypassShaping flag is used to tell Qt to
2752         only use the glyph advances.
2753
2754         Qt 4.7 is needed to get this flag thus the complex path is always
2755         used if QtWebKit is compiled against an earlier version.
2756
2757         Contrary to the WebKit's implementation, the complex code path
2758         is taken if the text is RightToLeft, justified or is formatted
2759         with non-zero letter or word spacing.
2760
2761         * wtf/Platform.h:
2762
2763 2010-06-11  Luiz Agostini  <luiz.agostini@openbossa.org>
2764
2765         Reviewed by Kenneth Rohde Christiansen.
2766
2767         add codePointCompare to JavaScriptCore.exp
2768         https://bugs.webkit.org/show_bug.cgi?id=40426
2769
2770         * JavaScriptCore.exp:
2771
2772 2010-06-10  Oliver Hunt  <oliver@apple.com>
2773
2774         Reviewed by Maciej Stachowiak.
2775
2776         Math Javascript Bug on Safari 5 (webkit 533.16) under "32bit" mode
2777         https://bugs.webkit.org/show_bug.cgi?id=40367
2778
2779         If we're in the slow case of right shift we must write the type tag as
2780         the only reason we hit this code path is because we know we're working
2781         with a double.  eg. we are guaranteed that the tag cannot be reused.
2782
2783         * jit/JITArithmetic32_64.cpp:
2784         (JSC::JIT::emitRightShiftSlowCase):
2785
2786 2010-06-10  Kwang Yul Seo  <skyul@company100.net>
2787
2788         Reviewed by Eric Seidel.
2789
2790         Remove weakRandomNumber
2791         https://bugs.webkit.org/show_bug.cgi?id=40291
2792
2793         weakRandomNumber is used nowhere. Currently, WeakRandom is used instead.
2794
2795         * wtf/RandomNumber.cpp:
2796         * wtf/RandomNumber.h:
2797
2798 2010-06-09  Alexey Proskuryakov  <ap@apple.com>
2799
2800         Reviewed by Brady Eidson.
2801
2802         Export StringImpl::ascii(). It might be not very useful, but it's a public function.
2803
2804         * JavaScriptCore.exp:
2805
2806 2010-06-09  Leandro Pereira  <leandro@profusion.mobi>
2807
2808         Reviewed by Adam Treat.
2809
2810         [EFL] Allow building core libraries as shared objects to speed up
2811         linking time on machines with small amounts of memory.
2812         http://webkit.org/b/39899
2813
2814         * CMakeLists.txt: If building with shared core, install the lib.
2815         * jsc/CMakeListsEfl.txt: Needs Glib and Ecore to link dynamically.
2816         * wtf/CMakeLists.txt: If building with shared core, install the lib.
2817
2818 2010-06-09  Gabor Loki  <loki@webkit.org>
2819
2820         Reviewed by David Levin.
2821
2822         Remove some unused variable warnings from JITOpcodes
2823         https://bugs.webkit.org/show_bug.cgi?id=40298
2824
2825         * jit/JITOpcodes.cpp:
2826         (JSC::JIT::privateCompileCTINativeCall):
2827         * jit/JITOpcodes32_64.cpp:
2828         (JSC::JIT::privateCompileCTINativeCall):
2829
2830 2010-05-18  Yuzo Fujishima  <yuzo@google.com>
2831
2832         Reviewed by Shinichiro Hamaji.
2833
2834         Fix for Bug 34529 -  [CSSOM] issues with cssText and selectorText
2835         Add U16_LENGTH that is needed to implement CSS character serialization.
2836         https://bugs.webkit.org/show_bug.cgi?id=34529
2837
2838         * wtf/unicode/qt4/UnicodeQt4.h:
2839         * wtf/unicode/wince/UnicodeWince.h:
2840
2841 2010-06-08  Sheriff Bot  <webkit.review.bot@gmail.com>
2842
2843         Unreviewed, rolling out r60830.
2844         http://trac.webkit.org/changeset/60830
2845         https://bugs.webkit.org/show_bug.cgi?id=40305
2846
2847         Broke the Windows build (Requested by abarth on #webkit).
2848
2849         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2850         * wtf/OwnPtrCommon.h:
2851         * wtf/brew/OwnPtrBrew.h: Removed.
2852         * wtf/win/OwnPtrWin.h: Removed.
2853
2854 2010-06-08  MORITA Hajime  <morrita@google.com>
2855
2856         Unreviewed. An attempt to fix test break.
2857
2858         * Configurations/FeatureDefines.xcconfig:
2859
2860 2010-06-08  Kwang Yul Seo  <skyul@company100.net>
2861
2862         Reviewed by Adam Barth.
2863
2864         Change OwnPtrCommon to include platform-specific headers
2865         https://bugs.webkit.org/show_bug.cgi?id=40279
2866
2867         Adding new type to OwnPtrCommon needlessly causes all ports to do full rebuilds.
2868         Change OwnPtrCommon to include platform-specific headers to avoid all ports rebuilds.
2869
2870         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2871         * wtf/OwnPtrCommon.h:
2872         * wtf/brew/OwnPtrBrew.h: Added.
2873         * wtf/win/OwnPtrWin.h: Added.
2874
2875 2010-06-07  MORITA Hajime  <morrita@google.com>
2876         
2877         Reviewed by Kent Tamura.
2878
2879         https://bugs.webkit.org/show_bug.cgi?id=40219
2880         [Mac] ENABLE_METER_TAG should be enabled
2881         
2882         Added ENABLE_METER_TAG.
2883
2884         * Configurations/FeatureDefines.xcconfig:
2885
2886 2010-06-07  Kwang Yul Seo  <skyul@company100.net>
2887
2888         Reviewed by Eric Seidel.
2889
2890         [BREWMP] Add more types to OwnPtr
2891         https://bugs.webkit.org/show_bug.cgi?id=39667
2892
2893         Add ISSL and ISocket to the list of OwnPtr-ed type.
2894
2895         * wtf/OwnPtrCommon.h:
2896         * wtf/brew/OwnPtrBrew.cpp:
2897         (WTF::deleteOwnedPtr):
2898
2899 2010-06-07  Benjamin Poulain  <benjamin.poulain@nokia.com>
2900
2901         Reviewed by Simon Hausmann.
2902
2903         [Qt] Crash when compiling on Snow Leopard and running on Leopard
2904         https://bugs.webkit.org/show_bug.cgi?id=31403
2905
2906         Disable the use of pthread_setname_np and other symbols
2907         when targetting Leopard.
2908
2909         Use the defines TARGETING_XX instead of BUILDING_ON_XX 
2910         for features that cannot be used before Snow Leopard.
2911
2912         * wtf/Platform.h:
2913
2914 2010-06-07  Gabor Loki  <loki@webkit.org>
2915
2916         Reviewed by NOBODY (JSVALUE32_64 build fix).
2917
2918         * jit/JITOpcodes32_64.cpp:
2919         (JSC::JIT::privateCompileCTINativeCall):
2920
2921 2010-06-06  Gavin Barraclough  <barraclough@apple.com>
2922
2923         Reviewed by NOBODY (windows build fix pt 2).
2924
2925         * JavaScriptCore.exp:
2926         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2927
2928 2010-06-06  Gavin Barraclough  <barraclough@apple.com>
2929
2930         Reviewed by NOBODY (windows build fix pt 1).
2931
2932         * JavaScriptCore.exp:
2933         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2934
2935 2010-06-06  Gavin Barraclough  <barraclough@apple.com>
2936
2937         Reviewed by Sam Weinig.
2938
2939         Bug 40214 - Clean up error construction / throwing in JSC.
2940         
2941         The one egregious insanity here is that creating an error requires
2942         a VM-entry-esqe-host call (the string argument is wrapped as a JS
2943         object & pushed on the RegisterFile, then unwrapped back to a
2944         UString).  Changing this also means you only require a global
2945         object, not an ExecState, to create an error.
2946
2947         The methods to create error objects are also parameterized
2948         requiring a switch on the type, which can be made cleaner and
2949         faster by moving to a separate method per error type.  Code to add
2950         divot information to error had been duplicated, and is coalesced
2951         back into a single function.
2952
2953         Convenience methods added to create & throw type & syntax error
2954         with a default error message, since this is a common case.
2955
2956         Also, errors are currently thrown either using
2957         "throwError(exec, error)" or "exec->setException(error)" - unify
2958         on the former, since this is more commonly used.  Add
2959         "throwVMError(exec, error)" equivalents, as a convenience for
2960         cases where the result was being wrapped in "JSValue::encode(...)".
2961
2962         * API/JSCallbackConstructor.cpp:
2963         (JSC::constructJSCallback):
2964         * API/JSCallbackFunction.cpp:
2965         (JSC::JSCallbackFunction::call):
2966         * API/JSCallbackObjectFunctions.h:
2967         (JSC::::getOwnPropertySlot):
2968         (JSC::::put):
2969         (JSC::::deleteProperty):
2970         (JSC::::construct):
2971         (JSC::::hasInstance):
2972         (JSC::::call):
2973         (JSC::::toNumber):
2974         (JSC::::toString):
2975         (JSC::::staticValueGetter):
2976         (JSC::::staticFunctionGetter):
2977         (JSC::::callbackGetter):
2978         * API/JSObjectRef.cpp:
2979         (JSObjectMakeError):
2980         * JavaScriptCore.exp:
2981         * bytecompiler/BytecodeGenerator.cpp:
2982         (JSC::BytecodeGenerator::emitNewError):
2983         (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
2984         * bytecompiler/BytecodeGenerator.h:
2985         * bytecompiler/NodesCodegen.cpp:
2986         (JSC::ThrowableExpressionData::emitThrowError):
2987         (JSC::RegExpNode::emitBytecode):
2988         (JSC::PostfixErrorNode::emitBytecode):
2989         (JSC::PrefixErrorNode::emitBytecode):
2990         (JSC::AssignErrorNode::emitBytecode):
2991         (JSC::ForInNode::emitBytecode):
2992         (JSC::ContinueNode::emitBytecode):
2993         (JSC::BreakNode::emitBytecode):
2994         (JSC::ReturnNode::emitBytecode):
2995         (JSC::LabelNode::emitBytecode):
2996         * interpreter/CallFrame.h:
2997         * interpreter/Interpreter.cpp:
2998         (JSC::Interpreter::throwException):
2999         (JSC::Interpreter::privateExecute):
3000         * jit/JITStubs.cpp:
3001         (JSC::DEFINE_STUB_FUNCTION):
3002         * jsc.cpp:
3003         (functionRun):
3004         (functionLoad):
3005         (functionCheckSyntax):
3006         * parser/Nodes.h:
3007         * runtime/ArrayConstructor.cpp:
3008         (JSC::constructArrayWithSizeQuirk):
3009         * runtime/ArrayPrototype.cpp:
3010         (JSC::arrayProtoFuncToString):
3011         (JSC::arrayProtoFuncToLocaleString):
3012         (JSC::arrayProtoFuncJoin):
3013         (JSC::arrayProtoFuncFilter):
3014         (JSC::arrayProtoFuncMap):
3015         (JSC::arrayProtoFuncEvery):
3016         (JSC::arrayProtoFuncForEach):
3017         (JSC::arrayProtoFuncSome):
3018         (JSC::arrayProtoFuncReduce):
3019         (JSC::arrayProtoFuncReduceRight):
3020         * runtime/BooleanPrototype.cpp:
3021         (JSC::booleanProtoFuncToString):
3022         (JSC::booleanProtoFuncValueOf):
3023         * runtime/DatePrototype.cpp:
3024         (JSC::dateProtoFuncToString):
3025         (JSC::dateProtoFuncToUTCString):
3026         (JSC::dateProtoFuncToISOString):
3027         (JSC::dateProtoFuncToDateString):
3028         (JSC::dateProtoFuncToTimeString):
3029         (JSC::dateProtoFuncToLocaleString):
3030         (JSC::dateProtoFuncToLocaleDateString):
3031         (JSC::dateProtoFuncToLocaleTimeString):
3032         (JSC::dateProtoFuncGetTime):
3033         (JSC::dateProtoFuncGetFullYear):
3034         (JSC::dateProtoFuncGetUTCFullYear):
3035         (JSC::dateProtoFuncToGMTString):
3036         (JSC::dateProtoFuncGetMonth):
3037         (JSC::dateProtoFuncGetUTCMonth):
3038         (JSC::dateProtoFuncGetDate):
3039         (JSC::dateProtoFuncGetUTCDate):
3040         (JSC::dateProtoFuncGetDay):
3041         (JSC::dateProtoFuncGetUTCDay):
3042         (JSC::dateProtoFuncGetHours):
3043         (JSC::dateProtoFuncGetUTCHours):
3044         (JSC::dateProtoFuncGetMinutes):
3045         (JSC::dateProtoFuncGetUTCMinutes):
3046         (JSC::dateProtoFuncGetSeconds):
3047         (JSC::dateProtoFuncGetUTCSeconds):
3048         (JSC::dateProtoFuncGetMilliSeconds):
3049         (JSC::dateProtoFuncGetUTCMilliseconds):
3050         (JSC::dateProtoFuncGetTimezoneOffset):
3051         (JSC::dateProtoFuncSetTime):
3052         (JSC::setNewValueFromTimeArgs):
3053         (JSC::setNewValueFromDateArgs):
3054         (JSC::dateProtoFuncSetMilliSeconds):
3055         (JSC::dateProtoFuncSetUTCMilliseconds):
3056         (JSC::dateProtoFuncSetSeconds):
3057         (JSC::dateProtoFuncSetUTCSeconds):
3058         (JSC::dateProtoFuncSetMinutes):
3059         (JSC::dateProtoFuncSetUTCMinutes):
3060         (JSC::dateProtoFuncSetHours):
3061         (JSC::dateProtoFuncSetUTCHours):
3062         (JSC::dateProtoFuncSetDate):
3063         (JSC::dateProtoFuncSetUTCDate):
3064         (JSC::dateProtoFuncSetMonth):
3065         (JSC::dateProtoFuncSetUTCMonth):
3066         (JSC::dateProtoFuncSetFullYear):
3067         (JSC::dateProtoFuncSetUTCFullYear):
3068         (JSC::dateProtoFuncSetYear):
3069         (JSC::dateProtoFuncGetYear):
3070         (JSC::dateProtoFuncToJSON):
3071         * runtime/Error.cpp:
3072         (JSC::createError):
3073         (JSC::createEvalError):
3074         (JSC::createRangeError):
3075         (JSC::createReferenceError):
3076         (JSC::createSyntaxError):
3077         (JSC::createTypeError):
3078         (JSC::createURIError):
3079         (JSC::addErrorSourceInfo):
3080         (JSC::addErrorDivotInfo):
3081         (JSC::addErrorInfo):
3082         (JSC::hasErrorInfo):
3083         (JSC::throwError):
3084         (JSC::throwTypeError):
3085         (JSC::throwSyntaxError):
3086         * runtime/Error.h:
3087         (JSC::throwVMError):
3088         (JSC::throwVMTypeError):
3089         * runtime/ErrorConstructor.cpp:
3090         (JSC::constructWithErrorConstructor):
3091         (JSC::callErrorConstructor):
3092         * runtime/ErrorConstructor.h:
3093         * runtime/ErrorInstance.cpp:
3094         (JSC::ErrorInstance::ErrorInstance):
3095         (JSC::ErrorInstance::create):
3096         * runtime/ErrorInstance.h:
3097         * runtime/ErrorPrototype.cpp:
3098         (JSC::ErrorPrototype::ErrorPrototype):
3099         * runtime/ExceptionHelpers.cpp:
3100         (JSC::createStackOverflowError):
3101         (JSC::createUndefinedVariableError):
3102         (JSC::createInvalidParamError):
3103         (JSC::createNotAConstructorError):
3104         (JSC::createNotAFunctionError):
3105         (JSC::createNotAnObjectError):
3106         (JSC::throwOutOfMemoryError):
3107         * runtime/ExceptionHelpers.h:
3108         * runtime/Executable.cpp:
3109         (JSC::EvalExecutable::compile):
3110         (JSC::ProgramExecutable::checkSyntax):
3111         (JSC::ProgramExecutable::compile):
3112         * runtime/FunctionConstructor.cpp:
3113         (JSC::constructFunction):
3114         * runtime/FunctionPrototype.cpp:
3115         (JSC::functionProtoFuncToString):
3116         (JSC::functionProtoFuncApply):
3117         (JSC::functionProtoFuncCall):
3118         * runtime/Identifier.cpp:
3119         (JSC::Identifier::from):
3120         * runtime/Identifier.h:
3121         * runtime/JSArray.cpp:
3122         (JSC::JSArray::put):
3123         * runtime/JSFunction.cpp:
3124         (JSC::callHostFunctionAsConstructor):
3125         * runtime/JSGlobalObjectFunctions.cpp:
3126         (JSC::encode):
3127         (JSC::decode):
3128         (JSC::globalFuncEval):
3129         * runtime/JSONObject.cpp:
3130         (JSC::Stringifier::appendStringifiedValue):
3131         (JSC::Walker::walk):
3132         (JSC::JSONProtoFuncParse):
3133         (JSC::JSONProtoFuncStringify):
3134         * runtime/JSObject.cpp:
3135         (JSC::throwSetterError):
3136         (JSC::JSObject::put):
3137         (JSC::JSObject::putWithAttributes):
3138         (JSC::JSObject::defaultValue):
3139         (JSC::JSObject::hasInstance):
3140         (JSC::JSObject::defineOwnProperty):
3141         * runtime/JSObject.h:
3142         * runtime/JSValue.cpp:
3143         (JSC::JSValue::toObjectSlowCase):
3144         (JSC::JSValue::synthesizeObject):
3145         (JSC::JSValue::synthesizePrototype):
3146         * runtime/NativeErrorConstructor.cpp:
3147         (JSC::constructWithNativeErrorConstructor):
3148         (JSC::callNativeErrorConstructor):
3149         * runtime/NativeErrorConstructor.h:
3150         * runtime/NumberPrototype.cpp:
3151         (JSC::numberProtoFuncToString):
3152         (JSC::numberProtoFuncToLocaleString):
3153         (JSC::numberProtoFuncValueOf):
3154         (JSC::numberProtoFuncToFixed):
3155         (JSC::numberProtoFuncToExponential):
3156         (JSC::numberProtoFuncToPrecision):
3157         * runtime/ObjectConstructor.cpp:
3158         (JSC::objectConstructorGetPrototypeOf):
3159         (JSC::objectConstructorGetOwnPropertyDescriptor):
3160         (JSC::objectConstructorGetOwnPropertyNames):
3161         (JSC::objectConstructorKeys):
3162         (JSC::toPropertyDescriptor):
3163         (JSC::objectConstructorDefineProperty):
3164         (JSC::objectConstructorDefineProperties):
3165         (JSC::objectConstructorCreate):
3166         * runtime/ObjectPrototype.cpp:
3167         (JSC::objectProtoFuncDefineGetter):
3168         (JSC::objectProtoFuncDefineSetter):
3169         * runtime/RegExpConstructor.cpp:
3170         (JSC::constructRegExp):
3171         * runtime/RegExpObject.cpp:
3172         (JSC::RegExpObject::match):
3173         * runtime/RegExpPrototype.cpp:
3174         (JSC::regExpProtoFuncTest):
3175         (JSC::regExpProtoFuncExec):
3176         (JSC::regExpProtoFuncCompile):
3177         (JSC::regExpProtoFuncToString):
3178         * runtime/StringPrototype.cpp:
3179         (JSC::stringProtoFuncToString):
3180
3181 2010-06-05  Kwang Yul Seo  <skyul@company100.net>
3182
3183         Reviewed by Eric Seidel.
3184
3185         [BREWMP] Add PLATFORM(BREWMP) guard for using std::xxx
3186         https://bugs.webkit.org/show_bug.cgi?id=39710
3187
3188         Build fix for BREW MP.
3189
3190         * wtf/MathExtras.h:
3191
3192 2010-06-04  Adam Barth  <abarth@webkit.org>
3193
3194         Reviewed by Darin Adler.
3195
3196         HTML5 parser should be within 1% of old parser performance
3197         https://bugs.webkit.org/show_bug.cgi?id=40172
3198
3199         Fix cast in this operator= to allow for assignment between vectors with
3200         different inline capacities (as clearly intended by its author).
3201
3202         * wtf/Vector.h:
3203         (WTF::::operator):
3204
3205 2010-06-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3206
3207         Reviewed by Kenneth Rohde Christiansen.
3208
3209         New QtScript API; QScriptValue::instanceOf.
3210
3211         New function create an easy way to check value's prototype hierarchy.
3212
3213         [Qt] QScriptValue should have an instanceOf method
3214         https://bugs.webkit.org/show_bug.cgi?id=40120
3215
3216         * qt/api/qscriptvalue.cpp:
3217         (QScriptValue::instanceOf):
3218         * qt/api/qscriptvalue.h:
3219         * qt/api/qscriptvalue_p.h:
3220         (QScriptValuePrivate::instanceOf):
3221         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
3222         * qt/tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp:
3223         (tst_QScriptValue::instanceOf_initData):
3224         (tst_QScriptValue::instanceOf_makeData):
3225         (tst_QScriptValue::instanceOf_test):
3226
3227 2010-06-04  Gavin Barraclough  <barraclough@apple.com>
3228
3229         Reviewed by NOBODY (interpreter build fix).
3230
3231         * interpreter/Interpreter.cpp:
3232         (JSC::Interpreter::privateExecute):
3233
3234 2010-06-04  Mark Rowe  <mrowe@apple.com>
3235
3236         Silence some warnings seen on the build bot.
3237
3238         * JavaScriptCore.JSVALUE32_64only.exp: Add a trailing newline.
3239         * JavaScriptCore.JSVALUE32only.exp: Ditto.
3240         * JavaScriptCore.JSVALUE64only.exp: Ditto.
3241         * JavaScriptCore.xcodeproj/project.pbxproj: Remove the .exp files from all targets so that Xcode doesn't
3242         complain about not knowing how to compile them.
3243
3244 2010-06-04  Gavin Barraclough  <barraclough@apple.com>
3245
3246         Reviewed by Oliver Hunt.
3247
3248         Bug 40187 - Change function signature of NativeConstructor to match NativeFunction
3249
3250         Mostly for consistency, but constructor & args arguments are redundant,
3251         and this will help if we wish to be able to JIT calls to more constructors.
3252
3253         * API/JSCallbackConstructor.cpp:
3254         (JSC::constructJSCallback):
3255         * API/JSCallbackObject.h:
3256         * API/JSCallbackObjectFunctions.h:
3257         (JSC::::construct):
3258         * interpreter/Interpreter.cpp:
3259         (JSC::Interpreter::executeConstruct):
3260         * interpreter/Interpreter.h:
3261         * jit/JITStubs.cpp:
3262         (JSC::DEFINE_STUB_FUNCTION):
3263         * runtime/ArrayConstructor.cpp:
3264         (JSC::constructWithArrayConstructor):
3265         * runtime/BooleanConstructor.cpp:
3266         (JSC::constructWithBooleanConstructor):
3267         * runtime/ConstructData.cpp:
3268         (JSC::construct):
3269         * runtime/ConstructData.h:
3270         * runtime/DateConstructor.cpp:
3271         (JSC::constructWithDateConstructor):
3272         * runtime/Error.cpp:
3273         (JSC::constructNativeError):
3274         (JSC::Error::create):
3275         * runtime/ErrorConstructor.cpp:
3276         (JSC::constructWithErrorConstructor):
3277         * runtime/FunctionConstructor.cpp:
3278         (JSC::constructWithFunctionConstructor):
3279         * runtime/NativeErrorConstructor.cpp:
3280         (JSC::constructWithNativeErrorConstructor):
3281         * runtime/NativeErrorConstructor.h:
3282         (JSC::NativeErrorConstructor::errorStructure):
3283         * runtime/NumberConstructor.cpp:
3284         (JSC::constructWithNumberConstructor):
3285         * runtime/ObjectConstructor.cpp:
3286         (JSC::constructWithObjectConstructor):
3287         * runtime/RegExpConstructor.cpp:
3288         (JSC::constructWithRegExpConstructor):
3289         * runtime/StringConstructor.cpp:
3290         (JSC::constructWithStringConstructor):
3291
3292 2010-06-04  Tony Gentilcore  <tonyg@chromium.org>
3293
3294         Reviewed by Adam Barth.
3295
3296         Add a takeFirst() method to Deque and use it where appropriate.
3297         https://bugs.webkit.org/show_bug.cgi?id=40089
3298
3299         * wtf/Deque.h:
3300         (WTF::::takeFirst):
3301         * wtf/MainThread.cpp:
3302         (WTF::dispatchFunctionsFromMainThread):
3303         * wtf/MessageQueue.h:
3304         (WTF::::tryGetMessage):
3305
3306 2010-06-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3307
3308         Reviewed by Kenneth Rohde Christiansen.
3309
3310         Remove a QEXPECT_FAIL flag from an autotest.
3311
3312         Test tst_QScriptEngine::globalObject pass after 36600 bug
3313         fix have been applied.
3314
3315         [Qt] Expected fail in the tst_QScriptEngine::globalObject should be removed.
3316         https://bugs.webkit.org/show_bug.cgi?id=40114
3317
3318         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
3319         (tst_QScriptEngine::globalObject):
3320
3321 2010-06-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3322
3323         Reviewed by Kenneth Rohde Christiansen.
3324
3325         Fix QScriptValue::equals.
3326
3327         Handling for a few edge cases were added. Now comparison between
3328         NaN, an invalid objects should works as supposed.
3329
3330         [Qt] QScriptValue::equals problems
3331         https://bugs.webkit.org/show_bug.cgi?id=40110
3332
3333         * qt/api/qscriptvalue.cpp:
3334         (QScriptValue::equals):
3335         * qt/api/qscriptvalue_p.h:
3336         (QScriptValuePrivate::equals):
3337         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
3338         * qt/tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp:
3339         (tst_QScriptValue::equals_initData):
3340         (tst_QScriptValue::equals_makeData):
3341         (tst_QScriptValue::equals_test):
3342
3343 2010-06-03  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3344
3345         Reviewed by Kenneth Rohde Christiansen.
3346
3347         New states in QScriptValuePrivate.
3348
3349         The CSpecial state was divided into CNull and CUndefined. It simplify
3350         the QScriptValue code by avoiding a few "cast" and "if".
3351         Moreover the MSVS compiler didn't like casting between a double and an
3352         enum which is avoided now.
3353
3354         [Qt] The QScriptValuePrivate::CSpecial is too generic.
3355         https://bugs.webkit.org/show_bug.cgi?id=40067
3356
3357         * qt/api/qscriptvalue_p.h:
3358         (QScriptValuePrivate::):
3359         (QScriptValuePrivate::QScriptValuePrivate):
3360         (QScriptValuePrivate::isNull):
3361         (QScriptValuePrivate::isUndefined):
3362         (QScriptValuePrivate::toString):
3363         (QScriptValuePrivate::toNumber):
3364         (QScriptValuePrivate::toBool):
3365         (QScriptValuePrivate::toObject):
3366         (QScriptValuePrivate::assignEngine):
3367         (QScriptValuePrivate::isNumberBased):
3368
3369 2010-06-03  Gavin Barraclough  <barraclough@apple.com>
3370
3371         Reviewed by NOBODY (Qt build fix).
3372
3373         * wtf/Platform.h:
3374
3375 2010-06-03  Gavin Barraclough  <barraclough@apple.com>
3376
3377         Reviewed by Mark Rowe.
3378
3379         Bug 40150 - ENABLE_JIT_OPTIMIZE_NATIVE_CALL on all x86/x86_64 platforms
3380         This was fixed in bug #40094.
3381
3382         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3383         * wtf/Platform.h:
3384
3385 2010-06-03  Gavin Barraclough  <barraclough@apple.com>
3386
3387         Reviewed by NOBODY (Interpreter build fix).
3388
3389         * JavaScriptCore.JSVALUE32_64only.exp:
3390         * JavaScriptCore.JSVALUE32only.exp:
3391         * JavaScriptCore.JSVALUE64only.exp:
3392         * interpreter/Interpreter.cpp:
3393         (JSC::Interpreter::privateExecute):
3394
3395 2010-06-03  Gavin Barraclough  <barraclough@apple.com>
3396
3397         Reviewed by NOBODY (windows build fix II).
3398
3399         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3400
3401 2010-06-03  Gavin Barraclough  <barraclough@apple.com>
3402
3403         Reviewed by NOBODY (windows build fix).
3404
3405         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3406
3407 2010-06-02  Gavin Barraclough  <barraclough@apple.com>
3408
3409         Reviewed by Oliver Hunt.
3410
3411         Bug 40094 - The return type of NativeFunction should be EncodedJSValue
3412         On Windows & Linux, using JSVALUE32_64, EncodedJSValue is returned in registers, but JSValue is not.
3413
3414         * API/JSCallbackFunction.cpp:
3415         (JSC::JSCallbackFunction::call):
3416         * API/JSCallbackFunction.h:
3417         * API/JSCallbackObject.h:
3418         * API/JSCallbackObjectFunctions.h:
3419         (JSC::::call):
3420         * JavaScriptCore.exp:
3421         * interpreter/Interpreter.cpp:
3422         (JSC::Interpreter::executeCall):
3423         * jit/JITStubs.cpp:
3424         (JSC::DEFINE_STUB_FUNCTION):
3425         * jit/JITStubs.h:
3426         * jsc.cpp:
3427         (functionPrint):
3428         (functionDebug):
3429         (functionGC):
3430         (functionVersion):
3431         (functionRun):
3432         (functionLoad):
3433         (functionCheckSyntax):
3434         (functionSetSamplingFlags):
3435         (functionClearSamplingFlags):
3436         (functionReadline):
3437         (functionQuit):
3438         * runtime/ArrayConstructor.cpp:
3439         (JSC::callArrayConstructor):
3440         (JSC::arrayConstructorIsArray):
3441         * runtime/ArrayPrototype.cpp:
3442         (JSC::arrayProtoFuncToString):
3443         (JSC::arrayProtoFuncToLocaleString):
3444         (JSC::arrayProtoFuncJoin):
3445         (JSC::arrayProtoFuncConcat):
3446         (JSC::arrayProtoFuncPop):
3447         (JSC::arrayProtoFuncPush):
3448         (JSC::arrayProtoFuncReverse):
3449         (JSC::arrayProtoFuncShift):
3450         (JSC::arrayProtoFuncSlice):
3451         (JSC::arrayProtoFuncSort):
3452         (JSC::arrayProtoFuncSplice):
3453         (JSC::arrayProtoFuncUnShift):
3454         (JSC::arrayProtoFuncFilter):
3455         (JSC::arrayProtoFuncMap):
3456         (JSC::arrayProtoFuncEvery):
3457         (JSC::arrayProtoFuncForEach):
3458         (JSC::arrayProtoFuncSome):
3459         (JSC::arrayProtoFuncReduce):
3460         (JSC::arrayProtoFuncReduceRight):
3461         (JSC::arrayProtoFuncIndexOf):
3462         (JSC::arrayProtoFuncLastIndexOf):
3463         * runtime/BooleanConstructor.cpp:
3464         (JSC::callBooleanConstructor):
3465         * runtime/BooleanPrototype.cpp:
3466         (JSC::booleanProtoFuncToString):
3467         (JSC::booleanProtoFuncValueOf):
3468         * runtime/CallData.h:
3469         * runtime/DateConstructor.cpp:
3470         (JSC::callDate):
3471         (JSC::dateParse):
3472         (JSC::dateNow):
3473         (JSC::dateUTC):
3474         * runtime/DatePrototype.cpp:
3475         (JSC::dateProtoFuncToString):
3476         (JSC::dateProtoFuncToUTCString):
3477         (JSC::dateProtoFuncToISOString):
3478         (JSC::dateProtoFuncToDateString):
3479         (JSC::dateProtoFuncToTimeString):
3480         (JSC::dateProtoFuncToLocaleString):
3481         (JSC::dateProtoFuncToLocaleDateString):
3482         (JSC::dateProtoFuncToLocaleTimeString):
3483         (JSC::dateProtoFuncGetTime):
3484         (JSC::dateProtoFuncGetFullYear):
3485         (JSC::dateProtoFuncGetUTCFullYear):
3486         (JSC::dateProtoFuncToGMTString):
3487         (JSC::dateProtoFuncGetMonth):
3488         (JSC::dateProtoFuncGetUTCMonth):
3489         (JSC::dateProtoFuncGetDate):
3490         (JSC::dateProtoFuncGetUTCDate):
3491         (JSC::dateProtoFuncGetDay):
3492         (JSC::dateProtoFuncGetUTCDay):
3493         (JSC::dateProtoFuncGetHours):
3494         (JSC::dateProtoFuncGetUTCHours):
3495         (JSC::dateProtoFuncGetMinutes):
3496         (JSC::dateProtoFuncGetUTCMinutes):
3497         (JSC::dateProtoFuncGetSeconds):
3498         (JSC::dateProtoFuncGetUTCSeconds):
3499         (JSC::dateProtoFuncGetMilliSeconds):
3500         (JSC::dateProtoFuncGetUTCMilliseconds):
3501         (JSC::dateProtoFuncGetTimezoneOffset):
3502         (JSC::dateProtoFuncSetTime):
3503         (JSC::dateProtoFuncSetMilliSeconds):
3504         (JSC::dateProtoFuncSetUTCMilliseconds):
3505         (JSC::dateProtoFuncSetSeconds):
3506         (JSC::dateProtoFuncSetUTCSeconds):
3507         (JSC::dateProtoFuncSetMinutes):
3508         (JSC::dateProtoFuncSetUTCMinutes):
3509         (JSC::dateProtoFuncSetHours):
3510         (JSC::dateProtoFuncSetUTCHours):
3511         (JSC::dateProtoFuncSetDate):
3512         (JSC::dateProtoFuncSetUTCDate):
3513         (JSC::dateProtoFuncSetMonth):
3514         (JSC::dateProtoFuncSetUTCMonth):
3515         (JSC::dateProtoFuncSetFullYear):
3516         (JSC::dateProtoFuncSetUTCFullYear):
3517         (JSC::dateProtoFuncSetYear):
3518         (JSC::dateProtoFuncGetYear):
3519         (JSC::dateProtoFuncToJSON):
3520         * runtime/ErrorConstructor.cpp:
3521         (JSC::callErrorConstructor):
3522         * runtime/ErrorPrototype.cpp:
3523         (JSC::errorProtoFuncToString):
3524         * runtime/FunctionConstructor.cpp:
3525         (JSC::callFunctionConstructor):
3526         * runtime/FunctionPrototype.cpp:
3527         (JSC::callFunctionPrototype):
3528         (JSC::functionProtoFuncToString):
3529         (JSC::functionProtoFuncApply):
3530         (JSC::functionProtoFuncCall):
3531         * runtime/JSCell.h:
3532         (JSC::getCallData):
3533         (JSC::getConstructData):
3534         * runtime/JSFunction.cpp:
3535         (JSC::callHostFunctionAsConstructor):
3536         * runtime/JSFunction.h:
3537         * runtime/JSGlobalObjectFunctions.cpp:
3538         (JSC::globalFuncEval):
3539         (JSC::globalFuncParseInt):
3540         (JSC::globalFuncParseFloat):
3541         (JSC::globalFuncIsNaN):
3542         (JSC::globalFuncIsFinite):
3543         (JSC::globalFuncDecodeURI):
3544         (JSC::globalFuncDecodeURIComponent):
3545         (JSC::globalFuncEncodeURI):
3546         (JSC::globalFuncEncodeURIComponent):
3547         (JSC::globalFuncEscape):
3548         (JSC::globalFuncUnescape):
3549         (JSC::globalFuncJSCPrint):
3550         * runtime/JSGlobalObjectFunctions.h:
3551         * runtime/JSONObject.cpp:
3552         (JSC::JSONProtoFuncParse):
3553         (JSC::JSONProtoFuncStringify):
3554         * runtime/JSObject.cpp:
3555         (JSC::callDefaultValueFunction):
3556         * runtime/JSValue.h:
3557         * runtime/MathObject.cpp:
3558         (JSC::mathProtoFuncAbs):
3559         (JSC::mathProtoFuncACos):
3560         (JSC::mathProtoFuncASin):
3561         (JSC::mathProtoFuncATan):
3562         (JSC::mathProtoFuncATan2):
3563         (JSC::mathProtoFuncCeil):
3564         (JSC::mathProtoFuncCos):
3565         (JSC::mathProtoFuncExp):
3566         (JSC::mathProtoFuncFloor):
3567         (JSC::mathProtoFuncLog):
3568         (JSC::mathProtoFuncMax):
3569         (JSC::mathProtoFuncMin):
3570         (JSC::mathProtoFuncPow):
3571         (JSC::mathProtoFuncRandom):
3572         (JSC::mathProtoFuncRound):
3573         (JSC::mathProtoFuncSin):
3574         (JSC::mathProtoFuncSqrt):
3575         (JSC::mathProtoFuncTan):
3576         * runtime/NativeErrorConstructor.cpp:
3577         (JSC::callNativeErrorConstructor):
3578         * runtime/NumberConstructor.cpp:
3579         (JSC::callNumberConstructor):
3580         * runtime/NumberPrototype.cpp:
3581         (JSC::numberProtoFuncToString):
3582         (JSC::numberProtoFuncToLocaleString):
3583         (JSC::numberProtoFuncValueOf):
3584         (JSC::numberProtoFuncToFixed):
3585         (JSC::numberProtoFuncToExponential):
3586         (JSC::numberProtoFuncToPrecision):
3587         * runtime/ObjectConstructor.cpp:
3588         (JSC::callObjectConstructor):
3589         (JSC::objectConstructorGetPrototypeOf):
3590         (JSC::objectConstructorGetOwnPropertyDescriptor):
3591         (JSC::objectConstructorGetOwnPropertyNames):
3592         (JSC::objectConstructorKeys):
3593         (JSC::toPropertyDescriptor):
3594         (JSC::objectConstructorDefineProperty):
3595         (JSC::objectConstructorDefineProperties):
3596         (JSC::objectConstructorCreate):
3597         * runtime/ObjectPrototype.cpp:
3598         (JSC::objectProtoFuncValueOf):
3599         (JSC::objectProtoFuncHasOwnProperty):
3600         (JSC::objectProtoFuncIsPrototypeOf):
3601         (JSC::objectProtoFuncDefineGetter):
3602         (JSC::objectProtoFuncDefineSetter):
3603         (JSC::objectProtoFuncLookupGetter):
3604         (JSC::objectProtoFuncLookupSetter):
3605         (JSC::objectProtoFuncPropertyIsEnumerable):
3606         (JSC::objectProtoFuncToLocaleString):
3607         (JSC::objectProtoFuncToString):
3608         * runtime/ObjectPrototype.h:
3609         * runtime/RegExpConstructor.cpp:
3610         (JSC::callRegExpConstructor):
3611         * runtime/RegExpObject.cpp:
3612         (JSC::callRegExpObject):
3613         * runtime/RegExpPrototype.cpp:
3614         (JSC::regExpProtoFuncTest):
3615         (JSC::regExpProtoFuncExec):
3616         (JSC::regExpProtoFuncCompile):
3617         (JSC::regExpProtoFuncToString):
3618         * runtime/StringConstructor.cpp:
3619         (JSC::stringFromCharCode):
3620         (JSC::callStringConstructor):
3621         * runtime/StringPrototype.cpp:
3622         (JSC::stringProtoFuncReplace):
3623         (JSC::stringProtoFuncToString):
3624         (JSC::stringProtoFuncCharAt):
3625         (JSC::stringProtoFuncCharCodeAt):
3626         (JSC::stringProtoFuncConcat):
3627         (JSC::stringProtoFuncIndexOf):
3628         (JSC::stringProtoFuncLastIndexOf):
3629         (JSC::stringProtoFuncMatch):
3630         (JSC::stringProtoFuncSearch):
3631         (JSC::stringProtoFuncSlice):
3632         (JSC::stringProtoFuncSplit):
3633         (JSC::stringProtoFuncSubstr):
3634         (JSC::stringProtoFuncSubstring):
3635         (JSC::stringProtoFuncToLowerCase):
3636         (JSC::stringProtoFuncToUpperCase):
3637         (JSC::stringProtoFuncLocaleCompare):
3638         (JSC::stringProtoFuncBig):
3639         (JSC::stringProtoFuncSmall):
3640         (JSC::stringProtoFuncBlink):
3641         (JSC::stringProtoFuncBold):
3642         (JSC::stringProtoFuncFixed):
3643         (JSC::stringProtoFuncItalics):
3644         (JSC::stringProtoFuncStrike):
3645         (JSC::stringProtoFuncSub):
3646         (JSC::stringProtoFuncSup):
3647         (JSC::stringProtoFuncFontcolor):
3648         (JSC::stringProtoFuncFontsize):
3649         (JSC::stringProtoFuncAnchor):
3650         (JSC::stringProtoFuncLink):
3651         (JSC::stringProtoFuncTrim):
3652         (JSC::stringProtoFuncTrimLeft):
3653         (JSC::stringProtoFuncTrimRight):
3654
3655 2010-06-02  Mark Rowe  <mrowe@apple.com>
3656
3657         Reviewed by Gavin Barraclough.
3658
3659         Add value-representation specific sections to the mac export file.
3660
3661         * Configurations/JavaScriptCore.xcconfig:
3662         * DerivedSources.make:
3663         * JavaScriptCore.JSVALUE32_64only.exp: Added.
3664         * JavaScriptCore.JSVALUE32only.exp: Added.
3665         * JavaScriptCore.JSVALUE64only.exp: Added.
3666         * JavaScriptCore.xcodeproj/project.pbxproj:
3667
3668 2010-06-02  Mark Rowe  <mrowe@apple.com>
3669
3670         Reviewed by Gavin Barraclough.
3671
3672         <rdar://problem/8054988> Work around an LLVM GCC code generation bug that results in crashes inside PCRE.
3673
3674         * pcre/pcre_exec.cpp:
3675         (repeatInformationFromInstructionOffset): Change the type of instructionOffset to int.  There's no good
3676         reason for it to be a short, and using int prevents this code from triggering the LLVM GCC bug.
3677
3678 2010-06-02  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3679
3680         Reviewed by Kenneth Rohde Christiansen.
3681
3682         Fix the QScriptValue::strictlyEquals function.
3683
3684         Handling for a few edge cases was added.
3685
3686         New autotest that covers the QScriptValue::strictlyEquals function.
3687
3688         [Qt] QScriptValue::strictlyEquals is broken
3689         https://bugs.webkit.org/show_bug.cgi?id=36600
3690
3691         * qt/api/qscriptvalue.cpp:
3692         (QScriptValue::strictlyEquals):
3693         * qt/api/qscriptvalue_p.h:
3694         (QScriptValuePrivate::strictlyEquals):
3695         * qt/tests/qscriptvalue/qscriptvalue.pro:
3696         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
3697         * qt/tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp: Added.
3698         (tst_QScriptValue::strictlyEquals_initData):
3699         (tst_QScriptValue::strictlyEquals_makeData):
3700         (tst_QScriptValue::strictlyEquals_test):
3701
3702 2010-06-02  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3703
3704         Reviewed by Kenneth Rohde Christiansen.
3705
3706         New function QScriptEngine::newObject.
3707
3708         The function creates a object of class Object and returns it
3709         as a QScriptValue.
3710
3711         [Qt] QScriptEngine API should contain a newObject function
3712         https://bugs.webkit.org/show_bug.cgi?id=39114
3713
3714         * qt/api/qscriptengine.cpp:
3715         (QScriptEngine::newObject):
3716         * qt/api/qscriptengine.h:
3717         * qt/api/qscriptengine_p.cpp:
3718         (QScriptEnginePrivate::newObject):
3719         * qt/api/qscriptengine_p.h:
3720         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
3721         (tst_QScriptEngine::newObject):
3722
3723 2010-06-02  Gabor Loki  <loki@webkit.org>
3724
3725         Reviewed by Gavin Barraclough.
3726         https://bugs.webkit.org/show_bug.cgi?id=40011
3727
3728         Thumb-2 build fix: The offset parameter of ldrh should be encoded as an
3729         imm12 immediate constant in load16. If it is not fit in the instruction
3730         a temporary register has to be used.
3731
3732         * assembler/MacroAssemblerARMv7.h:
3733         (JSC::MacroAssemblerARMv7::load16):
3734
3735 2010-06-02  Sterling Swigart  <sswigart@google.com>
3736
3737         Reviewed by David Levin.
3738
3739         Image Resizer Patch 0: Added compilation argument to conditionally compile pending patches.
3740         https://bugs.webkit.org/show_bug.cgi?id=39906
3741
3742         * Configurations/FeatureDefines.xcconfig:
3743
3744 2010-06-01  Gavin Barraclough  <barraclough@apple.com>
3745
3746         Reviewed by Sam Weinig.
3747
3748         Bug 40021 - Refactor bytecode generation for calls so that register for this & args are allocated together
3749
3750         This is a useful stepping stone towards reversing argument order.
3751
3752         * bytecompiler/BytecodeGenerator.cpp:
3753         (JSC::BytecodeGenerator::BytecodeGenerator):
3754         (JSC::BytecodeGenerator::addParameter):
3755         (JSC::BytecodeGenerator::emitCall):
3756         (JSC::BytecodeGenerator::emitCallEval):
3757         (JSC::BytecodeGenerator::emitConstruct):
3758         * bytecompiler/BytecodeGenerator.h:
3759         (JSC::CallArguments::thisRegister):
3760         (JSC::CallArguments::argumentRegister):
3761         (JSC::CallArguments::callFrame):
3762         (JSC::CallArguments::count):
3763         (JSC::BytecodeGenerator::shouldEmitProfileHooks):
3764         * bytecompiler/NodesCodegen.cpp:
3765         (JSC::NewExprNode::emitBytecode):
3766         (JSC::CallArguments::CallArguments):
3767         (JSC::EvalFunctionCallNode::emitBytecode):
3768         (JSC::FunctionCallValueNode::emitBytecode):
3769         (JSC::FunctionCallResolveNode::emitBytecode):
3770         (JSC::FunctionCallBracketNode::emitBytecode):
3771         (JSC::FunctionCallDotNode::emitBytecode):
3772         (JSC::CallFunctionCallDotNode::emitBytecode):
3773         (JSC::ApplyFunctionCallDotNode::emitBytecode):
3774
3775 2010-06-01  Yong Li  <yoli@rim.com>
3776
3777         Reviewed by Darin Adler.
3778
3779         Explicitly use PTHREAD_MUTEX_NORMAL to create pthread mutex.
3780         https://bugs.webkit.org/show_bug.cgi?id=39893
3781
3782         * wtf/ThreadingPthreads.cpp:
3783         (WTF::Mutex::Mutex):
3784
3785 2010-06-01  Kwang Yul Seo  <skyul@company100.net>
3786
3787         Reviewed by Xan Lopez.
3788
3789         [GTK] Use DEFINE_STATIC_LOCAL for threadMapMutex and threadMap
3790         https://bugs.webkit.org/show_bug.cgi?id=39831
3791
3792         Use DEFINE_STATIC_LOCAL for static local variables.
3793
3794         * wtf/gtk/ThreadingGtk.cpp:
3795         (WTF::threadMapMutex):
3796         (WTF::threadMap):
3797         (WTF::identifierByGthreadHandle):
3798
3799 2010-06-01  Kent Tamura  <tkent@chromium.org>
3800
3801         Reviewed by Shinichiro Hamaji.
3802
3803         Fix style errors of dtoa
3804         https://bugs.webkit.org/show_bug.cgi?id=39972
3805
3806         Fix all errors reported by check-webkit-style.
3807
3808         * wtf/dtoa.cpp:
3809         * wtf/dtoa.h:
3810
3811 2010-05-30  Darin Adler  <darin@apple.com>
3812
3813         Reviewed by Sam Weinig.
3814
3815         * wtf/OwnArrayPtr.h:
3816         (WTF::OwnArrayPtr::set): Fix the assertion in here to match the one in OwnPtr.
3817         At some point someone fixed the "asserts when assigning to 0 and the pointer is
3818         already 0" issue in OwnPtr but forgot to do it here.
3819
3820 2010-05-29  Geoffrey Garen  <ggaren@apple.com>
3821
3822         Windows build fix: Updated exported symbols.
3823         
3824         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3825
3826 2010-05-29  Geoffrey Garen  <ggaren@apple.com>
3827
3828         Disabled ENABLE_JIT_OPTIMIZE_NATIVE_CALL on Windows for now, until I
3829         can figure out why it's crashing.
3830
3831         * wtf/Platform.h:
3832
3833 2010-05-29  Geoffrey Garen  <ggaren@apple.com>
3834
3835         Fixed Windows crash seen on buildbot.
3836
3837         * jit/JITOpcodes32_64.cpp:
3838         (JSC::JIT::privateCompileCTINativeCall): __fastcall puts the first
3839         argument in ecx.
3840
3841 2010-05-28  Geoffrey Garen  <ggaren@apple.com>
3842
3843         Windows build fix: Updated exported symbols.
3844
3845         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3846
3847 2010-05-28  Geoffrey Garen  <ggaren@apple.com>
3848
3849         Qt build fix: disable a little more stuff when JIT_OPTIMIZE_NATIVE_CALL
3850         is disabled.
3851
3852         * runtime/Lookup.cpp:
3853         (JSC::setUpStaticFunctionSlot):
3854         * runtime/Lookup.h:
3855         * wtf/Platform.h:
3856
3857 2010-05-28  Geoffrey Garen  <ggaren@apple.com>
3858
3859         Windows build fix: Updated exported symbols.
3860
3861         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3862
3863 2010-05-28  Geoffrey Garen  <ggaren@apple.com>
3864
3865         Reviewed by Sam Weinig, Gavin Barraclough, Oliver Hunt.
3866
3867         Simplified the host calling convention.
3868         
3869         22.5% speedup on 32-bit host function calls. 9.5% speedup on 64-bit host
3870         function calls.
3871         
3872         No change on SunSpider.
3873         
3874         All JS calls (but not constructs, yet) now go through the normal JS
3875         calling convention via the RegisterFile. As a result, the host calling
3876         convention, which used to be this
3877
3878             JSValue (JSC_HOST_CALL *NativeFunction)(ExecState*, JSObject*, JSValue thisValue, const ArgList&)
3879             
3880         is now this
3881
3882             JSValue (JSC_HOST_CALL *NativeFunction)(ExecState*)
3883             
3884         Callee, 'this', and argument access all hapen relative to the ExecState*,
3885         which is a pointer into the RegisterFile.
3886         
3887         This patch comes in two parts.
3888         
3889         PART ONE: Functional code changes.
3890         
3891         * wtf/Platform.h: Disabled optimized calls on platforms I didn't test.
3892         We can re-enable once we verify that host calls on these platforms are
3893         correct.
3894
3895         * debugger/DebuggerCallFrame.cpp:
3896         (JSC::DebuggerCallFrame::functionName):
3897         (JSC::DebuggerCallFrame::calculatedFunctionName): Updated for change to
3898         ExecState::callee().
3899
3900         (JSC::DebuggerCallFrame::thisObject): Updated for removal of ExecState::thisValue().
3901
3902         * interpreter/CallFrame.cpp:
3903         * interpreter/CallFrame.h:
3904         (JSC::ExecState::callee):
3905         (JSC::ExecState::scopeChain):
3906         (JSC::ExecState::init): Changed callee() to be JSObject* instead of
3907         JSFunction* -- now, it might be some other callable host object.
3908
3909         (JSC::ExecState::hostThisRegister):
3910         (JSC::ExecState::hostThisValue):
3911         (JSC::ExecState::argumentCount):
3912         (JSC::ExecState::argumentCountIncludingThis):
3913         (JSC::ExecState::argument):
3914         (JSC::ExecState::setArgumentCountIncludingThis):
3915         (JSC::ExecState::setCallee): Added convenient accessors for arguments
3916         from within a host function. Removed thisValue() because it was too
3917         tempting to use incorrectly, and it only had one or two clients, anyway.
3918
3919         * interpreter/Interpreter.cpp:
3920         (JSC::Interpreter::callEval): Updated for removal of ExecState::thisValue().
3921
3922         (JSC::Interpreter::throwException): Be sure to shrink the register file
3923         before invoking the exception handler, to reduce the chances that the
3924         handler will re-throw in the case of stack overflow. (Re-throwing is now
3925         more likely than it used to be, since standardizing the calling convention
3926         implicitly added stack overflow checks to some places where they used to be missing.)
3927
3928         (JSC::Interpreter::execute): Clarified the scope of DynamicGlobalObjectScope.
3929         Updated for CallFrame::init API change.
3930
3931         (JSC::Interpreter::executeCall): Clarified scope of DynamicGlobalObjectScope.
3932         Updated for CallFrame::init API change. Added support for calling a host
3933         function.
3934
3935         (JSC::Interpreter::executeConstruct): Clarified scope of DynamicGlobalObjectScope.
3936         Updated for CallFrame::init API change. 
3937
3938         (JSC::Interpreter::prepareForRepeatCall): Updated for CallFrame::init API change. 
3939
3940         (JSC::Interpreter::privateExecute): Updated for CallFrame::init API change.
3941         Added some explicit JSValue(JSObject*) initialization, since relaxing
3942         the JSFunction* restriction on callee has made register types more ambiguous.
3943         Removed toThisObject() conversion, since all callees do it themselves now.
3944         Updated host function call for new host function signature. Updated for
3945         change to ExecState::argumentCount() API.
3946
3947         * interpreter/Register.h:
3948         (JSC::Register::):
3949         (JSC::Register::operator=):
3950         (JSC::Register::function): Changed callee() to be JSObject* instead of
3951         JSFunction* -- now, it might be some other callable host object.
3952
3953         * jit/JITOpcodes.cpp:
3954         (JSC::JIT::privateCompileCTINativeCall):
3955         * jit/JITOpcodes32_64.cpp:
3956         (JSC::JIT::privateCompileCTINativeCall): Deleted a bunch of code that
3957         set up the arguments to host functions -- all but one of the arguments
3958         are gone now. This is the actual optimization.
3959
3960         * jit/JITStubs.cpp:
3961         (JSC::DEFINE_STUB_FUNCTION): Updated for ExecState and Register API
3962         changes noted above. Removed toThisObject() conversion, since all callees
3963         do it themselves now.
3964         
3965         * runtime/ArgList.h:
3966         (JSC::ArgList::ArgList): ArgList is getting close to unused. Added a
3967         temporary shim for converting from ExecState* to ArgList where it's still
3968         necessary.
3969
3970         * runtime/Arguments.h:
3971         (JSC::Arguments::getArgumentsData):
3972         (JSC::Arguments::Arguments): Updated for ExecState and Register API
3973         changes noted above. 
3974
3975         * runtime/CallData.cpp:
3976         (JSC::call): Changed call always to call Interpreter::executeCall, even
3977         for host functions. This ensures that the normal calling convention is
3978         set up in the RegsiterFile when calling from C++ to host function.
3979
3980         * runtime/CallData.h: Changed host function signature as described above.
3981
3982         * runtime/ConstructData.cpp:
3983         (JSC::construct): Moved JSFunction::construct code here so I could nix
3984         JSFunction::call and JSFunction::call. We want a JSFunction-agnostic
3985         way to call and construct, so that everything works naturally for non-
3986         JSFunction objects. 
3987
3988         * runtime/JSFunction.cpp:
3989         (JSC::callHostFunctionAsConstructor):
3990         * runtime/JSFunction.h: Updated for ExecState and Register API changes
3991         noted above. Nixed JSFunction::call and JSFunction::construct, noted above.
3992  
3993         * runtime/JSGlobalObject.cpp:
3994         (JSC::JSGlobalObject::init): Ditto.
3995
3996         PART TWO: Global search and replace.
3997         
3998         In the areas below, I used global search-and-replace to change
3999             (ExecState*, JSObject*, JSValue, const ArgList&) => (ExecState*)
4000             args.size() => exec->argumentCount()
4001             args.at(i) => exec->argument(i)
4002
4003         * API/JSCallbackFunction.cpp:
4004         (JSC::JSCallbackFunction::call):
4005         * API/JSCallbackFunction.h:
4006         * API/JSCallbackObject.h:
4007         * API/JSCallbackObjectFunctions.h:
4008         (JSC::::call):
4009         * JavaScriptCore.exp:
4010         * jsc.cpp:
4011         (functionPrint):
4012         (functionDebug):
4013         (functionGC):
4014         (functionVersion):
4015         (functionRun):
4016         (functionLoad):
4017         (functionCheckSyntax):
4018         (functionSetSamplingFlags):
4019         (functionClearSamplingFlags):
4020         (functionReadline):
4021         (functionQuit):
4022         * runtime/ArrayConstructor.cpp:
4023         (JSC::callArrayConstructor):
4024         (JSC::arrayConstructorIsArray):
4025         * runtime/ArrayPrototype.cpp:
4026         (JSC::arrayProtoFuncToString):
4027         (JSC::arrayProtoFuncToLocaleString):
4028         (JSC::arrayProtoFuncJoin):
4029         (JSC::arrayProtoFuncConcat):
4030         (JSC::arrayProtoFuncPop):
4031         (JSC::arrayProtoFuncPush):
4032         (JSC::arrayProtoFuncReverse):
4033         (JSC::arrayProtoFuncShift):
4034         (JSC::arrayProtoFuncSlice):
4035         (JSC::arrayProtoFuncSort):
4036         (JSC::arrayProtoFuncSplice):
4037         (JSC::arrayProtoFuncUnShift):
4038         (JSC::arrayProtoFuncFilter):
4039         (JSC::arrayProtoFuncMap):
4040         (JSC::arrayProtoFuncEvery):
4041         (JSC::arrayProtoFuncForEach):
4042         (JSC::arrayProtoFuncSome):
4043         (JSC::arrayProtoFuncReduce):
4044         (JSC::arrayProtoFuncReduceRight):
4045         (JSC::arrayProtoFuncIndexOf):
4046         (JSC::arrayProtoFuncLastIndexOf):
4047         * runtime/BooleanConstructor.cpp:
4048         (JSC::callBooleanConstructor):
4049         * runtime/BooleanPrototype.cpp:
4050         (JSC::booleanProtoFuncToString):
4051         (JSC::booleanProtoFuncValueOf):
4052         * runtime/DateConstructor.cpp:
4053         (JSC::callDate):
4054         (JSC::dateParse):
4055         (JSC::dateNow):
4056         (JSC::dateUTC):
4057         * runtime/DatePrototype.cpp:
4058         (JSC::formatLocaleDate):
4059         (JSC::fillStructuresUsingTimeArgs):
4060         (JSC::fillStructuresUsingDateArgs):
4061         (JSC::dateProtoFuncToString):
4062         (JSC::dateProtoFuncToUTCString):
4063         (JSC::dateProtoFuncToISOString):
4064         (JSC::dateProtoFuncToDateString):
4065         (JSC::dateProtoFuncToTimeString):
4066         (JSC::dateProtoFuncToLocaleString):
4067         (JSC::dateProtoFuncToLocaleDateString):
4068         (JSC::dateProtoFuncToLocaleTimeString):
4069         (JSC::dateProtoFuncGetTime):
4070         (JSC::dateProtoFuncGetFullYear):
4071         (JSC::dateProtoFuncGetUTCFullYear):
4072         (JSC::dateProtoFuncToGMTString):
4073         (JSC::dateProtoFuncGetMonth):
4074         (JSC::dateProtoFuncGetUTCMonth):
4075         (JSC::dateProtoFuncGetDate):
4076         (JSC::dateProtoFuncGetUTCDate):
4077         (JSC::dateProtoFuncGetDay):
4078         (JSC::dateProtoFuncGetUTCDay):
4079         (JSC::dateProtoFuncGetHours):
4080         (JSC::dateProtoFuncGetUTCHours):
4081         (JSC::dateProtoFuncGetMinutes):
4082         (JSC::dateProtoFuncGetUTCMinutes):
4083         (JSC::dateProtoFuncGetSeconds):
4084         (JSC::dateProtoFuncGetUTCSeconds):
4085         (JSC::dateProtoFuncGetMilliSeconds):
4086         (JSC::dateProtoFuncGetUTCMilliseconds):
4087         (JSC::dateProtoFuncGetTimezoneOffset):
4088         (JSC::dateProtoFuncSetTime):
4089         (JSC::setNewValueFromTimeArgs):
4090         (JSC::setNewValueFromDateArgs):
4091         (JSC::dateProtoFuncSetMilliSeconds):
4092         (JSC::dateProtoFuncSetUTCMilliseconds):
4093         (JSC::dateProtoFuncSetSeconds):
4094         (JSC::dateProtoFuncSetUTCSeconds):
4095         (JSC::dateProtoFuncSetMinutes):
4096         (JSC::dateProtoFuncSetUTCMinutes):
4097         (JSC::dateProtoFuncSetHours):
4098         (JSC::dateProtoFuncSetUTCHours):
4099         (JSC::dateProtoFuncSetDate):
4100         (JSC::dateProtoFuncSetUTCDate):
4101         (JSC::dateProtoFuncSetMonth):
4102         (JSC::dateProtoFuncSetUTCMonth):
4103         (JSC::dateProtoFuncSetFullYear):
4104         (JSC::dateProtoFuncSetUTCFullYear):
4105         (JSC::dateProtoFuncSetYear):
4106         (JSC::dateProtoFuncGetYear):
4107         (JSC::dateProtoFuncToJSON):
4108         * runtime/ErrorConstructor.cpp:
4109         (JSC::callErrorConstructor):
4110         * runtime/ErrorPrototype.cpp:
4111         (JSC::errorProtoFuncToString):
4112         * runtime/FunctionConstructor.cpp:
4113         (JSC::callFunctionConstructor):
4114         * runtime/FunctionPrototype.cpp:
4115         (JSC::callFunctionPrototype):
4116         (JSC::functionProtoFuncToString):
4117         (JSC::functionProtoFuncApply):
4118         (JSC::functionProtoFuncCall):
4119         * runtime/JSGlobalObjectFunctions.cpp:
4120         (JSC::encode):
4121         (JSC::decode):
4122         (JSC::globalFuncEval):
4123         (JSC::globalFuncParseInt):
4124         (JSC::globalFuncParseFloat):
4125         (JSC::globalFuncIsNaN):
4126         (JSC::globalFuncIsFinite):
4127         (JSC::globalFuncDecodeURI):
4128         (JSC::globalFuncDecodeURIComponent):
4129         (JSC::globalFuncEncodeURI):
4130         (JSC::globalFuncEncodeURIComponent):
4131         (JSC::globalFuncEscape):
4132         (JSC::globalFuncUnescape):
4133         (JSC::globalFuncJSCPrint):
4134         * runtime/JSGlobalObjectFunctions.h:
4135         * runtime/JSONObject.cpp:
4136         (JSC::JSONProtoFuncParse):
4137         (JSC::JSONProtoFuncStringify):
4138         * runtime/JSString.h:
4139         * runtime/MathObject.cpp:
4140         (JSC::mathProtoFuncAbs):
4141         (JSC::mathProtoFuncACos):
4142         (JSC::mathProtoFuncASin):
4143         (JSC::mathProtoFuncATan):
4144         (JSC::mathProtoFuncATan2):
4145         (JSC::mathProtoFuncCeil):
4146         (JSC::mathProtoFuncCos):
4147         (JSC::mathProtoFuncExp):
4148         (JSC::mathProtoFuncFloor):
4149         (JSC::mathProtoFuncLog):
4150         (JSC::mathProtoFuncMax):
4151         (JSC::mathProtoFuncMin):
4152         (JSC::mathProtoFuncPow):
4153         (JSC::mathProtoFuncRandom):
4154         (JSC::mathProtoFuncRound):
4155         (JSC::mathProtoFuncSin):
4156         (JSC::mathProtoFuncSqrt):
4157         (JSC::mathProtoFuncTan):
4158         * runtime/NativeErrorConstructor.cpp:
4159         (JSC::callNativeErrorConstructor):
4160         * runtime/NumberConstructor.cpp:
4161         (JSC::callNumberConstructor):
4162         * runtime/NumberPrototype.cpp:
4163         (JSC::numberProtoFuncToString):
4164         (JSC::numberProtoFuncToLocaleString):
4165         (JSC::numberProtoFuncValueOf):
4166         (JSC::numberProtoFuncToFixed):
4167         (JSC::numberProtoFuncToExponential):
4168         (JSC::numberProtoFuncToPrecision):
4169         * runtime/ObjectConstructor.cpp:
4170         (JSC::callObjectConstructor):
4171         (JSC::objectConstructorGetPrototypeOf):
4172         (JSC::objectConstructorGetOwnPropertyDescriptor):
4173         (JSC::objectConstructorGetOwnPropertyNames):
4174         (JSC::objectConstructorKeys):
4175         (JSC::objectConstructorDefineProperty):
4176         (JSC::objectConstructorDefineProperties):
4177         (JSC::objectConstructorCreate):
4178         * runtime/ObjectPrototype.cpp:
4179         (JSC::objectProtoFuncValueOf):
4180         (JSC::objectProtoFuncHasOwnProperty):
4181         (JSC::objectProtoFuncIsPrototypeOf):
4182         (JSC::objectProtoFuncDefineGetter):
4183         (JSC::objectProtoFuncDefineSetter):
4184         (JSC::objectProtoFuncLookupGetter):
4185         (JSC::objectProtoFuncLookupSetter):
4186         (JSC::objectProtoFuncPropertyIsEnumerable):
4187         (JSC::objectProtoFuncToLocaleString):
4188         (JSC::objectProtoFuncToString):
4189         * runtime/ObjectPrototype.h:
4190         * runtime/Operations.h:
4191         (JSC::jsString):
4192         * runtime/RegExpConstructor.cpp:
4193         (JSC::callRegExpConstructor):
4194         * runtime/RegExpObject.cpp:
4195         (JSC::RegExpObject::test):
4196         (JSC::RegExpObject::exec):
4197         (JSC::callRegExpObject):
4198         (JSC::RegExpObject::match):
4199         * runtime/RegExpObject.h:
4200         * runtime/RegExpPrototype.cpp:
4201         (JSC::regExpProtoFuncTest):
4202         (JSC::regExpProtoFuncExec):
4203         (JSC::regExpProtoFuncCompile):
4204         (JSC::regExpProtoFuncToString):
4205         * runtime/StringConstructor.cpp:
4206         (JSC::stringFromCharCodeSlowCase):
4207         (JSC::stringFromCharCode):
4208         (JSC::callStringConstructor):
4209         * runtime/StringPrototype.cpp:
4210         (JSC::stringProtoFuncReplace):
4211         (JSC::stringProtoFuncToString):
4212         (JSC::stringProtoFuncCharAt):
4213         (JSC::stringProtoFuncCharCodeAt):
4214         (JSC::stringProtoFuncConcat):
4215         (JSC::stringProtoFuncIndexOf):
4216         (JSC::stringProtoFuncLastIndexOf):
4217         (JSC::stringProtoFuncMatch):
4218         (JSC::stringProtoFuncSearch):
4219         (JSC::stringProtoFuncSlice):
4220         (JSC::stringProtoFuncSplit):