Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: src/ppc/code-stubs-ppc.cc

Issue 1131783003: Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix debug-mode Arm issue. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | src/ppc/constants-ppc.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_PPC 7 #if V8_TARGET_ARCH_PPC
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm, 105 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm,
106 ExternalReference miss) { 106 ExternalReference miss) {
107 // Update the static counter each time a new code stub is generated. 107 // Update the static counter each time a new code stub is generated.
108 isolate()->counters()->code_stubs()->Increment(); 108 isolate()->counters()->code_stubs()->Increment();
109 109
110 CallInterfaceDescriptor descriptor = GetCallInterfaceDescriptor(); 110 CallInterfaceDescriptor descriptor = GetCallInterfaceDescriptor();
111 int param_count = descriptor.GetEnvironmentParameterCount(); 111 int param_count = descriptor.GetEnvironmentParameterCount();
112 { 112 {
113 // Call the runtime system in a fresh internal frame. 113 // Call the runtime system in a fresh internal frame.
114 FrameScope scope(masm, StackFrame::INTERNAL); 114 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
115 DCHECK(param_count == 0 || 115 DCHECK(param_count == 0 ||
116 r3.is(descriptor.GetEnvironmentParameterRegister(param_count - 1))); 116 r3.is(descriptor.GetEnvironmentParameterRegister(param_count - 1)));
117 // Push arguments 117 // Push arguments
118 for (int i = 0; i < param_count; ++i) { 118 for (int i = 0; i < param_count; ++i) {
119 __ push(descriptor.GetEnvironmentParameterRegister(i)); 119 __ push(descriptor.GetEnvironmentParameterRegister(i));
120 } 120 }
121 __ CallExternalReference(miss, param_count); 121 __ CallExternalReference(miss, param_count);
122 } 122 }
123 123
124 __ Ret(); 124 __ Ret();
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 1175
1176 // If the handler is a JS frame, restore the context to the frame. Note that 1176 // If the handler is a JS frame, restore the context to the frame. Note that
1177 // the context will be set to (cp == 0) for non-JS frames. 1177 // the context will be set to (cp == 0) for non-JS frames.
1178 Label skip; 1178 Label skip;
1179 __ cmpi(cp, Operand::Zero()); 1179 __ cmpi(cp, Operand::Zero());
1180 __ beq(&skip); 1180 __ beq(&skip);
1181 __ StoreP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 1181 __ StoreP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
1182 __ bind(&skip); 1182 __ bind(&skip);
1183 1183
1184 // Compute the handler entry address and jump to it. 1184 // Compute the handler entry address and jump to it.
1185 ConstantPoolUnavailableScope constant_pool_unavailable(masm);
1185 __ mov(r4, Operand(pending_handler_code_address)); 1186 __ mov(r4, Operand(pending_handler_code_address));
1186 __ LoadP(r4, MemOperand(r4)); 1187 __ LoadP(r4, MemOperand(r4));
1187 __ mov(r5, Operand(pending_handler_offset_address)); 1188 __ mov(r5, Operand(pending_handler_offset_address));
1188 __ LoadP(r5, MemOperand(r5)); 1189 __ LoadP(r5, MemOperand(r5));
1189 __ addi(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); // Code start 1190 __ addi(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); // Code start
1191 if (FLAG_enable_embedded_constant_pool) {
1192 __ LoadConstantPoolPointerRegisterFromCodeTargetAddress(r4);
1193 }
1190 __ add(ip, r4, r5); 1194 __ add(ip, r4, r5);
1191 __ Jump(ip); 1195 __ Jump(ip);
1192 } 1196 }
1193 1197
1194 1198
1195 void JSEntryStub::Generate(MacroAssembler* masm) { 1199 void JSEntryStub::Generate(MacroAssembler* masm) {
1196 // r3: code entry 1200 // r3: code entry
1197 // r4: function 1201 // r4: function
1198 // r5: receiver 1202 // r5: receiver
1199 // r6: argc 1203 // r6: argc
(...skipping 21 matching lines...) Expand all
1221 // __ lwz(r7, MemOperand(sp, offset_to_argv)); 1225 // __ lwz(r7, MemOperand(sp, offset_to_argv));
1222 1226
1223 // Push a frame with special values setup to mark it as an entry frame. 1227 // Push a frame with special values setup to mark it as an entry frame.
1224 // r3: code entry 1228 // r3: code entry
1225 // r4: function 1229 // r4: function
1226 // r5: receiver 1230 // r5: receiver
1227 // r6: argc 1231 // r6: argc
1228 // r7: argv 1232 // r7: argv
1229 __ li(r0, Operand(-1)); // Push a bad frame pointer to fail if it is used. 1233 __ li(r0, Operand(-1)); // Push a bad frame pointer to fail if it is used.
1230 __ push(r0); 1234 __ push(r0);
1235 if (FLAG_enable_embedded_constant_pool) {
1236 __ li(kConstantPoolRegister, Operand::Zero());
1237 __ push(kConstantPoolRegister);
1238 }
1231 int marker = type(); 1239 int marker = type();
1232 __ LoadSmiLiteral(r0, Smi::FromInt(marker)); 1240 __ LoadSmiLiteral(r0, Smi::FromInt(marker));
1233 __ push(r0); 1241 __ push(r0);
1234 __ push(r0); 1242 __ push(r0);
1235 // Save copies of the top frame descriptor on the stack. 1243 // Save copies of the top frame descriptor on the stack.
1236 __ mov(r8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); 1244 __ mov(r8, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate())));
1237 __ LoadP(r0, MemOperand(r8)); 1245 __ LoadP(r0, MemOperand(r8));
1238 __ push(r0); 1246 __ push(r0);
1239 1247
1240 // Set up frame pointer for the frame to be pushed. 1248 // Set up frame pointer for the frame to be pushed.
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 1543
1536 // Slow-case. Tail call builtin. 1544 // Slow-case. Tail call builtin.
1537 __ bind(&slow); 1545 __ bind(&slow);
1538 if (!ReturnTrueFalseObject()) { 1546 if (!ReturnTrueFalseObject()) {
1539 if (HasArgsInRegisters()) { 1547 if (HasArgsInRegisters()) {
1540 __ Push(r3, r4); 1548 __ Push(r3, r4);
1541 } 1549 }
1542 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 1550 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
1543 } else { 1551 } else {
1544 { 1552 {
1545 FrameScope scope(masm, StackFrame::INTERNAL); 1553 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
1546 __ Push(r3, r4); 1554 __ Push(r3, r4);
1547 __ InvokeBuiltin(Builtins::INSTANCE_OF, CALL_FUNCTION); 1555 __ InvokeBuiltin(Builtins::INSTANCE_OF, CALL_FUNCTION);
1548 } 1556 }
1549 if (CpuFeatures::IsSupported(ISELECT)) { 1557 if (CpuFeatures::IsSupported(ISELECT)) {
1550 __ cmpi(r3, Operand::Zero()); 1558 __ cmpi(r3, Operand::Zero());
1551 __ LoadRoot(r3, Heap::kTrueValueRootIndex); 1559 __ LoadRoot(r3, Heap::kTrueValueRootIndex);
1552 __ LoadRoot(r4, Heap::kFalseValueRootIndex); 1560 __ LoadRoot(r4, Heap::kFalseValueRootIndex);
1553 __ isel(eq, r3, r3, r4); 1561 __ isel(eq, r3, r3, r4);
1554 } else { 1562 } else {
1555 Label true_value, done; 1563 Label true_value, done;
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
2546 __ b(&check_underlying); // Go to (4). 2554 __ b(&check_underlying); // Go to (4).
2547 #endif // V8_INTERPRETED_REGEXP 2555 #endif // V8_INTERPRETED_REGEXP
2548 } 2556 }
2549 2557
2550 2558
2551 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { 2559 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) {
2552 // r3 : number of arguments to the construct function 2560 // r3 : number of arguments to the construct function
2553 // r5 : Feedback vector 2561 // r5 : Feedback vector
2554 // r6 : slot in feedback vector (Smi) 2562 // r6 : slot in feedback vector (Smi)
2555 // r4 : the function to call 2563 // r4 : the function to call
2556 FrameScope scope(masm, StackFrame::INTERNAL); 2564 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
2557 2565
2558 // Number-of-arguments register must be smi-tagged to call out. 2566 // Number-of-arguments register must be smi-tagged to call out.
2559 __ SmiTag(r3); 2567 __ SmiTag(r3);
2560 __ Push(r6, r5, r4, r3); 2568 __ Push(r6, r5, r4, r3);
2561 2569
2562 __ CallStub(stub); 2570 __ CallStub(stub);
2563 2571
2564 __ Pop(r6, r5, r4, r3); 2572 __ Pop(r6, r5, r4, r3);
2565 __ SmiUntag(r3); 2573 __ SmiUntag(r3);
2566 } 2574 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
2710 __ li(r5, Operand::Zero()); 2718 __ li(r5, Operand::Zero());
2711 __ GetBuiltinFunction(r4, Builtins::CALL_NON_FUNCTION); 2719 __ GetBuiltinFunction(r4, Builtins::CALL_NON_FUNCTION);
2712 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), 2720 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
2713 RelocInfo::CODE_TARGET); 2721 RelocInfo::CODE_TARGET);
2714 } 2722 }
2715 2723
2716 2724
2717 static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) { 2725 static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) {
2718 // Wrap the receiver and patch it back onto the stack. 2726 // Wrap the receiver and patch it back onto the stack.
2719 { 2727 {
2720 FrameScope frame_scope(masm, StackFrame::INTERNAL); 2728 FrameAndConstantPoolScope frame_scope(masm, StackFrame::INTERNAL);
2721 __ Push(r4, r6); 2729 __ Push(r4, r6);
2722 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 2730 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
2723 __ pop(r4); 2731 __ pop(r4);
2724 } 2732 }
2725 __ StoreP(r3, MemOperand(sp, argc * kPointerSize), r0); 2733 __ StoreP(r3, MemOperand(sp, argc * kPointerSize), r0);
2726 __ b(cont); 2734 __ b(cont);
2727 } 2735 }
2728 2736
2729 2737
2730 static void CallFunctionNoFeedback(MacroAssembler* masm, int argc, 2738 static void CallFunctionNoFeedback(MacroAssembler* masm, int argc,
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
3028 // Update stats. 3036 // Update stats.
3029 __ LoadP(r7, FieldMemOperand(r5, with_types_offset)); 3037 __ LoadP(r7, FieldMemOperand(r5, with_types_offset));
3030 __ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0); 3038 __ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0);
3031 __ StoreP(r7, FieldMemOperand(r5, with_types_offset), r0); 3039 __ StoreP(r7, FieldMemOperand(r5, with_types_offset), r0);
3032 3040
3033 // Store the function. Use a stub since we need a frame for allocation. 3041 // Store the function. Use a stub since we need a frame for allocation.
3034 // r5 - vector 3042 // r5 - vector
3035 // r6 - slot 3043 // r6 - slot
3036 // r4 - function 3044 // r4 - function
3037 { 3045 {
3038 FrameScope scope(masm, StackFrame::INTERNAL); 3046 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
3039 CreateWeakCellStub create_stub(masm->isolate()); 3047 CreateWeakCellStub create_stub(masm->isolate());
3040 __ Push(r4); 3048 __ Push(r4);
3041 __ CallStub(&create_stub); 3049 __ CallStub(&create_stub);
3042 __ Pop(r4); 3050 __ Pop(r4);
3043 } 3051 }
3044 3052
3045 __ b(&have_js_function); 3053 __ b(&have_js_function);
3046 3054
3047 // We are here because tracing is on or we encountered a MISS case we can't 3055 // We are here because tracing is on or we encountered a MISS case we can't
3048 // handle here. 3056 // handle here.
3049 __ bind(&miss); 3057 __ bind(&miss);
3050 GenerateMiss(masm); 3058 GenerateMiss(masm);
3051 3059
3052 // the slow case 3060 // the slow case
3053 __ bind(&slow_start); 3061 __ bind(&slow_start);
3054 // Check that the function is really a JavaScript function. 3062 // Check that the function is really a JavaScript function.
3055 // r4: pushed function (to be verified) 3063 // r4: pushed function (to be verified)
3056 __ JumpIfSmi(r4, &non_function); 3064 __ JumpIfSmi(r4, &non_function);
3057 3065
3058 // Goto slow case if we do not have a function. 3066 // Goto slow case if we do not have a function.
3059 __ CompareObjectType(r4, r7, r7, JS_FUNCTION_TYPE); 3067 __ CompareObjectType(r4, r7, r7, JS_FUNCTION_TYPE);
3060 __ bne(&slow); 3068 __ bne(&slow);
3061 __ b(&have_js_function); 3069 __ b(&have_js_function);
3062 } 3070 }
3063 3071
3064 3072
3065 void CallICStub::GenerateMiss(MacroAssembler* masm) { 3073 void CallICStub::GenerateMiss(MacroAssembler* masm) {
3066 FrameScope scope(masm, StackFrame::INTERNAL); 3074 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
3067 3075
3068 // Push the function and feedback info. 3076 // Push the function and feedback info.
3069 __ Push(r4, r5, r6); 3077 __ Push(r4, r5, r6);
3070 3078
3071 // Call the entry. 3079 // Call the entry.
3072 IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss 3080 IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
3073 : IC::kCallIC_Customization_Miss; 3081 : IC::kCallIC_Customization_Miss;
3074 3082
3075 ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate()); 3083 ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
3076 __ CallExternalReference(miss, 3); 3084 __ CallExternalReference(miss, 3);
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
4025 GenerateMiss(masm); 4033 GenerateMiss(masm);
4026 } 4034 }
4027 4035
4028 4036
4029 void CompareICStub::GenerateMiss(MacroAssembler* masm) { 4037 void CompareICStub::GenerateMiss(MacroAssembler* masm) {
4030 { 4038 {
4031 // Call the runtime system in a fresh internal frame. 4039 // Call the runtime system in a fresh internal frame.
4032 ExternalReference miss = 4040 ExternalReference miss =
4033 ExternalReference(IC_Utility(IC::kCompareIC_Miss), isolate()); 4041 ExternalReference(IC_Utility(IC::kCompareIC_Miss), isolate());
4034 4042
4035 FrameScope scope(masm, StackFrame::INTERNAL); 4043 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
4036 __ Push(r4, r3); 4044 __ Push(r4, r3);
4037 __ Push(r4, r3); 4045 __ Push(r4, r3);
4038 __ LoadSmiLiteral(r0, Smi::FromInt(op())); 4046 __ LoadSmiLiteral(r0, Smi::FromInt(op()));
4039 __ push(r0); 4047 __ push(r0);
4040 __ CallExternalReference(miss, 3); 4048 __ CallExternalReference(miss, 3);
4041 // Compute the entry point of the rewritten stub. 4049 // Compute the entry point of the rewritten stub.
4042 __ addi(r5, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); 4050 __ addi(r5, r3, Operand(Code::kHeaderSize - kHeapObjectTag));
4043 // Restore registers. 4051 // Restore registers.
4044 __ Pop(r4, r3); 4052 __ Pop(r4, r3);
4045 } 4053 }
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
5656 kStackUnwindSpace, NULL, 5664 kStackUnwindSpace, NULL,
5657 MemOperand(fp, 6 * kPointerSize), NULL); 5665 MemOperand(fp, 6 * kPointerSize), NULL);
5658 } 5666 }
5659 5667
5660 5668
5661 #undef __ 5669 #undef __
5662 } // namespace internal 5670 } // namespace internal
5663 } // namespace v8 5671 } // namespace v8
5664 5672
5665 #endif // V8_TARGET_ARCH_PPC 5673 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/builtins-ppc.cc ('k') | src/ppc/constants-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698