| Index: src/top.cc
|
| ===================================================================
|
| --- src/top.cc (revision 7511)
|
| +++ src/top.cc (working copy)
|
| @@ -29,6 +29,7 @@
|
|
|
| #include "api.h"
|
| #include "bootstrapper.h"
|
| +#include "compiler.h"
|
| #include "debug.h"
|
| #include "execution.h"
|
| #include "messages.h"
|
| @@ -37,6 +38,7 @@
|
| #include "string-stream.h"
|
| #include "vm-state-inl.h"
|
|
|
| +
|
| // TODO(isolates): move to isolate.cc. This stuff is kept here to
|
| // simplify merging.
|
|
|
| @@ -89,13 +91,13 @@
|
|
|
|
|
| void Isolate::IterateThread(ThreadVisitor* v) {
|
| - v->VisitThread(thread_local_top());
|
| + v->VisitThread(this, thread_local_top());
|
| }
|
|
|
|
|
| void Isolate::IterateThread(ThreadVisitor* v, char* t) {
|
| ThreadLocalTop* thread = reinterpret_cast<ThreadLocalTop*>(t);
|
| - v->VisitThread(thread);
|
| + v->VisitThread(this, thread);
|
| }
|
|
|
|
|
| @@ -125,7 +127,7 @@
|
| }
|
|
|
| // Iterate over pointers on native execution stack.
|
| - for (StackFrameIterator it(thread); !it.done(); it.Advance()) {
|
| + for (StackFrameIterator it(this, thread); !it.done(); it.Advance()) {
|
| it.frame()->Iterate(v);
|
| }
|
| }
|
| @@ -204,12 +206,13 @@
|
| Handle<String> constructor_key =
|
| factory()->LookupAsciiSymbol("isConstructor");
|
|
|
| - StackTraceFrameIterator it;
|
| + StackTraceFrameIterator it(this);
|
| int frames_seen = 0;
|
| while (!it.done() && (frames_seen < limit)) {
|
| JavaScriptFrame* frame = it.frame();
|
| -
|
| - List<FrameSummary> frames(3); // Max 2 levels of inlining.
|
| + // Set initial size to the maximum inlining level + 1 for the outermost
|
| + // function.
|
| + List<FrameSummary> frames(Compiler::kMaxInliningLevels + 1);
|
| frame->Summarize(&frames);
|
| for (int i = frames.length() - 1; i >= 0 && frames_seen < limit; i--) {
|
| // Create a JSObject to hold the information for the StackFrame.
|
| @@ -584,12 +587,12 @@
|
|
|
|
|
| void Isolate::PrintCurrentStackTrace(FILE* out) {
|
| - StackTraceFrameIterator it;
|
| + StackTraceFrameIterator it(this);
|
| while (!it.done()) {
|
| HandleScope scope;
|
| // Find code position if recorded in relocation info.
|
| JavaScriptFrame* frame = it.frame();
|
| - int pos = frame->LookupCode(this)->SourcePosition(frame->pc());
|
| + int pos = frame->LookupCode()->SourcePosition(frame->pc());
|
| Handle<Object> pos_obj(Smi::FromInt(pos));
|
| // Fetch function and receiver.
|
| Handle<JSFunction> fun(JSFunction::cast(frame->function()));
|
| @@ -613,14 +616,14 @@
|
|
|
| void Isolate::ComputeLocation(MessageLocation* target) {
|
| *target = MessageLocation(Handle<Script>(heap_.empty_script()), -1, -1);
|
| - StackTraceFrameIterator it;
|
| + StackTraceFrameIterator it(this);
|
| if (!it.done()) {
|
| JavaScriptFrame* frame = it.frame();
|
| JSFunction* fun = JSFunction::cast(frame->function());
|
| Object* script = fun->shared()->script();
|
| if (script->IsScript() &&
|
| !(Script::cast(script)->source()->IsUndefined())) {
|
| - int pos = frame->LookupCode(this)->SourcePosition(frame->pc());
|
| + int pos = frame->LookupCode()->SourcePosition(frame->pc());
|
| // Compute the location from the function and the reloc info.
|
| Handle<Script> casted_script(Script::cast(script));
|
| *target = MessageLocation(casted_script, pos, pos + 1);
|
|
|