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

Unified Diff: runtime/vm/snapshot.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/raw_object_snapshot.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.h
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index 7f6436b8b841a71a13821d789f910f08603f75a7..25dab12a4fd17212286ac1b44d88f306439f1f18 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -370,7 +370,7 @@ class InstructionsReader : public ZoneAllocated {
OS::PreferredCodeAlignment()));
}
- RawInstructions* GetInstructionsAt(int32_t offset, uword expected_tags);
+ uword GetInstructionsAt(int32_t offset);
RawObject* GetObjectAt(int32_t offset);
private:
@@ -483,8 +483,8 @@ class SnapshotReader : public BaseReader {
RawWeakProperty* NewWeakProperty();
RawRegExp* NewRegExp();
- RawInstructions* GetInstructionsAt(int32_t offset, uword expected_tags) {
- return instructions_reader_->GetInstructionsAt(offset, expected_tags);
+ uword GetInstructionsAt(int32_t offset) {
+ return instructions_reader_->GetInstructionsAt(offset);
}
RawObject* GetObjectAt(int32_t offset) {
@@ -862,26 +862,18 @@ class InstructionsWriter : public ZoneAllocated {
intptr_t binary_size() { return binary_size_; }
- int32_t GetOffsetFor(RawInstructions* instructions);
+ int32_t GetOffsetFor(RawInstructions* instructions, RawCode* code);
int32_t GetObjectOffsetFor(RawObject* raw_object);
- void SetInstructionsCode(RawInstructions* insns, RawCode* code) {
- for (intptr_t i = 0; i < instructions_.length(); i++) {
- if (instructions_[i].raw_insns_ == insns) {
- instructions_[i].raw_code_ = code;
- return;
- }
- }
- UNREACHABLE();
- }
-
void WriteAssembly();
private:
struct InstructionsData {
- explicit InstructionsData(RawInstructions* insns)
- : raw_insns_(insns), raw_code_(NULL) { }
+ explicit InstructionsData(RawInstructions* insns,
+ RawCode* code,
+ intptr_t offset)
+ : raw_insns_(insns), raw_code_(code), offset_(offset) { }
union {
RawInstructions* raw_insns_;
@@ -891,6 +883,7 @@ class InstructionsWriter : public ZoneAllocated {
RawCode* raw_code_;
const Code* code_;
};
+ intptr_t offset_;
};
struct ObjectData {
@@ -970,18 +963,14 @@ class SnapshotWriter : public BaseWriter {
static intptr_t FirstObjectId();
- int32_t GetInstructionsId(RawInstructions* instructions) {
- return instructions_writer_->GetOffsetFor(instructions);
+ int32_t GetInstructionsId(RawInstructions* instructions, RawCode* code) {
+ return instructions_writer_->GetOffsetFor(instructions, code);
}
int32_t GetObjectId(RawObject* raw) {
return instructions_writer_->GetObjectOffsetFor(raw);
}
- void SetInstructionsCode(RawInstructions* instructions, RawCode* code) {
- return instructions_writer_->SetInstructionsCode(instructions, code);
- }
-
void WriteFunctionId(RawFunction* func, bool owner_is_class);
RawFunction* IsSerializableClosure(RawClosure* closure);
@@ -1048,6 +1037,7 @@ class SnapshotWriter : public BaseWriter {
friend class RawArray;
friend class RawClass;
friend class RawClosureData;
+ friend class RawCode;
friend class RawContextScope;
friend class RawExceptionHandlers;
friend class RawField;
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698