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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 1858283002: Initial SIMDBC interpreter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 4 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
Index: runtime/vm/flow_graph_compiler.cc
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 1ca6adc4a1d0f3cd4f441f043c8ce939d5847781..bed88915fb7c0ddabd27fa87ed48c4bdd89a4373 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -503,7 +503,7 @@ void FlowGraphCompiler::VisitBlocks() {
continue;
}
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
if (!is_optimizing()) {
FrameStateClear();
}
@@ -557,14 +557,14 @@ void FlowGraphCompiler::VisitBlocks() {
EndCodeSourceRange(instr->token_pos());
}
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
if (!is_optimizing()) {
FrameStateUpdateWith(instr);
}
#endif
}
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
ASSERT(is_optimizing() || FrameStateIsSafeToCall());
#endif
}
@@ -1147,6 +1147,9 @@ bool FlowGraphCompiler::TryIntrinsify() {
}
+// DBC is very different from other architectures in how it performs instance
+// and static calls because it does not use stubs.
+#if !defined(TARGET_ARCH_DBC)
void FlowGraphCompiler::GenerateInstanceCall(
intptr_t deopt_id,
TokenPosition token_pos,
@@ -1285,7 +1288,7 @@ void FlowGraphCompiler::GenerateListTypeCheck(Register kClassIdReg,
CheckClassIds(kClassIdReg, args, is_instance_lbl, &unknown);
assembler()->Bind(&unknown);
}
-
+#endif
zra 2016/04/14 18:27:47 add // !defined(TARGET_ARCH_DBC)
Vyacheslav Egorov (Google) 2016/04/18 15:56:41 Done.
void FlowGraphCompiler::EmitComment(Instruction* instr) {
if (!FLAG_support_il_printer || !FLAG_support_disassembler) {
@@ -1300,6 +1303,8 @@ void FlowGraphCompiler::EmitComment(Instruction* instr) {
}
+#if !defined(TARGET_ARCH_DBC)
+// TODO(vegorov) enable edge-counters on DBC if we consider them beneficial.
bool FlowGraphCompiler::NeedsEdgeCounter(TargetEntryInstr* block) {
// Only emit an edge counter if there is not goto at the end of the block,
// except for the entry block.
@@ -1320,18 +1325,17 @@ static Register AllocateFreeRegister(bool* blocked_registers) {
UNREACHABLE();
return kNoRegister;
}
-
-
-static uword RegMaskBit(Register reg) {
- return ((reg) != kNoRegister) ? (1 << (reg)) : 0;
-}
+#endif
void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
ASSERT(!is_optimizing());
-
instr->InitializeLocationSummary(zone(),
false); // Not optimizing.
+
+ // No need to allocate registers based on LocationSummary on DBC as in
+ // unoptimized mode it's a stack based bytecode just like IR itself.
+#if !defined(TARGET_ARCH_DBC)
zra 2016/04/14 18:27:48 Is this temporary or permanent? Not clear from the
Vyacheslav Egorov (Google) 2016/04/18 15:56:40 It's not a TODO - which means it is permanent.
LocationSummary* locs = instr->locs();
bool blocked_registers[kNumberOfCpuRegisters];
@@ -1421,6 +1425,12 @@ void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
}
locs->set_out(0, result_location);
}
+#endif
zra 2016/04/14 18:27:47 add // !defined(TARGET_ARCH_DBC)
Vyacheslav Egorov (Google) 2016/04/18 15:56:41 Done.
+}
+
+
+static uword RegMaskBit(Register reg) {
+ return ((reg) != kNoRegister) ? (1 << (reg)) : 0;
}
@@ -1831,6 +1841,9 @@ NOT_IN_PRODUCT(
}
+#if !defined(TARGET_ARCH_DBC)
+// DBC emits calls very differently from other architectures due to its
+// interpreted nature.
void FlowGraphCompiler::EmitPolymorphicInstanceCall(
const ICData& ic_data,
intptr_t argument_count,
@@ -1864,9 +1877,12 @@ void FlowGraphCompiler::EmitPolymorphicInstanceCall(
assembler()->Bind(&ok);
}
}
+#endif
-
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
+// TODO(vegorov) re-enable frame state tracking on DBC. It is
+// currently disabled because it relies on LocationSummaries and
+// we don't use them during unoptimized compilation on DBC.
void FlowGraphCompiler::FrameStateUpdateWith(Instruction* instr) {
ASSERT(!is_optimizing());

Powered by Google App Engine
This is Rietveld 408576698