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