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

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

Issue 10910119: Implement new optional parameters syntax in the vm (issue 4290). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_compiler.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/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "vm/ast_printer.h" 7 #include "vm/ast_printer.h"
8 #include "vm/code_descriptors.h" 8 #include "vm/code_descriptors.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 13 matching lines...) Expand all
24 "Eliminate type checks when allowed by static type analysis."); 24 "Eliminate type checks when allowed by static type analysis.");
25 DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree."); 25 DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree.");
26 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph."); 26 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph.");
27 DEFINE_FLAG(bool, trace_type_check_elimination, false, 27 DEFINE_FLAG(bool, trace_type_check_elimination, false,
28 "Trace type check elimination at compile time."); 28 "Trace type check elimination at compile time.");
29 DECLARE_FLAG(bool, enable_type_checks); 29 DECLARE_FLAG(bool, enable_type_checks);
30 30
31 31
32 FlowGraphBuilder::FlowGraphBuilder(const ParsedFunction& parsed_function) 32 FlowGraphBuilder::FlowGraphBuilder(const ParsedFunction& parsed_function)
33 : parsed_function_(parsed_function), 33 : parsed_function_(parsed_function),
34 copied_parameter_count_(parsed_function.copied_parameter_count()), 34 num_copied_params_(parsed_function.num_copied_params()),
35 // All parameters are copied if any parameter is. 35 // All parameters are copied if any parameter is.
36 non_copied_parameter_count_((copied_parameter_count_ == 0) 36 num_non_copied_params_((num_copied_params_ == 0)
37 ? parsed_function.function().num_fixed_parameters() 37 ? parsed_function.function().num_fixed_parameters()
38 : 0), 38 : 0),
39 stack_local_count_(parsed_function.stack_local_count()), 39 num_stack_locals_(parsed_function.num_stack_locals()),
40 context_level_(0), 40 context_level_(0),
41 last_used_try_index_(CatchClauseNode::kInvalidTryIndex), 41 last_used_try_index_(CatchClauseNode::kInvalidTryIndex),
42 try_index_(CatchClauseNode::kInvalidTryIndex), 42 try_index_(CatchClauseNode::kInvalidTryIndex),
43 graph_entry_(NULL), 43 graph_entry_(NULL),
44 inlining_context_(kNotInlining), 44 inlining_context_(kNotInlining),
45 exits_(NULL) { } 45 exits_(NULL) { }
46 46
47 47
48 void FlowGraphBuilder::AddCatchEntry(TargetEntryInstr* entry) { 48 void FlowGraphBuilder::AddCatchEntry(TargetEntryInstr* entry) {
49 graph_entry_->AddCatchEntry(entry); 49 graph_entry_->AddCatchEntry(entry);
(...skipping 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after
2611 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2611 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2612 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2612 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2613 OS::SNPrint(chars, len, kFormat, function_name, reason); 2613 OS::SNPrint(chars, len, kFormat, function_name, reason);
2614 const Error& error = Error::Handle( 2614 const Error& error = Error::Handle(
2615 LanguageError::New(String::Handle(String::New(chars)))); 2615 LanguageError::New(String::Handle(String::New(chars))));
2616 Isolate::Current()->long_jump_base()->Jump(1, error); 2616 Isolate::Current()->long_jump_base()->Jump(1, error);
2617 } 2617 }
2618 2618
2619 2619
2620 } // namespace dart 2620 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698