| Index: src/ppc/code-stubs-ppc.cc
|
| diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc
|
| index 171258ce0eaaf3b2a5082d03b34aa865645cb860..c461ecb9501ad9f73612ee5abcfabe12f9e2dee5 100644
|
| --- a/src/ppc/code-stubs-ppc.cc
|
| +++ b/src/ppc/code-stubs-ppc.cc
|
| @@ -111,7 +111,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm,
|
| int param_count = descriptor.GetEnvironmentParameterCount();
|
| {
|
| // Call the runtime system in a fresh internal frame.
|
| - FrameScope scope(masm, StackFrame::INTERNAL);
|
| + FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
| DCHECK(param_count == 0 ||
|
| r3.is(descriptor.GetEnvironmentParameterRegister(param_count - 1)));
|
| // Push arguments
|
| @@ -1158,9 +1158,8 @@ void CEntryStub::Generate(MacroAssembler* masm) {
|
| __ mov(fp, Operand(pending_handler_fp_address));
|
| __ LoadP(fp, MemOperand(fp));
|
|
|
| - // If the handler is a JS frame, restore the context to the frame.
|
| - // (kind == ENTRY) == (fp == 0) == (cp == 0), so we could test either fp
|
| - // or cp.
|
| + // If the handler is a JS frame, restore the context to the frame. Note that
|
| + // the context will be set to (cp == 0) for non-JS frames.
|
| Label skip;
|
| __ cmpi(cp, Operand::Zero());
|
| __ beq(&skip);
|
| @@ -1168,11 +1167,15 @@ void CEntryStub::Generate(MacroAssembler* masm) {
|
| __ bind(&skip);
|
|
|
| // Compute the handler entry address and jump to it.
|
| + ConstantPoolUnavailableScope constant_pool_unavailable(masm);
|
| __ mov(r4, Operand(pending_handler_code_address));
|
| __ LoadP(r4, MemOperand(r4));
|
| __ mov(r5, Operand(pending_handler_offset_address));
|
| __ LoadP(r5, MemOperand(r5));
|
| __ addi(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); // Code start
|
| + if (FLAG_enable_embedded_constant_pool) {
|
| + __ LoadTargetConstantPoolPointerRegister(r4);
|
| + }
|
| __ add(ip, r4, r5);
|
| __ Jump(ip);
|
| }
|
| @@ -1214,6 +1217,10 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
|
| // r7: argv
|
| __ li(r0, Operand(-1)); // Push a bad frame pointer to fail if it is used.
|
| __ push(r0);
|
| + if (FLAG_enable_embedded_constant_pool) {
|
| + __ li(kConstantPoolRegister, Operand::Zero());
|
| + __ push(kConstantPoolRegister);
|
| + }
|
| int marker = type();
|
| __ LoadSmiLiteral(r0, Smi::FromInt(marker));
|
| __ push(r0);
|
| @@ -1250,7 +1257,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
|
| handler_offset_ = handler_entry.pos();
|
| // Caught exception: Store result (exception) in the pending exception
|
| // field in the JSEnv and return a failure sentinel. Coming in here the
|
| - // fp will be invalid because the PushTryHandler below sets it to 0 to
|
| + // fp will be invalid because the PushStackHandler below sets it to 0 to
|
| // signal the existence of the JSEntry frame.
|
| __ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress,
|
| isolate())));
|
| @@ -1259,11 +1266,10 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
|
| __ LoadRoot(r3, Heap::kExceptionRootIndex);
|
| __ b(&exit);
|
|
|
| - // Invoke: Link this frame into the handler chain. There's only one
|
| - // handler block in this code object, so its index is 0.
|
| + // Invoke: Link this frame into the handler chain.
|
| __ bind(&invoke);
|
| - // Must preserve r0-r4, r5-r7 are available. (needs update for PPC)
|
| - __ PushTryHandler(StackHandler::JS_ENTRY, 0);
|
| + // Must preserve r3-r7.
|
| + __ PushStackHandler();
|
| // If an exception not caught by another handler occurs, this handler
|
| // returns control to the code after the b(&invoke) above, which
|
| // restores all kCalleeSaved registers (including cp and fp) to their
|
| @@ -1302,7 +1308,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
|
| __ bctrl(); // make the call
|
|
|
| // Unlink this frame from the handler chain.
|
| - __ PopTryHandler();
|
| + __ PopStackHandler();
|
|
|
| __ bind(&exit); // r3 holds result
|
| // Check if the current stack frame is marked as the outermost JS frame.
|
| @@ -1524,7 +1530,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
|
| __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
|
| } else {
|
| {
|
| - FrameScope scope(masm, StackFrame::INTERNAL);
|
| + FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
| __ Push(r3, r4);
|
| __ InvokeBuiltin(Builtins::INSTANCE_OF, CALL_FUNCTION);
|
| }
|
| @@ -2596,7 +2602,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
| // Create an AllocationSite if we don't already have it, store it in the
|
| // slot.
|
| {
|
| - FrameScope scope(masm, StackFrame::INTERNAL);
|
| + FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
|
|
| // Arguments register must be smi-tagged to call out.
|
| __ SmiTag(r3);
|
| @@ -2682,7 +2688,7 @@ static void EmitSlowCase(MacroAssembler* masm, int argc, Label* non_function) {
|
| static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) {
|
| // Wrap the receiver and patch it back onto the stack.
|
| {
|
| - FrameScope frame_scope(masm, StackFrame::INTERNAL);
|
| + FrameAndConstantPoolScope frame_scope(masm, StackFrame::INTERNAL);
|
| __ Push(r4, r6);
|
| __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
|
| __ pop(r4);
|
| @@ -3000,7 +3006,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
| // r6 - slot
|
| // r4 - function
|
| {
|
| - FrameScope scope(masm, StackFrame::INTERNAL);
|
| + FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
| CreateWeakCellStub create_stub(masm->isolate());
|
| __ Push(r4);
|
| __ CallStub(&create_stub);
|
| @@ -3028,7 +3034,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
|
|
|
|
|
| void CallICStub::GenerateMiss(MacroAssembler* masm) {
|
| - FrameScope scope(masm, StackFrame::INTERNAL);
|
| + FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
|
|
| // Push the function and feedback info.
|
| __ Push(r4, r5, r6);
|
| @@ -3997,7 +4003,7 @@ void CompareICStub::GenerateMiss(MacroAssembler* masm) {
|
| ExternalReference miss =
|
| ExternalReference(IC_Utility(IC::kCompareIC_Miss), isolate());
|
|
|
| - FrameScope scope(masm, StackFrame::INTERNAL);
|
| + FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
| __ Push(r4, r3);
|
| __ Push(r4, r3);
|
| __ LoadSmiLiteral(r0, Smi::FromInt(op()));
|
|
|