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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-info.h" | 10 #include "src/compilation-info.h" |
(...skipping 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2837 FeedbackVectorSlot slot = expr->CompareOperationFeedbackSlot(); | 2837 FeedbackVectorSlot slot = expr->CompareOperationFeedbackSlot(); |
2838 builder()->CompareOperation(expr->op(), lhs, feedback_index(slot)); | 2838 builder()->CompareOperation(expr->op(), lhs, feedback_index(slot)); |
2839 } | 2839 } |
2840 | 2840 |
2841 void BytecodeGenerator::VisitArithmeticExpression(BinaryOperation* expr) { | 2841 void BytecodeGenerator::VisitArithmeticExpression(BinaryOperation* expr) { |
2842 // TODO(rmcilroy): Special case "x * 1.0" and "x * -1" which are generated for | 2842 // TODO(rmcilroy): Special case "x * 1.0" and "x * -1" which are generated for |
2843 // +x and -x by the parser. | 2843 // +x and -x by the parser. |
2844 Register lhs = VisitForRegisterValue(expr->left()); | 2844 Register lhs = VisitForRegisterValue(expr->left()); |
2845 VisitForAccumulatorValue(expr->right()); | 2845 VisitForAccumulatorValue(expr->right()); |
2846 FeedbackVectorSlot slot = expr->BinaryOperationFeedbackSlot(); | 2846 FeedbackVectorSlot slot = expr->BinaryOperationFeedbackSlot(); |
| 2847 builder()->SetExpressionPosition(expr); |
2847 builder()->BinaryOperation(expr->op(), lhs, feedback_index(slot)); | 2848 builder()->BinaryOperation(expr->op(), lhs, feedback_index(slot)); |
2848 } | 2849 } |
2849 | 2850 |
2850 void BytecodeGenerator::VisitSpread(Spread* expr) { Visit(expr->expression()); } | 2851 void BytecodeGenerator::VisitSpread(Spread* expr) { Visit(expr->expression()); } |
2851 | 2852 |
2852 void BytecodeGenerator::VisitEmptyParentheses(EmptyParentheses* expr) { | 2853 void BytecodeGenerator::VisitEmptyParentheses(EmptyParentheses* expr) { |
2853 UNREACHABLE(); | 2854 UNREACHABLE(); |
2854 } | 2855 } |
2855 | 2856 |
2856 void BytecodeGenerator::VisitGetIterator(GetIterator* expr) { | 2857 void BytecodeGenerator::VisitGetIterator(GetIterator* expr) { |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3259 } | 3260 } |
3260 | 3261 |
3261 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3262 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
3262 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3263 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
3263 : Runtime::kStoreKeyedToSuper_Sloppy; | 3264 : Runtime::kStoreKeyedToSuper_Sloppy; |
3264 } | 3265 } |
3265 | 3266 |
3266 } // namespace interpreter | 3267 } // namespace interpreter |
3267 } // namespace internal | 3268 } // namespace internal |
3268 } // namespace v8 | 3269 } // namespace v8 |
OLD | NEW |