| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 return GenerateUninstantiatedTypeTest(token_pos, | 238 return GenerateUninstantiatedTypeTest(token_pos, |
| 239 type, | 239 type, |
| 240 is_instance_lbl, | 240 is_instance_lbl, |
| 241 is_not_instance_lbl); | 241 is_not_instance_lbl); |
| 242 } | 242 } |
| 243 | 243 |
| 244 | 244 |
| 245 void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos, | 245 void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos, |
| 246 intptr_t deopt_id, | |
| 247 const AbstractType& type, | 246 const AbstractType& type, |
| 248 bool negate_result, | 247 bool negate_result, |
| 249 LocationSummary* locs) { | 248 LocationSummary* locs) { |
| 250 UNIMPLEMENTED(); | 249 UNIMPLEMENTED(); |
| 251 } | 250 } |
| 252 | 251 |
| 253 | 252 |
| 254 // Optimize assignable type check by adding inlined tests for: | 253 // Optimize assignable type check by adding inlined tests for: |
| 255 // - NULL -> return NULL. | 254 // - NULL -> return NULL. |
| 256 // - Smi -> compile time subtype check (only if dst class is not parameterized). | 255 // - Smi -> compile time subtype check (only if dst class is not parameterized). |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 __ Bind(&is_assignable); | 334 __ Bind(&is_assignable); |
| 336 // Restore instantiator and its type arguments. | 335 // Restore instantiator and its type arguments. |
| 337 __ PopList((1 << R1) | (1 << R2)); | 336 __ PopList((1 << R1) | (1 << R2)); |
| 338 } | 337 } |
| 339 | 338 |
| 340 | 339 |
| 341 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { | 340 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { |
| 342 if (!is_optimizing()) { | 341 if (!is_optimizing()) { |
| 343 if (FLAG_enable_type_checks && instr->IsAssertAssignable()) { | 342 if (FLAG_enable_type_checks && instr->IsAssertAssignable()) { |
| 344 AssertAssignableInstr* assert = instr->AsAssertAssignable(); | 343 AssertAssignableInstr* assert = instr->AsAssertAssignable(); |
| 345 AddCurrentDescriptor(PcDescriptors::kDeoptBefore, | 344 AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 346 assert->deopt_id(), | 345 assert->deopt_id(), |
| 347 assert->token_pos()); | 346 assert->token_pos()); |
| 347 } else if (instr->IsGuardField()) { |
| 348 GuardFieldInstr* guard = instr->AsGuardField(); |
| 349 AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 350 guard->deopt_id(), |
| 351 Scanner::kDummyTokenIndex); |
| 352 } else if (instr->CanBeDeoptimizationTarget()) { |
| 353 AddCurrentDescriptor(PcDescriptors::kDeopt, |
| 354 instr->deopt_id(), |
| 355 Scanner::kDummyTokenIndex); |
| 348 } | 356 } |
| 349 AllocateRegistersLocally(instr); | 357 AllocateRegistersLocally(instr); |
| 350 } | 358 } |
| 351 } | 359 } |
| 352 | 360 |
| 353 | 361 |
| 354 void FlowGraphCompiler::EmitInstructionEpilogue(Instruction* instr) { | 362 void FlowGraphCompiler::EmitInstructionEpilogue(Instruction* instr) { |
| 355 if (is_optimizing()) return; | 363 if (is_optimizing()) return; |
| 356 Definition* defn = instr->AsDefinition(); | 364 Definition* defn = instr->AsDefinition(); |
| 357 if ((defn != NULL) && defn->is_used()) { | 365 if ((defn != NULL) && defn->is_used()) { |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, | 819 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, |
| 812 intptr_t token_pos, | 820 intptr_t token_pos, |
| 813 const ExternalLabel* label, | 821 const ExternalLabel* label, |
| 814 PcDescriptors::Kind kind, | 822 PcDescriptors::Kind kind, |
| 815 LocationSummary* locs) { | 823 LocationSummary* locs) { |
| 816 __ BranchLinkPatchable(label); | 824 __ BranchLinkPatchable(label); |
| 817 AddCurrentDescriptor(kind, deopt_id, token_pos); | 825 AddCurrentDescriptor(kind, deopt_id, token_pos); |
| 818 RecordSafepoint(locs); | 826 RecordSafepoint(locs); |
| 819 // Marks either the continuation point in unoptimized code or the | 827 // Marks either the continuation point in unoptimized code or the |
| 820 // deoptimization point in optimized code, after call. | 828 // deoptimization point in optimized code, after call. |
| 829 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id); |
| 821 if (is_optimizing()) { | 830 if (is_optimizing()) { |
| 822 AddDeoptIndexAtCall(deopt_id, token_pos); | 831 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
| 823 } else { | 832 } else { |
| 824 // Add deoptimization continuation point after the call and before the | 833 // Add deoptimization continuation point after the call and before the |
| 825 // arguments are removed. | 834 // arguments are removed. |
| 826 AddCurrentDescriptor(PcDescriptors::kDeoptAfter, | 835 AddCurrentDescriptor(PcDescriptors::kDeopt, deopt_id_after, token_pos); |
| 827 deopt_id, | |
| 828 token_pos); | |
| 829 } | 836 } |
| 830 } | 837 } |
| 831 | 838 |
| 832 | 839 |
| 833 void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos, | 840 void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos, |
| 834 intptr_t deopt_id, | 841 intptr_t deopt_id, |
| 835 const RuntimeEntry& entry, | 842 const RuntimeEntry& entry, |
| 836 LocationSummary* locs) { | 843 LocationSummary* locs) { |
| 837 __ Unimplemented("call runtime"); | 844 __ Unimplemented("call runtime"); |
| 838 } | 845 } |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 | 1059 |
| 1053 | 1060 |
| 1054 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { | 1061 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { |
| 1055 UNIMPLEMENTED(); | 1062 UNIMPLEMENTED(); |
| 1056 } | 1063 } |
| 1057 | 1064 |
| 1058 | 1065 |
| 1059 } // namespace dart | 1066 } // namespace dart |
| 1060 | 1067 |
| 1061 #endif // defined TARGET_ARCH_ARM | 1068 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |