OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 3356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3367 HandleArrayCases(masm, feedback, receiver_map, scratch1, r10, false, &miss); | 3367 HandleArrayCases(masm, feedback, receiver_map, scratch1, r10, false, &miss); |
3368 | 3368 |
3369 __ bind(&miss); | 3369 __ bind(&miss); |
3370 KeyedLoadIC::GenerateMiss(masm); | 3370 KeyedLoadIC::GenerateMiss(masm); |
3371 | 3371 |
3372 __ bind(&load_smi_map); | 3372 __ bind(&load_smi_map); |
3373 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | 3373 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); |
3374 __ b(&compare_map); | 3374 __ b(&compare_map); |
3375 } | 3375 } |
3376 | 3376 |
3377 void StoreICTrampolineStub::Generate(MacroAssembler* masm) { | |
3378 __ EmitLoadTypeFeedbackVector(StoreWithVectorDescriptor::VectorRegister()); | |
3379 StoreICStub stub(isolate(), state()); | |
3380 stub.GenerateForTrampoline(masm); | |
3381 } | |
3382 | |
3383 void KeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { | 3377 void KeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { |
3384 __ EmitLoadTypeFeedbackVector(StoreWithVectorDescriptor::VectorRegister()); | 3378 __ EmitLoadTypeFeedbackVector(StoreWithVectorDescriptor::VectorRegister()); |
3385 KeyedStoreICStub stub(isolate(), state()); | 3379 KeyedStoreICStub stub(isolate(), state()); |
3386 stub.GenerateForTrampoline(masm); | 3380 stub.GenerateForTrampoline(masm); |
3387 } | 3381 } |
3388 | 3382 |
3389 void StoreICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } | |
3390 | |
3391 void StoreICStub::GenerateForTrampoline(MacroAssembler* masm) { | |
3392 GenerateImpl(masm, true); | |
3393 } | |
3394 | |
3395 void StoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { | |
3396 Register receiver = StoreWithVectorDescriptor::ReceiverRegister(); // r4 | |
3397 Register key = StoreWithVectorDescriptor::NameRegister(); // r5 | |
3398 Register vector = StoreWithVectorDescriptor::VectorRegister(); // r6 | |
3399 Register slot = StoreWithVectorDescriptor::SlotRegister(); // r7 | |
3400 DCHECK(StoreWithVectorDescriptor::ValueRegister().is(r3)); // r3 | |
3401 Register feedback = r8; | |
3402 Register receiver_map = r9; | |
3403 Register scratch1 = r10; | |
3404 | |
3405 __ SmiToPtrArrayOffset(r0, slot); | |
3406 __ add(feedback, vector, r0); | |
3407 __ LoadP(feedback, FieldMemOperand(feedback, FixedArray::kHeaderSize)); | |
3408 | |
3409 // Try to quickly handle the monomorphic case without knowing for sure | |
3410 // if we have a weak cell in feedback. We do know it's safe to look | |
3411 // at WeakCell::kValueOffset. | |
3412 Label try_array, load_smi_map, compare_map; | |
3413 Label not_array, miss; | |
3414 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot, | |
3415 scratch1, &compare_map, &load_smi_map, &try_array); | |
3416 | |
3417 // Is it a fixed array? | |
3418 __ bind(&try_array); | |
3419 __ LoadP(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | |
3420 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); | |
3421 __ bne(¬_array); | |
3422 | |
3423 Register scratch2 = r11; | |
3424 HandleArrayCases(masm, feedback, receiver_map, scratch1, scratch2, true, | |
3425 &miss); | |
3426 | |
3427 __ bind(¬_array); | |
3428 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); | |
3429 __ bne(&miss); | |
3430 masm->isolate()->store_stub_cache()->GenerateProbe( | |
3431 masm, receiver, key, feedback, receiver_map, scratch1, scratch2); | |
3432 | |
3433 __ bind(&miss); | |
3434 StoreIC::GenerateMiss(masm); | |
3435 | |
3436 __ bind(&load_smi_map); | |
3437 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | |
3438 __ b(&compare_map); | |
3439 } | |
3440 | |
3441 void KeyedStoreICStub::Generate(MacroAssembler* masm) { | 3383 void KeyedStoreICStub::Generate(MacroAssembler* masm) { |
3442 GenerateImpl(masm, false); | 3384 GenerateImpl(masm, false); |
3443 } | 3385 } |
3444 | 3386 |
3445 void KeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { | 3387 void KeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { |
3446 GenerateImpl(masm, true); | 3388 GenerateImpl(masm, true); |
3447 } | 3389 } |
3448 | 3390 |
3449 | 3391 |
3450 static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register feedback, | 3392 static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register feedback, |
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5114 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | 5056 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
5115 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5057 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5116 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5058 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5117 } | 5059 } |
5118 | 5060 |
5119 #undef __ | 5061 #undef __ |
5120 } // namespace internal | 5062 } // namespace internal |
5121 } // namespace v8 | 5063 } // namespace v8 |
5122 | 5064 |
5123 #endif // V8_TARGET_ARCH_PPC | 5065 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |