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

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

Issue 14682020: Optimize functions containing try-catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed checked mode tests failure Created 7 years, 7 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/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/code_descriptors.h" 9 #include "vm/code_descriptors.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 3053 matching lines...) Expand 10 before | Expand all | Expand 10 after
3064 } 3064 }
3065 3065
3066 // The outermost function sequence cannot contain a label. 3066 // The outermost function sequence cannot contain a label.
3067 ASSERT((node->label() == NULL) || 3067 ASSERT((node->label() == NULL) ||
3068 (node != owner()->parsed_function().node_sequence())); 3068 (node != owner()->parsed_function().node_sequence()));
3069 owner()->set_context_level(previous_context_level); 3069 owner()->set_context_level(previous_context_level);
3070 } 3070 }
3071 3071
3072 3072
3073 void EffectGraphVisitor::VisitCatchClauseNode(CatchClauseNode* node) { 3073 void EffectGraphVisitor::VisitCatchClauseNode(CatchClauseNode* node) {
3074 #if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS)
3075 Bailout("EffectGraphVisitor::VisitCatchClauseNode (exception)");
srdjan 2013/05/07 17:34:05 Why is this bailout necessary?
Florian Schneider 2013/05/08 08:57:47 Oops, yes this is the wrong place here. I was inc
3076 #endif
3074 InlineBailout("EffectGraphVisitor::VisitCatchClauseNode (exception)"); 3077 InlineBailout("EffectGraphVisitor::VisitCatchClauseNode (exception)");
3075 // NOTE: The implicit variables ':saved_context', ':exception_var' 3078 // NOTE: The implicit variables ':saved_context', ':exception_var'
3076 // and ':stacktrace_var' can never be captured variables. 3079 // and ':stacktrace_var' can never be captured variables.
3077 // Restores CTX from local variable ':saved_context'. 3080 // Restores CTX from local variable ':saved_context'.
3078 AddInstruction( 3081 AddInstruction(
3079 new CatchEntryInstr(node->exception_var(), node->stacktrace_var())); 3082 new CatchEntryInstr(node->exception_var(), node->stacktrace_var()));
3080 BuildLoadContext(node->context_var()); 3083 BuildLoadContext(node->context_var());
3081 3084
3082 EffectGraphVisitor for_catch(owner(), temp_index()); 3085 EffectGraphVisitor for_catch(owner(), temp_index());
3083 node->VisitChildren(&for_catch); 3086 node->VisitChildren(&for_catch);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
3382 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3385 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3383 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3386 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3384 OS::SNPrint(chars, len, kFormat, function_name, reason); 3387 OS::SNPrint(chars, len, kFormat, function_name, reason);
3385 const Error& error = Error::Handle( 3388 const Error& error = Error::Handle(
3386 LanguageError::New(String::Handle(String::New(chars)))); 3389 LanguageError::New(String::Handle(String::New(chars))));
3387 Isolate::Current()->long_jump_base()->Jump(1, error); 3390 Isolate::Current()->long_jump_base()->Jump(1, error);
3388 } 3391 }
3389 3392
3390 3393
3391 } // namespace dart 3394 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698