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 { ...@@ -647,6 +647,7 @@ namespace internal {
TFJ(MathTrunc, 1, kX) \ TFJ(MathTrunc, 1, kX) \
\ \
/* Number */ \ /* Number */ \
TFC(AllocateHeapNumber, AllocateHeapNumber, 1) \
/* ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case */ \ /* ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case */ \
TFJ(NumberConstructor, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ TFJ(NumberConstructor, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
/* ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case */ \ /* ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case */ \
......
...@@ -84,6 +84,11 @@ TF_BUILTIN(NumberIsFinite, CodeStubAssembler) { ...@@ -84,6 +84,11 @@ TF_BUILTIN(NumberIsFinite, CodeStubAssembler) {
Return(BooleanConstant(false)); Return(BooleanConstant(false));
} }
TF_BUILTIN(AllocateHeapNumber, CodeStubAssembler) {
Node* result = AllocateHeapNumber();
Return(result);
}
// ES6 #sec-number.isinteger // ES6 #sec-number.isinteger
TF_BUILTIN(NumberIsInteger, CodeStubAssembler) { TF_BUILTIN(NumberIsInteger, CodeStubAssembler) {
Node* number = Parameter(Descriptor::kNumber); Node* number = Parameter(Descriptor::kNumber);
......
...@@ -209,12 +209,6 @@ Callable CodeFactory::FastNewFunctionContext(Isolate* isolate, ...@@ -209,12 +209,6 @@ Callable CodeFactory::FastNewFunctionContext(Isolate* isolate,
FastNewFunctionContextDescriptor(isolate)); FastNewFunctionContextDescriptor(isolate));
} }
// static
Callable CodeFactory::AllocateHeapNumber(Isolate* isolate) {
AllocateHeapNumberStub stub(isolate);
return make_callable(stub);
}
// static // static
Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) { Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ArgumentsAdaptorTrampoline), return Callable(BUILTIN_CODE(isolate, ArgumentsAdaptorTrampoline),
......
...@@ -63,8 +63,6 @@ class V8_EXPORT_PRIVATE CodeFactory final { ...@@ -63,8 +63,6 @@ class V8_EXPORT_PRIVATE CodeFactory final {
static Callable FastNewFunctionContext(Isolate* isolate, static Callable FastNewFunctionContext(Isolate* isolate,
ScopeType scope_type); ScopeType scope_type);
static Callable AllocateHeapNumber(Isolate* isolate);
static Callable ArgumentAdaptor(Isolate* isolate); static Callable ArgumentAdaptor(Isolate* isolate);
static Callable Call(Isolate* isolate, static Callable Call(Isolate* isolate,
ConvertReceiverMode mode = ConvertReceiverMode::kAny); ConvertReceiverMode mode = ConvertReceiverMode::kAny);
......
...@@ -354,12 +354,6 @@ TF_STUB(ElementsTransitionAndStoreStub, CodeStubAssembler) { ...@@ -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. // TODO(ishell): move to builtins-handler-gen.
TF_STUB(StringLengthStub, CodeStubAssembler) { TF_STUB(StringLengthStub, CodeStubAssembler) {
Node* value = Parameter(Descriptor::kReceiver); Node* value = Parameter(Descriptor::kReceiver);
...@@ -507,13 +501,6 @@ void JSEntryStub::FinishCode(Handle<Code> code) { ...@@ -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. // TODO(ishell): move to builtins.
TF_STUB(GetPropertyStub, CodeStubAssembler) { TF_STUB(GetPropertyStub, CodeStubAssembler) {
Label call_runtime(this, Label::kDeferred), return_undefined(this), end(this); Label call_runtime(this, Label::kDeferred), return_undefined(this), end(this);
......
...@@ -44,7 +44,6 @@ class Node; ...@@ -44,7 +44,6 @@ class Node;
V(SubString) \ V(SubString) \
V(NameDictionaryLookup) \ V(NameDictionaryLookup) \
/* --- TurboFanCodeStubs --- */ \ /* --- TurboFanCodeStubs --- */ \
V(AllocateHeapNumber) \
V(ArrayNoArgumentConstructor) \ V(ArrayNoArgumentConstructor) \
V(ArraySingleArgumentConstructor) \ V(ArraySingleArgumentConstructor) \
V(ArrayNArgumentsConstructor) \ V(ArrayNArgumentsConstructor) \
...@@ -961,17 +960,6 @@ class StoreFastElementStub : public TurboFanCodeStub { ...@@ -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 { class CommonArrayConstructorStub : public TurboFanCodeStub {
protected: protected:
CommonArrayConstructorStub(Isolate* isolate, ElementsKind kind, CommonArrayConstructorStub(Isolate* isolate, ElementsKind kind,
......
...@@ -2736,9 +2736,10 @@ Node* WasmGraphBuilder::BuildAllocateHeapNumberWithValue(Node* value, ...@@ -2736,9 +2736,10 @@ Node* WasmGraphBuilder::BuildAllocateHeapNumberWithValue(Node* value,
Node* control) { Node* control) {
MachineOperatorBuilder* machine = jsgraph()->machine(); MachineOperatorBuilder* machine = jsgraph()->machine();
CommonOperatorBuilder* common = jsgraph()->common(); CommonOperatorBuilder* common = jsgraph()->common();
// The AllocateHeapNumberStub does not use the js_context, so we can safely // The AllocateHeapNumber builtin does not use the js_context, so we can
// pass in Smi zero here. // safely pass in Smi zero here.
Callable callable = CodeFactory::AllocateHeapNumber(jsgraph()->isolate()); Callable callable = Builtins::CallableFor(jsgraph()->isolate(),
Builtins::kAllocateHeapNumber);
Node* target = jsgraph()->HeapConstant(callable.code()); Node* target = jsgraph()->HeapConstant(callable.code());
Node* js_context = jsgraph()->NoContextConstant(); Node* js_context = jsgraph()->NoContextConstant();
Node* effect = 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