OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 Register literal = register_allocator()->NextConsecutiveRegister(); | 1389 Register literal = register_allocator()->NextConsecutiveRegister(); |
1390 Register prototype = register_allocator()->NextConsecutiveRegister(); | 1390 Register prototype = register_allocator()->NextConsecutiveRegister(); |
1391 Handle<String> name = isolate()->factory()->prototype_string(); | 1391 Handle<String> name = isolate()->factory()->prototype_string(); |
1392 FeedbackVectorSlot slot = expr->PrototypeSlot(); | 1392 FeedbackVectorSlot slot = expr->PrototypeSlot(); |
1393 builder() | 1393 builder() |
1394 ->StoreAccumulatorInRegister(literal) | 1394 ->StoreAccumulatorInRegister(literal) |
1395 .LoadNamedProperty(literal, name, feedback_index(slot)) | 1395 .LoadNamedProperty(literal, name, feedback_index(slot)) |
1396 .StoreAccumulatorInRegister(prototype); | 1396 .StoreAccumulatorInRegister(prototype); |
1397 | 1397 |
1398 VisitClassLiteralProperties(expr, literal, prototype); | 1398 VisitClassLiteralProperties(expr, literal, prototype); |
1399 builder()->CallRuntime(Runtime::kFinalizeClassDefinition, literal, 2); | 1399 builder()->CallRuntime(Runtime::kToFastProperties, literal, 1); |
1400 // Assign to class variable. | 1400 // Assign to class variable. |
1401 if (expr->class_variable_proxy() != nullptr) { | 1401 if (expr->class_variable_proxy() != nullptr) { |
1402 Variable* var = expr->class_variable_proxy()->var(); | 1402 Variable* var = expr->class_variable_proxy()->var(); |
1403 FeedbackVectorSlot slot = expr->NeedsProxySlot() | 1403 FeedbackVectorSlot slot = expr->NeedsProxySlot() |
1404 ? expr->ProxySlot() | 1404 ? expr->ProxySlot() |
1405 : FeedbackVectorSlot::Invalid(); | 1405 : FeedbackVectorSlot::Invalid(); |
1406 VisitVariableAssignment(var, Token::INIT, slot); | 1406 VisitVariableAssignment(var, Token::INIT, slot); |
1407 } | 1407 } |
1408 execution_result()->SetResultInAccumulator(); | 1408 execution_result()->SetResultInAccumulator(); |
1409 } | 1409 } |
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3270 } | 3270 } |
3271 | 3271 |
3272 | 3272 |
3273 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3273 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3274 return info()->shared_info()->feedback_vector()->GetIndex(slot); | 3274 return info()->shared_info()->feedback_vector()->GetIndex(slot); |
3275 } | 3275 } |
3276 | 3276 |
3277 } // namespace interpreter | 3277 } // namespace interpreter |
3278 } // namespace internal | 3278 } // namespace internal |
3279 } // namespace v8 | 3279 } // namespace v8 |
OLD | NEW |