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

Unified Diff: src/full-codegen/full-codegen.cc

Issue 2176653003: Wrap ClassLiterals in DoExpressions instead of giving them BlockScopes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comments Created 4 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/full-codegen/full-codegen.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index 597c805aaa70dd471f527f42e5b503f38194c226..2aa3f7f60fa4d6f8b46d47edd0804f007b99eb86 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -1446,45 +1446,38 @@ void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
Comment cmnt(masm_, "[ ClassLiteral");
- {
- NestedClassLiteral nested_class_literal(this, lit);
- EnterBlockScopeIfNeeded block_scope_state(
- this, lit->scope(), lit->EntryId(), lit->DeclsId(), lit->ExitId());
-
- if (lit->extends() != NULL) {
- VisitForStackValue(lit->extends());
- } else {
- PushOperand(isolate()->factory()->the_hole_value());
- }
+ if (lit->extends() != NULL) {
+ VisitForStackValue(lit->extends());
+ } else {
+ PushOperand(isolate()->factory()->the_hole_value());
+ }
- VisitForStackValue(lit->constructor());
+ VisitForStackValue(lit->constructor());
- PushOperand(Smi::FromInt(lit->start_position()));
- PushOperand(Smi::FromInt(lit->end_position()));
+ PushOperand(Smi::FromInt(lit->start_position()));
+ PushOperand(Smi::FromInt(lit->end_position()));
- CallRuntimeWithOperands(Runtime::kDefineClass);
- PrepareForBailoutForId(lit->CreateLiteralId(), BailoutState::TOS_REGISTER);
- PushOperand(result_register());
+ CallRuntimeWithOperands(Runtime::kDefineClass);
+ PrepareForBailoutForId(lit->CreateLiteralId(), BailoutState::TOS_REGISTER);
+ PushOperand(result_register());
- // Load the "prototype" from the constructor.
- __ Move(LoadDescriptor::ReceiverRegister(), result_register());
- __ LoadRoot(LoadDescriptor::NameRegister(),
- Heap::kprototype_stringRootIndex);
- __ Move(LoadDescriptor::SlotRegister(), SmiFromSlot(lit->PrototypeSlot()));
- CallLoadIC();
- PrepareForBailoutForId(lit->PrototypeId(), BailoutState::TOS_REGISTER);
- PushOperand(result_register());
+ // Load the "prototype" from the constructor.
+ __ Move(LoadDescriptor::ReceiverRegister(), result_register());
+ __ LoadRoot(LoadDescriptor::NameRegister(), Heap::kprototype_stringRootIndex);
+ __ Move(LoadDescriptor::SlotRegister(), SmiFromSlot(lit->PrototypeSlot()));
+ CallLoadIC();
+ PrepareForBailoutForId(lit->PrototypeId(), BailoutState::TOS_REGISTER);
+ PushOperand(result_register());
- EmitClassDefineProperties(lit);
- DropOperands(1);
+ EmitClassDefineProperties(lit);
+ DropOperands(1);
- // Set the constructor to have fast properties.
- CallRuntimeWithOperands(Runtime::kToFastProperties);
+ // Set the constructor to have fast properties.
+ CallRuntimeWithOperands(Runtime::kToFastProperties);
- if (lit->class_variable_proxy() != nullptr) {
- EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT,
- lit->ProxySlot());
- }
+ if (lit->class_variable_proxy() != nullptr) {
+ EmitVariableAssignment(lit->class_variable_proxy()->var(), Token::INIT,
+ lit->ProxySlot());
}
context()->Plug(result_register());
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698