Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 1cd3d445945234b2a9abd6dec48d7b848ee4d04c..3e3c82b78a059e1be336c1a5dfe84a703f553422 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -2564,6 +2564,19 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit, |
// constructor |
__ CallRuntime(Runtime::kToFastProperties, 1); |
+ |
+ if (is_strong(language_mode())) { |
+ __ mov(scratch, |
+ FieldOperand(eax, JSFunction::kPrototypeOrInitialMapOffset)); |
+ __ push(eax); |
+ __ 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); |
+ } |
} |