WebKit Bugzilla
Attachment 340846 Details for
Bug 185813
: [JSC] Remove duplicate methods in JSInterfaceJIT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185813-20180521221318.patch (text/plain), 29.81 KB, created by
Yusuke Suzuki
on 2018-05-21 06:13:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-05-21 06:13:19 PDT
Size:
29.81 KB
patch
obsolete
>Subversion Revision: 232008 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 399fa28df17e881089edecf0312efc81418d65f8..0dbce1f787c0e028afafc7a89c120a7e0d5c438a 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,73 @@ >+2018-05-21 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [JSC] Remove duplicate methods in JSInterfaceJIT >+ https://bugs.webkit.org/show_bug.cgi?id=185813 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Some methods of JSInterfaceJIT are duplicate with AssemblyHelpers' ones. >+ This patch removes these ones and use AssemblyHelpers' ones instead. >+ >+ This patch also a bit cleans up ThunkGenerators' unnecessary ifdefs. >+ >+ * jit/AssemblyHelpers.h: >+ (JSC::AssemblyHelpers::tagFor): >+ (JSC::AssemblyHelpers::payloadFor): >+ * jit/JIT.h: >+ * jit/JITArithmetic.cpp: >+ (JSC::JIT::emit_op_unsigned): >+ (JSC::JIT::emit_compareUnsigned): >+ (JSC::JIT::emit_op_inc): >+ (JSC::JIT::emit_op_dec): >+ (JSC::JIT::emit_op_mod): >+ * jit/JITCall32_64.cpp: >+ (JSC::JIT::compileOpCall): >+ * jit/JITInlines.h: >+ (JSC::JIT::emitPutIntToCallFrameHeader): >+ (JSC::JIT::updateTopCallFrame): >+ (JSC::JIT::emitInitRegister): >+ (JSC::JIT::emitLoad): >+ (JSC::JIT::emitStore): >+ (JSC::JIT::emitStoreInt32): >+ (JSC::JIT::emitStoreCell): >+ (JSC::JIT::emitStoreBool): >+ (JSC::JIT::emitGetVirtualRegister): >+ (JSC::JIT::emitPutVirtualRegister): >+ (JSC::JIT::emitTagBool): Deleted. >+ * jit/JITOpcodes.cpp: >+ (JSC::JIT::emit_op_overrides_has_instance): >+ (JSC::JIT::emit_op_is_empty): >+ (JSC::JIT::emit_op_is_undefined): >+ (JSC::JIT::emit_op_is_boolean): >+ (JSC::JIT::emit_op_is_number): >+ (JSC::JIT::emit_op_is_cell_with_type): >+ (JSC::JIT::emit_op_is_object): >+ (JSC::JIT::emit_op_eq): >+ (JSC::JIT::emit_op_neq): >+ (JSC::JIT::compileOpStrictEq): >+ (JSC::JIT::emit_op_eq_null): >+ (JSC::JIT::emit_op_neq_null): >+ (JSC::JIT::emitSlow_op_eq): >+ (JSC::JIT::emitSlow_op_neq): >+ (JSC::JIT::emitSlow_op_instanceof_custom): >+ (JSC::JIT::emitNewFuncExprCommon): >+ * jit/JSInterfaceJIT.h: >+ (JSC::JSInterfaceJIT::emitLoadInt32): >+ (JSC::JSInterfaceJIT::emitLoadDouble): >+ (JSC::JSInterfaceJIT::emitPutToCallFrameHeader): >+ (JSC::JSInterfaceJIT::emitPutCellToCallFrameHeader): >+ (JSC::JSInterfaceJIT::tagFor): Deleted. >+ (JSC::JSInterfaceJIT::payloadFor): Deleted. >+ (JSC::JSInterfaceJIT::intPayloadFor): Deleted. >+ (JSC::JSInterfaceJIT::intTagFor): Deleted. >+ (JSC::JSInterfaceJIT::emitTagInt): Deleted. >+ (JSC::JSInterfaceJIT::addressFor): Deleted. >+ * jit/SpecializedThunkJIT.h: >+ (JSC::SpecializedThunkJIT::returnDouble): >+ * jit/ThunkGenerators.cpp: >+ (JSC::nativeForGenerator): >+ (JSC::arityFixupGenerator): >+ > 2018-05-20 Filip Pizlo <fpizlo@apple.com> > > Revert the B3 compiler pipeline's treatment of taildup >diff --git a/Source/JavaScriptCore/jit/AssemblyHelpers.h b/Source/JavaScriptCore/jit/AssemblyHelpers.h >index 56251991ac91154d69c77f14baf6e9fc3bb7d091..e3a8ba76eb79394ba83709b8ab61420d447d4cf8 100644 >--- a/Source/JavaScriptCore/jit/AssemblyHelpers.h >+++ b/Source/JavaScriptCore/jit/AssemblyHelpers.h >@@ -1091,6 +1091,11 @@ class AssemblyHelpers : public MacroAssembler { > return addressFor(static_cast<VirtualRegister>(operand)); > } > >+ static Address tagFor(VirtualRegister virtualRegister, GPRReg baseGPR) >+ { >+ ASSERT(virtualRegister.isValid()); >+ return Address(baseGPR, virtualRegister.offset() * sizeof(Register) + TagOffset); >+ } > static Address tagFor(VirtualRegister virtualRegister) > { > ASSERT(virtualRegister.isValid()); >@@ -1101,6 +1106,11 @@ class AssemblyHelpers : public MacroAssembler { > return tagFor(static_cast<VirtualRegister>(operand)); > } > >+ static Address payloadFor(VirtualRegister virtualRegister, GPRReg baseGPR) >+ { >+ ASSERT(virtualRegister.isValid()); >+ return Address(baseGPR, virtualRegister.offset() * sizeof(Register) + PayloadOffset); >+ } > static Address payloadFor(VirtualRegister virtualRegister) > { > ASSERT(virtualRegister.isValid()); >diff --git a/Source/JavaScriptCore/jit/JIT.h b/Source/JavaScriptCore/jit/JIT.h >index b96aa22433aabda50ea8da9f3a995d904b797957..c3852222c5aa1248bd601273a6bd21bc4cf951b0 100644 >--- a/Source/JavaScriptCore/jit/JIT.h >+++ b/Source/JavaScriptCore/jit/JIT.h >@@ -449,8 +449,6 @@ namespace JSC { > void emitJumpSlowCaseIfNotNumber(RegisterID); > void emitJumpSlowCaseIfNotInt(RegisterID, RegisterID, RegisterID scratch); > >- void emitTagBool(RegisterID); >- > void compileGetByIdHotPath(int baseVReg, const Identifier*); > > #endif // USE(JSVALUE32_64) >diff --git a/Source/JavaScriptCore/jit/JITArithmetic.cpp b/Source/JavaScriptCore/jit/JITArithmetic.cpp >index 2b3fe90ccecfa9a36008d004c49d08c6832887e3..3981d0388189713f6b5b55de6a550be0024e024a 100644 >--- a/Source/JavaScriptCore/jit/JITArithmetic.cpp >+++ b/Source/JavaScriptCore/jit/JITArithmetic.cpp >@@ -241,7 +241,7 @@ void JIT::emit_op_unsigned(Instruction* currentInstruction) > emitGetVirtualRegister(op1, regT0); > emitJumpSlowCaseIfNotInt(regT0); > addSlowCase(branch32(LessThan, regT0, TrustedImm32(0))); >- emitTagInt(regT0, regT0); >+ boxInt32(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(result, regT0); > } > >@@ -322,7 +322,7 @@ void JIT::emit_compareUnsigned(int dst, int op1, int op2, RelationalCondition co > emitGetVirtualRegisters(op1, regT0, op2, regT1); > compare32(condition, regT0, regT1, regT0); > } >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(dst); > } > >@@ -434,7 +434,7 @@ void JIT::emit_op_inc(Instruction* currentInstruction) > emitGetVirtualRegister(srcDst, regT0); > emitJumpSlowCaseIfNotInt(regT0); > addSlowCase(branchAdd32(Overflow, TrustedImm32(1), regT0)); >- emitTagInt(regT0, regT0); >+ boxInt32(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(srcDst); > } > >@@ -445,7 +445,7 @@ void JIT::emit_op_dec(Instruction* currentInstruction) > emitGetVirtualRegister(srcDst, regT0); > emitJumpSlowCaseIfNotInt(regT0); > addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT0)); >- emitTagInt(regT0, regT0); >+ boxInt32(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(srcDst); > } > >@@ -480,7 +480,7 @@ void JIT::emit_op_mod(Instruction* currentInstruction) > Jump numeratorPositive = branch32(GreaterThanOrEqual, regT4, TrustedImm32(0)); > addSlowCase(branchTest32(Zero, edx)); > numeratorPositive.link(this); >- emitTagInt(edx, regT0); >+ boxInt32(edx, JSValueRegs { regT0 }); > emitPutVirtualRegister(result); > } > >diff --git a/Source/JavaScriptCore/jit/JITCall32_64.cpp b/Source/JavaScriptCore/jit/JITCall32_64.cpp >index d1efbe97d557b3011b64eb85b792a0ee086e06dc..88bef12ceb9568bbac868849d8245ecf22b7e01b 100644 >--- a/Source/JavaScriptCore/jit/JITCall32_64.cpp >+++ b/Source/JavaScriptCore/jit/JITCall32_64.cpp >@@ -261,7 +261,7 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned ca > } // SP holds newCallFrame + sizeof(CallerFrameAndPC), with ArgumentCount initialized. > > uint32_t locationBits = CallSiteIndex(instruction).bits(); >- store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCount, callFrameRegister)); >+ store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCount)); > emitLoad(callee, regT1, regT0); // regT1, regT0 holds callee. > > store32(regT0, Address(stackPointerRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC))); >diff --git a/Source/JavaScriptCore/jit/JITInlines.h b/Source/JavaScriptCore/jit/JITInlines.h >index 9a4b737c84aade6da37c371d8567eec9ef506055..db7993b1b2d1f22d491e178b8aed0221fa44d49a 100644 >--- a/Source/JavaScriptCore/jit/JITInlines.h >+++ b/Source/JavaScriptCore/jit/JITInlines.h >@@ -90,10 +90,10 @@ ALWAYS_INLINE JSValue JIT::getConstantOperand(int src) > ALWAYS_INLINE void JIT::emitPutIntToCallFrameHeader(RegisterID from, int entry) > { > #if USE(JSVALUE32_64) >- store32(TrustedImm32(Int32Tag), intTagFor(entry, callFrameRegister)); >- store32(from, intPayloadFor(entry, callFrameRegister)); >+ store32(TrustedImm32(JSValue::Int32Tag), tagFor(entry)); >+ store32(from, payloadFor(entry)); > #else >- store64(from, addressFor(entry, callFrameRegister)); >+ store64(from, addressFor(entry)); > #endif > } > >@@ -141,7 +141,7 @@ ALWAYS_INLINE void JIT::updateTopCallFrame() > #else > uint32_t locationBits = CallSiteIndex(m_bytecodeOffset).bits(); > #endif >- store32(TrustedImm32(locationBits), intTagFor(CallFrameSlot::argumentCount)); >+ store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCount)); > > // FIXME: It's not clear that this is needed. JITOperations tend to update the top call frame on > // the C++ side. >@@ -396,6 +396,11 @@ ALWAYS_INLINE double JIT::getOperandConstantDouble(int src) > return getConstantOperand(src).asDouble(); > } > >+ALWAYS_INLINE void JIT::emitInitRegister(int dst) >+{ >+ storeTrustedValue(jsUndefined(), addressFor(dst)); >+} >+ > #if USE(JSVALUE32_64) > > inline void JIT::emitLoadTag(int index, RegisterID tag) >@@ -445,14 +450,15 @@ inline void JIT::emitLoad(int index, RegisterID tag, RegisterID payload, Registe > return; > } > >+ VirtualRegister target { index }; > if (payload == base) { // avoid stomping base >- load32(tagFor(index, base), tag); >- load32(payloadFor(index, base), payload); >+ load32(tagFor(target, base), tag); >+ load32(payloadFor(target, base), payload); > return; > } > >- load32(payloadFor(index, base), payload); >- load32(tagFor(index, base), tag); >+ load32(payloadFor(target, base), payload); >+ load32(tagFor(target, base), tag); > } > > inline void JIT::emitLoad2(int index1, RegisterID tag1, RegisterID payload1, int index2, RegisterID tag2, RegisterID payload2) >@@ -482,36 +488,37 @@ inline void JIT::emitLoadInt32ToDouble(int index, FPRegisterID value) > > inline void JIT::emitStore(int index, RegisterID tag, RegisterID payload, RegisterID base) > { >- store32(payload, payloadFor(index, base)); >- store32(tag, tagFor(index, base)); >+ VirtualRegister target { index }; >+ store32(payload, payloadFor(target, base)); >+ store32(tag, tagFor(target, base)); > } > > inline void JIT::emitStoreInt32(int index, RegisterID payload, bool indexIsInt32) > { >- store32(payload, payloadFor(index, callFrameRegister)); >+ store32(payload, payloadFor(index)); > if (!indexIsInt32) >- store32(TrustedImm32(JSValue::Int32Tag), tagFor(index, callFrameRegister)); >+ store32(TrustedImm32(JSValue::Int32Tag), tagFor(index)); > } > > inline void JIT::emitStoreInt32(int index, TrustedImm32 payload, bool indexIsInt32) > { >- store32(payload, payloadFor(index, callFrameRegister)); >+ store32(payload, payloadFor(index)); > if (!indexIsInt32) >- store32(TrustedImm32(JSValue::Int32Tag), tagFor(index, callFrameRegister)); >+ store32(TrustedImm32(JSValue::Int32Tag), tagFor(index)); > } > > inline void JIT::emitStoreCell(int index, RegisterID payload, bool indexIsCell) > { >- store32(payload, payloadFor(index, callFrameRegister)); >+ store32(payload, payloadFor(index)); > if (!indexIsCell) >- store32(TrustedImm32(JSValue::CellTag), tagFor(index, callFrameRegister)); >+ store32(TrustedImm32(JSValue::CellTag), tagFor(index)); > } > > inline void JIT::emitStoreBool(int index, RegisterID payload, bool indexIsBool) > { >- store32(payload, payloadFor(index, callFrameRegister)); >+ store32(payload, payloadFor(index)); > if (!indexIsBool) >- store32(TrustedImm32(JSValue::BooleanTag), tagFor(index, callFrameRegister)); >+ store32(TrustedImm32(JSValue::BooleanTag), tagFor(index)); > } > > inline void JIT::emitStoreDouble(int index, FPRegisterID value) >@@ -521,13 +528,9 @@ inline void JIT::emitStoreDouble(int index, FPRegisterID value) > > inline void JIT::emitStore(int index, const JSValue constant, RegisterID base) > { >- store32(Imm32(constant.payload()), payloadFor(index, base)); >- store32(Imm32(constant.tag()), tagFor(index, base)); >-} >- >-ALWAYS_INLINE void JIT::emitInitRegister(int dst) >-{ >- emitStore(dst, jsUndefined()); >+ VirtualRegister target { index }; >+ store32(Imm32(constant.payload()), payloadFor(target, base)); >+ store32(Imm32(constant.tag()), tagFor(target, base)); > } > > inline void JIT::emitJumpSlowCaseIfNotJSCell(int virtualRegisterIndex) >@@ -589,7 +592,7 @@ ALWAYS_INLINE void JIT::emitGetVirtualRegister(int src, RegisterID dst) > return; > } > >- load64(Address(callFrameRegister, src * sizeof(Register)), dst); >+ load64(addressFor(src), dst); > } > > ALWAYS_INLINE void JIT::emitGetVirtualRegister(int src, JSValueRegs dst) >@@ -620,7 +623,7 @@ ALWAYS_INLINE bool JIT::isOperandConstantInt(int src) > > ALWAYS_INLINE void JIT::emitPutVirtualRegister(int dst, RegisterID from) > { >- store64(from, Address(callFrameRegister, dst * sizeof(Register))); >+ store64(from, addressFor(dst)); > } > > ALWAYS_INLINE void JIT::emitPutVirtualRegister(int dst, JSValueRegs from) >@@ -633,11 +636,6 @@ ALWAYS_INLINE void JIT::emitPutVirtualRegister(VirtualRegister dst, RegisterID f > emitPutVirtualRegister(dst.offset(), from); > } > >-ALWAYS_INLINE void JIT::emitInitRegister(int dst) >-{ >- store64(TrustedImm64(JSValue::encode(jsUndefined())), Address(callFrameRegister, dst * sizeof(Register))); >-} >- > ALWAYS_INLINE JIT::Jump JIT::emitJumpIfBothJSCells(RegisterID reg1, RegisterID reg2, RegisterID scratch) > { > move(reg1, scratch); >@@ -706,11 +704,6 @@ ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotNumber(RegisterID reg) > addSlowCase(branchIfNotNumber(reg)); > } > >-ALWAYS_INLINE void JIT::emitTagBool(RegisterID reg) >-{ >- or32(TrustedImm32(static_cast<int32_t>(ValueFalse)), reg); >-} >- > inline Instruction* JIT::copiedInstruction(Instruction* inst) > { > return &m_instructions[m_codeBlock->bytecodeOffset(inst)]; >diff --git a/Source/JavaScriptCore/jit/JITOpcodes.cpp b/Source/JavaScriptCore/jit/JITOpcodes.cpp >index 8846b24afec72eaed4f3e7cf99435b5bf99f7054..c6f12582beb0ca929a5fef8f451cb3984ad7e220 100644 >--- a/Source/JavaScriptCore/jit/JITOpcodes.cpp >+++ b/Source/JavaScriptCore/jit/JITOpcodes.cpp >@@ -125,7 +125,7 @@ void JIT::emit_op_overrides_has_instance(Instruction* currentInstruction) > > // Check that constructor 'ImplementsDefaultHasInstance' i.e. the object is not a C-API user nor a bound function. > test8(Zero, Address(regT0, JSCell::typeInfoFlagsOffset()), TrustedImm32(ImplementsDefaultHasInstance), regT0); >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > Jump done = jump(); > > customhasInstanceValue.link(this); >@@ -191,7 +191,7 @@ void JIT::emit_op_is_empty(Instruction* currentInstruction) > emitGetVirtualRegister(value, regT0); > compare64(Equal, regT0, TrustedImm32(JSValue::encode(JSValue())), regT0); > >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(dst); > } > >@@ -219,7 +219,7 @@ void JIT::emit_op_is_undefined(Instruction* currentInstruction) > > notMasqueradesAsUndefined.link(this); > done.link(this); >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(dst); > } > >@@ -231,7 +231,7 @@ void JIT::emit_op_is_boolean(Instruction* currentInstruction) > emitGetVirtualRegister(value, regT0); > xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0); > test64(Zero, regT0, TrustedImm32(static_cast<int32_t>(~1)), regT0); >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(dst); > } > >@@ -242,7 +242,7 @@ void JIT::emit_op_is_number(Instruction* currentInstruction) > > emitGetVirtualRegister(value, regT0); > test64(NonZero, regT0, tagTypeNumberRegister, regT0); >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(dst); > } > >@@ -256,7 +256,7 @@ void JIT::emit_op_is_cell_with_type(Instruction* currentInstruction) > Jump isNotCell = branchIfNotCell(regT0); > > compare8(Equal, Address(regT0, JSCell::typeInfoTypeOffset()), TrustedImm32(type), regT0); >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > Jump done = jump(); > > isNotCell.link(this); >@@ -275,7 +275,7 @@ void JIT::emit_op_is_object(Instruction* currentInstruction) > Jump isNotCell = branchIfNotCell(regT0); > > compare8(AboveOrEqual, Address(regT0, JSCell::typeInfoTypeOffset()), TrustedImm32(ObjectType), regT0); >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > Jump done = jump(); > > isNotCell.link(this); >@@ -416,7 +416,7 @@ void JIT::emit_op_eq(Instruction* currentInstruction) > emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1); > emitJumpSlowCaseIfNotInt(regT0, regT1, regT2); > compare32(Equal, regT1, regT0, regT0); >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(currentInstruction[1].u.operand); > } > >@@ -446,7 +446,7 @@ void JIT::emit_op_neq(Instruction* currentInstruction) > emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1); > emitJumpSlowCaseIfNotInt(regT0, regT1, regT2); > compare32(NotEqual, regT1, regT0, regT0); >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > > emitPutVirtualRegister(currentInstruction[1].u.operand); > } >@@ -494,7 +494,7 @@ void JIT::compileOpStrictEq(Instruction* currentInstruction, CompileOpStrictEqTy > compare64(Equal, regT1, regT0, regT0); > else > compare64(NotEqual, regT1, regT0, regT0); >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > > emitPutVirtualRegister(dst); > } >@@ -745,7 +745,7 @@ void JIT::emit_op_eq_null(Instruction* currentInstruction) > wasNotImmediate.link(this); > wasNotMasqueradesAsUndefined.link(this); > >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(dst); > > } >@@ -777,7 +777,7 @@ void JIT::emit_op_neq_null(Instruction* currentInstruction) > wasNotImmediate.link(this); > wasNotMasqueradesAsUndefined.link(this); > >- emitTagBool(regT0); >+ boxBoolean(regT0, JSValueRegs { regT0 }); > emitPutVirtualRegister(dst); > } > >@@ -869,7 +869,7 @@ void JIT::emitSlow_op_eq(Instruction* currentInstruction, Vector<SlowCaseEntry>: > linkAllSlowCases(iter); > > callOperation(operationCompareEq, regT0, regT1); >- emitTagBool(returnValueGPR); >+ boxBoolean(returnValueGPR, JSValueRegs { returnValueGPR }); > emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueGPR); > } > >@@ -879,7 +879,7 @@ void JIT::emitSlow_op_neq(Instruction* currentInstruction, Vector<SlowCaseEntry> > > callOperation(operationCompareEq, regT0, regT1); > xor32(TrustedImm32(0x1), regT0); >- emitTagBool(returnValueGPR); >+ boxBoolean(returnValueGPR, JSValueRegs { returnValueGPR }); > emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueGPR); > } > >@@ -915,7 +915,7 @@ void JIT::emitSlow_op_instanceof_custom(Instruction* currentInstruction, Vector< > emitGetVirtualRegister(constructor, regT1); > emitGetVirtualRegister(hasInstanceValue, regT2); > callOperation(operationInstanceOfCustom, regT0, regT1, regT2); >- emitTagBool(returnValueGPR); >+ boxBoolean(returnValueGPR, JSValueRegs { returnValueGPR }); > emitPutVirtualRegister(dst, returnValueGPR); > } > >@@ -1041,12 +1041,12 @@ void JIT::emitNewFuncExprCommon(Instruction* currentInstruction) > #if USE(JSVALUE64) > emitGetVirtualRegister(currentInstruction[2].u.operand, regT0); > notUndefinedScope = branchIfNotUndefined(regT0); >- store64(TrustedImm64(JSValue::encode(jsUndefined())), Address(callFrameRegister, sizeof(Register) * dst)); > #else > emitLoadPayload(currentInstruction[2].u.operand, regT0); > notUndefinedScope = branch32(NotEqual, tagFor(currentInstruction[2].u.operand), TrustedImm32(JSValue::UndefinedTag)); >- emitStore(dst, jsUndefined()); > #endif >+ storeTrustedValue(jsUndefined(), addressFor(dst)); >+ > Jump done = jump(); > notUndefinedScope.link(this); > >diff --git a/Source/JavaScriptCore/jit/JSInterfaceJIT.h b/Source/JavaScriptCore/jit/JSInterfaceJIT.h >index 2351973d4f9264eedf8d54467b3676df519ecd88..416b5f6908ede261e9c30d00ea47e33184201067 100644 >--- a/Source/JavaScriptCore/jit/JSInterfaceJIT.h >+++ b/Source/JavaScriptCore/jit/JSInterfaceJIT.h >@@ -44,22 +44,12 @@ namespace JSC { > { > } > >-#if USE(JSVALUE32_64) >- static const unsigned Int32Tag = static_cast<unsigned>(JSValue::Int32Tag); >-#else >- static const unsigned Int32Tag = static_cast<unsigned>(TagTypeNumber >> 32); >-#endif > inline Jump emitLoadJSCell(unsigned virtualRegisterIndex, RegisterID payload); > inline Jump emitLoadInt32(unsigned virtualRegisterIndex, RegisterID dst); > inline Jump emitLoadDouble(unsigned virtualRegisterIndex, FPRegisterID dst, RegisterID scratch); > > #if USE(JSVALUE32_64) > inline Jump emitJumpIfNotJSCell(unsigned virtualRegisterIndex); >- inline Address tagFor(int index, RegisterID base = callFrameRegister); >-#endif >- >-#if USE(JSVALUE64) >- void emitTagInt(RegisterID src, RegisterID dest); > #endif > > void emitGetFromCallFrameHeaderPtr(int entry, RegisterID to, RegisterID from = callFrameRegister); >@@ -67,11 +57,6 @@ namespace JSC { > void emitPutToCallFrameHeader(void* value, int entry); > void emitPutCellToCallFrameHeader(RegisterID from, int entry); > >- inline Address payloadFor(int index, RegisterID base = callFrameRegister); >- inline Address intPayloadFor(int index, RegisterID base = callFrameRegister); >- inline Address intTagFor(int index, RegisterID base = callFrameRegister); >- inline Address addressFor(int index, RegisterID base = callFrameRegister); >- > VM* vm() const { return m_vm; } > > VM* m_vm; >@@ -101,28 +86,6 @@ namespace JSC { > loadPtr(payloadFor(virtualRegisterIndex), dst); > return branch32(NotEqual, tagFor(static_cast<int>(virtualRegisterIndex)), TrustedImm32(JSValue::Int32Tag)); > } >- >- inline JSInterfaceJIT::Address JSInterfaceJIT::tagFor(int virtualRegisterIndex, RegisterID base) >- { >- ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex); >- return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register)) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)); >- } >- >- inline JSInterfaceJIT::Address JSInterfaceJIT::payloadFor(int virtualRegisterIndex, RegisterID base) >- { >- ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex); >- return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register)) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)); >- } >- >- inline JSInterfaceJIT::Address JSInterfaceJIT::intPayloadFor(int virtualRegisterIndex, RegisterID base) >- { >- return payloadFor(virtualRegisterIndex, base); >- } >- >- inline JSInterfaceJIT::Address JSInterfaceJIT::intTagFor(int virtualRegisterIndex, RegisterID base) >- { >- return tagFor(virtualRegisterIndex, base); >- } > > inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadDouble(unsigned virtualRegisterIndex, FPRegisterID dst, RegisterID scratch) > { >@@ -168,33 +131,6 @@ namespace JSC { > done.link(this); > return notNumber; > } >- >- // operand is int32_t, must have been zero-extended if register is 64-bit. >- ALWAYS_INLINE void JSInterfaceJIT::emitTagInt(RegisterID src, RegisterID dest) >- { >- if (src != dest) >- move(src, dest); >- or64(tagTypeNumberRegister, dest); >- } >-#endif >- >-#if USE(JSVALUE64) >- inline JSInterfaceJIT::Address JSInterfaceJIT::payloadFor(int virtualRegisterIndex, RegisterID base) >- { >- ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex); >- return addressFor(virtualRegisterIndex, base); >- } >- >- inline JSInterfaceJIT::Address JSInterfaceJIT::intPayloadFor(int virtualRegisterIndex, RegisterID base) >- { >- ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex); >- return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)); >- } >- inline JSInterfaceJIT::Address JSInterfaceJIT::intTagFor(int virtualRegisterIndex, RegisterID base) >- { >- ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex); >- return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)); >- } > #endif > > ALWAYS_INLINE void JSInterfaceJIT::emitGetFromCallFrameHeaderPtr(int entry, RegisterID to, RegisterID from) >@@ -205,33 +141,27 @@ namespace JSC { > ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(RegisterID from, int entry) > { > #if USE(JSVALUE32_64) >- storePtr(from, payloadFor(entry, callFrameRegister)); >+ storePtr(from, payloadFor(entry)); > #else >- store64(from, addressFor(entry, callFrameRegister)); >+ store64(from, addressFor(entry)); > #endif > } > > ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(void* value, int entry) > { >- storePtr(TrustedImmPtr(value), Address(callFrameRegister, entry * sizeof(Register))); >+ storePtr(TrustedImmPtr(value), addressFor(entry)); > } > > ALWAYS_INLINE void JSInterfaceJIT::emitPutCellToCallFrameHeader(RegisterID from, int entry) > { > #if USE(JSVALUE32_64) >- store32(TrustedImm32(JSValue::CellTag), tagFor(entry, callFrameRegister)); >- store32(from, payloadFor(entry, callFrameRegister)); >+ store32(TrustedImm32(JSValue::CellTag), tagFor(entry)); >+ store32(from, payloadFor(entry)); > #else >- store64(from, addressFor(entry, callFrameRegister)); >+ store64(from, addressFor(entry)); > #endif > } > >- inline JSInterfaceJIT::Address JSInterfaceJIT::addressFor(int virtualRegisterIndex, RegisterID base) >- { >- ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex); >- return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register))); >- } >- > } // namespace JSC > > #endif // ENABLE(JIT) >diff --git a/Source/JavaScriptCore/jit/SpecializedThunkJIT.h b/Source/JavaScriptCore/jit/SpecializedThunkJIT.h >index f282321a469b05eec19e97d98ab71c473ff7f15d..2ddaa5ad9fc24fca8730961853e570f1446e5165 100644 >--- a/Source/JavaScriptCore/jit/SpecializedThunkJIT.h >+++ b/Source/JavaScriptCore/jit/SpecializedThunkJIT.h >@@ -135,7 +135,7 @@ namespace JSC { > Jump lowNonZero = branchTestPtr(NonZero, regT1); > Jump highNonZero = branchTestPtr(NonZero, regT0); > move(TrustedImm32(0), regT0); >- move(TrustedImm32(Int32Tag), regT1); >+ move(TrustedImm32(JSValue::Int32Tag), regT1); > lowNonZero.link(this); > highNonZero.link(this); > #endif >diff --git a/Source/JavaScriptCore/jit/ThunkGenerators.cpp b/Source/JavaScriptCore/jit/ThunkGenerators.cpp >index 6e7e6313dcf3e0ebc0e87efd6270f2365ed90231..8bf663136237c845dc2a6fe3ce79448ef56e6bc3 100644 >--- a/Source/JavaScriptCore/jit/ThunkGenerators.cpp >+++ b/Source/JavaScriptCore/jit/ThunkGenerators.cpp >@@ -265,12 +265,7 @@ static MacroAssemblerCodeRef<JITThunkPtrTag> nativeForGenerator(VM* vm, ThunkFun > #if USE(JSVALUE64) > // We're coming from a specialized thunk that has saved the prior tag registers' contents. > // Restore them now. >-#if CPU(ARM64) > jit.popPair(JSInterfaceJIT::tagTypeNumberRegister, JSInterfaceJIT::tagMaskRegister); >-#else >- jit.pop(JSInterfaceJIT::tagMaskRegister); >- jit.pop(JSInterfaceJIT::tagTypeNumberRegister); >-#endif > #endif > break; > case EnterViaJumpWithoutSavedTags: >@@ -384,15 +379,7 @@ static MacroAssemblerCodeRef<JITThunkPtrTag> nativeForGenerator(VM* vm, ThunkFun > #endif > > // Check for an exception >-#if USE(JSVALUE64) >- jit.load64(vm->addressOfException(), JSInterfaceJIT::regT2); >- JSInterfaceJIT::Jump exceptionHandler = jit.branchTest64(JSInterfaceJIT::NonZero, JSInterfaceJIT::regT2); >-#else >- JSInterfaceJIT::Jump exceptionHandler = jit.branch32( >- JSInterfaceJIT::NotEqual, >- JSInterfaceJIT::AbsoluteAddress(vm->addressOfException()), >- JSInterfaceJIT::TrustedImm32(0)); >-#endif >+ JSInterfaceJIT::Jump exceptionHandler = jit.branchTestPtr(JSInterfaceJIT::NonZero, JSInterfaceJIT::AbsoluteAddress(vm->addressOfException())); > > jit.emitFunctionEpilogue(); > // Return. >@@ -485,7 +472,7 @@ MacroAssemblerCodeRef<JITThunkPtrTag> arityFixupGenerator(VM* vm) > jit.storePtr(GPRInfo::regT3, JSInterfaceJIT::Address(GPRInfo::callFrameRegister, CallFrame::returnPCOffset())); > #endif > jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3); >- jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, CallFrameSlot::argumentCount * sizeof(Register)), JSInterfaceJIT::argumentGPR2); >+ jit.load32(JSInterfaceJIT::addressFor(CallFrameSlot::argumentCount), JSInterfaceJIT::argumentGPR2); > jit.add32(JSInterfaceJIT::TrustedImm32(CallFrame::headerSizeInRegisters), JSInterfaceJIT::argumentGPR2); > > // Check to see if we have extra slots we can use >@@ -549,7 +536,7 @@ MacroAssemblerCodeRef<JITThunkPtrTag> arityFixupGenerator(VM* vm) > jit.pop(JSInterfaceJIT::regT4); > # endif > jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3); >- jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, CallFrameSlot::argumentCount * sizeof(Register)), JSInterfaceJIT::argumentGPR2); >+ jit.load32(addressFor(CallFrameSlot::argumentCount), JSInterfaceJIT::argumentGPR2); > jit.add32(JSInterfaceJIT::TrustedImm32(CallFrame::headerSizeInRegisters), JSInterfaceJIT::argumentGPR2); > > // Check to see if we have extra slots we can use
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
saam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185813
:
340828
|
340843
| 340846 |
340955