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 3443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3454 void InstanceofStub::Generate(MacroAssembler* masm) { | 3454 void InstanceofStub::Generate(MacroAssembler* masm) { |
3455 // Implements "value instanceof function" operator. | 3455 // Implements "value instanceof function" operator. |
3456 // Expected input state: | 3456 // Expected input state: |
3457 // rsp[0] : return address | 3457 // rsp[0] : return address |
3458 // rsp[1] : function pointer | 3458 // rsp[1] : function pointer |
3459 // rsp[2] : value | 3459 // rsp[2] : value |
3460 // Returns a bitwise zero to indicate that the value | 3460 // Returns a bitwise zero to indicate that the value |
3461 // is and instance of the function and anything else to | 3461 // is and instance of the function and anything else to |
3462 // indicate that the value is not an instance. | 3462 // indicate that the value is not an instance. |
3463 | 3463 |
3464 // None of the flags is supported on X64. | |
Rico
2011/02/16 14:43:25
is -> are
William Hesse
2011/02/16 15:15:06
Done.
| |
3465 ASSERT(flags_ == kNoFlags); | |
3466 | |
3464 // Get the object - go slow case if it's a smi. | 3467 // Get the object - go slow case if it's a smi. |
3465 Label slow; | 3468 Label slow; |
3466 __ movq(rax, Operand(rsp, 2 * kPointerSize)); | 3469 __ movq(rax, Operand(rsp, 2 * kPointerSize)); |
3467 __ JumpIfSmi(rax, &slow); | 3470 __ JumpIfSmi(rax, &slow); |
3468 | 3471 |
3469 // Check that the left hand is a JS object. Leave its map in rax. | 3472 // Check that the left hand is a JS object. Leave its map in rax. |
3470 __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rax); | 3473 __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rax); |
3471 __ j(below, &slow); | 3474 __ j(below, &slow); |
3472 __ CmpInstanceType(rax, LAST_JS_OBJECT_TYPE); | 3475 __ CmpInstanceType(rax, LAST_JS_OBJECT_TYPE); |
3473 __ j(above, &slow); | 3476 __ j(above, &slow); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3529 // We have to store a non-zero value in the cache. | 3532 // We have to store a non-zero value in the cache. |
3530 __ StoreRoot(kScratchRegister, Heap::kInstanceofCacheAnswerRootIndex); | 3533 __ StoreRoot(kScratchRegister, Heap::kInstanceofCacheAnswerRootIndex); |
3531 __ ret(2 * kPointerSize); | 3534 __ ret(2 * kPointerSize); |
3532 | 3535 |
3533 // Slow-case: Go through the JavaScript implementation. | 3536 // Slow-case: Go through the JavaScript implementation. |
3534 __ bind(&slow); | 3537 __ bind(&slow); |
3535 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 3538 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
3536 } | 3539 } |
3537 | 3540 |
3538 | 3541 |
3539 Register InstanceofStub::left() { return rax; } | 3542 // Passing arguments in registers is not supported. |
3543 Register InstanceofStub::left() { return no_reg; } | |
3540 | 3544 |
3541 | 3545 |
3542 Register InstanceofStub::right() { return rdx; } | 3546 Register InstanceofStub::right() { return no_reg; } |
3543 | 3547 |
3544 | 3548 |
3545 int CompareStub::MinorKey() { | 3549 int CompareStub::MinorKey() { |
3546 // Encode the three parameters in a unique 16 bit value. To avoid duplicate | 3550 // Encode the three parameters in a unique 16 bit value. To avoid duplicate |
3547 // stubs the never NaN NaN condition is only taken into account if the | 3551 // stubs the never NaN NaN condition is only taken into account if the |
3548 // condition is equals. | 3552 // condition is equals. |
3549 ASSERT(static_cast<unsigned>(cc_) < (1 << 12)); | 3553 ASSERT(static_cast<unsigned>(cc_) < (1 << 12)); |
3550 ASSERT(lhs_.is(no_reg) && rhs_.is(no_reg)); | 3554 ASSERT(lhs_.is(no_reg) && rhs_.is(no_reg)); |
3551 return ConditionField::encode(static_cast<unsigned>(cc_)) | 3555 return ConditionField::encode(static_cast<unsigned>(cc_)) |
3552 | RegisterField::encode(false) // lhs_ and rhs_ are not used | 3556 | RegisterField::encode(false) // lhs_ and rhs_ are not used |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4818 FieldOperand(elements, PixelArray::kExternalPointerOffset)); | 4822 FieldOperand(elements, PixelArray::kExternalPointerOffset)); |
4819 __ movb(Operand(external_pointer, untagged_key, times_1, 0), untagged_value); | 4823 __ movb(Operand(external_pointer, untagged_key, times_1, 0), untagged_value); |
4820 __ ret(0); // Return value in eax. | 4824 __ ret(0); // Return value in eax. |
4821 } | 4825 } |
4822 | 4826 |
4823 #undef __ | 4827 #undef __ |
4824 | 4828 |
4825 } } // namespace v8::internal | 4829 } } // namespace v8::internal |
4826 | 4830 |
4827 #endif // V8_TARGET_ARCH_X64 | 4831 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |