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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10928048: Nested deoptimization environments. (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 side-by-side diff with in-line comments
Download patch
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index d2734acb9112ed65ded1f32154aff129ee9e8b76..52dda0585b6131d4090e93d5924b4c2aec6201c3 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1612,27 +1612,42 @@ void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-Environment::Environment(const GrowableArray<Definition*>& definitions,
- intptr_t fixed_parameter_count)
- : values_(definitions.length()),
- locations_(NULL),
- fixed_parameter_count_(fixed_parameter_count) {
+Environment* Environment::From(const GrowableArray<Definition*>& definitions,
+ intptr_t fixed_parameter_count,
+ const Environment* outer) {
+ Environment* env = new Environment(
Kevin Millikin (Google) 2012/09/07 12:51:52 All other things being equal, I tend to try to bre
zerny-google 2012/09/07 13:51:37 Done.
+ definitions.length(),
+ fixed_parameter_count,
+ -1,
Kevin Millikin (Google) 2012/09/07 12:51:52 Isolate::kNoDeoptId,
zerny-google 2012/09/07 13:51:37 Done.
+ (outer == NULL) ? NULL : outer->Copy());
for (intptr_t i = 0; i < definitions.length(); ++i) {
- values_.Add(new Value(definitions[i]));
+ env->values_.Add(new Value(definitions[i]));
}
+ return env;
+}
+
+
+Environment* Environment::Copy() const {
+ Environment* copy = new Environment(
Kevin Millikin (Google) 2012/09/07 12:51:52 Same comment about indentation.
zerny-google 2012/09/07 13:51:37 Done.
+ values_.length(),
+ fixed_parameter_count_,
+ deopt_id_,
+ (outer_ == NULL) ? NULL : outer_->Copy());
+ for (intptr_t i = 0; i < values_.length(); ++i) {
+ copy->values_.Add(values_[i]->Copy());
+ }
+ return copy;
}
// Copies the environment and updates the environment use lists.
void Environment::CopyTo(Instruction* instr) const {
- Environment* copy = new Environment(values().length(),
- fixed_parameter_count());
- GrowableArray<Value*>* values_copy = copy->values_ptr();
- for (intptr_t i = 0; i < values().length(); ++i) {
- Value* value = values()[i]->Copy();
- values_copy->Add(value);
+ Environment* copy = Copy();
+ intptr_t use_index = 0;
+ for (EnvironmentIterator it(copy); !it.Done(); it.Advance()) {
+ Value* value = it.CurrentValue();
value->set_instruction(instr);
- value->set_use_index(i);
+ value->set_use_index(use_index++);
value->AddToEnvUseList();
}
instr->set_env(copy);
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698