| 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 4363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4374 NilValue nil) { | 4374 NilValue nil) { |
| 4375 Label materialize_true, materialize_false; | 4375 Label materialize_true, materialize_false; |
| 4376 Label* if_true = NULL; | 4376 Label* if_true = NULL; |
| 4377 Label* if_false = NULL; | 4377 Label* if_false = NULL; |
| 4378 Label* fall_through = NULL; | 4378 Label* fall_through = NULL; |
| 4379 context()->PrepareTest(&materialize_true, &materialize_false, | 4379 context()->PrepareTest(&materialize_true, &materialize_false, |
| 4380 &if_true, &if_false, &fall_through); | 4380 &if_true, &if_false, &fall_through); |
| 4381 | 4381 |
| 4382 VisitForAccumulatorValue(sub_expr); | 4382 VisitForAccumulatorValue(sub_expr); |
| 4383 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4383 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 4384 Heap::RootListIndex nil_value = nil == kNullValue ? | 4384 EqualityKind kind = expr->op() == Token::EQ_STRICT |
| 4385 Heap::kNullValueRootIndex : | 4385 ? kStrictEquality : kNonStrictEquality; |
| 4386 Heap::kUndefinedValueRootIndex; | 4386 if (kind == kStrictEquality) { |
| 4387 __ CompareRoot(rax, nil_value); | 4387 Heap::RootListIndex nil_value = nil == kNullValue ? |
| 4388 if (expr->op() == Token::EQ_STRICT) { | 4388 Heap::kNullValueRootIndex : |
| 4389 Heap::kUndefinedValueRootIndex; |
| 4390 __ CompareRoot(rax, nil_value); |
| 4389 Split(equal, if_true, if_false, fall_through); | 4391 Split(equal, if_true, if_false, fall_through); |
| 4390 } else { | 4392 } else { |
| 4391 Heap::RootListIndex other_nil_value = nil == kNullValue ? | 4393 __ Move(rcx, Smi::FromInt(kind)); |
| 4392 Heap::kUndefinedValueRootIndex : | 4394 __ Move(rbx, Smi::FromInt(nil)); |
| 4393 Heap::kNullValueRootIndex; | 4395 Handle<Code> ic = CompareNilIC::GetUninitialized(); |
| 4394 __ j(equal, if_true); | 4396 CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId()); |
| 4395 __ CompareRoot(rax, other_nil_value); | 4397 __ testq(rax, rax); |
| 4396 __ j(equal, if_true); | |
| 4397 __ JumpIfSmi(rax, if_false); | |
| 4398 // It can be an undetectable object. | |
| 4399 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset)); | |
| 4400 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), | |
| 4401 Immediate(1 << Map::kIsUndetectable)); | |
| 4402 Split(not_zero, if_true, if_false, fall_through); | 4398 Split(not_zero, if_true, if_false, fall_through); |
| 4403 } | 4399 } |
| 4404 context()->Plug(if_true, if_false); | 4400 context()->Plug(if_true, if_false); |
| 4405 } | 4401 } |
| 4406 | 4402 |
| 4407 | 4403 |
| 4408 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { | 4404 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
| 4409 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 4405 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 4410 context()->Plug(rax); | 4406 context()->Plug(rax); |
| 4411 } | 4407 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4547 *context_length = 0; | 4543 *context_length = 0; |
| 4548 return previous_; | 4544 return previous_; |
| 4549 } | 4545 } |
| 4550 | 4546 |
| 4551 | 4547 |
| 4552 #undef __ | 4548 #undef __ |
| 4553 | 4549 |
| 4554 } } // namespace v8::internal | 4550 } } // namespace v8::internal |
| 4555 | 4551 |
| 4556 #endif // V8_TARGET_ARCH_X64 | 4552 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |