"(0, the default, means to use system random).")
// objects.cc
-DEFINE_BOOL(trace_weak_arrays, false, "trace WeakFixedArray usage")
+DEFINE_BOOL(trace_weak_arrays, false, "Trace WeakFixedArray usage")
DEFINE_BOOL(track_prototype_users, false,
- "keep track of which maps refer to a given prototype object")
+ "Keep track of which maps refer to a given prototype object")
+DEFINE_BOOL(trace_prototype_users, false,
+ "Trace updates to prototype user tracking")
DEFINE_BOOL(eliminate_prototype_chain_checks, true,
- "collapse prototype chain checks into single-cell checks")
+ "Collapse prototype chain checks into single-cell checks")
DEFINE_IMPLICATION(eliminate_prototype_chain_checks, track_prototype_users)
DEFINE_BOOL(use_verbose_printer, true, "allows verbose printing")
#if TRACE_MAPS
DCHECK(object->map() == *new_map);
new_map->set_prototype_info(old_map->prototype_info());
old_map->set_prototype_info(Smi::FromInt(0));
+ if (FLAG_trace_prototype_users) {
+ PrintF("Moving prototype_info %p from map %p to map %p.\n",
+ reinterpret_cast<void*>(new_map->prototype_info()),
+ reinterpret_cast<void*>(*old_map),
+ reinterpret_cast<void*>(*new_map));
+ }
}
}
DCHECK(new_map->is_prototype_map());
new_map->set_prototype_info(object->map()->prototype_info());
object->map()->set_prototype_info(Smi::FromInt(0));
+ if (FLAG_trace_prototype_users) {
+ PrintF("Moving prototype_info %p from map %p to map %p.\n",
+ reinterpret_cast<void*>(new_map->prototype_info()),
+ reinterpret_cast<void*>(object->map()),
+ reinterpret_cast<void*>(*new_map));
+ }
}
#if TRACE_MAPS
Isolate* isolate = fast_map->GetIsolate();
Handle<Object> maybe_cache(isolate->native_context()->normalized_map_cache(),
isolate);
- bool use_cache = !maybe_cache->IsUndefined();
+ bool use_cache = !fast_map->is_prototype_map() && !maybe_cache->IsUndefined();
Handle<NormalizedMapCache> cache;
if (use_cache) cache = Handle<NormalizedMapCache>::cast(maybe_cache);
if (!maybe_registry.is_identical_to(new_array)) {
proto_info->set_prototype_users(*new_array);
}
+ if (FLAG_trace_prototype_users) {
+ PrintF("Registering %p as a user of prototype %p.\n",
+ reinterpret_cast<void*>(*user), reinterpret_cast<void*>(*prototype));
+ }
}
Object* maybe_registry = proto_info->prototype_users();
if (!maybe_registry->IsWeakFixedArray()) return;
WeakFixedArray::cast(maybe_registry)->Remove(user);
+ if (FLAG_trace_prototype_users) {
+ PrintF("Unregistering %p as a user of prototype %p.\n",
+ reinterpret_cast<void*>(*user), reinterpret_cast<void*>(*prototype));
+ }
}
prototype = Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
}
Handle<PrototypeInfo> proto_info(
- PrototypeInfo::cast(prototype->map()->prototype_info()));
+ PrototypeInfo::cast(prototype->map()->prototype_info()), isolate);
Object* maybe_cell = proto_info->validity_cell();
// Return existing cell if it's still valid.
if (maybe_cell->IsCell()) {
--- /dev/null
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var dummy = new ReferenceError("dummy");
+
+constructors = [ ReferenceError, TypeError];
+
+for (var i in constructors) {
+ constructors[i].prototype.__defineGetter__("stack", function() {});
+}
+
+for (var i in constructors) {
+ var obj = new constructors[i];
+ obj.toString();
+}