PPC/s390: [debug] allow calls to some builtins on temporary objects

Port 077205be55

Original Commit Message:

    This CL allows SetPrototypeAdd and ArrayIteratorPrototypeNext
    to be called on temporary objects during side effect free evaluation.

R=kozyatinskiy@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I4f6d4e885c19a032723ea8fe39976780900ba922
Reviewed-on: https://chromium-review.googlesource.com/1008634
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#52554}
This commit is contained in:
Junliang Yan 2018-04-11 18:16:14 -04:00 committed by Commit Bot
parent 4a681e5f49
commit 34f86aee33
6 changed files with 34 additions and 4 deletions

View File

@ -568,6 +568,8 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
__ Push(r4, r7);
// Push hole as receiver since we do not use it for stepping.
__ PushRoot(Heap::kTheHoleValueRootIndex);
__ CallRuntime(Runtime::kDebugOnFunctionCall);
__ Pop(r4);
__ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset));

View File

@ -570,6 +570,8 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
__ Push(r3, r6);
// Push hole as receiver since we do not use it for stepping.
__ PushRoot(Heap::kTheHoleValueRootIndex);
__ CallRuntime(Runtime::kDebugOnFunctionCall);
__ Pop(r3);
__ LoadP(r6, FieldMemOperand(r3, JSGeneratorObject::kFunctionOffset));

View File

@ -37,8 +37,13 @@ void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
__ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ LeaveFrame(StackFrame::INTERNAL);
__ LoadP(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
__ LoadP(
r3, FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset));
#if V8_TARGET_ARCH_PPC64
__ lwz(r3, FieldMemOperand(
r3, SharedFunctionInfo::kFormalParameterCountOffset + 4));
#else
__ lwz(r3,
FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset));
#endif
__ mr(r5, r3);
ParameterCount dummy1(r5);

View File

@ -39,8 +39,13 @@ void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
__ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ LeaveFrame(StackFrame::INTERNAL);
__ LoadP(r2, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset));
#if V8_TARGET_ARCH_S390X
__ LoadW(r2, FieldMemOperand(
r2, SharedFunctionInfo::kFormalParameterCountOffset + 4));
#else
__ LoadP(
r2, FieldMemOperand(r2, SharedFunctionInfo::kFormalParameterCountOffset));
#endif
__ LoadRR(r4, r2);
ParameterCount dummy1(r4);

View File

@ -1204,6 +1204,14 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
beq(&skip_hook);
{
// Load receiver to pass it later to DebugOnFunctionCall hook.
if (actual.is_reg()) {
mr(r7, actual.reg());
} else {
mov(r7, Operand(actual.immediate()));
}
ShiftLeftImm(r7, r7, Operand(kPointerSizeLog2));
LoadPX(r7, MemOperand(sp, r7));
FrameScope frame(this,
has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
if (expected.is_reg()) {
@ -1217,7 +1225,7 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
if (new_target.is_valid()) {
Push(new_target);
}
Push(fun, fun);
Push(fun, fun, r7);
CallRuntime(Runtime::kDebugOnFunctionCall);
Pop(fun);
if (new_target.is_valid()) {

View File

@ -1225,6 +1225,14 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
bne(&skip_hook);
{
// Load receiver to pass it later to DebugOnFunctionCall hook.
if (actual.is_reg()) {
LoadRR(r6, actual.reg());
} else {
mov(r6, Operand(actual.immediate()));
}
ShiftLeftP(r6, r6, Operand(kPointerSizeLog2));
LoadP(r6, MemOperand(sp, r6));
FrameScope frame(this,
has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
if (expected.is_reg()) {
@ -1238,7 +1246,7 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
if (new_target.is_valid()) {
Push(new_target);
}
Push(fun, fun);
Push(fun, fun, r6);
CallRuntime(Runtime::kDebugOnFunctionCall);
Pop(fun);
if (new_target.is_valid()) {