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

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

Issue 10918212: Prohibit inlining of functions containing throw. Inliner does not handle abnormal control flow. (Closed) Base URL: https://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 | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')
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 2517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2528 // Generate code for the finally block if one exists. 2528 // Generate code for the finally block if one exists.
2529 if ((node->finally_block() != NULL) && is_open()) { 2529 if ((node->finally_block() != NULL) && is_open()) {
2530 EffectGraphVisitor for_finally_block(owner(), temp_index()); 2530 EffectGraphVisitor for_finally_block(owner(), temp_index());
2531 node->finally_block()->Visit(&for_finally_block); 2531 node->finally_block()->Visit(&for_finally_block);
2532 Append(for_finally_block); 2532 Append(for_finally_block);
2533 } 2533 }
2534 } 2534 }
2535 2535
2536 2536
2537 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) { 2537 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) {
2538 // TODO(kmillikin) non-local control flow is not handled correctly
2539 // by the inliner.
2540 InlineBailout("EffectGraphVisitor::BuildThrowNode");
2538 ValueGraphVisitor for_exception(owner(), temp_index()); 2541 ValueGraphVisitor for_exception(owner(), temp_index());
2539 node->exception()->Visit(&for_exception); 2542 node->exception()->Visit(&for_exception);
2540 Append(for_exception); 2543 Append(for_exception);
2541 PushArgument(for_exception.value()); 2544 PushArgument(for_exception.value());
2542 Instruction* instr = NULL; 2545 Instruction* instr = NULL;
2543 if (node->stacktrace() == NULL) { 2546 if (node->stacktrace() == NULL) {
2544 instr = new ThrowInstr(node->token_pos()); 2547 instr = new ThrowInstr(node->token_pos());
2545 } else { 2548 } else {
2546 ValueGraphVisitor for_stack_trace(owner(), temp_index()); 2549 ValueGraphVisitor for_stack_trace(owner(), temp_index());
2547 node->stacktrace()->Visit(&for_stack_trace); 2550 node->stacktrace()->Visit(&for_stack_trace);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2633 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2636 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2634 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2637 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2635 OS::SNPrint(chars, len, kFormat, function_name, reason); 2638 OS::SNPrint(chars, len, kFormat, function_name, reason);
2636 const Error& error = Error::Handle( 2639 const Error& error = Error::Handle(
2637 LanguageError::New(String::Handle(String::New(chars)))); 2640 LanguageError::New(String::Handle(String::New(chars))));
2638 Isolate::Current()->long_jump_base()->Jump(1, error); 2641 Isolate::Current()->long_jump_base()->Jump(1, error);
2639 } 2642 }
2640 2643
2641 2644
2642 } // namespace dart 2645 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698