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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 FeedbackVectorICSlot slot = FLAG_vector_stores 1197 FeedbackVectorICSlot slot = FLAG_vector_stores
1198 ? lit->GetNthSlot(store_slot_index++) 1198 ? lit->GetNthSlot(store_slot_index++)
1199 : FeedbackVectorICSlot::Invalid(); 1199 : FeedbackVectorICSlot::Invalid();
1200 EmitVariableAssignment(lit->class_variable_proxy()->var(), 1200 EmitVariableAssignment(lit->class_variable_proxy()->var(),
1201 Token::INIT_CONST, slot); 1201 Token::INIT_CONST, slot);
1202 } 1202 }
1203 1203
1204 // Verify that compilation exactly consumed the number of store ic slots 1204 // Verify that compilation exactly consumed the number of store ic slots
1205 // that the ClassLiteral node had to offer. 1205 // that the ClassLiteral node had to offer.
1206 DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count()); 1206 DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count());
1207
1208 if (is_strong(language_mode())) {
1209 // TODO(conradw): It would be more efficient to define the properties with
1210 // the right attributes the first time round.
1211 __ Push(result_register());
1212 __ CallRuntime(Runtime::kObjectFreeze, 1);
1213 }
1207 } 1214 }
1208 1215
1209 context()->Plug(result_register()); 1216 context()->Plug(result_register());
1210 } 1217 }
1211 1218
1212 1219
1213 void FullCodeGenerator::VisitNativeFunctionLiteral( 1220 void FullCodeGenerator::VisitNativeFunctionLiteral(
1214 NativeFunctionLiteral* expr) { 1221 NativeFunctionLiteral* expr) {
1215 Comment cmnt(masm_, "[ NativeFunctionLiteral"); 1222 Comment cmnt(masm_, "[ NativeFunctionLiteral");
1216 1223
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); 1477 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS);
1471 codegen_->scope_ = saved_scope_; 1478 codegen_->scope_ = saved_scope_;
1472 } 1479 }
1473 1480
1474 1481
1475 #undef __ 1482 #undef __
1476 1483
1477 1484
1478 } // namespace internal 1485 } // namespace internal
1479 } // namespace v8 1486 } // namespace v8
OLDNEW
« 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