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

Unified Diff: runtime/vm/flow_graph.cc

Issue 2856543002: Use off-heap data for class check instructions (Closed)
Patch Set: Feedback from Slava: rejig inheritance of CallTargets Created 3 years, 7 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.cc
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index dff1c08e5882e639e8d8bd3dea9548902818261f..84b9e483e42517457bd48e6b7bce6e65207ac959 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -468,6 +468,19 @@ bool FlowGraph::InstanceCallNeedsClassCheck(InstanceCallInstr* call,
}
+Instruction* FlowGraph::CreateCheckClass(Definition* to_check,
+ const Cids& cids,
+ intptr_t deopt_id,
+ TokenPosition token_pos) {
+ if (cids.IsMonomorphic() && cids.MonomorphicReceiverCid() == kSmiCid) {
+ return new (zone())
+ CheckSmiInstr(new (zone()) Value(to_check), deopt_id, token_pos);
+ }
+ return new (zone())
+ CheckClassInstr(new (zone()) Value(to_check), deopt_id, cids, token_pos);
+}
+
+
bool FlowGraph::VerifyUseLists() {
// Verify the initial definitions.
for (intptr_t i = 0; i < graph_entry_->initial_definitions()->length(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698