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

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

Issue 315223003: Use CallBootstrapC stub for leaf native calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 // Push the result place holder initialized to NULL. 727 // Push the result place holder initialized to NULL.
728 __ PushObject(Object::ZoneHandle(), PP); 728 __ PushObject(Object::ZoneHandle(), PP);
729 // Pass a pointer to the first argument in RAX. 729 // Pass a pointer to the first argument in RAX.
730 if (!function().HasOptionalParameters()) { 730 if (!function().HasOptionalParameters()) {
731 __ leaq(RAX, Address(RBP, (kParamEndSlotFromFp + 731 __ leaq(RAX, Address(RBP, (kParamEndSlotFromFp +
732 function().NumParameters()) * kWordSize)); 732 function().NumParameters()) * kWordSize));
733 } else { 733 } else {
734 __ leaq(RAX, 734 __ leaq(RAX,
735 Address(RBP, kFirstLocalSlotFromFp * kWordSize)); 735 Address(RBP, kFirstLocalSlotFromFp * kWordSize));
736 } 736 }
737 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
738 const bool is_leaf_call =
739 (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
737 __ LoadImmediate( 740 __ LoadImmediate(
738 RBX, Immediate(reinterpret_cast<uword>(native_c_function())), PP); 741 RBX, Immediate(reinterpret_cast<uword>(native_c_function())), PP);
739 __ LoadImmediate( 742 __ LoadImmediate(
740 R10, Immediate(NativeArguments::ComputeArgcTag(function())), PP); 743 R10, Immediate(argc_tag), PP);
741 const ExternalLabel* stub_entry = 744 const ExternalLabel* stub_entry = (is_bootstrap_native() || is_leaf_call) ?
742 (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() : 745 &StubCode::CallBootstrapCFunctionLabel() :
743 &StubCode::CallNativeCFunctionLabel(); 746 &StubCode::CallNativeCFunctionLabel();
744 compiler->GenerateCall(token_pos(), 747 compiler->GenerateCall(token_pos(),
745 stub_entry, 748 stub_entry,
746 PcDescriptors::kOther, 749 PcDescriptors::kOther,
747 locs()); 750 locs());
748 __ popq(result); 751 __ popq(result);
749 } 752 }
750 753
751 754
752 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { 755 static bool CanBeImmediateIndex(Value* index, intptr_t cid) {
753 if (!index->definition()->IsConstant()) return false; 756 if (!index->definition()->IsConstant()) return false;
(...skipping 5063 matching lines...) Expand 10 before | Expand all | Expand 10 after
5817 PcDescriptors::kOther, 5820 PcDescriptors::kOther,
5818 locs()); 5821 locs());
5819 __ Drop(ArgumentCount()); // Discard arguments. 5822 __ Drop(ArgumentCount()); // Discard arguments.
5820 } 5823 }
5821 5824
5822 } // namespace dart 5825 } // namespace dart
5823 5826
5824 #undef __ 5827 #undef __
5825 5828
5826 #endif // defined TARGET_ARCH_X64 5829 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698