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

Unified Diff: src/x87/full-codegen-x87.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: cl feedback 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
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | test/mjsunit/strong/class-object-frozen.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/full-codegen-x87.cc
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
index cc4644c04429dde0be588582d441eb59481b012f..01e42b0d28fabaeb77057d3eecec37e8451b9165 100644
--- a/src/x87/full-codegen-x87.cc
+++ b/src/x87/full-codegen-x87.cc
@@ -2554,6 +2554,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);
+ }
}
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | test/mjsunit/strong/class-object-frozen.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698