| 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" |
| 10 #include "vm/dart_entry.h" | 11 #include "vm/dart_entry.h" |
| 11 #include "vm/flow_graph.h" | 12 #include "vm/flow_graph.h" |
| 12 #include "vm/flow_graph_compiler.h" | 13 #include "vm/flow_graph_compiler.h" |
| 13 #include "vm/flow_graph_range_analysis.h" | 14 #include "vm/flow_graph_range_analysis.h" |
| 14 #include "vm/locations.h" | 15 #include "vm/locations.h" |
| 15 #include "vm/object_store.h" | 16 #include "vm/object_store.h" |
| 16 #include "vm/parser.h" | 17 #include "vm/parser.h" |
| 17 #include "vm/simulator.h" | 18 #include "vm/simulator.h" |
| 18 #include "vm/stack_frame.h" | 19 #include "vm/stack_frame.h" |
| 19 #include "vm/stub_code.h" | 20 #include "vm/stub_code.h" |
| (...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2226 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2227 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2227 __ Comment("CreateArrayInstr"); | 2228 __ Comment("CreateArrayInstr"); |
| 2228 const Register kLengthReg = A1; | 2229 const Register kLengthReg = A1; |
| 2229 const Register kElemTypeReg = A0; | 2230 const Register kElemTypeReg = A0; |
| 2230 const Register kResultReg = V0; | 2231 const Register kResultReg = V0; |
| 2231 ASSERT(locs()->in(0).reg() == kElemTypeReg); | 2232 ASSERT(locs()->in(0).reg() == kElemTypeReg); |
| 2232 ASSERT(locs()->in(1).reg() == kLengthReg); | 2233 ASSERT(locs()->in(1).reg() == kLengthReg); |
| 2233 | 2234 |
| 2234 Label slow_path, done; | 2235 Label slow_path, done; |
| 2235 if (compiler->is_optimizing() && | 2236 if (compiler->is_optimizing() && |
| 2237 !Compiler::always_optimize() && |
| 2236 num_elements()->BindsToConstant() && | 2238 num_elements()->BindsToConstant() && |
| 2237 num_elements()->BoundConstant().IsSmi()) { | 2239 num_elements()->BoundConstant().IsSmi()) { |
| 2238 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); | 2240 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); |
| 2239 if ((length >= 0) && (length <= Array::kMaxElements)) { | 2241 if ((length >= 0) && (length <= Array::kMaxElements)) { |
| 2240 Label slow_path, done; | 2242 Label slow_path, done; |
| 2241 InlineArrayAllocation(compiler, length, &slow_path, &done); | 2243 InlineArrayAllocation(compiler, length, &slow_path, &done); |
| 2242 __ Bind(&slow_path); | 2244 __ Bind(&slow_path); |
| 2243 __ PushObject(Object::null_object()); // Make room for the result. | 2245 __ PushObject(Object::null_object()); // Make room for the result. |
| 2244 __ Push(kLengthReg); // length. | 2246 __ Push(kLengthReg); // length. |
| 2245 __ Push(kElemTypeReg); | 2247 __ Push(kElemTypeReg); |
| (...skipping 3352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5598 1, | 5600 1, |
| 5599 locs()); | 5601 locs()); |
| 5600 __ lw(result, Address(SP, 1 * kWordSize)); | 5602 __ lw(result, Address(SP, 1 * kWordSize)); |
| 5601 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5603 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 5602 } | 5604 } |
| 5603 | 5605 |
| 5604 | 5606 |
| 5605 } // namespace dart | 5607 } // namespace dart |
| 5606 | 5608 |
| 5607 #endif // defined TARGET_ARCH_MIPS | 5609 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |