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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
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 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2544 // a0 : number of arguments to the construct function | 2544 // a0 : number of arguments to the construct function |
2545 // a2 : Feedback vector | 2545 // a2 : Feedback vector |
2546 // a3 : slot in feedback vector (Smi) | 2546 // a3 : slot in feedback vector (Smi) |
2547 // a1 : the function to call | 2547 // a1 : the function to call |
2548 FrameScope scope(masm, StackFrame::INTERNAL); | 2548 FrameScope scope(masm, StackFrame::INTERNAL); |
2549 const RegList kSavedRegs = 1 << 4 | // a0 | 2549 const RegList kSavedRegs = 1 << 4 | // a0 |
2550 1 << 5 | // a1 | 2550 1 << 5 | // a1 |
2551 1 << 6 | // a2 | 2551 1 << 6 | // a2 |
2552 1 << 7; // a3 | 2552 1 << 7; // a3 |
2553 | 2553 |
2554 // Arguments register must be smi-tagged to call out. | 2554 // Number-of-arguments register must be smi-tagged to call out. |
2555 __ SmiTag(a0); | 2555 __ SmiTag(a0); |
2556 __ MultiPush(kSavedRegs); | 2556 __ MultiPush(kSavedRegs); |
2557 | 2557 |
2558 __ CallStub(stub); | 2558 __ CallStub(stub); |
2559 | 2559 |
2560 __ MultiPop(kSavedRegs); | 2560 __ MultiPop(kSavedRegs); |
2561 __ SmiUntag(a0); | 2561 __ SmiUntag(a0); |
2562 } | 2562 } |
2563 | 2563 |
2564 | 2564 |
(...skipping 12 matching lines...) Expand all Loading... |
2577 DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()), | 2577 DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()), |
2578 masm->isolate()->heap()->uninitialized_symbol()); | 2578 masm->isolate()->heap()->uninitialized_symbol()); |
2579 | 2579 |
2580 // Load the cache state into a4. | 2580 // Load the cache state into a4. |
2581 __ dsrl(a4, a3, 32 - kPointerSizeLog2); | 2581 __ dsrl(a4, a3, 32 - kPointerSizeLog2); |
2582 __ Daddu(a4, a2, Operand(a4)); | 2582 __ Daddu(a4, a2, Operand(a4)); |
2583 __ ld(a4, FieldMemOperand(a4, FixedArray::kHeaderSize)); | 2583 __ ld(a4, FieldMemOperand(a4, FixedArray::kHeaderSize)); |
2584 | 2584 |
2585 // A monomorphic cache hit or an already megamorphic state: invoke the | 2585 // A monomorphic cache hit or an already megamorphic state: invoke the |
2586 // function without changing the state. | 2586 // function without changing the state. |
| 2587 // We don't know if a4 is a WeakCell or a Symbol, but it's harmless to read at |
| 2588 // this position in a symbol (see static asserts in type-feedback-vector.h). |
2587 Label check_allocation_site; | 2589 Label check_allocation_site; |
2588 Register feedback_map = a5; | 2590 Register feedback_map = a5; |
2589 Register weak_value = t0; | 2591 Register weak_value = t0; |
2590 __ ld(weak_value, FieldMemOperand(a4, WeakCell::kValueOffset)); | 2592 __ ld(weak_value, FieldMemOperand(a4, WeakCell::kValueOffset)); |
2591 __ Branch(&done, eq, a1, Operand(weak_value)); | 2593 __ Branch(&done, eq, a1, Operand(weak_value)); |
2592 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); | 2594 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
2593 __ Branch(&done, eq, a4, Operand(at)); | 2595 __ Branch(&done, eq, a4, Operand(at)); |
2594 __ ld(feedback_map, FieldMemOperand(a4, 0)); | 2596 __ ld(feedback_map, FieldMemOperand(a4, HeapObject::kMapOffset)); |
2595 __ LoadRoot(at, Heap::kWeakCellMapRootIndex); | 2597 __ LoadRoot(at, Heap::kWeakCellMapRootIndex); |
2596 __ Branch(FLAG_pretenuring_call_new ? &miss : &check_allocation_site, ne, | 2598 __ Branch(FLAG_pretenuring_call_new ? &miss : &check_allocation_site, ne, |
2597 feedback_map, Operand(at)); | 2599 feedback_map, Operand(at)); |
2598 | 2600 |
2599 // If a1 is not equal to the weak cell value, and the weak cell value is | 2601 // If the weak cell is cleared, we have a new chance to become monomorphic. |
2600 // cleared, we have a new chance to become monomorphic. | |
2601 __ JumpIfSmi(weak_value, &initialize); | 2602 __ JumpIfSmi(weak_value, &initialize); |
2602 __ jmp(&megamorphic); | 2603 __ jmp(&megamorphic); |
2603 | 2604 |
2604 if (!FLAG_pretenuring_call_new) { | 2605 if (!FLAG_pretenuring_call_new) { |
2605 __ bind(&check_allocation_site); | 2606 __ bind(&check_allocation_site); |
2606 // If we came here, we need to see if we are the array function. | 2607 // If we came here, we need to see if we are the array function. |
2607 // If we didn't have a matching function, and we didn't find the megamorph | 2608 // If we didn't have a matching function, and we didn't find the megamorph |
2608 // sentinel, then we have in the slot either some other function or an | 2609 // sentinel, then we have in the slot either some other function or an |
2609 // AllocationSite. Do a map check on the object in a3. | 2610 // AllocationSite. |
2610 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); | 2611 __ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
2611 __ Branch(&miss, ne, feedback_map, Operand(at)); | 2612 __ Branch(&miss, ne, feedback_map, Operand(at)); |
2612 | 2613 |
2613 // Make sure the function is the Array() function | 2614 // Make sure the function is the Array() function |
2614 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, a4); | 2615 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, a4); |
2615 __ Branch(&megamorphic, ne, a1, Operand(a4)); | 2616 __ Branch(&megamorphic, ne, a1, Operand(a4)); |
2616 __ jmp(&done); | 2617 __ jmp(&done); |
2617 } | 2618 } |
2618 | 2619 |
2619 __ bind(&miss); | 2620 __ bind(&miss); |
(...skipping 2937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5557 kStackUnwindSpace, kInvalidStackOffset, | 5558 kStackUnwindSpace, kInvalidStackOffset, |
5558 MemOperand(fp, 6 * kPointerSize), NULL); | 5559 MemOperand(fp, 6 * kPointerSize), NULL); |
5559 } | 5560 } |
5560 | 5561 |
5561 | 5562 |
5562 #undef __ | 5563 #undef __ |
5563 | 5564 |
5564 } } // namespace v8::internal | 5565 } } // namespace v8::internal |
5565 | 5566 |
5566 #endif // V8_TARGET_ARCH_MIPS64 | 5567 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |