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

Unified Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2388093003: VM: Make optimized try-catch work in DBC. (Closed)
Patch Set: addressed comments, fix bug in CheckClass Created 4 years, 2 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/flow_graph_allocator.cc ('K') | « runtime/vm/flow_graph_compiler.cc ('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_dbc.cc
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index aca13bdda4f4d677e5fae7d59cca94a1699c7b3f..cbcd5875f623c13505e0022ebc9220139f796a27 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -1119,9 +1119,14 @@ EMIT_NATIVE_CODE(CatchBlockEntry, 0) {
compiler->assembler()->CodeSize(),
catch_handler_types_,
needs_stacktrace());
- __ MoveSpecial(-exception_var().index()-1,
+
+ if (HasParallelMove()) {
+ compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
+ }
+
+ __ MoveSpecial(LocalVarIndex(0, exception_var().index()),
Simulator::kExceptionSpecialIndex);
- __ MoveSpecial(-stacktrace_var().index()-1,
+ __ MoveSpecial(LocalVarIndex(0, stacktrace_var().index()),
Simulator::kStacktraceSpecialIndex);
__ SetFrame(compiler->StackSize());
}
@@ -1400,10 +1405,15 @@ EMIT_NATIVE_CODE(CheckClass, 1) {
(unary_checks().NumberOfChecks() > 1));
const intptr_t may_be_smi =
(unary_checks().GetReceiverClassIdAt(0) == kSmiCid) ? 1 : 0;
+ bool is_dense_switch = false;
+ intptr_t cid_mask = 0;
if (IsDenseSwitch()) {
ASSERT(cids_[0] < cids_[cids_.length() - 1]);
+ cid_mask = ComputeCidMask();
+ is_dense_switch = Smi::IsValid(cid_mask);
Florian Schneider 2016/10/04 17:07:57 I'll fix this in a follow-up CL by adding support
+ }
+ if (is_dense_switch) {
const intptr_t low_cid = cids_[0];
- const intptr_t cid_mask = ComputeCidMask();
__ CheckDenseSwitch(value, may_be_smi);
__ Nop(compiler->ToEmbeddableCid(low_cid, this));
__ Nop(__ AddConstant(Smi::Handle(Smi::New(cid_mask))));
« runtime/vm/flow_graph_allocator.cc ('K') | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698