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

Unified Diff: runtime/vm/object.cc

Issue 2064693003: Remember inside an ICData if it is for a static call or an instance call (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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/object_reload.cc » ('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 346ddfdb0d5968f3871bc2ffe6cdf9f143cf5aa8..0c0415f55bd956e4b7e42d7c4f240e89ef42ce50 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -12570,6 +12570,17 @@ void ICData::AddDeoptReason(DeoptReasonId reason) const {
}
+void ICData::SetIsStaticCall(bool static_call) const {
+ StoreNonPointer(&raw_ptr()->state_bits_,
+ StaticCallBit::update(static_call, raw_ptr()->state_bits_));
+}
+
+
+bool ICData::is_static_call() const {
+ return StaticCallBit::decode(raw_ptr()->state_bits_);
+}
+
+
void ICData::set_state_bits(uint32_t bits) const {
StoreNonPointer(&raw_ptr()->state_bits_, bits);
}
@@ -13382,7 +13393,8 @@ RawICData* ICData::NewDescriptor(Zone* zone,
const String& target_name,
const Array& arguments_descriptor,
intptr_t deopt_id,
- intptr_t num_args_tested) {
+ intptr_t num_args_tested,
+ bool is_static_call) {
ASSERT(!owner.IsNull());
ASSERT(!target_name.IsNull());
ASSERT(!arguments_descriptor.IsNull());
@@ -13405,6 +13417,7 @@ RawICData* ICData::NewDescriptor(Zone* zone,
#if defined(TAG_IC_DATA)
result.set_tag(-1);
#endif
+ result.SetIsStaticCall(is_static_call);
result.SetNumArgsTested(num_args_tested);
return result.raw();
}
@@ -13449,7 +13462,8 @@ RawICData* ICData::New(const Function& owner,
const String& target_name,
const Array& arguments_descriptor,
intptr_t deopt_id,
- intptr_t num_args_tested) {
+ intptr_t num_args_tested,
+ bool is_static_call) {
Zone* zone = Thread::Current()->zone();
const ICData& result = ICData::Handle(zone,
NewDescriptor(zone,
@@ -13457,7 +13471,8 @@ RawICData* ICData::New(const Function& owner,
target_name,
arguments_descriptor,
deopt_id,
- num_args_tested));
+ num_args_tested,
+ is_static_call));
result.set_ic_data_array(
Array::Handle(zone, NewEmptyICDataArray(num_args_tested)));
return result.raw();
@@ -13470,7 +13485,8 @@ RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) {
String::Handle(from.target_name()),
Array::Handle(from.arguments_descriptor()),
from.deopt_id(),
- num_args_tested));
+ num_args_tested,
+ from.is_static_call()));
// Copy deoptimization reasons.
result.SetDeoptReasons(from.DeoptReasons());
return result.raw();
@@ -13485,7 +13501,8 @@ RawICData* ICData::Clone(const ICData& from) {
String::Handle(zone, from.target_name()),
Array::Handle(zone, from.arguments_descriptor()),
from.deopt_id(),
- from.NumArgsTested()));
+ from.NumArgsTested(),
+ from.is_static_call()));
// Clone entry array.
const Array& from_array = Array::Handle(zone, from.ic_data());
const intptr_t len = from_array.Length();
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_reload.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698