2014-09-11 13:18:58 +00:00
|
|
|
// Copyright 2014 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2015-08-14 09:41:32 +00:00
|
|
|
#include "src/code-factory.h"
|
2014-09-11 13:18:58 +00:00
|
|
|
|
|
|
|
#include "src/bootstrapper.h"
|
2017-03-20 10:55:37 +00:00
|
|
|
#include "src/builtins/builtins-descriptors.h"
|
2014-09-11 13:18:58 +00:00
|
|
|
#include "src/ic/ic.h"
|
2017-02-23 11:46:29 +00:00
|
|
|
#include "src/objects-inl.h"
|
2014-09-11 13:18:58 +00:00
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2016-07-27 12:00:04 +00:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
// TODO(ishell): make it (const Stub& stub) once CodeStub::GetCode() is const.
|
|
|
|
template <typename Stub>
|
|
|
|
Callable make_callable(Stub& stub) {
|
|
|
|
typedef typename Stub::Descriptor Descriptor;
|
|
|
|
return Callable(stub.GetCode(), Descriptor(stub.isolate()));
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
2015-03-02 13:36:38 +00:00
|
|
|
|
2016-12-15 17:18:42 +00:00
|
|
|
// static
|
|
|
|
Handle<Code> CodeFactory::RuntimeCEntry(Isolate* isolate, int result_size) {
|
|
|
|
CEntryStub stub(isolate, result_size);
|
|
|
|
return stub.GetCode();
|
|
|
|
}
|
|
|
|
|
2016-04-19 12:11:05 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ApiGetter(Isolate* isolate) {
|
|
|
|
CallApiGetterStub stub(isolate);
|
2016-07-27 12:00:04 +00:00
|
|
|
return make_callable(stub);
|
2016-04-19 12:11:05 +00:00
|
|
|
}
|
2014-09-11 13:18:58 +00:00
|
|
|
|
2017-11-06 14:10:18 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::CallApiCallback(Isolate* isolate, int argc) {
|
|
|
|
CallApiCallbackStub stub(isolate, argc);
|
|
|
|
return make_callable(stub);
|
|
|
|
}
|
|
|
|
|
2016-06-14 13:20:42 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) {
|
2016-12-30 13:37:08 +00:00
|
|
|
return Callable(
|
|
|
|
typeof_mode == NOT_INSIDE_TYPEOF
|
2017-08-01 08:15:46 +00:00
|
|
|
? BUILTIN_CODE(isolate, LoadGlobalICTrampoline)
|
|
|
|
: BUILTIN_CODE(isolate, LoadGlobalICInsideTypeofTrampoline),
|
2016-12-30 13:37:08 +00:00
|
|
|
LoadGlobalDescriptor(isolate));
|
2016-06-14 13:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
Callable CodeFactory::LoadGlobalICInOptimizedCode(Isolate* isolate,
|
|
|
|
TypeofMode typeof_mode) {
|
2016-12-30 13:37:08 +00:00
|
|
|
return Callable(typeof_mode == NOT_INSIDE_TYPEOF
|
2017-08-01 08:15:46 +00:00
|
|
|
? BUILTIN_CODE(isolate, LoadGlobalIC)
|
|
|
|
: BUILTIN_CODE(isolate, LoadGlobalICInsideTypeof),
|
2016-12-30 13:37:08 +00:00
|
|
|
LoadGlobalWithVectorDescriptor(isolate));
|
2016-06-14 13:20:42 +00:00
|
|
|
}
|
2014-10-10 09:49:43 +00:00
|
|
|
|
2017-02-17 15:15:07 +00:00
|
|
|
Callable CodeFactory::StoreOwnIC(Isolate* isolate) {
|
|
|
|
// TODO(ishell): Currently we use StoreOwnIC only for storing properties that
|
|
|
|
// already exist in the boilerplate therefore we can use StoreIC.
|
2017-09-02 00:52:16 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, StoreICTrampoline),
|
2017-02-17 15:15:07 +00:00
|
|
|
StoreDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
|
|
|
Callable CodeFactory::StoreOwnICInOptimizedCode(Isolate* isolate) {
|
|
|
|
// TODO(ishell): Currently we use StoreOwnIC only for storing properties that
|
|
|
|
// already exist in the boilerplate therefore we can use StoreIC.
|
2017-09-02 00:52:16 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, StoreIC),
|
2017-02-17 15:15:07 +00:00
|
|
|
StoreWithVectorDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2014-09-11 13:18:58 +00:00
|
|
|
// static
|
2017-10-25 17:43:04 +00:00
|
|
|
Callable CodeFactory::BinaryOperation(Isolate* isolate, Operation op) {
|
2017-06-22 08:30:40 +00:00
|
|
|
switch (op) {
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kShiftRight:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kShiftRight);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kShiftLeft:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kShiftLeft);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kShiftRightLogical:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kShiftRightLogical);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kAdd:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kAdd);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kSubtract:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kSubtract);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kMultiply:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kMultiply);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kDivide:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kDivide);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kModulus:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kModulus);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kBitwiseOr:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kBitwiseOr);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kBitwiseAnd:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kBitwiseAnd);
|
2017-10-25 17:43:04 +00:00
|
|
|
case Operation::kBitwiseXor:
|
2017-06-22 08:30:40 +00:00
|
|
|
return Builtins::CallableFor(isolate, Builtins::kBitwiseXor);
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
UNREACHABLE();
|
2015-07-13 09:18:44 +00:00
|
|
|
}
|
|
|
|
|
2016-07-14 10:25:45 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::GetProperty(Isolate* isolate) {
|
|
|
|
GetPropertyStub stub(isolate);
|
2016-07-27 12:00:04 +00:00
|
|
|
return make_callable(stub);
|
2016-07-14 10:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
Callable CodeFactory::NonPrimitiveToPrimitive(Isolate* isolate,
|
|
|
|
ToPrimitiveHint hint) {
|
|
|
|
return Callable(isolate->builtins()->NonPrimitiveToPrimitive(hint),
|
|
|
|
TypeConversionDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
Callable CodeFactory::OrdinaryToPrimitive(Isolate* isolate,
|
|
|
|
OrdinaryToPrimitiveHint hint) {
|
|
|
|
return Callable(isolate->builtins()->OrdinaryToPrimitive(hint),
|
|
|
|
TypeConversionDescriptor(isolate));
|
|
|
|
}
|
2015-07-31 12:25:28 +00:00
|
|
|
|
2014-09-11 13:18:58 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags,
|
|
|
|
PretenureFlag pretenure_flag) {
|
|
|
|
StringAddStub stub(isolate, flags, pretenure_flag);
|
2016-07-27 12:00:04 +00:00
|
|
|
return make_callable(stub);
|
2014-09-11 13:18:58 +00:00
|
|
|
}
|
|
|
|
|
2016-04-06 08:37:09 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ResumeGenerator(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ResumeGeneratorTrampoline),
|
2016-04-06 08:37:09 +00:00
|
|
|
ResumeGeneratorDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-01-27 07:31:03 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::FrameDropperTrampoline(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, FrameDropperTrampoline),
|
2017-01-27 07:31:03 +00:00
|
|
|
FrameDropperTrampolineDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
Callable CodeFactory::HandleDebuggerStatement(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, HandleDebuggerStatement),
|
2017-01-27 07:31:03 +00:00
|
|
|
ContextOnlyDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2015-10-02 09:30:15 +00:00
|
|
|
// static
|
2016-12-20 16:23:19 +00:00
|
|
|
Callable CodeFactory::FastNewFunctionContext(Isolate* isolate,
|
|
|
|
ScopeType scope_type) {
|
2016-12-29 11:52:40 +00:00
|
|
|
return Callable(isolate->builtins()->NewFunctionContext(scope_type),
|
|
|
|
FastNewFunctionContextDescriptor(isolate));
|
2017-02-08 14:26:56 +00:00
|
|
|
}
|
|
|
|
|
2015-11-04 11:53:08 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ArgumentsAdaptorTrampoline),
|
2015-11-04 11:53:08 +00:00
|
|
|
ArgumentAdaptorDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2015-11-04 15:04:19 +00:00
|
|
|
// static
|
2017-07-13 18:06:15 +00:00
|
|
|
Callable CodeFactory::Call(Isolate* isolate, ConvertReceiverMode mode) {
|
|
|
|
return Callable(isolate->builtins()->Call(mode),
|
2015-11-04 15:04:19 +00:00
|
|
|
CallTrampolineDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-06-20 12:36:43 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::CallWithArrayLike(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, CallWithArrayLike),
|
2017-06-20 12:36:43 +00:00
|
|
|
CallWithArrayLikeDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-01-24 14:37:01 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::CallWithSpread(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, CallWithSpread),
|
2017-06-20 11:14:26 +00:00
|
|
|
CallWithSpreadDescriptor(isolate));
|
2017-01-24 14:37:01 +00:00
|
|
|
}
|
|
|
|
|
2015-11-05 13:30:41 +00:00
|
|
|
// static
|
2017-07-13 18:06:15 +00:00
|
|
|
Callable CodeFactory::CallFunction(Isolate* isolate, ConvertReceiverMode mode) {
|
|
|
|
return Callable(isolate->builtins()->CallFunction(mode),
|
2015-11-05 13:30:41 +00:00
|
|
|
CallTrampolineDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-06-08 18:31:59 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::CallVarargs(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, CallVarargs),
|
2017-06-08 18:31:59 +00:00
|
|
|
CallVarargsDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-01-26 09:29:56 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::CallForwardVarargs(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, CallForwardVarargs),
|
2017-01-26 09:29:56 +00:00
|
|
|
CallForwardVarargsDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
Callable CodeFactory::CallFunctionForwardVarargs(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, CallFunctionForwardVarargs),
|
2017-01-26 09:29:56 +00:00
|
|
|
CallForwardVarargsDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2015-11-23 10:34:04 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::Construct(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, Construct),
|
2015-11-23 10:34:04 +00:00
|
|
|
ConstructTrampolineDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-01-18 10:34:24 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ConstructWithSpread(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ConstructWithSpread),
|
2017-06-20 11:14:26 +00:00
|
|
|
ConstructWithSpreadDescriptor(isolate));
|
2017-01-18 10:34:24 +00:00
|
|
|
}
|
|
|
|
|
2015-12-10 06:03:37 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ConstructFunction(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ConstructFunction),
|
2015-12-10 06:03:37 +00:00
|
|
|
ConstructTrampolineDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-06-08 18:31:59 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ConstructVarargs(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ConstructVarargs),
|
2017-06-08 18:31:59 +00:00
|
|
|
ConstructVarargsDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
[turbofan] Avoid allocating rest parameters for spread calls.
We already had an optimization to turn Function.prototype.apply with
arguments object, i.e.
function foo() { return bar.apply(this, arguments); }
into a special operator JSCallForwardVarargs, which avoids the
allocation and deconstruction of the arguments object, but just passes
along the incoming parameters. We can do the same for rest parameters
and spread calls/constructs, i.e.
class A extends B {
constructor(...args) { super(...args); }
}
or
function foo(...args) { return bar(1, 2, 3, ...args); }
where we basically pass along the parameters (plus maybe additional
statically known parameters).
For this, we introduce a new JSConstructForwardVarargs operator and
generalize the CallForwardVarargs builtins that are backing this.
BUG=v8:6407,v8:6278,v8:6344
R=jarin@chromium.org
Review-Url: https://codereview.chromium.org/2890023004
Cr-Commit-Position: refs/heads/master@{#45388}
2017-05-18 07:32:22 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ConstructForwardVarargs(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ConstructForwardVarargs),
|
[turbofan] Avoid allocating rest parameters for spread calls.
We already had an optimization to turn Function.prototype.apply with
arguments object, i.e.
function foo() { return bar.apply(this, arguments); }
into a special operator JSCallForwardVarargs, which avoids the
allocation and deconstruction of the arguments object, but just passes
along the incoming parameters. We can do the same for rest parameters
and spread calls/constructs, i.e.
class A extends B {
constructor(...args) { super(...args); }
}
or
function foo(...args) { return bar(1, 2, 3, ...args); }
where we basically pass along the parameters (plus maybe additional
statically known parameters).
For this, we introduce a new JSConstructForwardVarargs operator and
generalize the CallForwardVarargs builtins that are backing this.
BUG=v8:6407,v8:6278,v8:6344
R=jarin@chromium.org
Review-Url: https://codereview.chromium.org/2890023004
Cr-Commit-Position: refs/heads/master@{#45388}
2017-05-18 07:32:22 +00:00
|
|
|
ConstructForwardVarargsDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
Callable CodeFactory::ConstructFunctionForwardVarargs(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ConstructFunctionForwardVarargs),
|
[turbofan] Avoid allocating rest parameters for spread calls.
We already had an optimization to turn Function.prototype.apply with
arguments object, i.e.
function foo() { return bar.apply(this, arguments); }
into a special operator JSCallForwardVarargs, which avoids the
allocation and deconstruction of the arguments object, but just passes
along the incoming parameters. We can do the same for rest parameters
and spread calls/constructs, i.e.
class A extends B {
constructor(...args) { super(...args); }
}
or
function foo(...args) { return bar(1, 2, 3, ...args); }
where we basically pass along the parameters (plus maybe additional
statically known parameters).
For this, we introduce a new JSConstructForwardVarargs operator and
generalize the CallForwardVarargs builtins that are backing this.
BUG=v8:6407,v8:6278,v8:6344
R=jarin@chromium.org
Review-Url: https://codereview.chromium.org/2890023004
Cr-Commit-Position: refs/heads/master@{#45388}
2017-05-18 07:32:22 +00:00
|
|
|
ConstructForwardVarargsDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2015-09-14 10:05:18 +00:00
|
|
|
// static
|
2017-04-11 14:20:30 +00:00
|
|
|
Callable CodeFactory::InterpreterPushArgsThenCall(
|
|
|
|
Isolate* isolate, ConvertReceiverMode receiver_mode,
|
2017-07-13 18:06:15 +00:00
|
|
|
InterpreterPushArgsMode mode) {
|
|
|
|
return Callable(
|
|
|
|
isolate->builtins()->InterpreterPushArgsThenCall(receiver_mode, mode),
|
|
|
|
InterpreterPushArgsThenCallDescriptor(isolate));
|
2015-10-02 18:13:41 +00:00
|
|
|
}
|
|
|
|
|
2015-10-15 16:46:16 +00:00
|
|
|
// static
|
2017-04-11 14:20:30 +00:00
|
|
|
Callable CodeFactory::InterpreterPushArgsThenConstruct(
|
2017-01-24 14:37:01 +00:00
|
|
|
Isolate* isolate, InterpreterPushArgsMode mode) {
|
2017-04-11 14:20:30 +00:00
|
|
|
return Callable(isolate->builtins()->InterpreterPushArgsThenConstruct(mode),
|
|
|
|
InterpreterPushArgsThenConstructDescriptor(isolate));
|
2015-10-15 16:46:16 +00:00
|
|
|
}
|
|
|
|
|
2015-10-02 18:13:41 +00:00
|
|
|
// static
|
2016-01-08 15:15:52 +00:00
|
|
|
Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) {
|
2015-10-02 18:13:41 +00:00
|
|
|
// Note: If we ever use fpregs in the interpreter then we will need to
|
|
|
|
// save fpregs too.
|
2016-01-08 15:15:52 +00:00
|
|
|
CEntryStub stub(isolate, result_size, kDontSaveFPRegs, kArgvInRegister);
|
2015-10-02 18:13:41 +00:00
|
|
|
return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate));
|
2015-09-14 10:05:18 +00:00
|
|
|
}
|
|
|
|
|
2016-07-26 14:31:10 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::InterpreterOnStackReplacement(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, InterpreterOnStackReplacement),
|
2016-07-26 14:31:10 +00:00
|
|
|
ContextOnlyDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-02-02 13:29:33 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ArrayConstructor(Isolate* isolate) {
|
|
|
|
ArrayConstructorStub stub(isolate);
|
|
|
|
return make_callable(stub);
|
|
|
|
}
|
|
|
|
|
2017-05-05 12:11:36 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ArrayPop(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ArrayPop), BuiltinDescriptor(isolate));
|
2017-05-05 12:11:36 +00:00
|
|
|
}
|
|
|
|
|
2017-05-17 14:39:34 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ArrayShift(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ArrayShift),
|
2017-05-17 14:39:34 +00:00
|
|
|
BuiltinDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-10-23 18:41:42 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ExtractFastJSArray(Isolate* isolate) {
|
|
|
|
return Callable(BUILTIN_CODE(isolate, ExtractFastJSArray),
|
|
|
|
ExtractFastJSArrayDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
Callable CodeFactory::CloneFastJSArray(Isolate* isolate) {
|
|
|
|
return Callable(BUILTIN_CODE(isolate, CloneFastJSArray),
|
|
|
|
CloneFastJSArrayDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2016-11-29 16:57:58 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::ArrayPush(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, ArrayPush), BuiltinDescriptor(isolate));
|
2016-11-29 16:57:58 +00:00
|
|
|
}
|
|
|
|
|
2016-12-01 21:15:08 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::FunctionPrototypeBind(Isolate* isolate) {
|
2017-08-01 08:15:46 +00:00
|
|
|
return Callable(BUILTIN_CODE(isolate, FunctionPrototypeBind),
|
2016-12-01 21:15:08 +00:00
|
|
|
BuiltinDescriptor(isolate));
|
|
|
|
}
|
|
|
|
|
2017-07-05 12:30:58 +00:00
|
|
|
// static
|
|
|
|
Callable CodeFactory::TransitionElementsKind(Isolate* isolate,
|
|
|
|
ElementsKind from, ElementsKind to,
|
|
|
|
bool is_jsarray) {
|
|
|
|
TransitionElementsKindStub stub(isolate, from, to, is_jsarray);
|
|
|
|
return make_callable(stub);
|
|
|
|
}
|
|
|
|
|
2014-09-11 13:18:58 +00:00
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|