blob: a3e8cd0e7fe992f888a82682a9916685c1e8fee4 [file] [log] [blame]
commit-queue@webkit.org45974062012-08-15 21:35:55 +000012012-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
2
3 Unreviewed, rolling out r125687.
4 http://trac.webkit.org/changeset/125687
5 https://bugs.webkit.org/show_bug.cgi?id=94147
6
7 It broke the whole world (Requested by Ossy_night on #webkit).
8
9 * API/JSValueRef.cpp:
10 (JSValueToBoolean):
11 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
12 * bytecode/Watchpoint.h:
13 (WatchpointSet):
14 * debugger/DebuggerCallFrame.h:
15 * dfg/DFGAbstractState.cpp:
16 (JSC::DFG::AbstractState::execute):
17 * dfg/DFGCFGSimplificationPhase.cpp:
18 (JSC::DFG::CFGSimplificationPhase::run):
19 * dfg/DFGOperations.cpp:
20 * dfg/DFGOperations.h:
21 * dfg/DFGSpeculativeJIT32_64.cpp:
22 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
23 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
24 (JSC::DFG::SpeculativeJIT::compile):
25 * dfg/DFGSpeculativeJIT64.cpp:
26 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
27 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
28 (JSC::DFG::SpeculativeJIT::compile):
29 * interpreter/Interpreter.cpp:
30 (JSC::Interpreter::privateExecute):
31 * jit/JITOpcodes.cpp:
32 (JSC::JIT::emit_op_is_undefined):
33 (JSC::JIT::emit_op_jeq_null):
34 (JSC::JIT::emit_op_jneq_null):
35 (JSC::JIT::emit_op_eq_null):
36 (JSC::JIT::emit_op_neq_null):
37 * jit/JITOpcodes32_64.cpp:
38 (JSC::JIT::emit_op_is_undefined):
39 (JSC::JIT::emit_op_jeq_null):
40 (JSC::JIT::emit_op_jneq_null):
41 (JSC::JIT::emit_op_eq_null):
42 (JSC::JIT::emit_op_neq_null):
43 * jit/JITStubs.cpp:
44 (JSC::DEFINE_STUB_FUNCTION):
45 * llint/LLIntSlowPaths.cpp:
46 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
47 * llint/LowLevelInterpreter32_64.asm:
48 * llint/LowLevelInterpreter64.asm:
49 * runtime/ArrayPrototype.cpp:
50 (JSC::arrayProtoFuncFilter):
51 (JSC::arrayProtoFuncEvery):
52 (JSC::arrayProtoFuncSome):
53 * runtime/BooleanConstructor.cpp:
54 (JSC::constructBoolean):
55 (JSC::callBooleanConstructor):
56 * runtime/JSCell.h:
57 (JSCell):
58 * runtime/JSGlobalObject.cpp:
59 (JSC::JSGlobalObject::JSGlobalObject):
60 * runtime/JSGlobalObject.h:
61 (JSGlobalObject):
62 * runtime/JSString.h:
63 (JSC::JSCell::toBoolean):
64 (JSC::JSValue::toBoolean):
65 * runtime/JSValue.h:
66 * runtime/ObjectConstructor.cpp:
67 (JSC::toPropertyDescriptor):
68 * runtime/Operations.cpp:
69 (JSC::jsTypeStringForValue):
70 (JSC::jsIsObjectType):
71 * runtime/Operations.h:
72 (JSC):
73 (JSC::JSValue::equalSlowCaseInline):
74 * runtime/RegExpConstructor.cpp:
75 (JSC::setRegExpConstructorMultiline):
76 * runtime/RegExpPrototype.cpp:
77 (JSC::regExpProtoFuncToString):
78 * runtime/Structure.h:
79
commit-queue@webkit.orgb6cc1852012-08-15 21:09:00 +0000802012-08-15 Gabor Ballabas <gaborb@inf.u-szeged.hu>
81
82 Buildfix after r125541
83 https://bugs.webkit.org/show_bug.cgi?id=94097
84
85 Reviewed by Filip Pizlo.
86
87 r125541 has broken the traditional ARM port build of JSC.
88
89 * assembler/MacroAssemblerARM.h:
90 (JSC::MacroAssemblerARM::neg32):
91 (JSC::MacroAssemblerARM::xor32):
92
mhahnenberg@apple.com35d54552012-08-15 18:32:41 +0000932012-08-14 Mark Hahnenberg <mhahnenberg@apple.com>
94
95 Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
96 https://bugs.webkit.org/show_bug.cgi?id=93884
97
98 Reviewed by Geoffrey Garen.
99
100 With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of
101 MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines,
102 we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined
103 objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject).
104 For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not
105 masquerade as undefined within frame B, but it will continue to masquerade in frame A.
106
107 There are two primary changes that are taking place here. One is to thread the ExecState* through
108 JSValue::toBoolean and JSCell::toBoolean so that JSCell::toBoolean can check the object's
109 JSGlobalObject to compare it to the lexical JSGlobalObject of the currently running code. If the two
110 are distinct, then the object cannot MasqueradeAsUndefined.
111
112 The other change is to perform this comparison of JSGlobalObjects everywhere where the MasqueradesAsUndefined
113 flag in the Structure is checked. For C++ code, this check has been factored into its own function in
114 Structure::masqueradesAsUndefined. We only perform this check in the DFG if the current JSGlobalObject has
115 had a MasqueradesAsUndefined object allocated within its context. This conditional compilation is managed
116 through the use of a WatchpointSet in each JSGlobalObject and alternate create() functions for JS DOM wrappers
117 that are MasqueradesAsUndefined.
118
119 * API/JSValueRef.cpp:
120 (JSValueToBoolean):
121 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
122 * bytecode/Watchpoint.h:
123 (WatchpointSet):
124 * debugger/DebuggerCallFrame.h:
125 (JSC::DebuggerCallFrame::callFrame):
126 * dfg/DFGAbstractState.cpp:
127 (JSC::DFG::AbstractState::execute):
128 * dfg/DFGCFGSimplificationPhase.cpp:
129 (JSC::DFG::CFGSimplificationPhase::run):
130 * dfg/DFGOperations.cpp:
131 * dfg/DFGOperations.h:
132 * dfg/DFGSpeculativeJIT32_64.cpp:
133 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
134 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
135 (JSC::DFG::SpeculativeJIT::compile):
136 * dfg/DFGSpeculativeJIT64.cpp:
137 (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
138 (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
139 (JSC::DFG::SpeculativeJIT::compile):
140 * interpreter/Interpreter.cpp:
141 (JSC::Interpreter::privateExecute):
142 * jit/JITOpcodes.cpp:
143 (JSC::JIT::emit_op_is_undefined):
144 (JSC::JIT::emit_op_jeq_null):
145 (JSC::JIT::emit_op_jneq_null):
146 (JSC::JIT::emit_op_eq_null):
147 (JSC::JIT::emit_op_neq_null):
148 * jit/JITOpcodes32_64.cpp:
149 (JSC::JIT::emit_op_is_undefined):
150 (JSC::JIT::emit_op_jeq_null):
151 (JSC::JIT::emit_op_jneq_null):
152 (JSC::JIT::emit_op_eq_null):
153 (JSC::JIT::emit_op_neq_null):
154 * jit/JITStubs.cpp:
155 (JSC::DEFINE_STUB_FUNCTION):
156 * llint/LLIntSlowPaths.cpp:
157 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
158 * llint/LowLevelInterpreter32_64.asm:
159 * llint/LowLevelInterpreter64.asm:
160 * runtime/ArrayPrototype.cpp:
161 (JSC::arrayProtoFuncFilter):
162 (JSC::arrayProtoFuncEvery):
163 (JSC::arrayProtoFuncSome):
164 * runtime/BooleanConstructor.cpp:
165 (JSC::constructBoolean):
166 (JSC::callBooleanConstructor):
167 * runtime/JSCell.h:
168 (JSCell):
169 * runtime/JSGlobalObject.cpp:
170 (JSC::JSGlobalObject::JSGlobalObject):
171 * runtime/JSGlobalObject.h:
172 (JSGlobalObject):
173 (JSC::JSGlobalObject::masqueradesAsUndefinedWatchpoint):
174 * runtime/JSString.h:
175 (JSC::JSCell::toBoolean):
176 (JSC::JSValue::toBoolean):
177 * runtime/JSValue.h:
178 * runtime/ObjectConstructor.cpp:
179 (JSC::toPropertyDescriptor):
180 * runtime/Operations.cpp:
181 (JSC::jsTypeStringForValue):
182 (JSC::jsIsObjectType):
183 * runtime/Operations.h:
184 (JSC):
185 (JSC::JSValue::equalSlowCaseInline):
186 * runtime/RegExpConstructor.cpp:
187 (JSC::setRegExpConstructorMultiline):
188 * runtime/RegExpPrototype.cpp:
189 (JSC::regExpProtoFuncToString):
190 * runtime/Structure.h:
191 (Structure):
192 (JSC::Structure::globalObjectOffset):
193 (JSC::Structure::masqueradesAsUndefined):
194 (JSC):
195
fpizlo@apple.coma0c9a0a2012-08-15 03:10:57 +00001962012-08-14 Filip Pizlo <fpizlo@apple.com>
197
198 Unreviewed, build fix for !ENABLE(DFG_JIT)
199
200 * jit/JITPropertyAccess.cpp:
201 (JSC::JIT::emit_op_get_by_val):
202 (JSC::JIT::emit_op_put_by_val):
203 (JSC::JIT::privateCompilePatchGetArrayLength):
204 * jit/JITPropertyAccess32_64.cpp:
205 (JSC::JIT::emit_op_get_by_val):
206 (JSC::JIT::emit_op_put_by_val):
207 (JSC::JIT::privateCompilePatchGetArrayLength):
208 * llint/LowLevelInterpreter32_64.asm:
209 * llint/LowLevelInterpreter64.asm:
210
fpizlo@apple.comf24804c2012-08-15 02:48:35 +00002112012-08-13 Filip Pizlo <fpizlo@apple.com>
212
213 Array checks should use the structure, not the class info
214 https://bugs.webkit.org/show_bug.cgi?id=93150
215
216 Reviewed by Mark Hahnenberg.
217
218 This changes all array checks used in array accesses (get, put, get length,
219 push, pop) to use the structure, not the class info. Additionally, these
220 checks in the LLInt and baseline JIT record the structure in an ArrayProfile,
221 so that the DFG can know exactly what structure to check for.
222
223 * CMakeLists.txt:
224 * GNUmakefile.list.am:
225 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
226 * JavaScriptCore.xcodeproj/project.pbxproj:
227 * Target.pri:
228 * bytecode/ArrayProfile.cpp: Added.
229 (JSC):
230 (JSC::ArrayProfile::computeUpdatedPrediction):
231 * bytecode/ArrayProfile.h: Added.
232 (JSC):
233 (JSC::arrayModeFromStructure):
234 (ArrayProfile):
235 (JSC::ArrayProfile::ArrayProfile):
236 (JSC::ArrayProfile::bytecodeOffset):
237 (JSC::ArrayProfile::addressOfLastSeenStructure):
238 (JSC::ArrayProfile::observeStructure):
239 (JSC::ArrayProfile::expectedStructure):
240 (JSC::ArrayProfile::structureIsPolymorphic):
241 (JSC::ArrayProfile::hasDefiniteStructure):
242 (JSC::ArrayProfile::observedArrayModes):
243 * bytecode/CodeBlock.cpp:
244 (JSC::CodeBlock::dump):
245 (JSC::CodeBlock::getArrayProfile):
246 (JSC):
247 (JSC::CodeBlock::getOrAddArrayProfile):
248 (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
249 * bytecode/CodeBlock.h:
250 (JSC::CodeBlock::executionEntryCount):
251 (JSC::CodeBlock::numberOfArrayProfiles):
252 (JSC::CodeBlock::arrayProfiles):
253 (JSC::CodeBlock::addArrayProfile):
254 (CodeBlock):
255 * bytecode/Instruction.h:
256 (JSC):
257 (JSC::Instruction::Instruction):
258 * bytecode/Opcode.h:
259 (JSC):
260 (JSC::padOpcodeName):
261 * bytecompiler/BytecodeGenerator.cpp:
262 (JSC::BytecodeGenerator::emitGetArgumentByVal):
263 (JSC::BytecodeGenerator::emitGetByVal):
264 (JSC::BytecodeGenerator::emitPutByVal):
265 * dfg/DFGAbstractState.cpp:
266 (JSC::DFG::AbstractState::initialize):
267 (JSC::DFG::AbstractState::execute):
268 * dfg/DFGAbstractValue.h:
269 (JSC::DFG::StructureAbstractValue::hasSingleton):
270 (StructureAbstractValue):
271 (JSC::DFG::StructureAbstractValue::singleton):
272 * dfg/DFGArgumentsSimplificationPhase.cpp:
273 (JSC::DFG::ArgumentsSimplificationPhase::run):
274 * dfg/DFGByteCodeParser.cpp:
275 (JSC::DFG::ByteCodeParser::parseBlock):
276 * dfg/DFGFixupPhase.cpp:
277 (JSC::DFG::FixupPhase::fixupNode):
278 * dfg/DFGSpeculativeJIT.cpp:
279 (JSC::DFG::SpeculativeJIT::speculateArray):
280 (DFG):
281 (JSC::DFG::SpeculativeJIT::compile):
282 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
283 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
284 * dfg/DFGSpeculativeJIT.h:
285 (SpeculativeJIT):
286 * dfg/DFGSpeculativeJIT32_64.cpp:
287 (JSC::DFG::SpeculativeJIT::compile):
288 * dfg/DFGSpeculativeJIT64.cpp:
289 (JSC::DFG::SpeculativeJIT::compile):
290 * dfg/DFGStructureCheckHoistingPhase.cpp:
291 (JSC::DFG::StructureCheckHoistingPhase::run):
292 * jit/JITPropertyAccess.cpp:
293 (JSC::JIT::emit_op_get_by_val):
294 (JSC::JIT::emit_op_put_by_val):
295 (JSC::JIT::privateCompilePatchGetArrayLength):
296 * jit/JITPropertyAccess32_64.cpp:
297 (JSC::JIT::emit_op_get_by_val):
298 (JSC::JIT::emit_op_put_by_val):
299 (JSC::JIT::privateCompilePatchGetArrayLength):
300 * llint/LLIntOffsetsExtractor.cpp:
301 * llint/LowLevelInterpreter32_64.asm:
302 * llint/LowLevelInterpreter64.asm:
303 * runtime/Structure.h:
304 (Structure):
305 (JSC::Structure::classInfoOffset):
306
commit-queue@webkit.orgb1409632012-08-14 11:28:25 +00003072012-08-14 Gabor Ballabas <gaborb@inf.u-szeged.hu>
308
309 Rename functions in the ARM port of DFG-JIT for better code readability.
310 https://bugs.webkit.org/show_bug.cgi?id=93609
311
312 Reviewed by Zoltan Herczeg.
313
314 Rename functions in the ARM port of DFG-JIT for better code
315 readability, and for following the WebKit coding style
316 wherever it is possible.
317
318 * assembler/ARMAssembler.cpp:
319 (JSC::ARMAssembler::genInt):
320 (JSC::ARMAssembler::getImm):
321 (JSC::ARMAssembler::moveImm):
322 (JSC::ARMAssembler::encodeComplexImm):
323 (JSC::ARMAssembler::dataTransfer32):
324 (JSC::ARMAssembler::baseIndexTransfer32):
325 (JSC::ARMAssembler::dataTransfer16):
326 (JSC::ARMAssembler::baseIndexTransfer16):
327 (JSC::ARMAssembler::dataTransferFloat):
328 (JSC::ARMAssembler::baseIndexTransferFloat):
329 * assembler/ARMAssembler.h:
330 (JSC::ARMAssembler::bitAnd):
331 (JSC::ARMAssembler::bitAnds):
332 (JSC::ARMAssembler::eor):
333 (JSC::ARMAssembler::eors):
334 (JSC::ARMAssembler::sub):
335 (JSC::ARMAssembler::subs):
336 (JSC::ARMAssembler::rsb):
337 (JSC::ARMAssembler::rsbs):
338 (JSC::ARMAssembler::add):
339 (JSC::ARMAssembler::adds):
340 (JSC::ARMAssembler::adc):
341 (JSC::ARMAssembler::adcs):
342 (JSC::ARMAssembler::sbc):
343 (JSC::ARMAssembler::sbcs):
344 (JSC::ARMAssembler::rsc):
345 (JSC::ARMAssembler::rscs):
346 (JSC::ARMAssembler::tst):
347 (JSC::ARMAssembler::teq):
348 (JSC::ARMAssembler::cmp):
349 (JSC::ARMAssembler::cmn):
350 (JSC::ARMAssembler::orr):
351 (JSC::ARMAssembler::orrs):
352 (JSC::ARMAssembler::mov):
353 (JSC::ARMAssembler::movw):
354 (JSC::ARMAssembler::movt):
355 (JSC::ARMAssembler::movs):
356 (JSC::ARMAssembler::bic):
357 (JSC::ARMAssembler::bics):
358 (JSC::ARMAssembler::mvn):
359 (JSC::ARMAssembler::mvns):
360 (JSC::ARMAssembler::mul):
361 (JSC::ARMAssembler::muls):
362 (JSC::ARMAssembler::mull):
363 (JSC::ARMAssembler::vmov_f64):
364 (JSC::ARMAssembler::vadd_f64):
365 (JSC::ARMAssembler::vdiv_f64):
366 (JSC::ARMAssembler::vsub_f64):
367 (JSC::ARMAssembler::vmul_f64):
368 (JSC::ARMAssembler::vcmp_f64):
369 (JSC::ARMAssembler::vsqrt_f64):
370 (JSC::ARMAssembler::vabs_f64):
371 (JSC::ARMAssembler::vneg_f64):
372 (JSC::ARMAssembler::ldrImmediate):
373 (JSC::ARMAssembler::ldrUniqueImmediate):
374 (JSC::ARMAssembler::dtrUp):
375 (JSC::ARMAssembler::dtrUpRegister):
376 (JSC::ARMAssembler::dtrDown):
377 (JSC::ARMAssembler::dtrDownRegister):
378 (JSC::ARMAssembler::halfDtrUp):
379 (JSC::ARMAssembler::halfDtrUpRegister):
380 (JSC::ARMAssembler::halfDtrDown):
381 (JSC::ARMAssembler::halfDtrDownRegister):
382 (JSC::ARMAssembler::doubleDtrUp):
383 (JSC::ARMAssembler::doubleDtrDown):
384 (JSC::ARMAssembler::push):
385 (JSC::ARMAssembler::pop):
386 (JSC::ARMAssembler::poke):
387 (JSC::ARMAssembler::peek):
388 (JSC::ARMAssembler::vmov_vfp64):
389 (JSC::ARMAssembler::vmov_arm64):
390 (JSC::ARMAssembler::vmov_vfp32):
391 (JSC::ARMAssembler::vmov_arm32):
392 (JSC::ARMAssembler::vcvt_f64_s32):
393 (JSC::ARMAssembler::vcvt_s32_f64):
394 (JSC::ARMAssembler::vcvt_u32_f64):
395 (JSC::ARMAssembler::vcvt_f64_f32):
396 (JSC::ARMAssembler::vcvt_f32_f64):
397 (JSC::ARMAssembler::clz):
398 (JSC::ARMAssembler::lslRegister):
399 (JSC::ARMAssembler::lsrRegister):
400 (JSC::ARMAssembler::asrRegister):
401 (JSC::ARMAssembler::align):
402 (JSC::ARMAssembler::loadBranchTarget):
403 (JSC::ARMAssembler::vmov):
404 * assembler/MacroAssemblerARM.cpp:
405 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
406 * assembler/MacroAssemblerARM.h:
407 (JSC::MacroAssemblerARM::add32):
408 (JSC::MacroAssemblerARM::and32):
409 (JSC::MacroAssemblerARM::lshift32):
410 (JSC::MacroAssemblerARM::mul32):
411 (JSC::MacroAssemblerARM::or32):
412 (JSC::MacroAssemblerARM::rshift32):
413 (JSC::MacroAssemblerARM::urshift32):
414 (JSC::MacroAssemblerARM::sub32):
415 (JSC::MacroAssemblerARM::xor32):
416 (JSC::MacroAssemblerARM::countLeadingZeros32):
417 (JSC::MacroAssemblerARM::convertibleLoadPtr):
418 (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
419 (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
420 (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
421 (JSC::MacroAssemblerARM::store32):
422 (JSC::MacroAssemblerARM::pop):
423 (JSC::MacroAssemblerARM::push):
424 (JSC::MacroAssemblerARM::move):
425 (JSC::MacroAssemblerARM::swap):
426 (JSC::MacroAssemblerARM::branch32):
427 (JSC::MacroAssemblerARM::branchTest32):
428 (JSC::MacroAssemblerARM::mull32):
429 (JSC::MacroAssemblerARM::branchSub32):
430 (JSC::MacroAssemblerARM::compare32):
431 (JSC::MacroAssemblerARM::test32):
432 (JSC::MacroAssemblerARM::load32):
433 (JSC::MacroAssemblerARM::relativeTableJump):
434 (JSC::MacroAssemblerARM::moveWithPatch):
435 (JSC::MacroAssemblerARM::loadDouble):
436 (JSC::MacroAssemblerARM::moveDouble):
437 (JSC::MacroAssemblerARM::addDouble):
438 (JSC::MacroAssemblerARM::divDouble):
439 (JSC::MacroAssemblerARM::subDouble):
440 (JSC::MacroAssemblerARM::mulDouble):
441 (JSC::MacroAssemblerARM::sqrtDouble):
442 (JSC::MacroAssemblerARM::absDouble):
443 (JSC::MacroAssemblerARM::negateDouble):
444 (JSC::MacroAssemblerARM::convertInt32ToDouble):
445 (JSC::MacroAssemblerARM::convertFloatToDouble):
446 (JSC::MacroAssemblerARM::convertDoubleToFloat):
447 (JSC::MacroAssemblerARM::branchDouble):
448 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
449 (JSC::MacroAssemblerARM::branchTruncateDoubleToUint32):
450 (JSC::MacroAssemblerARM::truncateDoubleToInt32):
451 (JSC::MacroAssemblerARM::truncateDoubleToUint32):
452 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
453 (JSC::MacroAssemblerARM::branchDoubleNonZero):
454 (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
455
hausmann@webkit.orge9a69542012-08-13 20:44:33 +00004562012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
457
hausmann@webkit.org029be3e2012-08-13 21:37:19 +0000458 Unreviewed, rolling out r125444.
459 http://trac.webkit.org/changeset/125444
460 https://bugs.webkit.org/show_bug.cgi?id=93872
461
462 Broke some tests
463
464 * Target.pri:
465
4662012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
467
hausmann@webkit.orge9a69542012-08-13 20:44:33 +0000468 [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
469 https://bugs.webkit.org/show_bug.cgi?id=93872
470
471 Reviewed by Kenneth Rohde Christiansen.
472
473 * Target.pri: Add missing JSWeakObjectMap file to build.
474
rakuco@webkit.org56218832012-08-13 20:38:06 +00004752012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
476
477 [CMake] Remove glib-related Find modules and write single new one instead.
478 https://bugs.webkit.org/show_bug.cgi?id=93786
479
480 Reviewed by Rob Buis.
481
482 * shell/PlatformEfl.cmake: Use GLIB_* instead of Glib_*.
483
allan.jensen@nokia.com3c6f1522012-08-12 11:47:34 +00004842012-08-12 Allan Sandfeld Jensen <allan.jensen@nokia.com>
485
486 Doesn't build with ENABLE_JIT=0
487 https://bugs.webkit.org/show_bug.cgi?id=85042
488
489 Reviewed by Eric Seidel.
490
491 Include headers without which CallFrame.h does not build, and
492 fix gcc warning about comparing unsigned int with 0.
493
494 * dfg/DFGDriver.cpp:
495 * interpreter/Interpreter.cpp:
496 (JSC::Interpreter::isOpcode):
497
commit-queue@webkit.org2d9f0782012-08-10 16:21:25 +00004982012-08-10 Yong Li <yoli@rim.com>
499
500 [BlackBerry] GCActivityCallback should always schedule GC even allocated bytes is a small number
501 https://bugs.webkit.org/show_bug.cgi?id=93650
502
503 Reviewed by Rob Buis.
504
505 Even a small number of allocated JS objects could hold expensive resources.
506
507 * runtime/GCActivityCallbackBlackBerry.cpp:
508 (JSC::DefaultGCActivityCallback::didAllocate):
509
commit-queue@webkit.orgb849db72012-08-09 20:38:56 +00005102012-08-09 Yong Li <yoli@rim.com>
511
512 [QNX] Implement getCPUTime() for OS(QNX)
513 https://bugs.webkit.org/show_bug.cgi?id=93516
514
515 Reviewed by George Staikos.
516
517 Implement getCPUTime() with CLOCK_THREAD_CPUTIME_ID so it will tell
518 exactly how long the current thread has spent without being impacted
519 by other things.
520
521 * runtime/TimeoutChecker.cpp:
522 (JSC::getCPUTime):
523
commit-queue@webkit.org656e6522012-08-09 02:29:35 +00005242012-08-08 Shane Stephens <shanestephens@google.com>
525
526 Compile flag for CSS Hierarchies
527 https://bugs.webkit.org/show_bug.cgi?id=92433
528
529 Reviewed by Tony Chang.
530
531 * Configurations/FeatureDefines.xcconfig:
532
benjamin@webkit.org58ac4792012-08-09 01:29:44 +00005332012-08-08 Benjamin Poulain <bpoulain@apple.com>
534
535 Use char* instead of LChar* for the public interface of String construction from literals
536 https://bugs.webkit.org/show_bug.cgi?id=93402
537
538 Reviewed by Michael Saboff.
539
540 Update JSC' Identifier to use StringImpl::createFromLiteral with a char*.
541
542 * runtime/Identifier.cpp:
543 (JSC::IdentifierASCIIStringTranslator::translate):
544
paroga@webkit.orgcb73ac52012-08-08 07:31:12 +00005452012-08-08 Patrick Gansterer <paroga@webkit.org>
546
paroga@webkit.org34230a82012-08-08 10:43:48 +0000547 Remove ce_time.(cpp|h) from list of source files
548 https://bugs.webkit.org/show_bug.cgi?id=93446
549
550 Reviewed by Simon Hausmann.
551
552 r125004 removed the last dependency on functions defined in ce_time.cpp.
553
554 * Target.pri:
555
5562012-08-08 Patrick Gansterer <paroga@webkit.org>
557
paroga@webkit.orgcb73ac52012-08-08 07:31:12 +0000558 [WIN] Use GetTimeZoneInformation() for getting the timezone name
559 https://bugs.webkit.org/show_bug.cgi?id=91936
560
561 Reviewed by Ryosuke Niwa.
562
563 The MS CRT implementation of strftime calls the same functions in the background.
564 Using them directly avoids the overhead of parsing the format string and removes
565 the dependency on strftime() for WinCE where this function does not exist.
566
567 * runtime/DateConversion.cpp:
568 (JSC::formatTime):
569
commit-queue@webkit.org3dfe8ce2012-08-07 22:55:04 +00005702012-08-07 Gabor Ballabas <gaborb@inf.u-szeged.hu>
571
572 Refactor magic numbers in the ARM port of DFG-JIT
573 https://bugs.webkit.org/show_bug.cgi?id=93348
574
575 Reviewed by Eric Seidel.
576
577 Introduce new names for hard-coded magic numbers.
578 Refactor constant with confusing names to more descriptive ones.
579
580 * assembler/ARMAssembler.cpp:
581 (JSC::ARMAssembler::patchConstantPoolLoad):
582 (JSC::ARMAssembler::getOp2):
583 (JSC::ARMAssembler::genInt):
584 (JSC::ARMAssembler::getImm):
585 (JSC::ARMAssembler::moveImm):
586 (JSC::ARMAssembler::encodeComplexImm):
587 (JSC::ARMAssembler::dataTransfer32):
588 (JSC::ARMAssembler::dataTransfer16):
589 (JSC::ARMAssembler::dataTransferFloat):
590 (JSC::ARMAssembler::executableCopy):
591 * assembler/ARMAssembler.h:
592 (JSC::ARMAssembler::emitInstruction):
593 (JSC::ARMAssembler::ands_r):
594 (JSC::ARMAssembler::eors_r):
595 (JSC::ARMAssembler::subs_r):
596 (JSC::ARMAssembler::rsbs_r):
597 (JSC::ARMAssembler::adds_r):
598 (JSC::ARMAssembler::adcs_r):
599 (JSC::ARMAssembler::sbcs_r):
600 (JSC::ARMAssembler::rscs_r):
601 (JSC::ARMAssembler::tst_r):
602 (JSC::ARMAssembler::teq_r):
603 (JSC::ARMAssembler::cmp_r):
604 (JSC::ARMAssembler::cmn_r):
605 (JSC::ARMAssembler::orrs_r):
606 (JSC::ARMAssembler::movs_r):
607 (JSC::ARMAssembler::bics_r):
608 (JSC::ARMAssembler::mvns_r):
609 (JSC::ARMAssembler::muls_r):
610 (JSC::ARMAssembler::ldr_imm):
611 (JSC::ARMAssembler::ldr_un_imm):
612 (JSC::ARMAssembler::dtr_u):
613 (JSC::ARMAssembler::dtr_ur):
614 (JSC::ARMAssembler::dtr_dr):
615 (JSC::ARMAssembler::dtrh_u):
616 (JSC::ARMAssembler::dtrh_ur):
617 (JSC::ARMAssembler::fdtr_u):
618 (JSC::ARMAssembler::push_r):
619 (JSC::ARMAssembler::pop_r):
620 (JSC::ARMAssembler::getLdrImmAddress):
621 (JSC::ARMAssembler::getLdrImmAddressOnPool):
622 (JSC::ARMAssembler::patchConstantPoolLoad):
623 (JSC::ARMAssembler::repatchCompact):
624 (JSC::ARMAssembler::replaceWithJump):
625 (JSC::ARMAssembler::replaceWithLoad):
626 (JSC::ARMAssembler::replaceWithAddressComputation):
627 (JSC::ARMAssembler::getOp2Byte):
628 (JSC::ARMAssembler::getOp2Half):
629 (JSC::ARMAssembler::getImm16Op2):
630 (JSC::ARMAssembler::placeConstantPoolBarrier):
631 (JSC::ARMAssembler::getConditionalField):
632 * assembler/MacroAssemblerARM.cpp:
633 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
634 * assembler/MacroAssemblerARM.h:
635 (JSC::MacroAssemblerARM::and32):
636 (JSC::MacroAssemblerARM::branch32):
637 (JSC::MacroAssemblerARM::branchTest32):
638 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
639
benjamin@webkit.orgd02c5572012-08-07 21:46:07 +00006402012-08-07 Benjamin Poulain <benjamin@webkit.org>
641
642 Use the initialization from literal for JSC's Identifiers
643 https://bugs.webkit.org/show_bug.cgi?id=93193
644
645 Reviewed by Geoffrey Garen.
646
647 This patches modify Identifier ot take advantage of the new initialization from literal.
648
649 In addition to the memory savings (~600bytes per instance), this gives us a 2% speed
650 improvement on CommonIdentifiers on average.
651
652 * runtime/CommonIdentifiers.cpp:
653 (JSC::CommonIdentifiers::CommonIdentifiers):
654 Null and empty strings are forbidden for literal initialization. Use the most efficient constructors
655 instead of a literal.
656
657 * runtime/Identifier.cpp:
658 (IdentifierASCIIStringTranslator):
659 Rename IdentifierCStringTranslator to IdentifierASCIIStringTranslator to make the text encoding
660 explicit.
661 (JSC::IdentifierASCIIStringTranslator::hash):
662 (JSC::IdentifierASCIIStringTranslator::equal):
663 (JSC::IdentifierASCIIStringTranslator::translate): Use the fast initialization from literal.
664 (JSC::Identifier::add):
665 * runtime/Identifier.h:
666 (JSC::Identifier::Identifier):
667
hausmann@webkit.orga0580522012-08-07 09:24:21 +00006682012-08-07 Simon Hausmann <simon.hausmann@nokia.com>
669
670 [Qt][Win] Remove pthreads linkage
671
672 Reviewed by Csaba Osztrogonác.
673
674 After r124823 linkage to pthreads is not needed anymore for the Windows
675 build.
676
677 * JavaScriptCore.pri:
678
commit-queue@webkit.org6c4f9272012-08-07 08:50:43 +00006792012-08-07 Gabor Ballabas <gaborb@inf.u-szeged.hu>
680
681 Refactor emit*Inst functions and introduce toARMWord functions in DFG-JIT's traditional ARM port
682 https://bugs.webkit.org/show_bug.cgi?id=93266
683
684 Reviewed by Csaba Osztrogonác.
685
686 First part of a bigger refactoring issue trying to make traditional
687 ARM DFG-JIT port easier to read and understand.
688
689
690 * assembler/ARMAssembler.h:
691 (JSC::ARMAssembler::emitInstruction):
692 (JSC::ARMAssembler::emitDoublePrecisionInstruction):
693 (JSC::ARMAssembler::emitSinglePrecisionInstruction):
694 (JSC::ARMAssembler::and_r):
695 (JSC::ARMAssembler::ands_r):
696 (JSC::ARMAssembler::eor_r):
697 (JSC::ARMAssembler::eors_r):
698 (JSC::ARMAssembler::sub_r):
699 (JSC::ARMAssembler::subs_r):
700 (JSC::ARMAssembler::rsb_r):
701 (JSC::ARMAssembler::rsbs_r):
702 (JSC::ARMAssembler::add_r):
703 (JSC::ARMAssembler::adds_r):
704 (JSC::ARMAssembler::adc_r):
705 (JSC::ARMAssembler::adcs_r):
706 (JSC::ARMAssembler::sbc_r):
707 (JSC::ARMAssembler::sbcs_r):
708 (JSC::ARMAssembler::rsc_r):
709 (JSC::ARMAssembler::rscs_r):
710 (JSC::ARMAssembler::tst_r):
711 (JSC::ARMAssembler::teq_r):
712 (JSC::ARMAssembler::cmp_r):
713 (JSC::ARMAssembler::cmn_r):
714 (JSC::ARMAssembler::orr_r):
715 (JSC::ARMAssembler::orrs_r):
716 (JSC::ARMAssembler::mov_r):
717 (JSC::ARMAssembler::movw_r):
718 (JSC::ARMAssembler::movt_r):
719 (JSC::ARMAssembler::movs_r):
720 (JSC::ARMAssembler::bic_r):
721 (JSC::ARMAssembler::bics_r):
722 (JSC::ARMAssembler::mvn_r):
723 (JSC::ARMAssembler::mvns_r):
724 (JSC::ARMAssembler::mul_r):
725 (JSC::ARMAssembler::muls_r):
726 (JSC::ARMAssembler::mull_r):
727 (JSC::ARMAssembler::vmov_f64_r):
728 (JSC::ARMAssembler::vadd_f64_r):
729 (JSC::ARMAssembler::vdiv_f64_r):
730 (JSC::ARMAssembler::vsub_f64_r):
731 (JSC::ARMAssembler::vmul_f64_r):
732 (JSC::ARMAssembler::vcmp_f64_r):
733 (JSC::ARMAssembler::vsqrt_f64_r):
734 (JSC::ARMAssembler::vabs_f64_r):
735 (JSC::ARMAssembler::vneg_f64_r):
736 (JSC::ARMAssembler::ldr_imm):
737 (JSC::ARMAssembler::ldr_un_imm):
738 (JSC::ARMAssembler::dtr_u):
739 (JSC::ARMAssembler::dtr_ur):
740 (JSC::ARMAssembler::dtr_d):
741 (JSC::ARMAssembler::dtr_dr):
742 (JSC::ARMAssembler::dtrh_u):
743 (JSC::ARMAssembler::dtrh_ur):
744 (JSC::ARMAssembler::dtrh_d):
745 (JSC::ARMAssembler::dtrh_dr):
746 (JSC::ARMAssembler::fdtr_u):
747 (JSC::ARMAssembler::fdtr_d):
748 (JSC::ARMAssembler::push_r):
749 (JSC::ARMAssembler::pop_r):
750 (JSC::ARMAssembler::vmov_vfp64_r):
751 (JSC::ARMAssembler::vmov_arm64_r):
752 (JSC::ARMAssembler::vmov_vfp32_r):
753 (JSC::ARMAssembler::vmov_arm32_r):
754 (JSC::ARMAssembler::vcvt_f64_s32_r):
755 (JSC::ARMAssembler::vcvt_s32_f64_r):
756 (JSC::ARMAssembler::vcvt_u32_f64_r):
757 (JSC::ARMAssembler::vcvt_f64_f32_r):
758 (JSC::ARMAssembler::vcvt_f32_f64_r):
759 (JSC::ARMAssembler::vmrs_apsr):
760 (JSC::ARMAssembler::clz_r):
761 (JSC::ARMAssembler::bx):
762 (JSC::ARMAssembler::blx):
763 (JSC::ARMAssembler::linkJump):
764 (JSC::ARMAssembler::toARMWord):
765 (ARMAssembler):
766
paroga@webkit.orgf5643b92012-08-06 23:46:11 +00007672012-08-06 Patrick Gansterer <paroga@webkit.org>
768
paroga@webkit.org156fc552012-08-07 00:29:14 +0000769 [WIN] Remove dependency on pthread from MachineStackMarker
770 https://bugs.webkit.org/show_bug.cgi?id=68429
771
772 Reviewed by Geoffrey Garen.
773
774 Windows has no support for calling a destructor for thread specific data.
775 Since we need more control over creating and deleting thread specific keys
776 we can not simply extend WTF::ThreadSpecific with this functionality.
777
778 All thread specific keys created via the new API get stored in a list.
779 After a thread function finished we iterate over this list and call
780 the registered destructor for every item if needed.
781
782 * heap/MachineStackMarker.cpp: Use the new functions instead of pthread directly.
783 (JSC::MachineThreads::~MachineThreads):
784 (JSC::MachineThreads::makeUsableFromMultipleThreads):
785 (JSC::MachineThreads::addCurrentThread):
786 * heap/MachineStackMarker.h:
787 (MachineThreads):
788
7892012-08-06 Patrick Gansterer <paroga@webkit.org>
790
paroga@webkit.orgf5643b92012-08-06 23:46:11 +0000791 Unify JSC date and time formating functions
792 https://bugs.webkit.org/show_bug.cgi?id=92282
793
794 Reviewed by Geoffrey Garen.
795
796 Replace the existing functions for formating GregorianDateTime
797 with one single function. This removes some code duplications
798 in DatePrototype and is a preperation to fix encoding issues,
799 since we can add UChar* values to the resulting string now.
800
801 * runtime/DateConstructor.cpp:
802 (JSC::callDate):
803 * runtime/DateConversion.cpp:
804 (JSC::formatDateTime):
805 * runtime/DateConversion.h:
806 (JSC):
807 * runtime/DatePrototype.cpp:
808 (JSC::formateDateInstance):
809 (JSC::dateProtoFuncToString):
810 (JSC::dateProtoFuncToUTCString):
811 (JSC::dateProtoFuncToDateString):
812 (JSC::dateProtoFuncToTimeString):
813 (JSC::dateProtoFuncToGMTString):
814
carlosgc@webkit.orga6cd87d2012-08-06 12:35:28 +00008152012-08-06 Carlos Garcia Campos <cgarcia@igalia.com>
816
817 Unreviewed. Fix make distcheck.
818
819 * GNUmakefile.list.am: Add missing header file.
820
commit-queue@webkit.org1b331cb2012-08-06 03:16:46 +00008212012-08-05 Peter Wang <peter.wang@torchmobile.com.cn>
822
823 Web Inspector: [JSC] implement setting breakpoints by line:column
824 https://bugs.webkit.org/show_bug.cgi?id=53003
825
826 Reviewed by Geoffrey Garen.
827
828 Add a counter to Lexer to record the column info of each Token. Add a column parameter to
829 op_debug, cti_op_debug, and _llint_op_debug byte-code command.
830
831 * bytecode/CodeBlock.cpp:
832 (JSC::CodeBlock::dump):
833 * bytecode/Opcode.h:
834 (JSC):
835 (JSC::padOpcodeName):
836 * bytecompiler/BytecodeGenerator.cpp:
837 (JSC::BytecodeGenerator::resolve):
838 (JSC::BytecodeGenerator::emitDebugHook):
839 * bytecompiler/BytecodeGenerator.h:
840 (BytecodeGenerator):
841 * bytecompiler/NodesCodegen.cpp:
842 (JSC::ArrayNode::toArgumentList):
843 (JSC::ApplyFunctionCallDotNode::emitBytecode):
844 (JSC::ConstStatementNode::emitBytecode):
845 (JSC::EmptyStatementNode::emitBytecode):
846 (JSC::DebuggerStatementNode::emitBytecode):
847 (JSC::ExprStatementNode::emitBytecode):
848 (JSC::VarStatementNode::emitBytecode):
849 (JSC::IfNode::emitBytecode):
850 (JSC::IfElseNode::emitBytecode):
851 (JSC::DoWhileNode::emitBytecode):
852 (JSC::WhileNode::emitBytecode):
853 (JSC::ForNode::emitBytecode):
854 (JSC::ForInNode::emitBytecode):
855 (JSC::ContinueNode::emitBytecode):
856 (JSC::BreakNode::emitBytecode):
857 (JSC::ReturnNode::emitBytecode):
858 (JSC::WithNode::emitBytecode):
859 (JSC::SwitchNode::emitBytecode):
860 (JSC::LabelNode::emitBytecode):
861 (JSC::ThrowNode::emitBytecode):
862 (JSC::TryNode::emitBytecode):
863 (JSC::ProgramNode::emitBytecode):
864 (JSC::EvalNode::emitBytecode):
865 (JSC::FunctionBodyNode::emitBytecode):
866 * debugger/Debugger.h:
867 * interpreter/Interpreter.cpp:
868 (JSC::Interpreter::unwindCallFrame):
869 (JSC::Interpreter::throwException):
870 (JSC::Interpreter::debug):
871 (JSC::Interpreter::privateExecute):
872 * interpreter/Interpreter.h:
873 (Interpreter):
874 * jit/JITOpcodes.cpp:
875 (JSC::JIT::emit_op_debug):
876 * jit/JITOpcodes32_64.cpp:
877 (JSC::JIT::emit_op_debug):
878 * jit/JITStubs.cpp:
879 (JSC::DEFINE_STUB_FUNCTION):
880 * llint/LLIntSlowPaths.cpp:
881 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
882 * llint/LowLevelInterpreter.asm:
883 * parser/ASTBuilder.h:
884 (ASTBuilder):
885 (JSC::ASTBuilder::createCommaExpr):
886 (JSC::ASTBuilder::createLogicalNot):
887 (JSC::ASTBuilder::createUnaryPlus):
888 (JSC::ASTBuilder::createVoid):
889 (JSC::ASTBuilder::thisExpr):
890 (JSC::ASTBuilder::createResolve):
891 (JSC::ASTBuilder::createObjectLiteral):
892 (JSC::ASTBuilder::createArray):
893 (JSC::ASTBuilder::createNumberExpr):
894 (JSC::ASTBuilder::createString):
895 (JSC::ASTBuilder::createBoolean):
896 (JSC::ASTBuilder::createNull):
897 (JSC::ASTBuilder::createBracketAccess):
898 (JSC::ASTBuilder::createDotAccess):
899 (JSC::ASTBuilder::createRegExp):
900 (JSC::ASTBuilder::createNewExpr):
901 (JSC::ASTBuilder::createConditionalExpr):
902 (JSC::ASTBuilder::createAssignResolve):
903 (JSC::ASTBuilder::createFunctionExpr):
904 (JSC::ASTBuilder::createFunctionBody):
905 (JSC::ASTBuilder::createGetterOrSetterProperty):
906 (JSC::ASTBuilder::createArgumentsList):
907 (JSC::ASTBuilder::createPropertyList):
908 (JSC::ASTBuilder::createFuncDeclStatement):
909 (JSC::ASTBuilder::createBlockStatement):
910 (JSC::ASTBuilder::createExprStatement):
911 (JSC::ASTBuilder::createIfStatement):
912 (JSC::ASTBuilder::createForLoop):
913 (JSC::ASTBuilder::createForInLoop):
914 (JSC::ASTBuilder::createEmptyStatement):
915 (JSC::ASTBuilder::createVarStatement):
916 (JSC::ASTBuilder::createReturnStatement):
917 (JSC::ASTBuilder::createBreakStatement):
918 (JSC::ASTBuilder::createContinueStatement):
919 (JSC::ASTBuilder::createTryStatement):
920 (JSC::ASTBuilder::createSwitchStatement):
921 (JSC::ASTBuilder::createWhileStatement):
922 (JSC::ASTBuilder::createDoWhileStatement):
923 (JSC::ASTBuilder::createLabelStatement):
924 (JSC::ASTBuilder::createWithStatement):
925 (JSC::ASTBuilder::createThrowStatement):
926 (JSC::ASTBuilder::createDebugger):
927 (JSC::ASTBuilder::createConstStatement):
928 (JSC::ASTBuilder::appendConstDecl):
929 (JSC::ASTBuilder::combineCommaNodes):
930 (JSC::ASTBuilder::appendBinaryOperation):
931 (JSC::ASTBuilder::createAssignment):
932 (JSC::ASTBuilder::createNumber):
933 (JSC::ASTBuilder::makeTypeOfNode):
934 (JSC::ASTBuilder::makeDeleteNode):
935 (JSC::ASTBuilder::makeNegateNode):
936 (JSC::ASTBuilder::makeBitwiseNotNode):
937 (JSC::ASTBuilder::makeMultNode):
938 (JSC::ASTBuilder::makeDivNode):
939 (JSC::ASTBuilder::makeModNode):
940 (JSC::ASTBuilder::makeAddNode):
941 (JSC::ASTBuilder::makeSubNode):
942 (JSC::ASTBuilder::makeLeftShiftNode):
943 (JSC::ASTBuilder::makeRightShiftNode):
944 (JSC::ASTBuilder::makeURightShiftNode):
945 (JSC::ASTBuilder::makeBitOrNode):
946 (JSC::ASTBuilder::makeBitAndNode):
947 (JSC::ASTBuilder::makeBitXOrNode):
948 (JSC::ASTBuilder::makeFunctionCallNode):
949 (JSC::ASTBuilder::makeBinaryNode):
950 (JSC::ASTBuilder::makeAssignNode):
951 (JSC::ASTBuilder::makePrefixNode):
952 (JSC::ASTBuilder::makePostfixNode):
953 * parser/Lexer.cpp:
954 (JSC::::setCode):
955 (JSC::::internalShift):
956 (JSC::::shift):
957 (JSC::::lex):
958 * parser/Lexer.h:
959 (Lexer):
960 (JSC::Lexer::currentColumnNumber):
961 (JSC::::lexExpectIdentifier):
962 * parser/NodeConstructors.h:
963 (JSC::Node::Node):
964 (JSC::ExpressionNode::ExpressionNode):
965 (JSC::StatementNode::StatementNode):
966 (JSC::NullNode::NullNode):
967 (JSC::BooleanNode::BooleanNode):
968 (JSC::NumberNode::NumberNode):
969 (JSC::StringNode::StringNode):
970 (JSC::RegExpNode::RegExpNode):
971 (JSC::ThisNode::ThisNode):
972 (JSC::ResolveNode::ResolveNode):
973 (JSC::ArrayNode::ArrayNode):
974 (JSC::PropertyListNode::PropertyListNode):
975 (JSC::ObjectLiteralNode::ObjectLiteralNode):
976 (JSC::BracketAccessorNode::BracketAccessorNode):
977 (JSC::DotAccessorNode::DotAccessorNode):
978 (JSC::ArgumentListNode::ArgumentListNode):
979 (JSC::NewExprNode::NewExprNode):
980 (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
981 (JSC::FunctionCallValueNode::FunctionCallValueNode):
982 (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
983 (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
984 (JSC::FunctionCallDotNode::FunctionCallDotNode):
985 (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
986 (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
987 (JSC::PrePostResolveNode::PrePostResolveNode):
988 (JSC::PostfixResolveNode::PostfixResolveNode):
989 (JSC::PostfixBracketNode::PostfixBracketNode):
990 (JSC::PostfixDotNode::PostfixDotNode):
991 (JSC::PostfixErrorNode::PostfixErrorNode):
992 (JSC::DeleteResolveNode::DeleteResolveNode):
993 (JSC::DeleteBracketNode::DeleteBracketNode):
994 (JSC::DeleteDotNode::DeleteDotNode):
995 (JSC::DeleteValueNode::DeleteValueNode):
996 (JSC::VoidNode::VoidNode):
997 (JSC::TypeOfResolveNode::TypeOfResolveNode):
998 (JSC::TypeOfValueNode::TypeOfValueNode):
999 (JSC::PrefixResolveNode::PrefixResolveNode):
1000 (JSC::PrefixBracketNode::PrefixBracketNode):
1001 (JSC::PrefixDotNode::PrefixDotNode):
1002 (JSC::PrefixErrorNode::PrefixErrorNode):
1003 (JSC::UnaryOpNode::UnaryOpNode):
1004 (JSC::UnaryPlusNode::UnaryPlusNode):
1005 (JSC::NegateNode::NegateNode):
1006 (JSC::BitwiseNotNode::BitwiseNotNode):
1007 (JSC::LogicalNotNode::LogicalNotNode):
1008 (JSC::BinaryOpNode::BinaryOpNode):
1009 (JSC::MultNode::MultNode):
1010 (JSC::DivNode::DivNode):
1011 (JSC::ModNode::ModNode):
1012 (JSC::AddNode::AddNode):
1013 (JSC::SubNode::SubNode):
1014 (JSC::LeftShiftNode::LeftShiftNode):
1015 (JSC::RightShiftNode::RightShiftNode):
1016 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
1017 (JSC::LessNode::LessNode):
1018 (JSC::GreaterNode::GreaterNode):
1019 (JSC::LessEqNode::LessEqNode):
1020 (JSC::GreaterEqNode::GreaterEqNode):
1021 (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
1022 (JSC::InstanceOfNode::InstanceOfNode):
1023 (JSC::InNode::InNode):
1024 (JSC::EqualNode::EqualNode):
1025 (JSC::NotEqualNode::NotEqualNode):
1026 (JSC::StrictEqualNode::StrictEqualNode):
1027 (JSC::NotStrictEqualNode::NotStrictEqualNode):
1028 (JSC::BitAndNode::BitAndNode):
1029 (JSC::BitOrNode::BitOrNode):
1030 (JSC::BitXOrNode::BitXOrNode):
1031 (JSC::LogicalOpNode::LogicalOpNode):
1032 (JSC::ConditionalNode::ConditionalNode):
1033 (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
1034 (JSC::AssignResolveNode::AssignResolveNode):
1035 (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
1036 (JSC::AssignBracketNode::AssignBracketNode):
1037 (JSC::AssignDotNode::AssignDotNode):
1038 (JSC::ReadModifyDotNode::ReadModifyDotNode):
1039 (JSC::AssignErrorNode::AssignErrorNode):
1040 (JSC::CommaNode::CommaNode):
1041 (JSC::ConstStatementNode::ConstStatementNode):
1042 (JSC::EmptyStatementNode::EmptyStatementNode):
1043 (JSC::DebuggerStatementNode::DebuggerStatementNode):
1044 (JSC::ExprStatementNode::ExprStatementNode):
1045 (JSC::VarStatementNode::VarStatementNode):
1046 (JSC::IfNode::IfNode):
1047 (JSC::IfElseNode::IfElseNode):
1048 (JSC::DoWhileNode::DoWhileNode):
1049 (JSC::WhileNode::WhileNode):
1050 (JSC::ForNode::ForNode):
1051 (JSC::ContinueNode::ContinueNode):
1052 (JSC::BreakNode::BreakNode):
1053 (JSC::ReturnNode::ReturnNode):
1054 (JSC::WithNode::WithNode):
1055 (JSC::LabelNode::LabelNode):
1056 (JSC::ThrowNode::ThrowNode):
1057 (JSC::TryNode::TryNode):
1058 (JSC::FuncExprNode::FuncExprNode):
1059 (JSC::FuncDeclNode::FuncDeclNode):
1060 (JSC::SwitchNode::SwitchNode):
1061 (JSC::ConstDeclNode::ConstDeclNode):
1062 (JSC::BlockNode::BlockNode):
1063 (JSC::ForInNode::ForInNode):
1064 * parser/Nodes.cpp:
1065 (JSC::StatementNode::setLoc):
1066 (JSC):
1067 (JSC::ScopeNode::ScopeNode):
1068 (JSC::ProgramNode::ProgramNode):
1069 (JSC::ProgramNode::create):
1070 (JSC::EvalNode::EvalNode):
1071 (JSC::EvalNode::create):
1072 (JSC::FunctionBodyNode::FunctionBodyNode):
1073 (JSC::FunctionBodyNode::create):
1074 * parser/Nodes.h:
1075 (Node):
1076 (JSC::Node::columnNo):
1077 (ExpressionNode):
1078 (StatementNode):
1079 (JSC::StatementNode::column):
1080 (NullNode):
1081 (BooleanNode):
1082 (NumberNode):
1083 (StringNode):
1084 (RegExpNode):
1085 (ThisNode):
1086 (ResolveNode):
1087 (ArrayNode):
1088 (PropertyListNode):
1089 (ObjectLiteralNode):
1090 (BracketAccessorNode):
1091 (DotAccessorNode):
1092 (ArgumentListNode):
1093 (NewExprNode):
1094 (EvalFunctionCallNode):
1095 (FunctionCallValueNode):
1096 (FunctionCallResolveNode):
1097 (FunctionCallBracketNode):
1098 (FunctionCallDotNode):
1099 (CallFunctionCallDotNode):
1100 (ApplyFunctionCallDotNode):
1101 (PrePostResolveNode):
1102 (PostfixResolveNode):
1103 (PostfixBracketNode):
1104 (PostfixDotNode):
1105 (PostfixErrorNode):
1106 (DeleteResolveNode):
1107 (DeleteBracketNode):
1108 (DeleteDotNode):
1109 (DeleteValueNode):
1110 (VoidNode):
1111 (TypeOfResolveNode):
1112 (TypeOfValueNode):
1113 (PrefixResolveNode):
1114 (PrefixBracketNode):
1115 (PrefixDotNode):
1116 (PrefixErrorNode):
1117 (UnaryOpNode):
1118 (UnaryPlusNode):
1119 (NegateNode):
1120 (BitwiseNotNode):
1121 (LogicalNotNode):
1122 (BinaryOpNode):
1123 (MultNode):
1124 (DivNode):
1125 (ModNode):
1126 (AddNode):
1127 (SubNode):
1128 (LeftShiftNode):
1129 (RightShiftNode):
1130 (UnsignedRightShiftNode):
1131 (LessNode):
1132 (GreaterNode):
1133 (LessEqNode):
1134 (GreaterEqNode):
1135 (ThrowableBinaryOpNode):
1136 (InstanceOfNode):
1137 (InNode):
1138 (EqualNode):
1139 (NotEqualNode):
1140 (StrictEqualNode):
1141 (NotStrictEqualNode):
1142 (BitAndNode):
1143 (BitOrNode):
1144 (BitXOrNode):
1145 (LogicalOpNode):
1146 (ConditionalNode):
1147 (ReadModifyResolveNode):
1148 (AssignResolveNode):
1149 (ReadModifyBracketNode):
1150 (AssignBracketNode):
1151 (AssignDotNode):
1152 (ReadModifyDotNode):
1153 (AssignErrorNode):
1154 (CommaNode):
1155 (ConstDeclNode):
1156 (ConstStatementNode):
1157 (BlockNode):
1158 (EmptyStatementNode):
1159 (DebuggerStatementNode):
1160 (ExprStatementNode):
1161 (VarStatementNode):
1162 (IfNode):
1163 (IfElseNode):
1164 (DoWhileNode):
1165 (WhileNode):
1166 (ForNode):
1167 (ForInNode):
1168 (ContinueNode):
1169 (BreakNode):
1170 (ReturnNode):
1171 (WithNode):
1172 (LabelNode):
1173 (ThrowNode):
1174 (TryNode):
1175 (ScopeNode):
1176 (ProgramNode):
1177 (EvalNode):
1178 (FunctionBodyNode):
1179 (FuncExprNode):
1180 (FuncDeclNode):
1181 (SwitchNode):
1182 * parser/Parser.cpp:
1183 (JSC::::parseSourceElements):
1184 (JSC::::parseVarDeclaration):
1185 (JSC::::parseConstDeclaration):
1186 (JSC::::parseDoWhileStatement):
1187 (JSC::::parseWhileStatement):
1188 (JSC::::parseVarDeclarationList):
1189 (JSC::::parseConstDeclarationList):
1190 (JSC::::parseForStatement):
1191 (JSC::::parseBreakStatement):
1192 (JSC::::parseContinueStatement):
1193 (JSC::::parseReturnStatement):
1194 (JSC::::parseThrowStatement):
1195 (JSC::::parseWithStatement):
1196 (JSC::::parseSwitchStatement):
1197 (JSC::::parseTryStatement):
1198 (JSC::::parseDebuggerStatement):
1199 (JSC::::parseBlockStatement):
1200 (JSC::::parseStatement):
1201 (JSC::::parseFunctionBody):
1202 (JSC::::parseFunctionInfo):
1203 (JSC::::parseFunctionDeclaration):
1204 (JSC::::parseExpressionOrLabelStatement):
1205 (JSC::::parseExpressionStatement):
1206 (JSC::::parseIfStatement):
1207 (JSC::::parseExpression):
1208 (JSC::::parseAssignmentExpression):
1209 (JSC::::parseConditionalExpression):
1210 (JSC::::parseBinaryExpression):
1211 (JSC::::parseProperty):
1212 (JSC::::parseObjectLiteral):
1213 (JSC::::parseStrictObjectLiteral):
1214 (JSC::::parseArrayLiteral):
1215 (JSC::::parsePrimaryExpression):
1216 (JSC::::parseArguments):
1217 (JSC::::parseMemberExpression):
1218 (JSC::::parseUnaryExpression):
1219 * parser/Parser.h:
1220 (JSC::Parser::next):
1221 (JSC::Parser::nextExpectIdentifier):
1222 (JSC::Parser::tokenStart):
1223 (JSC::Parser::tokenLine):
1224 (JSC::Parser::tokenEnd):
1225 (JSC::Parser::tokenLocation):
1226 (Parser):
1227 (JSC::Parser::getTokenName):
1228 (JSC::::parse):
1229 * parser/ParserTokens.h:
1230 (JSC::JSTokenLocation::JSTokenLocation):
1231 (JSTokenLocation):
1232 (JSToken):
1233 * parser/SourceProviderCacheItem.h:
1234 (JSC::SourceProviderCacheItem::closeBraceToken):
1235 * parser/SyntaxChecker.h:
1236 (JSC::SyntaxChecker::makeFunctionCallNode):
1237 (JSC::SyntaxChecker::createCommaExpr):
1238 (JSC::SyntaxChecker::makeAssignNode):
1239 (JSC::SyntaxChecker::makePrefixNode):
1240 (JSC::SyntaxChecker::makePostfixNode):
1241 (JSC::SyntaxChecker::makeTypeOfNode):
1242 (JSC::SyntaxChecker::makeDeleteNode):
1243 (JSC::SyntaxChecker::makeNegateNode):
1244 (JSC::SyntaxChecker::makeBitwiseNotNode):
1245 (JSC::SyntaxChecker::createLogicalNot):
1246 (JSC::SyntaxChecker::createUnaryPlus):
1247 (JSC::SyntaxChecker::createVoid):
1248 (JSC::SyntaxChecker::thisExpr):
1249 (JSC::SyntaxChecker::createResolve):
1250 (JSC::SyntaxChecker::createObjectLiteral):
1251 (JSC::SyntaxChecker::createArray):
1252 (JSC::SyntaxChecker::createNumberExpr):
1253 (JSC::SyntaxChecker::createString):
1254 (JSC::SyntaxChecker::createBoolean):
1255 (JSC::SyntaxChecker::createNull):
1256 (JSC::SyntaxChecker::createBracketAccess):
1257 (JSC::SyntaxChecker::createDotAccess):
1258 (JSC::SyntaxChecker::createRegExp):
1259 (JSC::SyntaxChecker::createNewExpr):
1260 (JSC::SyntaxChecker::createConditionalExpr):
1261 (JSC::SyntaxChecker::createAssignResolve):
1262 (JSC::SyntaxChecker::createFunctionExpr):
1263 (JSC::SyntaxChecker::createFunctionBody):
1264 (JSC::SyntaxChecker::createArgumentsList):
1265 (JSC::SyntaxChecker::createPropertyList):
1266 (JSC::SyntaxChecker::createFuncDeclStatement):
1267 (JSC::SyntaxChecker::createBlockStatement):
1268 (JSC::SyntaxChecker::createExprStatement):
1269 (JSC::SyntaxChecker::createIfStatement):
1270 (JSC::SyntaxChecker::createForLoop):
1271 (JSC::SyntaxChecker::createForInLoop):
1272 (JSC::SyntaxChecker::createEmptyStatement):
1273 (JSC::SyntaxChecker::createVarStatement):
1274 (JSC::SyntaxChecker::createReturnStatement):
1275 (JSC::SyntaxChecker::createBreakStatement):
1276 (JSC::SyntaxChecker::createContinueStatement):
1277 (JSC::SyntaxChecker::createTryStatement):
1278 (JSC::SyntaxChecker::createSwitchStatement):
1279 (JSC::SyntaxChecker::createWhileStatement):
1280 (JSC::SyntaxChecker::createWithStatement):
1281 (JSC::SyntaxChecker::createDoWhileStatement):
1282 (JSC::SyntaxChecker::createLabelStatement):
1283 (JSC::SyntaxChecker::createThrowStatement):
1284 (JSC::SyntaxChecker::createDebugger):
1285 (JSC::SyntaxChecker::createConstStatement):
1286 (JSC::SyntaxChecker::appendConstDecl):
1287 (JSC::SyntaxChecker::createGetterOrSetterProperty):
1288 (JSC::SyntaxChecker::combineCommaNodes):
1289 (JSC::SyntaxChecker::operatorStackPop):
1290
fpizlo@apple.com8ab9c432012-08-03 21:41:05 +000012912012-08-03 Filip Pizlo <fpizlo@apple.com>
1292
fpizlo@apple.com63dda942012-08-04 01:01:27 +00001293 Crashes in dfgBuildPutByIdList when clicking on just about anything on Google Maps
1294 https://bugs.webkit.org/show_bug.cgi?id=92691
1295
1296 Reviewed by Mark Hahnenberg.
1297
1298 The state of the stubs was changing after we determined the type (by virtue of the slow path
1299 function that was called), since the get or put (in this case put) could cause arbitrary
1300 side effects. Perhaps a full-blown fix would be to eliminate our reliance of the slow path
1301 function to determine what to do, but an easier fix for now is to have the slow path give up
1302 if its assumptions were invalidated by a side effect.
1303
1304 * dfg/DFGOperations.cpp:
1305 * jit/JITStubs.cpp:
1306 (JSC::DEFINE_STUB_FUNCTION):
1307
13082012-08-03 Filip Pizlo <fpizlo@apple.com>
1309
fpizlo@apple.come4a4d792012-08-03 22:42:29 +00001310 DFG handling of get_by_id should always inject a ForceOSRExit node if there is no prediction
1311 https://bugs.webkit.org/show_bug.cgi?id=93162
1312
1313 Reviewed by Mark Hahnenberg.
1314
1315 This simplifies the DFG IR by ensuring that all nodes that use value profiles will be preceded
1316 by a ForceOSRExit if the value profile had no data.
1317
1318 * dfg/DFGByteCodeParser.cpp:
1319 (JSC::DFG::ByteCodeParser::parseBlock):
1320
13212012-08-03 Filip Pizlo <fpizlo@apple.com>
1322
fpizlo@apple.com8ab9c432012-08-03 21:41:05 +00001323 DFG::StructureCheckHoistingPhase keeps a Node& around for too long
1324 https://bugs.webkit.org/show_bug.cgi?id=93157
1325
1326 Reviewed by Mark Hahnenberg.
1327
1328 * dfg/DFGStructureCheckHoistingPhase.cpp:
1329 (JSC::DFG::StructureCheckHoistingPhase::run):
1330
paroga@webkit.org438d93a2012-08-03 05:06:38 +000013312012-08-02 Patrick Gansterer <paroga@webkit.org>
1332
1333 Move getLocalTime() as static inline function to DateMath
1334 https://bugs.webkit.org/show_bug.cgi?id=92955
1335
1336 Reviewed by Ryosuke Niwa.
1337
1338 getCurrentLocalTime() and getLocalTime() has been superseded with the
1339 GregorianDateTime class. So we can move it into DateMath.cpp as an static inline
1340 function. This allows us to remove the dependecy on time() and localtime()
1341 for Windows CE, where this functions require the ce_time library to work.
1342
1343 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
1344
fpizlo@apple.com3088f182012-08-02 21:10:43 +000013452012-08-02 Filip Pizlo <fpizlo@apple.com>
1346
fpizlo@apple.com978a0eb2012-08-03 03:27:08 +00001347 ASSERTION FAILED: at(m_compileIndex).canExit() || m_isCheckingArgumentTypes
1348 https://bugs.webkit.org/show_bug.cgi?id=91074
1349
1350 Reviewed by Mark Hahnenberg.
1351
1352 Fixes a bug where the speculative JIT was performing an unnecessary speculation that the
1353 CFA had proven shouldn't be performed, leading to asserts that a node should not have
1354 exit sites. This is a debug-only assert with no release symptom - we were just emitting
1355 a check that was not reachable.
1356
1357 Also found, and fixed, a bug where structure check hoisting was slightly confusing the
1358 CFA by inserting GetLocal's into the graph. CSE would clean the GetLocal's up, which
1359 would make the backend happy - but the CFA would produce subtly wrong results.
1360
1361 * bytecode/SpeculatedType.h:
1362 (JSC::isOtherOrEmptySpeculation):
1363 (JSC):
1364 * dfg/DFGDriver.cpp:
1365 (JSC::DFG::compile):
1366 * dfg/DFGGraph.cpp:
1367 (JSC::DFG::Graph::dump):
1368 * dfg/DFGSpeculativeJIT64.cpp:
1369 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
1370 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
1371
13722012-08-02 Filip Pizlo <fpizlo@apple.com>
1373
fpizlo@apple.com3088f182012-08-02 21:10:43 +00001374 Unreviewed, build fix for DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE).
1375
1376 * dfg/DFGStructureCheckHoistingPhase.cpp:
1377 (JSC::DFG::StructureCheckHoistingPhase::run):
1378
mhahnenberg@apple.com85c200b2012-08-02 17:32:35 +000013792012-08-01 Mark Hahnenberg <mhahnenberg@apple.com>
1380
1381 Remove all uses of ClassInfo for JSStrings in JIT code
1382 https://bugs.webkit.org/show_bug.cgi?id=92935
1383
1384 Reviewed by Geoffrey Garen.
1385
1386 This is the first step in removing our dependence on in-object ClassInfo pointers
1387 in JIT code. Most of the changes are to check the Structure, which is unique for
1388 JSString primitives.
1389
1390 * bytecode/SpeculatedType.cpp:
1391 (JSC::speculationFromClassInfo):
1392 (JSC::speculationFromStructure): Changed to check the TypeInfo in the Structure
1393 since there wasn't a JSGlobalData immediately available to grab the JSString
1394 Structure out of.
1395 * dfg/DFGSpeculativeJIT.cpp:
1396 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
1397 * dfg/DFGSpeculativeJIT32_64.cpp:
1398 (JSC::DFG::SpeculativeJIT::compile):
1399 * dfg/DFGSpeculativeJIT64.cpp:
1400 (JSC::DFG::SpeculativeJIT::compile):
1401 * jit/JITInlineMethods.h:
1402 (JSC::JIT::emitLoadCharacterString):
1403 * jit/JITOpcodes.cpp:
1404 (JSC::JIT::privateCompileCTIMachineTrampolines):
1405 (JSC::JIT::emit_op_to_primitive):
1406 (JSC::JIT::emit_op_convert_this):
1407 * jit/JITOpcodes32_64.cpp:
1408 (JSC::JIT::privateCompileCTIMachineTrampolines):
1409 (JSC::JIT::emit_op_to_primitive):
1410 (JSC::JIT::emitSlow_op_eq):
1411 (JSC::JIT::emitSlow_op_neq):
1412 (JSC::JIT::compileOpStrictEq):
1413 (JSC::JIT::emit_op_convert_this):
1414 * jit/JITPropertyAccess.cpp:
1415 (JSC::JIT::stringGetByValStubGenerator):
1416 (JSC::JIT::emitSlow_op_get_by_val):
1417 * jit/JITPropertyAccess32_64.cpp:
1418 (JSC::JIT::stringGetByValStubGenerator):
1419 (JSC::JIT::emitSlow_op_get_by_val):
1420 * jit/SpecializedThunkJIT.h:
1421 (JSC::SpecializedThunkJIT::loadJSStringArgument):
1422 * jit/ThunkGenerators.cpp:
1423 (JSC::stringCharLoad):
1424 (JSC::charCodeAtThunkGenerator):
1425 (JSC::charAtThunkGenerator):
1426
fpizlo@apple.com58ec4b02012-08-02 08:22:57 +000014272012-08-02 Filip Pizlo <fpizlo@apple.com>
1428
fpizlo@apple.com470cde52012-08-02 08:27:48 +00001429 Unreviewed, missed a style goof in the previous patch: "NodeIndex nodeIndex"
1430 in a method signature is painfully redundant.
1431
1432 * dfg/DFGSpeculativeJIT.h:
1433 (SpeculativeJIT):
1434
14352012-08-02 Filip Pizlo <fpizlo@apple.com>
1436
fpizlo@apple.com58ec4b02012-08-02 08:22:57 +00001437 DFGSpeculativeJIT.h has too many inline method bodies
1438 https://bugs.webkit.org/show_bug.cgi?id=92957
1439
1440 Reviewed by Antti Koivisto.
1441
1442 * dfg/DFGSpeculativeJIT.cpp:
1443 (JSC::DFG::SpeculativeJIT::speculationCheck):
1444 (DFG):
1445 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
1446 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
1447 (JSC::DFG::SpeculativeJIT::speculationCheckWithConditionalDirection):
1448 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
1449 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection):
1450 * dfg/DFGSpeculativeJIT.h:
1451 (SpeculativeJIT):
1452
commit-queue@webkit.org709de8f2012-08-02 06:44:46 +000014532012-08-01 Sheriff Bot <webkit.review.bot@gmail.com>
1454
1455 Unreviewed, rolling out r124406.
1456 http://trac.webkit.org/changeset/124406
1457 https://bugs.webkit.org/show_bug.cgi?id=92951
1458
1459 it set the Mac bots on fire (Requested by pizlo on #webkit).
1460
1461 * bytecode/Opcode.h:
1462 (JSC):
1463 (JSC::padOpcodeName):
1464 * bytecompiler/BytecodeGenerator.cpp:
1465 (JSC::BytecodeGenerator::emitDebugHook):
1466 * bytecompiler/BytecodeGenerator.h:
1467 (BytecodeGenerator):
1468 * bytecompiler/NodesCodegen.cpp:
1469 (JSC::ArrayNode::toArgumentList):
1470 (JSC::ApplyFunctionCallDotNode::emitBytecode):
1471 (JSC::ConditionalNode::emitBytecode):
1472 (JSC::ConstStatementNode::emitBytecode):
1473 (JSC::EmptyStatementNode::emitBytecode):
1474 (JSC::DebuggerStatementNode::emitBytecode):
1475 (JSC::ExprStatementNode::emitBytecode):
1476 (JSC::VarStatementNode::emitBytecode):
1477 (JSC::IfNode::emitBytecode):
1478 (JSC::IfElseNode::emitBytecode):
1479 (JSC::DoWhileNode::emitBytecode):
1480 (JSC::WhileNode::emitBytecode):
1481 (JSC::ForNode::emitBytecode):
1482 (JSC::ForInNode::emitBytecode):
1483 (JSC::ContinueNode::emitBytecode):
1484 (JSC::BreakNode::emitBytecode):
1485 (JSC::ReturnNode::emitBytecode):
1486 (JSC::WithNode::emitBytecode):
1487 (JSC::SwitchNode::emitBytecode):
1488 (JSC::LabelNode::emitBytecode):
1489 (JSC::ThrowNode::emitBytecode):
1490 (JSC::TryNode::emitBytecode):
1491 (JSC::ProgramNode::emitBytecode):
1492 (JSC::EvalNode::emitBytecode):
1493 (JSC::FunctionBodyNode::emitBytecode):
1494 * debugger/Debugger.h:
1495 * interpreter/Interpreter.cpp:
1496 (JSC::Interpreter::unwindCallFrame):
1497 (JSC::Interpreter::throwException):
1498 (JSC::Interpreter::debug):
1499 * interpreter/Interpreter.h:
1500 (Interpreter):
1501 * jit/JITOpcodes.cpp:
1502 (JSC::JIT::emit_op_debug):
1503 * jit/JITOpcodes32_64.cpp:
1504 (JSC::JIT::emit_op_debug):
1505 * jit/JITStubs.cpp:
1506 (JSC::DEFINE_STUB_FUNCTION):
1507 * llint/LLIntSlowPaths.cpp:
1508 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
1509 * parser/ASTBuilder.h:
1510 (ASTBuilder):
1511 (JSC::ASTBuilder::createCommaExpr):
1512 (JSC::ASTBuilder::createLogicalNot):
1513 (JSC::ASTBuilder::createUnaryPlus):
1514 (JSC::ASTBuilder::createVoid):
1515 (JSC::ASTBuilder::thisExpr):
1516 (JSC::ASTBuilder::createResolve):
1517 (JSC::ASTBuilder::createObjectLiteral):
1518 (JSC::ASTBuilder::createArray):
1519 (JSC::ASTBuilder::createNumberExpr):
1520 (JSC::ASTBuilder::createString):
1521 (JSC::ASTBuilder::createBoolean):
1522 (JSC::ASTBuilder::createNull):
1523 (JSC::ASTBuilder::createBracketAccess):
1524 (JSC::ASTBuilder::createDotAccess):
1525 (JSC::ASTBuilder::createRegExp):
1526 (JSC::ASTBuilder::createNewExpr):
1527 (JSC::ASTBuilder::createConditionalExpr):
1528 (JSC::ASTBuilder::createAssignResolve):
1529 (JSC::ASTBuilder::createFunctionExpr):
1530 (JSC::ASTBuilder::createFunctionBody):
1531 (JSC::ASTBuilder::createGetterOrSetterProperty):
1532 (JSC::ASTBuilder::createArgumentsList):
1533 (JSC::ASTBuilder::createPropertyList):
1534 (JSC::ASTBuilder::createFuncDeclStatement):
1535 (JSC::ASTBuilder::createBlockStatement):
1536 (JSC::ASTBuilder::createExprStatement):
1537 (JSC::ASTBuilder::createIfStatement):
1538 (JSC::ASTBuilder::createForLoop):
1539 (JSC::ASTBuilder::createForInLoop):
1540 (JSC::ASTBuilder::createEmptyStatement):
1541 (JSC::ASTBuilder::createVarStatement):
1542 (JSC::ASTBuilder::createReturnStatement):
1543 (JSC::ASTBuilder::createBreakStatement):
1544 (JSC::ASTBuilder::createContinueStatement):
1545 (JSC::ASTBuilder::createTryStatement):
1546 (JSC::ASTBuilder::createSwitchStatement):
1547 (JSC::ASTBuilder::createWhileStatement):
1548 (JSC::ASTBuilder::createDoWhileStatement):
1549 (JSC::ASTBuilder::createLabelStatement):
1550 (JSC::ASTBuilder::createWithStatement):
1551 (JSC::ASTBuilder::createThrowStatement):
1552 (JSC::ASTBuilder::createDebugger):
1553 (JSC::ASTBuilder::createConstStatement):
1554 (JSC::ASTBuilder::appendConstDecl):
1555 (JSC::ASTBuilder::combineCommaNodes):
1556 (JSC::ASTBuilder::appendBinaryOperation):
1557 (JSC::ASTBuilder::createAssignment):
1558 (JSC::ASTBuilder::createNumber):
1559 (JSC::ASTBuilder::makeTypeOfNode):
1560 (JSC::ASTBuilder::makeDeleteNode):
1561 (JSC::ASTBuilder::makeNegateNode):
1562 (JSC::ASTBuilder::makeBitwiseNotNode):
1563 (JSC::ASTBuilder::makeMultNode):
1564 (JSC::ASTBuilder::makeDivNode):
1565 (JSC::ASTBuilder::makeModNode):
1566 (JSC::ASTBuilder::makeAddNode):
1567 (JSC::ASTBuilder::makeSubNode):
1568 (JSC::ASTBuilder::makeLeftShiftNode):
1569 (JSC::ASTBuilder::makeRightShiftNode):
1570 (JSC::ASTBuilder::makeURightShiftNode):
1571 (JSC::ASTBuilder::makeBitOrNode):
1572 (JSC::ASTBuilder::makeBitAndNode):
1573 (JSC::ASTBuilder::makeBitXOrNode):
1574 (JSC::ASTBuilder::makeFunctionCallNode):
1575 (JSC::ASTBuilder::makeBinaryNode):
1576 (JSC::ASTBuilder::makeAssignNode):
1577 (JSC::ASTBuilder::makePrefixNode):
1578 (JSC::ASTBuilder::makePostfixNode):
1579 * parser/Lexer.cpp:
1580 (JSC::::setCode):
1581 (JSC::::internalShift):
1582 (JSC::::shift):
1583 (JSC::::lex):
1584 * parser/Lexer.h:
1585 (Lexer):
1586 (JSC::::lexExpectIdentifier):
1587 * parser/NodeConstructors.h:
1588 (JSC::Node::Node):
1589 (JSC::ExpressionNode::ExpressionNode):
1590 (JSC::StatementNode::StatementNode):
1591 (JSC::NullNode::NullNode):
1592 (JSC::BooleanNode::BooleanNode):
1593 (JSC::NumberNode::NumberNode):
1594 (JSC::StringNode::StringNode):
1595 (JSC::RegExpNode::RegExpNode):
1596 (JSC::ThisNode::ThisNode):
1597 (JSC::ResolveNode::ResolveNode):
1598 (JSC::ArrayNode::ArrayNode):
1599 (JSC::PropertyListNode::PropertyListNode):
1600 (JSC::ObjectLiteralNode::ObjectLiteralNode):
1601 (JSC::BracketAccessorNode::BracketAccessorNode):
1602 (JSC::DotAccessorNode::DotAccessorNode):
1603 (JSC::ArgumentListNode::ArgumentListNode):
1604 (JSC::NewExprNode::NewExprNode):
1605 (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
1606 (JSC::FunctionCallValueNode::FunctionCallValueNode):
1607 (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
1608 (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
1609 (JSC::FunctionCallDotNode::FunctionCallDotNode):
1610 (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
1611 (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
1612 (JSC::PrePostResolveNode::PrePostResolveNode):
1613 (JSC::PostfixResolveNode::PostfixResolveNode):
1614 (JSC::PostfixBracketNode::PostfixBracketNode):
1615 (JSC::PostfixDotNode::PostfixDotNode):
1616 (JSC::PostfixErrorNode::PostfixErrorNode):
1617 (JSC::DeleteResolveNode::DeleteResolveNode):
1618 (JSC::DeleteBracketNode::DeleteBracketNode):
1619 (JSC::DeleteDotNode::DeleteDotNode):
1620 (JSC::DeleteValueNode::DeleteValueNode):
1621 (JSC::VoidNode::VoidNode):
1622 (JSC::TypeOfResolveNode::TypeOfResolveNode):
1623 (JSC::TypeOfValueNode::TypeOfValueNode):
1624 (JSC::PrefixResolveNode::PrefixResolveNode):
1625 (JSC::PrefixBracketNode::PrefixBracketNode):
1626 (JSC::PrefixDotNode::PrefixDotNode):
1627 (JSC::PrefixErrorNode::PrefixErrorNode):
1628 (JSC::UnaryOpNode::UnaryOpNode):
1629 (JSC::UnaryPlusNode::UnaryPlusNode):
1630 (JSC::NegateNode::NegateNode):
1631 (JSC::BitwiseNotNode::BitwiseNotNode):
1632 (JSC::LogicalNotNode::LogicalNotNode):
1633 (JSC::BinaryOpNode::BinaryOpNode):
1634 (JSC::MultNode::MultNode):
1635 (JSC::DivNode::DivNode):
1636 (JSC::ModNode::ModNode):
1637 (JSC::AddNode::AddNode):
1638 (JSC::SubNode::SubNode):
1639 (JSC::LeftShiftNode::LeftShiftNode):
1640 (JSC::RightShiftNode::RightShiftNode):
1641 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
1642 (JSC::LessNode::LessNode):
1643 (JSC::GreaterNode::GreaterNode):
1644 (JSC::LessEqNode::LessEqNode):
1645 (JSC::GreaterEqNode::GreaterEqNode):
1646 (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
1647 (JSC::InstanceOfNode::InstanceOfNode):
1648 (JSC::InNode::InNode):
1649 (JSC::EqualNode::EqualNode):
1650 (JSC::NotEqualNode::NotEqualNode):
1651 (JSC::StrictEqualNode::StrictEqualNode):
1652 (JSC::NotStrictEqualNode::NotStrictEqualNode):
1653 (JSC::BitAndNode::BitAndNode):
1654 (JSC::BitOrNode::BitOrNode):
1655 (JSC::BitXOrNode::BitXOrNode):
1656 (JSC::LogicalOpNode::LogicalOpNode):
1657 (JSC::ConditionalNode::ConditionalNode):
1658 (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
1659 (JSC::AssignResolveNode::AssignResolveNode):
1660 (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
1661 (JSC::AssignBracketNode::AssignBracketNode):
1662 (JSC::AssignDotNode::AssignDotNode):
1663 (JSC::ReadModifyDotNode::ReadModifyDotNode):
1664 (JSC::AssignErrorNode::AssignErrorNode):
1665 (JSC::CommaNode::CommaNode):
1666 (JSC::ConstStatementNode::ConstStatementNode):
1667 (JSC::EmptyStatementNode::EmptyStatementNode):
1668 (JSC::DebuggerStatementNode::DebuggerStatementNode):
1669 (JSC::ExprStatementNode::ExprStatementNode):
1670 (JSC::VarStatementNode::VarStatementNode):
1671 (JSC::IfNode::IfNode):
1672 (JSC::IfElseNode::IfElseNode):
1673 (JSC::DoWhileNode::DoWhileNode):
1674 (JSC::WhileNode::WhileNode):
1675 (JSC::ForNode::ForNode):
1676 (JSC::ContinueNode::ContinueNode):
1677 (JSC::BreakNode::BreakNode):
1678 (JSC::ReturnNode::ReturnNode):
1679 (JSC::WithNode::WithNode):
1680 (JSC::LabelNode::LabelNode):
1681 (JSC::ThrowNode::ThrowNode):
1682 (JSC::TryNode::TryNode):
1683 (JSC::FuncExprNode::FuncExprNode):
1684 (JSC::FuncDeclNode::FuncDeclNode):
1685 (JSC::SwitchNode::SwitchNode):
1686 (JSC::ConstDeclNode::ConstDeclNode):
1687 (JSC::BlockNode::BlockNode):
1688 (JSC::ForInNode::ForInNode):
1689 * parser/Nodes.cpp:
1690 (JSC):
1691 (JSC::StatementNode::setLoc):
1692 (JSC::ScopeNode::ScopeNode):
1693 (JSC::ProgramNode::ProgramNode):
1694 (JSC::ProgramNode::create):
1695 (JSC::EvalNode::EvalNode):
1696 (JSC::EvalNode::create):
1697 (JSC::FunctionBodyNode::FunctionBodyNode):
1698 (JSC::FunctionBodyNode::create):
1699 * parser/Nodes.h:
1700 (Node):
1701 (ExpressionNode):
1702 (StatementNode):
1703 (NullNode):
1704 (BooleanNode):
1705 (NumberNode):
1706 (StringNode):
1707 (RegExpNode):
1708 (ThisNode):
1709 (ResolveNode):
1710 (ArrayNode):
1711 (PropertyListNode):
1712 (ObjectLiteralNode):
1713 (BracketAccessorNode):
1714 (DotAccessorNode):
1715 (ArgumentListNode):
1716 (NewExprNode):
1717 (EvalFunctionCallNode):
1718 (FunctionCallValueNode):
1719 (FunctionCallResolveNode):
1720 (FunctionCallBracketNode):
1721 (FunctionCallDotNode):
1722 (CallFunctionCallDotNode):
1723 (ApplyFunctionCallDotNode):
1724 (PrePostResolveNode):
1725 (PostfixResolveNode):
1726 (PostfixBracketNode):
1727 (PostfixDotNode):
1728 (PostfixErrorNode):
1729 (DeleteResolveNode):
1730 (DeleteBracketNode):
1731 (DeleteDotNode):
1732 (DeleteValueNode):
1733 (VoidNode):
1734 (TypeOfResolveNode):
1735 (TypeOfValueNode):
1736 (PrefixResolveNode):
1737 (PrefixBracketNode):
1738 (PrefixDotNode):
1739 (PrefixErrorNode):
1740 (UnaryOpNode):
1741 (UnaryPlusNode):
1742 (NegateNode):
1743 (BitwiseNotNode):
1744 (LogicalNotNode):
1745 (BinaryOpNode):
1746 (MultNode):
1747 (DivNode):
1748 (ModNode):
1749 (AddNode):
1750 (SubNode):
1751 (LeftShiftNode):
1752 (RightShiftNode):
1753 (UnsignedRightShiftNode):
1754 (LessNode):
1755 (GreaterNode):
1756 (LessEqNode):
1757 (GreaterEqNode):
1758 (ThrowableBinaryOpNode):
1759 (InstanceOfNode):
1760 (InNode):
1761 (EqualNode):
1762 (NotEqualNode):
1763 (StrictEqualNode):
1764 (NotStrictEqualNode):
1765 (BitAndNode):
1766 (BitOrNode):
1767 (BitXOrNode):
1768 (LogicalOpNode):
1769 (ConditionalNode):
1770 (ReadModifyResolveNode):
1771 (AssignResolveNode):
1772 (ReadModifyBracketNode):
1773 (AssignBracketNode):
1774 (AssignDotNode):
1775 (ReadModifyDotNode):
1776 (AssignErrorNode):
1777 (CommaNode):
1778 (ConstDeclNode):
1779 (ConstStatementNode):
1780 (BlockNode):
1781 (EmptyStatementNode):
1782 (DebuggerStatementNode):
1783 (ExprStatementNode):
1784 (VarStatementNode):
1785 (IfNode):
1786 (IfElseNode):
1787 (DoWhileNode):
1788 (WhileNode):
1789 (ForNode):
1790 (ForInNode):
1791 (ContinueNode):
1792 (BreakNode):
1793 (ReturnNode):
1794 (WithNode):
1795 (LabelNode):
1796 (ThrowNode):
1797 (TryNode):
1798 (ScopeNode):
1799 (ProgramNode):
1800 (EvalNode):
1801 (FunctionBodyNode):
1802 (FuncExprNode):
1803 (FuncDeclNode):
1804 (SwitchNode):
1805 * parser/Parser.cpp:
1806 (JSC::::parseSourceElements):
1807 (JSC::::parseVarDeclaration):
1808 (JSC::::parseConstDeclaration):
1809 (JSC::::parseDoWhileStatement):
1810 (JSC::::parseWhileStatement):
1811 (JSC::::parseVarDeclarationList):
1812 (JSC::::parseConstDeclarationList):
1813 (JSC::::parseForStatement):
1814 (JSC::::parseBreakStatement):
1815 (JSC::::parseContinueStatement):
1816 (JSC::::parseReturnStatement):
1817 (JSC::::parseThrowStatement):
1818 (JSC::::parseWithStatement):
1819 (JSC::::parseSwitchStatement):
1820 (JSC::::parseTryStatement):
1821 (JSC::::parseDebuggerStatement):
1822 (JSC::::parseBlockStatement):
1823 (JSC::::parseStatement):
1824 (JSC::::parseFunctionBody):
1825 (JSC::::parseFunctionInfo):
1826 (JSC::::parseFunctionDeclaration):
1827 (JSC::::parseExpressionOrLabelStatement):
1828 (JSC::::parseExpressionStatement):
1829 (JSC::::parseIfStatement):
1830 (JSC::::parseExpression):
1831 (JSC::::parseAssignmentExpression):
1832 (JSC::::parseConditionalExpression):
1833 (JSC::::parseBinaryExpression):
1834 (JSC::::parseProperty):
1835 (JSC::::parseObjectLiteral):
1836 (JSC::::parseStrictObjectLiteral):
1837 (JSC::::parseArrayLiteral):
1838 (JSC::::parsePrimaryExpression):
1839 (JSC::::parseArguments):
1840 (JSC::::parseMemberExpression):
1841 (JSC::::parseUnaryExpression):
1842 * parser/Parser.h:
1843 (JSC::Parser::next):
1844 (JSC::Parser::nextExpectIdentifier):
1845 (JSC::Parser::tokenStart):
1846 (JSC::Parser::tokenLine):
1847 (JSC::Parser::tokenEnd):
1848 (JSC::Parser::getTokenName):
1849 (JSC::::parse):
1850 * parser/ParserTokens.h:
1851 (JSC::JSTokenInfo::JSTokenInfo):
1852 (JSTokenInfo):
1853 (JSToken):
1854 * parser/SourceProviderCacheItem.h:
1855 (JSC::SourceProviderCacheItem::closeBraceToken):
1856 * parser/SyntaxChecker.h:
1857 (JSC::SyntaxChecker::makeFunctionCallNode):
1858 (JSC::SyntaxChecker::createCommaExpr):
1859 (JSC::SyntaxChecker::makeAssignNode):
1860 (JSC::SyntaxChecker::makePrefixNode):
1861 (JSC::SyntaxChecker::makePostfixNode):
1862 (JSC::SyntaxChecker::makeTypeOfNode):
1863 (JSC::SyntaxChecker::makeDeleteNode):
1864 (JSC::SyntaxChecker::makeNegateNode):
1865 (JSC::SyntaxChecker::makeBitwiseNotNode):
1866 (JSC::SyntaxChecker::createLogicalNot):
1867 (JSC::SyntaxChecker::createUnaryPlus):
1868 (JSC::SyntaxChecker::createVoid):
1869 (JSC::SyntaxChecker::thisExpr):
1870 (JSC::SyntaxChecker::createResolve):
1871 (JSC::SyntaxChecker::createObjectLiteral):
1872 (JSC::SyntaxChecker::createArray):
1873 (JSC::SyntaxChecker::createNumberExpr):
1874 (JSC::SyntaxChecker::createString):
1875 (JSC::SyntaxChecker::createBoolean):
1876 (JSC::SyntaxChecker::createNull):
1877 (JSC::SyntaxChecker::createBracketAccess):
1878 (JSC::SyntaxChecker::createDotAccess):
1879 (JSC::SyntaxChecker::createRegExp):
1880 (JSC::SyntaxChecker::createNewExpr):
1881 (JSC::SyntaxChecker::createConditionalExpr):
1882 (JSC::SyntaxChecker::createAssignResolve):
1883 (JSC::SyntaxChecker::createFunctionExpr):
1884 (JSC::SyntaxChecker::createFunctionBody):
1885 (JSC::SyntaxChecker::createArgumentsList):
1886 (JSC::SyntaxChecker::createPropertyList):
1887 (JSC::SyntaxChecker::createFuncDeclStatement):
1888 (JSC::SyntaxChecker::createBlockStatement):
1889 (JSC::SyntaxChecker::createExprStatement):
1890 (JSC::SyntaxChecker::createIfStatement):
1891 (JSC::SyntaxChecker::createForLoop):
1892 (JSC::SyntaxChecker::createForInLoop):
1893 (JSC::SyntaxChecker::createEmptyStatement):
1894 (JSC::SyntaxChecker::createVarStatement):
1895 (JSC::SyntaxChecker::createReturnStatement):
1896 (JSC::SyntaxChecker::createBreakStatement):
1897 (JSC::SyntaxChecker::createContinueStatement):
1898 (JSC::SyntaxChecker::createTryStatement):
1899 (JSC::SyntaxChecker::createSwitchStatement):
1900 (JSC::SyntaxChecker::createWhileStatement):
1901 (JSC::SyntaxChecker::createWithStatement):
1902 (JSC::SyntaxChecker::createDoWhileStatement):
1903 (JSC::SyntaxChecker::createLabelStatement):
1904 (JSC::SyntaxChecker::createThrowStatement):
1905 (JSC::SyntaxChecker::createDebugger):
1906 (JSC::SyntaxChecker::createConstStatement):
1907 (JSC::SyntaxChecker::appendConstDecl):
1908 (JSC::SyntaxChecker::createGetterOrSetterProperty):
1909 (JSC::SyntaxChecker::combineCommaNodes):
1910 (JSC::SyntaxChecker::operatorStackPop):
1911
commit-queue@webkit.org3772d072012-08-02 04:49:25 +000019122012-08-01 Peter Wang <peter.wang@torchmobile.com.cn>
1913
1914 Web Inspector: [JSC] implement setting breakpoints by line:column
1915 https://bugs.webkit.org/show_bug.cgi?id=53003
1916
1917 Reviewed by Geoffrey Garen.
1918
1919 Add a counter in lexer to record the column of each token. Debugger will use column info
1920 in "Pretty Print" debug mode of Inspector.
1921
1922 * bytecode/Opcode.h:
1923 (JSC):
1924 (JSC::padOpcodeName):
1925 * bytecompiler/BytecodeGenerator.cpp:
1926 (JSC::BytecodeGenerator::emitDebugHook):
1927 * bytecompiler/BytecodeGenerator.h:
1928 (BytecodeGenerator):
1929 * bytecompiler/NodesCodegen.cpp:
1930 (JSC::ArrayNode::toArgumentList):
1931 (JSC::ApplyFunctionCallDotNode::emitBytecode):
1932 (JSC::ConditionalNode::emitBytecode):
1933 (JSC::ConstStatementNode::emitBytecode):
1934 (JSC::EmptyStatementNode::emitBytecode):
1935 (JSC::DebuggerStatementNode::emitBytecode):
1936 (JSC::ExprStatementNode::emitBytecode):
1937 (JSC::VarStatementNode::emitBytecode):
1938 (JSC::IfNode::emitBytecode):
1939 (JSC::IfElseNode::emitBytecode):
1940 (JSC::DoWhileNode::emitBytecode):
1941 (JSC::WhileNode::emitBytecode):
1942 (JSC::ForNode::emitBytecode):
1943 (JSC::ForInNode::emitBytecode):
1944 (JSC::ContinueNode::emitBytecode):
1945 (JSC::BreakNode::emitBytecode):
1946 (JSC::ReturnNode::emitBytecode):
1947 (JSC::WithNode::emitBytecode):
1948 (JSC::SwitchNode::emitBytecode):
1949 (JSC::LabelNode::emitBytecode):
1950 (JSC::ThrowNode::emitBytecode):
1951 (JSC::TryNode::emitBytecode):
1952 (JSC::ProgramNode::emitBytecode):
1953 (JSC::EvalNode::emitBytecode):
1954 (JSC::FunctionBodyNode::emitBytecode):
1955 * debugger/Debugger.h:
1956 * interpreter/Interpreter.cpp:
1957 (JSC::Interpreter::unwindCallFrame):
1958 (JSC::Interpreter::throwException):
1959 (JSC::Interpreter::debug):
1960 * interpreter/Interpreter.h:
1961 (Interpreter):
1962 * jit/JITOpcodes.cpp:
1963 (JSC::JIT::emit_op_debug):
1964 * jit/JITOpcodes32_64.cpp:
1965 (JSC::JIT::emit_op_debug):
1966 * jit/JITStubs.cpp:
1967 (JSC::DEFINE_STUB_FUNCTION):
1968 * llint/LLIntSlowPaths.cpp:
1969 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
1970 * parser/ASTBuilder.h:
1971 (ASTBuilder):
1972 (JSC::ASTBuilder::createCommaExpr):
1973 (JSC::ASTBuilder::createLogicalNot):
1974 (JSC::ASTBuilder::createUnaryPlus):
1975 (JSC::ASTBuilder::createVoid):
1976 (JSC::ASTBuilder::thisExpr):
1977 (JSC::ASTBuilder::createResolve):
1978 (JSC::ASTBuilder::createObjectLiteral):
1979 (JSC::ASTBuilder::createArray):
1980 (JSC::ASTBuilder::createNumberExpr):
1981 (JSC::ASTBuilder::createString):
1982 (JSC::ASTBuilder::createBoolean):
1983 (JSC::ASTBuilder::createNull):
1984 (JSC::ASTBuilder::createBracketAccess):
1985 (JSC::ASTBuilder::createDotAccess):
1986 (JSC::ASTBuilder::createRegExp):
1987 (JSC::ASTBuilder::createNewExpr):
1988 (JSC::ASTBuilder::createConditionalExpr):
1989 (JSC::ASTBuilder::createAssignResolve):
1990 (JSC::ASTBuilder::createFunctionExpr):
1991 (JSC::ASTBuilder::createFunctionBody):
1992 (JSC::ASTBuilder::createGetterOrSetterProperty):
1993 (JSC::ASTBuilder::createArgumentsList):
1994 (JSC::ASTBuilder::createPropertyList):
1995 (JSC::ASTBuilder::createFuncDeclStatement):
1996 (JSC::ASTBuilder::createBlockStatement):
1997 (JSC::ASTBuilder::createExprStatement):
1998 (JSC::ASTBuilder::createIfStatement):
1999 (JSC::ASTBuilder::createForLoop):
2000 (JSC::ASTBuilder::createForInLoop):
2001 (JSC::ASTBuilder::createEmptyStatement):
2002 (JSC::ASTBuilder::createVarStatement):
2003 (JSC::ASTBuilder::createReturnStatement):
2004 (JSC::ASTBuilder::createBreakStatement):
2005 (JSC::ASTBuilder::createContinueStatement):
2006 (JSC::ASTBuilder::createTryStatement):
2007 (JSC::ASTBuilder::createSwitchStatement):
2008 (JSC::ASTBuilder::createWhileStatement):
2009 (JSC::ASTBuilder::createDoWhileStatement):
2010 (JSC::ASTBuilder::createLabelStatement):
2011 (JSC::ASTBuilder::createWithStatement):
2012 (JSC::ASTBuilder::createThrowStatement):
2013 (JSC::ASTBuilder::createDebugger):
2014 (JSC::ASTBuilder::createConstStatement):
2015 (JSC::ASTBuilder::appendConstDecl):
2016 (JSC::ASTBuilder::combineCommaNodes):
2017 (JSC::ASTBuilder::appendBinaryOperation):
2018 (JSC::ASTBuilder::createAssignment):
2019 (JSC::ASTBuilder::createNumber):
2020 (JSC::ASTBuilder::makeTypeOfNode):
2021 (JSC::ASTBuilder::makeDeleteNode):
2022 (JSC::ASTBuilder::makeNegateNode):
2023 (JSC::ASTBuilder::makeBitwiseNotNode):
2024 (JSC::ASTBuilder::makeMultNode):
2025 (JSC::ASTBuilder::makeDivNode):
2026 (JSC::ASTBuilder::makeModNode):
2027 (JSC::ASTBuilder::makeAddNode):
2028 (JSC::ASTBuilder::makeSubNode):
2029 (JSC::ASTBuilder::makeLeftShiftNode):
2030 (JSC::ASTBuilder::makeRightShiftNode):
2031 (JSC::ASTBuilder::makeURightShiftNode):
2032 (JSC::ASTBuilder::makeBitOrNode):
2033 (JSC::ASTBuilder::makeBitAndNode):
2034 (JSC::ASTBuilder::makeBitXOrNode):
2035 (JSC::ASTBuilder::makeFunctionCallNode):
2036 (JSC::ASTBuilder::makeBinaryNode):
2037 (JSC::ASTBuilder::makeAssignNode):
2038 (JSC::ASTBuilder::makePrefixNode):
2039 (JSC::ASTBuilder::makePostfixNode):
2040 * parser/Lexer.cpp:
2041 (JSC::::setCode):
2042 (JSC::::internalShift):
2043 (JSC::::shift):
2044 (JSC::::lex):
2045 * parser/Lexer.h:
2046 (Lexer):
2047 (JSC::Lexer::currentColumnNumber):
2048 (JSC::::lexExpectIdentifier):
2049 * parser/NodeConstructors.h:
2050 (JSC::Node::Node):
2051 (JSC::ExpressionNode::ExpressionNode):
2052 (JSC::StatementNode::StatementNode):
2053 (JSC::NullNode::NullNode):
2054 (JSC::BooleanNode::BooleanNode):
2055 (JSC::NumberNode::NumberNode):
2056 (JSC::StringNode::StringNode):
2057 (JSC::RegExpNode::RegExpNode):
2058 (JSC::ThisNode::ThisNode):
2059 (JSC::ResolveNode::ResolveNode):
2060 (JSC::ArrayNode::ArrayNode):
2061 (JSC::PropertyListNode::PropertyListNode):
2062 (JSC::ObjectLiteralNode::ObjectLiteralNode):
2063 (JSC::BracketAccessorNode::BracketAccessorNode):
2064 (JSC::DotAccessorNode::DotAccessorNode):
2065 (JSC::ArgumentListNode::ArgumentListNode):
2066 (JSC::NewExprNode::NewExprNode):
2067 (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
2068 (JSC::FunctionCallValueNode::FunctionCallValueNode):
2069 (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
2070 (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
2071 (JSC::FunctionCallDotNode::FunctionCallDotNode):
2072 (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
2073 (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
2074 (JSC::PrePostResolveNode::PrePostResolveNode):
2075 (JSC::PostfixResolveNode::PostfixResolveNode):
2076 (JSC::PostfixBracketNode::PostfixBracketNode):
2077 (JSC::PostfixDotNode::PostfixDotNode):
2078 (JSC::PostfixErrorNode::PostfixErrorNode):
2079 (JSC::DeleteResolveNode::DeleteResolveNode):
2080 (JSC::DeleteBracketNode::DeleteBracketNode):
2081 (JSC::DeleteDotNode::DeleteDotNode):
2082 (JSC::DeleteValueNode::DeleteValueNode):
2083 (JSC::VoidNode::VoidNode):
2084 (JSC::TypeOfResolveNode::TypeOfResolveNode):
2085 (JSC::TypeOfValueNode::TypeOfValueNode):
2086 (JSC::PrefixResolveNode::PrefixResolveNode):
2087 (JSC::PrefixBracketNode::PrefixBracketNode):
2088 (JSC::PrefixDotNode::PrefixDotNode):
2089 (JSC::PrefixErrorNode::PrefixErrorNode):
2090 (JSC::UnaryOpNode::UnaryOpNode):
2091 (JSC::UnaryPlusNode::UnaryPlusNode):
2092 (JSC::NegateNode::NegateNode):
2093 (JSC::BitwiseNotNode::BitwiseNotNode):
2094 (JSC::LogicalNotNode::LogicalNotNode):
2095 (JSC::BinaryOpNode::BinaryOpNode):
2096 (JSC::MultNode::MultNode):
2097 (JSC::DivNode::DivNode):
2098 (JSC::ModNode::ModNode):
2099 (JSC::AddNode::AddNode):
2100 (JSC::SubNode::SubNode):
2101 (JSC::LeftShiftNode::LeftShiftNode):
2102 (JSC::RightShiftNode::RightShiftNode):
2103 (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
2104 (JSC::LessNode::LessNode):
2105 (JSC::GreaterNode::GreaterNode):
2106 (JSC::LessEqNode::LessEqNode):
2107 (JSC::GreaterEqNode::GreaterEqNode):
2108 (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
2109 (JSC::InstanceOfNode::InstanceOfNode):
2110 (JSC::InNode::InNode):
2111 (JSC::EqualNode::EqualNode):
2112 (JSC::NotEqualNode::NotEqualNode):
2113 (JSC::StrictEqualNode::StrictEqualNode):
2114 (JSC::NotStrictEqualNode::NotStrictEqualNode):
2115 (JSC::BitAndNode::BitAndNode):
2116 (JSC::BitOrNode::BitOrNode):
2117 (JSC::BitXOrNode::BitXOrNode):
2118 (JSC::LogicalOpNode::LogicalOpNode):
2119 (JSC::ConditionalNode::ConditionalNode):
2120 (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
2121 (JSC::AssignResolveNode::AssignResolveNode):
2122 (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
2123 (JSC::AssignBracketNode::AssignBracketNode):
2124 (JSC::AssignDotNode::AssignDotNode):
2125 (JSC::ReadModifyDotNode::ReadModifyDotNode):
2126 (JSC::AssignErrorNode::AssignErrorNode):
2127 (JSC::CommaNode::CommaNode):
2128 (JSC::ConstStatementNode::ConstStatementNode):
2129 (JSC::EmptyStatementNode::EmptyStatementNode):
2130 (JSC::DebuggerStatementNode::DebuggerStatementNode):
2131 (JSC::ExprStatementNode::ExprStatementNode):
2132 (JSC::VarStatementNode::VarStatementNode):
2133 (JSC::IfNode::IfNode):
2134 (JSC::IfElseNode::IfElseNode):
2135 (JSC::DoWhileNode::DoWhileNode):
2136 (JSC::WhileNode::WhileNode):
2137 (JSC::ForNode::ForNode):
2138 (JSC::ContinueNode::ContinueNode):
2139 (JSC::BreakNode::BreakNode):
2140 (JSC::ReturnNode::ReturnNode):
2141 (JSC::WithNode::WithNode):
2142 (JSC::LabelNode::LabelNode):
2143 (JSC::ThrowNode::ThrowNode):
2144 (JSC::TryNode::TryNode):
2145 (JSC::FuncExprNode::FuncExprNode):
2146 (JSC::FuncDeclNode::FuncDeclNode):
2147 (JSC::SwitchNode::SwitchNode):
2148 (JSC::ConstDeclNode::ConstDeclNode):
2149 (JSC::BlockNode::BlockNode):
2150 (JSC::ForInNode::ForInNode):
2151 * parser/Nodes.cpp:
2152 (JSC::StatementNode::setLoc):
2153 (JSC):
2154 (JSC::ScopeNode::ScopeNode):
2155 (JSC::ProgramNode::ProgramNode):
2156 (JSC::ProgramNode::create):
2157 (JSC::EvalNode::EvalNode):
2158 (JSC::EvalNode::create):
2159 (JSC::FunctionBodyNode::FunctionBodyNode):
2160 (JSC::FunctionBodyNode::create):
2161 * parser/Nodes.h:
2162 (Node):
2163 (JSC::Node::columnNo):
2164 (ExpressionNode):
2165 (StatementNode):
2166 (JSC::StatementNode::column):
2167 (NullNode):
2168 (BooleanNode):
2169 (NumberNode):
2170 (StringNode):
2171 (RegExpNode):
2172 (ThisNode):
2173 (ResolveNode):
2174 (ArrayNode):
2175 (PropertyListNode):
2176 (ObjectLiteralNode):
2177 (BracketAccessorNode):
2178 (DotAccessorNode):
2179 (ArgumentListNode):
2180 (NewExprNode):
2181 (EvalFunctionCallNode):
2182 (FunctionCallValueNode):
2183 (FunctionCallResolveNode):
2184 (FunctionCallBracketNode):
2185 (FunctionCallDotNode):
2186 (CallFunctionCallDotNode):
2187 (ApplyFunctionCallDotNode):
2188 (PrePostResolveNode):
2189 (PostfixResolveNode):
2190 (PostfixBracketNode):
2191 (PostfixDotNode):
2192 (PostfixErrorNode):
2193 (DeleteResolveNode):
2194 (DeleteBracketNode):
2195 (DeleteDotNode):
2196 (DeleteValueNode):
2197 (VoidNode):
2198 (TypeOfResolveNode):
2199 (TypeOfValueNode):
2200 (PrefixResolveNode):
2201 (PrefixBracketNode):
2202 (PrefixDotNode):
2203 (PrefixErrorNode):
2204 (UnaryOpNode):
2205 (UnaryPlusNode):
2206 (NegateNode):
2207 (BitwiseNotNode):
2208 (LogicalNotNode):
2209 (BinaryOpNode):
2210 (MultNode):
2211 (DivNode):
2212 (ModNode):
2213 (AddNode):
2214 (SubNode):
2215 (LeftShiftNode):
2216 (RightShiftNode):
2217 (UnsignedRightShiftNode):
2218 (LessNode):
2219 (GreaterNode):
2220 (LessEqNode):
2221 (GreaterEqNode):
2222 (ThrowableBinaryOpNode):
2223 (InstanceOfNode):
2224 (InNode):
2225 (EqualNode):
2226 (NotEqualNode):
2227 (StrictEqualNode):
2228 (NotStrictEqualNode):
2229 (BitAndNode):
2230 (BitOrNode):
2231 (BitXOrNode):
2232 (LogicalOpNode):
2233 (ConditionalNode):
2234 (ReadModifyResolveNode):
2235 (AssignResolveNode):
2236 (ReadModifyBracketNode):
2237 (AssignBracketNode):
2238 (AssignDotNode):
2239 (ReadModifyDotNode):
2240 (AssignErrorNode):
2241 (CommaNode):
2242 (ConstDeclNode):
2243 (ConstStatementNode):
2244 (BlockNode):
2245 (EmptyStatementNode):
2246 (DebuggerStatementNode):
2247 (ExprStatementNode):
2248 (VarStatementNode):
2249 (IfNode):
2250 (IfElseNode):
2251 (DoWhileNode):
2252 (WhileNode):
2253 (ForNode):
2254 (ForInNode):
2255 (ContinueNode):
2256 (BreakNode):
2257 (ReturnNode):
2258 (WithNode):
2259 (LabelNode):
2260 (ThrowNode):
2261 (TryNode):
2262 (ScopeNode):
2263 (ProgramNode):
2264 (EvalNode):
2265 (FunctionBodyNode):
2266 (FuncExprNode):
2267 (FuncDeclNode):
2268 (SwitchNode):
2269 * parser/Parser.cpp:
2270 (JSC::::parseSourceElements):
2271 (JSC::::parseVarDeclaration):
2272 (JSC::::parseConstDeclaration):
2273 (JSC::::parseDoWhileStatement):
2274 (JSC::::parseWhileStatement):
2275 (JSC::::parseVarDeclarationList):
2276 (JSC::::parseConstDeclarationList):
2277 (JSC::::parseForStatement):
2278 (JSC::::parseBreakStatement):
2279 (JSC::::parseContinueStatement):
2280 (JSC::::parseReturnStatement):
2281 (JSC::::parseThrowStatement):
2282 (JSC::::parseWithStatement):
2283 (JSC::::parseSwitchStatement):
2284 (JSC::::parseTryStatement):
2285 (JSC::::parseDebuggerStatement):
2286 (JSC::::parseBlockStatement):
2287 (JSC::::parseStatement):
2288 (JSC::::parseFunctionBody):
2289 (JSC::::parseFunctionInfo):
2290 (JSC::::parseFunctionDeclaration):
2291 (JSC::::parseExpressionOrLabelStatement):
2292 (JSC::::parseExpressionStatement):
2293 (JSC::::parseIfStatement):
2294 (JSC::::parseExpression):
2295 (JSC::::parseAssignmentExpression):
2296 (JSC::::parseConditionalExpression):
2297 (JSC::::parseBinaryExpression):
2298 (JSC::::parseProperty):
2299 (JSC::::parseObjectLiteral):
2300 (JSC::::parseStrictObjectLiteral):
2301 (JSC::::parseArrayLiteral):
2302 (JSC::::parsePrimaryExpression):
2303 (JSC::::parseArguments):
2304 (JSC::::parseMemberExpression):
2305 (JSC::::parseUnaryExpression):
2306 * parser/Parser.h:
2307 (JSC::Parser::next):
2308 (JSC::Parser::nextExpectIdentifier):
2309 (JSC::Parser::tokenStart):
2310 (JSC::Parser::tokenLine):
2311 (JSC::Parser::tokenEnd):
2312 (JSC::Parser::tokenLocation):
2313 (Parser):
2314 (JSC::Parser::getTokenName):
2315 (JSC::::parse):
2316 * parser/ParserTokens.h:
2317 (JSC::JSTokenLocation::JSTokenLocation):
2318 (JSTokenLocation):
2319 (JSToken):
2320 * parser/SourceProviderCacheItem.h:
2321 (JSC::SourceProviderCacheItem::closeBraceToken):
2322 * parser/SyntaxChecker.h:
2323 (JSC::SyntaxChecker::makeFunctionCallNode):
2324 (JSC::SyntaxChecker::createCommaExpr):
2325 (JSC::SyntaxChecker::makeAssignNode):
2326 (JSC::SyntaxChecker::makePrefixNode):
2327 (JSC::SyntaxChecker::makePostfixNode):
2328 (JSC::SyntaxChecker::makeTypeOfNode):
2329 (JSC::SyntaxChecker::makeDeleteNode):
2330 (JSC::SyntaxChecker::makeNegateNode):
2331 (JSC::SyntaxChecker::makeBitwiseNotNode):
2332 (JSC::SyntaxChecker::createLogicalNot):
2333 (JSC::SyntaxChecker::createUnaryPlus):
2334 (JSC::SyntaxChecker::createVoid):
2335 (JSC::SyntaxChecker::thisExpr):
2336 (JSC::SyntaxChecker::createResolve):
2337 (JSC::SyntaxChecker::createObjectLiteral):
2338 (JSC::SyntaxChecker::createArray):
2339 (JSC::SyntaxChecker::createNumberExpr):
2340 (JSC::SyntaxChecker::createString):
2341 (JSC::SyntaxChecker::createBoolean):
2342 (JSC::SyntaxChecker::createNull):
2343 (JSC::SyntaxChecker::createBracketAccess):
2344 (JSC::SyntaxChecker::createDotAccess):
2345 (JSC::SyntaxChecker::createRegExp):
2346 (JSC::SyntaxChecker::createNewExpr):
2347 (JSC::SyntaxChecker::createConditionalExpr):
2348 (JSC::SyntaxChecker::createAssignResolve):
2349 (JSC::SyntaxChecker::createFunctionExpr):
2350 (JSC::SyntaxChecker::createFunctionBody):
2351 (JSC::SyntaxChecker::createArgumentsList):
2352 (JSC::SyntaxChecker::createPropertyList):
2353 (JSC::SyntaxChecker::createFuncDeclStatement):
2354 (JSC::SyntaxChecker::createBlockStatement):
2355 (JSC::SyntaxChecker::createExprStatement):
2356 (JSC::SyntaxChecker::createIfStatement):
2357 (JSC::SyntaxChecker::createForLoop):
2358 (JSC::SyntaxChecker::createForInLoop):
2359 (JSC::SyntaxChecker::createEmptyStatement):
2360 (JSC::SyntaxChecker::createVarStatement):
2361 (JSC::SyntaxChecker::createReturnStatement):
2362 (JSC::SyntaxChecker::createBreakStatement):
2363 (JSC::SyntaxChecker::createContinueStatement):
2364 (JSC::SyntaxChecker::createTryStatement):
2365 (JSC::SyntaxChecker::createSwitchStatement):
2366 (JSC::SyntaxChecker::createWhileStatement):
2367 (JSC::SyntaxChecker::createWithStatement):
2368 (JSC::SyntaxChecker::createDoWhileStatement):
2369 (JSC::SyntaxChecker::createLabelStatement):
2370 (JSC::SyntaxChecker::createThrowStatement):
2371 (JSC::SyntaxChecker::createDebugger):
2372 (JSC::SyntaxChecker::createConstStatement):
2373 (JSC::SyntaxChecker::appendConstDecl):
2374 (JSC::SyntaxChecker::createGetterOrSetterProperty):
2375 (JSC::SyntaxChecker::combineCommaNodes):
2376 (JSC::SyntaxChecker::operatorStackPop):
2377
fpizlo@apple.com270a7ad2012-08-02 01:28:10 +000023782012-08-01 Filip Pizlo <fpizlo@apple.com>
2379
fpizlo@apple.comcaa68812012-08-02 04:32:30 +00002380 DFG should hoist structure checks
2381 https://bugs.webkit.org/show_bug.cgi?id=92696
2382
2383 Reviewed by Gavin Barraclough.
2384
2385 This hoists structure checks in the same way that we would hoist array checks, but with added
2386 complexity to cope with the fact that the structure of an object may change. This is handled
2387 by performing a side effects analysis over the region in which the respective variable is
2388 live. If a structure clobbering side effect may happen then we either hoist the structure
2389 checks and fall back on structure transition watchpoints (if the watchpoint set is still
2390 valid), or we avoid hoisting altogether.
2391
2392 Doing this required teaching the CFA that we may have an expectation that an object has a
2393 particular structure even after structure clobbering happens, in the sense that structure
2394 proofs that were cobbered can be revived using watchpoints. CFA must know about this so that
2395 OSR entry may know about it, since we cannot allow entry to happen if the variable has a
2396 clobbered structure proof, will have a watchpoint to revive the proof, and the variable in
2397 the baseline JIT has a completely unrelated structure.
2398
2399 This is mostly performance neutral.
2400
2401 * CMakeLists.txt:
2402 * GNUmakefile.list.am:
2403 * JavaScriptCore.xcodeproj/project.pbxproj:
2404 * Target.pri:
2405 * bytecode/ValueRecovery.h:
2406 (JSC::ValueRecovery::isSet):
2407 (JSC::ValueRecovery::operator!):
2408 (ValueRecovery):
2409 * dfg/DFGAbstractState.cpp:
2410 (JSC::DFG::AbstractState::execute):
2411 (JSC::DFG::AbstractState::clobberWorld):
2412 (DFG):
2413 (JSC::DFG::AbstractState::clobberCapturedVars):
2414 * dfg/DFGAbstractState.h:
2415 (AbstractState):
2416 * dfg/DFGAbstractValue.h:
2417 (JSC::DFG::AbstractValue::clear):
2418 (JSC::DFG::AbstractValue::isClear):
2419 (JSC::DFG::AbstractValue::makeTop):
2420 (JSC::DFG::AbstractValue::isTop):
2421 (JSC::DFG::AbstractValue::set):
2422 (JSC::DFG::AbstractValue::operator==):
2423 (JSC::DFG::AbstractValue::merge):
2424 (JSC::DFG::AbstractValue::filter):
2425 (JSC::DFG::AbstractValue::validate):
2426 (JSC::DFG::AbstractValue::validateForEntry):
2427 (AbstractValue):
2428 (JSC::DFG::AbstractValue::checkConsistency):
2429 (JSC::DFG::AbstractValue::dump):
2430 * dfg/DFGByteCodeParser.cpp:
2431 (JSC::DFG::ByteCodeParser::setLocal):
2432 (JSC::DFG::ByteCodeParser::getArgument):
2433 (JSC::DFG::ByteCodeParser::setArgument):
2434 (JSC::DFG::ByteCodeParser::parseBlock):
2435 (JSC::DFG::ByteCodeParser::fixVariableAccessSpeculations):
2436 * dfg/DFGCSEPhase.cpp:
2437 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
2438 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
2439 (JSC::DFG::CSEPhase::putStructureStoreElimination):
2440 (JSC::DFG::CSEPhase::getLocalLoadElimination):
2441 (JSC::DFG::CSEPhase::performNodeCSE):
2442 * dfg/DFGDriver.cpp:
2443 (JSC::DFG::compile):
2444 * dfg/DFGGraph.cpp:
2445 (JSC::DFG::Graph::dump):
2446 * dfg/DFGGraph.h:
2447 (JSC::DFG::Graph::vote):
2448 (Graph):
2449 * dfg/DFGNode.h:
2450 (JSC::DFG::Node::convertToStructureTransitionWatchpoint):
2451 (Node):
2452 (JSC::DFG::Node::hasStructureSet):
2453 * dfg/DFGNodeType.h:
2454 (DFG):
2455 * dfg/DFGOSREntry.cpp:
2456 (JSC::DFG::prepareOSREntry):
2457 * dfg/DFGPredictionPropagationPhase.cpp:
2458 (JSC::DFG::PredictionPropagationPhase::propagate):
2459 (PredictionPropagationPhase):
2460 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
2461 * dfg/DFGSpeculativeJIT.h:
2462 (SpeculativeJIT):
2463 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
2464 (JSC::DFG::SpeculativeJIT::speculationCheckWithConditionalDirection):
2465 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection):
2466 (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
2467 (JSC::DFG::SpeculateCellOperand::gpr):
2468 (SpeculateCellOperand):
2469 * dfg/DFGSpeculativeJIT32_64.cpp:
2470 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
2471 (JSC::DFG::SpeculativeJIT::compile):
2472 * dfg/DFGSpeculativeJIT64.cpp:
2473 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
2474 (JSC::DFG::SpeculativeJIT::compile):
2475 * dfg/DFGStructureCheckHoistingPhase.cpp: Added.
2476 (DFG):
2477 (StructureCheckHoistingPhase):
2478 (JSC::DFG::StructureCheckHoistingPhase::StructureCheckHoistingPhase):
2479 (JSC::DFG::StructureCheckHoistingPhase::run):
2480 (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck):
2481 (JSC::DFG::StructureCheckHoistingPhase::noticeClobber):
2482 (JSC::DFG::StructureCheckHoistingPhase::clobber):
2483 (CheckData):
2484 (JSC::DFG::StructureCheckHoistingPhase::CheckData::CheckData):
2485 (JSC::DFG::performStructureCheckHoisting):
2486 * dfg/DFGStructureCheckHoistingPhase.h: Added.
2487 (DFG):
2488 * dfg/DFGVariableAccessData.h:
2489 (VariableAccessData):
2490 (JSC::DFG::VariableAccessData::VariableAccessData):
2491 (JSC::DFG::VariableAccessData::mergeStructureCheckHoistingFailed):
2492 (JSC::DFG::VariableAccessData::structureCheckHoistingFailed):
2493 (JSC::DFG::VariableAccessData::clearVotes):
2494 (JSC::DFG::VariableAccessData::vote):
2495 (JSC::DFG::VariableAccessData::voteRatio):
2496 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
2497 * runtime/Options.h:
2498 (JSC):
2499
25002012-08-01 Filip Pizlo <fpizlo@apple.com>
2501
fpizlo@apple.com270a7ad2012-08-02 01:28:10 +00002502 DFG should distinguish between PutByVal's that clobber the world and ones that don't
2503 https://bugs.webkit.org/show_bug.cgi?id=92923
2504
2505 Reviewed by Mark Hahnenberg.
2506
2507 This is performance-neutral. I also confirmed that it's neutral if we make the
2508 clobbering variant (PutByValSafe) clobber all knowledge of what is an array,
2509 which should feed nicely into work on removing uses of ClassInfo.
2510
2511 * bytecode/DFGExitProfile.h:
2512 * dfg/DFGAbstractState.cpp:
2513 (JSC::DFG::AbstractState::execute):
2514 * dfg/DFGByteCodeParser.cpp:
2515 (JSC::DFG::ByteCodeParser::parseBlock):
2516 * dfg/DFGCSEPhase.cpp:
2517 (JSC::DFG::CSEPhase::getByValLoadElimination):
2518 (JSC::DFG::CSEPhase::checkStructureLoadElimination):
2519 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
2520 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
2521 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
2522 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
2523 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
2524 (JSC::DFG::CSEPhase::performNodeCSE):
2525 * dfg/DFGFixupPhase.cpp:
2526 (JSC::DFG::FixupPhase::fixupNode):
2527 * dfg/DFGGraph.h:
2528 (JSC::DFG::Graph::byValIsPure):
2529 (JSC::DFG::Graph::clobbersWorld):
2530 * dfg/DFGNodeType.h:
2531 (DFG):
2532 * dfg/DFGPredictionPropagationPhase.cpp:
2533 (JSC::DFG::PredictionPropagationPhase::propagate):
2534 * dfg/DFGSpeculativeJIT32_64.cpp:
2535 (JSC::DFG::SpeculativeJIT::compile):
2536 * dfg/DFGSpeculativeJIT64.cpp:
2537 (JSC::DFG::SpeculativeJIT::compile):
2538
jianli@chromium.orgf66b5812012-08-02 00:14:28 +000025392012-08-01 Jian Li <jianli@chromium.org>
2540
2541 Add new CSS property "-webkit-widget-region" to expose dashboard region support for other port
2542 https://bugs.webkit.org/show_bug.cgi?id=90298
2543
2544 Reviewed by Adam Barth.
2545
2546 * Configurations/FeatureDefines.xcconfig: Add ENABLE_WIDGET_REGION define.
2547
paroga@webkit.orgf3f2e132012-08-01 20:49:26 +000025482012-08-01 Patrick Gansterer <paroga@webkit.org>
2549
2550 Replace WTF::getCurrentLocalTime() with GregorianDateTime::setToCurrentLocalTime()
2551 https://bugs.webkit.org/show_bug.cgi?id=92286
2552
2553 Reviewed by Geoffrey Garen.
2554
2555 Add a method to GregorianDateTime to set its values to the current locale time.
2556 Replacing all occurrences of getCurrentLocalTime with the new function allows
2557 us to remove getCurrentLocalTime in a next step.
2558
2559 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2560
mhahnenberg@apple.comf19f9352012-08-01 19:24:58 +000025612012-08-01 Mark Hahnenberg <mhahnenberg@apple.com>
2562
2563 C++ code should get ClassInfo from the Structure
2564 https://bugs.webkit.org/show_bug.cgi?id=92892
2565
2566 Reviewed by Geoffrey Garen.
2567
2568 In our march to remove ClassInfo from our JSCell object headers, we can switch
2569 C++ code over to grabbing the ClassInfo from the Structure since it is finally
2570 safe to do so now that Structure access is safe during finalization/destruction.
2571 The remaining JIT code changes can be done in a separate patch.
2572
2573 * heap/MarkedBlock.cpp:
2574 (JSC::MarkedBlock::callDestructor): We don't want to clear the Structure any more
2575 since the Structure should still be valid at this point.
2576 * heap/WeakSetInlines.h:
2577 (JSC::WeakBlock::finalize): Ditto.
2578 * runtime/JSCell.h:
2579 (JSC):
2580 * runtime/Structure.h:
2581 (JSC::JSCell::classInfo): Move JSCell's classInfo() to Structure.h so it can be
2582 inline. Use a different method of getting the JSCell's Structure based on
2583 whether we're in GC_VALIDATION mode or not, since always using get() will cause
2584 infinite recursion in GC_VALIDATION mode.
2585 (JSC):
2586
mhahnenberg@apple.com42853a62012-08-01 18:55:03 +000025872012-07-31 Mark Hahnenberg <mhahnenberg@apple.com>
2588
2589 MarkedBlock::sweep() should sweep another block if it can't sweep a Structure block
2590 https://bugs.webkit.org/show_bug.cgi?id=92819
2591
2592 Reviewed by Geoffrey Garen.
2593
2594 If we are forced to allocate a new block for Structures because we are unable to safely
2595 sweep our pre-existing Structure blocks, we should sweep another random block so that we
2596 can start sweeping Structure blocks sooner.
2597
2598 * heap/IncrementalSweeper.cpp:
2599 (JSC::IncrementalSweeper::doSweep): Change to use sweepNextBlock.
2600 (JSC):
2601 (JSC::IncrementalSweeper::sweepNextBlock):
2602 * heap/IncrementalSweeper.h:
2603 (IncrementalSweeper):
2604 * heap/MarkedAllocator.cpp:
2605 (JSC::MarkedAllocator::tryAllocateHelper): When we can't safely sweep
2606 our Structure blocks, call sweepNextBlock instead.
2607
weinig@apple.comd824f452012-07-31 23:50:04 +000026082012-07-31 Sam Weinig <sam@webkit.org>
2609
2610 Fix the Windows build.
2611
2612 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
2613
ggaren@apple.come0d70122012-07-31 23:46:53 +000026142012-07-31 Geoffrey Garen <ggaren@apple.com>
2615
2616 Maybe fix the GCC build.
2617
2618 * heap/HeapBlock.h:
2619 (HeapBlock): Accommodate incorrect parsing in GCC.
2620
weinig@apple.com329b8062012-07-31 23:24:31 +000026212012-07-31 Sam Weinig <sam@webkit.org>
2622
2623 Stop masking 8 bits off of the visited link hash. We need all the bits!
2624 https://bugs.webkit.org/show_bug.cgi?id=92799
2625
2626 Reviewed by Anders Carlsson.
2627
2628 * runtime/Identifier.cpp:
2629 (JSC::IdentifierCStringTranslator::hash):
2630 (JSC::IdentifierLCharFromUCharTranslator::hash):
2631 * runtime/Identifier.h:
2632 (JSC::IdentifierCharBufferTranslator::hash):
2633 Update for new function names.
2634
ggaren@apple.comc33983c2012-07-31 23:07:46 +000026352012-07-31 Geoffrey Garen <ggaren@apple.com>
2636
2637 Maybe break the Windows build.
2638
2639 Reviewed by Anders Carlsson.
2640
2641 Formally objected to by Sam Weinig.
2642
2643 * heap/HeapBlock.h:
2644 (HeapBlock): Try to slightly improve this because we don't want Windows to control our lives.
2645
mhahnenberg@apple.com59c64f12012-07-31 23:05:12 +000026462012-07-30 Mark Hahnenberg <mhahnenberg@apple.com>
2647
2648 Structures should be swept after all other objects
2649 https://bugs.webkit.org/show_bug.cgi?id=92679
2650
2651 Reviewed by Filip Pizlo.
2652
2653 In order to get rid of ClassInfo from our objects, we need to be able to safely get the
2654 ClassInfo during the destruction of objects. We'd like to get the ClassInfo out of the
2655 Structure, but currently it is not safe to do so because the order of destruction of objects
2656 is not guaranteed to sweep objects before their corresponding Structure. We can fix this by
2657 sweeping Structures after everything else.
2658
2659 * heap/Heap.cpp:
2660 (JSC::Heap::isSafeToSweepStructures): Add a function that checks if it is safe to sweep Structures.
2661 If the Heap's IncrementalSweeper member is null, that means we're shutting down this VM and it is
2662 safe to sweep structures since we'll always do Structures last anyways due to the ordering of
2663 MarkedSpace::forEachBlock.
2664 (JSC):
2665 (JSC::Heap::didStartVMShutdown): Add this intermediate function to the Heap that ~JSGlobalData now
2666 calls rather than calling the two HeapTimer objects individually. This allows the Heap to null out
2667 these pointers after it has invalidated them to prevent accidental use-after-free in the sweep()
2668 calls during lastChanceToFinalize().
2669 * heap/Heap.h:
2670 (Heap):
2671 * heap/HeapTimer.h:
2672 (HeapTimer):
2673 * heap/IncrementalSweeper.cpp:
2674 (JSC::IncrementalSweeper::structuresCanBeSwept): Determines if it is currently safe to sweep Structures.
2675 This decision is based on whether we have gotten to the end of the vector of blocks that need sweeping
2676 the first time.
2677 (JSC):
2678 (JSC::IncrementalSweeper::doSweep): We add a second pass over the vector to sweep Structures after we
2679 make our first pass. We now null out the slots as we sweep them so that we can quickly find the
2680 Structures during the second pass.
2681 (JSC::IncrementalSweeper::startSweeping): Initialize our new Structure sweeping index.
2682 (JSC::IncrementalSweeper::willFinishSweeping): Callback that is called by MarkedSpace::sweep to notify
2683 the IncrementalSweeper that we are going to sweep all of the remaining blocks in the Heap so it can
2684 assume that everything is taken care of in the correct order. Since MarkedSpace::forEachBlock
2685 iterates over the Structure blocks after all other blocks, the ordering property for sweeping Structures holds.
2686 (JSC::IncrementalSweeper::IncrementalSweeper): Initialize Structure sweeping index.
2687 * heap/IncrementalSweeper.h: Add declarations for new stuff.
2688 (IncrementalSweeper):
2689 * heap/MarkedAllocator.cpp:
2690 (JSC::MarkedAllocator::tryAllocateHelper): We now check if the current block only contains structures and
2691 if so and it isn't safe to sweep Structures according to the Heap, we just return early instead of doing
2692 the normal lazy sweep. If this proves to be too much of a waste in the future we can add an extra clause that
2693 will sweep some number of other blocks in place of the current block to mitigate the cost of the floating
2694 Structure garbage.
2695 (JSC::MarkedAllocator::addBlock):
2696 * heap/MarkedAllocator.h:
2697 (JSC::MarkedAllocator::zapFreeList): When we zap the free list in the MarkedAllocator, the current block is no
2698 longer valid to allocate from, so we set the current block to null.
2699 * heap/MarkedBlock.cpp:
2700 (JSC::MarkedBlock::sweepHelper): Added a couple assertions to make sure that we weren't trying to sweep Structures
2701 at an unsafe time.
2702 * heap/MarkedSpace.cpp:
2703 (JSC::MarkedSpace::sweep): Notify the IncrementalSweeper that the MarkedSpace will finish all currently remaining sweeping.
2704 (JSC):
2705 * heap/MarkedSpace.h:
2706 (JSC):
2707 * runtime/JSGlobalData.cpp:
2708 (JSC::JSGlobalData::~JSGlobalData): Call the new Heap::didStartVMShutdown.
2709
ggaren@apple.comdd7793a2012-07-31 21:26:38 +000027102012-07-31 Geoffrey Garen <ggaren@apple.com>
2711
ggaren@apple.com0aa5f2a2012-07-31 23:00:53 +00002712 Fix all the other builds I just broke. Maybe fix the Windows build.
2713
2714 * heap/HeapBlock.h:
2715 (HeapBlock): WTF?
2716
27172012-07-31 Geoffrey Garen <ggaren@apple.com>
2718
ggaren@apple.comeff3a062012-07-31 22:27:38 +00002719 Maybe fix the Windows build.
2720
2721 * heap/HeapBlock.h:
2722 (HeapBlock): WTF?
2723
27242012-07-31 Geoffrey Garen <ggaren@apple.com>
2725
ggaren@apple.comc5be1dd2012-07-31 22:59:49 +00002726 Maybe fix the Windows build.
2727
2728 * heap/HeapBlock.h:
2729 (HeapBlock): WTF?
2730
27312012-07-31 Geoffrey Garen <ggaren@apple.com>
2732
ggaren@apple.comdd7793a2012-07-31 21:26:38 +00002733 Removed some public data and casting from the Heap
2734 https://bugs.webkit.org/show_bug.cgi?id=92777
2735
2736 Reviewed by Oliver Hunt.
2737
2738 * heap/BlockAllocator.cpp:
2739 (JSC::BlockAllocator::releaseFreeBlocks):
2740 (JSC::BlockAllocator::blockFreeingThreadMain): Use the DeadBlock class
2741 since HeapBlock is a template, and not a class, now. Call destroy()
2742 instead of monkeying around with DeadBlock's internal data because
2743 encapsulation is good.
2744
2745 * heap/BlockAllocator.h:
2746 (DeadBlock): Added a class to represent a dead block, since HeapBlock is
2747 a template now, and can't be instantiated directly.
2748
2749 (JSC::DeadBlock::DeadBlock):
2750 (JSC::DeadBlock::create):
2751 (BlockAllocator):
2752 (JSC::BlockAllocator::allocate):
2753 (JSC::BlockAllocator::deallocate): Use the DeadBlock class because
2754 encapsulation is good.
2755
2756 * heap/CopiedBlock.h:
2757 (CopiedBlock::destroy): No need for a destroy() function, since we
2758 inherit one now.
2759
2760 (JSC::CopiedBlock::CopiedBlock):
2761 (JSC::CopiedBlock::payloadEnd):
2762 (JSC::CopiedBlock::capacity): Updated for some encapsulation inside
2763 HeapBlock.
2764
2765 * heap/CopiedSpace.cpp:
2766 (JSC::CopiedSpace::~CopiedSpace):
2767 (JSC::CopiedSpace::doneCopying):
2768 (JSC::CopiedSpace::size):
2769 (JSC::CopiedSpace::capacity):
2770 (JSC::isBlockListPagedOut): Removed a bunch of casting. This is no longer
2771 necessary, now that our list and its nodes have the right type.
2772
2773 * heap/CopiedSpace.h: Use the right type in our data structures because
2774 it improves clarity.
2775
2776 * heap/CopiedSpaceInlineMethods.h:
2777 (JSC::CopiedSpace::startedCopying): Use swap to avoid duplicating it.
2778
2779 * heap/HeapBlock.h:
2780 (HeapBlock): Made this a class template so we can return the right type
2781 in linked list operations. Made our data private because encapsulation
2782 is good.
2783
2784 (JSC::HeapBlock::destroy): Since we know our type, we can also eliminate
2785 duplicate destroy() functions in our subclasses.
2786
2787 (JSC::HeapBlock::allocation): Added an accessor so we can hide our data.
2788 By using const, this accessor prevents clients from accidentally deleting
2789 our allocation.
2790
2791 * heap/MarkedAllocator.cpp:
2792 (JSC::MarkedAllocator::isPagedOut):
2793 (JSC::MarkedAllocator::tryAllocateHelper):
2794 (JSC::MarkedAllocator::removeBlock): Removed a bunch of casting. This is
2795 no longer necessary, now that our list and its nodes have the right type.
2796
2797 * heap/MarkedAllocator.h:
2798 (MarkedAllocator):
2799 (JSC::MarkedAllocator::reset):
2800 (JSC::MarkedAllocator::forEachBlock): Use the right type, do less casting.
2801
2802 * heap/MarkedBlock.cpp:
2803 (JSC::MarkedBlock::destroy): Removed this function because our parent
2804 class provides it for us now.
2805
2806 (JSC::MarkedBlock::MarkedBlock):
2807 * heap/MarkedBlock.h:
2808 (MarkedBlock):
2809 (JSC::MarkedBlock::capacity): Updated for encapsulation.
2810
fpizlo@apple.com46e4e4e2012-07-31 18:48:17 +000028112012-07-31 Filip Pizlo <fpizlo@apple.com>
2812
2813 DFG OSR exit profiling has unusual oversights
2814 https://bugs.webkit.org/show_bug.cgi?id=92728
2815
2816 Reviewed by Geoffrey Garen.
2817
2818 * dfg/DFGOSRExit.cpp:
2819 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
2820 * dfg/DFGSpeculativeJIT.h:
2821 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
2822 * dfg/DFGSpeculativeJIT32_64.cpp:
2823 (JSC::DFG::SpeculativeJIT::compile):
2824 * dfg/DFGSpeculativeJIT64.cpp:
2825 (JSC::DFG::SpeculativeJIT::compile):
2826
commit-queue@webkit.orge03e44a2012-07-31 18:44:03 +000028272012-07-31 Chao-ying Fu <fu@mips.com>
2828
2829 Add MIPS add32 function
2830 https://bugs.webkit.org/show_bug.cgi?id=91522
2831
2832 Reviewed by Oliver Hunt.
2833
2834 Add isCompactPtrAlignedAddressOffset.
2835 Add a new version of add32 that accepts AbsoluteAddress as inputs.
2836
2837 * assembler/MacroAssemblerMIPS.h:
2838 (JSC::MacroAssemblerMIPS::isCompactPtrAlignedAddressOffset): New.
2839 (MacroAssemblerMIPS):
2840 (JSC::MacroAssemblerMIPS::add32): Support AbsoluteAddress as inputs.
2841
commit-queue@webkit.org764c9fb2012-07-31 01:48:18 +000028422012-07-30 Sheriff Bot <webkit.review.bot@gmail.com>
2843
2844 Unreviewed, rolling out r124123.
2845 http://trac.webkit.org/changeset/124123
2846 https://bugs.webkit.org/show_bug.cgi?id=92700
2847
2848 ASSERT crashes terminate webkit Layout tests (Requested by
2849 msaboff on #webkit).
2850
2851 * heap/Heap.cpp:
2852 * heap/Heap.h:
2853 (Heap):
2854 * heap/IncrementalSweeper.cpp:
2855 (JSC::IncrementalSweeper::doSweep):
2856 (JSC::IncrementalSweeper::startSweeping):
2857 (JSC::IncrementalSweeper::IncrementalSweeper):
2858 (JSC):
2859 * heap/IncrementalSweeper.h:
2860 (IncrementalSweeper):
2861 * heap/MarkedAllocator.cpp:
2862 (JSC::MarkedAllocator::tryAllocateHelper):
2863 (JSC::MarkedAllocator::addBlock):
2864 * heap/MarkedAllocator.h:
2865 (JSC::MarkedAllocator::zapFreeList):
2866 * heap/MarkedBlock.cpp:
2867 (JSC::MarkedBlock::sweepHelper):
2868 * heap/MarkedSpace.cpp:
2869 * heap/MarkedSpace.h:
2870 (JSC::MarkedSpace::sweep):
2871 (JSC):
2872 * runtime/JSGlobalData.cpp:
2873 (JSC::JSGlobalData::~JSGlobalData):
2874
mhahnenberg@apple.com3c1699e2012-07-31 00:33:53 +000028752012-07-30 Mark Hahnenberg <mhahnenberg@apple.com>
2876
2877 Structures should be swept after all other objects
2878 https://bugs.webkit.org/show_bug.cgi?id=92679
2879
2880 Reviewed by Filip Pizlo.
2881
2882 In order to get rid of ClassInfo from our objects, we need to be able to safely get the
2883 ClassInfo during the destruction of objects. We'd like to get the ClassInfo out of the
2884 Structure, but currently it is not safe to do so because the order of destruction of objects
2885 is not guaranteed to sweep objects before their corresponding Structure. We can fix this by
2886 sweeping Structures after everything else.
2887
2888 * heap/Heap.cpp:
2889 (JSC::Heap::isSafeToSweepStructures): Add a function that checks if it is safe to sweep Structures.
2890 If the Heap's IncrementalSweeper member is null, that means we're shutting down this VM and it is
2891 safe to sweep structures since we'll always do Structures last anyways due to the ordering of
2892 MarkedSpace::forEachBlock.
2893 (JSC):
2894 (JSC::Heap::didStartVMShutdown): Add this intermediate function to the Heap that ~JSGlobalData now
2895 calls rather than calling the two HeapTimer objects individually. This allows the Heap to null out
2896 these pointers after it has invalidated them to prevent accidental use-after-free in the sweep()
2897 calls during lastChanceToFinalize().
2898 * heap/Heap.h:
2899 (Heap):
2900 * heap/HeapTimer.h:
2901 (HeapTimer):
2902 * heap/IncrementalSweeper.cpp:
2903 (JSC::IncrementalSweeper::structuresCanBeSwept): Determines if it is currently safe to sweep Structures.
2904 This decision is based on whether we have gotten to the end of the vector of blocks that need sweeping
2905 the first time.
2906 (JSC):
2907 (JSC::IncrementalSweeper::doSweep): We add a second pass over the vector to sweep Structures after we
2908 make our first pass. We now null out the slots as we sweep them so that we can quickly find the
2909 Structures during the second pass.
2910 (JSC::IncrementalSweeper::startSweeping): Initialize our new Structure sweeping index.
2911 (JSC::IncrementalSweeper::willFinishSweeping): Callback that is called by MarkedSpace::sweep to notify
2912 the IncrementalSweeper that we are going to sweep all of the remaining blocks in the Heap so it can
2913 assume that everything is taken care of in the correct order. Since MarkedSpace::forEachBlock
2914 iterates over the Structure blocks after all other blocks, the ordering property for sweeping Structures holds.
2915 (JSC::IncrementalSweeper::IncrementalSweeper): Initialize Structure sweeping index.
2916 * heap/IncrementalSweeper.h: Add declarations for new stuff.
2917 (IncrementalSweeper):
2918 * heap/MarkedAllocator.cpp:
2919 (JSC::MarkedAllocator::tryAllocateHelper): We now check if the current block only contains structures and
2920 if so and it isn't safe to sweep Structures according to the Heap, we just return early instead of doing
2921 the normal lazy sweep. If this proves to be too much of a waste in the future we can add an extra clause that
2922 will sweep some number of other blocks in place of the current block to mitigate the cost of the floating
2923 Structure garbage.
2924 (JSC::MarkedAllocator::addBlock):
2925 * heap/MarkedAllocator.h:
2926 (JSC::MarkedAllocator::zapFreeList): When we zap the free list in the MarkedAllocator, the current block is no
2927 longer valid to allocate from, so we set the current block to null.
2928 * heap/MarkedBlock.cpp:
2929 (JSC::MarkedBlock::sweepHelper): Added a couple assertions to make sure that we weren't trying to sweep Structures
2930 at an unsafe time.
2931 * heap/MarkedSpace.cpp:
2932 (JSC::MarkedSpace::sweep): Notify the IncrementalSweeper that the MarkedSpace will finish all currently remaining sweeping.
2933 (JSC):
2934 * heap/MarkedSpace.h:
2935 (JSC):
2936 * runtime/JSGlobalData.cpp:
2937 (JSC::JSGlobalData::~JSGlobalData): Call the new Heap::didStartVMShutdown.
2938
fpizlo@apple.com7cc53e02012-07-29 23:15:30 +000029392012-07-29 Filip Pizlo <fpizlo@apple.com>
2940
2941 PropertyNameArray::m_shouldCache is only assigned and never used
2942 https://bugs.webkit.org/show_bug.cgi?id=92598
2943
2944 Reviewed by Dan Bernstein.
2945
2946 * runtime/PropertyNameArray.h:
2947 (JSC::PropertyNameArray::PropertyNameArray):
2948 (PropertyNameArray):
2949
commit-queue@webkit.orgc1c4f122012-07-29 21:59:53 +000029502012-07-29 Rik Cabanier <cabanier@adobe.com>
2951
2952 Add ENABLE_CSS_COMPOSITING flag
2953 https://bugs.webkit.org/show_bug.cgi?id=92553
2954
2955 Reviewed by Dirk Schulze.
2956
2957 Adds compiler flag CSS_COMPOSITING to build systems to enable CSS blending and compositing. See spec https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html
2958
2959 * Configurations/FeatureDefines.xcconfig:
2960
mhahnenberg@apple.comaa1f4ec2012-07-27 19:29:03 +000029612012-07-27 Mark Hahnenberg <mhahnenberg@apple.com>
2962
mhahnenberg@apple.com7f5b9592012-07-27 22:59:14 +00002963 Split functionality of MarkedAllocator::m_currentBlock
2964 https://bugs.webkit.org/show_bug.cgi?id=92550
2965
2966 Reviewed by Filip Pizlo.
2967
2968 MarkedAllocator::m_currentBlock serves two purposes right now; it indicates the block that is currently
2969 being used for allocation and the beginning of the list of blocks that need to be swept. We should split
2970 these two functionalities into two separate fields.
2971
2972 * heap/MarkedAllocator.cpp:
2973 (JSC::MarkedAllocator::tryAllocateHelper): Use m_blocksToSweep instead of m_currentBlock as the
2974 initializer/reference of the loop. Only change m_currentBlock when we know what the result will be.
2975 (JSC::MarkedAllocator::addBlock): When we add a new block we know that both m_blocksToSweep and
2976 m_currentBlock are null. In order to preserve the invariant that m_currentBlock <= m_blocksToSweep,
2977 we assign both of them to point to the new block.
2978 (JSC::MarkedAllocator::removeBlock): We need a separate check to see if the block we're removing is
2979 m_blocksToSweep and if so, advance it to the next block in the list.
2980 * heap/MarkedAllocator.h:
2981 (MarkedAllocator): Initialize m_blocksToSweep.
2982 (JSC::MarkedAllocator::MarkedAllocator):
2983 (JSC::MarkedAllocator::reset): We set m_blocksToSweep to be the head of our list. This function is called
2984 at the end of a collection, so all of the blocks in our allocator need to be swept. We need to sweep a
2985 block before we can start allocating, so m_currentBlock is set to null. We also set the freeList to
2986 the empty FreeList to emphasize the fact that we can't start allocating until we do some sweeping.
2987
29882012-07-27 Mark Hahnenberg <mhahnenberg@apple.com>
2989
mhahnenberg@apple.comaa1f4ec2012-07-27 19:29:03 +00002990 Increase inline storage for JSFinalObjects by one
2991 https://bugs.webkit.org/show_bug.cgi?id=92526
2992
2993 Reviewed by Geoffrey Garen.
2994
2995 Now that we've removed the inheritorID from objects, we can increase our inline storage for JSFinalObjects on
2996 64-bit platforms by 1.
2997
2998 * llint/LowLevelInterpreter.asm: Change the constant.
2999 * runtime/PropertyOffset.h: Change the constant.
3000 (JSC):
3001
jer.noble@apple.com50ecb282012-07-27 16:31:07 +000030022012-07-27 Jer Noble <jer.noble@apple.com>
3003
3004 Support a rational time class for use by media elements.
3005 https://bugs.webkit.org/show_bug.cgi?id=88787
3006
3007 Re-export WTF::MediaTime from JavaScriptCore.
3008
3009 Reviewed by Eric Carlson.
3010
3011 * JavaScriptCore.order:
3012 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3013
fpizlo@apple.comd510fc22012-07-27 00:11:44 +000030142012-07-26 Filip Pizlo <fpizlo@apple.com>
3015
3016 JSObject::reallocateStorageIfNecessary is neither used nor defined
3017 https://bugs.webkit.org/show_bug.cgi?id=92417
3018
3019 Reviewed by Mark Rowe.
3020
3021 * runtime/JSObject.h:
3022 (JSObject):
3023
mhahnenberg@apple.comb44a7f02012-07-26 23:27:53 +000030242012-07-26 Mark Hahnenberg <mhahnenberg@apple.com>
3025
3026 Allocate Structures in a separate part of the Heap
3027 https://bugs.webkit.org/show_bug.cgi?id=92420
3028
3029 Reviewed by Filip Pizlo.
3030
3031 To fix our issue with destruction/finalization of Structures before their objects, we can move Structures to a separate
3032 part of the Heap that will be swept after all other objects. This first patch will just be separating Structures
3033 out into their own separate MarkedAllocator. Everything else will behave identically.
3034
3035 * heap/Heap.h: New function to allocate Structures in the Heap.
3036 (Heap):
3037 (JSC):
3038 (JSC::Heap::allocateStructure):
3039 * heap/MarkedAllocator.cpp: Pass whether or not we're allocated Structures to the MarkedBlock.
3040 (JSC::MarkedAllocator::allocateBlock):
3041 * heap/MarkedAllocator.h: Add tracking for whether or not we're allocating only Structures.
3042 (JSC::MarkedAllocator::onlyContainsStructures):
3043 (MarkedAllocator):
3044 (JSC::MarkedAllocator::MarkedAllocator):
3045 (JSC::MarkedAllocator::init):
3046 * heap/MarkedBlock.cpp: Add tracking for whether or not we're allocating only Structures. We need this to be able to
3047 distinguish the various MarkedBlock types in MarkedSpace::allocatorFor(MarkedBlock*).
3048 (JSC::MarkedBlock::create):
3049 (JSC::MarkedBlock::MarkedBlock):
3050 * heap/MarkedBlock.h:
3051 (MarkedBlock):
3052 (JSC::MarkedBlock::onlyContainsStructures):
3053 (JSC):
3054 * heap/MarkedSpace.cpp: Include the new Structure allocator in all the places that all the other allocators are used/modified.
3055 (JSC::MarkedSpace::MarkedSpace):
3056 (JSC::MarkedSpace::resetAllocators):
3057 (JSC::MarkedSpace::canonicalizeCellLivenessData):
3058 (JSC::MarkedSpace::isPagedOut):
3059 * heap/MarkedSpace.h: Add new MarkedAllocator just for Structures.
3060 (MarkedSpace):
3061 (JSC::MarkedSpace::allocatorFor):
3062 (JSC::MarkedSpace::allocateStructure):
3063 (JSC):
3064 (JSC::MarkedSpace::forEachBlock):
3065 * runtime/Structure.h: Move all of the functions that call allocateCell<Structure> down below the explicit template specialization
3066 for allocateCell<Structure>. The new inline specialization for allocateCell directly calls the allocateStructure() function in the
3067 Heap.
3068 (Structure):
3069 (JSC::Structure):
3070 (JSC):
3071 (JSC::Structure::create):
3072 (JSC::Structure::createStructure):
3073
fpizlo@apple.com2b1d81e2012-07-26 23:01:05 +000030742012-07-26 Filip Pizlo <fpizlo@apple.com>
3075
3076 JSArray has methods that are neither used nor defined
3077 https://bugs.webkit.org/show_bug.cgi?id=92416
3078
3079 Reviewed by Simon Fraser.
3080
3081 * runtime/JSArray.h:
3082 (JSArray):
3083
zherczeg@webkit.org4a637582012-07-26 12:29:10 +000030842012-07-26 Zoltan Herczeg <zherczeg@webkit.org>
3085
3086 [Qt][ARM]ARMAssembler needs buildfix afert r123417
3087 https://bugs.webkit.org/show_bug.cgi?id=92086
3088
3089 Reviewed by Csaba Osztrogonác.
3090
3091 The ARM implementation of this should be optimized code path
3092 is covered by a non-optimized code path. This patch fixes this,
3093 and adds a new function which returns with the offset range.
3094
3095 * assembler/ARMAssembler.h:
3096 (JSC::ARMAssembler::readPointer):
3097 (ARMAssembler):
3098 (JSC::ARMAssembler::repatchInt32):
3099 (JSC::ARMAssembler::repatchCompact):
3100 * assembler/MacroAssemblerARM.h:
3101 (MacroAssemblerARM):
3102 (JSC::MacroAssemblerARM::isCompactPtrAlignedAddressOffset):
3103 (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
3104
mhahnenberg@apple.com9a75d6f2012-07-26 06:06:25 +000031052012-07-25 Mark Hahnenberg <mhahnenberg@apple.com>
3106
3107 Build fix for 32-bit after r123682
3108
3109 * runtime/JSObject.h: Need to pad out JSObjects on 32-bit so that they're the correct size since
3110 we only removed one 4-byte word and we need to be 8-byte aligned.
3111 (JSObject):
3112
fpizlo@apple.com338a70dc2012-07-26 01:22:59 +000031132012-07-25 Filip Pizlo <fpizlo@apple.com>
3114
3115 JSC GC object copying APIs should allow for greater flexibility
3116 https://bugs.webkit.org/show_bug.cgi?id=92316
3117
3118 Reviewed by Mark Hahnenberg.
3119
3120 It's now the case that visitChildren() methods can directly pin and allocate in new space during copying.
3121 They can also do the copying and marking themselves. This new API is only used for JSObjects for now.
3122
3123 * JavaScriptCore.xcodeproj/project.pbxproj:
3124 * heap/MarkStack.cpp:
3125 (JSC::SlotVisitor::allocateNewSpaceSlow):
3126 (JSC::SlotVisitor::allocateNewSpaceOrPin):
3127 (JSC):
3128 (JSC::SlotVisitor::copyAndAppend):
3129 * heap/MarkStack.h:
3130 (MarkStack):
3131 (JSC::MarkStack::appendUnbarrieredValue):
3132 (JSC):
3133 * heap/SlotVisitor.h:
3134 * heap/SlotVisitorInlineMethods.h: Added.
3135 (JSC):
3136 (JSC::SlotVisitor::checkIfShouldCopyAndPinOtherwise):
3137 (JSC::SlotVisitor::allocateNewSpace):
3138 * runtime/JSObject.cpp:
3139 (JSC::JSObject::visitOutOfLineStorage):
3140 (JSC):
3141 (JSC::JSObject::visitChildren):
3142 (JSC::JSFinalObject::visitChildren):
3143 * runtime/JSObject.h:
3144 (JSObject):
3145
mhahnenberg@apple.com0e8fce12012-07-26 00:12:58 +000031462012-07-25 Mark Hahnenberg <mhahnenberg@apple.com>
3147
3148 Remove JSObject::m_inheritorID
3149 https://bugs.webkit.org/show_bug.cgi?id=88378
3150
3151 Reviewed by Filip Pizlo.
3152
3153 This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
3154 and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
3155 Instead use a private named value in the object's property storage.
3156
3157 * dfg/DFGSpeculativeJIT.h:
3158 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): No need m_inheritorID to initialize!
3159 * jit/JITInlineMethods.h:
3160 (JSC::JIT::emitAllocateBasicJSObject): No need m_inheritorID to initialize!
3161 * llint/LowLevelInterpreter.asm: No need m_inheritorID to initialize!
3162 * runtime/JSGlobalData.h:
3163 (JSGlobalData): Added private name 'm_inheritorIDKey'.
3164 * runtime/JSGlobalThis.cpp:
3165 (JSC::JSGlobalThis::setUnwrappedObject): resetInheritorID is now passed a JSGlobalData&.
3166 * runtime/JSObject.cpp:
3167 (JSC::JSObject::visitChildren): No m_inheritorID to be marked.
3168 (JSC::JSFinalObject::visitChildren): No m_inheritorID to be marked.
3169 (JSC::JSObject::createInheritorID): Store the newly created inheritorID in the property map. Make sure
3170 it's got the DontEnum attribute!!
3171 * runtime/JSObject.h:
3172 (JSObject):
3173 (JSC::JSObject::resetInheritorID): Remove the inheritorID from property storage.
3174 (JSC):
3175 (JSC::JSObject::inheritorID): Read the inheritorID from property storage.
3176
caio.oliveira@openbossa.org947a2282012-07-25 22:15:05 +000031772012-07-25 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
3178
3179 Create a specialized pair for use in HashMap iterators
3180 https://bugs.webkit.org/show_bug.cgi?id=92137
3181
3182 Reviewed by Ryosuke Niwa.
3183
3184 Update a couple of sites that relied on the fact that "contents" of iterators were
3185 std::pairs.
3186
3187 * profiler/Profile.cpp:
3188 (JSC): This code kept a vector of the pairs that were the "contents" of the iterators. This
3189 is changed to use a KeyValuePair. We make use HashCount's ValueType (which represents only
3190 the key) to get the proper key parameter for KeyValuePair.
3191 * tools/ProfileTreeNode.h:
3192 (ProfileTreeNode): Use HashMap::ValueType to declare the type of the contents of the hash
3193 instead of declaring it manually. This will make use of the new KeyValuePair.
3194
paroga@webkit.orgcf6740e2012-07-25 07:42:03 +000031952012-07-25 Patrick Gansterer <paroga@webkit.org>
3196
3197 REGRESSION(r123505): Date.getYear() returns the same as Date.getFullYear()
3198 https://bugs.webkit.org/show_bug.cgi?id=92218
3199
3200 Reviewed by Csaba Osztrogonác.
3201
3202 * runtime/DatePrototype.cpp:
3203 (JSC::dateProtoFuncGetYear): Added the missing offset of 1900 to the return value.
3204
fpizlo@apple.coma7f7dcd2012-07-24 19:47:18 +000032052012-07-24 Filip Pizlo <fpizlo@apple.com>
3206
3207 REGRESSION(r123417): It made tests assert/crash on 32 bit
3208 https://bugs.webkit.org/show_bug.cgi?id=92088
3209
3210 Reviewed by Mark Hahnenberg.
3211
3212 The pointer arithmetic was wrong, because negative numbers are hard to think about.
3213
3214 * dfg/DFGRepatch.cpp:
3215 (JSC::DFG::emitPutTransitionStub):
3216 * dfg/DFGSpeculativeJIT.cpp:
3217 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
3218
paroga@webkit.orgf2de22c2012-07-24 19:03:57 +000032192012-07-24 Patrick Gansterer <paroga@webkit.org>
3220
paroga@webkit.org683889f2012-07-24 19:25:30 +00003221 Store the full year in GregorianDateTime
3222 https://bugs.webkit.org/show_bug.cgi?id=92067
3223
3224 Reviewed by Geoffrey Garen.
3225
3226 Use the full year instead of the offset from year 1900
3227 for the year member variable of GregorianDateTime.
3228
3229 * runtime/DateConstructor.cpp:
3230 (JSC::constructDate):
3231 (JSC::dateUTC):
3232 * runtime/DateConversion.cpp:
3233 (JSC::formatDate):
3234 (JSC::formatDateUTCVariant):
3235 * runtime/DatePrototype.cpp:
3236 (JSC::formatLocaleDate):
3237 (JSC::fillStructuresUsingDateArgs):
3238 (JSC::dateProtoFuncToISOString):
3239 (JSC::dateProtoFuncGetFullYear):
3240 (JSC::dateProtoFuncGetUTCFullYear):
3241 (JSC::dateProtoFuncSetYear):
3242 * runtime/JSDateMath.cpp:
3243 (JSC::gregorianDateTimeToMS):
3244 (JSC::msToGregorianDateTime):
3245
32462012-07-24 Patrick Gansterer <paroga@webkit.org>
3247
paroga@webkit.orgf2de22c2012-07-24 19:03:57 +00003248 [WIN] Build fix after r123417.
3249
3250 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3251
paroga@webkit.org175d46f2012-07-24 05:19:55 +000032522012-07-23 Patrick Gansterer <paroga@webkit.org>
3253
3254 Move GregorianDateTime from JSC to WTF namespace
3255 https://bugs.webkit.org/show_bug.cgi?id=91948
3256
3257 Reviewed by Geoffrey Garen.
3258
3259 Moving GregorianDateTime into the WTF namespace allows us to us to
3260 use it in WebCore too. The new class has the same behaviour as the
3261 old struct. Only the unused timeZone member has been removed.
3262
3263 * runtime/DateConstructor.cpp:
3264 * runtime/DateConversion.cpp:
3265 * runtime/DateConversion.h:
3266 * runtime/DateInstance.h:
3267 * runtime/DatePrototype.cpp:
3268 * runtime/JSDateMath.cpp:
3269 * runtime/JSDateMath.h:
3270
fpizlo@apple.com94a9c102012-07-23 22:38:30 +000032712012-07-23 Filip Pizlo <fpizlo@apple.com>
3272
fpizlo@apple.com961a9562012-07-24 02:13:19 +00003273 Property storage should grow in reverse address direction, to support butterflies
3274 https://bugs.webkit.org/show_bug.cgi?id=91788
3275
3276 Reviewed by Geoffrey Garen.
3277
3278 Changes property storage to grow to the left, and changes the property storage pointer to point
3279 one 8-byte word (i.e. JSValue) to the right of the first value in the storage.
3280
3281 Also improved debug support somewhat, by adding a describe() function to the jsc command-line,
3282 and a slow mode of object access in LLInt.
3283
3284 * assembler/ARMv7Assembler.h:
3285 (JSC::ARMv7Assembler::repatchCompact):
3286 * assembler/MacroAssemblerARMv7.h:
3287 (MacroAssemblerARMv7):
3288 (JSC::MacroAssemblerARMv7::isCompactPtrAlignedAddressOffset):
3289 (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
3290 * assembler/MacroAssemblerX86Common.h:
3291 (JSC::MacroAssemblerX86Common::isCompactPtrAlignedAddressOffset):
3292 (JSC::MacroAssemblerX86Common::repatchCompact):
3293 * assembler/X86Assembler.h:
3294 (JSC::X86Assembler::repatchCompact):
3295 * bytecode/CodeBlock.cpp:
3296 (JSC::dumpStructure):
3297 * bytecode/GetByIdStatus.h:
3298 (JSC::GetByIdStatus::GetByIdStatus):
3299 * dfg/DFGOperations.cpp:
3300 * dfg/DFGOperations.h:
3301 * dfg/DFGRepatch.cpp:
3302 (JSC::DFG::tryCacheGetByID):
3303 (JSC::DFG::emitPutTransitionStub):
3304 * dfg/DFGSpeculativeJIT.cpp:
3305 (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
3306 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
3307 * dfg/DFGSpeculativeJIT.h:
3308 (JSC::DFG::SpeculativeJIT::callOperation):
3309 * dfg/DFGSpeculativeJIT32_64.cpp:
3310 (JSC::DFG::SpeculativeJIT::compile):
3311 * dfg/DFGSpeculativeJIT64.cpp:
3312 (JSC::DFG::SpeculativeJIT::compile):
3313 * heap/ConservativeRoots.cpp:
3314 (JSC::ConservativeRoots::genericAddPointer):
3315 * heap/CopiedSpace.h:
3316 (CopiedSpace):
3317 * heap/CopiedSpaceInlineMethods.h:
3318 (JSC::CopiedSpace::pinIfNecessary):
3319 (JSC):
3320 * jit/JITPropertyAccess.cpp:
3321 (JSC::JIT::compileGetDirectOffset):
3322 * jit/JITPropertyAccess32_64.cpp:
3323 (JSC::JIT::compileGetDirectOffset):
3324 * jit/JITStubs.cpp:
3325 (JSC::JITThunks::tryCacheGetByID):
3326 * jsc.cpp:
3327 (GlobalObject::finishCreation):
3328 (functionDescribe):
3329 * llint/LLIntCommon.h:
3330 * llint/LLIntSlowPaths.cpp:
3331 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
3332 * llint/LowLevelInterpreter32_64.asm:
3333 * llint/LowLevelInterpreter64.asm:
3334 * runtime/JSObject.cpp:
3335 (JSC::JSObject::visitChildren):
3336 (JSC::JSFinalObject::visitChildren):
3337 (JSC::JSObject::growOutOfLineStorage):
3338 * runtime/JSObject.h:
3339 (JSC::JSObject::getDirectLocation):
3340 (JSC::JSObject::offsetForLocation):
3341 * runtime/JSValue.h:
3342 (JSValue):
3343 * runtime/PropertyOffset.h:
3344 (JSC::offsetInOutOfLineStorage):
3345
33462012-07-23 Filip Pizlo <fpizlo@apple.com>
3347
fpizlo@apple.com5128a712012-07-23 22:46:14 +00003348 DFG is too aggressive in performing the specific value optimization on loads
3349 https://bugs.webkit.org/show_bug.cgi?id=92034
3350
3351 Reviewed by Mark Hahnenberg.
3352
3353 This ensures that we don't do optimizations based on a structure having a specific
3354 value, if there is no way to detect that the value is despecified. This is the
3355 case for dictionaries, since despecifying a value in a dictionary does not lead to
3356 a transition and so cannot be caught by either structure checks or structure
3357 transition watchpoints.
3358
3359 * bytecode/GetByIdStatus.cpp:
3360 (JSC::GetByIdStatus::computeFromLLInt):
3361 (JSC::GetByIdStatus::computeForChain):
3362 (JSC::GetByIdStatus::computeFor):
3363 * bytecode/ResolveGlobalStatus.cpp:
3364 (JSC::computeForStructure):
3365
33662012-07-23 Filip Pizlo <fpizlo@apple.com>
3367
fpizlo@apple.com94a9c102012-07-23 22:38:30 +00003368 REGRESSION(r123169): It made fast/js/dfg-inline-arguments-use-from-uninlined-code.html fail on 32 bit platforms
3369 https://bugs.webkit.org/show_bug.cgi?id=92002
3370
3371 Reviewed by Mark Hahnenberg.
3372
3373 In the process of changing the nature of local variable typing, I forgot to modify one of the places where
3374 we glue the DFG's notion of variable prediction to the runtime's notion of variable tagging.
3375
3376 * dfg/DFGSpeculativeJIT.cpp:
3377 (JSC::DFG::SpeculativeJIT::compile):
3378
simon.fraser@apple.com8b810602012-07-23 21:03:45 +000033792012-07-23 Simon Fraser <simon.fraser@apple.com>
3380
3381 Part 2 of: Implement sticky positioning
3382 https://bugs.webkit.org/show_bug.cgi?id=90046
3383
3384 Reviewed by Ojan Vafai.
3385
3386 Turn on ENABLE_CSS_STICKY_POSITION.
3387
3388 * Configurations/FeatureDefines.xcconfig:
3389
paroga@webkit.orgf4635662012-07-23 20:53:35 +000033902012-07-23 Patrick Gansterer <paroga@webkit.org>
3391
3392 Move JSC::parseDate() from DateConversion to JSDateMath
3393 https://bugs.webkit.org/show_bug.cgi?id=91982
3394
3395 Reviewed by Geoffrey Garen.
3396
3397 Moveing this function into the other files removes the dependency
3398 on JSC spcific classes in DateConversion.{cpp|h}.
3399
3400 * runtime/DateConversion.cpp:
3401 * runtime/DateConversion.h:
3402 (JSC):
3403 * runtime/JSDateMath.cpp:
3404 (JSC::parseDate):
3405 (JSC):
3406 * runtime/JSDateMath.h:
3407 (JSC):
3408
simon.fraser@apple.com5cc8c732012-07-23 17:45:43 +000034092012-07-23 Simon Fraser <simon.fraser@apple.com>
3410
3411 Part 1 of: Implement sticky positioning
3412 https://bugs.webkit.org/show_bug.cgi?id=90046
3413
3414 Reviewed by Ojan Vafai.
3415
3416 Add ENABLE_CSS_STICKY_POSITION, defaulting to off initially.
3417
3418 Sort the ENABLE_CSS lines in the file. Make sure all the flags
3419 are in FEATURE_DEFINES.
3420
3421 * Configurations/FeatureDefines.xcconfig:
3422
commit-queue@webkit.org1f562642012-07-23 15:49:29 +000034232012-07-23 Yong Li <yoli@rim.com>
3424
3425 [BlackBerry] Implement GCActivityCallback with platform timer
3426 https://bugs.webkit.org/show_bug.cgi?id=90175
3427
3428 Reviewed by Rob Buis.
3429
3430 Use JSLock when performing GC to avoid assertions.
3431
3432 * runtime/GCActivityCallbackBlackBerry.cpp:
3433 (JSC::DefaultGCActivityCallback::doWork):
3434
tkent@chromium.orgd89d5452012-07-22 23:23:53 +000034352012-07-23 Kent Tamura <tkent@chromium.org>
3436
3437 Rename ENABLE_METER_TAG and ENABLE_PROGRESS_TAG to ENABLE_METER_ELEMENT and ENABLE_PROGRESS_ELEMENT respectively
3438 https://bugs.webkit.org/show_bug.cgi?id=91941
3439
3440 Reviewed by Kentaro Hara.
3441
3442 A flag name for an elmement should be ENABLE_*_ELEMENT.
3443
3444 * Configurations/FeatureDefines.xcconfig:
3445
tkent@chromium.org43921e62012-07-22 10:59:32 +000034462012-07-22 Kent Tamura <tkent@chromium.org>
3447
3448 Rename ENABLE_DETAILS to ENABLE_DETAILS_ELEMENT
3449 https://bugs.webkit.org/show_bug.cgi?id=91928
3450
3451 Reviewed by Kentaro Hara.
3452
3453 A flag name for an elmement should be ENABLE_*_ELEMENT.
3454
3455 * Configurations/FeatureDefines.xcconfig:
3456
paroga@webkit.org6a026682012-07-21 21:22:28 +000034572012-07-21 Patrick Gansterer <paroga@webkit.org>
3458
3459 [WIN] Use GetDateFormat and GetTimeFormat instead of strftime
3460 https://bugs.webkit.org/show_bug.cgi?id=83436
3461
3462 Reviewed by Brent Fulgham.
3463
3464 The MS CRT implementation of strftime calls the same two functions.
3465 Using them directly avoids the overhead of parsing the format string and removes
3466 the dependency on strftime() for WinCE where this function does not exist.
3467
3468 * runtime/DatePrototype.cpp:
3469 (JSC::formatLocaleDate):
3470
tkent@chromium.org3d897372012-07-21 02:00:46 +000034712012-07-20 Kent Tamura <tkent@chromium.org>
3472
3473 Rename ENABLE_DATALIST to ENABLE_DATALIST_ELEMENT
3474 https://bugs.webkit.org/show_bug.cgi?id=91846
3475
3476 Reviewed by Kentaro Hara.
3477
3478 A flag name for an elmement should be ENABLE_*_ELEMENT.
3479
3480 * Configurations/FeatureDefines.xcconfig:
3481
commit-queue@webkit.org68c202c2012-07-20 20:09:02 +000034822012-07-20 Han Shen <shenhan@google.com>
3483
3484 [Chromium] Compilation fails under gcc 4.7
3485 https://bugs.webkit.org/show_bug.cgi?id=90227
3486
3487 Reviewed by Tony Chang.
3488
3489 Disable warnings about c++0x compatibility in gcc newer than 4.6.
3490
3491 * JavaScriptCore.gyp/JavaScriptCore.gyp:
3492
fpizlo@apple.com00528432012-07-20 03:50:02 +000034932012-07-18 Filip Pizlo <fpizlo@apple.com>
3494
3495 DFG cell checks should be hoisted
3496 https://bugs.webkit.org/show_bug.cgi?id=91717
3497
3498 Reviewed by Geoffrey Garen.
3499
3500 The DFG has always had the policy of hoisting array and integer checks to
3501 the point of variable assignment. Eventually, we added doubles and booleans
3502 to the mix. But cells should really be part of this as well, particularly
3503 for 32-bit where accessing a known-type variable is dramatically cheaper
3504 than accessing a variable whose types is only predicted but otherwise
3505 unproven.
3506
3507 This appears to be a definite speed-up for V8 on 32-bit, a possible speed-up
3508 for Kraken, and a possible slow-down for V8 on 64-bit (around 0.2% if at
3509 all). Any slow-downs can, and should, be addressed by making the hoisting
3510 logic cognizant of variables that are never used in a manner that requires
3511 type checks, and by sinking argument checks to the point(s) of first use.
3512
3513 To make this work I had to change some OSR machinery, and special-case the
3514 type predictions of the 'this' argument for constructors. OSR exit normally
3515 assumes that arguments are boxed, which happens to be true because the
3516 type prediction used for check hoisting is LUB'd with the type of the
3517 argument that was passed in - so either the arguments are always stored to
3518 with the full tag+payload, or if only the payload is stored then the tag
3519 matches whatever the caller would have set. But not so with the 'this'
3520 argument for constructors, which is not initialized by the caller. We
3521 could make this more precise by having argument types for OSR be inferred
3522 using similar machinery to other locals, but I figured that for this patch
3523 I should use the surgical fix.
3524
3525 * assembler/MacroAssemblerX86_64.h:
3526 (JSC::MacroAssemblerX86_64::branchTestPtr):
3527 (MacroAssemblerX86_64):
3528 * assembler/X86Assembler.h:
3529 (JSC::X86Assembler::testq_rm):
3530 (X86Assembler):
3531 * dfg/DFGAbstractState.cpp:
3532 (JSC::DFG::AbstractState::initialize):
3533 (JSC::DFG::AbstractState::execute):
3534 * dfg/DFGDriver.cpp:
3535 (JSC::DFG::compile):
3536 * dfg/DFGGraph.h:
3537 (JSC::DFG::Graph::isCreatedThisArgument):
3538 (Graph):
3539 * dfg/DFGSpeculativeJIT.cpp:
3540 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
3541 * dfg/DFGSpeculativeJIT32_64.cpp:
3542 (JSC::DFG::SpeculativeJIT::compile):
3543 * dfg/DFGSpeculativeJIT64.cpp:
3544 (JSC::DFG::SpeculativeJIT::compile):
3545 * dfg/DFGValueSource.h:
3546 (JSC::DFG::ValueSource::forSpeculation):
3547
fpizlo@apple.com26e27a62012-07-20 00:04:51 +000035482012-07-19 Filip Pizlo <fpizlo@apple.com>
3549
3550 Fast path of storage resize should be removed from property storage reallocation, since it is only useful for arrays
3551 https://bugs.webkit.org/show_bug.cgi?id=91796
3552
3553 Reviewed by Geoffrey Garen.
3554
3555 * dfg/DFGRepatch.cpp:
3556 (JSC::DFG::emitPutTransitionStub):
3557 * dfg/DFGSpeculativeJIT.cpp:
3558 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
3559 * runtime/JSObject.cpp:
3560 (JSC::JSObject::growOutOfLineStorage):
3561
commit-queue@webkit.orge602eca2012-07-19 20:53:22 +000035622012-07-19 Mark Lam <mark.lam@apple.com>
3563
3564 Bug fixes and enhancements for OfflineASM annotation system.
3565 https://bugs.webkit.org/show_bug.cgi?id=91690
3566
3567 Reviewed by Filip Pizlo.
3568
3569 * offlineasm/armv7.rb: added default handling of Instruction lower().
3570 * offlineasm/asm.rb: added more support for annotations and more pretty printing.
3571 * offlineasm/ast.rb: added more support for annotations.
3572 * offlineasm/config.rb: added $preferredCommentStartColumn, simplified $enableInstrAnnotations.
3573 * offlineasm/parser.rb: added more support for annotations.
3574 * offlineasm/transform.rb: added more support for annotations.
3575 * offlineasm/x86.rb: added default handling of Instruction lower().
3576
paroga@webkit.orgcb7c1a12012-07-19 18:20:53 +000035772012-07-19 Patrick Gansterer <paroga@webkit.org>
3578
3579 [WIN] Fix compilation of JSGlobalData.h with ENABLE(DFG_JIT)
3580 https://bugs.webkit.org/show_bug.cgi?id=91243
3581
3582 Reviewed by Geoffrey Garen.
3583
3584 Disable MSVC warning 4200 "zero-sized array in struct/union" for JSC::ScratchBuffer.
3585
3586 * runtime/JSGlobalData.h:
3587 (JSC):
3588
commit-queue@webkit.orgf06140e2012-07-19 15:45:26 +000035892012-07-19 Mark Lam <mark.lam@apple.com>
3590
3591 Fixed broken ENABLE_JIT=0 build.
3592 https://bugs.webkit.org/show_bug.cgi?id=91725
3593
3594 Reviewed by Oliver Hunt.
3595
3596 * bytecode/Watchpoint.cpp:
3597 * heap/JITStubRoutineSet.h:
3598 (JSC):
3599 (JITStubRoutineSet):
3600 (JSC::JITStubRoutineSet::JITStubRoutineSet):
3601 (JSC::JITStubRoutineSet::~JITStubRoutineSet):
3602 (JSC::JITStubRoutineSet::add):
3603 (JSC::JITStubRoutineSet::clearMarks):
3604 (JSC::JITStubRoutineSet::mark):
3605 (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
3606 (JSC::JITStubRoutineSet::traceMarkedStubRoutines):
3607
kkristof@inf.u-szeged.hub203f612012-07-19 13:21:38 +000036082012-07-19 Kristóf Kosztyó <kkristof@inf.u-szeged.hu>
3609
3610 [Qt] Unreviewed buildfix after r123042.
3611
3612 * interpreter/Interpreter.cpp:
3613 (JSC::Interpreter::dumpRegisters):
3614
fpizlo@apple.com1ffdcff2012-07-19 00:30:34 +000036152012-07-18 Filip Pizlo <fpizlo@apple.com>
3616
3617 DFG should emit inline code for property storage (re)allocation
3618 https://bugs.webkit.org/show_bug.cgi?id=91597
3619
3620 Reviewed by Oliver Hunt.
3621
3622 This adds two new ops to the DFG IR: AllocatePropertyStorage and
3623 ReallocatePropertyStorage. It enables these to interact properly with
3624 CSE so that a GetPropertyStorage on something for which we have
3625 obviously done a (Re)AllocatePropertyStorage will result in the
3626 GetPropertyStorage being eliminated. Other than that, the code
3627 emitted for these ops is identical to the code we were emitting in
3628 the corresponding PutById stub.
3629
3630 * dfg/DFGAbstractState.cpp:
3631 (JSC::DFG::AbstractState::execute):
3632 * dfg/DFGByteCodeParser.cpp:
3633 (JSC::DFG::ByteCodeParser::parseBlock):
3634 * dfg/DFGCSEPhase.cpp:
3635 (JSC::DFG::CSEPhase::putStructureStoreElimination):
3636 (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
3637 * dfg/DFGNode.h:
3638 (JSC::DFG::Node::hasStructureTransitionData):
3639 * dfg/DFGNodeType.h:
3640 (DFG):
3641 * dfg/DFGOperations.cpp:
3642 * dfg/DFGOperations.h:
3643 * dfg/DFGPredictionPropagationPhase.cpp:
3644 (JSC::DFG::PredictionPropagationPhase::propagate):
3645 * dfg/DFGSpeculativeJIT.cpp:
3646 (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
3647 (DFG):
3648 (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
3649 * dfg/DFGSpeculativeJIT.h:
3650 (JSC::DFG::SpeculativeJIT::callOperation):
3651 (SpeculativeJIT):
3652 * dfg/DFGSpeculativeJIT32_64.cpp:
3653 (JSC::DFG::SpeculativeJIT::compile):
3654 * dfg/DFGSpeculativeJIT64.cpp:
3655 (JSC::DFG::SpeculativeJIT::compile):
3656 * runtime/Structure.cpp:
3657 (JSC::nextOutOfLineStorageCapacity):
3658 * runtime/Structure.h:
3659 (JSC):
3660
oliver@apple.coma08210b2012-07-18 23:26:06 +000036612012-07-16 Oliver Hunt <oliver@apple.com>
3662
3663 dumpCallFrame is broken in ToT
3664 https://bugs.webkit.org/show_bug.cgi?id=91444
3665
3666 Reviewed by Gavin Barraclough.
3667
3668 Various changes have been made to the SF calling convention, but
3669 dumpCallFrame has not been updated to reflect these changes.
3670 That resulted in both bogus information, as well as numerous
3671 assertions of sadness.
3672
3673 This patch makes dumpCallFrame actually work again and adds the
3674 wonderful feature of telling you the name of the variable that a
3675 register reflects, or what value it contains.
3676
3677 * bytecode/CodeBlock.cpp:
3678 (JSC::CodeBlock::nameForRegister):
3679 A really innefficient mechanism for finding the name of a local register.
3680 This should only ever be used by debug code so this should be okay.
3681 * bytecode/CodeBlock.h:
3682 (CodeBlock):
3683 * bytecompiler/BytecodeGenerator.cpp:
3684 (JSC::BytecodeGenerator::generate):
3685 Debug builds no longer throw away a functions symbol table, this allows
3686 us to actually perform a register# to name mapping
3687 * dfg/DFGJITCompiler.cpp:
3688 (JSC::DFG::JITCompiler::link):
3689 We weren't propogating the bytecode offset here leading to assertions
3690 in debug builds when dumping bytecode of DFG compiled code.
3691 * interpreter/Interpreter.cpp:
3692 (JSC):
3693 (JSC::Interpreter::dumpRegisters):
3694 Rework to actually be correct.
3695 (JSC::getCallerInfo):
3696 Return the byteocde offset as well now, given we have to determine it
3697 anyway.
3698 (JSC::Interpreter::getStackTrace):
3699 (JSC::Interpreter::retrieveCallerFromVMCode):
3700 * interpreter/Interpreter.h:
3701 (Interpreter):
3702 * jsc.cpp:
3703 (GlobalObject::finishCreation):
3704 (functionDumpCallFrame):
3705 Give debug builds of JSC a method for calling dumpCallFrame so we can
3706 inspect a callframe without requiring us to break in a debugger.
3707
fpizlo@apple.comc6429b82012-07-18 22:17:18 +000037082012-07-18 Filip Pizlo <fpizlo@apple.com>
3709
3710 DFG 32-bit PutById transition stub storage reallocation case copies the first pointer of each JSValue instead of the whole JSValue
3711 https://bugs.webkit.org/show_bug.cgi?id=91599
3712
3713 Reviewed by Geoffrey Garen.
3714
3715 * dfg/DFGRepatch.cpp:
3716 (JSC::DFG::emitPutTransitionStub):
3717
fpizlo@apple.com07669e22012-07-17 23:11:23 +000037182012-07-17 Filip Pizlo <fpizlo@apple.com>
3719
fpizlo@apple.com41c6f1e2012-07-18 04:42:55 +00003720 DFG 32-bit PutById transition stub passes the payload/tag arguments to a DFG operation in the wrong order
3721 https://bugs.webkit.org/show_bug.cgi?id=91576
3722
3723 Reviewed by Gavin Barraclough.
3724
3725 * dfg/DFGRepatch.cpp:
3726 (JSC::DFG::emitPutTransitionStub):
3727
37282012-07-17 Filip Pizlo <fpizlo@apple.com>
3729
fpizlo@apple.com07669e22012-07-17 23:11:23 +00003730 [Qt] REGRESSION(r122768, r122771): They broke jquery/data.html and inspector/elements/edit-dom-actions.html
3731 https://bugs.webkit.org/show_bug.cgi?id=91476
3732
3733 Reviewed by Mark Hahnenberg.
3734
3735 The 32-bit repatching code was not correctly adapted to the new world where there may not always
3736 be an available scratch register. Fixed it by ensuring that the scratch register we select does
3737 not overlap with the value tag.
3738
3739 * dfg/DFGRepatch.cpp:
3740 (JSC::DFG::generateProtoChainAccessStub):
3741 (JSC::DFG::tryCacheGetByID):
3742 (JSC::DFG::tryBuildGetByIDList):
3743 (JSC::DFG::emitPutReplaceStub):
3744
rgabor@webkit.org600a0c12012-07-17 07:59:57 +000037452012-07-17 Gabor Rapcsanyi <rgabor@webkit.org>
3746
3747 Unreviewed buildfix from Zoltan Herczeg after 122768.
3748
3749 * dfg/DFGCCallHelpers.h:
3750 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
3751 (CCallHelpers):
3752
commit-queue@webkit.org7bf73302012-07-17 07:11:52 +000037532012-07-17 David Barr <davidbarr@chromium.org>
3754
3755 Introduce ENABLE_CSS_IMAGE_ORIENTATION compile flag
3756 https://bugs.webkit.org/show_bug.cgi?id=89055
3757
3758 Reviewed by Kent Tamura.
3759
3760 The css3-images module is at candidate recommendation.
3761 http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation
3762
3763 Add a configuration option for CSS image-orientation support, disabling it by default.
3764
3765 * Configurations/FeatureDefines.xcconfig:
3766
fpizlo@apple.com68bef1d2012-07-17 01:43:56 +000037672012-07-16 Filip Pizlo <fpizlo@apple.com>
3768
3769 Unreviewed, roll out 122790 because it broke the Windows build. I'm not
3770 sure what to do with exported symbols that are predicated on NDEBUG.
3771
3772 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
3773 * bytecode/CodeBlock.cpp:
3774 (JSC):
3775 * bytecode/CodeBlock.h:
3776 (CodeBlock):
3777 * bytecompiler/BytecodeGenerator.cpp:
3778 (JSC::BytecodeGenerator::generate):
3779 * dfg/DFGJITCompiler.cpp:
3780 (JSC::DFG::JITCompiler::link):
3781 * interpreter/Interpreter.cpp:
3782 (JSC):
3783 (JSC::Interpreter::dumpRegisters):
3784 (JSC::getCallerInfo):
3785 (JSC::Interpreter::getStackTrace):
3786 (JSC::Interpreter::retrieveCallerFromVMCode):
3787 * interpreter/Interpreter.h:
3788 (Interpreter):
3789 * jsc.cpp:
3790 (GlobalObject::finishCreation):
3791
oliver@apple.com0acb42b2012-07-17 01:14:18 +000037922012-07-16 Oliver Hunt <oliver@apple.com>
3793
3794 dumpCallFrame is broken in ToT
3795 https://bugs.webkit.org/show_bug.cgi?id=91444
3796
3797 Reviewed by Gavin Barraclough.
3798
3799 Various changes have been made to the SF calling convention, but
3800 dumpCallFrame has not been updated to reflect these changes.
3801 That resulted in both bogus information, as well as numerous
3802 assertions of sadness.
3803
3804 This patch makes dumpCallFrame actually work again and adds the
3805 wonderful feature of telling you the name of the variable that a
3806 register reflects, or what value it contains.
3807
3808 * bytecode/CodeBlock.cpp:
3809 (JSC::CodeBlock::nameForRegister):
3810 A really innefficient mechanism for finding the name of a local register.
3811 This should only ever be used by debug code so this should be okay.
3812 * bytecode/CodeBlock.h:
3813 (CodeBlock):
3814 * bytecompiler/BytecodeGenerator.cpp:
3815 (JSC::BytecodeGenerator::generate):
3816 Debug builds no longer throw away a functions symbol table, this allows
3817 us to actually perform a register# to name mapping
3818 * dfg/DFGJITCompiler.cpp:
3819 (JSC::DFG::JITCompiler::link):
3820 We weren't propogating the bytecode offset here leading to assertions
3821 in debug builds when dumping bytecode of DFG compiled code.
3822 * interpreter/Interpreter.cpp:
3823 (JSC):
3824 (JSC::Interpreter::dumpRegisters):
3825 Rework to actually be correct.
3826 (JSC::getCallerInfo):
3827 Return the byteocde offset as well now, given we have to determine it
3828 anyway.
3829 (JSC::Interpreter::getStackTrace):
3830 (JSC::Interpreter::retrieveCallerFromVMCode):
3831 * interpreter/Interpreter.h:
3832 (Interpreter):
3833 * jsc.cpp:
3834 (GlobalObject::finishCreation):
3835 (functionDumpCallFrame):
3836 Give debug builds of JSC a method for calling dumpCallFrame so we can
3837 inspect a callframe without requiring us to break in a debugger.
3838
fpizlo@apple.comcd8b6662012-07-16 22:17:29 +000038392012-07-16 Filip Pizlo <fpizlo@apple.com>
3840
3841 Unreviewed, adding forgotten files.
3842
3843 * dfg/DFGRegisterSet.h: Added.
3844 (DFG):
3845 (RegisterSet):
3846 (JSC::DFG::RegisterSet::RegisterSet):
3847 (JSC::DFG::RegisterSet::asPOD):
3848 (JSC::DFG::RegisterSet::copyInfo):
3849 (JSC::DFG::RegisterSet::set):
3850 (JSC::DFG::RegisterSet::setGPRByIndex):
3851 (JSC::DFG::RegisterSet::clear):
3852 (JSC::DFG::RegisterSet::get):
3853 (JSC::DFG::RegisterSet::getGPRByIndex):
3854 (JSC::DFG::RegisterSet::getFreeGPR):
3855 (JSC::DFG::RegisterSet::setFPRByIndex):
3856 (JSC::DFG::RegisterSet::getFPRByIndex):
3857 (JSC::DFG::RegisterSet::setByIndex):
3858 (JSC::DFG::RegisterSet::getByIndex):
3859 (JSC::DFG::RegisterSet::numberOfSetGPRs):
3860 (JSC::DFG::RegisterSet::numberOfSetFPRs):
3861 (JSC::DFG::RegisterSet::numberOfSetRegisters):
3862 (JSC::DFG::RegisterSet::setBit):
3863 (JSC::DFG::RegisterSet::clearBit):
3864 (JSC::DFG::RegisterSet::getBit):
3865 * dfg/DFGScratchRegisterAllocator.h: Added.
3866 (DFG):
3867 (ScratchRegisterAllocator):
3868 (JSC::DFG::ScratchRegisterAllocator::ScratchRegisterAllocator):
3869 (JSC::DFG::ScratchRegisterAllocator::lock):
3870 (JSC::DFG::ScratchRegisterAllocator::allocateScratch):
3871 (JSC::DFG::ScratchRegisterAllocator::allocateScratchGPR):
3872 (JSC::DFG::ScratchRegisterAllocator::allocateScratchFPR):
3873 (JSC::DFG::ScratchRegisterAllocator::didReuseRegisters):
3874 (JSC::DFG::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
3875 (JSC::DFG::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
3876 (JSC::DFG::ScratchRegisterAllocator::desiredScratchBufferSize):
3877 (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
3878 (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
3879
fpizlo@apple.com2f2052a2012-07-16 22:08:21 +000038802012-07-15 Filip Pizlo <fpizlo@apple.com>
3881
3882 DFG PutById transition should handle storage allocation, and inline it
3883 https://bugs.webkit.org/show_bug.cgi?id=91337
3884
3885 Reviewed by Oliver Hunt.
3886
3887 This enables the patching of DFG PutById to handle the out-of-line storage
3888 allocation case. Furthermore, it inlines out-of-line storage allocation (and
3889 reallocation) into the generated stubs.
3890
3891 To do this, this patch adds the ability to store the relevant register
3892 allocation state (i.e. the set of in-use registers) in the structure stub
3893 info so that the stub generation code can more flexibly select scratch
3894 registers: sometimes it needs none, sometimes one - or sometimes up to
3895 three. Moreover, to make the stub generation register allocation simple and
3896 maintainable, this patch introduces a reusable scratch register allocator
3897 class. This register allocator understands that some registers are in use by
3898 the main path code and so must be spilled as necessary, other registers are
3899 locked for use in the stub itself and so cannot even be spilled, while still
3900 others may be allocated for scratch purposes. A scratch register that is
3901 used must be spilled. If a register is locked, it cannot be used as a
3902 scratch register. If a register is used, it can be used as a scratch
3903 register so long as it is spilled.
3904
3905 This is a sub-1% speed-up on V8 and neutral elsewhere.
3906
3907 * GNUmakefile.list.am:
3908 * JavaScriptCore.xcodeproj/project.pbxproj:
3909 * assembler/MacroAssemblerCodeRef.h:
3910 (FunctionPtr):
3911 (JSC::FunctionPtr::FunctionPtr):
3912 * bytecode/StructureStubInfo.h:
3913 * dfg/DFGCCallHelpers.h:
3914 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
3915 (CCallHelpers):
3916 * dfg/DFGGPRInfo.h:
3917 * dfg/DFGJITCompiler.cpp:
3918 (JSC::DFG::JITCompiler::link):
3919 * dfg/DFGJITCompiler.h:
3920 (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord):
3921 (PropertyAccessRecord):
3922 * dfg/DFGOperations.cpp:
3923 * dfg/DFGOperations.h:
3924 * dfg/DFGRegisterBank.h:
3925 (JSC::DFG::RegisterBank::isInUse):
3926 (RegisterBank):
3927 * dfg/DFGRegisterSet.h: Added.
3928 (DFG):
3929 (RegisterSet):
3930 (JSC::DFG::RegisterSet::RegisterSet):
3931 (JSC::DFG::RegisterSet::asPOD):
3932 (JSC::DFG::RegisterSet::copyInfo):
3933 (JSC::DFG::RegisterSet::set):
3934 (JSC::DFG::RegisterSet::setGPRByIndex):
3935 (JSC::DFG::RegisterSet::clear):
3936 (JSC::DFG::RegisterSet::get):
3937 (JSC::DFG::RegisterSet::getGPRByIndex):
3938 (JSC::DFG::RegisterSet::getFreeGPR):
3939 (JSC::DFG::RegisterSet::setFPRByIndex):
3940 (JSC::DFG::RegisterSet::getFPRByIndex):
3941 (JSC::DFG::RegisterSet::setByIndex):
3942 (JSC::DFG::RegisterSet::getByIndex):
3943 (JSC::DFG::RegisterSet::numberOfSetGPRs):
3944 (JSC::DFG::RegisterSet::numberOfSetFPRs):
3945 (JSC::DFG::RegisterSet::numberOfSetRegisters):
3946 (JSC::DFG::RegisterSet::setBit):
3947 (JSC::DFG::RegisterSet::clearBit):
3948 (JSC::DFG::RegisterSet::getBit):
3949 * dfg/DFGRepatch.cpp:
3950 (JSC::DFG::generateProtoChainAccessStub):
3951 (JSC::DFG::tryCacheGetByID):
3952 (JSC::DFG::tryBuildGetByIDList):
3953 (JSC::DFG::emitPutReplaceStub):
3954 (JSC::DFG::emitPutTransitionStub):
3955 (JSC::DFG::tryCachePutByID):
3956 (JSC::DFG::tryBuildPutByIdList):
3957 * dfg/DFGScratchRegisterAllocator.h: Added.
3958 (DFG):
3959 (ScratchRegisterAllocator):
3960 (JSC::DFG::ScratchRegisterAllocator::ScratchRegisterAllocator):
3961 (JSC::DFG::ScratchRegisterAllocator::lock):
3962 (JSC::DFG::ScratchRegisterAllocator::allocateScratch):
3963 (JSC::DFG::ScratchRegisterAllocator::allocateScratchGPR):
3964 (JSC::DFG::ScratchRegisterAllocator::allocateScratchFPR):
3965 (JSC::DFG::ScratchRegisterAllocator::didReuseRegisters):
3966 (JSC::DFG::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
3967 (JSC::DFG::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
3968 (JSC::DFG::ScratchRegisterAllocator::desiredScratchBufferSize):
3969 (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
3970 (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
3971 * dfg/DFGSpeculativeJIT.h:
3972 (SpeculativeJIT):
3973 (JSC::DFG::SpeculativeJIT::usedRegisters):
3974 * dfg/DFGSpeculativeJIT32_64.cpp:
3975 (JSC::DFG::SpeculativeJIT::cachedGetById):
3976 (JSC::DFG::SpeculativeJIT::cachedPutById):
3977 (JSC::DFG::SpeculativeJIT::compile):
3978 * dfg/DFGSpeculativeJIT64.cpp:
3979 (JSC::DFG::SpeculativeJIT::cachedGetById):
3980 (JSC::DFG::SpeculativeJIT::cachedPutById):
3981 (JSC::DFG::SpeculativeJIT::compile):
3982 * heap/CopiedAllocator.h:
3983 (CopiedAllocator):
3984 (JSC::CopiedAllocator::fastPathShouldSucceed):
3985 (JSC):
3986
paroga@webkit.org24c86b82012-07-16 20:06:15 +000039872012-07-16 Patrick Gansterer <paroga@webkit.org>
3988
3989 Add dfg switch to create_jit_stubs script
3990 https://bugs.webkit.org/show_bug.cgi?id=91256
3991
3992 Reviewed by Geoffrey Garen.
3993
3994 * create_jit_stubs: Add a switch to enable or disable the generation of
3995 stub functions in #if ENABLE(DFG_JIT) conditions.
3996
rgabor@webkit.org58c69f82012-07-16 15:05:57 +000039972012-07-16 Gabor Rapcsanyi <rgabor@webkit.org>
3998
rgabor@webkit.org43ad3e52012-07-16 16:16:03 +00003999 Unreviewed buildfix after r122729. Typo fix.
4000
4001 * assembler/MacroAssemblerARM.h:
4002 (JSC::MacroAssemblerARM::add32):
4003
40042012-07-16 Gabor Rapcsanyi <rgabor@webkit.org>
4005
rgabor@webkit.org58c69f82012-07-16 15:05:57 +00004006 Unreviewed buildfix from Zoltan Herczeg after r122677.
4007 Implement missing add32 function to MacroAssemblerARM.
4008
4009 * assembler/MacroAssemblerARM.h:
4010 (JSC::MacroAssemblerARM::add32):
4011 (MacroAssemblerARM):
4012
fpizlo@apple.com327f2372012-07-15 04:02:16 +000040132012-07-14 Filip Pizlo <fpizlo@apple.com>
4014
fpizlo@apple.coma4eaa8a2012-07-15 05:23:58 +00004015 DFG PutByVal opcodes should accept more than 3 operands
4016 https://bugs.webkit.org/show_bug.cgi?id=91332
4017
4018 Reviewed by Oliver Hunt.
4019
4020 Turned PutByVal/PutByValAlias into var-arg nodes, so that we can give them
4021 4 or more operands in the future.
4022
4023 * dfg/DFGAbstractState.cpp:
4024 (JSC::DFG::AbstractState::execute):
4025 * dfg/DFGByteCodeParser.cpp:
4026 (JSC::DFG::ByteCodeParser::parseBlock):
4027 * dfg/DFGCSEPhase.cpp:
4028 (JSC::DFG::CSEPhase::getByValLoadElimination):
4029 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
4030 (JSC::DFG::CSEPhase::performNodeCSE):
4031 * dfg/DFGFixupPhase.cpp:
4032 (JSC::DFG::FixupPhase::fixupNode):
4033 (JSC::DFG::FixupPhase::fixDoubleEdge):
4034 * dfg/DFGGraph.h:
4035 (JSC::DFG::Graph::byValIsPure):
4036 (JSC::DFG::Graph::varArgNumChildren):
4037 (Graph):
4038 (JSC::DFG::Graph::numChildren):
4039 (JSC::DFG::Graph::varArgChild):
4040 (JSC::DFG::Graph::child):
4041 * dfg/DFGNodeType.h:
4042 (DFG):
4043 * dfg/DFGPredictionPropagationPhase.cpp:
4044 (JSC::DFG::PredictionPropagationPhase::propagate):
4045 * dfg/DFGSpeculativeJIT.cpp:
4046 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
4047 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
4048 * dfg/DFGSpeculativeJIT32_64.cpp:
4049 (JSC::DFG::SpeculativeJIT::compile):
4050 * dfg/DFGSpeculativeJIT64.cpp:
4051 (JSC::DFG::SpeculativeJIT::compile):
4052
40532012-07-14 Filip Pizlo <fpizlo@apple.com>
4054
fpizlo@apple.com327f2372012-07-15 04:02:16 +00004055 Rationalize and optimize storage allocation
4056 https://bugs.webkit.org/show_bug.cgi?id=91303
4057
4058 Reviewed by Oliver Hunt.
4059
4060 This implements a backwards bump allocator for copied space storage
4061 allocation, shown in pseudo-code below:
4062
4063 pointer bump(size) {
4064 pointer tmp = allocator->remaining;
4065 tmp -= size;
4066 if (tmp < 0)
4067 fail;
4068 allocator->remaining = tmp;
4069 return allocator->payloadEnd - tmp - size;
4070 }
4071
4072 The advantage of this allocator is that it:
4073
4074 - Only requires one comparison in the common case where size is known to
4075 not be huge, and this comparison can be done by checking the sign bit
4076 of the subtraction.
4077
4078 - Can be implemented even when only one register is available. This
4079 register is reused for both temporary storage during allocation and
4080 for the result.
4081
4082 - Preserves the behavior that memory in a block is filled in from lowest
4083 address to highest address, which allows for a cheap reallocation fast
4084 path.
4085
4086 - Is resilient against the block used for allocation being the last one
4087 in virtual memory, thereby otherwise leading to the risk of overflow
4088 in the bump pointer, despite only doing one branch.
4089
4090 In order to implement this allocator using the smallest possible chunk
4091 of code, I refactored the copied space code so that all of the allocation
4092 logic is in CopiedAllocator, and all of the state is in either
4093 CopiedBlock or CopiedAllocator. This should make changing the allocation
4094 fast path easier in the future.
4095
4096 In order to do this, I needed to add some new assembler support,
4097 particularly for various forms of add(address, register) and negPtr().
4098
4099 This is performance neutral. The purpose of this change is to facilitate
4100 further inlining of storage allocation without having to reserve
4101 additional registers or emit too much code.
4102
4103 * assembler/MacroAssembler.h:
4104 (JSC::MacroAssembler::addPtr):
4105 (MacroAssembler):
4106 (JSC::MacroAssembler::negPtr):
4107 * assembler/MacroAssemblerARMv7.h:
4108 (MacroAssemblerARMv7):
4109 (JSC::MacroAssemblerARMv7::add32):
4110 * assembler/MacroAssemblerX86.h:
4111 (JSC::MacroAssemblerX86::add32):
4112 (MacroAssemblerX86):
4113 * assembler/MacroAssemblerX86_64.h:
4114 (MacroAssemblerX86_64):
4115 (JSC::MacroAssemblerX86_64::addPtr):
4116 (JSC::MacroAssemblerX86_64::negPtr):
4117 * assembler/X86Assembler.h:
4118 (X86Assembler):
4119 (JSC::X86Assembler::addl_mr):
4120 (JSC::X86Assembler::addq_mr):
4121 (JSC::X86Assembler::negq_r):
4122 * heap/CopiedAllocator.h:
4123 (CopiedAllocator):
4124 (JSC::CopiedAllocator::isValid):
4125 (JSC::CopiedAllocator::CopiedAllocator):
4126 (JSC::CopiedAllocator::tryAllocate):
4127 (JSC):
4128 (JSC::CopiedAllocator::tryReallocate):
4129 (JSC::CopiedAllocator::forceAllocate):
4130 (JSC::CopiedAllocator::resetCurrentBlock):
4131 (JSC::CopiedAllocator::setCurrentBlock):
4132 (JSC::CopiedAllocator::currentCapacity):
4133 * heap/CopiedBlock.h:
4134 (CopiedBlock):
4135 (JSC::CopiedBlock::create):
4136 (JSC::CopiedBlock::zeroFillWilderness):
4137 (JSC::CopiedBlock::CopiedBlock):
4138 (JSC::CopiedBlock::payloadEnd):
4139 (JSC):
4140 (JSC::CopiedBlock::payloadCapacity):
4141 (JSC::CopiedBlock::data):
4142 (JSC::CopiedBlock::dataEnd):
4143 (JSC::CopiedBlock::dataSize):
4144 (JSC::CopiedBlock::wilderness):
4145 (JSC::CopiedBlock::wildernessEnd):
4146 (JSC::CopiedBlock::wildernessSize):
4147 (JSC::CopiedBlock::size):
4148 * heap/CopiedSpace.cpp:
4149 (JSC::CopiedSpace::tryAllocateSlowCase):
4150 (JSC::CopiedSpace::tryAllocateOversize):
4151 (JSC::CopiedSpace::tryReallocate):
4152 (JSC::CopiedSpace::doneFillingBlock):
4153 (JSC::CopiedSpace::doneCopying):
4154 * heap/CopiedSpace.h:
4155 (CopiedSpace):
4156 * heap/CopiedSpaceInlineMethods.h:
4157 (JSC::CopiedSpace::startedCopying):
4158 (JSC::CopiedSpace::allocateBlockForCopyingPhase):
4159 (JSC::CopiedSpace::allocateBlock):
4160 (JSC::CopiedSpace::tryAllocate):
4161 (JSC):
4162 * heap/MarkStack.cpp:
4163 (JSC::SlotVisitor::startCopying):
4164 (JSC::SlotVisitor::allocateNewSpace):
4165 (JSC::SlotVisitor::doneCopying):
4166 * heap/SlotVisitor.h:
4167 (JSC::SlotVisitor::SlotVisitor):
4168 * jit/JIT.h:
4169 * jit/JITInlineMethods.h:
4170 (JSC::JIT::emitAllocateBasicStorage):
4171 (JSC::JIT::emitAllocateJSArray):
4172
commit-queue@webkit.org782c20b2012-07-14 00:44:47 +000041732012-07-13 Mark Lam <mark.lam@apple.com>
4174
4175 OfflineASM Pretty printing and commenting enhancements.
4176 https://bugs.webkit.org/show_bug.cgi?id=91281
4177
4178 Reviewed by Filip Pizlo.
4179
4180 Added some minor pretty printing in the OfflineASM.
4181 Also added infrastruture for adding multiple types of comments and
4182 annotations with the ability to enable/disable them in the generated
4183 output as desired.
4184
4185 * GNUmakefile.list.am: add new file config.rb.
4186 * llint/LLIntOfflineAsmConfig.h:
4187 Added OFFLINE_ASM_BEGIN, OFFLINE_ASM_END, and OFFLINE_ASM_LOCAL_LABEL macros.
4188 This will allow us to redefine these for other backends later.
4189 * llint/LowLevelInterpreter32_64.asm:
4190 Add a small example of instruction annotations for now.
4191 * llint/LowLevelInterpreter64.asm:
4192 Add a small example of instruction annotations for now.
4193 * offlineasm/armv7.rb: Added handling of annotations.
4194 * offlineasm/asm.rb:
4195 Added machinery to dump the new comments and annotations.
4196 Also added some indentations to make the output a little prettier.
4197 * offlineasm/ast.rb: Added annotation field in class Instruction.
4198 * offlineasm/backends.rb:
4199 * offlineasm/config.rb: Added.
4200 Currently only contains commenting options. This file is meant to be
4201 a centralized place for build config values much like config.h for
4202 JavaScriptCore.
4203 * offlineasm/generate_offset_extractor.rb:
4204 * offlineasm/instructions.rb:
4205 * offlineasm/offsets.rb:
4206 * offlineasm/opt.rb:
4207 * offlineasm/parser.rb: Parse and record annotations.
4208 * offlineasm/registers.rb:
4209 * offlineasm/self_hash.rb:
4210 * offlineasm/settings.rb:
4211 * offlineasm/transform.rb:
4212 * offlineasm/x86.rb: Added handling of annotations.
4213
fpizlo@apple.com8ff7c5e72012-07-13 23:55:18 +000042142012-07-13 Filip Pizlo <fpizlo@apple.com>
4215
4216 ASSERTION FAILED: use.useKind() != DoubleUse
4217 https://bugs.webkit.org/show_bug.cgi?id=91082
4218
4219 Reviewed by Geoffrey Garen.
4220
4221 The implementation of Branch() was unwisely relying on register allocation state
4222 to decide what speculations to perform. That's never correct.
4223
4224 * dfg/DFGSpeculativeJIT32_64.cpp:
4225 (JSC::DFG::SpeculativeJIT::compile):
4226 * dfg/DFGSpeculativeJIT64.cpp:
4227 (JSC::DFG::SpeculativeJIT::compile):
4228
commit-queue@webkit.org2e002d12012-07-13 23:36:34 +000042292012-07-13 Sheriff Bot <webkit.review.bot@gmail.com>
4230
4231 Unreviewed, rolling out r122640.
4232 http://trac.webkit.org/changeset/122640
4233 https://bugs.webkit.org/show_bug.cgi?id=91298
4234
4235 LLInt apparently does not expect to mark these (Requested by
4236 olliej on #webkit).
4237
4238 * bytecode/CodeBlock.cpp:
4239 (JSC::CodeBlock::visitStructures):
4240 (JSC::CodeBlock::stronglyVisitStrongReferences):
4241
oliver@apple.comca095d52012-07-13 23:12:14 +000042422012-07-13 Oliver Hunt <oliver@apple.com>
4243
4244 LLInt fails to mark structures stored in the bytecode
4245 https://bugs.webkit.org/show_bug.cgi?id=91296
4246
4247 Reviewed by Geoffrey Garen.
4248
4249 LLInt stores structures in the bytecode, so we need to visit the appropriate
4250 instructions as we would if we were running in the classic interpreter.
4251 This requires adding additional checks for the LLInt specific opcodes, and
4252 the lint specific variants of operand ordering.
4253
4254 * bytecode/CodeBlock.cpp:
4255 (JSC::CodeBlock::visitStructures):
4256 (JSC::CodeBlock::stronglyVisitStrongReferences):
4257
commit-queue@webkit.orgf9b0ef22012-07-13 20:12:36 +000042582012-07-13 Yong Li <yoli@rim.com>
4259
4260 [BlackBerry] Implement GCActivityCallback with platform timer
4261 https://bugs.webkit.org/show_bug.cgi?id=90175
4262
4263 Reviewed by Rob Buis.
4264
4265 Implement GCActivityCallback and HeapTimer for BlackBerry port.
4266
4267 * heap/HeapTimer.cpp:
4268 (JSC):
4269 (JSC::HeapTimer::HeapTimer):
4270 (JSC::HeapTimer::~HeapTimer):
4271 (JSC::HeapTimer::timerDidFire):
4272 (JSC::HeapTimer::synchronize):
4273 (JSC::HeapTimer::invalidate):
4274 (JSC::HeapTimer::didStartVMShutdown):
4275 * heap/HeapTimer.h:
4276 (HeapTimer):
4277 * runtime/GCActivityCallbackBlackBerry.cpp:
4278 (JSC):
4279 (JSC::DefaultGCActivityCallback::doWork):
4280 (JSC::DefaultGCActivityCallback::didAllocate):
4281 (JSC::DefaultGCActivityCallback::willCollect):
4282 (JSC::DefaultGCActivityCallback::cancel):
4283
paroga@webkit.orgcc7dc5b2012-07-13 16:35:46 +000042842012-07-13 Patrick Gansterer <paroga@webkit.org>
4285
paroga@webkit.org4a3ecbd2012-07-13 16:53:20 +00004286 [WIN] Fix compilation of DFGRepatch.cpp
4287 https://bugs.webkit.org/show_bug.cgi?id=91241
4288
4289 Reviewed by Geoffrey Garen.
4290
4291 Use intptr_t instead of uintptr_t when calling CodeLocationCommon::dataLabelPtrAtOffset(int)
4292 to fix MSVC "unary minus operator applied to unsigned type, result still unsigned" warning.
4293
4294 * dfg/DFGRepatch.cpp:
4295 (JSC::DFG::dfgResetGetByID):
4296 (JSC::DFG::dfgResetPutByID):
4297
42982012-07-13 Patrick Gansterer <paroga@webkit.org>
4299
paroga@webkit.orgcc7dc5b2012-07-13 16:35:46 +00004300 Fix ARM_TRADITIONAL JIT for COMPILER(MSVC) and COMPILER(RVCT) after r121885
4301 https://bugs.webkit.org/show_bug.cgi?id=91238
4302
4303 Reviewed by Zoltan Herczeg.
4304
4305 r121885 changed the assembler instruction only for COMPILER(GCC).
4306 Use the same instructions for the other compilers too.
4307
4308 * jit/JITStubs.cpp:
4309 (JSC::ctiTrampoline):
4310 (JSC::ctiTrampolineEnd):
4311 (JSC::ctiVMThrowTrampoline):
4312
fpizlo@apple.comedcb7a92012-07-13 05:31:05 +000043132012-07-12 Filip Pizlo <fpizlo@apple.com>
4314
fpizlo@apple.comcf716122012-07-13 06:41:18 +00004315 DFG property access stubs should use structure transition watchpoints
4316 https://bugs.webkit.org/show_bug.cgi?id=91135
4317
4318 Reviewed by Geoffrey Garen.
4319
4320 This adds a Watchpoint subclass that will clear a structure stub (i.e.
4321 a property access stub) when fired. The DFG stub generation code now
4322 uses this optimization.
4323
4324 * CMakeLists.txt:
4325 * GNUmakefile.list.am:
4326 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4327 * JavaScriptCore.xcodeproj/project.pbxproj:
4328 * Target.pri:
4329 * bytecode/CodeBlock.cpp:
4330 (JSC):
4331 (JSC::CodeBlock::finalizeUnconditionally):
4332 (JSC::CodeBlock::resetStub):
4333 (JSC::CodeBlock::resetStubInternal):
4334 * bytecode/CodeBlock.h:
4335 (JSC):
4336 (CodeBlock):
4337 * bytecode/StructureStubClearingWatchpoint.cpp: Added.
4338 (JSC):
4339 (JSC::StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint):
4340 (JSC::StructureStubClearingWatchpoint::push):
4341 (JSC::StructureStubClearingWatchpoint::fireInternal):
4342 (JSC::WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo):
4343 (JSC::WatchpointsOnStructureStubInfo::addWatchpoint):
4344 (JSC::WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint):
4345 * bytecode/StructureStubClearingWatchpoint.h: Added.
4346 (JSC):
4347 (StructureStubClearingWatchpoint):
4348 (JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint):
4349 (WatchpointsOnStructureStubInfo):
4350 (JSC::WatchpointsOnStructureStubInfo::WatchpointsOnStructureStubInfo):
4351 (JSC::WatchpointsOnStructureStubInfo::codeBlock):
4352 (JSC::WatchpointsOnStructureStubInfo::stubInfo):
4353 * bytecode/StructureStubInfo.h:
4354 (JSC::StructureStubInfo::reset):
4355 (JSC::StructureStubInfo::addWatchpoint):
4356 (StructureStubInfo):
4357 * dfg/DFGRepatch.cpp:
4358 (JSC::DFG::addStructureTransitionCheck):
4359 (DFG):
4360 (JSC::DFG::generateProtoChainAccessStub):
4361 (JSC::DFG::emitPutTransitionStub):
4362 * jit/JumpReplacementWatchpoint.h:
4363
43642012-07-12 Filip Pizlo <fpizlo@apple.com>
4365
fpizlo@apple.comedcb7a92012-07-13 05:31:05 +00004366 DFG CFA may get overzealous in loops that have code that must exit
4367 https://bugs.webkit.org/show_bug.cgi?id=91188
4368
4369 Reviewed by Gavin Barraclough.
4370
4371 Ensure that if the CFA assumes that an operation must exit, then it will always exit
4372 no matter what happens after. That's necessary to preserve soundness.
4373
4374 Remove a broken fixup done by the DFG simplifier, where it was trying to say that the
4375 variable-at-head was the first access in the second block in the merge, if the first
4376 block did not read the variable. That's totally wrong, if the first block was in fact
4377 doing a phantom read. I removed that fixup and instead hardened the rest of the
4378 compiler.
4379
4380 * dfg/DFGAbstractState.cpp:
4381 (JSC::DFG::AbstractState::endBasicBlock):
4382 * dfg/DFGBasicBlock.h:
4383 (JSC::DFG::BasicBlock::BasicBlock):
4384 (BasicBlock):
4385 * dfg/DFGCFAPhase.cpp:
4386 (JSC::DFG::CFAPhase::performBlockCFA):
4387 * dfg/DFGCFGSimplificationPhase.cpp:
4388 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
4389 * dfg/DFGConstantFoldingPhase.cpp:
4390 (JSC::DFG::ConstantFoldingPhase::ConstantFoldingPhase):
4391 (JSC::DFG::ConstantFoldingPhase::run):
4392 (ConstantFoldingPhase):
4393 (JSC::DFG::ConstantFoldingPhase::foldConstants):
4394 (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode):
4395 * dfg/DFGVariableEventStream.cpp:
4396 (JSC::DFG::VariableEventStream::reconstruct):
4397
allan.jensen@nokia.comb619bbf22012-07-12 15:34:35 +000043982012-07-12 Allan Sandfeld Jensen <allan.jensen@nokia.com>
4399
4400 [Qt] Implement MemoryUsageSupport
4401 https://bugs.webkit.org/show_bug.cgi?id=91094
4402
4403 Reviewed by Adam Barth.
4404
4405 Compile in MemoryStatistics so we can make use of the interface.
4406
4407 * Target.pri:
4408
ossy@webkit.org8db5d862012-07-12 07:53:08 +000044092012-07-12 Csaba Osztrogonác <ossy@webkit.org>
4410
4411 Remove dead code after r122392.
4412 https://bugs.webkit.org/show_bug.cgi?id=91049
4413
4414 Reviewed by Filip Pizlo.
4415
4416 * dfg/DFGSpeculativeJIT64.cpp:
4417 (JSC::DFG::SpeculativeJIT::emitCall):
4418
commit-queue@webkit.org55a950b2012-07-12 02:49:24 +000044192012-07-11 Adenilson Cavalcanti <cavalcantii@gmail.com>
4420
4421 Build fix + remove dead code
4422 https://bugs.webkit.org/show_bug.cgi?id=91039
4423
4424 Reviewed by Filip Pizlo.
4425
4426 An unused variable was breaking compilation (thanks to warnings being treated as errors).
4427
4428 * dfg/DFGSpeculativeJIT32_64.cpp:
4429 (JSC::DFG::SpeculativeJIT::emitCall):
4430
mrowe@apple.comc8887bf2012-07-12 02:01:25 +000044312012-07-11 Mark Rowe <mrowe@apple.com>
4432
4433 <http://webkit.org/b/91024> Build against the latest SDK when targeting older OS X versions.
4434
4435 Reviewed by Dan Bernstein.
4436
4437 The deployment target is already set to the version that we're targeting, and it's that setting
4438 which determines which functionality from the SDK is available to us.
4439
4440 * Configurations/Base.xcconfig:
4441
fpizlo@apple.com3d949152012-07-11 23:12:35 +000044422012-07-11 Filip Pizlo <fpizlo@apple.com>
4443
fpizlo@apple.com5e135772012-07-12 00:12:03 +00004444 DFG should have fast virtual calls
4445 https://bugs.webkit.org/show_bug.cgi?id=90924
4446
4447 Reviewed by Gavin Barraclough.
4448
4449 Implements virtual call support in the style of the old JIT, with the
4450 caveat that we still use the same slow path for both InternalFunction
4451 calls and JSFunction calls. Also rationalized the way that our
4452 CodeOrigin indices tie into exception checks (previously it was a
4453 strange one-to-one mapping with fairly limited assertions; now it's a
4454 one-to-many mapping for CodeOrigins to exception checks, respectively).
4455 I also took the opportunity to clean up
4456 CallLinkInfo::callReturnLocation, which previously was either a Call or
4457 a NearCall. Now it's just a NearCall. As well, exceptions during slow
4458 path call resolution are now handled by returning an exception throwing
4459 thunk rather than returning null. And finally, I made a few things
4460 public that were previously private-with-lots-of-friends, because I
4461 truly despise the thought of listing each thunk generating function as
4462 a friend of JSValue and friends.
4463
4464 * bytecode/CallLinkInfo.cpp:
4465 (JSC::CallLinkInfo::unlink):
4466 * bytecode/CallLinkInfo.h:
4467 (CallLinkInfo):
4468 * bytecode/CodeOrigin.h:
4469 (JSC::CodeOrigin::CodeOrigin):
4470 (JSC::CodeOrigin::isSet):
4471 * dfg/DFGAssemblyHelpers.h:
4472 (JSC::DFG::AssemblyHelpers::AssemblyHelpers):
4473 * dfg/DFGCCallHelpers.h:
4474 (JSC::DFG::CCallHelpers::CCallHelpers):
4475 * dfg/DFGGPRInfo.h:
4476 (GPRInfo):
4477 * dfg/DFGJITCompiler.cpp:
4478 (JSC::DFG::JITCompiler::link):
4479 (JSC::DFG::JITCompiler::compileFunction):
4480 * dfg/DFGJITCompiler.h:
4481 (JSC::DFG::CallBeginToken::CallBeginToken):
4482 (JSC::DFG::CallBeginToken::~CallBeginToken):
4483 (CallBeginToken):
4484 (JSC::DFG::CallBeginToken::set):
4485 (JSC::DFG::CallBeginToken::registerWithExceptionCheck):
4486 (JSC::DFG::CallBeginToken::codeOrigin):
4487 (JSC::DFG::CallExceptionRecord::CallExceptionRecord):
4488 (CallExceptionRecord):
4489 (JSC::DFG::JITCompiler::currentCodeOriginIndex):
4490 (JITCompiler):
4491 (JSC::DFG::JITCompiler::beginCall):
4492 (JSC::DFG::JITCompiler::notifyCall):
4493 (JSC::DFG::JITCompiler::prepareForExceptionCheck):
4494 (JSC::DFG::JITCompiler::addExceptionCheck):
4495 (JSC::DFG::JITCompiler::addFastExceptionCheck):
4496 * dfg/DFGOperations.cpp:
4497 * dfg/DFGRepatch.cpp:
4498 (JSC::DFG::dfgLinkFor):
4499 * dfg/DFGSpeculativeJIT.h:
4500 (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck):
4501 * dfg/DFGSpeculativeJIT32_64.cpp:
4502 (JSC::DFG::SpeculativeJIT::emitCall):
4503 * dfg/DFGSpeculativeJIT64.cpp:
4504 (JSC::DFG::SpeculativeJIT::emitCall):
4505 * dfg/DFGThunks.cpp:
4506 (JSC::DFG::emitPointerValidation):
4507 (DFG):
4508 (JSC::DFG::throwExceptionFromCallSlowPathGenerator):
4509 (JSC::DFG::slowPathFor):
4510 (JSC::DFG::linkForThunkGenerator):
4511 (JSC::DFG::linkCallThunkGenerator):
4512 (JSC::DFG::linkConstructThunkGenerator):
4513 (JSC::DFG::virtualForThunkGenerator):
4514 (JSC::DFG::virtualCallThunkGenerator):
4515 (JSC::DFG::virtualConstructThunkGenerator):
4516 * dfg/DFGThunks.h:
4517 (DFG):
4518 * jit/JIT.cpp:
4519 (JSC::JIT::privateCompile):
4520 (JSC::JIT::linkFor):
4521 * runtime/Executable.h:
4522 (ExecutableBase):
4523 (JSC::ExecutableBase::offsetOfJITCodeFor):
4524 (JSC::ExecutableBase::offsetOfNumParametersFor):
4525 * runtime/JSValue.h:
4526 (JSValue):
4527
45282012-07-11 Filip Pizlo <fpizlo@apple.com>
4529
fpizlo@apple.com3a264a12012-07-11 23:33:20 +00004530 Accidentally used the wrong license (3-clause instead of 2-clause) in some
4531 files I just committed.
4532
4533 Rubber stamped by Oliver Hunt.
4534
4535 * bytecode/Watchpoint.cpp:
4536 * bytecode/Watchpoint.h:
4537 * jit/JumpReplacementWatchpoint.cpp:
4538 * jit/JumpReplacementWatchpoint.h:
4539
45402012-07-11 Filip Pizlo <fpizlo@apple.com>
4541
fpizlo@apple.com3d949152012-07-11 23:12:35 +00004542 Watchpoints and jump replacement should be decoupled
4543 https://bugs.webkit.org/show_bug.cgi?id=91016
4544
4545 Reviewed by Oliver Hunt.
4546
4547 * CMakeLists.txt:
4548 * GNUmakefile.list.am:
4549 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4550 * JavaScriptCore.xcodeproj/project.pbxproj:
4551 * Target.pri:
4552 * assembler/AbstractMacroAssembler.h:
4553 (JSC):
4554 (Label):
4555 * bytecode/CodeBlock.h:
4556 (JSC::CodeBlock::appendWatchpoint):
4557 (JSC::CodeBlock::watchpoint):
4558 (DFGData):
4559 * bytecode/Watchpoint.cpp:
4560 (JSC):
4561 * bytecode/Watchpoint.h:
4562 (JSC::Watchpoint::Watchpoint):
4563 (Watchpoint):
4564 (JSC::Watchpoint::fire):
4565 * dfg/DFGSpeculativeJIT.h:
4566 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
4567 * jit/JumpReplacementWatchpoint.cpp: Added.
4568 (JSC):
4569 (JSC::JumpReplacementWatchpoint::correctLabels):
4570 (JSC::JumpReplacementWatchpoint::fireInternal):
4571 * jit/JumpReplacementWatchpoint.h: Added.
4572 (JSC):
4573 (JumpReplacementWatchpoint):
4574 (JSC::JumpReplacementWatchpoint::JumpReplacementWatchpoint):
4575 (JSC::JumpReplacementWatchpoint::setDestination):
4576
kevino@webkit.org2b81ef22012-07-11 20:23:39 +000045772012-07-11 Kevin Ollivier <kevino@theolliviers.com>
4578
4579 [wx] Unreviewed build fix. Don't try to build udis86_itab.c since it's included by
4580 another file.
4581
4582 * wscript:
4583
commit-queue@webkit.orgd847b5c2012-07-11 19:48:29 +000045842012-07-11 Chao-ying Fu <fu@mips.com>
4585
4586 Add MIPS convertibleLoadPtr and other functions
4587 https://bugs.webkit.org/show_bug.cgi?id=90714
4588
4589 Reviewed by Oliver Hunt.
4590
4591 * assembler/MIPSAssembler.h:
4592 (JSC::MIPSAssembler::labelIgnoringWatchpoints):
4593 (MIPSAssembler):
4594 (JSC::MIPSAssembler::replaceWithLoad):
4595 (JSC::MIPSAssembler::replaceWithAddressComputation):
4596 * assembler/MacroAssemblerMIPS.h:
4597 (JSC::MacroAssemblerMIPS::convertibleLoadPtr):
4598 (MacroAssemblerMIPS):
4599
andersca@apple.come73df4c2012-07-11 19:41:03 +000046002012-07-11 Anders Carlsson <andersca@apple.com>
4601
4602 Add -Wtautological-compare and -Wsign-compare warning flags
4603 https://bugs.webkit.org/show_bug.cgi?id=90994
4604
4605 Reviewed by Mark Rowe.
4606
4607 * Configurations/Base.xcconfig:
4608
benjamin@webkit.orgea8276a2012-07-11 18:15:17 +000046092012-07-11 Benjamin Poulain <bpoulain@apple.com>
4610
4611 Simplify the copying of JSC ARMv7's LinkRecord
4612 https://bugs.webkit.org/show_bug.cgi?id=90930
4613
4614 Reviewed by Filip Pizlo.
4615
4616 The class LinkRecord is used by value everywhere in ARMv7Assembler. The compiler uses
4617 memmove() to move the objects.
4618
4619 The problem is memmove() is overkill for this object, moving the value can be done with
4620 3 load-store. This patch adds an operator= to the class doing more efficient copying.
4621 This reduces the link time by 19%.
4622
4623 * assembler/ARMv7Assembler.h:
4624 (JSC::ARMv7Assembler::LinkRecord::LinkRecord):
4625 (JSC::ARMv7Assembler::LinkRecord::operator=):
4626 (JSC::ARMv7Assembler::LinkRecord::from):
4627 (JSC::ARMv7Assembler::LinkRecord::setFrom):
4628 (JSC::ARMv7Assembler::LinkRecord::to):
4629 (JSC::ARMv7Assembler::LinkRecord::type):
4630 (JSC::ARMv7Assembler::LinkRecord::linkType):
4631 (JSC::ARMv7Assembler::LinkRecord::setLinkType):
4632 (JSC::ARMv7Assembler::LinkRecord::condition):
4633
wingo@igalia.com8d1d0d42012-07-11 17:50:15 +000046342012-07-11 Andy Wingo <wingo@igalia.com>
4635
4636 jsc: Parse options before creating global data
4637 https://bugs.webkit.org/show_bug.cgi?id=90975
4638
4639 Reviewed by Filip Pizlo.
4640
4641 This patch moves the options parsing in "jsc" before the creation
4642 of the JSGlobalData, so that --useJIT=no has a chance to take
4643 effect.
4644
4645 * jsc.cpp:
4646 (CommandLine::parseArguments): Refactor to be a class, and take
4647 argc and argv as constructor arguments.
4648 (jscmain): Move arg parsing before JSGlobalData creation.
4649
fpizlo@apple.com39c94a42012-07-10 09:18:47 +000046502012-07-10 Filip Pizlo <fpizlo@apple.com>
4651
ossy@webkit.orgb626a9e2012-07-10 09:36:13 +00004652 REGRESSION(r122166): It made 170 tests crash on 32 bit platforms
4653 https://bugs.webkit.org/show_bug.cgi?id=90852
4654
4655 Reviewed by Zoltan Herczeg.
4656
4657 If we can't use the range filter, we should still make sure that the
4658 address is remotely sane, otherwise the hashtables will assert.
4659
4660 * jit/JITStubRoutine.h:
4661 (JSC::JITStubRoutine::passesFilter):
4662
46632012-07-10 Filip Pizlo <fpizlo@apple.com>
4664
fpizlo@apple.com39c94a42012-07-10 09:18:47 +00004665 DFG recompilation heuristics should be based on count, not rate
4666 https://bugs.webkit.org/show_bug.cgi?id=90146
4667
4668 Reviewed by Oliver Hunt.
4669
4670 Rolling r121511 back in after fixing the DFG's interpretation of op_div
4671 profiling, with Gavin's rubber stamp.
4672
4673 This removes a bunch of code that was previously trying to prevent spurious
4674 reoptimizations if a large enough majority of executions of a code block did
4675 not result in OSR exit. It turns out that this code was purely harmful. This
4676 patch removes all of that logic and replaces it with a dead-simple
4677 heuristic: if you exit more than N times (where N is an exponential function
4678 of the number of times the code block has already been recompiled) then we
4679 will recompile.
4680
4681 This appears to be a broad ~1% win on many benchmarks large and small.
4682
4683 * bytecode/CodeBlock.cpp:
4684 (JSC::CodeBlock::CodeBlock):
4685 * bytecode/CodeBlock.h:
4686 (JSC::CodeBlock::couldTakeSpecialFastCase):
4687 (CodeBlock):
4688 (JSC::CodeBlock::osrExitCounter):
4689 (JSC::CodeBlock::countOSRExit):
4690 (JSC::CodeBlock::addressOfOSRExitCounter):
4691 (JSC::CodeBlock::offsetOfOSRExitCounter):
4692 (JSC::CodeBlock::adjustedExitCountThreshold):
4693 (JSC::CodeBlock::exitCountThresholdForReoptimization):
4694 (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
4695 (JSC::CodeBlock::shouldReoptimizeNow):
4696 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
4697 * bytecode/ExecutionCounter.cpp:
4698 (JSC::ExecutionCounter::setThreshold):
4699 * bytecode/ExecutionCounter.h:
4700 (ExecutionCounter):
4701 (JSC::ExecutionCounter::clippedThreshold):
4702 * dfg/DFGByteCodeParser.cpp:
4703 (JSC::DFG::ByteCodeParser::makeDivSafe):
4704 * dfg/DFGJITCompiler.cpp:
4705 (JSC::DFG::JITCompiler::compileBody):
4706 * dfg/DFGOSRExit.cpp:
4707 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
4708 * dfg/DFGOSRExitCompiler.cpp:
4709 (JSC::DFG::OSRExitCompiler::handleExitCounts):
4710 * dfg/DFGOperations.cpp:
4711 * jit/JITStubs.cpp:
4712 (JSC::DEFINE_STUB_FUNCTION):
4713 * runtime/Options.h:
4714 (JSC):
4715
commit-queue@webkit.orge1bba8e2012-07-10 05:45:21 +000047162012-07-09 Matt Falkenhagen <falken@chromium.org>
4717
4718 Add ENABLE_DIALOG_ELEMENT and skeleton files
4719 https://bugs.webkit.org/show_bug.cgi?id=90521
4720
4721 Reviewed by Kent Tamura.
4722
4723 * Configurations/FeatureDefines.xcconfig:
4724
fpizlo@apple.com746b8c52012-07-09 23:26:54 +000047252012-07-09 Filip Pizlo <fpizlo@apple.com>
4726
fpizlo@apple.com629c1cd2012-07-10 01:50:44 +00004727 Unreviewed, roll out http://trac.webkit.org/changeset/121511
4728 It made in-browser V8v7 10% slower.
4729
4730 * bytecode/CodeBlock.cpp:
4731 (JSC::CodeBlock::CodeBlock):
4732 * bytecode/CodeBlock.h:
4733 (CodeBlock):
4734 (JSC::CodeBlock::countSpeculationSuccess):
4735 (JSC::CodeBlock::countSpeculationFailure):
4736 (JSC::CodeBlock::speculativeSuccessCounter):
4737 (JSC::CodeBlock::speculativeFailCounter):
4738 (JSC::CodeBlock::forcedOSRExitCounter):
4739 (JSC::CodeBlock::addressOfSpeculativeSuccessCounter):
4740 (JSC::CodeBlock::addressOfSpeculativeFailCounter):
4741 (JSC::CodeBlock::addressOfForcedOSRExitCounter):
4742 (JSC::CodeBlock::offsetOfSpeculativeSuccessCounter):
4743 (JSC::CodeBlock::offsetOfSpeculativeFailCounter):
4744 (JSC::CodeBlock::offsetOfForcedOSRExitCounter):
4745 (JSC::CodeBlock::largeFailCountThreshold):
4746 (JSC::CodeBlock::largeFailCountThresholdForLoop):
4747 (JSC::CodeBlock::shouldReoptimizeNow):
4748 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
4749 * bytecode/ExecutionCounter.cpp:
4750 (JSC::ExecutionCounter::setThreshold):
4751 * bytecode/ExecutionCounter.h:
4752 (ExecutionCounter):
4753 * dfg/DFGJITCompiler.cpp:
4754 (JSC::DFG::JITCompiler::compileBody):
4755 * dfg/DFGOSRExit.cpp:
4756 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
4757 * dfg/DFGOSRExitCompiler.cpp:
4758 (JSC::DFG::OSRExitCompiler::handleExitCounts):
4759 * dfg/DFGOperations.cpp:
4760 * jit/JITStubs.cpp:
4761 (JSC::DEFINE_STUB_FUNCTION):
4762 * runtime/Options.h:
4763 (JSC):
4764
47652012-07-09 Filip Pizlo <fpizlo@apple.com>
4766
fpizlo@apple.comcacd7dc2012-07-09 23:28:53 +00004767 DFG may get stuck in an infinite fix point if it constant folds a mispredicted node
4768 https://bugs.webkit.org/show_bug.cgi?id=90829
4769 <rdar://problem/11823843>
4770
4771 Reviewed by Oliver Hunt.
4772
4773 If a node is shown to have been mispredicted during CFA, then don't allow constant
4774 folding to make the graph even more degenerate. Instead, pull back on constant folding
4775 and allow the normal OSR machinery to fix our profiling so that a future recompilation
4776 doesn't see the same mistake.
4777
4778 * dfg/DFGAbstractState.cpp:
4779 (JSC::DFG::AbstractState::execute):
4780 * dfg/DFGAbstractState.h:
4781 (JSC::DFG::AbstractState::trySetConstant):
4782 (AbstractState):
4783 * dfg/DFGPhase.h:
4784 (JSC::DFG::Phase::name):
4785 (Phase):
4786 (JSC::DFG::runAndLog):
4787 (DFG):
4788 (JSC::DFG::runPhase):
4789
47902012-07-09 Filip Pizlo <fpizlo@apple.com>
4791
fpizlo@apple.com746b8c52012-07-09 23:26:54 +00004792 It should be possible to jettison JIT stub routines even if they are currently running
4793 https://bugs.webkit.org/show_bug.cgi?id=90731
4794
4795 Reviewed by Gavin Barraclough.
4796
4797 This gives the GC awareness of all JIT-generated stubs for inline caches. That
4798 means that if you want to delete a JIT-generated stub, you don't have to worry
4799 about whether or not it is currently running: if there is a chance that it might
4800 be, the GC will kindly defer deletion until non-running-ness is proved.
4801
4802 * CMakeLists.txt:
4803 * GNUmakefile.list.am:
4804 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
4805 * JavaScriptCore.xcodeproj/project.pbxproj:
4806 * Target.pri:
4807 * bytecode/Instruction.h:
4808 (JSC):
4809 (PolymorphicStubInfo):
4810 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
4811 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
4812 * bytecode/PolymorphicPutByIdList.cpp:
4813 (JSC::PutByIdAccess::fromStructureStubInfo):
4814 * bytecode/PolymorphicPutByIdList.h:
4815 (JSC::PutByIdAccess::transition):
4816 (JSC::PutByIdAccess::replace):
4817 (JSC::PutByIdAccess::stubRoutine):
4818 (PutByIdAccess):
4819 (JSC::PolymorphicPutByIdList::currentSlowPathTarget):
4820 * bytecode/StructureStubInfo.h:
4821 (JSC::StructureStubInfo::reset):
4822 * dfg/DFGRepatch.cpp:
4823 (JSC::DFG::generateProtoChainAccessStub):
4824 (JSC::DFG::tryCacheGetByID):
4825 (JSC::DFG::tryBuildGetByIDList):
4826 (JSC::DFG::tryBuildGetByIDProtoList):
4827 (JSC::DFG::emitPutReplaceStub):
4828 (JSC::DFG::emitPutTransitionStub):
4829 (JSC::DFG::tryCachePutByID):
4830 (JSC::DFG::tryBuildPutByIdList):
4831 * heap/ConservativeRoots.cpp:
4832 (JSC):
4833 (DummyMarkHook):
4834 (JSC::DummyMarkHook::mark):
4835 (JSC::ConservativeRoots::add):
4836 (CompositeMarkHook):
4837 (JSC::CompositeMarkHook::CompositeMarkHook):
4838 (JSC::CompositeMarkHook::mark):
4839 * heap/ConservativeRoots.h:
4840 (JSC):
4841 (ConservativeRoots):
4842 * heap/Heap.cpp:
4843 (JSC::Heap::markRoots):
4844 (JSC::Heap::deleteUnmarkedCompiledCode):
4845 * heap/Heap.h:
4846 (JSC):
4847 (Heap):
4848 * heap/JITStubRoutineSet.cpp: Added.
4849 (JSC):
4850 (JSC::JITStubRoutineSet::JITStubRoutineSet):
4851 (JSC::JITStubRoutineSet::~JITStubRoutineSet):
4852 (JSC::JITStubRoutineSet::add):
4853 (JSC::JITStubRoutineSet::clearMarks):
4854 (JSC::JITStubRoutineSet::markSlow):
4855 (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
4856 (JSC::JITStubRoutineSet::traceMarkedStubRoutines):
4857 * heap/JITStubRoutineSet.h: Added.
4858 (JSC):
4859 (JITStubRoutineSet):
4860 (JSC::JITStubRoutineSet::mark):
4861 * heap/MachineStackMarker.h:
4862 (JSC):
4863 * interpreter/RegisterFile.cpp:
4864 (JSC::RegisterFile::gatherConservativeRoots):
4865 * interpreter/RegisterFile.h:
4866 (JSC):
4867 * jit/ExecutableAllocator.cpp:
4868 (JSC::DemandExecutableAllocator::DemandExecutableAllocator):
4869 * jit/ExecutableAllocator.h:
4870 (JSC):
4871 * jit/ExecutableAllocatorFixedVMPool.cpp:
4872 (JSC):
4873 (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
4874 * jit/GCAwareJITStubRoutine.cpp: Added.
4875 (JSC):
4876 (JSC::GCAwareJITStubRoutine::GCAwareJITStubRoutine):
4877 (JSC::GCAwareJITStubRoutine::~GCAwareJITStubRoutine):
4878 (JSC::GCAwareJITStubRoutine::observeZeroRefCount):
4879 (JSC::GCAwareJITStubRoutine::deleteFromGC):
4880 (JSC::GCAwareJITStubRoutine::markRequiredObjectsInternal):
4881 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::MarkingGCAwareJITStubRoutineWithOneObject):
4882 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::~MarkingGCAwareJITStubRoutineWithOneObject):
4883 (JSC::MarkingGCAwareJITStubRoutineWithOneObject::markRequiredObjectsInternal):
4884 (JSC::createJITStubRoutine):
4885 * jit/GCAwareJITStubRoutine.h: Added.
4886 (JSC):
4887 (GCAwareJITStubRoutine):
4888 (JSC::GCAwareJITStubRoutine::markRequiredObjects):
4889 (MarkingGCAwareJITStubRoutineWithOneObject):
4890 * jit/JITPropertyAccess.cpp:
4891 (JSC::JIT::privateCompilePutByIdTransition):
4892 (JSC::JIT::privateCompilePatchGetArrayLength):
4893 (JSC::JIT::privateCompileGetByIdProto):
4894 (JSC::JIT::privateCompileGetByIdSelfList):
4895 (JSC::JIT::privateCompileGetByIdProtoList):
4896 (JSC::JIT::privateCompileGetByIdChainList):
4897 (JSC::JIT::privateCompileGetByIdChain):
4898 * jit/JITPropertyAccess32_64.cpp:
4899 (JSC::JIT::privateCompilePutByIdTransition):
4900 (JSC::JIT::privateCompilePatchGetArrayLength):
4901 (JSC::JIT::privateCompileGetByIdProto):
4902 (JSC::JIT::privateCompileGetByIdSelfList):
4903 (JSC::JIT::privateCompileGetByIdProtoList):
4904 (JSC::JIT::privateCompileGetByIdChainList):
4905 (JSC::JIT::privateCompileGetByIdChain):
4906 * jit/JITStubRoutine.cpp: Added.
4907 (JSC):
4908 (JSC::JITStubRoutine::~JITStubRoutine):
4909 (JSC::JITStubRoutine::observeZeroRefCount):
4910 * jit/JITStubRoutine.h: Added.
4911 (JSC):
4912 (JITStubRoutine):
4913 (JSC::JITStubRoutine::JITStubRoutine):
4914 (JSC::JITStubRoutine::createSelfManagedRoutine):
4915 (JSC::JITStubRoutine::code):
4916 (JSC::JITStubRoutine::asCodePtr):
4917 (JSC::JITStubRoutine::ref):
4918 (JSC::JITStubRoutine::deref):
4919 (JSC::JITStubRoutine::startAddress):
4920 (JSC::JITStubRoutine::endAddress):
4921 (JSC::JITStubRoutine::addressStep):
4922 (JSC::JITStubRoutine::canPerformRangeFilter):
4923 (JSC::JITStubRoutine::filteringStartAddress):
4924 (JSC::JITStubRoutine::filteringExtentSize):
4925 (JSC::JITStubRoutine::passesFilter):
4926 * jit/JITStubs.cpp:
4927 (JSC::DEFINE_STUB_FUNCTION):
4928 (JSC::getPolymorphicAccessStructureListSlot):
4929
commit-queue@webkit.orgfb3c9682012-07-09 15:39:09 +000049302012-07-09 Sheriff Bot <webkit.review.bot@gmail.com>
4931
4932 Unreviewed, rolling out r122107.
4933 http://trac.webkit.org/changeset/122107
4934 https://bugs.webkit.org/show_bug.cgi?id=90794
4935
4936 Build failure on Mac debug bots (Requested by falken_ on
4937 #webkit).
4938
4939 * Configurations/FeatureDefines.xcconfig:
4940
commit-queue@webkit.orgb46a45d2012-07-09 14:42:00 +000049412012-07-09 Matt Falkenhagen <falken@chromium.org>
4942
4943 Add ENABLE_DIALOG_ELEMENT and skeleton files
4944 https://bugs.webkit.org/show_bug.cgi?id=90521
4945
4946 Reviewed by Kent Tamura.
4947
4948 * Configurations/FeatureDefines.xcconfig:
4949
rniwa@webkit.orga5efe7e2012-07-09 06:19:54 +000049502012-07-08 Ryosuke Niwa <rniwa@webkit.org>
4951
4952 gcc build fix after r121925.
4953
4954 * runtime/JSObject.h:
4955 (JSC::JSFinalObject::finishCreation):
4956
zherczeg@webkit.orgadfdb1f2012-07-08 10:00:04 +000049572012-07-08 Zoltan Herczeg <zherczeg@webkit.org>
4958
4959 [Qt][ARM] Implementing missing macro assembler instructions after r121925
4960 https://bugs.webkit.org/show_bug.cgi?id=90657
4961
4962 Reviewed by Csaba Osztrogonác.
4963
4964 Implementing convertibleLoadPtr, replaceWithLoad and
4965 replaceWithAddressComputation.
4966
4967 * assembler/ARMAssembler.h:
4968 (JSC::ARMAssembler::replaceWithLoad):
4969 (ARMAssembler):
4970 (JSC::ARMAssembler::replaceWithAddressComputation):
4971 * assembler/MacroAssemblerARM.h:
4972 (JSC::MacroAssemblerARM::convertibleLoadPtr):
4973 (MacroAssemblerARM):
4974
fpizlo@apple.com18066da2012-07-07 00:43:21 +000049752012-07-06 Filip Pizlo <fpizlo@apple.com>
4976
4977 WebKit Version 5.1.7 (6534.57.2, r121935): Double-click no longer works on OpenStreetMap
4978 https://bugs.webkit.org/show_bug.cgi?id=90703
4979
4980 Reviewed by Michael Saboff.
4981
4982 It turns out that in my object model refactoring, I managed to fix get_by_pname in all
4983 execution engines except 64-bit baseline JIT.
4984
4985 * jit/JITPropertyAccess.cpp:
4986 (JSC::JIT::emit_op_get_by_pname):
4987
commit-queue@webkit.org650e3e62012-07-06 20:41:09 +000049882012-07-06 Pravin D <pravind.2k4@gmail.com>
4989
4990 Build Error on Qt Linux build
4991 https://bugs.webkit.org/show_bug.cgi?id=90699
4992
4993 Reviewed by Laszlo Gombos.
4994
4995 * parser/Parser.cpp:
4996 (JSC::::parseForStatement):
4997 Removed unused boolean variable as this was causing build error on Qt Linux.
4998
commit-queue@webkit.orgc182dfc2012-07-06 17:39:20 +000049992012-07-06 Nuno Lopes <nlopes@apple.com>
5000
5001 Fix build with recent clang.
5002 https://bugs.webkit.org/show_bug.cgi?id=90634
5003
5004 Reviewed by Oliver Hunt.
5005
5006 * jit/SpecializedThunkJIT.h:
5007 (JSC::SpecializedThunkJIT::SpecializedThunkJIT):
5008 (SpecializedThunkJIT):
5009 * jit/ThunkGenerators.cpp:
5010 (JSC::charCodeAtThunkGenerator):
5011 (JSC::charAtThunkGenerator):
5012 (JSC::fromCharCodeThunkGenerator):
5013 (JSC::sqrtThunkGenerator):
5014 (JSC::floorThunkGenerator):
5015 (JSC::ceilThunkGenerator):
5016 (JSC::roundThunkGenerator):
5017 (JSC::expThunkGenerator):
5018 (JSC::logThunkGenerator):
5019 (JSC::absThunkGenerator):
5020 (JSC::powThunkGenerator):
5021 * parser/ASTBuilder.h:
5022 (JSC::ASTBuilder::createAssignResolve):
5023 (JSC::ASTBuilder::createForLoop):
5024 (JSC::ASTBuilder::createForInLoop):
5025 (JSC::ASTBuilder::makeAssignNode):
5026 (JSC::ASTBuilder::makePrefixNode):
5027 (JSC::ASTBuilder::makePostfixNode):
5028 * parser/NodeConstructors.h:
5029 (JSC::PostfixErrorNode::PostfixErrorNode):
5030 (JSC::PrefixErrorNode::PrefixErrorNode):
5031 (JSC::AssignResolveNode::AssignResolveNode):
5032 (JSC::AssignErrorNode::AssignErrorNode):
5033 (JSC::ForNode::ForNode):
5034 (JSC::ForInNode::ForInNode):
5035 * parser/Nodes.h:
5036 (FunctionCallResolveNode):
5037 (PostfixErrorNode):
5038 (PrefixErrorNode):
5039 (ReadModifyResolveNode):
5040 (AssignResolveNode):
5041 (AssignErrorNode):
5042 (ForNode):
5043 (ForInNode):
5044 * parser/Parser.cpp:
5045 (JSC::::parseVarDeclarationList):
5046 (JSC::::parseForStatement):
5047 * parser/SyntaxChecker.h:
5048 (JSC::SyntaxChecker::createAssignResolve):
5049 (JSC::SyntaxChecker::createForLoop):
5050
zherczeg@webkit.orgb3b18db2012-07-06 08:42:29 +000050512012-07-06 Zoltan Herczeg <zherczeg@webkit.org>
5052
5053 [Qt][ARM] REGRESSION(r121885): It broke 30 jsc tests, 500+ layout tests
5054 https://bugs.webkit.org/show_bug.cgi?id=90656
5055
5056 Reviewed by Csaba Osztrogonác.
5057
5058 Typo fixes.
5059
5060 * assembler/MacroAssemblerARM.cpp:
5061 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
5062 Rename getOp2Byte() -> getOp2Half()
5063 * assembler/MacroAssemblerARMv7.h:
5064 (JSC::MacroAssemblerARMv7::convertibleLoadPtr):
5065 Add a necessary space.
5066 * jit/JITStubs.cpp:
5067 (JSC):
5068 Revert INLINE_ARM_FUNCTION macro.
5069
fpizlo@apple.come26c6d22012-07-06 07:01:35 +000050702012-07-05 Filip Pizlo <fpizlo@apple.com>
5071
5072 REGRESSION(r121925): It broke 5 sputnik tests on x86 platforms
5073 https://bugs.webkit.org/show_bug.cgi?id=90658
5074
5075 Reviewed by Zoltan Herczeg.
5076
5077 Under the new object model, out-of-line property accesses such as those
5078 in ResolveGlobal must account for the fact that the offset to the Kth
5079 property is represented by K + inlineStorageCapacity. Hence, the property
5080 loads in ResolveGlobal must have an additional -inlineStorageCapacity *
5081 sizeof(JSValue) offset.
5082
5083 * dfg/DFGSpeculativeJIT32_64.cpp:
5084 (JSC::DFG::SpeculativeJIT::compile):
5085
ossy@webkit.orgc5b75fd2012-07-06 04:52:26 +000050862012-07-05 Csaba Osztrogonác <ossy@webkit.org>
5087
5088 [Qt] Unreviewed 64 bit buildfix after r121925.
5089
5090 * bytecode/PutByIdStatus.cpp:
5091 (JSC::PutByIdStatus::computeFromLLInt):
5092
msaboff@apple.comb1b64c72012-07-06 00:04:05 +000050932012-07-05 Michael Saboff <msaboff@apple.com>
5094
5095 JSString::tryHashConstLock() fails to get exclusive lock
5096 https://bugs.webkit.org/show_bug.cgi?id=90639
5097
5098 Reviewed by Oliver Hunt.
5099
5100 Added check that the string is already locked even before compare and swap.
5101
5102 * heap/MarkStack.cpp:
5103 (JSC::JSString::tryHashConstLock):
5104
fpizlo@apple.comd68b1f82012-07-05 22:55:51 +000051052012-07-04 Filip Pizlo <fpizlo@apple.com>
5106
5107 Inline property storage should not be wasted when it is exhausted
5108 https://bugs.webkit.org/show_bug.cgi?id=90347
5109
5110 Reviewed by Gavin Barraclough.
5111
5112 Previously, if we switched an object from using inline storage to out-of-line
5113 storage, we would abandon the inline storage. This would have two main implications:
5114 (i) all accesses to the object, even for properties that were previously in inline
5115 storage, must now take an extra indirection; and (ii) we waste a non-trivial amount
5116 of space since we must allocate additional out-of-line storage to hold properties
5117 that would have fit in the inline storage. There's also the copying cost when
5118 switching to out-of-line storage - we must copy all inline properties into ouf-of-line
5119 storage.
5120
5121 This patch changes the way that object property storage works so that we can use both
5122 inline and out-of-line storage concurrently. This is accomplished by introducing a
5123 new notion of property offset. This PropertyOffset is a 32-bit signed integer and it
5124 behaves as follows:
5125
5126 offset == -1: invalid offset, indicating a property that does not exist.
5127
5128 0 <= offset <= inlineStorageCapacity: offset into inline storage.
5129
5130 inlineStorageCapacity < offset: offset into out-of-line storage.
5131
5132 Because non-final objects don't have inline storage, the only valid PropertyOffsets
5133 for those objects' properties are -1 or > inlineStorageCapacity.
5134
5135 This now means that the decision to use inline or out-of-line storage for an access is
5136 made based on the offset, rather than the structure. It also means that any access
5137 where the offset is a variable must have an extra branch, unless the type of the
5138 object is also known (if it's known to be a non-final object then we can just assert
5139 that the offset is >= inlineStorageCapacity).
5140
5141 This looks like a big Kraken speed-up and a slight V8 speed-up.
5142
5143 * GNUmakefile.list.am:
5144 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
5145 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
5146 * JavaScriptCore.xcodeproj/project.pbxproj:
5147 * assembler/ARMv7Assembler.h:
5148 (ARMv7Assembler):
5149 (JSC::ARMv7Assembler::ldrWide8BitImmediate):
5150 (JSC::ARMv7Assembler::replaceWithLoad):
5151 (JSC::ARMv7Assembler::replaceWithAddressComputation):
5152 * assembler/AbstractMacroAssembler.h:
5153 (AbstractMacroAssembler):
5154 (ConvertibleLoadLabel):
5155 (JSC::AbstractMacroAssembler::ConvertibleLoadLabel::ConvertibleLoadLabel):
5156 (JSC::AbstractMacroAssembler::ConvertibleLoadLabel::isSet):
5157 (JSC::AbstractMacroAssembler::labelIgnoringWatchpoints):
5158 (JSC::AbstractMacroAssembler::replaceWithLoad):
5159 (JSC::AbstractMacroAssembler::replaceWithAddressComputation):
5160 * assembler/CodeLocation.h:
5161 (JSC):
5162 (CodeLocationCommon):
5163 (CodeLocationConvertibleLoad):
5164 (JSC::CodeLocationConvertibleLoad::CodeLocationConvertibleLoad):
5165 (JSC::CodeLocationCommon::convertibleLoadAtOffset):
5166 * assembler/LinkBuffer.cpp:
5167 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
5168 * assembler/LinkBuffer.h:
5169 (LinkBuffer):
5170 (JSC::LinkBuffer::locationOf):
5171 * assembler/MacroAssemblerARMv7.h:
5172 (MacroAssemblerARMv7):
5173 (JSC::MacroAssemblerARMv7::convertibleLoadPtr):
5174 * assembler/MacroAssemblerX86.h:
5175 (JSC::MacroAssemblerX86::convertibleLoadPtr):
5176 (MacroAssemblerX86):
5177 * assembler/MacroAssemblerX86_64.h:
5178 (JSC::MacroAssemblerX86_64::convertibleLoadPtr):
5179 (MacroAssemblerX86_64):
5180 * assembler/RepatchBuffer.h:
5181 (RepatchBuffer):
5182 (JSC::RepatchBuffer::replaceWithLoad):
5183 (JSC::RepatchBuffer::replaceWithAddressComputation):
5184 (JSC::RepatchBuffer::setLoadInstructionIsActive):
5185 * assembler/X86Assembler.h:
5186 (JSC::X86Assembler::replaceWithLoad):
5187 (X86Assembler):
5188 (JSC::X86Assembler::replaceWithAddressComputation):
5189 * bytecode/CodeBlock.cpp:
5190 (JSC::CodeBlock::printGetByIdOp):
5191 (JSC::CodeBlock::dump):
5192 (JSC::CodeBlock::finalizeUnconditionally):
5193 * bytecode/GetByIdStatus.cpp:
5194 (JSC::GetByIdStatus::computeFromLLInt):
5195 (JSC::GetByIdStatus::computeForChain):
5196 (JSC::GetByIdStatus::computeFor):
5197 * bytecode/GetByIdStatus.h:
5198 (JSC::GetByIdStatus::GetByIdStatus):
5199 (JSC::GetByIdStatus::offset):
5200 (GetByIdStatus):
5201 * bytecode/Opcode.h:
5202 (JSC):
5203 (JSC::padOpcodeName):
5204 * bytecode/PutByIdStatus.cpp:
5205 (JSC::PutByIdStatus::computeFromLLInt):
5206 (JSC::PutByIdStatus::computeFor):
5207 * bytecode/PutByIdStatus.h:
5208 (JSC::PutByIdStatus::PutByIdStatus):
5209 (JSC::PutByIdStatus::offset):
5210 (PutByIdStatus):
5211 * bytecode/ResolveGlobalStatus.cpp:
5212 (JSC):
5213 (JSC::computeForStructure):
5214 * bytecode/ResolveGlobalStatus.h:
5215 (JSC::ResolveGlobalStatus::ResolveGlobalStatus):
5216 (JSC::ResolveGlobalStatus::offset):
5217 (ResolveGlobalStatus):
5218 * bytecode/StructureSet.h:
5219 (StructureSet):
5220 * bytecode/StructureStubInfo.h:
5221 * dfg/DFGByteCodeParser.cpp:
5222 (ByteCodeParser):
5223 (JSC::DFG::ByteCodeParser::handleGetByOffset):
5224 (JSC::DFG::ByteCodeParser::handleGetById):
5225 (JSC::DFG::ByteCodeParser::parseBlock):
5226 * dfg/DFGCapabilities.h:
5227 (JSC::DFG::canCompileOpcode):
5228 * dfg/DFGJITCompiler.cpp:
5229 (JSC::DFG::JITCompiler::link):
5230 * dfg/DFGJITCompiler.h:
5231 (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord):
5232 (PropertyAccessRecord):
5233 * dfg/DFGRepatch.cpp:
5234 (JSC::DFG::dfgRepatchByIdSelfAccess):
5235 (JSC::DFG::generateProtoChainAccessStub):
5236 (JSC::DFG::tryCacheGetByID):
5237 (JSC::DFG::tryBuildGetByIDList):
5238 (JSC::DFG::tryBuildGetByIDProtoList):
5239 (JSC::DFG::emitPutReplaceStub):
5240 (JSC::DFG::emitPutTransitionStub):
5241 (JSC::DFG::tryCachePutByID):
5242 (JSC::DFG::tryBuildPutByIdList):
5243 * dfg/DFGSpeculativeJIT.h:
5244 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
5245 * dfg/DFGSpeculativeJIT32_64.cpp:
5246 (JSC::DFG::SpeculativeJIT::cachedGetById):
5247 (JSC::DFG::SpeculativeJIT::cachedPutById):
5248 (JSC::DFG::SpeculativeJIT::compile):
5249 * dfg/DFGSpeculativeJIT64.cpp:
5250 (JSC::DFG::SpeculativeJIT::cachedGetById):
5251 (JSC::DFG::SpeculativeJIT::cachedPutById):
5252 (JSC::DFG::SpeculativeJIT::compile):
5253 * heap/MarkStack.cpp:
5254 (JSC::visitChildren):
5255 * interpreter/Interpreter.cpp:
5256 (JSC::Interpreter::tryCacheGetByID):
5257 (JSC::Interpreter::privateExecute):
5258 * jit/JIT.cpp:
5259 (JSC::JIT::privateCompileMainPass):
5260 (JSC::JIT::privateCompileSlowCases):
5261 (JSC::PropertyStubCompilationInfo::copyToStubInfo):
5262 * jit/JIT.h:
5263 (JSC::PropertyStubCompilationInfo::PropertyStubCompilationInfo):
5264 (JSC::JIT::compileGetByIdProto):
5265 (JSC::JIT::compileGetByIdSelfList):
5266 (JSC::JIT::compileGetByIdProtoList):
5267 (JSC::JIT::compileGetByIdChainList):
5268 (JSC::JIT::compileGetByIdChain):
5269 (JSC::JIT::compilePutByIdTransition):
5270 (JIT):
5271 * jit/JITInlineMethods.h:
5272 (JSC::JIT::emitAllocateBasicJSObject):
5273 * jit/JITOpcodes.cpp:
5274 (JSC::JIT::emit_op_resolve_global):
5275 * jit/JITOpcodes32_64.cpp:
5276 (JSC::JIT::emit_op_resolve_global):
5277 * jit/JITPropertyAccess.cpp:
5278 (JSC::JIT::compileGetDirectOffset):
5279 (JSC::JIT::emit_op_method_check):
5280 (JSC::JIT::compileGetByIdHotPath):
5281 (JSC::JIT::emit_op_put_by_id):
5282 (JSC::JIT::compilePutDirectOffset):
5283 (JSC::JIT::privateCompilePutByIdTransition):
5284 (JSC::JIT::patchGetByIdSelf):
5285 (JSC::JIT::patchPutByIdReplace):
5286 (JSC::JIT::privateCompileGetByIdProto):
5287 (JSC::JIT::privateCompileGetByIdSelfList):
5288 (JSC::JIT::privateCompileGetByIdProtoList):
5289 (JSC::JIT::privateCompileGetByIdChainList):
5290 (JSC::JIT::privateCompileGetByIdChain):
5291 * jit/JITPropertyAccess32_64.cpp:
5292 (JSC::JIT::emit_op_method_check):
5293 (JSC::JIT::compileGetByIdHotPath):
5294 (JSC::JIT::emit_op_put_by_id):
5295 (JSC::JIT::compilePutDirectOffset):
5296 (JSC::JIT::compileGetDirectOffset):
5297 (JSC::JIT::privateCompilePutByIdTransition):
5298 (JSC::JIT::patchGetByIdSelf):
5299 (JSC::JIT::patchPutByIdReplace):
5300 (JSC::JIT::privateCompileGetByIdProto):
5301 (JSC::JIT::privateCompileGetByIdSelfList):
5302 (JSC::JIT::privateCompileGetByIdProtoList):
5303 (JSC::JIT::privateCompileGetByIdChainList):
5304 (JSC::JIT::privateCompileGetByIdChain):
5305 (JSC::JIT::emit_op_get_by_pname):
5306 * jit/JITStubs.cpp:
5307 (JSC::JITThunks::tryCacheGetByID):
5308 (JSC::DEFINE_STUB_FUNCTION):
5309 * llint/LLIntSlowPaths.cpp:
5310 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
5311 * llint/LowLevelInterpreter.asm:
5312 * llint/LowLevelInterpreter32_64.asm:
5313 * llint/LowLevelInterpreter64.asm:
5314 * offlineasm/x86.rb:
5315 * runtime/JSGlobalObject.h:
5316 (JSGlobalObject):
5317 (JSC::JSGlobalObject::functionNameOffset):
5318 * runtime/JSObject.cpp:
5319 (JSC::JSObject::visitChildren):
5320 (JSC):
5321 (JSC::JSFinalObject::visitChildren):
5322 (JSC::JSObject::put):
5323 (JSC::JSObject::deleteProperty):
5324 (JSC::JSObject::getPropertySpecificValue):
5325 (JSC::JSObject::removeDirect):
5326 (JSC::JSObject::growOutOfLineStorage):
5327 (JSC::JSObject::getOwnPropertyDescriptor):
5328 * runtime/JSObject.h:
5329 (JSObject):
5330 (JSC::JSObject::getDirect):
5331 (JSC::JSObject::getDirectLocation):
5332 (JSC::JSObject::hasInlineStorage):
5333 (JSC::JSObject::inlineStorageUnsafe):
5334 (JSC::JSObject::inlineStorage):
5335 (JSC::JSObject::outOfLineStorage):
5336 (JSC::JSObject::locationForOffset):
5337 (JSC::JSObject::offsetForLocation):
5338 (JSC::JSObject::getDirectOffset):
5339 (JSC::JSObject::putDirectOffset):
5340 (JSC::JSObject::putUndefinedAtDirectOffset):
5341 (JSC::JSObject::addressOfOutOfLineStorage):
5342 (JSC::JSObject::finishCreation):
5343 (JSC::JSNonFinalObject::JSNonFinalObject):
5344 (JSC::JSNonFinalObject::finishCreation):
5345 (JSFinalObject):
5346 (JSC::JSFinalObject::finishCreation):
5347 (JSC::JSFinalObject::JSFinalObject):
5348 (JSC::JSObject::offsetOfOutOfLineStorage):
5349 (JSC::JSObject::setOutOfLineStorage):
5350 (JSC::JSObject::JSObject):
5351 (JSC):
5352 (JSC::JSCell::fastGetOwnProperty):
5353 (JSC::JSObject::putDirectInternal):
5354 (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
5355 (JSC::JSObject::putDirectWithoutTransition):
5356 (JSC::offsetRelativeToPatchedStorage):
5357 (JSC::indexRelativeToBase):
5358 (JSC::offsetRelativeToBase):
5359 * runtime/JSPropertyNameIterator.cpp:
5360 (JSC::JSPropertyNameIterator::create):
5361 * runtime/JSPropertyNameIterator.h:
5362 (JSPropertyNameIterator):
5363 (JSC::JSPropertyNameIterator::getOffset):
5364 (JSC::JSPropertyNameIterator::finishCreation):
5365 * runtime/JSValue.cpp:
5366 (JSC::JSValue::putToPrimitive):
5367 * runtime/Operations.h:
5368 (JSC::normalizePrototypeChain):
5369 * runtime/Options.cpp:
5370 (JSC):
5371 (JSC::Options::initialize):
5372 * runtime/PropertyMapHashTable.h:
5373 (PropertyMapEntry):
5374 (JSC::PropertyMapEntry::PropertyMapEntry):
5375 (PropertyTable):
5376 (JSC::PropertyTable::PropertyTable):
5377 (JSC::PropertyTable::getDeletedOffset):
5378 (JSC::PropertyTable::addDeletedOffset):
5379 (JSC::PropertyTable::nextOffset):
5380 (JSC):
5381 (JSC::PropertyTable::sizeInMemory):
5382 * runtime/PropertyOffset.h: Added.
5383 (JSC):
5384 (JSC::checkOffset):
5385 (JSC::validateOffset):
5386 (JSC::isValidOffset):
5387 (JSC::isInlineOffset):
5388 (JSC::isOutOfLineOffset):
5389 (JSC::offsetInInlineStorage):
5390 (JSC::offsetInOutOfLineStorage):
5391 (JSC::offsetInRespectiveStorage):
5392 (JSC::numberOfOutOfLineSlotsForLastOffset):
5393 (JSC::numberOfSlotsForLastOffset):
5394 (JSC::nextPropertyOffsetFor):
5395 (JSC::firstPropertyOffsetFor):
5396 * runtime/PropertySlot.h:
5397 (JSC::PropertySlot::cachedOffset):
5398 (JSC::PropertySlot::setValue):
5399 (JSC::PropertySlot::setCacheableGetterSlot):
5400 (JSC::PropertySlot::clearOffset):
5401 * runtime/PutPropertySlot.h:
5402 (JSC::PutPropertySlot::setExistingProperty):
5403 (JSC::PutPropertySlot::setNewProperty):
5404 (JSC::PutPropertySlot::cachedOffset):
5405 (PutPropertySlot):
5406 * runtime/Structure.cpp:
5407 (JSC::Structure::Structure):
5408 (JSC::Structure::materializePropertyMap):
5409 (JSC::nextOutOfLineStorageCapacity):
5410 (JSC::Structure::growOutOfLineCapacity):
5411 (JSC::Structure::suggestedNewOutOfLineStorageCapacity):
5412 (JSC::Structure::addPropertyTransitionToExistingStructure):
5413 (JSC::Structure::addPropertyTransition):
5414 (JSC::Structure::removePropertyTransition):
5415 (JSC::Structure::flattenDictionaryStructure):
5416 (JSC::Structure::addPropertyWithoutTransition):
5417 (JSC::Structure::removePropertyWithoutTransition):
5418 (JSC::Structure::copyPropertyTableForPinning):
5419 (JSC::Structure::get):
5420 (JSC::Structure::putSpecificValue):
5421 (JSC::Structure::remove):
5422 * runtime/Structure.h:
5423 (Structure):
5424 (JSC::Structure::putWillGrowOutOfLineStorage):
5425 (JSC::Structure::previousID):
5426 (JSC::Structure::outOfLineCapacity):
5427 (JSC::Structure::outOfLineSizeForKnownFinalObject):
5428 (JSC::Structure::outOfLineSizeForKnownNonFinalObject):
5429 (JSC::Structure::outOfLineSize):
5430 (JSC::Structure::hasInlineStorage):
5431 (JSC::Structure::inlineCapacity):
5432 (JSC::Structure::inlineSizeForKnownFinalObject):
5433 (JSC::Structure::inlineSize):
5434 (JSC::Structure::totalStorageSize):
5435 (JSC::Structure::totalStorageCapacity):
5436 (JSC::Structure::firstValidOffset):
5437 (JSC::Structure::lastValidOffset):
5438 (JSC::Structure::isValidOffset):
5439 (JSC::Structure::isEmpty):
5440 (JSC::Structure::transitionCount):
5441 (JSC::Structure::get):
5442
oliver@apple.com5635b542012-07-05 20:36:37 +000054432012-07-05 Oliver Hunt <oliver@apple.com>
5444
5445 JSObjectCallAsFunction should thisConvert the provided thisObject
5446 https://bugs.webkit.org/show_bug.cgi?id=90628
5447
5448 Reviewed by Gavin Barraclough.
5449
5450 Perform this conversion on the provided this object.
5451
5452 * API/JSObjectRef.cpp:
5453 (JSObjectCallAsFunction):
5454
zherczeg@webkit.orgd6e661f2012-07-05 07:04:16 +000054552012-07-05 Zoltan Herczeg <zherczeg@webkit.org>
5456
zherczeg@webkit.orgda8c37d2012-07-05 07:53:51 +00005457 [Qt] Unreviewed buildfix after r121886. Typo fix.
5458
5459 * assembler/MacroAssemblerARM.cpp:
5460 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
5461
54622012-07-05 Zoltan Herczeg <zherczeg@webkit.org>
5463
zherczeg@webkit.orgd6e661f2012-07-05 07:04:16 +00005464 Port DFG JIT to traditional ARM
5465 https://bugs.webkit.org/show_bug.cgi?id=90198
5466
5467 Reviewed by Filip Pizlo.
5468
5469 This patch contains the macro assembler part of the
5470 DFG JIT support on ARM systems with fixed 32 bit instruction
5471 width. A large amount of old code was refactored, and the ARMv4
5472 or lower support is removed from the macro assembler.
5473
5474 Sunspider is improved by 8%, and V8 is 92%.
5475
5476 * assembler/ARMAssembler.cpp:
5477 (JSC::ARMAssembler::dataTransfer32):
5478 (JSC::ARMAssembler::baseIndexTransfer32):
5479 (JSC):
5480 (JSC::ARMAssembler::dataTransfer16):
5481 (JSC::ARMAssembler::baseIndexTransfer16):
5482 (JSC::ARMAssembler::dataTransferFloat):
5483 (JSC::ARMAssembler::baseIndexTransferFloat):
5484 (JSC::ARMAssembler::executableCopy):
5485 * assembler/ARMAssembler.h:
5486 (JSC::ARMAssembler::ARMAssembler):
5487 (JSC::ARMAssembler::emitInst):
5488 (JSC::ARMAssembler::vmov_f64_r):
5489 (ARMAssembler):
5490 (JSC::ARMAssembler::vabs_f64_r):
5491 (JSC::ARMAssembler::vneg_f64_r):
5492 (JSC::ARMAssembler::ldr_imm):
5493 (JSC::ARMAssembler::ldr_un_imm):
5494 (JSC::ARMAssembler::dtr_u):
5495 (JSC::ARMAssembler::dtr_ur):
5496 (JSC::ARMAssembler::dtr_d):
5497 (JSC::ARMAssembler::dtr_dr):
5498 (JSC::ARMAssembler::dtrh_u):
5499 (JSC::ARMAssembler::dtrh_ur):
5500 (JSC::ARMAssembler::dtrh_d):
5501 (JSC::ARMAssembler::dtrh_dr):
5502 (JSC::ARMAssembler::fdtr_u):
5503 (JSC::ARMAssembler::fdtr_d):
5504 (JSC::ARMAssembler::push_r):
5505 (JSC::ARMAssembler::pop_r):
5506 (JSC::ARMAssembler::poke_r):
5507 (JSC::ARMAssembler::peek_r):
5508 (JSC::ARMAssembler::vmov_vfp64_r):
5509 (JSC::ARMAssembler::vmov_arm64_r):
5510 (JSC::ARMAssembler::vmov_vfp32_r):
5511 (JSC::ARMAssembler::vmov_arm32_r):
5512 (JSC::ARMAssembler::vcvt_u32_f64_r):
5513 (JSC::ARMAssembler::vcvt_f64_f32_r):
5514 (JSC::ARMAssembler::vcvt_f32_f64_r):
5515 (JSC::ARMAssembler::clz_r):
5516 (JSC::ARMAssembler::bkpt):
5517 (JSC::ARMAssembler::bx):
5518 (JSC::ARMAssembler::blx):
5519 (JSC::ARMAssembler::labelIgnoringWatchpoints):
5520 (JSC::ARMAssembler::labelForWatchpoint):
5521 (JSC::ARMAssembler::label):
5522 (JSC::ARMAssembler::getLdrImmAddress):
5523 (JSC::ARMAssembler::replaceWithJump):
5524 (JSC::ARMAssembler::maxJumpReplacementSize):
5525 (JSC::ARMAssembler::getOp2Byte):
5526 (JSC::ARMAssembler::getOp2Half):
5527 (JSC::ARMAssembler::RM):
5528 (JSC::ARMAssembler::RS):
5529 (JSC::ARMAssembler::RD):
5530 (JSC::ARMAssembler::RN):
5531 * assembler/AssemblerBufferWithConstantPool.h:
5532 (JSC::AssemblerBufferWithConstantPool::ensureSpaceForAnyInstruction):
5533 * assembler/MacroAssemblerARM.cpp:
5534 (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
5535 * assembler/MacroAssemblerARM.h:
5536 (JSC::MacroAssemblerARM::add32):
5537 (MacroAssemblerARM):
5538 (JSC::MacroAssemblerARM::and32):
5539 (JSC::MacroAssemblerARM::lshift32):
5540 (JSC::MacroAssemblerARM::mul32):
5541 (JSC::MacroAssemblerARM::neg32):
5542 (JSC::MacroAssemblerARM::rshift32):
5543 (JSC::MacroAssemblerARM::urshift32):
5544 (JSC::MacroAssemblerARM::xor32):
5545 (JSC::MacroAssemblerARM::load8):
5546 (JSC::MacroAssemblerARM::load8Signed):
5547 (JSC::MacroAssemblerARM::load16):
5548 (JSC::MacroAssemblerARM::load16Signed):
5549 (JSC::MacroAssemblerARM::load32):
5550 (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
5551 (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
5552 (JSC::MacroAssemblerARM::store8):
5553 (JSC::MacroAssemblerARM::store16):
5554 (JSC::MacroAssemblerARM::store32):
5555 (JSC::MacroAssemblerARM::move):
5556 (JSC::MacroAssemblerARM::jump):
5557 (JSC::MacroAssemblerARM::branchAdd32):
5558 (JSC::MacroAssemblerARM::mull32):
5559 (JSC::MacroAssemblerARM::branchMul32):
5560 (JSC::MacroAssemblerARM::nearCall):
5561 (JSC::MacroAssemblerARM::compare32):
5562 (JSC::MacroAssemblerARM::test32):
5563 (JSC::MacroAssemblerARM::sub32):
5564 (JSC::MacroAssemblerARM::call):
5565 (JSC::MacroAssemblerARM::loadFloat):
5566 (JSC::MacroAssemblerARM::loadDouble):
5567 (JSC::MacroAssemblerARM::storeFloat):
5568 (JSC::MacroAssemblerARM::storeDouble):
5569 (JSC::MacroAssemblerARM::moveDouble):
5570 (JSC::MacroAssemblerARM::addDouble):
5571 (JSC::MacroAssemblerARM::divDouble):
5572 (JSC::MacroAssemblerARM::subDouble):
5573 (JSC::MacroAssemblerARM::mulDouble):
5574 (JSC::MacroAssemblerARM::absDouble):
5575 (JSC::MacroAssemblerARM::negateDouble):
5576 (JSC::MacroAssemblerARM::convertInt32ToDouble):
5577 (JSC::MacroAssemblerARM::convertFloatToDouble):
5578 (JSC::MacroAssemblerARM::convertDoubleToFloat):
5579 (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
5580 (JSC::MacroAssemblerARM::branchTruncateDoubleToUint32):
5581 (JSC::MacroAssemblerARM::truncateDoubleToInt32):
5582 (JSC::MacroAssemblerARM::truncateDoubleToUint32):
5583 (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
5584 (JSC::MacroAssemblerARM::branchDoubleNonZero):
5585 (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
5586 (JSC::MacroAssemblerARM::invert):
5587 (JSC::MacroAssemblerARM::replaceWithJump):
5588 (JSC::MacroAssemblerARM::maxJumpReplacementSize):
5589 (JSC::MacroAssemblerARM::call32):
5590 * assembler/SH4Assembler.h:
5591 (JSC::SH4Assembler::label):
5592 * dfg/DFGAssemblyHelpers.h:
5593 (JSC::DFG::AssemblyHelpers::debugCall):
5594 (JSC::DFG::AssemblyHelpers::boxDouble):
5595 (JSC::DFG::AssemblyHelpers::unboxDouble):
5596 * dfg/DFGCCallHelpers.h:
5597 (CCallHelpers):
5598 (JSC::DFG::CCallHelpers::setupArguments):
5599 * dfg/DFGFPRInfo.h:
5600 (DFG):
5601 * dfg/DFGGPRInfo.h:
5602 (DFG):
5603 (GPRInfo):
5604 * dfg/DFGOperations.cpp:
5605 (JSC):
5606 * dfg/DFGSpeculativeJIT.h:
5607 (SpeculativeJIT):
5608 (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult):
5609 (JSC::DFG::SpeculativeJIT::appendCallSetResult):
5610 * jit/JITStubs.cpp:
5611 (JSC):
5612 * jit/JITStubs.h:
5613 (JITStackFrame):
5614 * jit/JSInterfaceJIT.h:
5615 (JSInterfaceJIT):
5616
commit-queue@webkit.orgd106bf22012-07-04 21:36:52 +000056172012-07-04 Anthony Scian <ascian@rim.com>
5618
5619 Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
5620 https://bugs.webkit.org/show_bug.cgi?id=40118
5621
5622 Reviewed by Yong Li.
5623
5624 Added member functions to expose function name, urlString, and line #.
5625 Refactored toString to make use of these member functions to reduce
5626 duplicated code for future maintenance.
5627
5628 Manually tested refactoring of toString by tracing thrown exceptions.
5629
5630 * interpreter/Interpreter.h:
5631 (JSC::StackFrame::toString):
5632 (JSC::StackFrame::friendlySourceURL):
5633 (JSC::StackFrame::friendlyFunctionName):
5634 (JSC::StackFrame::friendlyLineNumber):
5635
wingo@igalia.com17649d82012-07-04 20:32:26 +000056362012-07-04 Andy Wingo <wingo@igalia.com>
5637
5638 [GTK] Enable parallel GC
5639 https://bugs.webkit.org/show_bug.cgi?id=90568
5640
5641 Reviewed by Martin Robinson.
5642
5643 * runtime/Options.cpp: Include <algorithm.h> for std::min.
5644
commit-queue@webkit.org1fcb31a2012-07-04 16:16:01 +000056452012-07-04 John Mellor <johnme@chromium.org>
5646
5647 Text Autosizing: Add compile flag and runtime setting
5648 https://bugs.webkit.org/show_bug.cgi?id=87394
5649
5650 This patch renames Font Boosting to Text Autosizing.
5651
5652 Reviewed by Adam Barth.
5653
5654 * Configurations/FeatureDefines.xcconfig:
5655
msaboff@apple.comd08f3502012-07-03 22:57:00 +000056562012-07-03 Michael Saboff <msaboff@apple.com>
5657
5658 Enh: Hash Const JSString in Backing Stores to Save Memory
5659 https://bugs.webkit.org/show_bug.cgi?id=86024
5660
5661 Reviewed by Oliver Hunt.
5662
5663 During garbage collection, each marking thread keeps a HashMap of
5664 strings. While visiting via MarkStack::copyAndAppend(), we check to
5665 see if the string we are visiting is already in the HashMap. If not
5666 we add it. If so, we change the reference to the current string we're
5667 visiting to the prior string.
5668
5669 To reduce the performance impact of this change, two throttles have
5670 ben added. 1) We only try hash consting if a significant number of new
5671 strings have been created since the last hash const. Currently this is
5672 set at 100 strings. 2) If a string is unique at the end of a marking
5673 it will not be checked during further GC phases. In some cases this
5674 won't catch all duplicates, but we are trying to catch the growth of
5675 duplicate strings.
5676
5677 * heap/Heap.cpp:
5678 (JSC::Heap::markRoots):
5679 * heap/MarkStack.cpp:
5680 (JSC::MarkStackThreadSharedData::resetChildren):
5681 (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
5682 (JSC::MarkStackThreadSharedData::reset):
5683 (JSC::MarkStack::setup): Check to see if enough strings have been created
5684 to hash const.
5685 (JSC::MarkStack::reset): Added call to clear m_uniqueStrings.
5686 (JSC::JSString::tryHashConstLock): New method to lock JSString for
5687 hash consting.
5688 (JSC::JSString::releaseHashConstLock): New unlock method.
5689 (JSC::JSString::shouldTryHashConst): Set of checks to see if we should
5690 try to hash const the string.
5691 (JSC::MarkStack::internalAppend): New method that performs the hash consting.
5692 (JSC::SlotVisitor::copyAndAppend): Changed to call the new hash
5693 consting internalAppend().
5694 * heap/MarkStack.h:
5695 (MarkStackThreadSharedData):
5696 (MarkStack):
5697 * runtime/JSGlobalData.cpp:
5698 (JSC::JSGlobalData::JSGlobalData):
5699 * runtime/JSGlobalData.h:
5700 (JSGlobalData):
5701 (JSC::JSGlobalData::haveEnoughNewStringsToHashConst):
5702 (JSC::JSGlobalData::resetNewStringsSinceLastHashConst):
5703 * runtime/JSString.h:
5704 (JSString): Changed from using bool flags to using an unsigned
5705 m_flags field. This works better with the weakCompareAndSwap in
5706 JSString::tryHashConstLock(). Changed the 8bitness setting and
5707 checking to use new accessors.
5708 (JSC::JSString::JSString):
5709 (JSC::JSString::finishCreation):
5710 (JSC::JSString::is8Bit): Updated for new m_flags.
5711 (JSC::JSString::setIs8Bit): New setter.
5712 New hash const flags accessors:
5713 (JSC::JSString::isHashConstSingleton):
5714 (JSC::JSString::clearHashConstSingleton):
5715 (JSC::JSString::setHashConstSingleton):
5716 (JSC::JSRopeString::finishCreation):
5717 (JSC::JSRopeString::append):
5718
tony@chromium.orga47ad862012-07-03 20:26:08 +000057192012-07-03 Tony Chang <tony@chromium.org>
5720
5721 [chromium] Unreviewed, update .gitignore to handle VS2010 files.
5722
5723 * JavaScriptCore.gyp/.gitignore:
5724
commit-queue@webkit.orgfbda60c2012-07-03 19:19:22 +000057252012-07-03 Mark Lam <mark.lam@apple.com>
5726
5727 Add ability to symbolically set and dump JSC VM options.
5728 See comments in runtime/Options.h for details on how the options work.
5729 https://bugs.webkit.org/show_bug.cgi?id=90420
5730
5731 Reviewed by Filip Pizlo.
5732
5733 * assembler/LinkBuffer.cpp:
5734 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
5735 * assembler/LinkBuffer.h:
5736 (JSC):
5737 * bytecode/CodeBlock.cpp:
5738 (JSC::CodeBlock::shouldOptimizeNow):
5739 * bytecode/CodeBlock.h:
5740 (JSC::CodeBlock::likelyToTakeSlowCase):
5741 (JSC::CodeBlock::couldTakeSlowCase):
5742 (JSC::CodeBlock::likelyToTakeSpecialFastCase):
5743 (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
5744 (JSC::CodeBlock::likelyToTakeAnySlowCase):
5745 (JSC::CodeBlock::jitAfterWarmUp):
5746 (JSC::CodeBlock::jitSoon):
5747 (JSC::CodeBlock::reoptimizationRetryCounter):
5748 (JSC::CodeBlock::countReoptimization):
5749 (JSC::CodeBlock::counterValueForOptimizeAfterWarmUp):
5750 (JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp):
5751 (JSC::CodeBlock::optimizeSoon):
5752 (JSC::CodeBlock::exitCountThresholdForReoptimization):
5753 (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
5754 * bytecode/ExecutionCounter.h:
5755 (JSC::ExecutionCounter::clippedThreshold):
5756 * dfg/DFGByteCodeParser.cpp:
5757 (JSC::DFG::ByteCodeParser::handleInlining):
5758 * dfg/DFGCapabilities.h:
5759 (JSC::DFG::mightCompileEval):
5760 (JSC::DFG::mightCompileProgram):
5761 (JSC::DFG::mightCompileFunctionForCall):
5762 (JSC::DFG::mightCompileFunctionForConstruct):
5763 (JSC::DFG::mightInlineFunctionForCall):
5764 (JSC::DFG::mightInlineFunctionForConstruct):
5765 * dfg/DFGCommon.h:
5766 (JSC::DFG::shouldShowDisassembly):
5767 * dfg/DFGDriver.cpp:
5768 (JSC::DFG::compile):
5769 * dfg/DFGOSRExit.cpp:
5770 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
5771 * dfg/DFGVariableAccessData.h:
5772 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
5773 * heap/MarkStack.cpp:
5774 (JSC::MarkStackSegmentAllocator::allocate):
5775 (JSC::MarkStackSegmentAllocator::shrinkReserve):
5776 (JSC::MarkStackArray::MarkStackArray):
5777 (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
5778 (JSC::SlotVisitor::donateKnownParallel):
5779 (JSC::SlotVisitor::drain):
5780 (JSC::SlotVisitor::drainFromShared):
5781 * heap/MarkStack.h:
5782 (JSC::MarkStack::mergeOpaqueRootsIfProfitable):
5783 (JSC::MarkStack::addOpaqueRoot):
5784 * heap/SlotVisitor.h:
5785 (JSC::SlotVisitor::donate):
5786 * jit/JIT.cpp:
5787 (JSC::JIT::emitOptimizationCheck):
5788 * jsc.cpp:
5789 (printUsageStatement):
5790 (parseArguments):
5791 * runtime/InitializeThreading.cpp:
5792 (JSC::initializeThreadingOnce):
5793 * runtime/JSGlobalData.cpp:
5794 (JSC::enableAssembler):
5795 * runtime/JSGlobalObject.cpp:
5796 (JSC::JSGlobalObject::JSGlobalObject):
5797 * runtime/Options.cpp:
5798 (JSC):
5799 (JSC::overrideOptionWithHeuristic):
5800 (JSC::Options::initialize):
5801 (JSC::Options::setOption):
5802 (JSC::Options::dumpAllOptions):
5803 (JSC::Options::dumpOption):
5804 * runtime/Options.h:
5805 (JSC):
5806 (Options):
5807 (EntryInfo):
5808
commit-queue@webkit.org337179a2012-07-03 13:43:13 +000058092012-07-03 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Joel Dillon <joel.dillon@codethink.co.uk>
5810
5811 [Qt][Win] Fix broken QtWebKit5.lib linking
5812 https://bugs.webkit.org/show_bug.cgi?id=88321
5813
5814 Reviewed by Kenneth Rohde Christiansen.
5815
5816 The goal is to have different ports build systems define STATICALLY_LINKED_WITH_WTF
5817 when building JavaScriptCore, if both are packaged in the same DLL, instead
5818 of relying on the code to handle this.
5819 The effects of BUILDING_* and STATICALLY_LINKED_WITH_* are currently the same
5820 except for a check in Source/JavaScriptCore/config.h.
5821
5822 Keeping the old way for the WX port as requested by the port's contributors.
5823 For non-Windows ports there is no difference between IMPORT and EXPORT, no
5824 change is needed.
5825
5826 * API/JSBase.h:
5827 JS symbols shouldn't be included by WTF objects anymore. Remove the export when BUILDING_WTF.
5828 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
5829 Make sure that JavaScriptCore uses import symbols of WTF for the Win port.
5830 * runtime/JSExportMacros.h:
5831
fpizlo@apple.comaedde2e2012-07-03 00:10:08 +000058322012-07-02 Filip Pizlo <fpizlo@apple.com>
5833
fpizlo@apple.com8618e4b2012-07-03 01:27:16 +00005834 DFG OSR exit value recoveries should be computed lazily
5835 https://bugs.webkit.org/show_bug.cgi?id=82155
5836
5837 Reviewed by Gavin Barraclough.
5838
5839 This change aims to reduce one aspect of DFG compile times: the fact
5840 that we currently compute the value recoveries for each local and
5841 argument on every speculation check. We compile many speculation checks,
5842 so this can add up quick. The strategy that this change takes is to
5843 have the DFG save just enough information about how the compiler is
5844 choosing to represent state, that the DFG::OSRExitCompiler can reify
5845 the value recoveries lazily.
5846
5847 This appears to be an 0.3% SunSpider speed-up and is neutral elsewhere.
5848
5849 I also took the opportunity to fix the sampling regions profiler (it
5850 was missing an export macro) and to put in more sampling regions in
5851 the DFG (which are disabled so long as ENABLE(SAMPLING_REGIONS) is
5852 false).
5853
5854 * CMakeLists.txt:
5855 * GNUmakefile.list.am:
5856 * JavaScriptCore.xcodeproj/project.pbxproj:
5857 * Target.pri:
5858 * bytecode/CodeBlock.cpp:
5859 (JSC):
5860 (JSC::CodeBlock::shrinkDFGDataToFit):
5861 * bytecode/CodeBlock.h:
5862 (CodeBlock):
5863 (JSC::CodeBlock::minifiedDFG):
5864 (JSC::CodeBlock::variableEventStream):
5865 (DFGData):
5866 * bytecode/Operands.h:
5867 (JSC::Operands::hasOperand):
5868 (Operands):
5869 (JSC::Operands::size):
5870 (JSC::Operands::at):
5871 (JSC::Operands::operator[]):
5872 (JSC::Operands::isArgument):
5873 (JSC::Operands::isVariable):
5874 (JSC::Operands::argumentForIndex):
5875 (JSC::Operands::variableForIndex):
5876 (JSC::Operands::operandForIndex):
5877 (JSC):
5878 (JSC::dumpOperands):
5879 * bytecode/SamplingTool.h:
5880 (SamplingRegion):
5881 * dfg/DFGByteCodeParser.cpp:
5882 (JSC::DFG::parse):
5883 * dfg/DFGCFAPhase.cpp:
5884 (JSC::DFG::performCFA):
5885 * dfg/DFGCSEPhase.cpp:
5886 (JSC::DFG::performCSE):
5887 * dfg/DFGFixupPhase.cpp:
5888 (JSC::DFG::performFixup):
5889 * dfg/DFGGenerationInfo.h:
5890 (JSC::DFG::GenerationInfo::GenerationInfo):
5891 (JSC::DFG::GenerationInfo::initConstant):
5892 (JSC::DFG::GenerationInfo::initInteger):
5893 (JSC::DFG::GenerationInfo::initJSValue):
5894 (JSC::DFG::GenerationInfo::initCell):
5895 (JSC::DFG::GenerationInfo::initBoolean):
5896 (JSC::DFG::GenerationInfo::initDouble):
5897 (JSC::DFG::GenerationInfo::initStorage):
5898 (GenerationInfo):
5899 (JSC::DFG::GenerationInfo::noticeOSRBirth):
5900 (JSC::DFG::GenerationInfo::use):
5901 (JSC::DFG::GenerationInfo::spill):
5902 (JSC::DFG::GenerationInfo::setSpilled):
5903 (JSC::DFG::GenerationInfo::fillJSValue):
5904 (JSC::DFG::GenerationInfo::fillCell):
5905 (JSC::DFG::GenerationInfo::fillInteger):
5906 (JSC::DFG::GenerationInfo::fillBoolean):
5907 (JSC::DFG::GenerationInfo::fillDouble):
5908 (JSC::DFG::GenerationInfo::fillStorage):
5909 (JSC::DFG::GenerationInfo::appendFill):
5910 (JSC::DFG::GenerationInfo::appendSpill):
5911 * dfg/DFGJITCompiler.cpp:
5912 (JSC::DFG::JITCompiler::link):
5913 (JSC::DFG::JITCompiler::compile):
5914 (JSC::DFG::JITCompiler::compileFunction):
5915 * dfg/DFGMinifiedGraph.h: Added.
5916 (DFG):
5917 (MinifiedGraph):
5918 (JSC::DFG::MinifiedGraph::MinifiedGraph):
5919 (JSC::DFG::MinifiedGraph::at):
5920 (JSC::DFG::MinifiedGraph::append):
5921 (JSC::DFG::MinifiedGraph::prepareAndShrink):
5922 (JSC::DFG::MinifiedGraph::setOriginalGraphSize):
5923 (JSC::DFG::MinifiedGraph::originalGraphSize):
5924 * dfg/DFGMinifiedNode.cpp: Added.
5925 (DFG):
5926 (JSC::DFG::MinifiedNode::fromNode):
5927 * dfg/DFGMinifiedNode.h: Added.
5928 (DFG):
5929 (JSC::DFG::belongsInMinifiedGraph):
5930 (MinifiedNode):
5931 (JSC::DFG::MinifiedNode::MinifiedNode):
5932 (JSC::DFG::MinifiedNode::index):
5933 (JSC::DFG::MinifiedNode::op):
5934 (JSC::DFG::MinifiedNode::hasChild1):
5935 (JSC::DFG::MinifiedNode::child1):
5936 (JSC::DFG::MinifiedNode::hasConstant):
5937 (JSC::DFG::MinifiedNode::hasConstantNumber):
5938 (JSC::DFG::MinifiedNode::constantNumber):
5939 (JSC::DFG::MinifiedNode::hasWeakConstant):
5940 (JSC::DFG::MinifiedNode::weakConstant):
5941 (JSC::DFG::MinifiedNode::getIndex):
5942 (JSC::DFG::MinifiedNode::compareByNodeIndex):
5943 (JSC::DFG::MinifiedNode::hasChild):
5944 * dfg/DFGNode.h:
5945 (Node):
5946 * dfg/DFGOSRExit.cpp:
5947 (JSC::DFG::OSRExit::OSRExit):
5948 * dfg/DFGOSRExit.h:
5949 (OSRExit):
5950 * dfg/DFGOSRExitCompiler.cpp:
5951 * dfg/DFGOSRExitCompiler.h:
5952 (OSRExitCompiler):
5953 * dfg/DFGOSRExitCompiler32_64.cpp:
5954 (JSC::DFG::OSRExitCompiler::compileExit):
5955 * dfg/DFGOSRExitCompiler64.cpp:
5956 (JSC::DFG::OSRExitCompiler::compileExit):
5957 * dfg/DFGPredictionPropagationPhase.cpp:
5958 (JSC::DFG::performPredictionPropagation):
5959 * dfg/DFGRedundantPhiEliminationPhase.cpp:
5960 (JSC::DFG::performRedundantPhiElimination):
5961 * dfg/DFGSpeculativeJIT.cpp:
5962 (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
5963 (DFG):
5964 (JSC::DFG::SpeculativeJIT::fillStorage):
5965 (JSC::DFG::SpeculativeJIT::noticeOSRBirth):
5966 (JSC::DFG::SpeculativeJIT::compileMovHint):
5967 (JSC::DFG::SpeculativeJIT::compile):
5968 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
5969 * dfg/DFGSpeculativeJIT.h:
5970 (DFG):
5971 (JSC::DFG::SpeculativeJIT::use):
5972 (SpeculativeJIT):
5973 (JSC::DFG::SpeculativeJIT::spill):
5974 (JSC::DFG::SpeculativeJIT::speculationCheck):
5975 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
5976 (JSC::DFG::SpeculativeJIT::recordSetLocal):
5977 * dfg/DFGSpeculativeJIT32_64.cpp:
5978 (JSC::DFG::SpeculativeJIT::fillInteger):
5979 (JSC::DFG::SpeculativeJIT::fillDouble):
5980 (JSC::DFG::SpeculativeJIT::fillJSValue):
5981 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
5982 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
5983 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
5984 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
5985 (JSC::DFG::SpeculativeJIT::compile):
5986 * dfg/DFGSpeculativeJIT64.cpp:
5987 (JSC::DFG::SpeculativeJIT::fillInteger):
5988 (JSC::DFG::SpeculativeJIT::fillDouble):
5989 (JSC::DFG::SpeculativeJIT::fillJSValue):
5990 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
5991 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
5992 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
5993 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
5994 (JSC::DFG::SpeculativeJIT::compile):
5995 * dfg/DFGValueRecoveryOverride.h: Added.
5996 (DFG):
5997 (ValueRecoveryOverride):
5998 (JSC::DFG::ValueRecoveryOverride::ValueRecoveryOverride):
5999 * dfg/DFGValueSource.cpp: Added.
6000 (DFG):
6001 (JSC::DFG::ValueSource::dump):
6002 * dfg/DFGValueSource.h: Added.
6003 (DFG):
6004 (JSC::DFG::dataFormatToValueSourceKind):
6005 (JSC::DFG::valueSourceKindToDataFormat):
6006 (JSC::DFG::isInRegisterFile):
6007 (ValueSource):
6008 (JSC::DFG::ValueSource::ValueSource):
6009 (JSC::DFG::ValueSource::forPrediction):
6010 (JSC::DFG::ValueSource::forDataFormat):
6011 (JSC::DFG::ValueSource::isSet):
6012 (JSC::DFG::ValueSource::kind):
6013 (JSC::DFG::ValueSource::isInRegisterFile):
6014 (JSC::DFG::ValueSource::dataFormat):
6015 (JSC::DFG::ValueSource::valueRecovery):
6016 (JSC::DFG::ValueSource::nodeIndex):
6017 (JSC::DFG::ValueSource::nodeIndexFromKind):
6018 (JSC::DFG::ValueSource::kindFromNodeIndex):
6019 * dfg/DFGVariableEvent.cpp: Added.
6020 (DFG):
6021 (JSC::DFG::VariableEvent::dump):
6022 (JSC::DFG::VariableEvent::dumpFillInfo):
6023 (JSC::DFG::VariableEvent::dumpSpillInfo):
6024 * dfg/DFGVariableEvent.h: Added.
6025 (DFG):
6026 (VariableEvent):
6027 (JSC::DFG::VariableEvent::VariableEvent):
6028 (JSC::DFG::VariableEvent::reset):
6029 (JSC::DFG::VariableEvent::fillGPR):
6030 (JSC::DFG::VariableEvent::fillPair):
6031 (JSC::DFG::VariableEvent::fillFPR):
6032 (JSC::DFG::VariableEvent::spill):
6033 (JSC::DFG::VariableEvent::death):
6034 (JSC::DFG::VariableEvent::setLocal):
6035 (JSC::DFG::VariableEvent::movHint):
6036 (JSC::DFG::VariableEvent::kind):
6037 (JSC::DFG::VariableEvent::nodeIndex):
6038 (JSC::DFG::VariableEvent::dataFormat):
6039 (JSC::DFG::VariableEvent::gpr):
6040 (JSC::DFG::VariableEvent::tagGPR):
6041 (JSC::DFG::VariableEvent::payloadGPR):
6042 (JSC::DFG::VariableEvent::fpr):
6043 (JSC::DFG::VariableEvent::virtualRegister):
6044 (JSC::DFG::VariableEvent::operand):
6045 (JSC::DFG::VariableEvent::variableRepresentation):
6046 * dfg/DFGVariableEventStream.cpp: Added.
6047 (DFG):
6048 (JSC::DFG::VariableEventStream::logEvent):
6049 (MinifiedGenerationInfo):
6050 (JSC::DFG::MinifiedGenerationInfo::MinifiedGenerationInfo):
6051 (JSC::DFG::MinifiedGenerationInfo::update):
6052 (JSC::DFG::VariableEventStream::reconstruct):
6053 * dfg/DFGVariableEventStream.h: Added.
6054 (DFG):
6055 (VariableEventStream):
6056 (JSC::DFG::VariableEventStream::appendAndLog):
6057 * dfg/DFGVirtualRegisterAllocationPhase.cpp:
6058 (JSC::DFG::performVirtualRegisterAllocation):
6059
60602012-07-02 Filip Pizlo <fpizlo@apple.com>
6061
fpizlo@apple.comaedde2e2012-07-03 00:10:08 +00006062 DFG::ArgumentsSimplificationPhase should assert that the PhantomArguments nodes it creates are not shouldGenerate()
6063 https://bugs.webkit.org/show_bug.cgi?id=90407
6064
6065 Reviewed by Mark Hahnenberg.
6066
6067 * dfg/DFGArgumentsSimplificationPhase.cpp:
6068 (JSC::DFG::ArgumentsSimplificationPhase::run):
6069
barraclough@apple.com15ab3352012-07-02 19:25:59 +000060702012-07-02 Gavin Barraclough <barraclough@apple.com>
6071
6072 Array.prototype.pop should throw if property is not configurable
6073 https://bugs.webkit.org/show_bug.cgi?id=75788
6074
6075 Rubber Stamped by Oliver Hunt.
6076
6077 No real bug here any more, but the error we throw sometimes has a misleading message.
6078
6079 * runtime/JSArray.cpp:
6080 (JSC::JSArray::pop):
6081
fpizlo@apple.com3aef57f2012-06-30 19:28:26 +000060822012-06-29 Filip Pizlo <fpizlo@apple.com>
6083
fpizlo@apple.com604d38a2012-07-01 03:54:49 +00006084 JSObject wastes too much memory on unused property slots
6085 https://bugs.webkit.org/show_bug.cgi?id=90255
6086
6087 Reviewed by Mark Hahnenberg.
6088
6089 Rolling back in after applying a simple fix: it appears that
6090 JSObject::setStructureAndReallocateStorageIfNecessary() was allocating more
6091 property storage than necessary. Fixing this appears to resolve the crash.
6092
6093 This does a few things:
6094
6095 - JSNonFinalObject no longer has inline property storage.
6096
6097 - Initial out-of-line property storage size is 4 slots for JSNonFinalObject,
6098 or 2x the inline storage for JSFinalObject.
6099
6100 - Property storage is only reallocated if it needs to be. Previously, we
6101 would reallocate the property storage on any transition where the original
6102 structure said shouldGrowProperyStorage(), but this led to spurious
6103 reallocations when doing transitionless property adds and there are
6104 deleted property slots available. That in turn led to crashes, because we
6105 would switch to out-of-line storage even if the capacity matched the
6106 criteria for inline storage.
6107
6108 - Inline JSFunction allocation is killed off because we don't have a good
6109 way of inlining property storage allocation. This didn't hurt performance.
6110 Killing off code is better than fixing it if that code wasn't doing any
6111 good.
6112
6113 This looks like a 1% progression on V8.
6114
6115 * interpreter/Interpreter.cpp:
6116 (JSC::Interpreter::privateExecute):
6117 * jit/JIT.cpp:
6118 (JSC::JIT::privateCompileSlowCases):
6119 * jit/JIT.h:
6120 * jit/JITInlineMethods.h:
6121 (JSC::JIT::emitAllocateBasicJSObject):
6122 (JSC):
6123 * jit/JITOpcodes.cpp:
6124 (JSC::JIT::emit_op_new_func):
6125 (JSC):
6126 (JSC::JIT::emit_op_new_func_exp):
6127 * runtime/JSFunction.cpp:
6128 (JSC::JSFunction::finishCreation):
6129 * runtime/JSObject.h:
6130 (JSC::JSObject::isUsingInlineStorage):
6131 (JSObject):
6132 (JSC::JSObject::finishCreation):
6133 (JSC):
6134 (JSC::JSNonFinalObject::hasInlineStorage):
6135 (JSNonFinalObject):
6136 (JSC::JSNonFinalObject::JSNonFinalObject):
6137 (JSC::JSNonFinalObject::finishCreation):
6138 (JSC::JSFinalObject::hasInlineStorage):
6139 (JSC::JSFinalObject::finishCreation):
6140 (JSC::JSObject::offsetOfInlineStorage):
6141 (JSC::JSObject::setPropertyStorage):
6142 (JSC::Structure::inlineStorageCapacity):
6143 (JSC::Structure::isUsingInlineStorage):
6144 (JSC::JSObject::putDirectInternal):
6145 (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
6146 (JSC::JSObject::putDirectWithoutTransition):
6147 * runtime/Structure.cpp:
6148 (JSC::Structure::Structure):
6149 (JSC::nextPropertyStorageCapacity):
6150 (JSC):
6151 (JSC::Structure::growPropertyStorageCapacity):
6152 (JSC::Structure::suggestedNewPropertyStorageSize):
6153 * runtime/Structure.h:
6154 (JSC::Structure::putWillGrowPropertyStorage):
6155 (Structure):
6156
61572012-06-29 Filip Pizlo <fpizlo@apple.com>
6158
fpizlo@apple.com3aef57f2012-06-30 19:28:26 +00006159 Webkit crashes in DFG on Google Docs when creating a new document
6160 https://bugs.webkit.org/show_bug.cgi?id=90209
6161
6162 Reviewed by Gavin Barraclough.
6163
6164 Don't attempt to short-circuit Phantom(GetLocal) if the GetLocal is for a
6165 captured variable.
6166
6167 * dfg/DFGCFGSimplificationPhase.cpp:
6168 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
6169
zandobersek@gmail.com069a2d32012-06-30 12:09:15 +000061702012-06-30 Zan Dobersek <zandobersek@gmail.com>
6171
6172 Unreviewed, rolling out r121605.
6173 http://trac.webkit.org/changeset/121605
6174 https://bugs.webkit.org/show_bug.cgi?id=90336
6175
6176 Changes caused flaky crashes in sputnik/Unicode tests on Apple
6177 WK1 and GTK Linux builders
6178
6179 * interpreter/Interpreter.cpp:
6180 (JSC::Interpreter::privateExecute):
6181 * jit/JIT.cpp:
6182 (JSC::JIT::privateCompileSlowCases):
6183 * jit/JIT.h:
6184 * jit/JITInlineMethods.h:
6185 (JSC::JIT::emitAllocateBasicJSObject):
6186 (JSC::JIT::emitAllocateJSFinalObject):
6187 (JSC):
6188 (JSC::JIT::emitAllocateJSFunction):
6189 * jit/JITOpcodes.cpp:
6190 (JSC::JIT::emit_op_new_func):
6191 (JSC::JIT::emitSlow_op_new_func):
6192 (JSC):
6193 (JSC::JIT::emit_op_new_func_exp):
6194 (JSC::JIT::emitSlow_op_new_func_exp):
6195 * runtime/JSFunction.cpp:
6196 (JSC::JSFunction::finishCreation):
6197 * runtime/JSObject.h:
6198 (JSC::JSObject::isUsingInlineStorage):
6199 (JSObject):
6200 (JSC::JSObject::finishCreation):
6201 (JSC):
6202 (JSNonFinalObject):
6203 (JSC::JSNonFinalObject::JSNonFinalObject):
6204 (JSC::JSNonFinalObject::finishCreation):
6205 (JSFinalObject):
6206 (JSC::JSFinalObject::finishCreation):
6207 (JSC::JSObject::offsetOfInlineStorage):
6208 (JSC::JSObject::setPropertyStorage):
6209 (JSC::Structure::isUsingInlineStorage):
6210 (JSC::JSObject::putDirectInternal):
6211 (JSC::JSObject::putDirectWithoutTransition):
6212 (JSC::JSObject::transitionTo):
6213 * runtime/Structure.cpp:
6214 (JSC::Structure::Structure):
6215 (JSC):
6216 (JSC::Structure::growPropertyStorageCapacity):
6217 (JSC::Structure::suggestedNewPropertyStorageSize):
6218 * runtime/Structure.h:
6219 (JSC::Structure::shouldGrowPropertyStorage):
6220 (JSC::Structure::propertyStorageSize):
6221
mhahnenberg@apple.com3100b432012-06-30 01:14:09 +000062222012-06-29 Mark Hahnenberg <mhahnenberg@apple.com>
6223
6224 Remove warning about protected values when the Heap is being destroyed
6225 https://bugs.webkit.org/show_bug.cgi?id=90302
6226
6227 Reviewed by Geoffrey Garen.
6228
6229 Having to do book-keeping about whether values allocated from a certain
6230 VM are or are not protected makes the JSC API much more difficult to use
6231 correctly. Clients should be able to throw an entire VM away and not have
6232 to worry about unprotecting all of the values that they protected earlier.
6233
6234 * heap/Heap.cpp:
6235 (JSC::Heap::lastChanceToFinalize):
6236
fpizlo@apple.com9243e792012-06-30 00:25:01 +000062372012-06-29 Filip Pizlo <fpizlo@apple.com>
6238
6239 JSObject wastes too much memory on unused property slots
6240 https://bugs.webkit.org/show_bug.cgi?id=90255
6241
6242 Reviewed by Mark Hahnenberg.
6243
6244 This does a few things:
6245
6246 - JSNonFinalObject no longer has inline property storage.
6247
6248 - Initial out-of-line property storage size is 4 slots for JSNonFinalObject,
6249 or 2x the inline storage for JSFinalObject.
6250
6251 - Property storage is only reallocated if it needs to be. Previously, we
6252 would reallocate the property storage on any transition where the original
6253 structure said shouldGrowProperyStorage(), but this led to spurious
6254 reallocations when doing transitionless property adds and there are
6255 deleted property slots available. That in turn led to crashes, because we
6256 would switch to out-of-line storage even if the capacity matched the
6257 criteria for inline storage.
6258
6259 - Inline JSFunction allocation is killed off because we don't have a good
6260 way of inlining property storage allocation. This didn't hurt performance.
6261 Killing off code is better than fixing it if that code wasn't doing any
6262 good.
6263
6264 This looks like a 1% progression on V8.
6265
6266 * interpreter/Interpreter.cpp:
6267 (JSC::Interpreter::privateExecute):
6268 * jit/JIT.cpp:
6269 (JSC::JIT::privateCompileSlowCases):
6270 * jit/JIT.h:
6271 * jit/JITInlineMethods.h:
6272 (JSC::JIT::emitAllocateBasicJSObject):
6273 (JSC):
6274 * jit/JITOpcodes.cpp:
6275 (JSC::JIT::emit_op_new_func):
6276 (JSC):
6277 (JSC::JIT::emit_op_new_func_exp):
6278 * runtime/JSFunction.cpp:
6279 (JSC::JSFunction::finishCreation):
6280 * runtime/JSObject.h:
6281 (JSC::JSObject::isUsingInlineStorage):
6282 (JSObject):
6283 (JSC::JSObject::finishCreation):
6284 (JSC):
6285 (JSC::JSNonFinalObject::hasInlineStorage):
6286 (JSNonFinalObject):
6287 (JSC::JSNonFinalObject::JSNonFinalObject):
6288 (JSC::JSNonFinalObject::finishCreation):
6289 (JSC::JSFinalObject::hasInlineStorage):
6290 (JSC::JSFinalObject::finishCreation):
6291 (JSC::JSObject::offsetOfInlineStorage):
6292 (JSC::JSObject::setPropertyStorage):
6293 (JSC::Structure::inlineStorageCapacity):
6294 (JSC::Structure::isUsingInlineStorage):
6295 (JSC::JSObject::putDirectInternal):
6296 (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
6297 (JSC::JSObject::putDirectWithoutTransition):
6298 * runtime/Structure.cpp:
6299 (JSC::Structure::Structure):
6300 (JSC::nextPropertyStorageCapacity):
6301 (JSC):
6302 (JSC::Structure::growPropertyStorageCapacity):
6303 (JSC::Structure::suggestedNewPropertyStorageSize):
6304 * runtime/Structure.h:
6305 (JSC::Structure::putWillGrowPropertyStorage):
6306 (Structure):
6307
fpizlo@apple.com48a964b2012-06-29 02:40:14 +000063082012-06-28 Filip Pizlo <fpizlo@apple.com>
6309
6310 DFG recompilation heuristics should be based on count, not rate
6311 https://bugs.webkit.org/show_bug.cgi?id=90146
6312
6313 Reviewed by Oliver Hunt.
6314
6315 This removes a bunch of code that was previously trying to prevent spurious
6316 reoptimizations if a large enough majority of executions of a code block did
6317 not result in OSR exit. It turns out that this code was purely harmful. This
6318 patch removes all of that logic and replaces it with a dead-simple
6319 heuristic: if you exit more than N times (where N is an exponential function
6320 of the number of times the code block has already been recompiled) then we
6321 will recompile.
6322
6323 This appears to be a broad ~1% win on many benchmarks large and small.
6324
6325 * bytecode/CodeBlock.cpp:
6326 (JSC::CodeBlock::CodeBlock):
6327 * bytecode/CodeBlock.h:
6328 (JSC::CodeBlock::osrExitCounter):
6329 (JSC::CodeBlock::countOSRExit):
6330 (CodeBlock):
6331 (JSC::CodeBlock::addressOfOSRExitCounter):
6332 (JSC::CodeBlock::offsetOfOSRExitCounter):
6333 (JSC::CodeBlock::adjustedExitCountThreshold):
6334 (JSC::CodeBlock::exitCountThresholdForReoptimization):
6335 (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
6336 (JSC::CodeBlock::shouldReoptimizeNow):
6337 (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
6338 * bytecode/ExecutionCounter.cpp:
6339 (JSC::ExecutionCounter::setThreshold):
6340 * bytecode/ExecutionCounter.h:
6341 (ExecutionCounter):
6342 (JSC::ExecutionCounter::clippedThreshold):
6343 * dfg/DFGJITCompiler.cpp:
6344 (JSC::DFG::JITCompiler::compileBody):
6345 * dfg/DFGOSRExit.cpp:
6346 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
6347 * dfg/DFGOSRExitCompiler.cpp:
6348 (JSC::DFG::OSRExitCompiler::handleExitCounts):
6349 * dfg/DFGOperations.cpp:
6350 * jit/JITStubs.cpp:
6351 (JSC::DEFINE_STUB_FUNCTION):
6352 * runtime/Options.cpp:
6353 (Options):
6354 (JSC::Options::initializeOptions):
6355 * runtime/Options.h:
6356 (Options):
6357
commit-queue@webkit.org97ee82b2012-06-28 23:03:07 +000063582012-06-28 Mark Lam <mark.lam@apple.com>
6359
6360 Adding a commenting utility to record BytecodeGenerator comments
6361 with opcodes that are emitted. Presently, the comments can only
6362 be constant strings. Adding comments for opcodes is optional.
6363 If a comment is added, the comment will be printed following the
6364 opcode when CodeBlock::dump() is called.
6365
6366 This utility is disabled by default, and is only meant for VM
6367 development purposes. It should not be enabled for product builds.
6368
6369 To enable this utility, set ENABLE_BYTECODE_COMMENTS in CodeBlock.h
6370 to 1.
6371
6372 https://bugs.webkit.org/show_bug.cgi?id=90095
6373
6374 Reviewed by Geoffrey Garen.
6375
6376 * GNUmakefile.list.am:
6377 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
6378 * JavaScriptCore.xcodeproj/project.pbxproj:
6379 * bytecode/CodeBlock.cpp:
6380 (JSC::CodeBlock::dumpBytecodeCommentAndNewLine): Dumps the comment.
6381 (JSC):
6382 (JSC::CodeBlock::printUnaryOp): Add comment dumps.
6383 (JSC::CodeBlock::printBinaryOp): Add comment dumps.
6384 (JSC::CodeBlock::printConditionalJump): Add comment dumps.
6385 (JSC::CodeBlock::printCallOp): Add comment dumps.
6386 (JSC::CodeBlock::printPutByIdOp): Add comment dumps.
6387 (JSC::CodeBlock::dump): Add comment dumps.
6388 (JSC::CodeBlock::CodeBlock):
6389 (JSC::CodeBlock::commentForBytecodeOffset):
6390 Finds the comment for an opcode if available.
6391 (JSC::CodeBlock::dumpBytecodeComments):
6392 For debugging whether comments are collected.
6393 It is not being called anywhere.
6394 * bytecode/CodeBlock.h:
6395 (CodeBlock):
6396 (JSC::CodeBlock::bytecodeComments):
6397 * bytecode/Comment.h: Added.
6398 (JSC):
6399 (Comment):
6400 * bytecompiler/BytecodeGenerator.cpp:
6401 (JSC::BytecodeGenerator::BytecodeGenerator):
6402 (JSC::BytecodeGenerator::emitOpcode): Calls emitComment().
6403 (JSC):
6404 (JSC::BytecodeGenerator::emitComment): Adds comment to CodeBlock.
6405 (JSC::BytecodeGenerator::prependComment):
6406 Registers a comment for emitComemnt() to use later.
6407 * bytecompiler/BytecodeGenerator.h:
6408 (BytecodeGenerator):
6409 (JSC::BytecodeGenerator::emitComment):
6410 (JSC::BytecodeGenerator::prependComment):
6411 These are inlined versions of these functions that nullify them
6412 when ENABLE_BYTECODE_COMMENTS is 0.
6413 (JSC::BytecodeGenerator::comments):
6414
oliver@apple.com41383bc2012-06-28 20:54:06 +000064152012-06-28 Oliver Hunt <oliver@apple.com>
6416
6417 32bit DFG incorrectly claims an fpr is fillable even if it has not been proven double
6418 https://bugs.webkit.org/show_bug.cgi?id=90127
6419
6420 Reviewed by Filip Pizlo.
6421
6422 The 32-bit version of fillSpeculateDouble doesn't handle Number->fpr loads
6423 correctly. This patch fixes this by killing the fill info in the GenerationInfo
6424 when the spillFormat doesn't guarantee the value is a double.
6425
6426 * dfg/DFGSpeculativeJIT32_64.cpp:
6427 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
6428
tkent@chromium.orgb53db042012-06-28 08:48:20 +000064292012-06-28 Kent Tamura <tkent@chromium.org>
6430
6431 Classify form control states by their owner forms
6432 https://bugs.webkit.org/show_bug.cgi?id=89950
6433
6434 Reviewed by Hajime Morita.
6435
6436 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6437 Expose WTF::StringBuilder::canShrink()
6438
msaboff@apple.comff141582012-06-28 01:14:20 +000064392012-06-27 Michael Saboff <msaboff@apple.com>
6440
6441 [Win] jscore-tests flakey
6442 https://bugs.webkit.org/show_bug.cgi?id=88118
6443
6444 Reviewed by Jessie Berlin.
6445
6446 jsDriver.pl on windows intermittently doesn't get the returned value from jsc,
6447 instead it gets 126. Added a new option to jsc (-x) which prints the exit
6448 code before exiting. jsDriver.pl uses this option on Windows and parses the
6449 exit code output for the exit code, removing it before comparing the actual
6450 and expected outputs. Filed a follow on "FIXME" defect:
6451 [WIN] Intermittent failure for jsc return value to propagate through jsDriver.pl
6452 https://bugs.webkit.org/show_bug.cgi?id=90119
6453
6454 * jsc.cpp:
6455 (CommandLine::CommandLine):
6456 (CommandLine):
6457 (printUsageStatement):
6458 (parseArguments):
6459 (jscmain):
6460 * tests/mozilla/jsDriver.pl:
6461 (execute_tests):
6462
commit-queue@webkit.orge12e2f32012-06-28 01:09:22 +000064632012-06-27 Sheriff Bot <webkit.review.bot@gmail.com>
6464
6465 Unreviewed, rolling out r121359.
6466 http://trac.webkit.org/changeset/121359
6467 https://bugs.webkit.org/show_bug.cgi?id=90115
6468
6469 Broke many inspector tests (Requested by jpfau on #webkit).
6470
6471 * interpreter/Interpreter.h:
6472 (JSC::StackFrame::toString):
6473
fpizlo@apple.com12c18392012-06-27 23:16:10 +000064742012-06-27 Filip Pizlo <fpizlo@apple.com>
6475
fpizlo@apple.comc01022e2012-06-28 00:49:55 +00006476 Javascript SHA-512 gives wrong hash on second and subsequent runs unless Web Inspector Javascript Debugging is on
6477 https://bugs.webkit.org/show_bug.cgi?id=90053
6478 <rdar://problem/11764613>
6479
6480 Reviewed by Mark Hahnenberg.
6481
6482 The problem is that the code was assuming that the recovery should be Undefined if the source of
6483 the SetLocal was !shouldGenerate(). But that's wrong, since the DFG optimizer may skip around a
6484 UInt32ToNumber node (hence making it !shouldGenerate()) and keep the source of that node alive.
6485 In that case we should base the recovery on the source of the UInt32ToNumber. The logic for this
6486 was already in place but the fast check for !shouldGenerate() broke it.
6487
6488 * dfg/DFGSpeculativeJIT.cpp:
6489 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
6490
64912012-06-27 Filip Pizlo <fpizlo@apple.com>
6492
fpizlo@apple.com12c18392012-06-27 23:16:10 +00006493 DFG disassembly should be easier to read
6494 https://bugs.webkit.org/show_bug.cgi?id=90106
6495
6496 Reviewed by Mark Hahnenberg.
6497
6498 Did a few things:
6499
6500 - Options::showDFGDisassembly now shows OSR exit disassembly as well.
6501
6502 - Phi node dumping doesn't attempt to do line wrapping since it just made the dump harder
6503 to read.
6504
6505 - DFG graph disassembly view shows a few additional node types that turn out to be
6506 essential for understanding OSR exits.
6507
6508 Put together, these changes reinforce the philosophy that anything needed for computing
6509 OSR exit is just as important as the machine code itself. Of course, we still don't take
6510 that philosophy to its full extreme - for example Phantom nodes are not dumped. We may
6511 revisit that in the future.
6512
6513 * assembler/LinkBuffer.cpp:
6514 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
6515 * assembler/LinkBuffer.h:
6516 (JSC):
6517 * dfg/DFGDisassembler.cpp:
6518 (JSC::DFG::Disassembler::dump):
6519 * dfg/DFGGraph.cpp:
6520 (JSC::DFG::Graph::dumpBlockHeader):
6521 * dfg/DFGNode.h:
6522 (JSC::DFG::Node::willHaveCodeGenOrOSR):
6523 * dfg/DFGOSRExitCompiler.cpp:
6524 * jit/JIT.cpp:
6525 (JSC::JIT::privateCompile):
6526
mhahnenberg@apple.come16f8092012-06-27 23:08:26 +000065272012-06-25 Mark Hahnenberg <mhahnenberg@apple.com>
6528
6529 JSLock should be per-JSGlobalData
6530 https://bugs.webkit.org/show_bug.cgi?id=89123
6531
6532 Reviewed by Geoffrey Garen.
6533
6534 * API/APIShims.h:
6535 (APIEntryShimWithoutLock):
6536 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Added an extra parameter to the constructor to
6537 determine whether we should ref the JSGlobalData or not. We want to ref all the time except for in the
6538 HeapTimer class because timerDidFire could run after somebody has started to tear down that particular
6539 JSGlobalData, so we wouldn't want to resurrect the ref count of that JSGlobalData from 0 back to 1 after
6540 its destruction has begun.
6541 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
6542 (JSC::APIEntryShim::APIEntryShim):
6543 (APIEntryShim):
6544 (JSC::APIEntryShim::~APIEntryShim):
6545 (JSC::APIEntryShim::init): Factored out common initialization code for the various APIEntryShim constructors.
6546 Also moved the timeoutChecker stop and start here because we need to start after we've grabbed the API lock
6547 and before we've released it, which can only done in APIEntryShim.
6548 (JSC::APICallbackShim::~APICallbackShim): We no longer need to synchronize here.
6549 * API/JSContextRef.cpp:
6550 (JSGlobalContextCreate):
6551 (JSGlobalContextCreateInGroup):
6552 (JSGlobalContextRelease):
6553 (JSContextCreateBacktrace):
6554 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6555 * heap/CopiedSpace.cpp:
6556 (JSC::CopiedSpace::tryAllocateSlowCase):
6557 * heap/Heap.cpp:
6558 (JSC::Heap::protect):
6559 (JSC::Heap::unprotect):
6560 (JSC::Heap::collect):
6561 (JSC::Heap::setActivityCallback):
6562 (JSC::Heap::activityCallback):
6563 (JSC::Heap::sweeper):
6564 * heap/Heap.h: Changed m_activityCallback and m_sweeper to be raw pointers rather than OwnPtrs because they
6565 are now responsible for their own lifetime. Also changed the order of declaration of the GCActivityCallback
6566 and the IncrementalSweeper to make sure they're the last things that get initialized during construction to
6567 prevent any issues with uninitialized memory in the JSGlobalData/Heap they might care about.
6568 (Heap):
6569 * heap/HeapTimer.cpp: Refactored to allow for thread-safe operation and shutdown.
6570 (JSC::HeapTimer::~HeapTimer):
6571 (JSC::HeapTimer::invalidate):
6572 (JSC):
6573 (JSC::HeapTimer::didStartVMShutdown): Called at the beginning of ~JSGlobalData. If we're on the same thread
6574 that the HeapTimer is running on, we kill the HeapTimer ourselves. If not, then we set some state in the
6575 HeapTimer and schedule it to fire immediately so that it can notice and kill itself.
6576 (JSC::HeapTimer::timerDidFire): We grab our mutex and check our JSGlobalData pointer. If it has been zero-ed
6577 out, then we know the VM has started to shutdown and we should kill ourselves. Otherwise, grab the APIEntryShim,
6578 but without ref-ing the JSGlobalData (we don't want to bring the JSGlobalData's ref-count from 0 to 1) in case
6579 we were interrupted between releasing our mutex and trying to grab the APILock.
6580 * heap/HeapTimer.h:
6581 (HeapTimer):
6582 * heap/IncrementalSweeper.cpp:
6583 (JSC::IncrementalSweeper::doWork): We no longer need the API shim here since HeapTimer::timerDidFire handles
6584 all of that for us.
6585 (JSC::IncrementalSweeper::create):
6586 * heap/IncrementalSweeper.h:
6587 (IncrementalSweeper):
6588 * heap/MarkedAllocator.cpp:
6589 (JSC::MarkedAllocator::allocateSlowCase):
6590 * heap/WeakBlock.cpp:
6591 (JSC::WeakBlock::reap):
6592 * jsc.cpp:
6593 (functionGC):
6594 (functionReleaseExecutableMemory):
6595 (jscmain):
6596 * runtime/Completion.cpp:
6597 (JSC::checkSyntax):
6598 (JSC::evaluate):
6599 * runtime/GCActivityCallback.h:
6600 (DefaultGCActivityCallback):
6601 (JSC::DefaultGCActivityCallback::create):
6602 * runtime/JSGlobalData.cpp:
6603 (JSC::JSGlobalData::JSGlobalData):
6604 (JSC::JSGlobalData::~JSGlobalData): Signals to the two HeapTimers (GCActivityCallback and IncrementalSweeper)
6605 that the VM has started shutting down. It then waits until the HeapTimer is done with whatever activity
6606 it needs to do before continuing with any further destruction. Also asserts that we do not currently hold the
6607 APILock because this could potentially cause deadlock when we try to signal to the HeapTimers using their mutexes.
6608 (JSC::JSGlobalData::sharedInstance): Protect the initialization for the shared instance with the GlobalJSLock.
6609 (JSC::JSGlobalData::sharedInstanceInternal):
6610 * runtime/JSGlobalData.h: Change to be ThreadSafeRefCounted so that we don't have to worry about refing and
6611 de-refing JSGlobalDatas on separate threads since we don't do it that often anyways.
6612 (JSGlobalData):
6613 (JSC::JSGlobalData::apiLock):
6614 * runtime/JSGlobalObject.cpp:
6615 (JSC::JSGlobalObject::~JSGlobalObject):
6616 (JSC::JSGlobalObject::init):
6617 * runtime/JSLock.cpp:
6618 (JSC):
6619 (JSC::GlobalJSLock::GlobalJSLock): For accessing the shared instance.
6620 (JSC::GlobalJSLock::~GlobalJSLock):
6621 (JSC::JSLockHolder::JSLockHolder): MutexLocker for JSLock. Also refs the JSGlobalData to keep it alive so that
6622 it can successfully unlock it later without it disappearing from underneath it.
6623 (JSC::JSLockHolder::~JSLockHolder):
6624 (JSC::JSLock::JSLock):
6625 (JSC::JSLock::~JSLock):
6626 (JSC::JSLock::lock): Uses the spin lock for guarding the lock count and owner thread fields. Uses the mutex for
6627 actually waiting for long periods.
6628 (JSC::JSLock::unlock):
6629 (JSC::JSLock::currentThreadIsHoldingLock):
6630 (JSC::JSLock::dropAllLocks):
6631 (JSC::JSLock::dropAllLocksUnconditionally):
6632 (JSC::JSLock::grabAllLocks):
6633 (JSC::JSLock::DropAllLocks::DropAllLocks):
6634 (JSC::JSLock::DropAllLocks::~DropAllLocks):
6635 * runtime/JSLock.h:
6636 (JSC):
6637 (GlobalJSLock):
6638 (JSLockHolder):
6639 (JSLock):
6640 (DropAllLocks):
6641 * runtime/WeakGCMap.h:
6642 (JSC::WeakGCMap::set):
6643 * testRegExp.cpp:
6644 (realMain):
6645
fpizlo@apple.coma8de6ba2012-06-27 21:25:23 +000066462012-06-27 Filip Pizlo <fpizlo@apple.com>
6647
fpizlo@apple.com4a4978b2012-06-27 21:45:08 +00006648 x86 disassembler confuses immediates with addresses
6649 https://bugs.webkit.org/show_bug.cgi?id=90099
6650
6651 Reviewed by Mark Hahnenberg.
6652
6653 Prepend "$" to immediates to disambiguate between immediates and addresses. This is in
6654 accordance with the gas and AT&T syntax.
6655
6656 * disassembler/udis86/udis86_syn-att.c:
6657 (gen_operand):
6658
66592012-06-27 Filip Pizlo <fpizlo@apple.com>
6660
fpizlo@apple.coma8de6ba2012-06-27 21:25:23 +00006661 Add a comment clarifying Options::showDisassembly versus Options::showDFGDisassembly.
6662
6663 Rubber stamped by Mark Hahnenberg.
6664
6665 * runtime/Options.cpp:
6666 (JSC::Options::initializeOptions):
6667
commit-queue@webkit.org50c978a2012-06-27 19:54:48 +000066682012-06-27 Anthony Scian <ascian@rim.com>
6669
6670 Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
6671 https://bugs.webkit.org/show_bug.cgi?id=40118
6672
6673 Reviewed by Yong Li.
6674
6675 Added member functions to expose function name, urlString, and line #.
6676 Refactored toString to make use of these member functions to reduce
6677 duplicated code for future maintenance.
6678
6679 Manually tested refactoring of toString by tracing thrown exceptions.
6680
6681 * interpreter/Interpreter.h:
6682 (StackFrame):
6683 (JSC::StackFrame::toString):
6684 (JSC::StackFrame::friendlySourceURL):
6685 (JSC::StackFrame::friendlyFunctionName):
6686 (JSC::StackFrame::friendlyLineNumber):
6687
vestbo@webkit.org36e47da2012-06-27 13:02:03 +000066882012-06-27 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
6689
6690 [Qt] Remove redundant c++11 warning suppression code
6691
6692 This is already handled in default_post.
6693
6694 Reviewed by Tor Arne Vestbø.
6695
6696 * Target.pri:
6697
vestbo@webkit.orgcaf4d2f2012-06-27 11:30:42 +000066982012-06-26 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
6699
6700 [Qt] Add missing heades to HEADERS
6701
6702 For JavaScriptCore there aren't any Qt specific files, so we include all
6703 headers for easy editing in Qt Creator.
6704
6705 Reviewed by Simon Hausmann.
6706
6707 * Target.pri:
6708
dominicc@chromium.org5940f722012-06-27 09:44:31 +000067092012-06-26 Dominic Cooney <dominicc@chromium.org>
6710
6711 [Chromium] Remove unused build scripts and empty folders for JavaScriptCore w/ gyp
6712 https://bugs.webkit.org/show_bug.cgi?id=90029
6713
6714 Reviewed by Adam Barth.
6715
6716 * gyp: Removed.
6717 * gyp/generate-derived-sources.sh: Removed.
6718 * gyp/generate-dtrace-header.sh: Removed.
6719 * gyp/run-if-exists.sh: Removed.
6720 * gyp/update-info-plist.sh: Removed.
6721
ggaren@apple.com6b348072012-06-27 03:44:05 +000067222012-06-26 Geoffrey Garen <ggaren@apple.com>
6723
6724 Reduced (but did not eliminate) use of "berzerker GC"
6725 https://bugs.webkit.org/show_bug.cgi?id=89237
6726
6727 Reviewed by Gavin Barraclough.
6728
6729 (PART 2)
6730
6731 This part turns off "berzerker GC" and turns on incremental shrinking.
6732
6733 * heap/IncrementalSweeper.cpp:
6734 (JSC::IncrementalSweeper::doSweep): Free or shrink after sweeping to
6735 maintain the behavior we used to get from the occasional berzerker GC,
6736 which would run all finalizers and then free or shrink all blocks
6737 synchronously.
6738
6739 * heap/MarkedBlock.h:
6740 (JSC::MarkedBlock::needsSweeping): Sweep zapped blocks, too. It's always
6741 safe to sweep a zapped block (that's the point of zapping), and it's
6742 sometimes profitable. For example, consider this case: Block A does some
6743 allocation (transitioning Block A from Marked to FreeListed), then GC
6744 happens (transitioning Block A to Zapped), then all objects in Block A
6745 are free, then the incremental sweeper visits Block A. If we skipped
6746 Zapped blocks, we'd skip Block A, even though it would be profitable to
6747 run its destructors and free its memory.
6748
6749 * runtime/GCActivityCallback.cpp:
6750 (JSC::DefaultGCActivityCallback::doWork): Don't sweep eagerly; we'll do
6751 this incrementally.
6752
fpizlo@apple.com580d9d72012-06-27 01:34:01 +000067532012-06-26 Filip Pizlo <fpizlo@apple.com>
6754
6755 DFG PutByValAlias is too aggressive
6756 https://bugs.webkit.org/show_bug.cgi?id=90026
6757 <rdar://problem/11751830>
6758
6759 Reviewed by Gavin Barraclough.
6760
6761 For CSE on normal arrays, we now treat PutByVal as impure. This does not appear to affect
6762 performance by much.
6763
6764 For CSE on typed arrays, we fix PutByValAlias by making GetByVal speculate that the access
6765 is within bounds. This also has the effect of making our out-of-bounds handling consistent
6766 with WebCore.
6767
6768 * dfg/DFGCSEPhase.cpp:
6769 (JSC::DFG::CSEPhase::performNodeCSE):
6770 * dfg/DFGGraph.h:
6771 (JSC::DFG::Graph::byValIsPure):
6772 (JSC::DFG::Graph::clobbersWorld):
6773 * dfg/DFGNodeType.h:
6774 (DFG):
6775 * dfg/DFGSpeculativeJIT.cpp:
6776 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
6777 (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
6778
commit-queue@webkit.org63a25eb2012-06-26 19:55:32 +000067792012-06-26 Yong Li <yoli@rim.com>
6780
6781 [BlackBerry] Add JSC statistics into about:memory
6782 https://bugs.webkit.org/show_bug.cgi?id=89779
6783
6784 Reviewed by Rob Buis.
6785
6786 Fix non-JIT build on BlackBerry broken by r121196.
6787
6788 * runtime/MemoryStatistics.cpp:
6789 (JSC::globalMemoryStatistics):
6790
fpizlo@apple.com6c89cd32012-06-26 19:42:05 +000067912012-06-25 Filip Pizlo <fpizlo@apple.com>
6792
6793 DFG::operationNewArray is unnecessarily slow, and may use the wrong array
6794 prototype when inlined
6795 https://bugs.webkit.org/show_bug.cgi?id=89821
6796
6797 Reviewed by Geoffrey Garen.
6798
6799 Fixes all array allocations to use the right structure, and hence the right prototype. Adds
6800 inlining of new Array(...) with a non-zero number of arguments. Optimizes allocations of
6801 empty arrays.
6802
6803 * dfg/DFGAbstractState.cpp:
6804 (JSC::DFG::AbstractState::execute):
6805 * dfg/DFGByteCodeParser.cpp:
6806 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
6807 * dfg/DFGCCallHelpers.h:
6808 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
6809 (CCallHelpers):
6810 * dfg/DFGNodeType.h:
6811 (DFG):
6812 * dfg/DFGOperations.cpp:
6813 * dfg/DFGOperations.h:
6814 * dfg/DFGPredictionPropagationPhase.cpp:
6815 (JSC::DFG::PredictionPropagationPhase::propagate):
6816 * dfg/DFGSpeculativeJIT.h:
6817 (JSC::DFG::SpeculativeJIT::callOperation):
6818 * dfg/DFGSpeculativeJIT32_64.cpp:
6819 (JSC::DFG::SpeculativeJIT::compile):
6820 * dfg/DFGSpeculativeJIT64.cpp:
6821 (JSC::DFG::SpeculativeJIT::compile):
6822 * runtime/JSArray.h:
6823 (JSC):
6824 (JSC::constructArray):
6825 * runtime/JSGlobalObject.h:
6826 (JSC):
6827 (JSC::constructArray):
6828
fpizlo@apple.com0b6ad50752012-06-26 09:22:45 +000068292012-06-26 Filip Pizlo <fpizlo@apple.com>
6830
6831 New fast/js/dfg-store-unexpected-value-into-argument-and-osr-exit.html fails on 32 bit
6832 https://bugs.webkit.org/show_bug.cgi?id=89953
6833
6834 Reviewed by Zoltan Herczeg.
6835
6836 DFG 32-bit JIT was confused about the difference between a predicted type and a
6837 proven type. This is easy to get confused about, since a local that is predicted int32
6838 almost always means that the local must be an int32 since speculations are hoisted to
6839 stores to locals. But that is less likely to be the case for arguments, where there is
6840 an additional least-upper-bounding step: any store to an argument with a weird type
6841 may force the argument to be any type.
6842
6843 This patch basically duplicates the functionality in DFGSpeculativeJIT64.cpp for
6844 GetLocal: the decision of whether to load a local as an int32 (or as an array, or as
6845 a boolean) is made based on the AbstractValue::m_type, which is a type proof, rather
6846 than the VariableAccessData::prediction(), which is a predicted type.
6847
6848 * dfg/DFGSpeculativeJIT32_64.cpp:
6849 (JSC::DFG::SpeculativeJIT::compile):
6850
fpizlo@apple.com41a1f0e2012-06-26 02:53:39 +000068512012-06-25 Filip Pizlo <fpizlo@apple.com>
6852
6853 JSC should try to make profiling deterministic because otherwise reproducing failures is
6854 nearly impossible
6855 https://bugs.webkit.org/show_bug.cgi?id=89940
6856
6857 Rubber stamped by Gavin Barraclough.
6858
6859 This rolls out the part of http://trac.webkit.org/changeset/121215 that introduced randomness
6860 into the system. Now, instead of randomizing the tier-up threshold, we always set it to an
6861 artificially low (and statically predetermined!) value. This gives most of the benefit of
6862 threshold randomization without actually making the system behave completely differently on
6863 each invocation.
6864
6865 * bytecode/ExecutionCounter.cpp:
6866 (JSC::ExecutionCounter::setThreshold):
6867 * runtime/Options.cpp:
6868 (Options):
6869 (JSC::Options::initializeOptions):
6870 * runtime/Options.h:
6871 (Options):
6872
fpizlo@apple.com3745dbc2012-06-26 02:14:07 +000068732012-06-22 Filip Pizlo <fpizlo@apple.com>
6874
6875 Value profiling should use tier-up threshold randomization to get more coverage
6876 https://bugs.webkit.org/show_bug.cgi?id=89802
6877
6878 Reviewed by Gavin Barraclough.
6879
6880 This patch causes both LLInt and Baseline JIT code to take the OSR slow path several
6881 times before actually doing OSR. If we take the OSR slow path before the execution
6882 count threshold is reached, then we just call CodeBlock::updateAllPredictions() to
6883 compute the current latest least-upper-bound SpecType of all values seen in each
6884 ValueProfile.
6885
6886 * bytecode/CodeBlock.cpp:
6887 (JSC::CodeBlock::stronglyVisitStrongReferences):
6888 (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
6889 (JSC):
6890 (JSC::CodeBlock::updateAllPredictions):
6891 (JSC::CodeBlock::shouldOptimizeNow):
6892 * bytecode/CodeBlock.h:
6893 (JSC::CodeBlock::llintExecuteCounter):
6894 (JSC::CodeBlock::jitExecuteCounter):
6895 (CodeBlock):
6896 (JSC::CodeBlock::updateAllPredictions):
6897 * bytecode/ExecutionCounter.cpp:
6898 (JSC::ExecutionCounter::setThreshold):
6899 (JSC::ExecutionCounter::status):
6900 (JSC):
6901 * bytecode/ExecutionCounter.h:
6902 (JSC::ExecutionCounter::count):
6903 (ExecutionCounter):
6904 * dfg/DFGAbstractState.cpp:
6905 (JSC::DFG::AbstractState::execute):
6906 * dfg/DFGOperations.cpp:
6907 * dfg/DFGSpeculativeJIT.cpp:
6908 (JSC::DFG::SpeculativeJIT::compile):
6909 * jit/JITStubs.cpp:
6910 (JSC::DEFINE_STUB_FUNCTION):
6911 * llint/LLIntSlowPaths.cpp:
6912 (JSC::LLInt::jitCompileAndSetHeuristics):
6913 (JSC::LLInt::entryOSR):
6914 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
6915 * runtime/JSGlobalObject.cpp:
6916 (JSC::JSGlobalObject::JSGlobalObject):
6917 (JSC):
6918 * runtime/JSGlobalObject.h:
6919 (JSGlobalObject):
6920 (JSC::JSGlobalObject::weakRandomInteger):
6921 * runtime/Options.cpp:
6922 (Options):
6923 (JSC::Options::initializeOptions):
6924 * runtime/Options.h:
6925 (Options):
6926 * runtime/WeakRandom.h:
6927 (WeakRandom):
6928 (JSC::WeakRandom::seedUnsafe):
6929
commit-queue@webkit.orgd3790912012-06-26 00:08:19 +000069302012-06-25 Yong Li <yoli@rim.com>
6931
6932 [BlackBerry] Add JSC statistics into about:memory
6933 https://bugs.webkit.org/show_bug.cgi?id=89779
6934
6935 Reviewed by Rob Buis.
6936
6937 Add MemoryStatistics.cpp into build, and fill JITBytes for BlackBerry port.
6938
6939 * PlatformBlackBerry.cmake:
6940 * runtime/MemoryStatistics.cpp:
6941 (JSC::globalMemoryStatistics):
6942
zandobersek@gmail.coma6460e12012-06-23 13:41:40 +000069432012-06-23 Sheriff Bot <webkit.review.bot@gmail.com>
6944
6945 Unreviewed, rolling out r121058.
6946 http://trac.webkit.org/changeset/121058
6947 https://bugs.webkit.org/show_bug.cgi?id=89809
6948
6949 Patch causes plugins tests to crash in GTK debug builds
6950 (Requested by zdobersek on #webkit).
6951
6952 * API/APIShims.h:
6953 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
6954 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
6955 (APIEntryShimWithoutLock):
6956 (JSC::APIEntryShim::APIEntryShim):
6957 (APIEntryShim):
6958 (JSC::APICallbackShim::~APICallbackShim):
6959 * API/JSContextRef.cpp:
6960 (JSGlobalContextCreate):
6961 (JSGlobalContextCreateInGroup):
6962 (JSGlobalContextRelease):
6963 (JSContextCreateBacktrace):
6964 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
6965 * heap/CopiedSpace.cpp:
6966 (JSC::CopiedSpace::tryAllocateSlowCase):
6967 * heap/Heap.cpp:
6968 (JSC::Heap::protect):
6969 (JSC::Heap::unprotect):
6970 (JSC::Heap::collect):
6971 (JSC::Heap::setActivityCallback):
6972 (JSC::Heap::activityCallback):
6973 (JSC::Heap::sweeper):
6974 * heap/Heap.h:
6975 (Heap):
6976 * heap/HeapTimer.cpp:
6977 (JSC::HeapTimer::~HeapTimer):
6978 (JSC::HeapTimer::invalidate):
6979 (JSC::HeapTimer::timerDidFire):
6980 (JSC):
6981 * heap/HeapTimer.h:
6982 (HeapTimer):
6983 * heap/IncrementalSweeper.cpp:
6984 (JSC::IncrementalSweeper::doWork):
6985 (JSC::IncrementalSweeper::create):
6986 * heap/IncrementalSweeper.h:
6987 (IncrementalSweeper):
6988 * heap/MarkedAllocator.cpp:
6989 (JSC::MarkedAllocator::allocateSlowCase):
6990 * heap/WeakBlock.cpp:
6991 (JSC::WeakBlock::reap):
6992 * jsc.cpp:
6993 (functionGC):
6994 (functionReleaseExecutableMemory):
6995 (jscmain):
6996 * runtime/Completion.cpp:
6997 (JSC::checkSyntax):
6998 (JSC::evaluate):
6999 * runtime/GCActivityCallback.h:
7000 (DefaultGCActivityCallback):
7001 (JSC::DefaultGCActivityCallback::create):
7002 * runtime/JSGlobalData.cpp:
7003 (JSC::JSGlobalData::JSGlobalData):
7004 (JSC::JSGlobalData::~JSGlobalData):
7005 (JSC::JSGlobalData::sharedInstance):
7006 (JSC::JSGlobalData::sharedInstanceInternal):
7007 * runtime/JSGlobalData.h:
7008 (JSGlobalData):
7009 * runtime/JSGlobalObject.cpp:
7010 (JSC::JSGlobalObject::~JSGlobalObject):
7011 (JSC::JSGlobalObject::init):
7012 * runtime/JSLock.cpp:
7013 (JSC):
7014 (JSC::createJSLockCount):
7015 (JSC::JSLock::lockCount):
7016 (JSC::setLockCount):
7017 (JSC::JSLock::JSLock):
7018 (JSC::JSLock::lock):
7019 (JSC::JSLock::unlock):
7020 (JSC::JSLock::currentThreadIsHoldingLock):
7021 (JSC::JSLock::DropAllLocks::DropAllLocks):
7022 (JSC::JSLock::DropAllLocks::~DropAllLocks):
7023 * runtime/JSLock.h:
7024 (JSC):
7025 (JSLock):
7026 (JSC::JSLock::JSLock):
7027 (JSC::JSLock::~JSLock):
7028 (DropAllLocks):
7029 * runtime/WeakGCMap.h:
7030 (JSC::WeakGCMap::set):
7031 * testRegExp.cpp:
7032 (realMain):
7033
achicu@adobe.comcead7612012-06-23 01:23:48 +000070342012-06-22 Alexandru Chiculita <achicu@adobe.com>
7035
7036 [CSS Shaders] Re-enable the CSS Shaders compile time flag on Safari Mac
7037 https://bugs.webkit.org/show_bug.cgi?id=89781
7038
7039 Reviewed by Dean Jackson.
7040
7041 Added ENABLE_CSS_SHADERS flag as enabled by default on Safari for Mac.
7042
7043 * Configurations/FeatureDefines.xcconfig:
7044
fpizlo@apple.com16e2cbf2012-06-22 23:32:59 +000070452012-06-22 Filip Pizlo <fpizlo@apple.com>
7046
7047 DFG tier-up should happen in prologues, not epilogues
7048 https://bugs.webkit.org/show_bug.cgi?id=89752
7049
7050 Reviewed by Geoffrey Garen.
7051
7052 This change has two outcomes:
7053
7054 1) Slightly reduces the likelihood that a function will be optimized both
7055 standalone and via inlining. Previously, if you had a call sequence like foo()
7056 calls bar() exactly once, and nobody else calls bar(), then bar() would get
7057 optimized first (because it returns first) and then foo() gets optimized. If foo()
7058 can inline bar() then that means that bar() gets optimized twice. But now, if we
7059 optimize in prologues, then foo() will be optimized first. If it inlines bar(),
7060 that means that there will no longer be any calls to bar().
7061
7062 2) It lets us kill some code in JITStubs. Epilogue tier-up was very different from
7063 loop tier-up, since epilogue tier-up should not attempt OSR. But prologue tier-up
7064 requires OSR (albeit really easy OSR since it's the top of the compilation unit),
7065 so it becomes just like loop tier-up. As a result, we now have one optimization
7066 hook (cti_optimize) instead of two (cti_optimize_from_loop and
7067 cti_optimize_from_ret).
7068
7069 As a consequence of not having an optimization check in epilogues, the OSR exit
7070 code must now trigger reoptimization itself instead of just signaling the epilogue
7071 check to fire.
7072
7073 This also adds the ability to count the number of DFG compilations, which was
7074 useful for debugging this patch and might be useful for other things in the future.
7075
7076 * bytecode/CodeBlock.cpp:
7077 (JSC::CodeBlock::reoptimize):
7078 (JSC):
7079 * bytecode/CodeBlock.h:
7080 (CodeBlock):
7081 * dfg/DFGByteCodeParser.cpp:
7082 (JSC::DFG::ByteCodeParser::parseCodeBlock):
7083 * dfg/DFGDriver.cpp:
7084 (DFG):
7085 (JSC::DFG::getNumCompilations):
7086 (JSC::DFG::compile):
7087 * dfg/DFGDriver.h:
7088 (DFG):
7089 * dfg/DFGOSRExitCompiler.cpp:
7090 (JSC::DFG::OSRExitCompiler::handleExitCounts):
7091 * dfg/DFGOperations.cpp:
7092 * dfg/DFGOperations.h:
7093 * jit/JIT.cpp:
7094 (JSC::JIT::emitOptimizationCheck):
7095 * jit/JIT.h:
7096 * jit/JITCall32_64.cpp:
7097 (JSC::JIT::emit_op_ret):
7098 (JSC::JIT::emit_op_ret_object_or_this):
7099 * jit/JITOpcodes.cpp:
7100 (JSC::JIT::emit_op_ret):
7101 (JSC::JIT::emit_op_ret_object_or_this):
7102 (JSC::JIT::emit_op_enter):
7103 * jit/JITOpcodes32_64.cpp:
7104 (JSC::JIT::emit_op_enter):
7105 * jit/JITStubs.cpp:
7106 (JSC::DEFINE_STUB_FUNCTION):
7107 * jit/JITStubs.h:
7108
mhahnenberg@apple.com6d9f86d2012-06-22 21:42:46 +000071092012-06-20 Mark Hahnenberg <mhahnenberg@apple.com>
7110
7111 JSLock should be per-JSGlobalData
7112 https://bugs.webkit.org/show_bug.cgi?id=89123
7113
7114 Reviewed by Gavin Barraclough.
7115
7116 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7117 * API/APIShims.h:
7118 (APIEntryShimWithoutLock):
7119 (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Added an extra parameter to the constructor to
7120 determine whether we should ref the JSGlobalData or not. We want to ref all the time except for in the
7121 HeapTimer class because timerDidFire could run after somebody has started to tear down that particular
7122 JSGlobalData, so we wouldn't want to resurrect the ref count of that JSGlobalData from 0 back to 1 after
7123 its destruction has begun.
7124 (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): Now derefs if it also refed.
7125 (JSC::APIEntryShim::APIEntryShim):
7126 (APIEntryShim):
7127 (JSC::APIEntryShim::~APIEntryShim):
7128 (JSC::APIEntryShim::init): Factored out common initialization code for the various APIEntryShim constructors.
7129 Also moved the timeoutChecker stop and start here because we need to start after we've grabbed the API lock
7130 and before we've released it, which can only done in APIEntryShim.
7131 (JSC::APICallbackShim::~APICallbackShim): We no longer need to synchronize here.
7132 * API/JSContextRef.cpp:
7133 (JSGlobalContextCreate):
7134 (JSGlobalContextCreateInGroup):
7135 (JSGlobalContextRelease):
7136 (JSContextCreateBacktrace):
7137 * heap/CopiedSpace.cpp:
7138 (JSC::CopiedSpace::tryAllocateSlowCase):
7139 * heap/Heap.cpp:
7140 (JSC::Heap::protect):
7141 (JSC::Heap::unprotect):
7142 (JSC::Heap::collect):
7143 (JSC::Heap::setActivityCallback):
7144 (JSC::Heap::activityCallback):
7145 (JSC::Heap::sweeper):
7146 * heap/Heap.h: Changed m_activityCallback and m_sweeper to be raw pointers rather than OwnPtrs because they
7147 are now responsible for their own lifetime. Also changed the order of declaration of the GCActivityCallback
7148 and the IncrementalSweeper to make sure they're the last things that get initialized during construction to
7149 prevent any issues with uninitialized memory in the JSGlobalData/Heap they might care about.
7150 (Heap):
7151 * heap/HeapTimer.cpp: Refactored to allow for thread-safe operation and shutdown.
7152 (JSC::HeapTimer::~HeapTimer):
7153 (JSC::HeapTimer::invalidate):
7154 (JSC):
7155 (JSC::HeapTimer::didStartVMShutdown): Called at the beginning of ~JSGlobalData. If we're on the same thread
7156 that the HeapTimer is running on, we kill the HeapTimer ourselves. If not, then we set some state in the
7157 HeapTimer and schedule it to fire immediately so that it can notice and kill itself.
7158 (JSC::HeapTimer::timerDidFire): We grab our mutex and check our JSGlobalData pointer. If it has been zero-ed
7159 out, then we know the VM has started to shutdown and we should kill ourselves. Otherwise, grab the APIEntryShim,
7160 but without ref-ing the JSGlobalData (we don't want to bring the JSGlobalData's ref-count from 0 to 1) in case
7161 we were interrupted between releasing our mutex and trying to grab the APILock.
7162 * heap/HeapTimer.h:
7163 (HeapTimer):
7164 * heap/IncrementalSweeper.cpp:
7165 (JSC::IncrementalSweeper::doWork): We no longer need the API shim here since HeapTimer::timerDidFire handles
7166 all of that for us.
7167 (JSC::IncrementalSweeper::create):
7168 * heap/IncrementalSweeper.h:
7169 (IncrementalSweeper):
7170 * heap/MarkedAllocator.cpp:
7171 (JSC::MarkedAllocator::allocateSlowCase):
7172 * heap/WeakBlock.cpp:
7173 (JSC::WeakBlock::reap):
7174 * jsc.cpp:
7175 (functionGC):
7176 (functionReleaseExecutableMemory):
7177 (jscmain):
7178 * runtime/Completion.cpp:
7179 (JSC::checkSyntax):
7180 (JSC::evaluate):
7181 * runtime/GCActivityCallback.h:
7182 (DefaultGCActivityCallback):
7183 (JSC::DefaultGCActivityCallback::create):
7184 * runtime/JSGlobalData.cpp:
7185 (JSC::JSGlobalData::JSGlobalData):
7186 (JSC::JSGlobalData::~JSGlobalData): Signals to the two HeapTimers (GCActivityCallback and IncrementalSweeper)
7187 that the VM has started shutting down. It then waits until the HeapTimer is done with whatever activity
7188 it needs to do before continuing with any further destruction. Also asserts that we do not currently hold the
7189 APILock because this could potentially cause deadlock when we try to signal to the HeapTimers using their mutexes.
7190 (JSC::JSGlobalData::sharedInstance): Protect the initialization for the shared instance with the GlobalJSLock.
7191 (JSC::JSGlobalData::sharedInstanceInternal):
7192 * runtime/JSGlobalData.h: Change to be ThreadSafeRefCounted so that we don't have to worry about refing and
7193 de-refing JSGlobalDatas on separate threads since we don't do it that often anyways.
7194 (JSGlobalData):
7195 (JSC::JSGlobalData::apiLock):
7196 * runtime/JSGlobalObject.cpp:
7197 (JSC::JSGlobalObject::~JSGlobalObject):
7198 (JSC::JSGlobalObject::init):
7199 * runtime/JSLock.cpp:
7200 (JSC):
7201 (JSC::GlobalJSLock::GlobalJSLock): For accessing the shared instance.
7202 (JSC::GlobalJSLock::~GlobalJSLock):
7203 (JSC::JSLockHolder::JSLockHolder): MutexLocker for JSLock. Also refs the JSGlobalData to keep it alive so that
7204 it can successfully unlock it later without it disappearing from underneath it.
7205 (JSC::JSLockHolder::~JSLockHolder):
7206 (JSC::JSLock::JSLock):
7207 (JSC::JSLock::~JSLock):
7208 (JSC::JSLock::lock): Uses the spin lock for guarding the lock count and owner thread fields. Uses the mutex for
7209 actually waiting for long periods.
7210 (JSC::JSLock::unlock):
7211 (JSC::JSLock::currentThreadIsHoldingLock):
7212 (JSC::JSLock::dropAllLocks):
7213 (JSC::JSLock::dropAllLocksUnconditionally):
7214 (JSC::JSLock::grabAllLocks):
7215 (JSC::JSLock::DropAllLocks::DropAllLocks):
7216 (JSC::JSLock::DropAllLocks::~DropAllLocks):
7217 * runtime/JSLock.h:
7218 (JSC):
7219 (GlobalJSLock):
7220 (JSLockHolder):
7221 (JSLock):
7222 (DropAllLocks):
7223 * runtime/WeakGCMap.h:
7224 (JSC::WeakGCMap::set):
7225 * testRegExp.cpp:
7226 (realMain):
7227
peter@chromium.org166f5bb2012-06-22 16:20:33 +000072282012-06-22 Peter Beverloo <peter@chromium.org>
7229
7230 [Chromium] Disable c++0x compatibility warnings in JavaScriptCore.gyp when building for Android
7231 https://bugs.webkit.org/show_bug.cgi?id=88853
7232
7233 Reviewed by Steve Block.
7234
7235 The Android exclusions were necessary to fix a gyp generation error, as
7236 the gcc_version variable wasn't being defined for Android. Remove these
7237 exceptions when Chromium is able to define the gcc_version variable.
7238
7239 * JavaScriptCore.gyp/JavaScriptCore.gyp:
7240
fpizlo@apple.com90011802012-06-22 01:33:30 +000072412012-06-21 Filip Pizlo <fpizlo@apple.com>
7242
7243 op_resolve_global should not prevent DFG inlining
7244 https://bugs.webkit.org/show_bug.cgi?id=89726
7245
7246 Reviewed by Gavin Barraclough.
7247
7248 * bytecode/CodeBlock.cpp:
7249 (JSC::CodeBlock::CodeBlock):
7250 (JSC::CodeBlock::shrinkToFit):
7251 * bytecode/GlobalResolveInfo.h:
7252 (JSC::GlobalResolveInfo::GlobalResolveInfo):
7253 (GlobalResolveInfo):
7254 * dfg/DFGByteCodeParser.cpp:
7255 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
7256 * dfg/DFGCapabilities.h:
7257 (JSC::DFG::canInlineOpcode):
7258 * dfg/DFGOperations.cpp:
7259 * dfg/DFGOperations.h:
7260 * dfg/DFGSpeculativeJIT.h:
7261 (JSC::DFG::SpeculativeJIT::callOperation):
7262 * dfg/DFGSpeculativeJIT32_64.cpp:
7263 (JSC::DFG::SpeculativeJIT::compile):
7264 * dfg/DFGSpeculativeJIT64.cpp:
7265 (JSC::DFG::SpeculativeJIT::compile):
7266
fpizlo@apple.com618044d2012-06-21 22:55:42 +000072672012-06-20 Filip Pizlo <fpizlo@apple.com>
7268
7269 DFG should inline 'new Array()'
7270 https://bugs.webkit.org/show_bug.cgi?id=89632
7271
7272 Reviewed by Geoffrey Garen.
7273
7274 This adds support for treating InternalFunction like intrinsics. The code
7275 to do so is actually quite clean, so I don't feel bad about perpetuating
7276 the InternalFunction vs. JSFunction-with-NativeExecutable dichotomy.
7277
7278 Currently this newfound power is only used to inline 'new Array()'.
7279
7280 * dfg/DFGByteCodeParser.cpp:
7281 (ByteCodeParser):
7282 (JSC::DFG::ByteCodeParser::handleCall):
7283 (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
7284 (DFG):
7285 * dfg/DFGGraph.h:
7286 (JSC::DFG::Graph::isInternalFunctionConstant):
7287 (JSC::DFG::Graph::valueOfInternalFunctionConstant):
7288
mhahnenberg@apple.coma2373032012-06-21 22:38:39 +000072892012-06-21 Mark Hahnenberg <mhahnenberg@apple.com>
7290
7291 Adding copyrights to new files.
7292
7293 * heap/HeapTimer.cpp:
7294 * heap/HeapTimer.h:
7295 * heap/IncrementalSweeper.cpp:
7296 * heap/IncrementalSweeper.h:
7297
commit-queue@webkit.orgc8209e72012-06-21 17:34:26 +000072982012-06-21 Arnaud Renevier <arno@renevier.net>
7299
7300 make sure headers are included only once per file
7301 https://bugs.webkit.org/show_bug.cgi?id=88922
7302
7303 Reviewed by Alexey Proskuryakov.
7304
7305 * bytecode/CodeBlock.h:
7306 * heap/MachineStackMarker.cpp:
7307 * runtime/JSVariableObject.h:
7308
commit-queue@webkit.orgbff9a102012-06-21 15:46:40 +000073092012-06-21 Ryuan Choi <ryuan.choi@gmail.com>
7310
7311 [EFL][WK2] Make WebKit2/Efl headers and resources installable.
7312 https://bugs.webkit.org/show_bug.cgi?id=88207
7313
7314 Reviewed by Chang Shu.
7315
7316 * shell/CMakeLists.txt: Use ${EXEC_INSTALL_DIR} instead of hardcoding "bin"
7317
ggaren@apple.com4b67d0d2012-06-21 02:00:08 +000073182012-06-20 Geoffrey Garen <ggaren@apple.com>
7319
7320 Reduced (but did not eliminate) use of "berzerker GC"
7321 https://bugs.webkit.org/show_bug.cgi?id=89237
7322
7323 Reviewed by Gavin Barraclough.
7324
7325 (PART 1)
7326
7327 This patch turned out to be crashy, so I'm landing the non-crashy bits
7328 first.
7329
7330 This part is pre-requisite refactoring. I didn't actually turn off
7331 "berzerker GC" or turn on incremental shrinking.
7332
7333 * heap/MarkedAllocator.cpp:
7334 (JSC::MarkedAllocator::removeBlock): Make sure to clear the free list when
7335 we throw away the block we're currently allocating out of. Otherwise, we'll
7336 allocate out of a stale free list.
7337
7338 * heap/MarkedSpace.cpp:
7339 (JSC::Free::Free):
7340 (JSC::Free::operator()):
7341 (JSC::Free::returnValue): Refactored this functor to use a shared helper
7342 function, so we can share our implementation with the incremental sweeper.
7343
7344 Also changed to freeing individual blocks immediately instead of linking
7345 them into a list for later freeing. This makes the programming interface
7346 simpler, and it's slightly more efficient to boot.
7347
7348 (JSC::MarkedSpace::~MarkedSpace): Updated for rename.
7349
7350 (JSC::MarkedSpace::freeBlock):
7351 (JSC::MarkedSpace::freeOrShrinkBlock): New helper functions to share behavior
7352 with the incremental sweeper.
7353
7354 (JSC::MarkedSpace::shrink): Updated for new functor behavior.
7355
7356 * heap/MarkedSpace.h: Statically typed languages are awesome.
7357
fpizlo@apple.com8c462122012-06-20 21:07:33 +000073582012-06-20 Filip Pizlo <fpizlo@apple.com>
7359
fpizlo@apple.com3bcb2112012-06-21 01:38:49 +00007360 DFG should optimize ResolveGlobal
7361 https://bugs.webkit.org/show_bug.cgi?id=89617
7362
7363 Reviewed by Oliver Hunt.
7364
7365 This adds inlining of ResolveGlobal accesses that are known monomorphic. It also
7366 adds the specific function optimization to ResolveGlobal, when it is inlined. And,
7367 it makes internal functions act like specific functions, since that will be the
7368 most common use-case of this optimization.
7369
7370 This is only a slighy speed-up (sub 1%), since we don't yet do the obvious thing
7371 with this optimization, which is to completely inline common "globally resolved"
7372 function and constructor calls, like "new Array()".
7373
7374 * CMakeLists.txt:
7375 * GNUmakefile.list.am:
7376 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
7377 * JavaScriptCore.xcodeproj/project.pbxproj:
7378 * Target.pri:
7379 * bytecode/CodeBlock.cpp:
7380 (JSC::CodeBlock::globalResolveInfoForBytecodeOffset):
7381 * bytecode/CodeBlock.h:
7382 (CodeBlock):
7383 (JSC::CodeBlock::numberOfGlobalResolveInfos):
7384 * bytecode/GlobalResolveInfo.h:
7385 (JSC::getGlobalResolveInfoBytecodeOffset):
7386 (JSC):
7387 * bytecode/ResolveGlobalStatus.cpp: Added.
7388 (JSC):
7389 (JSC::computeForStructure):
7390 (JSC::computeForLLInt):
7391 (JSC::ResolveGlobalStatus::computeFor):
7392 * bytecode/ResolveGlobalStatus.h: Added.
7393 (JSC):
7394 (ResolveGlobalStatus):
7395 (JSC::ResolveGlobalStatus::ResolveGlobalStatus):
7396 (JSC::ResolveGlobalStatus::state):
7397 (JSC::ResolveGlobalStatus::isSet):
7398 (JSC::ResolveGlobalStatus::operator!):
7399 (JSC::ResolveGlobalStatus::isSimple):
7400 (JSC::ResolveGlobalStatus::takesSlowPath):
7401 (JSC::ResolveGlobalStatus::structure):
7402 (JSC::ResolveGlobalStatus::offset):
7403 (JSC::ResolveGlobalStatus::specificValue):
7404 * dfg/DFGByteCodeParser.cpp:
7405 (ByteCodeParser):
7406 (JSC::DFG::ByteCodeParser::handleGetByOffset):
7407 (DFG):
7408 (JSC::DFG::ByteCodeParser::handleGetById):
7409 (JSC::DFG::ByteCodeParser::parseBlock):
7410 * runtime/JSObject.cpp:
7411 (JSC::getCallableObjectSlow):
7412 (JSC):
7413 (JSC::JSObject::put):
7414 (JSC::JSObject::putDirectVirtual):
7415 (JSC::JSObject::putDirectAccessor):
7416 * runtime/JSObject.h:
7417 (JSC):
7418 (JSC::getCallableObject):
7419 (JSC::JSObject::putOwnDataProperty):
7420 (JSC::JSObject::putDirect):
7421 (JSC::JSObject::putDirectWithoutTransition):
7422
74232012-06-20 Filip Pizlo <fpizlo@apple.com>
7424
fpizlo@apple.com2e368f72012-06-20 23:55:18 +00007425 Functions on global objects should be specializable
7426 https://bugs.webkit.org/show_bug.cgi?id=89615
7427
7428 Reviewed by Oliver Hunt.
7429
7430 I tested to see if this brought back the bug in https://bugs.webkit.org/show_bug.cgi?id=33343,
7431 and it didn't. Bug 33343 was the reason why we disabled global object function specialization
7432 to begin with. So I'm guessing this is safe.
7433
7434 * runtime/JSGlobalObject.cpp:
7435 (JSC::JSGlobalObject::init):
7436
74372012-06-20 Filip Pizlo <fpizlo@apple.com>
7438
fpizlo@apple.com8c462122012-06-20 21:07:33 +00007439 build-webkit failure due to illegal 32-bit integer constants in code
7440 generated by offlineasm
7441 https://bugs.webkit.org/show_bug.cgi?id=89347
7442
7443 Reviewed by Geoffrey Garen.
7444
7445 The offending constants are the magic numbers used by offlineasm to find
7446 offsets in the generated machine code. Added code to turn them into what
7447 the C++ compiler will believe to be valid 32-bit values.
7448
7449 * offlineasm/offsets.rb:
7450
ggaren@apple.com30ef2b32012-06-20 18:24:02 +000074512012-06-19 Geoffrey Garen <ggaren@apple.com>
7452
7453 Made the incremental sweeper more aggressive
7454 https://bugs.webkit.org/show_bug.cgi?id=89527
7455
7456 Reviewed by Oliver Hunt.
7457
7458 This is a pre-requisite to getting rid of "berzerker GC" because we need
7459 the sweeper to reclaim memory in a timely fashion, or we'll see a memory
7460 footprint regression.
7461
7462 * heap/IncrementalSweeper.h:
7463 * heap/IncrementalSweeper.cpp:
7464 (JSC::IncrementalSweeper::scheduleTimer): Since the time slice is predictable,
7465 no need to use a data member to record it.
7466
7467 (JSC::IncrementalSweeper::doSweep): Sweep as many blocks as we can in a
7468 small time slice. This is better than sweeping only one block per timer
7469 fire because that strategy has a heavy timer overhead, and artificially
7470 delays memory reclamation.
7471
fpizlo@apple.com3d517672012-06-20 17:48:23 +000074722012-06-20 Filip Pizlo <fpizlo@apple.com>
7473
7474 DFG should be able to print disassembly interleaved with the IR
7475 https://bugs.webkit.org/show_bug.cgi?id=89551
7476
7477 Reviewed by Geoffrey Garen.
fpizlo@apple.come245b3f2012-06-20 17:51:07 +00007478
7479 This change also removes running Dominators unconditionally on every DFG
7480 compile. Dominators are designed to be computed on-demand, and currently
7481 the only demand is graph dumps.
fpizlo@apple.com3d517672012-06-20 17:48:23 +00007482
7483 * CMakeLists.txt:
7484 * GNUmakefile.list.am:
7485 * JavaScriptCore.xcodeproj/project.pbxproj:
7486 * Target.pri:
7487 * assembler/ARMv7Assembler.h:
7488 (JSC::ARMv7Assembler::labelIgnoringWatchpoints):
7489 (ARMv7Assembler):
7490 * assembler/AbstractMacroAssembler.h:
7491 (AbstractMacroAssembler):
7492 (JSC::AbstractMacroAssembler::labelIgnoringWatchpoints):
7493 * assembler/X86Assembler.h:
7494 (X86Assembler):
7495 (JSC::X86Assembler::labelIgnoringWatchpoints):
7496 * dfg/DFGCommon.h:
7497 (JSC::DFG::shouldShowDisassembly):
7498 (DFG):
7499 * dfg/DFGDisassembler.cpp: Added.
7500 (DFG):
7501 (JSC::DFG::Disassembler::Disassembler):
7502 (JSC::DFG::Disassembler::dump):
7503 (JSC::DFG::Disassembler::dumpDisassembly):
7504 * dfg/DFGDisassembler.h: Added.
7505 (DFG):
7506 (Disassembler):
7507 (JSC::DFG::Disassembler::setStartOfCode):
7508 (JSC::DFG::Disassembler::setForBlock):
7509 (JSC::DFG::Disassembler::setForNode):
7510 (JSC::DFG::Disassembler::setEndOfMainPath):
7511 (JSC::DFG::Disassembler::setEndOfCode):
7512 * dfg/DFGDriver.cpp:
7513 (JSC::DFG::compile):
7514 * dfg/DFGGraph.cpp:
7515 (JSC::DFG::Graph::dumpCodeOrigin):
7516 (JSC::DFG::Graph::amountOfNodeWhiteSpace):
7517 (DFG):
7518 (JSC::DFG::Graph::printNodeWhiteSpace):
7519 (JSC::DFG::Graph::dump):
7520 (JSC::DFG::Graph::dumpBlockHeader):
7521 * dfg/DFGGraph.h:
7522 * dfg/DFGJITCompiler.cpp:
7523 (JSC::DFG::JITCompiler::JITCompiler):
7524 (DFG):
7525 (JSC::DFG::JITCompiler::compile):
7526 (JSC::DFG::JITCompiler::compileFunction):
7527 * dfg/DFGJITCompiler.h:
7528 (JITCompiler):
7529 (JSC::DFG::JITCompiler::setStartOfCode):
7530 (JSC::DFG::JITCompiler::setForBlock):
7531 (JSC::DFG::JITCompiler::setForNode):
7532 (JSC::DFG::JITCompiler::setEndOfMainPath):
7533 (JSC::DFG::JITCompiler::setEndOfCode):
7534 * dfg/DFGNode.h:
7535 (Node):
7536 (JSC::DFG::Node::willHaveCodeGen):
7537 * dfg/DFGNodeFlags.cpp:
7538 (JSC::DFG::nodeFlagsAsString):
7539 * dfg/DFGSpeculativeJIT.cpp:
7540 (JSC::DFG::SpeculativeJIT::compile):
7541 * dfg/DFGSpeculativeJIT.h:
7542 (SpeculativeJIT):
7543 * runtime/Options.cpp:
7544 (Options):
7545 (JSC::Options::initializeOptions):
7546 * runtime/Options.h:
7547 (Options):
7548
fpizlo@apple.com2adf5272012-06-20 01:33:30 +000075492012-06-19 Filip Pizlo <fpizlo@apple.com>
7550
7551 JSC should be able to show disassembly for all generated JIT code
7552 https://bugs.webkit.org/show_bug.cgi?id=89536
7553
7554 Reviewed by Gavin Barraclough.
7555
7556 Now instead of doing linkBuffer.finalizeCode(), you do
7557 FINALIZE_CODE(linkBuffer, (... explanation ...)). FINALIZE_CODE() then
7558 prints your explanation and the disassembled code, if
7559 Options::showDisassembly is set to true.
7560
7561 * CMakeLists.txt:
7562 * GNUmakefile.list.am:
7563 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7564 * JavaScriptCore.xcodeproj/project.pbxproj:
7565 * Target.pri:
7566 * assembler/LinkBuffer.cpp: Added.
7567 (JSC):
7568 (JSC::LinkBuffer::finalizeCodeWithoutDisassembly):
7569 (JSC::LinkBuffer::finalizeCodeWithDisassembly):
7570 (JSC::LinkBuffer::linkCode):
7571 (JSC::LinkBuffer::performFinalization):
7572 (JSC::LinkBuffer::dumpLinkStatistics):
7573 (JSC::LinkBuffer::dumpCode):
7574 * assembler/LinkBuffer.h:
7575 (LinkBuffer):
7576 (JSC):
7577 * assembler/MacroAssemblerCodeRef.h:
7578 (JSC::MacroAssemblerCodeRef::tryToDisassemble):
7579 (MacroAssemblerCodeRef):
7580 * dfg/DFGJITCompiler.cpp:
7581 (JSC::DFG::JITCompiler::compile):
7582 (JSC::DFG::JITCompiler::compileFunction):
7583 * dfg/DFGOSRExitCompiler.cpp:
7584 * dfg/DFGRepatch.cpp:
7585 (JSC::DFG::generateProtoChainAccessStub):
7586 (JSC::DFG::tryCacheGetByID):
7587 (JSC::DFG::tryBuildGetByIDList):
7588 (JSC::DFG::emitPutReplaceStub):
7589 (JSC::DFG::emitPutTransitionStub):
7590 * dfg/DFGThunks.cpp:
7591 (JSC::DFG::osrExitGenerationThunkGenerator):
7592 * disassembler/Disassembler.h:
7593 (JSC):
7594 (JSC::tryToDisassemble):
7595 * disassembler/UDis86Disassembler.cpp:
7596 (JSC::tryToDisassemble):
7597 * jit/JIT.cpp:
7598 (JSC::JIT::privateCompile):
7599 * jit/JITCode.h:
7600 (JSC::JITCode::tryToDisassemble):
7601 * jit/JITOpcodes.cpp:
7602 (JSC::JIT::privateCompileCTIMachineTrampolines):
7603 * jit/JITOpcodes32_64.cpp:
7604 (JSC::JIT::privateCompileCTIMachineTrampolines):
7605 (JSC::JIT::privateCompileCTINativeCall):
7606 * jit/JITPropertyAccess.cpp:
7607 (JSC::JIT::stringGetByValStubGenerator):
7608 (JSC::JIT::privateCompilePutByIdTransition):
7609 (JSC::JIT::privateCompilePatchGetArrayLength):
7610 (JSC::JIT::privateCompileGetByIdProto):
7611 (JSC::JIT::privateCompileGetByIdSelfList):
7612 (JSC::JIT::privateCompileGetByIdProtoList):
7613 (JSC::JIT::privateCompileGetByIdChainList):
7614 (JSC::JIT::privateCompileGetByIdChain):
7615 * jit/JITPropertyAccess32_64.cpp:
7616 (JSC::JIT::stringGetByValStubGenerator):
7617 (JSC::JIT::privateCompilePutByIdTransition):
7618 (JSC::JIT::privateCompilePatchGetArrayLength):
7619 (JSC::JIT::privateCompileGetByIdProto):
7620 (JSC::JIT::privateCompileGetByIdSelfList):
7621 (JSC::JIT::privateCompileGetByIdProtoList):
7622 (JSC::JIT::privateCompileGetByIdChainList):
7623 (JSC::JIT::privateCompileGetByIdChain):
7624 * jit/SpecializedThunkJIT.h:
7625 (JSC::SpecializedThunkJIT::finalize):
7626 * jit/ThunkGenerators.cpp:
7627 (JSC::charCodeAtThunkGenerator):
7628 (JSC::charAtThunkGenerator):
7629 (JSC::fromCharCodeThunkGenerator):
7630 (JSC::sqrtThunkGenerator):
7631 (JSC::floorThunkGenerator):
7632 (JSC::ceilThunkGenerator):
7633 (JSC::roundThunkGenerator):
7634 (JSC::expThunkGenerator):
7635 (JSC::logThunkGenerator):
7636 (JSC::absThunkGenerator):
7637 (JSC::powThunkGenerator):
7638 * llint/LLIntThunks.cpp:
7639 (JSC::LLInt::generateThunkWithJumpTo):
7640 (JSC::LLInt::functionForCallEntryThunkGenerator):
7641 (JSC::LLInt::functionForConstructEntryThunkGenerator):
7642 (JSC::LLInt::functionForCallArityCheckThunkGenerator):
7643 (JSC::LLInt::functionForConstructArityCheckThunkGenerator):
7644 (JSC::LLInt::evalEntryThunkGenerator):
7645 (JSC::LLInt::programEntryThunkGenerator):
7646 * runtime/Options.cpp:
7647 (Options):
7648 (JSC::Options::initializeOptions):
7649 * runtime/Options.h:
7650 (Options):
7651 * yarr/YarrJIT.cpp:
7652 (JSC::Yarr::YarrGenerator::compile):
7653
mhahnenberg@apple.com7ffd08d2012-06-20 00:20:30 +000076542012-06-19 Mark Hahnenberg <mhahnenberg@apple.com>
7655
7656 [Qt][Mac] REGRESSION(r120742): It broke the build
7657 https://bugs.webkit.org/show_bug.cgi?id=89516
7658
7659 Reviewed by Geoffrey Garen.
7660
7661 Removing GCActivityCallbackCF.cpp because it doesn't mesh well with cross-platform
7662 code on Darwin (e.g. Qt). We now use plain ol' vanilla ifdefs to handle platforms
7663 without CF support. These if-defs will probably disappear in the future when we
7664 use cross-platform timers in HeapTimer.
7665
7666 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7667 * JavaScriptCore.xcodeproj/project.pbxproj:
7668 * runtime/GCActivityCallback.cpp:
7669 (JSC):
7670 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
7671 (JSC::DefaultGCActivityCallback::doWork):
7672 (JSC::DefaultGCActivityCallback::scheduleTimer):
7673 (JSC::DefaultGCActivityCallback::cancelTimer):
7674 (JSC::DefaultGCActivityCallback::didAllocate):
7675 (JSC::DefaultGCActivityCallback::willCollect):
7676 (JSC::DefaultGCActivityCallback::cancel):
7677 * runtime/GCActivityCallbackCF.cpp: Removed.
7678
fpizlo@apple.com152abff2012-06-19 23:10:12 +000076792012-06-19 Filip Pizlo <fpizlo@apple.com>
7680
7681 DFG CFA forgets to notify subsequent phases of found constants if it proves LogicalNot to be a constant
7682 https://bugs.webkit.org/show_bug.cgi?id=89511
7683 <rdar://problem/11700089>
7684
7685 Reviewed by Geoffrey Garen.
7686
7687 * dfg/DFGAbstractState.cpp:
7688 (JSC::DFG::AbstractState::execute):
7689
commit-queue@webkit.orgb6833002012-06-19 21:06:08 +000076902012-06-19 Mark Lam <mark.lam@apple.com>
7691
7692 CodeBlock::needsCallReturnIndices() is no longer needed.
7693 https://bugs.webkit.org/show_bug.cgi?id=89490
7694
7695 Reviewed by Geoffrey Garen.
7696
7697 * bytecode/CodeBlock.h:
7698 (JSC::CodeBlock::needsCallReturnIndices): removed.
7699 * dfg/DFGJITCompiler.cpp:
7700 (JSC::DFG::JITCompiler::link):
7701 * jit/JIT.cpp:
7702 (JSC::JIT::privateCompile):
7703
fpizlo@apple.com861ea7b2012-06-19 20:05:06 +000077042012-06-19 Filip Pizlo <fpizlo@apple.com>
7705
7706 Unreviewed, try to fix Windows build.
7707
7708 * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
7709
fpizlo@apple.com01c2a192012-06-19 19:42:55 +000077102012-06-17 Filip Pizlo <fpizlo@apple.com>
7711
7712 It should be possible to look at disassembly
7713 https://bugs.webkit.org/show_bug.cgi?id=89319
7714
7715 Reviewed by Sam Weinig.
7716
7717 This imports the udis86 disassembler library. The library is placed
7718 behind an abstraction in disassembler/Disassembler.h, so that we can
7719 in the future use other disassemblers (for other platforms) whenever
7720 appropriate. As a first step, the disassembler is being invoked for
7721 DFG verbose dumps.
7722
7723 If we ever want to merge a new version of udis86 in the future, I've
7724 made notes about changes I made to the library in
7725 disassembler/udis86/differences.txt.
7726
7727 * CMakeLists.txt:
7728 * DerivedSources.make:
7729 * GNUmakefile.list.am:
7730 * JavaScriptCore.pri:
7731 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7732 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
7733 * JavaScriptCore.xcodeproj/project.pbxproj:
7734 * dfg/DFGJITCompiler.cpp:
7735 (JSC::DFG::JITCompiler::compile):
7736 (JSC::DFG::JITCompiler::compileFunction):
7737 * disassembler: Added.
7738 * disassembler/Disassembler.h: Added.
7739 (JSC):
7740 (JSC::tryToDisassemble):
7741 * disassembler/UDis86Disassembler.cpp: Added.
7742 (JSC):
7743 (JSC::tryToDisassemble):
7744 * disassembler/udis86: Added.
7745 * disassembler/udis86/differences.txt: Added.
7746 * disassembler/udis86/itab.py: Added.
7747 (UdItabGenerator):
7748 (UdItabGenerator.__init__):
7749 (UdItabGenerator.toGroupId):
7750 (UdItabGenerator.genLookupTable):
7751 (UdItabGenerator.genLookupTableList):
7752 (UdItabGenerator.genInsnTable):
7753 (genItabH):
7754 (genItabH.UD_ITAB_H):
7755 (genItabC):
7756 (genItab):
7757 (main):
7758 * disassembler/udis86/optable.xml: Added.
7759 * disassembler/udis86/ud_opcode.py: Added.
7760 (UdOpcodeTables):
7761 (UdOpcodeTables.sizeOfTable):
7762 (UdOpcodeTables.nameOfTable):
7763 (UdOpcodeTables.updateTable):
7764 (UdOpcodeTables.Insn):
7765 (UdOpcodeTables.Insn.__init__):
7766 (UdOpcodeTables.Insn.__init__.opcode):
7767 (UdOpcodeTables.parse):
7768 (UdOpcodeTables.addInsnDef):
7769 (UdOpcodeTables.print_table):
7770 (UdOpcodeTables.print_tree):
7771 * disassembler/udis86/ud_optable.py: Added.
7772 (UdOptableXmlParser):
7773 (UdOptableXmlParser.parseDef):
7774 (UdOptableXmlParser.parse):
7775 (printFn):
7776 (parse):
7777 (main):
7778 * disassembler/udis86/udis86.c: Added.
7779 (ud_init):
7780 (ud_disassemble):
7781 (ud_set_mode):
7782 (ud_set_vendor):
7783 (ud_set_pc):
7784 (ud):
7785 (ud_insn_asm):
7786 (ud_insn_off):
7787 (ud_insn_hex):
7788 (ud_insn_ptr):
7789 (ud_insn_len):
7790 * disassembler/udis86/udis86.h: Added.
7791 * disassembler/udis86/udis86_decode.c: Added.
7792 (eff_adr_mode):
7793 (ud_lookup_mnemonic):
7794 (decode_prefixes):
7795 (modrm):
7796 (resolve_operand_size):
7797 (resolve_mnemonic):
7798 (decode_a):
7799 (decode_gpr):
7800 (resolve_gpr64):
7801 (resolve_gpr32):
7802 (resolve_reg):
7803 (decode_imm):
7804 (decode_modrm_reg):
7805 (decode_modrm_rm):
7806 (decode_o):
7807 (decode_operand):
7808 (decode_operands):
7809 (clear_insn):
7810 (resolve_mode):
7811 (gen_hex):
7812 (decode_insn):
7813 (decode_3dnow):
7814 (decode_ssepfx):
7815 (decode_ext):
7816 (decode_opcode):
7817 (ud_decode):
7818 * disassembler/udis86/udis86_decode.h: Added.
7819 (ud_itab_entry_operand):
7820 (ud_itab_entry):
7821 (ud_lookup_table_list_entry):
7822 (sse_pfx_idx):
7823 (mode_idx):
7824 (modrm_mod_idx):
7825 (vendor_idx):
7826 (is_group_ptr):
7827 (group_idx):
7828 * disassembler/udis86/udis86_extern.h: Added.
7829 * disassembler/udis86/udis86_input.c: Added.
7830 (inp_buff_hook):
7831 (inp_file_hook):
7832 (ud):
7833 (ud_set_user_opaque_data):
7834 (ud_get_user_opaque_data):
7835 (ud_set_input_buffer):
7836 (ud_set_input_file):
7837 (ud_input_skip):
7838 (ud_input_end):
7839 (ud_inp_next):
7840 (ud_inp_back):
7841 (ud_inp_peek):
7842 (ud_inp_move):
7843 (ud_inp_uint8):
7844 (ud_inp_uint16):
7845 (ud_inp_uint32):
7846 (ud_inp_uint64):
7847 * disassembler/udis86/udis86_input.h: Added.
7848 * disassembler/udis86/udis86_itab_holder.c: Added.
7849 * disassembler/udis86/udis86_syn-att.c: Added.
7850 (opr_cast):
7851 (gen_operand):
7852 (ud_translate_att):
7853 * disassembler/udis86/udis86_syn-intel.c: Added.
7854 (opr_cast):
7855 (gen_operand):
7856 (ud_translate_intel):
7857 * disassembler/udis86/udis86_syn.c: Added.
7858 * disassembler/udis86/udis86_syn.h: Added.
7859 (mkasm):
7860 * disassembler/udis86/udis86_types.h: Added.
7861 (ud_operand):
7862 (ud):
7863 * jit/JITCode.h:
7864 (JITCode):
7865 (JSC::JITCode::tryToDisassemble):
7866
mhahnenberg@apple.coma7ec41b2012-06-19 19:17:31 +000078672012-06-19 Mark Hahnenberg <mhahnenberg@apple.com>
7868
7869 GCActivityCallback and IncrementalSweeper should share code
7870 https://bugs.webkit.org/show_bug.cgi?id=89400
7871
7872 Reviewed by Geoffrey Garen.
7873
7874 A lot of functionality is duplicated between GCActivityCallback and IncrementalSweeper.
7875 We should extract the common functionality out into a separate class that both of them
7876 can inherit from. This refactoring will be an even greater boon when we add the ability
7877 to shut these two agents down in a thread-safe fashion
7878
7879 * CMakeLists.txt:
7880 * GNUmakefile.list.am:
7881 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
7882 * JavaScriptCore.xcodeproj/project.pbxproj:
7883 * Target.pri:
7884 * heap/Heap.cpp:
7885 (JSC::Heap::Heap): Move initialization down so that the JSGlobalData has a valid Heap when
7886 we're initializing the GCActivityCallback and the IncrementalSweeper.
7887 * heap/Heap.h:
7888 (Heap):
7889 * heap/HeapTimer.cpp: Added.
7890 (JSC):
7891 (JSC::HeapTimer::HeapTimer): Initialize the various base class data that
7892 DefaultGCActivityCallback::commonConstructor() used to do.
7893 (JSC::HeapTimer::~HeapTimer): Call to invalidate().
7894 (JSC::HeapTimer::synchronize): Same functionality as the old DefaultGCActivityCallback::synchronize().
7895 Virtual so that non-CF subclasses can override.
7896 (JSC::HeapTimer::invalidate): Tears down the runloop timer to prevent any future firing.
7897 (JSC::HeapTimer::timerDidFire): Callback to pass to the timer function. Casts and calls the virtual doWork().
7898 * heap/HeapTimer.h: Added. This is the class that serves as the common base class for
7899 both GCActivityCallback and IncrementalSweeper. It handles setting up and tearing down run loops and synchronizing
7900 across threads for its subclasses.
7901 (JSC):
7902 (HeapTimer):
7903 * heap/IncrementalSweeper.cpp: Changes to accomodate the extraction of common functionality
7904 between IncrementalSweeper and GCActivityCallback into a common ancestor.
7905 (JSC):
7906 (JSC::IncrementalSweeper::doWork):
7907 (JSC::IncrementalSweeper::IncrementalSweeper):
7908 (JSC::IncrementalSweeper::cancelTimer):
7909 (JSC::IncrementalSweeper::create):
7910 * heap/IncrementalSweeper.h:
7911 (IncrementalSweeper):
7912 * runtime/GCActivityCallback.cpp:
7913 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
7914 (JSC::DefaultGCActivityCallback::doWork):
7915 * runtime/GCActivityCallback.h:
7916 (GCActivityCallback):
7917 (JSC::GCActivityCallback::willCollect):
7918 (JSC::GCActivityCallback::GCActivityCallback):
7919 (JSC):
7920 (DefaultGCActivityCallback): Remove the platform data struct. The platform data should be kept in
7921 the class itself so as to be accessible by doWork(). Most of the platform data for CF is kept in
7922 HeapTimer anyways, so we only need the m_delay field now.
7923 * runtime/GCActivityCallbackBlackBerry.cpp:
7924 (JSC):
7925 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
7926 (JSC::DefaultGCActivityCallback::doWork):
7927 (JSC::DefaultGCActivityCallback::didAllocate):
7928 * runtime/GCActivityCallbackCF.cpp:
7929 (JSC):
7930 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
7931 (JSC::DefaultGCActivityCallback::doWork):
7932 (JSC::DefaultGCActivityCallback::scheduleTimer):
7933 (JSC::DefaultGCActivityCallback::cancelTimer):
7934 (JSC::DefaultGCActivityCallback::didAllocate):
7935 (JSC::DefaultGCActivityCallback::willCollect):
7936 (JSC::DefaultGCActivityCallback::cancel):
7937
7938
commit-queue@webkit.orgf5584612012-06-19 09:13:52 +000079392012-06-19 Mike West <mkwst@chromium.org>
7940
7941 Introduce ENABLE_CSP_NEXT configuration flag.
7942 https://bugs.webkit.org/show_bug.cgi?id=89300
7943
7944 Reviewed by Adam Barth.
7945
7946 The 1.0 draft of the Content Security Policy spec is just about to
7947 move to Last Call. We'll hide work on the upcoming 1.1 spec behind
7948 this ENABLE flag, disabled by default.
7949
7950 Spec: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html
7951
7952 * Configurations/FeatureDefines.xcconfig:
7953
commit-queue@webkit.org3e0a1a02012-06-19 06:07:28 +000079542012-06-18 Mark Lam <mark.lam@apple.com>
7955
7956 Changed JSC to always record line number information so that error.stack
7957 and window.onerror() can report proper line numbers.
7958 https://bugs.webkit.org/show_bug.cgi?id=89410
7959
7960 Reviewed by Geoffrey Garen.
7961
7962 * bytecode/CodeBlock.cpp:
7963 (JSC::CodeBlock::CodeBlock):
7964 (JSC::CodeBlock::lineNumberForBytecodeOffset):
7965 (JSC::CodeBlock::shrinkToFit): m_lineInfo is now available unconditionally.
7966
7967 * bytecode/CodeBlock.h:
7968 (JSC::CodeBlock::addLineInfo):
7969 (JSC::CodeBlock::hasLineInfo): Unused. Now removed.
7970 (JSC::CodeBlock::needsCallReturnIndices):
7971 (CodeBlock):
7972 (RareData): Hoisted m_lineInfo out of m_rareData. m_lineInfo is now
7973 filled in unconditionally.
7974
7975 * bytecompiler/BytecodeGenerator.h:
7976 (JSC::BytecodeGenerator::addLineInfo):
7977
aestes@apple.comf6d51392012-06-19 03:32:30 +000079782012-06-18 Andy Estes <aestes@apple.com>
7979
aestes@apple.com6cc46942012-06-19 03:34:03 +00007980 Fix r120663, which didn't land the change that was reviewed.
7981
79822012-06-18 Andy Estes <aestes@apple.com>
7983
aestes@apple.comf6d51392012-06-19 03:32:30 +00007984 [JSC] In JSGlobalData.cpp, enableAssembler() sometimes leaks two CF objects
7985 https://bugs.webkit.org/show_bug.cgi?id=89415
7986
7987 Reviewed by Sam Weinig.
7988
7989 In the case where canUseJIT was a non-NULL CFBooleanRef,
7990 enableAssembler() would leak both canUseJITKey and canUseJIT by
7991 returning before calling CFRelease. Fix this by using RetainPtr.
7992
7993 * runtime/JSGlobalData.cpp:
7994 (JSC::enableAssembler):
7995
ggaren@apple.com2318dbc2012-06-18 04:35:21 +000079962012-06-17 Geoffrey Garen <ggaren@apple.com>
7997
7998 GC copy phase spends needless cycles zero-filling blocks
7999 https://bugs.webkit.org/show_bug.cgi?id=89128
8000
8001 Reviewed by Gavin Barraclough.
8002
8003 We only need to zero-fill when we're allocating memory that might not
8004 get fully initialized before GC.
8005
8006 * heap/CopiedBlock.h:
8007 (JSC::CopiedBlock::createNoZeroFill):
8008 (JSC::CopiedBlock::create): Added a way to create without zero-filling.
8009 This is our optimization.
8010
8011 (JSC::CopiedBlock::zeroFillToEnd):
8012 (JSC::CopiedBlock::CopiedBlock): Split zero-filling out from creation,
8013 so we can sometimes create without zero-filling.
8014
8015 * heap/CopiedSpace.cpp:
8016 (JSC::CopiedSpace::init):
8017 (JSC::CopiedSpace::tryAllocateSlowCase):
8018 (JSC::CopiedSpace::doneCopying): Renamed addNewBlock to allocateBlock()
8019 to clarify that the new block is always newly-allocated.
8020
8021 (JSC::CopiedSpace::doneFillingBlock): Make sure to zero-fill to the end
8022 of a block that might be used in the future for allocation. (Most of the
8023 time, this is a no-op, since we've already filled the block completely.)
8024
8025 (JSC::CopiedSpace::getFreshBlock): Removed this function because the
8026 abstraction of "allocation must succeed" is no longer useful.
8027
8028 * heap/CopiedSpace.h: Updated declarations to match.
8029
8030 * heap/CopiedSpaceInlineMethods.h:
8031 (JSC::CopiedSpace::allocateBlockForCopyingPhase): New function, which
8032 knows that it can skip zero-filling.
8033
8034 Added tighter scoping to our lock, to improve parallelism.
8035
8036 (JSC::CopiedSpace::allocateBlock): Folded getFreshBlock functionality
8037 into this function, for simplicity.
8038
8039 * heap/MarkStack.cpp:
8040 (JSC::SlotVisitor::startCopying):
8041 (JSC::SlotVisitor::allocateNewSpace): Use our new zero-fill-free helper
8042 function for great good.
8043
fpizlo@apple.com73df57b2012-06-18 01:59:18 +000080442012-06-17 Filip Pizlo <fpizlo@apple.com>
8045
8046 DFG should attempt to use structure watchpoints for all inlined get_by_id's and put_by_id's
8047 https://bugs.webkit.org/show_bug.cgi?id=89316
8048
8049 Reviewed by Oliver Hunt.
8050
8051 * dfg/DFGByteCodeParser.cpp:
8052 (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
8053 (ByteCodeParser):
8054 (JSC::DFG::ByteCodeParser::handleGetById):
8055 (JSC::DFG::ByteCodeParser::parseBlock):
8056
commit-queue@webkit.orgf8968a72012-06-15 22:24:21 +000080572012-06-15 Yong Li <yoli@rim.com>
8058
8059 [BlackBerry] Put platform-specific GC policy in GCActivityCallback
8060 https://bugs.webkit.org/show_bug.cgi?id=89236
8061
8062 Reviewed by Rob Buis.
8063
8064 Add GCActivityCallbackBlackBerry.cpp and implement platform-specific
8065 low memory GC policy there.
8066
8067 * PlatformBlackBerry.cmake:
8068 * heap/Heap.h:
8069 (JSC::Heap::isSafeToCollect): Added.
8070 * runtime/GCActivityCallbackBlackBerry.cpp: Added.
8071 (JSC):
8072 (JSC::DefaultGCActivityCallbackPlatformData::DefaultGCActivityCallbackPlatformData):
8073 (DefaultGCActivityCallbackPlatformData):
8074 (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
8075 (JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback):
8076 (JSC::DefaultGCActivityCallback::didAllocate):
8077 (JSC::DefaultGCActivityCallback::willCollect):
8078 (JSC::DefaultGCActivityCallback::synchronize):
8079 (JSC::DefaultGCActivityCallback::cancel):
8080
fpizlo@apple.com666a2d52012-06-15 22:21:44 +000080812012-06-15 Filip Pizlo <fpizlo@apple.com>
8082
8083 DFG should be able to set watchpoints on structure transitions in the
8084 method check prototype chain
8085 https://bugs.webkit.org/show_bug.cgi?id=89058
8086
8087 Adding the same assertion to 32-bit that I added to 64-bit. This change
8088 does not affect correctness but it's a good thing for assertion coverage.
8089
8090 * dfg/DFGSpeculativeJIT32_64.cpp:
8091 (JSC::DFG::SpeculativeJIT::compile):
8092
fpizlo@apple.comb75911b2012-06-13 20:53:52 +000080932012-06-13 Filip Pizlo <fpizlo@apple.com>
8094
fpizlo@apple.com04e41152012-06-15 22:14:53 +00008095 DFG should be able to set watchpoints on structure transitions in the
8096 method check prototype chain
8097 https://bugs.webkit.org/show_bug.cgi?id=89058
8098
8099 Reviewed by Gavin Barraclough.
8100
8101 This adds the ability to set watchpoints on Structures, and then does
8102 the most modest thing we can do with this ability: the DFG now sets
8103 watchpoints on structure transitions in the prototype chain of method
8104 checks.
8105
8106 This appears to be a >1% speed-up on V8.
8107
8108 * bytecode/PutByIdStatus.cpp:
8109 (JSC::PutByIdStatus::computeFromLLInt):
8110 (JSC::PutByIdStatus::computeFor):
8111 * bytecode/StructureSet.h:
8112 (JSC::StructureSet::containsOnly):
8113 (StructureSet):
8114 * bytecode/Watchpoint.cpp:
8115 (JSC::WatchpointSet::WatchpointSet):
8116 (JSC::InlineWatchpointSet::add):
8117 (JSC):
8118 (JSC::InlineWatchpointSet::inflateSlow):
8119 (JSC::InlineWatchpointSet::freeFat):
8120 * bytecode/Watchpoint.h:
8121 (WatchpointSet):
8122 (JSC):
8123 (InlineWatchpointSet):
8124 (JSC::InlineWatchpointSet::InlineWatchpointSet):
8125 (JSC::InlineWatchpointSet::~InlineWatchpointSet):
8126 (JSC::InlineWatchpointSet::hasBeenInvalidated):
8127 (JSC::InlineWatchpointSet::isStillValid):
8128 (JSC::InlineWatchpointSet::startWatching):
8129 (JSC::InlineWatchpointSet::notifyWrite):
8130 (JSC::InlineWatchpointSet::isFat):
8131 (JSC::InlineWatchpointSet::fat):
8132 (JSC::InlineWatchpointSet::inflate):
8133 * dfg/DFGAbstractState.cpp:
8134 (JSC::DFG::AbstractState::execute):
8135 * dfg/DFGByteCodeParser.cpp:
8136 (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
8137 (ByteCodeParser):
8138 (JSC::DFG::ByteCodeParser::parseBlock):
8139 * dfg/DFGCSEPhase.cpp:
8140 (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
8141 (CSEPhase):
8142 (JSC::DFG::CSEPhase::performNodeCSE):
8143 * dfg/DFGCommon.h:
8144 * dfg/DFGGraph.cpp:
8145 (JSC::DFG::Graph::dump):
8146 * dfg/DFGGraph.h:
8147 (JSC::DFG::Graph::isCellConstant):
8148 * dfg/DFGJITCompiler.h:
8149 (JSC::DFG::JITCompiler::addWeakReferences):
8150 (JITCompiler):
8151 * dfg/DFGNode.h:
8152 (JSC::DFG::Node::hasStructure):
8153 (Node):
8154 (JSC::DFG::Node::structure):
8155 * dfg/DFGNodeType.h:
8156 (DFG):
8157 * dfg/DFGPredictionPropagationPhase.cpp:
8158 (JSC::DFG::PredictionPropagationPhase::propagate):
8159 * dfg/DFGRepatch.cpp:
8160 (JSC::DFG::emitPutTransitionStub):
8161 * dfg/DFGSpeculativeJIT64.cpp:
8162 (JSC::DFG::SpeculativeJIT::compile):
8163 * jit/JITStubs.cpp:
8164 (JSC::JITThunks::tryCachePutByID):
8165 * llint/LLIntSlowPaths.cpp:
8166 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
8167 * runtime/Structure.cpp:
8168 (JSC::Structure::Structure):
8169 * runtime/Structure.h:
8170 (JSC::Structure::transitionWatchpointSetHasBeenInvalidated):
8171 (Structure):
8172 (JSC::Structure::transitionWatchpointSetIsStillValid):
8173 (JSC::Structure::addTransitionWatchpoint):
8174 (JSC::Structure::notifyTransitionFromThisStructure):
8175 (JSC::JSCell::setStructure):
8176 * runtime/SymbolTable.cpp:
8177 (JSC::SymbolTableEntry::attemptToWatch):
8178
81792012-06-13 Filip Pizlo <fpizlo@apple.com>
8180
fpizlo@apple.comb75911b2012-06-13 20:53:52 +00008181 DFG should be able to set watchpoints on global variables
8182 https://bugs.webkit.org/show_bug.cgi?id=88692
8183
8184 Reviewed by Geoffrey Garen.
8185
8186 Rolling back in after fixing Windows build issues, and implementing
8187 branchTest8 for the Qt port's strange assemblers.
8188
8189 This implements global variable constant folding by allowing the optimizing
8190 compiler to set a "watchpoint" on globals that it wishes to constant fold.
8191 If the watchpoint fires, then an OSR exit is forced by overwriting the
8192 machine code that the optimizing compiler generated with a jump.
8193
8194 As such, this patch is adding quite a bit of stuff:
8195
8196 - Jump replacement on those hardware targets supported by the optimizing
8197 JIT. It is now possible to patch in a jump instruction over any recorded
8198 watchpoint label. The jump must be "local" in the sense that it must be
8199 within the range of the largest jump distance supported by a one
8200 instruction jump.
8201
8202 - WatchpointSets and Watchpoints. A Watchpoint is a doubly-linked list node
8203 that records the location where a jump must be inserted and the
8204 destination to which it should jump. Watchpoints can be added to a
8205 WatchpointSet. The WatchpointSet can be fired all at once, which plants
8206 all jumps. WatchpointSet also remembers if it had ever been invalidated,
8207 which allows for monotonicity: we typically don't want to optimize using
8208 watchpoints on something for which watchpoints had previously fired. The
8209 act of notifying a WatchpointSet has a trivial fast path in case no
8210 Watchpoints are registered (one-byte load+branch).
8211
8212 - SpeculativeJIT::speculationWatchpoint(). It's like speculationCheck(),
8213 except that you don't have to emit branches. But, you need to know what
8214 WatchpointSet to add the resulting Watchpoint to. Not everything that
8215 you could write a speculationCheck() for will have a WatchpointSet that
8216 would get notified if the condition you were speculating against became
8217 invalid.
8218
8219 - SymbolTableEntry now has the ability to refer to a WatchpointSet. It can
8220 do so without incurring any space overhead for those entries that don't
8221 have WatchpointSets.
8222
8223 - The bytecode generator infers all global function variables to be
8224 watchable, and makes all stores perform the WatchpointSet's write check,
8225 and marks all loads as being potentially watchable (i.e. you can compile
8226 them to a watchpoint and a constant).
8227
8228 Put together, this allows for fully sleazy inlining of calls to globally
8229 declared functions. The inline prologue will no longer contain the load of
8230 the function, or any checks of the function you're calling. I.e. it's
8231 pretty much like the kind of inlining you would see in Java or C++.
8232 Furthermore, the watchpointing functionality is built to be fairly general,
8233 and should allow setting watchpoints on all sorts of interesting things
8234 in the future.
8235
8236 The sleazy inlining means that we will now sometimes inline in code paths
8237 that have never executed. Previously, to inline we would have either had
8238 to have executed the call (to read the call's inline cache) or have
8239 executed the method check (to read the method check's inline cache). Now,
8240 we might inline when the callee is a watched global variable. This
8241 revealed some humorous bugs. First, constant folding disagreed with CFA
8242 over what kinds of operations can clobber (example: code path A is dead
8243 but stores a String into variable X, all other code paths store 0 into
8244 X, and then you do CompareEq(X, 0) - CFA will say that this is a non-
8245 clobbering constant, but constant folding thought it was clobbering
8246 because it saw the String prediction). Second, inlining would crash if
8247 the inline callee had not been compiled. This patch fixes both bugs,
8248 since otherwise run-javascriptcore-tests would report regressions.
8249
8250 * CMakeLists.txt:
8251 * GNUmakefile.list.am:
8252 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8253 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8254 * JavaScriptCore.xcodeproj/project.pbxproj:
8255 * Target.pri:
8256 * assembler/ARMv7Assembler.h:
8257 (ARMv7Assembler):
8258 (JSC::ARMv7Assembler::ARMv7Assembler):
8259 (JSC::ARMv7Assembler::labelForWatchpoint):
8260 (JSC::ARMv7Assembler::label):
8261 (JSC::ARMv7Assembler::replaceWithJump):
8262 (JSC::ARMv7Assembler::maxJumpReplacementSize):
8263 * assembler/AbstractMacroAssembler.h:
8264 (JSC):
8265 (AbstractMacroAssembler):
8266 (Label):
8267 (JSC::AbstractMacroAssembler::watchpointLabel):
8268 (JSC::AbstractMacroAssembler::readPointer):
8269 * assembler/AssemblerBuffer.h:
8270 * assembler/MacroAssemblerARM.h:
8271 (JSC::MacroAssemblerARM::branchTest8):
8272 (MacroAssemblerARM):
8273 (JSC::MacroAssemblerARM::replaceWithJump):
8274 (JSC::MacroAssemblerARM::maxJumpReplacementSize):
8275 * assembler/MacroAssemblerARMv7.h:
8276 (JSC::MacroAssemblerARMv7::load8Signed):
8277 (JSC::MacroAssemblerARMv7::load16Signed):
8278 (MacroAssemblerARMv7):
8279 (JSC::MacroAssemblerARMv7::replaceWithJump):
8280 (JSC::MacroAssemblerARMv7::maxJumpReplacementSize):
8281 (JSC::MacroAssemblerARMv7::branchTest8):
8282 (JSC::MacroAssemblerARMv7::jump):
8283 (JSC::MacroAssemblerARMv7::makeBranch):
8284 * assembler/MacroAssemblerMIPS.h:
8285 (JSC::MacroAssemblerMIPS::branchTest8):
8286 (MacroAssemblerMIPS):
8287 (JSC::MacroAssemblerMIPS::replaceWithJump):
8288 (JSC::MacroAssemblerMIPS::maxJumpReplacementSize):
8289 * assembler/MacroAssemblerSH4.h:
8290 (JSC::MacroAssemblerSH4::branchTest8):
8291 (MacroAssemblerSH4):
8292 (JSC::MacroAssemblerSH4::replaceWithJump):
8293 (JSC::MacroAssemblerSH4::maxJumpReplacementSize):
8294 * assembler/MacroAssemblerX86.h:
8295 (MacroAssemblerX86):
8296 (JSC::MacroAssemblerX86::branchTest8):
8297 * assembler/MacroAssemblerX86Common.h:
8298 (JSC::MacroAssemblerX86Common::replaceWithJump):
8299 (MacroAssemblerX86Common):
8300 (JSC::MacroAssemblerX86Common::maxJumpReplacementSize):
8301 * assembler/MacroAssemblerX86_64.h:
8302 (MacroAssemblerX86_64):
8303 (JSC::MacroAssemblerX86_64::branchTest8):
8304 * assembler/X86Assembler.h:
8305 (JSC::X86Assembler::X86Assembler):
8306 (X86Assembler):
8307 (JSC::X86Assembler::cmpb_im):
8308 (JSC::X86Assembler::testb_im):
8309 (JSC::X86Assembler::labelForWatchpoint):
8310 (JSC::X86Assembler::label):
8311 (JSC::X86Assembler::replaceWithJump):
8312 (JSC::X86Assembler::maxJumpReplacementSize):
8313 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
8314 * bytecode/CodeBlock.cpp:
8315 (JSC):
8316 (JSC::CodeBlock::printGetByIdCacheStatus):
8317 (JSC::CodeBlock::dump):
8318 * bytecode/CodeBlock.h:
8319 (JSC::CodeBlock::appendOSRExit):
8320 (JSC::CodeBlock::appendSpeculationRecovery):
8321 (CodeBlock):
8322 (JSC::CodeBlock::appendWatchpoint):
8323 (JSC::CodeBlock::numberOfWatchpoints):
8324 (JSC::CodeBlock::watchpoint):
8325 (DFGData):
8326 * bytecode/DFGExitProfile.h:
8327 (JSC::DFG::exitKindToString):
8328 (JSC::DFG::exitKindIsCountable):
8329 * bytecode/GetByIdStatus.cpp:
8330 (JSC::GetByIdStatus::computeForChain):
8331 * bytecode/Instruction.h:
8332 (Instruction):
8333 (JSC::Instruction::Instruction):
8334 * bytecode/Opcode.h:
8335 (JSC):
8336 (JSC::padOpcodeName):
8337 * bytecode/Watchpoint.cpp: Added.
8338 (JSC):
8339 (JSC::Watchpoint::~Watchpoint):
8340 (JSC::Watchpoint::correctLabels):
8341 (JSC::Watchpoint::fire):
8342 (JSC::WatchpointSet::WatchpointSet):
8343 (JSC::WatchpointSet::~WatchpointSet):
8344 (JSC::WatchpointSet::add):
8345 (JSC::WatchpointSet::notifyWriteSlow):
8346 (JSC::WatchpointSet::fireAllWatchpoints):
8347 * bytecode/Watchpoint.h: Added.
8348 (JSC):
8349 (Watchpoint):
8350 (JSC::Watchpoint::Watchpoint):
8351 (JSC::Watchpoint::setDestination):
8352 (WatchpointSet):
8353 (JSC::WatchpointSet::isStillValid):
8354 (JSC::WatchpointSet::hasBeenInvalidated):
8355 (JSC::WatchpointSet::startWatching):
8356 (JSC::WatchpointSet::notifyWrite):
8357 (JSC::WatchpointSet::addressOfIsWatched):
8358 * bytecompiler/BytecodeGenerator.cpp:
8359 (JSC::ResolveResult::checkValidity):
8360 (JSC::BytecodeGenerator::addGlobalVar):
8361 (JSC::BytecodeGenerator::BytecodeGenerator):
8362 (JSC::BytecodeGenerator::resolve):
8363 (JSC::BytecodeGenerator::emitResolve):
8364 (JSC::BytecodeGenerator::emitResolveWithBase):
8365 (JSC::BytecodeGenerator::emitResolveWithThis):
8366 (JSC::BytecodeGenerator::emitGetStaticVar):
8367 (JSC::BytecodeGenerator::emitPutStaticVar):
8368 * bytecompiler/BytecodeGenerator.h:
8369 (BytecodeGenerator):
8370 * bytecompiler/NodesCodegen.cpp:
8371 (JSC::FunctionCallResolveNode::emitBytecode):
8372 (JSC::PostfixResolveNode::emitBytecode):
8373 (JSC::PrefixResolveNode::emitBytecode):
8374 (JSC::ReadModifyResolveNode::emitBytecode):
8375 (JSC::AssignResolveNode::emitBytecode):
8376 (JSC::ConstDeclNode::emitCodeSingle):
8377 * dfg/DFGAbstractState.cpp:
8378 (JSC::DFG::AbstractState::execute):
8379 (JSC::DFG::AbstractState::clobberStructures):
8380 * dfg/DFGAbstractState.h:
8381 (AbstractState):
8382 (JSC::DFG::AbstractState::didClobber):
8383 * dfg/DFGByteCodeParser.cpp:
8384 (JSC::DFG::ByteCodeParser::handleInlining):
8385 (JSC::DFG::ByteCodeParser::parseBlock):
8386 * dfg/DFGCCallHelpers.h:
8387 (CCallHelpers):
8388 (JSC::DFG::CCallHelpers::setupArguments):
8389 * dfg/DFGCSEPhase.cpp:
8390 (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
8391 (CSEPhase):
8392 (JSC::DFG::CSEPhase::globalVarStoreElimination):
8393 (JSC::DFG::CSEPhase::performNodeCSE):
8394 * dfg/DFGCapabilities.h:
8395 (JSC::DFG::canCompileOpcode):
8396 * dfg/DFGConstantFoldingPhase.cpp:
8397 (JSC::DFG::ConstantFoldingPhase::run):
8398 * dfg/DFGCorrectableJumpPoint.h:
8399 (JSC::DFG::CorrectableJumpPoint::isSet):
8400 (CorrectableJumpPoint):
8401 * dfg/DFGJITCompiler.cpp:
8402 (JSC::DFG::JITCompiler::linkOSRExits):
8403 (JSC::DFG::JITCompiler::link):
8404 * dfg/DFGNode.h:
8405 (JSC::DFG::Node::hasIdentifierNumberForCheck):
8406 (Node):
8407 (JSC::DFG::Node::identifierNumberForCheck):
8408 (JSC::DFG::Node::hasRegisterPointer):
8409 * dfg/DFGNodeType.h:
8410 (DFG):
8411 * dfg/DFGOSRExit.cpp:
8412 (JSC::DFG::OSRExit::OSRExit):
8413 * dfg/DFGOSRExit.h:
8414 (OSRExit):
8415 * dfg/DFGOperations.cpp:
8416 * dfg/DFGOperations.h:
8417 * dfg/DFGPredictionPropagationPhase.cpp:
8418 (JSC::DFG::PredictionPropagationPhase::propagate):
8419 * dfg/DFGSpeculativeJIT.h:
8420 (JSC::DFG::SpeculativeJIT::callOperation):
8421 (JSC::DFG::SpeculativeJIT::appendCall):
8422 (SpeculativeJIT):
8423 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
8424 * dfg/DFGSpeculativeJIT32_64.cpp:
8425 (JSC::DFG::SpeculativeJIT::compile):
8426 * dfg/DFGSpeculativeJIT64.cpp:
8427 (JSC::DFG::SpeculativeJIT::compile):
8428 * interpreter/Interpreter.cpp:
8429 (JSC::Interpreter::privateExecute):
8430 * jit/JIT.cpp:
8431 (JSC::JIT::privateCompileMainPass):
8432 (JSC::JIT::privateCompileSlowCases):
8433 * jit/JIT.h:
8434 * jit/JITPropertyAccess.cpp:
8435 (JSC::JIT::emit_op_put_global_var_check):
8436 (JSC):
8437 (JSC::JIT::emitSlow_op_put_global_var_check):
8438 * jit/JITPropertyAccess32_64.cpp:
8439 (JSC::JIT::emit_op_put_global_var_check):
8440 (JSC):
8441 (JSC::JIT::emitSlow_op_put_global_var_check):
8442 * jit/JITStubs.cpp:
8443 (JSC::DEFINE_STUB_FUNCTION):
8444 (JSC):
8445 * jit/JITStubs.h:
8446 * llint/LLIntSlowPaths.cpp:
8447 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
8448 (LLInt):
8449 * llint/LLIntSlowPaths.h:
8450 (LLInt):
8451 * llint/LowLevelInterpreter32_64.asm:
8452 * llint/LowLevelInterpreter64.asm:
8453 * runtime/JSObject.cpp:
8454 (JSC::JSObject::removeDirect):
8455 * runtime/JSObject.h:
8456 (JSObject):
8457 * runtime/JSSymbolTableObject.h:
8458 (JSC::symbolTableGet):
8459 (JSC::symbolTablePut):
8460 (JSC::symbolTablePutWithAttributes):
8461 * runtime/SymbolTable.cpp: Added.
8462 (JSC):
8463 (JSC::SymbolTableEntry::copySlow):
8464 (JSC::SymbolTableEntry::freeFatEntrySlow):
8465 (JSC::SymbolTableEntry::couldBeWatched):
8466 (JSC::SymbolTableEntry::attemptToWatch):
8467 (JSC::SymbolTableEntry::addressOfIsWatched):
8468 (JSC::SymbolTableEntry::addWatchpoint):
8469 (JSC::SymbolTableEntry::notifyWriteSlow):
8470 (JSC::SymbolTableEntry::inflateSlow):
8471 * runtime/SymbolTable.h:
8472 (JSC):
8473 (SymbolTableEntry):
8474 (Fast):
8475 (JSC::SymbolTableEntry::Fast::Fast):
8476 (JSC::SymbolTableEntry::Fast::isNull):
8477 (JSC::SymbolTableEntry::Fast::getIndex):
8478 (JSC::SymbolTableEntry::Fast::isReadOnly):
8479 (JSC::SymbolTableEntry::Fast::getAttributes):
8480 (JSC::SymbolTableEntry::Fast::isFat):
8481 (JSC::SymbolTableEntry::SymbolTableEntry):
8482 (JSC::SymbolTableEntry::~SymbolTableEntry):
8483 (JSC::SymbolTableEntry::operator=):
8484 (JSC::SymbolTableEntry::isNull):
8485 (JSC::SymbolTableEntry::getIndex):
8486 (JSC::SymbolTableEntry::getFast):
8487 (JSC::SymbolTableEntry::getAttributes):
8488 (JSC::SymbolTableEntry::isReadOnly):
8489 (JSC::SymbolTableEntry::watchpointSet):
8490 (JSC::SymbolTableEntry::notifyWrite):
8491 (FatEntry):
8492 (JSC::SymbolTableEntry::FatEntry::FatEntry):
8493 (JSC::SymbolTableEntry::isFat):
8494 (JSC::SymbolTableEntry::fatEntry):
8495 (JSC::SymbolTableEntry::inflate):
8496 (JSC::SymbolTableEntry::bits):
8497 (JSC::SymbolTableEntry::freeFatEntry):
8498 (JSC::SymbolTableEntry::pack):
8499 (JSC::SymbolTableEntry::isValidIndex):
8500
zandobersek@gmail.com88d53732012-06-13 09:38:42 +000085012012-06-13 Sheriff Bot <webkit.review.bot@gmail.com>
8502
8503 Unreviewed, rolling out r120172.
8504 http://trac.webkit.org/changeset/120172
8505 https://bugs.webkit.org/show_bug.cgi?id=88976
8506
8507 The patch causes compilation failures on Gtk, Qt and Apple Win
8508 bots (Requested by zdobersek on #webkit).
8509
8510 * CMakeLists.txt:
8511 * GNUmakefile.list.am:
8512 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
8513 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8514 * JavaScriptCore.xcodeproj/project.pbxproj:
8515 * Target.pri:
8516 * assembler/ARMv7Assembler.h:
8517 (JSC::ARMv7Assembler::nop):
8518 (JSC::ARMv7Assembler::label):
8519 (JSC::ARMv7Assembler::readPointer):
8520 (ARMv7Assembler):
8521 * assembler/AbstractMacroAssembler.h:
8522 (JSC):
8523 (AbstractMacroAssembler):
8524 (Label):
8525 * assembler/AssemblerBuffer.h:
8526 * assembler/MacroAssemblerARM.h:
8527 * assembler/MacroAssemblerARMv7.h:
8528 (JSC::MacroAssemblerARMv7::nop):
8529 (JSC::MacroAssemblerARMv7::jump):
8530 (JSC::MacroAssemblerARMv7::makeBranch):
8531 * assembler/MacroAssemblerMIPS.h:
8532 * assembler/MacroAssemblerSH4.h:
8533 * assembler/MacroAssemblerX86.h:
8534 (MacroAssemblerX86):
8535 (JSC::MacroAssemblerX86::moveWithPatch):
8536 * assembler/MacroAssemblerX86Common.h:
8537 * assembler/MacroAssemblerX86_64.h:
8538 (JSC::MacroAssemblerX86_64::branchTest8):
8539 * assembler/X86Assembler.h:
8540 (JSC::X86Assembler::cmpb_im):
8541 (JSC::X86Assembler::codeSize):
8542 (JSC::X86Assembler::label):
8543 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
8544 * bytecode/CodeBlock.cpp:
8545 (JSC::CodeBlock::dump):
8546 * bytecode/CodeBlock.h:
8547 (JSC::CodeBlock::appendOSRExit):
8548 (JSC::CodeBlock::appendSpeculationRecovery):
8549 (DFGData):
8550 * bytecode/DFGExitProfile.h:
8551 (JSC::DFG::exitKindToString):
8552 (JSC::DFG::exitKindIsCountable):
8553 * bytecode/Instruction.h:
8554 * bytecode/Opcode.h:
8555 (JSC):
8556 (JSC::padOpcodeName):
8557 * bytecode/Watchpoint.cpp: Removed.
8558 * bytecode/Watchpoint.h: Removed.
8559 * bytecompiler/BytecodeGenerator.cpp:
8560 (JSC::ResolveResult::checkValidity):
8561 (JSC::BytecodeGenerator::addGlobalVar):
8562 (JSC::BytecodeGenerator::BytecodeGenerator):
8563 (JSC::BytecodeGenerator::resolve):
8564 (JSC::BytecodeGenerator::emitResolve):
8565 (JSC::BytecodeGenerator::emitResolveWithBase):
8566 (JSC::BytecodeGenerator::emitResolveWithThis):
8567 (JSC::BytecodeGenerator::emitGetStaticVar):
8568 (JSC::BytecodeGenerator::emitPutStaticVar):
8569 * bytecompiler/BytecodeGenerator.h:
8570 (BytecodeGenerator):
8571 * bytecompiler/NodesCodegen.cpp:
8572 (JSC::FunctionCallResolveNode::emitBytecode):
8573 (JSC::PostfixResolveNode::emitBytecode):
8574 (JSC::PrefixResolveNode::emitBytecode):
8575 (JSC::ReadModifyResolveNode::emitBytecode):
8576 (JSC::AssignResolveNode::emitBytecode):
8577 (JSC::ConstDeclNode::emitCodeSingle):
8578 * dfg/DFGAbstractState.cpp:
8579 (JSC::DFG::AbstractState::execute):
8580 (JSC::DFG::AbstractState::clobberStructures):
8581 * dfg/DFGAbstractState.h:
8582 (AbstractState):
8583 * dfg/DFGByteCodeParser.cpp:
8584 (JSC::DFG::ByteCodeParser::handleInlining):
8585 (JSC::DFG::ByteCodeParser::parseBlock):
8586 * dfg/DFGCCallHelpers.h:
8587 (JSC::DFG::CCallHelpers::setupArguments):
8588 * dfg/DFGCSEPhase.cpp:
8589 (JSC::DFG::CSEPhase::globalVarStoreElimination):
8590 (JSC::DFG::CSEPhase::performNodeCSE):
8591 * dfg/DFGCapabilities.h:
8592 (JSC::DFG::canCompileOpcode):
8593 * dfg/DFGConstantFoldingPhase.cpp:
8594 (JSC::DFG::ConstantFoldingPhase::run):
8595 * dfg/DFGCorrectableJumpPoint.h:
8596 * dfg/DFGJITCompiler.cpp:
8597 (JSC::DFG::JITCompiler::linkOSRExits):
8598 (JSC::DFG::JITCompiler::link):
8599 * dfg/DFGNode.h:
8600 (JSC::DFG::Node::hasRegisterPointer):
8601 * dfg/DFGNodeType.h:
8602 (DFG):
8603 * dfg/DFGOSRExit.cpp:
8604 (JSC::DFG::OSRExit::OSRExit):
8605 * dfg/DFGOSRExit.h:
8606 (OSRExit):
8607 * dfg/DFGOperations.cpp:
8608 * dfg/DFGOperations.h:
8609 * dfg/DFGPredictionPropagationPhase.cpp:
8610 (JSC::DFG::PredictionPropagationPhase::propagate):
8611 * dfg/DFGSpeculativeJIT.h:
8612 (JSC::DFG::SpeculativeJIT::callOperation):
8613 (JSC::DFG::SpeculativeJIT::appendCallSetResult):
8614 (JSC::DFG::SpeculativeJIT::speculationCheck):
8615 * dfg/DFGSpeculativeJIT32_64.cpp:
8616 (JSC::DFG::SpeculativeJIT::compile):
8617 * dfg/DFGSpeculativeJIT64.cpp:
8618 (JSC::DFG::SpeculativeJIT::compile):
8619 * jit/JIT.cpp:
8620 (JSC::JIT::privateCompileMainPass):
8621 (JSC::JIT::privateCompileSlowCases):
8622 * jit/JIT.h:
8623 * jit/JITPropertyAccess.cpp:
8624 * jit/JITPropertyAccess32_64.cpp:
8625 * jit/JITStubs.cpp:
8626 * jit/JITStubs.h:
8627 * llint/LLIntSlowPaths.cpp:
8628 * llint/LLIntSlowPaths.h:
8629 (LLInt):
8630 * llint/LowLevelInterpreter32_64.asm:
8631 * llint/LowLevelInterpreter64.asm:
8632 * runtime/JSObject.cpp:
8633 (JSC::JSObject::removeDirect):
8634 * runtime/JSObject.h:
8635 (JSObject):
8636 * runtime/JSSymbolTableObject.h:
8637 (JSC::symbolTableGet):
8638 (JSC::symbolTablePut):
8639 (JSC::symbolTablePutWithAttributes):
8640 * runtime/SymbolTable.cpp: Removed.
8641 * runtime/SymbolTable.h:
8642 (JSC):
8643 (JSC::SymbolTableEntry::isNull):
8644 (JSC::SymbolTableEntry::getIndex):
8645 (SymbolTableEntry):
8646 (JSC::SymbolTableEntry::getAttributes):
8647 (JSC::SymbolTableEntry::isReadOnly):
8648 (JSC::SymbolTableEntry::pack):
8649 (JSC::SymbolTableEntry::isValidIndex):
8650
fpizlo@apple.com3bdd4c92012-06-13 04:56:22 +000086512012-06-12 Filip Pizlo <fpizlo@apple.com>
8652
fpizlo@apple.comb6c5eeb2012-06-13 08:20:39 +00008653 DFG should be able to set watchpoints on global variables
8654 https://bugs.webkit.org/show_bug.cgi?id=88692
8655
8656 Reviewed by Geoffrey Garen.
8657
8658 This implements global variable constant folding by allowing the optimizing
8659 compiler to set a "watchpoint" on globals that it wishes to constant fold.
8660 If the watchpoint fires, then an OSR exit is forced by overwriting the
8661 machine code that the optimizing compiler generated with a jump.
8662
8663 As such, this patch is adding quite a bit of stuff:
8664
8665 - Jump replacement on those hardware targets supported by the optimizing
8666 JIT. It is now possible to patch in a jump instruction over any recorded
8667 watchpoint label. The jump must be "local" in the sense that it must be
8668 within the range of the largest jump distance supported by a one
8669 instruction jump.
8670
8671 - WatchpointSets and Watchpoints. A Watchpoint is a doubly-linked list node
8672 that records the location where a jump must be inserted and the
8673 destination to which it should jump. Watchpoints can be added to a
8674 WatchpointSet. The WatchpointSet can be fired all at once, which plants
8675 all jumps. WatchpointSet also remembers if it had ever been invalidated,
8676 which allows for monotonicity: we typically don't want to optimize using
8677 watchpoints on something for which watchpoints had previously fired. The
8678 act of notifying a WatchpointSet has a trivial fast path in case no
8679 Watchpoints are registered (one-byte load+branch).
8680
8681 - SpeculativeJIT::speculationWatchpoint(). It's like speculationCheck(),
8682 except that you don't have to emit branches. But, you need to know what
8683 WatchpointSet to add the resulting Watchpoint to. Not everything that
8684 you could write a speculationCheck() for will have a WatchpointSet that
8685 would get notified if the condition you were speculating against became
8686 invalid.
8687
8688 - SymbolTableEntry now has the ability to refer to a WatchpointSet. It can
8689 do so without incurring any space overhead for those entries that don't
8690 have WatchpointSets.
8691
8692 - The bytecode generator infers all global function variables to be
8693 watchable, and makes all stores perform the WatchpointSet's write check,
8694 and marks all loads as being potentially watchable (i.e. you can compile
8695 them to a watchpoint and a constant).
8696
8697 Put together, this allows for fully sleazy inlining of calls to globally
8698 declared functions. The inline prologue will no longer contain the load of
8699 the function, or any checks of the function you're calling. I.e. it's
8700 pretty much like the kind of inlining you would see in Java or C++.
8701 Furthermore, the watchpointing functionality is built to be fairly general,
8702 and should allow setting watchpoints on all sorts of interesting things
8703 in the future.
8704
8705 The sleazy inlining means that we will now sometimes inline in code paths
8706 that have never executed. Previously, to inline we would have either had
8707 to have executed the call (to read the call's inline cache) or have
8708 executed the method check (to read the method check's inline cache). Now,
8709 we might inline when the callee is a watched global variable. This
8710 revealed some humorous bugs. First, constant folding disagreed with CFA
8711 over what kinds of operations can clobber (example: code path A is dead
8712 but stores a String into variable X, all other code paths store 0 into
8713 X, and then you do CompareEq(X, 0) - CFA will say that this is a non-
8714 clobbering constant, but constant folding thought it was clobbering
8715 because it saw the String prediction). Second, inlining would crash if
8716 the inline callee had not been compiled. This patch fixes both bugs,
8717 since otherwise run-javascriptcore-tests would report regressions.
8718
8719 * CMakeLists.txt:
8720 * GNUmakefile.list.am:
8721 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8722 * JavaScriptCore.xcodeproj/project.pbxproj:
8723 * Target.pri:
8724 * assembler/ARMv7Assembler.h:
8725 (ARMv7Assembler):
8726 (JSC::ARMv7Assembler::ARMv7Assembler):
8727 (JSC::ARMv7Assembler::labelForWatchpoint):
8728 (JSC::ARMv7Assembler::label):
8729 (JSC::ARMv7Assembler::replaceWithJump):
8730 (JSC::ARMv7Assembler::maxJumpReplacementSize):
8731 * assembler/AbstractMacroAssembler.h:
8732 (JSC):
8733 (AbstractMacroAssembler):
8734 (Label):
8735 (JSC::AbstractMacroAssembler::watchpointLabel):
8736 * assembler/AssemblerBuffer.h:
8737 * assembler/MacroAssemblerARM.h:
8738 (JSC::MacroAssemblerARM::replaceWithJump):
8739 (MacroAssemblerARM):
8740 (JSC::MacroAssemblerARM::maxJumpReplacementSize):
8741 * assembler/MacroAssemblerARMv7.h:
8742 (MacroAssemblerARMv7):
8743 (JSC::MacroAssemblerARMv7::replaceWithJump):
8744 (JSC::MacroAssemblerARMv7::maxJumpReplacementSize):
8745 (JSC::MacroAssemblerARMv7::branchTest8):
8746 (JSC::MacroAssemblerARMv7::jump):
8747 (JSC::MacroAssemblerARMv7::makeBranch):
8748 * assembler/MacroAssemblerMIPS.h:
8749 (JSC::MacroAssemblerMIPS::replaceWithJump):
8750 (MacroAssemblerMIPS):
8751 (JSC::MacroAssemblerMIPS::maxJumpReplacementSize):
8752 * assembler/MacroAssemblerSH4.h:
8753 (JSC::MacroAssemblerSH4::replaceWithJump):
8754 (MacroAssemblerSH4):
8755 (JSC::MacroAssemblerSH4::maxJumpReplacementSize):
8756 * assembler/MacroAssemblerX86.h:
8757 (MacroAssemblerX86):
8758 (JSC::MacroAssemblerX86::branchTest8):
8759 * assembler/MacroAssemblerX86Common.h:
8760 (JSC::MacroAssemblerX86Common::replaceWithJump):
8761 (MacroAssemblerX86Common):
8762 (JSC::MacroAssemblerX86Common::maxJumpReplacementSize):
8763 * assembler/MacroAssemblerX86_64.h:
8764 (MacroAssemblerX86_64):
8765 (JSC::MacroAssemblerX86_64::branchTest8):
8766 * assembler/X86Assembler.h:
8767 (JSC::X86Assembler::X86Assembler):
8768 (X86Assembler):
8769 (JSC::X86Assembler::cmpb_im):
8770 (JSC::X86Assembler::testb_im):
8771 (JSC::X86Assembler::labelForWatchpoint):
8772 (JSC::X86Assembler::label):
8773 (JSC::X86Assembler::replaceWithJump):
8774 (JSC::X86Assembler::maxJumpReplacementSize):
8775 (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
8776 * bytecode/CodeBlock.cpp:
8777 (JSC::CodeBlock::dump):
8778 * bytecode/CodeBlock.h:
8779 (JSC::CodeBlock::appendOSRExit):
8780 (JSC::CodeBlock::appendSpeculationRecovery):
8781 (CodeBlock):
8782 (JSC::CodeBlock::appendWatchpoint):
8783 (JSC::CodeBlock::numberOfWatchpoints):
8784 (JSC::CodeBlock::watchpoint):
8785 (DFGData):
8786 * bytecode/DFGExitProfile.h:
8787 (JSC::DFG::exitKindToString):
8788 (JSC::DFG::exitKindIsCountable):
8789 * bytecode/Instruction.h:
8790 (Instruction):
8791 (JSC::Instruction::Instruction):
8792 * bytecode/Opcode.h:
8793 (JSC):
8794 (JSC::padOpcodeName):
8795 * bytecode/Watchpoint.cpp: Added.
8796 (JSC):
8797 (JSC::Watchpoint::~Watchpoint):
8798 (JSC::Watchpoint::correctLabels):
8799 (JSC::Watchpoint::fire):
8800 (JSC::WatchpointSet::WatchpointSet):
8801 (JSC::WatchpointSet::~WatchpointSet):
8802 (JSC::WatchpointSet::add):
8803 (JSC::WatchpointSet::notifyWriteSlow):
8804 (JSC::WatchpointSet::fireAllWatchpoints):
8805 * bytecode/Watchpoint.h: Added.
8806 (JSC):
8807 (Watchpoint):
8808 (JSC::Watchpoint::Watchpoint):
8809 (JSC::Watchpoint::setDestination):
8810 (WatchpointSet):
8811 (JSC::WatchpointSet::isStillValid):
8812 (JSC::WatchpointSet::hasBeenInvalidated):
8813 (JSC::WatchpointSet::startWatching):
8814 (JSC::WatchpointSet::notifyWrite):
8815 (JSC::WatchpointSet::addressOfIsWatched):
8816 * bytecompiler/BytecodeGenerator.cpp:
8817 (JSC::ResolveResult::checkValidity):
8818 (JSC::BytecodeGenerator::addGlobalVar):
8819 (JSC::BytecodeGenerator::BytecodeGenerator):
8820 (JSC::BytecodeGenerator::resolve):
8821 (JSC::BytecodeGenerator::emitResolve):
8822 (JSC::BytecodeGenerator::emitResolveWithBase):
8823 (JSC::BytecodeGenerator::emitResolveWithThis):
8824 (JSC::BytecodeGenerator::emitGetStaticVar):
8825 (JSC::BytecodeGenerator::emitPutStaticVar):
8826 * bytecompiler/BytecodeGenerator.h:
8827 (BytecodeGenerator):
8828 * bytecompiler/NodesCodegen.cpp:
8829 (JSC::FunctionCallResolveNode::emitBytecode):
8830 (JSC::PostfixResolveNode::emitBytecode):
8831 (JSC::PrefixResolveNode::emitBytecode):
8832 (JSC::ReadModifyResolveNode::emitBytecode):
8833 (JSC::AssignResolveNode::emitBytecode):
8834 (JSC::ConstDeclNode::emitCodeSingle):
8835 * dfg/DFGAbstractState.cpp:
8836 (JSC::DFG::AbstractState::execute):
8837 (JSC::DFG::AbstractState::clobberStructures):
8838 * dfg/DFGAbstractState.h:
8839 (AbstractState):
8840 (JSC::DFG::AbstractState::didClobber):
8841 * dfg/DFGByteCodeParser.cpp:
8842 (JSC::DFG::ByteCodeParser::handleInlining):
8843 (JSC::DFG::ByteCodeParser::parseBlock):
8844 * dfg/DFGCCallHelpers.h:
8845 (CCallHelpers):
8846 (JSC::DFG::CCallHelpers::setupArguments):
8847 * dfg/DFGCSEPhase.cpp:
8848 (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
8849 (CSEPhase):
8850 (JSC::DFG::CSEPhase::globalVarStoreElimination):
8851 (JSC::DFG::CSEPhase::performNodeCSE):
8852 * dfg/DFGCapabilities.h:
8853 (JSC::DFG::canCompileOpcode):
8854 * dfg/DFGConstantFoldingPhase.cpp:
8855 (JSC::DFG::ConstantFoldingPhase::run):
8856 * dfg/DFGCorrectableJumpPoint.h:
8857 (JSC::DFG::CorrectableJumpPoint::isSet):
8858 (CorrectableJumpPoint):
8859 * dfg/DFGJITCompiler.cpp:
8860 (JSC::DFG::JITCompiler::linkOSRExits):
8861 (JSC::DFG::JITCompiler::link):
8862 * dfg/DFGNode.h:
8863 (JSC::DFG::Node::hasIdentifierNumberForCheck):
8864 (Node):
8865 (JSC::DFG::Node::identifierNumberForCheck):
8866 (JSC::DFG::Node::hasRegisterPointer):
8867 * dfg/DFGNodeType.h:
8868 (DFG):
8869 * dfg/DFGOSRExit.cpp:
8870 (JSC::DFG::OSRExit::OSRExit):
8871 * dfg/DFGOSRExit.h:
8872 (OSRExit):
8873 * dfg/DFGOperations.cpp:
8874 * dfg/DFGOperations.h:
8875 * dfg/DFGPredictionPropagationPhase.cpp:
8876 (JSC::DFG::PredictionPropagationPhase::propagate):
8877 * dfg/DFGSpeculativeJIT.h:
8878 (JSC::DFG::SpeculativeJIT::callOperation):
8879 (JSC::DFG::SpeculativeJIT::appendCall):
8880 (SpeculativeJIT):
8881 (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
8882 * dfg/DFGSpeculativeJIT32_64.cpp:
8883 (JSC::DFG::SpeculativeJIT::compile):
8884 * dfg/DFGSpeculativeJIT64.cpp:
8885 (JSC::DFG::SpeculativeJIT::compile):
8886 * jit/JIT.cpp:
8887 (JSC::JIT::privateCompileMainPass):
8888 (JSC::JIT::privateCompileSlowCases):
8889 * jit/JIT.h:
8890 * jit/JITPropertyAccess.cpp:
8891 (JSC::JIT::emit_op_put_global_var_check):
8892 (JSC):
8893 (JSC::JIT::emitSlow_op_put_global_var_check):
8894 * jit/JITPropertyAccess32_64.cpp:
8895 (JSC::JIT::emit_op_put_global_var_check):
8896 (JSC):
8897 (JSC::JIT::emitSlow_op_put_global_var_check):
8898 * jit/JITStubs.cpp:
8899 (JSC::JITThunks::JITThunks):
8900 (JSC::DEFINE_STUB_FUNCTION):
8901 (JSC):
8902 * jit/JITStubs.h:
8903 * llint/LLIntSlowPaths.cpp:
8904 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
8905 (LLInt):
8906 * llint/LLIntSlowPaths.h:
8907 (LLInt):
8908 * llint/LowLevelInterpreter32_64.asm:
8909 * llint/LowLevelInterpreter64.asm:
8910 * runtime/JSObject.cpp:
8911 (JSC::JSObject::removeDirect):
8912 * runtime/JSObject.h:
8913 (JSObject):
8914 * runtime/JSSymbolTableObject.h:
8915 (JSC::symbolTableGet):
8916 (JSC::symbolTablePut):
8917 (JSC::symbolTablePutWithAttributes):
8918 * runtime/SymbolTable.cpp: Added.
8919 (JSC):
8920 (JSC::SymbolTableEntry::copySlow):
8921 (JSC::SymbolTableEntry::freeFatEntrySlow):
8922 (JSC::SymbolTableEntry::couldBeWatched):
8923 (JSC::SymbolTableEntry::attemptToWatch):
8924 (JSC::SymbolTableEntry::addressOfIsWatched):
8925 (JSC::SymbolTableEntry::addWatchpoint):
8926 (JSC::SymbolTableEntry::notifyWriteSlow):
8927 (JSC::SymbolTableEntry::inflateSlow):
8928 * runtime/SymbolTable.h:
8929 (JSC):
8930 (SymbolTableEntry):
8931 (Fast):
8932 (JSC::SymbolTableEntry::Fast::Fast):
8933 (JSC::SymbolTableEntry::Fast::isNull):
8934 (JSC::SymbolTableEntry::Fast::getIndex):
8935 (JSC::SymbolTableEntry::Fast::isReadOnly):
8936 (JSC::SymbolTableEntry::Fast::getAttributes):
8937 (JSC::SymbolTableEntry::Fast::isFat):
8938 (JSC::SymbolTableEntry::SymbolTableEntry):
8939 (JSC::SymbolTableEntry::~SymbolTableEntry):
8940 (JSC::SymbolTableEntry::operator=):
8941 (JSC::SymbolTableEntry::isNull):
8942 (JSC::SymbolTableEntry::getIndex):
8943 (JSC::SymbolTableEntry::getFast):
8944 (JSC::SymbolTableEntry::getAttributes):
8945 (JSC::SymbolTableEntry::isReadOnly):
8946 (JSC::SymbolTableEntry::watchpointSet):
8947 (JSC::SymbolTableEntry::notifyWrite):
8948 (FatEntry):
8949 (JSC::SymbolTableEntry::FatEntry::FatEntry):
8950 (JSC::SymbolTableEntry::isFat):
8951 (JSC::SymbolTableEntry::fatEntry):
8952 (JSC::SymbolTableEntry::inflate):
8953 (JSC::SymbolTableEntry::bits):
8954 (JSC::SymbolTableEntry::freeFatEntry):
8955 (JSC::SymbolTableEntry::pack):
8956 (JSC::SymbolTableEntry::isValidIndex):
8957
89582012-06-12 Filip Pizlo <fpizlo@apple.com>
8959
fpizlo@apple.com3bdd4c92012-06-13 04:56:22 +00008960 Unreviewed build fix for ARMv7 debug builds.
8961
8962 * jit/JITStubs.cpp:
8963 (JSC::JITThunks::JITThunks):
8964
ggaren@apple.com3c89f392012-06-13 02:50:50 +000089652012-06-12 Geoffrey Garen <ggaren@apple.com>
8966
8967 Build fix for case-sensitive file systems: use the right case.
8968
8969 * heap/ListableHandler.h:
8970
ggaren@apple.com639160c2012-06-13 02:06:50 +000089712012-06-11 Geoffrey Garen <ggaren@apple.com>
8972
8973 GC should be 1.7X faster
8974 https://bugs.webkit.org/show_bug.cgi?id=88840
8975
8976 Reviewed by Oliver Hunt.
8977
8978 I profiled, and removed anything that showed up as a concurrency
8979 bottleneck. Then, I added 3 threads to our max thread count, since we
8980 can scale up to more threads now.
8981
8982 * heap/BlockAllocator.cpp:
8983 (JSC::BlockAllocator::BlockAllocator):
8984 (JSC::BlockAllocator::~BlockAllocator):
8985 (JSC::BlockAllocator::releaseFreeBlocks):
8986 (JSC::BlockAllocator::waitForRelativeTimeWhileHoldingLock):
8987 (JSC::BlockAllocator::waitForRelativeTime):
8988 (JSC::BlockAllocator::blockFreeingThreadMain):
8989 * heap/BlockAllocator.h:
8990 (BlockAllocator):
8991 (JSC::BlockAllocator::allocate):
8992 (JSC::BlockAllocator::deallocate): Use a spin lock for the common case
8993 where we're just popping a linked list. (A pthread mutex would sleep our
8994 thread even if the lock were only contended for a microsecond.)
8995
8996 Scope the lock to avoid holding it while allocating VM, since that's a
8997 slow activity and it doesn't modify any of our data structures.
8998
8999 We still use a pthread mutex to handle our condition variable since we
9000 have to, and it's not a hot path.
9001
9002 * heap/CopiedSpace.cpp:
9003 (JSC::CopiedSpace::CopiedSpace):
9004 (JSC::CopiedSpace::doneFillingBlock):
9005 * heap/CopiedSpace.h:
9006 (JSC::CopiedSpace::CopiedSpace): Use a spin lock for the to space lock,
9007 since it just guards linked list and hash table manipulation.
9008
9009 * heap/MarkStack.cpp:
9010 (JSC::MarkStackSegmentAllocator::MarkStackSegmentAllocator):
9011 (JSC::MarkStackSegmentAllocator::allocate):
9012 (JSC::MarkStackSegmentAllocator::release):
9013 (JSC::MarkStackSegmentAllocator::shrinkReserve): Use a spin lock, since
9014 we're just managing a linked list.
9015
9016 (JSC::MarkStackArray::donateSomeCellsTo): Changed donation to be proportional
9017 to our current stack size. This fixes cases where we used to donate too
9018 much. Interestingly, donating too much was starving the donor (when it
9019 ran out of work later) *and* the recipient (since it had to wait on a
9020 long donation operation to complete before it could acquire the lock).
9021
9022 In the worst case, we're still guaranteed to donate N cells in roughly log N time.
9023
9024 This change also fixes cases where we used to donate too little, since
9025 we would always keep a fixed minimum number of cells. In the worst case,
9026 with N marking threads, would could have N large object graph roots in
9027 our stack for the duration of GC, and scale to only 1 thread.
9028
9029 It's an interesting observation that a single object in the mark stack
9030 might represent an arbitrarily large object graph -- and only the act
9031 of marking can find out.
9032
9033 (JSC::MarkStackArray::stealSomeCellsFrom): Steal in proportion to idle
9034 threads. Once again, this fixes cases where constants could cause us
9035 to steal too much or too little.
9036
9037 (JSC::SlotVisitor::donateKnownParallel): Always wake up other threads
9038 if they're idle. We can afford to do this because we're conservative
9039 about when we donate.
9040
9041 (JSC::SlotVisitor::drainFromShared):
9042 * heap/MarkStack.h:
9043 (MarkStackSegmentAllocator):
9044 (MarkStackArray):
9045 (JSC):
9046 * heap/SlotVisitor.h: Merged the "should I donate?" decision into a
9047 single function, for simplicity.
9048
9049 * runtime/Options.cpp:
9050 (minimumNumberOfScansBetweenRebalance): Reduced the delay before donation
9051 a lot. We can afford to do this because, in the common case, donation is
9052 a single branch that decides not to donate.
9053
9054 (cpusToUse): Use more CPUs now, since we scale better now.
9055
9056 * runtime/Options.h:
9057 (Options): Removed now-unused variables.
9058
fpizlo@apple.com53ef1042012-06-13 01:29:07 +000090592012-06-12 Filip Pizlo <fpizlo@apple.com>
9060
9061 REGRESSION(120121): inspector tests crash in DFG
9062 https://bugs.webkit.org/show_bug.cgi?id=88941
9063
9064 Reviewed by Geoffrey Garen.
9065
9066 The CFG simplifier has two different ways of fixing up GetLocal, Phantom, and Flush. If we've
9067 already fixed up the node one way, we shouldn't try the other way. The reason why we shouldn't
9068 is that the second way depends on the node referring to other nodes in the to-be-jettisoned
9069 block. After fixup they potentially will refer to nodes in the block being merged to.
9070
9071 * dfg/DFGCFGSimplificationPhase.cpp:
9072 (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
9073 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
9074
leo.yang@torchmobile.com.cneac79cd2012-06-13 00:23:49 +000090752012-06-12 Leo Yang <leo.yang@torchmobile.com.cn>
9076
9077 Dynamic hash table in DOMObjectHashTableMap is wrong in multiple threads
9078 https://bugs.webkit.org/show_bug.cgi?id=87334
9079
9080 Reviewed by Geoffrey Garen.
9081
9082 Add a copy member function to JSC::HasTable. This function will copy all data
9083 members except for *table* which contains thread specific data that prevents
9084 up copying it. When you want to copy a JSC::HashTable that was constructed
9085 on another thread you should call JSC::HashTable::copy().
9086
9087 * runtime/Lookup.h:
9088 (JSC::HashTable::copy):
9089 (HashTable):
9090
fpizlo@apple.comdfd92802012-06-12 21:15:43 +000090912012-06-12 Filip Pizlo <fpizlo@apple.com>
9092
fpizlo@apple.com888325a2012-06-12 23:16:51 +00009093 DFG should not ASSERT if you have a double use of a variable that is not revealed to be a double
9094 until after CFG simplification
9095 https://bugs.webkit.org/show_bug.cgi?id=88927
9096 <rdar://problem/11513971>
9097
9098 Reviewed by Geoffrey Garen.
9099
9100 Speculation fixup needs to run if simplification did things, because simplification can change
9101 predictions - particularly if you had a control flow path that stored weird things into a
9102 variable, but that path got axed by the simplifier.
9103
9104 Running fixup in the fixpoint requires making it idempotent, which it previously wasn't. Only
9105 one place needed to be changed, namely the un-MustGenerate-ion of ValueToInt32.
9106
9107 * dfg/DFGDriver.cpp:
9108 (JSC::DFG::compile):
9109 * dfg/DFGFixupPhase.cpp:
9110 (JSC::DFG::FixupPhase::fixupNode):
9111
91122012-06-12 Filip Pizlo <fpizlo@apple.com>
9113
fpizlo@apple.comdfd92802012-06-12 21:15:43 +00009114 REGRESSION (r119779): Javascript TypeError: 'undefined' is not an object
9115 https://bugs.webkit.org/show_bug.cgi?id=88783
9116 <rdar://problem/11640299>
9117
9118 Reviewed by Geoffrey Garen.
9119
9120 If you don't keep alive the base of an object access over the various checks
9121 you do for the prototype chain, you're going to have a bad time.
9122
9123 * dfg/DFGByteCodeParser.cpp:
9124 (JSC::DFG::ByteCodeParser::handleGetById):
9125
commit-queue@webkit.orgce7e7ef2012-06-12 07:08:14 +000091262012-06-12 Hojong Han <hojong.han@samsung.com>
9127
9128 Property names of the built-in object cannot be retrieved
9129 after trying to delete one of its properties
9130 https://bugs.webkit.org/show_bug.cgi?id=86461
9131
9132 Reviewed by Gavin Barraclough.
9133
9134 * runtime/JSObject.cpp:
9135 (JSC::getClassPropertyNames):
9136 (JSC::JSObject::getOwnPropertyNames):
9137
gyuyoung.kim@samsung.com7a201592012-06-12 00:58:24 +000091382012-06-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
9139
9140 [CMAKE][EFL] Remove duplicated executable output path
9141 https://bugs.webkit.org/show_bug.cgi?id=88765
9142
9143 Reviewed by Daniel Bates.
9144
9145 CMake files for EFL port have redefined executable output path. However, EFL port doesn't
9146 need to define again because it is already defined in top-level CMake file.
9147
9148 * shell/CMakeLists.txt:
9149
carlosgc@webkit.orgf4fbe002012-06-11 15:31:19 +000091502012-06-11 Carlos Garcia Campos <cgarcia@igalia.com>
9151
9152 Unreviewed. Fix make distcheck issues.
9153
9154 * GNUmakefile.list.am: Remove non existent header file.
9155
paroga@webkit.org7a01e282012-06-10 12:25:57 +000091562012-06-10 Patrick Gansterer <paroga@webkit.org>
9157
paroga@webkit.orga601a8b2012-06-10 12:49:32 +00009158 Unreviewed. Build fix for !ENABLE(JIT) after r119844 and r119925.
9159
9160 * runtime/Executable.h:
9161 (ExecutableBase):
9162 (JSC::ExecutableBase::clearCodeVirtual):
9163
91642012-06-10 Patrick Gansterer <paroga@webkit.org>
9165
paroga@webkit.org7a01e282012-06-10 12:25:57 +00009166 Unreviewed. Build fix for !ENABLE(JIT) after r119844.
9167
9168 * runtime/Executable.h:
9169 (ExecutableBase):
9170 (JSC):
9171
dominicc@chromium.org2a95e332012-06-10 06:31:14 +000091722012-06-09 Dominic Cooney <dominicc@chromium.org>
9173
9174 [Chromium] Remove JavaScriptCore dependencies from gyp
9175 https://bugs.webkit.org/show_bug.cgi?id=88510
9176
9177 Reviewed by Adam Barth.
9178
9179 Chromium doesn't support JSC any more and there doesn't seem to be
9180 a strong interest in using GYP as the common build system in other
9181 ports.
9182
9183 * JavaScriptCore.gyp/JavaScriptCore.gyp: WebCore still depends on YARR interpreter.
9184 * JavaScriptCore.gypi: Only include YARR source.
9185 * gyp/JavaScriptCore.gyp: Removed.
9186 * gyp/gtk.gyp: Removed.
9187
ggaren@apple.com642da3e2012-06-09 17:34:30 +000091882012-06-09 Geoffrey Garen <ggaren@apple.com>
9189
9190 Unreviewed, rolling back in part2 of r118646.
9191
9192 This patch removes eager finalization.
9193
9194 Weak pointer finalization should be lazy
9195 https://bugs.webkit.org/show_bug.cgi?id=87599
9196
9197 Reviewed by Sam Weinig.
9198
9199 * heap/Heap.cpp:
9200 (JSC::Heap::collect): Don't finalize eagerly -- we'll do it lazily.
9201
9202 * heap/MarkedBlock.cpp:
9203 (JSC::MarkedBlock::sweep): Do sweep weak sets when sweeping a block,
9204 since we won't get another chance.
9205
9206 * heap/MarkedBlock.h:
9207 (JSC::MarkedBlock::sweepWeakSet):
9208 * heap/MarkedSpace.cpp:
9209 (MarkedSpace::WeakSetSweep):
9210 * heap/MarkedSpace.h:
9211 (JSC::MarkedSpace::sweepWeakSets): Removed now-unused code.
9212
commit-queue@webkit.org5deb7492012-06-09 09:05:22 +000092132012-06-09 Sukolsak Sakshuwong <sukolsak@google.com>
9214
9215 Add UNDO_MANAGER flag
9216 https://bugs.webkit.org/show_bug.cgi?id=87908
9217
9218 Reviewed by Tony Chang.
9219
9220 * Configurations/FeatureDefines.xcconfig:
9221
ggaren@apple.com642da3e2012-06-09 17:34:30 +000092222012-06-08 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com218a16a2012-06-08 23:57:58 +00009223
9224 Unreviewed, rolling back in part1 of r118646.
9225
9226 This patch includes everything necessary for lazy finalization, but
9227 keeps eager finalization enabled for the time being.
9228
9229 Weak pointer finalization should be lazy
9230 https://bugs.webkit.org/show_bug.cgi?id=87599
9231
9232 Reviewed by Sam Weinig.
9233
9234 * heap/MarkedBlock.cpp:
9235 * heap/MarkedBlock.h:
9236 (JSC::MarkedBlock::resetAllocator):
9237 * heap/MarkedSpace.cpp:
9238 (JSC::MarkedSpace::resetAllocators):
9239 * heap/MarkedSpace.h:
9240 (JSC::MarkedSpace::resetAllocators): Don't force allocator reset anymore.
9241 It will happen automatically when a weak set is swept. It's simpler to
9242 have only one canonical way for this to happen, and it wasn't buying
9243 us anything to do it eagerly.
9244 * heap/WeakBlock.cpp:
9245 (JSC::WeakBlock::sweep): Don't short-circuit a sweep unless we know
9246 the sweep would be a no-op. If even one finalizer is pending, we need to
9247 run it, since we won't get another chance.
9248 * heap/WeakSet.cpp:
9249 (JSC::WeakSet::sweep): This loop can be simpler now that
9250 WeakBlock::sweep() does what we mean.
9251 Reset our allocator after a sweep because this is the optimal time to
9252 start trying to recycle old weak pointers.
9253 (JSC::WeakSet::tryFindAllocator): Don't sweep when searching for an
9254 allocator because we've swept already, and forcing a new sweep would be
9255 wasteful.
9256 * heap/WeakSet.h:
9257 (JSC::WeakSet::shrink): Be sure to reset our allocator after a shrink
9258 because the shrink may have removed the block the allocator was going to
9259 allocate out of.
9260
barraclough@apple.com9dd771c2012-06-08 21:30:35 +000092612012-06-08 Gavin Barraclough <barraclough@apple.com>
9262
9263 Unreviewed roll out r119795.
9264
9265 This broke jquery/core.html
9266
9267 * dfg/DFGSpeculativeJIT.h:
9268 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
9269 * jit/JITInlineMethods.h:
9270 (JSC::JIT::emitAllocateBasicJSObject):
9271 * llint/LowLevelInterpreter.asm:
9272 * runtime/JSGlobalData.h:
9273 (JSGlobalData):
9274 * runtime/JSGlobalThis.cpp:
9275 (JSC::JSGlobalThis::setUnwrappedObject):
9276 * runtime/JSObject.cpp:
9277 (JSC::JSObject::visitChildren):
9278 (JSC::JSObject::createInheritorID):
9279 * runtime/JSObject.h:
9280 (JSObject):
9281 (JSC::JSObject::resetInheritorID):
9282 (JSC):
9283 (JSC::JSObject::offsetOfInheritorID):
9284 (JSC::JSObject::inheritorID):
9285
fpizlo@apple.com0bcbc112012-06-08 20:02:57 +000092862012-06-08 Filip Pizlo <fpizlo@apple.com>
9287
9288 PredictedType should be called SpeculatedType
9289 https://bugs.webkit.org/show_bug.cgi?id=88477
9290
9291 Unreviewed, fix a renaming goof from http://trac.webkit.org/changeset/119660.
9292 I accidentally renamed ByteCodeParser::getPrediction to
9293 ByteCodeParser::getSpeculation. That was not the intent. This changes it
9294 back.
9295
9296 * dfg/DFGByteCodeParser.cpp:
9297 (JSC::DFG::ByteCodeParser::addCall):
9298 (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
9299 (JSC::DFG::ByteCodeParser::getPrediction):
9300 (JSC::DFG::ByteCodeParser::handleCall):
9301 (JSC::DFG::ByteCodeParser::parseBlock):
9302
wingo@igalia.com332e9bf2012-06-08 19:57:40 +000093032012-06-08 Andy Wingo <wingo@igalia.com>
9304
9305 Explictly mark stubs called by JIT as being internal
9306 https://bugs.webkit.org/show_bug.cgi?id=88552
9307
9308 Reviewed by Filip Pizlo.
9309
9310 * dfg/DFGOSRExitCompiler.h:
9311 * dfg/DFGOperations.cpp:
9312 * dfg/DFGOperations.h:
9313 * jit/HostCallReturnValue.h:
9314 * jit/JITStubs.cpp:
9315 * jit/JITStubs.h:
9316 * jit/ThunkGenerators.cpp:
9317 * llint/LLIntSlowPaths.h: Mark a bunch of stubs as being
9318 WTF_INTERNAL. Change most calls to SYMBOL_STRING_RELOCATION to
9319 LOCAL_REFERENCE, or GLOBAL_REFERENCE in the case of the wrappers
9320 to truly global symbols.
9321 * offlineasm/asm.rb: Generate LOCAL_REFERENCE instead of
9322 SYMBOL_STRING_RELOCATION.
9323
fpizlo@apple.comf4a2ac32012-06-08 20:04:47 +000093242012-06-08 Geoffrey Garen <ggaren@apple.com>
9325
ggaren@apple.comd7147572012-06-08 18:17:16 +00009326 Don't rely on weak pointers for eager CodeBlock finalization
9327 https://bugs.webkit.org/show_bug.cgi?id=88465
9328
9329 Reviewed by Gavin Barraclough.
9330
9331 This is incompatible with lazy weak pointer finalization.
9332
9333 I considered just making CodeBlock finalization lazy-friendly, but it
9334 turns out that the heap is already way up in CodeBlock's business when
9335 it comes to finalization, so I decided to finish the job and move full
9336 responsibility for CodeBlock finalization into the heap.
9337
9338 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Maybe this
9339 will build.
9340
9341 * debugger/Debugger.cpp: Updated for rename.
9342
9343 * heap/Heap.cpp:
9344 (JSC::Heap::deleteAllCompiledCode): Renamed for consistency. Fixed a bug
9345 where we would not delete code for a code block that had been previously
9346 jettisoned. I don't know if this happens in practice -- I mostly did
9347 this to improve consistency with deleteUnmarkedCompiledCode.
9348
9349 (JSC::Heap::deleteUnmarkedCompiledCode): New function, responsible for
9350 eager finalization of unmarked code blocks.
9351
9352 (JSC::Heap::collect): Updated for rename. Updated to call
9353 deleteUnmarkedCompiledCode(), which takes care of jettisoned DFG code
9354 blocks too.
9355
9356 (JSC::Heap::addCompiledCode): Renamed, since this points to all code
9357 now, not just functions.
9358
9359 * heap/Heap.h:
9360 (Heap): Keep track of all user code, not just functions. This is a
9361 negligible additional overhead, since most code is function code.
9362
9363 * runtime/Executable.cpp:
9364 (JSC::*::finalize): Removed these functions, since we don't rely on
9365 weak pointer finalization anymore.
9366
9367 (JSC::FunctionExecutable::FunctionExecutable): Moved linked-list stuff
9368 into base class so all executables can be in the list.
9369
9370 (JSC::EvalExecutable::clearCode):
9371 (JSC::ProgramExecutable::clearCode):
9372 (JSC::FunctionExecutable::clearCode): All we need to do is delete our
9373 CodeBlock -- that will delete all of its internal data structures.
9374
9375 (JSC::FunctionExecutable::clearCodeIfNotCompiling): Factored out a helper
9376 function to improve clarity.
9377
9378 * runtime/Executable.h:
9379 (JSC::ExecutableBase): Moved linked-list stuff
9380 into base class so all executables can be in the list.
9381
9382 (JSC::NativeExecutable::create):
9383 (NativeExecutable):
9384 (ScriptExecutable):
9385 (JSC::ScriptExecutable::finishCreation):
9386 (JSC::EvalExecutable::create):
9387 (EvalExecutable):
9388 (JSC::ProgramExecutable::create):
9389 (ProgramExecutable):
9390 (FunctionExecutable):
9391 (JSC::FunctionExecutable::create): Don't use a finalizer -- the heap
9392 will call us back to destroy our code block.
9393
9394 (JSC::FunctionExecutable::discardCode): Renamed to clearCodeIfNotCompiling()
9395 for clarity.
9396
9397 (JSC::FunctionExecutable::isCompiling): New helper function, for clarity.
9398
9399 (JSC::ScriptExecutable::clearCodeVirtual): New helper function, since
9400 the heap needs to make polymorphic calls to clear code.
9401
9402 * runtime/JSGlobalData.cpp:
9403 (JSC::StackPreservingRecompiler::operator()):
9404 * runtime/JSGlobalObject.cpp:
9405 (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for
9406 renames.
9407
fpizlo@apple.comfd598b92012-06-08 01:31:21 +000094082012-06-07 Filip Pizlo <fpizlo@apple.com>
9409
9410 DFG should inline prototype chain accesses, and do the right things if the
9411 specific function optimization is available
9412 https://bugs.webkit.org/show_bug.cgi?id=88594
9413
9414 Reviewed by Gavin Barraclough.
9415
9416 Looks like a 3% win on V8.
9417
9418 * bytecode/CodeBlock.h:
9419 (JSC::Structure::prototypeForLookup):
9420 (JSC):
9421 * bytecode/GetByIdStatus.cpp:
9422 (JSC::GetByIdStatus::computeFromLLInt):
9423 (JSC):
9424 (JSC::GetByIdStatus::computeForChain):
9425 (JSC::GetByIdStatus::computeFor):
9426 * bytecode/GetByIdStatus.h:
9427 (JSC::GetByIdStatus::GetByIdStatus):
9428 (JSC::GetByIdStatus::isSimple):
9429 (JSC::GetByIdStatus::chain):
9430 (JSC::GetByIdStatus::specificValue):
9431 (GetByIdStatus):
9432 * bytecode/StructureSet.h:
9433 (StructureSet):
9434 (JSC::StructureSet::singletonStructure):
9435 * bytecode/StructureStubInfo.h:
9436 (JSC::StructureStubInfo::initGetByIdProto):
9437 (JSC::StructureStubInfo::initGetByIdChain):
9438 * dfg/DFGByteCodeParser.cpp:
9439 (JSC::DFG::ByteCodeParser::handleGetById):
9440 * dfg/DFGRepatch.cpp:
9441 (JSC::DFG::tryCacheGetByID):
9442 * jit/JITStubs.cpp:
9443 (JSC::JITThunks::tryCacheGetByID):
9444 * runtime/JSGlobalObject.h:
9445 (JSC::Structure::prototypeForLookup):
9446 (JSC):
9447 * runtime/Structure.h:
9448 (Structure):
9449
barraclough@apple.com48386932012-06-08 00:29:27 +000094502012-06-07 Gavin Barraclough <barraclough@apple.com>
9451
barraclough@apple.com64b74e02012-06-08 04:25:58 +00009452 Remove JSObject::m_inheritorID
9453 https://bugs.webkit.org/show_bug.cgi?id=88378
9454
9455 Reviewed by Geoff Garen.
9456
9457 This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
9458 and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
9459 Instead use a private named value in the object's property storage.
9460
9461 * dfg/DFGSpeculativeJIT.h:
9462 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
9463 - No need m_inheritorID to initialize!
9464 * jit/JITInlineMethods.h:
9465 (JSC::JIT::emitAllocateBasicJSObject):
9466 - No need m_inheritorID to initialize!
9467 * llint/LowLevelInterpreter.asm:
9468 - No need m_inheritorID to initialize!
9469 * runtime/JSGlobalData.h:
9470 (JSGlobalData):
9471 - Added private name 'm_inheritorIDKey'.
9472 * runtime/JSGlobalThis.cpp:
9473 (JSC::JSGlobalThis::setUnwrappedObject):
9474 - resetInheritorID is now passed a JSGlobalData&.
9475 * runtime/JSObject.cpp:
9476 (JSC::JSObject::visitChildren):
9477 - No m_inheritorID to be marked.
9478 (JSC::JSObject::createInheritorID):
9479 - Store the newly created inheritorID in the property map.
9480 * runtime/JSObject.h:
9481 (JSC::JSObject::resetInheritorID):
9482 - Remove the inheritorID from property storage.
9483 (JSC::JSObject::inheritorID):
9484 - Read the inheritorID from property storage.
9485
94862012-06-07 Gavin Barraclough <barraclough@apple.com>
9487
barraclough@apple.com48386932012-06-08 00:29:27 +00009488 Math.pow on iOS does not support denormal numbers.
9489 https://bugs.webkit.org/show_bug.cgi?id=88592
9490
9491 Reviewed by Filip Pizlo.
9492
9493 Import an implementation from fdlibm, detect cases where it is safe to use the system
9494 implementation & where we should fall back to fdlibm.
9495
9496 * runtime/MathObject.cpp:
9497 (JSC::isDenormal):
9498 (JSC::isEdgeCase):
9499 (JSC::mathPow):
9500 - On iOS, detect cases where denormal support may be required & use fdlibm in these cases.
9501 (JSC::mathProtoFuncPow):
9502 - Changed to use mathPow.
9503 (JSC::fdlibmScalbn):
9504 (JSC::fdlibmPow):
9505 - These functions imported from fdlibm; original style retained to ease future merging.
9506
paroga@webkit.orga334f732012-06-07 23:24:14 +000095072012-06-07 Patrick Gansterer <paroga@webkit.org>
9508
9509 Unreviewed. Build fix for !ENABLE(JIT) after r119441.
9510
9511 * interpreter/Interpreter.cpp:
9512 (JSC::Interpreter::privateExecute):
9513
wingo@igalia.comb8305a82012-06-07 16:05:19 +000095142012-06-07 Andy Wingo <wingo@igalia.com>
9515
9516 Unreviewed build fix after r119593.
9517
9518 * llint/LLIntOfflineAsmConfig.h (OFFLINE_ASM_GLOBAL_LABEL): Fix
9519 uses of "name" to be "label", the macro's parameter. Otherwise we
9520 serialize mentions of the literal symbol "name" into the objcode.
9521 Causes a build error using GNU ld (not gold).
9522
rniwa@webkit.org475cf8d2012-06-07 02:47:14 +000095232012-06-06 Ryosuke Niwa <rniwa@webkit.org>
9524
9525 Chromium build fix attempt. Why do we need to list these files in gyp!?
9526
9527 * JavaScriptCore.gypi:
9528
fpizlo@apple.comd5547492012-06-07 00:23:36 +000095292012-06-06 Filip Pizlo <fpizlo@apple.com>
9530
fpizlo@apple.com62336162012-06-07 01:35:59 +00009531 PredictedType should be called SpeculatedType
9532 https://bugs.webkit.org/show_bug.cgi?id=88477
9533
9534 Rubber stamped by Gavin Barraclough.
9535
9536 * CMakeLists.txt:
9537 * GNUmakefile.list.am:
9538 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
9539 * JavaScriptCore.xcodeproj/project.pbxproj:
9540 * Target.pri:
9541 * bytecode/CodeBlock.cpp:
9542 (JSC::CodeBlock::shouldOptimizeNow):
9543 (JSC::CodeBlock::dumpValueProfiles):
9544 * bytecode/CodeBlock.h:
9545 (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset):
9546 * bytecode/LazyOperandValueProfile.cpp:
9547 (JSC::LazyOperandValueProfileParser::prediction):
9548 * bytecode/LazyOperandValueProfile.h:
9549 (LazyOperandValueProfileParser):
9550 * bytecode/PredictedType.cpp: Removed.
9551 * bytecode/PredictedType.h: Removed.
9552 * bytecode/SpeculatedType.cpp: Copied from Source/JavaScriptCore/bytecode/PredictedType.cpp.
9553 (JSC::speculationToString):
9554 (JSC::speculationToAbbreviatedString):
9555 (JSC::speculationFromClassInfo):
9556 (JSC::speculationFromStructure):
9557 (JSC::speculationFromCell):
9558 (JSC::speculationFromValue):
9559 * bytecode/SpeculatedType.h: Copied from Source/JavaScriptCore/bytecode/PredictedType.h.
9560 (JSC):
9561 (JSC::isAnySpeculation):
9562 (JSC::isCellSpeculation):
9563 (JSC::isObjectSpeculation):
9564 (JSC::isFinalObjectSpeculation):
9565 (JSC::isFinalObjectOrOtherSpeculation):
9566 (JSC::isFixedIndexedStorageObjectSpeculation):
9567 (JSC::isStringSpeculation):
9568 (JSC::isArraySpeculation):
9569 (JSC::isFunctionSpeculation):
9570 (JSC::isInt8ArraySpeculation):
9571 (JSC::isInt16ArraySpeculation):
9572 (JSC::isInt32ArraySpeculation):
9573 (JSC::isUint8ArraySpeculation):
9574 (JSC::isUint8ClampedArraySpeculation):
9575 (JSC::isUint16ArraySpeculation):
9576 (JSC::isUint32ArraySpeculation):
9577 (JSC::isFloat32ArraySpeculation):
9578 (JSC::isFloat64ArraySpeculation):
9579 (JSC::isArgumentsSpeculation):
9580 (JSC::isActionableIntMutableArraySpeculation):
9581 (JSC::isActionableFloatMutableArraySpeculation):
9582 (JSC::isActionableTypedMutableArraySpeculation):
9583 (JSC::isActionableMutableArraySpeculation):
9584 (JSC::isActionableArraySpeculation):
9585 (JSC::isArrayOrOtherSpeculation):
9586 (JSC::isMyArgumentsSpeculation):
9587 (JSC::isInt32Speculation):
9588 (JSC::isDoubleRealSpeculation):
9589 (JSC::isDoubleSpeculation):
9590 (JSC::isNumberSpeculation):
9591 (JSC::isBooleanSpeculation):
9592 (JSC::isOtherSpeculation):
9593 (JSC::isEmptySpeculation):
9594 (JSC::mergeSpeculations):
9595 (JSC::mergeSpeculation):
9596 * bytecode/StructureSet.h:
9597 (JSC::StructureSet::speculationFromStructures):
9598 * bytecode/ValueProfile.h:
9599 (JSC::ValueProfileBase::ValueProfileBase):
9600 (JSC::ValueProfileBase::dump):
9601 (JSC::ValueProfileBase::computeUpdatedPrediction):
9602 (ValueProfileBase):
9603 * dfg/DFGAbstractState.cpp:
9604 (JSC::DFG::AbstractState::initialize):
9605 (JSC::DFG::AbstractState::execute):
9606 (JSC::DFG::AbstractState::mergeStateAtTail):
9607 * dfg/DFGAbstractState.h:
9608 (JSC::DFG::AbstractState::speculateInt32Unary):
9609 (JSC::DFG::AbstractState::speculateNumberUnary):
9610 (JSC::DFG::AbstractState::speculateBooleanUnary):
9611 (JSC::DFG::AbstractState::speculateInt32Binary):
9612 (JSC::DFG::AbstractState::speculateNumberBinary):
9613 * dfg/DFGAbstractValue.h:
9614 (JSC::DFG::StructureAbstractValue::filter):
9615 (JSC::DFG::StructureAbstractValue::speculationFromStructures):
9616 (JSC::DFG::AbstractValue::AbstractValue):
9617 (JSC::DFG::AbstractValue::clear):
9618 (JSC::DFG::AbstractValue::isClear):
9619 (JSC::DFG::AbstractValue::makeTop):
9620 (JSC::DFG::AbstractValue::clobberStructures):
9621 (JSC::DFG::AbstractValue::isTop):
9622 (JSC::DFG::AbstractValue::set):
9623 (JSC::DFG::AbstractValue::merge):
9624 (JSC::DFG::AbstractValue::filter):
9625 (JSC::DFG::AbstractValue::validateIgnoringValue):
9626 (JSC::DFG::AbstractValue::validate):
9627 (JSC::DFG::AbstractValue::checkConsistency):
9628 (JSC::DFG::AbstractValue::dump):
9629 (AbstractValue):
9630 * dfg/DFGArgumentPosition.h:
9631 (JSC::DFG::ArgumentPosition::ArgumentPosition):
9632 (JSC::DFG::ArgumentPosition::mergeArgumentAwareness):
9633 (JSC::DFG::ArgumentPosition::prediction):
9634 (ArgumentPosition):
9635 * dfg/DFGArgumentsSimplificationPhase.cpp:
9636 (JSC::DFG::ArgumentsSimplificationPhase::run):
9637 * dfg/DFGByteCodeParser.cpp:
9638 (ByteCodeParser):
9639 (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation):
9640 (JSC::DFG::ByteCodeParser::getLocal):
9641 (JSC::DFG::ByteCodeParser::getArgument):
9642 (JSC::DFG::ByteCodeParser::addCall):
9643 (JSC::DFG::ByteCodeParser::getSpeculationWithoutOSRExit):
9644 (JSC::DFG::ByteCodeParser::getSpeculation):
9645 (InlineStackEntry):
9646 (JSC::DFG::ByteCodeParser::handleCall):
9647 (JSC::DFG::ByteCodeParser::handleIntrinsic):
9648 (JSC::DFG::ByteCodeParser::handleGetById):
9649 (JSC::DFG::ByteCodeParser::parseBlock):
9650 (JSC::DFG::ByteCodeParser::fixVariableAccessSpeculations):
9651 (JSC::DFG::ByteCodeParser::parse):
9652 * dfg/DFGCSEPhase.cpp:
9653 (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
9654 (JSC::DFG::CSEPhase::performNodeCSE):
9655 * dfg/DFGConstantFoldingPhase.cpp:
9656 (JSC::DFG::ConstantFoldingPhase::run):
9657 * dfg/DFGFixupPhase.cpp:
9658 (JSC::DFG::FixupPhase::fixupNode):
9659 (JSC::DFG::FixupPhase::fixDoubleEdge):
9660 * dfg/DFGGraph.cpp:
9661 (JSC::DFG::Graph::nameOfVariableAccessData):
9662 (JSC::DFG::Graph::dump):
9663 (JSC::DFG::Graph::predictArgumentTypes):
9664 * dfg/DFGGraph.h:
9665 (JSC::DFG::Graph::getJSConstantSpeculation):
9666 (JSC::DFG::Graph::isPredictedNumerical):
9667 (JSC::DFG::Graph::byValIsPure):
9668 * dfg/DFGJITCompiler.h:
9669 (JSC::DFG::JITCompiler::getSpeculation):
9670 * dfg/DFGNode.h:
9671 (JSC::DFG::Node::Node):
9672 (JSC::DFG::Node::getHeapPrediction):
9673 (JSC::DFG::Node::predictHeap):
9674 (JSC::DFG::Node::prediction):
9675 (JSC::DFG::Node::predict):
9676 (JSC::DFG::Node::shouldSpeculateInteger):
9677 (JSC::DFG::Node::shouldSpeculateDouble):
9678 (JSC::DFG::Node::shouldSpeculateNumber):
9679 (JSC::DFG::Node::shouldSpeculateBoolean):
9680 (JSC::DFG::Node::shouldSpeculateFinalObject):
9681 (JSC::DFG::Node::shouldSpeculateFinalObjectOrOther):
9682 (JSC::DFG::Node::shouldSpeculateArray):
9683 (JSC::DFG::Node::shouldSpeculateArguments):
9684 (JSC::DFG::Node::shouldSpeculateInt8Array):
9685 (JSC::DFG::Node::shouldSpeculateInt16Array):
9686 (JSC::DFG::Node::shouldSpeculateInt32Array):
9687 (JSC::DFG::Node::shouldSpeculateUint8Array):
9688 (JSC::DFG::Node::shouldSpeculateUint8ClampedArray):
9689 (JSC::DFG::Node::shouldSpeculateUint16Array):
9690 (JSC::DFG::Node::shouldSpeculateUint32Array):
9691 (JSC::DFG::Node::shouldSpeculateFloat32Array):
9692 (JSC::DFG::Node::shouldSpeculateFloat64Array):
9693 (JSC::DFG::Node::shouldSpeculateArrayOrOther):
9694 (JSC::DFG::Node::shouldSpeculateObject):
9695 (JSC::DFG::Node::shouldSpeculateCell):
9696 (Node):
9697 * dfg/DFGPredictionPropagationPhase.cpp:
9698 (JSC::DFG::PredictionPropagationPhase::setPrediction):
9699 (JSC::DFG::PredictionPropagationPhase::mergePrediction):
9700 (JSC::DFG::PredictionPropagationPhase::propagate):
9701 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
9702 * dfg/DFGSpeculativeJIT.cpp:
9703 (JSC::DFG::SpeculativeJIT::fillStorage):
9704 (JSC::DFG::SpeculativeJIT::writeBarrier):
9705 (JSC::DFG::GPRTemporary::GPRTemporary):
9706 (JSC::DFG::FPRTemporary::FPRTemporary):
9707 (JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch):
9708 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
9709 (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
9710 (JSC::DFG::SpeculativeJIT::compile):
9711 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
9712 (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt):
9713 (JSC::DFG::SpeculativeJIT::compileGetByValOnString):
9714 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
9715 (JSC::DFG::SpeculativeJIT::compileDoubleAsInt32):
9716 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
9717 (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength):
9718 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
9719 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
9720 (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
9721 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
9722 (JSC::DFG::SpeculativeJIT::compileInstanceOf):
9723 (JSC::DFG::SpeculativeJIT::compileAdd):
9724 (JSC::DFG::SpeculativeJIT::compileArithSub):
9725 (JSC::DFG::SpeculativeJIT::compileArithNegate):
9726 (JSC::DFG::SpeculativeJIT::compileArithMul):
9727 (JSC::DFG::SpeculativeJIT::compileArithMod):
9728 (JSC::DFG::SpeculativeJIT::compare):
9729 (JSC::DFG::SpeculativeJIT::compileStrictEq):
9730 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
9731 (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
9732 (JSC::DFG::SpeculativeJIT::compileGetArgumentsLength):
9733 (JSC::DFG::SpeculativeJIT::compileRegExpExec):
9734 * dfg/DFGSpeculativeJIT.h:
9735 (DFG):
9736 (JSC::DFG::ValueSource::forSpeculation):
9737 (SpeculativeJIT):
9738 (GPRTemporary):
9739 (FPRTemporary):
9740 (JSC::DFG::SpecDoubleOperand::SpecDoubleOperand):
9741 (JSC::DFG::SpecDoubleOperand::~SpecDoubleOperand):
9742 (JSC::DFG::SpecDoubleOperand::fpr):
9743 (JSC::DFG::SpecCellOperand::SpecCellOperand):
9744 (JSC::DFG::SpecCellOperand::~SpecCellOperand):
9745 (JSC::DFG::SpecCellOperand::gpr):
9746 (JSC::DFG::SpecBooleanOperand::SpecBooleanOperand):
9747 (JSC::DFG::SpecBooleanOperand::~SpecBooleanOperand):
9748 (JSC::DFG::SpecBooleanOperand::gpr):
9749 * dfg/DFGSpeculativeJIT32_64.cpp:
9750 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
9751 (JSC::DFG::SpeculativeJIT::fillSpecDouble):
9752 (JSC::DFG::SpeculativeJIT::fillSpecCell):
9753 (JSC::DFG::SpeculativeJIT::fillSpecBoolean):
9754 (JSC::DFG::SpeculativeJIT::compileObjectEquality):
9755 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
9756 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
9757 (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
9758 (JSC::DFG::SpeculativeJIT::compileLogicalNot):
9759 (JSC::DFG::SpeculativeJIT::emitBranch):
9760 (JSC::DFG::SpeculativeJIT::compile):
9761 * dfg/DFGSpeculativeJIT64.cpp:
9762 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
9763 (JSC::DFG::SpeculativeJIT::fillSpecDouble):
9764 (JSC::DFG::SpeculativeJIT::fillSpecCell):
9765 (JSC::DFG::SpeculativeJIT::fillSpecBoolean):
9766 (JSC::DFG::SpeculativeJIT::compileObjectEquality):
9767 (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
9768 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
9769 (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
9770 (JSC::DFG::SpeculativeJIT::compileLogicalNot):
9771 (JSC::DFG::SpeculativeJIT::emitBranch):
9772 (JSC::DFG::SpeculativeJIT::compile):
9773 * dfg/DFGVariableAccessData.h:
9774 (JSC::DFG::VariableAccessData::VariableAccessData):
9775 (JSC::DFG::VariableAccessData::predict):
9776 (JSC::DFG::VariableAccessData::nonUnifiedPrediction):
9777 (JSC::DFG::VariableAccessData::prediction):
9778 (JSC::DFG::VariableAccessData::argumentAwarePrediction):
9779 (JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction):
9780 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
9781 (JSC::DFG::VariableAccessData::makePredictionForDoubleFormat):
9782 (VariableAccessData):
9783
97842012-06-06 Filip Pizlo <fpizlo@apple.com>
9785
fpizlo@apple.com26af9b62012-06-07 00:49:34 +00009786 Global object variable accesses should not require an extra load
9787 https://bugs.webkit.org/show_bug.cgi?id=88385
9788
9789 Reviewed by Gavin Barraclough and Geoffrey Garen.
9790
9791 Previously, if you wanted to access a global variable, you'd first have
9792 to load the register array from the appropriate global object and then
9793 either load or store at an offset to the register array. This is because
9794 JSGlobalObject inherited from JSVariableObject, and JSVariableObject is
9795 designed with the pessimistic assumption that its register array may
9796 point into the call stack. This is never the case for global objects.
9797 Hence, even though the global object may add more registers at any time,
9798 it does not need to store them in a contiguous array. It can use a
9799 SegmentedVector or similar.
9800
9801 This patch refactors global objects and variable objects as follows:
9802
9803 - The functionality to track variables in an indexable array using a
9804 SymbolTable to map names to indices is moved into JSSymbolTableObject,
9805 which is now a supertype of JSVariableObject. JSVariableObject is now
9806 just a holder for a registers array and implements the registerAt()
9807 method that is left abstract in JSSymbolTableObject. Because all users
9808 of JSVariableObject know whether they are a JSStaticScopeObject,
9809 JSActivation, or JSGlobalObject, this "abstract" method is not virtual;
9810 instead the utility methods that would call registerAt() are now
9811 template functions that require you to know statically what subtype of
9812 JSSymbolTableObject you're using (JSVariableObject or something else),
9813 so that registerAt() can be statically bound.
9814
9815 - A new class is added called JSSegmentedVariableObject, which only
9816 differs from JSVariableObject in how it allocates registers. It uses a
9817 SegmentedVector instead of manually managing a pointer to a contiguous
9818 slab of registers. This changes the interface somewhat; for example
9819 with JSVariableObject if you wanted to add a register you had to do
9820 it yourself since the JSVariableObject didn't know how the registers
9821 array ought to be allocated. With JSSegmentedVariableObject you can
9822 just call addRegisters(). JSSegmentedVariableObject preserves the
9823 invariant that once you get a pointer into a register, that pointer
9824 will continue to be valid so long as the JSSegmentedVariableObject is
9825 alive. This allows the JITs and interpreters to skip the extra load.
9826
9827 - JSGlobalObject now inherits from JSSegmentedVariableObject. For now
9828 (and possibly forever) it is the only subtype of this new class.
9829
9830 - The bytecode format is changed so that get_global_var and
9831 put_global_var have a pointer to the register directly rather than
9832 having an index. A convenience method is provided in
9833 JSSegmentedVariableObject to get the index given a a pointer, which is
9834 used for assertions and debug dumps.
9835
9836 This appears to be a 1% across the board win.
9837
9838 * CMakeLists.txt:
9839 * GNUmakefile.list.am:
9840 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
9841 * JavaScriptCore.xcodeproj/project.pbxproj:
9842 * Target.pri:
9843 * bytecode/CodeBlock.cpp:
9844 (JSC::CodeBlock::dump):
9845 * bytecode/Instruction.h:
9846 (Instruction):
9847 (JSC::Instruction::Instruction):
9848 * bytecompiler/BytecodeGenerator.cpp:
9849 (JSC::ResolveResult::registerPointer):
9850 (JSC):
9851 (JSC::BytecodeGenerator::BytecodeGenerator):
9852 (JSC::BytecodeGenerator::retrieveLastUnaryOp):
9853 (JSC::BytecodeGenerator::resolve):
9854 (JSC::BytecodeGenerator::resolveConstDecl):
9855 (JSC::BytecodeGenerator::emitGetStaticVar):
9856 (JSC::BytecodeGenerator::emitPutStaticVar):
9857 * bytecompiler/BytecodeGenerator.h:
9858 (ResolveResult):
9859 (BytecodeGenerator):
9860 * dfg/DFGAssemblyHelpers.h:
9861 (AssemblyHelpers):
9862 * dfg/DFGByteCodeParser.cpp:
9863 (JSC::DFG::ByteCodeParser::parseBlock):
9864 * dfg/DFGCSEPhase.cpp:
9865 (JSC::DFG::CSEPhase::globalVarLoadElimination):
9866 (JSC::DFG::CSEPhase::globalVarStoreElimination):
9867 (JSC::DFG::CSEPhase::performNodeCSE):
9868 * dfg/DFGGraph.cpp:
9869 (JSC::DFG::Graph::dump):
9870 * dfg/DFGGraph.h:
9871 (JSC::DFG::Graph::globalObjectFor):
9872 (Graph):
9873 * dfg/DFGNode.h:
9874 (JSC::DFG::Node::hasVarNumber):
9875 (Node):
9876 (JSC::DFG::Node::hasRegisterPointer):
9877 (JSC::DFG::Node::registerPointer):
9878 * dfg/DFGSpeculativeJIT32_64.cpp:
9879 (JSC::DFG::SpeculativeJIT::compile):
9880 * dfg/DFGSpeculativeJIT64.cpp:
9881 (JSC::DFG::SpeculativeJIT::compile):
9882 * heap/Heap.h:
9883 (Heap):
9884 (JSC::Heap::isWriteBarrierEnabled):
9885 (JSC):
9886 * interpreter/Interpreter.cpp:
9887 (JSC::Interpreter::execute):
9888 (JSC::Interpreter::privateExecute):
9889 * jit/JITPropertyAccess.cpp:
9890 (JSC::JIT::emit_op_get_global_var):
9891 (JSC::JIT::emit_op_put_global_var):
9892 * jit/JITPropertyAccess32_64.cpp:
9893 (JSC::JIT::emit_op_get_global_var):
9894 (JSC::JIT::emit_op_put_global_var):
9895 * llint/LowLevelInterpreter32_64.asm:
9896 * llint/LowLevelInterpreter64.asm:
9897 * runtime/JSGlobalObject.cpp:
9898 (JSC):
9899 (JSC::JSGlobalObject::put):
9900 (JSC::JSGlobalObject::putDirectVirtual):
9901 (JSC::JSGlobalObject::defineOwnProperty):
9902 (JSC::JSGlobalObject::visitChildren):
9903 (JSC::JSGlobalObject::addStaticGlobals):
9904 (JSC::JSGlobalObject::getOwnPropertySlot):
9905 (JSC::JSGlobalObject::getOwnPropertyDescriptor):
9906 * runtime/JSGlobalObject.h:
9907 (JSGlobalObject):
9908 (JSC::JSGlobalObject::JSGlobalObject):
9909 (JSC):
9910 (JSC::JSGlobalObject::hasOwnPropertyForWrite):
9911 * runtime/JSSegmentedVariableObject.cpp: Added.
9912 (JSC):
9913 (JSC::JSSegmentedVariableObject::findRegisterIndex):
9914 (JSC::JSSegmentedVariableObject::addRegisters):
9915 (JSC::JSSegmentedVariableObject::visitChildren):
9916 * runtime/JSSegmentedVariableObject.h: Added.
9917 (JSC):
9918 (JSSegmentedVariableObject):
9919 (JSC::JSSegmentedVariableObject::registerAt):
9920 (JSC::JSSegmentedVariableObject::assertRegisterIsInThisObject):
9921 (JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
9922 (JSC::JSSegmentedVariableObject::finishCreation):
9923 * runtime/JSStaticScopeObject.cpp:
9924 (JSC::JSStaticScopeObject::put):
9925 (JSC::JSStaticScopeObject::putDirectVirtual):
9926 (JSC::JSStaticScopeObject::getOwnPropertySlot):
9927 * runtime/JSSymbolTableObject.cpp: Added.
9928 (JSC):
9929 (JSC::JSSymbolTableObject::destroy):
9930 (JSC::JSSymbolTableObject::deleteProperty):
9931 (JSC::JSSymbolTableObject::getOwnPropertyNames):
9932 (JSC::JSSymbolTableObject::putDirectVirtual):
9933 (JSC::JSSymbolTableObject::isDynamicScope):
9934 * runtime/JSSymbolTableObject.h: Added.
9935 (JSC):
9936 (JSSymbolTableObject):
9937 (JSC::JSSymbolTableObject::symbolTable):
9938 (JSC::JSSymbolTableObject::JSSymbolTableObject):
9939 (JSC::JSSymbolTableObject::finishCreation):
9940 (JSC::symbolTableGet):
9941 (JSC::symbolTablePut):
9942 (JSC::symbolTablePutWithAttributes):
9943 * runtime/JSVariableObject.cpp:
9944 (JSC):
9945 * runtime/JSVariableObject.h:
9946 (JSVariableObject):
9947 (JSC::JSVariableObject::JSVariableObject):
9948 (JSC::JSVariableObject::finishCreation):
9949 (JSC):
9950 * runtime/WriteBarrier.h:
9951
99522012-06-06 Filip Pizlo <fpizlo@apple.com>
9953
fpizlo@apple.comd5547492012-06-07 00:23:36 +00009954 DFG arguments access slow path should not crash if the arguments haven't been created
9955 https://bugs.webkit.org/show_bug.cgi?id=88471
9956
9957 Reviewed by Gavin Barraclough.
9958
9959 * dfg/DFGCCallHelpers.h:
9960 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
9961 (CCallHelpers):
9962 * dfg/DFGOperations.cpp:
9963 * dfg/DFGOperations.h:
9964 * dfg/DFGSpeculativeJIT.h:
9965 (JSC::DFG::SpeculativeJIT::callOperation):
9966 * dfg/DFGSpeculativeJIT32_64.cpp:
9967 (JSC::DFG::SpeculativeJIT::compile):
9968 * dfg/DFGSpeculativeJIT64.cpp:
9969 (JSC::DFG::SpeculativeJIT::compile):
9970
msaboff@apple.com9d9eab62012-06-06 23:11:09 +000099712012-06-06 Michael Saboff <msaboff@apple.com>
9972
9973 ENH: Add Logging to GC Marking Phase
9974 https://bugs.webkit.org/show_bug.cgi?id=88364
9975
9976 Reviewed by Filip Pizlo.
9977
9978 Log GC marking to stderr or a file. The logging in controlled
9979 with the define ENABLE_OBJECT_MARK_LOGGING in wtf/Platform.h.
9980 If DATA_LOG_TO_FILE in wtf/DataLog.cpp is set to 1, output is
9981 logged to a file otherwise it is logged to stderr.
9982
9983 When logging is enabled, the GC is built single threaded since the
9984 log output from the various threads isn't buffered and output in a
9985 thread safe manner.
9986
9987 * heap/Heap.cpp:
9988 (JSC::Heap::markRoots):
9989 * heap/MarkStack.cpp:
9990 (JSC::MarkStackThreadSharedData::resetChildren):
9991 (JSC::MarkStackThreadSharedData::childVisitCount):
9992 (JSC::MarkStackThreadSharedData::markingThreadMain):
9993 (JSC::MarkStackThreadSharedData::markingThreadStartFunc):
9994 (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
9995 (JSC::MarkStackThreadSharedData::reset):
9996 * heap/MarkStack.h:
9997 (MarkStackThreadSharedData):
9998 (MarkStack):
9999 (JSC::MarkStack::sharedData):
10000 (JSC::MarkStack::resetChildCount):
10001 (JSC::MarkStack::childCount):
10002 (JSC::MarkStack::incrementChildCount):
10003 * runtime/JSArray.cpp:
10004 (JSC::JSArray::visitChildren):
10005 * runtime/JSCell.cpp:
10006 (JSC::JSCell::className):
10007 * runtime/JSCell.h:
10008 (JSCell):
10009 (JSC::JSCell::visitChildren):
10010 * runtime/JSString.cpp:
10011 (JSC::JSString::visitChildren):
10012 * runtime/JSString.h:
10013 (JSString):
10014 * runtime/Structure.h:
10015 (JSC::MarkStack::internalAppend):
10016
barraclough@apple.com799e44e2012-06-06 22:09:44 +0000100172012-06-06 Gavin Barraclough <barraclough@apple.com>
10018
10019 Assigning to a static property should not change iteration order
10020 https://bugs.webkit.org/show_bug.cgi?id=88401
10021
10022 Reviewed by Geoff Garen.
10023
10024 A specific iteration order is not defined by the spec, but test-262 somewhat tenuously
10025 requires that it is at least stable, e.g. ch10/10.4/10.4.2/S10.4.2_A1.1_T1.js
10026
10027 Whilst it is not clear that this behavior really arises from the specification, it
10028 would seem like common sense to conform to this.
10029
10030 The problem here is that we allow properties in the structure to shadow those in the
10031 static table, and we iterate the properties in the structure first - which means that
10032 as values of existing properties are modified, their iteration order changes too.
10033
10034 The easy fix is to iterate the properties from the static table first. This has a
10035 further benefit, since it will mean that user added properties will come after those
10036 present in the static table (respected the expected insertion-order).
10037
10038 * runtime/JSObject.cpp:
10039 (JSC::JSObject::getOwnPropertyNames):
10040 - Iterate static properties first.
10041
wingo@igalia.combe8ecb92012-06-06 09:39:04 +0000100422012-06-06 Andy Wingo <wingo@igalia.com>
10043
wingo@igalia.comc2fb5ba2012-06-06 18:59:35 +000010044 Ensure consistent order of evaluation in LLInt slow paths
10045 https://bugs.webkit.org/show_bug.cgi?id=88409
10046
10047 Reviewed by Geoffrey Garen.
10048
10049 * llint/LLIntSlowPaths.cpp:
10050 (slow_path_mul)
10051 (slow_path_sub)
10052 (slow_path_div)
10053 (slow_path_mod)
10054 (slow_path_lshift)
10055 (slow_path_rshift)
10056 (slow_path_urshift)
10057 (slow_path_bitand)
10058 (slow_path_bitor)
10059 (slow_path_bitxor): Avoid calling toNumber, toInt32, or toUInt32
10060 multiple times without intervening sequence points. Fixes
10061 fast/js/exception-sequencing-binops.html with GCC 4.7 on x86-64
10062 Linux, which reordered evaluation of the arguments to fmod.
10063
100642012-06-06 Andy Wingo <wingo@igalia.com>
10065
wingo@igalia.com4990fe82012-06-06 16:00:38 +000010066 [GTK] Enable the LLInt
10067 https://bugs.webkit.org/show_bug.cgi?id=88315
10068
10069 Reviewed by Filip Pizlo.
10070
10071 * GNUmakefile.am: Add rules to generate LLIntDesiredOffsets.h and
10072 LLIntAssembly.h.
10073 * GNUmakefile.list.am: Add offlineasm and llint files to the
10074 dist. Add LLInt source files to the build.
10075 * llint/LowLevelInterpreter.asm (crash): Generate a store of
10076 0xbbadbeef to a register, not to a constant. Otherwise, gas was
10077 failing to assemble result.
10078 * offlineasm/asm.rb (labelReference): Generate a
10079 SYMBOL_STRING_RELOCATION instead of a SYMBOL_STRING, so that we go
10080 through the PLT on ELF systems.
10081
100822012-06-06 Andy Wingo <wingo@igalia.com>
10083
wingo@igalia.combe8ecb92012-06-06 09:39:04 +000010084 REGRESSION (r106478): None of the Paper.js JavaScript examples work
10085 https://bugs.webkit.org/show_bug.cgi?id=87158
10086
10087 Reviewed by Michael Saboff.
10088
10089 * bytecompiler/BytecodeGenerator.cpp:
10090 (JSC::BytecodeGenerator::resolve): If we have to bail out to
10091 dynamicResolve(), only skip static scopes from the head of the
10092 scope chain. Before, we were also skipping activations with
10093 direct eval as well, which was incorrect.
10094
mitz@apple.com115e6642012-06-06 07:37:05 +0000100952012-06-06 Dan Bernstein <mitz@apple.com>
10096
10097 Reverted r119567, the fix for <http://webkit.org/b/88378>, because it broke the 32-bit build.
10098
10099 * dfg/DFGSpeculativeJIT.h:
10100 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
10101 * jit/JITInlineMethods.h:
10102 (JSC::JIT::emitAllocateBasicJSObject):
10103 * llint/LowLevelInterpreter.asm:
10104 * runtime/JSGlobalData.h:
10105 (JSGlobalData):
10106 * runtime/JSGlobalThis.cpp:
10107 (JSC::JSGlobalThis::setUnwrappedObject):
10108 * runtime/JSObject.cpp:
10109 (JSC::JSObject::visitChildren):
10110 (JSC::JSObject::createInheritorID):
10111 * runtime/JSObject.h:
10112 (JSObject):
10113 (JSC::JSObject::resetInheritorID):
10114 (JSC):
10115 (JSC::JSObject::offsetOfInheritorID):
10116 (JSC::JSObject::inheritorID):
10117
yuqiang.xian@intel.come8adde62012-06-06 05:25:54 +0000101182012-06-05 Yuqiang Xian <yuqiang.xian@intel.com>
10119
10120 Improve Math.round and Math.floor intrinsic
10121 https://bugs.webkit.org/show_bug.cgi?id=88314
10122
10123 Reviewed by Filip Pizlo.
10124
10125 Currently we call a native function from the JIT code to complete the
10126 "round" and "floor" operations. We could inline some fast paths
10127 especially for those positive values on the platforms where floating
10128 point truncation is supported.
10129 This brings 3% gain on Kraken, especially 32% on audio-oscillator,
10130 and slight win on SunSpider, measured on IA32.
10131
10132 * jit/ThunkGenerators.cpp:
10133 (JSC::floorThunkGenerator):
10134 (JSC):
10135 (JSC::roundThunkGenerator):
10136
barraclough@apple.comc48fc1b2012-06-06 05:08:45 +0000101372012-06-05 Gavin Barraclough <barraclough@apple.com>
10138
10139 Remove JSObject::m_inheritorID
10140 https://bugs.webkit.org/show_bug.cgi?id=88378
10141
10142 Reviewed by Geoff Garen.
10143
10144 This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
10145 and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
10146 Instead use a private named value in the object's property storage.
10147
10148 * dfg/DFGSpeculativeJIT.h:
10149 (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
10150 - No need m_inheritorID to initialize!
10151 * jit/JITInlineMethods.h:
10152 (JSC::JIT::emitAllocateBasicJSObject):
10153 - No need m_inheritorID to initialize!
10154 * llint/LowLevelInterpreter.asm:
10155 - No need m_inheritorID to initialize!
10156 * runtime/JSGlobalData.h:
10157 (JSGlobalData):
10158 - Added private name 'm_inheritorIDKey'.
10159 * runtime/JSGlobalThis.cpp:
10160 (JSC::JSGlobalThis::setUnwrappedObject):
10161 - resetInheritorID is now passed a JSGlobalData&.
10162 * runtime/JSObject.cpp:
10163 (JSC::JSObject::visitChildren):
10164 - No m_inheritorID to be marked.
10165 (JSC::JSObject::createInheritorID):
10166 - Store the newly created inheritorID in the property map.
10167 * runtime/JSObject.h:
10168 (JSC::JSObject::resetInheritorID):
10169 - Remove the inheritorID from property storage.
10170 (JSC::JSObject::inheritorID):
10171 - Read the inheritorID from property storage.
10172
fpizlo@apple.come7bee132012-06-05 21:32:18 +0000101732012-06-05 Filip Pizlo <fpizlo@apple.com>
10174
10175 DFG CFG simplification should not attempt to deref nodes inside of an unreachable subgraph
10176 https://bugs.webkit.org/show_bug.cgi?id=88362
10177
10178 Reviewed by Gavin Barraclough.
10179
10180 * dfg/DFGCFGSimplificationPhase.cpp:
10181 (JSC::DFG::CFGSimplificationPhase::fixPhis):
10182 (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
10183
mhahnenberg@apple.com47c9c532012-06-05 20:38:21 +0000101842012-06-05 Mark Hahnenberg <mhahnenberg@apple.com>
10185
10186 Entry into JSC should CRASH() if the Heap is busy
10187 https://bugs.webkit.org/show_bug.cgi?id=88355
10188
10189 Reviewed by Geoffrey Garen.
10190
10191 Interpreter::execute() returns jsNull() right now if we try to enter it while
10192 the Heap is busy (e.g. with a collection), which is okay, but some code paths
10193 that call Interpreter::execute() allocate objects before checking if the Heap
10194 is busy. Attempting to execute JS code while the Heap is busy should not be
10195 allowed and should be enforced by a release-mode CRASH() to prevent vague,
10196 unhelpful backtraces later on if somebody makes a mistake. Normally, recursively
10197 executing JS code is okay, e.g. for evals, but it should not occur during a
10198 Heap allocation or collection because the Heap is not guaranteed to be in a
10199 consistent state (especially during collections). We are protected from
10200 executing JS on the same Heap concurrently on two separate threads because
10201 they must each take a JSLock first. However, we are not protected from reentrant
10202 execution of JS on the same thread because JSLock allows reentrancy. Therefore,
10203 we should fail early if we detect an entrance into JS code while the Heap is busy.
10204
10205 * heap/Heap.cpp: Changed Heap::collect so that it sets the m_operationInProgress field
10206 at the beginning of collection and then unsets it at the end so that it is set at all
10207 times throughout the duration of a collection rather than sporadically during various
10208 phases. There is no reason to unset during a collection because our collector does
10209 not currently support running additional JS between the phases of a collection.
10210 (JSC::Heap::getConservativeRegisterRoots):
10211 (JSC::Heap::markRoots):
10212 (JSC::Heap::collect):
10213 * interpreter/Interpreter.cpp:
10214 (JSC::Interpreter::execute): Crash if the Heap is busy.
10215 * runtime/Completion.cpp: Crash if the Heap is busy. We do it here before we call
10216 Interpreter::execute() because we do some allocation prior to calling execute() which
10217 could cause Heap corruption if, for example, that allocation caused a collection.
10218 (JSC::evaluate):
10219
commit-queue@webkit.org3401b2d2012-06-05 11:32:22 +0000102202012-06-05 Dongwoo Im <dw.im@samsung.com>
10221
10222 Add 'isProtocolHandlerRegistered' and 'unregisterProtocolHandler'.
10223 https://bugs.webkit.org/show_bug.cgi?id=73176
10224
10225 Reviewed by Adam Barth.
10226
10227 Two more APIs are added in Custom Scheme Handler specification.
10228 http://dev.w3.org/html5/spec/Overview.html#custom-handlers
10229 One is 'isProtocolHandlerRegistered' to query whether the specific URL
10230 is registered or not.
10231 The other is 'unregisterProtocolHandler' to remove the registered URL.
10232
10233 * Configurations/FeatureDefines.xcconfig: Add a macro 'ENABLE_CUSTOM_SCHEME_HANDLER'.
10234
fpizlo@apple.com9cce18d2012-06-05 06:40:48 +0000102352012-06-04 Filip Pizlo <fpizlo@apple.com>
10236
10237 DFG CFG simplification should correct the variables at the head of the predecessor block
10238 https://bugs.webkit.org/show_bug.cgi?id=88284
10239
10240 Reviewed by Geoffrey Garen.
10241
10242 * dfg/DFGCFGSimplificationPhase.cpp:
10243 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
10244
ggaren@apple.com825cc102012-06-05 03:17:15 +0000102452012-06-04 Geoffrey Garen <ggaren@apple.com>
10246
10247 Unreviewed.
10248
10249 Rolled out r119364 because it's still causing crashes (when running
10250 v8-earley in release builds of DRT)
10251
10252 This time for sure!
10253
10254 * heap/Heap.cpp:
10255 (JSC::Heap::collect):
10256 * heap/MarkedBlock.cpp:
10257 (JSC::MarkedBlock::sweep):
10258 * heap/MarkedBlock.h:
10259 (JSC::MarkedBlock::resetAllocator):
10260 (JSC):
10261 * heap/MarkedSpace.cpp:
10262 (JSC::ResetAllocator::operator()):
10263 (JSC):
10264 (JSC::MarkedSpace::resetAllocators):
10265 (JSC::MarkedSpace::sweepWeakSets):
10266 * heap/MarkedSpace.h:
10267 (MarkedSpace):
10268 * heap/WeakBlock.cpp:
10269 (JSC::WeakBlock::sweep):
10270 * heap/WeakSet.cpp:
10271 (JSC::WeakSet::sweep):
10272 (JSC::WeakSet::tryFindAllocator):
10273 * heap/WeakSet.h:
10274 (JSC::WeakSet::shrink):
10275
fpizlo@apple.com9cd38a62012-06-05 00:28:49 +0000102762012-06-04 Filip Pizlo <fpizlo@apple.com>
10277
10278 DFG arguments simplification should have rationalized handling of TearOffArguments
10279 https://bugs.webkit.org/show_bug.cgi?id=88206
10280
10281 Reviewed by Geoffrey Garen.
10282
10283 - Accesses to the unmodified arguments register ought to have the same effect on
10284 alias/escape analysis of arguments as accesses to the mutable arguments register.
10285
10286 - The existence of TearOffArguments should not get in the way of arguments aliasing.
10287
10288 - TearOffArguments should be eliminated if CreateArguments is eliminated.
10289
10290 * dfg/DFGArgumentsSimplificationPhase.cpp:
10291 (JSC::DFG::ArgumentsSimplificationPhase::run):
10292 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
10293
barraclough@apple.com282d26a2012-06-05 00:00:17 +0000102942012-06-04 Gavin Barraclough <barraclough@apple.com>
10295
10296 Remove enabledProfilerReference
10297 https://bugs.webkit.org/show_bug.cgi?id=88258
10298
10299 Reviewed by Michael Saboff.
10300
10301 Make the enabled profiler a member of JSGlobalData, and switch code that accesses it to do so directly
10302 via the JSGlobalData, rather than holding a Profiler** reference to it. Do not pass the Profiler**
10303 reference to JIT code. This patch does not change the stack layout on entry into JIT code (passing an
10304 unused void* instead), since this is an intrusive change better handled in a separate patch.
10305
10306 * interpreter/Interpreter.cpp:
10307 (JSC::Interpreter::throwException):
10308 (JSC::Interpreter::execute):
10309 (JSC::Interpreter::executeCall):
10310 (JSC::Interpreter::executeConstruct):
10311 (JSC::Interpreter::privateExecute):
10312 * jit/JITCode.h:
10313 (JSC::JITCode::execute):
10314 - Don't pass Profiler** to JIT code.
10315 * jit/JITOpcodes.cpp:
10316 (JSC::JIT::emit_op_profile_will_call):
10317 (JSC::JIT::emit_op_profile_did_call):
10318 * jit/JITOpcodes32_64.cpp:
10319 (JSC::JIT::emit_op_profile_will_call):
10320 (JSC::JIT::emit_op_profile_did_call):
10321 * jit/JITStubs.cpp:
10322 (JSC):
10323 (JSC::ctiTrampoline):
10324 (JSC::ctiVMThrowTrampoline):
10325 (JSC::ctiOpThrowNotCaught):
10326 (JSC::JITThunks::JITThunks):
10327 (JSC::DEFINE_STUB_FUNCTION):
10328 - For ARM_THUMB2, rename ENABLE_PROFILER_REFERENCE_OFFSET to FIRST_STACK_ARGUMENT (which is how it is being used).
10329 - For MIPS, remove ENABLE_PROFILER_REFERENCE_OFFSET.
10330 * jit/JITStubs.h:
10331 (JITStackFrame):
10332 (JSC):
10333 - Renamed enabledProfilerReference to unusedX.
10334 * llint/LLIntSlowPaths.cpp:
10335 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
10336 * llint/LowLevelInterpreter.asm:
10337 * profiler/Profiler.cpp:
10338 (JSC):
10339 (JSC::Profiler::startProfiling):
10340 (JSC::Profiler::stopProfiling):
10341 * profiler/Profiler.h:
10342 (Profiler):
10343 - Removed s_sharedEnabledProfilerReference, enabledProfilerReference().
10344 * runtime/JSGlobalData.cpp:
10345 (JSC::JSGlobalData::JSGlobalData):
10346 * runtime/JSGlobalData.h:
10347 (JSC):
10348 (JSC::JSGlobalData::enabledProfiler):
10349 (JSGlobalData):
10350 - Added m_enabledProfiler, enabledProfiler().
10351 * runtime/JSGlobalObject.cpp:
10352 (JSC::JSGlobalObject::~JSGlobalObject):
10353
fpizlo@apple.com3d579cc2012-06-04 23:27:34 +0000103542012-06-04 Filip Pizlo <fpizlo@apple.com>
10355
fpizlo@apple.com477ce382012-06-04 23:32:57 +000010356 get_argument_by_val should be profiled everywhere
10357 https://bugs.webkit.org/show_bug.cgi?id=88205
10358
10359 Reviewed by Geoffrey Garen.
10360
10361 * jit/JITOpcodes32_64.cpp:
10362 (JSC::JIT::emitSlow_op_get_argument_by_val):
10363 * llint/LLIntSlowPaths.cpp:
10364 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
10365
103662012-06-04 Filip Pizlo <fpizlo@apple.com>
10367
fpizlo@apple.com3d579cc2012-06-04 23:27:34 +000010368 DFG arguments simplification takes unkindly to direct accesses to the arguments register
10369 https://bugs.webkit.org/show_bug.cgi?id=88261
10370
10371 Reviewed by Geoffrey Garen.
10372
10373 Fixed arguments simplification for direct accesses to the arguments register, which may
10374 arise if CSE had not run. Fixed CSE so that it does run prior to arguments simplification,
10375 by making it a full-fledged member of the fixpoint. Fixed other issues in arguments
10376 simplification, like realizing that it needs to bail if there is a direct assignment to
10377 the arguments register, and failing to turn CreateArguments into PhantomArguments. Also
10378 fixed CSE's handling of store elimination of captured locals in the presence of a
10379 GetMyArgumentByVal (or one of its friends), and fixed CSE to correctly fixup variables at
10380 tail if the Flush it removes is the last operation on a local in a basic block.
10381
10382 * bytecode/CodeBlock.cpp:
10383 (JSC::CodeBlock::dump):
10384 * dfg/DFGArgumentsSimplificationPhase.cpp:
10385 (JSC::DFG::ArgumentsSimplificationPhase::run):
10386 (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
10387 * dfg/DFGCSEPhase.cpp:
10388 (JSC::DFG::CSEPhase::run):
10389 (JSC::DFG::CSEPhase::setLocalStoreElimination):
10390 (JSC::DFG::CSEPhase::performNodeCSE):
10391 (CSEPhase):
10392 * dfg/DFGDriver.cpp:
10393 (JSC::DFG::compile):
10394
andersca@apple.comea6c6b22012-06-04 21:56:32 +0000103952012-06-04 Anders Carlsson <andersca@apple.com>
10396
10397 Fix a struct/class mismatch.
10398
10399 * heap/Handle.h:
10400 (Handle):
10401
ddkilzer@apple.comba58a612012-06-04 14:55:26 +0000104022012-06-04 David Kilzer <ddkilzer@apple.com>
10403
10404 BUILD FIX: FeatureDefines.xcconfig should match across projects
10405
10406 * Configurations/FeatureDefines.xcconfig:
10407 - Add missing ENABLE_LEGACY_CSS_VENDOR_PREFIXES.
10408
ggaren@apple.com02dec622012-06-03 21:16:55 +0000104092012-06-02 Geoffrey Garen <ggaren@apple.com>
10410
10411 Weak pointer finalization should be lazy
10412 https://bugs.webkit.org/show_bug.cgi?id=87599
10413
10414 Reviewed by Sam Weinig.
10415
10416 This time for sure!
10417
10418 * heap/Heap.cpp:
10419 (JSC::Heap::collect): Don't sweep eagerly -- we'll sweep lazily instead.
10420
10421 * heap/MarkedBlock.cpp:
10422 (JSC::MarkedBlock::sweep): Sweep our weak set before we sweep our other
10423 destructors -- this is our last chance to run weak set finalizers before
10424 we recycle our memory.
10425
10426 * heap/MarkedBlock.h:
10427 (JSC::MarkedBlock::resetAllocator):
10428 * heap/MarkedSpace.cpp:
10429 (JSC::MarkedSpace::resetAllocators):
10430 * heap/MarkedSpace.h:
10431 (JSC::MarkedSpace::resetAllocators): Don't force allocator reset anymore.
10432 It will happen automatically when a weak set is swept. It's simpler to
10433 have only one canonical way for this to happen, and it wasn't buying
10434 us anything to do it eagerly.
10435
10436 * heap/WeakBlock.cpp:
10437 (JSC::WeakBlock::sweep): Don't short-circuit a sweep unless we know
10438 the sweep would be a no-op. If even one finalizer is pending, we need to
10439 run it, since we won't get another chance.
10440
10441 * heap/WeakSet.cpp:
10442 (JSC::WeakSet::sweep): This loop can be simpler now that
10443 WeakBlock::sweep() does what we mean.
10444
10445 Reset our allocator after a sweep because this is the optimal time to
10446 start trying to recycle old weak pointers.
10447
10448 (JSC::WeakSet::tryFindAllocator): Don't sweep when searching for an
10449 allocator because we've swept already, and forcing a new sweep would be
10450 wasteful.
10451
10452 * heap/WeakSet.h:
10453 (JSC::WeakSet::shrink): Be sure to reset our allocator after a shrink
10454 because the shrink may have removed the block the allocator was going to
10455 allocate out of.
10456
fpizlo@apple.comb80bc2a32012-06-02 22:58:48 +0000104572012-06-02 Filip Pizlo <fpizlo@apple.com>
10458
fpizlo@apple.come0c200c2012-06-03 00:41:08 +000010459 If the DFG bytecode parser detects that op_method_check has gone polymorphic, it
10460 shouldn't revert all the way to GetById/GetByIdFlush
10461 https://bugs.webkit.org/show_bug.cgi?id=88176
10462
10463 Reviewed by Geoffrey Garen.
10464
10465 Refactored the code so that the op_method_check case of the parser gracefully falls
10466 through to all of the goodness of the normal op_get_by_id case.
10467
10468 * dfg/DFGByteCodeParser.cpp:
10469 (ByteCodeParser):
10470 (JSC::DFG::ByteCodeParser::handleGetById):
10471 (DFG):
10472 (JSC::DFG::ByteCodeParser::parseBlock):
10473
104742012-06-02 Filip Pizlo <fpizlo@apple.com>
10475
fpizlo@apple.comb80bc2a32012-06-02 22:58:48 +000010476 DFG CSE should be able to eliminate unnecessary flushes of arguments and captured variables
10477 https://bugs.webkit.org/show_bug.cgi?id=87929
10478
10479 Reviewed by Geoffrey Garen.
10480
10481 Slight speed-up on V8. Big win (up to 50%) on programs that inline very small functions.
10482
10483 This required a bunch of changes:
10484
10485 - The obvious change is making CSE essentially ignore whether or not the set of
10486 operations between the Flush and the SetLocal can exit, and instead focus on whether or
10487 not that set of operations can clobber the world or access local variables. This code
10488 is now refactored to return a set of flags indicating any of these events, and the CSE
10489 decides what to do based on those flags. If the set of operations is non-clobbering
10490 and non-accessing, then the Flush is turned into a Phantom on the child of the
10491 SetLocal. This expands the liveness of the relevant variable but virtually guarantees
10492 that it will be register allocated and not flushed to the stack. So, yeah, this patch
10493 is a lot of work to save a few stores to the stack.
10494
10495 - Previously, CheckArgumentsNotCreated was optimized "lazily" in that you only knew if
10496 it was a no-op if you were holding onto a CFA abstract state. But this would make the
10497 CSE act pessimistically, since it doesn't use the CFA. Hence, this patch changes the
10498 constant folding phase into something more broad; it now fixes up
10499 CheckArgumentsNotCreated nodes by turning them into phantoms if it knows that they are
10500 no-ops.
10501
10502 - Arguments simplification was previously relying on this very strange PhantomArguments
10503 node, which had two different meanings: for normal execution it meant the empty value
10504 but for OSR exit it meant that the arguments should be reified. This produces problems
10505 when set SetLocals to the captured arguments registers are CSE'd away, since we'd be
10506 triggering reification of arguments without having initialized the arguments registers
10507 to empty. The cleanest solution was to fix PhantomArguments to have one meaning:
10508 namely, arguments reification on OSR exit. Hence, this patch changes arguments
10509 simplification to change SetLocal of CreateArguments on the arguments registers to be
10510 a SetLocal of Empty.
10511
10512 - Argument value recoveries were previously derived from the value source of the
10513 arguments at the InlineStart. But that relies on all SetLocals to arguments having
10514 been flushed. It's possible that we could have elided the SetLocal to the arguments
10515 at the callsite because there were subsequent SetLocals to the arguments inside of the
10516 callee, in which case the InlineStart would get the wrong information. Hence, this
10517 patch changes argument value recovery computation to operate over the ArgumentPositions
10518 directly.
10519
10520 - But that doesn't actually work, because previously, there was no way to link an
10521 InlineStart back to the corresponding ArgumentPositions, at least not without some
10522 ugliness. So this patch instates the rule that the m_argumentPositions vector consists
10523 of disjoint subsequences such that each subsequence corresponds to an inline callsite
10524 and can be identified by its first index, and within each subsequence are the
10525 ArgumentPositions of all of the arguments ordered by argument index. This required
10526 flipping the order in which ArgumentPositions are added to the vector, and giving
10527 InlineStart an operand that indicates the start of that inline callsite's
10528 ArgumentPosition subsequence.
10529
10530 - This patch also revealed a nasty bug in the reification of arguments in inline call
10531 frames on OSR exit. Since the reification was happening after the values of virtual
10532 registers were recovered, the value recoveries of the inline arguments were wrong.
10533 Hence using operationCreateInlinedArguments is wrong. For example a value recovery
10534 might say that you have to box a double, but if we had already boxed it then boxing
10535 it a second time will result in garbage. The specific case of this bug was this patch
10536 uncovered was that now it is possible for an inline call frame to not have any valid
10537 value recoveries for any inline arguments, if the optimization elides all argument
10538 flushes, while at the same time optimizing away arguments creation. Then OSR exit
10539 would try to recover the arguments using the inline call frame, which had bogus
10540 information, and humorous crashes would ensue. This patch fixes this issue by moving
10541 arguments reification to after call frame reification, so that arguments reification
10542 can always use operationCreateArguments instead of operationCreateInlinedArguments.
10543
10544 - This patch may turn a Flush into a Phantom. That's kind of the whole point. But that
10545 broke forward speculation checks, which knew to look for a Flush prior to a SetLocal
10546 but didn't know that there could alternatively be a Phantom in place of the Flush.
10547 This patch fixes that by augmenting the forward speculation check logic.
10548
10549 - Finally, in the process of having fun with all of the above, I realized that my DFG
10550 validation was not actually running on every phase like I had originally designed it
10551 to. In fact it was only running just after bytecode parsing. I initially tried to
10552 make it run in every phase but found that this causes some tests to timeout
10553 (specifically the evil fuzzing ones), so I decided on a compromise where: (i) in
10554 release mode validation never runs, (ii) in debug mode validation will run just
10555 after parsing and just before the backend, and (iii) it's possible with a simple
10556 switch to enable validation to run on every phase.
10557
10558 Luckily all of the above issues were already covered by the 77 or so DFG-specific
10559 layout tests. Hence, this patch does not introduce any new tests despite being so
10560 meaty.
10561
10562 * dfg/DFGAbstractState.cpp:
10563 (JSC::DFG::AbstractState::execute):
10564 * dfg/DFGArgumentPosition.h:
10565 (JSC::DFG::ArgumentPosition::prediction):
10566 (JSC::DFG::ArgumentPosition::doubleFormatState):
10567 (JSC::DFG::ArgumentPosition::shouldUseDoubleFormat):
10568 (ArgumentPosition):
10569 * dfg/DFGArgumentsSimplificationPhase.cpp:
10570 (JSC::DFG::ArgumentsSimplificationPhase::run):
10571 * dfg/DFGByteCodeParser.cpp:
10572 (JSC::DFG::ByteCodeParser::handleInlining):
10573 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
10574 * dfg/DFGCSEPhase.cpp:
10575 (JSC::DFG::CSEPhase::SetLocalStoreEliminationResult::SetLocalStoreEliminationResult):
10576 (SetLocalStoreEliminationResult):
10577 (JSC::DFG::CSEPhase::setLocalStoreElimination):
10578 (JSC::DFG::CSEPhase::performNodeCSE):
10579 * dfg/DFGCommon.h:
10580 * dfg/DFGConstantFoldingPhase.cpp:
10581 (JSC::DFG::ConstantFoldingPhase::run):
10582 * dfg/DFGDriver.cpp:
10583 (JSC::DFG::compile):
10584 * dfg/DFGNode.h:
10585 (Node):
10586 (JSC::DFG::Node::hasArgumentPositionStart):
10587 (JSC::DFG::Node::argumentPositionStart):
10588 * dfg/DFGOSRExitCompiler32_64.cpp:
10589 (JSC::DFG::OSRExitCompiler::compileExit):
10590 * dfg/DFGOSRExitCompiler64.cpp:
10591 (JSC::DFG::OSRExitCompiler::compileExit):
10592 * dfg/DFGPhase.cpp:
10593 (DFG):
10594 * dfg/DFGPhase.h:
10595 (Phase):
10596 * dfg/DFGSpeculativeJIT.cpp:
10597 (JSC::DFG::SpeculativeJIT::compile):
10598 * dfg/DFGSpeculativeJIT.h:
10599 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
10600 * dfg/DFGSpeculativeJIT32_64.cpp:
10601 (JSC::DFG::SpeculativeJIT::compile):
10602 * dfg/DFGSpeculativeJIT64.cpp:
10603 (JSC::DFG::SpeculativeJIT::compile):
10604
ggaren@apple.com32eb24b2012-06-02 22:49:05 +0000106052012-06-02 Geoffrey Garen <ggaren@apple.com>
10606
10607 DOM string cache should hash pointers, not characters
10608 https://bugs.webkit.org/show_bug.cgi?id=88175
10609
10610 Reviewed by Phil Pizlo and Sam Weinig.
10611
10612 * heap/Weak.h:
10613 (JSC::weakAdd):
10614 (JSC::weakRemove): Made these function templates slightly more generic
10615 to accommodate new client types.
10616
fpizlo@apple.comcc5b61b2012-06-01 21:32:45 +0000106172012-06-01 Filip Pizlo <fpizlo@apple.com>
10618
fpizlo@apple.coma4754892012-06-02 00:22:31 +000010619 DFG CFA should know that PutByVal can clobber the world
10620 https://bugs.webkit.org/show_bug.cgi?id=88155
10621
10622 Reviewed by Gavin Barraclough.
10623
10624 * dfg/DFGAbstractState.cpp:
10625 (JSC::DFG::AbstractState::execute):
10626
106272012-06-01 Filip Pizlo <fpizlo@apple.com>
10628
fpizlo@apple.com8e537cd2012-06-01 23:54:36 +000010629 DFG CFA should mark basic blocks as having constants if local accesses yield constants
10630 https://bugs.webkit.org/show_bug.cgi?id=88153
10631
10632 Reviewed by Gavin Barraclough.
10633
10634 * dfg/DFGAbstractState.cpp:
10635 (JSC::DFG::AbstractState::execute):
10636
106372012-06-01 Filip Pizlo <fpizlo@apple.com>
10638
fpizlo@apple.comacc9dd22012-06-01 23:47:28 +000010639 DFG arguments simplification phase uses a node.codeOrigin after appending a node
10640 https://bugs.webkit.org/show_bug.cgi?id=88151
10641
10642 Reviewed by Geoffrey Garen.
10643
10644 The right thing to do is to save the CodeOrigin before appending to the graph.
10645
10646 * dfg/DFGArgumentsSimplificationPhase.cpp:
10647 (JSC::DFG::ArgumentsSimplificationPhase::run):
10648
106492012-06-01 Filip Pizlo <fpizlo@apple.com>
10650
fpizlo@apple.com4f337c22012-06-01 23:18:59 +000010651 DFG should not emit unnecessary speculation checks when performing an int32 to double conversion on
10652 a value that is proved to be a number, predicted to be an int32, but not proved to be an int32
10653 https://bugs.webkit.org/show_bug.cgi?id=88146
10654
10655 Reviewed by Gavin Barraclough.
10656
10657 * dfg/DFGSpeculativeJIT.cpp:
10658 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
10659
106602012-06-01 Filip Pizlo <fpizlo@apple.com>
10661
fpizlo@apple.comafc07412012-06-01 22:44:43 +000010662 DFG constant folding search for the last local access skips the immediately previous local access
10663 https://bugs.webkit.org/show_bug.cgi?id=88141
10664
10665 Reviewed by Michael Saboff.
10666
10667 If you use a loop in the style of:
10668
10669 for (i = start; i--;)
10670
10671 then you need to remember that the first value of 'i' that the loop body will see is 'start - 1'.
10672 Hence the following is probably wrong:
10673
10674 for (i = start - 1; i--;)
10675
10676 * dfg/DFGConstantFoldingPhase.cpp:
10677 (JSC::DFG::ConstantFoldingPhase::run):
10678
106792012-06-01 Filip Pizlo <fpizlo@apple.com>
10680
fpizlo@apple.comcc5b61b2012-06-01 21:32:45 +000010681 DFG constant folding should be OK with GetLocal of captured variables having a constant
10682 https://bugs.webkit.org/show_bug.cgi?id=88137
10683
10684 Reviewed by Gavin Barraclough.
10685
10686 * dfg/DFGConstantFoldingPhase.cpp:
10687 (JSC::DFG::ConstantFoldingPhase::run):
10688
mhahnenberg@apple.com016c5782012-06-01 00:02:09 +0000106892012-05-31 Mark Hahnenberg <mhahnenberg@apple.com>
10690
10691 JSGlobalObject does not mark m_privateNameStructure
10692 https://bugs.webkit.org/show_bug.cgi?id=88023
10693
10694 Rubber stamped by Gavin Barraclough.
10695
10696 * runtime/JSGlobalObject.cpp:
10697 (JSC::JSGlobalObject::visitChildren): We need to mark this so it doesn't get
10698 inadvertently garbage collected.
10699
arv@chromium.org31fddbc2012-05-31 18:00:03 +0000107002012-05-31 Erik Arvidsson <arv@chromium.org>
10701
10702 Make DOM Exceptions Errors
10703 https://bugs.webkit.org/show_bug.cgi?id=85078
10704
10705 Reviewed by Oliver Hunt.
10706
10707 WebIDL mandates that exceptions should have Error.prototype on its prototype chain.
10708
10709 For JSC we have access to the Error.prototype from the binding code.
10710
10711 For V8 we set a field in the WrapperTypeInfo and when the constructor function is created we
10712 set the prototype as needed.
10713
10714 Updated test: fast/dom/DOMException/prototype-object.html
10715
10716 * JavaScriptCore.xcodeproj/project.pbxproj:
10717 * runtime/JSGlobalObject.cpp:
10718 (JSC::JSGlobalObject::reset):
10719 * runtime/JSGlobalObject.h:
10720 (JSC):
10721 (JSGlobalObject):
10722 (JSC::JSGlobalObject::errorPrototype):
10723
wingo@igalia.com8de6a8a2012-05-31 17:28:21 +0000107242012-05-31 Andy Wingo <wingo@igalia.com>
10725
10726 Fix reference to unset variable in debug mode
10727 https://bugs.webkit.org/show_bug.cgi?id=87981
10728
10729 Reviewed by Geoffrey Garen.
10730
10731 * runtime/JSONObject.cpp (Stringifier::Holder::Holder):
10732 Initialize m_size in debug mode, as we check it later in an assert.
10733
mhahnenberg@apple.comeb39abc2012-05-31 03:04:00 +0000107342012-05-30 Mark Hahnenberg <mhahnenberg@apple.com>
10735
10736 Heap should sweep incrementally
10737 https://bugs.webkit.org/show_bug.cgi?id=85429
10738
10739 We shouldn't have to wait for the opportunistic GC timer to fire in order
10740 to call object destructors. Instead, we should incrementally sweep some
10741 subset of the blocks requiring sweeping periodically. We tie this sweeping
10742 to a timer rather than to collections because we want to reclaim this memory
10743 even if we stop allocating. This way, our memory usage scales smoothly with
10744 actual use, regardless of whether we've recently done an opportunistic GC or not.
10745
10746 Reviewed by Geoffrey Garen.
10747
10748 * CMakeLists.txt:
10749 * GNUmakefile.list.am:
10750 * JavaScriptCore.gypi:
10751 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10752 * JavaScriptCore.xcodeproj/project.pbxproj:
10753 * Target.pri:
10754 * heap/Heap.cpp:
10755 (JSC::Heap::Heap):
10756 (JSC::Heap::collect): We no longer sweep during a full sweep. We only shrink now,
10757 which we will switch over to being done during incremental sweeping too as soon as
10758 all finalizers can be run lazily (and, by extension, incrementally).
10759 (JSC::Heap::sweeper):
10760 (JSC):
10761 * heap/Heap.h:
10762 (JSC):
10763 (Heap):
10764 * heap/IncrementalSweeper.cpp: Added.
10765 (JSC):
10766 (JSC::IncrementalSweeper::timerDidFire): The IncrementalSweeper works very similarly to
10767 GCActivityCallback. It is tied to a run-loop based timer that fires periodically based
10768 on how long the previous sweep increment took to run. The IncrementalSweeper doesn't do
10769 anything if the platform doesn't support CoreFoundation.
10770 (JSC::IncrementalSweeper::IncrementalSweeper):
10771 (JSC::IncrementalSweeper::~IncrementalSweeper):
10772 (JSC::IncrementalSweeper::create):
10773 (JSC::IncrementalSweeper::scheduleTimer):
10774 (JSC::IncrementalSweeper::cancelTimer):
10775 (JSC::IncrementalSweeper::doSweep): Iterates over the snapshot of the MarkedSpace taken
10776 during the last collection, checking to see which blocks need sweeping. If it successfully
10777 gets to the end of the blocks that need sweeping then it cancels the timer.
10778 (JSC::IncrementalSweeper::startSweeping): We take a snapshot of the Heap and store it in
10779 a Vector that the incremental sweep will iterate over. We also reset our index into this Vector.
10780 * heap/IncrementalSweeper.h: Added.
10781 (JSC):
10782 (IncrementalSweeper):
10783 * heap/MarkedBlock.h:
10784 (JSC::MarkedBlock::needsSweeping): If a block is in the Marked state it needs sweeping
10785 to be usable and to run any destructors that need to be run.
10786
paroga@webkit.orgecd0fb62012-05-31 01:38:17 +0000107872012-05-30 Patrick Gansterer <paroga@webkit.org>
10788
10789 [WINCE] Fix JSString after r115516.
10790 https://bugs.webkit.org/show_bug.cgi?id=87892
10791
10792 Reviewed by Geoffrey Garen.
10793
10794 r115516 splitted JSString into two classes, with addition nested classes.
10795 Add a workaround for the WinCE compiler since it can't resolve the friend class
10796 declerations corretly and denies the access to protected members of JSString.
10797
10798 * runtime/JSString.h:
10799 (JSC::JSRopeString::RopeBuilder::append):
10800 (JSC::JSRopeString::append):
10801 (JSRopeString):
10802
oliver@apple.com3c996382012-05-30 23:47:27 +0000108032012-05-30 Oliver Hunt <oliver@apple.com>
10804
10805 Really provide error information with the inspector disabled
10806 https://bugs.webkit.org/show_bug.cgi?id=87910
10807
10808 Reviewed by Filip Pizlo.
10809
10810 Don't bother checking for anything other than pre-existing error info.
10811 In the absence of complete line number information you'll only get the
10812 line a function starts on, but at least it's something.
10813
10814 * interpreter/Interpreter.cpp:
10815 (JSC::Interpreter::throwException):
10816
fpizlo@apple.com074918c2012-05-30 20:18:00 +0000108172012-05-30 Filip Pizlo <fpizlo@apple.com>
10818
fpizlo@apple.com5673fe62012-05-30 23:09:45 +000010819 LLInt broken on x86-32 with JIT turned off
10820 https://bugs.webkit.org/show_bug.cgi?id=87906
10821
10822 Reviewed by Geoffrey Garen.
10823
10824 Fixed the code to not clobber registers that contain important things, like the call frame.
10825
10826 * llint/LowLevelInterpreter32_64.asm:
10827
108282012-05-30 Filip Pizlo <fpizlo@apple.com>
10829
fpizlo@apple.com074918c2012-05-30 20:18:00 +000010830 ScriptDebugServer wants sourceIDs that are non-zero because that's what HashMaps want, so JSC should placate it
10831 https://bugs.webkit.org/show_bug.cgi?id=87887
10832
fpizlo@apple.comd55e8152012-05-30 21:04:23 +000010833 Reviewed by Darin Adler.
10834
10835 Better fix - we now never call SourceProvider::asID() if SourceProvider* is 0.
10836
10837 * parser/Nodes.h:
10838 (JSC::ScopeNode::sourceID):
10839 * parser/SourceCode.h:
10840 (JSC::SourceCode::providerID):
10841 (SourceCode):
10842 * parser/SourceProvider.h:
10843 (SourceProvider):
10844 (JSC::SourceProvider::asID):
10845 * runtime/Executable.h:
10846 (JSC::ScriptExecutable::sourceID):
10847
108482012-05-30 Filip Pizlo <fpizlo@apple.com>
10849
10850 ScriptDebugServer wants sourceIDs that are non-zero because that's what HashMaps want, so JSC should placate it
10851 https://bugs.webkit.org/show_bug.cgi?id=87887
10852
fpizlo@apple.com074918c2012-05-30 20:18:00 +000010853 Reviewed by Geoffrey Garen.
10854
10855 * parser/SourceProvider.h:
10856 (JSC::SourceProvider::asID):
10857
oliver@apple.comc55314a2012-05-30 19:45:20 +0000108582012-05-30 Oliver Hunt <oliver@apple.com>
10859
10860 DFG does not correctly handle exceptions caught in the LLInt
10861 https://bugs.webkit.org/show_bug.cgi?id=87885
10862
10863 Reviewed by Filip Pizlo.
10864
10865 Make the DFG use genericThrow, rather than reimplementing a small portion of it.
10866 Also make the LLInt slow paths validate that their PC is correct.
10867
10868 * dfg/DFGOperations.cpp:
10869 * llint/LLIntSlowPaths.cpp:
10870 (LLInt):
10871
fpizlo@apple.com75824e82012-05-30 17:02:49 +0000108722012-05-29 Filip Pizlo <fpizlo@apple.com>
10873
10874 DFG CFA should infer types and values of captured variables
10875 https://bugs.webkit.org/show_bug.cgi?id=87813
10876
10877 Reviewed by Gavin Barraclough.
10878
10879 Slight speed-up in V8/earley-boyer (~1%).
10880
10881 * bytecode/CodeBlock.h:
10882 (JSC::CodeBlock::argumentsAreCaptured):
10883 (JSC::CodeBlock::argumentIsCaptured):
10884 (CodeBlock):
10885 * dfg/DFGAbstractState.cpp:
10886 (DFG):
10887 (JSC::DFG::AbstractState::beginBasicBlock):
10888 (JSC::DFG::AbstractState::initialize):
10889 (JSC::DFG::AbstractState::endBasicBlock):
10890 (JSC::DFG::AbstractState::execute):
10891 (JSC::DFG::AbstractState::clobberWorld):
10892 (JSC::DFG::AbstractState::clobberStructures):
10893 (JSC::DFG::AbstractState::mergeStateAtTail):
10894 (JSC::DFG::AbstractState::merge):
10895 (JSC::DFG::AbstractState::mergeToSuccessors):
10896 * dfg/DFGAbstractState.h:
10897 (JSC::DFG::AbstractState::variables):
10898 (AbstractState):
10899 * dfg/DFGSpeculativeJIT32_64.cpp:
10900 (JSC::DFG::SpeculativeJIT::compile):
10901 * dfg/DFGSpeculativeJIT64.cpp:
10902 (JSC::DFG::SpeculativeJIT::compile):
10903
paroga@webkit.orge373ab72012-05-30 16:44:03 +0000109042012-05-30 Patrick Gansterer <paroga@webkit.org>
10905
10906 Unreviewed. Build fix for !ENABLE(JIT) after r117823.
10907
10908 * bytecode/CodeBlock.cpp:
10909 (JSC::CodeBlock::dump):
10910
commit-queue@webkit.org4ac40e0d2012-05-30 07:17:05 +0000109112012-05-30 Sheriff Bot <webkit.review.bot@gmail.com>
10912
10913 Unreviewed, rolling out r118868.
10914 http://trac.webkit.org/changeset/118868
10915 https://bugs.webkit.org/show_bug.cgi?id=87828
10916
10917 introduced ~20 crashes on Mac and Qt bots (Requested by pizlo_
10918 on #webkit).
10919
10920 * heap/Heap.cpp:
10921 (JSC::Heap::collect):
10922 * heap/MarkedBlock.cpp:
10923 (JSC::MarkedBlock::sweep):
10924 * heap/MarkedBlock.h:
10925 (JSC::MarkedBlock::sweepWeakSet):
10926 (JSC):
10927 * heap/MarkedSpace.cpp:
10928 (JSC::SweepWeakSet::operator()):
10929 (JSC):
10930 (JSC::MarkedSpace::sweepWeakSets):
10931 * heap/MarkedSpace.h:
10932 (MarkedSpace):
10933
ggaren@apple.com15344ae2012-05-30 01:05:35 +0000109342012-05-29 Geoffrey Garen <ggaren@apple.com>
10935
10936 Rolled back in r118646, now that
10937 https://bugs.webkit.org/show_bug.cgi?id=87784 is fixed.
10938
10939 http://trac.webkit.org/changeset/118646
10940 https://bugs.webkit.org/show_bug.cgi?id=87599
10941
10942 * heap/Heap.cpp:
10943 (JSC::Heap::collect):
10944 * heap/MarkedBlock.cpp:
10945 (JSC::MarkedBlock::sweep):
10946 * heap/MarkedBlock.h:
10947 (JSC):
10948 * heap/MarkedSpace.cpp:
10949 (JSC):
10950 * heap/MarkedSpace.h:
10951 (MarkedSpace):
10952
fpizlo@apple.com4c0875e2012-05-29 23:43:16 +0000109532012-05-29 Filip Pizlo <fpizlo@apple.com>
10954
10955 DFG should keep captured variables alive until the (inline) return.
10956 https://bugs.webkit.org/show_bug.cgi?id=87205
10957
10958 Reviewed by Gavin Barraclough.
10959
10960 Changes the way we do flushing for captured variables and arguments. Instead of flushing
10961 each SetLocal immediately, we flush at kill points. So a SetLocal will cause a Flush of
10962 whatever was live in the variable previously, and a return will cause a Flush of all
10963 captured variables and all arguments.
10964
10965 * dfg/DFGByteCodeParser.cpp:
10966 (JSC::DFG::ByteCodeParser::setDirect):
10967 (JSC::DFG::ByteCodeParser::set):
10968 (JSC::DFG::ByteCodeParser::setLocal):
10969 (JSC::DFG::ByteCodeParser::getArgument):
10970 (JSC::DFG::ByteCodeParser::setArgument):
10971 (JSC::DFG::ByteCodeParser::findArgumentPositionForArgument):
10972 (ByteCodeParser):
10973 (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
10974 (JSC::DFG::ByteCodeParser::findArgumentPosition):
10975 (JSC::DFG::ByteCodeParser::flush):
10976 (JSC::DFG::ByteCodeParser::flushDirect):
10977 (JSC::DFG::ByteCodeParser::flushArgumentsAndCapturedVariables):
10978 (JSC::DFG::ByteCodeParser::handleInlining):
10979 (JSC::DFG::ByteCodeParser::parseBlock):
10980 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
10981 * dfg/DFGCSEPhase.cpp:
10982 (JSC::DFG::CSEPhase::setLocalStoreElimination):
10983 (JSC::DFG::CSEPhase::performNodeCSE):
10984 * dfg/DFGSpeculativeJIT.cpp:
10985 (JSC::DFG::SpeculativeJIT::compile):
10986 * dfg/DFGSpeculativeJIT.h:
10987 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
10988
ggaren@apple.com7cc57362012-05-29 23:40:26 +0000109892012-05-29 Geoffrey Garen <ggaren@apple.com>
10990
10991 WeakGCMap should be lazy-finalization-safe
10992 https://bugs.webkit.org/show_bug.cgi?id=87784
10993
10994 Reviewed by Darin Adler.
10995
10996 * runtime/WeakGCMap.h:
10997 (JSC::WeakGCMap::get): Since this is a map of raw WeakImpl pointers, and
10998 not Weak<T>, we need to verify manually that the WeakImpl is live before
10999 we return its payload.
11000
mhahnenberg@apple.com7ea7e8f2012-05-29 18:38:14 +0000110012012-05-29 Mark Hahnenberg <mhahnenberg@apple.com>
11002
11003 CopiedSpace::doneCopying could start another collection
11004 https://bugs.webkit.org/show_bug.cgi?id=86538
11005
11006 Reviewed by Geoffrey Garen.
11007
11008 It's possible that if we don't have anything at the head of to-space
11009 after a collection and the BlockAllocator doesn't have any fresh blocks
11010 to give us right now we could start another collection while still in
11011 the middle of the first collection when we call CopiedSpace::addNewBlock().
11012
11013 One way to resolve this would be to have Heap::shouldCollect() check that
11014 m_operationInProgress is NoOperation. This would prevent the path in
11015 getFreshBlock() that starts the collection if we're already in the middle of one.
11016
11017 I could not come up with a test case to reproduce this crash on ToT.
11018
11019 * heap/Heap.h:
11020 (JSC::Heap::shouldCollect): We shouldn't collect if we're already in the middle
11021 of a collection, i.e. the current operation should be NoOperation.
11022
commit-queue@webkit.orgd5058402012-05-29 14:44:38 +0000110232012-05-29 David Barr <davidbarr@chromium.org>
11024
11025 Introduce ENABLE_CSS_IMAGE_RESOLUTION compile flag
11026 https://bugs.webkit.org/show_bug.cgi?id=87685
11027
11028 Reviewed by Eric Seidel.
11029
11030 Add a configuration option for CSS image-resolution support, disabling it by default.
11031
11032 * Configurations/FeatureDefines.xcconfig:
11033
commit-queue@webkit.org10c0df22012-05-29 03:24:49 +0000110342012-05-28 Sheriff Bot <webkit.review.bot@gmail.com>
11035
11036 Unreviewed, rolling out r118646.
11037 http://trac.webkit.org/changeset/118646
11038 https://bugs.webkit.org/show_bug.cgi?id=87691
11039
11040 broke V8 raytrace benchmark (Requested by pizlo_ on #webkit).
11041
11042 * heap/Heap.cpp:
11043 (JSC::Heap::collect):
11044 * heap/MarkedBlock.cpp:
11045 (JSC::MarkedBlock::sweep):
11046 * heap/MarkedBlock.h:
11047 (JSC::MarkedBlock::sweepWeakSet):
11048 (JSC):
11049 * heap/MarkedSpace.cpp:
11050 (JSC::SweepWeakSet::operator()):
11051 (JSC):
11052 (JSC::MarkedSpace::sweepWeakSets):
11053 * heap/MarkedSpace.h:
11054 (MarkedSpace):
11055
fpizlo@apple.com26ece8e2012-05-29 02:43:30 +0000110562012-05-28 Filip Pizlo <fpizlo@apple.com>
11057
11058 DFG should not generate code for code that the CFA proves to be unreachable
11059 https://bugs.webkit.org/show_bug.cgi?id=87682
11060
11061 Reviewed by Sam Weinig.
11062
11063 This also fixes a small performance bug where CFA was not marking blocks
11064 as having constants (and hence not triggering constant folding) if the only
11065 constants were on GetLocals.
11066
11067 And fixing that bug revealed another bug: constant folding was assuming that
11068 a GetLocal must be the first access to a local in a basic block. This isn't
11069 true. The first access may be a Flush. This patch fixes that issue using the
11070 safest approach possible, since we don't need to be clever for something that
11071 only happens in one of our benchmarks.
11072
11073 * dfg/DFGAbstractState.cpp:
11074 (JSC::DFG::AbstractState::execute):
11075 * dfg/DFGConstantFoldingPhase.cpp:
11076 (JSC::DFG::ConstantFoldingPhase::run):
11077 * dfg/DFGJITCompiler.h:
11078 (JSC::DFG::JITCompiler::noticeOSREntry):
11079 * dfg/DFGSpeculativeJIT.cpp:
11080 (JSC::DFG::SpeculativeJIT::compile):
11081
carlosgc@webkit.orgb69727c2012-05-28 10:21:31 +0000110822012-05-28 Carlos Garcia Campos <cgarcia@igalia.com>
11083
11084 Unreviewed. Fix make distcheck.
11085
11086 * GNUmakefile.list.am: Add missing header file.
11087
ggaren@apple.comb816d752012-05-28 04:56:01 +0000110882012-05-27 Geoffrey Garen <ggaren@apple.com>
11089
11090 Weak pointer finalization should be lazy
11091 https://bugs.webkit.org/show_bug.cgi?id=87599
11092
11093 Reviewed by Darin Adler.
11094
11095 * heap/Heap.cpp:
11096 (JSC::Heap::collect): Don't force immediate finalization -- it will
11097 happen lazily.
11098
11099 * heap/MarkedBlock.cpp:
11100 (JSC::MarkedBlock::sweep): Sweep a block's weak set when sweeping the
11101 block. The weak set may not have been swept yet, and this is our last
11102 chance to run weak finalizers before we recycle the memory they reference.
11103
11104 * heap/MarkedBlock.h:
11105 * heap/MarkedSpace.cpp:
11106 (JSC::MarkedBlock::sweepWeakSets):
11107 * heap/MarkedSpace.h:
11108 (JSC::MarkedSpace::sweepWeakSets): Nixed sweepWeakSets because it's unused
11109 now.
11110
ggaren@apple.com72da8112012-05-26 22:40:46 +0000111112012-05-26 Geoffrey Garen <ggaren@apple.com>
11112
11113 WebKit should be lazy-finalization-safe (esp. the DOM) v2
11114 https://bugs.webkit.org/show_bug.cgi?id=87581
11115
11116 Reviewed by Oliver Hunt.
11117
11118 * heap/MarkedBlock.cpp:
11119 (JSC::MarkedBlock::callDestructor):
11120 * heap/WeakBlock.h:
11121 * heap/WeakSetInlines.h:
11122 (JSC::WeakBlock::finalize): Since we don't guarantee destruction order,
11123 it's not valid to access GC pointers like the Structure pointer during
11124 finalization. We NULL out the structure pointer in debug builds to try
11125 to make this programming mistake more obvious.
11126
11127 * API/JSCallbackConstructor.cpp:
11128 (JSC::JSCallbackConstructor::destroy):
11129 * API/JSCallbackObject.cpp:
11130 (JSC::::destroy):
11131 (JSC::JSCallbackObjectData::finalize):
11132 * runtime/Arguments.cpp:
11133 (JSC::Arguments::destroy):
11134 * runtime/DateInstance.cpp:
11135 (JSC::DateInstance::destroy):
11136 * runtime/Error.cpp:
11137 (JSC::StrictModeTypeErrorFunction::destroy):
11138 * runtime/Executable.cpp:
11139 (JSC::ExecutableBase::destroy):
11140 (JSC::NativeExecutable::destroy):
11141 (JSC::ScriptExecutable::destroy):
11142 (JSC::EvalExecutable::destroy):
11143 (JSC::ProgramExecutable::destroy):
11144 (JSC::FunctionExecutable::destroy):
11145 * runtime/JSGlobalObject.cpp:
11146 (JSC::JSGlobalObject::destroy):
11147 * runtime/JSPropertyNameIterator.cpp:
11148 (JSC::JSPropertyNameIterator::destroy):
11149 * runtime/JSStaticScopeObject.cpp:
11150 (JSC::JSStaticScopeObject::destroy):
11151 * runtime/JSString.cpp:
11152 (JSC::JSString::destroy):
11153 * runtime/JSVariableObject.cpp:
11154 (JSC::JSVariableObject::destroy):
11155 * runtime/NameInstance.cpp:
11156 (JSC::NameInstance::destroy):
11157 * runtime/RegExp.cpp:
11158 (JSC::RegExp::destroy):
11159 * runtime/RegExpConstructor.cpp:
11160 (JSC::RegExpConstructor::destroy):
11161 * runtime/Structure.cpp:
11162 (JSC::Structure::destroy):
11163 * runtime/StructureChain.cpp:
11164 (JSC::StructureChain::destroy): Use static_cast instead of jsCast because
11165 jsCast does Structure-based validation, and our Structure is not guaranteed
11166 to be alive when we get finalized.
11167
fpizlo@apple.com7e0f6502012-05-25 22:45:57 +0000111682012-05-22 Filip Pizlo <fpizlo@apple.com>
11169
fpizlo@apple.com190f5252012-05-25 23:00:26 +000011170 DFG CSE should eliminate redundant WeakJSConstants
11171 https://bugs.webkit.org/show_bug.cgi?id=87179
11172
11173 Reviewed by Gavin Barraclough.
11174
11175 Merged r118141 from dfgopt.
11176
11177 * dfg/DFGCSEPhase.cpp:
11178 (JSC::DFG::CSEPhase::weakConstantCSE):
11179 (CSEPhase):
11180 (JSC::DFG::CSEPhase::performNodeCSE):
11181 * dfg/DFGNode.h:
11182 (JSC::DFG::Node::weakConstant):
11183
111842012-05-22 Filip Pizlo <fpizlo@apple.com>
11185
fpizlo@apple.com7e0f6502012-05-25 22:45:57 +000011186 DFG CSE should do redundant store elimination
11187 https://bugs.webkit.org/show_bug.cgi?id=87161
11188
11189 Reviewed by Oliver Hunt.
11190
11191 Merge r118138 from dfgopt.
11192
11193 This patch adds redundant store elimination. For example, consider this
11194 code:
11195
11196 o.x = 42;
11197 o.x = 84;
11198
11199 If o.x is speculated to be a well-behaved field, the first assignment is
11200 unnecessary, since the second just overwrites it. We would like to
11201 eliminate the first assignment in these cases. The need for this
11202 optimization arises mostly from stores that our runtime requires. For
11203 example:
11204
11205 o = {f:1, g:2, h:3};
11206
11207 This will have four assignments to the structure for the newly created
11208 object - one assignment for the empty structure, one for {f}, one for
11209 {f, g}, and one for {f, g, h}. We would like to only have the last of
11210 those assigments in this case.
11211
11212 Intriguingly, doing so for captured variables breaks the way arguments
11213 simplification used to work. Consider that prior to either arguments
11214 simplification or store elimination we will have IR that looks like:
11215
11216 a: SetLocal(r0, Empty)
11217 b: SetLocal(r1, Empty)
11218 c: GetLocal(r0)
11219 d: CreateArguments(@c)
11220 e: SetLocal(r0, @d)
11221 f: SetLocal(r1, @d)
11222
11223 Then redundant store elimination will eliminate the stores that
11224 initialize the arguments registers to Empty, but then arguments
11225 simplification eliminates the stores that initialize the arguments to
11226 the newly created arguments - and at this point we no longer have any
11227 stores to the arguments register, leading to hilarious crashes. This
11228 patch therefore changes arguments simplification to replace
11229 CreateArguments with JSConstant(Empty) rather than eliminating the
11230 SetLocals. But this revealed bugs where arguments simplification was
11231 being overzealous, so I fixed those bugs.
11232
11233 This is a minor speed-up on V8/early and a handful of other tests.
11234
11235 * bytecode/CodeBlock.h:
11236 (JSC::CodeBlock::uncheckedActivationRegister):
11237 * dfg/DFGAbstractState.cpp:
11238 (JSC::DFG::AbstractState::execute):
11239 * dfg/DFGArgumentsSimplificationPhase.cpp:
11240 (JSC::DFG::ArgumentsSimplificationPhase::run):
11241 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
11242 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUses):
11243 (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
11244 * dfg/DFGCSEPhase.cpp:
11245 (JSC::DFG::CSEPhase::globalVarStoreElimination):
11246 (CSEPhase):
11247 (JSC::DFG::CSEPhase::putStructureStoreElimination):
11248 (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
11249 (JSC::DFG::CSEPhase::setLocalStoreElimination):
11250 (JSC::DFG::CSEPhase::setReplacement):
11251 (JSC::DFG::CSEPhase::eliminate):
11252 (JSC::DFG::CSEPhase::performNodeCSE):
11253 * dfg/DFGGraph.h:
11254 (JSC::DFG::Graph::uncheckedActivationRegisterFor):
11255 (Graph):
11256 * dfg/DFGNode.h:
11257 (JSC::DFG::Node::isPhantomArguments):
11258 (Node):
11259 (JSC::DFG::Node::hasConstant):
11260 (JSC::DFG::Node::valueOfJSConstant):
11261 (JSC::DFG::Node::hasStructureTransitionData):
11262 * dfg/DFGNodeType.h:
11263 (DFG):
11264 * dfg/DFGPredictionPropagationPhase.cpp:
11265 (JSC::DFG::PredictionPropagationPhase::propagate):
11266 * dfg/DFGSpeculativeJIT.cpp:
11267 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
11268 * dfg/DFGSpeculativeJIT32_64.cpp:
11269 (JSC::DFG::SpeculativeJIT::compile):
11270 * dfg/DFGSpeculativeJIT64.cpp:
11271 (JSC::DFG::SpeculativeJIT::compile):
11272
fpizlo@apple.com016fd682012-05-25 20:19:55 +0000112732012-05-21 Filip Pizlo <fpizlo@apple.com>
11274
11275 DFG ConvertThis should just be a CheckStructure if the structure is known
11276 https://bugs.webkit.org/show_bug.cgi?id=87057
11277
11278 Reviewed by Gavin Barraclough.
11279
11280 Merged r118021 from dfgopt.
11281
11282 This gives ValueProfile the ability to track singleton values - i.e. profiling
11283 sites that always see the same value.
11284
11285 That is then used to profile the structure in op_convert_this.
11286
11287 This is then used to optimize op_convert_this into a CheckStructure if the
11288 structure is always the same.
11289
11290 That then results in better CSE in inlined code that uses 'this', since
11291 previously we couldn't CSE accesses on 'this' from different inline call frames.
11292
11293 Also fixed a bug where we were unnecessarily flushing 'this'.
11294
11295 * bytecode/CodeBlock.cpp:
11296 (JSC::CodeBlock::dump):
11297 (JSC::CodeBlock::stronglyVisitStrongReferences):
11298 * bytecode/LazyOperandValueProfile.cpp:
11299 (JSC::CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions):
11300 * bytecode/LazyOperandValueProfile.h:
11301 (CompressedLazyOperandValueProfileHolder):
11302 * bytecode/Opcode.h:
11303 (JSC):
11304 (JSC::padOpcodeName):
11305 * bytecode/ValueProfile.h:
11306 (JSC::ValueProfileBase::ValueProfileBase):
11307 (JSC::ValueProfileBase::dump):
11308 (JSC::ValueProfileBase::computeUpdatedPrediction):
11309 (ValueProfileBase):
11310 * bytecompiler/BytecodeGenerator.cpp:
11311 (JSC::BytecodeGenerator::BytecodeGenerator):
11312 * dfg/DFGByteCodeParser.cpp:
11313 (JSC::DFG::ByteCodeParser::setArgument):
11314 (JSC::DFG::ByteCodeParser::parseBlock):
11315 * jit/JITOpcodes.cpp:
11316 (JSC::JIT::emit_op_convert_this):
11317 (JSC::JIT::emitSlow_op_convert_this):
11318 * jit/JITOpcodes32_64.cpp:
11319 (JSC::JIT::emit_op_convert_this):
11320 (JSC::JIT::emitSlow_op_convert_this):
11321 * llint/LLIntSlowPaths.cpp:
11322 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
11323 * llint/LowLevelInterpreter32_64.asm:
11324 * llint/LowLevelInterpreter64.asm:
11325 * runtime/JSValue.h:
11326 (JSValue):
11327 * runtime/Structure.h:
11328 (JSC::JSValue::structureOrUndefined):
11329 (JSC):
11330
timothy_horton@apple.com3f03ac12012-05-25 06:53:27 +0000113312012-05-24 Tim Horton <timothy_horton@apple.com>
11332
11333 Add feature defines for web-facing parts of CSS Regions and Exclusions
11334 https://bugs.webkit.org/show_bug.cgi?id=87442
11335 <rdar://problem/10887709>
11336
11337 Reviewed by Dan Bernstein.
11338
11339 * Configurations/FeatureDefines.xcconfig:
11340
ggaren@apple.com9e1789f2012-05-25 06:52:00 +0000113412012-05-24 Geoffrey Garen <ggaren@apple.com>
11342
11343 WebKit should be lazy-finalization-safe (esp. the DOM)
11344 https://bugs.webkit.org/show_bug.cgi?id=87456
11345
11346 Reviewed by Filip Pizlo.
11347
11348 Lazy finalization adds one twist to weak pointer use:
11349
11350 A HashMap of weak pointers may contain logically null entries.
11351 (Weak pointers behave as-if null once their payloads die.)
11352 Insertion must not assume that a pre-existing entry is
11353 necessarily valid, and iteration must not assume that all
11354 entries can be dereferenced.
11355
11356 (Previously, I thought that it also added a second twist:
11357
11358 A demand-allocated weak pointer may replace a dead payload
11359 before the payload's finalizer runs. In that case, when the
11360 payload's finalizer runs, the payload has already been
11361 overwritten, and the finalizer should not clear the payload,
11362 which now points to something new.
11363
11364 But that's not the case here, since we cancel the old payload's
11365 finalizer when we over-write it. I've added ASSERTs to verify this
11366 assumption, in case it ever changes.)
11367
11368 * API/JSClassRef.cpp:
11369 (OpaqueJSClass::prototype): No need to specify null; that's the default.
11370
11371 * API/JSWeakObjectMapRefPrivate.cpp: Use remove, since take() is gone.
11372
11373 * heap/PassWeak.h:
11374 (WeakImplAccessor::was): This is no longer a debug-only function, since
11375 it's required to reason about lazily finalized pointers.
11376
11377 * heap/Weak.h:
11378 (JSC::weakAdd):
11379 (JSC::weakRemove):
11380 (JSC::weakClear): Added these helper functions for the common idioms of
11381 what clients want to do in their weak pointer finalizers.
11382
11383 * jit/JITStubs.cpp:
11384 (JSC::JITThunks::hostFunctionStub): Use the new idioms. Otherwise, we
11385 would return NULL for a "zombie" executable weak pointer that was waiting
11386 for finalization (item (2)), and finalizing a dead executable weak pointer
11387 would potentially destroy a new, live one (item (1)).
11388
11389 * runtime/RegExpCache.cpp:
11390 (JSC::RegExpCache::lookupOrCreate):
11391 (JSC::RegExpCache::finalize): Ditto.
11392
11393 (JSC::RegExpCache::invalidateCode): Check for null while iterating. (See
11394 item (2).)
11395
11396 * runtime/Structure.cpp:
11397 (JSC::StructureTransitionTable::contains):
11398 (JSC::StructureTransitionTable::add): Use get and set instead of add and
11399 contains, since add and contains are not compatible with lazy finalization.
11400
11401 * runtime/WeakGCMap.h:
11402 (WeakGCMap):
11403 (JSC::WeakGCMap::clear):
11404 (JSC::WeakGCMap::remove): Removed a bunch of code that was incompatible with
11405 lazy finalization because I didn't feel like making it compatible, and I had
11406 no way to test it.
11407
fpizlo@apple.com0b9b37a2012-05-25 03:29:18 +0000114082012-05-24 Filip Pizlo <fpizlo@apple.com>
11409
fpizlo@apple.com9d899a42012-05-25 05:41:03 +000011410 REGRESSION (r118013-r118031): Loops/Reloads under www.yahoo.com, quits after three tries with error
11411 https://bugs.webkit.org/show_bug.cgi?id=87327
11412
11413 Reviewed by Geoffrey Garen.
11414
11415 If you use AbstractValue::filter(StructureSet) to test subset relationships between TOP and a
11416 set containing >=2 elements, you're going to have a bad time.
11417
11418 That's because AbstractValue considers a set with >=2 elements to be equivalent to TOP, in order
11419 to save space and speed up convergence. So filtering has no effect in this case, which made
11420 the code think that the abstract value was proving that the structure check was unnecessary.
11421 The correct thing to do is to use isSubsetOf() on the StructureAbstractValue, which does the
11422 right thingies for TOP and >=2 elements.
11423
11424 * dfg/DFGAbstractState.cpp:
11425 (JSC::DFG::AbstractState::execute):
11426 * dfg/DFGSpeculativeJIT32_64.cpp:
11427 (JSC::DFG::SpeculativeJIT::compile):
11428 * dfg/DFGSpeculativeJIT64.cpp:
11429 (JSC::DFG::SpeculativeJIT::compile):
11430
114312012-05-24 Filip Pizlo <fpizlo@apple.com>
11432
fpizlo@apple.com0b9b37a2012-05-25 03:29:18 +000011433 new test fast/js/dfg-arguments-mixed-alias.html fails on JSVALUE32_64
11434 https://bugs.webkit.org/show_bug.cgi?id=87378
11435
11436 Reviewed by Gavin Barraclough.
11437
11438 - Captured variable tracking forgot did not consistently handle arguments, leading to OSR
11439 badness.
11440
11441 - Nodes capable of exiting were tracked in a non-monotonic way, leading to compiler errors.
11442
11443 * dfg/DFGByteCodeParser.cpp:
11444 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
11445 * dfg/DFGCSEPhase.cpp:
11446 (JSC::DFG::CSEPhase::CSEPhase):
11447 (CSEPhase):
11448 (JSC::DFG::performCSE):
11449 * dfg/DFGCSEPhase.h:
11450 (DFG):
11451 * dfg/DFGCommon.h:
11452 * dfg/DFGDriver.cpp:
11453 (JSC::DFG::compile):
11454 * dfg/DFGGraph.cpp:
11455 (JSC::DFG::Graph::resetExitStates):
11456 (DFG):
11457 * dfg/DFGGraph.h:
11458 (Graph):
11459 * dfg/DFGPhase.h:
11460 (DFG):
11461 (JSC::DFG::runPhase):
11462
ggaren@apple.com39281e22012-05-24 21:18:10 +0000114632012-05-24 Geoffrey Garen <ggaren@apple.com>
11464
11465 Made WeakSet per-block instead of per-heap
11466 https://bugs.webkit.org/show_bug.cgi?id=87401
11467
11468 Reviewed by Oliver Hunt.
11469
11470 This allows us fast access to the set of all weak pointers for a block,
11471 which is a step toward lazy finalization.
11472
11473 No performance change.
11474
11475 * heap/Heap.cpp:
11476 (JSC::Heap::Heap):
11477 (JSC::Heap::lastChanceToFinalize): Removed the per-heap weak set, since
11478 it's per-block now.
11479
11480 (JSC::Heap::markRoots): Delegate weak set visiting to the marked space,
11481 since it knows how to iterate all blocks.
11482
11483 (JSC::Heap::collect): Moved the reaping outside of markRoots, since it
11484 doesn't mark anything.
11485
11486 Make sure to reset allocators after shrinking, since shrinking may
11487 deallocate the current allocator.
11488
11489 * heap/Heap.h:
11490 (Heap): No more per-heap weak set, since it's per-block now.
11491
11492 * heap/MarkedBlock.cpp:
11493 (JSC::MarkedBlock::MarkedBlock):
11494 * heap/MarkedBlock.h:
11495 (MarkedBlock):
11496 (JSC::MarkedBlock::lastChanceToFinalize): Migrated finalization logic
11497 here from the heap, so the heap doesn't need to know about our internal
11498 data structures like our weak set.
11499
11500 (JSC::MarkedBlock::heap):
11501 (JSC::MarkedBlock::weakSet):
11502 (JSC::MarkedBlock::shrink):
11503 (JSC::MarkedBlock::resetAllocator):
11504 (JSC::MarkedBlock::visitWeakSet):
11505 (JSC::MarkedBlock::reapWeakSet):
11506 (JSC::MarkedBlock::sweepWeakSet):
11507 * heap/MarkedSpace.cpp:
11508 (JSC::VisitWeakSet::VisitWeakSet):
11509 (JSC::VisitWeakSet::operator()):
11510 (VisitWeakSet):
11511 (JSC):
11512 (JSC::ReapWeakSet::operator()):
11513 (JSC::SweepWeakSet::operator()):
11514 (JSC::LastChanceToFinalize::operator()):
11515 (JSC::MarkedSpace::lastChanceToFinalize):
11516 (JSC::ResetAllocator::operator()):
11517 (JSC::MarkedSpace::resetAllocators):
11518 (JSC::MarkedSpace::visitWeakSets):
11519 (JSC::MarkedSpace::reapWeakSets):
11520 (JSC::MarkedSpace::sweepWeakSets):
11521 (JSC::Shrink::operator()):
11522 (JSC::MarkedSpace::shrink):
11523 * heap/MarkedSpace.h:
11524 (MarkedSpace): Make sure to account for our weak sets when sweeping,
11525 shrinking, etc.
11526
11527 * heap/WeakSet.cpp:
11528 (JSC):
11529 * heap/WeakSet.h:
11530 (WeakSet):
11531 (JSC::WeakSet::heap):
11532 (JSC):
11533 (JSC::WeakSet::lastChanceToFinalize):
11534 (JSC::WeakSet::visit):
11535 (JSC::WeakSet::reap):
11536 (JSC::WeakSet::shrink):
11537 (JSC::WeakSet::resetAllocator): Inlined some things since they're called
11538 once per block now instead of once per heap.
11539
11540 * heap/WeakSetInlines.h:
11541 (JSC::WeakSet::allocate): Use the per-block weak set since there is no
11542 per-heap weak set anymore.
11543
barraclough@apple.comefdbf472012-05-24 21:14:07 +0000115442012-05-24 Gavin Barraclough <barraclough@apple.com>
11545
barraclough@apple.com8ca6a7a2012-05-24 21:17:38 +000011546 Fix arm build
11547
11548 Rubber stamped by Geoff Garen
11549
11550 * dfg/DFGGPRInfo.h:
11551 (GPRInfo):
11552
115532012-05-24 Gavin Barraclough <barraclough@apple.com>
11554
barraclough@apple.comefdbf472012-05-24 21:14:07 +000011555 Move cacheFlush from ExecutableAllocator to Assembler classes
11556 https://bugs.webkit.org/show_bug.cgi?id=87420
11557
11558 Reviewed by Oliver Hunt.
11559
11560 Makes more sense there, & remove a pile of #ifdefs.
11561
11562 * assembler/ARMAssembler.cpp:
11563 (JSC):
11564 (JSC::ARMAssembler::cacheFlush):
11565 * assembler/ARMAssembler.h:
11566 (ARMAssembler):
11567 (JSC::ARMAssembler::cacheFlush):
11568 * assembler/ARMv7Assembler.h:
11569 (JSC::ARMv7Assembler::relinkJump):
11570 (JSC::ARMv7Assembler::cacheFlush):
11571 (ARMv7Assembler):
11572 (JSC::ARMv7Assembler::setInt32):
11573 (JSC::ARMv7Assembler::setUInt7ForLoad):
11574 * assembler/AbstractMacroAssembler.h:
11575 (JSC::AbstractMacroAssembler::cacheFlush):
11576 * assembler/LinkBuffer.h:
11577 (JSC::LinkBuffer::performFinalization):
11578 * assembler/MIPSAssembler.h:
11579 (JSC::MIPSAssembler::relinkJump):
11580 (JSC::MIPSAssembler::relinkCall):
11581 (JSC::MIPSAssembler::repatchInt32):
11582 (JSC::MIPSAssembler::cacheFlush):
11583 (MIPSAssembler):
11584 * assembler/SH4Assembler.h:
11585 (JSC::SH4Assembler::repatchCompact):
11586 (JSC::SH4Assembler::cacheFlush):
11587 (SH4Assembler):
11588 * assembler/X86Assembler.h:
11589 (X86Assembler):
11590 (JSC::X86Assembler::cacheFlush):
11591 * jit/ExecutableAllocator.cpp:
11592 (JSC):
11593 * jit/ExecutableAllocator.h:
11594 (ExecutableAllocator):
11595
commit-queue@webkit.org2c8bcde2012-05-24 20:01:53 +0000115962012-05-24 John Mellor <johnme@chromium.org>
11597
11598 Font Boosting: Add compile flag and runtime setting
11599 https://bugs.webkit.org/show_bug.cgi?id=87394
11600
11601 Reviewed by Adam Barth.
11602
11603 Add ENABLE_FONT_BOOSTING.
11604
11605 * Configurations/FeatureDefines.xcconfig:
11606
commit-queue@webkit.orgd553c622012-05-24 10:50:40 +0000116072012-05-24 Allan Sandfeld Jensen <allan.jensen@nokia.com>
11608
11609 cti_vm_throw gets kicked out by gcc 4.6 -flto
11610 https://bugs.webkit.org/show_bug.cgi?id=56088
11611
11612 Reviewed by Darin Adler.
11613
11614 Add REFERENCED_FROM_ASM to functions only referenced from assembler.
11615
11616 * dfg/DFGOperations.cpp:
11617 * jit/HostCallReturnValue.h:
11618 * jit/JITStubs.h:
11619 * jit/ThunkGenerators.cpp:
11620
fpizlo@apple.com36f14462012-05-24 07:35:05 +0000116212012-05-24 Filip Pizlo <fpizlo@apple.com>
11622
11623 Incorrect merge of r117542 from dfg opt branch in r118323 is leading to fast/js/dfg-arguments-osr-exit.html failing
11624 https://bugs.webkit.org/show_bug.cgi?id=87350
11625
11626 Reviewed by Maciej Stachowiak.
11627
11628 The dfgopt branch introduced the notion of a local variable being killed because it was aliased
11629 to the Arguments object as in cases like:
11630
11631 var a = arguments;
11632 return a.length;
11633
11634 This required changes to OSR exit handling - if the variable is dead but aliased to arguments, then
11635 OSR exit should reify the arguments. But meanwhile, in tip of tree we introduced special handling for
11636 dead variables on OSR exit. When the two were merged in r118323, the structure of the if/else branches
11637 ended up being such that we would treat dead arguments variables as totally dead as opposed to treating
11638 them as variables that need arguments reification.
11639
11640 This fixes the structure of the relevant if/else block so that variables that are dead-but-arguments
11641 end up being treated as reified arguments objects, while variables that are dead but not aliased to
11642 arguments are treated as tip of tree would have treated them (initialize to Undefined).
11643
11644 * dfg/DFGSpeculativeJIT.cpp:
11645 (JSC::DFG::SpeculativeJIT::compile):
11646
ossy@webkit.orgbc0d6372012-05-24 07:05:31 +0000116472012-05-24 Csaba Osztrogonác <ossy@webkit.org>
11648
11649 Unreviewed 32 bit buildfix after r118325.
11650
11651 * dfg/DFGSpeculativeJIT32_64.cpp:
11652 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): Use ASSERT_UNUSED instead ASSERT.
11653
fpizlo@apple.comd96eb4e2012-05-24 06:58:52 +0000116542012-05-23 Filip Pizlo <fpizlo@apple.com>
11655
fpizlo@apple.comb3ac2422012-05-24 07:00:24 +000011656 DFG operationTearOffActivation should return after handling the null activation case
11657 https://bugs.webkit.org/show_bug.cgi?id=87348
11658 <rdar://problem/11522295>
11659
11660 Reviewed by Oliver Hunt.
11661
11662 * dfg/DFGOperations.cpp:
11663
116642012-05-23 Filip Pizlo <fpizlo@apple.com>
11665
fpizlo@apple.comd96eb4e2012-05-24 06:58:52 +000011666 Unreviewed, merge the arguments fix in r118138 to get bots green.
11667
11668 * dfg/DFGArgumentsSimplificationPhase.cpp:
11669 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
11670
fpizlo@apple.comb9c94622012-05-24 05:51:05 +0000116712012-05-20 Filip Pizlo <fpizlo@apple.com>
11672
fpizlo@apple.com91b2c682012-05-24 06:24:36 +000011673 DFG CFA should record if a node can OSR exit
11674 https://bugs.webkit.org/show_bug.cgi?id=86905
11675
11676 Reviewed by Oliver Hunt.
11677
11678 Merged r117931 from dfgopt.
11679
11680 Adds a NodeFlag that denotes nodes that are known to not have OSR exits.
11681 This ought to aid any backwards analyses that need to know when a
11682 backward flow merge might happen due to a side exit.
11683
11684 Also added assertions into speculationCheck() that ensure that we did not
11685 mark a node as non-exiting and then promptly compile in an exit. This
11686 helped catch some minor bugs where we were doing unnecessary speculation
11687 checks.
11688
11689 This is a perf-neutral change. The speculation checks that this removes
11690 were not on hot paths of major benchmarks.
11691
11692 * bytecode/PredictedType.h:
11693 (JSC):
11694 (JSC::isAnyPrediction):
11695 * dfg/DFGAbstractState.cpp:
11696 (JSC::DFG::AbstractState::execute):
11697 * dfg/DFGAbstractState.h:
11698 (JSC::DFG::AbstractState::speculateInt32Unary):
11699 (AbstractState):
11700 (JSC::DFG::AbstractState::speculateNumberUnary):
11701 (JSC::DFG::AbstractState::speculateBooleanUnary):
11702 (JSC::DFG::AbstractState::speculateInt32Binary):
11703 (JSC::DFG::AbstractState::speculateNumberBinary):
11704 * dfg/DFGNode.h:
11705 (JSC::DFG::Node::mergeFlags):
11706 (JSC::DFG::Node::filterFlags):
11707 (Node):
11708 (JSC::DFG::Node::setCanExit):
11709 (JSC::DFG::Node::canExit):
11710 * dfg/DFGNodeFlags.cpp:
11711 (JSC::DFG::nodeFlagsAsString):
11712 * dfg/DFGNodeFlags.h:
11713 (DFG):
11714 * dfg/DFGSpeculativeJIT.cpp:
11715 (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
11716 (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
11717 (JSC::DFG::SpeculativeJIT::compileValueToInt32):
11718 * dfg/DFGSpeculativeJIT.h:
11719 (JSC::DFG::SpeculativeJIT::speculationCheck):
11720 (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
11721 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
11722 (SpeculativeJIT):
11723 * dfg/DFGSpeculativeJIT32_64.cpp:
11724 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
11725 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
11726 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
11727 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
11728 (JSC::DFG::SpeculativeJIT::compile):
11729 * dfg/DFGSpeculativeJIT64.cpp:
11730 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
11731 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
11732 (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
11733 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
11734 (JSC::DFG::SpeculativeJIT::compile):
11735
117362012-05-20 Filip Pizlo <fpizlo@apple.com>
11737
fpizlo@apple.comb9c94622012-05-24 05:51:05 +000011738 DFG should not do unnecessary indirections when storing to objects
11739 https://bugs.webkit.org/show_bug.cgi?id=86959
11740
11741 Reviewed by Oliver Hunt.
11742
11743 Merged r117819 from dfgopt.
11744
11745 * dfg/DFGByteCodeParser.cpp:
11746 (JSC::DFG::ByteCodeParser::parseBlock):
11747 * dfg/DFGCSEPhase.cpp:
11748 (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
11749 * dfg/DFGSpeculativeJIT32_64.cpp:
11750 (JSC::DFG::SpeculativeJIT::compile):
11751 * dfg/DFGSpeculativeJIT64.cpp:
11752 (JSC::DFG::SpeculativeJIT::compile):
11753
fpizlo@apple.com9a548f12012-05-24 05:33:09 +0000117542012-05-17 Filip Pizlo <fpizlo@apple.com>
11755
11756 DFG should optimize aliased uses of the Arguments object of the current call frame
11757 https://bugs.webkit.org/show_bug.cgi?id=86552
11758
11759 Reviewed by Geoff Garen.
11760
11761 Merged r117542 and r117543 from dfgopt.
11762
11763 Performs must-alias and escape analysis on uses of CreateArguments, and if
11764 a variable is must-aliased to CreateArguments and does not escape, then we
11765 turn all uses of that variable into direct arguments accesses.
11766
11767 36% speed-up on V8/earley leading to a 2.3% speed-up overall in V8.
11768
11769 * bytecode/CodeBlock.h:
11770 (JSC::CodeBlock::uncheckedArgumentsRegister):
11771 * bytecode/ValueRecovery.h:
11772 (JSC::ValueRecovery::argumentsThatWereNotCreated):
11773 (ValueRecovery):
11774 (JSC::ValueRecovery::dump):
11775 * dfg/DFGAbstractState.cpp:
11776 (JSC::DFG::AbstractState::execute):
11777 * dfg/DFGAdjacencyList.h:
11778 (AdjacencyList):
11779 (JSC::DFG::AdjacencyList::removeEdgeFromBag):
11780 * dfg/DFGArgumentsSimplificationPhase.cpp:
11781 (JSC::DFG::ArgumentsSimplificationPhase::run):
11782 (ArgumentsSimplificationPhase):
11783 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
11784 (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUses):
11785 (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
11786 (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
11787 (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
11788 * dfg/DFGAssemblyHelpers.h:
11789 (JSC::DFG::AssemblyHelpers::argumentsRegisterFor):
11790 (AssemblyHelpers):
11791 * dfg/DFGByteCodeParser.cpp:
11792 (JSC::DFG::ByteCodeParser::parseBlock):
11793 * dfg/DFGCFGSimplificationPhase.cpp:
11794 (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
11795 * dfg/DFGGPRInfo.h:
11796 (GPRInfo):
11797 * dfg/DFGGraph.cpp:
11798 (JSC::DFG::Graph::collectGarbage):
11799 (DFG):
11800 * dfg/DFGGraph.h:
11801 (Graph):
11802 (JSC::DFG::Graph::executableFor):
11803 (JSC::DFG::Graph::argumentsRegisterFor):
11804 (JSC::DFG::Graph::uncheckedArgumentsRegisterFor):
11805 (JSC::DFG::Graph::clobbersWorld):
11806 * dfg/DFGNode.h:
11807 (JSC::DFG::Node::hasHeapPrediction):
11808 * dfg/DFGNodeType.h:
11809 (DFG):
11810 * dfg/DFGOSRExitCompiler.cpp:
11811 * dfg/DFGOSRExitCompiler.h:
11812 (JSC::DFG::OSRExitCompiler::OSRExitCompiler):
11813 (OSRExitCompiler):
11814 * dfg/DFGOSRExitCompiler32_64.cpp:
11815 (JSC::DFG::OSRExitCompiler::compileExit):
11816 * dfg/DFGOSRExitCompiler64.cpp:
11817 (JSC::DFG::OSRExitCompiler::compileExit):
11818 * dfg/DFGOperations.cpp:
11819 * dfg/DFGPredictionPropagationPhase.cpp:
11820 (JSC::DFG::PredictionPropagationPhase::propagate):
11821 * dfg/DFGSpeculativeJIT.cpp:
11822 (JSC::DFG::ValueSource::dump):
11823 (JSC::DFG::SpeculativeJIT::compile):
11824 (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
11825 * dfg/DFGSpeculativeJIT.h:
11826 * dfg/DFGSpeculativeJIT32_64.cpp:
11827 (JSC::DFG::SpeculativeJIT::compile):
11828 * dfg/DFGSpeculativeJIT64.cpp:
11829 (JSC::DFG::SpeculativeJIT::compile):
11830 * dfg/DFGVariableAccessData.h:
11831 (JSC::DFG::VariableAccessData::VariableAccessData):
11832 (JSC::DFG::VariableAccessData::mergeIsArgumentsAlias):
11833 (VariableAccessData):
11834 (JSC::DFG::VariableAccessData::isArgumentsAlias):
11835 * jit/JITOpcodes.cpp:
11836 (JSC::JIT::emitSlow_op_get_argument_by_val):
11837
fpizlo@apple.comdb7ba192012-05-24 02:28:52 +0000118382012-05-23 Filip Pizlo <fpizlo@apple.com>
11839
fpizlo@apple.comae3413b2012-05-24 02:34:09 +000011840 DFGCapabilities should not try to get an arguments register from code blocks that don't have one
11841 https://bugs.webkit.org/show_bug.cgi?id=87332
11842
11843 Reviewed by Andy Estes.
11844
11845 * dfg/DFGCapabilities.h:
11846 (JSC::DFG::canInlineOpcode):
11847
118482012-05-23 Filip Pizlo <fpizlo@apple.com>
11849
fpizlo@apple.comdb7ba192012-05-24 02:28:52 +000011850 DFG should have sparse conditional constant propagation
11851 https://bugs.webkit.org/show_bug.cgi?id=86580
11852
11853 Reviewed by Oliver Hunt.
11854
11855 Merged r117370 from dfgopt.
11856
11857 This enhances CFA so that if it suspects at any point during the fixpoint that a
11858 branch will only go one way, then it only propagates in that one way.
11859
11860 This vastly increases the opportunities for CFG simplification. For example, it
11861 enables us to evaporate this loop:
11862
11863 for (var i = 0; i < 1; ++i) doThings(i);
11864
11865 As a result, it uncovered loads of bugs in the CFG simplifier. In particular:
11866
11867 - Phi fixup was assuming that all Phis worth fixing up are shouldGenerate().
11868 That's not true; we also fixup Phis that are dead.
11869
11870 - GetLocal fixup was assuming that it's only necessary to rewire links to a
11871 GetLocal, and that the GetLocal's own links don't need to be rewired. Untrue,
11872 because the GetLocal may not be rewirable (first block has no GetLocal for r42
11873 but second block does have a GetLocal), in which case it will refer to a Phi
11874 in the second block. We need it to refer to a Phi from the first block to
11875 ensure that subsequent transformations work.
11876
11877 - Tail operand fixup was ignoring the fact that Phis in successors may contain
11878 references to the children of our tail variables. Hence, successor Phi child
11879 substitution needs to use the original second block variable table as its
11880 prior, rather than trying to reconstruct the prior later (since by that point
11881 the children of the second block's tail variables will have been fixed up, so
11882 we will not know what the prior would have been).
11883
11884 * dfg/DFGAbstractState.cpp:
11885 (JSC::DFG::AbstractState::beginBasicBlock):
11886 (JSC::DFG::AbstractState::endBasicBlock):
11887 (JSC::DFG::AbstractState::reset):
11888 (JSC::DFG::AbstractState::execute):
11889 (JSC::DFG::AbstractState::mergeToSuccessors):
11890 * dfg/DFGAbstractState.h:
11891 (JSC::DFG::AbstractState::branchDirectionToString):
11892 (AbstractState):
11893 * dfg/DFGCFGSimplificationPhase.cpp:
11894 (JSC::DFG::CFGSimplificationPhase::run):
11895 (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
11896 (JSC::DFG::CFGSimplificationPhase::OperandSubstitution::OperandSubstitution):
11897 (OperandSubstitution):
11898 (JSC::DFG::CFGSimplificationPhase::skipGetLocal):
11899 (JSC::DFG::CFGSimplificationPhase::recordPossibleIncomingReference):
11900 (CFGSimplificationPhase):
11901 (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
11902 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
11903 * dfg/DFGGraph.h:
11904 (JSC::DFG::Graph::changeEdge):
11905
ojan@chromium.org959e4a22012-05-24 02:03:04 +0000119062012-05-23 Ojan Vafai <ojan@chromium.org>
11907
11908 add back the ability to disable flexbox
11909 https://bugs.webkit.org/show_bug.cgi?id=87147
11910
11911 Reviewed by Tony Chang.
11912
11913 * Configurations/FeatureDefines.xcconfig:
11914
fpizlo@apple.com9b928722012-05-24 00:18:55 +0000119152012-05-23 Filip Pizlo <fpizlo@apple.com>
11916
fpizlo@apple.com16faaea2012-05-24 01:04:55 +000011917 Unreviewed, fix Windows build.
11918
11919 * bytecode/CodeBlock.h:
11920 * dfg/DFGCapabilities.h:
11921 (JSC::DFG::canCompileOpcode):
11922 (JSC::DFG::canCompileOpcodes):
11923 * dfg/DFGCommon.h:
11924 (DFG):
11925
119262012-05-23 Filip Pizlo <fpizlo@apple.com>
11927
fpizlo@apple.com9b928722012-05-24 00:18:55 +000011928 DFG should optimize inlined uses of arguments.length and arguments[i]
11929 https://bugs.webkit.org/show_bug.cgi?id=86327
11930
11931 Reviewed by Gavin Barraclough.
11932
11933 Merged r117017 from dfgopt.
11934
11935 Turns inlined uses of arguments.length into a constant.
11936
11937 Turns inlined uses of arguments[constant] into a direct reference to the
11938 argument.
11939
11940 Big win on micro-benchmarks. Not yet a win on V8 because the hot uses of
11941 arguments.length and arguments[i] are aliased. I'll leave the aliasing
11942 optimizations to a later patch.
11943
11944 * CMakeLists.txt:
11945 * GNUmakefile.list.am:
11946 * JavaScriptCore.xcodeproj/project.pbxproj:
11947 * Target.pri:
11948 * bytecode/DFGExitProfile.h:
11949 (FrequentExitSite):
11950 (JSC::DFG::FrequentExitSite::FrequentExitSite):
11951 (JSC::DFG::QueryableExitProfile::hasExitSite):
11952 (QueryableExitProfile):
11953 * dfg/DFGAbstractState.cpp:
11954 (JSC::DFG::AbstractState::execute):
11955 * dfg/DFGArgumentsSimplificationPhase.cpp: Added.
11956 (DFG):
11957 (ArgumentsSimplificationPhase):
11958 (JSC::DFG::ArgumentsSimplificationPhase::ArgumentsSimplificationPhase):
11959 (JSC::DFG::ArgumentsSimplificationPhase::run):
11960 (JSC::DFG::performArgumentsSimplification):
11961 * dfg/DFGArgumentsSimplificationPhase.h: Added.
11962 (DFG):
11963 * dfg/DFGAssemblyHelpers.cpp:
11964 (JSC::DFG::AssemblyHelpers::executableFor):
11965 (DFG):
11966 * dfg/DFGAssemblyHelpers.h:
11967 (AssemblyHelpers):
11968 * dfg/DFGByteCodeParser.cpp:
11969 (JSC::DFG::ByteCodeParser::parseBlock):
11970 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
11971 * dfg/DFGCSEPhase.cpp:
11972 (JSC::DFG::CSEPhase::getLocalLoadElimination):
11973 (JSC::DFG::CSEPhase::performNodeCSE):
11974 * dfg/DFGDriver.cpp:
11975 (JSC::DFG::compile):
11976 * dfg/DFGGraph.h:
11977 (JSC::DFG::Graph::Graph):
11978 (JSC::DFG::Graph::executableFor):
11979 (Graph):
11980 (JSC::DFG::Graph::clobbersWorld):
11981 * dfg/DFGNode.h:
11982 (JSC::DFG::Node::convertToConstant):
11983 (JSC::DFG::Node::convertToGetLocalUnlinked):
11984 (Node):
11985 (JSC::DFG::Node::unlinkedLocal):
11986 * dfg/DFGNodeType.h:
11987 (DFG):
11988 * dfg/DFGOSRExit.cpp:
11989 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
11990 * dfg/DFGPredictionPropagationPhase.cpp:
11991 (JSC::DFG::PredictionPropagationPhase::propagate):
11992 * dfg/DFGSpeculativeJIT32_64.cpp:
11993 (JSC::DFG::SpeculativeJIT::compile):
11994 * dfg/DFGSpeculativeJIT64.cpp:
11995 (JSC::DFG::SpeculativeJIT::compile):
11996
fpizlo@apple.com5e3852d2012-05-24 00:05:21 +0000119972012-05-13 Filip Pizlo <fpizlo@apple.com>
11998
11999 DFG should be able to optimize foo.apply(bar, arguments)
12000 https://bugs.webkit.org/show_bug.cgi?id=86306
12001
12002 Reviewed by Gavin Barraclough.
12003
12004 Merge r116912 from dfgopt.
12005
12006 Enables compilation of op_jneq_ptr and some forms of op_call_varargs.
12007
12008 Also includes a bunch of bug fixes that were made necessary by the increased
12009 pressure on the CFG simplifier.
12010
12011 This is a 1-2% win on V8.
12012
12013 * bytecode/CodeBlock.cpp:
12014 (JSC::CodeBlock::printCallOp):
12015 (JSC::CodeBlock::CodeBlock):
12016 (JSC::ProgramCodeBlock::canCompileWithDFGInternal):
12017 (JSC::EvalCodeBlock::canCompileWithDFGInternal):
12018 (JSC::FunctionCodeBlock::canCompileWithDFGInternal):
12019 * bytecode/CodeBlock.h:
12020 (CodeBlock):
12021 (JSC::CodeBlock::canCompileWithDFG):
12022 (JSC::CodeBlock::canCompileWithDFGState):
12023 (ProgramCodeBlock):
12024 (EvalCodeBlock):
12025 (FunctionCodeBlock):
12026 * dfg/DFGAbstractState.cpp:
12027 (JSC::DFG::AbstractState::execute):
12028 * dfg/DFGByteCodeParser.cpp:
12029 (JSC::DFG::ByteCodeParser::parseBlock):
12030 (JSC::DFG::ByteCodeParser::processPhiStack):
12031 (JSC::DFG::ByteCodeParser::parse):
12032 * dfg/DFGCFGSimplificationPhase.cpp:
12033 (JSC::DFG::CFGSimplificationPhase::run):
12034 (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
12035 (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
12036 (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
12037 * dfg/DFGCSEPhase.cpp:
12038 (JSC::DFG::CSEPhase::getLocalLoadElimination):
12039 (CSEPhase):
12040 (JSC::DFG::CSEPhase::setReplacement):
12041 (JSC::DFG::CSEPhase::performNodeCSE):
12042 * dfg/DFGCapabilities.cpp:
12043 (JSC::DFG::debugFail):
12044 (DFG):
12045 (JSC::DFG::canHandleOpcodes):
12046 (JSC::DFG::canCompileOpcodes):
12047 (JSC::DFG::canInlineOpcodes):
12048 * dfg/DFGCapabilities.h:
12049 (JSC::DFG::canCompileOpcode):
12050 (JSC::DFG::canInlineOpcode):
12051 (DFG):
12052 (JSC::DFG::canCompileOpcodes):
12053 (JSC::DFG::canCompileEval):
12054 (JSC::DFG::canCompileProgram):
12055 (JSC::DFG::canCompileFunctionForCall):
12056 (JSC::DFG::canCompileFunctionForConstruct):
12057 * dfg/DFGCommon.h:
12058 * dfg/DFGGraph.cpp:
12059 (JSC::DFG::Graph::dump):
12060 * dfg/DFGNodeType.h:
12061 (DFG):
12062 * dfg/DFGPredictionPropagationPhase.cpp:
12063 (JSC::DFG::PredictionPropagationPhase::propagate):
12064 * dfg/DFGSpeculativeJIT32_64.cpp:
12065 (JSC::DFG::SpeculativeJIT::compile):
12066 * dfg/DFGSpeculativeJIT64.cpp:
12067 (JSC::DFG::SpeculativeJIT::emitCall):
12068 (JSC::DFG::SpeculativeJIT::compile):
12069 * dfg/DFGValidate.cpp:
12070 (Validate):
12071 (JSC::DFG::Validate::validate):
12072 (JSC::DFG::Validate::checkOperand):
12073 (JSC::DFG::Validate::reportValidationContext):
12074 * jit/JIT.cpp:
12075 (JSC::JIT::emitOptimizationCheck):
12076 (JSC::JIT::privateCompileSlowCases):
12077 (JSC::JIT::privateCompile):
12078 * jit/JIT.h:
12079 * jit/JITArithmetic.cpp:
12080 (JSC::JIT::compileBinaryArithOp):
12081 * jit/JITPropertyAccess.cpp:
12082 (JSC::JIT::privateCompilePutByIdTransition):
12083 * jit/JITPropertyAccess32_64.cpp:
12084 (JSC::JIT::privateCompilePutByIdTransition):
12085 * tools/CodeProfile.cpp:
12086 (JSC::CodeProfile::sample):
12087
ggaren@apple.com7070d422012-05-23 23:55:27 +0000120882012-05-23 Geoffrey Garen <ggaren@apple.com>
12089
12090 Refactored WeakBlock to use malloc, clarify behavior
12091 https://bugs.webkit.org/show_bug.cgi?id=87318
12092
12093 Reviewed by Filip Pizlo.
12094
12095 We want to use malloc so we can make these smaller than 4KB,
12096 since an individual MarkedBlock will usually have fewer than
12097 4KB worth of weak pointers.
12098
12099 * heap/Heap.cpp:
12100 (JSC::Heap::markRoots): Renamed visitLiveWeakImpls to visit, since
12101 we no longer need to distinguish from "visitDeadWeakImpls".
12102
12103 Renamed "visitDeadWeakImpls" to "reap" because we're not actually
12104 doing any visiting -- we're just tagging things as dead.
12105
12106 * heap/WeakBlock.cpp:
12107 (JSC::WeakBlock::create):
12108 (JSC::WeakBlock::destroy):
12109 (JSC::WeakBlock::WeakBlock): Malloc!
12110
12111 (JSC::WeakBlock::visit):
12112 (JSC::WeakBlock::reap): Renamed as above.
12113
12114 * heap/WeakBlock.h:
12115 (WeakBlock): Reduced to 3KB, as explained above.
12116
12117 * heap/WeakSet.cpp:
12118 (JSC::WeakSet::visit):
12119 (JSC::WeakSet::reap):
12120 * heap/WeakSet.h:
12121 (WeakSet): Updated for renames, and to match WebKit style.
12122
fpizlo@apple.com11e2f372012-05-23 22:25:21 +0000121232012-05-23 Filip Pizlo <fpizlo@apple.com>
12124
fpizlo@apple.combc96e8f2012-05-23 23:12:59 +000012125 Use after free in JSC::DFG::ByteCodeParser::processPhiStack
12126 https://bugs.webkit.org/show_bug.cgi?id=87312
12127 <rdar://problem/11518848>
12128
12129 Reviewed by Oliver Hunt.
12130
12131 * dfg/DFGByteCodeParser.cpp:
12132 (JSC::DFG::ByteCodeParser::processPhiStack):
12133 (JSC::DFG::ByteCodeParser::parse):
12134
121352012-05-23 Filip Pizlo <fpizlo@apple.com>
12136
fpizlo@apple.com11e2f372012-05-23 22:25:21 +000012137 It should be possible to make C function calls from DFG code on ARM in debug mode
12138 https://bugs.webkit.org/show_bug.cgi?id=87313
12139
12140 Reviewed by Gavin Barraclough.
12141
12142 * dfg/DFGSpeculativeJIT.h:
12143 (SpeculativeJIT):
12144
fpizlo@apple.comc6446112012-05-23 20:52:42 +0000121452012-05-11 Filip Pizlo <fpizlo@apple.com>
12146
12147 DFG should be able to inline functions that use arguments reflectively
12148 https://bugs.webkit.org/show_bug.cgi?id=86132
12149
12150 Reviewed by Oliver Hunt.
12151
12152 Merged r116838 from dfgopt.
12153
12154 This turns on inlining of functions that use arguments reflectively, but it
12155 does not do any of the obvious optimizations that this exposes. I'll save that
12156 for another patch - the important thing for now is that this contains all of
12157 the plumbing necessary to make this kind of inlining sound even in bizarro
12158 cases like an inline callee escaping the arguments object to parts of the
12159 inline caller where the arguments are otherwise dead. Or even more fun cases
12160 like where you've inlined to an inline stack that is three-deep, and the
12161 function on top of the inline stack reflectively accesses the arguments of a
12162 function that is in the middle of the inline stack. Any subsequent
12163 optimizations that we do for the obvious cases of arguments usage in inline
12164 functions will have to take care not to break the baseline functionality that
12165 this patch plumbs together.
12166
12167 * bytecode/CodeBlock.cpp:
12168 (JSC::CodeBlock::printCallOp):
12169 (JSC::CodeBlock::dump):
12170 * bytecode/CodeBlock.h:
12171 * dfg/DFGAssemblyHelpers.h:
12172 (JSC::DFG::AssemblyHelpers::argumentsRegisterFor):
12173 (AssemblyHelpers):
12174 * dfg/DFGByteCodeParser.cpp:
12175 (InlineStackEntry):
12176 (JSC::DFG::ByteCodeParser::handleCall):
12177 (JSC::DFG::ByteCodeParser::handleInlining):
12178 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
12179 (JSC::DFG::ByteCodeParser::parse):
12180 * dfg/DFGCCallHelpers.h:
12181 (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
12182 (CCallHelpers):
12183 * dfg/DFGCapabilities.h:
12184 (JSC::DFG::canInlineOpcode):
12185 * dfg/DFGDriver.cpp:
12186 (JSC::DFG::compile):
12187 * dfg/DFGFixupPhase.cpp:
12188 (JSC::DFG::FixupPhase::fixupNode):
12189 * dfg/DFGOperations.cpp:
12190 * dfg/DFGOperations.h:
12191 * dfg/DFGSpeculativeJIT.h:
12192 (JSC::DFG::SpeculativeJIT::callOperation):
12193 * dfg/DFGSpeculativeJIT32_64.cpp:
12194 (JSC::DFG::SpeculativeJIT::compile):
12195 * dfg/DFGSpeculativeJIT64.cpp:
12196 (JSC::DFG::SpeculativeJIT::compile):
12197 * interpreter/CallFrame.cpp:
12198 (JSC):
12199 (JSC::CallFrame::someCodeBlockForPossiblyInlinedCode):
12200 * interpreter/CallFrame.h:
12201 (ExecState):
12202 (JSC::ExecState::someCodeBlockForPossiblyInlinedCode):
12203 * interpreter/Interpreter.cpp:
12204 (JSC::Interpreter::retrieveArgumentsFromVMCode):
12205 * runtime/Arguments.cpp:
12206 (JSC::Arguments::tearOff):
12207 (JSC):
12208 (JSC::Arguments::tearOffForInlineCallFrame):
12209 * runtime/Arguments.h:
12210 (Arguments):
12211 (JSC::Arguments::create):
12212 (JSC::Arguments::finishCreation):
12213 (JSC):
12214
fpizlo@apple.comfe244b02012-05-23 20:51:21 +0000122152012-05-23 Filip Pizlo <fpizlo@apple.com>
12216
12217 Every OSR exit on ARM results in a crash
12218 https://bugs.webkit.org/show_bug.cgi?id=87307
12219
12220 Reviewed by Geoffrey Garen.
12221
12222 * dfg/DFGThunks.cpp:
12223 (JSC::DFG::osrExitGenerationThunkGenerator):
12224
ggaren@apple.com96fa0e72012-05-23 20:47:46 +0000122252012-05-23 Geoffrey Garen <ggaren@apple.com>
12226
12227 Refactored heap tear-down to use normal value semantics (i.e., destructors)
12228 https://bugs.webkit.org/show_bug.cgi?id=87302
12229
12230 Reviewed by Oliver Hunt.
12231
12232 This is a step toward incremental DOM finalization.
12233
12234 * heap/CopiedSpace.cpp:
12235 (JSC::CopiedSpace::~CopiedSpace):
12236 * heap/CopiedSpace.h:
12237 (CopiedSpace): Just use our destructor, instead of relying on the heap
12238 to send us a special message at a special time.
12239
12240 * heap/Heap.cpp:
12241 (JSC::Heap::Heap): Use OwnPtr for m_markListSet because this is not Sparta.
12242
12243 (JSC::Heap::~Heap): No need for delete or freeAllBlocks because normal
12244 destructors do this work automatically now.
12245
12246 (JSC::Heap::lastChanceToFinalize): Just call lastChanceToFinalize on our
12247 sub-objects, and assume it does the right thing. This improves encapsulation,
12248 so we can add items requiring finalization to our sub-objects.
12249
12250 * heap/Heap.h: Moved m_blockAllocator to get the right destruction order.
12251
12252 * heap/MarkedSpace.cpp:
12253 (Take):
12254 (JSC):
12255 (JSC::Take::Take):
12256 (JSC::Take::operator()):
12257 (JSC::Take::returnValue): Moved to the top of the file so it can be used
12258 in another function.
12259
12260 (JSC::MarkedSpace::~MarkedSpace): Delete all outstanding memory, like a good
12261 destructor should.
12262
12263 (JSC::MarkedSpace::lastChanceToFinalize): Moved some code here from the heap,
12264 since it pertains to our internal implementation details.
12265
12266 * heap/MarkedSpace.h:
12267 (MarkedSpace):
12268 * heap/WeakBlock.cpp:
12269 (JSC::WeakBlock::lastChanceToFinalize):
12270 * heap/WeakBlock.h:
12271 (WeakBlock):
12272 * heap/WeakSet.cpp:
12273 (JSC::WeakSet::lastChanceToFinalize):
12274 * heap/WeakSet.h:
12275 (WeakSet): Stop using a special freeAllBlocks() callback and just implement
12276 lastChanceToFinalize.
12277
ggaren@apple.comd6376d22012-05-23 18:29:55 +0000122782011-05-22 Geoffrey Garen <ggaren@apple.com>
12279
12280 Encapsulated some calculations for whether portions of the heap are empty
12281 https://bugs.webkit.org/show_bug.cgi?id=87210
12282
12283 Reviewed by Gavin Barraclough.
12284
12285 This is a step toward incremental DOM finalization.
12286
12287 * heap/Heap.cpp:
12288 (JSC::Heap::~Heap): Explicitly call freeAllBlocks() instead of relying
12289 implicitly on all blocks thinking they're empty. In future, we may
12290 choose to tear down the heap without first setting all data structures
12291 to "empty".
12292
12293 * heap/MarkedBlock.h:
12294 (JSC::MarkedBlock::isEmpty):
12295 (JSC::MarkedBlock::gatherDirtyCells): Renamed markCountIsZero to isEmpty,
12296 in preparation for making it check for outstanding finalizers in addition
12297 to marked cells.
12298
12299 * heap/MarkedSpace.cpp:
12300 (Take):
12301 (JSC::Take::Take):
12302 (JSC::Take::operator()):
12303 (JSC::Take::returnValue):
12304 (JSC::MarkedSpace::shrink):
12305 (JSC::MarkedSpace::freeAllBlocks): Refactored the "Take" functor to support
12306 a conditional isEmpty check, so it dould be shared by shrink() and freeAllBlocks().
12307
12308 * heap/WeakBlock.cpp:
12309 (JSC::WeakBlock::WeakBlock):
12310 (JSC::WeakBlock::visitLiveWeakImpls):
12311 (JSC::WeakBlock::visitDeadWeakImpls):
12312 * heap/WeakBlock.h:
12313 (WeakBlock):
12314 (JSC::WeakBlock::isEmpty):
12315 * heap/WeakSet.cpp:
12316 (JSC::WeakSet::sweep):
12317 (JSC::WeakSet::shrink): Use isEmpty(), in preparation for changes in
12318 its implementation.
12319
vestbo@webkit.orgb1f6e922012-05-23 10:50:53 +0000123202012-05-23 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12321
12322 [Qt] Remove references to $$QT_SOURCE_TREE
12323
12324 With a modularized Qt, it's ambigious. What we really want is qtbase,
12325 which qtcore is a proxy for (we assume it will always live in qtbase).
12326
12327 Reviewed by Tor Arne Vestbø.
12328
12329 * JavaScriptCore.pri:
12330 * Target.pri:
12331
fpizlo@apple.comb6b454cd2012-05-23 07:53:44 +0000123322012-05-09 Filip Pizlo <fpizlo@apple.com>
12333
12334 DFG should allow inlining in case of certain arity mismatches
12335 https://bugs.webkit.org/show_bug.cgi?id=86059
12336
12337 Reviewed by Geoff Garen.
fpizlo@apple.comb92907c2012-05-23 07:55:12 +000012338
12339 Merge r116620 from dfgopt.
fpizlo@apple.comb6b454cd2012-05-23 07:53:44 +000012340
12341 * dfg/DFGByteCodeParser.cpp:
12342 (JSC::DFG::ByteCodeParser::handleInlining):
12343
fpizlo@apple.com6d4456e2012-05-23 03:48:52 +0000123442012-05-08 Filip Pizlo <fpizlo@apple.com>
12345
fpizlo@apple.com1688cc12012-05-23 07:29:02 +000012346 DFG variable capture analysis should work even if the variables arose through inlining
12347 https://bugs.webkit.org/show_bug.cgi?id=85945
12348
12349 Reviewed by Oliver Hunt.
12350
12351 Merged r116555 from dfgopt.
12352
12353 This just changes how the DFG queries whether a variable is captured. It does not
12354 change any user-visible behavior.
12355
12356 As part of this change, I further solidified the policy that the CFA behaves in an
12357 undefined way for captured locals and queries about their values will not yield
12358 reliable results. This will likely be changed in the future, but for now it makes
12359 sense.
12360
12361 One fun part about this change is that it recognizes that the same variable may
12362 be both captured and not, at the same time, because their live interval spans
12363 inlining boundaries. This only happens in the case of arguments to functions that
12364 capture their arguments, and this change treats them with just the right touch of
12365 conservatism: they will be treated as if captured by the caller as well as the
12366 callee.
12367
12368 Finally, this also adds captured variable reasoning to the InlineCallFrame, which
12369 I thought might be useful for later tooling.
12370
12371 This is perf-neutral, since it does it does not make the DFG take advantage of this
12372 new functionality in any way. In particular, it is still the case that the DFG will
12373 not inline functions that use arguments reflectively or that create activations.
12374
12375 * bytecode/CodeBlock.h:
12376 (CodeBlock):
12377 (JSC::CodeBlock::needsActivation):
12378 (JSC::CodeBlock::argumentIsCaptured):
12379 (JSC::CodeBlock::localIsCaptured):
12380 (JSC::CodeBlock::isCaptured):
12381 * bytecode/CodeOrigin.h:
12382 (InlineCallFrame):
12383 * dfg/DFGAbstractState.cpp:
12384 (JSC::DFG::AbstractState::initialize):
12385 (JSC::DFG::AbstractState::endBasicBlock):
12386 (JSC::DFG::AbstractState::execute):
12387 (JSC::DFG::AbstractState::merge):
12388 * dfg/DFGByteCodeParser.cpp:
12389 (JSC::DFG::ByteCodeParser::newVariableAccessData):
12390 (JSC::DFG::ByteCodeParser::getLocal):
12391 (JSC::DFG::ByteCodeParser::setLocal):
12392 (JSC::DFG::ByteCodeParser::getArgument):
12393 (JSC::DFG::ByteCodeParser::setArgument):
12394 (JSC::DFG::ByteCodeParser::flushArgument):
12395 (JSC::DFG::ByteCodeParser::parseBlock):
12396 (JSC::DFG::ByteCodeParser::processPhiStack):
12397 (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
12398 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
12399 * dfg/DFGCFGSimplificationPhase.cpp:
12400 (CFGSimplificationPhase):
12401 (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
12402 (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
12403 (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
12404 * dfg/DFGCommon.h:
12405 * dfg/DFGFixupPhase.cpp:
12406 (JSC::DFG::FixupPhase::fixupNode):
12407 * dfg/DFGGraph.cpp:
12408 (JSC::DFG::Graph::nameOfVariableAccessData):
12409 * dfg/DFGGraph.h:
12410 (JSC::DFG::Graph::needsActivation):
12411 (JSC::DFG::Graph::usesArguments):
12412 * dfg/DFGPredictionPropagationPhase.cpp:
12413 (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
12414 * dfg/DFGSpeculativeJIT.cpp:
12415 (JSC::DFG::SpeculativeJIT::compile):
12416 * dfg/DFGSpeculativeJIT32_64.cpp:
12417 (JSC::DFG::SpeculativeJIT::compile):
12418 * dfg/DFGSpeculativeJIT64.cpp:
12419 (JSC::DFG::SpeculativeJIT::compile):
12420 * dfg/DFGVariableAccessData.h:
12421 (JSC::DFG::VariableAccessData::VariableAccessData):
12422 (JSC::DFG::VariableAccessData::mergeIsCaptured):
12423 (VariableAccessData):
12424 (JSC::DFG::VariableAccessData::isCaptured):
12425
124262012-05-08 Filip Pizlo <fpizlo@apple.com>
12427
fpizlo@apple.com6d4456e2012-05-23 03:48:52 +000012428 DFG should support op_get_argument_by_val and op_get_arguments_length
12429 https://bugs.webkit.org/show_bug.cgi?id=85911
12430
12431 Reviewed by Oliver Hunt.
12432
12433 Merged r116467 from dfgopt.
12434
12435 This adds a simple and relatively conservative implementation of op_get_argument_by_val
12436 and op_get_arguments_length. We can optimize these later. For now it's great to have
12437 the additional coverage.
12438
12439 This patch appears to be perf-neutral.
12440
12441 * dfg/DFGAbstractState.cpp:
12442 (JSC::DFG::AbstractState::execute):
12443 * dfg/DFGAssemblyHelpers.h:
12444 (JSC::DFG::AssemblyHelpers::addressFor):
12445 (JSC::DFG::AssemblyHelpers::tagFor):
12446 (JSC::DFG::AssemblyHelpers::payloadFor):
12447 * dfg/DFGByteCodeParser.cpp:
12448 (JSC::DFG::ByteCodeParser::parseBlock):
12449 * dfg/DFGCapabilities.h:
12450 (JSC::DFG::canCompileOpcode):
12451 (JSC::DFG::canInlineOpcode):
12452 * dfg/DFGNode.h:
12453 (JSC::DFG::Node::hasHeapPrediction):
12454 * dfg/DFGNodeType.h:
12455 (DFG):
12456 * dfg/DFGOperations.cpp:
12457 * dfg/DFGOperations.h:
12458 * dfg/DFGPredictionPropagationPhase.cpp:
12459 (JSC::DFG::PredictionPropagationPhase::propagate):
12460 * dfg/DFGSpeculativeJIT.h:
12461 (JSC::DFG::SpeculativeJIT::callOperation):
12462 (SpeculativeJIT):
12463 * dfg/DFGSpeculativeJIT32_64.cpp:
12464 (JSC::DFG::SpeculativeJIT::compile):
12465 * dfg/DFGSpeculativeJIT64.cpp:
12466 (JSC::DFG::SpeculativeJIT::compile):
12467 * jit/JITOpcodes.cpp:
12468 (JSC::JIT::emit_op_get_argument_by_val):
12469 * jit/JITOpcodes32_64.cpp:
12470 (JSC::JIT::emit_op_get_argument_by_val):
12471 * llint/LowLevelInterpreter32_64.asm:
12472 * llint/LowLevelInterpreter64.asm:
12473
fpizlo@apple.com15c03c72012-05-23 02:34:13 +0000124742012-05-07 Filip Pizlo <fpizlo@apple.com>
12475
12476 DFG should support op_tear_off_arguments
12477 https://bugs.webkit.org/show_bug.cgi?id=85847
12478
12479 Reviewed by Michael Saboff.
12480
12481 Merged r116378 from dfgopt.
12482
12483 * dfg/DFGAbstractState.cpp:
12484 (JSC::DFG::AbstractState::execute):
12485 * dfg/DFGByteCodeParser.cpp:
12486 (JSC::DFG::ByteCodeParser::parseBlock):
12487 * dfg/DFGCapabilities.h:
12488 (JSC::DFG::canCompileOpcode):
12489 (JSC::DFG::canInlineOpcode):
12490 * dfg/DFGNodeType.h:
12491 (DFG):
12492 * dfg/DFGOperations.cpp:
12493 * dfg/DFGOperations.h:
12494 * dfg/DFGPredictionPropagationPhase.cpp:
12495 (JSC::DFG::PredictionPropagationPhase::propagate):
12496 * dfg/DFGSpeculativeJIT.h:
12497 (SpeculativeJIT):
12498 (JSC::DFG::SpeculativeJIT::callOperation):
12499 * dfg/DFGSpeculativeJIT32_64.cpp:
12500 (JSC::DFG::SpeculativeJIT::compile):
12501 * dfg/DFGSpeculativeJIT64.cpp:
12502 (JSC::DFG::SpeculativeJIT::compile):
12503
mhahnenberg@apple.com3041bc12012-05-23 01:28:03 +0000125042012-05-22 Mark Hahnenberg <mhahnenberg@apple.com>
12505
12506 CopiedSpace::contains doesn't check for oversize blocks
12507 https://bugs.webkit.org/show_bug.cgi?id=87180
12508
12509 Reviewed by Geoffrey Garen.
12510
12511 When doing a conservative scan we use CopiedSpace::contains to determine if a particular
12512 address points into the CopiedSpace. Currently contains() only checks if the address
12513 points to a block in to-space, which means that pointers to oversize blocks may not get scanned.
12514
12515 * heap/CopiedSpace.cpp:
12516 (JSC::CopiedSpace::tryAllocateOversize):
12517 (JSC::CopiedSpace::tryReallocateOversize):
12518 (JSC::CopiedSpace::doneFillingBlock):
12519 (JSC::CopiedSpace::doneCopying):
12520 * heap/CopiedSpace.h: Refactored CopiedSpace so that all blocks (oversize and to-space) are
12521 in a single hash set and bloom filter for membership testing.
12522 (CopiedSpace):
12523 * heap/CopiedSpaceInlineMethods.h:
12524 (JSC::CopiedSpace::contains): We check for the normal block first. Since the oversize blocks are
12525 only page aligned, rather than block aligned, we have to re-mask the ptr to check if it's in
12526 CopiedSpace. Also added a helper function of the same name that takes a CopiedBlock* and checks
12527 if it's in CopiedSpace so that check isn't typed out twice.
12528 (JSC):
12529 (JSC::CopiedSpace::startedCopying):
12530 (JSC::CopiedSpace::addNewBlock):
12531
ggaren@apple.coma68a6502012-05-22 23:59:51 +0000125322012-05-22 Geoffrey Garen <ggaren@apple.com>
12533
12534 CopiedBlock and MarkedBlock should have proper value semantics (i.e., destructors)
12535 https://bugs.webkit.org/show_bug.cgi?id=87172
12536
12537 Reviewed by Oliver Hunt and Phil Pizlo.
12538
12539 This enables MarkedBlock to own non-trivial sub-objects that require
12540 destruction. It also fixes a FIXME about casting a CopiedBlock to a
12541 MarkedBlock at destroy time.
12542
12543 CopiedBlock and MarkedBlock now accept an allocation chunk at create
12544 time and return it at destroy time. Their client is expected to
12545 allocate, recycle, and destroy these chunks.
12546
12547 * heap/BlockAllocator.cpp:
12548 (JSC::BlockAllocator::releaseFreeBlocks):
12549 (JSC::BlockAllocator::blockFreeingThreadMain): Don't call MarkedBlock::destroy
12550 because we expect that to be called before a block is put on our free
12551 list now. Do manually deallocate our allocation chunk because that's
12552 our job now.
12553
12554 * heap/BlockAllocator.h:
12555 (BlockAllocator):
12556 (JSC::BlockAllocator::allocate): Allocate never fails now. This is a
12557 cleaner abstraction because only one object does all the VM allocation
12558 and deallocation. Caching is an implementation detail.
12559
12560 (JSC::BlockAllocator::deallocate): We take an allocation chunk argument
12561 instead of a block because we now expect the block to have been destroyed
12562 before we recycle its memory. For convenience, we still use the HeapBlock
12563 class as our linked list node. This is OK because HeapBlock is a POD type.
12564
12565 * heap/CopiedBlock.h:
12566 (CopiedBlock):
12567 (JSC::CopiedBlock::create):
12568 (JSC::CopiedBlock::destroy):
12569 (JSC::CopiedBlock::CopiedBlock): Added proper create and destroy functions,
12570 to match MarkedBlock.
12571
12572 * heap/CopiedSpace.cpp:
12573 (JSC::CopiedSpace::tryAllocateOversize):
12574 (JSC::CopiedSpace::tryReallocateOversize):
12575 (JSC::CopiedSpace::doneCopying):
12576 (JSC::CopiedSpace::getFreshBlock):
12577 (JSC::CopiedSpace::freeAllBlocks):
12578 * heap/CopiedSpaceInlineMethods.h:
12579 (JSC::CopiedSpace::recycleBlock): Make sure to call destroy before
12580 returning a block to the BlockAllocator. Otherwise, our destructors
12581 won't run. (If we get this wrong now, we'll get a compile error.)
12582
12583 * heap/HeapBlock.h:
12584 (JSC::HeapBlock::HeapBlock): const!
12585
12586 * heap/MarkedAllocator.cpp:
12587 (JSC::MarkedAllocator::allocateBlock): No need to distinguish between
12588 create and recycle -- MarkedBlock always accepts memory allocated by
12589 its client now.
12590
12591 * heap/MarkedBlock.cpp:
12592 (JSC::MarkedBlock::create): Don't allocate memory -- we assume that we're
12593 passed already-allocated memory, to clarify the responsibility for VM
12594 recycling.
12595
12596 (JSC::MarkedBlock::destroy): Do run our destructor before giving back
12597 our VM -- that is the whole point of this patch.
12598
12599 (JSC::MarkedBlock::MarkedBlock):
12600 * heap/MarkedBlock.h:
12601 (MarkedBlock):
12602 * heap/MarkedSpace.cpp: const!
12603
12604 (JSC::MarkedSpace::freeBlocks): Make sure to call destroy before
12605 returning a block to the BlockAllocator. Otherwise, our destructors
12606 won't run. (If we get this wrong now, we'll get a compile error.)
12607
simon.fraser@apple.com9bd2c702012-05-22 20:37:14 +000012608== Rolled over to ChangeLog-2012-05-22 ==