Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(875)

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 10917085: Revert "Remove classes Computation and BindInstr." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_test.cc ('k') | runtime/vm/locations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index ed93b9171aedf2bacbcf11f7f6c6346bbf271ae1..6814942e75be07e4ec56fd185dd68c2c5d82c9db 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -24,13 +24,21 @@ DECLARE_FLAG(bool, trace_functions);
// Generic summary for call instructions that have all arguments pushed
// on the stack and return the result in a fixed register RAX.
-LocationSummary* Instruction::MakeCallSummary() {
+LocationSummary* Computation::MakeCallSummary() {
LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall);
result->set_out(Location::RegisterLocation(RAX));
return result;
}
+void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ computation()->EmitNativeCode(compiler);
+ if (is_used() && !compiler->is_optimizing()) {
+ __ pushq(locs()->out().reg());
+ }
+}
+
+
LocationSummary* ReturnInstr::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 1;
@@ -119,7 +127,7 @@ void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* ClosureCallInstr::MakeLocationSummary() const {
+LocationSummary* ClosureCallComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 1;
LocationSummary* result =
@@ -130,27 +138,27 @@ LocationSummary* ClosureCallInstr::MakeLocationSummary() const {
}
-LocationSummary* LoadLocalInstr::MakeLocationSummary() const {
+LocationSummary* LoadLocalComp::MakeLocationSummary() const {
return LocationSummary::Make(0,
Location::RequiresRegister(),
LocationSummary::kNoCall);
}
-void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void LoadLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register result = locs()->out().reg();
__ movq(result, Address(RBP, local().index() * kWordSize));
}
-LocationSummary* StoreLocalInstr::MakeLocationSummary() const {
+LocationSummary* StoreLocalComp::MakeLocationSummary() const {
return LocationSummary::Make(1,
Location::SameAsFirstInput(),
LocationSummary::kNoCall);
}
-void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void StoreLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register value = locs()->in(0).reg();
Register result = locs()->out().reg();
ASSERT(result == value); // Assert that register assignment is correct.
@@ -158,15 +166,15 @@ void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* ConstantInstr::MakeLocationSummary() const {
+LocationSummary* ConstantComp::MakeLocationSummary() const {
return LocationSummary::Make(0,
Location::RequiresRegister(),
LocationSummary::kNoCall);
}
-void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- // The register allocator drops constant definitions that have no uses.
+void ConstantComp::EmitNativeCode(FlowGraphCompiler* compiler) {
+ // Register allocator drops constant definitions that have no uses.
if (!locs()->out().IsInvalid()) {
Register result = locs()->out().reg();
__ LoadObject(result, value());
@@ -174,7 +182,7 @@ void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* AssertAssignableInstr::MakeLocationSummary() const {
+LocationSummary* AssertAssignableComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 3;
const intptr_t kNumTemps = 0;
LocationSummary* summary =
@@ -187,7 +195,7 @@ LocationSummary* AssertAssignableInstr::MakeLocationSummary() const {
}
-LocationSummary* AssertBooleanInstr::MakeLocationSummary() const {
+LocationSummary* AssertBooleanComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -198,7 +206,7 @@ LocationSummary* AssertBooleanInstr::MakeLocationSummary() const {
}
-void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register obj = locs()->in(0).reg();
Register result = locs()->out().reg();
@@ -223,7 +231,7 @@ void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* ArgumentDefinitionTestInstr::MakeLocationSummary() const {
+LocationSummary* ArgumentDefinitionTestComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -234,7 +242,7 @@ LocationSummary* ArgumentDefinitionTestInstr::MakeLocationSummary() const {
}
-void ArgumentDefinitionTestInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void ArgumentDefinitionTestComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register saved_args_desc = locs()->in(0).reg();
Register result = locs()->out().reg();
@@ -266,7 +274,7 @@ static Condition TokenKindToSmiCondition(Token::Kind kind) {
}
-LocationSummary* EqualityCompareInstr::MakeLocationSummary() const {
+LocationSummary* EqualityCompareComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
const bool is_checked_strict_equal =
HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
@@ -619,7 +627,7 @@ static void EmitDoubleComparisonOp(FlowGraphCompiler* compiler,
}
-void EqualityCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void EqualityCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT((kind() == Token::kEQ) || (kind() == Token::kNE));
BranchInstr* kNoBranch = NULL;
if (receiver_class_id() == kSmiCid) {
@@ -657,8 +665,8 @@ void EqualityCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
- BranchInstr* branch) {
+void EqualityCompareComp::EmitBranchCode(FlowGraphCompiler* compiler,
+ BranchInstr* branch) {
ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
if (receiver_class_id() == kSmiCid) {
// Deoptimizes if both arguments not Smi.
@@ -697,7 +705,7 @@ void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
}
-LocationSummary* RelationalOpInstr::MakeLocationSummary() const {
+LocationSummary* RelationalOpComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
if (operands_class_id() == kDoubleCid) {
const intptr_t kNumTemps = 0;
@@ -728,7 +736,7 @@ LocationSummary* RelationalOpInstr::MakeLocationSummary() const {
}
-void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void RelationalOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
if (operands_class_id() == kSmiCid) {
EmitSmiComparisonOp(compiler, *locs(), kind(), NULL);
return;
@@ -785,8 +793,8 @@ void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
- BranchInstr* branch) {
+void RelationalOpComp::EmitBranchCode(FlowGraphCompiler* compiler,
+ BranchInstr* branch) {
if (operands_class_id() == kSmiCid) {
EmitSmiComparisonOp(compiler, *locs(), kind(), branch);
return;
@@ -801,7 +809,7 @@ void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
}
-LocationSummary* NativeCallInstr::MakeLocationSummary() const {
+LocationSummary* NativeCallComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 3;
LocationSummary* locs =
@@ -814,7 +822,7 @@ LocationSummary* NativeCallInstr::MakeLocationSummary() const {
}
-void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(locs()->temp(0).reg() == RAX);
ASSERT(locs()->temp(1).reg() == RBX);
ASSERT(locs()->temp(2).reg() == R10);
@@ -843,7 +851,7 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* LoadIndexedInstr::MakeLocationSummary() const {
+LocationSummary* LoadIndexedComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
if (receiver_type() == kGrowableObjectArrayCid) {
const intptr_t kNumTemps = 1;
@@ -864,7 +872,7 @@ LocationSummary* LoadIndexedInstr::MakeLocationSummary() const {
}
-void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void LoadIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register receiver = locs()->in(0).reg();
Register index = locs()->in(1).reg();
Register result = locs()->out().reg();
@@ -893,7 +901,7 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* StoreIndexedInstr::MakeLocationSummary() const {
+LocationSummary* StoreIndexedComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 3;
if (receiver_type() == kGrowableObjectArrayCid) {
const intptr_t kNumTemps = 1;
@@ -913,7 +921,7 @@ LocationSummary* StoreIndexedInstr::MakeLocationSummary() const {
}
-void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void StoreIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register receiver = locs()->in(0).reg();
Register index = locs()->in(1).reg();
Register value = locs()->in(2).reg();
@@ -958,7 +966,7 @@ void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* LoadInstanceFieldInstr::MakeLocationSummary() const {
+LocationSummary* LoadInstanceFieldComp::MakeLocationSummary() const {
// TODO(fschneider): For this instruction the input register may be
// reused for the result (but is not required to) because the input
// is not used after the result is defined. We should consider adding
@@ -969,14 +977,14 @@ LocationSummary* LoadInstanceFieldInstr::MakeLocationSummary() const {
}
-void LoadInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void LoadInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register instance_reg = locs()->in(0).reg();
Register result_reg = locs()->out().reg();
__ movq(result_reg, FieldAddress(instance_reg, field().Offset()));
}
-LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const {
+LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
const intptr_t num_temps = 0;
LocationSummary* summary =
@@ -987,7 +995,7 @@ LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const {
}
-void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register instance_reg = locs()->in(0).reg();
Register value_reg = locs()->in(1).reg();
if (this->value()->NeedsStoreBuffer()) {
@@ -1000,21 +1008,21 @@ void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const {
+LocationSummary* LoadStaticFieldComp::MakeLocationSummary() const {
return LocationSummary::Make(0,
Location::RequiresRegister(),
LocationSummary::kNoCall);
}
-void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void LoadStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register result = locs()->out().reg();
__ LoadObject(result, field());
__ movq(result, FieldAddress(result, Field::value_offset()));
}
-LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const {
+LocationSummary* StoreStaticFieldComp::MakeLocationSummary() const {
LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall);
locs->set_in(0, Location::RequiresRegister());
locs->set_temp(0, Location::RequiresRegister());
@@ -1023,7 +1031,7 @@ LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const {
}
-void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void StoreStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register value = locs()->in(0).reg();
Register temp = locs()->temp(0).reg();
ASSERT(locs()->out().reg() == value);
@@ -1038,7 +1046,7 @@ void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* InstanceOfInstr::MakeLocationSummary() const {
+LocationSummary* InstanceOfComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 3;
const intptr_t kNumTemps = 0;
LocationSummary* summary =
@@ -1051,7 +1059,7 @@ LocationSummary* InstanceOfInstr::MakeLocationSummary() const {
}
-void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void InstanceOfComp::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(locs()->in(0).reg() == RAX); // Value.
ASSERT(locs()->in(1).reg() == RCX); // Instantiator.
ASSERT(locs()->in(2).reg() == RDX); // Instantiator type arguments.
@@ -1064,7 +1072,7 @@ void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* CreateArrayInstr::MakeLocationSummary() const {
+LocationSummary* CreateArrayComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -1075,7 +1083,7 @@ LocationSummary* CreateArrayInstr::MakeLocationSummary() const {
}
-void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) {
// Allocate the array. R10 = length, RBX = element type.
ASSERT(locs()->in(0).reg() == RBX);
__ movq(R10, Immediate(Smi::RawValue(ArgumentCount())));
@@ -1094,7 +1102,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary*
-AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const {
+ AllocateObjectWithBoundsCheckComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -1106,7 +1114,7 @@ AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const {
}
-void AllocateObjectWithBoundsCheckInstr::EmitNativeCode(
+void AllocateObjectWithBoundsCheckComp::EmitNativeCode(
FlowGraphCompiler* compiler) {
const Class& cls = Class::ZoneHandle(constructor().Owner());
Register type_arguments = locs()->in(0).reg();
@@ -1127,14 +1135,14 @@ void AllocateObjectWithBoundsCheckInstr::EmitNativeCode(
}
-LocationSummary* LoadVMFieldInstr::MakeLocationSummary() const {
+LocationSummary* LoadVMFieldComp::MakeLocationSummary() const {
return LocationSummary::Make(1,
Location::RequiresRegister(),
LocationSummary::kNoCall);
}
-void LoadVMFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void LoadVMFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register instance_reg = locs()->in(0).reg();
Register result_reg = locs()->out().reg();
@@ -1142,7 +1150,7 @@ void LoadVMFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
+LocationSummary* InstantiateTypeArgumentsComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -1153,7 +1161,7 @@ LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
}
-void InstantiateTypeArgumentsInstr::EmitNativeCode(
+void InstantiateTypeArgumentsComp::EmitNativeCode(
FlowGraphCompiler* compiler) {
Register instantiator_reg = locs()->in(0).reg();
Register result_reg = locs()->out().reg();
@@ -1202,7 +1210,7 @@ void InstantiateTypeArgumentsInstr::EmitNativeCode(
LocationSummary*
-ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const {
+ ExtractConstructorTypeArgumentsComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -1213,7 +1221,7 @@ ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const {
}
-void ExtractConstructorTypeArgumentsInstr::EmitNativeCode(
+void ExtractConstructorTypeArgumentsComp::EmitNativeCode(
FlowGraphCompiler* compiler) {
Register instantiator_reg = locs()->in(0).reg();
Register result_reg = locs()->out().reg();
@@ -1258,7 +1266,7 @@ void ExtractConstructorTypeArgumentsInstr::EmitNativeCode(
LocationSummary*
-ExtractConstructorInstantiatorInstr::MakeLocationSummary() const {
+ ExtractConstructorInstantiatorComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -1269,7 +1277,7 @@ ExtractConstructorInstantiatorInstr::MakeLocationSummary() const {
}
-void ExtractConstructorInstantiatorInstr::EmitNativeCode(
+void ExtractConstructorInstantiatorComp::EmitNativeCode(
FlowGraphCompiler* compiler) {
Register instantiator_reg = locs()->in(0).reg();
ASSERT(locs()->out().reg() == instantiator_reg);
@@ -1322,7 +1330,7 @@ void ExtractConstructorInstantiatorInstr::EmitNativeCode(
}
-LocationSummary* AllocateContextInstr::MakeLocationSummary() const {
+LocationSummary* AllocateContextComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 1;
LocationSummary* locs =
@@ -1333,7 +1341,7 @@ LocationSummary* AllocateContextInstr::MakeLocationSummary() const {
}
-void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void AllocateContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(locs()->temp(0).reg() == R10);
ASSERT(locs()->out().reg() == RAX);
@@ -1347,7 +1355,7 @@ void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* CloneContextInstr::MakeLocationSummary() const {
+LocationSummary* CloneContextComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -1358,7 +1366,7 @@ LocationSummary* CloneContextInstr::MakeLocationSummary() const {
}
-void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register context_value = locs()->in(0).reg();
Register result = locs()->out().reg();
@@ -1372,7 +1380,7 @@ void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* CatchEntryInstr::MakeLocationSummary() const {
+LocationSummary* CatchEntryComp::MakeLocationSummary() const {
return LocationSummary::Make(0,
Location::NoLocation(),
LocationSummary::kNoCall);
@@ -1381,7 +1389,7 @@ LocationSummary* CatchEntryInstr::MakeLocationSummary() const {
// Restore stack and initialize the two exception variables:
// exception and stack trace variables.
-void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void CatchEntryComp::EmitNativeCode(FlowGraphCompiler* compiler) {
// Restore RSP from RBP as we are coming from a throw and the code for
// popping arguments has not been run.
const intptr_t locals_space_size = compiler->StackSize() * kWordSize;
@@ -1399,7 +1407,7 @@ void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const {
+LocationSummary* CheckStackOverflowComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 1;
LocationSummary* summary =
@@ -1413,25 +1421,25 @@ LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const {
class CheckStackOverflowSlowPath : public SlowPathCode {
public:
- explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
- : instruction_(instruction) { }
+ explicit CheckStackOverflowSlowPath(CheckStackOverflowComp* computation)
+ : computation_(computation) { }
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
__ Bind(entry_label());
- compiler->SaveLiveRegisters(instruction_->locs());
- compiler->GenerateCallRuntime(instruction_->token_pos(),
+ compiler->SaveLiveRegisters(computation_->locs());
+ compiler->GenerateCallRuntime(computation_->token_pos(),
kStackOverflowRuntimeEntry,
- instruction_->locs());
- compiler->RestoreLiveRegisters(instruction_->locs());
+ computation_->locs());
+ compiler->RestoreLiveRegisters(computation_->locs());
__ jmp(exit_label());
}
private:
- CheckStackOverflowInstr* instruction_;
+ CheckStackOverflowComp* computation_;
};
-void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void CheckStackOverflowComp::EmitNativeCode(FlowGraphCompiler* compiler) {
CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this);
compiler->AddSlowPathCode(slow_path);
@@ -1449,10 +1457,10 @@ static bool CanBeImmediate(const Object& constant) {
Immediate(reinterpret_cast<int64_t>(constant.raw())).is_int32();
}
-LocationSummary* BinarySmiOpInstr::MakeLocationSummary() const {
+LocationSummary* BinarySmiOpComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
- ConstantInstr* right_constant = right()->definition()->AsConstant();
+ ConstantComp* right_constant = right()->definition()->AsConstant();
if ((right_constant != NULL) &&
(op_kind() != Token::kTRUNCDIV) &&
(op_kind() != Token::kSHL) &&
@@ -1510,7 +1518,7 @@ LocationSummary* BinarySmiOpInstr::MakeLocationSummary() const {
}
-void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void BinarySmiOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register left = locs()->in(0).reg();
Register result = locs()->out().reg();
ASSERT(left == result);
@@ -1725,7 +1733,7 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* BinaryMintOpInstr::MakeLocationSummary() const {
+LocationSummary* BinaryMintOpComp::MakeLocationSummary() const {
ASSERT(op_kind() == Token::kBIT_AND);
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
@@ -1738,7 +1746,7 @@ LocationSummary* BinaryMintOpInstr::MakeLocationSummary() const {
}
-void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void BinaryMintOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
// TODO(regis): For now, we only support Token::kBIT_AND for a Mint or Smi
// receiver and a Mint or Smi argument. We fall back to the run time call if
// both receiver and argument are Mint or if one of them is Mint and the other
@@ -1827,7 +1835,7 @@ void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary() const {
+LocationSummary* CheckEitherNonSmiComp::MakeLocationSummary() const {
ASSERT((left()->ResultCid() != kDoubleCid) &&
(right()->ResultCid() != kDoubleCid));
const intptr_t kNumInputs = 2;
@@ -1841,8 +1849,10 @@ LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary() const {
}
-void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- Label* deopt = compiler->AddDeoptStub(deopt_id(), kDeoptBinaryDoubleOp);
+void CheckEitherNonSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Label* deopt = compiler->AddDeoptStub(instance_call_->deopt_id(),
+ kDeoptBinaryDoubleOp);
+
Register temp = locs()->temp(0).reg();
__ movq(temp, locs()->in(0).reg());
__ orq(temp, locs()->in(1).reg());
@@ -1851,7 +1861,7 @@ void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* BoxDoubleInstr::MakeLocationSummary() const {
+LocationSummary* BoxDoubleComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* summary =
@@ -1866,8 +1876,8 @@ LocationSummary* BoxDoubleInstr::MakeLocationSummary() const {
class BoxDoubleSlowPath : public SlowPathCode {
public:
- explicit BoxDoubleSlowPath(BoxDoubleInstr* instruction)
- : instruction_(instruction) { }
+ explicit BoxDoubleSlowPath(BoxDoubleComp* computation)
+ : computation_(computation) { }
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
__ Bind(entry_label());
@@ -1876,11 +1886,11 @@ class BoxDoubleSlowPath : public SlowPathCode {
Code::Handle(StubCode::GetAllocationStubForClass(double_class));
const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = computation_->locs();
locs->live_registers()->Remove(locs->out());
compiler->SaveLiveRegisters(locs);
- compiler->GenerateCall(instruction_->token_pos(),
+ compiler->GenerateCall(computation_->token_pos(),
&label,
PcDescriptors::kOther,
locs);
@@ -1891,11 +1901,11 @@ class BoxDoubleSlowPath : public SlowPathCode {
}
private:
- BoxDoubleInstr* instruction_;
+ BoxDoubleComp* computation_;
};
-void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void BoxDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
compiler->AddSlowPathCode(slow_path);
@@ -1912,7 +1922,7 @@ void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const {
+LocationSummary* UnboxDoubleComp::MakeLocationSummary() const {
const intptr_t v_cid = value()->ResultCid();
const intptr_t kNumInputs = 1;
@@ -1926,7 +1936,7 @@ LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const {
}
-void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void UnboxDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
const intptr_t v_cid = value()->ResultCid();
const Register value = locs()->in(0).reg();
@@ -1943,7 +1953,7 @@ void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* UnboxedDoubleBinaryOpInstr::MakeLocationSummary() const {
+LocationSummary* UnboxedDoubleBinaryOpComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
LocationSummary* summary =
@@ -1955,7 +1965,7 @@ LocationSummary* UnboxedDoubleBinaryOpInstr::MakeLocationSummary() const {
}
-void UnboxedDoubleBinaryOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void UnboxedDoubleBinaryOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
XmmRegister left = locs()->in(0).xmm_reg();
XmmRegister right = locs()->in(1).xmm_reg();
@@ -1971,7 +1981,7 @@ void UnboxedDoubleBinaryOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const {
+LocationSummary* UnarySmiOpComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* summary =
@@ -1982,7 +1992,7 @@ LocationSummary* UnarySmiOpInstr::MakeLocationSummary() const {
}
-void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void UnarySmiOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register value = locs()->in(0).reg();
ASSERT(value == locs()->out().reg());
switch (op_kind()) {
@@ -2003,7 +2013,7 @@ void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* NumberNegateInstr::MakeLocationSummary() const {
+LocationSummary* NumberNegateComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 1; // Needed for doubles.
LocationSummary* summary =
@@ -2015,7 +2025,7 @@ LocationSummary* NumberNegateInstr::MakeLocationSummary() const {
}
-void NumberNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void NumberNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) {
const ICData& ic_data = *instance_call()->ic_data();
ASSERT(!ic_data.IsNull());
ASSERT(ic_data.num_args_tested() == 1);
@@ -2061,7 +2071,7 @@ void NumberNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const {
+LocationSummary* DoubleToDoubleComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -2072,7 +2082,7 @@ LocationSummary* DoubleToDoubleInstr::MakeLocationSummary() const {
}
-void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void DoubleToDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register value = locs()->in(0).reg();
Register result = locs()->out().reg();
@@ -2087,12 +2097,12 @@ void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* SmiToDoubleInstr::MakeLocationSummary() const {
+LocationSummary* SmiToDoubleComp::MakeLocationSummary() const {
return MakeCallSummary(); // Calls a stub to allocate result.
}
-void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void SmiToDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register result = locs()->out().reg();
Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
@@ -2123,12 +2133,12 @@ void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary() const {
+LocationSummary* PolymorphicInstanceCallComp::MakeLocationSummary() const {
return MakeCallSummary();
}
-void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(),
kDeoptPolymorphicInstanceCallTestFail);
if (ic_data().NumberOfChecks() == 0) {
@@ -2167,18 +2177,12 @@ void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* BranchInstr::MakeLocationSummary() const {
- UNREACHABLE();
- return NULL;
-}
-
-
void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- comparison()->EmitBranchCode(compiler, this);
+ computation()->EmitBranchCode(compiler, this);
}
-LocationSummary* CheckClassInstr::MakeLocationSummary() const {
+LocationSummary* CheckClassComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 1;
LocationSummary* summary =
@@ -2189,7 +2193,7 @@ LocationSummary* CheckClassInstr::MakeLocationSummary() const {
}
-void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void CheckClassComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register value = locs()->in(0).reg();
Register temp = locs()->temp(0).reg();
Label* deopt = compiler->AddDeoptStub(deopt_id(),
@@ -2217,7 +2221,7 @@ void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* CheckSmiInstr::MakeLocationSummary() const {
+LocationSummary* CheckSmiComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
LocationSummary* summary =
@@ -2227,7 +2231,7 @@ LocationSummary* CheckSmiInstr::MakeLocationSummary() const {
}
-void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void CheckSmiComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register value = locs()->in(0).reg();
Label* deopt = compiler->AddDeoptStub(deopt_id(),
kDeoptCheckSmi);
@@ -2236,7 +2240,7 @@ void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* CheckArrayBoundInstr::MakeLocationSummary() const {
+LocationSummary* CheckArrayBoundComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
LocationSummary* locs =
@@ -2247,7 +2251,7 @@ LocationSummary* CheckArrayBoundInstr::MakeLocationSummary() const {
}
-void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+void CheckArrayBoundComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register receiver = locs()->in(0).reg();
const DeoptReasonId deopt_reason =
« no previous file with comments | « runtime/vm/intermediate_language_test.cc ('k') | runtime/vm/locations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698