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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 14740005: Initial support for polymorphic inlining. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 7 years, 7 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_mips.cc ('k') | no next file » | 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 989c41b4b2e3cf525eb39418bd153503aa0200bf..0a9704c8ececcaac685d9fcc8624744b9e8b6722 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);
}
@@ -3324,12 +3338,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);
}
@@ -3411,7 +3422,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,
@@ -3520,7 +3531,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);
@@ -3530,7 +3541,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(),
@@ -3549,7 +3560,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());
}
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698