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

Unified Diff: runtime/vm/object.h

Issue 1925153003: Undo "Don't include an object header for instructions in the text section." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 902ea91ed2b0515e3ffa8464f4976bc26a5b3e70..91da8468e579082b43f01a5a4b60889ee0907e7e 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -3961,7 +3961,8 @@ class Instructions : public Object {
FINAL_HEAP_OBJECT_IMPLEMENTATION(Instructions, Object);
friend class Class;
friend class Code;
- friend class InstructionsWriter;
+ friend class AssemblyInstructionsWriter;
+ friend class BlobInstructionsWriter;
};
@@ -4374,7 +4375,9 @@ class DeoptInfo : public AllStatic {
class Code : public Object {
public:
- uword active_entry_point() const { return raw_ptr()->entry_point_; }
+ RawInstructions* active_instructions() const {
+ return raw_ptr()->active_instructions_;
+ }
RawInstructions* instructions() const { return raw_ptr()->instructions_; }
@@ -4404,15 +4407,20 @@ class Code : public Object {
}
void set_is_alive(bool value) const;
- uword EntryPoint() const;
- intptr_t Size() const;
-
+ uword EntryPoint() const {
+ return Instructions::Handle(instructions()).EntryPoint();
+ }
+ intptr_t Size() const {
+ const Instructions& instr = Instructions::Handle(instructions());
+ return instr.size();
+ }
RawObjectPool* GetObjectPool() const {
return object_pool();
}
bool ContainsInstructionAt(uword addr) const {
- const uword offset = addr - EntryPoint();
- return offset < static_cast<uword>(Size());
+ const Instructions& instr = Instructions::Handle(instructions());
+ const uword offset = addr - instr.EntryPoint();
+ return offset < static_cast<uword>(instr.size());
}
// Returns true if there is a debugger breakpoint set in this code object.
@@ -4651,11 +4659,12 @@ class Code : public Object {
void Enable() const {
if (!IsDisabled()) return;
ASSERT(Thread::Current()->IsMutatorThread());
+ ASSERT(instructions() != active_instructions());
SetActiveInstructions(instructions());
}
bool IsDisabled() const {
- return active_entry_point() != EntryPoint();
+ return instructions() != active_instructions();
}
private:
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698