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

Unified Diff: runtime/vm/object.cc

Issue 1153963002: Remove value check from ICData checks/house-keeping (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: C Created 5 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
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/regexp_assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 3314c72efe8a016b79b7350f1873ae1c91e2eb9d..99fa73e936e9893c35b857777c8b70f528ba1b77 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -11732,6 +11732,18 @@ RawFunction* ICData::GetTargetForReceiverClassId(intptr_t class_id) const {
}
+RawICData* ICData::AsUnaryClassChecksForCid(
+ intptr_t cid, const Function& target) const {
+ ASSERT(!IsNull());
+ const intptr_t kNumArgsTested = 1;
+ ICData& result = ICData::Handle(ICData::NewFrom(*this, kNumArgsTested));
+
+ // Copy count so that we copy the state "count == 0" vs "count > 0".
+ result.AddReceiverCheck(cid, target, GetCountAt(0));
+ return result.raw();
+}
+
+
RawICData* ICData::AsUnaryClassChecksForArgNr(intptr_t arg_nr) const {
ASSERT(!IsNull());
ASSERT(NumArgsTested() > arg_nr);
@@ -11740,12 +11752,7 @@ RawICData* ICData::AsUnaryClassChecksForArgNr(intptr_t arg_nr) const {
return raw();
}
const intptr_t kNumArgsTested = 1;
- ICData& result = ICData::Handle(ICData::New(
- Function::Handle(owner()),
- String::Handle(target_name()),
- Array::Handle(arguments_descriptor()),
- deopt_id(),
- kNumArgsTested));
+ ICData& result = ICData::Handle(ICData::NewFrom(*this, kNumArgsTested));
const intptr_t len = NumberOfChecks();
for (intptr_t i = 0; i < len; i++) {
const intptr_t class_id = GetClassIdAt(i, arg_nr);
@@ -11773,8 +11780,6 @@ RawICData* ICData::AsUnaryClassChecksForArgNr(intptr_t arg_nr) const {
count);
}
}
- // Copy deoptimization reasons.
- result.SetDeoptReasons(DeoptReasons());
return result.raw();
}
@@ -11897,6 +11902,19 @@ RawICData* ICData::New(const Function& owner,
}
+RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) {
+ const ICData& result = ICData::Handle(ICData::New(
+ Function::Handle(from.owner()),
+ String::Handle(from.target_name()),
+ Array::Handle(from.arguments_descriptor()),
+ from.deopt_id(),
+ num_args_tested));
+ // Copy deoptimization reasons.
+ result.SetDeoptReasons(from.DeoptReasons());
+ return result.raw();
+}
+
+
void ICData::PrintJSONImpl(JSONStream* stream, bool ref) const {
Object::PrintJSONImpl(stream, ref);
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/regexp_assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698