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

Unified Diff: runtime/vm/object.h

Issue 1808553002: Precompilation: 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, 9 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 1b168bf6ad9c95594c6422951c96165fbaccc428..fd61123bdf8542b3af1f9bc60564fe27161ae9ce 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -3858,7 +3858,10 @@ class Instructions : public Object {
intptr_t size() const { return raw_ptr()->size_; } // Excludes HeaderSize().
uword EntryPoint() const {
- return reinterpret_cast<uword>(raw_ptr()) + HeaderSize();
+ return EntryPoint(raw());
+ }
+ static uword EntryPoint(RawInstructions* instr) {
+ return reinterpret_cast<uword>(instr->ptr()) + HeaderSize();
}
static const intptr_t kMaxElements = (kMaxInt32 -
@@ -4325,9 +4328,7 @@ class DeoptInfo : public AllStatic {
class Code : public Object {
public:
- RawInstructions* active_instructions() const {
- return raw_ptr()->active_instructions_;
- }
+ uword active_entry_point() const { return raw_ptr()->entry_point_; }
RawInstructions* instructions() const { return raw_ptr()->instructions_; }
@@ -4357,20 +4358,15 @@ class Code : public Object {
}
void set_is_alive(bool value) const;
- uword EntryPoint() const {
- return Instructions::Handle(instructions()).EntryPoint();
- }
- intptr_t Size() const {
- const Instructions& instr = Instructions::Handle(instructions());
- return instr.size();
- }
+ uword EntryPoint() const;
+ intptr_t Size() const;
+
RawObjectPool* GetObjectPool() const {
return object_pool();
}
bool ContainsInstructionAt(uword addr) const {
- const Instructions& instr = Instructions::Handle(instructions());
- const uword offset = addr - instr.EntryPoint();
- return offset < static_cast<uword>(instr.size());
+ const uword offset = addr - EntryPoint();
+ return offset < static_cast<uword>(Size());
}
// Returns true if there is a debugger breakpoint set in this code object.
@@ -4609,12 +4605,11 @@ class Code : public Object {
void Enable() const {
if (!IsDisabled()) return;
ASSERT(Thread::Current()->IsMutatorThread());
- ASSERT(instructions() != active_instructions());
SetActiveInstructions(instructions());
}
bool IsDisabled() const {
- return instructions() != active_instructions();
+ return active_entry_point() != EntryPoint();
}
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