| 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);
|
| };
|
|
|
|
|