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

Unified Diff: src/frames.cc

Issue 2647433002: Clarify the order of frame summaries and rename getters (Closed)
Patch Set: Fix bug Created 3 years, 11 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 | « src/frames.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index 45d26a161abe8b9f53a52af976f830b2cc7a2d95..5c561e6e7b4cb4d853336874a091933d05ed3253 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1263,12 +1263,15 @@ FrameSummary::~FrameSummary() {
#undef FRAME_SUMMARY_DESTR
}
-FrameSummary FrameSummary::Get(const StandardFrame* frame, int index) {
- DCHECK_LE(0, index);
+FrameSummary FrameSummary::GetTop(const StandardFrame* frame) {
List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
frame->Summarize(&frames);
- DCHECK_GT(frames.length(), index);
- return frames[index];
+ DCHECK_LT(0, frames.length());
+ return frames.last();
+}
+
+FrameSummary FrameSummary::GetBottom(const StandardFrame* frame) {
+ return Get(frame, 0);
}
FrameSummary FrameSummary::GetSingle(const StandardFrame* frame) {
@@ -1278,6 +1281,14 @@ FrameSummary FrameSummary::GetSingle(const StandardFrame* frame) {
return frames.first();
}
+FrameSummary FrameSummary::Get(const StandardFrame* frame, int index) {
+ DCHECK_LE(0, index);
+ List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
+ frame->Summarize(&frames);
+ DCHECK_GT(frames.length(), index);
+ return frames[index];
+}
+
#define FRAME_SUMMARY_DISPATCH(ret, name) \
ret FrameSummary::name() const { \
switch (base_.kind()) { \
@@ -1781,7 +1792,7 @@ Script* WasmInterpreterEntryFrame::script() const {
}
int WasmInterpreterEntryFrame::position() const {
- return FrameSummary::GetFirst(this).AsWasmInterpreted().SourcePosition();
+ return FrameSummary::GetBottom(this).AsWasmInterpreted().SourcePosition();
}
Address WasmInterpreterEntryFrame::GetCallerStackPointer() const {
« no previous file with comments | « src/frames.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698