| 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/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 5727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5738 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5738 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5739 // Arguments descriptor is expected in R10. | 5739 // Arguments descriptor is expected in R10. |
| 5740 intptr_t argument_count = ArgumentCount(); | 5740 intptr_t argument_count = ArgumentCount(); |
| 5741 const Array& arguments_descriptor = | 5741 const Array& arguments_descriptor = |
| 5742 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, | 5742 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, |
| 5743 argument_names())); | 5743 argument_names())); |
| 5744 __ LoadObject(R10, arguments_descriptor, PP); | 5744 __ LoadObject(R10, arguments_descriptor, PP); |
| 5745 | 5745 |
| 5746 // Function in RAX. | 5746 // Function in RAX. |
| 5747 ASSERT(locs()->in(0).reg() == RAX); | 5747 ASSERT(locs()->in(0).reg() == RAX); |
| 5748 __ movq(RCX, FieldAddress(RAX, Function::code_offset())); | 5748 __ movq(RCX, FieldAddress(RAX, Function::instructions_offset())); |
| 5749 | 5749 |
| 5750 // RAX: Function. | 5750 // RAX: Function. |
| 5751 // R10: Arguments descriptor array. | 5751 // R10: Arguments descriptor array. |
| 5752 // RBX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 5752 // RBX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
| 5753 __ xorq(RBX, RBX); | 5753 __ xorq(RBX, RBX); |
| 5754 __ movq(RCX, FieldAddress(RCX, Code::instructions_offset())); | |
| 5755 __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 5754 __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 5756 __ call(RCX); | 5755 __ call(RCX); |
| 5757 compiler->AddCurrentDescriptor(PcDescriptors::kClosureCall, | 5756 compiler->AddCurrentDescriptor(PcDescriptors::kClosureCall, |
| 5758 deopt_id(), | 5757 deopt_id(), |
| 5759 token_pos()); | 5758 token_pos()); |
| 5760 compiler->RecordSafepoint(locs()); | 5759 compiler->RecordSafepoint(locs()); |
| 5761 // Marks either the continuation point in unoptimized code or the | 5760 // Marks either the continuation point in unoptimized code or the |
| 5762 // deoptimization point in optimized code, after call. | 5761 // deoptimization point in optimized code, after call. |
| 5763 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); | 5762 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); |
| 5764 if (compiler->is_optimizing()) { | 5763 if (compiler->is_optimizing()) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5810 PcDescriptors::kOther, | 5809 PcDescriptors::kOther, |
| 5811 locs()); | 5810 locs()); |
| 5812 __ Drop(ArgumentCount()); // Discard arguments. | 5811 __ Drop(ArgumentCount()); // Discard arguments. |
| 5813 } | 5812 } |
| 5814 | 5813 |
| 5815 } // namespace dart | 5814 } // namespace dart |
| 5816 | 5815 |
| 5817 #undef __ | 5816 #undef __ |
| 5818 | 5817 |
| 5819 #endif // defined TARGET_ARCH_X64 | 5818 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |