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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 3016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3027 builder()->SetExpressionPosition(expr); | 3027 builder()->SetExpressionPosition(expr); |
3028 builder()->BinaryOperation(expr->op(), lhs, feedback_index(slot)); | 3028 builder()->BinaryOperation(expr->op(), lhs, feedback_index(slot)); |
3029 } | 3029 } |
3030 | 3030 |
3031 void BytecodeGenerator::VisitSpread(Spread* expr) { Visit(expr->expression()); } | 3031 void BytecodeGenerator::VisitSpread(Spread* expr) { Visit(expr->expression()); } |
3032 | 3032 |
3033 void BytecodeGenerator::VisitEmptyParentheses(EmptyParentheses* expr) { | 3033 void BytecodeGenerator::VisitEmptyParentheses(EmptyParentheses* expr) { |
3034 UNREACHABLE(); | 3034 UNREACHABLE(); |
3035 } | 3035 } |
3036 | 3036 |
3037 void BytecodeGenerator::VisitImportCallExpression(ImportCallExpression* expr) { | |
3038 RegisterList args = register_allocator()->NewRegisterList(2); | |
3039 VisitForRegisterValue(expr->argument(), args[1]); | |
3040 builder() | |
3041 ->LoadAccumulatorWithRegister(Register::function_closure()) | |
3042 .StoreAccumulatorInRegister(args[0]) | |
rmcilroy
2017/03/17 08:51:27
MoveRegister(...) instead of load/storeaccumulator
gsathya
2017/03/17 21:47:59
Done.
| |
3043 .CallRuntime(Runtime::kDynamicImportCall, args); | |
3044 } | |
3045 | |
3037 void BytecodeGenerator::VisitGetIterator(GetIterator* expr) { | 3046 void BytecodeGenerator::VisitGetIterator(GetIterator* expr) { |
3038 FeedbackSlot load_slot = expr->IteratorPropertyFeedbackSlot(); | 3047 FeedbackSlot load_slot = expr->IteratorPropertyFeedbackSlot(); |
3039 FeedbackSlot call_slot = expr->IteratorCallFeedbackSlot(); | 3048 FeedbackSlot call_slot = expr->IteratorCallFeedbackSlot(); |
3040 | 3049 |
3041 RegisterList args = register_allocator()->NewRegisterList(1); | 3050 RegisterList args = register_allocator()->NewRegisterList(1); |
3042 Register method = register_allocator()->NewRegister(); | 3051 Register method = register_allocator()->NewRegister(); |
3043 Register obj = args[0]; | 3052 Register obj = args[0]; |
3044 | 3053 |
3045 VisitForAccumulatorValue(expr->iterable()); | 3054 VisitForAccumulatorValue(expr->iterable()); |
3046 | 3055 |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3519 } | 3528 } |
3520 | 3529 |
3521 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3530 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
3522 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3531 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
3523 : Runtime::kStoreKeyedToSuper_Sloppy; | 3532 : Runtime::kStoreKeyedToSuper_Sloppy; |
3524 } | 3533 } |
3525 | 3534 |
3526 } // namespace interpreter | 3535 } // namespace interpreter |
3527 } // namespace internal | 3536 } // namespace internal |
3528 } // namespace v8 | 3537 } // namespace v8 |
OLD | NEW |