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 3004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3015 VisitForValue(expr->right(), kAccumulator); | 3015 VisitForValue(expr->right(), kAccumulator); |
3016 EmitBinaryOp(expr->op(), context_); | 3016 EmitBinaryOp(expr->op(), context_); |
3017 break; | 3017 break; |
3018 | 3018 |
3019 default: | 3019 default: |
3020 UNREACHABLE(); | 3020 UNREACHABLE(); |
3021 } | 3021 } |
3022 } | 3022 } |
3023 | 3023 |
3024 | 3024 |
3025 void FullCodeGenerator::EmitNullCompare(bool strict, | 3025 void FullCodeGenerator::EmitNullCompare(bool strict, |
3026 Register obj, | 3026 Register obj, |
3027 Register null_const, | 3027 Register null_const, |
3028 Label* if_true, | 3028 Label* if_true, |
3029 Label* if_false, | 3029 Label* if_false, |
3030 Register scratch) { | 3030 Register scratch) { |
3031 __ cmpq(obj, null_const); | 3031 __ cmpq(obj, null_const); |
3032 if (strict) { | 3032 if (strict) { |
3033 __ j(equal, if_true); | 3033 __ j(equal, if_true); |
3034 } else { | 3034 } else { |
3035 __ j(equal, if_true); | 3035 __ j(equal, if_true); |
3036 __ CompareRoot(obj, Heap::kUndefinedValueRootIndex); | 3036 __ CompareRoot(obj, Heap::kUndefinedValueRootIndex); |
3037 __ j(equal, if_true); | 3037 __ j(equal, if_true); |
3038 __ JumpIfSmi(obj, if_false); | 3038 __ JumpIfSmi(obj, if_false); |
3039 // It can be an undetectable object. | 3039 // It can be an undetectable object. |
3040 __ movq(scratch, FieldOperand(obj, HeapObject::kMapOffset)); | 3040 __ movq(scratch, FieldOperand(obj, HeapObject::kMapOffset)); |
3041 __ testb(FieldOperand(scratch, Map::kBitFieldOffset), | 3041 __ testb(FieldOperand(scratch, Map::kBitFieldOffset), |
3042 Immediate(1 << Map::kIsUndetectable)); | 3042 Immediate(1 << Map::kIsUndetectable)); |
3043 __ j(not_zero, if_true); | 3043 __ j(not_zero, if_true); |
3044 } | 3044 } |
3045 __ jmp(if_false); | 3045 __ jmp(if_false); |
3046 } | 3046 } |
3047 | |
3048 | 3047 |
3049 | 3048 |
3050 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 3049 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
3051 Comment cmnt(masm_, "[ CompareOperation"); | 3050 Comment cmnt(masm_, "[ CompareOperation"); |
3052 | 3051 |
3053 // Always perform the comparison for its control flow. Pack the result | 3052 // Always perform the comparison for its control flow. Pack the result |
3054 // into the expression's context after the comparison is performed. | 3053 // into the expression's context after the comparison is performed. |
3055 Label materialize_true, materialize_false; | 3054 Label materialize_true, materialize_false; |
3056 Label* if_true = NULL; | 3055 Label* if_true = NULL; |
3057 Label* if_false = NULL; | 3056 Label* if_false = NULL; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3208 __ ret(0); | 3207 __ ret(0); |
3209 } | 3208 } |
3210 | 3209 |
3211 | 3210 |
3212 #undef __ | 3211 #undef __ |
3213 | 3212 |
3214 | 3213 |
3215 } } // namespace v8::internal | 3214 } } // namespace v8::internal |
3216 | 3215 |
3217 #endif // V8_TARGET_ARCH_X64 | 3216 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |