Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index b21724583d879df280080fd49a5e50655d24ce9a..c5f7a2c5d9e705cdd83454a0e65455c2b3a79100 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -5565,29 +5565,22 @@ void SharedFunctionInfo::TryReenableOptimization() { |
} |
-bool JSFunction::IsBuiltin() { |
- return context()->global_object()->IsJSBuiltinsObject(); |
+bool SharedFunctionInfo::IsSubjectToDebugging() { |
+ Object* script_obj = script(); |
+ if (script_obj->IsUndefined()) return false; |
+ Script* script = Script::cast(script_obj); |
+ Script::Type type = static_cast<Script::Type>(script->type()->value()); |
+ return type == Script::TYPE_NORMAL; |
} |
-bool JSFunction::IsFromNativeScript() { |
- Object* script = shared()->script(); |
- bool native = script->IsScript() && |
- Script::cast(script)->type()->value() == Script::TYPE_NATIVE; |
- DCHECK(!IsBuiltin() || native); // All builtins are also native. |
- return native; |
-} |
- |
- |
-bool JSFunction::IsFromExtensionScript() { |
- Object* script = shared()->script(); |
- return script->IsScript() && |
- Script::cast(script)->type()->value() == Script::TYPE_EXTENSION; |
+bool JSFunction::IsBuiltin() { |
+ return context()->global_object()->IsJSBuiltinsObject(); |
} |
bool JSFunction::IsSubjectToDebugging() { |
- return !IsFromNativeScript() && !IsFromExtensionScript(); |
+ return shared()->IsSubjectToDebugging(); |
} |