OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2689 } | 2689 } |
2690 | 2690 |
2691 default: | 2691 default: |
2692 UNREACHABLE(); | 2692 UNREACHABLE(); |
2693 } | 2693 } |
2694 } | 2694 } |
2695 | 2695 |
2696 | 2696 |
2697 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { | 2697 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
2698 Comment cmnt(masm_, "[ CountOperation"); | 2698 Comment cmnt(masm_, "[ CountOperation"); |
| 2699 SetSourcePosition(expr->position()); |
2699 | 2700 |
2700 // Invalid left-hand-sides are rewritten to have a 'throw | 2701 // Invalid left-hand-sides are rewritten to have a 'throw |
2701 // ReferenceError' as the left-hand side. | 2702 // ReferenceError' as the left-hand side. |
2702 if (!expr->expression()->IsValidLeftHandSide()) { | 2703 if (!expr->expression()->IsValidLeftHandSide()) { |
2703 VisitForEffect(expr->expression()); | 2704 VisitForEffect(expr->expression()); |
2704 return; | 2705 return; |
2705 } | 2706 } |
2706 | 2707 |
2707 // Expression can only be a property, a global or a (parameter or local) | 2708 // Expression can only be a property, a global or a (parameter or local) |
2708 // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY. | 2709 // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY. |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2967 } else { | 2968 } else { |
2968 if (if_false != fall_through) __ jmp(if_false); | 2969 if (if_false != fall_through) __ jmp(if_false); |
2969 } | 2970 } |
2970 | 2971 |
2971 return true; | 2972 return true; |
2972 } | 2973 } |
2973 | 2974 |
2974 | 2975 |
2975 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 2976 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
2976 Comment cmnt(masm_, "[ CompareOperation"); | 2977 Comment cmnt(masm_, "[ CompareOperation"); |
| 2978 SetSourcePosition(expr->position()); |
2977 | 2979 |
2978 // Always perform the comparison for its control flow. Pack the result | 2980 // Always perform the comparison for its control flow. Pack the result |
2979 // into the expression's context after the comparison is performed. | 2981 // into the expression's context after the comparison is performed. |
2980 Label materialize_true, materialize_false; | 2982 Label materialize_true, materialize_false; |
2981 Label* if_true = NULL; | 2983 Label* if_true = NULL; |
2982 Label* if_false = NULL; | 2984 Label* if_false = NULL; |
2983 PrepareTest(&materialize_true, &materialize_false, &if_true, &if_false); | 2985 PrepareTest(&materialize_true, &materialize_false, &if_true, &if_false); |
2984 | 2986 |
2985 // First we try a fast inlined version of the compare when one of | 2987 // First we try a fast inlined version of the compare when one of |
2986 // the operands is a literal. | 2988 // the operands is a literal. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3154 __ ret(0); | 3156 __ ret(0); |
3155 } | 3157 } |
3156 | 3158 |
3157 | 3159 |
3158 #undef __ | 3160 #undef __ |
3159 | 3161 |
3160 | 3162 |
3161 } } // namespace v8::internal | 3163 } } // namespace v8::internal |
3162 | 3164 |
3163 #endif // V8_TARGET_ARCH_X64 | 3165 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |