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

Unified Diff: src/frames.cc

Issue 1846183002: Add assertions to FrameSummary and Code::SourcePosition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 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 | « no previous file | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index cfacbac45922f547258b75a11f179828aa4b96f3..8e5b530a93b095f5b42160320f9be007124adab1 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -954,6 +954,15 @@ void JavaScriptFrame::RestoreOperandStack(FixedArray* store) {
}
}
+namespace {
+
+bool CannotDeoptFromAsmCode(Code* code, JSFunction* function) {
+ return code->is_turbofanned() && function->shared()->asm_function() &&
+ !FLAG_turbo_asm_deoptimization;
+}
+
+} // namespace
+
FrameSummary::FrameSummary(Object* receiver, JSFunction* function,
AbstractCode* abstract_code, int code_offset,
bool is_constructor)
@@ -961,7 +970,11 @@ FrameSummary::FrameSummary(Object* receiver, JSFunction* function,
function_(function),
abstract_code_(abstract_code),
code_offset_(code_offset),
- is_constructor_(is_constructor) {}
+ is_constructor_(is_constructor) {
+ DCHECK(abstract_code->IsBytecodeArray() ||
+ Code::cast(abstract_code)->kind() != Code::OPTIMIZED_FUNCTION ||
+ CannotDeoptFromAsmCode(Code::cast(abstract_code), function));
+}
void FrameSummary::Print() {
PrintF("receiver: ");
@@ -973,7 +986,10 @@ void FrameSummary::Print() {
if (abstract_code_->IsCode()) {
Code* code = abstract_code_->GetCode();
if (code->kind() == Code::FUNCTION) PrintF(" UNOPT ");
- if (code->kind() == Code::OPTIMIZED_FUNCTION) PrintF(" OPT ");
+ if (code->kind() == Code::OPTIMIZED_FUNCTION) {
+ DCHECK(CannotDeoptFromAsmCode(code, *function()));
+ PrintF(" ASM ");
+ }
} else {
PrintF(" BYTECODE ");
}
@@ -989,8 +1005,7 @@ void OptimizedFrame::Summarize(List<FrameSummary>* frames) {
// TODO(turbofan): Revisit once we support deoptimization across the board.
Code* code = LookupCode();
if (code->kind() == Code::BUILTIN ||
- (code->is_turbofanned() && function()->shared()->asm_function() &&
- !FLAG_turbo_asm_deoptimization)) {
+ CannotDeoptFromAsmCode(code, function())) {
return JavaScriptFrame::Summarize(frames);
}
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698