| 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 "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 | 821 |
| 822 // Push the result place holder initialized to NULL. | 822 // Push the result place holder initialized to NULL. |
| 823 __ PushObject(Object::null_object()); | 823 __ PushObject(Object::null_object()); |
| 824 // Pass a pointer to the first argument in EAX. | 824 // Pass a pointer to the first argument in EAX. |
| 825 if (!function().HasOptionalParameters()) { | 825 if (!function().HasOptionalParameters()) { |
| 826 __ leal(EAX, Address(EBP, (kParamEndSlotFromFp + | 826 __ leal(EAX, Address(EBP, (kParamEndSlotFromFp + |
| 827 function().NumParameters()) * kWordSize)); | 827 function().NumParameters()) * kWordSize)); |
| 828 } else { | 828 } else { |
| 829 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); | 829 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); |
| 830 } | 830 } |
| 831 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); | |
| 832 __ movl(EDX, Immediate(argc_tag)); | 831 __ movl(EDX, Immediate(argc_tag)); |
| 833 const StubEntry* stub_entry = (is_bootstrap_native() || is_leaf_call) ? | 832 |
| 834 StubCode::CallBootstrapCFunction_entry() : | 833 const StubEntry* stub_entry; |
| 835 StubCode::CallNativeCFunction_entry(); | 834 if (link_lazily()) { |
| 835 stub_entry = StubCode::CallBootstrapCFunction_entry(); |
| 836 __ movl(ECX, Immediate(NativeEntry::LinkNativeCallLabel().address())); |
| 837 } else { |
| 838 stub_entry = (is_bootstrap_native() || is_leaf_call) ? |
| 839 StubCode::CallBootstrapCFunction_entry() : |
| 840 StubCode::CallNativeCFunction_entry(); |
| 841 const ExternalLabel label(reinterpret_cast<uword>(native_c_function())); |
| 842 __ movl(ECX, Immediate(label.address())); |
| 843 } |
| 836 compiler->GenerateCall(token_pos(), | 844 compiler->GenerateCall(token_pos(), |
| 837 *stub_entry, | 845 *stub_entry, |
| 838 RawPcDescriptors::kOther, | 846 RawPcDescriptors::kOther, |
| 839 locs()); | 847 locs()); |
| 840 __ popl(result); | 848 __ popl(result); |
| 841 } | 849 } |
| 842 | 850 |
| 843 | 851 |
| 844 static bool CanBeImmediateIndex(Value* value, intptr_t cid) { | 852 static bool CanBeImmediateIndex(Value* value, intptr_t cid) { |
| 845 ConstantInstr* constant = value->definition()->AsConstant(); | 853 ConstantInstr* constant = value->definition()->AsConstant(); |
| (...skipping 6012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6858 __ Drop(1); | 6866 __ Drop(1); |
| 6859 __ popl(result); | 6867 __ popl(result); |
| 6860 } | 6868 } |
| 6861 | 6869 |
| 6862 | 6870 |
| 6863 } // namespace dart | 6871 } // namespace dart |
| 6864 | 6872 |
| 6865 #undef __ | 6873 #undef __ |
| 6866 | 6874 |
| 6867 #endif // defined TARGET_ARCH_IA32 | 6875 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |