| 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 372 |
| 373 void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 373 void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 374 Register obj = locs()->in(0).reg(); | 374 Register obj = locs()->in(0).reg(); |
| 375 Register result = locs()->out().reg(); | 375 Register result = locs()->out().reg(); |
| 376 | 376 |
| 377 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler); | 377 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler); |
| 378 ASSERT(obj == result); | 378 ASSERT(obj == result); |
| 379 } | 379 } |
| 380 | 380 |
| 381 | 381 |
| 382 LocationSummary* ArgumentDefinitionTestInstr::MakeLocationSummary() const { | |
| 383 const intptr_t kNumInputs = 1; | |
| 384 const intptr_t kNumTemps = 0; | |
| 385 LocationSummary* locs = | |
| 386 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | |
| 387 locs->set_in(0, Location::RegisterLocation(RAX)); | |
| 388 locs->set_out(Location::RegisterLocation(RAX)); | |
| 389 return locs; | |
| 390 } | |
| 391 | |
| 392 | |
| 393 void ArgumentDefinitionTestInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 394 Register saved_args_desc = locs()->in(0).reg(); | |
| 395 Register result = locs()->out().reg(); | |
| 396 | |
| 397 // Push the result place holder initialized to NULL. | |
| 398 __ PushObject(Object::ZoneHandle()); | |
| 399 __ pushq(Immediate(Smi::RawValue(formal_parameter_index()))); | |
| 400 __ PushObject(formal_parameter_name()); | |
| 401 __ pushq(saved_args_desc); | |
| 402 compiler->GenerateCallRuntime(token_pos(), | |
| 403 deopt_id(), | |
| 404 kArgumentDefinitionTestRuntimeEntry, | |
| 405 locs()); | |
| 406 __ Drop(3); | |
| 407 __ popq(result); // Pop bool result. | |
| 408 } | |
| 409 | |
| 410 | |
| 411 static Condition TokenKindToSmiCondition(Token::Kind kind) { | 382 static Condition TokenKindToSmiCondition(Token::Kind kind) { |
| 412 switch (kind) { | 383 switch (kind) { |
| 413 case Token::kEQ: return EQUAL; | 384 case Token::kEQ: return EQUAL; |
| 414 case Token::kNE: return NOT_EQUAL; | 385 case Token::kNE: return NOT_EQUAL; |
| 415 case Token::kLT: return LESS; | 386 case Token::kLT: return LESS; |
| 416 case Token::kGT: return GREATER; | 387 case Token::kGT: return GREATER; |
| 417 case Token::kLTE: return LESS_EQUAL; | 388 case Token::kLTE: return LESS_EQUAL; |
| 418 case Token::kGTE: return GREATER_EQUAL; | 389 case Token::kGTE: return GREATER_EQUAL; |
| 419 default: | 390 default: |
| 420 UNREACHABLE(); | 391 UNREACHABLE(); |
| (...skipping 4025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4446 PcDescriptors::kOther, | 4417 PcDescriptors::kOther, |
| 4447 locs()); | 4418 locs()); |
| 4448 __ Drop(2); // Discard type arguments and receiver. | 4419 __ Drop(2); // Discard type arguments and receiver. |
| 4449 } | 4420 } |
| 4450 | 4421 |
| 4451 } // namespace dart | 4422 } // namespace dart |
| 4452 | 4423 |
| 4453 #undef __ | 4424 #undef __ |
| 4454 | 4425 |
| 4455 #endif // defined TARGET_ARCH_X64 | 4426 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |