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

Side by Side Diff: vm/compiler.cc

Issue 10783035: Create frequently used symbols in the vm isolate (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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) 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 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
11 #include "vm/dart_entry.h" 11 #include "vm/dart_entry.h"
12 #include "vm/debugger.h" 12 #include "vm/debugger.h"
13 #include "vm/disassembler.h" 13 #include "vm/disassembler.h"
14 #include "vm/exceptions.h" 14 #include "vm/exceptions.h"
15 #include "vm/flags.h" 15 #include "vm/flags.h"
16 #include "vm/flow_graph_allocator.h" 16 #include "vm/flow_graph_allocator.h"
17 #include "vm/flow_graph_builder.h" 17 #include "vm/flow_graph_builder.h"
18 #include "vm/flow_graph_compiler.h" 18 #include "vm/flow_graph_compiler.h"
19 #include "vm/flow_graph_optimizer.h" 19 #include "vm/flow_graph_optimizer.h"
20 #include "vm/il_printer.h" 20 #include "vm/il_printer.h"
21 #include "vm/longjump.h" 21 #include "vm/longjump.h"
22 #include "vm/object.h" 22 #include "vm/object.h"
23 #include "vm/object_store.h" 23 #include "vm/object_store.h"
24 #include "vm/os.h" 24 #include "vm/os.h"
25 #include "vm/parser.h" 25 #include "vm/parser.h"
26 #include "vm/scanner.h" 26 #include "vm/scanner.h"
27 #include "vm/symbols.h"
27 #include "vm/timer.h" 28 #include "vm/timer.h"
28 29
29 namespace dart { 30 namespace dart {
30 31
31 DEFINE_FLAG(bool, disassemble, false, "Disassemble dart code."); 32 DEFINE_FLAG(bool, disassemble, false, "Disassemble dart code.");
32 DEFINE_FLAG(bool, trace_compiler, false, "Trace compiler operations."); 33 DEFINE_FLAG(bool, trace_compiler, false, "Trace compiler operations.");
33 DEFINE_FLAG(int, deoptimization_counter_threshold, 5, 34 DEFINE_FLAG(int, deoptimization_counter_threshold, 5,
34 "How many times we allow deoptimization before we disallow" 35 "How many times we allow deoptimization before we disallow"
35 " certain optimizations"); 36 " certain optimizations");
36 DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler."); 37 DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler.");
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 isolate->set_long_jump_base(&jump); 427 isolate->set_long_jump_base(&jump);
427 if (setjmp(*jump.Set()) == 0) { 428 if (setjmp(*jump.Set()) == 0) {
428 if (FLAG_trace_compiler) { 429 if (FLAG_trace_compiler) {
429 OS::Print("compiling expression: "); 430 OS::Print("compiling expression: ");
430 AstPrinter::PrintNode(fragment); 431 AstPrinter::PrintNode(fragment);
431 } 432 }
432 433
433 // Create a dummy function object for the code generator. 434 // Create a dummy function object for the code generator.
434 const char* kEvalConst = "eval_const"; 435 const char* kEvalConst = "eval_const";
435 const Function& func = Function::Handle(Function::New( 436 const Function& func = Function::Handle(Function::New(
436 String::Handle(String::NewSymbol(kEvalConst)), 437 String::Handle(Symbols::New(kEvalConst)),
437 RawFunction::kConstImplicitGetter, 438 RawFunction::kConstImplicitGetter,
438 true, // static function. 439 true, // static function.
439 false, // not const function. 440 false, // not const function.
440 fragment->token_pos())); 441 fragment->token_pos()));
441 442
442 func.set_result_type(Type::Handle(Type::DynamicType())); 443 func.set_result_type(Type::Handle(Type::DynamicType()));
443 func.set_num_fixed_parameters(0); 444 func.set_num_fixed_parameters(0);
444 func.set_num_optional_parameters(0); 445 func.set_num_optional_parameters(0);
445 446
446 // The function needs to be associated with a named Class: the interface 447 // The function needs to be associated with a named Class: the interface
(...skipping 29 matching lines...) Expand all
476 isolate->object_store()->clear_sticky_error(); 477 isolate->object_store()->clear_sticky_error();
477 isolate->set_long_jump_base(base); 478 isolate->set_long_jump_base(base);
478 return result.raw(); 479 return result.raw();
479 } 480 }
480 UNREACHABLE(); 481 UNREACHABLE();
481 return Object::null(); 482 return Object::null();
482 } 483 }
483 484
484 485
485 } // namespace dart 486 } // namespace dart
OLDNEW
« no previous file with comments | « vm/code_patcher_x64_test.cc ('k') | vm/compiler_test.cc » ('j') | vm/dart_api_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698