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

Unified Diff: src/objects-inl.h

Issue 2481433002: [Interpreter] Add IsInterpreted() to JSFunction and use to fix test-heap tests. (Closed)
Patch Set: Rebase 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
« no previous file with comments | « src/objects.cc ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index f8d94bc79116b7ef1b1e2317d81513eeeb805e71..8a1433767c53d3b928dd50dd238a3c166590289f 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6265,6 +6265,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;
}
@@ -6506,6 +6510,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);
@@ -6551,11 +6559,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());
}
}
« no previous file with comments | « src/objects.cc ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698