Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index b622d9ce8574932f79225fcef40f9ec7b6997da4..d31cbeac851d3ef01ebe008e3e0c03e60c8a2ea3 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -221,33 +221,21 @@ void CompilationInfo::RollbackDependencies() { |
int CompilationInfo::num_parameters() const { |
- if (IsStub()) { |
- DCHECK(parameter_count_ > 0); |
- return parameter_count_; |
- } else { |
- return scope()->num_parameters(); |
- } |
+ return has_scope() ? scope()->num_parameters() : parameter_count_; |
} |
int CompilationInfo::num_heap_slots() const { |
- if (IsStub()) { |
- return 0; |
- } else { |
- return scope()->num_heap_slots(); |
- } |
+ return has_scope() ? scope()->num_heap_slots() : 0; |
} |
Code::Flags CompilationInfo::flags() const { |
- if (IsStub()) { |
- return Code::ComputeFlags(code_stub()->GetCodeKind(), |
- code_stub()->GetICState(), |
- code_stub()->GetExtraICState(), |
- code_stub()->GetStubType()); |
- } else { |
- return Code::ComputeFlags(Code::OPTIMIZED_FUNCTION); |
- } |
+ return code_stub() != nullptr |
+ ? Code::ComputeFlags( |
+ code_stub()->GetCodeKind(), code_stub()->GetICState(), |
+ code_stub()->GetExtraICState(), code_stub()->GetStubType()) |
+ : Code::ComputeFlags(Code::OPTIMIZED_FUNCTION); |
} |