OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
(...skipping 2823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2834 case Token::NE: | 2834 case Token::NE: |
2835 op = javascript()->NotEqual(); | 2835 op = javascript()->NotEqual(); |
2836 break; | 2836 break; |
2837 case Token::EQ_STRICT: | 2837 case Token::EQ_STRICT: |
2838 op = javascript()->StrictEqual(); | 2838 op = javascript()->StrictEqual(); |
2839 break; | 2839 break; |
2840 case Token::NE_STRICT: | 2840 case Token::NE_STRICT: |
2841 op = javascript()->StrictNotEqual(); | 2841 op = javascript()->StrictNotEqual(); |
2842 break; | 2842 break; |
2843 case Token::LT: | 2843 case Token::LT: |
2844 op = javascript()->LessThan(language_mode()); | 2844 op = javascript()->LessThan(); |
2845 break; | 2845 break; |
2846 case Token::GT: | 2846 case Token::GT: |
2847 op = javascript()->GreaterThan(language_mode()); | 2847 op = javascript()->GreaterThan(); |
2848 break; | 2848 break; |
2849 case Token::LTE: | 2849 case Token::LTE: |
2850 op = javascript()->LessThanOrEqual(language_mode()); | 2850 op = javascript()->LessThanOrEqual(); |
2851 break; | 2851 break; |
2852 case Token::GTE: | 2852 case Token::GTE: |
2853 op = javascript()->GreaterThanOrEqual(language_mode()); | 2853 op = javascript()->GreaterThanOrEqual(); |
2854 break; | 2854 break; |
2855 case Token::INSTANCEOF: | 2855 case Token::INSTANCEOF: |
2856 op = javascript()->InstanceOf(); | 2856 op = javascript()->InstanceOf(); |
2857 break; | 2857 break; |
2858 case Token::IN: | 2858 case Token::IN: |
2859 op = javascript()->HasProperty(); | 2859 op = javascript()->HasProperty(); |
2860 break; | 2860 break; |
2861 default: | 2861 default: |
2862 op = nullptr; | 2862 op = nullptr; |
2863 UNREACHABLE(); | 2863 UNREACHABLE(); |
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3818 Node* AstGraphBuilder::BuildBinaryOp(Node* left, Node* right, Token::Value op, | 3818 Node* AstGraphBuilder::BuildBinaryOp(Node* left, Node* right, Token::Value op, |
3819 TypeFeedbackId feedback_id) { | 3819 TypeFeedbackId feedback_id) { |
3820 const Operator* js_op; | 3820 const Operator* js_op; |
3821 BinaryOperationHints hints; | 3821 BinaryOperationHints hints; |
3822 if (!type_hint_analysis_ || | 3822 if (!type_hint_analysis_ || |
3823 !type_hint_analysis_->GetBinaryOperationHints(feedback_id, &hints)) { | 3823 !type_hint_analysis_->GetBinaryOperationHints(feedback_id, &hints)) { |
3824 hints = BinaryOperationHints::Any(); | 3824 hints = BinaryOperationHints::Any(); |
3825 } | 3825 } |
3826 switch (op) { | 3826 switch (op) { |
3827 case Token::BIT_OR: | 3827 case Token::BIT_OR: |
3828 js_op = javascript()->BitwiseOr(language_mode(), hints); | 3828 js_op = javascript()->BitwiseOr(hints); |
3829 break; | 3829 break; |
3830 case Token::BIT_AND: | 3830 case Token::BIT_AND: |
3831 js_op = javascript()->BitwiseAnd(language_mode(), hints); | 3831 js_op = javascript()->BitwiseAnd(hints); |
3832 break; | 3832 break; |
3833 case Token::BIT_XOR: | 3833 case Token::BIT_XOR: |
3834 js_op = javascript()->BitwiseXor(language_mode(), hints); | 3834 js_op = javascript()->BitwiseXor(hints); |
3835 break; | 3835 break; |
3836 case Token::SHL: | 3836 case Token::SHL: |
3837 js_op = javascript()->ShiftLeft(language_mode(), hints); | 3837 js_op = javascript()->ShiftLeft(hints); |
3838 break; | 3838 break; |
3839 case Token::SAR: | 3839 case Token::SAR: |
3840 js_op = javascript()->ShiftRight(language_mode(), hints); | 3840 js_op = javascript()->ShiftRight(hints); |
3841 break; | 3841 break; |
3842 case Token::SHR: | 3842 case Token::SHR: |
3843 js_op = javascript()->ShiftRightLogical(language_mode(), hints); | 3843 js_op = javascript()->ShiftRightLogical(hints); |
3844 break; | 3844 break; |
3845 case Token::ADD: | 3845 case Token::ADD: |
3846 js_op = javascript()->Add(language_mode(), hints); | 3846 js_op = javascript()->Add(hints); |
3847 break; | 3847 break; |
3848 case Token::SUB: | 3848 case Token::SUB: |
3849 js_op = javascript()->Subtract(language_mode(), hints); | 3849 js_op = javascript()->Subtract(hints); |
3850 break; | 3850 break; |
3851 case Token::MUL: | 3851 case Token::MUL: |
3852 js_op = javascript()->Multiply(language_mode(), hints); | 3852 js_op = javascript()->Multiply(hints); |
3853 break; | 3853 break; |
3854 case Token::DIV: | 3854 case Token::DIV: |
3855 js_op = javascript()->Divide(language_mode(), hints); | 3855 js_op = javascript()->Divide(hints); |
3856 break; | 3856 break; |
3857 case Token::MOD: | 3857 case Token::MOD: |
3858 js_op = javascript()->Modulus(language_mode(), hints); | 3858 js_op = javascript()->Modulus(hints); |
3859 break; | 3859 break; |
3860 default: | 3860 default: |
3861 UNREACHABLE(); | 3861 UNREACHABLE(); |
3862 js_op = nullptr; | 3862 js_op = nullptr; |
3863 } | 3863 } |
3864 return NewNode(js_op, left, right); | 3864 return NewNode(js_op, left, right); |
3865 } | 3865 } |
3866 | 3866 |
3867 | 3867 |
3868 Node* AstGraphBuilder::TryLoadGlobalConstant(Handle<Name> name) { | 3868 Node* AstGraphBuilder::TryLoadGlobalConstant(Handle<Name> name) { |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4349 // Phi does not exist yet, introduce one. | 4349 // Phi does not exist yet, introduce one. |
4350 value = NewPhi(inputs, value, control); | 4350 value = NewPhi(inputs, value, control); |
4351 value->ReplaceInput(inputs - 1, other); | 4351 value->ReplaceInput(inputs - 1, other); |
4352 } | 4352 } |
4353 return value; | 4353 return value; |
4354 } | 4354 } |
4355 | 4355 |
4356 } // namespace compiler | 4356 } // namespace compiler |
4357 } // namespace internal | 4357 } // namespace internal |
4358 } // namespace v8 | 4358 } // namespace v8 |
OLD | NEW |