Index: src/full-codegen/x64/full-codegen-x64.cc |
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc |
index 894a64a2ee657f5c23b9b79ddaad84cf1febc17d..775e188310e3ff2c9e424436c60229668c13e58a 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -2478,24 +2478,12 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit, |
} |
} |
- // prototype |
- __ CallRuntime(Runtime::kToFastProperties, 1); |
- |
- // constructor |
- __ CallRuntime(Runtime::kToFastProperties, 1); |
- |
- if (is_strong(language_mode())) { |
- __ movp(scratch, |
- FieldOperand(rax, JSFunction::kPrototypeOrInitialMapOffset)); |
- __ Push(rax); |
- __ Push(scratch); |
- // TODO(conradw): It would be more efficient to define the properties with |
- // the right attributes the first time round. |
- // Freeze the prototype. |
- __ CallRuntime(Runtime::kObjectFreeze, 1); |
- // Freeze the constructor. |
- __ CallRuntime(Runtime::kObjectFreeze, 1); |
- } |
+ // Set both the prototype and constructor to have fast properties, and also |
+ // freeze them in strong mode. |
+ __ CallRuntime(is_strong(language_mode()) |
+ ? Runtime::kFinalizeClassDefinitionStrong |
+ : Runtime::kFinalizeClassDefinition, |
+ 2); |
} |