Commit 30f6dfb7 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[interpreter] Remove SharedFunctionInfo::IsInterpreted.

The predicate in question was a workaround for when the compilation
pipeline still kept bytecode and baseline code on the same shared
function info. It is not longer needed. In the long run we want a
predicate which can determine the exact tier for each function.

R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/1940913002
Cr-Commit-Position: refs/heads/master@{#36007}
parent c3218375
...@@ -1323,7 +1323,7 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) { ...@@ -1323,7 +1323,7 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) {
isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask,
"prepare for break points"); "prepare for break points");
bool is_interpreted = shared->IsInterpreted(); bool is_interpreted = shared->HasBytecodeArray();
{ {
// TODO(yangguo): with bytecode, we still walk the heap to find all // TODO(yangguo): with bytecode, we still walk the heap to find all
...@@ -1532,7 +1532,7 @@ bool Debug::EnsureDebugInfo(Handle<SharedFunctionInfo> shared, ...@@ -1532,7 +1532,7 @@ bool Debug::EnsureDebugInfo(Handle<SharedFunctionInfo> shared,
return false; return false;
} }
if (shared->IsInterpreted()) { if (shared->HasBytecodeArray()) {
// To prepare bytecode for debugging, we already need to have the debug // To prepare bytecode for debugging, we already need to have the debug
// info (containing the debug copy) upfront, but since we do not recompile, // info (containing the debug copy) upfront, but since we do not recompile,
// preparing for break points cannot fail. // preparing for break points cannot fail.
......
...@@ -2232,7 +2232,7 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) { ...@@ -2232,7 +2232,7 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
Handle<DebugInfo> debug_info = Handle<DebugInfo> debug_info =
Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE)); Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE));
debug_info->set_shared(*shared); debug_info->set_shared(*shared);
if (shared->IsInterpreted()) { if (shared->HasBytecodeArray()) {
// We need to create a copy, but delay since this may cause heap // We need to create a copy, but delay since this may cause heap
// verification. // verification.
debug_info->set_abstract_code(AbstractCode::cast(shared->bytecode_array())); debug_info->set_abstract_code(AbstractCode::cast(shared->bytecode_array()));
...@@ -2240,7 +2240,7 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) { ...@@ -2240,7 +2240,7 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
debug_info->set_abstract_code(AbstractCode::cast(shared->code())); debug_info->set_abstract_code(AbstractCode::cast(shared->code()));
} }
debug_info->set_break_points(*break_points); debug_info->set_break_points(*break_points);
if (shared->IsInterpreted()) { if (shared->HasBytecodeArray()) {
// Create a copy for debugging. // Create a copy for debugging.
Handle<BytecodeArray> original(shared->bytecode_array()); Handle<BytecodeArray> original(shared->bytecode_array());
Handle<BytecodeArray> copy = CopyBytecodeArray(original); Handle<BytecodeArray> copy = CopyBytecodeArray(original);
......
...@@ -5901,7 +5901,7 @@ DebugInfo* SharedFunctionInfo::GetDebugInfo() { ...@@ -5901,7 +5901,7 @@ DebugInfo* SharedFunctionInfo::GetDebugInfo() {
bool SharedFunctionInfo::HasDebugCode() { bool SharedFunctionInfo::HasDebugCode() {
return IsInterpreted() || return HasBytecodeArray() ||
(code()->kind() == Code::FUNCTION && code()->has_debug_break_slots()); (code()->kind() == Code::FUNCTION && code()->has_debug_break_slots());
} }
...@@ -5925,16 +5925,6 @@ bool SharedFunctionInfo::HasBytecodeArray() { ...@@ -5925,16 +5925,6 @@ bool SharedFunctionInfo::HasBytecodeArray() {
return function_data()->IsBytecodeArray(); return function_data()->IsBytecodeArray();
} }
bool SharedFunctionInfo::IsInterpreted() {
// Currently, having bytecode does not mean the function is actually being
// interpreted. However, the debugger has to know precisely what is going to
// be executed.
// TODO(yangguo,mstarzinger): make this a synonym of HasBytecodeArray().
return code() ==
GetIsolate()->builtins()->builtin(
Builtins::kInterpreterEntryTrampoline);
}
BytecodeArray* SharedFunctionInfo::bytecode_array() { BytecodeArray* SharedFunctionInfo::bytecode_array() {
DCHECK(HasBytecodeArray()); DCHECK(HasBytecodeArray());
return BytecodeArray::cast(function_data()); return BytecodeArray::cast(function_data());
......
...@@ -6695,7 +6695,6 @@ class SharedFunctionInfo: public HeapObject { ...@@ -6695,7 +6695,6 @@ class SharedFunctionInfo: public HeapObject {
inline FunctionTemplateInfo* get_api_func_data(); inline FunctionTemplateInfo* get_api_func_data();
inline void set_api_func_data(FunctionTemplateInfo* data); inline void set_api_func_data(FunctionTemplateInfo* data);
inline bool HasBytecodeArray(); inline bool HasBytecodeArray();
inline bool IsInterpreted();
inline BytecodeArray* bytecode_array(); inline BytecodeArray* bytecode_array();
inline void set_bytecode_array(BytecodeArray* bytecode); inline void set_bytecode_array(BytecodeArray* bytecode);
inline void ClearBytecodeArray(); inline void ClearBytecodeArray();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment