| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 #define __ compiler->assembler()-> | 22 #define __ compiler->assembler()-> |
| 23 | 23 |
| 24 namespace dart { | 24 namespace dart { |
| 25 | 25 |
| 26 DECLARE_FLAG(bool, allow_absolute_addresses); | 26 DECLARE_FLAG(bool, allow_absolute_addresses); |
| 27 DECLARE_FLAG(bool, emit_edge_counters); | 27 DECLARE_FLAG(bool, emit_edge_counters); |
| 28 DECLARE_FLAG(int, optimization_counter_threshold); | 28 DECLARE_FLAG(int, optimization_counter_threshold); |
| 29 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 29 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| 30 DECLARE_FLAG(bool, use_osr); | 30 DECLARE_FLAG(bool, use_osr); |
| 31 DECLARE_FLAG(bool, precompilation); |
| 31 | 32 |
| 32 // Generic summary for call instructions that have all arguments pushed | 33 // Generic summary for call instructions that have all arguments pushed |
| 33 // on the stack and return the result in a fixed register RAX. | 34 // on the stack and return the result in a fixed register RAX. |
| 34 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { | 35 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { |
| 35 LocationSummary* result = new(zone) LocationSummary( | 36 LocationSummary* result = new(zone) LocationSummary( |
| 36 zone, 0, 0, LocationSummary::kCall); | 37 zone, 0, 0, LocationSummary::kCall); |
| 37 result->set_out(0, Location::RegisterLocation(RAX)); | 38 result->set_out(0, Location::RegisterLocation(RAX)); |
| 38 return result; | 39 return result; |
| 39 } | 40 } |
| 40 | 41 |
| (...skipping 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2108 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2109 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2109 // Allocate the array. R10 = length, RBX = element type. | 2110 // Allocate the array. R10 = length, RBX = element type. |
| 2110 const Register kLengthReg = R10; | 2111 const Register kLengthReg = R10; |
| 2111 const Register kElemTypeReg = RBX; | 2112 const Register kElemTypeReg = RBX; |
| 2112 const Register kResultReg = RAX; | 2113 const Register kResultReg = RAX; |
| 2113 ASSERT(locs()->in(0).reg() == kElemTypeReg); | 2114 ASSERT(locs()->in(0).reg() == kElemTypeReg); |
| 2114 ASSERT(locs()->in(1).reg() == kLengthReg); | 2115 ASSERT(locs()->in(1).reg() == kLengthReg); |
| 2115 | 2116 |
| 2116 Label slow_path, done; | 2117 Label slow_path, done; |
| 2117 if (compiler->is_optimizing() && | 2118 if (compiler->is_optimizing() && |
| 2118 !Compiler::always_optimize() && | 2119 !FLAG_precompilation && |
| 2119 num_elements()->BindsToConstant() && | 2120 num_elements()->BindsToConstant() && |
| 2120 num_elements()->BoundConstant().IsSmi()) { | 2121 num_elements()->BoundConstant().IsSmi()) { |
| 2121 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); | 2122 const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); |
| 2122 if ((length >= 0) && (length <= Array::kMaxElements)) { | 2123 if ((length >= 0) && (length <= Array::kMaxElements)) { |
| 2123 Label slow_path, done; | 2124 Label slow_path, done; |
| 2124 InlineArrayAllocation(compiler, length, &slow_path, &done); | 2125 InlineArrayAllocation(compiler, length, &slow_path, &done); |
| 2125 __ Bind(&slow_path); | 2126 __ Bind(&slow_path); |
| 2126 __ PushObject(Object::null_object()); // Make room for the result. | 2127 __ PushObject(Object::null_object()); // Make room for the result. |
| 2127 __ pushq(kLengthReg); | 2128 __ pushq(kLengthReg); |
| 2128 __ pushq(kElemTypeReg); | 2129 __ pushq(kElemTypeReg); |
| (...skipping 4323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6452 __ Drop(1); | 6453 __ Drop(1); |
| 6453 __ popq(result); | 6454 __ popq(result); |
| 6454 } | 6455 } |
| 6455 | 6456 |
| 6456 | 6457 |
| 6457 } // namespace dart | 6458 } // namespace dart |
| 6458 | 6459 |
| 6459 #undef __ | 6460 #undef __ |
| 6460 | 6461 |
| 6461 #endif // defined TARGET_ARCH_X64 | 6462 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |