| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 207 void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 208 Register obj = locs()->in(0).reg(); | 208 Register obj = locs()->in(0).reg(); |
| 209 Register result = locs()->out().reg(); | 209 Register result = locs()->out().reg(); |
| 210 | 210 |
| 211 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler); | 211 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler); |
| 212 ASSERT(obj == result); | 212 ASSERT(obj == result); |
| 213 } | 213 } |
| 214 | 214 |
| 215 | 215 |
| 216 LocationSummary* ArgumentDefinitionTestInstr::MakeLocationSummary() const { | |
| 217 const intptr_t kNumInputs = 1; | |
| 218 const intptr_t kNumTemps = 0; | |
| 219 LocationSummary* locs = | |
| 220 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | |
| 221 locs->set_in(0, Location::RegisterLocation(EAX)); | |
| 222 locs->set_out(Location::RegisterLocation(EAX)); | |
| 223 return locs; | |
| 224 } | |
| 225 | |
| 226 | |
| 227 void ArgumentDefinitionTestInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 228 Register saved_args_desc = locs()->in(0).reg(); | |
| 229 Register result = locs()->out().reg(); | |
| 230 | |
| 231 // Push the result place holder initialized to NULL. | |
| 232 __ PushObject(Object::ZoneHandle()); | |
| 233 __ pushl(Immediate(Smi::RawValue(formal_parameter_index()))); | |
| 234 __ PushObject(formal_parameter_name()); | |
| 235 __ pushl(saved_args_desc); | |
| 236 compiler->GenerateCallRuntime(token_pos(), | |
| 237 deopt_id(), | |
| 238 kArgumentDefinitionTestRuntimeEntry, | |
| 239 locs()); | |
| 240 __ Drop(3); | |
| 241 __ popl(result); // Pop bool result. | |
| 242 } | |
| 243 | |
| 244 | |
| 245 static Condition TokenKindToSmiCondition(Token::Kind kind) { | 216 static Condition TokenKindToSmiCondition(Token::Kind kind) { |
| 246 switch (kind) { | 217 switch (kind) { |
| 247 case Token::kEQ: return EQUAL; | 218 case Token::kEQ: return EQUAL; |
| 248 case Token::kNE: return NOT_EQUAL; | 219 case Token::kNE: return NOT_EQUAL; |
| 249 case Token::kLT: return LESS; | 220 case Token::kLT: return LESS; |
| 250 case Token::kGT: return GREATER; | 221 case Token::kGT: return GREATER; |
| 251 case Token::kLTE: return LESS_EQUAL; | 222 case Token::kLTE: return LESS_EQUAL; |
| 252 case Token::kGTE: return GREATER_EQUAL; | 223 case Token::kGTE: return GREATER_EQUAL; |
| 253 default: | 224 default: |
| 254 UNREACHABLE(); | 225 UNREACHABLE(); |
| (...skipping 4521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4776 PcDescriptors::kOther, | 4747 PcDescriptors::kOther, |
| 4777 locs()); | 4748 locs()); |
| 4778 __ Drop(2); // Discard type arguments and receiver. | 4749 __ Drop(2); // Discard type arguments and receiver. |
| 4779 } | 4750 } |
| 4780 | 4751 |
| 4781 } // namespace dart | 4752 } // namespace dart |
| 4782 | 4753 |
| 4783 #undef __ | 4754 #undef __ |
| 4784 | 4755 |
| 4785 #endif // defined TARGET_ARCH_IA32 | 4756 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |