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

Unified Diff: src/factory.cc

Issue 768633002: Add infrastructure to keep track of references to prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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/factory.h ('k') | src/flag-definitions.h » ('j') | src/objects.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 218d3b9625880164cc77add838d537432871f628..2645cca9add4191ceac9a7b36d7ec375b758018e 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -116,6 +116,15 @@ Handle<FixedArrayBase> Factory::NewFixedDoubleArrayWithHoles(
}
+Handle<WeakFixedArray> Factory::NewWeakFixedArray(int size) {
+ DCHECK(0 <= size);
+ size += WeakFixedArray::kReservedFieldCount;
+ CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateFixedArrayWithFiller(
+ size, NOT_TENURED, Smi::FromInt(0)),
+ WeakFixedArray);
+}
+
+
Handle<ConstantPoolArray> Factory::NewConstantPoolArray(
const ConstantPoolArray::NumberOfEntries& small) {
DCHECK(small.total_count() > 0);
@@ -1877,7 +1886,7 @@ Handle<JSProxy> Factory::NewJSProxy(Handle<Object> handler,
// TODO(rossberg): Once we optimize proxies, think about a scheme to share
// maps. Will probably depend on the identity of the handler object, too.
Handle<Map> map = NewMap(JS_PROXY_TYPE, JSProxy::kSize);
- map->set_prototype(*prototype);
+ map->SetPrototype(prototype);
// Allocate the proxy object.
Handle<JSProxy> result = New<JSProxy>(map, NEW_SPACE);
@@ -1896,7 +1905,7 @@ Handle<JSProxy> Factory::NewJSFunctionProxy(Handle<Object> handler,
// TODO(rossberg): Once we optimize proxies, think about a scheme to share
// maps. Will probably depend on the identity of the handler object, too.
Handle<Map> map = NewMap(JS_FUNCTION_PROXY_TYPE, JSFunctionProxy::kSize);
- map->set_prototype(*prototype);
+ map->SetPrototype(prototype);
// Allocate the proxy object.
Handle<JSFunctionProxy> result = New<JSFunctionProxy>(map, NEW_SPACE);
@@ -1921,7 +1930,7 @@ void Factory::ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type,
int size_difference = proxy->map()->instance_size() - map->instance_size();
DCHECK(size_difference >= 0);
- map->set_prototype(proxy->map()->prototype());
+ map->SetPrototype(handle(proxy->map()->prototype(), proxy->GetIsolate()));
// Allocate the backing storage for the properties.
int prop_size = map->InitialPropertiesLength();
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698