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

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: 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..7530134dfb0c7e4e3f8f442a7fb234fcda129b27 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -712,8 +712,9 @@ 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()),
+ temp_reg);
__ j(NOT_EQUAL, &type_arguments_uninstantiated, Assembler::kNearJump);
Immediate arguments_length =
Immediate(Smi::RawValue(type_arguments().Length()));
@@ -801,8 +802,9 @@ 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()),
+ temp_reg);
__ j(NOT_EQUAL, &done, Assembler::kNearJump);
Immediate arguments_length =
Immediate(Smi::RawValue(type_arguments().Length()));

Powered by Google App Engine
This is Rietveld 408576698