Commit b3507ff0 authored by jkummerow's avatar jkummerow Committed by Commit bot

[refactor] Separate generated builtins and C++ builtins into separate files

This is in preparation for linking the former only into mksnapshot.
Just shuffling code around, no changes in functionality.

BUG=v8:6055

Review-Url: https://codereview.chromium.org/2752143004
Cr-Commit-Position: refs/heads/master@{#43858}
parent 24b9ffa4
......@@ -808,6 +808,7 @@ v8_source_set("v8_nosnapshot") {
":js2c_experimental_extras",
":js2c_extras",
":v8_base",
":v8_builtins_generators",
]
sources = [
......@@ -833,6 +834,7 @@ v8_source_set("v8_snapshot") {
":js2c_experimental_extras",
":js2c_extras",
":v8_base",
":v8_builtins_generators",
]
public_deps = [
# This should be public so downstream targets can declare the snapshot
......@@ -859,6 +861,7 @@ if (v8_use_external_startup_data) {
":js2c_experimental_extras",
":js2c_extras",
":v8_base",
":v8_builtins_generators",
]
public_deps = [
":natives_blob",
......@@ -874,6 +877,53 @@ if (v8_use_external_startup_data) {
}
}
v8_source_set("v8_builtins_generators") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
deps = [
":v8_base",
]
sources = [
### gcmole(all) ###
"src/builtins/builtins-arguments-gen.cc",
"src/builtins/builtins-arguments.h",
"src/builtins/builtins-array-gen.cc",
"src/builtins/builtins-async-function-gen.cc",
"src/builtins/builtins-async-gen.cc",
"src/builtins/builtins-async-iterator-gen.cc",
"src/builtins/builtins-async.h",
"src/builtins/builtins-boolean-gen.cc",
"src/builtins/builtins-constructor-gen.cc",
"src/builtins/builtins-constructor.h",
"src/builtins/builtins-conversion-gen.cc",
"src/builtins/builtins-date-gen.cc",
"src/builtins/builtins-forin-gen.cc",
"src/builtins/builtins-forin.h",
"src/builtins/builtins-function-gen.cc",
"src/builtins/builtins-generator-gen.cc",
"src/builtins/builtins-global-gen.cc",
"src/builtins/builtins-handler-gen.cc",
"src/builtins/builtins-ic-gen.cc",
"src/builtins/builtins-internal-gen.cc",
"src/builtins/builtins-math-gen.cc",
"src/builtins/builtins-number-gen.cc",
"src/builtins/builtins-object-gen.cc",
"src/builtins/builtins-promise-gen.cc",
"src/builtins/builtins-promise.h",
"src/builtins/builtins-regexp-gen.cc",
"src/builtins/builtins-regexp-gen.h",
"src/builtins/builtins-sharedarraybuffer-gen.cc",
"src/builtins/builtins-string-gen.cc",
"src/builtins/builtins-symbol-gen.cc",
"src/builtins/builtins-typedarray-gen.cc",
"src/builtins/builtins-utils-gen.h",
"src/builtins/builtins-wasm-gen.cc",
]
configs = [ ":internal_config" ]
}
# This is split out to be a non-code containing target that the Chromium browser
# DLL can depend upon to get only a version string.
v8_header_set("v8_version") {
......@@ -972,49 +1022,36 @@ v8_source_set("v8_base") {
"src/bootstrapper.cc",
"src/bootstrapper.h",
"src/builtins/builtins-api.cc",
"src/builtins/builtins-arguments.cc",
"src/builtins/builtins-arguments.h",
"src/builtins/builtins-array.cc",
"src/builtins/builtins-arraybuffer.cc",
"src/builtins/builtins-async-function.cc",
"src/builtins/builtins-async-iterator.cc",
"src/builtins/builtins-async.cc",
"src/builtins/builtins-async.h",
"src/builtins/builtins-boolean.cc",
"src/builtins/builtins-call.cc",
"src/builtins/builtins-callsite.cc",
"src/builtins/builtins-constructor.cc",
"src/builtins/builtins-constructor.h",
"src/builtins/builtins-conversion.cc",
"src/builtins/builtins-dataview.cc",
"src/builtins/builtins-date.cc",
"src/builtins/builtins-debug.cc",
"src/builtins/builtins-error.cc",
"src/builtins/builtins-forin.cc",
"src/builtins/builtins-forin.h",
"src/builtins/builtins-function.cc",
"src/builtins/builtins-generator.cc",
"src/builtins/builtins-global.cc",
"src/builtins/builtins-handler.cc",
"src/builtins/builtins-ic.cc",
"src/builtins/builtins-internal.cc",
"src/builtins/builtins-interpreter.cc",
"src/builtins/builtins-json.cc",
"src/builtins/builtins-math.cc",
"src/builtins/builtins-number.cc",
"src/builtins/builtins-object.cc",
"src/builtins/builtins-promise.cc",
"src/builtins/builtins-promise.h",
"src/builtins/builtins-proxy.cc",
"src/builtins/builtins-reflect.cc",
"src/builtins/builtins-regexp-gen.h",
"src/builtins/builtins-regexp.cc",
"src/builtins/builtins-regexp.h",
"src/builtins/builtins-sharedarraybuffer.cc",
"src/builtins/builtins-string.cc",
"src/builtins/builtins-symbol.cc",
"src/builtins/builtins-typedarray.cc",
"src/builtins/builtins-utils.h",
"src/builtins/builtins-wasm.cc",
"src/builtins/builtins.cc",
"src/builtins/builtins.h",
"src/cached-powers.cc",
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "src/builtins/builtins-arguments.h"
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
......
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "src/builtins/builtins-async.h"
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/objects-inl.h"
......@@ -11,13 +11,9 @@
namespace v8 {
namespace internal {
typedef compiler::Node Node;
typedef CodeStubAssembler::ParameterMode ParameterMode;
typedef compiler::CodeAssemblerState CodeAssemblerState;
class AsyncFunctionBuiltinsAssembler : public AsyncBuiltinsAssembler {
public:
explicit AsyncFunctionBuiltinsAssembler(CodeAssemblerState* state)
explicit AsyncFunctionBuiltinsAssembler(compiler::CodeAssemblerState* state)
: AsyncBuiltinsAssembler(state) {}
protected:
......
......@@ -3,15 +3,12 @@
// found in the LICENSE file.
#include "src/builtins/builtins-async.h"
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
#include "src/frames-inl.h"
namespace v8 {
namespace internal {
using compiler::Node;
Node* AsyncBuiltinsAssembler::Await(
Node* context, Node* generator, Node* value, Node* outer_promise,
const NodeGenerator1& create_closure_context, int on_resolve_context_index,
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "src/builtins/builtins-async.h"
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
......@@ -12,6 +12,8 @@
namespace v8 {
namespace internal {
using compiler::Node;
namespace {
// Describe fields of Context associated with the AsyncIterator unwrap closure.
......@@ -22,7 +24,7 @@ class ValueUnwrapContext {
class AsyncFromSyncBuiltinsAssembler : public AsyncBuiltinsAssembler {
public:
explicit AsyncFromSyncBuiltinsAssembler(CodeAssemblerState* state)
explicit AsyncFromSyncBuiltinsAssembler(compiler::CodeAssemblerState* state)
: AsyncBuiltinsAssembler(state) {}
void ThrowIfNotAsyncFromSyncIterator(Node* const context, Node* const object,
......
......@@ -12,7 +12,7 @@ namespace internal {
class AsyncBuiltinsAssembler : public PromiseBuiltinsAssembler {
public:
explicit AsyncBuiltinsAssembler(CodeAssemblerState* state)
explicit AsyncBuiltinsAssembler(compiler::CodeAssemblerState* state)
: PromiseBuiltinsAssembler(state) {}
protected:
......
// Copyright 2017 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.
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
namespace v8 {
namespace internal {
// -----------------------------------------------------------------------------
// ES6 section 19.3 Boolean Objects
// ES6 section 19.3.3.2 Boolean.prototype.toString ( )
TF_BUILTIN(BooleanPrototypeToString, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* value = ToThisValue(context, receiver, PrimitiveType::kBoolean,
"Boolean.prototype.toString");
Node* result = LoadObjectField(value, Oddball::kToStringOffset);
Return(result);
}
// ES6 section 19.3.3.3 Boolean.prototype.valueOf ( )
TF_BUILTIN(BooleanPrototypeValueOf, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* result = ToThisValue(context, receiver, PrimitiveType::kBoolean,
"Boolean.prototype.valueOf");
Return(result);
}
} // namespace internal
} // namespace v8
......@@ -4,7 +4,6 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/counters.h"
#include "src/objects-inl.h"
......@@ -36,34 +35,5 @@ BUILTIN(BooleanConstructor_ConstructStub) {
return *result;
}
// ES6 section 19.3.3.2 Boolean.prototype.toString ( )
void Builtins::Generate_BooleanPrototypeToString(
compiler::CodeAssemblerState* state) {
typedef compiler::Node Node;
CodeStubAssembler assembler(state);
Node* receiver = assembler.Parameter(0);
Node* context = assembler.Parameter(3);
Node* value = assembler.ToThisValue(
context, receiver, PrimitiveType::kBoolean, "Boolean.prototype.toString");
Node* result = assembler.LoadObjectField(value, Oddball::kToStringOffset);
assembler.Return(result);
}
// ES6 section 19.3.3.3 Boolean.prototype.valueOf ( )
void Builtins::Generate_BooleanPrototypeValueOf(
compiler::CodeAssemblerState* state) {
typedef compiler::Node Node;
CodeStubAssembler assembler(state);
Node* receiver = assembler.Parameter(0);
Node* context = assembler.Parameter(3);
Node* result = assembler.ToThisValue(
context, receiver, PrimitiveType::kBoolean, "Boolean.prototype.valueOf");
assembler.Return(result);
}
} // namespace internal
} // namespace v8
......@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/builtins/builtins-constructor.h"
#include "src/ast/ast.h"
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-constructor.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
......@@ -21,9 +21,6 @@ Node* ConstructorBuiltinsAssembler::EmitFastNewClosure(Node* shared_info,
Node* feedback_vector,
Node* slot,
Node* context) {
typedef compiler::CodeAssembler::Label Label;
typedef compiler::CodeAssembler::Variable Variable;
Isolate* isolate = this->isolate();
Factory* factory = isolate->factory();
IncrementCounter(isolate->counters()->fast_new_closure_total(), 1);
......@@ -211,9 +208,10 @@ Node* ConstructorBuiltinsAssembler::EmitFastNewObject(Node* context,
return var_obj.value();
}
Node* ConstructorBuiltinsAssembler::EmitFastNewObject(
Node* context, Node* target, Node* new_target,
CodeAssemblerLabel* call_runtime) {
Node* ConstructorBuiltinsAssembler::EmitFastNewObject(Node* context,
Node* target,
Node* new_target,
Label* call_runtime) {
CSA_ASSERT(this, HasInstanceType(target, JS_FUNCTION_TYPE));
CSA_ASSERT(this, IsJSReceiver(new_target));
......@@ -403,18 +401,6 @@ TF_BUILTIN(FastNewFunctionContextFunction, ConstructorBuiltinsAssembler) {
ScopeType::FUNCTION_SCOPE));
}
Handle<Code> Builtins::NewFunctionContext(ScopeType scope_type) {
switch (scope_type) {
case ScopeType::EVAL_SCOPE:
return FastNewFunctionContextEval();
case ScopeType::FUNCTION_SCOPE:
return FastNewFunctionContextFunction();
default:
UNREACHABLE();
}
return Handle<Code>::null();
}
Node* ConstructorBuiltinsAssembler::EmitFastCloneRegExp(Node* closure,
Node* literal_index,
Node* pattern,
......@@ -501,12 +487,8 @@ Node* ConstructorBuiltinsAssembler::NonEmptyShallowClone(
}
Node* ConstructorBuiltinsAssembler::EmitFastCloneShallowArray(
Node* closure, Node* literal_index, Node* context,
CodeAssemblerLabel* call_runtime, AllocationSiteMode allocation_site_mode) {
typedef CodeStubAssembler::Label Label;
typedef CodeStubAssembler::Variable Variable;
typedef compiler::Node Node;
Node* closure, Node* literal_index, Node* context, Label* call_runtime,
AllocationSiteMode allocation_site_mode) {
Label zero_capacity(this), cow_elements(this), fast_elements(this),
return_result(this);
Variable result(this, MachineRepresentation::kTagged);
......@@ -641,19 +623,6 @@ TF_BUILTIN(FastCloneShallowArrayDontTrack, ConstructorBuiltinsAssembler) {
CreateFastCloneShallowArrayBuiltin(DONT_TRACK_ALLOCATION_SITE);
}
Handle<Code> Builtins::NewCloneShallowArray(
AllocationSiteMode allocation_mode) {
switch (allocation_mode) {
case TRACK_ALLOCATION_SITE:
return FastCloneShallowArrayTrack();
case DONT_TRACK_ALLOCATION_SITE:
return FastCloneShallowArrayDontTrack();
default:
UNREACHABLE();
}
return Handle<Code>::null();
}
// static
int ConstructorBuiltinsAssembler::FastCloneShallowObjectPropertiesCount(
int literal_length) {
......@@ -667,7 +636,7 @@ int ConstructorBuiltinsAssembler::FastCloneShallowObjectPropertiesCount(
}
Node* ConstructorBuiltinsAssembler::EmitFastCloneShallowObject(
CodeAssemblerLabel* call_runtime, Node* closure, Node* literals_index,
Label* call_runtime, Node* closure, Node* literals_index,
Node* properties_count) {
Node* cell = LoadObjectField(closure, JSFunction::kFeedbackVectorOffset);
Node* feedback_vector = LoadObjectField(cell, Cell::kValueOffset);
......@@ -768,27 +737,5 @@ SHALLOW_OBJECT_BUILTIN(4);
SHALLOW_OBJECT_BUILTIN(5);
SHALLOW_OBJECT_BUILTIN(6);
Handle<Code> Builtins::NewCloneShallowObject(int length) {
switch (length) {
case 0:
return FastCloneShallowObject0();
case 1:
return FastCloneShallowObject1();
case 2:
return FastCloneShallowObject2();
case 3:
return FastCloneShallowObject3();
case 4:
return FastCloneShallowObject4();
case 5:
return FastCloneShallowObject5();
case 6:
return FastCloneShallowObject6();
default:
UNREACHABLE();
}
return Handle<Code>::null();
}
} // namespace internal
} // namespace v8
......@@ -7,13 +7,9 @@
namespace v8 {
namespace internal {
typedef compiler::Node Node;
typedef compiler::CodeAssemblerState CodeAssemblerState;
typedef compiler::CodeAssemblerLabel CodeAssemblerLabel;
class ConstructorBuiltinsAssembler : public CodeStubAssembler {
public:
explicit ConstructorBuiltinsAssembler(CodeAssemblerState* state)
explicit ConstructorBuiltinsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
Node* EmitFastNewClosure(Node* shared_info, Node* feedback_vector, Node* slot,
......@@ -25,8 +21,7 @@ class ConstructorBuiltinsAssembler : public CodeStubAssembler {
Node* EmitFastCloneRegExp(Node* closure, Node* literal_index, Node* pattern,
Node* flags, Node* context);
Node* EmitFastCloneShallowArray(Node* closure, Node* literal_index,
Node* context,
CodeAssemblerLabel* call_runtime,
Node* context, Label* call_runtime,
AllocationSiteMode allocation_site_mode);
// Maximum number of elements in copied array (chosen so that even an array
......@@ -40,15 +35,15 @@ class ConstructorBuiltinsAssembler : public CodeStubAssembler {
// Maximum number of properties in copied objects.
static const int kMaximumClonedShallowObjectProperties = 6;
static int FastCloneShallowObjectPropertiesCount(int literal_length);
Node* EmitFastCloneShallowObject(CodeAssemblerLabel* call_runtime,
Node* closure, Node* literals_index,
Node* EmitFastCloneShallowObject(Label* call_runtime, Node* closure,
Node* literals_index,
Node* properties_count);
void CreateFastCloneShallowObjectBuiltin(int properties_count);
Node* EmitFastNewObject(Node* context, Node* target, Node* new_target);
Node* EmitFastNewObject(Node* context, Node* target, Node* new_target,
CodeAssemblerLabel* call_runtime);
Label* call_runtime);
private:
static const int kMaximumSlots = 0x8000;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
......@@ -22,19 +22,6 @@ class ConversionBuiltinsAssembler : public CodeStubAssembler {
void Generate_OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint);
};
Handle<Code> Builtins::NonPrimitiveToPrimitive(ToPrimitiveHint hint) {
switch (hint) {
case ToPrimitiveHint::kDefault:
return NonPrimitiveToPrimitive_Default();
case ToPrimitiveHint::kNumber:
return NonPrimitiveToPrimitive_Number();
case ToPrimitiveHint::kString:
return NonPrimitiveToPrimitive_String();
}
UNREACHABLE();
return Handle<Code>::null();
}
// ES6 section 7.1.1 ToPrimitive ( input [ , PreferredType ] )
void ConversionBuiltinsAssembler::Generate_NonPrimitiveToPrimitive(
ToPrimitiveHint hint) {
......@@ -169,17 +156,6 @@ TF_BUILTIN(ToString, CodeStubAssembler) {
{ Return(CallRuntime(Runtime::kToString, context, input)); }
}
Handle<Code> Builtins::OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint) {
switch (hint) {
case OrdinaryToPrimitiveHint::kNumber:
return OrdinaryToPrimitive_Number();
case OrdinaryToPrimitiveHint::kString:
return OrdinaryToPrimitive_String();
}
UNREACHABLE();
return Handle<Code>::null();
}
// 7.1.1.1 OrdinaryToPrimitive ( O, hint )
void ConversionBuiltinsAssembler::Generate_OrdinaryToPrimitive(
OrdinaryToPrimitiveHint hint) {
......
// Copyright 2017 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.
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
namespace v8 {
namespace internal {
// -----------------------------------------------------------------------------
// ES6 section 20.3 Date Objects
class DateBuiltinsAssembler : public CodeStubAssembler {
public:
explicit DateBuiltinsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
protected:
void Generate_DatePrototype_GetField(int field_index);
};
void DateBuiltinsAssembler::Generate_DatePrototype_GetField(int field_index) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Label receiver_not_date(this, Label::kDeferred);
GotoIf(TaggedIsSmi(receiver), &receiver_not_date);
Node* receiver_instance_type = LoadInstanceType(receiver);
GotoIf(Word32NotEqual(receiver_instance_type, Int32Constant(JS_DATE_TYPE)),
&receiver_not_date);
// Load the specified date field, falling back to the runtime as necessary.
if (field_index == JSDate::kDateValue) {
Return(LoadObjectField(receiver, JSDate::kValueOffset));
} else {
if (field_index < JSDate::kFirstUncachedField) {
Label stamp_mismatch(this, Label::kDeferred);
Node* date_cache_stamp = Load(
MachineType::AnyTagged(),
ExternalConstant(ExternalReference::date_cache_stamp(isolate())));
Node* cache_stamp = LoadObjectField(receiver, JSDate::kCacheStampOffset);
GotoIf(WordNotEqual(date_cache_stamp, cache_stamp), &stamp_mismatch);
Return(LoadObjectField(
receiver, JSDate::kValueOffset + field_index * kPointerSize));
Bind(&stamp_mismatch);
}
Node* field_index_smi = SmiConstant(Smi::FromInt(field_index));
Node* function =
ExternalConstant(ExternalReference::get_date_field_function(isolate()));
Node* result = CallCFunction2(
MachineType::AnyTagged(), MachineType::AnyTagged(),
MachineType::AnyTagged(), function, receiver, field_index_smi);
Return(result);
}
// Raise a TypeError if the receiver is not a date.
Bind(&receiver_not_date);
{
CallRuntime(Runtime::kThrowNotDateError, context);
Unreachable();
}
}
TF_BUILTIN(DatePrototypeGetDate, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kDay);
}
TF_BUILTIN(DatePrototypeGetDay, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kWeekday);
}
TF_BUILTIN(DatePrototypeGetFullYear, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kYear);
}
TF_BUILTIN(DatePrototypeGetHours, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kHour);
}
TF_BUILTIN(DatePrototypeGetMilliseconds, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMillisecond);
}
TF_BUILTIN(DatePrototypeGetMinutes, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMinute);
}
TF_BUILTIN(DatePrototypeGetMonth, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMonth);
}
TF_BUILTIN(DatePrototypeGetSeconds, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kSecond);
}
TF_BUILTIN(DatePrototypeGetTime, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kDateValue);
}
TF_BUILTIN(DatePrototypeGetTimezoneOffset, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kTimezoneOffset);
}
TF_BUILTIN(DatePrototypeGetUTCDate, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kDayUTC);
}
TF_BUILTIN(DatePrototypeGetUTCDay, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kWeekdayUTC);
}
TF_BUILTIN(DatePrototypeGetUTCFullYear, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kYearUTC);
}
TF_BUILTIN(DatePrototypeGetUTCHours, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kHourUTC);
}
TF_BUILTIN(DatePrototypeGetUTCMilliseconds, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMillisecondUTC);
}
TF_BUILTIN(DatePrototypeGetUTCMinutes, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMinuteUTC);
}
TF_BUILTIN(DatePrototypeGetUTCMonth, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMonthUTC);
}
TF_BUILTIN(DatePrototypeGetUTCSeconds, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kSecondUTC);
}
TF_BUILTIN(DatePrototypeValueOf, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kDateValue);
}
TF_BUILTIN(DatePrototypeToPrimitive, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* hint = Parameter(1);
Node* context = Parameter(4);
// Check if the {receiver} is actually a JSReceiver.
Label receiver_is_invalid(this, Label::kDeferred);
GotoIf(TaggedIsSmi(receiver), &receiver_is_invalid);
GotoIfNot(IsJSReceiver(receiver), &receiver_is_invalid);
// Dispatch to the appropriate OrdinaryToPrimitive builtin.
Label hint_is_number(this), hint_is_string(this),
hint_is_invalid(this, Label::kDeferred);
// Fast cases for internalized strings.
Node* number_string = LoadRoot(Heap::knumber_stringRootIndex);
GotoIf(WordEqual(hint, number_string), &hint_is_number);
Node* default_string = LoadRoot(Heap::kdefault_stringRootIndex);
GotoIf(WordEqual(hint, default_string), &hint_is_string);
Node* string_string = LoadRoot(Heap::kstring_stringRootIndex);
GotoIf(WordEqual(hint, string_string), &hint_is_string);
// Slow-case with actual string comparisons.
Callable string_equal = CodeFactory::StringEqual(isolate());
GotoIf(TaggedIsSmi(hint), &hint_is_invalid);
GotoIfNot(IsString(hint), &hint_is_invalid);
GotoIf(WordEqual(CallStub(string_equal, context, hint, number_string),
TrueConstant()),
&hint_is_number);
GotoIf(WordEqual(CallStub(string_equal, context, hint, default_string),
TrueConstant()),
&hint_is_string);
GotoIf(WordEqual(CallStub(string_equal, context, hint, string_string),
TrueConstant()),
&hint_is_string);
Goto(&hint_is_invalid);
// Use the OrdinaryToPrimitive builtin to convert to a Number.
Bind(&hint_is_number);
{
Callable callable = CodeFactory::OrdinaryToPrimitive(
isolate(), OrdinaryToPrimitiveHint::kNumber);
Node* result = CallStub(callable, context, receiver);
Return(result);
}
// Use the OrdinaryToPrimitive builtin to convert to a String.
Bind(&hint_is_string);
{
Callable callable = CodeFactory::OrdinaryToPrimitive(
isolate(), OrdinaryToPrimitiveHint::kString);
Node* result = CallStub(callable, context, receiver);
Return(result);
}
// Raise a TypeError if the {hint} is invalid.
Bind(&hint_is_invalid);
{
CallRuntime(Runtime::kThrowInvalidHint, context, hint);
Unreachable();
}
// Raise a TypeError if the {receiver} is not a JSReceiver instance.
Bind(&receiver_is_invalid);
{
CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context,
HeapConstant(factory()->NewStringFromAsciiChecked(
"Date.prototype [ @@toPrimitive ]", TENURED)),
receiver);
Unreachable();
}
}
} // namespace internal
} // namespace v8
......@@ -17,15 +17,6 @@ namespace internal {
// -----------------------------------------------------------------------------
// ES6 section 20.3 Date Objects
class DateBuiltinsAssembler : public CodeStubAssembler {
public:
explicit DateBuiltinsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
protected:
void Generate_DatePrototype_GetField(int field_index);
};
namespace {
// ES6 section 20.3.1.1 Time Values and Time Range
......@@ -904,200 +895,5 @@ BUILTIN(DatePrototypeToJson) {
}
}
void DateBuiltinsAssembler::Generate_DatePrototype_GetField(int field_index) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Label receiver_not_date(this, Label::kDeferred);
GotoIf(TaggedIsSmi(receiver), &receiver_not_date);
Node* receiver_instance_type = LoadInstanceType(receiver);
GotoIf(Word32NotEqual(receiver_instance_type, Int32Constant(JS_DATE_TYPE)),
&receiver_not_date);
// Load the specified date field, falling back to the runtime as necessary.
if (field_index == JSDate::kDateValue) {
Return(LoadObjectField(receiver, JSDate::kValueOffset));
} else {
if (field_index < JSDate::kFirstUncachedField) {
Label stamp_mismatch(this, Label::kDeferred);
Node* date_cache_stamp = Load(
MachineType::AnyTagged(),
ExternalConstant(ExternalReference::date_cache_stamp(isolate())));
Node* cache_stamp = LoadObjectField(receiver, JSDate::kCacheStampOffset);
GotoIf(WordNotEqual(date_cache_stamp, cache_stamp), &stamp_mismatch);
Return(LoadObjectField(
receiver, JSDate::kValueOffset + field_index * kPointerSize));
Bind(&stamp_mismatch);
}
Node* field_index_smi = SmiConstant(Smi::FromInt(field_index));
Node* function =
ExternalConstant(ExternalReference::get_date_field_function(isolate()));
Node* result = CallCFunction2(
MachineType::AnyTagged(), MachineType::AnyTagged(),
MachineType::AnyTagged(), function, receiver, field_index_smi);
Return(result);
}
// Raise a TypeError if the receiver is not a date.
Bind(&receiver_not_date);
{
CallRuntime(Runtime::kThrowNotDateError, context);
Unreachable();
}
}
TF_BUILTIN(DatePrototypeGetDate, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kDay);
}
TF_BUILTIN(DatePrototypeGetDay, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kWeekday);
}
TF_BUILTIN(DatePrototypeGetFullYear, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kYear);
}
TF_BUILTIN(DatePrototypeGetHours, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kHour);
}
TF_BUILTIN(DatePrototypeGetMilliseconds, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMillisecond);
}
TF_BUILTIN(DatePrototypeGetMinutes, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMinute);
}
TF_BUILTIN(DatePrototypeGetMonth, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMonth);
}
TF_BUILTIN(DatePrototypeGetSeconds, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kSecond);
}
TF_BUILTIN(DatePrototypeGetTime, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kDateValue);
}
TF_BUILTIN(DatePrototypeGetTimezoneOffset, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kTimezoneOffset);
}
TF_BUILTIN(DatePrototypeGetUTCDate, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kDayUTC);
}
TF_BUILTIN(DatePrototypeGetUTCDay, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kWeekdayUTC);
}
TF_BUILTIN(DatePrototypeGetUTCFullYear, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kYearUTC);
}
TF_BUILTIN(DatePrototypeGetUTCHours, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kHourUTC);
}
TF_BUILTIN(DatePrototypeGetUTCMilliseconds, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMillisecondUTC);
}
TF_BUILTIN(DatePrototypeGetUTCMinutes, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMinuteUTC);
}
TF_BUILTIN(DatePrototypeGetUTCMonth, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kMonthUTC);
}
TF_BUILTIN(DatePrototypeGetUTCSeconds, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kSecondUTC);
}
TF_BUILTIN(DatePrototypeValueOf, DateBuiltinsAssembler) {
Generate_DatePrototype_GetField(JSDate::kDateValue);
}
TF_BUILTIN(DatePrototypeToPrimitive, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* hint = Parameter(1);
Node* context = Parameter(4);
// Check if the {receiver} is actually a JSReceiver.
Label receiver_is_invalid(this, Label::kDeferred);
GotoIf(TaggedIsSmi(receiver), &receiver_is_invalid);
GotoIfNot(IsJSReceiver(receiver), &receiver_is_invalid);
// Dispatch to the appropriate OrdinaryToPrimitive builtin.
Label hint_is_number(this), hint_is_string(this),
hint_is_invalid(this, Label::kDeferred);
// Fast cases for internalized strings.
Node* number_string = LoadRoot(Heap::knumber_stringRootIndex);
GotoIf(WordEqual(hint, number_string), &hint_is_number);
Node* default_string = LoadRoot(Heap::kdefault_stringRootIndex);
GotoIf(WordEqual(hint, default_string), &hint_is_string);
Node* string_string = LoadRoot(Heap::kstring_stringRootIndex);
GotoIf(WordEqual(hint, string_string), &hint_is_string);
// Slow-case with actual string comparisons.
Callable string_equal = CodeFactory::StringEqual(isolate());
GotoIf(TaggedIsSmi(hint), &hint_is_invalid);
GotoIfNot(IsString(hint), &hint_is_invalid);
GotoIf(WordEqual(CallStub(string_equal, context, hint, number_string),
TrueConstant()),
&hint_is_number);
GotoIf(WordEqual(CallStub(string_equal, context, hint, default_string),
TrueConstant()),
&hint_is_string);
GotoIf(WordEqual(CallStub(string_equal, context, hint, string_string),
TrueConstant()),
&hint_is_string);
Goto(&hint_is_invalid);
// Use the OrdinaryToPrimitive builtin to convert to a Number.
Bind(&hint_is_number);
{
Callable callable = CodeFactory::OrdinaryToPrimitive(
isolate(), OrdinaryToPrimitiveHint::kNumber);
Node* result = CallStub(callable, context, receiver);
Return(result);
}
// Use the OrdinaryToPrimitive builtin to convert to a String.
Bind(&hint_is_string);
{
Callable callable = CodeFactory::OrdinaryToPrimitive(
isolate(), OrdinaryToPrimitiveHint::kString);
Node* result = CallStub(callable, context, receiver);
Return(result);
}
// Raise a TypeError if the {hint} is invalid.
Bind(&hint_is_invalid);
{
CallRuntime(Runtime::kThrowInvalidHint, context, hint);
Unreachable();
}
// Raise a TypeError if the {receiver} is not a JSReceiver instance.
Bind(&receiver_is_invalid);
{
CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context,
HeapConstant(factory()->NewStringFromAsciiChecked(
"Date.prototype [ @@toPrimitive ]", TENURED)),
receiver);
Unreachable();
}
}
} // namespace internal
} // namespace v8
......@@ -4,7 +4,7 @@
#include "src/builtins/builtins-forin.h"
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
......
// Copyright 2017 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.
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
namespace v8 {
namespace internal {
TF_BUILTIN(FastFunctionPrototypeBind, CodeStubAssembler) {
Label slow(this);
Node* argc = Parameter(BuiltinDescriptor::kArgumentsCount);
Node* context = Parameter(BuiltinDescriptor::kContext);
Node* new_target = Parameter(BuiltinDescriptor::kNewTarget);
CodeStubArguments args(this, ChangeInt32ToIntPtr(argc));
// Check that receiver has instance type of JS_FUNCTION_TYPE
Node* receiver = args.GetReceiver();
GotoIf(TaggedIsSmi(receiver), &slow);
Node* receiver_map = LoadMap(receiver);
Node* instance_type = LoadMapInstanceType(receiver_map);
GotoIf(Word32NotEqual(instance_type, Int32Constant(JS_FUNCTION_TYPE)), &slow);
// Disallow binding of slow-mode functions. We need to figure out whether the
// length and name property are in the original state.
Comment("Disallow binding of slow-mode functions");
GotoIf(IsDictionaryMap(receiver_map), &slow);
// Check whether the length and name properties are still present as
// AccessorInfo objects. In that case, their value can be recomputed even if
// the actual value on the object changes.
Comment("Check descriptor array length");
Node* descriptors = LoadMapDescriptors(receiver_map);
Node* descriptors_length = LoadFixedArrayBaseLength(descriptors);
GotoIf(SmiLessThanOrEqual(descriptors_length, SmiConstant(1)), &slow);
// Check whether the length and name properties are still present as
// AccessorInfo objects. In that case, their value can be recomputed even if
// the actual value on the object changes.
Comment("Check name and length properties");
const int length_index = JSFunction::kLengthDescriptorIndex;
Node* maybe_length = LoadFixedArrayElement(
descriptors, DescriptorArray::ToKeyIndex(length_index));
GotoIf(WordNotEqual(maybe_length, LoadRoot(Heap::klength_stringRootIndex)),
&slow);
Node* maybe_length_accessor = LoadFixedArrayElement(
descriptors, DescriptorArray::ToValueIndex(length_index));
GotoIf(TaggedIsSmi(maybe_length_accessor), &slow);
Node* length_value_map = LoadMap(maybe_length_accessor);
GotoIfNot(IsAccessorInfoMap(length_value_map), &slow);
const int name_index = JSFunction::kNameDescriptorIndex;
Node* maybe_name = LoadFixedArrayElement(
descriptors, DescriptorArray::ToKeyIndex(name_index));
GotoIf(WordNotEqual(maybe_name, LoadRoot(Heap::kname_stringRootIndex)),
&slow);
Node* maybe_name_accessor = LoadFixedArrayElement(
descriptors, DescriptorArray::ToValueIndex(name_index));
GotoIf(TaggedIsSmi(maybe_name_accessor), &slow);
Node* name_value_map = LoadMap(maybe_name_accessor);
GotoIfNot(IsAccessorInfoMap(name_value_map), &slow);
// Choose the right bound function map based on whether the target is
// constructable.
Comment("Choose the right bound function map");
Variable bound_function_map(this, MachineRepresentation::kTagged);
Label with_constructor(this);
VariableList vars({&bound_function_map}, zone());
Node* native_context = LoadNativeContext(context);
Label map_done(this, vars);
Node* bit_field = LoadMapBitField(receiver_map);
int mask = static_cast<int>(1 << Map::kIsConstructor);
GotoIf(IsSetWord32(bit_field, mask), &with_constructor);
bound_function_map.Bind(LoadContextElement(
native_context, Context::BOUND_FUNCTION_WITHOUT_CONSTRUCTOR_MAP_INDEX));
Goto(&map_done);
Bind(&with_constructor);
bound_function_map.Bind(LoadContextElement(
native_context, Context::BOUND_FUNCTION_WITH_CONSTRUCTOR_MAP_INDEX));
Goto(&map_done);
Bind(&map_done);
// Verify that __proto__ matches that of a the target bound function.
Comment("Verify that __proto__ matches target bound function");
Node* prototype = LoadMapPrototype(receiver_map);
Node* expected_prototype = LoadMapPrototype(bound_function_map.value());
GotoIf(WordNotEqual(prototype, expected_prototype), &slow);
// Allocate the arguments array.
Comment("Allocate the arguments array");
Variable argument_array(this, MachineRepresentation::kTagged);
Label empty_arguments(this);
Label arguments_done(this, &argument_array);
GotoIf(Uint32LessThanOrEqual(argc, Int32Constant(1)), &empty_arguments);
Node* elements_length = ChangeUint32ToWord(Int32Sub(argc, Int32Constant(1)));
Node* elements = AllocateFixedArray(FAST_ELEMENTS, elements_length);
Variable index(this, MachineType::PointerRepresentation());
index.Bind(IntPtrConstant(0));
VariableList foreach_vars({&index}, zone());
args.ForEach(foreach_vars,
[this, elements, &index](Node* arg) {
StoreFixedArrayElement(elements, index.value(), arg);
Increment(index);
},
IntPtrConstant(1));
argument_array.Bind(elements);
Goto(&arguments_done);
Bind(&empty_arguments);
argument_array.Bind(EmptyFixedArrayConstant());
Goto(&arguments_done);
Bind(&arguments_done);
// Determine bound receiver.
Comment("Determine bound receiver");
Variable bound_receiver(this, MachineRepresentation::kTagged);
Label has_receiver(this);
Label receiver_done(this, &bound_receiver);
GotoIf(Word32NotEqual(argc, Int32Constant(0)), &has_receiver);
bound_receiver.Bind(UndefinedConstant());
Goto(&receiver_done);
Bind(&has_receiver);
bound_receiver.Bind(args.AtIndex(0));
Goto(&receiver_done);
Bind(&receiver_done);
// Allocate the resulting bound function.
Comment("Allocate the resulting bound function");
Node* bound_function = Allocate(JSBoundFunction::kSize);
StoreMapNoWriteBarrier(bound_function, bound_function_map.value());
StoreObjectFieldNoWriteBarrier(
bound_function, JSBoundFunction::kBoundTargetFunctionOffset, receiver);
StoreObjectFieldNoWriteBarrier(bound_function,
JSBoundFunction::kBoundThisOffset,
bound_receiver.value());
StoreObjectFieldNoWriteBarrier(bound_function,
JSBoundFunction::kBoundArgumentsOffset,
argument_array.value());
Node* empty_fixed_array = EmptyFixedArrayConstant();
StoreObjectFieldNoWriteBarrier(bound_function, JSObject::kPropertiesOffset,
empty_fixed_array);
StoreObjectFieldNoWriteBarrier(bound_function, JSObject::kElementsOffset,
empty_fixed_array);
args.PopAndReturn(bound_function);
Bind(&slow);
Node* target = LoadFromFrame(StandardFrameConstants::kFunctionOffset,
MachineType::TaggedPointer());
TailCallStub(CodeFactory::FunctionPrototypeBind(isolate()), context, target,
new_target, argc);
}
// ES6 section 19.2.3.6 Function.prototype [ @@hasInstance ] ( V )
TF_BUILTIN(FunctionPrototypeHasInstance, CodeStubAssembler) {
Node* f = Parameter(0);
Node* v = Parameter(1);
Node* context = Parameter(4);
Node* result = OrdinaryHasInstance(context, f, v);
Return(result);
}
} // namespace internal
} // namespace v8
......@@ -5,7 +5,6 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
#include "src/compiler.h"
#include "src/conversions.h"
#include "src/counters.h"
......@@ -272,162 +271,6 @@ Object* DoFunctionBind(Isolate* isolate, BuiltinArguments args) {
// ES6 section 19.2.3.2 Function.prototype.bind ( thisArg, ...args )
BUILTIN(FunctionPrototypeBind) { return DoFunctionBind(isolate, args); }
TF_BUILTIN(FastFunctionPrototypeBind, CodeStubAssembler) {
Label slow(this);
Node* argc = Parameter(BuiltinDescriptor::kArgumentsCount);
Node* context = Parameter(BuiltinDescriptor::kContext);
Node* new_target = Parameter(BuiltinDescriptor::kNewTarget);
CodeStubArguments args(this, ChangeInt32ToIntPtr(argc));
// Check that receiver has instance type of JS_FUNCTION_TYPE
Node* receiver = args.GetReceiver();
GotoIf(TaggedIsSmi(receiver), &slow);
Node* receiver_map = LoadMap(receiver);
Node* instance_type = LoadMapInstanceType(receiver_map);
GotoIf(Word32NotEqual(instance_type, Int32Constant(JS_FUNCTION_TYPE)), &slow);
// Disallow binding of slow-mode functions. We need to figure out whether the
// length and name property are in the original state.
Comment("Disallow binding of slow-mode functions");
GotoIf(IsDictionaryMap(receiver_map), &slow);
// Check whether the length and name properties are still present as
// AccessorInfo objects. In that case, their value can be recomputed even if
// the actual value on the object changes.
Comment("Check descriptor array length");
Node* descriptors = LoadMapDescriptors(receiver_map);
Node* descriptors_length = LoadFixedArrayBaseLength(descriptors);
GotoIf(SmiLessThanOrEqual(descriptors_length, SmiConstant(1)), &slow);
// Check whether the length and name properties are still present as
// AccessorInfo objects. In that case, their value can be recomputed even if
// the actual value on the object changes.
Comment("Check name and length properties");
const int length_index = JSFunction::kLengthDescriptorIndex;
Node* maybe_length = LoadFixedArrayElement(
descriptors, DescriptorArray::ToKeyIndex(length_index));
GotoIf(WordNotEqual(maybe_length, LoadRoot(Heap::klength_stringRootIndex)),
&slow);
Node* maybe_length_accessor = LoadFixedArrayElement(
descriptors, DescriptorArray::ToValueIndex(length_index));
GotoIf(TaggedIsSmi(maybe_length_accessor), &slow);
Node* length_value_map = LoadMap(maybe_length_accessor);
GotoIfNot(IsAccessorInfoMap(length_value_map), &slow);
const int name_index = JSFunction::kNameDescriptorIndex;
Node* maybe_name = LoadFixedArrayElement(
descriptors, DescriptorArray::ToKeyIndex(name_index));
GotoIf(WordNotEqual(maybe_name, LoadRoot(Heap::kname_stringRootIndex)),
&slow);
Node* maybe_name_accessor = LoadFixedArrayElement(
descriptors, DescriptorArray::ToValueIndex(name_index));
GotoIf(TaggedIsSmi(maybe_name_accessor), &slow);
Node* name_value_map = LoadMap(maybe_name_accessor);
GotoIfNot(IsAccessorInfoMap(name_value_map), &slow);
// Choose the right bound function map based on whether the target is
// constructable.
Comment("Choose the right bound function map");
Variable bound_function_map(this, MachineRepresentation::kTagged);
Label with_constructor(this);
VariableList vars({&bound_function_map}, zone());
Node* native_context = LoadNativeContext(context);
Label map_done(this, vars);
Node* bit_field = LoadMapBitField(receiver_map);
int mask = static_cast<int>(1 << Map::kIsConstructor);
GotoIf(IsSetWord32(bit_field, mask), &with_constructor);
bound_function_map.Bind(LoadContextElement(
native_context, Context::BOUND_FUNCTION_WITHOUT_CONSTRUCTOR_MAP_INDEX));
Goto(&map_done);
Bind(&with_constructor);
bound_function_map.Bind(LoadContextElement(
native_context, Context::BOUND_FUNCTION_WITH_CONSTRUCTOR_MAP_INDEX));
Goto(&map_done);
Bind(&map_done);
// Verify that __proto__ matches that of a the target bound function.
Comment("Verify that __proto__ matches target bound function");
Node* prototype = LoadMapPrototype(receiver_map);
Node* expected_prototype = LoadMapPrototype(bound_function_map.value());
GotoIf(WordNotEqual(prototype, expected_prototype), &slow);
// Allocate the arguments array.
Comment("Allocate the arguments array");
Variable argument_array(this, MachineRepresentation::kTagged);
Label empty_arguments(this);
Label arguments_done(this, &argument_array);
GotoIf(Uint32LessThanOrEqual(argc, Int32Constant(1)), &empty_arguments);
Node* elements_length = ChangeUint32ToWord(Int32Sub(argc, Int32Constant(1)));
Node* elements = AllocateFixedArray(FAST_ELEMENTS, elements_length);
Variable index(this, MachineType::PointerRepresentation());
index.Bind(IntPtrConstant(0));
VariableList foreach_vars({&index}, zone());
args.ForEach(foreach_vars,
[this, elements, &index](Node* arg) {
StoreFixedArrayElement(elements, index.value(), arg);
Increment(index);
},
IntPtrConstant(1));
argument_array.Bind(elements);
Goto(&arguments_done);
Bind(&empty_arguments);
argument_array.Bind(EmptyFixedArrayConstant());
Goto(&arguments_done);
Bind(&arguments_done);
// Determine bound receiver.
Comment("Determine bound receiver");
Variable bound_receiver(this, MachineRepresentation::kTagged);
Label has_receiver(this);
Label receiver_done(this, &bound_receiver);
GotoIf(Word32NotEqual(argc, Int32Constant(0)), &has_receiver);
bound_receiver.Bind(UndefinedConstant());
Goto(&receiver_done);
Bind(&has_receiver);
bound_receiver.Bind(args.AtIndex(0));
Goto(&receiver_done);
Bind(&receiver_done);
// Allocate the resulting bound function.
Comment("Allocate the resulting bound function");
Node* bound_function = Allocate(JSBoundFunction::kSize);
StoreMapNoWriteBarrier(bound_function, bound_function_map.value());
StoreObjectFieldNoWriteBarrier(
bound_function, JSBoundFunction::kBoundTargetFunctionOffset, receiver);
StoreObjectFieldNoWriteBarrier(bound_function,
JSBoundFunction::kBoundThisOffset,
bound_receiver.value());
StoreObjectFieldNoWriteBarrier(bound_function,
JSBoundFunction::kBoundArgumentsOffset,
argument_array.value());
Node* empty_fixed_array = EmptyFixedArrayConstant();
StoreObjectFieldNoWriteBarrier(bound_function, JSObject::kPropertiesOffset,
empty_fixed_array);
StoreObjectFieldNoWriteBarrier(bound_function, JSObject::kElementsOffset,
empty_fixed_array);
args.PopAndReturn(bound_function);
Bind(&slow);
Node* target = LoadFromFrame(StandardFrameConstants::kFunctionOffset,
MachineType::TaggedPointer());
TailCallStub(CodeFactory::FunctionPrototypeBind(isolate()), context, target,
new_target, argc);
}
// TODO(verwaest): This is a temporary helper until the FastFunctionBind stub
// can tailcall to the builtin directly.
RUNTIME_FUNCTION(Runtime_FunctionBind) {
......@@ -454,14 +297,5 @@ BUILTIN(FunctionPrototypeToString) {
"Function.prototype.toString")));
}
// ES6 section 19.2.3.6 Function.prototype [ @@hasInstance ] ( V )
TF_BUILTIN(FunctionPrototypeHasInstance, CodeStubAssembler) {
Node* f = Parameter(0);
Node* v = Parameter(1);
Node* context = Parameter(4);
Node* result = OrdinaryHasInstance(context, f, v);
Return(result);
}
} // namespace internal
} // namespace v8
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
......@@ -12,11 +12,9 @@
namespace v8 {
namespace internal {
typedef compiler::CodeAssemblerState CodeAssemblerState;
class GeneratorBuiltinsAssembler : public CodeStubAssembler {
public:
explicit GeneratorBuiltinsAssembler(CodeAssemblerState* state)
explicit GeneratorBuiltinsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
protected:
......
// Copyright 2017 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.
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
namespace v8 {
namespace internal {
// ES6 section 18.2.2 isFinite ( number )
TF_BUILTIN(GlobalIsFinite, CodeStubAssembler) {
Node* context = Parameter(4);
Label return_true(this), return_false(this);
// We might need to loop once for ToNumber conversion.
Variable var_num(this, MachineRepresentation::kTagged);
Label loop(this, &var_num);
var_num.Bind(Parameter(1));
Goto(&loop);
Bind(&loop);
{
Node* num = var_num.value();
// Check if {num} is a Smi or a HeapObject.
GotoIf(TaggedIsSmi(num), &return_true);
// Check if {num} is a HeapNumber.
Label if_numisheapnumber(this),
if_numisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(num)), &if_numisheapnumber,
&if_numisnotheapnumber);
Bind(&if_numisheapnumber);
{
// Check if {num} contains a finite, non-NaN value.
Node* num_value = LoadHeapNumberValue(num);
BranchIfFloat64IsNaN(Float64Sub(num_value, num_value), &return_false,
&return_true);
}
Bind(&if_numisnotheapnumber);
{
// Need to convert {num} to a Number first.
Callable callable = CodeFactory::NonNumberToNumber(isolate());
var_num.Bind(CallStub(callable, context, num));
Goto(&loop);
}
}
Bind(&return_true);
Return(BooleanConstant(true));
Bind(&return_false);
Return(BooleanConstant(false));
}
// ES6 section 18.2.3 isNaN ( number )
TF_BUILTIN(GlobalIsNaN, CodeStubAssembler) {
Node* context = Parameter(4);
Label return_true(this), return_false(this);
// We might need to loop once for ToNumber conversion.
Variable var_num(this, MachineRepresentation::kTagged);
Label loop(this, &var_num);
var_num.Bind(Parameter(1));
Goto(&loop);
Bind(&loop);
{
Node* num = var_num.value();
// Check if {num} is a Smi or a HeapObject.
GotoIf(TaggedIsSmi(num), &return_false);
// Check if {num} is a HeapNumber.
Label if_numisheapnumber(this),
if_numisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(num)), &if_numisheapnumber,
&if_numisnotheapnumber);
Bind(&if_numisheapnumber);
{
// Check if {num} contains a NaN.
Node* num_value = LoadHeapNumberValue(num);
BranchIfFloat64IsNaN(num_value, &return_true, &return_false);
}
Bind(&if_numisnotheapnumber);
{
// Need to convert {num} to a Number first.
Callable callable = CodeFactory::NonNumberToNumber(isolate());
var_num.Bind(CallStub(callable, context, num));
Goto(&loop);
}
}
Bind(&return_true);
Return(BooleanConstant(true));
Bind(&return_false);
Return(BooleanConstant(false));
}
} // namespace internal
} // namespace v8
......@@ -5,7 +5,6 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
#include "src/compiler.h"
#include "src/counters.h"
#include "src/objects-inl.h"
......@@ -103,100 +102,5 @@ BUILTIN(GlobalEval) {
Execution::Call(isolate, function, target_global_proxy, 0, nullptr));
}
// ES6 section 18.2.2 isFinite ( number )
TF_BUILTIN(GlobalIsFinite, CodeStubAssembler) {
Node* context = Parameter(4);
Label return_true(this), return_false(this);
// We might need to loop once for ToNumber conversion.
Variable var_num(this, MachineRepresentation::kTagged);
Label loop(this, &var_num);
var_num.Bind(Parameter(1));
Goto(&loop);
Bind(&loop);
{
Node* num = var_num.value();
// Check if {num} is a Smi or a HeapObject.
GotoIf(TaggedIsSmi(num), &return_true);
// Check if {num} is a HeapNumber.
Label if_numisheapnumber(this),
if_numisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(num)), &if_numisheapnumber,
&if_numisnotheapnumber);
Bind(&if_numisheapnumber);
{
// Check if {num} contains a finite, non-NaN value.
Node* num_value = LoadHeapNumberValue(num);
BranchIfFloat64IsNaN(Float64Sub(num_value, num_value), &return_false,
&return_true);
}
Bind(&if_numisnotheapnumber);
{
// Need to convert {num} to a Number first.
Callable callable = CodeFactory::NonNumberToNumber(isolate());
var_num.Bind(CallStub(callable, context, num));
Goto(&loop);
}
}
Bind(&return_true);
Return(BooleanConstant(true));
Bind(&return_false);
Return(BooleanConstant(false));
}
// ES6 section 18.2.3 isNaN ( number )
TF_BUILTIN(GlobalIsNaN, CodeStubAssembler) {
Node* context = Parameter(4);
Label return_true(this), return_false(this);
// We might need to loop once for ToNumber conversion.
Variable var_num(this, MachineRepresentation::kTagged);
Label loop(this, &var_num);
var_num.Bind(Parameter(1));
Goto(&loop);
Bind(&loop);
{
Node* num = var_num.value();
// Check if {num} is a Smi or a HeapObject.
GotoIf(TaggedIsSmi(num), &return_false);
// Check if {num} is a HeapNumber.
Label if_numisheapnumber(this),
if_numisnotheapnumber(this, Label::kDeferred);
Branch(IsHeapNumberMap(LoadMap(num)), &if_numisheapnumber,
&if_numisnotheapnumber);
Bind(&if_numisheapnumber);
{
// Check if {num} contains a NaN.
Node* num_value = LoadHeapNumberValue(num);
BranchIfFloat64IsNaN(num_value, &return_true, &return_false);
}
Bind(&if_numisnotheapnumber);
{
// Need to convert {num} to a Number first.
Callable callable = CodeFactory::NonNumberToNumber(isolate());
var_num.Bind(CallStub(callable, context, num));
Goto(&loop);
}
}
Bind(&return_true);
Return(BooleanConstant(true));
Bind(&return_false);
Return(BooleanConstant(false));
}
} // namespace internal
} // namespace v8
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/ic/handler-compiler.h"
......
......@@ -2,10 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/ic/accessor-assembler.h"
#include "src/objects-inl.h"
namespace v8 {
namespace internal {
......
// Copyright 2017 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.
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/macro-assembler.h"
#include "src/runtime/runtime.h"
namespace v8 {
namespace internal {
// -----------------------------------------------------------------------------
// Interrupt and stack checks.
void Builtins::Generate_InterruptCheck(MacroAssembler* masm) {
masm->TailCallRuntime(Runtime::kInterrupt);
}
void Builtins::Generate_StackCheck(MacroAssembler* masm) {
masm->TailCallRuntime(Runtime::kStackGuard);
}
// -----------------------------------------------------------------------------
// TurboFan support builtins.
TF_BUILTIN(CopyFastSmiOrObjectElements, CodeStubAssembler) {
typedef CopyFastSmiOrObjectElementsDescriptor Descriptor;
Node* object = Parameter(Descriptor::kObject);
// Load the {object}s elements.
Node* source = LoadObjectField(object, JSObject::kElementsOffset);
ParameterMode mode = OptimalParameterMode();
Node* length = TaggedToParameter(LoadFixedArrayBaseLength(source), mode);
// Check if we can allocate in new space.
ElementsKind kind = FAST_ELEMENTS;
int max_elements = FixedArrayBase::GetMaxLengthForNewSpaceAllocation(kind);
Label if_newspace(this), if_oldspace(this);
Branch(UintPtrOrSmiLessThan(length, IntPtrOrSmiConstant(max_elements, mode),
mode),
&if_newspace, &if_oldspace);
Bind(&if_newspace);
{
Node* target = AllocateFixedArray(kind, length, mode);
CopyFixedArrayElements(kind, source, target, length, SKIP_WRITE_BARRIER,
mode);
StoreObjectField(object, JSObject::kElementsOffset, target);
Return(target);
}
Bind(&if_oldspace);
{
Node* target = AllocateFixedArray(kind, length, mode, kPretenured);
CopyFixedArrayElements(kind, source, target, length, UPDATE_WRITE_BARRIER,
mode);
StoreObjectField(object, JSObject::kElementsOffset, target);
Return(target);
}
}
TF_BUILTIN(GrowFastDoubleElements, CodeStubAssembler) {
typedef GrowArrayElementsDescriptor Descriptor;
Node* object = Parameter(Descriptor::kObject);
Node* key = Parameter(Descriptor::kKey);
Node* context = Parameter(Descriptor::kContext);
Label runtime(this, Label::kDeferred);
Node* elements = LoadElements(object);
elements = TryGrowElementsCapacity(object, elements, FAST_DOUBLE_ELEMENTS,
key, &runtime);
Return(elements);
Bind(&runtime);
TailCallRuntime(Runtime::kGrowArrayElements, context, object, key);
}
TF_BUILTIN(GrowFastSmiOrObjectElements, CodeStubAssembler) {
typedef GrowArrayElementsDescriptor Descriptor;
Node* object = Parameter(Descriptor::kObject);
Node* key = Parameter(Descriptor::kKey);
Node* context = Parameter(Descriptor::kContext);
Label runtime(this, Label::kDeferred);
Node* elements = LoadElements(object);
elements =
TryGrowElementsCapacity(object, elements, FAST_ELEMENTS, key, &runtime);
Return(elements);
Bind(&runtime);
TailCallRuntime(Runtime::kGrowArrayElements, context, object, key);
}
TF_BUILTIN(NewUnmappedArgumentsElements, CodeStubAssembler) {
typedef NewArgumentsElementsDescriptor Descriptor;
Node* frame = Parameter(Descriptor::kFrame);
Node* length = SmiToWord(Parameter(Descriptor::kLength));
// Check if we can allocate in new space.
ElementsKind kind = FAST_ELEMENTS;
int max_elements = FixedArray::GetMaxLengthForNewSpaceAllocation(kind);
Label if_newspace(this), if_oldspace(this, Label::kDeferred);
Branch(IntPtrLessThan(length, IntPtrConstant(max_elements)), &if_newspace,
&if_oldspace);
Bind(&if_newspace);
{
// Prefer EmptyFixedArray in case of non-positive {length} (the {length}
// can be negative here for rest parameters).
Label if_empty(this), if_notempty(this);
Branch(IntPtrLessThanOrEqual(length, IntPtrConstant(0)), &if_empty,
&if_notempty);
Bind(&if_empty);
Return(EmptyFixedArrayConstant());
Bind(&if_notempty);
{
// Allocate a FixedArray in new space.
Node* result = AllocateFixedArray(kind, length);
// Compute the effective {offset} into the {frame}.
Node* offset = IntPtrAdd(length, IntPtrConstant(1));
// Copy the parameters from {frame} (starting at {offset}) to {result}.
Variable var_index(this, MachineType::PointerRepresentation());
Label loop(this, &var_index), done_loop(this);
var_index.Bind(IntPtrConstant(0));
Goto(&loop);
Bind(&loop);
{
// Load the current {index}.
Node* index = var_index.value();
// Check if we are done.
GotoIf(WordEqual(index, length), &done_loop);
// Load the parameter at the given {index}.
Node* value = Load(MachineType::AnyTagged(), frame,
WordShl(IntPtrSub(offset, index),
IntPtrConstant(kPointerSizeLog2)));
// Store the {value} into the {result}.
StoreFixedArrayElement(result, index, value, SKIP_WRITE_BARRIER);
// Continue with next {index}.
var_index.Bind(IntPtrAdd(index, IntPtrConstant(1)));
Goto(&loop);
}
Bind(&done_loop);
Return(result);
}
}
Bind(&if_oldspace);
{
// Allocate in old space (or large object space).
TailCallRuntime(Runtime::kNewArgumentsElements, NoContextConstant(),
BitcastWordToTagged(frame), SmiFromWord(length));
}
}
TF_BUILTIN(ReturnReceiver, CodeStubAssembler) { Return(Parameter(0)); }
} // namespace internal
} // namespace v8
......@@ -4,10 +4,8 @@
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/counters.h"
#include "src/interface-descriptors.h"
#include "src/macro-assembler.h"
#include "src/objects-inl.h"
namespace v8 {
......@@ -42,164 +40,5 @@ BUILTIN(RestrictedStrictArgumentsPropertiesThrower) {
isolate, NewTypeError(MessageTemplate::kStrictPoisonPill));
}
// -----------------------------------------------------------------------------
// Interrupt and stack checks.
void Builtins::Generate_InterruptCheck(MacroAssembler* masm) {
masm->TailCallRuntime(Runtime::kInterrupt);
}
void Builtins::Generate_StackCheck(MacroAssembler* masm) {
masm->TailCallRuntime(Runtime::kStackGuard);
}
// -----------------------------------------------------------------------------
// TurboFan support builtins.
TF_BUILTIN(CopyFastSmiOrObjectElements, CodeStubAssembler) {
typedef CopyFastSmiOrObjectElementsDescriptor Descriptor;
Node* object = Parameter(Descriptor::kObject);
// Load the {object}s elements.
Node* source = LoadObjectField(object, JSObject::kElementsOffset);
ParameterMode mode = OptimalParameterMode();
Node* length = TaggedToParameter(LoadFixedArrayBaseLength(source), mode);
// Check if we can allocate in new space.
ElementsKind kind = FAST_ELEMENTS;
int max_elements = FixedArrayBase::GetMaxLengthForNewSpaceAllocation(kind);
Label if_newspace(this), if_oldspace(this);
Branch(UintPtrOrSmiLessThan(length, IntPtrOrSmiConstant(max_elements, mode),
mode),
&if_newspace, &if_oldspace);
Bind(&if_newspace);
{
Node* target = AllocateFixedArray(kind, length, mode);
CopyFixedArrayElements(kind, source, target, length, SKIP_WRITE_BARRIER,
mode);
StoreObjectField(object, JSObject::kElementsOffset, target);
Return(target);
}
Bind(&if_oldspace);
{
Node* target = AllocateFixedArray(kind, length, mode, kPretenured);
CopyFixedArrayElements(kind, source, target, length, UPDATE_WRITE_BARRIER,
mode);
StoreObjectField(object, JSObject::kElementsOffset, target);
Return(target);
}
}
TF_BUILTIN(GrowFastDoubleElements, CodeStubAssembler) {
typedef GrowArrayElementsDescriptor Descriptor;
Node* object = Parameter(Descriptor::kObject);
Node* key = Parameter(Descriptor::kKey);
Node* context = Parameter(Descriptor::kContext);
Label runtime(this, Label::kDeferred);
Node* elements = LoadElements(object);
elements = TryGrowElementsCapacity(object, elements, FAST_DOUBLE_ELEMENTS,
key, &runtime);
Return(elements);
Bind(&runtime);
TailCallRuntime(Runtime::kGrowArrayElements, context, object, key);
}
TF_BUILTIN(GrowFastSmiOrObjectElements, CodeStubAssembler) {
typedef GrowArrayElementsDescriptor Descriptor;
Node* object = Parameter(Descriptor::kObject);
Node* key = Parameter(Descriptor::kKey);
Node* context = Parameter(Descriptor::kContext);
Label runtime(this, Label::kDeferred);
Node* elements = LoadElements(object);
elements =
TryGrowElementsCapacity(object, elements, FAST_ELEMENTS, key, &runtime);
Return(elements);
Bind(&runtime);
TailCallRuntime(Runtime::kGrowArrayElements, context, object, key);
}
TF_BUILTIN(NewUnmappedArgumentsElements, CodeStubAssembler) {
typedef NewArgumentsElementsDescriptor Descriptor;
Node* frame = Parameter(Descriptor::kFrame);
Node* length = SmiToWord(Parameter(Descriptor::kLength));
// Check if we can allocate in new space.
ElementsKind kind = FAST_ELEMENTS;
int max_elements = FixedArray::GetMaxLengthForNewSpaceAllocation(kind);
Label if_newspace(this), if_oldspace(this, Label::kDeferred);
Branch(IntPtrLessThan(length, IntPtrConstant(max_elements)), &if_newspace,
&if_oldspace);
Bind(&if_newspace);
{
// Prefer EmptyFixedArray in case of non-positive {length} (the {length}
// can be negative here for rest parameters).
Label if_empty(this), if_notempty(this);
Branch(IntPtrLessThanOrEqual(length, IntPtrConstant(0)), &if_empty,
&if_notempty);
Bind(&if_empty);
Return(EmptyFixedArrayConstant());
Bind(&if_notempty);
{
// Allocate a FixedArray in new space.
Node* result = AllocateFixedArray(kind, length);
// Compute the effective {offset} into the {frame}.
Node* offset = IntPtrAdd(length, IntPtrConstant(1));
// Copy the parameters from {frame} (starting at {offset}) to {result}.
Variable var_index(this, MachineType::PointerRepresentation());
Label loop(this, &var_index), done_loop(this);
var_index.Bind(IntPtrConstant(0));
Goto(&loop);
Bind(&loop);
{
// Load the current {index}.
Node* index = var_index.value();
// Check if we are done.
GotoIf(WordEqual(index, length), &done_loop);
// Load the parameter at the given {index}.
Node* value = Load(MachineType::AnyTagged(), frame,
WordShl(IntPtrSub(offset, index),
IntPtrConstant(kPointerSizeLog2)));
// Store the {value} into the {result}.
StoreFixedArrayElement(result, index, value, SKIP_WRITE_BARRIER);
// Continue with next {index}.
var_index.Bind(IntPtrAdd(index, IntPtrConstant(1)));
Goto(&loop);
}
Bind(&done_loop);
Return(result);
}
}
Bind(&if_oldspace);
{
// Allocate in old space (or large object space).
TailCallRuntime(Runtime::kNewArgumentsElements, NoContextConstant(),
BitcastWordToTagged(frame), SmiFromWord(length));
}
}
TF_BUILTIN(ReturnReceiver, CodeStubAssembler) { Return(Parameter(0)); }
} // namespace internal
} // namespace v8
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/builtins/builtins-promise.h"
#include "src/builtins/builtins-constructor.h"
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-promise.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
......@@ -13,6 +13,8 @@
namespace v8 {
namespace internal {
using compiler::Node;
Node* PromiseBuiltinsAssembler::AllocateJSPromise(Node* context) {
Node* const native_context = LoadNativeContext(context);
Node* const promise_fun =
......@@ -410,7 +412,6 @@ Node* PromiseBuiltinsAssembler::InternalPerformPromiseThen(
Node* context, Node* promise, Node* on_resolve, Node* on_reject,
Node* deferred_promise, Node* deferred_on_resolve,
Node* deferred_on_reject) {
Variable var_on_resolve(this, MachineRepresentation::kTagged),
var_on_reject(this, MachineRepresentation::kTagged);
......
......@@ -11,8 +11,6 @@
namespace v8 {
namespace internal {
typedef compiler::Node Node;
typedef CodeStubAssembler::ParameterMode ParameterMode;
typedef compiler::CodeAssemblerState CodeAssemblerState;
class PromiseBuiltinsAssembler : public CodeStubAssembler {
......@@ -48,7 +46,7 @@ class PromiseBuiltinsAssembler : public CodeStubAssembler {
kOnFinallyContextLength,
};
explicit PromiseBuiltinsAssembler(CodeAssemblerState* state)
explicit PromiseBuiltinsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
// These allocate and initialize a promise with pending state and
// undefined fields.
......
This diff is collapsed.
......@@ -10,13 +10,9 @@
namespace v8 {
namespace internal {
typedef compiler::Node Node;
typedef compiler::CodeAssemblerState CodeAssemblerState;
typedef compiler::CodeAssemblerLabel CodeAssemblerLabel;
class RegExpBuiltinsAssembler : public CodeStubAssembler {
public:
explicit RegExpBuiltinsAssembler(CodeAssemblerState* state)
explicit RegExpBuiltinsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}
void BranchIfFastRegExp(Node* const context, Node* const map,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/builtins/builtins-utils.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/code-stub-assembler.h"
#include "src/objects-inl.h"
#include "src/wasm/wasm-opcodes.h"
......
This diff is collapsed.
This diff is collapsed.
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