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

Unified Diff: src/arm64/full-codegen-arm64.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/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc
index 09e08f3428d0619ceb95fd02b14e996f7a0c4a1d..500b594a726e4e16ad31bd6ac88700716c655520 100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -2352,6 +2352,17 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit,
// constructor
__ CallRuntime(Runtime::kToFastProperties, 1);
+
+ if (is_strong(language_mode())) {
+ __ Ldr(scratch,
+ FieldMemOperand(x0, JSFunction::kPrototypeOrInitialMapOffset));
+ __ push(x0);
+ __ 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