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

Unified Diff: runtime/vm/intermediate_language.h

Issue 1841073003: VM: Fix receiver type propagation in presence of try-catch. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments, added test Created 4 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
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 731fecafea9e5ff468c11fafe74c19b467a1ec55..b0705d4e801c76cdb841e1f82c4d87130a752500 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -1558,12 +1558,14 @@ class CatchBlockEntryInstr : public BlockEntryInstr {
public:
CatchBlockEntryInstr(intptr_t block_id,
intptr_t try_index,
+ GraphEntryInstr* graph_entry,
const Array& handler_types,
intptr_t catch_try_index,
const LocalVariable& exception_var,
const LocalVariable& stacktrace_var,
bool needs_stacktrace)
: BlockEntryInstr(block_id, try_index),
+ graph_entry_(graph_entry),
predecessor_(NULL),
catch_handler_types_(Array::ZoneHandle(handler_types.raw())),
catch_try_index_(catch_try_index),
@@ -1581,6 +1583,8 @@ class CatchBlockEntryInstr : public BlockEntryInstr {
return predecessor_;
}
+ GraphEntryInstr* graph_entry() const { return graph_entry_; }
+
const LocalVariable& exception_var() const { return exception_var_; }
const LocalVariable& stacktrace_var() const { return stacktrace_var_; }
@@ -1606,6 +1610,7 @@ class CatchBlockEntryInstr : public BlockEntryInstr {
predecessor_ = predecessor;
}
+ GraphEntryInstr* graph_entry_;
BlockEntryInstr* predecessor_;
const Array& catch_handler_types_;
const intptr_t catch_try_index_;
@@ -1912,10 +1917,11 @@ class PhiInstr : public Definition {
PhiInstr(JoinEntryInstr* block, intptr_t num_inputs)
: block_(block),
inputs_(num_inputs),
- is_alive_(false),
representation_(kTagged),
reaching_defs_(NULL),
- loop_variable_info_(NULL) {
+ loop_variable_info_(NULL),
+ is_alive_(false),
+ is_receiver_(kUnknownReceiver) {
for (intptr_t i = 0; i < num_inputs; ++i) {
inputs_.Add(NULL);
}
@@ -1985,6 +1991,21 @@ class PhiInstr : public Definition {
PRINT_TO_SUPPORT
+ enum ReceiverType {
+ kUnknownReceiver = -1,
+ kNotReceiver = 0,
+ kReceiver = 1
+ };
+
+ ReceiverType is_receiver() const {
+ return static_cast<ReceiverType>(is_receiver_);
+ }
+
+ void set_is_receiver(ReceiverType is_receiver) {
+ ASSERT(is_receiver_ == kUnknownReceiver);
+ is_receiver_ = is_receiver;
+ }
+
private:
// Direct access to inputs_ in order to resize it due to unreachable
// predecessors.
@@ -1994,11 +2015,11 @@ class PhiInstr : public Definition {
JoinEntryInstr* block_;
GrowableArray<Value*> inputs_;
- bool is_alive_;
Representation representation_;
-
BitVector* reaching_defs_;
InductionVariableInfo* loop_variable_info_;
+ bool is_alive_;
+ int8_t is_receiver_;
DISALLOW_COPY_AND_ASSIGN(PhiInstr);
};

Powered by Google App Engine
This is Rietveld 408576698