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

Unified Diff: src/frames.cc

Issue 1148007: Merge bleeding_edge from version 2.1.3 up to revision 4205... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 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
« no previous file with comments | « src/frame-element.h ('k') | src/globals.h » ('j') | src/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
===================================================================
--- src/frames.cc (revision 4205)
+++ src/frames.cc (working copy)
@@ -306,14 +306,12 @@
void StackHandler::Cook(Code* code) {
- ASSERT(MarkCompactCollector::IsCompacting());
ASSERT(code->contains(pc()));
set_pc(AddressFrom<Address>(pc() - code->instruction_start()));
}
void StackHandler::Uncook(Code* code) {
- ASSERT(MarkCompactCollector::HasCompacted());
set_pc(code->instruction_start() + OffsetFrom(pc()));
ASSERT(code->contains(pc()));
}
@@ -329,9 +327,6 @@
void StackFrame::CookFramesForThread(ThreadLocalTop* thread) {
- // Only cooking frames when the collector is compacting and thus moving code
- // around.
- ASSERT(MarkCompactCollector::IsCompacting());
ASSERT(!thread->stack_is_cooked());
for (StackFrameIterator it(thread); !it.done(); it.Advance()) {
it.frame()->Cook();
@@ -341,9 +336,6 @@
void StackFrame::UncookFramesForThread(ThreadLocalTop* thread) {
- // Only uncooking frames when the collector is compacting and thus moving code
- // around.
- ASSERT(MarkCompactCollector::HasCompacted());
ASSERT(thread->stack_is_cooked());
for (StackFrameIterator it(thread); !it.done(); it.Advance()) {
it.frame()->Uncook();
@@ -522,6 +514,31 @@
Code* code = NULL;
if (IsConstructor()) accumulator->Add("new ");
accumulator->PrintFunction(function, receiver, &code);
+
+ if (function->IsJSFunction()) {
+ Handle<SharedFunctionInfo> shared(JSFunction::cast(function)->shared());
+ Object* script_obj = shared->script();
+ if (script_obj->IsScript()) {
+ Handle<Script> script(Script::cast(script_obj));
+ accumulator->Add(" [");
+ accumulator->PrintName(script->name());
+
+ Address pc = this->pc();
+ if (code != NULL && code->kind() == Code::FUNCTION &&
+ pc >= code->instruction_start() && pc < code->relocation_start()) {
+ int source_pos = code->SourcePosition(pc);
+ int line = GetScriptLineNumberSafe(script, source_pos) + 1;
+ accumulator->Add(":%d", line);
+ } else {
+ int function_start_pos = shared->start_position();
+ int line = GetScriptLineNumberSafe(script, function_start_pos) + 1;
+ accumulator->Add(":~%d", line);
+ }
+
+ accumulator->Add("] ");
+ }
+ }
+
accumulator->Add("(this=%o", receiver);
// Get scope information for nicer output, if possible. If code is
« no previous file with comments | « src/frame-element.h ('k') | src/globals.h » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698