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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 10450014: Request for comments on overall approach. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix scavenger and freelist handling 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/flow_graph_compiler_x64.cc
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 426f7069b005235ba51a598cb5a70c7fd46e8ae3..0ed629bcf635b9282f8805bb2ec295bdd381fc78 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -124,7 +124,7 @@ FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest(
if (is_raw_type) {
// Dynamic type argument, check only classes.
// List is a very common case.
- __ movq(R10, FieldAddress(RAX, Object::class_offset()));
+ __ GetClassOf(R10, RAX);
if (!type_class.is_interface()) {
__ CompareObject(R10, type_class);
__ j(EQUAL, is_instance_lbl);
@@ -232,7 +232,7 @@ void FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
ObjectStore* object_store = Isolate::Current()->object_store();
// Compare if the classes are equal. Instance is not Smi.
__ Bind(&compare_classes);
- __ movq(R10, FieldAddress(RAX, Object::class_offset()));
+ __ GetClassOf(R10, RAX);
// If type is an interface, we can skip the class equality check.
if (!type_class.is_interface()) {
__ CompareObject(R10, type_class);
@@ -320,7 +320,7 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateSubtype1TestCacheLookup(
const Bool& bool_true = Bool::ZoneHandle(Bool::True());
const Immediate raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
- __ movq(R10, FieldAddress(RAX, Object::class_offset()));
+ __ GetClassOf(R10, RAX);
// Check immediate superclass equality.
__ movq(R13, FieldAddress(R10, Class::super_type_offset()));
__ movq(R13, FieldAddress(R13, Type::type_class_offset()));
@@ -369,7 +369,7 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateUninstantiatedTypeTest(
// Can handle only type arguments that are instances of TypeArguments.
// (runtime checks canonicalize type arguments).
Label fall_through;
- __ movq(R10, FieldAddress(RDX, Object::class_offset()));
+ __ GetClassOf(R10, RDX);
__ CompareObject(R10, Object::ZoneHandle(Object::type_arguments_class()));
__ j(NOT_EQUAL, &fall_through);
__ movq(RDI,
@@ -1145,8 +1145,8 @@ void FlowGraphCompiler::VisitInstantiateTypeArguments(
// 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(RCX, Class::ZoneHandle(Object::type_arguments_class()));
- __ cmpq(RCX, FieldAddress(RAX, Object::class_offset()));
+ __ GetClassOf(R10, RAX);
+ __ CompareObject(R10, Class::ZoneHandle(Object::type_arguments_class()));
__ j(NOT_EQUAL, &type_arguments_uninstantiated, Assembler::kNearJump);
Immediate arguments_length =
Immediate(Smi::RawValue(comp->type_arguments().Length()));
@@ -1194,8 +1194,8 @@ void FlowGraphCompiler::VisitExtractConstructorTypeArguments(
// No need to check the instantiator (RAX) for null here, because a null
// instantiator will have the wrong class (Null instead of TypeArguments).
Label type_arguments_uninstantiated;
- __ LoadObject(RCX, Class::ZoneHandle(Object::type_arguments_class()));
- __ cmpq(RCX, FieldAddress(RAX, Object::class_offset()));
+ __ GetClassOf(R10, RAX);
+ __ CompareObject(R10, Class::ZoneHandle(Object::type_arguments_class()));
__ j(NOT_EQUAL, &type_arguments_uninstantiated, Assembler::kNearJump);
Immediate arguments_length =
Immediate(Smi::RawValue(comp->type_arguments().Length()));
@@ -1248,8 +1248,8 @@ void FlowGraphCompiler::VisitExtractConstructorInstantiator(
// 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(RCX, Class::ZoneHandle(Object::type_arguments_class()));
- __ cmpq(RCX, FieldAddress(RAX, Object::class_offset()));
+ __ GetClassOf(R10, RAX);
+ __ CompareObject(R10, Class::ZoneHandle(Object::type_arguments_class()));
__ j(NOT_EQUAL, &done, Assembler::kNearJump);
Immediate arguments_length =
Immediate(Smi::RawValue(comp->type_arguments().Length()));

Powered by Google App Engine
This is Rietveld 408576698