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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 10458031: In generated code for x64 don't load object's class directly from class_ field. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: CoreClass in flow_graph_compiler_x64.cc should return RawClass* Created 8 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
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index aeb58d946e04806232e821475836cbdd2ffea35f..70a9c5480c3d044204597ddebdcadbb45986dbda 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -677,10 +677,9 @@ void StoreVMFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* InstantiateTypeArgumentsComp::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
- const intptr_t kNumTemps = 1;
+ const intptr_t kNumTemps = 0;
LocationSummary* locs = new LocationSummary(kNumInputs, kNumTemps);
locs->set_in(0, Location::RequiresRegister());
- locs->set_temp(0, Location::RequiresRegister());
locs->set_out(Location::SameAsFirstInput());
return locs;
}
@@ -688,7 +687,6 @@ LocationSummary* InstantiateTypeArgumentsComp::MakeLocationSummary() const {
void InstantiateTypeArgumentsComp::EmitNativeCode(FlowGraphCompiler* compiler) {
Register instantiator_reg = locs()->in(0).reg();
- Register temp_reg = locs()->temp(0).reg();
Register result_reg = locs()->out().reg();
// 'instantiator_reg' is the instantiator AbstractTypeArguments object
@@ -712,8 +710,8 @@ void InstantiateTypeArgumentsComp::EmitNativeCode(FlowGraphCompiler* compiler) {
// No need to check the instantiator ('instantiator_reg') for null here,
// because a null instantiator will have the wrong class (Null instead of
// TypeArguments).
- __ LoadObject(temp_reg, Class::ZoneHandle(Object::type_arguments_class()));
- __ cmpq(temp_reg, FieldAddress(instantiator_reg, Object::class_offset()));
+ __ CompareClassOfObject(instantiator_reg,
+ Class::Handle(Object::type_arguments_class()));
__ j(NOT_EQUAL, &type_arguments_uninstantiated, Assembler::kNearJump);
Immediate arguments_length =
Immediate(Smi::RawValue(type_arguments().Length()));
@@ -730,8 +728,7 @@ void InstantiateTypeArgumentsComp::EmitNativeCode(FlowGraphCompiler* compiler) {
token_index(),
try_index(),
kInstantiateTypeArgumentsRuntimeEntry);
- __ popq(temp_reg); // Pop instantiator type arguments.
- __ popq(temp_reg); // Pop uninstantiated type arguments.
+ __ Drop(2); // Drop instantiator and uninstantiated type arguments.
__ popq(result_reg); // Pop instantiated type arguments.
__ Bind(&type_arguments_instantiated);
ASSERT(instantiator_reg == result_reg);
@@ -754,10 +751,9 @@ void ExtractConstructorTypeArgumentsComp::EmitNativeCode(
LocationSummary* ExtractConstructorInstantiatorComp::
MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
- const intptr_t kNumTemps = 1;
+ const intptr_t kNumTemps = 0;
LocationSummary* locs = new LocationSummary(kNumInputs, kNumTemps);
locs->set_in(0, Location::RequiresRegister());
- locs->set_temp(0, Location::RequiresRegister());
locs->set_out(Location::SameAsFirstInput());
return locs;
}
@@ -767,7 +763,6 @@ void ExtractConstructorInstantiatorComp::EmitNativeCode(
FlowGraphCompiler* compiler) {
ASSERT(instantiator()->IsUse());
Register instantiator_reg = locs()->in(0).reg();
- Register temp_reg = locs()->temp(0).reg();
ASSERT(locs()->out().reg() == instantiator_reg);
// instantiator_reg is the instantiator AbstractTypeArguments object
@@ -801,8 +796,8 @@ void ExtractConstructorInstantiatorComp::EmitNativeCode(
// matching length and, if so, use it as the instantiated type_arguments.
// No need to check the instantiator (RAX) for null here, because a null
// instantiator will have the wrong class (Null instead of TypeArguments).
- __ LoadObject(temp_reg, Class::ZoneHandle(Object::type_arguments_class()));
- __ cmpq(temp_reg, FieldAddress(instantiator_reg, Object::class_offset()));
+ __ CompareClassOfObject(instantiator_reg,
+ Class::Handle(Object::type_arguments_class()));
__ j(NOT_EQUAL, &done, Assembler::kNearJump);
Immediate arguments_length =
Immediate(Smi::RawValue(type_arguments().Length()));

Powered by Google App Engine
This is Rietveld 408576698