Chromium Code Reviews| Index: runtime/vm/flow_graph_compiler_mips.cc |
| diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc |
| index fddc90155a504c9929c505a9a83817a57eaceb25..5bb23c190b274c5e4e8bd4668f71289321c81b47 100644 |
| --- a/runtime/vm/flow_graph_compiler_mips.cc |
| +++ b/runtime/vm/flow_graph_compiler_mips.cc |
| @@ -538,7 +538,7 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof( |
| // If instanceof type test cannot be performed successfully at compile time and |
| // therefore eliminated, optimize it by adding inlined tests for: |
| -// - NULL -> return false. |
| +// - NULL -> return type == Null (type is not Object or dynamic). |
| // - Smi -> compile time subtype check (only if dst class is not parameterized). |
| // - Class equality (only if class is not parameterized). |
| // Inputs: |
| @@ -552,6 +552,7 @@ void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos, |
| bool negate_result, |
| LocationSummary* locs) { |
| ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded()); |
| + ASSERT(!type.IsObjectType() && !type.IsDynamicType()); |
|
siva
2017/01/05 01:51:04
Why didn't you add the same ASSERT to the arm/arm6
regis
2017/01/05 18:02:01
Good catch! No reason. Added.
|
| // Preserve instantiator type arguments (A1). |
| __ addiu(SP, SP, Immediate(-1 * kWordSize)); |
| @@ -561,13 +562,13 @@ void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos, |
| // If type is instantiated and non-parameterized, we can inline code |
| // checking whether the tested instance is a Smi. |
| if (type.IsInstantiated()) { |
| - // A null object is only an instance of Object and dynamic, which has |
| - // already been checked above (if the type is instantiated). So we can |
| - // return false here if the instance is null (and if the type is |
| - // instantiated). |
| + // A null object is only an instance of Null, Object, and dynamic. |
| + // Object and dynamic have already been checked above (if the type is |
| + // instantiated). So we can return false here if the instance is null, |
| + // unless the type is Null (and if the type is instantiated). |
| // We can only inline this null check if the type is instantiated at compile |
| - // time, since an uninstantiated type at compile time could be Object or |
| - // dynamic at run time. |
| + // time, since an uninstantiated type at compile time could be Null, Object, |
| + // or dynamic at run time. |
| __ BranchEqual(A0, Object::null_object(), |
| type.IsNullType() ? &is_instance : &is_not_instance); |
| } |