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

Unified Diff: runtime/vm/raw_object.cc

Issue 2490363002: Clean up encoding of size and single entry flag in Instructions. (Closed)
Patch Set: Created 4 years, 1 month 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.h ('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/raw_object.cc
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index b731a90f9505b9d64c0b402cfd1d4f951c7656d0..bfe850aacb0d812c5e4ae03c4ed217fd4911019b 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -68,7 +68,7 @@ intptr_t RawObject::SizeFromClass() const {
case kInstructionsCid: {
const RawInstructions* raw_instructions =
reinterpret_cast<const RawInstructions*>(this);
- intptr_t instructions_size = abs(raw_instructions->ptr()->size_);
+ intptr_t instructions_size = Instructions::Size(raw_instructions);
instance_size = Instructions::InstanceSize(instructions_size);
break;
}
@@ -580,15 +580,14 @@ intptr_t RawObjectPool::VisitObjectPoolPointers(RawObjectPool* raw_obj,
intptr_t RawInstructions::VisitInstructionsPointers(
RawInstructions* raw_obj,
ObjectPointerVisitor* visitor) {
- RawInstructions* obj = raw_obj->ptr();
- return Instructions::InstanceSize(abs(obj->size_));
+ return Instructions::InstanceSize(Instructions::Size(raw_obj));
}
bool RawInstructions::ContainsPC(RawInstructions* raw_instr, uword pc) {
uword start_pc =
reinterpret_cast<uword>(raw_instr->ptr()) + Instructions::HeaderSize();
- uword end_pc = start_pc + abs(raw_instr->ptr()->size_);
+ uword end_pc = start_pc + Instructions::Size(raw_instr);
ASSERT(end_pc > start_pc);
return (pc >= start_pc) && (pc < end_pc);
}
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698