| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | |
| 11 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| 12 #include "vm/flow_graph.h" | 11 #include "vm/flow_graph.h" |
| 13 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
| 14 #include "vm/flow_graph_range_analysis.h" | 13 #include "vm/flow_graph_range_analysis.h" |
| 15 #include "vm/locations.h" | 14 #include "vm/locations.h" |
| 16 #include "vm/object_store.h" | 15 #include "vm/object_store.h" |
| 17 #include "vm/parser.h" | 16 #include "vm/parser.h" |
| 18 #include "vm/simulator.h" | 17 #include "vm/simulator.h" |
| 19 #include "vm/stack_frame.h" | 18 #include "vm/stack_frame.h" |
| 20 #include "vm/stub_code.h" | 19 #include "vm/stub_code.h" |
| 21 #include "vm/symbols.h" | 20 #include "vm/symbols.h" |
| 22 | 21 |
| 23 #define __ compiler->assembler()-> | 22 #define __ compiler->assembler()-> |
| 24 | 23 |
| 25 namespace dart { | 24 namespace dart { |
| 26 | 25 |
| 27 DECLARE_FLAG(bool, allow_absolute_addresses); | 26 DECLARE_FLAG(bool, allow_absolute_addresses); |
| 28 DECLARE_FLAG(bool, emit_edge_counters); | 27 DECLARE_FLAG(bool, emit_edge_counters); |
| 29 DECLARE_FLAG(int, optimization_counter_threshold); | 28 DECLARE_FLAG(int, optimization_counter_threshold); |
| 29 DECLARE_FLAG(bool, precompilation); |
| 30 DECLARE_FLAG(bool, use_osr); | 30 DECLARE_FLAG(bool, use_osr); |
| 31 | 31 |
| 32 // Generic summary for call instructions that have all arguments pushed | 32 // Generic summary for call instructions that have all arguments pushed |
| 33 // on the stack and return the result in a fixed register V0. | 33 // on the stack and return the result in a fixed register V0. |
| 34 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { | 34 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { |
| 35 LocationSummary* result = new(zone) LocationSummary( | 35 LocationSummary* result = new(zone) LocationSummary( |
| 36 zone, 0, 0, LocationSummary::kCall); | 36 zone, 0, 0, LocationSummary::kCall); |
| 37 result->set_out(0, Location::RegisterLocation(V0)); | 37 result->set_out(0, Location::RegisterLocation(V0)); |
| 38 return result; | 38 return result; |
| 39 } | 39 } |
| (...skipping 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2224 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2225 __ Comment("CreateArrayInstr"); | 2225 __ Comment("CreateArrayInstr"); |
| 2226 const Register kLengthReg = A1; | 2226 const Register kLengthReg = A1; |
| 2227 const Register kElemTypeReg = A0; | 2227 const Register kElemTypeReg = A0; |
| 2228 const Register kResultReg = V0; | 2228 const Register kResultReg = V0; |
| 2229 ASSERT(locs()->in(0).reg() == kElemTypeReg); | 2229 ASSERT(locs()->in(0).reg() == kElemTypeReg); |
| 2230 ASSERT(locs()->in(1).reg() == kLengthReg); | 2230 ASSERT(locs()->in(1).reg() == kLengthReg); |
| 2231 | 2231 |
| 2232 Label slow_path, done; | 2232 Label slow_path, done; |
| 2233 if (compiler->is_optimizing() && | 2233 if (compiler->is_optimizing() && |
| 2234 !Compiler::always_optimize() && | 2234 !FLAG_precompilation && |
| 2235 num_elements()->BindsToConstant() && | 2235 num_elements()->BindsToConstant() && |
| 2236 num_elements()->BoundConstant().IsSmi()) { | 2236 num_elements()->BoundConstant().IsSmi()) { |
| 2237 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); | 2237 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); |
| 2238 if ((length >= 0) && (length <= Array::kMaxElements)) { | 2238 if ((length >= 0) && (length <= Array::kMaxElements)) { |
| 2239 Label slow_path, done; | 2239 Label slow_path, done; |
| 2240 InlineArrayAllocation(compiler, length, &slow_path, &done); | 2240 InlineArrayAllocation(compiler, length, &slow_path, &done); |
| 2241 __ Bind(&slow_path); | 2241 __ Bind(&slow_path); |
| 2242 __ PushObject(Object::null_object()); // Make room for the result. | 2242 __ PushObject(Object::null_object()); // Make room for the result. |
| 2243 __ Push(kLengthReg); // length. | 2243 __ Push(kLengthReg); // length. |
| 2244 __ Push(kElemTypeReg); | 2244 __ Push(kElemTypeReg); |
| (...skipping 3352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5597 1, | 5597 1, |
| 5598 locs()); | 5598 locs()); |
| 5599 __ lw(result, Address(SP, 1 * kWordSize)); | 5599 __ lw(result, Address(SP, 1 * kWordSize)); |
| 5600 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5600 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 5601 } | 5601 } |
| 5602 | 5602 |
| 5603 | 5603 |
| 5604 } // namespace dart | 5604 } // namespace dart |
| 5605 | 5605 |
| 5606 #endif // defined TARGET_ARCH_MIPS | 5606 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |