1 2016-02-18 Filip Pizlo <fpizlo@apple.com>
3 Unreviewed, fix CMake build. This got messed up when rebasing.
7 2016-02-18 Csaba Osztrogonác <ossy@webkit.org>
9 Fix the !ENABLE(DFG_JIT) build after r195865
10 https://bugs.webkit.org/show_bug.cgi?id=154391
12 Reviewed by Filip Pizlo.
14 * runtime/SamplingProfiler.cpp:
15 (JSC::tryGetBytecodeIndex):
17 2016-02-17 Filip Pizlo <fpizlo@apple.com>
19 Remove remaining references to LLVM, and make sure comments refer to the backend as "B3" not "LLVM"
20 https://bugs.webkit.org/show_bug.cgi?id=154383
22 Reviewed by Saam Barati.
24 I did a grep -i llvm of all of our code and did one of the following for each occurence:
26 - Renamed it to B3. This is appropriate when we were using "LLVM" to mean "the FTL
29 - Removed the reference because I found it to be dead. In some cases it was a dead
30 comment: it was telling us things about what LLVM did and that's just not relevant
31 anymore. In other cases it was dead code that I forgot to delete in a previous patch.
33 - Edited the comment in some smart way. There were comments talking about what LLVM did
34 that were still of interest. In some cases, I added a FIXME to consider changing the
35 code below the comment on the grounds that it was written in a weird way to placate
36 LLVM and so we can do it better now.
39 * JavaScriptCore.xcodeproj/project.pbxproj:
40 * dfg/DFGArgumentsEliminationPhase.cpp:
41 * dfg/DFGOSRAvailabilityAnalysisPhase.h:
43 (JSC::DFG::Plan::compileInThread):
44 (JSC::DFG::Plan::compileInThreadImpl):
45 (JSC::DFG::Plan::compileTimeStats):
46 * dfg/DFGPutStackSinkingPhase.cpp:
47 * dfg/DFGSSAConversionPhase.h:
48 * dfg/DFGStaticExecutionCountEstimationPhase.h:
49 * dfg/DFGUnificationPhase.cpp:
50 (JSC::DFG::UnificationPhase::run):
51 * disassembler/ARM64Disassembler.cpp:
52 (JSC::tryToDisassemble): Deleted.
53 * disassembler/X86Disassembler.cpp:
54 (JSC::tryToDisassemble):
55 * ftl/FTLAbstractHeap.cpp:
56 (JSC::FTL::IndexedAbstractHeap::initialize):
57 * ftl/FTLAbstractHeap.h:
58 * ftl/FTLFormattedValue.h:
59 * ftl/FTLJITFinalizer.cpp:
60 (JSC::FTL::JITFinalizer::finalizeFunction):
63 * ftl/FTLLocation.cpp:
64 (JSC::FTL::Location::restoreInto):
65 * ftl/FTLLowerDFGToB3.cpp: Copied from Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp.
66 (JSC::FTL::DFG::ftlUnreachable):
67 (JSC::FTL::DFG::LowerDFGToB3::LowerDFGToB3):
68 (JSC::FTL::DFG::LowerDFGToB3::compileBlock):
69 (JSC::FTL::DFG::LowerDFGToB3::compileArithNegate):
70 (JSC::FTL::DFG::LowerDFGToB3::compileMultiGetByOffset):
71 (JSC::FTL::DFG::LowerDFGToB3::compileOverridesHasInstance):
72 (JSC::FTL::DFG::LowerDFGToB3::isBoolean):
73 (JSC::FTL::DFG::LowerDFGToB3::unboxBoolean):
74 (JSC::FTL::DFG::LowerDFGToB3::emitStoreBarrier):
75 (JSC::FTL::lowerDFGToB3):
76 (JSC::FTL::DFG::LowerDFGToLLVM::LowerDFGToLLVM): Deleted.
77 (JSC::FTL::DFG::LowerDFGToLLVM::compileBlock): Deleted.
78 (JSC::FTL::DFG::LowerDFGToLLVM::compileArithNegate): Deleted.
79 (JSC::FTL::DFG::LowerDFGToLLVM::compileMultiGetByOffset): Deleted.
80 (JSC::FTL::DFG::LowerDFGToLLVM::compileOverridesHasInstance): Deleted.
81 (JSC::FTL::DFG::LowerDFGToLLVM::isBoolean): Deleted.
82 (JSC::FTL::DFG::LowerDFGToLLVM::unboxBoolean): Deleted.
83 (JSC::FTL::DFG::LowerDFGToLLVM::emitStoreBarrier): Deleted.
84 (JSC::FTL::lowerDFGToLLVM): Deleted.
85 * ftl/FTLLowerDFGToB3.h: Copied from Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.h.
86 * ftl/FTLLowerDFGToLLVM.cpp: Removed.
87 * ftl/FTLLowerDFGToLLVM.h: Removed.
88 * ftl/FTLOSRExitCompiler.cpp:
89 (JSC::FTL::compileStub):
91 (JSC::FTL::Weight::frequencyClass):
92 (JSC::FTL::Weight::inverse):
93 (JSC::FTL::Weight::scaleToTotal): Deleted.
94 * ftl/FTLWeightedTarget.h:
97 * jit/CallFrameShuffler64.cpp:
98 (JSC::CallFrameShuffler::emitDisplace):
99 * jit/RegisterSet.cpp:
100 (JSC::RegisterSet::ftlCalleeSaveRegisters):
102 * llvm/InitializeLLVMLinux.cpp: Removed.
103 * llvm/InitializeLLVMWin.cpp: Removed.
104 * llvm/library: Removed.
105 * llvm/library/LLVMTrapCallback.h: Removed.
106 * llvm/library/libllvmForJSC.version: Removed.
107 * runtime/Options.cpp:
108 (JSC::recomputeDependentOptions):
109 (JSC::Options::initialize):
111 * wasm/WASMFunctionB3IRGenerator.h: Copied from Source/JavaScriptCore/wasm/WASMFunctionLLVMIRGenerator.h.
112 * wasm/WASMFunctionLLVMIRGenerator.h: Removed.
113 * wasm/WASMFunctionParser.cpp:
115 2016-02-18 Csaba Osztrogonác <ossy@webkit.org>
117 [cmake] Build system cleanup
118 https://bugs.webkit.org/show_bug.cgi?id=154337
120 Reviewed by Žan Doberšek.
124 2016-02-17 Mark Lam <mark.lam@apple.com>
126 Callers of JSString::value() should check for exceptions thereafter.
127 https://bugs.webkit.org/show_bug.cgi?id=154346
129 Reviewed by Geoffrey Garen.
131 JSString::value() can throw an exception if the JS string is a rope and value()
132 needs to resolve the rope but encounters an OutOfMemory error. If value() is not
133 able to resolve the rope, it will return a null string (in addition to throwing
134 the exception). If a caller does not check for exceptions after calling
135 JSString::value(), they may eventually use the returned null string and crash the
138 The fix is to add all the necessary exception checks, and do the appropriate
145 (functionCheckSyntax):
146 (functionLoadWebAssembly):
147 (functionLoadModule):
148 (functionCheckModuleSyntax):
149 * runtime/DateConstructor.cpp:
152 * runtime/JSGlobalObjectFunctions.cpp:
153 (JSC::globalFuncEval):
154 * tools/JSDollarVMPrototype.cpp:
155 (JSC::functionPrint):
157 2016-02-17 Benjamin Poulain <bpoulain@apple.com>
159 [JSC] ARM64: Support the immediate format used for bit operations in Air
160 https://bugs.webkit.org/show_bug.cgi?id=154327
162 Reviewed by Filip Pizlo.
164 ARM64 supports a pretty rich form of immediates for bit operation.
165 There are two formats used to encode repeating patterns and common
166 input in a dense form.
168 In this patch, I add 2 new type of Arg: BitImm32 and BitImm64.
169 Those represents the valid immediate forms for bit operation.
170 On x86, any 32bits value is valid. On ARM64, all the encoding
171 form are tried and the immediate is used when possible.
173 The arg type Imm64 is renamed to BigImm to better represent what
174 it is: an immediate that does not fit into Imm.
176 * assembler/ARM64Assembler.h:
177 (JSC::LogicalImmediate::create32): Deleted.
178 (JSC::LogicalImmediate::create64): Deleted.
179 (JSC::LogicalImmediate::value): Deleted.
180 (JSC::LogicalImmediate::isValid): Deleted.
181 (JSC::LogicalImmediate::is64bit): Deleted.
182 (JSC::LogicalImmediate::LogicalImmediate): Deleted.
183 (JSC::LogicalImmediate::mask): Deleted.
184 (JSC::LogicalImmediate::partialHSB): Deleted.
185 (JSC::LogicalImmediate::highestSetBit): Deleted.
186 (JSC::LogicalImmediate::findBitRange): Deleted.
187 (JSC::LogicalImmediate::encodeLogicalImmediate): Deleted.
188 * assembler/AssemblerCommon.h:
189 (JSC::ARM64LogicalImmediate::create32):
190 (JSC::ARM64LogicalImmediate::create64):
191 (JSC::ARM64LogicalImmediate::value):
192 (JSC::ARM64LogicalImmediate::isValid):
193 (JSC::ARM64LogicalImmediate::is64bit):
194 (JSC::ARM64LogicalImmediate::ARM64LogicalImmediate):
195 (JSC::ARM64LogicalImmediate::mask):
196 (JSC::ARM64LogicalImmediate::partialHSB):
197 (JSC::ARM64LogicalImmediate::highestSetBit):
198 (JSC::ARM64LogicalImmediate::findBitRange):
199 (JSC::ARM64LogicalImmediate::encodeLogicalImmediate):
200 * assembler/MacroAssemblerARM64.h:
201 (JSC::MacroAssemblerARM64::and64):
202 (JSC::MacroAssemblerARM64::or64):
203 (JSC::MacroAssemblerARM64::xor64):
204 * b3/B3LowerToAir.cpp:
205 (JSC::B3::Air::LowerToAir::bitImm):
206 (JSC::B3::Air::LowerToAir::bitImm64):
207 (JSC::B3::Air::LowerToAir::appendBinOp):
209 (JSC::B3::Air::Arg::dump):
210 (WTF::printInternal):
212 (JSC::B3::Air::Arg::bitImm):
213 (JSC::B3::Air::Arg::bitImm64):
214 (JSC::B3::Air::Arg::isBitImm):
215 (JSC::B3::Air::Arg::isBitImm64):
216 (JSC::B3::Air::Arg::isSomeImm):
217 (JSC::B3::Air::Arg::value):
218 (JSC::B3::Air::Arg::isGP):
219 (JSC::B3::Air::Arg::isFP):
220 (JSC::B3::Air::Arg::hasType):
221 (JSC::B3::Air::Arg::isValidBitImmForm):
222 (JSC::B3::Air::Arg::isValidBitImm64Form):
223 (JSC::B3::Air::Arg::isValidForm):
224 (JSC::B3::Air::Arg::asTrustedImm32):
225 (JSC::B3::Air::Arg::asTrustedImm64):
226 * b3/air/AirOpcode.opcodes:
227 * b3/air/opcode_generator.rb:
229 2016-02-17 Keith Miller <keith_miller@apple.com>
231 Spread operator should be allowed when not the first argument of parameter list
232 https://bugs.webkit.org/show_bug.cgi?id=152721
234 Reviewed by Saam Barati.
236 Spread arguments to functions should now be ES6 compliant. Before we
237 would only take a spread operator if it was the sole argument to a
238 function. Additionally, we would not use the Symbol.iterator on the
239 object to generate the arguments. Instead we would do a loop up to the
240 length mapping indexed properties to the corresponding argument. We fix
241 both these issues by doing an AST transformation from foo(...a, b, ...c, d)
242 to foo(...[...a, b, ...c, d]) (where the spread on the rhs uses the
243 old spread semantics). This solution has the downside of requiring the
244 allocation of another object and copying each element twice but avoids a
245 large change to the vm calling convention.
247 * interpreter/Interpreter.cpp:
249 * parser/ASTBuilder.h:
250 (JSC::ASTBuilder::createElementList):
252 (JSC::Parser<LexerType>::parseArguments):
253 (JSC::Parser<LexerType>::parseArgument):
254 (JSC::Parser<LexerType>::parseMemberExpression):
256 * parser/SyntaxChecker.h:
257 (JSC::SyntaxChecker::createElementList):
259 * tests/stress/spread-calling.js: Added.
263 (otherIterator.return.next):
266 (throwingIter.return.next):
270 2016-02-17 Brian Burg <bburg@apple.com>
272 Remove a wrong cast in RemoteInspector::receivedSetupMessage
273 https://bugs.webkit.org/show_bug.cgi?id=154361
274 <rdar://problem/24709281>
276 Reviewed by Joseph Pecoraro.
278 * inspector/remote/RemoteInspector.mm:
279 (Inspector::RemoteInspector::receivedSetupMessage):
280 Not only is this cast unnecessary (the constructor accepts the base class),
281 but it is wrong since the target could be an automation target. Remove it.
283 2016-02-17 Filip Pizlo <fpizlo@apple.com>
285 Rename FTLB3Blah to FTLBlah
286 https://bugs.webkit.org/show_bug.cgi?id=154365
288 Rubber stamped by Geoffrey Garen, Benjamin Poulain, Awesome Kling, and Saam Barati.
291 * JavaScriptCore.xcodeproj/project.pbxproj:
292 * ftl/FTLB3Compile.cpp: Removed.
293 * ftl/FTLB3Output.cpp: Removed.
294 * ftl/FTLB3Output.h: Removed.
295 * ftl/FTLCompile.cpp: Copied from Source/JavaScriptCore/ftl/FTLB3Compile.cpp.
296 * ftl/FTLOutput.cpp: Copied from Source/JavaScriptCore/ftl/FTLB3Output.cpp.
297 * ftl/FTLOutput.h: Copied from Source/JavaScriptCore/ftl/FTLB3Output.h.
299 2016-02-17 Filip Pizlo <fpizlo@apple.com>
301 Remove LLVM dependencies from WebKit
302 https://bugs.webkit.org/show_bug.cgi?id=154323
304 Reviewed by Antti Koivisto and Benjamin Poulain.
306 We have switched all ports that use the FTL JIT to using B3 as the backend. This renders all
307 LLVM-related code dead, including the disassembler, which was only reachable when you were on
308 a platform that already had an in-tree disassembler.
311 * JavaScriptCore.xcodeproj/project.pbxproj:
314 (JSC::DFG::Plan::compileInThread):
315 (JSC::DFG::Plan::compileInThreadImpl):
316 (JSC::DFG::Plan::compileTimeStats):
317 * disassembler/ARM64Disassembler.cpp:
318 (JSC::tryToDisassemble):
319 * disassembler/ARMv7Disassembler.cpp:
320 (JSC::tryToDisassemble):
321 * disassembler/Disassembler.cpp:
323 (JSC::disassembleAsynchronously):
324 * disassembler/Disassembler.h:
325 (JSC::tryToDisassemble):
326 * disassembler/LLVMDisassembler.cpp: Removed.
327 * disassembler/LLVMDisassembler.h: Removed.
328 * disassembler/UDis86Disassembler.cpp:
329 (JSC::tryToDisassembleWithUDis86):
330 * disassembler/UDis86Disassembler.h:
331 (JSC::tryToDisassembleWithUDis86):
332 * disassembler/X86Disassembler.cpp:
333 (JSC::tryToDisassemble):
334 * ftl/FTLAbbreviatedTypes.h:
335 * ftl/FTLAbbreviations.h: Removed.
336 * ftl/FTLAbstractHeap.cpp:
337 (JSC::FTL::AbstractHeap::decorateInstruction):
338 (JSC::FTL::AbstractHeap::dump):
339 (JSC::FTL::AbstractField::dump):
340 (JSC::FTL::IndexedAbstractHeap::IndexedAbstractHeap):
341 (JSC::FTL::IndexedAbstractHeap::~IndexedAbstractHeap):
342 (JSC::FTL::IndexedAbstractHeap::baseIndex):
343 (JSC::FTL::IndexedAbstractHeap::dump):
344 (JSC::FTL::NumberedAbstractHeap::NumberedAbstractHeap):
345 (JSC::FTL::NumberedAbstractHeap::dump):
346 (JSC::FTL::AbsoluteAbstractHeap::AbsoluteAbstractHeap):
347 (JSC::FTL::AbstractHeap::tbaaMetadataSlow): Deleted.
348 * ftl/FTLAbstractHeap.h:
349 (JSC::FTL::AbstractHeap::AbstractHeap):
350 (JSC::FTL::AbstractHeap::heapName):
351 (JSC::FTL::IndexedAbstractHeap::atAnyIndex):
352 (JSC::FTL::NumberedAbstractHeap::atAnyNumber):
353 (JSC::FTL::AbsoluteAbstractHeap::atAnyAddress):
354 (JSC::FTL::AbstractHeap::tbaaMetadata): Deleted.
355 * ftl/FTLAbstractHeapRepository.cpp:
356 (JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
357 * ftl/FTLAbstractHeapRepository.h:
358 * ftl/FTLB3Compile.cpp:
359 * ftl/FTLB3Output.cpp:
360 (JSC::FTL::Output::Output):
361 (JSC::FTL::Output::check):
362 (JSC::FTL::Output::load):
363 (JSC::FTL::Output::store):
365 * ftl/FTLCommonValues.cpp:
366 (JSC::FTL::CommonValues::CommonValues):
367 (JSC::FTL::CommonValues::initializeConstants):
368 * ftl/FTLCommonValues.h:
369 (JSC::FTL::CommonValues::initialize): Deleted.
370 * ftl/FTLCompile.cpp: Removed.
371 * ftl/FTLCompileBinaryOp.cpp: Removed.
372 * ftl/FTLCompileBinaryOp.h: Removed.
373 * ftl/FTLDWARFDebugLineInfo.cpp: Removed.
374 * ftl/FTLDWARFDebugLineInfo.h: Removed.
375 * ftl/FTLDWARFRegister.cpp: Removed.
376 * ftl/FTLDWARFRegister.h: Removed.
377 * ftl/FTLDataSection.cpp: Removed.
378 * ftl/FTLDataSection.h: Removed.
379 * ftl/FTLExceptionHandlerManager.cpp: Removed.
380 * ftl/FTLExceptionHandlerManager.h: Removed.
381 * ftl/FTLExceptionTarget.cpp:
382 * ftl/FTLExceptionTarget.h:
383 * ftl/FTLExitThunkGenerator.cpp: Removed.
384 * ftl/FTLExitThunkGenerator.h: Removed.
387 * ftl/FTLInlineCacheDescriptor.h: Removed.
388 * ftl/FTLInlineCacheSize.cpp: Removed.
389 * ftl/FTLInlineCacheSize.h: Removed.
390 * ftl/FTLIntrinsicRepository.cpp: Removed.
391 * ftl/FTLIntrinsicRepository.h: Removed.
392 * ftl/FTLJITCode.cpp:
393 (JSC::FTL::JITCode::~JITCode):
394 (JSC::FTL::JITCode::initializeB3Code):
395 (JSC::FTL::JITCode::initializeB3Byproducts):
396 (JSC::FTL::JITCode::initializeAddressForCall):
397 (JSC::FTL::JITCode::contains):
398 (JSC::FTL::JITCode::ftl):
399 (JSC::FTL::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
400 (JSC::FTL::JITCode::initializeExitThunks): Deleted.
401 (JSC::FTL::JITCode::addHandle): Deleted.
402 (JSC::FTL::JITCode::addDataSection): Deleted.
403 (JSC::FTL::JITCode::exitThunks): Deleted.
405 (JSC::FTL::JITCode::b3Code):
406 (JSC::FTL::JITCode::handles): Deleted.
407 (JSC::FTL::JITCode::dataSections): Deleted.
408 * ftl/FTLJITFinalizer.cpp:
409 (JSC::FTL::JITFinalizer::codeSize):
410 (JSC::FTL::JITFinalizer::finalizeFunction):
411 * ftl/FTLJITFinalizer.h:
412 * ftl/FTLJSCall.cpp: Removed.
413 * ftl/FTLJSCall.h: Removed.
414 * ftl/FTLJSCallBase.cpp: Removed.
415 * ftl/FTLJSCallBase.h: Removed.
416 * ftl/FTLJSCallVarargs.cpp: Removed.
417 * ftl/FTLJSCallVarargs.h: Removed.
418 * ftl/FTLJSTailCall.cpp: Removed.
419 * ftl/FTLJSTailCall.h: Removed.
420 * ftl/FTLLazySlowPath.cpp:
421 (JSC::FTL::LazySlowPath::LazySlowPath):
422 (JSC::FTL::LazySlowPath::generate):
423 * ftl/FTLLazySlowPath.h:
424 (JSC::FTL::LazySlowPath::createGenerator):
425 (JSC::FTL::LazySlowPath::patchableJump):
426 (JSC::FTL::LazySlowPath::done):
427 (JSC::FTL::LazySlowPath::usedRegisters):
428 (JSC::FTL::LazySlowPath::callSiteIndex):
429 (JSC::FTL::LazySlowPath::stub):
430 (JSC::FTL::LazySlowPath::patchpoint): Deleted.
433 * ftl/FTLLocation.cpp:
434 (JSC::FTL::Location::forValueRep):
435 (JSC::FTL::Location::dump):
436 (JSC::FTL::Location::forStackmaps): Deleted.
438 (JSC::FTL::Location::forRegister):
439 (JSC::FTL::Location::forIndirect):
440 (JSC::FTL::Location::forConstant):
441 (JSC::FTL::Location::kind):
442 (JSC::FTL::Location::hasReg):
443 * ftl/FTLLowerDFGToLLVM.cpp:
444 (JSC::FTL::DFG::LowerDFGToLLVM::LowerDFGToLLVM):
445 (JSC::FTL::DFG::LowerDFGToLLVM::lower):
446 (JSC::FTL::DFG::LowerDFGToLLVM::createPhiVariables):
447 (JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
448 (JSC::FTL::DFG::LowerDFGToLLVM::compileUpsilon):
449 (JSC::FTL::DFG::LowerDFGToLLVM::compilePhi):
450 (JSC::FTL::DFG::LowerDFGToLLVM::compileDoubleConstant):
451 (JSC::FTL::DFG::LowerDFGToLLVM::compileValueAdd):
452 (JSC::FTL::DFG::LowerDFGToLLVM::compileStrCat):
453 (JSC::FTL::DFG::LowerDFGToLLVM::compileArithAddOrSub):
454 (JSC::FTL::DFG::LowerDFGToLLVM::compileArithMul):
455 (JSC::FTL::DFG::LowerDFGToLLVM::compileArithDiv):
456 (JSC::FTL::DFG::LowerDFGToLLVM::compileArithNegate):
457 (JSC::FTL::DFG::LowerDFGToLLVM::compileBitAnd):
458 (JSC::FTL::DFG::LowerDFGToLLVM::compileBitOr):
459 (JSC::FTL::DFG::LowerDFGToLLVM::compileBitXor):
460 (JSC::FTL::DFG::LowerDFGToLLVM::compileBitRShift):
461 (JSC::FTL::DFG::LowerDFGToLLVM::compileBitLShift):
462 (JSC::FTL::DFG::LowerDFGToLLVM::compileBitURShift):
463 (JSC::FTL::DFG::LowerDFGToLLVM::compilePutById):
464 (JSC::FTL::DFG::LowerDFGToLLVM::compileGetButterfly):
465 (JSC::FTL::DFG::LowerDFGToLLVM::compileMakeRope):
466 (JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstruct):
467 (JSC::FTL::DFG::LowerDFGToLLVM::compileTailCall):
468 (JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstructVarargs):
469 (JSC::FTL::DFG::LowerDFGToLLVM::compileLoadVarargs):
470 (JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint):
471 (JSC::FTL::DFG::LowerDFGToLLVM::compileIsUndefined):
472 (JSC::FTL::DFG::LowerDFGToLLVM::compileIn):
473 (JSC::FTL::DFG::LowerDFGToLLVM::getById):
474 (JSC::FTL::DFG::LowerDFGToLLVM::loadButterflyWithBarrier):
475 (JSC::FTL::DFG::LowerDFGToLLVM::stringsEqual):
476 (JSC::FTL::DFG::LowerDFGToLLVM::emitRightShiftSnippet):
477 (JSC::FTL::DFG::LowerDFGToLLVM::allocateCell):
478 (JSC::FTL::DFG::LowerDFGToLLVM::lazySlowPath):
479 (JSC::FTL::DFG::LowerDFGToLLVM::speculate):
480 (JSC::FTL::DFG::LowerDFGToLLVM::callCheck):
481 (JSC::FTL::DFG::LowerDFGToLLVM::preparePatchpointForExceptions):
482 (JSC::FTL::DFG::LowerDFGToLLVM::lowBlock):
483 (JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitDescriptor):
484 (JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExit):
485 (JSC::FTL::DFG::LowerDFGToLLVM::blessSpeculation):
486 (JSC::FTL::DFG::LowerDFGToLLVM::buildExitArguments):
487 (JSC::FTL::DFG::LowerDFGToLLVM::exitValueForAvailability):
488 (JSC::FTL::DFG::LowerDFGToLLVM::exitValueForNode):
489 (JSC::FTL::DFG::LowerDFGToLLVM::probe):
490 (JSC::FTL::DFG::LowerDFGToLLVM::crash):
491 (JSC::FTL::DFG::LowerDFGToLLVM::compileUntypedBinaryOp): Deleted.
492 (JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitArgumentsForPatchpointIfWillCatchException): Deleted.
493 (JSC::FTL::DFG::LowerDFGToLLVM::emitOSRExitCall): Deleted.
494 (JSC::FTL::DFG::LowerDFGToLLVM::callStackmap): Deleted.
495 * ftl/FTLOSRExit.cpp:
496 (JSC::FTL::OSRExitDescriptor::OSRExitDescriptor):
497 (JSC::FTL::OSRExitDescriptor::validateReferences):
498 (JSC::FTL::OSRExitDescriptor::emitOSRExit):
499 (JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):
500 (JSC::FTL::OSRExit::OSRExit):
501 (JSC::FTL::OSRExit::codeLocationForRepatch):
502 (JSC::FTL::OSRExit::gatherRegistersToSpillForCallIfException): Deleted.
503 (JSC::FTL::OSRExit::spillRegistersToSpillSlot): Deleted.
504 (JSC::FTL::OSRExit::recoverRegistersFromSpillSlot): Deleted.
505 (JSC::FTL::OSRExit::willArriveAtExitFromIndirectExceptionCheck): Deleted.
506 (JSC::FTL::OSRExit::willArriveAtOSRExitFromCallOperation): Deleted.
507 (JSC::FTL::OSRExit::needsRegisterRecoveryOnGenericUnwindOSRExitPath): Deleted.
509 (JSC::FTL::OSRExit::considerAddingAsFrequentExitSite):
510 (JSC::FTL::OSRExitDescriptorImpl::OSRExitDescriptorImpl): Deleted.
511 * ftl/FTLOSRExitCompilationInfo.h: Removed.
512 * ftl/FTLOSRExitCompiler.cpp:
513 (JSC::FTL::compileRecovery):
514 (JSC::FTL::compileStub):
515 (JSC::FTL::compileFTLOSRExit):
516 * ftl/FTLOSRExitHandle.cpp:
517 * ftl/FTLOSRExitHandle.h:
518 * ftl/FTLOutput.cpp: Removed.
519 * ftl/FTLOutput.h: Removed.
520 * ftl/FTLPatchpointExceptionHandle.cpp:
521 * ftl/FTLPatchpointExceptionHandle.h:
522 * ftl/FTLStackMaps.cpp: Removed.
523 * ftl/FTLStackMaps.h: Removed.
525 (JSC::FTL::State::State):
526 (JSC::FTL::State::~State):
527 (JSC::FTL::State::dumpState): Deleted.
529 * ftl/FTLUnwindInfo.cpp: Removed.
530 * ftl/FTLUnwindInfo.h: Removed.
531 * ftl/FTLValueRange.cpp:
532 (JSC::FTL::ValueRange::decorateInstruction):
533 * ftl/FTLValueRange.h:
534 (JSC::FTL::ValueRange::ValueRange):
535 (JSC::FTL::ValueRange::begin):
536 (JSC::FTL::ValueRange::end):
538 (JSC::FTL::Weight::value):
539 (JSC::FTL::Weight::frequencyClass):
540 (JSC::FTL::Weight::scaleToTotal):
541 * llvm/InitializeLLVM.cpp: Removed.
542 * llvm/InitializeLLVM.h: Removed.
543 * llvm/InitializeLLVMMac.cpp: Removed.
544 * llvm/InitializeLLVMPOSIX.cpp: Removed.
545 * llvm/InitializeLLVMPOSIX.h: Removed.
546 * llvm/LLVMAPI.cpp: Removed.
547 * llvm/LLVMAPI.h: Removed.
548 * llvm/LLVMAPIFunctions.h: Removed.
549 * llvm/LLVMHeaders.h: Removed.
550 * llvm/library/LLVMAnchor.cpp: Removed.
551 * llvm/library/LLVMExports.cpp: Removed.
552 * llvm/library/LLVMOverrides.cpp: Removed.
553 * llvm/library/config_llvm.h: Removed.
555 2016-02-17 Benjamin Poulain <bpoulain@apple.com>
557 [JSC] Remove the overflow check on ArithAbs when possible
558 https://bugs.webkit.org/show_bug.cgi?id=154325
560 Reviewed by Filip Pizlo.
562 This patch adds support for ArithMode for ArithAbs.
564 It is useful for kraken tests where Math.abs() is used
565 on values for which the range is known.
567 For example, imaging-gaussian-blur has two Math.abs() with
568 integers that are always in a small range around zero.
569 The IntegerRangeOptimizationPhase detects the range correctly
570 so we can just update the ArithMode depending on the input.
572 * dfg/DFGFixupPhase.cpp:
573 (JSC::DFG::FixupPhase::fixupNode):
574 * dfg/DFGIntegerRangeOptimizationPhase.cpp:
576 (JSC::DFG::Node::convertToArithNegate):
577 (JSC::DFG::Node::hasArithMode):
578 * dfg/DFGSpeculativeJIT64.cpp:
579 (JSC::DFG::SpeculativeJIT::compile):
580 * ftl/FTLLowerDFGToLLVM.cpp:
581 (JSC::FTL::DFG::LowerDFGToLLVM::compileArithAbs):
582 * tests/stress/arith-abs-integer-range-optimization.js: Added.
584 (negativeRangeIncludingZero):
585 (negativeRangeWithOverflow):
587 (positiveRangeIncludingZero):
588 (rangeWithoutOverflow):
589 * tests/stress/arith-abs-with-bitwise-or-zero.js: Added.
592 2016-02-17 Chris Dumez <cdumez@apple.com>
594 SES selftest page crashes on nightly r196694
595 https://bugs.webkit.org/show_bug.cgi?id=154350
596 <rdar://problem/24704334>
598 Reviewed by Mark Lam.
600 SES selftest page crashes after r196001 / r196145 when calling
601 Object.getOwnPropertyDescriptor(window, "length") after the window
602 has been reified and "length" has been shadowed by a value property.
604 It was crashing in JSObject::getOwnPropertyDescriptor() because
605 we are getting a slot that has attribute "CustomAccessor" but
606 the property is not a CustomGetterSetter. In this case, since
607 window.length is [Replaceable] and has been set to a numeric value,
608 it makes that the property is not a CustomGetterSetter. However,
609 the "CustomAccessor" attribute should have been dropped from the
610 slot when window.length was shadowed. Therefore, this code path
611 should not be exercised at all when calling
612 getOwnPropertyDescriptor().
614 The issue was that putDirectInternal() was updating the slot
615 attributes only if the "Accessor" flag has changed, but not
616 the "customAccessor" flag. This patch fixes the issue.
618 * runtime/JSObject.h:
619 (JSC::JSObject::putDirectInternal):
621 2016-02-17 Saam barati <sbarati@apple.com>
623 Implement Proxy [[Get]]
624 https://bugs.webkit.org/show_bug.cgi?id=154081
626 Reviewed by Michael Saboff.
628 This patch implements ProxyObject and ProxyConstructor. Their
629 implementations are straight forward and follow the spec.
630 The largest change in this patch is adding a second parameter
631 to PropertySlot's constructor that specifies the internal method type of
632 the getOwnPropertySlot inquiry. We use getOwnPropertySlot to
633 implement more than one Internal Method in the spec. Because
634 of this, we need InternalMethodType to give us context about
635 which Internal Method we're executing. Specifically, Proxy will
636 call into different handlers based on this information.
638 InternalMethodType is an enum with the following values:
640 This corresponds to [[Get]] internal method in the spec.
642 This corresponds to [[GetOwnProperty]] internal method in the spec.
644 This corresponds to [[HasProperty]] internal method in the spec.
646 This is basically everything else that isn't one of the above
647 types. This value also mandates that getOwnPropertySlot does
648 not perform any user observable effects. I.e, it can't call
651 The other non-VMInquiry InternalMethodTypes are allowed to perform user
652 observable effects. I.e, in future patches, ProxyObject will implement
653 InternalMethodType::HasProperty and InternalMethodType::GetOwnProperty, which will both be defined
654 to call user defined JS functions, which clearly have the right to perform
655 user observable effects.
657 This patch implements getOwnPropertySlot of ProxyObject under
658 InternalMethodType::Get.
660 * API/JSCallbackObjectFunctions.h:
661 (JSC::JSCallbackObject<Parent>::put):
662 (JSC::JSCallbackObject<Parent>::staticFunctionGetter):
664 * JavaScriptCore.xcodeproj/project.pbxproj:
665 * debugger/DebuggerScope.cpp:
666 (JSC::DebuggerScope::caughtValue):
667 * interpreter/Interpreter.cpp:
668 (JSC::Interpreter::execute):
669 * jit/JITOperations.cpp:
670 * llint/LLIntSlowPaths.cpp:
671 (JSC::LLInt::LLINT_SLOW_PATH_DECL):
672 * runtime/ArrayPrototype.cpp:
674 * runtime/CommonIdentifiers.h:
675 * runtime/JSCJSValueInlines.h:
677 * runtime/JSFunction.cpp:
678 (JSC::JSFunction::getOwnNonIndexPropertyNames):
679 (JSC::JSFunction::put):
680 (JSC::JSFunction::defineOwnProperty):
681 * runtime/JSGenericTypedArrayViewConstructorInlines.h:
682 (JSC::constructGenericTypedArrayViewWithArguments):
683 * runtime/JSGlobalObject.cpp:
684 (JSC::JSGlobalObject::init):
685 (JSC::JSGlobalObject::defineOwnProperty):
686 * runtime/JSGlobalObject.h:
687 (JSC::JSGlobalObject::regExpMatchesArrayStructure):
688 (JSC::JSGlobalObject::moduleRecordStructure):
689 (JSC::JSGlobalObject::moduleNamespaceObjectStructure):
690 (JSC::JSGlobalObject::proxyObjectStructure):
691 (JSC::JSGlobalObject::wasmModuleStructure):
692 * runtime/JSModuleEnvironment.cpp:
693 (JSC::JSModuleEnvironment::getOwnPropertySlot):
694 * runtime/JSModuleNamespaceObject.cpp:
695 (JSC::callbackGetter):
696 * runtime/JSONObject.cpp:
697 (JSC::Stringifier::Holder::appendNextProperty):
699 * runtime/JSObject.cpp:
700 (JSC::JSObject::calculatedClassName):
701 (JSC::JSObject::putDirectNonIndexAccessor):
702 (JSC::JSObject::hasProperty):
703 (JSC::JSObject::deleteProperty):
704 (JSC::JSObject::hasOwnProperty):
705 (JSC::JSObject::getOwnPropertyDescriptor):
706 * runtime/JSObject.h:
707 (JSC::JSObject::getDirectIndex):
708 (JSC::JSObject::get):
709 * runtime/JSScope.cpp:
710 (JSC::abstractAccess):
711 * runtime/ObjectConstructor.cpp:
712 (JSC::toPropertyDescriptor):
713 * runtime/ObjectPrototype.cpp:
714 (JSC::objectProtoFuncLookupGetter):
715 (JSC::objectProtoFuncLookupSetter):
716 (JSC::objectProtoFuncToString):
717 * runtime/PropertySlot.h:
718 (JSC::attributesForStructure):
719 (JSC::PropertySlot::PropertySlot):
720 (JSC::PropertySlot::isCacheableGetter):
721 (JSC::PropertySlot::isCacheableCustom):
722 (JSC::PropertySlot::internalMethodType):
723 (JSC::PropertySlot::disableCaching):
724 (JSC::PropertySlot::getValue):
725 * runtime/ProxyConstructor.cpp: Added.
726 (JSC::ProxyConstructor::create):
727 (JSC::ProxyConstructor::ProxyConstructor):
728 (JSC::ProxyConstructor::finishCreation):
729 (JSC::constructProxyObject):
730 (JSC::ProxyConstructor::getConstructData):
731 (JSC::ProxyConstructor::getCallData):
732 * runtime/ProxyConstructor.h: Added.
733 (JSC::ProxyConstructor::createStructure):
734 * runtime/ProxyObject.cpp: Added.
735 (JSC::ProxyObject::ProxyObject):
736 (JSC::ProxyObject::finishCreation):
737 (JSC::performProxyGet):
738 (JSC::ProxyObject::getOwnPropertySlotCommon):
739 (JSC::ProxyObject::getOwnPropertySlot):
740 (JSC::ProxyObject::getOwnPropertySlotByIndex):
741 (JSC::ProxyObject::visitChildren):
742 * runtime/ProxyObject.h: Added.
743 (JSC::ProxyObject::create):
744 (JSC::ProxyObject::createStructure):
745 (JSC::ProxyObject::target):
746 (JSC::ProxyObject::handler):
747 * runtime/ReflectObject.cpp:
748 (JSC::reflectObjectGet):
749 * runtime/SamplingProfiler.cpp:
750 (JSC::SamplingProfiler::StackFrame::nameFromCallee):
752 * tests/stress/proxy-basic.js: Added.
754 (let.handler.get null):
756 (let.handler.get switch):
758 (let.theTarget.get x):
759 * tests/stress/proxy-in-proto-chain.js: Added.
761 * tests/stress/proxy-of-a-proxy.js: Added.
764 * tests/stress/proxy-property-descriptor.js: Added.
767 * wasm/WASMModuleParser.cpp:
768 (JSC::WASMModuleParser::getImportedValue):
770 2016-02-17 Mark Lam <mark.lam@apple.com>
772 StringPrototype functions should check for exceptions after calling JSString::value().
773 https://bugs.webkit.org/show_bug.cgi?id=154340
775 Reviewed by Filip Pizlo.
777 JSString::value() can throw an exception if the JS string is a rope and value()
778 needs to resolve the rope but encounters an OutOfMemory error. If value() is not
779 able to resolve the rope, it will return a null string (in addition to throwing
780 the exception). If StringPrototype functions do not check for exceptions after
781 calling JSString::value(), they may eventually use the returned null string and
784 The fix is to add all the necessary exception checks, and do the appropriate
787 Also in a few place where when an exception is detected, we return JSValue(), I
788 changed it to return jsUndefined() instead to be consistent with the rest of the
791 * runtime/StringPrototype.cpp:
792 (JSC::replaceUsingRegExpSearch):
793 (JSC::stringProtoFuncMatch):
794 (JSC::stringProtoFuncSlice):
795 (JSC::stringProtoFuncSplit):
796 (JSC::stringProtoFuncLocaleCompare):
797 (JSC::stringProtoFuncBig):
798 (JSC::stringProtoFuncSmall):
799 (JSC::stringProtoFuncBlink):
800 (JSC::stringProtoFuncBold):
801 (JSC::stringProtoFuncFixed):
802 (JSC::stringProtoFuncItalics):
803 (JSC::stringProtoFuncStrike):
804 (JSC::stringProtoFuncSub):
805 (JSC::stringProtoFuncSup):
806 (JSC::stringProtoFuncFontcolor):
807 (JSC::stringProtoFuncFontsize):
808 (JSC::stringProtoFuncAnchor):
809 (JSC::stringProtoFuncLink):
812 2016-02-17 Commit Queue <commit-queue@webkit.org>
814 Unreviewed, rolling out r196675.
815 https://bugs.webkit.org/show_bug.cgi?id=154344
817 "Causes major slowdowns on deltablue-varargs" (Requested by
818 keith_miller on #webkit).
822 "Spread operator should be allowed when not the first argument
824 https://bugs.webkit.org/show_bug.cgi?id=152721
825 http://trac.webkit.org/changeset/196675
827 2016-02-17 Gavin Barraclough <barraclough@apple.com>
829 JSDOMWindow::put should not do the same thing twice
830 https://bugs.webkit.org/show_bug.cgi?id=154334
832 Reviewed by Chris Dumez.
834 It either calls JSGlobalObject::put or Base::put. Hint: these are basically the same thing.
835 In the latter case it might call lookupPut. That's redundant; JSObject::put handles static
838 * runtime/JSGlobalObject.h:
839 (JSC::JSGlobalObject::hasOwnPropertyForWrite): Deleted.
842 2016-02-16 Filip Pizlo <fpizlo@apple.com>
844 FTL_USES_B3 should be unconditionally true
845 https://bugs.webkit.org/show_bug.cgi?id=154324
847 Reviewed by Benjamin Poulain.
851 2016-02-16 Filip Pizlo <fpizlo@apple.com>
853 FTL should support CompareEq(String:, String:)
854 https://bugs.webkit.org/show_bug.cgi?id=154269
855 rdar://problem/24499921
857 Reviewed by Benjamin Poulain.
859 Looks like a slight pdfjs slow-down, probably because we're having some recompilations. I
860 think we should land the increased coverage first and fix the issues after, especially since
861 the regression is so small and doesn't have a statistically significant effect on the overall
864 * ftl/FTLCapabilities.cpp:
865 (JSC::FTL::canCompile):
866 * ftl/FTLLowerDFGToLLVM.cpp:
867 (JSC::FTL::DFG::LowerDFGToLLVM::compileCompareEq):
868 (JSC::FTL::DFG::LowerDFGToLLVM::compileCompareStrictEq):
869 (JSC::FTL::DFG::LowerDFGToLLVM::nonSpeculativeCompare):
870 (JSC::FTL::DFG::LowerDFGToLLVM::stringsEqual):
871 * tests/stress/ftl-string-equality.js: Added.
872 * tests/stress/ftl-string-ident-equality.js: Added.
873 * tests/stress/ftl-string-strict-equality.js: Added.
875 2016-02-16 Filip Pizlo <fpizlo@apple.com>
877 FTL should support NewTypedArray
878 https://bugs.webkit.org/show_bug.cgi?id=154268
880 Reviewed by Saam Barati.
882 3% speed-up on pdfjs. This was already covered by many different tests.
884 Rolling this back in after fixing the butterfly argument.
886 * ftl/FTLCapabilities.cpp:
887 (JSC::FTL::canCompile):
888 * ftl/FTLLowerDFGToLLVM.cpp:
889 (JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
890 (JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayWithSize):
891 (JSC::FTL::DFG::LowerDFGToLLVM::compileNewTypedArray):
892 (JSC::FTL::DFG::LowerDFGToLLVM::compileAllocatePropertyStorage):
893 (JSC::FTL::DFG::LowerDFGToLLVM::allocateBasicStorageAndGetEnd):
894 (JSC::FTL::DFG::LowerDFGToLLVM::allocateBasicStorage):
895 (JSC::FTL::DFG::LowerDFGToLLVM::allocateObject):
897 2016-02-16 Gavin Barraclough <barraclough@apple.com>
899 JSDOMWindow::getOwnPropertySlot should just call getStaticPropertySlot
900 https://bugs.webkit.org/show_bug.cgi?id=154257
902 Reviewed by Chris Dumez.
905 (JSC::getStaticPropertySlot):
906 (JSC::getStaticFunctionSlot):
907 (JSC::getStaticValueSlot):
908 - this could all do with a little more love.
909 But enforce the basic precedence:
910 (1) regular storage properties always win over static table properties.
911 (2) if properties have been reified, don't consult the static tables.
912 (3) only if the property is not present on the object & not reified
913 should the static hashtable be consulted.
915 2016-02-16 Gavin Barraclough <barraclough@apple.com>
917 JSDOMWindow::getOwnPropertySlot should not search photo chain
918 https://bugs.webkit.org/show_bug.cgi?id=154102
920 Reviewed by Chris Dumez.
922 Should only return *own* properties.
924 * runtime/JSObject.cpp:
925 (JSC::JSObject::getOwnPropertyDescriptor):
926 - remove hack/special-case for DOMWindow; we no longer need this.
928 2016-02-16 Keith Miller <keith_miller@apple.com>
930 Spread operator should be allowed when not the first argument of parameter list
931 https://bugs.webkit.org/show_bug.cgi?id=152721
933 Reviewed by Saam Barati.
935 Spread arguments to functions should now be ES6 compliant. Before we
936 would only take a spread operator if it was the sole argument to a
937 function. Additionally, we would not use the Symbol.iterator on the
938 object to generate the arguments. Instead we would do a loop up to the
939 length mapping indexed properties to the corresponding argument. We fix
940 both these issues by doing an AST transformation from foo(...a, b, ...c, d)
941 to foo(...[...a, b, ...c, d]) (where the spread on the rhs uses the
942 old spread semantics). This solution has the downside of requiring the
943 allocation of another object and copying each element twice but avoids a
944 large change to the vm calling convention.
946 * interpreter/Interpreter.cpp:
948 * parser/ASTBuilder.h:
949 (JSC::ASTBuilder::createElementList):
951 (JSC::Parser<LexerType>::parseArguments):
952 (JSC::Parser<LexerType>::parseArgument):
953 (JSC::Parser<LexerType>::parseMemberExpression):
955 * parser/SyntaxChecker.h:
956 (JSC::SyntaxChecker::createElementList):
958 * tests/stress/spread-calling.js: Added.
962 (otherIterator.return.next):
965 (throwingIter.return.next):
969 2016-02-16 Benjamin Poulain <bpoulain@apple.com>
971 [JSC] Enable B3 on ARM64
972 https://bugs.webkit.org/show_bug.cgi?id=154275
974 Reviewed by Mark Lam.
976 The port passes more tests than LLVM now, let's use it by default.
980 2016-02-16 Commit Queue <commit-queue@webkit.org>
982 Unreviewed, rolling out r196652.
983 https://bugs.webkit.org/show_bug.cgi?id=154315
985 This change caused LayoutTest crashes (Requested by ryanhaddad
990 "FTL should support NewTypedArray"
991 https://bugs.webkit.org/show_bug.cgi?id=154268
992 http://trac.webkit.org/changeset/196652
994 2016-02-16 Brian Burg <bburg@apple.com>
996 RemoteInspector should forward new automation session requests to its client
997 https://bugs.webkit.org/show_bug.cgi?id=154260
998 <rdar://problem/24663313>
1000 Reviewed by Timothy Hatcher.
1002 * inspector/remote/RemoteInspector.h:
1003 * inspector/remote/RemoteInspector.mm:
1004 (Inspector::RemoteInspector::xpcConnectionReceivedMessage):
1005 (Inspector::RemoteInspector::listingForAutomationTarget):
1006 Use the correct key for the session identifier in the listing. The name()
1007 override for RemoteAutomationTarget is actually the session identifier.
1009 (Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):
1010 * inspector/remote/RemoteInspectorConstants.h: Add new constants.
1012 2016-02-16 Saam barati <sbarati@apple.com>
1014 SamplingProfiler still fails with ASan enabled
1015 https://bugs.webkit.org/show_bug.cgi?id=154301
1016 <rdar://problem/24679502>
1018 Reviewed by Filip Pizlo.
1020 To fix this issue, I've come up with unsafe versions
1021 of all operations that load memory from the thread's call
1022 frame. All these new unsafe methods are marked with SUPPRESS_ASAN.
1024 * interpreter/CallFrame.cpp:
1025 (JSC::CallFrame::callSiteAsRawBits):
1026 (JSC::CallFrame::unsafeCallSiteAsRawBits):
1027 (JSC::CallFrame::callSiteIndex):
1028 (JSC::CallFrame::unsafeCallSiteIndex):
1029 (JSC::CallFrame::stack):
1030 (JSC::CallFrame::callerFrame):
1031 (JSC::CallFrame::unsafeCallerFrame):
1032 (JSC::CallFrame::friendlyFunctionName):
1033 * interpreter/CallFrame.h:
1034 (JSC::ExecState::calleeAsValue):
1035 (JSC::ExecState::callee):
1036 (JSC::ExecState::unsafeCallee):
1037 (JSC::ExecState::codeBlock):
1038 (JSC::ExecState::unsafeCodeBlock):
1039 (JSC::ExecState::scope):
1040 (JSC::ExecState::callerFrame):
1041 (JSC::ExecState::callerFrameOrVMEntryFrame):
1042 (JSC::ExecState::unsafeCallerFrameOrVMEntryFrame):
1043 (JSC::ExecState::callerFrameOffset):
1044 (JSC::ExecState::callerFrameAndPC):
1045 (JSC::ExecState::unsafeCallerFrameAndPC):
1046 * interpreter/Register.h:
1047 (JSC::Register::codeBlock):
1048 (JSC::Register::asanUnsafeCodeBlock):
1049 (JSC::Register::unboxedInt32):
1050 (JSC::Register::tag):
1051 (JSC::Register::unsafeTag):
1052 (JSC::Register::payload):
1053 * interpreter/VMEntryRecord.h:
1054 (JSC::VMEntryRecord::prevTopCallFrame):
1055 (JSC::VMEntryRecord::unsafePrevTopCallFrame):
1056 (JSC::VMEntryRecord::prevTopVMEntryFrame):
1057 (JSC::VMEntryRecord::unsafePrevTopVMEntryFrame):
1058 * runtime/SamplingProfiler.cpp:
1059 (JSC::FrameWalker::walk):
1060 (JSC::FrameWalker::advanceToParentFrame):
1061 (JSC::FrameWalker::isAtTop):
1062 (JSC::FrameWalker::resetAtMachineFrame):
1064 2016-02-16 Filip Pizlo <fpizlo@apple.com>
1066 FTL should support NewTypedArray
1067 https://bugs.webkit.org/show_bug.cgi?id=154268
1069 Reviewed by Saam Barati.
1071 3% speed-up on pdfjs. This was already covered by many different tests.
1073 * ftl/FTLCapabilities.cpp:
1074 (JSC::FTL::canCompile):
1075 * ftl/FTLLowerDFGToLLVM.cpp:
1076 (JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
1077 (JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayWithSize):
1078 (JSC::FTL::DFG::LowerDFGToLLVM::compileNewTypedArray):
1079 (JSC::FTL::DFG::LowerDFGToLLVM::compileAllocatePropertyStorage):
1080 (JSC::FTL::DFG::LowerDFGToLLVM::allocateBasicStorageAndGetEnd):
1081 (JSC::FTL::DFG::LowerDFGToLLVM::allocateBasicStorage):
1082 (JSC::FTL::DFG::LowerDFGToLLVM::allocateObject):
1084 2016-02-16 Saam barati <sbarati@apple.com>
1086 stress/sampling-profiler-deep-stack.js fails on ARM 32bit
1087 https://bugs.webkit.org/show_bug.cgi?id=154255
1088 <rdar://problem/24662996>
1090 Reviewed by Mark Lam.
1092 The bug here wasn't in the implementation of the sampling profiler
1093 itself. Rather, it was a bug in the test. JSC wasn't spending a lot
1094 of time in a function that the test assumed a lot of time was spent in.
1095 That's because the DFG was doing a good job at optimizing the function
1096 at the leaf of the recursion. Because of that, we often wouldn't sample it.
1097 I fixed this by making the leaf function do more work.
1099 * tests/stress/sampling-profiler-deep-stack.js:
1100 (platformSupportsSamplingProfiler.foo):
1102 2016-02-16 Chris Dumez <cdumez@apple.com>
1104 [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
1105 https://bugs.webkit.org/show_bug.cgi?id=154120
1106 <rdar://problem/24613231>
1108 Reviewed by Gavin Barraclough.
1110 Have putEntry() take a thisValue parameter in addition to the base,
1111 instead of relying on PropertySlot::thisValue() because this did not
1112 always do the right thing. In particular, when JSDOMWindow::put() was
1113 called to set a function, it would end up setting the new value on the
1114 JSDOMWindowShell instead of the actual JSDOMWindow.
1115 JSDOMWindow::getOwnPropertySlot() would then not be able to find it.
1116 Therefore the following would fail:
1117 $ window.open = "test"
1118 $ console.log(window.open) // prints the native function instead of "test"
1120 * runtime/JSObject.cpp:
1121 (JSC::JSObject::putInlineSlow):
1126 2016-02-16 Keith Miller <keith_miller@apple.com>
1128 ClonedArguments should not materialize its special properties unless they are being changed or deleted
1129 https://bugs.webkit.org/show_bug.cgi?id=154128
1131 Reviewed by Filip Pizlo.
1133 Before we would materialize ClonedArguments whenever they were being accessed.
1134 However this would cause the IC to miss every time as the structure for
1135 the arguments object would change as we went to IC it. Thus on the next
1136 function call we would miss the cache since the new arguments object
1137 would not have materialized the value.
1139 * runtime/ClonedArguments.cpp:
1140 (JSC::ClonedArguments::getOwnPropertySlot):
1141 * tests/stress/cloned-arguments-modification.js: Added.
1144 2016-02-16 Filip Pizlo <fpizlo@apple.com>
1146 FTL should support StringFromCharCode
1147 https://bugs.webkit.org/show_bug.cgi?id=154267
1148 rdar://problem/24192536
1150 Reviewed by Mark Lam.
1152 * dfg/DFGFixupPhase.cpp:
1153 (JSC::DFG::FixupPhase::fixupNode): Fix a bug preventing the UntypedUse from being effective.
1154 * ftl/FTLCapabilities.cpp:
1155 (JSC::FTL::canCompile):
1156 * ftl/FTLLowerDFGToLLVM.cpp:
1157 (JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
1158 (JSC::FTL::DFG::LowerDFGToLLVM::compileStringFromCharCode): Implement the opcode.
1159 * tests/stress/string-from-char-code-slow.js: Added.
1161 2016-02-15 Benjamin Poulain <bpoulain@apple.com>
1163 [JSC] BranchAdd can override arguments of its stackmap
1164 https://bugs.webkit.org/show_bug.cgi?id=154274
1166 Reviewed by Filip Pizlo.
1168 With the 3 operands BranchAdd added in r196513, we can run into
1169 a register allocation such that the destination register is also
1170 used by a value in the stack map.
1172 It use to be that BranchAdd was a 2 operand instruction.
1173 In that form, the destination is also one of the source and
1174 can be recovered through Sub. There is no conflict between
1175 destination and the stackmap.
1177 After r196513, the destination has its own value. It is uncommon
1178 on x86 because of the aggressive aliasing but that can happen.
1179 On ARM, that's a standard form since there is no need for aliasing.
1181 Since the arguments of the stackmap are of type EarlyUse,
1182 they appeared as not interfering with the destination. When the register
1183 allocator gives the same register to the destination and something in
1184 the stack map, the result of BranchAdd destroys the value kept alive
1187 In this patch, I introduce a concept very similar to ForceLateUse
1188 to keep the argument of the stackmap live in CheckAdd. The new
1189 role is "ForceLateUseUnlessRecoverable".
1191 In this mode, anything that is not also an input argument becomes
1192 LateUse. As such, it interferes with the destination of CheckAdd.
1193 The arguments are recovered by the slow patch of CheckAdd. They
1196 This new modes ensure that destination can be aliased to the source
1197 when that's useful, while making sure it is not aliased with another
1198 value that needs to be live on exit.
1200 * b3/B3CheckSpecial.cpp:
1201 (JSC::B3::CheckSpecial::forEachArg):
1202 * b3/B3LowerToAir.cpp:
1203 (JSC::B3::Air::LowerToAir::lower):
1204 * b3/B3PatchpointSpecial.cpp:
1205 (JSC::B3::PatchpointSpecial::forEachArg):
1206 * b3/B3StackmapSpecial.cpp:
1207 (JSC::B3::StackmapSpecial::forEachArgImpl):
1208 (WTF::printInternal):
1209 * b3/B3StackmapSpecial.h:
1210 * b3/B3StackmapValue.h:
1212 2016-02-15 Joseph Pecoraro <pecoraro@apple.com>
1214 Web Inspector: Web Workers have no access to console for debugging
1215 https://bugs.webkit.org/show_bug.cgi?id=26237
1217 Reviewed by Timothy Hatcher.
1219 * inspector/ConsoleMessage.h:
1220 Add accessor for MessageLevel.
1222 2016-02-15 Mark Lam <mark.lam@apple.com>
1224 [ARMv7] stress/op_rshift.js and stress/op_urshift.js are failing.
1225 https://bugs.webkit.org/show_bug.cgi?id=151514
1227 Reviewed by Filip Pizlo.
1229 The issue turns out to be trivial: on ARMv7 (and traditional ARM too), arithmetic
1230 shift right (ASR) and logical shift right (LSR) takes an immediate shift amount
1231 from 1-32. See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Cjacbgca.html.
1232 An immediate shift amount of 0 is interpreted as a shift of 32 bits.
1234 Meanwhile, our macro assembler is expecting the immediate shift value to be
1235 between 0-31. As a result, a shift amount of 0 is being wrongly encoded with 0
1236 bits which means shift right by 32 bits.
1238 The fix is to check if the shift amount is 0, and if so, emit a move. Else,
1239 emit the right shift as usual.
1241 This issue does not affect left shifts, as the immediate shift amount for left
1242 shifts is between 0-31 as our macro assembler expects.
1244 * assembler/MacroAssemblerARM.h:
1245 (JSC::MacroAssemblerARM::rshift32):
1246 (JSC::MacroAssemblerARM::urshift32):
1247 (JSC::MacroAssemblerARM::sub32):
1248 * assembler/MacroAssemblerARMv7.h:
1249 (JSC::MacroAssemblerARMv7::rshift32):
1250 (JSC::MacroAssemblerARMv7::urshift32):
1252 * tests/stress/op_rshift.js:
1253 * tests/stress/op_urshift.js:
1254 - Un-skip these tests. They should always pass now.
1256 2016-02-15 Filip Pizlo <fpizlo@apple.com>
1258 Parser::parseVariableDeclarationList should null check the node before attempting to create a new CommaExpr
1259 https://bugs.webkit.org/show_bug.cgi?id=154244
1260 rdar://problem/24290670
1262 Reviewed by Michael Saboff.
1264 * parser/ASTBuilder.h:
1265 (JSC::ASTBuilder::appendToCommaExpr): Catch the bug sooner in debug.
1266 * parser/Parser.cpp:
1267 (JSC::Parser<LexerType>::parseVariableDeclarationList): Fix the bug.
1268 * tests/stress/for-let-comma.js: Added. This used to crash in debug and release.
1270 2016-02-15 Benjamin Poulain <bpoulain@apple.com>
1272 [JSC] Improve the interface of Inst::shouldTryAliasingDef()
1273 https://bugs.webkit.org/show_bug.cgi?id=154227
1275 Reviewed by Andreas Kling.
1277 Using Optional<> instead of a bool+reference looks cleaner
1280 * b3/B3CheckSpecial.cpp:
1281 (JSC::B3::CheckSpecial::shouldTryAliasingDef):
1282 * b3/B3CheckSpecial.h:
1283 * b3/air/AirCustom.h:
1284 (JSC::B3::Air::PatchCustom::shouldTryAliasingDef):
1286 * b3/air/AirInstInlines.h:
1287 (JSC::B3::Air::Inst::shouldTryAliasingDef):
1288 * b3/air/AirIteratedRegisterCoalescing.cpp:
1289 * b3/air/AirSpecial.cpp:
1290 (JSC::B3::Air::Special::shouldTryAliasingDef):
1291 * b3/air/AirSpecial.h:
1293 2016-02-14 Brian Burg <bburg@apple.com>
1295 WKAutomationDelegate's requestAutomationSession should take a suggested session identifier
1296 https://bugs.webkit.org/show_bug.cgi?id=154012
1297 <rdar://problem/24557697>
1299 Reviewed by Darin Adler.
1301 Add a string parameter to the client method for requesting a new session.
1303 * inspector/remote/RemoteInspector.h:
1305 2016-02-13 Timothy Hatcher <timothy@apple.com>
1307 Fix WebAssembly bug URL in the feature list.
1311 2016-02-12 Sukolsak Sakshuwong <sukolsak@gmail.com>
1313 Change the last RefPtr::get() to release() in String.prototype.normalize
1314 https://bugs.webkit.org/show_bug.cgi?id=154211
1316 Reviewed by Ryosuke Niwa.
1318 Change the last RefPtr::get() to release() in String.prototype.normalize.
1320 * runtime/StringPrototype.cpp:
1323 2016-02-12 Saam barati <sbarati@apple.com>
1325 [ES6] we have an incorrect syntax error when a callee of a function expression has the same name as a top-level lexical declaration
1326 https://bugs.webkit.org/show_bug.cgi?id=154143
1328 Reviewed by Benjamin Poulain.
1330 We were raising syntax errors on the following type of programs when
1331 we shouldn't have been.
1333 (function foo() { const foo = 20; });
1336 * parser/Parser.cpp:
1337 (JSC::Parser<LexerType>::parseFunctionInfo):
1339 (JSC::Scope::computeLexicallyCapturedVariablesAndPurgeCandidates):
1340 (JSC::Scope::declareCallee):
1341 (JSC::Scope::declareVariable):
1342 (JSC::Scope::hasDeclaredVariable):
1343 (JSC::Scope::hasLexicallyDeclaredVariable):
1344 (JSC::Scope::hasDeclaredParameter):
1345 (JSC::Scope::declareWrite):
1346 (JSC::Scope::getCapturedVars):
1348 2016-02-12 Benjamin Poulain <bpoulain@apple.com>
1350 [JSC] ZeroExtend and SignExtend use incorrect addressing on ARM64
1351 https://bugs.webkit.org/show_bug.cgi?id=154208
1353 Reviewed by Filip Pizlo.
1359 LowerToAir would see there is a form of SignExtend8To32 (an alias for Load8S)
1362 There are two problems with that:
1363 1) If we have an Addr, it went through legalizeMemoryOffsets() for a 32bits
1364 load. If used on an other kind of load, there is no guarantee the addressing
1366 2) If we have an Index, it is computed for the 32bits MemoryValue.
1367 The computed index is not valid for the 8bits load.
1369 (2) could be fixed by changing LowerToAir to use the current instruction width
1370 instead of the B3ValueWidth but that's a bit tricky. We should just embrace
1371 that one of our target is a Load-Store architecture.
1373 In this patch, I just disabled the faulty forms on ARM64. We still need those operations
1374 to be fast, this will be addressed in: https://bugs.webkit.org/show_bug.cgi?id=154207
1376 I also strengthened the m_allowScratchRegister assertion. The instructions that do not
1377 invalidate the temporary did not run the assertion, making this harder to debug.
1379 * assembler/MacroAssemblerARM64.h:
1380 (JSC::MacroAssemblerARM64::load8):
1381 (JSC::MacroAssemblerARM64::store64):
1382 (JSC::MacroAssemblerARM64::store32):
1383 (JSC::MacroAssemblerARM64::loadDouble):
1384 (JSC::MacroAssemblerARM64::storeDouble):
1385 (JSC::MacroAssemblerARM64::branch32):
1386 (JSC::MacroAssemblerARM64::branch64):
1387 (JSC::MacroAssemblerARM64::getCachedDataTempRegisterIDAndInvalidate):
1388 (JSC::MacroAssemblerARM64::getCachedMemoryTempRegisterIDAndInvalidate):
1389 (JSC::MacroAssemblerARM64::dataMemoryTempRegister):
1390 (JSC::MacroAssemblerARM64::cachedMemoryTempRegister):
1391 (JSC::MacroAssemblerARM64::load):
1392 (JSC::MacroAssemblerARM64::store):
1393 * b3/air/AirOpcode.opcodes:
1395 2016-02-12 Michael Saboff <msaboff@apple.com>
1397 offlineasm: Emit Dwarf2 file and location directives to allow for debugging .asm files
1398 https://bugs.webkit.org/show_bug.cgi?id=152703
1400 Reviewed by Mark Lam.
1402 Added support to output Dwarf2 .file and .loc assembler directives to provide the debugging
1403 information needed to correlate the offline assembler generated code with the source lines
1406 Changed the tracking of file data to include a file index that was provided to the .file
1407 directive. That index is used when emitting the .loc directives.
1409 * offlineasm/arm.rb:
1410 * offlineasm/arm64.rb:
1411 * offlineasm/asm.rb:
1412 * offlineasm/backends.rb:
1413 * offlineasm/config.rb:
1414 * offlineasm/parser.rb:
1415 * offlineasm/x86.rb:
1417 2016-02-12 Saam barati <sbarati@apple.com>
1419 The parser doesn't properly protect against global variable references in builtins
1420 https://bugs.webkit.org/show_bug.cgi?id=154144
1422 Reviewed by Geoffrey Garen.
1424 This patch fixes our global variable reference detection
1425 algorithm that was broken. After fixing the algorithm, I
1426 detected many places where we were incorrectly using global
1427 variables. I've fixed all those.
1429 * builtins/BuiltinExecutables.cpp:
1430 (JSC::createExecutableInternal):
1431 * builtins/NumberPrototype.js:
1433 * builtins/PromiseConstructor.js:
1438 (JSC::ProgramNode::ProgramNode):
1439 (JSC::ModuleProgramNode::ModuleProgramNode):
1440 (JSC::ProgramNode::setClosedVariables): Deleted.
1442 (JSC::ScopeNode::setClosedVariables): Deleted.
1443 (JSC::ProgramNode::closedVariables): Deleted.
1444 * parser/Parser.cpp:
1445 (JSC::Parser<LexerType>::parseInner):
1446 (JSC::Parser<LexerType>::didFinishParsing):
1448 (JSC::Scope::setIsLexicalScope):
1449 (JSC::Scope::isLexicalScope):
1450 (JSC::Scope::closedVariableCandidates):
1451 (JSC::Scope::declaredVariables):
1452 (JSC::Scope::lexicalVariables):
1453 (JSC::Scope::finalizeLexicalEnvironment):
1454 (JSC::Parser::positionBeforeLastNewline):
1455 (JSC::Parser::locationBeforeLastToken):
1456 (JSC::Parser::isFunctionMetadataNode):
1458 (JSC::Parser::closedVariables): Deleted.
1460 2016-02-12 Filip Pizlo <fpizlo@apple.com>
1462 JSObject::putByIndexBeyondVectorLengthWithoutAttributes needs to go to the sparse map based on MAX_STORAGE_VECTOR_INDEX
1463 https://bugs.webkit.org/show_bug.cgi?id=154201
1464 rdar://problem/24291387
1466 Reviewed by Saam Barati.
1468 I decided against adding a test for this, because it runs for a very long time.
1470 * runtime/JSObject.cpp:
1471 (JSC::JSObject::putByIndexBeyondVectorLengthWithoutAttributes): Fix the bug.
1472 * runtime/StringPrototype.cpp:
1473 (JSC::stringProtoFuncSplit): Fix a related bug: if this code creates an array that would have
1474 hit the above bug, then it would probably manifest as a spin or as swapping.
1476 2016-02-12 Jonathan Davis <jond@apple.com>
1478 Add WebAssembly to the status page
1479 https://bugs.webkit.org/show_bug.cgi?id=154199
1481 Reviewed by Timothy Hatcher.
1485 2016-02-12 Brian Burg <bburg@apple.com>
1487 Web Inspector: disambiguate the various identifier and connection types in RemoteInspector
1488 https://bugs.webkit.org/show_bug.cgi?id=154130
1490 Reviewed by Joseph Pecoraro.
1492 There are multiple identifier types:
1493 - connection identifier, a string UUID for a remote debugger process.
1494 - session identifier, a string UUID for a remote driver/debugger instance.
1495 - page/target identifier, a number unique within a single process.
1497 There are multiple connection types:
1498 - RemoteInspectorXPCConnection, a connection from RemoteInspectorXPCConnectionor to a relay.
1499 - RemoteConnectionToTarget, a class that bridges to targets' dispatch queues.
1501 Use consistent variable and getter names so that these don't get confused and
1502 so that the code is easier to read. This is especially an improvement when working
1503 with multiple target types or connection types within the same function.
1505 * inspector/remote/RemoteConnectionToTarget.h:
1506 * inspector/remote/RemoteConnectionToTarget.mm:
1507 Remove the member for m_identifier since we can ask the target for its target identifier
1508 or use a default value via WTF::Optional. There's no reason to cache the value.
1510 (Inspector::RemoteTargetHandleRunSourceWithInfo):
1511 (Inspector::RemoteConnectionToTarget::targetIdentifier):
1512 (Inspector::RemoteConnectionToTarget::destination):
1513 (Inspector::RemoteConnectionToTarget::setup):
1514 (Inspector::RemoteConnectionToTarget::sendMessageToFrontend):
1515 Bail out if the target pointer was somehow cleared and we can't get a useful target identifier.
1517 (Inspector::RemoteConnectionToTarget::RemoteConnectionToTarget): Deleted.
1518 * inspector/remote/RemoteControllableTarget.h:
1519 * inspector/remote/RemoteInspectionTarget.cpp:
1520 (Inspector::RemoteInspectionTarget::pauseWaitingForAutomaticInspection):
1521 (Inspector::RemoteInspectionTarget::unpauseForInitializedInspector):
1522 * inspector/remote/RemoteInspector.h:
1523 * inspector/remote/RemoteInspector.mm:
1524 (Inspector::RemoteInspector::nextAvailableTargetIdentifier):
1525 (Inspector::RemoteInspector::registerTarget):
1526 (Inspector::RemoteInspector::unregisterTarget):
1527 (Inspector::RemoteInspector::updateTarget):
1528 (Inspector::RemoteInspector::updateAutomaticInspectionCandidate):
1529 (Inspector::RemoteInspector::sendAutomaticInspectionCandidateMessage):
1530 (Inspector::RemoteInspector::sendMessageToRemote):
1531 (Inspector::RemoteInspector::setupFailed):
1532 (Inspector::RemoteInspector::setupCompleted):
1533 (Inspector::RemoteInspector::stopInternal):
1534 (Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
1535 (Inspector::RemoteInspector::xpcConnectionFailed):
1536 (Inspector::RemoteInspector::listingForInspectionTarget):
1537 (Inspector::RemoteInspector::listingForAutomationTarget):
1538 (Inspector::RemoteInspector::pushListingsNow):
1539 (Inspector::RemoteInspector::pushListingsSoon):
1540 (Inspector::RemoteInspector::updateHasActiveDebugSession):
1541 (Inspector::RemoteInspector::receivedSetupMessage):
1542 (Inspector::RemoteInspector::receivedDataMessage):
1543 (Inspector::RemoteInspector::receivedDidCloseMessage):
1544 (Inspector::RemoteInspector::receivedIndicateMessage):
1545 (Inspector::RemoteInspector::receivedProxyApplicationSetupMessage):
1546 (Inspector::RemoteInspector::receivedConnectionDiedMessage):
1547 (Inspector::RemoteInspector::receivedAutomaticInspectionRejectMessage):
1548 (Inspector::RemoteInspector::nextAvailableIdentifier): Deleted.
1549 * inspector/remote/RemoteInspectorConstants.h:
1551 2016-02-12 Benjamin Poulain <benjamin@webkit.org>
1553 [JSC] On x86, improve the selection of which value are selected for the UseDef part of commutative operations
1554 https://bugs.webkit.org/show_bug.cgi?id=154151
1556 Reviewed by Filip Pizlo.
1558 Previously, when an instruction destroy an argument with
1559 a UseDef use, we would try to pick a good target for the UseDef
1560 while doing instruction selection.
1572 The choice of which value ends up copied is done by preferRightForResult()
1575 There are two common problems with the code we generate:
1576 1) It is based on UseCount. If a value is at its last use,
1577 it is a good target for coalescing even with a use-count > 1.
1578 2) When both values are at their last use, the best choice
1579 depends on the register pressure of each. We don't have that information
1580 until we do register allocation.
1582 This patch implements a simple idea to minimize how many of those Moves are needed.
1583 Each commutative operation gets a 3 op variant. The register allocator then attempts
1584 to alias *both* of them to the destination.
1585 Since our aliasing is conservative, it removes as many copy as possible without causing
1588 There was an unexpected cool impovement too. If you have:
1590 BranchAdd32 Tmp3, Tmp2
1591 we would previously restore Tmp2 by substracting Tmp3 from the result.
1592 We can now just use Tmp1. That removes quite a few Sub from the slow paths.
1594 The problem is that simple idea uncoverred a bunch of issues that had to be fixed too.
1595 I detail them inline below.
1597 * assembler/MacroAssemblerARM64.h:
1598 (JSC::MacroAssemblerARM64::and64):
1599 * assembler/MacroAssemblerX86Common.h:
1600 Most addition are adding an Address version of the 3 operands opcodes.
1601 The reason for this is allow the complex addressing forms of instructions
1604 (JSC::MacroAssemblerX86Common::and32):
1605 (JSC::MacroAssemblerX86Common::mul32):
1606 (JSC::MacroAssemblerX86Common::or32):
1607 (JSC::MacroAssemblerX86Common::xor32):
1608 (JSC::MacroAssemblerX86Common::moveDouble):
1609 This was an unexpected discovery: removing tons of Move32 made floating-point heavy
1612 It turns out the MoveDouble we were using has partial register dependencies.
1614 The x86 optimization manual, Chapter 3, section 3.4.1.13 lists the move instructions executed
1615 directly on the frontend. That's what we use now.
1617 (JSC::MacroAssemblerX86Common::addDouble):
1618 (JSC::MacroAssemblerX86Common::addFloat):
1619 (JSC::MacroAssemblerX86Common::mulDouble):
1620 (JSC::MacroAssemblerX86Common::mulFloat):
1621 (JSC::MacroAssemblerX86Common::andDouble):
1622 (JSC::MacroAssemblerX86Common::andFloat):
1623 (JSC::MacroAssemblerX86Common::xorDouble):
1624 (JSC::MacroAssemblerX86Common::xorFloat):
1625 If the destination is not aliased, the version taking an address
1626 use LoadFloat/LoadDouble instead of direct addressing.
1628 That is because this:
1634 (sometimes significantly).
1636 I am not exactly sure why.
1638 (JSC::MacroAssemblerX86Common::branchAdd32):
1639 * assembler/MacroAssemblerX86_64.h:
1640 (JSC::MacroAssemblerX86_64::and64):
1641 * assembler/MacroAssemblerARM64.h:
1642 (JSC::MacroAssemblerARM64::and64):
1643 * assembler/MacroAssemblerX86Common.h:
1644 (JSC::MacroAssemblerX86Common::and32):
1645 (JSC::MacroAssemblerX86Common::mul32):
1646 (JSC::MacroAssemblerX86Common::or32):
1647 (JSC::MacroAssemblerX86Common::xor32):
1648 (JSC::MacroAssemblerX86Common::moveDouble):
1649 (JSC::MacroAssemblerX86Common::addDouble):
1650 (JSC::MacroAssemblerX86Common::addFloat):
1651 (JSC::MacroAssemblerX86Common::mulDouble):
1652 (JSC::MacroAssemblerX86Common::mulFloat):
1653 (JSC::MacroAssemblerX86Common::andDouble):
1654 (JSC::MacroAssemblerX86Common::andFloat):
1655 (JSC::MacroAssemblerX86Common::xorDouble):
1656 (JSC::MacroAssemblerX86Common::xorFloat):
1657 (JSC::MacroAssemblerX86Common::branchAdd32):
1658 * assembler/MacroAssemblerX86_64.h:
1659 (JSC::MacroAssemblerX86_64::and64):
1660 (JSC::MacroAssemblerX86_64::mul64):
1661 (JSC::MacroAssemblerX86_64::xor64):
1662 (JSC::MacroAssemblerX86_64::branchAdd64):
1663 * assembler/X86Assembler.h:
1664 (JSC::X86Assembler::movapd_rr):
1665 (JSC::X86Assembler::movaps_rr):
1666 * b3/B3CheckSpecial.cpp:
1667 (JSC::B3::CheckSpecial::shouldTryAliasingDef):
1668 (JSC::B3::CheckSpecial::generate):
1669 * b3/B3CheckSpecial.h:
1670 * b3/B3LowerToAir.cpp:
1671 (JSC::B3::Air::LowerToAir::lower):
1672 * b3/air/AirCustom.h:
1673 (JSC::B3::Air::PatchCustom::shouldTryAliasingDef):
1675 * b3/air/AirInstInlines.h:
1676 (JSC::B3::Air::Inst::shouldTryAliasingDef):
1677 * b3/air/AirIteratedRegisterCoalescing.cpp:
1678 Aliasing the operands is done the same way as any coalescing.
1680 There were problem with considering all those coalescing
1681 as equivalent for the result.
1683 Moves are mostly generated for Upsilon-Phis. Getting rid of
1684 those tends to give better loops.
1686 Sometimes, blocks have only Phis and a Jump. Coalescing
1687 those moves gets rids of the block entirely.
1689 Where it go interesting was that something like:
1692 was significantly better than:
1695 even in the same basic block.
1697 To get back to the same performance when, I had to prioritize
1698 regular Moves operations over argument coalescing.
1700 Another argument for doing this is that the alias has a shorter
1701 life in the hardware because the operation itself gets a new
1702 virtual register from the bank.
1704 * b3/air/AirOpcode.opcodes:
1705 * b3/air/AirSpecial.cpp:
1706 (JSC::B3::Air::Special::shouldTryAliasingDef):
1707 * b3/air/AirSpecial.h:
1709 (JSC::B3::testCheckAddArgumentAliasing64):
1710 (JSC::B3::testCheckAddArgumentAliasing32):
1711 (JSC::B3::testCheckAddSelfOverflow64):
1712 (JSC::B3::testCheckAddSelfOverflow32):
1713 (JSC::B3::testCheckMulArgumentAliasing64):
1714 (JSC::B3::testCheckMulArgumentAliasing32):
1717 * dfg/DFGOSRExitCompilerCommon.cpp:
1718 (JSC::DFG::reifyInlinedCallFrames):
1719 * jit/AssemblyHelpers.h:
1720 (JSC::AssemblyHelpers::emitSaveOrCopyCalleeSavesFor):
1721 This ruined my week.
1723 When regenerating the frame of an inlined function that
1724 was called through a tail call, we were ignoring r13 for some reason.
1726 Since this patch makes it more likely to increase the degree
1727 of each Tmp, the number of register used increased and r13 was more
1730 When getting out of OSRExit, we would have that value trashed :(
1732 The fix is simply to restore it like the other two Baseline callee saved
1735 2016-02-12 Yusuke Suzuki <utatane.tea@gmail.com>
1737 [ES6] Implement @@search
1738 https://bugs.webkit.org/show_bug.cgi?id=143889
1740 Reviewed by Darin Adler.
1742 Implement RegExp.prototype[@@search].
1743 In ES6, String.prototype.search delegates the actual matching to it
1744 instead of executing RegExp matching inside String.prototype.search method itself.
1745 By customizing @@search method, we can change the behavior of String.prototype.search for
1746 derived / customized RegExp object.
1749 * DerivedSources.make:
1750 * builtins/BuiltinNames.h:
1751 (JSC::BuiltinNames::BuiltinNames): Deleted.
1752 * builtins/BuiltinUtils.h:
1753 * builtins/StringPrototype.js:
1755 * bytecode/BytecodeIntrinsicRegistry.cpp:
1756 (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
1757 * bytecode/BytecodeIntrinsicRegistry.h:
1758 * runtime/CommonIdentifiers.h:
1759 * runtime/JSGlobalObject.cpp:
1760 (JSC::JSGlobalObject::init):
1761 * runtime/RegExpPrototype.cpp:
1762 (JSC::RegExpPrototype::finishCreation):
1763 (JSC::regExpProtoFuncSearch):
1764 * runtime/RegExpPrototype.h:
1765 (JSC::RegExpPrototype::create):
1766 * runtime/StringPrototype.cpp:
1767 (JSC::StringPrototype::getOwnPropertySlot):
1768 (JSC::StringPrototype::finishCreation): Deleted.
1769 (JSC::stringProtoFuncSearch): Deleted.
1770 * runtime/StringPrototype.h:
1772 * tests/stress/regexp-search.js: Added.
1775 (errorKey.toString):
1776 (primitive.of.primitives.shouldThrow):
1782 2016-02-12 Keith Miller <keith_miller@apple.com>
1784 AdaptiveInferredPropertyValueWatchpoint can trigger a GC that frees its CodeBlock and thus itself
1785 https://bugs.webkit.org/show_bug.cgi?id=154146
1787 Reviewed by Filip Pizlo.
1789 Consider the following: there is some CodeBlock, C, that is watching some object, O, with a
1790 structure, S, for replacements. Also, suppose that C has no references anymore and is due to
1791 be GCed. Now, when some new property is added to O, S will create a new structure S' and
1792 fire its transition watchpoints. Since C is watching S for replacements it will attempt to
1793 have its AdaptiveInferredPropertyValueWatchpoint relocate itself to S'. To do so, it needs
1794 it allocate RareData on S'. This allocation may cause a GC, which frees C while still
1795 executing its watchpoint handler. The solution to this is to defer GC while running
1796 AdaptiveInferredPropertyValueWatchpointBase handlers.
1798 * bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp:
1799 (JSC::AdaptiveInferredPropertyValueWatchpointBase::fire):
1801 2016-02-12 Gavin Barraclough <barraclough@apple.com>
1803 Separate out !allowsAccess path in JSDOMWindowCustom getOwnPropertySlot
1804 https://bugs.webkit.org/show_bug.cgi?id=154156
1806 Reviewed by Chris Dumez.
1808 * runtime/CommonIdentifiers.h:
1809 - added new property names, needed by jsDOMWindowGetOwnPropertySlotDisallowAccess.
1811 2016-02-12 Sukolsak Sakshuwong <sukolsak@gmail.com>
1813 Update ICU header files to version 52
1814 https://bugs.webkit.org/show_bug.cgi?id=154160
1816 Reviewed by Alex Christensen.
1818 Update ICU header files to version 52 to allow the use of newer APIs.
1820 * icu/unicode/localpointer.h:
1821 * icu/unicode/platform.h:
1822 * icu/unicode/ptypes.h:
1823 * icu/unicode/putil.h:
1824 * icu/unicode/ucal.h:
1825 * icu/unicode/uchar.h:
1826 * icu/unicode/ucnv.h:
1827 * icu/unicode/ucol.h:
1828 * icu/unicode/uconfig.h:
1829 * icu/unicode/udat.h:
1830 * icu/unicode/udatpg.h:
1831 * icu/unicode/udisplaycontext.h: Added.
1832 * icu/unicode/uenum.h:
1833 * icu/unicode/uformattable.h: Added.
1834 * icu/unicode/uiter.h:
1835 * icu/unicode/uloc.h:
1836 * icu/unicode/umachine.h:
1837 * icu/unicode/unorm2.h:
1838 * icu/unicode/unum.h:
1839 * icu/unicode/urename.h:
1840 * icu/unicode/uscript.h:
1841 * icu/unicode/uset.h:
1842 * icu/unicode/ustring.h:
1843 * icu/unicode/utf.h:
1844 * icu/unicode/utf16.h:
1845 * icu/unicode/utf8.h:
1846 * icu/unicode/utf_old.h:
1847 * icu/unicode/utypes.h:
1848 * icu/unicode/uvernum.h:
1849 * icu/unicode/uversion.h:
1851 2016-02-12 Filip Pizlo <fpizlo@apple.com>
1853 Fast path in JSObject::defineOwnIndexedProperty() forgets to check for the posibility of a descriptor that doesn't have a value
1854 https://bugs.webkit.org/show_bug.cgi?id=154175
1855 rdar://problem/24291497
1857 Reviewed by Geoffrey Garen.
1859 * runtime/JSObject.cpp:
1860 (JSC::JSObject::defineOwnIndexedProperty): Fix the bug.
1861 * runtime/SparseArrayValueMap.cpp:
1862 (JSC::SparseArrayValueMap::putEntry): Catch the bug sooner in debug.
1863 (JSC::SparseArrayValueMap::putDirect):
1864 * tests/stress/sparse-define-empty-descriptor.js: Added. This used to crash in release.
1866 2016-02-11 Brian Burg <bburg@apple.com>
1868 Web Inspector: RemoteInspector's listings should include whether an AutomationTarget is paired
1869 https://bugs.webkit.org/show_bug.cgi?id=154077
1870 <rdar://problem/24589133>
1872 Reviewed by Joseph Pecoraro.
1874 Instead of not generating a listing for the target when it is occupied,
1875 generate the listing with a 'paired' flag. The old flag was redundant
1876 because a _WKAutomationDelegate will not create a session if it doesn't
1877 support automation or it already has an active session.
1879 * inspector/remote/RemoteAutomationTarget.cpp:
1880 (Inspector::RemoteAutomationTarget::setIsPaired):
1881 (Inspector::RemoteAutomationTarget::setAutomationAllowed): Deleted.
1882 * inspector/remote/RemoteAutomationTarget.h:
1883 Return false for remoteControlAllowed() if the target is already paired.
1884 This function is used by RemoteInspector to deny incoming connections.
1886 * inspector/remote/RemoteInspector.mm:
1887 (Inspector::RemoteInspector::listingForAutomationTarget):
1888 * inspector/remote/RemoteInspectorConstants.h:
1890 2016-02-11 Filip Pizlo <fpizlo@apple.com>
1892 DFG::ByteCodeParser needs to null check the result of presenceLike()
1893 https://bugs.webkit.org/show_bug.cgi?id=154135
1894 rdar://problem/24291586
1896 Reviewed by Geoffrey Garen.
1898 ByteCodeParser::presenceLike() could return a null object property condition if it detects a
1899 contradiction. That could happen due to bogus profiling. It's totally OK - we just need to
1900 bail from using a property condition when that happens.
1902 * bytecode/ObjectPropertyCondition.h:
1903 (JSC::ObjectPropertyCondition::equivalence):
1904 (JSC::ObjectPropertyCondition::operator bool):
1905 (JSC::ObjectPropertyCondition::object):
1906 (JSC::ObjectPropertyCondition::condition):
1907 (JSC::ObjectPropertyCondition::operator!): Deleted.
1908 * bytecode/PropertyCondition.h:
1909 (JSC::PropertyCondition::equivalence):
1910 (JSC::PropertyCondition::operator bool):
1911 (JSC::PropertyCondition::kind):
1912 (JSC::PropertyCondition::uid):
1913 (JSC::PropertyCondition::operator!): Deleted.
1914 * dfg/DFGByteCodeParser.cpp:
1915 (JSC::DFG::ByteCodeParser::check):
1916 (JSC::DFG::ByteCodeParser::load):
1918 2016-02-11 Benjamin Poulain <benjamin@webkit.org>
1920 [JSC] SqrtFloat and CeilFloat also suffer from partial register stalls
1921 https://bugs.webkit.org/show_bug.cgi?id=154131
1923 Reviewed by Filip Pizlo.
1925 Looks like I forgot to update this when adding Float support.
1926 Credit to Filip for finding this issue.
1928 * b3/air/AirFixPartialRegisterStalls.cpp:
1930 2016-02-11 Filip Pizlo <fpizlo@apple.com>
1932 Cannot call initializeIndex() if we didn't create the array using tryCreateUninitialized()
1933 https://bugs.webkit.org/show_bug.cgi?id=154126
1935 Reviewed by Saam Barati.
1937 * runtime/ArrayPrototype.cpp:
1938 (JSC::arrayProtoFuncSplice):
1940 2016-02-11 Sukolsak Sakshuwong <sukolsak@gmail.com>
1942 [INTL] Implement Intl.NumberFormat.prototype.resolvedOptions ()
1943 https://bugs.webkit.org/show_bug.cgi?id=147602
1945 Reviewed by Darin Adler.
1947 This patch implements Intl.NumberFormat.prototype.resolvedOptions() according
1948 to the ECMAScript 2015 Internationalization API spec (ECMA-402 2nd edition.)
1950 * runtime/IntlDateTimeFormat.cpp:
1952 * runtime/IntlNumberFormat.cpp:
1954 (JSC::computeCurrencySortKey):
1955 (JSC::extractCurrencySortKey):
1956 (JSC::computeCurrencyDigits):
1957 (JSC::IntlNumberFormat::initializeNumberFormat):
1958 (JSC::IntlNumberFormat::styleString):
1959 (JSC::IntlNumberFormat::currencyDisplayString):
1960 (JSC::IntlNumberFormat::resolvedOptions):
1961 (JSC::IntlNumberFormat::setBoundFormat):
1962 * runtime/IntlNumberFormat.h:
1963 * runtime/IntlNumberFormatConstructor.cpp:
1964 (JSC::constructIntlNumberFormat):
1965 (JSC::callIntlNumberFormat):
1966 * runtime/IntlNumberFormatPrototype.cpp:
1967 (JSC::IntlNumberFormatPrototypeFuncResolvedOptions):
1968 * runtime/IntlObject.cpp:
1969 (JSC::intlNumberOption):
1970 (JSC::numberingSystemsForLocale):
1971 (JSC::getNumberingSystemsForLocale): Deleted.
1972 * runtime/IntlObject.h:
1974 2016-02-11 Filip Pizlo <fpizlo@apple.com>
1976 MacroAssemblerX86 should be happy with shift(cx, cx)
1977 https://bugs.webkit.org/show_bug.cgi?id=154124
1979 Reviewed by Saam Barati.
1981 Prior to this change the assembler asserted that shift_amount and dest cannot be the same.
1982 That's a good assertion for when shift_amount is not in cx. But if it's in cx already then
1983 it's OK for them to be the same. Air will sometimes do shift(cx, cx) if you do "x << x" and
1984 the coalescing got particularly clever.
1986 * assembler/MacroAssemblerX86Common.h:
1987 (JSC::MacroAssemblerX86Common::lshift32):
1988 (JSC::MacroAssemblerX86Common::rshift32):
1989 (JSC::MacroAssemblerX86Common::urshift32):
1990 * assembler/MacroAssemblerX86_64.h:
1991 (JSC::MacroAssemblerX86_64::lshift64):
1992 (JSC::MacroAssemblerX86_64::rshift64):
1993 (JSC::MacroAssemblerX86_64::urshift64):
1995 (JSC::B3::testLShiftSelf32):
1996 (JSC::B3::testRShiftSelf32):
1997 (JSC::B3::testURShiftSelf32):
1998 (JSC::B3::testLShiftSelf64):
1999 (JSC::B3::testRShiftSelf64):
2000 (JSC::B3::testURShiftSelf64):
2003 2016-02-11 Saam barati <sbarati@apple.com>
2005 The sampling profiler's stack walker methods should be marked with SUPPRESS_ASAN
2006 https://bugs.webkit.org/show_bug.cgi?id=154123
2008 Reviewed by Mark Lam.
2010 The entire premise of the sampling profiler is to load from
2011 another thread's memory. We should SUPPRESS_ASAN on the
2012 methods that do this.
2014 * runtime/SamplingProfiler.cpp:
2015 (JSC::FrameWalker::FrameWalker):
2016 (JSC::FrameWalker::walk):
2017 (JSC::FrameWalker::advanceToParentFrame):
2018 (JSC::FrameWalker::isAtTop):
2019 (JSC::FrameWalker::resetAtMachineFrame):
2021 2016-02-11 Csaba Osztrogonác <ossy@webkit.org>
2023 Unreviewed typo fix after r190063.
2025 * dfg/DFGSpeculativeJIT.cpp: Removed property svn:executable.
2026 * dfg/DFGSpeculativeJIT.h: Removed property svn:executable.
2027 * jit/JIT.h: Removed property svn:executable.
2028 * jit/JITInlines.h: Removed property svn:executable.
2029 * jit/JITOpcodes.cpp: Removed property svn:executable.
2031 2016-02-11 Csaba Osztrogonác <ossy@webkit.org>
2033 Unreviewed typo fix after r190063.
2035 * dfg/DFGSpeculativeJIT.cpp: Removed property svn:executable.
2036 * dfg/DFGSpeculativeJIT.h: Removed property svn:executable.
2037 * jit/JIT.h: Removed property svn:executable.
2038 * jit/JITInlines.h: Removed property svn:executable.
2039 * jit/JITOpcodes.cpp: Removed property svn:executable.
2041 2016-02-10 Keith Miller <keith_miller@apple.com>
2043 Symbol.species accessors on builtin constructors should be configurable
2044 https://bugs.webkit.org/show_bug.cgi?id=154097
2046 Reviewed by Benjamin Poulain.
2048 We did not have the Symbol.species accessors on our builtin constructors
2049 marked as configurable. This does not accurately follow the ES6 spec as
2050 the ES6 spec states that all default accessors on builtins should be
2051 configurable. This means that we need an additional watchpoint on
2052 ArrayConstructor to make sure that no users re-configures Symbol.species.
2054 * runtime/ArrayConstructor.cpp:
2055 (JSC::ArrayConstructor::finishCreation):
2056 * runtime/ArrayPrototype.cpp:
2057 (JSC::speciesConstructArray):
2058 (JSC::ArrayPrototype::setConstructor):
2059 (JSC::ArrayPrototypeAdaptiveInferredPropertyWatchpoint::handleFire):
2060 * runtime/ArrayPrototype.h:
2061 (JSC::ArrayPrototype::didChangeConstructorOrSpeciesProperties):
2062 (JSC::ArrayPrototype::didChangeConstructorProperty): Deleted.
2063 * runtime/JSArrayBufferConstructor.cpp:
2064 (JSC::JSArrayBufferConstructor::finishCreation):
2065 * runtime/JSPromiseConstructor.cpp:
2066 (JSC::JSPromiseConstructor::finishCreation):
2067 * runtime/JSTypedArrayViewConstructor.cpp:
2068 (JSC::JSTypedArrayViewConstructor::finishCreation):
2069 * runtime/MapConstructor.cpp:
2070 (JSC::MapConstructor::finishCreation):
2071 * runtime/RegExpConstructor.cpp:
2072 (JSC::RegExpConstructor::finishCreation):
2073 * runtime/SetConstructor.cpp:
2074 (JSC::SetConstructor::finishCreation):
2075 * tests/stress/array-species-config-array-constructor.js: Added.
2077 * tests/stress/symbol-species.js:
2078 (testSymbolSpeciesOnConstructor):
2080 2016-02-10 Benjamin Poulain <benjamin@webkit.org>
2082 [JSC] The destination of Sqrt should be Def, not UseDef
2083 https://bugs.webkit.org/show_bug.cgi?id=154086
2085 Reviewed by Geoffrey Garen.
2087 An unfortunate copy-paste: the destination of SqrtDouble and SqrtFloat
2088 was defined as UseDef. As a result, the argument would be interfering
2089 with everything defined prior.
2091 * b3/air/AirOpcode.opcodes:
2093 2016-02-10 Chris Dumez <cdumez@apple.com>
2095 [Web IDL] interface objects should be Function objects
2096 https://bugs.webkit.org/show_bug.cgi?id=154038
2097 <rdar://problem/24569358>
2099 Reviewed by Geoffrey Garen.
2101 Update functionProtoFuncToString() to handle JSObjects that
2102 have the TypeOfShouldCallGetCallData flag and are callable,
2103 as these behave like functions and use ClassInfo::className()
2104 as function name in this case.
2106 * runtime/FunctionPrototype.cpp:
2107 (JSC::functionProtoFuncToString):
2109 2016-02-10 Chris Dumez <cdumez@apple.com>
2111 Attributes on the Window instance should be configurable unless [Unforgeable]
2112 https://bugs.webkit.org/show_bug.cgi?id=153920
2113 <rdar://problem/24563211>
2115 Reviewed by Darin Adler.
2117 Marking the Window instance attributes as configurable but cause
2118 getOwnPropertyDescriptor() to report them as configurable, as
2119 expected. However, trying to delete them would actually lead to
2120 unexpected behavior because:
2121 - We did not reify custom accessor properties (most of the Window
2122 properties are custom accessors) upon deletion.
2123 - For non-reified static properties marked as configurable,
2124 JSObject::deleteProperty() would attempt to call the property
2125 setter with undefined. As a result, calling delete window.name
2126 would cause window.name to become the string "undefined" instead
2127 of the undefined value.
2129 * runtime/JSObject.cpp:
2130 (JSC::getClassPropertyNames):
2131 Now that we reify ALL properties, we only need to check the property table
2132 if we have not reified. As a result, I dropped the 'didReify' parameter for
2133 this function and instead only call this function if we have not yet reified.
2135 (JSC::JSObject::putInlineSlow):
2136 Only call putEntry() if we have not reified: Drop the
2137 '|| !(entry->attributes() & BuiltinOrFunctionOrAccessor)'
2138 check as such properties now get reified as well.
2140 (JSC::JSObject::deleteProperty):
2141 - Call reifyAllStaticProperties() instead of reifyStaticFunctionsForDelete()
2142 so that we now reify all properties upon deletion, including the custom
2143 accessors. reifyStaticFunctionsForDelete() is now removed and the same
2144 reification function is now used by: deletion, getOwnPropertyDescriptor()
2145 and eager reification of the prototype objects in the bindings.
2146 - Drop code that falls back to calling the static property setter with
2147 undefined if we cannot find the property in the property storage. As
2148 we now reify ALL properties, the code removing the property from the
2149 property storage should succeed, provided that the property actually
2152 (JSC::JSObject::getOwnNonIndexPropertyNames):
2153 Only call getClassPropertyNames() if we have not reified. We should no longer
2154 check the static property table after reifying now that we reify all
2157 (JSC::JSObject::reifyAllStaticProperties):
2158 Merge with reifyStaticFunctionsForDelete(). The only behavior change is the
2159 flattening to an uncacheable dictionary, like reifyStaticFunctionsForDelete()
2162 * runtime/JSObject.h:
2164 2016-02-10 Commit Queue <commit-queue@webkit.org>
2166 Unreviewed, rolling out r196251.
2167 https://bugs.webkit.org/show_bug.cgi?id=154078
2169 Large regression on Dromaeo needs explanation (Requested by
2174 "Visiting a WeakBlock should report bytes visited, since we
2175 reported them allocated."
2176 https://bugs.webkit.org/show_bug.cgi?id=153978
2177 http://trac.webkit.org/changeset/196251
2179 2016-02-10 Csaba Osztrogonác <ossy@webkit.org>
2181 REGRESSION(r196331): It made ~180 JSC tests crash on ARMv7 Linux
2182 https://bugs.webkit.org/show_bug.cgi?id=154064
2184 Reviewed by Mark Lam.
2186 * bytecode/PolymorphicAccess.cpp:
2187 (JSC::AccessCase::generate): Added EABI_32BIT_DUMMY_ARG where it is necessary.
2188 * dfg/DFGSpeculativeJIT.h: Fixed the comment.
2189 * jit/CCallHelpers.h:
2190 (JSC::CCallHelpers::setupArgumentsWithExecState): Added.
2191 * wasm/WASMFunctionCompiler.h: Fixed the comment.
2193 2016-02-09 Keith Miller <keith_miller@apple.com>
2195 calling methods off super in a class constructor should check for TDZ
2196 https://bugs.webkit.org/show_bug.cgi?id=154060
2198 Reviewed by Ryosuke Niwa.
2200 In a class constructor we need to check for TDZ when calling a method
2201 off the super class. This is because, for super method calls, we use
2202 the derived class's newly constructed object as the super method's
2205 * bytecompiler/NodesCodegen.cpp:
2206 (JSC::FunctionCallDotNode::emitBytecode):
2207 * tests/stress/super-method-calls-check-tdz.js: Added.
2212 2016-02-09 Filip Pizlo <fpizlo@apple.com>
2214 Don't crash if we fail to parse a builtin
2215 https://bugs.webkit.org/show_bug.cgi?id=154047
2216 rdar://problem/24300617
2218 Reviewed by Mark Lam.
2220 Crashing probably seemed like a good idea at the time, but we could get here in case of a
2221 near stack overflow, so that the parser bails because of recursion.
2226 2016-02-07 Gavin Barraclough <barraclough@apple.com>
2228 GetValueFunc/PutValueFunc should not take both slotBase and thisValue
2229 https://bugs.webkit.org/show_bug.cgi?id=154009
2231 Reviewed by Geoff Garen.
2233 In JavaScript there are two types of properties - regular value properties, and accessor properties.
2234 One difference between these is how they are reflected by getOwnPropertyDescriptor, and another is
2235 what object they operate on in the case of a prototype access. If you access a value property of a
2236 prototype object it return a value pertinent to the prototype, but in the case of a prototype object
2237 returning an accessor, then the accessor function is applied to the base object of the access.
2239 JSC supports special 'custom' properties implemented as a c++ callback, and these custom properties
2240 can be used to implement either value- or accessor-like behavior. getOwnPropertyDescriptor behavior
2241 is selected via the CustomAccessor attribute. Value- or accessor-like object selection is current
2242 supported by passing both the slotBase and the thisValue to the callback,and hoping it uses the
2243 right one. This is probably inefficient, bug-prone, and leads to crazy like JSBoundSlotBaseFunction.
2245 Instead, just pass one thisValue to the callback functions, consistent with CustomAccessor.
2247 * API/JSCallbackObject.h:
2248 * API/JSCallbackObjectFunctions.h:
2249 (JSC::JSCallbackObject<Parent>::getStaticValue):
2250 (JSC::JSCallbackObject<Parent>::staticFunctionGetter):
2251 (JSC::JSCallbackObject<Parent>::callbackGetter):
2252 - Merged slotBase & thisValue to custom property callbacks.
2253 * bytecode/PolymorphicAccess.cpp:
2254 (JSC::AccessCase::generate):
2255 - Modified the call being JIT generated - GetValueFunc/PutValueFunc now only take 3,
2256 rather than 4 arguments. Selects which one to keep/drop based on access type.
2257 (WTF::printInternal):
2258 * bytecode/PolymorphicAccess.h:
2259 (JSC::AccessCase::isGet):
2260 (JSC::AccessCase::isPut):
2261 (JSC::AccessCase::isIn):
2262 (JSC::AccessCase::doesCalls):
2263 (JSC::AccessCase::isGetter):
2264 * bytecode/PutByIdStatus.cpp:
2265 (JSC::PutByIdStatus::computeForStubInfo):
2267 (JSC::tryCacheGetByID):
2268 (JSC::tryCachePutByID):
2269 - Split the CustomGetter/Setter access types into Value/Accessor variants.
2271 (WTF::CustomGetter::getOwnPropertySlot):
2272 (WTF::CustomGetter::customGetter):
2273 (WTF::RuntimeArray::RuntimeArray):
2274 (WTF::RuntimeArray::lengthGetter):
2275 - Merged slotBase & thisValue to custom property callbacks.
2276 * runtime/CustomGetterSetter.cpp:
2277 (JSC::callCustomSetter):
2278 - Pass 3 arguments when calling PutValueFunc.
2279 * runtime/CustomGetterSetter.h:
2280 * runtime/JSBoundSlotBaseFunction.cpp:
2281 (JSC::boundSlotBaseFunctionCall):
2282 (JSC::JSBoundSlotBaseFunction::JSBoundSlotBaseFunction):
2283 * runtime/JSCJSValue.cpp:
2284 (JSC::JSValue::putToPrimitive):
2285 - callCustomSetter currently takes a flag to distinguish value/accessor calls.
2286 * runtime/JSFunction.cpp:
2287 (JSC::retrieveArguments):
2288 (JSC::JSFunction::argumentsGetter):
2289 (JSC::retrieveCallerFunction):
2290 (JSC::JSFunction::callerGetter):
2291 (JSC::JSFunction::lengthGetter):
2292 (JSC::JSFunction::nameGetter):
2293 * runtime/JSFunction.h:
2294 * runtime/JSModuleNamespaceObject.cpp:
2295 (JSC::JSModuleNamespaceObject::visitChildren):
2296 (JSC::callbackGetter):
2297 - Merged slotBase & thisValue to custom property callbacks.
2298 * runtime/JSObject.cpp:
2299 (JSC::JSObject::putInlineSlow):
2300 - callCustomSetter currently takes a flag to distinguish value/accessor calls.
2303 - split PutPropertySlot setCustom into Value/Accessor variants.
2304 * runtime/PropertySlot.cpp:
2305 (JSC::PropertySlot::functionGetter):
2306 (JSC::PropertySlot::customGetter):
2307 * runtime/PropertySlot.h:
2308 (JSC::PropertySlot::PropertySlot):
2309 (JSC::PropertySlot::getValue):
2310 - added customGetter helper to call GetValueFunc.
2311 * runtime/PutPropertySlot.h:
2312 (JSC::PutPropertySlot::PutPropertySlot):
2313 (JSC::PutPropertySlot::setNewProperty):
2314 (JSC::PutPropertySlot::setCustomValue):
2315 (JSC::PutPropertySlot::setCustomAccessor):
2316 (JSC::PutPropertySlot::setThisValue):
2317 (JSC::PutPropertySlot::customSetter):
2318 (JSC::PutPropertySlot::context):
2319 (JSC::PutPropertySlot::isStrictMode):
2320 (JSC::PutPropertySlot::isCacheablePut):
2321 (JSC::PutPropertySlot::isCacheableSetter):
2322 (JSC::PutPropertySlot::isCacheableCustom):
2323 (JSC::PutPropertySlot::isCustomAccessor):
2324 (JSC::PutPropertySlot::isInitialization):
2325 (JSC::PutPropertySlot::cachedOffset):
2326 (JSC::PutPropertySlot::setCustomProperty): Deleted.
2327 - split PutPropertySlot setCustom into Value/Accessor variants.
2328 * runtime/RegExpConstructor.cpp:
2329 (JSC::RegExpConstructor::getOwnPropertySlot):
2330 (JSC::regExpConstructorDollar1):
2331 (JSC::regExpConstructorDollar2):
2332 (JSC::regExpConstructorDollar3):
2333 (JSC::regExpConstructorDollar4):
2334 (JSC::regExpConstructorDollar5):
2335 (JSC::regExpConstructorDollar6):
2336 (JSC::regExpConstructorDollar7):
2337 (JSC::regExpConstructorDollar8):
2338 (JSC::regExpConstructorDollar9):
2339 (JSC::regExpConstructorInput):
2340 (JSC::regExpConstructorMultiline):
2341 (JSC::regExpConstructorLastMatch):
2342 (JSC::regExpConstructorLastParen):
2343 (JSC::regExpConstructorLeftContext):
2344 (JSC::regExpConstructorRightContext):
2345 (JSC::setRegExpConstructorInput):
2346 (JSC::setRegExpConstructorMultiline):
2347 * runtime/RegExpObject.cpp:
2348 (JSC::RegExpObject::defineOwnProperty):
2349 (JSC::regExpObjectSetLastIndexStrict):
2350 (JSC::regExpObjectSetLastIndexNonStrict):
2351 (JSC::RegExpObject::put):
2352 - Merged slotBase & thisValue to custom property callbacks.
2354 2016-02-09 Filip Pizlo <fpizlo@apple.com>
2356 Spread expressions are not fair game for direct binding
2357 https://bugs.webkit.org/show_bug.cgi?id=154042
2358 rdar://problem/24291413
2360 Reviewed by Saam Barati.
2362 Prior to this change we crashed on this:
2366 Because NodesCodegen thinks that this is a direct binding. It's not, because we cannot
2367 directly generate bytecode for "...y". This is a unique property of spread expressions, so
2368 its sufficient to just bail out of direct binding if we see a spread expression. That's what
2371 * bytecompiler/NodesCodegen.cpp:
2372 (JSC::ArrayPatternNode::emitDirectBinding):
2373 * tests/stress/spread-in-tail.js: Added.
2377 2016-02-09 Commit Queue <commit-queue@webkit.org>
2379 Unreviewed, rolling out r196286.
2380 https://bugs.webkit.org/show_bug.cgi?id=154026
2382 Looks like 5% iOS PLT regression (Requested by kling on
2387 "[iOS] Throw away some unlinked code when navigating to a new
2389 https://bugs.webkit.org/show_bug.cgi?id=154014
2390 http://trac.webkit.org/changeset/196286
2392 2016-02-08 Keith Miller <keith_miller@apple.com>
2394 Error construction for inlined operations should not use the inliner's CodeBlock
2395 https://bugs.webkit.org/show_bug.cgi?id=154021
2397 Reviewed by Mark Lam.
2399 Previously, if one function, A, was inlined into another function, B, in the DFG/FTL
2400 we would use B's DFG/FTL CodeBlock to construct source information about the Error.
2401 We would correctly compute the bytecodeOffset in A for the an expression but we would
2402 not use one of A's CodeBlocks when looking up source. This caused crashes during
2403 operationIn as we expected to be able to find the text "in" in the source.
2405 * runtime/ErrorInstance.cpp:
2406 (JSC::appendSourceToError):
2407 * tests/stress/inlined-error-gets-correct-codeblock-for-bytecodeoffset.js: Added.
2413 2016-02-08 Saam Barati <sbarati@apple.com>
2415 runtimeTypeForValue should protect against seeing TDZ value
2416 https://bugs.webkit.org/show_bug.cgi?id=154023
2417 rdar://problem/24291413
2419 Reviewed by Michael Saboff.
2421 There are a few back traces I've seen from crashes that bottom out
2422 inside runtimeTypeForValue. I haven't been able to reproduce
2423 any such crash, but it's likely that we're encountering the
2424 empty JSValue. It's better to just have this function protect
2425 against seeing the empty value instead of dereferencing a null
2426 pointer when it thinks the value is a cell.
2428 * runtime/RuntimeType.cpp:
2429 (JSC::runtimeTypeForValue):
2431 2016-02-08 Andreas Kling <akling@apple.com>
2433 [iOS] Throw away some unlinked code when navigating to a new page.
2434 <https://webkit.org/b/154014>
2436 Reviewed by Gavin Barraclough.
2439 (JSC::VM::deleteAllCodeExceptCaches):
2440 (JSC::VM::deleteAllLinkedCode): Deleted.
2443 2016-02-08 Filip Pizlo <fpizlo@apple.com>
2445 B3::foldPathConstants() needs to execute its insertion set
2446 https://bugs.webkit.org/show_bug.cgi?id=154020
2448 Reviewed by Saam Barati.
2450 * b3/B3FoldPathConstants.cpp:
2452 (JSC::B3::testFoldPathEqual): Added this. It used to crash in validation.
2455 2016-02-08 Yusuke Suzuki <utatane.tea@gmail.com>
2457 [JSC] Introduce @isObject bytecode intrinsic and use it instead of JS implemented one
2458 https://bugs.webkit.org/show_bug.cgi?id=153976
2460 Reviewed by Darin Adler.
2462 Use bytecode op_is_object directly.
2464 * builtins/GlobalObject.js:
2465 (isObject): Deleted.
2466 * bytecode/BytecodeIntrinsicRegistry.h:
2467 * bytecompiler/NodesCodegen.cpp:
2468 (JSC::BytecodeIntrinsicNode::emit_intrinsic_toString):
2469 (JSC::BytecodeIntrinsicNode::emit_intrinsic_isObject):
2470 * runtime/JSGlobalObject.cpp:
2471 (JSC::JSGlobalObject::init): Deleted.
2473 2016-02-08 Yusuke Suzuki <utatane.tea@gmail.com>
2475 {Map,Set}.prototype.forEach should be visible as own properties
2476 https://bugs.webkit.org/show_bug.cgi?id=153974
2478 Reviewed by Darin Adler.
2480 Now, Map and Set uses builtin tables. We should inlude it in class info.
2482 * runtime/MapPrototype.cpp:
2483 * runtime/SetPrototype.cpp:
2485 2016-02-08 Filip Pizlo <fpizlo@apple.com>
2487 Baseline JIT should not require its input to be constant-propagated
2488 https://bugs.webkit.org/show_bug.cgi?id=154011
2489 rdar://problem/24290933
2491 Reviewed by Mark Lam.
2493 * jit/JITArithmetic.cpp:
2494 (JSC::JIT::emitBitBinaryOpFastPath):
2495 (JSC::JIT::emitRightShiftFastPath):
2496 (JSC::JIT::emit_op_add):
2497 (JSC::JIT::emit_op_div):
2498 (JSC::JIT::emit_op_mul):
2500 2016-02-08 Filip Pizlo <fpizlo@apple.com>
2502 CodeCache should give up on evals if there are variables under TDZ
2503 https://bugs.webkit.org/show_bug.cgi?id=154002
2504 rdar://problem/24300998
2506 Reviewed by Mark Lam.
2508 Disable the code cache optimization because our approach to TDZ for scoped variables - using
2509 a separate check_tdz opcode when logically it's the get_from_scope's job to do it - makes
2510 caching code impossible if there are any variables in TDZ.
2512 We should do the right thing in the future, and fold the TDZ check into the get_from_scope.
2513 This is better not only because it will restore caching, but because our bytecode for heap
2514 accesses is usually at the highest practically doable level of abstraction, so that ICs,
2515 compilers and caches can see the intended meaning of the bytecode more easily.
2517 This doesn't appear to slow anything down, but that's just because we don't have enough ES6
2518 benchmarks. I've filed: https://bugs.webkit.org/show_bug.cgi?id=154010
2520 * runtime/CodeCache.cpp:
2521 (JSC::CodeCache::getGlobalCodeBlock):
2523 2016-02-08 Skachkov Oleksandr <gskachkov@gmail.com>
2525 [ES6] Arrow function syntax. Using 'super' in arrow function that declared out of the class should lead to Syntax error
2526 https://bugs.webkit.org/show_bug.cgi?id=150893
2528 Reviewed by Saam Barati.
2530 'super' and 'super()' inside of the arrow function should lead to syntax error if they are used
2531 out of the class context or they wrapped by ordinary function. Now JSC returns ReferenceError but
2532 should return SyntaxError according to the following specs:
2533 http://www.ecma-international.org/ecma-262/6.0/#sec-function-definitions-static-semantics-early-errors
2534 and http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions-runtime-semantics-evaluation
2535 Curren patch implemented only one case when super/super() are used inside of the arrow function
2536 Case when super/super() are used within the eval:
2539 costructor() { eval("super()");}
2541 is not part of this patch and will be implemented in this issue https://bugs.webkit.org/show_bug.cgi?id=153864.
2542 The same for case when eval with super/super() is invoked in arrow function will be
2543 implemented in issue https://bugs.webkit.org/show_bug.cgi?id=153977.
2545 * parser/Parser.cpp:
2546 (JSC::Parser<LexerType>::parseFunctionInfo):
2548 (JSC::Scope::Scope):
2549 (JSC::Scope::setExpectedSuperBinding):
2550 (JSC::Scope::expectedSuperBinding):
2551 (JSC::Scope::setConstructorKind):
2552 (JSC::Scope::constructorKind):
2553 (JSC::Parser::closestParentNonArrowFunctionNonLexicalScope):
2554 * tests/stress/arrowfunction-lexical-bind-supercall-4.js:
2555 * tests/stress/arrowfunction-lexical-bind-superproperty.js:
2557 2016-02-08 Filip Pizlo <fpizlo@apple.com>
2559 Parser should detect error before calls to parseAssignmentExpression()
2560 https://bugs.webkit.org/show_bug.cgi?id=153975
2561 rdar://problem/24291231
2563 Reviewed by Saam Barati.
2565 Fixes a very hard-to-create situation that an internal test picked up.
2567 * parser/Parser.cpp:
2568 (JSC::Parser<LexerType>::parseVariableDeclarationList):
2569 (JSC::Parser<LexerType>::parseAssignmentExpression):
2571 2016-02-08 Andreas Kling <akling@apple.com>
2573 Visiting a WeakBlock should report bytes visited, since we reported them allocated.
2574 <https://webkit.org/b/153978>
2576 Reviewed by Darin Adler.
2578 When creating a WeakBlock, we tell Heap that we've allocated 1 KB (WeakBlock::blockSize)
2579 of memory. Consequently, when visiting a WeakBlock, we should also report 1 KB of memory
2580 visited. Otherwise Heap will think that those 1 KB already went away.
2582 This was causing us to underestimate heap size, which affects collection scheduling.
2584 * heap/SlotVisitor.h:
2585 (JSC::SlotVisitor::reportMemoryVisited):
2586 * heap/WeakBlock.cpp:
2587 (JSC::WeakBlock::visit):
2589 2016-02-07 Saam barati <sbarati@apple.com>
2591 Follow up patch to: [ES6] bound functions .name property should be "bound " + the target function's name
2592 https://bugs.webkit.org/show_bug.cgi?id=153796
2594 Reviewed by Darin Adler.
2596 This follow-up patch addresses some comments/suggestions by
2597 Ryosuke, Darin, and Joe. It simplifies JSBoundFunction::toStringName
2598 and adds some tests for bound names.
2600 * runtime/JSBoundFunction.cpp:
2601 (JSC::hasInstanceBoundFunction):
2602 (JSC::JSBoundFunction::create):
2603 (JSC::JSBoundFunction::toStringName):
2605 2016-02-07 Filip Pizlo <fpizlo@apple.com>
2607 String.match should defend against matches that would crash the VM
2608 https://bugs.webkit.org/show_bug.cgi?id=153964
2609 rdar://problem/24301119
2611 Reviewed by Saam Barati.
2613 This fixes a crash in an internal test case.
2615 * runtime/ArgList.cpp:
2616 (JSC::MarkedArgumentBuffer::slowAppend): Use best practices to ensure that the size we
2617 compute makes sense. Crash if it stops making sense, since most users of this API assume
2618 that they are creating something small enough to fit on the stack.
2619 * runtime/ArgList.h:
2620 (JSC::MarkedArgumentBuffer::~MarkedArgumentBuffer):
2621 (JSC::MarkedArgumentBuffer::size):
2622 (JSC::MarkedArgumentBuffer::operator new): Deleted. These were ineffective. According to the
2623 debugger, we were still calling system malloc. So, I changed the code to use fastMalloc()
2625 (JSC::MarkedArgumentBuffer::operator delete): Deleted.
2626 * runtime/StringPrototype.cpp:
2627 (JSC::stringProtoFuncMatch): Explicitly defend against absurd sizes. Of course, it's still
2628 possible to crash the VM on OOME. That's sort of always been the philosophy of JSC - we
2629 don't guarantee that you'll get a nice-looking error whenever you run out of memory,
2630 since in a GC'd environment you can't really guarantee those things. But, if you have a
2631 match that obvious won't fit in memory, then reporting an error is useful in case this is
2632 a developer experimenting with a buggy regexp.
2634 2016-02-07 Dan Bernstein <mitz@apple.com>
2636 [Cocoa] Replace __has_include guards around inclusion of Apple-internal-SDK headers with USE(APPLE_INTERNAL_SDK)
2637 https://bugs.webkit.org/show_bug.cgi?id=153963
2639 Reviewed by Sam Weinig.
2641 * inspector/remote/RemoteInspectorXPCConnection.mm:
2643 2016-02-06 Filip Pizlo <fpizlo@apple.com>
2645 FTL must store the call site index before runtime calls, even if it's the tail call slow path
2646 https://bugs.webkit.org/show_bug.cgi?id=153955
2647 rdar://problem/24290970
2649 Reviewed by Saam Barati.
2651 This is necessary because you could throw an exception in a host call on the tail call's slow
2652 path. That'll route us to lookupExceptionHandler(), which unwinds starting with the call site
2653 index of our frame. Bad things happen if it's not set. Prior to this patch it was possible
2654 for the call site index field to be uninitialized, which meant that the throwing machinery
2655 was making a wild guess about where we are.
2657 * ftl/FTLLowerDFGToLLVM.cpp:
2658 (JSC::FTL::DFG::LowerDFGToLLVM::compileTailCall):
2659 * tests/stress/tail-call-host-call-throw.js: Added.
2661 2016-02-06 Darin Adler <darin@apple.com>
2663 Finish auditing call sites of upper() and lower(), eliminate many, and rename the functions
2664 https://bugs.webkit.org/show_bug.cgi?id=153905
2666 Reviewed by Sam Weinig.
2668 * runtime/IntlObject.cpp:
2669 (JSC::canonicalLangTag): Use converToASCIIUppercase on the language tag.
2671 * runtime/StringPrototype.cpp:
2672 (JSC::stringProtoFuncToLowerCase): Tweak style and update for name change.
2673 (JSC::stringProtoFuncToUpperCase): Ditto.
2675 2016-02-06 Chris Dumez <cdumez@apple.com>
2677 Object.getOwnPropertyDescriptor() does not work on sub-frame's window
2678 https://bugs.webkit.org/show_bug.cgi?id=153925
2680 Reviewed by Darin Adler.
2682 Calling Object.getOwnPropertyDescriptor() on a sub-frame's window was
2683 returning undefined for that window's own properties. The reason was
2684 that the check getOwnPropertySlot() is using to make sure the
2685 PropertySlot is not for a property coming from the prototype was wrong.
2687 The check was checking that 'this != slotBase' which works fine unless
2688 this is a JSProxy (e.g. JSDOMWindowShell). To handle proxies, the code
2689 was also checking that 'slotBase.toThis() != this', attempting to
2690 get the slotBase/Window's proxy. However, due to the implementation of
2691 toThis(), we were getting the lexical global object's proxy instead of
2692 slotBase's proxy. To avoid this issue, the new code explicitly checks
2693 if 'this' is a JSProxy and makes sure 'JSProxy::target() != slotBase',
2694 instead of using toThis().
2696 * runtime/JSObject.cpp:
2697 (JSC::JSObject::getOwnPropertyDescriptor):
2699 2016-02-06 Andreas Kling <akling@apple.com>
2701 [iOS] Throw away linked code when navigating to a new page.
2702 <https://webkit.org/b/153851>
2704 Reviewed by Gavin Barraclough.
2706 Add a VM API for throwing away linked code only.
2709 (JSC::VM::deleteAllLinkedCode):
2712 2016-02-06 Commit Queue <commit-queue@webkit.org>
2714 Unreviewed, rolling out r196104.
2715 https://bugs.webkit.org/show_bug.cgi?id=153940
2717 Regressed Speedometer on iOS (Requested by kling on #webkit).
2721 "[iOS] Throw away linked code when navigating to a new page."
2722 https://bugs.webkit.org/show_bug.cgi?id=153851
2723 http://trac.webkit.org/changeset/196104
2725 2016-02-05 Alex Christensen <achristensen@webkit.org>
2727 Fix internal Windows build
2728 https://bugs.webkit.org/show_bug.cgi?id=153930
2729 <rdar://problem/24534864>
2731 Reviewed by Mark Lam.
2733 * JavaScriptCore.vcxproj/JavaScriptCore.proj:
2734 I made a typo in r196144.
2736 2016-02-05 Saam barati <sbarati@apple.com>
2738 Web Inspector: Include SamplingProfiler's expression-level data for stack frames in the protocol
2739 https://bugs.webkit.org/show_bug.cgi?id=153455
2740 <rdar://problem/24335884>
2742 Reviewed by Joseph Pecoraro.
2744 We now send the sampling profiler's expression-level
2745 line/column info in the inspector protocol.
2747 * inspector/agents/InspectorScriptProfilerAgent.cpp:
2748 (Inspector::buildSamples):
2749 * inspector/protocol/ScriptProfiler.json:
2750 * runtime/SamplingProfiler.h:
2751 (JSC::SamplingProfiler::StackFrame::hasExpressionInfo):
2753 2016-02-05 Saam barati <sbarati@apple.com>
2755 follow-up to: JSC Sampling Profiler: (host) is confusing in cases where I would expect to see JS name
2756 https://bugs.webkit.org/show_bug.cgi?id=153663
2757 <rdar://problem/24415092>
2759 Rubber stamped by Joseph Pecoraro.
2761 We were performing operations that required us to
2762 hold the VM lock even when we might not have been holding it.
2763 We now ensure we're holding it.
2765 * inspector/agents/InspectorScriptProfilerAgent.cpp:
2766 (Inspector::InspectorScriptProfilerAgent::trackingComplete):
2768 2016-02-05 Filip Pizlo <fpizlo@apple.com>
2770 Arrayify for a typed array shouldn't create a monster
2771 https://bugs.webkit.org/show_bug.cgi?id=153908
2772 rdar://problem/24290639
2774 Reviewed by Mark Lam.
2776 Previously if you convinced the DFG to emit an Arrayify to ArrayStorage and then gave it a
2777 typed array, you'd corrupt the object.
2779 * runtime/JSArrayBufferView.cpp:
2780 (WTF::printInternal):
2781 * runtime/JSArrayBufferView.h:
2782 * runtime/JSGenericTypedArrayViewInlines.h:
2783 (JSC::JSGenericTypedArrayView<Adaptor>::visitChildren):
2784 (JSC::JSGenericTypedArrayView<Adaptor>::slowDownAndWasteMemory):
2785 * runtime/JSObject.cpp:
2786 (JSC::JSObject::copyButterfly):
2787 (JSC::JSObject::enterDictionaryIndexingMode):
2788 (JSC::JSObject::ensureInt32Slow):
2789 (JSC::JSObject::ensureDoubleSlow):
2790 (JSC::JSObject::ensureContiguousSlow):
2791 (JSC::JSObject::ensureArrayStorageSlow):
2792 (JSC::JSObject::growOutOfLineStorage):
2793 (JSC::getBoundSlotBaseFunctionForGetterSetter):
2794 * runtime/Structure.h:
2795 * tests/stress/arrayify-array-storage-typed-array.js: Added. This test failed.
2796 * tests/stress/arrayify-int32-typed-array.js: Added. This test case already had other protections, but we beefed them up.
2798 2016-02-04 Joseph Pecoraro <pecoraro@apple.com>
2800 Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
2801 https://bugs.webkit.org/show_bug.cgi?id=153500
2802 <rdar://problem/24352458>
2804 Reviewed by Timothy Hatcher.
2806 Be more explicit about enabling legacy profiling.
2809 * runtime/Executable.cpp:
2810 (JSC::ScriptExecutable::newCodeBlockFor):
2811 * runtime/JSGlobalObject.cpp:
2812 (JSC::JSGlobalObject::hasLegacyProfiler):
2813 (JSC::JSGlobalObject::createProgramCodeBlock):
2814 (JSC::JSGlobalObject::createEvalCodeBlock):
2815 (JSC::JSGlobalObject::createModuleProgramCodeBlock):
2816 (JSC::JSGlobalObject::hasProfiler): Deleted.
2817 * runtime/JSGlobalObject.h:
2818 (JSC::JSGlobalObject::supportsLegacyProfiling):
2819 (JSC::JSGlobalObject::supportsProfiling): Deleted.
2821 2016-02-04 Keith Miller <keith_miller@apple.com>
2823 ArrayPrototype should have a destroy function
2824 https://bugs.webkit.org/show_bug.cgi?id=153847
2826 Reviewed by Filip Pizlo.
2828 ArrayPrototype should have an destroy function as it now has a unique_ptr member that
2829 needs to be freed at the end of the object's life cycle. Also, this patch adds an
2830 option, gcAtEnd, that will cause jsc.cpp to do a garbage collection before exiting.
2835 * runtime/ArrayPrototype.cpp:
2836 (JSC::ArrayPrototype::create):
2837 (JSC::ArrayPrototype::destroy):
2838 * runtime/ArrayPrototype.h:
2839 * runtime/Options.h:
2841 2016-02-04 Filip Pizlo <fpizlo@apple.com>
2843 REGRESSION(192409): Cannot rely on add32() to zero-extend
2844 https://bugs.webkit.org/show_bug.cgi?id=153897
2846 Unreviewed rollout of r192409.
2848 * assembler/MacroAssemblerARM64.h:
2849 (JSC::MacroAssemblerARM64::add32):
2850 (JSC::MacroAssemblerARM64::add64):
2851 * assembler/MacroAssemblerARMv7.h:
2852 (JSC::MacroAssemblerARMv7::add32):
2853 * assembler/MacroAssemblerX86.h:
2854 (JSC::MacroAssemblerX86::add32):
2855 * assembler/MacroAssemblerX86Common.h:
2856 (JSC::MacroAssemblerX86Common::add32):
2857 (JSC::MacroAssemblerX86Common::add8):
2858 (JSC::MacroAssemblerX86Common::branchAdd32):
2859 (JSC::MacroAssemblerX86Common::generateTest32):
2860 (JSC::MacroAssemblerX86Common::clz32AfterBsr):
2861 (JSC::MacroAssemblerX86Common::add32AndSetFlags): Deleted.
2862 * assembler/MacroAssemblerX86_64.h:
2863 (JSC::MacroAssemblerX86_64::add32):
2864 (JSC::MacroAssemblerX86_64::add64):
2865 (JSC::MacroAssemblerX86_64::branchAdd64):
2866 (JSC::MacroAssemblerX86_64::repatchCall):
2867 (JSC::MacroAssemblerX86_64::clz64AfterBsr):
2868 (JSC::MacroAssemblerX86_64::add64AndSetFlags): Deleted.
2870 2016-02-04 Andreas Kling <akling@apple.com>
2872 Remove dead ENABLE(BYTECODE_COMMENTS) cruft.
2873 <https://webkit.org/b/153888>
2875 Reviewed by Antti Koivisto.
2877 * bytecode/UnlinkedCodeBlock.cpp:
2878 (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): Deleted.
2879 * bytecode/UnlinkedCodeBlock.h:
2880 (JSC::UnlinkedCodeBlock::shrinkToFit): Deleted.
2882 2016-02-04 Saam barati <sbarati@apple.com>
2884 JSC Sampling Profiler: (host) is confusing in cases where I would expect to see JS name
2885 https://bugs.webkit.org/show_bug.cgi?id=153663
2886 <rdar://problem/24415092>
2888 Reviewed by Geoffrey Garen.
2890 We now collect the Callee in the processed StackFrame
2891 when the Callee is a valid GC object. We later ask
2892 the Callee for it's .displayName or .name property.
2893 When we don't have a valid callee, we will still
2894 use the Executable for this information.
2896 This helps us come up with good names for frames where
2897 the Callee object is a bound function or an InternalFunction.
2899 * inspector/agents/InspectorScriptProfilerAgent.cpp:
2900 (Inspector::InspectorScriptProfilerAgent::addEvent):
2901 (Inspector::buildSamples):
2902 (Inspector::InspectorScriptProfilerAgent::trackingComplete):
2903 * runtime/SamplingProfiler.cpp:
2905 (JSC::FrameWalker::walk):
2906 (JSC::SamplingProfiler::processUnverifiedStackTraces):
2907 (JSC::SamplingProfiler::visit):
2908 (JSC::SamplingProfiler::shutdown):
2909 (JSC::SamplingProfiler::clearData):
2910 (JSC::SamplingProfiler::StackFrame::nameFromCallee):
2911 (JSC::SamplingProfiler::StackFrame::displayName):
2912 (JSC::SamplingProfiler::StackFrame::displayNameForJSONTests):
2913 (JSC::SamplingProfiler::stackTracesAsJSON):
2914 * runtime/SamplingProfiler.h:
2915 (JSC::SamplingProfiler::UnprocessedStackFrame::UnprocessedStackFrame):
2916 (JSC::SamplingProfiler::StackFrame::StackFrame):
2917 * tests/stress/sampling-profiler-basic.js:
2918 (platformSupportsSamplingProfiler.nothing):
2919 (platformSupportsSamplingProfiler.top):
2920 * tests/stress/sampling-profiler-bound-function-name.js: Added.
2921 (platformSupportsSamplingProfiler.foo):
2922 (platformSupportsSamplingProfiler.bar):
2923 (platformSupportsSamplingProfiler.let.baz):
2924 (platformSupportsSamplingProfiler):
2925 * tests/stress/sampling-profiler-display-name.js: Added.
2926 (platformSupportsSamplingProfiler.foo):
2927 (platformSupportsSamplingProfiler.baz):
2928 (platformSupportsSamplingProfiler.):
2929 (platformSupportsSamplingProfiler.bar):
2930 (platformSupportsSamplingProfiler.jaz):
2931 (platformSupportsSamplingProfiler.makeFunction.let.result):
2932 (platformSupportsSamplingProfiler.makeFunction):
2933 * tests/stress/sampling-profiler-internal-function-name.js: Added.
2934 (platformSupportsSamplingProfiler.foo):
2935 (platformSupportsSamplingProfiler.bar):
2936 (platformSupportsSamplingProfiler):
2938 2016-02-04 Chris Dumez <cdumez@apple.com>
2940 Object.getOwnPropertyDescriptor() returns incomplete descriptor for instance properties
2941 https://bugs.webkit.org/show_bug.cgi?id=153817
2943 Reviewed by Geoffrey Garen.
2945 Extend support for Object.getOwnPropertyDescriptor() on native bindings
2946 to instance properties (e.g. Unforgeable properties or Global object
2947 properties) so that the returned descriptor has getter / setter
2948 functions, as expected.
2950 * runtime/JSObject.cpp:
2951 (JSC::JSObject::reifyAllStaticProperties):
2952 Add method that reifies all static properties, including the custom
2953 accessors. This is similar to what is done eagerly on the prototype
2954 objects in the bindings code.
2956 (JSC::JSObject::getOwnPropertyDescriptor):
2957 getOwnPropertyDescriptor() would previously fails for custom accessors
2958 that are on the instance because getDirect() does not check the static
2959 property table and those custom accessors were not reified (We only
2960 reified all properties eagerly - including custom accessors - on
2961 prototype objects. To address this issue, we now call
2962 reifyAllStaticProperties() if the call to getDirect() fails and then
2963 call getDirect() again. This fix is however insufficient for Window
2964 properties because |this| is a JSDOMWindowShell / JSProxy in this case
2965 and getDirect() / reifyAllStaticProperties() would fail as the proxy
2966 does not actually have the properties. This issue was addressed by
2967 checking if |this| is a JSProxy and then using JSProxy::target() instead
2968 of |this| for the calls to getDirect() and for the reification.
2970 * runtime/JSObject.h:
2972 (JSC::reifyStaticProperty):
2973 (JSC::reifyStaticProperties):
2974 Move most code in reifyStaticProperties() to a separate function so the
2975 code can be shared with JSObject::reifyAllStaticProperties().
2976 reifyStaticProperties() is currently called by the bindings on the
2979 2016-02-04 Alex Christensen <achristensen@webkit.org>
2981 Fix internal Windows build
2982 https://bugs.webkit.org/show_bug.cgi?id=153886
2983 <rdar://problem/24499887>
2985 Reviewed by Mark Lam.
2987 * JavaScriptCore.vcxproj/JavaScriptCore.proj:
2988 In r190253 I changed the directory of the headers from AppleInternal/include/JavaScriptCore
2989 to AppleInternal/include/private/JavaScriptCore. This is ok for WebCore and WebKit, but not
2990 other projects, such as CFNetwork, which expect the public API headers to be in the old location.
2991 This used to be done by a combination of copy-files.cmd and the old JavaScriptCore.proj.
2992 This change copies all the API headers, which copies everything in copy-files.cmd except APIShims.h
2993 which does not exist any more. It copies additional headers that were not copied before, but
2994 I think this is beneficial so we do not forget to add new public headers to a list of public headers
2995 to be copied in the internal build. Having extra public headers in the internal Windows build is
2996 not a problem because only internal clients use the internal Windows build.
2998 2016-02-03 Yusuke Suzuki <utatane.tea@gmail.com>
3000 [JSC] Make some classes non JSDestructibleObject
3001 https://bugs.webkit.org/show_bug.cgi?id=153838
3003 Reviewed by Geoffrey Garen.
3005 SymbolPrototype, JSMapIterator and JSSetIterator are trivially destructible.
3006 So there is no need to inherit JSDestructibleObject.
3008 * runtime/JSMapIterator.cpp:
3009 (JSC::JSMapIterator::destroy): Deleted.
3010 * runtime/JSMapIterator.h:
3011 * runtime/JSSetIterator.cpp:
3012 (JSC::JSSetIterator::destroy): Deleted.
3013 * runtime/JSSetIterator.h:
3014 * runtime/MapData.h:
3015 * runtime/SymbolPrototype.h:
3017 2016-02-03 Yusuke Suzuki <utatane.tea@gmail.com>
3019 [JSC] Symbol structure has unnecessary flags
3020 https://bugs.webkit.org/show_bug.cgi?id=153840
3022 Reviewed by Saam Barati.
3025 * tests/stress/symbol-get-own-property.js: Added.
3028 2016-02-03 Andreas Kling <akling@apple.com>
3030 [iOS] Throw away linked code when navigating to a new page.
3031 <https://webkit.org/b/153851>
3033 Reviewed by Gavin Barraclough.
3035 Add a VM API for throwing away linked code only.
3038 (JSC::VM::deleteAllLinkedCode):
3041 2016-02-03 Michael Catanzaro <mcatanzaro@igalia.com>
3043 [GTK][EFL] Switch FTL to B3
3044 https://bugs.webkit.org/show_bug.cgi?id=153478
3046 Reviewed by Csaba Osztrogonác.
3048 Conditionalize code to make it possible to build FTL completely without LLVM.
3053 (JSC::DFG::Plan::compileInThreadImpl):
3054 * ftl/FTLAbbreviatedTypes.h:
3058 (JSC::FTL::State::State):
3059 (JSC::FTL::State::~State):
3061 2016-02-03 Carlos Garcia Campos <cgarcia@igalia.com>
3063 Unreviewed. Fix JavaScriptCore build with B3 enabled.
3065 Include <limits.h> for UINT_MAX.
3068 * b3/air/AirStackSlot.h:
3070 2016-02-02 Caitlin Potter <caitp@igalia.com>
3072 JSSymbolTableObject::deleteProperty() crashes deleting Symbols
3073 https://bugs.webkit.org/show_bug.cgi?id=153816
3075 Reviewed by Darin Adler.
3077 Changes JSSymbolTableObject::deleteProperty() to check if its
3078 symbolTable() contains the property's uid() rather than publicName().
3079 This ensures that it will not crash in the case of Symbols.
3081 * runtime/JSSymbolTableObject.cpp:
3082 (JSC::JSSymbolTableObject::deleteProperty):
3083 * tests/es6/Object_static_methods_Object.getOwnPropertyDescriptors.js:
3085 * tests/stress/regress-153816.js: Added.
3086 (deleteSymbolFromJSSymbolTableObject):
3088 2016-02-02 Benjamin Poulain <benjamin@webkit.org>
3090 [JSC] Do not copy FP when lowering FramePointer
3091 https://bugs.webkit.org/show_bug.cgi?id=153769
3093 Reviewed by Michael Saboff.
3095 That extra move is just wasted time. The fewer Moves we have,
3098 * b3/B3LowerToAir.cpp:
3099 (JSC::B3::Air::LowerToAir::tmp):
3100 (JSC::B3::Air::LowerToAir::lower):
3102 2016-02-02 Keith Miller <keith_miller@apple.com>
3104 DFG, FTL, B3, and Air should all have a unique option for printing their graphs
3105 https://bugs.webkit.org/show_bug.cgi?id=153815
3107 Reviewed by Benjamin Poulain.
3109 This patch adds a new printing option for each of the DFG/FTL compilation phases.
3112 (JSC::B3::shouldDumpIR):
3113 (JSC::B3::shouldDumpIRAtEachPhase):
3115 * b3/B3Generate.cpp:
3116 (JSC::B3::generateToAir):
3117 * b3/B3PhaseScope.cpp:
3118 (JSC::B3::PhaseScope::PhaseScope):
3119 * b3/air/AirGenerate.cpp:
3120 (JSC::B3::Air::prepareForGeneration):
3121 * b3/air/AirPhaseScope.cpp:
3122 (JSC::B3::Air::PhaseScope::PhaseScope):
3123 * dfg/DFGCFAPhase.cpp:
3124 (JSC::DFG::CFAPhase::run):
3126 (JSC::DFG::shouldDumpGraphAtEachPhase):
3128 (JSC::DFG::Phase::beginPhase):
3129 * runtime/Options.cpp:
3130 (JSC::recomputeDependentOptions):
3131 * runtime/Options.h:
3133 2016-02-02 Caitlin Potter <caitp@igalia.com>
3135 [JSC] make Object.getOwnPropertyDescriptors() work with non-JSObject types
3136 https://bugs.webkit.org/show_bug.cgi?id=153814
3138 Reviewed by Yusuke Suzuki.
3140 * runtime/ObjectConstructor.cpp:
3141 (JSC::objectConstructorGetOwnPropertyDescriptors):
3142 * tests/es6/Object_static_methods_Object.getOwnPropertyDescriptors.js:
3145 2016-02-02 Aakash Jain <aakash_jain@apple.com>
3147 Remove references to CallFrameInlines.h
3148 https://bugs.webkit.org/show_bug.cgi?id=153810
3150 Reviewed by Mark Lam.
3152 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
3153 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
3155 2016-02-02 Caitlin Potter <caitp@igalia.com>
3157 [JSC] Implement Object.getOwnPropertyDescriptors() proposal
3158 https://bugs.webkit.org/show_bug.cgi?id=153799
3160 Reviewed by Darin Adler.
3162 Implements the Object.getOwnPropertyDescriptors() proposal, which
3163 reached Stage 3 in the TC39 process in January 2016.
3164 https://github.com/tc39/proposal-object-getownpropertydescriptors
3166 The method extracts a set of property descriptor objects, which can
3167 be safely used via `Object.create()`.
3169 * runtime/ObjectConstructor.cpp:
3170 (JSC::objectConstructorGetOwnPropertyDescriptors):
3172 2016-02-02 Filip Pizlo <fpizlo@apple.com>
3174 B3 should be able to compile trivial self-loops
3175 https://bugs.webkit.org/show_bug.cgi?id=153802
3176 rdar://problem/24465632
3178 Reviewed by Michael Saboff.
3180 Tail-duplicating a self-loop would mean doing a kind of loop unrolling. It wouldn't be
3181 profitable even if it did work. It turns out that it doesn't work, because we edit the target
3182 block before reading the source block, which breaks if the target and source block are the
3185 This disables tail duplication of self-loops, adds a test, and adds better validation for this
3188 * b3/B3DuplicateTails.cpp:
3189 * b3/B3Procedure.cpp:
3190 (JSC::B3::Procedure::resetReachability):
3192 (JSC::B3::testComputeDivisionMagic):
3193 (JSC::B3::testTrivialInfiniteLoop):
3197 2016-02-02 Saam barati <sbarati@apple.com>
3199 [ES6] bound functions .name property should be "bound " + the target function's name
3200 https://bugs.webkit.org/show_bug.cgi?id=153796
3202 Reviewed by Mark Lam.
3204 See http://tc39.github.io/ecma262/#sec-function.prototype.bind for details.
3208 foo.bind(null).name === "bound foo"
3210 (function bar() { }).bind(null).name === "bound bar"
3213 * runtime/FunctionPrototype.cpp:
3214 (JSC::functionProtoFuncToString):
3215 * runtime/JSBoundFunction.cpp:
3216 (JSC::hasInstanceBoundFunction):
3217 (JSC::JSBoundFunction::create):
3218 (JSC::JSBoundFunction::visitChildren):
3219 (JSC::JSBoundFunction::toStringName):
3220 * runtime/JSBoundFunction.h:
3221 (JSC::JSBoundFunction::boundThis):
3222 (JSC::JSBoundFunction::boundArgs):
3223 (JSC::JSBoundFunction::createStructure):
3226 2016-02-02 Filip Pizlo <fpizlo@apple.com>
3228 Get rid of anonymous stack slots
3229 https://bugs.webkit.org/show_bug.cgi?id=151128
3231 Reviewed by Mark Lam.
3233 When I first designed stack slots, the idea was that an "anonymous" stack slot was one that
3234 behaved exactly like a C variable: if it never escaped, it would not need to get stack space
3235 for the entire lifetime of the function - it could get any slab of stack so long as it
3236 didn't interfere with other stack slots that would be live at the same time. The reason I
3237 called them "anonymous" is that external code could not get its address. This felt like it
3238 gave the stack slot anonymity. But it was never a good name for this concept.
3240 Then I had the register allocator lower temporaries to anonymous stack slots when it spilled
3241 them. Spilling became the sole client of anonymous stack slots.
3243 Then I realized that there was an aspect of how spill slots work that make them want
3244 slightly different semantics than a normal C variable. A C variable is a proper memory
3245 location - you could do a store to only some bytes in the variable, and it's reasonable to
3246 expect that this will not destroy the other bytes in the variable. But that means that to
3247 compute their liveness, you have to do something like a per-byte liveness. That's overkill
3248 for spill slots. You want any store to the spill slot to kill the whole slot even if it
3249 writes to just part of the slot. This matches how temporaries work. So rather than implement
3250 per-byte liveness, I decided to change the semantics of anonymous stack slots to make them
3251 work like how I wanted spill slots to work. This was quite dirty, and put B3 in the awkward
3252 situation that B3's anonymous stack slots behaved like spill slots. But it was OK since
3253 nobody used anonymous stack slots in B3.
3255 Then I added tail duplication, which required having a mechanism for introducing non-SSA
3256 variables in B3. I decided to use anonymous stack slots for this purpose. All of a sudden
3257 this all felt like it made sense: anonymous stack slots were just like variables! Hooray for
3258 the amazing foresight of anonymous stack slots!
3260 But then I realized that this was all very bad. We want B3 to be able to optimize Store and
3261 Load operations by reasoning about how they affect bytes in memory. For example, if you do
3262 a Load of a 64-bit value, and then you modify just the low 32 bits of that value, and then
3263 you do a 64-bit store back to the same location, then it would be better to transform this
3264 into 32-bit operations. We don't do this optimization yet, but it's the kind of thing that
3265 we want B3 to be able to do. To do it, we need Store to mean that it only affects N bytes
3266 starting at the pointer, where N is the size of the thing being stored. But that's not what
3267 Store means for anonymous stack slots. For anonymous slots, storing to any byte in the slot
3268 clobbers all bytes in the slot. We were never clear if you need to store directly to an
3269 anonymous slot to get this behavior, or if any pointer that points to an anoymous slot must
3270 exhibit this behavior when stored to. Neither kinds of semantics make sense to me.
3272 This change fixes the problem by eradicating anonymous stack slots. In B3, they are replaced
3273 with Variables. In Air, they are replaced with a different stack slot kind, called Spill.
3274 There is no such thing as stack slot kinds in B3 anymore, all B3 stack slots are locked. In
3275 Air, there is still the concept of stack slot kind - Locked or Spill.
3277 B3 Variables are awesome. They are exactly what they seem to be. They have a type. They are
3278 declared at the top level in the Procedure. You can access them with new opcodes, Get and
3279 Set. This greatly simplifies demoting SSA values to variables and promoting them back to
3280 SSA. I even made the instruction selector do the right things for variables, which means
3281 that introducing variables won't hurt instruction selection (there will be extra moves, but
3282 IRC will kill them). It's great to have non-SSA variables as an explicit concept in IR
3283 because it means that you don't have to do any magic to use them - they Just Work.
3285 Air spill slots behave almost like anonymous stack slots, with one exception: you cannot
3286 escape them. We validate this by making it illegal to UseAddr on a spill slot. This removes
3287 the need to answer awkward questions like: does a 32-bit Def on a pointer that may point to
3288 a 64-bit spill slot do anything to the 32 bits above the pointer? Does it write zero to it?
3289 Does it write zero to it just when the pointer actually points to a spill slot or always?
3290 These are silly questions, and we don't have to answer them because the only way to refer to
3291 a spill slot is directly. No escaping means no aliasing.
3293 This doesn't affect performance. It just makes the compiler more fun to work with by
3294 removing some cognitive dissonance.
3297 * JavaScriptCore.xcodeproj/project.pbxproj:
3298 * b3/B3ArgumentRegValue.h:
3299 * b3/B3CCallValue.h:
3300 * b3/B3CheckValue.cpp:
3301 (JSC::B3::CheckValue::cloneImpl):
3302 (JSC::B3::CheckValue::CheckValue):
3303 * b3/B3CheckValue.h:
3304 * b3/B3Const32Value.h:
3305 * b3/B3Const64Value.h:
3306 * b3/B3ConstDoubleValue.h:
3307 * b3/B3ConstFloatValue.h:
3308 * b3/B3ConstPtrValue.h:
3309 (JSC::B3::ConstPtrValue::ConstPtrValue):
3310 * b3/B3ControlValue.cpp:
3311 (JSC::B3::ControlValue::convertToJump):
3312 (JSC::B3::ControlValue::convertToOops):
3313 (JSC::B3::ControlValue::dumpMeta):
3314 * b3/B3ControlValue.h:
3316 (JSC::B3::Effects::interferes):
3317 (JSC::B3::Effects::dump):
3319 (JSC::B3::Effects::mustExecute):
3320 * b3/B3EliminateCommonSubexpressions.cpp:
3322 (JSC::B3::demoteValues):
3326 (JSC::B3::IndexMap::resize):
3327 (JSC::B3::IndexMap::clear):
3328 (JSC::B3::IndexMap::size):
3329 (JSC::B3::IndexMap::operator[]):
3331 (JSC::B3::IndexSet::contains):
3332 (JSC::B3::IndexSet::size):
3333 (JSC::B3::IndexSet::isEmpty):
3334 * b3/B3LowerToAir.cpp:
3335 (JSC::B3::Air::LowerToAir::run):
3336 (JSC::B3::Air::LowerToAir::lower):
3337 * b3/B3MemoryValue.h:
3339 (WTF::printInternal):
3341 * b3/B3PatchpointValue.cpp:
3342 (JSC::B3::PatchpointValue::cloneImpl):
3343 (JSC::B3::PatchpointValue::PatchpointValue):
3344 * b3/B3PatchpointValue.h:
3345 * b3/B3Procedure.cpp:
3346 (JSC::B3::Procedure::Procedure):
3347 (JSC::B3::Procedure::addBlock):
3348 (JSC::B3::Procedure::addStackSlot):
3349 (JSC::B3::Procedure::addVariable):
3350 (JSC::B3::Procedure::clone):
3351 (JSC::B3::Procedure::addIntConstant):
3352 (JSC::B3::Procedure::dump):
3353 (JSC::B3::Procedure::deleteStackSlot):
3354 (JSC::B3::Procedure::deleteVariable):
3355 (JSC::B3::Procedure::deleteValue):
3356 (JSC::B3::Procedure::deleteOrphans):
3357 (JSC::B3::Procedure::calleeSaveRegisters):
3358 (JSC::B3::Procedure::addValueImpl):
3359 (JSC::B3::Procedure::setBlockOrderImpl):
3360 (JSC::B3::Procedure::addAnonymousStackSlot): Deleted.
3361 (JSC::B3::Procedure::addStackSlotIndex): Deleted.
3362 (JSC::B3::Procedure::addValueIndex): Deleted.
3364 (JSC::B3::Procedure::setBlockOrder):
3365 (JSC::B3::Procedure::stackSlots):
3366 (JSC::B3::Procedure::variables):
3367 (JSC::B3::Procedure::values):
3368 (JSC::B3::Procedure::StackSlotsCollection::StackSlotsCollection): Deleted.