Chromium Code Reviews| Index: runtime/vm/object.h |
| diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
| index faf01cc65881fe6f86a4146bace35aba588d06a1..1b31a29e3c227ba21ccaa1d1887b9ce0a78cff3e 100644 |
| --- a/runtime/vm/object.h |
| +++ b/runtime/vm/object.h |
| @@ -3275,12 +3275,37 @@ class Code : public Object { |
| StorePointer(&raw_ptr()->exception_handlers_, handlers.raw()); |
| } |
| + bool OwnerIsFunction() const { |
|
Ivan Posva
2014/02/28 21:46:35
IsFunction, IsStub, IsAllocationStub
Cutch
2014/02/28 22:47:05
Done.
|
| + return raw_ptr()->owner_->IsHeapObject(); |
| + } |
| + |
| + bool OwnerIsAllocationStub() const { |
| + return !raw_ptr()->owner_->IsHeapObject(); |
| + } |
| + |
| + bool OwnerIsStub() const { |
| + return raw_ptr()->owner_ == Function::null(); |
| + } |
| + |
| RawFunction* function() const { |
| - return raw_ptr()->function_; |
| + ASSERT(OwnerIsFunction()); |
| + return reinterpret_cast<RawFunction*>(raw_ptr()->owner_); |
| } |
| - void set_function(const Function& function) const { |
| + |
| + RawSmi* allocation_stub_class_id() const { |
| + ASSERT(OwnerIsAllocationStub()); |
| + return reinterpret_cast<RawSmi*>(raw_ptr()->owner_); |
| + } |
| + |
| + void set_owner_function(const Function& function) const { |
| ASSERT(function.IsOld()); |
| - StorePointer(&raw_ptr()->function_, function.raw()); |
| + StorePointer(&raw_ptr()->owner_, |
| + reinterpret_cast<RawObject*>(function.raw())); |
| + } |
| + |
| + void set_owner_allocation_stub_class_id(RawSmi* cid) const { |
| + ASSERT(!cid->IsHeapObject()); |
| + raw_ptr()->owner_ = reinterpret_cast<RawObject*>(cid); |
| } |
| // We would have a VisitPointers function here to traverse all the |
| @@ -3305,6 +3330,7 @@ class Code : public Object { |
| Assembler* assembler, |
| bool optimized = false); |
| static RawCode* LookupCode(uword pc); |
| + static RawCode* LookupCodeInVmIsolate(uword pc); |
| int32_t GetPointerOffsetAt(int index) const { |
| return *PointerOffsetAddrAt(index); |
| @@ -3331,6 +3357,9 @@ class Code : public Object { |
| // Returns an array indexed by deopt id, containing the extracted ICData. |
| RawArray* ExtractTypeFeedbackArray() const; |
| + RawString* Name() const; |
| + RawString* UserName() const; |
| + |
| private: |
| void set_state_bits(intptr_t bits) const; |
| @@ -3383,6 +3412,7 @@ class Code : public Object { |
| } |
| intptr_t BinarySearchInSCallTable(uword pc) const; |
| + static RawCode* LookupCodeInIsolate(Isolate* isolate, uword pc); |
| // New is a private method as RawInstruction and RawCode objects should |
| // only be created using the Code::FinalizeCode method. This method creates |
| @@ -4937,6 +4967,7 @@ class String : public Instance { |
| ch_(0), |
| index_(-1), |
| end_(str.Length()) { |
| + ASSERT(!str_.IsNull()); |
| } |
| CodePointIterator(const String& str, intptr_t start, intptr_t length) |