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/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.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 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 } | 1293 } |
1294 | 1294 |
1295 VisitForStackValue(lit->constructor()); | 1295 VisitForStackValue(lit->constructor()); |
1296 | 1296 |
1297 __ Push(Smi::FromInt(lit->start_position())); | 1297 __ Push(Smi::FromInt(lit->start_position())); |
1298 __ Push(Smi::FromInt(lit->end_position())); | 1298 __ Push(Smi::FromInt(lit->end_position())); |
1299 | 1299 |
1300 __ CallRuntime(Runtime::kDefineClass, 5); | 1300 __ CallRuntime(Runtime::kDefineClass, 5); |
1301 PrepareForBailoutForId(lit->CreateLiteralId(), TOS_REG); | 1301 PrepareForBailoutForId(lit->CreateLiteralId(), TOS_REG); |
1302 | 1302 |
1303 int store_slot_index = 0; | 1303 EmitClassDefineProperties(lit); |
1304 EmitClassDefineProperties(lit, &store_slot_index); | |
1305 | 1304 |
1306 if (lit->scope() != NULL) { | 1305 if (lit->scope() != NULL) { |
1307 DCHECK_NOT_NULL(lit->class_variable_proxy()); | 1306 DCHECK_NOT_NULL(lit->class_variable_proxy()); |
1308 FeedbackVectorICSlot slot = | |
1309 FLAG_vector_stores && | |
1310 lit->class_variable_proxy()->var()->IsUnallocated() | |
1311 ? lit->GetNthSlot(store_slot_index++) | |
1312 : FeedbackVectorICSlot::Invalid(); | |
1313 EmitVariableAssignment(lit->class_variable_proxy()->var(), | 1307 EmitVariableAssignment(lit->class_variable_proxy()->var(), |
1314 Token::INIT_CONST, slot); | 1308 Token::INIT_CONST, lit->ProxySlot()); |
1315 } | 1309 } |
1316 | |
1317 // Verify that compilation exactly consumed the number of store ic slots | |
1318 // that the ClassLiteral node had to offer. | |
1319 DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count()); | |
1320 } | 1310 } |
1321 | 1311 |
1322 context()->Plug(result_register()); | 1312 context()->Plug(result_register()); |
1323 } | 1313 } |
1324 | 1314 |
1325 | 1315 |
1326 void FullCodeGenerator::VisitNativeFunctionLiteral( | 1316 void FullCodeGenerator::VisitNativeFunctionLiteral( |
1327 NativeFunctionLiteral* expr) { | 1317 NativeFunctionLiteral* expr) { |
1328 Comment cmnt(masm_, "[ NativeFunctionLiteral"); | 1318 Comment cmnt(masm_, "[ NativeFunctionLiteral"); |
1329 | 1319 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1647 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || | 1637 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || |
1648 var->initializer_position() >= proxy->position(); | 1638 var->initializer_position() >= proxy->position(); |
1649 } | 1639 } |
1650 | 1640 |
1651 | 1641 |
1652 #undef __ | 1642 #undef __ |
1653 | 1643 |
1654 | 1644 |
1655 } // namespace internal | 1645 } // namespace internal |
1656 } // namespace v8 | 1646 } // namespace v8 |
OLD | NEW |