Chromium Code Reviews| 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 } else { | 449 } else { |
| 450 // Look up the code object to figure out the type of the stack frame. | 450 // Look up the code object to figure out the type of the stack frame. |
| 451 Code* code_obj = | 451 Code* code_obj = |
| 452 GetContainingCode(iterator->isolate(), *(state->pc_address)); | 452 GetContainingCode(iterator->isolate(), *(state->pc_address)); |
| 453 if (code_obj != nullptr) { | 453 if (code_obj != nullptr) { |
| 454 if (code_obj->is_interpreter_entry_trampoline() || | 454 if (code_obj->is_interpreter_entry_trampoline() || |
| 455 code_obj->is_interpreter_enter_bytecode_dispatch()) { | 455 code_obj->is_interpreter_enter_bytecode_dispatch()) { |
| 456 return INTERPRETED; | 456 return INTERPRETED; |
| 457 } | 457 } |
| 458 switch (code_obj->kind()) { | 458 switch (code_obj->kind()) { |
| 459 case Code::BUILTIN: | |
| 460 if (marker->IsSmi()) break; | |
|
Michael Starzinger
2016/03/22 12:54:32
Please add a one-line comment explaining that this
Benedikt Meurer
2016/03/22 13:01:18
Done.
| |
| 461 return OPTIMIZED; | |
| 459 case Code::FUNCTION: | 462 case Code::FUNCTION: |
| 460 return JAVA_SCRIPT; | 463 return JAVA_SCRIPT; |
| 461 case Code::OPTIMIZED_FUNCTION: | 464 case Code::OPTIMIZED_FUNCTION: |
| 462 return OPTIMIZED; | 465 return OPTIMIZED; |
| 463 case Code::WASM_FUNCTION: | 466 case Code::WASM_FUNCTION: |
| 464 return WASM; | 467 return WASM; |
| 465 case Code::WASM_TO_JS_FUNCTION: | 468 case Code::WASM_TO_JS_FUNCTION: |
| 466 return WASM_TO_JS; | 469 return WASM_TO_JS; |
| 467 case Code::JS_TO_WASM_FUNCTION: | 470 case Code::JS_TO_WASM_FUNCTION: |
| 468 return JS_TO_WASM; | 471 return JS_TO_WASM; |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 974 PrintF("\npc: %d\n", code_offset_); | 977 PrintF("\npc: %d\n", code_offset_); |
| 975 } | 978 } |
| 976 | 979 |
| 977 | 980 |
| 978 void OptimizedFrame::Summarize(List<FrameSummary>* frames) { | 981 void OptimizedFrame::Summarize(List<FrameSummary>* frames) { |
| 979 DCHECK(frames->length() == 0); | 982 DCHECK(frames->length() == 0); |
| 980 DCHECK(is_optimized()); | 983 DCHECK(is_optimized()); |
| 981 | 984 |
| 982 // Delegate to JS frame in absence of turbofan deoptimization. | 985 // Delegate to JS frame in absence of turbofan deoptimization. |
| 983 // TODO(turbofan): Revisit once we support deoptimization across the board. | 986 // TODO(turbofan): Revisit once we support deoptimization across the board. |
| 984 if (LookupCode()->is_turbofanned() && function()->shared()->asm_function() && | 987 Code* code = LookupCode(); |
| 985 !FLAG_turbo_asm_deoptimization) { | 988 if (code->kind() == Code::BUILTIN || |
| 989 (code->is_turbofanned() && function()->shared()->asm_function() && | |
| 990 !FLAG_turbo_asm_deoptimization)) { | |
| 986 return JavaScriptFrame::Summarize(frames); | 991 return JavaScriptFrame::Summarize(frames); |
| 987 } | 992 } |
| 988 | 993 |
| 989 DisallowHeapAllocation no_gc; | 994 DisallowHeapAllocation no_gc; |
| 990 int deopt_index = Safepoint::kNoDeoptimizationIndex; | 995 int deopt_index = Safepoint::kNoDeoptimizationIndex; |
| 991 DeoptimizationInputData* const data = GetDeoptimizationData(&deopt_index); | 996 DeoptimizationInputData* const data = GetDeoptimizationData(&deopt_index); |
| 992 FixedArray* const literal_array = data->LiteralArray(); | 997 FixedArray* const literal_array = data->LiteralArray(); |
| 993 | 998 |
| 994 TranslationIterator it(data->TranslationByteArray(), | 999 TranslationIterator it(data->TranslationByteArray(), |
| 995 data->TranslationIndex(deopt_index)->value()); | 1000 data->TranslationIndex(deopt_index)->value()); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1078 it.Skip(Translation::NumberOfOperandsFor(frame_opcode)); | 1083 it.Skip(Translation::NumberOfOperandsFor(frame_opcode)); |
| 1079 } | 1084 } |
| 1080 } | 1085 } |
| 1081 DCHECK(!is_constructor); | 1086 DCHECK(!is_constructor); |
| 1082 } | 1087 } |
| 1083 | 1088 |
| 1084 | 1089 |
| 1085 int OptimizedFrame::LookupExceptionHandlerInTable( | 1090 int OptimizedFrame::LookupExceptionHandlerInTable( |
| 1086 int* stack_slots, HandlerTable::CatchPrediction* prediction) { | 1091 int* stack_slots, HandlerTable::CatchPrediction* prediction) { |
| 1087 Code* code = LookupCode(); | 1092 Code* code = LookupCode(); |
| 1088 DCHECK(code->is_optimized_code()); | |
| 1089 HandlerTable* table = HandlerTable::cast(code->handler_table()); | 1093 HandlerTable* table = HandlerTable::cast(code->handler_table()); |
| 1090 int pc_offset = static_cast<int>(pc() - code->entry()); | 1094 int pc_offset = static_cast<int>(pc() - code->entry()); |
| 1091 if (stack_slots) *stack_slots = code->stack_slots(); | 1095 if (stack_slots) *stack_slots = code->stack_slots(); |
| 1092 return table->LookupReturn(pc_offset, prediction); | 1096 return table->LookupReturn(pc_offset, prediction); |
| 1093 } | 1097 } |
| 1094 | 1098 |
| 1095 | 1099 |
| 1096 DeoptimizationInputData* OptimizedFrame::GetDeoptimizationData( | 1100 DeoptimizationInputData* OptimizedFrame::GetDeoptimizationData( |
| 1097 int* deopt_index) const { | 1101 int* deopt_index) const { |
| 1098 DCHECK(is_optimized()); | 1102 DCHECK(is_optimized()); |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1715 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1719 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
| 1716 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1720 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 1717 list.Add(frame, zone); | 1721 list.Add(frame, zone); |
| 1718 } | 1722 } |
| 1719 return list.ToVector(); | 1723 return list.ToVector(); |
| 1720 } | 1724 } |
| 1721 | 1725 |
| 1722 | 1726 |
| 1723 } // namespace internal | 1727 } // namespace internal |
| 1724 } // namespace v8 | 1728 } // namespace v8 |
| OLD | NEW |