| 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| 11 #include "vm/compiler.h" | |
| 12 #include "vm/dart_entry.h" | 11 #include "vm/dart_entry.h" |
| 13 #include "vm/flow_graph.h" | 12 #include "vm/flow_graph.h" |
| 14 #include "vm/flow_graph_compiler.h" | 13 #include "vm/flow_graph_compiler.h" |
| 15 #include "vm/flow_graph_range_analysis.h" | 14 #include "vm/flow_graph_range_analysis.h" |
| 16 #include "vm/locations.h" | 15 #include "vm/locations.h" |
| 17 #include "vm/object_store.h" | 16 #include "vm/object_store.h" |
| 18 #include "vm/parser.h" | 17 #include "vm/parser.h" |
| 19 #include "vm/simulator.h" | 18 #include "vm/simulator.h" |
| 20 #include "vm/stack_frame.h" | 19 #include "vm/stack_frame.h" |
| 21 #include "vm/stub_code.h" | 20 #include "vm/stub_code.h" |
| 22 #include "vm/symbols.h" | 21 #include "vm/symbols.h" |
| 23 | 22 |
| 24 #define __ compiler->assembler()-> | 23 #define __ compiler->assembler()-> |
| 25 | 24 |
| 26 namespace dart { | 25 namespace dart { |
| 27 | 26 |
| 28 DECLARE_FLAG(bool, allow_absolute_addresses); | 27 DECLARE_FLAG(bool, allow_absolute_addresses); |
| 29 DECLARE_FLAG(bool, emit_edge_counters); | 28 DECLARE_FLAG(bool, emit_edge_counters); |
| 30 DECLARE_FLAG(int, optimization_counter_threshold); | 29 DECLARE_FLAG(int, optimization_counter_threshold); |
| 30 DECLARE_FLAG(bool, precompilation); |
| 31 DECLARE_FLAG(bool, use_osr); | 31 DECLARE_FLAG(bool, use_osr); |
| 32 | 32 |
| 33 // Generic summary for call instructions that have all arguments pushed | 33 // Generic summary for call instructions that have all arguments pushed |
| 34 // on the stack and return the result in a fixed register R0. | 34 // on the stack and return the result in a fixed register R0. |
| 35 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { | 35 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { |
| 36 LocationSummary* result = new(zone) LocationSummary( | 36 LocationSummary* result = new(zone) LocationSummary( |
| 37 zone, 0, 0, LocationSummary::kCall); | 37 zone, 0, 0, LocationSummary::kCall); |
| 38 result->set_out(0, Location::RegisterLocation(R0)); | 38 result->set_out(0, Location::RegisterLocation(R0)); |
| 39 return result; | 39 return result; |
| 40 } | 40 } |
| (...skipping 2329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2370 | 2370 |
| 2371 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2371 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2372 const Register kLengthReg = R2; | 2372 const Register kLengthReg = R2; |
| 2373 const Register kElemTypeReg = R1; | 2373 const Register kElemTypeReg = R1; |
| 2374 const Register kResultReg = R0; | 2374 const Register kResultReg = R0; |
| 2375 | 2375 |
| 2376 ASSERT(locs()->in(kElementTypePos).reg() == kElemTypeReg); | 2376 ASSERT(locs()->in(kElementTypePos).reg() == kElemTypeReg); |
| 2377 ASSERT(locs()->in(kLengthPos).reg() == kLengthReg); | 2377 ASSERT(locs()->in(kLengthPos).reg() == kLengthReg); |
| 2378 | 2378 |
| 2379 if (compiler->is_optimizing() && | 2379 if (compiler->is_optimizing() && |
| 2380 !Compiler::always_optimize() && | 2380 !FLAG_precompilation && |
| 2381 num_elements()->BindsToConstant() && | 2381 num_elements()->BindsToConstant() && |
| 2382 num_elements()->BoundConstant().IsSmi()) { | 2382 num_elements()->BoundConstant().IsSmi()) { |
| 2383 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); | 2383 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); |
| 2384 if ((length >= 0) && (length <= Array::kMaxElements)) { | 2384 if ((length >= 0) && (length <= Array::kMaxElements)) { |
| 2385 Label slow_path, done; | 2385 Label slow_path, done; |
| 2386 InlineArrayAllocation(compiler, length, &slow_path, &done); | 2386 InlineArrayAllocation(compiler, length, &slow_path, &done); |
| 2387 __ Bind(&slow_path); | 2387 __ Bind(&slow_path); |
| 2388 __ PushObject(Object::null_object()); // Make room for the result. | 2388 __ PushObject(Object::null_object()); // Make room for the result. |
| 2389 __ Push(kLengthReg); // length. | 2389 __ Push(kLengthReg); // length. |
| 2390 __ Push(kElemTypeReg); | 2390 __ Push(kElemTypeReg); |
| (...skipping 4469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6860 1, | 6860 1, |
| 6861 locs()); | 6861 locs()); |
| 6862 __ Drop(1); | 6862 __ Drop(1); |
| 6863 __ Pop(result); | 6863 __ Pop(result); |
| 6864 } | 6864 } |
| 6865 | 6865 |
| 6866 | 6866 |
| 6867 } // namespace dart | 6867 } // namespace dart |
| 6868 | 6868 |
| 6869 #endif // defined TARGET_ARCH_ARM | 6869 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |