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

Unified Diff: src/mips64/full-codegen-mips64.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/mips64/full-codegen-mips64.cc
diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc
index 99777e0845871c696e89a47bb6b3ad7fe3446157..e46760bd17134d93dca51b836cdac7474da50847 100644
--- a/src/mips64/full-codegen-mips64.cc
+++ b/src/mips64/full-codegen-mips64.cc
@@ -2641,6 +2641,16 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit,
// constructor
__ CallRuntime(Runtime::kToFastProperties, 1);
+
+ if (is_strong(language_mode())) {
+ __ ld(scratch,
+ FieldMemOperand(v0, JSFunction::kPrototypeOrInitialMapOffset));
+ __ Push(v0, 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