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

Unified Diff: src/objects-inl.h

Issue 2481433002: [Interpreter] Add IsInterpreted() to JSFunction and use to fix test-heap tests. (Closed)
Patch Set: Fix always-opt Created 4 years, 1 month 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 494e9311b235172d178d7afa67ac5be77204f69c..74711f2e9a31ffadd28ec5412e48067a9a0aa4be 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6267,6 +6267,10 @@ void SharedFunctionInfo::ReplaceCode(Code* value) {
if (is_compiled()) set_never_compiled(false);
}
+bool SharedFunctionInfo::IsInterpreted() const {
+ return code()->is_interpreter_trampoline_builtin();
+}
+
bool SharedFunctionInfo::HasBaselineCode() const {
return code()->kind() == Code::FUNCTION;
}
@@ -6508,6 +6512,10 @@ bool JSFunction::IsOptimized() {
return code()->kind() == Code::OPTIMIZED_FUNCTION;
}
+bool JSFunction::IsInterpreted() {
+ return code()->is_interpreter_trampoline_builtin();
+}
+
bool JSFunction::IsMarkedForBaseline() {
return code() ==
GetIsolate()->builtins()->builtin(Builtins::kCompileBaseline);
@@ -6553,11 +6561,10 @@ void Map::InobjectSlackTrackingStep() {
}
AbstractCode* JSFunction::abstract_code() {
- Code* code = this->code();
- if (code->is_interpreter_trampoline_builtin()) {
+ if (IsInterpreted()) {
return AbstractCode::cast(shared()->bytecode_array());
} else {
- return AbstractCode::cast(code);
+ return AbstractCode::cast(code());
}
}

Powered by Google App Engine
This is Rietveld 408576698