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

Side by Side Diff: src/frames.cc

Issue 1153483002: [turbofan] Enable deoptimization for non-asm.js TurboFan code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Michis comment. REBASE Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 return JSFunction::cast(literal_array->get(literal_id)); 872 return JSFunction::cast(literal_array->get(literal_id));
873 } 873 }
874 874
875 875
876 void OptimizedFrame::Summarize(List<FrameSummary>* frames) { 876 void OptimizedFrame::Summarize(List<FrameSummary>* frames) {
877 DCHECK(frames->length() == 0); 877 DCHECK(frames->length() == 0);
878 DCHECK(is_optimized()); 878 DCHECK(is_optimized());
879 879
880 // Delegate to JS frame in absence of turbofan deoptimization. 880 // Delegate to JS frame in absence of turbofan deoptimization.
881 // TODO(turbofan): Revisit once we support deoptimization across the board. 881 // TODO(turbofan): Revisit once we support deoptimization across the board.
882 if (LookupCode()->is_turbofanned() && !FLAG_turbo_deoptimization) { 882 if (LookupCode()->is_turbofanned() && function()->shared()->asm_function() &&
883 !FLAG_turbo_asm_deoptimization) {
883 return JavaScriptFrame::Summarize(frames); 884 return JavaScriptFrame::Summarize(frames);
884 } 885 }
885 886
886 int deopt_index = Safepoint::kNoDeoptimizationIndex; 887 int deopt_index = Safepoint::kNoDeoptimizationIndex;
887 DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index); 888 DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index);
888 FixedArray* literal_array = data->LiteralArray(); 889 FixedArray* literal_array = data->LiteralArray();
889 890
890 // BUG(3243555): Since we don't have a lazy-deopt registered at 891 // BUG(3243555): Since we don't have a lazy-deopt registered at
891 // throw-statements, we can't use the translation at the call-site of 892 // throw-statements, we can't use the translation at the call-site of
892 // throw. An entry with no deoptimization index indicates a call-site 893 // throw. An entry with no deoptimization index indicates a call-site
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 1010
1010 return DeoptimizationInputData::cast(code->deoptimization_data()); 1011 return DeoptimizationInputData::cast(code->deoptimization_data());
1011 } 1012 }
1012 1013
1013 1014
1014 int OptimizedFrame::GetInlineCount() { 1015 int OptimizedFrame::GetInlineCount() {
1015 DCHECK(is_optimized()); 1016 DCHECK(is_optimized());
1016 1017
1017 // Delegate to JS frame in absence of turbofan deoptimization. 1018 // Delegate to JS frame in absence of turbofan deoptimization.
1018 // TODO(turbofan): Revisit once we support deoptimization across the board. 1019 // TODO(turbofan): Revisit once we support deoptimization across the board.
1019 if (LookupCode()->is_turbofanned() && !FLAG_turbo_deoptimization) { 1020 if (LookupCode()->is_turbofanned() && function()->shared()->asm_function() &&
1021 !FLAG_turbo_asm_deoptimization) {
1020 return JavaScriptFrame::GetInlineCount(); 1022 return JavaScriptFrame::GetInlineCount();
1021 } 1023 }
1022 1024
1023 int deopt_index = Safepoint::kNoDeoptimizationIndex; 1025 int deopt_index = Safepoint::kNoDeoptimizationIndex;
1024 DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index); 1026 DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index);
1025 1027
1026 TranslationIterator it(data->TranslationByteArray(), 1028 TranslationIterator it(data->TranslationByteArray(),
1027 data->TranslationIndex(deopt_index)->value()); 1029 data->TranslationIndex(deopt_index)->value());
1028 Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next()); 1030 Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
1029 DCHECK(opcode == Translation::BEGIN); 1031 DCHECK(opcode == Translation::BEGIN);
1030 USE(opcode); 1032 USE(opcode);
1031 it.Next(); // Drop frame count. 1033 it.Next(); // Drop frame count.
1032 int jsframe_count = it.Next(); 1034 int jsframe_count = it.Next();
1033 return jsframe_count; 1035 return jsframe_count;
1034 } 1036 }
1035 1037
1036 1038
1037 void OptimizedFrame::GetFunctions(List<JSFunction*>* functions) { 1039 void OptimizedFrame::GetFunctions(List<JSFunction*>* functions) {
1038 DCHECK(functions->length() == 0); 1040 DCHECK(functions->length() == 0);
1039 DCHECK(is_optimized()); 1041 DCHECK(is_optimized());
1040 1042
1041 // Delegate to JS frame in absence of turbofan deoptimization. 1043 // Delegate to JS frame in absence of turbofan deoptimization.
1042 // TODO(turbofan): Revisit once we support deoptimization across the board. 1044 // TODO(turbofan): Revisit once we support deoptimization across the board.
1043 if (LookupCode()->is_turbofanned() && !FLAG_turbo_deoptimization) { 1045 if (LookupCode()->is_turbofanned() && function()->shared()->asm_function() &&
1046 !FLAG_turbo_asm_deoptimization) {
1044 return JavaScriptFrame::GetFunctions(functions); 1047 return JavaScriptFrame::GetFunctions(functions);
1045 } 1048 }
1046 1049
1047 int deopt_index = Safepoint::kNoDeoptimizationIndex; 1050 int deopt_index = Safepoint::kNoDeoptimizationIndex;
1048 DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index); 1051 DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index);
1049 FixedArray* literal_array = data->LiteralArray(); 1052 FixedArray* literal_array = data->LiteralArray();
1050 1053
1051 TranslationIterator it(data->TranslationByteArray(), 1054 TranslationIterator it(data->TranslationByteArray(),
1052 data->TranslationIndex(deopt_index)->value()); 1055 data->TranslationIndex(deopt_index)->value());
1053 Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next()); 1056 Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 ZoneList<StackFrame*> list(10, zone); 1517 ZoneList<StackFrame*> list(10, zone);
1515 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1518 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1516 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1519 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1517 list.Add(frame, zone); 1520 list.Add(frame, zone);
1518 } 1521 }
1519 return list.ToVector(); 1522 return list.ToVector();
1520 } 1523 }
1521 1524
1522 1525
1523 } } // namespace v8::internal 1526 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698