Eagerly mark class prototypes as prototype.

BUG=v8:3330
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#31548}
This commit is contained in:
verwaest 2015-10-26 01:29:39 -07:00 committed by Commit bot
parent a3f782f260
commit 307158784e

View File

@ -123,6 +123,7 @@ static MaybeHandle<Object> DefineClass(Isolate* isolate, Handle<Object> name,
Handle<Map> map =
isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
map->set_is_prototype_map(true);
if (constructor->map()->is_strong()) {
map->set_is_strong();
if (super_class->IsNull()) {
@ -223,7 +224,6 @@ RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) {
CONVERT_ARG_HANDLE_CHECKED(JSObject, constructor, 0);
CONVERT_ARG_HANDLE_CHECKED(JSObject, prototype, 1);
JSObject::MigrateSlowToFast(prototype, 0, "RuntimeToFastProperties");
JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties");
if (constructor->map()->is_strong()) {