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

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

Issue 99373002: Mark native functions when they are created. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/code_patcher_x64_test.cc ('k') | runtime/vm/megamorphic_cache_table.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 AstPrinter::PrintNode(fragment); 910 AstPrinter::PrintNode(fragment);
911 } 911 }
912 912
913 // Create a dummy function object for the code generator. 913 // Create a dummy function object for the code generator.
914 // The function needs to be associated with a named Class: the interface 914 // The function needs to be associated with a named Class: the interface
915 // Function fits the bill. 915 // Function fits the bill.
916 const char* kEvalConst = "eval_const"; 916 const char* kEvalConst = "eval_const";
917 const Function& func = Function::ZoneHandle(Function::New( 917 const Function& func = Function::ZoneHandle(Function::New(
918 String::Handle(Symbols::New(kEvalConst)), 918 String::Handle(Symbols::New(kEvalConst)),
919 RawFunction::kRegularFunction, 919 RawFunction::kRegularFunction,
920 true, // static function. 920 true, // static function
921 false, // not const function. 921 false, // not const function
922 false, // not abstract 922 false, // not abstract
923 false, // not external. 923 false, // not external
924 false, // not native
924 Class::Handle(Type::Handle(Type::Function()).type_class()), 925 Class::Handle(Type::Handle(Type::Function()).type_class()),
925 fragment->token_pos())); 926 fragment->token_pos()));
926 927
927 func.set_result_type(Type::Handle(Type::DynamicType())); 928 func.set_result_type(Type::Handle(Type::DynamicType()));
928 func.set_num_fixed_parameters(0); 929 func.set_num_fixed_parameters(0);
929 func.SetNumOptionalParameters(0, true); 930 func.SetNumOptionalParameters(0, true);
930 // Manually generated AST, do not recompile. 931 // Manually generated AST, do not recompile.
931 func.set_is_optimizable(false); 932 func.set_is_optimizable(false);
932 933
933 // We compile the function here, even though InvokeStatic() below 934 // We compile the function here, even though InvokeStatic() below
(...skipping 18 matching lines...) Expand all
952 Object::Handle(isolate->object_store()->sticky_error()); 953 Object::Handle(isolate->object_store()->sticky_error());
953 isolate->object_store()->clear_sticky_error(); 954 isolate->object_store()->clear_sticky_error();
954 isolate->set_long_jump_base(base); 955 isolate->set_long_jump_base(base);
955 return result.raw(); 956 return result.raw();
956 } 957 }
957 UNREACHABLE(); 958 UNREACHABLE();
958 return Object::null(); 959 return Object::null();
959 } 960 }
960 961
961 } // namespace dart 962 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_x64_test.cc ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698