| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 #include "vm/locations.h" | 9 #include "vm/locations.h" |
| 10 #include "vm/stub_code.h" | 10 #include "vm/stub_code.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void StaticCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 132 void StaticCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 133 ASSERT(VerifyCallComputation(this)); | 133 ASSERT(VerifyCallComputation(this)); |
| 134 compiler->EmitStaticCall(token_index(), | 134 compiler->EmitStaticCall(token_index(), |
| 135 try_index(), | 135 try_index(), |
| 136 function(), | 136 function(), |
| 137 ArgumentCount(), | 137 ArgumentCount(), |
| 138 argument_names()); | 138 argument_names()); |
| 139 } | 139 } |
| 140 | 140 |
| 141 | 141 |
| 142 LocationSummary* LoadLocalComp::MakeLocationSummary() { |
| 143 return MakeSimpleLocationSummary(0, Location::RequiresRegister()); |
| 144 } |
| 145 |
| 146 |
| 147 void LoadLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 148 Register result = locs()->out().reg(); |
| 149 __ movq(result, Address(RBP, local().index() * kWordSize)); |
| 150 } |
| 151 |
| 152 |
| 153 LocationSummary* StoreLocalComp::MakeLocationSummary() { |
| 154 return MakeSimpleLocationSummary(1, Location::SameAsFirstInput()); |
| 155 } |
| 156 |
| 157 |
| 158 void StoreLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 159 Register value = locs()->in(0).reg(); |
| 160 Register result = locs()->out().reg(); |
| 161 ASSERT(result == value); // Assert that register assignment is correct. |
| 162 __ movq(Address(RBP, local().index() * kWordSize), value); |
| 163 } |
| 164 |
| 165 |
| 142 void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 166 void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 143 computation()->EmitNativeCode(compiler); | 167 computation()->EmitNativeCode(compiler); |
| 144 __ pushq(locs()->out().reg()); | 168 __ pushq(locs()->out().reg()); |
| 145 } | 169 } |
| 146 | 170 |
| 147 | 171 |
| 172 LocationSummary* ConstantVal::MakeLocationSummary() { |
| 173 return MakeSimpleLocationSummary(0, Location::RequiresRegister()); |
| 174 } |
| 175 |
| 176 |
| 177 void ConstantVal::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 178 Register result = locs()->out().reg(); |
| 179 if (value().IsSmi()) { |
| 180 int64_t imm = reinterpret_cast<int64_t>(value().raw()); |
| 181 __ movq(result, Immediate(imm)); |
| 182 } else { |
| 183 __ LoadObject(result, value()); |
| 184 } |
| 185 } |
| 186 |
| 187 |
| 148 } // namespace dart | 188 } // namespace dart |
| 149 | 189 |
| 150 #undef __ | 190 #undef __ |
| 151 | 191 |
| 152 #endif // defined TARGET_ARCH_X64 | 192 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |