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 4434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4445 NilValue nil) { | 4445 NilValue nil) { |
4446 Label materialize_true, materialize_false; | 4446 Label materialize_true, materialize_false; |
4447 Label* if_true = NULL; | 4447 Label* if_true = NULL; |
4448 Label* if_false = NULL; | 4448 Label* if_false = NULL; |
4449 Label* fall_through = NULL; | 4449 Label* fall_through = NULL; |
4450 context()->PrepareTest(&materialize_true, &materialize_false, | 4450 context()->PrepareTest(&materialize_true, &materialize_false, |
4451 &if_true, &if_false, &fall_through); | 4451 &if_true, &if_false, &fall_through); |
4452 | 4452 |
4453 VisitForAccumulatorValue(sub_expr); | 4453 VisitForAccumulatorValue(sub_expr); |
4454 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4454 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
4455 Heap::RootListIndex nil_value = nil == kNullValue ? | 4455 EqualityKind kind = expr->op() == Token::EQ_STRICT |
4456 Heap::kNullValueRootIndex : | 4456 ? kStrictEquality : kNonStrictEquality; |
4457 Heap::kUndefinedValueRootIndex; | |
4458 __ mov(a0, result_register()); | 4457 __ mov(a0, result_register()); |
4459 __ LoadRoot(a1, nil_value); | 4458 if (kind == kStrictEquality) { |
4460 if (expr->op() == Token::EQ_STRICT) { | 4459 Heap::RootListIndex nil_value = nil == kNullValue ? |
| 4460 Heap::kNullValueRootIndex : |
| 4461 Heap::kUndefinedValueRootIndex; |
| 4462 __ LoadRoot(a1, nil_value); |
4461 Split(eq, a0, Operand(a1), if_true, if_false, fall_through); | 4463 Split(eq, a0, Operand(a1), if_true, if_false, fall_through); |
4462 } else { | 4464 } else { |
4463 Heap::RootListIndex other_nil_value = nil == kNullValue ? | 4465 Handle<Code> ic = CompareNilICStub::GetUninitialized(isolate(), |
4464 Heap::kUndefinedValueRootIndex : | 4466 kNonStrictEquality, |
4465 Heap::kNullValueRootIndex; | 4467 nil); |
4466 __ Branch(if_true, eq, a0, Operand(a1)); | 4468 CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId()); |
4467 __ LoadRoot(a1, other_nil_value); | 4469 Split(ne, v0, Operand(zero_reg), if_true, if_false, fall_through); |
4468 __ Branch(if_true, eq, a0, Operand(a1)); | |
4469 __ JumpIfSmi(a0, if_false); | |
4470 // It can be an undetectable object. | |
4471 __ lw(a1, FieldMemOperand(a0, HeapObject::kMapOffset)); | |
4472 __ lbu(a1, FieldMemOperand(a1, Map::kBitFieldOffset)); | |
4473 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); | |
4474 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); | |
4475 } | 4470 } |
4476 context()->Plug(if_true, if_false); | 4471 context()->Plug(if_true, if_false); |
4477 } | 4472 } |
4478 | 4473 |
4479 | 4474 |
4480 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 4475 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
4481 __ lw(v0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4476 __ lw(v0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
4482 context()->Plug(v0); | 4477 context()->Plug(v0); |
4483 } | 4478 } |
4484 | 4479 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4624 *context_length = 0; | 4619 *context_length = 0; |
4625 return previous_; | 4620 return previous_; |
4626 } | 4621 } |
4627 | 4622 |
4628 | 4623 |
4629 #undef __ | 4624 #undef __ |
4630 | 4625 |
4631 } } // namespace v8::internal | 4626 } } // namespace v8::internal |
4632 | 4627 |
4633 #endif // V8_TARGET_ARCH_MIPS | 4628 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |