Revert of [cleanup] CodeStubAssembler: s/compiler::Node/Node/ (patchset #1 id:1 of https://codereview.chromium.org/2526803002/ )

Reason for revert:
Needed to revert https://codereview.chromium.org/2522393002/

Original issue's description:
> Reland of [cleanup] CodeStubAssembler: s/compiler::Node/Node/
>
> Reducing visual clutter.
>
> No changes since previous attempt; this was only reverted because it blocked another revert.
> Original review: https://codereview.chromium.org/2519093002/
>
> TBR=ishell@chromium.org
>
> Committed: https://crrev.com/c28bee0fdd297d2ef4fc88b5fe289cc9dbd664f6
> Cr-Commit-Position: refs/heads/master@{#41235}

TBR=ishell@chromium.org,jkummerow@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2529863002
Cr-Commit-Position: refs/heads/master@{#41249}
This commit is contained in:
hablich 2016-11-24 00:40:07 -08:00 committed by Commit bot
parent fa37f96e35
commit a87d252999
2 changed files with 656 additions and 481 deletions

View File

@ -884,12 +884,13 @@ void CodeStubAssembler::BranchIfToBooleanIsTrue(Node* value, Label* if_true,
}
}
Node* CodeStubAssembler::LoadFromFrame(int offset, MachineType rep) {
compiler::Node* CodeStubAssembler::LoadFromFrame(int offset, MachineType rep) {
Node* frame_pointer = LoadFramePointer();
return Load(rep, frame_pointer, IntPtrConstant(offset));
}
Node* CodeStubAssembler::LoadFromParentFrame(int offset, MachineType rep) {
compiler::Node* CodeStubAssembler::LoadFromParentFrame(int offset,
MachineType rep) {
Node* frame_pointer = LoadParentFramePointer();
return Load(rep, frame_pointer, IntPtrConstant(offset));
}
@ -2075,12 +2076,11 @@ void CodeStubAssembler::CopyFixedArrayElements(
Comment("] CopyFixedArrayElements");
}
void CodeStubAssembler::CopyStringCharacters(Node* from_string, Node* to_string,
Node* from_index, Node* to_index,
Node* character_count,
String::Encoding from_encoding,
String::Encoding to_encoding,
ParameterMode mode) {
void CodeStubAssembler::CopyStringCharacters(
compiler::Node* from_string, compiler::Node* to_string,
compiler::Node* from_index, compiler::Node* to_index,
compiler::Node* character_count, String::Encoding from_encoding,
String::Encoding to_encoding, ParameterMode mode) {
bool from_one_byte = from_encoding == String::ONE_BYTE_ENCODING;
bool to_one_byte = to_encoding == String::ONE_BYTE_ENCODING;
DCHECK_IMPLIES(to_one_byte, from_one_byte);
@ -2239,9 +2239,9 @@ Node* CodeStubAssembler::GrowElementsCapacity(
return new_elements;
}
void CodeStubAssembler::InitializeAllocationMemento(Node* base_allocation,
int base_allocation_size,
Node* allocation_site) {
void CodeStubAssembler::InitializeAllocationMemento(
compiler::Node* base_allocation, int base_allocation_size,
compiler::Node* allocation_site) {
StoreObjectFieldNoWriteBarrier(
base_allocation, AllocationMemento::kMapOffset + base_allocation_size,
HeapConstant(Handle<Map>(isolate()->heap()->allocation_memento_map())));
@ -3442,7 +3442,7 @@ Node* CodeStubAssembler::StringIndexOfChar(Node* context, Node* string,
return var_result.value();
}
Node* CodeStubAssembler::StringFromCodePoint(Node* codepoint,
Node* CodeStubAssembler::StringFromCodePoint(compiler::Node* codepoint,
UnicodeEncoding encoding) {
Variable var_result(this, MachineRepresentation::kTagged);
var_result.Bind(EmptyStringConstant());
@ -3520,7 +3520,8 @@ Node* CodeStubAssembler::StringToNumber(Node* context, Node* input) {
return var_result.value();
}
Node* CodeStubAssembler::NumberToString(Node* context, Node* argument) {
Node* CodeStubAssembler::NumberToString(compiler::Node* context,
compiler::Node* argument) {
Variable result(this, MachineRepresentation::kTagged);
Label runtime(this, Label::kDeferred);
Label smi(this);
@ -3599,6 +3600,9 @@ Node* CodeStubAssembler::NumberToString(Node* context, Node* argument) {
}
Node* CodeStubAssembler::ToName(Node* context, Node* value) {
typedef CodeStubAssembler::Label Label;
typedef CodeStubAssembler::Variable Variable;
Label end(this);
Variable var_result(this, MachineRepresentation::kTagged);
@ -4443,10 +4447,11 @@ void CodeStubAssembler::TryLookupProperty(
}
}
void CodeStubAssembler::TryHasOwnProperty(Node* object, Node* map,
Node* instance_type,
Node* unique_name, Label* if_found,
Label* if_not_found,
void CodeStubAssembler::TryHasOwnProperty(compiler::Node* object,
compiler::Node* map,
compiler::Node* instance_type,
compiler::Node* unique_name,
Label* if_found, Label* if_not_found,
Label* if_bailout) {
Comment("TryHasOwnProperty");
Variable var_meta_storage(this, MachineRepresentation::kTagged);
@ -5078,10 +5083,10 @@ Node* CodeStubAssembler::OrdinaryHasInstance(Node* context, Node* callable,
return var_result.value();
}
Node* CodeStubAssembler::ElementOffsetFromIndex(Node* index_node,
ElementsKind kind,
ParameterMode mode,
int base_size) {
compiler::Node* CodeStubAssembler::ElementOffsetFromIndex(Node* index_node,
ElementsKind kind,
ParameterMode mode,
int base_size) {
int element_size_shift = ElementsKindToShiftSize(kind);
int element_size = 1 << element_size_shift;
int const kSmiShiftBits = kSmiShiftSize + kSmiTagSize;
@ -5117,16 +5122,16 @@ Node* CodeStubAssembler::ElementOffsetFromIndex(Node* index_node,
return IntPtrAddFoldConstants(IntPtrConstant(base_size), shifted_index);
}
Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() {
compiler::Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() {
Node* function =
LoadFromParentFrame(JavaScriptFrameConstants::kFunctionOffset);
Node* literals = LoadObjectField(function, JSFunction::kLiteralsOffset);
return LoadObjectField(literals, LiteralsArray::kFeedbackVectorOffset);
}
void CodeStubAssembler::UpdateFeedback(Node* feedback,
Node* type_feedback_vector,
Node* slot_id) {
void CodeStubAssembler::UpdateFeedback(compiler::Node* feedback,
compiler::Node* type_feedback_vector,
compiler::Node* slot_id) {
// This method is used for binary op and compare feedback. These
// vector nodes are initialized with a smi 0, so we can simply OR
// our new feedback in place.
@ -5139,7 +5144,7 @@ void CodeStubAssembler::UpdateFeedback(Node* feedback,
SKIP_WRITE_BARRIER);
}
Node* CodeStubAssembler::LoadReceiverMap(Node* receiver) {
compiler::Node* CodeStubAssembler::LoadReceiverMap(compiler::Node* receiver) {
Variable var_receiver_map(this, MachineRepresentation::kTagged);
Label load_smi_map(this, Label::kDeferred), load_receiver_map(this),
if_result(this);
@ -5183,7 +5188,7 @@ Node* CodeStubAssembler::TryToIntptr(Node* key, Label* miss) {
return var_intptr_key.value();
}
void CodeStubAssembler::ExtendPropertiesBackingStore(Node* object) {
void CodeStubAssembler::ExtendPropertiesBackingStore(compiler::Node* object) {
Node* properties = LoadProperties(object);
Node* length = LoadFixedArrayBaseLength(properties);
@ -5637,11 +5642,9 @@ Node* CodeStubAssembler::CopyElementsOnWrite(Node* object, Node* elements,
return new_elements_var.value();
}
void CodeStubAssembler::TransitionElementsKind(Node* object, Node* map,
ElementsKind from_kind,
ElementsKind to_kind,
bool is_jsarray,
Label* bailout) {
void CodeStubAssembler::TransitionElementsKind(
compiler::Node* object, compiler::Node* map, ElementsKind from_kind,
ElementsKind to_kind, bool is_jsarray, Label* bailout) {
DCHECK(!IsFastHoleyElementsKind(from_kind) ||
IsFastHoleyElementsKind(to_kind));
if (AllocationSite::GetMode(from_kind, to_kind) == TRACK_ALLOCATION_SITE) {
@ -5904,10 +5907,11 @@ void CodeStubAssembler::BuildFastLoop(
}
void CodeStubAssembler::BuildFastFixedArrayForEach(
Node* fixed_array, ElementsKind kind, Node* first_element_inclusive,
Node* last_element_exclusive,
std::function<void(CodeStubAssembler* assembler, Node* fixed_array,
Node* offset)>
compiler::Node* fixed_array, ElementsKind kind,
compiler::Node* first_element_inclusive,
compiler::Node* last_element_exclusive,
std::function<void(CodeStubAssembler* assembler,
compiler::Node* fixed_array, compiler::Node* offset)>
body,
ParameterMode mode, ForEachDirection direction) {
STATIC_ASSERT(FixedArray::kHeaderSize == FixedDoubleArray::kHeaderSize);
@ -5960,8 +5964,10 @@ void CodeStubAssembler::BuildFastFixedArrayForEach(
}
void CodeStubAssembler::BranchIfNumericRelationalComparison(
RelationalComparisonMode mode, Node* lhs, Node* rhs, Label* if_true,
Label* if_false) {
RelationalComparisonMode mode, compiler::Node* lhs, compiler::Node* rhs,
Label* if_true, Label* if_false) {
typedef compiler::Node Node;
Label end(this);
Variable result(this, MachineRepresentation::kTagged);
@ -6063,16 +6069,19 @@ void CodeStubAssembler::BranchIfNumericRelationalComparison(
}
}
void CodeStubAssembler::GotoUnlessNumberLessThan(Node* lhs, Node* rhs,
void CodeStubAssembler::GotoUnlessNumberLessThan(compiler::Node* lhs,
compiler::Node* rhs,
Label* if_false) {
Label if_true(this);
BranchIfNumericRelationalComparison(kLessThan, lhs, rhs, &if_true, if_false);
Bind(&if_true);
}
Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
Node* lhs, Node* rhs,
Node* context) {
compiler::Node* CodeStubAssembler::RelationalComparison(
RelationalComparisonMode mode, compiler::Node* lhs, compiler::Node* rhs,
compiler::Node* context) {
typedef compiler::Node Node;
Label return_true(this), return_false(this), end(this);
Variable result(this, MachineRepresentation::kTagged);
@ -6393,7 +6402,7 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
namespace {
void GenerateEqual_Same(CodeStubAssembler* assembler, Node* value,
void GenerateEqual_Same(CodeStubAssembler* assembler, compiler::Node* value,
CodeStubAssembler::Label* if_equal,
CodeStubAssembler::Label* if_notequal) {
// In case of abstract or strict equality checks, we need additional checks
@ -6403,6 +6412,7 @@ void GenerateEqual_Same(CodeStubAssembler* assembler, Node* value,
// seems to be what is tested in the current SIMD.js testsuite.
typedef CodeStubAssembler::Label Label;
typedef compiler::Node Node;
// Check if {value} is a Smi or a HeapObject.
Label if_valueissmi(assembler), if_valueisnotsmi(assembler);
@ -6437,9 +6447,9 @@ void GenerateEqual_Same(CodeStubAssembler* assembler, Node* value,
}
void GenerateEqual_Simd128Value_HeapObject(
CodeStubAssembler* assembler, Node* lhs, Node* lhs_map, Node* rhs,
Node* rhs_map, CodeStubAssembler::Label* if_equal,
CodeStubAssembler::Label* if_notequal) {
CodeStubAssembler* assembler, compiler::Node* lhs, compiler::Node* lhs_map,
compiler::Node* rhs, compiler::Node* rhs_map,
CodeStubAssembler::Label* if_equal, CodeStubAssembler::Label* if_notequal) {
assembler->BranchIfSimd128Equal(lhs, lhs_map, rhs, rhs_map, if_equal,
if_notequal);
}
@ -6447,12 +6457,14 @@ void GenerateEqual_Simd128Value_HeapObject(
} // namespace
// ES6 section 7.2.12 Abstract Equality Comparison
Node* CodeStubAssembler::Equal(ResultMode mode, Node* lhs, Node* rhs,
Node* context) {
compiler::Node* CodeStubAssembler::Equal(ResultMode mode, compiler::Node* lhs,
compiler::Node* rhs,
compiler::Node* context) {
// This is a slightly optimized version of Object::Equals represented as
// scheduled TurboFan graph utilizing the CodeStubAssembler. Whenever you
// change something functionality wise in here, remember to update the
// Object::Equals method as well.
typedef compiler::Node Node;
Label if_equal(this), if_notequal(this),
do_rhsstringtonumber(this, Label::kDeferred), end(this);
@ -6946,8 +6958,10 @@ Node* CodeStubAssembler::Equal(ResultMode mode, Node* lhs, Node* rhs,
return result.value();
}
Node* CodeStubAssembler::StrictEqual(ResultMode mode, Node* lhs, Node* rhs,
Node* context) {
compiler::Node* CodeStubAssembler::StrictEqual(ResultMode mode,
compiler::Node* lhs,
compiler::Node* rhs,
compiler::Node* context) {
// Here's pseudo-code for the algorithm below in case of kDontNegateResult
// mode; for kNegateResult mode we properly negate the result.
//
@ -6996,6 +7010,8 @@ Node* CodeStubAssembler::StrictEqual(ResultMode mode, Node* lhs, Node* rhs,
// }
// }
typedef compiler::Node Node;
Label if_equal(this), if_notequal(this), end(this);
Variable result(this, MachineRepresentation::kTagged);
@ -7197,7 +7213,9 @@ Node* CodeStubAssembler::StrictEqual(ResultMode mode, Node* lhs, Node* rhs,
// ECMA#sec-samevalue
// This algorithm differs from the Strict Equality Comparison Algorithm in its
// treatment of signed zeroes and NaNs.
Node* CodeStubAssembler::SameValue(Node* lhs, Node* rhs, Node* context) {
compiler::Node* CodeStubAssembler::SameValue(compiler::Node* lhs,
compiler::Node* rhs,
compiler::Node* context) {
Variable var_result(this, MachineType::PointerRepresentation());
Label strict_equal(this), out(this);
@ -7281,7 +7299,9 @@ Node* CodeStubAssembler::SameValue(Node* lhs, Node* rhs, Node* context) {
return var_result.value();
}
Node* CodeStubAssembler::ForInFilter(Node* key, Node* object, Node* context) {
compiler::Node* CodeStubAssembler::ForInFilter(compiler::Node* key,
compiler::Node* object,
compiler::Node* context) {
Label return_undefined(this, Label::kDeferred), return_to_name(this),
end(this);
@ -7309,9 +7329,13 @@ Node* CodeStubAssembler::ForInFilter(Node* key, Node* object, Node* context) {
return var_result.value();
}
Node* CodeStubAssembler::HasProperty(
Node* object, Node* key, Node* context,
compiler::Node* CodeStubAssembler::HasProperty(
compiler::Node* object, compiler::Node* key, compiler::Node* context,
Runtime::FunctionId fallback_runtime_function_id) {
typedef compiler::Node Node;
typedef CodeStubAssembler::Label Label;
typedef CodeStubAssembler::Variable Variable;
Label call_runtime(this, Label::kDeferred), return_true(this),
return_false(this), end(this);
@ -7359,7 +7383,8 @@ Node* CodeStubAssembler::HasProperty(
return result.value();
}
Node* CodeStubAssembler::Typeof(Node* value, Node* context) {
compiler::Node* CodeStubAssembler::Typeof(compiler::Node* value,
compiler::Node* context) {
Variable result_var(this, MachineRepresentation::kTagged);
Label return_number(this, Label::kDeferred), if_oddball(this),
@ -7452,8 +7477,9 @@ Node* CodeStubAssembler::Typeof(Node* value, Node* context) {
return result_var.value();
}
Node* CodeStubAssembler::InstanceOf(Node* object, Node* callable,
Node* context) {
compiler::Node* CodeStubAssembler::InstanceOf(compiler::Node* object,
compiler::Node* callable,
compiler::Node* context) {
Label return_runtime(this, Label::kDeferred), end(this);
Variable result(this, MachineRepresentation::kTagged);
@ -7483,7 +7509,7 @@ Node* CodeStubAssembler::InstanceOf(Node* object, Node* callable,
return result.value();
}
Node* CodeStubAssembler::NumberInc(Node* value) {
compiler::Node* CodeStubAssembler::NumberInc(compiler::Node* value) {
Variable var_result(this, MachineRepresentation::kTagged),
var_finc_value(this, MachineRepresentation::kFloat64);
Label if_issmi(this), if_isnotsmi(this), do_finc(this), end(this);
@ -7535,9 +7561,9 @@ Node* CodeStubAssembler::NumberInc(Node* value) {
return var_result.value();
}
Node* CodeStubAssembler::CreateArrayIterator(Node* array, Node* array_map,
Node* array_type, Node* context,
IterationKind mode) {
compiler::Node* CodeStubAssembler::CreateArrayIterator(
compiler::Node* array, compiler::Node* array_map,
compiler::Node* array_type, compiler::Node* context, IterationKind mode) {
int kBaseMapIndex = 0;
switch (mode) {
case IterationKind::kKeys:
@ -7723,8 +7749,8 @@ Node* CodeStubAssembler::CreateArrayIterator(Node* array, Node* array_map,
return var_result.value();
}
Node* CodeStubAssembler::AllocateJSArrayIterator(Node* array, Node* array_map,
Node* map) {
compiler::Node* CodeStubAssembler::AllocateJSArrayIterator(
compiler::Node* array, compiler::Node* array_map, compiler::Node* map) {
Node* iterator = Allocate(JSArrayIterator::kSize);
StoreMapNoWriteBarrier(iterator, map);
StoreObjectFieldRoot(iterator, JSArrayIterator::kPropertiesOffset,
@ -7740,7 +7766,7 @@ Node* CodeStubAssembler::AllocateJSArrayIterator(Node* array, Node* array_map,
return iterator;
}
Node* CodeStubAssembler::IsDetachedBuffer(Node* buffer) {
compiler::Node* CodeStubAssembler::IsDetachedBuffer(compiler::Node* buffer) {
CSA_ASSERT(this, HasInstanceType(buffer, JS_ARRAY_BUFFER_TYPE));
Node* buffer_bit_field = LoadObjectField(
@ -7751,13 +7777,14 @@ Node* CodeStubAssembler::IsDetachedBuffer(Node* buffer) {
Int32Constant(0));
}
CodeStubArguments::CodeStubArguments(CodeStubAssembler* assembler, Node* argc,
CodeStubArguments::CodeStubArguments(CodeStubAssembler* assembler,
compiler::Node* argc,
CodeStubAssembler::ParameterMode mode)
: assembler_(assembler),
argc_(argc),
arguments_(nullptr),
fp_(assembler->LoadFramePointer()) {
Node* offset = assembler->ElementOffsetFromIndex(
compiler::Node* offset = assembler->ElementOffsetFromIndex(
argc_, FAST_ELEMENTS, mode,
(StandardFrameConstants::kFixedSlotCountAboveFp - 1) * kPointerSize);
arguments_ = assembler_->IntPtrAddFoldConstants(fp_, offset);
@ -7768,13 +7795,14 @@ CodeStubArguments::CodeStubArguments(CodeStubAssembler* assembler, Node* argc,
}
}
Node* CodeStubArguments::GetReceiver() {
compiler::Node* CodeStubArguments::GetReceiver() {
return assembler_->Load(MachineType::AnyTagged(), arguments_,
assembler_->IntPtrConstant(kPointerSize));
}
Node* CodeStubArguments::AtIndex(Node* index,
CodeStubAssembler::ParameterMode mode) {
compiler::Node* CodeStubArguments::AtIndex(
compiler::Node* index, CodeStubAssembler::ParameterMode mode) {
typedef compiler::Node Node;
Node* negated_index = assembler_->IntPtrSubFoldConstants(
assembler_->IntPtrOrSmiConstant(0, mode), index);
Node* offset =
@ -7782,13 +7810,13 @@ Node* CodeStubArguments::AtIndex(Node* index,
return assembler_->Load(MachineType::AnyTagged(), arguments_, offset);
}
Node* CodeStubArguments::AtIndex(int index) {
compiler::Node* CodeStubArguments::AtIndex(int index) {
return AtIndex(assembler_->IntPtrConstant(index));
}
void CodeStubArguments::ForEach(const CodeStubAssembler::VariableList& vars,
CodeStubArguments::ForEachBodyFunction body,
Node* first, Node* last,
compiler::Node* first, compiler::Node* last,
CodeStubAssembler::ParameterMode mode) {
assembler_->Comment("CodeStubArguments::ForEach");
DCHECK_IMPLIES(first == nullptr || last == nullptr,
@ -7799,33 +7827,35 @@ void CodeStubArguments::ForEach(const CodeStubAssembler::VariableList& vars,
if (last == nullptr) {
last = argc_;
}
Node* start = assembler_->IntPtrSubFoldConstants(
compiler::Node* start = assembler_->IntPtrSubFoldConstants(
arguments_,
assembler_->ElementOffsetFromIndex(first, FAST_ELEMENTS, mode));
Node* end = assembler_->IntPtrSubFoldConstants(
compiler::Node* end = assembler_->IntPtrSubFoldConstants(
arguments_,
assembler_->ElementOffsetFromIndex(last, FAST_ELEMENTS, mode));
assembler_->BuildFastLoop(
vars, MachineType::PointerRepresentation(), start, end,
[body](CodeStubAssembler* assembler, Node* current) {
[body](CodeStubAssembler* assembler, compiler::Node* current) {
Node* arg = assembler->Load(MachineType::AnyTagged(), current);
body(assembler, arg);
},
-kPointerSize, CodeStubAssembler::IndexAdvanceMode::kPost);
}
void CodeStubArguments::PopAndReturn(Node* value) {
void CodeStubArguments::PopAndReturn(compiler::Node* value) {
assembler_->PopAndReturn(
assembler_->IntPtrAddFoldConstants(argc_, assembler_->IntPtrConstant(1)),
value);
}
Node* CodeStubAssembler::IsFastElementsKind(Node* elements_kind) {
compiler::Node* CodeStubAssembler::IsFastElementsKind(
compiler::Node* elements_kind) {
return Uint32LessThanOrEqual(elements_kind,
Int32Constant(LAST_FAST_ELEMENTS_KIND));
}
Node* CodeStubAssembler::IsHoleyFastElementsKind(Node* elements_kind) {
compiler::Node* CodeStubAssembler::IsHoleyFastElementsKind(
compiler::Node* elements_kind) {
CSA_ASSERT(this, IsFastElementsKind(elements_kind));
STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == (FAST_SMI_ELEMENTS | 1));

File diff suppressed because it is too large Load Diff