OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4430 NilValue nil) { | 4430 NilValue nil) { |
4431 Label materialize_true, materialize_false; | 4431 Label materialize_true, materialize_false; |
4432 Label* if_true = NULL; | 4432 Label* if_true = NULL; |
4433 Label* if_false = NULL; | 4433 Label* if_false = NULL; |
4434 Label* fall_through = NULL; | 4434 Label* fall_through = NULL; |
4435 context()->PrepareTest(&materialize_true, &materialize_false, | 4435 context()->PrepareTest(&materialize_true, &materialize_false, |
4436 &if_true, &if_false, &fall_through); | 4436 &if_true, &if_false, &fall_through); |
4437 | 4437 |
4438 VisitForAccumulatorValue(sub_expr); | 4438 VisitForAccumulatorValue(sub_expr); |
4439 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4439 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
4440 Heap::RootListIndex nil_value = nil == kNullValue ? | 4440 EqualityKind kind = expr->op() == Token::EQ_STRICT |
4441 Heap::kNullValueRootIndex : | 4441 ? kStrictEquality : kNonStrictEquality; |
4442 Heap::kUndefinedValueRootIndex; | 4442 if (kind == kStrictEquality) { |
4443 __ LoadRoot(r1, nil_value); | 4443 Heap::RootListIndex nil_value = nil == kNullValue ? |
4444 __ cmp(r0, r1); | 4444 Heap::kNullValueRootIndex : |
4445 if (expr->op() == Token::EQ_STRICT) { | 4445 Heap::kUndefinedValueRootIndex; |
| 4446 __ LoadRoot(r1, nil_value); |
| 4447 __ cmp(r0, r1); |
4446 Split(eq, if_true, if_false, fall_through); | 4448 Split(eq, if_true, if_false, fall_through); |
4447 } else { | 4449 } else { |
4448 Heap::RootListIndex other_nil_value = nil == kNullValue ? | 4450 Handle<Code> ic = CompareNilICStub::GetUninitialized(isolate(), |
4449 Heap::kUndefinedValueRootIndex : | 4451 kNonStrictEquality, |
4450 Heap::kNullValueRootIndex; | 4452 nil); |
4451 __ b(eq, if_true); | 4453 CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId()); |
4452 __ LoadRoot(r1, other_nil_value); | 4454 __ cmp(r0, Operand(0)); |
4453 __ cmp(r0, r1); | 4455 Split(ne, if_true, if_false, fall_through); |
4454 __ b(eq, if_true); | |
4455 __ JumpIfSmi(r0, if_false); | |
4456 // It can be an undetectable object. | |
4457 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); | |
4458 __ ldrb(r1, FieldMemOperand(r1, Map::kBitFieldOffset)); | |
4459 __ and_(r1, r1, Operand(1 << Map::kIsUndetectable)); | |
4460 __ cmp(r1, Operand(1 << Map::kIsUndetectable)); | |
4461 Split(eq, if_true, if_false, fall_through); | |
4462 } | 4456 } |
4463 context()->Plug(if_true, if_false); | 4457 context()->Plug(if_true, if_false); |
4464 } | 4458 } |
4465 | 4459 |
4466 | 4460 |
4467 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 4461 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
4468 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4462 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
4469 context()->Plug(r0); | 4463 context()->Plug(r0); |
4470 } | 4464 } |
4471 | 4465 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4610 *context_length = 0; | 4604 *context_length = 0; |
4611 return previous_; | 4605 return previous_; |
4612 } | 4606 } |
4613 | 4607 |
4614 | 4608 |
4615 #undef __ | 4609 #undef __ |
4616 | 4610 |
4617 } } // namespace v8::internal | 4611 } } // namespace v8::internal |
4618 | 4612 |
4619 #endif // V8_TARGET_ARCH_ARM | 4613 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |