OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2736 matching lines...) Loading... |
2747 __ movq(kScratchRegister, StackOperandForReturnAddress(0)); | 2747 __ movq(kScratchRegister, StackOperandForReturnAddress(0)); |
2748 __ subp(kScratchRegister, args.GetArgumentOperand(2)); | 2748 __ subp(kScratchRegister, args.GetArgumentOperand(2)); |
2749 if (FLAG_debug_code) { | 2749 if (FLAG_debug_code) { |
2750 __ movl(scratch, Immediate(kWordBeforeMapCheckValue)); | 2750 __ movl(scratch, Immediate(kWordBeforeMapCheckValue)); |
2751 __ cmpl(Operand(kScratchRegister, kOffsetToMapCheckValue - 4), scratch); | 2751 __ cmpl(Operand(kScratchRegister, kOffsetToMapCheckValue - 4), scratch); |
2752 __ Assert(equal, kInstanceofStubUnexpectedCallSiteCacheCheck); | 2752 __ Assert(equal, kInstanceofStubUnexpectedCallSiteCacheCheck); |
2753 } | 2753 } |
2754 __ movp(kScratchRegister, | 2754 __ movp(kScratchRegister, |
2755 Operand(kScratchRegister, kOffsetToMapCheckValue)); | 2755 Operand(kScratchRegister, kOffsetToMapCheckValue)); |
2756 __ movp(Operand(kScratchRegister, 0), map); | 2756 __ movp(Operand(kScratchRegister, 0), map); |
2757 | |
2758 __ movp(r8, map); | |
2759 // Scratch points at the cell payload. Calculate the start of the object. | |
2760 __ subp(kScratchRegister, Immediate(Cell::kValueOffset - 1)); | |
2761 __ RecordWriteField(kScratchRegister, Cell::kValueOffset, r8, function, | |
2762 kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | |
2763 } | 2757 } |
2764 | 2758 |
2765 // Loop through the prototype chain looking for the function prototype. | 2759 // Loop through the prototype chain looking for the function prototype. |
2766 __ movp(scratch, FieldOperand(map, Map::kPrototypeOffset)); | 2760 __ movp(scratch, FieldOperand(map, Map::kPrototypeOffset)); |
2767 Label loop, is_instance, is_not_instance; | 2761 Label loop, is_instance, is_not_instance; |
2768 __ LoadRoot(kScratchRegister, Heap::kNullValueRootIndex); | 2762 __ LoadRoot(kScratchRegister, Heap::kNullValueRootIndex); |
2769 __ bind(&loop); | 2763 __ bind(&loop); |
2770 __ cmpp(scratch, prototype); | 2764 __ cmpp(scratch, prototype); |
2771 __ j(equal, &is_instance, Label::kNear); | 2765 __ j(equal, &is_instance, Label::kNear); |
2772 __ cmpp(scratch, kScratchRegister); | 2766 __ cmpp(scratch, kScratchRegister); |
(...skipping 2577 matching lines...) Loading... |
5350 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, | 5344 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, |
5351 kStackSpace, nullptr, return_value_operand, NULL); | 5345 kStackSpace, nullptr, return_value_operand, NULL); |
5352 } | 5346 } |
5353 | 5347 |
5354 | 5348 |
5355 #undef __ | 5349 #undef __ |
5356 | 5350 |
5357 } } // namespace v8::internal | 5351 } } // namespace v8::internal |
5358 | 5352 |
5359 #endif // V8_TARGET_ARCH_X64 | 5353 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |