Changeset 220318 in webkit
- Timestamp:
- Aug 5, 2017 7:10:07 AM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r220306 r220318 377 377 dfg/DFGOSREntrypointCreationPhase.cpp 378 378 dfg/DFGOSRExit.cpp 379 dfg/DFGOSRExit32_64.cpp380 379 dfg/DFGOSRExitBase.cpp 381 380 dfg/DFGOSRExitCompilerCommon.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r220311 r220318 1 2017-08-05 Mark Lam <mark.lam@apple.com> 2 3 Move DFG::OSRExitCompiler methods into DFG::OSRExit [step 3]. 4 https://bugs.webkit.org/show_bug.cgi?id=175228 5 <rdar://problem/33735737> 6 7 Reviewed by Saam Barati. 8 9 Merge the 32-bit OSRExit::compileExit() method into the 64-bit version, and 10 delete OSRExit32_64.cpp. 11 12 * CMakeLists.txt: 13 * JavaScriptCore.xcodeproj/project.pbxproj: 14 * dfg/DFGOSRExit.cpp: 15 (JSC::DFG::OSRExit::compileExit): 16 * dfg/DFGOSRExit32_64.cpp: Removed. 17 * jit/GPRInfo.h: 18 (JSC::JSValueSource::payloadGPR const): 19 1 20 2017-08-04 Youenn Fablet <youenn@apple.com> 2 21 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r220306 r220318 745 745 0FBF158D19B7A53100695DD0 /* DFGBlockSetInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBF158B19B7A53100695DD0 /* DFGBlockSetInlines.h */; }; 746 746 0FC0976A1468A6F700CF2442 /* DFGOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC097681468A6EF00CF2442 /* DFGOSRExit.h */; }; 747 0FC09776146943B000CF2442 /* DFGOSRExit32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC09775146943AD00CF2442 /* DFGOSRExit32_64.cpp */; };748 747 0FC09791146A6F7100CF2442 /* DFGOSRExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0978E146A6F6300CF2442 /* DFGOSRExit.cpp */; }; 749 748 0FC097A1146B28CA00CF2442 /* DFGThunks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC0979F146B28C700CF2442 /* DFGThunks.cpp */; }; … … 3340 3339 0FBF158B19B7A53100695DD0 /* DFGBlockSetInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGBlockSetInlines.h; path = dfg/DFGBlockSetInlines.h; sourceTree = "<group>"; }; 3341 3340 0FC097681468A6EF00CF2442 /* DFGOSRExit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExit.h; path = dfg/DFGOSRExit.h; sourceTree = "<group>"; }; 3342 0FC09775146943AD00CF2442 /* DFGOSRExit32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGOSRExit32_64.cpp; path = dfg/DFGOSRExit32_64.cpp; sourceTree = "<group>"; };3343 3341 0FC0977E1469EBC400CF2442 /* DFGCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGCommon.h; path = dfg/DFGCommon.h; sourceTree = "<group>"; }; 3344 3342 0FC0978E146A6F6300CF2442 /* DFGOSRExit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGOSRExit.cpp; path = dfg/DFGOSRExit.cpp; sourceTree = "<group>"; }; … … 7468 7466 0FC0978E146A6F6300CF2442 /* DFGOSRExit.cpp */, 7469 7467 0FC097681468A6EF00CF2442 /* DFGOSRExit.h */, 7470 0FC09775146943AD00CF2442 /* DFGOSRExit32_64.cpp */,7471 7468 0F235BE717178E7300690C7F /* DFGOSRExitBase.cpp */, 7472 7469 0F235BE817178E7300690C7F /* DFGOSRExitBase.h */, … … 10475 10472 0FC09791146A6F7100CF2442 /* DFGOSRExit.cpp in Sources */, 10476 10473 0F235BEB17178E7300690C7F /* DFGOSRExitBase.cpp in Sources */, 10477 0FC09776146943B000CF2442 /* DFGOSRExit32_64.cpp in Sources */,10478 10474 0F7025A91714B0FA00382C0E /* DFGOSRExitCompilerCommon.cpp in Sources */, 10479 10475 0F392C891B46188400844728 /* DFGOSRExitFuzz.cpp in Sources */, -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
r220306 r220318 224 224 } 225 225 226 #if USE(JSVALUE64)227 228 226 void OSRExit::compileExit(CCallHelpers& jit, VM& vm, const OSRExit& exit, const Operands<ValueRecovery>& operands, SpeculationRecovery* recovery) 229 227 { … … 247 245 case SpeculativeAdd: 248 246 jit.sub32(recovery->src(), recovery->dest()); 247 #if USE(JSVALUE64) 249 248 jit.or64(GPRInfo::tagTypeNumberRegister, recovery->dest()); 249 #endif 250 250 break; 251 251 252 252 case SpeculativeAddImmediate: 253 253 jit.sub32(AssemblyHelpers::Imm32(recovery->immediate()), recovery->dest()); 254 #if USE(JSVALUE64) 254 255 jit.or64(GPRInfo::tagTypeNumberRegister, recovery->dest()); 256 #endif 255 257 break; 256 258 257 259 case BooleanSpeculationCheck: 260 #if USE(JSVALUE64) 258 261 jit.xor64(AssemblyHelpers::TrustedImm32(static_cast<int32_t>(ValueFalse)), recovery->dest()); 262 #endif 259 263 break; 260 264 … … 279 283 CodeOrigin codeOrigin = exit.m_codeOriginForExitProfile; 280 284 if (ArrayProfile* arrayProfile = jit.baselineCodeBlockFor(codeOrigin)->getArrayProfile(codeOrigin.bytecodeIndex)) { 285 #if USE(JSVALUE64) 281 286 GPRReg usedRegister; 282 287 if (exit.m_jsValueSource.isAddress()) … … 284 289 else 285 290 usedRegister = exit.m_jsValueSource.gpr(); 291 #else 292 GPRReg usedRegister1; 293 GPRReg usedRegister2; 294 if (exit.m_jsValueSource.isAddress()) { 295 usedRegister1 = exit.m_jsValueSource.base(); 296 usedRegister2 = InvalidGPRReg; 297 } else { 298 usedRegister1 = exit.m_jsValueSource.payloadGPR(); 299 if (exit.m_jsValueSource.hasKnownTag()) 300 usedRegister2 = InvalidGPRReg; 301 else 302 usedRegister2 = exit.m_jsValueSource.tagGPR(); 303 } 304 #endif 286 305 287 306 GPRReg scratch1; 288 307 GPRReg scratch2; 308 #if USE(JSVALUE64) 289 309 scratch1 = AssemblyHelpers::selectScratchGPR(usedRegister); 290 310 scratch2 = AssemblyHelpers::selectScratchGPR(usedRegister, scratch1); 311 #else 312 scratch1 = AssemblyHelpers::selectScratchGPR(usedRegister1, usedRegister2); 313 scratch2 = AssemblyHelpers::selectScratchGPR(usedRegister1, usedRegister2, scratch1); 314 #endif 291 315 292 316 if (isARM64()) { … … 303 327 jit.loadPtr(AssemblyHelpers::Address(exit.m_jsValueSource.asAddress()), value); 304 328 } else 305 value = exit.m_jsValueSource. gpr();329 value = exit.m_jsValueSource.payloadGPR(); 306 330 307 331 jit.load32(AssemblyHelpers::Address(value, JSCell::structureIDOffset()), scratch1); 308 332 jit.store32(scratch1, arrayProfile->addressOfLastSeenStructureID()); 333 #if USE(JSVALUE64) 309 334 jit.load8(AssemblyHelpers::Address(value, JSCell::indexingTypeAndMiscOffset()), scratch1); 335 #else 336 jit.load8(AssemblyHelpers::Address(scratch1, Structure::indexingTypeIncludingHistoryOffset()), scratch1); 337 #endif 310 338 jit.move(AssemblyHelpers::TrustedImm32(1), scratch2); 311 339 jit.lshift32(scratch1, scratch2); … … 323 351 324 352 if (MethodOfGettingAValueProfile profile = exit.m_valueProfile) { 353 #if USE(JSVALUE64) 325 354 if (exit.m_jsValueSource.isAddress()) { 326 355 // We can't be sure that we have a spare register. So use the tagTypeNumberRegister, … … 331 360 } else 332 361 profile.emitReportValue(jit, JSValueRegs(exit.m_jsValueSource.gpr())); 362 #else // not USE(JSVALUE64) 363 if (exit.m_jsValueSource.isAddress()) { 364 // Save a register so we can use it. 365 GPRReg scratchPayload = AssemblyHelpers::selectScratchGPR(exit.m_jsValueSource.base()); 366 GPRReg scratchTag = AssemblyHelpers::selectScratchGPR(exit.m_jsValueSource.base(), scratchPayload); 367 jit.pushToSave(scratchPayload); 368 jit.pushToSave(scratchTag); 369 370 JSValueRegs scratch(scratchTag, scratchPayload); 371 372 jit.loadValue(exit.m_jsValueSource.asAddress(), scratch); 373 profile.emitReportValue(jit, scratch); 374 375 jit.popToRestore(scratchTag); 376 jit.popToRestore(scratchPayload); 377 } else if (exit.m_jsValueSource.hasKnownTag()) { 378 GPRReg scratchTag = AssemblyHelpers::selectScratchGPR(exit.m_jsValueSource.payloadGPR()); 379 jit.pushToSave(scratchTag); 380 jit.move(AssemblyHelpers::TrustedImm32(exit.m_jsValueSource.tag()), scratchTag); 381 JSValueRegs value(scratchTag, exit.m_jsValueSource.payloadGPR()); 382 profile.emitReportValue(jit, value); 383 jit.popToRestore(scratchTag); 384 } else 385 profile.emitReportValue(jit, exit.m_jsValueSource.regs()); 386 #endif // USE(JSVALUE64) 333 387 } 334 388 } … … 379 433 380 434 switch (recovery.technique()) { 435 case UnboxedInt32InGPR: 436 case UnboxedCellInGPR: 437 #if USE(JSVALUE64) 381 438 case InGPR: 382 case UnboxedInt32InGPR:383 439 case UnboxedInt52InGPR: 384 440 case UnboxedStrictInt52InGPR: 385 case UnboxedCellInGPR:386 441 jit.store64(recovery.gpr(), scratch + index); 387 442 break; 443 #else 444 case UnboxedBooleanInGPR: 445 jit.store32( 446 recovery.gpr(), 447 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.payload); 448 break; 449 450 case InPair: 451 jit.store32( 452 recovery.tagGPR(), 453 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.tag); 454 jit.store32( 455 recovery.payloadGPR(), 456 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.payload); 457 break; 458 #endif 388 459 389 460 default: … … 426 497 case Int32DisplacedInJSStack: 427 498 case DoubleDisplacedInJSStack: 499 #if USE(JSVALUE64) 428 500 case Int52DisplacedInJSStack: 429 501 case StrictInt52DisplacedInJSStack: … … 431 503 jit.store64(GPRInfo::regT0, scratch + index); 432 504 break; 505 #else 506 jit.load32( 507 AssemblyHelpers::tagFor(recovery.virtualRegister()), 508 GPRInfo::regT0); 509 jit.load32( 510 AssemblyHelpers::payloadFor(recovery.virtualRegister()), 511 GPRInfo::regT1); 512 jit.store32( 513 GPRInfo::regT0, 514 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.tag); 515 jit.store32( 516 GPRInfo::regT1, 517 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.payload); 518 break; 519 #endif 433 520 434 521 default: … … 467 554 468 555 switch (recovery.technique()) { 556 case DisplacedInJSStack: 557 case InFPR: 558 #if USE(JSVALUE64) 469 559 case InGPR: 470 560 case UnboxedCellInGPR: 471 case DisplacedInJSStack:472 561 case CellDisplacedInJSStack: 473 562 case BooleanDisplacedInJSStack: 474 case InFPR:475 563 jit.load64(scratch + index, GPRInfo::regT0); 476 564 jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand)); 477 565 break; 566 #else // not USE(JSVALUE64) 567 case InPair: 568 jit.load32( 569 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.tag, 570 GPRInfo::regT0); 571 jit.load32( 572 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.payload, 573 GPRInfo::regT1); 574 jit.store32( 575 GPRInfo::regT0, 576 AssemblyHelpers::tagFor(operand)); 577 jit.store32( 578 GPRInfo::regT1, 579 AssemblyHelpers::payloadFor(operand)); 580 break; 581 582 case UnboxedCellInGPR: 583 case CellDisplacedInJSStack: 584 jit.load32( 585 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.payload, 586 GPRInfo::regT0); 587 jit.store32( 588 AssemblyHelpers::TrustedImm32(JSValue::CellTag), 589 AssemblyHelpers::tagFor(operand)); 590 jit.store32( 591 GPRInfo::regT0, 592 AssemblyHelpers::payloadFor(operand)); 593 break; 594 595 case UnboxedBooleanInGPR: 596 case BooleanDisplacedInJSStack: 597 jit.load32( 598 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.payload, 599 GPRInfo::regT0); 600 jit.store32( 601 AssemblyHelpers::TrustedImm32(JSValue::BooleanTag), 602 AssemblyHelpers::tagFor(operand)); 603 jit.store32( 604 GPRInfo::regT0, 605 AssemblyHelpers::payloadFor(operand)); 606 break; 607 #endif // USE(JSVALUE64) 478 608 479 609 case UnboxedInt32InGPR: 480 610 case Int32DisplacedInJSStack: 611 #if USE(JSVALUE64) 481 612 jit.load64(scratch + index, GPRInfo::regT0); 482 613 jit.zeroExtend32ToPtr(GPRInfo::regT0, GPRInfo::regT0); 483 614 jit.or64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0); 484 615 jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand)); 485 break; 486 616 #else 617 jit.load32( 618 &bitwise_cast<EncodedValueDescriptor*>(scratch + index)->asBits.payload, 619 GPRInfo::regT0); 620 jit.store32( 621 AssemblyHelpers::TrustedImm32(JSValue::Int32Tag), 622 AssemblyHelpers::tagFor(operand)); 623 jit.store32( 624 GPRInfo::regT0, 625 AssemblyHelpers::payloadFor(operand)); 626 #endif 627 break; 628 629 #if USE(JSVALUE64) 487 630 case UnboxedInt52InGPR: 488 631 case Int52DisplacedInJSStack: … … 500 643 jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand)); 501 644 break; 645 #endif 502 646 503 647 case UnboxedDoubleInFPR: … … 506 650 jit.loadDouble(MacroAssembler::Address(GPRInfo::regT0), FPRInfo::fpRegT0); 507 651 jit.purifyNaN(FPRInfo::fpRegT0); 652 #if USE(JSVALUE64) 508 653 jit.boxDouble(FPRInfo::fpRegT0, GPRInfo::regT0); 509 654 jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand)); 655 #else 656 jit.storeDouble(FPRInfo::fpRegT0, AssemblyHelpers::addressFor(operand)); 657 #endif 510 658 break; 511 659 512 660 case Constant: 661 #if USE(JSVALUE64) 513 662 jit.store64( 514 663 AssemblyHelpers::TrustedImm64(JSValue::encode(recovery.constant())), 515 664 AssemblyHelpers::addressFor(operand)); 665 #else 666 jit.store32( 667 AssemblyHelpers::TrustedImm32(recovery.constant().tag()), 668 AssemblyHelpers::tagFor(operand)); 669 jit.store32( 670 AssemblyHelpers::TrustedImm32(recovery.constant().payload()), 671 AssemblyHelpers::payloadFor(operand)); 672 #endif 516 673 break; 517 674 … … 580 737 adjustAndJumpToTarget(vm, jit, exit); 581 738 } 582 #endif // USE(JSVALUE64)583 739 584 740 void JIT_OPERATION OSRExit::debugOperationPrintSpeculationFailure(ExecState* exec, void* debugInfoRaw, void* scratch) -
trunk/Source/JavaScriptCore/jit/GPRInfo.h
r219740 r220318 140 140 return m_base; 141 141 } 142 142 143 GPRReg payloadGPR() const { return gpr(); } 144 143 145 JSValueRegs regs() const 144 146 {
Note: See TracChangeset
for help on using the changeset viewer.