Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: runtime/vm/intermediate_language_ia32.cc

Issue 22303002: Auto create ApiLocalScope before calling native functions, this ensures that (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 __ PushObject(Object::ZoneHandle()); 1063 __ PushObject(Object::ZoneHandle());
1064 // Pass a pointer to the first argument in EAX. 1064 // Pass a pointer to the first argument in EAX.
1065 if (!function().HasOptionalParameters()) { 1065 if (!function().HasOptionalParameters()) {
1066 __ leal(EAX, Address(EBP, (kParamEndSlotFromFp + 1066 __ leal(EAX, Address(EBP, (kParamEndSlotFromFp +
1067 function().NumParameters()) * kWordSize)); 1067 function().NumParameters()) * kWordSize));
1068 } else { 1068 } else {
1069 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); 1069 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize));
1070 } 1070 }
1071 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); 1071 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function())));
1072 __ movl(EDX, Immediate(NativeArguments::ComputeArgcTag(function()))); 1072 __ movl(EDX, Immediate(NativeArguments::ComputeArgcTag(function())));
1073 const ExternalLabel* stub_entry =
1074 (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() :
1075 &StubCode::CallNativeCFunctionLabel();
1073 compiler->GenerateCall(token_pos(), 1076 compiler->GenerateCall(token_pos(),
1074 &StubCode::CallNativeCFunctionLabel(), 1077 stub_entry,
1075 PcDescriptors::kOther, 1078 PcDescriptors::kOther,
1076 locs()); 1079 locs());
1077 __ popl(result); 1080 __ popl(result);
1078 } 1081 }
1079 1082
1080 1083
1081 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { 1084 static bool CanBeImmediateIndex(Value* index, intptr_t cid) {
1082 if (!index->definition()->IsConstant()) return false; 1085 if (!index->definition()->IsConstant()) return false;
1083 const Object& constant = index->definition()->AsConstant()->value(); 1086 const Object& constant = index->definition()->AsConstant()->value();
1084 if (!constant.IsSmi()) return false; 1087 if (!constant.IsSmi()) return false;
(...skipping 3863 matching lines...) Expand 10 before | Expand all | Expand 10 after
4948 PcDescriptors::kOther, 4951 PcDescriptors::kOther,
4949 locs()); 4952 locs());
4950 __ Drop(2); // Discard type arguments and receiver. 4953 __ Drop(2); // Discard type arguments and receiver.
4951 } 4954 }
4952 4955
4953 } // namespace dart 4956 } // namespace dart
4954 4957
4955 #undef __ 4958 #undef __
4956 4959
4957 #endif // defined TARGET_ARCH_IA32 4960 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698