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

Unified Diff: src/ppc/full-codegen-ppc.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/ppc/full-codegen-ppc.cc
diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc
index e7b945bc1d27aa1d2aeda912bdb076040a3b5767..02536f7c093fb26f7c02964b8431e416b3bb08e4 100644
--- a/src/ppc/full-codegen-ppc.cc
+++ b/src/ppc/full-codegen-ppc.cc
@@ -2666,6 +2666,16 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit,
// constructor
__ CallRuntime(Runtime::kToFastProperties, 1);
+
+ if (is_strong(language_mode())) {
+ __ LoadP(scratch,
+ FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset));
+ __ Push(r3, 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