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

Unified Diff: src/ia32/full-codegen-ia32.cc

Issue 1235983002: [strong] class objects created in strong mode have their prototype frozen (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months 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
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..da2f3f892a51fb53166a6b2e09e703c62d276e71 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -2564,6 +2564,17 @@ 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);
+ __ CallRuntime(Runtime::kObjectFreeze, 1);
+ // TODO(conradw): It would be more efficient to define the properties with
+ // the right attributes the first time round.
+ __ CallRuntime(Runtime::kObjectFreeze, 1);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698