OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/frames.h" | 5 #include "src/frames.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 // linkage are actually generated with TurboFan currently, so | 467 // linkage are actually generated with TurboFan currently, so |
468 // this is sound). | 468 // this is sound). |
469 return OPTIMIZED; | 469 return OPTIMIZED; |
470 } | 470 } |
471 return BUILTIN; | 471 return BUILTIN; |
472 case Code::FUNCTION: | 472 case Code::FUNCTION: |
473 return JAVA_SCRIPT; | 473 return JAVA_SCRIPT; |
474 case Code::OPTIMIZED_FUNCTION: | 474 case Code::OPTIMIZED_FUNCTION: |
475 return OPTIMIZED; | 475 return OPTIMIZED; |
476 case Code::WASM_FUNCTION: | 476 case Code::WASM_FUNCTION: |
477 return WASM; | 477 return WASM_COMPILED; |
478 case Code::WASM_TO_JS_FUNCTION: | 478 case Code::WASM_TO_JS_FUNCTION: |
479 return WASM_TO_JS; | 479 return WASM_TO_JS; |
480 case Code::JS_TO_WASM_FUNCTION: | 480 case Code::JS_TO_WASM_FUNCTION: |
481 return JS_TO_WASM; | 481 return JS_TO_WASM; |
| 482 case Code::WASM_TO_INTERPRETER: |
| 483 return WASM_INTERPRETED; |
482 default: | 484 default: |
483 // All other types should have an explicit marker | 485 // All other types should have an explicit marker |
484 break; | 486 break; |
485 } | 487 } |
486 } else { | 488 } else { |
487 return NONE; | 489 return NONE; |
488 } | 490 } |
489 } | 491 } |
490 | 492 |
491 DCHECK(marker->IsSmi()); | 493 DCHECK(marker->IsSmi()); |
492 StackFrame::Type candidate = | 494 StackFrame::Type candidate = |
493 static_cast<StackFrame::Type>(Smi::cast(marker)->value()); | 495 static_cast<StackFrame::Type>(Smi::cast(marker)->value()); |
494 switch (candidate) { | 496 switch (candidate) { |
495 case ENTRY: | 497 case ENTRY: |
496 case ENTRY_CONSTRUCT: | 498 case ENTRY_CONSTRUCT: |
497 case EXIT: | 499 case EXIT: |
498 case STUB: | 500 case STUB: |
499 case STUB_FAILURE_TRAMPOLINE: | 501 case STUB_FAILURE_TRAMPOLINE: |
500 case INTERNAL: | 502 case INTERNAL: |
501 case CONSTRUCT: | 503 case CONSTRUCT: |
502 case ARGUMENTS_ADAPTOR: | 504 case ARGUMENTS_ADAPTOR: |
503 case WASM_TO_JS: | 505 case WASM_TO_JS: |
504 case WASM: | 506 case WASM_COMPILED: |
| 507 case WASM_INTERPRETED: |
505 return candidate; | 508 return candidate; |
506 case JS_TO_WASM: | 509 case JS_TO_WASM: |
507 case JAVA_SCRIPT: | 510 case JAVA_SCRIPT: |
508 case OPTIMIZED: | 511 case OPTIMIZED: |
509 case INTERPRETED: | 512 case INTERPRETED: |
510 default: | 513 default: |
511 // Unoptimized and optimized JavaScript frames, including | 514 // Unoptimized and optimized JavaScript frames, including |
512 // interpreted frames, should never have a StackFrame::Type | 515 // interpreted frames, should never have a StackFrame::Type |
513 // marker. If we find one, we're likely being called from the | 516 // marker. If we find one, we're likely being called from the |
514 // profiler in a bogus stack frame. | 517 // profiler in a bogus stack frame. |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 } | 652 } |
650 | 653 |
651 Object* StandardFrame::receiver() const { | 654 Object* StandardFrame::receiver() const { |
652 return isolate()->heap()->undefined_value(); | 655 return isolate()->heap()->undefined_value(); |
653 } | 656 } |
654 | 657 |
655 Object* StandardFrame::context() const { | 658 Object* StandardFrame::context() const { |
656 return isolate()->heap()->undefined_value(); | 659 return isolate()->heap()->undefined_value(); |
657 } | 660 } |
658 | 661 |
| 662 Object* StandardFrame::debug_info(bool create) const { |
| 663 // This should only be called on frames which override this method. |
| 664 DCHECK(false); |
| 665 return nullptr; |
| 666 } |
| 667 |
659 int StandardFrame::ComputeExpressionsCount() const { | 668 int StandardFrame::ComputeExpressionsCount() const { |
660 Address base = GetExpressionAddress(0); | 669 Address base = GetExpressionAddress(0); |
661 Address limit = sp() - kPointerSize; | 670 Address limit = sp() - kPointerSize; |
662 DCHECK(base >= limit); // stack grows downwards | 671 DCHECK(base >= limit); // stack grows downwards |
663 // Include register-allocated locals in number of expressions. | 672 // Include register-allocated locals in number of expressions. |
664 return static_cast<int>((base - limit) / kPointerSize); | 673 return static_cast<int>((base - limit) / kPointerSize); |
665 } | 674 } |
666 | 675 |
667 Object* StandardFrame::GetParameter(int index) const { | 676 Object* StandardFrame::GetParameter(int index) const { |
668 // StandardFrame does not define any parameters. | 677 // StandardFrame does not define any parameters. |
669 UNREACHABLE(); | 678 UNREACHABLE(); |
670 return nullptr; | 679 return nullptr; |
671 } | 680 } |
672 | 681 |
673 int StandardFrame::ComputeParametersCount() const { return 0; } | 682 int StandardFrame::ComputeParametersCount() const { return 0; } |
674 | 683 |
| 684 void StandardFrame::Summarize(List<FrameSummary>* frames, |
| 685 FrameSummary::Mode mode) const { |
| 686 // Default implementation: no frames. |
| 687 } |
| 688 |
675 void StandardFrame::ComputeCallerState(State* state) const { | 689 void StandardFrame::ComputeCallerState(State* state) const { |
676 state->sp = caller_sp(); | 690 state->sp = caller_sp(); |
677 state->fp = caller_fp(); | 691 state->fp = caller_fp(); |
678 state->pc_address = ResolveReturnAddressLocation( | 692 state->pc_address = ResolveReturnAddressLocation( |
679 reinterpret_cast<Address*>(ComputePCAddress(fp()))); | 693 reinterpret_cast<Address*>(ComputePCAddress(fp()))); |
680 state->constant_pool_address = | 694 state->constant_pool_address = |
681 reinterpret_cast<Address*>(ComputeConstantPoolAddress(fp())); | 695 reinterpret_cast<Address*>(ComputeConstantPoolAddress(fp())); |
682 } | 696 } |
683 | 697 |
684 | 698 |
(...skipping 27 matching lines...) Expand all Loading... |
712 case ENTRY: | 726 case ENTRY: |
713 case ENTRY_CONSTRUCT: | 727 case ENTRY_CONSTRUCT: |
714 case EXIT: | 728 case EXIT: |
715 case STUB_FAILURE_TRAMPOLINE: | 729 case STUB_FAILURE_TRAMPOLINE: |
716 case ARGUMENTS_ADAPTOR: | 730 case ARGUMENTS_ADAPTOR: |
717 case STUB: | 731 case STUB: |
718 case INTERNAL: | 732 case INTERNAL: |
719 case CONSTRUCT: | 733 case CONSTRUCT: |
720 case JS_TO_WASM: | 734 case JS_TO_WASM: |
721 case WASM_TO_JS: | 735 case WASM_TO_JS: |
722 case WASM: | 736 case WASM_COMPILED: |
| 737 case WASM_INTERPRETED: |
723 frame_header_size = TypedFrameConstants::kFixedFrameSizeFromFp; | 738 frame_header_size = TypedFrameConstants::kFixedFrameSizeFromFp; |
724 break; | 739 break; |
725 case JAVA_SCRIPT: | 740 case JAVA_SCRIPT: |
726 case OPTIMIZED: | 741 case OPTIMIZED: |
727 case INTERPRETED: | 742 case INTERPRETED: |
728 case BUILTIN: | 743 case BUILTIN: |
729 // These frame types have a context, but they are actually stored | 744 // These frame types have a context, but they are actually stored |
730 // in the place on the stack that one finds the frame type. | 745 // in the place on the stack that one finds the frame type. |
731 UNREACHABLE(); | 746 UNREACHABLE(); |
732 break; | 747 break; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 return Script::cast(function()->shared()->script()); | 921 return Script::cast(function()->shared()->script()); |
907 } | 922 } |
908 | 923 |
909 Object* JavaScriptFrame::context() const { | 924 Object* JavaScriptFrame::context() const { |
910 const int offset = StandardFrameConstants::kContextOffset; | 925 const int offset = StandardFrameConstants::kContextOffset; |
911 Object* maybe_result = Memory::Object_at(fp() + offset); | 926 Object* maybe_result = Memory::Object_at(fp() + offset); |
912 DCHECK(!maybe_result->IsSmi()); | 927 DCHECK(!maybe_result->IsSmi()); |
913 return maybe_result; | 928 return maybe_result; |
914 } | 929 } |
915 | 930 |
| 931 Object* JavaScriptFrame::debug_info(bool create) const { |
| 932 Handle<JSFunction> fun(function(), isolate()); |
| 933 Handle<SharedFunctionInfo> shared(fun->shared(), isolate()); |
| 934 if (!create && !shared->HasDebugInfo()) { |
| 935 return *isolate()->factory()->undefined_value(); |
| 936 } |
| 937 if (create) isolate()->debug()->EnsureDebugInfo(shared, fun); |
| 938 return shared->GetDebugInfo(); |
| 939 } |
| 940 |
916 int JavaScriptFrame::LookupExceptionHandlerInTable( | 941 int JavaScriptFrame::LookupExceptionHandlerInTable( |
917 int* stack_depth, HandlerTable::CatchPrediction* prediction) { | 942 int* stack_depth, HandlerTable::CatchPrediction* prediction) { |
918 Code* code = LookupCode(); | 943 Code* code = LookupCode(); |
919 DCHECK(!code->is_optimized_code()); | 944 DCHECK(!code->is_optimized_code()); |
920 HandlerTable* table = HandlerTable::cast(code->handler_table()); | 945 HandlerTable* table = HandlerTable::cast(code->handler_table()); |
921 int pc_offset = static_cast<int>(pc() - code->entry()); | 946 int pc_offset = static_cast<int>(pc() - code->entry()); |
922 return table->LookupRange(pc_offset, stack_depth, prediction); | 947 return table->LookupRange(pc_offset, stack_depth, prediction); |
923 } | 948 } |
924 | 949 |
925 | 950 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 return code->is_turbofanned() && function->shared()->asm_function() && | 1031 return code->is_turbofanned() && function->shared()->asm_function() && |
1007 !FLAG_turbo_asm_deoptimization; | 1032 !FLAG_turbo_asm_deoptimization; |
1008 } | 1033 } |
1009 | 1034 |
1010 } // namespace | 1035 } // namespace |
1011 | 1036 |
1012 FrameSummary::FrameSummary(Object* receiver, JSFunction* function, | 1037 FrameSummary::FrameSummary(Object* receiver, JSFunction* function, |
1013 AbstractCode* abstract_code, int code_offset, | 1038 AbstractCode* abstract_code, int code_offset, |
1014 bool is_constructor, Mode mode) | 1039 bool is_constructor, Mode mode) |
1015 : receiver_(receiver, function->GetIsolate()), | 1040 : receiver_(receiver, function->GetIsolate()), |
1016 function_(function), | 1041 function_(function, function->GetIsolate()), |
1017 abstract_code_(abstract_code), | 1042 abstract_code_(abstract_code), |
1018 code_offset_(code_offset), | 1043 code_offset_(code_offset), |
1019 is_constructor_(is_constructor) { | 1044 flags(is_constructor ? kIsConstructor : kNone) { |
1020 DCHECK(abstract_code->IsBytecodeArray() || | 1045 DCHECK(abstract_code->IsBytecodeArray() || |
1021 Code::cast(abstract_code)->kind() != Code::OPTIMIZED_FUNCTION || | 1046 Code::cast(abstract_code)->kind() != Code::OPTIMIZED_FUNCTION || |
1022 CannotDeoptFromAsmCode(Code::cast(abstract_code), function) || | 1047 CannotDeoptFromAsmCode(Code::cast(abstract_code), function) || |
1023 mode == kApproximateSummary); | 1048 mode == kApproximateSummary); |
1024 } | 1049 } |
1025 | 1050 |
1026 FrameSummary FrameSummary::GetFirst(JavaScriptFrame* frame) { | 1051 FrameSummary::FrameSummary(Object* wasm_object, int func_index, |
| 1052 AbstractCode* abstract_code, int code_offset, |
| 1053 Mode mode) |
| 1054 : receiver_(wasm_object, abstract_code->GetIsolate()), |
| 1055 function_(Smi::FromInt(func_index), abstract_code->GetIsolate()), |
| 1056 abstract_code_(abstract_code), |
| 1057 code_offset_(code_offset), |
| 1058 flags(kIsWasm) { |
| 1059 DCHECK(abstract_code->IsCode() && |
| 1060 abstract_code->GetCode()->kind() == Code::WASM_FUNCTION); |
| 1061 } |
| 1062 |
| 1063 FrameSummary FrameSummary::GetFirst(StandardFrame* frame) { |
1027 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); | 1064 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); |
1028 frame->Summarize(&frames); | 1065 frame->Summarize(&frames); |
1029 return frames.first(); | 1066 return frames.first(); |
1030 } | 1067 } |
1031 | 1068 |
| 1069 FrameSummary FrameSummary::GetLast(StandardFrame* frame) { |
| 1070 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); |
| 1071 frame->Summarize(&frames); |
| 1072 return frames.last(); |
| 1073 } |
| 1074 |
| 1075 Script* FrameSummary::script() { |
| 1076 if (is_javascript()) return Script::cast(function()->shared()->script()); |
| 1077 // In testing, we sometimes don't have a wasm object. |
| 1078 if (!wasm_object()->IsJSObject()) return nullptr; |
| 1079 Handle<wasm::WasmDebugInfo> debug_info( |
| 1080 wasm::GetDebugInfo(Handle<JSObject>::cast(wasm_object()))); |
| 1081 return wasm::WasmDebugInfo::GetFunctionScript(debug_info, |
| 1082 wasm_function_index()); |
| 1083 } |
| 1084 |
1032 void FrameSummary::Print() { | 1085 void FrameSummary::Print() { |
1033 PrintF("receiver: "); | 1086 if (is_javascript()) { |
1034 receiver_->ShortPrint(); | 1087 PrintF("receiver: "); |
1035 PrintF("\nfunction: "); | 1088 receiver()->ShortPrint(); |
1036 function_->shared()->DebugName()->ShortPrint(); | 1089 PrintF("\nfunction: "); |
| 1090 function()->shared()->DebugName()->ShortPrint(); |
| 1091 } else { |
| 1092 DCHECK(is_wasm()); |
| 1093 PrintF("wasm object: "); |
| 1094 wasm_object()->ShortPrint(); |
| 1095 PrintF("\nfunction index: %d", wasm_function_index()); |
| 1096 } |
1037 PrintF("\ncode: "); | 1097 PrintF("\ncode: "); |
1038 abstract_code_->ShortPrint(); | 1098 abstract_code_->ShortPrint(); |
1039 if (abstract_code_->IsCode()) { | 1099 if (abstract_code_->IsCode()) { |
1040 Code* code = abstract_code_->GetCode(); | 1100 Code* code = abstract_code_->GetCode(); |
1041 if (code->kind() == Code::FUNCTION) PrintF(" UNOPT "); | 1101 switch (code->kind()) { |
1042 if (code->kind() == Code::OPTIMIZED_FUNCTION) { | 1102 case Code::FUNCTION: |
1043 if (function()->shared()->asm_function()) { | 1103 PrintF(" UNOPT "); |
1044 DCHECK(CannotDeoptFromAsmCode(code, *function())); | 1104 break; |
1045 PrintF(" ASM "); | 1105 case Code::OPTIMIZED_FUNCTION: |
1046 } else { | 1106 if (function()->shared()->asm_function()) { |
1047 PrintF(" OPT (approximate)"); | 1107 DCHECK(CannotDeoptFromAsmCode(code, *function())); |
1048 } | 1108 PrintF(" ASM "); |
| 1109 } else { |
| 1110 PrintF(" OPT (approximate)"); |
| 1111 } |
| 1112 break; |
| 1113 case Code::WASM_FUNCTION: |
| 1114 PrintF(" WASM "); |
| 1115 break; |
| 1116 default: |
| 1117 PrintF("UNKNOWN"); |
| 1118 break; |
1049 } | 1119 } |
1050 } else { | 1120 } else { |
1051 PrintF(" BYTECODE "); | 1121 PrintF(" BYTECODE "); |
1052 } | 1122 } |
1053 PrintF("\npc: %d\n", code_offset_); | 1123 PrintF("\npc: %d\n", code_offset_); |
1054 } | 1124 } |
1055 | 1125 |
1056 void OptimizedFrame::Summarize(List<FrameSummary>* frames, | 1126 void OptimizedFrame::Summarize(List<FrameSummary>* frames, |
1057 FrameSummary::Mode mode) const { | 1127 FrameSummary::Mode mode) const { |
1058 DCHECK(frames->length() == 0); | 1128 DCHECK(frames->length() == 0); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 Code* WasmFrame::unchecked_code() const { | 1459 Code* WasmFrame::unchecked_code() const { |
1390 return static_cast<Code*>(isolate()->FindCodeObject(pc())); | 1460 return static_cast<Code*>(isolate()->FindCodeObject(pc())); |
1391 } | 1461 } |
1392 | 1462 |
1393 void WasmFrame::Iterate(ObjectVisitor* v) const { IterateCompiledFrame(v); } | 1463 void WasmFrame::Iterate(ObjectVisitor* v) const { IterateCompiledFrame(v); } |
1394 | 1464 |
1395 Address WasmFrame::GetCallerStackPointer() const { | 1465 Address WasmFrame::GetCallerStackPointer() const { |
1396 return fp() + ExitFrameConstants::kCallerSPOffset; | 1466 return fp() + ExitFrameConstants::kCallerSPOffset; |
1397 } | 1467 } |
1398 | 1468 |
1399 Object* WasmFrame::wasm_obj() const { | 1469 Object* WasmCompiledFrame::wasm_obj() const { |
1400 FixedArray* deopt_data = LookupCode()->deoptimization_data(); | 1470 FixedArray* deopt_data = LookupCode()->deoptimization_data(); |
1401 DCHECK(deopt_data->length() == 2); | 1471 DCHECK_EQ(2, deopt_data->length()); |
1402 return deopt_data->get(0); | 1472 return deopt_data->get(0); |
1403 } | 1473 } |
1404 | 1474 |
1405 uint32_t WasmFrame::function_index() const { | 1475 uint32_t WasmCompiledFrame::function_index() const { |
1406 FixedArray* deopt_data = LookupCode()->deoptimization_data(); | 1476 FixedArray* deopt_data = LookupCode()->deoptimization_data(); |
1407 DCHECK(deopt_data->length() == 2); | 1477 DCHECK_EQ(2, deopt_data->length()); |
1408 return Smi::cast(deopt_data->get(1))->value(); | 1478 return Smi::cast(deopt_data->get(1))->value(); |
1409 } | 1479 } |
1410 | 1480 |
1411 Script* WasmFrame::script() const { | 1481 Script* WasmCompiledFrame::script() const { |
1412 JSObject* wasm = JSObject::cast(wasm_obj()); | 1482 Handle<JSObject> wasm(JSObject::cast(wasm_obj()), isolate()); |
1413 Handle<wasm::WasmDebugInfo> debug_info(wasm::GetDebugInfo(wasm), isolate()); | 1483 Handle<wasm::WasmDebugInfo> debug_info(wasm::GetDebugInfo(wasm), isolate()); |
1414 return wasm::WasmDebugInfo::GetFunctionScript(debug_info, function_index()); | 1484 return wasm::WasmDebugInfo::GetFunctionScript(debug_info, function_index()); |
1415 } | 1485 } |
1416 | 1486 |
| 1487 Object* WasmCompiledFrame::debug_info(bool create) const { |
| 1488 Handle<JSObject> wasm(JSObject::cast(wasm_obj()), isolate()); |
| 1489 Handle<wasm::WasmDebugInfo> debug_info(wasm::GetDebugInfo(wasm), isolate()); |
| 1490 return wasm::WasmDebugInfo::GetDebugInfo(debug_info, function_index()); |
| 1491 } |
| 1492 |
| 1493 void WasmCompiledFrame::Summarize(List<FrameSummary>* frames, |
| 1494 FrameSummary::Mode mode) const { |
| 1495 Code* code = LookupCode(); |
| 1496 int offset = static_cast<int>(pc() - code->instruction_start()); |
| 1497 // Check that we don't call this from testing, where we have no wasm object. |
| 1498 FrameSummary summary(wasm_obj(), function_index(), AbstractCode::cast(code), |
| 1499 offset, mode); |
| 1500 frames->Add(summary); |
| 1501 } |
| 1502 |
| 1503 Object* WasmInterpretedFrame::wasm_obj() const { |
| 1504 FixedArray* deopt_data = LookupCode()->deoptimization_data(); |
| 1505 DCHECK_EQ(1, deopt_data->length()); |
| 1506 return deopt_data->get(0); |
| 1507 } |
| 1508 |
| 1509 Object* WasmInterpretedFrame::debug_info(bool /* create */) const { |
| 1510 Handle<JSObject> wasm(JSObject::cast(wasm_obj()), isolate()); |
| 1511 Handle<wasm::WasmDebugInfo> wasm_debug(wasm::GetDebugInfo(wasm), isolate()); |
| 1512 // Get the top-most function index. |
| 1513 auto it = wasm_debug->GetInterpreterFrameIterator(); |
| 1514 while (it.Remaining() > 0) it.Next(); |
| 1515 int func_index = it.GetFrameInfo().func_index(); |
| 1516 return wasm_debug->GetDebugInfo(wasm_debug, func_index); |
| 1517 } |
| 1518 |
| 1519 void WasmInterpretedFrame::Summarize(List<FrameSummary>* frames, |
| 1520 FrameSummary::Mode mode) const { |
| 1521 Handle<JSObject> wasm(JSObject::cast(wasm_obj()), isolate()); |
| 1522 Handle<wasm::WasmDebugInfo> debug_info(wasm::GetDebugInfo(wasm), isolate()); |
| 1523 wasm::InterpreterFrameIterator frame_it = |
| 1524 debug_info->GetInterpreterFrameIterator(); |
| 1525 |
| 1526 while (!frame_it.Done()) { |
| 1527 wasm::InterpreterFrameInfo frame_info = frame_it.GetFrameInfo(); |
| 1528 AbstractCode* code = AbstractCode::cast( |
| 1529 wasm::GetWasmFunctionCode(*wasm, frame_info.func_index())); |
| 1530 FrameSummary summ(*wasm, frame_info.func_index(), code, |
| 1531 frame_info.pc_offset()); |
| 1532 frames->Add(summ); |
| 1533 frame_it.Next(); |
| 1534 } |
| 1535 } |
| 1536 |
1417 namespace { | 1537 namespace { |
1418 | 1538 |
1419 | 1539 |
1420 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared, | 1540 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared, |
1421 Code* code) { | 1541 Code* code) { |
1422 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) { | 1542 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) { |
1423 std::ostringstream os; | 1543 std::ostringstream os; |
1424 os << "--------- s o u r c e c o d e ---------\n" | 1544 os << "--------- s o u r c e c o d e ---------\n" |
1425 << SourceCodeOf(shared, FLAG_max_stack_trace_source_length) | 1545 << SourceCodeOf(shared, FLAG_max_stack_trace_source_length) |
1426 << "\n-----------------------------------------\n"; | 1546 << "\n-----------------------------------------\n"; |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1964 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1845 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1965 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1846 list.Add(frame, zone); | 1966 list.Add(frame, zone); |
1847 } | 1967 } |
1848 return list.ToVector(); | 1968 return list.ToVector(); |
1849 } | 1969 } |
1850 | 1970 |
1851 | 1971 |
1852 } // namespace internal | 1972 } // namespace internal |
1853 } // namespace v8 | 1973 } // namespace v8 |
OLD | NEW |