Do not use js builtins object to determine whether a function is a builtin.
authoryangguo <yangguo@chromium.org>
Fri, 21 Aug 2015 09:12:57 +0000 (02:12 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 21 Aug 2015 09:13:04 +0000 (09:13 +0000)
commit371ad73a50f2c55286f59b34ca63920b44ca835f
treebf6cac4474031ba179cfc01a4d74ab1cb8ccc7f4
parentcd35155918f8f1a081a208721a878deba00a252b
Do not use js builtins object to determine whether a function is a builtin.

We can use the script type to determine that instead. Script of type
TYPE_NATIVE are considered builtins, TYPE_NORMAL are not. The only exception
to this rule is the empty function, for which the script is TYPE_NATIVE
(observable by the debugger), but should be stringified to "function () {}"
instead of "function () { [native code] }". For this, I introduce a
hide_source flag on the script object.

We also use IsBuiltin and IsSubjectToDebugging interchangeably. For debugger,
we now use the latter, hiding the detail that only non-builtins are debuggable.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/1292283004

Cr-Commit-Position: refs/heads/master@{#30285}
src/compiler.cc
src/debug/debug-scopes.cc
src/debug/debug.cc
src/isolate.cc
src/objects-inl.h
src/objects.h
src/runtime/runtime-debug.cc
src/runtime/runtime-function.cc
src/runtime/runtime.h
src/v8natives.js