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

Unified Diff: src/full-codegen.cc

Issue 1225303005: [strong] class objects created in strong mode are frozen (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove print 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/compiler/ast-graph-builder.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/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 636698122617ee491f72ea7862c2bc08547d4c36..a97ea22134af4e9ea52765b1471b51d74921e791 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -1204,6 +1204,13 @@ void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
// Verify that compilation exactly consumed the number of store ic slots
// that the ClassLiteral node had to offer.
DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count());
+
+ if (is_strong(language_mode())) {
+ // TODO(conradw): It would be more efficient to define the properties with
+ // the right attributes the first time round.
+ __ Push(result_register());
+ __ CallRuntime(Runtime::kObjectFreeze, 1);
+ }
}
context()->Plug(result_register());
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | test/mjsunit/strong/class-object-frozen.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698