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