Index: runtime/vm/flow_graph_compiler_arm64.cc |
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc |
index 44f146342b34dbd87f826bf0e0620a4617a1b2f5..42084584f17cd198f30ae9a8fadbcd4cfc1f45b1 100644 |
--- a/runtime/vm/flow_graph_compiler_arm64.cc |
+++ b/runtime/vm/flow_graph_compiler_arm64.cc |
@@ -454,7 +454,7 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateUninstantiatedTypeTest( |
// Skip check if destination is a dynamic type. |
if (type.IsTypeParameter()) { |
const TypeParameter& type_param = TypeParameter::Cast(type); |
- // Load instantiator (or null) and instantiator type arguments on stack. |
+ // Load instantiator type arguments on stack. |
__ ldr(R1, Address(SP)); // Get instantiator type arguments. |
// R1: instantiator type arguments. |
// Check if type arguments are null, i.e. equivalent to vector of dynamic. |
@@ -579,7 +579,6 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof( |
// Inputs: |
// - R0: object. |
// - R1: instantiator type arguments or raw_null. |
-// - R2: instantiator or raw_null. |
// Returns: |
// - true or false in R0. |
void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos, |
@@ -589,8 +588,7 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos, |
LocationSummary* locs) { |
ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded()); |
- // Preserve instantiator (R2) and its type arguments (R1). |
- __ Push(R2); |
+ // Preserve instantiator type arguments (R1). |
__ Push(R1); |
Label is_instance, is_not_instance; |
@@ -619,19 +617,16 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos, |
// Generate runtime call. |
// Load instantiator (R2) and its type arguments (R1). |
__ ldr(R1, Address(SP, 0 * kWordSize)); |
- __ ldr(R2, Address(SP, 1 * kWordSize)); |
__ PushObject(Object::null_object()); // Make room for the result. |
__ Push(R0); // Push the instance. |
__ PushObject(type); // Push the type. |
- // Push instantiator (R2) and its type arguments (R1). |
- __ Push(R2); |
- __ Push(R1); |
+ __ Push(R1); // Push instantiator type arguments (R1). |
__ LoadUniqueObject(R0, test_cache); |
__ Push(R0); |
- GenerateRuntimeCall(token_pos, deopt_id, kInstanceofRuntimeEntry, 5, locs); |
+ GenerateRuntimeCall(token_pos, deopt_id, kInstanceofRuntimeEntry, 4, locs); |
// Pop the parameters supplied to the runtime entry. The result of the |
// instanceof runtime call will be left as the result of the operation. |
- __ Drop(5); |
+ __ Drop(4); |
if (negate_result) { |
__ Pop(R1); |
__ LoadObject(R0, Bool::True()); |
@@ -650,8 +645,8 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos, |
__ Bind(&is_instance); |
__ LoadObject(R0, Bool::Get(!negate_result)); |
__ Bind(&done); |
- // Remove instantiator (R2) and its type arguments (R1). |
- __ Drop(2); |
+ // Remove instantiator type arguments (R1). |
+ __ Drop(1); |
} |
@@ -662,7 +657,6 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos, |
// Inputs: |
// - R0: instance being type checked. |
// - R1: instantiator type arguments or raw_null. |
-// - R2: instantiator or raw_null. |
// Returns: |
// - object in R0 for successful assignable check (or throws TypeError). |
// Performance notes: positive checks must be quick, negative checks can be slow |
@@ -678,8 +672,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos, |
// Assignable check is skipped in FlowGraphBuilder, not here. |
ASSERT(dst_type.IsMalformedOrMalbounded() || |
(!dst_type.IsDynamicType() && !dst_type.IsObjectType())); |
- // Preserve instantiator (R2) and its type arguments (R1). |
- __ Push(R2); |
+ // Preserve instantiator type arguments (R1). |
__ Push(R1); |
// A null object is always assignable and is returned as result. |
Label is_assignable, runtime_call; |
@@ -701,9 +694,8 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos, |
__ brk(0); |
__ Bind(&is_assignable); // For a null object. |
- // Restore instantiator (R2) and its type arguments (R1). |
+ // Restore instantiator type arguments (R1). |
__ Pop(R1); |
- __ Pop(R2); |
return; |
} |
@@ -713,28 +705,23 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos, |
&is_assignable, &runtime_call); |
__ Bind(&runtime_call); |
- // Load instantiator (R2) and its type arguments (R1). |
- __ ldr(R1, Address(SP)); |
- __ ldr(R2, Address(SP, 1 * kWordSize)); |
+ __ ldr(R1, Address(SP)); // Load instantiator type arguments (R1). |
__ PushObject(Object::null_object()); // Make room for the result. |
__ Push(R0); // Push the source object. |
__ PushObject(dst_type); // Push the type of the destination. |
- // Push instantiator (R2) and its type arguments (R1). |
- __ Push(R2); |
- __ Push(R1); |
+ __ Push(R1); // Push instantiator type arguments (R1). |
__ PushObject(dst_name); // Push the name of the destination. |
__ LoadUniqueObject(R0, test_cache); |
__ Push(R0); |
- GenerateRuntimeCall(token_pos, deopt_id, kTypeCheckRuntimeEntry, 6, locs); |
+ GenerateRuntimeCall(token_pos, deopt_id, kTypeCheckRuntimeEntry, 5, locs); |
// Pop the parameters supplied to the runtime entry. The result of the |
// type check runtime call is the checked value. |
- __ Drop(6); |
+ __ Drop(5); |
__ Pop(R0); |
__ Bind(&is_assignable); |
- // Restore instantiator (R2) and its type arguments (R1). |
+ // Restore instantiator type arguments (R1). |
__ Pop(R1); |
- __ Pop(R2); |
} |