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

Unified Diff: runtime/vm/intermediate_language.h

Issue 9706032: Add Throw and ReThrow nodes. Rethrow not yet tested (bailout with untested), since it needs the try… (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 5480)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -40,6 +40,8 @@
// | CreateArray <ArrayNode> <Value> ...
// | CreateClosure <ClosureNode>
// | AllocateObject <ConstructorCallNode>
+// | Throw <Value>
+// | ReThrow <Value> <Value>
// | NativeLoadField <Value> <intptr_t>
// | ExtractTypeArgumentsComp <ConstructorCallNode> <Value>
//
@@ -78,6 +80,8 @@
M(CreateArray, CreateArrayComp) \
M(CreateClosure, CreateClosureComp) \
M(AllocateObject, AllocateObjectComp) \
+ M(Throw, ThrowComp) \
+ M(ReThrow, ReThrowComp) \
M(NativeLoadField, NativeLoadFieldComp) \
M(ExtractTypeArguments, ExtractTypeArgumentsComp) \
@@ -639,6 +643,61 @@
};
+class ThrowComp : public Computation {
+ public:
+ explicit ThrowComp(intptr_t node_id,
+ intptr_t token_index,
+ Value* exception)
+ : node_id_(node_id), token_index_(token_index), exception_(exception) {
+ ASSERT(exception_ != NULL);
+ }
+
+ DECLARE_COMPUTATION(Throw)
+
+ intptr_t node_id() const { return node_id_; }
+ intptr_t token_index() const { return token_index_; }
+ Value* exception() const { return exception_; }
+
+ private:
+ intptr_t node_id_;
+ intptr_t token_index_;
+ Value* exception_;
+
+ DISALLOW_COPY_AND_ASSIGN(ThrowComp);
+};
+
+
+class ReThrowComp : public Computation {
+ public:
+ ReThrowComp(intptr_t node_id,
+ intptr_t token_index,
+ Value* exception,
+ Value* stack_trace)
+ : node_id_(node_id),
+ token_index_(token_index),
+ exception_(exception),
+ stack_trace_(stack_trace) {
+ ASSERT(exception_ != NULL);
+ ASSERT(stack_trace_ != NULL);
+ }
+
+ DECLARE_COMPUTATION(ReThrow)
+
+ intptr_t node_id() const { return node_id_; }
+ intptr_t token_index() const { return token_index_; }
+ Value* exception() const { return exception_; }
+ Value* stack_trace() const { return stack_trace_; }
+
+ private:
+ intptr_t node_id_;
+ intptr_t token_index_;
+ Value* exception_;
+ Value* stack_trace_;
+
+ DISALLOW_COPY_AND_ASSIGN(ReThrowComp);
+};
+
+
class NativeLoadFieldComp : public Computation {
public:
NativeLoadFieldComp(Value* value, intptr_t offset_in_bytes)
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698