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 "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 __ PushObject(Object::ZoneHandle()); | 1064 __ PushObject(Object::ZoneHandle()); |
1065 // Pass a pointer to the first argument in EAX. | 1065 // Pass a pointer to the first argument in EAX. |
1066 if (!function().HasOptionalParameters()) { | 1066 if (!function().HasOptionalParameters()) { |
1067 __ leal(EAX, Address(EBP, (kParamEndSlotFromFp + | 1067 __ leal(EAX, Address(EBP, (kParamEndSlotFromFp + |
1068 function().NumParameters()) * kWordSize)); | 1068 function().NumParameters()) * kWordSize)); |
1069 } else { | 1069 } else { |
1070 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); | 1070 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); |
1071 } | 1071 } |
1072 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); | 1072 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); |
1073 __ movl(EDX, Immediate(NativeArguments::ComputeArgcTag(function()))); | 1073 __ movl(EDX, Immediate(NativeArguments::ComputeArgcTag(function()))); |
| 1074 const ExternalLabel* stub_entry = |
| 1075 (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() : |
| 1076 &StubCode::CallNativeCFunctionLabel(); |
1074 compiler->GenerateCall(token_pos(), | 1077 compiler->GenerateCall(token_pos(), |
1075 &StubCode::CallNativeCFunctionLabel(), | 1078 stub_entry, |
1076 PcDescriptors::kOther, | 1079 PcDescriptors::kOther, |
1077 locs()); | 1080 locs()); |
1078 __ popl(result); | 1081 __ popl(result); |
1079 } | 1082 } |
1080 | 1083 |
1081 | 1084 |
1082 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { | 1085 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { |
1083 if (!index->definition()->IsConstant()) return false; | 1086 if (!index->definition()->IsConstant()) return false; |
1084 const Object& constant = index->definition()->AsConstant()->value(); | 1087 const Object& constant = index->definition()->AsConstant()->value(); |
1085 if (!constant.IsSmi()) return false; | 1088 if (!constant.IsSmi()) return false; |
(...skipping 3844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4930 PcDescriptors::kOther, | 4933 PcDescriptors::kOther, |
4931 locs()); | 4934 locs()); |
4932 __ Drop(2); // Discard type arguments and receiver. | 4935 __ Drop(2); // Discard type arguments and receiver. |
4933 } | 4936 } |
4934 | 4937 |
4935 } // namespace dart | 4938 } // namespace dart |
4936 | 4939 |
4937 #undef __ | 4940 #undef __ |
4938 | 4941 |
4939 #endif // defined TARGET_ARCH_IA32 | 4942 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |