]> git.saurik.com Git - apple/javascriptcore.git/blob - ChangeLog-2009-06-16
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / ChangeLog-2009-06-16
1 2009-06-15 Gavin Barraclough <barraclough@apple.com>
2
3 Rubber Stamped by Sam Weinig.
4
5 Rename PatchBuffer to LinkBuffer. Previously our terminology has been a little
6 mixed up, but we have decided to fix on refering to the process that takes place
7 at the end of code generation as 'linking', and on any modifications that take
8 place later (and once the code has potentially already been executed) as 'patching'.
9
10 However, the term 'PatchBuffer' is already in use, and needs to be repurposed.
11
12 To try to minimize confusion, we're going to switch the terminology over in stages,
13 so for now we'll refer to later modifications as 'repatching'. This means that the
14 new 'PatchBuffer' has been introduced with the name 'RepatchBuffer' instead.
15
16 This patch renames the old 'PatchBuffer' to 'LinkBuffer'. We'll leave ToT in this
17 state for a week or so to try to avoid to much overlap of the meaning of the term
18 'PatchBuffer', then will come back and rename 'RepatchBuffer'.
19
20 * assembler/ARMv7Assembler.h:
21 * assembler/AbstractMacroAssembler.h:
22 (JSC::AbstractMacroAssembler::LinkBuffer::LinkBuffer):
23 (JSC::AbstractMacroAssembler::LinkBuffer::~LinkBuffer):
24 * jit/JIT.cpp:
25 (JSC::JIT::privateCompile):
26 * jit/JITPropertyAccess.cpp:
27 (JSC::JIT::privateCompilePutByIdTransition):
28 (JSC::JIT::privateCompilePatchGetArrayLength):
29 (JSC::JIT::privateCompileGetByIdProto):
30 (JSC::JIT::privateCompileGetByIdSelfList):
31 (JSC::JIT::privateCompileGetByIdProtoList):
32 (JSC::JIT::privateCompileGetByIdChainList):
33 (JSC::JIT::privateCompileGetByIdChain):
34 * yarr/RegexJIT.cpp:
35 (JSC::Yarr::RegexGenerator::compile):
36
37 2009-06-15 Gavin Barraclough <barraclough@apple.com>
38
39 Reviewed by Sam Weinig.
40
41 Having moved most of their functionality into the RepatchBuffer class,
42 we can simplify the CodeLocation* classes.
43
44 The CodeLocation* classes are currently a tangle of templatey and friendly
45 badness, burried in the middle of AbstractMacroAssembler. Having moved
46 the ability to repatch out into RepatchBufer they are now do-nothing wrappers
47 on CodePtr (MacroAssemblerCodePtr), that only exist to provide type-safety.
48
49 Simplify the code, and move them off into their own header.
50
51 * JavaScriptCore.xcodeproj/project.pbxproj:
52 * assembler/AbstractMacroAssembler.h:
53 (JSC::AbstractMacroAssembler::PatchBuffer::patch):
54 * assembler/CodeLocation.h: Copied from assembler/AbstractMacroAssembler.h.
55 (JSC::CodeLocationCommon::CodeLocationCommon):
56 (JSC::CodeLocationInstruction::CodeLocationInstruction):
57 (JSC::CodeLocationLabel::CodeLocationLabel):
58 (JSC::CodeLocationJump::CodeLocationJump):
59 (JSC::CodeLocationCall::CodeLocationCall):
60 (JSC::CodeLocationNearCall::CodeLocationNearCall):
61 (JSC::CodeLocationDataLabel32::CodeLocationDataLabel32):
62 (JSC::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
63 (JSC::CodeLocationCommon::instructionAtOffset):
64 (JSC::CodeLocationCommon::labelAtOffset):
65 (JSC::CodeLocationCommon::jumpAtOffset):
66 (JSC::CodeLocationCommon::callAtOffset):
67 (JSC::CodeLocationCommon::nearCallAtOffset):
68 (JSC::CodeLocationCommon::dataLabelPtrAtOffset):
69 (JSC::CodeLocationCommon::dataLabel32AtOffset):
70 * assembler/MacroAssemblerCodeRef.h:
71 (JSC::MacroAssemblerCodePtr::operator!):
72 * bytecode/CodeBlock.h:
73 (JSC::getStructureStubInfoReturnLocation):
74 (JSC::getCallLinkInfoReturnLocation):
75 (JSC::getMethodCallLinkInfoReturnLocation):
76 * bytecode/Instruction.h:
77 * bytecode/JumpTable.h:
78 (JSC::StringJumpTable::ctiForValue):
79 (JSC::SimpleJumpTable::ctiForValue):
80 * bytecode/StructureStubInfo.h:
81 * bytecompiler/BytecodeGenerator.cpp:
82 (JSC::BytecodeGenerator::emitCatch):
83 * jit/JIT.cpp:
84 (JSC::JIT::privateCompile):
85 * jit/JITStubs.cpp:
86 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
87 (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
88
89 2009-06-15 Gavin Barraclough <barraclough@apple.com>
90
91 Reviewed by Sam Weinig.
92
93 Having introduced the RepatchBuffer, ProcessorReturnAddress is now a do-nothing
94 wrapper around ReturnAddressPtr. Remove it. In tugging on this piece of string
95 it made sense to roll out the use of ReturnAddressPtr a little further into
96 JITStubs (which had always been the intention).
97
98 No performance impact.
99
100 * assembler/AbstractMacroAssembler.h:
101 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToTrampoline):
102 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToFunction):
103 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkNearCallerToTrampoline):
104 * assembler/MacroAssemblerCodeRef.h:
105 (JSC::ReturnAddressPtr::ReturnAddressPtr):
106 * bytecode/CodeBlock.h:
107 (JSC::CodeBlock::getStubInfo):
108 (JSC::CodeBlock::getCallLinkInfo):
109 (JSC::CodeBlock::getMethodCallLinkInfo):
110 (JSC::CodeBlock::getBytecodeIndex):
111 * interpreter/Interpreter.cpp:
112 (JSC::bytecodeOffsetForPC):
113 * jit/JIT.cpp:
114 (JSC::ctiPatchNearCallByReturnAddress):
115 (JSC::ctiPatchCallByReturnAddress):
116 * jit/JIT.h:
117 (JSC::JIT::compileGetByIdProto):
118 (JSC::JIT::compileGetByIdChain):
119 (JSC::JIT::compilePutByIdTransition):
120 (JSC::JIT::compilePatchGetArrayLength):
121 * jit/JITPropertyAccess.cpp:
122 (JSC::JIT::privateCompilePutByIdTransition):
123 (JSC::JIT::patchGetByIdSelf):
124 (JSC::JIT::patchPutByIdReplace):
125 (JSC::JIT::privateCompilePatchGetArrayLength):
126 (JSC::JIT::privateCompileGetByIdProto):
127 (JSC::JIT::privateCompileGetByIdChain):
128 * jit/JITStubs.cpp:
129 (JSC::JITThunks::tryCachePutByID):
130 (JSC::JITThunks::tryCacheGetByID):
131 (JSC::StackHack::StackHack):
132 (JSC::returnToThrowTrampoline):
133 (JSC::throwStackOverflowError):
134 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
135 * jit/JITStubs.h:
136 (JSC::):
137 (JSC::JITStackFrame::returnAddressSlot):
138 * runtime/JSGlobalData.h:
139
140 2009-06-15 Simon Fraser <simon.fraser@apple.com>
141
142 Reviewed by Mark Rowe.
143
144 <rdar://problem/6974857>
145
146 Define ENABLE_3D_RENDERING when building on 10.6, and move ENABLE_3D_RENDERING
147 switch from config.h to wtf/Platform.h.
148
149 * Configurations/FeatureDefines.xcconfig:
150 * wtf/Platform.h:
151
152 2009-06-15 Gavin Barraclough <barraclough@apple.com>
153
154 Reviewed by Oliver Hunt.
155
156 Move repatching methods into a set of methods on a class. This will allow us to
157 coallesce memory reprotection calls. Really, we want this class to be called
158 PatchBuffer, we want the class PatchBuffer to be called LinkBuffer, we want both
159 to be memblers of MacroAssembler rather then AbstractMacroAssembler, we don't
160 want the CodeLocationFoo types anymore (they are now only really there to provide
161 type safety, and that is completely undermined by the way we use offsets). Then
162 the link & patch buffers should delegate the actual patching calls to the
163 architecture-specific layer of the MacroAssembler. Landing all these changes as a
164 sequence of patches.
165
166 No performance impact.
167
168 * assembler/AbstractMacroAssembler.h:
169 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
170 (JSC::AbstractMacroAssembler::CodeLocationNearCall::CodeLocationNearCall):
171 (JSC::AbstractMacroAssembler::CodeLocationNearCall::calleeReturnAddressValue):
172 (JSC::AbstractMacroAssembler::RepatchBuffer::RepatchBuffer):
173 (JSC::AbstractMacroAssembler::RepatchBuffer::relink):
174 (JSC::AbstractMacroAssembler::RepatchBuffer::repatch):
175 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToTrampoline):
176 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToFunction):
177 (JSC::AbstractMacroAssembler::RepatchBuffer::relinkNearCallerToTrampoline):
178 (JSC::AbstractMacroAssembler::RepatchBuffer::repatchLoadPtrToLEA):
179 * jit/JIT.cpp:
180 (JSC::ctiPatchNearCallByReturnAddress):
181 (JSC::ctiPatchCallByReturnAddress):
182 (JSC::JIT::unlinkCall):
183 (JSC::JIT::linkCall):
184 * jit/JITPropertyAccess.cpp:
185 (JSC::JIT::privateCompilePutByIdTransition):
186 (JSC::JIT::patchGetByIdSelf):
187 (JSC::JIT::patchMethodCallProto):
188 (JSC::JIT::patchPutByIdReplace):
189 (JSC::JIT::privateCompilePatchGetArrayLength):
190 (JSC::JIT::privateCompileGetByIdProto):
191 (JSC::JIT::privateCompileGetByIdSelfList):
192 (JSC::JIT::privateCompileGetByIdProtoList):
193 (JSC::JIT::privateCompileGetByIdChainList):
194 (JSC::JIT::privateCompileGetByIdChain):
195
196 2009-06-15 Gavin Barraclough <barraclough@apple.com>
197
198 Reviewed by Geoff Hunt & Oliver Garen.
199
200 We are currently generating two copies of the slow path for op_call for no reason. Stop that.
201
202 Originally op_call used two slow paths since the first set up the pointer to the CallLinkInfo
203 for use when linking. However this is now looked up using the return address (as we do for
204 property accesses) so the two paths are now identical.
205
206 No performance impact, reduces memory footprint.
207
208 * bytecode/CodeBlock.h:
209 * jit/JIT.cpp:
210 (JSC::JIT::privateCompile):
211 (JSC::JIT::linkCall):
212 * jit/JIT.h:
213 * jit/JITCall.cpp:
214 (JSC::JIT::compileOpCallSlowCase):
215 * jit/JITStubs.cpp:
216 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
217
218 2009-06-12 Dave Hyatt <hyatt@apple.com>
219
220 Reviewed by Anders Carlsson.
221
222 https://bugs.webkit.org/show_bug.cgi?id=26373
223
224 Add a new class to Threading in wtf called ReadWriteLock that handles single writer/multiple reader locking.
225 Provide a pthreads-only implementation of the lock for now, as this class is only going to be used
226 on Snow Leopard at first.
227
228 * wtf/Threading.h:
229 (WTF::ReadWriteLock::impl):
230 * wtf/ThreadingPthreads.cpp:
231 (WTF::ReadWriteLock::ReadWriteLock):
232 (WTF::ReadWriteLock::~ReadWriteLock):
233 (WTF::ReadWriteLock::readLock):
234 (WTF::ReadWriteLock::tryReadLock):
235 (WTF::ReadWriteLock::writeLock):
236 (WTF::ReadWriteLock::tryWriteLock):
237 (WTF::ReadWriteLock::unlock):
238
239 2009-06-12 Oliver Hunt <oliver@apple.com>
240
241 Reviewed by Geoff Garen.
242
243 Make LiteralParser non-recursive
244
245 Convert LiteralParser from using a simple recursive descent parser
246 to a hand rolled PDA. Relatively simple conversion, but required
247 modifications to MarkedArgumentBuffer to make it more suitable as
248 a generic marked vector. I'll refactor and rename MarkedArgumentBuffer
249 in future as there are many other cases where it will be useful to
250 have such a class.
251
252 * runtime/ArgList.h:
253 (JSC::MarkedArgumentBuffer::MarkedArgumentBuffer):
254 (JSC::MarkedArgumentBuffer::append):
255 (JSC::MarkedArgumentBuffer::removeLast):
256 (JSC::MarkedArgumentBuffer::last):
257 * runtime/LiteralParser.cpp:
258 (JSC::LiteralParser::parse):
259 * runtime/LiteralParser.h:
260 (JSC::LiteralParser::LiteralParser):
261 (JSC::LiteralParser::tryLiteralParse):
262 (JSC::LiteralParser::):
263
264 2009-06-12 David Levin <levin@chromium.org>
265
266 Reviewed by NOBODY (build fix for windows).
267
268 Adjust the exports for JSC on Windows like what was done for OSX in
269 the previous commit.
270
271 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
272 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
273
274 2009-06-12 David Levin <levin@chromium.org>
275
276 Reviewed by Darin Adler.
277
278 UString shouldn't create sharedBuffer for SmallStrings.
279 https://bugs.webkit.org/show_bug.cgi?id=26360
280
281 The methods changed are not used by JSC, so there is no JS perf impact. However,
282 there is a potential DOM perf impact, so I re-ran several of the tests that
283 I ran previously and ensured that the perf stay the same which caused me to
284 adjust the minLengthToShare.
285
286 * JavaScriptCore.exp:
287 * runtime/UString.cpp:
288 (JSC::UString::Rep::sharedBuffer):
289 Determines if the buffer being shared is big enough before doing so.
290 Previously, BaseString::sharedBuffer was called but it would only know
291 the length of the base string (BaseString::len) which may not be the same
292 as the string being shared (Rep::len).
293 (JSC::UString::BaseString::sharedBuffer):
294 This is now only be used by Rep::sharedBuffer. which does the length check.
295 * runtime/UString.h:
296
297 2009-06-12 Dimitri Glazkov <dglazkov@chromium.org>
298
299 Reviewed by Eric Seidel.
300
301 https://bugs.webkit.org/show_bug.cgi?id=26191
302 Remove xmath include in MathExtras.h, because it is not needed and also
303 breaks VS2008 builds with TR1 turned on.
304
305 * wtf/MathExtras.h: Removed xmath include.
306
307 2009-06-12 Peter Kasting <pkasting@google.com>
308
309 Reviewed by Eric Seidel.
310
311 * ChangeLog-2007-10-14: Change pseudonym "Don Gibson" to me (was used while Google Chrome was not public); update my email address.
312
313 2009-06-12 Kevin Ollivier <kevino@theolliviers.com>
314
315 wx build fix. Adding JSONObject.cpp to the build.
316
317 * JavaScriptCoreSources.bkl:
318
319 2009-06-12 Laszlo Gombos <laszlo.1.gombos@nokia.com>
320
321 Reviewed by Jan Michael Alonzo.
322
323 [Qt] Fix build break
324 https://bugs.webkit.org/show_bug.cgi?id=26340
325
326 * JavaScriptCore.pri: Add JSONObject.cpp to LUT files.
327
328 2009-06-11 Oliver Hunt <oliver@apple.com>
329
330 Reviewed by NOBODY (build fix).
331
332 Lower stringify recursion limit to deal with small windows stack.
333
334 * JavaScriptCore.xcodeproj/project.pbxproj:
335 * runtime/JSONObject.cpp:
336 (JSC::Stringifier::):
337
338 2009-06-11 Laszlo Gombos <laszlo.1.gombos@nokia.com>
339
340 Reviewed by Holger Freyther.
341
342 Fix compilation warnings
343 <https://bugs.webkit.org/show_bug.cgi?id=26015>
344
345 * wtf/ThreadingNone.cpp:
346 (WTF::ThreadCondition::wait): Fix compilation warning.
347 (WTF::ThreadCondition::timedWait): Ditto.
348
349 2009-06-10 Brent Fulgham <bfulgham@webkit.org>
350
351 Build fix for Windows target.
352
353 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
354 Correct missing </File> tag after @r44550 that prevents the
355 project from being loaded in the Visual Studio IDE.
356
357 2009-06-09 Gavin Barraclough <barraclough@apple.com>
358
359 Rubber Stamped by Mark Rowe.
360
361 Tidy up a couple of comments.
362
363 * assembler/ARMv7Assembler.h:
364 Fix date in copyright, neaten up a couple of comments.
365 * assembler/MacroAssemblerARMv7.h:
366 Fix date in copyright.
367
368 2009-06-07 Oliver Hunt <oliver@apple.com>
369
370 Reviewed by Sam Weinig.
371
372 Bug 26249: Support JSON.stringify
373 <https://bugs.webkit.org/show_bug.cgi?id=26249>
374
375 Implement JSON.stringify. This patch handles all the semantics of the ES5
376 JSON.stringify function, including replacer functions and arrays and both
377 string and numeric gap arguments.
378
379 Currently uses a clamped recursive algorithm basically identical to the spec
380 description but with a few minor tweaks for performance and corrected semantics
381 discussed in the es-discuss mailing list.
382
383 * DerivedSources.make:
384 * GNUmakefile.am:
385 * JavaScriptCore.pri:
386 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
387 * JavaScriptCore.xcodeproj/project.pbxproj:
388 * interpreter/CallFrame.h:
389 (JSC::ExecState::jsonTable):
390 * runtime/CommonIdentifiers.h:
391 add toJSON to the list of common identifiers
392
393 * runtime/JSGlobalData.cpp:
394 (JSC::JSGlobalData::JSGlobalData):
395 (JSC::JSGlobalData::~JSGlobalData):
396 * runtime/JSGlobalData.h:
397 * runtime/JSGlobalObject.cpp:
398 (JSC::JSGlobalObject::reset):
399 Add support for the JSON object lookup table
400
401 * runtime/JSONObject.cpp: Added.
402 (JSC::):
403 (JSC::JSONObject::getOwnPropertySlot):
404 (JSC::Stringifier::):
405 (JSC::Stringifier::Stringifier):
406 (JSC::Stringifier::stringify):
407 (JSC::Stringifier::appendString):
408
409 (JSC::Stringifier::StringKeyGenerator::StringKeyGenerator):
410 (JSC::Stringifier::StringKeyGenerator::getKey):
411 (JSC::Stringifier::IntKeyGenerator::IntKeyGenerator):
412 (JSC::Stringifier::IntKeyGenerator::getKey):
413 These KeyGenerator classes are used to abstract away the lazy evaluation of keys for
414 toJSON and replacer functions.
415
416 (JSC::Stringifier::toJSONValue):
417 (JSC::Stringifier::stringifyArray):
418 (JSC::Stringifier::stringifyObject):
419 (JSC::JSONProtoFuncStringify):
420 * runtime/JSONObject.h: Added.
421 (JSC::JSONObject:::JSObject):
422 (JSC::JSONObject::classInfo):
423 (JSC::JSONObject::createStructure):
424
425 2009-06-09 Gavin Barraclough <barraclough@apple.com>
426
427 Reviewed by Geoff Garen.
428
429 Enable JIT_OPTIMIZE_CALL & JIT_OPTIMIZE_METHOD_CALLS on ARMv7 platforms.
430
431 These optimizations function correctly with no further changes.
432
433 * wtf/Platform.h:
434 Change to enable JIT_OPTIMIZE_CALL & JIT_OPTIMIZE_METHOD_CALLS.
435
436 2009-06-09 Gavin Barraclough <barraclough@apple.com>
437
438 Not Reviewed, build fix.
439
440 * assembler/MacroAssemblerARMv7.h:
441
442 2009-06-09 Gavin Barraclough <barraclough@apple.com>
443
444 Reviewed by Geoff Garen.
445
446 Enable JIT_OPTIMIZE_ARITHMETIC on ARMv7 platforms.
447
448 Temporarily split support for 'branchTruncateDoubleToInt32' onto its own switch
449 ('supportsFloatingPointTruncate'). See comment in MacroAssemblerARMv7, we need
450 to work out wherther we are going to be able to support the current interface on
451 all platforms, or whether this should be refactored.
452
453 * assembler/MacroAssemblerARMv7.h:
454 (JSC::MacroAssemblerARMv7::supportsFloatingPoint):
455 Add implementation of supportsFloatingPointTruncate (returns true).
456 (JSC::MacroAssemblerARMv7::supportsFloatingPointTruncate):
457 Add implementation of supportsFloatingPointTruncate (returns false).
458 (JSC::MacroAssemblerARMv7::loadDouble):
459 (JSC::MacroAssemblerARMv7::storeDouble):
460 (JSC::MacroAssemblerARMv7::addDouble):
461 (JSC::MacroAssemblerARMv7::subDouble):
462 (JSC::MacroAssemblerARMv7::mulDouble):
463 (JSC::MacroAssemblerARMv7::convertInt32ToDouble):
464 (JSC::MacroAssemblerARMv7::branchDouble):
465 Implement FP code genertion operations.
466 * assembler/MacroAssemblerX86.h:
467 (JSC::MacroAssemblerX86::supportsFloatingPointTruncate):
468 Add implementation of supportsFloatingPointTruncate (returns true).
469 * assembler/MacroAssemblerX86_64.h:
470 (JSC::MacroAssemblerX86_64::supportsFloatingPointTruncate):
471 Add implementation of supportsFloatingPointTruncate (returns true).
472 * jit/JITArithmetic.cpp:
473 (JSC::JIT::emit_op_rshift):
474 Changed to call supportsFloatingPointTruncate().
475 (JSC::JIT::emitSlow_op_rshift):
476 Changed to call supportsFloatingPointTruncate().
477 * wtf/Platform.h:
478 Change to enable JIT_OPTIMIZE_ARITHMETIC.
479
480 2009-06-09 Gavin Barraclough <barraclough@apple.com>
481
482 Reviewed by Mark Rowe & Geoff Garen.
483
484 Enable JIT_OPTIMIZE_PROPERTY_ACCESS on ARMv7 platforms.
485
486 Firm up interface for planting load intructions that will be repatched by
487 repatchLoadPtrToLEA(). This method should now no longer be applied to just
488 any loadPtr instruction.
489
490 * assembler/MacroAssemblerARMv7.h:
491 (JSC::MacroAssemblerARMv7::loadPtrWithPatchToLEA):
492 Implement loadPtrWithPatchToLEA interface (plants a load with a fixed width address).
493 (JSC::MacroAssemblerARMv7::move):
494 (JSC::MacroAssemblerARMv7::nearCall):
495 (JSC::MacroAssemblerARMv7::call):
496 (JSC::MacroAssemblerARMv7::moveWithPatch):
497 (JSC::MacroAssemblerARMv7::tailRecursiveCall):
498 Switch to use common method 'moveFixedWidthEncoding()' to perform fixed width (often patchable) loads.
499 (JSC::MacroAssemblerARMv7::moveFixedWidthEncoding):
500 Move an immediate to a register, always plants movT3/movt instruction pair.
501 * assembler/MacroAssemblerX86.h:
502 (JSC::MacroAssemblerX86::loadPtrWithPatchToLEA):
503 Implement loadPtrWithPatchToLEA interface (just a regular 32-bit load on x86).
504 * assembler/MacroAssemblerX86_64.h:
505 (JSC::MacroAssemblerX86_64::loadPtrWithPatchToLEA):
506 Implement loadPtrWithPatchToLEA interface (just a regular 64-bit load on x86_64).
507 * jit/JITPropertyAccess.cpp:
508 (JSC::JIT::compileGetByIdHotPath):
509 (JSC::JIT::emit_op_put_by_id):
510 * wtf/Platform.h:
511 Change to enable JIT_OPTIMIZE_PROPERTY_ACCESS.
512
513 2009-06-08 Gavin Barraclough <barraclough@apple.com>
514
515 Reviewed by Geoff Garen.
516
517 Enable JS language JIT for ARM thumb2 platforms. Add ARMv7 specific
518 asm & constants, add appropriate configuration switches to Platform.h.
519
520 Landing this disabled until jump linking is completed (see YARR jit patch).
521
522 * assembler/MacroAssemblerARMv7.h:
523 (JSC::MacroAssemblerARMv7::load32):
524 Fix: should load pointer with ImmPtr not Imm32.
525 (JSC::MacroAssemblerARMv7::store32):
526 Fix: should load pointer with ImmPtr not Imm32.
527 (JSC::MacroAssemblerARMv7::move):
528 Fix: When moving an Imm32 that is actually a pointer, should call movT3()
529 not mov(), to ensure code generation is repeatable (for exception handling).
530 * jit/JIT.cpp:
531 (JSC::JIT::privateCompileCTIMachineTrampolines):
532 Disable JIT_OPTIMIZE_NATIVE_CALL specific code generation if the optimization is not enabled.
533 * jit/JIT.h:
534 Add ARMv7 specific values of constants & register names.
535 * jit/JITInlineMethods.h:
536 (JSC::JIT::preverveReturnAddressAfterCall):
537 (JSC::JIT::restoreReturnAddressBeforeReturn):
538 (JSC::JIT::restoreArgumentReferenceForTrampoline):
539 Implement for ARMv7 (move value to/from lr).
540 * jit/JITStubs.cpp:
541 Add JIT entry/thow trampolines, add macro to add thunk wrapper around stub routines.
542 * jit/JITStubs.h:
543 (JSC::JITStackFrame::returnAddressSlot):
544 Add ARMv7 stack frame object.
545 * wtf/Platform.h:
546 Add changes necessary to allow JIT to build on this platform, disabled.
547
548 2009-06-08 Mark Rowe <mrowe@apple.com>
549
550 Speculative GTK build fix.
551
552 * wtf/DateMath.cpp:
553
554 2009-06-08 Gavin Barraclough <barraclough@apple.com>
555
556 Reviewed by Mark Rowe.
557
558 Previous patch caused a regression.
559
560 Restructure so no new (empty, inline) function calls are added on x86.
561
562 * jit/ExecutableAllocator.h:
563 (JSC::ExecutableAllocator::makeWritable):
564 (JSC::ExecutableAllocator::makeExecutable):
565 (JSC::ExecutableAllocator::reprotectRegion):
566 (JSC::ExecutableAllocator::cacheFlush):
567
568 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
569
570 Unreviewed, GTK build fix (thanks, bdash).
571
572 * GNUmakefile.am: Moved DateMath with all other wtf kin.
573
574 2009-06-08 Gavin Barraclough <barraclough@apple.com>
575
576 Reviewed by Geoff Garen.
577
578 Add (incomplete) support to YARR for running with the jit enabled
579 on Arm thumb2 platforms. Adds new Assembler/MacroAssembler classes,
580 along with cache flushing support, tweaks to MacroAssemblerCodePtr
581 to support decorated thumb code pointers, and new enter/exit code
582 to YARR jit for the platform.
583
584 Support for this platform is still under development - the assembler
585 currrently only supports planting and linking jumps with a 16Mb range.
586 As such, initially commiting in a disabled state.
587
588 * JavaScriptCore.xcodeproj/project.pbxproj:
589 Add new assembler files.
590 * assembler/ARMv7Assembler.h: Added.
591 Add new Assembler.
592 * assembler/AbstractMacroAssembler.h:
593 Tweaks to ensure sizes of pointer values planted in JIT code do not change.
594 * assembler/MacroAssembler.h:
595 On ARMv7 platforms use MacroAssemblerARMv7.
596 * assembler/MacroAssemblerARMv7.h: Added.
597 Add new MacroAssembler.
598 * assembler/MacroAssemblerCodeRef.h:
599 (JSC::FunctionPtr::FunctionPtr):
600 Add better ASSERT.
601 (JSC::ReturnAddressPtr::ReturnAddressPtr):
602 Add better ASSERT.
603 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
604 On ARMv7, MacroAssemblerCodePtr's mush be 'decorated' with a low bit set,
605 to indicate to the processor that the code is thumb code, not traditional
606 32-bit ARM.
607 (JSC::MacroAssemblerCodePtr::dataLocation):
608 On ARMv7, decoration must be removed.
609 * jit/ExecutableAllocator.h:
610 (JSC::ExecutableAllocator::makeWritable):
611 Reformatted, no change.
612 (JSC::ExecutableAllocator::makeExecutable):
613 When marking code executable also cache flush it, where necessary.
614 (JSC::ExecutableAllocator::MakeWritable::MakeWritable):
615 Only use the null implementation of this class if both !ASSEMBLER_WX_EXCLUSIVE
616 and running on x86(_64) - on other platforms we may also need ensure that
617 makeExecutable is called at the end to flush caches.
618 (JSC::ExecutableAllocator::reprotectRegion):
619 Reformatted, no change.
620 (JSC::ExecutableAllocator::cacheFlush):
621 Cache flush a region of memory, or platforms where this is necessary.
622 * wtf/Platform.h:
623 Add changes necessary to allow YARR jit to build on this platform, disabled.
624 * yarr/RegexJIT.cpp:
625 (JSC::Yarr::RegexGenerator::generateEnter):
626 (JSC::Yarr::RegexGenerator::generateReturn):
627 Add support to these methods for ARMv7.
628
629 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
630
631 Unreviewed, fix my previous fix.
632
633 * runtime/DateInstance.cpp:
634 (JSC::DateInstance::msToGregorianDateTime): Use WTF namespace qualifier to
635 disambiguate func signatures.
636
637 2009-06-08 Mark Rowe <mrowe@apple.com>
638
639 Attempt to fix the Tiger build.
640
641 * wtf/Platform.h: Only test the value of the macro once we know it is defined.
642
643 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
644
645 Unreviewed, another Windows build fix.
646
647 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
648 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
649
650 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
651
652 Unreviewed, projectile-fixing Windows build.
653
654 * runtime/DateConversion.cpp: Added StringExtras include.
655 * wtf/DateMath.cpp: Replaced math with algorithm include (looking for std::min def for Windows).
656
657 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
658
659 Unreviewed, Windows build fix.
660
661 * runtime/DateConstructor.cpp: Changed to use WTF namespace.
662 * runtime/DateConversion.cpp: Added UString include.
663 * runtime/DateInstance.cpp: Changed to use WTF namespace.
664 * wtf/DateMath.cpp: Added math include.
665
666 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
667
668 Reviewed by Eric Seidel.
669
670 https://bugs.webkit.org/show_bug.cgi?id=26238
671 Move most of runtime/DateMath functions to wtf/DateMath, and split off conversion-related
672 helpers to DateConversion.
673
674 * AllInOneFile.cpp: Changed DateMath->DateConversion.
675 * GNUmakefile.am: Ditto and added DateMath.
676 * JavaScriptCore.exp: Ditto.
677 * JavaScriptCore.pri: Ditto.
678 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
679 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added DateMath.
680 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
681 * JavaScriptCoreSources.bkl: Ditto.
682 * pcre/pcre_exec.cpp: Changed to use DateMath.
683 * profiler/ProfileNode.cpp:
684 (JSC::getCount): Changed to use DateConversion.
685 * runtime/DateConstructor.cpp: Ditto.
686 * runtime/DateConversion.cpp: Copied from JavaScriptCore/runtime/DateMath.cpp.
687 (JSC::parseDate): Refactored to use null-terminated characters as input.
688 * runtime/DateConversion.h: Copied from JavaScriptCore/runtime/DateMath.h.
689 * runtime/DateInstance.cpp: Changed to use wtf/DateMath.
690 * runtime/DateInstance.h: Ditto.
691 * runtime/DateMath.cpp: Removed.
692 * runtime/DateMath.h: Removed.
693 * runtime/DatePrototype.cpp: Ditto.
694 * runtime/InitializeThreading.cpp: Ditto.
695 * wtf/DateMath.cpp: Copied from JavaScriptCore/runtime/DateMath.cpp.
696 * wtf/DateMath.h: Copied from JavaScriptCore/runtime/DateMath.h.
697
698 2009-06-08 Steve Falkenburg <sfalken@apple.com>
699
700 Windows build fix.
701
702 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
703
704 2009-06-07 David Kilzer <ddkilzer@apple.com>
705
706 Make JavaScriptCore compile for iPhone and iPhone Simulator
707
708 Reviewed by Gavin Barraclough.
709
710 * Configurations/Base.xcconfig: Split GCC_ENABLE_OBJC_GC on
711 $(REAL_PLATFORM_NAME). Added $(ARCHS_UNIVERSAL_IPHONE_OS) to
712 VALID_ARCHS. Added REAL_PLATFORM_NAME_iphoneos,
713 REAL_PLATFORM_NAME_iphonesimulator, HAVE_DTRACE_iphoneos and
714 HAVE_DTRACE_iphonesimulator variables.
715 * Configurations/DebugRelase.xcconfig: Split ARCHS definition on
716 $(REAL_PLATFORM_NAME).
717 * Configurations/JavaScriptCore.xcconfig: Added
718 EXPORTED_SYMBOLS_FILE_armv6 and EXPORTED_SYMBOLS_FILE_armv7
719 variables. Split OTHER_LDFLAGS into OTHER_LDFLAGS_BASE and
720 OTHER_LDFLAGS_$(REAL_PLATFORM_NAME) since CoreServices.framework
721 is only linked to on Mac OS X.
722 * JavaScriptCore.xcodeproj/project.pbxproj: Removed references
723 to CoreServices.framework since it's linked using OTHER_LDFLAGS
724 in JavaScriptCore.xcconfig.
725 * profiler/ProfilerServer.mm: Added #import for iPhone
726 Simulator.
727 (-[ProfilerServer init]): Conditionalize use of
728 NSDistributedNotificationCenter to non-iPhone or iPhone
729 Simulator.
730 * wtf/FastMalloc.cpp:
731 (WTF::TCMallocStats::): Build fix for iPhone and iPhone
732 Simulator.
733 * wtf/Platform.h: Defined PLATFORM(IPHONE) and
734 PLATFORM(IPHONE_SIMULATOR).
735 * wtf/ThreadingPthreads.cpp:
736 (WTF::setThreadNameInternal): Build fix for iPhone and iPhone
737 Simulator.
738
739 2009-06-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
740
741 Reviewed by Simon Hausmann.
742
743 [Qt] Use $QMAKE_PATH_SEP instead of hardcoded / to fix Windows build
744
745 * JavaScriptCore.pri:
746 * JavaScriptCore.pro:
747 * jsc.pro:
748
749 2009-06-07 Gavin Barraclough <barraclough@apple.com>
750
751 RS by Sam Weinig.
752
753 Remove bonus bogus \n from last commit.
754
755 * jit/JITStubs.cpp:
756 (JSC::):
757
758 2009-06-07 Gavin Barraclough <barraclough@apple.com>
759
760 Reviewed by Sam Weinig.
761
762 Change the implementation of op_throw so the stub function always modifies its
763 return address - if it doesn't find a 'catch' it will switch to a trampoline
764 to force a return from JIT execution. This saves memory, by avoiding the need
765 for a unique return for every op_throw.
766
767 * jit/JITOpcodes.cpp:
768 (JSC::JIT::emit_op_throw):
769 JITStubs::cti_op_throw now always changes its return address,
770 remove return code generated after the stub call (this is now
771 handled by ctiOpThrowNotCaught).
772 * jit/JITStubs.cpp:
773 (JSC::):
774 Add ctiOpThrowNotCaught definitions.
775 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
776 Change cti_op_throw to always change its return address.
777 * jit/JITStubs.h:
778 Add ctiOpThrowNotCaught declaration.
779
780 2009-06-05 Gavin Barraclough <barraclough@apple.com>
781
782 Rudder stamped by Sam Weinig.
783
784 Add missing ASSERT.
785
786 * assembler/X86Assembler.h:
787 (JSC::X86Assembler::getRelocatedAddress):
788
789 2009-06-05 Gavin Barraclough <barraclough@apple.com>
790
791 Reviewed by Sam Weinig.
792
793 Switch storePtrWithPatch to take the initial immediate value as an argument.
794
795 * assembler/MacroAssemblerX86.h:
796 (JSC::MacroAssemblerX86::storePtrWithPatch):
797 * assembler/MacroAssemblerX86_64.h:
798 (JSC::MacroAssemblerX86_64::storePtrWithPatch):
799 * jit/JITOpcodes.cpp:
800 (JSC::JIT::emit_op_jsr):
801
802 2009-06-05 Gavin Barraclough <barraclough@apple.com>
803
804 Reviewed by Sam Weinig.
805
806 Remove patchLength..tByIdExternalLoadPrefix magic numbers from JIT.h.
807
808 These aren't really suitable values to be tracking within common code
809 of the JIT, since they are not (and realistically cannot) be checked
810 by ASSERTs, as the other repatch offsets are. Move this functionality
811 (skipping the REX prefix when patching load instructions to LEAs on
812 x86-64) into the X86Assembler.
813
814 * assembler/AbstractMacroAssembler.h:
815 (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadPtrToLEA):
816 * assembler/X86Assembler.h:
817 (JSC::X86Assembler::repatchLoadPtrToLEA):
818 * jit/JIT.h:
819 * jit/JITPropertyAccess.cpp:
820 (JSC::JIT::patchGetByIdSelf):
821 (JSC::JIT::patchPutByIdReplace):
822
823 2009-06-05 Shinichiro Hamaji <hamaji@chromium.org>
824
825 Bug 26160: Compile fails in MacOSX when GNU fileutils are installed
826
827 <https://bugs.webkit.org/show_bug.cgi?id=26160>
828
829 Reviewed by Alexey Proskuryakov.
830
831 Use /bin/ln instead of ln for cases where this command is used with -h option.
832 As this option is not supported by GNU fileutils, this change helps users
833 who have GNU fileutils in their PATH.
834
835 * JavaScriptCore.xcodeproj/project.pbxproj:
836
837 2009-06-05 Gavin Barraclough <barraclough@apple.com>
838
839 Reviewed by Oliver Hunt.
840
841 Remove DoubleNotEqual floating point comparison condition for now -
842 it is not used, and it is unclear the semantics are correct (I think
843 this comparison would actually give you not-equal-or-unordered, which
844 might be what is wanted... we can revisit this interface & get it
845 right when required).
846
847 Also, fix asserts in branchArith32 ops. All adds & subs can check
848 for Signed, multiply only sets OF so can only check for overflow.
849
850 * assembler/MacroAssemblerX86Common.h:
851 (JSC::MacroAssemblerX86Common::):
852 (JSC::MacroAssemblerX86Common::branchAdd32):
853 (JSC::MacroAssemblerX86Common::branchMul32):
854 (JSC::MacroAssemblerX86Common::branchSub32):
855
856 2009-06-05 Gavin Barraclough <barraclough@apple.com>
857
858 Reviewed by Oliver Hunt.
859
860 Minor tidy up in JITStubs.
861
862 * jit/JITStubs.cpp:
863 (JSC::StackHack::StackHack):
864 * jit/JITStubs.h:
865
866 2009-06-05 Koen Kooi <koen@dominion.thruhere.net>
867
868 Reviewed by Xan Lopez.
869
870 Build fix for glib unicode backend.
871
872 * wtf/unicode/glib/UnicodeMacrosFromICU.h:
873
874 2009-06-05 Gavin Barraclough <barraclough@apple.com>
875
876 Reviewed by Oliver Hunt.
877
878 3 tiny cleanups:
879
880 * assembler/MacroAssemblerX86.h:
881 * assembler/MacroAssemblerX86_64.h:
882 (JSC::MacroAssemblerX86_64::storePtrWithPatch):
883 store*() methods should take an ImplicitAddress, rather than an Address.
884 * assembler/X86Assembler.h:
885 Make patchPointer private.
886 * jit/JITOpcodes.cpp:
887 (JSC::JIT::emit_op_ret):
888 Remove empty line at end of function.
889
890 2009-06-05 Gavin Barraclough <barraclough@apple.com>
891
892 Reviewed by Oliver Hunt.
893
894 Encapsulate many uses of void* in the assembler & jit with types that provide
895 more semantic information. The new types are:
896
897 * MacroAssemblerCodePtr - this wraps a pointer into JIT generated code.
898 * FunctionPtr - this wraps a pointer to a C/C++ function in JSC.
899 * ReturnAddressPtr - this wraps a return address resulting from a 'call' instruction.
900
901 Wrapping these types allows for stronger type-checking than is possible with everything
902 represented a void*. For example, it is now enforced by the type system that near
903 calls can only be linked to JIT code and not to C functions in JSC (this was previously
904 required, but could not be enforced on the interface).
905
906 * assembler/AbstractMacroAssembler.h:
907 (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
908 (JSC::AbstractMacroAssembler::CodeLocationCommon::dataLocation):
909 (JSC::AbstractMacroAssembler::CodeLocationCommon::executableAddress):
910 (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
911 (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadToLEA):
912 (JSC::AbstractMacroAssembler::CodeLocationInstruction::CodeLocationInstruction):
913 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
914 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
915 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
916 (JSC::AbstractMacroAssembler::CodeLocationLabel::operator!):
917 (JSC::AbstractMacroAssembler::CodeLocationLabel::reset):
918 (JSC::AbstractMacroAssembler::CodeLocationLabel::CodeLocationLabel):
919 (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
920 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
921 (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
922 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
923 (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
924 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
925 (JSC::AbstractMacroAssembler::CodeLocationNearCall::relink):
926 (JSC::AbstractMacroAssembler::CodeLocationNearCall::calleeReturnAddressValue):
927 (JSC::AbstractMacroAssembler::CodeLocationNearCall::CodeLocationNearCall):
928 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
929 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
930 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
931 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
932 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToTrampoline):
933 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
934 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkNearCallerToTrampoline):
935 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::addressForLookup):
936 (JSC::AbstractMacroAssembler::trampolineAt):
937 (JSC::AbstractMacroAssembler::PatchBuffer::link):
938 (JSC::AbstractMacroAssembler::PatchBuffer::performFinalization):
939 (JSC::::CodeLocationCommon::instructionAtOffset):
940 (JSC::::CodeLocationCommon::labelAtOffset):
941 (JSC::::CodeLocationCommon::jumpAtOffset):
942 (JSC::::CodeLocationCommon::callAtOffset):
943 (JSC::::CodeLocationCommon::nearCallAtOffset):
944 (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
945 (JSC::::CodeLocationCommon::dataLabel32AtOffset):
946 * assembler/MacroAssemblerCodeRef.h:
947 (JSC::FunctionPtr::FunctionPtr):
948 (JSC::FunctionPtr::value):
949 (JSC::FunctionPtr::executableAddress):
950 (JSC::ReturnAddressPtr::ReturnAddressPtr):
951 (JSC::ReturnAddressPtr::value):
952 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
953 (JSC::MacroAssemblerCodePtr::executableAddress):
954 (JSC::MacroAssemblerCodePtr::dataLocation):
955 (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
956 * assembler/X86Assembler.h:
957 (JSC::X86Assembler::patchPointerForCall):
958 * jit/JIT.cpp:
959 (JSC::ctiPatchNearCallByReturnAddress):
960 (JSC::ctiPatchCallByReturnAddress):
961 (JSC::JIT::privateCompile):
962 (JSC::JIT::privateCompileCTIMachineTrampolines):
963 * jit/JIT.h:
964 (JSC::JIT::compileCTIMachineTrampolines):
965 * jit/JITCall.cpp:
966 (JSC::JIT::compileOpCall):
967 * jit/JITCode.h:
968 (JSC::JITCode::operator !):
969 (JSC::JITCode::addressForCall):
970 (JSC::JITCode::offsetOf):
971 (JSC::JITCode::execute):
972 (JSC::JITCode::size):
973 (JSC::JITCode::HostFunction):
974 * jit/JITInlineMethods.h:
975 (JSC::JIT::emitNakedCall):
976 * jit/JITPropertyAccess.cpp:
977 (JSC::JIT::privateCompilePutByIdTransition):
978 (JSC::JIT::patchGetByIdSelf):
979 (JSC::JIT::patchPutByIdReplace):
980 (JSC::JIT::privateCompilePatchGetArrayLength):
981 (JSC::JIT::privateCompileGetByIdProto):
982 (JSC::JIT::privateCompileGetByIdChain):
983 * jit/JITStubs.cpp:
984 (JSC::JITThunks::JITThunks):
985 (JSC::JITThunks::tryCachePutByID):
986 (JSC::JITThunks::tryCacheGetByID):
987 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
988 * jit/JITStubs.h:
989 (JSC::JITThunks::ctiArrayLengthTrampoline):
990 (JSC::JITThunks::ctiStringLengthTrampoline):
991 (JSC::JITThunks::ctiVirtualCallPreLink):
992 (JSC::JITThunks::ctiVirtualCallLink):
993 (JSC::JITThunks::ctiVirtualCall):
994 (JSC::JITThunks::ctiNativeCallThunk):
995 * yarr/RegexJIT.h:
996 (JSC::Yarr::RegexCodeBlock::operator!):
997 (JSC::Yarr::RegexCodeBlock::execute):
998
999 2009-06-05 Antti Koivisto <antti@apple.com>
1000
1001 Try to unbreak Windows build.
1002
1003 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1004 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1005
1006 2009-06-03 Antti Koivisto <antti@apple.com>
1007
1008 Reviewed by Dave Kilzer.
1009
1010 https://bugs.webkit.org/show_bug.cgi?id=13128
1011 Safari not obeying cache header
1012
1013 Export JSC::parseDate()
1014
1015 * JavaScriptCore.exp:
1016 * JavaScriptCore.xcodeproj/project.pbxproj:
1017
1018 2009-06-04 Oliver Hunt <oliver@apple.com>
1019
1020 Reviewed by Gavin Barraclough.
1021
1022 Bug in property caching of getters and setters.
1023
1024 Make sure that the transition logic accounts for getters and setters.
1025 If we don't we end up screwing up the transition tables so that some
1026 transitions will start incorrectly believing that they need to check
1027 for getters and setters.
1028
1029 * runtime/JSObject.cpp:
1030 (JSC::JSObject::defineGetter):
1031 (JSC::JSObject::defineSetter):
1032 * runtime/JSObject.h:
1033 (JSC::):
1034 * runtime/Structure.h:
1035
1036 2009-06-04 Gavin Barraclough <barraclough@apple.com>
1037
1038 Reviewed by Sam Weinig.
1039
1040 Minor tweak to PatchBuffer, change it so it no longer holds a CodeRef, and instead
1041 holds a separate code pointer and executable pool. Since it now always holds its
1042 own copy of the code size, and to simplify the construction sequence, it's neater
1043 this way.
1044
1045 * assembler/AbstractMacroAssembler.h:
1046 (JSC::AbstractMacroAssembler::PatchBuffer::PatchBuffer):
1047 (JSC::AbstractMacroAssembler::PatchBuffer::finalizeCode):
1048 (JSC::AbstractMacroAssembler::PatchBuffer::code):
1049 (JSC::AbstractMacroAssembler::PatchBuffer::performFinalization):
1050
1051 2009-06-04 Gavin Barraclough <barraclough@apple.com>
1052
1053 Reviewed by Oliver Hunt.
1054
1055 Remove 'JIT_STUB_ARGUMENT_STACK' this is unused and untested.
1056
1057 This just leaves JIT_STUB_ARGUMENT_REGISTER and JIT_STUB_ARGUMENT_VA_LIST.
1058 Since JIT_STUB_ARGUMENT_REGISTER is the sensible configuration on most platforms,
1059 remove this define and make this the default behaviour.
1060 Platforms must now define JIT_STUB_ARGUMENT_VA_LIST to get crazy va_list voodoo,
1061 if they so desire.
1062
1063 (Refactoring of #ifdefs only, no functional change, no performance impact.)
1064
1065 * jit/JIT.h:
1066 * jit/JITInlineMethods.h:
1067 (JSC::JIT::restoreArgumentReference):
1068 (JSC::JIT::restoreArgumentReferenceForTrampoline):
1069 * jit/JITStubs.cpp:
1070 (JSC::):
1071 * jit/JITStubs.h:
1072 * wtf/Platform.h:
1073
1074 2009-06-04 Gavin Barraclough <barraclough@apple.com>
1075
1076 Rubber stamped by Sam Weinig.
1077
1078 * jit/JITArithmetic.cpp:
1079 Remove some redundant typedefs, unused since arithmetic was added to the MacroAssembler interface.
1080
1081 2009-06-04 Brent Fulgham <bfulgham@webkit.org>
1082
1083 Build fix due to header include problem.
1084
1085 * interpreter/Interpreter.h: Remove wtf from includes so that
1086 compile can find the headers in expected places.
1087
1088 2009-06-04 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
1089
1090 Reviewed by Darin Adler.
1091
1092 HashTable class (JavaScriptCore/wtf/HashTable.h) doesn't instantiated by 'new', so
1093 inheritance was removed. HashTable struct has been instantiated by operator new in
1094 JSGlobalData.cpp:106.
1095 HashTable couldn't inherited from FastAllocBase since struct with inheritance is
1096 no longer POD, so HashTable struct has been instantiated by fastNew, destroyed by
1097 fastDelete.
1098
1099 * interpreter/Interpreter.h:
1100 * runtime/JSGlobalData.cpp:
1101 (JSC::JSGlobalData::JSGlobalData):
1102 (JSC::JSGlobalData::~JSGlobalData):
1103 * wtf/HashTable.h:
1104
1105 2009-06-04 Gavin Barraclough <barraclough@apple.com>
1106
1107 Reviewed by Oliver Hunt.
1108
1109 Wrap the code that plants pushes/pops planted by JIT in explanatorily named
1110 methods; move property storage reallocation into a standard stub function.
1111
1112 ~No performance impact (possible <1% progression on x86-64, likely just noise).
1113
1114 * jit/JIT.cpp:
1115 (JSC::JIT::privateCompile):
1116 (JSC::JIT::privateCompileCTIMachineTrampolines):
1117 Wrap calls to push/pop.
1118 * jit/JIT.h:
1119 Declare the new wrapper methods.
1120 * jit/JITInlineMethods.h:
1121 (JSC::JIT::preverveReturnAddressAfterCall):
1122 (JSC::JIT::restoreReturnAddressBeforeReturn):
1123 Define the new wrapper methods.
1124 * jit/JITOpcodes.cpp:
1125 (JSC::JIT::emit_op_end):
1126 (JSC::JIT::emit_op_ret):
1127 Wrap calls to push/pop.
1128 * jit/JITPropertyAccess.cpp:
1129 (JSC::JIT::privateCompilePutByIdTransition):
1130 Move property storage reallocation into a standard stub function.
1131 * jit/JITStubs.cpp:
1132 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1133 * jit/JITStubs.h:
1134 (JSC::JITStubs::):
1135
1136 2009-06-04 Laszlo Gombos <laszlo.1.gombos@nokia.com>
1137
1138 Reviewed by Ariya Hidayat.
1139
1140 [Qt] Single-threaded QtWebKit configuration
1141 <https://bugs.webkit.org/show_bug.cgi?id=26015>
1142
1143 * JavaScriptCore.pri: Use ThreadingNone.cpp instead of
1144 ThreadingQt.cpp and make sure ENABLE_JSC_MULTIPLE_THREADS is turned off
1145 when ENABLE_SINGLE_THREADED is tuned on
1146 * wtf/ThreadingNone.cpp:
1147 (WTF::ThreadCondition::wait): Fix compilation warning.
1148 (WTF::ThreadCondition::timedWait): Ditto.
1149
1150 2009-06-02 Mark Rowe <mrowe@apple.com>
1151
1152 Reviewed by Anders Carlsson.
1153
1154 Remove workaround that was added to address <rdar://problem/5488678> as it no longer affects our Tiger builds.
1155
1156 * Configurations/Base.xcconfig:
1157
1158 2009-06-02 Xan Lopez <xlopez@igalia.com>
1159
1160 Reviewed by Sam Weinig.
1161
1162 Use C-style comments in Platform.h so it can be included from C
1163 files.
1164
1165 * wtf/Platform.h:
1166
1167 2009-06-02 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
1168
1169 Rubber-stamped by Simon Hausmann.
1170
1171 Use File::Spec->tmpdir instead of hardcoded paths for tempfile() dir
1172
1173 This fixes the Windows-build if the user does not have a /tmp directory.
1174
1175 * pcre/dftables:
1176
1177 2009-06-02 Gavin Barraclough <barraclough@apple.com>
1178
1179 Reviewed by Oliver ">>" Hunt.
1180
1181 emitSlow_op_rshift is linking the wrong number of slow cases, if !supportsFloatingPoint().
1182 Fixerate, and refactor/comment the code a little to make it clearer what is going on.
1183
1184 * jit/JITArithmetic.cpp:
1185 (JSC::JIT::emit_op_rshift):
1186 (JSC::JIT::emitSlow_op_rshift):
1187
1188 2009-06-01 Gavin Barraclough <barraclough@apple.com>
1189
1190 Reviewed by NOBODY - speculative windows build fix (errm, for the other patch!).
1191
1192 * jit/JITStubs.cpp:
1193 (JSC::):
1194
1195 2009-06-01 Gavin Barraclough <barraclough@apple.com>
1196
1197 Reviewed by NOBODY - speculative windows build fix.
1198
1199 * assembler/AbstractMacroAssembler.h:
1200 (JSC::::CodeLocationCall::CodeLocationCall):
1201 (JSC::::CodeLocationNearCall::CodeLocationNearCall):
1202
1203 2009-06-01 Gavin Barraclough <barraclough@apple.com>
1204
1205 Reviewed by Olliej Hunt.
1206
1207 Change JITStub functions from being static members on the JITStub class to be
1208 global extern "C" functions, and switch their the function signature declaration
1209 in the definition of the functions to be C-macro generated. This makes it easier
1210 to work with the stub functions from assembler code (since the names no longer
1211 require mangling), and by delaring the functions with a macro we can look at
1212 also auto-generating asm thunks to wrap the JITStub functions to perform the
1213 work currently in 'restoreArgumentReference' (as a memory saving).
1214
1215 Making this change also forces us to be a bit more realistic about what is private
1216 on the Register and CallFrame objects. Presently most everything on these classes
1217 is private, and the classes have plenty of friends. We could befriend all the
1218 global functions to perpetuate the delusion of encapsulation, but using friends is
1219 a bit of a sledgehammer solution here - since friends can poke around with all of
1220 the class's privates, and since all the major classes taht operate on Regsiters are
1221 currently friends, right there is currently in practice very little protection at
1222 all. Better to start removing friend delclarations, and exposing just the parts
1223 that need to be exposed.
1224
1225 * interpreter/CallFrame.h:
1226 (JSC::ExecState::returnPC):
1227 (JSC::ExecState::setCallerFrame):
1228 (JSC::ExecState::returnValueRegister):
1229 (JSC::ExecState::setArgumentCount):
1230 (JSC::ExecState::setCallee):
1231 (JSC::ExecState::setCodeBlock):
1232 * interpreter/Interpreter.h:
1233 * interpreter/Register.h:
1234 (JSC::Register::Register):
1235 (JSC::Register::i):
1236 * jit/JITStubs.cpp:
1237 (JSC::):
1238 (JSC::JITThunks::JITThunks):
1239 (JSC::JITThunks::tryCachePutByID):
1240 (JSC::JITThunks::tryCacheGetByID):
1241 (JSC::JITStubs::DEFINE_STUB_FUNCTION):
1242 * jit/JITStubs.h:
1243 (JSC::JITStubs::):
1244 * runtime/JSFunction.h:
1245 (JSC::JSFunction::nativeFunction):
1246 (JSC::JSFunction::classInfo):
1247 * runtime/JSGlobalData.h:
1248
1249 2009-06-01 Oliver Hunt <oliver@apple.com>
1250
1251 Reviewed by Gavin Barraclough.
1252
1253 Tidy up the literal parser.
1254
1255 Make the number lexing in the LiteralParser exactly match the JSON spec, which
1256 makes us cover more cases, but also more strict. Also made string lexing only
1257 allow double-quoted strings.
1258
1259 * runtime/LiteralParser.cpp:
1260 (JSC::LiteralParser::Lexer::lex):
1261 (JSC::LiteralParser::Lexer::lexString):
1262 (JSC::LiteralParser::Lexer::lexNumber):
1263
1264 2009-06-01 Gavin Barraclough <barraclough@apple.com>
1265
1266 Reviewed by Sam "WX" Weinig.
1267
1268 Allow the JIT to operate without relying on use of RWX memory, on platforms where this is supported.
1269
1270 This patch adds a switch to Platform.h (ENABLE_ASSEMBLER_WX_EXCLUSIVE) which enables this mode of operation.
1271 When this flag is set, all executable memory will be allocated RX, and switched to RW only whilst being
1272 modified. Upon completion of code generation the protection is switched back to RX to allow execution.
1273
1274 Further optimization will be required before it is desirable to enable this mode of operation by default;
1275 enabling this presently incurs a 5%-10% regression.
1276
1277 (Submitting disabled - no performance impact).
1278
1279 * assembler/AbstractMacroAssembler.h:
1280 (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadToLEA):
1281 (JSC::AbstractMacroAssembler::CodeLocationLabel::fromFunctionPointer):
1282 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
1283 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
1284 (JSC::AbstractMacroAssembler::CodeLocationNearCall::relink):
1285 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
1286 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
1287 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToTrampoline):
1288 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
1289 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkNearCallerToTrampoline):
1290 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkNearCallerToFunction):
1291 (JSC::AbstractMacroAssembler::PatchBuffer::PatchBuffer):
1292 (JSC::AbstractMacroAssembler::PatchBuffer::~PatchBuffer):
1293 (JSC::AbstractMacroAssembler::PatchBuffer::link):
1294 (JSC::AbstractMacroAssembler::PatchBuffer::patch):
1295 (JSC::AbstractMacroAssembler::PatchBuffer::performFinalization):
1296 (JSC::::CodeLocationCommon::nearCallAtOffset):
1297 (JSC::::CodeLocationCall::CodeLocationCall):
1298 (JSC::::CodeLocationNearCall::CodeLocationNearCall):
1299 * assembler/AssemblerBuffer.h:
1300 (JSC::AssemblerBuffer::executableCopy):
1301 * assembler/X86Assembler.h:
1302 (JSC::CAN_SIGN_EXTEND_U32_64):
1303 (JSC::X86Assembler::linkJump):
1304 (JSC::X86Assembler::linkCall):
1305 (JSC::X86Assembler::patchPointer):
1306 (JSC::X86Assembler::relinkJump):
1307 (JSC::X86Assembler::relinkCall):
1308 (JSC::X86Assembler::repatchInt32):
1309 (JSC::X86Assembler::repatchPointer):
1310 (JSC::X86Assembler::repatchLoadToLEA):
1311 (JSC::X86Assembler::patchInt32):
1312 (JSC::X86Assembler::patchRel32):
1313 * jit/ExecutableAllocator.h:
1314 (JSC::ExecutableAllocator::):
1315 (JSC::ExecutableAllocator::makeWritable):
1316 (JSC::ExecutableAllocator::makeExecutable):
1317 * jit/ExecutableAllocatorFixedVMPool.cpp:
1318 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
1319 * jit/ExecutableAllocatorPosix.cpp:
1320 (JSC::ExecutablePool::systemAlloc):
1321 (JSC::ExecutablePool::systemRelease):
1322 (JSC::ExecutableAllocator::reprotectRegion):
1323 * jit/ExecutableAllocatorWin.cpp:
1324 * jit/JITPropertyAccess.cpp:
1325 (JSC::JIT::patchGetByIdSelf):
1326 (JSC::JIT::patchPutByIdReplace):
1327 * wtf/Platform.h:
1328
1329 2009-05-29 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
1330
1331 Reviewed by Darin Adler.
1332
1333 Inherits Interpreter class from FastAllocBase because it has been
1334 instantiated by 'new' in JavaScriptCore/runtime/JSGlobalData.cpp.
1335
1336 * interpreter/Interpreter.h:
1337
1338 2009-06-01 David Levin <levin@chromium.org>
1339
1340 Reviewed by NOBODY (windows build fix).
1341
1342 Add exports for windows (corresponding to the JavaScriptCore.exp modification
1343 in the previous change).
1344
1345 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1346 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1347
1348 2009-06-01 David Levin <levin@chromium.org>
1349
1350 Reviewed by Darin Alder and Maciej Stachowiak.
1351
1352 Bug 26057: StringImpl should share buffers with UString.
1353 https://bugs.webkit.org/show_bug.cgi?id=26057
1354
1355 * JavaScriptCore.exp:
1356 * runtime/UString.cpp:
1357 (JSC::UString::Rep::create):
1358 (JSC::UString::BaseString::sharedBuffer): Only do the sharing when
1359 the buffer exceeds a certain size. The size was tuned by running
1360 various dom benchmarks with numbers ranging from 20 to 800 and finding
1361 a place that seemed to do the best overall.
1362 * runtime/UString.h:
1363
1364 2009-05-31 Gavin Barraclough <barraclough@apple.com>
1365
1366 Reviewed by Olliej "you just need to change NativeFunctionWrapper.h" Hunt.
1367
1368 Add ENABLE_JIT_OPTIMIZE_NATIVE_CALL switch to allow JIT to operate without native call optimizations.
1369
1370 * runtime/NativeFunctionWrapper.h:
1371 * wtf/Platform.h:
1372
1373 2009-05-30 Darin Adler <darin@apple.com>
1374
1375 Reviewed by Sam Weinig.
1376
1377 <rdar://problem/6935193> REGRESSION (r42734): Celtic Kane JavaScript benchmark does not run:
1378 "Maximum call stack size exceeded"
1379
1380 * runtime/ArrayPrototype.cpp:
1381 (JSC::arrayProtoFuncToString): Use the same recursion limit as the other recursion checks.
1382 We need a limit of at least 100 to run the benchmark above.
1383 (JSC::arrayProtoFuncToLocaleString): Ditto.
1384 (JSC::arrayProtoFuncJoin): Ditto.
1385
1386 2009-05-28 Dirk Schulze <krit@webkit.org>
1387
1388 Reviewed by Nikolas Zimmermann.
1389
1390 Added new build flag --filters for Mac. More details in WebCore/ChangeLog.
1391
1392 * Configurations/FeatureDefines.xcconfig:
1393
1394 2009-05-27 Oliver Hunt <oliver@apple.com>
1395
1396 Reviewed by Mark Rowe.
1397
1398 <rdar://problem/6928025> Stack overflow in JSC::stringProtoFuncReplace() running jsFunFuzz
1399
1400 We should always check for exceptions after creating a CachedCall, this wasn't being done in
1401 the string replace logic.
1402
1403 * runtime/StringPrototype.cpp:
1404 (JSC::stringProtoFuncReplace):
1405
1406 2009-05-27 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
1407
1408 Unreviewed (make distcheck) build fix; adding missing headers.
1409
1410 * GNUmakefile.am:
1411
1412 2009-05-27 Jessie Berlin <jberlin@apple.com>
1413
1414 Reviewed by Adam Roben
1415
1416 Fix the Windows build.
1417
1418 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1419 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1420
1421 2009-05-27 Fridrich Strba <fridrich.strba@bluewin.ch>
1422
1423 Reviewed by Gustavo Noronha.
1424
1425 When building on Windows, consider Windows specific files.
1426
1427 * GNUmakefile.am:
1428
1429 2009-05-27 Fridrich Strba <fridrich.strba@bluewin.ch>
1430
1431 Reviewed by Maciej Stachowiak.
1432
1433 When building with MinGW, don't use the __declspec(dl{import,export})
1434 decorations and rely on the linker to use its nifty auto-import feature.
1435 It is extremely hard to get the decorations right with MinGW in general
1436 and impossible in WebKit, where the resulting shared library is linking
1437 together some static libraries.
1438
1439 * config.h:
1440
1441 2009-05-26 Holger Hans Peter Freyther <zecke@selfish.org>
1442
1443 Reviewed by Xan Lopez.
1444
1445 https://bugs.webkit.org/show_bug.cgi?id=25613
1446
1447 Be able to use GOwnPtr for GHashTable as well. The assumption
1448 is that the hash table has been created with g_hash_table_new_full
1449 and has proper destruction functions.
1450
1451 * wtf/GOwnPtr.cpp:
1452 (WTF::GHashTable):
1453 * wtf/GOwnPtr.h:
1454
1455 2009-05-26 Oliver Hunt <oliver@apple.com>
1456
1457 Reviewed by Gavin Barraclough.
1458
1459 <rdar://problem/6924033> REGRESSION: Assertion failure due to forward references
1460
1461 Add a pattern type for forward references to ensure that we don't confuse the
1462 quantifier alternatives assertion.
1463
1464 * yarr/RegexCompiler.cpp:
1465 (JSC::Yarr::RegexPatternConstructor::atomBackReference):
1466 (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
1467 * yarr/RegexInterpreter.cpp:
1468 (JSC::Yarr::ByteCompiler::emitDisjunction):
1469 * yarr/RegexJIT.cpp:
1470 (JSC::Yarr::RegexGenerator::generateTerm):
1471 * yarr/RegexPattern.h:
1472 (JSC::Yarr::PatternTerm::):
1473 (JSC::Yarr::PatternTerm::PatternTerm):
1474 (JSC::Yarr::PatternTerm::ForwardReference):
1475
1476 2009-05-26 Gavin Barraclough <barraclough@apple.com>
1477
1478 Reviewed by Oliver Hunt.
1479
1480 Fix for: <rdar://problem/6918095> REGRESSION: jQuery load() issue (25981),
1481 and also an ASSERT failure on http://ihasahotdog.com/.
1482
1483 When overwriting a property on a dictionary with a cached specific value,
1484 clear the cache if new value being written is different.
1485
1486 * JavaScriptCore.exp:
1487 Export the new symbols.
1488 * jit/JITStubs.cpp:
1489 (JSC::JITStubs::cti_op_get_by_id_method_check_second):
1490 Close dictionary prototypes upon caching a method access, as would happen when caching
1491 a regular get_by_id.
1492 * runtime/JSObject.h:
1493 (JSC::JSObject::propertyStorage):
1494 (JSC::JSObject::locationForOffset):
1495 Make these methods private.
1496 (JSC::JSObject::putDirectInternal):
1497 When overwriting a property on a dictionary with a cached specific value,
1498 clear the cache if new value being written is different.
1499 * runtime/Structure.cpp:
1500 (JSC::Structure::despecifyDictionaryFunction):
1501 Reset the specific value field for a given property in a dictionary.
1502 (JSC::Structure::despecifyFunctionTransition):
1503 Rename of 'changeFunctionTransition' (this was already internally refered to as a despecification).
1504 * runtime/Structure.h:
1505 Declare new method.
1506
1507 2009-05-26 Gavin Barraclough <barraclough@apple.com>
1508
1509 Reviewed by Oliver "pieces of eight" Hunt.
1510
1511 When reseting RegexPattern class, should fully reset the class, not just bits of it.
1512 In particular, we delete the cached character classes (for wordchars, etc), but do
1513 not reset the set of pointers to the cached classes. In the case of a repeated parse
1514 due to an illegal back-reference we will continue to use the deleted character class.
1515
1516 * yarr/RegexPattern.h:
1517 (JSC::Yarr::RegexPattern::reset):
1518
1519 2009-05-26 Brent Fulgham <bfulgham@webkit.org>
1520
1521 Build fix to correct r44161.
1522
1523 * wtf/FastAllocBase.h:
1524
1525 2009-05-26 Zoltan Horvath <horvath.zoltan.6@stud.u-szeged.hu>
1526
1527 Reviewed by Maciej Stachowiak.
1528
1529 Inherite HashTable from FastAllocBase, because it has been instantiated by
1530 'new' in JavaScriptCore/runtime/JSGlobalData.cpp.
1531
1532 * wtf/HashTable.h:
1533 * wtf/FastAllocBase.h: Remove 'wtf' path from TypeTraits.h to allow use outside of wtf.
1534
1535 2009-05-25 David Levin <levin@chromium.org>
1536
1537 Reviewed by Maciej Stachowiak and Oliver Hunt.
1538
1539 https://bugs.webkit.org/show_bug.cgi?id=25126
1540 Allow the buffer underlying UString to be shared.
1541
1542 In order to not grow the underlying size of any structure,
1543 there is a union in the Rep string which holds
1544 + m_sharedBuffer -- a pointer to the shared ref counted buffer
1545 if the class is BaseString and the buffer is being shared OR
1546 + m_baseString -- the BaseString if the class is only UString::Rep
1547 but not a UString::BaseString
1548
1549 Ideally, m_sharedBuffer would be a RefPtr, but it cannot be because
1550 it is in a union.
1551
1552 No change in sunspider perf.
1553
1554 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1555 * JavaScriptCore.xcodeproj/project.pbxproj:
1556 * runtime/UString.cpp:
1557 (JSC::UString::Rep::share):
1558 (JSC::UString::Rep::destroy):
1559 (JSC::UString::BaseString::sharedBuffer):
1560 (JSC::UString::BaseString::setSharedBuffer):
1561 (JSC::UString::BaseString::slowIsBufferReadOnly):
1562 (JSC::expandCapacity):
1563 (JSC::UString::Rep::reserveCapacity):
1564 (JSC::UString::expandPreCapacity):
1565 (JSC::concatenate):
1566 (JSC::UString::append):
1567 * runtime/UString.h:
1568 (JSC::UString::Rep::Rep):
1569 (JSC::UString::Rep::):
1570 (JSC::UString::BaseString::isShared):
1571 (JSC::UString::BaseString::isBufferReadOnly):
1572 (JSC::UString::Rep::baseString):
1573 * wtf/CrossThreadRefCounted.h:
1574 (WTF::CrossThreadRefCounted::isShared):
1575 * wtf/OwnFastMallocPtr.h: Added.
1576 (WTF::OwnFastMallocPtr::OwnFastMallocPtr):
1577 (WTF::OwnFastMallocPtr::~OwnFastMallocPtr):
1578 (WTF::OwnFastMallocPtr::get):
1579 (WTF::OwnFastMallocPtr::release):
1580
1581 2009-05-25 Oliver Hunt <oliver@apple.com>
1582
1583 Reviewed by Maciej Stachowiak.
1584
1585 Re-add interpreter logic to jit-enabled builds as GCC mysteriously regresses without it
1586
1587 * wtf/Platform.h:
1588
1589 2009-05-25 Fridrich Strba <fridrich.strba@bluewin.ch>
1590
1591 Reviewed by Maciej Stachowiak.
1592
1593 The functions written in assembly need to have a leading
1594 underscore on Windows too.
1595
1596 * jit/JITStubs.cpp:
1597
1598 2009-05-24 Steve Falkenburg <sfalken@apple.com>
1599
1600 Build fix for experimental PGO Windows target.
1601
1602 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1603
1604 2009-05-23 David Kilzer <ddkilzer@apple.com>
1605
1606 Part 1 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr
1607
1608 <https://bugs.webkit.org/show_bug.cgi?id=25495>
1609
1610 Reviewed by Oliver Hunt.
1611
1612 * GNUmakefile.am: Added OwnPtrCommon.h and PassOwnPtr.h.
1613 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
1614 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
1615
1616 * wtf/OwnPtr.h:
1617 (WTF::OwnPtr::OwnPtr): Added constructors that take a
1618 PassOwnPtr. Also added a copy constructor declaration that's
1619 required when assigning a PassOwnPtr to a stack-based OwnPtr.
1620 (WTF::operator=): Added assignment operator methods that take a
1621 PassOwnPtr.
1622 (WTF::swap): Reformatted.
1623 (WTF::operator==): Whitespace changes.
1624 (WTF::operator!=): Ditto.
1625
1626 * wtf/OwnPtrCommon.h: Added.
1627 (WTF::deleteOwnedPtr):
1628
1629 * wtf/PassOwnPtr.h: Added.
1630 (WTF::PassOwnPtr::PassOwnPtr):
1631 (WTF::PassOwnPtr::~PassOwnPtr):
1632 (WTF::PassOwnPtr::get):
1633 (WTF::PassOwnPtr::clear):
1634 (WTF::PassOwnPtr::release):
1635 (WTF::PassOwnPtr::operator*):
1636 (WTF::PassOwnPtr::operator->):
1637 (WTF::PassOwnPtr::operator!):
1638 (WTF::PassOwnPtr::operator UnspecifiedBoolType):
1639 (WTF::::operator):
1640 (WTF::operator==):
1641 (WTF::operator!=):
1642 (WTF::static_pointer_cast):
1643 (WTF::const_pointer_cast):
1644 (WTF::getPtr):
1645
1646 2009-05-23 Oliver Hunt <oliver@apple.com>
1647
1648 Reviewed by Maciej Stachowiak.
1649
1650 Remove interpreter specific logic from the JIT builds.
1651
1652 This saves ~100k in JSC release builds.
1653
1654 * interpreter/Interpreter.cpp:
1655 (JSC::Interpreter::privateExecute):
1656 * interpreter/Interpreter.h:
1657 * wtf/Platform.h:
1658
1659 2009-05-22 Mark Rowe <mrowe@apple.com>
1660
1661 Part two of an attempted Windows build fix.
1662
1663 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1664 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1665
1666 2009-05-22 Mark Rowe <mrowe@apple.com>
1667
1668 Part one of an attempted Windows build fix.
1669
1670 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1671 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
1672
1673 2009-05-21 Gavin Barraclough <barraclough@apple.com>
1674
1675 Reviewed by Geoff Garen.
1676
1677 op_method_check
1678
1679 Optimize method calls, by caching specific function values within the Structure.
1680 The new opcode is used almost like an x86 opcode prefix byte to optimize op_get_by_id,
1681 where the property access is being used to read a function to be passed to op-call (i.e.
1682 'foo.bar();'). This patch modifies the Structure class such that when a property is
1683 put to an object for the first time we will check if the value is a function. If it is,
1684 we will cache the function value on the Structure. A Structure in such a state guarantees
1685 that not only does a property with the given identifier exist on the object, but also that
1686 its value is unchanged. Upon any further attempt to put a property with the same identifier
1687 (but a different value) to the object, it will transition back to a normal Structure (where
1688 it will guarantee the presence but not the value of the property).
1689
1690 op_method_check makes use of the new information made available by the Structure, by
1691 augmenting the functionality of op_get_by_id. Upon generating a FunctionCallDotNode a
1692 check will be emitted prior to the property access reading the function value, and the JIT
1693 will generate an extra (initially unlinked but patchable) set of checks prior to the regular
1694 JIT code for get_by_id. The new code will do inline structure and prototype structure check
1695 (unlike a regular get_by_id, which can only handle 'self' accesses inline), and then performs
1696 an immediate load of the function value, rather than using memory accesses to load the value
1697 from the obejct's property storage array. If the method check fails it will revert, or if
1698 the access is polymorphic, the op_get_by_id will continue to operate - and optimize itself -
1699 just as any other regular op_get_by_id would.
1700
1701 ~2.5% on v8-tests, due to a ~9% progression on richards.
1702
1703 * API/JSCallbackObjectFunctions.h:
1704 (JSC::::put):
1705 (JSC::::staticFunctionGetter):
1706 * API/JSObjectRef.cpp:
1707 (JSObjectMakeConstructor):
1708 * JavaScriptCore.exp:
1709 * assembler/AbstractMacroAssembler.h:
1710 (JSC::AbstractMacroAssembler::differenceBetween):
1711 * assembler/MacroAssemblerX86.h:
1712 (JSC::MacroAssemblerX86::moveWithPatch):
1713 * bytecode/CodeBlock.cpp:
1714 (JSC::CodeBlock::dump):
1715 * bytecode/CodeBlock.h:
1716 (JSC::getMethodCallLinkInfoReturnLocation):
1717 (JSC::CodeBlock::getMethodCallLinkInfo):
1718 (JSC::CodeBlock::addMethodCallLinkInfos):
1719 (JSC::CodeBlock::methodCallLinkInfo):
1720 * bytecode/Opcode.h:
1721 * bytecompiler/BytecodeGenerator.cpp:
1722 (JSC::BytecodeGenerator::emitMethodCheck):
1723 * bytecompiler/BytecodeGenerator.h:
1724 * interpreter/Interpreter.cpp:
1725 (JSC::Interpreter::privateExecute):
1726 * jit/JIT.cpp:
1727 (JSC::JIT::privateCompileMainPass):
1728 (JSC::JIT::privateCompileSlowCases):
1729 (JSC::JIT::privateCompile):
1730 * jit/JIT.h:
1731 (JSC::MethodCallCompilationInfo::MethodCallCompilationInfo):
1732 * jit/JITOpcodes.cpp:
1733 * jit/JITPropertyAccess.cpp:
1734 (JSC::JIT::emit_op_method_check):
1735 (JSC::JIT::emitSlow_op_method_check):
1736 (JSC::JIT::emit_op_get_by_id):
1737 (JSC::JIT::emitSlow_op_get_by_id):
1738 (JSC::JIT::emit_op_put_by_id):
1739 (JSC::JIT::emitSlow_op_put_by_id):
1740 (JSC::JIT::compileGetByIdHotPath):
1741 (JSC::JIT::compileGetByIdSlowCase):
1742 (JSC::JIT::patchMethodCallProto):
1743 * jit/JITStubs.cpp:
1744 (JSC::JITStubs::cti_op_get_by_id_method_check):
1745 (JSC::JITStubs::cti_op_get_by_id_method_check_second):
1746 * jit/JITStubs.h:
1747 * jsc.cpp:
1748 (GlobalObject::GlobalObject):
1749 * parser/Nodes.cpp:
1750 (JSC::FunctionCallDotNode::emitBytecode):
1751 * runtime/Arguments.cpp:
1752 (JSC::Arguments::put):
1753 * runtime/ArrayConstructor.cpp:
1754 (JSC::ArrayConstructor::ArrayConstructor):
1755 * runtime/BooleanConstructor.cpp:
1756 (JSC::BooleanConstructor::BooleanConstructor):
1757 * runtime/DateConstructor.cpp:
1758 (JSC::DateConstructor::DateConstructor):
1759 * runtime/ErrorConstructor.cpp:
1760 (JSC::ErrorConstructor::ErrorConstructor):
1761 (JSC::constructError):
1762 * runtime/ErrorPrototype.cpp:
1763 (JSC::ErrorPrototype::ErrorPrototype):
1764 * runtime/FunctionConstructor.cpp:
1765 (JSC::FunctionConstructor::FunctionConstructor):
1766 * runtime/FunctionPrototype.cpp:
1767 (JSC::FunctionPrototype::FunctionPrototype):
1768 * runtime/InternalFunction.cpp:
1769 (JSC::InternalFunction::InternalFunction):
1770 * runtime/JSActivation.cpp:
1771 (JSC::JSActivation::put):
1772 (JSC::JSActivation::putWithAttributes):
1773 * runtime/JSByteArray.cpp:
1774 (JSC::JSByteArray::JSByteArray):
1775 * runtime/JSFunction.cpp:
1776 (JSC::JSFunction::JSFunction):
1777 (JSC::JSFunction::getOwnPropertySlot):
1778 * runtime/JSGlobalObject.cpp:
1779 (JSC::JSGlobalObject::putWithAttributes):
1780 (JSC::JSGlobalObject::reset):
1781 (JSC::JSGlobalObject::mark):
1782 * runtime/JSGlobalObject.h:
1783 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
1784 (JSC::JSGlobalObject::methodCallDummy):
1785 * runtime/JSObject.cpp:
1786 (JSC::JSObject::put):
1787 (JSC::JSObject::putWithAttributes):
1788 (JSC::JSObject::deleteProperty):
1789 (JSC::JSObject::defineGetter):
1790 (JSC::JSObject::defineSetter):
1791 (JSC::JSObject::getPropertyAttributes):
1792 (JSC::JSObject::getPropertySpecificFunction):
1793 (JSC::JSObject::putDirectFunction):
1794 (JSC::JSObject::putDirectFunctionWithoutTransition):
1795 * runtime/JSObject.h:
1796 (JSC::getJSFunction):
1797 (JSC::JSObject::getDirectLocation):
1798 (JSC::JSObject::putDirect):
1799 (JSC::JSObject::putDirectWithoutTransition):
1800 * runtime/LiteralParser.cpp:
1801 (JSC::LiteralParser::parseObject):
1802 * runtime/Lookup.cpp:
1803 (JSC::setUpStaticFunctionSlot):
1804 * runtime/Lookup.h:
1805 (JSC::lookupPut):
1806 * runtime/MathObject.cpp:
1807 (JSC::MathObject::MathObject):
1808 * runtime/NativeErrorConstructor.cpp:
1809 (JSC::NativeErrorConstructor::NativeErrorConstructor):
1810 (JSC::NativeErrorConstructor::construct):
1811 * runtime/NativeErrorPrototype.cpp:
1812 (JSC::NativeErrorPrototype::NativeErrorPrototype):
1813 * runtime/NumberConstructor.cpp:
1814 (JSC::NumberConstructor::NumberConstructor):
1815 * runtime/ObjectConstructor.cpp:
1816 (JSC::ObjectConstructor::ObjectConstructor):
1817 * runtime/PropertyMapHashTable.h:
1818 (JSC::PropertyMapEntry::PropertyMapEntry):
1819 * runtime/PrototypeFunction.cpp:
1820 (JSC::PrototypeFunction::PrototypeFunction):
1821 * runtime/PutPropertySlot.h:
1822 (JSC::PutPropertySlot::):
1823 (JSC::PutPropertySlot::PutPropertySlot):
1824 (JSC::PutPropertySlot::setNewProperty):
1825 (JSC::PutPropertySlot::setDespecifyFunctionProperty):
1826 (JSC::PutPropertySlot::isCacheable):
1827 (JSC::PutPropertySlot::cachedOffset):
1828 * runtime/RegExpConstructor.cpp:
1829 (JSC::RegExpConstructor::RegExpConstructor):
1830 * runtime/StringConstructor.cpp:
1831 (JSC::StringConstructor::StringConstructor):
1832 * runtime/StringPrototype.cpp:
1833 (JSC::StringPrototype::StringPrototype):
1834 * runtime/Structure.cpp:
1835 (JSC::Structure::Structure):
1836 (JSC::Structure::~Structure):
1837 (JSC::Structure::materializePropertyMap):
1838 (JSC::Structure::addPropertyTransitionToExistingStructure):
1839 (JSC::Structure::addPropertyTransition):
1840 (JSC::Structure::changeFunctionTransition):
1841 (JSC::Structure::addPropertyWithoutTransition):
1842 (JSC::Structure::get):
1843 (JSC::Structure::despecifyFunction):
1844 (JSC::Structure::put):
1845 (JSC::Structure::remove):
1846 * runtime/Structure.h:
1847 (JSC::Structure::get):
1848 (JSC::Structure::specificFunction):
1849 * runtime/StructureTransitionTable.h:
1850 (JSC::StructureTransitionTableHashTraits::emptyValue):
1851 * wtf/Platform.h:
1852
1853 2009-05-22 Brent Fulgham <bfulgham@webkit.org>
1854
1855 Reviewed by Steve Falkenburg.
1856
1857 https://bugs.webkit.org/show_bug.cgi?id=25950
1858 JavaScriptCore Fails to build on Windows (Cairo) due to CoreFoundation
1859 link requirement.
1860
1861 Modify project to add new Debug_CFLite and Release_CFLite targets. These
1862 use the new JavaScriptCoreCFLite.vsprops to link against CFLite.dll.
1863 Existing projects are changed to use the new JavaScriptCoreCF.vsprops
1864 to link against CoreFoundation.dll.
1865
1866 The JavaScriptCoreCommon.vsprops is modified to remove the link
1867 against CoreFoundation.dll.
1868
1869 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1870 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCF.vsprops: Added.
1871 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops: Added.
1872 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
1873
1874 2009-05-22 Dominik Röttsches <dominik.roettsches@access-company.com>
1875
1876 Reviewed by Gustavo Noronha.
1877
1878 https://bugs.webkit.org/show_bug.cgi?id=15914
1879 [GTK] Implement Unicode functionality using GLib
1880
1881 Original patch by Jürg Billeter and Naiem Shaik.
1882 Implementing WTF Unicode functionality based on GLib.
1883
1884 * GNUmakefile.am:
1885 * wtf/unicode/Unicode.h:
1886 * wtf/unicode/glib: Added.
1887 * wtf/unicode/glib/UnicodeGLib.cpp: Added.
1888 (WTF::Unicode::foldCase):
1889 (WTF::Unicode::toLower):
1890 (WTF::Unicode::toUpper):
1891 (WTF::Unicode::direction):
1892 (WTF::Unicode::umemcasecmp):
1893 * wtf/unicode/glib/UnicodeGLib.h: Added.
1894 (WTF::Unicode::):
1895 (WTF::Unicode::toLower):
1896 (WTF::Unicode::toUpper):
1897 (WTF::Unicode::toTitleCase):
1898 (WTF::Unicode::isArabicChar):
1899 (WTF::Unicode::isFormatChar):
1900 (WTF::Unicode::isSeparatorSpace):
1901 (WTF::Unicode::isPrintableChar):
1902 (WTF::Unicode::isDigit):
1903 (WTF::Unicode::isPunct):
1904 (WTF::Unicode::mirroredChar):
1905 (WTF::Unicode::category):
1906 (WTF::Unicode::isLower):
1907 (WTF::Unicode::digitValue):
1908 (WTF::Unicode::combiningClass):
1909 (WTF::Unicode::decompositionType):
1910 * wtf/unicode/glib/UnicodeMacrosFromICU.h: Added.
1911
1912 2009-05-21 Xan Lopez <xlopez@igalia.com>
1913
1914 Unreviewed build fix.
1915
1916 Add MacroAssemblerCodeRef.h to file list.
1917
1918 * GNUmakefile.am:
1919
1920 2009-05-21 Gavin Barraclough <barraclough@apple.com>
1921
1922 Reviewed by Darin Adler.
1923 Addition of MacroAssemblerCodeRef.h rubber stamped by Geoff Garen.
1924
1925 Refactor JIT code-handle objects. The representation of generated code is currently
1926 a bit of a mess. We have a class JITCode which wraps the pointer to a block of
1927 generated code, but this object does not reference the executable pool meaning that
1928 external events (the pool being derefed) could make the pointer become invalid.
1929 To overcome this both the JIT and Yarr implement further (and similar) objects to
1930 wrap the code pointer with a RefPtr to the pool. To add to the mire, as well as the
1931 CodeBlock containing a handle onto the code the FunctionBodyNode also contains a
1932 copy of the code pointer which is used almost (but not entirely) uniquely to access
1933 the JIT code for a function.
1934
1935 Rationalization of all this:
1936
1937 * Add a new type 'MacroAssembler::CodeRef' as a handle for a block of JIT generated code.
1938 * Change the JIT & Yarr to internally handle code using CodeRefs.
1939 * Move the CodeRef (formerly anow defunct JITCodeRef) from CodeBlock to its owner node.
1940 * Remove the (now) redundant code pointer from FunctionBodyNode.
1941
1942 While tidying this up I've made the PatchBuffer return code in new allocations using a CodeRef,
1943 and have enforced an interface that the PatchBuffer will always be used, and 'finalizeCode()' or
1944 'finalizeCodeAddendum()' will always be called exactly once on the PatchBuffer to complete code generation.
1945
1946 This gives us a potentially useful hook ('PatchBuffer::performFinalization()') at the end of generation,
1947 which may have a number of uses. It may be helpful should we wish to switch our generation
1948 model to allow RW/RX exclusive memory, and it may be useful on non-cache-coherent platforms to
1949 give us an oportunity to cache flush as necessary.
1950
1951 No performance impact.
1952
1953 * assembler/AbstractMacroAssembler.h:
1954 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToTrampoline):
1955 (JSC::AbstractMacroAssembler::CodeRef::CodeRef):
1956 (JSC::AbstractMacroAssembler::CodeRef::trampolineAt):
1957 (JSC::AbstractMacroAssembler::PatchBuffer::PatchBuffer):
1958 (JSC::AbstractMacroAssembler::PatchBuffer::~PatchBuffer):
1959 (JSC::AbstractMacroAssembler::PatchBuffer::link):
1960 (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
1961 (JSC::AbstractMacroAssembler::PatchBuffer::patch):
1962 (JSC::AbstractMacroAssembler::PatchBuffer::complete):
1963 (JSC::AbstractMacroAssembler::PatchBuffer::finalize):
1964 (JSC::AbstractMacroAssembler::PatchBuffer::entry):
1965 * bytecode/CodeBlock.cpp:
1966 (JSC::CodeBlock::CodeBlock):
1967 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
1968 (JSC::CodeBlock::setJITCode):
1969 * bytecode/CodeBlock.h:
1970 (JSC::CodeBlock::getBytecodeIndex):
1971 (JSC::CodeBlock::executablePool):
1972 * interpreter/CallFrameClosure.h:
1973 * interpreter/Interpreter.cpp:
1974 (JSC::Interpreter::execute):
1975 (JSC::Interpreter::prepareForRepeatCall):
1976 * jit/JIT.cpp:
1977 (JSC::JIT::privateCompile):
1978 (JSC::JIT::privateCompileCTIMachineTrampolines):
1979 (JSC::JIT::linkCall):
1980 * jit/JIT.h:
1981 * jit/JITCode.h:
1982 (JSC::JITCode::JITCode):
1983 (JSC::JITCode::operator bool):
1984 (JSC::JITCode::addressForCall):
1985 (JSC::JITCode::offsetOf):
1986 (JSC::JITCode::execute):
1987 (JSC::JITCode::size):
1988 (JSC::JITCode::executablePool):
1989 (JSC::JITCode::HostFunction):
1990 * jit/JITPropertyAccess.cpp:
1991 (JSC::JIT::privateCompilePutByIdTransition):
1992 (JSC::JIT::privateCompilePatchGetArrayLength):
1993 (JSC::JIT::privateCompileGetByIdProto):
1994 (JSC::JIT::privateCompileGetByIdSelfList):
1995 (JSC::JIT::privateCompileGetByIdProtoList):
1996 (JSC::JIT::privateCompileGetByIdChainList):
1997 (JSC::JIT::privateCompileGetByIdChain):
1998 * jit/JITStubs.cpp:
1999 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
2000 (JSC::JITStubs::cti_vm_lazyLinkCall):
2001 * parser/Nodes.cpp:
2002 (JSC::ProgramNode::generateJITCode):
2003 (JSC::EvalNode::generateJITCode):
2004 (JSC::FunctionBodyNode::FunctionBodyNode):
2005 (JSC::FunctionBodyNode::createNativeThunk):
2006 (JSC::FunctionBodyNode::generateJITCode):
2007 * parser/Nodes.h:
2008 (JSC::ScopeNode::generatedJITCode):
2009 (JSC::ScopeNode::getExecutablePool):
2010 (JSC::ScopeNode::setJITCode):
2011 (JSC::ProgramNode::jitCode):
2012 (JSC::EvalNode::jitCode):
2013 (JSC::FunctionBodyNode::jitCode):
2014 * runtime/RegExp.cpp:
2015 (JSC::RegExp::match):
2016 * yarr/RegexJIT.cpp:
2017 (JSC::Yarr::RegexGenerator::compile):
2018 (JSC::Yarr::jitCompileRegex):
2019 (JSC::Yarr::executeRegex):
2020 * yarr/RegexJIT.h:
2021 (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
2022 (JSC::Yarr::RegexCodeBlock::pcreFallback):
2023 (JSC::Yarr::RegexCodeBlock::setFallback):
2024 (JSC::Yarr::RegexCodeBlock::operator bool):
2025 (JSC::Yarr::RegexCodeBlock::set):
2026 (JSC::Yarr::RegexCodeBlock::execute):
2027
2028 2009-05-21 Oliver Hunt <oliver@apple.com>
2029
2030 Reviewed by Maciej Stachowiak.
2031
2032 <rdar://problem/6910264> REGRESSION: Cached DOM global object property access fails in browser (25921)
2033 <https://bugs.webkit.org/show_bug.cgi?id=25921>
2034
2035 When caching properties on the global object we need to ensure that we're
2036 not attempting to cache through a shell object.
2037
2038 * interpreter/Interpreter.cpp:
2039 (JSC::Interpreter::resolveGlobal):
2040 * jit/JITStubs.cpp:
2041 (JSC::JITStubs::cti_op_resolve_global):
2042
2043 2009-05-21 Steve Falkenburg <sfalken@apple.com>
2044
2045 Windows build fix.
2046
2047 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
2048
2049 2009-05-21 Cameron Zwarich <zwarich@apple.com>
2050
2051 Reviewed by Mark Rowe.
2052
2053 Bug 25945: Add support for MADV_FREE to TCMalloc
2054 <https://bugs.webkit.org/show_bug.cgi?id=25945>
2055 <rdar://problem/6910754>
2056
2057 Add support for MADV_FREE to TCMalloc_SystemRelease for platforms that
2058 don't also support MADV_FREE_REUSE. The code is identical to the MADV_DONTNEED
2059 case except for the advice passed to madvise(), so combining the two cases
2060 makes the most sense.
2061
2062 * wtf/Platform.h: Only define HAVE_MADV_FREE when not building on Tiger or
2063 Leopard, because while it is defined on these platforms it actually does
2064 nothing.
2065 * wtf/TCSystemAlloc.cpp:
2066 (TCMalloc_SystemRelease): use MADV_FREE if it is available; otherwise use
2067 MADV_DONTNEED.
2068
2069 2009-05-21 Mark Rowe <mrowe@apple.com>
2070
2071 Reviewed by Oliver Hunt.
2072
2073 Fix <https://bugs.webkit.org/show_bug.cgi?id=25917> / <rdar://problem/6910066>.
2074 Bug 25917: REGRESSION (r43559?): Javascript debugger crashes when pausing page
2075
2076 The debugger currently retrieves the arguments object from an activation rather than pulling
2077 it from a call frame. This is unreliable to due to the recent optimization to lazily create
2078 the arguments object. In the long-term it should stop doing that (<rdar://problem/6911886>),
2079 but for now we force eager creation of the arguments object when debugging.
2080
2081 * bytecompiler/BytecodeGenerator.cpp:
2082 (JSC::BytecodeGenerator::BytecodeGenerator):
2083
2084 2009-05-21 Cameron Zwarich <zwarich@apple.com>
2085
2086 Reviewed by Maciej Stachowiak.
2087
2088 Bug 25912: Harden NumberPrototype.cpp by removing use of strcpy()
2089 <https://bugs.webkit.org/show_bug.cgi?id=25912>
2090
2091 This causes no change on SunSpider.
2092
2093 * runtime/NumberPrototype.cpp:
2094 (JSC::integerPartNoExp): replace strcpy() with memcpy(), ASSERT that the
2095 temporary buffer has sufficient space to store the result, and move the
2096 explicit null-termination closer to the memcpy() for easier visual inspection
2097 of the code.
2098 (JSC::fractionalPartToString): replace strcpy() with memcpy(), and ASSERT
2099 that the temporary buffer has sufficient space to store the result. There
2100 is no explicit null-termination because this is done by the caller. The
2101 same is already true for exponentialPartToString().
2102 (JSC::numberProtoFuncToExponential): replace strcpy() with memcpy(), explicitly
2103 null-terminate the result, and ASSERT that the temporary buffer has sufficient
2104 space to store the result.
2105
2106 2009-05-20 Sam Weinig <sam@webkit.org>
2107
2108 Reviewed by Cameron Zwarich.
2109
2110 Cleanup the JSGlobalData when exiting early with the usage statement in jsc.
2111
2112 * jsc.cpp:
2113 (printUsageStatement):
2114 (parseArguments):
2115 (jscmain):
2116
2117 2009-05-20 Stephanie Lewis <slewis@apple.com>
2118
2119 Update the order files. <rdar://problem/6881750> Generate new order files.
2120
2121 * JavaScriptCore.order:
2122
2123 2009-05-19 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
2124
2125 Reviewed by Simon Hausmann.
2126
2127 Replace WREC with YARR + YARR_JIT for the Qt port. This is only
2128 used when compiled with JIT support for now, so it is a drop-in
2129 replacement for the WREC usage. Still including the wrec headers
2130 as they are being referred from RegExp.h, though the contents of
2131 that header it protected by "#if ENABLE(WREC)".
2132
2133 * JavaScriptCore.pri:
2134
2135 2009-05-20 Xan Lopez <xlopez@igalia.com>
2136
2137 Reviewed by Eric Seidel.
2138
2139 Fix GTK debug build.
2140
2141 The function dumpDisjunction, compiled with debug enabled, uses
2142 printf, which needs stdio.h to be included.
2143
2144 * yarr/RegexInterpreter.cpp:
2145
2146 2009-05-20 Laszlo Gombos <laszlo.1.gombos@nokia.com>
2147
2148 Reviewed by George Staikos.
2149
2150 BUG 25843: [Qt] Remove qt-port build flag
2151 <https://bugs.webkit.org/show_bug.cgi?id=25843>
2152
2153 * JavaScriptCore.pro:
2154
2155
2156 2009-05-19 Geoffrey Garen <ggaren@apple.com>
2157
2158 Windows build fix.
2159
2160 * interpreter/RegisterFile.cpp:
2161 (JSC::RegisterFile::releaseExcessCapacity): Copy-paste typo.
2162
2163 2009-05-19 Geoffrey Garen <ggaren@apple.com>
2164
2165 Reviewed by Sam Weinig.
2166
2167 Fixed <rdar://problem/6885680> CrashTracer: [USER] 1 crash in Install
2168 Mac OS X at <unknown binary> • 0x9274241c
2169
2170 (Original patch by Joe Sokol and Ronnie Misra.)
2171
2172 SunSpider says 1.004x faster.
2173
2174 * interpreter/RegisterFile.cpp:
2175 (JSC::RegisterFile::releaseExcessCapacity): Instead of doing complicated
2176 math that sometimes used to overflow, just release the full range of the
2177 register file.
2178
2179 * interpreter/RegisterFile.h:
2180 (JSC::isPageAligned):
2181 (JSC::RegisterFile::RegisterFile): Added ASSERTs to verify that it's
2182 safe to release the full range of the register file.
2183
2184 (JSC::RegisterFile::shrink): No need to releaseExcessCapacity() if the
2185 new end is not smaller than the old end. (Also, doing so used to cause
2186 numeric overflow, unmapping basically the whole process from memory.)
2187
2188 2009-05-19 Oliver Hunt <oliver@apple.com>
2189
2190 RS=Mark Rowe.
2191
2192 <rdar://problem/6888393> REGRESSION: Start Debugging JavaScript crashes browser (nightly builds only?)
2193 <https://bugs.webkit.org/show_bug.cgi?id=25717>
2194
2195 Remove JSC_FAST_CALL as it wasn't gaining us anything, and was
2196 resulting in weird bugs in the nightly builds.
2197
2198 * parser/Nodes.cpp:
2199 * parser/Nodes.h:
2200 (JSC::ExpressionNode::isNumber):
2201 (JSC::ExpressionNode::isString):
2202 (JSC::ExpressionNode::isNull):
2203 (JSC::ExpressionNode::isPure):
2204 (JSC::ExpressionNode::isLocation):
2205 (JSC::ExpressionNode::isResolveNode):
2206 (JSC::ExpressionNode::isBracketAccessorNode):
2207 (JSC::ExpressionNode::isDotAccessorNode):
2208 (JSC::ExpressionNode::isFuncExprNode):
2209 (JSC::ExpressionNode::isSimpleArray):
2210 (JSC::ExpressionNode::isAdd):
2211 (JSC::ExpressionNode::resultDescriptor):
2212 (JSC::StatementNode::firstLine):
2213 (JSC::StatementNode::lastLine):
2214 (JSC::StatementNode::isEmptyStatement):
2215 (JSC::StatementNode::isReturnNode):
2216 (JSC::StatementNode::isExprStatement):
2217 (JSC::StatementNode::isBlock):
2218 (JSC::NullNode::isNull):
2219 (JSC::BooleanNode::isPure):
2220 (JSC::NumberNode::value):
2221 (JSC::NumberNode::setValue):
2222 (JSC::NumberNode::isNumber):
2223 (JSC::NumberNode::isPure):
2224 (JSC::StringNode::isPure):
2225 (JSC::StringNode::isString):
2226 (JSC::ResolveNode::identifier):
2227 (JSC::ResolveNode::isLocation):
2228 (JSC::ResolveNode::isResolveNode):
2229 (JSC::BracketAccessorNode::isLocation):
2230 (JSC::BracketAccessorNode::isBracketAccessorNode):
2231 (JSC::DotAccessorNode::base):
2232 (JSC::DotAccessorNode::identifier):
2233 (JSC::DotAccessorNode::isLocation):
2234 (JSC::DotAccessorNode::isDotAccessorNode):
2235 (JSC::TypeOfResolveNode::identifier):
2236 (JSC::AddNode::isAdd):
2237 (JSC::BlockNode::isBlock):
2238 (JSC::EmptyStatementNode::isEmptyStatement):
2239 (JSC::ExprStatementNode::isExprStatement):
2240 (JSC::ReturnNode::isReturnNode):
2241 (JSC::ScopeNode::sourceURL):
2242 (JSC::ProgramNode::bytecode):
2243 (JSC::EvalNode::bytecode):
2244 (JSC::FunctionBodyNode::parameters):
2245 (JSC::FunctionBodyNode::toSourceString):
2246 (JSC::FunctionBodyNode::bytecode):
2247 (JSC::FuncExprNode::isFuncExprNode):
2248
2249 2009-05-19 Maciej Stachowiak <mjs@apple.com>
2250
2251 Reviewed by Gavin Barraclough.
2252
2253 - speed up string comparison, especially for short strings
2254
2255 ~1% on SunSpider
2256
2257 * JavaScriptCore.exp:
2258 * runtime/UString.cpp:
2259 * runtime/UString.h:
2260 (JSC::operator==): Inline UString's operator==, since it is called from
2261 hot places in the runtime. Also, specialize 2-char strings in a similar way to
2262 1-char, since we're taking the hit of a switch anyway.
2263
2264 2009-05-18 Maciej Stachowiak <mjs@apple.com>
2265
2266 Reviewed by Gavin Barraclough.
2267
2268 - for polymorphic prototype lookups, increase the number of slots from 4 to 8
2269
2270 ~4% faster on v8 raytrace benchmark
2271
2272 * bytecode/Instruction.h:
2273
2274 2009-05-18 Maciej Stachowiak <mjs@apple.com>
2275
2276 Reviewed by Oliver Hunt.
2277
2278 - tighten up the code for the load_varargs stub
2279
2280 ~1-2% on v8-raytrace
2281
2282 * jit/JITStubs.cpp:
2283 (JSC::JITStubs::cti_op_load_varargs): Hoist some loop invariants that
2284 the compiler didn't feel like hoisting for us. Remove unneeded exception check.
2285
2286 2009-05-18 Maciej Stachowiak <mjs@apple.com>
2287
2288 Reviewed by Geoff Garen.
2289
2290 - Improve code generation for access to prototype properties
2291
2292 ~0.4% speedup on SunSpider.
2293
2294 Based on a suggestion from Geoff Garen.
2295
2296 * jit/JIT.h:
2297 * jit/JITPropertyAccess.cpp:
2298 (JSC::JIT::compileGetDirectOffset):
2299 (JSC::JIT::privateCompileGetByIdProto):
2300 (JSC::JIT::privateCompileGetByIdProtoList):
2301 (JSC::JIT::privateCompileGetByIdChainList):
2302 (JSC::JIT::privateCompileGetByIdChain):
2303
2304 2009-05-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
2305
2306 Reviewed by Gavin Barraclough.
2307
2308 Enable YARR, and disable WREC for GTK+.
2309
2310 * GNUmakefile.am:
2311 * yarr/RegexParser.h:
2312
2313 2009-05-18 Jan Michael Alonzo <jmalonzo@webkit.org>
2314
2315 Reviewed by Xan Lopez.
2316
2317 [Gtk] Various autotools build refactoring and fixes
2318 https://bugs.webkit.org/show_bug.cgi?id=25286
2319
2320 Add -no-install and -no-fast-install to programs and tests that we
2321 don't install. Also remove -O2 since this is already handled at
2322 configure time.
2323
2324 * GNUmakefile.am:
2325
2326 2009-05-17 Jan Michael Alonzo <jmalonzo@webkit.org>
2327
2328 Reviewed by Xan Lopez.
2329
2330 [Gtk] Various autotools build refactoring and fixes
2331 https://bugs.webkit.org/show_bug.cgi?id=25286
2332
2333 Add JavaScriptCore/ to JSC include path only since it's not
2334 required when building WebCore.
2335
2336 * GNUmakefile.am:
2337
2338 2009-05-17 Steve Falkenburg <sfalken@apple.com>
2339
2340 Windows build fix
2341
2342 * JavaScriptCore.vcproj/JavaScriptCore.make:
2343 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2344
2345 2009-05-15 Gavin Barraclough <barraclough@apple.com>
2346
2347 Reviewed by Oliver Hunt.
2348
2349 Looking like MSVC doesn't like static variables in inline methods?
2350 Make the state of the SSE2 check a static variable on the class
2351 MacroAssemblerX86Common as a speculative build fix for Windows.
2352
2353 * assembler/MacroAssemblerX86Common.h:
2354 (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
2355 (JSC::MacroAssemblerX86Common::branchDouble):
2356 (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
2357 (JSC::MacroAssemblerX86Common::isSSE2Present):
2358 (JSC::MacroAssemblerX86Common::):
2359 * jit/JIT.cpp:
2360
2361 2009-05-15 Adam Roben <aroben@apple.com>
2362
2363 Add some assembler headers to JavaScriptCore.vcproj
2364
2365 This is just a convenience for Windows developers.
2366
2367 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2368
2369 2009-05-15 Gavin Barraclough <barraclough@apple.com>
2370
2371 Reviewed by Oliver Hunt.
2372
2373 Add FP support to the MacroAssembler, port JITArithmetic over to make use of this. Also add
2374 API to determine whether FP support is available 'MacroAssembler::supportsFloatingPoint()',
2375 FP is presently only supported on SSE2 platforms, not x87. On platforms where a suitable
2376 hardware FPU is not available 'supportsFloatingPoint()' may simply return false, and all
2377 other methods ASSERT_NOT_REACHED().
2378
2379 * assembler/AbstractMacroAssembler.h:
2380 * assembler/MacroAssemblerX86.h:
2381 (JSC::MacroAssemblerX86::MacroAssemblerX86):
2382 (JSC::MacroAssemblerX86::branch32):
2383 (JSC::MacroAssemblerX86::branchPtrWithPatch):
2384 (JSC::MacroAssemblerX86::supportsFloatingPoint):
2385 * assembler/MacroAssemblerX86Common.h:
2386 (JSC::MacroAssemblerX86Common::):
2387 (JSC::MacroAssemblerX86Common::loadDouble):
2388 (JSC::MacroAssemblerX86Common::storeDouble):
2389 (JSC::MacroAssemblerX86Common::addDouble):
2390 (JSC::MacroAssemblerX86Common::subDouble):
2391 (JSC::MacroAssemblerX86Common::mulDouble):
2392 (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
2393 (JSC::MacroAssemblerX86Common::branchDouble):
2394 (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
2395 (JSC::MacroAssemblerX86Common::branch32):
2396 (JSC::MacroAssemblerX86Common::branch16):
2397 (JSC::MacroAssemblerX86Common::branchTest32):
2398 (JSC::MacroAssemblerX86Common::branchAdd32):
2399 (JSC::MacroAssemblerX86Common::branchMul32):
2400 (JSC::MacroAssemblerX86Common::branchSub32):
2401 (JSC::MacroAssemblerX86Common::set32):
2402 (JSC::MacroAssemblerX86Common::setTest32):
2403 (JSC::MacroAssemblerX86Common::x86Condition):
2404 (JSC::MacroAssemblerX86Common::isSSE2Present):
2405 * assembler/MacroAssemblerX86_64.h:
2406 (JSC::MacroAssemblerX86_64::movePtrToDouble):
2407 (JSC::MacroAssemblerX86_64::moveDoubleToPtr):
2408 (JSC::MacroAssemblerX86_64::setPtr):
2409 (JSC::MacroAssemblerX86_64::branchPtr):
2410 (JSC::MacroAssemblerX86_64::branchTestPtr):
2411 (JSC::MacroAssemblerX86_64::branchAddPtr):
2412 (JSC::MacroAssemblerX86_64::branchSubPtr):
2413 (JSC::MacroAssemblerX86_64::supportsFloatingPoint):
2414 * assembler/X86Assembler.h:
2415 * jit/JIT.cpp:
2416 (JSC::JIT::JIT):
2417 * jit/JIT.h:
2418 * jit/JITArithmetic.cpp:
2419 (JSC::JIT::emit_op_rshift):
2420 (JSC::JIT::emitSlow_op_rshift):
2421 (JSC::JIT::emitSlow_op_jnless):
2422 (JSC::JIT::emitSlow_op_jnlesseq):
2423 (JSC::JIT::compileBinaryArithOp):
2424 (JSC::JIT::compileBinaryArithOpSlowCase):
2425 (JSC::JIT::emit_op_add):
2426 (JSC::JIT::emitSlow_op_add):
2427 (JSC::JIT::emit_op_mul):
2428 (JSC::JIT::emitSlow_op_mul):
2429 * jit/JITPropertyAccess.cpp:
2430 (JSC::JIT::privateCompilePutByIdTransition):
2431
2432 2009-05-15 Francisco Tolmasky <francisco@280north.com>
2433
2434 BUG 25467: JavaScript debugger should use function.displayName as the function's name in the call stack
2435 <https://bugs.webkit.org/show_bug.cgi?id=25467>
2436
2437 Reviewed by Adam Roben.
2438
2439 * JavaScriptCore.exp: Added calculatedFunctionName
2440 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Added calculatedFunctionName
2441 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added calculatedFunctionName
2442 * debugger/DebuggerCallFrame.cpp: Added calculatedFunctionName to match existing one in ProfileNode.
2443 (JSC::DebuggerCallFrame::calculatedFunctionName):
2444 * debugger/DebuggerCallFrame.h: Added calculatedFunctionName to match existing one in ProfileNode.
2445
2446 2009-05-14 Gavin Barraclough <barraclough@apple.com>
2447
2448 Build fix, not reviewed.
2449
2450 Quick fixes for JIT builds with OPTIMIZE flags disabled.
2451
2452 * jit/JITCall.cpp:
2453 (JSC::JIT::compileOpCall):
2454 (JSC::JIT::compileOpCallSlowCase):
2455 * jit/JITPropertyAccess.cpp:
2456 (JSC::JIT::compilePutByIdHotPath):
2457
2458 2009-05-14 Steve Falkenburg <sfalken@apple.com>
2459
2460 Back out incorrect Windows build fix
2461
2462 * JavaScriptCore.vcproj/JavaScriptCore.make:
2463 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2464
2465 2009-05-14 Steve Falkenburg <sfalken@apple.com>
2466
2467 Windows build fix
2468
2469 * JavaScriptCore.vcproj/JavaScriptCore.make:
2470 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2471
2472 2009-05-14 Adam Roben <aroben@apple.com>
2473
2474 Windows jsc build fix
2475
2476 r43648 modified jsc.vcproj's post-build event not to try to copy files
2477 that aren't present. Then r43661 mistakenly un-did that modification.
2478 This patch restores the modification from r43648, but puts the code in
2479 jscCommon.vsprops (where it should have been added in r43648).
2480
2481 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Restored empty
2482 VCPostBuildEventTool tags.
2483 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Modified the post-build
2484 event command line to match the one in jsc.vcproj from r43648.
2485
2486 2009-05-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
2487
2488 Reviewed by Darin Adler.
2489
2490 https://bugs.webkit.org/show_bug.cgi?id=25325
2491
2492 Make sure pthread_self() is declared before it gets called in Collector.cpp
2493
2494 * runtime/Collector.cpp: Include pthread.h in most Unix-like platforms
2495 (not just for OPENBSD)
2496
2497 2009-05-14 Mark Rowe <mrowe@apple.com>
2498
2499 Reviewed by Oliver Hunt.
2500
2501 Fix <https://bugs.webkit.org/show_bug.cgi?id=25785>.
2502 Bug 25785: Segfault in mark when using JSObjectMakeConstructor
2503
2504 * API/JSObjectRef.cpp:
2505 (JSObjectMakeConstructor): OpaqueJSClass::prototype can return 0. We need to use the default object prototype when it does.
2506 * API/tests/testapi.c:
2507 (main): Add a test case.
2508 * runtime/JSObject.h:
2509 (JSC::JSObject::putDirect): Add a clearer assertion for a null value. The assertion on the next line does catch this,
2510 but the cause of the failure is not clear from the assertion itself.
2511
2512 2009-05-14 Mark Rowe <mrowe@apple.com>
2513
2514 Rubber-stamped by Darin Adler.
2515
2516 <rdar://problem/6681868> When building with Xcode 3.1.3 should be using gcc 4.2
2517
2518 The meaning of XCODE_VERSION_ACTUAL is more sensible in newer versions of Xcode.
2519 Update our logic to select the compiler version to use the more appropriate XCODE_VERSION_MINOR
2520 if the version of Xcode supports it, and fall back to XCODE_VERSION_ACTUAL if not.
2521
2522 * Configurations/Base.xcconfig:
2523
2524 2009-05-14 Gavin Barraclough <barraclough@apple.com>
2525
2526 Reviewed by Geoff Garen.
2527
2528 Checking register file bounds should be a ptr comparison (m_end is a Register*).
2529 Also, the compare should be unsigned, pointers don'ts go negative.
2530
2531 * jit/JIT.cpp:
2532 (JSC::JIT::privateCompile):
2533
2534 2009-05-13 Gavin Barraclough <barraclough@apple.com>
2535
2536 Reviewed by Oliver Hunt.
2537
2538 Fix <rdar://problem/6882919> REGRESSION: page at Metroauto site crashes in cti_op_loop_if_less (25730)
2539
2540 op_loop_if_less (imm < op) was loading op into regT1, but in the slow path spills regT0.
2541 This leads to bad happen.
2542
2543 * jit/JITOpcodes.cpp:
2544 (JSC::JIT::emit_op_loop_if_less):
2545 (JSC::JIT::emitSlow_op_loop_if_less):
2546
2547 2009-05-13 Dmitry Titov <dimich@chromium.org>
2548
2549 Rubber-stamped by Mark Rowe.
2550
2551 https://bugs.webkit.org/show_bug.cgi?id=25746
2552 Revert http://trac.webkit.org/changeset/43507 which caused crash in PPC nightlies with Safari 4.
2553
2554 * JavaScriptCore.exp:
2555 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2556 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2557 * bytecode/SamplingTool.cpp:
2558 (JSC::SamplingThread::start):
2559 (JSC::SamplingThread::stop):
2560 * bytecode/SamplingTool.h:
2561 * wtf/CrossThreadRefCounted.h:
2562 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
2563 (WTF::::ref):
2564 (WTF::::deref):
2565 * wtf/Threading.h:
2566 * wtf/ThreadingNone.cpp:
2567 * wtf/ThreadingPthreads.cpp:
2568 (WTF::threadMapMutex):
2569 (WTF::initializeThreading):
2570 (WTF::threadMap):
2571 (WTF::identifierByPthreadHandle):
2572 (WTF::establishIdentifierForPthreadHandle):
2573 (WTF::pthreadHandleForIdentifier):
2574 (WTF::clearPthreadHandleForIdentifier):
2575 (WTF::createThreadInternal):
2576 (WTF::waitForThreadCompletion):
2577 (WTF::detachThread):
2578 (WTF::currentThread):
2579 * wtf/ThreadingWin.cpp:
2580 (WTF::threadMapMutex):
2581 (WTF::initializeThreading):
2582 (WTF::threadMap):
2583 (WTF::storeThreadHandleByIdentifier):
2584 (WTF::threadHandleForIdentifier):
2585 (WTF::clearThreadHandleForIdentifier):
2586 (WTF::createThreadInternal):
2587 (WTF::waitForThreadCompletion):
2588 (WTF::detachThread):
2589 (WTF::currentThread):
2590 * wtf/gtk/ThreadingGtk.cpp:
2591 (WTF::threadMapMutex):
2592 (WTF::initializeThreading):
2593 (WTF::threadMap):
2594 (WTF::identifierByGthreadHandle):
2595 (WTF::establishIdentifierForThread):
2596 (WTF::threadForIdentifier):
2597 (WTF::clearThreadForIdentifier):
2598 (WTF::createThreadInternal):
2599 (WTF::waitForThreadCompletion):
2600 (WTF::currentThread):
2601 * wtf/qt/ThreadingQt.cpp:
2602 (WTF::threadMapMutex):
2603 (WTF::threadMap):
2604 (WTF::identifierByQthreadHandle):
2605 (WTF::establishIdentifierForThread):
2606 (WTF::clearThreadForIdentifier):
2607 (WTF::threadForIdentifier):
2608 (WTF::initializeThreading):
2609 (WTF::createThreadInternal):
2610 (WTF::waitForThreadCompletion):
2611 (WTF::currentThread):
2612
2613 2009-05-13 Darin Adler <darin@apple.com>
2614
2615 Revert the parser arena change. It was a slowdown, not a speedup.
2616 Better luck next time (I'll break it up into pieces).
2617
2618 2009-05-13 Darin Adler <darin@apple.com>
2619
2620 Tiger build fix.
2621
2622 * parser/Grammar.y: Add back empty code blocks, needed by older
2623 versions of bison on certain rules.
2624
2625 2009-05-13 Steve Falkenburg <sfalken@apple.com>
2626
2627 Windows build fix.
2628
2629 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
2630
2631 2009-05-13 Adam Roben <aroben@apple.com>
2632
2633 Windows build fixes after r43642
2634
2635 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2636 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
2637 Updated.
2638
2639 * debugger/Debugger.cpp:
2640 * runtime/ArrayConstructor.cpp:
2641 * runtime/JSArray.cpp:
2642 * runtime/RegExp.cpp:
2643 * runtime/RegExpConstructor.cpp:
2644 * runtime/RegExpPrototype.cpp:
2645 * runtime/StringPrototype.cpp:
2646 Added missing #includes.
2647
2648 2009-05-13 Darin Adler <darin@apple.com>
2649
2650 Reviewed by Cameron Zwarich.
2651
2652 Bug 25674: syntax tree nodes should use arena allocation
2653 https://bugs.webkit.org/show_bug.cgi?id=25674
2654
2655 Step 3: Add some actual arena allocation. About 1% SunSpider speedup.
2656
2657 * JavaScriptCore.exp: Updated.
2658
2659 * bytecompiler/BytecodeGenerator.cpp:
2660 (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
2661 contains const Identifier* now.
2662 (JSC::BytecodeGenerator::emitPushNewScope): Updated to take a const
2663 Identifier&.
2664 * bytecompiler/BytecodeGenerator.h: Ditto
2665
2666 * bytecompiler/SegmentedVector.h: Added isEmpty.
2667
2668 * debugger/Debugger.cpp:
2669 (JSC::Debugger::recompileAllJSFunctions): Moved this function here from
2670 WebCore so WebCore doesn't need the details of FunctionBodyNode.
2671 * debugger/Debugger.h: Ditto.
2672
2673 * interpreter/Interpreter.cpp:
2674 (JSC::Interpreter::execute): Updated since VarStack contains const
2675 Identifier* now.
2676
2677 * jit/JITStubs.cpp:
2678 (JSC::JITStubs::cti_vm_lazyLinkCall): Call isHostFunction on the body
2679 rather than on the function object, since we can't easily have inlined
2680 access to the FunctionBodyNode in JSFunction.h since WebCore needs
2681 access to that header.
2682 (JSC::JITStubs::cti_op_construct_JSConstruct): Ditto.
2683 * profiler/Profiler.cpp:
2684 (JSC::Profiler::createCallIdentifier): Ditto.
2685
2686 * parser/Grammar.y: Use JSGlobalData* to pass the global data pointer
2687 around whenever possible instead of using void*. Changed
2688 SET_EXCEPTION_LOCATION from a macro to an inline function. Marked
2689 the structure-creating functions inline. Changed the VarStack to use
2690 identifier pointers instead of actual identifiers. This takes
2691 advantage of the fact that all identifier pointers come from the
2692 arena and avoids reference count churn. Changed Identifier* to
2693 const Identifier* to make sure we don't modify any by accident.
2694 Used identifiers for regular expression strings too, using the new
2695 scanRegExp that has out parameters instead of the old one that relied
2696 on side effects in the Lexer. Move the creation of numeric identifiers
2697 out of this file and into the PropertyNode constructor.
2698
2699 * parser/Lexer.cpp:
2700 (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
2701 (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
2702 and changed to call ParserArena.
2703 (JSC::Lexer::scanRegExp): Added out arguments that are const Identifier*
2704 as well as a prefix character argument so we can handle the /= case
2705 without a string append.
2706 (JSC::Lexer::skipRegExp): Added. Skips a regular expression without
2707 allocating Identifier objects.
2708 (JSC::Lexer::clear): Removed the code to manage m_identifiers, m_pattern,
2709 and m_flags, and added code to set m_arena to 0.
2710 * parser/Lexer.h: Updated for changes above.
2711
2712 * parser/NodeConstructors.h:
2713 (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
2714 on the arena.
2715 (JSC::ParserArenaDeletable::operator new): Changed to call the
2716 allocateDeletable function on the arena instead of deleteWithArena.
2717 (JSC::RegExpNode::RegExpNode): Changed arguments to Identifier instead
2718 of UString since these come from the parser which makes identifiers.
2719 (JSC::PropertyNode::PropertyNode): Added new constructor that makes
2720 numeric identifiers. Some day we might want to optimize this for
2721 integers so it doesn't create a string for each one.
2722 (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
2723 since it's now a const Identifier& so it can't be left uninitialized.
2724 (JSC::BreakNode::BreakNode): Ditto.
2725 (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
2726 to keep track of the statements rather than a separate statement vector.
2727 (JSC::BlockNode::BlockNode): Ditto.
2728 (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
2729
2730 * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
2731 It seemed strangely out of place in the header.
2732 (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
2733 UString as well as Identifier.
2734 (JSC::SourceElements::singleStatement): Added.
2735 (JSC::SourceElements::lastStatement): Added.
2736 (JSC::RegExpNode::emitBytecode): Updated since the pattern and flags
2737 are now Identifier instead of UString. Also changed the throwError code
2738 to use the substitution mechanism instead of doing a string append.
2739 (JSC::SourceElements::emitBytecode): Added. Replaces the old
2740 statementListEmitCode function, since we now keep the SourceElements
2741 objects around.
2742 (JSC::BlockNode::lastStatement): Added.
2743 (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
2744 statementListEmitCode.
2745 (JSC::CaseClauseNode::emitBytecode): Added.
2746 (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
2747 instead of statementListEmitCode.
2748 (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
2749 SourceElements* instead of using releaseContentsIntoVector.
2750 (JSC::ScopeNode::emitStatementsBytecode): Added.
2751 (JSC::ScopeNode::singleStatement): Added.
2752 (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
2753 of statementListEmitCode.
2754 (JSC::EvalNode::emitBytecode): Ditto.
2755 (JSC::EvalNode::generateBytecode): Removed code to clear the children
2756 vector. This optimization is no longer possible since everything is in
2757 a single arena.
2758 (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
2759 insetad of statementListEmitCode and check for the return node using
2760 the new functions.
2761
2762 * parser/Nodes.h: Changed VarStack to store const Identifier* instead
2763 of Identifier and rely on the arena to control lifetime. Added a new
2764 ParserArenaFreeable class. Made ParserArenaDeletable inherit from
2765 FastAllocBase instead of having its own operator new. Base the Node
2766 class on ParserArenaFreeable. Changed the various Node classes
2767 to use const Identifier& instead of Identifier to avoid the need to
2768 call their destructors and allow them to function as "freeable" in the
2769 arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
2770 Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
2771 CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
2772 as a base class since they do not descend from Node. Eliminated the
2773 StatementVector type and instead have various classes use SourceElements*
2774 instead of StatementVector. This prevents those classes from having th
2775 use ParserArenaDeletable to make sure the vector destructor is called.
2776
2777 * parser/Parser.cpp:
2778 (JSC::Parser::parse): Pass the arena to the lexer.
2779
2780 * parser/Parser.h: Added an include of ParserArena.h, which is no longer
2781 included by Nodes.h.
2782
2783 * parser/ParserArena.cpp:
2784 (JSC::ParserArena::ParserArena): Added. Initializes the new members,
2785 m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
2786 (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
2787 since we store only the current pointer and the end of pool pointer.
2788 (JSC::ParserArena::deallocateObjects): Added. Contains the common
2789 memory-deallocation logic used by both the destructor and the
2790 reset function.
2791 (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
2792 (JSC::ParserArena::reset): Ditto. Also added code to zero out the
2793 new structures, and switched to use clear() instead of shrink(0) since
2794 we don't really reuse arenas.
2795 (JSC::ParserArena::makeNumericIdentifier): Added.
2796 (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
2797 is empty.
2798 (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
2799 since this is used only for assertions at the moment.
2800
2801 * parser/ParserArena.h: Added an actual arena of "freeable" objects,
2802 ones that don't need destructors to be called. Also added the segmented
2803 vector of identifiers that used to be in the Lexer.
2804
2805 * runtime/FunctionConstructor.cpp:
2806 (JSC::extractFunctionBody): Use singleStatement function rather than
2807 getting at a StatementVector.
2808
2809 * runtime/FunctionPrototype.cpp:
2810 (JSC::functionProtoFuncToString): Call isHostFunction on the body
2811 rather than the function object.
2812
2813 * runtime/JSFunction.cpp:
2814 (JSC::JSFunction::JSFunction): Moved the structure version of this in
2815 here from the header. It's not hot enough that it needs to be inlined.
2816 (JSC::JSFunction::isHostFunction): Moved this in here from the header.
2817 It's now a helper to be used only within the class.
2818 (JSC::JSFunction::setBody): Moved this in here. It's not hot enough that
2819 it needs to be inlined, and we want to be able to compile the header
2820 without the definition of FunctionBodyNode.
2821
2822 * runtime/JSFunction.h: Eliminated the include of "Nodes.h". This was
2823 exposing too much JavaScriptCore dependency to WebCore. Because of this
2824 change and some changes made to WebCore, we could now export a lot fewer
2825 headers from JavaScriptCore, but I have not done that yet in this check-in.
2826 Made a couple functions non-inline. Removes some isHostFunction() assertions.
2827
2828 * wtf/FastAllocBase.h: Added the conventional using statements we use in
2829 WTF so we can use identifiers from the WTF namespace without explicit
2830 namespace qualification or namespace directive. This is the usual WTF style,
2831 although it's unconventional in the C++ world. We use the namespace primarily
2832 for link-time disambiguation, not compile-time.
2833
2834 * wtf/FastMalloc.cpp: Fixed an incorrect comment.
2835
2836 2009-05-13 Xan Lopez <xlopez@igalia.com>
2837
2838 Unreviewed build fix: add JITStubCall.h to files list.
2839
2840 * GNUmakefile.am:
2841
2842 2009-05-13 Ariya Hidayat <ariya.hidayat@nokia.com>
2843
2844 Unreviewed build fix, as suggested by Yael Aharon <yael.aharon@nokia.com>.
2845
2846 * wtf/qt/ThreadingQt.cpp:
2847 (WTF::waitForThreadCompletion): renamed IsValid to isValid.
2848
2849 2009-05-13 Jan Michael Alonzo <jmalonzo@webkit.org>
2850
2851 Revert r43562 - [Gtk] WTF_USE_JSC is already defined in
2852 WebCore/config.h.
2853
2854 * wtf/Platform.h:
2855
2856 2009-05-12 Gavin Barraclough <barraclough@apple.com>
2857
2858 Reviewed by Oliver Hunt.
2859
2860 Add SamplingCounter tool to provide a simple mechanism for counting events in JSC
2861 (enabled using ENABLE(SAMPLING_COUNTERS)). To count events within a single function
2862 use the class 'SamplingCounter', where the counter may be incremented from multiple
2863 functions 'GlobalSamplingCounter' may be convenient; all other counters (stack or
2864 heap allocated, rather than statically declared) should use the DeletableSamplingCounter.
2865 Further description of these classes is provided alongside their definition in
2866 SamplingTool.h.
2867
2868 Counters may be incremented from c++ by calling the 'count()' method on the counter,
2869 or may be incremented by JIT code by using the 'emitCount()' method within the JIT.
2870
2871 This patch also fixes CODEBLOCK_SAMPLING, which was missing a null pointer check.
2872
2873 * JavaScriptCore.exp:
2874 * assembler/MacroAssemblerX86.h:
2875 (JSC::MacroAssemblerX86::addWithCarry32):
2876 (JSC::MacroAssemblerX86::and32):
2877 (JSC::MacroAssemblerX86::or32):
2878 * assembler/MacroAssemblerX86Common.h:
2879 (JSC::MacroAssemblerX86Common::and32):
2880 (JSC::MacroAssemblerX86Common::or32):
2881 * assembler/MacroAssemblerX86_64.h:
2882 (JSC::MacroAssemblerX86_64::and32):
2883 (JSC::MacroAssemblerX86_64::or32):
2884 (JSC::MacroAssemblerX86_64::addPtr):
2885 * assembler/X86Assembler.h:
2886 (JSC::X86Assembler::):
2887 (JSC::X86Assembler::adcl_im):
2888 (JSC::X86Assembler::addq_im):
2889 (JSC::X86Assembler::andl_im):
2890 (JSC::X86Assembler::orl_im):
2891 * bytecode/SamplingTool.cpp:
2892 (JSC::AbstractSamplingCounter::dump):
2893 * bytecode/SamplingTool.h:
2894 (JSC::AbstractSamplingCounter::count):
2895 (JSC::GlobalSamplingCounter::name):
2896 (JSC::SamplingCounter::SamplingCounter):
2897 * jit/JIT.h:
2898 * jit/JITCall.cpp:
2899 (JSC::):
2900 * jit/JITInlineMethods.h:
2901 (JSC::JIT::setSamplingFlag):
2902 (JSC::JIT::clearSamplingFlag):
2903 (JSC::JIT::emitCount):
2904 * jsc.cpp:
2905 (runWithScripts):
2906 * parser/Nodes.cpp:
2907 (JSC::ScopeNode::ScopeNode):
2908 * wtf/Platform.h:
2909
2910 2009-05-13 Steve Falkenburg <sfalken@apple.com>
2911
2912 Windows build fix.
2913
2914 * JavaScriptCore.vcproj/JavaScriptCore.make:
2915
2916 2009-05-12 Steve Falkenburg <sfalken@apple.com>
2917
2918 Windows build fix.
2919
2920 * JavaScriptCore.vcproj/JavaScriptCore.make:
2921
2922 2009-05-12 Oliver Hunt <oliver@apple.com>
2923
2924 Reviewed by Gavin Barraclough.
2925
2926 <rdar://problem/6881457> Crash occurs at JSC::Interpreter::execute() when loading http://www.sears.com
2927
2928 We created the arguments objects before an op_push_scope but not
2929 before op_push_new_scope, this meant a null arguments object could
2930 be resolved inside catch blocks.
2931
2932 * bytecompiler/BytecodeGenerator.cpp:
2933 (JSC::BytecodeGenerator::emitPushNewScope):
2934
2935 2009-05-12 Oliver Hunt <oliver@apple.com>
2936
2937 Reviewed by Gavin Barraclough.
2938
2939 <rdar://problem/6879881> Crash occurs at JSC::JSActivation::mark() when loading http://www.monster.com; http://www.cnet.com
2940 <https://bugs.webkit.org/show_bug.cgi?id=25736> Crash loading www.google.dk/ig (and other igoogle's as well)
2941
2942 Following on from the lazy arguments creation patch, it's now
2943 possible for an activation to to have a null register in the callframe
2944 so we can't just blindly mark the local registers in an activation,
2945 and must null check first instead.
2946
2947 * API/tests/testapi.c:
2948 (functionGC):
2949 * API/tests/testapi.js:
2950 (bludgeonArguments.return.g):
2951 (bludgeonArguments):
2952 * runtime/JSActivation.cpp:
2953 (JSC::JSActivation::mark):
2954
2955 2009-05-12 Gavin Barraclough <barraclough@apple.com>
2956
2957 Rubber stamped by Geoff Garen.
2958
2959 WTF_USE_CTI_REPATCH_PIC is no longer used, remove.
2960
2961 * jit/JIT.h:
2962 * jit/JITStubCall.h:
2963
2964 2009-05-12 Gavin Barraclough <barraclough@apple.com>
2965
2966 Reviewed by Maciej Stachowiak.
2967
2968 We've run into some problems where changing the size of the class JIT leads to
2969 performance fluctuations. Try forcing alignment in an attempt to stabalize this.
2970
2971 * jit/JIT.h:
2972
2973 2009-05-12 Kevin Ollivier <kevino@theolliviers.com>
2974
2975 wx build fix. Add ParserArena.cpp to the build.
2976
2977 * JavaScriptCoreSources.bkl:
2978
2979 2009-05-12 Oliver Hunt <oliver@apple.com>
2980
2981 Reviewed by Geoff Garen.
2982
2983 Unsigned underflow on 64bit cannot be treated as a negative number
2984
2985 This code included some placeswhere we deliberately create negative offsets
2986 from unsigned values, on 32bit this is "safe", but in 64bit builds much
2987 badness occurs. Solution is to use signed types as nature intended.
2988
2989 * jit/JITStubs.cpp:
2990 (JSC::JITStubs::cti_op_load_varargs):
2991
2992 2009-05-12 Jan Michael Alonzo <jmalonzo@webkit.org>
2993
2994 Reviewed by Holger Freyther.
2995
2996 [Gtk] Various autotools build refactoring and fixes
2997 https://bugs.webkit.org/show_bug.cgi?id=25286
2998
2999 Define WTF_USE_JSC for the Gtk port.
3000
3001 * wtf/Platform.h:
3002
3003 2009-05-12 Maciej Stachowiak <mjs@apple.com>
3004
3005 Reviewed by Oliver Hunt.
3006
3007 - allow all of strictEqual to be inlined into cti_op_stricteq once again
3008
3009 We had this optimization once but accidentally lost it at some point.
3010
3011 * runtime/Operations.h:
3012 (JSC::JSValue::strictEqualSlowCaseInline):
3013 (JSC::JSValue::strictEqual):
3014
3015 2009-05-12 Gavin Barraclough <barraclough@apple.com>
3016
3017 Reviewed by Oliver Hunt.
3018
3019 instanceof should throw if the constructor being tested does not implement
3020 'HasInstance" (i.e. is a function). Instead we were returning false.
3021
3022 * interpreter/Interpreter.cpp:
3023 (JSC::isInvalidParamForIn):
3024 (JSC::isInvalidParamForInstanceOf):
3025 (JSC::Interpreter::privateExecute):
3026 * jit/JITStubs.cpp:
3027 (JSC::JITStubs::cti_op_instanceof):
3028 * tests/mozilla/ecma_2/instanceof/instanceof-003.js:
3029 Fix broken test case.
3030 * tests/mozilla/ecma_2/instanceof/regress-7635.js:
3031 Remove broken test case (was an exact duplicate of a test in instanceof-003.js).
3032
3033 2009-05-12 Oliver Hunt <oliver@apple.com>
3034
3035 Reviewed by Gavin Barraclough.
3036
3037 Improve function call forwarding performance
3038
3039 Make creation of the Arguments object occur lazily, so it
3040 is not necessarily created for every function that references
3041 it. Then add logic to Function.apply to allow it to avoid
3042 allocating the Arguments object at all. Helps a lot with
3043 the function forwarding/binding logic in jQuery, Prototype,
3044 and numerous other JS libraries.
3045
3046 * bytecode/CodeBlock.cpp:
3047 (JSC::CodeBlock::dump):
3048 * bytecode/Opcode.h:
3049 * bytecompiler/BytecodeGenerator.cpp:
3050 (JSC::BytecodeGenerator::BytecodeGenerator):
3051 (JSC::BytecodeGenerator::registerFor):
3052 (JSC::BytecodeGenerator::willResolveToArguments):
3053 (JSC::BytecodeGenerator::uncheckedRegisterForArguments):
3054 (JSC::BytecodeGenerator::createArgumentsIfNecessary):
3055 (JSC::BytecodeGenerator::emitCallEval):
3056 (JSC::BytecodeGenerator::emitPushScope):
3057 * bytecompiler/BytecodeGenerator.h:
3058 * interpreter/Interpreter.cpp:
3059 (JSC::Interpreter::privateExecute):
3060 (JSC::Interpreter::retrieveArguments):
3061 * jit/JIT.cpp:
3062 (JSC::JIT::privateCompileMainPass):
3063 * jit/JIT.h:
3064 * jit/JITOpcodes.cpp:
3065 (JSC::JIT::emit_op_create_arguments):
3066 (JSC::JIT::emit_op_init_arguments):
3067 * jit/JITStubs.cpp:
3068 (JSC::JITStubs::cti_op_tear_off_arguments):
3069 (JSC::JITStubs::cti_op_load_varargs):
3070 * parser/Nodes.cpp:
3071 (JSC::ApplyFunctionCallDotNode::emitBytecode):
3072
3073 2009-05-11 Gavin Barraclough <barraclough@apple.com>
3074
3075 Reviewed by Oliver Hunt.
3076
3077 Enable use of SamplingFlags directly from JIT code.
3078
3079 * bytecode/SamplingTool.h:
3080 * jit/JIT.h:
3081 (JSC::JIT::sampleCodeBlock):
3082 (JSC::JIT::sampleInstruction):
3083 * jit/JITInlineMethods.h:
3084 (JSC::JIT::setSamplingFlag):
3085 (JSC::JIT::clearSamplingFlag):
3086
3087 2009-05-11 Gavin Barraclough <barraclough@apple.com>
3088
3089 Reviewed by Cameron Zwarich.
3090
3091 Implement JIT generation for instanceof for non-objects (always returns false).
3092 Also fixes the sequencing of the prototype and value isObject checks, to no match the spec.
3093
3094 0.5% progression on v8 tests overall, due to 3.5% on early-boyer.
3095
3096 * jit/JIT.cpp:
3097 (JSC::JIT::privateCompileMainPass):
3098 (JSC::JIT::privateCompileSlowCases):
3099 * runtime/JSObject.cpp:
3100 (JSC::JSObject::hasInstance):
3101 * runtime/TypeInfo.h:
3102 (JSC::TypeInfo::TypeInfo):
3103
3104 2009-05-11 Geoffrey Garen <ggaren@apple.com>
3105
3106 Reviewed by Sam Weinig.
3107
3108 A little more JIT refactoring.
3109
3110 Rearranged code to more clearly indicate what's conditionally compiled
3111 and why. Now, all shared code is at the top of our JIT files, and all
3112 #if'd code is at the bottom. #if'd code is delineated by large comments.
3113
3114 Moved functions that relate to the JIT but don't explicitly do codegen
3115 into JIT.cpp. Refactored SSE2 check to store its result as a data member
3116 in the JIT.
3117
3118 * jit/JIT.cpp:
3119 (JSC::isSSE2Present):
3120 (JSC::JIT::JIT):
3121 (JSC::JIT::unlinkCall):
3122 (JSC::JIT::linkCall):
3123 * jit/JIT.h:
3124 (JSC::JIT::isSSE2Present):
3125 * jit/JITArithmetic.cpp:
3126 (JSC::JIT::emit_op_mod):
3127 (JSC::JIT::emitSlow_op_mod):
3128 * jit/JITCall.cpp:
3129 (JSC::JIT::compileOpCallVarargs):
3130 (JSC::JIT::compileOpCallVarargsSlowCase):
3131
3132 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
3133
3134 Build fix.
3135
3136 * JavaScriptCore.pri: Build the new JITOpcodes.cpp
3137
3138 2009-05-11 Sam Weinig <sam@webkit.org>
3139
3140 Reviewed by Geoffrey Garen.
3141
3142 More re-factoring of JIT code generation. Use a macro to
3143 forward the main switch-statement cases to the helper functions.
3144
3145 * jit/JIT.cpp:
3146 (JSC::JIT::privateCompileMainPass):
3147 (JSC::JIT::privateCompileSlowCases):
3148
3149 2009-05-11 Sam Weinig <sam@webkit.org>
3150
3151 Reviewed by Geoffrey Garen.
3152
3153 More re-factoring of JIT code generation to move opcode generation
3154 to helper functions outside the main switch-statement and gave those
3155 helper functions standardized names. This patch covers the remaining
3156 slow cases.
3157
3158 * jit/JIT.cpp:
3159 * jit/JIT.h:
3160 * jit/JITOpcodes.cpp:
3161
3162 2009-05-11 Geoffrey Garen <ggaren@apple.com>
3163
3164 Build fix.
3165
3166 * GNUmakefile.am: Added JITOpcodes.cpp and JITStubCall.h to the project.
3167
3168 2009-05-11 Geoffrey Garen <ggaren@apple.com>
3169
3170 Build fix.
3171
3172 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
3173 JITOpcodes.cpp and JITStubCall.h to the project.
3174
3175 2009-05-11 Geoffrey Garen <ggaren@apple.com>
3176
3177 Reviewed by Sam Weinig.
3178
3179 Some JIT refactoring.
3180
3181 Moved JITStubCall* into its own header.
3182
3183 Modified JITStubCall to ASSERT that its return value is handled correctly.
3184 Also, replaced function template with explicit instantiations to resolve
3185 some confusion.
3186
3187 Replaced all uses of emit{Get,Put}CTIArgument with explicit peeks, pokes,
3188 and calls to killLastResultRegister().
3189
3190 * JavaScriptCore.xcodeproj/project.pbxproj:
3191 * jit/JIT.cpp:
3192 (JSC::JIT::privateCompileMainPass):
3193 (JSC::JIT::privateCompile):
3194 * jit/JIT.h:
3195 * jit/JITArithmetic.cpp:
3196 * jit/JITCall.cpp:
3197 * jit/JITInlineMethods.h:
3198 (JSC::JIT::restoreArgumentReference):
3199 * jit/JITPropertyAccess.cpp:
3200 * jit/JITStubCall.h: Copied from jit/JIT.h.
3201 (JSC::JITStubCall::JITStubCall):
3202 (JSC::JITStubCall::addArgument):
3203 (JSC::JITStubCall::call):
3204 (JSC::JITStubCall::):
3205
3206 2009-05-11 Sam Weinig <sam@webkit.org>
3207
3208 Reviewed by Geoffrey Garen.
3209
3210 Start re-factoring JIT code generation to move opcode generation
3211 to helper functions outside the main switch-statement and gave those
3212 helper functions standardized names. This patch only covers the main
3213 pass and all the arithmetic opcodes in the slow path.
3214
3215 * JavaScriptCore.xcodeproj/project.pbxproj:
3216 * jit/JIT.cpp:
3217 (JSC::JIT::privateCompileMainPass):
3218 (JSC::JIT::privateCompileSlowCases):
3219 * jit/JIT.h:
3220 * jit/JITArithmetic.cpp:
3221 * jit/JITOpcodes.cpp: Copied from jit/JIT.cpp.
3222 * jit/JITPropertyAccess.cpp:
3223
3224 2009-05-11 Steve Falkenburg <sfalken@apple.com>
3225
3226 Re-add experimental PGO configs.
3227
3228 Reviewed by Adam Roben.
3229
3230 * JavaScriptCore.vcproj/JavaScriptCore.make:
3231 * JavaScriptCore.vcproj/JavaScriptCore.sln:
3232 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3233 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
3234 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
3235
3236 2009-05-11 Sam Weinig <sam@webkit.org>
3237
3238 Reviewed by Geoffrey "1" Garen.
3239
3240 Rip out the !USE(CTI_REPATCH_PIC) code. It was untested and unused.
3241
3242 * jit/JIT.h:
3243 (JSC::JIT::compileGetByIdChainList):
3244 (JSC::JIT::compileGetByIdChain):
3245 (JSC::JIT::compileCTIMachineTrampolines):
3246 * jit/JITPropertyAccess.cpp:
3247 (JSC::JIT::privateCompileGetByIdProto):
3248 (JSC::JIT::privateCompileGetByIdChainList):
3249 (JSC::JIT::privateCompileGetByIdChain):
3250 * jit/JITStubs.cpp:
3251 (JSC::JITStubs::tryCachePutByID):
3252 (JSC::JITStubs::tryCacheGetByID):
3253
3254 2009-05-11 Dmitry Titov <dimich@chromium.org>
3255
3256 GTK build fix - the deprecated waitForThreadCompletion is not needed on GTK.
3257
3258 * wtf/ThreadingPthreads.cpp: used #ifdef PLATFORM(DARWIN) around waitForThreadCompletion().
3259
3260 2009-05-11 Adam Roben <aroben@apple.com>
3261
3262 Build fix for newer versions of GCC
3263
3264 * wtf/ThreadingPthreads.cpp: Added a declaration of
3265 waitForThreadCompletion before its definition to silence a warning.
3266
3267 2009-05-11 Dmitry Titov <dimich@chromium.org>
3268
3269 Reviewed by Alexey Proskuryakov and Adam Roben.
3270
3271 https://bugs.webkit.org/show_bug.cgi?id=25348
3272 Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
3273
3274 * wtf/Threading.h:
3275 (WTF::ThreadIdentifier::ThreadIdentifier):
3276 (WTF::ThreadIdentifier::isValid):
3277 (WTF::ThreadIdentifier::invalidate):
3278 (WTF::ThreadIdentifier::platformId):
3279 ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
3280 methods that are used across the code on thread ids: construction, comparisons,
3281 check for 'valid' state etc. '0' is used as invalid id, which happens to just work
3282 with all platform-specific thread id implementations.
3283
3284 All the following files repeatedly reflect the new ThreadIdentifier for each platform.
3285 We remove ThreadMap and threadMapMutex from all of them, remove the functions that
3286 populated/searched/cleared the map and add platform-specific comparison operators
3287 for ThreadIdentifier.
3288
3289 There are specific temporary workarounds for Safari 4 beta on OSX and Win32 since the
3290 public build uses WTF threading functions with old type of ThreadingIdentifier.
3291 The next time Safari 4 is rebuilt, it will 'automatically' pick up the new type and new
3292 functions so the deprecated ones can be removed.
3293
3294 * wtf/gtk/ThreadingGtk.cpp:
3295 (WTF::ThreadIdentifier::operator==):
3296 (WTF::ThreadIdentifier::operator!=):
3297 (WTF::initializeThreading):
3298 (WTF::createThreadInternal):
3299 (WTF::waitForThreadCompletion):
3300 (WTF::currentThread):
3301
3302 * wtf/ThreadingNone.cpp:
3303 (WTF::ThreadIdentifier::operator==):
3304 (WTF::ThreadIdentifier::operator!=):
3305
3306 * wtf/ThreadingPthreads.cpp:
3307 (WTF::ThreadIdentifier::operator==):
3308 (WTF::ThreadIdentifier::operator!=):
3309 (WTF::initializeThreading):
3310 (WTF::createThreadInternal):
3311 (WTF::waitForThreadCompletion):
3312 (WTF::detachThread):
3313 (WTF::currentThread):
3314 (WTF::waitForThreadCompletion): This is a workaround for Safari 4 beta on Mac.
3315 Safari 4 is linked against old definition of ThreadIdentifier so it treats it as uint32_t.
3316 This 'old' variant of waitForThreadCompletion takes uint32_t and has the old decorated name, so Safari can
3317 load it from JavaScriptCore library. The other functions (CurrentThread() etc) happen to match their previous
3318 decorated names and, while they return pthread_t now, it is a pointer which round-trips through a uint32_t.
3319 This function will be removed as soon as Safari 4 will release next public build.
3320
3321 * wtf/qt/ThreadingQt.cpp:
3322 (WTF::ThreadIdentifier::operator==):
3323 (WTF::ThreadIdentifier::operator!=):
3324 (WTF::initializeThreading):
3325 (WTF::createThreadInternal):
3326 (WTF::waitForThreadCompletion):
3327 (WTF::currentThread):
3328
3329 * wtf/ThreadingWin.cpp:
3330 (WTF::ThreadIdentifier::operator==):
3331 (WTF::ThreadIdentifier::operator!=):
3332 (WTF::initializeThreading):
3333 (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
3334 counter as a thread ID and mapped it into platform ID. Windows was using native thread
3335 id and mapped it into thread handle. Since we can always obtain a thread handle
3336 by thread id, createThread now closes the handle.
3337 (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
3338 it means the thread already exited.
3339 (WTF::detachThread):
3340 (WTF::currentThread):
3341 (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
3342 (WTF::waitForThreadCompletionDeprecated): same.
3343 (WTF::currentThreadDeprecated): same.
3344 (WTF::createThreadDeprecated): same.
3345
3346 * bytecode/SamplingTool.h:
3347 * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
3348
3349 * JavaScriptCore.exp: export lists - updated decorated names of the WTF threading functions
3350 since they now take a different type as a parameter.
3351 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
3352 that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
3353 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
3354
3355 2009-05-11 Darin Adler <darin@apple.com>
3356
3357 Reviewed by Oliver Hunt.
3358
3359 Bug 25560: REGRESSION (r34821): "string value".__proto__ gets the wrong object.
3360 https://bugs.webkit.org/show_bug.cgi?id=25560
3361 rdar://problem/6861069
3362
3363 I missed this case back a year ago when I sped up handling
3364 of JavaScript wrappers. Easy to fix.
3365
3366 * runtime/JSObject.h:
3367 (JSC::JSValue::get): Return the prototype itself if the property name
3368 is __proto__.
3369 * runtime/JSString.cpp:
3370 (JSC::JSString::getOwnPropertySlot): Ditto.
3371
3372 2009-05-09 Oliver Hunt <oliver@apple.com>
3373
3374 Reviewed by Maciej Stachowiak.
3375
3376 Rename emitGetFromCallFrameHeader to emitGetFromCallFrameHeaderPtr
3377
3378 * jit/JIT.cpp:
3379 (JSC::JIT::privateCompileMainPass):
3380 (JSC::JIT::privateCompileCTIMachineTrampolines):
3381 * jit/JIT.h:
3382 * jit/JITInlineMethods.h:
3383 (JSC::JIT::emitGetFromCallFrameHeaderPtr):
3384 (JSC::JIT::emitGetFromCallFrameHeader32):
3385
3386 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
3387
3388 Unreviewed build fix. Build ParserAreana.cpp for Qt
3389
3390 * JavaScriptCore.pri:
3391
3392 2009-05-11 Norbert Leser <norbert.leser@nokia.com>
3393
3394 Reviewed by Darin Adler.
3395
3396 https://bugs.webkit.org/show_bug.cgi?id=24536
3397
3398 Symbian compilers cannot resolve WTF::PassRefPtr<JSC::Profile>
3399 unless Profile.h is included.
3400
3401 * profiler/ProfileGenerator.h:
3402
3403 2009-05-11 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
3404
3405 Reviewed by Holger Freyther.
3406
3407 https://bugs.webkit.org/show_bug.cgi?id=24284
3408
3409 * JavaScriptCore.pri: coding style modified
3410 * jsc.pro: duplicated values removed from INCLUDEPATH, DEFINES
3411
3412 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
3413
3414 Reviewed by NOBODY (build fix).
3415
3416 Also add ParserArena, in addition to AllInOne, for release builds,
3417 since adding it to AllInOne breaks Mac.
3418
3419 * GNUmakefile.am:
3420
3421 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
3422
3423 Unreviewed build fix. Adding ParserArena to the autotools build.
3424
3425 * GNUmakefile.am:
3426
3427 2009-05-11 Adam Roben <aroben@apple.com>
3428
3429 More Windows build fixes after r43479
3430
3431 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3432 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3433 Export ParserArena::reset.
3434
3435 2009-05-11 Adam Roben <aroben@apple.com>
3436
3437 Windows build fixes after r43479
3438
3439 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
3440 ParserArena to the project.
3441
3442 * parser/NodeConstructors.h: Added a missing include.
3443 (JSC::ParserArenaDeletable::operator new): Marked these as inline.
3444
3445 2009-05-10 Maciej Stachowiak <mjs@apple.com>
3446
3447 Reviewed by Geoff Garen.
3448
3449 - fixed REGRESSION(r43432): Many JavaScriptCore tests crash in 64-bit
3450 https://bugs.webkit.org/show_bug.cgi?id=25680
3451
3452 Accound for the 64-bit instruction prefix when rewriting mov to lea on 64-bit.
3453
3454 * jit/JIT.h:
3455 * jit/JITPropertyAccess.cpp:
3456 (JSC::JIT::patchGetByIdSelf):
3457 (JSC::JIT::patchPutByIdReplace):
3458
3459 2009-05-10 Darin Adler <darin@apple.com>
3460
3461 Reviewed by Cameron Zwarich.
3462
3463 Bug 25674: syntax tree nodes should use arena allocation
3464 https://bugs.webkit.org/show_bug.cgi?id=25674
3465
3466 Part two: Remove reference counting from most nodes.
3467
3468 * JavaScriptCore.exp: Updated.
3469
3470 * JavaScriptCore.xcodeproj/project.pbxproj: Added ParserArena.h and .cpp.
3471
3472 * parser/Grammar.y: Replaced uses of ParserRefCountedData with uses of
3473 ParserArenaData. Took out now-nonfunctional code that tries to manually
3474 release declaration list. Changed the new calls that create FuncDeclNode
3475 and FuncExprNode so that they use the proper version of operator new for
3476 the reference-counted idiom, not the deletion idiom.
3477
3478 * parser/NodeConstructors.h:
3479 (JSC::ParserArenaDeletable::operator new): Added.
3480 (JSC::ParserArenaRefCounted::ParserArenaRefCounted): Added.
3481 (JSC::Node::Node): Removed ParserRefCounted initializer.
3482 (JSC::ElementNode::ElementNode): Ditto.
3483 (JSC::PropertyNode::PropertyNode): Ditto.
3484 (JSC::ArgumentsNode::ArgumentsNode): Ditto.
3485 (JSC::SourceElements::SourceElements): Ditto.
3486 (JSC::ParameterNode::ParameterNode): Ditto.
3487 (JSC::FuncExprNode::FuncExprNode): Added ParserArenaRefCounted initializer.
3488 (JSC::FuncDeclNode::FuncDeclNode): Ditto.
3489 (JSC::CaseClauseNode::CaseClauseNode): Removed ParserRefCounted initializer.
3490 (JSC::ClauseListNode::ClauseListNode): Ditto.
3491 (JSC::CaseBlockNode::CaseBlockNode): Ditto.
3492
3493 * parser/NodeInfo.h: Replaced uses of ParserRefCountedData with uses of
3494 ParserArenaData.
3495
3496 * parser/Nodes.cpp:
3497 (JSC::ScopeNode::ScopeNode): Added ParserArenaRefCounted initializer.
3498 (JSC::ProgramNode::create): Use the proper version of operator new for
3499 the reference-counted idiom, not the deletion idiom. Use the arena
3500 contains function instead of the vecctor find function.
3501 (JSC::EvalNode::create): Use the proper version of operator new for
3502 the reference-counted idiom, not the deletion idiom. Use the arena
3503 reset function instead of the vector shrink function.
3504 (JSC::FunctionBodyNode::createNativeThunk): Use the proper version
3505 of operator new for the reference-counted idiom, not the deletion idiom.
3506 (JSC::FunctionBodyNode::create): More of the same.
3507
3508 * parser/Nodes.h: Added ParserArenaDeletable and ParserArenaRefCounted
3509 to replace ParserRefCounted. Fixed inheritance so only the classes that
3510 need reference counting inherit from ParserArenaRefCounted.
3511
3512 * parser/Parser.cpp:
3513 (JSC::Parser::parse): Set m_sourceElements to 0 since it now starts
3514 uninitialized. Just set it to 0 again in the failure case, since it's
3515 now just a raw pointer, not an owning one.
3516 (JSC::Parser::reparseInPlace): Removed now-unneeded get() function.
3517 (JSC::Parser::didFinishParsing): Replaced uses of ParserRefCountedData
3518 with uses of ParserArenaData.
3519
3520 * parser/Parser.h: Less RefPtr, more arena.
3521
3522 * parser/ParserArena.cpp: Added.
3523 * parser/ParserArena.h: Added.
3524
3525 * runtime/JSGlobalData.cpp:
3526 (JSC::JSGlobalData::~JSGlobalData): Removed arena-related code, since it's
3527 now in the Parser.
3528 (JSC::JSGlobalData::createLeaked): Removed unneeded #ifndef.
3529 (JSC::JSGlobalData::createNativeThunk): Tweaked #if a bit.
3530
3531 * runtime/JSGlobalData.h: Removed parserArena, which is now in Parser.
3532
3533 * wtf/RefCounted.h: Added deletionHasBegun function, for use in
3534 assertions to catch deletion not done by the deref function.
3535
3536 2009-05-10 David Kilzer <ddkilzer@apple.com>
3537
3538 Part 2: Try to fix the Windows build by adding a symbol which is really just a re-mangling of a changed method signature
3539
3540 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3541 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3542
3543 2009-05-10 David Kilzer <ddkilzer@apple.com>
3544
3545 Try to fix the Windows build by removing an unknown symbol
3546
3547 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3548 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
3549
3550 2009-05-10 David Kilzer <ddkilzer@apple.com>
3551
3552 Touch Nodes.cpp to try to fix Windows build
3553
3554 * parser/Nodes.cpp: Removed whitespace.
3555
3556 2009-05-10 Darin Adler <darin@apple.com>
3557
3558 Reviewed by Maciej Stachowiak.
3559
3560 Quick fix for failures seen on buildbot. Maciej plans a better fix later.
3561
3562 * wtf/dtoa.cpp: Change the hardcoded number of 32-bit words in a BigInt
3563 from 32 to 64. Parsing "1e500", for example, requires more than 32 words.
3564
3565 2009-05-10 Darin Adler <darin@apple.com>
3566
3567 Reviewed by Sam Weinig.
3568
3569 Bug 25674: syntax tree nodes should use arena allocation
3570 Part one: Change lifetimes so we won't have to use reference
3571 counting so much, but don't eliminate the reference counts
3572 entirely yet.
3573
3574 * JavaScriptCore.exp: Updated.
3575
3576 * bytecompiler/BytecodeGenerator.cpp:
3577 (JSC::BytecodeGenerator::BytecodeGenerator): Update for use of raw pointers
3578 instead of RefPtr.
3579 (JSC::BytecodeGenerator::emitCall): Ditto.
3580 (JSC::BytecodeGenerator::emitConstruct): Ditto.
3581
3582 * parser/Grammar.y: Update node creating code to use new (JSGlobalData*)
3583 instead of the plain new. At the moment this is just a hook for future
3584 arena allocation; it's inline and JSGlobalData* is not used.
3585
3586 * parser/NodeConstructors.h: Updated for name change of parserObjects to
3587 parserArena. Also added explicit initialization for raw pointers that used
3588 to be RefPtr. Also removed some uses of get() that aren't needed now that
3589 the pointers are raw pointers. Also eliminated m_parameter from FuncExprNode
3590 and FuncDeclNode. Also changed node-creating code to use new (JSGlobalData*)
3591 as above.
3592
3593 * parser/Nodes.cpp: Eliminated NodeReleaser and all use of it.
3594 (JSC::ParserRefCounted::ParserRefCounted): Updated for name change of
3595 parserObjects to parserArena.
3596 (JSC::SourceElements::append): Use raw pointers.
3597 (JSC::ArrayNode::emitBytecode): Ditto.
3598 (JSC::ArrayNode::isSimpleArray): Ditto.
3599 (JSC::ArrayNode::toArgumentList): Ditto.
3600 (JSC::ObjectLiteralNode::emitBytecode): Ditto.
3601 (JSC::PropertyListNode::emitBytecode): Ditto.
3602 (JSC::BracketAccessorNode::emitBytecode): Ditto.
3603 (JSC::DotAccessorNode::emitBytecode): Ditto.
3604 (JSC::ArgumentListNode::emitBytecode): Ditto.
3605 (JSC::NewExprNode::emitBytecode): Ditto.
3606 (JSC::EvalFunctionCallNode::emitBytecode): Ditto.
3607 (JSC::FunctionCallValueNode::emitBytecode): Ditto.
3608 (JSC::FunctionCallResolveNode::emitBytecode): Ditto.
3609 (JSC::FunctionCallBracketNode::emitBytecode): Ditto.
3610 (JSC::FunctionCallDotNode::emitBytecode): Ditto.
3611 (JSC::CallFunctionCallDotNode::emitBytecode): Ditto.
3612 (JSC::ApplyFunctionCallDotNode::emitBytecode): Ditto.
3613 (JSC::PostfixBracketNode::emitBytecode): Ditto.
3614 (JSC::PostfixDotNode::emitBytecode): Ditto.
3615 (JSC::DeleteBracketNode::emitBytecode): Ditto.
3616 (JSC::DeleteDotNode::emitBytecode): Ditto.
3617 (JSC::DeleteValueNode::emitBytecode): Ditto.
3618 (JSC::VoidNode::emitBytecode): Ditto.
3619 (JSC::TypeOfValueNode::emitBytecode): Ditto.
3620 (JSC::PrefixBracketNode::emitBytecode): Ditto.
3621 (JSC::PrefixDotNode::emitBytecode): Ditto.
3622 (JSC::UnaryOpNode::emitBytecode): Ditto.
3623 (JSC::BinaryOpNode::emitStrcat): Ditto.
3624 (JSC::BinaryOpNode::emitBytecode): Ditto.
3625 (JSC::EqualNode::emitBytecode): Ditto.
3626 (JSC::StrictEqualNode::emitBytecode): Ditto.
3627 (JSC::ReverseBinaryOpNode::emitBytecode): Ditto.
3628 (JSC::ThrowableBinaryOpNode::emitBytecode): Ditto.
3629 (JSC::InstanceOfNode::emitBytecode): Ditto.
3630 (JSC::LogicalOpNode::emitBytecode): Ditto.
3631 (JSC::ConditionalNode::emitBytecode): Ditto.
3632 (JSC::ReadModifyResolveNode::emitBytecode): Ditto.
3633 (JSC::AssignResolveNode::emitBytecode): Ditto.
3634 (JSC::AssignDotNode::emitBytecode): Ditto.
3635 (JSC::ReadModifyDotNode::emitBytecode): Ditto.
3636 (JSC::AssignBracketNode::emitBytecode): Ditto.
3637 (JSC::ReadModifyBracketNode::emitBytecode): Ditto.
3638 (JSC::CommaNode::emitBytecode): Ditto.
3639 (JSC::ConstDeclNode::emitCodeSingle): Ditto.
3640 (JSC::ConstDeclNode::emitBytecode): Ditto.
3641 (JSC::ConstStatementNode::emitBytecode): Ditto.
3642 (JSC::statementListEmitCode): Ditto.
3643 (JSC::BlockNode::emitBytecode): Ditto.
3644 (JSC::ExprStatementNode::emitBytecode): Ditto.
3645 (JSC::VarStatementNode::emitBytecode): Ditto.
3646 (JSC::IfNode::emitBytecode): Ditto.
3647 (JSC::IfElseNode::emitBytecode): Ditto.
3648 (JSC::DoWhileNode::emitBytecode): Ditto.
3649 (JSC::WhileNode::emitBytecode): Ditto.
3650 (JSC::ForNode::emitBytecode): Ditto.
3651 (JSC::ForInNode::emitBytecode): Ditto.
3652 (JSC::ReturnNode::emitBytecode): Ditto.
3653 (JSC::WithNode::emitBytecode): Ditto.
3654 (JSC::CaseBlockNode::tryOptimizedSwitch): Ditto.
3655 (JSC::CaseBlockNode::emitBytecodeForBlock): Ditto.
3656 (JSC::SwitchNode::emitBytecode): Ditto.
3657 (JSC::LabelNode::emitBytecode): Ditto.
3658 (JSC::ThrowNode::emitBytecode): Ditto.
3659 (JSC::TryNode::emitBytecode): Ditto.
3660 (JSC::ScopeNodeData::ScopeNodeData): Use swap to transfer ownership
3661 of the arena, varStack and functionStack.
3662 (JSC::ScopeNode::ScopeNode): Pass in the arena when creating the
3663 ScopeNodeData.
3664 (JSC::ProgramNode::ProgramNode): Made this inline since it's used
3665 in only one place.
3666 (JSC::ProgramNode::create): Changed this to return a PassRefPtr since
3667 we plan to have the scope nodes be outside the arena, so they will need
3668 some kind of ownership transfer (maybe auto_ptr instead of PassRefPtr
3669 in the future, though). Remove the node from the newly-created arena to
3670 avoid a circular reference. Later we'll keep the node out of the arena
3671 by using a different operator new, but for now it's the ParserRefCounted
3672 constructor that puts the node into the arena, and there's no way to
3673 bypass that.
3674 (JSC::EvalNode::EvalNode): Ditto.
3675 (JSC::EvalNode::create): Ditto.
3676 (JSC::FunctionBodyNode::FunctionBodyNode): Ditto.
3677 (JSC::FunctionBodyNode::createNativeThunk): Moved the code that
3678 reseets the arena here instead of the caller.
3679 (JSC::FunctionBodyNode::create): Same change as the other create
3680 functions above.
3681 (JSC::FunctionBodyNode::emitBytecode): Use raw pointers.
3682
3683 * parser/Nodes.h: Removed NodeReleaser. Changed FunctionStack to
3684 use raw pointers. Removed the releaseNodes function. Added an override
3685 of operator new that takes a JSGlobalData* to prepare for future arena use.
3686 Use raw pointers instead of RefPtr everywhere possible.
3687
3688 * parser/Parser.cpp:
3689 (JSC::Parser::reparseInPlace): Pass the arena in.
3690
3691 * parser/Parser.h:
3692 (JSC::Parser::parse): Updated for name change of parserObjects to parserArena.
3693 (JSC::Parser::reparse): Ditto.
3694 * runtime/FunctionConstructor.cpp:
3695 (JSC::extractFunctionBody): Ditto.
3696 * runtime/JSGlobalData.cpp:
3697 (JSC::JSGlobalData::~JSGlobalData): Ditto.
3698 (JSC::JSGlobalData::createNativeThunk): Moved arena manipulation into the
3699 FunctionBodyNode::createNativeThunk function.
3700
3701 * runtime/JSGlobalData.h: Tweaked formatting and renamed parserObjects to
3702 parserArena.
3703
3704 * wtf/NotFound.h: Added the usual "using WTF" to this header to match the
3705 rest of WTF.
3706
3707 2009-05-10 Dimitri Glazkov <dglazkov@chromium.org>
3708
3709 Reviewed by Geoffrey Garen.
3710
3711 https://bugs.webkit.org/show_bug.cgi?id=25670
3712 Remove no longer valid chunk of code from dtoa.
3713
3714 * wtf/dtoa.cpp:
3715 (WTF::dtoa): Removed invalid code.
3716
3717 2009-05-10 Alexey Proskuryakov <ap@webkit.org>
3718
3719 Reviewed by Geoff Garen.
3720
3721 "Class const *" is the same as "const Class*", use the latter syntax consistently.
3722
3723 See <http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.9>.
3724
3725 * pcre/pcre_compile.cpp:
3726 (calculateCompiledPatternLength):
3727 * runtime/JSObject.h:
3728 (JSC::JSObject::offsetForLocation):
3729 (JSC::JSObject::locationForOffset):
3730
3731 2009-05-10 Maciej Stachowiak <mjs@apple.com>
3732
3733 Reviewed by Alexey Proskuryakov.
3734
3735 - speedup dtoa/strtod
3736
3737 Added a bunch of inlining, and replaced malloc with stack allocation.
3738
3739 0.5% SunSpider speedup (7% on string-tagcloud).
3740
3741 * runtime/NumberPrototype.cpp:
3742 (JSC::integerPartNoExp):
3743 (JSC::numberProtoFuncToExponential):
3744 * runtime/UString.cpp:
3745 (JSC::concatenate):
3746 (JSC::UString::from):
3747 * wtf/dtoa.cpp:
3748 (WTF::BigInt::BigInt):
3749 (WTF::BigInt::operator=):
3750 (WTF::Balloc):
3751 (WTF::Bfree):
3752 (WTF::multadd):
3753 (WTF::s2b):
3754 (WTF::i2b):
3755 (WTF::mult):
3756 (WTF::pow5mult):
3757 (WTF::lshift):
3758 (WTF::cmp):
3759 (WTF::diff):
3760 (WTF::b2d):
3761 (WTF::d2b):
3762 (WTF::ratio):
3763 (WTF::strtod):
3764 (WTF::quorem):
3765 (WTF::freedtoa):
3766 (WTF::dtoa):
3767 * wtf/dtoa.h:
3768
3769 2009-05-09 Mike Hommey <glandium@debian.org>
3770
3771 Reviewed by Geoffrey Garen. Landed by Jan Alonzo.
3772
3773 Enable JIT on x86-64 gtk+
3774 https://bugs.webkit.org/show_bug.cgi?id=24724
3775
3776 * GNUmakefile.am:
3777
3778 2009-05-09 Geoffrey Garen <ggaren@apple.com>
3779
3780 Reviewed by Cameron Zwarich.
3781
3782 Removed the last non-call-related manually managed JIT stub call.
3783
3784 * jit/JITArithmetic.cpp:
3785 (JSC::JIT::compileFastArithSlow_op_rshift): Fully use the JITStubCall
3786 abstraction, instead of emitPutJITStubArg.
3787
3788 2009-05-09 Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
3789
3790 Reviewed by Gustavo Noronha.
3791
3792 https://bugs.webkit.org/show_bug.cgi?id=25653
3793 PLATFORM(X86_64) inherits ia64
3794
3795 __ia64__ is defined by gcc in an IA64 arch and has completely
3796 nothing in common with X86-64 exept both are from Intel and have
3797 an 64bit address space. That's it. Since code seems to expect x86
3798 here, ia64 has to go.
3799
3800 * wtf/Platform.h:
3801
3802 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
3803
3804 Suggested by Geoffrey Garen.
3805
3806 Assume SSE2 is present on X86-64 and on MAC X86-32. This fixes a
3807 build breakage on non-Mac X86-64 when JIT is enabled.
3808
3809 * jit/JITArithmetic.cpp:
3810
3811 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
3812
3813 Build fix, adding missing files to make dist.
3814
3815 * GNUmakefile.am:
3816
3817 2009-05-09 Geoffrey Garen <ggaren@apple.com>
3818
3819 Windows build fix.
3820
3821 * assembler/X86Assembler.h:
3822 (JSC::X86Assembler::patchLoadToLEA):
3823
3824 2009-05-09 Geoffrey Garen <ggaren@apple.com>
3825
3826 Windows build fix.
3827
3828 * assembler/X86Assembler.h:
3829 (JSC::X86Assembler::patchLoadToLEA):
3830
3831 2009-05-09 Maciej Stachowiak <mjs@apple.com>
3832
3833 Reviewed by Gavin Barraclough.
3834
3835 Original patch by John McCall. Updated by Cameron Zwarich. Further refined by me.
3836
3837 - Assorted speedups to property access
3838
3839 ~.3%-1% speedup on SunSpider
3840
3841 1) When we know from the structure ID that an object is using inline storage, plant direct
3842 loads and stores against it; no need to indirect through storage pointer.
3843
3844 2) Also because of the above, union the property storage pointer with the first inline property
3845 slot and add an extra inline property slot.
3846
3847 * assembler/AbstractMacroAssembler.h:
3848 (JSC::AbstractMacroAssembler::CodeLocationInstruction::CodeLocationInstruction):
3849 (JSC::AbstractMacroAssembler::CodeLocationInstruction::patchLoadToLEA):
3850 (JSC::::CodeLocationCommon::instructionAtOffset):
3851 * assembler/MacroAssembler.h:
3852 (JSC::MacroAssembler::storePtr):
3853 * assembler/MacroAssemblerX86.h:
3854 (JSC::MacroAssemblerX86::store32):
3855 * assembler/MacroAssemblerX86_64.h:
3856 (JSC::MacroAssemblerX86_64::storePtr):
3857 * assembler/X86Assembler.h:
3858 (JSC::X86Assembler::movq_EAXm):
3859 (JSC::X86Assembler::movl_rm):
3860 (JSC::X86Assembler::patchLoadToLEA):
3861 * jit/JIT.cpp:
3862 (JSC::JIT::privateCompileMainPass):
3863 * jit/JIT.h:
3864 * jit/JITPropertyAccess.cpp:
3865 (JSC::JIT::compileGetByIdHotPath):
3866 (JSC::JIT::compilePutByIdHotPath):
3867 (JSC::JIT::compilePutDirectOffset):
3868 (JSC::JIT::compileGetDirectOffset):
3869 (JSC::JIT::privateCompilePutByIdTransition):
3870 (JSC::JIT::patchGetByIdSelf):
3871 (JSC::JIT::patchPutByIdReplace):
3872 (JSC::JIT::privateCompileGetByIdSelf):
3873 (JSC::JIT::privateCompileGetByIdProto):
3874 (JSC::JIT::privateCompileGetByIdSelfList):
3875 (JSC::JIT::privateCompileGetByIdProtoList):
3876 (JSC::JIT::privateCompileGetByIdChainList):
3877 (JSC::JIT::privateCompileGetByIdChain):
3878 (JSC::JIT::privateCompilePutByIdReplace):
3879 * runtime/JSObject.cpp:
3880 (JSC::JSObject::mark):
3881 (JSC::JSObject::removeDirect):
3882 * runtime/JSObject.h:
3883 (JSC::JSObject::propertyStorage):
3884 (JSC::JSObject::getDirect):
3885 (JSC::JSObject::getOffset):
3886 (JSC::JSObject::offsetForLocation):
3887 (JSC::JSObject::locationForOffset):
3888 (JSC::JSObject::getDirectOffset):
3889 (JSC::JSObject::putDirectOffset):
3890 (JSC::JSObject::isUsingInlineStorage):
3891 (JSC::JSObject::):
3892 (JSC::JSObject::JSObject):
3893 (JSC::JSObject::~JSObject):
3894 (JSC::Structure::isUsingInlineStorage):
3895 (JSC::JSObject::putDirect):
3896 (JSC::JSObject::putDirectWithoutTransition):
3897 (JSC::JSObject::allocatePropertyStorageInline):
3898 * runtime/Structure.h:
3899
3900 2009-05-09 Geoffrey Garen <ggaren@apple.com>
3901
3902 Reviewed by Gavin Barraclough.
3903
3904 Changed all our JIT stubs so that they return a maximum of 1 JS value or
3905 two non-JS pointers, and do all other value returning through out
3906 parameters, in preparation for 64bit JS values on a 32bit system.
3907
3908 Stubs that used to return two JSValues now return one JSValue and take
3909 and out parameter specifying where in the register array the second
3910 value should go.
3911
3912 SunSpider reports no change.
3913
3914 * jit/JIT.cpp:
3915 (JSC::JIT::privateCompileMainPass):
3916 * jit/JITArithmetic.cpp:
3917 (JSC::JIT::compileFastArithSlow_op_post_inc):
3918 (JSC::JIT::compileFastArithSlow_op_post_dec):
3919 * jit/JITStubs.cpp:
3920 (JSC::JITStubs::cti_op_call_arityCheck):
3921 (JSC::JITStubs::cti_op_resolve_func):
3922 (JSC::JITStubs::cti_op_post_inc):
3923 (JSC::JITStubs::cti_op_resolve_with_base):
3924 (JSC::JITStubs::cti_op_post_dec):
3925 * jit/JITStubs.h:
3926 (JSC::):
3927
3928 2009-05-08 Geoffrey Garen <ggaren@apple.com>
3929
3930 Reviewed by Cameron Zwarich.
3931
3932 Fixed <rdar://problem/6634956> CrashTracer: [REGRESSION] >400 crashes
3933 in Safari at com.apple.JavaScriptCore • JSC::BytecodeGenerator::emitComplexJumpScopes + 468
3934 https://bugs.webkit.org/show_bug.cgi?id=25658
3935
3936 * bytecompiler/BytecodeGenerator.cpp:
3937 (JSC::BytecodeGenerator::emitComplexJumpScopes): Guard the whole loop
3938 with a bounds check. The old loop logic would decrement and read topScope
3939 without a bounds check, which could cause crashes on page boundaries.
3940
3941 2009-05-08 Jan Michael Alonzo <jmalonzo@webkit.org>
3942
3943 Reviewed by NOBODY (BuildFix).
3944
3945 Gtk fix: add LiteralParser to the build script per r43424.
3946
3947 Add LiteralParser to the Qt and Wx build scripts too.
3948
3949 * GNUmakefile.am:
3950 * JavaScriptCore.pri:
3951 * JavaScriptCoreSources.bkl:
3952
3953 2009-05-08 Oliver Hunt <oliver@apple.com>
3954
3955 Reviewed by Gavin Barraclough and Darin Adler.
3956
3957 Add a limited literal parser for eval to handle object and array literals fired at eval
3958
3959 This is a simplified parser and lexer that we can throw at strings passed to eval
3960 in case a site is using eval to parse JSON (eg. json2.js). The lexer is intentionally
3961 limited (in effect it's whitelisting a limited "common" subset of the JSON grammar)
3962 as this decreases the likelihood of us wating time attempting to parse any significant
3963 amount of non-JSON content.
3964
3965 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3966 * JavaScriptCore.xcodeproj/project.pbxproj:
3967 * interpreter/Interpreter.cpp:
3968 (JSC::Interpreter::callEval):
3969 * runtime/JSGlobalObjectFunctions.cpp:
3970 (JSC::globalFuncEval):
3971 * runtime/LiteralParser.cpp: Added.
3972 (JSC::isStringCharacter):
3973 (JSC::LiteralParser::Lexer::lex):
3974 (JSC::LiteralParser::Lexer::lexString):
3975 (JSC::LiteralParser::Lexer::lexNumber):
3976 (JSC::LiteralParser::parseStatement):
3977 (JSC::LiteralParser::parseExpression):
3978 (JSC::LiteralParser::parseArray):
3979 (JSC::LiteralParser::parseObject):
3980 (JSC::LiteralParser::StackGuard::StackGuard):
3981 (JSC::LiteralParser::StackGuard::~StackGuard):
3982 (JSC::LiteralParser::StackGuard::isSafe):
3983 * runtime/LiteralParser.h: Added.
3984 (JSC::LiteralParser::LiteralParser):
3985 (JSC::LiteralParser::attemptJSONParse):
3986 (JSC::LiteralParser::):
3987 (JSC::LiteralParser::Lexer::Lexer):
3988 (JSC::LiteralParser::Lexer::next):
3989 (JSC::LiteralParser::Lexer::currentToken):
3990 (JSC::LiteralParser::abortParse):
3991
3992 2009-05-08 Geoffrey Garen <ggaren@apple.com>
3993
3994 Not reviewed.
3995
3996 Restored a Mozilla JS test I accidentally gutted.
3997
3998 * tests/mozilla/ecma/Array/15.4.4.2.js:
3999 (getTestCases):
4000 (test):
4001
4002 2009-05-08 Geoffrey Garen <ggaren@apple.com>
4003
4004 Reviewed by Gavin Barraclough.
4005
4006 More abstraction for JITStub calls from JITed code.
4007
4008 Added a JITStubCall class that automatically handles things like assigning
4009 arguments to different stack slots and storing return values. Deployed
4010 the class in about a billion places. A bunch more places remain to be
4011 fixed up, but this is a good stopping point for now.
4012
4013 * jit/JIT.cpp:
4014 (JSC::JIT::emitTimeoutCheck):
4015 (JSC::JIT::privateCompileMainPass):
4016 (JSC::JIT::privateCompileSlowCases):
4017 (JSC::JIT::privateCompile):
4018 * jit/JIT.h:
4019 (JSC::JIT::JSRInfo::JSRInfo):
4020 (JSC::JITStubCall::JITStubCall):
4021 (JSC::JITStubCall::addArgument):
4022 (JSC::JITStubCall::call):
4023 (JSC::JITStubCall::):
4024 (JSC::CallEvalJITStub::CallEvalJITStub):
4025 * jit/JITArithmetic.cpp:
4026 (JSC::JIT::compileFastArithSlow_op_lshift):
4027 (JSC::JIT::compileFastArithSlow_op_rshift):
4028 (JSC::JIT::compileFastArithSlow_op_jnless):
4029 (JSC::JIT::compileFastArithSlow_op_bitand):
4030 (JSC::JIT::compileFastArithSlow_op_mod):
4031 (JSC::JIT::compileFastArith_op_mod):
4032 (JSC::JIT::compileFastArithSlow_op_post_inc):
4033 (JSC::JIT::compileFastArithSlow_op_post_dec):
4034 (JSC::JIT::compileFastArithSlow_op_pre_inc):
4035 (JSC::JIT::compileFastArithSlow_op_pre_dec):
4036 (JSC::JIT::compileFastArith_op_add):
4037 (JSC::JIT::compileFastArith_op_mul):
4038 (JSC::JIT::compileFastArith_op_sub):
4039 (JSC::JIT::compileBinaryArithOpSlowCase):
4040 (JSC::JIT::compileFastArithSlow_op_add):
4041 (JSC::JIT::compileFastArithSlow_op_mul):
4042 * jit/JITCall.cpp:
4043 (JSC::JIT::compileOpCall):
4044 (JSC::):
4045 * jit/JITPropertyAccess.cpp:
4046 (JSC::JIT::compileGetByIdHotPath):
4047 (JSC::JIT::compilePutByIdHotPath):
4048 (JSC::JIT::compileGetByIdSlowCase):
4049 (JSC::JIT::compilePutByIdSlowCase):
4050 * jit/JITStubs.cpp:
4051 (JSC::JITStubs::cti_op_resolve_func):
4052 (JSC::JITStubs::cti_op_resolve_with_base):
4053
4054 2009-05-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
4055
4056 Reviewed by Maciej Stachowiak.
4057
4058 Add a new opcode jnlesseq, and optimize its compilation in the JIT using
4059 techniques similar to what were used to optimize jnless in r43363.
4060
4061 This gives a 0.7% speedup on SunSpider, particularly on the tests 3d-cube,
4062 control-flow-recursive, date-format-xparb, and string-base64.
4063
4064 * bytecode/CodeBlock.cpp:
4065 (JSC::CodeBlock::dump): Add support for dumping op_jnlesseq.
4066 * bytecode/Opcode.h: Add op_jnlesseq to the list of opcodes.
4067 * bytecompiler/BytecodeGenerator.cpp:
4068 (JSC::BytecodeGenerator::emitJumpIfFalse): Add a peephole optimization
4069 for op_jnlesseq when emitting lesseq followed by a jump.
4070 * interpreter/Interpreter.cpp:
4071 (JSC::Interpreter::privateExecute): Add case for op_jnlesseq.
4072 * jit/JIT.cpp:
4073 (JSC::JIT::privateCompileMainPass): Add case for op_jnlesseq.
4074 (JSC::JIT::privateCompileSlowCases): Add case for op_jnlesseq.
4075 * jit/JIT.h:
4076 * jit/JITArithmetic.cpp:
4077 (JSC::JIT::compileFastArith_op_jnlesseq): Added.
4078 (JSC::JIT::compileFastArithSlow_op_jnlesseq): Added.
4079 * jit/JITStubs.cpp:
4080 (JSC::JITStubs::cti_op_jlesseq): Added.
4081 * jit/JITStubs.h:
4082
4083 2009-05-08 Maciej Stachowiak <mjs@apple.com>
4084
4085 Reviewed by Cameron Zwarich.
4086
4087 - fix test failures on 64-bit
4088
4089 * jit/JITArithmetic.cpp:
4090 (JSC::JIT::compileFastArithSlow_op_jnless): Avoid accidentaly treating an
4091 immediate int as an immediate float in the 64-bit value representation.
4092
4093 2009-05-08 Gavin Barraclough <barraclough@apple.com>
4094
4095 Rubber stamped by Oliver Hunt.
4096
4097 Removing an empty constructor and an uncalled, empty function seems to be a
4098 pretty solid 1% regeression on my machine, so I'm going to put them back.
4099 Um. Yeah, this this pretty pointles and makes no sense at all. I officially
4100 lose the will to live in 3... 2...
4101
4102 * bytecode/SamplingTool.cpp:
4103 (JSC::SamplingTool::notifyOfScope):
4104 * bytecode/SamplingTool.h:
4105 (JSC::SamplingTool::~SamplingTool):
4106
4107 2009-05-08 Gavin Barraclough <barraclough@apple.com>
4108
4109 Reviewed by Oliver "I see lots of ifdefs" Hunt.
4110
4111 Fix (kinda) for sampling tool breakage. The codeblock sampling tool has become
4112 b0rked due to recent changes in native function calling. The initialization of
4113 a ScopeNode appears to now occur before the sampling tool (or possibly the
4114 interpreter has been brought into existence, wihich leads to crashyness).
4115
4116 This patch doesn't fix the problem. The crash occurs when tracking a Scope, but
4117 we shouldn't need to track scopes when we're just sampling opcodes, not
4118 codeblocks. Not retaining Scopes when just opcode sampling will reduce sampling
4119 overhead reducing any instrumentation skew, which is a good thing. As a side
4120 benefit this patch also gets the opcode sampling going again, albeit in a bit of
4121 a lame way. Will come back later with a proper fix from codeblock sampling.
4122
4123 * JavaScriptCore.exp:
4124 * bytecode/SamplingTool.cpp:
4125 (JSC::compareLineCountInfoSampling):
4126 (JSC::SamplingTool::dump):
4127 * bytecode/SamplingTool.h:
4128 (JSC::SamplingTool::SamplingTool):
4129 * parser/Nodes.cpp:
4130 (JSC::ScopeNode::ScopeNode):
4131
4132 2009-05-07 Mark Rowe <mrowe@apple.com>
4133
4134 Rubber-stamped by Oliver Hunt.
4135
4136 Fix <https://bugs.webkit.org/show_bug.cgi?id=25640>.
4137 Bug 25640: Crash on quit in r43384 nightly build on Leopard w/ Safari 4 beta installed
4138
4139 Roll out r43366 as it removed symbols that Safari 4 Beta uses.
4140
4141 * JavaScriptCore.exp:
4142 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4143 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4144 * bytecode/SamplingTool.cpp:
4145 (JSC::SamplingThread::start):
4146 (JSC::SamplingThread::stop):
4147 * bytecode/SamplingTool.h:
4148 * wtf/CrossThreadRefCounted.h:
4149 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
4150 (WTF::::ref):
4151 (WTF::::deref):
4152 * wtf/Threading.h:
4153 * wtf/ThreadingNone.cpp:
4154 * wtf/ThreadingPthreads.cpp:
4155 (WTF::threadMapMutex):
4156 (WTF::initializeThreading):
4157 (WTF::threadMap):
4158 (WTF::identifierByPthreadHandle):
4159 (WTF::establishIdentifierForPthreadHandle):
4160 (WTF::pthreadHandleForIdentifier):
4161 (WTF::clearPthreadHandleForIdentifier):
4162 (WTF::createThreadInternal):
4163 (WTF::waitForThreadCompletion):
4164 (WTF::detachThread):
4165 (WTF::currentThread):
4166 * wtf/ThreadingWin.cpp:
4167 (WTF::threadMapMutex):
4168 (WTF::initializeThreading):
4169 (WTF::threadMap):
4170 (WTF::storeThreadHandleByIdentifier):
4171 (WTF::threadHandleForIdentifier):
4172 (WTF::clearThreadHandleForIdentifier):
4173 (WTF::createThreadInternal):
4174 (WTF::waitForThreadCompletion):
4175 (WTF::detachThread):
4176 (WTF::currentThread):
4177 * wtf/gtk/ThreadingGtk.cpp:
4178 (WTF::threadMapMutex):
4179 (WTF::initializeThreading):
4180 (WTF::threadMap):
4181 (WTF::identifierByGthreadHandle):
4182 (WTF::establishIdentifierForThread):
4183 (WTF::threadForIdentifier):
4184 (WTF::clearThreadForIdentifier):
4185 (WTF::createThreadInternal):
4186 (WTF::waitForThreadCompletion):
4187 (WTF::currentThread):
4188 * wtf/qt/ThreadingQt.cpp:
4189 (WTF::threadMapMutex):
4190 (WTF::threadMap):
4191 (WTF::identifierByQthreadHandle):
4192 (WTF::establishIdentifierForThread):
4193 (WTF::clearThreadForIdentifier):
4194 (WTF::threadForIdentifier):
4195 (WTF::initializeThreading):
4196 (WTF::createThreadInternal):
4197 (WTF::waitForThreadCompletion):
4198 (WTF::currentThread):
4199
4200 2009-05-07 Gustavo Noronha Silva <gns@gnome.org>
4201
4202 Suggested by Oliver Hunt.
4203
4204 Also check for Linux for the special-cased calling convention.
4205
4206 * jit/JIT.cpp:
4207 (JSC::JIT::privateCompileCTIMachineTrampolines):
4208 * wtf/Platform.h:
4209
4210 2009-05-07 Gavin Barraclough <barraclough@apple.com>
4211
4212 Reviewed by Maciej Stachowiak.
4213
4214 Previously, when appending to an existing string and growing the underlying buffer,
4215 we would actually allocate 110% of the required size in order to give us some space
4216 to expand into. Now we treat strings differently based on their size:
4217
4218 Small Strings (up to 4 pages):
4219 Expand the allocation size to 112.5% of the amount requested. This is largely sicking
4220 to our previous policy, however 112.5% is cheaper to calculate.
4221
4222 Medium Strings (up to 128 pages):
4223 For pages covering multiple pages over-allocation is less of a concern - any unused
4224 space will not be paged in if it is not used, so this is purely a VM overhead. For
4225 these strings allocate 2x the requested size.
4226
4227 Large Strings (to infinity and beyond!):
4228 Revert to our 112.5% policy - probably best to limit the amount of unused VM we allow
4229 any individual string be responsible for.
4230
4231 Additionally, round small allocations up to a multiple of 16 bytes, and medium and
4232 large allocations up to a multiple of page size.
4233
4234 ~1.5% progression on Sunspider, due to 5% improvement on tagcloud & 15% on validate.
4235
4236 * runtime/UString.cpp:
4237 (JSC::expandedSize):
4238
4239 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4240
4241 Reviewed by Cameron Zwarich.
4242
4243 Fixed a minor sequencing error introduced by recent Parser speedups.
4244
4245 * runtime/JSGlobalData.cpp:
4246 (JSC::JSGlobalData::createNativeThunk): Missed a spot in my last patch.
4247
4248 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4249
4250 Not reviewed.
4251
4252 * wtf/Platform.h: Reverted an accidental (and performance-catastrophic)
4253 change.
4254
4255 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4256
4257 Reviewed by Cameron Zwarich.
4258
4259 Fixed a minor sequencing error introduced by recent Parser speedups.
4260
4261 * parser/Parser.cpp:
4262 (JSC::Parser::reparseInPlace): Missed a spot in my last patch.
4263
4264 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4265
4266 Reviewed by Cameron Zwarich.
4267
4268 Fixed a minor sequencing error introduced by recent Parser speedups.
4269
4270 * parser/Parser.cpp:
4271 (JSC::Parser::parse):
4272 * parser/Parser.h:
4273 (JSC::Parser::parse):
4274 (JSC::Parser::reparse): Shrink the parsedObjects vector after allocating
4275 the root node, to avoid leaving a stray node in the vector, since that's
4276 a slight memory leak, and it causes problems during JSGlobalData teardown.
4277
4278 * runtime/JSGlobalData.cpp:
4279 (JSC::JSGlobalData::~JSGlobalData): ASSERT that we're not being torn
4280 down while we think we're still parsing, since that would cause lots of
4281 bad memory references during our destruction.
4282
4283 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4284
4285 Reviewed by Cameron Zwarich.
4286
4287 Replaced two more macros with references to the JITStackFrame structure.
4288
4289 * jit/JIT.cpp:
4290 (JSC::JIT::privateCompileMainPass):
4291 * jit/JITInlineMethods.h:
4292 (JSC::JIT::restoreArgumentReference):
4293 * jit/JITStubs.cpp:
4294 (JSC::):
4295 * jit/JITStubs.h:
4296
4297 2009-05-07 Oliver Hunt <oliver@apple.com>
4298
4299 Reviewed by Gavin Barraclough.
4300
4301 Improve native call performance
4302
4303 Fix the windows build by adding calling convention declarations everywhere,
4304 chose fastcall as that seemed most sensible given we were having to declare
4305 the convention explicitly. In addition switched to fastcall on mac in the
4306 deluded belief that documented fastcall behavior on windows would match
4307 actual its actual behavior.
4308
4309 * API/JSCallbackFunction.h:
4310 * API/JSCallbackObject.h:
4311 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
4312 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
4313 * interpreter/CallFrame.h:
4314 (JSC::ExecState::argumentCount):
4315 * jit/JIT.cpp:
4316 (JSC::JIT::privateCompileCTIMachineTrampolines):
4317 * jsc.cpp:
4318 (functionPrint):
4319 (functionDebug):
4320 (functionGC):
4321 (functionVersion):
4322 (functionRun):
4323 (functionLoad):
4324 (functionSetSamplingFlags):
4325 (functionClearSamplingFlags):
4326 (functionReadline):
4327 (functionQuit):
4328 * runtime/ArrayConstructor.cpp:
4329 (JSC::callArrayConstructor):
4330 * runtime/ArrayPrototype.cpp:
4331 (JSC::arrayProtoFuncToString):
4332 (JSC::arrayProtoFuncToLocaleString):
4333 (JSC::arrayProtoFuncJoin):
4334 (JSC::arrayProtoFuncConcat):
4335 (JSC::arrayProtoFuncPop):
4336 (JSC::arrayProtoFuncPush):
4337 (JSC::arrayProtoFuncReverse):
4338 (JSC::arrayProtoFuncShift):
4339 (JSC::arrayProtoFuncSlice):
4340 (JSC::arrayProtoFuncSort):
4341 (JSC::arrayProtoFuncSplice):
4342 (JSC::arrayProtoFuncUnShift):
4343 (JSC::arrayProtoFuncFilter):
4344 (JSC::arrayProtoFuncMap):
4345 (JSC::arrayProtoFuncEvery):
4346 (JSC::arrayProtoFuncForEach):
4347 (JSC::arrayProtoFuncSome):
4348 (JSC::arrayProtoFuncReduce):
4349 (JSC::arrayProtoFuncReduceRight):
4350 (JSC::arrayProtoFuncIndexOf):
4351 (JSC::arrayProtoFuncLastIndexOf):
4352 * runtime/BooleanConstructor.cpp:
4353 (JSC::callBooleanConstructor):
4354 * runtime/BooleanPrototype.cpp:
4355 (JSC::booleanProtoFuncToString):
4356 (JSC::booleanProtoFuncValueOf):
4357 * runtime/CallData.h:
4358 * runtime/DateConstructor.cpp:
4359 (JSC::callDate):
4360 (JSC::dateParse):
4361 (JSC::dateNow):
4362 (JSC::dateUTC):
4363 * runtime/DatePrototype.cpp:
4364 (JSC::dateProtoFuncToString):
4365 (JSC::dateProtoFuncToUTCString):
4366 (JSC::dateProtoFuncToDateString):
4367 (JSC::dateProtoFuncToTimeString):
4368 (JSC::dateProtoFuncToLocaleString):
4369 (JSC::dateProtoFuncToLocaleDateString):
4370 (JSC::dateProtoFuncToLocaleTimeString):
4371 (JSC::dateProtoFuncGetTime):
4372 (JSC::dateProtoFuncGetFullYear):
4373 (JSC::dateProtoFuncGetUTCFullYear):
4374 (JSC::dateProtoFuncToGMTString):
4375 (JSC::dateProtoFuncGetMonth):
4376 (JSC::dateProtoFuncGetUTCMonth):
4377 (JSC::dateProtoFuncGetDate):
4378 (JSC::dateProtoFuncGetUTCDate):
4379 (JSC::dateProtoFuncGetDay):
4380 (JSC::dateProtoFuncGetUTCDay):
4381 (JSC::dateProtoFuncGetHours):
4382 (JSC::dateProtoFuncGetUTCHours):
4383 (JSC::dateProtoFuncGetMinutes):
4384 (JSC::dateProtoFuncGetUTCMinutes):
4385 (JSC::dateProtoFuncGetSeconds):
4386 (JSC::dateProtoFuncGetUTCSeconds):
4387 (JSC::dateProtoFuncGetMilliSeconds):
4388 (JSC::dateProtoFuncGetUTCMilliseconds):
4389 (JSC::dateProtoFuncGetTimezoneOffset):
4390 (JSC::dateProtoFuncSetTime):
4391 (JSC::dateProtoFuncSetMilliSeconds):
4392 (JSC::dateProtoFuncSetUTCMilliseconds):
4393 (JSC::dateProtoFuncSetSeconds):
4394 (JSC::dateProtoFuncSetUTCSeconds):
4395 (JSC::dateProtoFuncSetMinutes):
4396 (JSC::dateProtoFuncSetUTCMinutes):
4397 (JSC::dateProtoFuncSetHours):
4398 (JSC::dateProtoFuncSetUTCHours):
4399 (JSC::dateProtoFuncSetDate):
4400 (JSC::dateProtoFuncSetUTCDate):
4401 (JSC::dateProtoFuncSetMonth):
4402 (JSC::dateProtoFuncSetUTCMonth):
4403 (JSC::dateProtoFuncSetFullYear):
4404 (JSC::dateProtoFuncSetUTCFullYear):
4405 (JSC::dateProtoFuncSetYear):
4406 (JSC::dateProtoFuncGetYear):
4407 * runtime/ErrorConstructor.cpp:
4408 (JSC::callErrorConstructor):
4409 * runtime/ErrorPrototype.cpp:
4410 (JSC::errorProtoFuncToString):
4411 * runtime/FunctionConstructor.cpp:
4412 (JSC::callFunctionConstructor):
4413 * runtime/FunctionPrototype.cpp:
4414 (JSC::callFunctionPrototype):
4415 (JSC::functionProtoFuncToString):
4416 (JSC::functionProtoFuncApply):
4417 (JSC::functionProtoFuncCall):
4418 * runtime/JSFunction.h:
4419 (JSC::JSFunction::nativeFunction):
4420 (JSC::JSFunction::setScopeChain):
4421 * runtime/JSGlobalObjectFunctions.cpp:
4422 (JSC::globalFuncEval):
4423 (JSC::globalFuncParseInt):
4424 (JSC::globalFuncParseFloat):
4425 (JSC::globalFuncIsNaN):
4426 (JSC::globalFuncIsFinite):
4427 (JSC::globalFuncDecodeURI):
4428 (JSC::globalFuncDecodeURIComponent):
4429 (JSC::globalFuncEncodeURI):
4430 (JSC::globalFuncEncodeURIComponent):
4431 (JSC::globalFuncEscape):
4432 (JSC::globalFuncUnescape):
4433 (JSC::globalFuncJSCPrint):
4434 * runtime/JSGlobalObjectFunctions.h:
4435 * runtime/MathObject.cpp:
4436 (JSC::mathProtoFuncAbs):
4437 (JSC::mathProtoFuncACos):
4438 (JSC::mathProtoFuncASin):
4439 (JSC::mathProtoFuncATan):
4440 (JSC::mathProtoFuncATan2):
4441 (JSC::mathProtoFuncCeil):
4442 (JSC::mathProtoFuncCos):
4443 (JSC::mathProtoFuncExp):
4444 (JSC::mathProtoFuncFloor):
4445 (JSC::mathProtoFuncLog):
4446 (JSC::mathProtoFuncMax):
4447 (JSC::mathProtoFuncMin):
4448 (JSC::mathProtoFuncPow):
4449 (JSC::mathProtoFuncRandom):
4450 (JSC::mathProtoFuncRound):
4451 (JSC::mathProtoFuncSin):
4452 (JSC::mathProtoFuncSqrt):
4453 (JSC::mathProtoFuncTan):
4454 * runtime/NativeErrorConstructor.cpp:
4455 (JSC::callNativeErrorConstructor):
4456 * runtime/NativeFunctionWrapper.h:
4457 * runtime/NumberConstructor.cpp:
4458 (JSC::callNumberConstructor):
4459 * runtime/NumberPrototype.cpp:
4460 (JSC::numberProtoFuncToString):
4461 (JSC::numberProtoFuncToLocaleString):
4462 (JSC::numberProtoFuncValueOf):
4463 (JSC::numberProtoFuncToFixed):
4464 (JSC::numberProtoFuncToExponential):
4465 (JSC::numberProtoFuncToPrecision):
4466 * runtime/ObjectConstructor.cpp:
4467 (JSC::callObjectConstructor):
4468 * runtime/ObjectPrototype.cpp:
4469 (JSC::objectProtoFuncValueOf):
4470 (JSC::objectProtoFuncHasOwnProperty):
4471 (JSC::objectProtoFuncIsPrototypeOf):
4472 (JSC::objectProtoFuncDefineGetter):
4473 (JSC::objectProtoFuncDefineSetter):
4474 (JSC::objectProtoFuncLookupGetter):
4475 (JSC::objectProtoFuncLookupSetter):
4476 (JSC::objectProtoFuncPropertyIsEnumerable):
4477 (JSC::objectProtoFuncToLocaleString):
4478 (JSC::objectProtoFuncToString):
4479 * runtime/ObjectPrototype.h:
4480 * runtime/RegExpConstructor.cpp:
4481 (JSC::callRegExpConstructor):
4482 * runtime/RegExpObject.cpp:
4483 (JSC::callRegExpObject):
4484 * runtime/RegExpPrototype.cpp:
4485 (JSC::regExpProtoFuncTest):
4486 (JSC::regExpProtoFuncExec):
4487 (JSC::regExpProtoFuncCompile):
4488 (JSC::regExpProtoFuncToString):
4489 * runtime/StringConstructor.cpp:
4490 (JSC::stringFromCharCode):
4491 (JSC::callStringConstructor):
4492 * runtime/StringPrototype.cpp:
4493 (JSC::stringProtoFuncReplace):
4494 (JSC::stringProtoFuncToString):
4495 (JSC::stringProtoFuncCharAt):
4496 (JSC::stringProtoFuncCharCodeAt):
4497 (JSC::stringProtoFuncConcat):
4498 (JSC::stringProtoFuncIndexOf):
4499 (JSC::stringProtoFuncLastIndexOf):
4500 (JSC::stringProtoFuncMatch):
4501 (JSC::stringProtoFuncSearch):
4502 (JSC::stringProtoFuncSlice):
4503 (JSC::stringProtoFuncSplit):
4504 (JSC::stringProtoFuncSubstr):
4505 (JSC::stringProtoFuncSubstring):
4506 (JSC::stringProtoFuncToLowerCase):
4507 (JSC::stringProtoFuncToUpperCase):
4508 (JSC::stringProtoFuncLocaleCompare):
4509 (JSC::stringProtoFuncBig):
4510 (JSC::stringProtoFuncSmall):
4511 (JSC::stringProtoFuncBlink):
4512 (JSC::stringProtoFuncBold):
4513 (JSC::stringProtoFuncFixed):
4514 (JSC::stringProtoFuncItalics):
4515 (JSC::stringProtoFuncStrike):
4516 (JSC::stringProtoFuncSub):
4517 (JSC::stringProtoFuncSup):
4518 (JSC::stringProtoFuncFontcolor):
4519 (JSC::stringProtoFuncFontsize):
4520 (JSC::stringProtoFuncAnchor):
4521 (JSC::stringProtoFuncLink):
4522 * wtf/Platform.h:
4523
4524 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4525
4526 Not reviewed.
4527
4528 Rolled out a portion of r43352 because it broke 64bit.
4529
4530 * jit/JITStubs.h:
4531
4532 2009-05-07 Kevin Ollivier <kevino@theolliviers.com>
4533
4534 Build fix for functions reaturning ThreadIdentifier.
4535
4536 * wtf/ThreadingNone.cpp:
4537 (WTF::createThreadInternal):
4538 (WTF::currentThread):
4539
4540 2009-05-07 Maciej Stachowiak <mjs@apple.com>
4541
4542 Reviewed by John Honeycutt.
4543
4544 - enable optimization case im the last patch that I accidentally had disabled.
4545
4546 * jit/JITArithmetic.cpp:
4547 (JSC::JIT::compileFastArithSlow_op_jnless):
4548
4549 2009-05-07 Dmitry Titov <dimich@chromium.org>
4550
4551 Attempt to fix Win build.
4552
4553 * jit/JITArithmetic.cpp:
4554 (JSC::JIT::compileFastArithSlow_op_jnless):
4555
4556 2009-05-07 Dmitry Titov <dimich@chromium.org>
4557
4558 Reviewed by Alexey Proskuryakov and Adam Roben.
4559
4560 https://bugs.webkit.org/show_bug.cgi?id=25348
4561 Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
4562
4563 * wtf/Threading.h:
4564 (WTF::ThreadIdentifier::ThreadIdentifier):
4565 (WTF::ThreadIdentifier::isValid):
4566 (WTF::ThreadIdentifier::invalidate):
4567 (WTF::ThreadIdentifier::platformId):
4568 ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
4569 methods that are used across the code on thread ids: construction, comparisons,
4570 check for 'valid' state etc. '0' is used as invalid id, which happens to just work
4571 with all platform-specific thread id implementations.
4572
4573 All the following files repeatedly reflect the new ThreadIdentifier for each platform.
4574 We remove ThreadMap and threadMapMutex from all of them, remove the functions that
4575 populated/searched/cleared the map and add platform-specific comparison operators
4576 for ThreadIdentifier.
4577
4578 * wtf/gtk/ThreadingGtk.cpp:
4579 (WTF::ThreadIdentifier::operator==):
4580 (WTF::ThreadIdentifier::operator!=):
4581 (WTF::initializeThreading):
4582 (WTF::createThreadInternal):
4583 (WTF::waitForThreadCompletion):
4584 (WTF::currentThread):
4585
4586 * wtf/ThreadingNone.cpp:
4587 (WTF::ThreadIdentifier::operator==):
4588 (WTF::ThreadIdentifier::operator!=):
4589
4590 * wtf/ThreadingPthreads.cpp:
4591 (WTF::ThreadIdentifier::operator==):
4592 (WTF::ThreadIdentifier::operator!=):
4593 (WTF::initializeThreading):
4594 (WTF::createThreadInternal):
4595 (WTF::waitForThreadCompletion):
4596 (WTF::detachThread):
4597 (WTF::currentThread):
4598
4599 * wtf/qt/ThreadingQt.cpp:
4600 (WTF::ThreadIdentifier::operator==):
4601 (WTF::ThreadIdentifier::operator!=):
4602 (WTF::initializeThreading):
4603 (WTF::createThreadInternal):
4604 (WTF::waitForThreadCompletion):
4605 (WTF::currentThread):
4606
4607 * wtf/ThreadingWin.cpp:
4608 (WTF::ThreadIdentifier::operator==):
4609 (WTF::ThreadIdentifier::operator!=):
4610 (WTF::initializeThreading):
4611 (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
4612 counter as a thread ID and mapped it into platform ID. Windows was using native thread
4613 id and mapped it into thread handle. Since we can always obtain a thread handle
4614 by thread id, createThread now closes the handle.
4615 (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
4616 it means the thread already exited.
4617 (WTF::detachThread):
4618 (WTF::currentThread):
4619 (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
4620 (WTF::waitForThreadCompletionDeprecated): same.
4621 (WTF::currentThreadDeprecated): same.
4622 (WTF::createThreadDeprecated): same.
4623
4624 * bytecode/SamplingTool.h:
4625 * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
4626
4627 * JavaScriptCore.exp: export lists - updated the WTF threading functions decorated names
4628 since they now take a different type as a parameter.
4629 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
4630 that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
4631 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
4632
4633 2009-05-07 Maciej Stachowiak <mjs@apple.com>
4634
4635 Reviewed by Sam Weinig.
4636
4637 - optimize various cases of branch-fused less
4638
4639 1% speedup on SunSpider overall
4640 13% speedup on math-cordic
4641
4642 * jit/JIT.cpp:
4643 (JSC::JIT::privateCompileMainPass):
4644 op_loop_if_less: Optimize case of constant as first operand, just as case of constant as
4645 second operand.
4646 op_jnless: Factored out into compileFastArith_op_jnless.
4647 (JSC::JIT::privateCompileSlowCases):
4648 op_jnless: Factored out into compileFastArithSlow_op_jnless.
4649 * jit/JIT.h:
4650 * jit/JITArithmetic.cpp:
4651 (JSC::JIT::compileFastArith_op_jnless): Factored out from main compile loop.
4652 - Generate inline code for comparison of constant immediate int as first operand to another
4653 immediate int, as for loop_if_less
4654
4655 (JSC::JIT::compileFastArithSlow_op_jnless):
4656 - Generate inline code for comparing two floating point numbers.
4657 - Generate code for both cases of comparing a floating point number to a constant immediate
4658 int.
4659 * bytecode/CodeBlock.cpp:
4660 (JSC::CodeBlock::dump): Fix dumping of op_jnless (tangentially related bugfix).
4661
4662 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4663
4664 Reviewed by Sam Weinig.
4665
4666 Added the return address of a stub function to the JITStackFrame abstraction.
4667
4668 * jit/JIT.cpp:
4669 * jit/JIT.h:
4670 * jit/JITStubs.cpp:
4671 (JSC::):
4672 (JSC::StackHack::StackHack):
4673 (JSC::StackHack::~StackHack):
4674 (JSC::returnToThrowTrampoline):
4675 (JSC::JITStubs::cti_op_convert_this):
4676 (JSC::JITStubs::cti_op_end):
4677 (JSC::JITStubs::cti_op_add):
4678 (JSC::JITStubs::cti_op_pre_inc):
4679 (JSC::JITStubs::cti_timeout_check):
4680 (JSC::JITStubs::cti_register_file_check):
4681 (JSC::JITStubs::cti_op_loop_if_less):
4682 (JSC::JITStubs::cti_op_loop_if_lesseq):
4683 (JSC::JITStubs::cti_op_new_object):
4684 (JSC::JITStubs::cti_op_put_by_id_generic):
4685 (JSC::JITStubs::cti_op_get_by_id_generic):
4686 (JSC::JITStubs::cti_op_put_by_id):
4687 (JSC::JITStubs::cti_op_put_by_id_second):
4688 (JSC::JITStubs::cti_op_put_by_id_fail):
4689 (JSC::JITStubs::cti_op_get_by_id):
4690 (JSC::JITStubs::cti_op_get_by_id_second):
4691 (JSC::JITStubs::cti_op_get_by_id_self_fail):
4692 (JSC::JITStubs::cti_op_get_by_id_proto_list):
4693 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
4694 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
4695 (JSC::JITStubs::cti_op_get_by_id_array_fail):
4696 (JSC::JITStubs::cti_op_get_by_id_string_fail):
4697 (JSC::JITStubs::cti_op_instanceof):
4698 (JSC::JITStubs::cti_op_del_by_id):
4699 (JSC::JITStubs::cti_op_mul):
4700 (JSC::JITStubs::cti_op_new_func):
4701 (JSC::JITStubs::cti_op_call_JSFunction):
4702 (JSC::JITStubs::cti_op_call_arityCheck):
4703 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
4704 (JSC::JITStubs::cti_vm_lazyLinkCall):
4705 (JSC::JITStubs::cti_op_push_activation):
4706 (JSC::JITStubs::cti_op_call_NotJSFunction):
4707 (JSC::JITStubs::cti_op_create_arguments):
4708 (JSC::JITStubs::cti_op_create_arguments_no_params):
4709 (JSC::JITStubs::cti_op_tear_off_activation):
4710 (JSC::JITStubs::cti_op_tear_off_arguments):
4711 (JSC::JITStubs::cti_op_profile_will_call):
4712 (JSC::JITStubs::cti_op_profile_did_call):
4713 (JSC::JITStubs::cti_op_ret_scopeChain):
4714 (JSC::JITStubs::cti_op_new_array):
4715 (JSC::JITStubs::cti_op_resolve):
4716 (JSC::JITStubs::cti_op_construct_JSConstruct):
4717 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
4718 (JSC::JITStubs::cti_op_get_by_val):
4719 (JSC::JITStubs::cti_op_get_by_val_string):
4720 (JSC::JITStubs::cti_op_get_by_val_byte_array):
4721 (JSC::JITStubs::cti_op_resolve_func):
4722 (JSC::JITStubs::cti_op_sub):
4723 (JSC::JITStubs::cti_op_put_by_val):
4724 (JSC::JITStubs::cti_op_put_by_val_array):
4725 (JSC::JITStubs::cti_op_put_by_val_byte_array):
4726 (JSC::JITStubs::cti_op_lesseq):
4727 (JSC::JITStubs::cti_op_loop_if_true):
4728 (JSC::JITStubs::cti_op_load_varargs):
4729 (JSC::JITStubs::cti_op_negate):
4730 (JSC::JITStubs::cti_op_resolve_base):
4731 (JSC::JITStubs::cti_op_resolve_skip):
4732 (JSC::JITStubs::cti_op_resolve_global):
4733 (JSC::JITStubs::cti_op_div):
4734 (JSC::JITStubs::cti_op_pre_dec):
4735 (JSC::JITStubs::cti_op_jless):
4736 (JSC::JITStubs::cti_op_not):
4737 (JSC::JITStubs::cti_op_jtrue):
4738 (JSC::JITStubs::cti_op_post_inc):
4739 (JSC::JITStubs::cti_op_eq):
4740 (JSC::JITStubs::cti_op_lshift):
4741 (JSC::JITStubs::cti_op_bitand):
4742 (JSC::JITStubs::cti_op_rshift):
4743 (JSC::JITStubs::cti_op_bitnot):
4744 (JSC::JITStubs::cti_op_resolve_with_base):
4745 (JSC::JITStubs::cti_op_new_func_exp):
4746 (JSC::JITStubs::cti_op_mod):
4747 (JSC::JITStubs::cti_op_less):
4748 (JSC::JITStubs::cti_op_neq):
4749 (JSC::JITStubs::cti_op_post_dec):
4750 (JSC::JITStubs::cti_op_urshift):
4751 (JSC::JITStubs::cti_op_bitxor):
4752 (JSC::JITStubs::cti_op_new_regexp):
4753 (JSC::JITStubs::cti_op_bitor):
4754 (JSC::JITStubs::cti_op_call_eval):
4755 (JSC::JITStubs::cti_op_throw):
4756 (JSC::JITStubs::cti_op_get_pnames):
4757 (JSC::JITStubs::cti_op_next_pname):
4758 (JSC::JITStubs::cti_op_push_scope):
4759 (JSC::JITStubs::cti_op_pop_scope):
4760 (JSC::JITStubs::cti_op_typeof):
4761 (JSC::JITStubs::cti_op_is_undefined):
4762 (JSC::JITStubs::cti_op_is_boolean):
4763 (JSC::JITStubs::cti_op_is_number):
4764 (JSC::JITStubs::cti_op_is_string):
4765 (JSC::JITStubs::cti_op_is_object):
4766 (JSC::JITStubs::cti_op_is_function):
4767 (JSC::JITStubs::cti_op_stricteq):
4768 (JSC::JITStubs::cti_op_to_primitive):
4769 (JSC::JITStubs::cti_op_strcat):
4770 (JSC::JITStubs::cti_op_nstricteq):
4771 (JSC::JITStubs::cti_op_to_jsnumber):
4772 (JSC::JITStubs::cti_op_in):
4773 (JSC::JITStubs::cti_op_push_new_scope):
4774 (JSC::JITStubs::cti_op_jmp_scopes):
4775 (JSC::JITStubs::cti_op_put_by_index):
4776 (JSC::JITStubs::cti_op_switch_imm):
4777 (JSC::JITStubs::cti_op_switch_char):
4778 (JSC::JITStubs::cti_op_switch_string):
4779 (JSC::JITStubs::cti_op_del_by_val):
4780 (JSC::JITStubs::cti_op_put_getter):
4781 (JSC::JITStubs::cti_op_put_setter):
4782 (JSC::JITStubs::cti_op_new_error):
4783 (JSC::JITStubs::cti_op_debug):
4784 (JSC::JITStubs::cti_vm_throw):
4785 * jit/JITStubs.h:
4786 (JSC::JITStackFrame::returnAddressSlot):
4787
4788 2009-05-07 Darin Adler <darin@apple.com>
4789
4790 Reviewed by Geoff Garen.
4791
4792 * parser/Lexer.cpp:
4793 (JSC::Lexer::lex): Fix missing braces. This would make us always
4794 take the slower case for string parsing and Visual Studio correctly
4795 noticed unreachable code.
4796
4797 2009-05-07 Darin Adler <darin@apple.com>
4798
4799 Reviewed by Sam Weinig.
4800
4801 Bug 25589: goto instead of state machine in lexer
4802 https://bugs.webkit.org/show_bug.cgi?id=25589
4803
4804 SunSpider is 0.8% faster.
4805
4806 * parser/Lexer.cpp:
4807 (JSC::Lexer::currentCharacter): Added.
4808 (JSC::Lexer::currentOffset): Changed to call currentCharacter for clarity.
4809 (JSC::Lexer::setCode): Removed code to set now-obsolete m_skipLineEnd.
4810 (JSC::Lexer::shiftLineTerminator): Added. Handles line numbers and the
4811 two-character line terminators.
4812 (JSC::Lexer::makeIdentifier): Changed to take characters and length rather
4813 than a vector, since we now make these directly out of the source buffer
4814 when possible.
4815 (JSC::Lexer::lastTokenWasRestrKeyword): Added.
4816 (JSC::isNonASCIIIdentStart): Broke out the non-inline part.
4817 (JSC::isIdentStart): Moved here.
4818 (JSC::isNonASCIIIdentPart): Broke out the non-inline part.
4819 (JSC::isIdentPart): Moved here.
4820 (JSC::singleEscape): Moved here, and removed some unneeded cases.
4821 (JSC::Lexer::record8): Moved here.
4822 (JSC::Lexer::record16): Moved here.
4823 (JSC::Lexer::lex): Rewrote this whole function to use goto and not use
4824 a state machine. Got rid of most of the local variables. Also rolled the
4825 matchPunctuator function in here.
4826 (JSC::Lexer::scanRegExp): Changed to use the new version of isLineTerminator.
4827 Clear m_buffer16 after using it instead of before.
4828
4829 * parser/Lexer.h: Removed State enum, setDone function, nextLine function,
4830 lookupKeywordFunction, one of the isLineTerminator functions, m_done data member,
4831 m_skipLineEnd data member, and m_state data member. Added shiftLineTerminator
4832 function, currentCharacter function, and changed the arguments to the makeIdentifier
4833 function. Removed one branch from the isLineTerminator function.
4834
4835 * runtime/StringPrototype.cpp:
4836 (JSC::stringProtoFuncReplace): Streamlined the case where we don't replace anything.
4837
4838 2009-05-07 Geoffrey Garen <ggaren@apple.com>
4839
4840 Reviewed by Gavin Barraclough.
4841
4842 Removed a few more special constants, and replaced them with uses of
4843 the JITStackFrame struct.
4844
4845 Removed one of the two possible definitions of VoidPtrPair. The Mac
4846 definition was more elegant, but SunSpider doesn't think it's any
4847 faster, and it's net less elegant to have two ways of doing things.
4848
4849 * jit/JIT.cpp:
4850 (JSC::JIT::privateCompileMainPass):
4851 (JSC::JIT::privateCompile):
4852 * jit/JITStubs.h:
4853 (JSC::):
4854
4855 2009-05-07 Darin Adler <darin@apple.com>
4856
4857 * runtime/ScopeChain.h:
4858 (JSC::ScopeChainNode::~ScopeChainNode): Tweak formatting.
4859
4860 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
4861
4862 Reviewed by Tor Arne Vestbø.
4863
4864 Fix the build thread stack base determination build on Symbian,
4865 by moving the code block before PLATFORM(UNIX), which is also
4866 enabled on Symbian builds.
4867
4868 * runtime/Collector.cpp:
4869 (JSC::currentThreadStackBase):
4870
4871 2009-05-07 Oliver Hunt <oliver@apple.com>
4872
4873 Reviewed by Gavin Barraclough.
4874
4875 Fix crash due to incorrectly using an invalid scopechain
4876
4877 stringProtoFuncReplace was checking for an exception on a CachedCall
4878 by asking for the cached callframes exception. Unfortunately this
4879 could crash in certain circumstances as CachedCall does not guarantee
4880 a valid callframe following a call. Even more unfortunately the check
4881 was entirely unnecessary as there is only a single exception slot per
4882 global data, so it was already checked via the initial exec->hadException()
4883 check.
4884
4885 To make bugs like this more obvious, i've added a debug only destructor
4886 to ScopeChainNode that 0's all of its fields. This exposed a crash in
4887 the standard javascriptcore tests.
4888
4889 * runtime/ScopeChain.h:
4890 (JSC::ScopeChainNode::~ScopeChainNode):
4891 (JSC::ScopeChain::~ScopeChain):
4892 * runtime/StringPrototype.cpp:
4893 (JSC::stringProtoFuncReplace):
4894
4895 2009-05-07 Gavin Barraclough <barraclough@apple.com>
4896
4897 Reviewed by Geoff Garen.
4898
4899 Enable op_strcat across += assignments. This patch allows the lhs of a read/modify node
4900 to be included within the concatenation operation, and also modifies the implementation
4901 of the concatenation to attempt to reuse and cat onto the leftmost string, rather than
4902 always allocating a new empty output string to copy into (as was previously the behaviour).
4903
4904 ~0.5% progression, due to a 3%-3.5% progression on the string tests (particularly validate).
4905
4906 * parser/Nodes.cpp:
4907 (JSC::BinaryOpNode::emitStrcat):
4908 (JSC::emitReadModifyAssignment):
4909 (JSC::ReadModifyResolveNode::emitBytecode):
4910 (JSC::ReadModifyDotNode::emitBytecode):
4911 (JSC::ReadModifyBracketNode::emitBytecode):
4912 * parser/Nodes.h:
4913 * runtime/Operations.h:
4914 (JSC::concatenateStrings):
4915 * runtime/UString.cpp:
4916 (JSC::UString::reserveCapacity):
4917 * runtime/UString.h:
4918
4919 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
4920
4921 Reviewed by Oliver Hunt.
4922
4923 Fix the build on Windows without JIT: interpreter/RegisterFile.h needs
4924 roundUpAllocationSize, which is protected by #if ENABLED(ASSEMBLER).
4925 Moved the #ifdef down and always offer the function.
4926
4927 * jit/ExecutableAllocator.h:
4928
4929 2009-05-06 Geoffrey Garen <ggaren@apple.com>
4930
4931 Reviewed by Gavin "++" Barraclough.
4932
4933 Added some abstraction around the JIT stub calling convention by creating
4934 a struct to represent the persistent stack frame JIT code shares with
4935 JIT stubs.
4936
4937 SunSpider reports no change.
4938
4939 * jit/JIT.h:
4940 * jit/JITStubs.cpp:
4941 (JSC::JITStubs::cti_op_convert_this):
4942 (JSC::JITStubs::cti_op_end):
4943 (JSC::JITStubs::cti_op_add):
4944 (JSC::JITStubs::cti_op_pre_inc):
4945 (JSC::JITStubs::cti_timeout_check):
4946 (JSC::JITStubs::cti_register_file_check):
4947 (JSC::JITStubs::cti_op_loop_if_less):
4948 (JSC::JITStubs::cti_op_loop_if_lesseq):
4949 (JSC::JITStubs::cti_op_new_object):
4950 (JSC::JITStubs::cti_op_put_by_id_generic):
4951 (JSC::JITStubs::cti_op_get_by_id_generic):
4952 (JSC::JITStubs::cti_op_put_by_id):
4953 (JSC::JITStubs::cti_op_put_by_id_second):
4954 (JSC::JITStubs::cti_op_put_by_id_fail):
4955 (JSC::JITStubs::cti_op_get_by_id):
4956 (JSC::JITStubs::cti_op_get_by_id_second):
4957 (JSC::JITStubs::cti_op_get_by_id_self_fail):
4958 (JSC::JITStubs::cti_op_get_by_id_proto_list):
4959 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
4960 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
4961 (JSC::JITStubs::cti_op_get_by_id_array_fail):
4962 (JSC::JITStubs::cti_op_get_by_id_string_fail):
4963 (JSC::JITStubs::cti_op_instanceof):
4964 (JSC::JITStubs::cti_op_del_by_id):
4965 (JSC::JITStubs::cti_op_mul):
4966 (JSC::JITStubs::cti_op_new_func):
4967 (JSC::JITStubs::cti_op_call_JSFunction):
4968 (JSC::JITStubs::cti_op_call_arityCheck):
4969 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
4970 (JSC::JITStubs::cti_vm_lazyLinkCall):
4971 (JSC::JITStubs::cti_op_push_activation):
4972 (JSC::JITStubs::cti_op_call_NotJSFunction):
4973 (JSC::JITStubs::cti_op_create_arguments):
4974 (JSC::JITStubs::cti_op_create_arguments_no_params):
4975 (JSC::JITStubs::cti_op_tear_off_activation):
4976 (JSC::JITStubs::cti_op_tear_off_arguments):
4977 (JSC::JITStubs::cti_op_profile_will_call):
4978 (JSC::JITStubs::cti_op_profile_did_call):
4979 (JSC::JITStubs::cti_op_ret_scopeChain):
4980 (JSC::JITStubs::cti_op_new_array):
4981 (JSC::JITStubs::cti_op_resolve):
4982 (JSC::JITStubs::cti_op_construct_JSConstruct):
4983 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
4984 (JSC::JITStubs::cti_op_get_by_val):
4985 (JSC::JITStubs::cti_op_get_by_val_string):
4986 (JSC::JITStubs::cti_op_get_by_val_byte_array):
4987 (JSC::JITStubs::cti_op_resolve_func):
4988 (JSC::JITStubs::cti_op_sub):
4989 (JSC::JITStubs::cti_op_put_by_val):
4990 (JSC::JITStubs::cti_op_put_by_val_array):
4991 (JSC::JITStubs::cti_op_put_by_val_byte_array):
4992 (JSC::JITStubs::cti_op_lesseq):
4993 (JSC::JITStubs::cti_op_loop_if_true):
4994 (JSC::JITStubs::cti_op_load_varargs):
4995 (JSC::JITStubs::cti_op_negate):
4996 (JSC::JITStubs::cti_op_resolve_base):
4997 (JSC::JITStubs::cti_op_resolve_skip):
4998 (JSC::JITStubs::cti_op_resolve_global):
4999 (JSC::JITStubs::cti_op_div):
5000 (JSC::JITStubs::cti_op_pre_dec):
5001 (JSC::JITStubs::cti_op_jless):
5002 (JSC::JITStubs::cti_op_not):
5003 (JSC::JITStubs::cti_op_jtrue):
5004 (JSC::JITStubs::cti_op_post_inc):
5005 (JSC::JITStubs::cti_op_eq):
5006 (JSC::JITStubs::cti_op_lshift):
5007 (JSC::JITStubs::cti_op_bitand):
5008 (JSC::JITStubs::cti_op_rshift):
5009 (JSC::JITStubs::cti_op_bitnot):
5010 (JSC::JITStubs::cti_op_resolve_with_base):
5011 (JSC::JITStubs::cti_op_new_func_exp):
5012 (JSC::JITStubs::cti_op_mod):
5013 (JSC::JITStubs::cti_op_less):
5014 (JSC::JITStubs::cti_op_neq):
5015 (JSC::JITStubs::cti_op_post_dec):
5016 (JSC::JITStubs::cti_op_urshift):
5017 (JSC::JITStubs::cti_op_bitxor):
5018 (JSC::JITStubs::cti_op_new_regexp):
5019 (JSC::JITStubs::cti_op_bitor):
5020 (JSC::JITStubs::cti_op_call_eval):
5021 (JSC::JITStubs::cti_op_throw):
5022 (JSC::JITStubs::cti_op_get_pnames):
5023 (JSC::JITStubs::cti_op_next_pname):
5024 (JSC::JITStubs::cti_op_push_scope):
5025 (JSC::JITStubs::cti_op_pop_scope):
5026 (JSC::JITStubs::cti_op_typeof):
5027 (JSC::JITStubs::cti_op_is_undefined):
5028 (JSC::JITStubs::cti_op_is_boolean):
5029 (JSC::JITStubs::cti_op_is_number):
5030 (JSC::JITStubs::cti_op_is_string):
5031 (JSC::JITStubs::cti_op_is_object):
5032 (JSC::JITStubs::cti_op_is_function):
5033 (JSC::JITStubs::cti_op_stricteq):
5034 (JSC::JITStubs::cti_op_to_primitive):
5035 (JSC::JITStubs::cti_op_strcat):
5036 (JSC::JITStubs::cti_op_nstricteq):
5037 (JSC::JITStubs::cti_op_to_jsnumber):
5038 (JSC::JITStubs::cti_op_in):
5039 (JSC::JITStubs::cti_op_push_new_scope):
5040 (JSC::JITStubs::cti_op_jmp_scopes):
5041 (JSC::JITStubs::cti_op_put_by_index):
5042 (JSC::JITStubs::cti_op_switch_imm):
5043 (JSC::JITStubs::cti_op_switch_char):
5044 (JSC::JITStubs::cti_op_switch_string):
5045 (JSC::JITStubs::cti_op_del_by_val):
5046 (JSC::JITStubs::cti_op_put_getter):
5047 (JSC::JITStubs::cti_op_put_setter):
5048 (JSC::JITStubs::cti_op_new_error):
5049 (JSC::JITStubs::cti_op_debug):
5050 (JSC::JITStubs::cti_vm_throw):
5051 * jit/JITStubs.h:
5052 (JSC::):
5053
5054 2009-05-06 Gavin Barraclough <barraclough@apple.com>
5055
5056 Reviewed by Maciej Stachowiak & Darin Adler.
5057
5058 Improve string concatenation (as coded in JS as a sequence of adds).
5059
5060 Detect patterns corresponding to string concatenation, and change the bytecode
5061 generation to emit a new op_strcat instruction. By handling the full set of
5062 additions within a single function we do not need allocate JSString wrappers
5063 for intermediate results, and we can calculate the size of the output string
5064 prior to allocating storage, in order to prevent reallocation of the buffer.
5065
5066 1.5%-2% progression on Sunspider, largely due to a 30% progression on date-format-xparb.
5067
5068 * bytecode/CodeBlock.cpp:
5069 (JSC::CodeBlock::dump):
5070 Add new opcodes.
5071 * bytecode/Opcode.h:
5072 Add new opcodes.
5073 * bytecompiler/BytecodeGenerator.cpp:
5074 (JSC::BytecodeGenerator::emitStrcat):
5075 (JSC::BytecodeGenerator::emitToPrimitive):
5076 Add generation of new opcodes.
5077 * bytecompiler/BytecodeGenerator.h:
5078 Add generation of new opcodes.
5079 * interpreter/Interpreter.cpp:
5080 (JSC::Interpreter::privateExecute):
5081 Add implmentation of new opcodes.
5082 * jit/JIT.cpp:
5083 (JSC::JIT::privateCompileMainPass):
5084 (JSC::JIT::privateCompileSlowCases):
5085 Add implmentation of new opcodes.
5086 * jit/JITStubs.cpp:
5087 (JSC::JITStubs::cti_op_to_primitive):
5088 (JSC::JITStubs::cti_op_strcat):
5089 Add implmentation of new opcodes.
5090 * jit/JITStubs.h:
5091 Add implmentation of new opcodes.
5092 * parser/Nodes.cpp:
5093 (JSC::BinaryOpNode::emitStrcat):
5094 (JSC::BinaryOpNode::emitBytecode):
5095 (JSC::ReadModifyResolveNode::emitBytecode):
5096 Add generation of new opcodes.
5097 * parser/Nodes.h:
5098 (JSC::ExpressionNode::):
5099 (JSC::AddNode::):
5100 Add methods to allow identification of add nodes.
5101 * parser/ResultType.h:
5102 (JSC::ResultType::definitelyIsString):
5103 (JSC::ResultType::forAdd):
5104 Fix error in detection of adds that will produce string results.
5105 * runtime/Operations.h:
5106 (JSC::concatenateStrings):
5107 Add implmentation of new opcodes.
5108 * runtime/UString.cpp:
5109 (JSC::UString::appendNumeric):
5110 Add methods to append numbers to an existing string.
5111 * runtime/UString.h:
5112 (JSC::UString::Rep::createEmptyBuffer):
5113 (JSC::UString::BaseString::BaseString):
5114 Add support for creating an empty string with a non-zero capacity available in the BaseString.
5115
5116 2009-05-06 Darin Adler <darin@apple.com>
5117
5118 Reviewed by Sam Weinig.
5119
5120 Made RefCounted::m_refCount private.
5121
5122 * runtime/Structure.h: Removed addressOfCount.
5123 * wtf/RefCounted.h: Made m_refCount private.
5124 Added addressOfCount.
5125
5126 2009-05-06 Darin Adler <darin@apple.com>
5127
5128 Fixed assertion seen a lot!
5129
5130 * parser/Nodes.cpp:
5131 (JSC::FunctionBodyNode::~FunctionBodyNode): Removed now-bogus assertion.
5132
5133 2009-05-06 Darin Adler <darin@apple.com>
5134
5135 Working with Sam Weinig.
5136
5137 Redo parse tree constructor optimization without breaking the Windows
5138 build the way I did yesterday. The previous try broke the build by adding
5139 an include of Lexer.h and all its dependencies that had to work outside
5140 the JavaScriptCore project.
5141
5142 * GNUmakefile.am: Added NodeConstructors.h.
5143 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
5144
5145 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
5146 Removed byteocde directory -- we no longer are trying to include Lexer.h
5147 outside JavaScriptCore.
5148
5149 * JavaScriptCore.xcodeproj/project.pbxproj: Change SegmentedVector.h
5150 and Lexer.h back to internal files. Added NodeConstructors.h.
5151
5152 * parser/Grammar.y: Added include of NodeConstructors.h.
5153 Changed use of ConstDeclNode to use public functions.
5154
5155 * parser/NodeConstructors.h: Copied from parser/Nodes.h.
5156 Just contains the inlined constructors now.
5157
5158 * parser/Nodes.cpp: Added include of NodeConstructors.h.
5159 Moved node constructors into the header.
5160 (JSC::FunctionBodyNode::FunctionBodyNode): Removed m_refCount
5161 initialization.
5162
5163 * parser/Nodes.h: Removed all the constructor definitions, and also
5164 removed the JSC_FAST_CALL from them since these are all inlined, so the
5165 calling convention is irrelevant. Made more things private. Used a data
5166 member for operator opcodes instead of a virtual function. Removed the
5167 special FunctionBodyNode::ref/deref functions since the default functions
5168 are now just as fast.
5169
5170 * runtime/FunctionConstructor.cpp:
5171 (JSC::extractFunctionBody): Fixed types here so we don't typecast until
5172 after we do type checking.
5173
5174 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
5175
5176 Reviewed by Ariya Hidayat.
5177
5178 Fix the Qt build on Windows.
5179
5180 * JavaScriptCore.pri: Define BUILDING_JavaScriptCore/WTF to get the meaning
5181 of the JS_EXPORTDATA macros correct
5182
5183 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
5184
5185 Reviewed by Ariya Hidayat.
5186
5187 Enable the JIT for the Qt build on Windows.
5188
5189 * JavaScriptCore.pri:
5190
5191 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
5192
5193 Reviewed by Tor Arne Vestbø.
5194
5195 Tweak JavaScriptCore.pri for being able to override the generated sources dir for the
5196 generated_files target.
5197
5198 * JavaScriptCore.pri:
5199
5200 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
5201
5202 Reviewed by Simon Hausmann.
5203
5204 Build QtWebKit as a framework on Mac
5205
5206 This implies both debug and release build by default, unless
5207 one of the --debug or --release config options are passed to
5208 the build-webkit script.
5209
5210 Frameworks can be disabled by passing CONFIG+=webkit_no_framework
5211 to the build-webkit script.
5212
5213 To be able to build both debug and release targets in parallel
5214 we have to use separate output directories for the generated
5215 sources, which is not optimal, but required to avoid race conditions.
5216
5217 An optimization would be to only require this spit-up on Mac.
5218
5219 * JavaScriptCore.pri:
5220 * JavaScriptCore.pro:
5221 * jsc.pro:
5222
5223 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
5224
5225 Reviewed by Simon Hausmann.
5226
5227 [Qt] Use $$GENERATED_SOURCES_DIR as output when running bison
5228
5229 A couple of the generators left the bison output file in the source
5230 tree, and then moved it into $$GENERATED_SOURCES_DIR, which did not
5231 work well when building release and debug configurations in parallel.
5232
5233 * JavaScriptCore.pri:
5234
5235 2009-05-05 Geoffrey Garen <ggaren@apple.com>
5236
5237 Reviewed by Maciej Stachowiak.
5238
5239 Simplified a bit of codegen.
5240
5241 * jit/JIT.cpp:
5242 (JSC::JIT::privateCompileMainPass):
5243
5244 2009-05-05 Geoffrey Garen <ggaren@apple.com>
5245
5246 Reviewed by Cameron Zwarich.
5247
5248 Moved all the JIT stub related code into one place.
5249
5250 * jit/JIT.cpp:
5251 * jit/JIT.h:
5252 * jit/JITCode.h:
5253 * jit/JITStubs.cpp:
5254 (JSC::):
5255 * jit/JITStubs.h:
5256
5257 2009-05-05 Sam Weinig <sam@webkit.org>
5258
5259 Try to fix Windows build.
5260
5261 Move Node constructor to the .cpp file.
5262
5263 * parser/Nodes.cpp:
5264 * parser/Nodes.h:
5265
5266 2009-05-05 Darin Adler <darin@apple.com>
5267
5268 Try to fix Windows build.
5269
5270 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5271 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5272
5273 Try to fix Mac build.
5274
5275 * JavaScriptCore.xcodeproj/project.pbxproj: Made SegmentedVector.h private.
5276
5277 2009-05-05 Darin Adler <darin@apple.com>
5278
5279 Try to fix Mac build.
5280
5281 * JavaScriptCore.xcodeproj/project.pbxproj: Made Lexer.h private.
5282
5283 2009-05-05 Darin Adler <darin@apple.com>
5284
5285 Reviewed by Sam Weinig.
5286
5287 Bug 25569: make ParserRefCounted use conventional reference counting
5288 https://bugs.webkit.org/show_bug.cgi?id=25569
5289
5290 SunSpider speedup of about 1.6%.
5291
5292 * JavaScriptCore.exp: Updated.
5293
5294 * parser/Nodes.cpp:
5295 (JSC::NodeReleaser::releaseAllNodes): ALWAYS_INLINE.
5296 (JSC::NodeReleaser::adopt): Ditto.
5297 (JSC::ParserRefCounted::ParserRefCounted): Removed most of the code.
5298 Add the object to a Vector<RefPtr> that gets cleared after parsing.
5299 (JSC::ParserRefCounted::~ParserRefCounted): Removed most of the code.
5300
5301 * parser/Nodes.h: Made ParserRefCounted inherit from RefCounted and
5302 made inline versions of the constructor and destructor. Made the
5303 Node constructor inline.
5304
5305 * parser/Parser.cpp:
5306 (JSC::Parser::parse): Call globalData->parserObjects.shrink(0) after
5307 parsing, where it used to call ParserRefCounted::deleteNewObjects.
5308
5309 * runtime/JSGlobalData.cpp:
5310 (JSC::JSGlobalData::JSGlobalData): Eliminated code to manage the
5311 newParserObjects and parserObjectExtraRefCounts.
5312 (JSC::JSGlobalData::~JSGlobalData): Ditto.
5313
5314 * runtime/JSGlobalData.h: Replaced the HashSet and HashCountedSet
5315 with a Vector.
5316
5317 * wtf/PassRefPtr.h:
5318 (WTF::PassRefPtr::~PassRefPtr): The most common thing to do with a
5319 PassRefPtr in hot code is to pass it and then destroy it once it's
5320 set to zero. Help the optimizer by telling it that's true.
5321
5322 2009-05-05 Xan Lopez <xlopez@igalia.com> and Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
5323
5324 Reviewed by Oliver Hunt.
5325
5326 Disable the NativeFunctionWrapper for all non-Mac ports for now,
5327 as it is also crashing on Linux/x86.
5328
5329 * runtime/NativeFunctionWrapper.h:
5330
5331 2009-05-05 Steve Falkenburg <sfalken@apple.com>
5332
5333 Fix build.
5334
5335 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5336 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5337
5338 2009-05-05 Oliver Hunt <oliver@apple.com>
5339
5340 Reviewed by Maciej Stachowiak.
5341
5342 Expose toThisObject for the DOM Window
5343
5344 * JavaScriptCore.exp:
5345
5346 2009-05-05 Oliver Hunt <oliver@apple.com>
5347
5348 Reviewed by NOBODY (Make windows go again until i work out the
5349 accursed calling convention).
5350
5351 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5352 * jit/JIT.cpp:
5353 * runtime/NativeFunctionWrapper.h:
5354
5355 2009-05-05 Oliver Hunt <oliver@apple.com>
5356
5357 Reviewed by NOBODY (Fix windows debug builds).
5358
5359 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5360
5361 2009-05-05 Oliver Hunt <oliver@apple.com>
5362
5363 Reviewed by NOBODY (Hopefully the last fix).
5364
5365 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5366
5367 2009-05-05 Oliver Hunt <oliver@apple.com>
5368
5369 Reviewed by NOBODY (Fix the build fix caused by a different build fix).
5370
5371 * parser/Nodes.cpp:
5372 * parser/Nodes.h:
5373
5374 2009-05-05 Oliver Hunt <oliver@apple.com>
5375
5376 Reviewed by NOBODY (No idea how my changes could have broken these).
5377
5378 * runtime/DatePrototype.cpp:
5379 * runtime/RegExpObject.cpp:
5380
5381 2009-05-05 Oliver Hunt <oliver@apple.com>
5382
5383 Reviewed by NOBODY (Why should i expect msvc to list all the errors in a file?).
5384
5385 * parser/Nodes.cpp:
5386
5387 2009-05-05 Oliver Hunt <oliver@apple.com>
5388
5389 Reviewed by NOBODY (Fix warning, and another missing include).
5390
5391 * jit/JIT.cpp:
5392 * parser/Nodes.h:
5393
5394 2009-05-05 Oliver Hunt <oliver@apple.com>
5395
5396 Reviewed by NOBODY (More build fixes).
5397
5398 * runtime/ErrorPrototype.cpp:
5399 * runtime/JSGlobalObject.cpp:
5400 * runtime/NumberPrototype.cpp:
5401 * runtime/ObjectPrototype.cpp:
5402 * runtime/StringConstructor.cpp:
5403
5404 2009-05-05 Oliver Hunt <oliver@apple.com>
5405
5406 Reviewed by NOBODY (Will the fixes never end?).
5407
5408 * runtime/FunctionPrototype.h:
5409 * runtime/Lookup.cpp:
5410
5411 2009-05-05 Oliver Hunt <oliver@apple.com>
5412
5413 Reviewed by NOBODY (More build fixes).
5414
5415 * jit/JIT.cpp:
5416
5417 2009-05-05 Oliver Hunt <oliver@apple.com>
5418
5419 Reviewed by NOBODY (More build fixing).
5420
5421 * runtime/CallData.h:
5422
5423 2009-05-05 Oliver Hunt <oliver@apple.com>
5424
5425 Reviewed by NOBODY (Build fix).
5426
5427 * runtime/ArrayConstructor.cpp:
5428 * runtime/BooleanPrototype.cpp:
5429 * runtime/DateConstructor.cpp:
5430 * runtime/Error.cpp:
5431 * runtime/ObjectConstructor.cpp:
5432 * runtime/RegExpPrototype.cpp:
5433
5434 2009-05-05 Oliver Hunt <oliver@apple.com>
5435
5436 Reviewed by NOBODY (Buildfix).
5437
5438 Add missing file
5439
5440 * runtime/NativeFunctionWrapper.h: Copied from JavaScriptCore/jit/ExecutableAllocator.cpp.
5441
5442 2009-05-05 Oliver Hunt <oliver@apple.com>
5443
5444 Reviewed by Gavin Barraclough.
5445
5446 Bug 25559: Improve native function call performance
5447 <https://bugs.webkit.org/show_bug.cgi?id=25559>
5448
5449 In order to cache calls to native functions we now make the standard
5450 prototype functions use a small assembly thunk that converts the JS
5451 calling convention into the native calling convention. As this is
5452 only beneficial in the JIT we use the NativeFunctionWrapper typedef
5453 to alternate between PrototypeFunction and JSFunction to keep the
5454 code sane. This change from PrototypeFunction to NativeFunctionWrapper
5455 is the bulk of this patch.
5456
5457 * JavaScriptCore.exp:
5458 * JavaScriptCore.xcodeproj/project.pbxproj:
5459 * assembler/MacroAssemblerX86Common.h:
5460 (JSC::MacroAssemblerX86Common::call):
5461 * assembler/MacroAssemblerX86_64.h:
5462 (JSC::MacroAssemblerX86_64::addPtr):
5463 * assembler/X86Assembler.h:
5464 (JSC::X86Assembler::leaq_mr):
5465 (JSC::X86Assembler::call_m):
5466 * interpreter/Interpreter.cpp:
5467 (JSC::Interpreter::execute):
5468 (JSC::Interpreter::prepareForRepeatCall):
5469 * jit/JIT.cpp:
5470 (JSC::JIT::privateCompileCTIMachineTrampolines):
5471 * jit/JIT.h:
5472 (JSC::JIT::compileCTIMachineTrampolines):
5473 * jit/JITCall.cpp:
5474 (JSC::JIT::linkCall):
5475 (JSC::JIT::compileOpCallInitializeCallFrame):
5476 (JSC::JIT::compileOpCall):
5477 * jit/JITCode.h:
5478 (JSC::JITCode::operator bool):
5479 * jit/JITInlineMethods.h:
5480 (JSC::JIT::emitGetFromCallFrameHeader):
5481 (JSC::JIT::emitGetFromCallFrameHeader32):
5482 * jit/JITStubs.cpp:
5483 (JSC::JITStubs::JITStubs):
5484 (JSC::JITStubs::cti_op_call_JSFunction):
5485 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
5486 (JSC::JITStubs::cti_vm_lazyLinkCall):
5487 (JSC::JITStubs::cti_op_construct_JSConstruct):
5488 * jit/JITStubs.h:
5489 (JSC::JITStubs::ctiNativeCallThunk):
5490 * jsc.cpp:
5491 (GlobalObject::GlobalObject):
5492 * parser/Nodes.cpp:
5493 (JSC::FunctionBodyNode::FunctionBodyNode):
5494 (JSC::FunctionBodyNode::createNativeThunk):
5495 (JSC::FunctionBodyNode::generateJITCode):
5496 * parser/Nodes.h:
5497 (JSC::FunctionBodyNode::):
5498 (JSC::FunctionBodyNode::generatedJITCode):
5499 (JSC::FunctionBodyNode::jitCode):
5500 * profiler/Profiler.cpp:
5501 (JSC::Profiler::createCallIdentifier):
5502 * runtime/ArgList.h:
5503 * runtime/ArrayPrototype.cpp:
5504 (JSC::isNumericCompareFunction):
5505 * runtime/BooleanPrototype.cpp:
5506 (JSC::BooleanPrototype::BooleanPrototype):
5507 * runtime/DateConstructor.cpp:
5508 (JSC::DateConstructor::DateConstructor):
5509 * runtime/ErrorPrototype.cpp:
5510 (JSC::ErrorPrototype::ErrorPrototype):
5511 * runtime/FunctionPrototype.cpp:
5512 (JSC::FunctionPrototype::addFunctionProperties):
5513 (JSC::functionProtoFuncToString):
5514 * runtime/FunctionPrototype.h:
5515 * runtime/JSFunction.cpp:
5516 (JSC::JSFunction::JSFunction):
5517 (JSC::JSFunction::~JSFunction):
5518 (JSC::JSFunction::mark):
5519 (JSC::JSFunction::getCallData):
5520 (JSC::JSFunction::call):
5521 (JSC::JSFunction::argumentsGetter):
5522 (JSC::JSFunction::callerGetter):
5523 (JSC::JSFunction::lengthGetter):
5524 (JSC::JSFunction::getOwnPropertySlot):
5525 (JSC::JSFunction::put):
5526 (JSC::JSFunction::deleteProperty):
5527 (JSC::JSFunction::getConstructData):
5528 (JSC::JSFunction::construct):
5529 * runtime/JSFunction.h:
5530 (JSC::JSFunction::JSFunction):
5531 (JSC::JSFunction::setScope):
5532 (JSC::JSFunction::scope):
5533 (JSC::JSFunction::isHostFunction):
5534 (JSC::JSFunction::scopeChain):
5535 (JSC::JSFunction::clearScopeChain):
5536 (JSC::JSFunction::setScopeChain):
5537 (JSC::JSFunction::nativeFunction):
5538 (JSC::JSFunction::setNativeFunction):
5539 * runtime/JSGlobalData.cpp:
5540 (JSC::JSGlobalData::~JSGlobalData):
5541 (JSC::JSGlobalData::createNativeThunk):
5542 * runtime/JSGlobalData.h:
5543 (JSC::JSGlobalData::nativeFunctionThunk):
5544 * runtime/JSGlobalObject.cpp:
5545 (JSC::JSGlobalObject::reset):
5546 * runtime/JSGlobalObject.h:
5547 * runtime/Lookup.cpp:
5548 (JSC::setUpStaticFunctionSlot):
5549 * runtime/Lookup.h:
5550 * runtime/NumberPrototype.cpp:
5551 (JSC::NumberPrototype::NumberPrototype):
5552 * runtime/ObjectPrototype.cpp:
5553 (JSC::ObjectPrototype::ObjectPrototype):
5554 * runtime/RegExpPrototype.cpp:
5555 (JSC::RegExpPrototype::RegExpPrototype):
5556 * runtime/StringConstructor.cpp:
5557 (JSC::StringConstructor::StringConstructor):
5558
5559 2009-05-05 Gavin Barraclough <barraclough@apple.com>
5560
5561 Reviewed by Oliver Hunt.
5562
5563 For convenience, let the sampling flags tool clear multiple flags at once.
5564
5565 * jsc.cpp:
5566 (GlobalObject::GlobalObject):
5567 (functionSetSamplingFlags):
5568 (functionClearSamplingFlags):
5569
5570 2009-05-04 Maciej Stachowiak <mjs@apple.com>
5571
5572 Rubber stamped by Gavin.
5573
5574 - inline Vector::resize for a ~1.5% speedup on string-tagcloud
5575
5576 * wtf/Vector.h:
5577 (WTF::Vector::resize): Inline
5578
5579 2009-05-03 Steve Falkenburg <sfalken@apple.com>
5580
5581 Windows build fix.
5582
5583 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
5584
5585 2009-05-03 Mark Rowe <mrowe@apple.com>
5586
5587 Fix the 64-bit build.
5588
5589 * API/APICast.h:
5590 (toJS):
5591 (toRef):
5592 * runtime/JSNumberCell.cpp:
5593 (JSC::jsAPIMangledNumber):
5594 * runtime/JSNumberCell.h:
5595
5596 2009-05-02 Sam Weinig <sam@webkit.org>
5597
5598 Roll JSC API number marshaling back in one last time (I hope).
5599
5600 2009-05-03 Sam Weinig <sam@webkit.org>
5601
5602 Roll JSC API number marshaling back out. It still breaks windows.
5603
5604 2009-05-03 Sam Weinig <sam@webkit.org>
5605
5606 Roll JSC API number marshaling back in.
5607
5608 2009-05-02 Darin Adler <darin@apple.com>
5609
5610 Reviewed by Maciej Stachowiak.
5611
5612 Bug 25519: streamline lexer by handling BOMs differently
5613 https://bugs.webkit.org/show_bug.cgi?id=25519
5614
5615 Roughly 1% faster SunSpider.
5616
5617 * parser/Grammar.y: Tweak formatting a bit.
5618
5619 * parser/Lexer.cpp:
5620 (JSC::Lexer::Lexer): Remove unnnecessary initialization of data members
5621 that are set up by setCode.
5622 (JSC::Lexer::currentOffset): Added. Used where the old code would look at
5623 m_currentOffset.
5624 (JSC::Lexer::shift1): Replaces the old shift function. No longer does anything
5625 to handle BOM characters.
5626 (JSC::Lexer::shift2): Ditto.
5627 (JSC::Lexer::shift3): Ditto.
5628 (JSC::Lexer::shift4): Ditto.
5629 (JSC::Lexer::setCode): Updated for name change from yylineno to m_line.
5630 Removed now-unused m_eatNextIdentifier, m_stackToken, and m_restrKeyword.
5631 Replaced m_skipLF and m_skipCR with m_skipLineEnd. Replaced the old
5632 m_length with m_codeEnd and m_currentOffset with m_codeStart. Added code
5633 to scan for a BOM character and call copyCodeWithoutBOMs() if we find any.
5634 (JSC::Lexer::copyCodeWithoutBOMs): Added.
5635 (JSC::Lexer::nextLine): Updated for name change from yylineno to m_line.
5636 (JSC::Lexer::makeIdentifier): Moved up higher in the file.
5637 (JSC::Lexer::matchPunctuator): Moved up higher in the file and changed to
5638 use a switch statement instead of just if statements.
5639 (JSC::Lexer::isLineTerminator): Moved up higher in the file and changed to
5640 have fewer branches.
5641 (JSC::Lexer::lastTokenWasRestrKeyword): Added. This replaces the old
5642 m_restrKeyword boolean.
5643 (JSC::Lexer::isIdentStart): Moved up higher in the file. Changed to use
5644 fewer branches in the ASCII but not identifier case.
5645 (JSC::Lexer::isIdentPart): Ditto.
5646 (JSC::Lexer::singleEscape): Moved up higher in the file.
5647 (JSC::Lexer::convertOctal): Moved up higher in the file.
5648 (JSC::Lexer::convertHex): Moved up higher in the file. Changed to use
5649 toASCIIHexValue instead of rolling our own here.
5650 (JSC::Lexer::convertUnicode): Ditto.
5651 (JSC::Lexer::record8): Moved up higher in the file.
5652 (JSC::Lexer::record16): Moved up higher in the file.
5653 (JSC::Lexer::lex): Changed type of stringType to int. Replaced m_skipLF
5654 and m_skipCR with m_skipLineEnd, which requires fewer branches in the
5655 main lexer loop. Use currentOffset instead of m_currentOffset. Removed
5656 unneeded m_stackToken. Use isASCIIDigit instead of isDecimalDigit.
5657 Split out the two cases for InIdentifierOrKeyword and InIdentifier.
5658 Added special case tight loops for identifiers and other simple states.
5659 Removed a branch from the code that sets m_atLineStart to false using goto.
5660 Streamlined the number-handling code so we don't check for the same types
5661 twice for non-numeric cases and don't add a null to m_buffer8 when it's
5662 not being used. Removed m_eatNextIdentifier, which wasn't working anyway,
5663 and m_restrKeyword, which is redundant with m_lastToken. Set the
5664 m_delimited flag without using a branch.
5665 (JSC::Lexer::scanRegExp): Tweaked style a bit.
5666 (JSC::Lexer::clear): Clear m_codeWithoutBOMs so we don't use memory after
5667 parsing. Clear out UString objects in the more conventional way.
5668 (JSC::Lexer::sourceCode): Made this no-longer inline since it has more
5669 work to do in the case where we stripped BOMs.
5670
5671 * parser/Lexer.h: Renamed yylineno to m_lineNumber. Removed convertHex
5672 function, which is the same as toASCIIHexValue. Removed isHexDigit
5673 function, which is the same as isASCIIHedDigit. Replaced shift with four
5674 separate shift functions. Removed isWhiteSpace function that passes
5675 m_current, instead just passing m_current explicitly. Removed isOctalDigit,
5676 which is the same as isASCIIOctalDigit. Eliminated unused arguments from
5677 matchPunctuator. Added copyCoodeWithoutBOMs and currentOffset. Moved the
5678 makeIdentifier function out of the header. Added lastTokenWasRestrKeyword
5679 function. Added new constants for m_skipLineEnd. Removed unused yycolumn,
5680 m_restrKeyword, m_skipLF, m_skipCR, m_eatNextIdentifier, m_stackToken,
5681 m_position, m_length, m_currentOffset, m_nextOffset1, m_nextOffset2,
5682 m_nextOffset3. Added m_skipLineEnd, m_codeStart, m_codeEnd, and
5683 m_codeWithoutBOMs.
5684
5685 * parser/SourceProvider.h: Added hasBOMs function. In the future this can
5686 be used to tell the lexer about strings known not to have BOMs.
5687
5688 * runtime/JSGlobalObjectFunctions.cpp:
5689 (JSC::globalFuncUnescape): Changed to use isASCIIHexDigit.
5690
5691 * wtf/ASCIICType.h: Added using statements to match the design of the
5692 other WTF headers.
5693
5694 2009-05-02 Ada Chan <adachan@apple.com>
5695
5696 Fix windows build (when doing a clean build)
5697
5698 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5699
5700 2009-05-02 Geoffrey Garen <ggaren@apple.com>
5701
5702 Reviewed by Sam Weinig.
5703
5704 Simplified null-ish JSValues.
5705
5706 Replaced calls to noValue() with calls to JSValue() (which is what
5707 noValue() returned). Removed noValue().
5708
5709 Replaced almost all uses of jsImpossibleValue() with uses of JSValue().
5710 Its one remaining use is for construction of hash table deleted values.
5711 For that specific task, I made a new, private constructor with a special
5712 tag. Removed jsImpossibleValue().
5713
5714 Removed "JSValue()" initialiazers, since default construction happens...
5715 by default.
5716
5717 * API/JSCallbackObjectFunctions.h:
5718 (JSC::::call):
5719 * bytecompiler/BytecodeGenerator.cpp:
5720 (JSC::BytecodeGenerator::emitLoad):
5721 * bytecompiler/BytecodeGenerator.h:
5722 * debugger/DebuggerCallFrame.cpp:
5723 (JSC::DebuggerCallFrame::evaluate):
5724 * debugger/DebuggerCallFrame.h:
5725 (JSC::DebuggerCallFrame::DebuggerCallFrame):
5726 * interpreter/CallFrame.h:
5727 (JSC::ExecState::clearException):
5728 * interpreter/Interpreter.cpp:
5729 (JSC::Interpreter::privateExecute):
5730 (JSC::Interpreter::retrieveLastCaller):
5731 * interpreter/Register.h:
5732 (JSC::Register::Register):
5733 * jit/JITCall.cpp:
5734 (JSC::JIT::unlinkCall):
5735 (JSC::JIT::compileOpCallInitializeCallFrame):
5736 (JSC::JIT::compileOpCall):
5737 * jit/JITStubs.cpp:
5738 (JSC::JITStubs::cti_op_call_eval):
5739 (JSC::JITStubs::cti_vm_throw):
5740 * profiler/Profiler.cpp:
5741 (JSC::Profiler::willExecute):
5742 (JSC::Profiler::didExecute):
5743 * runtime/ArrayPrototype.cpp:
5744 (JSC::getProperty):
5745 * runtime/Completion.cpp:
5746 (JSC::evaluate):
5747 * runtime/Completion.h:
5748 (JSC::Completion::Completion):
5749 * runtime/GetterSetter.cpp:
5750 (JSC::GetterSetter::getPrimitiveNumber):
5751 * runtime/JSArray.cpp:
5752 (JSC::JSArray::putSlowCase):
5753 (JSC::JSArray::deleteProperty):
5754 (JSC::JSArray::increaseVectorLength):
5755 (JSC::JSArray::setLength):
5756 (JSC::JSArray::pop):
5757 (JSC::JSArray::sort):
5758 (JSC::JSArray::compactForSorting):
5759 * runtime/JSCell.cpp:
5760 (JSC::JSCell::getJSNumber):
5761 * runtime/JSCell.h:
5762 (JSC::JSValue::getJSNumber):
5763 * runtime/JSGlobalData.cpp:
5764 (JSC::JSGlobalData::JSGlobalData):
5765 * runtime/JSImmediate.h:
5766 (JSC::JSImmediate::fromNumberOutsideIntegerRange):
5767 (JSC::JSImmediate::from):
5768 * runtime/JSNumberCell.cpp:
5769 (JSC::jsNumberCell):
5770 * runtime/JSObject.cpp:
5771 (JSC::callDefaultValueFunction):
5772 * runtime/JSObject.h:
5773 (JSC::JSObject::getDirect):
5774 * runtime/JSPropertyNameIterator.cpp:
5775 (JSC::JSPropertyNameIterator::toPrimitive):
5776 * runtime/JSPropertyNameIterator.h:
5777 (JSC::JSPropertyNameIterator::next):
5778 * runtime/JSValue.h:
5779 (JSC::JSValue::):
5780 (JSC::JSValueHashTraits::constructDeletedValue):
5781 (JSC::JSValueHashTraits::isDeletedValue):
5782 (JSC::JSValue::JSValue):
5783 * runtime/JSWrapperObject.h:
5784 (JSC::JSWrapperObject::JSWrapperObject):
5785 * runtime/Operations.h:
5786 (JSC::resolveBase):
5787 * runtime/PropertySlot.h:
5788 (JSC::PropertySlot::clearBase):
5789 (JSC::PropertySlot::clearValue):
5790
5791 2009-05-02 Maciej Stachowiak <mjs@apple.com>
5792
5793 Reviewed by Cameron Zwarich.
5794
5795 - speed up the lexer in various ways
5796
5797 ~2% command-line SunSpider speedup
5798
5799 * parser/Lexer.cpp:
5800 (JSC::Lexer::setCode): Moved below shift() so it can inline.
5801 (JSC::Lexer::scanRegExp): Use resize(0) instead of clear() on Vectors, since the intent
5802 here is not to free the underlying buffer.
5803 (JSC::Lexer::lex): ditto; also, change the loop logic a bit for the main lexing loop
5804 to avoid branching on !m_done twice per iteration. Now we only check it once.
5805 (JSC::Lexer::shift): Make this ALWAYS_INLINE and tag an unusual branch as UNLIKELY
5806 * parser/Lexer.h:
5807 (JSC::Lexer::makeIdentifier): force to be ALWAYS_INLINE
5808 * wtf/Vector.h:
5809 (WTF::::append): force to be ALWAYS_INLINE (may have helped in ways other than parsing but it wasn't
5810 getting inlined in a hot code path in the lexer)
5811
5812 2009-05-01 Steve Falkenburg <sfalken@apple.com>
5813
5814 Windows build fix.
5815
5816 * JavaScriptCore.vcproj/JavaScriptCore.make:
5817
5818 2009-05-01 Sam Weinig <sam@webkit.org>
5819
5820 Fix 64bit build.
5821
5822 * runtime/JSNumberCell.h:
5823 (JSC::JSValue::JSValue):
5824 * runtime/JSValue.h:
5825 (JSC::jsNumber):
5826
5827 2009-05-01 Sam Weinig <sam@webkit.org>
5828
5829 Roll out JavaScriptCore API number marshaling.
5830
5831 * API/APICast.h:
5832 (toJS):
5833 (toRef):
5834 * API/JSBase.cpp:
5835 (JSEvaluateScript):
5836 (JSCheckScriptSyntax):
5837 * API/JSCallbackConstructor.cpp:
5838 (JSC::constructJSCallback):
5839 * API/JSCallbackFunction.cpp:
5840 (JSC::JSCallbackFunction::call):
5841 * API/JSCallbackObjectFunctions.h:
5842 (JSC::::getOwnPropertySlot):
5843 (JSC::::put):
5844 (JSC::::deleteProperty):
5845 (JSC::::construct):
5846 (JSC::::hasInstance):
5847 (JSC::::call):
5848 (JSC::::toNumber):
5849 (JSC::::toString):
5850 (JSC::::staticValueGetter):
5851 (JSC::::callbackGetter):
5852 * API/JSObjectRef.cpp:
5853 (JSObjectMakeFunction):
5854 (JSObjectMakeArray):
5855 (JSObjectMakeDate):
5856 (JSObjectMakeError):
5857 (JSObjectMakeRegExp):
5858 (JSObjectGetPrototype):
5859 (JSObjectSetPrototype):
5860 (JSObjectGetProperty):
5861 (JSObjectSetProperty):
5862 (JSObjectGetPropertyAtIndex):
5863 (JSObjectSetPropertyAtIndex):
5864 (JSObjectDeleteProperty):
5865 (JSObjectCallAsFunction):
5866 (JSObjectCallAsConstructor):
5867 * API/JSValueRef.cpp:
5868 (JSValueGetType):
5869 (JSValueIsUndefined):
5870 (JSValueIsNull):
5871 (JSValueIsBoolean):
5872 (JSValueIsNumber):
5873 (JSValueIsString):
5874 (JSValueIsObject):
5875 (JSValueIsObjectOfClass):
5876 (JSValueIsEqual):
5877 (JSValueIsStrictEqual):
5878 (JSValueIsInstanceOfConstructor):
5879 (JSValueMakeUndefined):
5880 (JSValueMakeNull):
5881 (JSValueMakeBoolean):
5882 (JSValueMakeNumber):
5883 (JSValueMakeString):
5884 (JSValueToBoolean):
5885 (JSValueToNumber):
5886 (JSValueToStringCopy):
5887 (JSValueToObject):
5888 (JSValueProtect):
5889 (JSValueUnprotect):
5890 * JavaScriptCore.exp:
5891 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5892 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5893 * runtime/JSNumberCell.cpp:
5894 * runtime/JSNumberCell.h:
5895 * runtime/JSValue.h:
5896
5897 2009-05-01 Sam Weinig <sam@webkit.org>
5898
5899 Fix windows build.
5900
5901 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5902 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
5903
5904 2009-05-01 Sam Weinig <sam@webkit.org>
5905
5906 Fix the build.
5907
5908 * JavaScriptCore.exp:
5909
5910 2009-05-01 Sam Weinig <sam@webkit.org>
5911
5912 Reviewed by Geoffrey "Too Far!" Garen.
5913
5914 Move JS number construction into JSValue.
5915
5916 * runtime/JSImmediate.h:
5917 * runtime/JSNumberCell.h:
5918 (JSC::JSValue::JSValue):
5919 * runtime/JSValue.h:
5920 (JSC::jsNumber):
5921
5922 2009-05-01 Sam Weinig <sam@webkit.org>
5923
5924 Reviewed by Geoff "The Minneapolis" Garen.
5925
5926 Add mechanism to vend heap allocated JS numbers to JavaScriptCore API clients with a
5927 representation that is independent of the number representation in the VM.
5928 - Numbers leaving the interpreter are converted to a tagged JSNumberCell.
5929 - The numbers coming into the interpreter (asserted to be the tagged JSNumberCell) are
5930 converted back to the VM's internal number representation.
5931
5932 * API/APICast.h:
5933 (toJS):
5934 (toRef):
5935 * API/JSBase.cpp:
5936 (JSEvaluateScript):
5937 (JSCheckScriptSyntax):
5938 * API/JSCallbackConstructor.cpp:
5939 (JSC::constructJSCallback):
5940 * API/JSCallbackFunction.cpp:
5941 (JSC::JSCallbackFunction::call):
5942 * API/JSCallbackObjectFunctions.h:
5943 (JSC::::getOwnPropertySlot):
5944 (JSC::::put):
5945 (JSC::::deleteProperty):
5946 (JSC::::construct):
5947 (JSC::::hasInstance):
5948 (JSC::::call):
5949 (JSC::::toNumber):
5950 (JSC::::toString):
5951 (JSC::::staticValueGetter):
5952 (JSC::::callbackGetter):
5953 * API/JSObjectRef.cpp:
5954 (JSObjectMakeFunction):
5955 (JSObjectMakeArray):
5956 (JSObjectMakeDate):
5957 (JSObjectMakeError):
5958 (JSObjectMakeRegExp):
5959 (JSObjectGetPrototype):
5960 (JSObjectSetPrototype):
5961 (JSObjectGetProperty):
5962 (JSObjectSetProperty):
5963 (JSObjectGetPropertyAtIndex):
5964 (JSObjectSetPropertyAtIndex):
5965 (JSObjectDeleteProperty):
5966 (JSObjectCallAsFunction):
5967 (JSObjectCallAsConstructor):
5968 * API/JSValueRef.cpp:
5969 (JSValueGetType):
5970 (JSValueIsUndefined):
5971 (JSValueIsNull):
5972 (JSValueIsBoolean):
5973 (JSValueIsNumber):
5974 (JSValueIsString):
5975 (JSValueIsObject):
5976 (JSValueIsObjectOfClass):
5977 (JSValueIsEqual):
5978 (JSValueIsStrictEqual):
5979 (JSValueIsInstanceOfConstructor):
5980 (JSValueMakeUndefined):
5981 (JSValueMakeNull):
5982 (JSValueMakeBoolean):
5983 (JSValueMakeNumber):
5984 (JSValueMakeString):
5985 (JSValueToBoolean):
5986 (JSValueToNumber):
5987 (JSValueToStringCopy):
5988 (JSValueToObject):
5989 (JSValueProtect):
5990 (JSValueUnprotect):
5991 * runtime/JSNumberCell.cpp:
5992 (JSC::jsAPIMangledNumber):
5993 * runtime/JSNumberCell.h:
5994 (JSC::JSNumberCell::isAPIMangledNumber):
5995 (JSC::JSNumberCell::):
5996 (JSC::JSNumberCell::JSNumberCell):
5997 (JSC::JSValue::isAPIMangledNumber):
5998 * runtime/JSValue.h:
5999
6000 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6001
6002 Windows build fix take 6.
6003
6004 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6005
6006 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6007
6008 Windows build fix take 5.
6009
6010 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6011
6012 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6013
6014 Windows build fix take 4.
6015
6016 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6017
6018 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6019
6020 Windows build fix take 3.
6021
6022 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6023
6024 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6025
6026 Windows build fix take 2.
6027
6028 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6029
6030 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6031
6032 Windows build fix take 1.
6033
6034 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6035 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
6036
6037 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6038
6039 Rubber Stamped by Sam Weinig.
6040
6041 Renamed JSValuePtr => JSValue.
6042
6043 * API/APICast.h:
6044 (toJS):
6045 (toRef):
6046 * API/JSCallbackConstructor.h:
6047 (JSC::JSCallbackConstructor::createStructure):
6048 * API/JSCallbackFunction.cpp:
6049 (JSC::JSCallbackFunction::call):
6050 * API/JSCallbackFunction.h:
6051 (JSC::JSCallbackFunction::createStructure):
6052 * API/JSCallbackObject.h:
6053 (JSC::JSCallbackObject::createStructure):
6054 * API/JSCallbackObjectFunctions.h:
6055 (JSC::::asCallbackObject):
6056 (JSC::::put):
6057 (JSC::::hasInstance):
6058 (JSC::::call):
6059 (JSC::::staticValueGetter):
6060 (JSC::::staticFunctionGetter):
6061 (JSC::::callbackGetter):
6062 * API/JSContextRef.cpp:
6063 * API/JSObjectRef.cpp:
6064 (JSObjectMakeConstructor):
6065 (JSObjectSetPrototype):
6066 (JSObjectGetProperty):
6067 (JSObjectSetProperty):
6068 (JSObjectGetPropertyAtIndex):
6069 (JSObjectSetPropertyAtIndex):
6070 * API/JSValueRef.cpp:
6071 (JSValueGetType):
6072 (JSValueIsUndefined):
6073 (JSValueIsNull):
6074 (JSValueIsBoolean):
6075 (JSValueIsNumber):
6076 (JSValueIsString):
6077 (JSValueIsObject):
6078 (JSValueIsObjectOfClass):
6079 (JSValueIsEqual):
6080 (JSValueIsStrictEqual):
6081 (JSValueIsInstanceOfConstructor):
6082 (JSValueToBoolean):
6083 (JSValueToNumber):
6084 (JSValueToStringCopy):
6085 (JSValueToObject):
6086 (JSValueProtect):
6087 (JSValueUnprotect):
6088 * JavaScriptCore.exp:
6089 * bytecode/CodeBlock.cpp:
6090 (JSC::valueToSourceString):
6091 (JSC::constantName):
6092 (JSC::CodeBlock::dump):
6093 * bytecode/CodeBlock.h:
6094 (JSC::CodeBlock::getConstant):
6095 (JSC::CodeBlock::addUnexpectedConstant):
6096 (JSC::CodeBlock::unexpectedConstant):
6097 * bytecode/EvalCodeCache.h:
6098 (JSC::EvalCodeCache::get):
6099 * bytecompiler/BytecodeGenerator.cpp:
6100 (JSC::BytecodeGenerator::addConstant):
6101 (JSC::BytecodeGenerator::addUnexpectedConstant):
6102 (JSC::BytecodeGenerator::emitLoad):
6103 (JSC::BytecodeGenerator::emitGetScopedVar):
6104 (JSC::BytecodeGenerator::emitPutScopedVar):
6105 (JSC::BytecodeGenerator::emitNewError):
6106 (JSC::keyForImmediateSwitch):
6107 * bytecompiler/BytecodeGenerator.h:
6108 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
6109 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
6110 * debugger/Debugger.cpp:
6111 (JSC::evaluateInGlobalCallFrame):
6112 * debugger/Debugger.h:
6113 * debugger/DebuggerActivation.cpp:
6114 (JSC::DebuggerActivation::put):
6115 (JSC::DebuggerActivation::putWithAttributes):
6116 (JSC::DebuggerActivation::lookupGetter):
6117 (JSC::DebuggerActivation::lookupSetter):
6118 * debugger/DebuggerActivation.h:
6119 (JSC::DebuggerActivation::createStructure):
6120 * debugger/DebuggerCallFrame.cpp:
6121 (JSC::DebuggerCallFrame::evaluate):
6122 * debugger/DebuggerCallFrame.h:
6123 (JSC::DebuggerCallFrame::DebuggerCallFrame):
6124 (JSC::DebuggerCallFrame::exception):
6125 * interpreter/CachedCall.h:
6126 (JSC::CachedCall::CachedCall):
6127 (JSC::CachedCall::call):
6128 (JSC::CachedCall::setThis):
6129 (JSC::CachedCall::setArgument):
6130 * interpreter/CallFrame.cpp:
6131 (JSC::CallFrame::thisValue):
6132 (JSC::CallFrame::dumpCaller):
6133 * interpreter/CallFrame.h:
6134 (JSC::ExecState::setException):
6135 (JSC::ExecState::exception):
6136 (JSC::ExecState::exceptionSlot):
6137 * interpreter/CallFrameClosure.h:
6138 (JSC::CallFrameClosure::setArgument):
6139 * interpreter/Interpreter.cpp:
6140 (JSC::Interpreter::resolve):
6141 (JSC::Interpreter::resolveSkip):
6142 (JSC::Interpreter::resolveGlobal):
6143 (JSC::Interpreter::resolveBase):
6144 (JSC::Interpreter::resolveBaseAndProperty):
6145 (JSC::Interpreter::resolveBaseAndFunc):
6146 (JSC::isNotObject):
6147 (JSC::Interpreter::callEval):
6148 (JSC::Interpreter::unwindCallFrame):
6149 (JSC::Interpreter::throwException):
6150 (JSC::Interpreter::execute):
6151 (JSC::Interpreter::prepareForRepeatCall):
6152 (JSC::Interpreter::createExceptionScope):
6153 (JSC::Interpreter::tryCachePutByID):
6154 (JSC::Interpreter::tryCacheGetByID):
6155 (JSC::Interpreter::privateExecute):
6156 (JSC::Interpreter::retrieveArguments):
6157 (JSC::Interpreter::retrieveCaller):
6158 (JSC::Interpreter::retrieveLastCaller):
6159 * interpreter/Interpreter.h:
6160 * interpreter/Register.h:
6161 (JSC::Register::):
6162 (JSC::Register::Register):
6163 (JSC::Register::jsValue):
6164 * jit/JIT.cpp:
6165 (JSC::):
6166 (JSC::JIT::privateCompileMainPass):
6167 * jit/JIT.h:
6168 * jit/JITArithmetic.cpp:
6169 (JSC::JIT::compileFastArith_op_mod):
6170 * jit/JITCall.cpp:
6171 (JSC::JIT::unlinkCall):
6172 (JSC::JIT::compileOpCallInitializeCallFrame):
6173 (JSC::JIT::compileOpCall):
6174 * jit/JITCode.h:
6175 (JSC::):
6176 (JSC::JITCode::execute):
6177 * jit/JITInlineMethods.h:
6178 (JSC::JIT::emitGetVirtualRegister):
6179 (JSC::JIT::getConstantOperand):
6180 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
6181 (JSC::JIT::emitInitRegister):
6182 * jit/JITPropertyAccess.cpp:
6183 (JSC::JIT::privateCompilePutByIdTransition):
6184 (JSC::JIT::patchGetByIdSelf):
6185 (JSC::JIT::patchPutByIdReplace):
6186 (JSC::JIT::privateCompileGetByIdSelf):
6187 (JSC::JIT::privateCompileGetByIdProto):
6188 (JSC::JIT::privateCompileGetByIdSelfList):
6189 (JSC::JIT::privateCompileGetByIdProtoList):
6190 (JSC::JIT::privateCompileGetByIdChainList):
6191 (JSC::JIT::privateCompileGetByIdChain):
6192 (JSC::JIT::privateCompilePutByIdReplace):
6193 * jit/JITStubs.cpp:
6194 (JSC::JITStubs::tryCachePutByID):
6195 (JSC::JITStubs::tryCacheGetByID):
6196 (JSC::JITStubs::cti_op_convert_this):
6197 (JSC::JITStubs::cti_op_add):
6198 (JSC::JITStubs::cti_op_pre_inc):
6199 (JSC::JITStubs::cti_op_loop_if_less):
6200 (JSC::JITStubs::cti_op_loop_if_lesseq):
6201 (JSC::JITStubs::cti_op_get_by_id_generic):
6202 (JSC::JITStubs::cti_op_get_by_id):
6203 (JSC::JITStubs::cti_op_get_by_id_second):
6204 (JSC::JITStubs::cti_op_get_by_id_self_fail):
6205 (JSC::JITStubs::cti_op_get_by_id_proto_list):
6206 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
6207 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
6208 (JSC::JITStubs::cti_op_get_by_id_array_fail):
6209 (JSC::JITStubs::cti_op_get_by_id_string_fail):
6210 (JSC::JITStubs::cti_op_instanceof):
6211 (JSC::JITStubs::cti_op_del_by_id):
6212 (JSC::JITStubs::cti_op_mul):
6213 (JSC::JITStubs::cti_op_call_NotJSFunction):
6214 (JSC::JITStubs::cti_op_resolve):
6215 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
6216 (JSC::JITStubs::cti_op_get_by_val):
6217 (JSC::JITStubs::cti_op_get_by_val_string):
6218 (JSC::JITStubs::cti_op_get_by_val_byte_array):
6219 (JSC::JITStubs::cti_op_resolve_func):
6220 (JSC::JITStubs::cti_op_sub):
6221 (JSC::JITStubs::cti_op_put_by_val):
6222 (JSC::JITStubs::cti_op_put_by_val_array):
6223 (JSC::JITStubs::cti_op_put_by_val_byte_array):
6224 (JSC::JITStubs::cti_op_lesseq):
6225 (JSC::JITStubs::cti_op_loop_if_true):
6226 (JSC::JITStubs::cti_op_load_varargs):
6227 (JSC::JITStubs::cti_op_negate):
6228 (JSC::JITStubs::cti_op_resolve_base):
6229 (JSC::JITStubs::cti_op_resolve_skip):
6230 (JSC::JITStubs::cti_op_resolve_global):
6231 (JSC::JITStubs::cti_op_div):
6232 (JSC::JITStubs::cti_op_pre_dec):
6233 (JSC::JITStubs::cti_op_jless):
6234 (JSC::JITStubs::cti_op_not):
6235 (JSC::JITStubs::cti_op_jtrue):
6236 (JSC::JITStubs::cti_op_post_inc):
6237 (JSC::JITStubs::cti_op_eq):
6238 (JSC::JITStubs::cti_op_lshift):
6239 (JSC::JITStubs::cti_op_bitand):
6240 (JSC::JITStubs::cti_op_rshift):
6241 (JSC::JITStubs::cti_op_bitnot):
6242 (JSC::JITStubs::cti_op_resolve_with_base):
6243 (JSC::JITStubs::cti_op_mod):
6244 (JSC::JITStubs::cti_op_less):
6245 (JSC::JITStubs::cti_op_neq):
6246 (JSC::JITStubs::cti_op_post_dec):
6247 (JSC::JITStubs::cti_op_urshift):
6248 (JSC::JITStubs::cti_op_bitxor):
6249 (JSC::JITStubs::cti_op_bitor):
6250 (JSC::JITStubs::cti_op_call_eval):
6251 (JSC::JITStubs::cti_op_throw):
6252 (JSC::JITStubs::cti_op_next_pname):
6253 (JSC::JITStubs::cti_op_typeof):
6254 (JSC::JITStubs::cti_op_is_undefined):
6255 (JSC::JITStubs::cti_op_is_boolean):
6256 (JSC::JITStubs::cti_op_is_number):
6257 (JSC::JITStubs::cti_op_is_string):
6258 (JSC::JITStubs::cti_op_is_object):
6259 (JSC::JITStubs::cti_op_is_function):
6260 (JSC::JITStubs::cti_op_stricteq):
6261 (JSC::JITStubs::cti_op_nstricteq):
6262 (JSC::JITStubs::cti_op_to_jsnumber):
6263 (JSC::JITStubs::cti_op_in):
6264 (JSC::JITStubs::cti_op_switch_imm):
6265 (JSC::JITStubs::cti_op_switch_char):
6266 (JSC::JITStubs::cti_op_switch_string):
6267 (JSC::JITStubs::cti_op_del_by_val):
6268 (JSC::JITStubs::cti_op_new_error):
6269 (JSC::JITStubs::cti_vm_throw):
6270 * jit/JITStubs.h:
6271 * jsc.cpp:
6272 (functionPrint):
6273 (functionDebug):
6274 (functionGC):
6275 (functionVersion):
6276 (functionRun):
6277 (functionLoad):
6278 (functionSetSamplingFlag):
6279 (functionClearSamplingFlag):
6280 (functionReadline):
6281 (functionQuit):
6282 * parser/Nodes.cpp:
6283 (JSC::processClauseList):
6284 * profiler/ProfileGenerator.cpp:
6285 (JSC::ProfileGenerator::addParentForConsoleStart):
6286 * profiler/Profiler.cpp:
6287 (JSC::Profiler::willExecute):
6288 (JSC::Profiler::didExecute):
6289 (JSC::Profiler::createCallIdentifier):
6290 * profiler/Profiler.h:
6291 * runtime/ArgList.cpp:
6292 (JSC::MarkedArgumentBuffer::slowAppend):
6293 * runtime/ArgList.h:
6294 (JSC::MarkedArgumentBuffer::at):
6295 (JSC::MarkedArgumentBuffer::append):
6296 (JSC::ArgList::ArgList):
6297 (JSC::ArgList::at):
6298 * runtime/Arguments.cpp:
6299 (JSC::Arguments::put):
6300 * runtime/Arguments.h:
6301 (JSC::Arguments::createStructure):
6302 (JSC::asArguments):
6303 * runtime/ArrayConstructor.cpp:
6304 (JSC::callArrayConstructor):
6305 * runtime/ArrayPrototype.cpp:
6306 (JSC::getProperty):
6307 (JSC::putProperty):
6308 (JSC::arrayProtoFuncToString):
6309 (JSC::arrayProtoFuncToLocaleString):
6310 (JSC::arrayProtoFuncJoin):
6311 (JSC::arrayProtoFuncConcat):
6312 (JSC::arrayProtoFuncPop):
6313 (JSC::arrayProtoFuncPush):
6314 (JSC::arrayProtoFuncReverse):
6315 (JSC::arrayProtoFuncShift):
6316 (JSC::arrayProtoFuncSlice):
6317 (JSC::arrayProtoFuncSort):
6318 (JSC::arrayProtoFuncSplice):
6319 (JSC::arrayProtoFuncUnShift):
6320 (JSC::arrayProtoFuncFilter):
6321 (JSC::arrayProtoFuncMap):
6322 (JSC::arrayProtoFuncEvery):
6323 (JSC::arrayProtoFuncForEach):
6324 (JSC::arrayProtoFuncSome):
6325 (JSC::arrayProtoFuncReduce):
6326 (JSC::arrayProtoFuncReduceRight):
6327 (JSC::arrayProtoFuncIndexOf):
6328 (JSC::arrayProtoFuncLastIndexOf):
6329 * runtime/BooleanConstructor.cpp:
6330 (JSC::callBooleanConstructor):
6331 (JSC::constructBooleanFromImmediateBoolean):
6332 * runtime/BooleanConstructor.h:
6333 * runtime/BooleanObject.h:
6334 (JSC::asBooleanObject):
6335 * runtime/BooleanPrototype.cpp:
6336 (JSC::booleanProtoFuncToString):
6337 (JSC::booleanProtoFuncValueOf):
6338 * runtime/CallData.cpp:
6339 (JSC::call):
6340 * runtime/CallData.h:
6341 * runtime/Collector.cpp:
6342 (JSC::Heap::protect):
6343 (JSC::Heap::unprotect):
6344 (JSC::Heap::heap):
6345 * runtime/Collector.h:
6346 * runtime/Completion.cpp:
6347 (JSC::evaluate):
6348 * runtime/Completion.h:
6349 (JSC::Completion::Completion):
6350 (JSC::Completion::value):
6351 (JSC::Completion::setValue):
6352 * runtime/ConstructData.cpp:
6353 (JSC::construct):
6354 * runtime/ConstructData.h:
6355 * runtime/DateConstructor.cpp:
6356 (JSC::constructDate):
6357 (JSC::callDate):
6358 (JSC::dateParse):
6359 (JSC::dateNow):
6360 (JSC::dateUTC):
6361 * runtime/DateInstance.h:
6362 (JSC::asDateInstance):
6363 * runtime/DatePrototype.cpp:
6364 (JSC::dateProtoFuncToString):
6365 (JSC::dateProtoFuncToUTCString):
6366 (JSC::dateProtoFuncToDateString):
6367 (JSC::dateProtoFuncToTimeString):
6368 (JSC::dateProtoFuncToLocaleString):
6369 (JSC::dateProtoFuncToLocaleDateString):
6370 (JSC::dateProtoFuncToLocaleTimeString):
6371 (JSC::dateProtoFuncGetTime):
6372 (JSC::dateProtoFuncGetFullYear):
6373 (JSC::dateProtoFuncGetUTCFullYear):
6374 (JSC::dateProtoFuncToGMTString):
6375 (JSC::dateProtoFuncGetMonth):
6376 (JSC::dateProtoFuncGetUTCMonth):
6377 (JSC::dateProtoFuncGetDate):
6378 (JSC::dateProtoFuncGetUTCDate):
6379 (JSC::dateProtoFuncGetDay):
6380 (JSC::dateProtoFuncGetUTCDay):
6381 (JSC::dateProtoFuncGetHours):
6382 (JSC::dateProtoFuncGetUTCHours):
6383 (JSC::dateProtoFuncGetMinutes):
6384 (JSC::dateProtoFuncGetUTCMinutes):
6385 (JSC::dateProtoFuncGetSeconds):
6386 (JSC::dateProtoFuncGetUTCSeconds):
6387 (JSC::dateProtoFuncGetMilliSeconds):
6388 (JSC::dateProtoFuncGetUTCMilliseconds):
6389 (JSC::dateProtoFuncGetTimezoneOffset):
6390 (JSC::dateProtoFuncSetTime):
6391 (JSC::setNewValueFromTimeArgs):
6392 (JSC::setNewValueFromDateArgs):
6393 (JSC::dateProtoFuncSetMilliSeconds):
6394 (JSC::dateProtoFuncSetUTCMilliseconds):
6395 (JSC::dateProtoFuncSetSeconds):
6396 (JSC::dateProtoFuncSetUTCSeconds):
6397 (JSC::dateProtoFuncSetMinutes):
6398 (JSC::dateProtoFuncSetUTCMinutes):
6399 (JSC::dateProtoFuncSetHours):
6400 (JSC::dateProtoFuncSetUTCHours):
6401 (JSC::dateProtoFuncSetDate):
6402 (JSC::dateProtoFuncSetUTCDate):
6403 (JSC::dateProtoFuncSetMonth):
6404 (JSC::dateProtoFuncSetUTCMonth):
6405 (JSC::dateProtoFuncSetFullYear):
6406 (JSC::dateProtoFuncSetUTCFullYear):
6407 (JSC::dateProtoFuncSetYear):
6408 (JSC::dateProtoFuncGetYear):
6409 * runtime/DatePrototype.h:
6410 (JSC::DatePrototype::createStructure):
6411 * runtime/ErrorConstructor.cpp:
6412 (JSC::callErrorConstructor):
6413 * runtime/ErrorPrototype.cpp:
6414 (JSC::errorProtoFuncToString):
6415 * runtime/ExceptionHelpers.cpp:
6416 (JSC::createInterruptedExecutionException):
6417 (JSC::createError):
6418 (JSC::createStackOverflowError):
6419 (JSC::createUndefinedVariableError):
6420 (JSC::createErrorMessage):
6421 (JSC::createInvalidParamError):
6422 (JSC::createNotAConstructorError):
6423 (JSC::createNotAFunctionError):
6424 * runtime/ExceptionHelpers.h:
6425 * runtime/FunctionConstructor.cpp:
6426 (JSC::callFunctionConstructor):
6427 * runtime/FunctionPrototype.cpp:
6428 (JSC::callFunctionPrototype):
6429 (JSC::functionProtoFuncToString):
6430 (JSC::functionProtoFuncApply):
6431 (JSC::functionProtoFuncCall):
6432 * runtime/FunctionPrototype.h:
6433 (JSC::FunctionPrototype::createStructure):
6434 * runtime/GetterSetter.cpp:
6435 (JSC::GetterSetter::toPrimitive):
6436 (JSC::GetterSetter::getPrimitiveNumber):
6437 * runtime/GetterSetter.h:
6438 (JSC::asGetterSetter):
6439 * runtime/InternalFunction.cpp:
6440 (JSC::InternalFunction::displayName):
6441 * runtime/InternalFunction.h:
6442 (JSC::InternalFunction::createStructure):
6443 (JSC::asInternalFunction):
6444 * runtime/JSActivation.cpp:
6445 (JSC::JSActivation::getOwnPropertySlot):
6446 (JSC::JSActivation::put):
6447 (JSC::JSActivation::putWithAttributes):
6448 (JSC::JSActivation::argumentsGetter):
6449 * runtime/JSActivation.h:
6450 (JSC::JSActivation::createStructure):
6451 (JSC::asActivation):
6452 * runtime/JSArray.cpp:
6453 (JSC::storageSize):
6454 (JSC::JSArray::JSArray):
6455 (JSC::JSArray::getOwnPropertySlot):
6456 (JSC::JSArray::put):
6457 (JSC::JSArray::putSlowCase):
6458 (JSC::JSArray::deleteProperty):
6459 (JSC::JSArray::setLength):
6460 (JSC::JSArray::pop):
6461 (JSC::JSArray::push):
6462 (JSC::JSArray::mark):
6463 (JSC::compareNumbersForQSort):
6464 (JSC::JSArray::sortNumeric):
6465 (JSC::JSArray::sort):
6466 (JSC::JSArray::compactForSorting):
6467 (JSC::JSArray::checkConsistency):
6468 (JSC::constructArray):
6469 * runtime/JSArray.h:
6470 (JSC::JSArray::getIndex):
6471 (JSC::JSArray::setIndex):
6472 (JSC::JSArray::createStructure):
6473 (JSC::asArray):
6474 (JSC::isJSArray):
6475 * runtime/JSByteArray.cpp:
6476 (JSC::JSByteArray::createStructure):
6477 (JSC::JSByteArray::put):
6478 * runtime/JSByteArray.h:
6479 (JSC::JSByteArray::getIndex):
6480 (JSC::JSByteArray::setIndex):
6481 (JSC::asByteArray):
6482 (JSC::isJSByteArray):
6483 * runtime/JSCell.cpp:
6484 (JSC::JSCell::put):
6485 (JSC::JSCell::getJSNumber):
6486 * runtime/JSCell.h:
6487 (JSC::asCell):
6488 (JSC::JSValue::asCell):
6489 (JSC::JSValue::isString):
6490 (JSC::JSValue::isGetterSetter):
6491 (JSC::JSValue::isObject):
6492 (JSC::JSValue::getString):
6493 (JSC::JSValue::getObject):
6494 (JSC::JSValue::getCallData):
6495 (JSC::JSValue::getConstructData):
6496 (JSC::JSValue::getUInt32):
6497 (JSC::JSValue::getTruncatedInt32):
6498 (JSC::JSValue::getTruncatedUInt32):
6499 (JSC::JSValue::mark):
6500 (JSC::JSValue::marked):
6501 (JSC::JSValue::toPrimitive):
6502 (JSC::JSValue::getPrimitiveNumber):
6503 (JSC::JSValue::toBoolean):
6504 (JSC::JSValue::toNumber):
6505 (JSC::JSValue::toString):
6506 (JSC::JSValue::toObject):
6507 (JSC::JSValue::toThisObject):
6508 (JSC::JSValue::needsThisConversion):
6509 (JSC::JSValue::toThisString):
6510 (JSC::JSValue::getJSNumber):
6511 * runtime/JSFunction.cpp:
6512 (JSC::JSFunction::call):
6513 (JSC::JSFunction::argumentsGetter):
6514 (JSC::JSFunction::callerGetter):
6515 (JSC::JSFunction::lengthGetter):
6516 (JSC::JSFunction::getOwnPropertySlot):
6517 (JSC::JSFunction::put):
6518 (JSC::JSFunction::construct):
6519 * runtime/JSFunction.h:
6520 (JSC::JSFunction::createStructure):
6521 (JSC::asFunction):
6522 * runtime/JSGlobalData.h:
6523 * runtime/JSGlobalObject.cpp:
6524 (JSC::markIfNeeded):
6525 (JSC::JSGlobalObject::put):
6526 (JSC::JSGlobalObject::putWithAttributes):
6527 (JSC::JSGlobalObject::reset):
6528 (JSC::JSGlobalObject::resetPrototype):
6529 * runtime/JSGlobalObject.h:
6530 (JSC::JSGlobalObject::createStructure):
6531 (JSC::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo):
6532 (JSC::asGlobalObject):
6533 (JSC::Structure::prototypeForLookup):
6534 (JSC::Structure::prototypeChain):
6535 (JSC::Structure::isValid):
6536 * runtime/JSGlobalObjectFunctions.cpp:
6537 (JSC::encode):
6538 (JSC::decode):
6539 (JSC::globalFuncEval):
6540 (JSC::globalFuncParseInt):
6541 (JSC::globalFuncParseFloat):
6542 (JSC::globalFuncIsNaN):
6543 (JSC::globalFuncIsFinite):
6544 (JSC::globalFuncDecodeURI):
6545 (JSC::globalFuncDecodeURIComponent):
6546 (JSC::globalFuncEncodeURI):
6547 (JSC::globalFuncEncodeURIComponent):
6548 (JSC::globalFuncEscape):
6549 (JSC::globalFuncUnescape):
6550 (JSC::globalFuncJSCPrint):
6551 * runtime/JSGlobalObjectFunctions.h:
6552 * runtime/JSImmediate.cpp:
6553 (JSC::JSImmediate::toThisObject):
6554 (JSC::JSImmediate::toObject):
6555 (JSC::JSImmediate::prototype):
6556 (JSC::JSImmediate::toString):
6557 * runtime/JSImmediate.h:
6558 (JSC::JSImmediate::isImmediate):
6559 (JSC::JSImmediate::isNumber):
6560 (JSC::JSImmediate::isIntegerNumber):
6561 (JSC::JSImmediate::isDoubleNumber):
6562 (JSC::JSImmediate::isPositiveIntegerNumber):
6563 (JSC::JSImmediate::isBoolean):
6564 (JSC::JSImmediate::isUndefinedOrNull):
6565 (JSC::JSImmediate::isEitherImmediate):
6566 (JSC::JSImmediate::areBothImmediate):
6567 (JSC::JSImmediate::areBothImmediateIntegerNumbers):
6568 (JSC::JSImmediate::makeValue):
6569 (JSC::JSImmediate::makeInt):
6570 (JSC::JSImmediate::makeDouble):
6571 (JSC::JSImmediate::makeBool):
6572 (JSC::JSImmediate::makeUndefined):
6573 (JSC::JSImmediate::makeNull):
6574 (JSC::JSImmediate::doubleValue):
6575 (JSC::JSImmediate::intValue):
6576 (JSC::JSImmediate::uintValue):
6577 (JSC::JSImmediate::boolValue):
6578 (JSC::JSImmediate::rawValue):
6579 (JSC::JSImmediate::trueImmediate):
6580 (JSC::JSImmediate::falseImmediate):
6581 (JSC::JSImmediate::undefinedImmediate):
6582 (JSC::JSImmediate::nullImmediate):
6583 (JSC::JSImmediate::zeroImmediate):
6584 (JSC::JSImmediate::oneImmediate):
6585 (JSC::JSImmediate::impossibleValue):
6586 (JSC::JSImmediate::toBoolean):
6587 (JSC::JSImmediate::getTruncatedUInt32):
6588 (JSC::JSImmediate::fromNumberOutsideIntegerRange):
6589 (JSC::JSImmediate::from):
6590 (JSC::JSImmediate::getTruncatedInt32):
6591 (JSC::JSImmediate::toDouble):
6592 (JSC::JSImmediate::getUInt32):
6593 (JSC::JSValue::JSValue):
6594 (JSC::JSValue::isUndefinedOrNull):
6595 (JSC::JSValue::isBoolean):
6596 (JSC::JSValue::getBoolean):
6597 (JSC::JSValue::toInt32):
6598 (JSC::JSValue::toUInt32):
6599 (JSC::JSValue::isCell):
6600 (JSC::JSValue::isInt32Fast):
6601 (JSC::JSValue::getInt32Fast):
6602 (JSC::JSValue::isUInt32Fast):
6603 (JSC::JSValue::getUInt32Fast):
6604 (JSC::JSValue::makeInt32Fast):
6605 (JSC::JSValue::areBothInt32Fast):
6606 (JSC::JSFastMath::canDoFastBitwiseOperations):
6607 (JSC::JSFastMath::equal):
6608 (JSC::JSFastMath::notEqual):
6609 (JSC::JSFastMath::andImmediateNumbers):
6610 (JSC::JSFastMath::xorImmediateNumbers):
6611 (JSC::JSFastMath::orImmediateNumbers):
6612 (JSC::JSFastMath::canDoFastRshift):
6613 (JSC::JSFastMath::canDoFastUrshift):
6614 (JSC::JSFastMath::rightShiftImmediateNumbers):
6615 (JSC::JSFastMath::canDoFastAdditiveOperations):
6616 (JSC::JSFastMath::addImmediateNumbers):
6617 (JSC::JSFastMath::subImmediateNumbers):
6618 (JSC::JSFastMath::incImmediateNumber):
6619 (JSC::JSFastMath::decImmediateNumber):
6620 * runtime/JSNotAnObject.cpp:
6621 (JSC::JSNotAnObject::toPrimitive):
6622 (JSC::JSNotAnObject::getPrimitiveNumber):
6623 (JSC::JSNotAnObject::put):
6624 * runtime/JSNotAnObject.h:
6625 (JSC::JSNotAnObject::createStructure):
6626 * runtime/JSNumberCell.cpp:
6627 (JSC::JSNumberCell::toPrimitive):
6628 (JSC::JSNumberCell::getPrimitiveNumber):
6629 (JSC::JSNumberCell::getJSNumber):
6630 (JSC::jsNumberCell):
6631 * runtime/JSNumberCell.h:
6632 (JSC::JSNumberCell::createStructure):
6633 (JSC::isNumberCell):
6634 (JSC::asNumberCell):
6635 (JSC::jsNumber):
6636 (JSC::JSValue::isDoubleNumber):
6637 (JSC::JSValue::getDoubleNumber):
6638 (JSC::JSValue::isNumber):
6639 (JSC::JSValue::uncheckedGetNumber):
6640 (JSC::jsNaN):
6641 (JSC::JSValue::toJSNumber):
6642 (JSC::JSValue::getNumber):
6643 (JSC::JSValue::numberToInt32):
6644 (JSC::JSValue::numberToUInt32):
6645 * runtime/JSObject.cpp:
6646 (JSC::JSObject::mark):
6647 (JSC::JSObject::put):
6648 (JSC::JSObject::putWithAttributes):
6649 (JSC::callDefaultValueFunction):
6650 (JSC::JSObject::getPrimitiveNumber):
6651 (JSC::JSObject::defaultValue):
6652 (JSC::JSObject::defineGetter):
6653 (JSC::JSObject::defineSetter):
6654 (JSC::JSObject::lookupGetter):
6655 (JSC::JSObject::lookupSetter):
6656 (JSC::JSObject::hasInstance):
6657 (JSC::JSObject::toNumber):
6658 (JSC::JSObject::toString):
6659 (JSC::JSObject::fillGetterPropertySlot):
6660 * runtime/JSObject.h:
6661 (JSC::JSObject::getDirect):
6662 (JSC::JSObject::getDirectLocation):
6663 (JSC::JSObject::offsetForLocation):
6664 (JSC::JSObject::locationForOffset):
6665 (JSC::JSObject::getDirectOffset):
6666 (JSC::JSObject::putDirectOffset):
6667 (JSC::JSObject::createStructure):
6668 (JSC::asObject):
6669 (JSC::JSObject::prototype):
6670 (JSC::JSObject::setPrototype):
6671 (JSC::JSValue::isObject):
6672 (JSC::JSObject::inlineGetOwnPropertySlot):
6673 (JSC::JSObject::getOwnPropertySlotForWrite):
6674 (JSC::JSObject::getPropertySlot):
6675 (JSC::JSObject::get):
6676 (JSC::JSObject::putDirect):
6677 (JSC::JSObject::putDirectWithoutTransition):
6678 (JSC::JSObject::toPrimitive):
6679 (JSC::JSValue::get):
6680 (JSC::JSValue::put):
6681 (JSC::JSObject::allocatePropertyStorageInline):
6682 * runtime/JSPropertyNameIterator.cpp:
6683 (JSC::JSPropertyNameIterator::toPrimitive):
6684 (JSC::JSPropertyNameIterator::getPrimitiveNumber):
6685 * runtime/JSPropertyNameIterator.h:
6686 (JSC::JSPropertyNameIterator::create):
6687 (JSC::JSPropertyNameIterator::next):
6688 * runtime/JSStaticScopeObject.cpp:
6689 (JSC::JSStaticScopeObject::put):
6690 (JSC::JSStaticScopeObject::putWithAttributes):
6691 * runtime/JSStaticScopeObject.h:
6692 (JSC::JSStaticScopeObject::JSStaticScopeObject):
6693 (JSC::JSStaticScopeObject::createStructure):
6694 * runtime/JSString.cpp:
6695 (JSC::JSString::toPrimitive):
6696 (JSC::JSString::getPrimitiveNumber):
6697 (JSC::JSString::getOwnPropertySlot):
6698 * runtime/JSString.h:
6699 (JSC::JSString::createStructure):
6700 (JSC::asString):
6701 (JSC::isJSString):
6702 (JSC::JSValue::toThisJSString):
6703 * runtime/JSValue.cpp:
6704 (JSC::JSValue::toInteger):
6705 (JSC::JSValue::toIntegerPreserveNaN):
6706 * runtime/JSValue.h:
6707 (JSC::JSValue::makeImmediate):
6708 (JSC::JSValue::asValue):
6709 (JSC::noValue):
6710 (JSC::jsImpossibleValue):
6711 (JSC::jsNull):
6712 (JSC::jsUndefined):
6713 (JSC::jsBoolean):
6714 (JSC::operator==):
6715 (JSC::operator!=):
6716 (JSC::JSValue::encode):
6717 (JSC::JSValue::decode):
6718 (JSC::JSValue::JSValue):
6719 (JSC::JSValue::operator bool):
6720 (JSC::JSValue::operator==):
6721 (JSC::JSValue::operator!=):
6722 (JSC::JSValue::isUndefined):
6723 (JSC::JSValue::isNull):
6724 * runtime/JSVariableObject.h:
6725 (JSC::JSVariableObject::symbolTablePut):
6726 (JSC::JSVariableObject::symbolTablePutWithAttributes):
6727 * runtime/JSWrapperObject.h:
6728 (JSC::JSWrapperObject::internalValue):
6729 (JSC::JSWrapperObject::setInternalValue):
6730 * runtime/Lookup.cpp:
6731 (JSC::setUpStaticFunctionSlot):
6732 * runtime/Lookup.h:
6733 (JSC::lookupPut):
6734 * runtime/MathObject.cpp:
6735 (JSC::mathProtoFuncAbs):
6736 (JSC::mathProtoFuncACos):
6737 (JSC::mathProtoFuncASin):
6738 (JSC::mathProtoFuncATan):
6739 (JSC::mathProtoFuncATan2):
6740 (JSC::mathProtoFuncCeil):
6741 (JSC::mathProtoFuncCos):
6742 (JSC::mathProtoFuncExp):
6743 (JSC::mathProtoFuncFloor):
6744 (JSC::mathProtoFuncLog):
6745 (JSC::mathProtoFuncMax):
6746 (JSC::mathProtoFuncMin):
6747 (JSC::mathProtoFuncPow):
6748 (JSC::mathProtoFuncRandom):
6749 (JSC::mathProtoFuncRound):
6750 (JSC::mathProtoFuncSin):
6751 (JSC::mathProtoFuncSqrt):
6752 (JSC::mathProtoFuncTan):
6753 * runtime/MathObject.h:
6754 (JSC::MathObject::createStructure):
6755 * runtime/NativeErrorConstructor.cpp:
6756 (JSC::callNativeErrorConstructor):
6757 * runtime/NumberConstructor.cpp:
6758 (JSC::numberConstructorNaNValue):
6759 (JSC::numberConstructorNegInfinity):
6760 (JSC::numberConstructorPosInfinity):
6761 (JSC::numberConstructorMaxValue):
6762 (JSC::numberConstructorMinValue):
6763 (JSC::callNumberConstructor):
6764 * runtime/NumberConstructor.h:
6765 (JSC::NumberConstructor::createStructure):
6766 * runtime/NumberObject.cpp:
6767 (JSC::NumberObject::getJSNumber):
6768 (JSC::constructNumber):
6769 * runtime/NumberObject.h:
6770 * runtime/NumberPrototype.cpp:
6771 (JSC::numberProtoFuncToString):
6772 (JSC::numberProtoFuncToLocaleString):
6773 (JSC::numberProtoFuncValueOf):
6774 (JSC::numberProtoFuncToFixed):
6775 (JSC::numberProtoFuncToExponential):
6776 (JSC::numberProtoFuncToPrecision):
6777 * runtime/ObjectConstructor.cpp:
6778 (JSC::constructObject):
6779 (JSC::callObjectConstructor):
6780 * runtime/ObjectPrototype.cpp:
6781 (JSC::objectProtoFuncValueOf):
6782 (JSC::objectProtoFuncHasOwnProperty):
6783 (JSC::objectProtoFuncIsPrototypeOf):
6784 (JSC::objectProtoFuncDefineGetter):
6785 (JSC::objectProtoFuncDefineSetter):
6786 (JSC::objectProtoFuncLookupGetter):
6787 (JSC::objectProtoFuncLookupSetter):
6788 (JSC::objectProtoFuncPropertyIsEnumerable):
6789 (JSC::objectProtoFuncToLocaleString):
6790 (JSC::objectProtoFuncToString):
6791 * runtime/ObjectPrototype.h:
6792 * runtime/Operations.cpp:
6793 (JSC::JSValue::equalSlowCase):
6794 (JSC::JSValue::strictEqualSlowCase):
6795 (JSC::throwOutOfMemoryError):
6796 (JSC::jsAddSlowCase):
6797 (JSC::jsTypeStringForValue):
6798 (JSC::jsIsObjectType):
6799 (JSC::jsIsFunctionType):
6800 * runtime/Operations.h:
6801 (JSC::JSValue::equal):
6802 (JSC::JSValue::equalSlowCaseInline):
6803 (JSC::JSValue::strictEqual):
6804 (JSC::JSValue::strictEqualSlowCaseInline):
6805 (JSC::jsLess):
6806 (JSC::jsLessEq):
6807 (JSC::jsAdd):
6808 (JSC::countPrototypeChainEntriesAndCheckForProxies):
6809 (JSC::resolveBase):
6810 * runtime/PropertySlot.cpp:
6811 (JSC::PropertySlot::functionGetter):
6812 * runtime/PropertySlot.h:
6813 (JSC::PropertySlot::PropertySlot):
6814 (JSC::PropertySlot::getValue):
6815 (JSC::PropertySlot::putValue):
6816 (JSC::PropertySlot::setValueSlot):
6817 (JSC::PropertySlot::setValue):
6818 (JSC::PropertySlot::setCustom):
6819 (JSC::PropertySlot::setCustomIndex):
6820 (JSC::PropertySlot::slotBase):
6821 (JSC::PropertySlot::setBase):
6822 (JSC::PropertySlot::):
6823 * runtime/Protect.h:
6824 (JSC::gcProtect):
6825 (JSC::gcUnprotect):
6826 (JSC::ProtectedPtr::operator JSValue):
6827 (JSC::ProtectedJSValue::ProtectedJSValue):
6828 (JSC::ProtectedJSValue::get):
6829 (JSC::ProtectedJSValue::operator JSValue):
6830 (JSC::ProtectedJSValue::operator->):
6831 (JSC::ProtectedJSValue::~ProtectedJSValue):
6832 (JSC::ProtectedJSValue::operator=):
6833 (JSC::operator==):
6834 (JSC::operator!=):
6835 * runtime/RegExpConstructor.cpp:
6836 (JSC::RegExpConstructor::getBackref):
6837 (JSC::RegExpConstructor::getLastParen):
6838 (JSC::RegExpConstructor::getLeftContext):
6839 (JSC::RegExpConstructor::getRightContext):
6840 (JSC::regExpConstructorDollar1):
6841 (JSC::regExpConstructorDollar2):
6842 (JSC::regExpConstructorDollar3):
6843 (JSC::regExpConstructorDollar4):
6844 (JSC::regExpConstructorDollar5):
6845 (JSC::regExpConstructorDollar6):
6846 (JSC::regExpConstructorDollar7):
6847 (JSC::regExpConstructorDollar8):
6848 (JSC::regExpConstructorDollar9):
6849 (JSC::regExpConstructorInput):
6850 (JSC::regExpConstructorMultiline):
6851 (JSC::regExpConstructorLastMatch):
6852 (JSC::regExpConstructorLastParen):
6853 (JSC::regExpConstructorLeftContext):
6854 (JSC::regExpConstructorRightContext):
6855 (JSC::RegExpConstructor::put):
6856 (JSC::setRegExpConstructorInput):
6857 (JSC::setRegExpConstructorMultiline):
6858 (JSC::constructRegExp):
6859 (JSC::callRegExpConstructor):
6860 * runtime/RegExpConstructor.h:
6861 (JSC::RegExpConstructor::createStructure):
6862 (JSC::asRegExpConstructor):
6863 * runtime/RegExpMatchesArray.h:
6864 (JSC::RegExpMatchesArray::put):
6865 * runtime/RegExpObject.cpp:
6866 (JSC::regExpObjectGlobal):
6867 (JSC::regExpObjectIgnoreCase):
6868 (JSC::regExpObjectMultiline):
6869 (JSC::regExpObjectSource):
6870 (JSC::regExpObjectLastIndex):
6871 (JSC::RegExpObject::put):
6872 (JSC::setRegExpObjectLastIndex):
6873 (JSC::RegExpObject::test):
6874 (JSC::RegExpObject::exec):
6875 (JSC::callRegExpObject):
6876 * runtime/RegExpObject.h:
6877 (JSC::RegExpObject::createStructure):
6878 (JSC::asRegExpObject):
6879 * runtime/RegExpPrototype.cpp:
6880 (JSC::regExpProtoFuncTest):
6881 (JSC::regExpProtoFuncExec):
6882 (JSC::regExpProtoFuncCompile):
6883 (JSC::regExpProtoFuncToString):
6884 * runtime/StringConstructor.cpp:
6885 (JSC::stringFromCharCodeSlowCase):
6886 (JSC::stringFromCharCode):
6887 (JSC::callStringConstructor):
6888 * runtime/StringObject.cpp:
6889 (JSC::StringObject::put):
6890 * runtime/StringObject.h:
6891 (JSC::StringObject::createStructure):
6892 (JSC::asStringObject):
6893 * runtime/StringObjectThatMasqueradesAsUndefined.h:
6894 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
6895 * runtime/StringPrototype.cpp:
6896 (JSC::stringProtoFuncReplace):
6897 (JSC::stringProtoFuncToString):
6898 (JSC::stringProtoFuncCharAt):
6899 (JSC::stringProtoFuncCharCodeAt):
6900 (JSC::stringProtoFuncConcat):
6901 (JSC::stringProtoFuncIndexOf):
6902 (JSC::stringProtoFuncLastIndexOf):
6903 (JSC::stringProtoFuncMatch):
6904 (JSC::stringProtoFuncSearch):
6905 (JSC::stringProtoFuncSlice):
6906 (JSC::stringProtoFuncSplit):
6907 (JSC::stringProtoFuncSubstr):
6908 (JSC::stringProtoFuncSubstring):
6909 (JSC::stringProtoFuncToLowerCase):
6910 (JSC::stringProtoFuncToUpperCase):
6911 (JSC::stringProtoFuncLocaleCompare):
6912 (JSC::stringProtoFuncBig):
6913 (JSC::stringProtoFuncSmall):
6914 (JSC::stringProtoFuncBlink):
6915 (JSC::stringProtoFuncBold):
6916 (JSC::stringProtoFuncFixed):
6917 (JSC::stringProtoFuncItalics):
6918 (JSC::stringProtoFuncStrike):
6919 (JSC::stringProtoFuncSub):
6920 (JSC::stringProtoFuncSup):
6921 (JSC::stringProtoFuncFontcolor):
6922 (JSC::stringProtoFuncFontsize):
6923 (JSC::stringProtoFuncAnchor):
6924 (JSC::stringProtoFuncLink):
6925 * runtime/Structure.cpp:
6926 (JSC::Structure::Structure):
6927 (JSC::Structure::changePrototypeTransition):
6928 * runtime/Structure.h:
6929 (JSC::Structure::create):
6930 (JSC::Structure::setPrototypeWithoutTransition):
6931 (JSC::Structure::storedPrototype):
6932
6933 2009-05-01 Geoffrey Garen <ggaren@apple.com>
6934
6935 Reviewed by Sam "That doesn't look like what I thought it looks like" Weinig.
6936
6937 Beefed up the JSValuePtr class and removed some non-JSValuePtr dependencies
6938 on JSImmediate, in prepapration for making JSImmediate an implementation
6939 detail of JSValuePtr.
6940
6941 SunSpider reports no change.
6942
6943 * interpreter/Interpreter.cpp:
6944 (JSC::Interpreter::privateExecute):
6945 * jit/JIT.cpp:
6946 (JSC::JIT::privateCompileMainPass):
6947 * jit/JITArithmetic.cpp:
6948 (JSC::JIT::compileFastArith_op_mod):
6949 * runtime/JSGlobalObjectFunctions.cpp:
6950 (JSC::globalFuncParseInt): Updated for interface changes.
6951
6952 * runtime/JSImmediate.h:
6953 (JSC::JSValuePtr::JSValuePtr):
6954 * runtime/JSValue.h:
6955 (JSC::JSValuePtr::):
6956 (JSC::jsImpossibleValue):
6957 (JSC::jsNull):
6958 (JSC::jsUndefined):
6959 (JSC::jsBoolean):
6960 (JSC::JSValuePtr::encode):
6961 (JSC::JSValuePtr::decode):
6962 (JSC::JSValuePtr::JSValuePtr):
6963 (JSC::JSValuePtr::operator bool):
6964 (JSC::JSValuePtr::operator==):
6965 (JSC::JSValuePtr::operator!=):
6966 (JSC::JSValuePtr::isUndefined):
6967 (JSC::JSValuePtr::isNull): Changed jsImpossibleValue(), jsNull(),
6968 jsUndefined(), and jsBoolean() to operate in terms of JSValuePtr instead
6969 of JSImmediate.
6970
6971 * wtf/StdLibExtras.h:
6972 (WTF::bitwise_cast): Fixed up for clarity.
6973
6974 2009-04-30 Gavin Barraclough <barraclough@apple.com>
6975
6976 Reviewed by Geoff Garen.
6977
6978 Bug fix for rdar:/6845379. If a case-insensitive regex contains
6979 a character class containing a range with an upper bound of \uFFFF
6980 the parser will infinite-loop whist adding other-case characters
6981 for characters in the range that do have another case.
6982
6983 * yarr/RegexCompiler.cpp:
6984 (JSC::Yarr::CharacterClassConstructor::putRange):
6985
6986 2009-04-30 Gavin Barraclough <barraclough@apple.com>
6987
6988 Reviewed by Oliver Hunt.
6989
6990 OPCODE_SAMPLING without CODEBLOCK_SAMPLING is currently broken,
6991 since SamplingTool::Sample::isNull() checks the m_codeBlock
6992 member (which is always null without CODEBLOCK_SAMPLING).
6993
6994 Restructure the checks so make this work again.
6995
6996 * bytecode/SamplingTool.cpp:
6997 (JSC::SamplingTool::doRun):
6998 * bytecode/SamplingTool.h:
6999 (JSC::SamplingTool::Sample::isNull):
7000
7001 2009-04-30 Maciej Stachowiak <mjs@apple.com>
7002
7003 Reviewed by Gavin Barraclough.
7004
7005 - Concatenate final three strings in simple replace case at one go
7006
7007 ~0.2% SunSpider speedup
7008
7009 * runtime/StringPrototype.cpp:
7010 (JSC::stringProtoFuncReplace): Use new replaceRange helper instead of
7011 taking substrings and concatenating three strings.
7012 * runtime/UString.cpp:
7013 (JSC::UString::replaceRange): New helper function.
7014 * runtime/UString.h:
7015
7016 2009-04-30 Geoffrey Garen <ggaren@apple.com>
7017
7018 Rubber Stamped by Gavin Barraclough.
7019
7020 Changed JSValueEncodedAsPtr* => EncodedJSValuePtr to support a non-pointer
7021 encoding for JSValuePtrs.
7022
7023 * API/APICast.h:
7024 (toJS):
7025 * bytecompiler/BytecodeGenerator.h:
7026 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
7027 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
7028 * interpreter/Register.h:
7029 (JSC::Register::):
7030 * jit/JIT.cpp:
7031 (JSC::):
7032 * jit/JIT.h:
7033 * jit/JITCode.h:
7034 (JSC::):
7035 * jit/JITStubs.cpp:
7036 (JSC::JITStubs::cti_op_add):
7037 (JSC::JITStubs::cti_op_pre_inc):
7038 (JSC::JITStubs::cti_op_get_by_id_generic):
7039 (JSC::JITStubs::cti_op_get_by_id):
7040 (JSC::JITStubs::cti_op_get_by_id_second):
7041 (JSC::JITStubs::cti_op_get_by_id_self_fail):
7042 (JSC::JITStubs::cti_op_get_by_id_proto_list):
7043 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
7044 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
7045 (JSC::JITStubs::cti_op_get_by_id_array_fail):
7046 (JSC::JITStubs::cti_op_get_by_id_string_fail):
7047 (JSC::JITStubs::cti_op_instanceof):
7048 (JSC::JITStubs::cti_op_del_by_id):
7049 (JSC::JITStubs::cti_op_mul):
7050 (JSC::JITStubs::cti_op_call_NotJSFunction):
7051 (JSC::JITStubs::cti_op_resolve):
7052 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
7053 (JSC::JITStubs::cti_op_get_by_val):
7054 (JSC::JITStubs::cti_op_get_by_val_string):
7055 (JSC::JITStubs::cti_op_get_by_val_byte_array):
7056 (JSC::JITStubs::cti_op_sub):
7057 (JSC::JITStubs::cti_op_lesseq):
7058 (JSC::JITStubs::cti_op_negate):
7059 (JSC::JITStubs::cti_op_resolve_base):
7060 (JSC::JITStubs::cti_op_resolve_skip):
7061 (JSC::JITStubs::cti_op_resolve_global):
7062 (JSC::JITStubs::cti_op_div):
7063 (JSC::JITStubs::cti_op_pre_dec):
7064 (JSC::JITStubs::cti_op_not):
7065 (JSC::JITStubs::cti_op_eq):
7066 (JSC::JITStubs::cti_op_lshift):
7067 (JSC::JITStubs::cti_op_bitand):
7068 (JSC::JITStubs::cti_op_rshift):
7069 (JSC::JITStubs::cti_op_bitnot):
7070 (JSC::JITStubs::cti_op_mod):
7071 (JSC::JITStubs::cti_op_less):
7072 (JSC::JITStubs::cti_op_neq):
7073 (JSC::JITStubs::cti_op_urshift):
7074 (JSC::JITStubs::cti_op_bitxor):
7075 (JSC::JITStubs::cti_op_bitor):
7076 (JSC::JITStubs::cti_op_call_eval):
7077 (JSC::JITStubs::cti_op_throw):
7078 (JSC::JITStubs::cti_op_next_pname):
7079 (JSC::JITStubs::cti_op_typeof):
7080 (JSC::JITStubs::cti_op_is_undefined):
7081 (JSC::JITStubs::cti_op_is_boolean):
7082 (JSC::JITStubs::cti_op_is_number):
7083 (JSC::JITStubs::cti_op_is_string):
7084 (JSC::JITStubs::cti_op_is_object):
7085 (JSC::JITStubs::cti_op_is_function):
7086 (JSC::JITStubs::cti_op_stricteq):
7087 (JSC::JITStubs::cti_op_nstricteq):
7088 (JSC::JITStubs::cti_op_to_jsnumber):
7089 (JSC::JITStubs::cti_op_in):
7090 (JSC::JITStubs::cti_op_del_by_val):
7091 (JSC::JITStubs::cti_vm_throw):
7092 * jit/JITStubs.h:
7093 * runtime/JSValue.h:
7094 (JSC::JSValuePtr::encode):
7095 (JSC::JSValuePtr::decode):
7096
7097 2009-04-30 Gavin Barraclough <barraclough@apple.com>
7098
7099 Reviewed by Oliver "Abandon Ship!" Hunt.
7100
7101 Fix a leak in Yarr.
7102
7103 All Disjunctions should be recorded in RegexPattern::m_disjunctions,
7104 so that they can be freed at the end of compilation - copyDisjunction
7105 is failing to do so.
7106
7107 * yarr/RegexCompiler.cpp:
7108 (JSC::Yarr::RegexPatternConstructor::copyDisjunction):
7109
7110 2009-04-30 Oliver Hunt <oliver@apple.com>
7111
7112 Reviewed by Gavin Barraclough.
7113
7114 Add function to CallFrame for dumping the current JS caller
7115
7116 Added debug only method CallFrame::dumpCaller() that provide the call location
7117 of the deepest currently executing JS function.
7118
7119 * interpreter/CallFrame.cpp:
7120 (JSC::CallFrame::dumpCaller):
7121 * interpreter/CallFrame.h:
7122
7123 2009-04-30 Maciej Stachowiak <mjs@apple.com>
7124
7125 Reviewed by Geoff Garen.
7126
7127 - make BaseStrings have themselves as a base, instead of nothing, to remove common branches
7128
7129 ~0.7% SunSpider speedup
7130
7131 * runtime/UString.h:
7132 (JSC::UString::Rep::Rep): For the constructor without a base, set self as base instead of null.
7133 (JSC::UString::Rep::baseString): Just read m_baseString - no more branching.
7134
7135 2009-04-30 Gavin Barraclough <barraclough@apple.com>
7136
7137 Reviewed by Oliver Hunt.
7138
7139 Two quick improvements to SamplingFlags mechanism.
7140
7141 SamplingFlags::ScopedFlag class to provide support for automagically
7142 clearing a flag as it goes out of scope, and add a little more detail
7143 to the output generated by the tool.
7144
7145 * bytecode/SamplingTool.cpp:
7146 (JSC::SamplingFlags::stop):
7147 * bytecode/SamplingTool.h:
7148 (JSC::SamplingFlags::ScopedFlag::ScopedFlag):
7149 (JSC::SamplingFlags::ScopedFlag::~ScopedFlag):
7150
7151 2009-04-30 Adam Roben <aroben@apple.com>
7152
7153 Restore build event steps that were truncated in r43082
7154
7155 Rubber-stamped by Steve Falkenburg.
7156
7157 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
7158 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
7159 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
7160 Re-copied the command lines for the build events from the pre-r43082
7161 .vcproj files.
7162
7163 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Removed an unnecessary
7164 attribute.
7165
7166 2009-04-30 Adam Roben <aroben@apple.com>
7167
7168 Move settings from .vcproj files to .vsprops files within the
7169 JavaScriptCore directory
7170
7171 Moving the settings to a .vsprops file means that we will only have to
7172 change a single setting to affect all configurations, instead of one
7173 setting per configuration.
7174
7175 Reviewed by Steve Falkenburg.
7176
7177 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7178 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
7179 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
7180 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
7181 Moved settings from these files to the new .vsprops files. Note that
7182 testapi.vcproj had a lot of overrides of default settings that were
7183 the same as the defaults, which I've removed.
7184
7185 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Added.
7186 * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: Added.
7187 * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added.
7188 * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Added.
7189
7190 2009-04-30 Dimitri Glazkov <dglazkov@chromium.org>
7191
7192 Reviewed by Timothy Hatcher.
7193
7194 https://bugs.webkit.org/show_bug.cgi?id=25470
7195 Extend the cover of ENABLE_JAVASCRIPT_DEBUGGER to profiler.
7196
7197 * Configurations/FeatureDefines.xcconfig: Added ENABLE_JAVASCRIPT_DEBUGGER define.
7198
7199 2009-04-30 Maciej Stachowiak <mjs@apple.com>
7200
7201 Reviewed by Alexey Proskuryakov.
7202
7203 - speed up string concatenation by reorganizing some simple cases
7204
7205 0.7% SunSpider speedup
7206
7207 * runtime/UString.cpp:
7208 (JSC::concatenate): Put fast case for appending a single character
7209 before the empty string special cases; streamline code a bit to
7210 delay computing values that are not needed in the fast path.
7211
7212 2009-04-30 Gavin Barraclough <barraclough@apple.com>
7213
7214 Reviewed by Maciej Stachowiak.
7215
7216 Add SamplingFlags mechanism.
7217
7218 This mechanism allows fine-grained JSC and JavaScript program aware
7219 performance measurement. The mechanism provides a set of 32 flags,
7220 numbered #1..#32. Flag #16 is initially set, and all other flags
7221 are cleared. Flags may be set and cleared from within
7222
7223 Enable by setting ENABLE_SAMPLING_FLAGS to 1 in wtf/Platform.h.
7224 Disabled by default, no performance impact. Flags may be modified
7225 by calling SamplingFlags::setFlag() and SamplingFlags::clearFlag()
7226 from within JSC implementation, or by calling setSamplingFlag() and
7227 clearSamplingFlag() from JavaScript.
7228
7229 The flags are sampled with a frequency of 10000Hz, and the highest
7230 set flag in recorded, allowing multiple events to be measured (with
7231 the highest flag number representing the highest priority).
7232
7233 Disabled by default; no performance impact.
7234
7235 * JavaScriptCore.exp:
7236 * bytecode/SamplingTool.cpp:
7237 (JSC::SamplingFlags::sample):
7238 (JSC::SamplingFlags::start):
7239 (JSC::SamplingFlags::stop):
7240 (JSC::SamplingThread::threadStartFunc):
7241 (JSC::SamplingThread::start):
7242 (JSC::SamplingThread::stop):
7243 (JSC::ScopeSampleRecord::sample):
7244 (JSC::SamplingTool::doRun):
7245 (JSC::SamplingTool::sample):
7246 (JSC::SamplingTool::start):
7247 (JSC::SamplingTool::stop):
7248 * bytecode/SamplingTool.h:
7249 (JSC::SamplingFlags::setFlag):
7250 (JSC::SamplingFlags::clearFlag):
7251 (JSC::SamplingTool::SamplingTool):
7252 * jsc.cpp:
7253 (GlobalObject::GlobalObject):
7254 (functionSetSamplingFlag):
7255 (functionClearSamplingFlag):
7256 (runWithScripts):
7257 * wtf/Platform.h:
7258
7259 2009-04-29 Sam Weinig <sam@webkit.org>
7260
7261 Another attempt to fix the windows build.
7262
7263 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7264 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
7265
7266 2009-04-29 Sam Weinig <sam@webkit.org>
7267
7268 Try and fix the windows build.
7269
7270 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7271 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
7272
7273 2009-04-29 Gavin Barraclough <barraclough@apple.com>
7274
7275 Reviewed by Oliver "Peg-Leg" Hunt.
7276
7277 Coallesce input checking and reduce futzing with the index position
7278 between alternatives and iterations of the main loop of a regex,
7279 when run in YARR.
7280
7281 Consider the following regex: /foo|bar/
7282
7283 Prior to this patch, this will be implemented something like this pseudo-code description:
7284
7285 loop:
7286 check_for_available_input(3) // this increments the index by 3, for the first alterantive.
7287 if (available) { test "foo" }
7288 decrement_index(3)
7289 check_for_available_input(3) // this increments the index by 3, for the second alterantive.
7290 if (available) { test "bar" }
7291 decrement_index(3)
7292 check_for_available_input(1) // can we loop again?
7293 if (available) { goto loop }
7294
7295 With these changes it will look more like this:
7296
7297 check_for_available_input(3) // this increments the index by 3, for the first alterantive.
7298 if (!available) { goto fail }
7299 loop:
7300 test "foo"
7301 test "bar"
7302 check_for_available_input(1) // can we loop again?
7303 if (available) { goto loop }
7304 fail:
7305
7306
7307 This gives about a 5% gain on v8-regex, no change on Sunspider.
7308
7309 * yarr/RegexJIT.cpp:
7310 (JSC::Yarr::RegexGenerator::TermGenerationState::linkAlternativeBacktracksTo):
7311 (JSC::Yarr::RegexGenerator::generateDisjunction):
7312
7313 2009-04-29 Oliver Hunt <oliver@apple.com>
7314
7315 Reviewed by Gavin Barraclough.
7316
7317 Clean up ArgList to be a trivial type
7318
7319 Separate out old ArgList logic to handle buffering and marking arguments
7320 into a distinct MarkedArgumentBuffer type. ArgList becomes a trivial
7321 struct of a pointer and length.
7322
7323 * API/JSObjectRef.cpp:
7324 (JSObjectMakeFunction):
7325 (JSObjectMakeArray):
7326 (JSObjectMakeDate):
7327 (JSObjectMakeError):
7328 (JSObjectMakeRegExp):
7329 (JSObjectCallAsFunction):
7330 (JSObjectCallAsConstructor):
7331 * JavaScriptCore.exp:
7332 * interpreter/CallFrame.h:
7333 (JSC::ExecState::emptyList):
7334 * runtime/ArgList.cpp:
7335 (JSC::ArgList::getSlice):
7336 (JSC::MarkedArgumentBuffer::markLists):
7337 (JSC::MarkedArgumentBuffer::slowAppend):
7338 * runtime/ArgList.h:
7339 (JSC::MarkedArgumentBuffer::MarkedArgumentBuffer):
7340 (JSC::MarkedArgumentBuffer::~MarkedArgumentBuffer):
7341 (JSC::ArgList::ArgList):
7342 (JSC::ArgList::at):
7343 (JSC::ArgList::isEmpty):
7344 (JSC::ArgList::size):
7345 (JSC::ArgList::begin):
7346 (JSC::ArgList::end):
7347 * runtime/Arguments.cpp:
7348 (JSC::Arguments::fillArgList):
7349 * runtime/Arguments.h:
7350 * runtime/ArrayPrototype.cpp:
7351 (JSC::arrayProtoFuncConcat):
7352 (JSC::arrayProtoFuncPush):
7353 (JSC::arrayProtoFuncSort):
7354 (JSC::arrayProtoFuncFilter):
7355 (JSC::arrayProtoFuncMap):
7356 (JSC::arrayProtoFuncEvery):
7357 (JSC::arrayProtoFuncForEach):
7358 (JSC::arrayProtoFuncSome):
7359 (JSC::arrayProtoFuncReduce):
7360 (JSC::arrayProtoFuncReduceRight):
7361 * runtime/Collector.cpp:
7362 (JSC::Heap::collect):
7363 * runtime/Collector.h:
7364 (JSC::Heap::markListSet):
7365 * runtime/CommonIdentifiers.h:
7366 * runtime/Error.cpp:
7367 (JSC::Error::create):
7368 * runtime/FunctionPrototype.cpp:
7369 (JSC::functionProtoFuncApply):
7370 * runtime/JSArray.cpp:
7371 (JSC::JSArray::JSArray):
7372 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
7373 (JSC::JSArray::fillArgList):
7374 (JSC::constructArray):
7375 * runtime/JSArray.h:
7376 * runtime/JSGlobalData.cpp:
7377 (JSC::JSGlobalData::JSGlobalData):
7378 * runtime/JSGlobalData.h:
7379 * runtime/JSObject.cpp:
7380 (JSC::JSObject::put):
7381 * runtime/StringConstructor.cpp:
7382 (JSC::stringFromCharCodeSlowCase):
7383 * runtime/StringPrototype.cpp:
7384 (JSC::stringProtoFuncReplace):
7385 (JSC::stringProtoFuncConcat):
7386 (JSC::stringProtoFuncMatch):
7387
7388 2009-04-29 Laszlo Gombos <laszlo.1.gombos@nokia.com>
7389
7390 Reviewed by Sam Weinig.
7391
7392 https://bugs.webkit.org/show_bug.cgi?id=25334
7393
7394 Fix Qt build when ENABLE_JIT is explicitly set to 1
7395 to overrule defaults.
7396
7397 * JavaScriptCore.pri:
7398
7399 2009-04-29 Oliver Hunt <oliver@apple.com>
7400
7401 Reviewed by Steve Falkenburg.
7402
7403 Crash in profiler due to incorrect assuming displayName would be a string.
7404
7405 Fixed by adding a type guard.
7406
7407 * runtime/InternalFunction.cpp:
7408 (JSC::InternalFunction::displayName):
7409
7410 2009-04-28 Geoffrey Garen <ggaren@apple.com>
7411
7412 Rubber stamped by Beth Dakin.
7413
7414 Removed scaffolding supporting dynamically converting between 32bit and
7415 64bit value representations.
7416
7417 * API/JSCallbackConstructor.cpp:
7418 (JSC::constructJSCallback):
7419 * API/JSCallbackFunction.cpp:
7420 (JSC::JSCallbackFunction::call):
7421 * API/JSCallbackObjectFunctions.h:
7422 (JSC::::construct):
7423 (JSC::::call):
7424 * bytecode/CodeBlock.cpp:
7425 (JSC::CodeBlock::dump):
7426 * bytecode/CodeBlock.h:
7427 (JSC::CodeBlock::getConstant):
7428 * bytecompiler/BytecodeGenerator.cpp:
7429 (JSC::BytecodeGenerator::emitEqualityOp):
7430 * interpreter/CallFrame.cpp:
7431 (JSC::CallFrame::thisValue):
7432 * interpreter/Interpreter.cpp:
7433 (JSC::Interpreter::callEval):
7434 (JSC::Interpreter::throwException):
7435 (JSC::Interpreter::createExceptionScope):
7436 (JSC::Interpreter::privateExecute):
7437 (JSC::Interpreter::retrieveArguments):
7438 * interpreter/Register.h:
7439 (JSC::Register::):
7440 (JSC::Register::Register):
7441 (JSC::Register::jsValue):
7442 (JSC::Register::marked):
7443 (JSC::Register::mark):
7444 (JSC::Register::i):
7445 (JSC::Register::activation):
7446 (JSC::Register::arguments):
7447 (JSC::Register::callFrame):
7448 (JSC::Register::codeBlock):
7449 (JSC::Register::function):
7450 (JSC::Register::propertyNameIterator):
7451 (JSC::Register::scopeChain):
7452 (JSC::Register::vPC):
7453 * jit/JITStubs.cpp:
7454 (JSC::JITStubs::cti_op_call_NotJSFunction):
7455 (JSC::JITStubs::cti_op_load_varargs):
7456 (JSC::JITStubs::cti_op_call_eval):
7457 * jsc.cpp:
7458 (functionPrint):
7459 (functionDebug):
7460 (functionRun):
7461 (functionLoad):
7462 * runtime/ArgList.h:
7463 (JSC::ArgList::at):
7464 * runtime/Arguments.cpp:
7465 (JSC::Arguments::copyToRegisters):
7466 (JSC::Arguments::fillArgList):
7467 (JSC::Arguments::getOwnPropertySlot):
7468 * runtime/ArrayConstructor.cpp:
7469 (JSC::constructArrayWithSizeQuirk):
7470 * runtime/ArrayPrototype.cpp:
7471 (JSC::arrayProtoFuncJoin):
7472 (JSC::arrayProtoFuncConcat):
7473 (JSC::arrayProtoFuncPush):
7474 (JSC::arrayProtoFuncSlice):
7475 (JSC::arrayProtoFuncSort):
7476 (JSC::arrayProtoFuncSplice):
7477 (JSC::arrayProtoFuncUnShift):
7478 (JSC::arrayProtoFuncFilter):
7479 (JSC::arrayProtoFuncMap):
7480 (JSC::arrayProtoFuncEvery):
7481 (JSC::arrayProtoFuncForEach):
7482 (JSC::arrayProtoFuncSome):
7483 (JSC::arrayProtoFuncReduce):
7484 (JSC::arrayProtoFuncReduceRight):
7485 (JSC::arrayProtoFuncIndexOf):
7486 (JSC::arrayProtoFuncLastIndexOf):
7487 * runtime/BooleanConstructor.cpp:
7488 (JSC::constructBoolean):
7489 (JSC::callBooleanConstructor):
7490 * runtime/DateConstructor.cpp:
7491 (JSC::constructDate):
7492 (JSC::dateParse):
7493 (JSC::dateUTC):
7494 * runtime/DatePrototype.cpp:
7495 (JSC::formatLocaleDate):
7496 (JSC::fillStructuresUsingTimeArgs):
7497 (JSC::fillStructuresUsingDateArgs):
7498 (JSC::dateProtoFuncSetTime):
7499 (JSC::dateProtoFuncSetYear):
7500 * runtime/ErrorConstructor.cpp:
7501 (JSC::constructError):
7502 * runtime/FunctionConstructor.cpp:
7503 (JSC::constructFunction):
7504 * runtime/FunctionPrototype.cpp:
7505 (JSC::functionProtoFuncApply):
7506 (JSC::functionProtoFuncCall):
7507 * runtime/JSArray.cpp:
7508 (JSC::JSArray::JSArray):
7509 (JSC::constructArray):
7510 * runtime/JSArray.h:
7511 * runtime/JSGlobalObjectFunctions.cpp:
7512 (JSC::encode):
7513 (JSC::decode):
7514 (JSC::globalFuncEval):
7515 (JSC::globalFuncParseInt):
7516 (JSC::globalFuncParseFloat):
7517 (JSC::globalFuncIsNaN):
7518 (JSC::globalFuncIsFinite):
7519 (JSC::globalFuncEscape):
7520 (JSC::globalFuncUnescape):
7521 (JSC::globalFuncJSCPrint):
7522 * runtime/MathObject.cpp:
7523 (JSC::mathProtoFuncAbs):
7524 (JSC::mathProtoFuncACos):
7525 (JSC::mathProtoFuncASin):
7526 (JSC::mathProtoFuncATan):
7527 (JSC::mathProtoFuncATan2):
7528 (JSC::mathProtoFuncCeil):
7529 (JSC::mathProtoFuncCos):
7530 (JSC::mathProtoFuncExp):
7531 (JSC::mathProtoFuncFloor):
7532 (JSC::mathProtoFuncLog):
7533 (JSC::mathProtoFuncMax):
7534 (JSC::mathProtoFuncMin):
7535 (JSC::mathProtoFuncPow):
7536 (JSC::mathProtoFuncRound):
7537 (JSC::mathProtoFuncSin):
7538 (JSC::mathProtoFuncSqrt):
7539 (JSC::mathProtoFuncTan):
7540 * runtime/NativeErrorConstructor.cpp:
7541 (JSC::NativeErrorConstructor::construct):
7542 * runtime/NumberConstructor.cpp:
7543 (JSC::constructWithNumberConstructor):
7544 (JSC::callNumberConstructor):
7545 * runtime/NumberPrototype.cpp:
7546 (JSC::numberProtoFuncToString):
7547 (JSC::numberProtoFuncToFixed):
7548 (JSC::numberProtoFuncToExponential):
7549 (JSC::numberProtoFuncToPrecision):
7550 * runtime/ObjectConstructor.cpp:
7551 (JSC::constructObject):
7552 * runtime/ObjectPrototype.cpp:
7553 (JSC::objectProtoFuncHasOwnProperty):
7554 (JSC::objectProtoFuncIsPrototypeOf):
7555 (JSC::objectProtoFuncDefineGetter):
7556 (JSC::objectProtoFuncDefineSetter):
7557 (JSC::objectProtoFuncLookupGetter):
7558 (JSC::objectProtoFuncLookupSetter):
7559 (JSC::objectProtoFuncPropertyIsEnumerable):
7560 * runtime/PropertySlot.h:
7561 (JSC::PropertySlot::getValue):
7562 * runtime/RegExpConstructor.cpp:
7563 (JSC::constructRegExp):
7564 * runtime/RegExpObject.cpp:
7565 (JSC::RegExpObject::match):
7566 * runtime/RegExpPrototype.cpp:
7567 (JSC::regExpProtoFuncCompile):
7568 * runtime/StringConstructor.cpp:
7569 (JSC::stringFromCharCodeSlowCase):
7570 (JSC::stringFromCharCode):
7571 (JSC::constructWithStringConstructor):
7572 (JSC::callStringConstructor):
7573 * runtime/StringPrototype.cpp:
7574 (JSC::stringProtoFuncReplace):
7575 (JSC::stringProtoFuncCharAt):
7576 (JSC::stringProtoFuncCharCodeAt):
7577 (JSC::stringProtoFuncConcat):
7578 (JSC::stringProtoFuncIndexOf):
7579 (JSC::stringProtoFuncLastIndexOf):
7580 (JSC::stringProtoFuncMatch):
7581 (JSC::stringProtoFuncSearch):
7582 (JSC::stringProtoFuncSlice):
7583 (JSC::stringProtoFuncSplit):
7584 (JSC::stringProtoFuncSubstr):
7585 (JSC::stringProtoFuncSubstring):
7586 (JSC::stringProtoFuncLocaleCompare):
7587 (JSC::stringProtoFuncFontcolor):
7588 (JSC::stringProtoFuncFontsize):
7589 (JSC::stringProtoFuncAnchor):
7590 (JSC::stringProtoFuncLink):
7591
7592 2009-04-28 David Kilzer <ddkilzer@apple.com>
7593
7594 A little more hardening for UString
7595
7596 Reviewed by Maciej Stachowiak.
7597
7598 Revised fix for <rdar://problem/5861045> in r42644.
7599
7600 * runtime/UString.cpp:
7601 (JSC::newCapacityWithOverflowCheck): Added.
7602 (JSC::concatenate): Used newCapacityWithOverflowCheck().
7603 (JSC::UString::append): Ditto.
7604
7605 2009-04-28 Oliver Hunt <oliver@apple.com>
7606
7607 Reviewed by Gavin Barraclough.
7608
7609 Bring back r42969, this time with correct codegen
7610
7611 Add logic to the codegen for right shift to avoid jumping to a helper function
7612 when shifting a small floating point value.
7613
7614 * jit/JITArithmetic.cpp:
7615 (isSSE2Present):
7616 (JSC::JIT::compileFastArith_op_rshift):
7617 (JSC::JIT::compileFastArithSlow_op_rshift):
7618
7619 2009-04-28 Kevin Ollivier <kevino@theolliviers.com>
7620
7621 wxMSW build fix. Switch JSCore build back to static.
7622
7623 * API/JSBase.h:
7624 * config.h:
7625 * jscore.bkl:
7626
7627 2009-04-28 Oliver Hunt <oliver@apple.com>
7628
7629 Reviewed by NOBODY (Build fix).
7630
7631 Roll out r42969, due to hangs in build bot.
7632
7633 * jit/JITArithmetic.cpp:
7634 (JSC::JIT::compileFastArith_op_rshift):
7635 (JSC::JIT::compileFastArithSlow_op_rshift):
7636 (JSC::isSSE2Present):
7637
7638 2009-04-28 Xan Lopez <xlopez@igalia.com>
7639
7640 Unreviewed: fix distcheck build, add (even more) missing files to list.
7641
7642 * GNUmakefile.am:
7643
7644 2009-04-28 Oliver Hunt <oliver@apple.com>
7645
7646 Reviewed by Geoff Garen.
7647
7648 Improve performance of string indexing
7649
7650 Add a cti_get_by_val_string function to specialise indexing into a string object.
7651 This gives us a slight performance win on a number of string tests.
7652
7653 * jit/JITStubs.cpp:
7654 (JSC::JITStubs::cti_op_get_by_val):
7655 (JSC::JITStubs::cti_op_get_by_val_string):
7656 * jit/JITStubs.h:
7657
7658 2009-04-28 Oliver Hunt <oliver@apple.com>
7659
7660 Reviewed by Geoff Garen.
7661
7662 Improve performance of right shifts of large or otherwise floating point values.
7663
7664 Add logic to the codegen for right shift to avoid jumping to a helper function
7665 when shifting a small floating point value.
7666
7667 * jit/JITArithmetic.cpp:
7668 (isSSE2Present): Moved to the head of file.
7669 (JSC::JIT::compileFastArith_op_rshift):
7670 (JSC::JIT::compileFastArithSlow_op_rshift):
7671
7672 2009-04-28 Xan Lopez <xlopez@igalia.com>
7673
7674 Unreviewed: fix distcheck build, add (more) missing files to list.
7675
7676 * GNUmakefile.am:
7677
7678 2009-04-28 Xan Lopez <xlopez@igalia.com>
7679
7680 Unreviewed: fix distcheck build, add missing header to file list.
7681
7682 * GNUmakefile.am:
7683
7684 2009-04-28 Gavin Barraclough <barraclough@apple.com>
7685
7686 Rubber stamped by Maciej "Henry Morgan" Stachowiak.
7687
7688 Enable YARR.
7689 (Again.)
7690
7691 * wtf/Platform.h:
7692
7693 2009-04-27 Gavin Barraclough <barraclough@apple.com>
7694
7695 Reviewed by Maciej Stachowiak.
7696
7697 Tweak a loop condition to keep GCC happy,
7698 some GCCs seem to be having issues with this. :-/
7699
7700 * bytecompiler/BytecodeGenerator.cpp:
7701 (JSC::BytecodeGenerator::breakTarget):
7702 * wtf/Platform.h:
7703
7704 2009-04-27 Adam Roben <aroben@apple.com>
7705
7706 Windows Debug build fix
7707
7708 Not sure why the buildbots weren't affected by this problem.
7709
7710 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Let VS
7711 re-order the file list, and added JavaScriptCore[_debug].def to the
7712 project. This was not necessary for the fix, but made making the fix
7713 easier.
7714
7715 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
7716 Removed a function that no longer exists.
7717
7718 2009-04-26 Gavin Barraclough <barraclough@apple.com>
7719
7720 Reviewed by Weinig Sam.
7721
7722 Fix for https://bugs.webkit.org/show_bug.cgi?id=25416
7723 "Cached prototype accesses unsafely hoist property storage load above structure checks."
7724
7725 Do not hoist the load of the pointer to the property storage array.
7726
7727 No performance impact.
7728
7729 * jit/JITPropertyAccess.cpp:
7730 (JSC::JIT::privateCompileGetByIdProto):
7731 (JSC::JIT::privateCompileGetByIdProtoList):
7732
7733 2009-04-26 Gavin Barraclough <barraclough@apple.com>
7734
7735 Reviewed by Geoffrey "Gaffe or energy?" Garen.
7736
7737 Randomize address requested by ExecutableAllocatorFixedVMPool.
7738
7739 * jit/ExecutableAllocatorFixedVMPool.cpp:
7740 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
7741
7742 2009-04-26 Sam Weinig <sam@webkit.org>
7743
7744 Reviewed by Eric Seidel.
7745
7746 Remove scons-based build system.
7747
7748 * JavaScriptCore.scons: Removed.
7749
7750 2009-04-25 Oliver Hunt <oliver@apple.com>
7751
7752 Reviewed by NOBODY (Buildfix).
7753
7754 Make HAVE_MADV_FREE darwin only for now
7755
7756 * wtf/Platform.h:
7757
7758 2009-04-25 Jan Michael Alonzo <jmalonzo@webkit.org>
7759
7760 Reviewed by Oliver Hunt.
7761
7762 Gtk build fix - check if we have MADV_FREE before using it.
7763
7764 * interpreter/RegisterFile.cpp:
7765 (JSC::RegisterFile::releaseExcessCapacity):
7766 * wtf/Platform.h:
7767
7768 2009-04-24 Kevin Ollivier <kevino@theolliviers.com>
7769
7770 wx build fix. Switching JSCore from a static lib to a dynamic lib
7771 to match the Apple build and fix symbol exports.
7772
7773 * jscore.bkl:
7774
7775 2009-04-24 Laszlo Gombos <laszlo.1.gombos@nokia.com>
7776
7777 Rubber-stamped by Mark Rowe.
7778
7779 https://bugs.webkit.org/show_bug.cgi?id=25337
7780 Move ThreadingQt.cpp under the qt directory.
7781
7782 * JavaScriptCore.pri:
7783 * wtf/ThreadingQt.cpp: Removed.
7784 * wtf/qt/ThreadingQt.cpp: Copied from JavaScriptCore/wtf/ThreadingQt.cpp.
7785
7786 2009-04-24 Laszlo Gombos <laszlo.1.gombos@nokia.com>
7787
7788 Rubber-stamped by Mark Rowe.
7789
7790 https://bugs.webkit.org/show_bug.cgi?id=25338
7791 Move ThreadingGtk.cpp under the gtk directory.
7792
7793 * GNUmakefile.am:
7794 * wtf/ThreadingGtk.cpp: Removed.
7795 * wtf/gtk/ThreadingGtk.cpp: Copied from JavaScriptCore/wtf/ThreadingGtk.cpp.
7796
7797 2009-04-24 Gavin Barraclough <barraclough@apple.com>
7798
7799 Reviewed by Sam "Wesley" Weinig.
7800
7801 Improve performance to YARR interpreter.
7802 (From about 3x slower than PCRE on regex-dna to about 30% slower).
7803
7804 * yarr/RegexCompiler.cpp:
7805 (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
7806 * yarr/RegexInterpreter.cpp:
7807 (JSC::Yarr::Interpreter::checkCharacter):
7808 (JSC::Yarr::Interpreter::checkCasedCharacter):
7809 (JSC::Yarr::Interpreter::backtrackPatternCharacter):
7810 (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
7811 (JSC::Yarr::Interpreter::matchParentheticalAssertionBegin):
7812 (JSC::Yarr::Interpreter::matchParentheticalAssertionEnd):
7813 (JSC::Yarr::Interpreter::backtrackParentheticalAssertionBegin):
7814 (JSC::Yarr::Interpreter::backtrackParentheticalAssertionEnd):
7815 (JSC::Yarr::Interpreter::matchDisjunction):
7816 (JSC::Yarr::Interpreter::interpret):
7817 (JSC::Yarr::ByteCompiler::atomPatternCharacter):
7818 (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
7819 (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
7820 (JSC::Yarr::ByteCompiler::closeAlternative):
7821 (JSC::Yarr::ByteCompiler::closeBodyAlternative):
7822 (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
7823 (JSC::Yarr::ByteCompiler::regexBegin):
7824 (JSC::Yarr::ByteCompiler::regexEnd):
7825 (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction):
7826 (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
7827 (JSC::Yarr::ByteCompiler::emitDisjunction):
7828 * yarr/RegexInterpreter.h:
7829 (JSC::Yarr::ByteTerm::):
7830 (JSC::Yarr::ByteTerm::ByteTerm):
7831 (JSC::Yarr::ByteTerm::BodyAlternativeBegin):
7832 (JSC::Yarr::ByteTerm::BodyAlternativeDisjunction):
7833 (JSC::Yarr::ByteTerm::BodyAlternativeEnd):
7834 (JSC::Yarr::ByteTerm::AlternativeBegin):
7835 (JSC::Yarr::ByteTerm::AlternativeDisjunction):
7836 (JSC::Yarr::ByteTerm::AlternativeEnd):
7837 (JSC::Yarr::ByteTerm::SubpatternBegin):
7838 (JSC::Yarr::ByteTerm::SubpatternEnd):
7839 * yarr/RegexJIT.cpp:
7840 (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
7841 * yarr/RegexPattern.h:
7842
7843 2009-04-24 Rob Raguet-Schofield <ragfield@gmail.com>
7844
7845 Rubber-stamped by Mark Rowe.
7846
7847 * wtf/CurrentTime.h: Fix a typo in a comment.
7848
7849 2009-04-24 Oliver Hunt <oliver@apple.com>
7850
7851 Reviewed by NOBODY (Build fix).
7852
7853 Add reinterpret_cast
7854
7855 * interpreter/RegisterFile.cpp:
7856 (JSC::RegisterFile::releaseExcessCapacity):
7857
7858 2009-04-23 Oliver Hunt <oliver@apple.com>
7859
7860 Reviewed by Geoff Garen.
7861
7862 <rdar://problem/6050421> JavaScript register file should remap to release physical pages accumulated during deep recursion
7863
7864 We now track the maximum extent of the RegisterFile, and when we reach the final
7865 return from JS (so the stack portion of the registerfile becomes empty) we see
7866 if that extent is greater than maxExcessCapacity. If it is we use madvise or
7867 VirtualFree to release the physical pages that were backing the excess.
7868
7869 * interpreter/RegisterFile.cpp:
7870 (JSC::RegisterFile::releaseExcessCapacity):
7871 * interpreter/RegisterFile.h:
7872 (JSC::RegisterFile::RegisterFile):
7873 (JSC::RegisterFile::shrink):
7874 (JSC::RegisterFile::grow):
7875
7876 2009-04-23 Mark Rowe <mrowe@apple.com>
7877
7878 With great sadness and a heavy heart I switch us back from YARR to WREC in
7879 order to restore greenness to the world once more.
7880
7881 * wtf/Platform.h:
7882
7883 2009-04-23 Mark Rowe <mrowe@apple.com>
7884
7885 More Windows build fixage.
7886
7887 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7888 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
7889
7890 2009-04-23 Mark Rowe <mrowe@apple.com>
7891
7892 Attempt to fix the Windows build.
7893
7894 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove a symbol that no longer exists.
7895
7896 2009-04-23 Francisco Tolmasky <francisco@280north.com>
7897
7898 BUG 24604: WebKit profiler reports incorrect total times
7899 <https://bugs.webkit.org/show_bug.cgi?id=24604>
7900
7901 Reviewed by Timothy Hatcher and Kevin McCullough.
7902
7903 * JavaScriptCore.exp:
7904 * JavaScriptCore.xcodeproj/project.pbxproj:
7905 * profiler/CallIdentifier.h:
7906 (JSC::CallIdentifier::Hash::hash):
7907 (JSC::CallIdentifier::Hash::equal):
7908 (JSC::CallIdentifier::hash):
7909 (WTF::):
7910 * profiler/HeavyProfile.cpp: Removed.
7911 * profiler/HeavyProfile.h: Removed.
7912 * profiler/Profile.cpp: No more need for TreeProfile/HeavyProfile
7913 (JSC::Profile::create):
7914 * profiler/Profile.h:
7915 * profiler/ProfileNode.cpp:
7916 * profiler/ProfileNode.h:
7917 * profiler/TreeProfile.cpp: Removed.
7918 * profiler/TreeProfile.h: Removed.
7919
7920 2009-04-23 Gavin Barraclough <barraclough@apple.com>
7921
7922 Not Reviewed.
7923
7924 Speculative Windows build fix II.
7925
7926 * yarr/RegexInterpreter.cpp:
7927
7928 2009-04-23 Gavin Barraclough <barraclough@apple.com>
7929
7930 Not Reviewed.
7931
7932 Speculative Windows build fix.
7933
7934 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7935 * runtime/RegExp.cpp:
7936
7937 2009-04-23 Gavin Barraclough <barraclough@apple.com>
7938
7939 Rubber stamped by salty sea dogs Sam & Geoff.
7940
7941 Enable YARR_JIT by default (where supported), replacing WREC.
7942
7943 * wtf/Platform.h:
7944
7945 2009-04-23 Gavin Barraclough <barraclough@apple.com>
7946
7947 Reviewed by Geoff "Dread Pirate Roberts" Garen.
7948
7949 Various small fixes to YARR JIT, in preparation for enabling it by default.
7950
7951 * Correctly index into the callframe when storing restart addresses for
7952 nested alternatives.
7953 * Allow backtracking back into matched alternatives of parentheses.
7954 * Fix callframe offset calculation for parenthetical assertions.
7955 * When a set of parenthese are quantified with a fixed and variable portion,
7956 and the variable portion is quantified once, this should not reset the
7957 pattern match on failure to match (the last match from the firxed portion
7958 should be preserved).
7959 * Up the pattern size limit to match PCRE's new limit.
7960 * Unlclosed parentheses should be reported with the message "missing )".
7961
7962 * wtf/Platform.h:
7963 * yarr/RegexCompiler.cpp:
7964 (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
7965 (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
7966 * yarr/RegexInterpreter.cpp:
7967 (JSC::Yarr::Interpreter::matchParentheses):
7968 (JSC::Yarr::Interpreter::backtrackParentheses):
7969 (JSC::Yarr::ByteCompiler::emitDisjunction):
7970 * yarr/RegexJIT.cpp:
7971 (JSC::Yarr::RegexGenerator::loadFromFrameAndJump):
7972 (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction):
7973 (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
7974 (JSC::Yarr::RegexGenerator::generateTerm):
7975 (JSC::Yarr::executeRegex):
7976 * yarr/RegexParser.h:
7977 (JSC::Yarr::Parser::):
7978 (JSC::Yarr::Parser::parseTokens):
7979 (JSC::Yarr::Parser::parse):
7980 * yarr/RegexPattern.h:
7981 (JSC::Yarr::PatternTerm::):
7982 (JSC::Yarr::PatternTerm::PatternTerm):
7983
7984 2009-04-22 Mark Rowe <mrowe@apple.com>
7985
7986 Rubber-stamped by Gavin Barraclough.
7987
7988 Add the m_ prefix on FixedVMPoolAllocator's member variables, and fix typos in a few comments.
7989
7990 * jit/ExecutableAllocatorFixedVMPool.cpp:
7991 (JSC::FixedVMPoolAllocator::addToFreeList):
7992 (JSC::FixedVMPoolAllocator::coalesceFreeSpace):
7993 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
7994 (JSC::FixedVMPoolAllocator::alloc):
7995 (JSC::FixedVMPoolAllocator::free):
7996 (JSC::FixedVMPoolAllocator::isWithinVMPool):
7997
7998 2009-04-22 Mark Rowe <mrowe@apple.com>
7999
8000 Rubber-stamped by Gavin Barraclough.
8001
8002 Add some assertions to FixedVMPoolAllocator to guard against cases where we
8003 attempt to free memory that didn't originate from the pool, or we attempt to
8004 hand out a bogus address from alloc.
8005
8006 * jit/ExecutableAllocatorFixedVMPool.cpp:
8007 (JSC::FixedVMPoolAllocator::release):
8008 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8009 (JSC::FixedVMPoolAllocator::alloc):
8010 (JSC::FixedVMPoolAllocator::free):
8011 (JSC::FixedVMPoolAllocator::isWithinVMPool):
8012
8013 2009-04-22 Gavin Barraclough <barraclough@apple.com>
8014
8015 Rubber stamped by Sam "Blackbeard" Weinig.
8016
8017 Although pirates do spell the word 'generate' as 'genertate',
8018 webkit developers do not. Fixertate.
8019
8020 * yarr/RegexJIT.cpp:
8021 (JSC::Yarr::RegexGenerator::generateAssertionBOL):
8022 (JSC::Yarr::RegexGenerator::generateAssertionEOL):
8023 (JSC::Yarr::RegexGenerator::generateAssertionWordBoundary):
8024 (JSC::Yarr::RegexGenerator::generatePatternCharacterSingle):
8025 (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
8026 (JSC::Yarr::RegexGenerator::generatePatternCharacterFixed):
8027 (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
8028 (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
8029 (JSC::Yarr::RegexGenerator::generateCharacterClassSingle):
8030 (JSC::Yarr::RegexGenerator::generateCharacterClassFixed):
8031 (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
8032 (JSC::Yarr::RegexGenerator::generateCharacterClassNonGreedy):
8033 (JSC::Yarr::RegexGenerator::generateTerm):
8034
8035 2009-04-22 Gavin Barraclough <barraclough@apple.com>
8036
8037 Reviewed by Sam "Blackbeard" Weinig.
8038
8039 Improvements to YARR JIT. This patch expands support in three key areas:
8040 * Add (temporary) support for falling back to PCRE for expressions not supported.
8041 * Add support for x86_64 and Windows.
8042 * Add support for singly quantified parentheses (? and ??), alternatives within
8043 parentheses, and parenthetical assertions.
8044
8045 * runtime/RegExp.cpp:
8046 (JSC::RegExp::match):
8047 * yarr/RegexJIT.cpp:
8048 (JSC::Yarr::RegexGenerator::storeToFrame):
8049 (JSC::Yarr::RegexGenerator::storeToFrameWithPatch):
8050 (JSC::Yarr::RegexGenerator::loadFromFrameAndJump):
8051 (JSC::Yarr::RegexGenerator::AlternativeBacktrackRecord::AlternativeBacktrackRecord):
8052 (JSC::Yarr::RegexGenerator::TermGenerationState::resetAlternative):
8053 (JSC::Yarr::RegexGenerator::TermGenerationState::resetTerm):
8054 (JSC::Yarr::RegexGenerator::TermGenerationState::jumpToBacktrack):
8055 (JSC::Yarr::RegexGenerator::TermGenerationState::plantJumpToBacktrackIfExists):
8056 (JSC::Yarr::RegexGenerator::TermGenerationState::addBacktrackJump):
8057 (JSC::Yarr::RegexGenerator::TermGenerationState::linkAlternativeBacktracks):
8058 (JSC::Yarr::RegexGenerator::TermGenerationState::propagateBacktrackingFrom):
8059 (JSC::Yarr::RegexGenerator::genertateAssertionBOL):
8060 (JSC::Yarr::RegexGenerator::genertateAssertionEOL):
8061 (JSC::Yarr::RegexGenerator::matchAssertionWordchar):
8062 (JSC::Yarr::RegexGenerator::genertateAssertionWordBoundary):
8063 (JSC::Yarr::RegexGenerator::genertatePatternCharacterSingle):
8064 (JSC::Yarr::RegexGenerator::genertatePatternCharacterPair):
8065 (JSC::Yarr::RegexGenerator::genertatePatternCharacterFixed):
8066 (JSC::Yarr::RegexGenerator::genertatePatternCharacterGreedy):
8067 (JSC::Yarr::RegexGenerator::genertatePatternCharacterNonGreedy):
8068 (JSC::Yarr::RegexGenerator::genertateCharacterClassSingle):
8069 (JSC::Yarr::RegexGenerator::genertateCharacterClassFixed):
8070 (JSC::Yarr::RegexGenerator::genertateCharacterClassGreedy):
8071 (JSC::Yarr::RegexGenerator::genertateCharacterClassNonGreedy):
8072 (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction):
8073 (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
8074 (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
8075 (JSC::Yarr::RegexGenerator::generateTerm):
8076 (JSC::Yarr::RegexGenerator::generateDisjunction):
8077 (JSC::Yarr::RegexGenerator::generateEnter):
8078 (JSC::Yarr::RegexGenerator::generateReturn):
8079 (JSC::Yarr::RegexGenerator::RegexGenerator):
8080 (JSC::Yarr::RegexGenerator::generate):
8081 (JSC::Yarr::RegexGenerator::compile):
8082 (JSC::Yarr::RegexGenerator::generationFailed):
8083 (JSC::Yarr::jitCompileRegex):
8084 (JSC::Yarr::executeRegex):
8085 * yarr/RegexJIT.h:
8086 (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
8087 (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
8088
8089 2009-04-22 Sam Weinig <sam@webkit.org>
8090
8091 Rubber-stamped by Darin Adler.
8092
8093 Fix for <rdar://problem/6816957>
8094 Turn off Geolocation by default
8095
8096 * Configurations/FeatureDefines.xcconfig:
8097
8098 2009-04-22 Oliver Hunt <oliver@apple.com>
8099
8100 Reviewed by NOBODY (Buildfix).
8101
8102 * interpreter/CachedCall.h:
8103
8104 2009-04-21 Oliver Hunt <oliver@apple.com>
8105
8106 Reviewed by NOBODY (Build fix).
8107
8108 * runtime/StringPrototype.cpp:
8109
8110 2009-04-21 Oliver Hunt <oliver@apple.com>
8111
8112 Reviewed by Maciej Stachowiak.
8113
8114 Improve String.replace performance slightly
8115
8116 Apply our vm reentry caching logic to String.replace with global
8117 regexes.
8118
8119 * runtime/StringPrototype.cpp:
8120 (JSC::stringProtoFuncReplace):
8121
8122 2009-04-21 Geoffrey Garen <ggaren@apple.com>
8123
8124 Reviewed by Cameron Zwarich and Oliver Hunt.
8125
8126 Re-Fixed <rdar://problem/6406045> REGRESSION: Stack overflow on PowerPC on
8127 fast/workers/use-machine-stack.html (22531)
8128
8129 SunSpider reports no change.
8130
8131 Use a larger recursion limit on the main thread (because we can, and
8132 there's some evidence that it may improve compatibility), and a smaller
8133 recursion limit on secondary threads (because they tend to have smaller
8134 stacks).
8135
8136 * interpreter/Interpreter.cpp:
8137 (JSC::Interpreter::execute):
8138 (JSC::Interpreter::prepareForRepeatCall):
8139 * interpreter/Interpreter.h:
8140 (JSC::): Ditto. I wrote the recursion test slightly funny, so that the
8141 common case remains a simple compare to constant.
8142
8143 * runtime/ArrayPrototype.cpp:
8144 (JSC::arrayProtoFuncToString):
8145 (JSC::arrayProtoFuncToLocaleString):
8146 (JSC::arrayProtoFuncJoin): Conservatively, set the array recursion limits
8147 to the lower, secondary thread limit. We can do something fancier if
8148 compatibility moves us, but this seems sufficient for now.
8149
8150 2009-04-21 Geoffrey Garen <ggaren@apple.com>
8151
8152 Rubber-stamped by Adam Roben.
8153
8154 Disabled one more Mozilla JS test because it fails intermittently on Windows.
8155 (See https://bugs.webkit.org/show_bug.cgi?id=25160.)
8156
8157 * tests/mozilla/expected.html:
8158
8159 2009-04-21 Adam Roben <aroben@apple.com>
8160
8161 Rename JavaScriptCore_debug.dll to JavaScriptCore.dll in the Debug
8162 configuration
8163
8164 This matches the naming scheme for WebKit.dll, and will be necessary
8165 once Safari links against JavaScriptCore.dll. This change also causes
8166 run-safari not to fail (because the launcher printed by FindSafari was
8167 always looking for JavaScriptCore.dll, never
8168 JavaScriptCore_debug.dll).
8169
8170 Part of Bug 25305: can't run safari or drt on windows
8171 <https://bugs.webkit.org/show_bug.cgi?id=25305>
8172
8173 Reviewed by Steve Falkenburg and Sam Weinig.
8174
8175 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8176 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
8177 * JavaScriptCore.vcproj/testapi/testapi.vcproj:
8178 Use $(WebKitDLLConfigSuffix) for naming JavaScriptCore.{dll,lib}.
8179
8180 2009-04-21 Adam Roben <aroben@apple.com>
8181
8182 Fix JavaScriptCore build on VC++ Express
8183
8184 Reviewed by Steve Falkenburg and Sam Weinig.
8185
8186 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Link
8187 explicitly against gdi32.lib and oleaut32.lib.
8188
8189 2009-04-21 Geoffrey Garen <ggaren@apple.com>
8190
8191 Reviewed by Mark Rowe.
8192
8193 Tiger crash fix: Put VM tags in their own header file, and fixed up the
8194 #ifdefs so they're not used on Tiger.
8195
8196 * JavaScriptCore.xcodeproj/project.pbxproj:
8197 * interpreter/RegisterFile.h:
8198 (JSC::RegisterFile::RegisterFile):
8199 * jit/ExecutableAllocatorFixedVMPool.cpp:
8200 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8201 * jit/ExecutableAllocatorPosix.cpp:
8202 (JSC::ExecutablePool::systemAlloc):
8203 * runtime/Collector.cpp:
8204 (JSC::allocateBlock):
8205 * wtf/VMTags.h: Added.
8206
8207 2009-04-20 Steve Falkenburg <sfalken@apple.com>
8208
8209 More Windows build fixes.
8210
8211 * JavaScriptCore.vcproj/JavaScriptCore.make: Copy DLLs, PDBs.
8212 * JavaScriptCore.vcproj/JavaScriptCore.resources: Added.
8213 * JavaScriptCore.vcproj/JavaScriptCore.resources/Info.plist: Added.
8214 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Added.
8215 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add version stamping, resource copying.
8216
8217 2009-04-20 Steve Falkenburg <sfalken@apple.com>
8218
8219 Separate JavaScriptCore.dll from WebKit.dll.
8220 Slight performance improvement or no change on benchmarks.
8221
8222 Allows us to break a circular dependency between CFNetwork and WebKit on Windows,
8223 and simplifies standalone JavaScriptCore builds.
8224
8225 Reviewed by Oliver Hunt.
8226
8227 * API/JSBase.h: Export symbols with JS_EXPORT when using MSVC.
8228 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8229 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Build JavaScriptCore as a DLL instead of a static library.
8230 * config.h: Specify __declspec(dllexport/dllimport) appropriately when exporting data.
8231 * runtime/InternalFunction.h: Specify JS_EXPORTDATA on exported data.
8232 * runtime/JSArray.h: Specify JS_EXPORTDATA on exported data.
8233 * runtime/JSFunction.h: Specify JS_EXPORTDATA on exported data.
8234 * runtime/StringObject.h: Specify JS_EXPORTDATA on exported data.
8235 * runtime/UString.h: Specify JS_EXPORTDATA on exported data.
8236
8237 2009-04-20 Sam Weinig <sam@webkit.org>
8238
8239 Reviewed by Kevin McCullough.
8240
8241 Always tag mmaped memory on darwin and clean up #defines
8242 now that they are a little bigger.
8243
8244 * interpreter/RegisterFile.h:
8245 (JSC::RegisterFile::RegisterFile):
8246 * jit/ExecutableAllocatorFixedVMPool.cpp:
8247 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8248 * jit/ExecutableAllocatorPosix.cpp:
8249 (JSC::ExecutablePool::systemAlloc):
8250 * runtime/Collector.cpp:
8251 (JSC::allocateBlock):
8252
8253 2009-04-20 Sam Weinig <sam@webkit.org>
8254
8255 Rubber-stamped by Tim Hatcher.
8256
8257 Add licenses for xcconfig files.
8258
8259 * Configurations/Base.xcconfig:
8260 * Configurations/DebugRelease.xcconfig:
8261 * Configurations/FeatureDefines.xcconfig:
8262 * Configurations/JavaScriptCore.xcconfig:
8263 * Configurations/Version.xcconfig:
8264
8265 2009-04-20 Ariya Hidayat <ariya.hidayat@nokia.com>
8266
8267 Build fix for Qt port (after r42646). Not reviewed.
8268
8269 * wtf/unicode/qt4/UnicodeQt4.h: Added U16_PREV.
8270
8271 2009-04-19 Sam Weinig <sam@webkit.org>
8272
8273 Reviewed by Darin Adler.
8274
8275 Better fix for JSStringCreateWithCFString hardening.
8276
8277 * API/JSStringRefCF.cpp:
8278 (JSStringCreateWithCFString):
8279
8280 2009-04-19 Sam Weinig <sam@webkit.org>
8281
8282 Reviewed by Dan Bernstein.
8283
8284 Fix for <rdar://problem/5860954>
8285 Harden JSStringCreateWithCFString against malformed CFStringRefs.
8286
8287 * API/JSStringRefCF.cpp:
8288 (JSStringCreateWithCFString):
8289
8290 2009-04-19 David Kilzer <ddkilzer@apple.com>
8291
8292 Make FEATURE_DEFINES completely dynamic
8293
8294 Reviewed by Darin Adler.
8295
8296 Make FEATURE_DEFINES depend on individual ENABLE_FEATURE_NAME
8297 variables for each feature, making it possible to remove all
8298 knowledge of FEATURE_DEFINES from build-webkit.
8299
8300 * Configurations/FeatureDefines.xcconfig: Extract a variable
8301 from FEATURE_DEFINES for each feature setting.
8302
8303 2009-04-18 Sam Weinig <sam@webkit.org>
8304
8305 Reviewed by Dan Bernstein.
8306
8307 Fix typo. s/VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE/VM_MEMORY_JAVASCRIPT_CORE/
8308
8309 * runtime/Collector.cpp:
8310 (JSC::allocateBlock): Fix bozo typo.
8311
8312 2009-04-18 Sam Weinig <sam@webkit.org>
8313
8314 Reviewed by Anders Carlsson.
8315
8316 Fix for <rdar://problem/6801555> Tag JavaScript memory on SnowLeopard
8317
8318 * interpreter/RegisterFile.h:
8319 (JSC::RegisterFile::RegisterFile):
8320 * jit/ExecutableAllocatorFixedVMPool.cpp:
8321 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8322 * jit/ExecutableAllocatorPosix.cpp:
8323 (JSC::ExecutablePool::systemAlloc):
8324 * runtime/Collector.cpp:
8325 (JSC::allocateBlock):
8326
8327 2009-04-18 Drew Wilson <amw@apple.com>
8328
8329 <rdar://problem/6781407> VisiblePosition.characterAfter should return UChar32
8330
8331 Reviewed by Dan Bernstein.
8332
8333 * wtf/unicode/icu/UnicodeIcu.h:
8334 (WTF::Unicode::hasLineBreakingPropertyComplexContextOrIdeographic): Added.
8335
8336 2009-04-18 Sam Weinig <sam@webkit.org>
8337
8338 Reviewed by Mark Rowe.
8339
8340 Fix for <rdar://problem/5861045>
8341 A little bit of hardening for UString.
8342
8343 * runtime/UString.cpp:
8344 (JSC::concatenate):
8345 (JSC::UString::append):
8346
8347 2009-04-18 Sam Weinig <sam@webkit.org>
8348
8349 Reviewed by Mark Rowe and Dan Bernstein.
8350
8351 Fix for <rdar://problem/5861188>
8352 A little bit of hardening for Vector.
8353
8354 * wtf/Vector.h:
8355 (WTF::Vector<T, inlineCapacity>::append):
8356 (WTF::Vector<T, inlineCapacity>::insert):
8357
8358 2009-04-17 Gavin Barraclough <barraclough@apple.com>
8359
8360 Reviewed by Geoff Garen.
8361
8362 On x86_64, make all JIT-code allocations from a new heap, managed
8363 by FixedVMPoolAllocator. This class allocates a single large (2Gb)
8364 pool of virtual memory from which all further allocations take place.
8365 Since all JIT code is allocated from this pool, we can continue to
8366 safely assume (as is already asserted) that it will always be possible
8367 to link any JIT-code to JIT-code jumps and calls.
8368
8369 * JavaScriptCore.xcodeproj/project.pbxproj:
8370 Add new file.
8371 * jit/ExecutableAllocatorFixedVMPool.cpp: Added.
8372 (JSC::FreeListEntry::FreeListEntry):
8373 (JSC::AVLTreeAbstractorForFreeList::get_less):
8374 (JSC::AVLTreeAbstractorForFreeList::set_less):
8375 (JSC::AVLTreeAbstractorForFreeList::get_greater):
8376 (JSC::AVLTreeAbstractorForFreeList::set_greater):
8377 (JSC::AVLTreeAbstractorForFreeList::get_balance_factor):
8378 (JSC::AVLTreeAbstractorForFreeList::set_balance_factor):
8379 (JSC::AVLTreeAbstractorForFreeList::null):
8380 (JSC::AVLTreeAbstractorForFreeList::compare_key_key):
8381 (JSC::AVLTreeAbstractorForFreeList::compare_key_node):
8382 (JSC::AVLTreeAbstractorForFreeList::compare_node_node):
8383 (JSC::sortFreeListEntriesByPointer):
8384 (JSC::sortCommonSizedAllocations):
8385 (JSC::FixedVMPoolAllocator::release):
8386 (JSC::FixedVMPoolAllocator::reuse):
8387 (JSC::FixedVMPoolAllocator::addToFreeList):
8388 (JSC::FixedVMPoolAllocator::coalesceFreeSpace):
8389 (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
8390 (JSC::FixedVMPoolAllocator::alloc):
8391 (JSC::FixedVMPoolAllocator::free):
8392 (JSC::ExecutableAllocator::intializePageSize):
8393 (JSC::ExecutablePool::systemAlloc):
8394 (JSC::ExecutablePool::systemRelease):
8395 The new 2Gb heap class!
8396 * jit/ExecutableAllocatorPosix.cpp:
8397 Disable use of this implementation on x86_64.
8398 * wtf/AVLTree.h:
8399 Add missing variable initialization.
8400 (WTF::::remove):
8401
8402 2009-04-17 Oliver Hunt <oliver@apple.com>
8403
8404 Reviewed by Darin Adler.
8405
8406 Fix bug where the VM reentry cache would not correctly unroll the cached callframe
8407
8408 Fix a check that was intended to mark a cached call as invalid when the callframe could
8409 not be constructed. Instead it was just checking that there was a place to put the
8410 exception. This eventually results in a non-recoverable RegisterFile starvation.
8411
8412 * interpreter/CachedCall.h:
8413 (JSC::CachedCall::CachedCall):
8414 (JSC::CachedCall::call): add assertion to ensure we don't use a bad callframe
8415
8416 2009-04-17 David Kilzer <ddkilzer@apple.com>
8417
8418 Simplify FEATURE_DEFINES definition
8419
8420 Reviewed by Darin Adler.
8421
8422 This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
8423 variables to their own FeatureDefines.xcconfig file. It also
8424 extracts a new ENABLE_GEOLOCATION variable so that
8425 FEATURE_DEFINES only needs to be defined once.
8426
8427 * Configurations/FeatureDefines.xcconfig: Added.
8428 * Configurations/JavaScriptCore.xcconfig: Removed definition of
8429 ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES. Added include
8430 of FeatureDefines.xcconfig.
8431 * JavaScriptCore.xcodeproj/project.pbxproj: Added
8432 FeatureDefines.xcconfig file.
8433
8434 2009-04-08 Mihnea Ovidenie <mihnea@adobe.com>
8435
8436 Reviewed by Oliver Hunt.
8437
8438 Bug 25027: JavaScript parseInt wrong on negative numbers
8439 <https://bugs.webkit.org/show_bug.cgi?id=25027>
8440
8441 When dealing with negative numbers, parseInt should use ceil instead of floor.
8442
8443 * runtime/JSGlobalObjectFunctions.cpp:
8444 (JSC::globalFuncParseInt):
8445
8446 2009-04-16 Stephanie Lewis <slewis@apple.com>
8447
8448 Reviewed by Oliver Hunt.
8449
8450 <rdar://problem/6744652> 32-bit to 64-bit: Javascript hash tables double in size
8451
8452 Remove perfect hash optimization which removes 1 MB of overhead on 32-bit and almost 2 MB on 64-bit. Removing the optimization was not a regression on SunSpider and the acid 3 test still passes.
8453
8454 * create_hash_table:
8455 * runtime/Lookup.cpp:
8456 (JSC::HashTable::createTable):
8457 (JSC::HashTable::deleteTable):
8458 * runtime/Lookup.h:
8459 (JSC::HashEntry::initialize):
8460 (JSC::HashEntry::next):
8461 (JSC::HashTable::entry):
8462 * runtime/Structure.cpp:
8463 (JSC::Structure::getEnumerableNamesFromClassInfoTable):
8464
8465 2009-04-16 Oliver Hunt <oliver@apple.com>
8466
8467 Reviewed by Gavin Barraclough.
8468
8469 Fix subtle error in optimised VM reentry in Array.sort
8470
8471 Basically to ensure we don't accidentally invalidate the cached callframe
8472 we should be using the cached callframe rather than our own exec state.
8473 While the old behaviour was wrong i have been unable to actually create a
8474 test case where anything actually ends up going wrong.
8475
8476 * interpreter/CachedCall.h:
8477 (JSC::CachedCall::newCallFrame):
8478 * runtime/JSArray.cpp:
8479 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
8480
8481 2009-04-16 Oliver Hunt <oliver@apple.com>
8482
8483 Reviewed by Gavin Barraclough.
8484
8485 Optimise op_resolve_base
8486
8487 If we can statically find a property we are trying to resolve
8488 the base of, the base is guaranteed to be the global object.
8489
8490 * bytecompiler/BytecodeGenerator.cpp:
8491 (JSC::BytecodeGenerator::emitResolveBase):
8492
8493 2009-04-16 Oliver Hunt <oliver@apple.com>
8494
8495 Reviewed by Gavin Barraclough.
8496
8497 Improve performance of read-write-modify operators
8498
8499 Implement cross scope optimisation for read-write-modify
8500 operators, to avoid unnecessary calls to property resolve
8501 helper functions.
8502
8503 * bytecompiler/BytecodeGenerator.cpp:
8504 (JSC::BytecodeGenerator::BytecodeGenerator):
8505 (JSC::BytecodeGenerator::emitLoadGlobalObject):
8506 (JSC::BytecodeGenerator::emitResolveWithBase):
8507 * bytecompiler/BytecodeGenerator.h:
8508
8509 2009-04-16 Oliver Hunt <oliver@apple.com>
8510
8511 Reviewed by Gavin Barraclough.
8512
8513 Improve performance of remaining array enumeration functions
8514
8515 Make use of function entry cache for remaining Array enumeration functions.
8516
8517 * runtime/ArrayPrototype.cpp:
8518 (JSC::arrayProtoFuncMap):
8519 (JSC::arrayProtoFuncEvery):
8520 (JSC::arrayProtoFuncForEach):
8521 (JSC::arrayProtoFuncSome):
8522
8523 2009-04-15 Oliver Hunt <oliver@apple.com>
8524
8525 Reviewed by Gavin Barraclough.
8526
8527 Improve performance of Array.sort
8528
8529 Cache the VM entry for Array.sort when using a JS comparison function.
8530
8531 * runtime/JSArray.cpp:
8532 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
8533 (JSC::JSArray::sort):
8534
8535 2009-04-15 Oliver Hunt <oliver@apple.com>
8536
8537 Reviewed by Gavin Barraclough.
8538
8539 Bug 25229: Need support for Array.prototype.reduceRight
8540 <https://bugs.webkit.org/show_bug.cgi?id=25229>
8541
8542 Implement Array.reduceRight
8543
8544 * runtime/ArrayPrototype.cpp:
8545 (JSC::arrayProtoFuncReduceRight):
8546
8547 2009-04-15 Oliver Hunt <oliver@apple.com>
8548
8549 Reviewed by Gavin Barraclough.
8550
8551 Bug 25227: Array.filter triggers an assertion when the target array shrinks while being filtered
8552 <https://bugs.webkit.org/show_bug.cgi?id=25227>
8553
8554 We correct this simply by making the fast array path fall back on the slow path if
8555 we ever discover the fast access is unsafe.
8556
8557 * runtime/ArrayPrototype.cpp:
8558 (JSC::arrayProtoFuncFilter):
8559
8560 2009-04-13 Oliver Hunt <oliver@apple.com>
8561
8562 Reviewed by Gavin Barraclough.
8563
8564 Bug 25159: Support Array.prototype.reduce
8565 <https://bugs.webkit.org/show_bug.cgi?id=25159>
8566
8567 Implement Array.prototype.reduce
8568
8569 * runtime/ArrayPrototype.cpp:
8570 (JSC::arrayProtoFuncReduce):
8571
8572 2009-04-15 Oliver Hunt <oliver@apple.com>
8573
8574 Reviewed by NOBODY (Build fix).
8575
8576 Move CallFrameClosure from inside the Interpreter class to its own file.
8577
8578 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8579 * JavaScriptCore.xcodeproj/project.pbxproj:
8580 * interpreter/CachedCall.h:
8581 * interpreter/CallFrameClosure.h: Copied from JavaScriptCore/yarr/RegexJIT.h.
8582 (JSC::CallFrameClosure::setArgument):
8583 (JSC::CallFrameClosure::resetCallFrame):
8584 * interpreter/Interpreter.cpp:
8585 (JSC::Interpreter::prepareForRepeatCall):
8586 * interpreter/Interpreter.h:
8587
8588 2009-04-14 Oliver Hunt <oliver@apple.com>
8589
8590 Reviewed by Cameron Zwarich.
8591
8592 Bug 25202: Improve performance of repeated callbacks into the VM
8593
8594 Add the concept of a CachedCall to native code for use in Array
8595 prototype and similar functions where a single callback function
8596 is called repeatedly with the same number of arguments.
8597
8598 Used Array.prototype.filter as the test function and got a 50% win
8599 over a naive non-caching specialised version. This makes the native
8600 implementation of Array.prototype.filter faster than the JS one once
8601 more.
8602
8603 * JavaScriptCore.vcproj/JavaScriptCore.sln:
8604 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8605 * JavaScriptCore.xcodeproj/project.pbxproj:
8606 * interpreter/CachedCall.h: Added.
8607 (JSC::CachedCall::CachedCall):
8608 (JSC::CachedCall::call):
8609 (JSC::CachedCall::setThis):
8610 (JSC::CachedCall::setArgument):
8611 (JSC::CachedCall::~CachedCall):
8612 CachedCall is a wrapper that automates the calling and teardown
8613 for a CallFrameClosure
8614 * interpreter/CallFrame.h:
8615 * interpreter/Interpreter.cpp:
8616 (JSC::Interpreter::prepareForRepeatCall):
8617 Create the basic entry closure for a function
8618 (JSC::Interpreter::execute):
8619 A new ::execute method to enter the interpreter from a closure
8620 (JSC::Interpreter::endRepeatCall):
8621 Clear the entry closure
8622 * interpreter/Interpreter.h:
8623 (JSC::Interpreter::CallFrameClosure::setArgument):
8624 (JSC::Interpreter::CallFrameClosure::resetCallFrame):
8625 Helper functions to simplify setting up the closure's callframe
8626 * runtime/ArrayPrototype.cpp:
8627 (JSC::arrayProtoFuncFilter):
8628
8629 2009-04-14 Xan Lopez <xlopez@igalia.com>
8630
8631 Fix the build.
8632
8633 Add the yarr headers (and only the headers) to the build, so that
8634 RegExp.cpp can compile. The headers are ifdefed out with yarr
8635 disabled, so we don't need anything else for now.
8636
8637 * GNUmakefile.am:
8638
8639 2009-04-14 Adam Roben <aroben@apple.com>
8640
8641 Remove support for profile-guided optimization on Windows
8642
8643 Rubber-stamped by Steve Falkenburg.
8644
8645 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed
8646 the Release_PGO configuration. Also let VS re-order the source files
8647 list.
8648
8649 2009-04-14 Xan Lopez <xlopez@igalia.com>
8650
8651 Unreviewed build fix.
8652
8653 * GNUmakefile.am:
8654
8655 2009-04-14 Jan Michael Alonzo <jmalonzo@webkit.org>
8656
8657 Gtk build fix when building minidom. Not reviewed.
8658
8659 Use C-style comment instead of C++ style since autotools builds
8660 minidom using gcc and not g++.
8661
8662 * wtf/Platform.h:
8663
8664 2009-04-14 Gavin Barraclough <barraclough@apple.com>
8665
8666 Reviewed by NOBODY - speculative build fix.
8667
8668 * runtime/RegExp.h:
8669
8670 2009-04-13 Gavin Barraclough <barraclough@apple.com>
8671
8672 Reviewed by Cap'n Geoff Garen.
8673
8674 Yarr!
8675 (Yet another regex runtime).
8676
8677 Currently disabled by default since the interpreter, whilst awesomely
8678 functional, has not been optimized and is likely slower than PCRE, and
8679 the JIT, whilst faster than WREC, is presently incomplete and does not
8680 fallback to using an interpreter for the cases it cannot handle.
8681
8682 * JavaScriptCore.xcodeproj/project.pbxproj:
8683 * assembler/MacroAssemblerX86Common.h:
8684 (JSC::MacroAssemblerX86Common::move):
8685 (JSC::MacroAssemblerX86Common::swap):
8686 (JSC::MacroAssemblerX86Common::signExtend32ToPtr):
8687 (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr):
8688 (JSC::MacroAssemblerX86Common::branch32):
8689 (JSC::MacroAssemblerX86Common::branch16):
8690 * assembler/X86Assembler.h:
8691 (JSC::X86Assembler::cmpw_im):
8692 (JSC::X86Assembler::testw_rr):
8693 (JSC::X86Assembler::X86InstructionFormatter::immediate16):
8694 * runtime/RegExp.cpp:
8695 (JSC::RegExp::RegExp):
8696 (JSC::RegExp::~RegExp):
8697 (JSC::RegExp::create):
8698 (JSC::RegExp::compile):
8699 (JSC::RegExp::match):
8700 * runtime/RegExp.h:
8701 * wtf/Platform.h:
8702 * yarr: Added.
8703 * yarr/RegexCompiler.cpp: Added.
8704 (JSC::Yarr::CharacterClassConstructor::CharacterClassConstructor):
8705 (JSC::Yarr::CharacterClassConstructor::reset):
8706 (JSC::Yarr::CharacterClassConstructor::append):
8707 (JSC::Yarr::CharacterClassConstructor::putChar):
8708 (JSC::Yarr::CharacterClassConstructor::isUnicodeUpper):
8709 (JSC::Yarr::CharacterClassConstructor::isUnicodeLower):
8710 (JSC::Yarr::CharacterClassConstructor::putRange):
8711 (JSC::Yarr::CharacterClassConstructor::charClass):
8712 (JSC::Yarr::CharacterClassConstructor::addSorted):
8713 (JSC::Yarr::CharacterClassConstructor::addSortedRange):
8714 (JSC::Yarr::newlineCreate):
8715 (JSC::Yarr::digitsCreate):
8716 (JSC::Yarr::spacesCreate):
8717 (JSC::Yarr::wordcharCreate):
8718 (JSC::Yarr::nondigitsCreate):
8719 (JSC::Yarr::nonspacesCreate):
8720 (JSC::Yarr::nonwordcharCreate):
8721 (JSC::Yarr::RegexPatternConstructor::RegexPatternConstructor):
8722 (JSC::Yarr::RegexPatternConstructor::~RegexPatternConstructor):
8723 (JSC::Yarr::RegexPatternConstructor::reset):
8724 (JSC::Yarr::RegexPatternConstructor::assertionBOL):
8725 (JSC::Yarr::RegexPatternConstructor::assertionEOL):
8726 (JSC::Yarr::RegexPatternConstructor::assertionWordBoundary):
8727 (JSC::Yarr::RegexPatternConstructor::atomPatternCharacter):
8728 (JSC::Yarr::RegexPatternConstructor::atomBuiltInCharacterClass):
8729 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassBegin):
8730 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassAtom):
8731 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassRange):
8732 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassBuiltIn):
8733 (JSC::Yarr::RegexPatternConstructor::atomCharacterClassEnd):
8734 (JSC::Yarr::RegexPatternConstructor::atomParenthesesSubpatternBegin):
8735 (JSC::Yarr::RegexPatternConstructor::atomParentheticalAssertionBegin):
8736 (JSC::Yarr::RegexPatternConstructor::atomParenthesesEnd):
8737 (JSC::Yarr::RegexPatternConstructor::atomBackReference):
8738 (JSC::Yarr::RegexPatternConstructor::copyDisjunction):
8739 (JSC::Yarr::RegexPatternConstructor::copyTerm):
8740 (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
8741 (JSC::Yarr::RegexPatternConstructor::disjunction):
8742 (JSC::Yarr::RegexPatternConstructor::regexBegin):
8743 (JSC::Yarr::RegexPatternConstructor::regexEnd):
8744 (JSC::Yarr::RegexPatternConstructor::regexError):
8745 (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
8746 (JSC::Yarr::RegexPatternConstructor::setupDisjunctionOffsets):
8747 (JSC::Yarr::RegexPatternConstructor::setupOffsets):
8748 (JSC::Yarr::compileRegex):
8749 * yarr/RegexCompiler.h: Added.
8750 * yarr/RegexInterpreter.cpp: Added.
8751 (JSC::Yarr::Interpreter::appendParenthesesDisjunctionContext):
8752 (JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):
8753 (JSC::Yarr::Interpreter::DisjunctionContext::DisjunctionContext):
8754 (JSC::Yarr::Interpreter::DisjunctionContext::operator new):
8755 (JSC::Yarr::Interpreter::allocDisjunctionContext):
8756 (JSC::Yarr::Interpreter::freeDisjunctionContext):
8757 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
8758 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::operator new):
8759 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::restoreOutput):
8760 (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::getDisjunctionContext):
8761 (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
8762 (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
8763 (JSC::Yarr::Interpreter::InputStream::InputStream):
8764 (JSC::Yarr::Interpreter::InputStream::next):
8765 (JSC::Yarr::Interpreter::InputStream::rewind):
8766 (JSC::Yarr::Interpreter::InputStream::read):
8767 (JSC::Yarr::Interpreter::InputStream::readChecked):
8768 (JSC::Yarr::Interpreter::InputStream::reread):
8769 (JSC::Yarr::Interpreter::InputStream::prev):
8770 (JSC::Yarr::Interpreter::InputStream::getPos):
8771 (JSC::Yarr::Interpreter::InputStream::setPos):
8772 (JSC::Yarr::Interpreter::InputStream::atStart):
8773 (JSC::Yarr::Interpreter::InputStream::atEnd):
8774 (JSC::Yarr::Interpreter::InputStream::checkInput):
8775 (JSC::Yarr::Interpreter::InputStream::uncheckInput):
8776 (JSC::Yarr::Interpreter::testCharacterClass):
8777 (JSC::Yarr::Interpreter::tryConsumeCharacter):
8778 (JSC::Yarr::Interpreter::checkCharacter):
8779 (JSC::Yarr::Interpreter::tryConsumeCharacterClass):
8780 (JSC::Yarr::Interpreter::checkCharacterClass):
8781 (JSC::Yarr::Interpreter::tryConsumeBackReference):
8782 (JSC::Yarr::Interpreter::matchAssertionBOL):
8783 (JSC::Yarr::Interpreter::matchAssertionEOL):
8784 (JSC::Yarr::Interpreter::matchAssertionWordBoundary):
8785 (JSC::Yarr::Interpreter::matchPatternCharacter):
8786 (JSC::Yarr::Interpreter::backtrackPatternCharacter):
8787 (JSC::Yarr::Interpreter::matchCharacterClass):
8788 (JSC::Yarr::Interpreter::backtrackCharacterClass):
8789 (JSC::Yarr::Interpreter::matchBackReference):
8790 (JSC::Yarr::Interpreter::backtrackBackReference):
8791 (JSC::Yarr::Interpreter::recordParenthesesMatch):
8792 (JSC::Yarr::Interpreter::resetMatches):
8793 (JSC::Yarr::Interpreter::resetAssertionMatches):
8794 (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
8795 (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
8796 (JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
8797 (JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
8798 (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
8799 (JSC::Yarr::Interpreter::matchParentheticalAssertionOnceBegin):
8800 (JSC::Yarr::Interpreter::matchParentheticalAssertionOnceEnd):
8801 (JSC::Yarr::Interpreter::backtrackParentheticalAssertionOnceBegin):
8802 (JSC::Yarr::Interpreter::backtrackParentheticalAssertionOnceEnd):
8803 (JSC::Yarr::Interpreter::matchParentheses):
8804 (JSC::Yarr::Interpreter::backtrackParentheses):
8805 (JSC::Yarr::Interpreter::matchTerm):
8806 (JSC::Yarr::Interpreter::backtrackTerm):
8807 (JSC::Yarr::Interpreter::matchAlternative):
8808 (JSC::Yarr::Interpreter::matchDisjunction):
8809 (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
8810 (JSC::Yarr::Interpreter::interpret):
8811 (JSC::Yarr::Interpreter::Interpreter):
8812 (JSC::Yarr::ByteCompiler::ParenthesesStackEntry::ParenthesesStackEntry):
8813 (JSC::Yarr::ByteCompiler::ByteCompiler):
8814 (JSC::Yarr::ByteCompiler::compile):
8815 (JSC::Yarr::ByteCompiler::checkInput):
8816 (JSC::Yarr::ByteCompiler::assertionBOL):
8817 (JSC::Yarr::ByteCompiler::assertionEOL):
8818 (JSC::Yarr::ByteCompiler::assertionWordBoundary):
8819 (JSC::Yarr::ByteCompiler::atomPatternCharacter):
8820 (JSC::Yarr::ByteCompiler::atomCharacterClass):
8821 (JSC::Yarr::ByteCompiler::atomBackReference):
8822 (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
8823 (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
8824 (JSC::Yarr::ByteCompiler::popParenthesesStack):
8825 (JSC::Yarr::ByteCompiler::dumpDisjunction):
8826 (JSC::Yarr::ByteCompiler::closeAlternative):
8827 (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
8828 (JSC::Yarr::ByteCompiler::regexBegin):
8829 (JSC::Yarr::ByteCompiler::regexEnd):
8830 (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
8831 (JSC::Yarr::ByteCompiler::emitDisjunction):
8832 (JSC::Yarr::byteCompileRegex):
8833 (JSC::Yarr::interpretRegex):
8834 * yarr/RegexInterpreter.h: Added.
8835 (JSC::Yarr::ByteTerm::):
8836 (JSC::Yarr::ByteTerm::ByteTerm):
8837 (JSC::Yarr::ByteTerm::BOL):
8838 (JSC::Yarr::ByteTerm::CheckInput):
8839 (JSC::Yarr::ByteTerm::EOL):
8840 (JSC::Yarr::ByteTerm::WordBoundary):
8841 (JSC::Yarr::ByteTerm::BackReference):
8842 (JSC::Yarr::ByteTerm::AlternativeBegin):
8843 (JSC::Yarr::ByteTerm::AlternativeDisjunction):
8844 (JSC::Yarr::ByteTerm::AlternativeEnd):
8845 (JSC::Yarr::ByteTerm::PatternEnd):
8846 (JSC::Yarr::ByteTerm::invert):
8847 (JSC::Yarr::ByteTerm::capture):
8848 (JSC::Yarr::ByteDisjunction::ByteDisjunction):
8849 (JSC::Yarr::BytecodePattern::BytecodePattern):
8850 (JSC::Yarr::BytecodePattern::~BytecodePattern):
8851 * yarr/RegexJIT.cpp: Added.
8852 (JSC::Yarr::RegexGenerator::optimizeAlternative):
8853 (JSC::Yarr::RegexGenerator::matchCharacterClassRange):
8854 (JSC::Yarr::RegexGenerator::matchCharacterClass):
8855 (JSC::Yarr::RegexGenerator::jumpIfNoAvailableInput):
8856 (JSC::Yarr::RegexGenerator::jumpIfAvailableInput):
8857 (JSC::Yarr::RegexGenerator::checkInput):
8858 (JSC::Yarr::RegexGenerator::atEndOfInput):
8859 (JSC::Yarr::RegexGenerator::notAtEndOfInput):
8860 (JSC::Yarr::RegexGenerator::jumpIfCharEquals):
8861 (JSC::Yarr::RegexGenerator::jumpIfCharNotEquals):
8862 (JSC::Yarr::RegexGenerator::readCharacter):
8863 (JSC::Yarr::RegexGenerator::storeToFrame):
8864 (JSC::Yarr::RegexGenerator::loadFromFrame):
8865 (JSC::Yarr::RegexGenerator::TermGenerationState::TermGenerationState):
8866 (JSC::Yarr::RegexGenerator::TermGenerationState::resetAlternative):
8867 (JSC::Yarr::RegexGenerator::TermGenerationState::alternativeValid):
8868 (JSC::Yarr::RegexGenerator::TermGenerationState::nextAlternative):
8869 (JSC::Yarr::RegexGenerator::TermGenerationState::alternative):
8870 (JSC::Yarr::RegexGenerator::TermGenerationState::resetTerm):
8871 (JSC::Yarr::RegexGenerator::TermGenerationState::termValid):
8872 (JSC::Yarr::RegexGenerator::TermGenerationState::nextTerm):
8873 (JSC::Yarr::RegexGenerator::TermGenerationState::term):
8874 (JSC::Yarr::RegexGenerator::TermGenerationState::lookaheadTerm):
8875 (JSC::Yarr::RegexGenerator::TermGenerationState::isSinglePatternCharacterLookaheadTerm):
8876 (JSC::Yarr::RegexGenerator::TermGenerationState::inputOffset):
8877 (JSC::Yarr::RegexGenerator::TermGenerationState::jumpToBacktrack):
8878 (JSC::Yarr::RegexGenerator::TermGenerationState::setBacktrackGenerated):
8879 (JSC::Yarr::RegexGenerator::jumpToBacktrackCheckEmitPending):
8880 (JSC::Yarr::RegexGenerator::genertateAssertionBOL):
8881 (JSC::Yarr::RegexGenerator::genertateAssertionEOL):
8882 (JSC::Yarr::RegexGenerator::matchAssertionWordchar):
8883 (JSC::Yarr::RegexGenerator::genertateAssertionWordBoundary):
8884 (JSC::Yarr::RegexGenerator::genertatePatternCharacterSingle):
8885 (JSC::Yarr::RegexGenerator::genertatePatternCharacterPair):
8886 (JSC::Yarr::RegexGenerator::genertatePatternCharacterFixed):
8887 (JSC::Yarr::RegexGenerator::genertatePatternCharacterGreedy):
8888 (JSC::Yarr::RegexGenerator::genertatePatternCharacterNonGreedy):
8889 (JSC::Yarr::RegexGenerator::genertateCharacterClassSingle):
8890 (JSC::Yarr::RegexGenerator::genertateCharacterClassFixed):
8891 (JSC::Yarr::RegexGenerator::genertateCharacterClassGreedy):
8892 (JSC::Yarr::RegexGenerator::genertateCharacterClassNonGreedy):
8893 (JSC::Yarr::RegexGenerator::generateParenthesesSingleDisjunctionOneAlternative):
8894 (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
8895 (JSC::Yarr::RegexGenerator::generateTerm):
8896 (JSC::Yarr::RegexGenerator::generateDisjunction):
8897 (JSC::Yarr::RegexGenerator::RegexGenerator):
8898 (JSC::Yarr::RegexGenerator::generate):
8899 (JSC::Yarr::jitCompileRegex):
8900 (JSC::Yarr::executeRegex):
8901 * yarr/RegexJIT.h: Added.
8902 (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
8903 * yarr/RegexParser.h: Added.
8904 (JSC::Yarr::):
8905 (JSC::Yarr::Parser::):
8906 (JSC::Yarr::Parser::CharacterClassParserDelegate::CharacterClassParserDelegate):
8907 (JSC::Yarr::Parser::CharacterClassParserDelegate::begin):
8908 (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacterUnescaped):
8909 (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
8910 (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
8911 (JSC::Yarr::Parser::CharacterClassParserDelegate::end):
8912 (JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
8913 (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
8914 (JSC::Yarr::Parser::CharacterClassParserDelegate::flush):
8915 (JSC::Yarr::Parser::CharacterClassParserDelegate::):
8916 (JSC::Yarr::Parser::Parser):
8917 (JSC::Yarr::Parser::parseEscape):
8918 (JSC::Yarr::Parser::parseAtomEscape):
8919 (JSC::Yarr::Parser::parseCharacterClassEscape):
8920 (JSC::Yarr::Parser::parseCharacterClass):
8921 (JSC::Yarr::Parser::parseParenthesesBegin):
8922 (JSC::Yarr::Parser::parseParenthesesEnd):
8923 (JSC::Yarr::Parser::parseQuantifier):
8924 (JSC::Yarr::Parser::parseTokens):
8925 (JSC::Yarr::Parser::parse):
8926 (JSC::Yarr::Parser::saveState):
8927 (JSC::Yarr::Parser::restoreState):
8928 (JSC::Yarr::Parser::atEndOfPattern):
8929 (JSC::Yarr::Parser::peek):
8930 (JSC::Yarr::Parser::peekIsDigit):
8931 (JSC::Yarr::Parser::peekDigit):
8932 (JSC::Yarr::Parser::consume):
8933 (JSC::Yarr::Parser::consumeDigit):
8934 (JSC::Yarr::Parser::consumeNumber):
8935 (JSC::Yarr::Parser::consumeOctal):
8936 (JSC::Yarr::Parser::tryConsume):
8937 (JSC::Yarr::Parser::tryConsumeHex):
8938 (JSC::Yarr::parse):
8939 * yarr/RegexPattern.h: Added.
8940 (JSC::Yarr::CharacterRange::CharacterRange):
8941 (JSC::Yarr::):
8942 (JSC::Yarr::PatternTerm::):
8943 (JSC::Yarr::PatternTerm::PatternTerm):
8944 (JSC::Yarr::PatternTerm::BOL):
8945 (JSC::Yarr::PatternTerm::EOL):
8946 (JSC::Yarr::PatternTerm::WordBoundary):
8947 (JSC::Yarr::PatternTerm::invert):
8948 (JSC::Yarr::PatternTerm::capture):
8949 (JSC::Yarr::PatternTerm::quantify):
8950 (JSC::Yarr::PatternAlternative::PatternAlternative):
8951 (JSC::Yarr::PatternAlternative::lastTerm):
8952 (JSC::Yarr::PatternAlternative::removeLastTerm):
8953 (JSC::Yarr::PatternDisjunction::PatternDisjunction):
8954 (JSC::Yarr::PatternDisjunction::~PatternDisjunction):
8955 (JSC::Yarr::PatternDisjunction::addNewAlternative):
8956 (JSC::Yarr::RegexPattern::RegexPattern):
8957 (JSC::Yarr::RegexPattern::~RegexPattern):
8958 (JSC::Yarr::RegexPattern::reset):
8959 (JSC::Yarr::RegexPattern::containsIllegalBackReference):
8960 (JSC::Yarr::RegexPattern::newlineCharacterClass):
8961 (JSC::Yarr::RegexPattern::digitsCharacterClass):
8962 (JSC::Yarr::RegexPattern::spacesCharacterClass):
8963 (JSC::Yarr::RegexPattern::wordcharCharacterClass):
8964 (JSC::Yarr::RegexPattern::nondigitsCharacterClass):
8965 (JSC::Yarr::RegexPattern::nonspacesCharacterClass):
8966 (JSC::Yarr::RegexPattern::nonwordcharCharacterClass):
8967
8968 2009-04-13 Oliver Hunt <oliver@apple.com>
8969
8970 Reviewed by NOBODY (Missed code from last patch).
8971
8972 * runtime/InternalFunction.cpp:
8973 (JSC::InternalFunction::displayName):
8974 (JSC::InternalFunction::calculatedDisplayName):
8975 * runtime/InternalFunction.h:
8976
8977 2009-04-13 Francisco Tolmasky <francisco@280north.com>
8978
8979 Reviewed by Oliver Hunt.
8980
8981 BUG 25171: It should be possible to manually set the name of an anonymous function
8982 <https://bugs.webkit.org/show_bug.cgi?id=25171>
8983
8984 This change adds the displayName property to functions, which when set overrides the
8985 normal name when appearing in the console.
8986
8987 * profiler/Profiler.cpp:
8988 (JSC::createCallIdentifierFromFunctionImp): Changed call to InternalFunction::name to InternalFunction::calculatedDisplayName
8989 * runtime/CommonIdentifiers.h: Added displayName common identifier.
8990 * runtime/InternalFunction.cpp:
8991 (JSC::InternalFunction::displayName): Access to user settable displayName property
8992 (JSC::InternalFunction::calculatedDisplayName): Returns displayName if it exists, if not then the natural name
8993
8994 2009-04-13 Geoffrey Garen <ggaren@apple.com>
8995
8996 Reviewed by Sam Weinig.
8997
8998 Disabled another JavaScriptCore test because it fails on Windows but
8999 not Mac, so it makes the bots red.
9000
9001 * tests/mozilla/expected.html:
9002
9003 2009-04-13 Geoffrey Garen <ggaren@apple.com>
9004
9005 Reviewed by Sam Weinig.
9006
9007 Disabled two JavaScriptCore tests because they fail on Window or Mac but
9008 not both, so they make the bots red.
9009
9010 * tests/mozilla/expected.html: Updated expected results.
9011
9012 2009-04-09 Ben Murdoch <benm@google.com>
9013
9014 Reviewed by Alexey Proskuryakov.
9015
9016 https://bugs.webkit.org/show_bug.cgi?id=25091
9017 The Android platform requires threads to be registered with the VM.
9018 This patch implements this behaviour inside ThreadingPthreads.cpp.
9019
9020 * wtf/ThreadingPthreads.cpp: Add a level above threadEntryPoint that takes care of (un)registering threads with the VM.
9021 (WTF::runThreadWithRegistration): register the thread and run entryPoint. Unregister the thread afterwards.
9022 (WTF::createThreadInternal): call runThreadWithRegistration instead of entryPoint directly.
9023
9024 2009-04-09 David Kilzer <ddkilzer@apple.com>
9025
9026 Reinstating <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
9027
9028 Rolled r42345 back in. The build failure was caused by an
9029 internal script which had not been updated the same way that
9030 build-webkit was updated.
9031
9032 * Configurations/JavaScriptCore.xcconfig:
9033
9034 2009-04-09 Alexey Proskuryakov <ap@webkit.org>
9035
9036 Reverting <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings.
9037 It broke Mac build, and I don't know how to fix it.
9038
9039 * Configurations/JavaScriptCore.xcconfig:
9040
9041 2009-04-09 Xan Lopez <xlopez@igalia.com>
9042
9043 Unreviewed build fix.
9044
9045 Checking for __GLIBCXX__ being bigger than some date is not enough
9046 to get std::tr1, C++0x has to be in use too. Add another check for
9047 __GXX_EXPERIMENTAL_CXX0X__.
9048
9049 * wtf/TypeTraits.h:
9050
9051 2009-04-08 Oliver Hunt <oliver@apple.com>
9052
9053 Reviewed by Adam Roben.
9054
9055 Fix assertion failure in function.apply
9056
9057 The result of excess arguments to function.apply is irrelevant
9058 so we don't need to provide a result register. We were providing
9059 temporary result register but not ref'ing it resulting in an
9060 assertion failure.
9061
9062 * parser/Nodes.cpp:
9063 (JSC::ApplyFunctionCallDotNode::emitBytecode):
9064
9065 2009-04-08 David Kilzer <ddkilzer@apple.com>
9066
9067 <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
9068
9069 Reviewed by Darin Adler and Maciej Stachowiak.
9070
9071 Introduce the ENABLE_SVG_DOM_OBJC_BINDINGS feature define so
9072 that SVG DOM Objective-C bindings may be optionally disabled.
9073
9074 * Configurations/JavaScriptCore.xcconfig: Added
9075 ENABLE_SVG_DOM_OBJC_BINDINGS variable and use it in
9076 FEATURE_DEFINES.
9077
9078 2009-04-08 Paul Pedriana <ppedriana@ea.com>
9079
9080 Reviewed by Darin Adler.
9081
9082 https://bugs.webkit.org/show_bug.cgi?id=20422
9083 Allow custom memory allocation control.
9084
9085 * wtf/FastAllocBase.h:
9086 New added file. Implements allocation base class.
9087 * wtf/TypeTraits.h:
9088 Augments existing type traits support as needed by FastAllocBase.
9089 * wtf/FastMalloc.h:
9090 Changed to support FastMalloc match validation.
9091 * wtf/FastMalloc.cpp:
9092 Changed to support FastMalloc match validation.
9093 * wtf/Platform.h:
9094 Added ENABLE_FAST_MALLOC_MATCH_VALIDATION; defaults to 0.
9095 * GNUmakefile.am:
9096 Updated to include added FastAllocBase.h.
9097 * JavaScriptCore.xcodeproj/project.pbxproj:
9098 Updated to include added FastAllocBase.h.
9099 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
9100 Updated to include added FastAllocBase.h.
9101
9102 2009-04-07 Oliver Hunt <oliver@apple.com>
9103
9104 Reviewed by Geoff Garen.
9105
9106 Improve function.apply performance
9107
9108 Jump through a few hoops to improve performance of function.apply in the general case.
9109
9110 In the case of zero or one arguments, or if there are only two arguments and the
9111 second is an array literal we treat function.apply as function.call.
9112
9113 Otherwise we use the new opcodes op_load_varargs and op_call_varargs to do the .apply call
9114 without re-entering the virtual machine.
9115
9116 * bytecode/CodeBlock.cpp:
9117 (JSC::CodeBlock::dump):
9118 * bytecode/Opcode.h:
9119 * bytecompiler/BytecodeGenerator.cpp:
9120 (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
9121 (JSC::BytecodeGenerator::emitLoadVarargs):
9122 (JSC::BytecodeGenerator::emitCallVarargs):
9123 * bytecompiler/BytecodeGenerator.h:
9124 * interpreter/Interpreter.cpp:
9125 (JSC::Interpreter::privateExecute):
9126 * jit/JIT.cpp:
9127 (JSC::JIT::privateCompileMainPass):
9128 (JSC::JIT::privateCompileSlowCases):
9129 * jit/JIT.h:
9130 * jit/JITCall.cpp:
9131 (JSC::JIT::compileOpCallSetupArgs):
9132 (JSC::JIT::compileOpCallVarargsSetupArgs):
9133 (JSC::JIT::compileOpCallVarargs):
9134 (JSC::JIT::compileOpCallVarargsSlowCase):
9135 * jit/JITStubs.cpp:
9136 (JSC::JITStubs::cti_op_load_varargs):
9137 * jit/JITStubs.h:
9138 * parser/Grammar.y:
9139 * parser/Nodes.cpp:
9140 (JSC::ArrayNode::isSimpleArray):
9141 (JSC::ArrayNode::toArgumentList):
9142 (JSC::CallFunctionCallDotNode::emitBytecode):
9143 (JSC::ApplyFunctionCallDotNode::emitBytecode):
9144 * parser/Nodes.h:
9145 (JSC::ExpressionNode::):
9146 (JSC::ApplyFunctionCallDotNode::):
9147 * runtime/Arguments.cpp:
9148 (JSC::Arguments::copyToRegisters):
9149 (JSC::Arguments::fillArgList):
9150 * runtime/Arguments.h:
9151 (JSC::Arguments::numProvidedArguments):
9152 * runtime/FunctionPrototype.cpp:
9153 (JSC::FunctionPrototype::addFunctionProperties):
9154 * runtime/FunctionPrototype.h:
9155 * runtime/JSArray.cpp:
9156 (JSC::JSArray::copyToRegisters):
9157 * runtime/JSArray.h:
9158 * runtime/JSGlobalObject.cpp:
9159 (JSC::JSGlobalObject::reset):
9160 (JSC::JSGlobalObject::mark):
9161 * runtime/JSGlobalObject.h:
9162
9163 2009-04-08 Alexey Proskuryakov <ap@webkit.org>
9164
9165 Reviewed by Darin Adler.
9166
9167 https://bugs.webkit.org/show_bug.cgi?id=25073
9168 JavaScriptCore tests don't run if time zone is not PST
9169
9170 * API/tests/testapi.c:
9171 (timeZoneIsPST): Added a function that checks whether the time zone is PST, using the same
9172 method as functions in DateMath.cpp do for formatting the result.
9173 (main): Skip date string format test if the time zone is not PST.
9174
9175 2009-04-07 David Levin <levin@chromium.org>
9176
9177 Reviewed by Sam Weinig and Geoff Garen.
9178
9179 https://bugs.webkit.org/show_bug.cgi?id=25039
9180 UString refactoring to support UChar* sharing.
9181
9182 No change in sunspider perf.
9183
9184 * runtime/SmallStrings.cpp:
9185 (JSC::SmallStringsStorage::SmallStringsStorage):
9186 * runtime/UString.cpp:
9187 (JSC::initializeStaticBaseString):
9188 (JSC::initializeUString):
9189 (JSC::UString::BaseString::isShared):
9190 Encapsulate the meaning behind the refcount == 1 checks because
9191 this needs to do slightly more when sharing is added.
9192 (JSC::concatenate):
9193 (JSC::UString::append):
9194 (JSC::UString::operator=):
9195 * runtime/UString.h:
9196 Make m_baseString part of a union to get rid of casts, but make it protected because
9197 it is tricky to use it correctly since it is only valid when the Rep is not a BaseString.
9198 The void* will be filled in when sharing is added.
9199
9200 Add constructors due to the making members protected and it make ensuring proper
9201 initialization work better (like in SmallStringsStorage).
9202 (JSC::UString::Rep::create):
9203 (JSC::UString::Rep::Rep):
9204 (JSC::UString::Rep::):
9205 (JSC::UString::BaseString::BaseString):
9206 (JSC::UString::Rep::setBaseString):
9207 (JSC::UString::Rep::baseString):
9208
9209 2009-04-04 Xan Lopez <xlopez@igalia.com>
9210
9211 Reviewed by Alexey Proskuryakov.
9212
9213 https://bugs.webkit.org/show_bug.cgi?id=25033
9214 dtoa.cpp segfaults with g++ 4.4.0
9215
9216 g++ 4.4.0 seems to be more strict about aliasing rules, so it
9217 produces incorrect code if dtoa.cpp is compiled with
9218 -fstrict-aliasing (it also emits a ton of warnings, so fair enough
9219 I guess). The problem was that we were only casting variables to
9220 union types in order to do type punning, but GCC and the C
9221 standard require that we actually use a union to store the value.
9222
9223 This patch does just that, the code is mostly copied from the dtoa
9224 version in GCC:
9225 http://gcc.gnu.org/viewcvs/trunk/libjava/classpath/native/fdlibm/dtoa.c?view=markup.
9226
9227 * wtf/dtoa.cpp:
9228 (WTF::ulp):
9229 (WTF::b2d):
9230 (WTF::ratio):
9231 (WTF::hexnan):
9232 (WTF::strtod):
9233 (WTF::dtoa):
9234
9235 2009-04-04 Kevin Ollivier <kevino@theolliviers.com>
9236
9237 wx build fix for Win port. Build the assembler sources to get missing functions.
9238
9239 * JavaScriptCoreSources.bkl:
9240 * jscore.bkl:
9241 * wtf/Platform.h:
9242
9243 2009-04-02 Darin Adler <darin@apple.com>
9244
9245 Reviewed by Kevin Decker.
9246
9247 <rdar://problem/6744471> crash in GC due to uninitialized callFunction pointer
9248
9249 * runtime/JSGlobalObject.h:
9250 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Initialize
9251 callFunction as we do the other data members that are used in the mark function.
9252
9253 2009-04-02 Yael Aharon <yael.aharon@nokia.com>
9254
9255 Reviewed by Simon Hausmann
9256
9257 https://bugs.webkit.org/show_bug.cgi?id=24490
9258
9259 Implement WTF::ThreadSpecific in the Qt build using
9260 QThreadStorage.
9261
9262 * wtf/ThreadSpecific.h:
9263
9264 2009-04-01 Greg Bolsinga <bolsinga@apple.com>
9265
9266 Reviewed by Mark Rowe.
9267
9268 https://bugs.webkit.org/show_bug.cgi?id=24990
9269 Put SECTORDER_FLAGS into xcconfig files.
9270
9271 * Configurations/Base.xcconfig:
9272 * Configurations/DebugRelease.xcconfig:
9273 * JavaScriptCore.xcodeproj/project.pbxproj:
9274
9275 2009-03-27 Oliver Hunt <oliver@apple.com>
9276
9277 Reviewed by NOBODY (Build fix).
9278
9279 Fix non-AllInOneFile builds.
9280
9281 * bytecompiler/BytecodeGenerator.cpp:
9282
9283 2009-03-27 Oliver Hunt <oliver@apple.com>
9284
9285 Reviewed by Gavin Barraclough.
9286
9287 Improve performance of Function.prototype.call
9288 <https://bugs.webkit.org/show_bug.cgi?id=24907>
9289
9290 Optimistically assume that expression.call(..) is going to be a call to
9291 Function.prototype.call, and handle it specially to attempt to reduce the
9292 degree of VM reentrancy.
9293
9294 When everything goes right this removes the vm reentry improving .call()
9295 by around a factor of 10.
9296
9297 * JavaScriptCore.xcodeproj/project.pbxproj:
9298 * bytecode/CodeBlock.cpp:
9299 (JSC::CodeBlock::dump):
9300 * bytecode/Opcode.h:
9301 * bytecompiler/BytecodeGenerator.cpp:
9302 (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
9303 * bytecompiler/BytecodeGenerator.h:
9304 * interpreter/Interpreter.cpp:
9305 (JSC::Interpreter::privateExecute):
9306 * jit/JIT.cpp:
9307 (JSC::JIT::privateCompileMainPass):
9308 * parser/Grammar.y:
9309 * parser/Nodes.cpp:
9310 (JSC::CallFunctionCallDotNode::emitBytecode):
9311 * parser/Nodes.h:
9312 (JSC::CallFunctionCallDotNode::):
9313 * runtime/FunctionPrototype.cpp:
9314 (JSC::FunctionPrototype::addFunctionProperties):
9315 * runtime/FunctionPrototype.h:
9316 * runtime/JSGlobalObject.cpp:
9317 (JSC::JSGlobalObject::reset):
9318 (JSC::JSGlobalObject::mark):
9319 * runtime/JSGlobalObject.h:
9320
9321 2009-03-27 Laszlo Gombos <laszlo.1.gombos@nokia.com>
9322
9323 Reviewed by Darin Adler.
9324
9325 Bug 24884: Include strings.h for strcasecmp()
9326 https://bugs.webkit.org/show_bug.cgi?id=24884
9327
9328 * runtime/DateMath.cpp: Reversed previous change including strings.h
9329 * wtf/StringExtras.h: Include strings.h here is available
9330
9331 2009-03-26 Adam Roben <aroben@apple.com>
9332
9333 Copy testapi.js to $WebKitOutputDir on Windows
9334
9335 Part of Bug 24856: run-javascriptcore-tests should run testapi on
9336 Windows
9337 <https://bugs.webkit.org/show_bug.cgi?id=24856>
9338
9339 This matches what Mac does, which will help once we enable running
9340 testapi from run-javascriptcore-tests on Windows.
9341
9342 Reviewed by Steve Falkenburg.
9343
9344 * JavaScriptCore.vcproj/testapi/testapi.vcproj: Copy testapi.js next
9345 to testapi.exe.
9346
9347 2009-03-25 Oliver Hunt <oliver@apple.com>
9348
9349 Reviewed by Geoff Garen.
9350
9351 Fix exception handling for instanceof in the interpreter.
9352
9353 * interpreter/Interpreter.cpp:
9354 (JSC::Interpreter::privateExecute):
9355
9356 2009-03-25 Geoffrey Garen <ggaren@apple.com>
9357
9358 Reviewed by Cameron Zwarich.
9359
9360 Fixed <rdar://problem/6724011> Write to freed memory in JSC::Label::deref
9361 when reloading http://helpme.att.net/speedtest/
9362
9363 * bytecompiler/BytecodeGenerator.h: Reversed the declaration order for
9364 m_labelScopes and m_labels to reverse their destruction order.
9365 m_labelScopes has references to memory within m_labels, so its destructor
9366 needs to run first.
9367
9368 2009-03-24 Eli Fidler <eli.fidler@torchmobile.com>
9369
9370 Reviewed by George Staikos.
9371
9372 Correct warnings which in some environments are treated as errors.
9373
9374 * wtf/dtoa.cpp:
9375 (WTF::b2d):
9376 (WTF::d2b):
9377 (WTF::strtod):
9378 (WTF::dtoa):
9379
9380 2009-03-24 Kevin Ollivier <kevino@theolliviers.com>
9381
9382 Reviewed by Darin Adler.
9383
9384 Explicitly define HAVE_LANGINFO_H on Darwin. Fixes the wx build bot jscore
9385 test failure.
9386
9387 https://bugs.webkit.org/show_bug.cgi?id=24780
9388
9389 * wtf/Platform.h:
9390
9391 2009-03-23 Oliver Hunt <oliver@apple.com>
9392
9393 Reviewed by Cameron Zwarich.
9394
9395 Fix className() for API defined class
9396
9397 * API/JSCallbackObjectFunctions.h:
9398 (JSC::::className):
9399 * API/tests/testapi.c:
9400 (EmptyObject_class):
9401 (main):
9402 * API/tests/testapi.js:
9403
9404 2009-03-23 Oliver Hunt <oliver@apple.com>
9405
9406 Reviewed by Geoff Garen.
9407
9408 Make testapi assertions run in release builds, so that testapi actually
9409 works in a release build.
9410
9411 Many of the testapi assertions have side effects that are necessary, and
9412 given testapi is a testing program, perf impact of an assertion is not
9413 important, so it makes sense to apply the assertions in release builds
9414 anyway.
9415
9416 * API/tests/testapi.c:
9417 (EvilExceptionObject_hasInstance):
9418
9419 2009-03-23 David Kilzer <ddkilzer@apple.com>
9420
9421 Provide JavaScript exception information after slow script timeout
9422
9423 Reviewed by Oliver Hunt.
9424
9425 * runtime/Completion.cpp:
9426 (JSC::evaluate): Set the exception object as the Completion
9427 object's value for slow script timeouts. This is used in
9428 WebCore when reporting the exception.
9429 * runtime/ExceptionHelpers.cpp:
9430 (JSC::InterruptedExecutionError::toString): Added. Provides a
9431 description message for the exception when it is reported.
9432
9433 2009-03-23 Gustavo Noronha Silva <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
9434
9435 Reviewed by Adam Roben.
9436
9437 https://bugs.webkit.org/show_bug.cgi?id=24674
9438 Crashes in !PLATFORM(MAC)'s formatLocaleDate, in very specific situations
9439
9440 Make sure strftime never returns 2-digits years to avoid ambiguity
9441 and a crash. We wrap this new code option in HAVE_LANGINFO_H,
9442 since it is apparently not available in all platforms.
9443
9444 * runtime/DatePrototype.cpp:
9445 (JSC::formatLocaleDate):
9446 * wtf/Platform.h:
9447
9448 2009-03-22 Oliver Hunt <oliver@apple.com>
9449
9450 Reviewed by Cameron Zwarich.
9451
9452 Fix exception handling in API
9453
9454 We can't just use the ExecState exception slot for returning exceptions
9455 from class introspection functions provided through the API as many JSC
9456 functions will explicitly clear the ExecState exception when returning.
9457
9458 * API/JSCallbackObjectFunctions.h:
9459 (JSC::JSCallbackObject<Base>::getOwnPropertySlot):
9460 (JSC::JSCallbackObject<Base>::put):
9461 (JSC::JSCallbackObject<Base>::deleteProperty):
9462 (JSC::JSCallbackObject<Base>::construct):
9463 (JSC::JSCallbackObject<Base>::hasInstance):
9464 (JSC::JSCallbackObject<Base>::call):
9465 (JSC::JSCallbackObject<Base>::toNumber):
9466 (JSC::JSCallbackObject<Base>::toString):
9467 (JSC::JSCallbackObject<Base>::staticValueGetter):
9468 (JSC::JSCallbackObject<Base>::callbackGetter):
9469 * API/tests/testapi.c:
9470 (MyObject_hasProperty):
9471 (MyObject_getProperty):
9472 (MyObject_setProperty):
9473 (MyObject_deleteProperty):
9474 (MyObject_callAsFunction):
9475 (MyObject_callAsConstructor):
9476 (MyObject_hasInstance):
9477 (EvilExceptionObject_hasInstance):
9478 (EvilExceptionObject_convertToType):
9479 (EvilExceptionObject_class):
9480 (main):
9481 * API/tests/testapi.js:
9482 (EvilExceptionObject.hasInstance):
9483 (EvilExceptionObject.toNumber):
9484 (EvilExceptionObject.toStringExplicit):
9485
9486 2009-03-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
9487
9488 Reviewed by Oliver Hunt.
9489
9490 Bug 20049: testapi failure: MyObject - 0 should be NaN but instead is 1.
9491 <https://bugs.webkit.org/show_bug.cgi?id=20049>
9492 <rdar://problem/6079127>
9493
9494 In this case, the test is wrong. According to the ECMA spec, subtraction
9495 uses ToNumber, not ToPrimitive. Change the test to match the spec.
9496
9497 * API/tests/testapi.js:
9498
9499 2009-03-21 Oliver Hunt <oliver@apple.com>
9500
9501 Reviewed by Cameron Zwarich.
9502
9503 Ensure that JSObjectMakeFunction doesn't produce incorrect line numbers.
9504
9505 Also make test api correctly propagate failures.
9506
9507 * API/tests/testapi.c:
9508 (main):
9509 * runtime/FunctionConstructor.cpp:
9510 (JSC::constructFunction):
9511
9512 2009-03-21 Oliver Hunt <oliver@apple.com>
9513
9514 Reviewed by Mark Rowe.
9515
9516 Improve testapi by making it report failures in a way we can pick up
9517 from our test scripts.
9518
9519 * API/tests/testapi.c:
9520 (assertEqualsAsBoolean):
9521 (assertEqualsAsNumber):
9522 (assertEqualsAsUTF8String):
9523 (assertEqualsAsCharactersPtr):
9524 (main):
9525 * API/tests/testapi.js:
9526 (pass):
9527 (fail):
9528 (shouldBe):
9529 (shouldThrow):
9530
9531 2009-03-20 Norbert Leser <norbert.leser@nokia.com>
9532
9533 Reviewed by Darin Adler.
9534
9535 https://bugs.webkit.org/show_bug.cgi?id=24535
9536
9537 Fixes missing line terminator character (;) after macro call.
9538 It is common practice to add the trailing ";" where macros are substituted
9539 and not where they are defined with #define.
9540 This change is consistent with other macro declarations across webkit,
9541 and it also solves compilation failure with symbian compilers.
9542
9543 * runtime/UString.cpp:
9544 * wtf/Assertions.h:
9545
9546 2009-03-20 Geoffrey Garen <ggaren@apple.com>
9547
9548 Reviewed by Darin Adler.
9549
9550 Fixed a JavaScriptCore crash on the Windows buildbot.
9551
9552 * bytecompiler/BytecodeGenerator.h: Reduced the AST recursion limit.
9553 Apparently, Windows has small stacks.
9554
9555 2009-03-20 Geoffrey Garen <ggaren@apple.com>
9556
9557 Reviewed by Oliver Hunt.
9558
9559 A little cleanup in the RegisterFile code.
9560
9561 Moved large inline functions out of the class declaration, to make it
9562 more readable.
9563
9564 Switched over to using the roundUpAllocationSize function to avoid
9565 duplicate code and subtle bugs.
9566
9567 Renamed m_maxCommitted to m_commitEnd, to match m_end.
9568
9569 Renamed allocationSize to commitSize because it's the chunk size for
9570 committing memory, not allocating memory.
9571
9572 SunSpider reports no change.
9573
9574 * interpreter/RegisterFile.h:
9575 (JSC::RegisterFile::RegisterFile):
9576 (JSC::RegisterFile::shrink):
9577 (JSC::RegisterFile::grow):
9578 * jit/ExecutableAllocator.h:
9579 (JSC::roundUpAllocationSize):
9580
9581 2009-03-19 Geoffrey Garen <ggaren@apple.com>
9582
9583 Reviewed by Oliver Hunt.
9584
9585 Fixed <rdar://problem/6033712> -- a little bit of hardening in the Collector.
9586
9587 SunSpider reports no change. I also verified in the disassembly that
9588 we end up with a single compare to constant.
9589
9590 * runtime/Collector.cpp:
9591 (JSC::Heap::heapAllocate):
9592
9593 2009-03-19 Geoffrey Garen <ggaren@apple.com>
9594
9595 Reviewed by Cameron Zwarich and Oliver Hunt.
9596
9597 Fixed <rdar://problem/6406045> REGRESSION: Stack overflow on PowerPC on
9598 fast/workers/use-machine-stack.html (22531)
9599
9600 Dialed down the re-entry allowance to 64 (from 128).
9601
9602 On a 512K stack, this leaves about 64K for other code on the stack while
9603 JavaScript is running. Not perfect, but it solves our crash on PPC.
9604
9605 Different platforms may want to dial this down even more.
9606
9607 Also, substantially shrunk BytecodeGenerator. Since we allocate one on
9608 the stack in order to throw a stack overflow exception -- well, let's
9609 just say the old code had an appreciation for irony.
9610
9611 SunSpider reports no change.
9612
9613 * bytecompiler/BytecodeGenerator.h:
9614 * interpreter/Interpreter.h:
9615 (JSC::):
9616
9617 2009-03-19 Cameron Zwarich <cwzwarich@uwaterloo.ca>
9618
9619 Reviewed by Oliver Hunt.
9620
9621 Bug 24350: REGRESSION: Safari 4 breaks SPAW wysiwyg editor multiple instances
9622 <https://bugs.webkit.org/show_bug.cgi?id=24350>
9623 <rdar://problem/6674182>
9624
9625 The SPAW editor's JavaScript assumes that toString() on a function
9626 constructed with the Function constructor produces a function with
9627 a newline after the opening brace.
9628
9629 * runtime/FunctionConstructor.cpp:
9630 (JSC::constructFunction): Add a newline after the opening brace of the
9631 function's source code.
9632
9633 2009-03-19 Cameron Zwarich <cwzwarich@uwaterloo.ca>
9634
9635 Reviewed by Geoff Garen.
9636
9637 Bug 23771: REGRESSION (r36016): JSObjectHasProperty freezes on global class without kJSClassAttributeNoAutomaticPrototype
9638 <https://bugs.webkit.org/show_bug.cgi?id=23771>
9639 <rdar://problem/6561016>
9640
9641 * API/tests/testapi.c:
9642 (main): Add a test for this bug.
9643 * runtime/JSGlobalObject.cpp:
9644 (JSC::JSGlobalObject::resetPrototype): Don't set the prototype of the
9645 last object in the prototype chain to the object prototype when the
9646 object prototype is already the last object in the prototype chain.
9647
9648 2009-03-19 Timothy Hatcher <timothy@apple.com>
9649
9650 <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers
9651
9652 Reviewed by Darin Adler.
9653
9654 * wtf/Platform.h: Added HAVE_RUNLOOP_TIMER for PLATFORM(MAC).
9655
9656 2009-03-19 Geoffrey Garen <ggaren@apple.com>
9657
9658 Reviewed by Oliver Hunt.
9659
9660 Fixed <rdar://problem/6279213> Regular expression run-time complexity
9661 limit too low for long inputs (21485)
9662
9663 I raised PCRE's "matchLimit" (limit on backtracking) by an order of
9664 magnitude. This fixes all the reported examples of timing out on legitimate
9665 regular expression matches.
9666
9667 In my testing on a Core Duo MacBook Pro, the longest you can get stuck
9668 trying to match a string is still under 1s, so this seems like a safe change.
9669
9670 I can think of a number of better solutions that are more complicated,
9671 but this is a good improvement for now.
9672
9673 * pcre/pcre_exec.cpp:
9674
9675 2009-03-19 Geoffrey Garen <ggaren@apple.com>
9676
9677 Reviewed by Sam Weinig.
9678
9679 Fixed <rdar://problem/6603562> REGRESSION (Safari 4): regular expression
9680 pattern size limit lower than Safari 3.2, other browsers, breaks SAP (14873)
9681
9682 Bumped the pattern size limit to 1MB, and standardized it between PCRE
9683 and WREC. (Empirical testing says that we can easily compile a 1MB regular
9684 expression without risking a hang. Other browsers support bigger regular
9685 expressions, but also hang.)
9686
9687 SunSpider reports no change.
9688
9689 I started with a patch posted to Bugzilla by Erik Corry (erikcorry@google.com).
9690
9691 * pcre/pcre_internal.h:
9692 (put3ByteValue):
9693 (get3ByteValue):
9694 (put3ByteValueAndAdvance):
9695 (putLinkValueAllowZero):
9696 (getLinkValueAllowZero): Made PCRE's "LINK_SIZE" (the number of bytes
9697 used to record jumps between bytecodes) 3, to accomodate larger potential
9698 jumps. Bumped PCRE's "MAX_PATTERN_SIZE" to 1MB. (Technically, at this
9699 LINK_SIZE, we can support even larger patterns, but we risk a hang during
9700 compilation, and it's not clear that such large patterns are important
9701 on the web.)
9702
9703 * wrec/WREC.cpp:
9704 (JSC::WREC::Generator::compileRegExp): Match PCRE's maximum pattern size,
9705 to avoid quirks between platforms.
9706
9707 2009-03-18 Ada Chan <adachan@apple.com>
9708
9709 Rolling out r41818 since it broke the windows build.
9710 Error: ..\..\runtime\DatePrototype.cpp(30) : fatal error C1083: Cannot open include file: 'langinfo.h': No such file or directory
9711
9712 * runtime/DatePrototype.cpp:
9713 (JSC::formatLocaleDate):
9714
9715 2009-03-17 Oliver Hunt <oliver@apple.com>
9716
9717 Reviewed by Cameron Zwarich.
9718
9719 <rdar://problem/6692138> REGRESSION (Safari 4): Incorrect function return value when using IE "try ... finally" memory leak work-around (24654)
9720 <https://bugs.webkit.org/show_bug.cgi?id=24654>
9721
9722 If the return value for a function is in a local register we need
9723 to copy it before executing any finalisers, otherwise it is possible
9724 for the finaliser to clobber the result.
9725
9726 * bytecompiler/BytecodeGenerator.h:
9727 (JSC::BytecodeGenerator::hasFinaliser):
9728 * parser/Nodes.cpp:
9729 (JSC::ReturnNode::emitBytecode):
9730
9731 2009-03-17 Kevin Ollivier <kevino@theolliviers.com>
9732
9733 Reviewed by Mark Rowe.
9734
9735 Move BUILDING_ON_* defines into Platform.h to make them available to other ports.
9736 Also tweak the defines so that they work with the default values set by
9737 AvailabilityMacros.h.
9738
9739 https://bugs.webkit.org/show_bug.cgi?id=24630
9740
9741 * JavaScriptCorePrefix.h:
9742 * wtf/Platform.h:
9743
9744 2009-03-15 Simon Fraser <simon.fraser@apple.com>
9745
9746 Revert r41718 because it broke DumpRenderTree on Tiger.
9747
9748 * JavaScriptCorePrefix.h:
9749 * wtf/Platform.h:
9750
9751 2009-03-15 Kevin Ollivier <kevino@theolliviers.com>
9752
9753 Non-Apple Mac ports build fix. Move defines for the BUILDING_ON_ macros into
9754 Platform.h so that they're defined for all ports building on Mac, and tweak
9755 the definitions of those macros based on Mark Rowe's suggestions to accomodate
9756 cases where the values may not be <= to the .0 release for that version.
9757
9758 * JavaScriptCorePrefix.h:
9759 * wtf/Platform.h:
9760
9761 2009-03-13 Mark Rowe <mrowe@apple.com>
9762
9763 Rubber-stamped by Dan Bernstein.
9764
9765 Take advantage of the ability of recent versions of Xcode to easily switch the active
9766 architecture.
9767
9768 * Configurations/DebugRelease.xcconfig:
9769
9770 2009-03-13 Mark Rowe <mrowe@apple.com>
9771
9772 Reviewed by David Kilzer.
9773
9774 Prevent AllInOneFile.cpp and ProfileGenerator.cpp from rebuilding unnecessarily when
9775 switching between building in Xcode and via build-webkit.
9776
9777 build-webkit passes FEATURE_DEFINES to xcodebuild, resulting in it being present in the
9778 Derived Sources build settings. When building in Xcode, this setting isn't present so
9779 Xcode reruns the script build phases. This results in a new version of TracingDtrace.h
9780 being generated, and the files that include it being rebuilt.
9781
9782 * JavaScriptCore.xcodeproj/project.pbxproj: Don't regenerate TracingDtrace.h if it is
9783 already newer than the input file.
9784
9785 2009-03-13 Norbert Leser <norbert.leser@nokia.com>
9786
9787 Reviewed by Darin Adler.
9788
9789 Resolved name conflict with globally defined tzname in Symbian.
9790 Replaced with different name instead of using namespace qualifier
9791 (appeared to be less clumsy).
9792
9793 * runtime/DateMath.cpp:
9794
9795 2009-03-12 Mark Rowe <mrowe@apple.com>
9796
9797 Reviewed by Darin Adler.
9798
9799 <rdar://problem/6548446> TCMalloc_SystemRelease should use madvise rather than re-mmaping span of pages
9800
9801 * wtf/FastMalloc.cpp:
9802 (WTF::mergeDecommittedStates): If either of the spans has been released to the system, release the other
9803 span as well so that the flag in the merged span is accurate.
9804 * wtf/Platform.h:
9805 * wtf/TCSystemAlloc.cpp: Track decommitted spans when using MADV_FREE_REUSABLE / MADV_FREE_REUSE.
9806 (TCMalloc_SystemRelease): Use madvise with MADV_FREE_REUSABLE when it is available.
9807 (TCMalloc_SystemCommit): Use madvise with MADV_FREE_REUSE when it is available.
9808 * wtf/TCSystemAlloc.h:
9809
9810 2009-03-12 Adam Treat <adam.treat@torchmobile.com>
9811
9812 Reviewed by NOBODY (Build fix).
9813
9814 Include string.h for strlen usage.
9815
9816 * wtf/Threading.cpp:
9817
9818 2009-03-12 David Kilzer <ddkilzer@apple.com>
9819
9820 Add NO_RETURN attribute to runInteractive() when not using readline
9821
9822 Reviewed by Darin Adler.
9823
9824 * jsc.cpp:
9825 (runInteractive): If the readline library is not used, this method
9826 will never return, thus the NO_RETURN attribute is needed to prevent
9827 a gcc warning.
9828
9829 2009-03-12 Adam Roben <aroben@apple.com>
9830
9831 Adopt setThreadNameInternal on Windows
9832
9833 Also changed a Windows-only assertion about thread name length to an
9834 all-platform log message.
9835
9836 Reviewed by Adam Treat.
9837
9838 * wtf/Threading.cpp:
9839 (WTF::createThread): Warn if the thread name is longer than 31
9840 characters, as Visual Studio will truncate names longer than that
9841 length.
9842
9843 * wtf/ThreadingWin.cpp:
9844 (WTF::setThreadNameInternal): Renamed from setThreadName and changed
9845 to always operate on the current thread.
9846 (WTF::initializeThreading): Changed to use setThreadNameInternal.
9847 (WTF::createThreadInternal): Removed call to setThreadName. This is
9848 now handled by threadEntryPoint and setThreadNameInternal.
9849
9850 2009-03-11 David Kilzer <ddkilzer@apple.com>
9851
9852 Clarify comments regarding order of FEATURE_DEFINES
9853
9854 Rubber-stamped by Mark Rowe.
9855
9856 * Configurations/JavaScriptCore.xcconfig: Added warning about
9857 the consequences when FEATURE_DEFINES are not kept in sync.
9858
9859 2009-03-11 Dan Bernstein <mitz@apple.com>
9860
9861 Reviewed by Darin Adler.
9862
9863 - WTF support for fixing <rdar://problem/3919124> Thai text selection
9864 in Safari is incorrect
9865
9866 * wtf/unicode/icu/UnicodeIcu.h:
9867 (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added. Returns
9868 whether the character has Unicode line breaking property value SA
9869 ("Complex Context").
9870 * wtf/unicode/qt4/UnicodeQt4.h:
9871 (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added an
9872 implementation that always returns false.
9873
9874 2009-03-11 Darin Adler <darin@apple.com>
9875
9876 Reviewed by Mark Rowe.
9877
9878 Give threads names on platforms with pthread_setname_np.
9879
9880 * wtf/Threading.cpp:
9881 (WTF::NewThreadContext::NewThreadContext): Initialize thread name.
9882 (WTF::threadEntryPoint): Call setThreadNameInternal.
9883 (WTF::createThread): Pass thread name.
9884
9885 * wtf/Threading.h: Added new comments, setThreadNameInternal.
9886
9887 * wtf/ThreadingGtk.cpp:
9888 (WTF::setThreadNameInternal): Added. Empty.
9889 * wtf/ThreadingNone.cpp:
9890 (WTF::setThreadNameInternal): Added. Empty.
9891 * wtf/ThreadingPthreads.cpp:
9892 (WTF::setThreadNameInternal): Call pthread_setname_np when available.
9893 * wtf/ThreadingQt.cpp:
9894 (WTF::setThreadNameInternal): Added. Empty.
9895 * wtf/ThreadingWin.cpp:
9896 (WTF::setThreadNameInternal): Added. Empty.
9897
9898 2009-03-11 Adam Roben <aroben@apple.com>
9899
9900 Change the Windows implementation of ThreadSpecific to use functions
9901 instead of extern globals
9902
9903 This will make it easier to export ThreadSpecific from WebKit.
9904
9905 Reviewed by John Sullivan.
9906
9907 * API/JSBase.cpp:
9908 (JSEvaluateScript):
9909 Touched this file to force ThreadSpecific.h to be copied into
9910 $WebKitOutputDir.
9911
9912 * wtf/ThreadSpecific.h: Replaced g_tls_key_count with tlsKeyCount()
9913 and g_tls_keys with tlsKeys().
9914
9915 (WTF::::ThreadSpecific):
9916 (WTF::::~ThreadSpecific):
9917 (WTF::::get):
9918 (WTF::::set):
9919 (WTF::::destroy):
9920 Updated to use the new functions.
9921
9922 * wtf/ThreadSpecificWin.cpp:
9923 (WTF::tlsKeyCount):
9924 (WTF::tlsKeys):
9925 Added.
9926
9927 (WTF::ThreadSpecificThreadExit): Changed to use the new functions.
9928
9929 2009-03-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
9930
9931 Reviewed by Geoff Garen.
9932
9933 Bug 24291: REGRESSION (r38635): Single line JavaScript comment prevents HTML button click handler execution
9934 <https://bugs.webkit.org/show_bug.cgi?id=24291>
9935 <rdar://problem/6663472>
9936
9937 Add an extra newline to the end of the body of the program text constructed
9938 by the Function constructor for parsing. This allows single line comments to
9939 be handled correctly by the parser.
9940
9941 * runtime/FunctionConstructor.cpp:
9942 (JSC::constructFunction):
9943
9944 2009-03-09 Oliver Hunt <oliver@apple.com>
9945
9946 Reviewed by Gavin Barraclough.
9947
9948 Bug 24447: REGRESSION (r41508): Google Maps does not complete initialization
9949 <rdar://problem/6657774>
9950
9951 r41508 actually exposed a pre-existing bug where we were not invalidating the result
9952 register cache at jump targets. This causes problems when condition loads occur in an
9953 expression -- namely through the ?: and || operators. This patch corrects these issues
9954 by marking the target of all forward jumps as being a jump target, and then clears the
9955 result register cache when ever it starts generating code for a targeted instruction.
9956
9957 I do not believe it is possible to cause this class of failure outside of a single
9958 expression, and expressions only provide forward branches, so this should resolve this
9959 entire class of bug. That said i've included a test case that gets as close as possible
9960 to hitting this bug with a back branch, to hopefully prevent anyone from introducing the
9961 problem in future.
9962
9963 * assembler/AbstractMacroAssembler.h:
9964 (JSC::AbstractMacroAssembler::Label::isUsed):
9965 (JSC::AbstractMacroAssembler::Label::used):
9966 * assembler/X86Assembler.h:
9967 (JSC::X86Assembler::JmpDst::JmpDst):
9968 (JSC::X86Assembler::JmpDst::isUsed):
9969 (JSC::X86Assembler::JmpDst::used):
9970 * jit/JIT.cpp:
9971 (JSC::JIT::privateCompileMainPass):
9972
9973 2009-03-09 David Levin <levin@chromium.org>
9974
9975 Reviewed by Darin Adler.
9976
9977 Bug 23175: String and UString should be able to share a UChar* buffer.
9978 <https://bugs.webkit.org/show_bug.cgi?id=23175>
9979
9980 Add CrossThreadRefCounted.
9981
9982 * wtf/CrossThreadRefCounted.h: Added.
9983 (WTF::CrossThreadRefCounted::create):
9984 (WTF::CrossThreadRefCounted::isShared):
9985 (WTF::CrossThreadRefCounted::dataAccessMustBeThreadSafe):
9986 (WTF::CrossThreadRefCounted::mayBePassedToAnotherThread):
9987 (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
9988 (WTF::CrossThreadRefCounted::~CrossThreadRefCounted):
9989 (WTF::CrossThreadRefCounted::ref):
9990 (WTF::CrossThreadRefCounted::deref):
9991 (WTF::CrossThreadRefCounted::release):
9992 (WTF::CrossThreadRefCounted::copy):
9993 (WTF::CrossThreadRefCounted::threadSafeDeref):
9994 * wtf/RefCounted.h:
9995 * wtf/Threading.h:
9996 (WTF::ThreadSafeSharedBase::ThreadSafeSharedBase):
9997 (WTF::ThreadSafeSharedBase::derefBase):
9998 (WTF::ThreadSafeShared::ThreadSafeShared):
9999 (WTF::ThreadSafeShared::deref):
10000
10001 2009-03-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
10002
10003 Reviewed by George Staikos.
10004
10005 https://bugs.webkit.org/show_bug.cgi?id=24353
10006 Allow to overrule default build options for Qt build.
10007
10008 * JavaScriptCore.pri: Allow to overrule ENABLE_JIT
10009
10010 2009-03-08 Oliver Hunt <oliver@apple.com>
10011
10012 Reviewed by NOBODY (build fix).
10013
10014 Build fix.
10015
10016 * runtime/ArrayPrototype.cpp:
10017 (JSC::arrayProtoFuncConcat):
10018
10019 2009-03-01 Oliver Hunt <oliver@apple.com>
10020
10021 Reviewed by Cameron Zwarich.
10022
10023 Bug 24268: RuntimeArray is not a fully implemented JSArray
10024 <https://bugs.webkit.org/show_bug.cgi?id=24268>
10025
10026 Don't cast a type to JSArray, just because it reportsArray as a supertype
10027 in the JS type system. Doesn't appear feasible to create a testcase
10028 unfortunately as setting up the failure conditions requires internal access
10029 to JSC not present in DRT.
10030
10031 * runtime/ArrayPrototype.cpp:
10032 (JSC::arrayProtoFuncConcat):
10033
10034 2009-03-06 Gavin Barraclough <barraclough@apple.com>
10035
10036 Reviewed by Oliver Hunt.
10037
10038 When preforming an op_mov, preserve any existing register mapping.
10039
10040 ~0.5% progression on v8 tests x86-64.
10041
10042 * jit/JIT.cpp:
10043 (JSC::JIT::privateCompileMainPass):
10044
10045 2009-03-05 Simone Fiorentino <simone.fiorentino@consulenti.fastweb.it>
10046
10047 Bug 24382: request to add SH4 platform
10048
10049 <https://bugs.webkit.org/show_bug.cgi?id=24382>
10050
10051 Reviewed by David Kilzer.
10052
10053 * wtf/Platform.h: Added support for SH4 platform.
10054
10055 2009-03-05 Gavin Barraclough <barraclough@apple.com>
10056
10057 Reviewed by Oliver Hunt.
10058
10059 Writes of constant values to SF registers should be made with direct memory
10060 writes where possible, rather than moving the value via a hardware register.
10061
10062 ~3% win on SunSpider tests on x86, ~1.5% win on v8 tests on x86-64.
10063
10064 * assembler/MacroAssemblerX86_64.h:
10065 (JSC::MacroAssemblerX86_64::storePtr):
10066 * assembler/X86Assembler.h:
10067 (JSC::X86Assembler::movq_i32m):
10068 * jit/JIT.cpp:
10069 (JSC::JIT::privateCompileMainPass):
10070
10071 2009-03-05 Mark Rowe <mrowe@apple.com>
10072
10073 Fix the build.
10074
10075 Sprinkle "static" around NumberConstructor.cpp in order to please the compiler.
10076
10077 * runtime/NumberConstructor.cpp:
10078 (JSC::numberConstructorNaNValue):
10079 (JSC::numberConstructorNegInfinity):
10080 (JSC::numberConstructorPosInfinity):
10081 (JSC::numberConstructorMaxValue):
10082 (JSC::numberConstructorMinValue):
10083
10084 2009-03-04 Mark Rowe <mrowe@apple.com>
10085
10086 Reviewed by Oliver Hunt.
10087
10088 <rdar://problem/6354858> FastMallocZone's enumeration code reports fragmented administration space
10089
10090 The handling of MALLOC_ADMIN_REGION_RANGE_TYPE in FastMalloc's zone was incorrect. It was attempting
10091 to record the memory containing and individual span as an administrative region, when all memory
10092 allocated via MetaDataAlloc should in fact be recorded. This was causing memory regions allocated
10093 via MetaDataAlloc to appear as "VM_ALLOCATE ?" in vmmap output. They are now correctly reported as
10094 "MALLOC_OTHER" regions associated with the JavaScriptCore FastMalloc zone.
10095
10096 Memory is allocated via MetaDataAlloc from two locations: PageHeapAllocator, and TCMalloc_PageMap{2,3}.
10097 These two cases are handled differently.
10098
10099 PageHeapAllocator is extended to keep a linked list of memory regions that it has allocated. The
10100 first object in an allocated region contains the link to the previously allocated region. To record
10101 the administrative regions of a PageHeapAllocator we can simply walk the linked list and record
10102 each allocated region we encounter.
10103
10104 TCMalloc_PageMaps allocate memory via MetaDataAlloc to store each level of the radix tree. To record
10105 the administrative regions of a TCMalloc_PageMap we walk the tree and record the storage used for nodes
10106 at each position rather than the nodes themselves.
10107
10108 A small performance improvement is achieved by coalescing adjacent memory regions inside the PageMapMemoryUsageRecorder
10109 so that fewer calls in to the range recorder are necessary. We further reduce the number of calls to the
10110 range recorder by aggregating the in-use ranges of a given memory region into a local buffer before recording
10111 them with a single call. A similar approach is also used by AdminRegionRecorder.
10112
10113 * wtf/FastMalloc.cpp:
10114 (WTF::PageHeapAllocator::Init):
10115 (WTF::PageHeapAllocator::New):
10116 (WTF::PageHeapAllocator::recordAdministrativeRegions):
10117 (WTF::TCMallocStats::FreeObjectFinder::isFreeObject):
10118 (WTF::TCMallocStats::PageMapMemoryUsageRecorder::~PageMapMemoryUsageRecorder):
10119 (WTF::TCMallocStats::PageMapMemoryUsageRecorder::recordPendingRegions):
10120 (WTF::TCMallocStats::PageMapMemoryUsageRecorder::visit):
10121 (WTF::TCMallocStats::AdminRegionRecorder::AdminRegionRecorder):
10122 (WTF::TCMallocStats::AdminRegionRecorder::recordRegion):
10123 (WTF::TCMallocStats::AdminRegionRecorder::visit):
10124 (WTF::TCMallocStats::AdminRegionRecorder::recordPendingRegions):
10125 (WTF::TCMallocStats::AdminRegionRecorder::~AdminRegionRecorder):
10126 (WTF::TCMallocStats::FastMallocZone::enumerate):
10127 (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
10128 (WTF::TCMallocStats::FastMallocZone::init):
10129 * wtf/TCPageMap.h:
10130 (TCMalloc_PageMap2::visitValues):
10131 (TCMalloc_PageMap2::visitAllocations):
10132 (TCMalloc_PageMap3::visitValues):
10133 (TCMalloc_PageMap3::visitAllocations):
10134
10135 2009-03-04 Antti Koivisto <antti@apple.com>
10136
10137 Reviewed by Dave Hyatt.
10138
10139 https://bugs.webkit.org/show_bug.cgi?id=24359
10140 Repaint throttling mechanism
10141
10142 Set ENABLE_REPAINT_THROTTLING to 0 by default.
10143
10144 * wtf/Platform.h:
10145
10146 2009-03-03 David Kilzer <ddkilzer@apple.com>
10147
10148 <rdar://problem/6581203> WebCore and WebKit should install the same set of headers during installhdrs phase as build phase
10149
10150 Reviewed by Mark Rowe.
10151
10152 * Configurations/Base.xcconfig: Defined REAL_PLATFORM_NAME based
10153 on PLATFORM_NAME to work around the missing definition on Tiger.
10154 Updated HAVE_DTRACE to use REAL_PLATFORM_NAME.
10155
10156 2009-03-03 Kevin McCullough <kmccullough@apple.com>
10157
10158 Reviewed by Oliver Hunt.
10159
10160 <rdar://problem/6639110> console.profile() doesn't work without a title
10161
10162 * profiler/Profiler.cpp:
10163 (JSC::Profiler::startProfiling): assert if there is not title to ensure
10164 we don't start profiling without one.
10165
10166 2009-03-02 Sam Weinig <sam@webkit.org>
10167
10168 Reviewed by Mark Rowe.
10169
10170 Enable Geolocation (except on Tiger and Leopard).
10171
10172 * Configurations/JavaScriptCore.xcconfig:
10173
10174 2009-03-01 David Kilzer <ddkilzer@apple.com>
10175
10176 <rdar://problem/6635688> Move HAVE_DTRACE check to Base.xcconfig
10177
10178 Reviewed by Mark Rowe.
10179
10180 * Configurations/Base.xcconfig: Set HAVE_DTRACE Xcode variable
10181 based on PLATFORM_NAME and MAC_OS_X_VERSION_MAJOR. Also define
10182 it as a preprocessor macro by modifying
10183 GCC_PREPROCESSOR_DEFINITIONS.
10184 * JavaScriptCore.xcodeproj/project.pbxproj: Changed "Generate
10185 DTrace header" script phase to check for HAVE_DTRACE instead of
10186 MACOSX_DEPLOYMENT_TARGET.
10187 * wtf/Platform.h: Removed definition of HAVE_DTRACE macro since
10188 it's defined in Base.xcconfig now.
10189
10190 2009-03-01 Horia Olaru <olaru@adobe.com>
10191
10192 By looking in grammar.y there are only a few types of statement nodes
10193 on which the debugger should stop.
10194
10195 Removed isBlock and isLoop virtual calls. No need to emit debug hooks in
10196 the "statementListEmitCode" method as long as the necessary hooks can be
10197 added in each "emitCode".
10198
10199 https://bugs.webkit.org/show_bug.cgi?id=21073
10200
10201 Reviewed by Kevin McCullough.
10202
10203 * parser/Nodes.cpp:
10204 (JSC::ConstStatementNode::emitBytecode):
10205 (JSC::statementListEmitCode):
10206 (JSC::EmptyStatementNode::emitBytecode):
10207 (JSC::ExprStatementNode::emitBytecode):
10208 (JSC::VarStatementNode::emitBytecode):
10209 (JSC::IfNode::emitBytecode):
10210 (JSC::IfElseNode::emitBytecode):
10211 (JSC::DoWhileNode::emitBytecode):
10212 (JSC::WhileNode::emitBytecode):
10213 (JSC::ForNode::emitBytecode):
10214 (JSC::ForInNode::emitBytecode):
10215 (JSC::ContinueNode::emitBytecode):
10216 (JSC::BreakNode::emitBytecode):
10217 (JSC::ReturnNode::emitBytecode):
10218 (JSC::WithNode::emitBytecode):
10219 (JSC::SwitchNode::emitBytecode):
10220 (JSC::LabelNode::emitBytecode):
10221 (JSC::ThrowNode::emitBytecode):
10222 (JSC::TryNode::emitBytecode):
10223 * parser/Nodes.h:
10224
10225 2009-02-26 Gavin Barraclough <barraclough@apple.com>
10226
10227 Reviewed by Geoff Garen.
10228
10229 Fix bug #23614. Switches on double precision values were incorrectly
10230 truncating the scrutinee value. E.g.:
10231
10232 switch (1.1) { case 1: print("FAIL"); }
10233
10234 Was resulting in FAIL.
10235
10236 * interpreter/Interpreter.cpp:
10237 (JSC::Interpreter::privateExecute):
10238 * jit/JITStubs.cpp:
10239 (JSC::JITStubs::cti_op_switch_imm):
10240
10241 2009-02-26 Gavin Barraclough <barraclough@apple.com>
10242
10243 Reviewed by Oliver Hunt.
10244
10245 Integer Immediate representation need not be canonical in x86 JIT code.
10246 On x86-64 we already have loosened the requirement that the int immediate
10247 representation in canonical, we should bring x86 into line.
10248
10249 This patch is a minor (~0.5%) improvement on sunspider & v8-tests, and
10250 should reduce memory footoprint (reduces JIT code size).
10251
10252 * jit/JIT.cpp:
10253 (JSC::JIT::compileOpStrictEq):
10254 (JSC::JIT::privateCompileSlowCases):
10255 * jit/JIT.h:
10256 (JSC::JIT::emitJumpIfImmediateNumber):
10257 (JSC::JIT::emitJumpIfNotImmediateNumber):
10258 * jit/JITArithmetic.cpp:
10259 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
10260 (JSC::JIT::compileBinaryArithOp):
10261
10262 2009-02-26 Carol Szabo <carol.szabo@nokia.com>
10263
10264 Reviewed by Darin Adler.
10265
10266 https://bugs.webkit.org/show_bug.cgi?id=24099
10267 ARM Compiler Warnings in pcre_exec.cpp
10268
10269 * pcre/pcre_exec.cpp:
10270 (match):
10271
10272 2009-02-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>
10273
10274 Reviewed by Gavin Barraclough.
10275
10276 Bug 24086: Regression (r40993): WebKit crashes after logging in to lists.zenbe
10277 <https://bugs.webkit.org/show_bug.cgi?id=24086>
10278 <rdar://problem/6625111>
10279
10280 The numeric sort optimization in r40993 generated bytecode for a function
10281 without generating JIT code. This breaks an assumption in some parts of
10282 the JIT's function calling logic that the presence of a CodeBlock implies
10283 the existence of JIT code.
10284
10285 In order to fix this, we simply generate JIT code whenever we check whether
10286 a function is a numeric sort function. This only incurs an additional cost
10287 in the case when the function is a numeric sort function, in which case it
10288 is not expensive to generate JIT code for it.
10289
10290 * runtime/ArrayPrototype.cpp:
10291 (JSC::isNumericCompareFunction):
10292
10293 2009-02-25 Geoffrey Garen <ggaren@apple.com>
10294
10295 Reviewed by Maciej Stachowiak.
10296
10297 Fixed <rdar://problem/6611174> REGRESSION (r36701): Unable to select
10298 messages on hotmail (24052)
10299
10300 The bug was that for-in enumeration used a cached prototype chain without
10301 validating that it was up-to-date.
10302
10303 This led me to refactor prototype chain caching so it was easier to work
10304 with and harder to get wrong.
10305
10306 After a bit of inlining, this patch is performance-neutral on SunSpider
10307 and the v8 benchmarks.
10308
10309 * interpreter/Interpreter.cpp:
10310 (JSC::Interpreter::tryCachePutByID):
10311 (JSC::Interpreter::tryCacheGetByID):
10312 * jit/JITStubs.cpp:
10313 (JSC::JITStubs::tryCachePutByID):
10314 (JSC::JITStubs::tryCacheGetByID):
10315 (JSC::JITStubs::cti_op_get_by_id_proto_list): Use the new refactored goodness. See
10316 lines beginning with "-" and smile.
10317
10318 * runtime/JSGlobalObject.h:
10319 (JSC::Structure::prototypeForLookup): A shout out to const.
10320
10321 * runtime/JSPropertyNameIterator.h:
10322 (JSC::JSPropertyNameIterator::next): We can use a pointer comparison to
10323 see if our cached structure chain is equal to the object's structure chain,
10324 since in the case of a cache hit, we share references to the same structure
10325 chain.
10326
10327 * runtime/Operations.h:
10328 (JSC::countPrototypeChainEntriesAndCheckForProxies): Use the new refactored
10329 goodness.
10330
10331 * runtime/PropertyNameArray.h:
10332 (JSC::PropertyNameArray::PropertyNameArray):
10333 (JSC::PropertyNameArray::setShouldCache):
10334 (JSC::PropertyNameArray::shouldCache): Renamed "cacheable" to "shouldCache"
10335 to communicate that the client is specifying a recommendation, not a
10336 capability.
10337
10338 * runtime/Structure.cpp:
10339 (JSC::Structure::Structure): No need to initialize a RefPtr.
10340 (JSC::Structure::getEnumerablePropertyNames): Moved some code into helper
10341 functions.
10342
10343 (JSC::Structure::prototypeChain): New centralized accessor for a prototype
10344 chain. Revalidates on every access, since the objects in the prototype
10345 chain may have mutated.
10346
10347 (JSC::Structure::isValid): Helper function for revalidating a cached
10348 prototype chain.
10349
10350 (JSC::Structure::getEnumerableNamesFromPropertyTable):
10351 (JSC::Structure::getEnumerableNamesFromClassInfoTable): Factored out of
10352 getEnumerablePropertyNames.
10353
10354 * runtime/Structure.h:
10355
10356 * runtime/StructureChain.cpp:
10357 (JSC::StructureChain::StructureChain):
10358 * runtime/StructureChain.h:
10359 (JSC::StructureChain::create): No need for structureChainsAreEqual, since
10360 we use pointer equality now. Refactored StructureChain to make a little
10361 more sense and eliminate special cases for null prototypes.
10362
10363 2009-02-25 Steve Falkenburg <sfalken@apple.com>
10364
10365 Use timeBeginPeriod to enable timing resolution greater than 16ms in command line jsc for Windows.
10366 Allows more accurate reporting of benchmark times via command line jsc.exe. Doesn't affect WebKit's use of JavaScriptCore.
10367
10368 Reviewed by Adam Roben.
10369
10370 * jsc.cpp:
10371 (main):
10372
10373 2009-02-24 Geoffrey Garen <ggaren@apple.com>
10374
10375 Build fix?
10376
10377 * GNUmakefile.am:
10378
10379 2009-02-24 Mark Rowe <mrowe@apple.com>
10380
10381 Reviewed by Oliver Hunt.
10382
10383 <rdar://problem/6259220> Rename AVAILABLE_AFTER_WEBKIT_VERSION_3_1 (etc.) to match the other macros
10384
10385 * API/JSBasePrivate.h:
10386 * API/JSContextRef.h:
10387 * API/JSObjectRef.h:
10388 * API/WebKitAvailability.h:
10389
10390 2009-02-23 Geoffrey Garen <ggaren@apple.com>
10391
10392 Reviewed by Sam Weinig.
10393
10394 Next step in splitting JIT functionality out of the Interpreter class:
10395 Moved vptr storage from Interpreter to JSGlobalData, so it could be shared
10396 between Interpreter and JITStubs, and moved the *Trampoline JIT stubs
10397 into the JITStubs class. Also added a VPtrSet class to encapsulate vptr
10398 hacks during JSGlobalData initialization.
10399
10400 SunSpider says 0.4% faster. Meh.
10401
10402 * JavaScriptCore.exp:
10403 * JavaScriptCore.xcodeproj/project.pbxproj:
10404 * interpreter/Interpreter.cpp:
10405 (JSC::Interpreter::Interpreter):
10406 (JSC::Interpreter::tryCacheGetByID):
10407 (JSC::Interpreter::privateExecute):
10408 * interpreter/Interpreter.h:
10409 * jit/JIT.cpp:
10410 (JSC::JIT::privateCompileMainPass):
10411 (JSC::JIT::privateCompile):
10412 (JSC::JIT::privateCompileCTIMachineTrampolines):
10413 * jit/JIT.h:
10414 (JSC::JIT::compileCTIMachineTrampolines):
10415 * jit/JITCall.cpp:
10416 (JSC::JIT::compileOpCall):
10417 (JSC::JIT::compileOpCallSlowCase):
10418 * jit/JITPropertyAccess.cpp:
10419 (JSC::JIT::privateCompilePatchGetArrayLength):
10420 * jit/JITStubs.cpp:
10421 (JSC::JITStubs::JITStubs):
10422 (JSC::JITStubs::tryCacheGetByID):
10423 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
10424 (JSC::JITStubs::cti_op_get_by_val):
10425 (JSC::JITStubs::cti_op_get_by_val_byte_array):
10426 (JSC::JITStubs::cti_op_put_by_val):
10427 (JSC::JITStubs::cti_op_put_by_val_array):
10428 (JSC::JITStubs::cti_op_put_by_val_byte_array):
10429 (JSC::JITStubs::cti_op_is_string):
10430 * jit/JITStubs.h:
10431 (JSC::JITStubs::ctiArrayLengthTrampoline):
10432 (JSC::JITStubs::ctiStringLengthTrampoline):
10433 (JSC::JITStubs::ctiVirtualCallPreLink):
10434 (JSC::JITStubs::ctiVirtualCallLink):
10435 (JSC::JITStubs::ctiVirtualCall):
10436 * runtime/ArrayPrototype.cpp:
10437 (JSC::arrayProtoFuncPop):
10438 (JSC::arrayProtoFuncPush):
10439 * runtime/FunctionPrototype.cpp:
10440 (JSC::functionProtoFuncApply):
10441 * runtime/JSArray.h:
10442 (JSC::isJSArray):
10443 * runtime/JSByteArray.h:
10444 (JSC::asByteArray):
10445 (JSC::isJSByteArray):
10446 * runtime/JSCell.h:
10447 * runtime/JSFunction.h:
10448 * runtime/JSGlobalData.cpp:
10449 (JSC::VPtrSet::VPtrSet):
10450 (JSC::JSGlobalData::JSGlobalData):
10451 (JSC::JSGlobalData::create):
10452 (JSC::JSGlobalData::sharedInstance):
10453 * runtime/JSGlobalData.h:
10454 * runtime/JSString.h:
10455 (JSC::isJSString):
10456 * runtime/Operations.h:
10457 (JSC::jsLess):
10458 (JSC::jsLessEq):
10459 * wrec/WREC.cpp:
10460 (JSC::WREC::Generator::compileRegExp):
10461
10462 2009-02-23 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
10463
10464 Reviewed by Oliver Hunt.
10465
10466 Bug 23787: Allow JIT to generate SSE2 code if using GCC
10467 <https://bugs.webkit.org/show_bug.cgi?id=23787>
10468
10469 GCC version of the cpuid check.
10470
10471 * jit/JITArithmetic.cpp:
10472 (JSC::isSSE2Present): previous assembly code fixed.
10473
10474 2009-02-23 David Levin <levin@chromium.org>
10475
10476 Reviewed by Alexey Proskuryakov.
10477
10478 Bug 24047: Need to simplify nested if's in WorkerRunLoop::runInMode
10479 <https://bugs.webkit.org/show_bug.cgi?id=24047>
10480
10481 * wtf/MessageQueue.h:
10482 (WTF::MessageQueue::infiniteTime):
10483 Allows for one to call waitForMessageFilteredWithTimeout and wait forever.
10484
10485 (WTF::MessageQueue::alwaysTruePredicate):
10486 (WTF::MessageQueue::waitForMessage):
10487 Made waitForMessage call waitForMessageFilteredWithTimeout, so that there is less
10488 duplicate code.
10489
10490 (WTF::MessageQueue::waitForMessageFilteredWithTimeout):
10491
10492 * wtf/ThreadingQt.cpp:
10493 (WTF::ThreadCondition::timedWait):
10494 * wtf/ThreadingWin.cpp:
10495 (WTF::ThreadCondition::timedWait):
10496 Made these two implementations consistent with the pthread and gtk implementations.
10497 Currently, the time calculations would overflow when passed large values.
10498
10499 2009-02-23 Jeremy Moskovich <jeremy@chromium.org>
10500
10501 Reviewed by Adam Roben.
10502
10503 https://bugs.webkit.org/show_bug.cgi?id=24096
10504 PLATFORM(MAC)->PLATFORM(CF) since we want to use the CF functions in Chrome on OS X.
10505
10506 * wtf/CurrentTime.cpp:
10507
10508 2009-02-22 Geoffrey Garen <ggaren@apple.com>
10509
10510 Build fix?
10511
10512 * GNUmakefile.am:
10513
10514 2009-02-22 Geoffrey Garen <ggaren@apple.com>
10515
10516 Build fix.
10517
10518 * GNUmakefile.am:
10519
10520 2009-02-22 Geoffrey Garen <ggaren@apple.com>
10521
10522 Reviewed by Sam Weinig.
10523
10524 Next step in splitting JIT functionality out of the Interpreter class:
10525 Created a JITStubs class and renamed Interpreter::cti_* to JITStubs::cti_*.
10526
10527 Also, moved timeout checking into its own class, located in JSGlobalData,
10528 so both the Interpreter and the JIT could have access to it.
10529
10530 * JavaScriptCore.exp:
10531 * JavaScriptCore.pri:
10532 * JavaScriptCore.scons:
10533 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10534 * JavaScriptCore.xcodeproj/project.pbxproj:
10535 * JavaScriptCoreSources.bkl:
10536 * interpreter/CallFrame.h:
10537 * interpreter/Interpreter.cpp:
10538 (JSC::Interpreter::Interpreter):
10539 (JSC::Interpreter::privateExecute):
10540 * interpreter/Interpreter.h:
10541 * interpreter/Register.h:
10542 * jit/JIT.cpp:
10543 (JSC::):
10544 (JSC::JIT::emitTimeoutCheck):
10545 (JSC::JIT::privateCompileMainPass):
10546 (JSC::JIT::privateCompileSlowCases):
10547 (JSC::JIT::privateCompile):
10548 (JSC::JIT::privateCompileCTIMachineTrampolines):
10549 * jit/JIT.h:
10550 * jit/JITArithmetic.cpp:
10551 (JSC::JIT::compileFastArithSlow_op_lshift):
10552 (JSC::JIT::compileFastArithSlow_op_rshift):
10553 (JSC::JIT::compileFastArithSlow_op_bitand):
10554 (JSC::JIT::compileFastArithSlow_op_mod):
10555 (JSC::JIT::compileFastArith_op_mod):
10556 (JSC::JIT::compileFastArithSlow_op_post_inc):
10557 (JSC::JIT::compileFastArithSlow_op_post_dec):
10558 (JSC::JIT::compileFastArithSlow_op_pre_inc):
10559 (JSC::JIT::compileFastArithSlow_op_pre_dec):
10560 (JSC::JIT::compileFastArith_op_add):
10561 (JSC::JIT::compileFastArith_op_mul):
10562 (JSC::JIT::compileFastArith_op_sub):
10563 (JSC::JIT::compileBinaryArithOpSlowCase):
10564 (JSC::JIT::compileFastArithSlow_op_add):
10565 (JSC::JIT::compileFastArithSlow_op_mul):
10566 * jit/JITCall.cpp:
10567 (JSC::JIT::compileOpCall):
10568 (JSC::JIT::compileOpCallSlowCase):
10569 * jit/JITPropertyAccess.cpp:
10570 (JSC::JIT::compileGetByIdHotPath):
10571 (JSC::JIT::compilePutByIdHotPath):
10572 (JSC::JIT::compileGetByIdSlowCase):
10573 (JSC::JIT::compilePutByIdSlowCase):
10574 (JSC::JIT::privateCompilePutByIdTransition):
10575 (JSC::JIT::patchGetByIdSelf):
10576 (JSC::JIT::patchPutByIdReplace):
10577 (JSC::JIT::privateCompilePatchGetArrayLength):
10578 (JSC::JIT::privateCompileGetByIdSelf):
10579 (JSC::JIT::privateCompileGetByIdProto):
10580 (JSC::JIT::privateCompileGetByIdChain):
10581 (JSC::JIT::privateCompilePutByIdReplace):
10582 * jit/JITStubs.cpp:
10583 (JSC::JITStubs::tryCachePutByID):
10584 (JSC::JITStubs::tryCacheGetByID):
10585 (JSC::JITStubs::cti_op_convert_this):
10586 (JSC::JITStubs::cti_op_end):
10587 (JSC::JITStubs::cti_op_add):
10588 (JSC::JITStubs::cti_op_pre_inc):
10589 (JSC::JITStubs::cti_timeout_check):
10590 (JSC::JITStubs::cti_register_file_check):
10591 (JSC::JITStubs::cti_op_loop_if_less):
10592 (JSC::JITStubs::cti_op_loop_if_lesseq):
10593 (JSC::JITStubs::cti_op_new_object):
10594 (JSC::JITStubs::cti_op_put_by_id_generic):
10595 (JSC::JITStubs::cti_op_get_by_id_generic):
10596 (JSC::JITStubs::cti_op_put_by_id):
10597 (JSC::JITStubs::cti_op_put_by_id_second):
10598 (JSC::JITStubs::cti_op_put_by_id_fail):
10599 (JSC::JITStubs::cti_op_get_by_id):
10600 (JSC::JITStubs::cti_op_get_by_id_second):
10601 (JSC::JITStubs::cti_op_get_by_id_self_fail):
10602 (JSC::JITStubs::cti_op_get_by_id_proto_list):
10603 (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
10604 (JSC::JITStubs::cti_op_get_by_id_proto_fail):
10605 (JSC::JITStubs::cti_op_get_by_id_array_fail):
10606 (JSC::JITStubs::cti_op_get_by_id_string_fail):
10607 (JSC::JITStubs::cti_op_instanceof):
10608 (JSC::JITStubs::cti_op_del_by_id):
10609 (JSC::JITStubs::cti_op_mul):
10610 (JSC::JITStubs::cti_op_new_func):
10611 (JSC::JITStubs::cti_op_call_JSFunction):
10612 (JSC::JITStubs::cti_op_call_arityCheck):
10613 (JSC::JITStubs::cti_vm_dontLazyLinkCall):
10614 (JSC::JITStubs::cti_vm_lazyLinkCall):
10615 (JSC::JITStubs::cti_op_push_activation):
10616 (JSC::JITStubs::cti_op_call_NotJSFunction):
10617 (JSC::JITStubs::cti_op_create_arguments):
10618 (JSC::JITStubs::cti_op_create_arguments_no_params):
10619 (JSC::JITStubs::cti_op_tear_off_activation):
10620 (JSC::JITStubs::cti_op_tear_off_arguments):
10621 (JSC::JITStubs::cti_op_profile_will_call):
10622 (JSC::JITStubs::cti_op_profile_did_call):
10623 (JSC::JITStubs::cti_op_ret_scopeChain):
10624 (JSC::JITStubs::cti_op_new_array):
10625 (JSC::JITStubs::cti_op_resolve):
10626 (JSC::JITStubs::cti_op_construct_JSConstruct):
10627 (JSC::JITStubs::cti_op_construct_NotJSConstruct):
10628 (JSC::JITStubs::cti_op_get_by_val):
10629 (JSC::JITStubs::cti_op_get_by_val_byte_array):
10630 (JSC::JITStubs::cti_op_resolve_func):
10631 (JSC::JITStubs::cti_op_sub):
10632 (JSC::JITStubs::cti_op_put_by_val):
10633 (JSC::JITStubs::cti_op_put_by_val_array):
10634 (JSC::JITStubs::cti_op_put_by_val_byte_array):
10635 (JSC::JITStubs::cti_op_lesseq):
10636 (JSC::JITStubs::cti_op_loop_if_true):
10637 (JSC::JITStubs::cti_op_negate):
10638 (JSC::JITStubs::cti_op_resolve_base):
10639 (JSC::JITStubs::cti_op_resolve_skip):
10640 (JSC::JITStubs::cti_op_resolve_global):
10641 (JSC::JITStubs::cti_op_div):
10642 (JSC::JITStubs::cti_op_pre_dec):
10643 (JSC::JITStubs::cti_op_jless):
10644 (JSC::JITStubs::cti_op_not):
10645 (JSC::JITStubs::cti_op_jtrue):
10646 (JSC::JITStubs::cti_op_post_inc):
10647 (JSC::JITStubs::cti_op_eq):
10648 (JSC::JITStubs::cti_op_lshift):
10649 (JSC::JITStubs::cti_op_bitand):
10650 (JSC::JITStubs::cti_op_rshift):
10651 (JSC::JITStubs::cti_op_bitnot):
10652 (JSC::JITStubs::cti_op_resolve_with_base):
10653 (JSC::JITStubs::cti_op_new_func_exp):
10654 (JSC::JITStubs::cti_op_mod):
10655 (JSC::JITStubs::cti_op_less):
10656 (JSC::JITStubs::cti_op_neq):
10657 (JSC::JITStubs::cti_op_post_dec):
10658 (JSC::JITStubs::cti_op_urshift):
10659 (JSC::JITStubs::cti_op_bitxor):
10660 (JSC::JITStubs::cti_op_new_regexp):
10661 (JSC::JITStubs::cti_op_bitor):
10662 (JSC::JITStubs::cti_op_call_eval):
10663 (JSC::JITStubs::cti_op_throw):
10664 (JSC::JITStubs::cti_op_get_pnames):
10665 (JSC::JITStubs::cti_op_next_pname):
10666 (JSC::JITStubs::cti_op_push_scope):
10667 (JSC::JITStubs::cti_op_pop_scope):
10668 (JSC::JITStubs::cti_op_typeof):
10669 (JSC::JITStubs::cti_op_is_undefined):
10670 (JSC::JITStubs::cti_op_is_boolean):
10671 (JSC::JITStubs::cti_op_is_number):
10672 (JSC::JITStubs::cti_op_is_string):
10673 (JSC::JITStubs::cti_op_is_object):
10674 (JSC::JITStubs::cti_op_is_function):
10675 (JSC::JITStubs::cti_op_stricteq):
10676 (JSC::JITStubs::cti_op_nstricteq):
10677 (JSC::JITStubs::cti_op_to_jsnumber):
10678 (JSC::JITStubs::cti_op_in):
10679 (JSC::JITStubs::cti_op_push_new_scope):
10680 (JSC::JITStubs::cti_op_jmp_scopes):
10681 (JSC::JITStubs::cti_op_put_by_index):
10682 (JSC::JITStubs::cti_op_switch_imm):
10683 (JSC::JITStubs::cti_op_switch_char):
10684 (JSC::JITStubs::cti_op_switch_string):
10685 (JSC::JITStubs::cti_op_del_by_val):
10686 (JSC::JITStubs::cti_op_put_getter):
10687 (JSC::JITStubs::cti_op_put_setter):
10688 (JSC::JITStubs::cti_op_new_error):
10689 (JSC::JITStubs::cti_op_debug):
10690 (JSC::JITStubs::cti_vm_throw):
10691 * jit/JITStubs.h:
10692 (JSC::):
10693 * runtime/JSFunction.h:
10694 * runtime/JSGlobalData.cpp:
10695 (JSC::JSGlobalData::JSGlobalData):
10696 * runtime/JSGlobalData.h:
10697 * runtime/JSGlobalObject.cpp:
10698 * runtime/JSGlobalObject.h:
10699 * runtime/TimeoutChecker.cpp: Copied from interpreter/Interpreter.cpp.
10700 (JSC::TimeoutChecker::TimeoutChecker):
10701 (JSC::TimeoutChecker::reset):
10702 (JSC::TimeoutChecker::didTimeOut):
10703 * runtime/TimeoutChecker.h: Copied from interpreter/Interpreter.h.
10704 (JSC::TimeoutChecker::setTimeoutInterval):
10705 (JSC::TimeoutChecker::ticksUntilNextCheck):
10706 (JSC::TimeoutChecker::start):
10707 (JSC::TimeoutChecker::stop):
10708
10709 2009-02-20 Gustavo Noronha Silva <gns@gnome.org>
10710
10711 Unreviewed build fix after r41100.
10712
10713 * GNUmakefile.am:
10714
10715 2009-02-20 Oliver Hunt <oliver@apple.com>
10716
10717 Reviewed by Mark Rowe.
10718
10719 <rdar://problem/6606660> 2==null returns true in 64bit jit
10720
10721 Code for op_eq_null and op_neq_null was incorrectly performing
10722 a 32bit compare, which truncated the type tag from an integer
10723 immediate, leading to incorrect behaviour.
10724
10725 * assembler/MacroAssembler.h:
10726 (JSC::MacroAssembler::setPtr):
10727 * assembler/MacroAssemblerX86_64.h:
10728 (JSC::MacroAssemblerX86_64::setPtr):
10729 * jit/JIT.cpp:
10730 (JSC::JIT::privateCompileMainPass):
10731
10732 2009-02-19 Geoffrey Garen <ggaren@apple.com>
10733
10734 Reviewed by Gavin Barraclough.
10735
10736 First step in splitting JIT functionality out of the Interpreter class:
10737 Created JITStubs.h/.cpp, and moved Interpreter::cti_* into JITStubs.cpp.
10738
10739 Functions that the Interpreter and JITStubs share moved to Operations.h/.cpp.
10740
10741 * GNUmakefile.am:
10742 * JavaScriptCore.pri:
10743 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10744 * JavaScriptCore.xcodeproj/project.pbxproj:
10745 * interpreter/Interpreter.cpp:
10746 (JSC::Interpreter::resolveBase):
10747 (JSC::Interpreter::checkTimeout):
10748 (JSC::Interpreter::privateExecute):
10749 * interpreter/Interpreter.h:
10750 * jit/JITStubs.cpp: Copied from interpreter/Interpreter.cpp.
10751 (JSC::Interpreter::cti_op_resolve_base):
10752 * jit/JITStubs.h: Copied from interpreter/Interpreter.h.
10753 * runtime/Operations.cpp:
10754 (JSC::jsAddSlowCase):
10755 (JSC::jsTypeStringForValue):
10756 (JSC::jsIsObjectType):
10757 (JSC::jsIsFunctionType):
10758 * runtime/Operations.h:
10759 (JSC::jsLess):
10760 (JSC::jsLessEq):
10761 (JSC::jsAdd):
10762 (JSC::cachePrototypeChain):
10763 (JSC::countPrototypeChainEntriesAndCheckForProxies):
10764 (JSC::resolveBase):
10765
10766 2009-02-19 Gavin Barraclough <barraclough@apple.com>
10767
10768 Reviewed by Oliver Hunt.
10769
10770 Fix for x86-64. Where the JavaScriptCore text segment lies outside
10771 a 2gb range of the heap containing JIT generated code, callbacks
10772 from JIT code to the stub functions in Interpreter will be incorrectly
10773 linked.
10774
10775 No performance impact on Sunspider, 1% regression on v8-tests,
10776 due to a 3% regression on richards.
10777
10778 * assembler/AbstractMacroAssembler.h:
10779 (JSC::AbstractMacroAssembler::Call::Call):
10780 (JSC::AbstractMacroAssembler::Jump::link):
10781 (JSC::AbstractMacroAssembler::Jump::linkTo):
10782 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
10783 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
10784 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
10785 (JSC::AbstractMacroAssembler::PatchBuffer::link):
10786 (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
10787 (JSC::AbstractMacroAssembler::differenceBetween):
10788 * assembler/MacroAssembler.h:
10789 (JSC::MacroAssembler::tailRecursiveCall):
10790 (JSC::MacroAssembler::makeTailRecursiveCall):
10791 * assembler/MacroAssemblerX86.h:
10792 (JSC::MacroAssemblerX86::call):
10793 * assembler/MacroAssemblerX86Common.h:
10794 * assembler/MacroAssemblerX86_64.h:
10795 (JSC::MacroAssemblerX86_64::call):
10796 (JSC::MacroAssemblerX86_64::moveWithPatch):
10797 (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
10798 (JSC::MacroAssemblerX86_64::storePtrWithPatch):
10799 * assembler/X86Assembler.h:
10800 (JSC::X86Assembler::jmp_r):
10801 (JSC::X86Assembler::linkJump):
10802 (JSC::X86Assembler::patchJump):
10803 (JSC::X86Assembler::patchCall):
10804 (JSC::X86Assembler::linkCall):
10805 (JSC::X86Assembler::patchAddress):
10806 * interpreter/Interpreter.cpp:
10807 (JSC::Interpreter::tryCTICachePutByID):
10808 * jit/JIT.cpp:
10809 (JSC::JIT::privateCompile):
10810 (JSC::JIT::privateCompileCTIMachineTrampolines):
10811 * jit/JIT.h:
10812 * jit/JITArithmetic.cpp:
10813 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
10814 (JSC::JIT::compileBinaryArithOp):
10815 * jit/JITPropertyAccess.cpp:
10816 (JSC::JIT::privateCompilePutByIdTransition):
10817 (JSC::JIT::privateCompileGetByIdSelf):
10818 (JSC::JIT::privateCompilePutByIdReplace):
10819
10820 2009-02-18 Geoffrey Garen <ggaren@apple.com>
10821
10822 Reviewed by Oliver Hunt.
10823
10824 Simplified .call and .apply in preparation for optimizing them. Also,
10825 a little cleanup.
10826
10827 * runtime/FunctionPrototype.cpp:
10828 (JSC::functionProtoFuncApply):
10829 (JSC::functionProtoFuncCall): No need to do any specific conversion on
10830 'this' -- op_convert_this will do it if necessary.
10831
10832 * runtime/JSImmediate.cpp:
10833 (JSC::JSImmediate::toThisObject): Slightly relaxed the rules on
10834 toThisObject to allow for 'undefined', which can be passed through
10835 .call and .apply.
10836
10837 2009-02-19 David Levin <levin@chromium.org>
10838
10839 Reviewed by Alexey Proskuryakov.
10840
10841 Bug 23976: MessageQueue needs a way to wait for a message that satisfies an arbitrary criteria.
10842 <https://bugs.webkit.org/show_bug.cgi?id=23976>
10843
10844 * wtf/Deque.h:
10845 (WTF::Deque<T>::findIf):
10846 * wtf/MessageQueue.h:
10847 (WTF::MessageQueue<T>::waitForMessageFiltered):
10848
10849 2009-02-18 David Levin <levin@chromium.org>
10850
10851 Reviewed by Alexey Proskuryakov.
10852
10853 Bug 23974: Deque::Remove would be a useful method.
10854 <https://bugs.webkit.org/show_bug.cgi?id=23974>
10855
10856 Add Deque::remove and DequeIteratorBase<T>::operator=.
10857
10858 Why was operator= added? Every concrete iterator (DequeIterator..DequeConstReverseIterator)
10859 was calling DequeIteratorBase::assign(), which called Base::operator=(). Base::operator=()
10860 was not implemented. This went unnoticed because the iterator copy code has been unused.
10861
10862 * wtf/Deque.h:
10863 (WTF::Deque<T>::remove):
10864 (WTF::DequeIteratorBase<T>::removeFromIteratorsList):
10865 (WTF::DequeIteratorBase<T>::operator=):
10866 (WTF::DequeIteratorBase<T>::~DequeIteratorBase):
10867
10868 2009-02-18 Gustavo Noronha Silva <gns@gnome.org>
10869
10870 Reviewed by Holger Freyther.
10871
10872 Fix symbols.filter location, and add other missing files to the
10873 autotools build, so that make dist works.
10874
10875 * GNUmakefile.am:
10876
10877 2009-02-17 Geoffrey Garen <ggaren@apple.com>
10878
10879 Reviewed by Sam Weinig.
10880
10881 Fixed failure in js1_5/Regress/regress-168347.js, as seen on the Oliver
10882 bot.
10883
10884 Technically, both behaviors are OK, but we might as well keep this test
10885 passing.
10886
10887 * runtime/FunctionPrototype.cpp:
10888 (JSC::insertSemicolonIfNeeded): No need to add a trailing semicolon
10889 after a trailing '}', since '}' ends a block, indicating the end of a
10890 statement.
10891
10892 2009-02-17 Geoffrey Garen <ggaren@apple.com>
10893
10894 Build fix.
10895
10896 * runtime/FunctionPrototype.cpp:
10897
10898 2009-02-17 Oliver Hunt <oliver@apple.com>
10899
10900 Reviewed by Geoff Garen.
10901
10902 Add assertion to guard against oversized pc relative calls.
10903
10904 * assembler/X86Assembler.h:
10905 (JSC::X86Assembler::link):
10906
10907 2009-02-17 Geoffrey Garen <ggaren@apple.com>
10908
10909 Reviewed by Sam Weinig.
10910
10911 Fixed <rdar://problem/6595040> REGRESSION: http://www.amnestyusa.org/
10912 fails to load.
10913
10914 amnestyusa.org uses the Optimist JavaScript library, which adds event
10915 listeners by concatenating string-ified functions. This is only sure to
10916 be syntactically valid if the string-ified functions end in semicolons.
10917
10918 * parser/Lexer.cpp:
10919 (JSC::Lexer::isWhiteSpace):
10920 * parser/Lexer.h:
10921 (JSC::Lexer::isWhiteSpace):
10922 (JSC::Lexer::isLineTerminator): Added some helper functions for examining
10923 whitespace.
10924
10925 * runtime/FunctionPrototype.cpp:
10926 (JSC::appendSemicolonIfNeeded):
10927 (JSC::functionProtoFuncToString): When string-ifying a function, insert
10928 a semicolon in the last non-whitespace position, if one doesn't already exist.
10929
10930 2009-02-16 Oliver Hunt <oliver@apple.com>
10931
10932 Reviewed by NOBODY (Build fix).
10933
10934 Roll out r41022 as it breaks qt and gtk builds
10935
10936 * jit/JITArithmetic.cpp:
10937 (JSC::isSSE2Present):
10938
10939 2009-02-16 Sam Weinig <sam@webkit.org>
10940
10941 Reviewed by Geoffrey Garen.
10942
10943 Fix for <rdar://problem/6468156>
10944 REGRESSION (r36779): Adding link, images, flash in TinyMCE blocks entire page (21382)
10945
10946 No performance regression.
10947
10948 * runtime/Arguments.cpp:
10949 (JSC::Arguments::fillArgList): Add codepath for when the "length" property has been
10950 overridden.
10951
10952 2009-02-16 Mark Rowe <mrowe@apple.com>
10953
10954 Build fix.
10955
10956 * wtf/FastMalloc.cpp:
10957 (WTF::TCMallocStats::):
10958 (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
10959
10960 2009-02-16 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
10961
10962 Reviewed by Oliver Hunt.
10963
10964 Bug 23787: Allow JIT to generate SSE2 code if using GCC
10965 <https://bugs.webkit.org/show_bug.cgi?id=23787>
10966
10967 GCC version of the cpuid check.
10968
10969 * jit/JITArithmetic.cpp:
10970 (JSC::isSSE2Present): GCC assembly code added.
10971 6.6% progression on x86 Linux with JIT and WREC on SunSpider if using SSE2 capable machine.
10972
10973 2009-02-13 Adam Treat <adam.treat@torchmobile.com>
10974
10975 Reviewed by George Staikos.
10976
10977 https://bugs.webkit.org/show_bug.cgi?id=23960
10978 Crash Fix.
10979
10980 Don't depend on 'initializeThreading()' to come before a call to 'isMainThread()'
10981 as QtWebKit only calls 'initializeThreading()' during QWebPage construction.
10982
10983 A client app may well make a call to QWebSettings::iconForUrl() for instance
10984 before creating a QWebPage and that call to QWebSettings triggers an
10985 ASSERT(isMainThread()) deep within WebCore.
10986
10987 * wtf/ThreadingQt.cpp:
10988 (WTF::isMainThread):
10989
10990 2009-02-13 Gavin Barraclough <barraclough@apple.com>
10991
10992 Reviewed by Darin Adler.
10993
10994 Some data in the instruction stream is potentially uninitialized - fix this.
10995
10996 Change the OperandTypes constructor so that uninitialized memory in the int
10997 is zeroed, and modify the Instruction constructor taking an Opcode so that
10998 if !HAVE(COMPUTED_GOTO) (i.e. when Opcode is an enum, and is potentially only
10999 a byte) it zeros the Instruction first before writing the opcode.
11000
11001 * bytecode/Instruction.h:
11002 (JSC::Instruction::Instruction):
11003 * parser/ResultType.h:
11004 (JSC::OperandTypes::OperandTypes):
11005
11006 2009-02-13 Geoffrey Garen <ggaren@apple.com>
11007
11008 Build fix for non_JIT platforms.
11009
11010 * bytecode/CodeBlock.h:
11011 (JSC::CodeBlock::setIsNumericCompareFunction):
11012 (JSC::CodeBlock::isNumericCompareFunction):
11013
11014 2009-02-13 Geoffrey Garen <ggaren@apple.com>
11015
11016 Reviewed by Darin Adler.
11017
11018 Fixed <rdar://problem/6584057> Optimize sort by JS numeric comparison
11019 function not to run the comparison function
11020
11021 * bytecode/CodeBlock.cpp:
11022 (JSC::CodeBlock::CodeBlock):
11023 * bytecode/CodeBlock.h:
11024 (JSC::CodeBlock::setIsNumericCompareFunction):
11025 (JSC::CodeBlock::isNumericCompareFunction): Added the ability to track
11026 whether a CodeBlock performs a sort-like numeric comparison.
11027
11028 * bytecompiler/BytecodeGenerator.cpp:
11029 (JSC::BytecodeGenerator::generate): Set the isNumericCompareFunction bit
11030 after compiling.
11031
11032 * parser/Nodes.cpp:
11033 (JSC::FunctionBodyNode::emitBytecode): Fixed a bug that caused us to
11034 codegen an extra return at the end of all functions (eek!), since this
11035 made it harder / weirder to detect the numeric comparison pattern in
11036 bytecode.
11037
11038 * runtime/ArrayPrototype.cpp:
11039 (JSC::arrayProtoFuncSort): Use the isNumericCompareFunction bit to do
11040 a faster sort if we can.
11041
11042 * runtime/FunctionConstructor.cpp:
11043 (JSC::extractFunctionBody):
11044 (JSC::constructFunction):
11045 * runtime/FunctionConstructor.h: Renamed and exported extractFunctionBody for
11046 use in initializing lazyNumericCompareFunction.
11047
11048 * runtime/JSArray.cpp:
11049 (JSC::compareNumbersForQSort):
11050 (JSC::compareByStringPairForQSort):
11051 (JSC::JSArray::sortNumeric):
11052 (JSC::JSArray::sort):
11053 * runtime/JSArray.h: Added a fast numeric sort. Renamed ArrayQSortPair
11054 to be more specific since we do different kinds of qsort now.
11055
11056 * runtime/JSGlobalData.cpp:
11057 (JSC::JSGlobalData::JSGlobalData):
11058 (JSC::JSGlobalData::numericCompareFunction):
11059 (JSC::JSGlobalData::ClientData::~ClientData):
11060 * runtime/JSGlobalData.h: Added helper data for computing the
11061 isNumericCompareFunction bit.
11062
11063 2009-02-13 Darin Adler <darin@apple.com>
11064
11065 * Configurations/JavaScriptCore.xcconfig: Undo accidental commit of this file.
11066
11067 2009-02-12 Darin Adler <darin@apple.com>
11068
11069 Reviewed by Oliver Hunt and Alexey Proskuryakov.
11070
11071 Speed up a couple string functions.
11072
11073 * runtime/StringPrototype.cpp:
11074 (JSC::stringProtoFuncIndexOf): Added a fast path for cases where the second
11075 argument is either missing or an integer.
11076 (JSC::stringProtoFuncBig): Use jsNontrivialString since the string is guaranteed
11077 to be 2 or more characters long.
11078 (JSC::stringProtoFuncSmall): Ditto.
11079 (JSC::stringProtoFuncBlink): Ditto.
11080 (JSC::stringProtoFuncBold): Ditto.
11081 (JSC::stringProtoFuncItalics): Ditto.
11082 (JSC::stringProtoFuncStrike): Ditto.
11083 (JSC::stringProtoFuncSub): Ditto.
11084 (JSC::stringProtoFuncSup): Ditto.
11085 (JSC::stringProtoFuncFontcolor): Ditto.
11086 (JSC::stringProtoFuncFontsize): Make the fast path Sam recently added even faster
11087 by avoiding all but the minimum memory allocation.
11088 (JSC::stringProtoFuncAnchor): Use jsNontrivialString.
11089 (JSC::stringProtoFuncLink): Added a fast path.
11090
11091 * runtime/UString.cpp:
11092 (JSC::UString::find): Added a fast path for single-character search strings.
11093
11094 2009-02-13 David Levin <levin@chromium.org>
11095
11096 Reviewed by Darin Adler.
11097
11098 Bug 23926: Race condition in callOnMainThreadAndWait
11099 <https://bugs.webkit.org/show_bug.cgi?id=23926>
11100
11101 * wtf/MainThread.cpp:
11102 Removed callOnMainThreadAndWait since it isn't used.
11103
11104 2009-02-13 Oliver Hunt <oliver@apple.com>
11105
11106 Reviewed by Jon Honeycutt.
11107
11108 Math.random is really slow on windows.
11109
11110 Math.random calls WTF::randomNumber which is implemented as
11111 the secure rand_s on windows. Unfortunately rand_s is an order
11112 of magnitude slower than arc4random. For this reason I've
11113 added "weakRandomNumber" for use by JavaScript's Math Object.
11114 In the long term we should look at using our own secure PRNG
11115 in place of the system, but this will do for now.
11116
11117 30% win on SunSpider on Windows, resolving most of the remaining
11118 disparity vs. Mac.
11119
11120 * runtime/MathObject.cpp:
11121 (JSC::MathObject::MathObject):
11122 (JSC::mathProtoFuncRandom):
11123 * wtf/RandomNumber.cpp:
11124 (WTF::weakRandomNumber):
11125 (WTF::randomNumber):
11126 * wtf/RandomNumber.h:
11127 * wtf/RandomNumberSeed.h:
11128 (WTF::initializeWeakRandomNumberGenerator):
11129
11130 2009-02-12 Mark Rowe <mrowe@apple.com>
11131
11132 Fix the build for other platforms.
11133
11134 * wtf/RandomNumber.cpp:
11135 (WTF::randomNumber):
11136
11137 2009-02-12 Gavin Barraclough <barraclough@apple.com>
11138
11139 Reviewed by Sam Weinig.
11140
11141 Remove (/reduce) use of hard-wired register names from the JIT.
11142 Currently there is no abstraction of registers used in the JIT,
11143 which has a number of negative consequences. Hard-wiring x86
11144 register names makes the JIT less portable to other platforms,
11145 and prevents us from performing dynamic register allocation to
11146 attempt to maintain more temporary values in machine registers.
11147 (The latter will be more important on x86-64, where we have more
11148 registers to make use of).
11149
11150 Also, remove MacroAssembler::mod32. This was not providing a
11151 useful abstraction, and was not in keeping with the rest of the
11152 MacroAssembler interface, in having specific register requirements.
11153
11154 * assembler/MacroAssemblerX86Common.h:
11155 * jit/JIT.cpp:
11156 (JSC::JIT::compileOpStrictEq):
11157 (JSC::JIT::emitSlowScriptCheck):
11158 (JSC::JIT::privateCompileMainPass):
11159 (JSC::JIT::privateCompileSlowCases):
11160 (JSC::JIT::privateCompile):
11161 (JSC::JIT::privateCompileCTIMachineTrampolines):
11162 * jit/JIT.h:
11163 * jit/JITArithmetic.cpp:
11164 (JSC::JIT::compileFastArith_op_lshift):
11165 (JSC::JIT::compileFastArithSlow_op_lshift):
11166 (JSC::JIT::compileFastArith_op_rshift):
11167 (JSC::JIT::compileFastArithSlow_op_rshift):
11168 (JSC::JIT::compileFastArith_op_bitand):
11169 (JSC::JIT::compileFastArithSlow_op_bitand):
11170 (JSC::JIT::compileFastArith_op_mod):
11171 (JSC::JIT::compileFastArithSlow_op_mod):
11172 (JSC::JIT::compileFastArith_op_post_inc):
11173 (JSC::JIT::compileFastArithSlow_op_post_inc):
11174 (JSC::JIT::compileFastArith_op_post_dec):
11175 (JSC::JIT::compileFastArithSlow_op_post_dec):
11176 (JSC::JIT::compileFastArith_op_pre_inc):
11177 (JSC::JIT::compileFastArithSlow_op_pre_inc):
11178 (JSC::JIT::compileFastArith_op_pre_dec):
11179 (JSC::JIT::compileFastArithSlow_op_pre_dec):
11180 (JSC::JIT::compileFastArith_op_add):
11181 (JSC::JIT::compileFastArith_op_mul):
11182 (JSC::JIT::compileFastArith_op_sub):
11183 (JSC::JIT::compileBinaryArithOp):
11184 * jit/JITCall.cpp:
11185 (JSC::JIT::compileOpCallInitializeCallFrame):
11186 (JSC::JIT::compileOpCallSetupArgs):
11187 (JSC::JIT::compileOpCallEvalSetupArgs):
11188 (JSC::JIT::compileOpConstructSetupArgs):
11189 (JSC::JIT::compileOpCall):
11190 (JSC::JIT::compileOpCallSlowCase):
11191 * jit/JITInlineMethods.h:
11192 (JSC::JIT::emitGetVirtualRegister):
11193 (JSC::JIT::emitPutVirtualRegister):
11194 (JSC::JIT::emitNakedCall):
11195 (JSC::JIT::restoreArgumentReference):
11196 (JSC::JIT::restoreArgumentReferenceForTrampoline):
11197 * jit/JITPropertyAccess.cpp:
11198 (JSC::JIT::compileGetByIdHotPath):
11199 (JSC::JIT::compilePutByIdHotPath):
11200 (JSC::JIT::compileGetByIdSlowCase):
11201 (JSC::JIT::compilePutByIdSlowCase):
11202 (JSC::JIT::privateCompilePutByIdTransition):
11203 (JSC::JIT::privateCompilePatchGetArrayLength):
11204 (JSC::JIT::privateCompileGetByIdSelf):
11205 (JSC::JIT::privateCompileGetByIdProto):
11206 (JSC::JIT::privateCompileGetByIdSelfList):
11207 (JSC::JIT::privateCompileGetByIdProtoList):
11208 (JSC::JIT::privateCompileGetByIdChainList):
11209 (JSC::JIT::privateCompileGetByIdChain):
11210 (JSC::JIT::privateCompilePutByIdReplace):
11211
11212 2009-02-12 Horia Olaru <olaru@adobe.com>
11213
11214 Reviewed by Oliver Hunt.
11215
11216 https://bugs.webkit.org/show_bug.cgi?id=23400
11217
11218 When throwing an exception within an eval argument string, the dst parameter was
11219 modified in the functions below and the return value for eval was altered. Changed
11220 the emitNode call in JSC::ThrowNode::emitBytecode to use a temporary register
11221 to store its results instead of dst. The JSC::FunctionCallResolveNode::emitBytecode
11222 would load the function within the dst registry, also altering the result returned
11223 by eval. Replaced it with another temporary.
11224
11225 * parser/Nodes.cpp:
11226 (JSC::FunctionCallResolveNode::emitBytecode):
11227 (JSC::ThrowNode::emitBytecode):
11228
11229 2009-02-12 Sam Weinig <sam@webkit.org>
11230
11231 Reviewed by Geoffrey Garen.
11232
11233 Speed up String.prototype.fontsize.
11234
11235 * runtime/StringPrototype.cpp:
11236 (JSC::stringProtoFuncFontsize): Specialize for defined/commonly used values.
11237
11238 2009-02-12 Geoffrey Garen <ggaren@apple.com>
11239
11240 Reviewed by Sam Weinig.
11241
11242 Correctness fix.
11243
11244 * wtf/RandomNumber.cpp:
11245 (WTF::randomNumber): Divide by the maximum representable value, which
11246 is different on each platform now, to get values between 0 and 1.
11247
11248 2009-02-12 Geoffrey Garen <ggaren@apple.com>
11249
11250 Build fix.
11251
11252 * wtf/RandomNumber.cpp:
11253 (WTF::randomNumber):
11254
11255 2009-02-12 Geoffrey Garen <ggaren@apple.com>
11256
11257 Reviewed by Sam Weinig.
11258
11259 Fixed <rdar://problem/6582048>.
11260
11261 * wtf/RandomNumber.cpp:
11262 (WTF::randomNumber): Make only one call to the random number generator
11263 on platforms where the generator is cryptographically secure. The value
11264 of randomness over and above cryptographically secure randomness is not
11265 clear, and it caused some performance problems.
11266
11267 2009-02-12 Adam Roben <aroben@apple.com>
11268
11269 Fix lots of Perl warnings when building JavaScriptCoreGenerated on
11270 Windows
11271
11272 Reviewed by John Sullivan.
11273
11274 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
11275 Create the docs/ directory so that we can write bytecode.html into it.
11276 This matches what JavaScriptCore.xcodeproj does.
11277
11278 2009-02-12 Simon Hausmann <simon.hausmann@nokia.com>
11279
11280 Rubber-stamped by Lars.
11281
11282 Re-enable the JIT in the Qt build with -fno-stack-protector on Linux.
11283
11284 * JavaScriptCore.pri:
11285
11286 2009-02-11 Dmitry Titov <dimich@chromium.org>
11287
11288 Reviewed by Alexey Proskuryakov.
11289
11290 https://bugs.webkit.org/show_bug.cgi?id=23705
11291 Fix the UI freeze caused by Worker generating a flood of messages.
11292 Measure time we spend in executing posted work items. If too much time is spent
11293 without returning to the run loop, exit and reschedule.
11294
11295 * wtf/MainThread.h:
11296 Added initializeMainThreadPlatform() to initialize low-level mechanism for posting
11297 work items from thread to thread. This removes #ifdefs for WIN and CHROMIUM from platform-independent code.
11298
11299 * wtf/MainThread.cpp:
11300 (WTF::initializeMainThread):
11301 (WTF::dispatchFunctionsFromMainThread):
11302 Instead of dispatching all work items in the queue, dispatch them one by one
11303 and measure elapsed time. After a threshold, reschedule and quit.
11304
11305 (WTF::callOnMainThread):
11306 (WTF::callOnMainThreadAndWait):
11307 Only schedule dispatch if the queue was empty - to avoid many posted messages in the run loop queue.
11308
11309 * wtf/mac/MainThreadMac.mm:
11310 (WTF::scheduleDispatchFunctionsOnMainThread):
11311 Use static instance of the mainThreadCaller instead of allocating and releasing it each time.
11312 (WTF::initializeMainThreadPlatform):
11313 * wtf/gtk/MainThreadChromium.cpp:
11314 (WTF::initializeMainThreadPlatform):
11315 * wtf/gtk/MainThreadGtk.cpp:
11316 (WTF::initializeMainThreadPlatform):
11317 * wtf/qt/MainThreadQt.cpp:
11318 (WTF::initializeMainThreadPlatform):
11319 * wtf/win/MainThreadWin.cpp:
11320 (WTF::initializeMainThreadPlatform):
11321 * wtf/wx/MainThreadWx.cpp:
11322 (WTF::initializeMainThreadPlatform):
11323
11324 2009-02-11 Sam Weinig <sam@webkit.org>
11325
11326 Reviewed by Gavin Barraclough.
11327
11328 Style cleanup.
11329
11330 * assembler/AbstractMacroAssembler.h:
11331 (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
11332 (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
11333 (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
11334 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
11335 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
11336 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
11337 (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
11338 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
11339 (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
11340 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
11341 (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
11342 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
11343 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
11344 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
11345 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
11346 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
11347 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
11348 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
11349 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
11350 (JSC::AbstractMacroAssembler::PatchBuffer::link):
11351 (JSC::::CodeLocationCommon::labelAtOffset):
11352 (JSC::::CodeLocationCommon::jumpAtOffset):
11353 (JSC::::CodeLocationCommon::callAtOffset):
11354 (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
11355 (JSC::::CodeLocationCommon::dataLabel32AtOffset):
11356
11357 2009-02-11 Sam Weinig <sam@webkit.org>
11358
11359 Reviewed by Gavin Barraclough.
11360
11361 * assembler/AbstractMacroAssembler.h: Fix comments.
11362
11363 2009-02-11 Alexey Proskuryakov <ap@webkit.org>
11364
11365 Trying to fix wx build.
11366
11367 * bytecode/JumpTable.h: Include "MacroAssembler.h", not <MacroAssembler.h>.
11368 * jscore.bkl: Added assembler directory to search paths.
11369
11370 2009-02-10 Gavin Barraclough <barraclough@apple.com>
11371
11372 Build
11373 fix.
11374 (Narrow
11375 changelog
11376 for
11377 dhyatt).
11378
11379 * bytecode/Instruction.h:
11380 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
11381 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
11382
11383 2009-02-10 Gavin Barraclough <barraclough@apple.com>
11384
11385 Reviewed by Oliver Hunt.
11386
11387 Reduce use of void* / reinterpret_cast in JIT repatching code,
11388 add strong types for Calls and for the various types of pointers
11389 we retain into the JIT generated instruction stream.
11390
11391 No performance impact.
11392
11393 * assembler/AbstractMacroAssembler.h:
11394 (JSC::AbstractMacroAssembler::ImmPtr::ImmPtr):
11395 (JSC::AbstractMacroAssembler::ImmPtr::asIntptr):
11396 (JSC::AbstractMacroAssembler::Imm32::Imm32):
11397 (JSC::AbstractMacroAssembler::Label::Label):
11398 (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
11399 (JSC::AbstractMacroAssembler::Call::Call):
11400 (JSC::AbstractMacroAssembler::Call::link):
11401 (JSC::AbstractMacroAssembler::Call::linkTo):
11402 (JSC::AbstractMacroAssembler::Jump::Jump):
11403 (JSC::AbstractMacroAssembler::Jump::linkTo):
11404 (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
11405 (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
11406 (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
11407 (JSC::AbstractMacroAssembler::CodeLocationLabel::CodeLocationLabel):
11408 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
11409 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
11410 (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
11411 (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
11412 (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
11413 (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
11414 (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
11415 (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
11416 (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
11417 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
11418 (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
11419 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
11420 (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
11421 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
11422 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
11423 (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
11424 (JSC::AbstractMacroAssembler::PatchBuffer::entry):
11425 (JSC::AbstractMacroAssembler::PatchBuffer::trampolineAt):
11426 (JSC::AbstractMacroAssembler::PatchBuffer::link):
11427 (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
11428 (JSC::AbstractMacroAssembler::PatchBuffer::patch):
11429 (JSC::AbstractMacroAssembler::PatchBuffer::locationOf):
11430 (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
11431 (JSC::AbstractMacroAssembler::differenceBetween):
11432 (JSC::::CodeLocationCommon::labelAtOffset):
11433 (JSC::::CodeLocationCommon::jumpAtOffset):
11434 (JSC::::CodeLocationCommon::callAtOffset):
11435 (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
11436 (JSC::::CodeLocationCommon::dataLabel32AtOffset):
11437 * assembler/MacroAssemblerX86Common.h:
11438 (JSC::MacroAssemblerX86Common::call):
11439 * assembler/X86Assembler.h:
11440 (JSC::X86Assembler::getCallReturnOffset):
11441 * bytecode/CodeBlock.h:
11442 (JSC::CallLinkInfo::CallLinkInfo):
11443 (JSC::getStructureStubInfoReturnLocation):
11444 (JSC::getCallLinkInfoReturnLocation):
11445 * bytecode/Instruction.h:
11446 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
11447 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
11448 * bytecode/JumpTable.h:
11449 (JSC::StringJumpTable::ctiForValue):
11450 (JSC::SimpleJumpTable::ctiForValue):
11451 * bytecode/StructureStubInfo.h:
11452 (JSC::StructureStubInfo::StructureStubInfo):
11453 * bytecompiler/BytecodeGenerator.cpp:
11454 (JSC::BytecodeGenerator::emitCatch):
11455 (JSC::prepareJumpTableForStringSwitch):
11456 * interpreter/Interpreter.cpp:
11457 (JSC::Interpreter::cti_op_get_by_id_self_fail):
11458 (JSC::getPolymorphicAccessStructureListSlot):
11459 (JSC::Interpreter::cti_op_throw):
11460 (JSC::Interpreter::cti_op_switch_imm):
11461 (JSC::Interpreter::cti_op_switch_char):
11462 (JSC::Interpreter::cti_op_switch_string):
11463 (JSC::Interpreter::cti_vm_throw):
11464 * jit/JIT.cpp:
11465 (JSC::ctiSetReturnAddress):
11466 (JSC::ctiPatchCallByReturnAddress):
11467 (JSC::JIT::privateCompile):
11468 (JSC::JIT::privateCompileCTIMachineTrampolines):
11469 * jit/JIT.h:
11470 (JSC::CallRecord::CallRecord):
11471 (JSC::JIT::compileGetByIdSelf):
11472 (JSC::JIT::compileGetByIdProto):
11473 (JSC::JIT::compileGetByIdChain):
11474 (JSC::JIT::compilePutByIdReplace):
11475 (JSC::JIT::compilePutByIdTransition):
11476 (JSC::JIT::compilePatchGetArrayLength):
11477 (JSC::JIT::emitCTICall):
11478 * jit/JITCall.cpp:
11479 (JSC::JIT::unlinkCall):
11480 (JSC::JIT::linkCall):
11481 * jit/JITInlineMethods.h:
11482 (JSC::JIT::emitNakedCall):
11483 (JSC::JIT::emitCTICall_internal):
11484 * jit/JITPropertyAccess.cpp:
11485 (JSC::JIT::compileGetByIdSlowCase):
11486 (JSC::JIT::compilePutByIdSlowCase):
11487 (JSC::JIT::privateCompilePutByIdTransition):
11488 (JSC::JIT::patchGetByIdSelf):
11489 (JSC::JIT::patchPutByIdReplace):
11490 (JSC::JIT::privateCompilePatchGetArrayLength):
11491 (JSC::JIT::privateCompileGetByIdSelf):
11492 (JSC::JIT::privateCompileGetByIdProto):
11493 (JSC::JIT::privateCompileGetByIdSelfList):
11494 (JSC::JIT::privateCompileGetByIdProtoList):
11495 (JSC::JIT::privateCompileGetByIdChainList):
11496 (JSC::JIT::privateCompileGetByIdChain):
11497 (JSC::JIT::privateCompilePutByIdReplace):
11498
11499 2009-02-10 Adam Roben <aroben@apple.com>
11500
11501 Windows build fix after r40813
11502
11503 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added profiler/ to the include
11504 path so that Profiler.h can be found.
11505
11506 2009-02-09 Gavin Barraclough <barraclough@apple.com>
11507
11508 Reviewed by Oliver Hunt.
11509
11510 Provide a class type for a generated block of JIT code.
11511 Also changes the return address -> bytecode index map to
11512 track the return addess as an unsigned offset into the code
11513 instead of a ptrdiff_t in terms of void**s - the latter is
11514 equal to the actual offset / sizeof(void*), making it a
11515 potentially lossy representation.
11516
11517 * JavaScriptCore.xcodeproj/project.pbxproj:
11518 * assembler/AbstractMacroAssembler.h:
11519 (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
11520 * assembler/X86Assembler.h:
11521 (JSC::X86Assembler::getCallReturnOffset):
11522 * bytecode/CodeBlock.h:
11523 (JSC::CallReturnOffsetToBytecodeIndex::CallReturnOffsetToBytecodeIndex):
11524 (JSC::getCallReturnOffset):
11525 (JSC::CodeBlock::getBytecodeIndex):
11526 (JSC::CodeBlock::jitCode):
11527 (JSC::CodeBlock::callReturnIndexVector):
11528 * interpreter/Interpreter.cpp:
11529 (JSC::Interpreter::execute):
11530 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
11531 (JSC::Interpreter::cti_vm_lazyLinkCall):
11532 * jit/JIT.cpp:
11533 (JSC::JIT::privateCompile):
11534 * jit/JIT.h:
11535 (JSC::):
11536 * jit/JITCall.cpp:
11537 (JSC::JIT::linkCall):
11538 * jit/JITCode.h: Added.
11539 (JSC::):
11540 (JSC::JITCode::JITCode):
11541 (JSC::JITCode::operator bool):
11542 (JSC::JITCode::addressForCall):
11543 (JSC::JITCode::offsetOf):
11544 (JSC::JITCode::execute):
11545
11546 2009-02-09 John Grabowski <jrg@chromium.org>
11547
11548 Reviewed by Darin Adler.
11549
11550 https://bugs.webkit.org/show_bug.cgi?id=23856
11551 Change the definition of "main thread" for Chromium on OSX.
11552 It does not match the DARWIN definition.
11553
11554 * wtf/ThreadingPthreads.cpp:
11555 (WTF::initializeThreading):
11556 (WTF::isMainThread):
11557
11558 2009-02-09 Gavin Barraclough <barraclough@apple.com>
11559
11560 Reviewed by Oliver Hunt.
11561
11562 Minor bugfix, incorrect check meant that subtraction causing integer overflow
11563 would be missed on x86-64 JIT.
11564
11565 * jit/JITArithmetic.cpp:
11566 (JSC::JIT::compileBinaryArithOp):
11567
11568 2009-02-09 Gavin Barraclough <barraclough@apple.com>
11569
11570 Reviewed by Oliver Hunt.
11571
11572 A more sensible register allocation for x86-64.
11573
11574 When WREC was ported to x86-64 it stuck with the same register allocation as x86.
11575 This requires registers to be reordered on entry into WREC generated code, since
11576 argument passing is different on x86-64 and x86 (regparm(3)). This patch switches
11577 x86-64 to use a native register allocation, that does not require argument registers
11578 to be reordered.
11579
11580 * wrec/WRECGenerator.cpp:
11581 (JSC::WREC::Generator::generateEnter):
11582 (JSC::WREC::Generator::generateReturnSuccess):
11583 (JSC::WREC::Generator::generateReturnFailure):
11584 * wrec/WRECGenerator.h:
11585
11586 2009-02-05 Adam Roben <aroben@apple.com>
11587
11588 Build fix
11589
11590 Rubberstamped by Sam Weinig.
11591
11592 * wtf/TypeTraits.h: Include Platform.h, since this header uses macros
11593 defined there.
11594
11595 2009-02-05 Dimitri Glazkov <dglazkov@chromium.org>
11596
11597 Reviewed by Eric Seidel.
11598
11599 https://bugs.webkit.org/show_bug.cgi?id=23747
11600 Add Chromium threading-related files.
11601
11602 * wtf/MainThread.cpp: Added platform guard to initializeMainThread.
11603 * wtf/chromium/ChromiumThreading.h: Added.
11604 * wtf/chromium/MainThreadChromium.cpp: Added.
11605 (WTF::initializeMainThread):
11606 (WTF::scheduleDispatchFunctionsOnMainThread):
11607
11608 2009-02-05 David Levin <levin@chromium.org>
11609
11610 Reviewed by Darin Adler.
11611
11612 Bug 23713: COMPILE_ASSERTS should be moved out of TypeTraits.h and into .cpp file
11613 <https://bugs.webkit.org/show_bug.cgi?id=23713>
11614
11615 * GNUmakefile.am:
11616 * JavaScriptCore.pri:
11617 * JavaScriptCore.scons:
11618 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
11619 * JavaScriptCore.xcodeproj/project.pbxproj:
11620 * JavaScriptCoreSources.bkl:
11621
11622 * wtf/HashTraits.h:
11623 Remove unnecessary header file that I missed when moving out the type traits form this file.
11624
11625 * wtf/TypeTraits.cpp: Added.
11626 (WTF::):
11627 * wtf/TypeTraits.h:
11628 Moved the compile asserts into TypeTraits.cpp file.
11629
11630 2009-02-04 Gavin Barraclough <barraclough@apple.com>
11631
11632 Reviewed by Oliver 'the nun' Hunt.
11633
11634 Add -e switch to jsc to enable evaluation of scripts passed on the command line.
11635
11636 * jsc.cpp:
11637 (Script::Script):
11638 (runWithScripts):
11639 (printUsageStatement):
11640 (parseArguments):
11641 (jscmain):
11642
11643 2009-02-04 Gavin Barraclough <barraclough@apple.com>
11644
11645 Rubber stamped by Sam 'Big Mac' Weinig.
11646
11647 * assembler/AbstractMacroAssembler.h: Copied from assembler/MacroAssembler.h.
11648 * assembler/MacroAssemblerX86.h: Copied from assembler/MacroAssembler.h.
11649 * assembler/MacroAssemblerX86Common.h: Copied from assembler/MacroAssembler.h.
11650 * assembler/MacroAssemblerX86_64.h: Copied from assembler/MacroAssembler.h.
11651
11652 2009-02-04 Gavin Barraclough <barraclough@apple.com>
11653
11654 Reviewed by Sam Weinig.
11655
11656 This patch tidies up the MacroAssembler, cleaning up the code and refactoring out the
11657 platform-specific parts. The MacroAssembler gets split up like a beef burger, with the
11658 platform-agnostic data types being the lower bun (in the form of the class AbstractMacroAssembler),
11659 the plaform-specific code generation forming a big meaty patty of methods like 'add32',
11660 'branch32', etc (MacroAssemblerX86), and finally topped off with the bun-lid of the
11661 MacroAssembler class itself, providing covenience methods such as the stack peek & poke,
11662 and backwards branch methods, all of which can be described in a platform independent
11663 way using methods from the base class. The AbstractMacroAssembler is templated on the
11664 type of the assembler class that will be used for code generation, and the three layers
11665 are held together with the cocktail stick of inheritance.
11666
11667 The above description is a slight simplification since the MacroAssemblerX86 is actually
11668 formed from two layers (in effect giving us a kind on bacon double cheeseburger) - with the
11669 bulk of methods that are common between x86 & x86-64 implemented in MacroAssemblerX86Common,
11670 which forms a base class for MacroAssemblerX86 and MacroAssemblerX86_64 (which add the methods
11671 specific to the given platform).
11672
11673 I'm landing these changes first without splitting the classes across multiple files,
11674 I will follow up with a second patch to split up the file MacroAssembler.h.
11675
11676 * assembler/MacroAssembler.h:
11677 (JSC::AbstractMacroAssembler::):
11678 (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
11679 (JSC::AbstractMacroAssembler::DataLabelPtr::patch):
11680 (JSC::AbstractMacroAssembler::DataLabel32::DataLabel32):
11681 (JSC::AbstractMacroAssembler::DataLabel32::patch):
11682 (JSC::AbstractMacroAssembler::Label::Label):
11683 (JSC::AbstractMacroAssembler::Jump::Jump):
11684 (JSC::AbstractMacroAssembler::Jump::link):
11685 (JSC::AbstractMacroAssembler::Jump::linkTo):
11686 (JSC::AbstractMacroAssembler::Jump::patch):
11687 (JSC::AbstractMacroAssembler::JumpList::link):
11688 (JSC::AbstractMacroAssembler::JumpList::linkTo):
11689 (JSC::AbstractMacroAssembler::PatchBuffer::link):
11690 (JSC::AbstractMacroAssembler::PatchBuffer::addressOf):
11691 (JSC::AbstractMacroAssembler::PatchBuffer::setPtr):
11692 (JSC::AbstractMacroAssembler::size):
11693 (JSC::AbstractMacroAssembler::copyCode):
11694 (JSC::AbstractMacroAssembler::label):
11695 (JSC::AbstractMacroAssembler::align):
11696 (JSC::AbstractMacroAssembler::differenceBetween):
11697 (JSC::MacroAssemblerX86Common::xor32):
11698 (JSC::MacroAssemblerX86Common::load32WithAddressOffsetPatch):
11699 (JSC::MacroAssemblerX86Common::store32WithAddressOffsetPatch):
11700 (JSC::MacroAssemblerX86Common::move):
11701 (JSC::MacroAssemblerX86Common::swap):
11702 (JSC::MacroAssemblerX86Common::signExtend32ToPtr):
11703 (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr):
11704 (JSC::MacroAssemblerX86Common::branch32):
11705 (JSC::MacroAssemblerX86Common::jump):
11706 (JSC::MacroAssemblerX86_64::add32):
11707 (JSC::MacroAssemblerX86_64::sub32):
11708 (JSC::MacroAssemblerX86_64::load32):
11709 (JSC::MacroAssemblerX86_64::store32):
11710 (JSC::MacroAssemblerX86_64::addPtr):
11711 (JSC::MacroAssemblerX86_64::andPtr):
11712 (JSC::MacroAssemblerX86_64::orPtr):
11713 (JSC::MacroAssemblerX86_64::rshiftPtr):
11714 (JSC::MacroAssemblerX86_64::subPtr):
11715 (JSC::MacroAssemblerX86_64::xorPtr):
11716 (JSC::MacroAssemblerX86_64::loadPtr):
11717 (JSC::MacroAssemblerX86_64::loadPtrWithAddressOffsetPatch):
11718 (JSC::MacroAssemblerX86_64::storePtr):
11719 (JSC::MacroAssemblerX86_64::storePtrWithAddressOffsetPatch):
11720 (JSC::MacroAssemblerX86_64::branchPtr):
11721 (JSC::MacroAssemblerX86_64::branchTestPtr):
11722 (JSC::MacroAssemblerX86_64::branchAddPtr):
11723 (JSC::MacroAssemblerX86_64::branchSubPtr):
11724 (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
11725 (JSC::MacroAssemblerX86_64::storePtrWithPatch):
11726 (JSC::MacroAssemblerX86::add32):
11727 (JSC::MacroAssemblerX86::sub32):
11728 (JSC::MacroAssemblerX86::load32):
11729 (JSC::MacroAssemblerX86::store32):
11730 (JSC::MacroAssemblerX86::branch32):
11731 (JSC::MacroAssemblerX86::branchPtrWithPatch):
11732 (JSC::MacroAssemblerX86::storePtrWithPatch):
11733 (JSC::MacroAssembler::pop):
11734 (JSC::MacroAssembler::peek):
11735 (JSC::MacroAssembler::poke):
11736 (JSC::MacroAssembler::branchPtr):
11737 (JSC::MacroAssembler::branch32):
11738 (JSC::MacroAssembler::branch16):
11739 (JSC::MacroAssembler::branchTestPtr):
11740 (JSC::MacroAssembler::addPtr):
11741 (JSC::MacroAssembler::andPtr):
11742 (JSC::MacroAssembler::orPtr):
11743 (JSC::MacroAssembler::rshiftPtr):
11744 (JSC::MacroAssembler::subPtr):
11745 (JSC::MacroAssembler::xorPtr):
11746 (JSC::MacroAssembler::loadPtr):
11747 (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
11748 (JSC::MacroAssembler::storePtr):
11749 (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
11750 (JSC::MacroAssembler::branchAddPtr):
11751 (JSC::MacroAssembler::branchSubPtr):
11752 * jit/JITArithmetic.cpp:
11753 (JSC::JIT::compileBinaryArithOp):
11754
11755 2009-02-04 Alexey Proskuryakov <ap@webkit.org>
11756
11757 Reviewed by Sam Weinig.
11758
11759 https://bugs.webkit.org/show_bug.cgi?id=23681
11760 Worker tests crash in debug builds if run --singly
11761
11762 The crash happened because worker threads continued running while debug-only static objects
11763 were already being destroyed on main thread.
11764
11765 * runtime/Structure.cpp: Create static debug-only sets in heap, so that they don't get
11766 destroyed.
11767
11768 * wtf/ThreadingPthreads.cpp: Changed assertions to conventional form.
11769
11770 2009-02-03 Gavin Barraclough <barraclough@apple.com>
11771
11772 Reviewed by Geoff Garen.
11773
11774 https://bugs.webkit.org/show_bug.cgi?id=23715
11775
11776 Simplify MacroAssembler interface, by combining comparison methods.
11777 Seprate operations are combined as follows:
11778 jz32/jnz32/jzPtr/jnzPtr -> branchTest32/branchTestPtr,
11779 j*(Add|Mul|Sub)32/j*(Add|Mul|Sub)Ptr -> branch(Add|Mul|Sub)32/branch(Add|Mul|Sub)Ptr
11780 j*32/j*Ptr (all other two op combparisons) -> branch32/brnachPtr
11781 set*32 -> set32
11782
11783 Also, represent the Scale of BaseIndex addresses as a plain enum (0,1,2,3),
11784 instead of as multiplicands (1,2,4,8).
11785
11786 This patch singificantly reduces replication of code, and increases functionality supported
11787 by the MacroAssembler. No performance impact.
11788
11789 * assembler/MacroAssembler.h:
11790 (JSC::MacroAssembler::):
11791 (JSC::MacroAssembler::branchPtr):
11792 (JSC::MacroAssembler::branchPtrWithPatch):
11793 (JSC::MacroAssembler::branch32):
11794 (JSC::MacroAssembler::branch16):
11795 (JSC::MacroAssembler::branchTestPtr):
11796 (JSC::MacroAssembler::branchTest32):
11797 (JSC::MacroAssembler::branchAddPtr):
11798 (JSC::MacroAssembler::branchAdd32):
11799 (JSC::MacroAssembler::branchMul32):
11800 (JSC::MacroAssembler::branchSubPtr):
11801 (JSC::MacroAssembler::branchSub32):
11802 (JSC::MacroAssembler::set32):
11803 (JSC::MacroAssembler::setTest32):
11804 * assembler/X86Assembler.h:
11805 (JSC::X86Assembler::):
11806 (JSC::X86Assembler::jccRel32):
11807 (JSC::X86Assembler::setccOpcode):
11808 (JSC::X86Assembler::cmpq_mr):
11809 (JSC::X86Assembler::setcc_r):
11810 (JSC::X86Assembler::sete_r):
11811 (JSC::X86Assembler::setne_r):
11812 (JSC::X86Assembler::jne):
11813 (JSC::X86Assembler::je):
11814 (JSC::X86Assembler::jl):
11815 (JSC::X86Assembler::jb):
11816 (JSC::X86Assembler::jle):
11817 (JSC::X86Assembler::jbe):
11818 (JSC::X86Assembler::jge):
11819 (JSC::X86Assembler::jg):
11820 (JSC::X86Assembler::ja):
11821 (JSC::X86Assembler::jae):
11822 (JSC::X86Assembler::jo):
11823 (JSC::X86Assembler::jp):
11824 (JSC::X86Assembler::js):
11825 (JSC::X86Assembler::jcc):
11826 (JSC::X86Assembler::X86InstructionFormatter::putModRmSib):
11827 * jit/JIT.cpp:
11828 (JSC::JIT::compileOpStrictEq):
11829 (JSC::JIT::emitSlowScriptCheck):
11830 (JSC::JIT::privateCompileMainPass):
11831 (JSC::JIT::privateCompileSlowCases):
11832 (JSC::JIT::privateCompile):
11833 (JSC::JIT::privateCompileCTIMachineTrampolines):
11834 * jit/JITArithmetic.cpp:
11835 (JSC::JIT::compileFastArith_op_lshift):
11836 (JSC::JIT::compileFastArith_op_mod):
11837 (JSC::JIT::compileFastArith_op_post_inc):
11838 (JSC::JIT::compileFastArith_op_post_dec):
11839 (JSC::JIT::compileFastArith_op_pre_inc):
11840 (JSC::JIT::compileFastArith_op_pre_dec):
11841 (JSC::JIT::compileBinaryArithOp):
11842 (JSC::JIT::compileFastArith_op_add):
11843 (JSC::JIT::compileFastArith_op_mul):
11844 * jit/JITCall.cpp:
11845 (JSC::JIT::compileOpCall):
11846 (JSC::JIT::compileOpCallSlowCase):
11847 * jit/JITInlineMethods.h:
11848 (JSC::JIT::checkStructure):
11849 (JSC::JIT::emitJumpIfJSCell):
11850 (JSC::JIT::emitJumpIfNotJSCell):
11851 (JSC::JIT::emitJumpIfImmediateNumber):
11852 (JSC::JIT::emitJumpIfNotImmediateNumber):
11853 (JSC::JIT::emitJumpIfImmediateInteger):
11854 (JSC::JIT::emitJumpIfNotImmediateInteger):
11855 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
11856 * jit/JITPropertyAccess.cpp:
11857 (JSC::JIT::compileGetByIdHotPath):
11858 (JSC::JIT::compilePutByIdHotPath):
11859 (JSC::JIT::privateCompilePutByIdTransition):
11860 (JSC::JIT::privateCompilePatchGetArrayLength):
11861 (JSC::JIT::privateCompileGetByIdProto):
11862 (JSC::JIT::privateCompileGetByIdProtoList):
11863 (JSC::JIT::privateCompileGetByIdChainList):
11864 (JSC::JIT::privateCompileGetByIdChain):
11865 * runtime/RegExp.cpp:
11866 (JSC::RegExp::match):
11867 * wrec/WRECGenerator.cpp:
11868 (JSC::WREC::Generator::generateEnter):
11869 (JSC::WREC::Generator::generateIncrementIndex):
11870 (JSC::WREC::Generator::generateLoadCharacter):
11871 (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
11872 (JSC::WREC::Generator::generateBackreferenceQuantifier):
11873 (JSC::WREC::Generator::generateNonGreedyQuantifier):
11874 (JSC::WREC::Generator::generateGreedyQuantifier):
11875 (JSC::WREC::Generator::generatePatternCharacterPair):
11876 (JSC::WREC::Generator::generatePatternCharacter):
11877 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
11878 (JSC::WREC::Generator::generateCharacterClassInverted):
11879 (JSC::WREC::Generator::generateAssertionBOL):
11880 (JSC::WREC::Generator::generateAssertionEOL):
11881 (JSC::WREC::Generator::generateAssertionWordBoundary):
11882 (JSC::WREC::Generator::generateBackreference):
11883
11884 2009-02-03 David Hyatt <hyatt@apple.com>
11885
11886 Fix a bug in Vector's shrinkCapacity method. It did not properly copy elements into the inline buffer
11887 when shrinking down from a size that was greater than the inline capacity.
11888
11889 Reviewed by Maciej
11890
11891 * wtf/Vector.h:
11892 (WTF::VectorBuffer::VectorBuffer):
11893 (WTF::VectorBuffer::allocateBuffer):
11894
11895 2009-02-03 Simon Hausmann <simon.hausmann@nokia.com>
11896
11897 Reviewed by Tor Arne Vestbø.
11898
11899 Added accessor for JSByteArray storage.
11900
11901 * runtime/JSByteArray.h:
11902 (JSC::JSByteArray::storage):
11903
11904 2009-02-03 Dmitry Titov <dimich@chromium.org>
11905
11906 Reviewed by Alexey Proskuryakov.
11907
11908 https://bugs.webkit.org/show_bug.cgi?id=23560
11909 Implement SharedTimer on WorkerRunLoop
11910
11911 * JavaScriptCore.exp:
11912 Forgot to expose ThreadCondition::timedWait() in one of previous patches.
11913
11914 2009-02-02 Oliver Hunt <oliver@apple.com>
11915
11916 Reviewed by Gavin Barraclough.
11917
11918 <https://bugs.webkit.org/show_bug.cgi?id=21414> REGRESSION: Regular Expressions and character classes, shorthands and ranges
11919 <rdar://problem/6543487>
11920
11921 In certain circumstances when WREC::Generator::generateCharacterClassInvertedRange invokes
11922 itself recursively, it will incorrectly emit (and thus consume) the next single character
11923 match in the current character class. As WREC uses a binary search this out of sequence
11924 codegen could result in a character match being missed and so cause the regex to produce
11925 incorrect results.
11926
11927 * wrec/WRECGenerator.cpp:
11928 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
11929
11930 2009-02-02 Darin Adler <darin@apple.com>
11931
11932 Reviewed by Dave Hyatt.
11933
11934 Bug 23676: Speed up uses of reserveCapacity on new vectors by adding a new reserveInitialCapacity
11935 https://bugs.webkit.org/show_bug.cgi?id=23676
11936
11937 * API/JSObjectRef.cpp:
11938 (JSObjectCopyPropertyNames): Use reserveInitialCapacity.
11939 * parser/Lexer.cpp:
11940 (JSC::Lexer::Lexer): Ditto.
11941 (JSC::Lexer::clear): Ditto.
11942
11943 * wtf/Vector.h: Added reserveInitialCapacity, a more efficient version of
11944 reserveCapacity for use when the vector is brand new (still size 0 with no
11945 capacity other than the inline capacity).
11946
11947 2009-01-30 Mark Rowe <mrowe@apple.com>
11948
11949 Rubber-stamped by Oliver Hunt.
11950
11951 <rdar://problem/6391501> Enable the JIT on Mac OS X x86_64 as it passes all tests.
11952
11953 * wtf/Platform.h:
11954
11955 2009-01-30 Oliver Hunt <oliver@apple.com>
11956
11957 Reviewed by Mark Rowe and Sam Weinig.
11958
11959 Finally fix load() to propagate exceptions correctly.
11960
11961 * jsc.cpp:
11962 (functionLoad):
11963
11964 2009-01-30 David Levin <levin@chromium.org>
11965
11966 Reviewed by Darin Adler.
11967
11968 https://bugs.webkit.org/show_bug.cgi?id=23618
11969 Templated worker tasks should be more error proof to use.
11970 Fix Chromium build.
11971
11972 * wtf/TypeTraits.h:
11973 (WTF::IsConvertibleToInteger::IsConvertibleToDouble):
11974 Avoid "possible loss of data" warning when using Microsoft's C++ compiler
11975 by avoiding an implicit conversion of int types to doubles.
11976
11977 2009-01-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
11978
11979 Reviewed by Simon Hausmann.
11980
11981 Bug 23580: GNU mode RVCT compilation support
11982 <https://bugs.webkit.org/show_bug.cgi?id=23580>
11983
11984 * pcre/pcre_exec.cpp: Use COMPILER(GCC) instead of __GNUC__.
11985 * wtf/FastMalloc.cpp: Ditto.
11986 (WTF::TCMallocStats::):
11987 * wtf/Platform.h: Don't define COMPILER(GCC) with RVCT --gnu.
11988
11989 2009-01-30 David Levin <levin@chromium.org>
11990
11991 Reviewed by Alexey Proskuryakov.
11992
11993 Bug 23618: Templated worker tasks should be more error proof to use
11994 <https://bugs.webkit.org/show_bug.cgi?id=23618>
11995
11996 Add the type traits needed for the generic worker tasks
11997 and compile asserts for them.
11998
11999 Add a summary header to the TypeTraits.h file to explain what is in there.
12000
12001 Add a note to explain IsPod's deficiencies.
12002
12003 * wtf/TypeTraits.h:
12004
12005 2009-01-30 David Levin <levin@chromium.org>
12006
12007 Reviewed by Alexey Proskuryakov.
12008
12009 Bug 23616: Various "template helpers" should be consolidated from isolated files in JavaScriptCore.
12010 <https://bugs.webkit.org/show_bug.cgi?id=23616>
12011
12012 * wtf/TypeTraits.h: Moved RemovePointer, IsPod, IsInteger to this file.
12013
12014 * wtf/OwnPtr.h: Use RemovePointer from TypeTraits.h.
12015 * wtf/RetainPtr.h: Ditto.
12016
12017 * wtf/HashTraits.h: Use IsInteger from TypeTraits.h.
12018
12019 * wtf/VectorTraits.h: Use IsPod from TypeTraits.h.
12020
12021 * GNUmakefile.am:
12022 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
12023 * JavaScriptCore.xcodeproj/project.pbxproj:
12024 Added TypeTraits.h.
12025
12026 2009-01-29 Stephanie Lewis <slewis@apple.com>
12027
12028 RS by Oliver Hunt.
12029
12030 Update the order files.
12031
12032 * JavaScriptCore.order:
12033
12034 2009-01-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
12035
12036 Reviewed by Oliver Hunt.
12037
12038 Bug 23551: Crash on page load with profiler enabled and running
12039 <https://bugs.webkit.org/show_bug.cgi?id=23551>
12040 <rdar://problem/6529521>
12041
12042 Interpreter::execute(FunctionBodyNode*, ...) calls Profiler::didExecute()
12043 with a stale CallFrame. If some part of the scope chain has already been
12044 freed, Profiler::didExecute() will crash when attempting to get the lexical
12045 global object. The fix is to make the didExecute() call use the caller's
12046 CallFrame, not the one made for the function call. In this case, the
12047 willExecute() call should also be changed to match.
12048
12049 Since this occurs in the actual inspector JS, it is difficult to reduce.
12050 I couldn't make a layout test.
12051
12052 * interpreter/Interpreter.cpp:
12053 (JSC::Interpreter::execute):
12054
12055 2009-01-28 Sam Weinig <sam@webkit.org>
12056
12057 Reviewed by Gavin Barraclough.
12058
12059 Fix for <rdar://problem/6525537>
12060 Hang occurs when closing Installer window (iTunes, Aperture)
12061
12062 * JavaScriptCore.exp: Export JSGlobalData::sharedInstance.
12063
12064 2009-01-28 Sam Weinig <sam@webkit.org>
12065
12066 Reviewed by Geoff Garen.
12067
12068 Initial patch by Mark Rowe.
12069
12070 <rdar://problem/6519356>
12071 REGRESSION (r36006): "out of memory" alert running dromaeo on Windows
12072
12073 Report the cost of the ArrayStorage vector more accurately/often.
12074
12075 * runtime/JSArray.cpp:
12076 (JSC::JSArray::JSArray): Report the extra cost even for a filled array
12077 because JSString using the single character optimization and immediates
12078 wont increase the cost themselves.
12079 (JSC::JSArray::putSlowCase): Update the cost when increasing the size of
12080 the array.
12081 (JSC::JSArray::increaseVectorLength): Ditto.
12082
12083 2009-01-28 Sam Weinig <sam@webkit.org>
12084
12085 Reviewed by Geoff Garen.
12086
12087 Fix for <rdar://problem/6129678>
12088 REGRESSION (Safari 3-4): Local variable not accessible from Dashcode console or variables view
12089
12090 Iterating the properties of activation objects accessed through the WebKit debugging
12091 APIs was broken by forced conversion of JSActivation to the global object. To fix this,
12092 we use a proxy activation object that acts more like a normal JSObject.
12093
12094 * debugger/DebuggerActivation.cpp: Added.
12095 (JSC::DebuggerActivation::DebuggerActivation):
12096 (JSC::DebuggerActivation::mark):
12097 (JSC::DebuggerActivation::className):
12098 (JSC::DebuggerActivation::getOwnPropertySlot):
12099 (JSC::DebuggerActivation::put):
12100 (JSC::DebuggerActivation::putWithAttributes):
12101 (JSC::DebuggerActivation::deleteProperty):
12102 (JSC::DebuggerActivation::getPropertyNames):
12103 (JSC::DebuggerActivation::getPropertyAttributes):
12104 (JSC::DebuggerActivation::defineGetter):
12105 (JSC::DebuggerActivation::defineSetter):
12106 (JSC::DebuggerActivation::lookupGetter):
12107 (JSC::DebuggerActivation::lookupSetter):
12108 * debugger/DebuggerActivation.h: Added.
12109 Proxy JSActivation object for Debugging.
12110
12111 * runtime/JSActivation.h:
12112 (JSC::JSActivation::isActivationObject): Added.
12113 * runtime/JSObject.h:
12114 (JSC::JSObject::isActivationObject): Added.
12115
12116 2009-01-28 David Kilzer <ddkilzer@apple.com>
12117
12118 Bug 23490: Remove initialRefCount argument from RefCounted class
12119
12120 <https://bugs.webkit.org/show_bug.cgi?id=23490>
12121
12122 Reviewed by Darin Adler.
12123
12124 RefCountedBase now always starts with a ref count of 1, so there
12125 is no need to pass the initialRefCount into the class anymore.
12126
12127 * wtf/ByteArray.h:
12128 (WTF::ByteArray::ByteArray): Removed call to RefCounted(1).
12129 * wtf/RefCounted.h:
12130 (WTF::RefCountedBase::RefCountedBase): Changed to start with a
12131 ref count of 1.
12132 (WTF::RefCounted::RefCounted): Removed initialRefCount argument
12133 and removed call to RefCounted(1).
12134
12135 2009-01-26 Adele Peterson <adele@apple.com>
12136
12137 Build fix.
12138
12139 * debugger/Debugger.cpp:
12140
12141 2009-01-26 Gavin Barraclough <barraclough@apple.com>
12142
12143 Reviewed by Darin Adler.
12144
12145 Fixes for eq null & neq null, on 64-bit JIT.
12146 https://bugs.webkit.org/show_bug.cgi?id=23559
12147
12148 This patch degrades 64-bit JIT performance on some benchmarks,
12149 due to the whole not-being-incorrect thing.
12150
12151 * jit/JIT.cpp:
12152 (JSC::JIT::privateCompileMainPass):
12153
12154 2009-01-26 Cameron Zwarich <cwzwarich@uwaterloo.ca>
12155
12156 Reviewed by Gavin Barraclough.
12157
12158 Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames
12159 <https://bugs.webkit.org/show_bug.cgi?id=23552>
12160 <rdar://problem/6398839>
12161
12162 * JavaScriptCore.exp:
12163 * debugger/Debugger.cpp:
12164 (JSC::evaluateInGlobalCallFrame): Added so that WebScriptCallFrame can
12165 evaluate JS starting from a global call frame.
12166 * debugger/Debugger.h:
12167
12168 2009-01-25 Mark Rowe <mrowe@apple.com>
12169
12170 Rubber-stamped by Dan Bernstein.
12171
12172 Improve the consistency of settings in our .xcconfig files.
12173
12174 * Configurations/Base.xcconfig: Enable GCC_OBJC_CALL_CXX_CDTORS to match other projects.
12175
12176 2009-01-25 Darin Adler <darin@apple.com>
12177
12178 Reviewed by Mark Rowe.
12179
12180 Bug 23352: Turn on more compiler warnings in the Mac build
12181 https://bugs.webkit.org/show_bug.cgi?id=23352
12182
12183 Turn on the following warnings:
12184
12185 -Wcast-qual
12186 -Wextra-tokens
12187 -Wformat=2
12188 -Winit-self
12189 -Wmissing-noreturn
12190 -Wpacked
12191 -Wrendundant-decls
12192
12193 * Configurations/Base.xcconfig: Added the new warnings. Switched to -Wextra instead of
12194 -W for clarity since we don't have to support the older versions of gcc that require the
12195 old -W syntax. Since we now use -Wformat=2, removed -Wformat-security. Also removed
12196 -Wno-format-y2k since we can have that one on now.
12197
12198 2009-01-25 Judit Jasz <jasy@inf.u-szeged.hu>
12199
12200 Reviewed by Darin Adler.
12201
12202 Compilation problem fixing
12203 http://bugs.webkit.org/show_bug.cgi?id=23497
12204
12205 * jit/JITCall.cpp:
12206 (JSC::JIT::compileOpCall): Use JSValuePtr::encode.
12207
12208 2009-01-25 Darin Adler <darin@apple.com>
12209
12210 Reviewed by Sam Weinig.
12211
12212 Bug 23352: Turn on more compiler warnings in the Mac build
12213 https://bugs.webkit.org/show_bug.cgi?id=23352
12214
12215 Fourth patch: Deal with the last few stray warnings.
12216
12217 * parser/Parser.cpp: Only declare jscyyparse if it's not already declared.
12218 This makes both separate compilation and all-in-one compilation work with the
12219 -Wredundant-decls warning.
12220
12221 2009-01-25 Darin Adler <darin@apple.com>
12222
12223 Reviewed by Sam Weinig.
12224
12225 Bug 23352: Turn on more compiler warnings in the Mac build
12226 https://bugs.webkit.org/show_bug.cgi?id=23352
12227
12228 Third patch: Use the noreturn attribute on functions that don't
12229 return to prepare for the use of the -Wmissing-noreturn warning.
12230
12231 * jit/JITCall.cpp:
12232 (JSC::unreachable): Added NO_RETURN.
12233 * jsc.cpp:
12234 (functionQuit): Ditto.
12235 (printUsageStatement): Ditto.
12236 * wtf/AlwaysInline.h: Added definition of NO_RETURN.
12237
12238 2009-01-24 Oliver Hunt <oliver@apple.com>
12239
12240 Reviewed by Maciej Stachowiak.
12241
12242 Force inlining of Lexer::matchPunctuator
12243
12244 2.2% win when parsing jQuery, Mootools, Prototype, etc
12245
12246 * parser/Lexer.h:
12247
12248 2009-01-23 Gavin Barraclough <barraclough@apple.com>
12249
12250 Reviewed by Geoff Garen.
12251
12252 Fix for <rdar://problem/6126212>
12253 Ensure that callbacks out from the JSC interface are only allowed
12254 to return in reverse-chronological order to that in which they were
12255 made. If we allow earlier callbacks to return first, then this may
12256 result in setions of the RegisterFile in use by another thread
12257 being trampled.
12258
12259 See uber-comment in JSLock.h for details.
12260
12261 * runtime/JSLock.cpp:
12262 (JSC::JSLock::DropAllLocks::DropAllLocks):
12263 (JSC::JSLock::DropAllLocks::~DropAllLocks):
12264
12265 2009-01-23 Darin Adler <darin@apple.com>
12266
12267 Try to fix WX build.
12268
12269 * runtime/JSGlobalObjectFunctions.h: Include <wtf/unicode/Unicode.h>
12270 for the definition of UChar.
12271
12272 2009-01-23 Anders Carlsson <andersca@apple.com>
12273
12274 * Configurations/Base.xcconfig:
12275 GCC 4.0 build fix.
12276
12277 * runtime/JSNumberCell.h:
12278 64-bit build fix.
12279
12280 2009-01-23 Anders Carlsson <andersca@apple.com>
12281
12282 Reviewed by Sam Weinig.
12283
12284 Turn on -Wmissing-prototypes and fix the warnings.
12285
12286 * API/JSClassRef.cpp:
12287 (clearReferenceToPrototype):
12288 * Configurations/Base.xcconfig:
12289 * runtime/Collector.cpp:
12290 (JSC::getPlatformThreadRegisters):
12291 * runtime/ExceptionHelpers.cpp:
12292 (JSC::createError):
12293 * runtime/JSGlobalObjectFunctions.h:
12294 * runtime/JSNumberCell.h:
12295 * runtime/UString.cpp:
12296 (JSC::initializeStaticBaseString):
12297 (JSC::createRep):
12298 * wtf/FastMalloc.cpp:
12299 * wtf/Threading.cpp:
12300
12301 2009-01-22 Mark Rowe <mrowe@apple.com>
12302
12303 Rubber-stamped by Anders Carlsson.
12304
12305 Disable GCC_WARN_ABOUT_MISSING_PROTOTYPES temporarily.
12306
12307 Current versions of Xcode only respect it for C and Objective-C files,
12308 and our code doesn't currently compile if it is applied to C++ and
12309 Objective-C++ files.
12310
12311 * Configurations/Base.xcconfig:
12312
12313 2009-01-22 Steve Falkenburg <sfalken@apple.com>
12314
12315 https://bugs.webkit.org/show_bug.cgi?id=23489
12316
12317 Return currentTime() in correct units for the two early return cases.
12318
12319 Reviewed by Mark Rowe.
12320
12321 * wtf/CurrentTime.cpp:
12322 (WTF::currentTime):
12323
12324 2009-01-22 Sam Weinig <sam@webkit.org>
12325
12326 Reviewed by Mark Rowe.
12327
12328 Fix for <rdar://problem/6439247>
12329 FastMalloc allocating an extra 4MB of meta-data on 64-bit
12330
12331 Rely on the fact that on all known x86-64 platforms only use 48 bits of
12332 address space to shrink the initial size of the PageMap from ~4MB to 120K.
12333 For 64-bit we still use a 3-level radix tree, but now each level is only 12
12334 bits wide.
12335
12336 No performance change.
12337
12338 * wtf/FastMalloc.cpp:
12339 (WTF::MapSelector): Add specialization for 64 bit that takes into account the
12340 16 bits of unused address space on x86-64.
12341
12342 2009-01-22 Beth Dakin <bdakin@apple.com>
12343
12344 Reviewed by Sam Weinig.
12345
12346 Fix for https://bugs.webkit.org/show_bug.cgi?id=23461 LayoutTests/
12347 fast/js/numeric-conversion.html is broken, and corresponding
12348 <rdar://problem/6514842>
12349
12350 The basic problem here is that parseInt(Infinity) should be NaN,
12351 but we were returning 0. NaN matches Safari 3.2.1 and Firefox.
12352
12353 * runtime/JSGlobalObjectFunctions.cpp:
12354 (JSC::globalFuncParseInt):
12355
12356 2009-01-22 Oliver Hunt <oliver@apple.com>
12357
12358 Reviewed by Geoff Garen.
12359
12360 <rdar://problem/6516853> (r39682-r39736) JSFunFuzz: crash on "(function(){({ x2: x }), })()"
12361 <https://bugs.webkit.org/show_bug.cgi?id=23479>
12362
12363 Automatic semicolon insertion was resulting in this being accepted in the initial
12364 nodeless parsing, but subsequent reparsing for code generation would fail, leading
12365 to a crash. The solution is to ensure that reparsing a function performs parsing
12366 in the same state as the initial parse. We do this by modifying the saved source
12367 ranges to include rather than exclude the opening and closing braces.
12368
12369 * bytecode/CodeBlock.cpp:
12370 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): add an assertion for successful recompile
12371 * parser/Lexer.h:
12372 (JSC::Lexer::sourceCode): include rather than exclude braces.
12373 * parser/Nodes.h:
12374 (JSC::FunctionBodyNode::toSourceString): No need to append braces anymore.
12375
12376 2009-01-22 Dmitry Titov <dimich@chromium.org>
12377
12378 Reviewed by Alexey Proskuryakov.
12379
12380 https://bugs.webkit.org/show_bug.cgi?id=23373
12381
12382 Implement ThreadCondition::timedWait().
12383 Since we borrow the code for condition variables from other sources,
12384 I did the same for timedWait(). See comments in ThreadingWin.cpp for
12385 rationale and more info.
12386
12387 * wtf/CONTRIBUTORS.pthreads-win32:
12388 Added. A list of Pthreads-win32 contributors mentioned in their license. The license itself
12389 is included into wtf/ThreadingWin32.cpp.
12390
12391 * wtf/Threading.h:
12392 * wtf/ThreadingWin.cpp:
12393 Additional info and Pthreads-win32 license at the beginning.
12394 (WTF::PlatformCondition::timedWait): new method, derived from Pthreads-win32.
12395 (WTF::PlatformCondition::signal): same
12396 (WTF::ThreadCondition::ThreadCondition):
12397 (WTF::ThreadCondition::~ThreadCondition):
12398 (WTF::ThreadCondition::wait): this now calls PlatformCondition::timedWait.
12399 (WTF::ThreadCondition::timedWait): same
12400 (WTF::ThreadCondition::signal): this now calls PlatformCondition::signal.
12401 (WTF::ThreadCondition::broadcast): same
12402
12403 2009-01-21 Gavin Barraclough <barraclough@apple.com>
12404
12405 Reviewed by Oliver Hunt.
12406
12407 Fix for https://bugs.webkit.org/show_bug.cgi?id=23469.
12408
12409 We need to check all numbers in integer switches, not just those
12410 represented as integer JSImmediates.
12411
12412 * interpreter/Interpreter.cpp:
12413 (JSC::Interpreter::privateExecute):
12414 (JSC::Interpreter::cti_op_switch_imm):
12415
12416 2009-01-21 Gavin Barraclough <barraclough@apple.com>
12417
12418 Reviewed by Geoff Garen.
12419
12420 Fix for https://bugs.webkit.org/show_bug.cgi?id=23468.
12421
12422 * interpreter/Interpreter.cpp:
12423 (JSC::Interpreter::privateExecute):
12424
12425 2009-01-21 Alexey Proskuryakov <ap@webkit.org>
12426
12427 Suggested by Oliver Hunt. Reviewed by Oliver Hunt.
12428
12429 https://bugs.webkit.org/show_bug.cgi?id=23456
12430 Function argument names leak
12431
12432 * parser/Nodes.cpp: (JSC::FunctionBodyNode::~FunctionBodyNode): Destruct parameter names.
12433
12434 2009-01-20 Oliver Hunt <oliver@apple.com>
12435
12436 Reviewed by NOBODY (Build fix).
12437
12438 Windows build fix
12439
12440 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
12441
12442 2009-01-20 Gavin Barraclough <barraclough@apple.com>
12443
12444 Reviewed by Mark Rowe.
12445
12446 Structure property table deleted offset maps are being leaked.
12447 Probably shouldn't be doing that.
12448
12449 https://bugs.webkit.org/show_bug.cgi?id=23442
12450
12451 * runtime/Structure.cpp:
12452 (JSC::Structure::~Structure):
12453
12454 2009-01-20 Oliver Hunt <oliver@apple.com>
12455
12456 Reviewed by NOBODY (build fix).
12457
12458 Attempt to fix gtk build
12459
12460 * GNUmakefile.am:
12461
12462 2009-01-20 Darin Adler <darin@apple.com>
12463
12464 * runtime/StringPrototype.cpp:
12465 (JSC::substituteBackreferences): Add back the initialization to fix the build.
12466
12467 2009-01-20 Darin Adler <darin@apple.com>
12468
12469 Reviewed by Mark Rowe.
12470
12471 Bug 23352: Turn on more compiler warnings in the Mac build
12472 https://bugs.webkit.org/show_bug.cgi?id=23352
12473
12474 First patch: Fix some simple cases of various warnings.
12475
12476 * pcre/pcre_compile.cpp:
12477 (jsRegExpCompile): Use const_cast to change const-ness.
12478
12479 * runtime/StringPrototype.cpp:
12480 (JSC::substituteBackreferences): Remove unneeded initialization and
12481 use UChar instead of unsigned short for UTF-16 values.
12482
12483 * wtf/dtoa.cpp:
12484 (WTF::strtod): Use const_cast to change const-ness.
12485
12486 2009-01-20 Oliver Hunt <oliver@apple.com>
12487
12488 Reviewed by NOBODY (build fix).
12489
12490 Whoops, remove runtime/ByteArray references from .pri and .scons builds, update .bkl
12491
12492 * JavaScriptCore.pri:
12493 * JavaScriptCore.scons:
12494 * JavaScriptCoreSources.bkl:
12495
12496 2009-01-20 Oliver Hunt <oliver@apple.com>
12497
12498 RS=Dan Bernstein.
12499
12500 Move runtime/ByteArray to wtf/ByteArray
12501
12502 * GNUmakefile.am:
12503 * JavaScriptCore.exp:
12504 * JavaScriptCore.pri:
12505 * JavaScriptCore.scons:
12506 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
12507 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
12508 * JavaScriptCore.xcodeproj/project.pbxproj:
12509 * runtime/JSByteArray.cpp:
12510 * runtime/JSByteArray.h:
12511 * wtf/ByteArray.cpp: Renamed from JavaScriptCore/runtime/ByteArray.cpp.
12512 (WTF::ByteArray::create):
12513 * wtf/ByteArray.h: Renamed from JavaScriptCore/runtime/ByteArray.h.
12514 (WTF::ByteArray::length):
12515 (WTF::ByteArray::set):
12516 (WTF::ByteArray::get):
12517 (WTF::ByteArray::data):
12518 (WTF::ByteArray::deref):
12519 (WTF::ByteArray::ByteArray):
12520
12521 2009-01-19 Sam Weinig <sam@webkit.org>
12522
12523 Rubber-stamped by Gavin Barraclough.
12524
12525 Remove temporary operator-> from JSValuePtr.
12526
12527 * API/JSCallbackFunction.cpp:
12528 (JSC::JSCallbackFunction::call):
12529 * API/JSCallbackObjectFunctions.h:
12530 (JSC::::call):
12531 (JSC::::toNumber):
12532 (JSC::::toString):
12533 * API/JSObjectRef.cpp:
12534 (JSObjectSetPrototype):
12535 * API/JSValueRef.cpp:
12536 (JSValueGetType):
12537 (JSValueIsUndefined):
12538 (JSValueIsNull):
12539 (JSValueIsBoolean):
12540 (JSValueIsNumber):
12541 (JSValueIsString):
12542 (JSValueIsObject):
12543 (JSValueIsObjectOfClass):
12544 (JSValueToBoolean):
12545 (JSValueToNumber):
12546 (JSValueToStringCopy):
12547 (JSValueToObject):
12548 * bytecode/CodeBlock.cpp:
12549 (JSC::valueToSourceString):
12550 (JSC::CodeBlock::mark):
12551 * bytecode/CodeBlock.h:
12552 (JSC::CodeBlock::isKnownNotImmediate):
12553 * bytecompiler/BytecodeGenerator.cpp:
12554 (JSC::BytecodeGenerator::emitEqualityOp):
12555 (JSC::keyForImmediateSwitch):
12556 * interpreter/Interpreter.cpp:
12557 (JSC::jsLess):
12558 (JSC::jsLessEq):
12559 (JSC::jsAddSlowCase):
12560 (JSC::jsAdd):
12561 (JSC::jsTypeStringForValue):
12562 (JSC::jsIsObjectType):
12563 (JSC::jsIsFunctionType):
12564 (JSC::isNotObject):
12565 (JSC::Interpreter::callEval):
12566 (JSC::Interpreter::throwException):
12567 (JSC::cachePrototypeChain):
12568 (JSC::Interpreter::tryCachePutByID):
12569 (JSC::countPrototypeChainEntriesAndCheckForProxies):
12570 (JSC::Interpreter::tryCacheGetByID):
12571 (JSC::Interpreter::privateExecute):
12572 (JSC::Interpreter::tryCTICachePutByID):
12573 (JSC::Interpreter::tryCTICacheGetByID):
12574 (JSC::Interpreter::cti_op_convert_this):
12575 (JSC::Interpreter::cti_op_add):
12576 (JSC::Interpreter::cti_op_pre_inc):
12577 (JSC::Interpreter::cti_op_put_by_id_generic):
12578 (JSC::Interpreter::cti_op_get_by_id_generic):
12579 (JSC::Interpreter::cti_op_put_by_id):
12580 (JSC::Interpreter::cti_op_put_by_id_second):
12581 (JSC::Interpreter::cti_op_put_by_id_fail):
12582 (JSC::Interpreter::cti_op_get_by_id):
12583 (JSC::Interpreter::cti_op_get_by_id_second):
12584 (JSC::Interpreter::cti_op_get_by_id_self_fail):
12585 (JSC::Interpreter::cti_op_get_by_id_proto_list):
12586 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
12587 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
12588 (JSC::Interpreter::cti_op_get_by_id_array_fail):
12589 (JSC::Interpreter::cti_op_get_by_id_string_fail):
12590 (JSC::Interpreter::cti_op_instanceof):
12591 (JSC::Interpreter::cti_op_del_by_id):
12592 (JSC::Interpreter::cti_op_mul):
12593 (JSC::Interpreter::cti_op_call_JSFunction):
12594 (JSC::Interpreter::cti_op_call_NotJSFunction):
12595 (JSC::Interpreter::cti_op_construct_JSConstruct):
12596 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
12597 (JSC::Interpreter::cti_op_get_by_val):
12598 (JSC::Interpreter::cti_op_get_by_val_byte_array):
12599 (JSC::Interpreter::cti_op_sub):
12600 (JSC::Interpreter::cti_op_put_by_val):
12601 (JSC::Interpreter::cti_op_put_by_val_array):
12602 (JSC::Interpreter::cti_op_put_by_val_byte_array):
12603 (JSC::Interpreter::cti_op_loop_if_true):
12604 (JSC::Interpreter::cti_op_negate):
12605 (JSC::Interpreter::cti_op_div):
12606 (JSC::Interpreter::cti_op_pre_dec):
12607 (JSC::Interpreter::cti_op_not):
12608 (JSC::Interpreter::cti_op_jtrue):
12609 (JSC::Interpreter::cti_op_post_inc):
12610 (JSC::Interpreter::cti_op_lshift):
12611 (JSC::Interpreter::cti_op_bitand):
12612 (JSC::Interpreter::cti_op_rshift):
12613 (JSC::Interpreter::cti_op_bitnot):
12614 (JSC::Interpreter::cti_op_mod):
12615 (JSC::Interpreter::cti_op_post_dec):
12616 (JSC::Interpreter::cti_op_urshift):
12617 (JSC::Interpreter::cti_op_bitxor):
12618 (JSC::Interpreter::cti_op_bitor):
12619 (JSC::Interpreter::cti_op_push_scope):
12620 (JSC::Interpreter::cti_op_is_undefined):
12621 (JSC::Interpreter::cti_op_is_boolean):
12622 (JSC::Interpreter::cti_op_is_number):
12623 (JSC::Interpreter::cti_op_to_jsnumber):
12624 (JSC::Interpreter::cti_op_in):
12625 (JSC::Interpreter::cti_op_put_by_index):
12626 (JSC::Interpreter::cti_op_switch_imm):
12627 (JSC::Interpreter::cti_op_switch_char):
12628 (JSC::Interpreter::cti_op_switch_string):
12629 (JSC::Interpreter::cti_op_del_by_val):
12630 (JSC::Interpreter::cti_op_put_getter):
12631 (JSC::Interpreter::cti_op_put_setter):
12632 (JSC::Interpreter::cti_op_new_error):
12633 * interpreter/Interpreter.h:
12634 (JSC::Interpreter::isJSArray):
12635 (JSC::Interpreter::isJSString):
12636 (JSC::Interpreter::isJSByteArray):
12637 * interpreter/Register.h:
12638 (JSC::Register::marked):
12639 (JSC::Register::mark):
12640 * jit/JITInlineMethods.h:
12641 (JSC::JIT::getConstantOperandImmediateInt):
12642 (JSC::JIT::isOperandConstantImmediateInt):
12643 * jsc.cpp:
12644 (functionPrint):
12645 (functionDebug):
12646 (functionRun):
12647 (functionLoad):
12648 (runWithScripts):
12649 (runInteractive):
12650 * parser/Nodes.cpp:
12651 (JSC::processClauseList):
12652 * profiler/ProfileGenerator.cpp:
12653 (JSC::ProfileGenerator::addParentForConsoleStart):
12654 * profiler/Profiler.cpp:
12655 (JSC::Profiler::createCallIdentifier):
12656 * runtime/ArrayConstructor.cpp:
12657 (JSC::constructArrayWithSizeQuirk):
12658 * runtime/ArrayPrototype.cpp:
12659 (JSC::arrayProtoFuncToString):
12660 (JSC::arrayProtoFuncToLocaleString):
12661 (JSC::arrayProtoFuncJoin):
12662 (JSC::arrayProtoFuncConcat):
12663 (JSC::arrayProtoFuncPop):
12664 (JSC::arrayProtoFuncPush):
12665 (JSC::arrayProtoFuncReverse):
12666 (JSC::arrayProtoFuncShift):
12667 (JSC::arrayProtoFuncSlice):
12668 (JSC::arrayProtoFuncSort):
12669 (JSC::arrayProtoFuncSplice):
12670 (JSC::arrayProtoFuncUnShift):
12671 (JSC::arrayProtoFuncFilter):
12672 (JSC::arrayProtoFuncMap):
12673 (JSC::arrayProtoFuncEvery):
12674 (JSC::arrayProtoFuncForEach):
12675 (JSC::arrayProtoFuncSome):
12676 (JSC::arrayProtoFuncIndexOf):
12677 (JSC::arrayProtoFuncLastIndexOf):
12678 * runtime/BooleanConstructor.cpp:
12679 (JSC::constructBoolean):
12680 (JSC::callBooleanConstructor):
12681 * runtime/BooleanPrototype.cpp:
12682 (JSC::booleanProtoFuncToString):
12683 (JSC::booleanProtoFuncValueOf):
12684 * runtime/Collector.cpp:
12685 (JSC::Heap::protect):
12686 (JSC::Heap::unprotect):
12687 (JSC::Heap::heap):
12688 (JSC::Heap::collect):
12689 (JSC::typeName):
12690 * runtime/Completion.cpp:
12691 (JSC::evaluate):
12692 * runtime/DateConstructor.cpp:
12693 (JSC::constructDate):
12694 (JSC::dateParse):
12695 (JSC::dateUTC):
12696 * runtime/DateInstance.h:
12697 (JSC::DateInstance::internalNumber):
12698 * runtime/DatePrototype.cpp:
12699 (JSC::formatLocaleDate):
12700 (JSC::fillStructuresUsingTimeArgs):
12701 (JSC::fillStructuresUsingDateArgs):
12702 (JSC::dateProtoFuncToString):
12703 (JSC::dateProtoFuncToUTCString):
12704 (JSC::dateProtoFuncToDateString):
12705 (JSC::dateProtoFuncToTimeString):
12706 (JSC::dateProtoFuncToLocaleString):
12707 (JSC::dateProtoFuncToLocaleDateString):
12708 (JSC::dateProtoFuncToLocaleTimeString):
12709 (JSC::dateProtoFuncGetTime):
12710 (JSC::dateProtoFuncGetFullYear):
12711 (JSC::dateProtoFuncGetUTCFullYear):
12712 (JSC::dateProtoFuncToGMTString):
12713 (JSC::dateProtoFuncGetMonth):
12714 (JSC::dateProtoFuncGetUTCMonth):
12715 (JSC::dateProtoFuncGetDate):
12716 (JSC::dateProtoFuncGetUTCDate):
12717 (JSC::dateProtoFuncGetDay):
12718 (JSC::dateProtoFuncGetUTCDay):
12719 (JSC::dateProtoFuncGetHours):
12720 (JSC::dateProtoFuncGetUTCHours):
12721 (JSC::dateProtoFuncGetMinutes):
12722 (JSC::dateProtoFuncGetUTCMinutes):
12723 (JSC::dateProtoFuncGetSeconds):
12724 (JSC::dateProtoFuncGetUTCSeconds):
12725 (JSC::dateProtoFuncGetMilliSeconds):
12726 (JSC::dateProtoFuncGetUTCMilliseconds):
12727 (JSC::dateProtoFuncGetTimezoneOffset):
12728 (JSC::dateProtoFuncSetTime):
12729 (JSC::setNewValueFromTimeArgs):
12730 (JSC::setNewValueFromDateArgs):
12731 (JSC::dateProtoFuncSetYear):
12732 (JSC::dateProtoFuncGetYear):
12733 * runtime/ErrorConstructor.cpp:
12734 (JSC::constructError):
12735 * runtime/ErrorPrototype.cpp:
12736 (JSC::errorProtoFuncToString):
12737 * runtime/ExceptionHelpers.cpp:
12738 (JSC::createError):
12739 (JSC::createErrorMessage):
12740 * runtime/FunctionConstructor.cpp:
12741 (JSC::constructFunction):
12742 * runtime/FunctionPrototype.cpp:
12743 (JSC::functionProtoFuncToString):
12744 (JSC::functionProtoFuncApply):
12745 (JSC::functionProtoFuncCall):
12746 * runtime/GetterSetter.cpp:
12747 (JSC::GetterSetter::toObject):
12748 * runtime/JSActivation.cpp:
12749 (JSC::JSActivation::getOwnPropertySlot):
12750 * runtime/JSArray.cpp:
12751 (JSC::JSArray::put):
12752 (JSC::JSArray::mark):
12753 (JSC::JSArray::sort):
12754 (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
12755 (JSC::JSArray::compactForSorting):
12756 * runtime/JSByteArray.h:
12757 (JSC::JSByteArray::setIndex):
12758 * runtime/JSCell.h:
12759 (JSC::asCell):
12760 * runtime/JSFunction.cpp:
12761 (JSC::JSFunction::call):
12762 (JSC::JSFunction::construct):
12763 * runtime/JSGlobalObject.cpp:
12764 (JSC::markIfNeeded):
12765 (JSC::lastInPrototypeChain):
12766 * runtime/JSGlobalObjectFunctions.cpp:
12767 (JSC::encode):
12768 (JSC::decode):
12769 (JSC::globalFuncEval):
12770 (JSC::globalFuncParseInt):
12771 (JSC::globalFuncParseFloat):
12772 (JSC::globalFuncIsNaN):
12773 (JSC::globalFuncIsFinite):
12774 (JSC::globalFuncEscape):
12775 (JSC::globalFuncUnescape):
12776 (JSC::globalFuncJSCPrint):
12777 * runtime/JSImmediate.cpp:
12778 (JSC::JSImmediate::toThisObject):
12779 (JSC::JSImmediate::toObject):
12780 (JSC::JSImmediate::prototype):
12781 (JSC::JSImmediate::toString):
12782 * runtime/JSImmediate.h:
12783 * runtime/JSObject.cpp:
12784 (JSC::JSObject::mark):
12785 (JSC::JSObject::put):
12786 (JSC::callDefaultValueFunction):
12787 (JSC::JSObject::getPrimitiveNumber):
12788 (JSC::JSObject::defineGetter):
12789 (JSC::JSObject::defineSetter):
12790 (JSC::JSObject::lookupGetter):
12791 (JSC::JSObject::lookupSetter):
12792 (JSC::JSObject::hasInstance):
12793 (JSC::JSObject::toNumber):
12794 (JSC::JSObject::toString):
12795 * runtime/JSObject.h:
12796 (JSC::JSObject::JSObject):
12797 (JSC::JSObject::inlineGetOwnPropertySlot):
12798 (JSC::JSObject::getOwnPropertySlotForWrite):
12799 (JSC::JSObject::getPropertySlot):
12800 (JSC::JSValuePtr::get):
12801 * runtime/JSPropertyNameIterator.h:
12802 (JSC::JSPropertyNameIterator::create):
12803 * runtime/JSString.cpp:
12804 (JSC::JSString::getOwnPropertySlot):
12805 * runtime/JSValue.h:
12806 * runtime/JSWrapperObject.cpp:
12807 (JSC::JSWrapperObject::mark):
12808 * runtime/JSWrapperObject.h:
12809 (JSC::JSWrapperObject::setInternalValue):
12810 * runtime/MathObject.cpp:
12811 (JSC::mathProtoFuncAbs):
12812 (JSC::mathProtoFuncACos):
12813 (JSC::mathProtoFuncASin):
12814 (JSC::mathProtoFuncATan):
12815 (JSC::mathProtoFuncATan2):
12816 (JSC::mathProtoFuncCeil):
12817 (JSC::mathProtoFuncCos):
12818 (JSC::mathProtoFuncExp):
12819 (JSC::mathProtoFuncFloor):
12820 (JSC::mathProtoFuncLog):
12821 (JSC::mathProtoFuncMax):
12822 (JSC::mathProtoFuncMin):
12823 (JSC::mathProtoFuncPow):
12824 (JSC::mathProtoFuncRound):
12825 (JSC::mathProtoFuncSin):
12826 (JSC::mathProtoFuncSqrt):
12827 (JSC::mathProtoFuncTan):
12828 * runtime/NativeErrorConstructor.cpp:
12829 (JSC::NativeErrorConstructor::NativeErrorConstructor):
12830 (JSC::NativeErrorConstructor::construct):
12831 * runtime/NumberConstructor.cpp:
12832 (JSC::constructWithNumberConstructor):
12833 (JSC::callNumberConstructor):
12834 * runtime/NumberPrototype.cpp:
12835 (JSC::numberProtoFuncToString):
12836 (JSC::numberProtoFuncToLocaleString):
12837 (JSC::numberProtoFuncValueOf):
12838 (JSC::numberProtoFuncToFixed):
12839 (JSC::numberProtoFuncToExponential):
12840 (JSC::numberProtoFuncToPrecision):
12841 * runtime/ObjectConstructor.cpp:
12842 (JSC::constructObject):
12843 * runtime/ObjectPrototype.cpp:
12844 (JSC::objectProtoFuncValueOf):
12845 (JSC::objectProtoFuncHasOwnProperty):
12846 (JSC::objectProtoFuncIsPrototypeOf):
12847 (JSC::objectProtoFuncDefineGetter):
12848 (JSC::objectProtoFuncDefineSetter):
12849 (JSC::objectProtoFuncLookupGetter):
12850 (JSC::objectProtoFuncLookupSetter):
12851 (JSC::objectProtoFuncPropertyIsEnumerable):
12852 (JSC::objectProtoFuncToLocaleString):
12853 (JSC::objectProtoFuncToString):
12854 * runtime/Operations.h:
12855 (JSC::JSValuePtr::equalSlowCaseInline):
12856 (JSC::JSValuePtr::strictEqual):
12857 (JSC::JSValuePtr::strictEqualSlowCaseInline):
12858 * runtime/Protect.h:
12859 (JSC::gcProtect):
12860 (JSC::gcUnprotect):
12861 * runtime/RegExpConstructor.cpp:
12862 (JSC::setRegExpConstructorInput):
12863 (JSC::setRegExpConstructorMultiline):
12864 (JSC::constructRegExp):
12865 * runtime/RegExpObject.cpp:
12866 (JSC::setRegExpObjectLastIndex):
12867 (JSC::RegExpObject::match):
12868 * runtime/RegExpPrototype.cpp:
12869 (JSC::regExpProtoFuncTest):
12870 (JSC::regExpProtoFuncExec):
12871 (JSC::regExpProtoFuncCompile):
12872 (JSC::regExpProtoFuncToString):
12873 * runtime/StringConstructor.cpp:
12874 (JSC::stringFromCharCodeSlowCase):
12875 (JSC::stringFromCharCode):
12876 (JSC::constructWithStringConstructor):
12877 (JSC::callStringConstructor):
12878 * runtime/StringPrototype.cpp:
12879 (JSC::stringProtoFuncReplace):
12880 (JSC::stringProtoFuncToString):
12881 (JSC::stringProtoFuncCharAt):
12882 (JSC::stringProtoFuncCharCodeAt):
12883 (JSC::stringProtoFuncConcat):
12884 (JSC::stringProtoFuncIndexOf):
12885 (JSC::stringProtoFuncLastIndexOf):
12886 (JSC::stringProtoFuncMatch):
12887 (JSC::stringProtoFuncSearch):
12888 (JSC::stringProtoFuncSlice):
12889 (JSC::stringProtoFuncSplit):
12890 (JSC::stringProtoFuncSubstr):
12891 (JSC::stringProtoFuncSubstring):
12892 (JSC::stringProtoFuncToLowerCase):
12893 (JSC::stringProtoFuncToUpperCase):
12894 (JSC::stringProtoFuncLocaleCompare):
12895 (JSC::stringProtoFuncBig):
12896 (JSC::stringProtoFuncSmall):
12897 (JSC::stringProtoFuncBlink):
12898 (JSC::stringProtoFuncBold):
12899 (JSC::stringProtoFuncFixed):
12900 (JSC::stringProtoFuncItalics):
12901 (JSC::stringProtoFuncStrike):
12902 (JSC::stringProtoFuncSub):
12903 (JSC::stringProtoFuncSup):
12904 (JSC::stringProtoFuncFontcolor):
12905 (JSC::stringProtoFuncFontsize):
12906 (JSC::stringProtoFuncAnchor):
12907 (JSC::stringProtoFuncLink):
12908 * runtime/Structure.cpp:
12909 (JSC::Structure::Structure):
12910 (JSC::Structure::getEnumerablePropertyNames):
12911 (JSC::Structure::createCachedPrototypeChain):
12912 * runtime/Structure.h:
12913 (JSC::Structure::mark):
12914 * runtime/StructureChain.cpp:
12915 (JSC::StructureChain::StructureChain):
12916
12917 2009-01-19 Darin Adler <darin@apple.com>
12918
12919 Reviewed by Sam Weinig.
12920
12921 Bug 23409: REGRESSION: RegExp 'replace()' function improperly processes '$$'
12922 <https://bugs.webkit.org/show_bug.cgi?id=23409>
12923 <rdar://problem/6505723>
12924
12925 Test: fast/js/string-replace-3.html
12926
12927 * runtime/StringPrototype.cpp:
12928 (JSC::substituteBackreferences): Remove code that adds an extra $ -- not sure
12929 how this ever worked.
12930
12931 2009-01-16 Gavin Barraclough <barraclough@apple.com>
12932
12933 Reviewed by Oliver Hunt.
12934
12935 On x86-64 jit, cache JSImmedate::TagMask & JSImmedate::TagTypeNumber in
12936 registers, save reloading them every time they're used.
12937
12938 Draws x86-64 jit performance close to that of i386 jit.
12939
12940 * assembler/MacroAssembler.h:
12941 (JSC::MacroAssembler::subPtr):
12942 (JSC::MacroAssembler::jnzPtr):
12943 (JSC::MacroAssembler::jzPtr):
12944 * jit/JIT.cpp:
12945 (JSC::JIT::privateCompileMainPass):
12946 * jit/JIT.h:
12947 * jit/JITArithmetic.cpp:
12948 (JSC::JIT::compileBinaryArithOpSlowCase):
12949 * jit/JITInlineMethods.h:
12950 (JSC::JIT::emitJumpIfJSCell):
12951 (JSC::JIT::emitJumpIfNotJSCell):
12952 (JSC::JIT::emitJumpIfImmediateNumber):
12953 (JSC::JIT::emitJumpIfNotImmediateNumber):
12954 (JSC::JIT::emitJumpIfImmediateInteger):
12955 (JSC::JIT::emitJumpIfNotImmediateInteger):
12956 (JSC::JIT::emitFastArithIntToImmNoCheck):
12957
12958 2009-01-16 Gavin Barraclough <barraclough@apple.com>
12959
12960 Reviewed by Oliver Hunt.
12961
12962 Add support to x86-64 JIT for inline double precision arithmetic ops.
12963 +5/6% on x86-64, JIT enabled, sunspider.
12964
12965 * assembler/MacroAssembler.h:
12966 (JSC::MacroAssembler::addPtr):
12967 * assembler/X86Assembler.h:
12968 (JSC::X86Assembler::movq_rr):
12969 * jit/JIT.h:
12970 * jit/JITArithmetic.cpp:
12971 (JSC::JIT::compileFastArith_op_pre_inc):
12972 (JSC::JIT::compileBinaryArithOp):
12973 (JSC::JIT::compileBinaryArithOpSlowCase):
12974 (JSC::JIT::compileFastArith_op_add):
12975 (JSC::JIT::compileFastArithSlow_op_add):
12976 (JSC::JIT::compileFastArith_op_mul):
12977 (JSC::JIT::compileFastArithSlow_op_mul):
12978 (JSC::JIT::compileFastArith_op_sub):
12979 (JSC::JIT::compileFastArithSlow_op_sub):
12980 * parser/ResultType.h:
12981 (JSC::ResultType::isReusable):
12982 (JSC::ResultType::isInt32):
12983 (JSC::ResultType::definitelyIsNumber):
12984 (JSC::ResultType::mightBeNumber):
12985 (JSC::ResultType::isNotNumber):
12986 (JSC::ResultType::unknownType):
12987
12988 2009-01-16 Gavin Barraclough <barraclough@apple.com>
12989
12990 Reviewed by Geoff Garen.
12991
12992 Fixes for SamplingTool.
12993
12994 https://bugs.webkit.org/show_bug.cgi?id=23390
12995
12996 * assembler/MacroAssembler.h:
12997 (JSC::MacroAssembler::storePtr):
12998 * bytecode/SamplingTool.cpp:
12999 (JSC::SamplingTool::run):
13000 (JSC::SamplingTool::dump):
13001 * bytecode/SamplingTool.h:
13002 (JSC::SamplingTool::encodeSample):
13003 * jit/JIT.cpp:
13004 (JSC::JIT::privateCompileMainPass):
13005 (JSC::JIT::privateCompile):
13006 * jit/JIT.h:
13007 (JSC::JIT::samplingToolTrackCodeBlock):
13008 * jit/JITCall.cpp:
13009 (JSC::JIT::compileOpCall):
13010 (JSC::JIT::compileOpCallSlowCase):
13011 * jit/JITInlineMethods.h:
13012 (JSC::JIT::emitCTICall_internal):
13013
13014 2009-01-16 Geoffrey Garen <ggaren@apple.com>
13015
13016 Reviewed by Darin Adler.
13017
13018 Fixed <rdar://problem/6452301> REGRESSION: Latest WebKit nightlies
13019 turn "c" into "" when stripping \\c_ character
13020
13021 * wrec/WRECParser.cpp:
13022 (JSC::WREC::Parser::consumeEscape): Mimic a Firefox quirk when parsing
13023 control escapes inside character classes.
13024
13025 2009-01-16 Adam Roben <aroben@apple.com>
13026
13027 Windows build fix
13028
13029 * wrec/WRECParser.cpp:
13030 (JSC::WREC::Parser::parseParentheses): Removed unreachable code.
13031
13032 2009-01-15 Geoffrey Garen <ggaren@apple.com>
13033
13034 Reviewed by Cameron Zwarich.
13035
13036 Fixed <rdar://problem/6471394> REGRESSION (r39164): Discarding quantifier
13037 on assertion gives incorrect result (23075)
13038
13039 https://bugs.webkit.org/show_bug.cgi?id=23075
13040
13041 * pcre/pcre_compile.cpp:
13042 (compileBranch): Throw away an assertion if it's followed by a quantifier
13043 with a 0 minimum, to match SpiderMonkey, v8, and the ECMA spec.
13044
13045 * wrec/WRECParser.cpp:
13046 (JSC::WREC::Parser::parseParentheses): Fall back on PCRE for the rare
13047 case of an assertion with a quantifier with a 0 minimum, since we
13048 don't handle quantified subexpressions yet, and in this special case,
13049 we can't just throw away the quantifier.
13050
13051 2009-01-15 Gavin Barraclough <barraclough@apple.com>
13052
13053 Reviewed by Oliver Hunt.
13054
13055 Add support in ResultType to track that the results of bitops
13056 are always of type int32_t.
13057
13058 * parser/Nodes.cpp:
13059 (JSC::ReadModifyResolveNode::emitBytecode):
13060 (JSC::ReadModifyDotNode::emitBytecode):
13061 (JSC::ReadModifyBracketNode::emitBytecode):
13062 * parser/Nodes.h:
13063 (JSC::ExpressionNode::):
13064 (JSC::BooleanNode::):
13065 (JSC::NumberNode::):
13066 (JSC::StringNode::):
13067 (JSC::PrePostResolveNode::):
13068 (JSC::TypeOfResolveNode::):
13069 (JSC::TypeOfValueNode::):
13070 (JSC::UnaryPlusNode::):
13071 (JSC::NegateNode::):
13072 (JSC::BitwiseNotNode::):
13073 (JSC::LogicalNotNode::):
13074 (JSC::MultNode::):
13075 (JSC::DivNode::):
13076 (JSC::ModNode::):
13077 (JSC::SubNode::):
13078 (JSC::LeftShiftNode::):
13079 (JSC::RightShiftNode::):
13080 (JSC::UnsignedRightShiftNode::):
13081 (JSC::LessNode::):
13082 (JSC::GreaterNode::):
13083 (JSC::LessEqNode::):
13084 (JSC::GreaterEqNode::):
13085 (JSC::InstanceOfNode::):
13086 (JSC::EqualNode::):
13087 (JSC::NotEqualNode::):
13088 (JSC::StrictEqualNode::):
13089 (JSC::NotStrictEqualNode::):
13090 (JSC::BitAndNode::):
13091 (JSC::BitOrNode::):
13092 (JSC::BitXOrNode::):
13093 (JSC::LogicalOpNode::):
13094 * parser/ResultType.h:
13095 (JSC::ResultType::isInt32):
13096 (JSC::ResultType::isNotNumber):
13097 (JSC::ResultType::booleanType):
13098 (JSC::ResultType::numberType):
13099 (JSC::ResultType::numberTypeCanReuse):
13100 (JSC::ResultType::numberTypeCanReuseIsInt32):
13101 (JSC::ResultType::stringOrNumberTypeCanReuse):
13102 (JSC::ResultType::stringType):
13103 (JSC::ResultType::unknownType):
13104 (JSC::ResultType::forAdd):
13105 (JSC::ResultType::forBitOp):
13106 (JSC::OperandTypes::OperandTypes):
13107
13108 2009-01-15 Gavin Barraclough <barraclough@apple.com>
13109
13110 Reviewed by Oliver Hunt.
13111
13112 Add support for integer addition, subtraction and multiplication
13113 in JIT code on x86-64.
13114
13115 * assembler/MacroAssembler.h:
13116 (JSC::MacroAssembler::mul32):
13117 (JSC::MacroAssembler::sub32):
13118 (JSC::MacroAssembler::joMul32):
13119 (JSC::MacroAssembler::joSub32):
13120 * jit/JIT.cpp:
13121 (JSC::JIT::privateCompileMainPass):
13122 (JSC::JIT::privateCompileSlowCases):
13123 * jit/JIT.h:
13124 * jit/JITArithmetic.cpp:
13125 (JSC::JIT::compileFastArith_op_add):
13126 (JSC::JIT::compileFastArithSlow_op_add):
13127 (JSC::JIT::compileFastArith_op_mul):
13128 (JSC::JIT::compileFastArithSlow_op_mul):
13129 (JSC::JIT::compileFastArith_op_sub):
13130 (JSC::JIT::compileFastArithSlow_op_sub):
13131
13132 2009-01-15 Gavin Barraclough <barraclough@apple.com>
13133
13134 Reviewed by Geoff Garen.
13135
13136 On x86-64 allow JSImmediate to encode 64-bit double precision values.
13137 This patch only affects builds that set USE(ALTERNATE_JSIMMEDIATE).
13138 Updates the implementation of JSValuePtr:: and JSImmediate:: methods
13139 that operate on neumeric values to be be aware of the new representation.
13140 When this representation is in use, the class JSNumberCell is redundant
13141 and is compiled out.
13142
13143 The format of the new immediate representation is documented in JSImmediate.h.
13144
13145 * JavaScriptCore.exp:
13146 * assembler/MacroAssembler.h:
13147 (JSC::MacroAssembler::subPtr):
13148 * assembler/X86Assembler.h:
13149 (JSC::X86Assembler::):
13150 (JSC::X86Assembler::subq_rr):
13151 (JSC::X86Assembler::movq_rr):
13152 (JSC::X86Assembler::ucomisd_rr):
13153 (JSC::X86Assembler::X86InstructionFormatter::twoByteOp64):
13154 * interpreter/Interpreter.cpp:
13155 (JSC::Interpreter::cti_op_stricteq):
13156 (JSC::Interpreter::cti_op_nstricteq):
13157 * jit/JIT.cpp:
13158 (JSC::JIT::compileOpStrictEq):
13159 (JSC::JIT::privateCompileMainPass):
13160 (JSC::JIT::privateCompileSlowCases):
13161 * jit/JIT.h:
13162 * jit/JITArithmetic.cpp:
13163 (JSC::JIT::compileFastArith_op_lshift):
13164 (JSC::JIT::compileFastArith_op_rshift):
13165 (JSC::JIT::compileFastArith_op_bitand):
13166 (JSC::JIT::compileFastArith_op_mod):
13167 (JSC::JIT::compileFastArith_op_add):
13168 (JSC::JIT::compileFastArith_op_mul):
13169 (JSC::JIT::compileFastArith_op_post_inc):
13170 (JSC::JIT::compileFastArith_op_post_dec):
13171 (JSC::JIT::compileFastArith_op_pre_inc):
13172 (JSC::JIT::compileFastArith_op_pre_dec):
13173 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
13174 (JSC::JIT::compileBinaryArithOp):
13175 * jit/JITInlineMethods.h:
13176 (JSC::JIT::emitJumpIfBothJSCells):
13177 (JSC::JIT::emitJumpIfEitherNumber):
13178 (JSC::JIT::emitJumpIfNotEitherNumber):
13179 (JSC::JIT::emitJumpIfImmediateIntegerNumber):
13180 (JSC::JIT::emitJumpIfNotImmediateIntegerNumber):
13181 (JSC::JIT::emitJumpIfNotImmediateIntegerNumbers):
13182 (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumber):
13183 (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumbers):
13184 (JSC::JIT::emitFastArithDeTagImmediate):
13185 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
13186 (JSC::JIT::emitFastArithReTagImmediate):
13187 (JSC::JIT::emitFastArithIntToImmNoCheck):
13188 * runtime/JSCell.h:
13189 * runtime/JSGlobalData.cpp:
13190 (JSC::JSGlobalData::JSGlobalData):
13191 * runtime/JSImmediate.cpp:
13192 (JSC::JSImmediate::toThisObject):
13193 (JSC::JSImmediate::toObject):
13194 (JSC::JSImmediate::toString):
13195 * runtime/JSImmediate.h:
13196 (JSC::wtf_reinterpret_cast):
13197 (JSC::JSImmediate::isNumber):
13198 (JSC::JSImmediate::isIntegerNumber):
13199 (JSC::JSImmediate::isDoubleNumber):
13200 (JSC::JSImmediate::isPositiveIntegerNumber):
13201 (JSC::JSImmediate::areBothImmediateIntegerNumbers):
13202 (JSC::JSImmediate::makeInt):
13203 (JSC::JSImmediate::makeDouble):
13204 (JSC::JSImmediate::doubleValue):
13205 (JSC::doubleToBoolean):
13206 (JSC::JSImmediate::toBoolean):
13207 (JSC::JSImmediate::getTruncatedUInt32):
13208 (JSC::JSImmediate::makeOutOfIntegerRange):
13209 (JSC::JSImmediate::from):
13210 (JSC::JSImmediate::getTruncatedInt32):
13211 (JSC::JSImmediate::toDouble):
13212 (JSC::JSImmediate::getUInt32):
13213 (JSC::JSValuePtr::isInt32Fast):
13214 (JSC::JSValuePtr::isUInt32Fast):
13215 (JSC::JSValuePtr::areBothInt32Fast):
13216 (JSC::JSFastMath::canDoFastBitwiseOperations):
13217 (JSC::JSFastMath::xorImmediateNumbers):
13218 (JSC::JSFastMath::canDoFastRshift):
13219 (JSC::JSFastMath::canDoFastUrshift):
13220 (JSC::JSFastMath::rightShiftImmediateNumbers):
13221 (JSC::JSFastMath::canDoFastAdditiveOperations):
13222 (JSC::JSFastMath::addImmediateNumbers):
13223 (JSC::JSFastMath::subImmediateNumbers):
13224 * runtime/JSNumberCell.cpp:
13225 (JSC::jsNumberCell):
13226 * runtime/JSNumberCell.h:
13227 (JSC::createNumberStructure):
13228 (JSC::isNumberCell):
13229 (JSC::asNumberCell):
13230 (JSC::jsNumber):
13231 (JSC::JSValuePtr::isDoubleNumber):
13232 (JSC::JSValuePtr::getDoubleNumber):
13233 (JSC::JSValuePtr::isNumber):
13234 (JSC::JSValuePtr::uncheckedGetNumber):
13235 (JSC::jsNaN):
13236 (JSC::JSValuePtr::getNumber):
13237 (JSC::JSValuePtr::numberToInt32):
13238 (JSC::JSValuePtr::numberToUInt32):
13239 * runtime/JSValue.h:
13240 * runtime/NumberConstructor.cpp:
13241 (JSC::numberConstructorNegInfinity):
13242 (JSC::numberConstructorPosInfinity):
13243 (JSC::numberConstructorMaxValue):
13244 (JSC::numberConstructorMinValue):
13245 * runtime/NumberObject.cpp:
13246 (JSC::constructNumber):
13247 * runtime/NumberObject.h:
13248 * runtime/Operations.h:
13249 (JSC::JSValuePtr::equal):
13250 (JSC::JSValuePtr::equalSlowCaseInline):
13251 (JSC::JSValuePtr::strictEqual):
13252 (JSC::JSValuePtr::strictEqualSlowCaseInline):
13253 * wtf/Platform.h:
13254
13255 2009-01-15 Sam Weinig <sam@webkit.org>
13256
13257 Reviewed by Geoffrey Garen.
13258
13259 <rdar://problem/6045018>
13260 REGRESSION (r34838): JavaScript objects appear to be leaked after loading google.com
13261
13262 Subtract the number of JSStrings cached in SmallStrings when calculating the
13263 number of live JSObjects.
13264
13265 * runtime/Collector.cpp:
13266 (JSC::Heap::objectCount):
13267 * runtime/SmallStrings.cpp:
13268 (JSC::SmallStrings::count):
13269 * runtime/SmallStrings.h:
13270
13271 2009-01-15 Sam Weinig <sam@webkit.org>
13272
13273 Fix Qt build.
13274
13275 * runtime/Collector.cpp:
13276
13277 2009-01-15 Sam Weinig <sam@webkit.org>
13278
13279 Reviewed by Gavin Barraclough.
13280
13281 Fix crash seen running fast/canvas.
13282
13283 Make sure to mark the ScopeNode and CodeBlock being created
13284 in the re-parse for exception information.
13285
13286 * bytecode/CodeBlock.cpp:
13287 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
13288 * parser/Nodes.h:
13289 (JSC::ScopeNode::mark):
13290 * runtime/Collector.cpp:
13291 (JSC::Heap::collect):
13292 * runtime/JSGlobalData.cpp:
13293 (JSC::JSGlobalData::JSGlobalData):
13294 * runtime/JSGlobalData.h:
13295
13296 2009-01-15 Craig Schlenter <craig.schlenter@gmail.com>
13297
13298 Reviewed by Darin Adler.
13299
13300 https://bugs.webkit.org/show_bug.cgi?id=23347
13301 Compilation of JavaScriptCore/wtf/ThreadingPthreads.cpp fails on Linux
13302
13303 * wtf/ThreadingPthreads.cpp: included limits.h as INT_MAX is defined there.
13304
13305 2009-01-15 Oliver Hunt <oliver@apple.com>
13306
13307 Reviewed by Geoff Garen.
13308
13309 Bug 23225: REGRESSION: Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com
13310 <https://bugs.webkit.org/show_bug.cgi?id=23225> <rdar://problem/6487432>
13311
13312 Character position for open and closing brace was incorrectly referencing m_position to
13313 record their position in a source document, however this is unsafe as BOMs may lead to
13314 m_position being an arbitrary position from the real position of the current character.
13315
13316 * parser/Lexer.cpp:
13317 (JSC::Lexer::matchPunctuator):
13318
13319 2009-01-14 David Kilzer <ddkilzer@apple.com>
13320
13321 Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html
13322
13323 <https://bugs.webkit.org/show_bug.cgi?id=23153>
13324
13325 Reviewed by Darin Adler.
13326
13327 Instead of building bytecode.html into ${SRCROOT}/docs/bytecode.html, build it
13328 into ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore/docs/bytecode.html.
13329
13330 Also fixes make-bytecode-docs.pl to actually generate documentation.
13331
13332 * DerivedSources.make: Changed bytecode.html to be built into local docs
13333 directory in ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore.
13334 * JavaScriptCore.xcodeproj/project.pbxproj: Added "/docs" to the end of the
13335 "mkdir -p" command so that the docs subdirectory is automatically created.
13336 * docs/make-bytecode-docs.pl: Changed BEGIN_OPCODE to DEFINE_OPCODE so that
13337 documentation is actually generated.
13338
13339 2009-01-14 Adam Treat <adam.treat@torchmobile.com>
13340
13341 Build fix for Qt from Dmitry Titov.
13342
13343 * wtf/ThreadingQt.cpp:
13344 (WTF::ThreadCondition::timedWait):
13345
13346 2009-01-14 Oliver Hunt <oliver@apple.com>
13347
13348 Reviewed by Cameron Zwarich.
13349
13350 Bug 22903: REGRESSION (r36267): visiting this site reliably crashes WebKit nightly
13351
13352 EvalCodeBlock's do not reference the functions that are declared inside the eval
13353 code, this means that simply marking the EvalCodeBlock through the global object
13354 is insufficient to mark the declared functions. This patch corrects this by
13355 explicitly marking the CodeBlocks of all the functions declared in the cached
13356 EvalNode.
13357
13358 * bytecode/CodeBlock.cpp:
13359 (JSC::CodeBlock::mark):
13360 * bytecode/CodeBlock.h:
13361 (JSC::CodeBlock::hasFunctions):
13362 * bytecode/EvalCodeCache.h:
13363 (JSC::EvalCodeCache::mark):
13364 * parser/Nodes.cpp:
13365 (JSC::ScopeNodeData::mark):
13366 (JSC::EvalNode::mark):
13367 * parser/Nodes.h:
13368
13369 2009-01-14 Dmitry Titov <dimich@chromium.org>
13370
13371 Reviewed by Alexey Proskuryakov.
13372
13373 https://bugs.webkit.org/show_bug.cgi?id=23312
13374 Implement MessageQueue::waitForMessageTimed()
13375 Also fixed ThreadCondition::timedWait() to take absolute time, as discussed on webkit-dev.
13376 Win32 version of timedWait still has to be implemented.
13377
13378 * wtf/MessageQueue.h:
13379 (WTF::MessageQueueWaitResult: new enum for the result of MessageQueue::waitForMessageTimed.
13380 (WTF::MessageQueue::waitForMessage):
13381 (WTF::MessageQueue::waitForMessageTimed): New method.
13382 * wtf/Threading.h:
13383 * wtf/ThreadingGtk.cpp:
13384 (WTF::ThreadCondition::timedWait): changed to use absolute time instead of interval.
13385 * wtf/ThreadingNone.cpp:
13386 (WTF::ThreadCondition::timedWait): ditto.
13387 * wtf/ThreadingPthreads.cpp:
13388 (WTF::ThreadCondition::timedWait): ditto.
13389 * wtf/ThreadingQt.cpp:
13390 (WTF::ThreadCondition::timedWait): ditto.
13391 * wtf/ThreadingWin.cpp:
13392 (WTF::ThreadCondition::timedWait): ditto. The actual Win32 code is still to be implemented.
13393
13394 2009-01-14 Dean McNamee <deanm@chromium.org>
13395
13396 Reviewed by Darin Adler and Oliver hunt.
13397
13398 Correctly match allocation functions by implementing a custom deref().
13399
13400 https://bugs.webkit.org/show_bug.cgi?id=23315
13401
13402 * runtime/ByteArray.h:
13403 (JSC::ByteArray::deref):
13404 (JSC::ByteArray::ByteArray):
13405
13406 2009-01-14 Dan Bernstein <mitz@apple.com>
13407
13408 Reviewed by John Sullivan.
13409
13410 - update copyright
13411
13412 * Info.plist:
13413
13414 2009-01-13 Beth Dakin <bdakin@apple.com>
13415
13416 Reviewed by Darin Adler and Oliver Hunt.
13417
13418 <rdar://problem/6489314> REGRESSION: Business widget's front side
13419 fails to render correctly when flipping widget
13420
13421 The problem here is that parseInt was parsing NaN as 0. This patch
13422 corrects that by parsing NaN as NaN. This matches our old behavior
13423 and Firefox.
13424
13425 * runtime/JSGlobalObjectFunctions.cpp:
13426 (JSC::globalFuncParseInt):
13427
13428 2009-01-13 Gavin Barraclough <barraclough@apple.com>
13429
13430 Reviewed by Oliver Hunt.
13431
13432 Fix for: https://bugs.webkit.org/show_bug.cgi?id=23292
13433
13434 Implementation of two argument canDoFastAdditiveOperations does not correlate well with reality.
13435
13436 * runtime/JSImmediate.h:
13437 (JSC::JSFastMath::canDoFastAdditiveOperations):
13438
13439 2009-01-13 Zalan Bujtas <zbujtas@gmail.com>
13440
13441 Reviewed by Darin Adler.
13442
13443 https://bugs.webkit.org/show_bug.cgi?id=23290
13444 Fix JSImmediate::isImmediate(src) to !src->isCell()
13445
13446 * interpreter/Interpreter.cpp:
13447 (JSC::Interpreter::privateExecute):
13448
13449 2009-01-13 Dmitry Titov <dimich@chromium.org>
13450
13451 Reviewed by Darin Adler.
13452
13453 https://bugs.webkit.org/show_bug.cgi?id=23281
13454 Fix the Chromium Win build.
13455 Need to use PLATFORM(WIN_OS) instead of PLATFORM(WIN).
13456 Moved GTK and WX up in #if sequence because they could come with WIN_OS too,
13457 while they have their own implementation even on Windows.
13458
13459 * wtf/CurrentTime.cpp:
13460 (WTF::currentTime):
13461
13462 2009-01-12 Gavin Barraclough <barraclough@apple.com>
13463
13464 Reviewed by Oliver Hunt.
13465
13466 Make the JSImmediate interface private.
13467
13468 All manipulation of JS values should be through the JSValuePtr class, not by using JSImmediate
13469 directly. The key missing methods on JSValuePtr are:
13470
13471 * isCell() - check for values that are JSCell*s, and as such where asCell() may be used.
13472 * isInt32Fast() getInt32Fast() - fast check/access for integer immediates.
13473 * isUInt32Fast() getUInt32Fast() - ditto for unsigned integer immediates.
13474
13475 The JIT is allowed full access to JSImmediate, since it needs to be able to directly
13476 manipulate JSValuePtrs. The Interpreter is provided access to perform operations directly
13477 on JSValuePtrs through the new JSFastMath interface.
13478
13479 No performance impact.
13480
13481 * API/JSCallbackObjectFunctions.h:
13482 (JSC::::toNumber):
13483 * API/JSValueRef.cpp:
13484 (JSValueIsEqual):
13485 (JSValueIsStrictEqual):
13486 * JavaScriptCore.exp:
13487 * bytecode/CodeBlock.h:
13488 (JSC::CodeBlock::isKnownNotImmediate):
13489 * bytecompiler/BytecodeGenerator.cpp:
13490 (JSC::keyForImmediateSwitch):
13491 * bytecompiler/BytecodeGenerator.h:
13492 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
13493 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
13494 * interpreter/Interpreter.cpp:
13495 (JSC::jsLess):
13496 (JSC::jsLessEq):
13497 (JSC::jsAdd):
13498 (JSC::jsIsObjectType):
13499 (JSC::cachePrototypeChain):
13500 (JSC::Interpreter::tryCachePutByID):
13501 (JSC::Interpreter::tryCacheGetByID):
13502 (JSC::Interpreter::privateExecute):
13503 (JSC::Interpreter::tryCTICachePutByID):
13504 (JSC::Interpreter::tryCTICacheGetByID):
13505 (JSC::Interpreter::cti_op_add):
13506 (JSC::Interpreter::cti_op_get_by_id_self_fail):
13507 (JSC::Interpreter::cti_op_get_by_id_proto_list):
13508 (JSC::Interpreter::cti_op_instanceof):
13509 (JSC::Interpreter::cti_op_mul):
13510 (JSC::Interpreter::cti_op_get_by_val):
13511 (JSC::Interpreter::cti_op_get_by_val_byte_array):
13512 (JSC::Interpreter::cti_op_sub):
13513 (JSC::Interpreter::cti_op_put_by_val):
13514 (JSC::Interpreter::cti_op_put_by_val_array):
13515 (JSC::Interpreter::cti_op_put_by_val_byte_array):
13516 (JSC::Interpreter::cti_op_negate):
13517 (JSC::Interpreter::cti_op_div):
13518 (JSC::Interpreter::cti_op_eq):
13519 (JSC::Interpreter::cti_op_lshift):
13520 (JSC::Interpreter::cti_op_bitand):
13521 (JSC::Interpreter::cti_op_rshift):
13522 (JSC::Interpreter::cti_op_bitnot):
13523 (JSC::Interpreter::cti_op_neq):
13524 (JSC::Interpreter::cti_op_urshift):
13525 (JSC::Interpreter::cti_op_call_eval):
13526 (JSC::Interpreter::cti_op_throw):
13527 (JSC::Interpreter::cti_op_is_undefined):
13528 (JSC::Interpreter::cti_op_stricteq):
13529 (JSC::Interpreter::cti_op_nstricteq):
13530 (JSC::Interpreter::cti_op_switch_imm):
13531 (JSC::Interpreter::cti_vm_throw):
13532 * interpreter/Interpreter.h:
13533 (JSC::Interpreter::isJSArray):
13534 (JSC::Interpreter::isJSString):
13535 (JSC::Interpreter::isJSByteArray):
13536 * jit/JIT.cpp:
13537 (JSC::JIT::compileOpStrictEq):
13538 (JSC::JIT::privateCompileMainPass):
13539 * jit/JIT.h:
13540 (JSC::JIT::isStrictEqCaseHandledInJITCode):
13541 * jit/JITArithmetic.cpp:
13542 (JSC::JIT::compileFastArith_op_rshift):
13543 (JSC::JIT::compileFastArith_op_bitand):
13544 (JSC::JIT::compileFastArith_op_mod):
13545 * jit/JITCall.cpp:
13546 (JSC::JIT::unlinkCall):
13547 (JSC::JIT::compileOpCall):
13548 * jit/JITInlineMethods.h:
13549 (JSC::JIT::getConstantOperandImmediateInt):
13550 (JSC::JIT::isOperandConstantImmediateInt):
13551 * parser/Nodes.cpp:
13552 (JSC::processClauseList):
13553 * runtime/ArrayPrototype.cpp:
13554 (JSC::arrayProtoFuncIndexOf):
13555 (JSC::arrayProtoFuncLastIndexOf):
13556 * runtime/BooleanPrototype.cpp:
13557 (JSC::booleanProtoFuncValueOf):
13558 * runtime/Collector.cpp:
13559 (JSC::Heap::protect):
13560 (JSC::Heap::unprotect):
13561 (JSC::Heap::heap):
13562 * runtime/JSByteArray.cpp:
13563 (JSC::JSByteArray::getOwnPropertySlot):
13564 * runtime/JSByteArray.h:
13565 (JSC::JSByteArray::getIndex):
13566 * runtime/JSCell.cpp:
13567 * runtime/JSCell.h:
13568 (JSC::JSValuePtr::isNumberCell):
13569 (JSC::JSValuePtr::asCell):
13570 (JSC::JSValuePtr::isNumber):
13571 * runtime/JSGlobalObjectFunctions.cpp:
13572 (JSC::globalFuncParseInt):
13573 * runtime/JSImmediate.h:
13574 (JSC::js0):
13575 (JSC::jsImpossibleValue):
13576 (JSC::JSValuePtr::toInt32):
13577 (JSC::JSValuePtr::toUInt32):
13578 (JSC::JSValuePtr::isCell):
13579 (JSC::JSValuePtr::isInt32Fast):
13580 (JSC::JSValuePtr::getInt32Fast):
13581 (JSC::JSValuePtr::isUInt32Fast):
13582 (JSC::JSValuePtr::getUInt32Fast):
13583 (JSC::JSValuePtr::makeInt32Fast):
13584 (JSC::JSValuePtr::areBothInt32Fast):
13585 (JSC::JSFastMath::canDoFastBitwiseOperations):
13586 (JSC::JSFastMath::equal):
13587 (JSC::JSFastMath::notEqual):
13588 (JSC::JSFastMath::andImmediateNumbers):
13589 (JSC::JSFastMath::xorImmediateNumbers):
13590 (JSC::JSFastMath::orImmediateNumbers):
13591 (JSC::JSFastMath::canDoFastRshift):
13592 (JSC::JSFastMath::canDoFastUrshift):
13593 (JSC::JSFastMath::rightShiftImmediateNumbers):
13594 (JSC::JSFastMath::canDoFastAdditiveOperations):
13595 (JSC::JSFastMath::addImmediateNumbers):
13596 (JSC::JSFastMath::subImmediateNumbers):
13597 (JSC::JSFastMath::incImmediateNumber):
13598 (JSC::JSFastMath::decImmediateNumber):
13599 * runtime/JSNumberCell.h:
13600 (JSC::JSValuePtr::asNumberCell):
13601 (JSC::jsNumber):
13602 (JSC::JSValuePtr::uncheckedGetNumber):
13603 (JSC::JSNumberCell::toInt32):
13604 (JSC::JSNumberCell::toUInt32):
13605 (JSC::JSValuePtr::toJSNumber):
13606 (JSC::JSValuePtr::getNumber):
13607 (JSC::JSValuePtr::numberToInt32):
13608 (JSC::JSValuePtr::numberToUInt32):
13609 * runtime/JSObject.h:
13610 (JSC::JSValuePtr::isObject):
13611 (JSC::JSValuePtr::get):
13612 (JSC::JSValuePtr::put):
13613 * runtime/JSValue.cpp:
13614 (JSC::JSValuePtr::toInteger):
13615 (JSC::JSValuePtr::toIntegerPreserveNaN):
13616 * runtime/JSValue.h:
13617 * runtime/Operations.cpp:
13618 (JSC::JSValuePtr::equalSlowCase):
13619 (JSC::JSValuePtr::strictEqualSlowCase):
13620 * runtime/Operations.h:
13621 (JSC::JSValuePtr::equal):
13622 (JSC::JSValuePtr::equalSlowCaseInline):
13623 (JSC::JSValuePtr::strictEqual):
13624 (JSC::JSValuePtr::strictEqualSlowCaseInline):
13625 * runtime/Protect.h:
13626 (JSC::gcProtect):
13627 (JSC::gcUnprotect):
13628 * runtime/StringPrototype.cpp:
13629 (JSC::stringProtoFuncCharAt):
13630 (JSC::stringProtoFuncCharCodeAt):
13631 * runtime/Structure.cpp:
13632 (JSC::Structure::createCachedPrototypeChain):
13633
13634 2009-01-12 Kevin Ollivier <kevino@theolliviers.com>
13635
13636 Since date time functions have moved here, now the wx port JSC
13637 needs to depend on wx.
13638
13639 * jscore.bkl:
13640
13641 2009-01-11 David Levin <levin@chromium.org>
13642
13643 Reviewed by Darin Adler.
13644
13645 https://bugs.webkit.org/show_bug.cgi?id=23245
13646
13647 Add initializeThreading to key places in JS API to ensure that
13648 UString is properly initialized.
13649
13650 * API/JSContextRef.cpp:
13651 (JSContextGroupCreate):
13652 (JSGlobalContextCreate):
13653 * API/JSObjectRef.cpp:
13654 (JSClassCreate):
13655 * API/JSStringRef.cpp:
13656 (JSStringCreateWithCharacters):
13657 (JSStringCreateWithUTF8CString):
13658 * API/JSStringRefCF.cpp:
13659 (JSStringCreateWithCFString):
13660
13661 2009-01-11 David Levin <levin@chromium.org>
13662
13663 Reviewed by Darin Adler.
13664
13665 https://bugs.webkit.org/show_bug.cgi?id=23175
13666
13667 Separate out BaseString information from UString::Rep and make all baseString access go through
13668 a member function, so that it may be used for something else (in the future) in the BaseString
13669 case.
13670
13671 * runtime/SmallStrings.cpp:
13672 (JSC::SmallStringsStorage::rep):
13673 (JSC::SmallStringsStorage::SmallStringsStorage):
13674 (JSC::SmallStrings::SmallStrings):
13675 (JSC::SmallStrings::mark):
13676 Adjust to account for the changes in UString and put the UString in place in
13677 SmallStringsStorage to aid in locality of reference among the UChar[] and UString::Rep's.
13678
13679 * runtime/SmallStrings.h:
13680 * runtime/UString.cpp:
13681 (JSC::initializeStaticBaseString):
13682 (JSC::initializeUString):
13683 (JSC::UString::Rep::create):
13684 (JSC::UString::Rep::destroy):
13685 (JSC::UString::Rep::checkConsistency):
13686 (JSC::expandCapacity):
13687 (JSC::UString::expandPreCapacity):
13688 (JSC::concatenate):
13689 (JSC::UString::append):
13690 (JSC::UString::operator=):
13691 * runtime/UString.h:
13692 (JSC::UString::Rep::baseIsSelf):
13693 (JSC::UString::Rep::setBaseString):
13694 (JSC::UString::Rep::baseString):
13695 (JSC::UString::Rep::):
13696 (JSC::UString::Rep::null):
13697 (JSC::UString::Rep::empty):
13698 (JSC::UString::Rep::data):
13699 (JSC::UString::cost):
13700 Separate out the items out used by base strings from those used in Rep's that only
13701 point to base strings. (This potentially saves 24 bytes per Rep.)
13702
13703 2009-01-11 Darin Adler <darin@apple.com>
13704
13705 Reviewed by Dan Bernstein.
13706
13707 Bug 23239: improve handling of unused arguments in JavaScriptCore
13708 https://bugs.webkit.org/show_bug.cgi?id=23239
13709
13710 * runtime/DatePrototype.cpp: Moved LocaleDateTimeFormat enum outside #if
13711 so we can use this on all platforms. Changed valueOf to share the same
13712 function with getTime, since the contents of the two are identical. Removed
13713 a FIXME since the idea isn't really specific enough or helpful enough to
13714 need to sit here in the source code.
13715 (JSC::formatLocaleDate): Changed the Mac version of this function to take
13716 the same arguments as the non-Mac version so the caller doesn't have to
13717 special-case the two platforms. Also made the formatString array be const;
13718 before the characters were, but the array was a modifiable global variable.
13719 (JSC::dateProtoFuncToLocaleString): Changed to call the new unified
13720 version of formatLocaleDate and remove the ifdef.
13721 (JSC::dateProtoFuncToLocaleDateString): Ditto.
13722 (JSC::dateProtoFuncToLocaleTimeString): Ditto.
13723
13724 * runtime/JSNotAnObject.cpp:
13725 (JSC::JSNotAnObject::toObject): Use the new ASSERT_UNUSED instead of the
13726 old UNUSED_PARAM.
13727
13728 * runtime/RegExp.cpp:
13729 (JSC::RegExp::RegExp): Changed to only use UNUSED_PARAM when the parameter
13730 is actually unused.
13731
13732 * wtf/TCSystemAlloc.cpp:
13733 (TCMalloc_SystemRelease): Changed to only use UNUSED_PARAM when the parameter
13734 is actually unused.
13735 (TCMalloc_SystemCommit): Changed to omit the argument names instead of using
13736 UNUSED_PARAM.
13737
13738 2009-01-11 Oliver Hunt <oliver@apple.com>
13739
13740 Reviewed by NOBODY (Build fix).
13741
13742 Fix the build (whoops)
13743
13744 * interpreter/Interpreter.cpp:
13745 (JSC::Interpreter::cti_op_get_by_val):
13746
13747 2009-01-11 Oliver Hunt <oliver@apple.com>
13748
13749 Reviewed by Darin Adler and Anders Carlsson
13750
13751 Bug 23128: get/put_by_val need to respecialise in the face of ByteArray
13752
13753 Restructure the code slightly, and add comments per Darin's suggestions
13754
13755 * interpreter/Interpreter.cpp:
13756 (JSC::Interpreter::cti_op_get_by_val):
13757 (JSC::Interpreter::cti_op_get_by_val_byte_array):
13758 (JSC::Interpreter::cti_op_put_by_val):
13759 (JSC::Interpreter::cti_op_put_by_val_byte_array):
13760
13761 2009-01-11 Oliver Hunt <oliver@apple.com>
13762
13763 Reviewed by Anders Carlsson.
13764
13765 Whoops, I accidentally removed an exception check from fast the
13766 fast path for string indexing when i originally landed the
13767 byte array logic.
13768
13769 * interpreter/Interpreter.cpp:
13770 (JSC::Interpreter::cti_op_get_by_val):
13771
13772 2009-01-11 Oliver Hunt <oliver@apple.com>
13773
13774 Reviewed by Anders Carlsson.
13775
13776 Bug 23128: get/put_by_val need to respecialise in the face of ByteArray
13777 <https://bugs.webkit.org/show_bug.cgi?id=23128>
13778
13779 Fairly simple patch, add specialised versions of cti_op_get/put_by_val
13780 that assume ByteArray, thus avoiding a few branches in the case of bytearray
13781 manipulation.
13782
13783 No effect on SunSpider. 15% win on the original testcase.
13784
13785 * interpreter/Interpreter.cpp:
13786 (JSC::Interpreter::cti_op_get_by_val):
13787 (JSC::Interpreter::cti_op_get_by_val_byte_array):
13788 (JSC::Interpreter::cti_op_put_by_val):
13789 (JSC::Interpreter::cti_op_put_by_val_byte_array):
13790 * interpreter/Interpreter.h:
13791
13792 2009-01-11 Alexey Proskuryakov <ap@webkit.org>
13793
13794 Try to fix Windows build.
13795
13796 * wtf/CurrentTime.cpp: Added a definition of msPerSecond (previously, this code was in
13797 DateMath.cpp, with constant definition in DateTime.h)
13798
13799 2009-01-11 Alexey Proskuryakov <ap@webkit.org>
13800
13801 Try to fix Windows build.
13802
13803 * wtf/CurrentTime.cpp: Include <sys/types.h> and <sys/timeb.h>, as MSDN says to.
13804
13805 2009-01-11 Dmitry Titov <dimich@chromium.org>
13806
13807 Reviewed by Darin Adler.
13808
13809 https://bugs.webkit.org/show_bug.cgi?id=23207
13810 Moved currentTime() to from WebCore to WTF.
13811
13812 * GNUmakefile.am:
13813 * JavaScriptCore.exp: added export for WTF::currentTime()
13814 * JavaScriptCore.pri:
13815 * JavaScriptCore.scons:
13816 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
13817 * JavaScriptCore.xcodeproj/project.pbxproj:
13818 * JavaScriptCoreSources.bkl:
13819 * runtime/DateMath.cpp:
13820 (JSC::getCurrentUTCTimeWithMicroseconds): This function had another implementation of currentTime(), essentially. Now uses WTF version.
13821 * wtf/CurrentTime.cpp: Added.
13822 (WTF::currentTime):
13823 (WTF::highResUpTime):
13824 (WTF::lowResUTCTime):
13825 (WTF::qpcAvailable):
13826 * wtf/CurrentTime.h: Added.
13827
13828 2009-01-09 Gavin Barraclough <barraclough@apple.com>
13829
13830 Reviewed by Oliver Hunt.
13831
13832 Stage two of converting JSValue from a pointer to a class type.
13833 Remove the class JSValue. The functionallity has been transitioned
13834 into the wrapper class type JSValuePtr.
13835
13836 The last stage will be to rename JSValuePtr to JSValue, remove the
13837 overloaded -> operator, and switch operations on JSValuePtrs from
13838 using '->' to use '.' instead.
13839
13840 * API/APICast.h:
13841 * JavaScriptCore.exp:
13842 * runtime/JSCell.h:
13843 (JSC::asCell):
13844 (JSC::JSValuePtr::asCell):
13845 (JSC::JSValuePtr::isNumber):
13846 (JSC::JSValuePtr::isString):
13847 (JSC::JSValuePtr::isGetterSetter):
13848 (JSC::JSValuePtr::isObject):
13849 (JSC::JSValuePtr::getNumber):
13850 (JSC::JSValuePtr::getString):
13851 (JSC::JSValuePtr::getObject):
13852 (JSC::JSValuePtr::getCallData):
13853 (JSC::JSValuePtr::getConstructData):
13854 (JSC::JSValuePtr::getUInt32):
13855 (JSC::JSValuePtr::getTruncatedInt32):
13856 (JSC::JSValuePtr::getTruncatedUInt32):
13857 (JSC::JSValuePtr::mark):
13858 (JSC::JSValuePtr::marked):
13859 (JSC::JSValuePtr::toPrimitive):
13860 (JSC::JSValuePtr::getPrimitiveNumber):
13861 (JSC::JSValuePtr::toBoolean):
13862 (JSC::JSValuePtr::toNumber):
13863 (JSC::JSValuePtr::toString):
13864 (JSC::JSValuePtr::toObject):
13865 (JSC::JSValuePtr::toThisObject):
13866 (JSC::JSValuePtr::needsThisConversion):
13867 (JSC::JSValuePtr::toThisString):
13868 (JSC::JSValuePtr::getJSNumber):
13869 * runtime/JSImmediate.h:
13870 (JSC::JSValuePtr::isUndefined):
13871 (JSC::JSValuePtr::isNull):
13872 (JSC::JSValuePtr::isUndefinedOrNull):
13873 (JSC::JSValuePtr::isBoolean):
13874 (JSC::JSValuePtr::getBoolean):
13875 (JSC::JSValuePtr::toInt32):
13876 (JSC::JSValuePtr::toUInt32):
13877 * runtime/JSNumberCell.h:
13878 (JSC::JSValuePtr::uncheckedGetNumber):
13879 (JSC::JSValuePtr::toJSNumber):
13880 * runtime/JSObject.h:
13881 (JSC::JSValuePtr::isObject):
13882 (JSC::JSValuePtr::get):
13883 (JSC::JSValuePtr::put):
13884 * runtime/JSString.h:
13885 (JSC::JSValuePtr::toThisJSString):
13886 * runtime/JSValue.cpp:
13887 (JSC::JSValuePtr::toInteger):
13888 (JSC::JSValuePtr::toIntegerPreserveNaN):
13889 (JSC::JSValuePtr::toInt32SlowCase):
13890 (JSC::JSValuePtr::toUInt32SlowCase):
13891 * runtime/JSValue.h:
13892 (JSC::JSValuePtr::makeImmediate):
13893 (JSC::JSValuePtr::immediateValue):
13894 (JSC::JSValuePtr::JSValuePtr):
13895 (JSC::JSValuePtr::operator->):
13896 (JSC::JSValuePtr::operator bool):
13897 (JSC::JSValuePtr::operator==):
13898 (JSC::JSValuePtr::operator!=):
13899 (JSC::JSValuePtr::encode):
13900 (JSC::JSValuePtr::decode):
13901 (JSC::JSValuePtr::toFloat):
13902 (JSC::JSValuePtr::asValue):
13903 (JSC::operator==):
13904 (JSC::operator!=):
13905
13906 2009-01-09 David Levin <levin@chromium.org>
13907
13908 Reviewed by Oliver Hunt.
13909
13910 https://bugs.webkit.org/show_bug.cgi?id=23175
13911
13912 Adjustment to previous patch. Remove call to initilizeThreading from JSGlobalCreate
13913 and fix jsc.cpp instead.
13914
13915 * jsc.cpp:
13916 (main):
13917 (jscmain):
13918 * runtime/JSGlobalData.cpp:
13919 (JSC::JSGlobalData::create):
13920
13921 2009-01-09 Sam Weinig <sam@webkit.org>
13922
13923 Roll r39720 back in with a working interpreted mode.
13924
13925 2009-01-09 David Levin <levin@chromium.org>
13926
13927 Reviewed by Oliver Hunt.
13928
13929 https://bugs.webkit.org/show_bug.cgi?id=23175
13930
13931 Added a template to make the pointer and flags combination
13932 in UString more readable and less error prone.
13933
13934 * GNUmakefile.am:
13935 * JavaScriptCore.exp:
13936 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
13937 * JavaScriptCore.xcodeproj/project.pbxproj:
13938 Added PtrAndFlags.h (and sorted the xcode project file).
13939
13940 * runtime/Identifier.cpp:
13941 (JSC::Identifier::add):
13942 (JSC::Identifier::addSlowCase):
13943 * runtime/InitializeThreading.cpp:
13944 (JSC::initializeThreadingOnce):
13945 Made the init threading initialize the UString globals. Before
13946 these were initilized using {} but that became harder due to the
13947 addition of this tempalte class.
13948
13949 * runtime/JSGlobalData.cpp:
13950 (JSC::JSGlobalData::create):
13951 * runtime/PropertyNameArray.cpp:
13952 (JSC::PropertyNameArray::add):
13953 * runtime/UString.cpp:
13954 (JSC::initializeStaticBaseString):
13955 (JSC::initializeUString):
13956 (JSC::UString::Rep::create):
13957 (JSC::UString::Rep::createFromUTF8):
13958 (JSC::createRep):
13959 (JSC::UString::UString):
13960 (JSC::concatenate):
13961 (JSC::UString::operator=):
13962 (JSC::UString::makeNull):
13963 (JSC::UString::nullRep):
13964 * runtime/UString.h:
13965 (JSC::UString::Rep::identifierTable):
13966 (JSC::UString::Rep::setIdentifierTable):
13967 (JSC::UString::Rep::isStatic):
13968 (JSC::UString::Rep::setStatic):
13969 (JSC::UString::Rep::):
13970 (JSC::UString::Rep::null):
13971 (JSC::UString::Rep::empty):
13972 (JSC::UString::isNull):
13973 (JSC::UString::null):
13974 (JSC::UString::UString):
13975
13976 * wtf/PtrAndFlags.h: Added.
13977 (WTF::PtrAndFlags::PtrAndFlags):
13978 (WTF::PtrAndFlags::isFlagSet):
13979 (WTF::PtrAndFlags::setFlag):
13980 (WTF::PtrAndFlags::clearFlag):
13981 (WTF::PtrAndFlags::get):
13982 (WTF::PtrAndFlags::set):
13983 A simple way to layer together a pointer and 2 flags. It relies on the pointer being 4 byte aligned,
13984 which should happen for all allocators (due to aligning pointers, int's, etc. on 4 byte boundaries).
13985
13986 2009-01-08 Gavin Barraclough <barraclough@apple.com>
13987
13988 Reviewed by -O-l-i-v-e-r- -H-u-n-t- Sam Weinig (sorry, Sam!).
13989
13990 Encode immediates in the low word of JSValuePtrs, on x86-64.
13991
13992 On 32-bit platforms a JSValuePtr may represent a 31-bit signed integer.
13993 On 64-bit platforms, if USE(ALTERNATE_JSIMMEDIATE) is defined, a full
13994 32-bit integer may be stored in an immediate.
13995
13996 Presently USE(ALTERNATE_JSIMMEDIATE) uses the same encoding as the default
13997 immediate format - the value is left shifted by one, so a one bit tag can
13998 be added to indicate the value is an immediate. However this means that
13999 values must be commonly be detagged (by right shifting by one) before
14000 arithmetic operations can be performed on immediates. This patch modifies
14001 the formattting so the the high bits of the immediate mark values as being
14002 integer.
14003
14004 * assembler/MacroAssembler.h:
14005 (JSC::MacroAssembler::not32):
14006 (JSC::MacroAssembler::orPtr):
14007 (JSC::MacroAssembler::zeroExtend32ToPtr):
14008 (JSC::MacroAssembler::jaePtr):
14009 (JSC::MacroAssembler::jbPtr):
14010 (JSC::MacroAssembler::jnzPtr):
14011 (JSC::MacroAssembler::jzPtr):
14012 * assembler/X86Assembler.h:
14013 (JSC::X86Assembler::):
14014 (JSC::X86Assembler::notl_r):
14015 (JSC::X86Assembler::testq_i32r):
14016 * jit/JIT.cpp:
14017 (JSC::JIT::privateCompileMainPass):
14018 (JSC::JIT::privateCompileSlowCases):
14019 (JSC::JIT::privateCompileCTIMachineTrampolines):
14020 * jit/JIT.h:
14021 * jit/JITArithmetic.cpp:
14022 (JSC::JIT::compileFastArith_op_lshift):
14023 (JSC::JIT::compileFastArith_op_rshift):
14024 (JSC::JIT::compileFastArith_op_bitand):
14025 (JSC::JIT::compileFastArithSlow_op_bitand):
14026 (JSC::JIT::compileFastArith_op_mod):
14027 (JSC::JIT::compileFastArithSlow_op_mod):
14028 (JSC::JIT::compileFastArith_op_add):
14029 (JSC::JIT::compileFastArith_op_mul):
14030 (JSC::JIT::compileFastArith_op_post_inc):
14031 (JSC::JIT::compileFastArith_op_post_dec):
14032 (JSC::JIT::compileFastArith_op_pre_inc):
14033 (JSC::JIT::compileFastArith_op_pre_dec):
14034 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
14035 (JSC::JIT::compileBinaryArithOp):
14036 * jit/JITCall.cpp:
14037 (JSC::JIT::compileOpCallSlowCase):
14038 * jit/JITInlineMethods.h:
14039 (JSC::JIT::emitJumpIfJSCell):
14040 (JSC::JIT::emitJumpIfNotJSCell):
14041 (JSC::JIT::emitJumpIfImmNum):
14042 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
14043 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
14044 (JSC::JIT::emitFastArithDeTagImmediate):
14045 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
14046 (JSC::JIT::emitFastArithReTagImmediate):
14047 (JSC::JIT::emitFastArithImmToInt):
14048 (JSC::JIT::emitFastArithIntToImmNoCheck):
14049 (JSC::JIT::emitTagAsBoolImmediate):
14050 * jit/JITPropertyAccess.cpp:
14051 (JSC::resizePropertyStorage):
14052 (JSC::JIT::privateCompilePutByIdTransition):
14053 (JSC::JIT::privateCompilePatchGetArrayLength):
14054 (JSC::JIT::privateCompileGetByIdSelf):
14055 (JSC::JIT::privateCompileGetByIdProto):
14056 (JSC::JIT::privateCompileGetByIdChain):
14057 (JSC::JIT::privateCompilePutByIdReplace):
14058 * runtime/JSImmediate.h:
14059 (JSC::JSImmediate::isNumber):
14060 (JSC::JSImmediate::isPositiveNumber):
14061 (JSC::JSImmediate::areBothImmediateNumbers):
14062 (JSC::JSImmediate::xorImmediateNumbers):
14063 (JSC::JSImmediate::rightShiftImmediateNumbers):
14064 (JSC::JSImmediate::canDoFastAdditiveOperations):
14065 (JSC::JSImmediate::addImmediateNumbers):
14066 (JSC::JSImmediate::subImmediateNumbers):
14067 (JSC::JSImmediate::makeInt):
14068 (JSC::JSImmediate::toBoolean):
14069 * wtf/Platform.h:
14070
14071 2009-01-08 Sam Weinig <sam@webkit.org>
14072
14073 Revert r39720. It broke Interpreted mode.
14074
14075 2009-01-08 Sam Weinig <sam@webkit.org>
14076
14077 Reviewed by Oliver Hunt.
14078
14079 Fix for https://bugs.webkit.org/show_bug.cgi?id=23197
14080 Delay creating the PCVector until an exception is thrown
14081 Part of <rdar://problem/6469060>
14082 Don't store exception information for a CodeBlock until first exception is thrown
14083
14084 - Change the process for re-parsing/re-generating bytecode for exception information
14085 to use data from the original CodeBlock (offsets of GlobalResolve instructions) to
14086 aid in creating an identical instruction stream on re-parse, instead of padding
14087 interchangeable opcodes, which would result in different JITed code.
14088 - Fix bug where the wrong ScopeChainNode was used when re-parsing/regenerating from
14089 within some odd modified scope chains.
14090 - Lazily create the pcVector by re-JITing the regenerated CodeBlock and stealing the
14091 the pcVector from it.
14092
14093 Saves ~2MB on Membuster head.
14094
14095 * bytecode/CodeBlock.cpp:
14096 (JSC::CodeBlock::dump):
14097 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
14098 (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
14099 (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
14100 * bytecode/CodeBlock.h:
14101 (JSC::JITCodeRef::JITCodeRef):
14102 (JSC::GlobalResolveInfo::GlobalResolveInfo):
14103 (JSC::CodeBlock::getBytecodeIndex):
14104 (JSC::CodeBlock::addGlobalResolveInstruction):
14105 (JSC::CodeBlock::addGlobalResolveInfo):
14106 (JSC::CodeBlock::addFunctionRegisterInfo):
14107 (JSC::CodeBlock::hasExceptionInfo):
14108 (JSC::CodeBlock::pcVector):
14109 (JSC::EvalCodeBlock::EvalCodeBlock):
14110 (JSC::EvalCodeBlock::baseScopeDepth):
14111 * bytecode/Opcode.h:
14112 * bytecompiler/BytecodeGenerator.cpp:
14113 (JSC::BytecodeGenerator::BytecodeGenerator):
14114 (JSC::BytecodeGenerator::emitResolve):
14115 (JSC::BytecodeGenerator::emitGetScopedVar):
14116 * bytecompiler/BytecodeGenerator.h:
14117 (JSC::BytecodeGenerator::setRegeneratingForExceptionInfo):
14118 * interpreter/Interpreter.cpp:
14119 (JSC::bytecodeOffsetForPC):
14120 (JSC::Interpreter::unwindCallFrame):
14121 (JSC::Interpreter::privateExecute):
14122 (JSC::Interpreter::retrieveLastCaller):
14123 (JSC::Interpreter::cti_op_instanceof):
14124 (JSC::Interpreter::cti_op_call_NotJSFunction):
14125 (JSC::Interpreter::cti_op_resolve):
14126 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
14127 (JSC::Interpreter::cti_op_resolve_func):
14128 (JSC::Interpreter::cti_op_resolve_skip):
14129 (JSC::Interpreter::cti_op_resolve_global):
14130 (JSC::Interpreter::cti_op_resolve_with_base):
14131 (JSC::Interpreter::cti_op_throw):
14132 (JSC::Interpreter::cti_op_in):
14133 (JSC::Interpreter::cti_vm_throw):
14134 * jit/JIT.cpp:
14135 (JSC::JIT::privateCompile):
14136 * parser/Nodes.cpp:
14137 (JSC::EvalNode::generateBytecode):
14138 (JSC::EvalNode::bytecodeForExceptionInfoReparse):
14139 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
14140 * parser/Nodes.h:
14141
14142 2009-01-08 Jian Li <jianli@chromium.org>
14143
14144 Reviewed by Alexey Proskuryakov.
14145
14146 Add Win32 implementation of ThreadSpecific.
14147 https://bugs.webkit.org/show_bug.cgi?id=22614
14148
14149 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
14150 * wtf/ThreadSpecific.h:
14151 (WTF::ThreadSpecific::ThreadSpecific):
14152 (WTF::ThreadSpecific::~ThreadSpecific):
14153 (WTF::ThreadSpecific::get):
14154 (WTF::ThreadSpecific::set):
14155 (WTF::ThreadSpecific::destroy):
14156 * wtf/ThreadSpecificWin.cpp: Added.
14157 (WTF::ThreadSpecificThreadExit):
14158 * wtf/ThreadingWin.cpp:
14159 (WTF::wtfThreadEntryPoint):
14160
14161 2009-01-08 Justin McPherson <justin.mcpherson@nokia.com>
14162
14163 Reviewed by Simon Hausmann.
14164
14165 Fix compilation with Qt on NetBSD.
14166
14167 * runtime/Collector.cpp:
14168 (JSC::currentThreadStackBase): Use PLATFORM(NETBSD) to enter the
14169 code path to retrieve the stack base using pthread_attr_get_np.
14170 The PTHREAD_NP_H define is not used because the header file does
14171 not exist on NetBSD, but the function is declared nevertheless.
14172 * wtf/Platform.h: Introduce WTF_PLATFORM_NETBSD.
14173
14174 2009-01-07 Sam Weinig <sam@webkit.org>
14175
14176 Reviewed by Geoffrey Garen.
14177
14178 <rdar://problem/6469060> Don't store exception information for a CodeBlock until first exception is thrown
14179
14180 Don't initially store exception information (lineNumber/expressionRange/getByIdExcecptionInfo)
14181 in CodeBlocks blocks. Instead, re-parse for the data on demand and cache it then.
14182
14183 One important change that was needed to make this work was to pad op_get_global_var with nops to
14184 be the same length as op_resolve_global, since one could be replaced for the other on re-parsing,
14185 and we want to keep the offsets bytecode offsets the same.
14186
14187 1.3MB improvement on Membuster head.
14188
14189 * bytecode/CodeBlock.cpp:
14190 (JSC::CodeBlock::dump): Update op_get_global_var to account for the padding.
14191 (JSC::CodeBlock::dumpStatistics): Add more statistic dumping.
14192 (JSC::CodeBlock::CodeBlock): Initialize m_exceptionInfo.
14193 (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): Re-parses the CodeBlocks
14194 associated SourceCode and steals the ExceptionInfo from it.
14195 (JSC::CodeBlock::lineNumberForBytecodeOffset): Creates the exception info on demand.
14196 (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
14197 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
14198 * bytecode/CodeBlock.h:
14199 (JSC::CodeBlock::numberOfExceptionHandlers): Updated to account for m_exceptionInfo indirection.
14200 (JSC::CodeBlock::addExceptionHandler): Ditto.
14201 (JSC::CodeBlock::exceptionHandler): Ditto.
14202 (JSC::CodeBlock::clearExceptionInfo): Ditto.
14203 (JSC::CodeBlock::addExpressionInfo): Ditto.
14204 (JSC::CodeBlock::addGetByIdExceptionInfo): Ditto.
14205 (JSC::CodeBlock::numberOfLineInfos): Ditto.
14206 (JSC::CodeBlock::addLineInfo): Ditto.
14207 (JSC::CodeBlock::lastLineInfo): Ditto.
14208
14209 * bytecode/Opcode.h: Change length of op_get_global_var to match op_resolve_global.
14210
14211 * bytecode/SamplingTool.cpp:
14212 (JSC::SamplingTool::dump): Add comment indicating why it is okay not to pass a CallFrame.
14213
14214 * bytecompiler/BytecodeGenerator.cpp:
14215 (JSC::BytecodeGenerator::generate): Clear the exception info after generation for Function and Eval
14216 Code when not in regenerate for exception info mode.
14217 (JSC::BytecodeGenerator::BytecodeGenerator): Initialize m_regeneratingForExceptionInfo to false.
14218 (JSC::BytecodeGenerator::emitGetScopedVar): Pad op_get_global_var with 2 nops.
14219 * bytecompiler/BytecodeGenerator.h:
14220 (JSC::BytecodeGenerator::setRegeneratingForExcpeptionInfo): Added.
14221
14222 * interpreter/Interpreter.cpp:
14223 (JSC::Interpreter::throwException): Pass the CallFrame to exception info accessors.
14224 (JSC::Interpreter::privateExecute): Ditto.
14225 (JSC::Interpreter::retrieveLastCaller): Ditto.
14226 (JSC::Interpreter::cti_op_new_error): Ditto.
14227
14228 * jit/JIT.cpp:
14229 (JSC::JIT::privateCompileMainPass): Pass the current bytecode offset instead of hard coding the
14230 line number, the stub will do the accessing if it gets called.
14231
14232 * parser/Nodes.cpp:
14233 (JSC::ProgramNode::emitBytecode): Moved.
14234 (JSC::ProgramNode::generateBytecode): Moved.
14235 (JSC::EvalNode::create): Moved.
14236 (JSC::EvalNode::bytecodeForExceptionInfoReparse): Added.
14237 (JSC::FunctionBodyNode::generateBytecode): Rename reparse to reparseInPlace.
14238 (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse): Addded.
14239
14240 * parser/Nodes.h:
14241 (JSC::ScopeNode::features): Added getter.
14242 * parser/Parser.cpp:
14243 (JSC::Parser::reparseInPlace): Renamed from reparse.
14244 * parser/Parser.h:
14245 (JSC::Parser::reparse): Added. Re-parses the passed in Node into
14246 a new Node.
14247 * runtime/ExceptionHelpers.cpp:
14248 (JSC::createUndefinedVariableError): Pass along CallFrame.
14249 (JSC::createInvalidParamError): Ditto.
14250 (JSC::createNotAConstructorError): Ditto.
14251 (JSC::createNotAFunctionError): Ditto.
14252 (JSC::createNotAnObjectError): Ditto.
14253
14254 2009-01-06 Gavin Barraclough <baraclough@apple.com>
14255
14256 Reviewed by Maciej Stachowiak.
14257
14258 Replace accidentally removed references in BytecodeGenerator, deleting these
14259 will be hindering the sharing of constant numbers and strings.
14260
14261 The code to add a new constant (either number or string) to their respective
14262 map works by attempting to add a null entry, then checking the result of the
14263 add for null. The first time, this should return the null (or noValue).
14264 The code checks for null (to see if this is the initial add), and then allocates
14265 a new number / string object. This code relies on the result returned from
14266 the add to the map being stored as a reference, such that the allocated object
14267 will be stored in the map, and will be resused if the same constant is encountered
14268 again. By failing to use a reference we will be leaking GC object for each
14269 additional entry added to the map. As GC objects they should be clollected,
14270 be we should no be allocatin them in the first place.
14271
14272 https://bugs.webkit.org/show_bug.cgi?id=23158
14273
14274 * bytecompiler/BytecodeGenerator.cpp:
14275 (JSC::BytecodeGenerator::emitLoad):
14276
14277 2009-01-06 Oliver Hunt <oliver@apple.com>
14278
14279 Reviewed by Gavin Barraclough.
14280
14281 <rdar://problem/6040850> JavaScript register file should use VirtualAlloc on Windows
14282
14283 Fairly simple, just reserve 4Mb of address space for the
14284 register file, and then commit one section at a time. We
14285 don't release committed memory as we drop back, but then
14286 mac doesn't either so this probably not too much of a
14287 problem.
14288
14289 * interpreter/RegisterFile.cpp:
14290 (JSC::RegisterFile::~RegisterFile):
14291 * interpreter/RegisterFile.h:
14292 (JSC::RegisterFile::RegisterFile):
14293 (JSC::RegisterFile::grow):
14294
14295 2009-01-06 Alexey Proskuryakov <ap@webkit.org>
14296
14297 Reviewed by Darin Adler.
14298
14299 https://bugs.webkit.org/show_bug.cgi?id=23142
14300 ThreadGlobalData leaks seen on buildbot
14301
14302 * wtf/ThreadSpecific.h: (WTF::ThreadSpecific::destroy): Temporarily reset the thread
14303 specific value to make getter work on Mac OS X.
14304
14305 * wtf/Platform.h: Touch this file again to make sure all Windows builds use the most recent
14306 version of ThreadSpecific.h.
14307
14308 2009-01-05 Gavin Barraclough <baraclough@apple.com>
14309
14310 Reviewed by Oliver Hunt.
14311
14312 Replace all uses of JSValue* with a new smart pointer type, JSValuePtr.
14313
14314 A JavaScript value may be a heap object or boxed primitive, represented by a
14315 pointer, or may be an unboxed immediate value, such as an integer. Since a
14316 value may dynamically need to contain either a pointer value or an immediate,
14317 we encode immediates as pointer values (since all valid JSCell pointers are
14318 allocated at alligned addesses, unaligned addresses are available to encode
14319 immediates). As such all JavaScript values are represented using a JSValue*.
14320
14321 This implementation is encumbered by a number of constraints. It ties the
14322 JSValue representation to the size of pointer on the platform, which, for
14323 example, means that we currently can represent different ranges of integers
14324 as immediates on x86 and x86-64. It also prevents us from overloading the
14325 to-boolean conversion used to test for noValue() - effectively forcing us
14326 to represent noValue() as 0. This would potentially be problematic were we
14327 to wish to encode integer values differently (e.g. were we to use the v8
14328 encoding, where pointers are tagged with 1 and integers with 0, then the
14329 immediate integer 0 would conflict with noValue()).
14330
14331 This patch replaces all usage of JSValue* with a new class, JSValuePtr,
14332 which encapsulates the pointer. JSValuePtr maintains the same interface as
14333 JSValue*, overloading operator-> and operator bool such that previous
14334 operations in the code on variables of type JSValue* are still supported.
14335
14336 In order to provide a ProtectPtr<> type with support for the new value
14337 representation (without using the internal JSValue type directly), a new
14338 ProtectJSValuePtr type has been added, equivalent to the previous type
14339 ProtectPtr<JSValue>.
14340
14341 This patch is likely the first in a sequence of three changes. With the
14342 value now encapsulated it will likely make sense to migrate the functionality
14343 from JSValue into JSValuePtr, such that the internal pointer representation
14344 need not be exposed. Through migrating the functionality to the wrapper
14345 class the existing JSValue should be rendered redundant, and the class is
14346 likely to be removed (the JSValuePtr now wrapping a pointer to a JSCell).
14347 At this stage it will likely make sense to rename JSValuePtr to JSValue.
14348
14349 https://bugs.webkit.org/show_bug.cgi?id=23114
14350
14351 * API/APICast.h:
14352 (toJS):
14353 (toRef):
14354 * API/JSBase.cpp:
14355 (JSEvaluateScript):
14356 * API/JSCallbackConstructor.h:
14357 (JSC::JSCallbackConstructor::createStructure):
14358 * API/JSCallbackFunction.cpp:
14359 (JSC::JSCallbackFunction::call):
14360 * API/JSCallbackFunction.h:
14361 (JSC::JSCallbackFunction::createStructure):
14362 * API/JSCallbackObject.h:
14363 (JSC::JSCallbackObject::createStructure):
14364 * API/JSCallbackObjectFunctions.h:
14365 (JSC::::asCallbackObject):
14366 (JSC::::put):
14367 (JSC::::hasInstance):
14368 (JSC::::call):
14369 (JSC::::staticValueGetter):
14370 (JSC::::staticFunctionGetter):
14371 (JSC::::callbackGetter):
14372 * API/JSContextRef.cpp:
14373 * API/JSObjectRef.cpp:
14374 (JSObjectMakeConstructor):
14375 (JSObjectSetPrototype):
14376 (JSObjectGetProperty):
14377 (JSObjectSetProperty):
14378 (JSObjectGetPropertyAtIndex):
14379 (JSObjectSetPropertyAtIndex):
14380 * API/JSValueRef.cpp:
14381 (JSValueGetType):
14382 (JSValueIsUndefined):
14383 (JSValueIsNull):
14384 (JSValueIsBoolean):
14385 (JSValueIsNumber):
14386 (JSValueIsString):
14387 (JSValueIsObject):
14388 (JSValueIsObjectOfClass):
14389 (JSValueIsEqual):
14390 (JSValueIsStrictEqual):
14391 (JSValueIsInstanceOfConstructor):
14392 (JSValueToBoolean):
14393 (JSValueToNumber):
14394 (JSValueToStringCopy):
14395 (JSValueToObject):
14396 (JSValueProtect):
14397 (JSValueUnprotect):
14398 * JavaScriptCore.exp:
14399 * bytecode/CodeBlock.cpp:
14400 (JSC::valueToSourceString):
14401 (JSC::constantName):
14402 (JSC::CodeBlock::dump):
14403 * bytecode/CodeBlock.h:
14404 (JSC::CodeBlock::getConstant):
14405 (JSC::CodeBlock::addUnexpectedConstant):
14406 (JSC::CodeBlock::unexpectedConstant):
14407 * bytecode/EvalCodeCache.h:
14408 (JSC::EvalCodeCache::get):
14409 * bytecompiler/BytecodeGenerator.cpp:
14410 (JSC::BytecodeGenerator::BytecodeGenerator):
14411 (JSC::BytecodeGenerator::addConstant):
14412 (JSC::BytecodeGenerator::addUnexpectedConstant):
14413 (JSC::BytecodeGenerator::emitLoad):
14414 (JSC::BytecodeGenerator::emitLoadJSV):
14415 (JSC::BytecodeGenerator::emitGetScopedVar):
14416 (JSC::BytecodeGenerator::emitPutScopedVar):
14417 (JSC::BytecodeGenerator::emitNewError):
14418 (JSC::keyForImmediateSwitch):
14419 * bytecompiler/BytecodeGenerator.h:
14420 (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
14421 (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
14422 * debugger/DebuggerCallFrame.cpp:
14423 (JSC::DebuggerCallFrame::evaluate):
14424 * debugger/DebuggerCallFrame.h:
14425 (JSC::DebuggerCallFrame::DebuggerCallFrame):
14426 (JSC::DebuggerCallFrame::exception):
14427 * interpreter/CallFrame.cpp:
14428 (JSC::CallFrame::thisValue):
14429 * interpreter/CallFrame.h:
14430 (JSC::ExecState::setException):
14431 (JSC::ExecState::exception):
14432 (JSC::ExecState::exceptionSlot):
14433 (JSC::ExecState::hadException):
14434 * interpreter/Interpreter.cpp:
14435 (JSC::fastIsNumber):
14436 (JSC::fastToInt32):
14437 (JSC::fastToUInt32):
14438 (JSC::jsLess):
14439 (JSC::jsLessEq):
14440 (JSC::jsAddSlowCase):
14441 (JSC::jsAdd):
14442 (JSC::jsTypeStringForValue):
14443 (JSC::jsIsObjectType):
14444 (JSC::jsIsFunctionType):
14445 (JSC::Interpreter::resolve):
14446 (JSC::Interpreter::resolveSkip):
14447 (JSC::Interpreter::resolveGlobal):
14448 (JSC::inlineResolveBase):
14449 (JSC::Interpreter::resolveBase):
14450 (JSC::Interpreter::resolveBaseAndProperty):
14451 (JSC::Interpreter::resolveBaseAndFunc):
14452 (JSC::isNotObject):
14453 (JSC::Interpreter::callEval):
14454 (JSC::Interpreter::unwindCallFrame):
14455 (JSC::Interpreter::throwException):
14456 (JSC::Interpreter::execute):
14457 (JSC::Interpreter::checkTimeout):
14458 (JSC::Interpreter::createExceptionScope):
14459 (JSC::cachePrototypeChain):
14460 (JSC::Interpreter::tryCachePutByID):
14461 (JSC::countPrototypeChainEntriesAndCheckForProxies):
14462 (JSC::Interpreter::tryCacheGetByID):
14463 (JSC::Interpreter::privateExecute):
14464 (JSC::Interpreter::retrieveArguments):
14465 (JSC::Interpreter::retrieveCaller):
14466 (JSC::Interpreter::retrieveLastCaller):
14467 (JSC::Interpreter::tryCTICachePutByID):
14468 (JSC::Interpreter::tryCTICacheGetByID):
14469 (JSC::returnToThrowTrampoline):
14470 (JSC::Interpreter::cti_op_convert_this):
14471 (JSC::Interpreter::cti_op_add):
14472 (JSC::Interpreter::cti_op_pre_inc):
14473 (JSC::Interpreter::cti_op_loop_if_less):
14474 (JSC::Interpreter::cti_op_loop_if_lesseq):
14475 (JSC::Interpreter::cti_op_get_by_id_generic):
14476 (JSC::Interpreter::cti_op_get_by_id):
14477 (JSC::Interpreter::cti_op_get_by_id_second):
14478 (JSC::Interpreter::cti_op_get_by_id_self_fail):
14479 (JSC::Interpreter::cti_op_get_by_id_proto_list):
14480 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
14481 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
14482 (JSC::Interpreter::cti_op_get_by_id_array_fail):
14483 (JSC::Interpreter::cti_op_get_by_id_string_fail):
14484 (JSC::Interpreter::cti_op_instanceof):
14485 (JSC::Interpreter::cti_op_del_by_id):
14486 (JSC::Interpreter::cti_op_mul):
14487 (JSC::Interpreter::cti_op_call_NotJSFunction):
14488 (JSC::Interpreter::cti_op_resolve):
14489 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
14490 (JSC::Interpreter::cti_op_get_by_val):
14491 (JSC::Interpreter::cti_op_resolve_func):
14492 (JSC::Interpreter::cti_op_sub):
14493 (JSC::Interpreter::cti_op_put_by_val):
14494 (JSC::Interpreter::cti_op_put_by_val_array):
14495 (JSC::Interpreter::cti_op_lesseq):
14496 (JSC::Interpreter::cti_op_loop_if_true):
14497 (JSC::Interpreter::cti_op_negate):
14498 (JSC::Interpreter::cti_op_resolve_base):
14499 (JSC::Interpreter::cti_op_resolve_skip):
14500 (JSC::Interpreter::cti_op_resolve_global):
14501 (JSC::Interpreter::cti_op_div):
14502 (JSC::Interpreter::cti_op_pre_dec):
14503 (JSC::Interpreter::cti_op_jless):
14504 (JSC::Interpreter::cti_op_not):
14505 (JSC::Interpreter::cti_op_jtrue):
14506 (JSC::Interpreter::cti_op_post_inc):
14507 (JSC::Interpreter::cti_op_eq):
14508 (JSC::Interpreter::cti_op_lshift):
14509 (JSC::Interpreter::cti_op_bitand):
14510 (JSC::Interpreter::cti_op_rshift):
14511 (JSC::Interpreter::cti_op_bitnot):
14512 (JSC::Interpreter::cti_op_resolve_with_base):
14513 (JSC::Interpreter::cti_op_mod):
14514 (JSC::Interpreter::cti_op_less):
14515 (JSC::Interpreter::cti_op_neq):
14516 (JSC::Interpreter::cti_op_post_dec):
14517 (JSC::Interpreter::cti_op_urshift):
14518 (JSC::Interpreter::cti_op_bitxor):
14519 (JSC::Interpreter::cti_op_bitor):
14520 (JSC::Interpreter::cti_op_call_eval):
14521 (JSC::Interpreter::cti_op_throw):
14522 (JSC::Interpreter::cti_op_next_pname):
14523 (JSC::Interpreter::cti_op_typeof):
14524 (JSC::Interpreter::cti_op_is_undefined):
14525 (JSC::Interpreter::cti_op_is_boolean):
14526 (JSC::Interpreter::cti_op_is_number):
14527 (JSC::Interpreter::cti_op_is_string):
14528 (JSC::Interpreter::cti_op_is_object):
14529 (JSC::Interpreter::cti_op_is_function):
14530 (JSC::Interpreter::cti_op_stricteq):
14531 (JSC::Interpreter::cti_op_nstricteq):
14532 (JSC::Interpreter::cti_op_to_jsnumber):
14533 (JSC::Interpreter::cti_op_in):
14534 (JSC::Interpreter::cti_op_switch_imm):
14535 (JSC::Interpreter::cti_op_switch_char):
14536 (JSC::Interpreter::cti_op_switch_string):
14537 (JSC::Interpreter::cti_op_del_by_val):
14538 (JSC::Interpreter::cti_op_new_error):
14539 (JSC::Interpreter::cti_vm_throw):
14540 * interpreter/Interpreter.h:
14541 (JSC::Interpreter::isJSArray):
14542 (JSC::Interpreter::isJSString):
14543 * interpreter/Register.h:
14544 (JSC::Register::):
14545 (JSC::Register::Register):
14546 (JSC::Register::jsValue):
14547 (JSC::Register::getJSValue):
14548 * jit/JIT.cpp:
14549 (JSC::):
14550 (JSC::JIT::compileOpStrictEq):
14551 (JSC::JIT::privateCompileMainPass):
14552 (JSC::JIT::privateCompileSlowCases):
14553 * jit/JIT.h:
14554 (JSC::):
14555 (JSC::JIT::execute):
14556 * jit/JITArithmetic.cpp:
14557 (JSC::JIT::compileFastArith_op_rshift):
14558 (JSC::JIT::compileFastArithSlow_op_rshift):
14559 * jit/JITCall.cpp:
14560 (JSC::JIT::unlinkCall):
14561 (JSC::JIT::compileOpCallInitializeCallFrame):
14562 (JSC::JIT::compileOpCall):
14563 * jit/JITInlineMethods.h:
14564 (JSC::JIT::emitGetVirtualRegister):
14565 (JSC::JIT::getConstantOperand):
14566 (JSC::JIT::isOperandConstant31BitImmediateInt):
14567 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
14568 (JSC::JIT::emitInitRegister):
14569 * jit/JITPropertyAccess.cpp:
14570 (JSC::resizePropertyStorage):
14571 (JSC::JIT::privateCompilePutByIdTransition):
14572 (JSC::JIT::patchGetByIdSelf):
14573 (JSC::JIT::patchPutByIdReplace):
14574 (JSC::JIT::privateCompileGetByIdSelf):
14575 (JSC::JIT::privateCompileGetByIdProto):
14576 (JSC::JIT::privateCompileGetByIdSelfList):
14577 (JSC::JIT::privateCompileGetByIdProtoList):
14578 (JSC::JIT::privateCompileGetByIdChainList):
14579 (JSC::JIT::privateCompileGetByIdChain):
14580 (JSC::JIT::privateCompilePutByIdReplace):
14581 * jsc.cpp:
14582 (functionPrint):
14583 (functionDebug):
14584 (functionGC):
14585 (functionVersion):
14586 (functionRun):
14587 (functionLoad):
14588 (functionReadline):
14589 (functionQuit):
14590 * parser/Nodes.cpp:
14591 (JSC::NullNode::emitBytecode):
14592 (JSC::ArrayNode::emitBytecode):
14593 (JSC::FunctionCallValueNode::emitBytecode):
14594 (JSC::FunctionCallResolveNode::emitBytecode):
14595 (JSC::VoidNode::emitBytecode):
14596 (JSC::ConstDeclNode::emitCodeSingle):
14597 (JSC::ReturnNode::emitBytecode):
14598 (JSC::processClauseList):
14599 (JSC::EvalNode::emitBytecode):
14600 (JSC::FunctionBodyNode::emitBytecode):
14601 (JSC::ProgramNode::emitBytecode):
14602 * profiler/ProfileGenerator.cpp:
14603 (JSC::ProfileGenerator::addParentForConsoleStart):
14604 * profiler/Profiler.cpp:
14605 (JSC::Profiler::willExecute):
14606 (JSC::Profiler::didExecute):
14607 (JSC::Profiler::createCallIdentifier):
14608 * profiler/Profiler.h:
14609 * runtime/ArgList.cpp:
14610 (JSC::ArgList::slowAppend):
14611 * runtime/ArgList.h:
14612 (JSC::ArgList::at):
14613 (JSC::ArgList::append):
14614 * runtime/Arguments.cpp:
14615 (JSC::Arguments::put):
14616 * runtime/Arguments.h:
14617 (JSC::Arguments::createStructure):
14618 (JSC::asArguments):
14619 * runtime/ArrayConstructor.cpp:
14620 (JSC::callArrayConstructor):
14621 * runtime/ArrayPrototype.cpp:
14622 (JSC::getProperty):
14623 (JSC::putProperty):
14624 (JSC::arrayProtoFuncToString):
14625 (JSC::arrayProtoFuncToLocaleString):
14626 (JSC::arrayProtoFuncJoin):
14627 (JSC::arrayProtoFuncConcat):
14628 (JSC::arrayProtoFuncPop):
14629 (JSC::arrayProtoFuncPush):
14630 (JSC::arrayProtoFuncReverse):
14631 (JSC::arrayProtoFuncShift):
14632 (JSC::arrayProtoFuncSlice):
14633 (JSC::arrayProtoFuncSort):
14634 (JSC::arrayProtoFuncSplice):
14635 (JSC::arrayProtoFuncUnShift):
14636 (JSC::arrayProtoFuncFilter):
14637 (JSC::arrayProtoFuncMap):
14638 (JSC::arrayProtoFuncEvery):
14639 (JSC::arrayProtoFuncForEach):
14640 (JSC::arrayProtoFuncSome):
14641 (JSC::arrayProtoFuncIndexOf):
14642 (JSC::arrayProtoFuncLastIndexOf):
14643 * runtime/BooleanConstructor.cpp:
14644 (JSC::callBooleanConstructor):
14645 (JSC::constructBooleanFromImmediateBoolean):
14646 * runtime/BooleanConstructor.h:
14647 * runtime/BooleanObject.h:
14648 (JSC::asBooleanObject):
14649 * runtime/BooleanPrototype.cpp:
14650 (JSC::booleanProtoFuncToString):
14651 (JSC::booleanProtoFuncValueOf):
14652 * runtime/CallData.cpp:
14653 (JSC::call):
14654 * runtime/CallData.h:
14655 * runtime/Collector.cpp:
14656 (JSC::Heap::protect):
14657 (JSC::Heap::unprotect):
14658 (JSC::Heap::heap):
14659 (JSC::Heap::collect):
14660 * runtime/Collector.h:
14661 * runtime/Completion.cpp:
14662 (JSC::evaluate):
14663 * runtime/Completion.h:
14664 (JSC::Completion::Completion):
14665 (JSC::Completion::value):
14666 (JSC::Completion::setValue):
14667 (JSC::Completion::isValueCompletion):
14668 * runtime/ConstructData.cpp:
14669 (JSC::construct):
14670 * runtime/ConstructData.h:
14671 * runtime/DateConstructor.cpp:
14672 (JSC::constructDate):
14673 (JSC::callDate):
14674 (JSC::dateParse):
14675 (JSC::dateNow):
14676 (JSC::dateUTC):
14677 * runtime/DateInstance.h:
14678 (JSC::asDateInstance):
14679 * runtime/DatePrototype.cpp:
14680 (JSC::dateProtoFuncToString):
14681 (JSC::dateProtoFuncToUTCString):
14682 (JSC::dateProtoFuncToDateString):
14683 (JSC::dateProtoFuncToTimeString):
14684 (JSC::dateProtoFuncToLocaleString):
14685 (JSC::dateProtoFuncToLocaleDateString):
14686 (JSC::dateProtoFuncToLocaleTimeString):
14687 (JSC::dateProtoFuncValueOf):
14688 (JSC::dateProtoFuncGetTime):
14689 (JSC::dateProtoFuncGetFullYear):
14690 (JSC::dateProtoFuncGetUTCFullYear):
14691 (JSC::dateProtoFuncToGMTString):
14692 (JSC::dateProtoFuncGetMonth):
14693 (JSC::dateProtoFuncGetUTCMonth):
14694 (JSC::dateProtoFuncGetDate):
14695 (JSC::dateProtoFuncGetUTCDate):
14696 (JSC::dateProtoFuncGetDay):
14697 (JSC::dateProtoFuncGetUTCDay):
14698 (JSC::dateProtoFuncGetHours):
14699 (JSC::dateProtoFuncGetUTCHours):
14700 (JSC::dateProtoFuncGetMinutes):
14701 (JSC::dateProtoFuncGetUTCMinutes):
14702 (JSC::dateProtoFuncGetSeconds):
14703 (JSC::dateProtoFuncGetUTCSeconds):
14704 (JSC::dateProtoFuncGetMilliSeconds):
14705 (JSC::dateProtoFuncGetUTCMilliseconds):
14706 (JSC::dateProtoFuncGetTimezoneOffset):
14707 (JSC::dateProtoFuncSetTime):
14708 (JSC::setNewValueFromTimeArgs):
14709 (JSC::setNewValueFromDateArgs):
14710 (JSC::dateProtoFuncSetMilliSeconds):
14711 (JSC::dateProtoFuncSetUTCMilliseconds):
14712 (JSC::dateProtoFuncSetSeconds):
14713 (JSC::dateProtoFuncSetUTCSeconds):
14714 (JSC::dateProtoFuncSetMinutes):
14715 (JSC::dateProtoFuncSetUTCMinutes):
14716 (JSC::dateProtoFuncSetHours):
14717 (JSC::dateProtoFuncSetUTCHours):
14718 (JSC::dateProtoFuncSetDate):
14719 (JSC::dateProtoFuncSetUTCDate):
14720 (JSC::dateProtoFuncSetMonth):
14721 (JSC::dateProtoFuncSetUTCMonth):
14722 (JSC::dateProtoFuncSetFullYear):
14723 (JSC::dateProtoFuncSetUTCFullYear):
14724 (JSC::dateProtoFuncSetYear):
14725 (JSC::dateProtoFuncGetYear):
14726 * runtime/DatePrototype.h:
14727 (JSC::DatePrototype::createStructure):
14728 * runtime/ErrorConstructor.cpp:
14729 (JSC::callErrorConstructor):
14730 * runtime/ErrorPrototype.cpp:
14731 (JSC::errorProtoFuncToString):
14732 * runtime/ExceptionHelpers.cpp:
14733 (JSC::createInterruptedExecutionException):
14734 (JSC::createError):
14735 (JSC::createStackOverflowError):
14736 (JSC::createUndefinedVariableError):
14737 (JSC::createErrorMessage):
14738 (JSC::createInvalidParamError):
14739 (JSC::createNotAConstructorError):
14740 (JSC::createNotAFunctionError):
14741 * runtime/ExceptionHelpers.h:
14742 * runtime/FunctionConstructor.cpp:
14743 (JSC::callFunctionConstructor):
14744 * runtime/FunctionPrototype.cpp:
14745 (JSC::callFunctionPrototype):
14746 (JSC::functionProtoFuncToString):
14747 (JSC::functionProtoFuncApply):
14748 (JSC::functionProtoFuncCall):
14749 * runtime/FunctionPrototype.h:
14750 (JSC::FunctionPrototype::createStructure):
14751 * runtime/GetterSetter.cpp:
14752 (JSC::GetterSetter::toPrimitive):
14753 (JSC::GetterSetter::getPrimitiveNumber):
14754 * runtime/GetterSetter.h:
14755 (JSC::asGetterSetter):
14756 * runtime/InitializeThreading.cpp:
14757 * runtime/InternalFunction.h:
14758 (JSC::InternalFunction::createStructure):
14759 (JSC::asInternalFunction):
14760 * runtime/JSActivation.cpp:
14761 (JSC::JSActivation::getOwnPropertySlot):
14762 (JSC::JSActivation::put):
14763 (JSC::JSActivation::putWithAttributes):
14764 (JSC::JSActivation::argumentsGetter):
14765 * runtime/JSActivation.h:
14766 (JSC::JSActivation::createStructure):
14767 (JSC::asActivation):
14768 * runtime/JSArray.cpp:
14769 (JSC::storageSize):
14770 (JSC::JSArray::JSArray):
14771 (JSC::JSArray::getOwnPropertySlot):
14772 (JSC::JSArray::put):
14773 (JSC::JSArray::putSlowCase):
14774 (JSC::JSArray::deleteProperty):
14775 (JSC::JSArray::getPropertyNames):
14776 (JSC::JSArray::setLength):
14777 (JSC::JSArray::pop):
14778 (JSC::JSArray::push):
14779 (JSC::JSArray::mark):
14780 (JSC::JSArray::sort):
14781 (JSC::JSArray::compactForSorting):
14782 (JSC::JSArray::checkConsistency):
14783 (JSC::constructArray):
14784 * runtime/JSArray.h:
14785 (JSC::JSArray::getIndex):
14786 (JSC::JSArray::setIndex):
14787 (JSC::JSArray::createStructure):
14788 (JSC::asArray):
14789 * runtime/JSCell.cpp:
14790 (JSC::JSCell::put):
14791 (JSC::JSCell::getJSNumber):
14792 * runtime/JSCell.h:
14793 (JSC::asCell):
14794 (JSC::JSValue::asCell):
14795 (JSC::JSValue::toPrimitive):
14796 (JSC::JSValue::getPrimitiveNumber):
14797 (JSC::JSValue::getJSNumber):
14798 * runtime/JSFunction.cpp:
14799 (JSC::JSFunction::call):
14800 (JSC::JSFunction::argumentsGetter):
14801 (JSC::JSFunction::callerGetter):
14802 (JSC::JSFunction::lengthGetter):
14803 (JSC::JSFunction::getOwnPropertySlot):
14804 (JSC::JSFunction::put):
14805 (JSC::JSFunction::construct):
14806 * runtime/JSFunction.h:
14807 (JSC::JSFunction::createStructure):
14808 (JSC::asFunction):
14809 * runtime/JSGlobalData.h:
14810 * runtime/JSGlobalObject.cpp:
14811 (JSC::markIfNeeded):
14812 (JSC::JSGlobalObject::put):
14813 (JSC::JSGlobalObject::putWithAttributes):
14814 (JSC::JSGlobalObject::reset):
14815 (JSC::JSGlobalObject::resetPrototype):
14816 * runtime/JSGlobalObject.h:
14817 (JSC::JSGlobalObject::createStructure):
14818 (JSC::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo):
14819 (JSC::asGlobalObject):
14820 (JSC::Structure::prototypeForLookup):
14821 * runtime/JSGlobalObjectFunctions.cpp:
14822 (JSC::encode):
14823 (JSC::decode):
14824 (JSC::globalFuncEval):
14825 (JSC::globalFuncParseInt):
14826 (JSC::globalFuncParseFloat):
14827 (JSC::globalFuncIsNaN):
14828 (JSC::globalFuncIsFinite):
14829 (JSC::globalFuncDecodeURI):
14830 (JSC::globalFuncDecodeURIComponent):
14831 (JSC::globalFuncEncodeURI):
14832 (JSC::globalFuncEncodeURIComponent):
14833 (JSC::globalFuncEscape):
14834 (JSC::globalFuncUnescape):
14835 (JSC::globalFuncJSCPrint):
14836 * runtime/JSGlobalObjectFunctions.h:
14837 * runtime/JSImmediate.cpp:
14838 (JSC::JSImmediate::toThisObject):
14839 (JSC::JSImmediate::toObject):
14840 (JSC::JSImmediate::prototype):
14841 (JSC::JSImmediate::toString):
14842 * runtime/JSImmediate.h:
14843 (JSC::JSImmediate::isImmediate):
14844 (JSC::JSImmediate::isNumber):
14845 (JSC::JSImmediate::isPositiveNumber):
14846 (JSC::JSImmediate::isBoolean):
14847 (JSC::JSImmediate::isUndefinedOrNull):
14848 (JSC::JSImmediate::isNegative):
14849 (JSC::JSImmediate::isEitherImmediate):
14850 (JSC::JSImmediate::isAnyImmediate):
14851 (JSC::JSImmediate::areBothImmediate):
14852 (JSC::JSImmediate::areBothImmediateNumbers):
14853 (JSC::JSImmediate::andImmediateNumbers):
14854 (JSC::JSImmediate::xorImmediateNumbers):
14855 (JSC::JSImmediate::orImmediateNumbers):
14856 (JSC::JSImmediate::rightShiftImmediateNumbers):
14857 (JSC::JSImmediate::canDoFastAdditiveOperations):
14858 (JSC::JSImmediate::addImmediateNumbers):
14859 (JSC::JSImmediate::subImmediateNumbers):
14860 (JSC::JSImmediate::incImmediateNumber):
14861 (JSC::JSImmediate::decImmediateNumber):
14862 (JSC::JSImmediate::makeValue):
14863 (JSC::JSImmediate::makeInt):
14864 (JSC::JSImmediate::makeBool):
14865 (JSC::JSImmediate::makeUndefined):
14866 (JSC::JSImmediate::makeNull):
14867 (JSC::JSImmediate::intValue):
14868 (JSC::JSImmediate::uintValue):
14869 (JSC::JSImmediate::boolValue):
14870 (JSC::JSImmediate::rawValue):
14871 (JSC::JSImmediate::trueImmediate):
14872 (JSC::JSImmediate::falseImmediate):
14873 (JSC::JSImmediate::undefinedImmediate):
14874 (JSC::JSImmediate::nullImmediate):
14875 (JSC::JSImmediate::zeroImmediate):
14876 (JSC::JSImmediate::oneImmediate):
14877 (JSC::JSImmediate::impossibleValue):
14878 (JSC::JSImmediate::toBoolean):
14879 (JSC::JSImmediate::getTruncatedUInt32):
14880 (JSC::JSImmediate::from):
14881 (JSC::JSImmediate::getTruncatedInt32):
14882 (JSC::JSImmediate::toDouble):
14883 (JSC::JSImmediate::getUInt32):
14884 (JSC::jsNull):
14885 (JSC::jsBoolean):
14886 (JSC::jsUndefined):
14887 (JSC::JSValue::isUndefined):
14888 (JSC::JSValue::isNull):
14889 (JSC::JSValue::isUndefinedOrNull):
14890 (JSC::JSValue::isBoolean):
14891 (JSC::JSValue::getBoolean):
14892 (JSC::JSValue::toInt32):
14893 (JSC::JSValue::toUInt32):
14894 (JSC::toInt32):
14895 (JSC::toUInt32):
14896 * runtime/JSNotAnObject.cpp:
14897 (JSC::JSNotAnObject::toPrimitive):
14898 (JSC::JSNotAnObject::getPrimitiveNumber):
14899 (JSC::JSNotAnObject::put):
14900 * runtime/JSNotAnObject.h:
14901 (JSC::JSNotAnObject::createStructure):
14902 * runtime/JSNumberCell.cpp:
14903 (JSC::JSNumberCell::toPrimitive):
14904 (JSC::JSNumberCell::getPrimitiveNumber):
14905 (JSC::JSNumberCell::getJSNumber):
14906 (JSC::jsNumberCell):
14907 (JSC::jsNaN):
14908 * runtime/JSNumberCell.h:
14909 (JSC::JSNumberCell::createStructure):
14910 (JSC::asNumberCell):
14911 (JSC::jsNumber):
14912 (JSC::JSValue::toJSNumber):
14913 * runtime/JSObject.cpp:
14914 (JSC::JSObject::mark):
14915 (JSC::JSObject::put):
14916 (JSC::JSObject::putWithAttributes):
14917 (JSC::callDefaultValueFunction):
14918 (JSC::JSObject::getPrimitiveNumber):
14919 (JSC::JSObject::defaultValue):
14920 (JSC::JSObject::defineGetter):
14921 (JSC::JSObject::defineSetter):
14922 (JSC::JSObject::lookupGetter):
14923 (JSC::JSObject::lookupSetter):
14924 (JSC::JSObject::hasInstance):
14925 (JSC::JSObject::toNumber):
14926 (JSC::JSObject::toString):
14927 (JSC::JSObject::fillGetterPropertySlot):
14928 * runtime/JSObject.h:
14929 (JSC::JSObject::getDirect):
14930 (JSC::JSObject::getDirectLocation):
14931 (JSC::JSObject::offsetForLocation):
14932 (JSC::JSObject::locationForOffset):
14933 (JSC::JSObject::getDirectOffset):
14934 (JSC::JSObject::putDirectOffset):
14935 (JSC::JSObject::createStructure):
14936 (JSC::asObject):
14937 (JSC::JSObject::prototype):
14938 (JSC::JSObject::setPrototype):
14939 (JSC::JSObject::inlineGetOwnPropertySlot):
14940 (JSC::JSObject::getOwnPropertySlotForWrite):
14941 (JSC::JSObject::getPropertySlot):
14942 (JSC::JSObject::get):
14943 (JSC::JSObject::putDirect):
14944 (JSC::JSObject::putDirectWithoutTransition):
14945 (JSC::JSObject::toPrimitive):
14946 (JSC::JSValue::get):
14947 (JSC::JSValue::put):
14948 (JSC::JSObject::allocatePropertyStorageInline):
14949 * runtime/JSPropertyNameIterator.cpp:
14950 (JSC::JSPropertyNameIterator::toPrimitive):
14951 (JSC::JSPropertyNameIterator::getPrimitiveNumber):
14952 * runtime/JSPropertyNameIterator.h:
14953 (JSC::JSPropertyNameIterator::create):
14954 (JSC::JSPropertyNameIterator::next):
14955 * runtime/JSStaticScopeObject.cpp:
14956 (JSC::JSStaticScopeObject::put):
14957 (JSC::JSStaticScopeObject::putWithAttributes):
14958 * runtime/JSStaticScopeObject.h:
14959 (JSC::JSStaticScopeObject::JSStaticScopeObject):
14960 (JSC::JSStaticScopeObject::createStructure):
14961 * runtime/JSString.cpp:
14962 (JSC::JSString::toPrimitive):
14963 (JSC::JSString::getPrimitiveNumber):
14964 (JSC::JSString::getOwnPropertySlot):
14965 * runtime/JSString.h:
14966 (JSC::JSString::createStructure):
14967 (JSC::asString):
14968 * runtime/JSValue.h:
14969 (JSC::JSValuePtr::makeImmediate):
14970 (JSC::JSValuePtr::immediateValue):
14971 (JSC::JSValuePtr::JSValuePtr):
14972 (JSC::JSValuePtr::operator->):
14973 (JSC::JSValuePtr::hasValue):
14974 (JSC::JSValuePtr::operator==):
14975 (JSC::JSValuePtr::operator!=):
14976 (JSC::JSValuePtr::encode):
14977 (JSC::JSValuePtr::decode):
14978 (JSC::JSValue::asValue):
14979 (JSC::noValue):
14980 (JSC::operator==):
14981 (JSC::operator!=):
14982 * runtime/JSVariableObject.h:
14983 (JSC::JSVariableObject::symbolTablePut):
14984 (JSC::JSVariableObject::symbolTablePutWithAttributes):
14985 * runtime/JSWrapperObject.cpp:
14986 (JSC::JSWrapperObject::mark):
14987 * runtime/JSWrapperObject.h:
14988 (JSC::JSWrapperObject::internalValue):
14989 (JSC::JSWrapperObject::setInternalValue):
14990 * runtime/Lookup.cpp:
14991 (JSC::setUpStaticFunctionSlot):
14992 * runtime/Lookup.h:
14993 (JSC::lookupPut):
14994 * runtime/MathObject.cpp:
14995 (JSC::mathProtoFuncAbs):
14996 (JSC::mathProtoFuncACos):
14997 (JSC::mathProtoFuncASin):
14998 (JSC::mathProtoFuncATan):
14999 (JSC::mathProtoFuncATan2):
15000 (JSC::mathProtoFuncCeil):
15001 (JSC::mathProtoFuncCos):
15002 (JSC::mathProtoFuncExp):
15003 (JSC::mathProtoFuncFloor):
15004 (JSC::mathProtoFuncLog):
15005 (JSC::mathProtoFuncMax):
15006 (JSC::mathProtoFuncMin):
15007 (JSC::mathProtoFuncPow):
15008 (JSC::mathProtoFuncRandom):
15009 (JSC::mathProtoFuncRound):
15010 (JSC::mathProtoFuncSin):
15011 (JSC::mathProtoFuncSqrt):
15012 (JSC::mathProtoFuncTan):
15013 * runtime/MathObject.h:
15014 (JSC::MathObject::createStructure):
15015 * runtime/NativeErrorConstructor.cpp:
15016 (JSC::callNativeErrorConstructor):
15017 * runtime/NumberConstructor.cpp:
15018 (JSC::numberConstructorNaNValue):
15019 (JSC::numberConstructorNegInfinity):
15020 (JSC::numberConstructorPosInfinity):
15021 (JSC::numberConstructorMaxValue):
15022 (JSC::numberConstructorMinValue):
15023 (JSC::callNumberConstructor):
15024 * runtime/NumberConstructor.h:
15025 (JSC::NumberConstructor::createStructure):
15026 * runtime/NumberObject.cpp:
15027 (JSC::NumberObject::getJSNumber):
15028 (JSC::constructNumberFromImmediateNumber):
15029 * runtime/NumberObject.h:
15030 * runtime/NumberPrototype.cpp:
15031 (JSC::numberProtoFuncToString):
15032 (JSC::numberProtoFuncToLocaleString):
15033 (JSC::numberProtoFuncValueOf):
15034 (JSC::numberProtoFuncToFixed):
15035 (JSC::numberProtoFuncToExponential):
15036 (JSC::numberProtoFuncToPrecision):
15037 * runtime/ObjectConstructor.cpp:
15038 (JSC::constructObject):
15039 (JSC::callObjectConstructor):
15040 * runtime/ObjectPrototype.cpp:
15041 (JSC::objectProtoFuncValueOf):
15042 (JSC::objectProtoFuncHasOwnProperty):
15043 (JSC::objectProtoFuncIsPrototypeOf):
15044 (JSC::objectProtoFuncDefineGetter):
15045 (JSC::objectProtoFuncDefineSetter):
15046 (JSC::objectProtoFuncLookupGetter):
15047 (JSC::objectProtoFuncLookupSetter):
15048 (JSC::objectProtoFuncPropertyIsEnumerable):
15049 (JSC::objectProtoFuncToLocaleString):
15050 (JSC::objectProtoFuncToString):
15051 * runtime/ObjectPrototype.h:
15052 * runtime/Operations.cpp:
15053 (JSC::equal):
15054 (JSC::equalSlowCase):
15055 (JSC::strictEqual):
15056 (JSC::strictEqualSlowCase):
15057 (JSC::throwOutOfMemoryError):
15058 * runtime/Operations.h:
15059 (JSC::equalSlowCaseInline):
15060 (JSC::strictEqualSlowCaseInline):
15061 * runtime/PropertySlot.cpp:
15062 (JSC::PropertySlot::functionGetter):
15063 * runtime/PropertySlot.h:
15064 (JSC::PropertySlot::PropertySlot):
15065 (JSC::PropertySlot::getValue):
15066 (JSC::PropertySlot::putValue):
15067 (JSC::PropertySlot::setValueSlot):
15068 (JSC::PropertySlot::setValue):
15069 (JSC::PropertySlot::setCustom):
15070 (JSC::PropertySlot::setCustomIndex):
15071 (JSC::PropertySlot::slotBase):
15072 (JSC::PropertySlot::setBase):
15073 (JSC::PropertySlot::):
15074 * runtime/Protect.h:
15075 (JSC::gcProtect):
15076 (JSC::gcUnprotect):
15077 (JSC::ProtectedPtr::ProtectedPtr):
15078 (JSC::ProtectedPtr::operator JSValuePtr):
15079 (JSC::ProtectedJSValuePtr::ProtectedJSValuePtr):
15080 (JSC::ProtectedJSValuePtr::get):
15081 (JSC::ProtectedJSValuePtr::operator JSValuePtr):
15082 (JSC::ProtectedJSValuePtr::operator->):
15083 (JSC::::ProtectedPtr):
15084 (JSC::::~ProtectedPtr):
15085 (JSC::::operator):
15086 (JSC::ProtectedJSValuePtr::~ProtectedJSValuePtr):
15087 (JSC::ProtectedJSValuePtr::operator=):
15088 (JSC::operator==):
15089 (JSC::operator!=):
15090 * runtime/RegExpConstructor.cpp:
15091 (JSC::RegExpConstructor::getBackref):
15092 (JSC::RegExpConstructor::getLastParen):
15093 (JSC::RegExpConstructor::getLeftContext):
15094 (JSC::RegExpConstructor::getRightContext):
15095 (JSC::regExpConstructorDollar1):
15096 (JSC::regExpConstructorDollar2):
15097 (JSC::regExpConstructorDollar3):
15098 (JSC::regExpConstructorDollar4):
15099 (JSC::regExpConstructorDollar5):
15100 (JSC::regExpConstructorDollar6):
15101 (JSC::regExpConstructorDollar7):
15102 (JSC::regExpConstructorDollar8):
15103 (JSC::regExpConstructorDollar9):
15104 (JSC::regExpConstructorInput):
15105 (JSC::regExpConstructorMultiline):
15106 (JSC::regExpConstructorLastMatch):
15107 (JSC::regExpConstructorLastParen):
15108 (JSC::regExpConstructorLeftContext):
15109 (JSC::regExpConstructorRightContext):
15110 (JSC::RegExpConstructor::put):
15111 (JSC::setRegExpConstructorInput):
15112 (JSC::setRegExpConstructorMultiline):
15113 (JSC::constructRegExp):
15114 (JSC::callRegExpConstructor):
15115 * runtime/RegExpConstructor.h:
15116 (JSC::RegExpConstructor::createStructure):
15117 (JSC::asRegExpConstructor):
15118 * runtime/RegExpMatchesArray.h:
15119 (JSC::RegExpMatchesArray::put):
15120 * runtime/RegExpObject.cpp:
15121 (JSC::regExpObjectGlobal):
15122 (JSC::regExpObjectIgnoreCase):
15123 (JSC::regExpObjectMultiline):
15124 (JSC::regExpObjectSource):
15125 (JSC::regExpObjectLastIndex):
15126 (JSC::RegExpObject::put):
15127 (JSC::setRegExpObjectLastIndex):
15128 (JSC::RegExpObject::test):
15129 (JSC::RegExpObject::exec):
15130 (JSC::callRegExpObject):
15131 * runtime/RegExpObject.h:
15132 (JSC::RegExpObject::createStructure):
15133 (JSC::asRegExpObject):
15134 * runtime/RegExpPrototype.cpp:
15135 (JSC::regExpProtoFuncTest):
15136 (JSC::regExpProtoFuncExec):
15137 (JSC::regExpProtoFuncCompile):
15138 (JSC::regExpProtoFuncToString):
15139 * runtime/StringConstructor.cpp:
15140 (JSC::stringFromCharCodeSlowCase):
15141 (JSC::stringFromCharCode):
15142 (JSC::callStringConstructor):
15143 * runtime/StringObject.cpp:
15144 (JSC::StringObject::put):
15145 * runtime/StringObject.h:
15146 (JSC::StringObject::createStructure):
15147 (JSC::asStringObject):
15148 * runtime/StringObjectThatMasqueradesAsUndefined.h:
15149 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
15150 * runtime/StringPrototype.cpp:
15151 (JSC::stringProtoFuncReplace):
15152 (JSC::stringProtoFuncToString):
15153 (JSC::stringProtoFuncCharAt):
15154 (JSC::stringProtoFuncCharCodeAt):
15155 (JSC::stringProtoFuncConcat):
15156 (JSC::stringProtoFuncIndexOf):
15157 (JSC::stringProtoFuncLastIndexOf):
15158 (JSC::stringProtoFuncMatch):
15159 (JSC::stringProtoFuncSearch):
15160 (JSC::stringProtoFuncSlice):
15161 (JSC::stringProtoFuncSplit):
15162 (JSC::stringProtoFuncSubstr):
15163 (JSC::stringProtoFuncSubstring):
15164 (JSC::stringProtoFuncToLowerCase):
15165 (JSC::stringProtoFuncToUpperCase):
15166 (JSC::stringProtoFuncLocaleCompare):
15167 (JSC::stringProtoFuncBig):
15168 (JSC::stringProtoFuncSmall):
15169 (JSC::stringProtoFuncBlink):
15170 (JSC::stringProtoFuncBold):
15171 (JSC::stringProtoFuncFixed):
15172 (JSC::stringProtoFuncItalics):
15173 (JSC::stringProtoFuncStrike):
15174 (JSC::stringProtoFuncSub):
15175 (JSC::stringProtoFuncSup):
15176 (JSC::stringProtoFuncFontcolor):
15177 (JSC::stringProtoFuncFontsize):
15178 (JSC::stringProtoFuncAnchor):
15179 (JSC::stringProtoFuncLink):
15180 * runtime/Structure.cpp:
15181 (JSC::Structure::Structure):
15182 (JSC::Structure::changePrototypeTransition):
15183 (JSC::Structure::createCachedPrototypeChain):
15184 * runtime/Structure.h:
15185 (JSC::Structure::create):
15186 (JSC::Structure::setPrototypeWithoutTransition):
15187 (JSC::Structure::storedPrototype):
15188
15189 2009-01-06 Oliver Hunt <oliver@apple.com>
15190
15191 Reviewed by Cameron Zwarich.
15192
15193 <https://bugs.webkit.org/show_bug.cgi?id=23085> [jsfunfuzz] Over released ScopeChainNode
15194 <rdar://problem/6474110>
15195
15196 So this delightful bug was caused by our unwind code using a ScopeChain to perform
15197 the unwind. The ScopeChain would ref the initial top of the scope chain, then deref
15198 the resultant top of scope chain, which is incorrect.
15199
15200 This patch removes the dependency on ScopeChain for the unwind, and i've filed
15201 <https://bugs.webkit.org/show_bug.cgi?id=23144> to look into the unintuitive
15202 ScopeChain behaviour.
15203
15204 * interpreter/Interpreter.cpp:
15205 (JSC::Interpreter::throwException):
15206
15207 2009-01-06 Adam Roben <aroben@apple.com>
15208
15209 Hopeful Windows crash-on-launch fix
15210
15211 * wtf/Platform.h: Force a world rebuild by touching this file.
15212
15213 2009-01-06 Holger Hans Peter Freyther <zecke@selfish.org>
15214
15215 Reviewed by NOBODY (Build fix).
15216
15217 * GNUmakefile.am:Add ByteArray.cpp too
15218
15219 2009-01-06 Holger Hans Peter Freyther <zecke@selfish.org>
15220
15221 Reviewed by NOBODY (Speculative build fix).
15222
15223 AllInOneFile.cpp does not include the JSByteArray.cpp include it...
15224
15225 * GNUmakefile.am:
15226
15227 2009-01-05 Oliver Hunt <oliver@apple.com>
15228
15229 Reviewed by NOBODY (Build fix).
15230
15231 Fix Wx build
15232
15233 * JavaScriptCoreSources.bkl:
15234
15235 2009-01-05 Oliver Hunt <oliver@apple.com>
15236
15237 Windows build fixes
15238
15239 Rubber-stamped by Alice Liu.
15240
15241 * interpreter/Interpreter.cpp:
15242 (JSC::Interpreter::Interpreter):
15243 * runtime/ByteArray.cpp:
15244 (JSC::ByteArray::create):
15245 * runtime/ByteArray.h:
15246
15247 2009-01-05 Oliver Hunt <oliver@apple.com>
15248
15249 Reviewed by Gavin Barraclough.
15250
15251 CanvasPixelArray performance is too slow
15252 <https://bugs.webkit.org/show_bug.cgi?id=23123>
15253
15254 The fix to this is to devirtualise get and put in a manner similar to
15255 JSString and JSArray. To do this I've added a ByteArray implementation
15256 and JSByteArray wrapper to JSC. We can then do vptr comparisons to
15257 devirtualise the calls.
15258
15259 This devirtualisation improves performance by 1.5-2x in my somewhat ad
15260 hoc tests.
15261
15262 * GNUmakefile.am:
15263 * JavaScriptCore.exp:
15264 * JavaScriptCore.pri:
15265 * JavaScriptCore.scons:
15266 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
15267 * JavaScriptCore.xcodeproj/project.pbxproj:
15268 * interpreter/Interpreter.cpp:
15269 (JSC::Interpreter::Interpreter):
15270 (JSC::Interpreter::privateExecute):
15271 (JSC::Interpreter::cti_op_get_by_val):
15272 (JSC::Interpreter::cti_op_put_by_val):
15273 * interpreter/Interpreter.h:
15274 (JSC::Interpreter::isJSByteArray):
15275 * runtime/ByteArray.cpp: Added.
15276 (JSC::ByteArray::create):
15277 * runtime/ByteArray.h: Added.
15278 (JSC::ByteArray::length):
15279 (JSC::ByteArray::set):
15280 (JSC::ByteArray::get):
15281 (JSC::ByteArray::data):
15282 (JSC::ByteArray::ByteArray):
15283 * runtime/JSByteArray.cpp: Added.
15284 (JSC::):
15285 (JSC::JSByteArray::JSByteArray):
15286 (JSC::JSByteArray::createStructure):
15287 (JSC::JSByteArray::getOwnPropertySlot):
15288 (JSC::JSByteArray::put):
15289 (JSC::JSByteArray::getPropertyNames):
15290 * runtime/JSByteArray.h: Added.
15291 (JSC::JSByteArray::canAccessIndex):
15292 (JSC::JSByteArray::getIndex):
15293 (JSC::JSByteArray::setIndex):
15294 (JSC::JSByteArray::classInfo):
15295 (JSC::JSByteArray::length):
15296 (JSC::JSByteArray::):
15297 (JSC::JSByteArray::JSByteArray):
15298 (JSC::asByteArray):
15299
15300 2009-01-05 Alexey Proskuryakov <ap@webkit.org>
15301
15302 Reviewed by Darin Adler.
15303
15304 https://bugs.webkit.org/show_bug.cgi?id=23073
15305 <rdar://problem/6471129> Workers crash on Windows Release builds
15306
15307 * wtf/ThreadSpecific.h:
15308 (WTF::ThreadSpecific::destroy): Changed to clear the pointer only after data object
15309 destruction is finished - otherwise, WebCore::ThreadGlobalData destructor was re-creating
15310 the object in order to access atomic string table.
15311 (WTF::ThreadSpecific::operator T*): Symmetrically, set up the per-thread pointer before
15312 data constructor is called.
15313
15314 * wtf/ThreadingWin.cpp: (WTF::wtfThreadEntryPoint): Remove a Windows-only hack to finalize
15315 a thread - pthreadVC2 is a DLL, so it gets thread detached messages, and cleans up thread
15316 specific data automatically. Besides, this code wasn't even compiled in for some time now.
15317
15318 2009-01-05 Alexey Proskuryakov <ap@webkit.org>
15319
15320 Reviewed by Darin Adler.
15321
15322 https://bugs.webkit.org/show_bug.cgi?id=23115
15323 Create a version of ASSERT for use with otherwise unused variables
15324
15325 * wtf/Assertions.h: Added ASSERT_UNUSED.
15326
15327 * jit/ExecutableAllocatorPosix.cpp:
15328 (JSC::ExecutablePool::systemRelease):
15329 * runtime/Collector.cpp:
15330 (JSC::Heap::destroy):
15331 (JSC::Heap::heapAllocate):
15332 * runtime/JSNotAnObject.cpp:
15333 (JSC::JSNotAnObject::toPrimitive):
15334 (JSC::JSNotAnObject::getPrimitiveNumber):
15335 (JSC::JSNotAnObject::toBoolean):
15336 (JSC::JSNotAnObject::toNumber):
15337 (JSC::JSNotAnObject::toString):
15338 (JSC::JSNotAnObject::getOwnPropertySlot):
15339 (JSC::JSNotAnObject::put):
15340 (JSC::JSNotAnObject::deleteProperty):
15341 (JSC::JSNotAnObject::getPropertyNames):
15342 * wtf/TCSystemAlloc.cpp:
15343 (TCMalloc_SystemRelease):
15344 Use it in some places that used other idioms for this purpose.
15345
15346 2009-01-04 Alice Liu <alice.liu@apple.com>
15347
15348 <rdar://problem/6341776> Merge m_transitionCount and m_offset in Structure.
15349
15350 Reviewed by Darin Adler.
15351
15352 * runtime/Structure.cpp:
15353 (JSC::Structure::Structure): Remove m_transitionCount
15354 (JSC::Structure::addPropertyTransitionToExistingStructure): No need to wait until after the assignment to offset to assert if it's notFound; move it up.
15355 (JSC::Structure::addPropertyTransition): Use method for transitionCount instead of m_transitionCount. Remove line that maintains the m_transitionCount.
15356 (JSC::Structure::changePrototypeTransition): Remove line that maintains the m_transitionCount.
15357 (JSC::Structure::getterSetterTransition): Remove line that maintains the m_transitionCount.
15358 * runtime/Structure.h:
15359 Changed s_maxTransitionLength and m_offset from size_t to signed char. m_offset will never become greater than 64
15360 because the structure transitions to a dictionary at that time.
15361 (JSC::Structure::transitionCount): method to replace the data member
15362
15363 2009-01-04 Darin Adler <darin@apple.com>
15364
15365 Reviewed by David Kilzer.
15366
15367 Bug 15114: Provide compile-time assertions for sizeof(UChar), sizeof(DeprecatedChar), etc.
15368 https://bugs.webkit.org/show_bug.cgi?id=15114
15369
15370 * wtf/unicode/Unicode.h: Assert size of UChar. There is no DeprecatedChar any more.
15371
15372 2009-01-03 Sam Weinig <sam@webkit.org>
15373
15374 Reviewed by Oliver Hunt.
15375
15376 Change the pcVector from storing native code pointers to storing offsets
15377 from the base pointer. This will allow us to generate the pcVector on demand
15378 for exceptions.
15379
15380 * bytecode/CodeBlock.h:
15381 (JSC::PC::PC):
15382 (JSC::getNativePCOffset):
15383 (JSC::CodeBlock::getBytecodeIndex):
15384 * jit/JIT.cpp:
15385 (JSC::JIT::privateCompile):
15386
15387 2009-01-02 Oliver Hunt <oliver@apple.com>
15388
15389 Reviewed by NOBODY (Build fix).
15390
15391 * runtime/ScopeChain.cpp:
15392
15393 2009-01-02 Oliver Hunt <oliver@apple.com>
15394
15395 Reviewed by Gavin Barraclough.
15396
15397 [jsfunfuzz] unwind logic for exceptions in eval fails to account for dynamic scope external to the eval
15398 https://bugs.webkit.org/show_bug.cgi?id=23078
15399
15400 This bug was caused by eval codeblocks being generated without accounting
15401 for the depth of the scope chain they inherited. This meant that exception
15402 handlers would understate their expected scope chain depth, which in turn
15403 led to incorrectly removing nodes from the scope chain.
15404
15405 * bytecompiler/BytecodeGenerator.cpp:
15406 (JSC::BytecodeGenerator::BytecodeGenerator):
15407 (JSC::BytecodeGenerator::emitCatch):
15408 * bytecompiler/BytecodeGenerator.h:
15409 * interpreter/Interpreter.cpp:
15410 (JSC::depth):
15411 * runtime/ScopeChain.cpp:
15412 (JSC::ScopeChain::localDepth):
15413 * runtime/ScopeChain.h:
15414 (JSC::ScopeChainNode::deref):
15415 (JSC::ScopeChainNode::ref):
15416
15417 2009-01-02 David Smith <catfish.man@gmail.com>
15418
15419 Reviewed by Darin Adler.
15420
15421 https://bugs.webkit.org/show_bug.cgi?id=22699
15422 Enable NodeList caching for getElementsByTagName
15423
15424 * wtf/HashFunctions.h: Moved the definition of PHI here and renamed to stringHashingStartValue
15425
15426 2009-01-02 David Kilzer <ddkilzer@apple.com>
15427
15428 Attempt to fix Qt Linux build after r39553
15429
15430 * wtf/RandomNumberSeed.h: Include <sys/time.h> for gettimeofday().
15431 Include <sys/types.h> and <unistd.h> for getpid().
15432
15433 2009-01-02 David Kilzer <ddkilzer@apple.com>
15434
15435 Bug 23081: These files are no longer part of the KDE libraries
15436
15437 <https://bugs.webkit.org/show_bug.cgi?id=23081>
15438
15439 Reviewed by Darin Adler.
15440
15441 Removed "This file is part of the KDE libraries" comment from
15442 source files. Added or updated Apple copyrights as well.
15443
15444 * parser/Lexer.h:
15445 * wtf/HashCountedSet.h:
15446 * wtf/RetainPtr.h:
15447 * wtf/VectorTraits.h:
15448
15449 2009-01-02 David Kilzer <ddkilzer@apple.com>
15450
15451 Bug 23080: Remove last vestiges of KJS references
15452
15453 <https://bugs.webkit.org/show_bug.cgi?id=23080>
15454
15455 Reviewed by Darin Adler.
15456
15457 Also updated Apple copyright statements.
15458
15459 * DerivedSources.make: Changed bison "kjsyy" prefix to "jscyy".
15460 * GNUmakefile.am: Ditto.
15461 * JavaScriptCore.pri: Ditto. Also changed KJSBISON to JSCBISON
15462 and kjsbison to jscbison.
15463
15464 * JavaScriptCoreSources.bkl: Changed JSCORE_KJS_SOURCES to
15465 JSCORE_JSC_SOURCES.
15466 * jscore.bkl: Ditto.
15467
15468 * create_hash_table: Updated copyright and removed old comment.
15469
15470 * parser/Grammar.y: Changed "kjsyy" prefix to "jscyy" prefix.
15471 * parser/Lexer.cpp: Ditto. Also changed KJS_DEBUG_LEX to
15472 JSC_DEBUG_LEX.
15473 (jscyylex):
15474 (JSC::Lexer::lex):
15475 * parser/Parser.cpp: Ditto.
15476 (JSC::Parser::parse):
15477
15478 * pcre/dftables: Changed "kjs_pcre_" prefix to "jsc_pcre_".
15479 * pcre/pcre_compile.cpp: Ditto.
15480 (getOthercaseRange):
15481 (encodeUTF8):
15482 (compileBranch):
15483 (calculateCompiledPatternLength):
15484 * pcre/pcre_exec.cpp: Ditto.
15485 (matchRef):
15486 (getUTF8CharAndIncrementLength):
15487 (match):
15488 * pcre/pcre_internal.h: Ditto.
15489 (toLowerCase):
15490 (flipCase):
15491 (classBitmapForChar):
15492 (charTypeForChar):
15493 * pcre/pcre_tables.cpp: Ditto.
15494 * pcre/pcre_ucp_searchfuncs.cpp: Ditto.
15495 (jsc_pcre_ucp_othercase):
15496 * pcre/pcre_xclass.cpp: Ditto.
15497 (getUTF8CharAndAdvancePointer):
15498 (jsc_pcre_xclass):
15499
15500 * runtime/Collector.h: Updated header guards using the
15501 clean-header-guards script.
15502 * runtime/CollectorHeapIterator.h: Added missing header guard.
15503 * runtime/Identifier.h: Updated header guards.
15504 * runtime/JSFunction.h: Fixed end-of-namespace comment.
15505
15506 * runtime/JSGlobalObject.cpp:
15507 (JSC::JSGlobalObject::reset): Renamed "kjsprint" debug function
15508 to "jscprint". Changed implementation method from
15509 globalFuncKJSPrint() to globalFuncJSCPrint().
15510 * runtime/JSGlobalObjectFunctions.cpp:
15511 (JSC::globalFuncJSCPrint): Renamed from globalFuncKJSPrint().
15512 * runtime/JSGlobalObjectFunctions.h: Ditto.
15513
15514 * runtime/JSImmediate.h: Updated header guards.
15515 * runtime/JSLock.h: Ditto.
15516 * runtime/JSType.h: Ditto.
15517 * runtime/JSWrapperObject.h: Ditto.
15518 * runtime/Lookup.h: Ditto.
15519 * runtime/Operations.h: Ditto.
15520 * runtime/Protect.h: Ditto.
15521 * runtime/RegExp.h: Ditto.
15522 * runtime/UString.h: Ditto.
15523
15524 * tests/mozilla/js1_5/Array/regress-157652.js: Changed "KJS"
15525 reference in comment to "JSC".
15526
15527 * wrec/CharacterClassConstructor.cpp: Change "kjs_pcre_" function
15528 prefixes to "jsc_pcre_".
15529 (JSC::WREC::CharacterClassConstructor::put):
15530 (JSC::WREC::CharacterClassConstructor::flush):
15531
15532 * wtf/unicode/Unicode.h: Change "KJS_" header guard to "WTF_".
15533 * wtf/unicode/icu/UnicodeIcu.h: Ditto.
15534 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
15535
15536 2009-01-02 Oliver Hunt <oliver@apple.com>
15537
15538 Reviewed by Maciej Stachowiak.
15539
15540 Make randomNumber generate 2^53 values instead of 2^32 (or 2^31 for rand() platforms)
15541
15542 * wtf/RandomNumber.cpp:
15543 (WTF::randomNumber):
15544
15545 2009-01-02 David Kilzer <ddkilzer@apple.com>
15546
15547 Remove declaration for JSC::Identifier::initializeIdentifierThreading()
15548
15549 Reviewed by Alexey Proskuryakov.
15550
15551 * runtime/Identifier.h:
15552 (JSC::Identifier::initializeIdentifierThreading): Removed
15553 declaration since the implementation was removed in r34412.
15554
15555 2009-01-01 Darin Adler <darin@apple.com>
15556
15557 Reviewed by Oliver Hunt.
15558
15559 String.replace does not support $& replacement metacharacter when search term is not a RegExp
15560 <https://bugs.webkit.org/show_bug.cgi?id=21431>
15561 <rdar://problem/6274993>
15562
15563 Test: fast/js/string-replace-3.html
15564
15565 * runtime/StringPrototype.cpp:
15566 (JSC::substituteBackreferences): Added a null check here so we won't try to handle $$-$9
15567 backreferences when the search term is a string, not a RegExp. Added a check for 0 so we
15568 won't try to handle $0 or $00 as a backreference.
15569 (JSC::stringProtoFuncReplace): Added a call to substituteBackreferences.
15570
15571 2009-01-01 Gavin Barraclough <barraclough@apple.com>
15572
15573 Reviewed by Darin Adler.
15574
15575 Allow 32-bit integers to be stored in JSImmediates, on x64-bit.
15576 Presently the top 32-bits of a 64-bit JSImmediate serve as a sign extension of a 31-bit
15577 int stored in the low word (shifted left by one, to make room for a tag). In the new
15578 format, the top 31-bits serve as a sign extension of a 32-bit int, still shifted left by
15579 one.
15580
15581 The new behavior is enabled using a flag in Platform.h, 'WTF_USE_ALTERNATE_JSIMMEDIATE'.
15582 When this is set the constants defining the range of ints allowed to be stored as
15583 JSImmediate values is extended. The code in JSImmediate.h can safely operate on either
15584 format. This patch updates the JIT so that it can also operate with the new format.
15585
15586 ~2% progression on x86-64, with & without the JIT, on sunspider & v8 tests.
15587
15588 * assembler/MacroAssembler.h:
15589 (JSC::MacroAssembler::addPtr):
15590 (JSC::MacroAssembler::orPtr):
15591 (JSC::MacroAssembler::or32):
15592 (JSC::MacroAssembler::rshiftPtr):
15593 (JSC::MacroAssembler::rshift32):
15594 (JSC::MacroAssembler::subPtr):
15595 (JSC::MacroAssembler::xorPtr):
15596 (JSC::MacroAssembler::xor32):
15597 (JSC::MacroAssembler::move):
15598 (JSC::MacroAssembler::compareImm64ForBranch):
15599 (JSC::MacroAssembler::compareImm64ForBranchEquality):
15600 (JSC::MacroAssembler::jePtr):
15601 (JSC::MacroAssembler::jgePtr):
15602 (JSC::MacroAssembler::jlPtr):
15603 (JSC::MacroAssembler::jlePtr):
15604 (JSC::MacroAssembler::jnePtr):
15605 (JSC::MacroAssembler::jnzSubPtr):
15606 (JSC::MacroAssembler::joAddPtr):
15607 (JSC::MacroAssembler::jzSubPtr):
15608 * assembler/X86Assembler.h:
15609 (JSC::X86Assembler::addq_rr):
15610 (JSC::X86Assembler::orq_ir):
15611 (JSC::X86Assembler::subq_ir):
15612 (JSC::X86Assembler::xorq_rr):
15613 (JSC::X86Assembler::sarq_CLr):
15614 (JSC::X86Assembler::sarq_i8r):
15615 (JSC::X86Assembler::cmpq_ir):
15616 * jit/JIT.cpp:
15617 (JSC::JIT::compileOpStrictEq):
15618 (JSC::JIT::privateCompileMainPass):
15619 (JSC::JIT::privateCompileSlowCases):
15620 (JSC::JIT::privateCompileCTIMachineTrampolines):
15621 * jit/JIT.h:
15622 * jit/JITArithmetic.cpp:
15623 (JSC::JIT::compileFastArith_op_lshift):
15624 (JSC::JIT::compileFastArithSlow_op_lshift):
15625 (JSC::JIT::compileFastArith_op_rshift):
15626 (JSC::JIT::compileFastArithSlow_op_rshift):
15627 (JSC::JIT::compileFastArith_op_bitand):
15628 (JSC::JIT::compileFastArithSlow_op_bitand):
15629 (JSC::JIT::compileFastArith_op_mod):
15630 (JSC::JIT::compileFastArithSlow_op_mod):
15631 (JSC::JIT::compileFastArith_op_add):
15632 (JSC::JIT::compileFastArithSlow_op_add):
15633 (JSC::JIT::compileFastArith_op_mul):
15634 (JSC::JIT::compileFastArithSlow_op_mul):
15635 (JSC::JIT::compileFastArith_op_post_inc):
15636 (JSC::JIT::compileFastArithSlow_op_post_inc):
15637 (JSC::JIT::compileFastArith_op_post_dec):
15638 (JSC::JIT::compileFastArithSlow_op_post_dec):
15639 (JSC::JIT::compileFastArith_op_pre_inc):
15640 (JSC::JIT::compileFastArithSlow_op_pre_inc):
15641 (JSC::JIT::compileFastArith_op_pre_dec):
15642 (JSC::JIT::compileFastArithSlow_op_pre_dec):
15643 (JSC::JIT::compileBinaryArithOp):
15644 * jit/JITInlineMethods.h:
15645 (JSC::JIT::getConstantOperand):
15646 (JSC::JIT::getConstantOperandImmediateInt):
15647 (JSC::JIT::isOperandConstantImmediateInt):
15648 (JSC::JIT::isOperandConstant31BitImmediateInt):
15649 (JSC::JIT::emitFastArithDeTagImmediate):
15650 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
15651 (JSC::JIT::emitFastArithReTagImmediate):
15652 (JSC::JIT::emitFastArithImmToInt):
15653 (JSC::JIT::emitFastArithIntToImmNoCheck):
15654 * runtime/JSImmediate.h:
15655 (JSC::JSImmediate::isPositiveNumber):
15656 (JSC::JSImmediate::isNegative):
15657 (JSC::JSImmediate::rightShiftImmediateNumbers):
15658 (JSC::JSImmediate::canDoFastAdditiveOperations):
15659 (JSC::JSImmediate::makeValue):
15660 (JSC::JSImmediate::makeInt):
15661 (JSC::JSImmediate::makeBool):
15662 (JSC::JSImmediate::intValue):
15663 (JSC::JSImmediate::rawValue):
15664 (JSC::JSImmediate::toBoolean):
15665 (JSC::JSImmediate::from):
15666 * wtf/Platform.h:
15667
15668 2008-12-31 Oliver Hunt <oliver@apple.com>
15669
15670 Reviewed by Cameron Zwarich.
15671
15672 [jsfunfuzz] Assertion + incorrect behaviour with dynamically created local variable in a catch block
15673 <https://bugs.webkit.org/show_bug.cgi?id=23063>
15674
15675 Eval inside a catch block attempts to use the catch block's static scope in
15676 an unsafe way by attempting to add new properties to the scope. This patch
15677 fixes this issue simply by preventing the catch block from using a static
15678 scope if it contains an eval.
15679
15680 * parser/Grammar.y:
15681 * parser/Nodes.cpp:
15682 (JSC::TryNode::emitBytecode):
15683 * parser/Nodes.h:
15684 (JSC::TryNode::):
15685
15686 2008-12-31 Oliver Hunt <oliver@apple.com>
15687
15688 Reviewed by Gavin Barraclough.
15689
15690 [jsfunfuzz] Computed exception offset wrong when first instruction is attempt to resolve deleted eval
15691 <https://bugs.webkit.org/show_bug.cgi?id=23062>
15692
15693 This was caused by the expression information for the initial resolve of
15694 eval not being emitted. If this resolve was the first instruction that
15695 could throw an exception the information search would fail leading to an
15696 assertion failure. If it was not the first throwable opcode the wrong
15697 expression information would used.
15698
15699 Fix is simply to emit the expression info.
15700
15701 * parser/Nodes.cpp:
15702 (JSC::EvalFunctionCallNode::emitBytecode):
15703
15704 2008-12-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15705
15706 Reviewed by Oliver Hunt.
15707
15708 Bug 23054: Caching of global lookups occurs even when the global object has become a dictionary
15709 <https://bugs.webkit.org/show_bug.cgi?id=23054>
15710 <rdar://problem/6469905>
15711
15712 * interpreter/Interpreter.cpp:
15713 (JSC::Interpreter::resolveGlobal): Do not cache lookup if the global
15714 object has transitioned to a dictionary.
15715 (JSC::Interpreter::cti_op_resolve_global): Do not cache lookup if the
15716 global object has transitioned to a dictionary.
15717
15718 2008-12-30 Oliver Hunt <oliver@apple.com>
15719
15720 Reviewed by Darin Adler.
15721
15722 <https://bugs.webkit.org/show_bug.cgi?id=23049> [jsfunfuzz] With blocks do not correctly protect their scope object
15723 <rdar://problem/6469742> Crash in JSC::TypeInfo::hasStandardGetOwnPropertySlot() running jsfunfuzz
15724
15725 The problem that caused this was that with nodes were not correctly protecting
15726 the final object that was placed in the scope chain. We correct this by forcing
15727 the use of a temporary register (which stops us relying on a local register
15728 protecting the scope) and changing the behaviour of op_push_scope so that it
15729 will store the final scope object.
15730
15731 * bytecompiler/BytecodeGenerator.cpp:
15732 (JSC::BytecodeGenerator::emitPushScope):
15733 * interpreter/Interpreter.cpp:
15734 (JSC::Interpreter::privateExecute):
15735 (JSC::Interpreter::cti_op_push_scope):
15736 * interpreter/Interpreter.h:
15737 * jit/JIT.cpp:
15738 (JSC::JIT::privateCompileMainPass):
15739 * parser/Nodes.cpp:
15740 (JSC::WithNode::emitBytecode):
15741
15742 2008-12-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15743
15744 Reviewed by Sam Weinig.
15745
15746 Bug 23037: Parsing and reparsing disagree on automatic semicolon insertion
15747 <https://bugs.webkit.org/show_bug.cgi?id=23037>
15748 <rdar://problem/6467124>
15749
15750 Parsing and reparsing disagree about automatic semicolon insertion, so that a
15751 function like
15752
15753 function() { a = 1, }
15754
15755 is parsed as being syntactically valid but gets a syntax error upon reparsing.
15756 This leads to an assertion failure in Parser::reparse(). It is not that big of
15757 an issue in practice, because in a Release build such a function will return
15758 'undefined' when called.
15759
15760 In this case, we are not following the spec and it should be a syntax error.
15761 However, unless there is a newline separating the ',' and the '}', WebKit would
15762 not treat it as a syntax error in the past either. It would be a bit of work to
15763 make the automatic semicolon insertion match the spec exactly, so this patch
15764 changes it to match our past behaviour.
15765
15766 The problem is that even during reparsing, the Lexer adds a semicolon at the
15767 end of the input, which confuses allowAutomaticSemicolon(), because it is
15768 expecting either a '}', the end of input, or a terminator like a newline.
15769
15770 * parser/Lexer.cpp:
15771 (JSC::Lexer::Lexer): Initialize m_isReparsing to false.
15772 (JSC::Lexer::lex): Do not perform automatic semicolon insertion in the Lexer if
15773 we are in the middle of reparsing.
15774 (JSC::Lexer::clear): Set m_isReparsing to false.
15775 * parser/Lexer.h:
15776 (JSC::Lexer::setIsReparsing): Added.
15777 * parser/Parser.cpp:
15778 (JSC::Parser::reparse): Call Lexer::setIsReparsing() to notify the Lexer of
15779 reparsing.
15780
15781 2008-12-29 Oliver Hunt <oliver@apple.com>
15782
15783 Reviewed by NOBODY (Build fix).
15784
15785 Yet another attempt to fix Tiger.
15786
15787 * wtf/RandomNumber.cpp:
15788 (WTF::randomNumber):
15789
15790 2008-12-29 Oliver Hunt <oliver@apple.com>
15791
15792 Reviewed by NOBODY (Build fix).
15793
15794 Tiger build fix (correct this time)
15795
15796 * wtf/RandomNumber.cpp:
15797
15798 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15799
15800 Rubber-stamped by Alexey Proskuryakov.
15801
15802 Revert r39509, because kjsyydebug is used in the generated code if YYDEBUG is 1.
15803
15804 * parser/Grammar.y:
15805
15806 2008-12-29 Oliver Hunt <oliver@apple.com>
15807
15808 Reviewed by NOBODY (Build fix).
15809
15810 Tiger build fix.
15811
15812 * wtf/RandomNumber.cpp:
15813
15814 2008-12-29 Oliver Hunt <oliver@apple.com>
15815
15816 Reviewed by Mark Rowe.
15817
15818 <rdar://problem/6358108> Insecure randomness in Math.random() leads to user tracking
15819
15820 Switch to arc4random on PLATFORM(DARWIN), this is ~1.5x slower than random(), but the
15821 it is still so fast that there is no fathomable way it could be a bottleneck for anything.
15822
15823 randomNumber is called in two places
15824 * During form submission where it is called once per form
15825 * Math.random in JSC. For this difference to show up you have to be looping on
15826 a cached local copy of random, for a large (>10000) calls.
15827
15828 No change in SunSpider.
15829
15830 * wtf/RandomNumber.cpp:
15831 (WTF::randomNumber):
15832 * wtf/RandomNumberSeed.h:
15833 (WTF::initializeRandomNumberGenerator):
15834
15835 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15836
15837 Rubber-stamped by Sam Weinig.
15838
15839 Remove unused kjsyydebug #define.
15840
15841 * parser/Grammar.y:
15842
15843 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15844
15845 Reviewed by Oliver Hunt and Sam Weinig.
15846
15847 Bug 23029: REGRESSION (r39337): jsfunfuzz generates identical test files
15848 <https://bugs.webkit.org/show_bug.cgi?id=23029>
15849 <rdar://problem/6469185>
15850
15851 The unification of random number generation in r39337 resulted in random()
15852 being initialized on Darwin, but rand() actually being used. Fix this by
15853 making randomNumber() use random() instead of rand() on Darwin.
15854
15855 * wtf/RandomNumber.cpp:
15856 (WTF::randomNumber):
15857
15858 2008-12-29 Sam Weinig <sam@webkit.org>
15859
15860 Fix buildbots.
15861
15862 * runtime/Structure.cpp:
15863
15864 2008-12-29 Sam Weinig <sam@webkit.org>
15865
15866 Reviewed by Oliver Hunt.
15867
15868 Patch for https://bugs.webkit.org/show_bug.cgi?id=23026
15869 Move the deleted offsets vector into the PropertyMap
15870
15871 Saves 3 words per Structure.
15872
15873 * runtime/PropertyMapHashTable.h:
15874 * runtime/Structure.cpp:
15875 (JSC::Structure::addPropertyTransition):
15876 (JSC::Structure::changePrototypeTransition):
15877 (JSC::Structure::getterSetterTransition):
15878 (JSC::Structure::toDictionaryTransition):
15879 (JSC::Structure::fromDictionaryTransition):
15880 (JSC::Structure::copyPropertyTable):
15881 (JSC::Structure::put):
15882 (JSC::Structure::remove):
15883 (JSC::Structure::rehashPropertyMapHashTable):
15884 * runtime/Structure.h:
15885 (JSC::Structure::propertyStorageSize):
15886
15887 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15888
15889 Reviewed by Oliver Hunt.
15890
15891 Change code using m_body.get() as a boolean to take advantage of the
15892 implicit conversion of RefPtr to boolean.
15893
15894 * runtime/JSFunction.cpp:
15895 (JSC::JSFunction::~JSFunction):
15896
15897 2008-12-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
15898
15899 Reviewed by Oliver Hunt.
15900
15901 Bug 22840: REGRESSION (r38349): Gmail doesn't load with profiling enabled
15902 <https://bugs.webkit.org/show_bug.cgi?id=22840>
15903 <rdar://problem/6468077>
15904
15905 * bytecompiler/BytecodeGenerator.cpp:
15906 (JSC::BytecodeGenerator::emitNewArray): Add an assertion that the range
15907 of registers passed to op_new_array is sequential.
15908 (JSC::BytecodeGenerator::emitCall): Correct the relocation of registers
15909 when emitting profiler hooks so that registers aren't leaked. Also, add
15910 an assertion that the 'this' register is always ref'd (because it is),
15911 remove the needless protection of the 'this' register when relocating,
15912 and add an assertion that the range of registers passed to op_call for
15913 function call arguments is sequential.
15914 (JSC::BytecodeGenerator::emitConstruct): Correct the relocation of
15915 registers when emitting profiler hooks so that registers aren't leaked.
15916 Also, add an assertion that the range of registers passed to op_construct
15917 for function call arguments is sequential.
15918
15919 2008-12-26 Mark Rowe <mrowe@apple.com>
15920
15921 Reviewed by Alexey Proskuryakov.
15922
15923 <rdar://problem/6467376> Race condition in WTF::currentThread can lead to a thread using two different identifiers during its lifetime
15924
15925 If a newly-created thread calls WTF::currentThread() before WTF::createThread calls establishIdentifierForPthreadHandle
15926 then more than one identifier will be used for the same thread. We can avoid this by adding some extra synchronization
15927 during thread creation that delays the execution of the thread function until the thread identifier has been set up, and
15928 an assertion to catch this problem should it reappear in the future.
15929
15930 * wtf/Threading.cpp: Added.
15931 (WTF::NewThreadContext::NewThreadContext):
15932 (WTF::threadEntryPoint):
15933 (WTF::createThread): Add cross-platform createThread function that delays the execution of the thread function until
15934 after the thread identifier has been set up.
15935 * wtf/Threading.h:
15936 * wtf/ThreadingGtk.cpp:
15937 (WTF::establishIdentifierForThread):
15938 (WTF::createThreadInternal):
15939 * wtf/ThreadingNone.cpp:
15940 (WTF::createThreadInternal):
15941 * wtf/ThreadingPthreads.cpp:
15942 (WTF::establishIdentifierForPthreadHandle):
15943 (WTF::createThreadInternal):
15944 * wtf/ThreadingQt.cpp:
15945 (WTF::identifierByQthreadHandle):
15946 (WTF::establishIdentifierForThread):
15947 (WTF::createThreadInternal):
15948 * wtf/ThreadingWin.cpp:
15949 (WTF::storeThreadHandleByIdentifier):
15950 (WTF::createThreadInternal):
15951
15952 Add Threading.cpp to the build.
15953
15954 * GNUmakefile.am:
15955 * JavaScriptCore.pri:
15956 * JavaScriptCore.scons:
15957 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
15958 * JavaScriptCore.xcodeproj/project.pbxproj:
15959 * JavaScriptCoreSources.bkl:
15960
15961 2008-12-26 Sam Weinig <sam@webkit.org>
15962
15963 Reviewed by Alexey Proskuryakov.
15964
15965 Remove unused method.
15966
15967 * runtime/Structure.h: Remove mutableTypeInfo.
15968
15969 2008-12-22 Gavin Barraclough <barraclough@apple.com>
15970
15971 Reviewed by Oliver Hunt.
15972
15973 Fix rounding / bounds / signed comparison bug in ExecutableAllocator.
15974
15975 ExecutableAllocator::alloc assumed that m_freePtr would be aligned. This was
15976 not always true, since the first allocation from an additional pool would not
15977 be rounded up. Subsequent allocations would be unaligned, and too much memory
15978 could be erroneously allocated from the pool, when the size requested was
15979 available, but the size rounded up to word granularity was not available in the
15980 pool. This may result in the value of m_freePtr being greater than m_end.
15981
15982 Under these circumstances, the unsigned check for space will always pass,
15983 resulting in pointers to memory outside of the arena being returned, and
15984 ultimately segfaulty goodness when attempting to memcpy the hot freshly jitted
15985 code from the AssemblerBuffer.
15986
15987 https://bugs.webkit.org/show_bug.cgi?id=22974
15988 ... and probably many, many more.
15989
15990 * jit/ExecutableAllocator.h:
15991 (JSC::ExecutablePool::alloc):
15992 (JSC::ExecutablePool::roundUpAllocationSize):
15993 (JSC::ExecutablePool::ExecutablePool):
15994 (JSC::ExecutablePool::poolAllocate):
15995
15996 2008-12-22 Sam Weinig <sam@webkit.org>
15997
15998 Reviewed by Gavin Barraclough.
15999
16000 Rename all uses of the term "repatch" to "patch".
16001
16002 * assembler/MacroAssembler.h:
16003 (JSC::MacroAssembler::DataLabelPtr::patch):
16004 (JSC::MacroAssembler::DataLabel32::patch):
16005 (JSC::MacroAssembler::Jump::patch):
16006 (JSC::MacroAssembler::PatchBuffer::PatchBuffer):
16007 (JSC::MacroAssembler::PatchBuffer::setPtr):
16008 (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
16009 (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
16010 (JSC::MacroAssembler::storePtrWithPatch):
16011 (JSC::MacroAssembler::jnePtrWithPatch):
16012 * assembler/X86Assembler.h:
16013 (JSC::X86Assembler::patchAddress):
16014 (JSC::X86Assembler::patchImmediate):
16015 (JSC::X86Assembler::patchPointer):
16016 (JSC::X86Assembler::patchBranchOffset):
16017 * interpreter/Interpreter.cpp:
16018 (JSC::Interpreter::tryCTICachePutByID):
16019 (JSC::Interpreter::tryCTICacheGetByID):
16020 (JSC::Interpreter::cti_op_put_by_id):
16021 (JSC::Interpreter::cti_op_get_by_id):
16022 (JSC::Interpreter::cti_op_get_by_id_self_fail):
16023 (JSC::Interpreter::cti_op_get_by_id_proto_list):
16024 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
16025 * jit/JIT.cpp:
16026 (JSC::ctiPatchCallByReturnAddress):
16027 (JSC::JIT::privateCompileMainPass):
16028 (JSC::JIT::privateCompile):
16029 (JSC::JIT::privateCompileCTIMachineTrampolines):
16030 * jit/JIT.h:
16031 * jit/JITCall.cpp:
16032 (JSC::JIT::unlinkCall):
16033 (JSC::JIT::linkCall):
16034 (JSC::JIT::compileOpCall):
16035 * jit/JITPropertyAccess.cpp:
16036 (JSC::JIT::compileGetByIdHotPath):
16037 (JSC::JIT::compilePutByIdHotPath):
16038 (JSC::JIT::compileGetByIdSlowCase):
16039 (JSC::JIT::compilePutByIdSlowCase):
16040 (JSC::JIT::privateCompilePutByIdTransition):
16041 (JSC::JIT::patchGetByIdSelf):
16042 (JSC::JIT::patchPutByIdReplace):
16043 (JSC::JIT::privateCompilePatchGetArrayLength):
16044 (JSC::JIT::privateCompileGetByIdSelf):
16045 (JSC::JIT::privateCompileGetByIdProto):
16046 (JSC::JIT::privateCompileGetByIdSelfList):
16047 (JSC::JIT::privateCompileGetByIdProtoList):
16048 (JSC::JIT::privateCompileGetByIdChainList):
16049 (JSC::JIT::privateCompileGetByIdChain):
16050 (JSC::JIT::privateCompilePutByIdReplace):
16051
16052 2008-12-22 Adam Roben <aroben@apple.com>
16053
16054 Build fix after r39428
16055
16056 * jit/JITCall.cpp:
16057 (JSC::JIT::compileOpCallSlowCase): Added a missing MacroAssembler::
16058
16059 2008-12-22 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
16060
16061 Rubber-stamped by George Staikos.
16062
16063 Unify all TorchMobile copyright lines. Consolidate in a single line, as requested by Mark Rowe, some time ago.
16064
16065 * wtf/RandomNumber.cpp:
16066 * wtf/RandomNumber.h:
16067 * wtf/RandomNumberSeed.h:
16068
16069 2008-12-21 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
16070
16071 Rubber-stamped by George Staikos.
16072
16073 Fix copyright of the new RandomNumber* files.
16074
16075 * wtf/RandomNumber.cpp:
16076 * wtf/RandomNumber.h:
16077 * wtf/RandomNumberSeed.h:
16078
16079 2008-12-21 Gavin Barraclough <barraclough@apple.com>
16080
16081 Reviewed by Oliver Hunt & Cameron Zwarich.
16082
16083 Add support for call and property access repatching on x86-64.
16084
16085 No change in performance on current configurations (2x impovement on v8-tests with JIT enabled on x86-64).
16086
16087 * assembler/MacroAssembler.h:
16088 (JSC::MacroAssembler::DataLabelPtr::repatch):
16089 (JSC::MacroAssembler::DataLabelPtr::operator X86Assembler::JmpDst):
16090 (JSC::MacroAssembler::DataLabel32::repatch):
16091 (JSC::MacroAssembler::RepatchBuffer::addressOf):
16092 (JSC::MacroAssembler::add32):
16093 (JSC::MacroAssembler::sub32):
16094 (JSC::MacroAssembler::loadPtrWithAddressOffsetRepatch):
16095 (JSC::MacroAssembler::storePtrWithAddressOffsetRepatch):
16096 (JSC::MacroAssembler::jePtr):
16097 (JSC::MacroAssembler::jnePtr):
16098 (JSC::MacroAssembler::jnePtrWithRepatch):
16099 (JSC::MacroAssembler::differenceBetween):
16100 * assembler/X86Assembler.h:
16101 (JSC::X86Assembler::addl_im):
16102 (JSC::X86Assembler::subl_im):
16103 (JSC::X86Assembler::cmpl_rm):
16104 (JSC::X86Assembler::movq_rm_disp32):
16105 (JSC::X86Assembler::movq_mr_disp32):
16106 (JSC::X86Assembler::repatchPointer):
16107 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp32):
16108 * jit/JIT.cpp:
16109 (JSC::JIT::privateCompile):
16110 (JSC::JIT::privateCompileCTIMachineTrampolines):
16111 * jit/JIT.h:
16112 * jit/JITCall.cpp:
16113 (JSC::JIT::unlinkCall):
16114 (JSC::JIT::linkCall):
16115 (JSC::JIT::compileOpCall):
16116 (JSC::JIT::compileOpCallSlowCase):
16117 * jit/JITInlineMethods.h:
16118 (JSC::JIT::restoreArgumentReferenceForTrampoline):
16119 * jit/JITPropertyAccess.cpp:
16120 (JSC::JIT::compileGetByIdHotPath):
16121 (JSC::JIT::compileGetByIdSlowCase):
16122 (JSC::JIT::compilePutByIdHotPath):
16123 (JSC::JIT::compilePutByIdSlowCase):
16124 (JSC::resizePropertyStorage):
16125 (JSC::JIT::privateCompilePutByIdTransition):
16126 (JSC::JIT::privateCompileGetByIdProto):
16127 (JSC::JIT::privateCompileGetByIdProtoList):
16128 (JSC::JIT::privateCompileGetByIdChainList):
16129 (JSC::JIT::privateCompileGetByIdChain):
16130 * wtf/Platform.h:
16131
16132 2008-12-20 Gavin Barraclough <barraclough@apple.com>
16133
16134 Reviewed by Oliver Hunt.
16135
16136 Port optimized property access generation to the MacroAssembler.
16137
16138 * assembler/MacroAssembler.h:
16139 (JSC::MacroAssembler::AbsoluteAddress::AbsoluteAddress):
16140 (JSC::MacroAssembler::DataLabelPtr::repatch):
16141 (JSC::MacroAssembler::DataLabel32::DataLabel32):
16142 (JSC::MacroAssembler::DataLabel32::repatch):
16143 (JSC::MacroAssembler::Label::operator X86Assembler::JmpDst):
16144 (JSC::MacroAssembler::Jump::repatch):
16145 (JSC::MacroAssembler::JumpList::empty):
16146 (JSC::MacroAssembler::RepatchBuffer::link):
16147 (JSC::MacroAssembler::add32):
16148 (JSC::MacroAssembler::and32):
16149 (JSC::MacroAssembler::sub32):
16150 (JSC::MacroAssembler::loadPtrWithAddressRepatch):
16151 (JSC::MacroAssembler::storePtrWithAddressRepatch):
16152 (JSC::MacroAssembler::push):
16153 (JSC::MacroAssembler::ja32):
16154 (JSC::MacroAssembler::jePtr):
16155 (JSC::MacroAssembler::jnePtr):
16156 (JSC::MacroAssembler::jnePtrWithRepatch):
16157 (JSC::MacroAssembler::align):
16158 (JSC::MacroAssembler::differenceBetween):
16159 * assembler/X86Assembler.h:
16160 (JSC::X86Assembler::movl_rm_disp32):
16161 (JSC::X86Assembler::movl_mr_disp32):
16162 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp32):
16163 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
16164 * jit/JIT.cpp:
16165 (JSC::ctiRepatchCallByReturnAddress):
16166 (JSC::JIT::privateCompileMainPass):
16167 (JSC::JIT::privateCompile):
16168 (JSC::JIT::privateCompileCTIMachineTrampolines):
16169 * jit/JIT.h:
16170 * jit/JITPropertyAccess.cpp:
16171 (JSC::JIT::compileGetByIdHotPath):
16172 (JSC::JIT::compileGetByIdSlowCase):
16173 (JSC::JIT::compilePutByIdHotPath):
16174 (JSC::JIT::compilePutByIdSlowCase):
16175 (JSC::resizePropertyStorage):
16176 (JSC::JIT::privateCompilePutByIdTransition):
16177 (JSC::JIT::patchGetByIdSelf):
16178 (JSC::JIT::patchPutByIdReplace):
16179 (JSC::JIT::privateCompilePatchGetArrayLength):
16180 (JSC::JIT::privateCompileGetByIdSelf):
16181 (JSC::JIT::privateCompileGetByIdProto):
16182 (JSC::JIT::privateCompileGetByIdSelfList):
16183 (JSC::JIT::privateCompileGetByIdProtoList):
16184 (JSC::JIT::privateCompileGetByIdChainList):
16185 (JSC::JIT::privateCompileGetByIdChain):
16186 (JSC::JIT::privateCompilePutByIdReplace):
16187 * wtf/RefCounted.h:
16188 (WTF::RefCountedBase::addressOfCount):
16189
16190 2008-12-19 Gustavo Noronha Silva <gns@gnome.org>
16191
16192 Reviewed by Holger Freyther.
16193
16194 https://bugs.webkit.org/show_bug.cgi?id=22686
16195
16196 Added file which was missing to the javascriptcore_sources
16197 variable, so that it shows up in the tarball created by `make
16198 dist'.
16199
16200 * GNUmakefile.am:
16201
16202 2008-12-19 Holger Hans Peter Freyther <zecke@selfish.org>
16203
16204 Reviewed by Antti Koivisto.
16205
16206 Build fix when building JS API tests with a c89 c compiler
16207
16208 Do not use C++ style comments and convert them to C comments.
16209
16210 * wtf/Platform.h:
16211
16212 2008-12-18 Gavin Barraclough <barraclough@apple.com>
16213
16214 Reviewed by Sam Weinig.
16215
16216 Same as last revision, adding cases for pre & post inc & dec.
16217
16218 https://bugs.webkit.org/show_bug.cgi?id=22928
16219
16220 * jit/JIT.cpp:
16221 (JSC::JIT::privateCompileMainPass):
16222
16223 2008-12-18 Gavin Barraclough <barraclough@apple.com>
16224
16225 Reviewed by Sam Weinig.
16226
16227 Fixes for the JIT's handling of JSImmediate values on x86-64.
16228 On 64-bit systems, the code in JSImmediate.h relies on the upper
16229 bits of a JSImmediate being a sign extension of the low 32-bits.
16230 This was not being enforced by the JIT, since a number of inline
16231 operations were being performed on 32-bit values in registers, and
16232 when a 32-bit result is written to a register on x86-64 the value
16233 is zero-extended to 64-bits.
16234
16235 This fix honors previous behavoir. A better fix in the long run
16236 (when the JIT is enabled by default) may be to change JSImmediate.h
16237 so it no longer relies on the upper bits of the pointer,... though
16238 if we're going to change JSImmediate.h for 64-bit, we probably may
16239 as well change the format so that the full range of 32-bit ints can
16240 be stored, rather than just 31-bits.
16241
16242 https://bugs.webkit.org/show_bug.cgi?id=22925
16243
16244 * assembler/MacroAssembler.h:
16245 (JSC::MacroAssembler::addPtr):
16246 (JSC::MacroAssembler::andPtr):
16247 (JSC::MacroAssembler::orPtr):
16248 (JSC::MacroAssembler::or32):
16249 (JSC::MacroAssembler::xor32):
16250 (JSC::MacroAssembler::xorPtr):
16251 (JSC::MacroAssembler::signExtend32ToPtr):
16252 * assembler/X86Assembler.h:
16253 (JSC::X86Assembler::):
16254 (JSC::X86Assembler::andq_rr):
16255 (JSC::X86Assembler::andq_ir):
16256 (JSC::X86Assembler::orq_rr):
16257 (JSC::X86Assembler::xorq_ir):
16258 (JSC::X86Assembler::movsxd_rr):
16259 * jit/JIT.cpp:
16260 (JSC::JIT::privateCompileMainPass):
16261 * jit/JITInlineMethods.h:
16262 (JSC::JIT::emitFastArithReTagImmediate):
16263 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
16264 (JSC::JIT::emitFastArithImmToInt):
16265
16266 2008-12-18 Gavin Barraclough <barraclough@apple.com>
16267
16268 Reviewed by Sam Weinig.
16269
16270 Just a tidy up - rename & refactor some the #defines configuring the JIT.
16271
16272 * interpreter/Interpreter.cpp:
16273 (JSC::Interpreter::cti_op_convert_this):
16274 (JSC::Interpreter::cti_op_end):
16275 (JSC::Interpreter::cti_op_add):
16276 (JSC::Interpreter::cti_op_pre_inc):
16277 (JSC::Interpreter::cti_timeout_check):
16278 (JSC::Interpreter::cti_register_file_check):
16279 (JSC::Interpreter::cti_op_loop_if_less):
16280 (JSC::Interpreter::cti_op_loop_if_lesseq):
16281 (JSC::Interpreter::cti_op_new_object):
16282 (JSC::Interpreter::cti_op_put_by_id_generic):
16283 (JSC::Interpreter::cti_op_get_by_id_generic):
16284 (JSC::Interpreter::cti_op_put_by_id):
16285 (JSC::Interpreter::cti_op_put_by_id_second):
16286 (JSC::Interpreter::cti_op_put_by_id_fail):
16287 (JSC::Interpreter::cti_op_get_by_id):
16288 (JSC::Interpreter::cti_op_get_by_id_second):
16289 (JSC::Interpreter::cti_op_get_by_id_self_fail):
16290 (JSC::Interpreter::cti_op_get_by_id_proto_list):
16291 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
16292 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
16293 (JSC::Interpreter::cti_op_get_by_id_array_fail):
16294 (JSC::Interpreter::cti_op_get_by_id_string_fail):
16295 (JSC::Interpreter::cti_op_instanceof):
16296 (JSC::Interpreter::cti_op_del_by_id):
16297 (JSC::Interpreter::cti_op_mul):
16298 (JSC::Interpreter::cti_op_new_func):
16299 (JSC::Interpreter::cti_op_call_JSFunction):
16300 (JSC::Interpreter::cti_op_call_arityCheck):
16301 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
16302 (JSC::Interpreter::cti_vm_lazyLinkCall):
16303 (JSC::Interpreter::cti_op_push_activation):
16304 (JSC::Interpreter::cti_op_call_NotJSFunction):
16305 (JSC::Interpreter::cti_op_create_arguments):
16306 (JSC::Interpreter::cti_op_create_arguments_no_params):
16307 (JSC::Interpreter::cti_op_tear_off_activation):
16308 (JSC::Interpreter::cti_op_tear_off_arguments):
16309 (JSC::Interpreter::cti_op_profile_will_call):
16310 (JSC::Interpreter::cti_op_profile_did_call):
16311 (JSC::Interpreter::cti_op_ret_scopeChain):
16312 (JSC::Interpreter::cti_op_new_array):
16313 (JSC::Interpreter::cti_op_resolve):
16314 (JSC::Interpreter::cti_op_construct_JSConstruct):
16315 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
16316 (JSC::Interpreter::cti_op_get_by_val):
16317 (JSC::Interpreter::cti_op_resolve_func):
16318 (JSC::Interpreter::cti_op_sub):
16319 (JSC::Interpreter::cti_op_put_by_val):
16320 (JSC::Interpreter::cti_op_put_by_val_array):
16321 (JSC::Interpreter::cti_op_lesseq):
16322 (JSC::Interpreter::cti_op_loop_if_true):
16323 (JSC::Interpreter::cti_op_negate):
16324 (JSC::Interpreter::cti_op_resolve_base):
16325 (JSC::Interpreter::cti_op_resolve_skip):
16326 (JSC::Interpreter::cti_op_resolve_global):
16327 (JSC::Interpreter::cti_op_div):
16328 (JSC::Interpreter::cti_op_pre_dec):
16329 (JSC::Interpreter::cti_op_jless):
16330 (JSC::Interpreter::cti_op_not):
16331 (JSC::Interpreter::cti_op_jtrue):
16332 (JSC::Interpreter::cti_op_post_inc):
16333 (JSC::Interpreter::cti_op_eq):
16334 (JSC::Interpreter::cti_op_lshift):
16335 (JSC::Interpreter::cti_op_bitand):
16336 (JSC::Interpreter::cti_op_rshift):
16337 (JSC::Interpreter::cti_op_bitnot):
16338 (JSC::Interpreter::cti_op_resolve_with_base):
16339 (JSC::Interpreter::cti_op_new_func_exp):
16340 (JSC::Interpreter::cti_op_mod):
16341 (JSC::Interpreter::cti_op_less):
16342 (JSC::Interpreter::cti_op_neq):
16343 (JSC::Interpreter::cti_op_post_dec):
16344 (JSC::Interpreter::cti_op_urshift):
16345 (JSC::Interpreter::cti_op_bitxor):
16346 (JSC::Interpreter::cti_op_new_regexp):
16347 (JSC::Interpreter::cti_op_bitor):
16348 (JSC::Interpreter::cti_op_call_eval):
16349 (JSC::Interpreter::cti_op_throw):
16350 (JSC::Interpreter::cti_op_get_pnames):
16351 (JSC::Interpreter::cti_op_next_pname):
16352 (JSC::Interpreter::cti_op_push_scope):
16353 (JSC::Interpreter::cti_op_pop_scope):
16354 (JSC::Interpreter::cti_op_typeof):
16355 (JSC::Interpreter::cti_op_is_undefined):
16356 (JSC::Interpreter::cti_op_is_boolean):
16357 (JSC::Interpreter::cti_op_is_number):
16358 (JSC::Interpreter::cti_op_is_string):
16359 (JSC::Interpreter::cti_op_is_object):
16360 (JSC::Interpreter::cti_op_is_function):
16361 (JSC::Interpreter::cti_op_stricteq):
16362 (JSC::Interpreter::cti_op_nstricteq):
16363 (JSC::Interpreter::cti_op_to_jsnumber):
16364 (JSC::Interpreter::cti_op_in):
16365 (JSC::Interpreter::cti_op_push_new_scope):
16366 (JSC::Interpreter::cti_op_jmp_scopes):
16367 (JSC::Interpreter::cti_op_put_by_index):
16368 (JSC::Interpreter::cti_op_switch_imm):
16369 (JSC::Interpreter::cti_op_switch_char):
16370 (JSC::Interpreter::cti_op_switch_string):
16371 (JSC::Interpreter::cti_op_del_by_val):
16372 (JSC::Interpreter::cti_op_put_getter):
16373 (JSC::Interpreter::cti_op_put_setter):
16374 (JSC::Interpreter::cti_op_new_error):
16375 (JSC::Interpreter::cti_op_debug):
16376 (JSC::Interpreter::cti_vm_throw):
16377 * interpreter/Interpreter.h:
16378 * jit/JIT.cpp:
16379 (JSC::):
16380 (JSC::JIT::privateCompileMainPass):
16381 (JSC::JIT::privateCompile):
16382 * jit/JIT.h:
16383 * jit/JITInlineMethods.h:
16384 (JSC::JIT::restoreArgumentReference):
16385 (JSC::JIT::restoreArgumentReferenceForTrampoline):
16386 * wtf/Platform.h:
16387
16388 2008-12-18 Cameron Zwarich <zwarich@apple.com>
16389
16390 Reviewed by Geoff Garen.
16391
16392 Bug 21855: REGRESSION (r37323): Gmail complains about popup blocking when opening a link
16393 <https://bugs.webkit.org/show_bug.cgi?id=21855>
16394 <rdar://problem/6278244>
16395
16396 Move DynamicGlobalObjectScope to JSGlobalObject.h so that it can be used
16397 from WebCore.
16398
16399 * interpreter/Interpreter.cpp:
16400 * runtime/JSGlobalObject.h:
16401 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
16402 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
16403
16404 2008-12-17 Geoffrey Garen <ggaren@apple.com>
16405
16406 Reviewed by Gavin Barraclough.
16407
16408 Fixed https://bugs.webkit.org/show_bug.cgi?id=22393
16409 Segfault when caching property accesses to primitive cells.
16410
16411 Changed some asObject casts to asCell casts in cases where a primitive
16412 value may be a cell and not an object.
16413
16414 Re-enabled property caching for primitives in cases where it had been
16415 disabled because of this bug.
16416
16417 Updated a comment to better explain something Darin thought needed
16418 explaining in an old patch review.
16419
16420 * interpreter/Interpreter.cpp:
16421 (JSC::countPrototypeChainEntriesAndCheckForProxies):
16422 (JSC::Interpreter::tryCacheGetByID):
16423 (JSC::Interpreter::tryCTICacheGetByID):
16424 (JSC::Interpreter::cti_op_get_by_id_self_fail):
16425 (JSC::Interpreter::cti_op_get_by_id_proto_list):
16426
16427 2008-12-17 Gavin Barraclough <barraclough@apple.com>
16428
16429 Reviewed by Cameron Zwarich.
16430
16431 Fixes for Sunspider failures with the JIT enabled on x86-64.
16432
16433 * assembler/MacroAssembler.h:
16434 Switch the order of the RegisterID & Address form of je32, to keep it consistent with jne32.
16435 * jit/JIT.cpp:
16436 * jit/JIT.h:
16437 * jit/JITInlineMethods.h:
16438 Port the m_ctiVirtualCall tramopline generation to use the MacroAssembler interface.
16439 * jit/JITCall.cpp:
16440 Fix bug in the non-optimizing code path, vptr check should have been to the memory address pointer
16441 to by the register, not to the register itself.
16442 * wrec/WRECGenerator.cpp:
16443 See assembler/MacroAssembler.h, above.
16444
16445 2008-12-17 Gavin Barraclough <barraclough@apple.com>
16446
16447 Reviewed by Sam Weinig.
16448
16449 print("Hello, 64-bit jitted world!");
16450 Get hello-world working through the JIT, on x86-64.
16451
16452 * assembler/X86Assembler.h:
16453 Fix encoding of opcode + RegisterID format instructions for 64-bit.
16454 * interpreter/Interpreter.cpp:
16455 * interpreter/Interpreter.h:
16456 Make VoidPtrPair actually be a pair of void*s.
16457 (Possibly should make this change for 32-bit Mac platforms, too - but won't change 32-bit behaviour in this patch).
16458 * jit/JIT.cpp:
16459 * jit/JIT.h:
16460 Provide names for the timeoutCheckRegister & callFrameRegister on x86-64,
16461 force x86-64 ctiTrampoline arguments onto the stack,
16462 implement the asm trampolines for x86-64,
16463 implement the restoreArgumentReference methods for x86-64 calling conventions.
16464 * jit/JITCall.cpp:
16465 * jit/JITInlineMethods.h:
16466 * wtf/Platform.h:
16467 Add switch settings to ENABLE(JIT), on PLATFORM(X86_64) (currently still disabled).
16468
16469 2008-12-17 Sam Weinig <sam@webkit.org>
16470
16471 Reviewed by Gavin Barraclough.
16472
16473 Add more CodeBlock statistics.
16474
16475 * bytecode/CodeBlock.cpp:
16476 (JSC::CodeBlock::dumpStatistics):
16477
16478 2008-12-17 Sam Weinig <sam@webkit.org>
16479
16480 Reviewed by Darin Adler.
16481
16482 Fix for https://bugs.webkit.org/show_bug.cgi?id=22897
16483 <rdar://problem/6428342>
16484 Look into feasibility of discarding bytecode after native codegen
16485
16486 Clear the bytecode Instruction vector at the end JIT generation.
16487
16488 Saves 4.8 MB on Membuster head.
16489
16490 * bytecode/CodeBlock.cpp:
16491 (JSC::CodeBlock::dump): Add logging for the case that someone tries
16492 to dump the instructions of a CodeBlock that has had its bytecode
16493 vector cleared.
16494 (JSC::CodeBlock::CodeBlock): Initialize the instructionCount
16495 (JSC::CodeBlock::handlerForBytecodeOffset): Use instructionCount instead
16496 of the size of the instruction vector in the assertion.
16497 (JSC::CodeBlock::lineNumberForBytecodeOffset): Ditto.
16498 (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
16499 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
16500 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Ditto.
16501 * bytecode/CodeBlock.h:
16502 (JSC::CodeBlock::setInstructionCount): Store the instruction vector size
16503 in debug builds for assertions.
16504 * bytecompiler/BytecodeGenerator.cpp:
16505 (JSC::BytecodeGenerator::generate):
16506 * jit/JIT.cpp:
16507 (JSC::JIT::privateCompile): Clear the bytecode vector unless we
16508 have compiled with Opcode sampling where we will continue to require it
16509
16510 2008-12-17 Cary Clark <caryclark@google.com>
16511
16512 Reviewed by Darin Adler.
16513 Landed by Adam Barth.
16514
16515 Add ENABLE_TEXT_CARET to permit the ANDROID platform
16516 to invalidate and draw the caret in a separate thread.
16517
16518 * wtf/Platform.h:
16519 Default ENABLE_TEXT_CARET to 1.
16520
16521 2008-12-17 Alexey Proskuryakov <ap@webkit.org>
16522
16523 Reviewed by Darin Adler.
16524
16525 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard, take two.
16526
16527 * API/JSContextRef.cpp: The previous patch that claimed to do this was making Tiger and
16528 Leopard always use unique context group instead.
16529
16530 2008-12-16 Sam Weinig <sam@webkit.org>
16531
16532 Reviewed by Geoffrey Garen.
16533
16534 Fix for https://bugs.webkit.org/show_bug.cgi?id=22838
16535 Remove dependency on the bytecode Instruction buffer in Interpreter::throwException
16536 Part of <rdar://problem/6428342>
16537
16538 * bytecode/CodeBlock.cpp:
16539 (JSC::CodeBlock::functionRegisterForBytecodeOffset): Added. Function to get
16540 a function Register index in a callFrame for a bytecode offset.
16541 (JSC::CodeBlock::shrinkToFit): Shrink m_getByIdExceptionInfo and m_functionRegisterInfos.
16542 * bytecode/CodeBlock.h:
16543 (JSC::FunctionRegisterInfo::FunctionRegisterInfo): Added.
16544 (JSC::CodeBlock::addFunctionRegisterInfo):
16545 * bytecompiler/BytecodeGenerator.cpp:
16546 (JSC::BytecodeGenerator::emitCall):
16547 * interpreter/Interpreter.cpp:
16548 (JSC::Interpreter::throwException): Use functionRegisterForBytecodeOffset in JIT
16549 mode.
16550
16551 2008-12-16 Sam Weinig <sam@webkit.org>
16552
16553 Reviewed by Gavin Barraclough.
16554
16555 Fix for https://bugs.webkit.org/show_bug.cgi?id=22837
16556 Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction
16557 Part of <rdar://problem/6428342>
16558
16559 * interpreter/CallFrame.h: Added comment regarding returnPC storing a void*.
16560 * interpreter/Interpreter.cpp:
16561 (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC
16562 being in the instruction stream for JIT, so we can remove the check.
16563 (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS
16564 as the call frame returnPC as it is only necessary for looking up when
16565 throwing an exception.
16566 * interpreter/RegisterFile.h:
16567 (JSC::RegisterFile::): Added comment regarding returnPC storing a void*.
16568 * jit/JIT.h: Remove ARG_instr4.
16569 * jit/JITCall.cpp:
16570 (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer.
16571
16572 2008-12-16 Darin Adler <darin@apple.com>
16573
16574 Reviewed and landed by Cameron Zwarich.
16575
16576 Preparatory work for fixing
16577
16578 Bug 22887: Make UString::Rep use RefCounted rather than implementing its own ref counting
16579 <https://bugs.webkit.org/show_bug.cgi?id=22887>
16580
16581 Change the various string translators used by Identifier:add() so that
16582 they never zero the ref count of a newly created UString::Rep.
16583
16584 * runtime/Identifier.cpp:
16585 (JSC::CStringTranslator::translate):
16586 (JSC::Identifier::add):
16587 (JSC::UCharBufferTranslator::translate):
16588
16589 2008-12-16 Gavin Barraclough <barraclough@apple.com>
16590
16591 Build fix for 'doze.
16592
16593 * assembler/AssemblerBuffer.h:
16594
16595 2008-12-16 Gavin Barraclough <barraclough@apple.com>
16596
16597 Reviewed by Cameron Zwarich.
16598
16599 Make the JIT compile on x86-64.
16600 This largely involves populting the missing calls in MacroAssembler.h.
16601 In addition some reinterpret_casts need removing from the JIT, and the
16602 repatching property access code will need to be fully compiled out for
16603 now. The changes in interpret.cpp are to reorder the functions so that
16604 the _generic forms come before all other property access methods, and
16605 then to place all property access methods other than the generic forms
16606 under control of the ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS macro.
16607
16608 No performance impact.
16609
16610 * assembler/AssemblerBuffer.h:
16611 (JSC::AssemblerBuffer::putInt64Unchecked):
16612 * assembler/MacroAssembler.h:
16613 (JSC::MacroAssembler::loadPtr):
16614 (JSC::MacroAssembler::load32):
16615 (JSC::MacroAssembler::storePtr):
16616 (JSC::MacroAssembler::storePtrWithRepatch):
16617 (JSC::MacroAssembler::store32):
16618 (JSC::MacroAssembler::poke):
16619 (JSC::MacroAssembler::move):
16620 (JSC::MacroAssembler::testImm64):
16621 (JSC::MacroAssembler::jePtr):
16622 (JSC::MacroAssembler::jnePtr):
16623 (JSC::MacroAssembler::jnzPtr):
16624 (JSC::MacroAssembler::jzPtr):
16625 * assembler/X86Assembler.h:
16626 (JSC::X86Assembler::):
16627 (JSC::X86Assembler::cmpq_rr):
16628 (JSC::X86Assembler::cmpq_rm):
16629 (JSC::X86Assembler::cmpq_im):
16630 (JSC::X86Assembler::testq_i32m):
16631 (JSC::X86Assembler::movl_mEAX):
16632 (JSC::X86Assembler::movl_i32r):
16633 (JSC::X86Assembler::movl_EAXm):
16634 (JSC::X86Assembler::movq_rm):
16635 (JSC::X86Assembler::movq_mEAX):
16636 (JSC::X86Assembler::movq_mr):
16637 (JSC::X86Assembler::movq_i64r):
16638 (JSC::X86Assembler::movl_mr):
16639 (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64):
16640 (JSC::X86Assembler::X86InstructionFormatter::immediate64):
16641 * interpreter/Interpreter.cpp:
16642 (JSC::Interpreter::cti_op_put_by_id_generic):
16643 (JSC::Interpreter::cti_op_get_by_id_generic):
16644 (JSC::Interpreter::cti_op_put_by_id):
16645 (JSC::Interpreter::cti_op_put_by_id_second):
16646 * jit/JIT.cpp:
16647 (JSC::JIT::privateCompileMainPass):
16648 (JSC::JIT::privateCompile):
16649 (JSC::JIT::privateCompileCTIMachineTrampolines):
16650 * jit/JITCall.cpp:
16651 (JSC::JIT::compileOpCallSetupArgs):
16652 (JSC::JIT::compileOpCall):
16653 * jit/JITPropertyAccess.cpp:
16654 (JSC::JIT::compileGetByIdHotPath):
16655 (JSC::JIT::compilePutByIdHotPath):
16656 * runtime/JSImmediate.h:
16657 (JSC::JSImmediate::makeInt):
16658
16659 2008-12-16 Cameron Zwarich <zwarich@apple.com>
16660
16661 Reviewed by Darin Adler.
16662
16663 Bug 22869: REGRESSION (r38407): http://news.cnet.com/8301-13579_3-9953533-37.html crashes
16664 <https://bugs.webkit.org/show_bug.cgi?id=22869>
16665 <rdar://problem/6402499>
16666
16667 Before r38407, Structure::m_nameInPrevious was ref'd due to it being
16668 stored in a PropertyMap. However, PropertyMaps are created lazily after
16669 r38407, so Structure::m_nameInPrevious is not necessarily ref'd while
16670 it is being used. Making it a RefPtr instead of a raw pointer fixes
16671 the problem.
16672
16673 Unfortunately, the crash in the bug is rather intermittent, and it is
16674 impossible to add an assertion in UString::Ref::ref() to catch this bug
16675 because some users of UString::Rep deliberately zero out the reference
16676 count. Therefore, there is no layout test accompanying this bug fix.
16677
16678 * runtime/Structure.cpp:
16679 (JSC::Structure::~Structure): Use get().
16680 (JSC::Structure::materializePropertyMap): Use get().
16681 (JSC::Structure::addPropertyTransitionToExistingStructure): Use get().
16682 (JSC::Structure::addPropertyTransition): Use get().
16683 * runtime/Structure.h: Make Structure::m_nameInPrevious a RefPtr instead
16684 of a raw pointer.
16685
16686 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
16687
16688 Not reviewed. Attempt to fix win build. No 'using namespace WTF' in this file, needs manual WTF:: prefix.
16689 Not sure why the build works as is here.
16690
16691 * runtime/MathObject.cpp:
16692 (JSC::mathProtoFuncRandom):
16693
16694 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
16695
16696 Reviewed by Darin Adler.
16697
16698 Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876
16699
16700 Unify random number generation in JavaScriptCore & WebCore, by introducing
16701 wtf/RandomNumber.h and moving wtf_random/wtf_random_init out of MathExtras.h.
16702
16703 wtf_random_init() has been renamed to initializeRandomNumberGenerator() and
16704 lives in it's own private header: wtf/RandomNumberSeed.h, only intended to
16705 be used from within JavaScriptCore.
16706
16707 wtf_random() has been renamed to randomNumber() and lives in a public header
16708 wtf/RandomNumber.h, usable from within JavaScriptCore & WebCore. It encapsulates
16709 the code taking care of initializing the random number generator (only when
16710 building without ENABLE(JSC_MULTIPLE_THREADS), otherwhise initializeThreading()
16711 already took care of that).
16712
16713 Functional change on darwin: Use random() instead of rand(), as it got a larger
16714 period (more randomness). HTMLFormElement already contains this implementation
16715 and I just moved it in randomNumber(), as special case for PLATFORM(DARWIN).
16716
16717 * GNUmakefile.am: Add RandomNumber.(cpp/h) / RandomNumberSeed.h.
16718 * JavaScriptCore.exp: Ditto.
16719 * JavaScriptCore.pri: Ditto.
16720 * JavaScriptCore.scons: Ditto.
16721 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
16722 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
16723 * JavaScriptCoreSources.bkl: Ditto.
16724 * runtime/MathObject.cpp: Use new WTF::randomNumber() functionality.
16725 (JSC::mathProtoFuncRandom):
16726 * wtf/MathExtras.h: Move wtf_random / wtf_random_init to new files.
16727 * wtf/RandomNumber.cpp: Added.
16728 (WTF::randomNumber):
16729 * wtf/RandomNumber.h: Added.
16730 * wtf/RandomNumberSeed.h: Added. Internal usage within JSC only.
16731 (WTF::initializeRandomNumberGenerator):
16732 * wtf/ThreadingGtk.cpp: Rename wtf_random_init() to initializeRandomNumberGenerator().
16733 (WTF::initializeThreading):
16734 * wtf/ThreadingPthreads.cpp: Ditto.
16735 (WTF::initializeThreading):
16736 * wtf/ThreadingQt.cpp: Ditto.
16737 (WTF::initializeThreading):
16738 * wtf/ThreadingWin.cpp: Ditto.
16739 (WTF::initializeThreading):
16740
16741 2008-12-16 Yael Aharon <yael.aharon@nokia.com>
16742
16743 Reviewed by Tor Arne Vestbø.
16744
16745 Qt/Win build fix
16746
16747 * JavaScriptCore.pri:
16748
16749 2008-12-15 Mark Rowe <mrowe@apple.com>
16750
16751 Reviewed by Cameron Zwarich.
16752
16753 Fix the build with GCC 4.0.
16754
16755 * Configurations/JavaScriptCore.xcconfig: GCC 4.0 appears to have a bug when compiling with -funwind-tables on,
16756 so don't use it with that compiler version.
16757
16758 2008-12-15 Mark Rowe <mrowe@apple.com>
16759
16760 Rubber-stamped by Cameron Zwarich.
16761
16762 <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard.
16763
16764 * Configurations/Base.xcconfig:
16765 * Configurations/DebugRelease.xcconfig:
16766
16767 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
16768
16769 Reviewed by Darin Adler.
16770
16771 Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard.
16772
16773 * API/JSContextRef.cpp: (JSGlobalContextCreate):
16774
16775 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
16776
16777 Reviewed by Darin Adler.
16778
16779 <rdar://problem/6445089> Mach ports leak from worker threads
16780
16781 * interpreter/Interpreter.cpp: (JSC::getCPUTime):
16782 Deallocate the thread self port.
16783
16784 2008-12-15 Gavin Barraclough <barraclough@apple.com>
16785
16786 Reviewed by Mark Rowe.
16787
16788 Construct stack frames in JIT code, so that backtracing can still work.
16789 <rdar://problem/6447870> JIT should play nice with attempts to take stack traces
16790
16791 * jit/JIT.cpp:
16792 (JSC::):
16793 (JSC::JIT::privateCompileMainPass):
16794
16795 2008-12-15 Mark Rowe <mrowe@apple.com>
16796
16797 Reviewed by Gavin Barraclough.
16798
16799 <rdar://problem/6402262> JavaScriptCore needs exception handling tables in order to get stack traces without frame pointers
16800
16801 * Configurations/JavaScriptCore.xcconfig:
16802
16803 2008-12-15 Gavin Barraclough <barraclough@apple.com>
16804
16805 Rubber stamped by Mark Rowe.
16806
16807 Revert r39226 / Bug 22818: Unify JIT callback argument access OS X / Windows
16808 This causes Acid3 failures – reverting for now & will revisit later.
16809 https://bugs.webkit.org/show_bug.cgi?id=22873
16810
16811 * interpreter/Interpreter.h:
16812 * jit/JIT.cpp:
16813 (JSC::JIT::privateCompileCTIMachineTrampolines):
16814 * jit/JIT.h:
16815 * jit/JITInlineMethods.h:
16816 (JSC::JIT::restoreArgumentReference):
16817 (JSC::JIT::restoreArgumentReferenceForTrampoline):
16818 (JSC::JIT::emitCTICall_internal):
16819 * jit/JITPropertyAccess.cpp:
16820 (JSC::JIT::privateCompilePutByIdTransition):
16821 * wtf/Platform.h:
16822
16823 2008-12-15 Darin Adler <darin@apple.com>
16824
16825 Reviewed by Sam Weinig.
16826
16827 - fix <rdar://problem/6427048> crash due to infinite recursion after setting window.__proto__ = window
16828
16829 Replaced toGlobalObject with the more generally useful unwrappedObject and used it to
16830 fix the cycle detection code in put(__proto__).
16831
16832 * JavaScriptCore.exp: Updated.
16833
16834 * runtime/JSGlobalObject.cpp: Removed toGlobalObject. We now use unwrappedObject instead.
16835 * runtime/JSGlobalObject.h:
16836 (JSC::JSGlobalObject::isGlobalObject): Ditto.
16837
16838 * runtime/JSGlobalObjectFunctions.cpp:
16839 (JSC::globalFuncEval): Use unwrappedObject and isGlobalObject here rather than toGlobalObject.
16840
16841 * runtime/JSObject.cpp:
16842 (JSC::JSObject::put): Rewrote prototype cycle checking loop. Use unwrappedObject in the loop now.
16843 (JSC::JSObject::unwrappedObject): Replaced toGlobalObject with this new function.
16844 * runtime/JSObject.h: More of the same.
16845
16846 2008-12-15 Steve Falkenburg <sfalken@apple.com>
16847
16848 Windows build fix.
16849
16850 Visual Studio requires visibility of forward declarations to match class declaration.
16851
16852 * assembler/X86Assembler.h:
16853
16854 2008-12-15 Gustavo Noronha Silva <kov@kov.eti.br>
16855
16856 Reviewed by Mark Rowe.
16857
16858 https://bugs.webkit.org/show_bug.cgi?id=22686
16859
16860 GTK+ build fix.
16861
16862 * GNUmakefile.am:
16863
16864 2008-12-15 Gavin Barraclough <barraclough@apple.com>
16865
16866 Reviewed by Geoff Garen.
16867
16868 Add support to X86Assembler emitting instructions that access all 16 registers on x86-64.
16869 Add a new formating class, that is reponsible for both emitting the opcode bytes and the
16870 ModRm bytes of an instruction in a single call; this can insert the REX byte as necessary
16871 before the opcode, but has access to the register numbers to build the REX.
16872
16873 * assembler/AssemblerBuffer.h:
16874 (JSC::AssemblerBuffer::isAligned):
16875 (JSC::AssemblerBuffer::data):
16876 * assembler/MacroAssembler.h:
16877 (JSC::MacroAssembler::addPtr):
16878 (JSC::MacroAssembler::add32):
16879 (JSC::MacroAssembler::and32):
16880 (JSC::MacroAssembler::or32):
16881 (JSC::MacroAssembler::sub32):
16882 (JSC::MacroAssembler::xor32):
16883 (JSC::MacroAssembler::loadPtr):
16884 (JSC::MacroAssembler::load32):
16885 (JSC::MacroAssembler::load16):
16886 (JSC::MacroAssembler::storePtr):
16887 (JSC::MacroAssembler::storePtrWithRepatch):
16888 (JSC::MacroAssembler::store32):
16889 (JSC::MacroAssembler::pop):
16890 (JSC::MacroAssembler::push):
16891 (JSC::MacroAssembler::compareImm32ForBranch):
16892 (JSC::MacroAssembler::compareImm32ForBranchEquality):
16893 (JSC::MacroAssembler::testImm32):
16894 (JSC::MacroAssembler::jae32):
16895 (JSC::MacroAssembler::jb32):
16896 (JSC::MacroAssembler::je16):
16897 (JSC::MacroAssembler::jg32):
16898 (JSC::MacroAssembler::jnePtr):
16899 (JSC::MacroAssembler::jne32):
16900 (JSC::MacroAssembler::jump):
16901 * assembler/X86Assembler.h:
16902 (JSC::X86::):
16903 (JSC::X86Assembler::):
16904 (JSC::X86Assembler::size):
16905 (JSC::X86Assembler::push_r):
16906 (JSC::X86Assembler::pop_r):
16907 (JSC::X86Assembler::push_i32):
16908 (JSC::X86Assembler::push_m):
16909 (JSC::X86Assembler::pop_m):
16910 (JSC::X86Assembler::addl_rr):
16911 (JSC::X86Assembler::addl_mr):
16912 (JSC::X86Assembler::addl_ir):
16913 (JSC::X86Assembler::addq_ir):
16914 (JSC::X86Assembler::addl_im):
16915 (JSC::X86Assembler::andl_rr):
16916 (JSC::X86Assembler::andl_ir):
16917 (JSC::X86Assembler::orl_rr):
16918 (JSC::X86Assembler::orl_mr):
16919 (JSC::X86Assembler::orl_ir):
16920 (JSC::X86Assembler::subl_rr):
16921 (JSC::X86Assembler::subl_mr):
16922 (JSC::X86Assembler::subl_ir):
16923 (JSC::X86Assembler::subl_im):
16924 (JSC::X86Assembler::xorl_rr):
16925 (JSC::X86Assembler::xorl_ir):
16926 (JSC::X86Assembler::sarl_i8r):
16927 (JSC::X86Assembler::sarl_CLr):
16928 (JSC::X86Assembler::shll_i8r):
16929 (JSC::X86Assembler::shll_CLr):
16930 (JSC::X86Assembler::imull_rr):
16931 (JSC::X86Assembler::imull_i32r):
16932 (JSC::X86Assembler::idivl_r):
16933 (JSC::X86Assembler::cmpl_rr):
16934 (JSC::X86Assembler::cmpl_rm):
16935 (JSC::X86Assembler::cmpl_mr):
16936 (JSC::X86Assembler::cmpl_ir):
16937 (JSC::X86Assembler::cmpl_ir_force32):
16938 (JSC::X86Assembler::cmpl_im):
16939 (JSC::X86Assembler::cmpl_im_force32):
16940 (JSC::X86Assembler::cmpw_rm):
16941 (JSC::X86Assembler::testl_rr):
16942 (JSC::X86Assembler::testl_i32r):
16943 (JSC::X86Assembler::testl_i32m):
16944 (JSC::X86Assembler::testq_rr):
16945 (JSC::X86Assembler::testq_i32r):
16946 (JSC::X86Assembler::testb_i8r):
16947 (JSC::X86Assembler::sete_r):
16948 (JSC::X86Assembler::setz_r):
16949 (JSC::X86Assembler::setne_r):
16950 (JSC::X86Assembler::setnz_r):
16951 (JSC::X86Assembler::cdq):
16952 (JSC::X86Assembler::xchgl_rr):
16953 (JSC::X86Assembler::movl_rr):
16954 (JSC::X86Assembler::movl_rm):
16955 (JSC::X86Assembler::movl_mr):
16956 (JSC::X86Assembler::movl_i32r):
16957 (JSC::X86Assembler::movl_i32m):
16958 (JSC::X86Assembler::movq_rr):
16959 (JSC::X86Assembler::movq_rm):
16960 (JSC::X86Assembler::movq_mr):
16961 (JSC::X86Assembler::movzwl_mr):
16962 (JSC::X86Assembler::movzbl_rr):
16963 (JSC::X86Assembler::leal_mr):
16964 (JSC::X86Assembler::call):
16965 (JSC::X86Assembler::jmp):
16966 (JSC::X86Assembler::jmp_r):
16967 (JSC::X86Assembler::jmp_m):
16968 (JSC::X86Assembler::jne):
16969 (JSC::X86Assembler::jnz):
16970 (JSC::X86Assembler::je):
16971 (JSC::X86Assembler::jl):
16972 (JSC::X86Assembler::jb):
16973 (JSC::X86Assembler::jle):
16974 (JSC::X86Assembler::jbe):
16975 (JSC::X86Assembler::jge):
16976 (JSC::X86Assembler::jg):
16977 (JSC::X86Assembler::ja):
16978 (JSC::X86Assembler::jae):
16979 (JSC::X86Assembler::jo):
16980 (JSC::X86Assembler::jp):
16981 (JSC::X86Assembler::js):
16982 (JSC::X86Assembler::addsd_rr):
16983 (JSC::X86Assembler::addsd_mr):
16984 (JSC::X86Assembler::cvtsi2sd_rr):
16985 (JSC::X86Assembler::cvttsd2si_rr):
16986 (JSC::X86Assembler::movd_rr):
16987 (JSC::X86Assembler::movsd_rm):
16988 (JSC::X86Assembler::movsd_mr):
16989 (JSC::X86Assembler::mulsd_rr):
16990 (JSC::X86Assembler::mulsd_mr):
16991 (JSC::X86Assembler::pextrw_irr):
16992 (JSC::X86Assembler::subsd_rr):
16993 (JSC::X86Assembler::subsd_mr):
16994 (JSC::X86Assembler::ucomis_rr):
16995 (JSC::X86Assembler::int3):
16996 (JSC::X86Assembler::ret):
16997 (JSC::X86Assembler::predictNotTaken):
16998 (JSC::X86Assembler::label):
16999 (JSC::X86Assembler::align):
17000 (JSC::X86Assembler::link):
17001 (JSC::X86Assembler::executableCopy):
17002 (JSC::X86Assembler::X86InstructionFormater::prefix):
17003 (JSC::X86Assembler::X86InstructionFormater::oneByteOp):
17004 (JSC::X86Assembler::X86InstructionFormater::twoByteOp):
17005 (JSC::X86Assembler::X86InstructionFormater::oneByteOp64):
17006 (JSC::X86Assembler::X86InstructionFormater::oneByteOp8):
17007 (JSC::X86Assembler::X86InstructionFormater::twoByteOp8):
17008 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate8):
17009 (JSC::X86Assembler::X86InstructionFormater::instructionImmediate32):
17010 (JSC::X86Assembler::X86InstructionFormater::instructionRel32):
17011 (JSC::X86Assembler::X86InstructionFormater::size):
17012 (JSC::X86Assembler::X86InstructionFormater::isAligned):
17013 (JSC::X86Assembler::X86InstructionFormater::data):
17014 (JSC::X86Assembler::X86InstructionFormater::executableCopy):
17015 (JSC::X86Assembler::X86InstructionFormater::registerModRM):
17016 (JSC::X86Assembler::X86InstructionFormater::memoryModRM):
17017 * jit/JIT.cpp:
17018 (JSC::JIT::privateCompileMainPass):
17019 (JSC::JIT::privateCompile):
17020 (JSC::JIT::privateCompileCTIMachineTrampolines):
17021 * jit/JITArithmetic.cpp:
17022 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
17023 (JSC::JIT::compileBinaryArithOp):
17024 * jit/JITCall.cpp:
17025 (JSC::JIT::compileOpCall):
17026 (JSC::JIT::compileOpCallSlowCase):
17027 * jit/JITPropertyAccess.cpp:
17028 (JSC::JIT::compileGetByIdHotPath):
17029 (JSC::JIT::compilePutByIdHotPath):
17030 (JSC::JIT::privateCompilePutByIdTransition):
17031 (JSC::JIT::privateCompilePatchGetArrayLength):
17032 (JSC::JIT::privateCompileGetByIdProto):
17033 (JSC::JIT::privateCompileGetByIdProtoList):
17034 (JSC::JIT::privateCompileGetByIdChainList):
17035 (JSC::JIT::privateCompileGetByIdChain):
17036
17037 2008-12-15 Darin Adler <darin@apple.com>
17038
17039 * interpreter/RegisterFile.h: Tweak include formatting.
17040
17041 2008-12-15 Holger Hans Peter Freyther <zecke@selfish.org>
17042
17043 Build fix for Gtk+.
17044
17045 * interpreter/RegisterFile.h: Include stdio.h for fprintf
17046
17047 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
17048
17049 Reviewed by Oliver Hunt.
17050
17051 <rdar://problem/6444455> Worker Thread crash running multiple workers for a moderate amount of time
17052
17053 * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile):
17054 Improve error handling: if mmap fails, crash immediately, and print out the reason.
17055
17056 2008-12-13 Gavin Barraclough <barraclough@apple.com>
17057
17058 Reviewed by Cameron Zwarich.
17059
17060 Re-enable WREC on 64-bit.
17061 Implements one of the MacroAssembler::jnzPtr methods, previously only implemented for 32-bit x86.
17062
17063 https://bugs.webkit.org/show_bug.cgi?id=22849
17064
17065 * assembler/MacroAssembler.h:
17066 (JSC::MacroAssembler::testImm64):
17067 (JSC::MacroAssembler::jnzPtr):
17068 * assembler/X86Assembler.h:
17069 (JSC::X86Assembler::testq_i32r):
17070 (JSC::X86Assembler::testq_rr):
17071 * wtf/Platform.h:
17072
17073 2008-12-13 Gavin Barraclough <barraclough@apple.com>
17074
17075 Fix PPC builds.
17076
17077 * assembler/MacroAssembler.h:
17078
17079 2008-12-13 Gavin Barraclough <barraclough@apple.com>
17080
17081 Build fix only, no review.
17082
17083 * bytecode/CodeBlock.h:
17084
17085 2008-12-13 Gavin Barraclough <barraclough@apple.com>
17086
17087 Reviewed by Cameron Zwarich.
17088
17089 Port the remainder of the JIT, bar calling convention related code, and code
17090 implementing optimizations which can be disabled, to use the MacroAssembler.
17091
17092 * assembler/MacroAssembler.h:
17093 (JSC::MacroAssembler::DataLabelPtr::DataLabelPtr):
17094 (JSC::MacroAssembler::RepatchBuffer::RepatchBuffer):
17095 (JSC::MacroAssembler::RepatchBuffer::link):
17096 (JSC::MacroAssembler::RepatchBuffer::addressOf):
17097 (JSC::MacroAssembler::RepatchBuffer::setPtr):
17098 (JSC::MacroAssembler::addPtr):
17099 (JSC::MacroAssembler::lshift32):
17100 (JSC::MacroAssembler::mod32):
17101 (JSC::MacroAssembler::rshift32):
17102 (JSC::MacroAssembler::storePtrWithRepatch):
17103 (JSC::MacroAssembler::jnzPtr):
17104 (JSC::MacroAssembler::jzPtr):
17105 (JSC::MacroAssembler::jump):
17106 (JSC::MacroAssembler::label):
17107 * assembler/X86Assembler.h:
17108 (JSC::X86Assembler::):
17109 (JSC::X86Assembler::xchgl_rr):
17110 (JSC::X86Assembler::jmp_m):
17111 (JSC::X86Assembler::repatchAddress):
17112 (JSC::X86Assembler::getRelocatedAddress):
17113 * bytecode/CodeBlock.cpp:
17114 (JSC::CodeBlock::CodeBlock):
17115 * bytecode/CodeBlock.h:
17116 (JSC::JITCodeRef::JITCodeRef):
17117 (JSC::CodeBlock::setJITCode):
17118 (JSC::CodeBlock::jitCode):
17119 (JSC::CodeBlock::executablePool):
17120 * jit/JIT.cpp:
17121 (JSC::JIT::privateCompileMainPass):
17122 (JSC::JIT::privateCompileLinkPass):
17123 (JSC::JIT::privateCompile):
17124 (JSC::JIT::privateCompileCTIMachineTrampolines):
17125 * jit/JIT.h:
17126 (JSC::CallRecord::CallRecord):
17127 (JSC::JumpTable::JumpTable):
17128 (JSC::JIT::emitCTICall):
17129 (JSC::JIT::JSRInfo::JSRInfo):
17130 * jit/JITArithmetic.cpp:
17131 * jit/JITCall.cpp:
17132 * jit/JITInlineMethods.h:
17133 (JSC::JIT::emitNakedCall):
17134 (JSC::JIT::emitCTICall_internal):
17135 (JSC::JIT::checkStructure):
17136 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
17137 (JSC::JIT::addSlowCase):
17138 (JSC::JIT::addJump):
17139 (JSC::JIT::emitJumpSlowToHot):
17140 * jit/JITPropertyAccess.cpp:
17141 (JSC::JIT::privateCompileGetByIdChainList):
17142 (JSC::JIT::privateCompileGetByIdChain):
17143
17144 2008-12-12 Cameron Zwarich <zwarich@apple.com>
17145
17146 Reviewed by Sam Weinig.
17147
17148 Fix the failures of the following layout tests, which regressed in
17149 r39255:
17150
17151 fast/dom/StyleSheet/ownerNode-lifetime-2.html
17152 fast/xsl/transform-xhr-doc.xhtml
17153
17154 The binary search in CodeBlock::getByIdExceptionInfoForBytecodeOffset()
17155 doesn't guarantee that it actually finds a match, so add an explicit check
17156 for this.
17157
17158 * bytecode/CodeBlock.cpp:
17159 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
17160
17161 2008-12-12 Gavin Barraclough <barraclough@apple.com>
17162
17163 Reviewed by Cameron Zwarich.
17164
17165 Replace emitPutCallArg methods with emitPutJITStubArg methods. Primarily to make the argument numbering
17166 more sensible (1-based incrementing by 1, rather than 0-based incrementing by 4). The CTI name also seems
17167 to be being deprecated from the code generally.
17168
17169 * jit/JIT.cpp:
17170 (JSC::JIT::privateCompileMainPass):
17171 (JSC::JIT::privateCompileSlowCases):
17172 (JSC::JIT::privateCompileCTIMachineTrampolines):
17173 * jit/JIT.h:
17174 * jit/JITArithmetic.cpp:
17175 (JSC::JIT::compileBinaryArithOp):
17176 (JSC::JIT::compileBinaryArithOpSlowCase):
17177 * jit/JITCall.cpp:
17178 (JSC::JIT::compileOpCallSetupArgs):
17179 (JSC::JIT::compileOpCallEvalSetupArgs):
17180 (JSC::JIT::compileOpConstructSetupArgs):
17181 (JSC::JIT::compileOpCall):
17182 * jit/JITInlineMethods.h:
17183 (JSC::JIT::emitPutJITStubArg):
17184 (JSC::JIT::emitPutJITStubArgConstant):
17185 (JSC::JIT::emitGetJITStubArg):
17186 (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
17187 * jit/JITPropertyAccess.cpp:
17188 (JSC::JIT::compileGetByIdHotPath):
17189 (JSC::JIT::compilePutByIdHotPath):
17190 (JSC::JIT::compileGetByIdSlowCase):
17191 (JSC::JIT::compilePutByIdSlowCase):
17192
17193 2008-12-12 Gavin Barraclough <barraclough@apple.com>
17194
17195 Fix windows builds.
17196
17197 * jit/JIT.cpp:
17198 (JSC::JIT::privateCompileMainPass):
17199 (JSC::JIT::privateCompileSlowCases):
17200 (JSC::JIT::privateCompile):
17201
17202 2008-12-12 Gavin Barraclough <barraclough@apple.com>
17203
17204 Reviewed by Geoff Garen.
17205
17206 Remove loop counter 'i' from the JIT generation passes, replace with a member m_bytecodeIndex.
17207
17208 No impact on performance.
17209
17210 * jit/JIT.cpp:
17211 (JSC::JIT::compileOpStrictEq):
17212 (JSC::JIT::emitSlowScriptCheck):
17213 (JSC::JIT::privateCompileMainPass):
17214 (JSC::JIT::privateCompileSlowCases):
17215 (JSC::JIT::privateCompile):
17216 * jit/JIT.h:
17217 (JSC::CallRecord::CallRecord):
17218 (JSC::JmpTable::JmpTable):
17219 (JSC::JIT::emitCTICall):
17220 * jit/JITArithmetic.cpp:
17221 (JSC::JIT::compileBinaryArithOp):
17222 (JSC::JIT::compileBinaryArithOpSlowCase):
17223 * jit/JITCall.cpp:
17224 (JSC::JIT::compileOpCall):
17225 (JSC::JIT::compileOpCallSlowCase):
17226 * jit/JITInlineMethods.h:
17227 (JSC::JIT::emitGetVirtualRegister):
17228 (JSC::JIT::emitGetVirtualRegisters):
17229 (JSC::JIT::emitNakedCall):
17230 (JSC::JIT::emitCTICall_internal):
17231 (JSC::JIT::emitJumpSlowCaseIfJSCell):
17232 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
17233 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
17234 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
17235 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
17236 (JSC::JIT::addSlowCase):
17237 (JSC::JIT::addJump):
17238 (JSC::JIT::emitJumpSlowToHot):
17239 * jit/JITPropertyAccess.cpp:
17240 (JSC::JIT::compileGetByIdHotPath):
17241 (JSC::JIT::compileGetByIdSlowCase):
17242 (JSC::JIT::compilePutByIdHotPath):
17243 (JSC::JIT::compilePutByIdSlowCase):
17244
17245 2008-12-12 Sam Weinig <sam@webkit.org>
17246
17247 Reviewed by Cameron Zwarich.
17248
17249 <rdar://problem/6428342> Look into feasibility of discarding bytecode after native codegen
17250
17251 Move more JIT functionality to using offsets into the Instruction buffer
17252 instead of raw pointers. Two to go!
17253
17254 * interpreter/Interpreter.cpp:
17255 (JSC::bytecodeOffsetForPC): Rename from vPCForPC.
17256 (JSC::Interpreter::resolve): Pass offset to exception helper.
17257 (JSC::Interpreter::resolveSkip): Ditto.
17258 (JSC::Interpreter::resolveGlobal): Ditto.
17259 (JSC::Interpreter::resolveBaseAndProperty): Ditto.
17260 (JSC::Interpreter::resolveBaseAndFunc): Ditto.
17261 (JSC::isNotObject): Ditto.
17262 (JSC::Interpreter::unwindCallFrame): Call bytecodeOffsetForPC.
17263 (JSC::Interpreter::throwException): Use offsets instead of vPCs.
17264 (JSC::Interpreter::privateExecute): Pass offset to exception helper.
17265 (JSC::Interpreter::retrieveLastCaller): Ditto.
17266 (JSC::Interpreter::cti_op_instanceof): Ditto.
17267 (JSC::Interpreter::cti_op_call_NotJSFunction): Ditto.
17268 (JSC::Interpreter::cti_op_resolve): Pass offset to exception helper.
17269 (JSC::Interpreter::cti_op_construct_NotJSConstruct): Ditto.
17270 (JSC::Interpreter::cti_op_resolve_func): Ditto.
17271 (JSC::Interpreter::cti_op_resolve_skip): Ditto.
17272 (JSC::Interpreter::cti_op_resolve_global): Ditto.
17273 (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
17274 (JSC::Interpreter::cti_op_throw): Ditto.
17275 (JSC::Interpreter::cti_op_in): Ditto.
17276 (JSC::Interpreter::cti_vm_throw): Ditto.
17277 * interpreter/Interpreter.h:
17278
17279 * jit/JIT.cpp:
17280 (JSC::JIT::privateCompileMainPass): Don't pass unnecessary vPC to stub.
17281 * jit/JIT.h: Remove ARG_instr1 - ARG_instr3 and ARG_instr5 - ARG_instr6.
17282 * jit/JITCall.cpp:
17283 (JSC::JIT::compileOpCallEvalSetupArgs): Don't pass unnecessary vPC to stub..
17284 (JSC::JIT::compileOpConstructSetupArgs): Ditto.
17285
17286 * runtime/ExceptionHelpers.cpp:
17287 (JSC::createUndefinedVariableError): Take an offset instead of vPC.
17288 (JSC::createInvalidParamError): Ditto.
17289 (JSC::createNotAConstructorError): Ditto.
17290 (JSC::createNotAFunctionError): Ditto.
17291 (JSC::createNotAnObjectError): Ditto.
17292 * runtime/ExceptionHelpers.h:
17293
17294 2008-12-12 Cameron Zwarich <zwarich@apple.com>
17295
17296 Reviewed by Oliver Hunt.
17297
17298 Bug 22835: Crash during bytecode generation when comparing to null
17299 <https://bugs.webkit.org/show_bug.cgi?id=22835>
17300 <rdar://problem/6286749>
17301
17302 Change the special cases in bytecode generation for comparison to null
17303 to use tempDestination().
17304
17305 * parser/Nodes.cpp:
17306 (JSC::BinaryOpNode::emitBytecode):
17307 (JSC::EqualNode::emitBytecode):
17308
17309 2008-12-12 Gavin Barraclough <barraclough@apple.com>
17310
17311 Reviewed by Geoff Garen.
17312
17313 Move slow-cases of JIT code generation over to the MacroAssembler interface.
17314
17315 * assembler/MacroAssembler.h:
17316 (JSC::MacroAssembler::Label::Label):
17317 (JSC::MacroAssembler::jae32):
17318 (JSC::MacroAssembler::jg32):
17319 (JSC::MacroAssembler::jzPtr):
17320 * jit/JIT.cpp:
17321 (JSC::JIT::privateCompileSlowCases):
17322 (JSC::JIT::privateCompile):
17323 (JSC::JIT::emitGetVariableObjectRegister):
17324 (JSC::JIT::emitPutVariableObjectRegister):
17325 * jit/JIT.h:
17326 (JSC::SlowCaseEntry::SlowCaseEntry):
17327 (JSC::JIT::getSlowCase):
17328 (JSC::JIT::linkSlowCase):
17329 * jit/JITArithmetic.cpp:
17330 (JSC::JIT::compileBinaryArithOpSlowCase):
17331 * jit/JITCall.cpp:
17332 (JSC::JIT::compileOpCallInitializeCallFrame):
17333 (JSC::JIT::compileOpCall):
17334 (JSC::JIT::compileOpCallSlowCase):
17335 * jit/JITInlineMethods.h:
17336 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
17337 (JSC::JIT::linkSlowCaseIfNotJSCell):
17338 * jit/JITPropertyAccess.cpp:
17339 (JSC::JIT::compileGetByIdHotPath):
17340 (JSC::JIT::compilePutByIdHotPath):
17341 (JSC::JIT::compileGetByIdSlowCase):
17342 (JSC::JIT::compilePutByIdSlowCase):
17343
17344 2008-12-12 Cameron Zwarich <zwarich@apple.com>
17345
17346 Reviewed by Sam Weinig.
17347
17348 Bug 22828: Do not inspect bytecode instruction stream for op_get_by_id exception information
17349 <https://bugs.webkit.org/show_bug.cgi?id=22828>
17350
17351 In order to remove the bytecode instruction stream after generating
17352 native code, all inspection of bytecode instructions at runtime must
17353 be removed. One particular instance of this is the special handling of
17354 exceptions thrown by the op_get_by_id emitted directly before an
17355 op_construct or an op_instanceof. This patch moves that information to
17356 an auxiliary data structure in CodeBlock.
17357
17358 * bytecode/CodeBlock.cpp:
17359 (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
17360 * bytecode/CodeBlock.h:
17361 (JSC::CodeBlock::addGetByIdExceptionInfo):
17362 * bytecompiler/BytecodeGenerator.cpp:
17363 (JSC::BytecodeGenerator::emitConstruct):
17364 * bytecompiler/BytecodeGenerator.h:
17365 (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
17366 * parser/Nodes.cpp:
17367 (JSC::InstanceOfNode::emitBytecode):
17368 * runtime/ExceptionHelpers.cpp:
17369 (JSC::createNotAnObjectError):
17370
17371 2008-12-12 Sam Weinig <sam@webkit.org>
17372
17373 Reviewed by Geoffrey Garen.
17374
17375 Change exception information accessors to take offsets into the bytecode
17376 instruction buffer instead of pointers so that they can work even even
17377 if the bytecode buffer is purged.
17378
17379 * bytecode/CodeBlock.cpp:
17380 (JSC::instructionOffsetForNth):
17381 (JSC::CodeBlock::handlerForBytecodeOffset):
17382 (JSC::CodeBlock::lineNumberForBytecodeOffset):
17383 (JSC::CodeBlock::expressionRangeForBytecodeOffset):
17384 * bytecode/CodeBlock.h:
17385 * bytecode/SamplingTool.cpp:
17386 (JSC::SamplingTool::dump):
17387 * interpreter/Interpreter.cpp:
17388 (JSC::Interpreter::throwException):
17389 (JSC::Interpreter::privateExecute):
17390 (JSC::Interpreter::retrieveLastCaller):
17391 * jit/JIT.cpp:
17392 (JSC::JIT::privateCompileMainPass):
17393 * runtime/ExceptionHelpers.cpp:
17394 (JSC::createUndefinedVariableError):
17395 (JSC::createInvalidParamError):
17396 (JSC::createNotAConstructorError):
17397 (JSC::createNotAFunctionError):
17398 (JSC::createNotAnObjectError):
17399
17400 2008-12-12 Geoffrey Garen <ggaren@apple.com>
17401
17402 Reviewed by Cameron Zwarich.
17403
17404 Tiny bit of refactoring in quantifier generation.
17405
17406 * wrec/WRECGenerator.cpp:
17407 (JSC::WREC::Generator::generateNonGreedyQuantifier):
17408 (JSC::WREC::Generator::generateGreedyQuantifier):
17409
17410 2008-12-11 Sam Weinig <sam@webkit.org>
17411
17412 Reviewed by Geoffrey Garen.
17413
17414 Remove dependancy on having the Instruction buffer in order to
17415 deref Structures used for property access and global resolves.
17416 Instead, we put references to the necessary Structures in auxiliary
17417 data structures on the CodeBlock. This is not an ideal solution,
17418 as we still pay for having the Structures in two places and we
17419 would like to eventually just hold on to offsets into the machine
17420 code buffer.
17421
17422 - Also removes CodeBlock bloat in non-JIT by #ifdefing the JIT
17423 only data structures.
17424
17425 * GNUmakefile.am:
17426 * JavaScriptCore.pri:
17427 * JavaScriptCore.scons:
17428 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
17429 * JavaScriptCore.xcodeproj/project.pbxproj:
17430 * JavaScriptCoreSources.bkl:
17431 * bytecode/CodeBlock.cpp:
17432 (JSC::isGlobalResolve):
17433 (JSC::isPropertyAccess):
17434 (JSC::instructionOffsetForNth):
17435 (JSC::printGlobalResolveInfo):
17436 (JSC::printStructureStubInfo):
17437 (JSC::CodeBlock::printStructures):
17438 (JSC::CodeBlock::dump):
17439 (JSC::CodeBlock::~CodeBlock):
17440 (JSC::CodeBlock::shrinkToFit):
17441 * bytecode/CodeBlock.h:
17442 (JSC::GlobalResolveInfo::GlobalResolveInfo):
17443 (JSC::getNativePC):
17444 (JSC::CodeBlock::instructions):
17445 (JSC::CodeBlock::getStubInfo):
17446 (JSC::CodeBlock::getBytecodeIndex):
17447 (JSC::CodeBlock::addPropertyAccessInstruction):
17448 (JSC::CodeBlock::addGlobalResolveInstruction):
17449 (JSC::CodeBlock::numberOfStructureStubInfos):
17450 (JSC::CodeBlock::addStructureStubInfo):
17451 (JSC::CodeBlock::structureStubInfo):
17452 (JSC::CodeBlock::addGlobalResolveInfo):
17453 (JSC::CodeBlock::globalResolveInfo):
17454 (JSC::CodeBlock::numberOfCallLinkInfos):
17455 (JSC::CodeBlock::addCallLinkInfo):
17456 (JSC::CodeBlock::callLinkInfo):
17457 * bytecode/Instruction.h:
17458 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
17459 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
17460 * bytecode/Opcode.h:
17461 (JSC::):
17462 * bytecode/StructureStubInfo.cpp: Copied from bytecode/CodeBlock.cpp.
17463 (JSC::StructureStubInfo::deref):
17464 * bytecode/StructureStubInfo.h: Copied from bytecode/CodeBlock.h.
17465 (JSC::StructureStubInfo::StructureStubInfo):
17466 (JSC::StructureStubInfo::initGetByIdSelf):
17467 (JSC::StructureStubInfo::initGetByIdProto):
17468 (JSC::StructureStubInfo::initGetByIdChain):
17469 (JSC::StructureStubInfo::initGetByIdSelfList):
17470 (JSC::StructureStubInfo::initGetByIdProtoList):
17471 (JSC::StructureStubInfo::initPutByIdTransition):
17472 (JSC::StructureStubInfo::initPutByIdReplace):
17473 (JSC::StructureStubInfo::):
17474 * bytecompiler/BytecodeGenerator.cpp:
17475 (JSC::BytecodeGenerator::emitResolve):
17476 (JSC::BytecodeGenerator::emitGetById):
17477 (JSC::BytecodeGenerator::emitPutById):
17478 (JSC::BytecodeGenerator::emitCall):
17479 (JSC::BytecodeGenerator::emitConstruct):
17480 (JSC::BytecodeGenerator::emitCatch):
17481 * interpreter/Interpreter.cpp:
17482 (JSC::Interpreter::tryCTICachePutByID):
17483 (JSC::Interpreter::tryCTICacheGetByID):
17484 (JSC::Interpreter::cti_op_get_by_id_self_fail):
17485 (JSC::getPolymorphicAccessStructureListSlot):
17486 (JSC::Interpreter::cti_op_get_by_id_proto_list):
17487 (JSC::Interpreter::cti_op_resolve_global):
17488 * jit/JIT.cpp:
17489 (JSC::JIT::JIT):
17490 (JSC::JIT::privateCompileMainPass):
17491 (JSC::JIT::privateCompileSlowCases):
17492 (JSC::JIT::privateCompile):
17493 * jit/JITPropertyAccess.cpp:
17494 (JSC::JIT::compileGetByIdHotPath):
17495 (JSC::JIT::compilePutByIdHotPath):
17496 (JSC::JIT::compileGetByIdSlowCase):
17497 (JSC::JIT::compilePutByIdSlowCase):
17498 (JSC::JIT::privateCompileGetByIdSelfList):
17499 (JSC::JIT::privateCompileGetByIdProtoList):
17500 (JSC::JIT::privateCompileGetByIdChainList):
17501
17502 2008-12-11 Gavin Barraclough <barraclough@apple.com>
17503
17504 Reviewed by Oliver Hunt.
17505
17506 Remove CTI_ARGUMENTS mode, use va_start implementation on Windows,
17507 unifying JIT callback (cti_*) argument access on OS X & Windows
17508
17509 No performance impact.
17510
17511 * interpreter/Interpreter.h:
17512 * jit/JIT.cpp:
17513 (JSC::JIT::privateCompileCTIMachineTrampolines):
17514 * jit/JIT.h:
17515 * jit/JITInlineMethods.h:
17516 (JSC::JIT::emitCTICall):
17517 * jit/JITPropertyAccess.cpp:
17518 (JSC::JIT::privateCompilePutByIdTransition):
17519 * wtf/Platform.h:
17520
17521 2008-12-11 Holger Freyther <zecke@selfish.org>
17522
17523 Reviewed by Simon Hausmann.
17524
17525 https://bugs.webkit.org/show_bug.cgi?id=20953
17526
17527 For Qt it is not pratical to have a FontCache and GlyphPageTreeNode
17528 implementation. This is one of the reasons why the Qt port is currently not
17529 using WebCore/platform/graphics/Font.cpp. By allowing to not use
17530 the simple/fast-path the Qt port will be able to use it.
17531
17532 Introduce USE(FONT_FAST_PATH) and define it for every port but the
17533 Qt one.
17534
17535 * wtf/Platform.h: Enable USE(FONT_FAST_PATH)
17536
17537 2008-12-11 Gabor Loki <loki@inf.u-szeged.hu>
17538
17539 Reviewed by Darin Adler and landed by Holger Freyther.
17540
17541 <https://bugs.webkit.org/show_bug.cgi?id=22648>
17542 Fix threading on Qt-port and Gtk-port for Sampling tool.
17543
17544 * wtf/ThreadingGtk.cpp:
17545 (WTF::waitForThreadCompletion):
17546 * wtf/ThreadingQt.cpp:
17547 (WTF::waitForThreadCompletion):
17548
17549 2008-12-10 Cameron Zwarich <zwarich@apple.com>
17550
17551 Reviewed by Oliver Hunt.
17552
17553 Bug 22734: Debugger crashes when stepping into a function call in a return statement
17554 <https://bugs.webkit.org/show_bug.cgi?id=22734>
17555 <rdar://problem/6426796>
17556
17557 * bytecompiler/BytecodeGenerator.cpp:
17558 (JSC::BytecodeGenerator::BytecodeGenerator): The DebuggerCallFrame uses
17559 the 'this' value stored in a callFrame, so op_convert_this should be
17560 emitted at the beginning of a function body when generating bytecode
17561 with debug hooks.
17562 * debugger/DebuggerCallFrame.cpp:
17563 (JSC::DebuggerCallFrame::thisObject): The assertion inherent in the call
17564 to asObject() here is valid, because any 'this' value should have been
17565 converted to a JSObject*.
17566
17567 2008-12-10 Gavin Barraclough <barraclough@apple.com>
17568
17569 Reviewed by Geoff Garen.
17570
17571 Port more of the JIT to use the MacroAssembler interface.
17572
17573 Everything in the main pass, bar a few corner cases (operations with required
17574 registers, or calling convention code). Slightly refactors array creation,
17575 moving the offset calculation into the callFrame into C code (reducing code
17576 planted).
17577
17578 Overall this appears to be a 1% win on v8-tests, due to the smaller immediates
17579 being planted (in jfalse in particular).
17580
17581 * interpreter/Interpreter.cpp:
17582 (JSC::Interpreter::cti_op_new_array):
17583 * jit/JIT.cpp:
17584 (JSC::JIT::privateCompileMainPass):
17585 (JSC::JIT::privateCompileSlowCases):
17586 * jit/JIT.h:
17587 * wrec/WRECGenerator.cpp:
17588 (JSC::WREC::Generator::generateEnter):
17589
17590 2008-12-10 Sam Weinig <sam@webkit.org>
17591
17592 Fix non-JIT builds.
17593
17594 * bytecode/CodeBlock.h:
17595
17596 2008-12-10 Sam Weinig <sam@webkit.org>
17597
17598 Reviewed by Geoffrey Garen.
17599
17600 <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
17601
17602 Step 2:
17603
17604 Convert the return address table from a HashMap to a sorted Vector. This
17605 reduces the size of the data structure by ~4.5MB on Membuster head.
17606
17607 SunSpider reports a 0.5% progression.
17608
17609 * bytecode/CodeBlock.cpp:
17610 (JSC::sizeInBytes): Generic method to get the cost of a Vector.
17611 (JSC::CodeBlock::dumpStatistics): Add dumping of member sizes.
17612 * bytecode/CodeBlock.h:
17613 (JSC::PC::PC): Struct representing NativePC -> VirtualPC mappings.
17614 (JSC::getNativePC): Helper for binary chop.
17615 (JSC::CodeBlock::getBytecodeIndex): Used to get the VirtualPC from a
17616 NativePC using a binary chop of the pcVector.
17617 (JSC::CodeBlock::pcVector): Accessor.
17618
17619 * interpreter/Interpreter.cpp:
17620 (JSC::vPCForPC): Use getBytecodeIndex instead of jitReturnAddressVPCMap().get().
17621 (JSC::Interpreter::cti_op_instanceof): Ditto.
17622 (JSC::Interpreter::cti_op_resolve): Ditto.
17623 (JSC::Interpreter::cti_op_resolve_func): Ditto.
17624 (JSC::Interpreter::cti_op_resolve_skip): Ditto.
17625 (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
17626 (JSC::Interpreter::cti_op_throw): Ditto.
17627 (JSC::Interpreter::cti_op_in): Ditto.
17628 (JSC::Interpreter::cti_vm_throw): Ditto.
17629
17630 * jit/JIT.cpp:
17631 (JSC::JIT::privateCompile): Reserve exact capacity and fill the pcVector.
17632
17633 2008-12-09 Geoffrey Garen <ggaren@apple.com>
17634
17635 Reviewed by Oliver Hunt.
17636
17637 Added WREC support for an assertion followed by a quantifier. Fixed
17638 PCRE to match.
17639
17640 * wrec/WRECParser.cpp:
17641 (JSC::WREC::Parser::parseParentheses): Throw away the quantifier, since
17642 it's meaningless. (Firefox does the same.)
17643
17644 * pcre/pcre_compile.cpp:
17645 (compileBranch): ditto.
17646
17647 2008-12-09 Geoffrey Garen <ggaren@apple.com>
17648
17649 Reviewed by Cameron Zwarich.
17650
17651 In preparation for compiling WREC without PCRE:
17652
17653 Further relaxed WREC's parsing to be more web-compatible. Fixed PCRE to
17654 match in cases where it didn't already.
17655
17656 Changed JavaScriptCore to report syntax errors detected by WREC, rather
17657 than falling back on PCRE any time WREC sees an error.
17658
17659 * pcre/pcre_compile.cpp:
17660 (checkEscape): Relaxed parsing of \c and \N escapes to be more
17661 web-compatible.
17662
17663 * runtime/RegExp.cpp:
17664 (JSC::RegExp::RegExp): Only fall back on PCRE if WREC has not reported
17665 a syntax error.
17666
17667 * wrec/WREC.cpp:
17668 (JSC::WREC::Generator::compileRegExp): Fixed some error reporting to
17669 match PCRE.
17670
17671 * wrec/WRECParser.cpp: Added error messages that match PCRE.
17672
17673 (JSC::WREC::Parser::consumeGreedyQuantifier):
17674 (JSC::WREC::Parser::parseParentheses):
17675 (JSC::WREC::Parser::parseCharacterClass):
17676 (JSC::WREC::Parser::parseNonCharacterEscape): Updated the above functions to
17677 use the new setError API.
17678
17679 (JSC::WREC::Parser::consumeEscape): Relaxed parsing of \c \N \u \x \B
17680 to be more web-compatible.
17681
17682 (JSC::WREC::Parser::parseAlternative): Distinguish between a malformed
17683 quantifier and a quantifier with no prefix, like PCRE does.
17684
17685 (JSC::WREC::Parser::consumeParenthesesType): Updated to use the new setError API.
17686
17687 * wrec/WRECParser.h:
17688 (JSC::WREC::Parser::error):
17689 (JSC::WREC::Parser::syntaxError):
17690 (JSC::WREC::Parser::parsePattern):
17691 (JSC::WREC::Parser::reset):
17692 (JSC::WREC::Parser::setError): Store error messages instead of error codes,
17693 to provide for exception messages. Use a setter for reporting errors, so
17694 errors detected early are not overwritten by errors detected later.
17695
17696 2008-12-09 Gavin Barraclough <barraclough@apple.com>
17697
17698 Reviewed by Oliver Hunt.
17699
17700 Use va_args to access cti function arguments.
17701 https://bugs.webkit.org/show_bug.cgi?id=22774
17702
17703 This may be a minor regression, but we'll take the hit if so to reduce fragility.
17704
17705 * interpreter/Interpreter.cpp:
17706 * interpreter/Interpreter.h:
17707
17708 2008-12-09 Sam Weinig <sam@webkit.org>
17709
17710 Reviewed twice by Cameron Zwarich.
17711
17712 Fix for https://bugs.webkit.org/show_bug.cgi?id=22752
17713 Clear SymbolTable after codegen for Function codeblocks that
17714 don't require an activation
17715
17716 This is a ~1.5MB improvement on Membuster-head.
17717
17718 * bytecode/CodeBlock.cpp:
17719 (JSC::CodeBlock::dumpStatistics): Add logging of non-empty symbol tables
17720 and total size used by symbol tables.
17721 * bytecompiler/BytecodeGenerator.cpp:
17722 (JSC::BytecodeGenerator::generate): Clear the symbol table here.
17723
17724 2008-12-09 Sam Weinig <sam@webkit.org>
17725
17726 Reviewed by Geoffrey Garen.
17727
17728 Remove unnecessary extra lookup when throwing an exception.
17729 We used to first lookup the target offset using getHandlerForVPC
17730 and then we would lookup the native code stub using
17731 nativeExceptionCodeForHandlerVPC. Instead, we can just pass around
17732 the HandlerInfo.
17733
17734 * bytecode/CodeBlock.cpp:
17735 (JSC::CodeBlock::handlerForVPC): Return the HandlerInfo.
17736 * bytecode/CodeBlock.h: Remove nativeExceptionCodeForHandlerVPC.
17737
17738 * interpreter/Interpreter.cpp:
17739 (JSC::Interpreter::throwException): Return a HandlerInfo instead of
17740 and Instruction offset.
17741 (JSC::Interpreter::privateExecute): Get the offset from HandlerInfo.
17742 (JSC::Interpreter::cti_op_throw): Get the native code from the HandleInfo.
17743 (JSC::Interpreter::cti_vm_throw): Ditto.
17744 * interpreter/Interpreter.h:
17745
17746 2008-12-09 Eric Seidel <eric@webkit.org>
17747
17748 Build fix only, no review.
17749
17750 Speculative fix for the Chromium-Windows bot.
17751 Add JavaScriptCore/os-win32 to the include path (for stdint.h)
17752 Strangely it builds fine on my local windows box (or at least doesn't hit this error)
17753
17754 * JavaScriptCore.scons:
17755
17756 2008-12-09 Eric Seidel <eric@webkit.org>
17757
17758 No review, build fix only.
17759
17760 Add ExecutableAllocator files missing from Scons build.
17761
17762 * JavaScriptCore.scons:
17763
17764 2008-12-09 Dimitri Glazkov <dglazkov@chromium.org>
17765
17766 Reviewed by Timothy Hatcher.
17767
17768 https://bugs.webkit.org/show_bug.cgi?id=22631
17769 Allow ScriptCallFrame query names of functions in the call stack.
17770
17771 * JavaScriptCore.exp: added InternalFunction::name and
17772 UString operator==() as exported symbol
17773
17774 2008-12-08 Judit Jasz <jasy@inf.u-szeged.hu>
17775
17776 Reviewed and tweaked by Cameron Zwarich.
17777
17778 Bug 22352: Annotate opcodes with their length
17779 <https://bugs.webkit.org/show_bug.cgi?id=22352>
17780
17781 * bytecode/Opcode.cpp:
17782 * bytecode/Opcode.h:
17783 * interpreter/Interpreter.cpp:
17784 (JSC::Interpreter::privateExecute):
17785 * jit/JIT.cpp:
17786 (JSC::JIT::privateCompileMainPass):
17787 (JSC::JIT::privateCompileSlowCases):
17788
17789 2008-12-08 Geoffrey Garen <ggaren@apple.com>
17790
17791 Reviewed by Oliver Hunt.
17792
17793 Implemented more of the relaxed and somewhat weird rules for deciding
17794 how to interpret a non-pattern-character.
17795
17796 * wrec/Escapes.h:
17797 (JSC::WREC::Escape::):
17798 (JSC::WREC::Escape::Escape): Eliminated Escape::None because it was
17799 unused. If you see an '\\', it's either a valid escape or an error.
17800
17801 * wrec/Quantifier.h:
17802 (JSC::WREC::Quantifier::Quantifier):
17803 * wrec/WRECGenerator.cpp:
17804 (JSC::WREC::Generator::generateNonGreedyQuantifier):
17805 (JSC::WREC::Generator::generateGreedyQuantifier): Renamed "noMaxSpecified"
17806 to "Infinity", since that's what it means.
17807
17808 * wrec/WRECParser.cpp:
17809 (JSC::WREC::Parser::consumeGreedyQuantifier): Re-wrote {n,m} parsing rules
17810 because they were too strict before. Added support for backtracking
17811 in the case where the {n,m} fails to parse as a quantifier, and yet is
17812 not a syntax error.
17813
17814 (JSC::WREC::Parser::parseCharacterClass):
17815 (JSC::WREC::Parser::parseNonCharacterEscape): Eliminated Escape::None,
17816 as above.
17817
17818 (JSC::WREC::Parser::consumeEscape): Don't treat ASCII and _ escapes
17819 as syntax errors. See fast/regex/non-pattern-characters.html.
17820
17821 * wrec/WRECParser.h:
17822 (JSC::WREC::Parser::SavedState::SavedState):
17823 (JSC::WREC::Parser::SavedState::restore): Added a state backtracker,
17824 since parsing {n,m} forms requires backtracking if the form turns out
17825 not to be a quantifier.
17826
17827 2008-12-08 Geoffrey Garen <ggaren@apple.com>
17828
17829 Reviewed by Oliver Hunt.
17830
17831 Refactored WREC parsing so that only one piece of code needs to know
17832 the relaxed and somewhat weird rules for deciding how to interpret a
17833 non-pattern-character, in preparation for implementing those rules.
17834
17835 Also, implemented the relaxed and somewhat weird rules for '}' and ']'.
17836
17837 * wrec/WREC.cpp: Reduced the regular expression size limit. Now that
17838 WREC handles ']' properly, it compiles fast/js/regexp-charclass-crash.html,
17839 which makes it hang at the old limit. (The old limit was based on the
17840 misimpression that the same value in PCRE limited the regular expression
17841 pattern size; in reality, it limited the expected compiled regular
17842 expression size. WREC doesn't have a way to calculate an expected
17843 compiled regular expression size, but this should be good enough.)
17844
17845 * wrec/WRECParser.cpp:
17846 (JSC::WREC::parsePatternCharacterSequence): Nixed this function because
17847 it contained a second copy of the logic for handling non-pattern-characters,
17848 which is about to get a lot more complicated.
17849
17850 (JSC::WREC::PatternCharacterSequence::PatternCharacterSequence):
17851 (JSC::WREC::PatternCharacterSequence::size):
17852 (JSC::WREC::PatternCharacterSequence::append):
17853 (JSC::WREC::PatternCharacterSequence::flush): Helper object for generating
17854 an optimized sequence of pattern characters.
17855
17856 (JSC::WREC::Parser::parseNonCharacterEscape): Renamed to reflect the fact
17857 that the main parseAlternative loop handles character escapes.
17858
17859 (JSC::WREC::Parser::parseAlternative): Moved pattern character sequence
17860 logic from parsePatternCharacterSequence to here, using
17861 PatternCharacterSequence to help with the details.
17862
17863 * wrec/WRECParser.h: Updated for renames.
17864
17865 2008-12-08 Alexey Proskuryakov <ap@webkit.org>
17866
17867 Reviewed by Geoff Garen.
17868
17869 <rdar://problem/6166088> Give JSGlobalContextCreate a behavior that is concurrency aware,
17870 and un-deprecate it
17871
17872 * API/JSContextRef.cpp: (JSGlobalContextCreate):
17873 * API/JSContextRef.h:
17874 Use a unique context group for the context, unless the application was linked against old
17875 JavaScriptCore.
17876
17877 2008-12-08 Sam Weinig <sam@webkit.org>
17878
17879 Reviewed by Cameron Zwarich.
17880
17881 Fix for <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
17882
17883 Step 1:
17884
17885 Remove use of jitReturnAddressVPCMap when looking for vPC to store Structures
17886 in for cached lookup. Instead, use the offset in the StructureStubInfo that is
17887 already required.
17888
17889 * bytecode/CodeBlock.cpp:
17890 (JSC::CodeBlock::dumpStatistics): Fix extraneous semicolon.
17891 * interpreter/Interpreter.cpp:
17892 (JSC::Interpreter::tryCTICachePutByID):
17893 (JSC::Interpreter::tryCTICacheGetByID):
17894 (JSC::Interpreter::cti_op_get_by_id_self_fail):
17895 (JSC::Interpreter::cti_op_get_by_id_proto_list):
17896 * jit/JIT.h:
17897 (JSC::JIT::compileGetByIdSelf):
17898 (JSC::JIT::compileGetByIdProto):
17899 (JSC::JIT::compileGetByIdChain):
17900 (JSC::JIT::compilePutByIdReplace):
17901 (JSC::JIT::compilePutByIdTransition):
17902 * jit/JITPropertyAccess.cpp:
17903 (JSC::JIT::privateCompilePutByIdTransition):
17904 (JSC::JIT::patchGetByIdSelf):
17905 (JSC::JIT::patchPutByIdReplace):
17906 (JSC::JIT::privateCompilePatchGetArrayLength): Remove extra call to getStubInfo.
17907 (JSC::JIT::privateCompileGetByIdSelf):
17908 (JSC::JIT::privateCompileGetByIdProto):
17909 (JSC::JIT::privateCompileGetByIdChain):
17910 (JSC::JIT::privateCompilePutByIdReplace):
17911
17912 2008-12-08 Gavin Barraclough <barraclough@apple.com>
17913
17914 Reviewed by Oliver Hunt.
17915
17916 Port the op_j?n?eq_null JIT code generation to use the MacroAssembler,
17917 and clean up slightly at the same time. The 'j' forms currently compare,
17918 then set a register, then compare again, then branch. Branch directly on
17919 the result of the first compare.
17920
17921 Around a 1% progression on deltablue, crypto & early boyer, for about 1/2%
17922 overall on v8-tests.
17923
17924 * jit/JIT.cpp:
17925 (JSC::JIT::privateCompileMainPass):
17926 * jit/JITPropertyAccess.cpp:
17927 (JSC::JIT::compileGetByIdSlowCase):
17928
17929 2008-12-08 Gavin Barraclough <barraclough@apple.com>
17930
17931 Reviewed by Geoff Garen.
17932
17933 Expand MacroAssembler to support more operations, required by the JIT.
17934
17935 Generally adds more operations and permutations of operands to the existing
17936 interface. Rename 'jset' to 'jnz' and 'jnset' to 'jz', which seem clearer,
17937 and require that immediate pointer operands (though not pointer addresses to
17938 load and store instructions) are wrapped in a ImmPtr() type, akin to Imm32().
17939
17940 No performance impact.
17941
17942 * assembler/MacroAssembler.h:
17943 (JSC::MacroAssembler::):
17944 (JSC::MacroAssembler::ImmPtr::ImmPtr):
17945 (JSC::MacroAssembler::add32):
17946 (JSC::MacroAssembler::and32):
17947 (JSC::MacroAssembler::or32):
17948 (JSC::MacroAssembler::sub32):
17949 (JSC::MacroAssembler::xor32):
17950 (JSC::MacroAssembler::loadPtr):
17951 (JSC::MacroAssembler::load32):
17952 (JSC::MacroAssembler::storePtr):
17953 (JSC::MacroAssembler::store32):
17954 (JSC::MacroAssembler::poke):
17955 (JSC::MacroAssembler::move):
17956 (JSC::MacroAssembler::testImm32):
17957 (JSC::MacroAssembler::jae32):
17958 (JSC::MacroAssembler::jb32):
17959 (JSC::MacroAssembler::jePtr):
17960 (JSC::MacroAssembler::je32):
17961 (JSC::MacroAssembler::jnePtr):
17962 (JSC::MacroAssembler::jne32):
17963 (JSC::MacroAssembler::jnzPtr):
17964 (JSC::MacroAssembler::jnz32):
17965 (JSC::MacroAssembler::jzPtr):
17966 (JSC::MacroAssembler::jz32):
17967 (JSC::MacroAssembler::joSub32):
17968 (JSC::MacroAssembler::jump):
17969 (JSC::MacroAssembler::sete32):
17970 (JSC::MacroAssembler::setne32):
17971 (JSC::MacroAssembler::setnz32):
17972 (JSC::MacroAssembler::setz32):
17973 * assembler/X86Assembler.h:
17974 (JSC::X86Assembler::addl_mr):
17975 (JSC::X86Assembler::andl_i8r):
17976 (JSC::X86Assembler::cmpl_rm):
17977 (JSC::X86Assembler::cmpl_mr):
17978 (JSC::X86Assembler::cmpl_i8m):
17979 (JSC::X86Assembler::subl_mr):
17980 (JSC::X86Assembler::testl_i32m):
17981 (JSC::X86Assembler::xorl_i32r):
17982 (JSC::X86Assembler::movl_rm):
17983 (JSC::X86Assembler::modRm_opmsib):
17984 * jit/JIT.cpp:
17985 (JSC::JIT::privateCompileMainPass):
17986 * jit/JITInlineMethods.h:
17987 (JSC::JIT::emitGetVirtualRegister):
17988 (JSC::JIT::emitPutCTIArgConstant):
17989 (JSC::JIT::emitPutCTIParam):
17990 (JSC::JIT::emitPutImmediateToCallFrameHeader):
17991 (JSC::JIT::emitInitRegister):
17992 (JSC::JIT::checkStructure):
17993 (JSC::JIT::emitJumpIfJSCell):
17994 (JSC::JIT::emitJumpIfNotJSCell):
17995 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
17996
17997 2008-12-08 Geoffrey Garen <ggaren@apple.com>
17998
17999 Reviewed by Sam Weinig.
18000
18001 Fixed a bug where WREC would allow a quantifier whose minimum was
18002 greater than its maximum.
18003
18004 * wrec/Quantifier.h:
18005 (JSC::WREC::Quantifier::Quantifier): ASSERT that the quantifier is not
18006 backwards.
18007
18008 * wrec/WRECParser.cpp:
18009 (JSC::WREC::Parser::consumeGreedyQuantifier): Verify that the minimum
18010 is not greater than the maximum.
18011
18012 2008-12-08 Eric Seidel <eric@webkit.org>
18013
18014 Build fix only, no review.
18015
18016 * JavaScriptCore.scons: add bytecode/JumpTable.cpp
18017
18018 2008-12-08 Sam Weinig <sam@webkit.org>
18019
18020 Reviewed by Geoffrey Garen.
18021
18022 Patch for https://bugs.webkit.org/show_bug.cgi?id=22716
18023 <rdar://problem/6428315>
18024 Add RareData structure to CodeBlock for infrequently used auxiliary data
18025 members.
18026
18027 Reduces memory on Membuster-head by ~.5MB
18028
18029 * bytecode/CodeBlock.cpp:
18030 (JSC::CodeBlock::dump):
18031 (JSC::CodeBlock::dumpStatistics):
18032 (JSC::CodeBlock::mark):
18033 (JSC::CodeBlock::getHandlerForVPC):
18034 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
18035 (JSC::CodeBlock::shrinkToFit):
18036 * bytecode/CodeBlock.h:
18037 (JSC::CodeBlock::numberOfExceptionHandlers):
18038 (JSC::CodeBlock::addExceptionHandler):
18039 (JSC::CodeBlock::exceptionHandler):
18040 (JSC::CodeBlock::addFunction):
18041 (JSC::CodeBlock::function):
18042 (JSC::CodeBlock::addUnexpectedConstant):
18043 (JSC::CodeBlock::unexpectedConstant):
18044 (JSC::CodeBlock::addRegExp):
18045 (JSC::CodeBlock::regexp):
18046 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
18047 (JSC::CodeBlock::addImmediateSwitchJumpTable):
18048 (JSC::CodeBlock::immediateSwitchJumpTable):
18049 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
18050 (JSC::CodeBlock::addCharacterSwitchJumpTable):
18051 (JSC::CodeBlock::characterSwitchJumpTable):
18052 (JSC::CodeBlock::numberOfStringSwitchJumpTables):
18053 (JSC::CodeBlock::addStringSwitchJumpTable):
18054 (JSC::CodeBlock::stringSwitchJumpTable):
18055 (JSC::CodeBlock::evalCodeCache):
18056 (JSC::CodeBlock::createRareDataIfNecessary):
18057
18058 2008-11-26 Peter Kasting <pkasting@google.com>
18059
18060 Reviewed by Anders Carlsson.
18061
18062 https://bugs.webkit.org/show_bug.cgi?id=16814
18063 Allow ports to disable ActiveX->NPAPI conversion for Media Player.
18064 Improve handling of miscellaneous ActiveX objects.
18065
18066 * wtf/Platform.h: Add another ENABLE(...).
18067
18068 2008-12-08 Sam Weinig <sam@webkit.org>
18069
18070 Reviewed by Mark Rowe.
18071
18072 Add dumping of CodeBlock member structure usage.
18073
18074 * bytecode/CodeBlock.cpp:
18075 (JSC::CodeBlock::dumpStatistics):
18076 * bytecode/EvalCodeCache.h:
18077 (JSC::EvalCodeCache::isEmpty):
18078
18079 2008-12-08 David Kilzer <ddkilzer@apple.com>
18080
18081 Bug 22555: Sort "children" sections in Xcode project files
18082
18083 <https://bugs.webkit.org/show_bug.cgi?id=22555>
18084
18085 Reviewed by Eric Seidel.
18086
18087 * JavaScriptCore.xcodeproj/project.pbxproj: Sorted.
18088
18089 2008-12-08 Tony Chang <tony@chromium.org>
18090
18091 Reviewed by Eric Seidel.
18092
18093 Enable Pan scrolling only when building on PLATFORM(WIN_OS)
18094 Previously platforms like Apple Windows WebKit, Cairo Windows WebKit,
18095 Wx and Chromium were enabling it explicitly, now we just turn it on
18096 for all WIN_OS, later platforms can turn it off as needed on Windows
18097 (or turn it on under Linux, etc.)
18098 https://bugs.webkit.org/show_bug.cgi?id=22698
18099
18100 * wtf/Platform.h:
18101
18102 2008-12-08 Sam Weinig <sam@webkit.org>
18103
18104 Reviewed by Cameron Zwarich.
18105
18106 Add basic memory statistics dumping for CodeBlock.
18107
18108 * bytecode/CodeBlock.cpp:
18109 (JSC::CodeBlock::dumpStatistics):
18110 (JSC::CodeBlock::CodeBlock):
18111 (JSC::CodeBlock::~CodeBlock):
18112 * bytecode/CodeBlock.h:
18113
18114 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
18115
18116 Fix the Linux build with newer gcc/glibc.
18117
18118 * jit/ExecutableAllocatorPosix.cpp: Include unistd.h for
18119 getpagesize(), according to
18120 http://opengroup.org/onlinepubs/007908775/xsh/getpagesize.html
18121
18122 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
18123
18124 Fix the build with Qt on Windows.
18125
18126 * JavaScriptCore.pri: Compile ExecutableAllocatorWin.cpp on Windows.
18127
18128 2008-12-07 Oliver Hunt <oliver@apple.com>
18129
18130 Reviewed by NOBODY (Buildfix).
18131
18132 Fix non-WREC builds
18133
18134 * runtime/RegExp.cpp:
18135 (JSC::RegExp::RegExp):
18136
18137 2008-12-07 Oliver Hunt <oliver@apple.com>
18138
18139 Reviewed by NOBODY (Build fix).
18140
18141 Put ENABLE(ASSEMBLER) guards around use of ExecutableAllocator in global data
18142
18143 Correct Qt and Gtk project files
18144
18145 * GNUmakefile.am:
18146 * JavaScriptCore.pri:
18147 * runtime/JSGlobalData.h:
18148
18149 2008-12-07 Oliver Hunt <oliver@apple.com>
18150
18151 Reviewed by NOBODY (Build fix).
18152
18153 Add new files to other projects.
18154
18155 * GNUmakefile.am:
18156 * JavaScriptCore.pri:
18157 * JavaScriptCore.pro:
18158
18159 2008-12-07 Oliver Hunt <oliver@apple.com>
18160
18161 Rubber stamped by Mark Rowe.
18162
18163 Rename ExecutableAllocatorMMAP to the more sensible ExecutableAllocatorPosix
18164
18165 * JavaScriptCore.xcodeproj/project.pbxproj:
18166 * jit/ExecutableAllocator.h:
18167 * jit/ExecutableAllocatorPosix.cpp: Renamed from JavaScriptCore/jit/ExecutableAllocatorMMAP.cpp.
18168 (JSC::ExecutableAllocator::intializePageSize):
18169 (JSC::ExecutablePool::systemAlloc):
18170 (JSC::ExecutablePool::systemRelease):
18171
18172 2008-12-07 Oliver Hunt <oliver@apple.com>
18173
18174 Reviewed by Cameron Zwarich and Sam Weinig
18175
18176 <rdar://problem/6309878> Need more granular control over allocation of executable memory (21783)
18177 <https://bugs.webkit.org/show_bug.cgi?id=21783>
18178
18179 Add a new allocator for use by the JIT that provides executable pages, so
18180 we can get rid of the current hack that makes the entire heap executable.
18181
18182 1-2% progression on SunSpider-v8, 1% on SunSpider. Reduces memory usage as well!
18183
18184 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
18185 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
18186 * JavaScriptCore.xcodeproj/project.pbxproj:
18187 * assembler/AssemblerBuffer.h:
18188 (JSC::AssemblerBuffer::size):
18189 (JSC::AssemblerBuffer::executableCopy):
18190 * assembler/MacroAssembler.h:
18191 (JSC::MacroAssembler::size):
18192 (JSC::MacroAssembler::copyCode):
18193 * assembler/X86Assembler.h:
18194 (JSC::X86Assembler::size):
18195 (JSC::X86Assembler::executableCopy):
18196 * bytecode/CodeBlock.cpp:
18197 (JSC::CodeBlock::~CodeBlock):
18198 * bytecode/CodeBlock.h:
18199 (JSC::CodeBlock::executablePool):
18200 (JSC::CodeBlock::setExecutablePool):
18201 * bytecode/Instruction.h:
18202 (JSC::PolymorphicAccessStructureList::derefStructures):
18203 * interpreter/Interpreter.cpp:
18204 (JSC::Interpreter::~Interpreter):
18205 * interpreter/Interpreter.h:
18206 * jit/ExecutableAllocator.cpp: Added.
18207 * jit/ExecutableAllocator.h: Added.
18208 (JSC::ExecutablePool::create):
18209 (JSC::ExecutablePool::alloc):
18210 (JSC::ExecutablePool::~ExecutablePool):
18211 (JSC::ExecutablePool::available):
18212 (JSC::ExecutablePool::ExecutablePool):
18213 (JSC::ExecutablePool::poolAllocate):
18214 (JSC::ExecutableAllocator::ExecutableAllocator):
18215 (JSC::ExecutableAllocator::poolForSize):
18216 (JSC::ExecutablePool::sizeForAllocation):
18217 * jit/ExecutableAllocatorMMAP.cpp: Added.
18218 (JSC::ExecutableAllocator::intializePageSize):
18219 (JSC::ExecutablePool::systemAlloc):
18220 (JSC::ExecutablePool::systemRelease):
18221 * jit/ExecutableAllocatorWin.cpp: Added.
18222 (JSC::ExecutableAllocator::intializePageSize):
18223 (JSC::ExecutablePool::systemAlloc):
18224 (JSC::ExecutablePool::systemRelease):
18225 * jit/JIT.cpp:
18226 (JSC::JIT::privateCompile):
18227 (JSC::JIT::privateCompileCTIMachineTrampolines):
18228 * jit/JIT.h:
18229 (JSC::JIT::compileCTIMachineTrampolines):
18230 * jit/JITPropertyAccess.cpp:
18231 (JSC::JIT::privateCompilePutByIdTransition):
18232 (JSC::JIT::privateCompilePatchGetArrayLength):
18233 (JSC::JIT::privateCompileGetByIdSelf):
18234 (JSC::JIT::privateCompileGetByIdProto):
18235 (JSC::JIT::privateCompileGetByIdSelfList):
18236 (JSC::JIT::privateCompileGetByIdProtoList):
18237 (JSC::JIT::privateCompileGetByIdChainList):
18238 (JSC::JIT::privateCompileGetByIdChain):
18239 (JSC::JIT::privateCompilePutByIdReplace):
18240 * parser/Nodes.cpp:
18241 (JSC::RegExpNode::emitBytecode):
18242 * runtime/JSGlobalData.h:
18243 (JSC::JSGlobalData::poolForSize):
18244 * runtime/RegExp.cpp:
18245 (JSC::RegExp::RegExp):
18246 (JSC::RegExp::create):
18247 (JSC::RegExp::~RegExp):
18248 * runtime/RegExp.h:
18249 * runtime/RegExpConstructor.cpp:
18250 (JSC::constructRegExp):
18251 * runtime/RegExpPrototype.cpp:
18252 (JSC::regExpProtoFuncCompile):
18253 * runtime/StringPrototype.cpp:
18254 (JSC::stringProtoFuncMatch):
18255 (JSC::stringProtoFuncSearch):
18256 * wrec/WREC.cpp:
18257 (JSC::WREC::Generator::compileRegExp):
18258 * wrec/WRECGenerator.h:
18259 * wtf/FastMalloc.cpp:
18260 * wtf/FastMalloc.h:
18261 * wtf/TCSystemAlloc.cpp:
18262 (TryMmap):
18263 (TryVirtualAlloc):
18264 (TryDevMem):
18265 (TCMalloc_SystemRelease):
18266
18267 2008-12-06 Sam Weinig <sam@webkit.org>
18268
18269 Fix the Gtk build.
18270
18271 * jit/JITPropertyAccess.cpp:
18272 (JSC::JIT::compileGetByIdHotPath):
18273 (JSC::JIT::compilePutByIdHotPath):
18274
18275 2008-12-06 Sam Weinig <sam@webkit.org>
18276
18277 Reviewed by Cameron Zwarich,
18278
18279 Move CodeBlock constructor into the .cpp file.
18280
18281 Sunspider reports a .7% progression, but I can only assume this
18282 is noise.
18283
18284 * bytecode/CodeBlock.cpp:
18285 (JSC::CodeBlock::CodeBlock):
18286 * bytecode/CodeBlock.h:
18287
18288 2008-12-06 Sam Weinig <sam@webkit.org>
18289
18290 Reviewed by Cameron Zwarich.
18291
18292 Split JumpTable code into its own file.
18293
18294 * GNUmakefile.am:
18295 * JavaScriptCore.pri:
18296 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
18297 * JavaScriptCore.xcodeproj/project.pbxproj:
18298 * JavaScriptCoreSources.bkl:
18299 * bytecode/CodeBlock.cpp:
18300 * bytecode/CodeBlock.h:
18301 * bytecode/JumpTable.cpp: Copied from bytecode/CodeBlock.cpp.
18302 * bytecode/JumpTable.h: Copied from bytecode/CodeBlock.h.
18303
18304 2008-12-05 Sam Weinig <sam@webkit.org>
18305
18306 Reviewed by Cameron Zwarich.
18307
18308 Fix for https://bugs.webkit.org/show_bug.cgi?id=22715
18309 Encapsulate more CodeBlock members in preparation
18310 of moving some of them to a rare data structure.
18311
18312 * bytecode/CodeBlock.cpp:
18313 (JSC::locationForOffset):
18314 (JSC::printConditionalJump):
18315 (JSC::printGetByIdOp):
18316 (JSC::printPutByIdOp):
18317 (JSC::CodeBlock::printStructure):
18318 (JSC::CodeBlock::printStructures):
18319 (JSC::CodeBlock::dump):
18320 (JSC::CodeBlock::~CodeBlock):
18321 (JSC::CodeBlock::unlinkCallers):
18322 (JSC::CodeBlock::derefStructures):
18323 (JSC::CodeBlock::refStructures):
18324 (JSC::CodeBlock::mark):
18325 (JSC::CodeBlock::getHandlerForVPC):
18326 (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
18327 (JSC::CodeBlock::lineNumberForVPC):
18328 (JSC::CodeBlock::expressionRangeForVPC):
18329 (JSC::CodeBlock::shrinkToFit):
18330 * bytecode/CodeBlock.h:
18331 (JSC::CodeBlock::CodeBlock):
18332 (JSC::CodeBlock::addCaller):
18333 (JSC::CodeBlock::removeCaller):
18334 (JSC::CodeBlock::isKnownNotImmediate):
18335 (JSC::CodeBlock::isConstantRegisterIndex):
18336 (JSC::CodeBlock::getConstant):
18337 (JSC::CodeBlock::isTemporaryRegisterIndex):
18338 (JSC::CodeBlock::getStubInfo):
18339 (JSC::CodeBlock::getCallLinkInfo):
18340 (JSC::CodeBlock::instructions):
18341 (JSC::CodeBlock::setJITCode):
18342 (JSC::CodeBlock::jitCode):
18343 (JSC::CodeBlock::ownerNode):
18344 (JSC::CodeBlock::setGlobalData):
18345 (JSC::CodeBlock::setThisRegister):
18346 (JSC::CodeBlock::thisRegister):
18347 (JSC::CodeBlock::setNeedsFullScopeChain):
18348 (JSC::CodeBlock::needsFullScopeChain):
18349 (JSC::CodeBlock::setUsesEval):
18350 (JSC::CodeBlock::usesEval):
18351 (JSC::CodeBlock::setUsesArguments):
18352 (JSC::CodeBlock::usesArguments):
18353 (JSC::CodeBlock::codeType):
18354 (JSC::CodeBlock::source):
18355 (JSC::CodeBlock::sourceOffset):
18356 (JSC::CodeBlock::addGlobalResolveInstruction):
18357 (JSC::CodeBlock::numberOfPropertyAccessInstructions):
18358 (JSC::CodeBlock::addPropertyAccessInstruction):
18359 (JSC::CodeBlock::propertyAccessInstruction):
18360 (JSC::CodeBlock::numberOfCallLinkInfos):
18361 (JSC::CodeBlock::addCallLinkInfo):
18362 (JSC::CodeBlock::callLinkInfo):
18363 (JSC::CodeBlock::numberOfJumpTargets):
18364 (JSC::CodeBlock::addJumpTarget):
18365 (JSC::CodeBlock::jumpTarget):
18366 (JSC::CodeBlock::lastJumpTarget):
18367 (JSC::CodeBlock::numberOfExceptionHandlers):
18368 (JSC::CodeBlock::addExceptionHandler):
18369 (JSC::CodeBlock::exceptionHandler):
18370 (JSC::CodeBlock::addExpressionInfo):
18371 (JSC::CodeBlock::numberOfLineInfos):
18372 (JSC::CodeBlock::addLineInfo):
18373 (JSC::CodeBlock::lastLineInfo):
18374 (JSC::CodeBlock::jitReturnAddressVPCMap):
18375 (JSC::CodeBlock::numberOfIdentifiers):
18376 (JSC::CodeBlock::addIdentifier):
18377 (JSC::CodeBlock::identifier):
18378 (JSC::CodeBlock::numberOfConstantRegisters):
18379 (JSC::CodeBlock::addConstantRegister):
18380 (JSC::CodeBlock::constantRegister):
18381 (JSC::CodeBlock::addFunction):
18382 (JSC::CodeBlock::function):
18383 (JSC::CodeBlock::addFunctionExpression):
18384 (JSC::CodeBlock::functionExpression):
18385 (JSC::CodeBlock::addUnexpectedConstant):
18386 (JSC::CodeBlock::unexpectedConstant):
18387 (JSC::CodeBlock::addRegExp):
18388 (JSC::CodeBlock::regexp):
18389 (JSC::CodeBlock::symbolTable):
18390 (JSC::CodeBlock::evalCodeCache):
18391 New inline setters/getters.
18392
18393 (JSC::ProgramCodeBlock::ProgramCodeBlock):
18394 (JSC::ProgramCodeBlock::~ProgramCodeBlock):
18395 (JSC::ProgramCodeBlock::clearGlobalObject):
18396 * bytecode/SamplingTool.cpp:
18397 (JSC::ScopeSampleRecord::sample):
18398 (JSC::SamplingTool::dump):
18399 * bytecompiler/BytecodeGenerator.cpp:
18400 * bytecompiler/BytecodeGenerator.h:
18401 * bytecompiler/Label.h:
18402 * interpreter/CallFrame.cpp:
18403 * interpreter/Interpreter.cpp:
18404 * jit/JIT.cpp:
18405 * jit/JITCall.cpp:
18406 * jit/JITInlineMethods.h:
18407 * jit/JITPropertyAccess.cpp:
18408 * parser/Nodes.cpp:
18409 * runtime/Arguments.h:
18410 * runtime/ExceptionHelpers.cpp:
18411 * runtime/JSActivation.cpp:
18412 * runtime/JSActivation.h:
18413 * runtime/JSGlobalObject.cpp:
18414 Change direct access to use new getter/setters.
18415
18416 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18417
18418 Reviewed by Oliver Hunt.
18419
18420 Prevent GCC4.2 from hanging when trying to compile Interpreter.cpp.
18421 Added "-fno-var-tracking" compiler flag.
18422
18423 https://bugs.webkit.org/show_bug.cgi?id=22704
18424
18425 * JavaScriptCore.xcodeproj/project.pbxproj:
18426
18427 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18428
18429 Reviewed by Oliver Hunt.
18430
18431 Ordering of branch operands in MacroAssembler in unnecessarily inconsistent.
18432
18433 je, jg etc take an immediate operand as the second argument, but for the
18434 equality branches (je, jne) the immediate operand was the first argument. This
18435 was unnecessarily inconsistent. Change je, jne methods to take the immediate
18436 as the second argument.
18437
18438 https://bugs.webkit.org/show_bug.cgi?id=22703
18439
18440 * assembler/MacroAssembler.h:
18441 (JSC::MacroAssembler::je32):
18442 (JSC::MacroAssembler::jne32):
18443 * jit/JIT.cpp:
18444 (JSC::JIT::compileOpStrictEq):
18445 * wrec/WRECGenerator.cpp:
18446 (JSC::WREC::Generator::generateEnter):
18447 (JSC::WREC::Generator::generateNonGreedyQuantifier):
18448 (JSC::WREC::Generator::generateGreedyQuantifier):
18449 (JSC::WREC::Generator::generatePatternCharacterPair):
18450 (JSC::WREC::Generator::generatePatternCharacter):
18451 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
18452 (JSC::WREC::Generator::generateCharacterClassInverted):
18453 (JSC::WREC::Generator::generateAssertionBOL):
18454 (JSC::WREC::Generator::generateAssertionWordBoundary):
18455
18456 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18457
18458 Reviewed by Geoff Garen.
18459
18460 Second tranche of porting JIT.cpp to MacroAssembler interface.
18461
18462 * assembler/MacroAssembler.h:
18463 (JSC::MacroAssembler::mul32):
18464 (JSC::MacroAssembler::jl32):
18465 (JSC::MacroAssembler::jnzSub32):
18466 (JSC::MacroAssembler::joAdd32):
18467 (JSC::MacroAssembler::joMul32):
18468 (JSC::MacroAssembler::jzSub32):
18469 * jit/JIT.cpp:
18470 (JSC::JIT::emitSlowScriptCheck):
18471 (JSC::JIT::privateCompileMainPass):
18472 (JSC::JIT::privateCompileSlowCases):
18473 (JSC::JIT::privateCompileCTIMachineTrampolines):
18474 * jit/JIT.h:
18475 * jit/JITInlineMethods.h:
18476 (JSC::JIT::emitJumpIfNotJSCell):
18477 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
18478
18479 2008-12-05 David Kilzer <ddkilzer@apple.com>
18480
18481 Bug 22609: Provide a build-time choice when generating hash tables for properties of built-in DOM objects
18482
18483 <https://bugs.webkit.org/show_bug.cgi?id=22609>
18484 <rdar://problem/6331749>
18485
18486 Reviewed by Darin Adler.
18487
18488 Initial patch by Yosen Lin. Adapted for ToT WebKit by David Kilzer.
18489
18490 Added back the code that generates a "compact" hash (instead of a
18491 perfect hash) as a build-time option using the
18492 ENABLE(PERFECT_HASH_SIZE) macro as defined in Lookup.h.
18493
18494 * create_hash_table: Rename variables to differentiate perfect hash
18495 values from compact hash values. Added back code to compute compact
18496 hash tables. Generate both hash table sizes and emit
18497 conditionalized code based on ENABLE(PERFECT_HASH_SIZE).
18498 * runtime/Lookup.cpp:
18499 (JSC::HashTable::createTable): Added version of createTable() for
18500 use with compact hash tables.
18501 (JSC::HashTable::deleteTable): Updated to work with compact hash
18502 tables.
18503 * runtime/Lookup.h: Defined ENABLE(PERFECT_HASH_SIZE) macro here.
18504 (JSC::HashEntry::initialize): Set m_next to zero when using compact
18505 hash tables.
18506 (JSC::HashEntry::setNext): Added for compact hash tables.
18507 (JSC::HashEntry::next): Added for compact hash tables.
18508 (JSC::HashTable::entry): Added version of entry() for use with
18509 compact hash tables.
18510 * runtime/Structure.cpp:
18511 (JSC::Structure::getEnumerablePropertyNames): Updated to work with
18512 compact hash tables.
18513
18514 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18515
18516 Reviewed by Geoff Garen.
18517
18518 Remove redundant calls to JIT::emitSlowScriptCheck.
18519 This is checked in the hot path, so is not needed on the slow path - and the code
18520 was being planted before the start of the slow case, so was completely unreachable!
18521
18522 * jit/JIT.cpp:
18523 (JSC::JIT::privateCompileSlowCases):
18524
18525 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18526
18527 Reviewed by Geoff Garen.
18528
18529 Move JIT::compileOpStrictEq to MacroAssembler interface.
18530
18531 The rewrite also looks like a small (<1%) performance progression.
18532
18533 https://bugs.webkit.org/show_bug.cgi?id=22697
18534
18535 * jit/JIT.cpp:
18536 (JSC::JIT::compileOpStrictEq):
18537 (JSC::JIT::privateCompileSlowCases):
18538 * jit/JIT.h:
18539 * jit/JITInlineMethods.h:
18540 (JSC::JIT::emitJumpIfJSCell):
18541 (JSC::JIT::emitJumpSlowCaseIfJSCell):
18542
18543 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18544
18545 Reviewed by Geoff Garen.
18546
18547 Remove m_assembler from MacroAssembler::Jump.
18548 Keeping a pointer allowed for some syntactic sugar - "link()" looks nicer
18549 than "link(this)". But maintaining this doubles the size of Jump, which
18550 is even more unfortunate for the JIT, since there are many large structures
18551 holding JmpSrcs. Probably best to remove it.
18552
18553 https://bugs.webkit.org/show_bug.cgi?id=22693
18554
18555 * assembler/MacroAssembler.h:
18556 (JSC::MacroAssembler::Jump::Jump):
18557 (JSC::MacroAssembler::Jump::link):
18558 (JSC::MacroAssembler::Jump::linkTo):
18559 (JSC::MacroAssembler::JumpList::link):
18560 (JSC::MacroAssembler::JumpList::linkTo):
18561 (JSC::MacroAssembler::jae32):
18562 (JSC::MacroAssembler::je32):
18563 (JSC::MacroAssembler::je16):
18564 (JSC::MacroAssembler::jg32):
18565 (JSC::MacroAssembler::jge32):
18566 (JSC::MacroAssembler::jl32):
18567 (JSC::MacroAssembler::jle32):
18568 (JSC::MacroAssembler::jnePtr):
18569 (JSC::MacroAssembler::jne32):
18570 (JSC::MacroAssembler::jnset32):
18571 (JSC::MacroAssembler::jset32):
18572 (JSC::MacroAssembler::jump):
18573 (JSC::MacroAssembler::jzSub32):
18574 (JSC::MacroAssembler::joAdd32):
18575 (JSC::MacroAssembler::call):
18576 * wrec/WREC.cpp:
18577 (JSC::WREC::Generator::compileRegExp):
18578 * wrec/WRECGenerator.cpp:
18579 (JSC::WREC::Generator::generateEnter):
18580 (JSC::WREC::Generator::generateBackreferenceQuantifier):
18581 (JSC::WREC::Generator::generateNonGreedyQuantifier):
18582 (JSC::WREC::Generator::generateGreedyQuantifier):
18583 (JSC::WREC::Generator::generatePatternCharacter):
18584 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
18585 (JSC::WREC::Generator::generateCharacterClassInverted):
18586 (JSC::WREC::Generator::generateCharacterClass):
18587 (JSC::WREC::Generator::generateParenthesesAssertion):
18588 (JSC::WREC::Generator::generateParenthesesInvertedAssertion):
18589 (JSC::WREC::Generator::generateParenthesesNonGreedy):
18590 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
18591 (JSC::WREC::Generator::generateAssertionBOL):
18592 (JSC::WREC::Generator::generateAssertionEOL):
18593 (JSC::WREC::Generator::generateAssertionWordBoundary):
18594 (JSC::WREC::Generator::generateBackreference):
18595 (JSC::WREC::Generator::terminateAlternative):
18596 (JSC::WREC::Generator::terminateDisjunction):
18597 * wrec/WRECParser.h:
18598
18599 2008-12-05 Gavin Barraclough <barraclough@apple.com>
18600
18601 Reviewed by Geoffrey Garen.
18602
18603 Simplify JIT generated checks for timeout code, by moving more work into the C function.
18604 https://bugs.webkit.org/show_bug.cgi?id=22688
18605
18606 * interpreter/Interpreter.cpp:
18607 (JSC::Interpreter::cti_timeout_check):
18608 * interpreter/Interpreter.h:
18609 * jit/JIT.cpp:
18610 (JSC::JIT::emitSlowScriptCheck):
18611
18612 2008-12-05 Sam Weinig <sam@webkit.org>
18613
18614 Reviewed by Geoffrey Garen.
18615
18616 Encapsulate access to jump tables in the CodeBlock in preparation
18617 of moving them to a rare data structure.
18618
18619 * bytecode/CodeBlock.cpp:
18620 (JSC::CodeBlock::dump):
18621 (JSC::CodeBlock::shrinkToFit):
18622 * bytecode/CodeBlock.h:
18623 (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
18624 (JSC::CodeBlock::addImmediateSwitchJumpTable):
18625 (JSC::CodeBlock::immediateSwitchJumpTable):
18626 (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
18627 (JSC::CodeBlock::addCharacterSwitchJumpTable):
18628 (JSC::CodeBlock::characterSwitchJumpTable):
18629 (JSC::CodeBlock::numberOfStringSwitchJumpTables):
18630 (JSC::CodeBlock::addStringSwitchJumpTable):
18631 (JSC::CodeBlock::stringSwitchJumpTable):
18632 * bytecompiler/BytecodeGenerator.cpp:
18633 (JSC::BytecodeGenerator::generate):
18634 (JSC::BytecodeGenerator::endSwitch):
18635 * interpreter/Interpreter.cpp:
18636 (JSC::Interpreter::privateExecute):
18637 (JSC::Interpreter::cti_op_switch_imm):
18638 (JSC::Interpreter::cti_op_switch_char):
18639 (JSC::Interpreter::cti_op_switch_string):
18640 * jit/JIT.cpp:
18641 (JSC::JIT::privateCompileMainPass):
18642
18643 2008-12-05 Adam Roben <aroben@apple.com>
18644
18645 Windows build fix after r39020
18646
18647 * jit/JITInlineMethods.h:
18648 (JSC::JIT::restoreArgumentReference):
18649 (JSC::JIT::restoreArgumentReferenceForTrampoline):
18650 Add some apparently-missing __.
18651
18652 2008-12-04 Geoffrey Garen <ggaren@apple.com>
18653
18654 Reviewed by Darin Adler.
18655
18656 https://bugs.webkit.org/show_bug.cgi?id=22673
18657
18658 Added support for the assertion (?=) and inverted assertion (?!) atoms
18659 in WREC.
18660
18661 * wrec/WRECGenerator.cpp:
18662 (JSC::WREC::Generator::generateParenthesesAssertion):
18663 (JSC::WREC::Generator::generateParenthesesInvertedAssertion): Split the
18664 old (unused) generateParentheses into these two functions, with more
18665 limited capabilities.
18666
18667 * wrec/WRECGenerator.h:
18668 (JSC::WREC::Generator::): Moved an enum to the top of the class definition,
18669 to match the WebKit style, and removed a defunct comment.
18670
18671 * wrec/WRECParser.cpp:
18672 (JSC::WREC::Parser::parseParentheses):
18673 (JSC::WREC::Parser::consumeParenthesesType):
18674 * wrec/WRECParser.h:
18675 (JSC::WREC::Parser::): Added support for parsing (?=) and (?!).
18676
18677 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
18678
18679 Rubber-stamped by Tor Arne Vestbø.
18680
18681 Disable the JIT for the Qt build alltogether again, after observing
18682 more miscompilations in a wider range of newer gcc versions.
18683
18684 * JavaScriptCore.pri:
18685
18686 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
18687
18688 Reviewed by Tor Arne Vestbø.
18689
18690 Disable the JIT for the Qt build on Linux unless gcc is >= 4.2,
18691 due to miscompilations.
18692
18693 * JavaScriptCore.pri:
18694
18695 2008-12-04 Gavin Barraclough <barraclough@apple.com>
18696
18697 Reviewed by Geoff Garen.
18698
18699 Start porting the JIT to use the MacroAssembler.
18700
18701 https://bugs.webkit.org/show_bug.cgi?id=22671
18702 No change in performance.
18703
18704 * assembler/MacroAssembler.h:
18705 (JSC::MacroAssembler::Jump::operator X86Assembler::JmpSrc):
18706 (JSC::MacroAssembler::add32):
18707 (JSC::MacroAssembler::and32):
18708 (JSC::MacroAssembler::lshift32):
18709 (JSC::MacroAssembler::rshift32):
18710 (JSC::MacroAssembler::storePtr):
18711 (JSC::MacroAssembler::store32):
18712 (JSC::MacroAssembler::poke):
18713 (JSC::MacroAssembler::move):
18714 (JSC::MacroAssembler::compareImm32ForBranchEquality):
18715 (JSC::MacroAssembler::jnePtr):
18716 (JSC::MacroAssembler::jnset32):
18717 (JSC::MacroAssembler::jset32):
18718 (JSC::MacroAssembler::jzeroSub32):
18719 (JSC::MacroAssembler::joverAdd32):
18720 (JSC::MacroAssembler::call):
18721 * assembler/X86Assembler.h:
18722 (JSC::X86Assembler::shll_i8r):
18723 * jit/JIT.cpp:
18724 (JSC::JIT::privateCompileMainPass):
18725 (JSC::JIT::privateCompile):
18726 (JSC::JIT::privateCompileCTIMachineTrampolines):
18727 * jit/JIT.h:
18728 * jit/JITArithmetic.cpp:
18729 (JSC::JIT::compileBinaryArithOp):
18730 * jit/JITInlineMethods.h:
18731 (JSC::JIT::emitGetVirtualRegister):
18732 (JSC::JIT::emitPutCTIArg):
18733 (JSC::JIT::emitPutCTIArgConstant):
18734 (JSC::JIT::emitGetCTIArg):
18735 (JSC::JIT::emitPutCTIArgFromVirtualRegister):
18736 (JSC::JIT::emitPutCTIParam):
18737 (JSC::JIT::emitGetCTIParam):
18738 (JSC::JIT::emitPutToCallFrameHeader):
18739 (JSC::JIT::emitPutImmediateToCallFrameHeader):
18740 (JSC::JIT::emitGetFromCallFrameHeader):
18741 (JSC::JIT::emitPutVirtualRegister):
18742 (JSC::JIT::emitInitRegister):
18743 (JSC::JIT::emitNakedCall):
18744 (JSC::JIT::restoreArgumentReference):
18745 (JSC::JIT::restoreArgumentReferenceForTrampoline):
18746 (JSC::JIT::emitCTICall):
18747 (JSC::JIT::checkStructure):
18748 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
18749 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
18750 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
18751 (JSC::JIT::emitFastArithDeTagImmediate):
18752 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
18753 (JSC::JIT::emitFastArithReTagImmediate):
18754 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
18755 (JSC::JIT::emitFastArithImmToInt):
18756 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
18757 (JSC::JIT::emitFastArithIntToImmNoCheck):
18758 (JSC::JIT::emitTagAsBoolImmediate):
18759 * jit/JITPropertyAccess.cpp:
18760 (JSC::JIT::privateCompilePutByIdTransition):
18761
18762 2008-12-04 Geoffrey Garen <ggaren@apple.com>
18763
18764 Reviewed by Oliver Hunt.
18765
18766 Some refactoring for generateGreedyQuantifier.
18767
18768 SunSpider reports no change (possibly a 0.3% speedup).
18769
18770 * wrec/WRECGenerator.cpp:
18771 (JSC::WREC::Generator::generateGreedyQuantifier): Clarified label
18772 meanings and unified some logic to simplify things.
18773
18774 * wrec/WRECParser.h:
18775 (JSC::WREC::Parser::parseAlternative): Added a version of parseAlternative
18776 that can jump to a Label, instead of a JumpList, upon failure. (Eventually,
18777 when we have a true Label class, this will be redundant.) This makes
18778 things easier for generateGreedyQuantifier, because it can avoid
18779 explicitly linking things.
18780
18781 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
18782
18783 Reviewed by Holger Freyther.
18784
18785 Fix crashes in the Qt build on Linux/i386 with non-executable memory
18786 by enabling TCSystemAlloc and the PROT_EXEC flag for mmap.
18787
18788 * JavaScriptCore.pri: Enable the use of TCSystemAlloc if the JIT is
18789 enabled.
18790 * wtf/TCSystemAlloc.cpp: Extend the PROT_EXEC permissions to
18791 PLATFORM(QT).
18792
18793 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
18794
18795 Reviewed by Tor Arne Vestbø.
18796
18797 Enable ENABLE_JIT_OPTIMIZE_CALL, ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
18798 and ENABLE_JIT_OPTIMIZE_ARITHMETIC, as suggested by Niko.
18799
18800 * JavaScriptCore.pri:
18801
18802 2008-12-04 Kent Hansen <khansen@trolltech.com>
18803
18804 Reviewed by Simon Hausmann.
18805
18806 Enable the JSC jit for the Qt build by default for release builds on
18807 linux-g++ and win32-msvc.
18808
18809 * JavaScriptCore.pri:
18810
18811 2008-12-04 Gavin Barraclough <barraclough@apple.com>
18812
18813 Reviewed by Oliver Hunt.
18814
18815 Allow JIT to function without property access repatching and arithmetic optimizations.
18816 Controlled by ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS and ENABLE_JIT_OPTIMIZE_ARITHMETIC switches.
18817
18818 https://bugs.webkit.org/show_bug.cgi?id=22643
18819
18820 * JavaScriptCore.xcodeproj/project.pbxproj:
18821 * jit/JIT.cpp:
18822 (JSC::JIT::privateCompileMainPass):
18823 (JSC::JIT::privateCompileSlowCases):
18824 * jit/JIT.h:
18825 * jit/JITArithmetic.cpp: Copied from jit/JIT.cpp.
18826 (JSC::JIT::compileBinaryArithOp):
18827 (JSC::JIT::compileBinaryArithOpSlowCase):
18828 * jit/JITPropertyAccess.cpp: Copied from jit/JIT.cpp.
18829 (JSC::JIT::compileGetByIdHotPath):
18830 (JSC::JIT::compileGetByIdSlowCase):
18831 (JSC::JIT::compilePutByIdHotPath):
18832 (JSC::JIT::compilePutByIdSlowCase):
18833 (JSC::resizePropertyStorage):
18834 (JSC::transitionWillNeedStorageRealloc):
18835 (JSC::JIT::privateCompilePutByIdTransition):
18836 (JSC::JIT::patchGetByIdSelf):
18837 (JSC::JIT::patchPutByIdReplace):
18838 (JSC::JIT::privateCompilePatchGetArrayLength):
18839 * wtf/Platform.h:
18840
18841 2008-12-03 Geoffrey Garen <ggaren@apple.com>
18842
18843 Reviewed by Oliver Hunt.
18844
18845 Optimized sequences of characters in regular expressions by comparing
18846 two characters at a time.
18847
18848 1-2% speedup on SunSpider, 19-25% speedup on regexp-dna.
18849
18850 * assembler/MacroAssembler.h:
18851 (JSC::MacroAssembler::load32):
18852 (JSC::MacroAssembler::jge32): Filled out a few more macro methods.
18853
18854 * assembler/X86Assembler.h:
18855 (JSC::X86Assembler::movl_mr): Added a verion of movl_mr that operates
18856 without an offset, to allow the macro assembler to optmize for that case.
18857
18858 * wrec/WREC.cpp:
18859 (JSC::WREC::Generator::compileRegExp): Test the saved value of index
18860 instead of the index register when checking for "end of input." The
18861 index register doesn't increment by 1 in an orderly fashion, so testing
18862 it for == "end of input" is not valid.
18863
18864 Also, jump all the way to "return failure" upon reaching "end of input,"
18865 instead of executing the next alternative. This is more logical, and
18866 it's a slight optimization in the case of an expression with many alternatives.
18867
18868 * wrec/WRECGenerator.cpp:
18869 (JSC::WREC::Generator::generateIncrementIndex): Added support for
18870 jumping to a failure label in the case where the index has reached "end
18871 of input."
18872
18873 (JSC::WREC::Generator::generatePatternCharacterSequence):
18874 (JSC::WREC::Generator::generatePatternCharacterPair): This is the
18875 optmization. It's basically like generatePatternCharacter, but it runs two
18876 characters at a time.
18877
18878 (JSC::WREC::Generator::generatePatternCharacter): Changed to use isASCII,
18879 since it's clearer than comparing to a magic hex value.
18880
18881 * wrec/WRECGenerator.h:
18882
18883 2008-12-03 Gavin Barraclough <barraclough@apple.com>
18884
18885 Reviewed by Cameron Zwarich.
18886
18887 Allow JIT to operate without the call-repatching optimization.
18888 Controlled by ENABLE(JIT_OPTIMIZE_CALL), defaults on, disabling
18889 this leads to significant performance regression.
18890
18891 https://bugs.webkit.org/show_bug.cgi?id=22639
18892
18893 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
18894 * JavaScriptCore.xcodeproj/project.pbxproj:
18895 * jit/JIT.cpp:
18896 (JSC::JIT::privateCompileSlowCases):
18897 * jit/JIT.h:
18898 * jit/JITCall.cpp: Copied from jit/JIT.cpp.
18899 (JSC::JIT::compileOpCallInitializeCallFrame):
18900 (JSC::JIT::compileOpCallSetupArgs):
18901 (JSC::JIT::compileOpCallEvalSetupArgs):
18902 (JSC::JIT::compileOpConstructSetupArgs):
18903 (JSC::JIT::compileOpCall):
18904 (JSC::JIT::compileOpCallSlowCase):
18905 (JSC::unreachable):
18906 * jit/JITInlineMethods.h: Copied from jit/JIT.cpp.
18907 (JSC::JIT::checkStructure):
18908 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
18909 (JSC::JIT::emitTagAsBoolImmediate):
18910 * wtf/Platform.h:
18911
18912 2008-12-03 Eric Seidel <eric@webkit.org>
18913
18914 Rubber-stamped by David Hyatt.
18915
18916 Make HAVE_ACCESSIBILITY only define if !defined
18917
18918 * wtf/Platform.h:
18919
18920 2008-12-03 Sam Weinig <sam@webkit.org>
18921
18922 Fix build.
18923
18924 * assembler/X86Assembler.h:
18925 (JSC::X86Assembler::orl_i32r):
18926
18927 2008-12-03 Sam Weinig <sam@webkit.org>
18928
18929 Reviewed by Geoffrey Garen.
18930
18931 Remove shared AssemblerBuffer 1MB buffer and instead give AssemblerBuffer
18932 an 256 byte inline capacity.
18933
18934 1% progression on Sunspider.
18935
18936 * assembler/AssemblerBuffer.h:
18937 (JSC::AssemblerBuffer::AssemblerBuffer):
18938 (JSC::AssemblerBuffer::~AssemblerBuffer):
18939 (JSC::AssemblerBuffer::grow):
18940 * assembler/MacroAssembler.h:
18941 (JSC::MacroAssembler::MacroAssembler):
18942 * assembler/X86Assembler.h:
18943 (JSC::X86Assembler::X86Assembler):
18944 * interpreter/Interpreter.cpp:
18945 (JSC::Interpreter::Interpreter):
18946 * interpreter/Interpreter.h:
18947 * jit/JIT.cpp:
18948 (JSC::JIT::JIT):
18949 * parser/Nodes.cpp:
18950 (JSC::RegExpNode::emitBytecode):
18951 * runtime/RegExp.cpp:
18952 (JSC::RegExp::RegExp):
18953 (JSC::RegExp::create):
18954 * runtime/RegExp.h:
18955 * runtime/RegExpConstructor.cpp:
18956 (JSC::constructRegExp):
18957 * runtime/RegExpPrototype.cpp:
18958 (JSC::regExpProtoFuncCompile):
18959 * runtime/StringPrototype.cpp:
18960 (JSC::stringProtoFuncMatch):
18961 (JSC::stringProtoFuncSearch):
18962 * wrec/WREC.cpp:
18963 (JSC::WREC::Generator::compileRegExp):
18964 * wrec/WRECGenerator.h:
18965 (JSC::WREC::Generator::Generator):
18966 * wrec/WRECParser.h:
18967 (JSC::WREC::Parser::Parser):
18968
18969 2008-12-03 Geoffrey Garen <ggaren@apple.com>
18970
18971 Reviewed by Oliver Hunt, with help from Gavin Barraclough.
18972
18973 orl_i32r was actually coded as an 8bit OR. So, I renamed orl_i32r to
18974 orl_i8r, changed all orl_i32r clients to use orl_i8r, and then added
18975 a new orl_i32r that actually does a 32bit OR.
18976
18977 (32bit OR is currently unused, but a patch I'm working on uses it.)
18978
18979 * assembler/MacroAssembler.h:
18980 (JSC::MacroAssembler::or32): Updated to choose between 8bit and 32bit OR.
18981
18982 * assembler/X86Assembler.h:
18983 (JSC::X86Assembler::orl_i8r): The old orl_i32r.
18984 (JSC::X86Assembler::orl_i32r): The new orl_i32r.
18985
18986 * jit/JIT.cpp:
18987 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
18988 (JSC::JIT::emitTagAsBoolImmediate): Use orl_i8r, since we're ORing 8bit
18989 values.
18990
18991 2008-12-03 Dean Jackson <dino@apple.com>
18992
18993 Reviewed by Dan Bernstein.
18994
18995 Helper functions for turn -> degrees.
18996 https://bugs.webkit.org/show_bug.cgi?id=22497
18997
18998 * wtf/MathExtras.h:
18999 (turn2deg):
19000 (deg2turn):
19001
19002 2008-12-02 Cameron Zwarich <zwarich@apple.com>
19003
19004 Reviewed by Geoff Garen.
19005
19006 Bug 22504: Crashes during code generation occur due to refing of ignoredResult()
19007 <https://bugs.webkit.org/show_bug.cgi?id=22504>
19008
19009 Since ignoredResult() was implemented by casting 1 to a RegisterID*, any
19010 attempt to ref ignoredResult() results in a crash. This will occur in
19011 code generation of a function body where a node emits another node with
19012 the dst that was passed to it, and then refs the returned RegisterID*.
19013
19014 To fix this problem, make ignoredResult() a member function of
19015 BytecodeGenerator that simply returns a pointe to a fixed RegisterID
19016 member of BytecodeGenerator.
19017
19018 * bytecompiler/BytecodeGenerator.h:
19019 (JSC::BytecodeGenerator::ignoredResult):
19020 * bytecompiler/RegisterID.h:
19021 * parser/Nodes.cpp:
19022 (JSC::NullNode::emitBytecode):
19023 (JSC::BooleanNode::emitBytecode):
19024 (JSC::NumberNode::emitBytecode):
19025 (JSC::StringNode::emitBytecode):
19026 (JSC::RegExpNode::emitBytecode):
19027 (JSC::ThisNode::emitBytecode):
19028 (JSC::ResolveNode::emitBytecode):
19029 (JSC::ObjectLiteralNode::emitBytecode):
19030 (JSC::PostfixResolveNode::emitBytecode):
19031 (JSC::PostfixBracketNode::emitBytecode):
19032 (JSC::PostfixDotNode::emitBytecode):
19033 (JSC::DeleteValueNode::emitBytecode):
19034 (JSC::VoidNode::emitBytecode):
19035 (JSC::TypeOfResolveNode::emitBytecode):
19036 (JSC::TypeOfValueNode::emitBytecode):
19037 (JSC::PrefixResolveNode::emitBytecode):
19038 (JSC::AssignResolveNode::emitBytecode):
19039 (JSC::CommaNode::emitBytecode):
19040 (JSC::ForNode::emitBytecode):
19041 (JSC::ForInNode::emitBytecode):
19042 (JSC::ReturnNode::emitBytecode):
19043 (JSC::ThrowNode::emitBytecode):
19044 (JSC::FunctionBodyNode::emitBytecode):
19045 (JSC::FuncDeclNode::emitBytecode):
19046
19047 2008-12-02 Geoffrey Garen <ggaren@apple.com>
19048
19049 Reviewed by Cameron Zwarich.
19050
19051 Fixed https://bugs.webkit.org/show_bug.cgi?id=22537
19052 REGRESSION (r38745): Assertion failure in jsSubstring() at ge.com
19053
19054 The bug was that index would become greater than length, so our
19055 "end of input" checks, which all check "index == length", would fail.
19056
19057 The solution is to check for end of input before incrementing index,
19058 to ensure that index is always <= length.
19059
19060 As a side benefit, generateJumpIfEndOfInput can now use je instead of
19061 jg, which should be slightly faster.
19062
19063 * wrec/WREC.cpp:
19064 (JSC::WREC::Generator::compileRegExp):
19065 * wrec/WRECGenerator.cpp:
19066 (JSC::WREC::Generator::generateJumpIfEndOfInput):
19067
19068 2008-12-02 Gavin Barraclough <barraclough@apple.com>
19069
19070 Reviewed by Geoffrey Garen.
19071
19072 Plant shift right immediate instructions, which are awesome.
19073 https://bugs.webkit.org/show_bug.cgi?id=22610
19074 ~5% on the v8-crypto test.
19075
19076 * jit/JIT.cpp:
19077 (JSC::JIT::privateCompileMainPass):
19078 (JSC::JIT::privateCompileSlowCases):
19079
19080 2008-12-02 Geoffrey Garen <ggaren@apple.com>
19081
19082 Reviewed by Sam Weinig.
19083
19084 Cleaned up SegmentedVector by abstracting segment access into helper
19085 functions.
19086
19087 SunSpider reports no change.
19088
19089 * bytecompiler/SegmentedVector.h:
19090 (JSC::SegmentedVector::SegmentedVector):
19091 (JSC::SegmentedVector::~SegmentedVector):
19092 (JSC::SegmentedVector::size):
19093 (JSC::SegmentedVector::at):
19094 (JSC::SegmentedVector::operator[]):
19095 (JSC::SegmentedVector::last):
19096 (JSC::SegmentedVector::append):
19097 (JSC::SegmentedVector::removeLast):
19098 (JSC::SegmentedVector::grow):
19099 (JSC::SegmentedVector::clear):
19100 (JSC::SegmentedVector::deleteAllSegments):
19101 (JSC::SegmentedVector::segmentFor):
19102 (JSC::SegmentedVector::subscriptFor):
19103 (JSC::SegmentedVector::ensureSegmentsFor):
19104 (JSC::SegmentedVector::ensureSegment):
19105
19106 2008-12-02 Geoffrey Garen <ggaren@apple.com>
19107
19108 Reviewed by Geoffrey Garen. (Patch by Cameron Zwarich <zwarich@apple.com>.)
19109
19110 Fixed https://bugs.webkit.org/show_bug.cgi?id=22482
19111 REGRESSION (r37991): Occasionally see "Scene rendered incorrectly"
19112 message when running the V8 Raytrace benchmark
19113
19114 Rolled out r37991. It didn't properly save xmm0, which is caller-save,
19115 before calling helper functions.
19116
19117 SunSpider and v8 benchmarks show little change -- possibly a .2%
19118 SunSpider regression, possibly a .2% v8 benchmark speedup.
19119
19120 * assembler/X86Assembler.h:
19121 (JSC::X86Assembler::):
19122 * bytecode/CodeBlock.cpp:
19123 (JSC::CodeBlock::dump):
19124 * bytecode/Instruction.h:
19125 (JSC::Instruction::):
19126 * bytecompiler/BytecodeGenerator.cpp:
19127 (JSC::BytecodeGenerator::emitUnaryOp):
19128 * bytecompiler/BytecodeGenerator.h:
19129 (JSC::BytecodeGenerator::emitToJSNumber):
19130 (JSC::BytecodeGenerator::emitTypeOf):
19131 (JSC::BytecodeGenerator::emitGetPropertyNames):
19132 * interpreter/Interpreter.cpp:
19133 (JSC::Interpreter::privateExecute):
19134 * interpreter/Interpreter.h:
19135 * jit/JIT.cpp:
19136 (JSC::JIT::privateCompileMainPass):
19137 (JSC::JIT::privateCompileSlowCases):
19138 * jit/JIT.h:
19139 * parser/Nodes.cpp:
19140 (JSC::UnaryOpNode::emitBytecode):
19141 (JSC::BinaryOpNode::emitBytecode):
19142 (JSC::EqualNode::emitBytecode):
19143 * parser/ResultType.h:
19144 (JSC::ResultType::isReusable):
19145 (JSC::ResultType::mightBeNumber):
19146 * runtime/JSNumberCell.h:
19147
19148 2008-12-01 Gavin Barraclough <barraclough@apple.com>
19149
19150 Reviewed by Geoffrey Garen.
19151
19152 Remove unused (sampling only, and derivable) argument to JIT::emitCTICall.
19153 https://bugs.webkit.org/show_bug.cgi?id=22587
19154
19155 * jit/JIT.cpp:
19156 (JSC::JIT::emitCTICall):
19157 (JSC::JIT::compileOpCall):
19158 (JSC::JIT::emitSlowScriptCheck):
19159 (JSC::JIT::compileBinaryArithOpSlowCase):
19160 (JSC::JIT::privateCompileMainPass):
19161 (JSC::JIT::privateCompileSlowCases):
19162 (JSC::JIT::privateCompile):
19163 * jit/JIT.h:
19164
19165 2008-12-02 Dimitri Glazkov <dglazkov@chromium.org>
19166
19167 Reviewed by Eric Seidel.
19168
19169 Fix the inheritance chain for JSFunction.
19170
19171 * runtime/JSFunction.cpp:
19172 (JSC::JSFunction::info): Add InternalFunction::info as parent class
19173
19174 2008-12-02 Simon Hausmann <hausmann@webkit.org>
19175
19176 Reviewed by Tor Arne Vestbø.
19177
19178 Fix ability to include JavaScriptCore.pri from other .pro files.
19179
19180 * JavaScriptCore.pri: Moved -O3 setting into the .pro files.
19181 * JavaScriptCore.pro:
19182 * jsc.pro:
19183
19184 2008-12-01 Geoffrey Garen <ggaren@apple.com>
19185
19186 Reviewed by Cameron Zwarich, with help from Gavin Barraclough.
19187
19188 Fixed https://bugs.webkit.org/show_bug.cgi?id=22583.
19189
19190 Refactored regular expression parsing to parse sequences of characters
19191 as a single unit, in preparation for optimizing sequences of characters.
19192
19193 SunSpider reports no change.
19194
19195 * JavaScriptCore.xcodeproj/project.pbxproj:
19196 * wrec/Escapes.h: Added. Set of classes for representing an escaped
19197 token in a pattern.
19198
19199 * wrec/Quantifier.h:
19200 (JSC::WREC::Quantifier::Quantifier): Simplified this constructor slightly,
19201 to match the new Escape constructor.
19202
19203 * wrec/WRECGenerator.cpp:
19204 (JSC::WREC::Generator::generatePatternCharacterSequence):
19205 * wrec/WRECGenerator.h: Added an interface for generating a sequence
19206 of pattern characters at a time. It doesn't do anything special yet.
19207
19208 * wrec/WRECParser.cpp:
19209 (JSC::WREC::Parser::consumeGreedyQuantifier):
19210 (JSC::WREC::Parser::consumeQuantifier): Renamed "parse" to "consume" in
19211 these functions, to match "consumeEscape."
19212
19213 (JSC::WREC::Parser::parsePatternCharacterSequence): New function for
19214 iteratively aggregating a sequence of characters in a pattern.
19215
19216 (JSC::WREC::Parser::parseCharacterClassQuantifier):
19217 (JSC::WREC::Parser::parseBackreferenceQuantifier): Renamed "parse" to
19218 "consume" in these functions, to match "consumeEscape."
19219
19220 (JSC::WREC::Parser::parseCharacterClass): Refactored to use the common
19221 escape processing code in consumeEscape.
19222
19223 (JSC::WREC::Parser::parseEscape): Refactored to use the common
19224 escape processing code in consumeEscape.
19225
19226 (JSC::WREC::Parser::consumeEscape): Factored escaped token processing
19227 into a common function, since we were doing this in a few places.
19228
19229 (JSC::WREC::Parser::parseTerm): Refactored to use the common
19230 escape processing code in consumeEscape.
19231
19232 * wrec/WRECParser.h:
19233 (JSC::WREC::Parser::consumeOctal): Refactored to use a helper function
19234 for reading a digit.
19235
19236 2008-12-01 Cameron Zwarich <zwarich@apple.com>
19237
19238 Reviewed by Oliver Hunt.
19239
19240 Bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
19241 <https://bugs.webkit.org/show_bug.cgi?id=20340>
19242
19243 SegmentedVector currently frees segments and reallocates them when used
19244 as a stack. This can lead to unsafe use of pointers into freed segments.
19245
19246 In order to fix this problem, SegmentedVector will be changed to only
19247 grow and never shrink. Also, rename the reserveCapacity() member
19248 function to grow() to match the actual usage in BytecodeGenerator, where
19249 this function is used to allocate a group of registers at once, rather
19250 than merely saving space for them.
19251
19252 * bytecompiler/BytecodeGenerator.cpp:
19253 (JSC::BytecodeGenerator::BytecodeGenerator): Use grow() instead of
19254 reserveCapacity().
19255 * bytecompiler/SegmentedVector.h:
19256 (JSC::SegmentedVector::SegmentedVector):
19257 (JSC::SegmentedVector::last):
19258 (JSC::SegmentedVector::append):
19259 (JSC::SegmentedVector::removeLast):
19260 (JSC::SegmentedVector::grow): Renamed from reserveCapacity().
19261 (JSC::SegmentedVector::clear):
19262
19263 2008-12-01 Mark Rowe <mrowe@apple.com>
19264
19265 Rubber-stamped by Anders Carlsson.
19266
19267 Disable WREC for x86_64 since memory allocated by the system allocator is not marked executable,
19268 which causes 64-bit debug builds to crash. Once we have a dedicated allocator for executable
19269 memory we can turn this back on.
19270
19271 * wtf/Platform.h:
19272
19273 2008-12-01 Antti Koivisto <antti@apple.com>
19274
19275 Reviewed by Maciej Stachowiak.
19276
19277 Restore inline buffer after vector is shrunk back below its inline capacity.
19278
19279 * wtf/Vector.h:
19280 (WTF::):
19281 (WTF::VectorBuffer::restoreInlineBufferIfNeeded):
19282 (WTF::::shrinkCapacity):
19283
19284 2008-11-30 Antti Koivisto <antti@apple.com>
19285
19286 Reviewed by Mark Rowe.
19287
19288 Try to return free pages in the current thread cache too.
19289
19290 * wtf/FastMalloc.cpp:
19291 (WTF::TCMallocStats::releaseFastMallocFreeMemory):
19292
19293 2008-12-01 David Levin <levin@chromium.org>
19294
19295 Reviewed by Alexey Proskuryakov.
19296
19297 https://bugs.webkit.org/show_bug.cgi?id=22567
19298 Make HashTable work as expected with respect to threads. Specifically, it has class-level
19299 thread safety and constant methods work on constant objects without synchronization.
19300
19301 No observable change in behavior, so no test. This only affects debug builds.
19302
19303 * wtf/HashTable.cpp:
19304 (WTF::hashTableStatsMutex):
19305 (WTF::HashTableStats::~HashTableStats):
19306 (WTF::HashTableStats::recordCollisionAtCount):
19307 Guarded variable access with a mutex.
19308
19309 * wtf/HashTable.h:
19310 (WTF::::lookup):
19311 (WTF::::lookupForWriting):
19312 (WTF::::fullLookupForWriting):
19313 (WTF::::add):
19314 (WTF::::reinsert):
19315 (WTF::::remove):
19316 (WTF::::rehash):
19317 Changed increments of static variables to use atomicIncrement.
19318
19319 (WTF::::invalidateIterators):
19320 (WTF::addIterator):
19321 (WTF::removeIterator):
19322 Guarded mutable access with a mutex.
19323
19324 2008-11-29 Gavin Barraclough <barraclough@apple.com>
19325
19326 Reviewed by Cameron Zwarich.
19327
19328 Enable WREC on PLATFORM(X86_64). This change predominantly requires changes to the
19329 WREC::Generator::generateEnter method to support the x86-64 ABI, and addition of
19330 support for a limited number of quadword operations in the X86Assembler.
19331
19332 This patch will cause the JS heap to be allocated with RWX permissions on 64-bit Mac
19333 platforms. This is a regression with respect to previous 64-bit behaviour, but is no
19334 more permissive than on 32-bit builds. This issue should be addressed at some point.
19335 (This is tracked by bug #21783.)
19336
19337 https://bugs.webkit.org/show_bug.cgi?id=22554
19338 Greater than 4x speedup on regexp-dna, on x86-64.
19339
19340 * assembler/MacroAssembler.h:
19341 (JSC::MacroAssembler::addPtr):
19342 (JSC::MacroAssembler::loadPtr):
19343 (JSC::MacroAssembler::storePtr):
19344 (JSC::MacroAssembler::pop):
19345 (JSC::MacroAssembler::push):
19346 (JSC::MacroAssembler::move):
19347 * assembler/X86Assembler.h:
19348 (JSC::X86Assembler::):
19349 (JSC::X86Assembler::movq_rr):
19350 (JSC::X86Assembler::addl_i8m):
19351 (JSC::X86Assembler::addl_i32r):
19352 (JSC::X86Assembler::addq_i8r):
19353 (JSC::X86Assembler::addq_i32r):
19354 (JSC::X86Assembler::movq_mr):
19355 (JSC::X86Assembler::movq_rm):
19356 * wrec/WREC.h:
19357 * wrec/WRECGenerator.cpp:
19358 (JSC::WREC::Generator::generateEnter):
19359 (JSC::WREC::Generator::generateReturnSuccess):
19360 (JSC::WREC::Generator::generateReturnFailure):
19361 * wtf/Platform.h:
19362 * wtf/TCSystemAlloc.cpp:
19363
19364 2008-12-01 Cameron Zwarich <zwarich@apple.com>
19365
19366 Reviewed by Sam Weinig.
19367
19368 Preliminary work for bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
19369 <https://bugs.webkit.org/show_bug.cgi?id=20340>
19370
19371 SegmentedVector currently frees segments and reallocates them when used
19372 as a stack. This can lead to unsafe use of pointers into freed segments.
19373
19374 In order to fix this problem, SegmentedVector will be changed to only
19375 grow and never shrink, with the sole exception of clearing all of its
19376 data, a capability that is required by Lexer. This patch changes the
19377 public interface to only allow for these capabilities.
19378
19379 * bytecompiler/BytecodeGenerator.cpp:
19380 (JSC::BytecodeGenerator::BytecodeGenerator): Use reserveCapacity()
19381 instead of resize() for m_globals and m_parameters.
19382 * bytecompiler/SegmentedVector.h:
19383 (JSC::SegmentedVector::resize): Removed.
19384 (JSC::SegmentedVector::reserveCapacity): Added.
19385 (JSC::SegmentedVector::clear): Added.
19386 (JSC::SegmentedVector::shrink): Removed.
19387 (JSC::SegmentedVector::grow): Removed.
19388 * parser/Lexer.cpp:
19389 (JSC::Lexer::clear): Use clear() instead of resize(0).
19390
19391 2008-11-30 Sam Weinig <sam@webkit.org>
19392
19393 Reviewed by Mark Rowe.
19394
19395 Renames jumps to m_jumps in JumpList.
19396
19397 * assembler/MacroAssembler.h:
19398 (JSC::MacroAssembler::JumpList::link):
19399 (JSC::MacroAssembler::JumpList::linkTo):
19400 (JSC::MacroAssembler::JumpList::append):
19401
19402 2008-11-30 Antti Koivisto <antti@apple.com>
19403
19404 Reviewed by Mark Rowe.
19405
19406 https://bugs.webkit.org/show_bug.cgi?id=22557
19407
19408 Report free size in central and thread caches too.
19409
19410 * wtf/FastMalloc.cpp:
19411 (WTF::TCMallocStats::fastMallocStatistics):
19412 * wtf/FastMalloc.h:
19413
19414 2008-11-29 Antti Koivisto <antti@apple.com>
19415
19416 Reviewed by Dan Bernstein.
19417
19418 https://bugs.webkit.org/show_bug.cgi?id=22557
19419 Add statistics for JavaScript GC heap.
19420
19421 * JavaScriptCore.exp:
19422 * runtime/Collector.cpp:
19423 (JSC::Heap::objectCount):
19424 (JSC::addToStatistics):
19425 (JSC::Heap::statistics):
19426 * runtime/Collector.h:
19427
19428 2008-11-29 Antti Koivisto <antti@apple.com>
19429
19430 Fix debug build by adding a stub method.
19431
19432 * wtf/FastMalloc.cpp:
19433 (WTF::fastMallocStatistics):
19434
19435 2008-11-29 Antti Koivisto <antti@apple.com>
19436
19437 Reviewed by Alexey Proskuryakov.
19438
19439 https://bugs.webkit.org/show_bug.cgi?id=22557
19440
19441 Add function for getting basic statistics from FastMalloc.
19442
19443 * JavaScriptCore.exp:
19444 * wtf/FastMalloc.cpp:
19445 (WTF::DLL_Length):
19446 (WTF::TCMalloc_PageHeap::ReturnedBytes):
19447 (WTF::TCMallocStats::fastMallocStatistics):
19448 * wtf/FastMalloc.h:
19449
19450 2008-11-29 Cameron Zwarich <zwarich@apple.com>
19451
19452 Not reviewed.
19453
19454 The C++ standard does not automatically grant the friendships of an
19455 enclosing class to its nested subclasses, so we should do so explicitly.
19456 This fixes the GCC 4.0 build, although both GCC 4.2 and Visual C++ 2005
19457 accept the incorrect code as it is.
19458
19459 * assembler/MacroAssembler.h:
19460
19461 2008-11-29 Gavin Barraclough <barraclough@apple.com>
19462
19463 Reviewed by Cameron Zwarich.
19464
19465 Add the class MacroAssembler to provide some abstraction of code generation,
19466 and change WREC to make use of this class, rather than directly accessing
19467 the X86Assembler.
19468
19469 This patch also allows WREC to be compiled without the rest of the JIT enabled.
19470
19471 * JavaScriptCore.xcodeproj/project.pbxproj:
19472 * assembler/MacroAssembler.h: Added.
19473 (JSC::MacroAssembler::):
19474 (JSC::MacroAssembler::MacroAssembler):
19475 (JSC::MacroAssembler::copyCode):
19476 (JSC::MacroAssembler::Address::Address):
19477 (JSC::MacroAssembler::ImplicitAddress::ImplicitAddress):
19478 (JSC::MacroAssembler::BaseIndex::BaseIndex):
19479 (JSC::MacroAssembler::Label::Label):
19480 (JSC::MacroAssembler::Jump::Jump):
19481 (JSC::MacroAssembler::Jump::link):
19482 (JSC::MacroAssembler::Jump::linkTo):
19483 (JSC::MacroAssembler::JumpList::link):
19484 (JSC::MacroAssembler::JumpList::linkTo):
19485 (JSC::MacroAssembler::JumpList::append):
19486 (JSC::MacroAssembler::Imm32::Imm32):
19487 (JSC::MacroAssembler::add32):
19488 (JSC::MacroAssembler::or32):
19489 (JSC::MacroAssembler::sub32):
19490 (JSC::MacroAssembler::loadPtr):
19491 (JSC::MacroAssembler::load32):
19492 (JSC::MacroAssembler::load16):
19493 (JSC::MacroAssembler::storePtr):
19494 (JSC::MacroAssembler::store32):
19495 (JSC::MacroAssembler::pop):
19496 (JSC::MacroAssembler::push):
19497 (JSC::MacroAssembler::peek):
19498 (JSC::MacroAssembler::poke):
19499 (JSC::MacroAssembler::move):
19500 (JSC::MacroAssembler::compareImm32ForBranch):
19501 (JSC::MacroAssembler::compareImm32ForBranchEquality):
19502 (JSC::MacroAssembler::jae32):
19503 (JSC::MacroAssembler::je32):
19504 (JSC::MacroAssembler::je16):
19505 (JSC::MacroAssembler::jg32):
19506 (JSC::MacroAssembler::jge32):
19507 (JSC::MacroAssembler::jl32):
19508 (JSC::MacroAssembler::jle32):
19509 (JSC::MacroAssembler::jne32):
19510 (JSC::MacroAssembler::jump):
19511 (JSC::MacroAssembler::breakpoint):
19512 (JSC::MacroAssembler::ret):
19513 * assembler/X86Assembler.h:
19514 (JSC::X86Assembler::cmpw_rm):
19515 * interpreter/Interpreter.cpp:
19516 (JSC::Interpreter::Interpreter):
19517 * interpreter/Interpreter.h:
19518 (JSC::Interpreter::assemblerBuffer):
19519 * runtime/RegExp.cpp:
19520 (JSC::RegExp::RegExp):
19521 * wrec/WREC.cpp:
19522 (JSC::WREC::Generator::compileRegExp):
19523 * wrec/WREC.h:
19524 * wrec/WRECFunctors.cpp:
19525 (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom):
19526 (JSC::WREC::GenerateCharacterClassFunctor::generateAtom):
19527 (JSC::WREC::GenerateBackreferenceFunctor::generateAtom):
19528 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
19529 * wrec/WRECFunctors.h:
19530 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
19531 * wrec/WRECGenerator.cpp:
19532 (JSC::WREC::Generator::generateEnter):
19533 (JSC::WREC::Generator::generateReturnSuccess):
19534 (JSC::WREC::Generator::generateSaveIndex):
19535 (JSC::WREC::Generator::generateIncrementIndex):
19536 (JSC::WREC::Generator::generateLoadCharacter):
19537 (JSC::WREC::Generator::generateJumpIfEndOfInput):
19538 (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
19539 (JSC::WREC::Generator::generateReturnFailure):
19540 (JSC::WREC::Generator::generateBacktrack1):
19541 (JSC::WREC::Generator::generateBacktrackBackreference):
19542 (JSC::WREC::Generator::generateBackreferenceQuantifier):
19543 (JSC::WREC::Generator::generateNonGreedyQuantifier):
19544 (JSC::WREC::Generator::generateGreedyQuantifier):
19545 (JSC::WREC::Generator::generatePatternCharacter):
19546 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
19547 (JSC::WREC::Generator::generateCharacterClassInverted):
19548 (JSC::WREC::Generator::generateCharacterClass):
19549 (JSC::WREC::Generator::generateParentheses):
19550 (JSC::WREC::Generator::generateParenthesesNonGreedy):
19551 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
19552 (JSC::WREC::Generator::generateAssertionBOL):
19553 (JSC::WREC::Generator::generateAssertionEOL):
19554 (JSC::WREC::Generator::generateAssertionWordBoundary):
19555 (JSC::WREC::Generator::generateBackreference):
19556 (JSC::WREC::Generator::terminateAlternative):
19557 (JSC::WREC::Generator::terminateDisjunction):
19558 * wrec/WRECGenerator.h:
19559 (JSC::WREC::Generator::Generator):
19560 * wrec/WRECParser.cpp:
19561 (JSC::WREC::Parser::parsePatternCharacterQualifier):
19562 (JSC::WREC::Parser::parseCharacterClassQuantifier):
19563 (JSC::WREC::Parser::parseBackreferenceQuantifier):
19564 (JSC::WREC::Parser::parseParentheses):
19565 (JSC::WREC::Parser::parseCharacterClass):
19566 (JSC::WREC::Parser::parseOctalEscape):
19567 (JSC::WREC::Parser::parseEscape):
19568 (JSC::WREC::Parser::parseTerm):
19569 (JSC::WREC::Parser::parseDisjunction):
19570 * wrec/WRECParser.h:
19571 (JSC::WREC::Parser::Parser):
19572 (JSC::WREC::Parser::parsePattern):
19573 (JSC::WREC::Parser::parseAlternative):
19574 * wtf/Platform.h:
19575
19576 2008-11-28 Simon Hausmann <hausmann@webkit.org>
19577
19578 Reviewed by Tor Arne Vestbø.
19579
19580 Fix compilation on Windows CE
19581
19582 Port away from the use of errno after calling strtol(), instead
19583 detect conversion errors by checking the result and the stop
19584 position.
19585
19586 * runtime/DateMath.cpp:
19587 (JSC::parseLong):
19588 (JSC::parseDate):
19589
19590 2008-11-28 Joerg Bornemann <joerg.bornemann@trolltech.com>
19591
19592 Reviewed by Simon Hausmann.
19593
19594 Implement lowResUTCTime() on Windows CE using GetSystemTime as _ftime() is not available.
19595
19596 * runtime/DateMath.cpp:
19597 (JSC::lowResUTCTime):
19598
19599 2008-11-28 Simon Hausmann <hausmann@webkit.org>
19600
19601 Rubber-stamped by Tor Arne Vestbø.
19602
19603 Removed unnecessary inclusion of errno.h, which also fixes compilation on Windows CE.
19604
19605 * runtime/JSGlobalObjectFunctions.cpp:
19606
19607 2008-11-27 Cameron Zwarich <zwarich@apple.com>
19608
19609 Not reviewed.
19610
19611 r38825 made JSFunction::m_body private, but some inspector code in
19612 WebCore sets the field. Add setters for it.
19613
19614 * runtime/JSFunction.h:
19615 (JSC::JSFunction::setBody):
19616
19617 2008-11-27 Sam Weinig <sam@webkit.org>
19618
19619 Reviewed by Cameron Zwarich.
19620
19621 Fix FIXME by adding accessor for JSFunction's m_body property.
19622
19623 * interpreter/Interpreter.cpp:
19624 (JSC::Interpreter::cti_op_call_JSFunction):
19625 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
19626 (JSC::Interpreter::cti_vm_lazyLinkCall):
19627 * profiler/Profiler.cpp:
19628 (JSC::createCallIdentifierFromFunctionImp):
19629 * runtime/Arguments.h:
19630 (JSC::Arguments::getArgumentsData):
19631 (JSC::Arguments::Arguments):
19632 * runtime/FunctionPrototype.cpp:
19633 (JSC::functionProtoFuncToString):
19634 * runtime/JSFunction.h:
19635 (JSC::JSFunction::JSFunction):
19636 (JSC::JSFunction::body):
19637
19638 2008-11-27 Sam Weinig <sam@webkit.org>
19639
19640 Reviewed by Oliver Hunt.
19641
19642 Remove unused member variables from ProgramNode.
19643
19644 * parser/Nodes.h:
19645
19646 2008-11-27 Brent Fulgham <bfulgham@gmail.com>
19647
19648 Reviewed by Alexey Proskuryakov.
19649
19650 Enable mouse panning feaure on Windows Cairo build.
19651 See http://bugs.webkit.org/show_bug.cgi?id=22525
19652
19653 * wtf/Platform.h: Enable mouse panning feaure on Windows Cairo build.
19654
19655 2008-11-27 Alp Toker <alp@nuanti.com>
19656
19657 Change recently introduced C++ comments in Platform.h to C comments to
19658 fix the minidom build with traditional C.
19659
19660 Build GtkLauncher and minidom with the '-ansi' compiler flag to detect
19661 API header breakage at build time.
19662
19663 * GNUmakefile.am:
19664 * wtf/Platform.h:
19665
19666 2008-11-27 Alp Toker <alp@nuanti.com>
19667
19668 Remove C++ comment from JavaScriptCore API headers (introduced r35449).
19669 Fixes build for ANSI C applications using the public API.
19670
19671 * API/WebKitAvailability.h:
19672
19673 2008-11-26 Eric Seidel <eric@webkit.org>
19674
19675 No review, build fix only.
19676
19677 Fix the JSC Chromium Mac build by adding JavaScriptCore/icu into the include path
19678
19679 * JavaScriptCore.scons:
19680
19681 2008-11-25 Cameron Zwarich <zwarich@apple.com>
19682
19683 Reviewed by Maciej Stachowiak.
19684
19685 Remove the unused member function JSFunction::getParameterName().
19686
19687 * runtime/JSFunction.cpp:
19688 * runtime/JSFunction.h:
19689
19690 2008-11-24 Gavin Barraclough <barraclough@apple.com>
19691
19692 Reviewed by Geoff Garen.
19693
19694 Polymorpic caching for get by id chain. Similar to the polymorphic caching already implemented
19695 for self and proto accesses (implemented by allowing multiple trampolines to be JIT genertaed,
19696 and linked together) - the get by id chain caching is implemented as a genericization of the
19697 proto list caching, allowing cached access lists to contain a mix of proto and proto chain
19698 accesses (since in JS style inheritance hierarchies you may commonly see a mix of properties
19699 being overridden on the direct prototype, or higher up its prototype chain).
19700
19701 In order to allow this patch to compile there is a fix to appease gcc 4.2 compiler issues
19702 (removing the jumps between fall-through cases in privateExecute).
19703
19704 This patch also removes redundant immediate checking from the reptach code, and fixes a related
19705 memory leak (failure to deallocate trampolines).
19706
19707 ~2% progression on v8 tests (bulk on the win on deltablue)
19708
19709 * bytecode/Instruction.h:
19710 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::):
19711 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
19712 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
19713 (JSC::PolymorphicAccessStructureList::derefStructures):
19714 * interpreter/Interpreter.cpp:
19715 (JSC::countPrototypeChainEntriesAndCheckForProxies):
19716 (JSC::Interpreter::tryCacheGetByID):
19717 (JSC::Interpreter::privateExecute):
19718 (JSC::Interpreter::tryCTICacheGetByID):
19719 (JSC::Interpreter::cti_op_get_by_id_self_fail):
19720 (JSC::getPolymorphicAccessStructureListSlot):
19721 (JSC::Interpreter::cti_op_get_by_id_proto_list):
19722 * interpreter/Interpreter.h:
19723 * jit/JIT.cpp:
19724 (JSC::JIT::privateCompileGetByIdProto):
19725 (JSC::JIT::privateCompileGetByIdSelfList):
19726 (JSC::JIT::privateCompileGetByIdProtoList):
19727 (JSC::JIT::privateCompileGetByIdChainList):
19728 (JSC::JIT::privateCompileGetByIdChain):
19729 (JSC::JIT::privateCompilePatchGetArrayLength):
19730 * jit/JIT.h:
19731 (JSC::JIT::compileGetByIdChainList):
19732
19733 2008-11-25 Cameron Zwarich <zwarich@apple.com>
19734
19735 Reviewed by Alexey Proskuryakov.
19736
19737 Move the collect() call in Heap::heapAllocate() that is conditionally
19738 compiled under COLLECT_ON_EVERY_ALLOCATION so that it is before we get
19739 information about the heap. This was causing assertion failures for me
19740 while I was reducing a bug.
19741
19742 * runtime/Collector.cpp:
19743 (JSC::Heap::heapAllocate):
19744
19745 2008-11-24 Cameron Zwarich <zwarich@apple.com>
19746
19747 Reviewed by Geoff Garen.
19748
19749 Bug 13790: Function declarations are not treated as statements (used to affect starcraft2.com)
19750 <https://bugs.webkit.org/show_bug.cgi?id=13790>
19751
19752 Modify the parser to treat function declarations as statements,
19753 simplifying the grammar in the process. Technically, according to the
19754 grammar in the ECMA spec, function declarations are not statements and
19755 can not be used everywhere that statements can, but it is not worth the
19756 possibility compatibility issues just to stick to the spec in this case.
19757
19758 * parser/Grammar.y:
19759 * parser/Nodes.cpp:
19760 (JSC::FuncDeclNode::emitBytecode): Avoid returning ignoredResult()
19761 as a result, because it causes a crash in DoWhileNode::emitBytecode().
19762
19763 2008-11-24 Geoffrey Garen <ggaren@apple.com>
19764
19765 Reviewed by Sam Weinig.
19766
19767 Unroll the regexp matching loop by 1. 10% speedup on simple matching
19768 stress test. No change on SunSpider.
19769
19770 (I decided not to unroll to arbitrary levels because the returns diminsh
19771 quickly.)
19772
19773 * wrec/WREC.cpp:
19774 (JSC::WREC::compileRegExp):
19775 * wrec/WRECGenerator.cpp:
19776 (JSC::WREC::Generator::generateJumpIfEndOfInput):
19777 (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
19778 * wrec/WRECGenerator.h:
19779 * wrec/WRECParser.h:
19780 (JSC::WREC::Parser::error):
19781 (JSC::WREC::Parser::parsePattern):
19782
19783 2008-11-24 Geoffrey Garen <ggaren@apple.com>
19784
19785 Reviewed by Sam Weinig.
19786
19787 Removed some unnecessary "Generator::" prefixes.
19788
19789 * wrec/WRECGenerator.cpp:
19790 (JSC::WREC::Generator::generateEnter):
19791 (JSC::WREC::Generator::generateReturnSuccess):
19792 (JSC::WREC::Generator::generateSaveIndex):
19793 (JSC::WREC::Generator::generateIncrementIndex):
19794 (JSC::WREC::Generator::generateLoopIfNotEndOfInput):
19795 (JSC::WREC::Generator::generateReturnFailure):
19796
19797 2008-11-24 Geoffrey Garen <ggaren@apple.com>
19798
19799 Reviewed by Sam Weinig.
19800
19801 Made a bunch of WREC::Parser functions private, and added an explicit
19802 "reset()" function, so a parser can be reused.
19803
19804 * wrec/WRECParser.h:
19805 (JSC::WREC::Parser::Parser):
19806 (JSC::WREC::Parser::generator):
19807 (JSC::WREC::Parser::ignoreCase):
19808 (JSC::WREC::Parser::multiline):
19809 (JSC::WREC::Parser::recordSubpattern):
19810 (JSC::WREC::Parser::numSubpatterns):
19811 (JSC::WREC::Parser::parsePattern):
19812 (JSC::WREC::Parser::parseAlternative):
19813 (JSC::WREC::Parser::reset):
19814
19815 2008-11-24 Gavin Barraclough <barraclough@apple.com>
19816
19817 Reviewed by Cameron Zwarich.
19818
19819 Implement repatching for get by id chain.
19820 Previously the access is performed in a function stub, in the repatch form
19821 the trampoline is not called to; instead the hot path is relinked to jump
19822 directly to the trampoline, if it fails it will jump to the slow case.
19823
19824 https://bugs.webkit.org/show_bug.cgi?id=22449
19825 3% progression on deltablue.
19826
19827 * jit/JIT.cpp:
19828 (JSC::JIT::privateCompileGetByIdProto):
19829 (JSC::JIT::privateCompileGetByIdChain):
19830
19831 2008-11-24 Joerg Bornemann <joerg.bornemann@trolltech.com>
19832
19833 Reviewed by Simon Hausmann.
19834
19835 https://bugs.webkit.org/show_bug.cgi?id=20746
19836
19837 Various small compilation fixes to make the Qt port of WebKit
19838 compile on Windows CE.
19839
19840 * config.h: Don't set _CRT_RAND_S for CE, it's not available.
19841 * jsc.cpp: Disabled use of debugger includes for CE. It
19842 does not have the debugging functions.
19843 * runtime/DateMath.cpp: Use localtime() on Windows CE.
19844 * wtf/Assertions.cpp: Compile on Windows CE without debugger.
19845 * wtf/Assertions.h: Include windows.h before defining ASSERT.
19846 * wtf/MathExtras.h: Include stdlib.h instead of xmath.h.
19847 * wtf/Platform.h: Disable ERRNO_H and detect endianess based
19848 on the Qt endianess. On Qt for Windows CE the endianess is
19849 defined by the vendor specific build spec.
19850 * wtf/Threading.h: Use the volatile-less atomic functions.
19851 * wtf/dtoa.cpp: Compile without errno.
19852 * wtf/win/MainThreadWin.cpp: Don't include windows.h on CE after
19853 Assertions.h due to the redefinition of ASSERT.
19854
19855 2008-11-22 Gavin Barraclough <barraclough@apple.com>
19856
19857 Reviewed by Cameron Zwarich.
19858
19859 Replace accidentally deleted immediate check from get by id chain trampoline.
19860 https://bugs.webkit.org/show_bug.cgi?id=22413
19861
19862 * jit/JIT.cpp:
19863 (JSC::JIT::privateCompileGetByIdChain):
19864
19865 2008-11-21 Gavin Barraclough <barraclough@apple.com>
19866
19867 Reviewed by Oliver Hunt.
19868
19869 Add (really) polymorphic caching for get by id self.
19870 Very similar to caching of prototype accesses, described below.
19871
19872 Oh, also, probably shouldn't have been leaking those structure list objects.
19873
19874 4% preogression on deltablue.
19875
19876 * bytecode/CodeBlock.cpp:
19877 (JSC::CodeBlock::dump):
19878 (JSC::CodeBlock::derefStructures):
19879 (JSC::PrototypeStructureList::derefStructures):
19880 * bytecode/Instruction.h:
19881 * bytecode/Opcode.h:
19882 * interpreter/Interpreter.cpp:
19883 (JSC::Interpreter::privateExecute):
19884 (JSC::Interpreter::cti_op_get_by_id_self_fail):
19885 * jit/JIT.cpp:
19886 (JSC::JIT::privateCompileMainPass):
19887 (JSC::JIT::privateCompileGetByIdSelfList):
19888 (JSC::JIT::patchGetByIdSelf):
19889 * jit/JIT.h:
19890 (JSC::JIT::compileGetByIdSelfList):
19891
19892 2008-11-21 Geoffrey Garen <ggaren@apple.com>
19893
19894 Reviewed by Sam Weinig.
19895
19896 Fixed many crashes seen 'round the world (but only in release builds).
19897
19898 Update outputParameter offset to reflect slight re-ordering of push
19899 instructions in r38669.
19900
19901 * wrec/WRECGenerator.cpp:
19902
19903 2008-11-21 Geoffrey Garen <ggaren@apple.com>
19904
19905 Reviewed by Sam Weinig.
19906
19907 A little more RegExp refactoring.
19908
19909 Deployed a helper function for reading the next character. Used the "link
19910 vector of jumps" helper in a place I missed before.
19911
19912 * wrec/WRECGenerator.cpp:
19913 (JSC::WREC::Generator::generateLoadCharacter):
19914 (JSC::WREC::Generator::generatePatternCharacter):
19915 (JSC::WREC::Generator::generateCharacterClass):
19916 (JSC::WREC::Generator::generateAssertionEOL):
19917 (JSC::WREC::Generator::generateAssertionWordBoundary):
19918 * wrec/WRECGenerator.h:
19919
19920 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
19921
19922 Reviewed by Dan Bernstein.
19923
19924 https://bugs.webkit.org/show_bug.cgi?id=22402
19925 Replace abort() with CRASH()
19926
19927 * wtf/Assertions.h: Added a different method to crash, which should work even is 0xbbadbeef
19928 is a valid memory address.
19929
19930 * runtime/Collector.cpp:
19931 * wtf/FastMalloc.cpp:
19932 * wtf/FastMalloc.h:
19933 * wtf/TCSpinLock.h:
19934 Replace abort() with CRASH().
19935
19936 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
19937
19938 Reverted fix for bug 22042 (Replace abort() with CRASH()), because it was breaking
19939 FOR_EACH_OPCODE_ID macro somehow, making Safari crash.
19940
19941 * runtime/Collector.cpp:
19942 (JSC::Heap::heapAllocate):
19943 (JSC::Heap::collect):
19944 * wtf/Assertions.h:
19945 * wtf/FastMalloc.cpp:
19946 (WTF::fastMalloc):
19947 (WTF::fastCalloc):
19948 (WTF::fastRealloc):
19949 (WTF::InitSizeClasses):
19950 (WTF::PageHeapAllocator::New):
19951 (WTF::TCMallocStats::do_malloc):
19952 * wtf/FastMalloc.h:
19953 * wtf/TCSpinLock.h:
19954 (TCMalloc_SpinLock::Init):
19955 (TCMalloc_SpinLock::Finalize):
19956 (TCMalloc_SpinLock::Lock):
19957 (TCMalloc_SpinLock::Unlock):
19958
19959 2008-11-21 Geoffrey Garen <ggaren@apple.com>
19960
19961 Reviewed by Sam Weinig.
19962
19963 A little more RegExp refactoring.
19964
19965 Moved all assembly from WREC.cpp into WRECGenerator helper functions.
19966 This should help with portability and readability.
19967
19968 Removed ASSERTs after calls to executableCopy(), and changed
19969 executableCopy() to ASSERT instead.
19970
19971 * assembler/X86Assembler.h:
19972 (JSC::X86Assembler::executableCopy):
19973 * jit/JIT.cpp:
19974 (JSC::JIT::privateCompile):
19975 (JSC::JIT::privateCompileGetByIdSelf):
19976 (JSC::JIT::privateCompileGetByIdProto):
19977 (JSC::JIT::privateCompileGetByIdChain):
19978 (JSC::JIT::privateCompilePutByIdReplace):
19979 (JSC::JIT::privateCompilePutByIdTransition):
19980 (JSC::JIT::privateCompileCTIMachineTrampolines):
19981 (JSC::JIT::privateCompilePatchGetArrayLength):
19982 * wrec/WREC.cpp:
19983 (JSC::WREC::compileRegExp):
19984 * wrec/WRECGenerator.cpp:
19985 (JSC::WREC::Generator::generateEnter):
19986 (JSC::WREC::Generator::generateReturnSuccess):
19987 (JSC::WREC::Generator::generateSaveIndex):
19988 (JSC::WREC::Generator::generateIncrementIndex):
19989 (JSC::WREC::Generator::generateLoopIfNotEndOfInput):
19990 (JSC::WREC::Generator::generateReturnFailure):
19991 * wrec/WRECGenerator.h:
19992 * wrec/WRECParser.h:
19993 (JSC::WREC::Parser::ignoreCase):
19994 (JSC::WREC::Parser::generator):
19995
19996 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
19997
19998 Build fix.
19999
20000 * wtf/Assertions.h: Use ::abort for C++ code.
20001
20002 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
20003
20004 Reviewed by Sam Weinig.
20005
20006 https://bugs.webkit.org/show_bug.cgi?id=22402
20007 Replace abort() with CRASH()
20008
20009 * wtf/Assertions.h: Added abort() after an attempt to crash for extra safety.
20010
20011 * runtime/Collector.cpp:
20012 * wtf/FastMalloc.cpp:
20013 * wtf/FastMalloc.h:
20014 * wtf/TCSpinLock.h:
20015 Replace abort() with CRASH().
20016
20017 2008-11-21 Geoffrey Garen <ggaren@apple.com>
20018
20019 Reviewed by Sam Weinig.
20020
20021 Renamed wrec => generator.
20022
20023 * wrec/WRECFunctors.cpp:
20024 (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom):
20025 (JSC::WREC::GeneratePatternCharacterFunctor::backtrack):
20026 (JSC::WREC::GenerateCharacterClassFunctor::generateAtom):
20027 (JSC::WREC::GenerateCharacterClassFunctor::backtrack):
20028 (JSC::WREC::GenerateBackreferenceFunctor::generateAtom):
20029 (JSC::WREC::GenerateBackreferenceFunctor::backtrack):
20030 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
20031
20032 2008-11-19 Gavin Barraclough <barraclough@apple.com>
20033
20034 Reviewed by Darin Adler.
20035
20036 Add support for (really) polymorphic caching of prototype accesses.
20037
20038 If a cached prototype access misses, cti_op_get_by_id_proto_list is called.
20039 When this occurs the Structure pointers from the instruction stream are copied
20040 off into a new ProtoStubInfo object. A second prototype access trampoline is
20041 generated, and chained onto the first. Subsequent missed call to
20042 cti_op_get_by_id_proto_list_append, which append futher new trampolines, up to
20043 PROTOTYPE_LIST_CACHE_SIZE (currently 4). If any of the misses result in an
20044 access other than to a direct prototype property, list formation is halted (or
20045 for the initial miss, does not take place at all).
20046
20047 Separate fail case functions are provided for each access since this contributes
20048 to the performance progression (enables better processor branch prediction).
20049
20050 Overall this is a near 5% progression on v8, with around 10% wins on richards
20051 and deltablue.
20052
20053 * bytecode/CodeBlock.cpp:
20054 (JSC::CodeBlock::dump):
20055 (JSC::CodeBlock::derefStructures):
20056 * bytecode/Instruction.h:
20057 (JSC::ProtoStructureList::ProtoStubInfo::set):
20058 (JSC::ProtoStructureList::ProtoStructureList):
20059 (JSC::Instruction::Instruction):
20060 (JSC::Instruction::):
20061 * bytecode/Opcode.h:
20062 * interpreter/Interpreter.cpp:
20063 (JSC::Interpreter::privateExecute):
20064 (JSC::Interpreter::tryCTICacheGetByID):
20065 (JSC::Interpreter::cti_op_put_by_id_fail):
20066 (JSC::Interpreter::cti_op_get_by_id_self_fail):
20067 (JSC::Interpreter::cti_op_get_by_id_proto_list):
20068 (JSC::Interpreter::cti_op_get_by_id_proto_list_append):
20069 (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
20070 (JSC::Interpreter::cti_op_get_by_id_proto_fail):
20071 (JSC::Interpreter::cti_op_get_by_id_chain_fail):
20072 (JSC::Interpreter::cti_op_get_by_id_array_fail):
20073 (JSC::Interpreter::cti_op_get_by_id_string_fail):
20074 * interpreter/Interpreter.h:
20075 * jit/JIT.cpp:
20076 (JSC::JIT::privateCompileMainPass):
20077 (JSC::JIT::privateCompileGetByIdSelf):
20078 (JSC::JIT::privateCompileGetByIdProto):
20079 (JSC::JIT::privateCompileGetByIdProtoList):
20080 (JSC::JIT::privateCompileGetByIdChain):
20081 (JSC::JIT::privateCompileCTIMachineTrampolines):
20082 (JSC::JIT::privateCompilePatchGetArrayLength):
20083 * jit/JIT.h:
20084 (JSC::JIT::compileGetByIdProtoList):
20085
20086 2008-11-20 Sam Weinig <sam@webkit.org>
20087
20088 Try and fix the tiger build.
20089
20090 * parser/Grammar.y:
20091
20092 2008-11-20 Eric Seidel <eric@webkit.org>
20093
20094 Reviewed by Darin Adler.
20095
20096 Make JavaScriptCore Chromium build under Windows (cmd only, cygwin almost works)
20097 https://bugs.webkit.org/show_bug.cgi?id=22347
20098
20099 * JavaScriptCore.scons:
20100 * parser/Parser.cpp: Add using std::auto_ptr since we use auto_ptr
20101
20102 2008-11-20 Steve Falkenburg <sfalken@apple.com>
20103
20104 Fix build.
20105
20106 Reviewed by Sam Weinig.
20107
20108 * parser/Parser.cpp:
20109 (JSC::Parser::reparse):
20110
20111 2008-11-20 Geoffrey Garen <ggaren@apple.com>
20112
20113 Reviewed by Sam Weinig.
20114
20115 A little more RegExp refactoring.
20116
20117 Created a helper function in the assembler for linking a vector of
20118 JmpSrc to a location, and deployed it in a bunch of places.
20119
20120 * JavaScriptCore.xcodeproj/project.pbxproj:
20121 * assembler/X86Assembler.h:
20122 (JSC::X86Assembler::link):
20123 * wrec/WREC.cpp:
20124 (JSC::WREC::compileRegExp):
20125 * wrec/WRECGenerator.cpp:
20126 (JSC::WREC::Generator::generateNonGreedyQuantifier):
20127 (JSC::WREC::Generator::generateGreedyQuantifier):
20128 (JSC::WREC::Generator::generateCharacterClassInverted):
20129 (JSC::WREC::Generator::generateParentheses):
20130 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
20131 (JSC::WREC::Generator::generateAssertionBOL):
20132 (JSC::WREC::Generator::generateAssertionEOL):
20133 (JSC::WREC::Generator::generateAssertionWordBoundary):
20134 (JSC::WREC::Generator::terminateAlternative):
20135 (JSC::WREC::Generator::terminateDisjunction):
20136 * wrec/WRECParser.cpp:
20137 * wrec/WRECParser.h:
20138 (JSC::WREC::Parser::consumeHex):
20139
20140 2008-11-20 Sam Weinig <sam@webkit.org>
20141
20142 Fix non-mac builds.
20143
20144 * parser/Lexer.cpp:
20145 * parser/Parser.cpp:
20146
20147 2008-11-20 Sam Weinig <sam@webkit.org>
20148
20149 Reviewed by Darin Adler.
20150
20151 Patch for https://bugs.webkit.org/show_bug.cgi?id=22385
20152 <rdar://problem/6390179>
20153 Lazily reparse FunctionBodyNodes on first execution.
20154
20155 - Saves 57MB on Membuster head.
20156
20157 * bytecompiler/BytecodeGenerator.cpp:
20158 (JSC::BytecodeGenerator::generate): Remove vector shrinking since this is now
20159 handled by destroying the ScopeNodeData after generation.
20160
20161 * parser/Grammar.y: Add alternate NoNode version of the grammar
20162 that does not create nodes. This is used to lazily create FunctionBodyNodes
20163 on first execution.
20164
20165 * parser/Lexer.cpp:
20166 (JSC::Lexer::setCode): Fix bug where on reparse, the Lexer was confused about
20167 what position and length meant. Position is the current position in the original
20168 data buffer (important for getting correct line/column information) and length
20169 the end offset in the original buffer.
20170 * parser/Lexer.h:
20171 (JSC::Lexer::sourceCode): Positions are relative to the beginning of the buffer.
20172
20173 * parser/Nodes.cpp:
20174 (JSC::ScopeNodeData::ScopeNodeData): Move initialization of ScopeNode data here.
20175 (JSC::ScopeNode::ScopeNode): Add constructor that only sets the JSGlobalData
20176 for FunctionBodyNode stubs.
20177 (JSC::ScopeNode::~ScopeNode): Release m_children now that we don't inherit from
20178 BlockNode.
20179 (JSC::ScopeNode::releaseNodes): Ditto.
20180 (JSC::EvalNode::generateBytecode): Only shrink m_children, as we need to keep around
20181 the rest of the data.
20182 (JSC::FunctionBodyNode::FunctionBodyNode): Add constructor that only sets the
20183 JSGlobalData.
20184 (JSC::FunctionBodyNode::create): Ditto.
20185 (JSC::FunctionBodyNode::generateBytecode): If we don't have the data, do a reparse
20186 to construct it. Then after generation, destroy the data.
20187 (JSC::ProgramNode::generateBytecode): After generation, destroy the AST data.
20188 * parser/Nodes.h:
20189 (JSC::ExpressionNode::): Add isFuncExprNode for FunctionConstructor.
20190 (JSC::StatementNode::): Add isExprStatementNode for FunctionConstructor.
20191 (JSC::ExprStatementNode::): Ditto.
20192 (JSC::ExprStatementNode::expr): Add accessor for FunctionConstructor.
20193 (JSC::FuncExprNode::): Add isFuncExprNode for FunctionConstructor
20194
20195 (JSC::ScopeNode::adoptData): Adopts a ScopeNodeData.
20196 (JSC::ScopeNode::data): Accessor for ScopeNodeData.
20197 (JSC::ScopeNode::destroyData): Deletes the ScopeNodeData.
20198 (JSC::ScopeNode::setFeatures): Added.
20199 (JSC::ScopeNode::varStack): Added assert.
20200 (JSC::ScopeNode::functionStack): Ditto.
20201 (JSC::ScopeNode::children): Ditto.
20202 (JSC::ScopeNode::neededConstants): Ditto.
20203 Factor m_varStack, m_functionStack, m_children and m_numConstants into ScopeNodeData.
20204
20205 * parser/Parser.cpp:
20206 (JSC::Parser::reparse): Reparse the SourceCode in the FunctionBodyNode and set
20207 set up the ScopeNodeData for it.
20208 * parser/Parser.h:
20209
20210 * parser/SourceCode.h:
20211 (JSC::SourceCode::endOffset): Added for use in the lexer.
20212
20213 * runtime/FunctionConstructor.cpp:
20214 (JSC::getFunctionBody): Assuming a ProgramNode with one FunctionExpression in it,
20215 get the FunctionBodyNode. Any issues signifies a parse failure in constructFunction.
20216 (JSC::constructFunction): Make parsing functions in the form new Function(""), easier
20217 by concatenating the strings together (with some glue) and parsing the function expression
20218 as a ProgramNode from which we can receive the FunctionBodyNode. This has the added benefit
20219 of not having special parsing code for the arguments and lazily constructing the
20220 FunctionBodyNode's AST on first execution.
20221
20222 * runtime/Identifier.h:
20223 (JSC::operator!=): Added.
20224
20225 2008-11-20 Sam Weinig <sam@webkit.org>
20226
20227 Reviewed by Geoffrey Garen.
20228
20229 Speedup the lexer to offset coming re-parsing patch.
20230
20231 - .6% progression on Sunspider.
20232
20233 * bytecompiler/SegmentedVector.h:
20234 (JSC::SegmentedVector::shrink): Fixed bug where m_size would not be
20235 set when shrinking to 0.
20236
20237 * parser/Lexer.cpp:
20238 (JSC::Lexer::Lexer):
20239 (JSC::Lexer::isIdentStart): Use isASCIIAlpha and isASCII to avoid going into ICU in the common cases.
20240 (JSC::Lexer::isIdentPart): Use isASCIIAlphanumeric and isASCII to avoid going into ICU in the common cases
20241 (JSC::isDecimalDigit): Use version in ASCIICType.h. Inlining it was a regression.
20242 (JSC::Lexer::isHexDigit): Ditto.
20243 (JSC::Lexer::isOctalDigit): Ditto.
20244 (JSC::Lexer::clear): Resize the m_identifiers SegmentedVector to initial
20245 capacity
20246 * parser/Lexer.h: Remove unused m_strings vector. Make m_identifiers
20247 a SegmentedVector<Identifier> to avoid allocating a new Identifier* for
20248 each identifier found. The SegmentedVector is need so we can passes
20249 references to the Identifier to the parser, which remain valid even when
20250 the vector is resized.
20251 (JSC::Lexer::makeIdentifier): Inline and return a reference to the added
20252 Identifier.
20253
20254 2008-11-20 Sam Weinig <sam@webkit.org>
20255
20256 Reviewed by Darin Adler.
20257
20258 Add isASCII to ASCIICType. Use coming soon!
20259
20260 * wtf/ASCIICType.h:
20261 (WTF::isASCII):
20262
20263 2008-11-20 Sam Weinig <sam@webkit.org>
20264
20265 Reviewed by Darin Adler.
20266
20267 Add OwnPtr constructor and OwnPtr::adopt that take an auto_ptr.
20268
20269 * wtf/OwnPtr.h:
20270 (WTF::OwnPtr::OwnPtr):
20271 (WTF::OwnPtr::adopt):
20272
20273 2008-11-20 Alexey Proskuryakov <ap@webkit.org>
20274
20275 Reviewed by Darin Adler.
20276
20277 https://bugs.webkit.org/show_bug.cgi?id=22364
20278 Crashes seen on Tiger buildbots due to worker threads exhausting pthread keys
20279
20280 * runtime/Collector.cpp:
20281 (JSC::Heap::Heap):
20282 (JSC::Heap::destroy):
20283 (JSC::Heap::makeUsableFromMultipleThreads):
20284 (JSC::Heap::registerThread):
20285 * runtime/Collector.h:
20286 Pthread key for tracking threads is only created on request now, because this is a limited
20287 resource, and thread tracking is not needed for worker heaps, or for WebCore heap.
20288
20289 * API/JSContextRef.cpp: (JSGlobalContextCreateInGroup): Call makeUsableFromMultipleThreads().
20290
20291 * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::sharedInstance): Ditto.
20292
20293 * runtime/JSGlobalData.h: (JSC::JSGlobalData::makeUsableFromMultipleThreads): Just forward
20294 the call to Heap, which clients need not know about, ideally.
20295
20296 2008-11-20 Geoffrey Garen <ggaren@apple.com>
20297
20298 Reviewed by Sam Weinig.
20299
20300 A little more WREC refactoring.
20301
20302 Removed the "Register" suffix from register names in WREC, and renamed:
20303 currentPosition => index
20304 currentValue => character
20305 quantifierCount => repeatCount
20306
20307 Added a top-level parsePattern function to the WREC parser, which
20308 allowed me to remove the error() and atEndOfPattern() accessors.
20309
20310 Factored out an MSVC customization into a constant.
20311
20312 Renamed nextLabel => beginPattern.
20313
20314 * wrec/WREC.cpp:
20315 (JSC::WREC::compileRegExp):
20316 * wrec/WRECGenerator.cpp:
20317 (JSC::WREC::Generator::generateBacktrack1):
20318 (JSC::WREC::Generator::generateBacktrackBackreference):
20319 (JSC::WREC::Generator::generateBackreferenceQuantifier):
20320 (JSC::WREC::Generator::generateNonGreedyQuantifier):
20321 (JSC::WREC::Generator::generateGreedyQuantifier):
20322 (JSC::WREC::Generator::generatePatternCharacter):
20323 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
20324 (JSC::WREC::Generator::generateCharacterClassInverted):
20325 (JSC::WREC::Generator::generateCharacterClass):
20326 (JSC::WREC::Generator::generateParentheses):
20327 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
20328 (JSC::WREC::Generator::generateAssertionBOL):
20329 (JSC::WREC::Generator::generateAssertionEOL):
20330 (JSC::WREC::Generator::generateAssertionWordBoundary):
20331 (JSC::WREC::Generator::generateBackreference):
20332 (JSC::WREC::Generator::generateDisjunction):
20333 (JSC::WREC::Generator::terminateDisjunction):
20334 * wrec/WRECGenerator.h:
20335 * wrec/WRECParser.h:
20336 (JSC::WREC::Parser::parsePattern):
20337
20338 2008-11-19 Geoffrey Garen <ggaren@apple.com>
20339
20340 Reviewed by Darin Adler.
20341
20342 https://bugs.webkit.org/show_bug.cgi?id=22361
20343 A little more RegExp refactoring.
20344
20345 Consistently named variables holding the starting position at which
20346 regexp matching should begin to "startOffset".
20347
20348 A few more "regExpObject" => "regExpConstructor" changes.
20349
20350 Refactored RegExpObject::match for clarity, and replaced a slow "get"
20351 of the "global" property with a fast access to the global bit.
20352
20353 Made the error message you see when RegExpObject::match has no input a
20354 little more informative, as in Firefox.
20355
20356 * runtime/RegExp.cpp:
20357 (JSC::RegExp::match):
20358 * runtime/RegExp.h:
20359 * runtime/RegExpObject.cpp:
20360 (JSC::RegExpObject::match):
20361 * runtime/StringPrototype.cpp:
20362 (JSC::stringProtoFuncReplace):
20363 (JSC::stringProtoFuncMatch):
20364 (JSC::stringProtoFuncSearch):
20365
20366 2008-11-19 Geoffrey Garen <ggaren@apple.com>
20367
20368 Reviewed by Sam Weinig.
20369
20370 A little more refactoring.
20371
20372 Removed the "emit" and "emitUnlinked" prefixes from the assembler.
20373
20374 Moved the JmpSrc and JmpDst class definitions to the top of the X86
20375 assembler class, in accordance with WebKit style guidelines.
20376
20377 * assembler/X86Assembler.h:
20378 (JSC::X86Assembler::JmpSrc::JmpSrc):
20379 (JSC::X86Assembler::JmpDst::JmpDst):
20380 (JSC::X86Assembler::int3):
20381 (JSC::X86Assembler::pushl_m):
20382 (JSC::X86Assembler::popl_m):
20383 (JSC::X86Assembler::movl_rr):
20384 (JSC::X86Assembler::addl_rr):
20385 (JSC::X86Assembler::addl_i8r):
20386 (JSC::X86Assembler::addl_i8m):
20387 (JSC::X86Assembler::addl_i32r):
20388 (JSC::X86Assembler::addl_mr):
20389 (JSC::X86Assembler::andl_rr):
20390 (JSC::X86Assembler::andl_i32r):
20391 (JSC::X86Assembler::cmpl_i8r):
20392 (JSC::X86Assembler::cmpl_rr):
20393 (JSC::X86Assembler::cmpl_rm):
20394 (JSC::X86Assembler::cmpl_mr):
20395 (JSC::X86Assembler::cmpl_i32r):
20396 (JSC::X86Assembler::cmpl_i32m):
20397 (JSC::X86Assembler::cmpl_i8m):
20398 (JSC::X86Assembler::cmpw_rm):
20399 (JSC::X86Assembler::orl_rr):
20400 (JSC::X86Assembler::orl_mr):
20401 (JSC::X86Assembler::orl_i32r):
20402 (JSC::X86Assembler::subl_rr):
20403 (JSC::X86Assembler::subl_i8r):
20404 (JSC::X86Assembler::subl_i8m):
20405 (JSC::X86Assembler::subl_i32r):
20406 (JSC::X86Assembler::subl_mr):
20407 (JSC::X86Assembler::testl_i32r):
20408 (JSC::X86Assembler::testl_i32m):
20409 (JSC::X86Assembler::testl_rr):
20410 (JSC::X86Assembler::xorl_i8r):
20411 (JSC::X86Assembler::xorl_rr):
20412 (JSC::X86Assembler::sarl_i8r):
20413 (JSC::X86Assembler::sarl_CLr):
20414 (JSC::X86Assembler::shl_i8r):
20415 (JSC::X86Assembler::shll_CLr):
20416 (JSC::X86Assembler::imull_rr):
20417 (JSC::X86Assembler::imull_i32r):
20418 (JSC::X86Assembler::idivl_r):
20419 (JSC::X86Assembler::negl_r):
20420 (JSC::X86Assembler::movl_mr):
20421 (JSC::X86Assembler::movzbl_rr):
20422 (JSC::X86Assembler::movzwl_mr):
20423 (JSC::X86Assembler::movl_rm):
20424 (JSC::X86Assembler::movl_i32r):
20425 (JSC::X86Assembler::movl_i32m):
20426 (JSC::X86Assembler::leal_mr):
20427 (JSC::X86Assembler::jmp_r):
20428 (JSC::X86Assembler::jmp_m):
20429 (JSC::X86Assembler::movsd_mr):
20430 (JSC::X86Assembler::xorpd_mr):
20431 (JSC::X86Assembler::movsd_rm):
20432 (JSC::X86Assembler::movd_rr):
20433 (JSC::X86Assembler::cvtsi2sd_rr):
20434 (JSC::X86Assembler::cvttsd2si_rr):
20435 (JSC::X86Assembler::addsd_mr):
20436 (JSC::X86Assembler::subsd_mr):
20437 (JSC::X86Assembler::mulsd_mr):
20438 (JSC::X86Assembler::addsd_rr):
20439 (JSC::X86Assembler::subsd_rr):
20440 (JSC::X86Assembler::mulsd_rr):
20441 (JSC::X86Assembler::ucomis_rr):
20442 (JSC::X86Assembler::pextrw_irr):
20443 (JSC::X86Assembler::call):
20444 (JSC::X86Assembler::jmp):
20445 (JSC::X86Assembler::jne):
20446 (JSC::X86Assembler::jnz):
20447 (JSC::X86Assembler::je):
20448 (JSC::X86Assembler::jl):
20449 (JSC::X86Assembler::jb):
20450 (JSC::X86Assembler::jle):
20451 (JSC::X86Assembler::jbe):
20452 (JSC::X86Assembler::jge):
20453 (JSC::X86Assembler::jg):
20454 (JSC::X86Assembler::ja):
20455 (JSC::X86Assembler::jae):
20456 (JSC::X86Assembler::jo):
20457 (JSC::X86Assembler::jp):
20458 (JSC::X86Assembler::js):
20459 (JSC::X86Assembler::predictNotTaken):
20460 (JSC::X86Assembler::convertToFastCall):
20461 (JSC::X86Assembler::restoreArgumentReference):
20462 (JSC::X86Assembler::restoreArgumentReferenceForTrampoline):
20463 (JSC::X86Assembler::modRm_rr):
20464 (JSC::X86Assembler::modRm_rr_Unchecked):
20465 (JSC::X86Assembler::modRm_rm):
20466 (JSC::X86Assembler::modRm_rm_Unchecked):
20467 (JSC::X86Assembler::modRm_rmsib):
20468 (JSC::X86Assembler::modRm_opr):
20469 (JSC::X86Assembler::modRm_opr_Unchecked):
20470 (JSC::X86Assembler::modRm_opm):
20471 (JSC::X86Assembler::modRm_opm_Unchecked):
20472 (JSC::X86Assembler::modRm_opmsib):
20473 * jit/JIT.cpp:
20474 (JSC::JIT::emitNakedCall):
20475 (JSC::JIT::emitNakedFastCall):
20476 (JSC::JIT::emitCTICall):
20477 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
20478 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
20479 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
20480 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
20481 (JSC::JIT::emitArithIntToImmWithJump):
20482 (JSC::JIT::compileOpCall):
20483 (JSC::JIT::compileOpStrictEq):
20484 (JSC::JIT::emitSlowScriptCheck):
20485 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
20486 (JSC::JIT::compileBinaryArithOp):
20487 (JSC::JIT::privateCompileMainPass):
20488 (JSC::JIT::privateCompileSlowCases):
20489 (JSC::JIT::privateCompile):
20490 (JSC::JIT::privateCompileGetByIdSelf):
20491 (JSC::JIT::privateCompileGetByIdProto):
20492 (JSC::JIT::privateCompileGetByIdChain):
20493 (JSC::JIT::privateCompilePutByIdReplace):
20494 (JSC::JIT::privateCompilePutByIdTransition):
20495 (JSC::JIT::privateCompileCTIMachineTrampolines):
20496 (JSC::JIT::privateCompilePatchGetArrayLength):
20497 * wrec/WREC.cpp:
20498 (JSC::WREC::compileRegExp):
20499 * wrec/WRECGenerator.cpp:
20500 (JSC::WREC::Generator::generateBackreferenceQuantifier):
20501 (JSC::WREC::Generator::generateNonGreedyQuantifier):
20502 (JSC::WREC::Generator::generateGreedyQuantifier):
20503 (JSC::WREC::Generator::generatePatternCharacter):
20504 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
20505 (JSC::WREC::Generator::generateCharacterClassInverted):
20506 (JSC::WREC::Generator::generateCharacterClass):
20507 (JSC::WREC::Generator::generateParentheses):
20508 (JSC::WREC::Generator::generateParenthesesNonGreedy):
20509 (JSC::WREC::Generator::generateParenthesesResetTrampoline):
20510 (JSC::WREC::Generator::generateAssertionBOL):
20511 (JSC::WREC::Generator::generateAssertionEOL):
20512 (JSC::WREC::Generator::generateAssertionWordBoundary):
20513 (JSC::WREC::Generator::generateBackreference):
20514 (JSC::WREC::Generator::generateDisjunction):
20515
20516 2008-11-19 Simon Hausmann <hausmann@webkit.org>
20517
20518 Sun CC build fix, removed trailing comman for last enum value.
20519
20520 * wtf/unicode/qt4/UnicodeQt4.h:
20521 (WTF::Unicode::):
20522
20523 2008-11-19 Mark Rowe <mrowe@apple.com>
20524
20525 Reviewed by Alexey Proskuryakov.
20526
20527 Expand the workaround for Apple GCC compiler bug <rdar://problem/6354696> to all versions of GCC 4.0.1.
20528 It has been observed with builds 5465 (Xcode 3.0) and 5484 (Xcode 3.1), and there is no evidence
20529 that it has been fixed in newer builds of GCC 4.0.1.
20530
20531 This addresses <https://bugs.webkit.org/show_bug.cgi?id=22351> (WebKit nightly crashes on launch on 10.4.11).
20532
20533 * wtf/StdLibExtras.h:
20534
20535 2008-11-18 Cameron Zwarich <zwarich@apple.com>
20536
20537 Reviewed by Maciej Stachowiak and Geoff Garen.
20538
20539 Bug 22287: ASSERTION FAILED: Not enough jumps linked in slow case codegen in CTI::privateCompileSlowCases())
20540 <https://bugs.webkit.org/show_bug.cgi?id=22287>
20541
20542 Fix a typo in the number cell reuse code where the first and second
20543 operands are sometimes confused.
20544
20545 * jit/JIT.cpp:
20546 (JSC::JIT::compileBinaryArithOpSlowCase):
20547
20548 2008-11-18 Dan Bernstein <mitz@apple.com>
20549
20550 - try to fix the Windows build
20551
20552 * interpreter/Interpreter.cpp:
20553 (JSC::Interpreter::privateExecute):
20554
20555 2008-11-18 Geoffrey Garen <ggaren@apple.com>
20556
20557 Reviewed by Sam Weinig.
20558
20559 Minor RegExp cleanup.
20560
20561 SunSpider says no change.
20562
20563 * runtime/RegExpObject.cpp:
20564 (JSC::RegExpObject::match): Renamed "regExpObj" to "regExpConstructor".
20565
20566 * wrec/WREC.cpp:
20567 (JSC::WREC::compileRegExp): Instead of checking for a NULL output vector,
20568 ASSERT that the output vector is not NULL. (The rest of WREC is not
20569 safe to use with a NULL output vector, and we probably don't want to
20570 spend the time and/or performance to make it safe.)
20571
20572 2008-11-18 Geoffrey Garen <ggaren@apple.com>
20573
20574 Reviewed by Darin Adler.
20575
20576 A little more renaming and refactoring.
20577
20578 VM_CHECK_EXCEPTION() => CHECK_FOR_EXCEPTION().
20579 NEXT_INSTRUCTION => NEXT_INSTRUCTION().
20580
20581 Removed the "Error_" and "TempError_" prefixes from WREC error types.
20582
20583 Refactored the WREC parser so it doesn't need a "setError" function,
20584 and changed "isEndOfPattern" and its use -- they read kind of backwards
20585 before.
20586
20587 Changed our "TODO:" error messages at least to say something, since you
20588 can't say "TODO:" in shipping software.
20589
20590 * interpreter/Interpreter.cpp:
20591 (JSC::Interpreter::privateExecute):
20592 (JSC::Interpreter::cti_op_convert_this):
20593 (JSC::Interpreter::cti_op_add):
20594 (JSC::Interpreter::cti_op_pre_inc):
20595 (JSC::Interpreter::cti_op_loop_if_less):
20596 (JSC::Interpreter::cti_op_loop_if_lesseq):
20597 (JSC::Interpreter::cti_op_put_by_id):
20598 (JSC::Interpreter::cti_op_put_by_id_second):
20599 (JSC::Interpreter::cti_op_put_by_id_generic):
20600 (JSC::Interpreter::cti_op_put_by_id_fail):
20601 (JSC::Interpreter::cti_op_get_by_id):
20602 (JSC::Interpreter::cti_op_get_by_id_second):
20603 (JSC::Interpreter::cti_op_get_by_id_generic):
20604 (JSC::Interpreter::cti_op_get_by_id_fail):
20605 (JSC::Interpreter::cti_op_instanceof):
20606 (JSC::Interpreter::cti_op_del_by_id):
20607 (JSC::Interpreter::cti_op_mul):
20608 (JSC::Interpreter::cti_op_call_NotJSFunction):
20609 (JSC::Interpreter::cti_op_resolve):
20610 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
20611 (JSC::Interpreter::cti_op_get_by_val):
20612 (JSC::Interpreter::cti_op_resolve_func):
20613 (JSC::Interpreter::cti_op_sub):
20614 (JSC::Interpreter::cti_op_put_by_val):
20615 (JSC::Interpreter::cti_op_put_by_val_array):
20616 (JSC::Interpreter::cti_op_lesseq):
20617 (JSC::Interpreter::cti_op_loop_if_true):
20618 (JSC::Interpreter::cti_op_negate):
20619 (JSC::Interpreter::cti_op_resolve_skip):
20620 (JSC::Interpreter::cti_op_resolve_global):
20621 (JSC::Interpreter::cti_op_div):
20622 (JSC::Interpreter::cti_op_pre_dec):
20623 (JSC::Interpreter::cti_op_jless):
20624 (JSC::Interpreter::cti_op_not):
20625 (JSC::Interpreter::cti_op_jtrue):
20626 (JSC::Interpreter::cti_op_post_inc):
20627 (JSC::Interpreter::cti_op_eq):
20628 (JSC::Interpreter::cti_op_lshift):
20629 (JSC::Interpreter::cti_op_bitand):
20630 (JSC::Interpreter::cti_op_rshift):
20631 (JSC::Interpreter::cti_op_bitnot):
20632 (JSC::Interpreter::cti_op_resolve_with_base):
20633 (JSC::Interpreter::cti_op_mod):
20634 (JSC::Interpreter::cti_op_less):
20635 (JSC::Interpreter::cti_op_neq):
20636 (JSC::Interpreter::cti_op_post_dec):
20637 (JSC::Interpreter::cti_op_urshift):
20638 (JSC::Interpreter::cti_op_bitxor):
20639 (JSC::Interpreter::cti_op_bitor):
20640 (JSC::Interpreter::cti_op_push_scope):
20641 (JSC::Interpreter::cti_op_to_jsnumber):
20642 (JSC::Interpreter::cti_op_in):
20643 (JSC::Interpreter::cti_op_del_by_val):
20644 * wrec/WREC.cpp:
20645 (JSC::WREC::compileRegExp):
20646 * wrec/WRECParser.cpp:
20647 (JSC::WREC::Parser::parseGreedyQuantifier):
20648 (JSC::WREC::Parser::parseParentheses):
20649 (JSC::WREC::Parser::parseCharacterClass):
20650 (JSC::WREC::Parser::parseEscape):
20651 * wrec/WRECParser.h:
20652 (JSC::WREC::Parser::):
20653 (JSC::WREC::Parser::atEndOfPattern):
20654
20655 2008-11-18 Alexey Proskuryakov <ap@webkit.org>
20656
20657 Reviewed by Darin Adler.
20658
20659 https://bugs.webkit.org/show_bug.cgi?id=22337
20660 Enable workers by default
20661
20662 * Configurations/JavaScriptCore.xcconfig: Define ENABLE_WORKERS.
20663
20664 2008-11-18 Alexey Proskuryakov <ap@webkit.org>
20665
20666 - Windows build fix
20667
20668 * wrec/WRECFunctors.h:
20669 * wrec/WRECGenerator.h:
20670 * wrec/WRECParser.h:
20671 CharacterClass is a struct, not a class, fix forward declarations.
20672
20673 2008-11-18 Dan Bernstein <mitz@apple.com>
20674
20675 - Windows build fix
20676
20677 * assembler/X86Assembler.h:
20678
20679 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20680
20681 Not reviewed.
20682
20683 Try to fix gtk build.
20684
20685 * wrec/Quantifier.h:
20686
20687 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20688
20689 Not reviewed.
20690
20691 Try to fix gtk build.
20692
20693 * assembler/AssemblerBuffer.h:
20694
20695 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20696
20697 Reviewed by Sam Weinig.
20698
20699 Split WREC classes out into individual files, with a few modifications
20700 to more closely match the WebKit coding style.
20701
20702 * GNUmakefile.am:
20703 * JavaScriptCore.scons:
20704 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20705 * JavaScriptCore.xcodeproj/project.pbxproj:
20706 * assembler/X86Assembler.h:
20707 * runtime/RegExp.cpp:
20708 * wrec/CharacterClass.cpp: Copied from wrec/CharacterClassConstructor.cpp.
20709 (JSC::WREC::CharacterClass::newline):
20710 (JSC::WREC::CharacterClass::digits):
20711 (JSC::WREC::CharacterClass::spaces):
20712 (JSC::WREC::CharacterClass::wordchar):
20713 (JSC::WREC::CharacterClass::nondigits):
20714 (JSC::WREC::CharacterClass::nonspaces):
20715 (JSC::WREC::CharacterClass::nonwordchar):
20716 * wrec/CharacterClass.h: Copied from wrec/CharacterClassConstructor.h.
20717 * wrec/CharacterClassConstructor.cpp:
20718 (JSC::WREC::CharacterClassConstructor::addSortedRange):
20719 (JSC::WREC::CharacterClassConstructor::append):
20720 * wrec/CharacterClassConstructor.h:
20721 * wrec/Quantifier.h: Copied from wrec/WREC.h.
20722 * wrec/WREC.cpp:
20723 (JSC::WREC::compileRegExp):
20724 * wrec/WREC.h:
20725 * wrec/WRECFunctors.cpp: Copied from wrec/WREC.cpp.
20726 * wrec/WRECFunctors.h: Copied from wrec/WREC.cpp.
20727 (JSC::WREC::GenerateAtomFunctor::~GenerateAtomFunctor):
20728 (JSC::WREC::GeneratePatternCharacterFunctor::GeneratePatternCharacterFunctor):
20729 (JSC::WREC::GenerateCharacterClassFunctor::GenerateCharacterClassFunctor):
20730 (JSC::WREC::GenerateBackreferenceFunctor::GenerateBackreferenceFunctor):
20731 (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
20732 * wrec/WRECGenerator.cpp: Copied from wrec/WREC.cpp.
20733 (JSC::WREC::Generator::generatePatternCharacter):
20734 (JSC::WREC::Generator::generateCharacterClassInvertedRange):
20735 (JSC::WREC::Generator::generateCharacterClassInverted):
20736 (JSC::WREC::Generator::generateCharacterClass):
20737 (JSC::WREC::Generator::generateParentheses):
20738 (JSC::WREC::Generator::generateAssertionBOL):
20739 (JSC::WREC::Generator::generateAssertionEOL):
20740 (JSC::WREC::Generator::generateAssertionWordBoundary):
20741 * wrec/WRECGenerator.h: Copied from wrec/WREC.h.
20742 * wrec/WRECParser.cpp: Copied from wrec/WREC.cpp.
20743 (JSC::WREC::Parser::parseGreedyQuantifier):
20744 (JSC::WREC::Parser::parseCharacterClassQuantifier):
20745 (JSC::WREC::Parser::parseParentheses):
20746 (JSC::WREC::Parser::parseCharacterClass):
20747 (JSC::WREC::Parser::parseEscape):
20748 (JSC::WREC::Parser::parseTerm):
20749 * wrec/WRECParser.h: Copied from wrec/WREC.h.
20750 (JSC::WREC::Parser::):
20751 (JSC::WREC::Parser::Parser):
20752 (JSC::WREC::Parser::setError):
20753 (JSC::WREC::Parser::error):
20754 (JSC::WREC::Parser::recordSubpattern):
20755 (JSC::WREC::Parser::numSubpatterns):
20756 (JSC::WREC::Parser::ignoreCase):
20757 (JSC::WREC::Parser::multiline):
20758
20759 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20760
20761 Not reviewed.
20762
20763 Try to fix a few builds.
20764
20765 * JavaScriptCoreSources.bkl:
20766
20767 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20768
20769 Not reviewed.
20770
20771 Try to fix a few builds.
20772
20773 * JavaScriptCore.pri:
20774 * JavaScriptCore.scons:
20775 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20776
20777 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20778
20779 Reviewed by Sam Weinig.
20780
20781 Moved VM/CTI.* => jit/JIT.*.
20782
20783 Removed VM.
20784
20785 * GNUmakefile.am:
20786 * JavaScriptCore.pri:
20787 * JavaScriptCore.scons:
20788 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20789 * JavaScriptCore.xcodeproj/project.pbxproj:
20790 * VM/CTI.cpp: Removed.
20791 * VM/CTI.h: Removed.
20792 * bytecode/CodeBlock.cpp:
20793 * interpreter/Interpreter.cpp:
20794 * jit: Added.
20795 * jit/JIT.cpp: Copied from VM/CTI.cpp.
20796 * jit/JIT.h: Copied from VM/CTI.h.
20797 * runtime/RegExp.cpp:
20798
20799 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20800
20801 Reviewed by Sam Weinig.
20802
20803 Moved runtime/ExecState.* => interpreter/CallFrame.*.
20804
20805 * API/JSBase.cpp:
20806 * API/OpaqueJSString.cpp:
20807 * GNUmakefile.am:
20808 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20809 * JavaScriptCore.xcodeproj/project.pbxproj:
20810 * debugger/DebuggerCallFrame.h:
20811 * interpreter/CallFrame.cpp: Copied from runtime/ExecState.cpp.
20812 * interpreter/CallFrame.h: Copied from runtime/ExecState.h.
20813 * interpreter/Interpreter.cpp:
20814 * parser/Nodes.cpp:
20815 * profiler/ProfileGenerator.cpp:
20816 * profiler/Profiler.cpp:
20817 * runtime/ClassInfo.h:
20818 * runtime/Collector.cpp:
20819 * runtime/Completion.cpp:
20820 * runtime/ExceptionHelpers.cpp:
20821 * runtime/ExecState.cpp: Removed.
20822 * runtime/ExecState.h: Removed.
20823 * runtime/Identifier.cpp:
20824 * runtime/JSFunction.cpp:
20825 * runtime/JSGlobalObjectFunctions.cpp:
20826 * runtime/JSLock.cpp:
20827 * runtime/JSNumberCell.h:
20828 * runtime/JSObject.h:
20829 * runtime/JSString.h:
20830 * runtime/Lookup.h:
20831 * runtime/PropertyNameArray.h:
20832
20833 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20834
20835 Not reviewed.
20836
20837 Try to fix Windows build.
20838
20839 * API/APICast.h:
20840
20841 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20842
20843 Not reviewed.
20844
20845 Try to fix Windows build.
20846
20847 * API/APICast.h:
20848 * runtime/ExecState.h:
20849
20850 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20851
20852 Reviewed by Sam Weinig.
20853
20854 Moved VM/SamplingTool.* => bytecode/SamplingTool.*.
20855
20856 * GNUmakefile.am:
20857 * JavaScriptCore.pri:
20858 * JavaScriptCore.scons:
20859 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20860 * JavaScriptCore.xcodeproj/project.pbxproj:
20861 * JavaScriptCoreSources.bkl:
20862 * VM/SamplingTool.cpp: Removed.
20863 * VM/SamplingTool.h: Removed.
20864 * bytecode/SamplingTool.cpp: Copied from VM/SamplingTool.cpp.
20865 * bytecode/SamplingTool.h: Copied from VM/SamplingTool.h.
20866 * jsc.cpp:
20867 (runWithScripts):
20868
20869 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20870
20871 Not reviewed.
20872
20873 Try to fix Windows build.
20874
20875 * runtime/ExecState.h:
20876
20877 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20878
20879 Reviewed by Sam Weinig.
20880
20881 Moved VM/ExceptionHelpers.cpp => runtime/ExceptionHelpers.cpp.
20882
20883 * GNUmakefile.am:
20884 * JavaScriptCore.pri:
20885 * JavaScriptCore.scons:
20886 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20887 * JavaScriptCore.xcodeproj/project.pbxproj:
20888 * JavaScriptCoreSources.bkl:
20889 * VM/ExceptionHelpers.cpp: Removed.
20890 * runtime/ExceptionHelpers.cpp: Copied from VM/ExceptionHelpers.cpp.
20891
20892 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20893
20894 Reviewed by Sam Weinig.
20895
20896 Moved VM/RegisterFile.cpp => interpreter/RegisterFile.cpp.
20897
20898 * AllInOneFile.cpp:
20899 * GNUmakefile.am:
20900 * JavaScriptCore.pri:
20901 * JavaScriptCore.scons:
20902 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20903 * JavaScriptCore.xcodeproj/project.pbxproj:
20904 * JavaScriptCoreSources.bkl:
20905 * VM/RegisterFile.cpp: Removed.
20906 * interpreter/RegisterFile.cpp: Copied from VM/RegisterFile.cpp.
20907
20908 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20909
20910 Not reviewed.
20911
20912 Try to fix Windows build.
20913
20914 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20915
20916 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20917
20918 Not reviewed.
20919
20920 Try to fix Windows build.
20921
20922 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
20923
20924 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20925
20926 Not reviewed.
20927
20928 Try to fix Windows build.
20929
20930 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20931
20932 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20933
20934 Reviewed by Sam Weinig.
20935
20936 Moved:
20937 VM/ExceptionHelpers.h => runtime/ExceptionHelpers.h
20938 VM/Register.h => interpreter/Register.h
20939 VM/RegisterFile.h => interpreter/RegisterFile.h
20940
20941
20942 * GNUmakefile.am:
20943 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20944 * JavaScriptCore.xcodeproj/project.pbxproj:
20945 * VM/ExceptionHelpers.h: Removed.
20946 * VM/Register.h: Removed.
20947 * VM/RegisterFile.h: Removed.
20948 * interpreter/Register.h: Copied from VM/Register.h.
20949 * interpreter/RegisterFile.h: Copied from VM/RegisterFile.h.
20950 * runtime/ExceptionHelpers.h: Copied from VM/ExceptionHelpers.h.
20951
20952 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20953
20954 Not reviewed.
20955
20956 Try to fix Qt build.
20957
20958 * JavaScriptCore.pri:
20959
20960 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20961
20962 Reviewed by Sam Weinig.
20963
20964 Moved VM/Machine.cpp => interpreter/Interpreter.cpp.
20965
20966 * DerivedSources.make:
20967 * GNUmakefile.am:
20968 * JavaScriptCore.pri:
20969 * JavaScriptCore.scons:
20970 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20971 * JavaScriptCore.xcodeproj/project.pbxproj:
20972 * JavaScriptCoreSources.bkl:
20973 * VM/Machine.cpp: Removed.
20974 * interpreter/Interpreter.cpp: Copied from VM/Machine.cpp.
20975
20976 2008-11-17 Geoffrey Garen <ggaren@apple.com>
20977
20978 Reviewed by Sam Weinig.
20979
20980 Moved VM/Machine.h => interpreter/Interpreter.h
20981
20982 * GNUmakefile.am:
20983 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
20984 * JavaScriptCore.xcodeproj/project.pbxproj:
20985 * VM/CTI.cpp:
20986 * VM/CTI.h:
20987 * VM/ExceptionHelpers.cpp:
20988 * VM/Machine.cpp:
20989 * VM/Machine.h: Removed.
20990 * VM/SamplingTool.cpp:
20991 * bytecode/CodeBlock.cpp:
20992 * bytecompiler/BytecodeGenerator.cpp:
20993 * bytecompiler/BytecodeGenerator.h:
20994 * debugger/DebuggerCallFrame.cpp:
20995 * interpreter: Added.
20996 * interpreter/Interpreter.h: Copied from VM/Machine.h.
20997 * profiler/ProfileGenerator.cpp:
20998 * runtime/Arguments.h:
20999 * runtime/ArrayPrototype.cpp:
21000 * runtime/Collector.cpp:
21001 * runtime/Completion.cpp:
21002 * runtime/ExecState.h:
21003 * runtime/FunctionPrototype.cpp:
21004 * runtime/JSActivation.cpp:
21005 * runtime/JSFunction.cpp:
21006 * runtime/JSGlobalData.cpp:
21007 * runtime/JSGlobalObject.cpp:
21008 * runtime/JSGlobalObjectFunctions.cpp:
21009 * wrec/WREC.cpp:
21010
21011 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21012
21013 Reviewed by Sam Weinig.
21014
21015 Moved runtime/Interpreter.cpp => runtime/Completion.cpp.
21016
21017 Moved functions from Interpreter.h to Completion.h, and removed
21018 Interpreter.h from the project.
21019
21020 * API/JSBase.cpp:
21021 * AllInOneFile.cpp:
21022 * GNUmakefile.am:
21023 * JavaScriptCore.pri:
21024 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21025 * JavaScriptCore.xcodeproj/project.pbxproj:
21026 * JavaScriptCoreSources.bkl:
21027 * jsc.cpp:
21028 * runtime/Completion.cpp: Copied from runtime/Interpreter.cpp.
21029 * runtime/Completion.h:
21030 * runtime/Interpreter.cpp: Removed.
21031 * runtime/Interpreter.h: Removed.
21032
21033 2008-11-17 Gabor Loki <loki@inf.u-szeged.hu>
21034
21035 Reviewed by Darin Adler.
21036
21037 <https://bugs.webkit.org/show_bug.cgi?id=22312>
21038 Fix PCRE include path problem on Qt-port
21039
21040 * JavaScriptCore.pri:
21041 * pcre/pcre.pri:
21042
21043 2008-11-17 Gabor Loki <loki@inf.u-szeged.hu>
21044
21045 Reviewed by Darin Adler.
21046
21047 <https://bugs.webkit.org/show_bug.cgi?id=22313>
21048 Add missing CTI source to the build system on Qt-port
21049
21050 * JavaScriptCore.pri:
21051
21052 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21053
21054 Not reviewed.
21055
21056 Try to fix JSGlue build.
21057
21058 * JavaScriptCore.xcodeproj/project.pbxproj:
21059
21060 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21061
21062 Not reviewed.
21063
21064 Try to fix Qt build.
21065
21066 * jsc.pro:
21067
21068 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21069
21070 Not reviewed.
21071
21072 Try to fix Qt build.
21073
21074 * JavaScriptCore.pri:
21075
21076 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21077
21078 Not reviewed.
21079
21080 Try to fix Qt build.
21081
21082 * JavaScriptCore.pri:
21083
21084 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21085
21086 Reviewed by Sam Weinig.
21087
21088 More file moves:
21089
21090 VM/CodeBlock.* => bytecode/CodeBlock.*
21091 VM/EvalCodeCache.h => bytecode/EvalCodeCache.h
21092 VM/Instruction.h => bytecode/Instruction.h
21093 VM/Opcode.* => bytecode/Opcode.*
21094
21095 * GNUmakefile.am:
21096 * JavaScriptCore.scons:
21097 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21098 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
21099 * JavaScriptCore.xcodeproj/project.pbxproj:
21100 * JavaScriptCoreSources.bkl:
21101 * VM/CodeBlock.cpp: Removed.
21102 * VM/CodeBlock.h: Removed.
21103 * VM/EvalCodeCache.h: Removed.
21104 * VM/Instruction.h: Removed.
21105 * VM/Opcode.cpp: Removed.
21106 * VM/Opcode.h: Removed.
21107 * bytecode: Added.
21108 * bytecode/CodeBlock.cpp: Copied from VM/CodeBlock.cpp.
21109 * bytecode/CodeBlock.h: Copied from VM/CodeBlock.h.
21110 * bytecode/EvalCodeCache.h: Copied from VM/EvalCodeCache.h.
21111 * bytecode/Instruction.h: Copied from VM/Instruction.h.
21112 * bytecode/Opcode.cpp: Copied from VM/Opcode.cpp.
21113 * bytecode/Opcode.h: Copied from VM/Opcode.h.
21114 * jsc.pro:
21115 * jscore.bkl:
21116
21117 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21118
21119 Not reviewed.
21120
21121 Try to fix a few more builds.
21122
21123 * GNUmakefile.am:
21124 * JavaScriptCore.pri:
21125 * JavaScriptCore.scons:
21126 * JavaScriptCoreSources.bkl:
21127
21128 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21129
21130 Not reviewed.
21131
21132 Try to fix gtk build.
21133
21134 * GNUmakefile.am:
21135
21136 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21137
21138 Not reviewed.
21139
21140 Try to fix Windows build.
21141
21142 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21143
21144 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21145
21146 Reviewed by Sam Weinig.
21147
21148 Some file moves:
21149
21150 VM/LabelID.h => bytecompiler/Label.h
21151 VM/RegisterID.h => bytecompiler/RegisterID.h
21152 VM/SegmentedVector.h => bytecompiler/SegmentedVector.h
21153 bytecompiler/CodeGenerator.* => bytecompiler/BytecodeGenerator.*
21154
21155 * AllInOneFile.cpp:
21156 * JavaScriptCore.xcodeproj/project.pbxproj:
21157 * VM/LabelID.h: Removed.
21158 * VM/RegisterID.h: Removed.
21159 * VM/SegmentedVector.h: Removed.
21160 * bytecompiler/BytecodeGenerator.cpp: Copied from bytecompiler/CodeGenerator.cpp.
21161 * bytecompiler/BytecodeGenerator.h: Copied from bytecompiler/CodeGenerator.h.
21162 * bytecompiler/CodeGenerator.cpp: Removed.
21163 * bytecompiler/CodeGenerator.h: Removed.
21164 * bytecompiler/Label.h: Copied from VM/LabelID.h.
21165 * bytecompiler/LabelScope.h:
21166 * bytecompiler/RegisterID.h: Copied from VM/RegisterID.h.
21167 * bytecompiler/SegmentedVector.h: Copied from VM/SegmentedVector.h.
21168 * jsc.cpp:
21169 * parser/Nodes.cpp:
21170
21171 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21172
21173 Not reviewed.
21174
21175 Try to fix Windows build.
21176
21177 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21178
21179 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21180
21181 Not reviewed.
21182
21183 Try to fix Windows build.
21184
21185 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21186
21187 2008-11-17 Geoffrey Garen <ggaren@apple.com>
21188
21189 Not reviewed.
21190
21191 Try to fix Windows build.
21192
21193 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21194
21195 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21196
21197 Not reviewed.
21198
21199 Try to fix Windows build.
21200
21201 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
21202
21203 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21204
21205 Not reviewed.
21206
21207 Try to fix Windows build.
21208
21209 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
21210
21211 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21212
21213 Reviewed by Sam Weinig.
21214
21215 Moved masm => assembler and split "AssemblerBuffer.h" out of "X86Assembler.h".
21216
21217 Also renamed ENABLE_MASM to ENABLE_ASSEMBLER.
21218
21219 * GNUmakefile.am:
21220 * JavaScriptCore.xcodeproj/project.pbxproj:
21221 * assembler: Added.
21222 * assembler/AssemblerBuffer.h: Copied from masm/X86Assembler.h.
21223 (JSC::AssemblerBuffer::AssemblerBuffer):
21224 (JSC::AssemblerBuffer::~AssemblerBuffer):
21225 (JSC::AssemblerBuffer::ensureSpace):
21226 (JSC::AssemblerBuffer::isAligned):
21227 (JSC::AssemblerBuffer::putByteUnchecked):
21228 (JSC::AssemblerBuffer::putByte):
21229 (JSC::AssemblerBuffer::putShortUnchecked):
21230 (JSC::AssemblerBuffer::putShort):
21231 (JSC::AssemblerBuffer::putIntUnchecked):
21232 (JSC::AssemblerBuffer::putInt):
21233 (JSC::AssemblerBuffer::data):
21234 (JSC::AssemblerBuffer::size):
21235 (JSC::AssemblerBuffer::reset):
21236 (JSC::AssemblerBuffer::executableCopy):
21237 (JSC::AssemblerBuffer::grow):
21238 * assembler/X86Assembler.h: Copied from masm/X86Assembler.h.
21239 * masm: Removed.
21240 * masm/X86Assembler.h: Removed.
21241 * wtf/Platform.h:
21242
21243 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21244
21245 Not reviewed.
21246
21247 Try to fix gtk build.
21248
21249 * GNUmakefile.am:
21250
21251 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21252
21253 Not reviewed.
21254
21255 Fixed tyop.
21256
21257 * VM/CTI.cpp:
21258
21259 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21260
21261 Not reviewed.
21262
21263 Try to fix windows build.
21264
21265 * VM/CTI.cpp:
21266
21267 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21268
21269 Not reviewed.
21270
21271 Try to fix gtk build.
21272
21273 * GNUmakefile.am:
21274
21275 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21276
21277 Reviewed by Sam Weinig.
21278
21279 Renamed ENABLE_CTI and ENABLE(CTI) to ENABLE_JIT and ENABLE(JIT).
21280
21281 * VM/CTI.cpp:
21282 * VM/CTI.h:
21283 * VM/CodeBlock.cpp:
21284 (JSC::CodeBlock::~CodeBlock):
21285 * VM/CodeBlock.h:
21286 (JSC::CodeBlock::CodeBlock):
21287 * VM/Machine.cpp:
21288 (JSC::Interpreter::Interpreter):
21289 (JSC::Interpreter::initialize):
21290 (JSC::Interpreter::~Interpreter):
21291 (JSC::Interpreter::execute):
21292 (JSC::Interpreter::privateExecute):
21293 * VM/Machine.h:
21294 * bytecompiler/CodeGenerator.cpp:
21295 (JSC::prepareJumpTableForStringSwitch):
21296 * runtime/JSFunction.cpp:
21297 (JSC::JSFunction::~JSFunction):
21298 * runtime/JSGlobalData.h:
21299 * wrec/WREC.h:
21300 * wtf/Platform.h:
21301 * wtf/TCSystemAlloc.cpp:
21302
21303 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21304
21305 Not reviewed.
21306
21307 Try to fix gtk build.
21308
21309 * VM/CTI.cpp:
21310
21311 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21312
21313 Reviewed by a few people on squirrelfish-dev.
21314
21315 Renamed CTI => JIT.
21316
21317 * VM/CTI.cpp:
21318 (JSC::JIT::killLastResultRegister):
21319 (JSC::JIT::emitGetVirtualRegister):
21320 (JSC::JIT::emitGetVirtualRegisters):
21321 (JSC::JIT::emitPutCTIArgFromVirtualRegister):
21322 (JSC::JIT::emitPutCTIArg):
21323 (JSC::JIT::emitGetCTIArg):
21324 (JSC::JIT::emitPutCTIArgConstant):
21325 (JSC::JIT::getConstantImmediateNumericArg):
21326 (JSC::JIT::emitPutCTIParam):
21327 (JSC::JIT::emitGetCTIParam):
21328 (JSC::JIT::emitPutToCallFrameHeader):
21329 (JSC::JIT::emitGetFromCallFrameHeader):
21330 (JSC::JIT::emitPutVirtualRegister):
21331 (JSC::JIT::emitInitRegister):
21332 (JSC::JIT::printBytecodeOperandTypes):
21333 (JSC::JIT::emitAllocateNumber):
21334 (JSC::JIT::emitNakedCall):
21335 (JSC::JIT::emitNakedFastCall):
21336 (JSC::JIT::emitCTICall):
21337 (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
21338 (JSC::JIT::linkSlowCaseIfNotJSCell):
21339 (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
21340 (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
21341 (JSC::JIT::getDeTaggedConstantImmediate):
21342 (JSC::JIT::emitFastArithDeTagImmediate):
21343 (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
21344 (JSC::JIT::emitFastArithReTagImmediate):
21345 (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
21346 (JSC::JIT::emitFastArithImmToInt):
21347 (JSC::JIT::emitFastArithIntToImmOrSlowCase):
21348 (JSC::JIT::emitFastArithIntToImmNoCheck):
21349 (JSC::JIT::emitArithIntToImmWithJump):
21350 (JSC::JIT::emitTagAsBoolImmediate):
21351 (JSC::JIT::JIT):
21352 (JSC::JIT::compileOpCallInitializeCallFrame):
21353 (JSC::JIT::compileOpCallSetupArgs):
21354 (JSC::JIT::compileOpCallEvalSetupArgs):
21355 (JSC::JIT::compileOpConstructSetupArgs):
21356 (JSC::JIT::compileOpCall):
21357 (JSC::JIT::compileOpStrictEq):
21358 (JSC::JIT::emitSlowScriptCheck):
21359 (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
21360 (JSC::JIT::compileBinaryArithOp):
21361 (JSC::JIT::compileBinaryArithOpSlowCase):
21362 (JSC::JIT::privateCompileMainPass):
21363 (JSC::JIT::privateCompileLinkPass):
21364 (JSC::JIT::privateCompileSlowCases):
21365 (JSC::JIT::privateCompile):
21366 (JSC::JIT::privateCompileGetByIdSelf):
21367 (JSC::JIT::privateCompileGetByIdProto):
21368 (JSC::JIT::privateCompileGetByIdChain):
21369 (JSC::JIT::privateCompilePutByIdReplace):
21370 (JSC::JIT::privateCompilePutByIdTransition):
21371 (JSC::JIT::unlinkCall):
21372 (JSC::JIT::linkCall):
21373 (JSC::JIT::privateCompileCTIMachineTrampolines):
21374 (JSC::JIT::freeCTIMachineTrampolines):
21375 (JSC::JIT::patchGetByIdSelf):
21376 (JSC::JIT::patchPutByIdReplace):
21377 (JSC::JIT::privateCompilePatchGetArrayLength):
21378 (JSC::JIT::emitGetVariableObjectRegister):
21379 (JSC::JIT::emitPutVariableObjectRegister):
21380 * VM/CTI.h:
21381 (JSC::JIT::compile):
21382 (JSC::JIT::compileGetByIdSelf):
21383 (JSC::JIT::compileGetByIdProto):
21384 (JSC::JIT::compileGetByIdChain):
21385 (JSC::JIT::compilePutByIdReplace):
21386 (JSC::JIT::compilePutByIdTransition):
21387 (JSC::JIT::compileCTIMachineTrampolines):
21388 (JSC::JIT::compilePatchGetArrayLength):
21389 * VM/CodeBlock.cpp:
21390 (JSC::CodeBlock::unlinkCallers):
21391 * VM/Machine.cpp:
21392 (JSC::Interpreter::initialize):
21393 (JSC::Interpreter::~Interpreter):
21394 (JSC::Interpreter::execute):
21395 (JSC::Interpreter::tryCTICachePutByID):
21396 (JSC::Interpreter::tryCTICacheGetByID):
21397 (JSC::Interpreter::cti_op_call_JSFunction):
21398 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
21399 (JSC::Interpreter::cti_vm_lazyLinkCall):
21400 * VM/Machine.h:
21401 * VM/RegisterFile.h:
21402 * parser/Nodes.h:
21403 * runtime/JSArray.h:
21404 * runtime/JSCell.h:
21405 * runtime/JSFunction.h:
21406 * runtime/JSImmediate.h:
21407 * runtime/JSNumberCell.h:
21408 * runtime/JSObject.h:
21409 * runtime/JSString.h:
21410 * runtime/JSVariableObject.h:
21411 * runtime/ScopeChain.h:
21412 * runtime/Structure.h:
21413 * runtime/TypeInfo.h:
21414 * runtime/UString.h:
21415
21416 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21417
21418 Not reviewed.
21419
21420 Try to fix wx build.
21421
21422 * jscore.bkl:
21423
21424 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21425
21426 Reviewed by Sam Weinig.
21427
21428 Nixed X86:: and X86Assembler:: prefixes in a lot of places using typedefs.
21429
21430 * VM/CTI.cpp:
21431 (JSC::CTI::emitGetVirtualRegister):
21432 (JSC::CTI::emitGetVirtualRegisters):
21433 (JSC::CTI::emitPutCTIArgFromVirtualRegister):
21434 (JSC::CTI::emitPutCTIArg):
21435 (JSC::CTI::emitGetCTIArg):
21436 (JSC::CTI::emitPutCTIParam):
21437 (JSC::CTI::emitGetCTIParam):
21438 (JSC::CTI::emitPutToCallFrameHeader):
21439 (JSC::CTI::emitGetFromCallFrameHeader):
21440 (JSC::CTI::emitPutVirtualRegister):
21441 (JSC::CTI::emitNakedCall):
21442 (JSC::CTI::emitNakedFastCall):
21443 (JSC::CTI::emitCTICall):
21444 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
21445 (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
21446 (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
21447 (JSC::CTI::emitFastArithDeTagImmediate):
21448 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
21449 (JSC::CTI::emitFastArithReTagImmediate):
21450 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
21451 (JSC::CTI::emitFastArithImmToInt):
21452 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
21453 (JSC::CTI::emitFastArithIntToImmNoCheck):
21454 (JSC::CTI::emitArithIntToImmWithJump):
21455 (JSC::CTI::emitTagAsBoolImmediate):
21456 (JSC::CTI::compileOpCall):
21457 (JSC::CTI::compileOpStrictEq):
21458 (JSC::CTI::emitSlowScriptCheck):
21459 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
21460 (JSC::CTI::compileBinaryArithOp):
21461 (JSC::CTI::compileBinaryArithOpSlowCase):
21462 (JSC::CTI::privateCompileMainPass):
21463 (JSC::CTI::privateCompileSlowCases):
21464 (JSC::CTI::privateCompile):
21465 (JSC::CTI::privateCompileGetByIdSelf):
21466 (JSC::CTI::privateCompileGetByIdProto):
21467 (JSC::CTI::privateCompileGetByIdChain):
21468 (JSC::CTI::privateCompilePutByIdReplace):
21469 (JSC::CTI::privateCompilePutByIdTransition):
21470 (JSC::CTI::privateCompileCTIMachineTrampolines):
21471 (JSC::CTI::privateCompilePatchGetArrayLength):
21472 (JSC::CTI::emitGetVariableObjectRegister):
21473 (JSC::CTI::emitPutVariableObjectRegister):
21474 * VM/CTI.h:
21475 (JSC::CallRecord::CallRecord):
21476 (JSC::JmpTable::JmpTable):
21477 (JSC::SlowCaseEntry::SlowCaseEntry):
21478 (JSC::CTI::JSRInfo::JSRInfo):
21479 * wrec/WREC.h:
21480
21481 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21482
21483 Not reviewed.
21484
21485 Try to fix Qt build.
21486
21487 * JavaScriptCore.pri:
21488
21489 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21490
21491 Reviewed by Sam Weinig.
21492
21493 Renamed OBJECT_OFFSET => FIELD_OFFSET
21494
21495 Nixed use of OBJECT_OFFSET outside of CTI.cpp by making CTI a friend in
21496 more places.
21497
21498 * VM/CTI.cpp:
21499 (JSC::CTI::compileOpCallInitializeCallFrame):
21500 (JSC::CTI::compileOpCall):
21501 (JSC::CTI::emitSlowScriptCheck):
21502 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
21503 (JSC::CTI::compileBinaryArithOp):
21504 (JSC::CTI::privateCompileMainPass):
21505 (JSC::CTI::privateCompileSlowCases):
21506 (JSC::CTI::privateCompile):
21507 (JSC::CTI::privateCompileGetByIdSelf):
21508 (JSC::CTI::privateCompileGetByIdProto):
21509 (JSC::CTI::privateCompileGetByIdChain):
21510 (JSC::CTI::privateCompilePutByIdReplace):
21511 (JSC::CTI::privateCompilePutByIdTransition):
21512 (JSC::CTI::privateCompileCTIMachineTrampolines):
21513 (JSC::CTI::privateCompilePatchGetArrayLength):
21514 (JSC::CTI::emitGetVariableObjectRegister):
21515 (JSC::CTI::emitPutVariableObjectRegister):
21516 * runtime/JSValue.h:
21517 * runtime/JSVariableObject.h:
21518
21519 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21520
21521 Reviewed by Sam Weinig.
21522
21523 Renames:
21524
21525 X86Assembler::copy => X86Assembler::executableCopy
21526 AssemblerBuffer::copy => AssemblerBuffer::executableCopy
21527
21528 * VM/CTI.cpp:
21529 (JSC::CTI::privateCompile):
21530 (JSC::CTI::privateCompileGetByIdSelf):
21531 (JSC::CTI::privateCompileGetByIdProto):
21532 (JSC::CTI::privateCompileGetByIdChain):
21533 (JSC::CTI::privateCompilePutByIdReplace):
21534 (JSC::CTI::privateCompilePutByIdTransition):
21535 (JSC::CTI::privateCompileCTIMachineTrampolines):
21536 (JSC::CTI::privateCompilePatchGetArrayLength):
21537 * masm/X86Assembler.h:
21538 (JSC::AssemblerBuffer::executableCopy):
21539 (JSC::X86Assembler::executableCopy):
21540 * wrec/WREC.cpp:
21541 (JSC::WREC::compileRegExp):
21542
21543 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21544
21545 Reviewed by Sam Weinig.
21546
21547 Renamed WREC => JSC::WREC, removing JSC:: prefix in a lot of places.
21548 Renamed WRECFunction => WREC::CompiledRegExp, and deployed this type
21549 name in place of a few casts.
21550
21551 * runtime/RegExp.cpp:
21552 (JSC::RegExp::RegExp):
21553 (JSC::RegExp::~RegExp):
21554 (JSC::RegExp::match):
21555 * runtime/RegExp.h:
21556 * wrec/CharacterClassConstructor.cpp:
21557 * wrec/CharacterClassConstructor.h:
21558 * wrec/WREC.cpp:
21559 (JSC::WREC::compileRegExp):
21560 * wrec/WREC.h:
21561 (JSC::WREC::Generator::Generator):
21562 (JSC::WREC::Parser::Parser):
21563 (JSC::WREC::Parser::parseAlternative):
21564
21565 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21566
21567 Reviewed by Sam Weinig.
21568
21569 Renamed BytecodeInterpreter => Interpreter.
21570
21571 * JavaScriptCore.exp:
21572 * VM/CTI.cpp:
21573 (JSC::):
21574 (JSC::CTI::compileOpCall):
21575 (JSC::CTI::emitSlowScriptCheck):
21576 (JSC::CTI::compileBinaryArithOpSlowCase):
21577 (JSC::CTI::privateCompileMainPass):
21578 (JSC::CTI::privateCompileSlowCases):
21579 (JSC::CTI::privateCompile):
21580 (JSC::CTI::privateCompileGetByIdSelf):
21581 (JSC::CTI::privateCompileGetByIdProto):
21582 (JSC::CTI::privateCompileGetByIdChain):
21583 (JSC::CTI::privateCompilePutByIdReplace):
21584 (JSC::CTI::privateCompilePutByIdTransition):
21585 (JSC::CTI::privateCompileCTIMachineTrampolines):
21586 (JSC::CTI::freeCTIMachineTrampolines):
21587 (JSC::CTI::patchGetByIdSelf):
21588 (JSC::CTI::patchPutByIdReplace):
21589 (JSC::CTI::privateCompilePatchGetArrayLength):
21590 * VM/CTI.h:
21591 * VM/CodeBlock.cpp:
21592 (JSC::CodeBlock::printStructures):
21593 (JSC::CodeBlock::derefStructures):
21594 (JSC::CodeBlock::refStructures):
21595 * VM/Machine.cpp:
21596 (JSC::jsLess):
21597 (JSC::jsLessEq):
21598 (JSC::Interpreter::resolve):
21599 (JSC::Interpreter::resolveSkip):
21600 (JSC::Interpreter::resolveGlobal):
21601 (JSC::Interpreter::resolveBase):
21602 (JSC::Interpreter::resolveBaseAndProperty):
21603 (JSC::Interpreter::resolveBaseAndFunc):
21604 (JSC::Interpreter::slideRegisterWindowForCall):
21605 (JSC::Interpreter::callEval):
21606 (JSC::Interpreter::Interpreter):
21607 (JSC::Interpreter::initialize):
21608 (JSC::Interpreter::~Interpreter):
21609 (JSC::Interpreter::dumpCallFrame):
21610 (JSC::Interpreter::dumpRegisters):
21611 (JSC::Interpreter::isOpcode):
21612 (JSC::Interpreter::unwindCallFrame):
21613 (JSC::Interpreter::throwException):
21614 (JSC::Interpreter::execute):
21615 (JSC::Interpreter::debug):
21616 (JSC::Interpreter::resetTimeoutCheck):
21617 (JSC::Interpreter::checkTimeout):
21618 (JSC::Interpreter::createExceptionScope):
21619 (JSC::Interpreter::tryCachePutByID):
21620 (JSC::Interpreter::uncachePutByID):
21621 (JSC::Interpreter::tryCacheGetByID):
21622 (JSC::Interpreter::uncacheGetByID):
21623 (JSC::Interpreter::privateExecute):
21624 (JSC::Interpreter::retrieveArguments):
21625 (JSC::Interpreter::retrieveCaller):
21626 (JSC::Interpreter::retrieveLastCaller):
21627 (JSC::Interpreter::findFunctionCallFrame):
21628 (JSC::Interpreter::tryCTICachePutByID):
21629 (JSC::Interpreter::tryCTICacheGetByID):
21630 (JSC::Interpreter::cti_op_convert_this):
21631 (JSC::Interpreter::cti_op_end):
21632 (JSC::Interpreter::cti_op_add):
21633 (JSC::Interpreter::cti_op_pre_inc):
21634 (JSC::Interpreter::cti_timeout_check):
21635 (JSC::Interpreter::cti_register_file_check):
21636 (JSC::Interpreter::cti_op_loop_if_less):
21637 (JSC::Interpreter::cti_op_loop_if_lesseq):
21638 (JSC::Interpreter::cti_op_new_object):
21639 (JSC::Interpreter::cti_op_put_by_id):
21640 (JSC::Interpreter::cti_op_put_by_id_second):
21641 (JSC::Interpreter::cti_op_put_by_id_generic):
21642 (JSC::Interpreter::cti_op_put_by_id_fail):
21643 (JSC::Interpreter::cti_op_get_by_id):
21644 (JSC::Interpreter::cti_op_get_by_id_second):
21645 (JSC::Interpreter::cti_op_get_by_id_generic):
21646 (JSC::Interpreter::cti_op_get_by_id_fail):
21647 (JSC::Interpreter::cti_op_instanceof):
21648 (JSC::Interpreter::cti_op_del_by_id):
21649 (JSC::Interpreter::cti_op_mul):
21650 (JSC::Interpreter::cti_op_new_func):
21651 (JSC::Interpreter::cti_op_call_JSFunction):
21652 (JSC::Interpreter::cti_op_call_arityCheck):
21653 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
21654 (JSC::Interpreter::cti_vm_lazyLinkCall):
21655 (JSC::Interpreter::cti_op_push_activation):
21656 (JSC::Interpreter::cti_op_call_NotJSFunction):
21657 (JSC::Interpreter::cti_op_create_arguments):
21658 (JSC::Interpreter::cti_op_create_arguments_no_params):
21659 (JSC::Interpreter::cti_op_tear_off_activation):
21660 (JSC::Interpreter::cti_op_tear_off_arguments):
21661 (JSC::Interpreter::cti_op_profile_will_call):
21662 (JSC::Interpreter::cti_op_profile_did_call):
21663 (JSC::Interpreter::cti_op_ret_scopeChain):
21664 (JSC::Interpreter::cti_op_new_array):
21665 (JSC::Interpreter::cti_op_resolve):
21666 (JSC::Interpreter::cti_op_construct_JSConstruct):
21667 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
21668 (JSC::Interpreter::cti_op_get_by_val):
21669 (JSC::Interpreter::cti_op_resolve_func):
21670 (JSC::Interpreter::cti_op_sub):
21671 (JSC::Interpreter::cti_op_put_by_val):
21672 (JSC::Interpreter::cti_op_put_by_val_array):
21673 (JSC::Interpreter::cti_op_lesseq):
21674 (JSC::Interpreter::cti_op_loop_if_true):
21675 (JSC::Interpreter::cti_op_negate):
21676 (JSC::Interpreter::cti_op_resolve_base):
21677 (JSC::Interpreter::cti_op_resolve_skip):
21678 (JSC::Interpreter::cti_op_resolve_global):
21679 (JSC::Interpreter::cti_op_div):
21680 (JSC::Interpreter::cti_op_pre_dec):
21681 (JSC::Interpreter::cti_op_jless):
21682 (JSC::Interpreter::cti_op_not):
21683 (JSC::Interpreter::cti_op_jtrue):
21684 (JSC::Interpreter::cti_op_post_inc):
21685 (JSC::Interpreter::cti_op_eq):
21686 (JSC::Interpreter::cti_op_lshift):
21687 (JSC::Interpreter::cti_op_bitand):
21688 (JSC::Interpreter::cti_op_rshift):
21689 (JSC::Interpreter::cti_op_bitnot):
21690 (JSC::Interpreter::cti_op_resolve_with_base):
21691 (JSC::Interpreter::cti_op_new_func_exp):
21692 (JSC::Interpreter::cti_op_mod):
21693 (JSC::Interpreter::cti_op_less):
21694 (JSC::Interpreter::cti_op_neq):
21695 (JSC::Interpreter::cti_op_post_dec):
21696 (JSC::Interpreter::cti_op_urshift):
21697 (JSC::Interpreter::cti_op_bitxor):
21698 (JSC::Interpreter::cti_op_new_regexp):
21699 (JSC::Interpreter::cti_op_bitor):
21700 (JSC::Interpreter::cti_op_call_eval):
21701 (JSC::Interpreter::cti_op_throw):
21702 (JSC::Interpreter::cti_op_get_pnames):
21703 (JSC::Interpreter::cti_op_next_pname):
21704 (JSC::Interpreter::cti_op_push_scope):
21705 (JSC::Interpreter::cti_op_pop_scope):
21706 (JSC::Interpreter::cti_op_typeof):
21707 (JSC::Interpreter::cti_op_is_undefined):
21708 (JSC::Interpreter::cti_op_is_boolean):
21709 (JSC::Interpreter::cti_op_is_number):
21710 (JSC::Interpreter::cti_op_is_string):
21711 (JSC::Interpreter::cti_op_is_object):
21712 (JSC::Interpreter::cti_op_is_function):
21713 (JSC::Interpreter::cti_op_stricteq):
21714 (JSC::Interpreter::cti_op_nstricteq):
21715 (JSC::Interpreter::cti_op_to_jsnumber):
21716 (JSC::Interpreter::cti_op_in):
21717 (JSC::Interpreter::cti_op_push_new_scope):
21718 (JSC::Interpreter::cti_op_jmp_scopes):
21719 (JSC::Interpreter::cti_op_put_by_index):
21720 (JSC::Interpreter::cti_op_switch_imm):
21721 (JSC::Interpreter::cti_op_switch_char):
21722 (JSC::Interpreter::cti_op_switch_string):
21723 (JSC::Interpreter::cti_op_del_by_val):
21724 (JSC::Interpreter::cti_op_put_getter):
21725 (JSC::Interpreter::cti_op_put_setter):
21726 (JSC::Interpreter::cti_op_new_error):
21727 (JSC::Interpreter::cti_op_debug):
21728 (JSC::Interpreter::cti_vm_throw):
21729 * VM/Machine.h:
21730 * VM/Register.h:
21731 * VM/SamplingTool.h:
21732 (JSC::SamplingTool::SamplingTool):
21733 * bytecompiler/CodeGenerator.cpp:
21734 (JSC::BytecodeGenerator::generate):
21735 (JSC::BytecodeGenerator::BytecodeGenerator):
21736 * jsc.cpp:
21737 (runWithScripts):
21738 * runtime/ExecState.h:
21739 (JSC::ExecState::interpreter):
21740 * runtime/JSCell.h:
21741 * runtime/JSFunction.h:
21742 * runtime/JSGlobalData.cpp:
21743 (JSC::JSGlobalData::JSGlobalData):
21744 * runtime/JSGlobalData.h:
21745 * runtime/JSString.h:
21746 * wrec/WREC.cpp:
21747 (WREC::compileRegExp):
21748 * wrec/WREC.h:
21749
21750 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21751
21752 Roll out r38461 (my last patch) because it broke the world.
21753
21754 2008-11-16 Geoffrey Garen <ggaren@apple.com>
21755
21756 Reviewed by Sam Weinig.
21757
21758 A few more renames:
21759
21760 BytecodeInterpreter => Interpreter
21761 WREC => JSC::WREC, removing JSC:: prefix in a lot of places
21762 X86Assembler::copy => X86Assembler::executableCopy
21763 AssemblerBuffer::copy => AssemblerBuffer::executableCopy
21764 WRECFunction => WREC::RegExpFunction
21765 OBJECT_OFFSET => FIELD_OFFSET
21766
21767 Also:
21768
21769 Nixed use of OBJECT_OFFSET outside of CTI.cpp by making CTI a friend in more places.
21770 Nixed X86:: and X86Assembler:: prefixes in a lot of places using typedefs
21771
21772 * JavaScriptCore.exp:
21773 * VM/CTI.cpp:
21774 (JSC::):
21775 (JSC::CTI::emitGetVirtualRegister):
21776 (JSC::CTI::emitGetVirtualRegisters):
21777 (JSC::CTI::emitPutCTIArgFromVirtualRegister):
21778 (JSC::CTI::emitPutCTIArg):
21779 (JSC::CTI::emitGetCTIArg):
21780 (JSC::CTI::emitPutCTIParam):
21781 (JSC::CTI::emitGetCTIParam):
21782 (JSC::CTI::emitPutToCallFrameHeader):
21783 (JSC::CTI::emitGetFromCallFrameHeader):
21784 (JSC::CTI::emitPutVirtualRegister):
21785 (JSC::CTI::emitNakedCall):
21786 (JSC::CTI::emitNakedFastCall):
21787 (JSC::CTI::emitCTICall):
21788 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
21789 (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
21790 (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
21791 (JSC::CTI::emitFastArithDeTagImmediate):
21792 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
21793 (JSC::CTI::emitFastArithReTagImmediate):
21794 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
21795 (JSC::CTI::emitFastArithImmToInt):
21796 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
21797 (JSC::CTI::emitFastArithIntToImmNoCheck):
21798 (JSC::CTI::emitArithIntToImmWithJump):
21799 (JSC::CTI::emitTagAsBoolImmediate):
21800 (JSC::CTI::compileOpCallInitializeCallFrame):
21801 (JSC::CTI::compileOpCall):
21802 (JSC::CTI::compileOpStrictEq):
21803 (JSC::CTI::emitSlowScriptCheck):
21804 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
21805 (JSC::CTI::compileBinaryArithOp):
21806 (JSC::CTI::compileBinaryArithOpSlowCase):
21807 (JSC::CTI::privateCompileMainPass):
21808 (JSC::CTI::privateCompileSlowCases):
21809 (JSC::CTI::privateCompile):
21810 (JSC::CTI::privateCompileGetByIdSelf):
21811 (JSC::CTI::privateCompileGetByIdProto):
21812 (JSC::CTI::privateCompileGetByIdChain):
21813 (JSC::CTI::privateCompilePutByIdReplace):
21814 (JSC::CTI::privateCompilePutByIdTransition):
21815 (JSC::CTI::privateCompileCTIMachineTrampolines):
21816 (JSC::CTI::freeCTIMachineTrampolines):
21817 (JSC::CTI::patchGetByIdSelf):
21818 (JSC::CTI::patchPutByIdReplace):
21819 (JSC::CTI::privateCompilePatchGetArrayLength):
21820 (JSC::CTI::emitGetVariableObjectRegister):
21821 (JSC::CTI::emitPutVariableObjectRegister):
21822 * VM/CTI.h:
21823 (JSC::CallRecord::CallRecord):
21824 (JSC::JmpTable::JmpTable):
21825 (JSC::SlowCaseEntry::SlowCaseEntry):
21826 (JSC::CTI::JSRInfo::JSRInfo):
21827 * VM/CodeBlock.cpp:
21828 (JSC::CodeBlock::printStructures):
21829 (JSC::CodeBlock::derefStructures):
21830 (JSC::CodeBlock::refStructures):
21831 * VM/Machine.cpp:
21832 (JSC::jsLess):
21833 (JSC::jsLessEq):
21834 (JSC::Interpreter::resolve):
21835 (JSC::Interpreter::resolveSkip):
21836 (JSC::Interpreter::resolveGlobal):
21837 (JSC::Interpreter::resolveBase):
21838 (JSC::Interpreter::resolveBaseAndProperty):
21839 (JSC::Interpreter::resolveBaseAndFunc):
21840 (JSC::Interpreter::slideRegisterWindowForCall):
21841 (JSC::Interpreter::callEval):
21842 (JSC::Interpreter::Interpreter):
21843 (JSC::Interpreter::initialize):
21844 (JSC::Interpreter::~Interpreter):
21845 (JSC::Interpreter::dumpCallFrame):
21846 (JSC::Interpreter::dumpRegisters):
21847 (JSC::Interpreter::isOpcode):
21848 (JSC::Interpreter::unwindCallFrame):
21849 (JSC::Interpreter::throwException):
21850 (JSC::Interpreter::execute):
21851 (JSC::Interpreter::debug):
21852 (JSC::Interpreter::resetTimeoutCheck):
21853 (JSC::Interpreter::checkTimeout):
21854 (JSC::Interpreter::createExceptionScope):
21855 (JSC::Interpreter::tryCachePutByID):
21856 (JSC::Interpreter::uncachePutByID):
21857 (JSC::Interpreter::tryCacheGetByID):
21858 (JSC::Interpreter::uncacheGetByID):
21859 (JSC::Interpreter::privateExecute):
21860 (JSC::Interpreter::retrieveArguments):
21861 (JSC::Interpreter::retrieveCaller):
21862 (JSC::Interpreter::retrieveLastCaller):
21863 (JSC::Interpreter::findFunctionCallFrame):
21864 (JSC::Interpreter::tryCTICachePutByID):
21865 (JSC::Interpreter::tryCTICacheGetByID):
21866 (JSC::):
21867 (JSC::Interpreter::cti_op_convert_this):
21868 (JSC::Interpreter::cti_op_end):
21869 (JSC::Interpreter::cti_op_add):
21870 (JSC::Interpreter::cti_op_pre_inc):
21871 (JSC::Interpreter::cti_timeout_check):
21872 (JSC::Interpreter::cti_register_file_check):
21873 (JSC::Interpreter::cti_op_loop_if_less):
21874 (JSC::Interpreter::cti_op_loop_if_lesseq):
21875 (JSC::Interpreter::cti_op_new_object):
21876 (JSC::Interpreter::cti_op_put_by_id):
21877 (JSC::Interpreter::cti_op_put_by_id_second):
21878 (JSC::Interpreter::cti_op_put_by_id_generic):
21879 (JSC::Interpreter::cti_op_put_by_id_fail):
21880 (JSC::Interpreter::cti_op_get_by_id):
21881 (JSC::Interpreter::cti_op_get_by_id_second):
21882 (JSC::Interpreter::cti_op_get_by_id_generic):
21883 (JSC::Interpreter::cti_op_get_by_id_fail):
21884 (JSC::Interpreter::cti_op_instanceof):
21885 (JSC::Interpreter::cti_op_del_by_id):
21886 (JSC::Interpreter::cti_op_mul):
21887 (JSC::Interpreter::cti_op_new_func):
21888 (JSC::Interpreter::cti_op_call_JSFunction):
21889 (JSC::Interpreter::cti_op_call_arityCheck):
21890 (JSC::Interpreter::cti_vm_dontLazyLinkCall):
21891 (JSC::Interpreter::cti_vm_lazyLinkCall):
21892 (JSC::Interpreter::cti_op_push_activation):
21893 (JSC::Interpreter::cti_op_call_NotJSFunction):
21894 (JSC::Interpreter::cti_op_create_arguments):
21895 (JSC::Interpreter::cti_op_create_arguments_no_params):
21896 (JSC::Interpreter::cti_op_tear_off_activation):
21897 (JSC::Interpreter::cti_op_tear_off_arguments):
21898 (JSC::Interpreter::cti_op_profile_will_call):
21899 (JSC::Interpreter::cti_op_profile_did_call):
21900 (JSC::Interpreter::cti_op_ret_scopeChain):
21901 (JSC::Interpreter::cti_op_new_array):
21902 (JSC::Interpreter::cti_op_resolve):
21903 (JSC::Interpreter::cti_op_construct_JSConstruct):
21904 (JSC::Interpreter::cti_op_construct_NotJSConstruct):
21905 (JSC::Interpreter::cti_op_get_by_val):
21906 (JSC::Interpreter::cti_op_resolve_func):
21907 (JSC::Interpreter::cti_op_sub):
21908 (JSC::Interpreter::cti_op_put_by_val):
21909 (JSC::Interpreter::cti_op_put_by_val_array):
21910 (JSC::Interpreter::cti_op_lesseq):
21911 (JSC::Interpreter::cti_op_loop_if_true):
21912 (JSC::Interpreter::cti_op_negate):
21913 (JSC::Interpreter::cti_op_resolve_base):
21914 (JSC::Interpreter::cti_op_resolve_skip):
21915 (JSC::Interpreter::cti_op_resolve_global):
21916 (JSC::Interpreter::cti_op_div):
21917 (JSC::Interpreter::cti_op_pre_dec):
21918 (JSC::Interpreter::cti_op_jless):
21919 (JSC::Interpreter::cti_op_not):
21920 (JSC::Interpreter::cti_op_jtrue):
21921 (JSC::Interpreter::cti_op_post_inc):
21922 (JSC::Interpreter::cti_op_eq):
21923 (JSC::Interpreter::cti_op_lshift):
21924 (JSC::Interpreter::cti_op_bitand):
21925 (JSC::Interpreter::cti_op_rshift):
21926 (JSC::Interpreter::cti_op_bitnot):
21927 (JSC::Interpreter::cti_op_resolve_with_base):
21928 (JSC::Interpreter::cti_op_new_func_exp):
21929 (JSC::Interpreter::cti_op_mod):
21930 (JSC::Interpreter::cti_op_less):
21931 (JSC::Interpreter::cti_op_neq):
21932 (JSC::Interpreter::cti_op_post_dec):
21933 (JSC::Interpreter::cti_op_urshift):
21934 (JSC::Interpreter::cti_op_bitxor):
21935 (JSC::Interpreter::cti_op_new_regexp):
21936 (JSC::Interpreter::cti_op_bitor):
21937 (JSC::Interpreter::cti_op_call_eval):
21938 (JSC::Interpreter::cti_op_throw):
21939 (JSC::Interpreter::cti_op_get_pnames):
21940 (JSC::Interpreter::cti_op_next_pname):
21941 (JSC::Interpreter::cti_op_push_scope):
21942 (JSC::Interpreter::cti_op_pop_scope):
21943 (JSC::Interpreter::cti_op_typeof):
21944 (JSC::Interpreter::cti_op_is_undefined):
21945 (JSC::Interpreter::cti_op_is_boolean):
21946 (JSC::Interpreter::cti_op_is_number):
21947 (JSC::Interpreter::cti_op_is_string):
21948 (JSC::Interpreter::cti_op_is_object):
21949 (JSC::Interpreter::cti_op_is_function):
21950 (JSC::Interpreter::cti_op_stricteq):
21951 (JSC::Interpreter::cti_op_nstricteq):
21952 (JSC::Interpreter::cti_op_to_jsnumber):
21953 (JSC::Interpreter::cti_op_in):
21954 (JSC::Interpreter::cti_op_push_new_scope):
21955 (JSC::Interpreter::cti_op_jmp_scopes):
21956 (JSC::Interpreter::cti_op_put_by_index):
21957 (JSC::Interpreter::cti_op_switch_imm):
21958 (JSC::Interpreter::cti_op_switch_char):
21959 (JSC::Interpreter::cti_op_switch_string):
21960 (JSC::Interpreter::cti_op_del_by_val):
21961 (JSC::Interpreter::cti_op_put_getter):
21962 (JSC::Interpreter::cti_op_put_setter):
21963 (JSC::Interpreter::cti_op_new_error):
21964 (JSC::Interpreter::cti_op_debug):
21965 (JSC::Interpreter::cti_vm_throw):
21966 * VM/Machine.h:
21967 * VM/Register.h:
21968 * VM/SamplingTool.cpp:
21969 (JSC::SamplingTool::dump):
21970 * VM/SamplingTool.h:
21971 (JSC::SamplingTool::SamplingTool):
21972 * bytecompiler/CodeGenerator.cpp:
21973 (JSC::BytecodeGenerator::generate):
21974 (JSC::BytecodeGenerator::BytecodeGenerator):
21975 * jsc.cpp:
21976 (runWithScripts):
21977 * masm/X86Assembler.h:
21978 (JSC::AssemblerBuffer::executableCopy):
21979 (JSC::X86Assembler::executableCopy):
21980 * runtime/ExecState.h:
21981 (JSC::ExecState::interpreter):
21982 * runtime/JSCell.h:
21983 * runtime/JSFunction.h:
21984 * runtime/JSGlobalData.cpp:
21985 (JSC::JSGlobalData::JSGlobalData):
21986 * runtime/JSGlobalData.h:
21987 * runtime/JSImmediate.h:
21988 * runtime/JSString.h:
21989 * runtime/JSValue.h:
21990 * runtime/JSVariableObject.h:
21991 * runtime/RegExp.cpp:
21992 (JSC::RegExp::RegExp):
21993 (JSC::RegExp::~RegExp):
21994 (JSC::RegExp::match):
21995 * runtime/RegExp.h:
21996 * wrec/CharacterClassConstructor.cpp:
21997 * wrec/CharacterClassConstructor.h:
21998 * wrec/WREC.cpp:
21999 (JSC::WREC::compileRegExp):
22000 * wrec/WREC.h:
22001 (JSC::WREC::Generator::Generator):
22002 (JSC::WREC::Parser::):
22003 (JSC::WREC::Parser::Parser):
22004 (JSC::WREC::Parser::parseAlternative):
22005
22006 2008-11-16 Greg Bolsinga <bolsinga@apple.com>
22007
22008 Reviewed by Darin Adler.
22009
22010 https://bugs.webkit.org/show_bug.cgi?id=21810
22011 Remove use of static C++ objects that are destroyed at exit time (destructors)
22012
22013 Conditionally have the DEFINE_STATIC_LOCAL workaround <rdar://problem/6354696>
22014 (Codegen issue with C++ static reference in gcc build 5465) based upon the compiler
22015 build versions. It will use the:
22016 static T& = *new T;
22017 style for all other compilers.
22018
22019 * wtf/StdLibExtras.h:
22020
22021 2008-11-16 Alexey Proskuryakov <ap@webkit.org>
22022
22023 Reviewed by Dan Bernstein.
22024
22025 https://bugs.webkit.org/show_bug.cgi?id=22290
22026 Remove cross-heap GC and MessagePort multi-threading support
22027
22028 It is broken (and may not be implementable at all), and no longer needed, as we
22029 don't use MessagePorts for communication with workers any more.
22030
22031 * JavaScriptCore.exp:
22032 * runtime/Collector.cpp:
22033 (JSC::Heap::collect):
22034 * runtime/JSGlobalObject.cpp:
22035 * runtime/JSGlobalObject.h:
22036 Remove hooks for cross-heap GC.
22037
22038 2008-11-15 Sam Weinig <sam@webkit.org>
22039
22040 Reviewed by Cameron Zwarich.
22041
22042 Cleanup jsc command line code a little.
22043
22044 * jsc.cpp:
22045 (functionQuit):
22046 (main): Use standard exit status macros
22047 (cleanupGlobalData): Factor out cleanup code into this function.
22048 (printUsageStatement): Use standard exit status macros.
22049
22050 2008-11-15 Sam Weinig <sam@webkit.org>
22051
22052 Reviewed by Cameron Zwarich.
22053
22054 Cleanup BytecodeGenerator constructors.
22055
22056 * bytecompiler/CodeGenerator.cpp:
22057 (JSC::BytecodeGenerator::BytecodeGenerator):
22058 * bytecompiler/CodeGenerator.h:
22059 * parser/Nodes.cpp:
22060 (JSC::ProgramNode::generateBytecode):
22061
22062 2008-11-15 Darin Adler <darin@apple.com>
22063
22064 Rubber stamped by Geoff Garen.
22065
22066 - do the long-planned StructureID -> Structure rename
22067
22068 * API/JSCallbackConstructor.cpp:
22069 (JSC::JSCallbackConstructor::JSCallbackConstructor):
22070 * API/JSCallbackConstructor.h:
22071 (JSC::JSCallbackConstructor::createStructure):
22072 * API/JSCallbackFunction.h:
22073 (JSC::JSCallbackFunction::createStructure):
22074 * API/JSCallbackObject.h:
22075 (JSC::JSCallbackObject::createStructure):
22076 * API/JSCallbackObjectFunctions.h:
22077 (JSC::::JSCallbackObject):
22078 * API/JSValueRef.cpp:
22079 (JSValueIsInstanceOfConstructor):
22080 * GNUmakefile.am:
22081 * JavaScriptCore.exp:
22082 * JavaScriptCore.pri:
22083 * JavaScriptCore.scons:
22084 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
22085 * JavaScriptCore.xcodeproj/project.pbxproj:
22086 * JavaScriptCoreSources.bkl:
22087 * VM/CTI.cpp:
22088 (JSC::CTI::compileBinaryArithOp):
22089 (JSC::CTI::privateCompileMainPass):
22090 (JSC::CTI::privateCompileGetByIdSelf):
22091 (JSC::CTI::privateCompileGetByIdProto):
22092 (JSC::CTI::privateCompileGetByIdChain):
22093 (JSC::CTI::privateCompilePutByIdReplace):
22094 (JSC::transitionWillNeedStorageRealloc):
22095 (JSC::CTI::privateCompilePutByIdTransition):
22096 (JSC::CTI::patchGetByIdSelf):
22097 (JSC::CTI::patchPutByIdReplace):
22098 * VM/CTI.h:
22099 (JSC::CTI::compileGetByIdSelf):
22100 (JSC::CTI::compileGetByIdProto):
22101 (JSC::CTI::compileGetByIdChain):
22102 (JSC::CTI::compilePutByIdReplace):
22103 (JSC::CTI::compilePutByIdTransition):
22104 * VM/CodeBlock.cpp:
22105 (JSC::CodeBlock::printStructure):
22106 (JSC::CodeBlock::printStructures):
22107 (JSC::CodeBlock::dump):
22108 (JSC::CodeBlock::~CodeBlock):
22109 (JSC::CodeBlock::derefStructures):
22110 (JSC::CodeBlock::refStructures):
22111 * VM/CodeBlock.h:
22112 * VM/Instruction.h:
22113 (JSC::Instruction::Instruction):
22114 (JSC::Instruction::):
22115 * VM/Machine.cpp:
22116 (JSC::jsTypeStringForValue):
22117 (JSC::jsIsObjectType):
22118 (JSC::BytecodeInterpreter::resolveGlobal):
22119 (JSC::BytecodeInterpreter::BytecodeInterpreter):
22120 (JSC::cachePrototypeChain):
22121 (JSC::BytecodeInterpreter::tryCachePutByID):
22122 (JSC::BytecodeInterpreter::uncachePutByID):
22123 (JSC::BytecodeInterpreter::tryCacheGetByID):
22124 (JSC::BytecodeInterpreter::uncacheGetByID):
22125 (JSC::BytecodeInterpreter::privateExecute):
22126 (JSC::BytecodeInterpreter::tryCTICachePutByID):
22127 (JSC::BytecodeInterpreter::tryCTICacheGetByID):
22128 (JSC::BytecodeInterpreter::cti_op_instanceof):
22129 (JSC::BytecodeInterpreter::cti_op_construct_JSConstruct):
22130 (JSC::BytecodeInterpreter::cti_op_resolve_global):
22131 (JSC::BytecodeInterpreter::cti_op_is_undefined):
22132 * runtime/Arguments.h:
22133 (JSC::Arguments::createStructure):
22134 * runtime/ArrayConstructor.cpp:
22135 (JSC::ArrayConstructor::ArrayConstructor):
22136 * runtime/ArrayConstructor.h:
22137 * runtime/ArrayPrototype.cpp:
22138 (JSC::ArrayPrototype::ArrayPrototype):
22139 * runtime/ArrayPrototype.h:
22140 * runtime/BatchedTransitionOptimizer.h:
22141 (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
22142 (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):
22143 * runtime/BooleanConstructor.cpp:
22144 (JSC::BooleanConstructor::BooleanConstructor):
22145 * runtime/BooleanConstructor.h:
22146 * runtime/BooleanObject.cpp:
22147 (JSC::BooleanObject::BooleanObject):
22148 * runtime/BooleanObject.h:
22149 * runtime/BooleanPrototype.cpp:
22150 (JSC::BooleanPrototype::BooleanPrototype):
22151 * runtime/BooleanPrototype.h:
22152 * runtime/DateConstructor.cpp:
22153 (JSC::DateConstructor::DateConstructor):
22154 * runtime/DateConstructor.h:
22155 * runtime/DateInstance.cpp:
22156 (JSC::DateInstance::DateInstance):
22157 * runtime/DateInstance.h:
22158 * runtime/DatePrototype.cpp:
22159 (JSC::DatePrototype::DatePrototype):
22160 * runtime/DatePrototype.h:
22161 (JSC::DatePrototype::createStructure):
22162 * runtime/ErrorConstructor.cpp:
22163 (JSC::ErrorConstructor::ErrorConstructor):
22164 * runtime/ErrorConstructor.h:
22165 * runtime/ErrorInstance.cpp:
22166 (JSC::ErrorInstance::ErrorInstance):
22167 * runtime/ErrorInstance.h:
22168 * runtime/ErrorPrototype.cpp:
22169 (JSC::ErrorPrototype::ErrorPrototype):
22170 * runtime/ErrorPrototype.h:
22171 * runtime/FunctionConstructor.cpp:
22172 (JSC::FunctionConstructor::FunctionConstructor):
22173 * runtime/FunctionConstructor.h:
22174 * runtime/FunctionPrototype.cpp:
22175 (JSC::FunctionPrototype::FunctionPrototype):
22176 (JSC::FunctionPrototype::addFunctionProperties):
22177 * runtime/FunctionPrototype.h:
22178 (JSC::FunctionPrototype::createStructure):
22179 * runtime/GlobalEvalFunction.cpp:
22180 (JSC::GlobalEvalFunction::GlobalEvalFunction):
22181 * runtime/GlobalEvalFunction.h:
22182 * runtime/Identifier.h:
22183 * runtime/InternalFunction.cpp:
22184 (JSC::InternalFunction::InternalFunction):
22185 * runtime/InternalFunction.h:
22186 (JSC::InternalFunction::createStructure):
22187 (JSC::InternalFunction::InternalFunction):
22188 * runtime/JSActivation.cpp:
22189 (JSC::JSActivation::JSActivation):
22190 * runtime/JSActivation.h:
22191 (JSC::JSActivation::createStructure):
22192 * runtime/JSArray.cpp:
22193 (JSC::JSArray::JSArray):
22194 * runtime/JSArray.h:
22195 (JSC::JSArray::createStructure):
22196 * runtime/JSCell.h:
22197 (JSC::JSCell::JSCell):
22198 (JSC::JSCell::isObject):
22199 (JSC::JSCell::isString):
22200 (JSC::JSCell::structure):
22201 (JSC::JSValue::needsThisConversion):
22202 * runtime/JSFunction.cpp:
22203 (JSC::JSFunction::construct):
22204 * runtime/JSFunction.h:
22205 (JSC::JSFunction::JSFunction):
22206 (JSC::JSFunction::createStructure):
22207 * runtime/JSGlobalData.cpp:
22208 (JSC::JSGlobalData::JSGlobalData):
22209 (JSC::JSGlobalData::createLeaked):
22210 * runtime/JSGlobalData.h:
22211 * runtime/JSGlobalObject.cpp:
22212 (JSC::markIfNeeded):
22213 (JSC::JSGlobalObject::reset):
22214 * runtime/JSGlobalObject.h:
22215 (JSC::JSGlobalObject::JSGlobalObject):
22216 (JSC::JSGlobalObject::argumentsStructure):
22217 (JSC::JSGlobalObject::arrayStructure):
22218 (JSC::JSGlobalObject::booleanObjectStructure):
22219 (JSC::JSGlobalObject::callbackConstructorStructure):
22220 (JSC::JSGlobalObject::callbackFunctionStructure):
22221 (JSC::JSGlobalObject::callbackObjectStructure):
22222 (JSC::JSGlobalObject::dateStructure):
22223 (JSC::JSGlobalObject::emptyObjectStructure):
22224 (JSC::JSGlobalObject::errorStructure):
22225 (JSC::JSGlobalObject::functionStructure):
22226 (JSC::JSGlobalObject::numberObjectStructure):
22227 (JSC::JSGlobalObject::prototypeFunctionStructure):
22228 (JSC::JSGlobalObject::regExpMatchesArrayStructure):
22229 (JSC::JSGlobalObject::regExpStructure):
22230 (JSC::JSGlobalObject::stringObjectStructure):
22231 (JSC::JSGlobalObject::createStructure):
22232 (JSC::Structure::prototypeForLookup):
22233 * runtime/JSNotAnObject.h:
22234 (JSC::JSNotAnObject::createStructure):
22235 * runtime/JSNumberCell.h:
22236 (JSC::JSNumberCell::createStructure):
22237 (JSC::JSNumberCell::JSNumberCell):
22238 * runtime/JSObject.cpp:
22239 (JSC::JSObject::mark):
22240 (JSC::JSObject::put):
22241 (JSC::JSObject::deleteProperty):
22242 (JSC::JSObject::defineGetter):
22243 (JSC::JSObject::defineSetter):
22244 (JSC::JSObject::getPropertyAttributes):
22245 (JSC::JSObject::getPropertyNames):
22246 (JSC::JSObject::removeDirect):
22247 (JSC::JSObject::createInheritorID):
22248 * runtime/JSObject.h:
22249 (JSC::JSObject::getDirect):
22250 (JSC::JSObject::getDirectLocation):
22251 (JSC::JSObject::hasCustomProperties):
22252 (JSC::JSObject::hasGetterSetterProperties):
22253 (JSC::JSObject::createStructure):
22254 (JSC::JSObject::JSObject):
22255 (JSC::JSObject::~JSObject):
22256 (JSC::JSObject::prototype):
22257 (JSC::JSObject::setPrototype):
22258 (JSC::JSObject::setStructure):
22259 (JSC::JSObject::inheritorID):
22260 (JSC::JSObject::inlineGetOwnPropertySlot):
22261 (JSC::JSObject::getOwnPropertySlotForWrite):
22262 (JSC::JSCell::fastGetOwnPropertySlot):
22263 (JSC::JSObject::putDirect):
22264 (JSC::JSObject::putDirectWithoutTransition):
22265 (JSC::JSObject::transitionTo):
22266 * runtime/JSPropertyNameIterator.h:
22267 (JSC::JSPropertyNameIterator::next):
22268 * runtime/JSStaticScopeObject.h:
22269 (JSC::JSStaticScopeObject::JSStaticScopeObject):
22270 (JSC::JSStaticScopeObject::createStructure):
22271 * runtime/JSString.h:
22272 (JSC::JSString::JSString):
22273 (JSC::JSString::createStructure):
22274 * runtime/JSVariableObject.h:
22275 (JSC::JSVariableObject::JSVariableObject):
22276 * runtime/JSWrapperObject.h:
22277 (JSC::JSWrapperObject::JSWrapperObject):
22278 * runtime/MathObject.cpp:
22279 (JSC::MathObject::MathObject):
22280 * runtime/MathObject.h:
22281 (JSC::MathObject::createStructure):
22282 * runtime/NativeErrorConstructor.cpp:
22283 (JSC::NativeErrorConstructor::NativeErrorConstructor):
22284 * runtime/NativeErrorConstructor.h:
22285 * runtime/NativeErrorPrototype.cpp:
22286 (JSC::NativeErrorPrototype::NativeErrorPrototype):
22287 * runtime/NativeErrorPrototype.h:
22288 * runtime/NumberConstructor.cpp:
22289 (JSC::NumberConstructor::NumberConstructor):
22290 * runtime/NumberConstructor.h:
22291 (JSC::NumberConstructor::createStructure):
22292 * runtime/NumberObject.cpp:
22293 (JSC::NumberObject::NumberObject):
22294 * runtime/NumberObject.h:
22295 * runtime/NumberPrototype.cpp:
22296 (JSC::NumberPrototype::NumberPrototype):
22297 * runtime/NumberPrototype.h:
22298 * runtime/ObjectConstructor.cpp:
22299 (JSC::ObjectConstructor::ObjectConstructor):
22300 * runtime/ObjectConstructor.h:
22301 * runtime/ObjectPrototype.cpp:
22302 (JSC::ObjectPrototype::ObjectPrototype):
22303 * runtime/ObjectPrototype.h:
22304 * runtime/Operations.h:
22305 (JSC::equalSlowCaseInline):
22306 * runtime/PropertyNameArray.h:
22307 (JSC::PropertyNameArrayData::setCachedStructure):
22308 (JSC::PropertyNameArrayData::cachedStructure):
22309 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
22310 (JSC::PropertyNameArrayData::cachedPrototypeChain):
22311 (JSC::PropertyNameArrayData::PropertyNameArrayData):
22312 * runtime/PrototypeFunction.cpp:
22313 (JSC::PrototypeFunction::PrototypeFunction):
22314 * runtime/PrototypeFunction.h:
22315 * runtime/RegExpConstructor.cpp:
22316 (JSC::RegExpConstructor::RegExpConstructor):
22317 * runtime/RegExpConstructor.h:
22318 (JSC::RegExpConstructor::createStructure):
22319 * runtime/RegExpObject.cpp:
22320 (JSC::RegExpObject::RegExpObject):
22321 * runtime/RegExpObject.h:
22322 (JSC::RegExpObject::createStructure):
22323 * runtime/RegExpPrototype.cpp:
22324 (JSC::RegExpPrototype::RegExpPrototype):
22325 * runtime/RegExpPrototype.h:
22326 * runtime/StringConstructor.cpp:
22327 (JSC::StringConstructor::StringConstructor):
22328 * runtime/StringConstructor.h:
22329 * runtime/StringObject.cpp:
22330 (JSC::StringObject::StringObject):
22331 * runtime/StringObject.h:
22332 (JSC::StringObject::createStructure):
22333 * runtime/StringObjectThatMasqueradesAsUndefined.h:
22334 (JSC::StringObjectThatMasqueradesAsUndefined::create):
22335 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
22336 (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
22337 * runtime/StringPrototype.cpp:
22338 (JSC::StringPrototype::StringPrototype):
22339 * runtime/StringPrototype.h:
22340 * runtime/Structure.cpp: Copied from JavaScriptCore/runtime/StructureID.cpp.
22341 (JSC::Structure::dumpStatistics):
22342 (JSC::Structure::Structure):
22343 (JSC::Structure::~Structure):
22344 (JSC::Structure::startIgnoringLeaks):
22345 (JSC::Structure::stopIgnoringLeaks):
22346 (JSC::Structure::materializePropertyMap):
22347 (JSC::Structure::getEnumerablePropertyNames):
22348 (JSC::Structure::clearEnumerationCache):
22349 (JSC::Structure::growPropertyStorageCapacity):
22350 (JSC::Structure::addPropertyTransitionToExistingStructure):
22351 (JSC::Structure::addPropertyTransition):
22352 (JSC::Structure::removePropertyTransition):
22353 (JSC::Structure::changePrototypeTransition):
22354 (JSC::Structure::getterSetterTransition):
22355 (JSC::Structure::toDictionaryTransition):
22356 (JSC::Structure::fromDictionaryTransition):
22357 (JSC::Structure::addPropertyWithoutTransition):
22358 (JSC::Structure::removePropertyWithoutTransition):
22359 (JSC::Structure::createCachedPrototypeChain):
22360 (JSC::Structure::checkConsistency):
22361 (JSC::Structure::copyPropertyTable):
22362 (JSC::Structure::get):
22363 (JSC::Structure::put):
22364 (JSC::Structure::remove):
22365 (JSC::Structure::insertIntoPropertyMapHashTable):
22366 (JSC::Structure::createPropertyMapHashTable):
22367 (JSC::Structure::expandPropertyMapHashTable):
22368 (JSC::Structure::rehashPropertyMapHashTable):
22369 (JSC::Structure::getEnumerablePropertyNamesInternal):
22370 * runtime/Structure.h: Copied from JavaScriptCore/runtime/StructureID.h.
22371 (JSC::Structure::create):
22372 (JSC::Structure::previousID):
22373 (JSC::Structure::setCachedPrototypeChain):
22374 (JSC::Structure::cachedPrototypeChain):
22375 (JSC::Structure::):
22376 (JSC::Structure::get):
22377 * runtime/StructureChain.cpp: Copied from JavaScriptCore/runtime/StructureIDChain.cpp.
22378 (JSC::StructureChain::StructureChain):
22379 (JSC::structureChainsAreEqual):
22380 * runtime/StructureChain.h: Copied from JavaScriptCore/runtime/StructureIDChain.h.
22381 (JSC::StructureChain::create):
22382 (JSC::StructureChain::head):
22383 * runtime/StructureID.cpp: Removed.
22384 * runtime/StructureID.h: Removed.
22385 * runtime/StructureIDChain.cpp: Removed.
22386 * runtime/StructureIDChain.h: Removed.
22387 * runtime/StructureIDTransitionTable.h: Removed.
22388 * runtime/StructureTransitionTable.h: Copied from JavaScriptCore/runtime/StructureIDTransitionTable.h.
22389
22390 2008-11-15 Darin Adler <darin@apple.com>
22391
22392 - fix non-WREC build
22393
22394 * runtime/RegExp.cpp: Put "using namespace WREC" inside #if ENABLE(WREC).
22395
22396 2008-11-15 Kevin Ollivier <kevino@theolliviers.com>
22397
22398 Reviewed by Timothy Hatcher.
22399
22400 As ThreadingNone doesn't implement threads, isMainThread should return true,
22401 not false.
22402
22403 https://bugs.webkit.org/show_bug.cgi?id=22285
22404
22405 * wtf/ThreadingNone.cpp:
22406 (WTF::isMainThread):
22407
22408 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22409
22410 Reviewed by Sam Weinig.
22411
22412 Moved all WREC-related code into WREC.cpp and put it in a WREC namespace.
22413 Removed the WREC prefix from class names.
22414
22415 * VM/CTI.cpp:
22416 * VM/CTI.h:
22417 * VM/Machine.h:
22418 (JSC::BytecodeInterpreter::assemblerBuffer):
22419 * masm/X86Assembler.h:
22420 * runtime/RegExp.cpp:
22421 (JSC::RegExp::RegExp):
22422 * wrec/CharacterClassConstructor.cpp:
22423 * wrec/CharacterClassConstructor.h:
22424 * wrec/WREC.cpp:
22425 (WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
22426 (WREC::GeneratePatternCharacterFunctor::generateAtom):
22427 (WREC::GeneratePatternCharacterFunctor::backtrack):
22428 (WREC::GenerateCharacterClassFunctor::generateAtom):
22429 (WREC::GenerateCharacterClassFunctor::backtrack):
22430 (WREC::GenerateBackreferenceFunctor::generateAtom):
22431 (WREC::GenerateBackreferenceFunctor::backtrack):
22432 (WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
22433 (WREC::GenerateParenthesesNonGreedyFunctor::backtrack):
22434 (WREC::Generator::generateBacktrack1):
22435 (WREC::Generator::generateBacktrackBackreference):
22436 (WREC::Generator::generateBackreferenceQuantifier):
22437 (WREC::Generator::generateNonGreedyQuantifier):
22438 (WREC::Generator::generateGreedyQuantifier):
22439 (WREC::Generator::generatePatternCharacter):
22440 (WREC::Generator::generateCharacterClassInvertedRange):
22441 (WREC::Generator::generateCharacterClassInverted):
22442 (WREC::Generator::generateCharacterClass):
22443 (WREC::Generator::generateParentheses):
22444 (WREC::Generator::generateParenthesesNonGreedy):
22445 (WREC::Generator::generateParenthesesResetTrampoline):
22446 (WREC::Generator::generateAssertionBOL):
22447 (WREC::Generator::generateAssertionEOL):
22448 (WREC::Generator::generateAssertionWordBoundary):
22449 (WREC::Generator::generateBackreference):
22450 (WREC::Generator::generateDisjunction):
22451 (WREC::Generator::terminateDisjunction):
22452 (WREC::Parser::parseGreedyQuantifier):
22453 (WREC::Parser::parseQuantifier):
22454 (WREC::Parser::parsePatternCharacterQualifier):
22455 (WREC::Parser::parseCharacterClassQuantifier):
22456 (WREC::Parser::parseBackreferenceQuantifier):
22457 (WREC::Parser::parseParentheses):
22458 (WREC::Parser::parseCharacterClass):
22459 (WREC::Parser::parseOctalEscape):
22460 (WREC::Parser::parseEscape):
22461 (WREC::Parser::parseTerm):
22462 (WREC::Parser::parseDisjunction):
22463 (WREC::compileRegExp):
22464 * wrec/WREC.h:
22465 (WREC::Generator::Generator):
22466 (WREC::Parser::Parser):
22467 (WREC::Parser::parseAlternative):
22468
22469 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22470
22471 Reviewed by Sam Weinig.
22472
22473 Changed another case of "m_jit" to "m_assembler".
22474
22475 * VM/CTI.cpp:
22476 * wrec/WREC.cpp:
22477 * wrec/WREC.h:
22478 (JSC::WRECGenerator::WRECGenerator):
22479 (JSC::WRECParser::WRECParser):
22480
22481 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22482
22483 Reviewed by Sam Weinig.
22484
22485 Renamed "jit" to "assembler" and, for brevity, replaced *jit.* with __
22486 using a macro.
22487
22488 * VM/CTI.cpp:
22489 (JSC::CTI::emitGetVirtualRegister):
22490 (JSC::CTI::emitPutCTIArgFromVirtualRegister):
22491 (JSC::CTI::emitPutCTIArg):
22492 (JSC::CTI::emitGetCTIArg):
22493 (JSC::CTI::emitPutCTIArgConstant):
22494 (JSC::CTI::emitPutCTIParam):
22495 (JSC::CTI::emitGetCTIParam):
22496 (JSC::CTI::emitPutToCallFrameHeader):
22497 (JSC::CTI::emitGetFromCallFrameHeader):
22498 (JSC::CTI::emitPutVirtualRegister):
22499 (JSC::CTI::emitInitRegister):
22500 (JSC::CTI::emitAllocateNumber):
22501 (JSC::CTI::emitNakedCall):
22502 (JSC::CTI::emitNakedFastCall):
22503 (JSC::CTI::emitCTICall):
22504 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
22505 (JSC::CTI::linkSlowCaseIfNotJSCell):
22506 (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
22507 (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
22508 (JSC::CTI::emitFastArithDeTagImmediate):
22509 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
22510 (JSC::CTI::emitFastArithReTagImmediate):
22511 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
22512 (JSC::CTI::emitFastArithImmToInt):
22513 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
22514 (JSC::CTI::emitFastArithIntToImmNoCheck):
22515 (JSC::CTI::emitArithIntToImmWithJump):
22516 (JSC::CTI::emitTagAsBoolImmediate):
22517 (JSC::CTI::CTI):
22518 (JSC::CTI::compileOpCallInitializeCallFrame):
22519 (JSC::CTI::compileOpCall):
22520 (JSC::CTI::compileOpStrictEq):
22521 (JSC::CTI::emitSlowScriptCheck):
22522 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
22523 (JSC::CTI::compileBinaryArithOp):
22524 (JSC::CTI::compileBinaryArithOpSlowCase):
22525 (JSC::CTI::privateCompileMainPass):
22526 (JSC::CTI::privateCompileLinkPass):
22527 (JSC::CTI::privateCompileSlowCases):
22528 (JSC::CTI::privateCompile):
22529 (JSC::CTI::privateCompileGetByIdSelf):
22530 (JSC::CTI::privateCompileGetByIdProto):
22531 (JSC::CTI::privateCompileGetByIdChain):
22532 (JSC::CTI::privateCompilePutByIdReplace):
22533 (JSC::CTI::privateCompilePutByIdTransition):
22534 (JSC::CTI::privateCompileCTIMachineTrampolines):
22535 (JSC::CTI::privateCompilePatchGetArrayLength):
22536 (JSC::CTI::emitGetVariableObjectRegister):
22537 (JSC::CTI::emitPutVariableObjectRegister):
22538 (JSC::CTI::compileRegExp):
22539 * VM/CTI.h:
22540 * wrec/WREC.cpp:
22541 (JSC::WRECGenerator::generateBacktrack1):
22542 (JSC::WRECGenerator::generateBacktrackBackreference):
22543 (JSC::WRECGenerator::generateBackreferenceQuantifier):
22544 (JSC::WRECGenerator::generateNonGreedyQuantifier):
22545 (JSC::WRECGenerator::generateGreedyQuantifier):
22546 (JSC::WRECGenerator::generatePatternCharacter):
22547 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
22548 (JSC::WRECGenerator::generateCharacterClassInverted):
22549 (JSC::WRECGenerator::generateCharacterClass):
22550 (JSC::WRECGenerator::generateParentheses):
22551 (JSC::WRECGenerator::generateParenthesesNonGreedy):
22552 (JSC::WRECGenerator::generateParenthesesResetTrampoline):
22553 (JSC::WRECGenerator::generateAssertionBOL):
22554 (JSC::WRECGenerator::generateAssertionEOL):
22555 (JSC::WRECGenerator::generateAssertionWordBoundary):
22556 (JSC::WRECGenerator::generateBackreference):
22557 (JSC::WRECGenerator::generateDisjunction):
22558 (JSC::WRECGenerator::terminateDisjunction):
22559
22560 2008-11-15 Sam Weinig <sam@webkit.org>
22561
22562 Reviewed by Geoffrey Garen.
22563
22564 Remove dead method declaration.
22565
22566 * bytecompiler/CodeGenerator.h:
22567
22568 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22569
22570 Reviewed by Sam Weinig.
22571
22572 Renamed LabelID to Label, Label::isForwardLabel to Label::isForward.
22573
22574 * VM/LabelID.h:
22575 (JSC::Label::Label):
22576 (JSC::Label::isForward):
22577 * bytecompiler/CodeGenerator.cpp:
22578 (JSC::BytecodeGenerator::newLabel):
22579 (JSC::BytecodeGenerator::emitLabel):
22580 (JSC::BytecodeGenerator::emitJump):
22581 (JSC::BytecodeGenerator::emitJumpIfTrue):
22582 (JSC::BytecodeGenerator::emitJumpIfFalse):
22583 (JSC::BytecodeGenerator::pushFinallyContext):
22584 (JSC::BytecodeGenerator::emitComplexJumpScopes):
22585 (JSC::BytecodeGenerator::emitJumpScopes):
22586 (JSC::BytecodeGenerator::emitNextPropertyName):
22587 (JSC::BytecodeGenerator::emitCatch):
22588 (JSC::BytecodeGenerator::emitJumpSubroutine):
22589 (JSC::prepareJumpTableForImmediateSwitch):
22590 (JSC::prepareJumpTableForCharacterSwitch):
22591 (JSC::prepareJumpTableForStringSwitch):
22592 (JSC::BytecodeGenerator::endSwitch):
22593 * bytecompiler/CodeGenerator.h:
22594 * bytecompiler/LabelScope.h:
22595 (JSC::LabelScope::LabelScope):
22596 (JSC::LabelScope::breakTarget):
22597 (JSC::LabelScope::continueTarget):
22598 * parser/Nodes.cpp:
22599 (JSC::LogicalOpNode::emitBytecode):
22600 (JSC::ConditionalNode::emitBytecode):
22601 (JSC::IfNode::emitBytecode):
22602 (JSC::IfElseNode::emitBytecode):
22603 (JSC::DoWhileNode::emitBytecode):
22604 (JSC::WhileNode::emitBytecode):
22605 (JSC::ForNode::emitBytecode):
22606 (JSC::ForInNode::emitBytecode):
22607 (JSC::ReturnNode::emitBytecode):
22608 (JSC::CaseBlockNode::emitBytecodeForBlock):
22609 (JSC::TryNode::emitBytecode):
22610
22611 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22612
22613 Reviewed by Sam Weinig.
22614
22615 Renamed JITCodeBuffer to AssemblerBuffer and renamed its data members
22616 to be more like the rest of our buffer classes, with a size and a
22617 capacity.
22618
22619 Added an assert in the unchecked put case to match the test in the checked
22620 put case.
22621
22622 Changed a C-style cast to a C++-style cast.
22623
22624 Renamed MAX_INSTRUCTION_SIZE to maxInstructionSize.
22625
22626 * VM/CTI.cpp:
22627 (JSC::CTI::CTI):
22628 (JSC::CTI::compileRegExp):
22629 * VM/Machine.cpp:
22630 (JSC::BytecodeInterpreter::BytecodeInterpreter):
22631 * VM/Machine.h:
22632 (JSC::BytecodeInterpreter::assemblerBuffer):
22633 * masm/X86Assembler.h:
22634 (JSC::AssemblerBuffer::AssemblerBuffer):
22635 (JSC::AssemblerBuffer::~AssemblerBuffer):
22636 (JSC::AssemblerBuffer::ensureSpace):
22637 (JSC::AssemblerBuffer::isAligned):
22638 (JSC::AssemblerBuffer::putByteUnchecked):
22639 (JSC::AssemblerBuffer::putByte):
22640 (JSC::AssemblerBuffer::putShortUnchecked):
22641 (JSC::AssemblerBuffer::putShort):
22642 (JSC::AssemblerBuffer::putIntUnchecked):
22643 (JSC::AssemblerBuffer::putInt):
22644 (JSC::AssemblerBuffer::data):
22645 (JSC::AssemblerBuffer::size):
22646 (JSC::AssemblerBuffer::reset):
22647 (JSC::AssemblerBuffer::copy):
22648 (JSC::AssemblerBuffer::grow):
22649 (JSC::X86Assembler::):
22650 (JSC::X86Assembler::X86Assembler):
22651 (JSC::X86Assembler::testl_i32r):
22652 (JSC::X86Assembler::movl_mr):
22653 (JSC::X86Assembler::movl_rm):
22654 (JSC::X86Assembler::movl_i32m):
22655 (JSC::X86Assembler::emitCall):
22656 (JSC::X86Assembler::label):
22657 (JSC::X86Assembler::emitUnlinkedJmp):
22658 (JSC::X86Assembler::emitUnlinkedJne):
22659 (JSC::X86Assembler::emitUnlinkedJe):
22660 (JSC::X86Assembler::emitUnlinkedJl):
22661 (JSC::X86Assembler::emitUnlinkedJb):
22662 (JSC::X86Assembler::emitUnlinkedJle):
22663 (JSC::X86Assembler::emitUnlinkedJbe):
22664 (JSC::X86Assembler::emitUnlinkedJge):
22665 (JSC::X86Assembler::emitUnlinkedJg):
22666 (JSC::X86Assembler::emitUnlinkedJa):
22667 (JSC::X86Assembler::emitUnlinkedJae):
22668 (JSC::X86Assembler::emitUnlinkedJo):
22669 (JSC::X86Assembler::emitUnlinkedJp):
22670 (JSC::X86Assembler::emitUnlinkedJs):
22671 (JSC::X86Assembler::link):
22672 (JSC::X86Assembler::emitModRm_rr):
22673 (JSC::X86Assembler::emitModRm_rm):
22674 (JSC::X86Assembler::emitModRm_opr):
22675
22676 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22677
22678 Suggested by Maciej Stachowiak.
22679
22680 Reverted most "opcode" => "bytecode" renames. We use "bytecode" as a
22681 mass noun to refer to a stream of instructions. Each instruction may be
22682 an opcode or an operand.
22683
22684 * VM/CTI.cpp:
22685 (JSC::CTI::emitCTICall):
22686 (JSC::CTI::compileOpCall):
22687 (JSC::CTI::compileBinaryArithOp):
22688 (JSC::CTI::compileBinaryArithOpSlowCase):
22689 (JSC::CTI::privateCompileMainPass):
22690 (JSC::CTI::privateCompileSlowCases):
22691 (JSC::CTI::privateCompile):
22692 * VM/CTI.h:
22693 * VM/CodeBlock.cpp:
22694 (JSC::CodeBlock::printStructureIDs):
22695 (JSC::CodeBlock::dump):
22696 (JSC::CodeBlock::derefStructureIDs):
22697 (JSC::CodeBlock::refStructureIDs):
22698 * VM/CodeBlock.h:
22699 * VM/ExceptionHelpers.cpp:
22700 (JSC::createNotAnObjectError):
22701 * VM/Instruction.h:
22702 (JSC::Instruction::Instruction):
22703 (JSC::Instruction::):
22704 * VM/Machine.cpp:
22705 (JSC::BytecodeInterpreter::isOpcode):
22706 (JSC::BytecodeInterpreter::throwException):
22707 (JSC::BytecodeInterpreter::tryCachePutByID):
22708 (JSC::BytecodeInterpreter::uncachePutByID):
22709 (JSC::BytecodeInterpreter::tryCacheGetByID):
22710 (JSC::BytecodeInterpreter::uncacheGetByID):
22711 (JSC::BytecodeInterpreter::privateExecute):
22712 (JSC::BytecodeInterpreter::tryCTICachePutByID):
22713 (JSC::BytecodeInterpreter::tryCTICacheGetByID):
22714 * VM/Machine.h:
22715 (JSC::BytecodeInterpreter::getOpcode):
22716 (JSC::BytecodeInterpreter::getOpcodeID):
22717 (JSC::BytecodeInterpreter::isCallBytecode):
22718 * VM/Opcode.cpp:
22719 (JSC::):
22720 (JSC::OpcodeStats::OpcodeStats):
22721 (JSC::compareOpcodeIndices):
22722 (JSC::compareOpcodePairIndices):
22723 (JSC::OpcodeStats::~OpcodeStats):
22724 (JSC::OpcodeStats::recordInstruction):
22725 (JSC::OpcodeStats::resetLastInstruction):
22726 * VM/Opcode.h:
22727 (JSC::):
22728 (JSC::padOpcodeName):
22729 * VM/SamplingTool.cpp:
22730 (JSC::ScopeSampleRecord::sample):
22731 (JSC::SamplingTool::run):
22732 (JSC::compareOpcodeIndicesSampling):
22733 (JSC::SamplingTool::dump):
22734 * VM/SamplingTool.h:
22735 (JSC::ScopeSampleRecord::ScopeSampleRecord):
22736 (JSC::SamplingTool::SamplingTool):
22737 * bytecompiler/CodeGenerator.cpp:
22738 (JSC::BytecodeGenerator::BytecodeGenerator):
22739 (JSC::BytecodeGenerator::emitLabel):
22740 (JSC::BytecodeGenerator::emitOpcode):
22741 (JSC::BytecodeGenerator::emitJump):
22742 (JSC::BytecodeGenerator::emitJumpIfTrue):
22743 (JSC::BytecodeGenerator::emitJumpIfFalse):
22744 (JSC::BytecodeGenerator::emitMove):
22745 (JSC::BytecodeGenerator::emitUnaryOp):
22746 (JSC::BytecodeGenerator::emitPreInc):
22747 (JSC::BytecodeGenerator::emitPreDec):
22748 (JSC::BytecodeGenerator::emitPostInc):
22749 (JSC::BytecodeGenerator::emitPostDec):
22750 (JSC::BytecodeGenerator::emitBinaryOp):
22751 (JSC::BytecodeGenerator::emitEqualityOp):
22752 (JSC::BytecodeGenerator::emitUnexpectedLoad):
22753 (JSC::BytecodeGenerator::emitInstanceOf):
22754 (JSC::BytecodeGenerator::emitResolve):
22755 (JSC::BytecodeGenerator::emitGetScopedVar):
22756 (JSC::BytecodeGenerator::emitPutScopedVar):
22757 (JSC::BytecodeGenerator::emitResolveBase):
22758 (JSC::BytecodeGenerator::emitResolveWithBase):
22759 (JSC::BytecodeGenerator::emitResolveFunction):
22760 (JSC::BytecodeGenerator::emitGetById):
22761 (JSC::BytecodeGenerator::emitPutById):
22762 (JSC::BytecodeGenerator::emitPutGetter):
22763 (JSC::BytecodeGenerator::emitPutSetter):
22764 (JSC::BytecodeGenerator::emitDeleteById):
22765 (JSC::BytecodeGenerator::emitGetByVal):
22766 (JSC::BytecodeGenerator::emitPutByVal):
22767 (JSC::BytecodeGenerator::emitDeleteByVal):
22768 (JSC::BytecodeGenerator::emitPutByIndex):
22769 (JSC::BytecodeGenerator::emitNewObject):
22770 (JSC::BytecodeGenerator::emitNewArray):
22771 (JSC::BytecodeGenerator::emitNewFunction):
22772 (JSC::BytecodeGenerator::emitNewRegExp):
22773 (JSC::BytecodeGenerator::emitNewFunctionExpression):
22774 (JSC::BytecodeGenerator::emitCall):
22775 (JSC::BytecodeGenerator::emitReturn):
22776 (JSC::BytecodeGenerator::emitUnaryNoDstOp):
22777 (JSC::BytecodeGenerator::emitConstruct):
22778 (JSC::BytecodeGenerator::emitPopScope):
22779 (JSC::BytecodeGenerator::emitDebugHook):
22780 (JSC::BytecodeGenerator::emitComplexJumpScopes):
22781 (JSC::BytecodeGenerator::emitJumpScopes):
22782 (JSC::BytecodeGenerator::emitNextPropertyName):
22783 (JSC::BytecodeGenerator::emitCatch):
22784 (JSC::BytecodeGenerator::emitNewError):
22785 (JSC::BytecodeGenerator::emitJumpSubroutine):
22786 (JSC::BytecodeGenerator::emitSubroutineReturn):
22787 (JSC::BytecodeGenerator::emitPushNewScope):
22788 (JSC::BytecodeGenerator::beginSwitch):
22789 * bytecompiler/CodeGenerator.h:
22790 * jsc.cpp:
22791 (runWithScripts):
22792 * masm/X86Assembler.h:
22793 (JSC::X86Assembler::):
22794 (JSC::X86Assembler::emitModRm_opr):
22795 (JSC::X86Assembler::emitModRm_opr_Unchecked):
22796 (JSC::X86Assembler::emitModRm_opm):
22797 (JSC::X86Assembler::emitModRm_opm_Unchecked):
22798 (JSC::X86Assembler::emitModRm_opmsib):
22799 * parser/Nodes.cpp:
22800 (JSC::UnaryOpNode::emitBytecode):
22801 (JSC::BinaryOpNode::emitBytecode):
22802 (JSC::ReverseBinaryOpNode::emitBytecode):
22803 (JSC::ThrowableBinaryOpNode::emitBytecode):
22804 (JSC::emitReadModifyAssignment):
22805 (JSC::ScopeNode::ScopeNode):
22806 * parser/Nodes.h:
22807 (JSC::UnaryPlusNode::):
22808 (JSC::NegateNode::):
22809 (JSC::BitwiseNotNode::):
22810 (JSC::LogicalNotNode::):
22811 (JSC::MultNode::):
22812 (JSC::DivNode::):
22813 (JSC::ModNode::):
22814 (JSC::AddNode::):
22815 (JSC::SubNode::):
22816 (JSC::LeftShiftNode::):
22817 (JSC::RightShiftNode::):
22818 (JSC::UnsignedRightShiftNode::):
22819 (JSC::LessNode::):
22820 (JSC::GreaterNode::):
22821 (JSC::LessEqNode::):
22822 (JSC::GreaterEqNode::):
22823 (JSC::InstanceOfNode::):
22824 (JSC::InNode::):
22825 (JSC::EqualNode::):
22826 (JSC::NotEqualNode::):
22827 (JSC::StrictEqualNode::):
22828 (JSC::NotStrictEqualNode::):
22829 (JSC::BitAndNode::):
22830 (JSC::BitOrNode::):
22831 (JSC::BitXOrNode::):
22832 * runtime/StructureID.cpp:
22833 (JSC::StructureID::fromDictionaryTransition):
22834 * wtf/Platform.h:
22835
22836 2008-11-15 Geoffrey Garen <ggaren@apple.com>
22837
22838 Reviewed by Sam Weinig.
22839
22840 Renames:
22841
22842 CodeGenerator => BytecodeGenerator
22843 emitCodeForBlock => emitBytecodeForBlock
22844 generatedByteCode => generatedBytecode
22845 generateCode => generateBytecode
22846
22847 * JavaScriptCore.exp:
22848 * bytecompiler/CodeGenerator.cpp:
22849 (JSC::BytecodeGenerator::setDumpsGeneratedCode):
22850 (JSC::BytecodeGenerator::generate):
22851 (JSC::BytecodeGenerator::addVar):
22852 (JSC::BytecodeGenerator::addGlobalVar):
22853 (JSC::BytecodeGenerator::allocateConstants):
22854 (JSC::BytecodeGenerator::BytecodeGenerator):
22855 (JSC::BytecodeGenerator::addParameter):
22856 (JSC::BytecodeGenerator::registerFor):
22857 (JSC::BytecodeGenerator::constRegisterFor):
22858 (JSC::BytecodeGenerator::isLocal):
22859 (JSC::BytecodeGenerator::isLocalConstant):
22860 (JSC::BytecodeGenerator::newRegister):
22861 (JSC::BytecodeGenerator::newTemporary):
22862 (JSC::BytecodeGenerator::highestUsedRegister):
22863 (JSC::BytecodeGenerator::newLabelScope):
22864 (JSC::BytecodeGenerator::newLabel):
22865 (JSC::BytecodeGenerator::emitLabel):
22866 (JSC::BytecodeGenerator::emitBytecode):
22867 (JSC::BytecodeGenerator::retrieveLastBinaryOp):
22868 (JSC::BytecodeGenerator::retrieveLastUnaryOp):
22869 (JSC::BytecodeGenerator::rewindBinaryOp):
22870 (JSC::BytecodeGenerator::rewindUnaryOp):
22871 (JSC::BytecodeGenerator::emitJump):
22872 (JSC::BytecodeGenerator::emitJumpIfTrue):
22873 (JSC::BytecodeGenerator::emitJumpIfFalse):
22874 (JSC::BytecodeGenerator::addConstant):
22875 (JSC::BytecodeGenerator::addUnexpectedConstant):
22876 (JSC::BytecodeGenerator::addRegExp):
22877 (JSC::BytecodeGenerator::emitMove):
22878 (JSC::BytecodeGenerator::emitUnaryOp):
22879 (JSC::BytecodeGenerator::emitPreInc):
22880 (JSC::BytecodeGenerator::emitPreDec):
22881 (JSC::BytecodeGenerator::emitPostInc):
22882 (JSC::BytecodeGenerator::emitPostDec):
22883 (JSC::BytecodeGenerator::emitBinaryOp):
22884 (JSC::BytecodeGenerator::emitEqualityOp):
22885 (JSC::BytecodeGenerator::emitLoad):
22886 (JSC::BytecodeGenerator::emitUnexpectedLoad):
22887 (JSC::BytecodeGenerator::findScopedProperty):
22888 (JSC::BytecodeGenerator::emitInstanceOf):
22889 (JSC::BytecodeGenerator::emitResolve):
22890 (JSC::BytecodeGenerator::emitGetScopedVar):
22891 (JSC::BytecodeGenerator::emitPutScopedVar):
22892 (JSC::BytecodeGenerator::emitResolveBase):
22893 (JSC::BytecodeGenerator::emitResolveWithBase):
22894 (JSC::BytecodeGenerator::emitResolveFunction):
22895 (JSC::BytecodeGenerator::emitGetById):
22896 (JSC::BytecodeGenerator::emitPutById):
22897 (JSC::BytecodeGenerator::emitPutGetter):
22898 (JSC::BytecodeGenerator::emitPutSetter):
22899 (JSC::BytecodeGenerator::emitDeleteById):
22900 (JSC::BytecodeGenerator::emitGetByVal):
22901 (JSC::BytecodeGenerator::emitPutByVal):
22902 (JSC::BytecodeGenerator::emitDeleteByVal):
22903 (JSC::BytecodeGenerator::emitPutByIndex):
22904 (JSC::BytecodeGenerator::emitNewObject):
22905 (JSC::BytecodeGenerator::emitNewArray):
22906 (JSC::BytecodeGenerator::emitNewFunction):
22907 (JSC::BytecodeGenerator::emitNewRegExp):
22908 (JSC::BytecodeGenerator::emitNewFunctionExpression):
22909 (JSC::BytecodeGenerator::emitCall):
22910 (JSC::BytecodeGenerator::emitCallEval):
22911 (JSC::BytecodeGenerator::emitReturn):
22912 (JSC::BytecodeGenerator::emitUnaryNoDstOp):
22913 (JSC::BytecodeGenerator::emitConstruct):
22914 (JSC::BytecodeGenerator::emitPushScope):
22915 (JSC::BytecodeGenerator::emitPopScope):
22916 (JSC::BytecodeGenerator::emitDebugHook):
22917 (JSC::BytecodeGenerator::pushFinallyContext):
22918 (JSC::BytecodeGenerator::popFinallyContext):
22919 (JSC::BytecodeGenerator::breakTarget):
22920 (JSC::BytecodeGenerator::continueTarget):
22921 (JSC::BytecodeGenerator::emitComplexJumpScopes):
22922 (JSC::BytecodeGenerator::emitJumpScopes):
22923 (JSC::BytecodeGenerator::emitNextPropertyName):
22924 (JSC::BytecodeGenerator::emitCatch):
22925 (JSC::BytecodeGenerator::emitNewError):
22926 (JSC::BytecodeGenerator::emitJumpSubroutine):
22927 (JSC::BytecodeGenerator::emitSubroutineReturn):
22928 (JSC::BytecodeGenerator::emitPushNewScope):
22929 (JSC::BytecodeGenerator::beginSwitch):
22930 (JSC::BytecodeGenerator::endSwitch):
22931 (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
22932 * bytecompiler/CodeGenerator.h:
22933 * jsc.cpp:
22934 (runWithScripts):
22935 * parser/Nodes.cpp:
22936 (JSC::ThrowableExpressionData::emitThrowError):
22937 (JSC::NullNode::emitBytecode):
22938 (JSC::BooleanNode::emitBytecode):
22939 (JSC::NumberNode::emitBytecode):
22940 (JSC::StringNode::emitBytecode):
22941 (JSC::RegExpNode::emitBytecode):
22942 (JSC::ThisNode::emitBytecode):
22943 (JSC::ResolveNode::isPure):
22944 (JSC::ResolveNode::emitBytecode):
22945 (JSC::ArrayNode::emitBytecode):
22946 (JSC::ObjectLiteralNode::emitBytecode):
22947 (JSC::PropertyListNode::emitBytecode):
22948 (JSC::BracketAccessorNode::emitBytecode):
22949 (JSC::DotAccessorNode::emitBytecode):
22950 (JSC::ArgumentListNode::emitBytecode):
22951 (JSC::NewExprNode::emitBytecode):
22952 (JSC::EvalFunctionCallNode::emitBytecode):
22953 (JSC::FunctionCallValueNode::emitBytecode):
22954 (JSC::FunctionCallResolveNode::emitBytecode):
22955 (JSC::FunctionCallBracketNode::emitBytecode):
22956 (JSC::FunctionCallDotNode::emitBytecode):
22957 (JSC::emitPreIncOrDec):
22958 (JSC::emitPostIncOrDec):
22959 (JSC::PostfixResolveNode::emitBytecode):
22960 (JSC::PostfixBracketNode::emitBytecode):
22961 (JSC::PostfixDotNode::emitBytecode):
22962 (JSC::PostfixErrorNode::emitBytecode):
22963 (JSC::DeleteResolveNode::emitBytecode):
22964 (JSC::DeleteBracketNode::emitBytecode):
22965 (JSC::DeleteDotNode::emitBytecode):
22966 (JSC::DeleteValueNode::emitBytecode):
22967 (JSC::VoidNode::emitBytecode):
22968 (JSC::TypeOfResolveNode::emitBytecode):
22969 (JSC::TypeOfValueNode::emitBytecode):
22970 (JSC::PrefixResolveNode::emitBytecode):
22971 (JSC::PrefixBracketNode::emitBytecode):
22972 (JSC::PrefixDotNode::emitBytecode):
22973 (JSC::PrefixErrorNode::emitBytecode):
22974 (JSC::UnaryOpNode::emitBytecode):
22975 (JSC::BinaryOpNode::emitBytecode):
22976 (JSC::EqualNode::emitBytecode):
22977 (JSC::StrictEqualNode::emitBytecode):
22978 (JSC::ReverseBinaryOpNode::emitBytecode):
22979 (JSC::ThrowableBinaryOpNode::emitBytecode):
22980 (JSC::InstanceOfNode::emitBytecode):
22981 (JSC::LogicalOpNode::emitBytecode):
22982 (JSC::ConditionalNode::emitBytecode):
22983 (JSC::emitReadModifyAssignment):
22984 (JSC::ReadModifyResolveNode::emitBytecode):
22985 (JSC::AssignResolveNode::emitBytecode):
22986 (JSC::AssignDotNode::emitBytecode):
22987 (JSC::ReadModifyDotNode::emitBytecode):
22988 (JSC::AssignErrorNode::emitBytecode):
22989 (JSC::AssignBracketNode::emitBytecode):
22990 (JSC::ReadModifyBracketNode::emitBytecode):
22991 (JSC::CommaNode::emitBytecode):
22992 (JSC::ConstDeclNode::emitCodeSingle):
22993 (JSC::ConstDeclNode::emitBytecode):
22994 (JSC::ConstStatementNode::emitBytecode):
22995 (JSC::statementListEmitCode):
22996 (JSC::BlockNode::emitBytecode):
22997 (JSC::EmptyStatementNode::emitBytecode):
22998 (JSC::DebuggerStatementNode::emitBytecode):
22999 (JSC::ExprStatementNode::emitBytecode):
23000 (JSC::VarStatementNode::emitBytecode):
23001 (JSC::IfNode::emitBytecode):
23002 (JSC::IfElseNode::emitBytecode):
23003 (JSC::DoWhileNode::emitBytecode):
23004 (JSC::WhileNode::emitBytecode):
23005 (JSC::ForNode::emitBytecode):
23006 (JSC::ForInNode::emitBytecode):
23007 (JSC::ContinueNode::emitBytecode):
23008 (JSC::BreakNode::emitBytecode):
23009 (JSC::ReturnNode::emitBytecode):
23010 (JSC::WithNode::emitBytecode):
23011 (JSC::CaseBlockNode::emitBytecodeForBlock):
23012 (JSC::SwitchNode::emitBytecode):
23013 (JSC::LabelNode::emitBytecode):
23014 (JSC::ThrowNode::emitBytecode):
23015 (JSC::TryNode::emitBytecode):
23016 (JSC::EvalNode::emitBytecode):
23017 (JSC::EvalNode::generateBytecode):
23018 (JSC::FunctionBodyNode::generateBytecode):
23019 (JSC::FunctionBodyNode::emitBytecode):
23020 (JSC::ProgramNode::emitBytecode):
23021 (JSC::ProgramNode::generateBytecode):
23022 (JSC::FuncDeclNode::emitBytecode):
23023 (JSC::FuncExprNode::emitBytecode):
23024 * parser/Nodes.h:
23025 (JSC::ExpressionNode::):
23026 (JSC::BooleanNode::):
23027 (JSC::NumberNode::):
23028 (JSC::StringNode::):
23029 (JSC::ProgramNode::):
23030 (JSC::EvalNode::):
23031 (JSC::FunctionBodyNode::):
23032 * runtime/Arguments.h:
23033 (JSC::Arguments::getArgumentsData):
23034 (JSC::JSActivation::copyRegisters):
23035 * runtime/JSActivation.cpp:
23036 (JSC::JSActivation::mark):
23037 * runtime/JSActivation.h:
23038 (JSC::JSActivation::JSActivationData::JSActivationData):
23039 * runtime/JSFunction.cpp:
23040 (JSC::JSFunction::~JSFunction):
23041
23042 2008-11-15 Geoffrey Garen <ggaren@apple.com>
23043
23044 Reviewed by Sam Weinig.
23045
23046 Renamed all forms of "byte code" "opcode" "op code" "code" "bitcode"
23047 etc. to "bytecode".
23048
23049 * VM/CTI.cpp:
23050 (JSC::CTI::printBytecodeOperandTypes):
23051 (JSC::CTI::emitAllocateNumber):
23052 (JSC::CTI::emitNakedCall):
23053 (JSC::CTI::emitNakedFastCall):
23054 (JSC::CTI::emitCTICall):
23055 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
23056 (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
23057 (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
23058 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
23059 (JSC::CTI::compileOpCall):
23060 (JSC::CTI::emitSlowScriptCheck):
23061 (JSC::CTI::compileBinaryArithOp):
23062 (JSC::CTI::compileBinaryArithOpSlowCase):
23063 (JSC::CTI::privateCompileMainPass):
23064 (JSC::CTI::privateCompileSlowCases):
23065 (JSC::CTI::privateCompile):
23066 * VM/CTI.h:
23067 (JSC::CallRecord::CallRecord):
23068 (JSC::SwitchRecord::SwitchRecord):
23069 * VM/CodeBlock.cpp:
23070 (JSC::CodeBlock::printStructureIDs):
23071 (JSC::CodeBlock::dump):
23072 (JSC::CodeBlock::~CodeBlock):
23073 (JSC::CodeBlock::derefStructureIDs):
23074 (JSC::CodeBlock::refStructureIDs):
23075 * VM/CodeBlock.h:
23076 (JSC::StructureStubInfo::StructureStubInfo):
23077 * VM/ExceptionHelpers.cpp:
23078 (JSC::createNotAnObjectError):
23079 * VM/Instruction.h:
23080 (JSC::Instruction::Instruction):
23081 (JSC::Instruction::):
23082 * VM/Machine.cpp:
23083 (JSC::BytecodeInterpreter::isBytecode):
23084 (JSC::BytecodeInterpreter::throwException):
23085 (JSC::BytecodeInterpreter::execute):
23086 (JSC::BytecodeInterpreter::tryCachePutByID):
23087 (JSC::BytecodeInterpreter::uncachePutByID):
23088 (JSC::BytecodeInterpreter::tryCacheGetByID):
23089 (JSC::BytecodeInterpreter::uncacheGetByID):
23090 (JSC::BytecodeInterpreter::privateExecute):
23091 (JSC::BytecodeInterpreter::tryCTICachePutByID):
23092 (JSC::BytecodeInterpreter::tryCTICacheGetByID):
23093 (JSC::BytecodeInterpreter::cti_op_call_JSFunction):
23094 (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall):
23095 (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall):
23096 * VM/Machine.h:
23097 (JSC::BytecodeInterpreter::getBytecode):
23098 (JSC::BytecodeInterpreter::getBytecodeID):
23099 (JSC::BytecodeInterpreter::isCallBytecode):
23100 * VM/Opcode.cpp:
23101 (JSC::):
23102 (JSC::BytecodeStats::BytecodeStats):
23103 (JSC::compareBytecodeIndices):
23104 (JSC::compareBytecodePairIndices):
23105 (JSC::BytecodeStats::~BytecodeStats):
23106 (JSC::BytecodeStats::recordInstruction):
23107 (JSC::BytecodeStats::resetLastInstruction):
23108 * VM/Opcode.h:
23109 (JSC::):
23110 (JSC::padBytecodeName):
23111 * VM/SamplingTool.cpp:
23112 (JSC::ScopeSampleRecord::sample):
23113 (JSC::SamplingTool::run):
23114 (JSC::compareBytecodeIndicesSampling):
23115 (JSC::SamplingTool::dump):
23116 * VM/SamplingTool.h:
23117 (JSC::ScopeSampleRecord::ScopeSampleRecord):
23118 (JSC::SamplingTool::SamplingTool):
23119 * bytecompiler/CodeGenerator.cpp:
23120 (JSC::CodeGenerator::generate):
23121 (JSC::CodeGenerator::CodeGenerator):
23122 (JSC::CodeGenerator::emitLabel):
23123 (JSC::CodeGenerator::emitBytecode):
23124 (JSC::CodeGenerator::emitJump):
23125 (JSC::CodeGenerator::emitJumpIfTrue):
23126 (JSC::CodeGenerator::emitJumpIfFalse):
23127 (JSC::CodeGenerator::emitMove):
23128 (JSC::CodeGenerator::emitUnaryOp):
23129 (JSC::CodeGenerator::emitPreInc):
23130 (JSC::CodeGenerator::emitPreDec):
23131 (JSC::CodeGenerator::emitPostInc):
23132 (JSC::CodeGenerator::emitPostDec):
23133 (JSC::CodeGenerator::emitBinaryOp):
23134 (JSC::CodeGenerator::emitEqualityOp):
23135 (JSC::CodeGenerator::emitUnexpectedLoad):
23136 (JSC::CodeGenerator::emitInstanceOf):
23137 (JSC::CodeGenerator::emitResolve):
23138 (JSC::CodeGenerator::emitGetScopedVar):
23139 (JSC::CodeGenerator::emitPutScopedVar):
23140 (JSC::CodeGenerator::emitResolveBase):
23141 (JSC::CodeGenerator::emitResolveWithBase):
23142 (JSC::CodeGenerator::emitResolveFunction):
23143 (JSC::CodeGenerator::emitGetById):
23144 (JSC::CodeGenerator::emitPutById):
23145 (JSC::CodeGenerator::emitPutGetter):
23146 (JSC::CodeGenerator::emitPutSetter):
23147 (JSC::CodeGenerator::emitDeleteById):
23148 (JSC::CodeGenerator::emitGetByVal):
23149 (JSC::CodeGenerator::emitPutByVal):
23150 (JSC::CodeGenerator::emitDeleteByVal):
23151 (JSC::CodeGenerator::emitPutByIndex):
23152 (JSC::CodeGenerator::emitNewObject):
23153 (JSC::CodeGenerator::emitNewArray):
23154 (JSC::CodeGenerator::emitNewFunction):
23155 (JSC::CodeGenerator::emitNewRegExp):
23156 (JSC::CodeGenerator::emitNewFunctionExpression):
23157 (JSC::CodeGenerator::emitCall):
23158 (JSC::CodeGenerator::emitReturn):
23159 (JSC::CodeGenerator::emitUnaryNoDstOp):
23160 (JSC::CodeGenerator::emitConstruct):
23161 (JSC::CodeGenerator::emitPopScope):
23162 (JSC::CodeGenerator::emitDebugHook):
23163 (JSC::CodeGenerator::emitComplexJumpScopes):
23164 (JSC::CodeGenerator::emitJumpScopes):
23165 (JSC::CodeGenerator::emitNextPropertyName):
23166 (JSC::CodeGenerator::emitCatch):
23167 (JSC::CodeGenerator::emitNewError):
23168 (JSC::CodeGenerator::emitJumpSubroutine):
23169 (JSC::CodeGenerator::emitSubroutineReturn):
23170 (JSC::CodeGenerator::emitPushNewScope):
23171 (JSC::CodeGenerator::beginSwitch):
23172 (JSC::CodeGenerator::endSwitch):
23173 * bytecompiler/CodeGenerator.h:
23174 (JSC::CodeGenerator::emitNode):
23175 * jsc.cpp:
23176 (runWithScripts):
23177 * masm/X86Assembler.h:
23178 (JSC::X86Assembler::):
23179 (JSC::X86Assembler::emitModRm_opr):
23180 (JSC::X86Assembler::emitModRm_opr_Unchecked):
23181 (JSC::X86Assembler::emitModRm_opm):
23182 (JSC::X86Assembler::emitModRm_opm_Unchecked):
23183 (JSC::X86Assembler::emitModRm_opmsib):
23184 * parser/Nodes.cpp:
23185 (JSC::NullNode::emitBytecode):
23186 (JSC::BooleanNode::emitBytecode):
23187 (JSC::NumberNode::emitBytecode):
23188 (JSC::StringNode::emitBytecode):
23189 (JSC::RegExpNode::emitBytecode):
23190 (JSC::ThisNode::emitBytecode):
23191 (JSC::ResolveNode::emitBytecode):
23192 (JSC::ArrayNode::emitBytecode):
23193 (JSC::ObjectLiteralNode::emitBytecode):
23194 (JSC::PropertyListNode::emitBytecode):
23195 (JSC::BracketAccessorNode::emitBytecode):
23196 (JSC::DotAccessorNode::emitBytecode):
23197 (JSC::ArgumentListNode::emitBytecode):
23198 (JSC::NewExprNode::emitBytecode):
23199 (JSC::EvalFunctionCallNode::emitBytecode):
23200 (JSC::FunctionCallValueNode::emitBytecode):
23201 (JSC::FunctionCallResolveNode::emitBytecode):
23202 (JSC::FunctionCallBracketNode::emitBytecode):
23203 (JSC::FunctionCallDotNode::emitBytecode):
23204 (JSC::PostfixResolveNode::emitBytecode):
23205 (JSC::PostfixBracketNode::emitBytecode):
23206 (JSC::PostfixDotNode::emitBytecode):
23207 (JSC::PostfixErrorNode::emitBytecode):
23208 (JSC::DeleteResolveNode::emitBytecode):
23209 (JSC::DeleteBracketNode::emitBytecode):
23210 (JSC::DeleteDotNode::emitBytecode):
23211 (JSC::DeleteValueNode::emitBytecode):
23212 (JSC::VoidNode::emitBytecode):
23213 (JSC::TypeOfResolveNode::emitBytecode):
23214 (JSC::TypeOfValueNode::emitBytecode):
23215 (JSC::PrefixResolveNode::emitBytecode):
23216 (JSC::PrefixBracketNode::emitBytecode):
23217 (JSC::PrefixDotNode::emitBytecode):
23218 (JSC::PrefixErrorNode::emitBytecode):
23219 (JSC::UnaryOpNode::emitBytecode):
23220 (JSC::BinaryOpNode::emitBytecode):
23221 (JSC::EqualNode::emitBytecode):
23222 (JSC::StrictEqualNode::emitBytecode):
23223 (JSC::ReverseBinaryOpNode::emitBytecode):
23224 (JSC::ThrowableBinaryOpNode::emitBytecode):
23225 (JSC::InstanceOfNode::emitBytecode):
23226 (JSC::LogicalOpNode::emitBytecode):
23227 (JSC::ConditionalNode::emitBytecode):
23228 (JSC::emitReadModifyAssignment):
23229 (JSC::ReadModifyResolveNode::emitBytecode):
23230 (JSC::AssignResolveNode::emitBytecode):
23231 (JSC::AssignDotNode::emitBytecode):
23232 (JSC::ReadModifyDotNode::emitBytecode):
23233 (JSC::AssignErrorNode::emitBytecode):
23234 (JSC::AssignBracketNode::emitBytecode):
23235 (JSC::ReadModifyBracketNode::emitBytecode):
23236 (JSC::CommaNode::emitBytecode):
23237 (JSC::ConstDeclNode::emitBytecode):
23238 (JSC::ConstStatementNode::emitBytecode):
23239 (JSC::BlockNode::emitBytecode):
23240 (JSC::EmptyStatementNode::emitBytecode):
23241 (JSC::DebuggerStatementNode::emitBytecode):
23242 (JSC::ExprStatementNode::emitBytecode):
23243 (JSC::VarStatementNode::emitBytecode):
23244 (JSC::IfNode::emitBytecode):
23245 (JSC::IfElseNode::emitBytecode):
23246 (JSC::DoWhileNode::emitBytecode):
23247 (JSC::WhileNode::emitBytecode):
23248 (JSC::ForNode::emitBytecode):
23249 (JSC::ForInNode::emitBytecode):
23250 (JSC::ContinueNode::emitBytecode):
23251 (JSC::BreakNode::emitBytecode):
23252 (JSC::ReturnNode::emitBytecode):
23253 (JSC::WithNode::emitBytecode):
23254 (JSC::SwitchNode::emitBytecode):
23255 (JSC::LabelNode::emitBytecode):
23256 (JSC::ThrowNode::emitBytecode):
23257 (JSC::TryNode::emitBytecode):
23258 (JSC::ScopeNode::ScopeNode):
23259 (JSC::EvalNode::emitBytecode):
23260 (JSC::FunctionBodyNode::emitBytecode):
23261 (JSC::ProgramNode::emitBytecode):
23262 (JSC::FuncDeclNode::emitBytecode):
23263 (JSC::FuncExprNode::emitBytecode):
23264 * parser/Nodes.h:
23265 (JSC::UnaryPlusNode::):
23266 (JSC::NegateNode::):
23267 (JSC::BitwiseNotNode::):
23268 (JSC::LogicalNotNode::):
23269 (JSC::MultNode::):
23270 (JSC::DivNode::):
23271 (JSC::ModNode::):
23272 (JSC::AddNode::):
23273 (JSC::SubNode::):
23274 (JSC::LeftShiftNode::):
23275 (JSC::RightShiftNode::):
23276 (JSC::UnsignedRightShiftNode::):
23277 (JSC::LessNode::):
23278 (JSC::GreaterNode::):
23279 (JSC::LessEqNode::):
23280 (JSC::GreaterEqNode::):
23281 (JSC::InstanceOfNode::):
23282 (JSC::InNode::):
23283 (JSC::EqualNode::):
23284 (JSC::NotEqualNode::):
23285 (JSC::StrictEqualNode::):
23286 (JSC::NotStrictEqualNode::):
23287 (JSC::BitAndNode::):
23288 (JSC::BitOrNode::):
23289 (JSC::BitXOrNode::):
23290 (JSC::ProgramNode::):
23291 (JSC::EvalNode::):
23292 (JSC::FunctionBodyNode::):
23293 * runtime/JSNotAnObject.h:
23294 * runtime/StructureID.cpp:
23295 (JSC::StructureID::fromDictionaryTransition):
23296 * wtf/Platform.h:
23297
23298 2008-11-15 Geoffrey Garen <ggaren@apple.com>
23299
23300 Reviewed by Sam Weinig.
23301
23302 Renamed Machine to BytecodeInterpreter.
23303
23304 Nixed the Interpreter class, and changed its two functions to stand-alone
23305 functions.
23306
23307 * JavaScriptCore.exp:
23308 * VM/CTI.cpp:
23309 (JSC::):
23310 (JSC::CTI::emitCTICall):
23311 (JSC::CTI::CTI):
23312 (JSC::CTI::compileOpCall):
23313 (JSC::CTI::emitSlowScriptCheck):
23314 (JSC::CTI::compileBinaryArithOpSlowCase):
23315 (JSC::CTI::privateCompileMainPass):
23316 (JSC::CTI::privateCompileSlowCases):
23317 (JSC::CTI::privateCompile):
23318 (JSC::CTI::privateCompileGetByIdSelf):
23319 (JSC::CTI::privateCompileGetByIdProto):
23320 (JSC::CTI::privateCompileGetByIdChain):
23321 (JSC::CTI::privateCompilePutByIdReplace):
23322 (JSC::CTI::privateCompilePutByIdTransition):
23323 (JSC::CTI::privateCompileCTIMachineTrampolines):
23324 (JSC::CTI::freeCTIMachineTrampolines):
23325 (JSC::CTI::patchGetByIdSelf):
23326 (JSC::CTI::patchPutByIdReplace):
23327 (JSC::CTI::privateCompilePatchGetArrayLength):
23328 (JSC::CTI::compileRegExp):
23329 * VM/CTI.h:
23330 * VM/CodeBlock.cpp:
23331 (JSC::CodeBlock::printStructureIDs):
23332 (JSC::CodeBlock::dump):
23333 (JSC::CodeBlock::derefStructureIDs):
23334 (JSC::CodeBlock::refStructureIDs):
23335 * VM/ExceptionHelpers.cpp:
23336 (JSC::createNotAnObjectError):
23337 * VM/Machine.cpp:
23338 (JSC::jsLess):
23339 (JSC::jsLessEq):
23340 (JSC::BytecodeInterpreter::resolve):
23341 (JSC::BytecodeInterpreter::resolveSkip):
23342 (JSC::BytecodeInterpreter::resolveGlobal):
23343 (JSC::BytecodeInterpreter::resolveBase):
23344 (JSC::BytecodeInterpreter::resolveBaseAndProperty):
23345 (JSC::BytecodeInterpreter::resolveBaseAndFunc):
23346 (JSC::BytecodeInterpreter::slideRegisterWindowForCall):
23347 (JSC::BytecodeInterpreter::callEval):
23348 (JSC::BytecodeInterpreter::BytecodeInterpreter):
23349 (JSC::BytecodeInterpreter::initialize):
23350 (JSC::BytecodeInterpreter::~BytecodeInterpreter):
23351 (JSC::BytecodeInterpreter::dumpCallFrame):
23352 (JSC::BytecodeInterpreter::dumpRegisters):
23353 (JSC::BytecodeInterpreter::isOpcode):
23354 (JSC::BytecodeInterpreter::unwindCallFrame):
23355 (JSC::BytecodeInterpreter::throwException):
23356 (JSC::BytecodeInterpreter::execute):
23357 (JSC::BytecodeInterpreter::debug):
23358 (JSC::BytecodeInterpreter::resetTimeoutCheck):
23359 (JSC::BytecodeInterpreter::checkTimeout):
23360 (JSC::BytecodeInterpreter::createExceptionScope):
23361 (JSC::BytecodeInterpreter::tryCachePutByID):
23362 (JSC::BytecodeInterpreter::uncachePutByID):
23363 (JSC::BytecodeInterpreter::tryCacheGetByID):
23364 (JSC::BytecodeInterpreter::uncacheGetByID):
23365 (JSC::BytecodeInterpreter::privateExecute):
23366 (JSC::BytecodeInterpreter::retrieveArguments):
23367 (JSC::BytecodeInterpreter::retrieveCaller):
23368 (JSC::BytecodeInterpreter::retrieveLastCaller):
23369 (JSC::BytecodeInterpreter::findFunctionCallFrame):
23370 (JSC::BytecodeInterpreter::tryCTICachePutByID):
23371 (JSC::BytecodeInterpreter::tryCTICacheGetByID):
23372 (JSC::BytecodeInterpreter::cti_op_convert_this):
23373 (JSC::BytecodeInterpreter::cti_op_end):
23374 (JSC::BytecodeInterpreter::cti_op_add):
23375 (JSC::BytecodeInterpreter::cti_op_pre_inc):
23376 (JSC::BytecodeInterpreter::cti_timeout_check):
23377 (JSC::BytecodeInterpreter::cti_register_file_check):
23378 (JSC::BytecodeInterpreter::cti_op_loop_if_less):
23379 (JSC::BytecodeInterpreter::cti_op_loop_if_lesseq):
23380 (JSC::BytecodeInterpreter::cti_op_new_object):
23381 (JSC::BytecodeInterpreter::cti_op_put_by_id):
23382 (JSC::BytecodeInterpreter::cti_op_put_by_id_second):
23383 (JSC::BytecodeInterpreter::cti_op_put_by_id_generic):
23384 (JSC::BytecodeInterpreter::cti_op_put_by_id_fail):
23385 (JSC::BytecodeInterpreter::cti_op_get_by_id):
23386 (JSC::BytecodeInterpreter::cti_op_get_by_id_second):
23387 (JSC::BytecodeInterpreter::cti_op_get_by_id_generic):
23388 (JSC::BytecodeInterpreter::cti_op_get_by_id_fail):
23389 (JSC::BytecodeInterpreter::cti_op_instanceof):
23390 (JSC::BytecodeInterpreter::cti_op_del_by_id):
23391 (JSC::BytecodeInterpreter::cti_op_mul):
23392 (JSC::BytecodeInterpreter::cti_op_new_func):
23393 (JSC::BytecodeInterpreter::cti_op_call_JSFunction):
23394 (JSC::BytecodeInterpreter::cti_op_call_arityCheck):
23395 (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall):
23396 (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall):
23397 (JSC::BytecodeInterpreter::cti_op_push_activation):
23398 (JSC::BytecodeInterpreter::cti_op_call_NotJSFunction):
23399 (JSC::BytecodeInterpreter::cti_op_create_arguments):
23400 (JSC::BytecodeInterpreter::cti_op_create_arguments_no_params):
23401 (JSC::BytecodeInterpreter::cti_op_tear_off_activation):
23402 (JSC::BytecodeInterpreter::cti_op_tear_off_arguments):
23403 (JSC::BytecodeInterpreter::cti_op_profile_will_call):
23404 (JSC::BytecodeInterpreter::cti_op_profile_did_call):
23405 (JSC::BytecodeInterpreter::cti_op_ret_scopeChain):
23406 (JSC::BytecodeInterpreter::cti_op_new_array):
23407 (JSC::BytecodeInterpreter::cti_op_resolve):
23408 (JSC::BytecodeInterpreter::cti_op_construct_JSConstruct):
23409 (JSC::BytecodeInterpreter::cti_op_construct_NotJSConstruct):
23410 (JSC::BytecodeInterpreter::cti_op_get_by_val):
23411 (JSC::BytecodeInterpreter::cti_op_resolve_func):
23412 (JSC::BytecodeInterpreter::cti_op_sub):
23413 (JSC::BytecodeInterpreter::cti_op_put_by_val):
23414 (JSC::BytecodeInterpreter::cti_op_put_by_val_array):
23415 (JSC::BytecodeInterpreter::cti_op_lesseq):
23416 (JSC::BytecodeInterpreter::cti_op_loop_if_true):
23417 (JSC::BytecodeInterpreter::cti_op_negate):
23418 (JSC::BytecodeInterpreter::cti_op_resolve_base):
23419 (JSC::BytecodeInterpreter::cti_op_resolve_skip):
23420 (JSC::BytecodeInterpreter::cti_op_resolve_global):
23421 (JSC::BytecodeInterpreter::cti_op_div):
23422 (JSC::BytecodeInterpreter::cti_op_pre_dec):
23423 (JSC::BytecodeInterpreter::cti_op_jless):
23424 (JSC::BytecodeInterpreter::cti_op_not):
23425 (JSC::BytecodeInterpreter::cti_op_jtrue):
23426 (JSC::BytecodeInterpreter::cti_op_post_inc):
23427 (JSC::BytecodeInterpreter::cti_op_eq):
23428 (JSC::BytecodeInterpreter::cti_op_lshift):
23429 (JSC::BytecodeInterpreter::cti_op_bitand):
23430 (JSC::BytecodeInterpreter::cti_op_rshift):
23431 (JSC::BytecodeInterpreter::cti_op_bitnot):
23432 (JSC::BytecodeInterpreter::cti_op_resolve_with_base):
23433 (JSC::BytecodeInterpreter::cti_op_new_func_exp):
23434 (JSC::BytecodeInterpreter::cti_op_mod):
23435 (JSC::BytecodeInterpreter::cti_op_less):
23436 (JSC::BytecodeInterpreter::cti_op_neq):
23437 (JSC::BytecodeInterpreter::cti_op_post_dec):
23438 (JSC::BytecodeInterpreter::cti_op_urshift):
23439 (JSC::BytecodeInterpreter::cti_op_bitxor):
23440 (JSC::BytecodeInterpreter::cti_op_new_regexp):
23441 (JSC::BytecodeInterpreter::cti_op_bitor):
23442 (JSC::BytecodeInterpreter::cti_op_call_eval):
23443 (JSC::BytecodeInterpreter::cti_op_throw):
23444 (JSC::BytecodeInterpreter::cti_op_get_pnames):
23445 (JSC::BytecodeInterpreter::cti_op_next_pname):
23446 (JSC::BytecodeInterpreter::cti_op_push_scope):
23447 (JSC::BytecodeInterpreter::cti_op_pop_scope):
23448 (JSC::BytecodeInterpreter::cti_op_typeof):
23449 (JSC::BytecodeInterpreter::cti_op_is_undefined):
23450 (JSC::BytecodeInterpreter::cti_op_is_boolean):
23451 (JSC::BytecodeInterpreter::cti_op_is_number):
23452 (JSC::BytecodeInterpreter::cti_op_is_string):
23453 (JSC::BytecodeInterpreter::cti_op_is_object):
23454 (JSC::BytecodeInterpreter::cti_op_is_function):
23455 (JSC::BytecodeInterpreter::cti_op_stricteq):
23456 (JSC::BytecodeInterpreter::cti_op_nstricteq):
23457 (JSC::BytecodeInterpreter::cti_op_to_jsnumber):
23458 (JSC::BytecodeInterpreter::cti_op_in):
23459 (JSC::BytecodeInterpreter::cti_op_push_new_scope):
23460 (JSC::BytecodeInterpreter::cti_op_jmp_scopes):
23461 (JSC::BytecodeInterpreter::cti_op_put_by_index):
23462 (JSC::BytecodeInterpreter::cti_op_switch_imm):
23463 (JSC::BytecodeInterpreter::cti_op_switch_char):
23464 (JSC::BytecodeInterpreter::cti_op_switch_string):
23465 (JSC::BytecodeInterpreter::cti_op_del_by_val):
23466 (JSC::BytecodeInterpreter::cti_op_put_getter):
23467 (JSC::BytecodeInterpreter::cti_op_put_setter):
23468 (JSC::BytecodeInterpreter::cti_op_new_error):
23469 (JSC::BytecodeInterpreter::cti_op_debug):
23470 (JSC::BytecodeInterpreter::cti_vm_throw):
23471 * VM/Machine.h:
23472 * VM/Register.h:
23473 * VM/SamplingTool.cpp:
23474 (JSC::SamplingTool::run):
23475 * VM/SamplingTool.h:
23476 (JSC::SamplingTool::SamplingTool):
23477 * bytecompiler/CodeGenerator.cpp:
23478 (JSC::CodeGenerator::generate):
23479 (JSC::CodeGenerator::CodeGenerator):
23480 (JSC::CodeGenerator::emitOpcode):
23481 * debugger/DebuggerCallFrame.cpp:
23482 (JSC::DebuggerCallFrame::evaluate):
23483 * jsc.cpp:
23484 (runWithScripts):
23485 * parser/Nodes.cpp:
23486 (JSC::ScopeNode::ScopeNode):
23487 * profiler/ProfileGenerator.cpp:
23488 (JSC::ProfileGenerator::addParentForConsoleStart):
23489 * runtime/ArrayPrototype.cpp:
23490 (JSC::arrayProtoFuncPop):
23491 (JSC::arrayProtoFuncPush):
23492 * runtime/Collector.cpp:
23493 (JSC::Heap::collect):
23494 * runtime/ExecState.h:
23495 (JSC::ExecState::interpreter):
23496 * runtime/FunctionPrototype.cpp:
23497 (JSC::functionProtoFuncApply):
23498 * runtime/Interpreter.cpp:
23499 (JSC::Interpreter::evaluate):
23500 * runtime/JSCell.h:
23501 * runtime/JSFunction.cpp:
23502 (JSC::JSFunction::call):
23503 (JSC::JSFunction::argumentsGetter):
23504 (JSC::JSFunction::callerGetter):
23505 (JSC::JSFunction::construct):
23506 * runtime/JSFunction.h:
23507 * runtime/JSGlobalData.cpp:
23508 (JSC::JSGlobalData::JSGlobalData):
23509 (JSC::JSGlobalData::~JSGlobalData):
23510 * runtime/JSGlobalData.h:
23511 * runtime/JSGlobalObject.cpp:
23512 (JSC::JSGlobalObject::~JSGlobalObject):
23513 (JSC::JSGlobalObject::setTimeoutTime):
23514 (JSC::JSGlobalObject::startTimeoutCheck):
23515 (JSC::JSGlobalObject::stopTimeoutCheck):
23516 (JSC::JSGlobalObject::mark):
23517 * runtime/JSGlobalObjectFunctions.cpp:
23518 (JSC::globalFuncEval):
23519 * runtime/JSString.h:
23520 * runtime/RegExp.cpp:
23521 (JSC::RegExp::RegExp):
23522
23523 2008-11-15 Maciej Stachowiak <mjs@apple.com>
23524
23525 Reviewed by Sam Weinig.
23526
23527 - Remove SymbolTable from FunctionBodyNode and move it to CodeBlock
23528
23529 It's not needed for functions that have never been executed, so no
23530 need to waste the memory. Saves ~4M on membuster after 30 pages.
23531
23532 * VM/CodeBlock.h:
23533 * VM/Machine.cpp:
23534 (JSC::Machine::retrieveArguments):
23535 * parser/Nodes.cpp:
23536 (JSC::EvalNode::generateCode):
23537 (JSC::FunctionBodyNode::generateCode):
23538 * parser/Nodes.h:
23539 * runtime/JSActivation.h:
23540 (JSC::JSActivation::JSActivationData::JSActivationData):
23541
23542 2008-11-14 Cameron Zwarich <zwarich@apple.com>
23543
23544 Reviewed by Darin Adler.
23545
23546 Bug 22259: Make all opcodes use eax as their final result register
23547 <https://bugs.webkit.org/show_bug.cgi?id=22259>
23548
23549 Change one case of op_add (and the corresponding slow case) to use eax
23550 rather than edx. Also, change the order in which the two results of
23551 resolve_func and resolve_base are emitted so that the retrieved value is
23552 put last into eax.
23553
23554 This gives no performance change on SunSpider or the V8 benchmark suite
23555 when run in either harness.
23556
23557 * VM/CTI.cpp:
23558 (JSC::CTI::privateCompileMainPass):
23559 (JSC::CTI::privateCompileSlowCases):
23560
23561 2008-11-14 Gavin Barraclough <barraclough@apple.com>
23562
23563 Reviewed by Geoff Garen.
23564
23565 Geoff has this wacky notion that emitGetArg and emitPutArg should be related to
23566 doing the same thing. Crazy.
23567
23568 Rename the methods for accessing virtual registers to say 'VirtualRegister' in the
23569 name, and those for setting up the arguments for CTI methods to contain 'CTIArg'.
23570
23571 * VM/CTI.cpp:
23572 (JSC::CTI::emitGetVirtualRegister):
23573 (JSC::CTI::emitGetVirtualRegisters):
23574 (JSC::CTI::emitPutCTIArgFromVirtualRegister):
23575 (JSC::CTI::emitPutCTIArg):
23576 (JSC::CTI::emitGetCTIArg):
23577 (JSC::CTI::emitPutCTIArgConstant):
23578 (JSC::CTI::emitPutVirtualRegister):
23579 (JSC::CTI::compileOpCallSetupArgs):
23580 (JSC::CTI::compileOpCallEvalSetupArgs):
23581 (JSC::CTI::compileOpConstructSetupArgs):
23582 (JSC::CTI::compileOpCall):
23583 (JSC::CTI::compileOpStrictEq):
23584 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
23585 (JSC::CTI::compileBinaryArithOp):
23586 (JSC::CTI::compileBinaryArithOpSlowCase):
23587 (JSC::CTI::privateCompileMainPass):
23588 (JSC::CTI::privateCompileSlowCases):
23589 (JSC::CTI::privateCompileCTIMachineTrampolines):
23590 * VM/CTI.h:
23591
23592 2008-11-14 Greg Bolsinga <bolsinga@apple.com>
23593
23594 Reviewed by Antti Koivisto
23595
23596 Fix potential build break by adding StdLibExtras.h
23597
23598 * GNUmakefile.am:
23599 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
23600
23601 2008-11-14 Gavin Barraclough <barraclough@apple.com>
23602
23603 Reviewed by Geoff Garen.
23604
23605 Generate less code for the slow cases of op_call and op_construct.
23606 https://bugs.webkit.org/show_bug.cgi?id=22272
23607
23608 1% progression on v8 tests.
23609
23610 * VM/CTI.cpp:
23611 (JSC::CTI::emitRetrieveArg):
23612 (JSC::CTI::emitNakedCall):
23613 (JSC::CTI::compileOpCallInitializeCallFrame):
23614 (JSC::CTI::compileOpCall):
23615 (JSC::CTI::privateCompileSlowCases):
23616 (JSC::CTI::privateCompileCTIMachineTrampolines):
23617 * VM/CTI.h:
23618 * VM/CodeBlock.h:
23619 (JSC::getCallLinkInfoReturnLocation):
23620 (JSC::CodeBlock::getCallLinkInfo):
23621 * VM/Machine.cpp:
23622 (JSC::Machine::Machine):
23623 (JSC::Machine::cti_vm_dontLazyLinkCall):
23624 (JSC::Machine::cti_vm_lazyLinkCall):
23625 * VM/Machine.h:
23626
23627 2008-11-14 Greg Bolsinga <bolsinga@apple.com>
23628
23629 Reviewed by Darin Alder.
23630
23631 https://bugs.webkit.org/show_bug.cgi?id=21810
23632 Remove use of static C++ objects that are destroyed at exit time (destructors)
23633
23634 Create DEFINE_STATIC_LOCAL macro. Change static local objects to leak to avoid
23635 exit-time destructor. Update code that was changed to fix this issue that ran
23636 into a gcc bug (<rdar://problem/6354696> Codegen issue with C++ static reference
23637 in gcc build 5465). Also typdefs for template types needed to be added in some
23638 cases so the type could make it through the macro successfully.
23639
23640 Basically code of the form:
23641 static T m;
23642 becomes:
23643 DEFINE_STATIC_LOCAL(T, m, ());
23644
23645 Also any code of the form:
23646 static T& m = *new T;
23647 also becomes:
23648 DEFINE_STATIC_LOCAL(T, m, ());
23649
23650 * JavaScriptCore.xcodeproj/project.pbxproj:
23651 * wtf/MainThread.cpp:
23652 (WTF::mainThreadFunctionQueueMutex):
23653 (WTF::functionQueue):
23654 * wtf/StdLibExtras.h: Added. Add DEFINE_STATIC_LOCAL macro
23655 * wtf/ThreadingPthreads.cpp:
23656 (WTF::threadMapMutex):
23657 (WTF::threadMap):
23658 (WTF::identifierByPthreadHandle):
23659
23660 2008-11-13 Sam Weinig <sam@webkit.org>
23661
23662 Reviewed by Darin Adler
23663
23664 Fix for https://bugs.webkit.org/show_bug.cgi?id=22269
23665 Reduce PropertyMap usage
23666
23667 From observation of StructureID statistics, it became clear that many
23668 StructureID's were not being used as StructureIDs themselves, but rather
23669 only being necessary as links in the transition chain. Acknowledging this
23670 and that PropertyMaps stored in StructureIDs can be treated as caches, that
23671 is that they can be reconstructed on demand, it became clear that we could
23672 reduce the memory consumption of StructureIDs by only keeping PropertyMaps
23673 for the StructureIDs that need them the most.
23674
23675 The specific strategy used to reduce the number of StructureIDs with
23676 PropertyMaps is to take the previous StructureIDs PropertyMap when initially
23677 transitioning (addPropertyTransition) from it and clearing out the pointer
23678 in the process. The next time we need to do the same transition, for instance
23679 repeated calls to the same constructor, we use the new addPropertyTransitionToExistingStructure
23680 first, which allows us not to need the PropertyMap to determine if the property
23681 exists already, since a transition to that property would require it not already
23682 be present in the StructureID. Should there be no transition, the PropertyMap
23683 can be constructed on demand (via materializePropertyMap) to determine if the put is a
23684 replace or a transition to a new StructureID.
23685
23686 Reduces memory use on Membuster head test (30 pages open) by ~15MB.
23687
23688 * JavaScriptCore.exp:
23689 * runtime/JSObject.h:
23690 (JSC::JSObject::putDirect): First use addPropertyTransitionToExistingStructure
23691 so that we can avoid building the PropertyMap on subsequent similar object
23692 creations.
23693 * runtime/PropertyMapHashTable.h:
23694 (JSC::PropertyMapEntry::PropertyMapEntry): Add version of constructor which takes
23695 all values to be used when lazily building the PropertyMap.
23696 * runtime/StructureID.cpp:
23697 (JSC::StructureID::dumpStatistics): Add statistics on the number of StructureIDs
23698 with PropertyMaps.
23699 (JSC::StructureID::StructureID): Rename m_cachedTransistionOffset to m_offset
23700 (JSC::isPowerOf2):
23701 (JSC::nextPowerOf2):
23702 (JSC::sizeForKeyCount): Returns the expected size of a PropertyMap for a key count.
23703 (JSC::StructureID::materializePropertyMap): Builds the PropertyMap out of its previous pointer chain.
23704 (JSC::StructureID::addPropertyTransitionToExistingStructure): Only transitions if there is a
23705 an existing transition.
23706 (JSC::StructureID::addPropertyTransition): Instead of always copying the ProperyMap, try and take
23707 it from it previous pointer.
23708 (JSC::StructureID::removePropertyTransition): Simplify by calling toDictionaryTransition() to do
23709 transition work.
23710 (JSC::StructureID::changePrototypeTransition): Build the PropertyMap if necessary before transitioning
23711 because once you have transitioned, you will not be able to reconstruct it afterwards as there is no
23712 previous pointer, pinning the ProperyMap as well.
23713 (JSC::StructureID::getterSetterTransition): Ditto.
23714 (JSC::StructureID::toDictionaryTransition): Pin the PropertyMap so that it is not destroyed on further transitions.
23715 (JSC::StructureID::fromDictionaryTransition): We can only transition back from a dictionary transition if there
23716 are no deleted offsets.
23717 (JSC::StructureID::addPropertyWithoutTransition): Build PropertyMap on demands and pin.
23718 (JSC::StructureID::removePropertyWithoutTransition): Ditto.
23719 (JSC::StructureID::get): Build on demand.
23720 (JSC::StructureID::createPropertyMapHashTable): Add version of create that takes a size
23721 for on demand building.
23722 (JSC::StructureID::expandPropertyMapHashTable):
23723 (JSC::StructureID::rehashPropertyMapHashTable):
23724 (JSC::StructureID::getEnumerablePropertyNamesInternal): Build PropertyMap on demand.
23725 * runtime/StructureID.h:
23726 (JSC::StructureID::propertyStorageSize): Account for StructureIDs without PropertyMaps.
23727 (JSC::StructureID::isEmpty): Ditto.
23728 (JSC::StructureID::materializePropertyMapIfNecessary):
23729 (JSC::StructureID::get): Build PropertyMap on demand
23730
23731 2008-11-14 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
23732
23733 Reviewed by Simon Hausmann.
23734
23735 <https://bugs.webkit.org/show_bug.cgi?id=21500>
23736
23737 JavaScriptCore build with -O3 flag instead of -O2 (gcc).
23738 2.02% speedup on SunSpider (Qt-port on Linux)
23739 1.10% speedup on V8 (Qt-port on Linux)
23740 3.45% speedup on WindScorpion (Qt-port on Linux)
23741
23742 * JavaScriptCore.pri:
23743
23744 2008-11-14 Kristian Amlie <kristian.amlie@trolltech.com>
23745
23746 Reviewed by Darin Adler.
23747
23748 Compile fix for RVCT.
23749
23750 In reality, it is two fixes:
23751
23752 1. Remove typename. I believe typename can only be used when the named
23753 type depends on the template parameters, which it doesn't in this
23754 case, so I think this is more correct.
23755 2. Replace ::iterator scope with specialized typedef. This is to work
23756 around a bug in RVCT.
23757
23758 https://bugs.webkit.org/show_bug.cgi?id=22260
23759
23760 * wtf/ListHashSet.h:
23761 (WTF::::find):
23762
23763 2008-11-14 Kristian Amlie <kristian.amlie@trolltech.com>
23764
23765 Reviewed by Darin Adler.
23766
23767 Compile fix for WINSCW.
23768
23769 This fix doesn't protect against implicit conversions from bool to
23770 integers, but most likely that will be caught on another platform.
23771
23772 https://bugs.webkit.org/show_bug.cgi?id=22260
23773
23774 * wtf/PassRefPtr.h:
23775 (WTF::PassRefPtr::operator bool):
23776 * wtf/RefPtr.h:
23777 (WTF::RefPtr::operator bool):
23778
23779 2008-11-14 Cameron Zwarich <zwarich@apple.com>
23780
23781 Reviewed by Darin Adler.
23782
23783 Bug 22245: Move wtf/dtoa.h into the WTF namespace
23784 <https://bugs.webkit.org/show_bug.cgi?id=22245>
23785
23786 Move wtf/dtoa.h into the WTF namespace from the JSC namespace. This
23787 introduces some ambiguities in name lookups, so I changed all uses of
23788 the functions in wtf/dtoa.h to explicitly state the namespace.
23789
23790 * JavaScriptCore.exp:
23791 * parser/Lexer.cpp:
23792 (JSC::Lexer::lex):
23793 * runtime/InitializeThreading.cpp:
23794 * runtime/JSGlobalObjectFunctions.cpp:
23795 (JSC::parseInt):
23796 * runtime/NumberPrototype.cpp:
23797 (JSC::integerPartNoExp):
23798 (JSC::numberProtoFuncToExponential):
23799 * runtime/UString.cpp:
23800 (JSC::concatenate):
23801 (JSC::UString::from):
23802 (JSC::UString::toDouble):
23803 * wtf/dtoa.cpp:
23804 * wtf/dtoa.h:
23805
23806 2008-11-14 Cameron Zwarich <zwarich@apple.com>
23807
23808 Reviewed by Maciej Stachowiak.
23809
23810 Bug 22257: Enable redundant read optimizations for results generated by compileBinaryArithOp()
23811 <https://bugs.webkit.org/show_bug.cgi?id=22257>
23812
23813 This shows no change in performance on either SunSpider or the V8
23814 benchmark suite, but it removes an ugly special case and allows for
23815 future optimizations to be implemented in a cleaner fashion.
23816
23817 This patch was essentially given to me by Gavin Barraclough upon my
23818 request, but I did regression and performance testing so that he could
23819 work on something else.
23820
23821 * VM/CTI.cpp:
23822 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): Move the final
23823 result to eax if it is not already there.
23824 (JSC::CTI::compileBinaryArithOp): Remove the killing of the final result
23825 register that disables the optimization.
23826
23827 2008-11-13 Eric Seidel <eric@webkit.org>
23828
23829 Reviewed by Adam Roben.
23830
23831 Add a Scons-based build system for building
23832 the Chromium-Mac build of JavaScriptCore.
23833 https://bugs.webkit.org/show_bug.cgi?id=21991
23834
23835 * JavaScriptCore.scons: Added.
23836 * SConstruct: Added.
23837
23838 2008-11-13 Eric Seidel <eric@webkit.org>
23839
23840 Reviewed by Adam Roben.
23841
23842 Add PLATFORM(CHROMIUM) to the "we don't use cairo" blacklist
23843 until https://bugs.webkit.org/show_bug.cgi?id=22250 is fixed.
23844
23845 * wtf/Platform.h:
23846
23847 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23848
23849 Reviewed by Sam Weinig.
23850
23851 In r38375 the 'jsc' shell was changed to improve teardown on quit. The
23852 main() function in jsc.cpp uses Structured Exception Handling, so Visual
23853 C++ emits a warning when destructors are used.
23854
23855 In order to speculatively fix the Windows build, this patch changes that
23856 code to use explicit pointer manipulation and locking rather than smart
23857 pointers and RAII.
23858
23859 * jsc.cpp:
23860 (main):
23861
23862 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23863
23864 Reviewed by Darin Adler.
23865
23866 Bug 22246: Get arguments for opcodes together to eliminate more redundant memory reads
23867 <https://bugs.webkit.org/show_bug.cgi?id=22246>
23868
23869 It is common for opcodes to read their first operand into eax and their
23870 second operand into edx. If the value intended for the second operand is
23871 in eax, we should first move eax to the register for the second operand
23872 and then read the first operand into eax.
23873
23874 This is a 0.5% speedup on SunSpider and a 2.0% speedup on the V8
23875 benchmark suite when measured using the V8 harness.
23876
23877 * VM/CTI.cpp:
23878 (JSC::CTI::emitGetArgs):
23879 (JSC::CTI::compileOpStrictEq):
23880 (JSC::CTI::compileBinaryArithOp):
23881 (JSC::CTI::privateCompileMainPass):
23882 (JSC::CTI::privateCompileSlowCases):
23883 * VM/CTI.h:
23884
23885 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23886
23887 Reviewed by Darin Adler.
23888
23889 Bug 22238: Avoid unnecessary reads of temporaries when the target machine register is not eax
23890 <https://bugs.webkit.org/show_bug.cgi?id=22238>
23891
23892 Enable the optimization of not reading a value back from memory that we
23893 just wrote when the target machine register is not eax. In order to do
23894 this, the code generation for op_put_global_var must be changed to
23895 read its argument into a register before overwriting eax.
23896
23897 This is a 0.5% speedup on SunSpider and shows no change on the V8
23898 benchmark suite when run in either harness.
23899
23900 * VM/CTI.cpp:
23901 (JSC::CTI::emitGetArg):
23902 (JSC::CTI::privateCompileMainPass):
23903
23904 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23905
23906 Reviewed by Alexey Proskuryakov.
23907
23908 Perform teardown in the 'jsc' shell in order to suppress annoying and
23909 misleading leak messages. There is still a lone JSC::Node leaking when
23910 quit() is called, but hopefully that can be fixed as well.
23911
23912 * jsc.cpp:
23913 (functionQuit):
23914 (main):
23915
23916 2008-11-13 Mike Pinkerton <pinkerton@chromium.org>
23917
23918 Reviewed by Sam Weinig.
23919
23920 Fix for https://bugs.webkit.org/show_bug.cgi?id=22087
23921 Need correct platform defines for Mac Chromium
23922
23923 Set the appropriate platform defines for Mac Chromium, which is
23924 similar to PLATFORM(MAC), but isn't.
23925
23926 * wtf/Platform.h:
23927
23928 2008-11-13 Maciej Stachowiak <mjs@apple.com>
23929
23930 Reviewed by Cameron Zwarich.
23931
23932 - remove immediate checks from native codegen for known non-immediate cases like "this"
23933
23934 ~.5% speedup on v8 benchmarks
23935
23936 In the future we can extend this model to remove all sorts of
23937 typechecks based on local type info or type inference.
23938
23939 I also added an assertion to verify that all slow cases linked as
23940 many slow case jumps as the corresponding fast case generated, and
23941 fixed the pre-existing cases where this was not true.
23942
23943 * VM/CTI.cpp:
23944 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
23945 (JSC::CTI::linkSlowCaseIfNotJSCell):
23946 (JSC::CTI::compileBinaryArithOp):
23947 (JSC::CTI::compileBinaryArithOpSlowCase):
23948 (JSC::CTI::privateCompileMainPass):
23949 (JSC::CTI::privateCompileSlowCases):
23950 * VM/CTI.h:
23951 * VM/CodeBlock.h:
23952 (JSC::CodeBlock::isKnownNotImmediate):
23953
23954 2008-11-13 Cameron Zwarich <zwarich@apple.com>
23955
23956 Reviewed by Maciej Stachowiak.
23957
23958 Bug 21943: Avoid needless reads of temporary values in CTI code
23959 <https://bugs.webkit.org/show_bug.cgi?id=21943>
23960
23961 If an opcode needs to load a virtual register and a previous opcode left
23962 the contents of that virtual register in a machine register, use the
23963 value in the machine register rather than getting it from memory.
23964
23965 In order to perform this optimization, it is necessary to know the
23966 jump tagets in the CodeBlock. For temporaries, the only problematic
23967 jump targets are binary logical operators and the ternary conditional
23968 operator. However, if this optimization were to be extended to local
23969 variable registers as well, other jump targets would need to be
23970 included, like switch statement cases and the beginnings of catch
23971 blocks.
23972
23973 This optimization also requires that the fast case and the slow case
23974 of an opcode use emitPutResult() on the same register, which was chosen
23975 to be eax, as that is the register into which we read the first operand
23976 of opcodes. In order to make this the case, we needed to add some mov
23977 instructions to the slow cases of some instructions.
23978
23979 This optimizaton is not applied whenever compileBinaryArithOp() is used
23980 to compile an opcode, because different machine registers may be used to
23981 store the final result. It seems possible to rewrite the code generation
23982 in compileBinaryArithOp() to allow for this optimization.
23983
23984 This optimization is also not applied when generating slow cases,
23985 because some fast cases overwrite the value of eax before jumping to the
23986 slow case. In the future, it may be possible to apply this optimization
23987 to slow cases as well, but it did not seem to be a speedup when testing
23988 an early version of this patch.
23989
23990 This is a 1.0% speedup on SunSpider and a 6.3% speedup on the V8
23991 benchmark suite.
23992
23993 * VM/CTI.cpp:
23994 (JSC::CTI::killLastResultRegister):
23995 (JSC::CTI::emitGetArg):
23996 (JSC::CTI::emitGetPutArg):
23997 (JSC::CTI::emitGetCTIParam):
23998 (JSC::CTI::emitGetFromCallFrameHeader):
23999 (JSC::CTI::emitPutResult):
24000 (JSC::CTI::emitCTICall):
24001 (JSC::CTI::CTI):
24002 (JSC::CTI::compileOpCall):
24003 (JSC::CTI::compileOpStrictEq):
24004 (JSC::CTI::emitSlowScriptCheck):
24005 (JSC::CTI::compileBinaryArithOp):
24006 (JSC::CTI::privateCompileMainPass):
24007 (JSC::CTI::privateCompileSlowCases):
24008 (JSC::CTI::privateCompileGetByIdProto):
24009 (JSC::CTI::privateCompilePatchGetArrayLength):
24010 * VM/CTI.h:
24011 * VM/CodeBlock.h:
24012 (JSC::CodeBlock::isTemporaryRegisterIndex):
24013 * bytecompiler/CodeGenerator.cpp:
24014 (JSC::CodeGenerator::emitLabel):
24015
24016 2008-11-12 Alp Toker <alp@nuanti.com>
24017
24018 autotools build system fix-up only. Add FloatQuad.h to the source
24019 lists and sort them.
24020
24021 * GNUmakefile.am:
24022
24023 2008-11-12 Geoffrey Garen <ggaren@apple.com>
24024
24025 Reviewed by Sam Weinig.
24026
24027 Fixed https://bugs.webkit.org/show_bug.cgi?id=22192
24028 +37 failures in fast/profiler
24029
24030 along with Darin's review comments in
24031 https://bugs.webkit.org/show_bug.cgi?id=22174
24032 Simplified op_call by nixing its responsibility for moving the value of
24033 "this" into the first argument slot
24034
24035 * VM/Machine.cpp:
24036 (JSC::returnToThrowTrampoline):
24037 (JSC::throwStackOverflowError):
24038 (JSC::Machine::cti_register_file_check):
24039 (JSC::Machine::cti_op_call_arityCheck):
24040 (JSC::Machine::cti_vm_throw): Moved the throw logic into a function, since
24041 functions are better than macros.
24042
24043 * bytecompiler/CodeGenerator.cpp:
24044 (JSC::CodeGenerator::emitCall):
24045 (JSC::CodeGenerator::emitConstruct): Ensure that the function register
24046 is preserved if profiling is enabled, since the profiler uses that
24047 register.
24048
24049 * runtime/JSGlobalData.h: Renamed throwReturnAddress to exceptionLocation,
24050 because I had a hard time understanding what "throwReturnAddress" meant.
24051
24052 2008-11-12 Geoffrey Garen <ggaren@apple.com>
24053
24054 Reviewed by Sam Weinig.
24055
24056 Roll in r38322, now that test failures have been fixed.
24057
24058 * VM/CTI.cpp:
24059 (JSC::CTI::compileOpCallSetupArgs):
24060 (JSC::CTI::compileOpCallEvalSetupArgs):
24061 (JSC::CTI::compileOpConstructSetupArgs):
24062 (JSC::CTI::compileOpCall):
24063 (JSC::CTI::privateCompileMainPass):
24064 (JSC::CTI::privateCompileSlowCases):
24065 * VM/CTI.h:
24066 * VM/CodeBlock.cpp:
24067 (JSC::CodeBlock::dump):
24068 * VM/Machine.cpp:
24069 (JSC::Machine::callEval):
24070 (JSC::Machine::dumpCallFrame):
24071 (JSC::Machine::dumpRegisters):
24072 (JSC::Machine::execute):
24073 (JSC::Machine::privateExecute):
24074 (JSC::Machine::cti_register_file_check):
24075 (JSC::Machine::cti_op_call_arityCheck):
24076 (JSC::Machine::cti_op_call_NotJSFunction):
24077 (JSC::Machine::cti_op_construct_JSConstruct):
24078 (JSC::Machine::cti_op_construct_NotJSConstruct):
24079 (JSC::Machine::cti_op_call_eval):
24080 (JSC::Machine::cti_vm_throw):
24081 * VM/Machine.h:
24082 * bytecompiler/CodeGenerator.cpp:
24083 (JSC::CodeGenerator::emitCall):
24084 (JSC::CodeGenerator::emitCallEval):
24085 (JSC::CodeGenerator::emitConstruct):
24086 * bytecompiler/CodeGenerator.h:
24087 * parser/Nodes.cpp:
24088 (JSC::EvalFunctionCallNode::emitCode):
24089 (JSC::FunctionCallValueNode::emitCode):
24090 (JSC::FunctionCallResolveNode::emitCode):
24091 (JSC::FunctionCallBracketNode::emitCode):
24092 (JSC::FunctionCallDotNode::emitCode):
24093 * parser/Nodes.h:
24094 (JSC::ScopeNode::neededConstants):
24095
24096 2008-11-12 Gavin Barraclough <barraclough@apple.com>
24097
24098 Reviewed by Cameron Zwarich.
24099
24100 Fix for https://bugs.webkit.org/show_bug.cgi?id=22201
24101 Integer conversion in array.length was safe signed values,
24102 but the length is unsigned.
24103
24104 * VM/CTI.cpp:
24105 (JSC::CTI::privateCompilePatchGetArrayLength):
24106
24107 2008-11-12 Cameron Zwarich <zwarich@apple.com>
24108
24109 Rubber-stamped by Mark Rowe.
24110
24111 Roll out r38322 due to test failures on the bots.
24112
24113 * VM/CTI.cpp:
24114 (JSC::CTI::compileOpCallSetupArgs):
24115 (JSC::CTI::compileOpCall):
24116 (JSC::CTI::privateCompileMainPass):
24117 (JSC::CTI::privateCompileSlowCases):
24118 * VM/CTI.h:
24119 * VM/CodeBlock.cpp:
24120 (JSC::CodeBlock::dump):
24121 * VM/Machine.cpp:
24122 (JSC::Machine::callEval):
24123 (JSC::Machine::dumpCallFrame):
24124 (JSC::Machine::dumpRegisters):
24125 (JSC::Machine::execute):
24126 (JSC::Machine::privateExecute):
24127 (JSC::Machine::throwStackOverflowPreviousFrame):
24128 (JSC::Machine::cti_register_file_check):
24129 (JSC::Machine::cti_op_call_arityCheck):
24130 (JSC::Machine::cti_op_call_NotJSFunction):
24131 (JSC::Machine::cti_op_construct_JSConstruct):
24132 (JSC::Machine::cti_op_construct_NotJSConstruct):
24133 (JSC::Machine::cti_op_call_eval):
24134 (JSC::Machine::cti_vm_throw):
24135 * VM/Machine.h:
24136 * bytecompiler/CodeGenerator.cpp:
24137 (JSC::CodeGenerator::emitCall):
24138 (JSC::CodeGenerator::emitCallEval):
24139 (JSC::CodeGenerator::emitConstruct):
24140 * bytecompiler/CodeGenerator.h:
24141 * parser/Nodes.cpp:
24142 (JSC::EvalFunctionCallNode::emitCode):
24143 (JSC::FunctionCallValueNode::emitCode):
24144 (JSC::FunctionCallResolveNode::emitCode):
24145 (JSC::FunctionCallBracketNode::emitCode):
24146 (JSC::FunctionCallDotNode::emitCode):
24147 * parser/Nodes.h:
24148 (JSC::ScopeNode::neededConstants):
24149
24150 2008-11-11 Geoffrey Garen <ggaren@apple.com>
24151
24152 Reviewed by Darin Adler.
24153
24154 Fixed https://bugs.webkit.org/show_bug.cgi?id=22174
24155 Simplified op_call by nixing its responsibility for moving the value of
24156 "this" into the first argument slot.
24157
24158 Instead, the caller emits an explicit load or mov instruction, or relies
24159 on implicit knowledge that "this" is already in the first argument slot.
24160 As a result, two operands to op_call are gone: firstArg and thisVal.
24161
24162 SunSpider and v8 tests show no change in bytecode or CTI.
24163
24164 * VM/CTI.cpp:
24165 (JSC::CTI::compileOpCallSetupArgs):
24166 (JSC::CTI::compileOpCallEvalSetupArgs):
24167 (JSC::CTI::compileOpConstructSetupArgs): Split apart these three versions
24168 of setting up arguments to op_call, because they're more different than
24169 they are the same -- even more so with this patch.
24170
24171 (JSC::CTI::compileOpCall): Updated for the fact that op_construct doesn't
24172 match op_call anymore.
24173
24174 (JSC::CTI::privateCompileMainPass):
24175 (JSC::CTI::privateCompileSlowCases): Merged a few call cases. Updated
24176 for changes mentioned above.
24177
24178 * VM/CTI.h:
24179
24180 * VM/CodeBlock.cpp:
24181 (JSC::CodeBlock::dump): Updated for new bytecode format of call / construct.
24182
24183 * VM/Machine.cpp:
24184 (JSC::Machine::callEval): Updated for new bytecode format of call / construct.
24185
24186 (JSC::Machine::dumpCallFrame):
24187 (JSC::Machine::dumpRegisters): Simplified these debugging functions,
24188 taking advantage of the new call frame layout.
24189
24190 (JSC::Machine::execute): Fixed up the eval version of execute to be
24191 friendlier to calls in the new format.
24192
24193 (JSC::Machine::privateExecute): Implemented the new call format in
24194 bytecode.
24195
24196 (JSC::Machine::cti_op_call_NotJSFunction):
24197 (JSC::Machine::cti_op_construct_JSConstruct):
24198 (JSC::Machine::cti_op_construct_NotJSConstruct):
24199 (JSC::Machine::cti_op_call_eval): Updated CTI helpers to match the new
24200 call format.
24201
24202 Fixed a latent bug in stack overflow checking that is now hit because
24203 the register layout has changed a bit -- namely: when throwing a stack
24204 overflow exception inside an op_call helper, we need to account for the
24205 fact that the current call frame is only half-constructed, and use the
24206 parent call frame instead.
24207
24208 * VM/Machine.h:
24209
24210 * bytecompiler/CodeGenerator.cpp:
24211 (JSC::CodeGenerator::emitCall):
24212 (JSC::CodeGenerator::emitCallEval):
24213 (JSC::CodeGenerator::emitConstruct):
24214 * bytecompiler/CodeGenerator.h: Updated codegen to match the new call
24215 format.
24216
24217 * parser/Nodes.cpp:
24218 (JSC::EvalFunctionCallNode::emitCode):
24219 (JSC::FunctionCallValueNode::emitCode):
24220 (JSC::FunctionCallResolveNode::emitCode):
24221 (JSC::FunctionCallBracketNode::emitCode):
24222 (JSC::FunctionCallDotNode::emitCode):
24223 * parser/Nodes.h:
24224 (JSC::ScopeNode::neededConstants): ditto
24225
24226 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24227
24228 Reviewed by Geoff Garen.
24229
24230 Remove an unused forwarding header for a file that no longer exists.
24231
24232 * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
24233
24234 2008-11-11 Mark Rowe <mrowe@apple.com>
24235
24236 Fix broken dependencies building JavaScriptCore on a freezing cold cat, caused
24237 by failure to update all instances of "kjs" to their new locations.
24238
24239 * JavaScriptCore.xcodeproj/project.pbxproj:
24240
24241 2008-11-11 Alexey Proskuryakov <ap@webkit.org>
24242
24243 Rubber-stamped by Adam Roben.
24244
24245 * wtf/AVLTree.h: (WTF::AVLTree::Iterator::start_iter):
24246 Fix indentation a little more.
24247
24248 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24249
24250 Rubber-stamped by Sam Weinig.
24251
24252 Clean up EvalCodeCache to match our coding style a bit more.
24253
24254 * VM/EvalCodeCache.h:
24255 (JSC::EvalCodeCache::get):
24256
24257 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24258
24259 Rubber-stamped by Sam Weinig.
24260
24261 Bug 22179: Move EvalCodeCache from CodeBlock.h into its own file
24262 <https://bugs.webkit.org/show_bug.cgi?id=22179>
24263
24264 * GNUmakefile.am:
24265 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
24266 * JavaScriptCore.xcodeproj/project.pbxproj:
24267 * VM/CodeBlock.h:
24268 * VM/EvalCodeCache.h: Copied from VM/CodeBlock.h.
24269 * VM/Machine.cpp:
24270
24271 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24272
24273 Reviewed by Sam Weinig.
24274
24275 Remove the 'm_' prefix from the fields of the SwitchRecord struct.
24276
24277 * VM/CTI.cpp:
24278 (JSC::CTI::privateCompile):
24279 * VM/CTI.h:
24280 (JSC::SwitchRecord):
24281 (JSC::SwitchRecord::SwitchRecord):
24282
24283 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24284
24285 Rubber-stamped by Sam Weinig.
24286
24287 Make asInteger() a static function so that it has internal linkage.
24288
24289 * VM/CTI.cpp:
24290 (JSC::asInteger):
24291
24292 2008-11-11 Maciej Stachowiak <mjs@apple.com>
24293
24294 Reviewed by Mark Rowe.
24295
24296 - shrink CodeBlock and AST related Vectors to exact fit (5-10M savings on membuster test)
24297
24298 No perf regression combined with the last patch (each seems like a small regression individually)
24299
24300 * bytecompiler/CodeGenerator.cpp:
24301 (JSC::CodeGenerator::generate):
24302 * parser/Nodes.h:
24303 (JSC::SourceElements::releaseContentsIntoVector):
24304 * wtf/Vector.h:
24305 (WTF::Vector::shrinkToFit):
24306
24307 2008-11-11 Maciej Stachowiak <mjs@apple.com>
24308
24309 Reviewed by Mark Rowe.
24310
24311 - remove inline capacity from declaration stacks (15M savings on membuster test)
24312
24313 No perf regression on SunSpider or V8 test combined with other upcoming memory improvement patch.
24314
24315 * JavaScriptCore.exp:
24316 * parser/Nodes.h:
24317
24318 2008-11-11 Cameron Zwarich <zwarich@apple.com>
24319
24320 Reviewed by Oliver Hunt.
24321
24322 While r38286 removed the need for the m_callFrame member variable of
24323 CTI, it should be also be removed.
24324
24325 * VM/CTI.h:
24326
24327 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24328
24329 Reviewed by Oliver Hunt.
24330
24331 Make CTI::asInteger() a non-member function, since it needs no access to
24332 any of CTI's member variables.
24333
24334 * VM/CTI.cpp:
24335 (JSC::asInteger):
24336 * VM/CTI.h:
24337
24338 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24339
24340 Reviewed by Maciej Stachowiak.
24341
24342 Use 'value' instead of 'js' in CTI as a name for JSValue* to match our
24343 usual convention elsewhere.
24344
24345 * VM/CTI.cpp:
24346 (JSC::CTI::emitGetArg):
24347 (JSC::CTI::emitGetPutArg):
24348 (JSC::CTI::getConstantImmediateNumericArg):
24349 (JSC::CTI::printOpcodeOperandTypes):
24350
24351 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24352
24353 Reviewed by Maciej Stachowiak.
24354
24355 Make CTI::getConstant() a member function of CodeBlock instead.
24356
24357 * VM/CTI.cpp:
24358 (JSC::CTI::emitGetArg):
24359 (JSC::CTI::emitGetPutArg):
24360 (JSC::CTI::getConstantImmediateNumericArg):
24361 (JSC::CTI::printOpcodeOperandTypes):
24362 (JSC::CTI::privateCompileMainPass):
24363 * VM/CTI.h:
24364 * VM/CodeBlock.h:
24365 (JSC::CodeBlock::getConstant):
24366
24367 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24368
24369 Reviewed by Sam Weinig.
24370
24371 Rename CodeBlock::isConstant() to isConstantRegisterIndex().
24372
24373 * VM/CTI.cpp:
24374 (JSC::CTI::emitGetArg):
24375 (JSC::CTI::emitGetPutArg):
24376 (JSC::CTI::getConstantImmediateNumericArg):
24377 (JSC::CTI::printOpcodeOperandTypes):
24378 (JSC::CTI::privateCompileMainPass):
24379 * VM/CodeBlock.h:
24380 (JSC::CodeBlock::isConstantRegisterIndex):
24381 * bytecompiler/CodeGenerator.cpp:
24382 (JSC::CodeGenerator::emitEqualityOp):
24383
24384 2008-11-10 Gavin Barraclough <barraclough@apple.com>
24385
24386 Build fix for non-CTI builds.
24387
24388 * VM/Machine.cpp:
24389 (JSC::Machine::initialize):
24390
24391 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24392
24393 Reviewed by Sam Weinig.
24394
24395 Remove the unused labels member variable of CodeBlock.
24396
24397 * VM/CodeBlock.h:
24398 * VM/LabelID.h:
24399 (JSC::LabelID::setLocation):
24400
24401 2008-11-10 Gavin Barraclough <barraclough@apple.com>
24402
24403 Reviewed by Cameron Zwarich.
24404
24405 Batch compile the set of static trampolines at the point Machine is constructed, using a single allocation.
24406 Refactor out m_callFrame from CTI, since this is only needed to access the global data (instead store a
24407 pointer to the global data directly, since this is available at the point the Machine is constructed).
24408 Add a method to align the code buffer, to allow JIT generation for multiple trampolines in one block.
24409
24410 * VM/CTI.cpp:
24411 (JSC::CTI::getConstant):
24412 (JSC::CTI::emitGetArg):
24413 (JSC::CTI::emitGetPutArg):
24414 (JSC::CTI::getConstantImmediateNumericArg):
24415 (JSC::CTI::printOpcodeOperandTypes):
24416 (JSC::CTI::CTI):
24417 (JSC::CTI::compileBinaryArithOp):
24418 (JSC::CTI::privateCompileMainPass):
24419 (JSC::CTI::privateCompileGetByIdProto):
24420 (JSC::CTI::privateCompileGetByIdChain):
24421 (JSC::CTI::privateCompileCTIMachineTrampolines):
24422 (JSC::CTI::freeCTIMachineTrampolines):
24423 * VM/CTI.h:
24424 (JSC::CTI::compile):
24425 (JSC::CTI::compileGetByIdSelf):
24426 (JSC::CTI::compileGetByIdProto):
24427 (JSC::CTI::compileGetByIdChain):
24428 (JSC::CTI::compilePutByIdReplace):
24429 (JSC::CTI::compilePutByIdTransition):
24430 (JSC::CTI::compileCTIMachineTrampolines):
24431 (JSC::CTI::compilePatchGetArrayLength):
24432 * VM/Machine.cpp:
24433 (JSC::Machine::initialize):
24434 (JSC::Machine::~Machine):
24435 (JSC::Machine::execute):
24436 (JSC::Machine::tryCTICachePutByID):
24437 (JSC::Machine::tryCTICacheGetByID):
24438 (JSC::Machine::cti_op_call_JSFunction):
24439 (JSC::Machine::cti_vm_lazyLinkCall):
24440 * VM/Machine.h:
24441 * masm/X86Assembler.h:
24442 (JSC::JITCodeBuffer::isAligned):
24443 (JSC::X86Assembler::):
24444 (JSC::X86Assembler::align):
24445 * runtime/JSGlobalData.cpp:
24446 (JSC::JSGlobalData::JSGlobalData):
24447
24448 2008-11-10 Maciej Stachowiak <mjs@apple.com>
24449
24450 Reviewed by Antti Koivisto.
24451
24452 - Make Vector::clear() release the Vector's memory (1MB savings on membuster)
24453 https://bugs.webkit.org/show_bug.cgi?id=22170
24454
24455 * wtf/Vector.h:
24456 (WTF::VectorBufferBase::deallocateBuffer): Set capacity to 0 as
24457 well as size, otherwise shrinking capacity to 0 can fail to reset
24458 the capacity and thus cause a future crash.
24459 (WTF::Vector::~Vector): Shrink size not capacity; we only need
24460 to call destructors, the buffer will be freed anyway.
24461 (WTF::Vector::clear): Change this to shrinkCapacity(0), not just shrink(0).
24462 (WTF::::shrinkCapacity): Use shrink() instead of resize() for case where
24463 the size is greater than the new capacity, to work with types that have no
24464 default constructor.
24465
24466 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24467
24468 Reviewed by Maciej Stachowiak.
24469
24470 Split multiple definitions into separate lines.
24471
24472 * VM/CTI.cpp:
24473 (JSC::CTI::compileBinaryArithOp):
24474
24475 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24476
24477 Reviewed by Geoff Garen.
24478
24479 Bug 22162: Remove cachedValueGetter from the JavaScriptCore API implementation
24480 <https://bugs.webkit.org/show_bug.cgi?id=22162>
24481
24482 There is no more need for the cachedValueGetter hack now that we have
24483 PropertySlot::setValue(), so we should remove it.
24484
24485 * API/JSCallbackObject.h:
24486 * API/JSCallbackObjectFunctions.h:
24487 (JSC::::getOwnPropertySlot):
24488
24489 2008-11-10 Cameron Zwarich <zwarich@apple.com>
24490
24491 Reviewed by Darin Adler.
24492
24493 Bug 22152: Remove asObject() call from JSCallbackObject::getOwnPropertySlot()
24494 <https://bugs.webkit.org/show_bug.cgi?id=22152>
24495
24496 With the recent change to adopt asType() style cast functions with
24497 assertions instead of static_casts in many places, the assertion for
24498 the asObject() call in JSCallbackObject::getOwnPropertySlot() has been
24499 failing when using any nontrivial client of the JavaScriptCore API.
24500 The cast isn't even necessary to call slot.setCustom(), so it should
24501 be removed.
24502
24503 * API/JSCallbackObjectFunctions.h:
24504 (JSC::JSCallbackObject::getOwnPropertySlot):
24505
24506 2008-11-10 Alexey Proskuryakov <ap@webkit.org>
24507
24508 Reviewed by Adam Roben.
24509
24510 A few coding style fixes for AVLTree.
24511
24512 * wtf/AVLTree.h: Moved to WTF namespace, Removed "KJS_" from include guards.
24513 (WTF::AVLTree::Iterator::start_iter): Fixed indentation
24514
24515 * runtime/JSArray.cpp: Added "using namepace WTF".
24516
24517 2008-11-09 Cameron Zwarich <zwarich@apple.com>
24518
24519 Not reviewed.
24520
24521 Speculatively fix the non-AllInOne build.
24522
24523 * runtime/NativeErrorConstructor.cpp:
24524
24525 2008-11-09 Darin Adler <darin@apple.com>
24526
24527 Reviewed by Tim Hatcher.
24528
24529 - https://bugs.webkit.org/show_bug.cgi?id=22149
24530 remove unused code from the parser
24531
24532 * AllInOneFile.cpp: Removed nodes2string.cpp.
24533 * GNUmakefile.am: Ditto.
24534 * JavaScriptCore.exp: Ditto.
24535 * JavaScriptCore.pri: Ditto.
24536 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
24537 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
24538 * JavaScriptCoreSources.bkl: Ditto.
24539
24540 * VM/CodeBlock.h: Added include.
24541
24542 * VM/Machine.cpp: (JSC::Machine::execute): Use the types from
24543 DeclarationStacks as DeclarationStacks:: rather than Node:: since
24544 "Node" really has little to do with it.
24545 * bytecompiler/CodeGenerator.cpp:
24546 (JSC::CodeGenerator::CodeGenerator): Ditto.
24547
24548 * jsc.cpp:
24549 (Options::Options): Removed prettyPrint option.
24550 (runWithScripts): Ditto.
24551 (printUsageStatement): Ditto.
24552 (parseArguments): Ditto.
24553 (jscmain): Ditto.
24554
24555 * parser/Grammar.y: Removed use of obsolete ImmediateNumberNode.
24556
24557 * parser/Nodes.cpp:
24558 (JSC::ThrowableExpressionData::emitThrowError): Use inline functions
24559 instead of direct member access for ThrowableExpressionData values.
24560 (JSC::BracketAccessorNode::emitCode): Ditto.
24561 (JSC::DotAccessorNode::emitCode): Ditto.
24562 (JSC::NewExprNode::emitCode): Ditto.
24563 (JSC::EvalFunctionCallNode::emitCode): Ditto.
24564 (JSC::FunctionCallValueNode::emitCode): Ditto.
24565 (JSC::FunctionCallResolveNode::emitCode): Ditto.
24566 (JSC::FunctionCallBracketNode::emitCode): Ditto.
24567 (JSC::FunctionCallDotNode::emitCode): Ditto.
24568 (JSC::PostfixResolveNode::emitCode): Ditto.
24569 (JSC::PostfixBracketNode::emitCode): Ditto.
24570 (JSC::PostfixDotNode::emitCode): Ditto.
24571 (JSC::DeleteResolveNode::emitCode): Ditto.
24572 (JSC::DeleteBracketNode::emitCode): Ditto.
24573 (JSC::DeleteDotNode::emitCode): Ditto.
24574 (JSC::PrefixResolveNode::emitCode): Ditto.
24575 (JSC::PrefixBracketNode::emitCode): Ditto.
24576 (JSC::PrefixDotNode::emitCode): Ditto.
24577 (JSC::ThrowableBinaryOpNode::emitCode): Ditto.
24578 (JSC::InstanceOfNode::emitCode): Ditto.
24579 (JSC::ReadModifyResolveNode::emitCode): Ditto.
24580 (JSC::AssignResolveNode::emitCode): Ditto.
24581 (JSC::AssignDotNode::emitCode): Ditto.
24582 (JSC::ReadModifyDotNode::emitCode): Ditto.
24583 (JSC::AssignBracketNode::emitCode): Ditto.
24584 (JSC::ReadModifyBracketNode::emitCode): Ditto.
24585 (JSC::statementListEmitCode): Take a const StatementVector instead
24586 of a non-const one. Also removed unused statementListPushFIFO.
24587 (JSC::ForInNode::emitCode): Inline functions instead of member access.
24588 (JSC::ThrowNode::emitCode): Ditto.
24589 (JSC::EvalNode::emitCode): Ditto.
24590 (JSC::FunctionBodyNode::emitCode): Ditto.
24591 (JSC::ProgramNode::emitCode): Ditto.
24592
24593 * parser/Nodes.h: Removed unused includes and forward declarations.
24594 Removed Precedence enum. Made many more members private instead of
24595 protected or public. Removed unused NodeStack typedef. Moved the
24596 VarStack and FunctionStack typedefs from Node to ScopeNode. Made
24597 Node::emitCode pure virtual and changed classes that don't emit
24598 any code to inherit from ParserRefCounted rather than Node.
24599 Moved isReturnNode from Node to StatementNode. Removed the
24600 streamTo, precedence, and needsParensIfLeftmost functions from
24601 all classes. Removed the ImmediateNumberNode class and make
24602 NumberNode::setValue nonvirtual.
24603
24604 * parser/nodes2string.cpp: Removed.
24605
24606 2008-11-09 Darin Adler <darin@apple.com>
24607
24608 Reviewed by Sam Weinig and Maciej Stachowiak.
24609 Includes some work done by Chris Brichford.
24610
24611 - fix https://bugs.webkit.org/show_bug.cgi?id=14886
24612 Stack overflow due to deeply nested parse tree doing repeated string concatentation
24613
24614 Test: fast/js/large-expressions.html
24615
24616 1) Code generation is recursive, so takes stack proportional to the complexity
24617 of the source code expression. Fixed by setting an arbitrary recursion limit
24618 of 10,000 nodes.
24619
24620 2) Destruction of the syntax tree was recursive. Fixed by introducing a
24621 non-recursive mechanism for destroying the tree.
24622
24623 * bytecompiler/CodeGenerator.cpp:
24624 (JSC::CodeGenerator::CodeGenerator): Initialize depth to 0.
24625 (JSC::CodeGenerator::emitThrowExpressionTooDeepException): Added. Emits the code
24626 to throw a "too deep" exception.
24627 * bytecompiler/CodeGenerator.h:
24628 (JSC::CodeGenerator::emitNode): Check depth and emit an exception if we exceed
24629 the maximum depth.
24630
24631 * parser/Nodes.cpp:
24632 (JSC::NodeReleaser::releaseAllNodes): Added. To be called inside node destructors
24633 to avoid recursive calls to destructors for nodes inside this one.
24634 (JSC::NodeReleaser::release): Added. To be called inside releaseNodes functions.
24635 Also added releaseNodes functions and calls to releaseAllNodes inside destructors
24636 for each class derived from Node that has RefPtr to other nodes.
24637 (JSC::NodeReleaser::adopt): Added. Used by the release function.
24638 (JSC::NodeReleaser::adoptFunctionBodyNode): Added.
24639
24640 * parser/Nodes.h: Added declarations of releaseNodes and destructors in all classes
24641 that needed it. Eliminated use of ListRefPtr and releaseNext, which are the two parts
24642 of an older solution to the non-recursive destruction problem that works only for
24643 lists, whereas the new solution works for other graphs. Changed ReverseBinaryOpNode
24644 to use BinaryOpNode as a base class to avoid some duplicated code.
24645
24646 2008-11-08 Kevin Ollivier <kevino@theolliviers.com>
24647
24648 wx build fixes after addition of JSCore parser and bycompiler dirs. Also cleanup
24649 the JSCore Bakefile's group names to be consistent.
24650
24651 * JavaScriptCoreSources.bkl:
24652 * jscore.bkl:
24653
24654 2008-11-07 Cameron Zwarich <zwarich@apple.com>
24655
24656 Reviewed by Geoff Garen.
24657
24658 Bug 21801: REGRESSION (r37821): YUI date formatting JavaScript puts the letter 'd' in place of the day
24659 <https://bugs.webkit.org/show_bug.cgi?id=21801>
24660
24661 Fix the constant register check in the 'typeof' optimization in
24662 CodeGenerator, which was completely broken after r37821.
24663
24664 * bytecompiler/CodeGenerator.cpp:
24665 (JSC::CodeGenerator::emitEqualityOp):
24666
24667 2008-11-07 Cameron Zwarich <zwarich@apple.com>
24668
24669 Reviewed by Geoff Garen.
24670
24671 Bug 22129: Move CTI::isConstant() to CodeBlock
24672 <https://bugs.webkit.org/show_bug.cgi?id=22129>
24673
24674 * VM/CTI.cpp:
24675 (JSC::CTI::emitGetArg):
24676 (JSC::CTI::emitGetPutArg):
24677 (JSC::CTI::getConstantImmediateNumericArg):
24678 (JSC::CTI::printOpcodeOperandTypes):
24679 (JSC::CTI::privateCompileMainPass):
24680 * VM/CTI.h:
24681 * VM/CodeBlock.h:
24682 (JSC::CodeBlock::isConstant):
24683
24684 2008-11-07 Alp Toker <alp@nuanti.com>
24685
24686 autotools fix. Always use the configured perl binary (which may be
24687 different to the one in $PATH) when generating sources.
24688
24689 * GNUmakefile.am:
24690
24691 2008-11-07 Cameron Zwarich <zwarich@apple.com>
24692
24693 Not reviewed.
24694
24695 Change grammar.cpp to Grammar.cpp and grammar.h to Grammar.h in several
24696 build scripts.
24697
24698 * DerivedSources.make:
24699 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
24700 * JavaScriptCoreSources.bkl:
24701
24702 2008-11-07 Alp Toker <alp@nuanti.com>
24703
24704 More grammar.cpp -> Grammar.cpp build fixes.
24705
24706 * AllInOneFile.cpp:
24707 * GNUmakefile.am:
24708
24709 2008-11-07 Simon Hausmann <hausmann@webkit.org>
24710
24711 Fix the build on case-sensitive file systems. grammar.y was renamed to
24712 Grammar.y but Lexer.cpp includes grammar.h. The build bots didn't
24713 notice this change because of stale files.
24714
24715 * parser/Lexer.cpp:
24716
24717 2008-11-07 Cameron Zwarich <zwarich@apple.com>
24718
24719 Reviewed by Alexey Proskuryakov.
24720
24721 Rename the m_nextGlobal, m_nextParameter, and m_nextConstant member
24722 variables of CodeGenerator to m_nextGlobalIndex, m_nextParameterIndex,
24723 and m_nextConstantIndex respectively. This is to distinguish these from
24724 member variables like m_lastConstant, which are actually RefPtrs to
24725 Registers.
24726
24727 * bytecompiler/CodeGenerator.cpp:
24728 (JSC::CodeGenerator::addGlobalVar):
24729 (JSC::CodeGenerator::allocateConstants):
24730 (JSC::CodeGenerator::CodeGenerator):
24731 (JSC::CodeGenerator::addParameter):
24732 (JSC::CodeGenerator::addConstant):
24733 * bytecompiler/CodeGenerator.h:
24734
24735 2008-11-06 Gavin Barraclough barraclough@apple.com
24736
24737 Reviewed by Oliver Hunt.
24738
24739 Do not make a cti_* call to perform an op_call unless either:
24740 (1) The codeblock for the function body has not been generated.
24741 (2) The number of arguments passed does not match the callee arity.
24742
24743 ~1% progression on sunspider --v8
24744
24745 * VM/CTI.cpp:
24746 (JSC::CTI::compileOpCallInitializeCallFrame):
24747 (JSC::CTI::compileOpCall):
24748 (JSC::CTI::privateCompileSlowCases):
24749 * VM/CTI.h:
24750 * VM/Machine.cpp:
24751 (JSC::Machine::cti_op_call_JSFunction):
24752 (JSC::Machine::cti_op_call_arityCheck):
24753 (JSC::Machine::cti_op_construct_JSConstruct):
24754 * VM/Machine.h:
24755 * kjs/nodes.h:
24756
24757 2008-11-06 Cameron Zwarich <zwarich@apple.com>
24758
24759 Reviewed by Geoff Garen.
24760
24761 Move the remaining files in the kjs subdirectory of JavaScriptCore to
24762 a new parser subdirectory, and remove the kjs subdirectory entirely.
24763
24764 * AllInOneFile.cpp:
24765 * DerivedSources.make:
24766 * GNUmakefile.am:
24767 * JavaScriptCore.pri:
24768 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
24769 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
24770 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
24771 * JavaScriptCore.xcodeproj/project.pbxproj:
24772 * JavaScriptCoreSources.bkl:
24773 * VM/CodeBlock.h:
24774 * VM/ExceptionHelpers.cpp:
24775 * VM/SamplingTool.h:
24776 * bytecompiler/CodeGenerator.h:
24777 * jsc.pro:
24778 * jscore.bkl:
24779 * kjs: Removed.
24780 * kjs/NodeInfo.h: Removed.
24781 * kjs/Parser.cpp: Removed.
24782 * kjs/Parser.h: Removed.
24783 * kjs/ResultType.h: Removed.
24784 * kjs/SourceCode.h: Removed.
24785 * kjs/SourceProvider.h: Removed.
24786 * kjs/grammar.y: Removed.
24787 * kjs/keywords.table: Removed.
24788 * kjs/lexer.cpp: Removed.
24789 * kjs/lexer.h: Removed.
24790 * kjs/nodes.cpp: Removed.
24791 * kjs/nodes.h: Removed.
24792 * kjs/nodes2string.cpp: Removed.
24793 * parser: Added.
24794 * parser/Grammar.y: Copied from kjs/grammar.y.
24795 * parser/Keywords.table: Copied from kjs/keywords.table.
24796 * parser/Lexer.cpp: Copied from kjs/lexer.cpp.
24797 * parser/Lexer.h: Copied from kjs/lexer.h.
24798 * parser/NodeInfo.h: Copied from kjs/NodeInfo.h.
24799 * parser/Nodes.cpp: Copied from kjs/nodes.cpp.
24800 * parser/Nodes.h: Copied from kjs/nodes.h.
24801 * parser/Parser.cpp: Copied from kjs/Parser.cpp.
24802 * parser/Parser.h: Copied from kjs/Parser.h.
24803 * parser/ResultType.h: Copied from kjs/ResultType.h.
24804 * parser/SourceCode.h: Copied from kjs/SourceCode.h.
24805 * parser/SourceProvider.h: Copied from kjs/SourceProvider.h.
24806 * parser/nodes2string.cpp: Copied from kjs/nodes2string.cpp.
24807 * pcre/pcre.pri:
24808 * pcre/pcre_exec.cpp:
24809 * runtime/FunctionConstructor.cpp:
24810 * runtime/JSActivation.h:
24811 * runtime/JSFunction.h:
24812 * runtime/JSGlobalData.cpp:
24813 * runtime/JSGlobalObjectFunctions.cpp:
24814 * runtime/JSObject.cpp:
24815 (JSC::JSObject::toNumber):
24816 * runtime/RegExp.cpp:
24817
24818 2008-11-06 Adam Roben <aroben@apple.com>
24819
24820 Windows build fix after r38196
24821
24822 * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added bytecompiler/ to the
24823 include path.
24824
24825 2008-11-06 Cameron Zwarich <zwarich@apple.com>
24826
24827 Rubber-stamped by Sam Weinig.
24828
24829 Create a new bytecompiler subdirectory of JavaScriptCore and move some
24830 relevant files to it.
24831
24832 * AllInOneFile.cpp:
24833 * GNUmakefile.am:
24834 * JavaScriptCore.pri:
24835 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
24836 * JavaScriptCore.xcodeproj/project.pbxproj:
24837 * JavaScriptCoreSources.bkl:
24838 * VM/CodeGenerator.cpp: Removed.
24839 * VM/CodeGenerator.h: Removed.
24840 * bytecompiler: Added.
24841 * bytecompiler/CodeGenerator.cpp: Copied from VM/CodeGenerator.cpp.
24842 * bytecompiler/CodeGenerator.h: Copied from VM/CodeGenerator.h.
24843 * bytecompiler/LabelScope.h: Copied from kjs/LabelScope.h.
24844 * jscore.bkl:
24845 * kjs/LabelScope.h: Removed.
24846
24847 2008-11-06 Adam Roben <aroben@apple.com>
24848
24849 Windows clean build fix after r38155
24850
24851 Rubberstamped by Cameron Zwarich.
24852
24853 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update
24854 the post-build event for the move of create_hash_table out of kjs/.
24855
24856 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
24857
24858 Reviewed by Darin Adler.
24859
24860 https://bugs.webkit.org/show_bug.cgi?id=22107
24861
24862 Bug uncovered during RVCT port in functions not used. get_lt() and
24863 get_gt() takes only one argument - remove second argument where
24864 applicable.
24865
24866 * wtf/AVLTree.h:
24867 (JSC::AVLTree::remove): Remove second argument of get_lt/get_gt().
24868 (JSC::AVLTree::subst): Ditto.
24869
24870 2008-11-06 Alp Toker <alp@nuanti.com>
24871
24872 Reviewed by Cameron Zwarich.
24873
24874 https://bugs.webkit.org/show_bug.cgi?id=22033
24875 [GTK] CTI/Linux r38064 crashes; JIT requires executable memory
24876
24877 Mark pages allocated by the FastMalloc mmap code path executable with
24878 PROT_EXEC. This fixes crashes seen on CPUs and kernels that enforce
24879 non-executable memory (like ExecShield on Fedora Linux) when the JIT
24880 is enabled.
24881
24882 This patch does not resolve the issue on debug builds so affected
24883 developers may still need to pass --disable-jit to configure.
24884
24885 * wtf/TCSystemAlloc.cpp:
24886 (TryMmap):
24887 (TryDevMem):
24888 (TCMalloc_SystemRelease):
24889
24890 2008-11-06 Peter Gal <galpeter@inf.u-szeged.hu>
24891
24892 Reviewed by Cameron Zwarich.
24893
24894 Bug 22099: Make the Qt port build the JSC shell in the correct place
24895 <https://bugs.webkit.org/show_bug.cgi?id=22099>
24896
24897 Adjust include paths and build destination dir for the 'jsc' executable
24898 in the Qt build.
24899
24900 * jsc.pro:
24901
24902 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
24903
24904 Reviewed by Simon Hausmann.
24905
24906 Implemented the block allocation on Symbian through heap allocation.
24907
24908 Unfortunately there is no way to allocate virtual memory. The Posix
24909 layer provides mmap() but no anonymous mapping. So this is a very slow
24910 solution but it should work as a start.
24911
24912 * runtime/Collector.cpp:
24913 (JSC::allocateBlock):
24914 (JSC::freeBlock):
24915
24916 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
24917
24918 Reviewed by Simon Hausmann.
24919
24920 Borrow some math functions from the MSVC port to the build with the
24921 RVCT compiler.
24922
24923 * wtf/MathExtras.h:
24924 (isinf):
24925 (isnan):
24926 (signbit):
24927
24928 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
24929
24930 Reviewed by Simon Hausmann.
24931
24932 Include strings.h for strncasecmp().
24933 This is needed for compilation inside Symbian and it is also
24934 confirmed by the man-page on Linux.
24935
24936 * runtime/DateMath.cpp:
24937
24938 2008-11-06 Norbert Leser <norbert.leser@nokia.com>
24939
24940 Reviewed by Simon Hausmann.
24941
24942 Implemented currentThreadStackBase for Symbian.
24943
24944 * runtime/Collector.cpp:
24945 (JSC::currentThreadStackBase):
24946
24947 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
24948
24949 Reviewed by Simon Hausmann.
24950
24951 RVCT does not support tm_gmtoff field, so disable that code just like
24952 for MSVC.
24953
24954 * runtime/DateMath.h:
24955 (JSC::GregorianDateTime::GregorianDateTime):
24956 (JSC::GregorianDateTime::operator tm):
24957
24958 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
24959
24960 Reviewed by Simon Hausmann.
24961
24962 Define PLATFORM(UNIX) for S60. Effectively WebKit on S60 is compiled
24963 on top of the Posix layer.
24964
24965 * wtf/Platform.h:
24966
24967 2008-11-06 Norbert Leser <norbert.leser@nokia.com>
24968
24969 Reviewed by Simon Hausmann.
24970
24971 Added __SYMBIAN32__ condition for defining PLATFORM(SYMBIAN).
24972
24973 * wtf/Platform.h:
24974
24975 2008-11-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
24976
24977 Reviewed by Simon Hausmann.
24978
24979 Added WINSCW compiler define for Symbian S60.
24980
24981 * wtf/Platform.h:
24982
24983 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
24984
24985 Reviewed by Simon Hausmann.
24986
24987 Use the GCC defines of the WTF_ALIGN* macros for the RVCT and the
24988 MINSCW compiler.
24989
24990 * wtf/Vector.h:
24991
24992 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
24993
24994 Reviewed by Simon Hausmann.
24995
24996 Define capabilities of the SYMBIAN platform. Some of the system
24997 headers are actually dependent on RVCT.
24998
24999 * wtf/Platform.h:
25000
25001 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
25002
25003 Reviewed by Simon Hausmann.
25004
25005 Add missing stddef.h header needed for compilation in Symbian.
25006
25007 * runtime/Collector.h:
25008
25009 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
25010
25011 Reviewed by Simon Hausmann.
25012
25013 Added COMPILER(RVCT) to detect the ARM RVCT compiler used in the Symbian environment.
25014
25015 * wtf/Platform.h:
25016
25017 2008-11-06 Simon Hausmann <hausmann@webkit.org>
25018
25019 Fix the Qt build, adjust include paths after move of jsc.pro.
25020
25021 * jsc.pro:
25022
25023 2008-11-06 Cameron Zwarich <zwarich@apple.com>
25024
25025 Rubber-stamped by Sam Weinig.
25026
25027 Move kjs/Shell.cpp to the top level of the JavaScriptCore directory and
25028 rename it to jsc.cpp to reflect the name of the binary compiled from it.
25029
25030 * GNUmakefile.am:
25031 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
25032 * JavaScriptCore.xcodeproj/project.pbxproj:
25033 * jsc.cpp: Copied from kjs/Shell.cpp.
25034 * jsc.pro:
25035 * jscore.bkl:
25036 * kjs/Shell.cpp: Removed.
25037
25038 2008-11-06 Cameron Zwarich <zwarich@apple.com>
25039
25040 Rubber-stamped by Sam Weinig.
25041
25042 Move create_hash_table and jsc.pro out of the kjs directory and into the
25043 root directory of JavaScriptCore.
25044
25045 * DerivedSources.make:
25046 * JavaScriptCore.pri:
25047 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25048 * JavaScriptCore.xcodeproj/project.pbxproj:
25049 * create_hash_table: Copied from kjs/create_hash_table.
25050 * jsc.pro: Copied from kjs/jsc.pro.
25051 * kjs/create_hash_table: Removed.
25052 * kjs/jsc.pro: Removed.
25053 * make-generated-sources.sh:
25054
25055 2008-11-05 Gavin Barraclough <barraclough@apple.com>
25056
25057 Reviewed by Maciej Stachowiak.
25058
25059 https://bugs.webkit.org/show_bug.cgi?id=22094
25060
25061 Fix for bug where the callee incorrectly recieves the caller's lexical
25062 global object as this, rather than its own. Implementation closely
25063 follows the spec, passing jsNull, checking in the callee and replacing
25064 with the global object where necessary.
25065
25066 * VM/CTI.cpp:
25067 (JSC::CTI::compileOpCall):
25068 * VM/Machine.cpp:
25069 (JSC::Machine::cti_op_call_NotJSFunction):
25070 (JSC::Machine::cti_op_call_eval):
25071 * runtime/JSCell.h:
25072 (JSC::JSValue::toThisObject):
25073 * runtime/JSImmediate.cpp:
25074 (JSC::JSImmediate::toThisObject):
25075 * runtime/JSImmediate.h:
25076
25077 2008-11-05 Kevin Ollivier <kevino@theolliviers.com>
25078
25079 wx build fix after Operations.cpp move.
25080
25081 * JavaScriptCoreSources.bkl:
25082
25083 2008-11-05 Cameron Zwarich <zwarich@apple.com>
25084
25085 Not reviewed.
25086
25087 Fix the build for case-sensitive build systems and wxWindows.
25088
25089 * JavaScriptCoreSources.bkl:
25090 * kjs/create_hash_table:
25091
25092 2008-11-05 Cameron Zwarich <zwarich@apple.com>
25093
25094 Not reviewed.
25095
25096 Fix the build for case-sensitive build systems.
25097
25098 * JavaScriptCoreSources.bkl:
25099 * kjs/Shell.cpp:
25100 * runtime/Interpreter.cpp:
25101 * runtime/JSArray.cpp:
25102
25103 2008-11-05 Cameron Zwarich <zwarich@apple.com>
25104
25105 Not reviewed.
25106
25107 Fix the build for case-sensitive build systems.
25108
25109 * API/JSBase.cpp:
25110 * API/JSObjectRef.cpp:
25111 * runtime/CommonIdentifiers.h:
25112 * runtime/Identifier.cpp:
25113 * runtime/InitializeThreading.cpp:
25114 * runtime/InternalFunction.h:
25115 * runtime/JSString.h:
25116 * runtime/Lookup.h:
25117 * runtime/PropertyNameArray.h:
25118 * runtime/PropertySlot.h:
25119 * runtime/StructureID.cpp:
25120 * runtime/StructureID.h:
25121 * runtime/UString.cpp:
25122
25123 2008-11-05 Cameron Zwarich <zwarich@apple.com>
25124
25125 Rubber-stamped by Sam Weinig.
25126
25127 Move more files to the runtime subdirectory of JavaScriptCore.
25128
25129 * API/APICast.h:
25130 * API/JSBase.cpp:
25131 * API/JSCallbackObject.cpp:
25132 * API/JSClassRef.cpp:
25133 * API/JSClassRef.h:
25134 * API/JSStringRefCF.cpp:
25135 * API/JSValueRef.cpp:
25136 * API/OpaqueJSString.cpp:
25137 * API/OpaqueJSString.h:
25138 * AllInOneFile.cpp:
25139 * GNUmakefile.am:
25140 * JavaScriptCore.pri:
25141 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25142 * JavaScriptCore.xcodeproj/project.pbxproj:
25143 * JavaScriptCoreSources.bkl:
25144 * VM/CodeBlock.h:
25145 * VM/CodeGenerator.cpp:
25146 * VM/Machine.cpp:
25147 * VM/RegisterFile.h:
25148 * debugger/Debugger.h:
25149 * kjs/SourceProvider.h:
25150 * kjs/TypeInfo.h: Removed.
25151 * kjs/collector.cpp: Removed.
25152 * kjs/collector.h: Removed.
25153 * kjs/completion.h: Removed.
25154 * kjs/create_hash_table:
25155 * kjs/identifier.cpp: Removed.
25156 * kjs/identifier.h: Removed.
25157 * kjs/interpreter.cpp: Removed.
25158 * kjs/interpreter.h: Removed.
25159 * kjs/lexer.cpp:
25160 * kjs/lexer.h:
25161 * kjs/lookup.cpp: Removed.
25162 * kjs/lookup.h: Removed.
25163 * kjs/nodes.cpp:
25164 * kjs/nodes.h:
25165 * kjs/operations.cpp: Removed.
25166 * kjs/operations.h: Removed.
25167 * kjs/protect.h: Removed.
25168 * kjs/regexp.cpp: Removed.
25169 * kjs/regexp.h: Removed.
25170 * kjs/ustring.cpp: Removed.
25171 * kjs/ustring.h: Removed.
25172 * pcre/pcre_exec.cpp:
25173 * profiler/CallIdentifier.h:
25174 * profiler/Profile.h:
25175 * runtime/ArrayConstructor.cpp:
25176 * runtime/ArrayPrototype.cpp:
25177 * runtime/ArrayPrototype.h:
25178 * runtime/Collector.cpp: Copied from kjs/collector.cpp.
25179 * runtime/Collector.h: Copied from kjs/collector.h.
25180 * runtime/CollectorHeapIterator.h:
25181 * runtime/Completion.h: Copied from kjs/completion.h.
25182 * runtime/ErrorPrototype.cpp:
25183 * runtime/Identifier.cpp: Copied from kjs/identifier.cpp.
25184 * runtime/Identifier.h: Copied from kjs/identifier.h.
25185 * runtime/InitializeThreading.cpp:
25186 * runtime/Interpreter.cpp: Copied from kjs/interpreter.cpp.
25187 * runtime/Interpreter.h: Copied from kjs/interpreter.h.
25188 * runtime/JSCell.h:
25189 * runtime/JSGlobalData.cpp:
25190 * runtime/JSGlobalData.h:
25191 * runtime/JSLock.cpp:
25192 * runtime/JSNumberCell.cpp:
25193 * runtime/JSNumberCell.h:
25194 * runtime/JSObject.cpp:
25195 * runtime/JSValue.h:
25196 * runtime/Lookup.cpp: Copied from kjs/lookup.cpp.
25197 * runtime/Lookup.h: Copied from kjs/lookup.h.
25198 * runtime/MathObject.cpp:
25199 * runtime/NativeErrorPrototype.cpp:
25200 * runtime/NumberPrototype.cpp:
25201 * runtime/Operations.cpp: Copied from kjs/operations.cpp.
25202 * runtime/Operations.h: Copied from kjs/operations.h.
25203 * runtime/PropertyMapHashTable.h:
25204 * runtime/Protect.h: Copied from kjs/protect.h.
25205 * runtime/RegExp.cpp: Copied from kjs/regexp.cpp.
25206 * runtime/RegExp.h: Copied from kjs/regexp.h.
25207 * runtime/RegExpConstructor.cpp:
25208 * runtime/RegExpObject.h:
25209 * runtime/RegExpPrototype.cpp:
25210 * runtime/SmallStrings.h:
25211 * runtime/StringObjectThatMasqueradesAsUndefined.h:
25212 * runtime/StructureID.cpp:
25213 * runtime/StructureID.h:
25214 * runtime/StructureIDTransitionTable.h:
25215 * runtime/SymbolTable.h:
25216 * runtime/TypeInfo.h: Copied from kjs/TypeInfo.h.
25217 * runtime/UString.cpp: Copied from kjs/ustring.cpp.
25218 * runtime/UString.h: Copied from kjs/ustring.h.
25219 * wrec/CharacterClassConstructor.h:
25220 * wrec/WREC.h:
25221
25222 2008-11-05 Geoffrey Garen <ggaren@apple.com>
25223
25224 Suggested by Darin Adler.
25225
25226 Removed two copy constructors that the compiler can generate for us
25227 automatically.
25228
25229 * VM/LabelID.h:
25230 (JSC::LabelID::setLocation):
25231 (JSC::LabelID::offsetFrom):
25232 (JSC::LabelID::ref):
25233 (JSC::LabelID::refCount):
25234 * kjs/LabelScope.h:
25235
25236 2008-11-05 Anders Carlsson <andersca@apple.com>
25237
25238 Fix Snow Leopard build.
25239
25240 * JavaScriptCore.xcodeproj/project.pbxproj:
25241
25242 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25243
25244 Rubber-stamped by Steve Falkenburg.
25245
25246 Move dtoa.cpp and dtoa.h to the WTF Visual Studio project to reflect
25247 their movement in the filesystem.
25248
25249 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25250 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
25251
25252 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25253
25254 Rubber-stamped by Sam Weinig.
25255
25256 Move kjs/dtoa.h to the wtf subdirectory of JavaScriptCore.
25257
25258 * AllInOneFile.cpp:
25259 * GNUmakefile.am:
25260 * JavaScriptCore.pri:
25261 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25262 * JavaScriptCore.xcodeproj/project.pbxproj:
25263 * JavaScriptCoreSources.bkl:
25264 * kjs/dtoa.cpp: Removed.
25265 * kjs/dtoa.h: Removed.
25266 * wtf/dtoa.cpp: Copied from kjs/dtoa.cpp.
25267 * wtf/dtoa.h: Copied from kjs/dtoa.h.
25268
25269 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25270
25271 Rubber-stamped by Sam Weinig.
25272
25273 Move kjs/config.h to the top level of JavaScriptCore.
25274
25275 * GNUmakefile.am:
25276 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25277 * JavaScriptCore.xcodeproj/project.pbxproj:
25278 * config.h: Copied from kjs/config.h.
25279 * kjs/config.h: Removed.
25280
25281 2008-11-04 Darin Adler <darin@apple.com>
25282
25283 Reviewed by Tim Hatcher.
25284
25285 * wtf/ThreadingNone.cpp: Tweak formatting.
25286
25287 2008-11-03 Darin Adler <darin@apple.com>
25288
25289 Reviewed by Tim Hatcher.
25290
25291 - https://bugs.webkit.org/show_bug.cgi?id=22061
25292 create script to check for exit-time destructors
25293
25294 * JavaScriptCore.exp: Changed to export functions rather than
25295 a global for the atomically initialized static mutex.
25296
25297 * JavaScriptCore.xcodeproj/project.pbxproj: Added a script
25298 phase that runs the check-for-exit-time-destructors script.
25299
25300 * wtf/MainThread.cpp:
25301 (WTF::mainThreadFunctionQueueMutex): Changed to leak an object
25302 rather than using an exit time destructor.
25303 (WTF::functionQueue): Ditto.
25304 * wtf/unicode/icu/CollatorICU.cpp:
25305 (WTF::cachedCollatorMutex): Ditto.
25306
25307 * wtf/Threading.h: Changed other platforms to share the Windows
25308 approach where the mutex is internal and the functions are exported.
25309 * wtf/ThreadingGtk.cpp:
25310 (WTF::lockAtomicallyInitializedStaticMutex): Ditto.
25311 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
25312 * wtf/ThreadingNone.cpp:
25313 (WTF::lockAtomicallyInitializedStaticMutex): Ditto.
25314 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
25315 * wtf/ThreadingPthreads.cpp:
25316 (WTF::threadMapMutex): Changed to leak an object rather than using
25317 an exit time destructor.
25318 (WTF::lockAtomicallyInitializedStaticMutex): Mutex change.
25319 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
25320 (WTF::threadMap): Changed to leak an object rather than using
25321 an exit time destructor.
25322 * wtf/ThreadingQt.cpp:
25323 (WTF::lockAtomicallyInitializedStaticMutex): Mutex change.
25324 (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
25325 * wtf/ThreadingWin.cpp:
25326 (WTF::lockAtomicallyInitializedStaticMutex): Added an assertion.
25327
25328 2008-11-04 Adam Roben <aroben@apple.com>
25329
25330 Windows build fix
25331
25332 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update
25333 the location of JSStaticScopeObject.{cpp,h}.
25334
25335 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25336
25337 Reviewed by Alexey Proskuryakov.
25338
25339 Move AllInOneFile.cpp to the top level of JavaScriptCore.
25340
25341 * AllInOneFile.cpp: Copied from kjs/AllInOneFile.cpp.
25342 * GNUmakefile.am:
25343 * JavaScriptCore.xcodeproj/project.pbxproj:
25344 * kjs/AllInOneFile.cpp: Removed.
25345
25346 2008-11-04 Cameron Zwarich <zwarich@apple.com>
25347
25348 Rubber-stamped by Alexey Proskuryakov.
25349
25350 Add NodeInfo.h to the JavaScriptCore Xcode project.
25351
25352 * JavaScriptCore.xcodeproj/project.pbxproj:
25353
25354 2008-11-03 Cameron Zwarich <zwarich@apple.com>
25355
25356 Rubber-stamped by Maciej Stachowiak.
25357
25358 Move more files into the runtime subdirectory of JavaScriptCore.
25359
25360 * API/JSBase.cpp:
25361 * API/JSCallbackConstructor.cpp:
25362 * API/JSCallbackFunction.cpp:
25363 * API/JSClassRef.cpp:
25364 * API/OpaqueJSString.cpp:
25365 * GNUmakefile.am:
25366 * JavaScriptCore.pri:
25367 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25368 * JavaScriptCore.xcodeproj/project.pbxproj:
25369 * JavaScriptCoreSources.bkl:
25370 * kjs/AllInOneFile.cpp:
25371 * kjs/ArgList.cpp: Removed.
25372 * kjs/ArgList.h: Removed.
25373 * kjs/Arguments.cpp: Removed.
25374 * kjs/Arguments.h: Removed.
25375 * kjs/BatchedTransitionOptimizer.h: Removed.
25376 * kjs/CollectorHeapIterator.h: Removed.
25377 * kjs/CommonIdentifiers.cpp: Removed.
25378 * kjs/CommonIdentifiers.h: Removed.
25379 * kjs/ExecState.cpp: Removed.
25380 * kjs/ExecState.h: Removed.
25381 * kjs/GetterSetter.cpp: Removed.
25382 * kjs/GetterSetter.h: Removed.
25383 * kjs/InitializeThreading.cpp: Removed.
25384 * kjs/InitializeThreading.h: Removed.
25385 * kjs/JSActivation.cpp: Removed.
25386 * kjs/JSActivation.h: Removed.
25387 * kjs/JSGlobalData.cpp: Removed.
25388 * kjs/JSGlobalData.h: Removed.
25389 * kjs/JSLock.cpp: Removed.
25390 * kjs/JSLock.h: Removed.
25391 * kjs/JSStaticScopeObject.cpp: Removed.
25392 * kjs/JSStaticScopeObject.h: Removed.
25393 * kjs/JSType.h: Removed.
25394 * kjs/PropertyNameArray.cpp: Removed.
25395 * kjs/PropertyNameArray.h: Removed.
25396 * kjs/ScopeChain.cpp: Removed.
25397 * kjs/ScopeChain.h: Removed.
25398 * kjs/ScopeChainMark.h: Removed.
25399 * kjs/SymbolTable.h: Removed.
25400 * kjs/Tracing.d: Removed.
25401 * kjs/Tracing.h: Removed.
25402 * runtime/ArgList.cpp: Copied from kjs/ArgList.cpp.
25403 * runtime/ArgList.h: Copied from kjs/ArgList.h.
25404 * runtime/Arguments.cpp: Copied from kjs/Arguments.cpp.
25405 * runtime/Arguments.h: Copied from kjs/Arguments.h.
25406 * runtime/BatchedTransitionOptimizer.h: Copied from kjs/BatchedTransitionOptimizer.h.
25407 * runtime/CollectorHeapIterator.h: Copied from kjs/CollectorHeapIterator.h.
25408 * runtime/CommonIdentifiers.cpp: Copied from kjs/CommonIdentifiers.cpp.
25409 * runtime/CommonIdentifiers.h: Copied from kjs/CommonIdentifiers.h.
25410 * runtime/ExecState.cpp: Copied from kjs/ExecState.cpp.
25411 * runtime/ExecState.h: Copied from kjs/ExecState.h.
25412 * runtime/GetterSetter.cpp: Copied from kjs/GetterSetter.cpp.
25413 * runtime/GetterSetter.h: Copied from kjs/GetterSetter.h.
25414 * runtime/InitializeThreading.cpp: Copied from kjs/InitializeThreading.cpp.
25415 * runtime/InitializeThreading.h: Copied from kjs/InitializeThreading.h.
25416 * runtime/JSActivation.cpp: Copied from kjs/JSActivation.cpp.
25417 * runtime/JSActivation.h: Copied from kjs/JSActivation.h.
25418 * runtime/JSGlobalData.cpp: Copied from kjs/JSGlobalData.cpp.
25419 * runtime/JSGlobalData.h: Copied from kjs/JSGlobalData.h.
25420 * runtime/JSLock.cpp: Copied from kjs/JSLock.cpp.
25421 * runtime/JSLock.h: Copied from kjs/JSLock.h.
25422 * runtime/JSStaticScopeObject.cpp: Copied from kjs/JSStaticScopeObject.cpp.
25423 * runtime/JSStaticScopeObject.h: Copied from kjs/JSStaticScopeObject.h.
25424 * runtime/JSType.h: Copied from kjs/JSType.h.
25425 * runtime/PropertyNameArray.cpp: Copied from kjs/PropertyNameArray.cpp.
25426 * runtime/PropertyNameArray.h: Copied from kjs/PropertyNameArray.h.
25427 * runtime/ScopeChain.cpp: Copied from kjs/ScopeChain.cpp.
25428 * runtime/ScopeChain.h: Copied from kjs/ScopeChain.h.
25429 * runtime/ScopeChainMark.h: Copied from kjs/ScopeChainMark.h.
25430 * runtime/SymbolTable.h: Copied from kjs/SymbolTable.h.
25431 * runtime/Tracing.d: Copied from kjs/Tracing.d.
25432 * runtime/Tracing.h: Copied from kjs/Tracing.h.
25433
25434 2008-11-03 Sam Weinig <sam@webkit.org>
25435
25436 Reviewed by Mark Rowe.
25437
25438 Move #define to turn on dumping StructureID statistics to StructureID.cpp so that
25439 turning it on does not require a full rebuild.
25440
25441 * runtime/StructureID.cpp:
25442 (JSC::StructureID::dumpStatistics):
25443 * runtime/StructureID.h:
25444
25445 2008-11-03 Alp Toker <alp@nuanti.com>
25446
25447 Reviewed by Geoffrey Garen.
25448
25449 Fix warning when building on Darwin without JSC_MULTIPLE_THREADS
25450 enabled.
25451
25452 * kjs/InitializeThreading.cpp:
25453
25454 2008-11-02 Matt Lilek <webkit@mattlilek.com>
25455
25456 Reviewed by Cameron Zwarich.
25457
25458 Bug 22042: REGRESSION(r38066): ASSERTION FAILED: source in CodeBlock
25459 <https://bugs.webkit.org/show_bug.cgi?id=22042>
25460
25461 Rename parameter name to avoid ASSERT.
25462
25463 * VM/CodeBlock.h:
25464 (JSC::CodeBlock::CodeBlock):
25465 (JSC::ProgramCodeBlock::ProgramCodeBlock):
25466 (JSC::EvalCodeBlock::EvalCodeBlock):
25467
25468 2008-11-02 Cameron Zwarich <zwarich@apple.com>
25469
25470 Reviewed by Oliver Hunt.
25471
25472 Bug 22035: Remove the '_' suffix on constructor parameter names for structs
25473 <https://bugs.webkit.org/show_bug.cgi?id=22035>
25474
25475 * API/JSCallbackObject.h:
25476 (JSC::JSCallbackObject::JSCallbackObjectData::JSCallbackObjectData):
25477 * VM/CodeBlock.h:
25478 (JSC::CodeBlock::CodeBlock):
25479 (JSC::ProgramCodeBlock::ProgramCodeBlock):
25480 (JSC::EvalCodeBlock::EvalCodeBlock):
25481 * wrec/WREC.h:
25482 (JSC::Quantifier::Quantifier):
25483
25484 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25485
25486 Rubber-stamped by Geoff Garen.
25487
25488 Rename SourceRange.h to SourceCode.h.
25489
25490 * API/JSBase.cpp:
25491 * GNUmakefile.am:
25492 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25493 * JavaScriptCore.xcodeproj/project.pbxproj:
25494 * VM/CodeBlock.h:
25495 * kjs/SourceCode.h: Copied from kjs/SourceRange.h.
25496 * kjs/SourceRange.h: Removed.
25497 * kjs/grammar.y:
25498 * kjs/lexer.h:
25499 * kjs/nodes.cpp:
25500 (JSC::ForInNode::ForInNode):
25501 * kjs/nodes.h:
25502 (JSC::ThrowableExpressionData::setExceptionSourceCode):
25503
25504 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25505
25506 Reviewed by Darin Adler.
25507
25508 Bug 22019: Move JSC::Interpreter::shouldPrintExceptions() to WebCore::Console
25509 <https://bugs.webkit.org/show_bug.cgi?id=22019>
25510
25511 The JSC::Interpreter::shouldPrintExceptions() function is not used at
25512 all in JavaScriptCore, so it should be moved to WebCore::Console, its
25513 only user.
25514
25515 * JavaScriptCore.exp:
25516 * kjs/interpreter.cpp:
25517 * kjs/interpreter.h:
25518
25519 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25520
25521 Not reviewed.
25522
25523 Windows build fix.
25524
25525 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25526
25527 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25528
25529 Rubber-stamped by Sam Weinig.
25530
25531 Remove the call to Interpreter::setShouldPrintExceptions() from the
25532 GlobalObject constructor in the shell. The shouldPrintExceptions()
25533 information is not used anywhere in JavaScriptCore, only in WebCore.
25534
25535 * kjs/Shell.cpp:
25536 (GlobalObject::GlobalObject):
25537
25538 2008-10-31 Kevin Ollivier <kevino@theolliviers.com>
25539
25540 wxMSW build fix.
25541
25542 * wtf/Threading.h:
25543
25544 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25545
25546 Rubber-stamped by Sam Weinig.
25547
25548 Move more files from the kjs subdirectory of JavaScriptCore to the
25549 runtime subdirectory.
25550
25551 * GNUmakefile.am:
25552 * JavaScriptCore.pri:
25553 * JavaScriptCore.xcodeproj/project.pbxproj:
25554 * JavaScriptCoreSources.bkl:
25555 * kjs/AllInOneFile.cpp:
25556 * kjs/RegExpConstructor.cpp: Removed.
25557 * kjs/RegExpConstructor.h: Removed.
25558 * kjs/RegExpMatchesArray.h: Removed.
25559 * kjs/RegExpObject.cpp: Removed.
25560 * kjs/RegExpObject.h: Removed.
25561 * kjs/RegExpPrototype.cpp: Removed.
25562 * kjs/RegExpPrototype.h: Removed.
25563 * runtime/RegExpConstructor.cpp: Copied from kjs/RegExpConstructor.cpp.
25564 * runtime/RegExpConstructor.h: Copied from kjs/RegExpConstructor.h.
25565 * runtime/RegExpMatchesArray.h: Copied from kjs/RegExpMatchesArray.h.
25566 * runtime/RegExpObject.cpp: Copied from kjs/RegExpObject.cpp.
25567 * runtime/RegExpObject.h: Copied from kjs/RegExpObject.h.
25568 * runtime/RegExpPrototype.cpp: Copied from kjs/RegExpPrototype.cpp.
25569 * runtime/RegExpPrototype.h: Copied from kjs/RegExpPrototype.h.
25570
25571 2008-10-31 Mark Rowe <mrowe@apple.com>
25572
25573 Revert an incorrect portion of r38034.
25574
25575 * profiler/ProfilerServer.mm:
25576
25577 2008-10-31 Mark Rowe <mrowe@apple.com>
25578
25579 Fix the 64-bit build.
25580
25581 Disable strict aliasing in ProfilerServer.mm as it leads to the compiler being unhappy
25582 with the common Obj-C idiom self = [super init];
25583
25584 * JavaScriptCore.xcodeproj/project.pbxproj:
25585
25586 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25587
25588 Reviewed by Alexey Proskuryakov.
25589
25590 Change a header guard to match our coding style.
25591
25592 * kjs/InitializeThreading.h:
25593
25594 2008-10-30 Geoffrey Garen <ggaren@apple.com>
25595
25596 Reviewed by Oliver Hunt.
25597
25598 Fixed a small bit of https://bugs.webkit.org/show_bug.cgi?id=21962
25599 AST uses way too much memory
25600
25601 Removed a word from StatementNode by nixing LabelStack and turning it
25602 into a compile-time data structure managed by CodeGenerator.
25603
25604 v8 tests and SunSpider, run by Gavin, report no change.
25605
25606 * GNUmakefile.am:
25607 * JavaScriptCore.order:
25608 * JavaScriptCore.pri:
25609 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25610 * JavaScriptCore.xcodeproj/project.pbxproj:
25611 * kjs/AllInOneFile.cpp:
25612 * JavaScriptCoreSources.bkl: I sure hope this builds!
25613
25614 * VM/CodeGenerator.cpp:
25615 (JSC::CodeGenerator::CodeGenerator):
25616 (JSC::CodeGenerator::newLabelScope):
25617 (JSC::CodeGenerator::breakTarget):
25618 (JSC::CodeGenerator::continueTarget):
25619 * VM/CodeGenerator.h: Nixed the JumpContext system because it depended
25620 on a LabelStack in the AST, and it was a little cumbersome on the client
25621 side. Replaced with LabelScope, which tracks all break / continue
25622 information in the CodeGenerator, just like we track LabelIDs and other
25623 stacks of compile-time data.
25624
25625 * kjs/LabelScope.h: Added.
25626 (JSC::LabelScope::):
25627 (JSC::LabelScope::LabelScope):
25628 (JSC::LabelScope::ref):
25629 (JSC::LabelScope::deref):
25630 (JSC::LabelScope::refCount):
25631 (JSC::LabelScope::breakTarget):
25632 (JSC::LabelScope::continueTarget):
25633 (JSC::LabelScope::type):
25634 (JSC::LabelScope::name):
25635 (JSC::LabelScope::scopeDepth): Simple abstraction for holding everything
25636 you might want to know about a break-able / continue-able scope.
25637
25638 * kjs/LabelStack.cpp: Removed.
25639 * kjs/LabelStack.h: Removed.
25640
25641 * kjs/grammar.y: No need to push labels at parse time -- we don't store
25642 LabelStacks in the AST anymore.
25643
25644 * kjs/nodes.cpp:
25645 (JSC::DoWhileNode::emitCode):
25646 (JSC::WhileNode::emitCode):
25647 (JSC::ForNode::emitCode):
25648 (JSC::ForInNode::emitCode):
25649 (JSC::ContinueNode::emitCode):
25650 (JSC::BreakNode::emitCode):
25651 (JSC::SwitchNode::emitCode):
25652 (JSC::LabelNode::emitCode):
25653 * kjs/nodes.h:
25654 (JSC::StatementNode::):
25655 (JSC::LabelNode::): Use LabelScope where we used to use JumpContext.
25656 Simplified a bunch of code. Touched up label-related error messages a
25657 bit.
25658
25659 * kjs/nodes2string.cpp:
25660 (JSC::LabelNode::streamTo): Updated for rename.
25661
25662 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25663
25664 Reviewed by Darin Adler.
25665
25666 Bug 22005: Move StructureIDChain into its own file
25667 <https://bugs.webkit.org/show_bug.cgi?id=22005>
25668
25669 * GNUmakefile.am:
25670 * JavaScriptCore.pri:
25671 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25672 * JavaScriptCore.xcodeproj/project.pbxproj:
25673 * JavaScriptCoreSources.bkl:
25674 * runtime/StructureID.cpp:
25675 * runtime/StructureID.h:
25676 * runtime/StructureIDChain.cpp: Copied from runtime/StructureID.cpp.
25677 * runtime/StructureIDChain.h: Copied from runtime/StructureID.h.
25678
25679 2008-10-31 Steve Falkenburg <sfalken@apple.com>
25680
25681 Build fix.
25682
25683 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
25684
25685 2008-10-31 Steve Falkenburg <sfalken@apple.com>
25686
25687 Build fix.
25688
25689 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25690
25691 2008-10-31 Darin Adler <darin@apple.com>
25692
25693 Reviewed by Dan Bernstein.
25694
25695 - fix storage leak seen on buildbot
25696
25697 Some other cleanup too. The storage leak was caused by the fact
25698 that HashTraits<CallIdentifier>::needsDestruction was false, so
25699 the call identifier objects didn't get deleted.
25700
25701 * profiler/CallIdentifier.h:
25702
25703 Added a default constructor to create empty call identifiers.
25704
25705 Changed the normal constructor to use const UString&
25706 to avoid extra copying and reference count thrash.
25707
25708 Removed the explicit copy constructor definition, since it's what
25709 the compiler will automatically generate. (Rule of thumb: Either
25710 you need both a custom copy constructor and a custom assignment
25711 operator, or neither.)
25712
25713 Moved the CallIdentifier hash function out of the WTF namespace;
25714 there's no reason to put it there.
25715
25716 Changed the CallIdentifier hash function to be a struct rather than
25717 a specialization of the IntHash struct template. Having it be
25718 a specialization made no sense, since CallIdentifier is not an integer,
25719 and did no good.
25720
25721 Removed explicit definition of emptyValueIsZero in the hash traits,
25722 since inheriting from GenericHashTraits already makes that false.
25723
25724 Removed explicit definition of emptyValue, instead relying on the
25725 default constructor and GenericHashTraits.
25726
25727 Removed explicit definition of needsDestruction, because we want it
25728 to have its default value: true, not false. This fixes the leak!
25729
25730 Changed constructDeletedValue and isDeletedValue to use a line number
25731 of numeric_limits<unsigned>::max() to indicate a value is deleted.
25732 Previously this used empty strings for the empty value and null strings
25733 for the deleted value, but it's more efficient to use null for both.
25734
25735 2008-10-31 Timothy Hatcher <timothy@apple.com>
25736
25737 Emit the WillExecuteStatement debugger hook before the for loop body
25738 when the statement node for the body isn't a block. This allows
25739 breakpoints on those statements in the Web Inspector.
25740
25741 https://bugs.webkit.org/show_bug.cgi?id=22004
25742
25743 Reviewed by Darin Adler.
25744
25745 * kjs/nodes.cpp:
25746 (JSC::ForNode::emitCode): Emit the WillExecuteStatement
25747 debugger hook before the statement node if isn't a block.
25748 Also emit the WillExecuteStatement debugger hook for the
25749 loop as the first op-code.
25750 (JSC::ForInNode::emitCode): Ditto.
25751
25752 2008-10-31 Timothy Hatcher <timothy@apple.com>
25753
25754 Fixes console warnings about not having an autorelease pool.
25755 Also fixes the build for Snow Leopard, by including individual
25756 Foundation headers instead of Foundation.h.
25757
25758 https://bugs.webkit.org/show_bug.cgi?id=21995
25759
25760 Reviewed by Oliver Hunt.
25761
25762 * profiler/ProfilerServer.mm:
25763 (-[ProfilerServer init]): Create a NSAutoreleasePool and drain it.
25764
25765 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25766
25767 Not reviewed.
25768
25769 Speculative wxWindows build fix.
25770
25771 * JavaScriptCoreSources.bkl:
25772 * jscore.bkl:
25773
25774 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25775
25776 Rubber-stamped by Maciej Stachowiak.
25777
25778 Move VM/JSPropertyNameIterator.cpp and VM/JSPropertyNameIterator.h to
25779 the runtime directory.
25780
25781 * GNUmakefile.am:
25782 * JavaScriptCore.pri:
25783 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25784 * JavaScriptCore.xcodeproj/project.pbxproj:
25785 * JavaScriptCoreSources.bkl:
25786 * VM/JSPropertyNameIterator.cpp: Removed.
25787 * VM/JSPropertyNameIterator.h: Removed.
25788 * runtime/JSPropertyNameIterator.cpp: Copied from VM/JSPropertyNameIterator.cpp.
25789 * runtime/JSPropertyNameIterator.h: Copied from VM/JSPropertyNameIterator.h.
25790
25791 2008-10-31 Cameron Zwarich <zwarich@apple.com>
25792
25793 Not reviewed.
25794
25795 Speculative wxWindows build fix.
25796
25797 * jscore.bkl:
25798
25799 2008-10-30 Mark Rowe <mrowe@apple.com>
25800
25801 Reviewed by Jon Homeycutt.
25802
25803 Explicitly default to building for only the native architecture in debug and release builds.
25804
25805 * Configurations/DebugRelease.xcconfig:
25806
25807 2008-10-30 Cameron Zwarich <zwarich@apple.com>
25808
25809 Rubber-stamped by Sam Weinig.
25810
25811 Create a debugger directory in JavaScriptCore and move the relevant
25812 files to it.
25813
25814 * GNUmakefile.am:
25815 * JavaScriptCore.pri:
25816 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25817 * JavaScriptCore.xcodeproj/project.pbxproj:
25818 * VM/CodeBlock.cpp:
25819 * VM/CodeGenerator.h:
25820 * VM/Machine.cpp:
25821 * debugger: Added.
25822 * debugger/Debugger.cpp: Copied from kjs/debugger.cpp.
25823 * debugger/Debugger.h: Copied from kjs/debugger.h.
25824 * debugger/DebuggerCallFrame.cpp: Copied from kjs/DebuggerCallFrame.cpp.
25825 * debugger/DebuggerCallFrame.h: Copied from kjs/DebuggerCallFrame.h.
25826 * kjs/AllInOneFile.cpp:
25827 * kjs/DebuggerCallFrame.cpp: Removed.
25828 * kjs/DebuggerCallFrame.h: Removed.
25829 * kjs/Parser.cpp:
25830 * kjs/Parser.h:
25831 * kjs/debugger.cpp: Removed.
25832 * kjs/debugger.h: Removed.
25833 * kjs/interpreter.cpp:
25834 * kjs/nodes.cpp:
25835 * runtime/FunctionConstructor.cpp:
25836 * runtime/JSGlobalObject.cpp:
25837
25838 2008-10-30 Benjamin K. Stuhl <bks24@cornell.edu>
25839
25840 gcc 4.3.3/linux-x86 generates "suggest parentheses around && within ||"
25841 warnings; add some parentheses to disambiguate things. No functional
25842 changes, so no tests.
25843
25844 https://bugs.webkit.org/show_bug.cgi?id=21973
25845 Add parentheses to clean up some gcc warnings
25846
25847 Reviewed by Dan Bernstein.
25848
25849 * wtf/ASCIICType.h:
25850 (WTF::isASCIIAlphanumeric):
25851 (WTF::isASCIIHexDigit):
25852
25853 2008-10-30 Kevin Lindeman <klindeman@apple.com>
25854
25855 Adds ProfilerServer, which is a distributed notification listener
25856 that allows starting and stopping the profiler remotely for use
25857 in conjunction with the profiler's DTace probes.
25858
25859 https://bugs.webkit.org/show_bug.cgi?id=21719
25860
25861 Reviewed by Timothy Hatcher.
25862
25863 * JavaScriptCore.xcodeproj/project.pbxproj:
25864 * kjs/JSGlobalData.cpp:
25865 (JSC::JSGlobalData::JSGlobalData): Calls startProfilerServerIfNeeded.
25866 * profiler/ProfilerServer.h: Added.
25867 * profiler/ProfilerServer.mm: Added.
25868 (+[ProfilerServer sharedProfileServer]):
25869 (-[ProfilerServer init]):
25870 (-[ProfilerServer startProfiling]):
25871 (-[ProfilerServer stopProfiling]):
25872 (JSC::startProfilerServerIfNeeded):
25873
25874 2008-10-30 Kevin Ollivier <kevino@theolliviers.com>
25875
25876 wx build fix after PropertyMap and StructureID merge.
25877
25878 * JavaScriptCoreSources.bkl:
25879
25880 2008-10-30 Cameron Zwarich <zwarich@apple.com>
25881
25882 Reviewed by Mark Rowe.
25883
25884 Change the JavaScriptCore Xcode project to use relative paths for the
25885 PCRE source files.
25886
25887 * JavaScriptCore.xcodeproj/project.pbxproj:
25888
25889 2008-10-30 Sam Weinig <sam@webkit.org>
25890
25891 Reviewed by Cameron Zwarich and Geoffrey Garen.
25892
25893 Fix for https://bugs.webkit.org/show_bug.cgi?id=21989
25894 Merge PropertyMap and StructureID
25895
25896 - Move PropertyMap code into StructureID in preparation for lazily
25897 creating the map on gets.
25898 - Make remove with transition explicit by adding removePropertyTransition.
25899 - Make the put/remove without transition explicit.
25900 - Make cache invalidation part of put/remove without transition.
25901
25902 1% speedup on SunSpider; 0.5% speedup on v8 suite.
25903
25904 * GNUmakefile.am:
25905 * JavaScriptCore.exp:
25906 * JavaScriptCore.pri:
25907 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
25908 * JavaScriptCore.xcodeproj/project.pbxproj:
25909 * JavaScriptCoreSources.bkl:
25910 * kjs/AllInOneFile.cpp:
25911 * kjs/identifier.h:
25912 * runtime/JSObject.cpp:
25913 (JSC::JSObject::removeDirect):
25914 * runtime/JSObject.h:
25915 (JSC::JSObject::putDirect):
25916 * runtime/PropertyMap.cpp: Removed.
25917 * runtime/PropertyMap.h: Removed.
25918 * runtime/PropertyMapHashTable.h: Copied from runtime/PropertyMap.h.
25919 * runtime/StructureID.cpp:
25920 (JSC::StructureID::dumpStatistics):
25921 (JSC::StructureID::StructureID):
25922 (JSC::StructureID::~StructureID):
25923 (JSC::StructureID::getEnumerablePropertyNames):
25924 (JSC::StructureID::addPropertyTransition):
25925 (JSC::StructureID::removePropertyTransition):
25926 (JSC::StructureID::toDictionaryTransition):
25927 (JSC::StructureID::changePrototypeTransition):
25928 (JSC::StructureID::getterSetterTransition):
25929 (JSC::StructureID::addPropertyWithoutTransition):
25930 (JSC::StructureID::removePropertyWithoutTransition):
25931 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
25932 (JSC::StructureID::checkConsistency):
25933 (JSC::StructureID::copyPropertyTable):
25934 (JSC::StructureID::get):
25935 (JSC::StructureID::put):
25936 (JSC::StructureID::remove):
25937 (JSC::StructureID::insertIntoPropertyMapHashTable):
25938 (JSC::StructureID::expandPropertyMapHashTable):
25939 (JSC::StructureID::createPropertyMapHashTable):
25940 (JSC::StructureID::rehashPropertyMapHashTable):
25941 (JSC::comparePropertyMapEntryIndices):
25942 (JSC::StructureID::getEnumerablePropertyNamesInternal):
25943 * runtime/StructureID.h:
25944 (JSC::StructureID::propertyStorageSize):
25945 (JSC::StructureID::isEmpty):
25946 (JSC::StructureID::get):
25947
25948 2008-10-30 Cameron Zwarich <zwarich@apple.com>
25949
25950 Reviewed by Oliver Hunt.
25951
25952 Bug 21987: CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result register
25953 <https://bugs.webkit.org/show_bug.cgi?id=21987>
25954
25955 CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result
25956 register as ecx, but it should be tempReg1, which is ecx at all of its
25957 callsites.
25958
25959 * VM/CTI.cpp:
25960 (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
25961
25962 2008-10-30 Cameron Zwarich <zwarich@apple.com>
25963
25964 Reviewed by Sam Weinig.
25965
25966 Bug 21985: Opcodes should use eax as their destination register whenever possible
25967 <https://bugs.webkit.org/show_bug.cgi?id=21985>
25968
25969 Change more opcodes to use eax as the register for their final result,
25970 and change calls to emitPutResult() that pass eax to rely on the default
25971 value of eax.
25972
25973 * VM/CTI.cpp:
25974 (JSC::CTI::privateCompileMainPass):
25975
25976 2008-10-30 Alp Toker <alp@nuanti.com>
25977
25978 Build fix attempt for older gcc on the trunk-mac-intel build bot
25979 (error: initializer for scalar variable requires one element).
25980
25981 Modify the initializer syntax slightly with an additional comma.
25982
25983 * VM/Machine.cpp:
25984 (JSC::Machine::cti_op_call_JSFunction):
25985 (JSC::Machine::cti_op_construct_JSConstruct):
25986 (JSC::Machine::cti_op_resolve_func):
25987 (JSC::Machine::cti_op_post_inc):
25988 (JSC::Machine::cti_op_resolve_with_base):
25989 (JSC::Machine::cti_op_post_dec):
25990
25991 2008-10-30 Alp Toker <alp@nuanti.com>
25992
25993 Reviewed by Alexey Proskuryakov.
25994
25995 https://bugs.webkit.org/show_bug.cgi?id=21571
25996 VoidPtrPair breaks CTI on Linux
25997
25998 The VoidPtrPair return change made in r37457 does not work on Linux
25999 since POD structs aren't passed in registers.
26000
26001 This patch uses a union to vectorize VoidPtrPair to a uint64_t and
26002 matches Darwin/MSVC fixing CTI/WREC on Linux.
26003
26004 Alexey reports no measurable change in Mac performance with this fix.
26005
26006 * VM/Machine.cpp:
26007 (JSC::Machine::cti_op_call_JSFunction):
26008 (JSC::Machine::cti_op_construct_JSConstruct):
26009 (JSC::Machine::cti_op_resolve_func):
26010 (JSC::Machine::cti_op_post_inc):
26011 (JSC::Machine::cti_op_resolve_with_base):
26012 (JSC::Machine::cti_op_post_dec):
26013 * VM/Machine.h:
26014 (JSC::):
26015
26016 2008-10-29 Oliver Hunt <oliver@apple.com>
26017
26018 Reviewed by Geoff Garen.
26019
26020 Initial work to reduce cost of JSNumberCell allocation
26021
26022 This does the initial work needed to bring more of number
26023 allocation into CTI code directly, rather than just falling
26024 back onto the slow paths if we can't guarantee that a number
26025 cell can be reused.
26026
26027 Initial implementation only used by op_negate to make sure
26028 it all works. In a negate heavy (though not dominated) test
26029 it results in a 10% win in the non-reusable cell case.
26030
26031 * VM/CTI.cpp:
26032 (JSC::):
26033 (JSC::CTI::emitAllocateNumber):
26034 (JSC::CTI::emitNakedFastCall):
26035 (JSC::CTI::emitArithIntToImmWithJump):
26036 (JSC::CTI::privateCompileMainPass):
26037 (JSC::CTI::privateCompileSlowCases):
26038 * VM/CTI.h:
26039 * VM/CodeBlock.cpp:
26040 (JSC::CodeBlock::dump):
26041 * VM/CodeGenerator.cpp:
26042 (JSC::CodeGenerator::emitUnaryOp):
26043 * VM/CodeGenerator.h:
26044 (JSC::CodeGenerator::emitToJSNumber):
26045 (JSC::CodeGenerator::emitTypeOf):
26046 (JSC::CodeGenerator::emitGetPropertyNames):
26047 * VM/Machine.cpp:
26048 (JSC::Machine::privateExecute):
26049 * VM/Machine.h:
26050 * kjs/ResultType.h:
26051 (JSC::ResultType::isReusableNumber):
26052 (JSC::ResultType::toInt):
26053 * kjs/nodes.cpp:
26054 (JSC::UnaryOpNode::emitCode):
26055 (JSC::BinaryOpNode::emitCode):
26056 (JSC::EqualNode::emitCode):
26057 * masm/X86Assembler.h:
26058 (JSC::X86Assembler::):
26059 (JSC::X86Assembler::negl_r):
26060 (JSC::X86Assembler::xorpd_mr):
26061 * runtime/JSNumberCell.h:
26062 (JSC::JSNumberCell::JSNumberCell):
26063
26064 2008-10-29 Steve Falkenburg <sfalken@apple.com>
26065
26066 <rdar://problem/6326563> Crash on launch
26067
26068 For Windows, export explicit functions rather than exporting data for atomicallyInitializedStaticMutex.
26069
26070 Exporting data from a DLL on Windows requires specifying __declspec(dllimport) in the header used by
26071 callers, but __declspec(dllexport) when defined in the DLL implementation. By instead exporting
26072 the explicit lock/unlock functions, we can avoid this.
26073
26074 Fixes a crash on launch, since we were previously erroneously exporting atomicallyInitializedStaticMutex as a function.
26075
26076 Reviewed by Darin Adler.
26077
26078 * wtf/Threading.h:
26079 (WTF::lockAtomicallyInitializedStaticMutex):
26080 (WTF::unlockAtomicallyInitializedStaticMutex):
26081 * wtf/ThreadingWin.cpp:
26082 (WTF::lockAtomicallyInitializedStaticMutex):
26083 (WTF::unlockAtomicallyInitializedStaticMutex):
26084
26085 2008-10-29 Sam Weinig <sam@webkit.org>
26086
26087 Reviewed by Oliver Hunt.
26088
26089 Remove direct use of PropertyMap.
26090
26091 * JavaScriptCore.exp:
26092 * runtime/JSObject.cpp:
26093 (JSC::JSObject::mark):
26094 (JSC::JSObject::put):
26095 (JSC::JSObject::deleteProperty):
26096 (JSC::JSObject::getPropertyAttributes):
26097 (JSC::JSObject::removeDirect):
26098 * runtime/JSObject.h:
26099 (JSC::JSObject::getDirect):
26100 (JSC::JSObject::getDirectLocation):
26101 (JSC::JSObject::hasCustomProperties):
26102 (JSC::JSObject::JSObject):
26103 (JSC::JSObject::putDirect):
26104 * runtime/PropertyMap.cpp:
26105 (JSC::PropertyMap::get):
26106 * runtime/PropertyMap.h:
26107 (JSC::PropertyMap::isEmpty):
26108 (JSC::PropertyMap::get):
26109 * runtime/StructureID.cpp:
26110 (JSC::StructureID::dumpStatistics):
26111 * runtime/StructureID.h:
26112 (JSC::StructureID::propertyStorageSize):
26113 (JSC::StructureID::get):
26114 (JSC::StructureID::put):
26115 (JSC::StructureID::remove):
26116 (JSC::StructureID::isEmpty):
26117
26118 2008-10-29 Sam Weinig <sam@webkit.org>
26119
26120 Reviewed by Geoffrey Garen.
26121
26122 Rename and move the StructureID transition table to its own file.
26123
26124 * GNUmakefile.am:
26125 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26126 * JavaScriptCore.xcodeproj/project.pbxproj:
26127 * runtime/StructureID.cpp:
26128 (JSC::StructureID::addPropertyTransition):
26129 * runtime/StructureID.h:
26130 (JSC::StructureID::):
26131 * runtime/StructureIDTransitionTable.h: Copied from runtime/StructureID.h.
26132 (JSC::StructureIDTransitionTableHash::hash):
26133 (JSC::StructureIDTransitionTableHash::equal):
26134
26135 2008-10-29 Sam Weinig <sam@webkit.org>
26136
26137 Reviewed by Cameron Zwarich.
26138
26139 Fix for https://bugs.webkit.org/show_bug.cgi?id=21958
26140 Pack bits in StructureID to reduce the size of each StructureID by 2 words.
26141
26142 * runtime/PropertyMap.h:
26143 (JSC::PropertyMap::propertyMapSize):
26144 * runtime/StructureID.cpp:
26145 (JSC::StructureID::dumpStatistics): Add additional size statistics when dumping.
26146 (JSC::StructureID::StructureID):
26147 * runtime/StructureID.h:
26148
26149 2008-10-29 Kevin Ollivier <kevino@theolliviers.com>
26150
26151 wx build fixes after addition of runtime and ImageBuffer changes.
26152
26153 * JavaScriptCoreSources.bkl:
26154 * jscore.bkl:
26155
26156 2008-10-29 Timothy Hatcher <timothy@apple.com>
26157
26158 Emit the WillExecuteStatement debugger hook before the "else" body
26159 when there is no block for the "else" body. This allows breakpoints
26160 on those statements in the Web Inspector.
26161
26162 https://bugs.webkit.org/show_bug.cgi?id=21944
26163
26164 Reviewed by Maciej Stachowiak.
26165
26166 * kjs/nodes.cpp:
26167 (JSC::IfElseNode::emitCode): Emit the WillExecuteStatement
26168 debugger hook before the else node if isn't a block.
26169
26170 2008-10-29 Alexey Proskuryakov <ap@webkit.org>
26171
26172 Build fix.
26173
26174 * JavaScriptCore.exp: Export HashTable::deleteTable().
26175
26176 2008-10-28 Alp Toker <alp@nuanti.com>
26177
26178 Fix builddir != srcdir builds after kjs -> runtime breakage. Sources
26179 may now be generated in both kjs/ and runtime/.
26180
26181 Also sort the sources list for readability.
26182
26183 * GNUmakefile.am:
26184
26185 2008-10-28 Alp Toker <alp@nuanti.com>
26186
26187 Reviewed by Cameron Zwarich.
26188
26189 Build fix attempt after kjs -> runtime rename.
26190
26191 * GNUmakefile.am:
26192
26193 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26194
26195 Not reviewed.
26196
26197 Remove a duplicate includes directory.
26198
26199 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26200
26201 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26202
26203 Not reviewed.
26204
26205 Attempt to fix the Windows build.
26206
26207 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26208 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
26209
26210 2008-10-28 Dan Bernstein <mitz@apple.com>
26211
26212 Reviewed by Mark Rowe.
26213
26214 - export WTF::atomicallyInitializedStaticMutex
26215
26216 * JavaScriptCore.exp:
26217
26218 2008-10-28 Geoffrey Garen <ggaren@apple.com>
26219
26220 Reviewed by Cameron Zwarich.
26221
26222 Fixed CodeBlock dumping to accurately report constant register indices.
26223
26224 * VM/CodeBlock.cpp:
26225 (JSC::CodeBlock::dump):
26226
26227 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26228
26229 Not reviewed.
26230
26231 More Qt build fixes.
26232
26233 * JavaScriptCore.pri:
26234
26235 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26236
26237 Not reviewed.
26238
26239 Fix the Qt build, hopefully for real this time.
26240
26241 * JavaScriptCore.pri:
26242
26243 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26244
26245 Not reviewed.
26246
26247 Fix the Qt build.
26248
26249 * JavaScriptCore.pri:
26250
26251 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26252
26253 Not reviewed.
26254
26255 Fix the Windows build.
26256
26257 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26258
26259 2008-10-28 Cameron Zwarich <zwarich@apple.com>
26260
26261 Rubber-stamped by Sam Weinig.
26262
26263 Create a runtime directory in JavaScriptCore and begin moving files to
26264 it. This is the first step towards removing the kjs directory and
26265 placing files in more meaningful subdirectories of JavaScriptCore.
26266
26267 * API/JSBase.cpp:
26268 * API/JSCallbackConstructor.cpp:
26269 * API/JSCallbackConstructor.h:
26270 * API/JSCallbackFunction.cpp:
26271 * API/JSClassRef.cpp:
26272 * API/JSClassRef.h:
26273 * API/JSStringRefCF.cpp:
26274 * API/JSValueRef.cpp:
26275 * API/OpaqueJSString.cpp:
26276 * DerivedSources.make:
26277 * GNUmakefile.am:
26278 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
26279 * JavaScriptCore.xcodeproj/project.pbxproj:
26280 * kjs/AllInOneFile.cpp:
26281 * kjs/ArrayConstructor.cpp: Removed.
26282 * kjs/ArrayConstructor.h: Removed.
26283 * kjs/ArrayPrototype.cpp: Removed.
26284 * kjs/ArrayPrototype.h: Removed.
26285 * kjs/BooleanConstructor.cpp: Removed.
26286 * kjs/BooleanConstructor.h: Removed.
26287 * kjs/BooleanObject.cpp: Removed.
26288 * kjs/BooleanObject.h: Removed.
26289 * kjs/BooleanPrototype.cpp: Removed.
26290 * kjs/BooleanPrototype.h: Removed.
26291 * kjs/CallData.cpp: Removed.
26292 * kjs/CallData.h: Removed.
26293 * kjs/ClassInfo.h: Removed.
26294 * kjs/ConstructData.cpp: Removed.
26295 * kjs/ConstructData.h: Removed.
26296 * kjs/DateConstructor.cpp: Removed.
26297 * kjs/DateConstructor.h: Removed.
26298 * kjs/DateInstance.cpp: Removed.
26299 * kjs/DateInstance.h: Removed.
26300 * kjs/DateMath.cpp: Removed.
26301 * kjs/DateMath.h: Removed.
26302 * kjs/DatePrototype.cpp: Removed.
26303 * kjs/DatePrototype.h: Removed.
26304 * kjs/Error.cpp: Removed.
26305 * kjs/Error.h: Removed.
26306 * kjs/ErrorConstructor.cpp: Removed.
26307 * kjs/ErrorConstructor.h: Removed.
26308 * kjs/ErrorInstance.cpp: Removed.
26309 * kjs/ErrorInstance.h: Removed.
26310 * kjs/ErrorPrototype.cpp: Removed.
26311 * kjs/ErrorPrototype.h: Removed.
26312 * kjs/FunctionConstructor.cpp: Removed.
26313 * kjs/FunctionConstructor.h: Removed.
26314 * kjs/FunctionPrototype.cpp: Removed.
26315 * kjs/FunctionPrototype.h: Removed.
26316 * kjs/GlobalEvalFunction.cpp: Removed.
26317 * kjs/GlobalEvalFunction.h: Removed.
26318 * kjs/InternalFunction.cpp: Removed.
26319 * kjs/InternalFunction.h: Removed.
26320 * kjs/JSArray.cpp: Removed.
26321 * kjs/JSArray.h: Removed.
26322 * kjs/JSCell.cpp: Removed.
26323 * kjs/JSCell.h: Removed.
26324 * kjs/JSFunction.cpp: Removed.
26325 * kjs/JSFunction.h: Removed.
26326 * kjs/JSGlobalObject.cpp: Removed.
26327 * kjs/JSGlobalObject.h: Removed.
26328 * kjs/JSGlobalObjectFunctions.cpp: Removed.
26329 * kjs/JSGlobalObjectFunctions.h: Removed.
26330 * kjs/JSImmediate.cpp: Removed.
26331 * kjs/JSImmediate.h: Removed.
26332 * kjs/JSNotAnObject.cpp: Removed.
26333 * kjs/JSNotAnObject.h: Removed.
26334 * kjs/JSNumberCell.cpp: Removed.
26335 * kjs/JSNumberCell.h: Removed.
26336 * kjs/JSObject.cpp: Removed.
26337 * kjs/JSObject.h: Removed.
26338 * kjs/JSString.cpp: Removed.
26339 * kjs/JSString.h: Removed.
26340 * kjs/JSValue.cpp: Removed.
26341 * kjs/JSValue.h: Removed.
26342 * kjs/JSVariableObject.cpp: Removed.
26343 * kjs/JSVariableObject.h: Removed.
26344 * kjs/JSWrapperObject.cpp: Removed.
26345 * kjs/JSWrapperObject.h: Removed.
26346 * kjs/MathObject.cpp: Removed.
26347 * kjs/MathObject.h: Removed.
26348 * kjs/NativeErrorConstructor.cpp: Removed.
26349 * kjs/NativeErrorConstructor.h: Removed.
26350 * kjs/NativeErrorPrototype.cpp: Removed.
26351 * kjs/NativeErrorPrototype.h: Removed.
26352 * kjs/NumberConstructor.cpp: Removed.
26353 * kjs/NumberConstructor.h: Removed.
26354 * kjs/NumberObject.cpp: Removed.
26355 * kjs/NumberObject.h: Removed.
26356 * kjs/NumberPrototype.cpp: Removed.
26357 * kjs/NumberPrototype.h: Removed.
26358 * kjs/ObjectConstructor.cpp: Removed.
26359 * kjs/ObjectConstructor.h: Removed.
26360 * kjs/ObjectPrototype.cpp: Removed.
26361 * kjs/ObjectPrototype.h: Removed.
26362 * kjs/PropertyMap.cpp: Removed.
26363 * kjs/PropertyMap.h: Removed.
26364 * kjs/PropertySlot.cpp: Removed.
26365 * kjs/PropertySlot.h: Removed.
26366 * kjs/PrototypeFunction.cpp: Removed.
26367 * kjs/PrototypeFunction.h: Removed.
26368 * kjs/PutPropertySlot.h: Removed.
26369 * kjs/SmallStrings.cpp: Removed.
26370 * kjs/SmallStrings.h: Removed.
26371 * kjs/StringConstructor.cpp: Removed.
26372 * kjs/StringConstructor.h: Removed.
26373 * kjs/StringObject.cpp: Removed.
26374 * kjs/StringObject.h: Removed.
26375 * kjs/StringObjectThatMasqueradesAsUndefined.h: Removed.
26376 * kjs/StringPrototype.cpp: Removed.
26377 * kjs/StringPrototype.h: Removed.
26378 * kjs/StructureID.cpp: Removed.
26379 * kjs/StructureID.h: Removed.
26380 * kjs/completion.h:
26381 * kjs/interpreter.h:
26382 * runtime: Added.
26383 * runtime/ArrayConstructor.cpp: Copied from kjs/ArrayConstructor.cpp.
26384 * runtime/ArrayConstructor.h: Copied from kjs/ArrayConstructor.h.
26385 * runtime/ArrayPrototype.cpp: Copied from kjs/ArrayPrototype.cpp.
26386 * runtime/ArrayPrototype.h: Copied from kjs/ArrayPrototype.h.
26387 * runtime/BooleanConstructor.cpp: Copied from kjs/BooleanConstructor.cpp.
26388 * runtime/BooleanConstructor.h: Copied from kjs/BooleanConstructor.h.
26389 * runtime/BooleanObject.cpp: Copied from kjs/BooleanObject.cpp.
26390 * runtime/BooleanObject.h: Copied from kjs/BooleanObject.h.
26391 * runtime/BooleanPrototype.cpp: Copied from kjs/BooleanPrototype.cpp.
26392 * runtime/BooleanPrototype.h: Copied from kjs/BooleanPrototype.h.
26393 * runtime/CallData.cpp: Copied from kjs/CallData.cpp.
26394 * runtime/CallData.h: Copied from kjs/CallData.h.
26395 * runtime/ClassInfo.h: Copied from kjs/ClassInfo.h.
26396 * runtime/ConstructData.cpp: Copied from kjs/ConstructData.cpp.
26397 * runtime/ConstructData.h: Copied from kjs/ConstructData.h.
26398 * runtime/DateConstructor.cpp: Copied from kjs/DateConstructor.cpp.
26399 * runtime/DateConstructor.h: Copied from kjs/DateConstructor.h.
26400 * runtime/DateInstance.cpp: Copied from kjs/DateInstance.cpp.
26401 * runtime/DateInstance.h: Copied from kjs/DateInstance.h.
26402 * runtime/DateMath.cpp: Copied from kjs/DateMath.cpp.
26403 * runtime/DateMath.h: Copied from kjs/DateMath.h.
26404 * runtime/DatePrototype.cpp: Copied from kjs/DatePrototype.cpp.
26405 * runtime/DatePrototype.h: Copied from kjs/DatePrototype.h.
26406 * runtime/Error.cpp: Copied from kjs/Error.cpp.
26407 * runtime/Error.h: Copied from kjs/Error.h.
26408 * runtime/ErrorConstructor.cpp: Copied from kjs/ErrorConstructor.cpp.
26409 * runtime/ErrorConstructor.h: Copied from kjs/ErrorConstructor.h.
26410 * runtime/ErrorInstance.cpp: Copied from kjs/ErrorInstance.cpp.
26411 * runtime/ErrorInstance.h: Copied from kjs/ErrorInstance.h.
26412 * runtime/ErrorPrototype.cpp: Copied from kjs/ErrorPrototype.cpp.
26413 * runtime/ErrorPrototype.h: Copied from kjs/ErrorPrototype.h.
26414 * runtime/FunctionConstructor.cpp: Copied from kjs/FunctionConstructor.cpp.
26415 * runtime/FunctionConstructor.h: Copied from kjs/FunctionConstructor.h.
26416 * runtime/FunctionPrototype.cpp: Copied from kjs/FunctionPrototype.cpp.
26417 * runtime/FunctionPrototype.h: Copied from kjs/FunctionPrototype.h.
26418 * runtime/GlobalEvalFunction.cpp: Copied from kjs/GlobalEvalFunction.cpp.
26419 * runtime/GlobalEvalFunction.h: Copied from kjs/GlobalEvalFunction.h.
26420 * runtime/InternalFunction.cpp: Copied from kjs/InternalFunction.cpp.
26421 * runtime/InternalFunction.h: Copied from kjs/InternalFunction.h.
26422 * runtime/JSArray.cpp: Copied from kjs/JSArray.cpp.
26423 * runtime/JSArray.h: Copied from kjs/JSArray.h.
26424 * runtime/JSCell.cpp: Copied from kjs/JSCell.cpp.
26425 * runtime/JSCell.h: Copied from kjs/JSCell.h.
26426 * runtime/JSFunction.cpp: Copied from kjs/JSFunction.cpp.
26427 * runtime/JSFunction.h: Copied from kjs/JSFunction.h.
26428 * runtime/JSGlobalObject.cpp: Copied from kjs/JSGlobalObject.cpp.
26429 * runtime/JSGlobalObject.h: Copied from kjs/JSGlobalObject.h.
26430 * runtime/JSGlobalObjectFunctions.cpp: Copied from kjs/JSGlobalObjectFunctions.cpp.
26431 * runtime/JSGlobalObjectFunctions.h: Copied from kjs/JSGlobalObjectFunctions.h.
26432 * runtime/JSImmediate.cpp: Copied from kjs/JSImmediate.cpp.
26433 * runtime/JSImmediate.h: Copied from kjs/JSImmediate.h.
26434 * runtime/JSNotAnObject.cpp: Copied from kjs/JSNotAnObject.cpp.
26435 * runtime/JSNotAnObject.h: Copied from kjs/JSNotAnObject.h.
26436 * runtime/JSNumberCell.cpp: Copied from kjs/JSNumberCell.cpp.
26437 * runtime/JSNumberCell.h: Copied from kjs/JSNumberCell.h.
26438 * runtime/JSObject.cpp: Copied from kjs/JSObject.cpp.
26439 * runtime/JSObject.h: Copied from kjs/JSObject.h.
26440 * runtime/JSString.cpp: Copied from kjs/JSString.cpp.
26441 * runtime/JSString.h: Copied from kjs/JSString.h.
26442 * runtime/JSValue.cpp: Copied from kjs/JSValue.cpp.
26443 * runtime/JSValue.h: Copied from kjs/JSValue.h.
26444 * runtime/JSVariableObject.cpp: Copied from kjs/JSVariableObject.cpp.
26445 * runtime/JSVariableObject.h: Copied from kjs/JSVariableObject.h.
26446 * runtime/JSWrapperObject.cpp: Copied from kjs/JSWrapperObject.cpp.
26447 * runtime/JSWrapperObject.h: Copied from kjs/JSWrapperObject.h.
26448 * runtime/MathObject.cpp: Copied from kjs/MathObject.cpp.
26449 * runtime/MathObject.h: Copied from kjs/MathObject.h.
26450 * runtime/NativeErrorConstructor.cpp: Copied from kjs/NativeErrorConstructor.cpp.
26451 * runtime/NativeErrorConstructor.h: Copied from kjs/NativeErrorConstructor.h.
26452 * runtime/NativeErrorPrototype.cpp: Copied from kjs/NativeErrorPrototype.cpp.
26453 * runtime/NativeErrorPrototype.h: Copied from kjs/NativeErrorPrototype.h.
26454 * runtime/NumberConstructor.cpp: Copied from kjs/NumberConstructor.cpp.
26455 * runtime/NumberConstructor.h: Copied from kjs/NumberConstructor.h.
26456 * runtime/NumberObject.cpp: Copied from kjs/NumberObject.cpp.
26457 * runtime/NumberObject.h: Copied from kjs/NumberObject.h.
26458 * runtime/NumberPrototype.cpp: Copied from kjs/NumberPrototype.cpp.
26459 * runtime/NumberPrototype.h: Copied from kjs/NumberPrototype.h.
26460 * runtime/ObjectConstructor.cpp: Copied from kjs/ObjectConstructor.cpp.
26461 * runtime/ObjectConstructor.h: Copied from kjs/ObjectConstructor.h.
26462 * runtime/ObjectPrototype.cpp: Copied from kjs/ObjectPrototype.cpp.
26463 * runtime/ObjectPrototype.h: Copied from kjs/ObjectPrototype.h.
26464 * runtime/PropertyMap.cpp: Copied from kjs/PropertyMap.cpp.
26465 * runtime/PropertyMap.h: Copied from kjs/PropertyMap.h.
26466 * runtime/PropertySlot.cpp: Copied from kjs/PropertySlot.cpp.
26467 * runtime/PropertySlot.h: Copied from kjs/PropertySlot.h.
26468 * runtime/PrototypeFunction.cpp: Copied from kjs/PrototypeFunction.cpp.
26469 * runtime/PrototypeFunction.h: Copied from kjs/PrototypeFunction.h.
26470 * runtime/PutPropertySlot.h: Copied from kjs/PutPropertySlot.h.
26471 * runtime/SmallStrings.cpp: Copied from kjs/SmallStrings.cpp.
26472 * runtime/SmallStrings.h: Copied from kjs/SmallStrings.h.
26473 * runtime/StringConstructor.cpp: Copied from kjs/StringConstructor.cpp.
26474 * runtime/StringConstructor.h: Copied from kjs/StringConstructor.h.
26475 * runtime/StringObject.cpp: Copied from kjs/StringObject.cpp.
26476 * runtime/StringObject.h: Copied from kjs/StringObject.h.
26477 * runtime/StringObjectThatMasqueradesAsUndefined.h: Copied from kjs/StringObjectThatMasqueradesAsUndefined.h.
26478 * runtime/StringPrototype.cpp: Copied from kjs/StringPrototype.cpp.
26479 * runtime/StringPrototype.h: Copied from kjs/StringPrototype.h.
26480 * runtime/StructureID.cpp: Copied from kjs/StructureID.cpp.
26481 * runtime/StructureID.h: Copied from kjs/StructureID.h.
26482
26483 2008-10-28 Geoffrey Garen <ggaren@apple.com>
26484
26485 Reviewed by Sam Weinig.
26486
26487 Fixed https://bugs.webkit.org/show_bug.cgi?id=21919
26488 Sampler reports bogus time in op_enter during 3d-raytrace.js
26489
26490 Fixed a bug where we would pass the incorrect Instruction* during some
26491 parts of CTI codegen.
26492
26493 * VM/CTI.cpp:
26494 (JSC::CTI::privateCompileMainPass):
26495 (JSC::CTI::privateCompileSlowCases):
26496 * VM/SamplingTool.cpp:
26497 (JSC::SamplingTool::run):
26498 * wtf/Platform.h:
26499
26500 2008-10-28 Kevin McCullough <kmccullough@apple.com>
26501
26502 Reviewed by Dan Bernstein.
26503
26504 -Removed unused includes.
26505 Apparent .4% speedup in Sunspider
26506
26507 * kjs/JSObject.cpp:
26508 * kjs/interpreter.cpp:
26509
26510 2008-10-28 Alp Toker <alp@nuanti.com>
26511
26512 Include copyright license files in the autotools dist target.
26513
26514 Change suggested by Mike Hommey.
26515
26516 * GNUmakefile.am:
26517
26518 2008-10-27 Geoffrey Garen <ggaren@apple.com>
26519
26520 Reviewed by Maciej Stachowiak.
26521
26522 Stop discarding CodeBlock samples that can't be charged to a specific
26523 opcode. Instead, charge the relevant CodeBlock, and provide a footnote
26524 explaining the situation.
26525
26526 This will help us tell which CodeBlocks are hot, even if we can't
26527 identify specific lines of code within the CodeBlocks.
26528
26529 * VM/SamplingTool.cpp:
26530 (JSC::ScopeSampleRecord::sample):
26531 (JSC::compareScopeSampleRecords):
26532 (JSC::SamplingTool::dump):
26533
26534 * VM/SamplingTool.h:
26535 (JSC::ScopeSampleRecord::ScopeSampleRecord):
26536 (JSC::ScopeSampleRecord::~ScopeSampleRecord):
26537
26538 2008-10-27 Geoffrey Garen <ggaren@apple.com>
26539
26540 Reviewed by Sam Weinig.
26541
26542 Added a mutex around the SamplingTool's ScopeNode* map, to solve a crash
26543 when sampling the v8 tests.
26544
26545 * VM/SamplingTool.cpp:
26546 (JSC::SamplingTool::run):
26547 (JSC::SamplingTool::notifyOfScope):
26548 * VM/SamplingTool.h: Since new ScopeNodes can be created after
26549 the SamplingTools has begun sampling, reads and writes to / from the
26550 map need to be synchronized. Shark says this doesn't measurably increase
26551 sampling overhead.
26552
26553 2008-10-25 Geoffrey Garen <ggaren@apple.com>
26554
26555 Not reviewed.
26556
26557 Try to fix Windows build.
26558
26559 * VM/Machine.cpp:
26560 (JSC::Machine::privateExecute): Provide a dummy value to the
26561 HostCallRecord in CTI non-sampling builds, to silence compiler warning.
26562
26563 2008-10-25 Geoffrey Garen <ggaren@apple.com>
26564
26565 Not reviewed.
26566
26567 Try to fix Windows build.
26568
26569 * VM/SamplingTool.h:
26570 (JSC::SamplingTool::encodeSample): Explicitly cast bool to int, to
26571 silence compiler warning.
26572
26573 2008-10-25 Geoffrey Garen <ggaren@apple.com>
26574
26575 Reviewed by Sam Weinig, with Gavin Barraclough's help.
26576
26577 Fixed Sampling Tool:
26578 - Made CodeBlock sampling work with CTI
26579 - Improved accuracy by unifying most sampling data into a single
26580 32bit word, which can be written / read atomically.
26581 - Split out three different #ifdefs for modularity: OPCODE_SAMPLING;
26582 CODEBLOCK_SAMPLING; OPCODE_STATS.
26583 - Improved reporting clarity
26584 - Refactored for code clarity
26585
26586 * JavaScriptCore.exp: Exported another symbol.
26587
26588 * VM/CTI.cpp:
26589 (JSC::CTI::emitCTICall):
26590 (JSC::CTI::compileOpCall):
26591 (JSC::CTI::emitSlowScriptCheck):
26592 (JSC::CTI::compileBinaryArithOpSlowCase):
26593 (JSC::CTI::privateCompileMainPass):
26594 (JSC::CTI::privateCompileSlowCases):
26595 (JSC::CTI::privateCompile):
26596 * VM/CTI.h: Updated CTI codegen to use the unified SamplingTool interface
26597 for encoding samples. (This required passing the current vPC to a lot
26598 more functions, since the unified interface samples the current vPC.)
26599 Added hooks for writing the current CodeBlock* on function entry and
26600 after a function call, for the sake of the CodeBlock sampler. Removed
26601 obsolete hook for clearing the current sample inside op_end. Also removed
26602 the custom enum used to differentiate flavors of op_call, since the
26603 OpcodeID enum works just as well. (This was important in an earlier
26604 version of the patch, but now it's just cleanup.)
26605
26606 * VM/CodeBlock.cpp:
26607 (JSC::CodeBlock::lineNumberForVPC):
26608 * VM/CodeBlock.h: Upated for refactored #ifdefs. Changed lineNumberForVPC
26609 to be robust against vPCs not recorded for exception handling, since
26610 the Sampler may ask for an arbitrary vPC.
26611
26612 * VM/Machine.cpp:
26613 (JSC::Machine::execute):
26614 (JSC::Machine::privateExecute):
26615 (JSC::Machine::cti_op_call_NotJSFunction):
26616 (JSC::Machine::cti_op_construct_NotJSConstruct):
26617 * VM/Machine.h:
26618 (JSC::Machine::setSampler):
26619 (JSC::Machine::sampler):
26620 (JSC::Machine::jitCodeBuffer): Upated for refactored #ifdefs. Changed
26621 Machine to use SamplingTool helper objects to record movement in and
26622 out of host code. This makes samples a bit more precise.
26623
26624 * VM/Opcode.cpp:
26625 (JSC::OpcodeStats::~OpcodeStats):
26626 * VM/Opcode.h: Upated for refactored #ifdefs. Added a little more padding,
26627 to accomodate our more verbose opcode names.
26628
26629 * VM/SamplingTool.cpp:
26630 (JSC::ScopeSampleRecord::sample): Only count a sample toward our total
26631 if we actually record it. This solves cases where a CodeBlock will
26632 claim to have been sampled many times, with reported samples that don't
26633 match.
26634
26635 (JSC::SamplingTool::run): Read the current sample into a Sample helper
26636 object, to ensure that the data doesn't change while we're analyzing it,
26637 and to help decode the data. Only access the CodeBlock sampling hash
26638 table if CodeBlock sampling has been enabled, so non-CodeBlock sampling
26639 runs can operate with even less overhead.
26640
26641 (JSC::SamplingTool::dump): I reorganized this code a lot to print the
26642 most important info at the top, print as a table, annotate and document
26643 the stuff I didn't understand when I started, etc.
26644
26645 * VM/SamplingTool.h: New helper classes, described above.
26646
26647 * kjs/Parser.h:
26648 * kjs/Shell.cpp:
26649 (runWithScripts):
26650 * kjs/nodes.cpp:
26651 (JSC::ScopeNode::ScopeNode): Updated for new sampling APIs.
26652
26653 * wtf/Platform.h: Moved sampling #defines here, since our custom is to
26654 put ENABLE #defines into Platform.h. Made explicit the fact that
26655 CODEBLOCK_SAMPLING depends on OPCODE_SAMPLING.
26656
26657 2008-10-25 Jan Michael Alonzo <jmalonzo@webkit.org>
26658
26659 JSC Build fix, not reviewed.
26660
26661 * VM/CTI.cpp: add missing include stdio.h for debug builds
26662
26663 2008-10-24 Eric Seidel <eric@webkit.org>
26664
26665 Reviewed by Darin Adler.
26666
26667 Get rid of a bonus ASSERT when using a null string as a regexp.
26668 Specifically calling: RegularExpression::match() with String::empty()
26669 will hit this ASSERT.
26670 Chromium hits this, but I don't know of any way to make a layout test.
26671
26672 * pcre/pcre_exec.cpp:
26673 (jsRegExpExecute):
26674
26675 2008-10-24 Alexey Proskuryakov <ap@webkit.org>
26676
26677 Suggested and rubber-stamped by Geoff Garen.
26678
26679 Fix a crash when opening Font Picker.
26680
26681 The change also hopefully fixes this bug, which I could never reproduce:
26682 https://bugs.webkit.org/show_bug.cgi?id=20241
26683 <rdar://problem/6290576> Safari crashes at JSValueUnprotect() when fontpicker view close
26684
26685 * API/JSContextRef.cpp: (JSContextGetGlobalObject): Use lexical global object instead of
26686 dynamic one.
26687
26688 2008-10-24 Cameron Zwarich <zwarich@apple.com>
26689
26690 Reviewed by Geoff Garen.
26691
26692 Remove ScopeChainNode::bottom() and inline it into its only caller,
26693 ScopeChainnode::globalObject().
26694
26695 * kjs/JSGlobalObject.h:
26696 (JSC::ScopeChainNode::globalObject):
26697 * kjs/ScopeChain.h:
26698 (JSC::ScopeChain::bottom):
26699
26700 2008-10-24 Cameron Zwarich <zwarich@apple.com>
26701
26702 Reviewed by Maciej Stachowiak.
26703
26704 Bug 21862: Create JSFunction prototype property lazily
26705 <https://bugs.webkit.org/show_bug.cgi?id=21862>
26706
26707 This is a 1.5% speedup on SunSpider and a 1.4% speedup on the V8
26708 benchmark suite, including a 3.8% speedup on Earley-Boyer.
26709
26710 * kjs/JSFunction.cpp:
26711 (JSC::JSFunction::getOwnPropertySlot):
26712 * kjs/nodes.cpp:
26713 (JSC::FuncDeclNode::makeFunction):
26714 (JSC::FuncExprNode::makeFunction):
26715
26716 2008-10-24 Greg Bolsinga <bolsinga@apple.com>
26717
26718 Reviewed by Sam Weinig.
26719
26720 https://bugs.webkit.org/show_bug.cgi?id=21475
26721
26722 Provide support for the Geolocation API
26723
26724 http://dev.w3.org/geo/api/spec-source.html
26725
26726 * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0
26727
26728 2008-10-24 Darin Adler <darin@apple.com>
26729
26730 - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
26731
26732 * API/APICast.h:
26733 * API/JSCallbackConstructor.h:
26734 * API/JSCallbackFunction.cpp:
26735 * API/JSCallbackFunction.h:
26736 * API/JSCallbackObject.h:
26737 * API/JSCallbackObjectFunctions.h:
26738 * API/JSContextRef.cpp:
26739 * API/JSObjectRef.cpp:
26740 * API/JSValueRef.cpp:
26741 * VM/CTI.cpp:
26742 * VM/CTI.h:
26743 * VM/CodeBlock.cpp:
26744 * VM/CodeBlock.h:
26745 * VM/CodeGenerator.cpp:
26746 * VM/CodeGenerator.h:
26747 * VM/ExceptionHelpers.cpp:
26748 * VM/ExceptionHelpers.h:
26749 * VM/JSPropertyNameIterator.cpp:
26750 * VM/JSPropertyNameIterator.h:
26751 * VM/Machine.cpp:
26752 * VM/Machine.h:
26753 * VM/Register.h:
26754 * kjs/ArgList.cpp:
26755 * kjs/ArgList.h:
26756 * kjs/Arguments.cpp:
26757 * kjs/Arguments.h:
26758 * kjs/ArrayConstructor.cpp:
26759 * kjs/ArrayPrototype.cpp:
26760 * kjs/BooleanConstructor.cpp:
26761 * kjs/BooleanConstructor.h:
26762 * kjs/BooleanObject.h:
26763 * kjs/BooleanPrototype.cpp:
26764 * kjs/CallData.cpp:
26765 * kjs/CallData.h:
26766 * kjs/ConstructData.cpp:
26767 * kjs/ConstructData.h:
26768 * kjs/DateConstructor.cpp:
26769 * kjs/DateInstance.h:
26770 * kjs/DatePrototype.cpp:
26771 * kjs/DatePrototype.h:
26772 * kjs/DebuggerCallFrame.cpp:
26773 * kjs/DebuggerCallFrame.h:
26774 * kjs/ErrorConstructor.cpp:
26775 * kjs/ErrorPrototype.cpp:
26776 * kjs/ExecState.cpp:
26777 * kjs/ExecState.h:
26778 * kjs/FunctionConstructor.cpp:
26779 * kjs/FunctionPrototype.cpp:
26780 * kjs/FunctionPrototype.h:
26781 * kjs/GetterSetter.cpp:
26782 * kjs/GetterSetter.h:
26783 * kjs/InternalFunction.h:
26784 * kjs/JSActivation.cpp:
26785 * kjs/JSActivation.h:
26786 * kjs/JSArray.cpp:
26787 * kjs/JSArray.h:
26788 * kjs/JSCell.cpp:
26789 * kjs/JSCell.h:
26790 * kjs/JSFunction.cpp:
26791 * kjs/JSFunction.h:
26792 * kjs/JSGlobalData.h:
26793 * kjs/JSGlobalObject.cpp:
26794 * kjs/JSGlobalObject.h:
26795 * kjs/JSGlobalObjectFunctions.cpp:
26796 * kjs/JSGlobalObjectFunctions.h:
26797 * kjs/JSImmediate.cpp:
26798 * kjs/JSImmediate.h:
26799 * kjs/JSNotAnObject.cpp:
26800 * kjs/JSNotAnObject.h:
26801 * kjs/JSNumberCell.cpp:
26802 * kjs/JSNumberCell.h:
26803 * kjs/JSObject.cpp:
26804 * kjs/JSObject.h:
26805 * kjs/JSStaticScopeObject.cpp:
26806 * kjs/JSStaticScopeObject.h:
26807 * kjs/JSString.cpp:
26808 * kjs/JSString.h:
26809 * kjs/JSValue.h:
26810 * kjs/JSVariableObject.h:
26811 * kjs/JSWrapperObject.h:
26812 * kjs/MathObject.cpp:
26813 * kjs/MathObject.h:
26814 * kjs/NativeErrorConstructor.cpp:
26815 * kjs/NumberConstructor.cpp:
26816 * kjs/NumberConstructor.h:
26817 * kjs/NumberObject.cpp:
26818 * kjs/NumberObject.h:
26819 * kjs/NumberPrototype.cpp:
26820 * kjs/ObjectConstructor.cpp:
26821 * kjs/ObjectPrototype.cpp:
26822 * kjs/ObjectPrototype.h:
26823 * kjs/PropertyMap.h:
26824 * kjs/PropertySlot.cpp:
26825 * kjs/PropertySlot.h:
26826 * kjs/RegExpConstructor.cpp:
26827 * kjs/RegExpConstructor.h:
26828 * kjs/RegExpMatchesArray.h:
26829 * kjs/RegExpObject.cpp:
26830 * kjs/RegExpObject.h:
26831 * kjs/RegExpPrototype.cpp:
26832 * kjs/Shell.cpp:
26833 * kjs/StringConstructor.cpp:
26834 * kjs/StringObject.cpp:
26835 * kjs/StringObject.h:
26836 * kjs/StringObjectThatMasqueradesAsUndefined.h:
26837 * kjs/StringPrototype.cpp:
26838 * kjs/StructureID.cpp:
26839 * kjs/StructureID.h:
26840 * kjs/collector.cpp:
26841 * kjs/collector.h:
26842 * kjs/completion.h:
26843 * kjs/grammar.y:
26844 * kjs/interpreter.cpp:
26845 * kjs/interpreter.h:
26846 * kjs/lookup.cpp:
26847 * kjs/lookup.h:
26848 * kjs/nodes.h:
26849 * kjs/operations.cpp:
26850 * kjs/operations.h:
26851 * kjs/protect.h:
26852 * profiler/ProfileGenerator.cpp:
26853 * profiler/Profiler.cpp:
26854 * profiler/Profiler.h:
26855 Use JSValue* instead of JSValuePtr.
26856
26857 2008-10-24 David Kilzer <ddkilzer@apple.com>
26858
26859 Rolled out r37840.
26860
26861 * wtf/Platform.h:
26862
26863 2008-10-23 Greg Bolsinga <bolsinga@apple.com>
26864
26865 Reviewed by Sam Weinig.
26866
26867 https://bugs.webkit.org/show_bug.cgi?id=21475
26868
26869 Provide support for the Geolocation API
26870
26871 http://dev.w3.org/geo/api/spec-source.html
26872
26873 * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0
26874
26875 2008-10-23 David Kilzer <ddkilzer@apple.com>
26876
26877 Bug 21832: Fix scripts using 'new File::Temp' for Perl 5.10
26878
26879 <https://bugs.webkit.org/show_bug.cgi?id=21832>
26880
26881 Reviewed by Sam Weinig.
26882
26883 * pcre/dftables: Use imported tempfile() from File::Temp instead of
26884 'new File::Temp' to make the script work with Perl 5.10.
26885
26886 2008-10-23 Gavin Barraclough <barraclough@apple.com>
26887
26888 Reviewed by Oliver Hunt.
26889
26890 Fix hideous pathological case performance when looking up repatch info, bug #21727.
26891
26892 When repatching JIT code to optimize we look up records providing information about
26893 the generated code (also used to track recsources used in linking to be later released).
26894 The lookup was being performed using a linear scan of all such records.
26895
26896 (1) Split up the different types of reptach information. This means we can search them
26897 separately, and in some cases should reduce their size.
26898 (2) In the case of property accesses, search with a binary chop over the data.
26899 (3) In the case of calls, pass a pointer to the repatch info into the relink function.
26900
26901 * VM/CTI.cpp:
26902 (JSC::CTI::CTI):
26903 (JSC::CTI::compileOpCall):
26904 (JSC::CTI::privateCompileMainPass):
26905 (JSC::CTI::privateCompileSlowCases):
26906 (JSC::CTI::privateCompile):
26907 (JSC::CTI::unlinkCall):
26908 (JSC::CTI::linkCall):
26909 * VM/CTI.h:
26910 * VM/CodeBlock.cpp:
26911 (JSC::CodeBlock::dump):
26912 (JSC::CodeBlock::~CodeBlock):
26913 (JSC::CodeBlock::unlinkCallers):
26914 (JSC::CodeBlock::derefStructureIDs):
26915 * VM/CodeBlock.h:
26916 (JSC::StructureStubInfo::StructureStubInfo):
26917 (JSC::CallLinkInfo::CallLinkInfo):
26918 (JSC::CallLinkInfo::setUnlinked):
26919 (JSC::CallLinkInfo::isLinked):
26920 (JSC::getStructureStubInfoReturnLocation):
26921 (JSC::binaryChop):
26922 (JSC::CodeBlock::addCaller):
26923 (JSC::CodeBlock::getStubInfo):
26924 * VM/CodeGenerator.cpp:
26925 (JSC::CodeGenerator::emitResolve):
26926 (JSC::CodeGenerator::emitGetById):
26927 (JSC::CodeGenerator::emitPutById):
26928 (JSC::CodeGenerator::emitCall):
26929 (JSC::CodeGenerator::emitConstruct):
26930 * VM/Machine.cpp:
26931 (JSC::Machine::cti_vm_lazyLinkCall):
26932
26933 2008-10-23 Peter Kasting <pkasting@google.com>
26934
26935 Reviewed by Adam Roben.
26936
26937 https://bugs.webkit.org/show_bug.cgi?id=21833
26938 Place JavaScript Debugger hooks under #if ENABLE(JAVASCRIPT_DEBUGGER).
26939
26940 * wtf/Platform.h:
26941
26942 2008-10-23 David Kilzer <ddkilzer@apple.com>
26943
26944 Bug 21831: Fix create_hash_table for Perl 5.10
26945
26946 <https://bugs.webkit.org/show_bug.cgi?id=21831>
26947
26948 Reviewed by Sam Weinig.
26949
26950 * kjs/create_hash_table: Escaped square brackets so that Perl 5.10
26951 doesn't try to use @nameEntries.
26952
26953 2008-10-23 Darin Adler <darin@apple.com>
26954
26955 - roll out https://bugs.webkit.org/show_bug.cgi?id=21732
26956 to remove the JSValuePtr class, to fix two problems
26957
26958 1) slowness under MSVC, since it doesn't handle a
26959 class with a single pointer in it as efficiently
26960 as a pointer
26961
26962 2) uninitialized pointers in Vector
26963
26964 * JavaScriptCore.exp: Updated.
26965
26966 * API/APICast.h:
26967 (toRef):
26968 * VM/CTI.cpp:
26969 (JSC::CTI::asInteger):
26970 * VM/CodeGenerator.cpp:
26971 (JSC::CodeGenerator::addConstant):
26972 * VM/CodeGenerator.h:
26973 (JSC::CodeGenerator::JSValueHashTraits::constructDeletedValue):
26974 (JSC::CodeGenerator::JSValueHashTraits::isDeletedValue):
26975 * VM/Machine.cpp:
26976 (JSC::Machine::cti_op_add):
26977 (JSC::Machine::cti_op_pre_inc):
26978 (JSC::Machine::cti_op_get_by_id):
26979 (JSC::Machine::cti_op_get_by_id_second):
26980 (JSC::Machine::cti_op_get_by_id_generic):
26981 (JSC::Machine::cti_op_get_by_id_fail):
26982 (JSC::Machine::cti_op_instanceof):
26983 (JSC::Machine::cti_op_del_by_id):
26984 (JSC::Machine::cti_op_mul):
26985 (JSC::Machine::cti_op_call_NotJSFunction):
26986 (JSC::Machine::cti_op_resolve):
26987 (JSC::Machine::cti_op_construct_NotJSConstruct):
26988 (JSC::Machine::cti_op_get_by_val):
26989 (JSC::Machine::cti_op_sub):
26990 (JSC::Machine::cti_op_lesseq):
26991 (JSC::Machine::cti_op_negate):
26992 (JSC::Machine::cti_op_resolve_base):
26993 (JSC::Machine::cti_op_resolve_skip):
26994 (JSC::Machine::cti_op_resolve_global):
26995 (JSC::Machine::cti_op_div):
26996 (JSC::Machine::cti_op_pre_dec):
26997 (JSC::Machine::cti_op_not):
26998 (JSC::Machine::cti_op_eq):
26999 (JSC::Machine::cti_op_lshift):
27000 (JSC::Machine::cti_op_bitand):
27001 (JSC::Machine::cti_op_rshift):
27002 (JSC::Machine::cti_op_bitnot):
27003 (JSC::Machine::cti_op_mod):
27004 (JSC::Machine::cti_op_less):
27005 (JSC::Machine::cti_op_neq):
27006 (JSC::Machine::cti_op_urshift):
27007 (JSC::Machine::cti_op_bitxor):
27008 (JSC::Machine::cti_op_bitor):
27009 (JSC::Machine::cti_op_call_eval):
27010 (JSC::Machine::cti_op_throw):
27011 (JSC::Machine::cti_op_next_pname):
27012 (JSC::Machine::cti_op_typeof):
27013 (JSC::Machine::cti_op_is_undefined):
27014 (JSC::Machine::cti_op_is_boolean):
27015 (JSC::Machine::cti_op_is_number):
27016 (JSC::Machine::cti_op_is_string):
27017 (JSC::Machine::cti_op_is_object):
27018 (JSC::Machine::cti_op_is_function):
27019 (JSC::Machine::cti_op_stricteq):
27020 (JSC::Machine::cti_op_nstricteq):
27021 (JSC::Machine::cti_op_to_jsnumber):
27022 (JSC::Machine::cti_op_in):
27023 (JSC::Machine::cti_op_del_by_val):
27024 (JSC::Machine::cti_vm_throw):
27025 Removed calls to payload functions.
27026
27027 * VM/Register.h:
27028 (JSC::Register::Register): Removed overload for JSCell and call
27029 to payload function.
27030
27031 * kjs/JSCell.h: Changed JSCell to derive from JSValue again.
27032 Removed JSValuePtr constructor.
27033 (JSC::asCell): Changed cast from reinterpret_cast to static_cast.
27034
27035 * kjs/JSImmediate.h: Removed JSValuePtr class. Added typedef back.
27036
27037 * kjs/JSValue.h:
27038 (JSC::JSValue::JSValue): Added empty protected inline constructor back.
27039 (JSC::JSValue::~JSValue): Same for destructor.
27040 Removed == and != operator for JSValuePtr.
27041
27042 * kjs/PropertySlot.h:
27043 (JSC::PropertySlot::PropertySlot): Chnaged argument to const JSValue*
27044 and added a const_cast.
27045
27046 * kjs/protect.h: Removed overloads and specialization for JSValuePtr.
27047
27048 2008-10-22 Oliver Hunt <oliver@apple.com>
27049
27050 Reviewed by Maciej Stachowiak.
27051
27052 Really "fix" CTI mode on windows 2k3.
27053
27054 This adds new methods fastMallocExecutable and fastFreeExecutable
27055 to wrap allocation for cti code. This still just makes fastMalloc
27056 return executable memory all the time, which will be fixed in a
27057 later patch.
27058
27059 However in windows debug builds all executable allocations will be
27060 allocated on separate executable pages, which should resolve any
27061 remaining 2k3 issues. Conveniently the 2k3 bot will now also fail
27062 if there are any fastFree vs. fastFreeExecutable errors.
27063
27064 * ChangeLog:
27065 * VM/CodeBlock.cpp:
27066 (JSC::CodeBlock::~CodeBlock):
27067 * kjs/regexp.cpp:
27068 (JSC::RegExp::~RegExp):
27069 * masm/X86Assembler.h:
27070 (JSC::JITCodeBuffer::copy):
27071 * wtf/FastMalloc.cpp:
27072 (WTF::fastMallocExecutable):
27073 (WTF::fastFreeExecutable):
27074 (WTF::TCMallocStats::fastMallocExecutable):
27075 (WTF::TCMallocStats::fastFreeExecutable):
27076 * wtf/FastMalloc.h:
27077
27078 2008-10-22 Darin Adler <darin@apple.com>
27079
27080 Reviewed by Sam Weinig.
27081
27082 - fix https://bugs.webkit.org/show_bug.cgi?id=21294
27083 Bug 21294: Devirtualize getOwnPropertySlot()
27084
27085 A bit over 3% faster on V8 tests.
27086
27087 * JavascriptCore.exp: Export leak-related functions..
27088
27089 * API/JSCallbackConstructor.h:
27090 (JSC::JSCallbackConstructor::createStructureID): Set HasStandardGetOwnPropertySlot
27091 since this class doesn't override getPropertySlot.
27092 * API/JSCallbackFunction.h:
27093 (JSC::JSCallbackFunction::createStructureID): Ditto.
27094
27095 * VM/ExceptionHelpers.cpp:
27096 (JSC::InterruptedExecutionError::InterruptedExecutionError): Use a structure
27097 that's created just for this class instead of trying to share a single "null
27098 prototype" structure.
27099
27100 * VM/Machine.cpp:
27101 (JSC::Machine::cti_op_create_arguments_no_params): Rename
27102 Arguments::ArgumentsNoParameters to Arguments::NoParameters.
27103
27104 * kjs/Arguments.h: Rename the enum from Arguments::ArgumentsParameters to
27105 Arguments::NoParametersType and the value from Arguments::ArgumentsNoParameters
27106 to Arguments::NoParameters.
27107 (JSC::Arguments::createStructureID): Added. Returns a structure without
27108 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27109 (JSC::Arguments::Arguments): Added an assertion that there are no parameters.
27110
27111 * kjs/DatePrototype.h:
27112 (JSC::DatePrototype::createStructureID): Added. Returns a structure without
27113 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27114
27115 * kjs/FunctionPrototype.h:
27116 (JSC::FunctionPrototype::createStructureID): Set HasStandardGetOwnPropertySlot
27117 since this class doesn't override getPropertySlot.
27118 * kjs/InternalFunction.h:
27119 (JSC::InternalFunction::createStructureID): Ditto.
27120
27121 * kjs/JSArray.h:
27122 (JSC::JSArray::createStructureID): Added. Returns a structure without
27123 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27124
27125 * kjs/JSCell.h: Added declaration of fastGetOwnPropertySlot; a non-virtual
27126 version that uses the structure bit to decide whether to call the virtual
27127 version.
27128
27129 * kjs/JSFunction.h:
27130 (JSC::JSFunction::createStructureID): Added. Returns a structure without
27131 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27132
27133 * kjs/JSGlobalData.cpp:
27134 (JSC::JSGlobalData::JSGlobalData): Initialize new structures; removed
27135 nullProtoStructureID.
27136 * kjs/JSGlobalData.h: Added new structures. Removed nullProtoStructureID.
27137
27138 * kjs/JSGlobalObject.h:
27139 (JSC::JSGlobalObject::createStructureID): Added. Returns a structure without
27140 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27141
27142 * kjs/JSNotAnObject.h:
27143 (JSC::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub): Use a structure
27144 that's created just for this class instead of trying to share a single "null
27145 prototype" structure.
27146 (JSC::JSNotAnObjectErrorStub::isNotAnObjectErrorStub): Marked this function
27147 virtual for clarity and made it private since no one should call it if they
27148 already have a pointer to this specific type.
27149 (JSC::JSNotAnObject::JSNotAnObject): Use a structure that's created just
27150 for this class instead of trying to share a single "null prototype" structure.
27151 (JSC::JSNotAnObject::createStructureID): Added. Returns a structure without
27152 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27153
27154 * kjs/JSObject.h:
27155 (JSC::JSObject::createStructureID): Added HasStandardGetOwnPropertySlot.
27156 (JSC::JSObject::inlineGetOwnPropertySlot): Added. Used so we can share code
27157 between getOwnPropertySlot and fastGetOwnPropertySlot.
27158 (JSC::JSObject::getOwnPropertySlot): Moved so that functions are above the
27159 functions that call them. Moved the guts of this function into
27160 inlineGetOwnPropertySlot.
27161 (JSC::JSCell::fastGetOwnPropertySlot): Added. Checks the
27162 HasStandardGetOwnPropertySlot bit and if it's set, calls
27163 inlineGetOwnPropertySlot, otherwise calls getOwnPropertySlot.
27164 (JSC::JSObject::getPropertySlot): Changed to call fastGetOwnPropertySlot.
27165 (JSC::JSValue::get): Changed to call fastGetOwnPropertySlot.
27166
27167 * kjs/JSWrapperObject.h: Made constructor protected to emphasize that
27168 this class is only a base class and never instantiated.
27169
27170 * kjs/MathObject.h:
27171 (JSC::MathObject::createStructureID): Added. Returns a structure without
27172 HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
27173 * kjs/NumberConstructor.h:
27174 (JSC::NumberConstructor::createStructureID): Ditto.
27175 * kjs/RegExpConstructor.h:
27176 (JSC::RegExpConstructor::createStructureID): Ditto.
27177 * kjs/RegExpObject.h:
27178 (JSC::RegExpObject::createStructureID): Ditto.
27179 * kjs/StringObject.h:
27180 (JSC::StringObject::createStructureID): Ditto.
27181
27182 * kjs/TypeInfo.h: Added HasStandardGetOwnPropertySlot flag and
27183 hasStandardGetOwnPropertySlot accessor function.
27184
27185 2008-10-22 Cameron Zwarich <zwarich@apple.com>
27186
27187 Reviewed by Geoff Garen.
27188
27189 Bug 21803: Fuse op_jfalse with op_eq_null and op_neq_null
27190 <https://bugs.webkit.org/show_bug.cgi?id=21803>
27191
27192 Fuse op_jfalse with op_eq_null and op_neq_null to make the new opcodes
27193 op_jeq_null and op_jneq_null.
27194
27195 This is a 2.6% speedup on the V8 Raytrace benchmark, and strangely also
27196 a 4.7% speedup on the V8 Arguments benchmark, even though it uses
27197 neither of the two new opcodes.
27198
27199 * VM/CTI.cpp:
27200 (JSC::CTI::privateCompileMainPass):
27201 * VM/CodeBlock.cpp:
27202 (JSC::CodeBlock::dump):
27203 * VM/CodeGenerator.cpp:
27204 (JSC::CodeGenerator::emitJumpIfTrue):
27205 (JSC::CodeGenerator::emitJumpIfFalse):
27206 * VM/Machine.cpp:
27207 (JSC::Machine::privateExecute):
27208 * VM/Opcode.h:
27209
27210 2008-10-22 Darin Fisher <darin@chromium.org>
27211
27212 Reviewed by Eric Seidel.
27213
27214 Should not define PLATFORM(WIN,MAC,GTK) when PLATFORM(CHROMIUM) is defined
27215 https://bugs.webkit.org/show_bug.cgi?id=21757
27216
27217 PLATFORM(CHROMIUM) implies HAVE_ACCESSIBILITY
27218
27219 * wtf/Platform.h:
27220
27221 2008-10-22 Cameron Zwarich <zwarich@apple.com>
27222
27223 Reviewed by Alexey Proskuryakov.
27224
27225 Correct opcode names in documentation.
27226
27227 * VM/Machine.cpp:
27228 (JSC::Machine::privateExecute):
27229
27230 2008-10-21 Oliver Hunt <oliver@apple.com>
27231
27232 RS=Maciej Stachowiak.
27233
27234 Force FastMalloc to make all allocated pages executable in
27235 a vague hope this will allow the Win2k3 bot to be able to
27236 run tests.
27237
27238 Filed Bug 21783: Need more granular control over allocation of executable memory
27239 to cover a more granular version of this patch.
27240
27241 * wtf/TCSystemAlloc.cpp:
27242 (TryVirtualAlloc):
27243
27244 2008-10-21 Alexey Proskuryakov <ap@webkit.org>
27245
27246 Reviewed by Darin Adler.
27247
27248 https://bugs.webkit.org/show_bug.cgi?id=21769
27249 MessagePort should be GC protected if there are messages to be delivered
27250
27251 * wtf/MessageQueue.h:
27252 (WTF::::isEmpty): Added. Also added a warning for methods that return a snapshot of queue
27253 state, thus likely to cause race conditions.
27254
27255 2008-10-21 Darin Adler <darin@apple.com>
27256
27257 Reviewed by Maciej Stachowiak.
27258
27259 - convert post-increment to pre-increment in a couple more places for speed
27260
27261 Speeds up V8 benchmarks a little on most computers. (But, strangely, slows
27262 them down a little on my computer.)
27263
27264 * kjs/nodes.cpp:
27265 (JSC::statementListEmitCode): Removed default argument, since we always want
27266 to specify this explicitly.
27267 (JSC::ForNode::emitCode): Tolerate ignoredResult() as the dst -- means the
27268 same thing as 0.
27269 (JSC::ReturnNode::emitCode): Ditto.
27270 (JSC::ThrowNode::emitCode): Ditto.
27271 (JSC::FunctionBodyNode::emitCode): Pass ignoredResult() so that we know we
27272 don't have to compute the result of function statements.
27273
27274 2008-10-21 Peter Kasting <pkasting@google.com>
27275
27276 Reviewed by Maciej Stachowiak.
27277
27278 Fix an include of a non-public header to use "" instead of <>.
27279
27280 * API/JSProfilerPrivate.cpp:
27281
27282 2008-10-20 Sam Weinig <sam@webkit.org>
27283
27284 Reviewed by Cameron Zwarich.
27285
27286 Fix for https://bugs.webkit.org/show_bug.cgi?id=21766
27287 REGRESSION: 12 JSC tests fail
27288
27289 The JSGlobalObject was mutating the shared nullProtoStructureID when
27290 used in jsc. Instead of using nullProtoStructureID, use a new StructureID.
27291
27292 * API/JSCallbackObject.h:
27293 * API/JSCallbackObjectFunctions.h:
27294 (JSC::::JSCallbackObject):
27295 * API/JSContextRef.cpp:
27296 (JSGlobalContextCreateInGroup):
27297 * kjs/JSGlobalObject.h:
27298 (JSC::JSGlobalObject::JSGlobalObject):
27299 * kjs/Shell.cpp:
27300 (GlobalObject::GlobalObject):
27301 (jscmain):
27302
27303 2008-10-20 Cameron Zwarich <zwarich@apple.com>
27304
27305 Reviewed by Maciej Stachowiak.
27306
27307 Remove an untaken branch in CodeGenerator::emitJumpIfFalse(). This
27308 function is never called with a backwards target LabelID, and there is
27309 even an assertion to this effect at the top of the function body.
27310
27311 * VM/CodeGenerator.cpp:
27312 (JSC::CodeGenerator::emitJumpIfFalse):
27313
27314 2008-10-20 Cameron Zwarich <zwarich@apple.com>
27315
27316 Rubber-stamped by Sam Weinig.
27317
27318 Add opcode documentation for undocumented opcodes.
27319
27320 * VM/Machine.cpp:
27321 (JSC::Machine::privateExecute):
27322
27323 2008-10-16 Sam Weinig <sam@webkit.org>
27324
27325 Reviewed by Cameron Zwarich.
27326
27327 Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
27328 Don't create intermediate StructureIDs for builtin objects
27329
27330 Second stage in reduce number of StructureIDs created when initializing the
27331 JSGlobalObject.
27332
27333 - Use putDirectWithoutTransition for the remaining singleton objects to reduce
27334 the number of StructureIDs create for about:blank from 132 to 73.
27335
27336 * kjs/ArrayConstructor.cpp:
27337 (JSC::ArrayConstructor::ArrayConstructor):
27338 * kjs/BooleanConstructor.cpp:
27339 (JSC::BooleanConstructor::BooleanConstructor):
27340 * kjs/BooleanPrototype.cpp:
27341 (JSC::BooleanPrototype::BooleanPrototype):
27342 * kjs/DateConstructor.cpp:
27343 (JSC::DateConstructor::DateConstructor):
27344 * kjs/ErrorConstructor.cpp:
27345 (JSC::ErrorConstructor::ErrorConstructor):
27346 * kjs/ErrorPrototype.cpp:
27347 (JSC::ErrorPrototype::ErrorPrototype):
27348 * kjs/FunctionConstructor.cpp:
27349 (JSC::FunctionConstructor::FunctionConstructor):
27350 * kjs/FunctionPrototype.cpp:
27351 (JSC::FunctionPrototype::FunctionPrototype):
27352 (JSC::FunctionPrototype::addFunctionProperties):
27353 * kjs/FunctionPrototype.h:
27354 (JSC::FunctionPrototype::createStructureID):
27355 * kjs/InternalFunction.cpp:
27356 * kjs/InternalFunction.h:
27357 (JSC::InternalFunction::InternalFunction):
27358 * kjs/JSGlobalObject.cpp:
27359 (JSC::JSGlobalObject::reset):
27360 * kjs/JSObject.h:
27361 * kjs/MathObject.cpp:
27362 (JSC::MathObject::MathObject):
27363 * kjs/NumberConstructor.cpp:
27364 (JSC::NumberConstructor::NumberConstructor):
27365 * kjs/NumberPrototype.cpp:
27366 (JSC::NumberPrototype::NumberPrototype):
27367 * kjs/ObjectConstructor.cpp:
27368 (JSC::ObjectConstructor::ObjectConstructor):
27369 * kjs/RegExpConstructor.cpp:
27370 (JSC::RegExpConstructor::RegExpConstructor):
27371 * kjs/RegExpPrototype.cpp:
27372 (JSC::RegExpPrototype::RegExpPrototype):
27373 * kjs/StringConstructor.cpp:
27374 (JSC::StringConstructor::StringConstructor):
27375 * kjs/StringPrototype.cpp:
27376 (JSC::StringPrototype::StringPrototype):
27377 * kjs/StructureID.cpp:
27378 (JSC::StructureID::dumpStatistics):
27379 * kjs/StructureID.h:
27380 (JSC::StructureID::setPrototypeWithoutTransition):
27381
27382 2008-10-20 Alp Toker <alp@nuanti.com>
27383
27384 Fix autotools dist build target by listing recently added header
27385 files only. Not reviewed.
27386
27387 * GNUmakefile.am:
27388
27389 2008-10-20 Geoffrey Garen <ggaren@apple.com>
27390
27391 Reviewed by Anders Carlsson.
27392
27393 * VM/Machine.cpp:
27394 (JSC::Machine::tryCacheGetByID): Removed a redundant and sometimes
27395 incorrect cast, which started ASSERTing after Darin's last checkin.
27396
27397 2008-10-20 Geoffrey Garen <ggaren@apple.com>
27398
27399 Not reviewed.
27400
27401 Re-enable CTI, which I accidentally disabled while checking in fixes
27402 to bytecode.
27403
27404 * wtf/Platform.h:
27405
27406 2008-10-20 Alp Toker <alp@nuanti.com>
27407
27408 Rubber-stamped by Mark Rowe.
27409
27410 Typo fix in function name: mimimum -> minimum.
27411
27412 * kjs/DateMath.cpp:
27413 (JSC::minimumYearForDST):
27414 (JSC::equivalentYearForDST):
27415
27416 2008-10-20 Alp Toker <alp@nuanti.com>
27417
27418 Reviewed by Mark Rowe.
27419
27420 Use pthread instead of GThread where possible in the GTK+ port. This
27421 fixes issues with global initialisation, particularly on GTK+/Win32
27422 where a late g_thread_init() will cause hangs.
27423
27424 * GNUmakefile.am:
27425 * wtf/Platform.h:
27426 * wtf/Threading.h:
27427 * wtf/ThreadingGtk.cpp:
27428 * wtf/ThreadingPthreads.cpp:
27429
27430 2008-10-20 Geoffrey Garen <ggaren@apple.com>
27431
27432 Reviewed by Darin Adler.
27433
27434 Fixed https://bugs.webkit.org/show_bug.cgi?id=21735
27435 Emit profiling instrumentation only if the Web Inspector's profiling
27436 feature is enabled
27437
27438 22.2% speedup on empty function call benchmark.
27439 2.9% speedup on v8 benchmark.
27440 0.7% speedup on SunSpider.
27441
27442 Lesser but similar speedups in bytecode.
27443
27444 * VM/CTI.cpp:
27445 (JSC::CTI::compileOpCall):
27446 (JSC::CTI::privateCompileMainPass):
27447 (JSC::CTI::privateCompileSlowCases): Nixed JITed profiler hooks. Profiler
27448 hooks now have their own opcodes. Added support for compiling profiler
27449 hook opcodes.
27450
27451 (JSC::CodeBlock::dump): Dump support for the new profiling opcodes.
27452
27453 * VM/CodeGenerator.h:
27454 * VM/CodeGenerator.cpp:
27455 (JSC::CodeGenerator::CodeGenerator):
27456 (JSC::CodeGenerator::emitCall):
27457 (JSC::CodeGenerator::emitConstruct): Conditionally emit profiling hooks
27458 around call and construct, at the call site. (It's easier to get things
27459 right this way, if you have profiled code calling non-profiled code.
27460 Also, you get a slightly more accurate profile, since you charge the full
27461 cost of the call / construct operation to the callee.)
27462
27463 Also, fixed a bug where construct would fetch the ".prototype" property
27464 from the constructor before evaluating the arguments to the constructor,
27465 incorrectly allowing an "invalid constructor" exception to short-circuit
27466 argument evaluation. I encountered this bug when trying to make
27467 constructor exceptions work with profiling.
27468
27469 * VM/Machine.cpp:
27470 (JSC::Machine::callEval): Removed obsolete profiler hooks.
27471
27472 (JSC::Machine::throwException): Added a check for an exception thrown
27473 within a call instruction. We didn't need this before because the call
27474 instruction would check for a valid call before involing the profiler.
27475 (JSC::Machine::execute): Added a didExecute hook at the end of top-level
27476 function invocation, since op_ret no longer does this for us.
27477
27478 (JSC::Machine::privateExecute): Removed obsolete profiler hooks. Added
27479 profiler opcodes. Changed some ++vPC to vPC[x] notation, since the
27480 latter is better for performance, and it makes reasoning about the
27481 current opcode in exception handling much simpler.
27482
27483 (JSC::Machine::cti_op_call_NotJSFunction): Removed obsolete profiler
27484 hooks.
27485
27486 (JSC::Machine::cti_op_create_arguments_no_params): Added missing
27487 CTI_STACK_HACK that I noticed when adding CTI_STACK_HACK to the new
27488 profiler opcode functions.
27489
27490 (JSC::Machine::cti_op_profile_will_call):
27491 (JSC::Machine::cti_op_profile_did_call): The new profiler opcode
27492 functions.
27493
27494 (JSC::Machine::cti_op_construct_NotJSConstruct): Removed obsolete profiler
27495 hooks.
27496
27497 * VM/Machine.h:
27498 (JSC::Machine::isCallOpcode): Helper for exception handling.
27499
27500 * VM/Opcode.h: Declare new opcodes.
27501
27502 * kjs/JSGlobalObject.h:
27503 (JSC::JSGlobalObject::supportsProfiling): Added virtual interface that
27504 allows WebCore to specify whether the target global object has the Web
27505 Inspector's profiling feature enabled.
27506
27507 * profiler/Profiler.cpp:
27508 (JSC::Profiler::willExecute):
27509 (JSC::Profiler::didExecute):
27510 (JSC::Profiler::createCallIdentifier):
27511 * profiler/Profiler.h: Added support for invoking the profiler with
27512 an arbitrary JSValue*, and not a known object. We didn't need this
27513 before because the call instruction would check for a valid call before
27514 involing the profiler.
27515
27516 2008-10-20 Darin Adler <darin@apple.com>
27517
27518 Reviewed by Geoff Garen.
27519
27520 - get CTI working on Windows again
27521
27522 * VM/CTI.cpp:
27523 (JSC::CTI::emitCTICall): Add an overload for functions that
27524 return JSObject*.
27525 * VM/CTI.h: Use JSValue* and JSObject* as return types for
27526 cti_op functions. Apparently, MSVC doesn't handle returning
27527 the JSValuePtr struct in a register. We'll have to look into
27528 this more.
27529
27530 * VM/Machine.cpp:
27531 (JSC::Machine::cti_op_convert_this):
27532 (JSC::Machine::cti_op_add):
27533 (JSC::Machine::cti_op_pre_inc):
27534 (JSC::Machine::cti_op_new_object):
27535 (JSC::Machine::cti_op_get_by_id):
27536 (JSC::Machine::cti_op_get_by_id_second):
27537 (JSC::Machine::cti_op_get_by_id_generic):
27538 (JSC::Machine::cti_op_get_by_id_fail):
27539 (JSC::Machine::cti_op_instanceof):
27540 (JSC::Machine::cti_op_del_by_id):
27541 (JSC::Machine::cti_op_mul):
27542 (JSC::Machine::cti_op_new_func):
27543 (JSC::Machine::cti_op_push_activation):
27544 (JSC::Machine::cti_op_call_NotJSFunction):
27545 (JSC::Machine::cti_op_new_array):
27546 (JSC::Machine::cti_op_resolve):
27547 (JSC::Machine::cti_op_construct_JSConstructFast):
27548 (JSC::Machine::cti_op_construct_NotJSConstruct):
27549 (JSC::Machine::cti_op_get_by_val):
27550 (JSC::Machine::cti_op_sub):
27551 (JSC::Machine::cti_op_lesseq):
27552 (JSC::Machine::cti_op_negate):
27553 (JSC::Machine::cti_op_resolve_base):
27554 (JSC::Machine::cti_op_resolve_skip):
27555 (JSC::Machine::cti_op_resolve_global):
27556 (JSC::Machine::cti_op_div):
27557 (JSC::Machine::cti_op_pre_dec):
27558 (JSC::Machine::cti_op_not):
27559 (JSC::Machine::cti_op_eq):
27560 (JSC::Machine::cti_op_lshift):
27561 (JSC::Machine::cti_op_bitand):
27562 (JSC::Machine::cti_op_rshift):
27563 (JSC::Machine::cti_op_bitnot):
27564 (JSC::Machine::cti_op_new_func_exp):
27565 (JSC::Machine::cti_op_mod):
27566 (JSC::Machine::cti_op_less):
27567 (JSC::Machine::cti_op_neq):
27568 (JSC::Machine::cti_op_urshift):
27569 (JSC::Machine::cti_op_bitxor):
27570 (JSC::Machine::cti_op_new_regexp):
27571 (JSC::Machine::cti_op_bitor):
27572 (JSC::Machine::cti_op_call_eval):
27573 (JSC::Machine::cti_op_throw):
27574 (JSC::Machine::cti_op_next_pname):
27575 (JSC::Machine::cti_op_typeof):
27576 (JSC::Machine::cti_op_is_undefined):
27577 (JSC::Machine::cti_op_is_boolean):
27578 (JSC::Machine::cti_op_is_number):
27579 (JSC::Machine::cti_op_is_string):
27580 (JSC::Machine::cti_op_is_object):
27581 (JSC::Machine::cti_op_is_function):
27582 (JSC::Machine::cti_op_stricteq):
27583 (JSC::Machine::cti_op_nstricteq):
27584 (JSC::Machine::cti_op_to_jsnumber):
27585 (JSC::Machine::cti_op_in):
27586 (JSC::Machine::cti_op_push_new_scope):
27587 (JSC::Machine::cti_op_del_by_val):
27588 (JSC::Machine::cti_op_new_error):
27589 (JSC::Machine::cti_vm_throw):
27590 Change these functions to return pointer types, and never
27591 JSValuePtr.
27592 * VM/Machine.h: Ditto.
27593
27594 2008-10-20 Geoffrey Garen <ggaren@apple.com>
27595
27596 Reviewed by Darin Adler.
27597
27598 Fixed some recent break-age in bytecode mode.
27599
27600 * VM/CodeBlock.cpp:
27601 (JSC::CodeBlock::printStructureIDs): Fixed up an ASSERT caused by
27602 Gavin's last checkin. This is a temporary fix so I can keep on moving.
27603 I'll send email about what I think is an underlying problem soon.
27604
27605 * VM/Machine.cpp:
27606 (JSC::Machine::privateExecute): Removed a redundant and sometimes
27607 incorrect cast, which started ASSERTing after Darin's last checkin.
27608
27609 2008-10-20 Darin Adler <darin@apple.com>
27610
27611 - another similar Windows build fix
27612
27613 * VM/CTI.cpp: Changed return type to JSObject* instead of JSValuePtr.
27614
27615 2008-10-20 Darin Adler <darin@apple.com>
27616
27617 - try to fix Windows build
27618
27619 * VM/CTI.cpp: Use JSValue* instead of JSValuePtr for ctiTrampoline.
27620 * VM/CTI.h: Ditto.
27621
27622 2008-10-19 Darin Adler <darin@apple.com>
27623
27624 Reviewed by Cameron Zwarich.
27625
27626 - finish https://bugs.webkit.org/show_bug.cgi?id=21732
27627 improve performance by eliminating JSValue as a base class for JSCell
27628
27629 * VM/Machine.cpp:
27630 (JSC::Machine::cti_op_call_profiler): Use asFunction.
27631 (JSC::Machine::cti_vm_lazyLinkCall): Ditto.
27632 (JSC::Machine::cti_op_construct_JSConstructFast): Use asObject.
27633
27634 * kjs/JSCell.h: Re-sort friend classes. Eliminate inheritance from
27635 JSValue. Changed cast in asCell from static_cast to reinterpret_cast.
27636 Removed JSValue::getNumber(double&) and one of JSValue::getObject
27637 overloads.
27638
27639 * kjs/JSValue.h: Made the private constructor and destructor both
27640 non-virtual and also remove the definitions. This class can never
27641 be instantiated or derived.
27642
27643 2008-10-19 Darin Adler <darin@apple.com>
27644
27645 Reviewed by Cameron Zwarich.
27646
27647 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
27648 improve performance by eliminating JSValue as a base class for JSCell
27649
27650 Change JSValuePtr from a typedef into a class. This allows us to support
27651 conversion from JSCell* to JSValuePtr even if JSCell isn't derived from
27652 JSValue.
27653
27654 * JavaScriptCore.exp: Updated symbols that involve JSValuePtr, since
27655 it's now a distinct type.
27656
27657 * API/APICast.h:
27658 (toRef): Extract the JSValuePtr payload explicitly since we can't just
27659 cast any more.
27660 * VM/CTI.cpp:
27661 (JSC::CTI::asInteger): Ditto.
27662
27663 * VM/CodeGenerator.cpp:
27664 (JSC::CodeGenerator::addConstant): Get at the payload directly.
27665 (JSC::CodeGenerator::emitLoad): Added an overload of JSCell* because
27666 otherwise classes derived from JSValue end up calling the bool
27667 overload instead of JSValuePtr.
27668 * VM/CodeGenerator.h: Ditto. Also update traits to use JSValue*
27669 and the payload functions.
27670
27671 * VM/Register.h: Added a JSCell* overload and use of payload functions.
27672
27673 * kjs/JSCell.h:
27674 (JSC::asCell): Use payload function.
27675 (JSC::JSValue::asCell): Use JSValue* instead of JSValuePtr.
27676 (JSC::JSValuePtr::JSValuePtr): Added. Constructor that takes JSCell*
27677 and creates a JSValuePtr.
27678
27679 * kjs/JSImmediate.h: Added JSValuePtr class. Also updated makeValue
27680 and makeInt to work with JSValue* and the payload function.
27681
27682 * kjs/JSValue.h: Added == and != operators for JSValuePtr. Put them
27683 here because eventually all the JSValue functions should go here
27684 except what's needed by JSImmediate. Also fix asValue to use
27685 JSValue* instead of JSValuePtr.
27686
27687 * kjs/PropertySlot.h: Change constructor to take JSValuePtr.
27688
27689 * kjs/protect.h: Update gcProtect functions to work with JSCell*
27690 as well as JSValuePtr. Also updated the ProtectedPtr<JSValuePtr>
27691 specialization to work more directly. Also changed all the call
27692 sites to use gcProtectNullTolerant.
27693
27694 2008-10-19 Darin Adler <darin@apple.com>
27695
27696 Reviewed by Oliver Hunt.
27697
27698 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
27699 improve performance by eliminating JSValue as a base class for JSCell
27700
27701 Remove most uses of JSValue, which will be removed in a future patch.
27702
27703 * VM/Machine.cpp:
27704 (JSC::fastToUInt32): Call toUInt32SlowCase function; no longer a member
27705 of JSValue.
27706 * kjs/JSNumberCell.h:
27707 (JSC::JSNumberCell::toInt32): Ditto.
27708 (JSC::JSNumberCell::toUInt32): Ditto.
27709
27710 * kjs/JSValue.cpp:
27711 (JSC::toInt32SlowCase): Made a non-member function.
27712 (JSC::JSValue::toInt32SlowCase): Changed to call non-member function.
27713 (JSC::toUInt32SlowCase): More of the same.
27714 (JSC::JSValue::toUInt32SlowCase): Ditto.
27715
27716 * kjs/JSValue.h: Moved static member function so they are no longer
27717 member functions at all.
27718
27719 * VM/CTI.h: Removed forward declaration of JSValue.
27720 * VM/ExceptionHelpers.h: Ditto.
27721 * kjs/CallData.h: Ditto.
27722 * kjs/ConstructData.h: Ditto.
27723 * kjs/JSGlobalObjectFunctions.h: Ditto.
27724 * kjs/PropertyMap.h: Ditto.
27725 * kjs/StructureID.h: Ditto.
27726 * kjs/collector.h: Ditto.
27727 * kjs/completion.h: Ditto.
27728
27729 * kjs/grammar.y:
27730 (JSC::makeBitwiseNotNode): Call new non-member toInt32 function.
27731 (JSC::makeLeftShiftNode): More of the same.
27732 (JSC::makeRightShiftNode): Ditto.
27733
27734 * kjs/protect.h: Added a specialization for ProtectedPtr<JSValuePtr>
27735 so this can be used with JSValuePtr.
27736
27737 2008-10-18 Darin Adler <darin@apple.com>
27738
27739 Reviewed by Oliver Hunt.
27740
27741 - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
27742 improve performance by eliminating JSValue as a base class for JSCell
27743
27744 Tweak a little more to get closer to where we can make JSValuePtr a class.
27745
27746 * API/APICast.h:
27747 (toJS): Change back to JSValue* here, since we're converting the
27748 pointer type.
27749 * VM/CTI.cpp:
27750 (JSC::CTI::unlinkCall): Call asPointer.
27751 * VM/CTI.h: Cast to JSValue* here, since it's a pointer cast.
27752 * kjs/DebuggerCallFrame.h:
27753 (JSC::DebuggerCallFrame::DebuggerCallFrame): Call noValue.
27754 * kjs/JSGlobalData.cpp:
27755 (JSC::JSGlobalData::JSGlobalData): Call noValue.
27756 * kjs/JSImmediate.cpp:
27757 (JSC::JSImmediate::toObject): Remove unneeded const_cast.
27758 * kjs/JSWrapperObject.h:
27759 (JSC::JSWrapperObject::JSWrapperObject): Call noValue.
27760
27761 2008-10-18 Darin Adler <darin@apple.com>
27762
27763 - fix non-all-in-one build
27764
27765 * kjs/completion.h:
27766 (JSC::Completion::Completion): Add include of JSValue.h.
27767
27768 2008-10-18 Darin Adler <darin@apple.com>
27769
27770 Reviewed by Oliver Hunt.
27771
27772 - fix assertions I introduced with my casting changes
27773
27774 These were showing up as failures in the JavaScriptCore tests.
27775
27776 * VM/Machine.cpp:
27777 (JSC::Machine::cti_op_instanceof): Remove the bogus asCell casting that
27778 was at the top of the function, and instead cast at the point of use.
27779 (JSC::Machine::cti_op_construct_NotJSConstruct): Moved the cast to
27780 object after checking the construct type.
27781
27782 2008-10-18 Darin Adler <darin@apple.com>
27783
27784 - fix non-all-in-one build
27785
27786 * kjs/JSGlobalObjectFunctions.h: Add include of JSImmedate.h (for now).
27787
27788 2008-10-18 Darin Adler <darin@apple.com>
27789
27790 - fix build
27791
27792 * kjs/interpreter.h: Include JSValue.h instead of JSImmediate.h.
27793
27794 2008-10-18 Darin Adler <darin@apple.com>
27795
27796 * kjs/interpreter.h: Fix include of JSImmediate.h.
27797
27798 2008-10-18 Darin Adler <darin@apple.com>
27799
27800 - fix non-all-in-one build
27801
27802 * kjs/interpreter.h: Add include of JSImmediate.h.
27803
27804 2008-10-18 Darin Adler <darin@apple.com>
27805
27806 - fix non-all-in-one build
27807
27808 * kjs/ConstructData.h: Add include of JSImmedate.h (for now).
27809
27810 2008-10-18 Darin Adler <darin@apple.com>
27811
27812 - try to fix Windows build
27813
27814 * VM/Machine.cpp:
27815 (JSC::Machine::Machine): Use JSCell* type since MSVC seems to only allow
27816 calling ~JSCell directly if it's a JSCell*.
27817
27818 2008-10-18 Darin Adler <darin@apple.com>
27819
27820 Reviewed by Cameron Zwarich.
27821
27822 - next step on https://bugs.webkit.org/show_bug.cgi?id=21732
27823 improve performance by eliminating JSValue as a base class for JSCell
27824
27825 Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
27826 changing JSValuePtr to be a class, and then eventually renaming it
27827 to JSValue once that's done.
27828
27829 * JavaScriptCore.exp: Update entry points, since some now take JSValue*
27830 instead of const JSValue*.
27831
27832 * API/APICast.h:
27833 * API/JSCallbackConstructor.h:
27834 * API/JSCallbackFunction.cpp:
27835 * API/JSCallbackFunction.h:
27836 * API/JSCallbackObject.h:
27837 * API/JSCallbackObjectFunctions.h:
27838 * API/JSContextRef.cpp:
27839 * API/JSObjectRef.cpp:
27840 * API/JSValueRef.cpp:
27841 * VM/CTI.cpp:
27842 * VM/CTI.h:
27843 * VM/CodeBlock.cpp:
27844 * VM/CodeBlock.h:
27845 * VM/CodeGenerator.cpp:
27846 * VM/CodeGenerator.h:
27847 * VM/ExceptionHelpers.cpp:
27848 * VM/ExceptionHelpers.h:
27849 * VM/JSPropertyNameIterator.cpp:
27850 * VM/JSPropertyNameIterator.h:
27851 * VM/Machine.cpp:
27852 * VM/Machine.h:
27853 * VM/Register.h:
27854 * kjs/ArgList.cpp:
27855 * kjs/ArgList.h:
27856 * kjs/Arguments.cpp:
27857 * kjs/Arguments.h:
27858 * kjs/ArrayConstructor.cpp:
27859 * kjs/ArrayPrototype.cpp:
27860 * kjs/BooleanConstructor.cpp:
27861 * kjs/BooleanConstructor.h:
27862 * kjs/BooleanObject.h:
27863 * kjs/BooleanPrototype.cpp:
27864 * kjs/CallData.cpp:
27865 * kjs/CallData.h:
27866 * kjs/ConstructData.cpp:
27867 * kjs/ConstructData.h:
27868 * kjs/DateConstructor.cpp:
27869 * kjs/DateInstance.h:
27870 * kjs/DatePrototype.cpp:
27871 * kjs/DebuggerCallFrame.cpp:
27872 * kjs/DebuggerCallFrame.h:
27873 * kjs/ErrorConstructor.cpp:
27874 * kjs/ErrorPrototype.cpp:
27875 * kjs/ExecState.cpp:
27876 * kjs/ExecState.h:
27877 * kjs/FunctionConstructor.cpp:
27878 * kjs/FunctionPrototype.cpp:
27879 * kjs/GetterSetter.cpp:
27880 * kjs/GetterSetter.h:
27881 * kjs/InternalFunction.h:
27882 * kjs/JSActivation.cpp:
27883 * kjs/JSActivation.h:
27884 * kjs/JSArray.cpp:
27885 * kjs/JSArray.h:
27886 * kjs/JSCell.cpp:
27887 * kjs/JSCell.h:
27888 * kjs/JSFunction.cpp:
27889 * kjs/JSFunction.h:
27890 * kjs/JSGlobalData.h:
27891 * kjs/JSGlobalObject.cpp:
27892 * kjs/JSGlobalObject.h:
27893 * kjs/JSGlobalObjectFunctions.cpp:
27894 * kjs/JSGlobalObjectFunctions.h:
27895 * kjs/JSImmediate.cpp:
27896 * kjs/JSImmediate.h:
27897 * kjs/JSNotAnObject.cpp:
27898 * kjs/JSNotAnObject.h:
27899 * kjs/JSNumberCell.cpp:
27900 * kjs/JSNumberCell.h:
27901 * kjs/JSObject.cpp:
27902 * kjs/JSObject.h:
27903 * kjs/JSStaticScopeObject.cpp:
27904 * kjs/JSStaticScopeObject.h:
27905 * kjs/JSString.cpp:
27906 * kjs/JSString.h:
27907 * kjs/JSValue.h:
27908 * kjs/JSVariableObject.h:
27909 * kjs/JSWrapperObject.h:
27910 * kjs/MathObject.cpp:
27911 * kjs/NativeErrorConstructor.cpp:
27912 * kjs/NumberConstructor.cpp:
27913 * kjs/NumberConstructor.h:
27914 * kjs/NumberObject.cpp:
27915 * kjs/NumberObject.h:
27916 * kjs/NumberPrototype.cpp:
27917 * kjs/ObjectConstructor.cpp:
27918 * kjs/ObjectPrototype.cpp:
27919 * kjs/ObjectPrototype.h:
27920 * kjs/PropertyMap.h:
27921 * kjs/PropertySlot.cpp:
27922 * kjs/PropertySlot.h:
27923 * kjs/RegExpConstructor.cpp:
27924 * kjs/RegExpConstructor.h:
27925 * kjs/RegExpMatchesArray.h:
27926 * kjs/RegExpObject.cpp:
27927 * kjs/RegExpObject.h:
27928 * kjs/RegExpPrototype.cpp:
27929 * kjs/Shell.cpp:
27930 * kjs/StringConstructor.cpp:
27931 * kjs/StringObject.cpp:
27932 * kjs/StringObject.h:
27933 * kjs/StringObjectThatMasqueradesAsUndefined.h:
27934 * kjs/StringPrototype.cpp:
27935 * kjs/StructureID.cpp:
27936 * kjs/StructureID.h:
27937 * kjs/collector.cpp:
27938 * kjs/collector.h:
27939 * kjs/completion.h:
27940 * kjs/grammar.y:
27941 * kjs/interpreter.cpp:
27942 * kjs/interpreter.h:
27943 * kjs/lookup.cpp:
27944 * kjs/lookup.h:
27945 * kjs/nodes.h:
27946 * kjs/operations.cpp:
27947 * kjs/operations.h:
27948 * kjs/protect.h:
27949 * profiler/ProfileGenerator.cpp:
27950 Replace JSValue* with JSValuePtr.
27951
27952 2008-10-18 Darin Adler <darin@apple.com>
27953
27954 * VM/Machine.cpp:
27955 (JSC::Machine::cti_op_call_eval): Removed stray parentheses from my
27956 last check-in.
27957
27958 2008-10-18 Darin Adler <darin@apple.com>
27959
27960 Reviewed by Oliver Hunt.
27961
27962 - first step of https://bugs.webkit.org/show_bug.cgi?id=21732
27963 improve performance by eliminating JSValue as a base class for JSCell
27964
27965 Remove casts from JSValue* to derived classes, replacing them with
27966 calls to inline casting functions. These functions are also a bit
27967 better than aidrect cast because they also do a runtime assertion.
27968
27969 Removed use of 0 as for JSValue*, changing call sites to use a
27970 noValue() function instead.
27971
27972 Move things needed by classes derived from JSValue out of the class,
27973 since the classes won't be deriving from JSValue any more soon.
27974
27975 I did most of these changes by changing JSValue to not be JSValue* any
27976 more, then fixing a lot of the compilation problems, then rolling out
27977 the JSValue change.
27978
27979 1.011x as fast on SunSpider (presumably due to some of the Machine.cpp changes)
27980
27981 * API/APICast.h: Removed unneeded forward declarations.
27982
27983 * API/JSCallbackObject.h: Added an asCallbackObject function for casting.
27984 * API/JSCallbackObjectFunctions.h:
27985 (JSC::JSCallbackObject::asCallbackObject): Added.
27986 (JSC::JSCallbackObject::getOwnPropertySlot): Use asObject.
27987 (JSC::JSCallbackObject::call): Use noValue.
27988 (JSC::JSCallbackObject::staticValueGetter): Use asCallbackObject.
27989 (JSC::JSCallbackObject::staticFunctionGetter): Ditto.
27990 (JSC::JSCallbackObject::callbackGetter): Ditto.
27991
27992 * JavaScriptCore.exp: Updated.
27993
27994 * JavaScriptCore.xcodeproj/project.pbxproj: Added RegExpMatchesArray.h.
27995
27996 * VM/CTI.cpp:
27997 (JSC::CTI::asInteger): Added. For use casting a JSValue to an integer.
27998 (JSC::CTI::emitGetArg): Use asInteger.
27999 (JSC::CTI::emitGetPutArg): Ditto.
28000 (JSC::CTI::getConstantImmediateNumericArg): Ditto. Also use noValue.
28001 (JSC::CTI::emitInitRegister): Use asInteger.
28002 (JSC::CTI::getDeTaggedConstantImmediate): Ditto.
28003 (JSC::CTI::compileOpCallInitializeCallFrame): Ditto.
28004 (JSC::CTI::compileOpCall): Ditto.
28005 (JSC::CTI::compileOpStrictEq): Ditto.
28006 (JSC::CTI::privateCompileMainPass): Ditto.
28007 (JSC::CTI::privateCompileGetByIdProto): Ditto.
28008 (JSC::CTI::privateCompileGetByIdChain): Ditto.
28009 (JSC::CTI::privateCompilePutByIdTransition): Ditto.
28010 * VM/CTI.h: Rewrite the ARG-related macros to use C++ casts instead of
28011 C casts and get rid of some extra parentheses. Addd declaration of
28012 asInteger.
28013
28014 * VM/CodeGenerator.cpp:
28015 (JSC::CodeGenerator::emitEqualityOp): Use asString.
28016 (JSC::CodeGenerator::emitLoad): Use noValue.
28017 (JSC::CodeGenerator::findScopedProperty): Change globalObject argument
28018 to JSObject* instead of JSValue*.
28019 (JSC::CodeGenerator::emitResolve): Remove unneeded cast.
28020 (JSC::CodeGenerator::emitGetScopedVar): Use asCell.
28021 (JSC::CodeGenerator::emitPutScopedVar): Ditto.
28022 * VM/CodeGenerator.h: Changed out argument of findScopedProperty.
28023 Also change the JSValueMap to use PtrHash explicitly instead of
28024 getting it from DefaultHash.
28025
28026 * VM/JSPropertyNameIterator.cpp:
28027 (JSC::JSPropertyNameIterator::toPrimitive): Use noValue.
28028 * VM/JSPropertyNameIterator.h:
28029 (JSC::JSPropertyNameIterator::next): Ditto.
28030
28031 * VM/Machine.cpp:
28032 (JSC::fastIsNumber): Moved isImmediate check here instead of
28033 checking for 0 inside Heap::isNumber. Use asCell and asNumberCell.
28034 (JSC::fastToInt32): Ditto.
28035 (JSC::fastToUInt32): Ditto.
28036 (JSC::jsLess): Use asString.
28037 (JSC::jsLessEq): Ditto.
28038 (JSC::jsAdd): Ditto.
28039 (JSC::jsTypeStringForValue): Use asObject.
28040 (JSC::jsIsObjectType): Ditto.
28041 (JSC::jsIsFunctionType): Ditto.
28042 (JSC::inlineResolveBase): Use noValue.
28043 (JSC::Machine::callEval): Use asString. Initialize result to
28044 undefined, not 0.
28045 (JSC::Machine::Machine): Remove unneeded casts to JSCell*.
28046 (JSC::Machine::throwException): Use asObject.
28047 (JSC::Machine::debug): Remove explicit calls to the DebuggerCallFrame
28048 constructor.
28049 (JSC::Machine::checkTimeout): Use noValue.
28050 (JSC::cachePrototypeChain): Use asObject.
28051 (JSC::Machine::tryCachePutByID): Use asCell.
28052 (JSC::Machine::tryCacheGetByID): Use aCell and asObject.
28053 (JSC::Machine::privateExecute): Use noValue, asCell, asObject, asString,
28054 asArray, asActivation, asFunction. Changed code that creates call frames
28055 for host functions to pass 0 for the function pointer -- the call frame
28056 needs a JSFunction* and a host function object is not one. This was
28057 caught by the assertions in the casting functions. Also remove some
28058 unneeded casts in cases where two values are compared.
28059 (JSC::Machine::retrieveLastCaller): Use noValue.
28060 (JSC::Machine::tryCTICachePutByID): Use asCell.
28061 (JSC::Machine::tryCTICacheGetByID): Use aCell and asObject.
28062 (JSC::setUpThrowTrampolineReturnAddress): Added this function to restore
28063 the PIC-branch-avoidance that was recently lost.
28064 (JSC::Machine::cti_op_add): Use asString.
28065 (JSC::Machine::cti_op_instanceof): Use asCell and asObject.
28066 (JSC::Machine::cti_op_call_JSFunction): Use asFunction.
28067 (JSC::Machine::cti_op_call_NotJSFunction): Changed code to pass 0 for
28068 the function pointer, since we don't have a JSFunction. Use asObject.
28069 (JSC::Machine::cti_op_tear_off_activation): Use asActivation.
28070 (JSC::Machine::cti_op_construct_JSConstruct): Use asFunction and asObject.
28071 (JSC::Machine::cti_op_construct_NotJSConstruct): use asObject.
28072 (JSC::Machine::cti_op_get_by_val): Use asArray and asString.
28073 (JSC::Machine::cti_op_resolve_func): Use asPointer; this helps prepare
28074 us for a situation where JSValue is not a pointer.
28075 (JSC::Machine::cti_op_put_by_val): Use asArray.
28076 (JSC::Machine::cti_op_put_by_val_array): Ditto.
28077 (JSC::Machine::cti_op_resolve_global): Use asGlobalObject.
28078 (JSC::Machine::cti_op_post_inc): Change VM_CHECK_EXCEPTION_2 to
28079 VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
28080 that point. Also use asPointer.
28081 (JSC::Machine::cti_op_resolve_with_base): Use asPointer.
28082 (JSC::Machine::cti_op_post_dec): Change VM_CHECK_EXCEPTION_2 to
28083 VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
28084 that point. Also use asPointer.
28085 (JSC::Machine::cti_op_call_eval): Use asObject, noValue, and change
28086 VM_CHECK_EXCEPTION_ARG to VM_THROW_EXCEPTION_AT_END.
28087 (JSC::Machine::cti_op_throw): Change return value to a JSValue*.
28088 (JSC::Machine::cti_op_in): Use asObject.
28089 (JSC::Machine::cti_op_switch_char): Use asString.
28090 (JSC::Machine::cti_op_switch_string): Ditto.
28091 (JSC::Machine::cti_op_put_getter): Use asObject.
28092 (JSC::Machine::cti_op_put_setter): Ditto.
28093 (JSC::Machine::cti_vm_throw): Change return value to a JSValue*.
28094 Use noValue.
28095 * VM/Machine.h: Change return values of both cti_op_throw and
28096 cti_vm_throw to JSValue*.
28097
28098 * VM/Register.h: Remove nullJSValue, which is the same thing
28099 as noValue(). Also removed unneeded definition of JSValue.
28100
28101 * kjs/ArgList.h: Removed unneeded definition of JSValue.
28102
28103 * kjs/Arguments.h:
28104 (JSC::asArguments): Added.
28105
28106 * kjs/ArrayPrototype.cpp:
28107 (JSC::getProperty): Use noValue.
28108 (JSC::arrayProtoFuncToString): Use asArray.
28109 (JSC::arrayProtoFuncToLocaleString): Ditto.
28110 (JSC::arrayProtoFuncConcat): Ditto.
28111 (JSC::arrayProtoFuncPop): Ditto. Also removed unneeded initialization
28112 of the result, which is set in both sides of the branch.
28113 (JSC::arrayProtoFuncPush): Ditto.
28114 (JSC::arrayProtoFuncShift): Removed unneeded initialization
28115 of the result, which is set in both sides of the branch.
28116 (JSC::arrayProtoFuncSort): Use asArray.
28117
28118 * kjs/BooleanObject.h:
28119 (JSC::asBooleanObject): Added.
28120
28121 * kjs/BooleanPrototype.cpp:
28122 (JSC::booleanProtoFuncToString): Use asBooleanObject.
28123 (JSC::booleanProtoFuncValueOf): Ditto.
28124
28125 * kjs/CallData.cpp:
28126 (JSC::call): Use asObject and asFunction.
28127 * kjs/ConstructData.cpp:
28128 (JSC::construct): Ditto.
28129
28130 * kjs/DateConstructor.cpp:
28131 (JSC::constructDate): Use asDateInstance.
28132
28133 * kjs/DateInstance.h:
28134 (JSC::asDateInstance): Added.
28135
28136 * kjs/DatePrototype.cpp:
28137 (JSC::dateProtoFuncToString): Use asDateInstance.
28138 (JSC::dateProtoFuncToUTCString): Ditto.
28139 (JSC::dateProtoFuncToDateString): Ditto.
28140 (JSC::dateProtoFuncToTimeString): Ditto.
28141 (JSC::dateProtoFuncToLocaleString): Ditto.
28142 (JSC::dateProtoFuncToLocaleDateString): Ditto.
28143 (JSC::dateProtoFuncToLocaleTimeString): Ditto.
28144 (JSC::dateProtoFuncValueOf): Ditto.
28145 (JSC::dateProtoFuncGetTime): Ditto.
28146 (JSC::dateProtoFuncGetFullYear): Ditto.
28147 (JSC::dateProtoFuncGetUTCFullYear): Ditto.
28148 (JSC::dateProtoFuncToGMTString): Ditto.
28149 (JSC::dateProtoFuncGetMonth): Ditto.
28150 (JSC::dateProtoFuncGetUTCMonth): Ditto.
28151 (JSC::dateProtoFuncGetDate): Ditto.
28152 (JSC::dateProtoFuncGetUTCDate): Ditto.
28153 (JSC::dateProtoFuncGetDay): Ditto.
28154 (JSC::dateProtoFuncGetUTCDay): Ditto.
28155 (JSC::dateProtoFuncGetHours): Ditto.
28156 (JSC::dateProtoFuncGetUTCHours): Ditto.
28157 (JSC::dateProtoFuncGetMinutes): Ditto.
28158 (JSC::dateProtoFuncGetUTCMinutes): Ditto.
28159 (JSC::dateProtoFuncGetSeconds): Ditto.
28160 (JSC::dateProtoFuncGetUTCSeconds): Ditto.
28161 (JSC::dateProtoFuncGetMilliSeconds): Ditto.
28162 (JSC::dateProtoFuncGetUTCMilliseconds): Ditto.
28163 (JSC::dateProtoFuncGetTimezoneOffset): Ditto.
28164 (JSC::dateProtoFuncSetTime): Ditto.
28165 (JSC::setNewValueFromTimeArgs): Ditto.
28166 (JSC::setNewValueFromDateArgs): Ditto.
28167 (JSC::dateProtoFuncSetYear): Ditto.
28168 (JSC::dateProtoFuncGetYear): Ditto.
28169
28170 * kjs/DebuggerCallFrame.cpp:
28171 (JSC::DebuggerCallFrame::thisObject): Use asObject.
28172 (JSC::DebuggerCallFrame::evaluate): Use noValue.
28173 * kjs/DebuggerCallFrame.h: Added a constructor that
28174 takes only a callFrame.
28175
28176 * kjs/ExecState.h:
28177 (JSC::ExecState::clearException): Use noValue.
28178
28179 * kjs/FunctionPrototype.cpp:
28180 (JSC::functionProtoFuncToString): Use asFunction.
28181 (JSC::functionProtoFuncApply): Use asArguments and asArray.
28182
28183 * kjs/GetterSetter.cpp:
28184 (JSC::GetterSetter::getPrimitiveNumber): Use noValue.
28185
28186 * kjs/GetterSetter.h:
28187 (JSC::asGetterSetter): Added.
28188
28189 * kjs/InternalFunction.cpp:
28190 (JSC::InternalFunction::name): Use asString.
28191
28192 * kjs/InternalFunction.h:
28193 (JSC::asInternalFunction): Added.
28194
28195 * kjs/JSActivation.cpp:
28196 (JSC::JSActivation::argumentsGetter): Use asActivation.
28197
28198 * kjs/JSActivation.h:
28199 (JSC::asActivation): Added.
28200
28201 * kjs/JSArray.cpp:
28202 (JSC::JSArray::putSlowCase): Use noValue.
28203 (JSC::JSArray::deleteProperty): Ditto.
28204 (JSC::JSArray::increaseVectorLength): Ditto.
28205 (JSC::JSArray::setLength): Ditto.
28206 (JSC::JSArray::pop): Ditto.
28207 (JSC::JSArray::sort): Ditto.
28208 (JSC::JSArray::compactForSorting): Ditto.
28209 * kjs/JSArray.h:
28210 (JSC::asArray): Added.
28211
28212 * kjs/JSCell.cpp:
28213 (JSC::JSCell::getJSNumber): Use noValue.
28214
28215 * kjs/JSCell.h:
28216 (JSC::asCell): Added.
28217 (JSC::JSValue::asCell): Changed to not preserve const.
28218 Given the wide use of JSValue* and JSCell*, it's not
28219 really useful to use const.
28220 (JSC::JSValue::isNumber): Use asValue.
28221 (JSC::JSValue::isString): Ditto.
28222 (JSC::JSValue::isGetterSetter): Ditto.
28223 (JSC::JSValue::isObject): Ditto.
28224 (JSC::JSValue::getNumber): Ditto.
28225 (JSC::JSValue::getString): Ditto.
28226 (JSC::JSValue::getObject): Ditto.
28227 (JSC::JSValue::getCallData): Ditto.
28228 (JSC::JSValue::getConstructData): Ditto.
28229 (JSC::JSValue::getUInt32): Ditto.
28230 (JSC::JSValue::getTruncatedInt32): Ditto.
28231 (JSC::JSValue::getTruncatedUInt32): Ditto.
28232 (JSC::JSValue::mark): Ditto.
28233 (JSC::JSValue::marked): Ditto.
28234 (JSC::JSValue::toPrimitive): Ditto.
28235 (JSC::JSValue::getPrimitiveNumber): Ditto.
28236 (JSC::JSValue::toBoolean): Ditto.
28237 (JSC::JSValue::toNumber): Ditto.
28238 (JSC::JSValue::toString): Ditto.
28239 (JSC::JSValue::toObject): Ditto.
28240 (JSC::JSValue::toThisObject): Ditto.
28241 (JSC::JSValue::needsThisConversion): Ditto.
28242 (JSC::JSValue::toThisString): Ditto.
28243 (JSC::JSValue::getJSNumber): Ditto.
28244
28245 * kjs/JSFunction.cpp:
28246 (JSC::JSFunction::argumentsGetter): Use asFunction.
28247 (JSC::JSFunction::callerGetter): Ditto.
28248 (JSC::JSFunction::lengthGetter): Ditto.
28249 (JSC::JSFunction::construct): Use asObject.
28250
28251 * kjs/JSFunction.h:
28252 (JSC::asFunction): Added.
28253
28254 * kjs/JSGlobalObject.cpp:
28255 (JSC::lastInPrototypeChain): Use asObject.
28256
28257 * kjs/JSGlobalObject.h:
28258 (JSC::asGlobalObject): Added.
28259 (JSC::ScopeChainNode::globalObject): Use asGlobalObject.
28260
28261 * kjs/JSImmediate.h: Added noValue, asPointer, and makeValue
28262 functions. Use rawValue, makeValue, and noValue consistently
28263 instead of doing reinterpret_cast in various functions.
28264
28265 * kjs/JSNumberCell.h:
28266 (JSC::asNumberCell): Added.
28267 (JSC::JSValue::uncheckedGetNumber): Use asValue and asNumberCell.
28268 (JSC::JSValue::toJSNumber): Use asValue.
28269
28270 * kjs/JSObject.cpp:
28271 (JSC::JSObject::put): Use asObject and asGetterSetter.
28272 (JSC::callDefaultValueFunction): Use noValue.
28273 (JSC::JSObject::defineGetter): Use asGetterSetter.
28274 (JSC::JSObject::defineSetter): Ditto.
28275 (JSC::JSObject::lookupGetter): Ditto. Also use asObject.
28276 (JSC::JSObject::lookupSetter): Ditto.
28277 (JSC::JSObject::hasInstance): Use asObject.
28278 (JSC::JSObject::fillGetterPropertySlot): Use asGetterSetter.
28279
28280 * kjs/JSObject.h:
28281 (JSC::JSObject::getDirect): Use noValue.
28282 (JSC::asObject): Added.
28283 (JSC::JSValue::isObject): Use asValue.
28284 (JSC::JSObject::get): Removed unneeded const_cast.
28285 (JSC::JSObject::getPropertySlot): Use asObject.
28286 (JSC::JSValue::get): Removed unneeded const_cast.
28287 Use asValue, asCell, and asObject.
28288 (JSC::JSValue::put): Ditto.
28289 (JSC::JSObject::allocatePropertyStorageInline): Fixed spelling
28290 of "oldPropertStorage".
28291
28292 * kjs/JSString.cpp:
28293 (JSC::JSString::getOwnPropertySlot): Use asObject.
28294
28295 * kjs/JSString.h:
28296 (JSC::asString): Added.
28297 (JSC::JSValue::toThisJSString): Use asValue.
28298
28299 * kjs/JSValue.h: Make PreferredPrimitiveType a top level enum
28300 instead of a member of JSValue. Added an asValue function that
28301 returns this. Removed overload of asCell for const. Use asValue
28302 instead of getting right at this.
28303
28304 * kjs/ObjectPrototype.cpp:
28305 (JSC::objectProtoFuncIsPrototypeOf): Use asObject.
28306 (JSC::objectProtoFuncDefineGetter): Ditto.
28307 (JSC::objectProtoFuncDefineSetter): Ditto.
28308
28309 * kjs/PropertySlot.h:
28310 (JSC::PropertySlot::PropertySlot): Take a const JSValue* so the
28311 callers don't have to worry about const.
28312 (JSC::PropertySlot::clearBase): Use noValue.
28313 (JSC::PropertySlot::clearValue): Ditto.
28314
28315 * kjs/RegExpConstructor.cpp:
28316 (JSC::regExpConstructorDollar1): Use asRegExpConstructor.
28317 (JSC::regExpConstructorDollar2): Ditto.
28318 (JSC::regExpConstructorDollar3): Ditto.
28319 (JSC::regExpConstructorDollar4): Ditto.
28320 (JSC::regExpConstructorDollar5): Ditto.
28321 (JSC::regExpConstructorDollar6): Ditto.
28322 (JSC::regExpConstructorDollar7): Ditto.
28323 (JSC::regExpConstructorDollar8): Ditto.
28324 (JSC::regExpConstructorDollar9): Ditto.
28325 (JSC::regExpConstructorInput): Ditto.
28326 (JSC::regExpConstructorMultiline): Ditto.
28327 (JSC::regExpConstructorLastMatch): Ditto.
28328 (JSC::regExpConstructorLastParen): Ditto.
28329 (JSC::regExpConstructorLeftContext): Ditto.
28330 (JSC::regExpConstructorRightContext): Ditto.
28331 (JSC::setRegExpConstructorInput): Ditto.
28332 (JSC::setRegExpConstructorMultiline): Ditto.
28333 (JSC::constructRegExp): Use asObject.
28334
28335 * kjs/RegExpConstructor.h:
28336 (JSC::asRegExpConstructor): Added.
28337
28338 * kjs/RegExpObject.cpp:
28339 (JSC::regExpObjectGlobal): Use asRegExpObject.
28340 (JSC::regExpObjectIgnoreCase): Ditto.
28341 (JSC::regExpObjectMultiline): Ditto.
28342 (JSC::regExpObjectSource): Ditto.
28343 (JSC::regExpObjectLastIndex): Ditto.
28344 (JSC::setRegExpObjectLastIndex): Ditto.
28345 (JSC::callRegExpObject): Ditto.
28346
28347 * kjs/RegExpObject.h:
28348 (JSC::asRegExpObject): Added.
28349
28350 * kjs/RegExpPrototype.cpp:
28351 (JSC::regExpProtoFuncTest): Use asRegExpObject.
28352 (JSC::regExpProtoFuncExec): Ditto.
28353 (JSC::regExpProtoFuncCompile): Ditto.
28354 (JSC::regExpProtoFuncToString): Ditto.
28355
28356 * kjs/StringObject.h:
28357 (JSC::StringObject::internalValue): Use asString.
28358 (JSC::asStringObject): Added.
28359
28360 * kjs/StringPrototype.cpp:
28361 (JSC::stringProtoFuncReplace): Use asRegExpObject.
28362 (JSC::stringProtoFuncToString): Ue asStringObject.
28363 (JSC::stringProtoFuncMatch): Use asRegExpObject.
28364 (JSC::stringProtoFuncSearch): Ditto.
28365 (JSC::stringProtoFuncSplit): Ditto.
28366
28367 * kjs/StructureID.cpp:
28368 (JSC::StructureID::getEnumerablePropertyNames): Use asObject.
28369 (JSC::StructureID::createCachedPrototypeChain): Ditto.
28370 (JSC::StructureIDChain::StructureIDChain): Use asCell and asObject.
28371
28372 * kjs/collector.h:
28373 (JSC::Heap::isNumber): Removed null handling. This can only be called
28374 on valid cells.
28375 (JSC::Heap::cellBlock): Removed overload for const and non-const.
28376 Whether the JSCell* is const or not really should have no effect on
28377 whether you can modify the collector block it's in.
28378
28379 * kjs/interpreter.cpp:
28380 (JSC::Interpreter::evaluate): Use noValue and noObject.
28381
28382 * kjs/nodes.cpp:
28383 (JSC::FunctionCallResolveNode::emitCode): Use JSObject for the global
28384 object rather than JSValue.
28385 (JSC::PostfixResolveNode::emitCode): Ditto.
28386 (JSC::PrefixResolveNode::emitCode): Ditto.
28387 (JSC::ReadModifyResolveNode::emitCode): Ditto.
28388 (JSC::AssignResolveNode::emitCode): Ditto.
28389
28390 * kjs/operations.h:
28391 (JSC::equalSlowCaseInline): Use asString, asCell, asNumberCell,
28392 (JSC::strictEqualSlowCaseInline): Ditto.
28393
28394 2008-10-18 Cameron Zwarich <zwarich@apple.com>
28395
28396 Reviewed by Oliver Hunt.
28397
28398 Bug 21702: Special op_create_activation for the case where there are no named parameters
28399 <https://bugs.webkit.org/show_bug.cgi?id=21702>
28400
28401 This is a 2.5% speedup on the V8 Raytrace benchmark and a 1.1% speedup
28402 on the V8 Earley-Boyer benchmark.
28403
28404 * VM/CTI.cpp:
28405 (JSC::CTI::privateCompileMainPass):
28406 * VM/Machine.cpp:
28407 (JSC::Machine::cti_op_create_arguments_no_params):
28408 * VM/Machine.h:
28409 * kjs/Arguments.h:
28410 (JSC::Arguments::):
28411 (JSC::Arguments::Arguments):
28412
28413 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28414
28415 Reviewed by Cameron Zwarich.
28416
28417 - in debug builds, alter the stack to avoid blowing out MallocStackLogging
28418
28419 (In essence, while executing a CTI function we alter the return
28420 address to jscGeneratedNativeCode so that a single consistent
28421 function is on the stack instead of many random functions without
28422 symbols.)
28423
28424 * VM/CTI.h:
28425 * VM/Machine.cpp:
28426 (JSC::doSetReturnAddress):
28427 (JSC::):
28428 (JSC::StackHack::StackHack):
28429 (JSC::StackHack::~StackHack):
28430 (JSC::Machine::cti_op_convert_this):
28431 (JSC::Machine::cti_op_end):
28432 (JSC::Machine::cti_op_add):
28433 (JSC::Machine::cti_op_pre_inc):
28434 (JSC::Machine::cti_timeout_check):
28435 (JSC::Machine::cti_register_file_check):
28436 (JSC::Machine::cti_op_loop_if_less):
28437 (JSC::Machine::cti_op_loop_if_lesseq):
28438 (JSC::Machine::cti_op_new_object):
28439 (JSC::Machine::cti_op_put_by_id):
28440 (JSC::Machine::cti_op_put_by_id_second):
28441 (JSC::Machine::cti_op_put_by_id_generic):
28442 (JSC::Machine::cti_op_put_by_id_fail):
28443 (JSC::Machine::cti_op_get_by_id):
28444 (JSC::Machine::cti_op_get_by_id_second):
28445 (JSC::Machine::cti_op_get_by_id_generic):
28446 (JSC::Machine::cti_op_get_by_id_fail):
28447 (JSC::Machine::cti_op_instanceof):
28448 (JSC::Machine::cti_op_del_by_id):
28449 (JSC::Machine::cti_op_mul):
28450 (JSC::Machine::cti_op_new_func):
28451 (JSC::Machine::cti_op_call_profiler):
28452 (JSC::Machine::cti_op_call_JSFunction):
28453 (JSC::Machine::cti_vm_lazyLinkCall):
28454 (JSC::Machine::cti_vm_compile):
28455 (JSC::Machine::cti_op_push_activation):
28456 (JSC::Machine::cti_op_call_NotJSFunction):
28457 (JSC::Machine::cti_op_create_arguments):
28458 (JSC::Machine::cti_op_tear_off_activation):
28459 (JSC::Machine::cti_op_tear_off_arguments):
28460 (JSC::Machine::cti_op_ret_profiler):
28461 (JSC::Machine::cti_op_ret_scopeChain):
28462 (JSC::Machine::cti_op_new_array):
28463 (JSC::Machine::cti_op_resolve):
28464 (JSC::Machine::cti_op_construct_JSConstructFast):
28465 (JSC::Machine::cti_op_construct_JSConstruct):
28466 (JSC::Machine::cti_op_construct_NotJSConstruct):
28467 (JSC::Machine::cti_op_get_by_val):
28468 (JSC::Machine::cti_op_resolve_func):
28469 (JSC::Machine::cti_op_sub):
28470 (JSC::Machine::cti_op_put_by_val):
28471 (JSC::Machine::cti_op_put_by_val_array):
28472 (JSC::Machine::cti_op_lesseq):
28473 (JSC::Machine::cti_op_loop_if_true):
28474 (JSC::Machine::cti_op_negate):
28475 (JSC::Machine::cti_op_resolve_base):
28476 (JSC::Machine::cti_op_resolve_skip):
28477 (JSC::Machine::cti_op_resolve_global):
28478 (JSC::Machine::cti_op_div):
28479 (JSC::Machine::cti_op_pre_dec):
28480 (JSC::Machine::cti_op_jless):
28481 (JSC::Machine::cti_op_not):
28482 (JSC::Machine::cti_op_jtrue):
28483 (JSC::Machine::cti_op_post_inc):
28484 (JSC::Machine::cti_op_eq):
28485 (JSC::Machine::cti_op_lshift):
28486 (JSC::Machine::cti_op_bitand):
28487 (JSC::Machine::cti_op_rshift):
28488 (JSC::Machine::cti_op_bitnot):
28489 (JSC::Machine::cti_op_resolve_with_base):
28490 (JSC::Machine::cti_op_new_func_exp):
28491 (JSC::Machine::cti_op_mod):
28492 (JSC::Machine::cti_op_less):
28493 (JSC::Machine::cti_op_neq):
28494 (JSC::Machine::cti_op_post_dec):
28495 (JSC::Machine::cti_op_urshift):
28496 (JSC::Machine::cti_op_bitxor):
28497 (JSC::Machine::cti_op_new_regexp):
28498 (JSC::Machine::cti_op_bitor):
28499 (JSC::Machine::cti_op_call_eval):
28500 (JSC::Machine::cti_op_throw):
28501 (JSC::Machine::cti_op_get_pnames):
28502 (JSC::Machine::cti_op_next_pname):
28503 (JSC::Machine::cti_op_push_scope):
28504 (JSC::Machine::cti_op_pop_scope):
28505 (JSC::Machine::cti_op_typeof):
28506 (JSC::Machine::cti_op_is_undefined):
28507 (JSC::Machine::cti_op_is_boolean):
28508 (JSC::Machine::cti_op_is_number):
28509 (JSC::Machine::cti_op_is_string):
28510 (JSC::Machine::cti_op_is_object):
28511 (JSC::Machine::cti_op_is_function):
28512 (JSC::Machine::cti_op_stricteq):
28513 (JSC::Machine::cti_op_nstricteq):
28514 (JSC::Machine::cti_op_to_jsnumber):
28515 (JSC::Machine::cti_op_in):
28516 (JSC::Machine::cti_op_push_new_scope):
28517 (JSC::Machine::cti_op_jmp_scopes):
28518 (JSC::Machine::cti_op_put_by_index):
28519 (JSC::Machine::cti_op_switch_imm):
28520 (JSC::Machine::cti_op_switch_char):
28521 (JSC::Machine::cti_op_switch_string):
28522 (JSC::Machine::cti_op_del_by_val):
28523 (JSC::Machine::cti_op_put_getter):
28524 (JSC::Machine::cti_op_put_setter):
28525 (JSC::Machine::cti_op_new_error):
28526 (JSC::Machine::cti_op_debug):
28527 (JSC::Machine::cti_vm_throw):
28528
28529 2008-10-17 Gavin Barraclough <barraclough@apple.com>
28530
28531 Optimize op_call by allowing call sites to be directly linked to callees.
28532
28533 For the hot path of op_call, CTI now generates a check (initially for an impossible
28534 value), and the first time the call is executed we attempt to link the call directly
28535 to the callee. We can currently only do so if the arity of the caller and callee
28536 match. The (optimized) setup for the call on the hot path is linked directly to
28537 the ctiCode for the callee, without indirection.
28538
28539 Two forms of the slow case of the call are generated, the first will be executed the
28540 first time the call is reached. As well as this path attempting to link the call to
28541 a callee, it also relinks the slow case to a second slow case, which will not continue
28542 to attempt relinking the call. (This policy could be changed in future, but for not
28543 this is intended to prevent thrashing).
28544
28545 If a callee that the caller has been linked to is garbage collected, then the link
28546 in the caller's JIt code will be reset back to a value that cannot match - to prevent
28547 any false positive matches.
28548
28549 ~20% progression on deltablue & richards, >12% overall reduction in v8-tests
28550 runtime, one or two percent progression on sunspider.
28551
28552 Reviewed by Oliver Hunt.
28553
28554 * VM/CTI.cpp:
28555 (JSC::):
28556 (JSC::CTI::emitNakedCall):
28557 (JSC::unreachable):
28558 (JSC::CTI::compileOpCallInitializeCallFrame):
28559 (JSC::CTI::compileOpCallSetupArgs):
28560 (JSC::CTI::compileOpCall):
28561 (JSC::CTI::privateCompileMainPass):
28562 (JSC::CTI::privateCompileSlowCases):
28563 (JSC::CTI::privateCompile):
28564 (JSC::CTI::unlinkCall):
28565 (JSC::CTI::linkCall):
28566 * VM/CTI.h:
28567 * VM/CodeBlock.cpp:
28568 (JSC::CodeBlock::~CodeBlock):
28569 (JSC::CodeBlock::unlinkCallers):
28570 (JSC::CodeBlock::derefStructureIDs):
28571 * VM/CodeBlock.h:
28572 (JSC::StructureStubInfo::StructureStubInfo):
28573 (JSC::CallLinkInfo::CallLinkInfo):
28574 (JSC::CodeBlock::addCaller):
28575 (JSC::CodeBlock::removeCaller):
28576 (JSC::CodeBlock::getStubInfo):
28577 * VM/CodeGenerator.cpp:
28578 (JSC::CodeGenerator::emitCall):
28579 (JSC::CodeGenerator::emitConstruct):
28580 * VM/Machine.cpp:
28581 (JSC::Machine::cti_op_call_profiler):
28582 (JSC::Machine::cti_op_call_JSFunction):
28583 (JSC::Machine::cti_vm_lazyLinkCall):
28584 (JSC::Machine::cti_op_construct_JSConstructFast):
28585 (JSC::Machine::cti_op_construct_JSConstruct):
28586 (JSC::Machine::cti_op_construct_NotJSConstruct):
28587 * VM/Machine.h:
28588 * kjs/JSFunction.cpp:
28589 (JSC::JSFunction::~JSFunction):
28590 * kjs/JSFunction.h:
28591 * kjs/nodes.h:
28592 (JSC::FunctionBodyNode::):
28593 * masm/X86Assembler.h:
28594 (JSC::X86Assembler::getDifferenceBetweenLabels):
28595
28596 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28597
28598 Reviewed by Geoff Garen.
28599
28600 - remove ASSERT that makes the leaks buildbot cry
28601
28602 * kjs/JSFunction.cpp:
28603 (JSC::JSFunction::JSFunction):
28604
28605 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28606
28607 Reviewed by Cameron Zwarich
28608
28609 - don't bother to do arguments tearoff when it will have no effect
28610
28611 ~1% on v8 raytrace
28612
28613 * VM/CodeGenerator.cpp:
28614 (JSC::CodeGenerator::emitReturn):
28615
28616 2008-10-17 Marco Barisione <marco.barisione@collabora.co.uk>
28617
28618 Reviewed by Sam Weinig. Landed by Jan Alonzo.
28619
28620 https://bugs.webkit.org/show_bug.cgi?id=21603
28621 [GTK] Minor fixes to GOwnPtr
28622
28623 * wtf/GOwnPtr.cpp:
28624 (WTF::GError):
28625 (WTF::GList):
28626 (WTF::GCond):
28627 (WTF::GMutex):
28628 (WTF::GPatternSpec):
28629 (WTF::GDir):
28630 * wtf/GOwnPtr.h:
28631 (WTF::freeOwnedGPtr):
28632 (WTF::GOwnPtr::~GOwnPtr):
28633 (WTF::GOwnPtr::outPtr):
28634 (WTF::GOwnPtr::set):
28635 (WTF::GOwnPtr::clear):
28636 * wtf/Threading.h:
28637
28638 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28639
28640 Reviewed by Cameron Zwarich.
28641
28642 - speed up transitions that resize the property storage a fair bit
28643
28644 ~3% speedup on v8 RayTrace benchmark, ~1% on DeltaBlue
28645
28646 * VM/CTI.cpp:
28647 (JSC::resizePropertyStorage): renamed from transitionObject, and reduced to just resize
28648 the object's property storage with one inline call.
28649 (JSC::CTI::privateCompilePutByIdTransition): Use a separate function for property storage
28650 resize, but still do all the rest of the work in assembly in that case, and pass the known
28651 compile-time constants of old and new size rather than structureIDs, saving a bunch of
28652 redundant memory access.
28653 * kjs/JSObject.cpp:
28654 (JSC::JSObject::allocatePropertyStorage): Just call the inline version.
28655 * kjs/JSObject.h:
28656 (JSC::JSObject::allocatePropertyStorageInline): Inline version of allocatePropertyStorage
28657 * masm/X86Assembler.h:
28658 (JSC::X86Assembler::):
28659 (JSC::X86Assembler::pushl_i32): Add code to assmeble push of a constant; code originally by Cameron Zwarich.
28660
28661 2008-10-17 Cameron Zwarich <zwarich@apple.com>
28662
28663 Reviewed by Maciej Stachowiak.
28664
28665 Remove some C style casts.
28666
28667 * masm/X86Assembler.h:
28668 (JSC::JITCodeBuffer::putIntUnchecked):
28669 (JSC::X86Assembler::link):
28670 (JSC::X86Assembler::linkAbsoluteAddress):
28671 (JSC::X86Assembler::getRelocatedAddress):
28672
28673 2008-10-17 Cameron Zwarich <zwarich@apple.com>
28674
28675 Rubber-stamped by Maciej Stachowiak.
28676
28677 Remove some C style casts.
28678
28679 * VM/CTI.cpp:
28680 (JSC::CTI::patchGetByIdSelf):
28681 (JSC::CTI::patchPutByIdReplace):
28682 * VM/Machine.cpp:
28683 (JSC::Machine::tryCTICachePutByID):
28684 (JSC::Machine::tryCTICacheGetByID):
28685 (JSC::Machine::cti_op_put_by_id):
28686 (JSC::Machine::cti_op_put_by_id_fail):
28687 (JSC::Machine::cti_op_get_by_id):
28688 (JSC::Machine::cti_op_get_by_id_fail):
28689
28690 2008-10-17 Maciej Stachowiak <mjs@apple.com>
28691
28692 Reviewed by Cameron Zwarich.
28693
28694 - Avoid restoring the caller's 'r' value in op_ret
28695 https://bugs.webkit.org/show_bug.cgi?id=21319
28696
28697 This patch stops writing the call frame at call and return points;
28698 instead it does so immediately before any CTI call.
28699
28700 0.5% speedup or so on the v8 benchmark
28701
28702 * VM/CTI.cpp:
28703 (JSC::CTI::emitCTICall):
28704 (JSC::CTI::compileOpCall):
28705 (JSC::CTI::emitSlowScriptCheck):
28706 (JSC::CTI::compileBinaryArithOpSlowCase):
28707 (JSC::CTI::privateCompileMainPass):
28708 (JSC::CTI::privateCompileSlowCases):
28709 (JSC::CTI::privateCompile):
28710 * VM/CTI.h:
28711
28712 2008-10-17 Cameron Zwarich <zwarich@apple.com>
28713
28714 Reviewed by Sam Weinig.
28715
28716 Make WREC require CTI because it won't actually compile otherwise.
28717
28718 * wtf/Platform.h:
28719
28720 2008-10-16 Maciej Stachowiak <mjs@apple.com>
28721
28722 Reviewed by Geoff Garen.
28723
28724 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
28725 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
28726
28727 This time there is no performance regression; we can avoid having
28728 to use the fastcall calling convention for CTI functions by using
28729 varargs to prevent the compiler from moving things around on the
28730 stack.
28731
28732 * Configurations/DebugRelease.xcconfig:
28733 * JavaScriptCore.xcodeproj/project.pbxproj:
28734 * VM/CTI.cpp:
28735 * VM/Machine.h:
28736 * wtf/Platform.h:
28737
28738 2008-10-16 Maciej Stachowiak <mjs@apple.com>
28739
28740 Reviewed by Oliver Hunt.
28741
28742 - fix for REGRESSION: r37631 causing crashes on buildbot
28743 https://bugs.webkit.org/show_bug.cgi?id=21682
28744
28745 * kjs/collector.cpp:
28746 (JSC::Heap::collect): Avoid crashing when a GC occurs while no global objects are live.
28747
28748 2008-10-16 Sam Weinig <sam@webkit.org>
28749
28750 Reviewed by Maciej Stachowiak.
28751
28752 Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
28753 Don't create intermediate StructureIDs for builtin objects
28754
28755 First step in reduce number of StructureIDs created when initializing the
28756 JSGlobalObject.
28757
28758 - In order to avoid creating the intermediate StructureIDs use the new putDirectWithoutTransition
28759 and putDirectFunctionWithoutTransition to add properties to JSObjects without transitioning
28760 the StructureID. This patch just implements this strategy for ObjectPrototype but alone
28761 reduces the number of StructureIDs create for about:blank by 10, from 142 to 132.
28762
28763 * kjs/JSGlobalObject.cpp:
28764 (JSC::JSGlobalObject::reset):
28765 * kjs/JSObject.cpp:
28766 (JSC::JSObject::putDirectFunctionWithoutTransition):
28767 * kjs/JSObject.h:
28768 (JSC::JSObject::putDirectWithoutTransition):
28769 * kjs/ObjectPrototype.cpp:
28770 (JSC::ObjectPrototype::ObjectPrototype):
28771 * kjs/ObjectPrototype.h:
28772 * kjs/StructureID.cpp:
28773 (JSC::StructureID::addPropertyWithoutTransition):
28774 * kjs/StructureID.h:
28775
28776 2008-10-16 Maciej Stachowiak <mjs@apple.com>
28777
28778 Reviewed by Cameron Zwarich.
28779
28780 - fix for: REGRESSION: over 100 StructureIDs leak loading about:blank (result of fix for bug 21633)
28781
28782 Apparent slight progression (< 0.5%) on v8 benchmarks and SunSpider.
28783
28784 * kjs/StructureID.cpp:
28785 (JSC::StructureID::~StructureID): Don't deref this object's parent's pointer to
28786 itself from the destructor; that doesn't even make sense.
28787 (JSC::StructureID::addPropertyTransition): Don't refer the single transition;
28788 the rule is that parent StructureIDs are ref'd but child ones are not. Refing
28789 the child creates a cycle.
28790
28791 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
28792
28793 Reviewed by Darin Adler.
28794
28795 https://bugs.webkit.org/show_bug.cgi?id=21609
28796 Make MessagePorts protect their peers across heaps
28797
28798 * JavaScriptCore.exp:
28799 * kjs/JSGlobalObject.cpp:
28800 (JSC::JSGlobalObject::markCrossHeapDependentObjects):
28801 * kjs/JSGlobalObject.h:
28802 * kjs/collector.cpp:
28803 (JSC::Heap::collect):
28804 Before GC sweep phase, a function supplied by global object is now called for all global
28805 objects in the heap, making it possible to implement cross-heap dependencies.
28806
28807 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
28808
28809 Reviewed by Darin Adler.
28810
28811 https://bugs.webkit.org/show_bug.cgi?id=21610
28812 run-webkit-threads --threaded crashes in StructureID destructor
28813
28814 * kjs/StructureID.cpp:
28815 (JSC::StructureID::StructureID):
28816 (JSC::StructureID::~StructureID):
28817 Protect access to a static (debug-only) HashSet with a lock.
28818
28819 2008-10-15 Sam Weinig <sam@webkit.org>
28820
28821 Reviewed by Goeffrey Garen.
28822
28823 Add function to dump statistics for StructureIDs.
28824
28825 * kjs/StructureID.cpp:
28826 (JSC::StructureID::dumpStatistics):
28827 (JSC::StructureID::StructureID):
28828 (JSC::StructureID::~StructureID):
28829 * kjs/StructureID.h:
28830
28831 2008-10-15 Cameron Zwarich <zwarich@apple.com>
28832
28833 Reviewed by Maciej Stachowiak.
28834
28835 Bug 21633: Avoid using a HashMap when there is only a single transition
28836 <https://bugs.webkit.org/show_bug.cgi?id=21633>
28837
28838 This is a 0.8% speedup on SunSpider and between a 0.5% and 1.0% speedup
28839 on the V8 benchmark suite, depending on which harness we use. It will
28840 also slightly reduce the memory footprint of a StructureID.
28841
28842 * kjs/StructureID.cpp:
28843 (JSC::StructureID::StructureID):
28844 (JSC::StructureID::~StructureID):
28845 (JSC::StructureID::addPropertyTransition):
28846 * kjs/StructureID.h:
28847 (JSC::StructureID::):
28848
28849 2008-10-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
28850
28851 Reviewed by Geoffrey Garen.
28852
28853 1.40% speedup on SunSpider, 1.44% speedup on V8. (Linux)
28854
28855 No change on Mac.
28856
28857 * VM/Machine.cpp:
28858 (JSC::fastIsNumber): ALWAYS_INLINE modifier added.
28859
28860 2008-10-15 Geoffrey Garen <ggaren@apple.com>
28861
28862 Reviewed by Cameron Zwarich.
28863
28864 Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
28865 Start the debugger without reloading the inspected page
28866
28867 * JavaScriptCore.exp: New symbols.
28868 * JavaScriptCore.xcodeproj/project.pbxproj: New files.
28869
28870 * VM/CodeBlock.h:
28871 (JSC::EvalCodeCache::get): Updated for tweak to parsing API.
28872
28873 * kjs/CollectorHeapIterator.h: Added. An iterator for the object heap,
28874 which we use to find all the live functions and recompile them.
28875
28876 * kjs/DebuggerCallFrame.cpp:
28877 (JSC::DebuggerCallFrame::evaluate): Updated for tweak to parsing API.
28878
28879 * kjs/FunctionConstructor.cpp:
28880 (JSC::constructFunction): Updated for tweak to parsing API.
28881
28882 * kjs/JSFunction.cpp:
28883 (JSC::JSFunction::JSFunction): Try to validate our SourceCode in debug
28884 builds by ASSERTing that it's syntactically valid. This doesn't catch
28885 all SourceCode bugs, but it catches a lot of them.
28886
28887 * kjs/JSGlobalObjectFunctions.cpp:
28888 (JSC::globalFuncEval): Updated for tweak to parsing API.
28889
28890 * kjs/Parser.cpp:
28891 (JSC::Parser::parse):
28892 * kjs/Parser.h:
28893 (JSC::Parser::parse): Tweaked the parser to make it possible to parse
28894 without an ExecState, and to allow the client to specify a debugger to
28895 notify (or not) about the source we parse. This allows the inspector
28896 to recompile even though no JavaScript is executing, then notify the
28897 debugger about all source code when it's done.
28898
28899 * kjs/Shell.cpp:
28900 (prettyPrintScript): Updated for tweak to parsing API.
28901
28902 * kjs/SourceRange.h:
28903 (JSC::SourceCode::isNull): Added to help with ASSERTs.
28904
28905 * kjs/collector.cpp:
28906 (JSC::Heap::heapAllocate):
28907 (JSC::Heap::sweep):
28908 (JSC::Heap::primaryHeapBegin):
28909 (JSC::Heap::primaryHeapEnd):
28910 * kjs/collector.h:
28911 (JSC::): Moved a bunch of declarations around to enable compilation of
28912 CollectorHeapIterator.
28913
28914 * kjs/interpreter.cpp:
28915 (JSC::Interpreter::checkSyntax):
28916 (JSC::Interpreter::evaluate): Updated for tweak to parsing API.
28917
28918 * kjs/lexer.h:
28919 (JSC::Lexer::sourceCode): BUG FIX: Calculate SourceCode ranges relative
28920 to the SourceCode range in which we're lexing, otherwise nested functions
28921 that are compiled individually get SourceCode ranges that don't reflect
28922 their nesting.
28923
28924 * kjs/nodes.cpp:
28925 (JSC::FunctionBodyNode::FunctionBodyNode):
28926 (JSC::FunctionBodyNode::finishParsing):
28927 (JSC::FunctionBodyNode::create):
28928 (JSC::FunctionBodyNode::copyParameters):
28929 * kjs/nodes.h:
28930 (JSC::ScopeNode::setSource):
28931 (JSC::FunctionBodyNode::parameterCount): Added some helper functions for
28932 copying one FunctionBodyNode's parameters to another. The recompiler uses
28933 these when calling "finishParsing".
28934
28935 2008-10-15 Joerg Bornemann <joerg.bornemann@trolltech.com>
28936
28937 Reviewed by Darin Adler.
28938
28939 - part of https://bugs.webkit.org/show_bug.cgi?id=20746
28940 Fix compilation on Windows CE.
28941
28942 str(n)icmp, strdup and vsnprintf are not available on Windows CE,
28943 they are called _str(n)icmp, etc. instead
28944
28945 * wtf/StringExtras.h: Added inline function implementations.
28946
28947 2008-10-15 Gabor Loki <loki@inf.u-szeged.hu>
28948
28949 Reviewed by Cameron Zwarich.
28950
28951 <https://bugs.webkit.org/show_bug.cgi?id=20912>
28952 Use simple uint32_t multiplication on op_mul if both operands are
28953 immediate number and they are between zero and 0x7FFF.
28954
28955 * VM/Machine.cpp:
28956 (JSC::Machine::privateExecute):
28957
28958 2008-10-09 Darin Fisher <darin@chromium.org>
28959
28960 Reviewed by Sam Weinig.
28961
28962 Make pan scrolling a platform configurable option.
28963 https://bugs.webkit.org/show_bug.cgi?id=21515
28964
28965 * wtf/Platform.h: Add ENABLE_PAN_SCROLLING
28966
28967 2008-10-14 Maciej Stachowiak <mjs@apple.com>
28968
28969 Rubber stamped by Sam Weinig.
28970
28971 - revert r37572 and r37581 for now
28972
28973 Turns out GCC 4.2 is still a (small) regression, we'll have to do
28974 more work to turn it on.
28975
28976 * Configurations/DebugRelease.xcconfig:
28977 * JavaScriptCore.xcodeproj/project.pbxproj:
28978 * VM/CTI.cpp:
28979 * VM/CTI.h:
28980 * VM/Machine.cpp:
28981 (JSC::Machine::cti_op_convert_this):
28982 (JSC::Machine::cti_op_end):
28983 (JSC::Machine::cti_op_add):
28984 (JSC::Machine::cti_op_pre_inc):
28985 (JSC::Machine::cti_timeout_check):
28986 (JSC::Machine::cti_register_file_check):
28987 (JSC::Machine::cti_op_loop_if_less):
28988 (JSC::Machine::cti_op_loop_if_lesseq):
28989 (JSC::Machine::cti_op_new_object):
28990 (JSC::Machine::cti_op_put_by_id):
28991 (JSC::Machine::cti_op_put_by_id_second):
28992 (JSC::Machine::cti_op_put_by_id_generic):
28993 (JSC::Machine::cti_op_put_by_id_fail):
28994 (JSC::Machine::cti_op_get_by_id):
28995 (JSC::Machine::cti_op_get_by_id_second):
28996 (JSC::Machine::cti_op_get_by_id_generic):
28997 (JSC::Machine::cti_op_get_by_id_fail):
28998 (JSC::Machine::cti_op_instanceof):
28999 (JSC::Machine::cti_op_del_by_id):
29000 (JSC::Machine::cti_op_mul):
29001 (JSC::Machine::cti_op_new_func):
29002 (JSC::Machine::cti_op_call_JSFunction):
29003 (JSC::Machine::cti_vm_compile):
29004 (JSC::Machine::cti_op_push_activation):
29005 (JSC::Machine::cti_op_call_NotJSFunction):
29006 (JSC::Machine::cti_op_create_arguments):
29007 (JSC::Machine::cti_op_tear_off_activation):
29008 (JSC::Machine::cti_op_tear_off_arguments):
29009 (JSC::Machine::cti_op_ret_profiler):
29010 (JSC::Machine::cti_op_ret_scopeChain):
29011 (JSC::Machine::cti_op_new_array):
29012 (JSC::Machine::cti_op_resolve):
29013 (JSC::Machine::cti_op_construct_JSConstruct):
29014 (JSC::Machine::cti_op_construct_NotJSConstruct):
29015 (JSC::Machine::cti_op_get_by_val):
29016 (JSC::Machine::cti_op_resolve_func):
29017 (JSC::Machine::cti_op_sub):
29018 (JSC::Machine::cti_op_put_by_val):
29019 (JSC::Machine::cti_op_put_by_val_array):
29020 (JSC::Machine::cti_op_lesseq):
29021 (JSC::Machine::cti_op_loop_if_true):
29022 (JSC::Machine::cti_op_negate):
29023 (JSC::Machine::cti_op_resolve_base):
29024 (JSC::Machine::cti_op_resolve_skip):
29025 (JSC::Machine::cti_op_resolve_global):
29026 (JSC::Machine::cti_op_div):
29027 (JSC::Machine::cti_op_pre_dec):
29028 (JSC::Machine::cti_op_jless):
29029 (JSC::Machine::cti_op_not):
29030 (JSC::Machine::cti_op_jtrue):
29031 (JSC::Machine::cti_op_post_inc):
29032 (JSC::Machine::cti_op_eq):
29033 (JSC::Machine::cti_op_lshift):
29034 (JSC::Machine::cti_op_bitand):
29035 (JSC::Machine::cti_op_rshift):
29036 (JSC::Machine::cti_op_bitnot):
29037 (JSC::Machine::cti_op_resolve_with_base):
29038 (JSC::Machine::cti_op_new_func_exp):
29039 (JSC::Machine::cti_op_mod):
29040 (JSC::Machine::cti_op_less):
29041 (JSC::Machine::cti_op_neq):
29042 (JSC::Machine::cti_op_post_dec):
29043 (JSC::Machine::cti_op_urshift):
29044 (JSC::Machine::cti_op_bitxor):
29045 (JSC::Machine::cti_op_new_regexp):
29046 (JSC::Machine::cti_op_bitor):
29047 (JSC::Machine::cti_op_call_eval):
29048 (JSC::Machine::cti_op_throw):
29049 (JSC::Machine::cti_op_get_pnames):
29050 (JSC::Machine::cti_op_next_pname):
29051 (JSC::Machine::cti_op_push_scope):
29052 (JSC::Machine::cti_op_pop_scope):
29053 (JSC::Machine::cti_op_typeof):
29054 (JSC::Machine::cti_op_is_undefined):
29055 (JSC::Machine::cti_op_is_boolean):
29056 (JSC::Machine::cti_op_is_number):
29057 (JSC::Machine::cti_op_is_string):
29058 (JSC::Machine::cti_op_is_object):
29059 (JSC::Machine::cti_op_is_function):
29060 (JSC::Machine::cti_op_stricteq):
29061 (JSC::Machine::cti_op_nstricteq):
29062 (JSC::Machine::cti_op_to_jsnumber):
29063 (JSC::Machine::cti_op_in):
29064 (JSC::Machine::cti_op_push_new_scope):
29065 (JSC::Machine::cti_op_jmp_scopes):
29066 (JSC::Machine::cti_op_put_by_index):
29067 (JSC::Machine::cti_op_switch_imm):
29068 (JSC::Machine::cti_op_switch_char):
29069 (JSC::Machine::cti_op_switch_string):
29070 (JSC::Machine::cti_op_del_by_val):
29071 (JSC::Machine::cti_op_put_getter):
29072 (JSC::Machine::cti_op_put_setter):
29073 (JSC::Machine::cti_op_new_error):
29074 (JSC::Machine::cti_op_debug):
29075 (JSC::Machine::cti_vm_throw):
29076 * VM/Machine.h:
29077 * masm/X86Assembler.h:
29078 (JSC::X86Assembler::emitRestoreArgumentReference):
29079 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
29080 * wtf/Platform.h:
29081
29082 2008-10-14 Alexey Proskuryakov <ap@webkit.org>
29083
29084 Reviewed by Darin Adler.
29085
29086 https://bugs.webkit.org/show_bug.cgi?id=20256
29087 Array.push and other standard methods disappear
29088
29089 * kjs/JSGlobalData.cpp:
29090 (JSC::JSGlobalData::JSGlobalData):
29091 (JSC::JSGlobalData::~JSGlobalData):
29092 Don't use static hash tables even on platforms that don't enable JSC_MULTIPLE_THREADS -
29093 these tables reference IdentifierTable, which is always per-GlobalData.
29094
29095 2008-10-14 Maciej Stachowiak <mjs@apple.com>
29096
29097 Reviewed by Cameron Zwarich.
29098
29099 - always use CTI_ARGUMENTS and CTI_ARGUMENTS_FASTCALL
29100
29101 This is a small regression for GCC 4.0, but simplifies the code
29102 for future improvements and lets us focus on GCC 4.2+ and MSVC.
29103
29104 * VM/CTI.cpp:
29105 * VM/CTI.h:
29106 * VM/Machine.cpp:
29107 (JSC::Machine::cti_op_convert_this):
29108 (JSC::Machine::cti_op_end):
29109 (JSC::Machine::cti_op_add):
29110 (JSC::Machine::cti_op_pre_inc):
29111 (JSC::Machine::cti_timeout_check):
29112 (JSC::Machine::cti_register_file_check):
29113 (JSC::Machine::cti_op_loop_if_less):
29114 (JSC::Machine::cti_op_loop_if_lesseq):
29115 (JSC::Machine::cti_op_new_object):
29116 (JSC::Machine::cti_op_put_by_id):
29117 (JSC::Machine::cti_op_put_by_id_second):
29118 (JSC::Machine::cti_op_put_by_id_generic):
29119 (JSC::Machine::cti_op_put_by_id_fail):
29120 (JSC::Machine::cti_op_get_by_id):
29121 (JSC::Machine::cti_op_get_by_id_second):
29122 (JSC::Machine::cti_op_get_by_id_generic):
29123 (JSC::Machine::cti_op_get_by_id_fail):
29124 (JSC::Machine::cti_op_instanceof):
29125 (JSC::Machine::cti_op_del_by_id):
29126 (JSC::Machine::cti_op_mul):
29127 (JSC::Machine::cti_op_new_func):
29128 (JSC::Machine::cti_op_call_JSFunction):
29129 (JSC::Machine::cti_vm_compile):
29130 (JSC::Machine::cti_op_push_activation):
29131 (JSC::Machine::cti_op_call_NotJSFunction):
29132 (JSC::Machine::cti_op_create_arguments):
29133 (JSC::Machine::cti_op_tear_off_activation):
29134 (JSC::Machine::cti_op_tear_off_arguments):
29135 (JSC::Machine::cti_op_ret_profiler):
29136 (JSC::Machine::cti_op_ret_scopeChain):
29137 (JSC::Machine::cti_op_new_array):
29138 (JSC::Machine::cti_op_resolve):
29139 (JSC::Machine::cti_op_construct_JSConstruct):
29140 (JSC::Machine::cti_op_construct_NotJSConstruct):
29141 (JSC::Machine::cti_op_get_by_val):
29142 (JSC::Machine::cti_op_resolve_func):
29143 (JSC::Machine::cti_op_sub):
29144 (JSC::Machine::cti_op_put_by_val):
29145 (JSC::Machine::cti_op_put_by_val_array):
29146 (JSC::Machine::cti_op_lesseq):
29147 (JSC::Machine::cti_op_loop_if_true):
29148 (JSC::Machine::cti_op_negate):
29149 (JSC::Machine::cti_op_resolve_base):
29150 (JSC::Machine::cti_op_resolve_skip):
29151 (JSC::Machine::cti_op_resolve_global):
29152 (JSC::Machine::cti_op_div):
29153 (JSC::Machine::cti_op_pre_dec):
29154 (JSC::Machine::cti_op_jless):
29155 (JSC::Machine::cti_op_not):
29156 (JSC::Machine::cti_op_jtrue):
29157 (JSC::Machine::cti_op_post_inc):
29158 (JSC::Machine::cti_op_eq):
29159 (JSC::Machine::cti_op_lshift):
29160 (JSC::Machine::cti_op_bitand):
29161 (JSC::Machine::cti_op_rshift):
29162 (JSC::Machine::cti_op_bitnot):
29163 (JSC::Machine::cti_op_resolve_with_base):
29164 (JSC::Machine::cti_op_new_func_exp):
29165 (JSC::Machine::cti_op_mod):
29166 (JSC::Machine::cti_op_less):
29167 (JSC::Machine::cti_op_neq):
29168 (JSC::Machine::cti_op_post_dec):
29169 (JSC::Machine::cti_op_urshift):
29170 (JSC::Machine::cti_op_bitxor):
29171 (JSC::Machine::cti_op_new_regexp):
29172 (JSC::Machine::cti_op_bitor):
29173 (JSC::Machine::cti_op_call_eval):
29174 (JSC::Machine::cti_op_throw):
29175 (JSC::Machine::cti_op_get_pnames):
29176 (JSC::Machine::cti_op_next_pname):
29177 (JSC::Machine::cti_op_push_scope):
29178 (JSC::Machine::cti_op_pop_scope):
29179 (JSC::Machine::cti_op_typeof):
29180 (JSC::Machine::cti_op_is_undefined):
29181 (JSC::Machine::cti_op_is_boolean):
29182 (JSC::Machine::cti_op_is_number):
29183 (JSC::Machine::cti_op_is_string):
29184 (JSC::Machine::cti_op_is_object):
29185 (JSC::Machine::cti_op_is_function):
29186 (JSC::Machine::cti_op_stricteq):
29187 (JSC::Machine::cti_op_nstricteq):
29188 (JSC::Machine::cti_op_to_jsnumber):
29189 (JSC::Machine::cti_op_in):
29190 (JSC::Machine::cti_op_push_new_scope):
29191 (JSC::Machine::cti_op_jmp_scopes):
29192 (JSC::Machine::cti_op_put_by_index):
29193 (JSC::Machine::cti_op_switch_imm):
29194 (JSC::Machine::cti_op_switch_char):
29195 (JSC::Machine::cti_op_switch_string):
29196 (JSC::Machine::cti_op_del_by_val):
29197 (JSC::Machine::cti_op_put_getter):
29198 (JSC::Machine::cti_op_put_setter):
29199 (JSC::Machine::cti_op_new_error):
29200 (JSC::Machine::cti_op_debug):
29201 (JSC::Machine::cti_vm_throw):
29202 * VM/Machine.h:
29203 * masm/X86Assembler.h:
29204 (JSC::X86Assembler::emitRestoreArgumentReference):
29205 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
29206 * wtf/Platform.h:
29207
29208 2008-10-13 Maciej Stachowiak <mjs@apple.com>
29209
29210 Reviewed by Cameron Zwarich.
29211
29212 - make Machine::getArgumentsData an Arguments method and inline it
29213
29214 ~2% on v8 raytrace
29215
29216 * VM/Machine.cpp:
29217 * kjs/Arguments.h:
29218 (JSC::Machine::getArgumentsData):
29219
29220 2008-10-13 Alp Toker <alp@nuanti.com>
29221
29222 Fix autotools dist build target by listing recently added header
29223 files only. Not reviewed.
29224
29225 * GNUmakefile.am:
29226
29227 2008-10-13 Maciej Stachowiak <mjs@apple.com>
29228
29229 Rubber stamped by Mark Rowe.
29230
29231 - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
29232 - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
29233
29234 * Configurations/DebugRelease.xcconfig:
29235 * JavaScriptCore.xcodeproj/project.pbxproj:
29236
29237 2008-10-13 Cameron Zwarich <zwarich@apple.com>
29238
29239 Reviewed by Geoff Garen.
29240
29241 Bug 21541: Move RegisterFile growth check to callee
29242 <https://bugs.webkit.org/show_bug.cgi?id=21541>
29243
29244 Move the RegisterFile growth check to the callee in the common case,
29245 where some of the information is known statically at JIT time. There is
29246 still a check in the caller in the case where the caller provides too
29247 few arguments.
29248
29249 This is a 2.1% speedup on the V8 benchmark, including a 5.1% speedup on
29250 the Richards benchmark, a 4.1% speedup on the DeltaBlue benchmark, and a
29251 1.4% speedup on the Earley-Boyer benchmark. It is also a 0.5% speedup on
29252 SunSpider.
29253
29254 * VM/CTI.cpp:
29255 (JSC::CTI::privateCompile):
29256 * VM/Machine.cpp:
29257 (JSC::Machine::cti_register_file_check):
29258 (JSC::Machine::cti_op_call_JSFunction):
29259 (JSC::Machine::cti_op_construct_JSConstruct):
29260 * VM/Machine.h:
29261 * VM/RegisterFile.h:
29262 * masm/X86Assembler.h:
29263 (JSC::X86Assembler::):
29264 (JSC::X86Assembler::cmpl_mr):
29265 (JSC::X86Assembler::emitUnlinkedJg):
29266
29267 2008-10-13 Sam Weinig <sam@webkit.org>
29268
29269 Reviewed by Dan Bernstein.
29270
29271 Fix for https://bugs.webkit.org/show_bug.cgi?id=21577
29272 5 false positive StructureID leaks
29273
29274 - Add leak ignore set to StructureID to selectively ignore leaking some StructureIDs.
29275 - Add create method to JSGlolalData to be used when the data will be intentionally
29276 leaked and ignore all leaks caused the StructureIDs stored in it.
29277
29278 * JavaScriptCore.exp:
29279 * kjs/JSGlobalData.cpp:
29280 (JSC::JSGlobalData::createLeaked):
29281 * kjs/JSGlobalData.h:
29282 * kjs/StructureID.cpp:
29283 (JSC::StructureID::StructureID):
29284 (JSC::StructureID::~StructureID):
29285 (JSC::StructureID::startIgnoringLeaks):
29286 (JSC::StructureID::stopIgnoringLeaks):
29287 * kjs/StructureID.h:
29288
29289 2008-10-13 Marco Barisione <marco.barisione@collabora.co.uk>
29290
29291 Reviewed by Darin Adler. Landed by Jan Alonzo.
29292
29293 WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?)
29294 http://bugs.webkit.org/show_bug.cgi?id=20483
29295
29296 Add a GOwnPtr smart pointer (similar to OwnPtr) to handle memory
29297 allocated by GLib and start the conversion to use it.
29298
29299 * GNUmakefile.am:
29300 * wtf/GOwnPtr.cpp: Added.
29301 (WTF::GError):
29302 (WTF::GList):
29303 (WTF::GCond):
29304 (WTF::GMutex):
29305 (WTF::GPatternSpec):
29306 (WTF::GDir):
29307 * wtf/GOwnPtr.h: Added.
29308 (WTF::freeOwnedPtr):
29309 (WTF::GOwnPtr::GOwnPtr):
29310 (WTF::GOwnPtr::~GOwnPtr):
29311 (WTF::GOwnPtr::get):
29312 (WTF::GOwnPtr::release):
29313 (WTF::GOwnPtr::rawPtr):
29314 (WTF::GOwnPtr::set):
29315 (WTF::GOwnPtr::clear):
29316 (WTF::GOwnPtr::operator*):
29317 (WTF::GOwnPtr::operator->):
29318 (WTF::GOwnPtr::operator!):
29319 (WTF::GOwnPtr::operator UnspecifiedBoolType):
29320 (WTF::GOwnPtr::swap):
29321 (WTF::swap):
29322 (WTF::operator==):
29323 (WTF::operator!=):
29324 (WTF::getPtr):
29325 * wtf/Threading.h:
29326 * wtf/ThreadingGtk.cpp:
29327 (WTF::Mutex::~Mutex):
29328 (WTF::Mutex::lock):
29329 (WTF::Mutex::tryLock):
29330 (WTF::Mutex::unlock):
29331 (WTF::ThreadCondition::~ThreadCondition):
29332 (WTF::ThreadCondition::wait):
29333 (WTF::ThreadCondition::timedWait):
29334 (WTF::ThreadCondition::signal):
29335 (WTF::ThreadCondition::broadcast):
29336
29337 2008-10-12 Gabriella Toth <gtoth@inf.u-szeged.hu>
29338
29339 Reviewed by Darin Adler.
29340
29341 - part of https://bugs.webkit.org/show_bug.cgi?id=21055
29342 Bug 21055: not invoked functions
29343
29344 * kjs/nodes.cpp: Deleted a function that is not invoked:
29345 statementListInitializeVariableAccessStack.
29346
29347 2008-10-12 Darin Adler <darin@apple.com>
29348
29349 Reviewed by Sam Weinig.
29350
29351 * wtf/unicode/icu/UnicodeIcu.h: Fixed indentation to match WebKit coding style.
29352 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
29353
29354 2008-10-12 Darin Adler <darin@apple.com>
29355
29356 Reviewed by Sam Weinig.
29357
29358 - https://bugs.webkit.org/show_bug.cgi?id=21556
29359 Bug 21556: non-ASCII digits are allowed in places where only ASCII should be
29360
29361 * wtf/unicode/icu/UnicodeIcu.h: Removed isDigit, digitValue, and isFormatChar.
29362 * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
29363
29364 2008-10-12 Anders Carlsson <andersca@apple.com>
29365
29366 Reviewed by Darin Adler.
29367
29368 Make the append method that takes a Vector more strict - it now requires the elements
29369 of the vector to be appended same type as the elements of the Vector they're being appended to.
29370
29371 This would cause problems when dealing with Vectors containing other Vectors.
29372
29373 * wtf/Vector.h:
29374 (WTF::::append):
29375
29376 2008-10-11 Cameron Zwarich <zwarich@apple.com>
29377
29378 Reviewed by Sam Weinig.
29379
29380 Clean up RegExpMatchesArray.h to match our coding style.
29381
29382 * kjs/RegExpMatchesArray.h:
29383 (JSC::RegExpMatchesArray::getOwnPropertySlot):
29384 (JSC::RegExpMatchesArray::put):
29385 (JSC::RegExpMatchesArray::deleteProperty):
29386 (JSC::RegExpMatchesArray::getPropertyNames):
29387
29388 2008-10-11 Cameron Zwarich <zwarich@apple.com>
29389
29390 Reviewed by Sam Weinig.
29391
29392 Bug 21525: 55 StructureID leaks on Wikitravel's main page
29393 <https://bugs.webkit.org/show_bug.cgi?id=21525>
29394
29395 Bug 21533: Simple JavaScript code leaks StructureIDs
29396 <https://bugs.webkit.org/show_bug.cgi?id=21533>
29397
29398 StructureID::getEnumerablePropertyNames() ends up calling back to itself
29399 via JSObject::getPropertyNames(), which causes the PropertyNameArray to
29400 be cached twice. This leads to a memory leak in almost every use of
29401 JSObject::getPropertyNames() on an object. The fix here is based on a
29402 suggestion of Sam Weinig.
29403
29404 This patch also fixes every StructureID leaks that occurs while running
29405 the Mozilla MemBuster test.
29406
29407 * kjs/PropertyNameArray.h:
29408 (JSC::PropertyNameArray::PropertyNameArray):
29409 (JSC::PropertyNameArray::setCacheable):
29410 (JSC::PropertyNameArray::cacheable):
29411 * kjs/StructureID.cpp:
29412 (JSC::StructureID::getEnumerablePropertyNames):
29413
29414 2008-10-10 Oliver Hunt <oliver@apple.com>
29415
29416 Reviewed by Cameron Zwarich.
29417
29418 Use fastcall calling convention on GCC > 4.0
29419
29420 Results in a 2-3% improvement in GCC 4.2 performance, so
29421 that it is no longer a regression vs. GCC 4.0
29422
29423 * VM/CTI.cpp:
29424 * VM/Machine.h:
29425 * wtf/Platform.h:
29426
29427 2008-10-10 Sam Weinig <sam@webkit.org>
29428
29429 Reviewed by Darin Adler.
29430
29431 - Add a workaround for a bug in ceil in Darwin libc.
29432 - Remove old workarounds for JS math functions that are not needed
29433 anymore.
29434
29435 The math functions are heavily tested by fast/js/math.html.
29436
29437 * kjs/MathObject.cpp:
29438 (JSC::mathProtoFuncAbs): Remove workaround.
29439 (JSC::mathProtoFuncCeil): Ditto.
29440 (JSC::mathProtoFuncFloor): Ditto.
29441 * wtf/MathExtras.h:
29442 (wtf_ceil): Add ceil workaround for darwin.
29443
29444 2008-10-10 Sam Weinig <sam@webkit.org>
29445
29446 Reviewed by Darin Adler
29447
29448 Add Assertions to JSObject constructor.
29449
29450 * kjs/JSObject.h:
29451 (JSC::JSObject::JSObject):
29452
29453 2008-10-10 Sam Weinig <sam@webkit.org>
29454
29455 Reviewed by Cameron Zwarich.
29456
29457 Remove now unused m_getterSetterFlag variable from PropertyMap.
29458
29459 * kjs/PropertyMap.cpp:
29460 (JSC::PropertyMap::operator=):
29461 * kjs/PropertyMap.h:
29462 (JSC::PropertyMap::PropertyMap):
29463
29464 2008-10-09 Sam Weinig <sam@webkit.org>
29465
29466 Reviewed by Maciej Stachowiak.
29467
29468 Add leaks checking to StructureID.
29469
29470 * kjs/StructureID.cpp:
29471 (JSC::StructureID::StructureID):
29472 (JSC::StructureID::~StructureID):
29473
29474 2008-10-09 Alp Toker <alp@nuanti.com>
29475
29476 Reviewed by Mark Rowe.
29477
29478 https://bugs.webkit.org/show_bug.cgi?id=20760
29479 Implement support for x86 Linux in CTI
29480
29481 Prepare to enable CTI/WREC on supported architectures.
29482
29483 Make it possible to use the CTI_ARGUMENT workaround with GCC as well
29484 as MSVC by fixing some preprocessor conditionals.
29485
29486 Note that CTI/WREC no longer requires CTI_ARGUMENT on Linux so we
29487 don't actually enable it except when building with MSVC. GCC on Win32
29488 remains untested.
29489
29490 Adapt inline ASM code to use the global symbol underscore prefix only
29491 on Darwin and to call the properly mangled Machine::cti_vm_throw
29492 symbol name depending on CTI_ARGUMENT.
29493
29494 Also avoid global inclusion of the JIT infrastructure headers
29495 throughout WebCore and WebKit causing recompilation of about ~1500
29496 source files after modification to X86Assembler.h, CTI.h, WREC.h,
29497 which are only used deep inside JavaScriptCore.
29498
29499 * GNUmakefile.am:
29500 * VM/CTI.cpp:
29501 * VM/CTI.h:
29502 * VM/Machine.cpp:
29503 * VM/Machine.h:
29504 * kjs/regexp.cpp:
29505 (JSC::RegExp::RegExp):
29506 (JSC::RegExp::~RegExp):
29507 (JSC::RegExp::match):
29508 * kjs/regexp.h:
29509 * masm/X86Assembler.h:
29510 (JSC::X86Assembler::emitConvertToFastCall):
29511 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
29512 (JSC::X86Assembler::emitRestoreArgumentReference):
29513
29514 2008-10-09 Gavin Barraclough <barraclough@apple.com>
29515
29516 Reviewed by Cameron Zwarich.
29517
29518 Fix for bug #21160, x=0;1/(x*-1) == -Infinity
29519
29520 * ChangeLog:
29521 * VM/CTI.cpp:
29522 (JSC::CTI::emitFastArithDeTagImmediate):
29523 (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
29524 (JSC::CTI::compileBinaryArithOp):
29525 (JSC::CTI::compileBinaryArithOpSlowCase):
29526 (JSC::CTI::privateCompileMainPass):
29527 (JSC::CTI::privateCompileSlowCases):
29528 * VM/CTI.h:
29529 * masm/X86Assembler.h:
29530 (JSC::X86Assembler::):
29531 (JSC::X86Assembler::emitUnlinkedJs):
29532
29533 2008-10-09 Cameron Zwarich <zwarich@apple.com>
29534
29535 Reviewed by Oliver Hunt.
29536
29537 Bug 21459: REGRESSION (r37324): Safari crashes inside JavaScriptCore while browsing hulu.com
29538 <https://bugs.webkit.org/show_bug.cgi?id=21459>
29539
29540 After r37324, an Arguments object does not mark an associated activation
29541 object. This change was made because Arguments no longer directly used
29542 the activation object in any way. However, if an activation is torn off,
29543 then the backing store of Arguments becomes the register array of the
29544 activation object. Arguments directly marks all of the arguments, but
29545 the activation object is being collected, which causes its register
29546 array to be freed and new memory to be allocated in its place.
29547
29548 Unfortunately, it does not seem possible to reproduce this issue in a
29549 layout test.
29550
29551 * kjs/Arguments.cpp:
29552 (JSC::Arguments::mark):
29553 * kjs/Arguments.h:
29554 (JSC::Arguments::setActivation):
29555 (JSC::Arguments::Arguments):
29556 (JSC::JSActivation::copyRegisters):
29557
29558 2008-10-09 Ariya Hidayat <ariya.hidayat@trolltech.com>
29559
29560 Reviewed by Simon.
29561
29562 Build fix for MinGW.
29563
29564 * wtf/AlwaysInline.h:
29565
29566 2008-10-08 Cameron Zwarich <zwarich@apple.com>
29567
29568 Reviewed by Maciej Stachowiak.
29569
29570 Bug 21497: REGRESSION (r37433): Bytecode JSC tests are severely broken
29571 <https://bugs.webkit.org/show_bug.cgi?id=21497>
29572
29573 Fix a typo in r37433 that causes the failure of a large number of JSC
29574 tests with the bytecode interpreter enabled.
29575
29576 * VM/Machine.cpp:
29577 (JSC::Machine::privateExecute):
29578
29579 2008-10-08 Mark Rowe <mrowe@apple.com>
29580
29581 Windows build fix.
29582
29583 * VM/CTI.cpp:
29584 (JSC::): Update type of argument to ctiTrampoline.
29585
29586 2008-10-08 Darin Adler <darin@apple.com>
29587
29588 Reviewed by Cameron Zwarich.
29589
29590 - https://bugs.webkit.org/show_bug.cgi?id=21403
29591 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
29592
29593 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
29594 client over to the new name.
29595
29596 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
29597 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
29598 accessor functions to get at things in the frame.
29599
29600 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
29601 JSGlobalData* and in other cases eliminating them entirely.
29602
29603 * API/JSObjectRef.cpp:
29604 (JSObjectMakeFunctionWithCallback):
29605 (JSObjectMakeFunction):
29606 (JSObjectHasProperty):
29607 (JSObjectGetProperty):
29608 (JSObjectSetProperty):
29609 (JSObjectDeleteProperty):
29610 * API/OpaqueJSString.cpp:
29611 * API/OpaqueJSString.h:
29612 * VM/CTI.cpp:
29613 (JSC::CTI::getConstant):
29614 (JSC::CTI::emitGetArg):
29615 (JSC::CTI::emitGetPutArg):
29616 (JSC::CTI::getConstantImmediateNumericArg):
29617 (JSC::CTI::printOpcodeOperandTypes):
29618 (JSC::CTI::CTI):
29619 (JSC::CTI::compileOpCall):
29620 (JSC::CTI::compileBinaryArithOp):
29621 (JSC::CTI::privateCompileMainPass):
29622 (JSC::CTI::privateCompile):
29623 (JSC::CTI::privateCompileGetByIdProto):
29624 (JSC::CTI::privateCompileGetByIdChain):
29625 (JSC::CTI::compileRegExp):
29626 * VM/CTI.h:
29627 * VM/CodeBlock.h:
29628 * VM/CodeGenerator.cpp:
29629 (JSC::CodeGenerator::emitEqualityOp):
29630 (JSC::CodeGenerator::emitLoad):
29631 (JSC::CodeGenerator::emitUnexpectedLoad):
29632 (JSC::CodeGenerator::emitConstruct):
29633 * VM/CodeGenerator.h:
29634 * VM/Machine.cpp:
29635 (JSC::jsLess):
29636 (JSC::jsLessEq):
29637 (JSC::jsAddSlowCase):
29638 (JSC::jsAdd):
29639 (JSC::jsTypeStringForValue):
29640 (JSC::Machine::resolve):
29641 (JSC::Machine::resolveSkip):
29642 (JSC::Machine::resolveGlobal):
29643 (JSC::inlineResolveBase):
29644 (JSC::Machine::resolveBase):
29645 (JSC::Machine::resolveBaseAndProperty):
29646 (JSC::Machine::resolveBaseAndFunc):
29647 (JSC::Machine::slideRegisterWindowForCall):
29648 (JSC::isNotObject):
29649 (JSC::Machine::callEval):
29650 (JSC::Machine::dumpCallFrame):
29651 (JSC::Machine::dumpRegisters):
29652 (JSC::Machine::unwindCallFrame):
29653 (JSC::Machine::throwException):
29654 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
29655 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
29656 (JSC::Machine::execute):
29657 (JSC::Machine::debug):
29658 (JSC::Machine::createExceptionScope):
29659 (JSC::cachePrototypeChain):
29660 (JSC::Machine::tryCachePutByID):
29661 (JSC::Machine::tryCacheGetByID):
29662 (JSC::Machine::privateExecute):
29663 (JSC::Machine::retrieveArguments):
29664 (JSC::Machine::retrieveCaller):
29665 (JSC::Machine::retrieveLastCaller):
29666 (JSC::Machine::findFunctionCallFrame):
29667 (JSC::Machine::getArgumentsData):
29668 (JSC::Machine::tryCTICachePutByID):
29669 (JSC::Machine::getCTIArrayLengthTrampoline):
29670 (JSC::Machine::getCTIStringLengthTrampoline):
29671 (JSC::Machine::tryCTICacheGetByID):
29672 (JSC::Machine::cti_op_convert_this):
29673 (JSC::Machine::cti_op_end):
29674 (JSC::Machine::cti_op_add):
29675 (JSC::Machine::cti_op_pre_inc):
29676 (JSC::Machine::cti_timeout_check):
29677 (JSC::Machine::cti_op_loop_if_less):
29678 (JSC::Machine::cti_op_loop_if_lesseq):
29679 (JSC::Machine::cti_op_new_object):
29680 (JSC::Machine::cti_op_put_by_id):
29681 (JSC::Machine::cti_op_put_by_id_second):
29682 (JSC::Machine::cti_op_put_by_id_generic):
29683 (JSC::Machine::cti_op_put_by_id_fail):
29684 (JSC::Machine::cti_op_get_by_id):
29685 (JSC::Machine::cti_op_get_by_id_second):
29686 (JSC::Machine::cti_op_get_by_id_generic):
29687 (JSC::Machine::cti_op_get_by_id_fail):
29688 (JSC::Machine::cti_op_instanceof):
29689 (JSC::Machine::cti_op_del_by_id):
29690 (JSC::Machine::cti_op_mul):
29691 (JSC::Machine::cti_op_new_func):
29692 (JSC::Machine::cti_op_call_JSFunction):
29693 (JSC::Machine::cti_vm_compile):
29694 (JSC::Machine::cti_op_push_activation):
29695 (JSC::Machine::cti_op_call_NotJSFunction):
29696 (JSC::Machine::cti_op_create_arguments):
29697 (JSC::Machine::cti_op_tear_off_activation):
29698 (JSC::Machine::cti_op_tear_off_arguments):
29699 (JSC::Machine::cti_op_ret_profiler):
29700 (JSC::Machine::cti_op_ret_scopeChain):
29701 (JSC::Machine::cti_op_new_array):
29702 (JSC::Machine::cti_op_resolve):
29703 (JSC::Machine::cti_op_construct_JSConstruct):
29704 (JSC::Machine::cti_op_construct_NotJSConstruct):
29705 (JSC::Machine::cti_op_get_by_val):
29706 (JSC::Machine::cti_op_resolve_func):
29707 (JSC::Machine::cti_op_sub):
29708 (JSC::Machine::cti_op_put_by_val):
29709 (JSC::Machine::cti_op_put_by_val_array):
29710 (JSC::Machine::cti_op_lesseq):
29711 (JSC::Machine::cti_op_loop_if_true):
29712 (JSC::Machine::cti_op_negate):
29713 (JSC::Machine::cti_op_resolve_base):
29714 (JSC::Machine::cti_op_resolve_skip):
29715 (JSC::Machine::cti_op_resolve_global):
29716 (JSC::Machine::cti_op_div):
29717 (JSC::Machine::cti_op_pre_dec):
29718 (JSC::Machine::cti_op_jless):
29719 (JSC::Machine::cti_op_not):
29720 (JSC::Machine::cti_op_jtrue):
29721 (JSC::Machine::cti_op_post_inc):
29722 (JSC::Machine::cti_op_eq):
29723 (JSC::Machine::cti_op_lshift):
29724 (JSC::Machine::cti_op_bitand):
29725 (JSC::Machine::cti_op_rshift):
29726 (JSC::Machine::cti_op_bitnot):
29727 (JSC::Machine::cti_op_resolve_with_base):
29728 (JSC::Machine::cti_op_new_func_exp):
29729 (JSC::Machine::cti_op_mod):
29730 (JSC::Machine::cti_op_less):
29731 (JSC::Machine::cti_op_neq):
29732 (JSC::Machine::cti_op_post_dec):
29733 (JSC::Machine::cti_op_urshift):
29734 (JSC::Machine::cti_op_bitxor):
29735 (JSC::Machine::cti_op_new_regexp):
29736 (JSC::Machine::cti_op_bitor):
29737 (JSC::Machine::cti_op_call_eval):
29738 (JSC::Machine::cti_op_throw):
29739 (JSC::Machine::cti_op_get_pnames):
29740 (JSC::Machine::cti_op_next_pname):
29741 (JSC::Machine::cti_op_push_scope):
29742 (JSC::Machine::cti_op_pop_scope):
29743 (JSC::Machine::cti_op_typeof):
29744 (JSC::Machine::cti_op_to_jsnumber):
29745 (JSC::Machine::cti_op_in):
29746 (JSC::Machine::cti_op_push_new_scope):
29747 (JSC::Machine::cti_op_jmp_scopes):
29748 (JSC::Machine::cti_op_put_by_index):
29749 (JSC::Machine::cti_op_switch_imm):
29750 (JSC::Machine::cti_op_switch_char):
29751 (JSC::Machine::cti_op_switch_string):
29752 (JSC::Machine::cti_op_del_by_val):
29753 (JSC::Machine::cti_op_put_getter):
29754 (JSC::Machine::cti_op_put_setter):
29755 (JSC::Machine::cti_op_new_error):
29756 (JSC::Machine::cti_op_debug):
29757 (JSC::Machine::cti_vm_throw):
29758 * VM/Machine.h:
29759 * VM/Register.h:
29760 * VM/RegisterFile.h:
29761 * kjs/Arguments.h:
29762 * kjs/DebuggerCallFrame.cpp:
29763 (JSC::DebuggerCallFrame::functionName):
29764 (JSC::DebuggerCallFrame::type):
29765 (JSC::DebuggerCallFrame::thisObject):
29766 (JSC::DebuggerCallFrame::evaluate):
29767 * kjs/DebuggerCallFrame.h:
29768 * kjs/ExecState.cpp:
29769 (JSC::CallFrame::thisValue):
29770 * kjs/ExecState.h:
29771 * kjs/FunctionConstructor.cpp:
29772 (JSC::constructFunction):
29773 * kjs/JSActivation.cpp:
29774 (JSC::JSActivation::JSActivation):
29775 (JSC::JSActivation::argumentsGetter):
29776 * kjs/JSActivation.h:
29777 * kjs/JSGlobalObject.cpp:
29778 (JSC::JSGlobalObject::init):
29779 * kjs/JSGlobalObjectFunctions.cpp:
29780 (JSC::globalFuncEval):
29781 * kjs/JSVariableObject.h:
29782 * kjs/Parser.cpp:
29783 (JSC::Parser::parse):
29784 * kjs/RegExpConstructor.cpp:
29785 (JSC::constructRegExp):
29786 * kjs/RegExpPrototype.cpp:
29787 (JSC::regExpProtoFuncCompile):
29788 * kjs/Shell.cpp:
29789 (prettyPrintScript):
29790 * kjs/StringPrototype.cpp:
29791 (JSC::stringProtoFuncMatch):
29792 (JSC::stringProtoFuncSearch):
29793 * kjs/identifier.cpp:
29794 (JSC::Identifier::checkSameIdentifierTable):
29795 * kjs/interpreter.cpp:
29796 (JSC::Interpreter::checkSyntax):
29797 (JSC::Interpreter::evaluate):
29798 * kjs/nodes.cpp:
29799 (JSC::ThrowableExpressionData::emitThrowError):
29800 (JSC::RegExpNode::emitCode):
29801 (JSC::ArrayNode::emitCode):
29802 (JSC::InstanceOfNode::emitCode):
29803 * kjs/nodes.h:
29804 * kjs/regexp.cpp:
29805 (JSC::RegExp::RegExp):
29806 (JSC::RegExp::create):
29807 * kjs/regexp.h:
29808 * profiler/HeavyProfile.h:
29809 * profiler/Profile.h:
29810 * wrec/WREC.cpp:
29811 * wrec/WREC.h:
29812
29813 2008-10-08 Mark Rowe <mrowe@apple.com>
29814
29815 Typed by Maciej Stachowiak, reviewed by Mark Rowe.
29816
29817 Fix crash in fast/js/constant-folding.html with CTI disabled.
29818
29819 * VM/Machine.cpp:
29820 (JSC::Machine::privateExecute):
29821
29822 2008-10-08 Timothy Hatcher <timothy@apple.com>
29823
29824 Roll out r37427 because it causes an infinite recursion loading about:blank.
29825
29826 https://bugs.webkit.org/show_bug.cgi?id=21476
29827
29828 2008-10-08 Darin Adler <darin@apple.com>
29829
29830 Reviewed by Cameron Zwarich.
29831
29832 - https://bugs.webkit.org/show_bug.cgi?id=21403
29833 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
29834
29835 Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
29836 client over to the new name.
29837
29838 Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
29839 as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
29840 accessor functions to get at things in the frame.
29841
29842 Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
29843 JSGlobalData* and in other cases eliminating them entirely.
29844
29845 * API/JSObjectRef.cpp:
29846 (JSObjectMakeFunctionWithCallback):
29847 (JSObjectMakeFunction):
29848 (JSObjectHasProperty):
29849 (JSObjectGetProperty):
29850 (JSObjectSetProperty):
29851 (JSObjectDeleteProperty):
29852 * API/OpaqueJSString.cpp:
29853 * API/OpaqueJSString.h:
29854 * VM/CTI.cpp:
29855 (JSC::CTI::getConstant):
29856 (JSC::CTI::emitGetArg):
29857 (JSC::CTI::emitGetPutArg):
29858 (JSC::CTI::getConstantImmediateNumericArg):
29859 (JSC::CTI::printOpcodeOperandTypes):
29860 (JSC::CTI::CTI):
29861 (JSC::CTI::compileOpCall):
29862 (JSC::CTI::compileBinaryArithOp):
29863 (JSC::CTI::privateCompileMainPass):
29864 (JSC::CTI::privateCompile):
29865 (JSC::CTI::privateCompileGetByIdProto):
29866 (JSC::CTI::privateCompileGetByIdChain):
29867 (JSC::CTI::compileRegExp):
29868 * VM/CTI.h:
29869 * VM/CodeBlock.h:
29870 * VM/CodeGenerator.cpp:
29871 (JSC::CodeGenerator::emitEqualityOp):
29872 (JSC::CodeGenerator::emitLoad):
29873 (JSC::CodeGenerator::emitUnexpectedLoad):
29874 (JSC::CodeGenerator::emitConstruct):
29875 * VM/CodeGenerator.h:
29876 * VM/Machine.cpp:
29877 (JSC::jsLess):
29878 (JSC::jsLessEq):
29879 (JSC::jsAddSlowCase):
29880 (JSC::jsAdd):
29881 (JSC::jsTypeStringForValue):
29882 (JSC::Machine::resolve):
29883 (JSC::Machine::resolveSkip):
29884 (JSC::Machine::resolveGlobal):
29885 (JSC::inlineResolveBase):
29886 (JSC::Machine::resolveBase):
29887 (JSC::Machine::resolveBaseAndProperty):
29888 (JSC::Machine::resolveBaseAndFunc):
29889 (JSC::Machine::slideRegisterWindowForCall):
29890 (JSC::isNotObject):
29891 (JSC::Machine::callEval):
29892 (JSC::Machine::dumpCallFrame):
29893 (JSC::Machine::dumpRegisters):
29894 (JSC::Machine::unwindCallFrame):
29895 (JSC::Machine::throwException):
29896 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
29897 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
29898 (JSC::Machine::execute):
29899 (JSC::Machine::debug):
29900 (JSC::Machine::createExceptionScope):
29901 (JSC::cachePrototypeChain):
29902 (JSC::Machine::tryCachePutByID):
29903 (JSC::Machine::tryCacheGetByID):
29904 (JSC::Machine::privateExecute):
29905 (JSC::Machine::retrieveArguments):
29906 (JSC::Machine::retrieveCaller):
29907 (JSC::Machine::retrieveLastCaller):
29908 (JSC::Machine::findFunctionCallFrame):
29909 (JSC::Machine::getArgumentsData):
29910 (JSC::Machine::tryCTICachePutByID):
29911 (JSC::Machine::getCTIArrayLengthTrampoline):
29912 (JSC::Machine::getCTIStringLengthTrampoline):
29913 (JSC::Machine::tryCTICacheGetByID):
29914 (JSC::Machine::cti_op_convert_this):
29915 (JSC::Machine::cti_op_end):
29916 (JSC::Machine::cti_op_add):
29917 (JSC::Machine::cti_op_pre_inc):
29918 (JSC::Machine::cti_timeout_check):
29919 (JSC::Machine::cti_op_loop_if_less):
29920 (JSC::Machine::cti_op_loop_if_lesseq):
29921 (JSC::Machine::cti_op_new_object):
29922 (JSC::Machine::cti_op_put_by_id):
29923 (JSC::Machine::cti_op_put_by_id_second):
29924 (JSC::Machine::cti_op_put_by_id_generic):
29925 (JSC::Machine::cti_op_put_by_id_fail):
29926 (JSC::Machine::cti_op_get_by_id):
29927 (JSC::Machine::cti_op_get_by_id_second):
29928 (JSC::Machine::cti_op_get_by_id_generic):
29929 (JSC::Machine::cti_op_get_by_id_fail):
29930 (JSC::Machine::cti_op_instanceof):
29931 (JSC::Machine::cti_op_del_by_id):
29932 (JSC::Machine::cti_op_mul):
29933 (JSC::Machine::cti_op_new_func):
29934 (JSC::Machine::cti_op_call_JSFunction):
29935 (JSC::Machine::cti_vm_compile):
29936 (JSC::Machine::cti_op_push_activation):
29937 (JSC::Machine::cti_op_call_NotJSFunction):
29938 (JSC::Machine::cti_op_create_arguments):
29939 (JSC::Machine::cti_op_tear_off_activation):
29940 (JSC::Machine::cti_op_tear_off_arguments):
29941 (JSC::Machine::cti_op_ret_profiler):
29942 (JSC::Machine::cti_op_ret_scopeChain):
29943 (JSC::Machine::cti_op_new_array):
29944 (JSC::Machine::cti_op_resolve):
29945 (JSC::Machine::cti_op_construct_JSConstruct):
29946 (JSC::Machine::cti_op_construct_NotJSConstruct):
29947 (JSC::Machine::cti_op_get_by_val):
29948 (JSC::Machine::cti_op_resolve_func):
29949 (JSC::Machine::cti_op_sub):
29950 (JSC::Machine::cti_op_put_by_val):
29951 (JSC::Machine::cti_op_put_by_val_array):
29952 (JSC::Machine::cti_op_lesseq):
29953 (JSC::Machine::cti_op_loop_if_true):
29954 (JSC::Machine::cti_op_negate):
29955 (JSC::Machine::cti_op_resolve_base):
29956 (JSC::Machine::cti_op_resolve_skip):
29957 (JSC::Machine::cti_op_resolve_global):
29958 (JSC::Machine::cti_op_div):
29959 (JSC::Machine::cti_op_pre_dec):
29960 (JSC::Machine::cti_op_jless):
29961 (JSC::Machine::cti_op_not):
29962 (JSC::Machine::cti_op_jtrue):
29963 (JSC::Machine::cti_op_post_inc):
29964 (JSC::Machine::cti_op_eq):
29965 (JSC::Machine::cti_op_lshift):
29966 (JSC::Machine::cti_op_bitand):
29967 (JSC::Machine::cti_op_rshift):
29968 (JSC::Machine::cti_op_bitnot):
29969 (JSC::Machine::cti_op_resolve_with_base):
29970 (JSC::Machine::cti_op_new_func_exp):
29971 (JSC::Machine::cti_op_mod):
29972 (JSC::Machine::cti_op_less):
29973 (JSC::Machine::cti_op_neq):
29974 (JSC::Machine::cti_op_post_dec):
29975 (JSC::Machine::cti_op_urshift):
29976 (JSC::Machine::cti_op_bitxor):
29977 (JSC::Machine::cti_op_new_regexp):
29978 (JSC::Machine::cti_op_bitor):
29979 (JSC::Machine::cti_op_call_eval):
29980 (JSC::Machine::cti_op_throw):
29981 (JSC::Machine::cti_op_get_pnames):
29982 (JSC::Machine::cti_op_next_pname):
29983 (JSC::Machine::cti_op_push_scope):
29984 (JSC::Machine::cti_op_pop_scope):
29985 (JSC::Machine::cti_op_typeof):
29986 (JSC::Machine::cti_op_to_jsnumber):
29987 (JSC::Machine::cti_op_in):
29988 (JSC::Machine::cti_op_push_new_scope):
29989 (JSC::Machine::cti_op_jmp_scopes):
29990 (JSC::Machine::cti_op_put_by_index):
29991 (JSC::Machine::cti_op_switch_imm):
29992 (JSC::Machine::cti_op_switch_char):
29993 (JSC::Machine::cti_op_switch_string):
29994 (JSC::Machine::cti_op_del_by_val):
29995 (JSC::Machine::cti_op_put_getter):
29996 (JSC::Machine::cti_op_put_setter):
29997 (JSC::Machine::cti_op_new_error):
29998 (JSC::Machine::cti_op_debug):
29999 (JSC::Machine::cti_vm_throw):
30000 * VM/Machine.h:
30001 * VM/Register.h:
30002 * VM/RegisterFile.h:
30003 * kjs/Arguments.h:
30004 * kjs/DebuggerCallFrame.cpp:
30005 (JSC::DebuggerCallFrame::functionName):
30006 (JSC::DebuggerCallFrame::type):
30007 (JSC::DebuggerCallFrame::thisObject):
30008 (JSC::DebuggerCallFrame::evaluate):
30009 * kjs/DebuggerCallFrame.h:
30010 * kjs/ExecState.cpp:
30011 (JSC::CallFrame::thisValue):
30012 * kjs/ExecState.h:
30013 * kjs/FunctionConstructor.cpp:
30014 (JSC::constructFunction):
30015 * kjs/JSActivation.cpp:
30016 (JSC::JSActivation::JSActivation):
30017 (JSC::JSActivation::argumentsGetter):
30018 * kjs/JSActivation.h:
30019 * kjs/JSGlobalObject.cpp:
30020 (JSC::JSGlobalObject::init):
30021 * kjs/JSGlobalObjectFunctions.cpp:
30022 (JSC::globalFuncEval):
30023 * kjs/JSVariableObject.h:
30024 * kjs/Parser.cpp:
30025 (JSC::Parser::parse):
30026 * kjs/RegExpConstructor.cpp:
30027 (JSC::constructRegExp):
30028 * kjs/RegExpPrototype.cpp:
30029 (JSC::regExpProtoFuncCompile):
30030 * kjs/Shell.cpp:
30031 (prettyPrintScript):
30032 * kjs/StringPrototype.cpp:
30033 (JSC::stringProtoFuncMatch):
30034 (JSC::stringProtoFuncSearch):
30035 * kjs/identifier.cpp:
30036 (JSC::Identifier::checkSameIdentifierTable):
30037 * kjs/interpreter.cpp:
30038 (JSC::Interpreter::checkSyntax):
30039 (JSC::Interpreter::evaluate):
30040 * kjs/nodes.cpp:
30041 (JSC::ThrowableExpressionData::emitThrowError):
30042 (JSC::RegExpNode::emitCode):
30043 (JSC::ArrayNode::emitCode):
30044 (JSC::InstanceOfNode::emitCode):
30045 * kjs/nodes.h:
30046 * kjs/regexp.cpp:
30047 (JSC::RegExp::RegExp):
30048 (JSC::RegExp::create):
30049 * kjs/regexp.h:
30050 * profiler/HeavyProfile.h:
30051 * profiler/Profile.h:
30052 * wrec/WREC.cpp:
30053 * wrec/WREC.h:
30054
30055 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
30056
30057 Reviewed by Oliver Hunt.
30058
30059 Avoid endless loops when compiling without the computed goto
30060 optimization.
30061
30062 NEXT_OPCODE expands to "continue", which will not work inside
30063 loops.
30064
30065 * VM/Machine.cpp:
30066 (JSC::Machine::privateExecute):
30067
30068 2008-10-08 Maciej Stachowiak <mjs@apple.com>
30069
30070 Reviewed by Oliver Hunt.
30071
30072 Re-landing the following fix with the crashing bug in it fixed (r37405):
30073
30074 - optimize away multiplication by constant 1.0
30075
30076 2.3% speedup on v8 RayTrace benchmark
30077
30078 Apparently it's not uncommon for JavaScript code to multiply by
30079 constant 1.0 in the mistaken belief that this converts integer to
30080 floating point and that there is any operational difference.
30081
30082 * VM/CTI.cpp:
30083 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
30084 case where parameter is already number.
30085 (JSC::CTI::privateCompileSlowCases): ditto
30086 * VM/Machine.cpp:
30087 (JSC::Machine::privateExecute): ditto
30088 * kjs/grammar.y:
30089 (makeMultNode): Transform as follows:
30090 +FOO * BAR ==> FOO * BAR
30091 FOO * +BAR ==> FOO * BAR
30092 FOO * 1 ==> +FOO
30093 1 * FOO ==> +FOO
30094 (makeDivNode): Transform as follows:
30095 +FOO / BAR ==> FOO / BAR
30096 FOO / +BAR ==> FOO / BAR
30097 (makeSubNode): Transform as follows:
30098 +FOO - BAR ==> FOO - BAR
30099 FOO - +BAR ==> FOO - BAR
30100 * kjs/nodes.h:
30101 (JSC::ExpressionNode::stripUnaryPlus): Helper for above
30102 grammar.y changes
30103 (JSC::UnaryPlusNode::stripUnaryPlus): ditto
30104
30105 2008-10-08 Maciej Stachowiak <mjs@apple.com>
30106
30107 Reviewed by Oliver Hunt.
30108
30109 - correctly handle appending -0 to a string, it should stringify as just 0
30110
30111 * kjs/ustring.cpp:
30112 (JSC::concatenate):
30113
30114 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
30115
30116 Reviewed by Simon.
30117
30118 Fix WebKit compilation with VC2008SP1
30119
30120 Apply the TR1 workaround for JavaScriptCore, too.
30121
30122 * JavaScriptCore.pro:
30123
30124 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
30125
30126 Reviewed by Simon.
30127
30128 Fix compilation errors on VS2008 64Bit
30129
30130 * kjs/collector.cpp:
30131 (JSC::currentThreadStackBase):
30132
30133 2008-10-08 André Pönitz <apoenitz@trolltech.com>
30134
30135 Reviewed by Simon.
30136
30137 Fix compilation with Qt namespaces.
30138
30139 * wtf/Threading.h:
30140
30141 2008-10-07 Sam Weinig <sam@webkit.org>
30142
30143 Roll out r37405.
30144
30145 2008-10-07 Oliver Hunt <oliver@apple.com>
30146
30147 Reviewed by Cameron Zwarich.
30148
30149 Switch CTI runtime calls to the fastcall calling convention
30150
30151 Basically this means that we get to store the argument for CTI
30152 calls in the ECX register, which saves a register->memory write
30153 and subsequent memory->register read.
30154
30155 This is a 1.7% progression in SunSpider and 2.4% on commandline
30156 v8 tests on Windows
30157
30158 * VM/CTI.cpp:
30159 (JSC::):
30160 (JSC::CTI::privateCompilePutByIdTransition):
30161 (JSC::CTI::privateCompilePatchGetArrayLength):
30162 * VM/CTI.h:
30163 * VM/Machine.h:
30164 * masm/X86Assembler.h:
30165 (JSC::X86Assembler::emitRestoreArgumentReference):
30166 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
30167 We need this to correctly reload ecx from inside certain property access
30168 trampolines.
30169 * wtf/Platform.h:
30170
30171 2008-10-07 Maciej Stachowiak <mjs@apple.com>
30172
30173 Reviewed by Mark Rowe.
30174
30175 - optimize away multiplication by constant 1.0
30176
30177 2.3% speedup on v8 RayTrace benchmark
30178
30179 Apparently it's not uncommon for JavaScript code to multiply by
30180 constant 1.0 in the mistaken belief that this converts integer to
30181 floating point and that there is any operational difference.
30182
30183 * VM/CTI.cpp:
30184 (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
30185 case where parameter is already number.
30186 (JSC::CTI::privateCompileSlowCases): ditto
30187 * VM/Machine.cpp:
30188 (JSC::Machine::privateExecute): ditto
30189 * kjs/grammar.y:
30190 (makeMultNode): Transform as follows:
30191 +FOO * BAR ==> FOO * BAR
30192 FOO * +BAR ==> FOO * BAR
30193 FOO * 1 ==> +FOO
30194 1 * FOO ==> +FOO
30195 (makeDivNode): Transform as follows:
30196 +FOO / BAR ==> FOO / BAR
30197 FOO / +BAR ==> FOO / BAR
30198 (makeSubNode): Transform as follows:
30199 +FOO - BAR ==> FOO - BAR
30200 FOO - +BAR ==> FOO - BAR
30201 * kjs/nodes.h:
30202 (JSC::ExpressionNode::stripUnaryPlus): Helper for above
30203 grammar.y changes
30204 (JSC::UnaryPlusNode::stripUnaryPlus): ditto
30205
30206 2008-10-07 Maciej Stachowiak <mjs@apple.com>
30207
30208 Reviewed by Oliver Hunt.
30209
30210 - make constant folding code more consistent
30211
30212 Added a makeSubNode to match add, mult and div; use the makeFooNode functions always,
30213 instead of allocating nodes directly in other places in the grammar.
30214
30215 * kjs/grammar.y:
30216
30217 2008-10-07 Sam Weinig <sam@webkit.org>
30218
30219 Reviewed by Cameron Zwarich.
30220
30221 Move hasGetterSetterProperties flag from PropertyMap to StructureID.
30222
30223 * kjs/JSObject.cpp:
30224 (JSC::JSObject::put):
30225 (JSC::JSObject::defineGetter):
30226 (JSC::JSObject::defineSetter):
30227 * kjs/JSObject.h:
30228 (JSC::JSObject::hasGetterSetterProperties):
30229 (JSC::JSObject::getOwnPropertySlotForWrite):
30230 (JSC::JSObject::getOwnPropertySlot):
30231 * kjs/PropertyMap.h:
30232 * kjs/StructureID.cpp:
30233 (JSC::StructureID::StructureID):
30234 (JSC::StructureID::addPropertyTransition):
30235 (JSC::StructureID::toDictionaryTransition):
30236 (JSC::StructureID::changePrototypeTransition):
30237 (JSC::StructureID::getterSetterTransition):
30238 * kjs/StructureID.h:
30239 (JSC::StructureID::hasGetterSetterProperties):
30240 (JSC::StructureID::setHasGetterSetterProperties):
30241
30242 2008-10-07 Sam Weinig <sam@webkit.org>
30243
30244 Reviewed by Cameron Zwarich.
30245
30246 Roll r37370 back in with bug fixes.
30247
30248 - PropertyMap::storageSize() should reflect the number of keys + deletedOffsets
30249 and has nothing to do with the internal deletedSentinel count anymore.
30250
30251 2008-10-07 Gavin Barraclough <barraclough@apple.com>
30252
30253 Reviewed by Oliver Hunt.
30254
30255 Move callframe initialization into JIT code, again.
30256
30257 As a part of the restructuring the second result from functions is now
30258 returned in edx, allowing the new value of 'r' to be returned via a
30259 register, and stored to the stack from JIT code, too.
30260
30261 4.5% progression on v8-tests. (3% in their harness)
30262
30263 * VM/CTI.cpp:
30264 (JSC::):
30265 (JSC::CTI::emitCall):
30266 (JSC::CTI::compileOpCall):
30267 (JSC::CTI::privateCompileMainPass):
30268 (JSC::CTI::privateCompileSlowCases):
30269 (JSC::CTI::privateCompile):
30270 * VM/CTI.h:
30271 (JSC::CallRecord::CallRecord):
30272 * VM/Machine.cpp:
30273 (JSC::Machine::cti_op_call_JSFunction):
30274 (JSC::Machine::cti_op_construct_JSConstruct):
30275 (JSC::Machine::cti_op_resolve_func):
30276 (JSC::Machine::cti_op_post_inc):
30277 (JSC::Machine::cti_op_resolve_with_base):
30278 (JSC::Machine::cti_op_post_dec):
30279 * VM/Machine.h:
30280 * kjs/JSFunction.h:
30281 * kjs/ScopeChain.h:
30282
30283 2008-10-07 Mark Rowe <mrowe@apple.com>
30284
30285 Fix typo in method name.
30286
30287 * wrec/WREC.cpp:
30288 * wrec/WREC.h:
30289
30290 2008-10-07 Cameron Zwarich <zwarich@apple.com>
30291
30292 Rubber-stamped by Mark Rowe.
30293
30294 Roll out r37370.
30295
30296 2008-10-06 Sam Weinig <sam@webkit.org>
30297
30298 Reviewed by Cameron Zwarich.
30299
30300 Fix for https://bugs.webkit.org/show_bug.cgi?id=21415
30301 Improve the division between PropertyStorageArray and PropertyMap
30302
30303 - Rework ProperyMap to store offsets in the value so that they don't
30304 change when rehashing. This allows us not to have to keep the
30305 PropertyStorageArray in sync and thus not have to pass it in.
30306 - Rename PropertyMap::getOffset -> PropertyMap::get since put/remove
30307 now also return offsets.
30308 - A Vector of deleted offsets is now needed since the storage is out of
30309 band.
30310
30311 1% win on SunSpider. Wash on V8 suite.
30312
30313 * JavaScriptCore.exp:
30314 * VM/CTI.cpp:
30315 (JSC::transitionWillNeedStorageRealloc):
30316 * VM/Machine.cpp:
30317 (JSC::Machine::privateExecute):
30318 Transition logic can be greatly simplified by the fact that
30319 the storage capacity is always known, and is correct for the
30320 inline case.
30321 * kjs/JSObject.cpp:
30322 (JSC::JSObject::put): Rename getOffset -> get.
30323 (JSC::JSObject::deleteProperty): Ditto.
30324 (JSC::JSObject::getPropertyAttributes): Ditto.
30325 (JSC::JSObject::removeDirect): Use returned offset to
30326 clear the value in the PropertyNameArray.
30327 (JSC::JSObject::allocatePropertyStorage): Add assert.
30328 * kjs/JSObject.h:
30329 (JSC::JSObject::getDirect): Rename getOffset -> get
30330 (JSC::JSObject::getDirectLocation): Rename getOffset -> get
30331 (JSC::JSObject::putDirect): Use propertyStorageCapacity to determine whether
30332 or not to resize. Also, since put now returns an offset (and thus
30333 addPropertyTransition does also) setting of the PropertyStorageArray is
30334 now done here.
30335 (JSC::JSObject::transitionTo):
30336 * kjs/PropertyMap.cpp:
30337 (JSC::PropertyMap::checkConsistency): PropertyStorageArray is no longer
30338 passed in.
30339 (JSC::PropertyMap::operator=): Copy the delete offsets vector.
30340 (JSC::PropertyMap::put): Instead of setting the PropertyNameArray
30341 explicitly, return the offset where the value should go.
30342 (JSC::PropertyMap::remove): Instead of removing from the PropertyNameArray
30343 explicitly, return the offset where the value should be removed.
30344 (JSC::PropertyMap::get): Switch to using the stored offset, instead
30345 of the implicit one.
30346 (JSC::PropertyMap::insert):
30347 (JSC::PropertyMap::expand): This is never called when m_table is null,
30348 so remove that branch and add it as an assertion.
30349 (JSC::PropertyMap::createTable): Consistency checks no longer take
30350 a PropertyNameArray.
30351 (JSC::PropertyMap::rehash): No need to rehash the PropertyNameArray
30352 now that it is completely out of band.
30353 * kjs/PropertyMap.h:
30354 (JSC::PropertyMapEntry::PropertyMapEntry): Store offset into PropertyNameArray.
30355 (JSC::PropertyMap::get): Switch to using the stored offset, instead
30356 of the implicit one.
30357 * kjs/StructureID.cpp:
30358 (JSC::StructureID::StructureID): Initialize the propertyStorageCapacity to
30359 JSObject::inlineStorageCapacity.
30360 (JSC::StructureID::growPropertyStorageCapacity): Grow the storage capacity as
30361 described below.
30362 (JSC::StructureID::addPropertyTransition): Copy the storage capacity.
30363 (JSC::StructureID::toDictionaryTransition): Ditto.
30364 (JSC::StructureID::changePrototypeTransition): Ditto.
30365 (JSC::StructureID::getterSetterTransition): Ditto.
30366 * kjs/StructureID.h:
30367 (JSC::StructureID::propertyStorageCapacity): Add propertyStorageCapacity
30368 which is the current capacity for the JSObjects PropertyStorageArray.
30369 It starts at the JSObject::inlineStorageCapacity (currently 2), then
30370 when it first needs to be resized moves to the JSObject::nonInlineBaseStorageCapacity
30371 (currently 16), and after that doubles each time.
30372
30373 2008-10-06 Cameron Zwarich <zwarich@apple.com>
30374
30375 Reviewed by Oliver Hunt.
30376
30377 Bug 21396: Remove the OptionalCalleeActivation call frame slot
30378 <https://bugs.webkit.org/show_bug.cgi?id=21396>
30379
30380 Remove the OptionalCalleeActivation call frame slot. We have to be
30381 careful to store the activation object in a register, because objects
30382 in the scope chain do not get marked.
30383
30384 This is a 0.3% speedup on both SunSpider and the V8 benchmark.
30385
30386 * VM/CTI.cpp:
30387 (JSC::CTI::privateCompileMainPass):
30388 * VM/CodeBlock.cpp:
30389 (JSC::CodeBlock::dump):
30390 * VM/CodeGenerator.cpp:
30391 (JSC::CodeGenerator::CodeGenerator):
30392 (JSC::CodeGenerator::emitReturn):
30393 * VM/CodeGenerator.h:
30394 * VM/Machine.cpp:
30395 (JSC::Machine::dumpRegisters):
30396 (JSC::Machine::unwindCallFrame):
30397 (JSC::Machine::privateExecute):
30398 (JSC::Machine::cti_op_call_JSFunction):
30399 (JSC::Machine::cti_op_push_activation):
30400 (JSC::Machine::cti_op_tear_off_activation):
30401 (JSC::Machine::cti_op_construct_JSConstruct):
30402 * VM/Machine.h:
30403 (JSC::Machine::initializeCallFrame):
30404 * VM/RegisterFile.h:
30405 (JSC::RegisterFile::):
30406
30407 2008-10-06 Tony Chang <tony@chromium.org>
30408
30409 Reviewed by Alexey Proskuryakov.
30410
30411 Chromium doesn't use pthreads on windows, so make its use conditional.
30412
30413 Also convert a WORD to a DWORD to avoid a compiler warning. This
30414 matches the other methods around it.
30415
30416 * wtf/ThreadingWin.cpp:
30417 (WTF::wtfThreadEntryPoint):
30418 (WTF::ThreadCondition::broadcast):
30419
30420 2008-10-06 Mark Mentovai <mark@moxienet.com>
30421
30422 Reviewed by Tim Hatcher.
30423
30424 Allow ENABLE_DASHBOARD_SUPPORT and ENABLE_MAC_JAVA_BRIDGE to be
30425 disabled on the Mac.
30426
30427 https://bugs.webkit.org/show_bug.cgi?id=21333
30428
30429 * wtf/Platform.h:
30430
30431 2008-10-06 Steve Falkenburg <sfalken@apple.com>
30432
30433 https://bugs.webkit.org/show_bug.cgi?id=21416
30434 Pass 0 for size to VirtualAlloc, as documented by MSDN.
30435 Identified by Application Verifier.
30436
30437 Reviewed by Darin Adler.
30438
30439 * kjs/collector.cpp:
30440 (KJS::freeBlock):
30441
30442 2008-10-06 Kevin McCullough <kmccullough@apple.com>
30443
30444 Reviewed by Tim Hatcheri and Oliver Hunt.
30445
30446 https://bugs.webkit.org/show_bug.cgi?id=21412
30447 Bug 21412: Refactor user initiated profile count to be more stable
30448 - Export UString::from for use with creating the profile title.
30449
30450 * JavaScriptCore.exp:
30451
30452 2008-10-06 Maciej Stachowiak <mjs@apple.com>
30453
30454 Not reviewed. Build fix.
30455
30456 - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these
30457
30458 * API/JSValueRef.cpp:
30459 (JSValueToBoolean):
30460 * ChangeLog:
30461 * JavaScriptCore.exp:
30462 * VM/CodeBlock.cpp:
30463 (JSC::CodeBlock::dump):
30464 * VM/Machine.cpp:
30465 (JSC::Machine::privateExecute):
30466 (JSC::Machine::cti_op_loop_if_true):
30467 (JSC::Machine::cti_op_not):
30468 (JSC::Machine::cti_op_jtrue):
30469 * kjs/ArrayPrototype.cpp:
30470 (JSC::arrayProtoFuncFilter):
30471 (JSC::arrayProtoFuncEvery):
30472 (JSC::arrayProtoFuncSome):
30473 * kjs/BooleanConstructor.cpp:
30474 (JSC::constructBoolean):
30475 (JSC::callBooleanConstructor):
30476 * kjs/GetterSetter.h:
30477 * kjs/JSCell.h:
30478 (JSC::JSValue::toBoolean):
30479 * kjs/JSNumberCell.cpp:
30480 (JSC::JSNumberCell::toBoolean):
30481 * kjs/JSNumberCell.h:
30482 * kjs/JSObject.cpp:
30483 (JSC::JSObject::toBoolean):
30484 * kjs/JSObject.h:
30485 * kjs/JSString.cpp:
30486 (JSC::JSString::toBoolean):
30487 * kjs/JSString.h:
30488 * kjs/JSValue.h:
30489 * kjs/RegExpConstructor.cpp:
30490 (JSC::setRegExpConstructorMultiline):
30491 * kjs/RegExpObject.cpp:
30492 (JSC::RegExpObject::match):
30493 * kjs/RegExpPrototype.cpp:
30494 (JSC::regExpProtoFuncToString):
30495
30496 2008-10-06 Maciej Stachowiak <mjs@apple.com>
30497
30498 Reviewed by Sam Weinig.
30499
30500 - optimize op_jtrue, op_loop_if_true and op_not in various ways
30501 https://bugs.webkit.org/show_bug.cgi?id=21404
30502
30503 1) Make JSValue::toBoolean nonvirtual and completely inline by
30504 making use of the StructureID type field.
30505
30506 2) Make JSValue::toBoolean not take an ExecState; doesn't need it.
30507
30508 3) Make op_not, op_loop_if_true and op_jtrue not read the
30509 ExecState (toBoolean doesn't need it any more) and not check
30510 exceptions (toBoolean can't throw).
30511
30512 * API/JSValueRef.cpp:
30513 (JSValueToBoolean):
30514 * JavaScriptCore.exp:
30515 * VM/CodeBlock.cpp:
30516 (JSC::CodeBlock::dump):
30517 * VM/Machine.cpp:
30518 (JSC::Machine::privateExecute):
30519 (JSC::Machine::cti_op_loop_if_true):
30520 (JSC::Machine::cti_op_not):
30521 (JSC::Machine::cti_op_jtrue):
30522 * kjs/ArrayPrototype.cpp:
30523 (JSC::arrayProtoFuncFilter):
30524 (JSC::arrayProtoFuncEvery):
30525 (JSC::arrayProtoFuncSome):
30526 * kjs/BooleanConstructor.cpp:
30527 (JSC::constructBoolean):
30528 (JSC::callBooleanConstructor):
30529 * kjs/GetterSetter.h:
30530 * kjs/JSCell.h:
30531 (JSC::JSValue::toBoolean):
30532 * kjs/JSNumberCell.cpp:
30533 * kjs/JSNumberCell.h:
30534 (JSC::JSNumberCell::toBoolean):
30535 * kjs/JSObject.cpp:
30536 * kjs/JSObject.h:
30537 (JSC::JSObject::toBoolean):
30538 (JSC::JSCell::toBoolean):
30539 * kjs/JSString.cpp:
30540 * kjs/JSString.h:
30541 (JSC::JSString::toBoolean):
30542 * kjs/JSValue.h:
30543 * kjs/RegExpConstructor.cpp:
30544 (JSC::setRegExpConstructorMultiline):
30545 * kjs/RegExpObject.cpp:
30546 (JSC::RegExpObject::match):
30547 * kjs/RegExpPrototype.cpp:
30548 (JSC::regExpProtoFuncToString):
30549
30550 2008-10-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
30551
30552 Reviewed by Simon.
30553
30554 Build fix for MinGW.
30555
30556 * JavaScriptCore.pri:
30557 * kjs/DateMath.cpp:
30558 (JSC::highResUpTime):
30559
30560 2008-10-05 Cameron Zwarich <zwarich@apple.com>
30561
30562 Reviewed by Oliver Hunt.
30563
30564 Remove ScopeNode::containsClosures() now that it is unused.
30565
30566 * kjs/nodes.h:
30567 (JSC::ScopeNode::containsClosures):
30568
30569 2008-10-05 Maciej Stachowiak <mjs@apple.com>
30570
30571 Reviewed by Cameron Zwarich.
30572
30573 - fix releas-only test failures caused by the fix to bug 21375
30574
30575 * VM/Machine.cpp:
30576 (JSC::Machine::unwindCallFrame): Update ExecState while unwinding call frames;
30577 it now matters more to have a still-valid ExecState, since dynamicGlobalObject
30578 will make use of the ExecState's scope chain.
30579 * VM/Machine.h:
30580
30581 2008-10-05 Cameron Zwarich <zwarich@apple.com>
30582
30583 Reviewed by Oliver Hunt.
30584
30585 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
30586 <https://bugs.webkit.org/show_bug.cgi?id=21364>
30587
30588 Use information from the parser to detect whether an activation is
30589 needed or 'arguments' is used, and emit explicit instructions to tear
30590 them off before op_ret. This allows a branch to be removed from op_ret
30591 and simplifies some other code. This does cause a small change in the
30592 behaviour of 'f.arguments'; it is no longer live when 'arguments' is not
30593 mentioned in the lexical scope of the function.
30594
30595 It should now be easy to remove the OptionaCalleeActivation slot in the
30596 call frame, but this will be done in a later patch.
30597
30598 * VM/CTI.cpp:
30599 (JSC::CTI::privateCompileMainPass):
30600 * VM/CodeBlock.cpp:
30601 (JSC::CodeBlock::dump):
30602 * VM/CodeGenerator.cpp:
30603 (JSC::CodeGenerator::emitReturn):
30604 * VM/CodeGenerator.h:
30605 * VM/Machine.cpp:
30606 (JSC::Machine::unwindCallFrame):
30607 (JSC::Machine::privateExecute):
30608 (JSC::Machine::retrieveArguments):
30609 (JSC::Machine::cti_op_create_arguments):
30610 (JSC::Machine::cti_op_tear_off_activation):
30611 (JSC::Machine::cti_op_tear_off_arguments):
30612 * VM/Machine.h:
30613 * VM/Opcode.h:
30614 * kjs/Arguments.cpp:
30615 (JSC::Arguments::mark):
30616 * kjs/Arguments.h:
30617 (JSC::Arguments::isTornOff):
30618 (JSC::Arguments::Arguments):
30619 (JSC::Arguments::copyRegisters):
30620 (JSC::JSActivation::copyRegisters):
30621 * kjs/JSActivation.cpp:
30622 (JSC::JSActivation::argumentsGetter):
30623 * kjs/JSActivation.h:
30624
30625 2008-10-05 Maciej Stachowiak <mjs@apple.com>
30626
30627 Reviewed by Oliver Hunt.
30628
30629 - fixed "REGRESSION (r37297): fast/js/deep-recursion-test takes too long and times out"
30630 https://bugs.webkit.org/show_bug.cgi?id=21375
30631
30632 The problem is that dynamicGlobalObject had become O(N) in number
30633 of call frames, but unwinding the stack for an exception called it
30634 for every call frame, resulting in O(N^2) behavior for an
30635 exception thrown from inside deep recursion.
30636
30637 Instead of doing it that way, stash the dynamic global object in JSGlobalData.
30638
30639 * JavaScriptCore.exp:
30640 * VM/Machine.cpp:
30641 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Helper class to temporarily
30642 store and later restore a dynamicGlobalObject in JSGlobalData.
30643 (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
30644 (JSC::Machine::execute): In each version, establish a DynamicGlobalObjectScope.
30645 For ProgramNode, always establish set new dynamicGlobalObject, for FunctionBody and Eval,
30646 only if none is currently set.
30647 * VM/Machine.h:
30648 * kjs/ExecState.h:
30649 * kjs/JSGlobalData.cpp:
30650 (JSC::JSGlobalData::JSGlobalData): Ininitalize new dynamicGlobalObject field to 0.
30651 * kjs/JSGlobalData.h:
30652 * kjs/JSGlobalObject.h:
30653 (JSC::ExecState::dynamicGlobalObject): Moved here from ExecState for benefit of inlining.
30654 Return lexical global object if this is a globalExec(), otherwise look in JSGlobalData
30655 for the one stashed there.
30656
30657 2008-10-05 Sam Weinig <sam@webkit.org>
30658
30659 Reviewed by Maciej Stachowiak.
30660
30661 Avoid an extra lookup when transitioning to an existing StructureID
30662 by caching the offset of property that caused the transition.
30663
30664 1% win on V8 suite. Wash on SunSpider.
30665
30666 * kjs/PropertyMap.cpp:
30667 (JSC::PropertyMap::put):
30668 * kjs/PropertyMap.h:
30669 * kjs/StructureID.cpp:
30670 (JSC::StructureID::StructureID):
30671 (JSC::StructureID::addPropertyTransition):
30672 * kjs/StructureID.h:
30673 (JSC::StructureID::setCachedTransistionOffset):
30674 (JSC::StructureID::cachedTransistionOffset):
30675
30676 2008-10-05 Cameron Zwarich <zwarich@apple.com>
30677
30678 Reviewed by Maciej Stachowiak.
30679
30680 Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
30681 <https://bugs.webkit.org/show_bug.cgi?id=21364>
30682
30683 This patch does not yet remove the branch, but it does a bit of refactoring
30684 so that a CodeGenerator now knows whether the associated CodeBlock will need
30685 a full scope before doing any code generation. This makes it possible to emit
30686 explicit tear-off instructions before every op_ret.
30687
30688 * VM/CodeBlock.h:
30689 (JSC::CodeBlock::CodeBlock):
30690 * VM/CodeGenerator.cpp:
30691 (JSC::CodeGenerator::generate):
30692 (JSC::CodeGenerator::CodeGenerator):
30693 (JSC::CodeGenerator::emitPushScope):
30694 (JSC::CodeGenerator::emitPushNewScope):
30695 * kjs/nodes.h:
30696 (JSC::ScopeNode::needsActivation):
30697
30698 2008-10-05 Gavin Barraclough <barraclough@apple.com>
30699
30700 Reviewed by Cameron Zwarich.
30701
30702 Fix for bug #21387 - using SamplingTool with CTI.
30703
30704 (1) A repatch offset offset changes due to an additional instruction to update SamplingTool state.
30705 (2) Fix an incusion order problem due to ExecState changes.
30706 (3) Change to a MACHINE_SAMPLING macro, use of exec should now be accessing global data.
30707
30708 * VM/CTI.h:
30709 (JSC::CTI::execute):
30710 * VM/SamplingTool.h:
30711 (JSC::SamplingTool::privateExecuteReturned):
30712 * kjs/Shell.cpp:
30713
30714 2008-10-04 Mark Rowe <mrowe@apple.com>
30715
30716 Reviewed by Tim Hatcher.
30717
30718 Add a 'Check For Weak VTables' build phase to catch weak vtables as early as possible.
30719
30720 * JavaScriptCore.xcodeproj/project.pbxproj:
30721
30722 2008-10-04 Sam Weinig <sam@webkit.org>
30723
30724 Reviewed by Oliver Hunt.
30725
30726 Fix https://bugs.webkit.org/show_bug.cgi?id=21320
30727 leaks of PropertyNameArrayData seen on buildbot
30728
30729 - Fix RefPtr cycle by making PropertyNameArrayData's pointer back
30730 to the StructureID a weak pointer.
30731
30732 * kjs/PropertyNameArray.h:
30733 (JSC::PropertyNameArrayData::setCachedStructureID):
30734 (JSC::PropertyNameArrayData::cachedStructureID):
30735 * kjs/StructureID.cpp:
30736 (JSC::StructureID::getEnumerablePropertyNames):
30737 (JSC::StructureID::clearEnumerationCache):
30738 (JSC::StructureID::~StructureID):
30739
30740 2008-10-04 Darin Adler <darin@apple.com>
30741
30742 Reviewed by Cameron Zwarich.
30743
30744 - https://bugs.webkit.org/show_bug.cgi?id=21295
30745 Bug 21295: Replace ExecState with a call frame Register pointer
30746
30747 10% faster on Richards; other v8 benchmarks faster too.
30748 A wash on SunSpider.
30749
30750 This does the minimum necessary to get the speedup. Next step in
30751 cleaning this up is to replace ExecState with a CallFrame class,
30752 and be more judicious about when to pass a call frame and when
30753 to pass a global data pointer, global object pointer, or perhaps
30754 something else entirely.
30755
30756 * VM/CTI.cpp: Remove the debug-only check of the exception in
30757 ctiVMThrowTrampoline -- already checked in the code the trampoline
30758 jumps to, so not all that useful. Removed the exec argument from
30759 ctiTrampoline. Removed emitDebugExceptionCheck -- no longer needed.
30760 (JSC::CTI::emitCall): Removed code to set ExecState::m_callFrame.
30761 (JSC::CTI::privateCompileMainPass): Removed code in catch to extract
30762 the exception from ExecState::m_exception; instead, the code that
30763 jumps into catch will make sure the exception is already in eax.
30764 * VM/CTI.h: Removed exec from the ctiTrampoline. Also removed the
30765 non-helpful "volatile". Temporarily left ARG_exec in as a synonym
30766 for ARG_r; I'll change that on a future cleanup pass when introducing
30767 more use of the CallFrame type.
30768 (JSC::CTI::execute): Removed the ExecState* argument.
30769
30770 * VM/ExceptionHelpers.cpp:
30771 (JSC::InterruptedExecutionError::InterruptedExecutionError): Take
30772 JSGlobalData* instead of ExecState*.
30773 (JSC::createInterruptedExecutionException): Ditto.
30774 * VM/ExceptionHelpers.h: Ditto. Also removed an unneeded include.
30775
30776 * VM/Machine.cpp:
30777 (JSC::slideRegisterWindowForCall): Removed the exec and
30778 exceptionValue arguments. Changed to return 0 when there's a stack
30779 overflow rather than using a separate exception argument to cut
30780 down on memory accesses in the calling convention.
30781 (JSC::Machine::unwindCallFrame): Removed the exec argument when
30782 constructing a DebuggerCallFrame. Also removed code to set
30783 ExecState::m_callFrame.
30784 (JSC::Machine::throwException): Removed the exec argument when
30785 construction a DebuggerCallFrame.
30786 (JSC::Machine::execute): Updated to use the register instead of
30787 ExecState and also removed various uses of ExecState.
30788 (JSC::Machine::debug):
30789 (JSC::Machine::privateExecute): Put globalData into a local
30790 variable so it can be used throughout the interpreter. Changed
30791 the VM_CHECK_EXCEPTION to get the exception in globalData instead
30792 of through ExecState.
30793 (JSC::Machine::retrieveLastCaller): Turn exec into a registers
30794 pointer by calling registers() instead of by getting m_callFrame.
30795 (JSC::Machine::callFrame): Ditto.
30796 Tweaked exception macros. Made new versions for when you know
30797 you have an exception. Get at global exception with ARG_globalData.
30798 Got rid of the need to pass in the return value type.
30799 (JSC::Machine::cti_op_add): Update to use new version of exception
30800 macros.
30801 (JSC::Machine::cti_op_pre_inc): Ditto.
30802 (JSC::Machine::cti_timeout_check): Ditto.
30803 (JSC::Machine::cti_op_instanceof): Ditto.
30804 (JSC::Machine::cti_op_new_func): Ditto.
30805 (JSC::Machine::cti_op_call_JSFunction): Optimized by using the
30806 ARG values directly instead of through local variables -- this gets
30807 rid of code that just shuffles things around in the stack frame.
30808 Also get rid of ExecState and update for the new way exceptions are
30809 handled in slideRegisterWindowForCall.
30810 (JSC::Machine::cti_vm_compile): Update to make exec out of r since
30811 they are both the same thing now.
30812 (JSC::Machine::cti_op_call_NotJSFunction): Ditto.
30813 (JSC::Machine::cti_op_init_arguments): Ditto.
30814 (JSC::Machine::cti_op_resolve): Ditto.
30815 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
30816 (JSC::Machine::cti_op_construct_NotJSConstruct): Ditto.
30817 (JSC::Machine::cti_op_resolve_func): Ditto.
30818 (JSC::Machine::cti_op_put_by_val): Ditto.
30819 (JSC::Machine::cti_op_put_by_val_array): Ditto.
30820 (JSC::Machine::cti_op_resolve_skip): Ditto.
30821 (JSC::Machine::cti_op_resolve_global): Ditto.
30822 (JSC::Machine::cti_op_post_inc): Ditto.
30823 (JSC::Machine::cti_op_resolve_with_base): Ditto.
30824 (JSC::Machine::cti_op_post_dec): Ditto.
30825 (JSC::Machine::cti_op_call_eval): Ditto.
30826 (JSC::Machine::cti_op_throw): Ditto. Also rearranged to return
30827 the exception value as the return value so it can be used by
30828 op_catch.
30829 (JSC::Machine::cti_op_push_scope): Ditto.
30830 (JSC::Machine::cti_op_in): Ditto.
30831 (JSC::Machine::cti_op_del_by_val): Ditto.
30832 (JSC::Machine::cti_vm_throw): Ditto. Also rearranged to return
30833 the exception value as the return value so it can be used by
30834 op_catch.
30835
30836 * kjs/DebuggerCallFrame.cpp:
30837 (JSC::DebuggerCallFrame::functionName): Pass globalData.
30838 (JSC::DebuggerCallFrame::evaluate): Eliminated code to make a
30839 new ExecState.
30840 * kjs/DebuggerCallFrame.h: Removed ExecState argument from
30841 constructor.
30842
30843 * kjs/ExecState.h: Eliminated all data members and made ExecState
30844 inherit privately from Register instead. Also added a typedef to
30845 the future name for this class, which is CallFrame. It's just a
30846 Register* that knows it's a pointer at a call frame. The new class
30847 can't be constructed or copied. Changed all functions to use
30848 the this pointer instead of m_callFrame. Changed exception-related
30849 functions to access an exception in JSGlobalData. Removed functions
30850 used by CTI to pass the return address to the throw machinery --
30851 this is now done directly with a global in the global data.
30852
30853 * kjs/FunctionPrototype.cpp:
30854 (JSC::functionProtoFuncToString): Pass globalData instead of exec.
30855
30856 * kjs/InternalFunction.cpp:
30857 (JSC::InternalFunction::name): Take globalData instead of exec.
30858 * kjs/InternalFunction.h: Ditto.
30859
30860 * kjs/JSGlobalData.cpp: Initialize the new exception global to 0.
30861 * kjs/JSGlobalData.h: Declare two new globals. One for the current
30862 exception and another for the return address used by CTI to
30863 implement the throw operation.
30864
30865 * kjs/JSGlobalObject.cpp:
30866 (JSC::JSGlobalObject::init): Removed code to set up globalExec,
30867 which is now the same thing as globalCallFrame.
30868 (JSC::JSGlobalObject::reset): Get globalExec from our globalExec
30869 function so we don't have to repeat the logic twice.
30870 (JSC::JSGlobalObject::mark): Removed code to mark the exception;
30871 the exception is now stored in JSGlobalData and marked there.
30872 (JSC::JSGlobalObject::globalExec): Return a pointer to the end
30873 of the global call frame.
30874 * kjs/JSGlobalObject.h: Removed the globalExec data member.
30875
30876 * kjs/JSObject.cpp:
30877 (JSC::JSObject::putDirectFunction): Pass globalData instead of exec.
30878
30879 * kjs/collector.cpp:
30880 (JSC::Heap::collect): Mark the global exception.
30881
30882 * profiler/ProfileGenerator.cpp:
30883 (JSC::ProfileGenerator::addParentForConsoleStart): Pass globalData
30884 instead of exec to createCallIdentifier.
30885
30886 * profiler/Profiler.cpp:
30887 (JSC::Profiler::willExecute): Pass globalData instead of exec to
30888 createCallIdentifier.
30889 (JSC::Profiler::didExecute): Ditto.
30890 (JSC::Profiler::createCallIdentifier): Take globalData instead of
30891 exec.
30892 (JSC::createCallIdentifierFromFunctionImp): Ditto.
30893 * profiler/Profiler.h: Change interface to take a JSGlobalData
30894 instead of an ExecState.
30895
30896 2008-10-04 Cameron Zwarich <zwarich@apple.com>
30897
30898 Reviewed by Darin Adler.
30899
30900 Bug 21369: Add opcode documentation for all undocumented opcodes
30901 <https://bugs.webkit.org/show_bug.cgi?id=21369>
30902
30903 This patch adds opcode documentation for all undocumented opcodes, and
30904 it also renames op_init_arguments to op_create_arguments.
30905
30906 * VM/CTI.cpp:
30907 (JSC::CTI::privateCompileMainPass):
30908 * VM/CodeBlock.cpp:
30909 (JSC::CodeBlock::dump):
30910 * VM/CodeGenerator.cpp:
30911 (JSC::CodeGenerator::CodeGenerator):
30912 * VM/Machine.cpp:
30913 (JSC::Machine::privateExecute):
30914 (JSC::Machine::cti_op_create_arguments):
30915 * VM/Machine.h:
30916 * VM/Opcode.h:
30917
30918 2008-10-03 Maciej Stachowiak <mjs@apple.com>
30919
30920 Reviewed by Cameron Zwarich.
30921
30922 - "this" object in methods called on primitives should be wrapper object
30923 https://bugs.webkit.org/show_bug.cgi?id=21362
30924
30925 I changed things so that functions which use "this" do a fast
30926 version of toThisObject conversion if needed. Currently we miss
30927 the conversion entirely, at least for primitive types. Using
30928 TypeInfo and the primitive check, I made the fast case bail out
30929 pretty fast.
30930
30931 This is inexplicably an 1.007x SunSpider speedup (and a wash on V8 benchmarks).
30932
30933 Also renamed some opcodes for clarity:
30934
30935 init ==> enter
30936 init_activation ==> enter_with_activation
30937
30938 * VM/CTI.cpp:
30939 (JSC::CTI::privateCompileMainPass):
30940 (JSC::CTI::privateCompileSlowCases):
30941 * VM/CodeBlock.cpp:
30942 (JSC::CodeBlock::dump):
30943 * VM/CodeGenerator.cpp:
30944 (JSC::CodeGenerator::generate):
30945 (JSC::CodeGenerator::CodeGenerator):
30946 * VM/Machine.cpp:
30947 (JSC::Machine::privateExecute):
30948 (JSC::Machine::cti_op_convert_this):
30949 * VM/Machine.h:
30950 * VM/Opcode.h:
30951 * kjs/JSActivation.cpp:
30952 (JSC::JSActivation::JSActivation):
30953 * kjs/JSActivation.h:
30954 (JSC::JSActivation::createStructureID):
30955 * kjs/JSCell.h:
30956 (JSC::JSValue::needsThisConversion):
30957 * kjs/JSGlobalData.cpp:
30958 (JSC::JSGlobalData::JSGlobalData):
30959 * kjs/JSGlobalData.h:
30960 * kjs/JSNumberCell.h:
30961 (JSC::JSNumberCell::createStructureID):
30962 * kjs/JSStaticScopeObject.h:
30963 (JSC::JSStaticScopeObject::JSStaticScopeObject):
30964 (JSC::JSStaticScopeObject::createStructureID):
30965 * kjs/JSString.h:
30966 (JSC::JSString::createStructureID):
30967 * kjs/JSValue.h:
30968 * kjs/TypeInfo.h:
30969 (JSC::TypeInfo::needsThisConversion):
30970 * kjs/nodes.h:
30971 (JSC::ScopeNode::usesThis):
30972
30973 2008-10-03 Cameron Zwarich <zwarich@apple.com>
30974
30975 Reviewed by Maciej Stachowiak.
30976
30977 Bug 21356: The size of the RegisterFile differs depending on 32-bit / 64-bit and Debug / Release
30978 <https://bugs.webkit.org/show_bug.cgi?id=21356>
30979
30980 The RegisterFile decreases in size (measured in terms of numbers of
30981 Registers) as the size of a Register increases. This causes
30982
30983 js1_5/Regress/regress-159334.js
30984
30985 to fail in 64-bit debug builds. This fix makes the RegisterFile on all
30986 platforms the same size that it is in 32-bit Release builds.
30987
30988 * VM/RegisterFile.h:
30989 (JSC::RegisterFile::RegisterFile):
30990
30991 2008-10-03 Maciej Stachowiak <mjs@apple.com>
30992
30993 Reviewed by Cameron Zwarich.
30994
30995 - Some code cleanup to how we handle code features.
30996
30997 1) Rename FeatureInfo typedef to CodeFeatures.
30998 2) Rename NodeFeatureInfo template to NodeInfo.
30999 3) Keep CodeFeature bitmask in ScopeNode instead of trying to break it out into individual bools.
31000 4) Rename misleadingly named "needsClosure" method to "containsClosures", which better describes the meaning
31001 of ClosureFeature.
31002 5) Make setUsersArguments() not take an argument since it only goes one way.
31003
31004 * JavaScriptCore.exp:
31005 * VM/CodeBlock.h:
31006 (JSC::CodeBlock::CodeBlock):
31007 * kjs/NodeInfo.h:
31008 * kjs/Parser.cpp:
31009 (JSC::Parser::didFinishParsing):
31010 * kjs/Parser.h:
31011 (JSC::Parser::parse):
31012 * kjs/grammar.y:
31013 * kjs/nodes.cpp:
31014 (JSC::ScopeNode::ScopeNode):
31015 (JSC::ProgramNode::ProgramNode):
31016 (JSC::ProgramNode::create):
31017 (JSC::EvalNode::EvalNode):
31018 (JSC::EvalNode::create):
31019 (JSC::FunctionBodyNode::FunctionBodyNode):
31020 (JSC::FunctionBodyNode::create):
31021 * kjs/nodes.h:
31022 (JSC::ScopeNode::usesEval):
31023 (JSC::ScopeNode::containsClosures):
31024 (JSC::ScopeNode::usesArguments):
31025 (JSC::ScopeNode::setUsesArguments):
31026
31027 2008-10-03 Cameron Zwarich <zwarich@apple.com>
31028
31029 Reviewed by Maciej Stachowiak.
31030
31031 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit
31032 <https://bugs.webkit.org/show_bug.cgi?id=21343>
31033
31034 A fix was landed for this issue in r37253, and the ChangeLog assumes
31035 that it is a compiler bug, but it turns out that it is a subtle issue
31036 with mixing signed and unsigned 32-bit values in a 64-bit environment.
31037 In order to properly fix this bug, we should convert our signed offsets
31038 into the register file to use ptrdiff_t.
31039
31040 This may not be the only instance of this issue, but I will land this
31041 fix first and look for more later.
31042
31043 * VM/Machine.cpp:
31044 (JSC::Machine::getArgumentsData):
31045 * VM/Machine.h:
31046 * kjs/Arguments.cpp:
31047 (JSC::Arguments::getOwnPropertySlot):
31048 * kjs/Arguments.h:
31049 (JSC::Arguments::init):
31050
31051 2008-10-03 Darin Adler <darin@apple.com>
31052
31053 * VM/CTI.cpp: Another Windows build fix. Change the args of ctiTrampoline.
31054
31055 * kjs/JSNumberCell.h: A build fix for newer versions of gcc. Added
31056 declarations of JSGlobalData overloads of jsNumberCell.
31057
31058 2008-10-03 Darin Adler <darin@apple.com>
31059
31060 - try to fix Windows build
31061
31062 * kjs/ScopeChain.h: Add forward declaration of JSGlobalData.
31063
31064 2008-10-03 Darin Adler <darin@apple.com>
31065
31066 Reviewed by Geoff Garen.
31067
31068 - next step of https://bugs.webkit.org/show_bug.cgi?id=21295
31069 Turn ExecState into a call frame pointer.
31070
31071 Remove m_globalObject and m_globalData from ExecState.
31072
31073 SunSpider says this is a wash (slightly faster but not statistically
31074 significant); which is good enough since it's a preparation step and
31075 not supposed to be a spedup.
31076
31077 * API/JSCallbackFunction.cpp:
31078 (JSC::JSCallbackFunction::JSCallbackFunction):
31079 * kjs/ArrayConstructor.cpp:
31080 (JSC::ArrayConstructor::ArrayConstructor):
31081 * kjs/BooleanConstructor.cpp:
31082 (JSC::BooleanConstructor::BooleanConstructor):
31083 * kjs/DateConstructor.cpp:
31084 (JSC::DateConstructor::DateConstructor):
31085 * kjs/ErrorConstructor.cpp:
31086 (JSC::ErrorConstructor::ErrorConstructor):
31087 * kjs/FunctionPrototype.cpp:
31088 (JSC::FunctionPrototype::FunctionPrototype):
31089 * kjs/JSFunction.cpp:
31090 (JSC::JSFunction::JSFunction):
31091 * kjs/NativeErrorConstructor.cpp:
31092 (JSC::NativeErrorConstructor::NativeErrorConstructor):
31093 * kjs/NumberConstructor.cpp:
31094 (JSC::NumberConstructor::NumberConstructor):
31095 * kjs/ObjectConstructor.cpp:
31096 (JSC::ObjectConstructor::ObjectConstructor):
31097 * kjs/PrototypeFunction.cpp:
31098 (JSC::PrototypeFunction::PrototypeFunction):
31099 * kjs/RegExpConstructor.cpp:
31100 (JSC::RegExpConstructor::RegExpConstructor):
31101 * kjs/StringConstructor.cpp:
31102 (JSC::StringConstructor::StringConstructor):
31103 Pass JSGlobalData* instead of ExecState* to the InternalFunction
31104 constructor.
31105
31106 * API/OpaqueJSString.cpp: Added now-needed include.
31107
31108 * JavaScriptCore.exp: Updated.
31109
31110 * VM/CTI.cpp:
31111 (JSC::CTI::emitSlowScriptCheck): Changed to use ARGS_globalData
31112 instead of ARGS_exec.
31113
31114 * VM/CTI.h: Added a new argument to the CTI, the global data pointer.
31115 While it's possible to get to the global data pointer using the
31116 ExecState pointer, it's slow enough that it's better to just keep
31117 it around in the CTI arguments.
31118
31119 * VM/CodeBlock.h: Moved the CodeType enum here from ExecState.h.
31120
31121 * VM/Machine.cpp:
31122 (JSC::Machine::execute): Pass fewer arguments when constructing
31123 ExecState, and pass the global data pointer when invoking CTI.
31124 (JSC::Machine::firstCallFrame): Added. Used to get the dynamic global
31125 object, which is in the scope chain of the first call frame.
31126 (JSC::Machine::cti_op_add): Use globalData instead of exec when
31127 possible, to keep fast cases fast, since it's now more expensive to
31128 get to it through the exec pointer.
31129 (JSC::Machine::cti_timeout_check): Ditto.
31130 (JSC::Machine::cti_op_put_by_id_second): Ditto.
31131 (JSC::Machine::cti_op_get_by_id_second): Ditto.
31132 (JSC::Machine::cti_op_mul): Ditto.
31133 (JSC::Machine::cti_vm_compile): Ditto.
31134 (JSC::Machine::cti_op_get_by_val): Ditto.
31135 (JSC::Machine::cti_op_sub): Ditto.
31136 (JSC::Machine::cti_op_put_by_val): Ditto.
31137 (JSC::Machine::cti_op_put_by_val_array): Ditto.
31138 (JSC::Machine::cti_op_negate): Ditto.
31139 (JSC::Machine::cti_op_div): Ditto.
31140 (JSC::Machine::cti_op_pre_dec): Ditto.
31141 (JSC::Machine::cti_op_post_inc): Ditto.
31142 (JSC::Machine::cti_op_lshift): Ditto.
31143 (JSC::Machine::cti_op_bitand): Ditto.
31144 (JSC::Machine::cti_op_rshift): Ditto.
31145 (JSC::Machine::cti_op_bitnot): Ditto.
31146 (JSC::Machine::cti_op_mod): Ditto.
31147 (JSC::Machine::cti_op_post_dec): Ditto.
31148 (JSC::Machine::cti_op_urshift): Ditto.
31149 (JSC::Machine::cti_op_bitxor): Ditto.
31150 (JSC::Machine::cti_op_bitor): Ditto.
31151 (JSC::Machine::cti_op_call_eval): Ditto.
31152 (JSC::Machine::cti_op_throw): Ditto.
31153 (JSC::Machine::cti_op_is_string): Ditto.
31154 (JSC::Machine::cti_op_debug): Ditto.
31155 (JSC::Machine::cti_vm_throw): Ditto.
31156
31157 * VM/Machine.h: Added firstCallFrame.
31158
31159 * kjs/DebuggerCallFrame.cpp:
31160 (JSC::DebuggerCallFrame::evaluate): Pass fewer arguments when
31161 constructing ExecState.
31162
31163 * kjs/ExecState.cpp: Deleted contents. Later we'll remove the
31164 file altogether.
31165
31166 * kjs/ExecState.h: Removed m_globalObject and m_globalData.
31167 Moved CodeType into another header.
31168 (JSC::ExecState::ExecState): Take only a single argument, a
31169 call frame pointer.
31170 (JSC::ExecState::dynamicGlobalObject): Get the object from
31171 the first call frame since it's no longer stored.
31172 (JSC::ExecState::globalData): Get the global data from the
31173 scope chain, since we no longer store a pointer to it here.
31174 (JSC::ExecState::identifierTable): Ditto.
31175 (JSC::ExecState::propertyNames): Ditto.
31176 (JSC::ExecState::emptyList): Ditto.
31177 (JSC::ExecState::lexer): Ditto.
31178 (JSC::ExecState::parser): Ditto.
31179 (JSC::ExecState::machine): Ditto.
31180 (JSC::ExecState::arrayTable): Ditto.
31181 (JSC::ExecState::dateTable): Ditto.
31182 (JSC::ExecState::mathTable): Ditto.
31183 (JSC::ExecState::numberTable): Ditto.
31184 (JSC::ExecState::regExpTable): Ditto.
31185 (JSC::ExecState::regExpConstructorTable): Ditto.
31186 (JSC::ExecState::stringTable): Ditto.
31187 (JSC::ExecState::heap): Ditto.
31188
31189 * kjs/FunctionConstructor.cpp:
31190 (JSC::FunctionConstructor::FunctionConstructor): Pass
31191 JSGlobalData* instead of ExecState* to the InternalFunction
31192 constructor.
31193 (JSC::constructFunction): Pass the global data pointer when
31194 constructing a new scope chain.
31195
31196 * kjs/InternalFunction.cpp:
31197 (JSC::InternalFunction::InternalFunction): Take a JSGlobalData*
31198 instead of an ExecState*. Later we can change more places to
31199 work this way -- it's more efficient to take the type you need
31200 since the caller might already have it.
31201 * kjs/InternalFunction.h: Ditto.
31202
31203 * kjs/JSCell.h:
31204 (JSC::JSCell::operator new): Added an overload that takes a
31205 JSGlobalData* so you can construct without an ExecState*.
31206
31207 * kjs/JSGlobalObject.cpp:
31208 (JSC::JSGlobalObject::init): Moved creation of the global scope
31209 chain in here, since it now requires a pointer to the global data.
31210 Moved the initialization of the call frame in here since it requires
31211 the global scope chain node. Removed the extra argument to ExecState
31212 when creating the global ExecState*.
31213 * kjs/JSGlobalObject.h: Removed initialization of globalScopeChain
31214 and the call frame from the JSGlobalObjectData constructor. Added
31215 a thisValue argument to the init function.
31216
31217 * kjs/JSNumberCell.cpp: Added versions of jsNumberCell that take
31218 JSGlobalData* rather than ExecState*.
31219 * kjs/JSNumberCell.h:
31220 (JSC::JSNumberCell::operator new): Added a version that takes
31221 JSGlobalData*.
31222 (JSC::JSNumberCell::JSNumberCell): Ditto.
31223 (JSC::jsNumber): Ditto.
31224 * kjs/JSString.cpp:
31225 (JSC::jsString): Ditto.
31226 (JSC::jsSubstring): Ditto.
31227 (JSC::jsOwnedString): Ditto.
31228 * kjs/JSString.h:
31229 (JSC::JSString::JSString): Changed to take JSGlobalData*.
31230 (JSC::jsEmptyString): Added a version that takes JSGlobalData*.
31231 (JSC::jsSingleCharacterString): Ditto.
31232 (JSC::jsSingleCharacterSubstring): Ditto.
31233 (JSC::jsNontrivialString): Ditto.
31234 (JSC::JSString::getIndex): Ditto.
31235 (JSC::jsString): Ditto.
31236 (JSC::jsSubstring): Ditto.
31237 (JSC::jsOwnedString): Ditto.
31238
31239 * kjs/ScopeChain.h: Added a globalData pointer to each node.
31240 (JSC::ScopeChainNode::ScopeChainNode): Initialize the globalData
31241 pointer.
31242 (JSC::ScopeChainNode::push): Set the global data pointer in the
31243 new node.
31244 (JSC::ScopeChain::ScopeChain): Take a globalData argument.
31245
31246 * kjs/SmallStrings.cpp:
31247 (JSC::SmallStrings::createEmptyString): Take JSGlobalData* instead of
31248 ExecState*.
31249 (JSC::SmallStrings::createSingleCharacterString): Ditto.
31250 * kjs/SmallStrings.h:
31251 (JSC::SmallStrings::emptyString): Ditto.
31252 (JSC::SmallStrings::singleCharacterString): Ditto.
31253
31254 2008-10-03 Cameron Zwarich <zwarich@apple.com>
31255
31256 Reviewed by Geoff Garen.
31257
31258 Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit
31259 <https://bugs.webkit.org/show_bug.cgi?id=21343>
31260
31261 Add a workaround for a bug in GCC, which affects GCC 4.0, GCC 4.2, and
31262 llvm-gcc 4.2. I put it in an #ifdef because it was a slight regression
31263 on SunSpider in 32-bit, although that might be entirely random.
31264
31265 * kjs/Arguments.cpp:
31266 (JSC::Arguments::getOwnPropertySlot):
31267
31268 2008-10-03 Darin Adler <darin@apple.com>
31269
31270 Rubber stamped by Alexey Proskuryakov.
31271
31272 * kjs/Shell.cpp: (main): Don't delete JSGlobalData. Later, we need to change
31273 this tool to use public JavaScriptCore API instead.
31274
31275 2008-10-03 Darin Adler <darin@apple.com>
31276
31277 Suggested by Alexey Proskuryakov.
31278
31279 * kjs/JSGlobalData.cpp:
31280 (JSC::JSGlobalData::~JSGlobalData): Remove call to heap.destroy() because
31281 it's too late to ref the JSGlobalData object once it's already being
31282 destroyed. In practice this is not a problem because WebCore's JSGlobalData
31283 is never destroyed and JSGlobalContextRelease takes care of calling
31284 heap.destroy() in advance.
31285
31286 2008-10-02 Oliver Hunt <oliver@apple.com>
31287
31288 Reviewed by Maciej Stachowiak.
31289
31290 Replace SSE3 check with an SSE2 check, and implement SSE2 check on windows.
31291
31292 5.6% win on SunSpider on windows.
31293
31294 * VM/CTI.cpp:
31295 (JSC::isSSE2Present):
31296 (JSC::CTI::compileBinaryArithOp):
31297 (JSC::CTI::compileBinaryArithOpSlowCase):
31298
31299 2008-10-03 Maciej Stachowiak <mjs@apple.com>
31300
31301 Rubber stamped by Cameron Zwarich.
31302
31303 - fix mistaken change of | to || which caused a big perf regression on EarleyBoyer
31304
31305 * kjs/grammar.y:
31306
31307 2008-10-02 Darin Adler <darin@apple.com>
31308
31309 Reviewed by Geoff Garen.
31310
31311 - https://bugs.webkit.org/show_bug.cgi?id=21321
31312 Bug 21321: speed up JavaScriptCore by inlining Heap in JSGlobalData
31313
31314 1.019x as fast on SunSpider.
31315
31316 * API/JSBase.cpp:
31317 (JSEvaluateScript): Use heap. instead of heap-> to work with the heap.
31318 (JSCheckScriptSyntax): Ditto.
31319 (JSGarbageCollect): Ditto.
31320 (JSReportExtraMemoryCost): Ditto.
31321 * API/JSContextRef.cpp:
31322 (JSGlobalContextRetain): Ditto.
31323 (JSGlobalContextRelease): Destroy the heap with the destroy function instead
31324 of the delete operator.
31325 (JSContextGetGlobalObject): Use heap. instead of heap-> to work with the heap.
31326 * API/JSObjectRef.cpp:
31327 (JSObjectMake): Use heap. instead of heap-> to work with the heap.
31328 (JSObjectMakeFunctionWithCallback): Ditto.
31329 (JSObjectMakeConstructor): Ditto.
31330 (JSObjectMakeFunction): Ditto.
31331 (JSObjectMakeArray): Ditto.
31332 (JSObjectMakeDate): Ditto.
31333 (JSObjectMakeError): Ditto.
31334 (JSObjectMakeRegExp): Ditto.
31335 (JSObjectHasProperty): Ditto.
31336 (JSObjectGetProperty): Ditto.
31337 (JSObjectSetProperty): Ditto.
31338 (JSObjectGetPropertyAtIndex): Ditto.
31339 (JSObjectSetPropertyAtIndex): Ditto.
31340 (JSObjectDeleteProperty): Ditto.
31341 (JSObjectCallAsFunction): Ditto.
31342 (JSObjectCallAsConstructor): Ditto.
31343 (JSObjectCopyPropertyNames): Ditto.
31344 (JSPropertyNameAccumulatorAddName): Ditto.
31345 * API/JSValueRef.cpp:
31346 (JSValueIsEqual): Ditto.
31347 (JSValueIsInstanceOfConstructor): Ditto.
31348 (JSValueMakeNumber): Ditto.
31349 (JSValueMakeString): Ditto.
31350 (JSValueToNumber): Ditto.
31351 (JSValueToStringCopy): Ditto.
31352 (JSValueToObject): Ditto.
31353 (JSValueProtect): Ditto.
31354 (JSValueUnprotect): Ditto.
31355
31356 * kjs/ExecState.h:
31357 (JSC::ExecState::heap): Update to use the & operator.
31358
31359 * kjs/JSGlobalData.cpp:
31360 (JSC::JSGlobalData::JSGlobalData): Update to initialize a heap member
31361 instead of calling new to make a heap.
31362 (JSC::JSGlobalData::~JSGlobalData): Destroy the heap with the destroy
31363 function instead of the delete operator.
31364 * kjs/JSGlobalData.h: Change from Heap* to a Heap.
31365 * kjs/JSGlobalObject.cpp:
31366 (JSC::JSGlobalObject::mark): Use the & operator here.
31367 (JSC::JSGlobalObject::operator new): Use heap. instead of heap-> to work
31368 with the heap.
31369
31370 2008-10-02 Cameron Zwarich <zwarich@apple.com>
31371
31372 Reviewed by Geoff Garen.
31373
31374 Bug 21317: Replace RegisterFile size and capacity information with Register pointers
31375 <https://bugs.webkit.org/show_bug.cgi?id=21317>
31376
31377 This is a 2.3% speedup on the V8 DeltaBlue benchmark, a 3.3% speedup on
31378 the V8 Raytrace benchmark, and a 1.0% speedup on SunSpider.
31379
31380 * VM/Machine.cpp:
31381 (JSC::slideRegisterWindowForCall):
31382 (JSC::Machine::callEval):
31383 (JSC::Machine::execute):
31384 (JSC::Machine::privateExecute):
31385 (JSC::Machine::cti_op_call_JSFunction):
31386 (JSC::Machine::cti_op_construct_JSConstruct):
31387 * VM/RegisterFile.cpp:
31388 (JSC::RegisterFile::~RegisterFile):
31389 * VM/RegisterFile.h:
31390 (JSC::RegisterFile::RegisterFile):
31391 (JSC::RegisterFile::start):
31392 (JSC::RegisterFile::end):
31393 (JSC::RegisterFile::size):
31394 (JSC::RegisterFile::shrink):
31395 (JSC::RegisterFile::grow):
31396 (JSC::RegisterFile::lastGlobal):
31397 (JSC::RegisterFile::markGlobals):
31398 (JSC::RegisterFile::markCallFrames):
31399 * kjs/JSGlobalObject.cpp:
31400 (JSC::JSGlobalObject::copyGlobalsTo):
31401
31402 2008-10-02 Cameron Zwarich <zwarich@apple.com>
31403
31404 Rubber-stamped by Darin Adler.
31405
31406 Change bitwise operations introduced in r37166 to boolean operations. We
31407 only use bitwise operations over boolean operations for increasing
31408 performance in extremely hot code, but that does not apply to anything
31409 in the parser.
31410
31411 * kjs/grammar.y:
31412
31413 2008-10-02 Gavin Barraclough <barraclough@apple.com>
31414
31415 Reviewed by Darin Adler.
31416
31417 Fix for bug #21232 - should reset m_isPendingDash on flush,
31418 and should allow '\-' as beginning or end of a range (though
31419 not to specifiy a range itself).
31420
31421 * ChangeLog:
31422 * wrec/CharacterClassConstructor.cpp:
31423 (JSC::CharacterClassConstructor::put):
31424 (JSC::CharacterClassConstructor::flush):
31425 * wrec/CharacterClassConstructor.h:
31426 (JSC::CharacterClassConstructor::flushBeforeEscapedHyphen):
31427 * wrec/WREC.cpp:
31428 (JSC::WRECGenerator::generateDisjunction):
31429 (JSC::WRECParser::parseCharacterClass):
31430 (JSC::WRECParser::parseDisjunction):
31431 * wrec/WREC.h:
31432
31433 2008-10-02 Darin Adler <darin@apple.com>
31434
31435 Reviewed by Sam Weinig.
31436
31437 - remove the "static" from declarations in a header file, since we
31438 don't want them to have internal linkage
31439
31440 * VM/Machine.h: Remove the static keyword from the constant and the
31441 three inline functions that Geoff just moved here.
31442
31443 2008-10-02 Geoffrey Garen <ggaren@apple.com>
31444
31445 Reviewed by Sam Weinig.
31446
31447 Fixed https://bugs.webkit.org/show_bug.cgi?id=21283.
31448 Profiler Crashes When Started
31449
31450 * VM/Machine.cpp:
31451 * VM/Machine.h:
31452 (JSC::makeHostCallFramePointer):
31453 (JSC::isHostCallFrame):
31454 (JSC::stripHostCallFrameBit): Moved some things to the header so
31455 JSGlobalObject could use them.
31456
31457 * kjs/JSGlobalObject.h:
31458 (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Call the
31459 new makeHostCallFramePointer API, since 0 no longer indicates a host
31460 call frame.
31461
31462 2008-10-02 Alexey Proskuryakov <ap@webkit.org>
31463
31464 Reviewed by Darin Adler.
31465
31466 https://bugs.webkit.org/show_bug.cgi?id=21304
31467 Stop using a static wrapper map for WebCore JS bindings
31468
31469 * kjs/JSGlobalData.cpp:
31470 (JSC::JSGlobalData::JSGlobalData):
31471 (JSC::JSGlobalData::~JSGlobalData):
31472 (JSC::JSGlobalData::ClientData::~ClientData):
31473 * kjs/JSGlobalData.h:
31474 Added a client data member to JSGlobalData. WebCore will use it to store bindings-related
31475 global data.
31476
31477 * JavaScriptCore.exp: Export virtual ClientData destructor.
31478
31479 2008-10-02 Geoffrey Garen <ggaren@apple.com>
31480
31481 Not reviewed.
31482
31483 Try to fix Qt build.
31484
31485 * kjs/Error.h:
31486
31487 2008-10-01 Geoffrey Garen <ggaren@apple.com>
31488
31489 Reviewed by Darin Adler and Cameron Zwarich.
31490
31491 Preliminary step toward dynamic recompilation: Standardized and
31492 simplified the parsing interface.
31493
31494 The main goal in this patch is to make it easy to ask for a duplicate
31495 compilation, and get back a duplicate result -- same source URL, same
31496 debugger / profiler ID, same toString behavior, etc.
31497
31498 The basic unit of compilation and evaluation is now SourceCode, which
31499 encompasses a SourceProvider, a range in that provider, and a starting
31500 line number.
31501
31502 A SourceProvider now encompasses a source URL, and *is* a source ID,
31503 since a pointer is a unique identifier.
31504
31505 * API/JSBase.cpp:
31506 (JSEvaluateScript):
31507 (JSCheckScriptSyntax): Provide a SourceCode to the Interpreter, since
31508 other APIs are no longer supported.
31509
31510 * VM/CodeBlock.h:
31511 (JSC::EvalCodeCache::get): Provide a SourceCode to the Interpreter, since
31512 other APIs are no longer supported.
31513 (JSC::CodeBlock::CodeBlock): ASSERT something that used to be ASSERTed
31514 by our caller -- this is a better bottleneck.
31515
31516 * VM/CodeGenerator.cpp:
31517 (JSC::CodeGenerator::CodeGenerator): Updated for the fact that
31518 FunctionBodyNode's parameters are no longer a WTF::Vector.
31519
31520 * kjs/Arguments.cpp:
31521 (JSC::Arguments::Arguments): ditto
31522
31523 * kjs/DebuggerCallFrame.cpp:
31524 (JSC::DebuggerCallFrame::evaluate): Provide a SourceCode to the Parser,
31525 since other APIs are no longer supported.
31526
31527 * kjs/FunctionConstructor.cpp:
31528 (JSC::constructFunction): Provide a SourceCode to the Parser, since
31529 other APIs are no longer supported. Adopt FunctionBodyNode's new
31530 "finishParsing" API.
31531
31532 * kjs/JSFunction.cpp:
31533 (JSC::JSFunction::lengthGetter):
31534 (JSC::JSFunction::getParameterName): Updated for the fact that
31535 FunctionBodyNode's parameters are no longer a wtf::Vector.
31536
31537 * kjs/JSFunction.h: Nixed some cruft.
31538
31539 * kjs/JSGlobalObjectFunctions.cpp:
31540 (JSC::globalFuncEval): Provide a SourceCode to the Parser, since
31541 other APIs are no longer supported.
31542
31543 * kjs/Parser.cpp:
31544 (JSC::Parser::parse): Require a SourceCode argument, instead of a bunch
31545 of broken out parameters. Stop tracking sourceId as an integer, since we
31546 use the SourceProvider pointer for this now. Don't clamp the
31547 startingLineNumber, since SourceCode does that now.
31548
31549 * kjs/Parser.h:
31550 (JSC::Parser::parse): Standardized the parsing interface to require a
31551 SourceCode.
31552
31553 * kjs/Shell.cpp:
31554 (functionRun):
31555 (functionLoad):
31556 (prettyPrintScript):
31557 (runWithScripts):
31558 (runInteractive): Provide a SourceCode to the Interpreter, since
31559 other APIs are no longer supported.
31560
31561 * kjs/SourceProvider.h:
31562 (JSC::SourceProvider::SourceProvider):
31563 (JSC::SourceProvider::url):
31564 (JSC::SourceProvider::asId):
31565 (JSC::UStringSourceProvider::create):
31566 (JSC::UStringSourceProvider::UStringSourceProvider): Added new
31567 responsibilities described above.
31568
31569 * kjs/SourceRange.h:
31570 (JSC::SourceCode::SourceCode):
31571 (JSC::SourceCode::toString):
31572 (JSC::SourceCode::provider):
31573 (JSC::SourceCode::firstLine):
31574 (JSC::SourceCode::data):
31575 (JSC::SourceCode::length): Added new responsibilities described above.
31576 Renamed SourceRange to SourceCode, based on review feedback. Added
31577 a makeSource function for convenience.
31578
31579 * kjs/debugger.h: Provide a SourceCode to the client, since other APIs
31580 are no longer supported.
31581
31582 * kjs/grammar.y: Provide startingLineNumber when creating a SourceCode.
31583
31584 * kjs/debugger.h: Treat sourceId as intptr_t to avoid loss of precision
31585 on 64bit platforms.
31586
31587 * kjs/interpreter.cpp:
31588 (JSC::Interpreter::checkSyntax):
31589 (JSC::Interpreter::evaluate):
31590 * kjs/interpreter.h: Require a SourceCode instead of broken out arguments.
31591
31592 * kjs/lexer.cpp:
31593 (JSC::Lexer::setCode):
31594 * kjs/lexer.h:
31595 (JSC::Lexer::sourceRange): Fold together the SourceProvider and line number
31596 into a SourceCode. Fixed a bug where the Lexer would accidentally keep
31597 alive the last SourceProvider forever.
31598
31599 * kjs/nodes.cpp:
31600 (JSC::ScopeNode::ScopeNode):
31601 (JSC::ProgramNode::ProgramNode):
31602 (JSC::ProgramNode::create):
31603 (JSC::EvalNode::EvalNode):
31604 (JSC::EvalNode::generateCode):
31605 (JSC::EvalNode::create):
31606 (JSC::FunctionBodyNode::FunctionBodyNode):
31607 (JSC::FunctionBodyNode::finishParsing):
31608 (JSC::FunctionBodyNode::create):
31609 (JSC::FunctionBodyNode::generateCode):
31610 (JSC::ProgramNode::generateCode):
31611 (JSC::FunctionBodyNode::paramString):
31612 * kjs/nodes.h:
31613 (JSC::ScopeNode::):
31614 (JSC::ScopeNode::sourceId):
31615 (JSC::FunctionBodyNode::):
31616 (JSC::FunctionBodyNode::parameterCount):
31617 (JSC::FuncExprNode::):
31618 (JSC::FuncDeclNode::): Store a SourceCode in all ScopeNodes, since
31619 SourceCode is now responsible for tracking URL, ID, etc. Streamlined
31620 some ad hoc FunctionBodyNode fixups into a "finishParsing" function, to
31621 help make clear what you need to do in order to finish parsing a
31622 FunctionBodyNode.
31623
31624 * wtf/Vector.h:
31625 (WTF::::releaseBuffer): Don't ASSERT that releaseBuffer() is only called
31626 when buffer is not 0, since FunctionBodyNode is more than happy
31627 to get back a 0 buffer, and other functions like RefPtr::release() allow
31628 for 0, too.
31629
31630 2008-10-01 Cameron Zwarich <zwarich@apple.com>
31631
31632 Reviewed by Maciej Stachowiak.
31633
31634 Bug 21289: REGRESSION (r37160): Inspector crashes on load
31635 <https://bugs.webkit.org/show_bug.cgi?id=21289>
31636
31637 The code in Arguments::mark() in r37160 was wrong. It marks indices in
31638 d->registers, but that makes no sense (they are local variables, not
31639 arguments). It should mark those indices in d->registerArray instead.
31640
31641 This patch also changes Arguments::copyRegisters() to use d->numParameters
31642 instead of recomputing it.
31643
31644 * kjs/Arguments.cpp:
31645 (JSC::Arguments::mark):
31646 * kjs/Arguments.h:
31647 (JSC::Arguments::copyRegisters):
31648
31649 2008-09-30 Darin Adler <darin@apple.com>
31650
31651 Reviewed by Eric Seidel.
31652
31653 - https://bugs.webkit.org/show_bug.cgi?id=21214
31654 work on getting rid of ExecState
31655
31656 Eliminate some unneeded uses of dynamicGlobalObject.
31657
31658 * API/JSClassRef.cpp:
31659 (OpaqueJSClass::contextData): Changed to use a map in the global data instead
31660 of on the global object. Also fixed to use only a single hash table lookup.
31661
31662 * API/JSObjectRef.cpp:
31663 (JSObjectMakeConstructor): Use lexicalGlobalObject rather than dynamicGlobalObject
31664 to get the object prototype.
31665
31666 * kjs/ArrayPrototype.cpp:
31667 (JSC::arrayProtoFuncToString): Use arrayVisitedElements set in global data rather
31668 than in the global object.
31669 (JSC::arrayProtoFuncToLocaleString): Ditto.
31670 (JSC::arrayProtoFuncJoin): Ditto.
31671
31672 * kjs/JSGlobalData.cpp:
31673 (JSC::JSGlobalData::JSGlobalData): Don't initialize opaqueJSClassData, since
31674 it's no longer a pointer.
31675 (JSC::JSGlobalData::~JSGlobalData): We still need to delete all the values, but
31676 we don't need to delete the map since it's no longer a pointer.
31677
31678 * kjs/JSGlobalData.h: Made opaqueJSClassData a map instead of a pointer to a map.
31679 Also added arrayVisitedElements.
31680
31681 * kjs/JSGlobalObject.h: Removed arrayVisitedElements.
31682
31683 * kjs/Shell.cpp:
31684 (functionRun): Use lexicalGlobalObject instead of dynamicGlobalObject.
31685 (functionLoad): Ditto.
31686
31687 2008-10-01 Cameron Zwarich <zwarich@apple.com>
31688
31689 Not reviewed.
31690
31691 Speculative Windows build fix.
31692
31693 * kjs/grammar.y:
31694
31695 2008-10-01 Cameron Zwarich <zwarich@apple.com>
31696
31697 Reviewed by Darin Adler.
31698
31699 Bug 21123: using "arguments" in a function should not force creation of an activation object
31700 <https://bugs.webkit.org/show_bug.cgi?id=21123>
31701
31702 Make the 'arguments' object not require a JSActivation. We store the
31703 'arguments' object in the OptionalCalleeArguments call frame slot. We
31704 need to be able to get the original 'arguments' object to tear it off
31705 when returning from a function, but 'arguments' may be assigned to in a
31706 number of ways.
31707
31708 Therefore, we use the OptionalCalleeArguments slot when we want to get
31709 the original activation or we know that 'arguments' was not assigned a
31710 different value. When 'arguments' may have been assigned a new value,
31711 we use a new local variable that is initialized with 'arguments'. Since
31712 a function parameter named 'arguments' may overwrite the value of
31713 'arguments', we also need to be careful to look up 'arguments' in the
31714 symbol table, so we get the parameter named 'arguments' instead of the
31715 local variable that we have added for holding the 'arguments' object.
31716
31717 This is a 19.1% win on the V8 Raytrace benchmark using the SunSpider
31718 harness, and a 20.7% win using the V8 harness. This amounts to a 6.5%
31719 total speedup on the V8 benchmark suite using the V8 harness.
31720
31721 * VM/CTI.cpp:
31722 (JSC::CTI::privateCompileMainPass):
31723 * VM/CodeBlock.h:
31724 * VM/CodeGenerator.cpp:
31725 (JSC::CodeGenerator::CodeGenerator):
31726 * VM/Machine.cpp:
31727 (JSC::Machine::unwindCallFrame):
31728 (JSC::Machine::privateExecute):
31729 (JSC::Machine::retrieveArguments):
31730 (JSC::Machine::cti_op_init_arguments):
31731 (JSC::Machine::cti_op_ret_activation_arguments):
31732 * VM/Machine.h:
31733 * VM/RegisterFile.h:
31734 (JSC::RegisterFile::):
31735 * kjs/Arguments.cpp:
31736 (JSC::Arguments::mark):
31737 (JSC::Arguments::fillArgList):
31738 (JSC::Arguments::getOwnPropertySlot):
31739 (JSC::Arguments::put):
31740 * kjs/Arguments.h:
31741 (JSC::Arguments::setRegisters):
31742 (JSC::Arguments::init):
31743 (JSC::Arguments::Arguments):
31744 (JSC::Arguments::copyRegisters):
31745 (JSC::JSActivation::copyRegisters):
31746 * kjs/JSActivation.cpp:
31747 (JSC::JSActivation::argumentsGetter):
31748 * kjs/JSActivation.h:
31749 (JSC::JSActivation::JSActivationData::JSActivationData):
31750 * kjs/grammar.y:
31751 * kjs/nodes.h:
31752 (JSC::ScopeNode::setUsesArguments):
31753 * masm/X86Assembler.h:
31754 (JSC::X86Assembler::):
31755 (JSC::X86Assembler::orl_mr):
31756
31757 2008-10-01 Kevin McCullough <kmccullough@apple.com>
31758
31759 Rubberstamped by Geoff Garen.
31760
31761 Remove BreakpointCheckStatement because it's not used anymore.
31762 No effect on sunspider or the jsc tests.
31763
31764 * kjs/nodes.cpp:
31765 * kjs/nodes.h:
31766
31767 2008-09-30 Oliver Hunt <oliver@apple.com>
31768
31769 Reviewed by Geoff Garen.
31770
31771 Improve performance of CTI on windows.
31772
31773 Currently on platforms where the compiler doesn't allow us to safely
31774 index relative to the address of a parameter we need to actually
31775 provide a pointer to CTI runtime call arguments. This patch improves
31776 performance in this case by making the CTI logic for restoring this
31777 parameter much less conservative by only resetting it before we actually
31778 make a call, rather than between each and every SF bytecode we generate
31779 code for.
31780
31781 This results in a 3.6% progression on the v8 benchmark when compiled with MSVC.
31782
31783 * VM/CTI.cpp:
31784 (JSC::CTI::emitCall):
31785 (JSC::CTI::compileOpCall):
31786 (JSC::CTI::privateCompileMainPass):
31787 (JSC::CTI::privateCompileSlowCases):
31788 (JSC::CTI::privateCompilePutByIdTransition):
31789 * VM/CTI.h:
31790 * masm/X86Assembler.h:
31791 * wtf/Platform.h:
31792
31793 2008-09-30 Maciej Stachowiak <mjs@apple.com>
31794
31795 Reviewed by Oliver Hunt.
31796
31797 - track uses of "this", "with" and "catch" in the parser
31798
31799 Knowing this up front will be useful for future optimizations.
31800
31801 Perf and correctness remain the same.
31802
31803 * kjs/NodeInfo.h:
31804 * kjs/grammar.y:
31805
31806 2008-09-30 Sam Weinig <sam@webkit.org>
31807
31808 Reviewed by Mark Rowe.
31809
31810 Add WebKitAvailability macros for JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError,
31811 and JSObjectMakeRegExp
31812
31813 * API/JSObjectRef.h:
31814
31815 2008-09-30 Darin Adler <darin@apple.com>
31816
31817 Reviewed by Geoff Garen.
31818
31819 - https://bugs.webkit.org/show_bug.cgi?id=21214
31820 work on getting rid of ExecState
31821
31822 Replaced the m_prev field of ExecState with a bit in the
31823 call frame pointer to indicate "host" call frames.
31824
31825 * VM/Machine.cpp:
31826 (JSC::makeHostCallFramePointer): Added. Sets low bit.
31827 (JSC::isHostCallFrame): Added. Checks low bit.
31828 (JSC::stripHostCallFrameBit): Added. Clears low bit.
31829 (JSC::Machine::unwindCallFrame): Replaced null check that was
31830 formerly used to detect host call frames with an isHostCallFrame check.
31831 (JSC::Machine::execute): Pass in a host call frame pointer rather than
31832 always passing 0 when starting execution from the host. This allows us
31833 to follow the entire call frame pointer chain when desired, or to stop
31834 at the host calls when that's desired.
31835 (JSC::Machine::privateExecute): Replaced null check that was
31836 formerly used to detect host call frames with an isHostCallFrame check.
31837 (JSC::Machine::retrieveCaller): Ditto.
31838 (JSC::Machine::retrieveLastCaller): Ditto.
31839 (JSC::Machine::callFrame): Removed the code to walk up m_prev pointers
31840 and replaced it with code that uses the caller pointer and uses the
31841 stripHostCallFrameBit function.
31842
31843 * kjs/ExecState.cpp: Removed m_prev.
31844 * kjs/ExecState.h: Ditto.
31845
31846 2008-09-30 Cameron Zwarich <zwarich@apple.com>
31847
31848 Reviewed by Geoff Garen.
31849
31850 Move all detection of 'arguments' in a lexical scope to the parser, in
31851 preparation for fixing
31852
31853 Bug 21123: using "arguments" in a function should not force creation of an activation object
31854 <https://bugs.webkit.org/show_bug.cgi?id=21123>
31855
31856 * VM/CodeGenerator.cpp:
31857 (JSC::CodeGenerator::CodeGenerator):
31858 * kjs/NodeInfo.h:
31859 * kjs/grammar.y:
31860
31861 2008-09-30 Geoffrey Garen <ggaren@apple.com>
31862
31863 Not reviewed.
31864
31865 * kjs/Shell.cpp:
31866 (runWithScripts): Fixed indentation.
31867
31868 2008-09-30 Mark Rowe <mrowe@apple.com>
31869
31870 Rubber-stamped by Sam Weinig.
31871
31872 Build fix. Move InternalFunction::classInfo implementation into the .cpp
31873 file to prevent the vtable for InternalFunction being generated as a weak symbol.
31874 Has no effect on SunSpider.
31875
31876 * kjs/InternalFunction.cpp:
31877 (JSC::InternalFunction::classInfo):
31878 * kjs/InternalFunction.h:
31879
31880 2008-09-29 Maciej Stachowiak <mjs@apple.com>
31881
31882 Reviewed by Darin Adler.
31883
31884 - optimize appending a number to a string
31885 https://bugs.webkit.org/show_bug.cgi?id=21203
31886
31887 It's pretty common in real-world code (and on some of the v8
31888 benchmarks) to append a number to a string, so I made this one of
31889 the fast cases, and also added support to UString to do it
31890 directly without allocating a temporary UString.
31891
31892 ~1% speedup on v8 benchmark.
31893
31894 * VM/Machine.cpp:
31895 (JSC::jsAddSlowCase): Make this NEVER_INLINE because somehow otherwise
31896 the change is a regression.
31897 (JSC::jsAdd): Handle number + string special case.
31898 (JSC::Machine::cti_op_add): Integrate much of the logic of jsAdd to
31899 avoid exception check in the str + str, num + num and str + num cases.
31900 * kjs/ustring.cpp:
31901 (JSC::expandedSize): Make this a non-member function, since it needs to be
31902 called in non-member functions but not outside this file.
31903 (JSC::expandCapacity): Ditto.
31904 (JSC::UString::expandCapacity): Call the non-member version.
31905 (JSC::createRep): Helper to make a rep from a char*.
31906 (JSC::UString::UString): Use above helper.
31907 (JSC::concatenate): Guts of concatenating constructor for cases where first
31908 item is a UString::Rep, and second is a UChar* and length, or a char*.
31909 (JSC::UString::append): Implement for cases where first item is a UString::Rep,
31910 and second is an int or double. Sadly duplicates logic of UString::from(int)
31911 and UString::from(double).
31912 * kjs/ustring.h:
31913
31914 2008-09-29 Darin Adler <darin@apple.com>
31915
31916 Reviewed by Sam Weinig.
31917
31918 - https://bugs.webkit.org/show_bug.cgi?id=21214
31919 work on getting rid of ExecState
31920
31921 * JavaScriptCore.exp: Updated since JSGlobalObject::init
31922 no longer takes a parameter.
31923
31924 * VM/Machine.cpp:
31925 (JSC::Machine::execute): Removed m_registerFile argument
31926 for ExecState constructors.
31927
31928 * kjs/DebuggerCallFrame.cpp:
31929 (JSC::DebuggerCallFrame::evaluate): Removed globalThisValue
31930 argument for ExecState constructor.
31931
31932 * kjs/ExecState.cpp:
31933 (JSC::ExecState::ExecState): Removed globalThisValue and
31934 registerFile arguments to constructors.
31935
31936 * kjs/ExecState.h: Removed m_globalThisValue and
31937 m_registerFile data members.
31938
31939 * kjs/JSGlobalObject.cpp:
31940 (JSC::JSGlobalObject::init): Removed globalThisValue
31941 argument for ExecState constructor.
31942
31943 * kjs/JSGlobalObject.h:
31944 (JSC::JSGlobalObject::JSGlobalObject): Got rid of parameter
31945 for the init function.
31946
31947 2008-09-29 Geoffrey Garen <ggaren@apple.com>
31948
31949 Rubber-stamped by Cameron Zwarich.
31950
31951 Fixed https://bugs.webkit.org/show_bug.cgi?id=21225
31952 Machine::retrieveLastCaller should check for a NULL codeBlock
31953
31954 In order to crash, you would need to call retrieveCaller in a situation
31955 where you had two host call frames in a row in the register file. I
31956 don't know how to make that happen, or if it's even possible, so I don't
31957 have a test case -- but better safe than sorry!
31958
31959 * VM/Machine.cpp:
31960 (JSC::Machine::retrieveLastCaller):
31961
31962 2008-09-29 Geoffrey Garen <ggaren@apple.com>
31963
31964 Reviewed by Cameron Zwarich.
31965
31966 Store the callee ScopeChain, not the caller ScopeChain, in the call frame
31967 header. Nix the "scopeChain" local variable and ExecState::m_scopeChain, and
31968 access the callee ScopeChain through the call frame header instead.
31969
31970 Profit: call + return are simpler, because they don't have to update the
31971 "scopeChain" local variable, or ExecState::m_scopeChain.
31972
31973 Because CTI keeps "r" in a register, reading the callee ScopeChain relative
31974 to "r" can be very fast, in any cases we care to optimize.
31975
31976 0% speedup on empty function call benchmark. (5.5% speedup in bytecode.)
31977 0% speedup on SunSpider. (7.5% speedup on controlflow-recursive.)
31978 2% speedup on SunSpider --v8.
31979 2% speedup on v8 benchmark.
31980
31981 * VM/CTI.cpp: Changed scope chain access to read the scope chain from
31982 the call frame header. Sped up op_ret by changing it not to fuss with
31983 the "scopeChain" local variable or ExecState::m_scopeChain.
31984
31985 * VM/CTI.h: Updated CTI trampolines not to take a ScopeChainNode*
31986 argument, since that's stored in the call frame header now.
31987
31988 * VM/Machine.cpp: Access "scopeChain" and "codeBlock" through new helper
31989 functions that read from the call frame header. Updated functions operating
31990 on ExecState::m_callFrame to account for / take advantage of the fact that
31991 Exec:m_callFrame is now never NULL.
31992
31993 Fixed a bug in op_construct, where it would use the caller's default
31994 object prototype, rather than the callee's, when constructing a new object.
31995
31996 * VM/Machine.h: Made some helper functions available. Removed
31997 ScopeChainNode* arguments to a lot of functions, since the ScopeChainNode*
31998 is now stored in the call frame header.
31999
32000 * VM/RegisterFile.h: Renamed "CallerScopeChain" to "ScopeChain", since
32001 that's what it is now.
32002
32003 * kjs/DebuggerCallFrame.cpp: Updated for change to ExecState signature.
32004
32005 * kjs/ExecState.cpp:
32006 * kjs/ExecState.h: Nixed ExecState::m_callFrame, along with the unused
32007 isGlobalObject function.
32008
32009 * kjs/JSGlobalObject.cpp:
32010 * kjs/JSGlobalObject.h: Gave the global object a fake call frame in
32011 which to store the global scope chain, since our code now assumes that
32012 it can always read the scope chain out of the ExecState's call frame.
32013
32014 2008-09-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
32015
32016 Reviewed by Sam Weinig.
32017
32018 Remove the isActivationObject() virtual method on JSObject and use
32019 StructureID information instead. This should be slightly faster, but
32020 isActivationObject() is only used in assertions and unwinding the stack
32021 for exceptions.
32022
32023 * VM/Machine.cpp:
32024 (JSC::depth):
32025 (JSC::Machine::unwindCallFrame):
32026 (JSC::Machine::privateExecute):
32027 (JSC::Machine::cti_op_ret_activation):
32028 * kjs/JSActivation.cpp:
32029 * kjs/JSActivation.h:
32030 * kjs/JSObject.h:
32031
32032 2008-09-29 Peter Gal <galpeter@inf.u-szeged.hu>
32033
32034 Reviewed and tweaked by Darin Adler.
32035
32036 Fix build for non-all-in-one platforms.
32037
32038 * kjs/StringPrototype.cpp: Added missing ASCIICType.h include.
32039
32040 2008-09-29 Bradley T. Hughes <bradley.hughes@nokia.com>
32041
32042 Reviewed by Simon Hausmann.
32043
32044 Fix compilation with icpc
32045
32046 * wtf/HashSet.h:
32047 (WTF::::find):
32048 (WTF::::contains):
32049
32050 2008-09-29 Thiago Macieira <thiago.macieira@nokia.com>
32051
32052 Reviewed by Simon Hausmann.
32053
32054 Changed copyright from Trolltech ASA to Nokia.
32055
32056 Nokia acquired Trolltech ASA, assets were transferred on September 26th 2008.
32057
32058
32059 * wtf/qt/MainThreadQt.cpp:
32060
32061 2008-09-29 Simon Hausmann <hausmann@webkit.org>
32062
32063 Reviewed by Lars Knoll.
32064
32065 Don't accidentially install libJavaScriptCore.a for the build inside
32066 Qt.
32067
32068 * JavaScriptCore.pro:
32069
32070 2008-09-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
32071
32072 Reviewed by Maciej Stachowiak.
32073
32074 Bug 21200: Allow direct access to 'arguments' without using op_resolve
32075 <https://bugs.webkit.org/show_bug.cgi?id=21200>
32076
32077 Allow fast access to the 'arguments' object by adding an extra slot to
32078 the callframe to store it.
32079
32080 This is a 3.0% speedup on the V8 Raytrace benchmark.
32081
32082 * JavaScriptCore.exp:
32083 * VM/CTI.cpp:
32084 (JSC::CTI::privateCompileMainPass):
32085 * VM/CodeBlock.cpp:
32086 (JSC::CodeBlock::dump):
32087 * VM/CodeGenerator.cpp:
32088 (JSC::CodeGenerator::CodeGenerator):
32089 (JSC::CodeGenerator::registerFor):
32090 * VM/CodeGenerator.h:
32091 (JSC::CodeGenerator::registerFor):
32092 * VM/Machine.cpp:
32093 (JSC::Machine::initializeCallFrame):
32094 (JSC::Machine::dumpRegisters):
32095 (JSC::Machine::privateExecute):
32096 (JSC::Machine::retrieveArguments):
32097 (JSC::Machine::cti_op_call_JSFunction):
32098 (JSC::Machine::cti_op_create_arguments):
32099 (JSC::Machine::cti_op_construct_JSConstruct):
32100 * VM/Machine.h:
32101 * VM/Opcode.h:
32102 * VM/RegisterFile.h:
32103 (JSC::RegisterFile::):
32104 * kjs/JSActivation.cpp:
32105 (JSC::JSActivation::mark):
32106 (JSC::JSActivation::argumentsGetter):
32107 * kjs/JSActivation.h:
32108 (JSC::JSActivation::JSActivationData::JSActivationData):
32109 * kjs/NodeInfo.h:
32110 * kjs/Parser.cpp:
32111 (JSC::Parser::didFinishParsing):
32112 * kjs/Parser.h:
32113 (JSC::Parser::parse):
32114 * kjs/grammar.y:
32115 * kjs/nodes.cpp:
32116 (JSC::ScopeNode::ScopeNode):
32117 (JSC::ProgramNode::ProgramNode):
32118 (JSC::ProgramNode::create):
32119 (JSC::EvalNode::EvalNode):
32120 (JSC::EvalNode::create):
32121 (JSC::FunctionBodyNode::FunctionBodyNode):
32122 (JSC::FunctionBodyNode::create):
32123 * kjs/nodes.h:
32124 (JSC::ScopeNode::usesArguments):
32125
32126 2008-09-28 Mark Rowe <mrowe@apple.com>
32127
32128 Reviewed by Sam Weinig.
32129
32130 Add an ASCII fast-path to toLowerCase and toUpperCase.
32131
32132 The fast path speeds up the common case of an ASCII-only string by up to 60% while adding a less than 5% penalty
32133 to the less common non-ASCII case.
32134
32135 This also removes stringProtoFuncToLocaleLowerCase and stringProtoFuncToLocaleUpperCase, which were identical
32136 to the non-locale variants of the functions. toLocaleLowerCase and toLocaleUpperCase now use the non-locale
32137 variants of the functions directly.
32138
32139 * kjs/StringPrototype.cpp:
32140 (JSC::stringProtoFuncToLowerCase):
32141 (JSC::stringProtoFuncToUpperCase):
32142
32143 2008-09-28 Mark Rowe <mrowe@apple.com>
32144
32145 Reviewed by Cameron Zwarich.
32146
32147 Speed up parseInt and parseFloat.
32148
32149 Repeatedly indexing into a UString is slow, so retrieve a pointer into the underlying buffer once up front
32150 and use that instead. This is a 7% win on a parseInt/parseFloat micro-benchmark.
32151
32152 * kjs/JSGlobalObjectFunctions.cpp:
32153 (JSC::parseInt):
32154 (JSC::parseFloat):
32155
32156 2008-09-28 Simon Hausmann <hausmann@webkit.org>
32157
32158 Reviewed by David Hyatt.
32159
32160 In Qt's initializeThreading re-use an existing thread identifier for the main
32161 thread if it exists.
32162
32163 currentThread() implicitly creates new identifiers and it could be that
32164 it is called before initializeThreading().
32165
32166 * wtf/ThreadingQt.cpp:
32167 (WTF::initializeThreading):
32168
32169 2008-09-27 Keishi Hattori <casey.hattori@gmail.com>
32170
32171 Added Machine::retrieveCaller to the export list.
32172
32173 Reviewed by Kevin McCullough and Tim Hatcher.
32174
32175 * JavaScriptCore.exp: Added Machine::retrieveCaller.
32176
32177 2008-09-27 Anders Carlsson <andersca@apple.com>
32178
32179 Fix build.
32180
32181 * VM/CTI.cpp:
32182 (JSC::):
32183
32184 2008-09-27 Geoffrey Garen <ggaren@apple.com>
32185
32186 Reviewed by Cameron Zwarich.
32187
32188 https://bugs.webkit.org/show_bug.cgi?id=21175
32189
32190 Store the callee CodeBlock, not the caller CodeBlock, in the call frame
32191 header. Nix the "codeBlock" local variable, and access the callee
32192 CodeBlock through the call frame header instead.
32193
32194 Profit: call + return are simpler, because they don't have to update the
32195 "codeBlock" local variable.
32196
32197 Because CTI keeps "r" in a register, reading the callee CodeBlock relative
32198 to "r" can be very fast, in any cases we care to optimize. Presently,
32199 no such cases seem important.
32200
32201 Also, stop writing "dst" to the call frame header. CTI doesn't use it.
32202
32203 21.6% speedup on empty function call benchmark.
32204 3.8% speedup on SunSpider --v8.
32205 2.1% speedup on v8 benchmark.
32206 0.7% speedup on SunSpider (6% speedup on controlflow-recursive).
32207
32208 Small regression in bytecode, because currently every op_ret reads the
32209 callee CodeBlock to check needsFullScopeChain, and bytecode does not
32210 keep "r" in a register. On-balance, this is probably OK, since CTI is
32211 our high-performance execution model. Also, this should go away once
32212 we make needsFullScopeChain statically determinable at parse time.
32213
32214 * VM/CTI.cpp:
32215 (JSC::CTI::compileOpCall): The speedup!
32216 (JSC::CTI::privateCompileSlowCases): ditto
32217
32218 * VM/CTI.h:
32219 (JSC::): Fixed up magic trampoline constants to account for the nixed
32220 "codeBlock" argument.
32221 (JSC::CTI::execute): Changed trampoline function not to take a "codeBlock"
32222 argument, since codeBlock is now stored in the call frame header.
32223
32224 * VM/Machine.cpp: Read the callee CodeBlock from the register file. Use
32225 a NULL CallerRegisters in the call frame header to signal a built-in
32226 caller, since CodeBlock is now never NULL.
32227
32228 * VM/Machine.h: Made some stand-alone functions Machine member functions
32229 so they could call the private codeBlock() accessor in the Register
32230 class, of which Machine is a friend. Renamed "CallerCodeBlock" to
32231 "CodeBlock", since it's no longer the caller's CodeBlock.
32232
32233 * VM/RegisterFile.h: Marked some methods const to accommodate a
32234 const RegisterFile* being passed around in Machine.cpp.
32235
32236 2008-09-26 Jan Michael Alonzo <jmalonzo@webkit.org>
32237
32238 Gtk build fix. Not reviewed.
32239
32240 Narrow-down the target of the JavaScriptCore .lut.h generator so
32241 it won't try to create the WebCore .lut.hs.
32242
32243 * GNUmakefile.am:
32244
32245 2008-09-26 Matt Lilek <webkit@mattlilek.com>
32246
32247 Reviewed by Tim Hatcher.
32248
32249 Update FEATURE_DEFINES after ENABLE_CROSS_DOCUMENT_MESSAGING was removed.
32250
32251 * Configurations/JavaScriptCore.xcconfig:
32252
32253 2008-09-26 Cameron Zwarich <cwzwarich@uwaterloo.ca>
32254
32255 Rubber-stamped by Anders Carlson.
32256
32257 Change the name 'sc' to 'scopeChainNode' in a few places.
32258
32259 * kjs/nodes.cpp:
32260 (JSC::EvalNode::generateCode):
32261 (JSC::FunctionBodyNode::generateCode):
32262 (JSC::ProgramNode::generateCode):
32263
32264 2008-09-26 Sam Weinig <sam@webkit.org>
32265
32266 Reviewed by Darin Adler.
32267
32268 Patch for https://bugs.webkit.org/show_bug.cgi?id=21152
32269 Speedup static property get/put
32270
32271 Convert getting/setting static property values to use static functions
32272 instead of storing an integer and switching in getValueProperty/putValueProperty.
32273
32274 * kjs/JSObject.cpp:
32275 (JSC::JSObject::deleteProperty):
32276 (JSC::JSObject::getPropertyAttributes):
32277 * kjs/MathObject.cpp:
32278 (JSC::MathObject::getOwnPropertySlot):
32279 * kjs/NumberConstructor.cpp:
32280 (JSC::numberConstructorNaNValue):
32281 (JSC::numberConstructorNegInfinity):
32282 (JSC::numberConstructorPosInfinity):
32283 (JSC::numberConstructorMaxValue):
32284 (JSC::numberConstructorMinValue):
32285 * kjs/PropertySlot.h:
32286 (JSC::PropertySlot::):
32287 * kjs/RegExpConstructor.cpp:
32288 (JSC::regExpConstructorDollar1):
32289 (JSC::regExpConstructorDollar2):
32290 (JSC::regExpConstructorDollar3):
32291 (JSC::regExpConstructorDollar4):
32292 (JSC::regExpConstructorDollar5):
32293 (JSC::regExpConstructorDollar6):
32294 (JSC::regExpConstructorDollar7):
32295 (JSC::regExpConstructorDollar8):
32296 (JSC::regExpConstructorDollar9):
32297 (JSC::regExpConstructorInput):
32298 (JSC::regExpConstructorMultiline):
32299 (JSC::regExpConstructorLastMatch):
32300 (JSC::regExpConstructorLastParen):
32301 (JSC::regExpConstructorLeftContext):
32302 (JSC::regExpConstructorRightContext):
32303 (JSC::setRegExpConstructorInput):
32304 (JSC::setRegExpConstructorMultiline):
32305 (JSC::RegExpConstructor::setInput):
32306 (JSC::RegExpConstructor::setMultiline):
32307 (JSC::RegExpConstructor::multiline):
32308 * kjs/RegExpConstructor.h:
32309 * kjs/RegExpObject.cpp:
32310 (JSC::regExpObjectGlobal):
32311 (JSC::regExpObjectIgnoreCase):
32312 (JSC::regExpObjectMultiline):
32313 (JSC::regExpObjectSource):
32314 (JSC::regExpObjectLastIndex):
32315 (JSC::setRegExpObjectLastIndex):
32316 * kjs/RegExpObject.h:
32317 (JSC::RegExpObject::setLastIndex):
32318 (JSC::RegExpObject::lastIndex):
32319 (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
32320 * kjs/StructureID.cpp:
32321 (JSC::StructureID::getEnumerablePropertyNames):
32322 * kjs/create_hash_table:
32323 * kjs/lexer.cpp:
32324 (JSC::Lexer::lex):
32325 * kjs/lookup.cpp:
32326 (JSC::HashTable::createTable):
32327 (JSC::HashTable::deleteTable):
32328 (JSC::setUpStaticFunctionSlot):
32329 * kjs/lookup.h:
32330 (JSC::HashEntry::initialize):
32331 (JSC::HashEntry::setKey):
32332 (JSC::HashEntry::key):
32333 (JSC::HashEntry::attributes):
32334 (JSC::HashEntry::function):
32335 (JSC::HashEntry::functionLength):
32336 (JSC::HashEntry::propertyGetter):
32337 (JSC::HashEntry::propertyPutter):
32338 (JSC::HashEntry::lexerValue):
32339 (JSC::HashEntry::):
32340 (JSC::HashTable::entry):
32341 (JSC::getStaticPropertySlot):
32342 (JSC::getStaticValueSlot):
32343 (JSC::lookupPut):
32344
32345 2008-09-26 Gavin Barraclough <barraclough@apple.com>
32346
32347 Reviewed by Maciej Stachowiak & Oliver Hunt.
32348
32349 Add support for reusing temporary JSNumberCells. This change is based on the observation
32350 that if the result of certain operations is a JSNumberCell and is consumed by a subsequent
32351 operation that would produce a JSNumberCell, we can reuse the object rather than allocating
32352 a fresh one. E.g. given the expression ((a * b) * c), we can statically determine that
32353 (a * b) will have a numeric result (or else it will have thrown an exception), so the result
32354 will either be a JSNumberCell or a JSImmediate.
32355
32356 This patch changes three areas of JSC:
32357 * The AST now tracks type information about the result of each node.
32358 * This information is consumed in bytecode compilation, and certain bytecode operations
32359 now carry the statically determined type information about their operands.
32360 * CTI uses the information in a number of fashions:
32361 * Where an operand to certain arithmetic operations is reusable, it will plant code
32362 to try to perform the operation in JIT code & reuse the cell, where appropriate.
32363 * Where it can be statically determined that an operand can only be numeric (typically
32364 the result of another arithmetic operation) the code will not redundantly check that
32365 the JSCell is a JSNumberCell.
32366 * Where either of the operands to an add are non-numeric do not plant an optimized
32367 arithmetic code path, just call straight out to the C function.
32368
32369 +6% Sunspider (10% progression on 3D, 16% progression on math, 60% progression on access-nbody),
32370 +1% v8-tests (improvements in raytrace & crypto)
32371
32372 * VM/CTI.cpp: Add optimized code generation with reuse of temporary JSNumberCells.
32373 * VM/CTI.h:
32374 * kjs/JSNumberCell.h:
32375 * masm/X86Assembler.h:
32376
32377 * VM/CodeBlock.cpp: Add type information to specific bytecodes.
32378 * VM/CodeGenerator.cpp:
32379 * VM/CodeGenerator.h:
32380 * VM/Machine.cpp:
32381
32382 * kjs/nodes.cpp: Track static type information for nodes.
32383 * kjs/nodes.h:
32384 * kjs/ResultDescriptor.h: (Added)
32385 * JavaScriptCore.xcodeproj/project.pbxproj:
32386
32387 2008-09-26 Yichao Yin <yichao.yin@torchmobile.com.cn>
32388
32389 Reviewed by George Staikos, Maciej Stachowiak.
32390
32391 Add utility functions needed for upcoming WML code.
32392
32393 * wtf/ASCIICType.h:
32394 (WTF::isASCIIPrintable):
32395
32396 2008-09-26 Geoffrey Garen <ggaren@apple.com>
32397
32398 Reviewed by Darin Adler.
32399
32400 Reverted the part of r36614 that used static data because static data
32401 is not thread-safe.
32402
32403 2008-09-26 Geoffrey Garen <ggaren@apple.com>
32404
32405 Reviewed by Maciej Stachowiak.
32406
32407 Removed dynamic check for whether the callee needs an activation object.
32408 Replaced with callee code to create the activation object.
32409
32410 0.5% speedup on SunSpider.
32411 No change on v8 benchmark. (Might be a speedup, but it's in range of the
32412 variance.)
32413
32414 0.7% speedup on v8 benchmark in bytecode.
32415 1.3% speedup on empty call benchmark in bytecode.
32416
32417 * VM/CTI.cpp:
32418 (JSC::CTI::privateCompileMainPass): Added support for op_init_activation,
32419 the new opcode that specifies that the callee's initialization should
32420 create an activation object.
32421 (JSC::CTI::privateCompile): Removed previous code that did a similar
32422 thing in an ad-hoc way.
32423
32424 * VM/CodeBlock.cpp:
32425 (JSC::CodeBlock::dump): Added a case for dumping op_init_activation.
32426
32427 * VM/CodeGenerator.cpp:
32428 (JSC::CodeGenerator::generate): Added fixup code to change op_init to
32429 op_init_activation if necessary. (With a better parser, we would know
32430 which to use from the beginning.)
32431
32432 * VM/Instruction.h:
32433 (JSC::Instruction::Instruction):
32434 (WTF::): Faster traits for the instruction vector. An earlier version
32435 of this patch relied on inserting at the beginning of the vector, and
32436 depended on this change for speed.
32437
32438 * VM/Machine.cpp:
32439 (JSC::Machine::execute): Removed clients of setScopeChain, the old
32440 abstraction for dynamically checking for whether an activation object
32441 needed to be created.
32442 (JSC::Machine::privateExecute): ditto
32443
32444 (JSC::Machine::cti_op_push_activation): Renamed this function from
32445 cti_vm_updateScopeChain, and made it faster by removing the call to
32446 setScopeChain.
32447 * VM/Machine.h:
32448
32449 * VM/Opcode.h: Declared op_init_activation.
32450
32451 2008-09-24 Geoffrey Garen <ggaren@apple.com>
32452
32453 Reviewed by Maciej Stachowiak.
32454
32455 Move most of the return code back into the callee, now that the callee
32456 doesn't have to calculate anything dynamically.
32457
32458 11.5% speedup on empty function call benchmark.
32459
32460 SunSpider says 0.3% faster. SunSpider --v8 says no change.
32461
32462 * VM/CTI.cpp:
32463 (JSC::CTI::compileOpCall):
32464 (JSC::CTI::privateCompileMainPass):
32465 (JSC::CTI::privateCompileSlowCases):
32466
32467 2008-09-24 Sam Weinig <sam@webkit.org>
32468
32469 Reviewed by Maciej Stachowiak.
32470
32471 Remove staticFunctionGetter. There is only one remaining user of
32472 staticFunctionGetter and it can be converted to use setUpStaticFunctionSlot.
32473
32474 * JavaScriptCore.exp:
32475 * kjs/lookup.cpp:
32476 * kjs/lookup.h:
32477
32478 2008-09-24 Maciej Stachowiak <mjs@apple.com>
32479
32480 Reviewed by Oliver Hunt.
32481
32482 - inline JIT fast case of op_neq
32483 - remove extra level of function call indirection from slow cases of eq and neq
32484
32485 1% speedup on Richards
32486
32487 * VM/CTI.cpp:
32488 (JSC::CTI::privateCompileMainPass):
32489 (JSC::CTI::privateCompileSlowCases):
32490 * VM/Machine.cpp:
32491 (JSC::Machine::privateExecute):
32492 (JSC::Machine::cti_op_eq):
32493 (JSC::Machine::cti_op_neq):
32494 * kjs/operations.cpp:
32495 (JSC::equal):
32496 (JSC::equalSlowCase):
32497 * kjs/operations.h:
32498 (JSC::equalSlowCaseInline):
32499
32500 2008-09-24 Sam Weinig <sam@webkit.org>
32501
32502 Reviewed by Darin Adler.
32503
32504 Fix for https://bugs.webkit.org/show_bug.cgi?id=21080
32505 <rdar://problem/6243534>
32506 Crash below Function.apply when using a runtime array as the argument list
32507
32508 Test: plugins/bindings-array-apply-crash.html
32509
32510 * kjs/FunctionPrototype.cpp:
32511 (JSC::functionProtoFuncApply): Revert to the slow case if the object inherits from
32512 JSArray (via ClassInfo) but is not a JSArray.
32513
32514 2008-09-24 Kevin McCullough <kmccullough@apple.com>
32515
32516 Style change.
32517
32518 * kjs/nodes.cpp:
32519 (JSC::statementListEmitCode):
32520
32521 2008-09-24 Kevin McCullough <kmccullough@apple.com>
32522
32523 Reviewed by Geoff.
32524
32525 Bug 21031: Breakpoints in the condition of loops only breaks the first
32526 time
32527 - Now when setting breakpoints in the condition of a loop (for, while,
32528 for in, and do while) will successfully break each time throught the
32529 loop.
32530 - For 'for' loops we need a little more complicated behavior that cannot
32531 be accomplished without some more significant changes:
32532 https://bugs.webkit.org/show_bug.cgi?id=21073
32533
32534 * kjs/nodes.cpp:
32535 (JSC::statementListEmitCode): We don't want to blindly emit a debug hook
32536 at the first line of loops, instead let the loop emit the debug hooks.
32537 (JSC::DoWhileNode::emitCode):
32538 (JSC::WhileNode::emitCode):
32539 (JSC::ForNode::emitCode):
32540 (JSC::ForInNode::emitCode):
32541 * kjs/nodes.h:
32542 (JSC::StatementNode::):
32543 (JSC::DoWhileNode::):
32544 (JSC::WhileNode::):
32545 (JSC::ForInNode::):
32546
32547 2008-09-24 Geoffrey Garen <ggaren@apple.com>
32548
32549 Reviewed by Darin Adler.
32550
32551 Fixed <rdar://problem/5605532> Need a SPI for telling JS the size of
32552 the objects it retains
32553
32554 * API/tests/testapi.c: Test the new SPI a little.
32555
32556 * API/JSSPI.cpp: Add the new SPI.
32557 * API/JSSPI.h: Add the new SPI.
32558 * JavaScriptCore.exp: Add the new SPI.
32559 * JavaScriptCore.xcodeproj/project.pbxproj: Add the new SPI.
32560
32561 2008-09-24 Geoffrey Garen <ggaren@apple.com>
32562
32563 Reviewed by Darin Adler.
32564
32565 * API/JSBase.h: Filled in some missing function names.
32566
32567 2008-09-24 Geoffrey Garen <ggaren@apple.com>
32568
32569 Reviewed by Cameron Zwarich.
32570
32571 Fixed https://bugs.webkit.org/show_bug.cgi?id=21057
32572 Crash in RegisterID::deref() running fast/canvas/canvas-putImageData.html
32573
32574 * VM/CodeGenerator.h: Changed declaration order to ensure the
32575 m_lastConstant, which is a RefPtr that points into m_calleeRegisters,
32576 has its destructor called before the destructor for m_calleeRegisters.
32577
32578 2008-09-24 Darin Adler <darin@apple.com>
32579
32580 Reviewed by Sam Weinig.
32581
32582 - https://bugs.webkit.org/show_bug.cgi?id=21047
32583 speed up ret_activation with inlining
32584
32585 About 1% on v8-raytrace.
32586
32587 * JavaScriptCore.exp: Removed JSVariableObject::setRegisters.
32588
32589 * kjs/JSActivation.cpp: Moved copyRegisters to the header to make it inline.
32590 * kjs/JSActivation.h:
32591 (JSC::JSActivation::copyRegisters): Moved here. Also removed the registerArraySize
32592 argument to setRegisters, since the object doesn't need to store the number of
32593 registers.
32594
32595 * kjs/JSGlobalObject.cpp:
32596 (JSC::JSGlobalObject::reset): Removed unnecessary clearing left over from when we
32597 used this on objects that weren't brand new. These days, this function is really
32598 just part of the constructor.
32599
32600 * kjs/JSGlobalObject.h: Added registerArraySize to JSGlobalObjectData, since
32601 JSVariableObjectData no longer needs it. Added a setRegisters override here
32602 that handles storing the size.
32603
32604 * kjs/JSStaticScopeObject.h: Removed code to set registerArraySize, since it
32605 no longer exists.
32606
32607 * kjs/JSVariableObject.cpp: Moved copyRegisterArray and setRegisters to the
32608 header to make them inline.
32609 * kjs/JSVariableObject.h: Removed registerArraySize from JSVariableObjectData,
32610 since it was only used for the global object.
32611 (JSC::JSVariableObject::copyRegisterArray): Moved here ot make it inline.
32612 (JSC::JSVariableObject::setRegisters): Moved here to make it inline. Also
32613 removed the code to set registerArraySize and changed an if statement into
32614 an assert to save an unnnecessary branch.
32615
32616 2008-09-24 Maciej Stachowiak <mjs@apple.com>
32617
32618 Reviewed by Oliver Hunt.
32619
32620 - inline PropertyMap::getOffset to speed up polymorphic lookups
32621
32622 ~1.5% speedup on v8 benchmark
32623 no effect on SunSpider
32624
32625 * JavaScriptCore.exp:
32626 * kjs/PropertyMap.cpp:
32627 * kjs/PropertyMap.h:
32628 (JSC::PropertyMap::getOffset):
32629
32630 2008-09-24 Jan Michael Alonzo <jmalonzo@webkit.org>
32631
32632 Reviewed by Alp Toker.
32633
32634 https://bugs.webkit.org/show_bug.cgi?id=20992
32635 Build fails on GTK+ Mac OS
32636
32637 * wtf/ThreadingGtk.cpp: Remove platform ifdef as suggested by
32638 Richard Hult.
32639 (WTF::initializeThreading):
32640
32641 2008-09-23 Oliver Hunt <oliver@apple.com>
32642
32643 Reviewed by Maciej Stachowiak.
32644
32645 Bug 19968: Slow Script at www.huffingtonpost.com
32646 <https://bugs.webkit.org/show_bug.cgi?id=19968>
32647
32648 Finally found the cause of this accursed issue. It is triggered
32649 by synchronous creation of a new global object from JS. The new
32650 global object resets the timer state in this execution group's
32651 Machine, taking timerCheckCount to 0. Then when JS returns the
32652 timerCheckCount is decremented making it non-zero. The next time
32653 we execute JS we will start the timeout counter, however the non-zero
32654 timeoutCheckCount means we don't reset the timer information. This
32655 means that the timeout check is now checking the cumulative time
32656 since the creation of the global object rather than the time since
32657 JS was last entered. At this point the slow script dialog is guaranteed
32658 to eventually be displayed incorrectly unless a page is loaded
32659 asynchronously (which will reset everything into a sane state).
32660
32661 The fix for this is rather trivial -- the JSGlobalObject constructor
32662 should not be resetting the machine timer state.
32663
32664 * VM/Machine.cpp:
32665 (JSC::Machine::Machine):
32666 Now that we can't rely on the GlobalObject initialising the timeout
32667 state, we do it in the Machine constructor.
32668
32669 * VM/Machine.h:
32670 (JSC::Machine::stopTimeoutCheck):
32671 Add assertions to guard against this happening.
32672
32673 * kjs/JSGlobalObject.cpp:
32674 (JSC::JSGlobalObject::init):
32675 Don't reset the timeout state.
32676
32677 2008-09-23 Geoffrey Garen <ggaren@apple.com>
32678
32679 Reviewed by Oliver Hunt.
32680
32681 Fixed https://bugs.webkit.org/show_bug.cgi?id=21038 | <rdar://problem/6240812>
32682 Uncaught exceptions in regex replace callbacks crash webkit
32683
32684 This was a combination of two problems:
32685
32686 (1) the replace function would continue execution after an exception
32687 had been thrown.
32688
32689 (2) In some cases, the Machine would return 0 in the case of an exception,
32690 despite the fact that a few clients dereference the Machine's return
32691 value without first checking for an exception.
32692
32693 * VM/Machine.cpp:
32694 (JSC::Machine::execute):
32695
32696 ^ Return jsNull() instead of 0 in the case of an exception, since some
32697 clients depend on using our return value.
32698
32699 ^ ASSERT that execution does not continue after an exception has been
32700 thrown, to help catch problems like this in the future.
32701
32702 * kjs/StringPrototype.cpp:
32703 (JSC::stringProtoFuncReplace):
32704
32705 ^ Stop execution if an exception has been thrown.
32706
32707 2008-09-23 Geoffrey Garen <ggaren@apple.com>
32708
32709 Try to fix the windows build.
32710
32711 * VM/CTI.cpp:
32712 (JSC::CTI::compileOpCall):
32713 (JSC::CTI::privateCompileMainPass):
32714
32715 2008-09-23 Alp Toker <alp@nuanti.com>
32716
32717 Build fix.
32718
32719 * VM/CTI.h:
32720
32721 2008-09-23 Geoffrey Garen <ggaren@apple.com>
32722
32723 Reviewed by Darin Adler.
32724
32725 * wtf/Platform.h: Removed duplicate #if.
32726
32727 2008-09-23 Geoffrey Garen <ggaren@apple.com>
32728
32729 Reviewed by Darin Adler.
32730
32731 Changed the layout of the call frame from
32732
32733 { header, parameters, locals | constants, temporaries }
32734
32735 to
32736
32737 { parameters, header | locals, constants, temporaries }
32738
32739 This simplifies function entry+exit, and enables a number of future
32740 optimizations.
32741
32742 13.5% speedup on empty call benchmark for bytecode; 23.6% speedup on
32743 empty call benchmark for CTI.
32744
32745 SunSpider says no change. SunSpider --v8 says 1% faster.
32746
32747 * VM/CTI.cpp:
32748
32749 Added a bit of abstraction for calculating whether a register is a
32750 constant, since this patch changes that calculation:
32751 (JSC::CTI::isConstant):
32752 (JSC::CTI::getConstant):
32753 (JSC::CTI::emitGetArg):
32754 (JSC::CTI::emitGetPutArg):
32755 (JSC::CTI::getConstantImmediateNumericArg):
32756
32757 Updated for changes to callframe header location:
32758 (JSC::CTI::emitPutToCallFrameHeader):
32759 (JSC::CTI::emitGetFromCallFrameHeader):
32760 (JSC::CTI::printOpcodeOperandTypes):
32761
32762 Renamed to spite Oliver:
32763 (JSC::CTI::emitInitRegister):
32764
32765 Added an abstraction for emitting a call through a register, so that
32766 calls through registers generate exception info, too:
32767 (JSC::CTI::emitCall):
32768
32769 Updated to match the new callframe header layout, and to support calls
32770 through registers, which have no destination address:
32771 (JSC::CTI::compileOpCall):
32772 (JSC::CTI::privateCompileMainPass):
32773 (JSC::CTI::privateCompileSlowCases):
32774 (JSC::CTI::privateCompile):
32775
32776 * VM/CTI.h:
32777
32778 More of the above:
32779 (JSC::CallRecord::CallRecord):
32780
32781 * VM/CodeBlock.cpp:
32782
32783 Updated for new register layout:
32784 (JSC::registerName):
32785 (JSC::CodeBlock::dump):
32786
32787 * VM/CodeBlock.h:
32788
32789 Updated CodeBlock to track slightly different information about the
32790 register frame, and tweaked the style of an ASSERT_NOT_REACHED.
32791 (JSC::CodeBlock::CodeBlock):
32792 (JSC::CodeBlock::getStubInfo):
32793
32794 * VM/CodeGenerator.cpp:
32795
32796 Added some abstraction around constant register allocation, since this
32797 patch changes it, changed codegen to account for the new callframe
32798 layout, and added abstraction around register fetching code
32799 that used to assume that all local registers lived at negative indices,
32800 since vars now live at positive indices:
32801 (JSC::CodeGenerator::generate):
32802 (JSC::CodeGenerator::addVar):
32803 (JSC::CodeGenerator::addGlobalVar):
32804 (JSC::CodeGenerator::allocateConstants):
32805 (JSC::CodeGenerator::CodeGenerator):
32806 (JSC::CodeGenerator::addParameter):
32807 (JSC::CodeGenerator::registerFor):
32808 (JSC::CodeGenerator::constRegisterFor):
32809 (JSC::CodeGenerator::newRegister):
32810 (JSC::CodeGenerator::newTemporary):
32811 (JSC::CodeGenerator::highestUsedRegister):
32812 (JSC::CodeGenerator::addConstant):
32813
32814 ASSERT that our caller referenced the registers it passed to us.
32815 Otherwise, we might overwrite them with parameters:
32816 (JSC::CodeGenerator::emitCall):
32817 (JSC::CodeGenerator::emitConstruct):
32818
32819 * VM/CodeGenerator.h:
32820
32821 Added some abstraction for getting a RegisterID for a given index,
32822 since the rules are a little weird:
32823 (JSC::CodeGenerator::registerFor):
32824
32825 * VM/Machine.cpp:
32826
32827 Utility function to transform a machine return PC to a virtual machine
32828 return VPC, for the sake of stack unwinding, since both PCs are stored
32829 in the same location now:
32830 (JSC::vPCForPC):
32831
32832 Tweaked to account for new call frame:
32833 (JSC::Machine::initializeCallFrame):
32834
32835 Tweaked to account for registerOffset supplied by caller:
32836 (JSC::slideRegisterWindowForCall):
32837
32838 Tweaked to account for new register layout:
32839 (JSC::scopeChainForCall):
32840 (JSC::Machine::callEval):
32841 (JSC::Machine::dumpRegisters):
32842 (JSC::Machine::unwindCallFrame):
32843 (JSC::Machine::execute):
32844
32845 Changed op_call and op_construct to implement the new calling convention:
32846 (JSC::Machine::privateExecute):
32847
32848 Tweaked to account for the new register layout:
32849 (JSC::Machine::retrieveArguments):
32850 (JSC::Machine::retrieveCaller):
32851 (JSC::Machine::retrieveLastCaller):
32852 (JSC::Machine::callFrame):
32853 (JSC::Machine::getArgumentsData):
32854
32855 Changed CTI call helpers to implement the new calling convention:
32856 (JSC::Machine::cti_op_call_JSFunction):
32857 (JSC::Machine::cti_op_call_NotJSFunction):
32858 (JSC::Machine::cti_op_ret_activation):
32859 (JSC::Machine::cti_op_ret_profiler):
32860 (JSC::Machine::cti_op_construct_JSConstruct):
32861 (JSC::Machine::cti_op_construct_NotJSConstruct):
32862 (JSC::Machine::cti_op_call_eval):
32863
32864 * VM/Machine.h:
32865
32866 * VM/Opcode.h:
32867
32868 Renamed op_initialise_locals to op_init, because this opcode
32869 doesn't initialize all locals, and it doesn't initialize only locals.
32870 Also, to spite Oliver.
32871
32872 * VM/RegisterFile.h:
32873
32874 New call frame enumeration values:
32875 (JSC::RegisterFile::):
32876
32877 Simplified the calculation of whether a RegisterID is a temporary,
32878 since we can no longer assume that all positive non-constant registers
32879 are temporaries:
32880 * VM/RegisterID.h:
32881 (JSC::RegisterID::RegisterID):
32882 (JSC::RegisterID::setTemporary):
32883 (JSC::RegisterID::isTemporary):
32884
32885 Renamed firstArgumentIndex to firstParameterIndex because the assumption
32886 that this variable pertained to the actual arguments supplied by the
32887 caller caused me to write some buggy code:
32888 * kjs/Arguments.cpp:
32889 (JSC::ArgumentsData::ArgumentsData):
32890 (JSC::Arguments::Arguments):
32891 (JSC::Arguments::fillArgList):
32892 (JSC::Arguments::getOwnPropertySlot):
32893 (JSC::Arguments::put):
32894
32895 Updated for new call frame layout:
32896 * kjs/DebuggerCallFrame.cpp:
32897 (JSC::DebuggerCallFrame::functionName):
32898 (JSC::DebuggerCallFrame::type):
32899 * kjs/DebuggerCallFrame.h:
32900
32901 Changed the activation object to account for the fact that a call frame
32902 header now sits between parameters and local variables. This change
32903 requires all variable objects to do their own marking, since they
32904 now use their register storage differently:
32905 * kjs/JSActivation.cpp:
32906 (JSC::JSActivation::mark):
32907 (JSC::JSActivation::copyRegisters):
32908 (JSC::JSActivation::createArgumentsObject):
32909 * kjs/JSActivation.h:
32910
32911 Updated global object to use the new interfaces required by the change
32912 to JSActivation above:
32913 * kjs/JSGlobalObject.cpp:
32914 (JSC::JSGlobalObject::reset):
32915 (JSC::JSGlobalObject::mark):
32916 (JSC::JSGlobalObject::copyGlobalsFrom):
32917 (JSC::JSGlobalObject::copyGlobalsTo):
32918 * kjs/JSGlobalObject.h:
32919 (JSC::JSGlobalObject::addStaticGlobals):
32920
32921 Updated static scope object to use the new interfaces required by the
32922 change to JSActivation above:
32923 * kjs/JSStaticScopeObject.cpp:
32924 (JSC::JSStaticScopeObject::mark):
32925 (JSC::JSStaticScopeObject::~JSStaticScopeObject):
32926 * kjs/JSStaticScopeObject.h:
32927 (JSC::JSStaticScopeObject::JSStaticScopeObject):
32928 (JSC::JSStaticScopeObject::d):
32929
32930 Updated variable object to use the new interfaces required by the
32931 change to JSActivation above:
32932 * kjs/JSVariableObject.cpp:
32933 (JSC::JSVariableObject::copyRegisterArray):
32934 (JSC::JSVariableObject::setRegisters):
32935 * kjs/JSVariableObject.h:
32936
32937 Changed the bit twiddling in symbol table not to assume that all indices
32938 are negative, since they can be positive now:
32939 * kjs/SymbolTable.h:
32940 (JSC::SymbolTableEntry::SymbolTableEntry):
32941 (JSC::SymbolTableEntry::isNull):
32942 (JSC::SymbolTableEntry::getIndex):
32943 (JSC::SymbolTableEntry::getAttributes):
32944 (JSC::SymbolTableEntry::setAttributes):
32945 (JSC::SymbolTableEntry::isReadOnly):
32946 (JSC::SymbolTableEntry::pack):
32947 (JSC::SymbolTableEntry::isValidIndex):
32948
32949 Changed call and construct nodes to ref their functions and/or bases,
32950 so that emitCall/emitConstruct doesn't overwrite them with parameters.
32951 Also, updated for rename to registerFor:
32952 * kjs/nodes.cpp:
32953 (JSC::ResolveNode::emitCode):
32954 (JSC::NewExprNode::emitCode):
32955 (JSC::EvalFunctionCallNode::emitCode):
32956 (JSC::FunctionCallValueNode::emitCode):
32957 (JSC::FunctionCallResolveNode::emitCode):
32958 (JSC::FunctionCallBracketNode::emitCode):
32959 (JSC::FunctionCallDotNode::emitCode):
32960 (JSC::PostfixResolveNode::emitCode):
32961 (JSC::DeleteResolveNode::emitCode):
32962 (JSC::TypeOfResolveNode::emitCode):
32963 (JSC::PrefixResolveNode::emitCode):
32964 (JSC::ReadModifyResolveNode::emitCode):
32965 (JSC::AssignResolveNode::emitCode):
32966 (JSC::ConstDeclNode::emitCodeSingle):
32967 (JSC::ForInNode::emitCode):
32968
32969 Added abstraction for getting exception info out of a call through a
32970 register:
32971 * masm/X86Assembler.h:
32972 (JSC::X86Assembler::emitCall):
32973
32974 Removed duplicate #if:
32975 * wtf/Platform.h:
32976
32977 2008-09-23 Kevin McCullough <kmccullough@apple.com>
32978
32979 Reviewed by Darin.
32980
32981 Bug 21030: The JS debugger breaks on the do of a do-while not the while
32982 (where the conditional statement is)
32983 https://bugs.webkit.org/show_bug.cgi?id=21030
32984 Now the statementListEmitCode detects if a do-while node is being
32985 emited and emits the debug hook on the last line instead of the first.
32986
32987 This change had no effect on sunspider.
32988
32989 * kjs/nodes.cpp:
32990 (JSC::statementListEmitCode):
32991 * kjs/nodes.h:
32992 (JSC::StatementNode::isDoWhile):
32993 (JSC::DoWhileNode::isDoWhile):
32994
32995 2008-09-23 Maciej Stachowiak <mjs@apple.com>
32996
32997 Reviewed by Cameron Zwarich.
32998
32999 - inline the fast case of instanceof
33000 https://bugs.webkit.org/show_bug.cgi?id=20818
33001
33002 ~2% speedup on EarleyBoyer test.
33003
33004 * VM/CTI.cpp:
33005 (JSC::CTI::privateCompileMainPass):
33006 (JSC::CTI::privateCompileSlowCases):
33007 * VM/Machine.cpp:
33008 (JSC::Machine::cti_op_instanceof):
33009
33010 2008-09-23 Maciej Stachowiak <mjs@apple.com>
33011
33012 Reviewed by Cameron Zwarich.
33013
33014 - add forgotten slow case logic for !==
33015
33016 * VM/CTI.cpp:
33017 (JSC::CTI::privateCompileSlowCases):
33018
33019 2008-09-23 Maciej Stachowiak <mjs@apple.com>
33020
33021 Reviewed by Cameron Zwarich.
33022
33023 - inline the fast cases of !==, same as for ===
33024
33025 2.9% speedup on EarleyBoyer benchmark
33026
33027 * VM/CTI.cpp:
33028 (JSC::CTI::compileOpStrictEq): Factored stricteq codegen into this function,
33029 and parameterized so it can do the reverse version as well.
33030 (JSC::CTI::privateCompileMainPass): Use the above for stricteq and nstricteq.
33031 * VM/CTI.h:
33032 (JSC::CTI::): Declare above stuff.
33033 * VM/Machine.cpp:
33034 (JSC::Machine::cti_op_nstricteq): Removed fast cases, now handled inline.
33035
33036 2008-09-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
33037
33038 Reviewed by Oliver Hunt.
33039
33040 Bug 20989: Aguments constructor should put 'callee' and 'length' properties in a more efficient way
33041 <https://bugs.webkit.org/show_bug.cgi?id=20989>
33042
33043 Make special cases for the 'callee' and 'length' properties in the
33044 Arguments object.
33045
33046 This is somewhere between a 7.8% speedup and a 10% speedup on the V8
33047 Raytrace benchmark, depending on whether it is run alone or with the
33048 other V8 benchmarks.
33049
33050 * kjs/Arguments.cpp:
33051 (JSC::ArgumentsData::ArgumentsData):
33052 (JSC::Arguments::Arguments):
33053 (JSC::Arguments::mark):
33054 (JSC::Arguments::getOwnPropertySlot):
33055 (JSC::Arguments::put):
33056 (JSC::Arguments::deleteProperty):
33057
33058 2008-09-23 Maciej Stachowiak <mjs@apple.com>
33059
33060 Reviewed by Darin.
33061
33062 - speed up instanceof some more
33063 https://bugs.webkit.org/show_bug.cgi?id=20818
33064
33065 ~2% speedup on EarleyBoyer
33066
33067 The idea here is to record in the StructureID whether the class
33068 needs a special hasInstance or if it can use the normal logic from
33069 JSObject.
33070
33071 Based on this I inlined the real work directly into
33072 cti_op_instanceof and put the fastest checks up front and the
33073 error handling at the end (so it should be fairly straightforward
33074 to split off the beginning to be inlined if desired).
33075
33076 I only did this for CTI, not the bytecode interpreter.
33077
33078 * API/JSCallbackObject.h:
33079 (JSC::JSCallbackObject::createStructureID):
33080 * ChangeLog:
33081 * VM/Machine.cpp:
33082 (JSC::Machine::cti_op_instanceof):
33083 * kjs/JSImmediate.h:
33084 (JSC::JSImmediate::isAnyImmediate):
33085 * kjs/TypeInfo.h:
33086 (JSC::TypeInfo::overridesHasInstance):
33087 (JSC::TypeInfo::flags):
33088
33089 2008-09-22 Darin Adler <darin@apple.com>
33090
33091 Reviewed by Sam Weinig.
33092
33093 - https://bugs.webkit.org/show_bug.cgi?id=21019
33094 make FunctionBodyNode::ref/deref fast
33095
33096 Speeds up v8-raytrace by 7.2%.
33097
33098 * kjs/nodes.cpp:
33099 (JSC::FunctionBodyNode::FunctionBodyNode): Initialize m_refCount to 0.
33100 * kjs/nodes.h:
33101 (JSC::FunctionBodyNode::ref): Call base class ref once, and thereafter use
33102 m_refCount.
33103 (JSC::FunctionBodyNode::deref): Ditto, but the deref side.
33104
33105 2008-09-22 Darin Adler <darin@apple.com>
33106
33107 Pointed out by Sam Weinig.
33108
33109 * kjs/Arguments.cpp:
33110 (JSC::Arguments::fillArgList): Fix bad copy and paste. Oops!
33111
33112 2008-09-22 Darin Adler <darin@apple.com>
33113
33114 Reviewed by Cameron Zwarich.
33115
33116 - https://bugs.webkit.org/show_bug.cgi?id=20983
33117 ArgumentsData should have some room to allocate some extra arguments inline
33118
33119 Speeds up v8-raytrace by 5%.
33120
33121 * kjs/Arguments.cpp:
33122 (JSC::ArgumentsData::ArgumentsData): Use a fixed buffer if there are 4 or fewer
33123 extra arguments.
33124 (JSC::Arguments::Arguments): Use a fixed buffer if there are 4 or fewer
33125 extra arguments.
33126 (JSC::Arguments::~Arguments): Delete the buffer if necessary.
33127 (JSC::Arguments::mark): Update since extraArguments are now Register.
33128 (JSC::Arguments::fillArgList): Added special case for the only case that's
33129 actually used in the practice, when there are no parameters. There are some
33130 other special cases in there too, but that's the only one that matters.
33131 (JSC::Arguments::getOwnPropertySlot): Updated to use setValueSlot since there's
33132 no operation to get you at the JSValue* inside a Register as a "slot".
33133
33134 2008-09-22 Sam Weinig <sam@webkit.org>
33135
33136 Reviewed by Maciej Stachowiak.
33137
33138 Patch for https://bugs.webkit.org/show_bug.cgi?id=21014
33139 Speed up for..in by using StructureID to avoid calls to hasProperty
33140
33141 Speeds up fasta by 8%.
33142
33143 * VM/JSPropertyNameIterator.cpp:
33144 (JSC::JSPropertyNameIterator::invalidate):
33145 * VM/JSPropertyNameIterator.h:
33146 (JSC::JSPropertyNameIterator::next):
33147 * kjs/PropertyNameArray.h:
33148 (JSC::PropertyNameArrayData::begin):
33149 (JSC::PropertyNameArrayData::end):
33150 (JSC::PropertyNameArrayData::setCachedStructureID):
33151 (JSC::PropertyNameArrayData::cachedStructureID):
33152 * kjs/StructureID.cpp:
33153 (JSC::StructureID::getEnumerablePropertyNames):
33154 (JSC::structureIDChainsAreEqual):
33155 * kjs/StructureID.h:
33156
33157 2008-09-22 Kelvin Sherlock <ksherlock@gmail.com>
33158
33159 Updated and tweaked by Sam Weinig.
33160
33161 Reviewed by Geoffrey Garen.
33162
33163 Bug 20020: Proposed enhancement to JavaScriptCore API
33164 <https://bugs.webkit.org/show_bug.cgi?id=20020>
33165
33166 Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp
33167 functions to create JavaScript Array, Date, Error, and RegExp objects, respectively.
33168
33169 * API/JSObjectRef.cpp: The functions
33170 * API/JSObjectRef.h: Function prototype and documentation
33171 * JavaScriptCore.exp: Added functions to exported function list
33172 * API/tests/testapi.c: Added basic functionality tests.
33173
33174 * kjs/DateConstructor.cpp:
33175 Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
33176 with JSObject* constructDate(ExecState* exec, const ArgList& args).
33177 Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function
33178
33179 * kjs/DateConstructor.h:
33180 added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args)
33181
33182 * kjs/ErrorConstructor.cpp:
33183 removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args)
33184
33185 * kjs/ErrorConstructor.h:
33186 added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args)
33187
33188 * kjs/RegExpConstructor.cpp:
33189 removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args)
33190
33191 * kjs/RegExpConstructor.h:
33192 added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args)
33193
33194 2008-09-22 Matt Lilek <webkit@mattlilek.com>
33195
33196 Not reviewed, Windows build fix.
33197
33198 * kjs/Arguments.cpp:
33199 * kjs/FunctionPrototype.cpp:
33200
33201 2008-09-22 Sam Weinig <sam@webkit.org>
33202
33203 Reviewed by Darin Adler.
33204
33205 Patch for https://bugs.webkit.org/show_bug.cgi?id=20982
33206 Speed up the apply method of functions by special-casing array and 'arguments' objects
33207
33208 1% speedup on v8-raytrace.
33209
33210 Test: fast/js/function-apply.html
33211
33212 * kjs/Arguments.cpp:
33213 (JSC::Arguments::fillArgList):
33214 * kjs/Arguments.h:
33215 * kjs/FunctionPrototype.cpp:
33216 (JSC::functionProtoFuncApply):
33217 * kjs/JSArray.cpp:
33218 (JSC::JSArray::fillArgList):
33219 * kjs/JSArray.h:
33220
33221 2008-09-22 Darin Adler <darin@apple.com>
33222
33223 Reviewed by Sam Weinig.
33224
33225 - https://bugs.webkit.org/show_bug.cgi?id=20993
33226 Array.push/pop need optimized cases for JSArray
33227
33228 3% or so speedup on DeltaBlue benchmark.
33229
33230 * kjs/ArrayPrototype.cpp:
33231 (JSC::arrayProtoFuncPop): Call JSArray::pop when appropriate.
33232 (JSC::arrayProtoFuncPush): Call JSArray::push when appropriate.
33233
33234 * kjs/JSArray.cpp:
33235 (JSC::JSArray::putSlowCase): Set m_fastAccessCutoff when appropriate, getting
33236 us into the fast code path.
33237 (JSC::JSArray::pop): Added.
33238 (JSC::JSArray::push): Added.
33239 * kjs/JSArray.h: Added push and pop.
33240
33241 * kjs/operations.cpp:
33242 (JSC::throwOutOfMemoryError): Don't inline this. Helps us avoid PIC branches.
33243
33244 2008-09-22 Maciej Stachowiak <mjs@apple.com>
33245
33246 Reviewed by Cameron Zwarich.
33247
33248 - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
33249
33250 Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
33251
33252 2.2% speedup on EarleyBoyer benchmark.
33253
33254 * API/JSCallbackConstructor.cpp:
33255 * API/JSCallbackConstructor.h:
33256 (JSC::JSCallbackConstructor::createStructureID):
33257 * API/JSCallbackFunction.cpp:
33258 * API/JSCallbackFunction.h:
33259 (JSC::JSCallbackFunction::createStructureID):
33260 * API/JSCallbackObject.h:
33261 (JSC::JSCallbackObject::createStructureID):
33262 * API/JSCallbackObjectFunctions.h:
33263 (JSC::::hasInstance):
33264 * API/JSValueRef.cpp:
33265 (JSValueIsInstanceOfConstructor):
33266 * JavaScriptCore.exp:
33267 * VM/Machine.cpp:
33268 (JSC::Machine::privateExecute):
33269 (JSC::Machine::cti_op_instanceof):
33270 * kjs/InternalFunction.cpp:
33271 * kjs/InternalFunction.h:
33272 (JSC::InternalFunction::createStructureID):
33273 * kjs/JSObject.cpp:
33274 * kjs/JSObject.h:
33275 * kjs/TypeInfo.h:
33276 (JSC::TypeInfo::implementsHasInstance):
33277
33278 2008-09-22 Maciej Stachowiak <mjs@apple.com>
33279
33280 Reviewed by Dave Hyatt.
33281
33282 Based on initial work by Darin Adler.
33283
33284 - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
33285 - use this to JIT inline code for eq_null and neq_null
33286 https://bugs.webkit.org/show_bug.cgi?id=20823
33287
33288 0.5% speedup on SunSpider
33289 ~4% speedup on Richards benchmark
33290
33291 * VM/CTI.cpp:
33292 (JSC::CTI::privateCompileMainPass):
33293 * VM/Machine.cpp:
33294 (JSC::jsTypeStringForValue):
33295 (JSC::jsIsObjectType):
33296 (JSC::Machine::privateExecute):
33297 (JSC::Machine::cti_op_is_undefined):
33298 * VM/Machine.h:
33299 * kjs/JSCell.h:
33300 * kjs/JSValue.h:
33301 * kjs/StringObjectThatMasqueradesAsUndefined.h:
33302 (JSC::StringObjectThatMasqueradesAsUndefined::create):
33303 (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
33304 * kjs/StructureID.h:
33305 (JSC::StructureID::mutableTypeInfo):
33306 * kjs/TypeInfo.h:
33307 (JSC::TypeInfo::TypeInfo):
33308 (JSC::TypeInfo::masqueradesAsUndefined):
33309 * kjs/operations.cpp:
33310 (JSC::equal):
33311 * masm/X86Assembler.h:
33312 (JSC::X86Assembler::):
33313 (JSC::X86Assembler::setne_r):
33314 (JSC::X86Assembler::setnz_r):
33315 (JSC::X86Assembler::testl_i32m):
33316
33317 2008-09-22 Tor Arne Vestbø <tavestbo@trolltech.com>
33318
33319 Reviewed by Simon.
33320
33321 Initialize QCoreApplication in kjs binary/Shell.cpp
33322
33323 This allows us to use QCoreApplication::instance() to
33324 get the main thread in ThreadingQt.cpp
33325
33326 * kjs/Shell.cpp:
33327 (main):
33328 * wtf/ThreadingQt.cpp:
33329 (WTF::initializeThreading):
33330
33331 2008-09-21 Darin Adler <darin@apple.com>
33332
33333 - blind attempt to fix non-all-in-one builds
33334
33335 * kjs/JSGlobalObject.cpp: Added includes of Arguments.h and RegExpObject.h.
33336
33337 2008-09-21 Darin Adler <darin@apple.com>
33338
33339 - fix debug build
33340
33341 * kjs/StructureID.cpp:
33342 (JSC::StructureID::addPropertyTransition): Use typeInfo().type() instead of m_type.
33343 (JSC::StructureID::createCachedPrototypeChain): Ditto.
33344
33345 2008-09-21 Maciej Stachowiak <mjs@apple.com>
33346
33347 Reviewed by Darin Adler.
33348
33349 - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
33350 https://bugs.webkit.org/show_bug.cgi?id=20981
33351
33352 * JavaScriptCore.exp:
33353 * JavaScriptCore.xcodeproj/project.pbxproj:
33354 * VM/CTI.cpp:
33355 (JSC::CTI::privateCompileMainPass):
33356 (JSC::CTI::privateCompilePutByIdTransition):
33357 * VM/Machine.cpp:
33358 (JSC::jsIsObjectType):
33359 (JSC::Machine::Machine):
33360 * kjs/AllInOneFile.cpp:
33361 * kjs/JSCell.h:
33362 (JSC::JSCell::isObject):
33363 (JSC::JSCell::isString):
33364 * kjs/JSGlobalData.cpp:
33365 (JSC::JSGlobalData::JSGlobalData):
33366 * kjs/JSGlobalObject.cpp:
33367 (JSC::JSGlobalObject::reset):
33368 * kjs/JSGlobalObject.h:
33369 (JSC::StructureID::prototypeForLookup):
33370 * kjs/JSNumberCell.h:
33371 (JSC::JSNumberCell::createStructureID):
33372 * kjs/JSObject.cpp:
33373 (JSC::JSObject::createInheritorID):
33374 * kjs/JSObject.h:
33375 (JSC::JSObject::createStructureID):
33376 * kjs/JSString.h:
33377 (JSC::JSString::createStructureID):
33378 * kjs/NativeErrorConstructor.cpp:
33379 (JSC::NativeErrorConstructor::NativeErrorConstructor):
33380 * kjs/RegExpConstructor.cpp:
33381 * kjs/RegExpMatchesArray.h: Added.
33382 (JSC::RegExpMatchesArray::getOwnPropertySlot):
33383 (JSC::RegExpMatchesArray::put):
33384 (JSC::RegExpMatchesArray::deleteProperty):
33385 (JSC::RegExpMatchesArray::getPropertyNames):
33386 * kjs/StructureID.cpp:
33387 (JSC::StructureID::StructureID):
33388 (JSC::StructureID::addPropertyTransition):
33389 (JSC::StructureID::toDictionaryTransition):
33390 (JSC::StructureID::changePrototypeTransition):
33391 (JSC::StructureID::getterSetterTransition):
33392 * kjs/StructureID.h:
33393 (JSC::StructureID::create):
33394 (JSC::StructureID::typeInfo):
33395 * kjs/TypeInfo.h: Added.
33396 (JSC::TypeInfo::TypeInfo):
33397 (JSC::TypeInfo::type):
33398
33399 2008-09-21 Darin Adler <darin@apple.com>
33400
33401 Reviewed by Cameron Zwarich.
33402
33403 - fix crash logging into Gmail due to recent Arguments change
33404
33405 * kjs/Arguments.cpp:
33406 (JSC::Arguments::Arguments): Fix window where mark() function could
33407 see d->extraArguments with uninitialized contents.
33408 (JSC::Arguments::mark): Check d->extraArguments for 0 to handle two
33409 cases: 1) Inside the constructor before it's initialized.
33410 2) numArguments <= numParameters.
33411
33412 2008-09-21 Darin Adler <darin@apple.com>
33413
33414 - fix loose end from the "duplicate constant values" patch
33415
33416 * VM/CodeGenerator.cpp:
33417 (JSC::CodeGenerator::emitLoad): Add a special case for values the
33418 hash table can't handle.
33419
33420 2008-09-21 Mark Rowe <mrowe@apple.com>
33421
33422 Fix the non-AllInOneFile build.
33423
33424 * kjs/Arguments.cpp: Add missing #include.
33425
33426 2008-09-21 Darin Adler <darin@apple.com>
33427
33428 Reviewed by Cameron Zwarich and Mark Rowe.
33429
33430 - fix test failure caused by my recent IndexToNameMap patch
33431
33432 * kjs/Arguments.cpp:
33433 (JSC::Arguments::deleteProperty): Added the accidentally-omitted
33434 check of the boolean result from toArrayIndex.
33435
33436 2008-09-21 Darin Adler <darin@apple.com>
33437
33438 Reviewed by Maciej Stachowiak.
33439
33440 - https://bugs.webkit.org/show_bug.cgi?id=20975
33441 inline immediate-number case of ==
33442
33443 * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to
33444 emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.
33445
33446 * VM/CTI.cpp: Updated for new name.
33447 (JSC::CTI::privateCompileMainPass): Added op_eq.
33448 (JSC::CTI::privateCompileSlowCases): Added op_eq.
33449
33450 * VM/Machine.cpp:
33451 (JSC::Machine::cti_op_eq): Removed fast case, since it's now
33452 compiled.
33453
33454 2008-09-21 Peter Gal <galpter@inf.u-szeged.hu>
33455
33456 Reviewed by Tim Hatcher and Eric Seidel.
33457
33458 Fix the QT/Linux JavaScriptCore segmentation fault.
33459 https://bugs.webkit.org/show_bug.cgi?id=20914
33460
33461 * wtf/ThreadingQt.cpp:
33462 (WTF::initializeThreading): Use currentThread() if
33463 platform is not a MAC (like in pre 36541 revisions)
33464
33465 2008-09-21 Darin Adler <darin@apple.com>
33466
33467 Reviewed by Sam Weinig.
33468
33469 * kjs/debugger.h: Removed some unneeded includes and declarations.
33470
33471 2008-09-21 Darin Adler <darin@apple.com>
33472
33473 Reviewed by Sam Weinig.
33474
33475 - https://bugs.webkit.org/show_bug.cgi?id=20972
33476 speed up Arguments further by eliminating the IndexToNameMap
33477
33478 No change on SunSpider. 1.29x as fast on V8 Raytrace.
33479
33480 * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the
33481 indexToNameMap and hadDeletes data members. Changed extraArguments into
33482 an OwnArrayPtr and added deletedArguments, another OwnArrayPtr.
33483 Replaced numExtraArguments with numParameters, since that's what's
33484 used more directly in hot code paths.
33485 (JSC::Arguments::Arguments): Pass in argument count instead of ArgList.
33486 Initialize ArgumentsData the new way.
33487 (JSC::Arguments::mark): Updated.
33488 (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so
33489 we don't have to convert integers to identifiers just to get an argument.
33490 Integrated the deleted case with the fast case.
33491 (JSC::Arguments::put): Ditto.
33492 (JSC::Arguments::deleteProperty): Ditto.
33493
33494 * kjs/Arguments.h: Minimized includes. Made everything private. Added
33495 overloads for the integral property name case. Eliminated mappedIndexSetter.
33496 Moved ArgumentsData into the .cpp file.
33497
33498 * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
33499 * kjs/IndexToNameMap.h: Ditto.
33500
33501 * kjs/JSActivation.cpp:
33502 (JSC::JSActivation::createArgumentsObject): Elminated ArgList.
33503
33504 * GNUmakefile.am:
33505 * JavaScriptCore.pri:
33506 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
33507 * JavaScriptCore.xcodeproj/project.pbxproj:
33508 * JavaScriptCoreSources.bkl:
33509 * kjs/AllInOneFile.cpp:
33510 Removed IndexToNameMap.
33511
33512 2008-09-21 Darin Adler <darin@apple.com>
33513
33514 * VM/CodeGenerator.cpp:
33515 (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly
33516 clearer style.
33517
33518 2008-09-21 Judit Jasz <jasy@inf.u-szeged.hu>
33519
33520 Reviewed and tweaked by Darin Adler.
33521
33522 - https://bugs.webkit.org/show_bug.cgi?id=20645
33523 Elminate duplicate constant values in CodeBlocks.
33524
33525 Seems to be a wash on SunSpider.
33526
33527 * VM/CodeGenerator.cpp:
33528 (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee
33529 we emit the same JSValue* for identical numbers and strings.
33530 * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&.
33531 Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap.
33532 * kjs/nodes.cpp:
33533 (JSC::StringNode::emitCode): Call the new emitLoad and let it do the
33534 JSString creation.
33535
33536 2008-09-21 Paul Pedriana <webkit@pedriana.com>
33537
33538 Reviewed and tweaked by Darin Adler.
33539
33540 - https://bugs.webkit.org/show_bug.cgi?id=16925
33541 Fixed lack of Vector buffer alignment for both GCC and MSVC.
33542 Since there's no portable way to do this, for now we don't support
33543 other compilers.
33544
33545 * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer.
33546 Use AlignedBuffer insteadof an array of char in VectorBuffer.
33547
33548 2008-09-21 Gabor Loki <loki@inf.u-szeged.hu>
33549
33550 Reviewed by Darin Adler.
33551
33552 - https://bugs.webkit.org/show_bug.cgi?id=19408
33553 Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators.
33554
33555 1.008x as fast on SunSpider.
33556
33557 * kjs/grammar.y:
33558 (makeNegateNode): Fold if expression is a number > 0.
33559 (makeBitwiseNotNode): Fold if expression is a number.
33560 (makeMultNode): Fold if expressions are both numbers.
33561 (makeDivNode): Fold if expressions are both numbers.
33562 (makeAddNode): Fold if expressions are both numbers.
33563 (makeLeftShiftNode): Fold if expressions are both numbers.
33564 (makeRightShiftNode): Fold if expressions are both numbers.
33565
33566 2008-09-21 Maciej Stachowiak <mjs@apple.com>
33567
33568 Reviewed by Oliver.
33569
33570 - speed up === operator by generating inline machine code for the fast paths
33571 https://bugs.webkit.org/show_bug.cgi?id=20820
33572
33573 * VM/CTI.cpp:
33574 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber):
33575 (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers):
33576 (JSC::CTI::emitJumpSlowCaseIfNotImmediates):
33577 (JSC::CTI::emitTagAsBoolImmediate):
33578 (JSC::CTI::privateCompileMainPass):
33579 (JSC::CTI::privateCompileSlowCases):
33580 * VM/CTI.h:
33581 * VM/Machine.cpp:
33582 (JSC::Machine::cti_op_stricteq):
33583 * masm/X86Assembler.h:
33584 (JSC::X86Assembler::):
33585 (JSC::X86Assembler::sete_r):
33586 (JSC::X86Assembler::setz_r):
33587 (JSC::X86Assembler::movzbl_rr):
33588 (JSC::X86Assembler::emitUnlinkedJnz):
33589
33590 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
33591
33592 Reviewed by Maciej Stachowiak.
33593
33594 Free memory allocated for extra arguments in the destructor of the
33595 Arguments object.
33596
33597 * kjs/Arguments.cpp:
33598 (JSC::Arguments::~Arguments):
33599 * kjs/Arguments.h:
33600
33601 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
33602
33603 Reviewed by Maciej Stachowiak.
33604
33605 Bug 20815: 'arguments' object creation is non-optimal
33606 <https://bugs.webkit.org/show_bug.cgi?id=20815>
33607
33608 Fix our inefficient way of creating the arguments object by only
33609 creating named properties for each of the arguments after a use of the
33610 'delete' statement. This patch also speeds up access to the 'arguments'
33611 object slightly, but it still does not use the array fast path for
33612 indexed access that exists for many opcodes.
33613
33614 This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5%
33615 improvement on the Earley-Boyer benchmark, which gives a 4% improvement
33616 overall.
33617
33618 * kjs/Arguments.cpp:
33619 (JSC::Arguments::Arguments):
33620 (JSC::Arguments::mark):
33621 (JSC::Arguments::getOwnPropertySlot):
33622 (JSC::Arguments::put):
33623 (JSC::Arguments::deleteProperty):
33624 * kjs/Arguments.h:
33625 (JSC::Arguments::ArgumentsData::ArgumentsData):
33626 * kjs/IndexToNameMap.h:
33627 (JSC::IndexToNameMap::size):
33628 * kjs/JSActivation.cpp:
33629 (JSC::JSActivation::createArgumentsObject):
33630 * kjs/JSActivation.h:
33631 (JSC::JSActivation::uncheckedSymbolTableGet):
33632 (JSC::JSActivation::uncheckedSymbolTableGetValue):
33633 (JSC::JSActivation::uncheckedSymbolTablePut):
33634 * kjs/JSFunction.h:
33635 (JSC::JSFunction::numParameters):
33636
33637 2008-09-20 Darin Adler <darin@apple.com>
33638
33639 Reviewed by Mark Rowe.
33640
33641 - fix crash seen on buildbot
33642
33643 * kjs/JSGlobalObject.cpp:
33644 (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype,
33645 deleted by accident in my recent check-in.
33646
33647 2008-09-20 Maciej Stachowiak <mjs@apple.com>
33648
33649 Not reviewed, build fix.
33650
33651 - speculative fix for non-AllInOne builds
33652
33653 * kjs/operations.h:
33654
33655 2008-09-20 Maciej Stachowiak <mjs@apple.com>
33656
33657 Reviewed by Darin Adler.
33658
33659 - assorted optimizations to === and !== operators
33660 (work towards <https://bugs.webkit.org/show_bug.cgi?id=20820>)
33661
33662 2.5% speedup on earley-boyer test
33663
33664 * VM/Machine.cpp:
33665 (JSC::Machine::cti_op_stricteq): Use inline version of
33666 strictEqualSlowCase; remove unneeded exception check.
33667 (JSC::Machine::cti_op_nstricteq): ditto
33668 * kjs/operations.cpp:
33669 (JSC::strictEqual): Use strictEqualSlowCaseInline
33670 (JSC::strictEqualSlowCase): ditto
33671 * kjs/operations.h:
33672 (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined,
33673 since the extra function call indirection is a lose for CTI.
33674
33675 2008-09-20 Darin Adler <darin@apple.com>
33676
33677 Reviewed by Maciej Stachowiak.
33678
33679 - finish https://bugs.webkit.org/show_bug.cgi?id=20858
33680 make each distinct C++ class get a distinct JSC::Structure
33681
33682 This also includes some optimizations that make the change an overall
33683 small speedup. Without those it was a bit of a slowdown.
33684
33685 * API/JSCallbackConstructor.cpp:
33686 (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
33687 * API/JSCallbackConstructor.h: Ditto.
33688 * API/JSCallbackFunction.cpp:
33689 (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
33690 * API/JSCallbackObject.h: Take a structure.
33691 * API/JSCallbackObjectFunctions.h:
33692 (JSC::JSCallbackObject::JSCallbackObject): Ditto.
33693
33694 * API/JSClassRef.cpp:
33695 (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype
33696 if there's a custom prototype involved.
33697 * API/JSObjectRef.cpp:
33698 (JSObjectMake): Ditto.
33699 (JSObjectMakeConstructor): Pass in a structure.
33700
33701 * JavaScriptCore.exp: Updated.
33702
33703 * VM/Machine.cpp:
33704 (JSC::jsLess): Added a special case for when both arguments are strings.
33705 This avoids converting both strings to with UString::toDouble.
33706 (JSC::jsLessEq): Ditto.
33707 (JSC::Machine::privateExecute): Pass in a structure.
33708 (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
33709 (JSC::Machine::cti_op_new_regexp): Ditto.
33710 (JSC::Machine::cti_op_is_string): Ditto.
33711 * VM/Machine.h: Made isJSString public so it can be used in the CTI.
33712
33713 * kjs/Arguments.cpp:
33714 (JSC::Arguments::Arguments): Pass in a structure.
33715
33716 * kjs/JSCell.h: Mark constructor explicit.
33717
33718 * kjs/JSGlobalObject.cpp:
33719 (JSC::markIfNeeded): Added an overload for marking structures.
33720 (JSC::JSGlobalObject::reset): Eliminate code to set data members to
33721 zero. We now do that in the constructor, and we no longer use this
33722 anywhere except in the constructor. Added code to create structures.
33723 Pass structures rather than prototypes when creating objects.
33724 (JSC::JSGlobalObject::mark): Mark the structures.
33725
33726 * kjs/JSGlobalObject.h: Removed unneeded class declarations.
33727 Added initializers for raw pointers in JSGlobalObjectData so
33728 everything starts with a 0. Added structure data and accessor
33729 functions.
33730
33731 * kjs/JSImmediate.cpp:
33732 (JSC::JSImmediate::nonInlineNaN): Added.
33733 * kjs/JSImmediate.h:
33734 (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
33735
33736 * kjs/JSNumberCell.cpp:
33737 (JSC::jsNumberCell): Made non-inline to avoid PIC branches
33738 in functions that call this one.
33739 (JSC::jsNaN): Ditto.
33740 * kjs/JSNumberCell.h: Ditto.
33741
33742 * kjs/JSObject.h: Removed constructor that takes a prototype.
33743 All callers now pass structures.
33744
33745 * kjs/ArrayConstructor.cpp:
33746 (JSC::ArrayConstructor::ArrayConstructor):
33747 (JSC::constructArrayWithSizeQuirk):
33748 * kjs/ArrayConstructor.h:
33749 * kjs/ArrayPrototype.cpp:
33750 (JSC::ArrayPrototype::ArrayPrototype):
33751 * kjs/ArrayPrototype.h:
33752 * kjs/BooleanConstructor.cpp:
33753 (JSC::BooleanConstructor::BooleanConstructor):
33754 (JSC::constructBoolean):
33755 (JSC::constructBooleanFromImmediateBoolean):
33756 * kjs/BooleanConstructor.h:
33757 * kjs/BooleanObject.cpp:
33758 (JSC::BooleanObject::BooleanObject):
33759 * kjs/BooleanObject.h:
33760 * kjs/BooleanPrototype.cpp:
33761 (JSC::BooleanPrototype::BooleanPrototype):
33762 * kjs/BooleanPrototype.h:
33763 * kjs/DateConstructor.cpp:
33764 (JSC::DateConstructor::DateConstructor):
33765 (JSC::constructDate):
33766 * kjs/DateConstructor.h:
33767 * kjs/DateInstance.cpp:
33768 (JSC::DateInstance::DateInstance):
33769 * kjs/DateInstance.h:
33770 * kjs/DatePrototype.cpp:
33771 (JSC::DatePrototype::DatePrototype):
33772 * kjs/DatePrototype.h:
33773 * kjs/ErrorConstructor.cpp:
33774 (JSC::ErrorConstructor::ErrorConstructor):
33775 (JSC::constructError):
33776 * kjs/ErrorConstructor.h:
33777 * kjs/ErrorInstance.cpp:
33778 (JSC::ErrorInstance::ErrorInstance):
33779 * kjs/ErrorInstance.h:
33780 * kjs/ErrorPrototype.cpp:
33781 (JSC::ErrorPrototype::ErrorPrototype):
33782 * kjs/ErrorPrototype.h:
33783 * kjs/FunctionConstructor.cpp:
33784 (JSC::FunctionConstructor::FunctionConstructor):
33785 * kjs/FunctionConstructor.h:
33786 * kjs/FunctionPrototype.cpp:
33787 (JSC::FunctionPrototype::FunctionPrototype):
33788 (JSC::FunctionPrototype::addFunctionProperties):
33789 * kjs/FunctionPrototype.h:
33790 * kjs/GlobalEvalFunction.cpp:
33791 (JSC::GlobalEvalFunction::GlobalEvalFunction):
33792 * kjs/GlobalEvalFunction.h:
33793 * kjs/InternalFunction.cpp:
33794 (JSC::InternalFunction::InternalFunction):
33795 * kjs/InternalFunction.h:
33796 (JSC::InternalFunction::InternalFunction):
33797 * kjs/JSArray.cpp:
33798 (JSC::JSArray::JSArray):
33799 (JSC::constructEmptyArray):
33800 (JSC::constructArray):
33801 * kjs/JSArray.h:
33802 * kjs/JSFunction.cpp:
33803 (JSC::JSFunction::JSFunction):
33804 (JSC::JSFunction::construct):
33805 * kjs/JSObject.cpp:
33806 (JSC::constructEmptyObject):
33807 * kjs/JSString.cpp:
33808 (JSC::StringObject::create):
33809 * kjs/JSWrapperObject.h:
33810 * kjs/MathObject.cpp:
33811 (JSC::MathObject::MathObject):
33812 * kjs/MathObject.h:
33813 * kjs/NativeErrorConstructor.cpp:
33814 (JSC::NativeErrorConstructor::NativeErrorConstructor):
33815 (JSC::NativeErrorConstructor::construct):
33816 * kjs/NativeErrorConstructor.h:
33817 * kjs/NativeErrorPrototype.cpp:
33818 (JSC::NativeErrorPrototype::NativeErrorPrototype):
33819 * kjs/NativeErrorPrototype.h:
33820 * kjs/NumberConstructor.cpp:
33821 (JSC::NumberConstructor::NumberConstructor):
33822 (JSC::constructWithNumberConstructor):
33823 * kjs/NumberConstructor.h:
33824 * kjs/NumberObject.cpp:
33825 (JSC::NumberObject::NumberObject):
33826 (JSC::constructNumber):
33827 (JSC::constructNumberFromImmediateNumber):
33828 * kjs/NumberObject.h:
33829 * kjs/NumberPrototype.cpp:
33830 (JSC::NumberPrototype::NumberPrototype):
33831 * kjs/NumberPrototype.h:
33832 * kjs/ObjectConstructor.cpp:
33833 (JSC::ObjectConstructor::ObjectConstructor):
33834 (JSC::constructObject):
33835 * kjs/ObjectConstructor.h:
33836 * kjs/ObjectPrototype.cpp:
33837 (JSC::ObjectPrototype::ObjectPrototype):
33838 * kjs/ObjectPrototype.h:
33839 * kjs/PrototypeFunction.cpp:
33840 (JSC::PrototypeFunction::PrototypeFunction):
33841 * kjs/PrototypeFunction.h:
33842 * kjs/RegExpConstructor.cpp:
33843 (JSC::RegExpConstructor::RegExpConstructor):
33844 (JSC::RegExpMatchesArray::RegExpMatchesArray):
33845 (JSC::constructRegExp):
33846 * kjs/RegExpConstructor.h:
33847 * kjs/RegExpObject.cpp:
33848 (JSC::RegExpObject::RegExpObject):
33849 * kjs/RegExpObject.h:
33850 * kjs/RegExpPrototype.cpp:
33851 (JSC::RegExpPrototype::RegExpPrototype):
33852 * kjs/RegExpPrototype.h:
33853 * kjs/Shell.cpp:
33854 (GlobalObject::GlobalObject):
33855 * kjs/StringConstructor.cpp:
33856 (JSC::StringConstructor::StringConstructor):
33857 (JSC::constructWithStringConstructor):
33858 * kjs/StringConstructor.h:
33859 * kjs/StringObject.cpp:
33860 (JSC::StringObject::StringObject):
33861 * kjs/StringObject.h:
33862 * kjs/StringObjectThatMasqueradesAsUndefined.h:
33863 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
33864 * kjs/StringPrototype.cpp:
33865 (JSC::StringPrototype::StringPrototype):
33866 * kjs/StringPrototype.h:
33867 Take and pass structures.
33868
33869 2008-09-19 Alp Toker <alp@nuanti.com>
33870
33871 Build fix for the 'gold' linker and recent binutils. New behaviour
33872 requires that we link to used libraries explicitly.
33873
33874 * GNUmakefile.am:
33875
33876 2008-09-19 Sam Weinig <sam@webkit.org>
33877
33878 Roll r36694 back in. It did not cause the crash.
33879
33880 * JavaScriptCore.exp:
33881 * VM/JSPropertyNameIterator.cpp:
33882 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
33883 (JSC::JSPropertyNameIterator::invalidate):
33884 * VM/JSPropertyNameIterator.h:
33885 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
33886 (JSC::JSPropertyNameIterator::create):
33887 * kjs/JSObject.cpp:
33888 (JSC::JSObject::getPropertyNames):
33889 * kjs/PropertyMap.cpp:
33890 (JSC::PropertyMap::getEnumerablePropertyNames):
33891 * kjs/PropertyMap.h:
33892 * kjs/PropertyNameArray.cpp:
33893 (JSC::PropertyNameArray::add):
33894 * kjs/PropertyNameArray.h:
33895 (JSC::PropertyNameArrayData::create):
33896 (JSC::PropertyNameArrayData::propertyNameVector):
33897 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
33898 (JSC::PropertyNameArrayData::cachedPrototypeChain):
33899 (JSC::PropertyNameArrayData::begin):
33900 (JSC::PropertyNameArrayData::end):
33901 (JSC::PropertyNameArrayData::PropertyNameArrayData):
33902 (JSC::PropertyNameArray::PropertyNameArray):
33903 (JSC::PropertyNameArray::addKnownUnique):
33904 (JSC::PropertyNameArray::size):
33905 (JSC::PropertyNameArray::operator[]):
33906 (JSC::PropertyNameArray::begin):
33907 (JSC::PropertyNameArray::end):
33908 (JSC::PropertyNameArray::setData):
33909 (JSC::PropertyNameArray::data):
33910 (JSC::PropertyNameArray::releaseData):
33911 * kjs/StructureID.cpp:
33912 (JSC::structureIDChainsAreEqual):
33913 (JSC::StructureID::getEnumerablePropertyNames):
33914 (JSC::StructureID::clearEnumerationCache):
33915 (JSC::StructureID::createCachedPrototypeChain):
33916 * kjs/StructureID.h:
33917
33918 2008-09-19 Sam Weinig <sam@webkit.org>
33919
33920 Roll out r36694.
33921
33922 * JavaScriptCore.exp:
33923 * VM/JSPropertyNameIterator.cpp:
33924 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
33925 (JSC::JSPropertyNameIterator::invalidate):
33926 * VM/JSPropertyNameIterator.h:
33927 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
33928 (JSC::JSPropertyNameIterator::create):
33929 * kjs/JSObject.cpp:
33930 (JSC::JSObject::getPropertyNames):
33931 * kjs/PropertyMap.cpp:
33932 (JSC::PropertyMap::getEnumerablePropertyNames):
33933 * kjs/PropertyMap.h:
33934 * kjs/PropertyNameArray.cpp:
33935 (JSC::PropertyNameArray::add):
33936 * kjs/PropertyNameArray.h:
33937 (JSC::PropertyNameArray::PropertyNameArray):
33938 (JSC::PropertyNameArray::addKnownUnique):
33939 (JSC::PropertyNameArray::begin):
33940 (JSC::PropertyNameArray::end):
33941 (JSC::PropertyNameArray::size):
33942 (JSC::PropertyNameArray::operator[]):
33943 (JSC::PropertyNameArray::releaseIdentifiers):
33944 * kjs/StructureID.cpp:
33945 (JSC::StructureID::getEnumerablePropertyNames):
33946 * kjs/StructureID.h:
33947 (JSC::StructureID::clearEnumerationCache):
33948
33949 2008-09-19 Oliver Hunt <oliver@apple.com>
33950
33951 Reviewed by Maciej Stachowiak.
33952
33953 Improve peformance of local variable initialisation.
33954
33955 Pull local and constant initialisation out of slideRegisterWindowForCall
33956 and into its own opcode. This allows the JIT to generate the initialisation
33957 code for a function directly into the instruction stream and so avoids a few
33958 branches on function entry.
33959
33960 Results a 1% progression in SunSpider, particularly in a number of the bitop
33961 tests where the called functions are very fast.
33962
33963 * VM/CTI.cpp:
33964 (JSC::CTI::emitInitialiseRegister):
33965 (JSC::CTI::privateCompileMainPass):
33966 * VM/CTI.h:
33967 * VM/CodeBlock.cpp:
33968 (JSC::CodeBlock::dump):
33969 * VM/CodeGenerator.cpp:
33970 (JSC::CodeGenerator::CodeGenerator):
33971 * VM/Machine.cpp:
33972 (JSC::slideRegisterWindowForCall):
33973 (JSC::Machine::privateExecute):
33974 * VM/Opcode.h:
33975
33976 2008-09-19 Sam Weinig <sam@webkit.org>
33977
33978 Reviewed by Darin Adler.
33979
33980 Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
33981 Speed up JS property enumeration by caching entire PropertyNameArray
33982
33983 1.3% speedup on Sunspider, 30% on string-fasta.
33984
33985 * JavaScriptCore.exp:
33986 * VM/JSPropertyNameIterator.cpp:
33987 (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
33988 (JSC::JSPropertyNameIterator::invalidate):
33989 * VM/JSPropertyNameIterator.h:
33990 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
33991 (JSC::JSPropertyNameIterator::create):
33992 * kjs/JSObject.cpp:
33993 (JSC::JSObject::getPropertyNames):
33994 * kjs/PropertyMap.cpp:
33995 (JSC::PropertyMap::getEnumerablePropertyNames):
33996 * kjs/PropertyMap.h:
33997 * kjs/PropertyNameArray.cpp:
33998 (JSC::PropertyNameArray::add):
33999 * kjs/PropertyNameArray.h:
34000 (JSC::PropertyNameArrayData::create):
34001 (JSC::PropertyNameArrayData::propertyNameVector):
34002 (JSC::PropertyNameArrayData::setCachedPrototypeChain):
34003 (JSC::PropertyNameArrayData::cachedPrototypeChain):
34004 (JSC::PropertyNameArrayData::begin):
34005 (JSC::PropertyNameArrayData::end):
34006 (JSC::PropertyNameArrayData::PropertyNameArrayData):
34007 (JSC::PropertyNameArray::PropertyNameArray):
34008 (JSC::PropertyNameArray::addKnownUnique):
34009 (JSC::PropertyNameArray::size):
34010 (JSC::PropertyNameArray::operator[]):
34011 (JSC::PropertyNameArray::begin):
34012 (JSC::PropertyNameArray::end):
34013 (JSC::PropertyNameArray::setData):
34014 (JSC::PropertyNameArray::data):
34015 (JSC::PropertyNameArray::releaseData):
34016 * kjs/ScopeChain.cpp:
34017 (JSC::ScopeChainNode::print):
34018 * kjs/StructureID.cpp:
34019 (JSC::structureIDChainsAreEqual):
34020 (JSC::StructureID::getEnumerablePropertyNames):
34021 (JSC::StructureID::clearEnumerationCache):
34022 (JSC::StructureID::createCachedPrototypeChain):
34023 * kjs/StructureID.h:
34024
34025 2008-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
34026
34027 Reviewed by Maciej Stachowiak.
34028
34029 Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
34030
34031 * kjs/JSObject.cpp:
34032 (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
34033
34034 2008-09-19 Darin Adler <darin@apple.com>
34035
34036 Reviewed by Sam Weinig.
34037
34038 - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
34039 make each distinct C++ class get a distinct JSC::Structure
34040
34041 * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
34042
34043 * kjs/JSGlobalObject.h: Changed the protected constructor to take a
34044 structure instead of a prototype.
34045
34046 * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
34047
34048 2008-09-19 Julien Chaffraix <jchaffraix@pleyo.com>
34049
34050 Reviewed by Alexey Proskuryakov.
34051
34052 Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
34053 non-template methods' code been copied for each instance of the template.
34054 The patch splits RefCounted between a base class that holds non-template methods and attributes
34055 and the template RefCounted class that keeps the same functionnality.
34056
34057 On my Linux with gcc 4.3 for the Gtk port, this is:
34058 - a ~600KB save on libwebkit.so in release.
34059 - a ~1.6MB save on libwebkit.so in debug.
34060
34061 It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
34062 On the whole, it should be a small win as we reduce the compiled code size and the only
34063 new function call should be inlined by the compiler.
34064
34065 * wtf/RefCounted.h:
34066 (WTF::RefCountedBase::ref): Copied from RefCounted.
34067 (WTF::RefCountedBase::hasOneRef): Ditto.
34068 (WTF::RefCountedBase::refCount): Ditto.
34069 (WTF::RefCountedBase::RefCountedBase): Ditto.
34070 (WTF::RefCountedBase::~RefCountedBase): Ditto.
34071 (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
34072 template section.
34073 (WTF::RefCounted::RefCounted):
34074 (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
34075 (WTF::RefCounted::~RefCounted): Keep private destructor.
34076
34077 2008-09-18 Darin Adler <darin@apple.com>
34078
34079 Reviewed by Maciej Stachowiak.
34080
34081 - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
34082 make each distinct C++ class get a distinct JSC::Structure
34083
34084 * kjs/lookup.h: Removed things here that were used only in WebCore:
34085 cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
34086 and JSC_IMPLEMENT_PROTOTYPE.
34087
34088 2008-09-18 Darin Adler <darin@apple.com>
34089
34090 Reviewed by Maciej Stachowiak.
34091
34092 - https://bugs.webkit.org/show_bug.cgi?id=20927
34093 simplify/streamline the code to turn strings into identifiers while parsing
34094
34095 * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
34096 well as for IDENT.
34097
34098 * kjs/lexer.cpp:
34099 (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
34100 * kjs/lexer.h: Remove makeUString.
34101
34102 * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
34103
34104 * VM/CodeGenerator.cpp:
34105 (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
34106 (JSC::prepareJumpTableForStringSwitch): Ditto.
34107 * kjs/nodes.cpp:
34108 (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
34109 (JSC::processClauseList): Ditto.
34110 * kjs/nodes2string.cpp:
34111 (JSC::StringNode::streamTo): Ditto.
34112
34113 2008-09-18 Sam Weinig <sam@webkit.org>
34114
34115 Fix style.
34116
34117 * VM/Instruction.h:
34118 (JSC::Instruction::Instruction):
34119
34120 2008-09-18 Oliver Hunt <oliver@apple.com>
34121
34122 Reviewed by Maciej Stachowiak.
34123
34124 Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
34125 <https://bugs.webkit.org/show_bug.cgi?id=20911>
34126
34127 The problem was simply caused by the int constructor for Instruction
34128 failing to initialise the full struct in 64bit builds.
34129
34130 * VM/Instruction.h:
34131 (JSC::Instruction::Instruction):
34132
34133 2008-09-18 Darin Adler <darin@apple.com>
34134
34135 - fix release build
34136
34137 * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
34138
34139 2008-09-18 Darin Adler <darin@apple.com>
34140
34141 Reviewed by Sam Weinig.
34142
34143 * kjs/JSGlobalObject.h: Tiny style guideline tweak.
34144
34145 2008-09-18 Darin Adler <darin@apple.com>
34146
34147 Reviewed by Sam Weinig.
34148
34149 - fix https://bugs.webkit.org/show_bug.cgi?id=20925
34150 LEAK messages appear every time I quit
34151
34152 * JavaScriptCore.exp: Updated, and also added an export
34153 needed for future WebCore use of JSC::StructureID.
34154
34155 * wtf/RefCountedLeakCounter.cpp:
34156 (WTF::RefCountedLeakCounter::suppressMessages): Added.
34157 (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
34158 (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
34159 (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
34160 log the reason there was no leak checking done.
34161 (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
34162 (WTF::RefCountedLeakCounter::decrement): Ditto.
34163
34164 * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
34165 new functions, suppressMessages and cancelMessageSuppression. Also
34166 added m_ prefixes to the data member names.
34167
34168 2008-09-18 Holger Hans Peter Freyther <zecke@selfish.org>
34169
34170 Reviewed by Mark Rowe.
34171
34172 https://bugs.webkit.org/show_bug.cgi?id=20437
34173
34174 Add a proper #define to define which XML Parser implementation to use. Client
34175 code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
34176 implementation is going to be used.
34177
34178 * wtf/Platform.h:
34179
34180 2008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34181
34182 Reviewed by Maciej Stachowiak.
34183
34184 Make a Unicode non-breaking space count as a whitespace character in
34185 PCRE. This change was already made in WREC, and it fixes one of the
34186 Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
34187 in a new set of expected test results.
34188
34189 * pcre/pcre_internal.h:
34190 (isSpaceChar):
34191 * tests/mozilla/expected.html:
34192
34193 2008-09-18 Stephanie Lewis <slewis@apple.com>
34194
34195 Reviewed by Mark Rowe and Maciej Stachowiak.
34196
34197 add an option use arch to specify which architecture to run.
34198
34199 * tests/mozilla/jsDriver.pl:
34200
34201 2008-09-17 Oliver Hunt <oliver@apple.com>
34202
34203 Correctly restore argument reference prior to SFX runtime calls.
34204
34205 Reviewed by Steve Falkenburg.
34206
34207 * VM/CTI.cpp:
34208 (JSC::CTI::privateCompileSlowCases):
34209 (JSC::CTI::privateCompile):
34210
34211 2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34212
34213 Reviewed by Maciej Stachowiak.
34214
34215 Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
34216 <https://bugs.webkit.org/show_bug.cgi?id=20876>
34217
34218 r36417 and r36427 caused an get_by_id opcode to be emitted before the
34219 instanceof and construct opcodes, in order to enable inline caching of
34220 the prototype property. Unfortunately, this regressed some tests dealing
34221 with exceptions thrown by 'instanceof' and the 'new' operator. We fix
34222 these problems by detecting whether an "is not an object" exception is
34223 thrown before op_instanceof or op_construct, and emit the proper
34224 exception in those cases.
34225
34226 * VM/CodeGenerator.cpp:
34227 (JSC::CodeGenerator::emitConstruct):
34228 * VM/CodeGenerator.h:
34229 * VM/ExceptionHelpers.cpp:
34230 (JSC::createInvalidParamError):
34231 (JSC::createNotAConstructorError):
34232 (JSC::createNotAnObjectError):
34233 * VM/ExceptionHelpers.h:
34234 * VM/Machine.cpp:
34235 (JSC::Machine::getOpcode):
34236 (JSC::Machine::privateExecute):
34237 * VM/Machine.h:
34238 * kjs/nodes.cpp:
34239 (JSC::NewExprNode::emitCode):
34240 (JSC::InstanceOfNode::emitCode):
34241
34242 2008-09-17 Gavin Barraclough <barraclough@apple.com>
34243
34244 Reviewed by Oliver Hunt.
34245
34246 JIT generation cti_op_construct_verify.
34247
34248 Quarter to half percent progression on v8-tests.
34249 Roughly not change on SunSpider (possible minor progression).
34250
34251 * VM/CTI.cpp:
34252 (JSC::CTI::privateCompileMainPass):
34253 * VM/Machine.cpp:
34254 * VM/Machine.h:
34255
34256 2008-09-15 Steve Falkenburg <sfalken@apple.com>
34257
34258 Improve timer accuracy for JavaScript Date object on Windows.
34259
34260 Use a combination of ftime and QueryPerformanceCounter.
34261 ftime returns the information we want, but doesn't have sufficient resolution.
34262 QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
34263 To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
34264 QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to
34265 correct for drift if the low-res and high-res elapsed time between calls differs by more
34266 than twice the low-resolution timer resolution.
34267
34268 QueryPerformanceCounter may be inaccurate due to a problems with:
34269 - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
34270 - BIOS bugs (http://support.microsoft.com/kb/895980/)
34271 - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
34272
34273 Reviewed by Darin Adler.
34274
34275 * kjs/DateMath.cpp:
34276 (JSC::highResUpTime):
34277 (JSC::lowResUTCTime):
34278 (JSC::qpcAvailable):
34279 (JSC::getCurrentUTCTimeWithMicroseconds):
34280
34281 2008-09-17 Gavin Barraclough <barraclough@apple.com>
34282
34283 Reviewed by Geoff Garen.
34284
34285 Implement JIT generation of CallFrame initialization, for op_call.
34286
34287 1% sunspider 2.5% v8-tests.
34288
34289 * VM/CTI.cpp:
34290 (JSC::CTI::compileOpCall):
34291 * VM/Machine.cpp:
34292 (JSC::Machine::cti_op_call_JSFunction):
34293 (JSC::Machine::cti_op_call_NotJSFunction):
34294
34295 2008-09-17 Gavin Barraclough <barraclough@apple.com>
34296
34297 Reviewed by Geoff Garen.
34298
34299 Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code,
34300 move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
34301 functions, instead of checking prior to making the call.
34302
34303 3% on v8-tests (4% on richards, 6% in delta-blue)
34304
34305 * VM/CTI.cpp:
34306 (JSC::CTI::compileOpCall):
34307 (JSC::CTI::privateCompileSlowCases):
34308 (JSC::CTI::privateCompile):
34309 * VM/Machine.cpp:
34310 (JSC::Machine::execute):
34311 (JSC::Machine::cti_op_call_JSFunction):
34312 (JSC::Machine::cti_vm_compile):
34313 (JSC::Machine::cti_vm_updateScopeChain):
34314 (JSC::Machine::cti_op_construct_JSConstruct):
34315 * VM/Machine.h:
34316
34317 2008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com>
34318
34319 Fix the QtWebKit/Mac build
34320
34321 * wtf/ThreadingQt.cpp:
34322 (WTF::initializeThreading): use QCoreApplication to get the main thread
34323
34324 2008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34325
34326 Reviewed by Maciej Stachowiak.
34327
34328 Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
34329 <https://bugs.webkit.org/show_bug.cgi?id=20857>
34330
34331 Fix a problem stemming from the slightly unsafe behaviour of the
34332 CodeGenerator::finalDestination() method by putting the "func" argument
34333 of the emitConstruct() method in a RefPtr in its caller. Also, add an
34334 assertion guaranteeing that this is always the case.
34335
34336 CodeGenerator::finalDestination() is still incorrect and can cause
34337 problems with a different allocator; see bug 20340 for more details.
34338
34339 * VM/CodeGenerator.cpp:
34340 (JSC::CodeGenerator::emitConstruct):
34341 * kjs/nodes.cpp:
34342 (JSC::NewExprNode::emitCode):
34343
34344 2008-09-16 Alice Liu <alice.liu@apple.com>
34345
34346 build fix.
34347
34348 * VM/CTI.cpp:
34349 (JSC::CTI::privateCompileMainPass):
34350
34351 2008-09-16 Gavin Barraclough <barraclough@apple.com>
34352
34353 Reviewed by Geoff Garen.
34354
34355 CTI code generation for op_ret. The majority of the work
34356 (updating variables on the stack & on exec) can be performed
34357 directly in generated code.
34358
34359 We still need to check, & to call out to C-code to handle
34360 activation records, profiling, and full scope chains.
34361
34362 +1.5% Sunspider, +5/6% v8 tests.
34363
34364 * VM/CTI.cpp:
34365 (JSC::CTI::emitPutCTIParam):
34366 (JSC::CTI::compileOpCall):
34367 (JSC::CTI::privateCompileMainPass):
34368 * VM/CTI.h:
34369 * VM/Machine.cpp:
34370 (JSC::Machine::cti_op_ret_activation):
34371 (JSC::Machine::cti_op_ret_profiler):
34372 (JSC::Machine::cti_op_ret_scopeChain):
34373 * VM/Machine.h:
34374
34375 2008-09-16 Dimitri Glazkov <dglazkov@chromium.org>
34376
34377 Fix the Windows build.
34378
34379 Add some extra parentheses to stop MSVC from complaining so much.
34380
34381 * VM/Machine.cpp:
34382 (JSC::Machine::privateExecute):
34383 (JSC::Machine::cti_op_stricteq):
34384 (JSC::Machine::cti_op_nstricteq):
34385 * kjs/operations.cpp:
34386 (JSC::strictEqual):
34387
34388 2008-09-15 Maciej Stachowiak <mjs@apple.com>
34389
34390 Reviewed by Cameron Zwarich.
34391
34392 - speed up the === and !== operators by choosing the fast cases better
34393
34394 No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
34395
34396 * VM/Machine.cpp:
34397 (JSC::Machine::privateExecute):
34398 (JSC::Machine::cti_op_stricteq):
34399 (JSC::Machine::cti_op_nstricteq):
34400 * kjs/JSImmediate.h:
34401 (JSC::JSImmediate::areBothImmediate):
34402 * kjs/operations.cpp:
34403 (JSC::strictEqual):
34404 (JSC::strictEqualSlowCase):
34405 * kjs/operations.h:
34406
34407 2008-09-15 Oliver Hunt <oliver@apple.com>
34408
34409 RS=Sam Weinig.
34410
34411 Coding style cleanup.
34412
34413 * VM/Machine.cpp:
34414 (JSC::Machine::privateExecute):
34415
34416 2008-09-15 Oliver Hunt <oliver@apple.com>
34417
34418 Reviewed by Cameron Zwarich.
34419
34420 Bug 20874: op_resolve does not do any form of caching
34421 <https://bugs.webkit.org/show_bug.cgi?id=20874>
34422
34423 This patch adds an op_resolve_global opcode to handle (and cache)
34424 property lookup we can statically determine must occur on the global
34425 object (if at all).
34426
34427 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
34428 10% in math-partial-sums
34429
34430 * VM/CTI.cpp:
34431 (JSC::CTI::privateCompileMainPass):
34432 * VM/CTI.h:
34433 * VM/CodeBlock.cpp:
34434 (JSC::CodeBlock::dump):
34435 * VM/CodeGenerator.cpp:
34436 (JSC::CodeGenerator::findScopedProperty):
34437 (JSC::CodeGenerator::emitResolve):
34438 * VM/Machine.cpp:
34439 (JSC::resolveGlobal):
34440 (JSC::Machine::privateExecute):
34441 (JSC::Machine::cti_op_resolve_global):
34442 * VM/Machine.h:
34443 * VM/Opcode.h:
34444
34445 2008-09-15 Sam Weinig <sam@webkit.org>
34446
34447 Roll out r36462. It broke document.all.
34448
34449 * VM/CTI.cpp:
34450 (JSC::CTI::privateCompileMainPass):
34451 (JSC::CTI::privateCompileSlowCases):
34452 * VM/CTI.h:
34453 * VM/Machine.cpp:
34454 (JSC::Machine::Machine):
34455 (JSC::Machine::cti_op_eq_null):
34456 (JSC::Machine::cti_op_neq_null):
34457 * VM/Machine.h:
34458 (JSC::Machine::isJSString):
34459 * kjs/JSCell.h:
34460 * kjs/JSWrapperObject.h:
34461 * kjs/StringObject.h:
34462 * kjs/StringObjectThatMasqueradesAsUndefined.h:
34463
34464 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34465
34466 Reviewed by Maciej Stachowiak.
34467
34468 Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
34469 <https://bugs.webkit.org/show_bug.cgi?id=20863>
34470
34471 r36427 changed the number of arguments to op_construct without changing
34472 the argument index for the vPC in the call to initializeCallFrame() in
34473 the CTI case. This caused a JSC test failure. Correcting the argument
34474 index fixes the test failure.
34475
34476 * VM/Machine.cpp:
34477 (JSC::Machine::cti_op_construct_JSConstruct):
34478
34479 2008-09-15 Mark Rowe <mrowe@apple.com>
34480
34481 Fix GCC 4.2 build.
34482
34483 * VM/CTI.h:
34484
34485 2008-09-15 Geoffrey Garen <ggaren@apple.com>
34486
34487 Reviewed by Maciej Stachowiak.
34488
34489 Fixed a typo in op_get_by_id_chain that caused it to miss every time
34490 in the interpreter.
34491
34492 Also, a little cleanup.
34493
34494 * VM/Machine.cpp:
34495 (JSC::Machine::privateExecute): Set up baseObject before entering the
34496 loop, so we compare against the right values.
34497
34498 2008-09-15 Geoffrey Garen <ggaren@apple.com>
34499
34500 Reviewed by Sam Weinig.
34501
34502 Removed the CalledAsConstructor flag from the call frame header. Now,
34503 we use an explicit opcode at the call site to fix up constructor results.
34504
34505 SunSpider says 0.4% faster.
34506
34507 cti_op_construct_verify is an out-of-line function call for now, but we
34508 can fix that once StructureID holds type information like isObject.
34509
34510 * VM/CTI.cpp:
34511 (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
34512
34513 * VM/CodeBlock.cpp:
34514 (JSC::CodeBlock::dump):
34515
34516 * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
34517 (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
34518 (JSC::CodeGenerator::emitConstruct): ... ditto.
34519
34520 * VM/Machine.cpp: No more CalledAsConstructor
34521 (JSC::Machine::privateExecute): Implementation for the new opcode.
34522 (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
34523 called as a constructor.
34524 (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
34525 * VM/Machine.h:
34526
34527 * VM/Opcode.h: Declare new opcode.
34528
34529 * VM/RegisterFile.h:
34530 (JSC::RegisterFile::): No more CalledAsConstructor
34531
34532 2008-09-15 Gavin Barraclough <barraclough@apple.com>
34533
34534 Reviewed by Geoff Garen.
34535
34536 Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
34537 StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
34538 masquerading may be handled differently (through the StructureIDs - see bug
34539 #20823).
34540
34541 >1% on v8-tests.
34542
34543 * VM/CTI.cpp:
34544 (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
34545 (JSC::CTI::privateCompileMainPass):
34546 (JSC::CTI::privateCompileSlowCases):
34547 * VM/CTI.h:
34548 * VM/Machine.cpp:
34549 (JSC::Machine::Machine):
34550 (JSC::Machine::cti_op_eq_null):
34551 (JSC::Machine::cti_op_neq_null):
34552 * VM/Machine.h:
34553 (JSC::Machine::doesMasqueradesAsUndefined):
34554 * kjs/JSWrapperObject.h:
34555 (JSC::JSWrapperObject::):
34556 (JSC::JSWrapperObject::JSWrapperObject):
34557 * kjs/StringObject.h:
34558 (JSC::StringObject::StringObject):
34559 * kjs/StringObjectThatMasqueradesAsUndefined.h:
34560 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
34561
34562 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34563
34564 Rubber-stamped by Oliver Hunt.
34565
34566 r36427 broke CodeBlock::dump() by changing the number of arguments to
34567 op_construct without changing the code that prints it. This patch fixes
34568 it by printing the additional argument.
34569
34570 * JavaScriptCore.xcodeproj/project.pbxproj:
34571 * VM/CodeBlock.cpp:
34572 (JSC::CodeBlock::dump):
34573
34574 2008-09-15 Adam Roben <aroben@apple.com>
34575
34576 Build fix
34577
34578 * kjs/StructureID.cpp: Removed a stray semicolon.
34579
34580 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34581
34582 Reviewed by Maciej Stachowiak.
34583
34584 Fix a crash in fast/js/exception-expression-offset.html caused by not
34585 updating all mentions of the length of op_construct in r36427.
34586
34587 * VM/Machine.cpp:
34588 (JSC::Machine::cti_op_construct_NotJSConstruct):
34589
34590 2008-09-15 Maciej Stachowiak <mjs@apple.com>
34591
34592 Reviewed by Cameron Zwarich.
34593
34594 - fix layout test failure introduced by fix for 20849
34595
34596 (The failing test was fast/js/delete-then-put.html)
34597
34598 * kjs/JSObject.cpp:
34599 (JSC::JSObject::removeDirect): Clear enumeration cache
34600 in the dictionary case.
34601 * kjs/JSObject.h:
34602 (JSC::JSObject::putDirect): Ditto.
34603 * kjs/StructureID.h:
34604 (JSC::StructureID::clearEnumerationCache): Inline to handle the
34605 clear.
34606
34607 2008-09-15 Maciej Stachowiak <mjs@apple.com>
34608
34609 Reviewed by Cameron Zwarich.
34610
34611 - fix JSC test failures introduced by fix for 20849
34612
34613 * kjs/PropertyMap.cpp:
34614 (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
34615
34616 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34617
34618 Reviewed by Maciej Stachowiak.
34619
34620 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
34621 <https://bugs.webkit.org/show_bug.cgi?id=20851>
34622
34623 r36410 introduced an optimization for parseInt() that is incorrect when
34624 its argument is larger than the range of a 32-bit integer. If the
34625 argument is a number that is not an immediate integer, then the correct
34626 behaviour is to return the floor of its value, unless it is an infinite
34627 value, in which case the correct behaviour is to return 0.
34628
34629 * kjs/JSGlobalObjectFunctions.cpp:
34630 (JSC::globalFuncParseInt):
34631
34632 2008-09-15 Sam Weinig <sam@webkit.org>
34633
34634 Reviewed by Maciej Stachowiak.
34635
34636 Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
34637 Cache property names for getEnumerablePropertyNames in the StructureID.
34638
34639 ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
34640 on the v8 test suite.
34641
34642 * kjs/JSObject.cpp:
34643 (JSC::JSObject::getPropertyNames):
34644 * kjs/PropertyMap.cpp:
34645 (JSC::PropertyMap::getEnumerablePropertyNames):
34646 * kjs/PropertyMap.h:
34647 * kjs/StructureID.cpp:
34648 (JSC::StructureID::StructureID):
34649 (JSC::StructureID::getEnumerablePropertyNames):
34650 * kjs/StructureID.h:
34651
34652 2008-09-14 Maciej Stachowiak <mjs@apple.com>
34653
34654 Reviewed by Cameron Zwarich.
34655
34656 - speed up JS construction by extracting "prototype" lookup so PIC applies.
34657
34658 ~0.5% speedup on SunSpider
34659 Speeds up some of the V8 tests as well, most notably earley-boyer.
34660
34661 * VM/CTI.cpp:
34662 (JSC::CTI::compileOpCall): Account for extra arg for prototype.
34663 (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
34664 * VM/CodeGenerator.cpp:
34665 (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
34666 * VM/Machine.cpp:
34667 (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
34668 (JSC::Machine::cti_op_construct_JSConstruct): ditto
34669 (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
34670
34671 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
34672
34673 Reviewed by Eric Seidel.
34674
34675 Add a protected destructor for RefCounted.
34676
34677 It is wrong to call its destructor directly, because (1) this should be taken care of by
34678 deref(), and (2) many classes that use RefCounted have non-virtual destructors.
34679
34680 No change in behavior.
34681
34682 * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
34683
34684 2008-09-14 Gavin Barraclough <barraclough@apple.com>
34685
34686 Reviewed by Sam Weinig.
34687
34688 Accelerated property accesses.
34689
34690 Inline more of the array access code into the JIT code for get/put_by_val.
34691 Accelerate get/put_by_id by speculatively inlining a disable direct access
34692 into the hot path of the code, and repatch this with the correct StructureID
34693 and property map offset once these are known. In the case of accesses to the
34694 prototype and reading the array-length a trampoline is genertaed, and the
34695 branch to the slow-case is relinked to jump to this.
34696
34697 By repatching, we mean rewriting the x86 instruction stream. Instructions are
34698 only modified in a simple fasion - altering immediate operands, memory access
34699 deisplacements, and branch offsets.
34700
34701 For regular get_by_id/put_by_id accesses to an object, a StructureID in an
34702 instruction's immediate operant is updateded, and a memory access operation's
34703 displacement is updated to access the correct field on the object. In the case
34704 of more complex accesses (array length and get_by_id_prototype) the offset on
34705 the branch to slow-case is updated, to now jump to a trampoline.
34706
34707 +2.8% sunspider, +13% v8-tests
34708
34709 * VM/CTI.cpp:
34710 (JSC::CTI::emitCall):
34711 (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
34712 (JSC::CTI::CTI):
34713 (JSC::CTI::privateCompileMainPass):
34714 (JSC::CTI::privateCompileSlowCases):
34715 (JSC::CTI::privateCompile):
34716 (JSC::CTI::privateCompileGetByIdSelf):
34717 (JSC::CTI::privateCompileGetByIdProto):
34718 (JSC::CTI::privateCompileGetByIdChain):
34719 (JSC::CTI::privateCompilePutByIdReplace):
34720 (JSC::CTI::privateCompilePutByIdTransition):
34721 (JSC::CTI::privateCompileArrayLengthTrampoline):
34722 (JSC::CTI::privateCompileStringLengthTrampoline):
34723 (JSC::CTI::patchGetByIdSelf):
34724 (JSC::CTI::patchPutByIdReplace):
34725 (JSC::CTI::privateCompilePatchGetArrayLength):
34726 (JSC::CTI::privateCompilePatchGetStringLength):
34727 * VM/CTI.h:
34728 (JSC::CTI::compileGetByIdSelf):
34729 (JSC::CTI::compileGetByIdProto):
34730 (JSC::CTI::compileGetByIdChain):
34731 (JSC::CTI::compilePutByIdReplace):
34732 (JSC::CTI::compilePutByIdTransition):
34733 (JSC::CTI::compileArrayLengthTrampoline):
34734 (JSC::CTI::compileStringLengthTrampoline):
34735 (JSC::CTI::compilePatchGetArrayLength):
34736 (JSC::CTI::compilePatchGetStringLength):
34737 * VM/CodeBlock.cpp:
34738 (JSC::CodeBlock::dump):
34739 (JSC::CodeBlock::~CodeBlock):
34740 * VM/CodeBlock.h:
34741 (JSC::StructureStubInfo::StructureStubInfo):
34742 (JSC::CodeBlock::getStubInfo):
34743 * VM/Machine.cpp:
34744 (JSC::Machine::tryCTICachePutByID):
34745 (JSC::Machine::tryCTICacheGetByID):
34746 (JSC::Machine::cti_op_put_by_val_array):
34747 * VM/Machine.h:
34748 * masm/X86Assembler.h:
34749 (JSC::X86Assembler::):
34750 (JSC::X86Assembler::cmpl_i8m):
34751 (JSC::X86Assembler::emitUnlinkedJa):
34752 (JSC::X86Assembler::getRelocatedAddress):
34753 (JSC::X86Assembler::getDifferenceBetweenLabels):
34754 (JSC::X86Assembler::emitModRm_opmsib):
34755
34756 2008-09-14 Maciej Stachowiak <mjs@apple.com>
34757
34758 Reviewed by Cameron Zwarich.
34759
34760 - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
34761
34762 ~5% speedup on v8 earley-boyer test
34763
34764 * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
34765 * API/JSCallbackObjectFunctions.h:
34766 (JSC::::hasInstance): Ditto.
34767 * API/JSValueRef.cpp:
34768 (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
34769 * JavaScriptCore.exp:
34770 * VM/CTI.cpp:
34771 (JSC::CTI::privateCompileMainPass): Pass along prototype.
34772 * VM/CodeBlock.cpp:
34773 (JSC::CodeBlock::dump): Print third arg.
34774 * VM/CodeGenerator.cpp:
34775 (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
34776 is a third argument.
34777 * VM/CodeGenerator.h:
34778 * VM/Machine.cpp:
34779 (JSC::Machine::privateExecute): Pass along the prototype.
34780 (JSC::Machine::cti_op_instanceof): ditto
34781 * kjs/JSObject.cpp:
34782 (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
34783 * kjs/JSObject.h:
34784 * kjs/nodes.cpp:
34785 (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
34786 property and pass that register to instanceof.
34787 * kjs/nodes.h:
34788
34789 2008-09-14 Gavin Barraclough <barraclough@apple.com>
34790
34791 Reviewed by Sam Weinig.
34792
34793 Remove unnecessary virtual function call from cti_op_call_JSFunction -
34794 ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
34795
34796 * VM/Machine.cpp:
34797 (JSC::Machine::cti_op_call_JSFunction):
34798
34799 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34800
34801 Reviewed by Maciej Stachowiak.
34802
34803 Bug 20827: the 'typeof' operator is slow
34804 <https://bugs.webkit.org/show_bug.cgi?id=20827>
34805
34806 Optimize the 'typeof' operator when its result is compared to a constant
34807 string.
34808
34809 This is a 5.5% speedup on the V8 Earley-Boyer test.
34810
34811 * VM/CTI.cpp:
34812 (JSC::CTI::privateCompileMainPass):
34813 * VM/CodeBlock.cpp:
34814 (JSC::CodeBlock::dump):
34815 * VM/CodeGenerator.cpp:
34816 (JSC::CodeGenerator::emitEqualityOp):
34817 * VM/CodeGenerator.h:
34818 * VM/Machine.cpp:
34819 (JSC::jsIsObjectType):
34820 (JSC::jsIsFunctionType):
34821 (JSC::Machine::privateExecute):
34822 (JSC::Machine::cti_op_is_undefined):
34823 (JSC::Machine::cti_op_is_boolean):
34824 (JSC::Machine::cti_op_is_number):
34825 (JSC::Machine::cti_op_is_string):
34826 (JSC::Machine::cti_op_is_object):
34827 (JSC::Machine::cti_op_is_function):
34828 * VM/Machine.h:
34829 * VM/Opcode.h:
34830 * kjs/nodes.cpp:
34831 (JSC::BinaryOpNode::emitCode):
34832 (JSC::EqualNode::emitCode):
34833 (JSC::StrictEqualNode::emitCode):
34834 * kjs/nodes.h:
34835
34836 2008-09-14 Sam Weinig <sam@webkit.org>
34837
34838 Reviewed by Cameron Zwarich.
34839
34840 Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
34841 Speed up parseInt for numbers
34842
34843 Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
34844 No change on the v8 suite.
34845
34846 * kjs/JSGlobalObjectFunctions.cpp:
34847 (JSC::globalFuncParseInt): Don't convert numbers to strings just to
34848 convert them back to numbers.
34849
34850 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34851
34852 Reviewed by Oliver Hunt.
34853
34854 Bug 20816: op_lesseq should be optimized
34855 <https://bugs.webkit.org/show_bug.cgi?id=20816>
34856
34857 Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
34858
34859 This is a 9.4% speedup on the V8 Crypto benchmark.
34860
34861 * VM/CTI.cpp:
34862 (JSC::CTI::privateCompileMainPass):
34863 (JSC::CTI::privateCompileSlowCases):
34864 * VM/CodeBlock.cpp:
34865 (JSC::CodeBlock::dump):
34866 * VM/CodeGenerator.cpp:
34867 (JSC::CodeGenerator::emitJumpIfTrue):
34868 * VM/Machine.cpp:
34869 (JSC::Machine::privateExecute):
34870 (JSC::Machine::cti_op_loop_if_lesseq):
34871 * VM/Machine.h:
34872 * VM/Opcode.h:
34873
34874 2008-09-14 Sam Weinig <sam@webkit.org>
34875
34876 Reviewed by Cameron Zwarich.
34877
34878 Cleanup Sampling code.
34879
34880 * VM/CTI.cpp:
34881 (JSC::CTI::emitCall):
34882 (JSC::CTI::privateCompileMainPass):
34883 * VM/CTI.h:
34884 (JSC::CTI::execute):
34885 * VM/SamplingTool.cpp:
34886 (JSC::):
34887 (JSC::SamplingTool::run):
34888 (JSC::SamplingTool::dump):
34889 * VM/SamplingTool.h:
34890 (JSC::SamplingTool::callingHostFunction):
34891
34892 2008-09-13 Oliver Hunt <oliver@apple.com>
34893
34894 Reviewed by Cameron Zwarich.
34895
34896 Bug 20821: Cache property transitions to speed up object initialization
34897 https://bugs.webkit.org/show_bug.cgi?id=20821
34898
34899 Implement a transition cache to improve the performance of new properties
34900 being added to objects. This is extremely beneficial in constructors and
34901 shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
34902 overall)
34903
34904 * VM/CTI.cpp:
34905 (JSC::CTI::privateCompileMainPass):
34906 (JSC::):
34907 (JSC::transitionWillNeedStorageRealloc):
34908 (JSC::CTI::privateCompilePutByIdTransition):
34909 * VM/CTI.h:
34910 (JSC::CTI::compilePutByIdTransition):
34911 * VM/CodeBlock.cpp:
34912 (JSC::printPutByIdOp):
34913 (JSC::CodeBlock::printStructureIDs):
34914 (JSC::CodeBlock::dump):
34915 (JSC::CodeBlock::derefStructureIDs):
34916 (JSC::CodeBlock::refStructureIDs):
34917 * VM/CodeGenerator.cpp:
34918 (JSC::CodeGenerator::emitPutById):
34919 * VM/Machine.cpp:
34920 (JSC::cachePrototypeChain):
34921 (JSC::Machine::tryCachePutByID):
34922 (JSC::Machine::tryCacheGetByID):
34923 (JSC::Machine::privateExecute):
34924 (JSC::Machine::tryCTICachePutByID):
34925 (JSC::Machine::tryCTICacheGetByID):
34926 * VM/Machine.h:
34927 * VM/Opcode.h:
34928 * kjs/JSObject.h:
34929 (JSC::JSObject::putDirect):
34930 (JSC::JSObject::transitionTo):
34931 * kjs/PutPropertySlot.h:
34932 (JSC::PutPropertySlot::PutPropertySlot):
34933 (JSC::PutPropertySlot::wasTransition):
34934 (JSC::PutPropertySlot::setWasTransition):
34935 * kjs/StructureID.cpp:
34936 (JSC::StructureID::transitionTo):
34937 (JSC::StructureIDChain::StructureIDChain):
34938 * kjs/StructureID.h:
34939 (JSC::StructureID::previousID):
34940 (JSC::StructureID::setCachedPrototypeChain):
34941 (JSC::StructureID::cachedPrototypeChain):
34942 (JSC::StructureID::propertyMap):
34943 * masm/X86Assembler.h:
34944 (JSC::X86Assembler::addl_i8m):
34945 (JSC::X86Assembler::subl_i8m):
34946
34947 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34948
34949 Reviewed by Maciej Stachowiak.
34950
34951 Bug 20819: JSValue::isObject() is slow
34952 <https://bugs.webkit.org/show_bug.cgi?id=20819>
34953
34954 Optimize JSCell::isObject() and JSCell::isString() by making them
34955 non-virtual calls that rely on the StructureID type information.
34956
34957 This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
34958 benchmark suite.
34959
34960 * JavaScriptCore.exp:
34961 * kjs/JSCell.cpp:
34962 * kjs/JSCell.h:
34963 (JSC::JSCell::isObject):
34964 (JSC::JSCell::isString):
34965 * kjs/JSObject.cpp:
34966 * kjs/JSObject.h:
34967 * kjs/JSString.cpp:
34968 * kjs/JSString.h:
34969 (JSC::JSString::JSString):
34970 * kjs/StructureID.h:
34971 (JSC::StructureID::type):
34972
34973 2008-09-11 Stephanie Lewis <slewis@apple.com>
34974
34975 Reviewed by Oliver Hunt.
34976
34977 Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
34978 crash on CNN and on Dromaeo.
34979 Fix Missing close tag in vcproj.
34980
34981 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
34982
34983 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
34984
34985 Not reviewed.
34986
34987 Correct an SVN problem with the last commit and actually add the new
34988 files.
34989
34990 * wrec/CharacterClassConstructor.cpp: Added.
34991 (JSC::):
34992 (JSC::getCharacterClassNewline):
34993 (JSC::getCharacterClassDigits):
34994 (JSC::getCharacterClassSpaces):
34995 (JSC::getCharacterClassWordchar):
34996 (JSC::getCharacterClassNondigits):
34997 (JSC::getCharacterClassNonspaces):
34998 (JSC::getCharacterClassNonwordchar):
34999 (JSC::CharacterClassConstructor::addSorted):
35000 (JSC::CharacterClassConstructor::addSortedRange):
35001 (JSC::CharacterClassConstructor::put):
35002 (JSC::CharacterClassConstructor::flush):
35003 (JSC::CharacterClassConstructor::append):
35004 * wrec/CharacterClassConstructor.h: Added.
35005 (JSC::CharacterClassConstructor::CharacterClassConstructor):
35006 (JSC::CharacterClassConstructor::isUpsideDown):
35007 (JSC::CharacterClassConstructor::charClass):
35008
35009 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35010
35011 Reviewed by Maciej Stachowiak.
35012
35013 Bug 20788: Split CharacterClassConstructor into its own file
35014 <https://bugs.webkit.org/show_bug.cgi?id=20788>
35015
35016 Split CharacterClassConstructor into its own file and clean up some
35017 style issues.
35018
35019 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
35020 * JavaScriptCore.xcodeproj/project.pbxproj:
35021 * wrec/CharacterClassConstructor.cpp: Added.
35022 (JSC::):
35023 (JSC::getCharacterClassNewline):
35024 (JSC::getCharacterClassDigits):
35025 (JSC::getCharacterClassSpaces):
35026 (JSC::getCharacterClassWordchar):
35027 (JSC::getCharacterClassNondigits):
35028 (JSC::getCharacterClassNonspaces):
35029 (JSC::getCharacterClassNonwordchar):
35030 (JSC::CharacterClassConstructor::addSorted):
35031 (JSC::CharacterClassConstructor::addSortedRange):
35032 (JSC::CharacterClassConstructor::put):
35033 (JSC::CharacterClassConstructor::flush):
35034 (JSC::CharacterClassConstructor::append):
35035 * wrec/CharacterClassConstructor.h: Added.
35036 (JSC::CharacterClassConstructor::CharacterClassConstructor):
35037 (JSC::CharacterClassConstructor::isUpsideDown):
35038 (JSC::CharacterClassConstructor::charClass):
35039 * wrec/WREC.cpp:
35040 (JSC::WRECParser::parseCharacterClass):
35041
35042 2008-09-10 Simon Hausmann <hausmann@webkit.org>
35043
35044 Not reviewed but trivial one-liner for yet unused macro.
35045
35046 Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
35047
35048 (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
35049
35050 * wtf/Platform.h:
35051
35052 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35053
35054 Rubber-stamped by Oliver Hunt.
35055
35056 Fix a typo by renaming the overloaded orl_rr that takes an immediate to
35057 orl_i32r.
35058
35059 * VM/CTI.cpp:
35060 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
35061 * masm/X86Assembler.h:
35062 (JSC::X86Assembler::orl_i32r):
35063 * wrec/WREC.cpp:
35064 (JSC::WRECGenerator::generatePatternCharacter):
35065 (JSC::WRECGenerator::generateCharacterClassInverted):
35066
35067 2008-09-10 Sam Weinig <sam@webkit.org>
35068
35069 Reviewed by Geoff Garen.
35070
35071 Add inline property storage for JSObject.
35072
35073 1.2% progression on Sunspider. .5% progression on the v8 test suite.
35074
35075 * JavaScriptCore.exp:
35076 * VM/CTI.cpp:
35077 (JSC::CTI::privateCompileGetByIdProto):
35078 (JSC::CTI::privateCompileGetByIdChain):
35079 * kjs/JSObject.cpp:
35080 (JSC::JSObject::mark): There is no reason to check storageSize now that
35081 we start from 0.
35082 (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
35083 * kjs/JSObject.h:
35084 (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
35085 now so there is no reason to .get()
35086 (JSC::JSObject::usingInlineStorage):
35087 (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
35088 inline storage.
35089 (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
35090 storage.
35091 (JSC::JSObject::putDirect): Switch to the heap storage only when we know
35092 we know that we are about to add a property that will overflow the inline
35093 storage.
35094 * kjs/PropertyMap.cpp:
35095 (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
35096 now handled by JSObject.
35097 (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
35098 * kjs/PropertyMap.h:
35099 (JSC::PropertyMap::storageSize): Rename from markingCount.
35100 * kjs/StructureID.cpp:
35101 (JSC::StructureID::addPropertyTransition): Don't resize the property storage
35102 if we are using inline storage.
35103 * kjs/StructureID.h:
35104
35105 2008-09-10 Oliver Hunt <oliver@apple.com>
35106
35107 Reviewed by Geoff Garen.
35108
35109 Inline immediate number version of op_mul.
35110
35111 Renamed mull_rr to imull_rr as that's what it's
35112 actually doing, and added imull_i32r for the constant
35113 case immediate multiply.
35114
35115 1.1% improvement to SunSpider.
35116
35117 * VM/CTI.cpp:
35118 (JSC::CTI::privateCompileMainPass):
35119 (JSC::CTI::privateCompileSlowCases):
35120 * masm/X86Assembler.h:
35121 (JSC::X86Assembler::):
35122 (JSC::X86Assembler::imull_rr):
35123 (JSC::X86Assembler::imull_i32r):
35124
35125 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35126
35127 Not reviewed.
35128
35129 Mac build fix.
35130
35131 * JavaScriptCore.xcodeproj/project.pbxproj:
35132
35133 2008-09-09 Oliver Hunt <oliver@apple.com>
35134
35135 Reviewed by Maciej Stachowiak.
35136
35137 Add optimised access to known properties on the global object.
35138
35139 Improve cross scope access to the global object by emitting
35140 code to access it directly rather than by walking the scope chain.
35141
35142 This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
35143
35144 * VM/CTI.cpp:
35145 (JSC::CTI::privateCompileMainPass):
35146 (JSC::CTI::emitGetVariableObjectRegister):
35147 (JSC::CTI::emitPutVariableObjectRegister):
35148 * VM/CTI.h:
35149 * VM/CodeBlock.cpp:
35150 (JSC::CodeBlock::dump):
35151 * VM/CodeGenerator.cpp:
35152 (JSC::CodeGenerator::findScopedProperty):
35153 (JSC::CodeGenerator::emitResolve):
35154 (JSC::CodeGenerator::emitGetScopedVar):
35155 (JSC::CodeGenerator::emitPutScopedVar):
35156 * VM/CodeGenerator.h:
35157 * VM/Machine.cpp:
35158 (JSC::Machine::privateExecute):
35159 * VM/Opcode.h:
35160 * kjs/nodes.cpp:
35161 (JSC::FunctionCallResolveNode::emitCode):
35162 (JSC::PostfixResolveNode::emitCode):
35163 (JSC::PrefixResolveNode::emitCode):
35164 (JSC::ReadModifyResolveNode::emitCode):
35165 (JSC::AssignResolveNode::emitCode):
35166
35167 2008-09-10 Maciej Stachowiak <mjs@apple.com>
35168
35169 Reviewed by Oliver.
35170
35171 - enable polymorphic inline caching of properties of primitives
35172
35173 1.012x speedup on SunSpider.
35174
35175 We create special structure IDs for JSString and
35176 JSNumberCell. Unlike normal structure IDs, these cannot hold the
35177 true prototype. Due to JS autoboxing semantics, the prototype used
35178 when looking up string or number properties depends on the lexical
35179 global object of the call site, not the creation site. Thus we
35180 enable StructureIDs to handle this quirk for primitives.
35181
35182 Everything else should be straightforward.
35183
35184 * VM/CTI.cpp:
35185 (JSC::CTI::privateCompileGetByIdProto):
35186 (JSC::CTI::privateCompileGetByIdChain):
35187 * VM/CTI.h:
35188 (JSC::CTI::compileGetByIdProto):
35189 (JSC::CTI::compileGetByIdChain):
35190 * VM/JSPropertyNameIterator.h:
35191 (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
35192 * VM/Machine.cpp:
35193 (JSC::Machine::Machine):
35194 (JSC::cachePrototypeChain):
35195 (JSC::Machine::tryCachePutByID):
35196 (JSC::Machine::tryCacheGetByID):
35197 (JSC::Machine::privateExecute):
35198 (JSC::Machine::tryCTICachePutByID):
35199 (JSC::Machine::tryCTICacheGetByID):
35200 * kjs/GetterSetter.h:
35201 (JSC::GetterSetter::GetterSetter):
35202 * kjs/JSCell.h:
35203 * kjs/JSGlobalData.cpp:
35204 (JSC::JSGlobalData::JSGlobalData):
35205 * kjs/JSGlobalData.h:
35206 * kjs/JSGlobalObject.h:
35207 (JSC::StructureID::prototypeForLookup):
35208 * kjs/JSNumberCell.h:
35209 (JSC::JSNumberCell::JSNumberCell):
35210 (JSC::jsNumberCell):
35211 * kjs/JSObject.h:
35212 (JSC::JSObject::prototype):
35213 * kjs/JSString.cpp:
35214 (JSC::jsString):
35215 (JSC::jsSubstring):
35216 (JSC::jsOwnedString):
35217 * kjs/JSString.h:
35218 (JSC::JSString::JSString):
35219 (JSC::JSString::):
35220 (JSC::jsSingleCharacterString):
35221 (JSC::jsSingleCharacterSubstring):
35222 (JSC::jsNontrivialString):
35223 * kjs/SmallStrings.cpp:
35224 (JSC::SmallStrings::createEmptyString):
35225 (JSC::SmallStrings::createSingleCharacterString):
35226 * kjs/StructureID.cpp:
35227 (JSC::StructureID::StructureID):
35228 (JSC::StructureID::addPropertyTransition):
35229 (JSC::StructureID::getterSetterTransition):
35230 (JSC::StructureIDChain::StructureIDChain):
35231 * kjs/StructureID.h:
35232 (JSC::StructureID::create):
35233 (JSC::StructureID::storedPrototype):
35234
35235 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
35236
35237 Reviewed by Sam Weinig.
35238
35239 https://bugs.webkit.org/show_bug.cgi?id=20746
35240
35241 Added WINCE platform macro.
35242
35243 * wtf/Platform.h:
35244
35245 2008-09-09 Sam Weinig <sam@webkit.org>
35246
35247 Reviewed by Mark Rowe.
35248
35249 Remove unnecessary override of getOffset.
35250
35251 Sunspider reports this as a .6% progression.
35252
35253 * JavaScriptCore.exp:
35254 * kjs/JSObject.h:
35255 (JSC::JSObject::getDirectLocation):
35256 (JSC::JSObject::getOwnPropertySlotForWrite):
35257 (JSC::JSObject::putDirect):
35258 * kjs/PropertyMap.cpp:
35259 * kjs/PropertyMap.h:
35260
35261 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35262
35263 Reviewed by Maciej Stachowiak.
35264
35265 Bug 20759: Remove MacroAssembler
35266 <https://bugs.webkit.org/show_bug.cgi?id=20759>
35267
35268 Remove MacroAssembler and move its functionality to X86Assembler.
35269
35270 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
35271 * JavaScriptCore.xcodeproj/project.pbxproj:
35272 * VM/CTI.cpp:
35273 (JSC::CTI::emitGetArg):
35274 (JSC::CTI::emitGetPutArg):
35275 (JSC::CTI::emitPutArg):
35276 (JSC::CTI::emitPutCTIParam):
35277 (JSC::CTI::emitGetCTIParam):
35278 (JSC::CTI::emitPutToCallFrameHeader):
35279 (JSC::CTI::emitGetFromCallFrameHeader):
35280 (JSC::CTI::emitPutResult):
35281 (JSC::CTI::emitDebugExceptionCheck):
35282 (JSC::CTI::emitJumpSlowCaseIfNotImm):
35283 (JSC::CTI::emitJumpSlowCaseIfNotImms):
35284 (JSC::CTI::emitFastArithDeTagImmediate):
35285 (JSC::CTI::emitFastArithReTagImmediate):
35286 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
35287 (JSC::CTI::emitFastArithImmToInt):
35288 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
35289 (JSC::CTI::emitFastArithIntToImmNoCheck):
35290 (JSC::CTI::compileOpCall):
35291 (JSC::CTI::emitSlowScriptCheck):
35292 (JSC::CTI::privateCompileMainPass):
35293 (JSC::CTI::privateCompileSlowCases):
35294 (JSC::CTI::privateCompile):
35295 (JSC::CTI::privateCompileGetByIdSelf):
35296 (JSC::CTI::privateCompileGetByIdProto):
35297 (JSC::CTI::privateCompileGetByIdChain):
35298 (JSC::CTI::privateCompilePutByIdReplace):
35299 (JSC::CTI::privateArrayLengthTrampoline):
35300 (JSC::CTI::privateStringLengthTrampoline):
35301 (JSC::CTI::compileRegExp):
35302 * VM/CTI.h:
35303 (JSC::CallRecord::CallRecord):
35304 (JSC::JmpTable::JmpTable):
35305 (JSC::SlowCaseEntry::SlowCaseEntry):
35306 (JSC::CTI::JSRInfo::JSRInfo):
35307 * masm/MacroAssembler.h: Removed.
35308 * masm/MacroAssemblerWin.cpp: Removed.
35309 * masm/X86Assembler.h:
35310 (JSC::X86Assembler::emitConvertToFastCall):
35311 (JSC::X86Assembler::emitRestoreArgumentReference):
35312 * wrec/WREC.h:
35313 (JSC::WRECGenerator::WRECGenerator):
35314 (JSC::WRECParser::WRECParser):
35315
35316 2008-09-09 Sam Weinig <sam@webkit.org>
35317
35318 Reviewed by Cameron Zwarich.
35319
35320 Don't waste the first item in the PropertyStorage.
35321
35322 - Fix typo (makingCount -> markingCount)
35323 - Remove undefined method declaration.
35324
35325 No change on Sunspider.
35326
35327 * kjs/JSObject.cpp:
35328 (JSC::JSObject::mark):
35329 * kjs/PropertyMap.cpp:
35330 (JSC::PropertyMap::put):
35331 (JSC::PropertyMap::remove):
35332 (JSC::PropertyMap::getOffset):
35333 (JSC::PropertyMap::insert):
35334 (JSC::PropertyMap::rehash):
35335 (JSC::PropertyMap::resizePropertyStorage):
35336 (JSC::PropertyMap::checkConsistency):
35337 * kjs/PropertyMap.h:
35338 (JSC::PropertyMap::markingCount): Fix typo.
35339
35340 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35341
35342 Not reviewed.
35343
35344 Speculative Windows build fix.
35345
35346 * masm/MacroAssemblerWin.cpp:
35347 (JSC::MacroAssembler::emitConvertToFastCall):
35348 (JSC::MacroAssembler::emitRestoreArgumentReference):
35349
35350 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35351
35352 Reviewed by Maciej Stachowiak.
35353
35354 Bug 20755: Create an X86 namespace for register names and other things
35355 <https://bugs.webkit.org/show_bug.cgi?id=20755>
35356
35357 Create an X86 namespace to put X86 register names. Perhaps I will move
35358 opcode names here later as well.
35359
35360 * VM/CTI.cpp:
35361 (JSC::CTI::emitGetArg):
35362 (JSC::CTI::emitGetPutArg):
35363 (JSC::CTI::emitPutArg):
35364 (JSC::CTI::emitPutArgConstant):
35365 (JSC::CTI::emitPutCTIParam):
35366 (JSC::CTI::emitGetCTIParam):
35367 (JSC::CTI::emitPutToCallFrameHeader):
35368 (JSC::CTI::emitGetFromCallFrameHeader):
35369 (JSC::CTI::emitPutResult):
35370 (JSC::CTI::emitDebugExceptionCheck):
35371 (JSC::CTI::emitJumpSlowCaseIfNotImms):
35372 (JSC::CTI::compileOpCall):
35373 (JSC::CTI::emitSlowScriptCheck):
35374 (JSC::CTI::privateCompileMainPass):
35375 (JSC::CTI::privateCompileSlowCases):
35376 (JSC::CTI::privateCompile):
35377 (JSC::CTI::privateCompileGetByIdSelf):
35378 (JSC::CTI::privateCompileGetByIdProto):
35379 (JSC::CTI::privateCompileGetByIdChain):
35380 (JSC::CTI::privateCompilePutByIdReplace):
35381 (JSC::CTI::privateArrayLengthTrampoline):
35382 (JSC::CTI::privateStringLengthTrampoline):
35383 (JSC::CTI::compileRegExp):
35384 * VM/CTI.h:
35385 * masm/X86Assembler.h:
35386 (JSC::X86::):
35387 (JSC::X86Assembler::emitModRm_rm):
35388 (JSC::X86Assembler::emitModRm_rm_Unchecked):
35389 (JSC::X86Assembler::emitModRm_rmsib):
35390 * wrec/WREC.cpp:
35391 (JSC::WRECGenerator::generateNonGreedyQuantifier):
35392 (JSC::WRECGenerator::generateGreedyQuantifier):
35393 (JSC::WRECGenerator::generateParentheses):
35394 (JSC::WRECGenerator::generateBackreference):
35395 (JSC::WRECGenerator::gernerateDisjunction):
35396 * wrec/WREC.h:
35397
35398 2008-09-09 Sam Weinig <sam@webkit.org>
35399
35400 Reviewed by Geoffrey Garen.
35401
35402 Remove unnecessary friend declaration.
35403
35404 * kjs/PropertyMap.h:
35405
35406 2008-09-09 Sam Weinig <sam@webkit.org>
35407
35408 Reviewed by Geoffrey Garen.
35409
35410 Replace uses of PropertyMap::get and PropertyMap::getLocation with
35411 PropertyMap::getOffset.
35412
35413 Sunspider reports this as a .6% improvement.
35414
35415 * JavaScriptCore.exp:
35416 * kjs/JSObject.cpp:
35417 (JSC::JSObject::put):
35418 (JSC::JSObject::deleteProperty):
35419 (JSC::JSObject::getPropertyAttributes):
35420 * kjs/JSObject.h:
35421 (JSC::JSObject::getDirect):
35422 (JSC::JSObject::getDirectLocation):
35423 (JSC::JSObject::locationForOffset):
35424 * kjs/PropertyMap.cpp:
35425 (JSC::PropertyMap::remove):
35426 (JSC::PropertyMap::getOffset):
35427 * kjs/PropertyMap.h:
35428
35429 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35430
35431 Reviewed by Sam Weinig.
35432
35433 Bug 20754: Remove emit prefix from assembler opcode methods
35434 <https://bugs.webkit.org/show_bug.cgi?id=20754>
35435
35436 * VM/CTI.cpp:
35437 (JSC::CTI::emitGetArg):
35438 (JSC::CTI::emitGetPutArg):
35439 (JSC::CTI::emitPutArg):
35440 (JSC::CTI::emitPutArgConstant):
35441 (JSC::CTI::emitPutCTIParam):
35442 (JSC::CTI::emitGetCTIParam):
35443 (JSC::CTI::emitPutToCallFrameHeader):
35444 (JSC::CTI::emitGetFromCallFrameHeader):
35445 (JSC::CTI::emitPutResult):
35446 (JSC::CTI::emitDebugExceptionCheck):
35447 (JSC::CTI::emitCall):
35448 (JSC::CTI::emitJumpSlowCaseIfNotImm):
35449 (JSC::CTI::emitJumpSlowCaseIfNotImms):
35450 (JSC::CTI::emitFastArithDeTagImmediate):
35451 (JSC::CTI::emitFastArithReTagImmediate):
35452 (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
35453 (JSC::CTI::emitFastArithImmToInt):
35454 (JSC::CTI::emitFastArithIntToImmOrSlowCase):
35455 (JSC::CTI::emitFastArithIntToImmNoCheck):
35456 (JSC::CTI::compileOpCall):
35457 (JSC::CTI::emitSlowScriptCheck):
35458 (JSC::CTI::privateCompileMainPass):
35459 (JSC::CTI::privateCompileSlowCases):
35460 (JSC::CTI::privateCompile):
35461 (JSC::CTI::privateCompileGetByIdSelf):
35462 (JSC::CTI::privateCompileGetByIdProto):
35463 (JSC::CTI::privateCompileGetByIdChain):
35464 (JSC::CTI::privateCompilePutByIdReplace):
35465 (JSC::CTI::privateArrayLengthTrampoline):
35466 (JSC::CTI::privateStringLengthTrampoline):
35467 (JSC::CTI::compileRegExp):
35468 * masm/MacroAssemblerWin.cpp:
35469 (JSC::MacroAssembler::emitConvertToFastCall):
35470 (JSC::MacroAssembler::emitRestoreArgumentReference):
35471 * masm/X86Assembler.h:
35472 (JSC::X86Assembler::pushl_r):
35473 (JSC::X86Assembler::pushl_m):
35474 (JSC::X86Assembler::popl_r):
35475 (JSC::X86Assembler::popl_m):
35476 (JSC::X86Assembler::movl_rr):
35477 (JSC::X86Assembler::addl_rr):
35478 (JSC::X86Assembler::addl_i8r):
35479 (JSC::X86Assembler::addl_i32r):
35480 (JSC::X86Assembler::addl_mr):
35481 (JSC::X86Assembler::andl_rr):
35482 (JSC::X86Assembler::andl_i32r):
35483 (JSC::X86Assembler::cmpl_i8r):
35484 (JSC::X86Assembler::cmpl_rr):
35485 (JSC::X86Assembler::cmpl_rm):
35486 (JSC::X86Assembler::cmpl_i32r):
35487 (JSC::X86Assembler::cmpl_i32m):
35488 (JSC::X86Assembler::cmpw_rm):
35489 (JSC::X86Assembler::orl_rr):
35490 (JSC::X86Assembler::subl_rr):
35491 (JSC::X86Assembler::subl_i8r):
35492 (JSC::X86Assembler::subl_i32r):
35493 (JSC::X86Assembler::subl_mr):
35494 (JSC::X86Assembler::testl_i32r):
35495 (JSC::X86Assembler::testl_rr):
35496 (JSC::X86Assembler::xorl_i8r):
35497 (JSC::X86Assembler::xorl_rr):
35498 (JSC::X86Assembler::sarl_i8r):
35499 (JSC::X86Assembler::sarl_CLr):
35500 (JSC::X86Assembler::shl_i8r):
35501 (JSC::X86Assembler::shll_CLr):
35502 (JSC::X86Assembler::mull_rr):
35503 (JSC::X86Assembler::idivl_r):
35504 (JSC::X86Assembler::cdq):
35505 (JSC::X86Assembler::movl_mr):
35506 (JSC::X86Assembler::movzwl_mr):
35507 (JSC::X86Assembler::movl_rm):
35508 (JSC::X86Assembler::movl_i32r):
35509 (JSC::X86Assembler::movl_i32m):
35510 (JSC::X86Assembler::leal_mr):
35511 (JSC::X86Assembler::ret):
35512 (JSC::X86Assembler::jmp_r):
35513 (JSC::X86Assembler::jmp_m):
35514 (JSC::X86Assembler::call_r):
35515 * wrec/WREC.cpp:
35516 (JSC::WRECGenerator::generateBacktrack1):
35517 (JSC::WRECGenerator::generateBacktrackBackreference):
35518 (JSC::WRECGenerator::generateBackreferenceQuantifier):
35519 (JSC::WRECGenerator::generateNonGreedyQuantifier):
35520 (JSC::WRECGenerator::generateGreedyQuantifier):
35521 (JSC::WRECGenerator::generatePatternCharacter):
35522 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
35523 (JSC::WRECGenerator::generateCharacterClassInverted):
35524 (JSC::WRECGenerator::generateCharacterClass):
35525 (JSC::WRECGenerator::generateParentheses):
35526 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
35527 (JSC::WRECGenerator::generateAssertionBOL):
35528 (JSC::WRECGenerator::generateAssertionEOL):
35529 (JSC::WRECGenerator::generateAssertionWordBoundary):
35530 (JSC::WRECGenerator::generateBackreference):
35531 (JSC::WRECGenerator::gernerateDisjunction):
35532
35533 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35534
35535 Reviewed by Maciej Stachowiak.
35536
35537 Clean up the WREC code some more.
35538
35539 * VM/CTI.cpp:
35540 (JSC::CTI::compileRegExp):
35541 * wrec/WREC.cpp:
35542 (JSC::getCharacterClassNewline):
35543 (JSC::getCharacterClassDigits):
35544 (JSC::getCharacterClassSpaces):
35545 (JSC::getCharacterClassWordchar):
35546 (JSC::getCharacterClassNondigits):
35547 (JSC::getCharacterClassNonspaces):
35548 (JSC::getCharacterClassNonwordchar):
35549 (JSC::WRECGenerator::generateBacktrack1):
35550 (JSC::WRECGenerator::generateBacktrackBackreference):
35551 (JSC::WRECGenerator::generateBackreferenceQuantifier):
35552 (JSC::WRECGenerator::generateNonGreedyQuantifier):
35553 (JSC::WRECGenerator::generateGreedyQuantifier):
35554 (JSC::WRECGenerator::generatePatternCharacter):
35555 (JSC::WRECGenerator::generateCharacterClassInvertedRange):
35556 (JSC::WRECGenerator::generateCharacterClassInverted):
35557 (JSC::WRECGenerator::generateCharacterClass):
35558 (JSC::WRECGenerator::generateParentheses):
35559 (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
35560 (JSC::WRECGenerator::generateAssertionBOL):
35561 (JSC::WRECGenerator::generateAssertionEOL):
35562 (JSC::WRECGenerator::generateAssertionWordBoundary):
35563 (JSC::WRECGenerator::generateBackreference):
35564 (JSC::WRECGenerator::gernerateDisjunction):
35565 (JSC::WRECParser::parseCharacterClass):
35566 (JSC::WRECParser::parseEscape):
35567 (JSC::WRECParser::parseTerm):
35568 * wrec/WREC.h:
35569
35570 2008-09-09 Mark Rowe <mrowe@apple.com>
35571
35572 Build fix, rubber-stamped by Anders Carlsson.
35573
35574 Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
35575
35576 * JavaScriptCore.xcodeproj/project.pbxproj:
35577
35578 2008-09-09 Mark Rowe <mrowe@apple.com>
35579
35580 Rubber-stamped by Oliver Hunt.
35581
35582 Fix builds using the "debug" variant.
35583
35584 This reverts r36130 and tweaks Identifier to export the same symbols for Debug
35585 and Release configurations.
35586
35587 * Configurations/JavaScriptCore.xcconfig:
35588 * DerivedSources.make:
35589 * JavaScriptCore.Debug.exp: Removed.
35590 * JavaScriptCore.base.exp: Removed.
35591 * JavaScriptCore.exp: Added.
35592 * JavaScriptCore.xcodeproj/project.pbxproj:
35593 * kjs/identifier.cpp:
35594 (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
35595 there is no overhead in Release builds.
35596 (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
35597 * kjs/identifier.h:
35598 (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
35599 no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
35600
35601 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35602
35603 Reviewed by Maciej Stachowiak.
35604
35605 Clean up WREC a bit to bring it closer to our coding style guidelines.
35606
35607 * wrec/WREC.cpp:
35608 (JSC::):
35609 (JSC::getCharacterClass_newline):
35610 (JSC::getCharacterClass_d):
35611 (JSC::getCharacterClass_s):
35612 (JSC::getCharacterClass_w):
35613 (JSC::getCharacterClass_D):
35614 (JSC::getCharacterClass_S):
35615 (JSC::getCharacterClass_W):
35616 (JSC::CharacterClassConstructor::append):
35617 (JSC::WRECGenerator::generateNonGreedyQuantifier):
35618 (JSC::WRECGenerator::generateGreedyQuantifier):
35619 (JSC::WRECGenerator::generateCharacterClassInverted):
35620 (JSC::WRECParser::parseQuantifier):
35621 (JSC::WRECParser::parsePatternCharacterQualifier):
35622 (JSC::WRECParser::parseCharacterClassQuantifier):
35623 (JSC::WRECParser::parseBackreferenceQuantifier):
35624 * wrec/WREC.h:
35625 (JSC::Quantifier::):
35626 (JSC::Quantifier::Quantifier):
35627
35628 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
35629
35630 Reviewed by Alexey Proskuryakov.
35631
35632 Try MIME charset names before trying IANA names
35633 ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
35634
35635 * wtf/StringExtras.h: (strcasecmp): Added.
35636
35637 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35638
35639 Reviewed by Mark Rowe.
35640
35641 Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
35642 <https://bugs.webkit.org/show_bug.cgi?id=20719>
35643 <rdar://problem/6205787>
35644
35645 Fix a typo in the case-insensitive matching of character patterns.
35646
35647 * wrec/WREC.cpp:
35648 (JSC::WRECGenerator::generatePatternCharacter):
35649
35650 2008-09-09 Maciej Stachowiak <mjs@apple.com>
35651
35652 Reviewed by Sam Weinig.
35653
35654 - allow polymorphic inline cache to handle Math object functions and possibly other similar things
35655
35656 1.012x speedup on SunSpider.
35657
35658 * kjs/MathObject.cpp:
35659 (JSC::MathObject::getOwnPropertySlot):
35660 * kjs/lookup.cpp:
35661 (JSC::setUpStaticFunctionSlot):
35662 * kjs/lookup.h:
35663 (JSC::getStaticPropertySlot):
35664
35665 2008-09-08 Sam Weinig <sam@webkit.org>
35666
35667 Reviewed by Maciej Stachowiak and Oliver Hunt.
35668
35669 Split storage of properties out of the PropertyMap and into the JSObject
35670 to allow sharing PropertyMap on the StructureID. In order to get this
35671 function correctly, the StructureID's transition mappings were changed to
35672 transition based on property name and attribute pairs, instead of just
35673 property name.
35674
35675 - Removes the single property optimization now that the PropertyMap is shared.
35676 This will be replaced by in-lining some values on the JSObject.
35677
35678 This is a wash on Sunspider and a 6.7% win on the v8 test suite.
35679
35680 * JavaScriptCore.base.exp:
35681 * VM/CTI.cpp:
35682 (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
35683 (JSC::CTI::privateCompileGetByIdProto): Ditto.
35684 (JSC::CTI::privateCompileGetByIdChain): Ditto.
35685 (JSC::CTI::privateCompilePutByIdReplace): Ditto.
35686 * kjs/JSObject.cpp:
35687 (JSC::JSObject::mark): Mark the PropertyStorage.
35688 (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
35689 (JSC::JSObject::deleteProperty): Ditto.
35690 (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
35691 (JSC::JSObject::defineSetter): Ditto.
35692 (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
35693 (JSC::JSObject::getPropertyNames): Ditto.
35694 (JSC::JSObject::removeDirect): Ditto.
35695 * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
35696 (JSC::JSObject::propertyStorage): return the PropertyStorage.
35697 (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
35698 (JSC::JSObject::getDirectLocation): Ditto.
35699 (JSC::JSObject::offsetForLocation): Compute location directly.
35700 (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
35701 (JSC::JSObject::hasGetterSetterProperties): Ditto.
35702 (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
35703 (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
35704 (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
35705 (JSC::JSObject::getOwnPropertySlot): Ditto.
35706 (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
35707 * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
35708 (JSC::PropertyMap::checkConsistency):
35709 (JSC::PropertyMap::operator=):
35710 (JSC::PropertyMap::~PropertyMap):
35711 (JSC::PropertyMap::get):
35712 (JSC::PropertyMap::getLocation):
35713 (JSC::PropertyMap::put):
35714 (JSC::PropertyMap::getOffset):
35715 (JSC::PropertyMap::insert):
35716 (JSC::PropertyMap::expand):
35717 (JSC::PropertyMap::rehash):
35718 (JSC::PropertyMap::createTable):
35719 (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
35720 (JSC::PropertyMap::remove):
35721 (JSC::PropertyMap::getEnumerablePropertyNames):
35722 * kjs/PropertyMap.h:
35723 (JSC::PropertyMapEntry::PropertyMapEntry):
35724 (JSC::PropertyMap::isEmpty):
35725 (JSC::PropertyMap::size):
35726 (JSC::PropertyMap::makingCount):
35727 (JSC::PropertyMap::PropertyMap):
35728
35729 * kjs/StructureID.cpp:
35730 (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
35731 and attributes.
35732 (JSC::StructureID::toDictionaryTransition): Copy the map.
35733 (JSC::StructureID::changePrototypeTransition): Copy the map.
35734 (JSC::StructureID::getterSetterTransition): Copy the map.
35735 (JSC::StructureID::~StructureID):
35736 * kjs/StructureID.h:
35737 (JSC::TransitionTableHash::hash): Custom hash for transition map.
35738 (JSC::TransitionTableHash::equal): Ditto.
35739 (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
35740 (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
35741 (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
35742 (JSC::StructureID::propertyMap): Added.
35743
35744 2008-09-08 Oliver Hunt <oliver@apple.com>
35745
35746 Reviewed by Mark Rowe.
35747
35748 Bug 20694: Slow Script error pops up when running Dromaeo tests
35749
35750 Correct error in timeout logic where execution tick count would
35751 be reset to incorrect value due to incorrect offset and indirection.
35752 Codegen for the slow script dialog was factored out into a separate
35753 method (emitSlowScriptCheck) rather than having multiple copies of
35754 the same code. Also added calls to generate slow script checks
35755 for loop_if_less and loop_if_true opcodes.
35756
35757 * VM/CTI.cpp:
35758 (JSC::CTI::emitSlowScriptCheck):
35759 (JSC::CTI::privateCompileMainPass):
35760 (JSC::CTI::privateCompileSlowCases):
35761 * VM/CTI.h:
35762
35763 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35764
35765 Reviewed by Maciej Stachowiak.
35766
35767 Remove references to the removed WRECompiler class.
35768
35769 * VM/Machine.h:
35770 * wrec/WREC.h:
35771
35772 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35773
35774 Rubber-stamped by Mark Rowe.
35775
35776 Fix the build with CTI enabled but WREC disabled.
35777
35778 * VM/CTI.cpp:
35779 * VM/CTI.h:
35780
35781 2008-09-08 Dan Bernstein <mitz@apple.com>
35782
35783 - build fix
35784
35785 * kjs/nodes.h:
35786 (JSC::StatementNode::):
35787 (JSC::BlockNode::):
35788
35789 2008-09-08 Kevin McCullough <kmccullough@apple.com>
35790
35791 Reviewed by Geoff.
35792
35793 <rdar://problem/6134407> Breakpoints in for loops, while loops or
35794 conditions without curly braces don't break. (19306)
35795 -Statement Lists already emit debug hooks but conditionals without
35796 brackets are not lists.
35797
35798 * kjs/nodes.cpp:
35799 (KJS::IfNode::emitCode):
35800 (KJS::IfElseNode::emitCode):
35801 (KJS::DoWhileNode::emitCode):
35802 (KJS::WhileNode::emitCode):
35803 (KJS::ForNode::emitCode):
35804 (KJS::ForInNode::emitCode):
35805 * kjs/nodes.h:
35806 (KJS::StatementNode::):
35807 (KJS::BlockNode::):
35808
35809 2008-09-08 Maciej Stachowiak <mjs@apple.com>
35810
35811 Reviewed by Anders Carlsson.
35812
35813 - Cache the code generated for eval to speed up SunSpider and web sites
35814 https://bugs.webkit.org/show_bug.cgi?id=20718
35815
35816 1.052x on SunSpider
35817 2.29x on date-format-tofte
35818
35819 Lots of real sites seem to get many hits on this cache as well,
35820 including GMail, Google Spreadsheets, Slate and Digg (the last of
35821 these gets over 100 hits on initial page load).
35822
35823 * VM/CodeBlock.h:
35824 (JSC::EvalCodeCache::get):
35825 * VM/Machine.cpp:
35826 (JSC::Machine::callEval):
35827 (JSC::Machine::privateExecute):
35828 (JSC::Machine::cti_op_call_eval):
35829 * VM/Machine.h:
35830
35831 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35832
35833 Reviewed by Oliver Hunt.
35834
35835 Bug 20711: Change KJS prefix on preprocessor macros to JSC
35836 <https://bugs.webkit.org/show_bug.cgi?id=20711>
35837
35838 * kjs/CommonIdentifiers.cpp:
35839 (JSC::CommonIdentifiers::CommonIdentifiers):
35840 * kjs/CommonIdentifiers.h:
35841 * kjs/PropertySlot.h:
35842 (JSC::PropertySlot::getValue):
35843 (JSC::PropertySlot::putValue):
35844 (JSC::PropertySlot::setValueSlot):
35845 (JSC::PropertySlot::setValue):
35846 (JSC::PropertySlot::setRegisterSlot):
35847 * kjs/lookup.h:
35848 * kjs/nodes.cpp:
35849 * kjs/nodes.h:
35850 (JSC::Node::):
35851 (JSC::ExpressionNode::):
35852 (JSC::StatementNode::):
35853 (JSC::NullNode::):
35854 (JSC::BooleanNode::):
35855 (JSC::NumberNode::):
35856 (JSC::ImmediateNumberNode::):
35857 (JSC::StringNode::):
35858 (JSC::RegExpNode::):
35859 (JSC::ThisNode::):
35860 (JSC::ResolveNode::):
35861 (JSC::ElementNode::):
35862 (JSC::ArrayNode::):
35863 (JSC::PropertyNode::):
35864 (JSC::PropertyListNode::):
35865 (JSC::ObjectLiteralNode::):
35866 (JSC::BracketAccessorNode::):
35867 (JSC::DotAccessorNode::):
35868 (JSC::ArgumentListNode::):
35869 (JSC::ArgumentsNode::):
35870 (JSC::NewExprNode::):
35871 (JSC::EvalFunctionCallNode::):
35872 (JSC::FunctionCallValueNode::):
35873 (JSC::FunctionCallResolveNode::):
35874 (JSC::FunctionCallBracketNode::):
35875 (JSC::FunctionCallDotNode::):
35876 (JSC::PrePostResolveNode::):
35877 (JSC::PostfixResolveNode::):
35878 (JSC::PostfixBracketNode::):
35879 (JSC::PostfixDotNode::):
35880 (JSC::PostfixErrorNode::):
35881 (JSC::DeleteResolveNode::):
35882 (JSC::DeleteBracketNode::):
35883 (JSC::DeleteDotNode::):
35884 (JSC::DeleteValueNode::):
35885 (JSC::VoidNode::):
35886 (JSC::TypeOfResolveNode::):
35887 (JSC::TypeOfValueNode::):
35888 (JSC::PrefixResolveNode::):
35889 (JSC::PrefixBracketNode::):
35890 (JSC::PrefixDotNode::):
35891 (JSC::PrefixErrorNode::):
35892 (JSC::UnaryPlusNode::):
35893 (JSC::NegateNode::):
35894 (JSC::BitwiseNotNode::):
35895 (JSC::LogicalNotNode::):
35896 (JSC::MultNode::):
35897 (JSC::DivNode::):
35898 (JSC::ModNode::):
35899 (JSC::AddNode::):
35900 (JSC::SubNode::):
35901 (JSC::LeftShiftNode::):
35902 (JSC::RightShiftNode::):
35903 (JSC::UnsignedRightShiftNode::):
35904 (JSC::LessNode::):
35905 (JSC::GreaterNode::):
35906 (JSC::LessEqNode::):
35907 (JSC::GreaterEqNode::):
35908 (JSC::ThrowableBinaryOpNode::):
35909 (JSC::InstanceOfNode::):
35910 (JSC::InNode::):
35911 (JSC::EqualNode::):
35912 (JSC::NotEqualNode::):
35913 (JSC::StrictEqualNode::):
35914 (JSC::NotStrictEqualNode::):
35915 (JSC::BitAndNode::):
35916 (JSC::BitOrNode::):
35917 (JSC::BitXOrNode::):
35918 (JSC::LogicalOpNode::):
35919 (JSC::ConditionalNode::):
35920 (JSC::ReadModifyResolveNode::):
35921 (JSC::AssignResolveNode::):
35922 (JSC::ReadModifyBracketNode::):
35923 (JSC::AssignBracketNode::):
35924 (JSC::AssignDotNode::):
35925 (JSC::ReadModifyDotNode::):
35926 (JSC::AssignErrorNode::):
35927 (JSC::CommaNode::):
35928 (JSC::VarDeclCommaNode::):
35929 (JSC::ConstDeclNode::):
35930 (JSC::ConstStatementNode::):
35931 (JSC::EmptyStatementNode::):
35932 (JSC::DebuggerStatementNode::):
35933 (JSC::ExprStatementNode::):
35934 (JSC::VarStatementNode::):
35935 (JSC::IfNode::):
35936 (JSC::IfElseNode::):
35937 (JSC::DoWhileNode::):
35938 (JSC::WhileNode::):
35939 (JSC::ForNode::):
35940 (JSC::ContinueNode::):
35941 (JSC::BreakNode::):
35942 (JSC::ReturnNode::):
35943 (JSC::WithNode::):
35944 (JSC::LabelNode::):
35945 (JSC::ThrowNode::):
35946 (JSC::TryNode::):
35947 (JSC::ParameterNode::):
35948 (JSC::ScopeNode::):
35949 (JSC::ProgramNode::):
35950 (JSC::EvalNode::):
35951 (JSC::FunctionBodyNode::):
35952 (JSC::FuncExprNode::):
35953 (JSC::FuncDeclNode::):
35954 (JSC::CaseClauseNode::):
35955 (JSC::ClauseListNode::):
35956 (JSC::CaseBlockNode::):
35957 (JSC::SwitchNode::):
35958
35959 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
35960
35961 Reviewed by Maciej Stachowiak.
35962
35963 Bug 20704: Replace the KJS namespace
35964 <https://bugs.webkit.org/show_bug.cgi?id=20704>
35965
35966 Rename the KJS namespace to JSC. There are still some uses of KJS in
35967 preprocessor macros and comments, but these will also be changed some
35968 time in the near future.
35969
35970 * API/APICast.h:
35971 (toJS):
35972 (toRef):
35973 (toGlobalRef):
35974 * API/JSBase.cpp:
35975 * API/JSCallbackConstructor.cpp:
35976 * API/JSCallbackConstructor.h:
35977 * API/JSCallbackFunction.cpp:
35978 * API/JSCallbackFunction.h:
35979 * API/JSCallbackObject.cpp:
35980 * API/JSCallbackObject.h:
35981 * API/JSCallbackObjectFunctions.h:
35982 * API/JSClassRef.cpp:
35983 (OpaqueJSClass::staticValues):
35984 (OpaqueJSClass::staticFunctions):
35985 * API/JSClassRef.h:
35986 * API/JSContextRef.cpp:
35987 * API/JSObjectRef.cpp:
35988 * API/JSProfilerPrivate.cpp:
35989 * API/JSStringRef.cpp:
35990 * API/JSValueRef.cpp:
35991 (JSValueGetType):
35992 * API/OpaqueJSString.cpp:
35993 * API/OpaqueJSString.h:
35994 * JavaScriptCore.Debug.exp:
35995 * JavaScriptCore.base.exp:
35996 * VM/CTI.cpp:
35997 (JSC::):
35998 * VM/CTI.h:
35999 * VM/CodeBlock.cpp:
36000 * VM/CodeBlock.h:
36001 * VM/CodeGenerator.cpp:
36002 * VM/CodeGenerator.h:
36003 * VM/ExceptionHelpers.cpp:
36004 * VM/ExceptionHelpers.h:
36005 * VM/Instruction.h:
36006 * VM/JSPropertyNameIterator.cpp:
36007 * VM/JSPropertyNameIterator.h:
36008 * VM/LabelID.h:
36009 * VM/Machine.cpp:
36010 * VM/Machine.h:
36011 * VM/Opcode.cpp:
36012 * VM/Opcode.h:
36013 * VM/Register.h:
36014 (WTF::):
36015 * VM/RegisterFile.cpp:
36016 * VM/RegisterFile.h:
36017 * VM/RegisterID.h:
36018 (WTF::):
36019 * VM/SamplingTool.cpp:
36020 * VM/SamplingTool.h:
36021 * VM/SegmentedVector.h:
36022 * kjs/ArgList.cpp:
36023 * kjs/ArgList.h:
36024 * kjs/Arguments.cpp:
36025 * kjs/Arguments.h:
36026 * kjs/ArrayConstructor.cpp:
36027 * kjs/ArrayConstructor.h:
36028 * kjs/ArrayPrototype.cpp:
36029 * kjs/ArrayPrototype.h:
36030 * kjs/BatchedTransitionOptimizer.h:
36031 * kjs/BooleanConstructor.cpp:
36032 * kjs/BooleanConstructor.h:
36033 * kjs/BooleanObject.cpp:
36034 * kjs/BooleanObject.h:
36035 * kjs/BooleanPrototype.cpp:
36036 * kjs/BooleanPrototype.h:
36037 * kjs/CallData.cpp:
36038 * kjs/CallData.h:
36039 * kjs/ClassInfo.h:
36040 * kjs/CommonIdentifiers.cpp:
36041 * kjs/CommonIdentifiers.h:
36042 * kjs/ConstructData.cpp:
36043 * kjs/ConstructData.h:
36044 * kjs/DateConstructor.cpp:
36045 * kjs/DateConstructor.h:
36046 * kjs/DateInstance.cpp:
36047 (JSC::DateInstance::msToGregorianDateTime):
36048 * kjs/DateInstance.h:
36049 * kjs/DateMath.cpp:
36050 * kjs/DateMath.h:
36051 * kjs/DatePrototype.cpp:
36052 * kjs/DatePrototype.h:
36053 * kjs/DebuggerCallFrame.cpp:
36054 * kjs/DebuggerCallFrame.h:
36055 * kjs/Error.cpp:
36056 * kjs/Error.h:
36057 * kjs/ErrorConstructor.cpp:
36058 * kjs/ErrorConstructor.h:
36059 * kjs/ErrorInstance.cpp:
36060 * kjs/ErrorInstance.h:
36061 * kjs/ErrorPrototype.cpp:
36062 * kjs/ErrorPrototype.h:
36063 * kjs/ExecState.cpp:
36064 * kjs/ExecState.h:
36065 * kjs/FunctionConstructor.cpp:
36066 * kjs/FunctionConstructor.h:
36067 * kjs/FunctionPrototype.cpp:
36068 * kjs/FunctionPrototype.h:
36069 * kjs/GetterSetter.cpp:
36070 * kjs/GetterSetter.h:
36071 * kjs/GlobalEvalFunction.cpp:
36072 * kjs/GlobalEvalFunction.h:
36073 * kjs/IndexToNameMap.cpp:
36074 * kjs/IndexToNameMap.h:
36075 * kjs/InitializeThreading.cpp:
36076 * kjs/InitializeThreading.h:
36077 * kjs/InternalFunction.cpp:
36078 * kjs/InternalFunction.h:
36079 (JSC::InternalFunction::InternalFunction):
36080 * kjs/JSActivation.cpp:
36081 * kjs/JSActivation.h:
36082 * kjs/JSArray.cpp:
36083 * kjs/JSArray.h:
36084 * kjs/JSCell.cpp:
36085 * kjs/JSCell.h:
36086 * kjs/JSFunction.cpp:
36087 * kjs/JSFunction.h:
36088 (JSC::JSFunction::JSFunction):
36089 * kjs/JSGlobalData.cpp:
36090 (JSC::JSGlobalData::JSGlobalData):
36091 * kjs/JSGlobalData.h:
36092 * kjs/JSGlobalObject.cpp:
36093 * kjs/JSGlobalObject.h:
36094 * kjs/JSGlobalObjectFunctions.cpp:
36095 * kjs/JSGlobalObjectFunctions.h:
36096 * kjs/JSImmediate.cpp:
36097 * kjs/JSImmediate.h:
36098 * kjs/JSLock.cpp:
36099 * kjs/JSLock.h:
36100 * kjs/JSNotAnObject.cpp:
36101 * kjs/JSNotAnObject.h:
36102 * kjs/JSNumberCell.cpp:
36103 * kjs/JSNumberCell.h:
36104 * kjs/JSObject.cpp:
36105 * kjs/JSObject.h:
36106 * kjs/JSStaticScopeObject.cpp:
36107 * kjs/JSStaticScopeObject.h:
36108 * kjs/JSString.cpp:
36109 * kjs/JSString.h:
36110 * kjs/JSType.h:
36111 * kjs/JSValue.cpp:
36112 * kjs/JSValue.h:
36113 * kjs/JSVariableObject.cpp:
36114 * kjs/JSVariableObject.h:
36115 * kjs/JSWrapperObject.cpp:
36116 * kjs/JSWrapperObject.h:
36117 * kjs/LabelStack.cpp:
36118 * kjs/LabelStack.h:
36119 * kjs/MathObject.cpp:
36120 * kjs/MathObject.h:
36121 * kjs/NativeErrorConstructor.cpp:
36122 * kjs/NativeErrorConstructor.h:
36123 * kjs/NativeErrorPrototype.cpp:
36124 * kjs/NativeErrorPrototype.h:
36125 * kjs/NodeInfo.h:
36126 * kjs/NumberConstructor.cpp:
36127 * kjs/NumberConstructor.h:
36128 * kjs/NumberObject.cpp:
36129 * kjs/NumberObject.h:
36130 * kjs/NumberPrototype.cpp:
36131 * kjs/NumberPrototype.h:
36132 * kjs/ObjectConstructor.cpp:
36133 * kjs/ObjectConstructor.h:
36134 * kjs/ObjectPrototype.cpp:
36135 * kjs/ObjectPrototype.h:
36136 * kjs/Parser.cpp:
36137 * kjs/Parser.h:
36138 * kjs/PropertyMap.cpp:
36139 (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
36140 * kjs/PropertyMap.h:
36141 * kjs/PropertyNameArray.cpp:
36142 * kjs/PropertyNameArray.h:
36143 * kjs/PropertySlot.cpp:
36144 * kjs/PropertySlot.h:
36145 * kjs/PrototypeFunction.cpp:
36146 * kjs/PrototypeFunction.h:
36147 * kjs/PutPropertySlot.h:
36148 * kjs/RegExpConstructor.cpp:
36149 * kjs/RegExpConstructor.h:
36150 * kjs/RegExpObject.cpp:
36151 * kjs/RegExpObject.h:
36152 * kjs/RegExpPrototype.cpp:
36153 * kjs/RegExpPrototype.h:
36154 * kjs/ScopeChain.cpp:
36155 * kjs/ScopeChain.h:
36156 * kjs/ScopeChainMark.h:
36157 * kjs/Shell.cpp:
36158 (jscmain):
36159 * kjs/SmallStrings.cpp:
36160 * kjs/SmallStrings.h:
36161 * kjs/SourceProvider.h:
36162 * kjs/SourceRange.h:
36163 * kjs/StringConstructor.cpp:
36164 * kjs/StringConstructor.h:
36165 * kjs/StringObject.cpp:
36166 * kjs/StringObject.h:
36167 * kjs/StringObjectThatMasqueradesAsUndefined.h:
36168 * kjs/StringPrototype.cpp:
36169 * kjs/StringPrototype.h:
36170 * kjs/StructureID.cpp:
36171 * kjs/StructureID.h:
36172 * kjs/SymbolTable.h:
36173 * kjs/collector.cpp:
36174 * kjs/collector.h:
36175 * kjs/completion.h:
36176 * kjs/create_hash_table:
36177 * kjs/debugger.cpp:
36178 * kjs/debugger.h:
36179 * kjs/dtoa.cpp:
36180 * kjs/dtoa.h:
36181 * kjs/grammar.y:
36182 * kjs/identifier.cpp:
36183 * kjs/identifier.h:
36184 (JSC::Identifier::equal):
36185 * kjs/interpreter.cpp:
36186 * kjs/interpreter.h:
36187 * kjs/lexer.cpp:
36188 (JSC::Lexer::Lexer):
36189 (JSC::Lexer::clear):
36190 (JSC::Lexer::makeIdentifier):
36191 * kjs/lexer.h:
36192 * kjs/lookup.cpp:
36193 * kjs/lookup.h:
36194 * kjs/nodes.cpp:
36195 * kjs/nodes.h:
36196 * kjs/nodes2string.cpp:
36197 * kjs/operations.cpp:
36198 * kjs/operations.h:
36199 * kjs/protect.h:
36200 * kjs/regexp.cpp:
36201 * kjs/regexp.h:
36202 * kjs/ustring.cpp:
36203 * kjs/ustring.h:
36204 (JSC::operator!=):
36205 (JSC::IdentifierRepHash::hash):
36206 (WTF::):
36207 * masm/MacroAssembler.h:
36208 * masm/MacroAssemblerWin.cpp:
36209 * masm/X86Assembler.h:
36210 * pcre/pcre_exec.cpp:
36211 * profiler/CallIdentifier.h:
36212 (WTF::):
36213 * profiler/HeavyProfile.cpp:
36214 * profiler/HeavyProfile.h:
36215 * profiler/Profile.cpp:
36216 * profiler/Profile.h:
36217 * profiler/ProfileGenerator.cpp:
36218 * profiler/ProfileGenerator.h:
36219 * profiler/ProfileNode.cpp:
36220 * profiler/ProfileNode.h:
36221 * profiler/Profiler.cpp:
36222 * profiler/Profiler.h:
36223 * profiler/TreeProfile.cpp:
36224 * profiler/TreeProfile.h:
36225 * wrec/WREC.cpp:
36226 * wrec/WREC.h:
36227 * wtf/AVLTree.h:
36228
36229 2008-09-07 Maciej Stachowiak <mjs@apple.com>
36230
36231 Reviewed by Dan Bernstein.
36232
36233 - rename IA32MacroAssembler class to X86Assembler
36234
36235 We otherwise call the platform X86, and also, I don't see any macros.
36236
36237 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
36238 * JavaScriptCore.xcodeproj/project.pbxproj:
36239 * masm/IA32MacroAsm.h: Removed.
36240 * masm/MacroAssembler.h:
36241 (KJS::MacroAssembler::MacroAssembler):
36242 * masm/MacroAssemblerWin.cpp:
36243 (KJS::MacroAssembler::emitRestoreArgumentReference):
36244 * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
36245 (KJS::X86Assembler::X86Assembler):
36246 * wrec/WREC.cpp:
36247 (KJS::WRECGenerator::generateNonGreedyQuantifier):
36248 (KJS::WRECGenerator::generateGreedyQuantifier):
36249 (KJS::WRECGenerator::generateParentheses):
36250 (KJS::WRECGenerator::generateBackreference):
36251 (KJS::WRECGenerator::gernerateDisjunction):
36252 * wrec/WREC.h:
36253
36254 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
36255
36256 Not reviewed.
36257
36258 Visual C++ seems to have some odd casting rules, so just convert the
36259 offending cast back to a C-style cast for now.
36260
36261 * kjs/collector.cpp:
36262 (KJS::otherThreadStackPointer):
36263
36264 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
36265
36266 Reviewed by Mark Rowe.
36267
36268 Attempt to fix the Windows build by using a const_cast to cast regs.Esp
36269 to a uintptr_t instead of a reinterpret_cast.
36270
36271 * kjs/collector.cpp:
36272 (KJS::otherThreadStackPointer):
36273
36274 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
36275
36276 Reviewed by Sam Weinig.
36277
36278 Remove C-style casts from kjs/collector.cpp.
36279
36280 * kjs/collector.cpp:
36281 (KJS::Heap::heapAllocate):
36282 (KJS::currentThreadStackBase):
36283 (KJS::Heap::markConservatively):
36284 (KJS::otherThreadStackPointer):
36285 (KJS::Heap::markOtherThreadConservatively):
36286 (KJS::Heap::sweep):
36287
36288 2008-09-07 Mark Rowe <mrowe@apple.com>
36289
36290 Build fix for the debug variant.
36291
36292 * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
36293
36294 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
36295
36296 Reviewed by Timothy Hatcher.
36297
36298 Remove C-style casts from the CTI code.
36299
36300 * VM/CTI.cpp:
36301 (KJS::CTI::emitGetArg):
36302 (KJS::CTI::emitGetPutArg):
36303 (KJS::ctiRepatchCallByReturnAddress):
36304 (KJS::CTI::compileOpCall):
36305 (KJS::CTI::privateCompileMainPass):
36306 (KJS::CTI::privateCompileGetByIdSelf):
36307 (KJS::CTI::privateCompileGetByIdProto):
36308 (KJS::CTI::privateCompileGetByIdChain):
36309 (KJS::CTI::privateCompilePutByIdReplace):
36310 (KJS::CTI::privateArrayLengthTrampoline):
36311 (KJS::CTI::privateStringLengthTrampoline):
36312
36313 === End merge of squirrelfish-extreme ===
36314
36315 2008-09-06 Gavin Barraclough <barraclough@apple.com>
36316
36317 Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
36318
36319 - refactor WREC to share more of the JIT infrastructure with CTI
36320
36321 * VM/CTI.cpp:
36322 (KJS::CTI::emitGetArg):
36323 (KJS::CTI::emitGetPutArg):
36324 (KJS::CTI::emitPutArg):
36325 (KJS::CTI::emitPutArgConstant):
36326 (KJS::CTI::emitPutCTIParam):
36327 (KJS::CTI::emitGetCTIParam):
36328 (KJS::CTI::emitPutToCallFrameHeader):
36329 (KJS::CTI::emitGetFromCallFrameHeader):
36330 (KJS::CTI::emitPutResult):
36331 (KJS::CTI::emitDebugExceptionCheck):
36332 (KJS::CTI::emitJumpSlowCaseIfNotImm):
36333 (KJS::CTI::emitJumpSlowCaseIfNotImms):
36334 (KJS::CTI::emitFastArithDeTagImmediate):
36335 (KJS::CTI::emitFastArithReTagImmediate):
36336 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
36337 (KJS::CTI::emitFastArithImmToInt):
36338 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
36339 (KJS::CTI::emitFastArithIntToImmNoCheck):
36340 (KJS::CTI::CTI):
36341 (KJS::CTI::compileOpCall):
36342 (KJS::CTI::privateCompileMainPass):
36343 (KJS::CTI::privateCompileSlowCases):
36344 (KJS::CTI::privateCompile):
36345 (KJS::CTI::privateCompileGetByIdSelf):
36346 (KJS::CTI::privateCompileGetByIdProto):
36347 (KJS::CTI::privateCompileGetByIdChain):
36348 (KJS::CTI::privateCompilePutByIdReplace):
36349 (KJS::CTI::privateArrayLengthTrampoline):
36350 (KJS::CTI::privateStringLengthTrampoline):
36351 (KJS::CTI::compileRegExp):
36352 * VM/CTI.h:
36353 (KJS::CallRecord::CallRecord):
36354 (KJS::JmpTable::JmpTable):
36355 (KJS::SlowCaseEntry::SlowCaseEntry):
36356 (KJS::CTI::JSRInfo::JSRInfo):
36357 * kjs/regexp.cpp:
36358 (KJS::RegExp::RegExp):
36359 * wrec/WREC.cpp:
36360 (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
36361 (KJS::GeneratePatternCharacterFunctor::generateAtom):
36362 (KJS::GeneratePatternCharacterFunctor::backtrack):
36363 (KJS::GenerateCharacterClassFunctor::generateAtom):
36364 (KJS::GenerateCharacterClassFunctor::backtrack):
36365 (KJS::GenerateBackreferenceFunctor::generateAtom):
36366 (KJS::GenerateBackreferenceFunctor::backtrack):
36367 (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
36368 (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
36369 (KJS::WRECGenerate::generateBacktrack1):
36370 (KJS::WRECGenerate::generateBacktrackBackreference):
36371 (KJS::WRECGenerate::generateBackreferenceQuantifier):
36372 (KJS::WRECGenerate::generateNonGreedyQuantifier):
36373 (KJS::WRECGenerate::generateGreedyQuantifier):
36374 (KJS::WRECGenerate::generatePatternCharacter):
36375 (KJS::WRECGenerate::generateCharacterClassInvertedRange):
36376 (KJS::WRECGenerate::generateCharacterClassInverted):
36377 (KJS::WRECGenerate::generateCharacterClass):
36378 (KJS::WRECGenerate::generateParentheses):
36379 (KJS::WRECGenerate::generateParenthesesNonGreedy):
36380 (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
36381 (KJS::WRECGenerate::generateAssertionBOL):
36382 (KJS::WRECGenerate::generateAssertionEOL):
36383 (KJS::WRECGenerate::generateAssertionWordBoundary):
36384 (KJS::WRECGenerate::generateBackreference):
36385 (KJS::WRECGenerate::gernerateDisjunction):
36386 (KJS::WRECGenerate::terminateDisjunction):
36387 (KJS::WRECParser::parseGreedyQuantifier):
36388 (KJS::WRECParser::parseQuantifier):
36389 (KJS::WRECParser::parsePatternCharacterQualifier):
36390 (KJS::WRECParser::parseCharacterClassQuantifier):
36391 (KJS::WRECParser::parseBackreferenceQuantifier):
36392 (KJS::WRECParser::parseParentheses):
36393 (KJS::WRECParser::parseCharacterClass):
36394 (KJS::WRECParser::parseOctalEscape):
36395 (KJS::WRECParser::parseEscape):
36396 (KJS::WRECParser::parseTerm):
36397 (KJS::WRECParser::parseDisjunction):
36398 * wrec/WREC.h:
36399 (KJS::WRECGenerate::WRECGenerate):
36400 (KJS::WRECParser::):
36401 (KJS::WRECParser::WRECParser):
36402 (KJS::WRECParser::parseAlternative):
36403 (KJS::WRECParser::isEndOfPattern):
36404
36405 2008-09-06 Oliver Hunt <oliver@apple.com>
36406
36407 Reviewed by NOBODY (Build fix).
36408
36409 Fix the sampler build.
36410
36411 * VM/SamplingTool.h:
36412
36413 2008-09-06 Oliver Hunt <oliver@apple.com>
36414
36415 Reviewed by Maciej Stachowiak.
36416
36417 Jump through the necessary hoops required to make MSVC cooperate with SFX
36418
36419 We now explicitly declare the calling convention on all cti_op_* cfunctions,
36420 and return int instead of bool where appropriate (despite the cdecl calling
36421 convention seems to state MSVC generates code that returns the result value
36422 through ecx). SFX behaves slightly differently under MSVC, specifically it
36423 stores the base argument address for the cti_op_* functions in the first
36424 argument, and then does the required stack manipulation through that pointer.
36425 This is necessary as MSVC's optimisations assume they have complete control
36426 of the stack, and periodically elide our stack manipulations, or move
36427 values in unexpected ways. MSVC also frequently produces tail calls which may
36428 clobber the first argument, so the MSVC path is slightly less efficient due
36429 to the need to restore it.
36430
36431 * JavaScriptCore.xcodeproj/project.pbxproj:
36432 * VM/CTI.cpp:
36433 (KJS::):
36434 (KJS::CTI::compileOpCall):
36435 (KJS::CTI::privateCompileMainPass):
36436 (KJS::CTI::privateCompileSlowCases):
36437 * VM/CTI.h:
36438 * VM/Machine.cpp:
36439 * VM/Machine.h:
36440 * masm/MacroAssembler.h:
36441 (KJS::MacroAssembler::emitConvertToFastCall):
36442 * masm/MacroAssemblerIA32GCC.cpp: Removed.
36443 For performance reasons we need these no-op functions to be inlined.
36444
36445 * masm/MacroAssemblerWin.cpp:
36446 (KJS::MacroAssembler::emitRestoreArgumentReference):
36447 * wtf/Platform.h:
36448
36449 2008-09-05 Geoffrey Garen <ggaren@apple.com>
36450
36451 Reviewed by Maciej Stachowiak, or maybe the other way around.
36452
36453 Added the ability to coalesce JITCode buffer grow operations by first
36454 growing the buffer and then executing unchecked puts to it.
36455
36456 About a 2% speedup on date-format-tofte.
36457
36458 * VM/CTI.cpp:
36459 (KJS::CTI::compileOpCall):
36460 * masm/IA32MacroAsm.h:
36461 (KJS::JITCodeBuffer::ensureSpace):
36462 (KJS::JITCodeBuffer::putByteUnchecked):
36463 (KJS::JITCodeBuffer::putByte):
36464 (KJS::JITCodeBuffer::putShortUnchecked):
36465 (KJS::JITCodeBuffer::putShort):
36466 (KJS::JITCodeBuffer::putIntUnchecked):
36467 (KJS::JITCodeBuffer::putInt):
36468 (KJS::IA32MacroAssembler::emitTestl_i32r):
36469 (KJS::IA32MacroAssembler::emitMovl_mr):
36470 (KJS::IA32MacroAssembler::emitMovl_rm):
36471 (KJS::IA32MacroAssembler::emitMovl_i32m):
36472 (KJS::IA32MacroAssembler::emitUnlinkedJe):
36473 (KJS::IA32MacroAssembler::emitModRm_rr):
36474 (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
36475 (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
36476 (KJS::IA32MacroAssembler::emitModRm_rm):
36477 (KJS::IA32MacroAssembler::emitModRm_opr):
36478 (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
36479 (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
36480
36481 2008-09-05 Mark Rowe <mrowe@apple.com>
36482
36483 Reviewed by Sam Weinig.
36484
36485 Disable WREC and CTI on platforms that we have not yet had a chance to test with.
36486
36487 * wtf/Platform.h:
36488
36489 2008-09-05 Geoffrey Garen <ggaren@apple.com>
36490
36491 Reviewed by Sam Weinig.
36492
36493 Use jo instead of a mask compare when fetching array.length and
36494 string.length. 4% speedup on array.length / string.length torture
36495 test.
36496
36497 * VM/CTI.cpp:
36498 (KJS::CTI::privateArrayLengthTrampoline):
36499 (KJS::CTI::privateStringLengthTrampoline):
36500
36501 2008-09-05 Geoffrey Garen <ggaren@apple.com>
36502
36503 Reviewed by Sam Weinig.
36504
36505 Removed a CTI compilation pass by recording labels during bytecode
36506 generation. This is more to reduce complexity than it is to improve
36507 performance.
36508
36509 SunSpider reports no change.
36510
36511 CodeBlock now keeps a "labels" set, which holds the offsets of all the
36512 instructions that can be jumped to.
36513
36514 * VM/CTI.cpp: Nixed a pass.
36515
36516 * VM/CodeBlock.h: Added a "labels" set.
36517
36518 * VM/LabelID.h: No need for a special LableID for holding jump
36519 destinations, since the CodeBlock now knows all jump destinations.
36520
36521 * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
36522 the set.
36523
36524 * kjs/nodes.cpp:
36525 (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
36526
36527 2008-09-05 Mark Rowe <mrowe@apple.com>
36528
36529 Reviewed by Oliver Hunt and Gavin Barraclough.
36530
36531 Move the JITCodeBuffer onto Machine and remove the static variables.
36532
36533 * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
36534 * VM/Machine.cpp:
36535 (KJS::Machine::Machine): Allocate a JITCodeBuffer.
36536 * VM/Machine.h:
36537 * kjs/RegExpConstructor.cpp:
36538 (KJS::constructRegExp): Pass the ExecState through.
36539 * kjs/RegExpPrototype.cpp:
36540 (KJS::regExpProtoFuncCompile): Ditto.
36541 * kjs/StringPrototype.cpp:
36542 (KJS::stringProtoFuncMatch): Ditto.
36543 (KJS::stringProtoFuncSearch): Ditto.
36544 * kjs/nodes.cpp:
36545 (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
36546 so that we have access to an ExecState.
36547 * kjs/nodes.h:
36548 (KJS::RegExpNode::):
36549 * kjs/nodes2string.cpp:
36550 * kjs/regexp.cpp:
36551 (KJS::RegExp::RegExp): Pass the ExecState through.
36552 (KJS::RegExp::create): Ditto.
36553 * kjs/regexp.h:
36554 * masm/IA32MacroAsm.h:
36555 (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
36556 constructed.
36557 * wrec/WREC.cpp:
36558 (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
36559 * wrec/WREC.h:
36560
36561 2008-09-05 Mark Rowe <mrowe@apple.com>
36562
36563 Reviewed by Oliver Hunt and Gavin Barraclough.
36564
36565 Fix the build when CTI is disabled.
36566
36567 * VM/CodeBlock.cpp:
36568 (KJS::CodeBlock::~CodeBlock):
36569 * VM/CodeGenerator.cpp:
36570 (KJS::prepareJumpTableForStringSwitch):
36571 * VM/Machine.cpp:
36572 (KJS::Machine::Machine):
36573 (KJS::Machine::~Machine):
36574
36575 2008-09-05 Gavin Barraclough <barraclough@apple.com>
36576
36577 Reviewed by Mark Rowe.
36578
36579 Fix some windows abi issues.
36580
36581 * VM/CTI.cpp:
36582 (KJS::CTI::privateCompileMainPass):
36583 (KJS::CTI::privateCompileSlowCases):
36584 * VM/CTI.h:
36585 (KJS::CallRecord::CallRecord):
36586 (KJS::):
36587 * VM/Machine.cpp:
36588 (KJS::Machine::cti_op_resolve_func):
36589 (KJS::Machine::cti_op_post_inc):
36590 (KJS::Machine::cti_op_resolve_with_base):
36591 (KJS::Machine::cti_op_post_dec):
36592 * VM/Machine.h:
36593
36594 2008-09-05 Mark Rowe <mrowe@apple.com>
36595
36596 Reviewed by Sam Weinig.
36597
36598 Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
36599
36600 * VM/Machine.cpp:
36601 (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
36602 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
36603
36604 2008-09-04 Mark Rowe <mrowe@apple.com>
36605
36606 Reviewed by Sam Weinig.
36607
36608 Fix fast/dom/Window/console-functions.html.
36609
36610 The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
36611 such as console.log would use the line number of the last JS function on the call stack.
36612
36613 * VM/Machine.cpp:
36614 (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
36615 and restore it when the function is done.
36616 (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
36617
36618 2008-09-05 Oliver Hunt <oliver@apple.com>
36619
36620 Start bringing up SFX on windows.
36621
36622 Reviewed by Mark Rowe and Sam Weinig
36623
36624 Start doing the work to bring up SFX on windows. Initially
36625 just working on WREC, as it does not make any calls so reduces
36626 the amount of code that needs to be corrected.
36627
36628 Start abstracting the CTI JIT codegen engine.
36629
36630 * ChangeLog:
36631 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
36632 * JavaScriptCore.xcodeproj/project.pbxproj:
36633 * VM/CTI.cpp:
36634 * masm/IA32MacroAsm.h:
36635 * masm/MacroAssembler.h: Added.
36636 (KJS::MacroAssembler::MacroAssembler):
36637 * masm/MacroAssemblerIA32GCC.cpp: Added.
36638 (KJS::MacroAssembler::emitConvertToFastCall):
36639 * masm/MacroAssemblerWin.cpp: Added.
36640 (KJS::MacroAssembler::emitConvertToFastCall):
36641 * wrec/WREC.cpp:
36642 (KJS::WRECompiler::parseGreedyQuantifier):
36643 (KJS::WRECompiler::parseCharacterClass):
36644 (KJS::WRECompiler::parseEscape):
36645 (KJS::WRECompiler::compilePattern):
36646 * wrec/WREC.h:
36647
36648 2008-09-04 Gavin Barraclough <barraclough@apple.com>
36649
36650 Reviewed by Sam Weinig.
36651
36652 Support for slow scripts (timeout checking).
36653
36654 * VM/CTI.cpp:
36655 (KJS::CTI::privateCompileMainPass):
36656 (KJS::CTI::privateCompile):
36657 * VM/Machine.cpp:
36658 (KJS::slideRegisterWindowForCall):
36659 (KJS::Machine::cti_timeout_check):
36660 (KJS::Machine::cti_vm_throw):
36661
36662 2008-09-04 Sam Weinig <sam@webkit.org>
36663
36664 Reviewed by Mark Rowe.
36665
36666 Third round of style cleanup.
36667
36668 * VM/CTI.cpp:
36669 * VM/CTI.h:
36670 * VM/CodeBlock.h:
36671 * VM/Machine.cpp:
36672 * VM/Machine.h:
36673 * kjs/ExecState.h:
36674
36675 2008-09-04 Sam Weinig <sam@webkit.org>
36676
36677 Reviewed by Jon Honeycutt.
36678
36679 Second round of style cleanup.
36680
36681 * VM/CTI.cpp:
36682 * VM/CTI.h:
36683 * wrec/WREC.h:
36684
36685 2008-09-04 Sam Weinig <sam@webkit.org>
36686
36687 Reviewed by Mark Rowe.
36688
36689 First round of style cleanup.
36690
36691 * VM/CTI.cpp:
36692 * VM/CTI.h:
36693 * masm/IA32MacroAsm.h:
36694 * wrec/WREC.cpp:
36695 * wrec/WREC.h:
36696
36697 2008-09-04 Geoffrey Garen <ggaren@apple.com>
36698
36699 Reviewed by Mark Rowe.
36700
36701 Merged http://trac.webkit.org/changeset/36081 to work with CTI.
36702
36703 * VM/Machine.cpp:
36704 (KJS::Machine::tryCtiCacheGetByID):
36705
36706 2008-09-04 Gavin Barraclough <barraclough@apple.com>
36707
36708 Reviewed by Sam Weinig.
36709
36710 Enable profiling in CTI.
36711
36712 * VM/CTI.h:
36713 (KJS::):
36714 (KJS::CTI::execute):
36715 * VM/Machine.cpp:
36716 (KJS::Machine::cti_op_call_JSFunction):
36717 (KJS::Machine::cti_op_call_NotJSFunction):
36718 (KJS::Machine::cti_op_ret):
36719 (KJS::Machine::cti_op_construct_JSConstruct):
36720 (KJS::Machine::cti_op_construct_NotJSConstruct):
36721
36722 2008-09-04 Victor Hernandez <vhernandez@apple.com>
36723
36724 Reviewed by Geoffrey Garen.
36725
36726 Fixed an #if to support using WREC without CTI.
36727
36728 * kjs/regexp.cpp:
36729 (KJS::RegExp::match):
36730
36731 2008-09-04 Gavin Barraclough <barraclough@apple.com>
36732
36733 Reviewed by Oliver Hunt.
36734
36735 The array/string length trampolines are owned by the Machine, not the codeblock that compiled them.
36736
36737 * VM/CTI.cpp:
36738 (KJS::CTI::privateArrayLengthTrampoline):
36739 (KJS::CTI::privateStringLengthTrampoline):
36740 * VM/Machine.cpp:
36741 (KJS::Machine::~Machine):
36742 * VM/Machine.h:
36743
36744 2008-09-04 Mark Rowe <mrowe@apple.com>
36745
36746 Reviewed by Gavin Barraclough and Sam Weinig.
36747
36748 Fix a crash on launch of jsc when GuardMalloc is enabled.
36749
36750 * kjs/ScopeChain.h:
36751 (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain.
36752 (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref.
36753
36754 2008-09-03 Oliver Hunt <oliver@apple.com>
36755
36756 Reviewed by Gavin Barraclough and Geoff Garen.
36757
36758 Fix inspector and fast array access so that it bounds
36759 checks correctly.
36760
36761 * VM/CTI.cpp:
36762 (KJS::CTI::privateCompile_pass2_Main):
36763 * masm/IA32MacroAsm.h:
36764 (KJS::IA32MacroAssembler::):
36765 (KJS::IA32MacroAssembler::emitUnlinkedJb):
36766 (KJS::IA32MacroAssembler::emitUnlinkedJbe):
36767
36768 2008-09-03 Mark Rowe <mrowe@apple.com>
36769
36770 Move the assertion after the InitializeAndReturn block, as
36771 that is used even when CTI is enabled.
36772
36773 * VM/Machine.cpp:
36774 (KJS::Machine::privateExecute):
36775
36776 2008-09-03 Mark Rowe <mrowe@apple.com>
36777
36778 Reviewed by Sam Weinig.
36779
36780 Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED.
36781
36782 * VM/CTI.cpp:
36783 (KJS::CTI::privateCompile_pass1_Scan):
36784 (KJS::CTI::privateCompile_pass2_Main):
36785 (KJS::CTI::privateCompile_pass4_SlowCases):
36786 * VM/Machine.cpp:
36787 (KJS::Machine::privateExecute):
36788 (KJS::Machine::cti_vm_throw):
36789
36790 2008-09-03 Mark Rowe <mrowe@apple.com>
36791
36792 Reviewed by Sam Weinig.
36793
36794 Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved
36795 by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86)
36796 #if's.
36797
36798 * VM/CTI.cpp:
36799 * VM/CTI.h:
36800 * VM/CodeBlock.cpp:
36801 (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for
36802 printing a ptrdiff_t.
36803 * VM/Machine.cpp:
36804 * VM/Machine.h:
36805 * kjs/regexp.cpp:
36806 (KJS::RegExp::RegExp):
36807 (KJS::RegExp::~RegExp):
36808 (KJS::RegExp::match):
36809 * kjs/regexp.h:
36810 * masm/IA32MacroAsm.h:
36811 * wrec/WREC.cpp:
36812 * wrec/WREC.h:
36813 * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to
36814 track whether any MASM-using features are enabled.
36815
36816 2008-09-03 Gavin Barraclough <barraclough@apple.com>
36817
36818 Reviewed by Oliver Hunt.
36819
36820 Copy Geoff's array/string length optimization for CTI.
36821
36822 * VM/CTI.cpp:
36823 (KJS::CTI::privateArrayLengthTrampoline):
36824 (KJS::CTI::privateStringLengthTrampoline):
36825 * VM/CTI.h:
36826 (KJS::CTI::compileArrayLengthTrampoline):
36827 (KJS::CTI::compileStringLengthTrampoline):
36828 * VM/Machine.cpp:
36829 (KJS::Machine::Machine):
36830 (KJS::Machine::getCtiArrayLengthTrampoline):
36831 (KJS::Machine::getCtiStringLengthTrampoline):
36832 (KJS::Machine::tryCtiCacheGetByID):
36833 (KJS::Machine::cti_op_get_by_id_second):
36834 * VM/Machine.h:
36835 * kjs/JSString.h:
36836 * kjs/ustring.h:
36837
36838 2008-09-03 Gavin Barraclough <barraclough@apple.com>
36839
36840 Reviewed by Oliver Hunt.
36841
36842 Implement fast array accesses in CTI - 2-3% progression on sunspider.
36843
36844 * VM/CTI.cpp:
36845 (KJS::CTI::emitFastArithIntToImmNoCheck):
36846 (KJS::CTI::compileOpCall):
36847 (KJS::CTI::privateCompile_pass2_Main):
36848 (KJS::CTI::privateCompile_pass4_SlowCases):
36849 * VM/CTI.h:
36850 * kjs/JSArray.h:
36851
36852 2008-09-02 Gavin Barraclough <barraclough@apple.com>
36853
36854 Reviewed by Oliver Hunt.
36855
36856 Enable fast property access support in CTI.
36857
36858 * VM/CTI.cpp:
36859 (KJS::ctiSetReturnAddress):
36860 (KJS::ctiRepatchCallByReturnAddress):
36861 (KJS::CTI::privateCompile_pass2_Main):
36862 (KJS::CTI::privateCompile):
36863 (KJS::CTI::privateCompileGetByIdSelf):
36864 (KJS::CTI::privateCompileGetByIdProto):
36865 (KJS::CTI::privateCompileGetByIdChain):
36866 (KJS::CTI::privateCompilePutByIdReplace):
36867 * VM/CTI.h:
36868 (KJS::CTI::compileGetByIdSelf):
36869 (KJS::CTI::compileGetByIdProto):
36870 (KJS::CTI::compileGetByIdChain):
36871 (KJS::CTI::compilePutByIdReplace):
36872 * VM/CodeBlock.cpp:
36873 (KJS::CodeBlock::~CodeBlock):
36874 * VM/CodeBlock.h:
36875 * VM/Machine.cpp:
36876 (KJS::doSetReturnAddressVmThrowTrampoline):
36877 (KJS::Machine::tryCtiCachePutByID):
36878 (KJS::Machine::tryCtiCacheGetByID):
36879 (KJS::Machine::cti_op_put_by_id):
36880 (KJS::Machine::cti_op_put_by_id_second):
36881 (KJS::Machine::cti_op_put_by_id_generic):
36882 (KJS::Machine::cti_op_put_by_id_fail):
36883 (KJS::Machine::cti_op_get_by_id):
36884 (KJS::Machine::cti_op_get_by_id_second):
36885 (KJS::Machine::cti_op_get_by_id_generic):
36886 (KJS::Machine::cti_op_get_by_id_fail):
36887 (KJS::Machine::cti_op_throw):
36888 (KJS::Machine::cti_vm_throw):
36889 * VM/Machine.h:
36890 * kjs/JSCell.h:
36891 * kjs/JSObject.h:
36892 * kjs/PropertyMap.h:
36893 * kjs/StructureID.cpp:
36894 (KJS::StructureIDChain::StructureIDChain):
36895 * masm/IA32MacroAsm.h:
36896 (KJS::IA32MacroAssembler::emitCmpl_i32m):
36897 (KJS::IA32MacroAssembler::emitMovl_mr):
36898 (KJS::IA32MacroAssembler::emitMovl_rm):
36899
36900 2008-09-02 Sam Weinig <sam@webkit.org>
36901
36902 Reviewed by Gavin Barraclough and Mark Rowe.
36903
36904 A backslash (\) at the of a RegEx should produce an error.
36905 Fixes fast/regex/test1.html.
36906
36907 * wrec/WREC.cpp:
36908 (KJS::WRECompiler::parseEscape):
36909
36910 2008-09-02 Sam Weinig <sam@webkit.org>
36911
36912 Reviewed by Geoff Garen.
36913
36914 Link jumps for the slow case of op_loop_if_less. Fixes acid3.
36915
36916 * VM/CTI.cpp:
36917 (KJS::CTI::privateCompile_pass4_SlowCases):
36918
36919 2008-09-01 Sam Weinig <sam@webkit.org>
36920
36921 Rubber-stamped by Maciej Stachowiak.
36922
36923 Switch WREC on by default.
36924
36925 * wtf/Platform.h:
36926
36927 2008-09-01 Sam Weinig <sam@webkit.org>
36928
36929 Reviewed by Mark Rowe.
36930
36931 Fix two failures in fast/regex/test1.html
36932 - \- in a character class should be treated as a literal -
36933 - A missing max quantifier needs to be treated differently than
36934 a null max quantifier.
36935
36936 * wrec/WREC.cpp:
36937 (KJS::WRECompiler::generateNonGreedyQuantifier):
36938 (KJS::WRECompiler::generateGreedyQuantifier):
36939 (KJS::WRECompiler::parseCharacterClass):
36940 * wrec/WREC.h:
36941 (KJS::Quantifier::Quantifier):
36942
36943 2008-09-01 Sam Weinig <sam@webkit.org>
36944
36945 Reviewed by Mark Rowe.
36946
36947 Fix crash in fast/js/kde/evil-n.html
36948
36949 * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function.
36950
36951 2008-09-01 Sam Weinig <sam@webkit.org>
36952
36953 Reviewed by Gavin Barraclough and Mark Rowe.
36954
36955 Add pattern length limit fixing one test in fast/js.
36956
36957 * wrec/WREC.cpp:
36958 (KJS::WRECompiler::compile):
36959 * wrec/WREC.h:
36960 (KJS::WRECompiler::):
36961
36962 2008-09-01 Sam Weinig <sam@webkit.org>
36963
36964 Reviewed by Gavin Barraclough and Mark Rowe.
36965
36966 Make octal escape parsing/back-reference parsing more closely match
36967 prior behavior fixing one test in fast/js.
36968
36969 * wrec/WREC.cpp:
36970 (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped
36971 (KJS::WRECompiler::parseEscape):
36972 * wrec/WREC.h:
36973 (KJS::WRECompiler::peekDigit):
36974
36975 2008-09-01 Sam Weinig <sam@webkit.org>
36976
36977 Reviewed by Gavin Barraclough and Mark Rowe.
36978
36979 Fix one mozilla test.
36980
36981 * wrec/WREC.cpp:
36982 (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not
36983 ascii upper check.
36984
36985 2008-09-01 Sam Weinig <sam@webkit.org>
36986
36987 Reviewed by Gavin Barraclough and Mark Rowe.
36988
36989 Parse octal escapes in character classes fixing one mozilla test.
36990
36991 * wrec/WREC.cpp:
36992 (KJS::WRECompiler::parseCharacterClass):
36993 (KJS::WRECompiler::parseOctalEscape):
36994 * wrec/WREC.h:
36995 (KJS::WRECompiler::consumeOctal):
36996
36997 2008-09-01 Sam Weinig <sam@webkit.org>
36998
36999 Reviewed by Oliver Hunt.
37000
37001 Fixes two mozilla tests with WREC enabled.
37002
37003 * wrec/WREC.cpp:
37004 (KJS::CharacterClassConstructor::append): Keep the character class sorted
37005 when appending another character class.
37006
37007 2008-09-01 Sam Weinig <sam@webkit.org>
37008
37009 Reviewed by Gavin Barraclough and Mark Rowe.
37010
37011 Fixes two mozilla tests with WREC enabled.
37012
37013 * wrec/WREC.cpp:
37014 (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position
37015 instead of appending it to the end.
37016
37017 2008-09-01 Gavin Barraclough <barraclough@apple.com>
37018
37019 Reviewed by Oliver Hunt.
37020
37021 Move cross-compilation unit call into NEVER_INLINE function.
37022
37023 * VM/Machine.cpp:
37024 (KJS::doSetReturnAddressVmThrowTrampoline):
37025
37026 2008-09-01 Sam Weinig <sam@webkit.org>
37027
37028 Reviewed by Gavin Barraclough and Geoff Garen.
37029
37030 Fix one test in fast/js.
37031
37032 * VM/Machine.cpp:
37033 (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError,
37034 instead of a createNotAFunctionError.
37035
37036 2008-08-31 Gavin Barraclough <barraclough@apple.com>
37037
37038 Reviewed by Maciej Stachowiak.
37039
37040 Zero-cost exception handling. This patch takes the exception checking
37041 back of the hot path. When an exception occurs in a Machine::cti*
37042 method, the return address to JIT code is recorded, and is then
37043 overwritten with a pointer to a trampoline routine. When the method
37044 returns the trampoline will cause the cti_vm_throw method to be invoked.
37045
37046 cti_vm_throw uses the return address preserved above, to discover the
37047 vPC of the bytecode that raised the exception (using a map build during
37048 translation). From the VPC of the faulting bytecode the vPC of a catch
37049 routine may be discovered (unwinding the stack where necesary), and then
37050 a bytecode address for the catch routine is looked up. Final cti_vm_throw
37051 overwrites its return address to JIT code again, to trampoline directly
37052 to the catch routine.
37053
37054 cti_op_throw is handled in a similar fashion.
37055
37056 * VM/CTI.cpp:
37057 (KJS::CTI::emitPutCTIParam):
37058 (KJS::CTI::emitPutToCallFrameHeader):
37059 (KJS::CTI::emitGetFromCallFrameHeader):
37060 (KJS::ctiSetReturnAddressForArgs):
37061 (KJS::CTI::emitDebugExceptionCheck):
37062 (KJS::CTI::printOpcodeOperandTypes):
37063 (KJS::CTI::emitCall):
37064 (KJS::CTI::compileOpCall):
37065 (KJS::CTI::privateCompile_pass2_Main):
37066 (KJS::CTI::privateCompile):
37067 * VM/CTI.h:
37068 (KJS::CallRecord::CallRecord):
37069 (KJS::):
37070 (KJS::CTI::execute):
37071 * VM/CodeBlock.h:
37072 * VM/Machine.cpp:
37073 (KJS::Machine::privateExecute):
37074 (KJS::Machine::cti_op_instanceof):
37075 (KJS::Machine::cti_op_call_NotJSFunction):
37076 (KJS::Machine::cti_op_resolve):
37077 (KJS::Machine::cti_op_resolve_func):
37078 (KJS::Machine::cti_op_resolve_skip):
37079 (KJS::Machine::cti_op_resolve_with_base):
37080 (KJS::Machine::cti_op_throw):
37081 (KJS::Machine::cti_op_in):
37082 (KJS::Machine::cti_vm_throw):
37083 * VM/RegisterFile.h:
37084 (KJS::RegisterFile::):
37085 * kjs/ExecState.h:
37086 (KJS::ExecState::setCtiReturnAddress):
37087 (KJS::ExecState::ctiReturnAddress):
37088 * masm/IA32MacroAsm.h:
37089 (KJS::IA32MacroAssembler::):
37090 (KJS::IA32MacroAssembler::emitPushl_m):
37091 (KJS::IA32MacroAssembler::emitPopl_m):
37092 (KJS::IA32MacroAssembler::getRelocatedAddress):
37093
37094 2008-08-31 Mark Rowe <mrowe@apple.com>
37095
37096 Reviewed by Oliver Hunt.
37097
37098 Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them.
37099
37100 * wrec/WREC.cpp:
37101 (KJS::WRECompiler::parseParentheses):
37102 * wrec/WREC.h:
37103 (KJS::WRECompiler::):
37104
37105 2008-08-31 Mark Rowe <mrowe@apple.com>
37106
37107 Reviewed by Oliver Hunt.
37108
37109 Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled.
37110
37111 * wrec/WREC.cpp:
37112 (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum.
37113 (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register.
37114 (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag.
37115
37116 2008-08-30 Mark Rowe <mrowe@apple.com>
37117
37118 Reviewed by Oliver Hunt.
37119
37120 Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance.
37121 This shows up as a 0.6% progression on SunSpider on my machine.
37122
37123 Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out.
37124
37125 * VM/CodeBlock.h:
37126 (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc.
37127 * kjs/regexp.cpp: Ditto.
37128 * masm/IA32MacroAsm.h:
37129 (KJS::JITCodeBuffer::growBuffer):
37130 (KJS::JITCodeBuffer::JITCodeBuffer):
37131 (KJS::JITCodeBuffer::~JITCodeBuffer):
37132 (KJS::JITCodeBuffer::putByte):
37133 (KJS::JITCodeBuffer::putShort):
37134 (KJS::JITCodeBuffer::putInt):
37135 (KJS::JITCodeBuffer::reset):
37136 (KJS::JITCodeBuffer::copy):
37137
37138 2008-08-29 Oliver Hunt <oliver@apple.com>
37139
37140 RS=Maciej
37141
37142 Roll out previous patch as it causes a 5% performance regression
37143
37144 * JavaScriptCore.xcodeproj/project.pbxproj:
37145 * VM/CTI.cpp:
37146 (KJS::getJCB):
37147 (KJS::CTI::privateCompile):
37148 * VM/CodeBlock.h:
37149 (KJS::CodeBlock::~CodeBlock):
37150 * masm/IA32MacroAsm.h:
37151 (KJS::JITCodeBuffer::JITCodeBuffer):
37152 (KJS::JITCodeBuffer::putByte):
37153 (KJS::JITCodeBuffer::putShort):
37154 (KJS::JITCodeBuffer::putInt):
37155 (KJS::JITCodeBuffer::getEIP):
37156 (KJS::JITCodeBuffer::start):
37157 (KJS::JITCodeBuffer::getOffset):
37158 (KJS::JITCodeBuffer::reset):
37159 (KJS::JITCodeBuffer::copy):
37160 (KJS::IA32MacroAssembler::emitModRm_rr):
37161 (KJS::IA32MacroAssembler::emitModRm_rm):
37162 (KJS::IA32MacroAssembler::emitModRm_rmsib):
37163 (KJS::IA32MacroAssembler::IA32MacroAssembler):
37164 (KJS::IA32MacroAssembler::emitInt3):
37165 (KJS::IA32MacroAssembler::emitPushl_r):
37166 (KJS::IA32MacroAssembler::emitPopl_r):
37167 (KJS::IA32MacroAssembler::emitMovl_rr):
37168 (KJS::IA32MacroAssembler::emitAddl_rr):
37169 (KJS::IA32MacroAssembler::emitAddl_i8r):
37170 (KJS::IA32MacroAssembler::emitAddl_i32r):
37171 (KJS::IA32MacroAssembler::emitAddl_mr):
37172 (KJS::IA32MacroAssembler::emitAndl_rr):
37173 (KJS::IA32MacroAssembler::emitAndl_i32r):
37174 (KJS::IA32MacroAssembler::emitCmpl_i8r):
37175 (KJS::IA32MacroAssembler::emitCmpl_rr):
37176 (KJS::IA32MacroAssembler::emitCmpl_rm):
37177 (KJS::IA32MacroAssembler::emitCmpl_i32r):
37178 (KJS::IA32MacroAssembler::emitCmpl_i32m):
37179 (KJS::IA32MacroAssembler::emitCmpw_rm):
37180 (KJS::IA32MacroAssembler::emitOrl_rr):
37181 (KJS::IA32MacroAssembler::emitOrl_i8r):
37182 (KJS::IA32MacroAssembler::emitSubl_rr):
37183 (KJS::IA32MacroAssembler::emitSubl_i8r):
37184 (KJS::IA32MacroAssembler::emitSubl_i32r):
37185 (KJS::IA32MacroAssembler::emitSubl_mr):
37186 (KJS::IA32MacroAssembler::emitTestl_i32r):
37187 (KJS::IA32MacroAssembler::emitTestl_rr):
37188 (KJS::IA32MacroAssembler::emitXorl_i8r):
37189 (KJS::IA32MacroAssembler::emitXorl_rr):
37190 (KJS::IA32MacroAssembler::emitSarl_i8r):
37191 (KJS::IA32MacroAssembler::emitSarl_CLr):
37192 (KJS::IA32MacroAssembler::emitShl_i8r):
37193 (KJS::IA32MacroAssembler::emitShll_CLr):
37194 (KJS::IA32MacroAssembler::emitMull_rr):
37195 (KJS::IA32MacroAssembler::emitIdivl_r):
37196 (KJS::IA32MacroAssembler::emitCdq):
37197 (KJS::IA32MacroAssembler::emitMovl_mr):
37198 (KJS::IA32MacroAssembler::emitMovzwl_mr):
37199 (KJS::IA32MacroAssembler::emitMovl_rm):
37200 (KJS::IA32MacroAssembler::emitMovl_i32r):
37201 (KJS::IA32MacroAssembler::emitMovl_i32m):
37202 (KJS::IA32MacroAssembler::emitLeal_mr):
37203 (KJS::IA32MacroAssembler::emitRet):
37204 (KJS::IA32MacroAssembler::emitJmpN_r):
37205 (KJS::IA32MacroAssembler::emitJmpN_m):
37206 (KJS::IA32MacroAssembler::emitCall):
37207 (KJS::IA32MacroAssembler::label):
37208 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
37209 (KJS::IA32MacroAssembler::emitUnlinkedJne):
37210 (KJS::IA32MacroAssembler::emitUnlinkedJe):
37211 (KJS::IA32MacroAssembler::emitUnlinkedJl):
37212 (KJS::IA32MacroAssembler::emitUnlinkedJle):
37213 (KJS::IA32MacroAssembler::emitUnlinkedJge):
37214 (KJS::IA32MacroAssembler::emitUnlinkedJae):
37215 (KJS::IA32MacroAssembler::emitUnlinkedJo):
37216 (KJS::IA32MacroAssembler::link):
37217 * wrec/WREC.cpp:
37218 (KJS::WRECompiler::compilePattern):
37219 (KJS::WRECompiler::compile):
37220 * wrec/WREC.h:
37221
37222 2008-08-29 Mark Rowe <mrowe@apple.com>
37223
37224 Reviewed by Oliver Hunt.
37225
37226 Have JITCodeBuffer manage a Vector containing the generated code so that it can grow
37227 as needed when generating code for a large function. This fixes all six remaining failures
37228 in Mozilla tests in both debug and release builds.
37229
37230 * VM/CTI.cpp:
37231 (KJS::CTI::privateCompile):
37232 * VM/CodeBlock.h:
37233 (KJS::CodeBlock::~CodeBlock):
37234 * masm/IA32MacroAsm.h:
37235 (KJS::JITCodeBuffer::putByte):
37236 (KJS::JITCodeBuffer::putShort):
37237 (KJS::JITCodeBuffer::putInt):
37238 (KJS::JITCodeBuffer::getEIP):
37239 (KJS::JITCodeBuffer::start):
37240 (KJS::JITCodeBuffer::getOffset):
37241 (KJS::JITCodeBuffer::getCode):
37242 (KJS::IA32MacroAssembler::emitModRm_rr):
37243 * wrec/WREC.cpp:
37244 (KJS::WRECompiler::compilePattern):
37245 * wrec/WREC.h:
37246
37247 2008-08-29 Mark Rowe <mrowe@apple.com>
37248
37249 Reviewed by Oliver Hunt.
37250
37251 Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests.
37252
37253 * wrec/WREC.cpp:
37254 (KJS::WRECompiler::parseOctalEscape):
37255 (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero.
37256 Add a FIXME about treating invalid backreferences as octal escapes in the future.
37257 * wrec/WREC.h:
37258 (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than
37259 one digit.
37260 * wtf/ASCIICType.h:
37261 (WTF::isASCIIOctalDigit):
37262
37263 2008-08-29 Sam Weinig <sam@webkit.org>
37264
37265 Reviewed by Mark Rowe.
37266
37267 Pass vPC to instanceof method. Fixes 2 mozilla tests in debug.
37268
37269 * VM/CTI.cpp:
37270 (KJS::CTI::privateCompile_pass2_Main):
37271 * VM/Machine.cpp:
37272 (KJS::Machine::cti_op_instanceof):
37273
37274 2008-08-29 Sam Weinig <sam@webkit.org>
37275
37276 Reviewed by Mark Rowe.
37277
37278 Pass vPCs to resolve methods for correct exception creation. Fixes
37279 17 mozilla tests in debug.
37280
37281 * VM/CTI.cpp:
37282 (KJS::CTI::privateCompile_pass2_Main):
37283 * VM/CTI.h:
37284 * VM/Machine.cpp:
37285 (KJS::Machine::cti_op_resolve):
37286 (KJS::Machine::cti_op_resolve_func):
37287 (KJS::Machine::cti_op_resolve_skip):
37288 (KJS::Machine::cti_op_resolve_with_base):
37289
37290 2008-08-29 Gavin Barraclough <barraclough@apple.com>
37291
37292 Reviewed by Oliver Hunt.
37293
37294 Remembering to actually throw the exception passed to op throw helps.
37295 Regressions 19 -> 6.
37296
37297 * VM/Machine.cpp:
37298 (KJS::Machine::cti_op_throw):
37299 (KJS::Machine::cti_vm_throw):
37300
37301 2008-08-29 Gavin Barraclough <barraclough@apple.com>
37302
37303 Reviewed by Sam Weinig.
37304
37305 Support for exception unwinding the stack.
37306
37307 Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address
37308 is now preserved on entry to a JIT code function (if we preserve lazily we need
37309 restore the native return address during exception stack unwind). This takes
37310 the number of regressions down from ~150 to 19.
37311
37312 * VM/CTI.cpp:
37313 (KJS::getJCB):
37314 (KJS::CTI::emitExceptionCheck):
37315 (KJS::CTI::compileOpCall):
37316 (KJS::CTI::privateCompile_pass2_Main):
37317 (KJS::CTI::privateCompile):
37318 * VM/CTI.h:
37319 (KJS::):
37320 * VM/Machine.cpp:
37321 (KJS::Machine::throwException):
37322 (KJS::Machine::cti_op_call_JSFunction):
37323 (KJS::Machine::cti_op_call_NotJSFunction):
37324 (KJS::Machine::cti_op_construct_JSConstruct):
37325 (KJS::Machine::cti_op_construct_NotJSConstruct):
37326 (KJS::Machine::cti_op_throw):
37327 (KJS::Machine::cti_vm_throw):
37328
37329 2008-08-29 Mark Rowe <mrowe@apple.com>
37330
37331 Reviewed by Oliver Hunt.
37332
37333 Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled.
37334
37335 * wrec/WREC.cpp:
37336 (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches
37337 succeeded, jump to failure.
37338 (KJS::WRECompiler::compilePattern): Restore and increment the current position stored
37339 on the stack to ensure that it will be reset to the correct position after a failed
37340 match has consumed input.
37341
37342 2008-08-29 Mark Rowe <mrowe@apple.com>
37343
37344 Reviewed by Oliver Hunt.
37345
37346 Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled.
37347 A backreference with a quantifier would get stuck in an infinite
37348 loop if the captured range was empty.
37349
37350 * wrec/WREC.cpp:
37351 (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range
37352 was empty, do not attempt to match the backreference.
37353 (KJS::WRECompiler::parseBackreferenceQuantifier):
37354 * wrec/WREC.h:
37355 (KJS::Quantifier::):
37356
37357 2008-08-28 Sam Weinig <sam@webkit.org>
37358
37359 Reviewed by Oliver Hunt.
37360
37361 Implement op_debug.
37362
37363 * VM/CTI.cpp:
37364 (KJS::CTI::privateCompile_pass1_Scan):
37365 (KJS::CTI::privateCompile_pass2_Main):
37366 * VM/Machine.cpp:
37367 (KJS::Machine::debug):
37368 (KJS::Machine::privateExecute):
37369 (KJS::Machine::cti_op_debug):
37370 * VM/Machine.h:
37371
37372 2008-08-28 Sam Weinig <sam@webkit.org>
37373
37374 Reviewed by Gavin Barraclough and Geoff Garen.
37375
37376 Implement op_switch_string fixing 1 mozilla test and one test in fast/js.
37377
37378 * VM/CTI.cpp:
37379 (KJS::CTI::privateCompile_pass1_Scan):
37380 (KJS::CTI::privateCompile_pass2_Main):
37381 (KJS::CTI::privateCompile):
37382 * VM/CTI.h:
37383 (KJS::SwitchRecord::):
37384 (KJS::SwitchRecord::SwitchRecord):
37385 * VM/CodeBlock.cpp:
37386 (KJS::CodeBlock::dump):
37387 * VM/CodeBlock.h:
37388 (KJS::ExpressionRangeInfo::):
37389 (KJS::StringJumpTable::offsetForValue):
37390 (KJS::StringJumpTable::ctiForValue):
37391 (KJS::SimpleJumpTable::add):
37392 (KJS::SimpleJumpTable::ctiForValue):
37393 * VM/CodeGenerator.cpp:
37394 (KJS::prepareJumpTableForStringSwitch):
37395 * VM/Machine.cpp:
37396 (KJS::Machine::privateExecute):
37397 (KJS::Machine::cti_op_switch_string):
37398 * VM/Machine.h:
37399
37400 2008-08-28 Gavin Barraclough <barraclough@apple.com>
37401
37402 Reviewed by Oliver Hunt.
37403
37404 Do not recurse on the machine stack when executing op_call.
37405
37406 * VM/CTI.cpp:
37407 (KJS::CTI::emitGetPutArg):
37408 (KJS::CTI::emitPutArg):
37409 (KJS::CTI::emitPutArgConstant):
37410 (KJS::CTI::compileOpCall):
37411 (KJS::CTI::privateCompile_pass2_Main):
37412 (KJS::CTI::privateCompile):
37413 * VM/CTI.h:
37414 (KJS::):
37415 (KJS::CTI::compile):
37416 (KJS::CTI::execute):
37417 (KJS::CTI::):
37418 * VM/Machine.cpp:
37419 (KJS::Machine::Machine):
37420 (KJS::Machine::execute):
37421 (KJS::Machine::cti_op_call_JSFunction):
37422 (KJS::Machine::cti_op_call_NotJSFunction):
37423 (KJS::Machine::cti_op_ret):
37424 (KJS::Machine::cti_op_construct_JSConstruct):
37425 (KJS::Machine::cti_op_construct_NotJSConstruct):
37426 (KJS::Machine::cti_op_call_eval):
37427 * VM/Machine.h:
37428 * VM/Register.h:
37429 (KJS::Register::Register):
37430 * VM/RegisterFile.h:
37431 (KJS::RegisterFile::):
37432 * kjs/InternalFunction.h:
37433 (KJS::InternalFunction::InternalFunction):
37434 * kjs/JSFunction.h:
37435 (KJS::JSFunction::JSFunction):
37436 * kjs/ScopeChain.h:
37437 (KJS::ScopeChain::ScopeChain):
37438 * masm/IA32MacroAsm.h:
37439 (KJS::IA32MacroAssembler::):
37440 (KJS::IA32MacroAssembler::emitModRm_opm):
37441 (KJS::IA32MacroAssembler::emitCmpl_i32m):
37442 (KJS::IA32MacroAssembler::emitCallN_r):
37443
37444 2008-08-28 Sam Weinig <sam@webkit.org>
37445
37446 Reviewed by Mark Rowe.
37447
37448 Exit instead of crashing in ctiUnsupported and ctiTimedOut.
37449
37450 * VM/Machine.cpp:
37451 (KJS::ctiUnsupported):
37452 (KJS::ctiTimedOut):
37453
37454 2008-08-28 Oliver Hunt <oliver@apple.com>
37455
37456 Reviewed by Maciej Stachowiak.
37457
37458 Implement codegen for op_jsr and op_sret.
37459
37460 * VM/CTI.cpp:
37461 (KJS::CTI::privateCompile_pass1_Scan):
37462 (KJS::CTI::privateCompile_pass2_Main):
37463 (KJS::CTI::privateCompile):
37464 * VM/CTI.h:
37465 (KJS::CTI::JSRInfo::JSRInfo):
37466 * masm/IA32MacroAsm.h:
37467 (KJS::IA32MacroAssembler::emitJmpN_m):
37468 (KJS::IA32MacroAssembler::linkAbsoluteAddress):
37469
37470 2008-08-28 Gavin Barraclough <barraclough@apple.com>
37471
37472 Reviewed by Oliver Hunt.
37473
37474 Initial support for exceptions (throw / catch must occur in same CodeBlock).
37475
37476 * VM/CTI.cpp:
37477 (KJS::CTI::emitExceptionCheck):
37478 (KJS::CTI::emitCall):
37479 (KJS::CTI::privateCompile_pass2_Main):
37480 (KJS::CTI::privateCompile_pass4_SlowCases):
37481 (KJS::CTI::privateCompile):
37482 * VM/CTI.h:
37483 * VM/CodeBlock.cpp:
37484 (KJS::CodeBlock::nativeExceptionCodeForHandlerVPC):
37485 * VM/CodeBlock.h:
37486 * VM/CodeGenerator.cpp:
37487 (KJS::CodeGenerator::emitCatch):
37488 * VM/Machine.cpp:
37489 (KJS::Machine::throwException):
37490 (KJS::Machine::privateExecute):
37491 (KJS::ctiUnsupported):
37492 (KJS::ctiTimedOut):
37493 (KJS::Machine::cti_op_add):
37494 (KJS::Machine::cti_op_pre_inc):
37495 (KJS::Machine::cti_timeout_check):
37496 (KJS::Machine::cti_op_loop_if_less):
37497 (KJS::Machine::cti_op_put_by_id):
37498 (KJS::Machine::cti_op_get_by_id):
37499 (KJS::Machine::cti_op_instanceof):
37500 (KJS::Machine::cti_op_del_by_id):
37501 (KJS::Machine::cti_op_mul):
37502 (KJS::Machine::cti_op_call):
37503 (KJS::Machine::cti_op_resolve):
37504 (KJS::Machine::cti_op_construct):
37505 (KJS::Machine::cti_op_get_by_val):
37506 (KJS::Machine::cti_op_resolve_func):
37507 (KJS::Machine::cti_op_sub):
37508 (KJS::Machine::cti_op_put_by_val):
37509 (KJS::Machine::cti_op_lesseq):
37510 (KJS::Machine::cti_op_loop_if_true):
37511 (KJS::Machine::cti_op_negate):
37512 (KJS::Machine::cti_op_resolve_skip):
37513 (KJS::Machine::cti_op_div):
37514 (KJS::Machine::cti_op_pre_dec):
37515 (KJS::Machine::cti_op_jless):
37516 (KJS::Machine::cti_op_not):
37517 (KJS::Machine::cti_op_jtrue):
37518 (KJS::Machine::cti_op_post_inc):
37519 (KJS::Machine::cti_op_eq):
37520 (KJS::Machine::cti_op_lshift):
37521 (KJS::Machine::cti_op_bitand):
37522 (KJS::Machine::cti_op_rshift):
37523 (KJS::Machine::cti_op_bitnot):
37524 (KJS::Machine::cti_op_resolve_with_base):
37525 (KJS::Machine::cti_op_mod):
37526 (KJS::Machine::cti_op_less):
37527 (KJS::Machine::cti_op_neq):
37528 (KJS::Machine::cti_op_post_dec):
37529 (KJS::Machine::cti_op_urshift):
37530 (KJS::Machine::cti_op_bitxor):
37531 (KJS::Machine::cti_op_bitor):
37532 (KJS::Machine::cti_op_call_eval):
37533 (KJS::Machine::cti_op_throw):
37534 (KJS::Machine::cti_op_push_scope):
37535 (KJS::Machine::cti_op_stricteq):
37536 (KJS::Machine::cti_op_nstricteq):
37537 (KJS::Machine::cti_op_to_jsnumber):
37538 (KJS::Machine::cti_op_in):
37539 (KJS::Machine::cti_op_del_by_val):
37540 (KJS::Machine::cti_vm_throw):
37541 * VM/Machine.h:
37542 * kjs/ExecState.h:
37543 * masm/IA32MacroAsm.h:
37544 (KJS::IA32MacroAssembler::emitCmpl_i32m):
37545
37546 2008-08-28 Mark Rowe <mrowe@apple.com>
37547
37548 Rubber-stamped by Oliver Hunt.
37549
37550 Print debugging info to stderr so that run-webkit-tests can capture it.
37551 This makes it easy to check whether test failures are due to unimplemented
37552 op codes, missing support for exceptions, etc.
37553
37554 * VM/CTI.cpp:
37555 (KJS::CTI::privateCompile_pass1_Scan):
37556 (KJS::CTI::printOpcodeOperandTypes):
37557 (KJS::CTI::privateCompile_pass2_Main):
37558 (KJS::CTI::privateCompile_pass4_SlowCases):
37559 (KJS::CTI::privateCompile):
37560 * VM/Machine.cpp:
37561 (KJS::Machine::privateExecute):
37562 (KJS::ctiException):
37563 (KJS::ctiUnsupported):
37564 (KJS::Machine::cti_op_call):
37565 (KJS::Machine::cti_op_resolve):
37566 (KJS::Machine::cti_op_construct):
37567 (KJS::Machine::cti_op_get_by_val):
37568 (KJS::Machine::cti_op_resolve_func):
37569 (KJS::Machine::cti_op_resolve_skip):
37570 (KJS::Machine::cti_op_resolve_with_base):
37571 (KJS::Machine::cti_op_call_eval):
37572
37573 2008-08-27 Mark Rowe <mrowe@apple.com>
37574
37575 Reviewed by Gavin Barraclough and Maciej Stachowiak.
37576
37577 Fix fast/js/bitwise-and-on-undefined.html.
37578
37579 A temporary value in the slow path of op_bitand was being stored in edx, but was
37580 being clobbered by emitGetPutArg before we used it. To fix this, emitGetPutArg
37581 now takes a third argument that specifies the scratch register to use when loading
37582 from memory. This allows us to avoid clobbering the temporary in op_bitand.
37583
37584 * VM/CTI.cpp:
37585 (KJS::CTI::emitGetPutArg):
37586 (KJS::CTI::privateCompile_pass2_Main):
37587 (KJS::CTI::privateCompile_pass4_SlowCases):
37588 * VM/CTI.h:
37589
37590 2008-08-27 Mark Rowe <mrowe@apple.com>
37591
37592 Rubber-stamped by Oliver Hunt.
37593
37594 Switch CTI on by default.
37595
37596 * wtf/Platform.h:
37597
37598 2008-08-27 Mark Rowe <mrowe@apple.com>
37599
37600 Reviewed by Oliver Hunt.
37601
37602 Fix the build of the full WebKit stack.
37603
37604 * JavaScriptCore.xcodeproj/project.pbxproj: Mark two new headers as private so they can be pulled in from WebCore.
37605 * VM/CTI.h: Fix build issues that show up when compiled with GCC 4.2 as part of WebCore.
37606 * wrec/WREC.h: Ditto.
37607
37608 2008-08-27 Mark Rowe <mrowe@apple.com>
37609
37610 Reviewed by Sam Weinig.
37611
37612 Implement op_new_error. Does not fix any tests as it is always followed by the unimplemented op_throw.
37613
37614 * VM/CTI.cpp:
37615 (KJS::CTI::privateCompile_pass1_Scan):
37616 (KJS::CTI::privateCompile_pass2_Main):
37617 * VM/Machine.cpp:
37618 (KJS::Machine::cti_op_new_error):
37619 * VM/Machine.h:
37620
37621 2008-08-27 Sam Weinig <sam@webkit.org>
37622
37623 Reviewed by Gavin Barraclough and Geoff Garen.
37624
37625 Implement op_put_getter and op_put_setter.
37626
37627 * VM/CTI.cpp:
37628 (KJS::CTI::privateCompile_pass1_Scan):
37629 (KJS::CTI::privateCompile_pass2_Main):
37630 * VM/Machine.cpp:
37631 (KJS::Machine::cti_op_put_getter):
37632 (KJS::Machine::cti_op_put_setter):
37633 * VM/Machine.h:
37634
37635 2008-08-27 Sam Weinig <sam@webkit.org>
37636
37637 Reviewed by Gavin Barraclough and Geoff Garen.
37638
37639 Implement op_del_by_val fixing 3 mozilla tests.
37640
37641 * VM/CTI.cpp:
37642 (KJS::CTI::privateCompile_pass1_Scan):
37643 (KJS::CTI::privateCompile_pass2_Main):
37644 * VM/Machine.cpp:
37645 (KJS::Machine::cti_op_del_by_val):
37646 * VM/Machine.h:
37647
37648 2008-08-27 Gavin Barraclough <barraclough@apple.com>
37649
37650 Reviewed by Oliver Hunt.
37651
37652 Quick & dirty fix to get SamplingTool sampling op_call.
37653
37654 * VM/SamplingTool.h:
37655 (KJS::SamplingTool::callingHostFunction):
37656
37657 2008-08-27 Sam Weinig <sam@webkit.org>
37658
37659 Reviewed by Gavin Barraclough and Geoff Garen.
37660
37661 Fix op_put_by_index.
37662
37663 * VM/CTI.cpp:
37664 (KJS::CTI::privateCompile_pass2_Main): Use emitPutArgConstant instead of emitGetPutArg
37665 for the property value.
37666 * VM/Machine.cpp:
37667 (KJS::Machine::cti_op_put_by_index): Get the property value from the correct argument.
37668
37669 2008-08-27 Sam Weinig <sam@webkit.org>
37670
37671 Reviewed by Gavin Barraclough and Geoff Garen.
37672
37673 Implement op_switch_imm in the CTI fixing 13 mozilla tests.
37674
37675 * VM/CTI.cpp:
37676 (KJS::CTI::privateCompile_pass1_Scan):
37677 (KJS::CTI::privateCompile_pass2_Main):
37678 * VM/Machine.cpp:
37679 (KJS::Machine::cti_op_switch_imm):
37680 * VM/Machine.h:
37681
37682 2008-08-27 Gavin Barraclough <barraclough@apple.com>
37683
37684 Reviewed by Oliver Hunt.
37685
37686 Implement op_switch_char in CTI.
37687
37688 * VM/CTI.cpp:
37689 (KJS::CTI::emitCall):
37690 (KJS::CTI::privateCompile_pass1_Scan):
37691 (KJS::CTI::privateCompile_pass2_Main):
37692 (KJS::CTI::privateCompile):
37693 * VM/CTI.h:
37694 (KJS::CallRecord::CallRecord):
37695 (KJS::SwitchRecord::SwitchRecord):
37696 * VM/CodeBlock.h:
37697 (KJS::SimpleJumpTable::SimpleJumpTable::ctiForValue):
37698 * VM/Machine.cpp:
37699 (KJS::Machine::cti_op_switch_char):
37700 * VM/Machine.h:
37701 * masm/IA32MacroAsm.h:
37702 (KJS::IA32MacroAssembler::):
37703 (KJS::IA32MacroAssembler::emitJmpN_r):
37704 (KJS::IA32MacroAssembler::getRelocatedAddress):
37705 * wtf/Platform.h:
37706
37707 2008-08-26 Sam Weinig <sam@webkit.org>
37708
37709 Reviewed by Mark Rowe.
37710
37711 Implement op_put_by_index to fix 1 mozilla test.
37712
37713 * VM/CTI.cpp:
37714 (KJS::CTI::privateCompile_pass1_Scan):
37715 (KJS::CTI::privateCompile_pass2_Main):
37716 * VM/Machine.cpp:
37717 (KJS::Machine::cti_op_put_by_index):
37718 * VM/Machine.h:
37719
37720 2008-08-26 Gavin Barraclough <barraclough@apple.com>
37721
37722 Reviewed by Geoff Garen.
37723
37724 More fixes from Geoff's review.
37725
37726 * VM/CTI.cpp:
37727 (KJS::CTI::emitGetArg):
37728 (KJS::CTI::emitGetPutArg):
37729 (KJS::CTI::emitPutArg):
37730 (KJS::CTI::emitPutArgConstant):
37731 (KJS::CTI::getConstantImmediateNumericArg):
37732 (KJS::CTI::emitGetCTIParam):
37733 (KJS::CTI::emitPutResult):
37734 (KJS::CTI::emitCall):
37735 (KJS::CTI::emitJumpSlowCaseIfNotImm):
37736 (KJS::CTI::emitJumpSlowCaseIfNotImms):
37737 (KJS::CTI::getDeTaggedConstantImmediate):
37738 (KJS::CTI::emitFastArithDeTagImmediate):
37739 (KJS::CTI::emitFastArithReTagImmediate):
37740 (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
37741 (KJS::CTI::emitFastArithImmToInt):
37742 (KJS::CTI::emitFastArithIntToImmOrSlowCase):
37743 (KJS::CTI::privateCompile_pass2_Main):
37744 (KJS::CTI::privateCompile_pass4_SlowCases):
37745 (KJS::CTI::privateCompile):
37746 * VM/CTI.h:
37747
37748 2008-08-26 Mark Rowe <mrowe@apple.com>
37749
37750 Reviewed by Gavin Barraclough and Geoff Garen.
37751
37752 Implement op_jmp_scopes to fix 2 Mozilla tests.
37753
37754 * VM/CTI.cpp:
37755 (KJS::CTI::privateCompile_pass1_Scan):
37756 (KJS::CTI::privateCompile_pass2_Main):
37757 * VM/Machine.cpp:
37758 (KJS::Machine::cti_op_push_new_scope): Update ExecState::m_scopeChain after calling ARG_setScopeChain.
37759 (KJS::Machine::cti_op_jmp_scopes):
37760 * VM/Machine.h:
37761
37762 2008-08-26 Gavin Barraclough <barraclough@apple.com>
37763
37764 Reviewed by Oliver Hunt.
37765
37766 WebKit Regular Expression Compiler. (set ENABLE_WREC = 1 in Platform.h).
37767
37768 * JavaScriptCore.xcodeproj/project.pbxproj:
37769 * kjs/regexp.cpp:
37770 * kjs/regexp.h:
37771 * wrec: Added.
37772 * wrec/WREC.cpp: Added.
37773 * wrec/WREC.h: Added.
37774 * wtf/Platform.h:
37775
37776 2008-08-26 Sam Weinig <sam@webkit.org>
37777
37778 Rubber-stamped by Oliver Hunt.
37779
37780 Remove bogus assertion.
37781
37782 * VM/Machine.cpp:
37783 (KJS::Machine::cti_op_del_by_id):
37784
37785 2008-08-26 Mark Rowe <mrowe@apple.com>
37786
37787 Reviewed by Sam Weinig.
37788
37789 Implement op_push_new_scope and stub out op_catch. This fixes 11 Mozilla tests.
37790
37791 * VM/CTI.cpp:
37792 (KJS::CTI::privateCompile_pass1_Scan):
37793 (KJS::CTI::privateCompile_pass2_Main):
37794 * VM/Machine.cpp:
37795 (KJS::Machine::cti_op_push_new_scope):
37796 (KJS::Machine::cti_op_catch):
37797 * VM/Machine.h:
37798
37799 2008-08-26 Mark Rowe <mrowe@apple.com>
37800
37801 Reviewed by Sam Weinig.
37802
37803 Clean up op_resolve_base so that it shares its implementation with the bytecode interpreter.
37804
37805 * VM/Machine.cpp:
37806 (KJS::inlineResolveBase):
37807 (KJS::resolveBase):
37808
37809 2008-08-26 Oliver Hunt <oliver@apple.com>
37810
37811 Reviewed by Sam Weinig.
37812
37813 Add codegen support for op_instanceof, fixing 15 mozilla tests.
37814
37815 * VM/CTI.cpp:
37816 (KJS::CTI::privateCompile_pass1_Scan):
37817 (KJS::CTI::privateCompile_pass2_Main):
37818 * VM/Machine.cpp:
37819 (KJS::Machine::cti_op_instanceof):
37820 (KJS::Machine::cti_op_del_by_id):
37821 * VM/Machine.h:
37822 * wtf/Platform.h:
37823
37824 2008-08-26 Gavin Barraclough <barraclough@apple.com>
37825
37826 Reviewed by Geoff Garen.
37827
37828 Fixes for initial review comments.
37829
37830 * VM/CTI.cpp:
37831 (KJS::CTI::ctiCompileGetArg):
37832 (KJS::CTI::ctiCompileGetPutArg):
37833 (KJS::CTI::ctiCompilePutResult):
37834 (KJS::CTI::ctiCompileCall):
37835 (KJS::CTI::CTI):
37836 (KJS::CTI::privateCompile_pass1_Scan):
37837 (KJS::CTI::printOpcodeOperandTypes):
37838 (KJS::CTI::privateCompile_pass2_Main):
37839 (KJS::CTI::privateCompile_pass4_SlowCases):
37840 (KJS::CTI::privateCompile):
37841 * VM/CTI.h:
37842 * VM/Register.h:
37843 * kjs/JSValue.h:
37844
37845 2008-08-26 Sam Weinig <sam@webkit.org>
37846
37847 Reviewed by Gavin Barraclough and Geoff Garen.
37848
37849 Fix up exception checking code.
37850
37851 * VM/Machine.cpp:
37852 (KJS::Machine::cti_op_call):
37853 (KJS::Machine::cti_op_resolve):
37854 (KJS::Machine::cti_op_construct):
37855 (KJS::Machine::cti_op_resolve_func):
37856 (KJS::Machine::cti_op_resolve_skip):
37857 (KJS::Machine::cti_op_resolve_with_base):
37858 (KJS::Machine::cti_op_call_eval):
37859
37860 2008-08-26 Sam Weinig <sam@webkit.org>
37861
37862 Reviewed by Oliver Hunt.
37863
37864 Fix slowcase for op_post_inc and op_post_dec fixing 2 mozilla tests.
37865
37866 * VM/CTI.cpp:
37867 (KJS::CTI::privateCompile_pass4_SlowCases):
37868
37869 2008-08-26 Mark Rowe <mrowe@apple.com>
37870
37871 Reviewed by Sam Weinig.
37872
37873 Implement op_in, fixing 8 mozilla tests.
37874
37875 * VM/CTI.cpp:
37876 (KJS::CTI::privateCompile_pass1_Scan):
37877 (KJS::CTI::privateCompile_pass2_Main):
37878 * VM/Machine.cpp:
37879 (KJS::Machine::cti_op_in):
37880 * VM/Machine.h:
37881
37882 2008-08-26 Mark Rowe <mrowe@apple.com>
37883
37884 Rubber-stamped by Oliver Hunt.
37885
37886 Don't hardcode the size of a Register for op_new_array. Fixes a crash
37887 seen during the Mozilla tests.
37888
37889 * VM/CTI.cpp:
37890 (KJS::CTI::privateCompile_pass2_Main):
37891
37892 2008-08-26 Sam Weinig <sam@webkit.org>
37893
37894 Reviewed by Gavin Barraclough and Geoff Garen.
37895
37896 Add support for op_push_scope and op_pop_scope, fixing 20 mozilla tests.
37897
37898 * VM/CTI.cpp:
37899 (KJS::CTI::privateCompile_pass1_Scan):
37900 (KJS::CTI::privateCompile_pass2_Main):
37901 * VM/CTI.h:
37902 * VM/Machine.cpp:
37903 (KJS::Machine::cti_op_push_scope):
37904 (KJS::Machine::cti_op_pop_scope):
37905 * VM/Machine.h:
37906
37907 2008-08-26 Oliver Hunt <oliver@apple.com>
37908
37909 Reviewed by Maciej Stachowiak.
37910
37911 Add codegen support for op_del_by_id, fixing 49 mozilla tests.
37912
37913 * VM/CTI.cpp:
37914 (KJS::CTI::privateCompile_pass1_Scan):
37915 (KJS::CTI::privateCompile_pass2_Main):
37916 * VM/Machine.cpp:
37917 (KJS::Machine::cti_op_del_by_id):
37918 * VM/Machine.h:
37919
37920 2008-08-26 Sam Weinig <sam@webkit.org>
37921
37922 Reviewed by Gavin Barraclough and Geoff Garen.
37923
37924 Don't hardcode the size of a Register for op_get_scoped_var and op_put_scoped_var
37925 fixing 513 mozilla tests in debug build.
37926
37927 * VM/CTI.cpp:
37928 (KJS::CTI::privateCompile_pass2_Main):
37929
37930 2008-08-26 Oliver Hunt <oliver@apple.com>
37931
37932 Reviewed by Maciej Stachowiak.
37933
37934 Added code generator support for op_loop, fixing around 60 mozilla tests.
37935
37936 * VM/CTI.cpp:
37937 (KJS::CTI::privateCompile_pass1_Scan):
37938 (KJS::CTI::privateCompile_pass2_Main):
37939
37940 2008-08-26 Mark Rowe <mrowe@apple.com>
37941
37942 Reviewed by Sam Weinig.
37943
37944 Set -fomit-frame-pointer in the correct location.
37945
37946 * Configurations/JavaScriptCore.xcconfig:
37947 * JavaScriptCore.xcodeproj/project.pbxproj:
37948
37949 2008-08-26 Gavin Barraclough <barraclough@apple.com>
37950
37951 Reviewed by Geoff Garen.
37952
37953 Inital cut of CTI, Geoff's review fixes to follow.
37954
37955 * JavaScriptCore.xcodeproj/project.pbxproj:
37956 * VM/CTI.cpp: Added.
37957 (KJS::getJCB):
37958 (KJS::CTI::ctiCompileGetArg):
37959 (KJS::CTI::ctiCompileGetPutArg):
37960 (KJS::CTI::ctiCompilePutArg):
37961 (KJS::CTI::ctiCompilePutArgImm):
37962 (KJS::CTI::ctiImmediateNumericArg):
37963 (KJS::CTI::ctiCompileGetCTIParam):
37964 (KJS::CTI::ctiCompilePutResult):
37965 (KJS::CTI::ctiCompileCall):
37966 (KJS::CTI::slowCaseIfNotImm):
37967 (KJS::CTI::slowCaseIfNotImms):
37968 (KJS::CTI::ctiFastArithDeTagConstImmediate):
37969 (KJS::CTI::ctiFastArithDeTagImmediate):
37970 (KJS::CTI::ctiFastArithReTagImmediate):
37971 (KJS::CTI::ctiFastArithPotentiallyReTagImmediate):
37972 (KJS::CTI::ctiFastArithImmToInt):
37973 (KJS::CTI::ctiFastArithIntToImmOrSlowCase):
37974 (KJS::CTI::CTI):
37975 (KJS::CTI::privateCompile_pass1_Scan):
37976 (KJS::CTI::ctiCompileAdd):
37977 (KJS::CTI::ctiCompileAddImm):
37978 (KJS::CTI::ctiCompileAddImmNotInt):
37979 (KJS::CTI::TEMP_HACK_PRINT_TYPES):
37980 (KJS::CTI::privateCompile_pass2_Main):
37981 (KJS::CTI::privateCompile_pass3_Link):
37982 (KJS::CTI::privateCompile_pass4_SlowCases):
37983 (KJS::CTI::privateCompile):
37984 * VM/CTI.h: Added.
37985 (KJS::CTI2Result::CTI2Result):
37986 (KJS::CallRecord::CallRecord):
37987 (KJS::JmpTable::JmpTable):
37988 (KJS::SlowCaseEntry::SlowCaseEntry):
37989 (KJS::CTI::compile):
37990 (KJS::CTI::LabelInfo::LabelInfo):
37991 * VM/CodeBlock.h:
37992 (KJS::CodeBlock::CodeBlock):
37993 (KJS::CodeBlock::~CodeBlock):
37994 * VM/Machine.cpp:
37995 (KJS::Machine::execute):
37996 (KJS::Machine::privateExecute):
37997 (KJS::ctiException):
37998 (KJS::ctiUnsupported):
37999 (KJS::ctiTimedOut):
38000 (KJS::Machine::cti_op_end):
38001 (KJS::Machine::cti_op_add):
38002 (KJS::Machine::cti_op_pre_inc):
38003 (KJS::Machine::cti_timeout_check):
38004 (KJS::Machine::cti_op_loop_if_less):
38005 (KJS::Machine::cti_op_new_object):
38006 (KJS::Machine::cti_op_put_by_id):
38007 (KJS::Machine::cti_op_get_by_id):
38008 (KJS::Machine::cti_op_mul):
38009 (KJS::Machine::cti_op_new_func):
38010 (KJS::Machine::cti_op_call):
38011 (KJS::Machine::cti_op_ret):
38012 (KJS::Machine::cti_op_new_array):
38013 (KJS::Machine::cti_op_resolve):
38014 (KJS::Machine::cti_op_construct):
38015 (KJS::Machine::cti_op_get_by_val):
38016 (KJS::Machine::cti_op_resolve_func):
38017 (KJS::Machine::cti_op_sub):
38018 (KJS::Machine::cti_op_put_by_val):
38019 (KJS::Machine::cti_op_lesseq):
38020 (KJS::Machine::cti_op_loop_if_true):
38021 (KJS::Machine::cti_op_negate):
38022 (KJS::Machine::cti_op_resolve_base):
38023 (KJS::Machine::cti_op_resolve_skip):
38024 (KJS::Machine::cti_op_div):
38025 (KJS::Machine::cti_op_pre_dec):
38026 (KJS::Machine::cti_op_jless):
38027 (KJS::Machine::cti_op_not):
38028 (KJS::Machine::cti_op_jtrue):
38029 (KJS::Machine::cti_op_post_inc):
38030 (KJS::Machine::cti_op_eq):
38031 (KJS::Machine::cti_op_lshift):
38032 (KJS::Machine::cti_op_bitand):
38033 (KJS::Machine::cti_op_rshift):
38034 (KJS::Machine::cti_op_bitnot):
38035 (KJS::Machine::cti_op_resolve_with_base):
38036 (KJS::Machine::cti_op_new_func_exp):
38037 (KJS::Machine::cti_op_mod):
38038 (KJS::Machine::cti_op_less):
38039 (KJS::Machine::cti_op_neq):
38040 (KJS::Machine::cti_op_post_dec):
38041 (KJS::Machine::cti_op_urshift):
38042 (KJS::Machine::cti_op_bitxor):
38043 (KJS::Machine::cti_op_new_regexp):
38044 (KJS::Machine::cti_op_bitor):
38045 (KJS::Machine::cti_op_call_eval):
38046 (KJS::Machine::cti_op_throw):
38047 (KJS::Machine::cti_op_get_pnames):
38048 (KJS::Machine::cti_op_next_pname):
38049 (KJS::Machine::cti_op_typeof):
38050 (KJS::Machine::cti_op_stricteq):
38051 (KJS::Machine::cti_op_nstricteq):
38052 (KJS::Machine::cti_op_to_jsnumber):
38053 * VM/Machine.h:
38054 * VM/Register.h:
38055 (KJS::Register::jsValue):
38056 (KJS::Register::getJSValue):
38057 (KJS::Register::codeBlock):
38058 (KJS::Register::scopeChain):
38059 (KJS::Register::i):
38060 (KJS::Register::r):
38061 (KJS::Register::vPC):
38062 (KJS::Register::jsPropertyNameIterator):
38063 * VM/SamplingTool.cpp:
38064 (KJS::):
38065 (KJS::SamplingTool::run):
38066 (KJS::SamplingTool::dump):
38067 * VM/SamplingTool.h:
38068 * kjs/JSImmediate.h:
38069 (KJS::JSImmediate::zeroImmediate):
38070 (KJS::JSImmediate::oneImmediate):
38071 * kjs/JSValue.h:
38072 * kjs/JSVariableObject.h:
38073 (KJS::JSVariableObject::JSVariableObjectData::offsetOf_registers):
38074 (KJS::JSVariableObject::offsetOf_d):
38075 (KJS::JSVariableObject::offsetOf_Data_registers):
38076 * masm: Added.
38077 * masm/IA32MacroAsm.h: Added.
38078 (KJS::JITCodeBuffer::JITCodeBuffer):
38079 (KJS::JITCodeBuffer::putByte):
38080 (KJS::JITCodeBuffer::putShort):
38081 (KJS::JITCodeBuffer::putInt):
38082 (KJS::JITCodeBuffer::getEIP):
38083 (KJS::JITCodeBuffer::start):
38084 (KJS::JITCodeBuffer::getOffset):
38085 (KJS::JITCodeBuffer::reset):
38086 (KJS::JITCodeBuffer::copy):
38087 (KJS::IA32MacroAssembler::):
38088 (KJS::IA32MacroAssembler::emitModRm_rr):
38089 (KJS::IA32MacroAssembler::emitModRm_rm):
38090 (KJS::IA32MacroAssembler::emitModRm_rmsib):
38091 (KJS::IA32MacroAssembler::emitModRm_opr):
38092 (KJS::IA32MacroAssembler::emitModRm_opm):
38093 (KJS::IA32MacroAssembler::IA32MacroAssembler):
38094 (KJS::IA32MacroAssembler::emitInt3):
38095 (KJS::IA32MacroAssembler::emitPushl_r):
38096 (KJS::IA32MacroAssembler::emitPopl_r):
38097 (KJS::IA32MacroAssembler::emitMovl_rr):
38098 (KJS::IA32MacroAssembler::emitAddl_rr):
38099 (KJS::IA32MacroAssembler::emitAddl_i8r):
38100 (KJS::IA32MacroAssembler::emitAddl_i32r):
38101 (KJS::IA32MacroAssembler::emitAddl_mr):
38102 (KJS::IA32MacroAssembler::emitAndl_rr):
38103 (KJS::IA32MacroAssembler::emitAndl_i32r):
38104 (KJS::IA32MacroAssembler::emitCmpl_i8r):
38105 (KJS::IA32MacroAssembler::emitCmpl_rr):
38106 (KJS::IA32MacroAssembler::emitCmpl_rm):
38107 (KJS::IA32MacroAssembler::emitCmpl_i32r):
38108 (KJS::IA32MacroAssembler::emitCmpw_rm):
38109 (KJS::IA32MacroAssembler::emitOrl_rr):
38110 (KJS::IA32MacroAssembler::emitOrl_i8r):
38111 (KJS::IA32MacroAssembler::emitSubl_rr):
38112 (KJS::IA32MacroAssembler::emitSubl_i8r):
38113 (KJS::IA32MacroAssembler::emitSubl_i32r):
38114 (KJS::IA32MacroAssembler::emitSubl_mr):
38115 (KJS::IA32MacroAssembler::emitTestl_i32r):
38116 (KJS::IA32MacroAssembler::emitTestl_rr):
38117 (KJS::IA32MacroAssembler::emitXorl_i8r):
38118 (KJS::IA32MacroAssembler::emitXorl_rr):
38119 (KJS::IA32MacroAssembler::emitSarl_i8r):
38120 (KJS::IA32MacroAssembler::emitSarl_CLr):
38121 (KJS::IA32MacroAssembler::emitShl_i8r):
38122 (KJS::IA32MacroAssembler::emitShll_CLr):
38123 (KJS::IA32MacroAssembler::emitMull_rr):
38124 (KJS::IA32MacroAssembler::emitIdivl_r):
38125 (KJS::IA32MacroAssembler::emitCdq):
38126 (KJS::IA32MacroAssembler::emitMovl_mr):
38127 (KJS::IA32MacroAssembler::emitMovzwl_mr):
38128 (KJS::IA32MacroAssembler::emitMovl_rm):
38129 (KJS::IA32MacroAssembler::emitMovl_i32r):
38130 (KJS::IA32MacroAssembler::emitMovl_i32m):
38131 (KJS::IA32MacroAssembler::emitLeal_mr):
38132 (KJS::IA32MacroAssembler::emitRet):
38133 (KJS::IA32MacroAssembler::JmpSrc::JmpSrc):
38134 (KJS::IA32MacroAssembler::JmpDst::JmpDst):
38135 (KJS::IA32MacroAssembler::emitCall):
38136 (KJS::IA32MacroAssembler::label):
38137 (KJS::IA32MacroAssembler::emitUnlinkedJmp):
38138 (KJS::IA32MacroAssembler::emitUnlinkedJne):
38139 (KJS::IA32MacroAssembler::emitUnlinkedJe):
38140 (KJS::IA32MacroAssembler::emitUnlinkedJl):
38141 (KJS::IA32MacroAssembler::emitUnlinkedJle):
38142 (KJS::IA32MacroAssembler::emitUnlinkedJge):
38143 (KJS::IA32MacroAssembler::emitUnlinkedJae):
38144 (KJS::IA32MacroAssembler::emitUnlinkedJo):
38145 (KJS::IA32MacroAssembler::emitPredictionNotTaken):
38146 (KJS::IA32MacroAssembler::link):
38147 (KJS::IA32MacroAssembler::copy):
38148 * wtf/Platform.h:
38149
38150 2008-08-26 Oliver Hunt <oliver@apple.com>
38151
38152 RS=Maciej.
38153
38154 Enabled -fomit-frame-pointer on Release and Production builds, add additional Profiling build config for shark, etc.
38155
38156 * JavaScriptCore.xcodeproj/project.pbxproj:
38157
38158 === Start merge of squirrelfish-extreme ===
38159
38160 2008-09-06 Cameron Zwarich <cwzwarich@uwaterloo.ca>
38161
38162 Reviewed by Maciej Stachowiak.
38163
38164 Fix the Mac Debug build by adding symbols that are exported only in a
38165 Debug configuration.
38166
38167 * Configurations/JavaScriptCore.xcconfig:
38168 * DerivedSources.make:
38169 * JavaScriptCore.Debug.exp: Added.
38170 * JavaScriptCore.base.exp: Copied from JavaScriptCore.exp.
38171 * JavaScriptCore.exp: Removed.
38172 * JavaScriptCore.xcodeproj/project.pbxproj:
38173
38174 2008-09-05 Darin Adler <darin@apple.com>
38175
38176 Reviewed by Cameron Zwarich.
38177
38178 - https://bugs.webkit.org/show_bug.cgi?id=20681
38179 JSPropertyNameIterator functions need to be inlined
38180
38181 1.007x as fast on SunSpider overall
38182 1.081x as fast on SunSpider math-cordic
38183
38184 * VM/JSPropertyNameIterator.cpp: Moved functions out of here.
38185 * VM/JSPropertyNameIterator.h:
38186 (KJS::JSPropertyNameIterator::JSPropertyNameIterator): Moved
38187 this into the header and marked it inline.
38188 (KJS::JSPropertyNameIterator::create): Ditto.
38189 (KJS::JSPropertyNameIterator::next): Ditto.
38190
38191 2008-09-05 Darin Adler <darin@apple.com>
38192
38193 Reviewed by Geoffrey Garen.
38194
38195 - fix https://bugs.webkit.org/show_bug.cgi?id=20673
38196 single-character strings are churning in the Identifier table
38197
38198 1.007x as fast on SunSpider overall
38199 1.167x as fast on SunSpider string-fasta
38200
38201 * JavaScriptCore.exp: Updated.
38202 * kjs/SmallStrings.cpp:
38203 (KJS::SmallStrings::singleCharacterStringRep): Added.
38204 * kjs/SmallStrings.h: Added singleCharacterStringRep for clients that
38205 need just a UString, not a JSString.
38206 * kjs/identifier.cpp:
38207 (KJS::Identifier::add): Added special cases for single character strings
38208 so that the UString::Rep that ends up in the identifier table is the one
38209 from the single-character string optimization; otherwise we end up having
38210 to look it up in the identifier table over and over again.
38211 (KJS::Identifier::addSlowCase): Ditto.
38212 (KJS::Identifier::checkSameIdentifierTable): Made this function an empty
38213 inline in release builds so that callers don't have to put #ifndef NDEBUG
38214 at each call site.
38215 * kjs/identifier.h:
38216 (KJS::Identifier::add): Removed #ifndef NDEBUG around the calls to
38217 checkSameIdentifierTable.
38218 (KJS::Identifier::checkSameIdentifierTable): Added. Empty inline version
38219 for NDEBUG builds.
38220
38221 2008-09-05 Mark Rowe <mrowe@apple.com>
38222
38223 Build fix.
38224
38225 * kjs/JSObject.h: Move the inline virtual destructor after a non-inline
38226 virtual function so that the symbol for the vtable is not marked as a
38227 weakly exported symbol.
38228
38229 2008-09-05 Darin Adler <darin@apple.com>
38230
38231 Reviewed by Sam Weinig.
38232
38233 - fix https://bugs.webkit.org/show_bug.cgi?id=20671
38234 JavaScriptCore string manipulation spends too much time in memcpy
38235
38236 1.011x as fast on SunSpider overall
38237 1.028x as fast on SunSpider string tests
38238
38239 For small strings, use a loop rather than calling memcpy. The loop can
38240 be faster because there's no function call overhead, and because it can
38241 assume the pointers are aligned instead of checking that. Currently the
38242 threshold is set at 20 characters, based on some testing on one particular
38243 computer. Later we can tune this for various platforms by setting
38244 USTRING_COPY_CHARS_INLINE_CUTOFF appropriately, but it does no great harm
38245 if not perfectly tuned.
38246
38247 * kjs/ustring.cpp:
38248 (KJS::overflowIndicator): Removed bogus const.
38249 (KJS::maxUChars): Ditto.
38250 (KJS::copyChars): Added.
38251 (KJS::UString::Rep::createCopying): Call copyChars instead of memcpy.
38252 Also eliminated need for const_cast.
38253 (KJS::UString::expandPreCapacity): Ditto.
38254 (KJS::concatenate): Ditto.
38255 (KJS::UString::spliceSubstringsWithSeparators): Ditto.
38256 (KJS::UString::append): Ditto.
38257
38258 2008-09-05 Kevin McCullough <kmccullough@apple.com>
38259
38260 Reviewed by Sam and Alexey.
38261
38262 Make the profiler work with a null exec state. This will allow other
38263 applications start the profiler to get DTrace probes going without
38264 needing a WebView.
38265
38266 * ChangeLog:
38267 * profiler/ProfileGenerator.cpp:
38268 (KJS::ProfileGenerator::ProfileGenerator):
38269 (KJS::ProfileGenerator::willExecute):
38270 (KJS::ProfileGenerator::didExecute):
38271 * profiler/Profiler.cpp:
38272 (KJS::Profiler::startProfiling):
38273 (KJS::Profiler::stopProfiling):
38274 (KJS::dispatchFunctionToProfiles):
38275
38276 2008-09-04 Gavin Barraclough <barraclough@apple.com>
38277
38278 Reviewed by Geoffrey Garen.
38279
38280 Fixed an off-by-one error that would cause the StructureIDChain to
38281 be one object too short.
38282
38283 Can't construct a test case because other factors make this not crash
38284 (yet!).
38285
38286 * kjs/StructureID.cpp:
38287 (KJS::StructureIDChain::StructureIDChain):
38288
38289 2008-09-04 Kevin Ollivier <kevino@theolliviers.com>
38290
38291 wx build fixes.
38292
38293 * JavaScriptCoreSources.bkl:
38294
38295 2008-09-04 Mark Rowe <mrowe@apple.com>
38296
38297 Reviewed by Eric Seidel.
38298
38299 Fix https://bugs.webkit.org/show_bug.cgi?id=20639.
38300 Bug 20639: ENABLE_DASHBOARD_SUPPORT does not need to be a FEATURE_DEFINE
38301
38302 * Configurations/JavaScriptCore.xcconfig: Remove ENABLE_DASHBOARD_SUPPORT from FEATURE_DEFINES.
38303 * wtf/Platform.h: Set ENABLE_DASHBOARD_SUPPORT for PLATFORM(MAC).
38304
38305 2008-09-04 Adele Peterson <adele@apple.com>
38306
38307 Build fix.
38308
38309 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
38310 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
38311 * JavaScriptCore.vcproj/jsc/jsc.vcproj:
38312
38313 2008-09-04 Mark Rowe <mrowe@apple.com>
38314
38315 Mac build fix.
38316
38317 * kjs/config.h: Only check the value of HAVE_CONFIG_H if it is defined.
38318
38319 2008-09-04 Marco Barisione <marco.barisione@collabora.co.uk>
38320
38321 Reviewed by Eric Seidel.
38322
38323 http://bugs.webkit.org/show_bug.cgi?id=20380
38324 [GTK][AUTOTOOLS] Include autotoolsconfig.h from config.h
38325
38326 * kjs/config.h: Include the configuration header generated by
38327 autotools if available.
38328
38329 2008-09-04 Tor Arne Vestbø <tavestbo@trolltech.com>
38330
38331 Reviewed by Simon.
38332
38333 Fix the QtWebKit build to match changes in r36016
38334
38335 * JavaScriptCore.pri:
38336
38337 2008-09-04 Mark Rowe <mrowe@apple.com>
38338
38339 Fix the 64-bit build.
38340
38341 * VM/CodeBlock.cpp:
38342 (KJS::CodeBlock::printStructureID): Store the instruction offset into an unsigned local
38343 to avoid a warning related to format specifiers.
38344 (KJS::CodeBlock::printStructureIDs): Ditto.
38345
38346 2008-09-04 Cameron Zwarich <cwzwarich@uwaterloo.ca>
38347
38348 Rubber-stamped by Oliver Hunt.
38349
38350 Correct the spelling of 'entryIndices'.
38351
38352 * kjs/PropertyMap.cpp:
38353 (KJS::PropertyMap::get):
38354 (KJS::PropertyMap::getLocation):
38355 (KJS::PropertyMap::put):
38356 (KJS::PropertyMap::insert):
38357 (KJS::PropertyMap::remove):
38358 (KJS::PropertyMap::checkConsistency):
38359 * kjs/PropertyMap.h:
38360 (KJS::PropertyMapHashTable::entries):
38361 (KJS::PropertyMap::getOffset):
38362 (KJS::PropertyMap::putOffset):
38363 (KJS::PropertyMap::offsetForTableLocation):
38364
38365 2008-09-03 Geoffrey Garen <ggaren@apple.com>
38366
38367 Reviewed by Cameron Zwarich.
38368
38369 Fixed <rdar://problem/6193925> REGRESSION: Crash occurs at
38370 KJS::Machine::privateExecute() when attempting to load my Mobile Gallery
38371 (http://www.me.com/gallery/#home)
38372
38373 also
38374
38375 https://bugs.webkit.org/show_bug.cgi?id=20633 Crash in privateExecute
38376 @ cs.byu.edu
38377
38378 The underlying problem was that we would cache prototype properties
38379 even if the prototype was a dictionary.
38380
38381 The fix is to transition a prototype back from dictionary to normal
38382 status when an opcode caches access to it. (This is better than just
38383 refusing to cache, since a heavily accessed prototype is almost
38384 certainly not a true dictionary.)
38385
38386 * VM/Machine.cpp:
38387 (KJS::Machine::tryCacheGetByID):
38388 * kjs/JSObject.h:
38389
38390 2008-09-03 Eric Seidel <eric@webkit.org>
38391
38392 Reviewed by Sam.
38393
38394 Clean up Platform.h and add PLATFORM(CHROMIUM), PLATFORM(SKIA) and USE(V8_BINDINGS)
38395
38396 * Configurations/JavaScriptCore.xcconfig: add missing ENABLE_*
38397 * wtf/ASCIICType.h: include <wtf/Assertions.h> since it depends on it.
38398 * wtf/Platform.h:
38399
38400 2008-09-03 Kevin McCullough <kmccullough@apple.com>
38401
38402 Reviewed by Tim.
38403
38404 Remove the rest of the "zombie" code from the profiler.
38405 - There is no longer a need for the ProfilerClient callback mechanism.
38406
38407 * API/JSProfilerPrivate.cpp:
38408 (JSStartProfiling):
38409 * JavaScriptCore.exp:
38410 * profiler/HeavyProfile.h:
38411 * profiler/ProfileGenerator.cpp:
38412 (KJS::ProfileGenerator::create):
38413 (KJS::ProfileGenerator::ProfileGenerator):
38414 * profiler/ProfileGenerator.h:
38415 (KJS::ProfileGenerator::profileGroup):
38416 * profiler/Profiler.cpp:
38417 (KJS::Profiler::startProfiling):
38418 (KJS::Profiler::stopProfiling): Immediately return the profile when
38419 stopped instead of using a callback.
38420 * profiler/Profiler.h:
38421 * profiler/TreeProfile.h:
38422
38423 2008-09-03 Adele Peterson <adele@apple.com>
38424
38425 Build fix.
38426
38427 * wtf/win/MainThreadWin.cpp:
38428
38429 2008-09-02 Kevin McCullough <kmccullough@apple.com>
38430
38431 Reviewed by Darin and Tim.
38432
38433 Remove most of the "zombie" mode from the profiler. Next we will need
38434 to remove the client callback mechanism in profiles.
38435
38436 - This simplifies the code, leverages the recent changes I've made in
38437 getting line numbers from SquirrelFish, and is a slight speed
38438 improvement on SunSpider.
38439 - Also the "zombie" mode was a constant source of odd edge cases and
38440 obscure bugs so it's good to remove since all of its issues may not have
38441 been found.
38442
38443 * API/JSProfilerPrivate.cpp: No need to call didFinishAllExecution() any
38444 more.
38445 (JSEndProfiling):
38446 * JavaScriptCore.exp: Export the new signature of retrieveLastCaller()
38447 * VM/Machine.cpp:
38448 (KJS::Machine::execute): No need to call didFinishAllExecution() any
38449 more.
38450 (KJS::Machine::retrieveCaller): Now operates on InternalFunctions now
38451 since the RegisterFile is no longer guaranteeded to store only
38452 JSFunctions
38453 (KJS::Machine::retrieveLastCaller): Now also retrieve the function's
38454 name
38455 (KJS::Machine::callFrame): A result of changing retrieveCaller()
38456 * VM/Machine.h:
38457 * VM/Register.h:
38458 * kjs/JSGlobalObject.cpp:
38459 (KJS::JSGlobalObject::~JSGlobalObject):
38460 * kjs/nodes.h:
38461 * profiler/ProfileGenerator.cpp:
38462 (KJS::ProfileGenerator::create): Now pass the original exec and get the
38463 global exec and client when necessary. We need the original exec so we
38464 can have the stack frame where profiling started.
38465 (KJS::ProfileGenerator::ProfileGenerator): ditto.
38466 (KJS::ProfileGenerator::addParentForConsoleStart): This is where the
38467 parent to star of the profile is added, if there is one.
38468 (KJS::ProfileGenerator::willExecute): Remove uglyness!
38469 (KJS::ProfileGenerator::didExecute): Ditto!
38470 (KJS::ProfileGenerator::stopProfiling):
38471 (KJS::ProfileGenerator::removeProfileStart): Use a better way to find
38472 and remove the function we are looking for.
38473 (KJS::ProfileGenerator::removeProfileEnd): Ditto.
38474 * profiler/ProfileGenerator.h:
38475 (KJS::ProfileGenerator::client):
38476 * profiler/ProfileNode.cpp:
38477 (KJS::ProfileNode::removeChild): Add a better way to remove a child from
38478 a ProfileNode.
38479 (KJS::ProfileNode::stopProfiling):
38480 (KJS::ProfileNode::debugPrintData): Modified a debug-only diagnostic
38481 function to be sane.
38482 * profiler/ProfileNode.h:
38483 * profiler/Profiler.cpp: Change to pass the original exec state.
38484 (KJS::Profiler::startProfiling):
38485 (KJS::Profiler::stopProfiling):
38486 (KJS::Profiler::willExecute):
38487 (KJS::Profiler::didExecute):
38488 (KJS::Profiler::createCallIdentifier):
38489 * profiler/Profiler.h:
38490
38491 2008-09-01 Alexey Proskuryakov <ap@webkit.org>
38492
38493 Reviewed by Darin Adler.
38494
38495 Implement callOnMainThreadAndWait().
38496
38497 This will be useful when a background thread needs to perform UI calls synchronously
38498 (e.g. an openDatabase() call cannot return until the user answers to a confirmation dialog).
38499
38500 * wtf/MainThread.cpp:
38501 (WTF::FunctionWithContext::FunctionWithContext): Added a ThreadCondition member. When
38502 non-zero, the condition is signalled after the function is called.
38503 (WTF::mainThreadFunctionQueueMutex): Renamed from functionQueueMutex, sinc this is no longer
38504 static. Changed to be initialized from initializeThreading() to avoid lock contention.
38505 (WTF::initializeMainThread): On non-Windows platforms, just call mainThreadFunctionQueueMutex.
38506 (WTF::dispatchFunctionsFromMainThread): Signal synchronous calls when done.
38507 (WTF::callOnMainThread): Updated for functionQueueMutex rename.
38508 (WTF::callOnMainThreadAndWait): Added.
38509
38510 * wtf/MainThread.h: Added callOnMainThreadAndWait(); initializeMainThread() now exists on
38511 all platforms.
38512
38513 * wtf/win/MainThreadWin.cpp: (WTF::initializeMainThread): Added a callOnMainThreadAndWait()
38514 call to initialize function queue mutex.
38515
38516 * wtf/ThreadingGtk.cpp: (WTF::initializeThreading):
38517 * wtf/ThreadingPthreads.cpp: (WTF::initializeThreading):
38518 * wtf/ThreadingQt.cpp: (WTF::initializeThreading):
38519 Only initialize mainThreadIdentifier on non-Darwin platforms. It was not guaranteed to be
38520 accurate on Darwin.
38521
38522 2008-09-03 Geoffrey Garen <ggaren@apple.com>
38523
38524 Reviewed by Darin Adler.
38525
38526 Use isUndefinedOrNull() instead of separate checks for each in op_eq_null
38527 and op_neq_null.
38528
38529 * VM/Machine.cpp:
38530 (KJS::Machine::privateExecute):
38531
38532 2008-09-02 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
38533
38534 Reviewed by Darin Adler.
38535
38536 Bug 20296: OpcodeStats doesn't build on platforms which don't have mergesort().
38537 <https://bugs.webkit.org/show_bug.cgi?id=20296>
38538
38539 * VM/Opcode.cpp:
38540 (KJS::OpcodeStats::~OpcodeStats): mergesort() replaced with qsort()
38541
38542 2008-09-02 Geoffrey Garen <ggaren@apple.com>
38543
38544 Reviewed by Oliver Hunt.
38545
38546 Fast path for array.length and string.length.
38547
38548 SunSpider says 0.5% faster.
38549
38550 2008-09-02 Geoffrey Garen <ggaren@apple.com>
38551
38552 Reviewed by Anders Carlsson.
38553
38554 Added optimized paths for comparing to null.
38555
38556 SunSpider says 0.5% faster.
38557
38558 2008-09-02 Geoffrey Garen <ggaren@apple.com>
38559
38560 Reviewed by Sam Weinig.
38561
38562 Changed jsDriver.pl to dump the exact text you would need in order to
38563 reproduce a test result. This enables a fast workflow where you copy
38564 and paste a test failure in the terminal.
38565
38566 * tests/mozilla/jsDriver.pl:
38567
38568 2008-09-02 Geoffrey Garen <ggaren@apple.com>
38569
38570 Reviewed by Sam Weinig.
38571
38572 Implemented the rest of Darin's review comments for the 09-01 inline
38573 caching patch.
38574
38575 SunSpider says 0.5% faster, but that seems like noise.
38576
38577 * JavaScriptCore.xcodeproj/project.pbxproj: Put PutPropertySlot into
38578 its own file, and added BatchedTransitionOptimizer.
38579
38580 * VM/CodeBlock.cpp:
38581 (KJS::CodeBlock::~CodeBlock): Use array indexing instead of a pointer
38582 iterator.
38583
38584 * VM/CodeGenerator.cpp:
38585 (KJS::CodeGenerator::CodeGenerator): Used BatchedTransitionOptimizer to
38586 make batched put and remove for declared variables fast, without forever
38587 pessimizing the global object. Removed the old getDirect/removeDirect hack
38588 that tried to do the same in a more limited way.
38589
38590 * VM/CodeGenerator.h: Moved IdentifierRepHash to the KJS namespace since
38591 it doesn't specialize anything in WTF.
38592
38593 * VM/Machine.cpp:
38594 (KJS::Machine::Machine): Nixed the DummyConstruct tag because it was
38595 confusingly named.
38596
38597 (KJS::Machine::execute): Used BatchedTransitionOptimizer, as above. Fixed
38598 up some comments.
38599
38600 (KJS::cachePrototypeChain): Cast to JSObject*, since it's more specific.
38601
38602 (KJS::Machine::tryCachePutByID): Use isNull() instead of comparing to
38603 jsNull(), since isNull() leaves more options open for the future.
38604 (KJS::Machine::tryCacheGetByID): ditto
38605 (KJS::Machine::privateExecute): ditto
38606
38607 * VM/SamplingTool.cpp:
38608 (KJS::SamplingTool::dump): Use C++-style cast, to match our style
38609 guidelines.
38610
38611 * kjs/BatchedTransitionOptimizer.h: Added. New class that allows host
38612 code to add a batch of properties to an object in an efficient way.
38613
38614 * kjs/JSActivation.cpp: Use isNull(), as above.
38615
38616 * kjs/JSArray.cpp: Get rid of DummyConstruct tag, as above.
38617 * kjs/JSArray.h:
38618
38619 * kjs/JSGlobalData.cpp: Nixed two unused StructureIDs.
38620 * kjs/JSGlobalData.h:
38621
38622 * kjs/JSImmediate.cpp: Use isNull(), as above.
38623
38624 * kjs/JSObject.cpp:
38625 (KJS::JSObject::mark): Moved mark tracing code elsewhere, to make this
38626 function more readable.
38627
38628 (KJS::JSObject::put): Use isNull(), as above.
38629
38630 (KJS::JSObject::createInheritorID): Return a raw pointer, since the
38631 object is owned by a data member, not necessarily the caller.
38632 * kjs/JSObject.h:
38633
38634 * kjs/JSString.cpp: Use isNull(), as above.
38635
38636 * kjs/PropertyMap.h: Updated to use PropertySlot::invalidOffset.
38637
38638 * kjs/PropertySlot.h: Changed KJS_INVALID_OFFSET to WTF::notFound
38639 because C macros are so 80's.
38640
38641 * kjs/PutPropertySlot.h: Added. Split out of PropertySlot.h. Also renamed
38642 PutPropertySlot::SlotType to PutPropertySlot::Type, and slotBase to base,
38643 since "slot" was redundant.
38644
38645 * kjs/StructureID.cpp: Added a new transition *away* from dictionary
38646 status, to support BatchedTransitionOptimizer.
38647
38648 (KJS::StructureIDChain::StructureIDChain): No need to store m_size as
38649 a data member, so keep it in a local, which might be faster.
38650 * kjs/StructureID.h:
38651
38652 * kjs/SymbolTable.h: Moved IdentifierRepHash to KJS namespace, as above.
38653 * kjs/ustring.h:
38654
38655 2008-09-02 Adam Roben <aroben@apple.com>
38656
38657 Windows build fixes
38658
38659 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
38660 StructureID.{cpp,h} to the project. Also let VS reorder this file.
38661 * VM/CodeBlock.cpp: Include StringExtras so that snprintf will be
38662 defined on Windows.
38663
38664 2008-09-01 Sam Weinig <sam@webkit.org>
38665
38666 Fix release build.
38667
38668 * JavaScriptCore.exp:
38669
38670 2008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
38671
38672 Reviewed by Oliver Hunt.
38673
38674 Gtk buildfix
38675
38676 * GNUmakefile.am:
38677 * kjs/PropertyMap.cpp: rename Identifier.h to identifier.h
38678 * kjs/StructureID.cpp: include JSObject.h
38679
38680 2008-09-01 Geoffrey Garen <ggaren@apple.com>
38681
38682 Reviewed by Darin Adler.
38683
38684 First cut at inline caching for access to vanilla JavaScript properties.
38685
38686 SunSpider says 4% faster. Tests heavy on dictionary-like access have
38687 regressed a bit -- we have a lot of room to improve in this area,
38688 but this patch is over-ripe as-is.
38689
38690 JSCells now have a StructureID that uniquely identifies their layout,
38691 and holds their prototype.
38692
38693 JSValue::put takes a PropertySlot& argument, so it can fill in details
38694 about where it put a value, for the sake of caching.
38695
38696 * VM/CodeGenerator.cpp:
38697 (KJS::CodeGenerator::CodeGenerator): Avoid calling removeDirect if we
38698 can, since it disables inline caching in the global object. This can
38699 probably improve in the future.
38700
38701 * kjs/JSGlobalObject.cpp: Nixed reset(), since it complicates caching, and
38702 wasn't really necessary.
38703
38704 * kjs/JSObject.cpp: Tweaked getter / setter behavior not to rely on the
38705 IsGetterSetter flag, since the flag was buggy. This is necessary in order
38706 to avoid accidentally accessing a getter / setter as a normal property.
38707
38708 Also changed getter / setter creation to honor ReadOnly, matching Mozilla.
38709
38710 * kjs/PropertyMap.cpp: Nixed clear(), since it complicates caching and
38711 isn't necessary.
38712
38713 * kjs/Shell.cpp: Moved SamplingTool dumping outside the loop. This allows
38714 you to aggregate sampling of multiple files (or the same file repeatedly),
38715 which helped me track down regressions.
38716
38717 * kjs/ustring.h: Moved IdentifierRepHash here to share it.
38718
38719 2008-09-01 Geoffrey Garen <ggaren@apple.com>
38720
38721 Reviewed by Sam Weinig.
38722
38723 Eagerly allocate the Math object's numeric constants. This avoids
38724 constantly reallocating them in loops, and also ensures that the Math
38725 object will not use the single property optimization, which makes
38726 properties ineligible for caching.
38727
38728 SunSpider reports a small speedup, in combination with inline caching.
38729
38730 * kjs/MathObject.cpp:
38731 (KJS::MathObject::MathObject):
38732 (KJS::MathObject::getOwnPropertySlot):
38733 * kjs/MathObject.h:
38734
38735 2008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
38736
38737 Gtk build fix, not reviewed.
38738
38739 * GNUmakefile.am: Add SmallStrings.cpp in both release and debug builds
38740
38741 2008-08-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
38742
38743 Reviewed by Maciej Stachowiak.
38744
38745 Bug 20577: REGRESSION (r36006): Gmail is broken
38746 <https://bugs.webkit.org/show_bug.cgi?id=20577>
38747
38748 r36006 changed stringProtoFuncSubstr() so that it is uses the more
38749 efficient jsSubstring(), rather than using UString::substr() and then
38750 calling jsString(). However, the change did not account for the case
38751 where the start and the length of the substring extend beyond the length
38752 of the original string. This patch corrects that.
38753
38754 * kjs/StringPrototype.cpp:
38755 (KJS::stringProtoFuncSubstr):
38756
38757 2008-08-31 Simon Hausmann <hausmann@wekit.org>
38758
38759 Unreviewed build fix (with gcc 4.3)
38760
38761 * kjs/ustring.h: Properly forward declare operator== for UString and
38762 the the concatenate functions inside the KJS namespace.
38763
38764 2008-08-30 Darin Adler <darin@apple.com>
38765
38766 Reviewed by Maciej.
38767
38768 - https://bugs.webkit.org/show_bug.cgi?id=20333
38769 improve JavaScript speed when handling single-character strings
38770
38771 1.035x as fast on SunSpider overall.
38772 1.127x as fast on SunSpider string tests.
38773 1.910x as fast on SunSpider string-base64 test.
38774
38775 * API/JSObjectRef.cpp:
38776 (JSObjectMakeFunction): Removed unneeded explicit construction of UString.
38777
38778 * GNUmakefile.am: Added SmallStrings.h and SmallStrings.cpp.
38779 * JavaScriptCore.pri: Ditto.
38780 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
38781 Ditto.
38782 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
38783 * JavaScriptCoreSources.bkl: Ditto.
38784
38785 * JavaScriptCore.exp: Updated.
38786
38787 * VM/Machine.cpp:
38788 (KJS::jsAddSlowCase): Changed to use a code path that doesn't involve
38789 a UString constructor. This avoids an extra jump caused by the "in charge"
38790 vs. "not in charge" constructors.
38791 (KJS::jsAdd): Ditto.
38792 (KJS::jsTypeStringForValue): Adopted jsNontrivialString.
38793
38794 * kjs/ArrayPrototype.cpp:
38795 (KJS::arrayProtoFuncToString): Adopted jsEmptyString.
38796 (KJS::arrayProtoFuncToLocaleString): Ditto.
38797 (KJS::arrayProtoFuncJoin): Ditto.
38798 * kjs/BooleanPrototype.cpp:
38799 (KJS::booleanProtoFuncToString): Adopted jsNontrivialString.
38800 * kjs/DateConstructor.cpp:
38801 (KJS::callDate): Ditto.
38802 * kjs/DatePrototype.cpp:
38803 (KJS::formatLocaleDate): Adopted jsEmptyString and jsNontrivialString.
38804 (KJS::dateProtoFuncToString): Ditto.
38805 (KJS::dateProtoFuncToUTCString): Ditto.
38806 (KJS::dateProtoFuncToDateString): Ditto.
38807 (KJS::dateProtoFuncToTimeString): Ditto.
38808 (KJS::dateProtoFuncToLocaleString): Ditto.
38809 (KJS::dateProtoFuncToLocaleDateString): Ditto.
38810 (KJS::dateProtoFuncToLocaleTimeString): Ditto.
38811 (KJS::dateProtoFuncToGMTString): Ditto.
38812
38813 * kjs/ErrorPrototype.cpp:
38814 (KJS::ErrorPrototype::ErrorPrototype): Ditto.
38815 (KJS::errorProtoFuncToString): Ditto.
38816
38817 * kjs/JSGlobalData.h: Added SmallStrings.
38818
38819 * kjs/JSString.cpp:
38820 (KJS::jsString): Eliminated the overload that takes a const char*.
38821 Added code to use SmallStrings to get strings of small sizes rather
38822 than creating a new JSString every time.
38823 (KJS::jsSubstring): Added. Used when creating a string from a substring
38824 to avoid creating a JSString in cases where the substring will end up
38825 empty or as one character.
38826 (KJS::jsOwnedString): Added the same code as in jsString.
38827
38828 * kjs/JSString.h: Added new functions jsEmptyString, jsSingleCharacterString,
38829 jsSingleCharacterSubstring, jsSubstring, and jsNontrivialString for various
38830 cases where we want to create JSString, and want special handling for small
38831 strings.
38832 (KJS::JSString::JSString): Added an overload that takes a PassRefPtr of
38833 a UString::Rep so you don't have to construct a UString; PassRefPtr can be
38834 more efficient.
38835 (KJS::jsEmptyString): Added.
38836 (KJS::jsSingleCharacterString): Added.
38837 (KJS::jsSingleCharacterSubstring): Added.
38838 (KJS::jsNontrivialString): Added.
38839 (KJS::JSString::getIndex): Adopted jsSingleCharacterSubstring.
38840 (KJS::JSString::getStringPropertySlot): Ditto.
38841
38842 * kjs/NumberPrototype.cpp:
38843 (KJS::numberProtoFuncToFixed): Adopted jsNontrivialString.
38844 (KJS::numberProtoFuncToExponential): Ditto.
38845 (KJS::numberProtoFuncToPrecision): Ditto.
38846
38847 * kjs/ObjectPrototype.cpp:
38848 (KJS::objectProtoFuncToLocaleString): Adopted toThisJSString.
38849 (KJS::objectProtoFuncToString): Adopted jsNontrivialString.
38850
38851 * kjs/RegExpConstructor.cpp: Separated the lastInput value that's used
38852 with the lastOvector to return matches from the input value that can be
38853 changed via JavaScript. They will be equal in many cases, but not all.
38854 (KJS::RegExpConstructor::performMatch): Set input.
38855 (KJS::RegExpMatchesArray::RegExpMatchesArray): Ditto.
38856 (KJS::RegExpMatchesArray::fillArrayInstance): Adopted jsSubstring. Also,
38857 use input rather than lastInput in the appropriate place.
38858 (KJS::RegExpConstructor::getBackref): Adopted jsSubstring and jsEmptyString.
38859 Added code to handle the case where there is no backref -- before this
38860 depended on range checking in UString::substr which is not present in
38861 jsSubstring.
38862 (KJS::RegExpConstructor::getLastParen): Ditto.
38863 (KJS::RegExpConstructor::getLeftContext): Ditto.
38864 (KJS::RegExpConstructor::getRightContext): Ditto.
38865 (KJS::RegExpConstructor::getValueProperty): Use input rather than lastInput.
38866 Also adopt jsEmptyString.
38867 (KJS::RegExpConstructor::putValueProperty): Ditto.
38868 (KJS::RegExpConstructor::input): Ditto.
38869
38870 * kjs/RegExpPrototype.cpp:
38871 (KJS::regExpProtoFuncToString): Adopt jsNonTrivialString. Also changed to
38872 use UString::append to append single characters rather than using += and
38873 a C-style string.
38874
38875 * kjs/SmallStrings.cpp: Added.
38876 (KJS::SmallStringsStorage::SmallStringsStorage): Construct the
38877 buffer and UString::Rep for all 256 single-character strings for
38878 the U+0000 through U+00FF. This covers all the values used in
38879 the base64 test as well as most values seen elsewhere on the web
38880 as well. It's possible that later we might fix this to only work
38881 for U+0000 through U+007F but the others are used quite a bit in
38882 the current version of the base64 test.
38883 (KJS::SmallStringsStorage::~SmallStringsStorage): Free memory.
38884 (KJS::SmallStrings::SmallStrings): Create a set of small strings,
38885 initially not created; created later when they are used.
38886 (KJS::SmallStrings::~SmallStrings): Deallocate. Not left compiler
38887 generated because the SmallStringsStorage class's destructor needs
38888 to be visible.
38889 (KJS::SmallStrings::mark): Mark all the strings.
38890 (KJS::SmallStrings::createEmptyString): Create a cell for the
38891 empty string. Called only the first time.
38892 (KJS::SmallStrings::createSingleCharacterString): Create a cell
38893 for one of the single-character strings. Called only the first time.
38894 * kjs/SmallStrings.h: Added.
38895
38896 * kjs/StringConstructor.cpp:
38897 (KJS::stringFromCharCodeSlowCase): Factored out of strinFromCharCode.
38898 Only used for cases where the caller does not pass exactly one argument.
38899 (KJS::stringFromCharCode): Adopted jsSingleCharacterString.
38900 (KJS::callStringConstructor): Adopted jsEmptyString.
38901
38902 * kjs/StringObject.cpp:
38903 (KJS::StringObject::StringObject): Adopted jsEmptyString.
38904
38905 * kjs/StringPrototype.cpp:
38906 (KJS::stringProtoFuncReplace): Adopted jsSubstring.
38907 (KJS::stringProtoFuncCharAt): Adopted jsEmptyString and
38908 jsSingleCharacterSubstring and also added a special case when the
38909 index is an immediate number to avoid conversion to and from floating
38910 point, since that's the common case.
38911 (KJS::stringProtoFuncCharCodeAt): Ditto.
38912 (KJS::stringProtoFuncMatch): Adopted jsSubstring and jsEmptyString.
38913 (KJS::stringProtoFuncSlice): Adopted jsSubstring and
38914 jsSingleCharacterSubstring. Also got rid of some unneeded locals and
38915 removed unneeded code to set the length property of the array, since it
38916 is automatically updated as values are added to the array.
38917 (KJS::stringProtoFuncSplit): Adopted jsEmptyString.
38918 (KJS::stringProtoFuncSubstr): Adopted jsSubstring.
38919 (KJS::stringProtoFuncSubstring): Ditto.
38920
38921 * kjs/collector.cpp:
38922 (KJS::Heap::collect): Added a call to mark SmallStrings.
38923
38924 * kjs/ustring.cpp:
38925 (KJS::UString::expandedSize): Made this a static member function since
38926 it doesn't need to look at any data members.
38927 (KJS::UString::expandCapacity): Use a non-inline function, makeNull, to
38928 set the rep to null in failure cases. This avoids adding a PIC branch for
38929 the normal case when there is no failure.
38930 (KJS::UString::expandPreCapacity): Ditto.
38931 (KJS::UString::UString): Ditto.
38932 (KJS::concatenate): Refactored the concatenation constructor into this
38933 separate function. Calling the concatenation constructor was leading to
38934 an extra branch because of the in-charge vs. not-in-charge versions not
38935 both being inlined, and this was showing up as nearly 1% on Shark. Also
38936 added a special case for when the second string is a single character,
38937 since it's a common idiom to build up a string that way and we can do
38938 things much more quickly, without involving memcpy for example. Also
38939 adopted the non-inline function, nullRep, for the same reason given for
38940 makeNull above.
38941 (KJS::UString::append): Adopted makeNull for failure cases.
38942 (KJS::UString::operator=): Ditto.
38943 (KJS::UString::toDouble): Added a special case for converting single
38944 character strings to numbers. We're doing this a ton of times while
38945 running the base64 test.
38946 (KJS::operator==): Added special cases so we can compare single-character
38947 strings without calling memcmp. Later we might want to special case other
38948 short lengths similarly.
38949 (KJS::UString::makeNull): Added.
38950 (KJS::UString::nullRep): Added.
38951 * kjs/ustring.h: Added declarations for the nullRep and makeNull. Changed
38952 expandedSize to be a static member function. Added a declaration of the
38953 concatenate function. Removed the concatenation constructor. Rewrote
38954 operator+ to use the concatenate function.
38955
38956 2008-08-29 Anders Carlsson <andersca@apple.com>
38957
38958 Build fix.
38959
38960 * VM/Machine.cpp:
38961 (KJS::getCPUTime):
38962
38963 2008-08-29 Anders Carlsson <andersca@apple.com>
38964
38965 Reviewed by Darin Adler.
38966
38967 <rdar://problem/6174667>
38968 When a machine is under heavy load, the Slow Script dialog often comes up many times and just gets in the way
38969
38970 Instead of using clock time, use the CPU time spent executing the current thread when
38971 determining if the script has been running for too long.
38972
38973 * VM/Machine.cpp:
38974 (KJS::getCPUTime):
38975 (KJS::Machine::checkTimeout):
38976
38977 2008-08-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
38978
38979 Rubber-stamped by Sam Weinig.
38980
38981 Change 'term' to 'expr' in variable names to standardize terminology.
38982
38983 * kjs/nodes.cpp:
38984 (KJS::BinaryOpNode::emitCode):
38985 (KJS::ReverseBinaryOpNode::emitCode):
38986 (KJS::ThrowableBinaryOpNode::emitCode):
38987 * kjs/nodes.h:
38988 (KJS::BinaryOpNode::BinaryOpNode):
38989 (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
38990 (KJS::MultNode::):
38991 (KJS::DivNode::):
38992 (KJS::ModNode::):
38993 (KJS::AddNode::):
38994 (KJS::SubNode::):
38995 (KJS::LeftShiftNode::):
38996 (KJS::RightShiftNode::):
38997 (KJS::UnsignedRightShiftNode::):
38998 (KJS::LessNode::):
38999 (KJS::GreaterNode::):
39000 (KJS::LessEqNode::):
39001 (KJS::GreaterEqNode::):
39002 (KJS::ThrowableBinaryOpNode::):
39003 (KJS::InstanceOfNode::):
39004 (KJS::InNode::):
39005 (KJS::EqualNode::):
39006 (KJS::NotEqualNode::):
39007 (KJS::StrictEqualNode::):
39008 (KJS::NotStrictEqualNode::):
39009 (KJS::BitAndNode::):
39010 (KJS::BitOrNode::):
39011 (KJS::BitXOrNode::):
39012 * kjs/nodes2string.cpp:
39013 (KJS::MultNode::streamTo):
39014 (KJS::DivNode::streamTo):
39015 (KJS::ModNode::streamTo):
39016 (KJS::AddNode::streamTo):
39017 (KJS::SubNode::streamTo):
39018 (KJS::LeftShiftNode::streamTo):
39019 (KJS::RightShiftNode::streamTo):
39020 (KJS::UnsignedRightShiftNode::streamTo):
39021 (KJS::LessNode::streamTo):
39022 (KJS::GreaterNode::streamTo):
39023 (KJS::LessEqNode::streamTo):
39024 (KJS::GreaterEqNode::streamTo):
39025 (KJS::InstanceOfNode::streamTo):
39026 (KJS::InNode::streamTo):
39027 (KJS::EqualNode::streamTo):
39028 (KJS::NotEqualNode::streamTo):
39029 (KJS::StrictEqualNode::streamTo):
39030 (KJS::NotStrictEqualNode::streamTo):
39031 (KJS::BitAndNode::streamTo):
39032 (KJS::BitXOrNode::streamTo):
39033 (KJS::BitOrNode::streamTo):
39034
39035 2008-08-28 Alp Toker <alp@nuanti.com>
39036
39037 GTK+ dist/build fix. List newly added header files.
39038
39039 * GNUmakefile.am:
39040
39041 2008-08-28 Sam Weinig <sam@webkit.org>
39042
39043 Reviewed by Oliver Hunt.
39044
39045 Change to throw a ReferenceError at runtime instead of a ParseError
39046 at parse time, when the left hand side expression of a for-in statement
39047 is not an lvalue.
39048
39049 * kjs/grammar.y:
39050 * kjs/nodes.cpp:
39051 (KJS::ForInNode::emitCode):
39052
39053 2008-08-28 Alexey Proskuryakov <ap@webkit.org>
39054
39055 Not reviewed, build fix (at least for OpenBSD, posssibly more).
39056
39057 https://bugs.webkit.org/show_bug.cgi?id=20545
39058 missing #include <unistd.h> in JavaScriptCore/VM/SamplingTool.cpp
39059
39060 * VM/SamplingTool.cpp: add the missing include.
39061
39062 2008-08-26 Kevin McCullough <kmccullough@apple.com>
39063
39064 Reviewed by Geoff and Cameron.
39065
39066 <rdar://problem/6174603> Hitting assertion in Register::codeBlock when
39067 loading facebook (20516).
39068
39069 - This was a result of my line numbers change. After a host function is
39070 called the stack does not get reset correctly.
39071 - Oddly this also appears to be a slight speedup on SunSpider.
39072
39073 * VM/Machine.cpp:
39074 (KJS::Machine::privateExecute):
39075
39076 2008-08-26 Alexey Proskuryakov <ap@webkit.org>
39077
39078 Reviewed by Geoff and Tim.
39079
39080 Export new API methods.
39081
39082 * JavaScriptCore.exp:
39083
39084 2008-08-25 Kevin McCullough <kmccullough@apple.com>
39085
39086 Reviewed by Geoff, Tim and Mark.
39087
39088 <rdar://problem/6150623> JSProfiler: It would be nice if the profiles
39089 in the console said what file and line number they came from
39090 - Lay the foundation for getting line numbers and other data from the
39091 JavaScript engine. With the cleanup in kjs/ExecState this is actually
39092 a slight performance improvement.
39093
39094 * JavaScriptCore.exp: Export retrieveLastCaller() for WebCore.
39095 * JavaScriptCore.xcodeproj/project.pbxproj:
39096 * VM/Machine.cpp: Now Host and JS functions set a call frame on the
39097 exec state, so this and the profiler code were pulled out of the
39098 branches.
39099 (KJS::Machine::privateExecute):
39100 (KJS::Machine::retrieveLastCaller): This get's the lineNumber, sourceID
39101 and sourceURL for the previously called function.
39102 * VM/Machine.h:
39103 * kjs/ExecState.cpp: Remove references to JSFunction since it's not used
39104 anywhere.
39105 * kjs/ExecState.h:
39106
39107 2008-08-25 Alexey Proskuryakov <ap@webkit.org>
39108
39109 Reviewed by Darin Adler.
39110
39111 Ensure that JSGlobalContextRelease() performs garbage collection, even if there are other
39112 contexts in the current context's group.
39113
39114 This is only really necessary when the last reference is released, but there is no way to
39115 determine that, and no harm in collecting slightly more often.
39116
39117 * API/JSContextRef.cpp: (JSGlobalContextRelease): Explicitly collect the heap if it is not
39118 being destroyed.
39119
39120 2008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39121
39122 Reviewed by Oliver Hunt.
39123
39124 Bug 20093: JSC shell does not clear exceptions after it executes toString on an expression
39125 <https://bugs.webkit.org/show_bug.cgi?id=20093>
39126
39127 Clear exceptions after evaluating any code in the JSC shell. We do not
39128 report exceptions that are caused by calling toString on the final
39129 valued, but at least we avoid incorrect behaviour.
39130
39131 Also, print any exceptions that occurred while evaluating code at the
39132 interactive prompt, not just while evaluating code from a file.
39133
39134 * kjs/Shell.cpp:
39135 (runWithScripts):
39136 (runInteractive):
39137
39138 2008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39139
39140 Reviewed by Oliver.
39141
39142 Remove an unnecessary RefPtr to a RegisterID.
39143
39144 * kjs/nodes.cpp:
39145 (KJS::DeleteBracketNode::emitCode):
39146
39147 2008-08-24 Mark Rowe <mrowe@apple.com>
39148
39149 Reviewed by Oliver Hunt.
39150
39151 Use the correct version number for when JSGlobalContextCreate was introduced.
39152
39153 * API/JSContextRef.h:
39154
39155 2008-08-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39156
39157 Rubber-stamped by Mark Rowe.
39158
39159 Remove modelines.
39160
39161 * API/APICast.h:
39162 * API/JSBase.cpp:
39163 * API/JSCallbackConstructor.cpp:
39164 * API/JSCallbackConstructor.h:
39165 * API/JSCallbackFunction.cpp:
39166 * API/JSCallbackFunction.h:
39167 * API/JSCallbackObject.cpp:
39168 * API/JSCallbackObject.h:
39169 * API/JSCallbackObjectFunctions.h:
39170 * API/JSClassRef.cpp:
39171 * API/JSContextRef.cpp:
39172 * API/JSObjectRef.cpp:
39173 * API/JSProfilerPrivate.cpp:
39174 * API/JSStringRef.cpp:
39175 * API/JSStringRefBSTR.cpp:
39176 * API/JSStringRefCF.cpp:
39177 * API/JSValueRef.cpp:
39178 * API/tests/JSNode.c:
39179 * API/tests/JSNode.h:
39180 * API/tests/JSNodeList.c:
39181 * API/tests/JSNodeList.h:
39182 * API/tests/Node.c:
39183 * API/tests/Node.h:
39184 * API/tests/NodeList.c:
39185 * API/tests/NodeList.h:
39186 * API/tests/minidom.c:
39187 * API/tests/minidom.js:
39188 * API/tests/testapi.c:
39189 * API/tests/testapi.js:
39190 * JavaScriptCore.pro:
39191 * kjs/FunctionConstructor.h:
39192 * kjs/FunctionPrototype.h:
39193 * kjs/JSArray.h:
39194 * kjs/JSString.h:
39195 * kjs/JSWrapperObject.cpp:
39196 * kjs/NumberConstructor.h:
39197 * kjs/NumberObject.h:
39198 * kjs/NumberPrototype.h:
39199 * kjs/lexer.h:
39200 * kjs/lookup.h:
39201 * wtf/Assertions.cpp:
39202 * wtf/Assertions.h:
39203 * wtf/HashCountedSet.h:
39204 * wtf/HashFunctions.h:
39205 * wtf/HashIterators.h:
39206 * wtf/HashMap.h:
39207 * wtf/HashSet.h:
39208 * wtf/HashTable.h:
39209 * wtf/HashTraits.h:
39210 * wtf/ListHashSet.h:
39211 * wtf/ListRefPtr.h:
39212 * wtf/Noncopyable.h:
39213 * wtf/OwnArrayPtr.h:
39214 * wtf/OwnPtr.h:
39215 * wtf/PassRefPtr.h:
39216 * wtf/Platform.h:
39217 * wtf/RefPtr.h:
39218 * wtf/RefPtrHashMap.h:
39219 * wtf/RetainPtr.h:
39220 * wtf/UnusedParam.h:
39221 * wtf/Vector.h:
39222 * wtf/VectorTraits.h:
39223 * wtf/unicode/Unicode.h:
39224 * wtf/unicode/icu/UnicodeIcu.h:
39225
39226 2008-08-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39227
39228 Reviewed by Oliver.
39229
39230 Some cleanup to match our coding style.
39231
39232 * VM/CodeGenerator.h:
39233 * VM/Machine.cpp:
39234 (KJS::Machine::privateExecute):
39235 * kjs/ExecState.cpp:
39236 * kjs/ExecState.h:
39237 * kjs/completion.h:
39238 * kjs/identifier.cpp:
39239 (KJS::Identifier::equal):
39240 (KJS::CStringTranslator::hash):
39241 (KJS::CStringTranslator::equal):
39242 (KJS::CStringTranslator::translate):
39243 (KJS::UCharBufferTranslator::equal):
39244 (KJS::UCharBufferTranslator::translate):
39245 (KJS::Identifier::remove):
39246 * kjs/operations.h:
39247
39248 2008-08-20 Alexey Proskuryakov <ap@webkit.org>
39249
39250 Windows build fix.
39251
39252 * API/WebKitAvailability.h: Define DEPRECATED_ATTRIBUTE.
39253
39254 2008-08-19 Alexey Proskuryakov <ap@webkit.org>
39255
39256 Reviewed by Geoff Garen.
39257
39258 Bring back shared JSGlobalData and implicit locking, because too many clients rely on it.
39259
39260 * kjs/JSGlobalData.cpp:
39261 (KJS::JSGlobalData::~JSGlobalData):
39262 (KJS::JSGlobalData::JSGlobalData): Re-add shared instance.
39263 (KJS::JSGlobalData::sharedInstanceExists): Ditto.
39264 (KJS::JSGlobalData::sharedInstance): Ditto.
39265 (KJS::JSGlobalData::sharedInstanceInternal): Ditto.
39266
39267 * API/JSContextRef.h: Deprecated JSGlobalContextCreate(). Added a very conservative
39268 description of its threading model (nothing is allowed).
39269
39270 * API/JSContextRef.cpp:
39271 (JSGlobalContextCreate): Use shared JSGlobalData.
39272 (JSGlobalContextCreateInGroup): Support passing NULL group to request a unique one.
39273 (JSGlobalContextRetain): Added back locking.
39274 (JSGlobalContextRelease): Ditto.
39275 (JSContextGetGlobalObject): Ditto.
39276
39277 * API/tests/minidom.c: (main):
39278 * API/tests/testapi.c: (main):
39279 Switched to JSGlobalContextCreateInGroup() to avoid deprecation warnings.
39280
39281 * JavaScriptCore.exp: Re-added JSLock methods. Added JSGlobalContextCreateInGroup (d'oh!).
39282
39283 * API/JSBase.cpp:
39284 (JSEvaluateScript):
39285 (JSCheckScriptSyntax):
39286 (JSGarbageCollect):
39287 * API/JSCallbackConstructor.cpp:
39288 (KJS::constructJSCallback):
39289 * API/JSCallbackFunction.cpp:
39290 (KJS::JSCallbackFunction::call):
39291 * API/JSCallbackObjectFunctions.h:
39292 (KJS::::init):
39293 (KJS::::getOwnPropertySlot):
39294 (KJS::::put):
39295 (KJS::::deleteProperty):
39296 (KJS::::construct):
39297 (KJS::::hasInstance):
39298 (KJS::::call):
39299 (KJS::::getPropertyNames):
39300 (KJS::::toNumber):
39301 (KJS::::toString):
39302 (KJS::::staticValueGetter):
39303 (KJS::::callbackGetter):
39304 * API/JSObjectRef.cpp:
39305 (JSObjectMake):
39306 (JSObjectMakeFunctionWithCallback):
39307 (JSObjectMakeConstructor):
39308 (JSObjectMakeFunction):
39309 (JSObjectHasProperty):
39310 (JSObjectGetProperty):
39311 (JSObjectSetProperty):
39312 (JSObjectGetPropertyAtIndex):
39313 (JSObjectSetPropertyAtIndex):
39314 (JSObjectDeleteProperty):
39315 (JSObjectCallAsFunction):
39316 (JSObjectCallAsConstructor):
39317 (JSObjectCopyPropertyNames):
39318 (JSPropertyNameArrayRelease):
39319 (JSPropertyNameAccumulatorAddName):
39320 * API/JSValueRef.cpp:
39321 (JSValueIsEqual):
39322 (JSValueIsInstanceOfConstructor):
39323 (JSValueMakeNumber):
39324 (JSValueMakeString):
39325 (JSValueToNumber):
39326 (JSValueToStringCopy):
39327 (JSValueToObject):
39328 (JSValueProtect):
39329 (JSValueUnprotect):
39330 * ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
39331 * GNUmakefile.am:
39332 * JavaScriptCore.pri:
39333 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
39334 * JavaScriptCore.xcodeproj/project.pbxproj:
39335 * JavaScriptCoreSources.bkl:
39336 * kjs/AllInOneFile.cpp:
39337 * kjs/JSGlobalData.h:
39338 * kjs/JSGlobalObject.cpp:
39339 (KJS::JSGlobalObject::~JSGlobalObject):
39340 (KJS::JSGlobalObject::init):
39341 * kjs/JSLock.cpp: Added.
39342 (KJS::createJSLockCount):
39343 (KJS::JSLock::lockCount):
39344 (KJS::setLockCount):
39345 (KJS::JSLock::JSLock):
39346 (KJS::JSLock::lock):
39347 (KJS::JSLock::unlock):
39348 (KJS::JSLock::currentThreadIsHoldingLock):
39349 (KJS::JSLock::DropAllLocks::DropAllLocks):
39350 (KJS::JSLock::DropAllLocks::~DropAllLocks):
39351 * kjs/JSLock.h: Added.
39352 (KJS::JSLock::JSLock):
39353 (KJS::JSLock::~JSLock):
39354 * kjs/Shell.cpp:
39355 (functionGC):
39356 (jscmain):
39357 * kjs/collector.cpp:
39358 (KJS::Heap::~Heap):
39359 (KJS::Heap::heapAllocate):
39360 (KJS::Heap::setGCProtectNeedsLocking):
39361 (KJS::Heap::protect):
39362 (KJS::Heap::unprotect):
39363 (KJS::Heap::collect):
39364 * kjs/identifier.cpp:
39365 * kjs/interpreter.cpp:
39366 (KJS::Interpreter::checkSyntax):
39367 (KJS::Interpreter::evaluate):
39368 Re-added implicit locking.
39369
39370 2008-08-19 Kevin McCullough <kmccullough@apple.com>
39371
39372 Reviewed by Tim and Mark.
39373
39374 Implement DTrace hooks for dashcode and instruments.
39375
39376 * API/JSProfilerPrivate.cpp: Added. Expose SPI so that profiling can be
39377 turned on from a client. The DTrace probes were added within the
39378 profiler mechanism for performance reasons so the profiler must be
39379 started to enable tracing.
39380 (JSStartProfiling):
39381 (JSEndProfiling):
39382 * API/JSProfilerPrivate.h: Added. Ditto.
39383 * JavaScriptCore.exp: Exposing the start/stop methods to clients.
39384 * JavaScriptCore.xcodeproj/project.pbxproj:
39385 * kjs/Tracing.d: Define the DTrace probes.
39386 * kjs/Tracing.h: Ditto.
39387 * profiler/ProfileGenerator.cpp: Implement the DTrace probes in the
39388 profiler.
39389 (KJS::ProfileGenerator::willExecute):
39390 (KJS::ProfileGenerator::didExecute):
39391
39392 2008-08-19 Steve Falkenburg <sfalken@apple.com>
39393
39394 Build fix.
39395
39396 * kjs/operations.cpp:
39397 (KJS::equal):
39398
39399 2008-08-18 Timothy Hatcher <timothy@apple.com>
39400
39401 Fix an assertion when generating a heavy profile because the
39402 empty value and deleted value of CallIdentifier where equal.
39403
39404 https://bugs.webkit.org/show_bug.cgi?id=20439
39405
39406 Reviewed by Dan Bernstein.
39407
39408 * profiler/CallIdentifier.h: Make the emptyValue for CallIdentifier
39409 use empty strings for URL and function name.
39410
39411 2008-08-12 Darin Adler <darin@apple.com>
39412
39413 Reviewed by Geoff.
39414
39415 - eliminate JSValue::type()
39416
39417 This will make it slightly easier to change the JSImmediate design without
39418 having to touch so many call sites.
39419
39420 SunSpider says this change is a wash (looked like a slight speedup, but not
39421 statistically significant).
39422
39423 * API/JSStringRef.cpp: Removed include of JSType.h.
39424 * API/JSValueRef.cpp: Removed include of JSType.h.
39425 (JSValueGetType): Replaced use of JSValue::type() with
39426 JSValue::is functions.
39427
39428 * JavaScriptCore.exp: Updated.
39429
39430 * VM/JSPropertyNameIterator.cpp: Removed type() implementation.
39431 (KJS::JSPropertyNameIterator::toPrimitive): Changed to take
39432 PreferredPrimitiveType argument instead of JSType.
39433 * VM/JSPropertyNameIterator.h: Ditto.
39434
39435 * VM/Machine.cpp:
39436 (KJS::fastIsNumber): Updated for name change.
39437 (KJS::fastToInt32): Ditto.
39438 (KJS::fastToUInt32): Ditto.
39439 (KJS::jsAddSlowCase): Updated toPrimitive caller for change from
39440 JSType to PreferredPrimitiveType.
39441 (KJS::jsAdd): Replaced calls to JSValue::type() with calls to
39442 JSValue::isString().
39443 (KJS::jsTypeStringForValue): Replaced calls to JSValue::type()
39444 with multiple calls to JSValue::is -- we could make this a
39445 virtual function instead if we want to have faster performance.
39446 (KJS::Machine::privateExecute): Renamed JSImmediate::toTruncatedUInt32
39447 to JSImmediate::getTruncatedUInt32 for consistency with other functions.
39448 Changed two calls of JSValue::type() to JSValue::isString().
39449
39450 * kjs/GetterSetter.cpp:
39451 (KJS::GetterSetter::toPrimitive): Changed to take
39452 PreferredPrimitiveType argument instead of JSType.
39453 (KJS::GetterSetter::isGetterSetter): Added.
39454 * kjs/GetterSetter.h:
39455
39456 * kjs/JSCell.cpp:
39457 (KJS::JSCell::isString): Added.
39458 (KJS::JSCell::isGetterSetter): Added.
39459 (KJS::JSCell::isObject): Added.
39460
39461 * kjs/JSCell.h: Eliminated type function. Added isGetterSetter.
39462 Made isString and isObject virtual. Changed toPrimitive to take
39463 PreferredPrimitiveType argument instead of JSType.
39464 (KJS::JSCell::isNumber): Use Heap::isNumber for faster performance.
39465 (KJS::JSValue::isGetterSetter): Added.
39466 (KJS::JSValue::toPrimitive): Changed to take
39467 PreferredPrimitiveType argument instead of JSType.
39468
39469 * kjs/JSImmediate.h: Removed JSValue::type() and replaced
39470 JSValue::toTruncatedUInt32 with JSValue::getTruncatedUInt32.
39471 (KJS::JSImmediate::isEitherImmediate): Added.
39472
39473 * kjs/JSNotAnObject.cpp:
39474 (KJS::JSNotAnObject::toPrimitive): Changed to take
39475 PreferredPrimitiveType argument instead of JSType.
39476 * kjs/JSNotAnObject.h: Ditto.
39477 * kjs/JSNumberCell.cpp:
39478 (KJS::JSNumberCell::toPrimitive): Ditto.
39479 * kjs/JSNumberCell.h:
39480 (KJS::JSNumberCell::toInt32): Renamed from fastToInt32. There's no
39481 other "slow" version of this once you have a JSNumberCell, so there's
39482 no need for "fast" in the name. It's a feature that this hides the
39483 base class toInt32, which does the same job less efficiently (and has
39484 an additional ExecState argument).
39485 (KJS::JSNumberCell::toUInt32): Ditto.
39486
39487 * kjs/JSObject.cpp:
39488 (KJS::callDefaultValueFunction): Use isGetterSetter instead of type.
39489 (KJS::JSObject::getPrimitiveNumber): Use PreferredPrimitiveType.
39490 (KJS::JSObject::defaultValue): Ditto.
39491 (KJS::JSObject::defineGetter): Use isGetterSetter.
39492 (KJS::JSObject::defineSetter): Ditto.
39493 (KJS::JSObject::lookupGetter): Ditto.
39494 (KJS::JSObject::lookupSetter): Ditto.
39495 (KJS::JSObject::toNumber): Use PreferredPrimitiveType.
39496 (KJS::JSObject::toString): Ditto.
39497 (KJS::JSObject::isObject): Added.
39498
39499 * kjs/JSObject.h:
39500 (KJS::JSObject::inherits): Call the isObject from JSCell; it's now
39501 hidden by our override of isObject.
39502 (KJS::JSObject::getOwnPropertySlotForWrite): Use isGetterSetter
39503 instead of type.
39504 (KJS::JSObject::getOwnPropertySlot): Ditto.
39505 (KJS::JSObject::toPrimitive): Use PreferredPrimitiveType.
39506
39507 * kjs/JSString.cpp:
39508 (KJS::JSString::toPrimitive): Use PreferredPrimitiveType.
39509 (KJS::JSString::isString): Added.
39510 * kjs/JSString.h: Ditto.
39511
39512 * kjs/JSValue.h: Removed type(), added isGetterSetter(). Added
39513 PreferredPrimitiveType enum and used it as the argument for the
39514 toPrimitive function.
39515 (KJS::JSValue::getBoolean): Simplified a bit an removed a branch.
39516
39517 * kjs/collector.cpp:
39518 (KJS::typeName): Changed to use JSCell::is functions instead of
39519 calling JSCell::type.
39520
39521 * kjs/collector.h:
39522 (KJS::Heap::isNumber): Renamed from fastIsNumber.
39523
39524 * kjs/nodes.h: Added now-needed include of JSType, since the type
39525 is used here to record types of values in the tree.
39526
39527 * kjs/operations.cpp:
39528 (KJS::equal): Rewrote to no longer depend on type().
39529 (KJS::strictEqual): Ditto.
39530
39531 2008-08-18 Kevin McCullough <kmccullough@apple.com>
39532
39533 Reviewed by Tim.
39534
39535 If there are no nodes in a profile all the time should be attributed to
39536 (idle)
39537
39538 * profiler/Profile.cpp: If ther are no nodes make sure we still process
39539 the head.
39540 (KJS::Profile::forEach):
39541 * profiler/ProfileGenerator.cpp: Remove some useless code.
39542 (KJS::ProfileGenerator::stopProfiling):
39543
39544 2008-08-18 Alexey Proskuryakov <ap@webkit.org>
39545
39546 Reviewed by Maciej.
39547
39548 Make JSGlobalContextRetain/Release actually work.
39549
39550 * API/JSContextRef.cpp:
39551 (JSGlobalContextRetain):
39552 (JSGlobalContextRelease):
39553 Ref/deref global data to give checking for globalData.refCount() some sense.
39554
39555 * API/tests/testapi.c: (main): Added a test for this bug.
39556
39557 * kjs/JSGlobalData.cpp:
39558 (KJS::JSGlobalData::~JSGlobalData):
39559 While checking for memory leaks, found that JSGlobalData::emptyList has changed to
39560 a pointer, but it was not destructed, causing a huge leak in run-webkit-tests --threaded.
39561
39562 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39563
39564 Reviewed by Maciej.
39565
39566 Change the counting of constants so that preincrement and predecrement of
39567 const local variables are considered unexpected loads.
39568
39569 * kjs/nodes.cpp:
39570 (KJS::PrefixResolveNode::emitCode):
39571 * kjs/nodes.h:
39572 (KJS::ScopeNode::neededConstants):
39573
39574 2008-08-17 Oliver Hunt <oliver@apple.com>
39575
39576 Reviewed by Cameron Zwarich.
39577
39578 <rdar://problem/6150322> In Gmail, a crash occurs at KJS::Machine::privateExecute() when applying list styling to text after a quote had been removed
39579 <https://bugs.webkit.org/show_bug.cgi?id=20386>
39580
39581 This crash was caused by "depth()" incorrectly determining the scope depth
39582 of a 0 depth function without a full scope chain. Because such a function
39583 would not have an activation the depth function would return the scope depth
39584 of the parent frame, thus triggering an incorrect unwind. Any subsequent
39585 look up that walked the scope chain would result in incorrect behaviour,
39586 leading to a crash or incorrect variable resolution. This can only actually
39587 happen in try...finally statements as that's the only path that can result in
39588 the need to unwind the scope chain, but not force the function to need a
39589 full scope chain.
39590
39591 The fix is simply to check for this case before attempting to walk the scope chain.
39592
39593 * VM/Machine.cpp:
39594 (KJS::depth):
39595 (KJS::Machine::throwException):
39596
39597 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39598
39599 Reviewed by Maciej.
39600
39601 Bug 20419: Remove op_jless
39602 <https://bugs.webkit.org/show_bug.cgi?id=20419>
39603
39604 Remove op_jless, which is rarely used now that we have op_loop_if_less.
39605
39606 * VM/CodeBlock.cpp:
39607 (KJS::CodeBlock::dump):
39608 * VM/CodeGenerator.cpp:
39609 (KJS::CodeGenerator::emitJumpIfTrue):
39610 * VM/Machine.cpp:
39611 (KJS::Machine::privateExecute):
39612 * VM/Opcode.h:
39613
39614 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
39615
39616 Reviewed by Dan Bernstein.
39617
39618 Fix a typo in r35807 that is also causing build failures for
39619 non-AllInOne builds.
39620
39621 * kjs/NumberConstructor.cpp:
39622
39623 2008-08-17 Geoffrey Garen <ggaren@apple.com>
39624
39625 Reviewed by Cameron Zwarich.
39626
39627 Made room for a free word in JSCell.
39628
39629 SunSpider says no change.
39630
39631 I changed JSCallbackObjectData, Arguments, JSArray, and RegExpObject to
39632 store auxiliary data in a secondary structure.
39633
39634 I changed InternalFunction to store the function's name in the property
39635 map.
39636
39637 I changed JSGlobalObjectData to use a virtual destructor, so WebCore's
39638 JSDOMWindowBaseData could inherit from it safely. (It's a strange design
39639 for JSDOMWindowBase to allocate an object that JSGlobalObject deletes,
39640 but that's really our only option, given the size constraint.)
39641
39642 I also added a bunch of compile-time ASSERTs, and removed lots of comments
39643 in JSObject.h because they were often out of date, and they got in the
39644 way of reading what was actually going on.
39645
39646 Also renamed JSArray::getLength to JSArray::length, to match our style
39647 guidelines.
39648
39649 2008-08-16 Geoffrey Garen <ggaren@apple.com>
39650
39651 Reviewed by Oliver Hunt.
39652
39653 Sped up property access for array.length and string.length by adding a
39654 mechanism for returning a temporary value directly instead of returning
39655 a pointer to a function that retrieves the value.
39656
39657 Also removed some unused cruft from PropertySlot.
39658
39659 SunSpider says 0.5% - 1.2% faster.
39660
39661 NOTE: This optimization is not a good idea in general, because it's
39662 actually a pessimization in the case of resolve for assignment,
39663 and it may get in the way of other optimizations in the future.
39664
39665 2008-08-16 Dan Bernstein <mitz@apple.com>
39666
39667 Reviewed by Geoffrey Garen.
39668
39669 Disable dead code stripping in debug builds.
39670
39671 * Configurations/Base.xcconfig:
39672 * JavaScriptCore.xcodeproj/project.pbxproj:
39673
39674 2008-08-15 Mark Rowe <mrowe@apple.com>
39675
39676 Reviewed by Oliver Hunt.
39677
39678 <rdar://problem/6143072> FastMallocZone's enumeration code makes assumptions about handling of remote memory regions that overlap
39679
39680 * wtf/FastMalloc.cpp:
39681 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Don't directly compare pointers mapped into the local process with
39682 a pointer that has not been mapped. Instead, calculate a local address for the pointer and compare with that.
39683 (WTF::TCMallocStats::FreeObjectFinder::findFreeObjects): Pass in the remote address of the central free list so that it can
39684 be used when calculating local addresses.
39685 (WTF::TCMallocStats::FastMallocZone::enumerate): Ditto.
39686
39687 2008-08-15 Mark Rowe <mrowe@apple.com>
39688
39689 Rubber-stamped by Geoff Garen.
39690
39691 <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework
39692
39693 * Configurations/Base.xcconfig: Factor out the debug-only settings so that they can shared
39694 between the Debug configuration and debug Production variant.
39695 * JavaScriptCore.xcodeproj/project.pbxproj: Enable the debug variant.
39696
39697 2008-08-15 Mark Rowe <mrowe@apple.com>
39698
39699 Fix the 64-bit build.
39700
39701 Add extra cast to avoid warnings about loss of precision when casting from
39702 JSValue* to an integer type.
39703
39704 * kjs/JSImmediate.h:
39705 (KJS::JSImmediate::intValue):
39706 (KJS::JSImmediate::uintValue):
39707
39708 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39709
39710 Still fixing Windows build.
39711
39712 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added OpaqueJSString
39713 to yet another place.
39714
39715 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39716
39717 Trying to fix non-Apple builds.
39718
39719 * ForwardingHeaders/JavaScriptCore/OpaqueJSString.h: Added.
39720
39721 2008-08-15 Gavin Barraclough <barraclough@apple.com>
39722
39723 Reviewed by Geoff Garen.
39724
39725 Allow JSImmediate to hold 31 bit signed integer immediate values. The low two bits of a
39726 JSValue* are a tag, with the tag value 00 indicating the JSValue* is a pointer to a
39727 JSCell. Non-zero tag values used to indicate that the JSValue* is not a real pointer,
39728 but instead holds an immediate value encoded within the pointer. This patch changes the
39729 encoding so both the tag values 01 and 11 indicate the value is a signed integer, allowing
39730 a 31 bit value to be stored. All other immediates are tagged with the value 10, and
39731 distinguished by a secondary tag.
39732
39733 Roughly +2% on SunSpider.
39734
39735 * kjs/JSImmediate.h: Encoding of JSImmediates has changed - see comment at head of file for
39736 descption of new layout.
39737
39738 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39739
39740 More build fixes.
39741
39742 * API/OpaqueJSString.h: Add a namespace to friend declaration to appease MSVC.
39743 * API/JSStringRefCF.h: (JSStringCreateWithCFString) Cast UniChar* to UChar* explicitly.
39744 * JavaScriptCore.exp: Added OpaqueJSString::create(const KJS::UString&) to fix WebCore build.
39745
39746 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39747
39748 Build fix.
39749
39750 * JavaScriptCore.xcodeproj/project.pbxproj: Marked OpaqueJSString as private
39751
39752 * kjs/identifier.cpp:
39753 (KJS::Identifier::checkSameIdentifierTable):
39754 * kjs/identifier.h:
39755 (KJS::Identifier::add):
39756 Since checkSameIdentifierTable is exported for debug build's sake, gcc wants it to be
39757 non-inline in release builds, too.
39758
39759 * JavaScriptCore.exp: Don't export inline OpaqueJSString destructor.
39760
39761 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
39762
39763 Reviewed by Geoff Garen.
39764
39765 JSStringRef is created context-free, but can get linked to one via an identifier table,
39766 breaking an implicit API contract.
39767
39768 Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString.
39769
39770 * API/APICast.h: Removed toRef/toJS conversions for JSStringRef, as this is no longer a
39771 simple typecast.
39772
39773 * kjs/identifier.cpp:
39774 (KJS::Identifier::checkSameIdentifierTable):
39775 * kjs/identifier.h:
39776 (KJS::Identifier::add):
39777 (KJS::UString::checkSameIdentifierTable):
39778 Added assertions to verify that an identifier is not being added to a different JSGlobalData.
39779
39780 * API/JSObjectRef.cpp:
39781 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray): Changed OpaqueJSPropertyNameArray to
39782 hold JSStringRefs. This is necessary to avoid having to construct (and leak) a new instance
39783 in JSPropertyNameArrayGetNameAtIndex(), now that making a JSStringRef is not just a typecast.
39784
39785 * API/OpaqueJSString.cpp: Added.
39786 (OpaqueJSString::create):
39787 (OpaqueJSString::ustring):
39788 (OpaqueJSString::identifier):
39789 * API/OpaqueJSString.h: Added.
39790 (OpaqueJSString::create):
39791 (OpaqueJSString::characters):
39792 (OpaqueJSString::length):
39793 (OpaqueJSString::OpaqueJSString):
39794 (OpaqueJSString::~OpaqueJSString):
39795
39796 * API/JSBase.cpp:
39797 (JSEvaluateScript):
39798 (JSCheckScriptSyntax):
39799 * API/JSCallbackObjectFunctions.h:
39800 (KJS::::getOwnPropertySlot):
39801 (KJS::::put):
39802 (KJS::::deleteProperty):
39803 (KJS::::staticValueGetter):
39804 (KJS::::callbackGetter):
39805 * API/JSStringRef.cpp:
39806 (JSStringCreateWithCharacters):
39807 (JSStringCreateWithUTF8CString):
39808 (JSStringRetain):
39809 (JSStringRelease):
39810 (JSStringGetLength):
39811 (JSStringGetCharactersPtr):
39812 (JSStringGetMaximumUTF8CStringSize):
39813 (JSStringGetUTF8CString):
39814 (JSStringIsEqual):
39815 * API/JSStringRefCF.cpp:
39816 (JSStringCreateWithCFString):
39817 (JSStringCopyCFString):
39818 * API/JSValueRef.cpp:
39819 (JSValueMakeString):
39820 (JSValueToStringCopy):
39821 Updated to use OpaqueJSString.
39822
39823 * GNUmakefile.am:
39824 * JavaScriptCore.exp:
39825 * JavaScriptCore.pri:
39826 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
39827 * JavaScriptCore.xcodeproj/project.pbxproj:
39828 * JavaScriptCoreSources.bkl:
39829 Added OpaqueJSString.
39830
39831 2008-08-14 Kevin McCullough <kmccullough@apple.com>
39832
39833 Reviewed by Tim.
39834
39835 <rdar://problem/6115819> Notify of profile in console
39836 - Profiles now have a unique ID so that they can be linked to the
39837 console message that announces that a profile completed.
39838
39839 * profiler/HeavyProfile.cpp:
39840 (KJS::HeavyProfile::HeavyProfile):
39841 * profiler/Profile.cpp:
39842 (KJS::Profile::create):
39843 (KJS::Profile::Profile):
39844 * profiler/Profile.h:
39845 (KJS::Profile::uid):
39846 * profiler/ProfileGenerator.cpp:
39847 (KJS::ProfileGenerator::create):
39848 (KJS::ProfileGenerator::ProfileGenerator):
39849 * profiler/ProfileGenerator.h:
39850 * profiler/Profiler.cpp:
39851 (KJS::Profiler::startProfiling):
39852 * profiler/TreeProfile.cpp:
39853 (KJS::TreeProfile::create):
39854 (KJS::TreeProfile::TreeProfile):
39855 * profiler/TreeProfile.h:
39856
39857 2008-08-13 Geoffrey Garen <ggaren@apple.com>
39858
39859 Reviewed by Oliver Hunt.
39860
39861 Nixed a PIC branch from JSObject::getOwnPropertySlot, by forcing
39862 fillGetterProperty, which references a global function pointer,
39863 out-of-line.
39864
39865 .2% SunSpider speedup, 4.3% access-nbody speedup, 8.7% speedup on a
39866 custom property access benchmark for objects with one property.
39867
39868 * kjs/JSObject.cpp:
39869 (KJS::JSObject::fillGetterPropertySlot):
39870
39871 2008-08-13 Alp Toker <alp@nuanti.com>
39872
39873 Reviewed by Eric Seidel.
39874
39875 https://bugs.webkit.org/show_bug.cgi?id=20349
39876 WTF::initializeThreading() fails if threading is already initialized
39877
39878 Fix threading initialization logic to support cases where
39879 g_thread_init() has already been called elsewhere.
39880
39881 Resolves database-related crashers reported in several applications.
39882
39883 * wtf/ThreadingGtk.cpp:
39884 (WTF::initializeThreading):
39885
39886 2008-08-13 Brad Hughes <bhughes@trolltech.com>
39887
39888 Reviewed by Simon.
39889
39890 Fix compiling of QtWebKit in release mode with the Intel C++ Compiler for Linux
39891
39892 The latest upgrade of the intel compiler allows us to compile all of
39893 Qt with optimizations enabled (yay!).
39894
39895 * JavaScriptCore.pro:
39896
39897 2008-08-12 Oliver Hunt <oliver@apple.com>
39898
39899 Reviewed by Geoff Garen.
39900
39901 Add peephole optimisation to 'op_not... jfalse...' (eg. if(!...) )
39902
39903 This is a very slight win in sunspider, and a fairly substantial win
39904 in hot code that does if(!...), etc.
39905
39906 * VM/CodeGenerator.cpp:
39907 (KJS::CodeGenerator::retrieveLastUnaryOp):
39908 (KJS::CodeGenerator::rewindBinaryOp):
39909 (KJS::CodeGenerator::rewindUnaryOp):
39910 (KJS::CodeGenerator::emitJumpIfFalse):
39911 * VM/CodeGenerator.h:
39912
39913 2008-08-12 Dan Bernstein <mitz@apple.com>
39914
39915 - JavaScriptCore part of <rdar://problem/6121636>
39916 Make fast*alloc() abort() on failure and add "try" variants that
39917 return NULL on failure.
39918
39919 Reviewed by Darin Adler.
39920
39921 * JavaScriptCore.exp: Exported tryFastCalloc().
39922 * VM/RegisterFile.h:
39923 (KJS::RegisterFile::RegisterFile): Removed an ASSERT().
39924 * kjs/JSArray.cpp:
39925 (KJS::JSArray::putSlowCase): Changed to use tryFastRealloc().
39926 (KJS::JSArray::increaseVectorLength): Ditto.
39927 * kjs/ustring.cpp:
39928 (KJS::allocChars): Changed to use tryFastMalloc().
39929 (KJS::reallocChars): Changed to use tryFastRealloc().
39930 * wtf/FastMalloc.cpp:
39931 (WTF::fastZeroedMalloc): Removed null checking of fastMalloc()'s result
39932 and removed extra call to InvokeNewHook().
39933 (WTF::tryFastZeroedMalloc): Added. Uses tryFastMalloc().
39934 (WTF::tryFastMalloc): Renamed fastMalloc() to this.
39935 (WTF::fastMalloc): Added. This version abort()s if allocation fails.
39936 (WTF::tryFastCalloc): Renamed fastCalloc() to this.
39937 (WTF::fastCalloc): Added. This version abort()s if allocation fails.
39938 (WTF::tryFastRealloc): Renamed fastRealloc() to this.
39939 (WTF::fastRealloc): Added. This version abort()s if allocation fails.
39940 (WTF::do_malloc): Made this a function template. When the abortOnFailure
39941 template parameter is set, the function abort()s on failure to allocate.
39942 Otherwise, it sets errno to ENOMEM and returns zero.
39943 (WTF::TCMallocStats::fastMalloc): Defined to abort() on failure.
39944 (WTF::TCMallocStats::tryFastMalloc): Added. Does not abort() on
39945 failure.
39946 (WTF::TCMallocStats::fastCalloc): Defined to abort() on failure.
39947 (WTF::TCMallocStats::tryFastCalloc): Added. Does not abort() on
39948 failure.
39949 (WTF::TCMallocStats::fastRealloc): Defined to abort() on failure.
39950 (WTF::TCMallocStats::tryFastRealloc): Added. Does not abort() on
39951 failure.
39952 * wtf/FastMalloc.h: Declared the "try" variants.
39953
39954 2008-08-11 Adam Roben <aroben@apple.com>
39955
39956 Move WTF::notFound into its own header so that it can be used
39957 independently of Vector
39958
39959 Rubberstamped by Darin Adler.
39960
39961 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
39962 * JavaScriptCore.xcodeproj/project.pbxproj:
39963 Added NotFound.h to the project.
39964 * wtf/NotFound.h: Added. Moved the notFound constant here...
39965 * wtf/Vector.h: ...from here.
39966
39967 2008-08-11 Alexey Proskuryakov <ap@webkit.org>
39968
39969 Reviewed by Mark Rowe.
39970
39971 <rdar://problem/6130393> REGRESSION: PhotoBooth hangs after launching under TOT Webkit
39972
39973 * API/JSContextRef.cpp: (JSGlobalContextRelease): Corrected a comment.
39974
39975 * kjs/collector.cpp: (KJS::Heap::~Heap): Ensure that JSGlobalData is not deleted while
39976 sweeping the heap.
39977
39978 == Rolled over to ChangeLog-2008-08-10 ==