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

Unified Diff: src/compiler/frame.h

Issue 1696043002: [runtime] Unify and simplify how frames are marked (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge problems 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
Index: src/compiler/frame.h
diff --git a/src/compiler/frame.h b/src/compiler/frame.h
index 011a0f02d5820e07c2064e528bbc0b2d1d8651c1..4c4c2409b46271e9ce9e605c862c77942487a3c9 100644
--- a/src/compiler/frame.h
+++ b/src/compiler/frame.h
@@ -59,9 +59,9 @@ class CallDescriptor;
// |- - - - - - - - -| | |
// 1 | saved frame ptr | Fixed |
// |- - - - - - - - -| Header <-- frame ptr |
-// 2 | Context | | |
+// 2 |Context/Frm. Type| | |
// |- - - - - - - - -| | |
-// 3 |JSFunction/Marker| v |
+// 3 | [JSFunction] | v |
// +-----------------+---- |
// 4 | spill 1 | ^ Callee
// |- - - - - - - - -| | frame slots
@@ -115,11 +115,14 @@ class Frame : public ZoneObject {
return !allocated_double_registers_->IsEmpty();
}
- int AlignSavedCalleeRegisterSlots() {
+ int AlignSavedCalleeRegisterSlots(int alignment = kDoubleSize) {
DCHECK_EQ(0, callee_saved_slot_count_);
- needs_frame_ = true;
- int delta = frame_slot_count_ & 1;
- frame_slot_count_ += delta;
+ int alignment_slots = alignment / kPointerSize;
+ int delta = alignment_slots - (frame_slot_count_ & (alignment_slots - 1));
+ if (delta != alignment_slots) {
+ DCHECK(needs_frame_);
+ frame_slot_count_ += delta;
+ }
return delta;
}
@@ -138,6 +141,8 @@ class Frame : public ZoneObject {
return slot;
}
+ int AlignFrame(int alignment = kDoubleSize);
+
int ReserveSpillSlots(size_t slot_count) {
DCHECK_EQ(0, callee_saved_slot_count_);
DCHECK_EQ(0, spill_slot_count_);

Powered by Google App Engine
This is Rietveld 408576698