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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2857513002: Revert "VM: [Kernel] elide parent context setup if it's empty" (Closed)
Patch Set: Created 3 years, 8 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/kernel_to_il.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index 6d95f78172a293f71ad406982c9b9860b78493df..9f2d4601307fbe47a96f02a3a28c0840969d7750 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -2311,23 +2311,14 @@ Fragment FlowGraphBuilder::AdjustContextTo(int depth) {
}
-bool FlowGraphBuilder::HasContextScope() const {
- const ContextScope& context_scope =
- ContextScope::Handle(parsed_function_->function().context_scope());
- return !context_scope.IsNull() && context_scope.num_variables() > 0;
-}
-
-
Fragment FlowGraphBuilder::PushContext(int size) {
ASSERT(size > 0);
Fragment instructions = AllocateContext(size);
- if (context_depth_ != 0 || HasContextScope()) {
- LocalVariable* context = MakeTemporary();
- instructions += LoadLocal(context);
- instructions += LoadLocal(parsed_function_->current_context_var());
- instructions +=
- StoreInstanceField(TokenPosition::kNoSource, Context::parent_offset());
- }
+ LocalVariable* context = MakeTemporary();
+ instructions += LoadLocal(context);
+ instructions += LoadLocal(parsed_function_->current_context_var());
+ instructions +=
+ StoreInstanceField(TokenPosition::kNoSource, Context::parent_offset());
instructions += StoreLocal(TokenPosition::kNoSource,
parsed_function_->current_context_var());
++context_depth_;
« no previous file with comments | « runtime/vm/kernel_to_il.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698