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

Unified Diff: runtime/vm/object.cc

Issue 2044423003: 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 5003e7e1123010340703167e50e3252ce2356933..3c61ec52a20d609a18c4e9b68363ca44f9014325 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -12558,6 +12558,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);
}
@@ -13370,7 +13381,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());
@@ -13393,6 +13405,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();
}
@@ -13437,7 +13450,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,
@@ -13445,7 +13459,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();
@@ -13458,7 +13473,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();
@@ -13473,7 +13489,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