Commit 16e4bbd6 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: [builtins] More stubs to the builtin-o-sphere.

Port 05873add
Port f2e8c978

Original commit message:

    The following ported to builtins:
    FastCloneRegExp
    FastCloneShallowArray
    FastCloneShallowObject

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

Review-Url: https://codereview.chromium.org/2603003002
Cr-Commit-Position: refs/heads/master@{#41996}
parent 9d22fa31
......@@ -5,6 +5,7 @@
#include "src/crankshaft/ppc/lithium-codegen-ppc.h"
#include "src/base/bits.h"
#include "src/builtins/builtins-constructor.h"
#include "src/code-factory.h"
#include "src/code-stubs.h"
#include "src/crankshaft/hydrogen-osr.h"
......@@ -186,13 +187,14 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
if (slots <= FastNewFunctionContextStub::MaximumSlots()) {
FastNewFunctionContextStub stub(isolate(),
info()->scope()->scope_type());
if (slots <=
ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) {
Callable callable = CodeFactory::FastNewFunctionContext(
isolate(), info()->scope()->scope_type());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
__ Call(callable.code(), RelocInfo::CODE_TARGET);
// Result of the FastNewFunctionContext builtin is always in new space.
need_write_barrier = false;
} else {
__ push(r4);
......
......@@ -6,6 +6,7 @@
#include "src/crankshaft/s390/lithium-codegen-s390.h"
#include "src/base/bits.h"
#include "src/builtins/builtins-constructor.h"
#include "src/code-factory.h"
#include "src/code-stubs.h"
#include "src/crankshaft/hydrogen-osr.h"
......@@ -177,13 +178,14 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else {
if (slots <= FastNewFunctionContextStub::MaximumSlots()) {
FastNewFunctionContextStub stub(isolate(),
info()->scope()->scope_type());
if (slots <=
ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) {
Callable callable = CodeFactory::FastNewFunctionContext(
isolate(), info()->scope()->scope_type());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
__ Call(callable.code(), RelocInfo::CODE_TARGET);
// Result of the FastNewFunctionContext builtin is always in new space.
need_write_barrier = false;
} else {
__ push(r3);
......
......@@ -4,15 +4,16 @@
#if V8_TARGET_ARCH_PPC
#include "src/full-codegen/full-codegen.h"
#include "src/ast/compile-time-value.h"
#include "src/ast/scopes.h"
#include "src/builtins/builtins-constructor.h"
#include "src/code-factory.h"
#include "src/code-stubs.h"
#include "src/codegen.h"
#include "src/compilation-info.h"
#include "src/compiler.h"
#include "src/debug/debug.h"
#include "src/full-codegen/full-codegen.h"
#include "src/ic/ic.h"
#include "src/ppc/code-stubs-ppc.h"
......@@ -206,12 +207,14 @@ void FullCodeGenerator::Generate() {
if (info->scope()->new_target_var() != nullptr) {
__ push(r6); // Preserve new target.
}
if (slots <= FastNewFunctionContextStub::MaximumSlots()) {
FastNewFunctionContextStub stub(isolate(), info->scope()->scope_type());
if (slots <=
ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) {
Callable callable = CodeFactory::FastNewFunctionContext(
isolate(), info->scope()->scope_type());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
__ Call(callable.code(), RelocInfo::CODE_TARGET);
// Result of the FastNewFunctionContext builtin is always in new space.
need_write_barrier = false;
} else {
__ push(r4);
......@@ -1186,8 +1189,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
__ Push(r6, r5, r4, r3);
__ CallRuntime(Runtime::kCreateObjectLiteral);
} else {
FastCloneShallowObjectStub stub(isolate(), expr->properties_count());
__ CallStub(&stub);
Callable callable = CodeFactory::FastCloneShallowObject(
isolate(), expr->properties_count());
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER);
......@@ -1322,8 +1326,9 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ Push(r6, r5, r4, r3);
__ CallRuntime(Runtime::kCreateArrayLiteral);
} else {
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
__ CallStub(&stub);
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER);
......
......@@ -4,15 +4,16 @@
#if V8_TARGET_ARCH_S390
#include "src/full-codegen/full-codegen.h"
#include "src/ast/compile-time-value.h"
#include "src/ast/scopes.h"
#include "src/builtins/builtins-constructor.h"
#include "src/code-factory.h"
#include "src/code-stubs.h"
#include "src/codegen.h"
#include "src/compilation-info.h"
#include "src/compiler.h"
#include "src/debug/debug.h"
#include "src/full-codegen/full-codegen.h"
#include "src/ic/ic.h"
#include "src/s390/code-stubs-s390.h"
......@@ -210,12 +211,14 @@ void FullCodeGenerator::Generate() {
if (info->scope()->new_target_var() != nullptr) {
__ push(r5); // Preserve new target.
}
if (slots <= FastNewFunctionContextStub::MaximumSlots()) {
FastNewFunctionContextStub stub(isolate(), info->scope()->scope_type());
if (slots <=
ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) {
Callable callable = CodeFactory::FastNewFunctionContext(
isolate(), info->scope()->scope_type());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
__ Call(callable.code(), RelocInfo::CODE_TARGET);
// Result of the FastNewFunctionContext builtin is always in new space.
need_write_barrier = false;
} else {
__ push(r3);
......@@ -1149,8 +1152,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
__ Push(r5, r4, r3, r2);
__ CallRuntime(Runtime::kCreateObjectLiteral);
} else {
FastCloneShallowObjectStub stub(isolate(), expr->properties_count());
__ CallStub(&stub);
Callable callable = CodeFactory::FastCloneShallowObject(
isolate(), expr->properties_count());
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER);
......@@ -1284,8 +1288,9 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ Push(r5, r4, r3, r2);
__ CallRuntime(Runtime::kCreateArrayLiteral);
} else {
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
__ CallStub(&stub);
Callable callable =
CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
__ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment