ArmOperandConverter i(this, instr);
switch (ArchOpcodeField::decode(instr->opcode())) {
- case kArchJmp:
- __ b(code_->GetLabel(i.InputBlock(0)));
+ case kArchCallAddress: {
+ DirectCEntryStub stub(isolate());
+ stub.GenerateCall(masm(), i.InputRegister(0));
DCHECK_EQ(LeaveCC, i.OutputSBit());
break;
- case kArchNop:
- // don't emit code for nops.
+ }
+ case kArchCallCodeObject: {
+ if (instr->InputAt(0)->IsImmediate()) {
+ __ Call(Handle<Code>::cast(i.InputHeapObject(0)),
+ RelocInfo::CODE_TARGET);
+ } else {
+ __ add(ip, i.InputRegister(0),
+ Operand(Code::kHeaderSize - kHeapObjectTag));
+ __ Call(ip);
+ }
+ AddSafepointAndDeopt(instr);
DCHECK_EQ(LeaveCC, i.OutputSBit());
break;
- case kArchRet:
- AssembleReturn();
+ }
+ case kArchCallJSFunction: {
+ // TODO(jarin) The load of the context should be separated from the call.
+ Register func = i.InputRegister(0);
+ __ ldr(cp, FieldMemOperand(func, JSFunction::kContextOffset));
+ __ ldr(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
+ __ Call(ip);
+ AddSafepointAndDeopt(instr);
DCHECK_EQ(LeaveCC, i.OutputSBit());
break;
+ }
case kArchDeoptimize: {
int deoptimization_id = MiscField::decode(instr->opcode());
BuildTranslation(instr, 0, deoptimization_id);
-
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, Deoptimizer::LAZY);
__ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
DCHECK_EQ(LeaveCC, i.OutputSBit());
break;
}
+ case kArchDrop: {
+ int words = MiscField::decode(instr->opcode());
+ __ Drop(words);
+ DCHECK_LT(0, words);
+ DCHECK_EQ(LeaveCC, i.OutputSBit());
+ break;
+ }
+ case kArchJmp:
+ __ b(code_->GetLabel(i.InputBlock(0)));
+ DCHECK_EQ(LeaveCC, i.OutputSBit());
+ break;
+ case kArchNop:
+ // don't emit code for nops.
+ DCHECK_EQ(LeaveCC, i.OutputSBit());
+ break;
+ case kArchRet:
+ AssembleReturn();
+ DCHECK_EQ(LeaveCC, i.OutputSBit());
+ break;
case kArchTruncateDoubleToI:
__ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0));
DCHECK_EQ(LeaveCC, i.OutputSBit());
DCHECK_EQ(LeaveCC, i.OutputSBit());
break;
}
- case kArmCallCodeObject: {
- if (instr->InputAt(0)->IsImmediate()) {
- Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0));
- __ Call(code, RelocInfo::CODE_TARGET);
- } else {
- Register reg = i.InputRegister(0);
- int entry = Code::kHeaderSize - kHeapObjectTag;
- __ ldr(reg, MemOperand(reg, entry));
- __ Call(reg);
- }
-
- AddSafepointAndDeopt(instr);
-
- DCHECK_EQ(LeaveCC, i.OutputSBit());
- break;
- }
- case kArmCallJSFunction: {
- Register func = i.InputRegister(0);
-
- // TODO(jarin) The load of the context should be separated from the call.
- __ ldr(cp, FieldMemOperand(func, JSFunction::kContextOffset));
- __ ldr(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
- __ Call(ip);
-
- AddSafepointAndDeopt(instr);
-
- DCHECK_EQ(LeaveCC, i.OutputSBit());
- break;
- }
- case kArmCallAddress: {
- DirectCEntryStub stub(isolate());
- stub.GenerateCall(masm(), i.InputRegister(0));
- DCHECK_EQ(LeaveCC, i.OutputSBit());
- break;
- }
- case kArmPush:
- __ Push(i.InputRegister(0));
- DCHECK_EQ(LeaveCC, i.OutputSBit());
- break;
- case kArmDrop: {
- int words = MiscField::decode(instr->opcode());
- __ Drop(words);
- DCHECK_EQ(LeaveCC, i.OutputSBit());
- break;
- }
case kArmCmp:
__ cmp(i.InputRegister(0), i.InputOperand2(1));
DCHECK_EQ(SetCC, i.OutputSBit());
DCHECK_EQ(LeaveCC, i.OutputSBit());
break;
}
+ case kArmPush:
+ __ Push(i.InputRegister(0));
+ DCHECK_EQ(LeaveCC, i.OutputSBit());
+ break;
case kArmStoreWriteBarrier: {
Register object = i.InputRegister(0);
Register index = i.InputRegister(1);
V(ArmMvn) \
V(ArmBfc) \
V(ArmUbfx) \
- V(ArmCallCodeObject) \
- V(ArmCallJSFunction) \
- V(ArmCallAddress) \
- V(ArmPush) \
- V(ArmDrop) \
V(ArmVcmpF64) \
V(ArmVaddF64) \
V(ArmVsubF64) \
V(ArmStrh) \
V(ArmLdr) \
V(ArmStr) \
+ V(ArmPush) \
V(ArmStoreWriteBarrier)
case kArmStrh:
return value >= -255 && value <= 255;
+ case kArchCallAddress:
+ case kArchCallCodeObject:
+ case kArchCallJSFunction:
+ case kArchDeoptimize:
+ case kArchDrop:
case kArchJmp:
case kArchNop:
case kArchRet:
- case kArchDeoptimize:
case kArchTruncateDoubleToI:
case kArmMul:
case kArmMla:
case kArmUdiv:
case kArmBfc:
case kArmUbfx:
- case kArmCallCodeObject:
- case kArmCallJSFunction:
- case kArmCallAddress:
- case kArmPush:
- case kArmDrop:
case kArmVcmpF64:
case kArmVaddF64:
case kArmVsubF64:
case kArmVcvtF64U32:
case kArmVcvtS32F64:
case kArmVcvtU32F64:
+ case kArmPush:
return false;
}
UNREACHABLE();
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject: {
- opcode = kArmCallCodeObject;
+ opcode = kArchCallCodeObject;
break;
}
case CallDescriptor::kCallAddress:
- opcode = kArmCallAddress;
+ opcode = kArchCallAddress;
break;
case CallDescriptor::kCallJSFunction:
- opcode = kArmCallJSFunction;
+ opcode = kArchCallJSFunction;
break;
default:
UNREACHABLE();
if (descriptor->kind() == CallDescriptor::kCallAddress &&
!buffer.pushed_nodes.empty()) {
DCHECK(deoptimization == NULL && continuation == NULL);
- Emit(kArmDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL);
+ Emit(kArchDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL);
}
}
Arm64OperandConverter i(this, instr);
InstructionCode opcode = instr->opcode();
switch (ArchOpcodeField::decode(opcode)) {
- case kArchJmp:
- __ B(code_->GetLabel(i.InputBlock(0)));
+ case kArchCallAddress: {
+ DirectCEntryStub stub(isolate());
+ stub.GenerateCall(masm(), i.InputRegister(0));
break;
- case kArchNop:
- // don't emit code for nops.
+ }
+ case kArchCallCodeObject: {
+ if (instr->InputAt(0)->IsImmediate()) {
+ __ Call(Handle<Code>::cast(i.InputHeapObject(0)),
+ RelocInfo::CODE_TARGET);
+ } else {
+ Register target = i.InputRegister(0);
+ __ Add(target, target, Code::kHeaderSize - kHeapObjectTag);
+ __ Call(target);
+ }
+ AddSafepointAndDeopt(instr);
+ // Meaningless instruction for ICs to overwrite.
+ AddNopForSmiCodeInlining();
break;
- case kArchRet:
- AssembleReturn();
+ }
+ case kArchCallJSFunction: {
+ // TODO(jarin) The load of the context should be separated from the call.
+ Register func = i.InputRegister(0);
+ __ Ldr(cp, FieldMemOperand(func, JSFunction::kContextOffset));
+ __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
+ __ Call(x10);
+ AddSafepointAndDeopt(instr);
break;
+ }
case kArchDeoptimize: {
int deoptimization_id = MiscField::decode(instr->opcode());
BuildTranslation(instr, 0, deoptimization_id);
-
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, Deoptimizer::LAZY);
__ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
break;
}
+ case kArchDrop: {
+ int words = MiscField::decode(instr->opcode());
+ __ Drop(words);
+ break;
+ }
+ case kArchJmp:
+ __ B(code_->GetLabel(i.InputBlock(0)));
+ break;
+ case kArchNop:
+ // don't emit code for nops.
+ break;
+ case kArchRet:
+ AssembleReturn();
+ break;
case kArchTruncateDoubleToI:
__ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0));
break;
case kArm64Sxtw:
__ Sxtw(i.OutputRegister(), i.InputRegister32(0));
break;
- case kArm64CallCodeObject: {
- if (instr->InputAt(0)->IsImmediate()) {
- Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0));
- __ Call(code, RelocInfo::CODE_TARGET);
- } else {
- Register reg = i.InputRegister(0);
- int entry = Code::kHeaderSize - kHeapObjectTag;
- __ Ldr(reg, MemOperand(reg, entry));
- __ Call(reg);
- }
-
- AddSafepointAndDeopt(instr);
- // Meaningless instruction for ICs to overwrite.
- AddNopForSmiCodeInlining();
- break;
- }
- case kArm64CallJSFunction: {
- Register func = i.InputRegister(0);
-
- // TODO(jarin) The load of the context should be separated from the call.
- __ Ldr(cp, FieldMemOperand(func, JSFunction::kContextOffset));
- __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
- __ Call(x10);
-
- AddSafepointAndDeopt(instr);
- break;
- }
- case kArm64CallAddress: {
- DirectCEntryStub stub(isolate());
- stub.GenerateCall(masm(), i.InputRegister(0));
- break;
- }
case kArm64Claim: {
int words = MiscField::decode(instr->opcode());
__ Claim(words);
__ PokePair(i.InputRegister(1), i.InputRegister(0), slot * kPointerSize);
break;
}
- case kArm64Drop: {
- int words = MiscField::decode(instr->opcode());
- __ Drop(words);
- break;
- }
case kArm64Cmp:
__ Cmp(i.InputRegister(0), i.InputOperand(1));
break;
V(Arm64Ror32) \
V(Arm64Mov32) \
V(Arm64Sxtw) \
- V(Arm64CallCodeObject) \
- V(Arm64CallJSFunction) \
- V(Arm64CallAddress) \
V(Arm64Claim) \
V(Arm64Poke) \
V(Arm64PokePairZero) \
V(Arm64PokePair) \
- V(Arm64Drop) \
V(Arm64Float64Cmp) \
V(Arm64Float64Add) \
V(Arm64Float64Sub) \
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject: {
- opcode = kArm64CallCodeObject;
+ opcode = kArchCallCodeObject;
break;
}
case CallDescriptor::kCallAddress:
- opcode = kArm64CallAddress;
+ opcode = kArchCallAddress;
break;
case CallDescriptor::kCallJSFunction:
- opcode = kArm64CallJSFunction;
+ opcode = kArchCallJSFunction;
break;
default:
UNREACHABLE();
// Caller clean up of stack for C-style calls.
if (is_c_frame && aligned_push_count > 0) {
DCHECK(deoptimization == NULL && continuation == NULL);
- Emit(kArm64Drop | MiscField::encode(aligned_push_count), NULL);
+ Emit(kArchDrop | MiscField::encode(aligned_push_count), NULL);
}
}
IA32OperandConverter i(this, instr);
switch (ArchOpcodeField::decode(instr->opcode())) {
- case kArchJmp:
- __ jmp(code()->GetLabel(i.InputBlock(0)));
+ case kArchCallAddress:
+ if (HasImmediateInput(instr, 0)) {
+ // TODO(dcarney): wire up EXTERNAL_REFERENCE instead of RUNTIME_ENTRY.
+ __ call(reinterpret_cast<byte*>(i.InputInt32(0)),
+ RelocInfo::RUNTIME_ENTRY);
+ } else {
+ __ call(i.InputRegister(0));
+ }
break;
- case kArchNop:
- // don't emit code for nops.
+ case kArchCallCodeObject: {
+ if (HasImmediateInput(instr, 0)) {
+ Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0));
+ __ call(code, RelocInfo::CODE_TARGET);
+ } else {
+ Register reg = i.InputRegister(0);
+ __ call(Operand(reg, Code::kHeaderSize - kHeapObjectTag));
+ }
+ AddSafepointAndDeopt(instr);
+ AddNopForSmiCodeInlining();
break;
- case kArchRet:
- AssembleReturn();
+ }
+ case kArchCallJSFunction: {
+ // TODO(jarin) The load of the context should be separated from the call.
+ Register func = i.InputRegister(0);
+ __ mov(esi, FieldOperand(func, JSFunction::kContextOffset));
+ __ call(FieldOperand(func, JSFunction::kCodeEntryOffset));
+ AddSafepointAndDeopt(instr);
break;
+ }
case kArchDeoptimize: {
int deoptimization_id = MiscField::decode(instr->opcode());
BuildTranslation(instr, 0, deoptimization_id);
__ call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
break;
}
+ case kArchDrop: {
+ int words = MiscField::decode(instr->opcode());
+ __ add(esp, Immediate(kPointerSize * words));
+ break;
+ }
+ case kArchJmp:
+ __ jmp(code()->GetLabel(i.InputBlock(0)));
+ break;
+ case kArchNop:
+ // don't emit code for nops.
+ break;
+ case kArchRet:
+ AssembleReturn();
+ break;
case kArchTruncateDoubleToI:
__ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0));
break;
__ ror_cl(i.OutputRegister());
}
break;
- case kIA32Push:
- if (HasImmediateInput(instr, 0)) {
- __ push(i.InputImmediate(0));
- } else {
- __ push(i.InputOperand(0));
- }
- break;
- case kIA32CallCodeObject: {
- if (HasImmediateInput(instr, 0)) {
- Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0));
- __ call(code, RelocInfo::CODE_TARGET);
- } else {
- Register reg = i.InputRegister(0);
- int entry = Code::kHeaderSize - kHeapObjectTag;
- __ call(Operand(reg, entry));
- }
-
- AddSafepointAndDeopt(instr);
-
- AddNopForSmiCodeInlining();
- break;
- }
- case kIA32CallAddress:
- if (HasImmediateInput(instr, 0)) {
- // TODO(dcarney): wire up EXTERNAL_REFERENCE instead of RUNTIME_ENTRY.
- __ call(reinterpret_cast<byte*>(i.InputInt32(0)),
- RelocInfo::RUNTIME_ENTRY);
- } else {
- __ call(i.InputRegister(0));
- }
- break;
- case kPopStack: {
- int words = MiscField::decode(instr->opcode());
- __ add(esp, Immediate(kPointerSize * words));
- break;
- }
- case kIA32CallJSFunction: {
- Register func = i.InputRegister(0);
-
- // TODO(jarin) The load of the context should be separated from the call.
- __ mov(esi, FieldOperand(func, JSFunction::kContextOffset));
- __ call(FieldOperand(func, JSFunction::kCodeEntryOffset));
-
- AddSafepointAndDeopt(instr);
- break;
- }
case kSSEFloat64Cmp:
__ ucomisd(i.InputDoubleRegister(0), i.InputOperand(1));
break;
__ movss(operand, xmm0);
}
break;
+ case kIA32Push:
+ if (HasImmediateInput(instr, 0)) {
+ __ push(i.InputImmediate(0));
+ } else {
+ __ push(i.InputOperand(0));
+ }
+ break;
case kIA32StoreWriteBarrier: {
Register object = i.InputRegister(0);
Register index = i.InputRegister(1);
V(IA32Shr) \
V(IA32Sar) \
V(IA32Ror) \
- V(IA32Push) \
- V(IA32CallCodeObject) \
- V(IA32CallAddress) \
- V(PopStack) \
- V(IA32CallJSFunction) \
V(SSEFloat64Cmp) \
V(SSEFloat64Add) \
V(SSEFloat64Sub) \
V(IA32Movl) \
V(IA32Movss) \
V(IA32Movsd) \
+ V(IA32Push) \
V(IA32StoreWriteBarrier)
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject: {
- opcode = kIA32CallCodeObject;
+ opcode = kArchCallCodeObject;
break;
}
case CallDescriptor::kCallAddress:
- opcode = kIA32CallAddress;
+ opcode = kArchCallAddress;
break;
case CallDescriptor::kCallJSFunction:
- opcode = kIA32CallJSFunction;
+ opcode = kArchCallJSFunction;
break;
default:
UNREACHABLE();
if (descriptor->kind() == CallDescriptor::kCallAddress &&
buffer.pushed_nodes.size() > 0) {
DCHECK(deoptimization == NULL && continuation == NULL);
- Emit(kPopStack | MiscField::encode(buffer.pushed_nodes.size()), NULL);
+ Emit(kArchDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL);
}
}
// Target-specific opcodes that specify which assembly sequence to emit.
// Most opcodes specify a single instruction.
#define ARCH_OPCODE_LIST(V) \
+ V(ArchCallAddress) \
+ V(ArchCallCodeObject) \
+ V(ArchCallJSFunction) \
V(ArchDeoptimize) \
+ V(ArchDrop) \
V(ArchJmp) \
V(ArchNop) \
V(ArchRet) \
X64OperandConverter i(this, instr);
switch (ArchOpcodeField::decode(instr->opcode())) {
- case kArchJmp:
- __ jmp(code_->GetLabel(i.InputBlock(0)));
+ case kArchCallCodeObject: {
+ if (HasImmediateInput(instr, 0)) {
+ Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0));
+ __ Call(code, RelocInfo::CODE_TARGET);
+ } else {
+ Register reg = i.InputRegister(0);
+ int entry = Code::kHeaderSize - kHeapObjectTag;
+ __ Call(Operand(reg, entry));
+ }
+ AddSafepointAndDeopt(instr);
+ AddNopForSmiCodeInlining();
break;
- case kArchNop:
- // don't emit code for nops.
+ }
+ case kArchCallAddress:
+ if (HasImmediateInput(instr, 0)) {
+ Immediate64 imm = i.InputImmediate64(0);
+ DCHECK_EQ(kImm64Value, imm.type);
+ __ Call(reinterpret_cast<byte*>(imm.value), RelocInfo::NONE64);
+ } else {
+ __ call(i.InputRegister(0));
+ }
break;
- case kArchRet:
- AssembleReturn();
+ case kArchCallJSFunction: {
+ // TODO(jarin) The load of the context should be separated from the call.
+ Register func = i.InputRegister(0);
+ __ movp(rsi, FieldOperand(func, JSFunction::kContextOffset));
+ __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset));
+ AddSafepointAndDeopt(instr);
break;
+ }
case kArchDeoptimize: {
int deoptimization_id = MiscField::decode(instr->opcode());
BuildTranslation(instr, 0, deoptimization_id);
-
Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
isolate(), deoptimization_id, Deoptimizer::LAZY);
__ call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
break;
}
+ case kArchDrop: {
+ int words = MiscField::decode(instr->opcode());
+ __ addq(rsp, Immediate(kPointerSize * words));
+ break;
+ }
+ case kArchJmp:
+ __ jmp(code_->GetLabel(i.InputBlock(0)));
+ break;
+ case kArchNop:
+ // don't emit code for nops.
+ break;
+ case kArchRet:
+ AssembleReturn();
+ break;
case kArchTruncateDoubleToI:
__ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0));
break;
case kX64Ror:
ASSEMBLE_SHIFT(rorq, 6);
break;
- case kX64Push: {
- RegisterOrOperand input = i.InputRegisterOrOperand(0);
- if (input.type == kRegister) {
- __ pushq(input.reg);
- } else {
- __ pushq(input.operand);
- }
- break;
- }
- case kX64PushI:
- __ pushq(i.InputImmediate(0));
- break;
- case kX64CallCodeObject: {
- if (HasImmediateInput(instr, 0)) {
- Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0));
- __ Call(code, RelocInfo::CODE_TARGET);
- } else {
- Register reg = i.InputRegister(0);
- int entry = Code::kHeaderSize - kHeapObjectTag;
- __ Call(Operand(reg, entry));
- }
-
- AddSafepointAndDeopt(instr);
-
- AddNopForSmiCodeInlining();
- break;
- }
- case kX64CallAddress:
- if (HasImmediateInput(instr, 0)) {
- Immediate64 imm = i.InputImmediate64(0);
- DCHECK_EQ(kImm64Value, imm.type);
- __ Call(reinterpret_cast<byte*>(imm.value), RelocInfo::NONE64);
- } else {
- __ call(i.InputRegister(0));
- }
- break;
- case kPopStack: {
- int words = MiscField::decode(instr->opcode());
- __ addq(rsp, Immediate(kPointerSize * words));
- break;
- }
- case kX64CallJSFunction: {
- Register func = i.InputRegister(0);
-
- // TODO(jarin) The load of the context should be separated from the call.
- __ movp(rsi, FieldOperand(func, JSFunction::kContextOffset));
- __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset));
-
- AddSafepointAndDeopt(instr);
- break;
- }
case kSSEFloat64Cmp: {
RegisterOrOperand input = i.InputRegisterOrOperand(1);
if (input.type == kDoubleRegister) {
__ cvtqsi2sd(i.OutputDoubleRegister(), i.InputRegister(0));
break;
}
-
case kX64Movsxbl:
__ movsxbl(i.OutputRegister(), i.MemoryOperand());
break;
__ movsd(operand, i.InputDoubleRegister(index));
}
break;
+ case kX64Push:
+ if (HasImmediateInput(instr, 0)) {
+ __ pushq(i.InputImmediate(0));
+ } else {
+ RegisterOrOperand input = i.InputRegisterOrOperand(0);
+ if (input.type == kRegister) {
+ __ pushq(input.reg);
+ } else {
+ __ pushq(input.operand);
+ }
+ }
+ break;
case kX64StoreWriteBarrier: {
Register object = i.InputRegister(0);
Register index = i.InputRegister(1);
V(X64Sar32) \
V(X64Ror) \
V(X64Ror32) \
- V(X64Push) \
- V(X64PushI) \
- V(X64CallCodeObject) \
- V(X64CallAddress) \
- V(PopStack) \
- V(X64CallJSFunction) \
V(SSEFloat64Cmp) \
V(SSEFloat64Add) \
V(SSEFloat64Sub) \
V(X64Movq) \
V(X64Movsd) \
V(X64Movss) \
+ V(X64Push) \
V(X64StoreWriteBarrier)
for (NodeVectorRIter input = buffer.pushed_nodes.rbegin();
input != buffer.pushed_nodes.rend(); input++) {
// TODO(titzer): handle pushing double parameters.
- if (g.CanBeImmediate(*input)) {
- Emit(kX64PushI, NULL, g.UseImmediate(*input));
- } else {
- Emit(kX64Push, NULL, g.Use(*input));
- }
+ Emit(kX64Push, NULL,
+ g.CanBeImmediate(*input) ? g.UseImmediate(*input) : g.Use(*input));
}
// Select the appropriate opcode based on the call type.
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject: {
- opcode = kX64CallCodeObject;
+ opcode = kArchCallCodeObject;
break;
}
case CallDescriptor::kCallAddress:
- opcode = kX64CallAddress;
+ opcode = kArchCallAddress;
break;
case CallDescriptor::kCallJSFunction:
- opcode = kX64CallJSFunction;
+ opcode = kArchCallJSFunction;
break;
default:
UNREACHABLE();
if (descriptor->kind() == CallDescriptor::kCallAddress &&
!buffer.pushed_nodes.empty()) {
DCHECK(deoptimization == NULL && continuation == NULL);
- Emit(kPopStack |
+ Emit(kArchDrop |
MiscField::encode(static_cast<int>(buffer.pushed_nodes.size())),
NULL);
}