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

Side by Side Diff: vm/flow_graph_builder.cc

Issue 10829141: Support Throw and ReThrow in SSA-based compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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 | vm/il_printer.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/bit_vector.h" 8 #include "vm/bit_vector.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 2173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 node->finally_block()->Visit(&for_finally_block); 2184 node->finally_block()->Visit(&for_finally_block);
2185 Append(for_finally_block); 2185 Append(for_finally_block);
2186 } 2186 }
2187 } 2187 }
2188 2188
2189 2189
2190 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) { 2190 void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) {
2191 ValueGraphVisitor for_exception(owner(), temp_index()); 2191 ValueGraphVisitor for_exception(owner(), temp_index());
2192 node->exception()->Visit(&for_exception); 2192 node->exception()->Visit(&for_exception);
2193 Append(for_exception); 2193 Append(for_exception);
2194 PushArgument(for_exception.value());
2194 Instruction* instr = NULL; 2195 Instruction* instr = NULL;
2195 if (node->stacktrace() == NULL) { 2196 if (node->stacktrace() == NULL) {
2196 instr = new ThrowInstr(node->token_pos(), 2197 instr = new ThrowInstr(node->token_pos(), owner()->try_index());
2197 owner()->try_index(),
2198 for_exception.value());
2199 } else { 2198 } else {
2200 ValueGraphVisitor for_stack_trace(owner(), temp_index()); 2199 ValueGraphVisitor for_stack_trace(owner(), temp_index());
2201 node->stacktrace()->Visit(&for_stack_trace); 2200 node->stacktrace()->Visit(&for_stack_trace);
2202 Append(for_stack_trace); 2201 Append(for_stack_trace);
2203 instr = new ReThrowInstr(node->token_pos(), 2202 PushArgument(for_stack_trace.value());
2204 owner()->try_index(), 2203 instr = new ReThrowInstr(node->token_pos(), owner()->try_index());
2205 for_exception.value(),
2206 for_stack_trace.value());
2207 } 2204 }
2208 AddInstruction(instr); 2205 AddInstruction(instr);
2209 } 2206 }
2210 2207
2211 2208
2212 void EffectGraphVisitor::VisitThrowNode(ThrowNode* node) { 2209 void EffectGraphVisitor::VisitThrowNode(ThrowNode* node) {
2213 BuildThrowNode(node); 2210 BuildThrowNode(node);
2214 CloseFragment(); 2211 CloseFragment();
2215 } 2212 }
2216 2213
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
2688 char* chars = reinterpret_cast<char*>( 2685 char* chars = reinterpret_cast<char*>(
2689 Isolate::Current()->current_zone()->Allocate(len)); 2686 Isolate::Current()->current_zone()->Allocate(len));
2690 OS::SNPrint(chars, len, kFormat, function_name, reason); 2687 OS::SNPrint(chars, len, kFormat, function_name, reason);
2691 const Error& error = Error::Handle( 2688 const Error& error = Error::Handle(
2692 LanguageError::New(String::Handle(String::New(chars)))); 2689 LanguageError::New(String::Handle(String::New(chars))));
2693 Isolate::Current()->long_jump_base()->Jump(1, error); 2690 Isolate::Current()->long_jump_base()->Jump(1, error);
2694 } 2691 }
2695 2692
2696 2693
2697 } // namespace dart 2694 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698