Skip to content

Commit 1f9bf30

Browse files
sstricklcommit-bot@chromium.org
authored andcommitted
[vm/compiler] Early work on IL deserializer.
At this point, we do get some successful deserializations (of methods that are optimized into constant value returns). Adds support for: GraphEntry (including constant pool) FunctionEntry TargetEntry Return Results from compiling hello world program: * Early round trip * Contains unhandled instructions: 4180 * Failed during deserialization: 0 * Successful round trip: 0 * Late round trip * Contains unhandled instructions: 4163 * Failed during deserialization : 0 * Successful round trip: 15 Bug: #36882 Change-Id: I9e0919f6ffbfe059ce0efd55f9a767c1ba805795 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113325 Commit-Queue: Teagan Strickland <[email protected]> Reviewed-by: Martin Kustermann <[email protected]> Reviewed-by: Aart Bik <[email protected]>
1 parent cd5bcd7 commit 1f9bf30

File tree

7 files changed

+826
-22
lines changed

7 files changed

+826
-22
lines changed

runtime/tests/vm/dart/il_round_trip_deserialization_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
// VMOptions=--early-round-trip-serialization
77
// VMOptions=--late-round-trip-serialization
88
// VMOptions=--early-round-trip-serialization --late-round-trip-serialization
9+
// VMOptions=--deterministic
10+
// VMOptions=--deterministic --early-round-trip-serialization
11+
// VMOptions=--deterministic --late-round-trip-serialization
12+
// VMOptions=--deterministic --early-round-trip-serialization --late-round-trip-serialization
913

1014
// Just use the existing hello world test for now.
1115
// TODO(36882): Add more interesting code as the deserializer grows.

runtime/vm/compiler/backend/il.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,9 +1113,14 @@ const Object& Value::BoundConstant() const {
11131113

11141114
GraphEntryInstr::GraphEntryInstr(const ParsedFunction& parsed_function,
11151115
intptr_t osr_id)
1116-
: BlockEntryWithInitialDefs(0,
1117-
kInvalidTryIndex,
1118-
CompilerState::Current().GetNextDeoptId()),
1116+
: GraphEntryInstr(parsed_function,
1117+
osr_id,
1118+
CompilerState::Current().GetNextDeoptId()) {}
1119+
1120+
GraphEntryInstr::GraphEntryInstr(const ParsedFunction& parsed_function,
1121+
intptr_t osr_id,
1122+
intptr_t deopt_id)
1123+
: BlockEntryWithInitialDefs(0, kInvalidTryIndex, deopt_id),
11191124
parsed_function_(parsed_function),
11201125
catch_entries_(),
11211126
indirect_entries_(),

runtime/vm/compiler/backend/il.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,12 @@ class GraphEntryInstr : public BlockEntryWithInitialDefs {
15061506
PRINT_TO_SUPPORT
15071507

15081508
private:
1509+
friend class FlowGraphDeserializer; // For the constructor with deopt_id arg.
1510+
1511+
GraphEntryInstr(const ParsedFunction& parsed_function,
1512+
intptr_t osr_id,
1513+
intptr_t deopt_id);
1514+
15091515
virtual void ClearPredecessors() {}
15101516
virtual void AddPredecessor(BlockEntryInstr* predecessor) { UNREACHABLE(); }
15111517

@@ -8454,6 +8460,7 @@ class Environment : public ZoneAllocated {
84548460
private:
84558461
friend class ShallowIterator;
84568462
friend class compiler::BlockBuilder; // For Environment constructor.
8463+
friend class FlowGraphDeserializer; // For constructor and deopt_id_.
84578464

84588465
Environment(intptr_t length,
84598466
intptr_t fixed_parameter_count,

0 commit comments

Comments
 (0)