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

Unified Diff: runtime/vm/raw_object.cc

Issue 2463083002: Remove default monomorphic check code from functions and stubs that do not need it. (Closed)
Patch Set: address comment 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
Index: runtime/vm/raw_object.cc
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index d777f68b57d2426a166f82c5b06bb458f8640c1c..dea8f2d4ea32a9cba534af127d550f20381472cf 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 = raw_instructions->ptr()->size_;
+ intptr_t instructions_size = abs(raw_instructions->ptr()->size_);
instance_size = Instructions::InstanceSize(instructions_size);
break;
}
@@ -574,14 +574,14 @@ intptr_t RawObjectPool::VisitObjectPoolPointers(
intptr_t RawInstructions::VisitInstructionsPointers(
RawInstructions* raw_obj, ObjectPointerVisitor* visitor) {
RawInstructions* obj = raw_obj->ptr();
- return Instructions::InstanceSize(obj->size_);
+ return Instructions::InstanceSize(abs(obj->size_));
}
bool RawInstructions::ContainsPC(RawInstructions* raw_instr, uword pc) {
uword start_pc =
reinterpret_cast<uword>(raw_instr->ptr()) + Instructions::HeaderSize();
- uword end_pc = start_pc + raw_instr->ptr()->size_;
+ uword end_pc = start_pc + abs(raw_instr->ptr()->size_);
ASSERT(end_pc > start_pc);
return (pc >= start_pc) && (pc < end_pc);
}

Powered by Google App Engine
This is Rietveld 408576698