| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 return break_frame_id_; | 326 return break_frame_id_; |
| 327 } | 327 } |
| 328 | 328 |
| 329 | 329 |
| 330 int Top::break_id() { | 330 int Top::break_id() { |
| 331 ExecutionAccess access; | 331 ExecutionAccess access; |
| 332 return break_id_; | 332 return break_id_; |
| 333 } | 333 } |
| 334 | 334 |
| 335 | 335 |
| 336 void Top::MarkCompactPrologue() { | 336 void Top::MarkCompactPrologue(bool is_compacting) { |
| 337 MarkCompactPrologue(&thread_local_); | 337 MarkCompactPrologue(is_compacting, &thread_local_); |
| 338 } | 338 } |
| 339 | 339 |
| 340 | 340 |
| 341 void Top::MarkCompactPrologue(char* data) { | 341 void Top::MarkCompactPrologue(bool is_compacting, char* data) { |
| 342 MarkCompactPrologue(reinterpret_cast<ThreadLocalTop*>(data)); | 342 MarkCompactPrologue(is_compacting, reinterpret_cast<ThreadLocalTop*>(data)); |
| 343 } | 343 } |
| 344 | 344 |
| 345 | 345 |
| 346 void Top::MarkCompactPrologue(ThreadLocalTop* thread) { | 346 void Top::MarkCompactPrologue(bool is_compacting, ThreadLocalTop* thread) { |
| 347 StackFrame::CookFramesForThread(thread); | 347 if (is_compacting) { |
| 348 StackFrame::CookFramesForThread(thread); |
| 349 } |
| 348 } | 350 } |
| 349 | 351 |
| 350 | 352 |
| 351 void Top::MarkCompactEpilogue(char* data) { | 353 void Top::MarkCompactEpilogue(bool is_compacting, char* data) { |
| 352 MarkCompactEpilogue(reinterpret_cast<ThreadLocalTop*>(data)); | 354 MarkCompactEpilogue(is_compacting, reinterpret_cast<ThreadLocalTop*>(data)); |
| 353 } | 355 } |
| 354 | 356 |
| 355 | 357 |
| 356 void Top::MarkCompactEpilogue() { | 358 void Top::MarkCompactEpilogue(bool is_compacting) { |
| 357 MarkCompactEpilogue(&thread_local_); | 359 MarkCompactEpilogue(is_compacting, &thread_local_); |
| 358 } | 360 } |
| 359 | 361 |
| 360 | 362 |
| 361 void Top::MarkCompactEpilogue(ThreadLocalTop* thread) { | 363 void Top::MarkCompactEpilogue(bool is_compacting, ThreadLocalTop* thread) { |
| 362 StackFrame::UncookFramesForThread(thread); | 364 if (is_compacting) { |
| 365 StackFrame::UncookFramesForThread(thread); |
| 366 } |
| 363 } | 367 } |
| 364 | 368 |
| 365 | 369 |
| 366 static int stack_trace_nesting_level = 0; | 370 static int stack_trace_nesting_level = 0; |
| 367 static StringStream* incomplete_message = NULL; | 371 static StringStream* incomplete_message = NULL; |
| 368 | 372 |
| 369 | 373 |
| 370 Handle<String> Top::StackTrace() { | 374 Handle<String> Top::StackTrace() { |
| 371 if (stack_trace_nesting_level == 0) { | 375 if (stack_trace_nesting_level == 0) { |
| 372 stack_trace_nesting_level++; | 376 stack_trace_nesting_level++; |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 } | 687 } |
| 684 }; | 688 }; |
| 685 | 689 |
| 686 | 690 |
| 687 void Top::PrintCurrentStackTrace(FILE* out) { | 691 void Top::PrintCurrentStackTrace(FILE* out) { |
| 688 StackTraceFrameIterator it; | 692 StackTraceFrameIterator it; |
| 689 while (!it.done()) { | 693 while (!it.done()) { |
| 690 HandleScope scope; | 694 HandleScope scope; |
| 691 // Find code position if recorded in relocation info. | 695 // Find code position if recorded in relocation info. |
| 692 JavaScriptFrame* frame = it.frame(); | 696 JavaScriptFrame* frame = it.frame(); |
| 693 int pos = frame->FindCode()->SourcePosition(frame->pc()); | 697 int pos = frame->code()->SourcePosition(frame->pc()); |
| 694 Handle<Object> pos_obj(Smi::FromInt(pos)); | 698 Handle<Object> pos_obj(Smi::FromInt(pos)); |
| 695 // Fetch function and receiver. | 699 // Fetch function and receiver. |
| 696 Handle<JSFunction> fun(JSFunction::cast(frame->function())); | 700 Handle<JSFunction> fun(JSFunction::cast(frame->function())); |
| 697 Handle<Object> recv(frame->receiver()); | 701 Handle<Object> recv(frame->receiver()); |
| 698 // Advance to the next JavaScript frame and determine if the | 702 // Advance to the next JavaScript frame and determine if the |
| 699 // current frame is the top-level frame. | 703 // current frame is the top-level frame. |
| 700 it.Advance(); | 704 it.Advance(); |
| 701 Handle<Object> is_top_level = it.done() | 705 Handle<Object> is_top_level = it.done() |
| 702 ? Factory::true_value() | 706 ? Factory::true_value() |
| 703 : Factory::false_value(); | 707 : Factory::false_value(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 714 | 718 |
| 715 void Top::ComputeLocation(MessageLocation* target) { | 719 void Top::ComputeLocation(MessageLocation* target) { |
| 716 *target = MessageLocation(empty_script(), -1, -1); | 720 *target = MessageLocation(empty_script(), -1, -1); |
| 717 StackTraceFrameIterator it; | 721 StackTraceFrameIterator it; |
| 718 if (!it.done()) { | 722 if (!it.done()) { |
| 719 JavaScriptFrame* frame = it.frame(); | 723 JavaScriptFrame* frame = it.frame(); |
| 720 JSFunction* fun = JSFunction::cast(frame->function()); | 724 JSFunction* fun = JSFunction::cast(frame->function()); |
| 721 Object* script = fun->shared()->script(); | 725 Object* script = fun->shared()->script(); |
| 722 if (script->IsScript() && | 726 if (script->IsScript() && |
| 723 !(Script::cast(script)->source()->IsUndefined())) { | 727 !(Script::cast(script)->source()->IsUndefined())) { |
| 724 int pos = frame->FindCode()->SourcePosition(frame->pc()); | 728 int pos = frame->code()->SourcePosition(frame->pc()); |
| 725 // Compute the location from the function and the reloc info. | 729 // Compute the location from the function and the reloc info. |
| 726 Handle<Script> casted_script(Script::cast(script)); | 730 Handle<Script> casted_script(Script::cast(script)); |
| 727 *target = MessageLocation(casted_script, pos, pos + 1); | 731 *target = MessageLocation(casted_script, pos, pos + 1); |
| 728 } | 732 } |
| 729 } | 733 } |
| 730 } | 734 } |
| 731 | 735 |
| 732 | 736 |
| 733 void Top::ReportUncaughtException(Handle<Object> exception, | 737 void Top::ReportUncaughtException(Handle<Object> exception, |
| 734 MessageLocation* location, | 738 MessageLocation* location, |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 Top::break_access_->Lock(); | 957 Top::break_access_->Lock(); |
| 954 } | 958 } |
| 955 | 959 |
| 956 | 960 |
| 957 ExecutionAccess::~ExecutionAccess() { | 961 ExecutionAccess::~ExecutionAccess() { |
| 958 Top::break_access_->Unlock(); | 962 Top::break_access_->Unlock(); |
| 959 } | 963 } |
| 960 | 964 |
| 961 | 965 |
| 962 } } // namespace v8::internal | 966 } } // namespace v8::internal |
| OLD | NEW |