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

Unified Diff: runtime/vm/object.h

Issue 182703003: Cleanup native, collected, and stub code handling in profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index faf01cc65881fe6f86a4146bace35aba588d06a1..ac24661530a990e433632379eaa01e07ef007383 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -3275,12 +3275,38 @@ class Code : public Object {
StorePointer(&raw_ptr()->exception_handlers_, handlers.raw());
}
+ bool OwnerIsFunction() const {
+ return raw_ptr()->owner_->IsHeapObject();
+ }
+
+ bool OwnerIsNotNullFunction() const {
+ return (raw_ptr()->owner_->IsHeapObject()) &&
+ (raw_ptr()->owner_ != Function::null());
+ }
+
+ bool OwnerIsAllocationStub() const {
+ return !raw_ptr()->owner_->IsHeapObject();
+ }
+
RawFunction* function() const {
- return raw_ptr()->function_;
+ ASSERT(OwnerIsFunction());
+ return reinterpret_cast<RawFunction*>(raw_ptr()->owner_);
+ }
+
+ RawSmi* allocation_stub_class_id() const {
+ ASSERT(OwnerIsAllocationStub());
+ return reinterpret_cast<RawSmi*>(raw_ptr()->owner_);
}
- void set_function(const Function& function) const {
+
+ void set_owner_function(const Function& function) const {
turnidge 2014/02/28 19:23:37 Consider camel-case for this function and the one
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 +3331,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);
@@ -3383,6 +3410,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 +4965,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)

Powered by Google App Engine
This is Rietveld 408576698