Commit 92b21548 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

Migrate AllocateHeapNumberStub to TF builtin

Bug: 
Change-Id: Ib888e52c7ad98e3b7419a3a5b4eabbe07f37d796
Reviewed-on: https://chromium-review.googlesource.com/691656Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48215}
parent 36f4c0f6
......@@ -647,6 +647,7 @@ namespace internal {
TFJ(MathTrunc, 1, kX) \
\
/* Number */ \
TFC(AllocateHeapNumber, AllocateHeapNumber, 1) \
/* ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case */ \
TFJ(NumberConstructor, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
/* ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case */ \
......
......@@ -84,6 +84,11 @@ TF_BUILTIN(NumberIsFinite, CodeStubAssembler) {
Return(BooleanConstant(false));
}
TF_BUILTIN(AllocateHeapNumber, CodeStubAssembler) {
Node* result = AllocateHeapNumber();
Return(result);
}
// ES6 #sec-number.isinteger
TF_BUILTIN(NumberIsInteger, CodeStubAssembler) {
Node* number = Parameter(Descriptor::kNumber);
......
......@@ -209,12 +209,6 @@ Callable CodeFactory::FastNewFunctionContext(Isolate* isolate,
FastNewFunctionContextDescriptor(isolate));
}
// static
Callable CodeFactory::AllocateHeapNumber(Isolate* isolate) {
AllocateHeapNumberStub stub(isolate);
return make_callable(stub);
}
// static
Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ArgumentsAdaptorTrampoline),
......
......@@ -63,8 +63,6 @@ class V8_EXPORT_PRIVATE CodeFactory final {
static Callable FastNewFunctionContext(Isolate* isolate,
ScopeType scope_type);
static Callable AllocateHeapNumber(Isolate* isolate);
static Callable ArgumentAdaptor(Isolate* isolate);
static Callable Call(Isolate* isolate,
ConvertReceiverMode mode = ConvertReceiverMode::kAny);
......
......@@ -354,12 +354,6 @@ TF_STUB(ElementsTransitionAndStoreStub, CodeStubAssembler) {
}
}
// TODO(ishell): move to builtins.
TF_STUB(AllocateHeapNumberStub, CodeStubAssembler) {
Node* result = AllocateHeapNumber();
Return(result);
}
// TODO(ishell): move to builtins-handler-gen.
TF_STUB(StringLengthStub, CodeStubAssembler) {
Node* value = Parameter(Descriptor::kReceiver);
......@@ -507,13 +501,6 @@ void JSEntryStub::FinishCode(Handle<Code> code) {
}
void AllocateHeapNumberStub::InitializeDescriptor(
CodeStubDescriptor* descriptor) {
descriptor->Initialize(
Runtime::FunctionForId(Runtime::kAllocateHeapNumber)->entry);
}
// TODO(ishell): move to builtins.
TF_STUB(GetPropertyStub, CodeStubAssembler) {
Label call_runtime(this, Label::kDeferred), return_undefined(this), end(this);
......
......@@ -44,7 +44,6 @@ class Node;
V(SubString) \
V(NameDictionaryLookup) \
/* --- TurboFanCodeStubs --- */ \
V(AllocateHeapNumber) \
V(ArrayNoArgumentConstructor) \
V(ArraySingleArgumentConstructor) \
V(ArrayNArgumentsConstructor) \
......@@ -961,17 +960,6 @@ class StoreFastElementStub : public TurboFanCodeStub {
};
class AllocateHeapNumberStub : public TurboFanCodeStub {
public:
explicit AllocateHeapNumberStub(Isolate* isolate)
: TurboFanCodeStub(isolate) {}
void InitializeDescriptor(CodeStubDescriptor* descriptor) override;
DEFINE_CALL_INTERFACE_DESCRIPTOR(AllocateHeapNumber);
DEFINE_TURBOFAN_CODE_STUB(AllocateHeapNumber, TurboFanCodeStub);
};
class CommonArrayConstructorStub : public TurboFanCodeStub {
protected:
CommonArrayConstructorStub(Isolate* isolate, ElementsKind kind,
......
......@@ -2736,9 +2736,10 @@ Node* WasmGraphBuilder::BuildAllocateHeapNumberWithValue(Node* value,
Node* control) {
MachineOperatorBuilder* machine = jsgraph()->machine();
CommonOperatorBuilder* common = jsgraph()->common();
// The AllocateHeapNumberStub does not use the js_context, so we can safely
// pass in Smi zero here.
Callable callable = CodeFactory::AllocateHeapNumber(jsgraph()->isolate());
// The AllocateHeapNumber builtin does not use the js_context, so we can
// safely pass in Smi zero here.
Callable callable = Builtins::CallableFor(jsgraph()->isolate(),
Builtins::kAllocateHeapNumber);
Node* target = jsgraph()->HeapConstant(callable.code());
Node* js_context = jsgraph()->NoContextConstant();
Node* effect =
......
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