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

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

Issue 2142333002: Refactor class declaration logic to the parser and runtime Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: minor cleanup per Adam 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
Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index 79c887ade32c2e43029cb3a17d64d37f2d7b5b6f..ab7b9a97988aabfc278165269612fced95a4fb8b 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -1468,53 +1468,6 @@ 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());
- }
-
- VisitForStackValue(lit->constructor());
-
- PushOperand(Smi::FromInt(lit->start_position()));
- PushOperand(Smi::FromInt(lit->end_position()));
-
- 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());
-
- EmitClassDefineProperties(lit);
- DropOperands(1);
-
- // 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());
- }
- }
-
- context()->Plug(result_register());
-}
-
void FullCodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) {
Comment cmnt(masm_, "[ RegExpLiteral");
Callable callable = CodeFactory::FastCloneRegExp(isolate());

Powered by Google App Engine
This is Rietveld 408576698