2010-05-20 Geoffrey Garen <ggaren@apple.com>
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2010-05-20  Geoffrey Garen  <ggaren@apple.com>
2
3         Reviewed by Darin Adler.
4
5         Removed some reliance on callFame[CodeBlock] by storing CodeBlock in a
6         local variable in the Interpreter.
7         https://bugs.webkit.org/show_bug.cgi?id=39447
8
9         Small speedup on SunSpider in Interpreter mode.
10
11         * interpreter/Interpreter.cpp:
12         (JSC::Interpreter::privateExecute):
13         * jsc.cpp:
14         * wtf/Platform.h:
15
16 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
17
18         Reviewed by Oliver Hunt.
19
20         Bug 39408 - Unify JIT/interpreter return behaviour.
21
22         Presently the JIT and the interpreter have differing implementations in how
23         they handle storing the result of a function call back to the register file.
24         In both cases the op_call ( / _eval / _varargs / op_construct) opcode has an
25         operand indicating the VM register in which the result should be stored.
26         The JIT plants code after the call to store the result, so the value will be
27         stored as soon as the callee has returned.  In the interpreter the call
28         passes the return value register id into the callee via the callee callframe,
29         and the callee is responsible for writing the result back into its callers
30         register file after it has restored the parents callframe pointer, but before
31         returning.
32
33         Instead, move the task of writing the call result to the register file into a
34         new opcode (op_call_put_result), and after returning the callee should leave
35         the return value in a canonical location.  In the case of the interpreter,
36         this canonical location is a local variable in privateExecute
37         (functionReturnValue), in the case of the JIT this is the normal return value
38         registers (regT0, or regT1:regT0 in JSVALUE32_64).  op_call_put_result stores
39         the result from the canonical location to the registerfile.
40
41         In addition to unifying JIT & interpreter behaviour this change allows us to
42         remove a slot from the callframe, omit the write of the result where the
43         return value from the call is not used, and provides a 2% speedup on sunspider
44         in the interpreter.
45
46         * bytecode/CodeBlock.cpp:
47         (JSC::CodeBlock::dump):
48         * bytecode/Opcode.h:
49         * bytecompiler/BytecodeGenerator.cpp:
50         (JSC::BytecodeGenerator::emitCall):
51         (JSC::BytecodeGenerator::emitCallVarargs):
52         (JSC::BytecodeGenerator::emitConstruct):
53         * bytecompiler/BytecodeGenerator.h:
54         (JSC::BytecodeGenerator::finalDestinationOrIgnored):
55         * bytecompiler/NodesCodegen.cpp:
56         (JSC::NewExprNode::emitBytecode):
57         (JSC::FunctionCallValueNode::emitBytecode):
58         (JSC::FunctionCallResolveNode::emitBytecode):
59         (JSC::FunctionCallBracketNode::emitBytecode):
60         (JSC::FunctionCallDotNode::emitBytecode):
61         (JSC::CallFunctionCallDotNode::emitBytecode):
62         (JSC::ApplyFunctionCallDotNode::emitBytecode):
63         * interpreter/CallFrame.h:
64         (JSC::ExecState::init):
65         (JSC::ExecState::noCaller):
66         * interpreter/Interpreter.cpp:
67         (JSC::Interpreter::dumpRegisters):
68         (JSC::Interpreter::throwException):
69         (JSC::Interpreter::privateExecute):
70         * interpreter/RegisterFile.h:
71         (JSC::RegisterFile::):
72         * jit/JIT.cpp:
73         (JSC::JIT::privateCompileMainPass):
74         * jit/JIT.h:
75         * jit/JITCall.cpp:
76         (JSC::JIT::compileOpCallSetupArgs):
77         (JSC::JIT::compileOpConstructSetupArgs):
78         (JSC::JIT::emit_op_call_put_result):
79         (JSC::JIT::compileOpCallVarargs):
80         (JSC::JIT::compileOpCallVarargsSlowCase):
81         (JSC::JIT::compileOpCall):
82         (JSC::JIT::compileOpCallSlowCase):
83         (JSC::JIT::compileOpCallVarargsSetupArgs):
84
85 2010-05-20  Steve Block  <steveblock@google.com>
86
87         Reviewed by Jeremy Orlow.
88
89         Provide bindings for DeviceOrientation
90         https://bugs.webkit.org/show_bug.cgi?id=39210
91
92         Adds ENABLE_DEVICE_ORIENTATION to XCode project file, always disabled.
93
94         * Configurations/FeatureDefines.xcconfig:
95
96 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
97
98         Reviewed by Geoff Garen.
99
100         Errk! rename op_constructor_ret as requested in review of Bug 39399.
101
102         * bytecode/CodeBlock.cpp:
103         (JSC::CodeBlock::dump):
104         * bytecode/Opcode.h:
105         * bytecompiler/BytecodeGenerator.cpp:
106         (JSC::BytecodeGenerator::emitReturn):
107         * interpreter/Interpreter.cpp:
108         (JSC::Interpreter::privateExecute):
109         * jit/JIT.cpp:
110         (JSC::JIT::privateCompileMainPass):
111         * jit/JIT.h:
112         * jit/JITCall.cpp:
113         (JSC::JIT::emit_op_ret_object_or_this):
114         * jit/JITOpcodes.cpp:
115         (JSC::JIT::emit_op_ret_object_or_this):
116
117 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
118
119         Reviewed by Geoff Garen.
120
121         Bug 39399 - Move responsibility for verifying constructors return objects from the caller to the callee.
122         
123         This is a necessary step to move object creation from caller to callee.
124
125         * bytecode/CodeBlock.cpp:
126         (JSC::CodeBlock::dump):
127         * bytecode/Opcode.h:
128         * bytecompiler/BytecodeGenerator.cpp:
129         (JSC::BytecodeGenerator::BytecodeGenerator):
130         (JSC::BytecodeGenerator::emitReturn):
131         (JSC::BytecodeGenerator::emitConstruct):
132         * bytecompiler/BytecodeGenerator.h:
133         (JSC::BytecodeGenerator::isConstructor):
134         * bytecompiler/NodesCodegen.cpp:
135         (JSC::FunctionBodyNode::emitBytecode):
136         * interpreter/Interpreter.cpp:
137         (JSC::Interpreter::privateExecute):
138         * jit/JIT.cpp:
139         (JSC::JIT::privateCompileMainPass):
140         (JSC::JIT::privateCompileSlowCases):
141         * jit/JIT.h:
142         * jit/JITCall.cpp:
143         (JSC::JIT::emit_op_constructor_ret):
144         * jit/JITOpcodes.cpp:
145         (JSC::JIT::emit_op_constructor_ret):
146
147 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
148
149         Reviewed by NOBODY (build fix).
150
151         Fix windows build II.
152
153         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
154
155 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
156
157         Reviewed by NOBODY (build fix).
158
159         Fix windows build.
160
161         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
162
163 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
164
165         Reviewed by Oliver Hunt.
166
167         Bug 39393 - JSFunction need not be a subclass of InternalFunction.
168
169         re-landing r59800.
170
171         * JavaScriptCore.exp:
172         * interpreter/Interpreter.cpp:
173         (JSC::Interpreter::retrieveCaller):
174         (JSC::Interpreter::findFunctionCallFrame):
175         * interpreter/Interpreter.h:
176         * profiler/Profiler.cpp:
177         (JSC::Profiler::createCallIdentifier):
178         * runtime/FunctionPrototype.cpp:
179         (JSC::functionProtoFuncToString):
180         * runtime/JSFunction.cpp:
181         (JSC::):
182         (JSC::JSFunction::JSFunction):
183         (JSC::JSFunction::name):
184         (JSC::JSFunction::displayName):
185         (JSC::JSFunction::calculatedDisplayName):
186         * runtime/JSFunction.h:
187         * runtime/JSObject.cpp:
188         (JSC::JSObject::putDirectFunction):
189         (JSC::JSObject::putDirectFunctionWithoutTransition):
190         * runtime/JSObject.h:
191         * runtime/Lookup.cpp:
192         (JSC::setUpStaticFunctionSlot):
193
194 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
195
196         Reviewed by NOBODY (build fix).
197
198         Reverting r59800, this b0rked stuff.
199
200         * JavaScriptCore.exp:
201         * interpreter/Interpreter.cpp:
202         (JSC::Interpreter::retrieveCaller):
203         (JSC::Interpreter::findFunctionCallFrame):
204         * interpreter/Interpreter.h:
205         * profiler/Profiler.cpp:
206         (JSC::Profiler::createCallIdentifier):
207         * runtime/FunctionPrototype.cpp:
208         (JSC::functionProtoFuncToString):
209         * runtime/JSFunction.cpp:
210         (JSC::):
211         (JSC::JSFunction::JSFunction):
212         * runtime/JSFunction.h:
213         * runtime/JSObject.cpp:
214         * runtime/JSObject.h:
215         * runtime/Lookup.cpp:
216         (JSC::setUpStaticFunctionSlot):
217
218 2010-05-19  Gavin Barraclough  <barraclough@apple.com>
219
220         Reviewed by Oliver Hunt.
221
222         Bug 39393 - JSFunction need not be a subclass of InternalFunction.
223
224         This may prevent us from introducing a more useful parent class to
225         JSFunction, e.g. a JSObject that holds an executable, which could
226         also reference an eval or program executable.
227
228         * JavaScriptCore.exp:
229         * interpreter/Interpreter.cpp:
230         (JSC::Interpreter::retrieveCaller):
231         (JSC::Interpreter::findFunctionCallFrame):
232         * interpreter/Interpreter.h:
233         * profiler/Profiler.cpp:
234         (JSC::Profiler::createCallIdentifier):
235         * runtime/FunctionPrototype.cpp:
236         (JSC::functionProtoFuncToString):
237         * runtime/JSFunction.cpp:
238         (JSC::):
239         (JSC::JSFunction::JSFunction):
240         (JSC::JSFunction::name):
241         (JSC::JSFunction::displayName):
242         (JSC::JSFunction::calculatedDisplayName):
243         * runtime/JSFunction.h:
244         * runtime/JSObject.cpp:
245         (JSC::JSObject::putDirectFunction):
246         (JSC::JSObject::putDirectFunctionWithoutTransition):
247         * runtime/JSObject.h:
248         * runtime/Lookup.cpp:
249         (JSC::setUpStaticFunctionSlot):
250
251 2010-05-19  Oliver Hunt  <oliver@apple.com>
252
253         Reviewed by Geoffrey Garen.
254
255         emitJumpIfNotJSCell should special case constant immediate values
256         https://bugs.webkit.org/show_bug.cgi?id=39392
257         <rdar://problem/8001324>
258
259         Make emitJumpSlowCaseIfNotJSCell special case constant immediate
260         values, in addition to the immediate JSCell optimisation.
261
262         Also add assertions to make sure no one else produces code that
263         attempts to load constants from the register file.
264
265         * jit/JITInlineMethods.h:
266         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
267         * jit/JSInterfaceJIT.h:
268         (JSC::JSInterfaceJIT::emitJumpIfNotJSCell):
269         (JSC::JSInterfaceJIT::emitLoadInt32):
270         (JSC::JSInterfaceJIT::tagFor):
271         (JSC::JSInterfaceJIT::payloadFor):
272         (JSC::JSInterfaceJIT::emitLoadDouble):
273         (JSC::JSInterfaceJIT::addressFor):
274         * jit/ThunkGenerators.cpp:
275
276 2010-05-19  Geoffrey Garen  <ggaren@apple.com>
277
278         Reviewed by Sam Weinig.
279
280         Slight refactoring to CodeBlock bytecode access
281         https://bugs.webkit.org/show_bug.cgi?id=39384
282
283         * bytecode/CodeBlock.h:
284         (JSC::CodeBlock::bytecodeOffset):
285         * interpreter/CallFrame.h:
286         (JSC::ExecState::returnPC):
287         * interpreter/Interpreter.cpp:
288         (JSC::Interpreter::unwindCallFrame):
289         (JSC::Interpreter::retrieveLastCaller): Moved bytecode access into a
290         CodeBlock helper function. Changed CallFrame to accurately represent
291         how the returnPC is stored in JIT vs Interpreter.
292
293 2010-05-19  Geoffrey Garen  <ggaren@apple.com>
294
295         Reviewed by Sam Weinig.
296
297         Don't build the Interpreter into JIT builds.
298         https://bugs.webkit.org/show_bug.cgi?id=39373
299
300         SunSpider says no change.
301
302         * interpreter/Interpreter.cpp:
303         (JSC::Interpreter::privateExecute):
304         * interpreter/Interpreter.h:
305         * wtf/Platform.h:
306
307 2010-05-19  Geoffrey Garen  <ggaren@apple.com>
308
309         Reviewed by Gavin Barraclough.
310         
311         Standardized naming: "bytecode offset" wins; "bytecode index" loses.
312         
313         Also renamed getBytecodeOffset to bytecodeOffset, to match the WebKit
314         naming style.
315
316         * bytecode/CodeBlock.h:
317         (JSC::CallReturnOffsetToBytecodeOffset::CallReturnOffsetToBytecodeOffset):
318         (JSC::getCallReturnOffset):
319         (JSC::CodeBlock::bytecodeOffset):
320         (JSC::CodeBlock::callReturnIndexVector):
321         * interpreter/Interpreter.cpp:
322         (JSC::bytecodeOffsetForPC):
323         * jit/JIT.cpp:
324         (JSC::JIT::JIT):
325         (JSC::JIT::privateCompileMainPass):
326         (JSC::JIT::privateCompileLinkPass):
327         (JSC::JIT::privateCompileSlowCases):
328         (JSC::JIT::privateCompile):
329         * jit/JIT.h:
330         (JSC::CallRecord::CallRecord):
331         (JSC::JumpTable::JumpTable):
332         (JSC::SwitchRecord::SwitchRecord):
333         * jit/JITCall.cpp:
334         (JSC::JIT::compileOpCallVarargsSlowCase):
335         (JSC::JIT::compileOpCall):
336         * jit/JITInlineMethods.h:
337         (JSC::JIT::emitNakedCall):
338         (JSC::JIT::addSlowCase):
339         (JSC::JIT::addJump):
340         (JSC::JIT::emitJumpSlowToHot):
341         (JSC::JIT::isLabeled):
342         (JSC::JIT::map):
343         (JSC::JIT::unmap):
344         (JSC::JIT::isMapped):
345         (JSC::JIT::getMappedPayload):
346         (JSC::JIT::getMappedTag):
347         (JSC::JIT::emitGetVirtualRegister):
348         * jit/JITOpcodes.cpp:
349         (JSC::JIT::emit_op_switch_imm):
350         (JSC::JIT::emit_op_switch_char):
351         (JSC::JIT::emit_op_switch_string):
352         (JSC::JIT::emit_op_new_error):
353         * jit/JITOpcodes32_64.cpp:
354         (JSC::JIT::emit_op_mov):
355         (JSC::JIT::emit_op_get_global_var):
356         (JSC::JIT::emit_op_put_global_var):
357         (JSC::JIT::emit_op_get_scoped_var):
358         (JSC::JIT::emit_op_put_scoped_var):
359         (JSC::JIT::emit_op_to_primitive):
360         (JSC::JIT::emit_op_resolve_global):
361         (JSC::JIT::emit_op_to_jsnumber):
362         (JSC::JIT::emit_op_catch):
363         (JSC::JIT::emit_op_switch_imm):
364         (JSC::JIT::emit_op_switch_char):
365         (JSC::JIT::emit_op_switch_string):
366         (JSC::JIT::emit_op_new_error):
367         (JSC::JIT::emit_op_convert_this):
368         * jit/JITPropertyAccess.cpp:
369         (JSC::JIT::emit_op_method_check):
370         (JSC::JIT::emitSlow_op_method_check):
371         * jit/JITPropertyAccess32_64.cpp:
372         (JSC::JIT::emit_op_method_check):
373         (JSC::JIT::emitSlow_op_method_check):
374         (JSC::JIT::emit_op_get_by_val):
375         (JSC::JIT::emit_op_get_by_id):
376         (JSC::JIT::emit_op_get_by_pname):
377         * jit/JITStubCall.h:
378         (JSC::JITStubCall::call):
379         * jit/JITStubs.cpp:
380         (JSC::DEFINE_STUB_FUNCTION):
381
382 2010-05-19  Peter Varga  <pvarga@inf.u-szeged.hu>
383
384         Reviewed by Darin Adler.
385
386         The backtrackParenthesesOnceEnd function should store the start position
387         of the subpattern's non-greedy match at the place of the subpattern's
388         start index in the output array instead of the place of the
389         subpattern's end index.
390         Add layout test for checking of non-greedy matching of subpattern in
391         regular expressions.
392         https://bugs.webkit.org/show_bug.cgi?id=39289
393
394         * yarr/RegexInterpreter.cpp:
395         (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
396
397 2010-05-18  Gavin Barraclough  <barraclough@apple.com>
398
399         Reviewed by Geoff Garen.
400
401         Bug 39343 - Dynamically generate a native call thunk per NativeFunction
402         
403         https://bugs.webkit.org/show_bug.cgi?id=39252 regressed performance on i386,
404         by adding an extra indirection to making a native call.  By introducing per-
405         NativeFunction thunks we can hard code the function pointer into the thunk
406         so that it need not be loaded from the callee.
407
408         * jit/JIT.h:
409         (JSC::JIT::compileCTINativeCall):
410         * jit/JITOpcodes.cpp:
411         (JSC::JIT::privateCompileCTINativeCall):
412         * jit/JITOpcodes32_64.cpp:
413         (JSC::JIT::privateCompileCTINativeCall):
414         * jit/JITPropertyAccess.cpp:
415         (JSC::JIT::emitSlow_op_get_by_val):
416         * jit/JITPropertyAccess32_64.cpp:
417         (JSC::JIT::emitSlow_op_get_by_val):
418         * jit/JITStubs.cpp:
419         (JSC::JITThunks::ctiStub):
420         (JSC::JITThunks::hostFunctionStub):
421         * jit/JITStubs.h:
422         * jit/SpecializedThunkJIT.h:
423         (JSC::SpecializedThunkJIT::finalize):
424         * jit/ThunkGenerators.cpp:
425         (JSC::charCodeAtThunkGenerator):
426         (JSC::charAtThunkGenerator):
427         (JSC::fromCharCodeThunkGenerator):
428         (JSC::sqrtThunkGenerator):
429         (JSC::powThunkGenerator):
430         * runtime/JSFunction.cpp:
431         (JSC::JSFunction::JSFunction):
432         * runtime/JSGlobalData.cpp:
433         (JSC::JSGlobalData::getHostFunction):
434         * runtime/JSGlobalData.h:
435         (JSC::JSGlobalData::getCTIStub):
436         * runtime/Lookup.cpp:
437         (JSC::setUpStaticFunctionSlot):
438         * runtime/StringConstructor.cpp:
439         (JSC::StringConstructor::StringConstructor):
440         * wtf/Platform.h:
441
442 2010-05-18  Geoffrey Garen  <ggaren@apple.com>
443
444         Reviewed by Darin Adler.
445
446         Simplified handling of 'arguments' -- 1.2% SunSpider speedup
447         https://bugs.webkit.org/show_bug.cgi?id=39200
448         
449         Removed the reserved OptionalCalleeArguments slot from the CallFrame.
450         Now, slots for 'arguments' are allocated and initialized only by
451         functions that might need them.
452         
453         * bytecode/CodeBlock.cpp:
454         (JSC::CodeBlock::dump): Updated for new bytecode operands.
455
456         (JSC::CodeBlock::CodeBlock):
457         * bytecode/CodeBlock.h:
458         (JSC::unmodifiedArgumentsRegister): Added a helper function for mapping
459         from the arguments register to its unmodified counterpart.
460
461         (JSC::CodeBlock::setArgumentsRegister):
462         (JSC::CodeBlock::argumentsRegister):
463         (JSC::CodeBlock::usesArguments):  Changed from a "usesArguments" bool to
464         an optional int index representing the arguments register.
465
466         * bytecode/Opcode.h: Updated for new bytecode operands.
467
468         * bytecompiler/BytecodeGenerator.cpp:
469         (JSC::BytecodeGenerator::addVar): Factored out a helper function for
470         allocating an anonymous var.
471
472         (JSC::BytecodeGenerator::BytecodeGenerator): Merged / simplified some
473         arguments vs activation logic, and added code to allocate the arguments
474         registers when needed.
475
476         (JSC::BytecodeGenerator::createArgumentsIfNecessary): Updated for new bytecode operands.
477
478         (JSC::BytecodeGenerator::emitCallEval): No need to create the arguments
479         object before calling eval; the activation object will lazily create the
480         arguments object if eval resolves it.
481
482         (JSC::BytecodeGenerator::emitReturn): Updated for new bytecode operands.
483
484         (JSC::BytecodeGenerator::emitPushScope):
485         (JSC::BytecodeGenerator::emitPushNewScope): Ditto emitCallEval.
486
487         * bytecompiler/BytecodeGenerator.h:
488         (JSC::BytecodeGenerator::addVar): Factored out a helper function for
489         allocating an anonymous var.
490
491         (JSC::BytecodeGenerator::registerFor): No more need for special handling
492         of the arguments registers; they're allocated just like normal registers
493         now.
494
495         * interpreter/CallFrame.h:
496         (JSC::ExecState::callerFrame):
497         (JSC::ExecState::init):
498         * interpreter/CallFrameClosure.h:
499         (JSC::CallFrameClosure::resetCallFrame): Nixed optionalCalleeArguments.
500
501         * interpreter/Interpreter.cpp:
502         (JSC::Interpreter::dumpRegisters):
503         (JSC::Interpreter::unwindCallFrame):
504         (JSC::Interpreter::privateExecute):
505         (JSC::Interpreter::retrieveArguments): Opcodes accessing 'arguments' now
506         take operands specifying registers, just like all other opcodes.
507         JSActivation::copyRegisters is no longer responsible for tearing off the
508         arguments object; instead, the VM is responsible for both.
509
510         Also, a behavior change: Each access to f.arguments creates a new object,
511         unless f itself uses 'arguments'. This matches Chrome, and is necessary
512         for the optimization. f.arguments is a nonstandard, deprecated feature,
513         so high fidelity to a given implementation is not necessarily a goal.
514         Also, as illustrated by the new test case, the identity of f.arguments
515         has been broken since 2008, except in the case where f itself accesses
516         f.arguments -- but nobody seemed to notice. So, hopefully this change won't
517         break the web.
518         
519         * interpreter/Register.h: Nixed the special arguments accessor. It's no
520         longer needed.
521
522         * interpreter/RegisterFile.h:
523         (JSC::RegisterFile::):
524         * jit/JITCall.cpp:
525         (JSC::JIT::compileOpCallInitializeCallFrame):
526         (JSC::JIT::compileOpCall):
527         * jit/JITOpcodes.cpp:
528         (JSC::JIT::emit_op_tear_off_activation):
529         (JSC::JIT::emit_op_tear_off_arguments):
530         (JSC::JIT::emit_op_create_arguments):
531         (JSC::JIT::emit_op_init_arguments):
532         * jit/JITOpcodes32_64.cpp:
533         (JSC::JIT::emit_op_tear_off_activation):
534         (JSC::JIT::emit_op_tear_off_arguments):
535         (JSC::JIT::emit_op_create_arguments):
536         (JSC::JIT::emit_op_init_arguments): The actual optimization: Removed
537         OptionalCalleeArguments from the callframe slot. Now, it doesn't need
538         to be initialized for most calls.
539
540         * jit/JITStubs.cpp:
541         (JSC::DEFINE_STUB_FUNCTION):
542         * jit/JITStubs.h:
543         (JSC::): Updated stubs to support arbitrary 'arguments' registers,
544         instead of hard-coding something in the call frame.
545
546         * runtime/Arguments.h:
547         (JSC::JSActivation::copyRegisters): Removed some obfuscatory abstraction.
548
549         * runtime/Executable.h:
550         (JSC::FunctionExecutable::generatedByteCode): Added a helper for accessing
551         the 'arguments' register. In a future patch, that kind of data should
552         probably move out of CodeBlock and into Executable.
553
554         * runtime/JSActivation.cpp:
555         (JSC::JSActivation::getOwnPropertySlot):
556         (JSC::JSActivation::argumentsGetter):
557         * runtime/JSActivation.h: Simplified / fixed access to 'arguments' via
558         the activation object. It now implements the same behavior implemented
559         by optimized variable access in the VM. This simplifies some other
560         things, too -- like eval code generation.
561
562 2010-05-18  Sam Weinig  <sam@webkit.org>
563
564         Try to fix the windows build.
565
566         * API/JSStringRefBSTR.cpp:
567
568 2010-05-18  Anders Carlsson  <andersca@apple.com>
569
570         Reviewed by Sam Weinig.
571
572         Add an inlineCapacity template parameter to ListHashSet and use it to shrink the positioned object list hash set.
573         https://bugs.webkit.org/show_bug.cgi?id=39304
574         <rdar://problem/7998366>
575
576         Add an inlineCapacity template parameter to ListHashSet.
577
578         * wtf/ListHashSet.h:
579         (WTF::::ListHashSet):
580         (WTF::::operator):
581         (WTF::::swap):
582         (WTF::::~ListHashSet):
583         (WTF::::size):
584         (WTF::::capacity):
585         (WTF::::isEmpty):
586         (WTF::::begin):
587         (WTF::::end):
588         (WTF::::find):
589         (WTF::::contains):
590         (WTF::::add):
591         (WTF::::insertBefore):
592         (WTF::::remove):
593         (WTF::::clear):
594         (WTF::::unlinkAndDelete):
595         (WTF::::appendNode):
596         (WTF::::insertNodeBefore):
597         (WTF::::deleteAllNodes):
598         (WTF::::makeIterator):
599         (WTF::::makeConstIterator):
600         (WTF::deleteAllValues):
601
602 2010-05-18  Gabor Loki  <loki@webkit.org>
603
604         Reviewed by Darin Adler.
605
606         Fix the interpreter after r59637
607         https://bugs.webkit.org/show_bug.cgi?id=39287
608
609         * runtime/Executable.h:
610         * runtime/JSFunction.cpp:
611         (JSC::JSFunction::JSFunction):
612         (JSC::JSFunction::getCallData):
613         * runtime/JSGlobalData.cpp:
614         * runtime/JSGlobalData.h:
615
616 2010-05-17  Gavin Barraclough  <barraclough@apple.com>
617
618         Reviewed by Geoff Garen.
619
620         Oops, meant ebx not eax there.  Fix Qt (and probably Win too).
621
622         * jit/JITOpcodes32_64.cpp:
623
624 2010-05-17  Gavin Barraclough  <barraclough@apple.com>
625
626         Reviewed by Geoff Garen.
627
628         Bug 39252 - Move host/native JSFunction's NativeFunction onto NativeExecutable.
629
630         Currently host functions reuse JSFunction's ScopeChain as storage for their
631         NativeFunction (the C function pointer to the host function implementation).
632         Instead, move this onto NativeExecutable.  This will allow host functions to
633         have a scopechain (which will be implemented as a separate patch).
634
635         * JavaScriptCore.xcodeproj/project.pbxproj:
636         * jit/JIT.h:
637         * jit/JITCall.cpp:
638         (JSC::JIT::compileOpCallInitializeCallFrame):
639         (JSC::JIT::compileOpCall):
640         * jit/JITOpcodes.cpp:
641         (JSC::JIT::privateCompileCTIMachineTrampolines):
642         * jit/JITOpcodes32_64.cpp:
643         * jit/JITPropertyAccess.cpp:
644         (JSC::JIT::stringGetByValStubGenerator):
645         (JSC::JIT::emitSlow_op_get_by_val):
646         * jit/JITPropertyAccess32_64.cpp:
647         (JSC::JIT::stringGetByValStubGenerator):
648         (JSC::JIT::emitSlow_op_get_by_val):
649         * jit/JITStubs.cpp:
650         (JSC::JITThunks::specializedThunk):
651         * jit/JITStubs.h:
652         (JSC::JITThunks::ctiNativeCall):
653         * jit/SpecializedThunkJIT.h:
654         (JSC::SpecializedThunkJIT::finalize):
655         * jit/ThunkGenerators.cpp:
656         (JSC::charCodeAtThunkGenerator):
657         (JSC::charAtThunkGenerator):
658         (JSC::fromCharCodeThunkGenerator):
659         (JSC::sqrtThunkGenerator):
660         (JSC::powThunkGenerator):
661         * jit/ThunkGenerators.h:
662         * runtime/Executable.h:
663         (JSC::NativeExecutable::create):
664         (JSC::NativeExecutable::function):
665         (JSC::NativeExecutable::NativeExecutable):
666         (JSC::JSFunction::nativeFunction):
667         * runtime/JSFunction.cpp:
668         (JSC::JSFunction::JSFunction):
669         (JSC::JSFunction::~JSFunction):
670         (JSC::JSFunction::markChildren):
671         (JSC::JSFunction::getCallData):
672         (JSC::JSFunction::call):
673         (JSC::JSFunction::getOwnPropertySlot):
674         (JSC::JSFunction::getConstructData):
675         (JSC::JSFunction::construct):
676         * runtime/JSFunction.h:
677         (JSC::JSFunction::scope):
678         * runtime/JSGlobalData.h:
679         (JSC::JSGlobalData::getThunk):
680         * runtime/Lookup.cpp:
681         (JSC::setUpStaticFunctionSlot):
682         * runtime/StringConstructor.cpp:
683         (JSC::StringConstructor::StringConstructor):
684
685 2010-05-17  Patrick Gansterer  <paroga@paroga.com>
686
687         Reviewed by Laszlo Gombos.
688
689         [Qt] Remove WinCE endian dedection.
690         https://bugs.webkit.org/show_bug.cgi?id=38511
691
692         Windows CE supports little-endian format only.
693         Correct dedection was added in r57804.
694
695         * wtf/Platform.h:
696
697 2010-05-16  Simon Fraser  <simon.fraser@apple.com>
698
699         Reviewed by Darin Adler.
700
701         Reduce the size of FunctionExecutable
702         https://bugs.webkit.org/show_bug.cgi?id=39180
703         
704         Change m_numVariables from a size_t to 31 bits in a bitfield,
705         packed with another bit for m_forceUsesArguments (which in turn
706         get packed with the base class).
707         
708         Reduces the size of FunctionExecutable from 160 to 152 bytes.
709
710         * runtime/Executable.h:
711         (JSC::FunctionExecutable::variableCount):
712         (JSC::FunctionExecutable::FunctionExecutable):
713
714 2010-05-15  Oliver Hunt  <oliver@apple.com>
715
716         Reviewed by Maciej Stachowiak.
717
718         Incorrect codegen for slowcase of < in 64-bit
719         https://bugs.webkit.org/show_bug.cgi?id=39151
720
721         Call the correct stud for the slowcases of the < operator.
722
723         * jit/JITArithmetic.cpp:
724         (JSC::JIT::emitSlow_op_jnless):
725         (JSC::JIT::emitSlow_op_jless):
726
727 2010-05-15  Leo Yang  <leo.yang@torchmobile.com.cn>
728
729         Reviewed by Darin Adler.
730
731         Fix bug https://bugs.webkit.org/show_bug.cgi?id=38890
732
733         * runtime/DatePrototype.cpp:
734         (JSC::formatLocaleDate):
735
736 2010-05-15  Leandro Pereira  <leandro@profusion.mobi>
737
738         Reviewed by Adam Treat.
739
740         [EFL] Add build system for the EFL port.
741         http://webkit.org/b/37945
742
743         * CMakeLists.txt: Added.
744         * CMakeListsEfl.txt: Added.
745         * config.h: Add conditional to look for cmakeconfig.h.
746         * jsc/CMakeLists.txt: Added.
747         * jsc/CMakeListsEfl.txt: Added.
748         * wtf/CMakeLists.txt: Added.
749         * wtf/CMakeListsEfl.txt: Added.
750
751 2010-05-15  Chao-ying Fu  <fu@mips.com>
752
753         Reviewed by Oliver Hunt.
754
755         Update MIPS JIT for unsigned right shift, Math.sqrt, load16
756         https://bugs.webkit.org/show_bug.cgi?id=38412
757
758         Fixed MIPS build failure.
759
760         * assembler/MIPSAssembler.h:
761         (JSC::MIPSAssembler::srl):
762         (JSC::MIPSAssembler::srlv):
763         (JSC::MIPSAssembler::sqrtd):
764         * assembler/MacroAssemblerMIPS.h:
765         (JSC::MacroAssemblerMIPS::urshift32):
766         (JSC::MacroAssemblerMIPS::sqrtDouble):
767         (JSC::MacroAssemblerMIPS::load16):
768         (JSC::MacroAssemblerMIPS::supportsFloatingPointSqrt):
769         * jit/JSInterfaceJIT.h:
770
771 2010-05-15  Ilya Tikhonovsky  <loislo@chromium.org>
772
773         Reviewed by Geoffrey Garen.
774
775         WebInspector: JSC Should provide heap size info for Timeline panel.
776         https://bugs.webkit.org/show_bug.cgi?id=38420
777
778         * JavaScriptCore.exp:
779         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
780         * runtime/Collector.cpp:
781         (JSC::Heap::size):
782         * runtime/Collector.h:
783
784 2010-05-15  Dave Tapuska  <dtapuska@rim.com>
785
786         Reviewed by Darin Adler.
787
788         Add a new define for we need strict arena alignment. ARMv5 with
789         double word instructions set this value.
790
791         * wtf/Platform.h:
792
793 2010-05-14  Stephanie Lewis  <slewis@apple.com>
794
795         Rubber-stamped by Mark Rowe.
796
797         Update order files.
798
799         * JavaScriptCore.order:
800
801 2010-05-14  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
802
803         Reviewed by Kenneth Rohde Christiansen.
804
805         Implementation of QtScript API that provide method to convert a value to an object.
806
807         [Qt] QtScript is missing toObject API
808         https://bugs.webkit.org/show_bug.cgi?id=36594
809
810         * qt/api/qscriptengine.cpp:
811         (QScriptEngine::toObject):
812         * qt/api/qscriptengine.h:
813         * qt/api/qscriptvalue.cpp:
814         (QScriptValue::toObject):
815         * qt/api/qscriptvalue.h:
816         * qt/api/qscriptvalue_p.h:
817         (QScriptValuePrivate::toObject):
818         * qt/tests/qscriptengine/tst_qscriptengine.cpp:
819         (tst_QScriptEngine::toObject):
820         (tst_QScriptEngine::toObjectTwoEngines):
821         * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
822         (tst_QScriptValue::toObjectSimple):
823         * qt/tests/qscriptvalue/tst_qscriptvalue.h:
824
825 2010-05-14  Chao-ying Fu  <fu@mips.com>
826
827         Reviewed by Oliver Hunt.
828
829         String Indexing Failure on JSVALUE32 targets
830         https://bugs.webkit.org/show_bug.cgi?id=39034
831
832         Remove zero-extend/shift-right code on regT1, because we already have
833         it in emit_op_get_by_val().
834
835         * jit/JITPropertyAccess.cpp:
836         (JSC::JIT::stringGetByValStubGenerator):
837
838 2010-05-10  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
839
840         Reviewed by Alexey Proskuryakov.
841
842         Fix a VS2010 assert in std::copy
843         https://bugs.webkit.org/show_bug.cgi?id=38630
844
845         The assert complains that the output iterator is null.
846
847         * wtf/Vector.h:
848         (WTF::::operator):
849
850 2010-05-13  Maciej Stachowiak  <mjs@apple.com>
851
852         No review, attempted build fix.
853
854         Try to fix Tiger build with some gratuitous initialization of
855         seemingly uninitialized variables.
856
857         * wtf/text/StringImpl.h:
858         (WebCore::StringImpl::tryCreateUninitialized):
859
860 2010-05-13  Maciej Stachowiak  <mjs@apple.com>
861
862         Reviewed by Mark Rowe.
863
864         Various JavaScript string optimizations
865         https://bugs.webkit.org/show_bug.cgi?id=39051
866
867         Approximately 1% SunSpider speedup.
868         
869         * runtime/ArrayPrototype.cpp:
870         (JSC::arrayProtoFuncJoin): Remove branches from the hot code path
871         by moving the first pass outside the loop, and duplicating the hot loop
872         to extract the loop-invariant branch.
873         * runtime/RegExp.cpp:
874         (JSC::RegExp::match): resize ovector to 0 instead of clearing to avoid
875         thrash in case of large matches.
876         * runtime/RegExpConstructor.h:
877         (JSC::RegExpConstructor::performMatch): Mark ALWAYS_INLINE to make the
878         compiler respect our authority.
879         * runtime/StringPrototype.cpp:
880         (JSC::jsSpliceSubstringsWithSeparators): Inline.
881         (JSC::stringProtoFuncSubstring): Rewrite boundary condition checks to
882         reduce the number of floating point comparisons and branches.
883
884 2010-05-12  Gavin Barraclough  <barraclough@apple.com>
885
886         Reviewed by Oliver Hunt.
887
888         https://bugs.webkit.org/show_bug.cgi?id=39039
889         Provide support for separate bytecode/JIT code translations for call/construct usage
890         This will allow us to produce code generated specifically for use as a constructor, not for general function use.
891
892         * bytecode/CodeBlock.cpp:
893         (JSC::CodeBlock::CodeBlock):
894         (JSC::CodeBlock::unlinkCallers):
895         * bytecode/CodeBlock.h:
896         (JSC::CodeBlock::getBytecodeIndex):
897         (JSC::CodeBlock::getJITCode):
898         (JSC::CodeBlock::executablePool):
899         (JSC::GlobalCodeBlock::GlobalCodeBlock):
900         (JSC::FunctionCodeBlock::FunctionCodeBlock):
901         * interpreter/Interpreter.cpp:
902         (JSC::Interpreter::executeCall):
903         (JSC::Interpreter::executeConstruct):
904         (JSC::Interpreter::prepareForRepeatCall):
905         (JSC::Interpreter::execute):
906         (JSC::Interpreter::privateExecute):
907         * interpreter/Interpreter.h:
908         * jit/JIT.cpp:
909         (JSC::JIT::unlinkCallOrConstruct):
910         (JSC::JIT::linkConstruct):
911         * jit/JIT.h:
912         * jit/JITCall.cpp:
913         (JSC::JIT::compileOpCall):
914         (JSC::JIT::compileOpCallSlowCase):
915         * jit/JITOpcodes.cpp:
916         (JSC::JIT::privateCompileCTIMachineTrampolines):
917         * jit/JITOpcodes32_64.cpp:
918         (JSC::JIT::privateCompileCTIMachineTrampolines):
919         * jit/JITPropertyAccess.cpp:
920         (JSC::JIT::emitSlow_op_get_by_val):
921         * jit/JITPropertyAccess32_64.cpp:
922         (JSC::JIT::emitSlow_op_get_by_val):
923         * jit/JITStubs.cpp:
924         (JSC::DEFINE_STUB_FUNCTION):
925         * jit/JITStubs.h:
926         (JSC::JITThunks::ctiVirtualConstructLink):
927         (JSC::JITThunks::ctiVirtualConstruct):
928         (JSC::):
929         * jit/SpecializedThunkJIT.h:
930         (JSC::SpecializedThunkJIT::finalize):
931         * runtime/Arguments.h:
932         (JSC::JSActivation::copyRegisters):
933         * runtime/ArrayPrototype.cpp:
934         (JSC::isNumericCompareFunction):
935         * runtime/Executable.cpp:
936         (JSC::FunctionExecutable::~FunctionExecutable):
937         (JSC::FunctionExecutable::compileForCall):
938         (JSC::FunctionExecutable::compileForConstruct):
939         (JSC::EvalExecutable::generateJITCode):
940         (JSC::ProgramExecutable::generateJITCode):
941         (JSC::FunctionExecutable::generateJITCodeForCall):
942         (JSC::FunctionExecutable::generateJITCodeForConstruct):
943         (JSC::FunctionExecutable::markAggregate):
944         (JSC::FunctionExecutable::reparseExceptionInfo):
945         (JSC::EvalExecutable::reparseExceptionInfo):
946         (JSC::FunctionExecutable::recompile):
947         * runtime/Executable.h:
948         (JSC::ExecutableBase::ExecutableBase):
949         (JSC::ExecutableBase::isHostFunction):
950         (JSC::ExecutableBase::generatedJITCodeForCall):
951         (JSC::ExecutableBase::generatedJITCodeForConstruct):
952         (JSC::NativeExecutable::NativeExecutable):
953         (JSC::EvalExecutable::jitCode):
954         (JSC::ProgramExecutable::jitCode):
955         (JSC::FunctionExecutable::bytecodeForCall):
956         (JSC::FunctionExecutable::isGeneratedForCall):
957         (JSC::FunctionExecutable::generatedBytecodeForCall):
958         (JSC::FunctionExecutable::bytecodeForConstruct):
959         (JSC::FunctionExecutable::isGeneratedForConstruct):
960         (JSC::FunctionExecutable::generatedBytecodeForConstruct):
961         (JSC::FunctionExecutable::symbolTable):
962         (JSC::FunctionExecutable::FunctionExecutable):
963         (JSC::FunctionExecutable::jitCodeForCall):
964         (JSC::FunctionExecutable::jitCodeForConstruct):
965         * runtime/JSActivation.h:
966         (JSC::JSActivation::JSActivationData::JSActivationData):
967         * runtime/JSFunction.cpp:
968         (JSC::JSFunction::~JSFunction):
969         (JSC::JSFunction::call):
970         (JSC::JSFunction::construct):
971         * runtime/JSGlobalData.cpp:
972         (JSC::JSGlobalData::numericCompareFunction):
973
974 2010-05-12  Oliver Hunt  <oliver@apple.com>
975
976         build fix
977
978         <rdar://problem/7977960> REGRESSION (r59282): Tiger PPC build broken
979
980         * runtime/UString.h:
981         (JSC::tryMakeString):
982
983 2010-05-12  Oliver Hunt  <oliver@apple.com>
984
985         Reviewed by Gavin Barraclough.
986
987         <rdar://7969718> Incorrect 32-bit codegen for op_jnlesseq
988         https://bugs.webkit.org/show_bug.cgi?id=39038
989
990         Correct the use of incorrect comparison operators.
991
992         * jit/JITArithmetic32_64.cpp:
993         (JSC::JIT::emit_op_jlesseq):
994         (JSC::JIT::emitBinaryDoubleOp):
995
996 2010-05-12  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
997
998         Reviewed by Eric Seidel.
999
1000         JavaScriptCore: fix build when some optimizations are disabled
1001         https://bugs.webkit.org/show_bug.cgi?id=38800
1002
1003         Remove outdated UNUSED_PARAMs when using JIT but with
1004         ENABLE_JIT_OPTIMIZE_CALL and ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
1005         disabled.
1006
1007         * jit/JITOpcodes.cpp:
1008         * jit/JITOpcodes32_64.cpp:
1009
1010 2010-05-12  Oliver Hunt  <oliver@apple.com>
1011
1012         Reviewed by Gavin Barraclough.
1013
1014         Work around GCC stupidity by either explicitly inlining or by
1015         using ALWAYS_INLINE
1016
1017         * runtime/StringPrototype.cpp:
1018         (JSC::stringProtoFuncReplace):
1019         * runtime/UString.h:
1020         (JSC::UString::~UString):
1021         * wtf/RefPtr.h:
1022         (WTF::RefPtr::RefPtr):
1023         (WTF::RefPtr::~RefPtr):
1024         * wtf/text/StringImpl.h:
1025         (WebCore::StringImpl::create):
1026         (WebCore::StringImpl::tryCreateUninitialized):
1027
1028 2010-05-12  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1029
1030         Reviewed by Kenneth Rohde Christiansen.
1031
1032         [Qt] Detect debug mode consistently
1033         https://bugs.webkit.org/show_bug.cgi?id=38863
1034
1035         * JavaScriptCore.pri:
1036         * JavaScriptCore.pro:
1037         * jsc.pro:
1038         * qt/api/QtScript.pro:
1039
1040 2010-05-12  Peter Varga  <pvarga@inf.u-szeged.hu>
1041
1042         Reviewed by Gavin Barraclough.
1043
1044         Remove a direct jump in generatePatternCharacterGreedy() and
1045         generatePatternCharacterClassGreedy() functions if quantityCount of the term
1046         is unlimited.
1047         https://bugs.webkit.org/show_bug.cgi?id=38898
1048
1049         * yarr/RegexJIT.cpp:
1050         (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
1051         (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
1052
1053 2010-05-11  Geoffrey Garen  <ggaren@apple.com>
1054
1055         Reviewed by Gavin Barraclough.
1056
1057         Slight simplification to the calling convention: read RegisterFile::end()
1058         from an absolute address, instead of from a pointer to the RegisterFile
1059         on the stack.
1060         
1061         SunSpider reports no change.
1062         
1063         This should free us to remove the RegisterFile argument from the stack.
1064
1065         * jit/JIT.cpp:
1066         (JSC::JIT::privateCompile):
1067
1068 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
1069
1070         Possible Gtk build fix - use ALWAYS_INLINE on functions that were inlined.
1071
1072         * wtf/text/AtomicString.h:
1073         (WebCore::AtomicString::add): Use ALWAYS_INLINE.
1074         * wtf/text/WTFString.h:
1075         (WebCore::String::length): Ditto.
1076         (WebCore::String::isEmpty): Ditto.
1077
1078 2010-05-11  Anders Carlsson  <andersca@apple.com>
1079
1080         Reviewed by Sam Weinig.
1081
1082         Add a compile time assert that sizeof(String) == sizeof(AtomicString).
1083
1084         * wtf/text/AtomicString.cpp:
1085
1086 2010-05-11  Anders Carlsson  <andersca@apple.com>
1087
1088         Reviewed by Mark Rowe.
1089
1090         https://bugs.webkit.org/show_bug.cgi?id=38961
1091         Move some member variables around to reduce class sizes.
1092         
1093         Make AtomicString no longer inherit from FastAllocBase.
1094
1095         Since AtomicString's first (and only) member variable, a RefPtr, also inherits from FastAllocBase this
1096         was causing the size of AtomicString to contain sizeof(void*) bytes of padding.
1097
1098         * wtf/text/AtomicString.h:
1099
1100 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
1101
1102         Reviewed by Maciej Stachowiak.
1103         Patch by Gavin Barraclough.
1104         
1105         Rest of REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
1106         https://bugs.webkit.org/show_bug.cgi?id=38930
1107         <rdar://problem/7937188>
1108         
1109         Inline string functions that are commonly used in WTFString, CString, and AtomicString.
1110
1111         * JavaScriptCore.exp: Remove exports of inline functions.
1112         * wtf/text/AtomicString.cpp:
1113         (WebCore::AtomicString::addSlowCase): Rename add to addSlowCase, and inline the fast path
1114             of add.
1115         * wtf/text/AtomicString.h:
1116         (WebCore::AtomicString::add): Inline the fast path of add.
1117         * wtf/text/CString.cpp: Inline implementation of data and length in the header.
1118         * wtf/text/CString.h:
1119         (WTF::CString::data): Inline implementation of data.
1120         (WTF::CString::length): Inline implementation of length.
1121         * wtf/text/WTFString.cpp: Remove implementations of functions to be inlined.
1122         * wtf/text/WTFString.h:
1123         (WebCore::String::String): Inline implementation.
1124         (WebCore::String::length): Ditto.
1125         (WebCore::String::characters): Ditto.
1126         (WebCore::String::operator[]): Ditto.
1127         (WebCore::String::isEmpty): Ditto.
1128
1129 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
1130
1131         Reviewed by Steve Falkenburg and Jon Honeycutt.
1132         Patch by Gavin Barraclough.
1133         
1134         REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
1135         https://bugs.webkit.org/show_bug.cgi?id=38930
1136         <rdar://problem/7937188>
1137         
1138         When the String classes were moved from WebCore to WTF, it meant that on Windows, all operations
1139         on Strings in WebCore had to cross a DLL boundary (from WebKit.dll to JavaScript.dll).
1140         
1141         We fix this by refactoring some of the WTF string code, so the code in AtomicString, StringImpl, and
1142         WTFString can be built by both WebCore and WTF, and we don't need to talk across a DLL to do operations
1143         on Strings.
1144
1145         * GNUmakefile.am: Add new file to build system.
1146         * JavaScriptCore.gypi: Ditto.
1147         * JavaScriptCore.pro: Ditto.
1148         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove string exports, because these are now
1149             handled in WebCore.
1150         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Remove the post-build step that was added
1151             here (the post build step is in JavaScriptCoreCommon.vsprops).
1152         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Copy the three cpp files that need to be compiled
1153             by WebCore into the WebKitOutputDir directory.
1154         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add the StringStatics file.
1155         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add the three WTF string cpp files to this project.
1156         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Remove the need to link against WTF.lib (since jsc links against JavaScriptCore).
1157         * JavaScriptCore.xcodeproj/project.pbxproj: Add the StringStatics file.
1158         * wtf/text/AtomicString.cpp: Moved code to StringStatics.
1159         * wtf/text/StringImpl.cpp: Ditto.
1160         * wtf/text/StringStatics.cpp: Added. Move functions in WTF Strings that define static variables to here, so 
1161             the rest of the files can be compiled in WebCore.
1162         (WebCore::StringImpl::empty): Moved from StringImpl.cpp to here.
1163         (WebCore::AtomicString::init): Moved from AtomicString.cpp to here.
1164
1165 2010-05-11  Alice Liu  <alice.liu@apple.com>
1166
1167         Rubber-stamped by Gavin Barraclough.
1168
1169         Fix build error when enabling debugging block in WebKit win painting code
1170
1171         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1172
1173 2010-05-11  Mark Rowe  <mrowe@apple.com>
1174
1175         Fix the world.
1176
1177         In r59162 a change was made to WebCore's FeatureDefines.xcconfig that enabled FILE_READER and FILE_WRITER.
1178         The author and reviewer of that patch ignored the carefully-worded warning at the top of that file asking
1179         that changes to the file be kept in sync across JavaScriptCore, WebCore and WebKit, as well as being kept
1180         in sync with build-webkit.  This led to WebCore and WebKit having different views of Document's vtable
1181         and results in crashes in Safari shortly after launch when virtual function calls resulted in the wrong
1182         function in WebCore being called.
1183
1184         We fix this by bringing the FeatureDefines.xcconfig files in to sync.  Based on the ChangeLog message and
1185         other changes in r59162 it appears that enabling FILE_WRITER was unintentional so that particular change
1186         has been reverted.
1187
1188         * Configurations/FeatureDefines.xcconfig:
1189
1190 2010-05-11  Sheriff Bot  <webkit.review.bot@gmail.com>
1191
1192         Unreviewed, rolling out r59171.
1193         http://trac.webkit.org/changeset/59171
1194         https://bugs.webkit.org/show_bug.cgi?id=38933
1195
1196         "Broke the world" (Requested by bweinstein on #webkit).
1197
1198         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1199         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1200         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
1201         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1202         * JavaScriptCore.vcproj/jsc/jsc.vcproj:
1203         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
1204         * JavaScriptCore.xcodeproj/project.pbxproj:
1205         * wtf/text/AtomicString.cpp:
1206         (WebCore::AtomicString::init):
1207         * wtf/text/StringImpl.cpp:
1208         (WebCore::StringImpl::empty):
1209         * wtf/text/StringStatics.cpp: Removed.
1210
1211 2010-05-11  Brian Weinstein  <bweinstein@apple.com>
1212
1213         Reviewed by Steve Falkenburg.
1214         Patch by Gavin Barraclough.
1215         
1216         REGRESSION (r57900-57919): 3% PLT Regression from moving strings into WTF.
1217         https://bugs.webkit.org/show_bug.cgi?id=38930
1218         <rdar://problem/7937188>
1219         
1220         When the String classes were moved from WebCore to WTF, it meant that on Windows, all operations
1221         on Strings in WebCore had to cross a DLL boundary (from WebKit.dll to JavaScript.dll).
1222         
1223         We fix this by refactoring some of the WTF string code, so the code in AtomicString, StringImpl, and
1224         WTFString can be built by both WebCore and WTF, and we don't need to talk across a DLL to do operations
1225         on Strings.
1226
1227         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove string exports, because these are now
1228             handled in WebCore.
1229         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Remove the post-build step that was added
1230             here (the post build step is in JavaScriptCoreCommon.vsprops).
1231         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Copy the three cpp files that need to be compiled
1232             by WebCore into the WebKitOutputDir directory.
1233         * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add the StringStatics file.
1234         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add the three WTF string cpp files to this project.
1235         * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Remove the need to link against WTF.lib (since jsc links against JavaScriptCore).
1236         * JavaScriptCore.xcodeproj/project.pbxproj: Add the StringStatics file.
1237         * wtf/text/AtomicString.cpp: Moved code to StringStatics.
1238         * wtf/text/StringImpl.cpp: Ditto.
1239         * wtf/text/StringStatics.cpp: Added. Move functions in WTF Strings that define static variables to here, so 
1240             the rest of the files can be compiled in WebCore.
1241         (WebCore::StringImpl::empty): Moved from StringImpl.cpp to here.
1242         (WebCore::AtomicString::init): Moved from AtomicString.cpp to here.
1243
1244 2010-05-11  Geoffrey Garen  <ggaren@apple.com>
1245
1246         Fixed test failures seen on SnowLeopard buildbot.
1247
1248         * runtime/JSString.cpp:
1249         (JSC::JSString::replaceCharacter): Don't use size_t and wtf::notFound.
1250         Instead, use the individual types and notFound values of the string APIs
1251         we're using, since they're not necessarily the same in 64bit.
1252
1253 2010-05-11  Geoffrey Garen  <ggaren@apple.com>
1254
1255         Reviewed by Oliver Hunt and Darin Adler.
1256
1257         Start using ropes in String.prototype.replace.
1258         
1259         1%-1.5% speedup on SunSpider.
1260
1261         * runtime/JSString.cpp:
1262         (JSC::JSString::resolveRope): Updated for RopeImpl refactoring.
1263
1264         (JSC::JSString::replaceCharacter): Added a replaceCharacter function, which creates
1265         a rope for the resulting replacement.
1266
1267         * runtime/JSString.h: A few changes here:
1268         (JSC::):
1269         (JSC::RopeBuilder::RopeIterator::RopeIterator):
1270         (JSC::RopeBuilder::RopeIterator::operator++):
1271         (JSC::RopeBuilder::RopeIterator::operator*):
1272         (JSC::RopeBuilder::RopeIterator::operator!=):
1273         (JSC::RopeBuilder::RopeIterator::WorkItem::WorkItem):
1274         (JSC::RopeBuilder::RopeIterator::WorkItem::operator!=):
1275         (JSC::RopeBuilder::RopeIterator::skipRopes): Created a RopeIterator abstraction.
1276         We use this to do a substring find without having to resolve the rope.
1277         (We could use this iterator when resolving ropes, too, but resolving
1278         ropes backwards is usually more efficient.)
1279
1280         (JSC::RopeBuilder::JSString): Added constructors for 2 & 3 UStrings.
1281
1282         (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
1283         (JSC::RopeBuilder::size): Updated for RopeImpl refactoring.
1284
1285         * runtime/Operations.h: Updated for RopeImpl refactoring.
1286         (JSC::jsString): Added jsString functions for 2 & 3 UStrings.
1287
1288         * runtime/RopeImpl.cpp:
1289         (JSC::RopeImpl::derefFibersNonRecursive):
1290         * runtime/RopeImpl.h:
1291         (JSC::RopeImpl::initializeFiber):
1292         (JSC::RopeImpl::size):
1293         (JSC::RopeImpl::fibers):
1294         (JSC::RopeImpl::deref):
1295         (JSC::RopeImpl::RopeImpl): A little refactoring to make this patch easier:
1296         Moved statics to the top of the class; put multi-statement functions on
1297         multiple lines; renamed "fiberCount" to "size" to match other collections;
1298         changed the "fibers" accessor to return the fibers buffer, instead of an
1299         item in the buffer, to make iteration easier.
1300
1301         * runtime/StringPrototype.cpp:
1302         (JSC::stringProtoFuncReplace): Don't resolve a rope unless we need to. Do
1303         use our new replaceCharacter function if possible. Do use a rope to
1304         represent splicing three strings together.
1305
1306 2010-05-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1307
1308         Reviewed by Darin Adler.
1309
1310         [Qt] Disable JIT support for mingw-w64
1311         https://bugs.webkit.org/show_bug.cgi?id=38747
1312
1313         Disale JIT for mingw-w64 as it is reportedly
1314         unstable.
1315
1316         Thanks for Vanboxem Rruben for the investigation.
1317
1318         * wtf/Platform.h:
1319
1320 2010-05-09  Fumitoshi Ukai  <ukai@chromium.org>
1321
1322         Reviewed by Eric Seidel.
1323
1324         JavaScriptCore/wtf/MD5.h: checksum should take a reference to output.
1325         https://bugs.webkit.org/show_bug.cgi?id=38723
1326
1327         * JavaScriptCore.exp:
1328         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1329         * wtf/MD5.cpp:
1330         (WTF::expectMD5):
1331           Fix for checksum change.
1332         (WTF::MD5::checksum):
1333           Take a reference to output, instead of returning the result by value, to reduce coping for performance.
1334         * wtf/MD5.h:
1335
1336 2010-05-09  Oliver Hunt  <oliver@apple.com>
1337
1338         Build fix.
1339
1340         Fix accidental repeat addition of emit_op_new_regexp
1341
1342         * jit/JITOpcodes.cpp:
1343
1344 2010-05-09  Oliver Hunt  <oliver@apple.com>
1345
1346         Reviewed by Gavin Barraclough.
1347
1348         REGRESSION(r57955): RegExp literals should not actually be cached, so r57955 should be rolled out.
1349         https://bugs.webkit.org/show_bug.cgi?id=38828
1350         <rdar://problem/7961634>
1351
1352         Rollout r57955
1353
1354         * bytecode/CodeBlock.cpp:
1355         (JSC::regexpToSourceString):
1356         (JSC::regexpName):
1357         (JSC::CodeBlock::dump):
1358         (JSC::CodeBlock::shrinkToFit):
1359         * bytecode/CodeBlock.h:
1360         (JSC::CodeBlock::addRegExp):
1361         (JSC::CodeBlock::regexp):
1362         * bytecode/Opcode.h:
1363         * bytecompiler/BytecodeGenerator.cpp:
1364         (JSC::BytecodeGenerator::addRegExp):
1365         (JSC::BytecodeGenerator::emitNewRegExp):
1366         * bytecompiler/BytecodeGenerator.h:
1367         * bytecompiler/NodesCodegen.cpp:
1368         (JSC::RegExpNode::emitBytecode):
1369         * interpreter/Interpreter.cpp:
1370         (JSC::Interpreter::privateExecute):
1371         * jit/JIT.cpp:
1372         (JSC::JIT::privateCompileMainPass):
1373         * jit/JIT.h:
1374         * jit/JITOpcodes.cpp:
1375         (JSC::JIT::emit_op_new_regexp):
1376         * jit/JITStubs.cpp:
1377         (JSC::DEFINE_STUB_FUNCTION):
1378         * jit/JITStubs.h:
1379         (JSC::):
1380
1381 2010-05-09  Geoffrey Garen  <ggaren@apple.com>
1382
1383         Reviewed by Oliver Hunt.
1384
1385         Reserve a large-ish initial capacity for Lexer::m_buffer16.
1386         
1387         SunSpider says 0.3% faster.
1388         
1389         m_buffer16 is used when parsing complex strings -- for example, strings
1390         with escape sequences in them. These kinds of strings can be really long,
1391         and we want to avoid repeatedly copying as we grow m_buffer16.
1392         
1393         The net memory cost is quite low, since it's proporitional to source
1394         code we already have in memory, and we throw away m_buffer16 right when
1395         we're done parsing.
1396
1397         * parser/Lexer.cpp:
1398         (JSC::Lexer::Lexer): No need to reserve initial capacity in our constructor,
1399         since setCode will be called before we're asked to lex anything.
1400         (JSC::Lexer::setCode): Reserve enough space to lex half the source code
1401         as a complex string without having to copy.
1402         (JSC::Lexer::clear): No need to reserve initial capacity here either,
1403         since setCode will be called before we're asked to lex anything.
1404
1405 2010-05-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1406
1407         Reviewed by Eric Seidel.
1408
1409         [Qt] Remove YARR configuration rules from Qt make system
1410         https://bugs.webkit.org/show_bug.cgi?id=38819
1411
1412         Setting YARR based on JIT seeting is now in Platform.h 
1413         for all ports. This patch essentially reverses r49238.
1414
1415         * JavaScriptCore.pri:
1416
1417 2010-05-09  Oliver Hunt  <oliver@apple.com>
1418
1419         Reviewed by Maciej Stachowiak.
1420
1421         Improve string indexing performance
1422         https://bugs.webkit.org/show_bug.cgi?id=38814
1423
1424         Add an assembly stub to do indexed loads from strings much
1425         more cheaply than the current stub dispatch logic.  We can
1426         do this because we are able to make guarantees about the
1427         register contents when entering the stub so the call overhead
1428         is negligible.
1429
1430         * jit/JIT.h:
1431         * jit/JITInlineMethods.h:
1432         * jit/JITOpcodes.cpp:
1433         * jit/JITPropertyAccess.cpp:
1434         (JSC::JIT::stringGetByValStubGenerator):
1435         (JSC::JIT::emitSlow_op_get_by_val):
1436            Moved from JITOpcodes.cpp to keep the slowcase next to
1437            the normal case codegen as we do for everything else.
1438         * jit/JITPropertyAccess32_64.cpp:
1439         (JSC::JIT::stringGetByValStubGenerator):
1440         (JSC::JIT::emitSlow_op_get_by_val):
1441         * jit/JSInterfaceJIT.h:
1442         (JSC::JSInterfaceJIT::emitFastArithImmToInt):
1443
1444 2010-05-09  Maciej Stachowiak  <mjs@apple.com>
1445
1446         Fixed version of: "Optimized o[s] where o is a cell and s is a string"
1447         https://bugs.webkit.org/show_bug.cgi?id=38815
1448         
1449         Fixed the previous patch for this from Geoff Garen.
1450         
1451         The two problems were a missing exception check and a PropertySlot
1452         initialized improperly, leading to crashes and failures in the case
1453         of getters accessed with bracket syntax.
1454
1455     Previous patch:
1456
1457         Optimized o[s] where o is a cell and s is a string, removing some old
1458         code that wasn't really tuned for the JIT.
1459         
1460         SunSpider says 0.8% faster.
1461
1462         * jit/JITStubs.cpp:
1463         (JSC::DEFINE_STUB_FUNCTION):
1464         * runtime/JSCell.h:
1465
1466 2010-05-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1467
1468         Unreviewed, build fix.
1469
1470         Fix missing terminating ' character warning
1471
1472         The warning has been only seen on the Gtk buildbots.
1473
1474         * wtf/Platform.h:
1475
1476 2010-05-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1477
1478         Reviewed by Gavin Barraclough.
1479
1480         Refactor YARR and YARR_JIT default rules in Platform.h
1481         https://bugs.webkit.org/show_bug.cgi?id=38727
1482
1483         Turn on YARR and YARR JIT by default of JIT is enabled.
1484         Ports can overrule this default decisions as they wish.
1485
1486         * wtf/Platform.h:
1487
1488 2010-05-08  Oliver Hunt  <oliver@apple.com>
1489
1490         Reviewed by Gavin Barraclough.
1491
1492         Split JSVALUE32_64 code out of JITOpcodes.cpp and into JITOpcodes32_64.cpp
1493         https://bugs.webkit.org/show_bug.cgi?id=38808
1494
1495         * GNUmakefile.am:
1496         * JavaScriptCore.gypi:
1497         * JavaScriptCore.pro:
1498         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1499         * JavaScriptCore.xcodeproj/project.pbxproj:
1500         * jit/JITOpcodes.cpp:
1501         * jit/JITOpcodes32_64.cpp: Added.
1502         (JSC::JIT::privateCompileCTIMachineTrampolines):
1503         (JSC::JIT::emit_op_mov):
1504         (JSC::JIT::emit_op_end):
1505         (JSC::JIT::emit_op_jmp):
1506         (JSC::JIT::emit_op_loop_if_lesseq):
1507         (JSC::JIT::emitSlow_op_loop_if_lesseq):
1508         (JSC::JIT::emit_op_new_object):
1509         (JSC::JIT::emit_op_instanceof):
1510         (JSC::JIT::emitSlow_op_instanceof):
1511         (JSC::JIT::emit_op_new_func):
1512         (JSC::JIT::emit_op_get_global_var):
1513         (JSC::JIT::emit_op_put_global_var):
1514         (JSC::JIT::emit_op_get_scoped_var):
1515         (JSC::JIT::emit_op_put_scoped_var):
1516         (JSC::JIT::emit_op_tear_off_activation):
1517         (JSC::JIT::emit_op_tear_off_arguments):
1518         (JSC::JIT::emit_op_new_array):
1519         (JSC::JIT::emit_op_resolve):
1520         (JSC::JIT::emit_op_to_primitive):
1521         (JSC::JIT::emitSlow_op_to_primitive):
1522         (JSC::JIT::emit_op_strcat):
1523         (JSC::JIT::emit_op_resolve_base):
1524         (JSC::JIT::emit_op_resolve_skip):
1525         (JSC::JIT::emit_op_resolve_global):
1526         (JSC::JIT::emitSlow_op_resolve_global):
1527         (JSC::JIT::emit_op_not):
1528         (JSC::JIT::emitSlow_op_not):
1529         (JSC::JIT::emit_op_jfalse):
1530         (JSC::JIT::emitSlow_op_jfalse):
1531         (JSC::JIT::emit_op_jtrue):
1532         (JSC::JIT::emitSlow_op_jtrue):
1533         (JSC::JIT::emit_op_jeq_null):
1534         (JSC::JIT::emit_op_jneq_null):
1535         (JSC::JIT::emit_op_jneq_ptr):
1536         (JSC::JIT::emit_op_jsr):
1537         (JSC::JIT::emit_op_sret):
1538         (JSC::JIT::emit_op_eq):
1539         (JSC::JIT::emitSlow_op_eq):
1540         (JSC::JIT::emit_op_neq):
1541         (JSC::JIT::emitSlow_op_neq):
1542         (JSC::JIT::compileOpStrictEq):
1543         (JSC::JIT::emit_op_stricteq):
1544         (JSC::JIT::emitSlow_op_stricteq):
1545         (JSC::JIT::emit_op_nstricteq):
1546         (JSC::JIT::emitSlow_op_nstricteq):
1547         (JSC::JIT::emit_op_eq_null):
1548         (JSC::JIT::emit_op_neq_null):
1549         (JSC::JIT::emit_op_resolve_with_base):
1550         (JSC::JIT::emit_op_new_func_exp):
1551         (JSC::JIT::emit_op_throw):
1552         (JSC::JIT::emit_op_get_pnames):
1553         (JSC::JIT::emit_op_next_pname):
1554         (JSC::JIT::emit_op_push_scope):
1555         (JSC::JIT::emit_op_pop_scope):
1556         (JSC::JIT::emit_op_to_jsnumber):
1557         (JSC::JIT::emitSlow_op_to_jsnumber):
1558         (JSC::JIT::emit_op_push_new_scope):
1559         (JSC::JIT::emit_op_catch):
1560         (JSC::JIT::emit_op_jmp_scopes):
1561         (JSC::JIT::emit_op_switch_imm):
1562         (JSC::JIT::emit_op_switch_char):
1563         (JSC::JIT::emit_op_switch_string):
1564         (JSC::JIT::emit_op_new_error):
1565         (JSC::JIT::emit_op_debug):
1566         (JSC::JIT::emit_op_enter):
1567         (JSC::JIT::emit_op_enter_with_activation):
1568         (JSC::JIT::emit_op_create_arguments):
1569         (JSC::JIT::emit_op_init_arguments):
1570         (JSC::JIT::emit_op_convert_this):
1571         (JSC::JIT::emitSlow_op_convert_this):
1572         (JSC::JIT::emit_op_profile_will_call):
1573         (JSC::JIT::emit_op_profile_did_call):
1574
1575 2010-05-08  Gabor Loki  <loki@webkit.org>
1576
1577         Reviewed by Gavin Barraclough.
1578
1579         Fix halfword loads on ARM
1580         https://bugs.webkit.org/show_bug.cgi?id=38741
1581
1582         The BaseIndex and ImplicitAddress are contain 32bit wide offset, but
1583         the load16 functions were working with 8 bit data (encoded in the
1584         instruction). If the offset cannot be encoded in an instruction, it
1585         should be stored in a temporary register.
1586
1587         * assembler/ARMAssembler.h:
1588         (JSC::ARMAssembler::getOffsetForHalfwordDataTransfer):
1589         * assembler/MacroAssemblerARM.h:
1590         (JSC::MacroAssemblerARM::load16):
1591
1592 2010-05-08  Gabor Loki  <loki@webkit.org>
1593
1594         Reviewed by Gavin Barraclough.
1595
1596         Fix spanning branch instruction on Cortex-A8 with Thumb-2 JIT
1597         https://bugs.webkit.org/show_bug.cgi?id=38280
1598
1599         If the 32-bit Thumb-2 branch instruction spans two 4KiB regions and
1600         the target of the branch falls within the first region it is
1601         possible for the processor to incorrectly determine the branch
1602         instruction, and it is also possible in some cases for the processor
1603         to enter a deadlock state.
1604
1605         * assembler/ARMv7Assembler.h:
1606         (JSC::ARMv7Assembler::linkJumpAbsolute):
1607
1608 2010-05-08  Adam Barth  <abarth@webkit.org>
1609
1610         Reviewed by Darin Fisher.
1611
1612         [WTFURL] Add a buffer for managing the output of the canonicalizer
1613         https://bugs.webkit.org/show_bug.cgi?id=38671
1614
1615         The canonicalizer produces a stream of canonicalized characters, which
1616         we will store in a URLBuffer.  URLBuffer is quite similar to Vector,
1617         but serves as an abstraction to isolate us from the underlying
1618         character storage.  In the case of WebKit, we'll probably implement a
1619         subclass of URLBuffer with Vector.  In Chromium, the backing store is a
1620         std::string, which avoids an unnecessary memcpy that would be caused by
1621         using Vector instead.
1622
1623         * wtf/url/src/URLBuffer.h: Added.
1624         (WTF::URLBuffer::URLBuffer):
1625         (WTF::URLBuffer::~URLBuffer):
1626         (WTF::URLBuffer::at):
1627         (WTF::URLBuffer::set):
1628         (WTF::URLBuffer::capacity):
1629         (WTF::URLBuffer::length):
1630         (WTF::URLBuffer::data):
1631         (WTF::URLBuffer::setLength):
1632         (WTF::URLBuffer::append):
1633         (WTF::URLBuffer::grow):
1634
1635 2010-05-08  Eric Seidel  <eric@webkit.org>
1636
1637         Unreviewed, just reverting commit.
1638
1639         REGRESSION(59000): r59000 contained all sorts of changes it should not have, needs revert.
1640         https://bugs.webkit.org/show_bug.cgi?id=38798
1641
1642         * bytecompiler/BytecodeGenerator.cpp:
1643         (JSC::BytecodeGenerator::emitResolve):
1644         * jit/JITOpcodes.cpp:
1645         (JSC::JIT::emit_op_resolve_global):
1646
1647 2010-05-04  Jer Noble  <jer.noble@apple.com>
1648
1649         Reviewed by Maciej Stachowiak
1650
1651         Safari pegs CPU and drops tons of frames using HTML5 Vimeo player
1652         <https://bugs.webkit.org/show_bug.cgi?id=34005>
1653         <rdar://problem/7569713>
1654         
1655         Added cancelCallOnMainThread.  callOnMainThread should always now be paired
1656         with cancelCallOnMainThread in situations where the refcon passed to callOnMainThread
1657         may be dealloced before the main thread function can be dispatched.  
1658         
1659         * wtf/MainThread.cpp:
1660         (WTF::FunctionWithContext::operator == ): Supports the FunctionWithContextFinder predicate functor.
1661         (WTF::FunctionWithContextFinder::FunctionWithContextFinder):  Predicate functor for use with Dequeue::findIf
1662         (WTF::FunctionWithContextFinder::operator()):
1663         (WTF::cancelCallOnMainThread):
1664         * wtf/MainThread.h:
1665
1666 2010-05-07  Oliver Hunt  <oliver@apple.com>
1667
1668         Windows build fix.
1669
1670         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1671
1672 2010-05-07  Eric Seidel  <eric@webkit.org>
1673
1674         Unreviewed, rolling out r58990.
1675         http://trac.webkit.org/changeset/58990
1676
1677         Broke 4 tests on Snow Leopard and Qt.
1678
1679         * jit/JITStubs.cpp:
1680         (JSC::DEFINE_STUB_FUNCTION):
1681         * runtime/JSCell.h:
1682
1683 2010-05-07  Oliver Hunt  <oliver@apple.com>
1684
1685         Reviewed by Gavin Barraclough.
1686
1687         Optimize access to the global object from a function that uses eval
1688         https://bugs.webkit.org/show_bug.cgi?id=38644
1689
1690         Fix bug where cross scope access to a global var (vs. property) would
1691         be allowed without checking for intervening dynamic scopes.
1692
1693         * bytecompiler/BytecodeGenerator.cpp:
1694         (JSC::BytecodeGenerator::emitResolve):
1695
1696 2010-05-07  Oliver Hunt  <oliver@apple.com>
1697
1698         32-bit buildfix.
1699
1700         Macro expansion I stab at thee!
1701
1702         * jit/JITOpcodes.cpp:
1703         (JSC::JIT::emit_op_resolve_global):
1704
1705 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
1706
1707         Reviewed by Darin Adler.
1708
1709         Optimized o[s] where o is a cell and s is a string, removing some old
1710         code that wasn't really tuned for the JIT.
1711         
1712         SunSpider says 0.8% faster.
1713
1714         * jit/JITStubs.cpp:
1715         (JSC::DEFINE_STUB_FUNCTION):
1716         * runtime/JSCell.h:
1717
1718 2010-05-07  Oliver Hunt  <oliver@apple.com>
1719
1720         Windows build fix.
1721
1722         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1723
1724 2010-05-07  Oliver Hunt  <oliver@apple.com>
1725
1726         Reviewed by Geoffrey Garen.
1727
1728         Optimize access to the global object from a function that uses eval
1729         https://bugs.webkit.org/show_bug.cgi?id=38644
1730
1731         Add op_resolve_global_dynamic, a variant of op_resolve_global that
1732         checks each node in the scope chain for dynamically inserted properties
1733         and falls back to the normal resolve logic in that case.
1734
1735         * JavaScriptCore.exp:
1736         * bytecode/CodeBlock.cpp:
1737         (JSC::isGlobalResolve):
1738         (JSC::CodeBlock::printStructures):
1739         (JSC::CodeBlock::dump):
1740         (JSC::CodeBlock::derefStructures):
1741         * bytecode/Opcode.h:
1742         * bytecompiler/BytecodeGenerator.cpp:
1743         (JSC::BytecodeGenerator::findScopedProperty):
1744            Now take an additional reference parameter to used to indicate that
1745            there were nodes that may gain dynamic properties
1746         (JSC::BytecodeGenerator::emitResolve):
1747         (JSC::BytecodeGenerator::emitResolveBase):
1748         (JSC::BytecodeGenerator::emitResolveWithBase):
1749            deal with additional argument to findScopedProperty
1750         * bytecompiler/BytecodeGenerator.h:
1751         * bytecompiler/NodesCodegen.cpp:
1752         (JSC::FunctionCallResolveNode::emitBytecode):
1753         (JSC::PostfixResolveNode::emitBytecode):
1754         (JSC::PrefixResolveNode::emitBytecode):
1755         (JSC::ReadModifyResolveNode::emitBytecode):
1756         (JSC::AssignResolveNode::emitBytecode):
1757            These functions use findScopedProperty directly in order to
1758            optimise lookup.  They cannot trivially handle any degree of
1759            dynamism in the lookup so we just give up in such case.
1760         * interpreter/Interpreter.cpp:
1761         (JSC::Interpreter::resolveGlobalDynamic):
1762         (JSC::Interpreter::execute):
1763         (JSC::Interpreter::privateExecute):
1764         * interpreter/Interpreter.h:
1765         * jit/JIT.cpp:
1766         (JSC::JIT::privateCompileMainPass):
1767         (JSC::JIT::privateCompileSlowCases):
1768         * jit/JIT.h:
1769         * jit/JITOpcodes.cpp:
1770         (JSC::JIT::emit_op_resolve_global):
1771         (JSC::JIT::emit_op_resolve_global_dynamic):
1772         (JSC::JIT::emitSlow_op_resolve_global):
1773         (JSC::JIT::emitSlow_op_resolve_global_dynamic):
1774            Happily resolve_global_dynamic can share the slow case!
1775         * jit/JITStubs.h:
1776         (JSC::):
1777         * runtime/JSActivation.cpp:
1778         (JSC::JSActivation::isDynamicScope):
1779         * runtime/JSActivation.h:
1780         * runtime/JSGlobalObject.cpp:
1781         (JSC::JSGlobalObject::isDynamicScope):
1782         * runtime/JSGlobalObject.h:
1783         * runtime/JSStaticScopeObject.cpp:
1784         (JSC::JSStaticScopeObject::isDynamicScope):
1785         * runtime/JSStaticScopeObject.h:
1786         * runtime/JSVariableObject.h:
1787
1788 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
1789
1790         Reviewed by Gavin Barraclough.
1791
1792         Fixed Sputnik failure seen on buildbot.
1793
1794         * runtime/NumberPrototype.cpp:
1795         (JSC::numberProtoFuncToString): Cast to unsigned before checking magnitude,
1796         to efficiently exclude negative numbers, which require two characters
1797         instead of one.
1798
1799 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
1800
1801         Reviewed by Alexey Proskuryakov.
1802         
1803         Slightly more effective way to guarantee a compile-time constant, at
1804         least on gcc.
1805
1806         * runtime/NumberPrototype.cpp:
1807         (JSC::numberProtoFuncToString): Use pointer notation instead of array
1808         notation, so the compiler treats the string and its contents as constant.
1809
1810 2010-05-07  Adam Barth  <abarth@webkit.org>
1811
1812         Reviewed by Alexey Proskuryakov.
1813
1814         [WTFURL] Add core URL parser
1815         https://bugs.webkit.org/show_bug.cgi?id=38572
1816
1817         This patch adds the core of the URL parser.  The URL parser uses a
1818         templated notion of a code unit to support different string types.
1819         Later we'll add some non-templated APIs with concrete types that
1820         clients can use more conveniently.
1821
1822         The URLParser has a couple calls to ASSERT(), which I've commented out
1823         for now.  I'm not 100% sure how to handle the dependency issues there
1824         yet, so I've punted on the issue for now.
1825
1826         Also, there are a number of methods that are declared public in this
1827         patch that are only used by the canonicalizer.  My plan is to make
1828         those private or protected and make the canonicalizer a friend of the
1829         parser.  The details will be in a later patch.
1830
1831         * wtf/url/src/URLComponent.h:
1832         (WTF::URLComponent::fromRange):
1833         (WTF::URLComponent::isNonEmpty):
1834         (WTF::URLComponent::isEmptyOrInvalid):
1835         * wtf/url/src/URLParser.h: Added.
1836         (WTF::URLParser::):
1837         (WTF::URLParser::isPossibleAuthorityTerminator):
1838         (WTF::URLParser::parseAuthority):
1839         (WTF::URLParser::extractScheme):
1840         (WTF::URLParser::parseAfterScheme):
1841         (WTF::URLParser::parseStandardURL):
1842         (WTF::URLParser::parsePath):
1843         (WTF::URLParser::parsePathURL):
1844         (WTF::URLParser::parseMailtoURL):
1845         (WTF::URLParser::parsePort):
1846         (WTF::URLParser::extractFileName):
1847         (WTF::URLParser::extractQueryKeyValue):
1848         (WTF::URLParser::isURLSlash):
1849         (WTF::URLParser::shouldTrimFromURL):
1850         (WTF::URLParser::trimURL):
1851         (WTF::URLParser::consecutiveSlashes):
1852         (WTF::URLParser::isPortDigit):
1853         (WTF::URLParser::nextAuthorityTerminator):
1854         (WTF::URLParser::parseUserInfo):
1855         (WTF::URLParser::parseServerInfo):
1856
1857 2010-05-07  Geoffrey Garen  <ggaren@apple.com>
1858
1859         Reviewed by Oliver Hunt.
1860
1861         Added a fast path for number-to-character conversion via
1862         Number.prototype.toString base 36.
1863         
1864         0.7% speedup on SunSpider.
1865
1866         * runtime/NumberPrototype.cpp:
1867         (JSC::numberProtoFuncToString): Made radix interpretation a little more
1868         efficient by keeping it in int space. Turned "const char" into
1869         "static const char" just in case. Added a fast path for base 36
1870         conversion of something that will turn into a character.
1871
1872 2010-05-07  Adam Barth  <abarth@webkit.org>
1873
1874         Reviewed by Darin Fisher.
1875
1876         [WTFURL] Add a malloc-backed URLBuffer
1877         https://bugs.webkit.org/show_bug.cgi?id=38694
1878
1879         This patch adds a URLBuffer that uses new/delete to manage the backing
1880         store for the buffer.
1881
1882         * wtf/url/src/RawURLBuffer.h: Added.
1883         (WTF::RawURLBuffer::RawURLBuffer):
1884         (WTF::RawURLBuffer::~RawURLBuffer):
1885         (WTF::RawURLBuffer::resize):
1886
1887 2010-05-06  Fumitoshi Ukai  <ukai@chromium.org>
1888
1889         Reviewed by Alexey Proskuryakov.
1890
1891         JavaScriptCore/wtf/RandomNumber.h should provide using WTF::*
1892         https://bugs.webkit.org/show_bug.cgi?id=38719
1893
1894         * wtf/RandomNumber.h:
1895           Add using directives.
1896
1897 2010-05-06  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1898
1899         Reviewed by Kenneth Rohde Christiansen.
1900
1901         [Qt] Enable YARR_JIT for X86 Mac for QtWebKit
1902         https://bugs.webkit.org/show_bug.cgi?id=38668
1903
1904         * wtf/Platform.h:
1905
1906 2010-05-06  Gavin Barraclough  <barraclough@apple.com>
1907
1908         Reviewed by Geoff Garen.
1909
1910         Bug 38714 - Add result caching for Math.sin
1911
1912         Math.sin is frequently called with the same operand, caching the result should
1913         improve performance.  CachedTranscendentalFunction adds a generic mechanism to
1914         cache results for pure functions with the signature "double func(double)", and
1915         where NaN maps to NaN.
1916
1917         CachedTranscendentalFunction uses a very simple hash function designed to be
1918         fast to execute since we cannot cache the result, and trivial to JIT generate,
1919         should we wish to do so.
1920
1921         * JavaScriptCore.xcodeproj/project.pbxproj:
1922         * runtime/CachedTranscendentalFunction.h: Added.
1923         (JSC::CachedTranscendentalFunction::CachedTranscendentalFunction):
1924         (JSC::CachedTranscendentalFunction::~CachedTranscendentalFunction):
1925         (JSC::CachedTranscendentalFunction::operator()):
1926         (JSC::CachedTranscendentalFunction::initialize):
1927         (JSC::CachedTranscendentalFunction::hash):
1928         * runtime/JSGlobalData.h:
1929         * runtime/MathObject.cpp:
1930         (JSC::mathProtoFuncSin):
1931         * wtf/Platform.h:
1932
1933 2010-05-06  Geoffrey Garen  <ggaren@apple.com>
1934
1935         Windows build fix.
1936
1937         * bytecode/SamplingTool.cpp:
1938         (JSC::SamplingFlags::sample): Use a cast, so Windows will be happy when
1939         this code is enabled.
1940         * wtf/Platform.h: Reverted last change to this file, which seems to have
1941         been accidental.
1942
1943 2010-05-06  Gavin Barraclough  <barraclough@apple.com>
1944
1945         Reviewed by Oliver Hunt.
1946
1947         Add compile switch to make debugger keyword plant breakpoint instructions.
1948
1949         * bytecompiler/BytecodeGenerator.cpp:
1950         (JSC::BytecodeGenerator::emitDebugHook):
1951         * jit/JITOpcodes.cpp:
1952         (JSC::JIT::emit_op_debug):
1953         * wtf/Platform.h:
1954
1955 2010-05-06  Oliver Hunt  <oliver@apple.com>
1956
1957         Build fix
1958
1959         Fix ARM builds
1960
1961         * assembler/MacroAssemblerARM.h:
1962         (JSC::MacroAssemblerARM::load16):
1963         * assembler/MacroAssemblerARMv7.h:
1964         (JSC::MacroAssemblerARMv7::load16):
1965
1966 2010-05-06  Oliver Hunt  <oliver@apple.com>
1967
1968         Reviewed by Geoffrey Garen.
1969
1970         Improve performance of single character string compares
1971         https://bugs.webkit.org/show_bug.cgi?id=38659
1972
1973         Add logic to the jit to identify comparisons to single character string literals
1974         and then just perform the comparison inline, rather than ignoring the evidence
1975         and attempting to perform an integer comparison.
1976
1977         Multiple changes required -- add jnlesseq opcode, add helper function to identify
1978         single character string constants, add a helper to load single character strings.
1979         Then add the 32_64 and normal codepaths to the JIT.
1980
1981         * assembler/MacroAssemblerX86Common.h:
1982         (JSC::MacroAssemblerX86Common::load16):
1983         * bytecode/CodeBlock.cpp:
1984         (JSC::CodeBlock::dump):
1985         * bytecode/Opcode.h:
1986         * bytecompiler/BytecodeGenerator.cpp:
1987         (JSC::BytecodeGenerator::emitJumpIfTrue):
1988         * interpreter/Interpreter.cpp:
1989         (JSC::Interpreter::privateExecute):
1990         * jit/JIT.cpp:
1991         (JSC::JIT::privateCompileMainPass):
1992         (JSC::JIT::privateCompileSlowCases):
1993         * jit/JIT.h:
1994         * jit/JITArithmetic.cpp:
1995         (JSC::JIT::emit_op_jnless):
1996         (JSC::JIT::emitSlow_op_jnless):
1997         (JSC::JIT::emit_op_jless):
1998         (JSC::JIT::emitSlow_op_jless):
1999         (JSC::JIT::emit_op_jlesseq):
2000         (JSC::JIT::emit_op_jnlesseq):
2001         (JSC::JIT::emitSlow_op_jlesseq):
2002         (JSC::JIT::emitSlow_op_jnlesseq):
2003         * jit/JITArithmetic32_64.cpp:
2004         (JSC::JIT::emit_op_jnless):
2005         (JSC::JIT::emitSlow_op_jnless):
2006         (JSC::JIT::emit_op_jless):
2007         (JSC::JIT::emitSlow_op_jless):
2008         (JSC::JIT::emit_op_jlesseq):
2009         (JSC::JIT::emit_op_jnlesseq):
2010         (JSC::JIT::emitSlow_op_jlesseq):
2011         (JSC::JIT::emitSlow_op_jnlesseq):
2012         (JSC::JIT::emitBinaryDoubleOp):
2013         * jit/JITInlineMethods.h:
2014         (JSC::JIT::emitLoadCharacterString):
2015         (JSC::JIT::isOperandConstantImmediateChar):
2016         * jit/JSInterfaceJIT.h:
2017         (JSC::ThunkHelpers::stringImplDataOffset):
2018         (JSC::ThunkHelpers::jsStringLengthOffset):
2019         (JSC::ThunkHelpers::jsStringValueOffset):
2020          Moved from ThunkGenerators to make it possible to share.
2021         * jit/ThunkGenerators.cpp:
2022
2023 2010-05-06  Martin Robinson  <mrobinson@webkit.org>
2024
2025         Reviewed by Gustavo Noronha Silva.
2026
2027         [GTK] Enable DOM clipboard and drag-and-drop access
2028         https://bugs.webkit.org/show_bug.cgi?id=30623
2029
2030         Convert dragging portion of drag-and-drop to use DataObjectGtk.
2031
2032         * wtf/gobject/GRefPtr.h: Add forward declarations for GObject functions.
2033
2034 2010-05-06  Steve Block  <steveblock@google.com>
2035
2036         Reviewed by Eric Seidel.
2037
2038         MAC_JAVA_BRIDGE should be renamed JAVA_BRIDGE
2039         https://bugs.webkit.org/show_bug.cgi?id=38544
2040
2041         * wtf/Platform.h:
2042
2043 2010-05-06  Adam Barth  <abarth@webkit.org>
2044
2045         Reviewed by Maciej Stachowiak.
2046
2047         [WTFURL] Add a class to represent the segments of a URL
2048         https://bugs.webkit.org/show_bug.cgi?id=38566
2049
2050         When paired with a string, this class represents a parsed URL.
2051
2052         * wtf/url/src/URLSegments.cpp: Added.
2053         (WTF::URLSegments::length):
2054         (WTF::URLSegments::charactersBefore):
2055         * wtf/url/src/URLSegments.h: Added.
2056         (WTF::URLSegments::):
2057         (WTF::URLSegments::URLSegments):
2058         * wtf/url/wtfurl.gyp:
2059
2060 2010-05-05  Tony Gentilcore  <tonyg@chromium.org>
2061
2062         Reviewed by Adam Barth.
2063
2064         Adding comment with link to RefPtr documentation.
2065         https://bugs.webkit.org/show_bug.cgi?id=38601
2066
2067         * wtf/RefPtr.h:
2068
2069 2010-05-05  Gavin Barraclough  <barraclough@apple.com>
2070
2071         Reviewed by Darin Adler.
2072
2073         Bug 38604 - workers-gc2 crashing on Qt
2074
2075         This appears to be due to a couple of issues.
2076         (1) When the atomic string table is deleted it does not clear the 'inTable' bit
2077         on AtomicStrings - it implicitly assumes that all AtomicStrings have already
2078         been deleted at this point (otherwise they will crash in their destructor when
2079         they try to remove themselves from the atomic string table).
2080         (2) We don't fix the ordering in which WTF::WTFThreadData and
2081         WebCore::ThreadGlobalData are destructed.
2082
2083         We should make sure that ThreadGlobalData is cleaned up before worker threads
2084         terminate and WTF::WTFThreadData is destroyed, and we should clear the inTable
2085         bit of members on atomic string table destruction.
2086
2087         WTF changes (fix issue 1, above) - ensure inTable property is cleared when the
2088         atomic string table is destroyed (also, rename InTable to IsAtomic, to make it
2089         clear which table we are refering to!)
2090
2091         * wtf/text/AtomicString.cpp:
2092         (WebCore::AtomicStringTable::destroy):
2093         (WebCore::CStringTranslator::translate):
2094         (WebCore::UCharBufferTranslator::translate):
2095         (WebCore::HashAndCharactersTranslator::translate):
2096         (WebCore::AtomicString::add):
2097         * wtf/text/StringImpl.cpp:
2098         (WebCore::StringImpl::~StringImpl):
2099         * wtf/text/StringImpl.h:
2100         (WebCore::StringImpl::isAtomic):
2101         (WebCore::StringImpl::setIsAtomic):
2102         * wtf/text/StringImplBase.h:
2103
2104 2010-05-05  Oliver Hunt  <oliver@apple.com>
2105
2106         Reviewed by Geoffrey Garen.
2107
2108         Make Array.join specialised for actual arrays
2109         https://bugs.webkit.org/show_bug.cgi?id=38592
2110
2111         Bring Array.join in line with the other array methods by specialising for
2112         this === an array.
2113
2114         * runtime/ArrayPrototype.cpp:
2115         (JSC::arrayProtoFuncJoin):
2116
2117 2010-05-04  Yongjun Zhang  <yongjun_zhang@apple.com>
2118
2119         Reviewed by Darin Adler.
2120
2121         WebKit crashes at DebuggerCallFrame::functionName() if m_callFrame is the top global callframe.
2122         https://bugs.webkit.org/show_bug.cgi?id=38535
2123
2124         Don't call asFunction if callee is not a FunctionType to prevent assertion failure
2125         in JSCell::isObject().
2126
2127         * debugger/DebuggerCallFrame.cpp:
2128         (JSC::DebuggerCallFrame::functionName):
2129         (JSC::DebuggerCallFrame::calculatedFunctionName):
2130
2131 2010-05-04  Steve Falkenburg  <sfalken@apple.com>
2132
2133         Remove redundant exports to fix Windows build warnings.
2134
2135         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2136
2137 2010-05-04  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
2138
2139         Reviewed by Holger Freyther.
2140
2141         Fix a memory leak inside the QScriptValue.
2142
2143         QSciptValuePrivate::toString should release all temporary variables.
2144
2145         [Qt] QScriptValue::toString have a memory leak.
2146         https://bugs.webkit.org/show_bug.cgi?id=38112
2147
2148         * qt/api/qscriptvalue_p.h:
2149         (QScriptValuePrivate::toString):
2150
2151 2010-05-04  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2152
2153         Reviewed by Darin Adler.
2154
2155         Does not work on SPARC because of alignment issues
2156         https://bugs.webkit.org/show_bug.cgi?id=38455
2157
2158         Use AllocAlignmentInteger instead of void* on pageheap_memory to
2159         avoid crashing at runtime in some architectures. Investigated by
2160         Mike Hommey <mh@glandium.org>, change suggested by Darin Adler.
2161
2162         * wtf/FastMalloc.cpp:
2163
2164 2010-05-04  Adam Barth  <abarth@webkit.org>
2165
2166         Reviewed by Maciej Stachowiak.
2167
2168         Add first WTFURL file
2169         https://bugs.webkit.org/show_bug.cgi?id=38470
2170
2171         This class represents a component of a URL, such as the scheme or path.
2172         Essentially, the class is an index into a string buffer.
2173
2174         * wtf/url: Added.
2175             - There was some discussion about where to put the URL library.
2176               There are a number of reasonable options, but putting the library
2177               in the WTF directory seems like a reasonable alternative.  This
2178               location will make more sense once WTF is moved out of
2179               JavaScriptCore and into a top-level directory.
2180         * wtf/url/src: Added.
2181             - I've added this extra directory to the usual structure because we
2182               eventually want a "public" folder that defines the public
2183               interface to this library that clients outside of svn.webkit.org
2184               can rely upon, much like the various subfolders of the WebKit
2185               directory often define a public API.
2186         * wtf/url/src/URLComponent.h: Added.
2187             - I've added this somewhat trivial class to get the ball rolling.
2188         (WTF::URLComponent::URLComponent):
2189         (WTF::URLComponent::isValid):
2190         (WTF::URLComponent::isNonempty):
2191         (WTF::URLComponent::reset):
2192         (WTF::URLComponent::operator==):
2193         (WTF::URLComponent::begin):
2194         (WTF::URLComponent::setBegin):
2195         (WTF::URLComponent::length):
2196         (WTF::URLComponent::setLength):
2197         (WTF::URLComponent::end):
2198         * wtf/url/wtfurl.gyp: Added.
2199             - WTFURL will be an independently buildable library, hence the
2200               beginnings of a wtfurl.gyp file.
2201
2202 2010-05-03  Stephanie Lewis  <slewis@apple.com>
2203
2204         Reviewed by Geoff Garen.
2205
2206         https://bugs.webkit.org/show_bug.cgi?id=38368
2207         <rdar://problem/7834433> REGRESSSION: 1.5% PLT regression due to 56028 
2208         (return memory quicker).
2209         Instead of returning everything but the smallest spans spread out 
2210         the spans kept over several size lists.
2211
2212         * wtf/FastMalloc.cpp:
2213         (WTF::TCMalloc_PageHeap::scavenge):
2214
2215 2010-05-03  James Robinson  <jamesr@chromium.org>
2216
2217         Reviewed by Eric Seidel.
2218
2219         Clean up a few compiler warnings
2220         https://bugs.webkit.org/show_bug.cgi?id=38073
2221
2222         * wtf/text/StringImpl.cpp:
2223         (WebCore::StringImpl::ascii):
2224
2225 2010-05-03  Gavin Barraclough  <barraclough@apple.com>
2226
2227         Reviewed by NOBODY (reverting previous commit).
2228
2229         Rolling out r58114 - this introduced memory leaks of
2230         AtomicStrings then workers terminated.
2231
2232         * GNUmakefile.am:
2233         * JavaScriptCore.gypi:
2234         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2235         * JavaScriptCore.xcodeproj/project.pbxproj:
2236         * jit/ThunkGenerators.cpp:
2237         (JSC::ThunkHelpers::stringImplDataOffset):
2238         * runtime/Identifier.cpp:
2239         (JSC::IdentifierTable::~IdentifierTable):
2240         (JSC::IdentifierTable::add):
2241         (JSC::IdentifierCStringTranslator::hash):
2242         (JSC::IdentifierCStringTranslator::equal):
2243         (JSC::IdentifierCStringTranslator::translate):
2244         (JSC::Identifier::add):
2245         (JSC::IdentifierUCharBufferTranslator::hash):
2246         (JSC::IdentifierUCharBufferTranslator::equal):
2247         (JSC::IdentifierUCharBufferTranslator::translate):
2248         (JSC::Identifier::addSlowCase):
2249         * runtime/Identifier.h:
2250         * runtime/JSGlobalData.cpp:
2251         (JSC::JSGlobalData::JSGlobalData):
2252         (JSC::JSGlobalData::~JSGlobalData):
2253         * runtime/JSGlobalData.h:
2254         * wtf/WTFThreadData.cpp:
2255         (WTF::WTFThreadData::WTFThreadData):
2256         (WTF::WTFThreadData::~WTFThreadData):
2257         * wtf/WTFThreadData.h:
2258         (JSC::IdentifierTable::remove):
2259         (JSC::IdentifierTable::literalTable):
2260         (WTF::WTFThreadData::atomicStringTable):
2261         * wtf/text/AtomicString.cpp:
2262         (WebCore::AtomicStringTable::create):
2263         (WebCore::AtomicStringTable::table):
2264         (WebCore::AtomicStringTable::destroy):
2265         (WebCore::stringTable):
2266         (WebCore::CStringTranslator::hash):
2267         (WebCore::CStringTranslator::equal):
2268         (WebCore::CStringTranslator::translate):
2269         (WebCore::operator==):
2270         (WebCore::AtomicString::add):
2271         (WebCore::equal):
2272         (WebCore::UCharBufferTranslator::hash):
2273         (WebCore::UCharBufferTranslator::equal):
2274         (WebCore::UCharBufferTranslator::translate):
2275         (WebCore::HashAndCharactersTranslator::hash):
2276         (WebCore::HashAndCharactersTranslator::equal):
2277         (WebCore::HashAndCharactersTranslator::translate):
2278         (WebCore::AtomicString::find):
2279         (WebCore::AtomicString::remove):
2280         * wtf/text/AtomicStringTable.h: Removed.
2281         * wtf/text/StringImpl.cpp:
2282         (WebCore::StringImpl::~StringImpl):
2283         * wtf/text/StringImpl.h:
2284         (WebCore::StringImpl::inTable):
2285         (WebCore::StringImpl::setInTable):
2286         (WebCore::equal):
2287         * wtf/text/StringImplBase.h:
2288         (WTF::StringImplBase::StringImplBase):
2289
2290 2010-05-03  Kevin Watters  <kevinwatters@gmail.com>
2291
2292         Reviewed by Kevin Ollivier.
2293
2294         [wx] Implement scheduleDispatchFunctionsOnMainThread for wx port.
2295         https://bugs.webkit.org/show_bug.cgi?id=38480
2296
2297         * wtf/wx/MainThreadWx.cpp:
2298         (wxCallAfter::wxCallAfter):
2299         (wxCallAfter::OnCallback):
2300         (WTF::scheduleDispatchFunctionsOnMainThread):
2301
2302 2010-05-03  Kevin Watters  <kevinwatters@gmail.com>
2303
2304         Reviewed by Kevin Ollivier.
2305
2306         [wx] Build and use Mac's ComplexTextController to support complex text in wx.
2307         https://bugs.webkit.org/show_bug.cgi?id=38482
2308
2309         * wtf/Platform.h:
2310
2311 2010-05-03  Oliver Hunt  <oliver@apple.com>
2312
2313         Reviewed by Maciej Stachowiak.
2314
2315         Interpreter crashes due to incorrect refcounting of cached structures.
2316         https://bugs.webkit.org/show_bug.cgi?id=38491
2317         rdar://problem/7926160
2318
2319         Make sure we ref/deref structures used for cached custom property getters
2320
2321         * bytecode/CodeBlock.cpp:
2322         (JSC::CodeBlock::derefStructures):
2323         (JSC::CodeBlock::refStructures):
2324
2325 2010-05-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2326
2327         Reviewed by Eric Seidel.
2328
2329         [Qt] Enable JIT for QtWebKit on Symbian
2330         https://bugs.webkit.org/show_bug.cgi?id=38339
2331
2332         JIT on Symbian has been stable for quite some time, it
2333         is time to turn it on by default.
2334
2335         * wtf/Platform.h:
2336
2337 2010-04-29  Oliver Hunt  <oliver@apple.com>
2338
2339         Reviewed by Gavin Barraclough.
2340
2341         Add codegen support for unsigned right shift
2342         https://bugs.webkit.org/show_bug.cgi?id=38375
2343
2344         Expose unsigned right shift in the macro assembler, and make use of it
2345         from the jit.  Currently if the result is outside the range 0..2^31-1
2346         we simply fall back to the slow case, even in JSVALUE64 and JSVALUE32_64
2347         where technically we could still return an immediate value.
2348
2349         * assembler/MacroAssemblerARM.h:
2350         (JSC::MacroAssemblerARM::urshift32):
2351         * assembler/MacroAssemblerARMv7.h:
2352         (JSC::MacroAssemblerARMv7::urshift32):
2353         * assembler/MacroAssemblerX86Common.h:
2354         (JSC::MacroAssemblerX86Common::urshift32):
2355         * assembler/X86Assembler.h:
2356         (JSC::X86Assembler::):
2357         (JSC::X86Assembler::shrl_i8r):
2358         (JSC::X86Assembler::shrl_CLr):
2359            Add unsigned right shift to the x86 assembler
2360         * jit/JIT.cpp:
2361         (JSC::JIT::privateCompileMainPass):
2362         (JSC::JIT::privateCompileSlowCases):
2363            op_rshift no longer simply get thrown to a stub function
2364         * jit/JIT.h:
2365         * jit/JITArithmetic.cpp:
2366         (JSC::JIT::emit_op_urshift):
2367         (JSC::JIT::emitSlow_op_urshift):
2368           JSVALUE32 and JSVALUE64 implementation.  Only supports
2369           double lhs in JSVALUE64.
2370         * jit/JITArithmetic32_64.cpp:
2371         (JSC::JIT::emit_op_rshift):
2372         (JSC::JIT::emitSlow_op_rshift):
2373         (JSC::JIT::emit_op_urshift):
2374         (JSC::JIT::emitSlow_op_urshift):
2375           Refactor right shift code to have shared implementation between signed
2376           and unsigned versions.
2377
2378 2010-04-29  Oliver Hunt  <oliver@apple.com>
2379
2380         Reviewed by Gavin Barraclough.
2381
2382         Handle double on righthand side of a right shift
2383         https://bugs.webkit.org/show_bug.cgi?id=38363
2384
2385         In 64-bit we support right shift of a double, and there's no
2386         reason not to in 32-bit either.  This is a 1.1% sunspider
2387         improvement in 32bit.
2388
2389         Given high performance javascript code frequently makes
2390         use of bit operators to perform double->int conversion i'll
2391         follow this patch up with similar patches for bitwise 'and'
2392         and 'or'.
2393
2394         * jit/JITArithmetic32_64.cpp:
2395         (JSC::JIT::emit_op_rshift):
2396         (JSC::JIT::emitSlow_op_rshift):
2397
2398 2010-04-29  Oliver Hunt  <oliver@apple.com>
2399
2400         Reviewed by Geoff Garen.
2401
2402         Hoist JSVALUE32_64 arithmetic implementations into a separate file.
2403
2404         * GNUmakefile.am:
2405         * JavaScriptCore.gypi:
2406         * JavaScriptCore.pro:
2407         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2408         * JavaScriptCore.xcodeproj/project.pbxproj:
2409         * jit/JITArithmetic.cpp:
2410         (JSC::JIT::emitSlow_op_jnless):
2411         (JSC::JIT::emitSlow_op_jless):
2412         (JSC::JIT::emitSlow_op_jnlesseq):
2413         (JSC::JIT::emit_op_mod):
2414         (JSC::JIT::compileBinaryArithOpSlowCase):
2415         (JSC::JIT::emit_op_div):
2416         (JSC::JIT::compileBinaryArithOp):
2417         * jit/JITArithmetic32_64.cpp: Added.
2418         (JSC::JIT::emit_op_negate):
2419         (JSC::JIT::emitSlow_op_negate):
2420         (JSC::JIT::emit_op_jnless):
2421         (JSC::JIT::emitSlow_op_jnless):
2422         (JSC::JIT::emit_op_jless):
2423         (JSC::JIT::emitSlow_op_jless):
2424         (JSC::JIT::emit_op_jnlesseq):
2425         (JSC::JIT::emitSlow_op_jnlesseq):
2426         (JSC::JIT::emit_op_lshift):
2427         (JSC::JIT::emitSlow_op_lshift):
2428         (JSC::JIT::emit_op_rshift):
2429         (JSC::JIT::emitSlow_op_rshift):
2430         (JSC::JIT::emit_op_bitand):
2431         (JSC::JIT::emitSlow_op_bitand):
2432         (JSC::JIT::emit_op_bitor):
2433         (JSC::JIT::emitSlow_op_bitor):
2434         (JSC::JIT::emit_op_bitxor):
2435         (JSC::JIT::emitSlow_op_bitxor):
2436         (JSC::JIT::emit_op_bitnot):
2437         (JSC::JIT::emitSlow_op_bitnot):
2438         (JSC::JIT::emit_op_post_inc):
2439         (JSC::JIT::emitSlow_op_post_inc):
2440         (JSC::JIT::emit_op_post_dec):
2441         (JSC::JIT::emitSlow_op_post_dec):
2442         (JSC::JIT::emit_op_pre_inc):
2443         (JSC::JIT::emitSlow_op_pre_inc):
2444         (JSC::JIT::emit_op_pre_dec):
2445         (JSC::JIT::emitSlow_op_pre_dec):
2446         (JSC::JIT::emit_op_add):
2447         (JSC::JIT::emitAdd32Constant):
2448         (JSC::JIT::emitSlow_op_add):
2449         (JSC::JIT::emit_op_sub):
2450         (JSC::JIT::emitSub32Constant):
2451         (JSC::JIT::emitSlow_op_sub):
2452         (JSC::JIT::emitBinaryDoubleOp):
2453         (JSC::JIT::emit_op_mul):
2454         (JSC::JIT::emitSlow_op_mul):
2455         (JSC::JIT::emit_op_div):
2456         (JSC::JIT::emitSlow_op_div):
2457         (JSC::JIT::emit_op_mod):
2458         (JSC::JIT::emitSlow_op_mod):
2459
2460 2010-04-29  Zoltan Herczeg  <zherczeg@webkit.org>
2461
2462         Reviewed by Oliver Hunt
2463
2464         Add sqrt() instruction support for ARM assembler (using VFP)
2465         https://bugs.webkit.org/show_bug.cgi?id=38312
2466
2467         * assembler/ARMAssembler.h:
2468         (JSC::ARMAssembler::):
2469         (JSC::ARMAssembler::fsqrtd_r):
2470         * assembler/MacroAssemblerARM.h:
2471         (JSC::MacroAssemblerARM::supportsFloatingPointSqrt):
2472         (JSC::MacroAssemblerARM::sqrtDouble):
2473
2474 2010-04-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2475
2476         Reviewed by Simon Hausmann.
2477
2478         [Qt] Refactor qtscriptglobal.h
2479         https://bugs.webkit.org/show_bug.cgi?id=37953
2480
2481         Use the same pattern in qtscriptglobal.h as in 
2482         qwebkitglobal.h without checking for specific OSs.
2483
2484         * qt/api/qtscriptglobal.h:
2485
2486 2010-04-29  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
2487
2488         Reviewed by Simon Hausmann.
2489
2490         Small cleanup.
2491
2492         QScriptValuePrivate constructor shouldn't take QScriptEngine pointer
2493         as a parameter, because it breaks a private / public separation rule.
2494         QScriptEnginePrivate::get(QScriptEngine*) should return
2495         a QScriptEnginePrivate pointer instead of a QScriptEnginePtr, it simplifies
2496         implementation.
2497
2498         [Qt] QScriptValuePrivate class needs some cleanup.
2499         https://bugs.webkit.org/show_bug.cgi?id=37729
2500
2501         * qt/api/qscriptengine_p.h:
2502         (QScriptEnginePrivate::get):
2503         * qt/api/qscriptvalue.cpp:
2504         (QScriptValue::QScriptValue):
2505         * qt/api/qscriptvalue_p.h:
2506         (QScriptValuePrivate::QScriptValuePrivate):
2507
2508 2010-04-29  Kwang Yul Seo  <skyul@company100.net>
2509
2510         Reviewed by Simon Hausmann.
2511
2512         [WINCE] Export g_stackBase with JS_EXPORTDATA
2513         https://bugs.webkit.org/show_bug.cgi?id=37437
2514
2515         Export g_stackBase with JS_EXPORTDATA as it is used by SharedTimerWince.cpp.
2516
2517         * runtime/Collector.cpp:
2518
2519 2010-04-28  Oliver Hunt  <oliver@apple.com>
2520
2521         Do an unordered compare so that we don't treat NaN incorrectly.
2522
2523         RS=Gavin Barraclough
2524
2525         * jit/ThunkGenerators.cpp:
2526         (JSC::powThunkGenerator):
2527
2528 2010-04-28  Oliver Hunt  <oliver@apple.com>
2529
2530         Reviewed by Gavin Barraclough.
2531
2532         Add fast paths for Math.pow and Math.sqrt
2533         https://bugs.webkit.org/show_bug.cgi?id=38294
2534
2535         Add specialized thunks for Math.pow and Math.sqrt.
2536         This requires adding a sqrtDouble function to the MacroAssembler
2537         and sqrtsd to the x86 assembler.
2538
2539         Math.pow is slightly more complicated, in that we have
2540         to implement exponentiation ourselves rather than relying
2541         on hardware support.  The inline exponentiation is restricted
2542         to positive integer exponents on a numeric base.  Exponentiation
2543         is finally performed through the "Exponentiation by Squaring"
2544         algorithm.
2545
2546         * assembler/AbstractMacroAssembler.h:
2547         (JSC::AbstractMacroAssembler::ImmPtr::ImmPtr):
2548         * assembler/MacroAssemblerARM.h:
2549         (JSC::MacroAssemblerARM::supportsFloatingPointSqrt):
2550         (JSC::MacroAssemblerARM::loadDouble):
2551         (JSC::MacroAssemblerARM::sqrtDouble):
2552         * assembler/MacroAssemblerARMv7.h:
2553         (JSC::MacroAssemblerARMv7::supportsFloatingPointSqrt):
2554         (JSC::MacroAssemblerARMv7::sqrtDouble):
2555         * assembler/MacroAssemblerX86.h:
2556         (JSC::MacroAssemblerX86::loadDouble):
2557         (JSC::MacroAssemblerX86::supportsFloatingPointSqrt):
2558         * assembler/MacroAssemblerX86Common.h:
2559         (JSC::MacroAssemblerX86Common::sqrtDouble):
2560         * assembler/MacroAssemblerX86_64.h:
2561         (JSC::MacroAssemblerX86_64::loadDouble):
2562         (JSC::MacroAssemblerX86_64::supportsFloatingPointSqrt):
2563         * assembler/X86Assembler.h:
2564         (JSC::X86Assembler::):
2565         (JSC::X86Assembler::movsd_mr):
2566         (JSC::X86Assembler::sqrtsd_rr):
2567         (JSC::X86Assembler::X86InstructionFormatter::twoByteOp):
2568         (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
2569         * create_hash_table:
2570         * jit/JIT.h:
2571         * jit/JITInlineMethods.h:
2572         * jit/JITOpcodes.cpp:
2573         * jit/JITStubs.h:
2574         (JSC::JITThunks::ctiNativeCallThunk):
2575         * jit/JSInterfaceJIT.h:
2576         (JSC::JSInterfaceJIT::emitLoadDouble):
2577         (JSC::JSInterfaceJIT::emitJumpIfImmediateNumber):
2578         (JSC::JSInterfaceJIT::emitJumpIfNotImmediateNumber):
2579         (JSC::JSInterfaceJIT::emitLoadInt32):
2580         * jit/SpecializedThunkJIT.h:
2581         (JSC::SpecializedThunkJIT::loadDoubleArgument):
2582         (JSC::SpecializedThunkJIT::loadInt32Argument):
2583         (JSC::SpecializedThunkJIT::returnJSValue):
2584         (JSC::SpecializedThunkJIT::returnDouble):
2585         (JSC::SpecializedThunkJIT::finalize):
2586         * jit/ThunkGenerators.cpp:
2587         (JSC::sqrtThunkGenerator):
2588         (JSC::powThunkGenerator):
2589         * jit/ThunkGenerators.h:
2590         * runtime/Executable.h:
2591         (JSC::NativeExecutable::NativeExecutable):
2592         * runtime/JSFunction.cpp:
2593         (JSC::JSFunction::JSFunction):
2594
2595 2010-04-28  Mike Thole  <mthole@apple.com>
2596
2597         Reviewed by Mark Rowe.
2598
2599         Reenable WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK now that an
2600         exports file for it has been added.
2601
2602         * wtf/Platform.h:
2603
2604 2010-04-28  Mike Thole  <mthole@apple.com>
2605
2606         Build fix, not reviewed.
2607
2608         * wtf/Platform.h:
2609         Disable WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK until an exports file is created.
2610
2611 2010-04-28  Mike Thole  <mthole@apple.com>
2612
2613         Reviewed by David Kilzer.
2614
2615         Add canAuthenticateAgainstProtectionSpace() to frame loader so that a protection space 
2616         can be inspected before attempting to authenticate against it
2617         https://bugs.webkit.org/show_bug.cgi?id=38271
2618
2619         * wtf/Platform.h: Add WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK define.
2620
2621 2010-04-28  Darin Adler  <darin@apple.com>
2622
2623         Reviewed by Sam Weinig.
2624
2625         Don't use CFAbsoluteTimeGetCurrent on Mac OS X, since it's just a cover
2626         for gettimeofday anyway.
2627
2628         * wtf/CurrentTime.cpp:
2629         (WTF::currentTime): Remove the CF version of this. Change the "other POSIX"
2630         version to pass 0 for the time zone instead of ignoring a return value.
2631         Also get rid of unneeded type casts, since operations involving both
2632         integers and doubles are always evaluated as doubles in C without explicit
2633         type casting.
2634
2635 2010-04-28  Darin Fisher  <darin@chromium.org>
2636
2637         Reviewed by David Levin.
2638
2639         [Chromium] callOnMainThread should equate to MessageLoop::PostTask
2640         https://bugs.webkit.org/show_bug.cgi?id=38276
2641
2642         * JavaScriptCore.gyp/JavaScriptCore.gyp:
2643         * wtf/MainThread.cpp:
2644         * wtf/chromium/ChromiumThreading.h:
2645         * wtf/chromium/MainThreadChromium.cpp:
2646         (WTF::initializeMainThread):
2647         (WTF::callOnMainThread):
2648         (WTF::callOnMainThreadAndWait):
2649         (WTF::setMainThreadCallbacksPaused):
2650         (WTF::isMainThread):
2651
2652 2010-04-28  Simon Hausmann  <simon.hausmann@nokia.com>, Kent Hansen <kent.hansen@nokia.com>
2653
2654         Reviewed by Darin Adler.
2655
2656         JSC's currentThreadStackBase is not reentrant on some platforms
2657         https://bugs.webkit.org/show_bug.cgi?id=37195
2658
2659         This function needs to be reentrant to avoid memory corruption on platforms where
2660         the implementation uses global variables.
2661
2662         This patch adds a mutex lock where necessary and makes the Symbian implementation
2663         reentrant.
2664
2665         * runtime/Collector.cpp:
2666         (JSC::currentThreadStackBaseMutex):
2667         (JSC::currentThreadStackBase):
2668
2669 2010-04-28  Thiago Macieira <thiago.macieira@nokia.com>
2670
2671         Reviewed by Simon Hausmann.
2672
2673         Fix compilation with gcc 3.4.
2674
2675         AtomicStringImpl.h:29: error: base `WebCore::StringImpl' with only
2676         non-default constructor in class without a constructor
2677
2678         * wtf/text/AtomicStringImpl.h:
2679         (WebCore::AtomicStringImpl::AtomicStringImpl): Provide a default constructor.
2680         * wtf/text/StringImpl.h: Allow AtomicStringImpl to call a StringImpl constructor through a friend declaration.
2681
2682 2010-04-27  Stephanie Lewis  <slewis@apple.com>
2683
2684         Fix Tiger build.
2685
2686         * wtf/FastMalloc.cpp:
2687         (WTF::TCMalloc_PageHeap::Carve):
2688
2689 2010-04-26  Stephanie Lewis  <slewis@apple.com>
2690
2691         Reviewed by Geoff Garen.
2692
2693         https://bugs.webkit.org/show_bug.cgi?id=38154 FastMalloc calls madvise too often.
2694         <rdar://problem/7834433> REGRESSSION: 1.5% PLT regression due to 56028 (return memory quicker).  
2695         To save on madvise calls when recommitting memory recommit the entire span and then carve it
2696         instead of carving the span up and only committing the part that will be used immediately.
2697
2698         * wtf/FastMalloc.cpp:
2699         (WTF::TCMalloc_PageHeap::New):
2700         (WTF::TCMalloc_PageHeap::AllocLarge):
2701         (WTF::TCMalloc_PageHeap::Carve):
2702
2703 2010-04-26  Oliver Hunt  <oliver@apple.com>
2704
2705         Reviewed by Maciej Stachowiak.
2706
2707         Add specialized thunks for a char code related string functions
2708         https://bugs.webkit.org/show_bug.cgi?id=38177
2709
2710         This is a simple extension to my prior patch.  Basically hoist the
2711         existing character loading logic from the charCodeAt thunk and into
2712         a helper function, then add a helper to load strings from the small
2713         string cache.  This allows trivial implementations of fromCharCode
2714         and charAt. 
2715
2716         * create_hash_table:
2717         * jit/SpecializedThunkJIT.h:
2718         (JSC::SpecializedThunkJIT::returnJSCell):
2719         (JSC::SpecializedThunkJIT::tagReturnAsJSCell):
2720         * jit/ThunkGenerators.cpp:
2721         (JSC::stringCharLoad):
2722         (JSC::charToString):
2723         (JSC::charCodeAtThunkGenerator):
2724         (JSC::charAtThunkGenerator):
2725         (JSC::fromCharCodeThunkGenerator):
2726         * jit/ThunkGenerators.h:
2727         * runtime/SmallStrings.h:
2728         (JSC::SmallStrings::singleCharacterStrings):
2729         * runtime/StringConstructor.cpp:
2730         (JSC::StringConstructor::StringConstructor):
2731
2732 2010-04-27  Thomas Zander <t.zander@nokia.com>
2733
2734         Reviewed by Simon Hausmann.
2735
2736         [Qt] Fix the build on Symbian on Linux using the Makefile based mkspec
2737
2738         * JavaScriptCore.pri: It is necessary to specify the library search path
2739         when linking against JavaScriptCore.
2740
2741 2010-04-21  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2742
2743         Reviewed by Simon Hausmann.
2744
2745         Compile fix for Visual Studio 2010
2746         https://bugs.webkit.org/show_bug.cgi?id=37867
2747
2748         Patch by Prasanth Ullattil <prasanth.ullattil@nokia.com>
2749
2750         * runtime/Structure.cpp:
2751         (JSC::Structure::transitionTableAdd):
2752         * wtf/MathExtras.h:
2753         * wtf/Platform.h:
2754
2755 2010-04-27  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2756
2757         Reviewed by Simon Hausmann.
2758
2759         Rename COMPILER(MSVC7) to COMPILER(MSVC7_OR_LOWER)
2760
2761         * config.h:
2762         (JSC::Structure::transitionTableAdd):
2763         * wtf/Assertions.h:
2764         * wtf/Atomics.h:
2765         * wtf/CurrentTime.h:
2766         (WTF::getLocalTime):
2767         * wtf/Platform.h:
2768         * wtf/StaticConstructors.h:
2769         * wtf/StringExtras.h:
2770         * wtf/Vector.h:
2771         (WTF::::append):
2772
2773 2010-04-15  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2774
2775         Reviewed by Tor Arne Vestbø.
2776
2777         [Qt] Fix Mac build break.
2778
2779         https://bugs.webkit.org/show_bug.cgi?id=37867
2780         - Make sure JavaScriptCore's debug_and_release config follows that
2781           of WebCore.
2782         - Use different name for JavaScriptCore target in debug and release
2783           since they might be written in the same path at the same time on
2784           parallel builds
2785         - Consolidate the DESTDIR determination logic in JavaScriptCore.pri
2786
2787         * JavaScriptCore.pri:
2788         * JavaScriptCore.pro:
2789
2790 2010-04-21  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
2791
2792         Reviewed by Kenneth Rohde Christiansen.
2793
2794         [Qt] Make sure WebKit is not compiled using C++0x.
2795         https://bugs.webkit.org/show_bug.cgi?id=37867
2796
2797         As the rest of Qt compiles in the C++0x mode, people might start
2798         compiling it in this mode. WebKit don't support this yet.
2799
2800         Patch by Thiago Macieira <thiago.macieira@nokia.com>
2801
2802         * JavaScriptCore.pro:
2803
2804 2010-04-26  Oliver Hunt  <oliver@apple.com>
2805
2806         Fix windows
2807
2808         * jit/SpecializedThunkJIT.h:
2809         (JSC::SpecializedThunkJIT::argumentToVirtualRegister):
2810
2811 2010-04-26  Oliver Hunt  <oliver@apple.com>
2812
2813         Reviewed by Gavin Barraclough.
2814
2815         Need to support more efficient dispatch of lightweight builtins
2816         https://bugs.webkit.org/show_bug.cgi?id=38155
2817
2818         The problem with calling lightweight builtins is that marshalling
2819         the call from the nitro calling convention to the system calling
2820         convention is very expensive relative to the cost of the actually
2821         evaluating the function.  To work around this problem this patch
2822         adds the ability to define a custom thunk for a builtin.
2823
2824         This allows us to use high performance custom implementations of
2825         the common and sensible versions of simple builtins.  This patch
2826         includes a simple (use of which is currently hardcoded) thunk for
2827         charCodeAt.
2828
2829         This adds a JSInterfaceJIT subclass called SpecializedThunkJIT
2830         that has helper functions to remove (or at least reduce) the need
2831         to have separate thunk implementations for each JSValue encoding.
2832
2833         * GNUmakefile.am:
2834         * JavaScriptCore.pro:
2835         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2836         * JavaScriptCore.xcodeproj/project.pbxproj:
2837           Many project file updates
2838
2839         * create_hash_table:
2840           Add thunk generation callbacks to the hash tables, currently
2841           we hardcode the script to only support charCodeAt
2842
2843         * jit/JITStubCall.h:
2844         * jit/JITStubs.cpp:
2845         (JSC::JITThunks::~JITThunks):
2846         (JSC::JITThunks::specializedThunk):
2847         * jit/JITStubs.h:
2848         * jit/SpecializedThunkJIT.h: Added.
2849         (JSC::SpecializedThunkJIT::SpecializedThunkJIT):
2850         (JSC::SpecializedThunkJIT::loadCellArgument):
2851         (JSC::SpecializedThunkJIT::loadJSStringArgument):
2852         (JSC::SpecializedThunkJIT::loadInt32Argument):
2853         (JSC::SpecializedThunkJIT::appendFailure):
2854         (JSC::SpecializedThunkJIT::returnInt32):
2855         (JSC::SpecializedThunkJIT::finalize):
2856         (JSC::SpecializedThunkJIT::argumentToVirtualRegister):
2857         (JSC::SpecializedThunkJIT::tagReturnAsInt32):
2858         * jit/ThunkGenerators.cpp: Added.
2859         (JSC::ThunkHelpers::stringImplDataOffset):
2860         (JSC::ThunkHelpers::jsStringLengthOffset):
2861         (JSC::ThunkHelpers::jsStringValueOffset):
2862         (JSC::charCodeAtThunkGenerator):
2863         * jit/ThunkGenerators.h: Added.
2864         * runtime/Executable.h:
2865         (JSC::NativeExecutable::NativeExecutable):
2866         * runtime/JSFunction.cpp:
2867         (JSC::JSFunction::JSFunction):
2868         * runtime/JSFunction.h:
2869         * runtime/JSGlobalData.h:
2870         (JSC::JSGlobalData::getThunk):
2871         * runtime/JSString.h:
2872         (JSC::):
2873         * runtime/JSValue.h:
2874           Protect some of the JSVALUE32 and JSVALUE32_64 only constants
2875           and function behind appropriate USE() guards to make it harder
2876           to use the wrong flags for the target build.
2877         * runtime/Lookup.cpp:
2878         (JSC::HashTable::createTable):
2879         (JSC::setUpStaticFunctionSlot):
2880         * runtime/Lookup.h:
2881         (JSC::HashEntry::initialize):
2882         (JSC::HashEntry::generator):
2883         (JSC::HashEntry::):
2884           Make the lookup tables use a specialized thunkGenerator
2885           if present
2886         * wtf/text/StringImpl.h:
2887
2888 2010-04-26  Oliver Hunt  <oliver@apple.com>
2889
2890         Build fix
2891
2892         * runtime/JSImmediate.h:
2893         * runtime/JSValue.h:
2894
2895 2010-04-26  Oliver Hunt  <oliver@apple.com>
2896
2897         Reviewed by Gavin Barraclough.
2898
2899         Factor some basic JS interface logic out of JIT and into a superclass
2900         https://bugs.webkit.org/show_bug.cgi?id=38163
2901
2902         Create JSInterfaceJIT to hold some common low level functions for
2903         interacting with the JS RegisterFile.  Doing this separately from
2904         https://bugs.webkit.org/show_bug.cgi?id=38155 to ease reviewing.
2905
2906         * JavaScriptCore.xcodeproj/project.pbxproj:
2907         * jit/JIT.h:
2908         * jit/JITInlineMethods.h:
2909         (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
2910         * jit/JSInterfaceJIT.h: Added.
2911         (JSC::JSInterfaceJIT::emitLoadJSCell):
2912         (JSC::JSInterfaceJIT::emitJumpIfNotJSCell):
2913         (JSC::JSInterfaceJIT::emitLoadInt32):
2914         (JSC::JSInterfaceJIT::tagFor):
2915         (JSC::JSInterfaceJIT::payloadFor):
2916         (JSC::JSInterfaceJIT::addressFor):
2917
2918 2010-04-26  Sam Weinig  <sam@webkit.org>
2919
2920         Fix Tiger build.
2921
2922         * wtf/mac/MainThreadMac.mm:
2923         (WTF::isMainThread):
2924
2925 2010-04-26  Geoffrey Garen  <ggaren@apple.com>
2926
2927         Reviewed by Sam Weinig.
2928
2929         <rdar://problem/7766413>
2930         
2931         Fixed a crash seen when using the JavaScriptCore API with WebKit.
2932         
2933         No layout test because DumpRenderTree doesn't use the JavaScriptCore API
2934         in this way.
2935
2936         * interpreter/RegisterFile.cpp:
2937         (JSC::RegisterFile::setGlobalObject):
2938         (JSC::RegisterFile::clearGlobalObject):
2939         (JSC::RegisterFile::globalObject):
2940         * interpreter/RegisterFile.h:
2941         (JSC::RegisterFile::RegisterFile): Use WeakGCPtr for managing m_globalObject,
2942         since it's a weak pointer. (We never noticed this error before because,
2943         in WebKit, global objects always have a self-reference in a global variable,
2944         so marking the register file's global variables would keep m_globalObject
2945         alive. In the JavaScriptCore API, you can allocate a global object with
2946         no self-reference.)
2947
2948         * runtime/JSActivation.h: Removed unneeded #include.
2949
2950         * runtime/JSGlobalObject.cpp:
2951         (JSC::JSGlobalObject::~JSGlobalObject): Don't use ==, since a weak
2952         pointer is 0 when the object it points to runs its destructor.
2953
2954         * runtime/WeakGCPtr.h:
2955         (JSC::WeakGCPtr::clear): Changed to return a bool indicating whether the
2956         clear actually happened.
2957         (JSC::WeakGCPtr::assign): Changed to forbid assignment of 0 as a shorthand
2958         for calling clear(). A client should never clear by assigning 0, since
2959         clear() should be conditional on whether the object doing the clearing
2960         is still pointed to by the weak pointer. (Otherwise, a zombie object might
2961         clear a pointer to a new, valid object.)
2962
2963 2010-04-25  Sam Weinig  <sam@webkit.org>
2964
2965         Reviewed by Maciej Stachowiak.
2966
2967         Fix for https://bugs.webkit.org/show_bug.cgi?id=38097
2968         Disentangle initializing the main thread from initializing threading
2969
2970         This is the first step in getting rid of the WEB_THREAD #define and
2971         paving the way to allowing mac both WebKit and WebKit2 to use the same
2972         WebCore.
2973
2974         * JavaScriptCore.exp: Export initializeMainThread and initializeMainThreadToProcessMainThread.
2975         * JavaScriptCore.xcodeproj/project.pbxproj: Sort files.
2976
2977         * wtf/MainThread.cpp:
2978         (WTF::mainThreadInitializationMutex):
2979         (WTF::mainThreadFunctionQueueMutex):
2980         (WTF::initializeMainThread):
2981         (WTF::deprecatedInitializeMainThread):
2982         * wtf/MainThread.h:
2983         Added Mac only initializeMainThreadToProcessMainThread which sets up callOnMainThread
2984         and isMainThead calls to assume that WebCore's main thread is also the
2985         process's main thread. Since it is possible that both initializeMainThread
2986         and initializeMainThreadToProcessMainThread could be called, the first one called
2987         wins (either will work).
2988
2989         * wtf/Threading.h: Moved to top of file.
2990
2991         * wtf/ThreadingPthreads.cpp:
2992         (WTF::initializeThreading): Remove call to initializeMainThread.
2993         * wtf/ThreadingWin.cpp:
2994         (WTF::initializeThreading): Ditto.
2995         * wtf/gtk/ThreadingGtk.cpp:
2996         (WTF::initializeThreading): Ditto.
2997
2998         * wtf/mac/MainThreadMac.mm:
2999         (WTF::initializeMainThreadPlatform):
3000         (WTF::initializeMainThreadToProcessMainThread):
3001         (WTF::scheduleDispatchFunctionsOnMainThread):
3002         (WTF::isMainThread):
3003         Add runtime switch between the old behavior of using the system's main
3004         thread and a stored pointer to the main thread. Tiger always uses the
3005         system's main thread.
3006
3007         * wtf/qt/ThreadingQt.cpp:
3008         (WTF::initializeThreading): Remove call to initializeMainThread.
3009         * wtf/win/MainThreadWin.cpp:
3010         (WTF::initializeMainThreadPlatform): Add call to initializeCurrentThreadInternal
3011         removed from initializeThreading.
3012
3013 2010-04-26  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
3014
3015         Reviewed by Kenneth Rohde Christiansen.
3016
3017         Fix a memory leak in the QScriptString.
3018
3019         QScriptStringPrivate's constructor shouldn't call JSStringRetain as
3020         QScriptConverter implicitly pass a JSStringRef ownership.
3021
3022         [Qt] QScriptStringPrivate c'tor problem
3023         https://bugs.webkit.org/show_bug.cgi?id=38110
3024
3025         * qt/api/qscriptstring_p.h:
3026         (QScriptStringPrivate::QScriptStringPrivate):
3027
3028 2010-04-24  Darin Adler  <darin@apple.com>
3029
3030         Reviewed by Dan Bernstein.
3031
3032         REGRESSION (r56560): Crash in parseFloat if passed invalid UTF-16 data
3033         https://bugs.webkit.org/show_bug.cgi?id=38083
3034         rdar://problem/7901044
3035
3036         Tests: fast/js/ToNumber.html
3037                fast/js/parseFloat.html
3038
3039         * runtime/JSGlobalObjectFunctions.cpp:
3040         (JSC::parseInt): Added a FIXME comment about a problem I noticed.
3041         (JSC::parseFloat): Added a FIXME comment about a problem I noticed;
3042         covered by test cases in the test I added.
3043         * runtime/UString.cpp:
3044         (JSC::UString::toDouble): Added FIXME comments about two problems I
3045         noticed; covered by test cases in the tests I added. Added a return
3046         statement so we don't crash when illegal UTF-16 sequences are present.
3047
3048 2010-04-24  Anton Muhin  <antonm@chromium.org>
3049
3050         Reviewed by Darin Adler.
3051
3052         Allow to construct HashTraits<WebCore::QualifiedName>::constructDeletedValue
3053
3054         Former implementation attempted to use AtomicString(HashTableDeletedValue)
3055         however those values cannot be used that way: one cannot construct
3056         QualifiedNameImpl out of such AtomicString as we'll try to lookup this string
3057         in the table, for example.
3058         https://bugs.webkit.org/show_bug.cgi?id=37722
3059
3060         * wtf/RefPtr.h: expose hash table deleted value
3061
3062 2010-04-23  Sam Weinig  <sam@webkit.org>
3063
3064         Reviewed by David Levin.
3065
3066         Fix for https://bugs.webkit.org/show_bug.cgi?id=38060
3067         Split up Threading.h
3068
3069         Move bits for of Threading.h into 3 new files.
3070         - Atomics.h for atomic operations.
3071         - ThreadSafeShared.h for the ThreadSafeShared class.
3072         - ThreadingPrimitives.h for the primitives and platform types.
3073
3074         Basic threading operations (creation, etc.) remain in Threading.h.
3075
3076         * GNUmakefile.am:
3077         * JavaScriptCore.gypi:
3078         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3079         * JavaScriptCore.xcodeproj/project.pbxproj:
3080         * wtf/Atomics.h: Copied from wtf/Threading.h.
3081         * wtf/ThreadSafeShared.h: Copied from wtf/Threading.h.
3082         * wtf/Threading.h:
3083         * wtf/ThreadingPrimitives.h: Copied from wtf/Threading.h.
3084
3085 2010-04-23  Sam Weinig  <sam@webkit.org>
3086
3087         Fix Qt build.
3088
3089         * wtf/qt/MainThreadQt.cpp: #include <QThread>
3090
3091 2010-04-22  Sam Weinig  <sam@webkit.org>
3092
3093         Reviewed by Anders Carlsson.
3094
3095         Fix for https://bugs.webkit.org/show_bug.cgi?id=38022
3096         Move isMainThread predicate function to MainThread.h
3097
3098         * wtf/MainThread.cpp:
3099         (WTF::initializeMainThread):
3100         (WTF::isMainThread):
3101         * wtf/MainThread.h:
3102         * wtf/Threading.h:
3103         * wtf/ThreadingPthreads.cpp:
3104         (WTF::initializeThreading):
3105         * wtf/ThreadingWin.cpp:
3106         (WTF::initializeThreading):
3107         * wtf/gtk/ThreadingGtk.cpp:
3108         (WTF::initializeThreading):
3109         * wtf/mac/MainThreadMac.mm:
3110         (WTF::initializeMainThreadPlatform):
3111         (WTF::isMainThread):
3112         * wtf/qt/MainThreadQt.cpp:
3113         (WTF::isMainThread):
3114         * wtf/qt/ThreadingQt.cpp:
3115         (WTF::initializeThreading):
3116         * wtf/text/AtomicString.cpp:
3117
3118 2010-04-23  Gabor Rapcsanyi  <rgabor@inf.u-szeged.hu>
3119
3120         Reviewed by Laszlo Gombos.
3121
3122         Add RVCT support for Linux
3123
3124         Developed in cooperation with Gabor Loki.
3125
3126         * API/JSStringRef.h:
3127         * jit/ExecutableAllocator.h:
3128         * jit/ExecutableAllocatorPosix.cpp:
3129         (JSC::ExecutableAllocator::cacheFlush):
3130         * jit/JITStubs.cpp:
3131         * wtf/MathExtras.h:
3132         * wtf/unicode/qt4/UnicodeQt4.h:
3133
3134 2010-04-23  Patrick Gansterer  <paroga@paroga.com>
3135
3136         Reviewed by Laszlo Gombos.
3137
3138         [WIN] Move OwnPtrWin.cpp into platform specific folder.
3139         https://bugs.webkit.org/show_bug.cgi?id=38042
3140
3141         * JavaScriptCore.gypi:
3142         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3143         * wtf/OwnPtrWin.cpp: Removed.
3144         * wtf/win/OwnPtrWin.cpp: Copied from JavaScriptCore/wtf/OwnPtrWin.cpp.
3145
3146 2010-04-23  Patrick Gansterer  <paroga@paroga.com>
3147
3148         Reviewed by Laszlo Gombos.
3149
3150         [BREWMP] Move OwnPtrBrew.cpp into platform specific folder.
3151         https://bugs.webkit.org/show_bug.cgi?id=38042
3152
3153         * wtf/OwnPtrBrew.cpp: Removed.
3154         * wtf/brew/OwnPtrBrew.cpp: Copied from JavaScriptCore/wtf/OwnPtrBrew.cpp.
3155
3156 2010-04-22  Steve Block  <steveblock@google.com>
3157
3158         Reviewed by Adam Barth.
3159
3160         Update Android to use isfinite, isinf, isnan and signbit from namespace std.
3161         https://bugs.webkit.org/show_bug.cgi?id=37948
3162
3163         * wtf/MathExtras.h:
3164
3165 2010-04-22  Fumitoshi Ukai  <ukai@chromium.org>
3166
3167         Unreviewed build fix.
3168
3169         * wtf/MD5.cpp: fix include path of CString.h
3170
3171 2010-04-22  Fumitoshi Ukai  <ukai@chromium.org>
3172
3173         Reviewed by Adam Barth.
3174
3175         MD5 is required for WebSocket new protocol implementation
3176         https://bugs.webkit.org/show_bug.cgi?id=37913
3177
3178         * GNUmakefile.am:
3179         * JavaScriptCore.exp:
3180         * JavaScriptCore.gypi:
3181         * JavaScriptCore.pro:
3182         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3183         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3184         * JavaScriptCore.xcodeproj/project.pbxproj:
3185         * wtf/MD5.cpp: Added.
3186         * wtf/MD5.h: Added.
3187
3188 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3189
3190         Reviewed by NOBODY (build fix).
3191         Errk, accidentally committed commenting out two ASSERTs! reverting.
3192
3193         * runtime/Collector.cpp:
3194         (JSC::Heap::protect):
3195         (JSC::Heap::unprotect):
3196
3197 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3198
3199         Reviewed by Geoff Garen.
3200
3201         https://bugs.webkit.org/show_bug.cgi?id=38006
3202         Change lifetime of JSC::IdentifierTables used by WebCores to match AtomicStringTable
3203
3204         Presently JSC's IdentifierTables are owned by the JSGlobalData.  For
3205         JSGlobalData objects created via the API this should continue to be the case,
3206         but for the JSGlobalData objects used by WebCore (the main thread's common
3207         global data, and those for workers) use a IdentifierTable provided (and owned)
3208         by wtfThreadData.  This allow the lifetime of these IdentifierTable to match
3209         those of the corresponding AtomicStringTables.
3210
3211         * API/APIShims.h:
3212         (JSC::APIEntryShim::APIEntryShim):
3213         * API/JSContextRef.cpp:
3214         (JSContextGroupCreate):
3215         * runtime/Collector.cpp:
3216         (JSC::Heap::protect):
3217         (JSC::Heap::unprotect):
3218         (JSC::Heap::markRoots):
3219         * runtime/JSGlobalData.cpp:
3220         (JSC::JSGlobalData::JSGlobalData):
3221         (JSC::JSGlobalData::~JSGlobalData):
3222         (JSC::JSGlobalData::createContextGroup):
3223         (JSC::JSGlobalData::create):
3224         (JSC::JSGlobalData::sharedInstance):
3225         * runtime/JSGlobalData.h:
3226         (JSC::JSGlobalData::):
3227         (JSC::JSGlobalData::isSharedInstance):
3228         * runtime/JSLock.cpp:
3229         (JSC::JSLock::JSLock):
3230         (JSC::JSLock::lock):
3231         (JSC::JSLock::unlock):
3232         (JSC::JSLock::DropAllLocks::DropAllLocks):
3233         * wtf/WTFThreadData.cpp:
3234         (WTF::WTFThreadData::WTFThreadData):
3235         (WTF::WTFThreadData::~WTFThreadData):
3236
3237 2010-04-22  Sheriff Bot  <webkit.review.bot@gmail.com>
3238
3239         Unreviewed, rolling out r58110.
3240         http://trac.webkit.org/changeset/58110
3241         https://bugs.webkit.org/show_bug.cgi?id=38007
3242
3243         Caused an internal compiler error on Qt (Requested by abarth
3244         on #webkit).
3245
3246         * wtf/MathExtras.h:
3247
3248 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3249
3250         Reviewed by NOBODY (windows build fix).
3251
3252         * API/JSWeakObjectMapRefPrivate.cpp:
3253
3254 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3255
3256         Reviewed by NOBODY (windows build fix).
3257
3258         * API/JSBase.cpp:
3259         * API/JSCallbackObject.cpp:
3260
3261 2010-04-22  Gavin Barraclough  <barraclough@apple.com>
3262
3263         Reviewed by Geoff Garen.
3264
3265         https://bugs.webkit.org/show_bug.cgi?id=37978
3266         Unify JSC::IdentifierTable and WebCore::AtomicStringTable implementations.
3267
3268         These two classes both implement a HashSet of uniqued StringImpls, with
3269         translator classes to avoid unnecessary object creation. The only difference
3270         between the classes is which flag (isIdentifier or inTable) is set.
3271         Combine the two classes using a template predicated on which flag to use.
3272
3273         New class AtomicStringTable created, containing all the goodness from
3274         IdentifierTable & AtomicStringTable, expect for Identifier's literalTable,
3275         which has been moved onto JSGlobalData. Removed duplicate string translator
3276         classes. Renamed StringImpl's inTable flag to more explicit 'isAtomic',
3277         and set this on the empty string (which matches Identifier behaviour, and
3278         removes a redundant check for zero-length).
3279
3280         * GNUmakefile.am:
3281         * JavaScriptCore.gypi:
3282         * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3283         * JavaScriptCore.xcodeproj/project.pbxproj:
3284         * runtime/Identifier.cpp:
3285         (JSC::createLiteralTable):
3286         (JSC::deleteLiteralTable):
3287         (JSC::Identifier::add):
3288         (JSC::Identifier::addSlowCase):
3289         * runtime/Identifier.h:
3290         * runtime/JSGlobalData.cpp:
3291         (JSC::JSGlobalData::JSGlobalData):
3292         (JSC::JSGlobalData::~JSGlobalData):
3293         * runtime/JSGlobalData.h:
3294         * wtf/WTFThreadData.cpp:
3295         (WTF::WTFThreadData::WTFThreadData):
3296         (WTF::WTFThreadData::~WTFThreadData):
3297         * wtf/WTFThreadData.h:
3298         (WTF::WTFThreadData::atomicStringTable):
3299         * wtf/text/AtomicString.cpp:
3300         (WebCore::table):
3301         (WebCore::operator==):
3302         (WebCore::AtomicString::add):
3303         (WebCore::AtomicString::find):
3304         (WebCore::AtomicString::remove):
3305         * wtf/text/AtomicStringTable.h: Added.
3306         (WTF::CStringTranslator::hash):
3307         (WTF::CStringTranslator::equal):
3308         (WTF::CStringTranslator::translate):
3309         (WTF::UCharBufferTranslator::hash):
3310         (WTF::UCharBufferTranslator::equal):
3311         (WTF::UCharBufferTranslator::translate):
3312         (WTF::HashAndCharactersTranslator::hash):
3313         (WTF::HashAndCharactersTranslator::equal):
3314         (WTF::HashAndCharactersTranslator::translate):
3315         (WTF::IdentifierOrAtomicStringTable::remove):
3316         (WTF::::~IdentifierOrAtomicStringTable):
3317         (WTF::::add):
3318         (WTF::::find):
3319         * wtf/text/StringImpl.cpp:
3320         (WebCore::StringImpl::~StringImpl):
3321         * wtf/text/StringImpl.h:
3322         (WebCore::StringImpl::isAtomic):
3323         (WebCore::StringImpl::setIsAtomic):
3324         (WebCore::equal):
3325         * wtf/text/StringImplBase.h:
3326         (WTF::StringImplBase::StringImplBase):
3327
3328 2010-04-22  Steve Block  <steveblock@google.com>
3329
3330         Reviewed by Adam Barth.
3331
3332         Update Android to use isfinite, isinf, isnan and signbit from namespace std.
3333         https://bugs.webkit.org/show_bug.cgi?id=37948
3334
3335         * wtf/MathExtras.h:
3336
3337 2010-04-22  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3338
3339         Reviewed by Kenneth Rohde Christiansen.
3340
3341         [Qt] Remove dependency of JSC to QtGui
3342         https://bugs.webkit.org/show_bug.cgi?id=37867
3343
3344         The patch also make sure that hal.h is in the include path on Symbian.
3345         The dependency to QtGui took care of that before.
3346
3347         Patch by Thiago Macieira <thiago.macieira@nokia.com>
3348              and Rohan McGovern <rohan.mcgovern@nokia.com>
3349
3350         * JavaScriptCore.pri:
3351         * JavaScriptCore.pro:
3352
3353 2010-04-22  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3354
3355         Reviewed by Tor Arne Vestbø.
3356
3357         [Qt] Corrects symbols visibility for JavaScriptCore.
3358
3359         https://bugs.webkit.org/show_bug.cgi?id=37867
3360
3361         * JavaScriptCore.pro:
3362
3363 2010-04-22  Gabor Loki  <loki@webkit.org>
3364
3365         Reviewed by Gavin Barraclough.
3366
3367         Use BLX and BX to keep happy the return stack predictor above ARMv4
3368         https://bugs.webkit.org/show_bug.cgi?id=37862
3369
3370         Inspired by Jacob Bramley's patch from JaegerMonkey
3371
3372         * assembler/ARMAssembler.cpp:
3373         (JSC::ARMAssembler::executableCopy):
3374         * assembler/ARMAssembler.h:
3375         (JSC::ARMAssembler::):
3376         (JSC::ARMAssembler::bx):
3377         (JSC::ARMAssembler::blx):
3378         (JSC::ARMAssembler::loadBranchTarget):
3379         (JSC::ARMAssembler::jmp):
3380         (JSC::ARMAssembler::getLdrImmAddress):
3381         * assembler/MacroAssemblerARM.h:
3382         (JSC::MacroAssemblerARM::jump):
3383         (JSC::MacroAssemblerARM::nearCall):
3384         (JSC::MacroAssemblerARM::call):
3385         (JSC::MacroAssemblerARM::ret):
3386         (JSC::MacroAssemblerARM::prepareCall):
3387         (JSC::MacroAssemblerARM::call32):
3388
3389 2010-04-21  Andy Estes  <aestes@apple.com>
3390
3391         Rubber stamped by Mark Rowe.
3392
3393         Export WTF::deleteOwnedPtr(HFONT).
3394
3395         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3396
3397 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
3398
3399         Rubber Stamped by Oliver Hunt.
3400
3401         Make SmallStrings store an array of RefPtr<StringImpl>,
3402         instead of a direct array of StringImpls.  This allows
3403         us to remove a friend (and a layering violation) from
3404         WTF::StringImpl, and makes it so that all StringImpls
3405         are individually heap allocated.
3406
3407         * runtime/SmallStrings.cpp:
3408         (JSC::SmallStringsStorage::rep):
3409         (JSC::SmallStringsStorage::SmallStringsStorage):
3410         * wtf/text/StringImpl.h:
3411
3412 2010-04-21  Sam Weinig  <sam@webkit.org>
3413
3414         Reviewed by Geoffrey Garen.
3415
3416         Fix for https://bugs.webkit.org/show_bug.cgi?id=37937
3417         Wean JavaScriptCore off calls to isMainThread()
3418
3419         - Replace use of isMainThread() for interpreter reentry checks
3420           with a stored value on the JSGlobalData.
3421         - Replace use of isMainThread() for useMainThread only check in the
3422           collector with a stored exclusive thread.
3423
3424         * API/JSContextRef.cpp:
3425         (JSContextGroupCreate):
3426         Always default to a small stack type for uses of the JSC API. It is
3427         unlikely that the interpreter reentry required on the web will be as
3428         important for other uses of JavaScriptCore. 
3429
3430         * JavaScriptCore.exp: 
3431         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3432         Update exports.
3433
3434         * interpreter/Interpreter.cpp:
3435         (JSC::Interpreter::execute):
3436         (JSC::Interpreter::prepareForRepeatCall):
3437         Use new stored JSGlobalData::maxReentryDepth instead of isMainThread().
3438
3439         * interpreter/Interpreter.h:
3440         Rename MaxMainThreadReentryDepth to MaxLargeThreadReentryDepth and 
3441         MaxSecondaryThreadReentryDepth to MaxSmallThreadReentryDepth.
3442
3443         * jsc.cpp:
3444         (main): Use the a large stack for jsc since it is always using the
3445         main thread.
3446         
3447         * runtime/ArrayPrototype.cpp:
3448         (JSC::arrayProtoFuncToString):
3449         (JSC::arrayProtoFuncToLocaleString):
3450         (JSC::arrayProtoFuncJoin):
3451         Use new stored JSGlobalData::maxReentryDepth instead of isMainThread().
3452
3453         * runtime/Collector.cpp:
3454         (JSC::Heap::registerThread):
3455         Use the concept of making JSC run on an exclusiveThread instead of
3456         forcing a mainThreadOnly assertion.
3457         
3458         * runtime/JSGlobalData.cpp:
3459         (JSC::JSGlobalData::JSGlobalData):
3460         (JSC::JSGlobalData::createNonDefault):
3461         (JSC::JSGlobalData::create):
3462         (JSC::JSGlobalData::createLeaked):
3463         (JSC::JSGlobalData::sharedInstance):
3464         * runtime/JSGlobalData.h:
3465         Add ThreadStackType argument to JSGlobalData constructors and set
3466         maxReentryDepth based on it.
3467
3468 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
3469
3470         Reviewed by NOBODY (windows build fix pt. 3).
3471
3472         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3473
3474 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
3475
3476         Reviewed by NOBODY (windows build fix pt. 2).
3477
3478         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3479
3480 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
3481
3482         Reviewed by NOBODY (Qt build fix).
3483
3484         * JavaScriptCore.gypi:
3485         * JavaScriptCore.pro:
3486         * wtf/qt/StringQt.cpp: Copied from WebCore/platform/text/qt/StringQt.cpp.
3487
3488 2010-04-21  Gavin Barraclough  <barraclough@apple.com>
3489
3490         Reviewed by NOBODY (windows build fix).
3491
3492         * API/JSValueRef.cpp:
3493         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3494         * runtime/Identifier.cpp:
3495         (JSC::IdentifierTable::~IdentifierTable):
3496         (JSC::IdentifierTable::add):
3497         * runtime/Identifier.h:
3498         * wtf/WTFThreadData.h:
3499         (JSC::IdentifierTable::remove):
3500         (JSC::IdentifierTable::literalTable):
3501         * wtf/text/StringImpl.cpp:
3502         (WebCore::StringImpl::~StringImpl):
3503
3504 2010-04-20  Gavin Barraclough  <barraclough@apple.com>
3505
3506         Reviewed by Oliver Hunt, Darin Adler.
3507
3508         Bug 37906 - Remove JSC::UStringImpl; unify with StringImpl.
3509
3510         JSC::UStringImpl and WebCore::StringImpl (soon to be renamed to
3511         WTF::StringImpl) are almost identical.  Remove duplication of code by unifying
3512         the two, move missing features from UStringImpl into StringImpl & delete the
3513         class UStringImpl.
3514
3515         * API/JSClassRef.cpp:
3516         * API/JSContextRef.cpp:
3517         * GNUmakefile.am:
3518         * JavaScriptCore.exp:
3519         * JavaScriptCore.pro:
3520         * JavaScriptCore.xcodeproj/project.pbxproj:
3521         * bytecode/EvalCodeCache.h:
3522         * bytecode/JumpTable.cpp:
3523         * profiler/ProfileNode.cpp:
3524         * runtime/Identifier.cpp:
3525         (JSC::Identifier::add):
3526         * runtime/Identifier.h:
3527         (JSC::Identifier::equal):
3528         * runtime/UString.cpp:
3529         * runtime/UString.h:
3530         (WTF::):
3531         * runtime/UStringImpl.cpp: Removed.
3532         * runtime/UStringImpl.h:
3533         * wtf/text/StringHash.h:
3534         (WebCore::StringHash::equal):
3535         (WebCore::CaseFoldingHash::equal):
3536         * wtf/text/StringImpl.cpp:
3537         (WebCore::StringImpl::~StringImpl):
3538         (WebCore::StringImpl::empty):
3539         (WebCore::StringImpl::sharedBuffer):
3540         (WebCore::equal):
3541         * wtf/text/StringImpl.h:
3542         (WebCore::StringImpl::StringImpl):
3543         (WebCore::StringImpl::create):
3544         (WebCore::StringImpl::tryCreateUninitialized):
3545         (WebCore::StringImpl::cost):
3546         (WebCore::StringImpl::isIdentifier):
3547         (WebCore::StringImpl::setIsIdentifier):
3548         (WebCore::StringImpl::computeHash):
3549         (WebCore::StringImpl::copyChars):
3550         (WebCore::StringImpl::):
3551
3552 2010-04-21  Patrick Gansterer  <paroga@paroga.com>
3553
3554         Reviewed by Darin Adler.
3555
3556         Added missing #include "Lookup.h" in LUT source files.
3557         https://bugs.webkit.org/show_bug.cgi?id=37903