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

Side by Side Diff: runtime/vm/intermediate_language_x64.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
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_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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 // Pass a pointer to the first argument in RAX. 1062 // Pass a pointer to the first argument in RAX.
1063 if (!function().HasOptionalParameters()) { 1063 if (!function().HasOptionalParameters()) {
1064 __ leaq(RAX, Address(RBP, (kParamEndSlotFromFp + 1064 __ leaq(RAX, Address(RBP, (kParamEndSlotFromFp +
1065 function().NumParameters()) * kWordSize)); 1065 function().NumParameters()) * kWordSize));
1066 } else { 1066 } else {
1067 __ leaq(RAX, 1067 __ leaq(RAX,
1068 Address(RBP, kFirstLocalSlotFromFp * kWordSize)); 1068 Address(RBP, kFirstLocalSlotFromFp * kWordSize));
1069 } 1069 }
1070 __ movq(RBX, Immediate(reinterpret_cast<uword>(native_c_function()))); 1070 __ movq(RBX, Immediate(reinterpret_cast<uword>(native_c_function())));
1071 __ movq(R10, Immediate(NativeArguments::ComputeArgcTag(function()))); 1071 __ movq(R10, Immediate(NativeArguments::ComputeArgcTag(function())));
1072 const ExternalLabel* stub_entry =
1073 (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() :
1074 &StubCode::CallNativeCFunctionLabel();
1072 compiler->GenerateCall(token_pos(), 1075 compiler->GenerateCall(token_pos(),
1073 &StubCode::CallNativeCFunctionLabel(), 1076 stub_entry,
1074 PcDescriptors::kOther, 1077 PcDescriptors::kOther,
1075 locs()); 1078 locs());
1076 __ popq(result); 1079 __ popq(result);
1077 } 1080 }
1078 1081
1079 1082
1080 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { 1083 static bool CanBeImmediateIndex(Value* index, intptr_t cid) {
1081 if (!index->definition()->IsConstant()) return false; 1084 if (!index->definition()->IsConstant()) return false;
1082 const Object& constant = index->definition()->AsConstant()->value(); 1085 const Object& constant = index->definition()->AsConstant()->value();
1083 if (!constant.IsSmi()) return false; 1086 if (!constant.IsSmi()) return false;
(...skipping 3479 matching lines...) Expand 10 before | Expand all | Expand 10 after
4563 PcDescriptors::kOther, 4566 PcDescriptors::kOther,
4564 locs()); 4567 locs());
4565 __ Drop(2); // Discard type arguments and receiver. 4568 __ Drop(2); // Discard type arguments and receiver.
4566 } 4569 }
4567 4570
4568 } // namespace dart 4571 } // namespace dart
4569 4572
4570 #undef __ 4573 #undef __
4571 4574
4572 #endif // defined TARGET_ARCH_X64 4575 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698