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

Unified Diff: src/accessors.cc

Issue 2629113004: Revert of [runtime] Change JavaScriptFrame::GetFunctions interface. (Closed)
Patch Set: 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 | « no previous file | src/frames.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 4aacbcb165c40c9f06840550909ebeb963d53cae..085e00cd44e0320555d3c2d8e16b95b61d96e215 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -844,10 +844,10 @@
static int FindFunctionInFrame(JavaScriptFrame* frame,
Handle<JSFunction> function) {
DisallowHeapAllocation no_allocation;
- List<FrameSummary> frames(2);
- frame->Summarize(&frames);
- for (int i = frames.length() - 1; i >= 0; i--) {
- if (*frames[i].function() == *function) return i;
+ List<JSFunction*> functions(2);
+ frame->GetFunctions(&functions);
+ for (int i = functions.length() - 1; i >= 0; i--) {
+ if (functions[i] == *function) return i;
}
return -1;
}
@@ -951,16 +951,19 @@
class FrameFunctionIterator {
public:
FrameFunctionIterator(Isolate* isolate, const DisallowHeapAllocation& promise)
- : isolate_(isolate), frame_iterator_(isolate), frames_(2), index_(0) {
- GetFrames();
+ : isolate_(isolate),
+ frame_iterator_(isolate),
+ functions_(2),
+ index_(0) {
+ GetFunctions();
}
JSFunction* next() {
while (true) {
- if (frames_.length() == 0) return NULL;
- JSFunction* next_function = *frames_[index_].function();
+ if (functions_.length() == 0) return NULL;
+ JSFunction* next_function = functions_[index_];
index_--;
if (index_ < 0) {
- GetFrames();
+ GetFunctions();
}
// Skip functions from other origins.
if (!AllowAccessToFunction(isolate_->context(), next_function)) continue;
@@ -981,18 +984,18 @@
}
private:
- void GetFrames() {
- frames_.Rewind(0);
+ void GetFunctions() {
+ functions_.Rewind(0);
if (frame_iterator_.done()) return;
JavaScriptFrame* frame = frame_iterator_.frame();
- frame->Summarize(&frames_);
- DCHECK(frames_.length() > 0);
+ frame->GetFunctions(&functions_);
+ DCHECK(functions_.length() > 0);
frame_iterator_.Advance();
- index_ = frames_.length() - 1;
+ index_ = functions_.length() - 1;
}
Isolate* isolate_;
JavaScriptFrameIterator frame_iterator_;
- List<FrameSummary> frames_;
+ List<JSFunction*> functions_;
int index_;
};
« no previous file with comments | « no previous file | src/frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698