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

Unified Diff: src/objects-inl.h

Issue 1292283004: Do not use js builtins object to determine whether a function is a builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove redundant check Created 5 years, 4 months 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.h ('k') | src/runtime/runtime.h » ('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 933360c59fa41a462ed9e3997e2346a0f59db395..277b63aca414a985d3f4a0dde31c6c243c0ab3f1 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5537,6 +5537,10 @@ void Script::set_compilation_type(CompilationType type) {
set_flags(BooleanBit::set(flags(), kCompilationTypeBit,
type == COMPILATION_TYPE_EVAL));
}
+bool Script::hide_source() { return BooleanBit::get(flags(), kHideSourceBit); }
+void Script::set_hide_source(bool value) {
+ set_flags(BooleanBit::set(flags(), kHideSourceBit, value));
+}
Script::CompilationState Script::compilation_state() {
return BooleanBit::get(flags(), kCompilationStateBit) ?
COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL;
@@ -6002,18 +6006,19 @@ void SharedFunctionInfo::set_disable_optimization_reason(BailoutReason reason) {
}
-bool SharedFunctionInfo::IsSubjectToDebugging() {
+bool SharedFunctionInfo::IsBuiltin() {
Object* script_obj = script();
- if (script_obj->IsUndefined()) return false;
+ if (script_obj->IsUndefined()) return true;
Script* script = Script::cast(script_obj);
Script::Type type = static_cast<Script::Type>(script->type()->value());
- return type == Script::TYPE_NORMAL;
+ return type != Script::TYPE_NORMAL;
}
-bool JSFunction::IsBuiltin() {
- return context()->global_object()->IsJSBuiltinsObject();
-}
+bool SharedFunctionInfo::IsSubjectToDebugging() { return !IsBuiltin(); }
+
+
+bool JSFunction::IsBuiltin() { return shared()->IsBuiltin(); }
bool JSFunction::IsSubjectToDebugging() {
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698