Index: runtime/vm/intermediate_language_x64.cc |
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc |
index ac9d6f854b467f7c91ac49d1bf7ab9e1b4342d5f..aa345d2299df7a13acd7325b84c976962f7c8411 100644 |
--- a/runtime/vm/intermediate_language_x64.cc |
+++ b/runtime/vm/intermediate_language_x64.cc |
@@ -1089,13 +1089,10 @@ static bool CanBeImmediateIndex(Value* index, intptr_t cid) { |
LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { |
const intptr_t kNumInputs = 1; |
- const intptr_t kNumTemps = 0; |
- LocationSummary* locs = |
- new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
// TODO(fschneider): Allow immediate operands for the char code. |
- locs->set_in(0, Location::RequiresRegister()); |
- locs->set_out(Location::RequiresRegister()); |
- return locs; |
+ return LocationSummary::Make(kNumInputs, |
+ Location::RequiresRegister(), |
+ LocationSummary::kNoCall); |
} |
@@ -1113,12 +1110,9 @@ void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
LocationSummary* LoadUntaggedInstr::MakeLocationSummary() const { |
const intptr_t kNumInputs = 1; |
- const intptr_t kNumTemps = 0; |
- LocationSummary* locs = |
- new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
- locs->set_in(0, Location::RequiresRegister()); |
- locs->set_out(Location::RequiresRegister()); |
- return locs; |
+ return LocationSummary::Make(kNumInputs, |
+ Location::RequiresRegister(), |
+ LocationSummary::kNoCall); |
} |
@@ -1129,6 +1123,29 @@ void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
} |
+LocationSummary* LoadClassIdInstr::MakeLocationSummary() const { |
+ const intptr_t kNumInputs = 1; |
+ return LocationSummary::Make(kNumInputs, |
+ Location::RequiresRegister(), |
+ LocationSummary::kNoCall); |
+} |
+ |
+ |
+void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
+ Register object = locs()->in(0).reg(); |
+ Register result = locs()->out().reg(); |
+ Label load, done; |
+ __ testq(object, Immediate(kSmiTagMask)); |
+ __ j(NOT_ZERO, &load, Assembler::kNearJump); |
+ __ movq(result, Immediate(Smi::RawValue(kSmiCid))); |
+ __ jmp(&done); |
+ __ Bind(&load); |
+ __ LoadClassId(result, object); |
+ __ SmiTag(result); |
+ __ Bind(&done); |
+} |
+ |
+ |
CompileType LoadIndexedInstr::ComputeType() const { |
switch (class_id_) { |
case kArrayCid: |
@@ -2747,12 +2764,9 @@ void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary() const { |
const intptr_t kNumInputs = 1; |
- const intptr_t kNumTemps = 0; |
- LocationSummary* summary = |
- new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
- summary->set_in(0, Location::RequiresRegister()); |
- summary->set_out(Location::RequiresFpuRegister()); |
- return summary; |
+ return LocationSummary::Make(kNumInputs, |
+ Location::RequiresFpuRegister(), |
+ LocationSummary::kNoCall); |
} |
@@ -3191,12 +3205,9 @@ void MathSqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const { |
const intptr_t kNumInputs = 1; |
- const intptr_t kNumTemps = 0; |
- LocationSummary* summary = |
- new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
- summary->set_in(0, Location::RequiresRegister()); |
- summary->set_out(Location::SameAsFirstInput()); |
- return summary; |
+ return LocationSummary::Make(kNumInputs, |
+ Location::SameAsFirstInput(), |
+ LocationSummary::kNoCall); |
} |
@@ -3278,7 +3289,7 @@ void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
const intptr_t kNumberOfArguments = 1; |
__ pushq(value_obj); |
- compiler->GenerateStaticCall(instance_call()->deopt_id(), |
+ compiler->GenerateStaticCall(deopt_id(), |
instance_call()->token_pos(), |
target, |
kNumberOfArguments, |
@@ -3387,7 +3398,7 @@ LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const { |
void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
- Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), |
+ Label* deopt = compiler->AddDeoptStub(deopt_id(), |
kDeoptPolymorphicInstanceCallTestFail); |
if (ic_data().NumberOfChecks() == 0) { |
__ jmp(deopt); |
@@ -3397,7 +3408,7 @@ void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
if (!with_checks()) { |
ASSERT(ic_data().HasOneTarget()); |
const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); |
- compiler->GenerateStaticCall(instance_call()->deopt_id(), |
+ compiler->GenerateStaticCall(deopt_id(), |
instance_call()->token_pos(), |
target, |
instance_call()->ArgumentCount(), |
@@ -3416,7 +3427,7 @@ void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
instance_call()->ArgumentCount(), |
instance_call()->argument_names(), |
deopt, |
- instance_call()->deopt_id(), |
+ deopt_id(), |
instance_call()->token_pos(), |
locs()); |
} |