OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 3574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3585 __ CompareRoot(cached_map, Heap::kUndefinedValueRootIndex); | 3585 __ CompareRoot(cached_map, Heap::kUndefinedValueRootIndex); |
3586 __ j(not_equal, &transition_call); | 3586 __ j(not_equal, &transition_call); |
3587 __ mov(feedback, FieldOperand(feedback, counter, times_half_pointer_size, | 3587 __ mov(feedback, FieldOperand(feedback, counter, times_half_pointer_size, |
3588 FixedArray::kHeaderSize + 2 * kPointerSize)); | 3588 FixedArray::kHeaderSize + 2 * kPointerSize)); |
3589 __ pop(key); | 3589 __ pop(key); |
3590 __ pop(vector); | 3590 __ pop(vector); |
3591 __ pop(receiver); | 3591 __ pop(receiver); |
3592 __ lea(feedback, FieldOperand(feedback, Code::kHeaderSize)); | 3592 __ lea(feedback, FieldOperand(feedback, Code::kHeaderSize)); |
3593 __ mov(Operand::StaticVariable(virtual_register), feedback); | 3593 __ mov(Operand::StaticVariable(virtual_register), feedback); |
3594 __ pop(value); | 3594 __ pop(value); |
| 3595 |
| 3596 // Call store handler using StoreWithVectorDescriptor calling convention. |
3595 __ jmp(Operand::StaticVariable(virtual_register)); | 3597 __ jmp(Operand::StaticVariable(virtual_register)); |
3596 | 3598 |
3597 __ bind(&transition_call); | 3599 __ bind(&transition_call); |
3598 // Current stack layout: | 3600 // Current stack layout: |
3599 // - esp[0] -- key | 3601 // - esp[0] -- key |
3600 // - esp[4] -- vector | 3602 // - esp[4] -- vector |
3601 // - esp[8] -- receiver | 3603 // - esp[8] -- receiver |
3602 // - esp[12] -- value | 3604 // - esp[12] -- value |
3603 // - esp[16] -- return address | 3605 // - esp[16] -- return address |
3604 // | 3606 // |
3605 // Required stack layout for handler call: | 3607 // Required stack layout for handler call: |
3606 // - esp[0] -- return address | 3608 // - esp[0] -- return address |
3607 // - receiver, key, value, map, vector in registers. | 3609 // - receiver, key, value, map, vector in registers. |
3608 // - handler and slot in virtual registers. | 3610 // - handler and slot in virtual registers. |
3609 __ mov(Operand::StaticVariable(virtual_slot), slot); | 3611 __ mov(Operand::StaticVariable(virtual_slot), slot); |
3610 __ mov(feedback, FieldOperand(feedback, counter, times_half_pointer_size, | 3612 __ mov(feedback, FieldOperand(feedback, counter, times_half_pointer_size, |
3611 FixedArray::kHeaderSize + 2 * kPointerSize)); | 3613 FixedArray::kHeaderSize + 2 * kPointerSize)); |
3612 __ lea(feedback, FieldOperand(feedback, Code::kHeaderSize)); | 3614 __ lea(feedback, FieldOperand(feedback, Code::kHeaderSize)); |
3613 __ mov(Operand::StaticVariable(virtual_register), feedback); | 3615 __ mov(Operand::StaticVariable(virtual_register), feedback); |
3614 | 3616 |
3615 __ mov(cached_map, FieldOperand(cached_map, WeakCell::kValueOffset)); | 3617 __ mov(cached_map, FieldOperand(cached_map, WeakCell::kValueOffset)); |
3616 // The weak cell may have been cleared. | 3618 // The weak cell may have been cleared. |
3617 __ JumpIfSmi(cached_map, &pop_and_miss); | 3619 __ JumpIfSmi(cached_map, &pop_and_miss); |
3618 DCHECK(!cached_map.is(VectorStoreTransitionDescriptor::MapRegister())); | 3620 DCHECK(!cached_map.is(StoreTransitionDescriptor::MapRegister())); |
3619 __ mov(VectorStoreTransitionDescriptor::MapRegister(), cached_map); | 3621 __ mov(StoreTransitionDescriptor::MapRegister(), cached_map); |
3620 | 3622 |
3621 // Pop key into place. | 3623 // Call store transition handler using StoreTransitionDescriptor calling |
| 3624 // convention. |
3622 __ pop(key); | 3625 __ pop(key); |
3623 __ pop(vector); | 3626 __ pop(vector); |
3624 __ pop(receiver); | 3627 __ pop(receiver); |
3625 __ pop(value); | 3628 __ pop(value); |
| 3629 { |
| 3630 // Put vector and slot beneath return address. |
| 3631 __ push(vector); |
| 3632 __ push(Operand(esp, 1 * kPointerSize)); // push return address |
| 3633 __ mov(Operand(esp, 2 * kPointerSize), slot); |
| 3634 } |
3626 __ jmp(Operand::StaticVariable(virtual_register)); | 3635 __ jmp(Operand::StaticVariable(virtual_register)); |
3627 | 3636 |
3628 __ bind(&prepare_next); | 3637 __ bind(&prepare_next); |
3629 __ add(counter, Immediate(Smi::FromInt(3))); | 3638 __ add(counter, Immediate(Smi::FromInt(3))); |
3630 __ cmp(counter, FieldOperand(feedback, FixedArray::kLengthOffset)); | 3639 __ cmp(counter, FieldOperand(feedback, FixedArray::kLengthOffset)); |
3631 __ j(less, &next_loop); | 3640 __ j(less, &next_loop); |
3632 | 3641 |
3633 // We exhausted our array of map handler pairs. | 3642 // We exhausted our array of map handler pairs. |
3634 __ bind(&pop_and_miss); | 3643 __ bind(&pop_and_miss); |
3635 __ pop(key); | 3644 __ pop(key); |
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5241 kStackUnwindSpace, nullptr, return_value_operand, | 5250 kStackUnwindSpace, nullptr, return_value_operand, |
5242 NULL); | 5251 NULL); |
5243 } | 5252 } |
5244 | 5253 |
5245 #undef __ | 5254 #undef __ |
5246 | 5255 |
5247 } // namespace internal | 5256 } // namespace internal |
5248 } // namespace v8 | 5257 } // namespace v8 |
5249 | 5258 |
5250 #endif // V8_TARGET_ARCH_X87 | 5259 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |