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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 513213002: Generate some intrinsics using our IR. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed Slava's feedback Created 6 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
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 39909)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -98,6 +98,7 @@
GrowableObjectArray::New())),
is_optimizing_(is_optimizing),
may_reoptimize_(false),
+ intrinsic_mode_(false),
double_class_(Class::ZoneHandle(
isolate_->object_store()->double_class())),
mint_class_(Class::ZoneHandle(
@@ -547,6 +548,7 @@
void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id,
intptr_t token_pos) {
ASSERT(is_optimizing());
+ ASSERT(!intrinsic_mode());
CompilerDeoptInfo* info =
new CompilerDeoptInfo(deopt_id,
ICData::kDeoptAtCall,
@@ -727,6 +729,10 @@
Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id,
ICData::DeoptReasonId reason) {
+ if (intrinsic_mode()) {
+ return &intrinsic_slow_path_label_;
+ }
+
ASSERT(is_optimizing_);
CompilerDeoptInfoWithStub* stub =
new CompilerDeoptInfoWithStub(deopt_id,
@@ -855,9 +861,19 @@
}
}
}
- // Even if an intrinsified version of the function was successfully
- // generated, it may fall through to the non-intrinsified method body.
- Intrinsifier::Intrinsify(parsed_function().function(), assembler());
+
+ EnterIntrinsicMode();
+
+ Intrinsifier::Intrinsify(&parsed_function(), this);
+
+ ExitIntrinsicMode();
+ // "Deoptimization" from intrinsic continues here. All deoptimization
+ // branches from intrinsic code redirect to here where the slow-path
+ // (normal function body) starts.
+ // This means that there must not be any side-effects in intrinsic code
+ // before any deoptimization point.
+ ASSERT(!intrinsic_slow_path_label_.IsBound());
+ assembler()->Bind(&intrinsic_slow_path_label_);
}
@@ -1368,6 +1384,10 @@
| MaskBit(TMP)
| MaskBit(TMP2)
| MaskBit(PP);
+ if (resolver->compiler_->intrinsic_mode()) {
+ // Block additional registers that must be preserved for intrinsics.
+ blocked_mask |= MaskBit(ARGS_DESC_REG);
+ }
reg_ = static_cast<Register>(
resolver_->AllocateScratchRegister(Location::kRegister,
blocked_mask,
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698