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

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: Eliminate CoreClass helpers on ia32/x64 and use class ids for array classes. 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intrinsifier_ia32.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 aeb58d946e04806232e821475836cbdd2ffea35f..263dc6af47117f3500a43278ef1022af23ec8f8a 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,7 @@ 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()));
+ __ CompareClassId(instantiator_reg, kTypeArguments);
__ j(NOT_EQUAL, &type_arguments_uninstantiated, Assembler::kNearJump);
Immediate arguments_length =
Immediate(Smi::RawValue(type_arguments().Length()));
@@ -730,8 +727,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 +750,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 +762,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 +795,7 @@ 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()));
+ __ CompareClassId(instantiator_reg, kTypeArguments);
__ j(NOT_EQUAL, &done, Assembler::kNearJump);
Immediate arguments_length =
Immediate(Smi::RawValue(type_arguments().Length()));
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698