Commit 5c8560a7 authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

Remove vestiges of debug context.

We no longer implement part of the debugger in JS. Therefore we can
remove the infrastructure to support this in the bootstrapper.

Also includes some drive-by cleanups.

Bug: v8:5530

R=petermarshall@chromium.org

Change-Id: I06628a559c17f99c70029fcc94848b0c78f1d3e9
Reviewed-on: https://chromium-review.googlesource.com/c/1369945
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58140}
parent e23bbceb
...@@ -167,8 +167,7 @@ class Genesis { ...@@ -167,8 +167,7 @@ class Genesis {
Genesis(Isolate* isolate, MaybeHandle<JSGlobalProxy> maybe_global_proxy, Genesis(Isolate* isolate, MaybeHandle<JSGlobalProxy> maybe_global_proxy,
v8::Local<v8::ObjectTemplate> global_proxy_template, v8::Local<v8::ObjectTemplate> global_proxy_template,
size_t context_snapshot_index, size_t context_snapshot_index,
v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer, v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer);
GlobalContextType context_type);
Genesis(Isolate* isolate, MaybeHandle<JSGlobalProxy> maybe_global_proxy, Genesis(Isolate* isolate, MaybeHandle<JSGlobalProxy> maybe_global_proxy,
v8::Local<v8::ObjectTemplate> global_proxy_template); v8::Local<v8::ObjectTemplate> global_proxy_template);
~Genesis() = default; ~Genesis() = default;
...@@ -227,11 +226,10 @@ class Genesis { ...@@ -227,11 +226,10 @@ class Genesis {
void InstallGlobalThisBinding(); void InstallGlobalThisBinding();
// New context initialization. Used for creating a context from scratch. // New context initialization. Used for creating a context from scratch.
void InitializeGlobal(Handle<JSGlobalObject> global_object, void InitializeGlobal(Handle<JSGlobalObject> global_object,
Handle<JSFunction> empty_function, Handle<JSFunction> empty_function);
GlobalContextType context_type);
void InitializeExperimentalGlobal(); void InitializeExperimentalGlobal();
// Depending on the situation, expose and/or get rid of the utils object. // Depending on the situation, expose and/or get rid of the utils object.
void ConfigureUtilsObject(GlobalContextType context_type); void ConfigureUtilsObject();
#define DECLARE_FEATURE_INITIALIZATION(id, descr) \ #define DECLARE_FEATURE_INITIALIZATION(id, descr) \
void InitializeGlobal_##id(); void InitializeGlobal_##id();
...@@ -250,13 +248,12 @@ class Genesis { ...@@ -250,13 +248,12 @@ class Genesis {
Handle<JSFunction> InstallInternalArray(Handle<JSObject> target, Handle<JSFunction> InstallInternalArray(Handle<JSObject> target,
const char* name, const char* name,
ElementsKind elements_kind); ElementsKind elements_kind);
bool InstallNatives(GlobalContextType context_type); bool InstallNatives();
Handle<JSFunction> InstallTypedArray(const char* name, Handle<JSFunction> InstallTypedArray(const char* name,
ElementsKind elements_kind); ElementsKind elements_kind);
bool InstallExtraNatives(); bool InstallExtraNatives();
bool InstallExperimentalExtraNatives(); bool InstallExperimentalExtraNatives();
bool InstallDebuggerNatives();
void InstallBuiltinFunctionIds(); void InstallBuiltinFunctionIds();
void InstallExperimentalBuiltinFunctionIds(); void InstallExperimentalBuiltinFunctionIds();
void InitializeNormalizedMapCaches(); void InitializeNormalizedMapCaches();
...@@ -335,14 +332,12 @@ Handle<Context> Bootstrapper::CreateEnvironment( ...@@ -335,14 +332,12 @@ Handle<Context> Bootstrapper::CreateEnvironment(
MaybeHandle<JSGlobalProxy> maybe_global_proxy, MaybeHandle<JSGlobalProxy> maybe_global_proxy,
v8::Local<v8::ObjectTemplate> global_proxy_template, v8::Local<v8::ObjectTemplate> global_proxy_template,
v8::ExtensionConfiguration* extensions, size_t context_snapshot_index, v8::ExtensionConfiguration* extensions, size_t context_snapshot_index,
v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer, v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer) {
GlobalContextType context_type) {
HandleScope scope(isolate_); HandleScope scope(isolate_);
Handle<Context> env; Handle<Context> env;
{ {
Genesis genesis(isolate_, maybe_global_proxy, global_proxy_template, Genesis genesis(isolate_, maybe_global_proxy, global_proxy_template,
context_snapshot_index, embedder_fields_deserializer, context_snapshot_index, embedder_fields_deserializer);
context_type);
env = genesis.result(); env = genesis.result();
if (env.is_null() || !InstallExtensions(env, extensions)) { if (env.is_null() || !InstallExtensions(env, extensions)) {
return Handle<Context>(); return Handle<Context>();
...@@ -1412,8 +1407,7 @@ void InstallMakeError(Isolate* isolate, int builtin_id, int context_index) { ...@@ -1412,8 +1407,7 @@ void InstallMakeError(Isolate* isolate, int builtin_id, int context_index) {
// This is only called if we are not using snapshots. The equivalent // This is only called if we are not using snapshots. The equivalent
// work in the snapshot case is done in HookUpGlobalObject. // work in the snapshot case is done in HookUpGlobalObject.
void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Handle<JSFunction> empty_function, Handle<JSFunction> empty_function) {
GlobalContextType context_type) {
// --- N a t i v e C o n t e x t --- // --- N a t i v e C o n t e x t ---
// Use the empty scope info. // Use the empty scope info.
native_context()->set_scope_info(empty_function->shared()->scope_info()); native_context()->set_scope_info(empty_function->shared()->scope_info());
...@@ -4047,26 +4041,19 @@ static Handle<JSObject> ResolveBuiltinIdHolder(Isolate* isolate, ...@@ -4047,26 +4041,19 @@ static Handle<JSObject> ResolveBuiltinIdHolder(Isolate* isolate,
return Handle<JSObject>::cast(value); return Handle<JSObject>::cast(value);
} }
void Genesis::ConfigureUtilsObject(GlobalContextType context_type) { void Genesis::ConfigureUtilsObject() {
switch (context_type) { // We still need the utils object after deserialization.
// We still need the utils object to find debug functions. if (isolate()->serializer_enabled()) return;
case DEBUG_CONTEXT: if (FLAG_expose_natives_as != nullptr &&
return; strlen(FLAG_expose_natives_as) != 0) {
// Expose the natives in global if a valid name for it is specified. HandleScope scope(isolate());
case FULL_CONTEXT: { Handle<String> natives_key =
// We still need the utils object after deserialization. factory()->InternalizeUtf8String(FLAG_expose_natives_as);
if (isolate()->serializer_enabled()) return; uint32_t dummy_index;
if (FLAG_expose_natives_as == nullptr) break; if (!natives_key->AsArrayIndex(&dummy_index)) {
if (strlen(FLAG_expose_natives_as) == 0) break;
HandleScope scope(isolate());
Handle<String> natives_key =
factory()->InternalizeUtf8String(FLAG_expose_natives_as);
uint32_t dummy_index;
if (natives_key->AsArrayIndex(&dummy_index)) break;
Handle<Object> utils = isolate()->natives_utils_object(); Handle<Object> utils = isolate()->natives_utils_object();
Handle<JSObject> global = isolate()->global_object(); Handle<JSObject> global = isolate()->global_object();
JSObject::AddProperty(isolate(), global, natives_key, utils, DONT_ENUM); JSObject::AddProperty(isolate(), global, natives_key, utils, DONT_ENUM);
break;
} }
} }
...@@ -4076,7 +4063,6 @@ void Genesis::ConfigureUtilsObject(GlobalContextType context_type) { ...@@ -4076,7 +4063,6 @@ void Genesis::ConfigureUtilsObject(GlobalContextType context_type) {
native_context()->set_extras_utils_object(undefined); native_context()->set_extras_utils_object(undefined);
} }
void Bootstrapper::ExportFromRuntime(Isolate* isolate, void Bootstrapper::ExportFromRuntime(Isolate* isolate,
Handle<JSObject> container) { Handle<JSObject> container) {
Factory* factory = isolate->factory(); Factory* factory = isolate->factory();
...@@ -4957,7 +4943,7 @@ Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target, ...@@ -4957,7 +4943,7 @@ Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target,
return array_function; return array_function;
} }
bool Genesis::InstallNatives(GlobalContextType context_type) { bool Genesis::InstallNatives() {
HandleScope scope(isolate()); HandleScope scope(isolate());
// Set up the utils object as shared container between native scripts. // Set up the utils object as shared container between native scripts.
...@@ -5005,7 +4991,7 @@ bool Genesis::InstallNatives(GlobalContextType context_type) { ...@@ -5005,7 +4991,7 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
factory()->InternalizeUtf8String("isPromise"), factory()->InternalizeUtf8String("isPromise"),
isolate()->is_promise(), DONT_ENUM); isolate()->is_promise(), DONT_ENUM);
int builtin_index = Natives::GetDebuggerCount(); int builtin_index = 0;
// Only run prologue.js at this point. // Only run prologue.js at this point.
DCHECK_EQ(builtin_index, Natives::GetIndex("prologue")); DCHECK_EQ(builtin_index, Natives::GetIndex("prologue"));
if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false; if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false;
...@@ -5367,8 +5353,7 @@ bool Genesis::InstallExtraNatives() { ...@@ -5367,8 +5353,7 @@ bool Genesis::InstallExtraNatives() {
native_context()->set_extras_binding_object(*extras_binding); native_context()->set_extras_binding_object(*extras_binding);
for (int i = ExtraNatives::GetDebuggerCount(); for (int i = 0; i < ExtraNatives::GetBuiltinsCount(); i++) {
i < ExtraNatives::GetBuiltinsCount(); i++) {
if (!Bootstrapper::CompileExtraBuiltin(isolate(), i)) return false; if (!Bootstrapper::CompileExtraBuiltin(isolate(), i)) return false;
} }
...@@ -5377,8 +5362,7 @@ bool Genesis::InstallExtraNatives() { ...@@ -5377,8 +5362,7 @@ bool Genesis::InstallExtraNatives() {
bool Genesis::InstallExperimentalExtraNatives() { bool Genesis::InstallExperimentalExtraNatives() {
for (int i = ExperimentalExtraNatives::GetDebuggerCount(); for (int i = 0; i < ExperimentalExtraNatives::GetBuiltinsCount(); i++) {
i < ExperimentalExtraNatives::GetBuiltinsCount(); i++) {
if (!Bootstrapper::CompileExperimentalExtraBuiltin(isolate(), i)) if (!Bootstrapper::CompileExperimentalExtraBuiltin(isolate(), i))
return false; return false;
} }
...@@ -5387,13 +5371,6 @@ bool Genesis::InstallExperimentalExtraNatives() { ...@@ -5387,13 +5371,6 @@ bool Genesis::InstallExperimentalExtraNatives() {
} }
bool Genesis::InstallDebuggerNatives() {
for (int i = 0; i < Natives::GetDebuggerCount(); ++i) {
if (!Bootstrapper::CompileBuiltin(isolate(), i)) return false;
}
return true;
}
static void InstallBuiltinFunctionId(Isolate* isolate, Handle<JSObject> holder, static void InstallBuiltinFunctionId(Isolate* isolate, Handle<JSObject> holder,
const char* function_name, const char* function_name,
BuiltinFunctionId id) { BuiltinFunctionId id) {
...@@ -5791,13 +5768,11 @@ void Genesis::TransferObject(Handle<JSObject> from, Handle<JSObject> to) { ...@@ -5791,13 +5768,11 @@ void Genesis::TransferObject(Handle<JSObject> from, Handle<JSObject> to) {
JSObject::ForceSetPrototype(to, proto); JSObject::ForceSetPrototype(to, proto);
} }
Genesis::Genesis( Genesis::Genesis(
Isolate* isolate, MaybeHandle<JSGlobalProxy> maybe_global_proxy, Isolate* isolate, MaybeHandle<JSGlobalProxy> maybe_global_proxy,
v8::Local<v8::ObjectTemplate> global_proxy_template, v8::Local<v8::ObjectTemplate> global_proxy_template,
size_t context_snapshot_index, size_t context_snapshot_index,
v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer, v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer)
GlobalContextType context_type)
: isolate_(isolate), active_(isolate->bootstrapper()) { : isolate_(isolate), active_(isolate->bootstrapper()) {
RuntimeCallTimerScope rcs_timer(isolate, RuntimeCallCounterId::kGenesis); RuntimeCallTimerScope rcs_timer(isolate, RuntimeCallCounterId::kGenesis);
result_ = Handle<Context>::null(); result_ = Handle<Context>::null();
...@@ -5876,10 +5851,10 @@ Genesis::Genesis( ...@@ -5876,10 +5851,10 @@ Genesis::Genesis(
CreateAsyncFunctionMaps(empty_function); CreateAsyncFunctionMaps(empty_function);
Handle<JSGlobalObject> global_object = Handle<JSGlobalObject> global_object =
CreateNewGlobals(global_proxy_template, global_proxy); CreateNewGlobals(global_proxy_template, global_proxy);
InitializeGlobal(global_object, empty_function, context_type); InitializeGlobal(global_object, empty_function);
InitializeNormalizedMapCaches(); InitializeNormalizedMapCaches();
if (!InstallNatives(context_type)) return; if (!InstallNatives()) return;
if (!InstallExtraNatives()) return; if (!InstallExtraNatives()) return;
if (!ConfigureGlobalObjects(global_proxy_template)) return; if (!ConfigureGlobalObjects(global_proxy_template)) return;
...@@ -5896,7 +5871,6 @@ Genesis::Genesis( ...@@ -5896,7 +5871,6 @@ Genesis::Genesis(
// Install experimental natives. Do not include them into the // Install experimental natives. Do not include them into the
// snapshot as we should be able to turn them off at runtime. Re-installing // snapshot as we should be able to turn them off at runtime. Re-installing
// them after they have already been deserialized would also fail. // them after they have already been deserialized would also fail.
if (context_type == FULL_CONTEXT) {
if (!isolate->serializer_enabled()) { if (!isolate->serializer_enabled()) {
InitializeExperimentalGlobal(); InitializeExperimentalGlobal();
...@@ -5914,18 +5888,13 @@ Genesis::Genesis( ...@@ -5914,18 +5888,13 @@ Genesis::Genesis(
native_context()->set_string_function_prototype_map( native_context()->set_string_function_prototype_map(
string_function_prototype->map()); string_function_prototype->map());
} }
} else if (context_type == DEBUG_CONTEXT) {
DCHECK(!isolate->serializer_enabled());
InitializeExperimentalGlobal();
if (!InstallDebuggerNatives()) return;
}
if (FLAG_disallow_code_generation_from_strings) { if (FLAG_disallow_code_generation_from_strings) {
native_context()->set_allow_code_gen_from_strings( native_context()->set_allow_code_gen_from_strings(
ReadOnlyRoots(isolate).false_value()); ReadOnlyRoots(isolate).false_value());
} }
ConfigureUtilsObject(context_type); ConfigureUtilsObject();
// We created new functions, which may require debug instrumentation. // We created new functions, which may require debug instrumentation.
if (isolate->debug()->is_active()) { if (isolate->debug()->is_active()) {
......
...@@ -40,7 +40,6 @@ class SourceCodeCache final { ...@@ -40,7 +40,6 @@ class SourceCodeCache final {
DISALLOW_COPY_AND_ASSIGN(SourceCodeCache); DISALLOW_COPY_AND_ASSIGN(SourceCodeCache);
}; };
enum GlobalContextType { FULL_CONTEXT, DEBUG_CONTEXT };
// The Boostrapper is the public interface for creating a JavaScript global // The Boostrapper is the public interface for creating a JavaScript global
// context. // context.
...@@ -59,8 +58,7 @@ class Bootstrapper final { ...@@ -59,8 +58,7 @@ class Bootstrapper final {
MaybeHandle<JSGlobalProxy> maybe_global_proxy, MaybeHandle<JSGlobalProxy> maybe_global_proxy,
v8::Local<v8::ObjectTemplate> global_object_template, v8::Local<v8::ObjectTemplate> global_object_template,
v8::ExtensionConfiguration* extensions, size_t context_snapshot_index, v8::ExtensionConfiguration* extensions, size_t context_snapshot_index,
v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer, v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer);
GlobalContextType context_type = FULL_CONTEXT);
Handle<JSGlobalProxy> NewRemoteContext( Handle<JSGlobalProxy> NewRemoteContext(
MaybeHandle<JSGlobalProxy> maybe_global_proxy, MaybeHandle<JSGlobalProxy> maybe_global_proxy,
......
...@@ -38,19 +38,6 @@ function ImportNow(name) { ...@@ -38,19 +38,6 @@ function ImportNow(name) {
} }
function InstallConstants(object, constants) {
%CheckIsBootstrapping();
%OptimizeObjectForAddingMultipleProperties(object, constants.length >> 1);
var attributes = DONT_ENUM | DONT_DELETE | READ_ONLY;
for (var i = 0; i < constants.length; i += 2) {
var name = constants[i];
var k = constants[i + 1];
%AddNamedProperty(object, name, k, attributes);
}
%ToFastProperties(object);
}
// Prevents changes to the prototype of a built-in function. // Prevents changes to the prototype of a built-in function.
// The "prototype" property of the function object is made non-configurable, // The "prototype" property of the function object is made non-configurable,
// and the prototype object is made non-extensible. The latter prevents // and the prototype object is made non-extensible. The latter prevents
...@@ -96,6 +83,7 @@ function PostNatives(utils) { ...@@ -96,6 +83,7 @@ function PostNatives(utils) {
utils.Export = UNDEFINED; utils.Export = UNDEFINED;
utils.Import = UNDEFINED; utils.Import = UNDEFINED;
utils.ImportNow = UNDEFINED; utils.ImportNow = UNDEFINED;
utils.SetUpLockedPrototype = UNDEFINED;
utils.PostNatives = UNDEFINED; utils.PostNatives = UNDEFINED;
} }
...@@ -106,7 +94,6 @@ function PostNatives(utils) { ...@@ -106,7 +94,6 @@ function PostNatives(utils) {
utils.Import = Import; utils.Import = Import;
utils.ImportNow = ImportNow; utils.ImportNow = ImportNow;
utils.Export = Export; utils.Export = Export;
utils.InstallConstants = InstallConstants;
utils.SetUpLockedPrototype = SetUpLockedPrototype; utils.SetUpLockedPrototype = SetUpLockedPrototype;
utils.PostNatives = PostNatives; utils.PostNatives = PostNatives;
......
...@@ -33,7 +33,6 @@ class NativesStore { ...@@ -33,7 +33,6 @@ class NativesStore {
} }
int GetBuiltinsCount() { return static_cast<int>(native_ids_.size()); } int GetBuiltinsCount() { return static_cast<int>(native_ids_.size()); }
int GetDebuggerCount() { return debugger_count_; }
Vector<const char> GetScriptSource(int index) { Vector<const char> GetScriptSource(int index) {
return native_source_[index]; return native_source_[index];
...@@ -60,22 +59,17 @@ class NativesStore { ...@@ -60,22 +59,17 @@ class NativesStore {
NativesStore* store = new NativesStore; NativesStore* store = new NativesStore;
// We expect the libraries in the following format: // We expect the libraries in the following format:
// int: # of debugger sources. // int: # of sources.
// 2N blobs: N pairs of source name + actual source. // 2N blobs: N pairs of source name + actual source.
// then, repeat for non-debugger sources.
int debugger_count = source->GetInt();
for (int i = 0; i < debugger_count; ++i)
store->ReadNameAndContentPair(source);
int library_count = source->GetInt(); int library_count = source->GetInt();
for (int i = 0; i < library_count; ++i) for (int i = 0; i < library_count; ++i)
store->ReadNameAndContentPair(source); store->ReadNameAndContentPair(source);
store->debugger_count_ = debugger_count;
return store; return store;
} }
private: private:
NativesStore() : debugger_count_(0) {} NativesStore() = default;
Vector<const char> NameFromId(const byte* id, int id_length) { Vector<const char> NameFromId(const byte* id, int id_length) {
const char native[] = "native "; const char native[] = "native ";
...@@ -103,7 +97,6 @@ class NativesStore { ...@@ -103,7 +97,6 @@ class NativesStore {
std::vector<Vector<const char>> native_ids_; std::vector<Vector<const char>> native_ids_;
std::vector<Vector<const char>> native_names_; std::vector<Vector<const char>> native_names_;
std::vector<Vector<const char>> native_source_; std::vector<Vector<const char>> native_source_;
int debugger_count_;
DISALLOW_COPY_AND_ASSIGN(NativesStore); DISALLOW_COPY_AND_ASSIGN(NativesStore);
}; };
...@@ -187,11 +180,6 @@ int NativesCollection<type>::GetBuiltinsCount() { ...@@ -187,11 +180,6 @@ int NativesCollection<type>::GetBuiltinsCount() {
return NativesHolder<type>::get()->GetBuiltinsCount(); return NativesHolder<type>::get()->GetBuiltinsCount();
} }
template<NativeType type>
int NativesCollection<type>::GetDebuggerCount() {
return NativesHolder<type>::get()->GetDebuggerCount();
}
template<NativeType type> template<NativeType type>
int NativesCollection<type>::GetIndex(const char* name) { int NativesCollection<type>::GetIndex(const char* name) {
return NativesHolder<type>::get()->GetIndex(name); return NativesHolder<type>::get()->GetIndex(name);
...@@ -216,7 +204,6 @@ Vector<const char> NativesCollection<type>::GetScriptsSource() { ...@@ -216,7 +204,6 @@ Vector<const char> NativesCollection<type>::GetScriptsSource() {
// Explicit template instantiations. // Explicit template instantiations.
#define INSTANTIATE_TEMPLATES(T) \ #define INSTANTIATE_TEMPLATES(T) \
template int NativesCollection<T>::GetBuiltinsCount(); \ template int NativesCollection<T>::GetBuiltinsCount(); \
template int NativesCollection<T>::GetDebuggerCount(); \
template int NativesCollection<T>::GetIndex(const char* name); \ template int NativesCollection<T>::GetIndex(const char* name); \
template Vector<const char> NativesCollection<T>::GetScriptSource(int i); \ template Vector<const char> NativesCollection<T>::GetScriptSource(int i); \
template Vector<const char> NativesCollection<T>::GetScriptName(int i); \ template Vector<const char> NativesCollection<T>::GetScriptName(int i); \
......
...@@ -36,13 +36,6 @@ class V8_EXPORT_PRIVATE NativesCollection { ...@@ -36,13 +36,6 @@ class V8_EXPORT_PRIVATE NativesCollection {
// Number of built-in scripts. // Number of built-in scripts.
static int GetBuiltinsCount(); static int GetBuiltinsCount();
// Number of debugger implementation scripts.
static int GetDebuggerCount();
// These are used to access built-in scripts. The debugger implementation
// scripts have an index in the interval [0, GetDebuggerCount()). The
// non-debugger scripts have an index in the interval [GetDebuggerCount(),
// GetNativesCount()).
static int GetIndex(const char* name); static int GetIndex(const char* name);
static Vector<const char> GetScriptSource(int index); static Vector<const char> GetScriptSource(int index);
static Vector<const char> GetScriptName(int index); static Vector<const char> GetScriptName(int index);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --expose-natives-as natives --allow-natives-syntax // Flags: --allow-natives-syntax
// Test the SameValue and SameValueZero internal methods. // Test the SameValue and SameValueZero internal methods.
var obj1 = {x: 10, y: 11, z: "test"}; var obj1 = {x: 10, y: 11, z: "test"};
......
...@@ -272,11 +272,6 @@ namespace internal { ...@@ -272,11 +272,6 @@ namespace internal {
return %(builtin_count)i; return %(builtin_count)i;
} }
template <>
int NativesCollection<%(type)s>::GetDebuggerCount() {
return %(debugger_count)i;
}
template <> template <>
int NativesCollection<%(type)s>::GetIndex(const char* name) { int NativesCollection<%(type)s>::GetIndex(const char* name) {
%(get_index_cases)s\ %(get_index_cases)s\
...@@ -363,11 +358,6 @@ class Sources: ...@@ -363,11 +358,6 @@ class Sources:
def __init__(self): def __init__(self):
self.names = [] self.names = []
self.modules = [] self.modules = []
self.is_debugger_id = []
def IsDebuggerFile(filename):
return os.path.basename(os.path.dirname(filename)) == "debug"
def IsMacroFile(filename): def IsMacroFile(filename):
return filename.endswith("macros.py") return filename.endswith("macros.py")
...@@ -410,10 +400,6 @@ def PrepareSources(source_files, native_type, emit_js): ...@@ -410,10 +400,6 @@ def PrepareSources(source_files, native_type, emit_js):
else: else:
filters = BuildFilterChain(macro_file, message_template_file) filters = BuildFilterChain(macro_file, message_template_file)
# Sort 'debugger' sources first.
source_files = sorted(source_files,
lambda l,r: IsDebuggerFile(r) - IsDebuggerFile(l))
source_files_and_contents = [(f, ReadFile(f)) for f in source_files] source_files_and_contents = [(f, ReadFile(f)) for f in source_files]
# Have a single not-quite-empty source file if there are none present; # Have a single not-quite-empty source file if there are none present;
...@@ -433,9 +419,6 @@ def PrepareSources(source_files, native_type, emit_js): ...@@ -433,9 +419,6 @@ def PrepareSources(source_files, native_type, emit_js):
result.modules.append(lines) result.modules.append(lines)
is_debugger = IsDebuggerFile(source)
result.is_debugger_id.append(is_debugger)
name = os.path.basename(source)[:-3] name = os.path.basename(source)[:-3]
result.names.append(name) result.names.append(name)
...@@ -483,7 +466,6 @@ def BuildMetadata(sources, source_bytes, native_type): ...@@ -483,7 +466,6 @@ def BuildMetadata(sources, source_bytes, native_type):
metadata = { metadata = {
"builtin_count": len(sources.modules), "builtin_count": len(sources.modules),
"debugger_count": sum(sources.is_debugger_id),
"sources_declaration": SOURCES_DECLARATION % ToCArray(source_bytes), "sources_declaration": SOURCES_DECLARATION % ToCArray(source_bytes),
"total_length": total_length, "total_length": total_length,
"get_index_cases": "".join(get_index_cases), "get_index_cases": "".join(get_index_cases),
...@@ -528,14 +510,8 @@ def WriteStartupBlob(sources, startup_blob): ...@@ -528,14 +510,8 @@ def WriteStartupBlob(sources, startup_blob):
""" """
output = open(startup_blob, "wb") output = open(startup_blob, "wb")
debug_sources = sum(sources.is_debugger_id); PutInt(output, len(sources.names))
PutInt(output, debug_sources) for i in xrange(len(sources.names)):
for i in xrange(debug_sources):
PutStr(output, sources.names[i]);
PutStr(output, sources.modules[i]);
PutInt(output, len(sources.names) - debug_sources)
for i in xrange(debug_sources, len(sources.names)):
PutStr(output, sources.names[i]); PutStr(output, sources.names[i]);
PutStr(output, sources.modules[i]); PutStr(output, sources.modules[i]);
......
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