OLD | NEW |
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 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 } | 1414 } |
1415 | 1415 |
1416 VisitForStackValue(lit->constructor()); | 1416 VisitForStackValue(lit->constructor()); |
1417 | 1417 |
1418 __ Push(script()); | 1418 __ Push(script()); |
1419 __ Push(Smi::FromInt(lit->start_position())); | 1419 __ Push(Smi::FromInt(lit->start_position())); |
1420 __ Push(Smi::FromInt(lit->end_position())); | 1420 __ Push(Smi::FromInt(lit->end_position())); |
1421 | 1421 |
1422 __ CallRuntime(Runtime::kDefineClass, 6); | 1422 __ CallRuntime(Runtime::kDefineClass, 6); |
1423 PrepareForBailoutForId(lit->CreateLiteralId(), TOS_REG); | 1423 PrepareForBailoutForId(lit->CreateLiteralId(), TOS_REG); |
1424 EmitClassDefineProperties(lit); | 1424 |
| 1425 int store_slot_index = 0; |
| 1426 EmitClassDefineProperties(lit, &store_slot_index); |
1425 | 1427 |
1426 if (lit->scope() != NULL) { | 1428 if (lit->scope() != NULL) { |
1427 DCHECK_NOT_NULL(lit->class_variable_proxy()); | 1429 DCHECK_NOT_NULL(lit->class_variable_proxy()); |
| 1430 FeedbackVectorICSlot slot = FLAG_vector_stores |
| 1431 ? lit->GetNthSlot(store_slot_index++) |
| 1432 : FeedbackVectorICSlot::Invalid(); |
1428 EmitVariableAssignment(lit->class_variable_proxy()->var(), | 1433 EmitVariableAssignment(lit->class_variable_proxy()->var(), |
1429 Token::INIT_CONST); | 1434 Token::INIT_CONST, slot); |
1430 } | 1435 } |
| 1436 |
| 1437 // Verify that compilation exactly consumed the number of store ic slots |
| 1438 // that the ClassLiteral node had to offer. |
| 1439 DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count()); |
1431 } | 1440 } |
1432 | 1441 |
1433 context()->Plug(result_register()); | 1442 context()->Plug(result_register()); |
1434 } | 1443 } |
1435 | 1444 |
1436 | 1445 |
1437 void FullCodeGenerator::VisitNativeFunctionLiteral( | 1446 void FullCodeGenerator::VisitNativeFunctionLiteral( |
1438 NativeFunctionLiteral* expr) { | 1447 NativeFunctionLiteral* expr) { |
1439 Comment cmnt(masm_, "[ NativeFunctionLiteral"); | 1448 Comment cmnt(masm_, "[ NativeFunctionLiteral"); |
1440 | 1449 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1694 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1703 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1695 codegen_->scope_ = saved_scope_; | 1704 codegen_->scope_ = saved_scope_; |
1696 } | 1705 } |
1697 | 1706 |
1698 | 1707 |
1699 #undef __ | 1708 #undef __ |
1700 | 1709 |
1701 | 1710 |
1702 } // namespace internal | 1711 } // namespace internal |
1703 } // namespace v8 | 1712 } // namespace v8 |
OLD | NEW |