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

Side by Side Diff: runtime/vm/intermediate_language_arm.cc

Issue 2796283003: VM: [Kernel] Implement CatchBlockEntryInstr::should_restore_closure_context on all platforms. (Closed)
Patch Set: Address Zach's comment 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_dbc.cc ('k') | runtime/vm/intermediate_language_arm64.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 1
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. 6 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
7 #if defined(TARGET_ARCH_ARM) 7 #if defined(TARGET_ARCH_ARM)
8 8
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 10
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after
2900 // Auxiliary variables introduced by the try catch can be captured if we are 2900 // Auxiliary variables introduced by the try catch can be captured if we are
2901 // inside a function with yield/resume points. In this case we first need 2901 // inside a function with yield/resume points. In this case we first need
2902 // to restore the context to match the context at entry into the closure. 2902 // to restore the context to match the context at entry into the closure.
2903 if (should_restore_closure_context()) { 2903 if (should_restore_closure_context()) {
2904 const ParsedFunction& parsed_function = compiler->parsed_function(); 2904 const ParsedFunction& parsed_function = compiler->parsed_function();
2905 ASSERT(parsed_function.function().IsClosureFunction()); 2905 ASSERT(parsed_function.function().IsClosureFunction());
2906 LocalScope* scope = parsed_function.node_sequence()->scope(); 2906 LocalScope* scope = parsed_function.node_sequence()->scope();
2907 2907
2908 LocalVariable* closure_parameter = scope->VariableAt(0); 2908 LocalVariable* closure_parameter = scope->VariableAt(0);
2909 ASSERT(!closure_parameter->is_captured()); 2909 ASSERT(!closure_parameter->is_captured());
2910 __ ldr(CTX, Address(FP, closure_parameter->index() * kWordSize)); 2910 __ LoadFromOffset(kWord, CTX, FP, closure_parameter->index() * kWordSize);
2911 __ ldr(CTX, FieldAddress(CTX, Closure::context_offset())); 2911 __ LoadFieldFromOffset(kWord, CTX, CTX, Closure::context_offset());
2912 2912
2913 const intptr_t context_index = 2913 const intptr_t context_index =
2914 parsed_function.current_context_var()->index(); 2914 parsed_function.current_context_var()->index();
2915 __ StoreToOffset(kWord, CTX, FP, context_index * kWordSize); 2915 __ StoreToOffset(kWord, CTX, FP, context_index * kWordSize);
2916 } 2916 }
2917 2917
2918 // Initialize exception and stack trace variables. 2918 // Initialize exception and stack trace variables.
2919 if (exception_var().is_captured()) { 2919 if (exception_var().is_captured()) {
2920 ASSERT(stacktrace_var().is_captured()); 2920 ASSERT(stacktrace_var().is_captured());
2921 __ StoreIntoObjectOffset(CTX, 2921 __ StoreIntoObjectOffset(CTX,
(...skipping 4335 matching lines...) Expand 10 before | Expand all | Expand 10 after
7257 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), 7257 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
7258 kGrowRegExpStackRuntimeEntry, 1, locs()); 7258 kGrowRegExpStackRuntimeEntry, 1, locs());
7259 __ Drop(1); 7259 __ Drop(1);
7260 __ Pop(result); 7260 __ Pop(result);
7261 } 7261 }
7262 7262
7263 7263
7264 } // namespace dart 7264 } // namespace dart
7265 7265
7266 #endif // defined TARGET_ARCH_ARM 7266 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_dbc.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698