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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10378093: Adding collected type feedback to the IL nodes (only in optimized mode). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/compiler.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 7505)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -70,11 +70,17 @@
public:
static const int kNoCid = -1;
- Computation() : cid_(GetNextCid()) { }
+ Computation() : cid_(-1), ic_data_(NULL) {
+ Isolate* isolate = Isolate::Current();
+ cid_ = GetNextCid(isolate);
+ ic_data_ = GetICDataForCid(cid_, isolate);
+ }
// Unique computation/instruction id, used for deoptimization.
intptr_t cid() const { return cid_; }
+ const ICData* ic_data() const { return ic_data_; }
+
// Visiting support.
virtual void Accept(FlowGraphVisitor* visitor) = 0;
@@ -82,14 +88,26 @@
private:
friend class Instruction;
- static intptr_t GetNextCid() {
- Isolate* isolate = Isolate::Current();
+ static intptr_t GetNextCid(Isolate* isolate) {
intptr_t tmp = isolate->computation_id();
isolate->set_computation_id(tmp + 1);
return tmp;
}
+ static ICData* GetICDataForCid(intptr_t cid, Isolate* isolate) {
+ if (isolate->ic_data_array() == Array::null()) {
+ return NULL;
+ } else {
+ const Array& array_handle = Array::Handle(isolate->ic_data_array());
+ ICData& ic_data_handle = ICData::ZoneHandle();
+ if (cid < array_handle.Length()) {
+ ic_data_handle ^= array_handle.At(cid);
+ }
+ return &ic_data_handle;
+ }
+ }
- const intptr_t cid_;
+ intptr_t cid_;
+ ICData* ic_data_;
DISALLOW_COPY_AND_ASSIGN(Computation);
};
@@ -1138,12 +1156,18 @@
class Instruction : public ZoneAllocated {
public:
- Instruction() : cid_(Computation::GetNextCid()) { }
+ Instruction() : cid_(-1), ic_data_(NULL) {
+ Isolate* isolate = Isolate::Current();
+ cid_ = Computation::GetNextCid(isolate);
+ ic_data_ = Computation::GetICDataForCid(cid_, isolate);
+ }
// Unique computation/instruction id, used for deoptimization, e.g. for
// ReturnInstr, ThrowInstr and ReThrowInstr.
intptr_t cid() const { return cid_; }
+ const ICData* ic_data() const { return ic_data_; }
+
virtual bool IsBlockEntry() const { return false; }
BlockEntryInstr* AsBlockEntry() {
return IsBlockEntry() ? reinterpret_cast<BlockEntryInstr*>(this) : NULL;
@@ -1188,7 +1212,8 @@
#undef INSTRUCTION_TYPE_CHECK
private:
- const intptr_t cid_;
+ intptr_t cid_;
+ ICData* ic_data_;
DISALLOW_COPY_AND_ASSIGN(Instruction);
};
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698