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

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

Issue 9693020: Optional arguments in new compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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/code_generator_x64.cc ('k') | runtime/vm/flow_graph_compiler_x64.h » ('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/flags.h" 8 #include "vm/flags.h"
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 instr->false_successor()->block_number()); 1497 instr->false_successor()->block_number());
1498 } 1498 }
1499 1499
1500 1500
1501 void FlowGraphBuilder::BuildGraph() { 1501 void FlowGraphBuilder::BuildGraph() {
1502 if (FLAG_print_ast) { 1502 if (FLAG_print_ast) {
1503 // Print the function ast before IL generation. 1503 // Print the function ast before IL generation.
1504 AstPrinter::PrintFunctionNodes(parsed_function()); 1504 AstPrinter::PrintFunctionNodes(parsed_function());
1505 } 1505 }
1506 const Function& function = parsed_function().function(); 1506 const Function& function = parsed_function().function();
1507 if ((function.num_optional_parameters() != 0)) {
1508 Bailout("function has optional parameters");
1509 }
1510 EffectGraphVisitor for_effect(this, 0); 1507 EffectGraphVisitor for_effect(this, 0);
1511 for_effect.AddInstruction(new TargetEntryInstr()); 1508 for_effect.AddInstruction(new TargetEntryInstr());
1512 parsed_function().node_sequence()->Visit(&for_effect); 1509 parsed_function().node_sequence()->Visit(&for_effect);
1513 // Check that the graph is properly terminated. 1510 // Check that the graph is properly terminated.
1514 ASSERT(!for_effect.is_open()); 1511 ASSERT(!for_effect.is_open());
1515 if (for_effect.entry() != NULL) { 1512 if (for_effect.entry() != NULL) {
1516 // Accumulate basic block entries via postorder traversal. 1513 // Accumulate basic block entries via postorder traversal.
1517 for_effect.entry()->Postorder(&postorder_block_entries_); 1514 for_effect.entry()->Postorder(&postorder_block_entries_);
1518 // Number the blocks in reverse postorder starting with 0. 1515 // Number the blocks in reverse postorder starting with 0.
1519 intptr_t last_index = postorder_block_entries_.length() - 1; 1516 intptr_t last_index = postorder_block_entries_.length() - 1;
(...skipping 15 matching lines...) Expand all
1535 char* chars = reinterpret_cast<char*>( 1532 char* chars = reinterpret_cast<char*>(
1536 Isolate::Current()->current_zone()->Allocate(len)); 1533 Isolate::Current()->current_zone()->Allocate(len));
1537 OS::SNPrint(chars, len, kFormat, function_name, reason); 1534 OS::SNPrint(chars, len, kFormat, function_name, reason);
1538 const Error& error = Error::Handle( 1535 const Error& error = Error::Handle(
1539 LanguageError::New(String::Handle(String::New(chars)))); 1536 LanguageError::New(String::Handle(String::New(chars))));
1540 Isolate::Current()->long_jump_base()->Jump(1, error); 1537 Isolate::Current()->long_jump_base()->Jump(1, error);
1541 } 1538 }
1542 1539
1543 1540
1544 } // namespace dart 1541 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator_x64.cc ('k') | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698