| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4078 Split(cond, if_true, if_false, fall_through); | 4078 Split(cond, if_true, if_false, fall_through); |
| 4079 } | 4079 } |
| 4080 } | 4080 } |
| 4081 | 4081 |
| 4082 // Convert the result of the comparison into one expected for this | 4082 // Convert the result of the comparison into one expected for this |
| 4083 // expression's context. | 4083 // expression's context. |
| 4084 context()->Plug(if_true, if_false); | 4084 context()->Plug(if_true, if_false); |
| 4085 } | 4085 } |
| 4086 | 4086 |
| 4087 | 4087 |
| 4088 void FullCodeGenerator::VisitCompareToNull(CompareToNull* expr) { | 4088 void FullCodeGenerator::EmitLiteralCompareNull(Expression* expr, |
| 4089 Comment cmnt(masm_, "[ CompareToNull"); | 4089 bool is_strict, |
| 4090 Label materialize_true, materialize_false; | 4090 Label* if_true, |
| 4091 Label* if_true = NULL; | 4091 Label* if_false, |
| 4092 Label* if_false = NULL; | 4092 Label* fall_through) { |
| 4093 Label* fall_through = NULL; | 4093 VisitForAccumulatorValue(expr); |
| 4094 context()->PrepareTest(&materialize_true, &materialize_false, | |
| 4095 &if_true, &if_false, &fall_through); | |
| 4096 | |
| 4097 VisitForAccumulatorValue(expr->expression()); | |
| 4098 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); | 4094 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); |
| 4099 __ LoadRoot(r1, Heap::kNullValueRootIndex); | 4095 __ LoadRoot(r1, Heap::kNullValueRootIndex); |
| 4100 __ cmp(r0, r1); | 4096 __ cmp(r0, r1); |
| 4101 if (expr->is_strict()) { | 4097 if (is_strict) { |
| 4102 Split(eq, if_true, if_false, fall_through); | 4098 Split(eq, if_true, if_false, fall_through); |
| 4103 } else { | 4099 } else { |
| 4104 __ b(eq, if_true); | 4100 __ b(eq, if_true); |
| 4105 __ LoadRoot(r1, Heap::kUndefinedValueRootIndex); | 4101 __ LoadRoot(r1, Heap::kUndefinedValueRootIndex); |
| 4106 __ cmp(r0, r1); | 4102 __ cmp(r0, r1); |
| 4107 __ b(eq, if_true); | 4103 __ b(eq, if_true); |
| 4108 __ JumpIfSmi(r0, if_false); | 4104 __ JumpIfSmi(r0, if_false); |
| 4109 // It can be an undetectable object. | 4105 // It can be an undetectable object. |
| 4110 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); | 4106 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); |
| 4111 __ ldrb(r1, FieldMemOperand(r1, Map::kBitFieldOffset)); | 4107 __ ldrb(r1, FieldMemOperand(r1, Map::kBitFieldOffset)); |
| 4112 __ and_(r1, r1, Operand(1 << Map::kIsUndetectable)); | 4108 __ and_(r1, r1, Operand(1 << Map::kIsUndetectable)); |
| 4113 __ cmp(r1, Operand(1 << Map::kIsUndetectable)); | 4109 __ cmp(r1, Operand(1 << Map::kIsUndetectable)); |
| 4114 Split(eq, if_true, if_false, fall_through); | 4110 Split(eq, if_true, if_false, fall_through); |
| 4115 } | 4111 } |
| 4116 context()->Plug(if_true, if_false); | |
| 4117 } | 4112 } |
| 4118 | 4113 |
| 4119 | 4114 |
| 4120 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 4115 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
| 4121 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4116 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 4122 context()->Plug(r0); | 4117 context()->Plug(r0); |
| 4123 } | 4118 } |
| 4124 | 4119 |
| 4125 | 4120 |
| 4126 Register FullCodeGenerator::result_register() { | 4121 Register FullCodeGenerator::result_register() { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4219 *context_length = 0; | 4214 *context_length = 0; |
| 4220 return previous_; | 4215 return previous_; |
| 4221 } | 4216 } |
| 4222 | 4217 |
| 4223 | 4218 |
| 4224 #undef __ | 4219 #undef __ |
| 4225 | 4220 |
| 4226 } } // namespace v8::internal | 4221 } } // namespace v8::internal |
| 4227 | 4222 |
| 4228 #endif // V8_TARGET_ARCH_ARM | 4223 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |