| 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 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 __ movq(RAX, CTX); | 522 __ movq(RAX, CTX); |
| 523 } | 523 } |
| 524 | 524 |
| 525 | 525 |
| 526 void FlowGraphCompiler::VisitStoreContext(StoreContextComp* comp) { | 526 void FlowGraphCompiler::VisitStoreContext(StoreContextComp* comp) { |
| 527 LoadValue(CTX, comp->value()); | 527 LoadValue(CTX, comp->value()); |
| 528 } | 528 } |
| 529 | 529 |
| 530 | 530 |
| 531 void FlowGraphCompiler::VisitClosureCall(ClosureCallComp* comp) { | 531 void FlowGraphCompiler::VisitClosureCall(ClosureCallComp* comp) { |
| 532 ASSERT(comp->context()->IsUse()); | |
| 533 ASSERT(VerifyCallComputation(comp)); | 532 ASSERT(VerifyCallComputation(comp)); |
| 534 // The arguments to the stub include the closure. The arguments | 533 // The arguments to the stub include the closure. The arguments |
| 535 // descriptor describes the closure's arguments (and so does not include | 534 // descriptor describes the closure's arguments (and so does not include |
| 536 // the closure). | 535 // the closure). |
| 537 int argument_count = comp->ArgumentCount(); | 536 int argument_count = comp->ArgumentCount(); |
| 538 const Array& arguments_descriptor = | 537 const Array& arguments_descriptor = |
| 539 CodeGenerator::ArgumentsDescriptor(argument_count - 1, | 538 CodeGenerator::ArgumentsDescriptor(argument_count - 1, |
| 540 comp->argument_names()); | 539 comp->argument_names()); |
| 541 __ LoadObject(R10, arguments_descriptor); | 540 __ LoadObject(R10, arguments_descriptor); |
| 542 | 541 |
| 543 GenerateCall(comp->token_index(), | 542 GenerateCall(comp->token_index(), |
| 544 comp->try_index(), | 543 comp->try_index(), |
| 545 &StubCode::CallClosureFunctionLabel(), | 544 &StubCode::CallClosureFunctionLabel(), |
| 546 PcDescriptors::kOther); | 545 PcDescriptors::kOther); |
| 547 __ Drop(argument_count); | 546 __ Drop(argument_count); |
| 548 __ popq(CTX); | |
| 549 } | 547 } |
| 550 | 548 |
| 551 | 549 |
| 552 void FlowGraphCompiler::VisitInstanceCall(InstanceCallComp* comp) { | 550 void FlowGraphCompiler::VisitInstanceCall(InstanceCallComp* comp) { |
| 553 ASSERT(VerifyCallComputation(comp)); | 551 ASSERT(VerifyCallComputation(comp)); |
| 554 EmitInstanceCall(comp->cid(), | 552 EmitInstanceCall(comp->cid(), |
| 555 comp->token_index(), | 553 comp->token_index(), |
| 556 comp->try_index(), | 554 comp->try_index(), |
| 557 comp->function_name(), | 555 comp->function_name(), |
| 558 comp->ArgumentCount(), | 556 comp->ArgumentCount(), |
| (...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 | 1741 |
| 1744 | 1742 |
| 1745 void FlowGraphCompiler::FinalizeComments(const Code& code) { | 1743 void FlowGraphCompiler::FinalizeComments(const Code& code) { |
| 1746 code.set_comments(assembler_->GetCodeComments()); | 1744 code.set_comments(assembler_->GetCodeComments()); |
| 1747 } | 1745 } |
| 1748 | 1746 |
| 1749 | 1747 |
| 1750 } // namespace dart | 1748 } // namespace dart |
| 1751 | 1749 |
| 1752 #endif // defined TARGET_ARCH_X64 | 1750 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |