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 2683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2694 } | 2694 } |
2695 | 2695 |
2696 default: | 2696 default: |
2697 UNREACHABLE(); | 2697 UNREACHABLE(); |
2698 } | 2698 } |
2699 } | 2699 } |
2700 | 2700 |
2701 | 2701 |
2702 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { | 2702 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
2703 Comment cmnt(masm_, "[ CountOperation"); | 2703 Comment cmnt(masm_, "[ CountOperation"); |
| 2704 SetSourcePosition(expr->position()); |
| 2705 |
2704 // Invalid left-hand sides are rewritten to have a 'throw ReferenceError' | 2706 // Invalid left-hand sides are rewritten to have a 'throw ReferenceError' |
2705 // as the left-hand side. | 2707 // as the left-hand side. |
2706 if (!expr->expression()->IsValidLeftHandSide()) { | 2708 if (!expr->expression()->IsValidLeftHandSide()) { |
2707 VisitForEffect(expr->expression()); | 2709 VisitForEffect(expr->expression()); |
2708 return; | 2710 return; |
2709 } | 2711 } |
2710 | 2712 |
2711 // Expression can only be a property, a global or a (parameter or local) | 2713 // Expression can only be a property, a global or a (parameter or local) |
2712 // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY. | 2714 // slot. Variables with rewrite to .arguments are treated as KEYED_PROPERTY. |
2713 enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; | 2715 enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2974 } else { | 2976 } else { |
2975 if (if_false != fall_through) __ jmp(if_false); | 2977 if (if_false != fall_through) __ jmp(if_false); |
2976 } | 2978 } |
2977 | 2979 |
2978 return true; | 2980 return true; |
2979 } | 2981 } |
2980 | 2982 |
2981 | 2983 |
2982 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 2984 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
2983 Comment cmnt(masm_, "[ CompareOperation"); | 2985 Comment cmnt(masm_, "[ CompareOperation"); |
| 2986 SetSourcePosition(expr->position()); |
2984 | 2987 |
2985 // Always perform the comparison for its control flow. Pack the result | 2988 // Always perform the comparison for its control flow. Pack the result |
2986 // into the expression's context after the comparison is performed. | 2989 // into the expression's context after the comparison is performed. |
2987 | 2990 |
2988 Label materialize_true, materialize_false; | 2991 Label materialize_true, materialize_false; |
2989 Label* if_true = NULL; | 2992 Label* if_true = NULL; |
2990 Label* if_false = NULL; | 2993 Label* if_false = NULL; |
2991 PrepareTest(&materialize_true, &materialize_false, &if_true, &if_false); | 2994 PrepareTest(&materialize_true, &materialize_false, &if_true, &if_false); |
2992 | 2995 |
2993 // First we try a fast inlined version of the compare when one of | 2996 // First we try a fast inlined version of the compare when one of |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3160 // And return. | 3163 // And return. |
3161 __ ret(0); | 3164 __ ret(0); |
3162 } | 3165 } |
3163 | 3166 |
3164 | 3167 |
3165 #undef __ | 3168 #undef __ |
3166 | 3169 |
3167 } } // namespace v8::internal | 3170 } } // namespace v8::internal |
3168 | 3171 |
3169 #endif // V8_TARGET_ARCH_IA32 | 3172 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |