| 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 | 774 |
| 775 // Push the result place holder initialized to NULL. | 775 // Push the result place holder initialized to NULL. |
| 776 __ PushObject(Object::null_object()); | 776 __ PushObject(Object::null_object()); |
| 777 // Pass a pointer to the first argument in RAX. | 777 // Pass a pointer to the first argument in RAX. |
| 778 if (!function().HasOptionalParameters()) { | 778 if (!function().HasOptionalParameters()) { |
| 779 __ leaq(RAX, Address(RBP, (kParamEndSlotFromFp + | 779 __ leaq(RAX, Address(RBP, (kParamEndSlotFromFp + |
| 780 function().NumParameters()) * kWordSize)); | 780 function().NumParameters()) * kWordSize)); |
| 781 } else { | 781 } else { |
| 782 __ leaq(RAX, Address(RBP, kFirstLocalSlotFromFp * kWordSize)); | 782 __ leaq(RAX, Address(RBP, kFirstLocalSlotFromFp * kWordSize)); |
| 783 } | 783 } |
| 784 __ LoadImmediate( | 784 ExternalLabel label(reinterpret_cast<uword>(native_c_function())); |
| 785 RBX, Immediate(reinterpret_cast<uword>(native_c_function()))); | 785 __ LoadExternalLabel(RBX, &label, kNotPatchable); |
| 786 __ LoadImmediate(R10, Immediate(argc_tag)); | 786 __ LoadImmediate(R10, Immediate(argc_tag)); |
| 787 const StubEntry& stub_entry = (is_bootstrap_native() || is_leaf_call) ? | 787 const StubEntry& stub_entry = (is_bootstrap_native() || is_leaf_call) ? |
| 788 *StubCode::CallBootstrapCFunction_entry() : | 788 *StubCode::CallBootstrapCFunction_entry() : |
| 789 *StubCode::CallNativeCFunction_entry(); | 789 *StubCode::CallNativeCFunction_entry(); |
| 790 compiler->GenerateCall(token_pos(), | 790 compiler->GenerateCall(token_pos(), |
| 791 stub_entry, | 791 stub_entry, |
| 792 RawPcDescriptors::kOther, | 792 RawPcDescriptors::kOther, |
| 793 locs()); | 793 locs()); |
| 794 __ popq(result); | 794 __ popq(result); |
| 795 } | 795 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 815 kNumInputs, | 815 kNumInputs, |
| 816 Location::RequiresRegister(), | 816 Location::RequiresRegister(), |
| 817 LocationSummary::kNoCall); | 817 LocationSummary::kNoCall); |
| 818 } | 818 } |
| 819 | 819 |
| 820 | 820 |
| 821 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 821 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 822 ASSERT(compiler->is_optimizing()); | 822 ASSERT(compiler->is_optimizing()); |
| 823 Register char_code = locs()->in(0).reg(); | 823 Register char_code = locs()->in(0).reg(); |
| 824 Register result = locs()->out(0).reg(); | 824 Register result = locs()->out(0).reg(); |
| 825 __ LoadImmediate(result, | 825 |
| 826 Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress()))); | 826 ExternalLabel label(reinterpret_cast<uword>(Symbols::PredefinedAddress())); |
| 827 __ LoadExternalLabel(result, &label, kNotPatchable); |
| 827 __ movq(result, Address(result, | 828 __ movq(result, Address(result, |
| 828 char_code, | 829 char_code, |
| 829 TIMES_HALF_WORD_SIZE, // Char code is a smi. | 830 TIMES_HALF_WORD_SIZE, // Char code is a smi. |
| 830 Symbols::kNullCharCodeSymbolOffset * kWordSize)); | 831 Symbols::kNullCharCodeSymbolOffset * kWordSize)); |
| 831 } | 832 } |
| 832 | 833 |
| 833 | 834 |
| 834 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone, | 835 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone, |
| 835 bool opt) const { | 836 bool opt) const { |
| 836 const intptr_t kNumInputs = 1; | 837 const intptr_t kNumInputs = 1; |
| (...skipping 5593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6430 __ Drop(1); | 6431 __ Drop(1); |
| 6431 __ popq(result); | 6432 __ popq(result); |
| 6432 } | 6433 } |
| 6433 | 6434 |
| 6434 | 6435 |
| 6435 } // namespace dart | 6436 } // namespace dart |
| 6436 | 6437 |
| 6437 #undef __ | 6438 #undef __ |
| 6438 | 6439 |
| 6439 #endif // defined TARGET_ARCH_X64 | 6440 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |