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

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

Issue 1420173006: Move resolving of natives to a late stage (during code emission). That eliminates unnecessary nativ… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: r Created 5 years, 1 month 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/bootstrap.h"
8 #include "vm/compiler.h" 9 #include "vm/compiler.h"
9 #include "vm/constant_propagator.h" 10 #include "vm/constant_propagator.h"
10 #include "vm/cpu.h" 11 #include "vm/cpu.h"
11 #include "vm/dart_entry.h" 12 #include "vm/dart_entry.h"
12 #include "vm/flow_graph_allocator.h" 13 #include "vm/flow_graph_allocator.h"
13 #include "vm/flow_graph_builder.h" 14 #include "vm/flow_graph_builder.h"
14 #include "vm/flow_graph_compiler.h" 15 #include "vm/flow_graph_compiler.h"
15 #include "vm/flow_graph_optimizer.h" 16 #include "vm/flow_graph_optimizer.h"
16 #include "vm/flow_graph_range_analysis.h" 17 #include "vm/flow_graph_range_analysis.h"
17 #include "vm/locations.h" 18 #include "vm/locations.h"
(...skipping 3631 matching lines...) Expand 10 before | Expand all | Expand 10 after
3649 3650
3650 intptr_t MergedMathInstr::OutputIndexOf(Token::Kind token) { 3651 intptr_t MergedMathInstr::OutputIndexOf(Token::Kind token) {
3651 switch (token) { 3652 switch (token) {
3652 case Token::kTRUNCDIV: return 0; 3653 case Token::kTRUNCDIV: return 0;
3653 case Token::kMOD: return 1; 3654 case Token::kMOD: return 1;
3654 default: UNIMPLEMENTED(); return -1; 3655 default: UNIMPLEMENTED(); return -1;
3655 } 3656 }
3656 } 3657 }
3657 3658
3658 3659
3660 void NativeCallInstr::SetupNative() {
3661 Zone* Z = Thread::Current()->zone();
3662 const Class& cls = Class::Handle(Z, function().Owner());
3663 const Library& library = Library::Handle(Z, cls.library());
3664 const int num_params =
3665 NativeArguments::ParameterCountForResolution(function());
3666 bool auto_setup_scope = true;
3667 NativeFunction native_function = NativeEntry::ResolveNative(
3668 library, native_name(), num_params, &auto_setup_scope);
3669 if (native_function == NULL) {
3670 Report::MessageF(Report::kError,
3671 Script::Handle(function().script()),
3672 function().token_pos(),
3673 "native function '%s' (%" Pd " arguments) cannot be found",
3674 native_name().ToCString(),
3675 function().NumParameters());
3676 }
3677 set_native_c_function(native_function);
3678 function().SetIsNativeAutoSetupScope(auto_setup_scope);
3679 Dart_NativeEntryResolver resolver = library.native_entry_resolver();
3680 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver);
3681 set_is_bootstrap_native(is_bootstrap_native);
3682 }
3683
3659 #undef __ 3684 #undef __
3660 3685
3661 } // namespace dart 3686 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698