| 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 4420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4431 NilValue nil) { | 4431 NilValue nil) { |
| 4432 Label materialize_true, materialize_false; | 4432 Label materialize_true, materialize_false; |
| 4433 Label* if_true = NULL; | 4433 Label* if_true = NULL; |
| 4434 Label* if_false = NULL; | 4434 Label* if_false = NULL; |
| 4435 Label* fall_through = NULL; | 4435 Label* fall_through = NULL; |
| 4436 context()->PrepareTest(&materialize_true, &materialize_false, | 4436 context()->PrepareTest(&materialize_true, &materialize_false, |
| 4437 &if_true, &if_false, &fall_through); | 4437 &if_true, &if_false, &fall_through); |
| 4438 | 4438 |
| 4439 VisitForAccumulatorValue(sub_expr); | 4439 VisitForAccumulatorValue(sub_expr); |
| 4440 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4440 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 4441 Handle<Object> nil_value = nil == kNullValue ? | 4441 |
| 4442 isolate()->factory()->null_value() : | 4442 EqualityKind kind = expr->op() == Token::EQ_STRICT |
| 4443 isolate()->factory()->undefined_value(); | 4443 ? kStrictEquality : kNonStrictEquality; |
| 4444 __ cmp(eax, nil_value); | 4444 Handle<Object> nil_value = nil == kNullValue |
| 4445 if (expr->op() == Token::EQ_STRICT) { | 4445 ? isolate()->factory()->null_value() |
| 4446 : isolate()->factory()->undefined_value(); |
| 4447 if (kind == kStrictEquality) { |
| 4448 __ cmp(eax, nil_value); |
| 4446 Split(equal, if_true, if_false, fall_through); | 4449 Split(equal, if_true, if_false, fall_through); |
| 4447 } else { | 4450 } else { |
| 4448 Handle<Object> other_nil_value = nil == kNullValue ? | 4451 Handle<Code> ic = CompareNilICStub::GetUninitialized(isolate(), |
| 4449 isolate()->factory()->undefined_value() : | 4452 kNonStrictEquality, |
| 4450 isolate()->factory()->null_value(); | 4453 nil); |
| 4451 __ j(equal, if_true); | 4454 CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId()); |
| 4452 __ cmp(eax, other_nil_value); | 4455 __ test(eax, eax); |
| 4453 __ j(equal, if_true); | |
| 4454 __ JumpIfSmi(eax, if_false); | |
| 4455 // It can be an undetectable object. | |
| 4456 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); | |
| 4457 __ movzx_b(edx, FieldOperand(edx, Map::kBitFieldOffset)); | |
| 4458 __ test(edx, Immediate(1 << Map::kIsUndetectable)); | |
| 4459 Split(not_zero, if_true, if_false, fall_through); | 4456 Split(not_zero, if_true, if_false, fall_through); |
| 4460 } | 4457 } |
| 4461 context()->Plug(if_true, if_false); | 4458 context()->Plug(if_true, if_false); |
| 4462 } | 4459 } |
| 4463 | 4460 |
| 4464 | 4461 |
| 4465 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 4462 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
| 4466 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 4463 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 4467 context()->Plug(eax); | 4464 context()->Plug(eax); |
| 4468 } | 4465 } |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4600 *stack_depth = 0; | 4597 *stack_depth = 0; |
| 4601 *context_length = 0; | 4598 *context_length = 0; |
| 4602 return previous_; | 4599 return previous_; |
| 4603 } | 4600 } |
| 4604 | 4601 |
| 4605 #undef __ | 4602 #undef __ |
| 4606 | 4603 |
| 4607 } } // namespace v8::internal | 4604 } } // namespace v8::internal |
| 4608 | 4605 |
| 4609 #endif // V8_TARGET_ARCH_IA32 | 4606 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |