Chromium Code Reviews| 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 2996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3007 Split(cc, if_true, if_false, NULL); | 3007 Split(cc, if_true, if_false, NULL); |
| 3008 } | 3008 } |
| 3009 } | 3009 } |
| 3010 | 3010 |
| 3011 // Convert the result of the comparison into one expected for this | 3011 // Convert the result of the comparison into one expected for this |
| 3012 // expression's context. | 3012 // expression's context. |
| 3013 Apply(context_, if_true, if_false); | 3013 Apply(context_, if_true, if_false); |
| 3014 } | 3014 } |
| 3015 | 3015 |
| 3016 | 3016 |
| 3017 void FullCodeGenerator::VisitCompareToNull(CompareToNull* expr) { | |
| 3018 Comment cmnt(masm_, "[ CompareToNull"); | |
| 3019 Label materialize_true, materialize_false; | |
|
Mads Ager (chromium)
2010/08/24 07:17:45
Indentation.
| |
| 3020 Label* if_true = NULL; | |
| 3021 Label* if_false = NULL; | |
| 3022 PrepareTest(&materialize_true, &materialize_false, &if_true, &if_false); | |
| 3023 | |
| 3024 VisitForValue(expr->expression(), kAccumulator); | |
| 3025 __ CompareRoot(rax, Heap::kNullValueRootIndex); | |
| 3026 if (expr->is_strict()) { | |
| 3027 Split(equal, if_true, if_false, NULL); | |
| 3028 } else { | |
| 3029 __ j(equal, if_true); | |
| 3030 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex); | |
| 3031 __ j(equal, if_true); | |
| 3032 Condition is_smi = masm_->CheckSmi(rax); | |
| 3033 __ j(is_smi, if_false); | |
| 3034 // It can be an undetectable object. | |
| 3035 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); | |
| 3036 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), | |
| 3037 Immediate(1 << Map::kIsUndetectable)); | |
| 3038 Split(not_zero, if_true, if_false, NULL); | |
| 3039 } | |
| 3040 Apply(context_, if_true, if_false); | |
| 3041 } | |
| 3042 | |
| 3043 | |
| 3017 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 3044 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
| 3018 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 3045 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 3019 Apply(context_, rax); | 3046 Apply(context_, rax); |
| 3020 } | 3047 } |
| 3021 | 3048 |
| 3022 | 3049 |
| 3023 Register FullCodeGenerator::result_register() { return rax; } | 3050 Register FullCodeGenerator::result_register() { return rax; } |
| 3024 | 3051 |
| 3025 | 3052 |
| 3026 Register FullCodeGenerator::context_register() { return rsi; } | 3053 Register FullCodeGenerator::context_register() { return rsi; } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3070 __ ret(0); | 3097 __ ret(0); |
| 3071 } | 3098 } |
| 3072 | 3099 |
| 3073 | 3100 |
| 3074 #undef __ | 3101 #undef __ |
| 3075 | 3102 |
| 3076 | 3103 |
| 3077 } } // namespace v8::internal | 3104 } } // namespace v8::internal |
| 3078 | 3105 |
| 3079 #endif // V8_TARGET_ARCH_X64 | 3106 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |